@probelabs/visor 0.1.106 → 0.1.107
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -2
- package/action.yml +1 -1
- package/defaults/code-refiner.yaml +114 -0
- package/defaults/{.visor.yaml → code-review.yaml} +35 -226
- package/defaults/override.yaml +52 -0
- package/defaults/task-refinement.yaml +620 -0
- package/defaults/visor.tests.yaml +674 -0
- package/defaults/visor.yaml +482 -0
- package/dist/663.index.js +2 -3
- package/dist/80.index.js +2 -3
- package/dist/action-cli-bridge.d.ts +11 -82
- package/dist/action-cli-bridge.d.ts.map +1 -1
- package/dist/ai-review-service.d.ts +15 -0
- package/dist/ai-review-service.d.ts.map +1 -1
- package/dist/check-execution-engine.d.ts +19 -331
- package/dist/check-execution-engine.d.ts.map +1 -1
- package/dist/cli-main.d.ts.map +1 -1
- package/dist/cli.d.ts +0 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/config.d.ts +16 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/cron-scheduler.d.ts +3 -3
- package/dist/cron-scheduler.d.ts.map +1 -1
- package/dist/debug-visualizer/ws-server.d.ts.map +1 -1
- package/dist/defaults/code-refiner.yaml +114 -0
- package/dist/defaults/{.visor.yaml → code-review.yaml} +35 -226
- package/dist/defaults/override.yaml +52 -0
- package/dist/defaults/task-refinement.yaml +620 -0
- package/dist/defaults/visor.tests.yaml +674 -0
- package/dist/defaults/visor.yaml +482 -0
- package/dist/docs/DEPLOYMENT.md +118 -0
- package/dist/docs/GITHUB_CHECKS.md +280 -0
- package/dist/docs/NPM_USAGE.md +208 -0
- package/dist/docs/action-reference.md +19 -0
- package/dist/docs/advanced-ai.md +178 -0
- package/dist/docs/ai-configuration.md +468 -0
- package/dist/docs/author-permissions.md +610 -0
- package/dist/docs/ci-cli-mode.md +34 -0
- package/dist/docs/claude-code.md +74 -0
- package/dist/docs/command-provider.md +559 -0
- package/dist/docs/commands.md +8 -0
- package/dist/docs/configuration.md +303 -0
- package/dist/docs/custom-tools.md +424 -0
- package/dist/docs/dashboards/README.md +23 -0
- package/dist/docs/dashboards/grafana-visor-diagrams.json +20 -0
- package/dist/docs/dashboards/grafana-visor-overview.json +33 -0
- package/dist/docs/debug-visualizer-progress.md +572 -0
- package/dist/docs/debug-visualizer-rfc.md +691 -0
- package/dist/docs/debug-visualizer.md +114 -0
- package/dist/docs/debugging.md +636 -0
- package/dist/docs/default-output-schema.md +28 -0
- package/dist/docs/dependencies.md +369 -0
- package/dist/docs/dev-playbook.md +9 -0
- package/dist/docs/engine-state-machine-plan.md +333 -0
- package/dist/docs/event-driven-github-integration-rfc.md +743 -0
- package/dist/docs/event-triggers.md +292 -0
- package/dist/docs/execution-statistics-rfc.md +290 -0
- package/dist/docs/fact-validator-gap-analysis.md +178 -0
- package/dist/docs/fact-validator-implementation-plan.md +1235 -0
- package/dist/docs/fail-if.md +95 -0
- package/dist/docs/failure-conditions-implementation.md +271 -0
- package/dist/docs/failure-conditions-schema.md +173 -0
- package/dist/docs/failure-routing-rfc.md +193 -0
- package/dist/docs/failure-routing.md +507 -0
- package/dist/docs/foreach-dependency-propagation.md +473 -0
- package/dist/docs/github-ops.md +89 -0
- package/dist/docs/goto-forward-run-plan.md +113 -0
- package/dist/docs/guides/criticality-modes.md +332 -0
- package/dist/docs/guides/fault-management-and-contracts.md +738 -0
- package/dist/docs/guides/workflow-style-guide.md +224 -0
- package/dist/docs/http.md +299 -0
- package/dist/docs/human-input-provider.md +372 -0
- package/dist/docs/limits.md +64 -0
- package/dist/docs/liquid-templates.md +347 -0
- package/dist/docs/loop-routing-refactor.md +89 -0
- package/dist/docs/mcp-provider.md +557 -0
- package/dist/docs/mcp.md +124 -0
- package/dist/docs/memory.md +903 -0
- package/dist/docs/observability.md +12 -0
- package/dist/docs/output-formats.md +20 -0
- package/dist/docs/output-formatting.md +29 -0
- package/dist/docs/output-history.md +383 -0
- package/dist/docs/performance.md +6 -0
- package/dist/docs/pluggable.md +124 -0
- package/dist/docs/proposals/snapshot-scope-execution.md +236 -0
- package/dist/docs/recipes.md +21 -0
- package/dist/docs/roadmap/criticality-implementation-tasks.md +92 -0
- package/dist/docs/schema-next-pr.md +10 -0
- package/dist/docs/schema-templates.md +68 -0
- package/dist/docs/script.md +34 -0
- package/dist/docs/sdk.md +222 -0
- package/dist/docs/security.md +7 -0
- package/dist/docs/suppressions.md +89 -0
- package/dist/docs/tag-filtering.md +258 -0
- package/dist/docs/telemetry-setup.md +119 -0
- package/dist/docs/telemetry-tracing-rfc.md +275 -0
- package/dist/docs/test-framework-rfc.md +680 -0
- package/dist/docs/testing/assertions.md +85 -0
- package/dist/docs/testing/ci.md +44 -0
- package/dist/docs/testing/cli.md +41 -0
- package/dist/docs/testing/cookbook.md +172 -0
- package/dist/docs/testing/dsl-reference.md +199 -0
- package/dist/docs/testing/fixtures-and-mocks.md +91 -0
- package/dist/docs/testing/flows.md +92 -0
- package/dist/docs/testing/getting-started.md +93 -0
- package/dist/docs/testing/troubleshooting.md +55 -0
- package/dist/docs/timeouts.md +50 -0
- package/dist/docs/troubleshooting.md +7 -0
- package/dist/docs/visor-sdk-rfc.md +186 -0
- package/dist/docs/workflows.md +569 -0
- package/dist/engine/on-finish/orchestrator.d.ts +19 -0
- package/dist/engine/on-finish/orchestrator.d.ts.map +1 -0
- package/dist/engine/on-finish/utils.d.ts +44 -0
- package/dist/engine/on-finish/utils.d.ts.map +1 -0
- package/dist/event-bus/event-bus.d.ts +13 -0
- package/dist/event-bus/event-bus.d.ts.map +1 -0
- package/dist/event-bus/types.d.ts +57 -0
- package/dist/event-bus/types.d.ts.map +1 -0
- package/dist/examples/.claude/agents/code-reviewer.md +69 -0
- package/dist/examples/.mcp.json +34 -0
- package/dist/examples/CALCULATOR-SDK.md +364 -0
- package/dist/examples/README.md +384 -0
- package/dist/examples/ai-retry-fallback-config.yaml +180 -0
- package/dist/examples/ai-with-bash.yaml +126 -0
- package/dist/examples/ai-with-mcp.yaml +82 -0
- package/dist/examples/basic-human-input.yaml +15 -0
- package/dist/examples/bedrock-config.yaml +77 -0
- package/dist/examples/calculator-config.yaml +133 -0
- package/dist/examples/calculator-json-output-guide.md +311 -0
- package/dist/examples/calculator-sdk-automated.ts +340 -0
- package/dist/examples/calculator-sdk-example.ts +275 -0
- package/dist/examples/calculator-sdk-json.ts +331 -0
- package/dist/examples/calculator-sdk-real.ts +374 -0
- package/dist/examples/calculator-sdk-test.ts +148 -0
- package/dist/examples/claude-code-config.yaml +191 -0
- package/dist/examples/cron-webhook-config.yaml +215 -0
- package/dist/examples/custom-template.liquid +57 -0
- package/dist/examples/custom-tools-example.yaml +281 -0
- package/dist/examples/enhanced-config.yaml +165 -0
- package/dist/examples/environments/visor.base.yaml +92 -0
- package/dist/examples/environments/visor.dev.yaml +33 -0
- package/dist/examples/environments/visor.prod.yaml +95 -0
- package/dist/examples/environments/visor.staging.yaml +46 -0
- package/dist/examples/fact-validator.yaml +361 -0
- package/dist/examples/fail-if-simple.yaml +90 -0
- package/dist/examples/failure-conditions-advanced.yaml +136 -0
- package/dist/examples/failure-conditions-basic.yaml +48 -0
- package/dist/examples/failure-conditions-github-style.yaml +119 -0
- package/dist/examples/failure-conditions-migration.yaml +74 -0
- package/dist/examples/for-loop-example.yaml +176 -0
- package/dist/examples/forEach-example.yaml +120 -0
- package/dist/examples/github-workflow-with-tags.yml +163 -0
- package/dist/examples/http-integration-config.yaml +240 -0
- package/dist/examples/https-server-config.yaml +209 -0
- package/dist/examples/human-input-example.yaml +63 -0
- package/dist/examples/if-conditions.yaml +173 -0
- package/dist/examples/jira-simple-example.yaml +56 -0
- package/dist/examples/jira-single-issue-workflow.yaml +166 -0
- package/dist/examples/jira-workflow-mcp.yaml +182 -0
- package/dist/examples/mcp/analyzer.py +119 -0
- package/dist/examples/mcp-provider-example.yaml +301 -0
- package/dist/examples/memory-counter.yaml +99 -0
- package/dist/examples/memory-error-collection.yaml +104 -0
- package/dist/examples/memory-exec-js.yaml +247 -0
- package/dist/examples/memory-namespace-isolation.yaml +184 -0
- package/dist/examples/memory-retry-counter.yaml +65 -0
- package/dist/examples/memory-state-machine.yaml +170 -0
- package/dist/examples/outputs-raw-basic.yaml +26 -0
- package/dist/examples/project-with-tools.yaml +174 -0
- package/dist/examples/prompts/architecture-analysis.liquid +116 -0
- package/dist/examples/prompts/security-comprehensive.liquid +107 -0
- package/dist/examples/quick-start-tags.yaml +53 -0
- package/dist/examples/routing-basic.yaml +35 -0
- package/dist/examples/routing-dynamic-js.yaml +46 -0
- package/dist/examples/routing-foreach.yaml +34 -0
- package/dist/examples/routing-goto-event.yaml +34 -0
- package/dist/examples/routing-on-success.yaml +25 -0
- package/dist/examples/run-calculator-demo.sh +71 -0
- package/dist/examples/sdk-basic.mjs +10 -0
- package/dist/examples/sdk-cjs.cjs +10 -0
- package/dist/examples/sdk-comprehensive.mjs +175 -0
- package/dist/examples/sdk-manual-config.mjs +65 -0
- package/dist/examples/sdk-typescript.js +81 -0
- package/dist/examples/sdk-typescript.ts +92 -0
- package/dist/examples/session-reuse-config.yaml +151 -0
- package/dist/examples/templates/security-report.liquid +137 -0
- package/dist/examples/tools-library.yaml +281 -0
- package/dist/examples/transform-example.yaml +199 -0
- package/dist/examples/visor-with-tags.yaml +198 -0
- package/dist/examples/webhook-pipeline-config.yaml +218 -0
- package/dist/examples/workflows/calculator-workflow.yaml +163 -0
- package/dist/examples/workflows/code-quality.yaml +222 -0
- package/dist/examples/workflows/quick-pr-check.yaml +90 -0
- package/dist/examples/workflows/workflow-composition-example.yaml +130 -0
- package/dist/failure-condition-evaluator.d.ts +1 -0
- package/dist/failure-condition-evaluator.d.ts.map +1 -1
- package/dist/frontends/github-frontend.d.ts +38 -0
- package/dist/frontends/github-frontend.d.ts.map +1 -0
- package/dist/frontends/host.d.ts +43 -0
- package/dist/frontends/host.d.ts.map +1 -0
- package/dist/frontends/ndjson-sink.d.ts +12 -0
- package/dist/frontends/ndjson-sink.d.ts.map +1 -0
- package/dist/generated/config-schema.d.ts +564 -22
- package/dist/generated/config-schema.d.ts.map +1 -1
- package/dist/generated/config-schema.json +612 -24
- package/dist/github-check-service.d.ts +4 -6
- package/dist/github-check-service.d.ts.map +1 -1
- package/dist/github-comments.d.ts +0 -4
- package/dist/github-comments.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +70335 -62514
- package/dist/liquid-extensions.d.ts.map +1 -1
- package/dist/logger.d.ts +1 -0
- package/dist/logger.d.ts.map +1 -1
- package/dist/memory-store.d.ts +6 -0
- package/dist/memory-store.d.ts.map +1 -1
- package/dist/output/assistant-json/template.liquid +0 -0
- package/dist/output/traces/run-2025-11-21T11-50-46-505Z.ndjson +138 -0
- package/dist/output/traces/run-2025-11-21T11-51-33-674Z.ndjson +839 -0
- package/dist/output-formatters.d.ts +1 -1
- package/dist/output-formatters.d.ts.map +1 -1
- package/dist/providers/ai-check-provider.d.ts.map +1 -1
- package/dist/providers/check-provider-registry.d.ts +6 -0
- package/dist/providers/check-provider-registry.d.ts.map +1 -1
- package/dist/providers/check-provider.interface.d.ts +34 -1
- package/dist/providers/check-provider.interface.d.ts.map +1 -1
- package/dist/providers/claude-code-check-provider.d.ts.map +1 -1
- package/dist/providers/command-check-provider.d.ts +1 -1
- package/dist/providers/command-check-provider.d.ts.map +1 -1
- package/dist/providers/custom-tool-executor.d.ts +61 -0
- package/dist/providers/custom-tool-executor.d.ts.map +1 -0
- package/dist/providers/github-ops-provider.d.ts.map +1 -1
- package/dist/providers/http-client-provider.d.ts +1 -4
- package/dist/providers/http-client-provider.d.ts.map +1 -1
- package/dist/providers/human-input-check-provider.d.ts +3 -0
- package/dist/providers/human-input-check-provider.d.ts.map +1 -1
- package/dist/providers/index.d.ts +1 -0
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/log-check-provider.d.ts +2 -5
- package/dist/providers/log-check-provider.d.ts.map +1 -1
- package/dist/providers/mcp-check-provider.d.ts +9 -3
- package/dist/providers/mcp-check-provider.d.ts.map +1 -1
- package/dist/providers/memory-check-provider.d.ts +2 -8
- package/dist/providers/memory-check-provider.d.ts.map +1 -1
- package/dist/providers/script-check-provider.d.ts +25 -0
- package/dist/providers/script-check-provider.d.ts.map +1 -0
- package/dist/providers/workflow-check-provider.d.ts +56 -0
- package/dist/providers/workflow-check-provider.d.ts.map +1 -0
- package/dist/reviewer.d.ts +2 -1
- package/dist/reviewer.d.ts.map +1 -1
- package/dist/sdk/chunk-37ZSCMFC.mjs +482 -0
- package/dist/sdk/chunk-37ZSCMFC.mjs.map +1 -0
- package/dist/sdk/chunk-6Y4YTKCF.mjs +197 -0
- package/dist/sdk/chunk-6Y4YTKCF.mjs.map +1 -0
- package/dist/sdk/chunk-CNX7V5JK.mjs +89 -0
- package/dist/sdk/chunk-CNX7V5JK.mjs.map +1 -0
- package/dist/sdk/chunk-IEO6CFLG.mjs +1215 -0
- package/dist/sdk/chunk-IEO6CFLG.mjs.map +1 -0
- package/dist/sdk/chunk-JEHPDJIF.mjs +223 -0
- package/dist/sdk/chunk-JEHPDJIF.mjs.map +1 -0
- package/dist/sdk/chunk-O5EZDNYL.mjs +274 -0
- package/dist/sdk/chunk-O5EZDNYL.mjs.map +1 -0
- package/dist/sdk/{chunk-TUTOLSFV.mjs → chunk-OOZITMRU.mjs} +1 -1
- package/dist/sdk/chunk-OOZITMRU.mjs.map +1 -0
- package/dist/sdk/chunk-OWUVOILT.mjs +557 -0
- package/dist/sdk/chunk-OWUVOILT.mjs.map +1 -0
- package/dist/sdk/chunk-OZJ263FM.mjs +986 -0
- package/dist/sdk/chunk-OZJ263FM.mjs.map +1 -0
- package/dist/sdk/chunk-PTL3K3PN.mjs +3128 -0
- package/dist/sdk/chunk-PTL3K3PN.mjs.map +1 -0
- package/dist/sdk/chunk-S2RUE2RG.mjs +145 -0
- package/dist/sdk/chunk-S2RUE2RG.mjs.map +1 -0
- package/dist/sdk/chunk-VMPLF6FT.mjs +127 -0
- package/dist/sdk/chunk-VMPLF6FT.mjs.map +1 -0
- package/dist/sdk/chunk-YSN4G6CI.mjs +146 -0
- package/dist/sdk/chunk-YSN4G6CI.mjs.map +1 -0
- package/dist/sdk/chunk-ZYAUYXSW.mjs +206 -0
- package/dist/sdk/chunk-ZYAUYXSW.mjs.map +1 -0
- package/dist/sdk/config-M4ZNO6NU.mjs +14 -0
- package/dist/sdk/config-merger-PX3WIT57.mjs +10 -0
- package/dist/sdk/event-bus-5BEVPQ6T.mjs +35 -0
- package/dist/sdk/event-bus-5BEVPQ6T.mjs.map +1 -0
- package/dist/sdk/failure-condition-evaluator-NBO5YRXW.mjs +16 -0
- package/dist/sdk/git-repository-analyzer-HJC4MYW4.mjs +458 -0
- package/dist/sdk/git-repository-analyzer-HJC4MYW4.mjs.map +1 -0
- package/dist/sdk/github-frontend-4AWRJT7D.mjs +1242 -0
- package/dist/sdk/github-frontend-4AWRJT7D.mjs.map +1 -0
- package/dist/sdk/host-7GBC3S7L.mjs +49 -0
- package/dist/sdk/host-7GBC3S7L.mjs.map +1 -0
- package/dist/sdk/{liquid-extensions-KVL4MKRH.mjs → liquid-extensions-C7EG3YKH.mjs} +7 -2
- package/dist/sdk/memory-store-GJACZC2A.mjs +11 -0
- package/dist/sdk/metrics-7PP3EJUH.mjs +29 -0
- package/dist/sdk/ndjson-sink-B4V4NTAQ.mjs +44 -0
- package/dist/sdk/ndjson-sink-B4V4NTAQ.mjs.map +1 -0
- package/dist/sdk/renderer-schema-6RF26VUS.mjs +50 -0
- package/dist/sdk/renderer-schema-6RF26VUS.mjs.map +1 -0
- package/dist/sdk/routing-RP56JTV2.mjs +23 -0
- package/dist/sdk/routing-RP56JTV2.mjs.map +1 -0
- package/dist/sdk/sdk.d.mts +326 -21
- package/dist/sdk/sdk.d.ts +326 -21
- package/dist/sdk/sdk.js +21403 -16366
- package/dist/sdk/sdk.js.map +1 -1
- package/dist/sdk/sdk.mjs +13510 -2096
- package/dist/sdk/sdk.mjs.map +1 -1
- package/dist/sdk/session-registry-N5FFYFTM.mjs +10 -0
- package/dist/sdk/session-registry-N5FFYFTM.mjs.map +1 -0
- package/dist/sdk/trace-helpers-VP6QYVBX.mjs +23 -0
- package/dist/sdk/trace-helpers-VP6QYVBX.mjs.map +1 -0
- package/dist/sdk/{tracer-init-WC75N5NW.mjs → tracer-init-WP4X46IF.mjs} +2 -2
- package/dist/sdk/tracer-init-WP4X46IF.mjs.map +1 -0
- package/dist/sdk/workflow-registry-2YIIXQCK.mjs +11 -0
- package/dist/sdk/workflow-registry-2YIIXQCK.mjs.map +1 -0
- package/dist/sdk.d.ts.map +1 -1
- package/dist/snapshot-store.d.ts +59 -0
- package/dist/snapshot-store.d.ts.map +1 -0
- package/dist/state-machine/context/build-engine-context.d.ts +9 -0
- package/dist/state-machine/context/build-engine-context.d.ts.map +1 -0
- package/dist/state-machine/dispatch/dependency-gating.d.ts +12 -0
- package/dist/state-machine/dispatch/dependency-gating.d.ts.map +1 -0
- package/dist/state-machine/dispatch/execution-invoker.d.ts +14 -0
- package/dist/state-machine/dispatch/execution-invoker.d.ts.map +1 -0
- package/dist/state-machine/dispatch/foreach-processor.d.ts +8 -0
- package/dist/state-machine/dispatch/foreach-processor.d.ts.map +1 -0
- package/dist/state-machine/dispatch/history-snapshot.d.ts +8 -0
- package/dist/state-machine/dispatch/history-snapshot.d.ts.map +1 -0
- package/dist/state-machine/dispatch/renderer-schema.d.ts +8 -0
- package/dist/state-machine/dispatch/renderer-schema.d.ts.map +1 -0
- package/dist/state-machine/dispatch/stats-manager.d.ts +15 -0
- package/dist/state-machine/dispatch/stats-manager.d.ts.map +1 -0
- package/dist/state-machine/dispatch/template-renderer.d.ts +7 -0
- package/dist/state-machine/dispatch/template-renderer.d.ts.map +1 -0
- package/dist/state-machine/execution/summary.d.ts +8 -0
- package/dist/state-machine/execution/summary.d.ts.map +1 -0
- package/dist/state-machine/runner.d.ts +73 -0
- package/dist/state-machine/runner.d.ts.map +1 -0
- package/dist/state-machine/states/check-running.d.ts +14 -0
- package/dist/state-machine/states/check-running.d.ts.map +1 -0
- package/dist/state-machine/states/completed.d.ts +12 -0
- package/dist/state-machine/states/completed.d.ts.map +1 -0
- package/dist/state-machine/states/error.d.ts +11 -0
- package/dist/state-machine/states/error.d.ts.map +1 -0
- package/dist/state-machine/states/init.d.ts +11 -0
- package/dist/state-machine/states/init.d.ts.map +1 -0
- package/dist/state-machine/states/level-dispatch.d.ts +17 -0
- package/dist/state-machine/states/level-dispatch.d.ts.map +1 -0
- package/dist/state-machine/states/plan-ready.d.ts +12 -0
- package/dist/state-machine/states/plan-ready.d.ts.map +1 -0
- package/dist/state-machine/states/routing.d.ts +52 -0
- package/dist/state-machine/states/routing.d.ts.map +1 -0
- package/dist/state-machine/states/wave-planning.d.ts +14 -0
- package/dist/state-machine/states/wave-planning.d.ts.map +1 -0
- package/dist/state-machine/workflow-projection.d.ts +47 -0
- package/dist/state-machine/workflow-projection.d.ts.map +1 -0
- package/dist/state-machine-execution-engine.d.ts +147 -0
- package/dist/state-machine-execution-engine.d.ts.map +1 -0
- package/dist/telemetry/opentelemetry.d.ts.map +1 -1
- package/dist/test-runner/assertions.d.ts +59 -0
- package/dist/test-runner/assertions.d.ts.map +1 -0
- package/dist/test-runner/core/environment.d.ts +8 -0
- package/dist/test-runner/core/environment.d.ts.map +1 -0
- package/dist/test-runner/core/fixture.d.ts +3 -0
- package/dist/test-runner/core/fixture.d.ts.map +1 -0
- package/dist/test-runner/core/flow-stage.d.ts +32 -0
- package/dist/test-runner/core/flow-stage.d.ts.map +1 -0
- package/dist/test-runner/core/mocks.d.ts +8 -0
- package/dist/test-runner/core/mocks.d.ts.map +1 -0
- package/dist/test-runner/core/test-execution-wrapper.d.ts +18 -0
- package/dist/test-runner/core/test-execution-wrapper.d.ts.map +1 -0
- package/dist/test-runner/evaluators.d.ts +12 -0
- package/dist/test-runner/evaluators.d.ts.map +1 -0
- package/dist/test-runner/fixture-loader.d.ts +30 -0
- package/dist/test-runner/fixture-loader.d.ts.map +1 -0
- package/dist/test-runner/index.d.ts +120 -0
- package/dist/test-runner/index.d.ts.map +1 -0
- package/dist/test-runner/recorders/github-recorder.d.ts +23 -0
- package/dist/test-runner/recorders/github-recorder.d.ts.map +1 -0
- package/dist/test-runner/recorders/global-recorder.d.ts +4 -0
- package/dist/test-runner/recorders/global-recorder.d.ts.map +1 -0
- package/dist/test-runner/utils/selectors.d.ts +2 -0
- package/dist/test-runner/utils/selectors.d.ts.map +1 -0
- package/dist/test-runner/validator.d.ts +8 -0
- package/dist/test-runner/validator.d.ts.map +1 -0
- package/dist/traces/run-2025-11-21T11-50-46-505Z.ndjson +138 -0
- package/dist/traces/run-2025-11-21T11-51-33-674Z.ndjson +839 -0
- package/dist/types/cli.d.ts +4 -1
- package/dist/types/cli.d.ts.map +1 -1
- package/dist/types/config.d.ts +278 -5
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/engine.d.ts +172 -0
- package/dist/types/engine.d.ts.map +1 -0
- package/dist/types/execution.d.ts +73 -0
- package/dist/types/execution.d.ts.map +1 -0
- package/dist/types/github.d.ts +51 -0
- package/dist/types/github.d.ts.map +1 -0
- package/dist/types/workflow.d.ts +237 -0
- package/dist/types/workflow.d.ts.map +1 -0
- package/dist/utils/command-executor.d.ts +43 -0
- package/dist/utils/command-executor.d.ts.map +1 -0
- package/dist/utils/comment-metadata.d.ts +21 -0
- package/dist/utils/comment-metadata.d.ts.map +1 -0
- package/dist/utils/config-loader.d.ts.map +1 -1
- package/dist/utils/config-merger.d.ts.map +1 -1
- package/dist/utils/env-exposure.d.ts +3 -0
- package/dist/utils/env-exposure.d.ts.map +1 -0
- package/dist/utils/file-exclusion.d.ts.map +1 -1
- package/dist/utils/interactive-prompt.d.ts +1 -1
- package/dist/utils/interactive-prompt.d.ts.map +1 -1
- package/dist/utils/sandbox.d.ts.map +1 -1
- package/dist/utils/script-memory-ops.d.ts +21 -0
- package/dist/utils/script-memory-ops.d.ts.map +1 -0
- package/dist/utils/template-context.d.ts +7 -0
- package/dist/utils/template-context.d.ts.map +1 -0
- package/dist/webhook-server.d.ts +3 -3
- package/dist/webhook-server.d.ts.map +1 -1
- package/dist/workflow-executor.d.ts +81 -0
- package/dist/workflow-executor.d.ts.map +1 -0
- package/dist/workflow-registry.d.ts +79 -0
- package/dist/workflow-registry.d.ts.map +1 -0
- package/package.json +10 -5
- package/dist/output/traces/run-2025-10-22T18-22-56-873Z.ndjson +0 -218
- package/dist/sdk/check-execution-engine-2YYKUUSH.mjs +0 -11
- package/dist/sdk/check-execution-engine-6QJXYYON.mjs +0 -11
- package/dist/sdk/check-execution-engine-PJZ4ZOKG.mjs +0 -11
- package/dist/sdk/chunk-33QVZ2D4.mjs +0 -316
- package/dist/sdk/chunk-33QVZ2D4.mjs.map +0 -1
- package/dist/sdk/chunk-B5QBV2QJ.mjs +0 -752
- package/dist/sdk/chunk-B5QBV2QJ.mjs.map +0 -1
- package/dist/sdk/chunk-BVFNRCHT.mjs +0 -14129
- package/dist/sdk/chunk-BVFNRCHT.mjs.map +0 -1
- package/dist/sdk/chunk-KWZW23FG.mjs +0 -14129
- package/dist/sdk/chunk-KWZW23FG.mjs.map +0 -1
- package/dist/sdk/chunk-O4RP4BRH.mjs +0 -14092
- package/dist/sdk/chunk-O4RP4BRH.mjs.map +0 -1
- package/dist/sdk/chunk-TUTOLSFV.mjs.map +0 -1
- package/dist/sdk/chunk-U5D2LY66.mjs +0 -245
- package/dist/sdk/chunk-U5D2LY66.mjs.map +0 -1
- package/dist/sdk/chunk-U7X54EMV.mjs +0 -331
- package/dist/sdk/chunk-U7X54EMV.mjs.map +0 -1
- package/dist/sdk/config-merger-TWUBWFC2.mjs +0 -8
- package/dist/sdk/mermaid-telemetry-SN6A2TKW.mjs +0 -61
- package/dist/sdk/mermaid-telemetry-SN6A2TKW.mjs.map +0 -1
- package/dist/sdk/mermaid-telemetry-YCTIG76M.mjs +0 -61
- package/dist/sdk/mermaid-telemetry-YCTIG76M.mjs.map +0 -1
- package/dist/traces/run-2025-10-22T18-22-56-873Z.ndjson +0 -218
- /package/dist/sdk/{check-execution-engine-2YYKUUSH.mjs.map → config-M4ZNO6NU.mjs.map} +0 -0
- /package/dist/sdk/{check-execution-engine-6QJXYYON.mjs.map → config-merger-PX3WIT57.mjs.map} +0 -0
- /package/dist/sdk/{check-execution-engine-PJZ4ZOKG.mjs.map → failure-condition-evaluator-NBO5YRXW.mjs.map} +0 -0
- /package/dist/sdk/{config-merger-TWUBWFC2.mjs.map → liquid-extensions-C7EG3YKH.mjs.map} +0 -0
- /package/dist/sdk/{liquid-extensions-KVL4MKRH.mjs.map → memory-store-GJACZC2A.mjs.map} +0 -0
- /package/dist/sdk/{tracer-init-WC75N5NW.mjs.map → metrics-7PP3EJUH.mjs.map} +0 -0
|
@@ -1,752 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__esm,
|
|
3
|
-
__export
|
|
4
|
-
} from "./chunk-WMJKH4XE.mjs";
|
|
5
|
-
|
|
6
|
-
// src/logger.ts
|
|
7
|
-
var logger_exports = {};
|
|
8
|
-
__export(logger_exports, {
|
|
9
|
-
configureLoggerFromCli: () => configureLoggerFromCli,
|
|
10
|
-
logger: () => logger
|
|
11
|
-
});
|
|
12
|
-
function levelToNumber(level) {
|
|
13
|
-
switch (level) {
|
|
14
|
-
case "silent":
|
|
15
|
-
return 0;
|
|
16
|
-
case "error":
|
|
17
|
-
return 10;
|
|
18
|
-
case "warn":
|
|
19
|
-
return 20;
|
|
20
|
-
case "info":
|
|
21
|
-
return 30;
|
|
22
|
-
case "verbose":
|
|
23
|
-
return 40;
|
|
24
|
-
case "debug":
|
|
25
|
-
return 50;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
function configureLoggerFromCli(options) {
|
|
29
|
-
logger.configure({
|
|
30
|
-
outputFormat: options.output,
|
|
31
|
-
debug: options.debug,
|
|
32
|
-
verbose: options.verbose,
|
|
33
|
-
quiet: options.quiet
|
|
34
|
-
});
|
|
35
|
-
try {
|
|
36
|
-
if (options.output) process.env.VISOR_OUTPUT_FORMAT = String(options.output);
|
|
37
|
-
if (typeof options.debug === "boolean") {
|
|
38
|
-
process.env.VISOR_DEBUG = options.debug ? "true" : "false";
|
|
39
|
-
}
|
|
40
|
-
} catch {
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
var Logger, logger;
|
|
44
|
-
var init_logger = __esm({
|
|
45
|
-
"src/logger.ts"() {
|
|
46
|
-
"use strict";
|
|
47
|
-
Logger = class {
|
|
48
|
-
level = "info";
|
|
49
|
-
isJsonLike = false;
|
|
50
|
-
isTTY = typeof process !== "undefined" ? !!process.stderr.isTTY : false;
|
|
51
|
-
configure(opts = {}) {
|
|
52
|
-
let lvl = "info";
|
|
53
|
-
if (opts.debug || process.env.VISOR_DEBUG === "true") {
|
|
54
|
-
lvl = "debug";
|
|
55
|
-
} else if (opts.verbose || process.env.VISOR_LOG_LEVEL === "verbose") {
|
|
56
|
-
lvl = "verbose";
|
|
57
|
-
} else if (opts.quiet || process.env.VISOR_LOG_LEVEL === "quiet") {
|
|
58
|
-
lvl = "warn";
|
|
59
|
-
} else if (opts.level) {
|
|
60
|
-
lvl = opts.level;
|
|
61
|
-
} else if (process.env.VISOR_LOG_LEVEL) {
|
|
62
|
-
const envLvl = process.env.VISOR_LOG_LEVEL;
|
|
63
|
-
if (["silent", "error", "warn", "info", "verbose", "debug"].includes(envLvl)) {
|
|
64
|
-
lvl = envLvl;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
this.level = lvl;
|
|
68
|
-
const output = opts.outputFormat || process.env.VISOR_OUTPUT_FORMAT || "table";
|
|
69
|
-
this.isJsonLike = output === "json" || output === "sarif";
|
|
70
|
-
}
|
|
71
|
-
shouldLog(level) {
|
|
72
|
-
const desired = levelToNumber(level);
|
|
73
|
-
const current = levelToNumber(this.level);
|
|
74
|
-
if (desired > current) return false;
|
|
75
|
-
if (this.isJsonLike && desired < levelToNumber("error") && this.level !== "debug" && this.level !== "verbose") {
|
|
76
|
-
return false;
|
|
77
|
-
}
|
|
78
|
-
return true;
|
|
79
|
-
}
|
|
80
|
-
write(msg) {
|
|
81
|
-
try {
|
|
82
|
-
process.stderr.write(msg + "\n");
|
|
83
|
-
} catch {
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
info(msg) {
|
|
87
|
-
if (this.shouldLog("info")) this.write(msg);
|
|
88
|
-
}
|
|
89
|
-
warn(msg) {
|
|
90
|
-
if (this.shouldLog("warn")) this.write(msg);
|
|
91
|
-
}
|
|
92
|
-
error(msg) {
|
|
93
|
-
if (this.shouldLog("error")) this.write(msg);
|
|
94
|
-
}
|
|
95
|
-
verbose(msg) {
|
|
96
|
-
if (this.shouldLog("verbose")) this.write(msg);
|
|
97
|
-
}
|
|
98
|
-
debug(msg) {
|
|
99
|
-
if (this.shouldLog("debug")) this.write(msg);
|
|
100
|
-
}
|
|
101
|
-
step(msg) {
|
|
102
|
-
if (this.shouldLog("info")) this.write(`\u25B6 ${msg}`);
|
|
103
|
-
}
|
|
104
|
-
success(msg) {
|
|
105
|
-
if (this.shouldLog("info")) this.write(`\u2714 ${msg}`);
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
logger = new Logger();
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
// src/liquid-extensions.ts
|
|
113
|
-
import { Liquid, Tag, Value } from "liquidjs";
|
|
114
|
-
import { AsyncLocalStorage } from "async_hooks";
|
|
115
|
-
import fs2 from "fs/promises";
|
|
116
|
-
import path2 from "path";
|
|
117
|
-
|
|
118
|
-
// src/utils/author-permissions.ts
|
|
119
|
-
var PERMISSION_HIERARCHY = [
|
|
120
|
-
"OWNER",
|
|
121
|
-
"MEMBER",
|
|
122
|
-
"COLLABORATOR",
|
|
123
|
-
"CONTRIBUTOR",
|
|
124
|
-
"FIRST_TIME_CONTRIBUTOR",
|
|
125
|
-
"FIRST_TIMER",
|
|
126
|
-
"NONE"
|
|
127
|
-
];
|
|
128
|
-
function getPermissionLevel(association) {
|
|
129
|
-
if (!association) return PERMISSION_HIERARCHY.length;
|
|
130
|
-
const index = PERMISSION_HIERARCHY.indexOf(association.toUpperCase());
|
|
131
|
-
return index === -1 ? PERMISSION_HIERARCHY.length : index;
|
|
132
|
-
}
|
|
133
|
-
function hasMinPermission(authorAssociation, minPermission, isLocalMode = false) {
|
|
134
|
-
if (isLocalMode) {
|
|
135
|
-
return true;
|
|
136
|
-
}
|
|
137
|
-
const authorLevel = getPermissionLevel(authorAssociation);
|
|
138
|
-
const minLevel = getPermissionLevel(minPermission);
|
|
139
|
-
return authorLevel <= minLevel;
|
|
140
|
-
}
|
|
141
|
-
function isOwner(authorAssociation, isLocalMode = false) {
|
|
142
|
-
if (isLocalMode) return true;
|
|
143
|
-
return authorAssociation?.toUpperCase() === "OWNER";
|
|
144
|
-
}
|
|
145
|
-
function isMember(authorAssociation, isLocalMode = false) {
|
|
146
|
-
if (isLocalMode) return true;
|
|
147
|
-
return hasMinPermission(authorAssociation, "MEMBER", isLocalMode);
|
|
148
|
-
}
|
|
149
|
-
function isCollaborator(authorAssociation, isLocalMode = false) {
|
|
150
|
-
if (isLocalMode) return true;
|
|
151
|
-
return hasMinPermission(authorAssociation, "COLLABORATOR", isLocalMode);
|
|
152
|
-
}
|
|
153
|
-
function isContributor(authorAssociation, isLocalMode = false) {
|
|
154
|
-
if (isLocalMode) return true;
|
|
155
|
-
return hasMinPermission(authorAssociation, "CONTRIBUTOR", isLocalMode);
|
|
156
|
-
}
|
|
157
|
-
function isFirstTimer(authorAssociation, isLocalMode = false) {
|
|
158
|
-
if (isLocalMode) return false;
|
|
159
|
-
const assoc = authorAssociation?.toUpperCase();
|
|
160
|
-
return assoc === "FIRST_TIME_CONTRIBUTOR" || assoc === "FIRST_TIMER";
|
|
161
|
-
}
|
|
162
|
-
function createPermissionHelpers(authorAssociation, isLocalMode = false) {
|
|
163
|
-
return {
|
|
164
|
-
hasMinPermission: (minPermission) => hasMinPermission(authorAssociation, minPermission, isLocalMode),
|
|
165
|
-
isOwner: () => isOwner(authorAssociation, isLocalMode),
|
|
166
|
-
isMember: () => isMember(authorAssociation, isLocalMode),
|
|
167
|
-
isCollaborator: () => isCollaborator(authorAssociation, isLocalMode),
|
|
168
|
-
isContributor: () => isContributor(authorAssociation, isLocalMode),
|
|
169
|
-
isFirstTimer: () => isFirstTimer(authorAssociation, isLocalMode)
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
function detectLocalMode() {
|
|
173
|
-
return !process.env.GITHUB_ACTIONS;
|
|
174
|
-
}
|
|
175
|
-
function resolveAssociationFromEvent(eventContext, fallback) {
|
|
176
|
-
try {
|
|
177
|
-
const ec = eventContext || {};
|
|
178
|
-
return ec?.comment?.author_association || ec?.issue?.author_association || ec?.pull_request?.author_association || fallback;
|
|
179
|
-
} catch {
|
|
180
|
-
return fallback;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
// src/memory-store.ts
|
|
185
|
-
init_logger();
|
|
186
|
-
import fs from "fs/promises";
|
|
187
|
-
import path from "path";
|
|
188
|
-
var MemoryStore = class _MemoryStore {
|
|
189
|
-
static instance;
|
|
190
|
-
data;
|
|
191
|
-
// namespace -> key -> value
|
|
192
|
-
config;
|
|
193
|
-
initialized = false;
|
|
194
|
-
constructor(config) {
|
|
195
|
-
this.data = /* @__PURE__ */ new Map();
|
|
196
|
-
this.config = this.normalizeConfig(config);
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* Get singleton instance
|
|
200
|
-
*/
|
|
201
|
-
static getInstance(config) {
|
|
202
|
-
if (!_MemoryStore.instance) {
|
|
203
|
-
_MemoryStore.instance = new _MemoryStore(config);
|
|
204
|
-
} else if (config && !_MemoryStore.instance.initialized) {
|
|
205
|
-
_MemoryStore.instance.config = _MemoryStore.instance.normalizeConfig(config);
|
|
206
|
-
}
|
|
207
|
-
return _MemoryStore.instance;
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Reset singleton instance (for testing)
|
|
211
|
-
*/
|
|
212
|
-
static resetInstance() {
|
|
213
|
-
_MemoryStore.instance = void 0;
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* Initialize memory store (load from file if configured)
|
|
217
|
-
*/
|
|
218
|
-
async initialize() {
|
|
219
|
-
if (this.initialized) {
|
|
220
|
-
return;
|
|
221
|
-
}
|
|
222
|
-
if (this.config.storage === "file" && this.config.auto_load && this.config.file) {
|
|
223
|
-
try {
|
|
224
|
-
await this.load();
|
|
225
|
-
logger.debug(`Memory store loaded from ${this.config.file}`);
|
|
226
|
-
} catch (error) {
|
|
227
|
-
if (error.code !== "ENOENT") {
|
|
228
|
-
logger.warn(
|
|
229
|
-
`Failed to load memory store from ${this.config.file}: ${error instanceof Error ? error.message : "Unknown error"}`
|
|
230
|
-
);
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
this.initialized = true;
|
|
235
|
-
}
|
|
236
|
-
/**
|
|
237
|
-
* Normalize and apply defaults to config
|
|
238
|
-
*/
|
|
239
|
-
normalizeConfig(config) {
|
|
240
|
-
const storage = config?.storage || "memory";
|
|
241
|
-
return {
|
|
242
|
-
storage,
|
|
243
|
-
format: config?.format || "json",
|
|
244
|
-
file: config?.file,
|
|
245
|
-
namespace: config?.namespace || "default",
|
|
246
|
-
auto_load: config?.auto_load !== false,
|
|
247
|
-
auto_save: config?.auto_save !== false
|
|
248
|
-
};
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* Get the default namespace
|
|
252
|
-
*/
|
|
253
|
-
getDefaultNamespace() {
|
|
254
|
-
return this.config.namespace || "default";
|
|
255
|
-
}
|
|
256
|
-
/**
|
|
257
|
-
* Get a value from memory
|
|
258
|
-
*/
|
|
259
|
-
get(key, namespace) {
|
|
260
|
-
const ns = namespace || this.getDefaultNamespace();
|
|
261
|
-
const nsData = this.data.get(ns);
|
|
262
|
-
return nsData?.get(key);
|
|
263
|
-
}
|
|
264
|
-
/**
|
|
265
|
-
* Check if a key exists in memory
|
|
266
|
-
*/
|
|
267
|
-
has(key, namespace) {
|
|
268
|
-
const ns = namespace || this.getDefaultNamespace();
|
|
269
|
-
const nsData = this.data.get(ns);
|
|
270
|
-
return nsData?.has(key) || false;
|
|
271
|
-
}
|
|
272
|
-
/**
|
|
273
|
-
* Set a value in memory (override existing)
|
|
274
|
-
*/
|
|
275
|
-
async set(key, value, namespace) {
|
|
276
|
-
const ns = namespace || this.getDefaultNamespace();
|
|
277
|
-
if (!this.data.has(ns)) {
|
|
278
|
-
this.data.set(ns, /* @__PURE__ */ new Map());
|
|
279
|
-
}
|
|
280
|
-
const nsData = this.data.get(ns);
|
|
281
|
-
nsData.set(key, value);
|
|
282
|
-
if (this.config.storage === "file" && this.config.auto_save) {
|
|
283
|
-
await this.save();
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
/**
|
|
287
|
-
* Append a value to an array in memory
|
|
288
|
-
* If key doesn't exist, creates a new array
|
|
289
|
-
* If key exists but is not an array, converts it to an array
|
|
290
|
-
*/
|
|
291
|
-
async append(key, value, namespace) {
|
|
292
|
-
const ns = namespace || this.getDefaultNamespace();
|
|
293
|
-
const existing = this.get(key, ns);
|
|
294
|
-
let newValue;
|
|
295
|
-
if (existing === void 0) {
|
|
296
|
-
newValue = [value];
|
|
297
|
-
} else if (Array.isArray(existing)) {
|
|
298
|
-
newValue = [...existing, value];
|
|
299
|
-
} else {
|
|
300
|
-
newValue = [existing, value];
|
|
301
|
-
}
|
|
302
|
-
await this.set(key, newValue, ns);
|
|
303
|
-
}
|
|
304
|
-
/**
|
|
305
|
-
* Increment a numeric value in memory
|
|
306
|
-
* If key doesn't exist, initializes to 0 before incrementing
|
|
307
|
-
* If key exists but is not a number, throws an error
|
|
308
|
-
*/
|
|
309
|
-
async increment(key, amount = 1, namespace) {
|
|
310
|
-
const ns = namespace || this.getDefaultNamespace();
|
|
311
|
-
const existing = this.get(key, ns);
|
|
312
|
-
let newValue;
|
|
313
|
-
if (existing === void 0 || existing === null) {
|
|
314
|
-
newValue = amount;
|
|
315
|
-
} else if (typeof existing === "number") {
|
|
316
|
-
newValue = existing + amount;
|
|
317
|
-
} else {
|
|
318
|
-
throw new Error(
|
|
319
|
-
`Cannot increment non-numeric value at key '${key}' (type: ${typeof existing})`
|
|
320
|
-
);
|
|
321
|
-
}
|
|
322
|
-
await this.set(key, newValue, ns);
|
|
323
|
-
return newValue;
|
|
324
|
-
}
|
|
325
|
-
/**
|
|
326
|
-
* Delete a key from memory
|
|
327
|
-
*/
|
|
328
|
-
async delete(key, namespace) {
|
|
329
|
-
const ns = namespace || this.getDefaultNamespace();
|
|
330
|
-
const nsData = this.data.get(ns);
|
|
331
|
-
if (!nsData) {
|
|
332
|
-
return false;
|
|
333
|
-
}
|
|
334
|
-
const deleted = nsData.delete(key);
|
|
335
|
-
if (deleted && this.config.storage === "file" && this.config.auto_save) {
|
|
336
|
-
await this.save();
|
|
337
|
-
}
|
|
338
|
-
return deleted;
|
|
339
|
-
}
|
|
340
|
-
/**
|
|
341
|
-
* Clear all keys in a namespace (or all namespaces if none specified)
|
|
342
|
-
*/
|
|
343
|
-
async clear(namespace) {
|
|
344
|
-
if (namespace) {
|
|
345
|
-
this.data.delete(namespace);
|
|
346
|
-
} else {
|
|
347
|
-
this.data.clear();
|
|
348
|
-
}
|
|
349
|
-
if (this.config.storage === "file" && this.config.auto_save) {
|
|
350
|
-
await this.save();
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
/**
|
|
354
|
-
* List all keys in a namespace
|
|
355
|
-
*/
|
|
356
|
-
list(namespace) {
|
|
357
|
-
const ns = namespace || this.getDefaultNamespace();
|
|
358
|
-
const nsData = this.data.get(ns);
|
|
359
|
-
return nsData ? Array.from(nsData.keys()) : [];
|
|
360
|
-
}
|
|
361
|
-
/**
|
|
362
|
-
* List all namespaces
|
|
363
|
-
*/
|
|
364
|
-
listNamespaces() {
|
|
365
|
-
return Array.from(this.data.keys());
|
|
366
|
-
}
|
|
367
|
-
/**
|
|
368
|
-
* Get all data in a namespace
|
|
369
|
-
*/
|
|
370
|
-
getAll(namespace) {
|
|
371
|
-
const ns = namespace || this.getDefaultNamespace();
|
|
372
|
-
const nsData = this.data.get(ns);
|
|
373
|
-
if (!nsData) {
|
|
374
|
-
return {};
|
|
375
|
-
}
|
|
376
|
-
const result = {};
|
|
377
|
-
for (const [key, value] of nsData.entries()) {
|
|
378
|
-
result[key] = value;
|
|
379
|
-
}
|
|
380
|
-
return result;
|
|
381
|
-
}
|
|
382
|
-
/**
|
|
383
|
-
* Load data from file
|
|
384
|
-
*/
|
|
385
|
-
async load() {
|
|
386
|
-
if (!this.config.file) {
|
|
387
|
-
throw new Error("No file path configured for memory store");
|
|
388
|
-
}
|
|
389
|
-
const filePath = path.resolve(process.cwd(), this.config.file);
|
|
390
|
-
const content = await fs.readFile(filePath, "utf-8");
|
|
391
|
-
if (this.config.format === "json") {
|
|
392
|
-
await this.loadFromJson(content);
|
|
393
|
-
} else if (this.config.format === "csv") {
|
|
394
|
-
await this.loadFromCsv(content);
|
|
395
|
-
} else {
|
|
396
|
-
throw new Error(`Unsupported format: ${this.config.format}`);
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
/**
|
|
400
|
-
* Save data to file
|
|
401
|
-
*/
|
|
402
|
-
async save() {
|
|
403
|
-
if (!this.config.file) {
|
|
404
|
-
throw new Error("No file path configured for memory store");
|
|
405
|
-
}
|
|
406
|
-
const filePath = path.resolve(process.cwd(), this.config.file);
|
|
407
|
-
const dir = path.dirname(filePath);
|
|
408
|
-
await fs.mkdir(dir, { recursive: true });
|
|
409
|
-
let content;
|
|
410
|
-
if (this.config.format === "json") {
|
|
411
|
-
content = this.saveToJson();
|
|
412
|
-
} else if (this.config.format === "csv") {
|
|
413
|
-
content = this.saveToCsv();
|
|
414
|
-
} else {
|
|
415
|
-
throw new Error(`Unsupported format: ${this.config.format}`);
|
|
416
|
-
}
|
|
417
|
-
await fs.writeFile(filePath, content, "utf-8");
|
|
418
|
-
}
|
|
419
|
-
/**
|
|
420
|
-
* Load data from JSON format
|
|
421
|
-
*/
|
|
422
|
-
async loadFromJson(content) {
|
|
423
|
-
const data = JSON.parse(content);
|
|
424
|
-
this.data.clear();
|
|
425
|
-
for (const [namespace, nsData] of Object.entries(data)) {
|
|
426
|
-
if (typeof nsData === "object" && nsData !== null && !Array.isArray(nsData)) {
|
|
427
|
-
const nsMap = /* @__PURE__ */ new Map();
|
|
428
|
-
for (const [key, value] of Object.entries(nsData)) {
|
|
429
|
-
nsMap.set(key, value);
|
|
430
|
-
}
|
|
431
|
-
this.data.set(namespace, nsMap);
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
/**
|
|
436
|
-
* Save data to JSON format
|
|
437
|
-
*/
|
|
438
|
-
saveToJson() {
|
|
439
|
-
const result = {};
|
|
440
|
-
for (const [namespace, nsData] of this.data.entries()) {
|
|
441
|
-
const nsObj = {};
|
|
442
|
-
for (const [key, value] of nsData.entries()) {
|
|
443
|
-
nsObj[key] = value;
|
|
444
|
-
}
|
|
445
|
-
result[namespace] = nsObj;
|
|
446
|
-
}
|
|
447
|
-
return JSON.stringify(result, null, 2);
|
|
448
|
-
}
|
|
449
|
-
/**
|
|
450
|
-
* Load data from CSV format
|
|
451
|
-
* CSV format: namespace,key,value,type
|
|
452
|
-
*/
|
|
453
|
-
async loadFromCsv(content) {
|
|
454
|
-
const lines = content.split("\n").filter((line) => line.trim());
|
|
455
|
-
let startIndex = 0;
|
|
456
|
-
if (lines[0]?.startsWith("namespace,")) {
|
|
457
|
-
startIndex = 1;
|
|
458
|
-
}
|
|
459
|
-
this.data.clear();
|
|
460
|
-
const arrays = /* @__PURE__ */ new Map();
|
|
461
|
-
for (let i = startIndex; i < lines.length; i++) {
|
|
462
|
-
const line = lines[i];
|
|
463
|
-
const parts = this.parseCsvLine(line);
|
|
464
|
-
if (parts.length < 3) {
|
|
465
|
-
logger.warn(`Invalid CSV line ${i + 1}: ${line}`);
|
|
466
|
-
continue;
|
|
467
|
-
}
|
|
468
|
-
const [namespace, key, valueStr, typeStr] = parts;
|
|
469
|
-
const value = this.parseCsvValue(valueStr, typeStr);
|
|
470
|
-
if (!this.data.has(namespace)) {
|
|
471
|
-
this.data.set(namespace, /* @__PURE__ */ new Map());
|
|
472
|
-
arrays.set(namespace, /* @__PURE__ */ new Map());
|
|
473
|
-
}
|
|
474
|
-
const nsData = this.data.get(namespace);
|
|
475
|
-
const nsArrays = arrays.get(namespace);
|
|
476
|
-
if (nsData.has(key)) {
|
|
477
|
-
if (!nsArrays.has(key)) {
|
|
478
|
-
const existingValue = nsData.get(key);
|
|
479
|
-
nsArrays.set(key, [existingValue]);
|
|
480
|
-
}
|
|
481
|
-
nsArrays.get(key).push(value);
|
|
482
|
-
nsData.set(key, nsArrays.get(key));
|
|
483
|
-
} else {
|
|
484
|
-
nsData.set(key, value);
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
/**
|
|
489
|
-
* Save data to CSV format
|
|
490
|
-
*/
|
|
491
|
-
saveToCsv() {
|
|
492
|
-
const lines = ["namespace,key,value,type"];
|
|
493
|
-
for (const [namespace, nsData] of this.data.entries()) {
|
|
494
|
-
for (const [key, value] of nsData.entries()) {
|
|
495
|
-
if (Array.isArray(value)) {
|
|
496
|
-
for (const item of value) {
|
|
497
|
-
lines.push(this.formatCsvLine(namespace, key, item));
|
|
498
|
-
}
|
|
499
|
-
} else {
|
|
500
|
-
lines.push(this.formatCsvLine(namespace, key, value));
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
return lines.join("\n") + "\n";
|
|
505
|
-
}
|
|
506
|
-
/**
|
|
507
|
-
* Parse a CSV line, handling quoted values with commas
|
|
508
|
-
*/
|
|
509
|
-
parseCsvLine(line) {
|
|
510
|
-
const parts = [];
|
|
511
|
-
let current = "";
|
|
512
|
-
let inQuotes = false;
|
|
513
|
-
for (let i = 0; i < line.length; i++) {
|
|
514
|
-
const char = line[i];
|
|
515
|
-
if (char === '"') {
|
|
516
|
-
if (inQuotes && line[i + 1] === '"') {
|
|
517
|
-
current += '"';
|
|
518
|
-
i++;
|
|
519
|
-
} else {
|
|
520
|
-
inQuotes = !inQuotes;
|
|
521
|
-
}
|
|
522
|
-
} else if (char === "," && !inQuotes) {
|
|
523
|
-
parts.push(current);
|
|
524
|
-
current = "";
|
|
525
|
-
} else {
|
|
526
|
-
current += char;
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
parts.push(current);
|
|
530
|
-
return parts;
|
|
531
|
-
}
|
|
532
|
-
/**
|
|
533
|
-
* Format a CSV line with proper escaping
|
|
534
|
-
*/
|
|
535
|
-
formatCsvLine(namespace, key, value) {
|
|
536
|
-
const type = this.getValueType(value);
|
|
537
|
-
const valueStr = this.formatCsvValue(value);
|
|
538
|
-
return `${this.escapeCsv(namespace)},${this.escapeCsv(key)},${valueStr},${type}`;
|
|
539
|
-
}
|
|
540
|
-
/**
|
|
541
|
-
* Escape a CSV value
|
|
542
|
-
*/
|
|
543
|
-
escapeCsv(value) {
|
|
544
|
-
if (value.includes(",") || value.includes('"') || value.includes("\n")) {
|
|
545
|
-
return `"${value.replace(/"/g, '""')}"`;
|
|
546
|
-
}
|
|
547
|
-
return value;
|
|
548
|
-
}
|
|
549
|
-
/**
|
|
550
|
-
* Format a value for CSV storage
|
|
551
|
-
*/
|
|
552
|
-
formatCsvValue(value) {
|
|
553
|
-
if (value === null) {
|
|
554
|
-
return '""';
|
|
555
|
-
}
|
|
556
|
-
if (value === void 0) {
|
|
557
|
-
return '""';
|
|
558
|
-
}
|
|
559
|
-
if (typeof value === "string") {
|
|
560
|
-
return this.escapeCsv(value);
|
|
561
|
-
}
|
|
562
|
-
if (typeof value === "number" || typeof value === "boolean") {
|
|
563
|
-
return this.escapeCsv(String(value));
|
|
564
|
-
}
|
|
565
|
-
return this.escapeCsv(JSON.stringify(value));
|
|
566
|
-
}
|
|
567
|
-
/**
|
|
568
|
-
* Parse a CSV value based on its type
|
|
569
|
-
*/
|
|
570
|
-
parseCsvValue(valueStr, typeStr) {
|
|
571
|
-
if (!typeStr || typeStr === "string") {
|
|
572
|
-
return valueStr;
|
|
573
|
-
}
|
|
574
|
-
if (typeStr === "number") {
|
|
575
|
-
return Number(valueStr);
|
|
576
|
-
}
|
|
577
|
-
if (typeStr === "boolean") {
|
|
578
|
-
return valueStr === "true";
|
|
579
|
-
}
|
|
580
|
-
if (typeStr === "object" || typeStr === "array") {
|
|
581
|
-
try {
|
|
582
|
-
return JSON.parse(valueStr);
|
|
583
|
-
} catch {
|
|
584
|
-
return valueStr;
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
return valueStr;
|
|
588
|
-
}
|
|
589
|
-
/**
|
|
590
|
-
* Get the type of a value for CSV storage
|
|
591
|
-
*/
|
|
592
|
-
getValueType(value) {
|
|
593
|
-
if (value === null || value === void 0) {
|
|
594
|
-
return "string";
|
|
595
|
-
}
|
|
596
|
-
if (typeof value === "number") {
|
|
597
|
-
return "number";
|
|
598
|
-
}
|
|
599
|
-
if (typeof value === "boolean") {
|
|
600
|
-
return "boolean";
|
|
601
|
-
}
|
|
602
|
-
if (Array.isArray(value)) {
|
|
603
|
-
return "array";
|
|
604
|
-
}
|
|
605
|
-
if (typeof value === "object") {
|
|
606
|
-
return "object";
|
|
607
|
-
}
|
|
608
|
-
return "string";
|
|
609
|
-
}
|
|
610
|
-
/**
|
|
611
|
-
* Get the current configuration
|
|
612
|
-
*/
|
|
613
|
-
getConfig() {
|
|
614
|
-
return { ...this.config };
|
|
615
|
-
}
|
|
616
|
-
};
|
|
617
|
-
|
|
618
|
-
// src/liquid-extensions.ts
|
|
619
|
-
function sanitizeLabel(value) {
|
|
620
|
-
if (value == null) return "";
|
|
621
|
-
const s = String(value);
|
|
622
|
-
return s.replace(/[^A-Za-z0-9:\/\- ]/g, "").replace(/\/{2,}/g, "/").trim();
|
|
623
|
-
}
|
|
624
|
-
function sanitizeLabelList(labels) {
|
|
625
|
-
if (!Array.isArray(labels)) return [];
|
|
626
|
-
return labels.map((v) => sanitizeLabel(v)).filter((s) => s.length > 0);
|
|
627
|
-
}
|
|
628
|
-
var ReadFileTag = class extends Tag {
|
|
629
|
-
filepath;
|
|
630
|
-
constructor(token, remainTokens, liquid) {
|
|
631
|
-
super(token, remainTokens, liquid);
|
|
632
|
-
this.filepath = new Value(token.args, liquid);
|
|
633
|
-
}
|
|
634
|
-
*render(ctx, emitter) {
|
|
635
|
-
const filePath = yield this.filepath.value(ctx, false);
|
|
636
|
-
if (!filePath || typeof filePath !== "string") {
|
|
637
|
-
emitter.write("[Error: Invalid file path]");
|
|
638
|
-
return;
|
|
639
|
-
}
|
|
640
|
-
const projectRoot = process.cwd();
|
|
641
|
-
const resolvedPath = path2.resolve(projectRoot, filePath.toString());
|
|
642
|
-
if (!resolvedPath.startsWith(projectRoot)) {
|
|
643
|
-
emitter.write("[Error: File path escapes project directory]");
|
|
644
|
-
return;
|
|
645
|
-
}
|
|
646
|
-
try {
|
|
647
|
-
const content = yield fs2.readFile(resolvedPath, "utf-8");
|
|
648
|
-
emitter.write(content);
|
|
649
|
-
} catch (error) {
|
|
650
|
-
const errorMessage = error instanceof Error ? error.message : error?.code || "Unknown error";
|
|
651
|
-
emitter.write(`[Error reading file: ${errorMessage}]`);
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
};
|
|
655
|
-
var permissionsALS = new AsyncLocalStorage();
|
|
656
|
-
async function withPermissionsContext(ctx, fn) {
|
|
657
|
-
return await permissionsALS.run(ctx, fn);
|
|
658
|
-
}
|
|
659
|
-
function configureLiquidWithExtensions(liquid) {
|
|
660
|
-
liquid.registerTag("readfile", ReadFileTag);
|
|
661
|
-
liquid.registerFilter("parse_json", (value) => {
|
|
662
|
-
if (typeof value !== "string") {
|
|
663
|
-
return value;
|
|
664
|
-
}
|
|
665
|
-
try {
|
|
666
|
-
return JSON.parse(value);
|
|
667
|
-
} catch {
|
|
668
|
-
return value;
|
|
669
|
-
}
|
|
670
|
-
});
|
|
671
|
-
liquid.registerFilter("to_json", (value) => {
|
|
672
|
-
try {
|
|
673
|
-
return JSON.stringify(value);
|
|
674
|
-
} catch {
|
|
675
|
-
return "[Error: Unable to serialize to JSON]";
|
|
676
|
-
}
|
|
677
|
-
});
|
|
678
|
-
liquid.registerFilter("safe_label", (value) => sanitizeLabel(value));
|
|
679
|
-
liquid.registerFilter("safe_label_list", (value) => sanitizeLabelList(value));
|
|
680
|
-
liquid.registerFilter("unescape_newlines", (value) => {
|
|
681
|
-
if (value == null) return "";
|
|
682
|
-
const s = String(value);
|
|
683
|
-
return s.replace(/\\n/g, "\n").replace(/\\r/g, "\r").replace(/\\t/g, " ");
|
|
684
|
-
});
|
|
685
|
-
const isLocal = detectLocalMode();
|
|
686
|
-
const resolveAssoc = (val) => {
|
|
687
|
-
if (typeof val === "string" && val.length > 0) return val;
|
|
688
|
-
const store = permissionsALS.getStore();
|
|
689
|
-
return store?.authorAssociation;
|
|
690
|
-
};
|
|
691
|
-
liquid.registerFilter("has_min_permission", (authorAssociation, level) => {
|
|
692
|
-
return hasMinPermission(resolveAssoc(authorAssociation), level, isLocal);
|
|
693
|
-
});
|
|
694
|
-
liquid.registerFilter("is_owner", (authorAssociation) => {
|
|
695
|
-
return isOwner(resolveAssoc(authorAssociation), isLocal);
|
|
696
|
-
});
|
|
697
|
-
liquid.registerFilter("is_member", (authorAssociation) => {
|
|
698
|
-
return isMember(resolveAssoc(authorAssociation), isLocal);
|
|
699
|
-
});
|
|
700
|
-
liquid.registerFilter("is_collaborator", (authorAssociation) => {
|
|
701
|
-
return isCollaborator(resolveAssoc(authorAssociation), isLocal);
|
|
702
|
-
});
|
|
703
|
-
liquid.registerFilter("is_contributor", (authorAssociation) => {
|
|
704
|
-
return isContributor(resolveAssoc(authorAssociation), isLocal);
|
|
705
|
-
});
|
|
706
|
-
liquid.registerFilter("is_first_timer", (authorAssociation) => {
|
|
707
|
-
return isFirstTimer(resolveAssoc(authorAssociation), isLocal);
|
|
708
|
-
});
|
|
709
|
-
const memoryStore = MemoryStore.getInstance();
|
|
710
|
-
liquid.registerFilter("memory_get", (key, namespace) => {
|
|
711
|
-
if (typeof key !== "string") {
|
|
712
|
-
return void 0;
|
|
713
|
-
}
|
|
714
|
-
return memoryStore.get(key, namespace);
|
|
715
|
-
});
|
|
716
|
-
liquid.registerFilter("memory_has", (key, namespace) => {
|
|
717
|
-
if (typeof key !== "string") {
|
|
718
|
-
return false;
|
|
719
|
-
}
|
|
720
|
-
return memoryStore.has(key, namespace);
|
|
721
|
-
});
|
|
722
|
-
liquid.registerFilter("memory_list", (namespace) => {
|
|
723
|
-
return memoryStore.list(namespace);
|
|
724
|
-
});
|
|
725
|
-
}
|
|
726
|
-
function createExtendedLiquid(options = {}) {
|
|
727
|
-
const liquid = new Liquid({
|
|
728
|
-
cache: false,
|
|
729
|
-
strictFilters: false,
|
|
730
|
-
strictVariables: false,
|
|
731
|
-
...options
|
|
732
|
-
});
|
|
733
|
-
configureLiquidWithExtensions(liquid);
|
|
734
|
-
return liquid;
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
export {
|
|
738
|
-
logger,
|
|
739
|
-
logger_exports,
|
|
740
|
-
init_logger,
|
|
741
|
-
createPermissionHelpers,
|
|
742
|
-
detectLocalMode,
|
|
743
|
-
resolveAssociationFromEvent,
|
|
744
|
-
MemoryStore,
|
|
745
|
-
sanitizeLabel,
|
|
746
|
-
sanitizeLabelList,
|
|
747
|
-
ReadFileTag,
|
|
748
|
-
withPermissionsContext,
|
|
749
|
-
configureLiquidWithExtensions,
|
|
750
|
-
createExtendedLiquid
|
|
751
|
-
};
|
|
752
|
-
//# sourceMappingURL=chunk-B5QBV2QJ.mjs.map
|