@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,247 @@
|
|
|
1
|
+
# Script Example: Complex Logic with Memory
|
|
2
|
+
#
|
|
3
|
+
# This example demonstrates using the script provider to perform
|
|
4
|
+
# complex data analysis and manipulation with full JavaScript support.
|
|
5
|
+
|
|
6
|
+
version: "1.0"
|
|
7
|
+
|
|
8
|
+
memory:
|
|
9
|
+
storage: memory
|
|
10
|
+
namespace: default
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
# Simulate multiple validation checks
|
|
14
|
+
check-security:
|
|
15
|
+
type: command
|
|
16
|
+
exec: 'echo ''{"issues": 3, "severity": "high"}'''
|
|
17
|
+
transform_js: "JSON.parse(output.trim())"
|
|
18
|
+
|
|
19
|
+
check-performance:
|
|
20
|
+
type: command
|
|
21
|
+
exec: 'echo ''{"issues": 7, "severity": "medium"}'''
|
|
22
|
+
transform_js: "JSON.parse(output.trim())"
|
|
23
|
+
|
|
24
|
+
check-style:
|
|
25
|
+
type: command
|
|
26
|
+
exec: 'echo ''{"issues": 15, "severity": "low"}'''
|
|
27
|
+
transform_js: "JSON.parse(output.trim())"
|
|
28
|
+
|
|
29
|
+
# Use script to aggregate and analyze results
|
|
30
|
+
analyze-all-checks:
|
|
31
|
+
type: script
|
|
32
|
+
depends_on: [check-security, check-performance, check-style]
|
|
33
|
+
content: |
|
|
34
|
+
// Collect all check results
|
|
35
|
+
const checks = {
|
|
36
|
+
security: outputs['check-security'],
|
|
37
|
+
performance: outputs['check-performance'],
|
|
38
|
+
style: outputs['check-style']
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
// Initialize analysis object
|
|
42
|
+
const analysis = {
|
|
43
|
+
checks: {},
|
|
44
|
+
totals: {
|
|
45
|
+
critical: 0,
|
|
46
|
+
high: 0,
|
|
47
|
+
medium: 0,
|
|
48
|
+
low: 0,
|
|
49
|
+
total: 0
|
|
50
|
+
},
|
|
51
|
+
summary: {
|
|
52
|
+
passed: 0,
|
|
53
|
+
failed: 0,
|
|
54
|
+
total: 3
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// Analyze each check
|
|
59
|
+
for (const [name, result] of Object.entries(checks)) {
|
|
60
|
+
const issueCount = result.issues || 0;
|
|
61
|
+
const severity = result.severity || 'low';
|
|
62
|
+
|
|
63
|
+
analysis.checks[name] = {
|
|
64
|
+
issues: issueCount,
|
|
65
|
+
severity: severity,
|
|
66
|
+
status: issueCount === 0 ? 'passed' : 'failed'
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
// Update totals
|
|
70
|
+
analysis.totals.total += issueCount;
|
|
71
|
+
analysis.totals[severity] = (analysis.totals[severity] || 0) + issueCount;
|
|
72
|
+
|
|
73
|
+
// Update summary
|
|
74
|
+
if (issueCount === 0) {
|
|
75
|
+
analysis.summary.passed++;
|
|
76
|
+
} else {
|
|
77
|
+
analysis.summary.failed++;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Calculate risk score (0-100, higher is worse)
|
|
82
|
+
const riskScore = Math.min(100,
|
|
83
|
+
(analysis.totals.critical * 20) +
|
|
84
|
+
(analysis.totals.high * 10) +
|
|
85
|
+
(analysis.totals.medium * 5) +
|
|
86
|
+
(analysis.totals.low * 1)
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
analysis.riskScore = riskScore;
|
|
90
|
+
|
|
91
|
+
// Determine overall status
|
|
92
|
+
let overallStatus;
|
|
93
|
+
if (analysis.totals.critical > 0 || analysis.totals.high > 5) {
|
|
94
|
+
overallStatus = 'critical';
|
|
95
|
+
} else if (analysis.totals.high > 0 || analysis.totals.medium > 10) {
|
|
96
|
+
overallStatus = 'warning';
|
|
97
|
+
} else if (analysis.totals.total > 20) {
|
|
98
|
+
overallStatus = 'attention';
|
|
99
|
+
} else {
|
|
100
|
+
overallStatus = 'ok';
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
analysis.overallStatus = overallStatus;
|
|
104
|
+
|
|
105
|
+
// Store in memory for other checks
|
|
106
|
+
memory.set('analysis', analysis);
|
|
107
|
+
memory.set('risk_score', riskScore);
|
|
108
|
+
memory.set('overall_status', overallStatus);
|
|
109
|
+
|
|
110
|
+
// Create recommendations based on analysis
|
|
111
|
+
const recommendations = [];
|
|
112
|
+
if (analysis.totals.critical > 0) {
|
|
113
|
+
recommendations.push('Address all critical security issues immediately');
|
|
114
|
+
}
|
|
115
|
+
if (analysis.totals.high >= 3) {
|
|
116
|
+
recommendations.push(`Fix ${analysis.totals.high} high-severity issues`);
|
|
117
|
+
}
|
|
118
|
+
if (analysis.totals.medium > 5) {
|
|
119
|
+
recommendations.push('Consider addressing medium-severity issues');
|
|
120
|
+
}
|
|
121
|
+
if (analysis.totals.low > 20) {
|
|
122
|
+
recommendations.push('Clean up style issues in a follow-up PR');
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
memory.set('recommendations', recommendations);
|
|
126
|
+
|
|
127
|
+
// Return summary
|
|
128
|
+
return {
|
|
129
|
+
riskScore,
|
|
130
|
+
overallStatus,
|
|
131
|
+
totalIssues: analysis.totals.total,
|
|
132
|
+
recommendationCount: recommendations.length
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
# Generate detailed report
|
|
136
|
+
generate-report:
|
|
137
|
+
type: log
|
|
138
|
+
depends_on: [analyze-all-checks]
|
|
139
|
+
message: |
|
|
140
|
+
{% assign analysis = "analysis" | memory_get %}
|
|
141
|
+
{% assign recommendations = "recommendations" | memory_get %}
|
|
142
|
+
|
|
143
|
+
## Code Quality Report
|
|
144
|
+
|
|
145
|
+
### Overall Status: {{ analysis.overallStatus | upcase }}
|
|
146
|
+
**Risk Score:** {{ analysis.riskScore }}/100
|
|
147
|
+
|
|
148
|
+
### Check Results
|
|
149
|
+
| Check | Issues | Severity | Status |
|
|
150
|
+
|-------|--------|----------|--------|
|
|
151
|
+
{% for check in analysis.checks %}
|
|
152
|
+
| {{ check[0] }} | {{ check[1].issues }} | {{ check[1].severity }} | {{ check[1].status }} |
|
|
153
|
+
{% endfor %}
|
|
154
|
+
|
|
155
|
+
### Issue Summary
|
|
156
|
+
- 🔴 Critical: {{ analysis.totals.critical }}
|
|
157
|
+
- 🟠 High: {{ analysis.totals.high }}
|
|
158
|
+
- 🟡 Medium: {{ analysis.totals.medium }}
|
|
159
|
+
- 🟢 Low: {{ analysis.totals.low }}
|
|
160
|
+
- **Total:** {{ analysis.totals.total }}
|
|
161
|
+
|
|
162
|
+
### Recommendations
|
|
163
|
+
{% if recommendations.size > 0 %}
|
|
164
|
+
{% for rec in recommendations %}
|
|
165
|
+
{{ forloop.index }}. {{ rec }}
|
|
166
|
+
{% endfor %}
|
|
167
|
+
{% else %}
|
|
168
|
+
✅ No issues found - great job!
|
|
169
|
+
{% endif %}
|
|
170
|
+
|
|
171
|
+
# Calculate trends if previous data exists
|
|
172
|
+
calculate-trend:
|
|
173
|
+
type: script
|
|
174
|
+
depends_on: [analyze-all-checks]
|
|
175
|
+
content: |
|
|
176
|
+
const currentScore = memory.get('risk_score');
|
|
177
|
+
|
|
178
|
+
// Get previous score (would be from persistent storage in real use)
|
|
179
|
+
const previousScore = memory.get('previous_risk_score') || currentScore;
|
|
180
|
+
|
|
181
|
+
// Calculate trend
|
|
182
|
+
const diff = currentScore - previousScore;
|
|
183
|
+
const percentChange = previousScore > 0
|
|
184
|
+
? ((diff / previousScore) * 100).toFixed(1)
|
|
185
|
+
: 0;
|
|
186
|
+
|
|
187
|
+
let trend;
|
|
188
|
+
if (Math.abs(diff) < 5) {
|
|
189
|
+
trend = 'stable';
|
|
190
|
+
} else if (diff > 0) {
|
|
191
|
+
trend = 'worsening';
|
|
192
|
+
} else {
|
|
193
|
+
trend = 'improving';
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
const trendData = {
|
|
197
|
+
current: currentScore,
|
|
198
|
+
previous: previousScore,
|
|
199
|
+
diff,
|
|
200
|
+
percentChange,
|
|
201
|
+
trend
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
memory.set('trend', trendData);
|
|
205
|
+
|
|
206
|
+
// Store current as previous for next run
|
|
207
|
+
memory.set('previous_risk_score', currentScore);
|
|
208
|
+
|
|
209
|
+
return trendData;
|
|
210
|
+
|
|
211
|
+
# Report trend
|
|
212
|
+
report-trend:
|
|
213
|
+
type: log
|
|
214
|
+
depends_on: [calculate-trend]
|
|
215
|
+
message: |
|
|
216
|
+
{% assign trend = "trend" | memory_get %}
|
|
217
|
+
|
|
218
|
+
### Trend Analysis
|
|
219
|
+
- Previous Score: {{ trend.previous }}
|
|
220
|
+
- Current Score: {{ trend.current }}
|
|
221
|
+
- Change: {% if trend.diff > 0 %}+{% endif %}{{ trend.diff }} ({{ trend.percentChange }}%)
|
|
222
|
+
- Trend: **{{ trend.trend | upcase }}**
|
|
223
|
+
|
|
224
|
+
{% if trend.trend == "improving" %}
|
|
225
|
+
📈 Code quality is improving!
|
|
226
|
+
{% elsif trend.trend == "worsening" %}
|
|
227
|
+
📉 Code quality is declining - attention needed
|
|
228
|
+
{% else %}
|
|
229
|
+
➡️ Code quality remains stable
|
|
230
|
+
{% endif %}
|
|
231
|
+
|
|
232
|
+
# Final check - fail if risk is too high
|
|
233
|
+
verify-quality-gate:
|
|
234
|
+
type: noop
|
|
235
|
+
depends_on: [report-trend]
|
|
236
|
+
fail_if: |
|
|
237
|
+
const riskScore = memory.get('risk_score');
|
|
238
|
+
const overallStatus = memory.get('overall_status');
|
|
239
|
+
|
|
240
|
+
// Fail if critical status or risk score > 50
|
|
241
|
+
return overallStatus === 'critical' || riskScore > 50;
|
|
242
|
+
|
|
243
|
+
output:
|
|
244
|
+
pr_comment:
|
|
245
|
+
format: markdown
|
|
246
|
+
group_by: check
|
|
247
|
+
collapse: false
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# Memory Example: Namespace Isolation
|
|
2
|
+
#
|
|
3
|
+
# This example shows how to use namespaces to isolate data
|
|
4
|
+
# for different environments (production, staging, development).
|
|
5
|
+
|
|
6
|
+
version: "1.0"
|
|
7
|
+
|
|
8
|
+
memory:
|
|
9
|
+
storage: file
|
|
10
|
+
file: ./multi-env-memory.json
|
|
11
|
+
format: json
|
|
12
|
+
namespace: production # Default namespace
|
|
13
|
+
|
|
14
|
+
steps:
|
|
15
|
+
# Production environment metrics
|
|
16
|
+
prod-init-counter:
|
|
17
|
+
type: memory
|
|
18
|
+
operation: set
|
|
19
|
+
key: deploy_count
|
|
20
|
+
value_js: "(memory.get('deploy_count', 'production') || 0)"
|
|
21
|
+
namespace: production
|
|
22
|
+
|
|
23
|
+
prod-increment:
|
|
24
|
+
type: memory
|
|
25
|
+
operation: set
|
|
26
|
+
key: deploy_count
|
|
27
|
+
value_js: "memory.get('deploy_count', 'production') + 1"
|
|
28
|
+
namespace: production
|
|
29
|
+
depends_on: [prod-init-counter]
|
|
30
|
+
|
|
31
|
+
prod-track-time:
|
|
32
|
+
type: memory
|
|
33
|
+
operation: set
|
|
34
|
+
key: last_deploy_time
|
|
35
|
+
value_js: "new Date().toISOString()"
|
|
36
|
+
namespace: production
|
|
37
|
+
depends_on: [prod-increment]
|
|
38
|
+
|
|
39
|
+
# Staging environment metrics
|
|
40
|
+
stage-init-counter:
|
|
41
|
+
type: memory
|
|
42
|
+
operation: set
|
|
43
|
+
key: deploy_count
|
|
44
|
+
value_js: "(memory.get('deploy_count', 'staging') || 0)"
|
|
45
|
+
namespace: staging
|
|
46
|
+
|
|
47
|
+
stage-increment:
|
|
48
|
+
type: memory
|
|
49
|
+
operation: set
|
|
50
|
+
key: deploy_count
|
|
51
|
+
value_js: "memory.get('deploy_count', 'staging') + 1"
|
|
52
|
+
namespace: staging
|
|
53
|
+
depends_on: [stage-init-counter]
|
|
54
|
+
|
|
55
|
+
stage-track-time:
|
|
56
|
+
type: memory
|
|
57
|
+
operation: set
|
|
58
|
+
key: last_deploy_time
|
|
59
|
+
value_js: "new Date().toISOString()"
|
|
60
|
+
namespace: staging
|
|
61
|
+
depends_on: [stage-increment]
|
|
62
|
+
|
|
63
|
+
# Development environment metrics
|
|
64
|
+
dev-init-counter:
|
|
65
|
+
type: memory
|
|
66
|
+
operation: set
|
|
67
|
+
key: deploy_count
|
|
68
|
+
value_js: "(memory.get('deploy_count', 'development') || 0)"
|
|
69
|
+
namespace: development
|
|
70
|
+
|
|
71
|
+
dev-increment:
|
|
72
|
+
type: memory
|
|
73
|
+
operation: set
|
|
74
|
+
key: deploy_count
|
|
75
|
+
value_js: "memory.get('deploy_count', 'development') + 1"
|
|
76
|
+
namespace: development
|
|
77
|
+
depends_on: [dev-init-counter]
|
|
78
|
+
|
|
79
|
+
dev-track-time:
|
|
80
|
+
type: memory
|
|
81
|
+
operation: set
|
|
82
|
+
key: last_deploy_time
|
|
83
|
+
value_js: "new Date().toISOString()"
|
|
84
|
+
namespace: development
|
|
85
|
+
depends_on: [dev-increment]
|
|
86
|
+
|
|
87
|
+
# Collect environment-specific errors
|
|
88
|
+
prod-check:
|
|
89
|
+
type: command
|
|
90
|
+
exec: ./scripts/check-production.sh
|
|
91
|
+
depends_on: [prod-track-time]
|
|
92
|
+
on_fail:
|
|
93
|
+
run: [prod-log-error]
|
|
94
|
+
|
|
95
|
+
prod-log-error:
|
|
96
|
+
type: memory
|
|
97
|
+
operation: append
|
|
98
|
+
key: errors
|
|
99
|
+
value: "Production check failed"
|
|
100
|
+
namespace: production
|
|
101
|
+
|
|
102
|
+
stage-check:
|
|
103
|
+
type: command
|
|
104
|
+
exec: ./scripts/check-staging.sh
|
|
105
|
+
depends_on: [stage-track-time]
|
|
106
|
+
on_fail:
|
|
107
|
+
run: [stage-log-error]
|
|
108
|
+
|
|
109
|
+
stage-log-error:
|
|
110
|
+
type: memory
|
|
111
|
+
operation: append
|
|
112
|
+
key: errors
|
|
113
|
+
value: "Staging check failed"
|
|
114
|
+
namespace: staging
|
|
115
|
+
|
|
116
|
+
# Report metrics for all environments
|
|
117
|
+
report-metrics:
|
|
118
|
+
type: log
|
|
119
|
+
depends_on: [prod-track-time, stage-track-time, dev-track-time]
|
|
120
|
+
message: |
|
|
121
|
+
## Deployment Metrics
|
|
122
|
+
|
|
123
|
+
### Production
|
|
124
|
+
- Deploys: {{ "deploy_count" | memory_get: "production" }}
|
|
125
|
+
- Last Deploy: {{ "last_deploy_time" | memory_get: "production" }}
|
|
126
|
+
{% assign prod_errors = "errors" | memory_get: "production" %}
|
|
127
|
+
- Errors: {{ prod_errors.size | default: 0 }}
|
|
128
|
+
|
|
129
|
+
### Staging
|
|
130
|
+
- Deploys: {{ "deploy_count" | memory_get: "staging" }}
|
|
131
|
+
- Last Deploy: {{ "last_deploy_time" | memory_get: "staging" }}
|
|
132
|
+
{% assign stage_errors = "errors" | memory_get: "staging" %}
|
|
133
|
+
- Errors: {{ stage_errors.size | default: 0 }}
|
|
134
|
+
|
|
135
|
+
### Development
|
|
136
|
+
- Deploys: {{ "deploy_count" | memory_get: "development" }}
|
|
137
|
+
- Last Deploy: {{ "last_deploy_time" | memory_get: "development" }}
|
|
138
|
+
|
|
139
|
+
# List all namespaces
|
|
140
|
+
list-namespaces:
|
|
141
|
+
type: log
|
|
142
|
+
depends_on: [report-metrics]
|
|
143
|
+
message: |
|
|
144
|
+
Active namespaces:
|
|
145
|
+
{% for ns in memory.listNamespaces() %}
|
|
146
|
+
- {{ ns }}
|
|
147
|
+
{% endfor %}
|
|
148
|
+
|
|
149
|
+
# Compare environments
|
|
150
|
+
compare-envs:
|
|
151
|
+
type: memory
|
|
152
|
+
operation: set
|
|
153
|
+
key: comparison
|
|
154
|
+
value_js: |
|
|
155
|
+
return {
|
|
156
|
+
production: memory.get('deploy_count', 'production'),
|
|
157
|
+
staging: memory.get('deploy_count', 'staging'),
|
|
158
|
+
development: memory.get('deploy_count', 'development'),
|
|
159
|
+
total: (memory.get('deploy_count', 'production') || 0) +
|
|
160
|
+
(memory.get('deploy_count', 'staging') || 0) +
|
|
161
|
+
(memory.get('deploy_count', 'development') || 0)
|
|
162
|
+
};
|
|
163
|
+
depends_on: [list-namespaces]
|
|
164
|
+
|
|
165
|
+
# Report comparison
|
|
166
|
+
report-comparison:
|
|
167
|
+
type: log
|
|
168
|
+
depends_on: [compare-envs]
|
|
169
|
+
message: |
|
|
170
|
+
{% assign comp = "comparison" | memory_get %}
|
|
171
|
+
## Environment Comparison
|
|
172
|
+
|
|
173
|
+
| Environment | Deploys |
|
|
174
|
+
|-------------|---------|
|
|
175
|
+
| Production | {{ comp.production }} |
|
|
176
|
+
| Staging | {{ comp.staging }} |
|
|
177
|
+
| Development | {{ comp.development }} |
|
|
178
|
+
| **Total** | **{{ comp.total }}** |
|
|
179
|
+
|
|
180
|
+
output:
|
|
181
|
+
pr_comment:
|
|
182
|
+
format: markdown
|
|
183
|
+
group_by: check
|
|
184
|
+
collapse: false
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Memory Example: Retry Counter with goto
|
|
2
|
+
#
|
|
3
|
+
# This example demonstrates using memory to track retry attempts
|
|
4
|
+
# and implement retry logic with goto routing.
|
|
5
|
+
|
|
6
|
+
version: "1.0"
|
|
7
|
+
|
|
8
|
+
memory:
|
|
9
|
+
storage: memory # In-memory storage (not persistent)
|
|
10
|
+
namespace: default
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
# Initialize retry counter
|
|
14
|
+
init-retry:
|
|
15
|
+
type: memory
|
|
16
|
+
operation: set
|
|
17
|
+
key: retry_count
|
|
18
|
+
value: 0
|
|
19
|
+
|
|
20
|
+
# Run a test that might fail
|
|
21
|
+
run-flaky-test:
|
|
22
|
+
type: command
|
|
23
|
+
exec: |
|
|
24
|
+
# Simulate a flaky test (fails 50% of the time)
|
|
25
|
+
if [ $((RANDOM % 2)) -eq 0 ]; then
|
|
26
|
+
echo "Test passed!"
|
|
27
|
+
exit 0
|
|
28
|
+
else
|
|
29
|
+
echo "Test failed!"
|
|
30
|
+
exit 1
|
|
31
|
+
fi
|
|
32
|
+
depends_on: [init-retry]
|
|
33
|
+
on_fail:
|
|
34
|
+
run: [increment-retry, check-retry-limit]
|
|
35
|
+
|
|
36
|
+
# Increment retry counter
|
|
37
|
+
increment-retry:
|
|
38
|
+
type: memory
|
|
39
|
+
operation: set
|
|
40
|
+
key: retry_count
|
|
41
|
+
value_js: "memory.get('retry_count') + 1"
|
|
42
|
+
|
|
43
|
+
# Check if we should retry
|
|
44
|
+
check-retry-limit:
|
|
45
|
+
type: noop
|
|
46
|
+
depends_on: [increment-retry]
|
|
47
|
+
# Use goto_js to conditionally jump back to run-flaky-test
|
|
48
|
+
on_success:
|
|
49
|
+
goto_js: |
|
|
50
|
+
const retries = memory.get('retry_count');
|
|
51
|
+
log('Retry attempt:', retries);
|
|
52
|
+
return retries < 3 ? 'run-flaky-test' : null;
|
|
53
|
+
|
|
54
|
+
# Report final result
|
|
55
|
+
report-result:
|
|
56
|
+
type: log
|
|
57
|
+
depends_on: [run-flaky-test]
|
|
58
|
+
message: |
|
|
59
|
+
Test completed after {{ "retry_count" | memory_get }} retries
|
|
60
|
+
|
|
61
|
+
output:
|
|
62
|
+
pr_comment:
|
|
63
|
+
format: markdown
|
|
64
|
+
group_by: check
|
|
65
|
+
collapse: false
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# Memory Example: Workflow State Machine
|
|
2
|
+
#
|
|
3
|
+
# This example demonstrates using memory to implement a state machine
|
|
4
|
+
# for managing a multi-step workflow.
|
|
5
|
+
|
|
6
|
+
version: "1.0"
|
|
7
|
+
|
|
8
|
+
memory:
|
|
9
|
+
storage: file
|
|
10
|
+
file: ./workflow-state.json
|
|
11
|
+
format: json
|
|
12
|
+
namespace: deployment
|
|
13
|
+
|
|
14
|
+
steps:
|
|
15
|
+
# Initialize workflow state
|
|
16
|
+
init-state:
|
|
17
|
+
type: memory
|
|
18
|
+
operation: set
|
|
19
|
+
key: state
|
|
20
|
+
value: pending
|
|
21
|
+
namespace: deployment
|
|
22
|
+
|
|
23
|
+
# Track start time
|
|
24
|
+
track-start:
|
|
25
|
+
type: memory
|
|
26
|
+
operation: set
|
|
27
|
+
key: start_time
|
|
28
|
+
value_js: "Date.now()"
|
|
29
|
+
depends_on: [init-state]
|
|
30
|
+
|
|
31
|
+
# Step 1: Build
|
|
32
|
+
build:
|
|
33
|
+
type: command
|
|
34
|
+
exec: npm run build
|
|
35
|
+
depends_on: [track-start]
|
|
36
|
+
on_success:
|
|
37
|
+
run: [set-state-built]
|
|
38
|
+
on_fail:
|
|
39
|
+
run: [set-state-build-failed]
|
|
40
|
+
|
|
41
|
+
set-state-built:
|
|
42
|
+
type: memory
|
|
43
|
+
operation: set
|
|
44
|
+
key: state
|
|
45
|
+
value: built
|
|
46
|
+
|
|
47
|
+
set-state-build-failed:
|
|
48
|
+
type: memory
|
|
49
|
+
operation: set
|
|
50
|
+
key: state
|
|
51
|
+
value: build_failed
|
|
52
|
+
|
|
53
|
+
# Step 2: Test (only if built)
|
|
54
|
+
test:
|
|
55
|
+
type: command
|
|
56
|
+
exec: npm test
|
|
57
|
+
depends_on: [set-state-built]
|
|
58
|
+
if: 'memory.get("state") === "built"'
|
|
59
|
+
on_success:
|
|
60
|
+
run: [set-state-tested]
|
|
61
|
+
on_fail:
|
|
62
|
+
run: [set-state-test-failed]
|
|
63
|
+
|
|
64
|
+
set-state-tested:
|
|
65
|
+
type: memory
|
|
66
|
+
operation: set
|
|
67
|
+
key: state
|
|
68
|
+
value: tested
|
|
69
|
+
|
|
70
|
+
set-state-test-failed:
|
|
71
|
+
type: memory
|
|
72
|
+
operation: set
|
|
73
|
+
key: state
|
|
74
|
+
value: test_failed
|
|
75
|
+
|
|
76
|
+
# Step 3: Deploy (only if tested)
|
|
77
|
+
deploy:
|
|
78
|
+
type: command
|
|
79
|
+
exec: npm run deploy
|
|
80
|
+
depends_on: [set-state-tested]
|
|
81
|
+
if: 'memory.get("state") === "tested"'
|
|
82
|
+
on_success:
|
|
83
|
+
run: [set-state-deployed]
|
|
84
|
+
on_fail:
|
|
85
|
+
run: [set-state-deploy-failed]
|
|
86
|
+
|
|
87
|
+
set-state-deployed:
|
|
88
|
+
type: memory
|
|
89
|
+
operation: set
|
|
90
|
+
key: state
|
|
91
|
+
value: deployed
|
|
92
|
+
|
|
93
|
+
set-state-deploy-failed:
|
|
94
|
+
type: memory
|
|
95
|
+
operation: set
|
|
96
|
+
key: state
|
|
97
|
+
value: deploy_failed
|
|
98
|
+
|
|
99
|
+
# Track end time
|
|
100
|
+
track-end:
|
|
101
|
+
type: memory
|
|
102
|
+
operation: set
|
|
103
|
+
key: end_time
|
|
104
|
+
value_js: "Date.now()"
|
|
105
|
+
depends_on: [deploy, set-state-build-failed, set-state-test-failed, set-state-deploy-failed]
|
|
106
|
+
|
|
107
|
+
# Calculate duration
|
|
108
|
+
calculate-duration:
|
|
109
|
+
type: memory
|
|
110
|
+
operation: set
|
|
111
|
+
key: duration_seconds
|
|
112
|
+
value_js: |
|
|
113
|
+
const start = memory.get('start_time');
|
|
114
|
+
const end = memory.get('end_time');
|
|
115
|
+
return Math.round((end - start) / 1000);
|
|
116
|
+
depends_on: [track-end]
|
|
117
|
+
|
|
118
|
+
# Report final state
|
|
119
|
+
report-state:
|
|
120
|
+
type: log
|
|
121
|
+
depends_on: [calculate-duration]
|
|
122
|
+
message: |
|
|
123
|
+
{% assign state = "state" | memory_get %}
|
|
124
|
+
{% assign duration = "duration_seconds" | memory_get %}
|
|
125
|
+
|
|
126
|
+
## Workflow Status: {{ state | upcase }}
|
|
127
|
+
|
|
128
|
+
**Duration**: {{ duration }} seconds
|
|
129
|
+
|
|
130
|
+
{% case state %}
|
|
131
|
+
{% when "deployed" %}
|
|
132
|
+
✅ **Deployment Successful!**
|
|
133
|
+
|
|
134
|
+
All steps completed:
|
|
135
|
+
1. ✅ Build
|
|
136
|
+
2. ✅ Test
|
|
137
|
+
3. ✅ Deploy
|
|
138
|
+
|
|
139
|
+
{% when "build_failed" %}
|
|
140
|
+
❌ **Build Failed**
|
|
141
|
+
|
|
142
|
+
The build step failed. Please check the logs.
|
|
143
|
+
|
|
144
|
+
{% when "test_failed" %}
|
|
145
|
+
❌ **Tests Failed**
|
|
146
|
+
|
|
147
|
+
Build succeeded, but tests failed.
|
|
148
|
+
|
|
149
|
+
{% when "deploy_failed" %}
|
|
150
|
+
❌ **Deployment Failed**
|
|
151
|
+
|
|
152
|
+
Build and tests passed, but deployment failed.
|
|
153
|
+
|
|
154
|
+
{% else %}
|
|
155
|
+
⏳ **Workflow In Progress**
|
|
156
|
+
|
|
157
|
+
Current state: {{ state }}
|
|
158
|
+
{% endcase %}
|
|
159
|
+
|
|
160
|
+
# Fail workflow if not deployed
|
|
161
|
+
check-deployment:
|
|
162
|
+
type: noop
|
|
163
|
+
depends_on: [report-state]
|
|
164
|
+
fail_if: 'memory.get("state") !== "deployed"'
|
|
165
|
+
|
|
166
|
+
output:
|
|
167
|
+
pr_comment:
|
|
168
|
+
format: markdown
|
|
169
|
+
group_by: check
|
|
170
|
+
collapse: true
|