@runa-ai/runa-cli 0.5.72 → 0.6.0
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/dist/build-BXUJKYHC.js +1730 -0
- package/dist/cache-H63JKFYH.js +112 -0
- package/dist/check-6AB5NGWK.js +207 -0
- package/dist/chunk-22CS6EMA.js +31 -0
- package/dist/chunk-3FDQW524.js +544 -0
- package/dist/chunk-5NKWR4FF.js +254 -0
- package/dist/chunk-6AALH2ED.js +121 -0
- package/dist/chunk-6Y3LAUGL.js +35 -0
- package/dist/chunk-7QV7U6NI.js +62 -0
- package/dist/chunk-AAIE4F2U.js +140 -0
- package/dist/chunk-CCKG5R4Y.js +59 -0
- package/dist/chunk-CE3DEYFT.js +480 -0
- package/dist/chunk-DRSUEMAK.js +123 -0
- package/dist/chunk-GOGRLQNP.js +12 -0
- package/dist/chunk-HD74F6W2.js +460 -0
- package/dist/chunk-HKUWEGUX.js +36 -0
- package/dist/chunk-HPYJPB5Y.js +408 -0
- package/dist/chunk-IBVVGH6X.js +33 -0
- package/dist/chunk-II7VYQEM.js +179 -0
- package/dist/chunk-JMJP4A47.js +204 -0
- package/dist/chunk-JQXOVCOP.js +574 -0
- package/dist/chunk-JT5SUTWE.js +9 -0
- package/dist/chunk-KWX3JHCY.js +85 -0
- package/dist/chunk-M47WJJVS.js +71 -0
- package/dist/chunk-MNPMZERI.js +194 -0
- package/dist/chunk-MXRWBNIY.js +74 -0
- package/dist/chunk-NPSRD26F.js +149 -0
- package/dist/chunk-P7U52PBY.js +1149 -0
- package/dist/chunk-QDF7QXBL.js +67 -0
- package/dist/chunk-RRGQCUKT.js +48 -0
- package/dist/chunk-RZLYEO4U.js +219 -0
- package/dist/chunk-TYIAD6SB.js +74 -0
- package/dist/chunk-UU55OH7P.js +42 -0
- package/dist/chunk-UWWSAPDR.js +31 -0
- package/dist/chunk-VM3IWOT5.js +458 -0
- package/dist/chunk-VRXHCR5K.js +42 -0
- package/dist/chunk-XJBQINSA.js +351 -0
- package/dist/chunk-ZZOXM6Q4.js +8 -0
- package/dist/ci-V3PIG2GI.js +8322 -0
- package/dist/cli/index.d.ts +7 -1
- package/dist/cli/requested-command.d.ts +8 -0
- package/dist/cli-GFRZCJQR.js +661 -0
- package/dist/commands/build/actors/db-sync.d.ts +2 -0
- package/dist/commands/build/actors/static-checks.d.ts +7 -6
- package/dist/commands/build/contract.d.ts +30 -30
- package/dist/commands/build/machine-dry-run.d.ts +3 -0
- package/dist/commands/build/machine-e2e-meta.d.ts +120 -0
- package/dist/commands/build/machine.d.ts +22 -22
- package/dist/commands/build/types.d.ts +2 -4
- package/dist/commands/ci/machine/contract.d.ts +26 -26
- package/dist/commands/ci/machine/formatters/sections/final-comment.d.ts +1 -5
- package/dist/commands/ci/machine/formatters/sections/format-helpers.d.ts +5 -0
- package/dist/commands/ci/machine/formatters/sections/index.d.ts +2 -2
- package/dist/commands/ci/machine/machine-execution-helpers.d.ts +40 -0
- package/dist/commands/ci/machine/machine-state-helpers.d.ts +14 -0
- package/dist/commands/ci/machine/machine.d.ts +12 -12
- package/dist/commands/ci/machine/types.d.ts +0 -5
- package/dist/commands/ci/utils/ci-summary.d.ts +15 -15
- package/dist/commands/ci/utils/execa-helpers.d.ts +1 -0
- package/dist/commands/db/apply/actors/idempotent-actors.d.ts +34 -0
- package/dist/commands/db/apply/actors/lock-actors.d.ts +16 -0
- package/dist/commands/db/apply/actors/pg-schema-diff-actors.d.ts +31 -0
- package/dist/commands/db/apply/actors/seed-actors.d.ts +11 -0
- package/dist/commands/db/apply/actors/shared.d.ts +9 -0
- package/dist/commands/db/apply/actors.d.ts +16 -65
- package/dist/commands/db/apply/contract.d.ts +8 -1
- package/dist/commands/db/apply/helpers/data-compatibility-checker.d.ts +3 -4
- package/dist/commands/db/apply/helpers/data-integrity-verifier.d.ts +37 -0
- package/dist/commands/db/apply/helpers/fresh-db-handler.d.ts +34 -0
- package/dist/commands/db/apply/helpers/hazard-handler.d.ts +60 -0
- package/dist/commands/db/apply/helpers/idempotent-object-registry.d.ts +96 -0
- package/dist/commands/db/apply/helpers/idempotent-transaction.d.ts +20 -0
- package/dist/commands/db/apply/helpers/index.d.ts +6 -0
- package/dist/commands/db/apply/helpers/partition-validator.d.ts +2 -15
- package/dist/commands/db/apply/helpers/pg-schema-diff-helpers.d.ts +18 -162
- package/dist/commands/db/apply/helpers/pg-schema-diff-patterns.d.ts +55 -0
- package/dist/commands/db/apply/helpers/pg-schema-diff-version.d.ts +50 -0
- package/dist/commands/db/apply/helpers/plan-validator.d.ts +4 -10
- package/dist/commands/db/apply/helpers/rbac-password-manager.d.ts +34 -0
- package/dist/commands/db/apply/helpers/retry-logic.d.ts +16 -2
- package/dist/commands/db/apply/helpers/shadow-db-manager.d.ts +1 -1
- package/dist/commands/db/apply/helpers/sql-utils.d.ts +26 -0
- package/dist/commands/db/apply/machine.d.ts +52 -1
- package/dist/commands/db/commands/db-apply.d.ts +18 -0
- package/dist/commands/db/commands/db-sync/boundary-classifier.d.ts +21 -0
- package/dist/commands/db/commands/db-sync/plan-hazard-analyzer.d.ts +13 -0
- package/dist/commands/db/commands/db-sync/risk-reporter.d.ts +19 -0
- package/dist/commands/db/commands/db-sync/sql-parser.d.ts +25 -0
- package/dist/commands/db/commands/db-sync/types.d.ts +47 -0
- package/dist/commands/db/commands/db-sync.d.ts +14 -0
- package/dist/commands/db/sync/contract.d.ts +6 -2
- package/dist/commands/db/sync/machine.d.ts +2 -1
- package/dist/commands/db/types.d.ts +2 -0
- package/dist/commands/db/utils/boundary-policy/rule-compiler.d.ts +11 -0
- package/dist/commands/db/utils/boundary-policy/types.d.ts +105 -0
- package/dist/commands/db/utils/boundary-policy/validation.d.ts +20 -0
- package/dist/commands/db/utils/boundary-policy-runtime.d.ts +28 -0
- package/dist/commands/db/utils/boundary-policy.d.ts +5 -0
- package/dist/commands/db/utils/idempotent-risk-context.d.ts +29 -0
- package/dist/commands/db/utils/preflight-check.d.ts +14 -0
- package/dist/commands/db/utils/preflight-checks/domain-naming-checks.d.ts +106 -0
- package/dist/commands/db/utils/preflight-checks/orphan-checks.d.ts +36 -0
- package/dist/commands/db/utils/preflight-checks/schema-risk-checks.d.ts +22 -0
- package/dist/commands/db/utils/preflight-checks/supabase-checks.d.ts +55 -0
- package/dist/commands/db/utils/risk-detector-loader.d.ts +8 -0
- package/dist/commands/db/utils/schema-precheck-budget.d.ts +17 -0
- package/dist/commands/db/utils/sql-boundary-parser.d.ts +12 -0
- package/dist/commands/db/utils/sql-file-collector.d.ts +8 -0
- package/dist/commands/db/utils/sql-filename-parser.d.ts +20 -0
- package/dist/commands/db/utils/sql-table-extractor-ast.d.ts +19 -0
- package/dist/commands/db/utils/sql-table-extractor-regex.d.ts +50 -0
- package/dist/commands/db/utils/sql-table-extractor-rls.d.ts +13 -0
- package/dist/commands/db/utils/sql-table-extractor.d.ts +79 -1
- package/dist/commands/db/utils/table-registry-introspection.d.ts +68 -0
- package/dist/commands/db/utils/table-registry.d.ts +3 -38
- package/dist/commands/dev/actors/app-lifecycle.d.ts +18 -0
- package/dist/commands/dev/actors/index.d.ts +7 -2
- package/dist/commands/dev/actors/process-check.d.ts +12 -0
- package/dist/commands/dev/actors/shared.d.ts +15 -0
- package/dist/commands/dev/contract.d.ts +2 -2
- package/dist/commands/dev/machine.d.ts +7 -31
- package/dist/commands/env/commands/env-pull/auth.d.ts +13 -0
- package/dist/commands/env/commands/env-pull/dotenv-files.d.ts +14 -0
- package/dist/commands/env/commands/env-pull/security.d.ts +12 -0
- package/dist/commands/env/commands/env-pull/service.d.ts +8 -0
- package/dist/commands/env/commands/env-pull/shared.d.ts +79 -0
- package/dist/commands/env/commands/setup/types.d.ts +1 -1
- package/dist/commands/env/constants/local-supabase.d.ts +2 -0
- package/dist/commands/template-check/contract.d.ts +6 -6
- package/dist/commands/template-check/machine.d.ts +2 -2
- package/dist/commands/template-check/types.d.ts +0 -4
- package/dist/commands/template-check/utils/diff-analyzer.d.ts +0 -4
- package/dist/config/env.d.ts +4 -4
- package/dist/config-loader-GT3HAQ7U.js +7 -0
- package/dist/db-HR7CREX2.js +15913 -0
- package/dist/dev-A7RW6XQV.js +873 -0
- package/dist/env-B47Z4747.js +2624 -0
- package/dist/env-HMMRSYCI.js +7 -0
- package/dist/env-files-K2C7O7L5.js +8 -0
- package/dist/error-handler-4EYSDOSE.js +460 -0
- package/dist/hotfix-CULKKMGS.js +1477 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +48 -42995
- package/dist/init-ELK5QCWR.js +632 -0
- package/dist/inject-test-attrs-Y5UD5P7Q.js +36 -0
- package/dist/internal/machines/snapshot-helpers.d.ts +6 -0
- package/dist/lib/sql-comment-utils.d.ts +25 -0
- package/dist/license-OB7GVJQ2.js +468 -0
- package/dist/link-C43JRZWY.js +60 -0
- package/dist/manifest-2NOQ2IMK.js +32 -0
- package/dist/prepare-32DOVHTE.js +250 -0
- package/dist/risk-detector-BXUY2WKS.js +6 -0
- package/dist/risk-detector-core-O7I7SPR7.js +166 -0
- package/dist/risk-detector-plpgsql-SGMVKYJP.js +1856 -0
- package/dist/sdk-XK6HQU7S.js +348 -0
- package/dist/services-7VK5KZTO.js +177 -0
- package/dist/session-SFW5QSXZ.js +142 -0
- package/dist/signal-handler-DO3OANW5.js +6 -0
- package/dist/status-IJ4ZWHMX.js +95 -0
- package/dist/telemetry-FN7V727Y.js +94 -0
- package/dist/template-check-PNG5NQ5H.js +1933 -0
- package/dist/test-QYXE5UVW.js +626 -0
- package/dist/test-gen-QPWOIEHU.js +89 -0
- package/dist/ui-RJAMCWUI.js +331 -0
- package/dist/upgrade-3SLWVNAC.js +625 -0
- package/dist/utils/config-loader.d.ts +0 -3
- package/dist/validate-SM4PXPS7.js +55 -0
- package/dist/validators/risk-detector-content-risks.d.ts +13 -0
- package/dist/validators/risk-detector-core.d.ts +25 -0
- package/dist/validators/risk-detector-patterns.d.ts +15 -0
- package/dist/validators/risk-detector-plpgsql-expression-resolver.d.ts +22 -0
- package/dist/validators/risk-detector-plpgsql-parser.d.ts +5 -0
- package/dist/validators/risk-detector-plpgsql-tokenizer.d.ts +18 -0
- package/dist/validators/risk-detector-plpgsql.d.ts +9 -0
- package/dist/validators/risk-detector-text-utils.d.ts +6 -0
- package/dist/validators/risk-detector-types.d.ts +16 -0
- package/dist/validators/risk-detector.d.ts +7 -26
- package/dist/vuln-check-TYQNEFS7.js +122 -0
- package/dist/vuln-checker-2QXGN5YT.js +2950 -0
- package/dist/watch-UCDVOQAH.js +911 -0
- package/dist/workflow-ZB5Q2PFY.js +898 -0
- package/package.json +4 -1
- package/dist/cli/contract-mode.d.ts.map +0 -1
- package/dist/cli/contract-output.d.ts.map +0 -1
- package/dist/cli/early-flags.d.ts.map +0 -1
- package/dist/cli/error-handler.d.ts.map +0 -1
- package/dist/cli/exec.d.ts.map +0 -1
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/json-output.d.ts.map +0 -1
- package/dist/cli/non-interactive.d.ts.map +0 -1
- package/dist/cli/output-format.d.ts.map +0 -1
- package/dist/cli/signal-handler.d.ts.map +0 -1
- package/dist/commands/build/actors/build.d.ts.map +0 -1
- package/dist/commands/build/actors/clean.d.ts.map +0 -1
- package/dist/commands/build/actors/db-sync.d.ts.map +0 -1
- package/dist/commands/build/actors/index.d.ts.map +0 -1
- package/dist/commands/build/actors/manifest.d.ts.map +0 -1
- package/dist/commands/build/actors/setup.d.ts.map +0 -1
- package/dist/commands/build/actors/static-checks.d.ts.map +0 -1
- package/dist/commands/build/actors/validate.d.ts.map +0 -1
- package/dist/commands/build/commands/build.d.ts.map +0 -1
- package/dist/commands/build/contract.d.ts.map +0 -1
- package/dist/commands/build/guards.d.ts.map +0 -1
- package/dist/commands/build/index.d.ts.map +0 -1
- package/dist/commands/build/machine.d.ts.map +0 -1
- package/dist/commands/build/types.d.ts.map +0 -1
- package/dist/commands/cache.d.ts.map +0 -1
- package/dist/commands/check/commands/check.d.ts.map +0 -1
- package/dist/commands/check/index.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-checks.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-layer-content.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-pr-capabilities.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-prod-apply.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-prod-db-operations.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-prod-github.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-prod-types.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-prod-utils.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-prod-workflow.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-resolvers.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-static.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-supabase-local.d.ts.map +0 -1
- package/dist/commands/ci/index.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/build/app-build.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/build/app-start.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/build/build-and-playwright.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/build/index.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/build/playwright-install.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/build/static-checks.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/db/apply-seeds.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/db/collect-schema-stats.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/db/index.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/db/pgtap-install.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/db/production-preview.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/db/pull-production.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/db/reset.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/db/schema-stats.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/db/setup-roles.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/db/sync-schema.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/finalize/github.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/finalize/index.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/finalize/summary.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/index.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/setup/index.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/setup/local.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/setup/pr-common.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/setup/pr-local.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/test/capabilities.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/test/index.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/test/run-layers.d.ts.map +0 -1
- package/dist/commands/ci/machine/commands/ci-local.d.ts.map +0 -1
- package/dist/commands/ci/machine/commands/ci-pr.d.ts.map +0 -1
- package/dist/commands/ci/machine/commands/index.d.ts.map +0 -1
- package/dist/commands/ci/machine/commands/machine-runner.d.ts.map +0 -1
- package/dist/commands/ci/machine/commands/runtime-env.d.ts.map +0 -1
- package/dist/commands/ci/machine/contract.d.ts.map +0 -1
- package/dist/commands/ci/machine/formatters/github-comment-types.d.ts.map +0 -1
- package/dist/commands/ci/machine/formatters/github-comment.d.ts.map +0 -1
- package/dist/commands/ci/machine/formatters/index.d.ts.map +0 -1
- package/dist/commands/ci/machine/formatters/sections/final-comment.d.ts.map +0 -1
- package/dist/commands/ci/machine/formatters/sections/format-helpers.d.ts.map +0 -1
- package/dist/commands/ci/machine/formatters/sections/index.d.ts.map +0 -1
- package/dist/commands/ci/machine/formatters/sections/progress-comment.d.ts.map +0 -1
- package/dist/commands/ci/machine/formatters/sections/schema-matrix.d.ts.map +0 -1
- package/dist/commands/ci/machine/formatters/summary.d.ts.map +0 -1
- package/dist/commands/ci/machine/guards.d.ts.map +0 -1
- package/dist/commands/ci/machine/helpers.d.ts.map +0 -1
- package/dist/commands/ci/machine/index.d.ts.map +0 -1
- package/dist/commands/ci/machine/machine.d.ts.map +0 -1
- package/dist/commands/ci/machine/types.d.ts.map +0 -1
- package/dist/commands/ci/utils/ai-report.d.ts.map +0 -1
- package/dist/commands/ci/utils/app-process.d.ts.map +0 -1
- package/dist/commands/ci/utils/app-runtime.d.ts.map +0 -1
- package/dist/commands/ci/utils/ci-config.d.ts.map +0 -1
- package/dist/commands/ci/utils/ci-env-schema.d.ts.map +0 -1
- package/dist/commands/ci/utils/ci-logging.d.ts.map +0 -1
- package/dist/commands/ci/utils/ci-summary.d.ts.map +0 -1
- package/dist/commands/ci/utils/config-readers.d.ts.map +0 -1
- package/dist/commands/ci/utils/db-url-utils.d.ts.map +0 -1
- package/dist/commands/ci/utils/e2e-auth-setup.d.ts.map +0 -1
- package/dist/commands/ci/utils/env-security.d.ts.map +0 -1
- package/dist/commands/ci/utils/execa-helpers.d.ts.map +0 -1
- package/dist/commands/ci/utils/exit-code-computation.d.ts.map +0 -1
- package/dist/commands/ci/utils/github-api.d.ts.map +0 -1
- package/dist/commands/ci/utils/github.d.ts.map +0 -1
- package/dist/commands/ci/utils/index.d.ts.map +0 -1
- package/dist/commands/ci/utils/pgtap-installer.d.ts.map +0 -1
- package/dist/commands/ci/utils/rls-verification.d.ts.map +0 -1
- package/dist/commands/ci/utils/schema-operations.d.ts.map +0 -1
- package/dist/commands/ci/utils/seed-operations.d.ts.map +0 -1
- package/dist/commands/ci/utils/test-parallel.d.ts.map +0 -1
- package/dist/commands/ci/utils/timestamp-invariants.d.ts.map +0 -1
- package/dist/commands/ci/utils/workflow-idempotency.d.ts.map +0 -1
- package/dist/commands/db/apply/actors.d.ts.map +0 -1
- package/dist/commands/db/apply/contract.d.ts.map +0 -1
- package/dist/commands/db/apply/helpers/advisory-lock.d.ts.map +0 -1
- package/dist/commands/db/apply/helpers/data-compatibility-checker.d.ts.map +0 -1
- package/dist/commands/db/apply/helpers/index.d.ts.map +0 -1
- package/dist/commands/db/apply/helpers/partition-acl-cleaner.d.ts.map +0 -1
- package/dist/commands/db/apply/helpers/partition-prefilter.d.ts.map +0 -1
- package/dist/commands/db/apply/helpers/partition-validator.d.ts.map +0 -1
- package/dist/commands/db/apply/helpers/pg-schema-diff-helpers.d.ts.map +0 -1
- package/dist/commands/db/apply/helpers/plan-validator.d.ts.map +0 -1
- package/dist/commands/db/apply/helpers/retry-logic.d.ts.map +0 -1
- package/dist/commands/db/apply/helpers/shadow-db-manager.d.ts.map +0 -1
- package/dist/commands/db/apply/index.d.ts.map +0 -1
- package/dist/commands/db/apply/machine.d.ts.map +0 -1
- package/dist/commands/db/commands/db-apply.d.ts.map +0 -1
- package/dist/commands/db/commands/db-audit.d.ts.map +0 -1
- package/dist/commands/db/commands/db-backup.d.ts.map +0 -1
- package/dist/commands/db/commands/db-cleanup.d.ts.map +0 -1
- package/dist/commands/db/commands/db-derive-role-passwords.d.ts.map +0 -1
- package/dist/commands/db/commands/db-derive-urls.d.ts.map +0 -1
- package/dist/commands/db/commands/db-diagram.d.ts.map +0 -1
- package/dist/commands/db/commands/db-drizzle.d.ts.map +0 -1
- package/dist/commands/db/commands/db-extension.d.ts.map +0 -1
- package/dist/commands/db/commands/db-generate-password.d.ts.map +0 -1
- package/dist/commands/db/commands/db-lifecycle.d.ts.map +0 -1
- package/dist/commands/db/commands/db-rollback.d.ts.map +0 -1
- package/dist/commands/db/commands/db-schema.d.ts.map +0 -1
- package/dist/commands/db/commands/db-seed-metadata.d.ts.map +0 -1
- package/dist/commands/db/commands/db-seed-verify.d.ts.map +0 -1
- package/dist/commands/db/commands/db-seed.d.ts.map +0 -1
- package/dist/commands/db/commands/db-snapshot.d.ts.map +0 -1
- package/dist/commands/db/commands/db-stack.d.ts.map +0 -1
- package/dist/commands/db/commands/db-stats.d.ts.map +0 -1
- package/dist/commands/db/commands/db-sync.d.ts.map +0 -1
- package/dist/commands/db/commands/db-test.d.ts.map +0 -1
- package/dist/commands/db/constants.d.ts.map +0 -1
- package/dist/commands/db/extension-registry.d.ts.map +0 -1
- package/dist/commands/db/index.d.ts.map +0 -1
- package/dist/commands/db/preflight/actors.d.ts.map +0 -1
- package/dist/commands/db/preflight/contract.d.ts.map +0 -1
- package/dist/commands/db/preflight/index.d.ts.map +0 -1
- package/dist/commands/db/sync/actors.d.ts.map +0 -1
- package/dist/commands/db/sync/contract.d.ts.map +0 -1
- package/dist/commands/db/sync/index.d.ts.map +0 -1
- package/dist/commands/db/sync/machine.d.ts.map +0 -1
- package/dist/commands/db/types.d.ts.map +0 -1
- package/dist/commands/db/utils/db-target.d.ts.map +0 -1
- package/dist/commands/db/utils/db-url-builder.d.ts.map +0 -1
- package/dist/commands/db/utils/error-handlers.d.ts.map +0 -1
- package/dist/commands/db/utils/import-impact-analyzer.d.ts.map +0 -1
- package/dist/commands/db/utils/preflight-check.d.ts.map +0 -1
- package/dist/commands/db/utils/psql.d.ts.map +0 -1
- package/dist/commands/db/utils/schema-detector.d.ts.map +0 -1
- package/dist/commands/db/utils/schema-sync.d.ts.map +0 -1
- package/dist/commands/db/utils/script-runner.d.ts.map +0 -1
- package/dist/commands/db/utils/seed-manager.d.ts.map +0 -1
- package/dist/commands/db/utils/semantic-mapper.d.ts.map +0 -1
- package/dist/commands/db/utils/sql-table-extractor.d.ts.map +0 -1
- package/dist/commands/db/utils/stack-detector.d.ts.map +0 -1
- package/dist/commands/db/utils/table-registry.d.ts.map +0 -1
- package/dist/commands/db/utils/table-source-classifier.d.ts.map +0 -1
- package/dist/commands/dev/actors/index.d.ts.map +0 -1
- package/dist/commands/dev/commands/dev.d.ts.map +0 -1
- package/dist/commands/dev/contract.d.ts.map +0 -1
- package/dist/commands/dev/guards.d.ts.map +0 -1
- package/dist/commands/dev/helpers/stale-process-detector.d.ts.map +0 -1
- package/dist/commands/dev/machine.d.ts.map +0 -1
- package/dist/commands/dev/types.d.ts.map +0 -1
- package/dist/commands/env/commands/env-check.d.ts.map +0 -1
- package/dist/commands/env/commands/env-encrypt.d.ts.map +0 -1
- package/dist/commands/env/commands/env-pull.d.ts.map +0 -1
- package/dist/commands/env/commands/env-setup.d.ts.map +0 -1
- package/dist/commands/env/commands/env-sync.d.ts.map +0 -1
- package/dist/commands/env/commands/setup/action.d.ts.map +0 -1
- package/dist/commands/env/commands/setup/auth.d.ts.map +0 -1
- package/dist/commands/env/commands/setup/file-export.d.ts.map +0 -1
- package/dist/commands/env/commands/setup/github-api.d.ts.map +0 -1
- package/dist/commands/env/commands/setup/helpers.d.ts.map +0 -1
- package/dist/commands/env/commands/setup/index.d.ts.map +0 -1
- package/dist/commands/env/commands/setup/parsers.d.ts.map +0 -1
- package/dist/commands/env/commands/setup/prompts.d.ts.map +0 -1
- package/dist/commands/env/commands/setup/supabase-api.d.ts.map +0 -1
- package/dist/commands/env/commands/setup/types.d.ts.map +0 -1
- package/dist/commands/env/commands/setup/vercel-api.d.ts.map +0 -1
- package/dist/commands/env/constants/local-supabase.d.ts.map +0 -1
- package/dist/commands/env/index.d.ts.map +0 -1
- package/dist/commands/hotfix/actors.d.ts.map +0 -1
- package/dist/commands/hotfix/commands/hotfix-complete.d.ts.map +0 -1
- package/dist/commands/hotfix/commands/hotfix-create.d.ts.map +0 -1
- package/dist/commands/hotfix/commands/hotfix-deploy.d.ts.map +0 -1
- package/dist/commands/hotfix/commands/hotfix-status.d.ts.map +0 -1
- package/dist/commands/hotfix/contract.d.ts.map +0 -1
- package/dist/commands/hotfix/index.d.ts.map +0 -1
- package/dist/commands/hotfix/machine.d.ts.map +0 -1
- package/dist/commands/hotfix/metadata.d.ts.map +0 -1
- package/dist/commands/hotfix/utils/hotfix-machine-helper.d.ts.map +0 -1
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/inject-test-attrs/action.d.ts.map +0 -1
- package/dist/commands/inject-test-attrs/commands/inject-test-attrs.d.ts.map +0 -1
- package/dist/commands/inject-test-attrs/contract.d.ts.map +0 -1
- package/dist/commands/inject-test-attrs/detection-diagnostics.d.ts.map +0 -1
- package/dist/commands/inject-test-attrs/formatter.d.ts.map +0 -1
- package/dist/commands/inject-test-attrs/index.d.ts.map +0 -1
- package/dist/commands/inject-test-attrs/manifest-generator.d.ts.map +0 -1
- package/dist/commands/inject-test-attrs/processor-utils.d.ts.map +0 -1
- package/dist/commands/inject-test-attrs/processor.d.ts.map +0 -1
- package/dist/commands/inject-test-attrs/types.d.ts.map +0 -1
- package/dist/commands/link.d.ts.map +0 -1
- package/dist/commands/manifest/index.d.ts.map +0 -1
- package/dist/commands/prepare/commands/prepare.d.ts.map +0 -1
- package/dist/commands/prepare/index.d.ts.map +0 -1
- package/dist/commands/sdk/commands/publish.d.ts.map +0 -1
- package/dist/commands/sdk/index.d.ts.map +0 -1
- package/dist/commands/services/index.d.ts.map +0 -1
- package/dist/commands/session/index.d.ts.map +0 -1
- package/dist/commands/status.d.ts.map +0 -1
- package/dist/commands/telemetry.d.ts.map +0 -1
- package/dist/commands/template-check/actors/compare.d.ts.map +0 -1
- package/dist/commands/template-check/actors/discover.d.ts.map +0 -1
- package/dist/commands/template-check/actors/index.d.ts.map +0 -1
- package/dist/commands/template-check/actors/report.d.ts.map +0 -1
- package/dist/commands/template-check/commands/template-check.d.ts.map +0 -1
- package/dist/commands/template-check/config.d.ts.map +0 -1
- package/dist/commands/template-check/contract.d.ts.map +0 -1
- package/dist/commands/template-check/index.d.ts.map +0 -1
- package/dist/commands/template-check/machine.d.ts.map +0 -1
- package/dist/commands/template-check/types.d.ts.map +0 -1
- package/dist/commands/template-check/utils/diff-analyzer.d.ts.map +0 -1
- package/dist/commands/template-check/utils/normalizer.d.ts.map +0 -1
- package/dist/commands/template-check/utils/path-mapping.d.ts.map +0 -1
- package/dist/commands/test/commands/test-db.d.ts.map +0 -1
- package/dist/commands/test/commands/test-e2e.d.ts.map +0 -1
- package/dist/commands/test/commands/test-fast.d.ts.map +0 -1
- package/dist/commands/test/commands/test-integration.d.ts.map +0 -1
- package/dist/commands/test/commands/test-layer.d.ts.map +0 -1
- package/dist/commands/test/commands/test-owasp-generate.d.ts.map +0 -1
- package/dist/commands/test/commands/test-service.d.ts.map +0 -1
- package/dist/commands/test/commands/test-static.d.ts.map +0 -1
- package/dist/commands/test/commands/test.d.ts.map +0 -1
- package/dist/commands/test/index.d.ts.map +0 -1
- package/dist/commands/test-gen.d.ts.map +0 -1
- package/dist/commands/ui.d.ts.map +0 -1
- package/dist/commands/upgrade.d.ts.map +0 -1
- package/dist/commands/validate.d.ts.map +0 -1
- package/dist/commands/vuln-check.d.ts.map +0 -1
- package/dist/commands/watch.d.ts.map +0 -1
- package/dist/commands/workflow/commands/deploy-production.d.ts.map +0 -1
- package/dist/commands/workflow/commands/final-status.d.ts.map +0 -1
- package/dist/commands/workflow/commands/log.d.ts.map +0 -1
- package/dist/commands/workflow/commands/notify.d.ts.map +0 -1
- package/dist/commands/workflow/commands/paths.d.ts.map +0 -1
- package/dist/commands/workflow/commands/sync.d.ts.map +0 -1
- package/dist/commands/workflow/commands/validate.d.ts.map +0 -1
- package/dist/commands/workflow/commands/verify-credentials.d.ts.map +0 -1
- package/dist/commands/workflow/index.d.ts.map +0 -1
- package/dist/commands/workflow/types.d.ts.map +0 -1
- package/dist/config/env-files.d.ts.map +0 -1
- package/dist/config/env.d.ts.map +0 -1
- package/dist/constants/versions.d.ts.map +0 -1
- package/dist/contracts/envelope.d.ts.map +0 -1
- package/dist/errors/catalog.d.ts.map +0 -1
- package/dist/errors/exit-codes.d.ts.map +0 -1
- package/dist/errors/index.d.ts.map +0 -1
- package/dist/incremental/affected-tests.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/internal/machines/index.d.ts.map +0 -1
- package/dist/internal/machines/machine-runner.d.ts.map +0 -1
- package/dist/internal/machines/snapshot-helpers.d.ts.map +0 -1
- package/dist/internal/machines/types.d.ts.map +0 -1
- package/dist/internal/vuln-checker/analyzers/dependency-analyzer.d.ts.map +0 -1
- package/dist/internal/vuln-checker/analyzers/rls-analyzer.d.ts.map +0 -1
- package/dist/internal/vuln-checker/analyzers/secret-analyzer.d.ts.map +0 -1
- package/dist/internal/vuln-checker/analyzers/typescript-analyzer.d.ts.map +0 -1
- package/dist/internal/vuln-checker/config/loader.d.ts.map +0 -1
- package/dist/internal/vuln-checker/constants.d.ts.map +0 -1
- package/dist/internal/vuln-checker/ignore/matcher.d.ts.map +0 -1
- package/dist/internal/vuln-checker/index.d.ts.map +0 -1
- package/dist/internal/vuln-checker/reporters/console-reporter.d.ts.map +0 -1
- package/dist/internal/vuln-checker/reporters/json-reporter.d.ts.map +0 -1
- package/dist/internal/vuln-checker/reporters/markdown-reporter.d.ts.map +0 -1
- package/dist/internal/vuln-checker/reporters/sarif-reporter.d.ts.map +0 -1
- package/dist/internal/vuln-checker/security/path-validation.d.ts.map +0 -1
- package/dist/internal/vuln-checker/types.d.ts.map +0 -1
- package/dist/notifiers/desktop-notifier.d.ts.map +0 -1
- package/dist/ui/components/db-panel.d.ts.map +0 -1
- package/dist/ui/components/status-bar.d.ts.map +0 -1
- package/dist/ui/components/test-panel.d.ts.map +0 -1
- package/dist/ui/dashboard.d.ts.map +0 -1
- package/dist/ui/index.d.ts.map +0 -1
- package/dist/utils/config-loader.d.ts.map +0 -1
- package/dist/utils/config-updater.d.ts.map +0 -1
- package/dist/utils/diagnostics.d.ts.map +0 -1
- package/dist/utils/dotenvx.d.ts.map +0 -1
- package/dist/utils/env-local-bridge.d.ts.map +0 -1
- package/dist/utils/execution-plan.d.ts.map +0 -1
- package/dist/utils/github-output-security.d.ts.map +0 -1
- package/dist/utils/help-system.d.ts.map +0 -1
- package/dist/utils/license/admin-auth.d.ts.map +0 -1
- package/dist/utils/license/allowlist-checker.d.ts.map +0 -1
- package/dist/utils/license/ci-detector.d.ts.map +0 -1
- package/dist/utils/license/index.d.ts.map +0 -1
- package/dist/utils/license/owner-resolver.d.ts.map +0 -1
- package/dist/utils/license/types.d.ts.map +0 -1
- package/dist/utils/license/validate-owner.d.ts.map +0 -1
- package/dist/utils/path-security.d.ts.map +0 -1
- package/dist/utils/port-allocator.d.ts.map +0 -1
- package/dist/utils/secure-exec.d.ts.map +0 -1
- package/dist/utils/template-fetcher.d.ts.map +0 -1
- package/dist/utils/type-guards.d.ts.map +0 -1
- package/dist/utils/vercel-project.d.ts.map +0 -1
- package/dist/utils/workspace-detector.d.ts.map +0 -1
- package/dist/validators/risk-detector.d.ts.map +0 -1
- package/dist/validators/schema-validator.d.ts.map +0 -1
- package/dist/version.d.ts.map +0 -1
- package/dist/watchers/schema-watcher.d.ts.map +0 -1
- package/dist/watchers/test-watcher.d.ts.map +0 -1
|
@@ -0,0 +1,898 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'module';
|
|
3
|
+
import { detectDatabaseStack, getStackPaths } from './chunk-CCKG5R4Y.js';
|
|
4
|
+
import { loadRunaConfig, getAppConfig } from './chunk-5NKWR4FF.js';
|
|
5
|
+
import { detectEnvironment } from './chunk-JMJP4A47.js';
|
|
6
|
+
import { emitJsonSuccess } from './chunk-UU55OH7P.js';
|
|
7
|
+
import './chunk-RRGQCUKT.js';
|
|
8
|
+
import './chunk-JT5SUTWE.js';
|
|
9
|
+
import { getOutputFormatFromEnv } from './chunk-HKUWEGUX.js';
|
|
10
|
+
import { init_esm_shims } from './chunk-VRXHCR5K.js';
|
|
11
|
+
import { Command } from 'commander';
|
|
12
|
+
import { CLIError, deploySchemaToProduction, createCLILogger, WorkflowNotifyOutputSchema, devopsSync, DevOpsSyncOutputSchema, workflowSync, WorkflowSyncOutputSchema, validateInfrastructure, emitWorkflowValidateFailureCapsule, emitWorkflowAnnotations, writeWorkflowValidateStepSummary, exportWorkflowReportJson, WorkflowValidateInfrastructureOutputSchema, workflowNotify } from '@runa-ai/runa';
|
|
13
|
+
import { z } from 'zod';
|
|
14
|
+
import { appendFile } from 'fs/promises';
|
|
15
|
+
|
|
16
|
+
createRequire(import.meta.url);
|
|
17
|
+
|
|
18
|
+
// src/commands/workflow/index.ts
|
|
19
|
+
init_esm_shims();
|
|
20
|
+
|
|
21
|
+
// src/commands/workflow/commands/deploy-production.ts
|
|
22
|
+
init_esm_shims();
|
|
23
|
+
var DeployProductionOutputSchema = z.object({
|
|
24
|
+
stepsCompleted: z.array(z.string()).min(1)
|
|
25
|
+
});
|
|
26
|
+
var deployProductionCommand = new Command("deploy-production").description("Deploy schema to production database (unified command)").requiredOption(
|
|
27
|
+
"--db-url <url>",
|
|
28
|
+
"Production database URL (admin/DDL)",
|
|
29
|
+
process.env.GH_DATABASE_URL_ADMIN || process.env.GH_DATABASE_URL
|
|
30
|
+
).option("--skip-validation", "Skip schema validation (not recommended)", false).option("--skip-risk-detection", "Skip risk detection (not recommended)", false).option("--max-retries <number>", "Maximum retry attempts for schema application", "3").action(
|
|
31
|
+
async (options) => {
|
|
32
|
+
try {
|
|
33
|
+
if (!options.dbUrl) {
|
|
34
|
+
throw new CLIError("Production database URL not provided", "PRODUCTION_DB_URL_MISSING", [
|
|
35
|
+
"Set GH_DATABASE_URL_ADMIN environment variable (recommended for DDL)",
|
|
36
|
+
"Or set GH_DATABASE_URL environment variable",
|
|
37
|
+
"Or use --db-url <url>"
|
|
38
|
+
]);
|
|
39
|
+
}
|
|
40
|
+
const config = {
|
|
41
|
+
productionDatabaseUrl: options.dbUrl,
|
|
42
|
+
skipValidation: options.skipValidation,
|
|
43
|
+
skipRiskDetection: options.skipRiskDetection,
|
|
44
|
+
maxRetries: options.maxRetries ? Number.parseInt(options.maxRetries, 10) : 3
|
|
45
|
+
};
|
|
46
|
+
const result = await deploySchemaToProduction(config);
|
|
47
|
+
emitJsonSuccess(deployProductionCommand, DeployProductionOutputSchema, result);
|
|
48
|
+
} catch (error) {
|
|
49
|
+
if (error instanceof CLIError) {
|
|
50
|
+
throw error;
|
|
51
|
+
}
|
|
52
|
+
throw new CLIError(
|
|
53
|
+
"Production deployment error",
|
|
54
|
+
"PRODUCTION_DEPLOY_ERROR",
|
|
55
|
+
["Check error details above", "Review deployment logs"],
|
|
56
|
+
error instanceof Error ? error : void 0
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
// src/commands/workflow/commands/final-status.ts
|
|
63
|
+
init_esm_shims();
|
|
64
|
+
var JobResultSchema = z.enum(["success", "failure", "cancelled", "skipped"]);
|
|
65
|
+
var FinalStatusSchema = z.enum(["success", "failure", "cancelled"]);
|
|
66
|
+
var WorkflowFinalStatusOutputSchema = z.object({
|
|
67
|
+
status: FinalStatusSchema,
|
|
68
|
+
errorMessage: z.string(),
|
|
69
|
+
cleanupResult: JobResultSchema.optional()
|
|
70
|
+
}).strict();
|
|
71
|
+
async function writeGitHubOutput(values) {
|
|
72
|
+
const outFile = process.env.GITHUB_OUTPUT;
|
|
73
|
+
if (!outFile) {
|
|
74
|
+
throw new CLIError(
|
|
75
|
+
"GITHUB_OUTPUT is not set",
|
|
76
|
+
"GITHUB_OUTPUT_MISSING",
|
|
77
|
+
["Run in GitHub Actions or set GITHUB_OUTPUT to a file path"],
|
|
78
|
+
void 0,
|
|
79
|
+
2
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
const lines = Object.entries(values).map(([k, v]) => `${k}=${v}`).join("\n");
|
|
83
|
+
await appendFile(outFile, `${lines}
|
|
84
|
+
`, "utf-8");
|
|
85
|
+
}
|
|
86
|
+
function parseJobResult(name, raw) {
|
|
87
|
+
const value = (raw || "").trim();
|
|
88
|
+
const parsed = JobResultSchema.safeParse(value);
|
|
89
|
+
if (parsed.success) return parsed.data;
|
|
90
|
+
throw new CLIError(
|
|
91
|
+
`${name} is required and must be one of: success, failure, cancelled, skipped`,
|
|
92
|
+
"WORKFLOW_FINAL_STATUS_INVALID_INPUT",
|
|
93
|
+
[`Set ${name} env var from needs.<job>.result`],
|
|
94
|
+
void 0,
|
|
95
|
+
2
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
function computeFinalStatus(params) {
|
|
99
|
+
if (params.deployPreview === "failure" || params.integrationTests === "failure") {
|
|
100
|
+
return {
|
|
101
|
+
status: "failure",
|
|
102
|
+
errorMessage: `One or more jobs failed. View logs: ${params.serverUrl}/${params.repo}/actions/runs/${params.runId}`,
|
|
103
|
+
cleanupResult: params.cleanup
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
if (params.deployPreview === "cancelled" || params.integrationTests === "cancelled") {
|
|
107
|
+
return {
|
|
108
|
+
status: "cancelled",
|
|
109
|
+
errorMessage: "Workflow was cancelled",
|
|
110
|
+
cleanupResult: params.cleanup
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
return {
|
|
114
|
+
status: "success",
|
|
115
|
+
errorMessage: "",
|
|
116
|
+
cleanupResult: params.cleanup
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
var workflowFinalStatusCommand = new Command("final-status").description("Aggregate job results into a final workflow status (GitHub Actions helper)").option("--github-output", "Write outputs to $GITHUB_OUTPUT (GitHub Actions)", false).action(async (options) => {
|
|
120
|
+
const deployPreview = parseJobResult(
|
|
121
|
+
"DEPLOY_PREVIEW_RESULT",
|
|
122
|
+
process.env.DEPLOY_PREVIEW_RESULT
|
|
123
|
+
);
|
|
124
|
+
const integrationTests = parseJobResult(
|
|
125
|
+
"INTEGRATION_TESTS_RESULT",
|
|
126
|
+
process.env.INTEGRATION_TESTS_RESULT
|
|
127
|
+
);
|
|
128
|
+
const cleanupRaw = (process.env.CLEANUP_RESULT || "").trim();
|
|
129
|
+
const cleanup = cleanupRaw.length > 0 ? parseJobResult("CLEANUP_RESULT", cleanupRaw) : void 0;
|
|
130
|
+
const repo = (process.env.GITHUB_REPOSITORY || "").trim();
|
|
131
|
+
const runId = (process.env.GITHUB_RUN_ID || "").trim();
|
|
132
|
+
const serverUrl = (process.env.GITHUB_SERVER_URL || "").trim();
|
|
133
|
+
if (!repo || !runId || !serverUrl) {
|
|
134
|
+
throw new CLIError(
|
|
135
|
+
"GITHUB_REPOSITORY, GITHUB_RUN_ID, and GITHUB_SERVER_URL are required",
|
|
136
|
+
"WORKFLOW_FINAL_STATUS_MISSING_GITHUB_ENV",
|
|
137
|
+
["Run in GitHub Actions context"],
|
|
138
|
+
void 0,
|
|
139
|
+
2
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
const out = computeFinalStatus({
|
|
143
|
+
deployPreview,
|
|
144
|
+
integrationTests,
|
|
145
|
+
cleanup,
|
|
146
|
+
repo,
|
|
147
|
+
runId,
|
|
148
|
+
serverUrl
|
|
149
|
+
});
|
|
150
|
+
if (options.githubOutput === true) {
|
|
151
|
+
await writeGitHubOutput({ status: out.status, error_message: out.errorMessage });
|
|
152
|
+
}
|
|
153
|
+
if (getOutputFormatFromEnv() === "json") {
|
|
154
|
+
emitJsonSuccess(workflowFinalStatusCommand, WorkflowFinalStatusOutputSchema, out);
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
// src/commands/workflow/commands/log.ts
|
|
159
|
+
init_esm_shims();
|
|
160
|
+
var LOG_EVENTS = [
|
|
161
|
+
"schema-consistency:start",
|
|
162
|
+
"schema-management:start",
|
|
163
|
+
"db-roles:start",
|
|
164
|
+
"seed-apply:start",
|
|
165
|
+
"seed-verify:start",
|
|
166
|
+
"infra-complete:start"
|
|
167
|
+
];
|
|
168
|
+
function parseLogEvent(value) {
|
|
169
|
+
const trimmed = value.trim();
|
|
170
|
+
const found = LOG_EVENTS.find((e) => e === trimmed);
|
|
171
|
+
if (found) return found;
|
|
172
|
+
throw new CLIError(
|
|
173
|
+
`Unknown workflow log event: ${trimmed}`,
|
|
174
|
+
"WORKFLOW_LOG_UNKNOWN_EVENT",
|
|
175
|
+
[
|
|
176
|
+
`Allowed events: ${LOG_EVENTS.join(", ")}`,
|
|
177
|
+
"Use `runa workflow log <event>` with one of the supported values"
|
|
178
|
+
],
|
|
179
|
+
void 0,
|
|
180
|
+
2
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
function printSection(title) {
|
|
184
|
+
process.stdout.write("\n");
|
|
185
|
+
process.stdout.write("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\n");
|
|
186
|
+
process.stdout.write(`${title}
|
|
187
|
+
`);
|
|
188
|
+
process.stdout.write("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\n");
|
|
189
|
+
process.stdout.write("\n");
|
|
190
|
+
}
|
|
191
|
+
function printLines(lines) {
|
|
192
|
+
for (const line of lines) {
|
|
193
|
+
process.stdout.write(`${line}
|
|
194
|
+
`);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
function handleLogEvent(event) {
|
|
198
|
+
switch (event) {
|
|
199
|
+
case "schema-consistency:start": {
|
|
200
|
+
printSection("\u{1F50D} Schema Consistency Validation");
|
|
201
|
+
printLines([
|
|
202
|
+
" Validating Drizzle schema files...",
|
|
203
|
+
" Checks:",
|
|
204
|
+
" 1. pgEnum usage requires pgEnum import",
|
|
205
|
+
" 2. No schema.enum() pattern (incompatible with drizzle-kit)",
|
|
206
|
+
" 3. biome-ignore comments present",
|
|
207
|
+
" 4. Naming conventions (snake_case)",
|
|
208
|
+
""
|
|
209
|
+
]);
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
case "schema-management:start": {
|
|
213
|
+
printSection("\u{1F535} Schema Management");
|
|
214
|
+
printLines([
|
|
215
|
+
" Stack: SQL-First Architecture (pg-schema-diff)",
|
|
216
|
+
" Operation: SQL Schema Sync",
|
|
217
|
+
" Method: SQL schema \u2192 pg-schema-diff \u2192 Apply \u2192 TypeScript gen",
|
|
218
|
+
" Process:",
|
|
219
|
+
" 1. Read SQL schemas (supabase/schemas/declarative/*.sql)",
|
|
220
|
+
" 2. Compare with current DB state via pg-schema-diff",
|
|
221
|
+
" 3. Apply incremental changes",
|
|
222
|
+
" 4. Generate TypeScript via drizzle-kit introspect",
|
|
223
|
+
"",
|
|
224
|
+
"\u{1F527} Applying schema changes (via runa CLI)...",
|
|
225
|
+
""
|
|
226
|
+
]);
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
case "db-roles:start": {
|
|
230
|
+
printSection("\u{1F510} Setting up DB roles (drizzle_app)");
|
|
231
|
+
printLines([
|
|
232
|
+
" - Creates drizzle_app (DML-only) + grants privileges",
|
|
233
|
+
" - Ensures app DATABASE_URL can safely use restricted role",
|
|
234
|
+
""
|
|
235
|
+
]);
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
case "seed-apply:start": {
|
|
239
|
+
printSection("\u{1F331} Auto-Generated Seed Application");
|
|
240
|
+
printLines([
|
|
241
|
+
" Environment: preview (minimal CI test data)",
|
|
242
|
+
" Method: TypeScript \u2192 SQL (auto-generated)",
|
|
243
|
+
" Purpose: Provide test data for E2E tests",
|
|
244
|
+
"",
|
|
245
|
+
" \u{1F4DD} Seed was auto-generated by db:sync",
|
|
246
|
+
" Location: supabase/seeds/preview.sql",
|
|
247
|
+
" Generator: packages/database/scripts/generate-seeds.ts",
|
|
248
|
+
"",
|
|
249
|
+
"\u{1F527} Applying preview seed data...",
|
|
250
|
+
""
|
|
251
|
+
]);
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
case "seed-verify:start": {
|
|
255
|
+
process.stdout.write("\u{1F527} Running seed verification (via runa CLI)...\n");
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
case "infra-complete:start": {
|
|
259
|
+
printSection("\u2705 Infrastructure Setup Complete");
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
var workflowLogCommand = new Command("log").description("Print standardized workflow log messages (no side effects)").argument("<event>", "Event name (e.g., schema-management:start)").action((eventRaw) => {
|
|
265
|
+
const event = parseLogEvent(eventRaw);
|
|
266
|
+
handleLogEvent(event);
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
// src/commands/workflow/commands/notify.ts
|
|
270
|
+
init_esm_shims();
|
|
271
|
+
async function sendNotification(config, logger) {
|
|
272
|
+
logger.debug(`Sending notification to ${config.runaAppUrl}`);
|
|
273
|
+
logger.debug(`Event type: ${config.eventType ?? "runa-workflow-update"}`);
|
|
274
|
+
logger.debug(`Status: ${config.status}`);
|
|
275
|
+
const result = await workflowNotify({
|
|
276
|
+
runaAppUrl: config.runaAppUrl,
|
|
277
|
+
apiToken: config.apiToken,
|
|
278
|
+
repositoryFullName: config.repositoryFullName,
|
|
279
|
+
prNumber: config.prNumber,
|
|
280
|
+
commitSha: config.commitSha,
|
|
281
|
+
status: config.status,
|
|
282
|
+
errorMessage: config.errorMessage,
|
|
283
|
+
eventType: config.eventType
|
|
284
|
+
});
|
|
285
|
+
if (result.success) logger.success(`Notification sent successfully (HTTP ${result.httpCode})`);
|
|
286
|
+
else logger.error(`Notification failed (HTTP ${result.httpCode})`);
|
|
287
|
+
return result;
|
|
288
|
+
}
|
|
289
|
+
var startCommand = new Command("start").description("Notify runa-app of workflow start").requiredOption("--url <url>", "runa-app webhook URL", process.env.RUNA_APP_URL).requiredOption("--token <token>", "runa-app API token", process.env.RUNA_APP_API_TOKEN).requiredOption(
|
|
290
|
+
"--repo <name>",
|
|
291
|
+
"Repository full name (owner/repo)",
|
|
292
|
+
process.env.GITHUB_REPOSITORY
|
|
293
|
+
).requiredOption("--pr <number>", "Pull request number").requiredOption("--sha <sha>", "Commit SHA").action(
|
|
294
|
+
async (options) => {
|
|
295
|
+
const logger = createCLILogger("workflow:notify:start");
|
|
296
|
+
try {
|
|
297
|
+
if (!options.url) {
|
|
298
|
+
throw new CLIError("runa-app URL not provided", "RUNA_APP_URL_MISSING", [
|
|
299
|
+
"Set RUNA_APP_URL environment variable",
|
|
300
|
+
"Or use --url <url>"
|
|
301
|
+
]);
|
|
302
|
+
}
|
|
303
|
+
if (!options.token) {
|
|
304
|
+
throw new CLIError("runa-app API token not provided", "RUNA_APP_TOKEN_MISSING", [
|
|
305
|
+
"Set RUNA_APP_API_TOKEN environment variable",
|
|
306
|
+
"Or use --token <token>"
|
|
307
|
+
]);
|
|
308
|
+
}
|
|
309
|
+
if (!options.repo || !options.pr || !options.sha) {
|
|
310
|
+
throw new CLIError("Missing required parameters", "REQUIRED_PARAMS_MISSING", [
|
|
311
|
+
"Provide --repo <owner/repo>",
|
|
312
|
+
"Provide --pr <number>",
|
|
313
|
+
"Provide --sha <sha>"
|
|
314
|
+
]);
|
|
315
|
+
}
|
|
316
|
+
const config = {
|
|
317
|
+
runaAppUrl: options.url,
|
|
318
|
+
apiToken: options.token,
|
|
319
|
+
repositoryFullName: options.repo,
|
|
320
|
+
prNumber: Number.parseInt(options.pr, 10),
|
|
321
|
+
commitSha: options.sha,
|
|
322
|
+
status: "in_progress"
|
|
323
|
+
};
|
|
324
|
+
const result = await sendNotification(config, logger);
|
|
325
|
+
emitJsonSuccess(startCommand, WorkflowNotifyOutputSchema, result);
|
|
326
|
+
if (!result.success) {
|
|
327
|
+
throw new CLIError("Failed to send workflow start notification", "NOTIFICATION_FAILED", [
|
|
328
|
+
"Check runa-app URL is accessible",
|
|
329
|
+
"Verify API token is valid",
|
|
330
|
+
"Check network connectivity"
|
|
331
|
+
]);
|
|
332
|
+
}
|
|
333
|
+
} catch (error) {
|
|
334
|
+
if (error instanceof CLIError) {
|
|
335
|
+
throw error;
|
|
336
|
+
}
|
|
337
|
+
throw new CLIError(
|
|
338
|
+
"Workflow start notification error",
|
|
339
|
+
"NOTIFICATION_ERROR",
|
|
340
|
+
["Check error details above", "Verify all parameters are correct"],
|
|
341
|
+
error instanceof Error ? error : void 0
|
|
342
|
+
);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
);
|
|
346
|
+
var completeCommand = new Command("complete").description("Notify runa-app of workflow completion").requiredOption("--url <url>", "runa-app webhook URL", process.env.RUNA_APP_URL).requiredOption("--token <token>", "runa-app API token", process.env.RUNA_APP_API_TOKEN).requiredOption(
|
|
347
|
+
"--repo <name>",
|
|
348
|
+
"Repository full name (owner/repo)",
|
|
349
|
+
process.env.GITHUB_REPOSITORY
|
|
350
|
+
).requiredOption("--pr <number>", "Pull request number").requiredOption("--sha <sha>", "Commit SHA").requiredOption(
|
|
351
|
+
"--status <status>",
|
|
352
|
+
"Workflow status (success, failure, cancelled)",
|
|
353
|
+
process.env.WORKFLOW_STATUS
|
|
354
|
+
).option("--error <message>", "Error message (for failures)", process.env.ERROR_MESSAGE).action(
|
|
355
|
+
async (options) => {
|
|
356
|
+
const logger = createCLILogger("workflow:notify:complete");
|
|
357
|
+
try {
|
|
358
|
+
if (!options.url) {
|
|
359
|
+
throw new CLIError("runa-app URL not provided", "RUNA_APP_URL_MISSING", [
|
|
360
|
+
"Set RUNA_APP_URL environment variable",
|
|
361
|
+
"Or use --url <url>"
|
|
362
|
+
]);
|
|
363
|
+
}
|
|
364
|
+
if (!options.token) {
|
|
365
|
+
throw new CLIError("runa-app API token not provided", "RUNA_APP_TOKEN_MISSING", [
|
|
366
|
+
"Set RUNA_APP_API_TOKEN environment variable",
|
|
367
|
+
"Or use --token <token>"
|
|
368
|
+
]);
|
|
369
|
+
}
|
|
370
|
+
if (!options.repo || !options.pr || !options.sha || !options.status) {
|
|
371
|
+
throw new CLIError("Missing required parameters", "REQUIRED_PARAMS_MISSING", [
|
|
372
|
+
"Provide --repo <owner/repo>",
|
|
373
|
+
"Provide --pr <number>",
|
|
374
|
+
"Provide --sha <sha>",
|
|
375
|
+
"Provide --status <status>"
|
|
376
|
+
]);
|
|
377
|
+
}
|
|
378
|
+
const validStatuses = ["success", "failure", "cancelled"];
|
|
379
|
+
if (!validStatuses.includes(options.status)) {
|
|
380
|
+
throw new CLIError("Invalid workflow status", "INVALID_STATUS", [
|
|
381
|
+
"Status must be one of: success, failure, cancelled"
|
|
382
|
+
]);
|
|
383
|
+
}
|
|
384
|
+
const config = {
|
|
385
|
+
runaAppUrl: options.url,
|
|
386
|
+
apiToken: options.token,
|
|
387
|
+
repositoryFullName: options.repo,
|
|
388
|
+
prNumber: Number.parseInt(options.pr, 10),
|
|
389
|
+
commitSha: options.sha,
|
|
390
|
+
status: options.status,
|
|
391
|
+
errorMessage: options.error
|
|
392
|
+
};
|
|
393
|
+
const result = await sendNotification(config, logger);
|
|
394
|
+
emitJsonSuccess(completeCommand, WorkflowNotifyOutputSchema, result);
|
|
395
|
+
if (!result.success) {
|
|
396
|
+
throw new CLIError(
|
|
397
|
+
"Failed to send workflow completion notification",
|
|
398
|
+
"NOTIFICATION_FAILED",
|
|
399
|
+
[
|
|
400
|
+
"Check runa-app URL is accessible",
|
|
401
|
+
"Verify API token is valid",
|
|
402
|
+
"Check network connectivity"
|
|
403
|
+
]
|
|
404
|
+
);
|
|
405
|
+
}
|
|
406
|
+
} catch (error) {
|
|
407
|
+
if (error instanceof CLIError) {
|
|
408
|
+
throw error;
|
|
409
|
+
}
|
|
410
|
+
throw new CLIError(
|
|
411
|
+
"Workflow completion notification error",
|
|
412
|
+
"NOTIFICATION_ERROR",
|
|
413
|
+
["Check error details above", "Verify all parameters are correct"],
|
|
414
|
+
error instanceof Error ? error : void 0
|
|
415
|
+
);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
);
|
|
419
|
+
var deploymentCommand = new Command("deployment").description("Notify runa-app of deployment event (production schema, etc.)").requiredOption("--url <url>", "runa-app webhook URL", process.env.RUNA_APP_URL).requiredOption("--token <token>", "runa-app API token", process.env.RUNA_APP_API_TOKEN).requiredOption(
|
|
420
|
+
"--repo <name>",
|
|
421
|
+
"Repository full name (owner/repo)",
|
|
422
|
+
process.env.GITHUB_REPOSITORY
|
|
423
|
+
).requiredOption("--sha <sha>", "Commit SHA").requiredOption(
|
|
424
|
+
"--status <status>",
|
|
425
|
+
"Deployment status (success, failure, cancelled)",
|
|
426
|
+
process.env.JOB_STATUS
|
|
427
|
+
).option("--error <message>", "Error message (for failures)", process.env.ERROR_MESSAGE).option("--type <type>", "Deployment type (e.g., production-schema)", "production-schema").action(
|
|
428
|
+
async (options) => {
|
|
429
|
+
const logger = createCLILogger("workflow:notify:deployment");
|
|
430
|
+
try {
|
|
431
|
+
if (!options.url) {
|
|
432
|
+
throw new CLIError("runa-app URL not provided", "RUNA_APP_URL_MISSING", [
|
|
433
|
+
"Set RUNA_APP_URL environment variable",
|
|
434
|
+
"Or use --url <url>"
|
|
435
|
+
]);
|
|
436
|
+
}
|
|
437
|
+
if (!options.token) {
|
|
438
|
+
throw new CLIError("runa-app API token not provided", "RUNA_APP_TOKEN_MISSING", [
|
|
439
|
+
"Set RUNA_APP_API_TOKEN environment variable",
|
|
440
|
+
"Or use --token <token>"
|
|
441
|
+
]);
|
|
442
|
+
}
|
|
443
|
+
if (!options.repo || !options.sha || !options.status) {
|
|
444
|
+
throw new CLIError("Missing required parameters", "REQUIRED_PARAMS_MISSING", [
|
|
445
|
+
"Provide --repo <owner/repo>",
|
|
446
|
+
"Provide --sha <sha>",
|
|
447
|
+
"Provide --status <status>"
|
|
448
|
+
]);
|
|
449
|
+
}
|
|
450
|
+
const validStatuses = ["success", "failure", "cancelled"];
|
|
451
|
+
if (!validStatuses.includes(options.status)) {
|
|
452
|
+
throw new CLIError("Invalid deployment status", "INVALID_STATUS", [
|
|
453
|
+
"Status must be one of: success, failure, cancelled"
|
|
454
|
+
]);
|
|
455
|
+
}
|
|
456
|
+
const config = {
|
|
457
|
+
runaAppUrl: options.url,
|
|
458
|
+
apiToken: options.token,
|
|
459
|
+
repositoryFullName: options.repo,
|
|
460
|
+
commitSha: options.sha,
|
|
461
|
+
status: options.status,
|
|
462
|
+
errorMessage: options.error,
|
|
463
|
+
eventType: "runa-deployment"
|
|
464
|
+
};
|
|
465
|
+
const result = await sendNotification(config, logger);
|
|
466
|
+
emitJsonSuccess(deploymentCommand, WorkflowNotifyOutputSchema, result);
|
|
467
|
+
if (!result.success) {
|
|
468
|
+
throw new CLIError("Failed to send deployment notification", "NOTIFICATION_FAILED", [
|
|
469
|
+
"Check runa-app URL is accessible",
|
|
470
|
+
"Verify API token is valid",
|
|
471
|
+
"Check network connectivity"
|
|
472
|
+
]);
|
|
473
|
+
}
|
|
474
|
+
} catch (error) {
|
|
475
|
+
if (error instanceof CLIError) {
|
|
476
|
+
throw error;
|
|
477
|
+
}
|
|
478
|
+
throw new CLIError(
|
|
479
|
+
"Deployment notification error",
|
|
480
|
+
"NOTIFICATION_ERROR",
|
|
481
|
+
["Check error details above", "Verify all parameters are correct"],
|
|
482
|
+
error instanceof Error ? error : void 0
|
|
483
|
+
);
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
);
|
|
487
|
+
var notifyCommand = new Command("notify").description("Notify runa-app of workflow events").addCommand(startCommand).addCommand(completeCommand).addCommand(deploymentCommand);
|
|
488
|
+
|
|
489
|
+
// src/commands/workflow/commands/paths.ts
|
|
490
|
+
init_esm_shims();
|
|
491
|
+
var WorkflowPathsOutputSchema = z.object({
|
|
492
|
+
appDir: z.string().min(1),
|
|
493
|
+
dbStack: z.enum(["drizzle", "supabase"]),
|
|
494
|
+
dbRoot: z.string().min(1)
|
|
495
|
+
}).strict();
|
|
496
|
+
async function writeGitHubOutput2(values) {
|
|
497
|
+
const outFile = process.env.GITHUB_OUTPUT;
|
|
498
|
+
if (!outFile) {
|
|
499
|
+
throw new CLIError(
|
|
500
|
+
"GITHUB_OUTPUT is not set",
|
|
501
|
+
"GITHUB_OUTPUT_MISSING",
|
|
502
|
+
["Run in GitHub Actions or set GITHUB_OUTPUT to a file path"],
|
|
503
|
+
void 0,
|
|
504
|
+
2
|
|
505
|
+
);
|
|
506
|
+
}
|
|
507
|
+
const lines = Object.entries(values).map(([k, v]) => `${k}=${v}`).join("\n");
|
|
508
|
+
await appendFile(outFile, `${lines}
|
|
509
|
+
`, "utf-8");
|
|
510
|
+
}
|
|
511
|
+
var workflowPathsCommand = new Command("paths").description("Detect project paths for GitHub Actions (app dir / db stack / db root)").option("--github-output", "Write outputs to $GITHUB_OUTPUT (GitHub Actions)", false).action(async (options) => {
|
|
512
|
+
try {
|
|
513
|
+
const config = loadRunaConfig(process.cwd());
|
|
514
|
+
const app = getAppConfig(config);
|
|
515
|
+
const stackResult = await detectDatabaseStack();
|
|
516
|
+
const paths = await getStackPaths(stackResult.stack);
|
|
517
|
+
const out = {
|
|
518
|
+
appDir: app.directory || ".",
|
|
519
|
+
dbStack: stackResult.stack,
|
|
520
|
+
dbRoot: paths.rootDir
|
|
521
|
+
};
|
|
522
|
+
if (options.githubOutput === true) {
|
|
523
|
+
await writeGitHubOutput2({
|
|
524
|
+
app_dir: out.appDir,
|
|
525
|
+
db_stack: out.dbStack,
|
|
526
|
+
db_root: out.dbRoot
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
if (getOutputFormatFromEnv() === "json") {
|
|
530
|
+
emitJsonSuccess(workflowPathsCommand, WorkflowPathsOutputSchema, out);
|
|
531
|
+
return;
|
|
532
|
+
}
|
|
533
|
+
} catch (error) {
|
|
534
|
+
if (error instanceof CLIError) throw error;
|
|
535
|
+
throw new CLIError(
|
|
536
|
+
error instanceof Error ? error.message : "Failed to detect workflow paths",
|
|
537
|
+
"WORKFLOW_PATHS_FAILED",
|
|
538
|
+
[
|
|
539
|
+
"Ensure runa.config.ts exists",
|
|
540
|
+
"Run: runa init",
|
|
541
|
+
"Run: runa db detect-stack (to verify database structure)"
|
|
542
|
+
],
|
|
543
|
+
error instanceof Error ? error : void 0,
|
|
544
|
+
1
|
|
545
|
+
);
|
|
546
|
+
}
|
|
547
|
+
});
|
|
548
|
+
|
|
549
|
+
// src/commands/workflow/commands/sync.ts
|
|
550
|
+
init_esm_shims();
|
|
551
|
+
function isRunaRepo() {
|
|
552
|
+
const env = detectEnvironment();
|
|
553
|
+
return env === "runa-repo";
|
|
554
|
+
}
|
|
555
|
+
var checkCommand = new Command("check").description("Check if files match SDK templates (for pre-commit)").option("--strict", "Exit with error if out of sync (runa-repo)", false).option("--all", "Check all distributed files (workflows/actions/zap/seeds)", false).option("--seeds", "Check database seed infrastructure files", false).action(async (options) => {
|
|
556
|
+
const logger = createCLILogger("workflow:check");
|
|
557
|
+
try {
|
|
558
|
+
await handleWorkflowCheck({ options, logger });
|
|
559
|
+
} catch (error) {
|
|
560
|
+
if (error instanceof CLIError) {
|
|
561
|
+
throw error;
|
|
562
|
+
}
|
|
563
|
+
throw new CLIError(
|
|
564
|
+
"Workflow check failed",
|
|
565
|
+
"WORKFLOW_CHECK_FAILED",
|
|
566
|
+
["Check error details above", "Verify @runa-ai/runa is installed"],
|
|
567
|
+
error instanceof Error ? error : void 0
|
|
568
|
+
);
|
|
569
|
+
}
|
|
570
|
+
});
|
|
571
|
+
var syncCommand = new Command("sync").description("Sync SDK templates to project").option("--check", "Check sync status without modifying files", false).option("--all", "Sync all distributed files (workflows/actions/zap/seeds)", false).option("--seeds", "Sync database seed infrastructure files", false).action(async (options) => {
|
|
572
|
+
const logger = createCLILogger("workflow:sync");
|
|
573
|
+
try {
|
|
574
|
+
await handleWorkflowSync({ options, logger });
|
|
575
|
+
} catch (error) {
|
|
576
|
+
if (error instanceof CLIError) {
|
|
577
|
+
throw error;
|
|
578
|
+
}
|
|
579
|
+
throw new CLIError(
|
|
580
|
+
"Workflow sync operation failed",
|
|
581
|
+
"WORKFLOW_SYNC_OPERATION_FAILED",
|
|
582
|
+
["Check error details above", "Verify @runa-ai/runa is installed"],
|
|
583
|
+
error instanceof Error ? error : void 0
|
|
584
|
+
);
|
|
585
|
+
}
|
|
586
|
+
});
|
|
587
|
+
async function handleWorkflowCheck(params) {
|
|
588
|
+
const isRuna = isRunaRepo();
|
|
589
|
+
const strict = params.options.strict ?? isRuna;
|
|
590
|
+
const all = params.options.all === true;
|
|
591
|
+
const seeds = params.options.seeds === true;
|
|
592
|
+
const target = all ? "all" : seeds ? "database:seeds" : "workflow:runa";
|
|
593
|
+
if (all || seeds) {
|
|
594
|
+
await handleDevOpsCheckAll({ isRuna, strict, target, logger: params.logger });
|
|
595
|
+
return;
|
|
596
|
+
}
|
|
597
|
+
await handleWorkflowCheckSingle({ isRuna, strict, logger: params.logger });
|
|
598
|
+
}
|
|
599
|
+
async function handleDevOpsCheckAll(params) {
|
|
600
|
+
const result = await devopsSync({
|
|
601
|
+
mode: "check",
|
|
602
|
+
target: params.target,
|
|
603
|
+
isRunaRepo: params.isRuna,
|
|
604
|
+
targetDir: process.cwd(),
|
|
605
|
+
strict: params.strict
|
|
606
|
+
});
|
|
607
|
+
emitJsonSuccess(checkCommand, DevOpsSyncOutputSchema, result);
|
|
608
|
+
if (result.inSync) {
|
|
609
|
+
params.logger.success("Files match templates");
|
|
610
|
+
return;
|
|
611
|
+
}
|
|
612
|
+
params.logger.warn("Files differ from templates");
|
|
613
|
+
if (params.strict) {
|
|
614
|
+
throw new CLIError("Files out of sync", "FILES_OUT_OF_SYNC", [
|
|
615
|
+
`Run: runa workflow sync --${params.target === "database:seeds" ? "seeds" : "all"}`,
|
|
616
|
+
"To sync with latest templates"
|
|
617
|
+
]);
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
async function handleWorkflowCheckSingle(params) {
|
|
621
|
+
const result = await workflowSync({
|
|
622
|
+
mode: "check",
|
|
623
|
+
isRunaRepo: params.isRuna,
|
|
624
|
+
targetDir: process.cwd(),
|
|
625
|
+
strict: params.strict
|
|
626
|
+
});
|
|
627
|
+
emitJsonSuccess(checkCommand, WorkflowSyncOutputSchema, result);
|
|
628
|
+
if (result.inSync) {
|
|
629
|
+
params.logger.success("Workflow matches template");
|
|
630
|
+
return;
|
|
631
|
+
}
|
|
632
|
+
params.logger.warn("Workflow differs from template");
|
|
633
|
+
if (params.strict) {
|
|
634
|
+
throw new CLIError("Workflow out of sync", "WORKFLOW_OUT_OF_SYNC", [
|
|
635
|
+
"Run: runa workflow sync",
|
|
636
|
+
"Or update template in packages/sdk/templates/.github/workflows/runa.yml"
|
|
637
|
+
]);
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
async function handleWorkflowSync(params) {
|
|
641
|
+
const isRuna = isRunaRepo();
|
|
642
|
+
const all = params.options.all === true;
|
|
643
|
+
const seeds = params.options.seeds === true;
|
|
644
|
+
const target = all ? "all" : seeds ? "database:seeds" : "workflow:runa";
|
|
645
|
+
if (params.options.check) {
|
|
646
|
+
if (all || seeds) {
|
|
647
|
+
await handleDevOpsCheckForSync({ isRuna, target, logger: params.logger });
|
|
648
|
+
return;
|
|
649
|
+
}
|
|
650
|
+
await handleWorkflowCheckSingleForSync({ isRuna, logger: params.logger });
|
|
651
|
+
return;
|
|
652
|
+
}
|
|
653
|
+
if (all || seeds) {
|
|
654
|
+
await handleDevOpsSyncTarget({ isRuna, target, logger: params.logger });
|
|
655
|
+
return;
|
|
656
|
+
}
|
|
657
|
+
await handleWorkflowSyncSingle({ isRuna, logger: params.logger });
|
|
658
|
+
}
|
|
659
|
+
async function handleDevOpsCheckForSync(params) {
|
|
660
|
+
const result = await devopsSync({
|
|
661
|
+
mode: "check",
|
|
662
|
+
target: params.target,
|
|
663
|
+
isRunaRepo: params.isRuna,
|
|
664
|
+
targetDir: process.cwd()
|
|
665
|
+
});
|
|
666
|
+
emitJsonSuccess(syncCommand, DevOpsSyncOutputSchema, result);
|
|
667
|
+
if (result.inSync) {
|
|
668
|
+
params.logger.success("Files match templates");
|
|
669
|
+
return;
|
|
670
|
+
}
|
|
671
|
+
throw new CLIError("Files out of sync", "FILES_OUT_OF_SYNC", [
|
|
672
|
+
`Run: runa workflow sync --${params.target === "database:seeds" ? "seeds" : "all"}`,
|
|
673
|
+
"To sync with latest templates"
|
|
674
|
+
]);
|
|
675
|
+
}
|
|
676
|
+
async function handleWorkflowCheckSingleForSync(params) {
|
|
677
|
+
const result = await workflowSync({
|
|
678
|
+
mode: "check",
|
|
679
|
+
isRunaRepo: params.isRuna,
|
|
680
|
+
targetDir: process.cwd()
|
|
681
|
+
});
|
|
682
|
+
emitJsonSuccess(syncCommand, WorkflowSyncOutputSchema, result);
|
|
683
|
+
if (result.inSync) {
|
|
684
|
+
params.logger.success("Workflow matches template");
|
|
685
|
+
return;
|
|
686
|
+
}
|
|
687
|
+
throw new CLIError("Workflow out of sync", "WORKFLOW_OUT_OF_SYNC", [
|
|
688
|
+
"Run: runa workflow sync",
|
|
689
|
+
"To sync with latest template"
|
|
690
|
+
]);
|
|
691
|
+
}
|
|
692
|
+
async function handleDevOpsSyncTarget(params) {
|
|
693
|
+
const result = await devopsSync({
|
|
694
|
+
mode: "sync",
|
|
695
|
+
target: params.target,
|
|
696
|
+
isRunaRepo: params.isRuna,
|
|
697
|
+
targetDir: process.cwd()
|
|
698
|
+
});
|
|
699
|
+
emitJsonSuccess(syncCommand, DevOpsSyncOutputSchema, result);
|
|
700
|
+
params.logger.success("Files synced successfully");
|
|
701
|
+
params.logger.info(`Files: ${result.files.length}`);
|
|
702
|
+
const created = result.files.filter((f) => f.action === "created");
|
|
703
|
+
const updated = result.files.filter((f) => f.action === "updated");
|
|
704
|
+
if (created.length > 0) {
|
|
705
|
+
params.logger.info(`Created: ${created.length}`);
|
|
706
|
+
}
|
|
707
|
+
if (updated.length > 0) {
|
|
708
|
+
params.logger.info(`Updated: ${updated.length}`);
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
async function handleWorkflowSyncSingle(params) {
|
|
712
|
+
const result = await workflowSync({
|
|
713
|
+
mode: "sync",
|
|
714
|
+
isRunaRepo: params.isRuna,
|
|
715
|
+
targetDir: process.cwd()
|
|
716
|
+
});
|
|
717
|
+
emitJsonSuccess(syncCommand, WorkflowSyncOutputSchema, result);
|
|
718
|
+
if (result.inSync) {
|
|
719
|
+
params.logger.success("Workflow synced successfully");
|
|
720
|
+
params.logger.info(`Template: ${result.templatePath}`);
|
|
721
|
+
params.logger.info(`Target: ${result.targetPath}`);
|
|
722
|
+
return;
|
|
723
|
+
}
|
|
724
|
+
throw new CLIError("Workflow sync failed", "WORKFLOW_SYNC_FAILED", [
|
|
725
|
+
"Check error details above",
|
|
726
|
+
"Verify file permissions"
|
|
727
|
+
]);
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
// src/commands/workflow/commands/validate.ts
|
|
731
|
+
init_esm_shims();
|
|
732
|
+
function parseValidateOptions(options) {
|
|
733
|
+
if (!options.previewUrl) {
|
|
734
|
+
throw new CLIError("Preview URL must be provided", "VALIDATION_NO_URLS", [
|
|
735
|
+
"Use --preview-url <url>",
|
|
736
|
+
"Or set PREVIEW_URL environment variable"
|
|
737
|
+
]);
|
|
738
|
+
}
|
|
739
|
+
return {
|
|
740
|
+
previewUrl: options.previewUrl,
|
|
741
|
+
maxRetries: options.maxRetries ? Number.parseInt(options.maxRetries, 10) : 5,
|
|
742
|
+
retryDelaySeconds: options.retryDelay ? Number.parseInt(options.retryDelay, 10) : 15
|
|
743
|
+
};
|
|
744
|
+
}
|
|
745
|
+
function toFailureDetails(result) {
|
|
746
|
+
const details = [];
|
|
747
|
+
if (result.previewUrl && !result.previewUrl.valid) {
|
|
748
|
+
details.push(`previewUrl: ${result.previewUrl.error ?? "Invalid"}`);
|
|
749
|
+
}
|
|
750
|
+
return details;
|
|
751
|
+
}
|
|
752
|
+
var validateCommand = new Command("validate").description("Validate infrastructure setup (Preview URL accessibility)").option("--preview-url <url>", "Preview URL to validate", process.env.PREVIEW_URL).option("--max-retries <n>", "Max retries for accessibility check", "5").option("--retry-delay <seconds>", "Delay between retries (seconds)", "15").option("--report-json <path>", "Export report to JSON file").action(async (options) => {
|
|
753
|
+
const logger = createCLILogger("workflow:validate");
|
|
754
|
+
const startTime = Date.now();
|
|
755
|
+
const ci = process.env.CI === "true";
|
|
756
|
+
const command = "runa workflow validate";
|
|
757
|
+
try {
|
|
758
|
+
const config = parseValidateOptions(options);
|
|
759
|
+
logger.section("Infrastructure Validation");
|
|
760
|
+
const result = await validateInfrastructure(config);
|
|
761
|
+
const totalDurationMs = Date.now() - startTime;
|
|
762
|
+
const stages = [];
|
|
763
|
+
if (config.previewUrl) {
|
|
764
|
+
stages.push({
|
|
765
|
+
name: "previewUrl",
|
|
766
|
+
status: result.previewUrl?.valid ? "passed" : "failed",
|
|
767
|
+
durationMs: 0,
|
|
768
|
+
errorDetails: result.previewUrl?.error
|
|
769
|
+
});
|
|
770
|
+
}
|
|
771
|
+
if (!result.valid) {
|
|
772
|
+
const details = toFailureDetails(result);
|
|
773
|
+
const failedStages = stages.filter((s) => s.status === "failed").map((s) => s.name);
|
|
774
|
+
emitWorkflowValidateFailureCapsule({
|
|
775
|
+
command,
|
|
776
|
+
ci,
|
|
777
|
+
failedStages,
|
|
778
|
+
errorDetails: details.join("\n")
|
|
779
|
+
});
|
|
780
|
+
emitWorkflowAnnotations({
|
|
781
|
+
command,
|
|
782
|
+
success: false,
|
|
783
|
+
failedStages
|
|
784
|
+
});
|
|
785
|
+
writeWorkflowValidateStepSummary({
|
|
786
|
+
command,
|
|
787
|
+
ci,
|
|
788
|
+
totalDurationMs,
|
|
789
|
+
stages,
|
|
790
|
+
success: false,
|
|
791
|
+
reportJsonPath: options.reportJson
|
|
792
|
+
});
|
|
793
|
+
if (options.reportJson) {
|
|
794
|
+
exportWorkflowReportJson({
|
|
795
|
+
command,
|
|
796
|
+
domain: "workflow",
|
|
797
|
+
tier: "validate",
|
|
798
|
+
ci,
|
|
799
|
+
totalDurationMs,
|
|
800
|
+
stages: stages.map((s) => ({
|
|
801
|
+
name: s.name,
|
|
802
|
+
status: s.status,
|
|
803
|
+
durationMs: s.durationMs,
|
|
804
|
+
errorDetails: s.errorDetails
|
|
805
|
+
})),
|
|
806
|
+
success: false,
|
|
807
|
+
filePath: options.reportJson
|
|
808
|
+
});
|
|
809
|
+
}
|
|
810
|
+
throw new CLIError("Infrastructure validation failed", "VALIDATION_FAILED", [
|
|
811
|
+
...details.map((d) => `Fix: ${d}`),
|
|
812
|
+
"Fix infrastructure issues and retry"
|
|
813
|
+
]);
|
|
814
|
+
}
|
|
815
|
+
writeWorkflowValidateStepSummary({
|
|
816
|
+
command,
|
|
817
|
+
ci,
|
|
818
|
+
totalDurationMs,
|
|
819
|
+
stages,
|
|
820
|
+
success: true,
|
|
821
|
+
reportJsonPath: options.reportJson
|
|
822
|
+
});
|
|
823
|
+
if (options.reportJson) {
|
|
824
|
+
exportWorkflowReportJson({
|
|
825
|
+
command,
|
|
826
|
+
domain: "workflow",
|
|
827
|
+
tier: "validate",
|
|
828
|
+
ci,
|
|
829
|
+
totalDurationMs,
|
|
830
|
+
stages: stages.map((s) => ({ name: s.name, status: s.status, durationMs: s.durationMs })),
|
|
831
|
+
success: true,
|
|
832
|
+
filePath: options.reportJson
|
|
833
|
+
});
|
|
834
|
+
logger.info(`\u{1F4CA} Report JSON: ${options.reportJson}`);
|
|
835
|
+
}
|
|
836
|
+
emitJsonSuccess(validateCommand, WorkflowValidateInfrastructureOutputSchema, result);
|
|
837
|
+
logger.success("Validation complete");
|
|
838
|
+
} catch (error) {
|
|
839
|
+
if (error instanceof CLIError) {
|
|
840
|
+
throw error;
|
|
841
|
+
}
|
|
842
|
+
throw new CLIError(
|
|
843
|
+
"Validation failed",
|
|
844
|
+
"VALIDATION_ERROR",
|
|
845
|
+
["Check error details above", "Verify URLs are accessible"],
|
|
846
|
+
error instanceof Error ? error : void 0
|
|
847
|
+
);
|
|
848
|
+
}
|
|
849
|
+
});
|
|
850
|
+
|
|
851
|
+
// src/commands/workflow/commands/verify-credentials.ts
|
|
852
|
+
init_esm_shims();
|
|
853
|
+
function requireNonEmpty(name) {
|
|
854
|
+
const value = (process.env[name] || "").trim();
|
|
855
|
+
if (value.length > 0) return value;
|
|
856
|
+
throw new CLIError(
|
|
857
|
+
`${name} is required`,
|
|
858
|
+
"WORKFLOW_CREDENTIALS_MISSING",
|
|
859
|
+
[
|
|
860
|
+
`Ensure ${name} is set in the workflow step env`,
|
|
861
|
+
"Re-run workflow after fixing upstream step outputs"
|
|
862
|
+
],
|
|
863
|
+
void 0,
|
|
864
|
+
1
|
|
865
|
+
);
|
|
866
|
+
}
|
|
867
|
+
var verifyCredentialsCommand = new Command("verify-credentials").description("Verify required workflow credentials are available (GitHub Actions helper)").option(
|
|
868
|
+
"--require <NAME>",
|
|
869
|
+
"Additional required environment variable name (repeatable)",
|
|
870
|
+
(value, previous) => [...previous, value],
|
|
871
|
+
[]
|
|
872
|
+
).action(async (options) => {
|
|
873
|
+
const required = [
|
|
874
|
+
"SUPABASE_URL",
|
|
875
|
+
"SUPABASE_ANON_KEY",
|
|
876
|
+
"RUNA_PRIMARY_ROOT_ID",
|
|
877
|
+
...options.require ?? []
|
|
878
|
+
];
|
|
879
|
+
for (const key of required) {
|
|
880
|
+
requireNonEmpty(key);
|
|
881
|
+
}
|
|
882
|
+
});
|
|
883
|
+
|
|
884
|
+
// src/commands/workflow/index.ts
|
|
885
|
+
var workflowCommand = new Command("workflow").description(
|
|
886
|
+
"GitHub Actions workflow utilities"
|
|
887
|
+
);
|
|
888
|
+
workflowCommand.addCommand(notifyCommand);
|
|
889
|
+
workflowCommand.addCommand(syncCommand);
|
|
890
|
+
workflowCommand.addCommand(checkCommand);
|
|
891
|
+
workflowCommand.addCommand(workflowPathsCommand);
|
|
892
|
+
workflowCommand.addCommand(verifyCredentialsCommand);
|
|
893
|
+
workflowCommand.addCommand(workflowFinalStatusCommand);
|
|
894
|
+
workflowCommand.addCommand(workflowLogCommand);
|
|
895
|
+
workflowCommand.addCommand(validateCommand);
|
|
896
|
+
workflowCommand.addCommand(deployProductionCommand);
|
|
897
|
+
|
|
898
|
+
export { workflowCommand };
|