@probelabs/visor 0.1.106 → 0.1.111
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +71 -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 +624 -0
- package/defaults/visor.tests.yaml +685 -0
- package/defaults/visor.yaml +483 -0
- 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 +28 -9
- 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 +7 -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 +624 -0
- package/dist/defaults/visor.tests.yaml +685 -0
- package/dist/defaults/visor.yaml +483 -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 +237 -0
- package/dist/docs/ai-configuration.md +535 -0
- package/dist/docs/ai-custom-tools-usage.md +261 -0
- package/dist/docs/ai-custom-tools.md +392 -0
- package/dist/docs/author-permissions.md +610 -0
- package/dist/docs/bot-transports-rfc.md +23 -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 +324 -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-pause-resume-rfc.md +192 -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/lifecycle-hooks.md +253 -0
- package/dist/docs/limits.md +64 -0
- package/dist/docs/liquid-templates.md +490 -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/providers/git-checkout.md +589 -0
- package/dist/docs/recipes.md +474 -0
- package/dist/docs/rfc/git-checkout-step.md +601 -0
- package/dist/docs/rfc/on_init-hook.md +1294 -0
- package/dist/docs/rfc/workspace-isolation.md +216 -0
- package/dist/docs/roadmap/criticality-implementation-tasks.md +92 -0
- package/dist/docs/router-patterns.md +339 -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 +71 -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-custom-tools-example.yaml +206 -0
- package/dist/examples/ai-custom-tools-simple.yaml +76 -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/git-checkout-basic.yaml +32 -0
- package/dist/examples/git-checkout-compare.yaml +59 -0
- package/dist/examples/git-checkout-cross-repo.yaml +76 -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/on-init-import-demo.yaml +179 -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/reusable-tools.yaml +92 -0
- package/dist/examples/reusable-workflows.yaml +88 -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/session-reuse-self.yaml +81 -0
- package/dist/examples/slack-simple-chat.yaml +775 -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 +3 -0
- package/dist/failure-condition-evaluator.d.ts.map +1 -1
- package/dist/frontends/github-frontend.d.ts +58 -0
- package/dist/frontends/github-frontend.d.ts.map +1 -0
- package/dist/frontends/host.d.ts +47 -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/frontends/slack-frontend.d.ts +58 -0
- package/dist/frontends/slack-frontend.d.ts.map +1 -0
- package/dist/generated/config-schema.d.ts +967 -57
- package/dist/generated/config-schema.d.ts.map +1 -1
- package/dist/generated/config-schema.json +1033 -56
- 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 +2 -4
- package/dist/github-comments.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +134327 -99004
- package/dist/liquid-extensions.d.ts.map +1 -1
- package/dist/logger.d.ts +2 -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-2026-01-20T19-22-58-043Z.ndjson +138 -0
- package/dist/output/traces/run-2026-01-20T19-23-52-175Z.ndjson +1067 -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 +12 -0
- 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 +43 -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/git-checkout-provider.d.ts +25 -0
- package/dist/providers/git-checkout-provider.d.ts.map +1 -0
- package/dist/providers/github-ops-provider.d.ts.map +1 -1
- package/dist/providers/http-client-provider.d.ts +4 -4
- package/dist/providers/http-client-provider.d.ts.map +1 -1
- package/dist/providers/human-input-check-provider.d.ts +5 -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 +10 -4
- package/dist/providers/mcp-check-provider.d.ts.map +1 -1
- package/dist/providers/mcp-custom-sse-server.d.ts +66 -0
- package/dist/providers/mcp-custom-sse-server.d.ts.map +1 -0
- 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/check-provider-registry-534KL5HT.mjs +27 -0
- package/dist/sdk/chunk-23L3QRYX.mjs +16872 -0
- package/dist/sdk/chunk-23L3QRYX.mjs.map +1 -0
- package/dist/sdk/{chunk-TUTOLSFV.mjs → chunk-3OMWVM6J.mjs} +11 -1
- package/dist/sdk/chunk-3OMWVM6J.mjs.map +1 -0
- package/dist/sdk/chunk-7UK3NIIT.mjs +482 -0
- package/dist/sdk/chunk-7UK3NIIT.mjs.map +1 -0
- package/dist/sdk/chunk-AGIZJ4UZ.mjs +173 -0
- package/dist/sdk/chunk-AGIZJ4UZ.mjs.map +1 -0
- package/dist/sdk/chunk-AIVFBIS4.mjs +1371 -0
- package/dist/sdk/chunk-AIVFBIS4.mjs.map +1 -0
- package/dist/sdk/chunk-AK6BVWIT.mjs +426 -0
- package/dist/sdk/chunk-AK6BVWIT.mjs.map +1 -0
- package/dist/sdk/chunk-AUT26LHW.mjs +139 -0
- package/dist/sdk/chunk-AUT26LHW.mjs.map +1 -0
- package/dist/sdk/chunk-BOVFH3LI.mjs +232 -0
- package/dist/sdk/chunk-BOVFH3LI.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-HTOKWMPO.mjs +157 -0
- package/dist/sdk/chunk-HTOKWMPO.mjs.map +1 -0
- package/dist/sdk/chunk-NAW3DB3I.mjs +197 -0
- package/dist/sdk/chunk-NAW3DB3I.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-QR7MOMJH.mjs +558 -0
- package/dist/sdk/chunk-QR7MOMJH.mjs.map +1 -0
- package/dist/sdk/chunk-QY2XYPEV.mjs +3556 -0
- package/dist/sdk/chunk-QY2XYPEV.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-SIWNBRTK.mjs +800 -0
- package/dist/sdk/chunk-SIWNBRTK.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/command-executor-TYUV6HUS.mjs +14 -0
- package/dist/sdk/config-YNC2EOOT.mjs +16 -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-YGTF2GHG.mjs +17 -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-SIAEOCON.mjs +1420 -0
- package/dist/sdk/github-frontend-SIAEOCON.mjs.map +1 -0
- package/dist/sdk/host-DXUYTNMU.mjs +52 -0
- package/dist/sdk/host-DXUYTNMU.mjs.map +1 -0
- package/dist/sdk/{liquid-extensions-KVL4MKRH.mjs → liquid-extensions-PKWCKK7E.mjs} +8 -2
- package/dist/sdk/memory-store-XGBB7LX7.mjs +12 -0
- package/dist/sdk/memory-store-XGBB7LX7.mjs.map +1 -0
- package/dist/sdk/metrics-7PP3EJUH.mjs +29 -0
- package/dist/sdk/metrics-7PP3EJUH.mjs.map +1 -0
- package/dist/sdk/ndjson-sink-B4V4NTAQ.mjs +44 -0
- package/dist/sdk/ndjson-sink-B4V4NTAQ.mjs.map +1 -0
- package/dist/sdk/prompt-state-YRJY6QAL.mjs +16 -0
- package/dist/sdk/prompt-state-YRJY6QAL.mjs.map +1 -0
- package/dist/sdk/renderer-schema-LPKN5UJS.mjs +51 -0
- package/dist/sdk/renderer-schema-LPKN5UJS.mjs.map +1 -0
- package/dist/sdk/routing-6N45MJ4F.mjs +24 -0
- package/dist/sdk/routing-6N45MJ4F.mjs.map +1 -0
- package/dist/sdk/sdk.d.mts +541 -22
- package/dist/sdk/sdk.d.ts +541 -22
- package/dist/sdk/sdk.js +27963 -16505
- package/dist/sdk/sdk.js.map +1 -1
- package/dist/sdk/sdk.mjs +1116 -2169
- package/dist/sdk/sdk.mjs.map +1 -1
- package/dist/sdk/session-registry-4E6YRQ77.mjs +10 -0
- package/dist/sdk/session-registry-4E6YRQ77.mjs.map +1 -0
- package/dist/sdk/slack-frontend-BVKW3GD5.mjs +735 -0
- package/dist/sdk/slack-frontend-BVKW3GD5.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-GSLPPLCD.mjs} +2 -2
- package/dist/sdk/tracer-init-GSLPPLCD.mjs.map +1 -0
- package/dist/sdk/workflow-registry-R6KSACFR.mjs +12 -0
- package/dist/sdk/workflow-registry-R6KSACFR.mjs.map +1 -0
- package/dist/sdk.d.ts.map +1 -1
- package/dist/slack/adapter.d.ts +36 -0
- package/dist/slack/adapter.d.ts.map +1 -0
- package/dist/slack/cache-prewarmer.d.ts +31 -0
- package/dist/slack/cache-prewarmer.d.ts.map +1 -0
- package/dist/slack/client.d.ts +77 -0
- package/dist/slack/client.d.ts.map +1 -0
- package/dist/slack/markdown.d.ts +45 -0
- package/dist/slack/markdown.d.ts.map +1 -0
- package/dist/slack/prompt-state.d.ts +33 -0
- package/dist/slack/prompt-state.d.ts.map +1 -0
- package/dist/slack/rate-limiter.d.ts +56 -0
- package/dist/slack/rate-limiter.d.ts.map +1 -0
- package/dist/slack/signature.d.ts +2 -0
- package/dist/slack/signature.d.ts.map +1 -0
- package/dist/slack/socket-runner.d.ts +42 -0
- package/dist/slack/socket-runner.d.ts.map +1 -0
- package/dist/slack/thread-cache.d.ts +51 -0
- package/dist/slack/thread-cache.d.ts.map +1 -0
- 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 +17 -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/on-init-handlers.d.ts +43 -0
- package/dist/state-machine/dispatch/on-init-handlers.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 +79 -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 +159 -0
- package/dist/state-machine-execution-engine.d.ts.map +1 -0
- package/dist/telemetry/opentelemetry.d.ts.map +1 -1
- package/dist/telemetry/state-capture.d.ts +5 -0
- package/dist/telemetry/state-capture.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 +45 -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 +127 -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/recorders/slack-recorder.d.ts +17 -0
- package/dist/test-runner/recorders/slack-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-2026-01-20T19-22-58-043Z.ndjson +138 -0
- package/dist/traces/run-2026-01-20T19-23-52-175Z.ndjson +1067 -0
- package/dist/types/bot.d.ts +109 -0
- package/dist/types/bot.d.ts.map +1 -0
- package/dist/types/cli.d.ts +8 -1
- package/dist/types/cli.d.ts.map +1 -1
- package/dist/types/config.d.ts +459 -9
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/engine.d.ts +177 -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/git-checkout.d.ts +76 -0
- package/dist/types/git-checkout.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/json-text-extractor.d.ts +17 -0
- package/dist/utils/json-text-extractor.d.ts.map +1 -0
- package/dist/utils/sandbox.d.ts +10 -0
- 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 +8 -0
- package/dist/utils/template-context.d.ts.map +1 -0
- package/dist/utils/tracer-init.d.ts.map +1 -1
- package/dist/utils/workspace-manager.d.ts +118 -0
- package/dist/utils/workspace-manager.d.ts.map +1 -0
- package/dist/utils/worktree-cleanup.d.ts +33 -0
- package/dist/utils/worktree-cleanup.d.ts.map +1 -0
- package/dist/utils/worktree-manager.d.ts +153 -0
- package/dist/utils/worktree-manager.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 +12 -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 → check-provider-registry-534KL5HT.mjs.map} +0 -0
- /package/dist/sdk/{check-execution-engine-6QJXYYON.mjs.map → command-executor-TYUV6HUS.mjs.map} +0 -0
- /package/dist/sdk/{check-execution-engine-PJZ4ZOKG.mjs.map → config-YNC2EOOT.mjs.map} +0 -0
- /package/dist/sdk/{config-merger-TWUBWFC2.mjs.map → config-merger-PX3WIT57.mjs.map} +0 -0
- /package/dist/sdk/{liquid-extensions-KVL4MKRH.mjs.map → failure-condition-evaluator-YGTF2GHG.mjs.map} +0 -0
- /package/dist/sdk/{tracer-init-WC75N5NW.mjs.map → liquid-extensions-PKWCKK7E.mjs.map} +0 -0
|
@@ -0,0 +1,490 @@
|
|
|
1
|
+
# Liquid Templates in Visor
|
|
2
|
+
|
|
3
|
+
Visor uses [LiquidJS](https://liquidjs.com/) for templating in prompts, commands, and transformations. This enables dynamic content generation based on PR context, check outputs, and environment variables.
|
|
4
|
+
|
|
5
|
+
## Available Variables
|
|
6
|
+
|
|
7
|
+
### In Prompts and Commands
|
|
8
|
+
|
|
9
|
+
- `pr` - Pull request information
|
|
10
|
+
- `pr.number` - PR number
|
|
11
|
+
- `pr.title` - PR title
|
|
12
|
+
- `pr.body` - PR description
|
|
13
|
+
- `pr.author` - PR author username
|
|
14
|
+
- `pr.authorAssociation` - Author's association (OWNER, MEMBER, COLLABORATOR, CONTRIBUTOR, etc.)
|
|
15
|
+
- `pr.baseBranch` - Target branch
|
|
16
|
+
- `pr.headBranch` - Source branch
|
|
17
|
+
- `pr.totalAdditions` - Lines added
|
|
18
|
+
- `pr.totalDeletions` - Lines removed
|
|
19
|
+
|
|
20
|
+
- `files` - Array of changed files
|
|
21
|
+
- `files[].filename` - File path
|
|
22
|
+
- `files[].status` - Change type (added, modified, deleted)
|
|
23
|
+
- `files[].additions` - Lines added in this file
|
|
24
|
+
- `files[].deletions` - Lines removed in this file
|
|
25
|
+
- `files[].patch` - Diff content
|
|
26
|
+
|
|
27
|
+
- `event` - GitHub event context (varies by trigger)
|
|
28
|
+
|
|
29
|
+
- `outputs` - Results from dependency checks (Map)
|
|
30
|
+
- Access current value: `outputs.checkName`
|
|
31
|
+
- Access history: `outputs.history.checkName` - Array of all previous outputs from this check
|
|
32
|
+
- See [Output History](./output-history.md) for detailed usage in loops, retries, and forEach
|
|
33
|
+
|
|
34
|
+
- `env` - Safe environment variables
|
|
35
|
+
|
|
36
|
+
- `utils` - Utility functions
|
|
37
|
+
- `utils.timestamp` - Current timestamp
|
|
38
|
+
- `utils.date` - Current date
|
|
39
|
+
|
|
40
|
+
## Custom Tags
|
|
41
|
+
|
|
42
|
+
### Reading Files
|
|
43
|
+
|
|
44
|
+
The `readfile` tag allows you to include content from files within your templates:
|
|
45
|
+
|
|
46
|
+
```liquid
|
|
47
|
+
# Read a file by path
|
|
48
|
+
{% readfile "config/settings.json" %}
|
|
49
|
+
|
|
50
|
+
# Read using a variable
|
|
51
|
+
{% readfile configPath %}
|
|
52
|
+
|
|
53
|
+
# Use in conditionals
|
|
54
|
+
{% if includeConfig %}
|
|
55
|
+
Config: {% readfile "config.yaml" %}
|
|
56
|
+
{% endif %}
|
|
57
|
+
|
|
58
|
+
# Use in loops
|
|
59
|
+
{% for file in configFiles %}
|
|
60
|
+
{% readfile file %}
|
|
61
|
+
{% endfor %}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Parsing JSON from Files
|
|
65
|
+
|
|
66
|
+
You can read JSON files and parse them into objects using the `parse_json` filter:
|
|
67
|
+
|
|
68
|
+
```liquid
|
|
69
|
+
# Read and parse JSON, then access properties
|
|
70
|
+
{% capture config_json %}{% readfile "config.json" %}{% endcapture %}
|
|
71
|
+
{% assign config = config_json | parse_json %}
|
|
72
|
+
Version: {{ config.version }}
|
|
73
|
+
Name: {{ config.name }}
|
|
74
|
+
|
|
75
|
+
# Use parsed JSON in conditionals
|
|
76
|
+
{% if config.enabled %}
|
|
77
|
+
Feature is enabled
|
|
78
|
+
{% endif %}
|
|
79
|
+
|
|
80
|
+
# Iterate over arrays from JSON
|
|
81
|
+
{% for item in config.items %}
|
|
82
|
+
- {{ item.name }}: {{ item.value }}
|
|
83
|
+
{% endfor %}
|
|
84
|
+
|
|
85
|
+
# Combine with other filters
|
|
86
|
+
{% assign pkg = '{% readfile "package.json" %}' | parse_json %}
|
|
87
|
+
Dependencies: {{ pkg.dependencies | json }}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**Security notes:**
|
|
91
|
+
- Files are read relative to the project root
|
|
92
|
+
- Directory traversal attempts are blocked
|
|
93
|
+
- Absolute paths are not allowed
|
|
94
|
+
- Invalid JSON returns the original string
|
|
95
|
+
|
|
96
|
+
## Useful Filters
|
|
97
|
+
|
|
98
|
+
### JSON Serialization
|
|
99
|
+
|
|
100
|
+
The `json` filter serializes objects to JSON strings, useful for debugging or passing to tools:
|
|
101
|
+
|
|
102
|
+
```liquid
|
|
103
|
+
# Debug output object
|
|
104
|
+
{{ outputs | json }}
|
|
105
|
+
|
|
106
|
+
### Author Permission Filters
|
|
107
|
+
|
|
108
|
+
> **📖 For complete documentation, see [Author Permissions Guide](./author-permissions.md)**
|
|
109
|
+
|
|
110
|
+
Check the PR author's permission level in Liquid templates using filters:
|
|
111
|
+
|
|
112
|
+
```liquid
|
|
113
|
+
# Check if author has at least MEMBER permission
|
|
114
|
+
{% if pr.authorAssociation | has_min_permission: "MEMBER" %}
|
|
115
|
+
Running quick scan for trusted member...
|
|
116
|
+
{% else %}
|
|
117
|
+
Running full security scan for external contributor...
|
|
118
|
+
{% endif %}
|
|
119
|
+
|
|
120
|
+
# Check specific permission levels
|
|
121
|
+
{% if pr.authorAssociation | is_owner %}
|
|
122
|
+
🎖️ Repository owner
|
|
123
|
+
{% elsif pr.authorAssociation | is_member %}
|
|
124
|
+
👥 Organization member
|
|
125
|
+
{% elsif pr.authorAssociation | is_collaborator %}
|
|
126
|
+
🤝 Collaborator
|
|
127
|
+
{% elsif pr.authorAssociation | is_first_timer %}
|
|
128
|
+
🎉 First-time contributor - Welcome!
|
|
129
|
+
{% endif %}
|
|
130
|
+
|
|
131
|
+
# Use in prompts
|
|
132
|
+
{% if pr.authorAssociation | is_member %}
|
|
133
|
+
Review this PR from team member {{ pr.author }}.
|
|
134
|
+
Focus on logic and design patterns.
|
|
135
|
+
{% else %}
|
|
136
|
+
Review this PR from external contributor {{ pr.author }}.
|
|
137
|
+
Pay extra attention to security and best practices.
|
|
138
|
+
{% endif %}
|
|
139
|
+
|
|
140
|
+
# Conditional commands
|
|
141
|
+
{% if pr.authorAssociation | has_min_permission: "COLLABORATOR" %}
|
|
142
|
+
gh pr review --approve
|
|
143
|
+
{% else %}
|
|
144
|
+
gh pr review --comment --body "Thanks! A maintainer will review soon."
|
|
145
|
+
{% endif %}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
**Available filters:**
|
|
149
|
+
- `has_min_permission: "LEVEL"` - Check if >= permission level
|
|
150
|
+
- `is_owner` - Repository owner
|
|
151
|
+
- `is_member` - Organization member or owner
|
|
152
|
+
- `is_collaborator` - Collaborator or higher
|
|
153
|
+
- `is_contributor` - Has contributed before
|
|
154
|
+
- `is_first_timer` - First-time contributor
|
|
155
|
+
|
|
156
|
+
### Auto‑JSON Access
|
|
157
|
+
|
|
158
|
+
When a dependency's output is a JSON string, Visor exposes it as an object automatically in templates:
|
|
159
|
+
|
|
160
|
+
```liquid
|
|
161
|
+
# If `fetch-tickets` printed '{"tickets":[{"key":"TT-101"}]}'
|
|
162
|
+
Ticket key: {{ outputs['fetch-tickets'].tickets[0].key }}
|
|
163
|
+
# No JSON.parse required
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
If the underlying value is plain text, it behaves as a normal string.
|
|
167
|
+
|
|
168
|
+
# Debug specific check output
|
|
169
|
+
{{ outputs.security | json }}
|
|
170
|
+
|
|
171
|
+
# Pass to command safely
|
|
172
|
+
echo '{{ pr | json }}' | jq .
|
|
173
|
+
|
|
174
|
+
# Create JSON payload
|
|
175
|
+
{
|
|
176
|
+
"title": {{ pr.title | json }},
|
|
177
|
+
"files": {{ files | json }},
|
|
178
|
+
"outputs": {{ outputs | json }}
|
|
179
|
+
}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### String Filters
|
|
183
|
+
|
|
184
|
+
```liquid
|
|
185
|
+
{{ pr.title | escape }} # HTML escape
|
|
186
|
+
{{ pr.title | upcase }} # Uppercase
|
|
187
|
+
{{ pr.title | downcase }} # Lowercase
|
|
188
|
+
{{ pr.title | capitalize }} # Capitalize first letter
|
|
189
|
+
{{ pr.title | truncate: 50 }} # Truncate to 50 chars
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### Array Filters
|
|
193
|
+
|
|
194
|
+
```liquid
|
|
195
|
+
{{ files | size }} # Count of files
|
|
196
|
+
{{ files | first }} # First file
|
|
197
|
+
{{ files | last }} # Last file
|
|
198
|
+
{{ files | map: "filename" }} # Array of filenames
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Chat History Helper
|
|
202
|
+
|
|
203
|
+
The `chat_history` filter turns one or more check histories into a linear, timestamp‑sorted chat transcript. This is especially useful for human‑input + AI chat flows (Slack, CLI, etc.).
|
|
204
|
+
|
|
205
|
+
Basic usage:
|
|
206
|
+
|
|
207
|
+
```liquid
|
|
208
|
+
{% assign history = '' | chat_history: 'ask', 'reply' %}
|
|
209
|
+
{% for m in history %}
|
|
210
|
+
{{ m.role | capitalize }}: {{ m.text }}
|
|
211
|
+
{% endfor %}
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Each `history` item has:
|
|
215
|
+
|
|
216
|
+
- `m.step` – originating check name (e.g. `"ask"`, `"reply"`)
|
|
217
|
+
- `m.role` – logical role (`"user"` or `"assistant"` by default)
|
|
218
|
+
- `m.text` – normalized text (from `.text` / `.content` / fallback field)
|
|
219
|
+
- `m.ts` – timestamp used for ordering
|
|
220
|
+
- `m.raw` – original `outputs_history[step][i]` object
|
|
221
|
+
|
|
222
|
+
By default:
|
|
223
|
+
|
|
224
|
+
- Human input checks (`type: human-input`) map to `role: "user"`.
|
|
225
|
+
- AI checks (`type: ai`) map to `role: "assistant"`.
|
|
226
|
+
- Messages are sorted by `ts` ascending across all steps.
|
|
227
|
+
|
|
228
|
+
Advanced options (all optional, passed as keyword arguments):
|
|
229
|
+
|
|
230
|
+
```liquid
|
|
231
|
+
{% assign history = '' | chat_history:
|
|
232
|
+
'ask',
|
|
233
|
+
'reply',
|
|
234
|
+
direction: 'asc', # or 'desc' (default: 'asc')
|
|
235
|
+
limit: 50, # keep at most N messages (after sorting)
|
|
236
|
+
text: {
|
|
237
|
+
default_field: 'text', # which field to prefer when .text/.content missing
|
|
238
|
+
by_step: {
|
|
239
|
+
'summary': 'summary.text' # use nested path for specific steps
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
roles: {
|
|
243
|
+
by_type: {
|
|
244
|
+
'human-input': 'user',
|
|
245
|
+
'ai': 'assistant'
|
|
246
|
+
},
|
|
247
|
+
by_step: {
|
|
248
|
+
'system-note': 'system'
|
|
249
|
+
},
|
|
250
|
+
default: 'assistant'
|
|
251
|
+
},
|
|
252
|
+
role_map: 'ask=user,reply=assistant' # compact per-step override
|
|
253
|
+
%}
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
Precedence for `role` resolution:
|
|
257
|
+
|
|
258
|
+
1. `role_map` / `roles.by_step[step]` (explicit step override)
|
|
259
|
+
2. `roles.by_type[checkType]` (e.g. `'human-input'`, `'ai'`)
|
|
260
|
+
3. Built‑in defaults: `human-input → user`, `ai → assistant`
|
|
261
|
+
4. `roles.default` if provided
|
|
262
|
+
5. Fallback: `"assistant"`
|
|
263
|
+
|
|
264
|
+
Examples:
|
|
265
|
+
|
|
266
|
+
```liquid
|
|
267
|
+
{%- assign history = '' | chat_history: 'ask', 'reply' -%}
|
|
268
|
+
{%- for m in history -%}
|
|
269
|
+
{{ m.role }}: {{ m.text }}
|
|
270
|
+
{%- endfor -%}
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
```liquid
|
|
274
|
+
{%- assign history = '' | chat_history: 'ask', 'clarify', 'reply', direction: 'desc', limit: 5 -%}
|
|
275
|
+
{%- for m in history -%}
|
|
276
|
+
[{{ m.step }}][{{ m.role }}] {{ m.text }}
|
|
277
|
+
{%- endfor -%}
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
<!-- Removed merge_sort_by example: filter no longer provided -->
|
|
281
|
+
|
|
282
|
+
### Conversation Context (Slack, GitHub, etc.)
|
|
283
|
+
|
|
284
|
+
For transport‑aware prompts, Visor exposes a normalized `conversation` object in Liquid
|
|
285
|
+
for AI checks:
|
|
286
|
+
|
|
287
|
+
```liquid
|
|
288
|
+
{% if conversation %}
|
|
289
|
+
Transport: {{ conversation.transport }} {# 'slack', 'github', ... #}
|
|
290
|
+
Thread: {{ conversation.thread.id }}
|
|
291
|
+
{% if conversation.thread.url %}
|
|
292
|
+
Link: {{ conversation.thread.url }}
|
|
293
|
+
{% endif %}
|
|
294
|
+
|
|
295
|
+
{% for m in conversation.messages %}
|
|
296
|
+
{{ m.user }} ({{ m.role }} at {{ m.timestamp }}): {{ m.text }}
|
|
297
|
+
{% endfor %}
|
|
298
|
+
|
|
299
|
+
Latest:
|
|
300
|
+
{{ conversation.current.user }} ({{ conversation.current.role }}): {{ conversation.current.text }}
|
|
301
|
+
{% endif %}
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
Contract:
|
|
305
|
+
|
|
306
|
+
- `conversation.transport` – transport identifier (`'slack'`, `'github'`, etc.)
|
|
307
|
+
- `conversation.thread.id` – stable thread key:
|
|
308
|
+
- Slack: `"channel:thread_ts"`
|
|
309
|
+
- GitHub: `"owner/repo#number"`
|
|
310
|
+
- `conversation.thread.url` – optional deep link (Slack thread or GitHub PR/issue URL)
|
|
311
|
+
- `conversation.messages[]` – full history as normalized messages:
|
|
312
|
+
- `role`: `'user' | 'bot'`
|
|
313
|
+
- `user`: Slack user id or GitHub login
|
|
314
|
+
- `text`: message body
|
|
315
|
+
- `timestamp`: message timestamp
|
|
316
|
+
- `origin`: e.g. `'visor'` for bot messages, `'github'` for GitHub messages
|
|
317
|
+
- `conversation.current` – message that triggered the current run (same shape as above)
|
|
318
|
+
- `conversation.attributes` – extra metadata (e.g. `channel`, `thread_ts`, `owner`, `repo`, `number`, `event_name`, `action`)
|
|
319
|
+
|
|
320
|
+
Transport‑specific helpers:
|
|
321
|
+
|
|
322
|
+
- Slack:
|
|
323
|
+
- `slack.event` – raw Slack event payload (channel, ts, text, etc.)
|
|
324
|
+
- `slack.conversation` – same structure as `conversation` for Slack runs
|
|
325
|
+
- GitHub:
|
|
326
|
+
- `event` – GitHub event metadata and payload (unchanged)
|
|
327
|
+
- A normalized GitHub conversation is also attached so `conversation.transport == 'github'`
|
|
328
|
+
reflects the PR/issue body and comment history.
|
|
329
|
+
|
|
330
|
+
You can combine `conversation` with `chat_history`:
|
|
331
|
+
|
|
332
|
+
```liquid
|
|
333
|
+
{% assign history = '' | chat_history: 'ask', 'reply' %}
|
|
334
|
+
{% if conversation and conversation.transport == 'slack' %}
|
|
335
|
+
# Slack thread:
|
|
336
|
+
{% for m in conversation.messages %}
|
|
337
|
+
{{ m.user }}: {{ m.text }}
|
|
338
|
+
{% endfor %}
|
|
339
|
+
{% endif %}
|
|
340
|
+
|
|
341
|
+
{% for m in history %}
|
|
342
|
+
[{{ m.step }}][{{ m.role }}] {{ m.text }}
|
|
343
|
+
{% endfor %}
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
## Examples
|
|
347
|
+
|
|
348
|
+
### Debugging Outputs
|
|
349
|
+
|
|
350
|
+
When you see `[Object]` in your templates, use the `json` filter:
|
|
351
|
+
|
|
352
|
+
```yaml
|
|
353
|
+
steps:
|
|
354
|
+
debug-outputs:
|
|
355
|
+
type: log
|
|
356
|
+
message: |
|
|
357
|
+
Raw outputs object: {{ outputs }}
|
|
358
|
+
JSON serialized: {{ outputs | json }}
|
|
359
|
+
|
|
360
|
+
Specific check output:
|
|
361
|
+
{{ outputs.security | json }}
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
### Conditional Content
|
|
365
|
+
|
|
366
|
+
```liquid
|
|
367
|
+
{% if pr.totalAdditions > 500 %}
|
|
368
|
+
Large PR detected with {{ pr.totalAdditions }} additions.
|
|
369
|
+
{% endif %}
|
|
370
|
+
|
|
371
|
+
{% for file in files %}
|
|
372
|
+
{% if file.status == "added" %}
|
|
373
|
+
New file: {{ file.filename }}
|
|
374
|
+
{% endif %}
|
|
375
|
+
{% endfor %}
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
### Safe Command Execution
|
|
379
|
+
|
|
380
|
+
```yaml
|
|
381
|
+
steps:
|
|
382
|
+
analyze-with-tool:
|
|
383
|
+
type: command
|
|
384
|
+
exec: |
|
|
385
|
+
# Use json filter for safe data passing
|
|
386
|
+
echo '{{ pr | json }}' > /tmp/pr-data.json
|
|
387
|
+
echo '{{ outputs | json }}' > /tmp/outputs.json
|
|
388
|
+
|
|
389
|
+
# Process with external tool
|
|
390
|
+
my-analyzer --pr-file /tmp/pr-data.json --outputs /tmp/outputs.json
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
### Transform Responses
|
|
394
|
+
|
|
395
|
+
```yaml
|
|
396
|
+
steps:
|
|
397
|
+
http-webhook:
|
|
398
|
+
type: http_input
|
|
399
|
+
transform: |
|
|
400
|
+
{
|
|
401
|
+
"processed": true,
|
|
402
|
+
"original": {{ data | json }},
|
|
403
|
+
"pr_context": {{ pr | json }}
|
|
404
|
+
}
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
## Best Practices
|
|
408
|
+
|
|
409
|
+
1. **Use `json` filter for debugging**: When you need to inspect complex objects
|
|
410
|
+
2. **Escape user input**: Use appropriate filters (`escape`, `json`) when including user content
|
|
411
|
+
3. **Validate before parsing**: When transforming to JSON, ensure valid syntax
|
|
412
|
+
4. **Keep templates readable**: Use proper indentation and comments
|
|
413
|
+
|
|
414
|
+
## Debugging Techniques
|
|
415
|
+
|
|
416
|
+
### Using the `json` Filter for Inspection
|
|
417
|
+
|
|
418
|
+
The `json` filter is your primary debugging tool for inspecting data structures:
|
|
419
|
+
|
|
420
|
+
```liquid
|
|
421
|
+
# Debug all available outputs
|
|
422
|
+
All outputs: {{ outputs | json }}
|
|
423
|
+
|
|
424
|
+
# Debug specific dependency output
|
|
425
|
+
Fetch result: {{ outputs["fetch-tickets"] | json }}
|
|
426
|
+
|
|
427
|
+
# Debug PR context
|
|
428
|
+
PR info: {{ pr | json }}
|
|
429
|
+
|
|
430
|
+
# Debug environment variables
|
|
431
|
+
Environment: {{ env | json }}
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
### Debugging in JavaScript Expressions
|
|
435
|
+
|
|
436
|
+
When using `transform_js` or conditions (`if`, `fail_if`), use the `log()` function:
|
|
437
|
+
|
|
438
|
+
```yaml
|
|
439
|
+
steps:
|
|
440
|
+
my-check:
|
|
441
|
+
type: command
|
|
442
|
+
exec: curl -s https://api.example.com/data
|
|
443
|
+
transform_js: |
|
|
444
|
+
log("Raw output:", output);
|
|
445
|
+
const data = JSON.parse(output);
|
|
446
|
+
log("Parsed data:", data);
|
|
447
|
+
return data.items;
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
See the [Debugging Guide](./debugging.md) for comprehensive debugging techniques.
|
|
451
|
+
|
|
452
|
+
## Troubleshooting
|
|
453
|
+
|
|
454
|
+
### "[Object]" in output
|
|
455
|
+
This means you're trying to output an object directly. Use the `json` filter:
|
|
456
|
+
- Wrong: `{{ outputs }}`
|
|
457
|
+
- Right: `{{ outputs | json }}`
|
|
458
|
+
|
|
459
|
+
### Undefined variable errors
|
|
460
|
+
Check variable names match exactly (case-sensitive). Use conditional checks:
|
|
461
|
+
```liquid
|
|
462
|
+
{% if outputs.security %}
|
|
463
|
+
Security data: {{ outputs.security | json }}
|
|
464
|
+
{% else %}
|
|
465
|
+
No security output available
|
|
466
|
+
{% endif %}
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
### Debugging missing outputs
|
|
470
|
+
```liquid
|
|
471
|
+
# Check what outputs are available
|
|
472
|
+
Available outputs: {{ outputs | json }}
|
|
473
|
+
|
|
474
|
+
# Check specific output existence
|
|
475
|
+
{% if outputs["fetch-data"] %}
|
|
476
|
+
Data found: {{ outputs["fetch-data"] | json }}
|
|
477
|
+
{% else %}
|
|
478
|
+
Warning: fetch-data output not found.
|
|
479
|
+
Available keys: {% for key in outputs %}{{ key }}{% unless forloop.last %}, {% endunless %}{% endfor %}
|
|
480
|
+
{% endif %}
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
### JSON parsing errors
|
|
484
|
+
Ensure proper escaping when creating JSON:
|
|
485
|
+
```liquid
|
|
486
|
+
{
|
|
487
|
+
"title": {{ pr.title | json }}, ✓ Properly escaped
|
|
488
|
+
"title": "{{ pr.title }}" ✗ May break with quotes in title
|
|
489
|
+
}
|
|
490
|
+
```
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Manual Loop Routing Refactor — Plan and Status
|
|
2
|
+
|
|
3
|
+
This document captures the plan, rationale, completed work, and next steps to support manual‑only chat loops in Visor without special tags or goto_js.
|
|
4
|
+
|
|
5
|
+
## Background
|
|
6
|
+
|
|
7
|
+
The previous behavior de‑duplicated a step when re‑routed in the same event, which stalled manual chat loops (ask → refine → ask …). We also experimented with a `repeatable` tag to bypass the guard, but it added concept complexity.
|
|
8
|
+
|
|
9
|
+
## Goals
|
|
10
|
+
|
|
11
|
+
- Manual‑only loop: ask → refine → ask … until refined=true, then finish.
|
|
12
|
+
- No special tags, no goto_js, no schedule event hops.
|
|
13
|
+
- Use fail_if + on_fail/on_success only.
|
|
14
|
+
- Keep default suites green and avoid regressions.
|
|
15
|
+
|
|
16
|
+
## Changes (Completed)
|
|
17
|
+
|
|
18
|
+
1) Engine parity for inline runs
|
|
19
|
+
- Inline `fail_if` evaluation and post‑`fail_if` routing: honor `on_fail.goto` for inline runs.
|
|
20
|
+
|
|
21
|
+
2) Routed re‑runs (no special tags)
|
|
22
|
+
- For `origin='on_fail'`, forward‑run allows re‑running the same step within the same grouped run; loop safety relies on `routing.max_loops`.
|
|
23
|
+
|
|
24
|
+
3) Failure‑aware forward runs
|
|
25
|
+
- Skip static `on_success.goto` chains when the target produced fatal issues (including `fail_if`).
|
|
26
|
+
- For `origin='on_fail'`, schedule only direct dependents of the failed target; skip dependents when any direct dep has fatal issues.
|
|
27
|
+
|
|
28
|
+
4) One‑shot opt‑in
|
|
29
|
+
- `tags: [one_shot]` prevents a terminal step (e.g., `finish`) from running more than once per grouped run.
|
|
30
|
+
|
|
31
|
+
5) Test‑visible history
|
|
32
|
+
- `executeChecks` now attaches `reviewSummary.history` with a safe snapshot of per‑step outputs history for deterministic testing (no I/O).
|
|
33
|
+
|
|
34
|
+
6) Task‑refinement agent (manual‑only)
|
|
35
|
+
- `defaults/task-refinement.yaml` uses `ask` → `refine` loop with `fail_if` and `on_fail/on_success` only; no `repeatable`, no `goto_js`, no `schedule`.
|
|
36
|
+
- Embedded tests: one‑pass and multi‑turn pass locally.
|
|
37
|
+
|
|
38
|
+
## Removed
|
|
39
|
+
|
|
40
|
+
- `repeatable` / `x-repeatable` mechanics: no longer needed.
|
|
41
|
+
|
|
42
|
+
## Tests
|
|
43
|
+
|
|
44
|
+
- YAML suites (green):
|
|
45
|
+
- `defaults/task-refinement.yaml` (both cases)
|
|
46
|
+
- `defaults/visor.tests.yaml` (10/10)
|
|
47
|
+
|
|
48
|
+
- Jest integration (added):
|
|
49
|
+
- `tests/integration/on-fail-no-cascade.test.ts`: verifies failure‑aware forward runs do not cascade into success chains.
|
|
50
|
+
|
|
51
|
+
- Jest integration (deferred):
|
|
52
|
+
- A deterministic loop test using `reviewSummary.history` to assert multiple turns. Will add a tiny test driver to stabilize execution context and tag filtering.
|
|
53
|
+
|
|
54
|
+
## How to Validate Locally
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# Build CLI
|
|
58
|
+
npm run build:cli
|
|
59
|
+
|
|
60
|
+
# Task-refinement YAML
|
|
61
|
+
VISOR_DEBUG=true node dist/index.js test --config defaults/task-refinement.yaml --max-parallel 1
|
|
62
|
+
|
|
63
|
+
# Default suite
|
|
64
|
+
node dist/index.js test --config defaults/visor.tests.yaml --max-parallel 2 --json tmp/visor.json
|
|
65
|
+
|
|
66
|
+
# Focused Jest tests (engine behavior)
|
|
67
|
+
npm test -- on-fail-no-cascade.test.ts
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Acceptance criteria:
|
|
71
|
+
- Both YAML suites pass.
|
|
72
|
+
- No `repeatable`/`x-repeatable` in the codebase.
|
|
73
|
+
- `defaults/task-refinement.yaml` contains no `goto_js` and no `schedule` hops.
|
|
74
|
+
|
|
75
|
+
## Next Steps (Planned)
|
|
76
|
+
|
|
77
|
+
1) Deterministic Jest loop test
|
|
78
|
+
- Add a small engine test driver util (internal only) that seeds event=`manual` and disables tag filtering; assert loop counts via `reviewSummary.history`.
|
|
79
|
+
|
|
80
|
+
2) Documentation
|
|
81
|
+
- Add a short “Manual Loops” page covering `fail_if`+`on_fail/on_success`, loop budgets, and `one_shot` for terminal steps.
|
|
82
|
+
|
|
83
|
+
3) CI gates
|
|
84
|
+
- Add a CI job to run: default YAML, task‑refinement YAML, and the focused Jest tests.
|
|
85
|
+
|
|
86
|
+
## Risk & Rollback
|
|
87
|
+
|
|
88
|
+
- Risk: forward‑run changes could over/under schedule dependents; mitigated by direct‑dependent + fatal‑skip guards.
|
|
89
|
+
- Rollback: revert to pre‑refactor `scheduleForwardRun` and inline `fail_if` handling while keeping `reviewSummary.history` attachment (benign).
|