@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,559 @@
|
|
|
1
|
+
# Command Provider Documentation
|
|
2
|
+
|
|
3
|
+
The `command` provider executes shell commands and captures their output for processing. It's useful for integrating external tools, running tests, performing custom validations, or gathering system information.
|
|
4
|
+
|
|
5
|
+
## Basic Usage
|
|
6
|
+
|
|
7
|
+
```yaml
|
|
8
|
+
steps:
|
|
9
|
+
my-command-check:
|
|
10
|
+
type: command
|
|
11
|
+
exec: "npm test"
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Features
|
|
15
|
+
|
|
16
|
+
- **Shell command execution** - Run any shell command
|
|
17
|
+
- **JSON output parsing** - Automatically parses JSON output
|
|
18
|
+
- **Liquid templating** - Use variables in commands and transforms
|
|
19
|
+
- **Dependency support** - Access outputs from other checks
|
|
20
|
+
- **Environment variables** - Pass custom environment variables
|
|
21
|
+
- **Output transformation** - Transform command output using Liquid templates
|
|
22
|
+
|
|
23
|
+
## Configuration Options
|
|
24
|
+
|
|
25
|
+
| Option | Type | Required | Description |
|
|
26
|
+
|--------|------|----------|-------------|
|
|
27
|
+
| `type` | string | Yes | Must be `"command"` |
|
|
28
|
+
| `exec` | string | Yes | The shell command to execute |
|
|
29
|
+
| `transform` | string | No | Liquid template to transform output |
|
|
30
|
+
| `transform_js` | string | No | JavaScript expression to transform output (evaluated in sandbox) |
|
|
31
|
+
| `env` | object | No | Environment variables to pass to the command |
|
|
32
|
+
| `timeout` | number | No | Command timeout in seconds (default: 60) |
|
|
33
|
+
| `depends_on` | array | No | Other checks this depends on |
|
|
34
|
+
| `forEach` | object | No | Run command for each item in a collection |
|
|
35
|
+
| `group` | string | No | Group name for organizing results |
|
|
36
|
+
| `on` | array | No | Events that trigger this check |
|
|
37
|
+
| `tags` | array | No | Tags for filtering checks |
|
|
38
|
+
|
|
39
|
+
## Auto‑JSON Access (no JSON.parse needed)
|
|
40
|
+
|
|
41
|
+
Visor automatically parses command stdout when it contains valid JSON and exposes it in templates and `transform_js` without requiring `JSON.parse(...)`.
|
|
42
|
+
|
|
43
|
+
- In Liquid templates: `{{ output.key }}` and `{{ outputs['some-check'].key }}` work directly when the underlying string is JSON.
|
|
44
|
+
- In JavaScript transforms: you can write `output.items` instead of `JSON.parse(output).items`.
|
|
45
|
+
- Backward compatible: `JSON.parse(output)` still works if you prefer it.
|
|
46
|
+
|
|
47
|
+
Examples:
|
|
48
|
+
|
|
49
|
+
```yaml
|
|
50
|
+
steps:
|
|
51
|
+
fetch-tickets:
|
|
52
|
+
type: command
|
|
53
|
+
exec: |
|
|
54
|
+
echo '{"tickets":[{"key":"TT-101"},{"key":"TT-102"}]}'
|
|
55
|
+
transform_js: |
|
|
56
|
+
output.tickets # no JSON.parse required
|
|
57
|
+
forEach: true
|
|
58
|
+
|
|
59
|
+
analyze-ticket:
|
|
60
|
+
type: command
|
|
61
|
+
depends_on: [fetch-tickets]
|
|
62
|
+
exec: |
|
|
63
|
+
echo "Processing {{ outputs['fetch-tickets'].key }} (index in batch)"
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
If the command prints plain text (not JSON), `output` behaves as a normal string.
|
|
67
|
+
|
|
68
|
+
## Examples
|
|
69
|
+
|
|
70
|
+
### Basic Command Execution
|
|
71
|
+
|
|
72
|
+
```yaml
|
|
73
|
+
steps:
|
|
74
|
+
lint:
|
|
75
|
+
type: command
|
|
76
|
+
exec: "npm run lint"
|
|
77
|
+
group: quality
|
|
78
|
+
on: [pr_opened, pr_updated]
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### JSON Output Parsing
|
|
82
|
+
|
|
83
|
+
Commands that output JSON will be automatically parsed:
|
|
84
|
+
|
|
85
|
+
```yaml
|
|
86
|
+
steps:
|
|
87
|
+
security-audit:
|
|
88
|
+
type: command
|
|
89
|
+
exec: "npm audit --json"
|
|
90
|
+
group: security
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Using Liquid Templates
|
|
94
|
+
|
|
95
|
+
The `exec` field fully supports Liquid templating for dynamic command generation. Templates are processed before command execution.
|
|
96
|
+
|
|
97
|
+
```yaml
|
|
98
|
+
steps:
|
|
99
|
+
branch-check:
|
|
100
|
+
type: command
|
|
101
|
+
exec: "git diff {{ pr.base }}..{{ pr.branch }} --stat"
|
|
102
|
+
group: analysis
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Available template variables:
|
|
106
|
+
- `pr.number` - Pull request number
|
|
107
|
+
- `pr.title` - Pull request title
|
|
108
|
+
- `pr.author` - Pull request author
|
|
109
|
+
- `pr.branch` - Source branch (head)
|
|
110
|
+
- `pr.base` - Target branch (base)
|
|
111
|
+
- `files` - Array of changed files
|
|
112
|
+
- `fileCount` - Number of changed files
|
|
113
|
+
- `env` - Safe environment variables (see Security section)
|
|
114
|
+
- `outputs.<check_name>` - Outputs from dependency checks
|
|
115
|
+
|
|
116
|
+
### Using Dependencies
|
|
117
|
+
|
|
118
|
+
Access outputs from other checks:
|
|
119
|
+
|
|
120
|
+
```yaml
|
|
121
|
+
steps:
|
|
122
|
+
get-version:
|
|
123
|
+
type: command
|
|
124
|
+
exec: "node -p 'require(\"./package.json\").version'"
|
|
125
|
+
|
|
126
|
+
tag-release:
|
|
127
|
+
type: command
|
|
128
|
+
exec: "git tag v{{ outputs.get_version }}"
|
|
129
|
+
depends_on: [get-version]
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Transform Output
|
|
133
|
+
|
|
134
|
+
Transform command output using Liquid templates (see [Liquid Templates Guide](./liquid-templates.md) for full reference):
|
|
135
|
+
|
|
136
|
+
```yaml
|
|
137
|
+
steps:
|
|
138
|
+
test-coverage:
|
|
139
|
+
type: command
|
|
140
|
+
exec: "npm test -- --coverage --json"
|
|
141
|
+
transform: |
|
|
142
|
+
{
|
|
143
|
+
"coverage": {{ output.coverageMap | json }},
|
|
144
|
+
"summary": "Coverage: {{ output.coverageSummary.total.lines.pct }}%"
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Reading Files in Templates
|
|
149
|
+
|
|
150
|
+
You can read file content directly in your command templates:
|
|
151
|
+
|
|
152
|
+
```yaml
|
|
153
|
+
steps:
|
|
154
|
+
check-config:
|
|
155
|
+
type: command
|
|
156
|
+
exec: |
|
|
157
|
+
# Include config file content in command
|
|
158
|
+
CONFIG='{% readfile "config.json" %}'
|
|
159
|
+
echo "$CONFIG" | jq '.version'
|
|
160
|
+
|
|
161
|
+
validate-schema:
|
|
162
|
+
type: command
|
|
163
|
+
exec: |
|
|
164
|
+
# Read and validate against schema
|
|
165
|
+
SCHEMA='{% readfile "schema.json" %}'
|
|
166
|
+
DATA='{% readfile "data.json" %}'
|
|
167
|
+
ajv validate -s <(echo "$SCHEMA") -d <(echo "$DATA")
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### JavaScript Transform
|
|
171
|
+
|
|
172
|
+
Transform command output using JavaScript expressions (evaluated in secure sandbox):
|
|
173
|
+
|
|
174
|
+
```yaml
|
|
175
|
+
steps:
|
|
176
|
+
# Extract specific fields using JavaScript
|
|
177
|
+
extract-vulnerabilities:
|
|
178
|
+
type: command
|
|
179
|
+
exec: "security-scan --json"
|
|
180
|
+
transform_js: |
|
|
181
|
+
output.vulnerabilities.filter(v => v.severity === 'critical')
|
|
182
|
+
forEach: true
|
|
183
|
+
|
|
184
|
+
# Complex data manipulation
|
|
185
|
+
aggregate-metrics:
|
|
186
|
+
type: command
|
|
187
|
+
exec: "get-metrics --json"
|
|
188
|
+
transform_js: |
|
|
189
|
+
({
|
|
190
|
+
total: output.metrics.reduce((sum, m) => sum + m.value, 0),
|
|
191
|
+
average: output.metrics.reduce((sum, m) => sum + m.value, 0) / output.metrics.length,
|
|
192
|
+
critical: output.metrics.filter(m => m.level === 'critical').map(m => m.name)
|
|
193
|
+
})
|
|
194
|
+
|
|
195
|
+
# Array extraction with conditions
|
|
196
|
+
get-failed-tests:
|
|
197
|
+
type: command
|
|
198
|
+
exec: "npm test --json"
|
|
199
|
+
transform_js: |
|
|
200
|
+
output.tests
|
|
201
|
+
.filter(t => !t.passed)
|
|
202
|
+
.map(t => ({ name: t.name, error: t.error }))
|
|
203
|
+
|
|
204
|
+
# Combine with Liquid transform (Liquid runs first, then JavaScript)
|
|
205
|
+
process-data:
|
|
206
|
+
type: command
|
|
207
|
+
exec: "api-call --json"
|
|
208
|
+
transform: |
|
|
209
|
+
{{ output.data | json }}
|
|
210
|
+
transform_js: |
|
|
211
|
+
output.filter(item => item.active && item.priority > 5)
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
**Available in JavaScript transform context:**
|
|
215
|
+
- `output` - The command output (or result of Liquid transform if present)
|
|
216
|
+
- `pr` - Pull request context (number, title, author, branch, base)
|
|
217
|
+
- `files` - Array of changed files
|
|
218
|
+
- `outputs` - Results from dependency checks
|
|
219
|
+
- `env` - Environment variables
|
|
220
|
+
- `log()` - Debug function that prints to console with 🔍 prefix
|
|
221
|
+
|
|
222
|
+
**Debugging JavaScript transforms:**
|
|
223
|
+
```yaml
|
|
224
|
+
steps:
|
|
225
|
+
debug-transform:
|
|
226
|
+
type: command
|
|
227
|
+
exec: "echo '{\"items\":[1,2,3]}'"
|
|
228
|
+
transform_js: |
|
|
229
|
+
log("Raw output:", output);
|
|
230
|
+
const data = JSON.parse(output);
|
|
231
|
+
log("Parsed data:", data);
|
|
232
|
+
log("Item count:", data.items.length);
|
|
233
|
+
return data.items;
|
|
234
|
+
```
|
|
235
|
+
- `JSON` - JSON object for parsing/stringifying
|
|
236
|
+
|
|
237
|
+
### Environment Variables
|
|
238
|
+
|
|
239
|
+
You can use environment variables in three ways:
|
|
240
|
+
|
|
241
|
+
#### 1. Shell Variable Expansion (Recommended for defaults)
|
|
242
|
+
```yaml
|
|
243
|
+
steps:
|
|
244
|
+
jira-query:
|
|
245
|
+
type: command
|
|
246
|
+
exec: |
|
|
247
|
+
# Shell expansion with defaults
|
|
248
|
+
JQL="${VISOR_JQL:-project = MYPROJ}"
|
|
249
|
+
LIMIT="${VISOR_LIMIT:-10}"
|
|
250
|
+
|
|
251
|
+
curl -s "https://jira.example.com/rest/api/2/search?jql=${JQL}&maxResults=${LIMIT}"
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
#### 2. Liquid Templates
|
|
255
|
+
```yaml
|
|
256
|
+
steps:
|
|
257
|
+
api-check:
|
|
258
|
+
type: command
|
|
259
|
+
exec: |
|
|
260
|
+
curl "{{ env.API_URL | default: 'https://api.example.com' }}/status"
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
#### 3. Custom Environment Variables
|
|
264
|
+
```yaml
|
|
265
|
+
steps:
|
|
266
|
+
integration-test:
|
|
267
|
+
type: command
|
|
268
|
+
exec: "npm run test:integration"
|
|
269
|
+
env:
|
|
270
|
+
NODE_ENV: test
|
|
271
|
+
API_URL: https://api.example.com
|
|
272
|
+
TIMEOUT: "30000"
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
**Note**: Commands inherit all parent process environment variables. Custom `env` values override inherited ones.
|
|
276
|
+
|
|
277
|
+
### For Each Execution
|
|
278
|
+
|
|
279
|
+
Run a command for each item in a collection:
|
|
280
|
+
|
|
281
|
+
```yaml
|
|
282
|
+
steps:
|
|
283
|
+
validate-files:
|
|
284
|
+
type: command
|
|
285
|
+
exec: "jsonlint {{ item }}"
|
|
286
|
+
forEach:
|
|
287
|
+
items: "{{ files | where: 'extension', '.json' }}"
|
|
288
|
+
group: validation
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
### Conditional Execution
|
|
292
|
+
|
|
293
|
+
Run checks only under certain conditions:
|
|
294
|
+
|
|
295
|
+
```yaml
|
|
296
|
+
steps:
|
|
297
|
+
deploy-check:
|
|
298
|
+
type: command
|
|
299
|
+
exec: "npm run deploy:dry-run"
|
|
300
|
+
on: [pr_opened]
|
|
301
|
+
if: "pr.base == 'main'"
|
|
302
|
+
tags: [deployment, validation]
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
### Timeout Configuration
|
|
306
|
+
|
|
307
|
+
Configure longer timeouts for commands that take more time:
|
|
308
|
+
|
|
309
|
+
```yaml
|
|
310
|
+
steps:
|
|
311
|
+
build-project:
|
|
312
|
+
type: command
|
|
313
|
+
exec: "npm run build"
|
|
314
|
+
timeout: 300 # 5 minutes
|
|
315
|
+
group: build
|
|
316
|
+
|
|
317
|
+
quick-lint:
|
|
318
|
+
type: command
|
|
319
|
+
exec: "eslint src/"
|
|
320
|
+
timeout: 30 # 30 seconds
|
|
321
|
+
group: quality
|
|
322
|
+
|
|
323
|
+
long-test-suite:
|
|
324
|
+
type: command
|
|
325
|
+
exec: "npm run test:e2e"
|
|
326
|
+
timeout: 600 # 10 minutes
|
|
327
|
+
group: testing
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
### Complex Example
|
|
331
|
+
|
|
332
|
+
A comprehensive example combining multiple features:
|
|
333
|
+
|
|
334
|
+
```yaml
|
|
335
|
+
steps:
|
|
336
|
+
# First, get dependencies that need updating
|
|
337
|
+
outdated-deps:
|
|
338
|
+
type: command
|
|
339
|
+
exec: "npm outdated --json || true"
|
|
340
|
+
timeout: 120 # 2 minutes for npm operations
|
|
341
|
+
group: dependencies
|
|
342
|
+
tags: [dependencies, maintenance]
|
|
343
|
+
|
|
344
|
+
# Then check for security issues in those dependencies
|
|
345
|
+
security-check:
|
|
346
|
+
type: command
|
|
347
|
+
exec: |
|
|
348
|
+
if [ -n '{{ outputs.outdated_deps }}' ]; then
|
|
349
|
+
npm audit --json
|
|
350
|
+
else
|
|
351
|
+
echo '{"vulnerabilities": {}}'
|
|
352
|
+
fi
|
|
353
|
+
depends_on: [outdated-deps]
|
|
354
|
+
timeout: 180 # 3 minutes for audit
|
|
355
|
+
transform: |
|
|
356
|
+
{
|
|
357
|
+
"critical": {{ output.metadata.vulnerabilities.critical | default: 0 }},
|
|
358
|
+
"high": {{ output.metadata.vulnerabilities.high | default: 0 }},
|
|
359
|
+
"message": "Found {{ output.metadata.vulnerabilities.total | default: 0 }} vulnerabilities"
|
|
360
|
+
}
|
|
361
|
+
group: security
|
|
362
|
+
tags: [security, dependencies]
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
## Error Handling
|
|
366
|
+
|
|
367
|
+
The command provider handles errors gracefully:
|
|
368
|
+
|
|
369
|
+
1. **Command failures** - Non-zero exit codes are captured as errors
|
|
370
|
+
2. **Timeout** - Commands timeout after 60 seconds by default
|
|
371
|
+
3. **Buffer limits** - Output is limited to 10MB
|
|
372
|
+
4. **Transform errors** - Invalid transforms are reported as issues
|
|
373
|
+
|
|
374
|
+
Example error output:
|
|
375
|
+
```json
|
|
376
|
+
{
|
|
377
|
+
"issues": [
|
|
378
|
+
{
|
|
379
|
+
"file": "command",
|
|
380
|
+
"line": 0,
|
|
381
|
+
"ruleId": "command/execution_error",
|
|
382
|
+
"message": "Command execution failed: npm test exited with code 1",
|
|
383
|
+
"severity": "error",
|
|
384
|
+
"category": "logic"
|
|
385
|
+
}
|
|
386
|
+
]
|
|
387
|
+
}
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
## Security Considerations
|
|
391
|
+
|
|
392
|
+
### ⚠️ CRITICAL: Command Injection Prevention
|
|
393
|
+
|
|
394
|
+
**NEVER use uncontrolled user input directly in commands!** This includes PR titles, branch names, commit messages, or any other user-provided data.
|
|
395
|
+
|
|
396
|
+
#### ❌ DANGEROUS - Command Injection Vulnerable
|
|
397
|
+
```yaml
|
|
398
|
+
# DON'T DO THIS - PR title could contain malicious commands
|
|
399
|
+
steps:
|
|
400
|
+
bad-example:
|
|
401
|
+
type: command
|
|
402
|
+
exec: "echo 'Reviewing: {{ pr.title }}'" # VULNERABLE!
|
|
403
|
+
# If pr.title is: '; rm -rf / #
|
|
404
|
+
# Command becomes: echo 'Reviewing: '; rm -rf / #'
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
#### ✅ SAFE - Properly Escaped
|
|
408
|
+
```yaml
|
|
409
|
+
steps:
|
|
410
|
+
# Option 1: Use Liquid filters to escape
|
|
411
|
+
safe-echo:
|
|
412
|
+
type: command
|
|
413
|
+
exec: "echo 'Reviewing: {{ pr.title | escape }}'"
|
|
414
|
+
|
|
415
|
+
# Option 2: Pass as environment variable (shell handles escaping)
|
|
416
|
+
safe-with-env:
|
|
417
|
+
type: command
|
|
418
|
+
exec: |
|
|
419
|
+
PR_TITLE="{{ pr.title }}"
|
|
420
|
+
echo "Reviewing: $PR_TITLE"
|
|
421
|
+
|
|
422
|
+
# Option 3: Use JSON encoding for complex data
|
|
423
|
+
safe-json:
|
|
424
|
+
type: command
|
|
425
|
+
exec: |
|
|
426
|
+
cat << 'EOF' | jq .
|
|
427
|
+
{
|
|
428
|
+
"title": {{ pr.title | json }},
|
|
429
|
+
"author": {{ pr.author | json }}
|
|
430
|
+
}
|
|
431
|
+
EOF
|
|
432
|
+
|
|
433
|
+
# Option 4: Avoid user input entirely
|
|
434
|
+
safest:
|
|
435
|
+
type: command
|
|
436
|
+
exec: "echo 'PR #{{ pr.number }} needs review'" # number is safe
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
### Input Sanitization Examples
|
|
440
|
+
|
|
441
|
+
#### Handling File Paths
|
|
442
|
+
```yaml
|
|
443
|
+
steps:
|
|
444
|
+
# DANGEROUS - file names could contain special characters
|
|
445
|
+
bad-lint:
|
|
446
|
+
type: command
|
|
447
|
+
exec: "eslint {{ files | join: ' ' }}" # VULNERABLE!
|
|
448
|
+
|
|
449
|
+
# SAFE - quote each file properly
|
|
450
|
+
safe-lint:
|
|
451
|
+
type: command
|
|
452
|
+
exec: |
|
|
453
|
+
{% for file in files %}
|
|
454
|
+
eslint "{{ file | escape }}"
|
|
455
|
+
{% endfor %}
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
#### Working with Branch Names
|
|
459
|
+
```yaml
|
|
460
|
+
steps:
|
|
461
|
+
# DANGEROUS
|
|
462
|
+
bad-branch:
|
|
463
|
+
type: command
|
|
464
|
+
exec: "git checkout {{ pr.branch }}" # VULNERABLE!
|
|
465
|
+
|
|
466
|
+
# SAFE - use quotes and escape
|
|
467
|
+
safe-branch:
|
|
468
|
+
type: command
|
|
469
|
+
exec: "git checkout '{{ pr.branch | escape }}'"
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
### Additional Security Best Practices
|
|
473
|
+
|
|
474
|
+
1. **Environment Variables in Liquid** - Only safe environment variables are exposed in Liquid templates:
|
|
475
|
+
- Allowed prefixes: `CI_`, `GITHUB_`, `RUNNER_`, `NODE_`, `npm_`
|
|
476
|
+
- Always available: `PATH`, `HOME`, `USER`, `PWD`
|
|
477
|
+
- All others are filtered out for security
|
|
478
|
+
|
|
479
|
+
2. **Shell Environment** - Commands inherit the full process environment, so shell expansion (`$VAR`) has access to all variables
|
|
480
|
+
|
|
481
|
+
3. **Secrets Management**:
|
|
482
|
+
```yaml
|
|
483
|
+
checks:
|
|
484
|
+
# BAD - Don't echo secrets
|
|
485
|
+
bad-secret:
|
|
486
|
+
type: command
|
|
487
|
+
exec: "echo $API_KEY" # DON'T DO THIS
|
|
488
|
+
|
|
489
|
+
# GOOD - Use secrets safely
|
|
490
|
+
good-secret:
|
|
491
|
+
type: command
|
|
492
|
+
exec: "curl -H 'Authorization: Bearer $API_KEY' https://api.example.com"
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
4. **File System Access** - Commands run with the same permissions as the visor process:
|
|
496
|
+
```yaml
|
|
497
|
+
checks:
|
|
498
|
+
# Be careful with file operations
|
|
499
|
+
file-check:
|
|
500
|
+
type: command
|
|
501
|
+
exec: |
|
|
502
|
+
# Validate path is within project
|
|
503
|
+
FILE="{{ files[0] | escape }}"
|
|
504
|
+
if [[ "$FILE" == *".."* ]]; then
|
|
505
|
+
echo "Invalid file path"
|
|
506
|
+
exit 1
|
|
507
|
+
fi
|
|
508
|
+
cat "$FILE"
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
5. **Timeout Protection** - Commands timeout after 60 seconds by default (configurable via `timeout` field)
|
|
512
|
+
6. **Output Limits** - Command output is limited to 10MB to prevent memory exhaustion
|
|
513
|
+
|
|
514
|
+
## Integration with Other Providers
|
|
515
|
+
|
|
516
|
+
The command provider works well with other providers:
|
|
517
|
+
|
|
518
|
+
```yaml
|
|
519
|
+
steps:
|
|
520
|
+
# Run tests first
|
|
521
|
+
test:
|
|
522
|
+
type: command
|
|
523
|
+
exec: "npm test -- --json"
|
|
524
|
+
group: quality
|
|
525
|
+
|
|
526
|
+
# Then analyze results with AI
|
|
527
|
+
test-analysis:
|
|
528
|
+
type: ai
|
|
529
|
+
prompt: |
|
|
530
|
+
Analyze these test results and identify patterns:
|
|
531
|
+
{{ outputs.test | json }}
|
|
532
|
+
depends_on: [test]
|
|
533
|
+
group: analysis
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
## Tips and Best Practices
|
|
537
|
+
|
|
538
|
+
1. **Use JSON output** when possible for better integration
|
|
539
|
+
2. **Set appropriate groups** to organize related checks
|
|
540
|
+
3. **Use tags** for filtering check execution
|
|
541
|
+
4. **Handle errors gracefully** - consider using `|| true` for info-mode commands
|
|
542
|
+
5. **Keep commands simple** - complex logic should be in scripts
|
|
543
|
+
6. **Use dependencies** to chain related commands
|
|
544
|
+
7. **Set timeouts** for long-running commands if needed
|
|
545
|
+
8. **Test locally** using the CLI before deploying
|
|
546
|
+
|
|
547
|
+
## Common Use Cases
|
|
548
|
+
|
|
549
|
+
- **Running tests**: `npm test`, `pytest`, `go test`
|
|
550
|
+
- **Linting**: `eslint`, `ruff`, `golangci-lint`
|
|
551
|
+
- **Security scanning**: `npm audit`, `safety check`, `gosec`
|
|
552
|
+
- **Build verification**: `npm run build`, `make`, `cargo build`
|
|
553
|
+
- **Documentation generation**: `typedoc`, `sphinx-build`
|
|
554
|
+
- **Deployment checks**: `terraform plan`, `kubectl diff`
|
|
555
|
+
- **Custom validations**: Any shell script or command
|
|
556
|
+
|
|
557
|
+
## Comparison with Script Provider
|
|
558
|
+
|
|
559
|
+
Note: There is no "script" provider. The `command` provider is used for executing shell commands. If you see references to a "script" type in error messages or old documentation, use `type: command` instead.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
## 💬 PR Comment Commands
|
|
2
|
+
|
|
3
|
+
- `/review` – Rerun all configured checks on the pull request
|
|
4
|
+
- `/review --check security` – Run only security checks
|
|
5
|
+
- `/review --check performance` – Run only performance checks
|
|
6
|
+
- `/visor …` – Ask the assistant a question about the code or context
|
|
7
|
+
- `/review --help` – Show available review commands
|
|
8
|
+
|