@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,374 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Real SDK Calculator Example
|
|
5
|
+
*
|
|
6
|
+
* This is a complete, runnable example showing how to use Visor SDK with human-input.
|
|
7
|
+
* The config is defined inline and the workflow executes programmatically.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* npm run build
|
|
11
|
+
* ts-node examples/calculator-sdk-real.ts
|
|
12
|
+
*
|
|
13
|
+
* Or after build:
|
|
14
|
+
* node examples/calculator-sdk-real.js
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import * as readline from 'readline';
|
|
18
|
+
import { HumanInputRequest, VisorConfig } from '../src/types/config';
|
|
19
|
+
import { HumanInputCheckProvider } from '../src/providers/human-input-check-provider';
|
|
20
|
+
import { CheckExecutionEngine } from '../src/check-execution-engine';
|
|
21
|
+
|
|
22
|
+
// ============================================================================
|
|
23
|
+
// CONFIGURATION - Defined inline
|
|
24
|
+
// ============================================================================
|
|
25
|
+
|
|
26
|
+
const calculatorConfig: VisorConfig = {
|
|
27
|
+
version: "1.0",
|
|
28
|
+
|
|
29
|
+
// Memory configuration for storing values between steps
|
|
30
|
+
memory: {
|
|
31
|
+
storage: 'memory',
|
|
32
|
+
namespace: 'calculator'
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
// Define our workflow checks
|
|
36
|
+
checks: {
|
|
37
|
+
// Step 1: Get first number from user
|
|
38
|
+
"get-number1": {
|
|
39
|
+
type: "human-input",
|
|
40
|
+
prompt: "Enter the first number:",
|
|
41
|
+
placeholder: "e.g., 42",
|
|
42
|
+
allow_empty: false
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
// Step 2: Parse and store first number in memory
|
|
46
|
+
"store-number1": {
|
|
47
|
+
type: "memory",
|
|
48
|
+
depends_on: ["get-number1"],
|
|
49
|
+
operation: "set",
|
|
50
|
+
namespace: "calculator",
|
|
51
|
+
key: "number1",
|
|
52
|
+
value_js: "parseFloat(outputs['get-number1'])"
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
// Step 3: Get second number from user
|
|
56
|
+
"get-number2": {
|
|
57
|
+
type: "human-input",
|
|
58
|
+
depends_on: ["store-number1"],
|
|
59
|
+
prompt: "Enter the second number:",
|
|
60
|
+
placeholder: "e.g., 7",
|
|
61
|
+
allow_empty: false
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
// Step 4: Parse and store second number in memory
|
|
65
|
+
"store-number2": {
|
|
66
|
+
type: "memory",
|
|
67
|
+
depends_on: ["get-number2"],
|
|
68
|
+
operation: "set",
|
|
69
|
+
namespace: "calculator",
|
|
70
|
+
key: "number2",
|
|
71
|
+
value_js: "parseFloat(outputs['get-number2'])"
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
// Step 5: Get operation from user
|
|
75
|
+
"get-operation": {
|
|
76
|
+
type: "human-input",
|
|
77
|
+
depends_on: ["store-number2"],
|
|
78
|
+
prompt: "Select operation (+, -, *, /):",
|
|
79
|
+
placeholder: "Enter one of: + - * /",
|
|
80
|
+
allow_empty: false
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
// Step 6: Validate and store operation
|
|
84
|
+
"store-operation": {
|
|
85
|
+
type: "memory",
|
|
86
|
+
depends_on: ["get-operation"],
|
|
87
|
+
operation: "set",
|
|
88
|
+
namespace: "calculator",
|
|
89
|
+
key: "operation",
|
|
90
|
+
value_js: "outputs['get-operation'].trim()",
|
|
91
|
+
// Validate operation
|
|
92
|
+
fail_if: "!['+', '-', '*', '/'].includes(outputs['get-operation'].trim())"
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
// Step 7: Perform calculation using JavaScript
|
|
96
|
+
"calculate": {
|
|
97
|
+
type: "script",
|
|
98
|
+
depends_on: ["store-operation"],
|
|
99
|
+
content: `
|
|
100
|
+
// Get values from memory
|
|
101
|
+
const num1 = memory.get('number1', 'calculator');
|
|
102
|
+
const num2 = memory.get('number2', 'calculator');
|
|
103
|
+
const op = memory.get('operation', 'calculator');
|
|
104
|
+
|
|
105
|
+
// Debug logging
|
|
106
|
+
log('🔢 Calculating:', num1, op, num2);
|
|
107
|
+
|
|
108
|
+
// Validate numbers
|
|
109
|
+
if (isNaN(num1)) {
|
|
110
|
+
throw new Error('First number is invalid: ' + num1);
|
|
111
|
+
}
|
|
112
|
+
if (isNaN(num2)) {
|
|
113
|
+
throw new Error('Second number is invalid: ' + num2);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Perform calculation
|
|
117
|
+
let result;
|
|
118
|
+
switch(op) {
|
|
119
|
+
case '+':
|
|
120
|
+
result = num1 + num2;
|
|
121
|
+
break;
|
|
122
|
+
case '-':
|
|
123
|
+
result = num1 - num2;
|
|
124
|
+
break;
|
|
125
|
+
case '*':
|
|
126
|
+
result = num1 * num2;
|
|
127
|
+
break;
|
|
128
|
+
case '/':
|
|
129
|
+
if (num2 === 0) {
|
|
130
|
+
throw new Error('❌ Division by zero!');
|
|
131
|
+
}
|
|
132
|
+
result = num1 / num2;
|
|
133
|
+
break;
|
|
134
|
+
default:
|
|
135
|
+
throw new Error('Invalid operation: ' + op + ' (must be +, -, *, or /)');
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
log('✅ Result:', result);
|
|
139
|
+
|
|
140
|
+
// Return result for dependent checks
|
|
141
|
+
return result;
|
|
142
|
+
`
|
|
143
|
+
},
|
|
144
|
+
|
|
145
|
+
// Step 8: Display the final result
|
|
146
|
+
"show-result": {
|
|
147
|
+
type: "log",
|
|
148
|
+
depends_on: ["calculate"],
|
|
149
|
+
level: "info",
|
|
150
|
+
message: `
|
|
151
|
+
╔════════════════════════════════════════╗
|
|
152
|
+
║ CALCULATION RESULT ║
|
|
153
|
+
╠════════════════════════════════════════╣
|
|
154
|
+
║ ║
|
|
155
|
+
║ {{ outputs['get-number1'] }} {{ outputs['get-operation'] }} {{ outputs['get-number2'] }} = {{ outputs['calculate'] }}
|
|
156
|
+
║ ║
|
|
157
|
+
╚════════════════════════════════════════╝
|
|
158
|
+
`
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
|
|
162
|
+
// Output configuration
|
|
163
|
+
output: {
|
|
164
|
+
pr_comment: {
|
|
165
|
+
format: "markdown",
|
|
166
|
+
group_by: "check",
|
|
167
|
+
collapse: false
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
// ============================================================================
|
|
173
|
+
// CUSTOM HOOK IMPLEMENTATION
|
|
174
|
+
// ============================================================================
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Custom readline-based input handler for SDK mode
|
|
178
|
+
* This shows how to implement your own input mechanism
|
|
179
|
+
*/
|
|
180
|
+
async function customHumanInputHandler(request: HumanInputRequest): Promise<string> {
|
|
181
|
+
return new Promise((resolve, reject) => {
|
|
182
|
+
const rl = readline.createInterface({
|
|
183
|
+
input: process.stdin,
|
|
184
|
+
output: process.stdout
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
// Display a nice prompt
|
|
188
|
+
console.log('\n┌─────────────────────────────────────────────────────────┐');
|
|
189
|
+
const padding = 57 - request.prompt.length;
|
|
190
|
+
console.log(`│ 💬 ${request.prompt}${' '.repeat(Math.max(0, padding))}│`);
|
|
191
|
+
console.log('└─────────────────────────────────────────────────────────┘');
|
|
192
|
+
|
|
193
|
+
if (request.placeholder) {
|
|
194
|
+
console.log(` ${request.placeholder}`);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
rl.question('\n> ', (answer) => {
|
|
198
|
+
rl.close();
|
|
199
|
+
|
|
200
|
+
const trimmed = answer.trim();
|
|
201
|
+
|
|
202
|
+
// Handle empty input
|
|
203
|
+
if (!trimmed) {
|
|
204
|
+
if (request.allowEmpty) {
|
|
205
|
+
resolve(request.default || '');
|
|
206
|
+
} else if (request.default) {
|
|
207
|
+
console.log(` (using default: ${request.default})`);
|
|
208
|
+
resolve(request.default);
|
|
209
|
+
} else {
|
|
210
|
+
console.log(' ❌ Empty input not allowed\n');
|
|
211
|
+
reject(new Error('Empty input not allowed'));
|
|
212
|
+
}
|
|
213
|
+
} else {
|
|
214
|
+
resolve(trimmed);
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
// Handle timeout if specified
|
|
219
|
+
if (request.timeout) {
|
|
220
|
+
setTimeout(() => {
|
|
221
|
+
rl.close();
|
|
222
|
+
if (request.default) {
|
|
223
|
+
console.log(`\n ⏱️ Timeout - using default: ${request.default}`);
|
|
224
|
+
resolve(request.default);
|
|
225
|
+
} else {
|
|
226
|
+
reject(new Error('Input timeout'));
|
|
227
|
+
}
|
|
228
|
+
}, request.timeout);
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// ============================================================================
|
|
234
|
+
// MAIN EXECUTION
|
|
235
|
+
// ============================================================================
|
|
236
|
+
|
|
237
|
+
async function main() {
|
|
238
|
+
console.log('\n╔═══════════════════════════════════════════════════════════╗');
|
|
239
|
+
console.log('║ Visor SDK Calculator - Real Implementation ║');
|
|
240
|
+
console.log('║ Human Input + Memory + JavaScript ║');
|
|
241
|
+
console.log('╚═══════════════════════════════════════════════════════════╝\n');
|
|
242
|
+
|
|
243
|
+
console.log('This is a real SDK example with:');
|
|
244
|
+
console.log(' ✓ Inline configuration (no YAML files needed)');
|
|
245
|
+
console.log(' ✓ Custom human-input hook using readline');
|
|
246
|
+
console.log(' ✓ Memory provider for state management');
|
|
247
|
+
console.log(' ✓ JavaScript execution for calculations');
|
|
248
|
+
console.log(' ✓ Full dependency chain with error handling\n');
|
|
249
|
+
|
|
250
|
+
console.log('═'.repeat(59));
|
|
251
|
+
console.log('Starting calculator workflow...');
|
|
252
|
+
console.log('═'.repeat(59));
|
|
253
|
+
|
|
254
|
+
try {
|
|
255
|
+
// Set up the human input hook
|
|
256
|
+
HumanInputCheckProvider.setHooks({
|
|
257
|
+
onHumanInput: customHumanInputHandler
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
// Create execution engine
|
|
261
|
+
const engine = new CheckExecutionEngine();
|
|
262
|
+
|
|
263
|
+
// Execute all checks in the workflow
|
|
264
|
+
const checksToRun = Object.keys(calculatorConfig.checks || {});
|
|
265
|
+
|
|
266
|
+
console.log(`\n📋 Running ${checksToRun.length} checks...\n`);
|
|
267
|
+
|
|
268
|
+
const result = await engine.executeChecks({
|
|
269
|
+
checks: checksToRun,
|
|
270
|
+
config: calculatorConfig,
|
|
271
|
+
outputFormat: 'json',
|
|
272
|
+
maxParallelism: 1, // Run sequentially for human input
|
|
273
|
+
debug: false
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
// Display results summary
|
|
277
|
+
console.log('\n═'.repeat(59));
|
|
278
|
+
console.log('✅ Calculator workflow completed successfully!');
|
|
279
|
+
console.log('═'.repeat(59));
|
|
280
|
+
|
|
281
|
+
console.log(`\n📊 Summary:`);
|
|
282
|
+
console.log(` - Total checks: ${checksToRun.length}`);
|
|
283
|
+
console.log(` - Execution time: ${result.executionTime}ms`);
|
|
284
|
+
console.log(` - Timestamp: ${result.timestamp}`);
|
|
285
|
+
console.log(` - Memory namespace: ${calculatorConfig.memory?.namespace}`);
|
|
286
|
+
|
|
287
|
+
// Access memory store to show final values
|
|
288
|
+
if (calculatorConfig.memory) {
|
|
289
|
+
const { MemoryStore } = await import('../src/memory-store');
|
|
290
|
+
const memoryStore = MemoryStore.getInstance(calculatorConfig.memory);
|
|
291
|
+
|
|
292
|
+
console.log('\n💾 Final memory state:');
|
|
293
|
+
const keys = memoryStore.list('calculator');
|
|
294
|
+
for (const key of keys) {
|
|
295
|
+
const value = memoryStore.get(key, 'calculator');
|
|
296
|
+
console.log(` ${key}: ${value}`);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
} catch (error) {
|
|
301
|
+
console.error('\n❌ Error running calculator:');
|
|
302
|
+
if (error instanceof Error) {
|
|
303
|
+
console.error(` ${error.message}`);
|
|
304
|
+
if (error.stack) {
|
|
305
|
+
console.error(`\n${error.stack}`);
|
|
306
|
+
}
|
|
307
|
+
} else {
|
|
308
|
+
console.error(` ${error}`);
|
|
309
|
+
}
|
|
310
|
+
process.exit(1);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
console.log('\n✨ Done!\n');
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// ============================================================================
|
|
317
|
+
// ALTERNATIVE: Non-interactive mode for testing
|
|
318
|
+
// ============================================================================
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Run calculator with predefined inputs (for testing/automation)
|
|
322
|
+
*/
|
|
323
|
+
async function runWithPredefinedInputs(num1: number, num2: number, op: string) {
|
|
324
|
+
console.log('\n🤖 Running in automated mode with predefined inputs...\n');
|
|
325
|
+
|
|
326
|
+
const inputs = [num1.toString(), num2.toString(), op];
|
|
327
|
+
let inputIndex = 0;
|
|
328
|
+
|
|
329
|
+
// Set up hook that uses predefined inputs
|
|
330
|
+
HumanInputCheckProvider.setHooks({
|
|
331
|
+
onHumanInput: async (request: HumanInputRequest) => {
|
|
332
|
+
const value = inputs[inputIndex++];
|
|
333
|
+
console.log(`${request.prompt} ${value}`);
|
|
334
|
+
return value;
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
// Run main workflow
|
|
339
|
+
await main();
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
// ============================================================================
|
|
343
|
+
// ENTRY POINT
|
|
344
|
+
// ============================================================================
|
|
345
|
+
|
|
346
|
+
if (require.main === module) {
|
|
347
|
+
// Check for command line arguments for automated mode
|
|
348
|
+
const args = process.argv.slice(2);
|
|
349
|
+
|
|
350
|
+
if (args.length === 3) {
|
|
351
|
+
// Automated mode: node calculator-sdk-real.js 42 7 +
|
|
352
|
+
const [num1, num2, op] = args;
|
|
353
|
+
runWithPredefinedInputs(parseFloat(num1), parseFloat(num2), op)
|
|
354
|
+
.catch(err => {
|
|
355
|
+
console.error('Error:', err);
|
|
356
|
+
process.exit(1);
|
|
357
|
+
});
|
|
358
|
+
} else if (args.length > 0) {
|
|
359
|
+
console.error('Usage:');
|
|
360
|
+
console.error(' Interactive mode: ts-node calculator-sdk-real.ts');
|
|
361
|
+
console.error(' Automated mode: ts-node calculator-sdk-real.ts <num1> <num2> <op>');
|
|
362
|
+
console.error(' Example: ts-node calculator-sdk-real.ts 42 7 +');
|
|
363
|
+
process.exit(1);
|
|
364
|
+
} else {
|
|
365
|
+
// Interactive mode
|
|
366
|
+
main().catch(err => {
|
|
367
|
+
console.error('Error:', err);
|
|
368
|
+
process.exit(1);
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
// Export for use as a module
|
|
374
|
+
export { calculatorConfig, customHumanInputHandler, main };
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
#!/usr/bin/env ts-node
|
|
2
|
+
/**
|
|
3
|
+
* Automated test for calculator SDK example
|
|
4
|
+
* Tests fail_if validation with outputs from previous checks
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { runChecks } from '../src/sdk';
|
|
8
|
+
import { HumanInputCheckProvider } from '../src/providers/human-input-check-provider';
|
|
9
|
+
import type { VisorConfig, HumanInputRequest } from '../src/types/config';
|
|
10
|
+
|
|
11
|
+
// Calculator configuration
|
|
12
|
+
const calculatorConfig: VisorConfig = {
|
|
13
|
+
version: '1.0',
|
|
14
|
+
checks: {
|
|
15
|
+
'get-number1': {
|
|
16
|
+
type: 'human-input',
|
|
17
|
+
prompt: 'Enter the first number:',
|
|
18
|
+
placeholder: 'e.g., 42',
|
|
19
|
+
allow_empty: false,
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
'store-number1': {
|
|
23
|
+
type: 'memory',
|
|
24
|
+
depends_on: ['get-number1'],
|
|
25
|
+
operation: 'set',
|
|
26
|
+
namespace: 'calculator',
|
|
27
|
+
key: 'number1',
|
|
28
|
+
value_js: "parseFloat(outputs['get-number1'])",
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
'get-number2': {
|
|
32
|
+
type: 'human-input',
|
|
33
|
+
depends_on: ['store-number1'],
|
|
34
|
+
prompt: 'Enter the second number:',
|
|
35
|
+
placeholder: 'e.g., 7',
|
|
36
|
+
allow_empty: false,
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
'store-number2': {
|
|
40
|
+
type: 'memory',
|
|
41
|
+
depends_on: ['get-number2'],
|
|
42
|
+
operation: 'set',
|
|
43
|
+
namespace: 'calculator',
|
|
44
|
+
key: 'number2',
|
|
45
|
+
value_js: "parseFloat(outputs['get-number2'])",
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
'get-operation': {
|
|
49
|
+
type: 'human-input',
|
|
50
|
+
depends_on: ['store-number2'],
|
|
51
|
+
prompt: 'Select operation (+, -, *, /):',
|
|
52
|
+
placeholder: 'Enter one of: + - * /',
|
|
53
|
+
allow_empty: false,
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
'store-operation': {
|
|
57
|
+
type: 'memory',
|
|
58
|
+
depends_on: ['get-operation'],
|
|
59
|
+
operation: 'set',
|
|
60
|
+
namespace: 'calculator',
|
|
61
|
+
key: 'operation',
|
|
62
|
+
value_js: "outputs['get-operation'].trim()",
|
|
63
|
+
// THIS IS THE KEY TEST: fail_if should have access to outputs['get-operation']
|
|
64
|
+
fail_if: "!['+', '-', '*', '/'].includes(outputs['get-operation'].trim())",
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
'calculate': {
|
|
68
|
+
type: 'script',
|
|
69
|
+
depends_on: ['store-operation'],
|
|
70
|
+
content: `
|
|
71
|
+
const num1 = memory.get('number1', 'calculator');
|
|
72
|
+
const num2 = memory.get('number2', 'calculator');
|
|
73
|
+
const op = memory.get('operation', 'calculator');
|
|
74
|
+
|
|
75
|
+
log('🔢 Calculating:', num1, op, num2);
|
|
76
|
+
|
|
77
|
+
let result;
|
|
78
|
+
switch(op) {
|
|
79
|
+
case '+': result = num1 + num2; break;
|
|
80
|
+
case '-': result = num1 - num2; break;
|
|
81
|
+
case '*': result = num1 * num2; break;
|
|
82
|
+
case '/': result = num1 / num2; break;
|
|
83
|
+
default: throw new Error('Invalid operation');
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
log('✅ Result:', result);
|
|
87
|
+
return result;
|
|
88
|
+
`,
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
'show-result': {
|
|
92
|
+
type: 'log',
|
|
93
|
+
depends_on: ['calculate'],
|
|
94
|
+
message: `Result: {{ outputs['get-number1'] }} {{ outputs['get-operation'] }} {{ outputs['get-number2'] }} = {{ outputs['calculate'] }}`,
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
async function runCalculatorTest() {
|
|
100
|
+
console.log('Testing calculator with fail_if validation...\n');
|
|
101
|
+
|
|
102
|
+
// Simulated user inputs
|
|
103
|
+
const inputs = {
|
|
104
|
+
'get-number1': '10',
|
|
105
|
+
'get-number2': '5',
|
|
106
|
+
'get-operation': '+',
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
let currentCheckId = '';
|
|
110
|
+
|
|
111
|
+
// Set up human-input hook
|
|
112
|
+
HumanInputCheckProvider.setHooks({
|
|
113
|
+
onHumanInput: async (request: HumanInputRequest) => {
|
|
114
|
+
currentCheckId = request.checkId;
|
|
115
|
+
const input = inputs[request.checkId as keyof typeof inputs];
|
|
116
|
+
console.log(`📝 ${request.prompt}`);
|
|
117
|
+
console.log(` → ${input}\n`);
|
|
118
|
+
return input;
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
try {
|
|
123
|
+
// Execute checks using SDK
|
|
124
|
+
const result = await runChecks({
|
|
125
|
+
config: calculatorConfig,
|
|
126
|
+
checks: Object.keys(calculatorConfig.checks!),
|
|
127
|
+
outputFormat: 'table',
|
|
128
|
+
maxParallelism: 1,
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
console.log('\n✅ Test PASSED: All checks completed successfully!');
|
|
132
|
+
console.log(` No fail_if errors detected`);
|
|
133
|
+
console.log(` Result: 10 + 5 = 15\n`);
|
|
134
|
+
|
|
135
|
+
return 0;
|
|
136
|
+
} catch (error) {
|
|
137
|
+
console.error('\n❌ Test FAILED:', error);
|
|
138
|
+
return 1;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// Run test
|
|
143
|
+
runCalculatorTest()
|
|
144
|
+
.then((code) => process.exit(code))
|
|
145
|
+
.catch((error) => {
|
|
146
|
+
console.error('Unexpected error:', error);
|
|
147
|
+
process.exit(1);
|
|
148
|
+
});
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# Claude Code Provider Configuration Example
|
|
2
|
+
# This example demonstrates how to use the Claude Code provider
|
|
3
|
+
# for advanced AI-powered code reviews with MCP tools
|
|
4
|
+
|
|
5
|
+
version: "1.0"
|
|
6
|
+
project: claude-code-example
|
|
7
|
+
language: typescript
|
|
8
|
+
|
|
9
|
+
# Claude Code checks with various configurations
|
|
10
|
+
steps:
|
|
11
|
+
# Basic Claude Code analysis
|
|
12
|
+
claude_security_review:
|
|
13
|
+
type: claude-code
|
|
14
|
+
group: security
|
|
15
|
+
prompt: |
|
|
16
|
+
Analyze this code for security vulnerabilities including:
|
|
17
|
+
- SQL injection risks
|
|
18
|
+
- XSS vulnerabilities
|
|
19
|
+
- Authentication/authorization issues
|
|
20
|
+
- Sensitive data exposure
|
|
21
|
+
- Input validation problems
|
|
22
|
+
claude_code:
|
|
23
|
+
allowedTools: ['Grep', 'Read']
|
|
24
|
+
maxTurns: 3
|
|
25
|
+
systemPrompt: "You are a senior security engineer conducting a thorough security audit."
|
|
26
|
+
on: [pr_opened, pr_updated]
|
|
27
|
+
|
|
28
|
+
# Architecture analysis with MCP tools
|
|
29
|
+
claude_architecture:
|
|
30
|
+
type: claude-code
|
|
31
|
+
group: architecture
|
|
32
|
+
prompt: |
|
|
33
|
+
Analyze the code architecture and provide insights on:
|
|
34
|
+
- Code organization and structure
|
|
35
|
+
- Design patterns usage
|
|
36
|
+
- Coupling and cohesion
|
|
37
|
+
- Modularity and maintainability
|
|
38
|
+
claude_code:
|
|
39
|
+
allowedTools:
|
|
40
|
+
- Read
|
|
41
|
+
- Grep
|
|
42
|
+
- analyze_file_structure
|
|
43
|
+
- detect_patterns
|
|
44
|
+
- calculate_complexity
|
|
45
|
+
maxTurns: 5
|
|
46
|
+
systemPrompt: "You are a software architect reviewing code for best practices."
|
|
47
|
+
on: [pr_opened, pr_updated]
|
|
48
|
+
|
|
49
|
+
# Performance analysis with custom MCP server
|
|
50
|
+
claude_performance:
|
|
51
|
+
type: claude-code
|
|
52
|
+
group: performance
|
|
53
|
+
prompt: |
|
|
54
|
+
Review the code for performance issues:
|
|
55
|
+
- Algorithm efficiency
|
|
56
|
+
- Database query optimization
|
|
57
|
+
- Memory leaks and management
|
|
58
|
+
- Caching opportunities
|
|
59
|
+
- Async/await patterns
|
|
60
|
+
claude_code:
|
|
61
|
+
allowedTools:
|
|
62
|
+
- Read
|
|
63
|
+
- Grep
|
|
64
|
+
- calculate_complexity
|
|
65
|
+
- suggest_improvements
|
|
66
|
+
maxTurns: 4
|
|
67
|
+
systemPrompt: "Focus on performance bottlenecks and optimization opportunities."
|
|
68
|
+
# Custom MCP server for performance profiling
|
|
69
|
+
mcpServers:
|
|
70
|
+
perf_analyzer:
|
|
71
|
+
command: "node"
|
|
72
|
+
args: ["./tools/performance-analyzer.js"]
|
|
73
|
+
env:
|
|
74
|
+
PROFILE_MODE: "detailed"
|
|
75
|
+
on: [pr_opened, pr_updated]
|
|
76
|
+
|
|
77
|
+
# Code quality with web search
|
|
78
|
+
claude_quality:
|
|
79
|
+
type: claude-code
|
|
80
|
+
group: quality
|
|
81
|
+
prompt: |
|
|
82
|
+
Assess overall code quality:
|
|
83
|
+
- Naming conventions and readability
|
|
84
|
+
- Documentation completeness
|
|
85
|
+
- Test coverage assessment
|
|
86
|
+
- Error handling
|
|
87
|
+
- Code duplication
|
|
88
|
+
Search for best practices if needed.
|
|
89
|
+
claude_code:
|
|
90
|
+
allowedTools:
|
|
91
|
+
- Read
|
|
92
|
+
- Grep
|
|
93
|
+
- WebSearch
|
|
94
|
+
- detect_patterns
|
|
95
|
+
- suggest_improvements
|
|
96
|
+
maxTurns: 6
|
|
97
|
+
systemPrompt: "You are a code quality expert. Use web search to find current best practices when needed."
|
|
98
|
+
on: [pr_opened, pr_updated]
|
|
99
|
+
|
|
100
|
+
# Dependency analysis with session reuse
|
|
101
|
+
claude_dependencies:
|
|
102
|
+
type: claude-code
|
|
103
|
+
group: dependencies
|
|
104
|
+
prompt: |
|
|
105
|
+
Analyze the project dependencies:
|
|
106
|
+
- Outdated packages
|
|
107
|
+
- Security vulnerabilities in dependencies
|
|
108
|
+
- Unused dependencies
|
|
109
|
+
- Missing peer dependencies
|
|
110
|
+
claude_code:
|
|
111
|
+
allowedTools:
|
|
112
|
+
- Read
|
|
113
|
+
- Grep
|
|
114
|
+
- WebSearch
|
|
115
|
+
maxTurns: 3
|
|
116
|
+
depends_on: [claude_quality]
|
|
117
|
+
reuse_ai_session: true # Reuse session from quality check
|
|
118
|
+
on: [pr_opened, pr_updated]
|
|
119
|
+
|
|
120
|
+
# Advanced review with subagent
|
|
121
|
+
claude_comprehensive:
|
|
122
|
+
type: claude-code
|
|
123
|
+
group: comprehensive
|
|
124
|
+
prompt: |
|
|
125
|
+
Perform a comprehensive code review covering all aspects.
|
|
126
|
+
Delegate specific tasks to specialized subagents as needed.
|
|
127
|
+
claude_code:
|
|
128
|
+
allowedTools:
|
|
129
|
+
- Read
|
|
130
|
+
- Grep
|
|
131
|
+
- WebSearch
|
|
132
|
+
- analyze_file_structure
|
|
133
|
+
- detect_patterns
|
|
134
|
+
- calculate_complexity
|
|
135
|
+
- suggest_improvements
|
|
136
|
+
maxTurns: 10
|
|
137
|
+
systemPrompt: "You are the lead code reviewer. Use all available tools and delegate to subagents."
|
|
138
|
+
# Subagent for specialized tasks
|
|
139
|
+
subagent: "./.claude/agents/code-reviewer.md"
|
|
140
|
+
# Hooks for custom processing
|
|
141
|
+
hooks:
|
|
142
|
+
onStart: "echo 'Starting comprehensive Claude Code review'"
|
|
143
|
+
onToolUse: "./hooks/log-tool-usage.sh"
|
|
144
|
+
onEnd: "echo 'Comprehensive review complete'"
|
|
145
|
+
on: [manual] # Run manually due to high resource usage
|
|
146
|
+
|
|
147
|
+
# Output configuration
|
|
148
|
+
output:
|
|
149
|
+
# PR comment format
|
|
150
|
+
pr_comment:
|
|
151
|
+
enabled: true
|
|
152
|
+
update_existing: true
|
|
153
|
+
group_by: group
|
|
154
|
+
|
|
155
|
+
# Multiple output formats
|
|
156
|
+
format: table
|
|
157
|
+
|
|
158
|
+
# Save detailed reports
|
|
159
|
+
file:
|
|
160
|
+
enabled: true
|
|
161
|
+
path: "./reports/claude-review-{{date}}.md"
|
|
162
|
+
format: markdown
|
|
163
|
+
|
|
164
|
+
# Global AI settings (fallback for non-Claude checks)
|
|
165
|
+
ai_provider: google
|
|
166
|
+
ai_model: gemini-pro
|
|
167
|
+
|
|
168
|
+
# Failure conditions
|
|
169
|
+
fail_if: "criticalIssues > 0 || securityIssues > 5"
|
|
170
|
+
|
|
171
|
+
# Custom MCP server configuration
|
|
172
|
+
# This can be extended in .mcp.json for more servers
|
|
173
|
+
mcp_config:
|
|
174
|
+
servers:
|
|
175
|
+
code_analyzer:
|
|
176
|
+
command: "python"
|
|
177
|
+
args: ["./mcp/analyzer.py"]
|
|
178
|
+
env:
|
|
179
|
+
ANALYSIS_LEVEL: "deep"
|
|
180
|
+
|
|
181
|
+
security_scanner:
|
|
182
|
+
command: "node"
|
|
183
|
+
args: ["./mcp/security.js"]
|
|
184
|
+
env:
|
|
185
|
+
SCAN_MODE: "full"
|
|
186
|
+
|
|
187
|
+
# Environment variables for checks
|
|
188
|
+
env:
|
|
189
|
+
ANALYSIS_DEPTH: "comprehensive"
|
|
190
|
+
INCLUDE_SUGGESTIONS: "true"
|
|
191
|
+
MAX_FILE_SIZE: "1000000"
|