@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.
- package/README.md +65 -2
- package/action.yml +1 -1
- package/defaults/code-refiner.yaml +114 -0
- package/defaults/{.visor.yaml → code-review.yaml} +35 -226
- package/defaults/override.yaml +52 -0
- package/defaults/task-refinement.yaml +620 -0
- package/defaults/visor.tests.yaml +674 -0
- package/defaults/visor.yaml +482 -0
- package/dist/663.index.js +2 -3
- package/dist/80.index.js +2 -3
- package/dist/action-cli-bridge.d.ts +11 -82
- package/dist/action-cli-bridge.d.ts.map +1 -1
- package/dist/ai-review-service.d.ts +15 -0
- package/dist/ai-review-service.d.ts.map +1 -1
- package/dist/check-execution-engine.d.ts +19 -331
- package/dist/check-execution-engine.d.ts.map +1 -1
- package/dist/cli-main.d.ts.map +1 -1
- package/dist/cli.d.ts +0 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/config.d.ts +16 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/cron-scheduler.d.ts +3 -3
- package/dist/cron-scheduler.d.ts.map +1 -1
- package/dist/debug-visualizer/ws-server.d.ts.map +1 -1
- package/dist/defaults/code-refiner.yaml +114 -0
- package/dist/defaults/{.visor.yaml → code-review.yaml} +35 -226
- package/dist/defaults/override.yaml +52 -0
- package/dist/defaults/task-refinement.yaml +620 -0
- package/dist/defaults/visor.tests.yaml +674 -0
- package/dist/defaults/visor.yaml +482 -0
- package/dist/docs/DEPLOYMENT.md +118 -0
- package/dist/docs/GITHUB_CHECKS.md +280 -0
- package/dist/docs/NPM_USAGE.md +208 -0
- package/dist/docs/action-reference.md +19 -0
- package/dist/docs/advanced-ai.md +178 -0
- package/dist/docs/ai-configuration.md +468 -0
- package/dist/docs/author-permissions.md +610 -0
- package/dist/docs/ci-cli-mode.md +34 -0
- package/dist/docs/claude-code.md +74 -0
- package/dist/docs/command-provider.md +559 -0
- package/dist/docs/commands.md +8 -0
- package/dist/docs/configuration.md +303 -0
- package/dist/docs/custom-tools.md +424 -0
- package/dist/docs/dashboards/README.md +23 -0
- package/dist/docs/dashboards/grafana-visor-diagrams.json +20 -0
- package/dist/docs/dashboards/grafana-visor-overview.json +33 -0
- package/dist/docs/debug-visualizer-progress.md +572 -0
- package/dist/docs/debug-visualizer-rfc.md +691 -0
- package/dist/docs/debug-visualizer.md +114 -0
- package/dist/docs/debugging.md +636 -0
- package/dist/docs/default-output-schema.md +28 -0
- package/dist/docs/dependencies.md +369 -0
- package/dist/docs/dev-playbook.md +9 -0
- package/dist/docs/engine-state-machine-plan.md +333 -0
- package/dist/docs/event-driven-github-integration-rfc.md +743 -0
- package/dist/docs/event-triggers.md +292 -0
- package/dist/docs/execution-statistics-rfc.md +290 -0
- package/dist/docs/fact-validator-gap-analysis.md +178 -0
- package/dist/docs/fact-validator-implementation-plan.md +1235 -0
- package/dist/docs/fail-if.md +95 -0
- package/dist/docs/failure-conditions-implementation.md +271 -0
- package/dist/docs/failure-conditions-schema.md +173 -0
- package/dist/docs/failure-routing-rfc.md +193 -0
- package/dist/docs/failure-routing.md +507 -0
- package/dist/docs/foreach-dependency-propagation.md +473 -0
- package/dist/docs/github-ops.md +89 -0
- package/dist/docs/goto-forward-run-plan.md +113 -0
- package/dist/docs/guides/criticality-modes.md +332 -0
- package/dist/docs/guides/fault-management-and-contracts.md +738 -0
- package/dist/docs/guides/workflow-style-guide.md +224 -0
- package/dist/docs/http.md +299 -0
- package/dist/docs/human-input-provider.md +372 -0
- package/dist/docs/limits.md +64 -0
- package/dist/docs/liquid-templates.md +347 -0
- package/dist/docs/loop-routing-refactor.md +89 -0
- package/dist/docs/mcp-provider.md +557 -0
- package/dist/docs/mcp.md +124 -0
- package/dist/docs/memory.md +903 -0
- package/dist/docs/observability.md +12 -0
- package/dist/docs/output-formats.md +20 -0
- package/dist/docs/output-formatting.md +29 -0
- package/dist/docs/output-history.md +383 -0
- package/dist/docs/performance.md +6 -0
- package/dist/docs/pluggable.md +124 -0
- package/dist/docs/proposals/snapshot-scope-execution.md +236 -0
- package/dist/docs/recipes.md +21 -0
- package/dist/docs/roadmap/criticality-implementation-tasks.md +92 -0
- package/dist/docs/schema-next-pr.md +10 -0
- package/dist/docs/schema-templates.md +68 -0
- package/dist/docs/script.md +34 -0
- package/dist/docs/sdk.md +222 -0
- package/dist/docs/security.md +7 -0
- package/dist/docs/suppressions.md +89 -0
- package/dist/docs/tag-filtering.md +258 -0
- package/dist/docs/telemetry-setup.md +119 -0
- package/dist/docs/telemetry-tracing-rfc.md +275 -0
- package/dist/docs/test-framework-rfc.md +680 -0
- package/dist/docs/testing/assertions.md +85 -0
- package/dist/docs/testing/ci.md +44 -0
- package/dist/docs/testing/cli.md +41 -0
- package/dist/docs/testing/cookbook.md +172 -0
- package/dist/docs/testing/dsl-reference.md +199 -0
- package/dist/docs/testing/fixtures-and-mocks.md +91 -0
- package/dist/docs/testing/flows.md +92 -0
- package/dist/docs/testing/getting-started.md +93 -0
- package/dist/docs/testing/troubleshooting.md +55 -0
- package/dist/docs/timeouts.md +50 -0
- package/dist/docs/troubleshooting.md +7 -0
- package/dist/docs/visor-sdk-rfc.md +186 -0
- package/dist/docs/workflows.md +569 -0
- package/dist/engine/on-finish/orchestrator.d.ts +19 -0
- package/dist/engine/on-finish/orchestrator.d.ts.map +1 -0
- package/dist/engine/on-finish/utils.d.ts +44 -0
- package/dist/engine/on-finish/utils.d.ts.map +1 -0
- package/dist/event-bus/event-bus.d.ts +13 -0
- package/dist/event-bus/event-bus.d.ts.map +1 -0
- package/dist/event-bus/types.d.ts +57 -0
- package/dist/event-bus/types.d.ts.map +1 -0
- package/dist/examples/.claude/agents/code-reviewer.md +69 -0
- package/dist/examples/.mcp.json +34 -0
- package/dist/examples/CALCULATOR-SDK.md +364 -0
- package/dist/examples/README.md +384 -0
- package/dist/examples/ai-retry-fallback-config.yaml +180 -0
- package/dist/examples/ai-with-bash.yaml +126 -0
- package/dist/examples/ai-with-mcp.yaml +82 -0
- package/dist/examples/basic-human-input.yaml +15 -0
- package/dist/examples/bedrock-config.yaml +77 -0
- package/dist/examples/calculator-config.yaml +133 -0
- package/dist/examples/calculator-json-output-guide.md +311 -0
- package/dist/examples/calculator-sdk-automated.ts +340 -0
- package/dist/examples/calculator-sdk-example.ts +275 -0
- package/dist/examples/calculator-sdk-json.ts +331 -0
- package/dist/examples/calculator-sdk-real.ts +374 -0
- package/dist/examples/calculator-sdk-test.ts +148 -0
- package/dist/examples/claude-code-config.yaml +191 -0
- package/dist/examples/cron-webhook-config.yaml +215 -0
- package/dist/examples/custom-template.liquid +57 -0
- package/dist/examples/custom-tools-example.yaml +281 -0
- package/dist/examples/enhanced-config.yaml +165 -0
- package/dist/examples/environments/visor.base.yaml +92 -0
- package/dist/examples/environments/visor.dev.yaml +33 -0
- package/dist/examples/environments/visor.prod.yaml +95 -0
- package/dist/examples/environments/visor.staging.yaml +46 -0
- package/dist/examples/fact-validator.yaml +361 -0
- package/dist/examples/fail-if-simple.yaml +90 -0
- package/dist/examples/failure-conditions-advanced.yaml +136 -0
- package/dist/examples/failure-conditions-basic.yaml +48 -0
- package/dist/examples/failure-conditions-github-style.yaml +119 -0
- package/dist/examples/failure-conditions-migration.yaml +74 -0
- package/dist/examples/for-loop-example.yaml +176 -0
- package/dist/examples/forEach-example.yaml +120 -0
- package/dist/examples/github-workflow-with-tags.yml +163 -0
- package/dist/examples/http-integration-config.yaml +240 -0
- package/dist/examples/https-server-config.yaml +209 -0
- package/dist/examples/human-input-example.yaml +63 -0
- package/dist/examples/if-conditions.yaml +173 -0
- package/dist/examples/jira-simple-example.yaml +56 -0
- package/dist/examples/jira-single-issue-workflow.yaml +166 -0
- package/dist/examples/jira-workflow-mcp.yaml +182 -0
- package/dist/examples/mcp/analyzer.py +119 -0
- package/dist/examples/mcp-provider-example.yaml +301 -0
- package/dist/examples/memory-counter.yaml +99 -0
- package/dist/examples/memory-error-collection.yaml +104 -0
- package/dist/examples/memory-exec-js.yaml +247 -0
- package/dist/examples/memory-namespace-isolation.yaml +184 -0
- package/dist/examples/memory-retry-counter.yaml +65 -0
- package/dist/examples/memory-state-machine.yaml +170 -0
- package/dist/examples/outputs-raw-basic.yaml +26 -0
- package/dist/examples/project-with-tools.yaml +174 -0
- package/dist/examples/prompts/architecture-analysis.liquid +116 -0
- package/dist/examples/prompts/security-comprehensive.liquid +107 -0
- package/dist/examples/quick-start-tags.yaml +53 -0
- package/dist/examples/routing-basic.yaml +35 -0
- package/dist/examples/routing-dynamic-js.yaml +46 -0
- package/dist/examples/routing-foreach.yaml +34 -0
- package/dist/examples/routing-goto-event.yaml +34 -0
- package/dist/examples/routing-on-success.yaml +25 -0
- package/dist/examples/run-calculator-demo.sh +71 -0
- package/dist/examples/sdk-basic.mjs +10 -0
- package/dist/examples/sdk-cjs.cjs +10 -0
- package/dist/examples/sdk-comprehensive.mjs +175 -0
- package/dist/examples/sdk-manual-config.mjs +65 -0
- package/dist/examples/sdk-typescript.js +81 -0
- package/dist/examples/sdk-typescript.ts +92 -0
- package/dist/examples/session-reuse-config.yaml +151 -0
- package/dist/examples/templates/security-report.liquid +137 -0
- package/dist/examples/tools-library.yaml +281 -0
- package/dist/examples/transform-example.yaml +199 -0
- package/dist/examples/visor-with-tags.yaml +198 -0
- package/dist/examples/webhook-pipeline-config.yaml +218 -0
- package/dist/examples/workflows/calculator-workflow.yaml +163 -0
- package/dist/examples/workflows/code-quality.yaml +222 -0
- package/dist/examples/workflows/quick-pr-check.yaml +90 -0
- package/dist/examples/workflows/workflow-composition-example.yaml +130 -0
- package/dist/failure-condition-evaluator.d.ts +1 -0
- package/dist/failure-condition-evaluator.d.ts.map +1 -1
- package/dist/frontends/github-frontend.d.ts +38 -0
- package/dist/frontends/github-frontend.d.ts.map +1 -0
- package/dist/frontends/host.d.ts +43 -0
- package/dist/frontends/host.d.ts.map +1 -0
- package/dist/frontends/ndjson-sink.d.ts +12 -0
- package/dist/frontends/ndjson-sink.d.ts.map +1 -0
- package/dist/generated/config-schema.d.ts +564 -22
- package/dist/generated/config-schema.d.ts.map +1 -1
- package/dist/generated/config-schema.json +612 -24
- package/dist/github-check-service.d.ts +4 -6
- package/dist/github-check-service.d.ts.map +1 -1
- package/dist/github-comments.d.ts +0 -4
- package/dist/github-comments.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +70335 -62514
- package/dist/liquid-extensions.d.ts.map +1 -1
- package/dist/logger.d.ts +1 -0
- package/dist/logger.d.ts.map +1 -1
- package/dist/memory-store.d.ts +6 -0
- package/dist/memory-store.d.ts.map +1 -1
- package/dist/output/assistant-json/template.liquid +0 -0
- package/dist/output/traces/run-2025-11-21T11-50-46-505Z.ndjson +138 -0
- package/dist/output/traces/run-2025-11-21T11-51-33-674Z.ndjson +839 -0
- package/dist/output-formatters.d.ts +1 -1
- package/dist/output-formatters.d.ts.map +1 -1
- package/dist/providers/ai-check-provider.d.ts.map +1 -1
- package/dist/providers/check-provider-registry.d.ts +6 -0
- package/dist/providers/check-provider-registry.d.ts.map +1 -1
- package/dist/providers/check-provider.interface.d.ts +34 -1
- package/dist/providers/check-provider.interface.d.ts.map +1 -1
- package/dist/providers/claude-code-check-provider.d.ts.map +1 -1
- package/dist/providers/command-check-provider.d.ts +1 -1
- package/dist/providers/command-check-provider.d.ts.map +1 -1
- package/dist/providers/custom-tool-executor.d.ts +61 -0
- package/dist/providers/custom-tool-executor.d.ts.map +1 -0
- package/dist/providers/github-ops-provider.d.ts.map +1 -1
- package/dist/providers/http-client-provider.d.ts +1 -4
- package/dist/providers/http-client-provider.d.ts.map +1 -1
- package/dist/providers/human-input-check-provider.d.ts +3 -0
- package/dist/providers/human-input-check-provider.d.ts.map +1 -1
- package/dist/providers/index.d.ts +1 -0
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/log-check-provider.d.ts +2 -5
- package/dist/providers/log-check-provider.d.ts.map +1 -1
- package/dist/providers/mcp-check-provider.d.ts +9 -3
- package/dist/providers/mcp-check-provider.d.ts.map +1 -1
- package/dist/providers/memory-check-provider.d.ts +2 -8
- package/dist/providers/memory-check-provider.d.ts.map +1 -1
- package/dist/providers/script-check-provider.d.ts +25 -0
- package/dist/providers/script-check-provider.d.ts.map +1 -0
- package/dist/providers/workflow-check-provider.d.ts +56 -0
- package/dist/providers/workflow-check-provider.d.ts.map +1 -0
- package/dist/reviewer.d.ts +2 -1
- package/dist/reviewer.d.ts.map +1 -1
- package/dist/sdk/chunk-37ZSCMFC.mjs +482 -0
- package/dist/sdk/chunk-37ZSCMFC.mjs.map +1 -0
- package/dist/sdk/chunk-6Y4YTKCF.mjs +197 -0
- package/dist/sdk/chunk-6Y4YTKCF.mjs.map +1 -0
- package/dist/sdk/chunk-CNX7V5JK.mjs +89 -0
- package/dist/sdk/chunk-CNX7V5JK.mjs.map +1 -0
- package/dist/sdk/chunk-IEO6CFLG.mjs +1215 -0
- package/dist/sdk/chunk-IEO6CFLG.mjs.map +1 -0
- package/dist/sdk/chunk-JEHPDJIF.mjs +223 -0
- package/dist/sdk/chunk-JEHPDJIF.mjs.map +1 -0
- package/dist/sdk/chunk-O5EZDNYL.mjs +274 -0
- package/dist/sdk/chunk-O5EZDNYL.mjs.map +1 -0
- package/dist/sdk/{chunk-TUTOLSFV.mjs → chunk-OOZITMRU.mjs} +1 -1
- package/dist/sdk/chunk-OOZITMRU.mjs.map +1 -0
- package/dist/sdk/chunk-OWUVOILT.mjs +557 -0
- package/dist/sdk/chunk-OWUVOILT.mjs.map +1 -0
- package/dist/sdk/chunk-OZJ263FM.mjs +986 -0
- package/dist/sdk/chunk-OZJ263FM.mjs.map +1 -0
- package/dist/sdk/chunk-PTL3K3PN.mjs +3128 -0
- package/dist/sdk/chunk-PTL3K3PN.mjs.map +1 -0
- package/dist/sdk/chunk-S2RUE2RG.mjs +145 -0
- package/dist/sdk/chunk-S2RUE2RG.mjs.map +1 -0
- package/dist/sdk/chunk-VMPLF6FT.mjs +127 -0
- package/dist/sdk/chunk-VMPLF6FT.mjs.map +1 -0
- package/dist/sdk/chunk-YSN4G6CI.mjs +146 -0
- package/dist/sdk/chunk-YSN4G6CI.mjs.map +1 -0
- package/dist/sdk/chunk-ZYAUYXSW.mjs +206 -0
- package/dist/sdk/chunk-ZYAUYXSW.mjs.map +1 -0
- package/dist/sdk/config-M4ZNO6NU.mjs +14 -0
- package/dist/sdk/config-merger-PX3WIT57.mjs +10 -0
- package/dist/sdk/event-bus-5BEVPQ6T.mjs +35 -0
- package/dist/sdk/event-bus-5BEVPQ6T.mjs.map +1 -0
- package/dist/sdk/failure-condition-evaluator-NBO5YRXW.mjs +16 -0
- package/dist/sdk/git-repository-analyzer-HJC4MYW4.mjs +458 -0
- package/dist/sdk/git-repository-analyzer-HJC4MYW4.mjs.map +1 -0
- package/dist/sdk/github-frontend-4AWRJT7D.mjs +1242 -0
- package/dist/sdk/github-frontend-4AWRJT7D.mjs.map +1 -0
- package/dist/sdk/host-7GBC3S7L.mjs +49 -0
- package/dist/sdk/host-7GBC3S7L.mjs.map +1 -0
- package/dist/sdk/{liquid-extensions-KVL4MKRH.mjs → liquid-extensions-C7EG3YKH.mjs} +7 -2
- package/dist/sdk/memory-store-GJACZC2A.mjs +11 -0
- package/dist/sdk/metrics-7PP3EJUH.mjs +29 -0
- package/dist/sdk/ndjson-sink-B4V4NTAQ.mjs +44 -0
- package/dist/sdk/ndjson-sink-B4V4NTAQ.mjs.map +1 -0
- package/dist/sdk/renderer-schema-6RF26VUS.mjs +50 -0
- package/dist/sdk/renderer-schema-6RF26VUS.mjs.map +1 -0
- package/dist/sdk/routing-RP56JTV2.mjs +23 -0
- package/dist/sdk/routing-RP56JTV2.mjs.map +1 -0
- package/dist/sdk/sdk.d.mts +326 -21
- package/dist/sdk/sdk.d.ts +326 -21
- package/dist/sdk/sdk.js +21403 -16366
- package/dist/sdk/sdk.js.map +1 -1
- package/dist/sdk/sdk.mjs +13510 -2096
- package/dist/sdk/sdk.mjs.map +1 -1
- package/dist/sdk/session-registry-N5FFYFTM.mjs +10 -0
- package/dist/sdk/session-registry-N5FFYFTM.mjs.map +1 -0
- package/dist/sdk/trace-helpers-VP6QYVBX.mjs +23 -0
- package/dist/sdk/trace-helpers-VP6QYVBX.mjs.map +1 -0
- package/dist/sdk/{tracer-init-WC75N5NW.mjs → tracer-init-WP4X46IF.mjs} +2 -2
- package/dist/sdk/tracer-init-WP4X46IF.mjs.map +1 -0
- package/dist/sdk/workflow-registry-2YIIXQCK.mjs +11 -0
- package/dist/sdk/workflow-registry-2YIIXQCK.mjs.map +1 -0
- package/dist/sdk.d.ts.map +1 -1
- package/dist/snapshot-store.d.ts +59 -0
- package/dist/snapshot-store.d.ts.map +1 -0
- package/dist/state-machine/context/build-engine-context.d.ts +9 -0
- package/dist/state-machine/context/build-engine-context.d.ts.map +1 -0
- package/dist/state-machine/dispatch/dependency-gating.d.ts +12 -0
- package/dist/state-machine/dispatch/dependency-gating.d.ts.map +1 -0
- package/dist/state-machine/dispatch/execution-invoker.d.ts +14 -0
- package/dist/state-machine/dispatch/execution-invoker.d.ts.map +1 -0
- package/dist/state-machine/dispatch/foreach-processor.d.ts +8 -0
- package/dist/state-machine/dispatch/foreach-processor.d.ts.map +1 -0
- package/dist/state-machine/dispatch/history-snapshot.d.ts +8 -0
- package/dist/state-machine/dispatch/history-snapshot.d.ts.map +1 -0
- package/dist/state-machine/dispatch/renderer-schema.d.ts +8 -0
- package/dist/state-machine/dispatch/renderer-schema.d.ts.map +1 -0
- package/dist/state-machine/dispatch/stats-manager.d.ts +15 -0
- package/dist/state-machine/dispatch/stats-manager.d.ts.map +1 -0
- package/dist/state-machine/dispatch/template-renderer.d.ts +7 -0
- package/dist/state-machine/dispatch/template-renderer.d.ts.map +1 -0
- package/dist/state-machine/execution/summary.d.ts +8 -0
- package/dist/state-machine/execution/summary.d.ts.map +1 -0
- package/dist/state-machine/runner.d.ts +73 -0
- package/dist/state-machine/runner.d.ts.map +1 -0
- package/dist/state-machine/states/check-running.d.ts +14 -0
- package/dist/state-machine/states/check-running.d.ts.map +1 -0
- package/dist/state-machine/states/completed.d.ts +12 -0
- package/dist/state-machine/states/completed.d.ts.map +1 -0
- package/dist/state-machine/states/error.d.ts +11 -0
- package/dist/state-machine/states/error.d.ts.map +1 -0
- package/dist/state-machine/states/init.d.ts +11 -0
- package/dist/state-machine/states/init.d.ts.map +1 -0
- package/dist/state-machine/states/level-dispatch.d.ts +17 -0
- package/dist/state-machine/states/level-dispatch.d.ts.map +1 -0
- package/dist/state-machine/states/plan-ready.d.ts +12 -0
- package/dist/state-machine/states/plan-ready.d.ts.map +1 -0
- package/dist/state-machine/states/routing.d.ts +52 -0
- package/dist/state-machine/states/routing.d.ts.map +1 -0
- package/dist/state-machine/states/wave-planning.d.ts +14 -0
- package/dist/state-machine/states/wave-planning.d.ts.map +1 -0
- package/dist/state-machine/workflow-projection.d.ts +47 -0
- package/dist/state-machine/workflow-projection.d.ts.map +1 -0
- package/dist/state-machine-execution-engine.d.ts +147 -0
- package/dist/state-machine-execution-engine.d.ts.map +1 -0
- package/dist/telemetry/opentelemetry.d.ts.map +1 -1
- package/dist/test-runner/assertions.d.ts +59 -0
- package/dist/test-runner/assertions.d.ts.map +1 -0
- package/dist/test-runner/core/environment.d.ts +8 -0
- package/dist/test-runner/core/environment.d.ts.map +1 -0
- package/dist/test-runner/core/fixture.d.ts +3 -0
- package/dist/test-runner/core/fixture.d.ts.map +1 -0
- package/dist/test-runner/core/flow-stage.d.ts +32 -0
- package/dist/test-runner/core/flow-stage.d.ts.map +1 -0
- package/dist/test-runner/core/mocks.d.ts +8 -0
- package/dist/test-runner/core/mocks.d.ts.map +1 -0
- package/dist/test-runner/core/test-execution-wrapper.d.ts +18 -0
- package/dist/test-runner/core/test-execution-wrapper.d.ts.map +1 -0
- package/dist/test-runner/evaluators.d.ts +12 -0
- package/dist/test-runner/evaluators.d.ts.map +1 -0
- package/dist/test-runner/fixture-loader.d.ts +30 -0
- package/dist/test-runner/fixture-loader.d.ts.map +1 -0
- package/dist/test-runner/index.d.ts +120 -0
- package/dist/test-runner/index.d.ts.map +1 -0
- package/dist/test-runner/recorders/github-recorder.d.ts +23 -0
- package/dist/test-runner/recorders/github-recorder.d.ts.map +1 -0
- package/dist/test-runner/recorders/global-recorder.d.ts +4 -0
- package/dist/test-runner/recorders/global-recorder.d.ts.map +1 -0
- package/dist/test-runner/utils/selectors.d.ts +2 -0
- package/dist/test-runner/utils/selectors.d.ts.map +1 -0
- package/dist/test-runner/validator.d.ts +8 -0
- package/dist/test-runner/validator.d.ts.map +1 -0
- package/dist/traces/run-2025-11-21T11-50-46-505Z.ndjson +138 -0
- package/dist/traces/run-2025-11-21T11-51-33-674Z.ndjson +839 -0
- package/dist/types/cli.d.ts +4 -1
- package/dist/types/cli.d.ts.map +1 -1
- package/dist/types/config.d.ts +278 -5
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/engine.d.ts +172 -0
- package/dist/types/engine.d.ts.map +1 -0
- package/dist/types/execution.d.ts +73 -0
- package/dist/types/execution.d.ts.map +1 -0
- package/dist/types/github.d.ts +51 -0
- package/dist/types/github.d.ts.map +1 -0
- package/dist/types/workflow.d.ts +237 -0
- package/dist/types/workflow.d.ts.map +1 -0
- package/dist/utils/command-executor.d.ts +43 -0
- package/dist/utils/command-executor.d.ts.map +1 -0
- package/dist/utils/comment-metadata.d.ts +21 -0
- package/dist/utils/comment-metadata.d.ts.map +1 -0
- package/dist/utils/config-loader.d.ts.map +1 -1
- package/dist/utils/config-merger.d.ts.map +1 -1
- package/dist/utils/env-exposure.d.ts +3 -0
- package/dist/utils/env-exposure.d.ts.map +1 -0
- package/dist/utils/file-exclusion.d.ts.map +1 -1
- package/dist/utils/interactive-prompt.d.ts +1 -1
- package/dist/utils/interactive-prompt.d.ts.map +1 -1
- package/dist/utils/sandbox.d.ts.map +1 -1
- package/dist/utils/script-memory-ops.d.ts +21 -0
- package/dist/utils/script-memory-ops.d.ts.map +1 -0
- package/dist/utils/template-context.d.ts +7 -0
- package/dist/utils/template-context.d.ts.map +1 -0
- package/dist/webhook-server.d.ts +3 -3
- package/dist/webhook-server.d.ts.map +1 -1
- package/dist/workflow-executor.d.ts +81 -0
- package/dist/workflow-executor.d.ts.map +1 -0
- package/dist/workflow-registry.d.ts +79 -0
- package/dist/workflow-registry.d.ts.map +1 -0
- package/package.json +10 -5
- package/dist/output/traces/run-2025-10-22T18-22-56-873Z.ndjson +0 -218
- package/dist/sdk/check-execution-engine-2YYKUUSH.mjs +0 -11
- package/dist/sdk/check-execution-engine-6QJXYYON.mjs +0 -11
- package/dist/sdk/check-execution-engine-PJZ4ZOKG.mjs +0 -11
- package/dist/sdk/chunk-33QVZ2D4.mjs +0 -316
- package/dist/sdk/chunk-33QVZ2D4.mjs.map +0 -1
- package/dist/sdk/chunk-B5QBV2QJ.mjs +0 -752
- package/dist/sdk/chunk-B5QBV2QJ.mjs.map +0 -1
- package/dist/sdk/chunk-BVFNRCHT.mjs +0 -14129
- package/dist/sdk/chunk-BVFNRCHT.mjs.map +0 -1
- package/dist/sdk/chunk-KWZW23FG.mjs +0 -14129
- package/dist/sdk/chunk-KWZW23FG.mjs.map +0 -1
- package/dist/sdk/chunk-O4RP4BRH.mjs +0 -14092
- package/dist/sdk/chunk-O4RP4BRH.mjs.map +0 -1
- package/dist/sdk/chunk-TUTOLSFV.mjs.map +0 -1
- package/dist/sdk/chunk-U5D2LY66.mjs +0 -245
- package/dist/sdk/chunk-U5D2LY66.mjs.map +0 -1
- package/dist/sdk/chunk-U7X54EMV.mjs +0 -331
- package/dist/sdk/chunk-U7X54EMV.mjs.map +0 -1
- package/dist/sdk/config-merger-TWUBWFC2.mjs +0 -8
- package/dist/sdk/mermaid-telemetry-SN6A2TKW.mjs +0 -61
- package/dist/sdk/mermaid-telemetry-SN6A2TKW.mjs.map +0 -1
- package/dist/sdk/mermaid-telemetry-YCTIG76M.mjs +0 -61
- package/dist/sdk/mermaid-telemetry-YCTIG76M.mjs.map +0 -1
- package/dist/traces/run-2025-10-22T18-22-56-873Z.ndjson +0 -218
- /package/dist/sdk/{check-execution-engine-2YYKUUSH.mjs.map → config-M4ZNO6NU.mjs.map} +0 -0
- /package/dist/sdk/{check-execution-engine-6QJXYYON.mjs.map → config-merger-PX3WIT57.mjs.map} +0 -0
- /package/dist/sdk/{check-execution-engine-PJZ4ZOKG.mjs.map → failure-condition-evaluator-NBO5YRXW.mjs.map} +0 -0
- /package/dist/sdk/{config-merger-TWUBWFC2.mjs.map → liquid-extensions-C7EG3YKH.mjs.map} +0 -0
- /package/dist/sdk/{liquid-extensions-KVL4MKRH.mjs.map → memory-store-GJACZC2A.mjs.map} +0 -0
- /package/dist/sdk/{tracer-init-WC75N5NW.mjs.map → metrics-7PP3EJUH.mjs.map} +0 -0
|
@@ -0,0 +1,569 @@
|
|
|
1
|
+
# Reusable Workflows
|
|
2
|
+
|
|
3
|
+
Visor supports defining reusable workflows that can be used as building blocks in your CI/CD pipeline. Workflows allow you to create modular, parameterized sequences of checks that can be shared across projects and teams.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [Overview](#overview)
|
|
8
|
+
- [Workflow Structure](#workflow-structure)
|
|
9
|
+
- [Input Parameters](#input-parameters)
|
|
10
|
+
- [Output Parameters](#output-parameters)
|
|
11
|
+
- [Using Workflows](#using-workflows)
|
|
12
|
+
- [Advanced Features](#advanced-features)
|
|
13
|
+
- [Examples](#examples)
|
|
14
|
+
- [Best Practices](#best-practices)
|
|
15
|
+
|
|
16
|
+
## Overview
|
|
17
|
+
|
|
18
|
+
Workflows are reusable components that:
|
|
19
|
+
- Accept input parameters (args) with JSON Schema validation
|
|
20
|
+
- Define a sequence of steps at the root level (just like regular visor configs)
|
|
21
|
+
- Produce output values that can be consumed by other checks
|
|
22
|
+
- Must be defined in separate files and imported
|
|
23
|
+
- Support all existing check types as steps
|
|
24
|
+
|
|
25
|
+
## Workflow Structure
|
|
26
|
+
|
|
27
|
+
Each workflow is defined in its own file with the following structure:
|
|
28
|
+
|
|
29
|
+
```yaml
|
|
30
|
+
# workflow-name.yaml
|
|
31
|
+
id: workflow-name # Unique identifier
|
|
32
|
+
name: Workflow Display Name # Human-readable name
|
|
33
|
+
description: What this workflow does
|
|
34
|
+
version: "1.0.0" # Semantic versioning
|
|
35
|
+
|
|
36
|
+
# Input parameters
|
|
37
|
+
inputs:
|
|
38
|
+
- name: param_name
|
|
39
|
+
description: Parameter description
|
|
40
|
+
schema:
|
|
41
|
+
type: string
|
|
42
|
+
enum: ["option1", "option2"]
|
|
43
|
+
default: "option1"
|
|
44
|
+
required: false
|
|
45
|
+
|
|
46
|
+
# Output parameters
|
|
47
|
+
outputs:
|
|
48
|
+
- name: result
|
|
49
|
+
description: Computation result
|
|
50
|
+
value_js: steps.analyze.output.score
|
|
51
|
+
|
|
52
|
+
# Steps at root level - just like regular visor configs
|
|
53
|
+
steps:
|
|
54
|
+
analyze:
|
|
55
|
+
type: ai
|
|
56
|
+
prompt: Analyze code with {{ inputs.param_name }}
|
|
57
|
+
focus: security
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Importing Workflows
|
|
61
|
+
|
|
62
|
+
Import workflow files in your main configuration:
|
|
63
|
+
|
|
64
|
+
```yaml
|
|
65
|
+
# visor.yaml
|
|
66
|
+
version: "1.0"
|
|
67
|
+
|
|
68
|
+
# Import workflow definitions
|
|
69
|
+
imports:
|
|
70
|
+
- ./workflows/security-scan.yaml
|
|
71
|
+
- ./workflows/code-quality.yaml
|
|
72
|
+
- https://example.com/workflows/shared.yaml
|
|
73
|
+
|
|
74
|
+
# Use imported workflows in your steps
|
|
75
|
+
steps:
|
|
76
|
+
security_check:
|
|
77
|
+
type: workflow
|
|
78
|
+
workflow: security-scan
|
|
79
|
+
args:
|
|
80
|
+
severity_threshold: high
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Input Parameters
|
|
84
|
+
|
|
85
|
+
Workflows accept input parameters with JSON Schema validation:
|
|
86
|
+
|
|
87
|
+
```yaml
|
|
88
|
+
inputs:
|
|
89
|
+
- name: language
|
|
90
|
+
description: Programming language to analyze
|
|
91
|
+
schema:
|
|
92
|
+
type: string
|
|
93
|
+
enum: ["javascript", "typescript", "python", "go"]
|
|
94
|
+
required: true
|
|
95
|
+
|
|
96
|
+
- name: strict_mode
|
|
97
|
+
description: Enable strict checking
|
|
98
|
+
schema:
|
|
99
|
+
type: boolean
|
|
100
|
+
default: false
|
|
101
|
+
required: false
|
|
102
|
+
|
|
103
|
+
- name: patterns
|
|
104
|
+
description: Custom patterns to check
|
|
105
|
+
schema:
|
|
106
|
+
type: array
|
|
107
|
+
items:
|
|
108
|
+
type: string
|
|
109
|
+
minItems: 1
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Supported Schema Types
|
|
113
|
+
|
|
114
|
+
- `string` - Text values with optional patterns, enums, length constraints
|
|
115
|
+
- `number` - Numeric values with min/max constraints
|
|
116
|
+
- `boolean` - True/false values
|
|
117
|
+
- `array` - Lists with item schemas
|
|
118
|
+
- `object` - Structured data with property schemas
|
|
119
|
+
|
|
120
|
+
## Output Parameters
|
|
121
|
+
|
|
122
|
+
Workflows produce outputs that can be consumed by other checks:
|
|
123
|
+
|
|
124
|
+
```yaml
|
|
125
|
+
outputs:
|
|
126
|
+
- name: total_issues
|
|
127
|
+
description: Total number of issues found
|
|
128
|
+
value_js: |
|
|
129
|
+
steps.scan1.output.issues.length +
|
|
130
|
+
steps.scan2.output.issues.length
|
|
131
|
+
|
|
132
|
+
- name: summary
|
|
133
|
+
description: Human-readable summary
|
|
134
|
+
value: |
|
|
135
|
+
Found {{ outputs.total_issues }} issues:
|
|
136
|
+
- Critical: {{ steps.scan1.output.critical_count }}
|
|
137
|
+
- Warning: {{ steps.scan2.output.warning_count }}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Output Computation Methods
|
|
141
|
+
|
|
142
|
+
1. **JavaScript expressions** (`value_js`): Compute outputs using JavaScript
|
|
143
|
+
2. **Liquid templates** (`value`): Format outputs using Liquid templating
|
|
144
|
+
|
|
145
|
+
## Workflow Steps
|
|
146
|
+
|
|
147
|
+
Steps in a workflow support all standard check features:
|
|
148
|
+
|
|
149
|
+
```yaml
|
|
150
|
+
steps:
|
|
151
|
+
validate_input:
|
|
152
|
+
type: script
|
|
153
|
+
content: |
|
|
154
|
+
if (!inputs.api_key) {
|
|
155
|
+
throw new Error("API key is required");
|
|
156
|
+
}
|
|
157
|
+
return { valid: true };
|
|
158
|
+
|
|
159
|
+
fetch_data:
|
|
160
|
+
type: http_client
|
|
161
|
+
url: https://api.example.com/data
|
|
162
|
+
headers:
|
|
163
|
+
Authorization: "Bearer {{ inputs.api_key }}"
|
|
164
|
+
depends_on: [validate_input]
|
|
165
|
+
|
|
166
|
+
analyze_data:
|
|
167
|
+
type: ai
|
|
168
|
+
prompt: |
|
|
169
|
+
Analyze the following data:
|
|
170
|
+
{{ steps.fetch_data.output | json }}
|
|
171
|
+
|
|
172
|
+
Apply threshold: {{ inputs.threshold }}
|
|
173
|
+
depends_on: [fetch_data]
|
|
174
|
+
|
|
175
|
+
store_results:
|
|
176
|
+
type: memory
|
|
177
|
+
operation: set
|
|
178
|
+
key: analysis_results
|
|
179
|
+
value: "{{ steps.analyze_data.output }}"
|
|
180
|
+
depends_on: [analyze_data]
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Step Input Mappings
|
|
184
|
+
|
|
185
|
+
Map workflow inputs to step parameters:
|
|
186
|
+
|
|
187
|
+
```yaml
|
|
188
|
+
steps:
|
|
189
|
+
my_step:
|
|
190
|
+
type: command
|
|
191
|
+
exec: echo "Processing..."
|
|
192
|
+
inputs:
|
|
193
|
+
# Direct parameter reference
|
|
194
|
+
param1:
|
|
195
|
+
source: param
|
|
196
|
+
value: input_name
|
|
197
|
+
|
|
198
|
+
# Step output reference
|
|
199
|
+
param2:
|
|
200
|
+
source: step
|
|
201
|
+
stepId: previous_step
|
|
202
|
+
outputParam: result
|
|
203
|
+
|
|
204
|
+
# Constant value
|
|
205
|
+
param3:
|
|
206
|
+
source: constant
|
|
207
|
+
value: "fixed value"
|
|
208
|
+
|
|
209
|
+
# JavaScript expression
|
|
210
|
+
param4:
|
|
211
|
+
source: expression
|
|
212
|
+
expression: inputs.value * 2
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
## Using Workflows
|
|
216
|
+
|
|
217
|
+
### Basic Usage
|
|
218
|
+
|
|
219
|
+
Use a workflow as a check with the `workflow` type:
|
|
220
|
+
|
|
221
|
+
```yaml
|
|
222
|
+
steps:
|
|
223
|
+
security_check:
|
|
224
|
+
type: workflow
|
|
225
|
+
workflow: security-scan # Workflow ID from imported file
|
|
226
|
+
args:
|
|
227
|
+
severity_threshold: high
|
|
228
|
+
scan_dependencies: true
|
|
229
|
+
on: [pr_opened, pr_updated]
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### With Output Mapping
|
|
233
|
+
|
|
234
|
+
Map workflow outputs to check outputs:
|
|
235
|
+
|
|
236
|
+
```yaml
|
|
237
|
+
steps:
|
|
238
|
+
quality_analysis:
|
|
239
|
+
type: workflow
|
|
240
|
+
workflow: code-quality
|
|
241
|
+
args:
|
|
242
|
+
language: typescript
|
|
243
|
+
output_mapping:
|
|
244
|
+
final_score: quality_score # Map workflow output to check output
|
|
245
|
+
issues_list: recommendations
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### With Step Overrides
|
|
249
|
+
|
|
250
|
+
Override specific steps in the workflow:
|
|
251
|
+
|
|
252
|
+
```yaml
|
|
253
|
+
steps:
|
|
254
|
+
custom_scan:
|
|
255
|
+
type: workflow
|
|
256
|
+
workflow: security-scan
|
|
257
|
+
args:
|
|
258
|
+
severity_threshold: low
|
|
259
|
+
overrides:
|
|
260
|
+
secrets: # Override the 'secrets' step
|
|
261
|
+
prompt: "Custom prompt for secret scanning"
|
|
262
|
+
timeout: 120
|
|
263
|
+
sql_injection: # Override the 'sql_injection' step
|
|
264
|
+
ai_model: claude-3-opus-20240229
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
## Advanced Features
|
|
268
|
+
|
|
269
|
+
### Conditional Steps
|
|
270
|
+
|
|
271
|
+
Use conditions in workflow steps:
|
|
272
|
+
|
|
273
|
+
```yaml
|
|
274
|
+
steps:
|
|
275
|
+
optional_check:
|
|
276
|
+
type: ai
|
|
277
|
+
prompt: Run expensive check
|
|
278
|
+
if: inputs.enable_expensive_checks === true
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
### Dynamic Routing
|
|
282
|
+
|
|
283
|
+
Use workflow outputs for dynamic behavior:
|
|
284
|
+
|
|
285
|
+
```yaml
|
|
286
|
+
steps:
|
|
287
|
+
decision_point:
|
|
288
|
+
type: script
|
|
289
|
+
content: |
|
|
290
|
+
if (outputs.severity_check.critical_count > 0) {
|
|
291
|
+
return { next_action: "block" };
|
|
292
|
+
}
|
|
293
|
+
return { next_action: "proceed" };
|
|
294
|
+
|
|
295
|
+
follow_up:
|
|
296
|
+
type: workflow
|
|
297
|
+
workflow: "{{ steps.decision_point.output.next_action }}-workflow"
|
|
298
|
+
depends_on: [decision_point]
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
### Workflow Composition
|
|
302
|
+
|
|
303
|
+
Workflows can use other workflows:
|
|
304
|
+
|
|
305
|
+
```yaml
|
|
306
|
+
workflows:
|
|
307
|
+
comprehensive-check:
|
|
308
|
+
steps:
|
|
309
|
+
security:
|
|
310
|
+
type: workflow
|
|
311
|
+
workflow: security-scan
|
|
312
|
+
workflow_inputs:
|
|
313
|
+
severity_threshold: "{{ inputs.security_level }}"
|
|
314
|
+
|
|
315
|
+
quality:
|
|
316
|
+
type: workflow
|
|
317
|
+
workflow: code-quality
|
|
318
|
+
workflow_inputs:
|
|
319
|
+
language: "{{ inputs.language }}"
|
|
320
|
+
|
|
321
|
+
aggregate:
|
|
322
|
+
type: script
|
|
323
|
+
content: |
|
|
324
|
+
return {
|
|
325
|
+
passed: steps.security.output.passed && steps.quality.output.passed,
|
|
326
|
+
score: (steps.security.output.score + steps.quality.output.score) / 2
|
|
327
|
+
};
|
|
328
|
+
depends_on: [security, quality]
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
## Examples
|
|
332
|
+
|
|
333
|
+
### Security Scan Workflow
|
|
334
|
+
|
|
335
|
+
```yaml
|
|
336
|
+
id: security-scan
|
|
337
|
+
name: Security Scanner
|
|
338
|
+
inputs:
|
|
339
|
+
- name: scan_level
|
|
340
|
+
schema:
|
|
341
|
+
type: string
|
|
342
|
+
enum: [basic, standard, comprehensive]
|
|
343
|
+
default: standard
|
|
344
|
+
|
|
345
|
+
outputs:
|
|
346
|
+
- name: vulnerabilities
|
|
347
|
+
value_js: |
|
|
348
|
+
[...(steps.secrets.output.issues || []),
|
|
349
|
+
...(steps.injection.output.issues || [])]
|
|
350
|
+
|
|
351
|
+
- name: passed
|
|
352
|
+
value_js: outputs.vulnerabilities.length === 0
|
|
353
|
+
|
|
354
|
+
steps:
|
|
355
|
+
secrets:
|
|
356
|
+
type: ai
|
|
357
|
+
prompt: Scan for hardcoded secrets and API keys
|
|
358
|
+
|
|
359
|
+
injection:
|
|
360
|
+
type: ai
|
|
361
|
+
prompt: Check for injection vulnerabilities
|
|
362
|
+
depends_on: [secrets]
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
### Multi-Language Support Workflow
|
|
366
|
+
|
|
367
|
+
```yaml
|
|
368
|
+
id: language-check
|
|
369
|
+
name: Multi-Language Analyzer
|
|
370
|
+
|
|
371
|
+
inputs:
|
|
372
|
+
- name: languages
|
|
373
|
+
schema:
|
|
374
|
+
type: array
|
|
375
|
+
items:
|
|
376
|
+
type: string
|
|
377
|
+
|
|
378
|
+
steps:
|
|
379
|
+
detect_languages:
|
|
380
|
+
type: script
|
|
381
|
+
content: |
|
|
382
|
+
const detected = [];
|
|
383
|
+
if (filesChanged.some(f => f.endsWith('.js'))) detected.push('javascript');
|
|
384
|
+
if (filesChanged.some(f => f.endsWith('.py'))) detected.push('python');
|
|
385
|
+
return { languages: detected };
|
|
386
|
+
|
|
387
|
+
analyze_each:
|
|
388
|
+
type: ai
|
|
389
|
+
forEach: true
|
|
390
|
+
prompt: Analyze {{ item }} code for best practices
|
|
391
|
+
depends_on: [detect_languages]
|
|
392
|
+
|
|
393
|
+
summarize:
|
|
394
|
+
type: script
|
|
395
|
+
content: |
|
|
396
|
+
const results = outputs.analyze_each;
|
|
397
|
+
return {
|
|
398
|
+
total_issues: results.reduce((sum, r) => sum + r.issues.length, 0),
|
|
399
|
+
by_language: results.map((r, i) => ({
|
|
400
|
+
language: steps.detect_languages.output.languages[i],
|
|
401
|
+
issues: r.issues.length
|
|
402
|
+
}))
|
|
403
|
+
};
|
|
404
|
+
depends_on: [analyze_each]
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
## Best Practices
|
|
408
|
+
|
|
409
|
+
### 1. Design for Reusability
|
|
410
|
+
|
|
411
|
+
- Use meaningful parameter names
|
|
412
|
+
- Provide sensible defaults
|
|
413
|
+
- Document all inputs and outputs
|
|
414
|
+
- Keep workflows focused on a single concern
|
|
415
|
+
|
|
416
|
+
### 2. Validate Inputs
|
|
417
|
+
|
|
418
|
+
```yaml
|
|
419
|
+
inputs:
|
|
420
|
+
- name: url
|
|
421
|
+
schema:
|
|
422
|
+
type: string
|
|
423
|
+
format: uri
|
|
424
|
+
pattern: "^https://"
|
|
425
|
+
description: HTTPS URL only
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
### 3. Handle Errors Gracefully
|
|
429
|
+
|
|
430
|
+
```yaml
|
|
431
|
+
steps:
|
|
432
|
+
safe_operation:
|
|
433
|
+
type: script
|
|
434
|
+
content: |
|
|
435
|
+
try {
|
|
436
|
+
return processData(inputs.data);
|
|
437
|
+
} catch (error) {
|
|
438
|
+
return {
|
|
439
|
+
success: false,
|
|
440
|
+
error: error.message,
|
|
441
|
+
fallback: inputs.default_value
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
### 4. Version Your Workflows
|
|
447
|
+
|
|
448
|
+
```yaml
|
|
449
|
+
version: "2.0.0" # Semantic versioning
|
|
450
|
+
# Breaking changes from 1.x:
|
|
451
|
+
# - Renamed 'threshold' input to 'quality_threshold'
|
|
452
|
+
# - Added required 'language' input
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
### 5. Provide Examples
|
|
456
|
+
|
|
457
|
+
```yaml
|
|
458
|
+
examples:
|
|
459
|
+
- name: Basic usage
|
|
460
|
+
description: Run with default settings
|
|
461
|
+
inputs:
|
|
462
|
+
severity: medium
|
|
463
|
+
|
|
464
|
+
- name: Strict mode
|
|
465
|
+
description: Maximum security scanning
|
|
466
|
+
inputs:
|
|
467
|
+
severity: critical
|
|
468
|
+
deep_scan: true
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
### 6. Test Your Workflows
|
|
472
|
+
|
|
473
|
+
Create test configurations to validate workflows:
|
|
474
|
+
|
|
475
|
+
```yaml
|
|
476
|
+
# test-workflow.yaml
|
|
477
|
+
steps:
|
|
478
|
+
test_workflow:
|
|
479
|
+
type: workflow
|
|
480
|
+
workflow: my-workflow
|
|
481
|
+
workflow_inputs:
|
|
482
|
+
test_param: "test_value"
|
|
483
|
+
|
|
484
|
+
validate_output:
|
|
485
|
+
type: script
|
|
486
|
+
content: |
|
|
487
|
+
const output = outputs.test_workflow;
|
|
488
|
+
assert(output.result !== undefined, "Result is required");
|
|
489
|
+
assert(output.score >= 0 && output.score <= 100, "Score out of range");
|
|
490
|
+
depends_on: [test_workflow]
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
## Workflow Schema Reference
|
|
494
|
+
|
|
495
|
+
Complete workflow schema:
|
|
496
|
+
|
|
497
|
+
```typescript
|
|
498
|
+
interface WorkflowDefinition {
|
|
499
|
+
id: string; // Unique identifier
|
|
500
|
+
name: string; // Display name
|
|
501
|
+
description?: string; // Description
|
|
502
|
+
version?: string; // Semantic version
|
|
503
|
+
tags?: string[]; // Categorization tags
|
|
504
|
+
category?: string; // Category (security, quality, etc.)
|
|
505
|
+
|
|
506
|
+
inputs?: WorkflowInputParam[]; // Input parameters
|
|
507
|
+
outputs?: WorkflowOutputParam[]; // Output parameters
|
|
508
|
+
steps: Record<string, WorkflowStep>; // Workflow steps
|
|
509
|
+
|
|
510
|
+
on?: EventTrigger[]; // Events that can trigger this workflow
|
|
511
|
+
defaults?: Partial<CheckConfig>; // Default config for steps
|
|
512
|
+
reusable?: boolean; // Can be used as component
|
|
513
|
+
|
|
514
|
+
author?: { // Author information
|
|
515
|
+
name?: string;
|
|
516
|
+
email?: string;
|
|
517
|
+
url?: string;
|
|
518
|
+
};
|
|
519
|
+
|
|
520
|
+
license?: string; // License information
|
|
521
|
+
examples?: WorkflowExample[]; // Usage examples
|
|
522
|
+
}
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
## Integration with CI/CD
|
|
526
|
+
|
|
527
|
+
Workflows integrate seamlessly with GitHub Actions:
|
|
528
|
+
|
|
529
|
+
```yaml
|
|
530
|
+
name: PR Review
|
|
531
|
+
on: [pull_request]
|
|
532
|
+
|
|
533
|
+
jobs:
|
|
534
|
+
visor:
|
|
535
|
+
runs-on: ubuntu-latest
|
|
536
|
+
steps:
|
|
537
|
+
- uses: actions/checkout@v3
|
|
538
|
+
|
|
539
|
+
- name: Run Visor with Workflows
|
|
540
|
+
uses: your-org/visor-action@v1
|
|
541
|
+
with:
|
|
542
|
+
config: .visor.yaml
|
|
543
|
+
workflow_imports: |
|
|
544
|
+
./workflows/*.yaml
|
|
545
|
+
https://workflows.example.com/shared/*.yaml
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
## Troubleshooting
|
|
549
|
+
|
|
550
|
+
### Common Issues
|
|
551
|
+
|
|
552
|
+
1. **Workflow not found**: Ensure the workflow is registered via `workflows` or `workflow_imports`
|
|
553
|
+
2. **Input validation failed**: Check that inputs match the defined schema
|
|
554
|
+
3. **Circular dependencies**: Ensure workflow steps don't have circular `depends_on`
|
|
555
|
+
4. **Output computation error**: Verify JavaScript expressions and Liquid templates are valid
|
|
556
|
+
|
|
557
|
+
### Debug Mode
|
|
558
|
+
|
|
559
|
+
Enable debug output to troubleshoot workflows:
|
|
560
|
+
|
|
561
|
+
```bash
|
|
562
|
+
visor --debug --config visor.yaml
|
|
563
|
+
```
|
|
564
|
+
|
|
565
|
+
This will show:
|
|
566
|
+
- Workflow registration details
|
|
567
|
+
- Input validation results
|
|
568
|
+
- Step execution order
|
|
569
|
+
- Output computation values
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { PRInfo } from '../../pr-analyzer';
|
|
2
|
+
import type { ReviewSummary } from '../../reviewer';
|
|
3
|
+
import type { VisorConfig, CheckConfig } from '../../types/config';
|
|
4
|
+
type RunCheckFn = (id: string) => Promise<ReviewSummary>;
|
|
5
|
+
export declare function runOnFinishChildren(runIds: string[], runCheck: RunCheckFn, config: VisorConfig, onFinishContext: any, debug: boolean, log: (msg: string) => void): Promise<{
|
|
6
|
+
lastRunOutput?: unknown;
|
|
7
|
+
}>;
|
|
8
|
+
export declare function decideRouting(checkName: string, checkConfig: CheckConfig, outputsForContext: Record<string, unknown>, outputsHistoryForContext: Record<string, unknown[]>, forEachStats: {
|
|
9
|
+
items: unknown[];
|
|
10
|
+
}, prInfo: PRInfo, config: VisorConfig, debug: boolean, log: (msg: string) => void): {
|
|
11
|
+
gotoTarget: string | null;
|
|
12
|
+
};
|
|
13
|
+
export declare function projectOutputs(results: Map<string, ReviewSummary>, historySnapshot: Record<string, unknown[]>): {
|
|
14
|
+
outputsForContext: Record<string, unknown>;
|
|
15
|
+
outputsHistoryForContext: Record<string, unknown[]>;
|
|
16
|
+
};
|
|
17
|
+
export declare function computeAllValid(history: Record<string, unknown[]>, itemsCount: number): boolean | undefined;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=orchestrator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["file:///home/runner/work/visor/visor/src/engine/on-finish/orchestrator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAQnE,KAAK,UAAU,GAAG,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;AAEzD,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,MAAM,EAAE,EAChB,QAAQ,EAAE,UAAU,EACpB,MAAM,EAAE,WAAW,EACnB,eAAe,EAAE,GAAG,EACpB,KAAK,EAAE,OAAO,EACd,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GACzB,OAAO,CAAC;IAAE,aAAa,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CA8BtC;AAED,wBAAgB,aAAa,CAC3B,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,WAAW,EACxB,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC1C,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,EACnD,YAAY,EAAE;IAAE,KAAK,EAAE,OAAO,EAAE,CAAA;CAAE,EAClC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,OAAO,EACd,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GACzB;IAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAuD/B;AAED,wBAAgB,cAAc,CAC5B,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,EACnC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,GACzC;IACD,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;CACrD,CAEA;AAED,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,EAClC,UAAU,EAAE,MAAM,GACjB,OAAO,GAAG,SAAS,CAErB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { PRInfo } from '../../pr-analyzer';
|
|
2
|
+
import type { ReviewSummary } from '../../reviewer';
|
|
3
|
+
import type { VisorConfig, CheckConfig, OnFinishConfig } from '../../types/config';
|
|
4
|
+
export declare function buildProjectionFrom(results: Map<string, ReviewSummary>, historySnapshot: Record<string, unknown[]>): {
|
|
5
|
+
outputsForContext: Record<string, unknown>;
|
|
6
|
+
outputsHistoryForContext: Record<string, unknown[]>;
|
|
7
|
+
};
|
|
8
|
+
export interface OnFinishContext {
|
|
9
|
+
step: {
|
|
10
|
+
id: string;
|
|
11
|
+
tags: string[];
|
|
12
|
+
group?: string;
|
|
13
|
+
};
|
|
14
|
+
attempt: number;
|
|
15
|
+
loop: number;
|
|
16
|
+
outputs: Record<string, unknown>;
|
|
17
|
+
outputs_history: Record<string, unknown[]>;
|
|
18
|
+
outputs_raw: Record<string, unknown>;
|
|
19
|
+
forEach: unknown;
|
|
20
|
+
memory: {
|
|
21
|
+
get: (key: string, ns?: string) => unknown;
|
|
22
|
+
has: (key: string, ns?: string) => boolean;
|
|
23
|
+
getAll: (ns?: string) => Record<string, unknown>;
|
|
24
|
+
set: (key: string, value: unknown, ns?: string) => void;
|
|
25
|
+
clear: (ns?: string) => void;
|
|
26
|
+
increment: (key: string, amount?: number, ns?: string) => number;
|
|
27
|
+
};
|
|
28
|
+
pr: {
|
|
29
|
+
number: number;
|
|
30
|
+
title?: string;
|
|
31
|
+
author?: string;
|
|
32
|
+
branch?: string;
|
|
33
|
+
base?: string;
|
|
34
|
+
};
|
|
35
|
+
files?: unknown;
|
|
36
|
+
env: Record<string, string | undefined>;
|
|
37
|
+
event: {
|
|
38
|
+
name: string;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export declare function composeOnFinishContext(_memoryConfig: VisorConfig['memory'] | undefined, checkName: string, checkConfig: CheckConfig, outputsForContext: Record<string, unknown>, outputsHistoryForContext: Record<string, unknown[]>, forEachStats: any, prInfo: PRInfo): OnFinishContext;
|
|
42
|
+
export declare function evaluateOnFinishGoto(onFinish: NonNullable<OnFinishConfig>, onFinishContext: any, debug: boolean, log: (msg: string) => void): string | null;
|
|
43
|
+
export declare function recomputeAllValidFromHistory(history: Record<string, unknown[]>, forEachItemsCount: number): boolean | undefined;
|
|
44
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["file:///home/runner/work/visor/visor/src/engine/on-finish/utils.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { EventEnvelope, AnyEvent } from './types';
|
|
2
|
+
export type EventHandler<T = AnyEvent> = (event: T | EventEnvelope<T>) => void | Promise<void>;
|
|
3
|
+
export interface Subscription {
|
|
4
|
+
unsubscribe(): void;
|
|
5
|
+
}
|
|
6
|
+
export declare class EventBus {
|
|
7
|
+
private handlers;
|
|
8
|
+
private anyHandlers;
|
|
9
|
+
on<T = AnyEvent>(eventType: string, handler: EventHandler<T>): Subscription;
|
|
10
|
+
onAny(handler: EventHandler): Subscription;
|
|
11
|
+
emit(event: AnyEvent | EventEnvelope): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=event-bus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-bus.d.ts","sourceRoot":"","sources":["file:///home/runner/work/visor/visor/src/event-bus/event-bus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEvD,MAAM,MAAM,YAAY,CAAC,CAAC,GAAG,QAAQ,IAAI,CAAC,KAAK,EAAE,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAE/F,MAAM,WAAW,YAAY;IAC3B,WAAW,IAAI,IAAI,CAAC;CACrB;AAED,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAA6C;IAC7D,OAAO,CAAC,WAAW,CAAgC;IAEnD,EAAE,CAAC,CAAC,GAAG,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,YAAY;IAW3E,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,YAAY;IAKpC,IAAI,CAAC,KAAK,EAAE,QAAQ,GAAG,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;CAY3D"}
|