@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,460 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'module';
|
|
3
|
+
import { init_esm_shims, __require } from './chunk-VRXHCR5K.js';
|
|
4
|
+
import { existsSync, createWriteStream } from 'fs';
|
|
5
|
+
import path from 'path';
|
|
6
|
+
import { loadRunaConfig, CLIError } from '@runa-ai/runa';
|
|
7
|
+
import { writeFile, readFile } from 'fs/promises';
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
|
|
10
|
+
createRequire(import.meta.url);
|
|
11
|
+
|
|
12
|
+
// src/commands/ci/machine/actors/setup/pr-common.ts
|
|
13
|
+
init_esm_shims();
|
|
14
|
+
function resolvePrContext(input) {
|
|
15
|
+
const prNumberStr = input.githubRef?.match(/refs\/pull\/(\d+)/)?.[1];
|
|
16
|
+
const prNumber = prNumberStr ? Number.parseInt(prNumberStr, 10) : null;
|
|
17
|
+
return {
|
|
18
|
+
prNumber,
|
|
19
|
+
action: input.githubEventAction ?? null,
|
|
20
|
+
sha: input.githubSha ?? null,
|
|
21
|
+
baseBranch: input.githubBaseRef ?? null,
|
|
22
|
+
headBranch: input.githubHeadRef ?? null
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function resolvePolicy(_config, _repoKind) {
|
|
26
|
+
return {
|
|
27
|
+
allowLocalFallback: true,
|
|
28
|
+
allowPartialPhases: false,
|
|
29
|
+
source: "default"
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function detectRepoKind(repoRoot) {
|
|
33
|
+
const hasApps = existsSync(path.join(repoRoot, "apps"));
|
|
34
|
+
const hasPackages = existsSync(path.join(repoRoot, "packages"));
|
|
35
|
+
const hasTurbo = existsSync(path.join(repoRoot, "turbo.json"));
|
|
36
|
+
if (hasApps || hasPackages || hasTurbo) {
|
|
37
|
+
return "monorepo";
|
|
38
|
+
}
|
|
39
|
+
const hasSrc = existsSync(path.join(repoRoot, "src"));
|
|
40
|
+
const hasApp = existsSync(path.join(repoRoot, "app"));
|
|
41
|
+
if (hasSrc || hasApp) {
|
|
42
|
+
return "pj-repo";
|
|
43
|
+
}
|
|
44
|
+
return "unknown";
|
|
45
|
+
}
|
|
46
|
+
var APP_PRIORITY = ["web", "dashboard", "app", "frontend", "client"];
|
|
47
|
+
function hasKnownFrameworkConfig(dir) {
|
|
48
|
+
if (existsSync(path.join(dir, "next.config.js")) || existsSync(path.join(dir, "next.config.mjs")) || existsSync(path.join(dir, "next.config.ts"))) {
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
if (existsSync(path.join(dir, "vite.config.js")) || existsSync(path.join(dir, "vite.config.ts"))) {
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
if (existsSync(path.join(dir, "remix.config.js"))) {
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
if (existsSync(path.join(dir, "astro.config.mjs")) || existsSync(path.join(dir, "astro.config.ts"))) {
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
if (existsSync(path.join(dir, "nuxt.config.js")) || existsSync(path.join(dir, "nuxt.config.ts"))) {
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
if (existsSync(path.join(dir, "svelte.config.js"))) {
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
function hasPackageJson(dir) {
|
|
69
|
+
return existsSync(path.join(dir, "package.json"));
|
|
70
|
+
}
|
|
71
|
+
function readAppsSubdirectoryNames(appsDir) {
|
|
72
|
+
try {
|
|
73
|
+
const { readdirSync } = __require("fs");
|
|
74
|
+
const entries = readdirSync(appsDir, { withFileTypes: true });
|
|
75
|
+
return entries.filter((entry) => entry.isDirectory()).map((entry) => entry.name);
|
|
76
|
+
} catch {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function splitAppCandidates(names) {
|
|
81
|
+
const nameSet = new Set(names);
|
|
82
|
+
const prioritySet = new Set(APP_PRIORITY);
|
|
83
|
+
const priorityCandidates = APP_PRIORITY.filter((name) => nameSet.has(name));
|
|
84
|
+
const secondaryCandidates = names.filter((name) => !prioritySet.has(name));
|
|
85
|
+
return { priorityCandidates, secondaryCandidates };
|
|
86
|
+
}
|
|
87
|
+
function findFirstMatchingAppDir(appsDir, names, predicate) {
|
|
88
|
+
for (const name of names) {
|
|
89
|
+
const candidate = path.join(appsDir, name);
|
|
90
|
+
if (predicate(candidate)) {
|
|
91
|
+
return candidate;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
var PORT_PATTERNS = [
|
|
97
|
+
/-p\s*([0-9]+)/i,
|
|
98
|
+
/--port[=\s]+([0-9]+)/i,
|
|
99
|
+
/\bPORT\s*=\s*([0-9]+)/
|
|
100
|
+
];
|
|
101
|
+
function extractPortFromScript(script) {
|
|
102
|
+
for (const pattern of PORT_PATTERNS) {
|
|
103
|
+
const match = script.match(pattern);
|
|
104
|
+
if (match?.[1]) {
|
|
105
|
+
const port = Number.parseInt(match[1], 10);
|
|
106
|
+
if (!Number.isNaN(port) && port > 0 && port < 65536) {
|
|
107
|
+
return port;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
function readPortFromScripts(appDir) {
|
|
114
|
+
const pkgPath = path.join(appDir, "package.json");
|
|
115
|
+
if (!existsSync(pkgPath)) return 3e3;
|
|
116
|
+
try {
|
|
117
|
+
const { readFileSync } = __require("fs");
|
|
118
|
+
const raw = readFileSync(pkgPath, "utf-8");
|
|
119
|
+
const parsed = JSON.parse(raw);
|
|
120
|
+
const scripts = parsed.scripts;
|
|
121
|
+
for (const key of ["start:ci", "start", "dev"]) {
|
|
122
|
+
const script = scripts?.[key];
|
|
123
|
+
if (script) {
|
|
124
|
+
const port = extractPortFromScript(script);
|
|
125
|
+
if (port !== null) return port;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
} catch {
|
|
129
|
+
}
|
|
130
|
+
return 3e3;
|
|
131
|
+
}
|
|
132
|
+
function findWebAppUnderApps(repoRoot) {
|
|
133
|
+
const appsDir = path.join(repoRoot, "apps");
|
|
134
|
+
if (!existsSync(appsDir)) return null;
|
|
135
|
+
const names = readAppsSubdirectoryNames(appsDir);
|
|
136
|
+
if (!names) return null;
|
|
137
|
+
const { priorityCandidates, secondaryCandidates } = splitAppCandidates(names);
|
|
138
|
+
return findFirstMatchingAppDir(appsDir, priorityCandidates, hasKnownFrameworkConfig) ?? findFirstMatchingAppDir(appsDir, secondaryCandidates, hasKnownFrameworkConfig) ?? findFirstMatchingAppDir(appsDir, priorityCandidates, hasPackageJson) ?? findFirstMatchingAppDir(appsDir, secondaryCandidates, hasPackageJson);
|
|
139
|
+
}
|
|
140
|
+
function detectApp(repoRoot, configOverride) {
|
|
141
|
+
if (configOverride?.directory && configOverride.directory !== ".") {
|
|
142
|
+
const configuredDir = path.join(repoRoot, configOverride.directory);
|
|
143
|
+
if (existsSync(configuredDir) && hasPackageJson(configuredDir)) {
|
|
144
|
+
return {
|
|
145
|
+
appDir: configuredDir,
|
|
146
|
+
port: configOverride.port ?? readPortFromScripts(configuredDir)
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
const appUnderApps = findWebAppUnderApps(repoRoot);
|
|
151
|
+
if (appUnderApps) {
|
|
152
|
+
return {
|
|
153
|
+
appDir: appUnderApps,
|
|
154
|
+
port: configOverride?.port ?? readPortFromScripts(appUnderApps)
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
if (hasKnownFrameworkConfig(repoRoot)) {
|
|
158
|
+
return {
|
|
159
|
+
appDir: repoRoot,
|
|
160
|
+
port: configOverride?.port ?? readPortFromScripts(repoRoot)
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
if (hasPackageJson(repoRoot)) {
|
|
164
|
+
return {
|
|
165
|
+
appDir: repoRoot,
|
|
166
|
+
port: configOverride?.port ?? readPortFromScripts(repoRoot)
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
function createErrorOutput(repoRoot, error, extraFields) {
|
|
172
|
+
const baseError = {
|
|
173
|
+
repoRoot,
|
|
174
|
+
tmpDir: "",
|
|
175
|
+
repoKind: "unknown",
|
|
176
|
+
prContext: { prNumber: null, action: null, sha: null, baseBranch: null, headBranch: null },
|
|
177
|
+
policy: {
|
|
178
|
+
allowLocalFallback: true,
|
|
179
|
+
allowPartialPhases: false,
|
|
180
|
+
source: "default"
|
|
181
|
+
},
|
|
182
|
+
app: null,
|
|
183
|
+
databaseUrl: "",
|
|
184
|
+
supabaseUrl: "",
|
|
185
|
+
anonKey: "",
|
|
186
|
+
layers: [],
|
|
187
|
+
expectedDrift: [],
|
|
188
|
+
error: error instanceof Error ? error.message : String(error)
|
|
189
|
+
};
|
|
190
|
+
return { ...baseError, ...extraFields };
|
|
191
|
+
}
|
|
192
|
+
async function executePrSetupBase(input, ensureTmpDir) {
|
|
193
|
+
const repoRoot = input.targetDir || process.cwd();
|
|
194
|
+
const tmpDir = await ensureTmpDir(repoRoot);
|
|
195
|
+
const repoKind = detectRepoKind(repoRoot);
|
|
196
|
+
const prContext = resolvePrContext({
|
|
197
|
+
githubRef: input.githubRef,
|
|
198
|
+
githubEventAction: input.githubEventAction,
|
|
199
|
+
githubSha: input.githubSha,
|
|
200
|
+
githubBaseRef: input.githubBaseRef,
|
|
201
|
+
githubHeadRef: input.githubHeadRef
|
|
202
|
+
});
|
|
203
|
+
const policy = resolvePolicy(input.config);
|
|
204
|
+
const configResult = loadRunaConfig(repoRoot);
|
|
205
|
+
const appConfigOverride = configResult?.config?.app?.directory ? {
|
|
206
|
+
directory: configResult.config.app.directory
|
|
207
|
+
// Port is auto-detected via readPortFromScripts() - not in config schema
|
|
208
|
+
} : void 0;
|
|
209
|
+
const app = detectApp(repoRoot, appConfigOverride);
|
|
210
|
+
const layers = input.layers || [1, 2, 3, 4];
|
|
211
|
+
const rawDrift = configResult?.config?.database?.pgSchemaDiff?.expectedDrift;
|
|
212
|
+
const expectedDrift = rawDrift ? rawDrift : [];
|
|
213
|
+
return { repoRoot, tmpDir, repoKind, prContext, policy, app, layers, expectedDrift };
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// src/commands/ci/utils/app-runtime.ts
|
|
217
|
+
init_esm_shims();
|
|
218
|
+
function pipeChildOutputToLog(params) {
|
|
219
|
+
const sources = [];
|
|
220
|
+
if (params.stdout) sources.push({ stream: params.stdout, isStderr: false });
|
|
221
|
+
if (params.stderr) sources.push({ stream: params.stderr, isStderr: true });
|
|
222
|
+
if (sources.length === 0) {
|
|
223
|
+
params.logStream.end();
|
|
224
|
+
return { cleanup: () => {
|
|
225
|
+
} };
|
|
226
|
+
}
|
|
227
|
+
let pending = sources.length;
|
|
228
|
+
let cleanedUp = false;
|
|
229
|
+
const onSourceEnd = () => {
|
|
230
|
+
pending -= 1;
|
|
231
|
+
if (pending === 0 && !cleanedUp) {
|
|
232
|
+
params.logStream.end();
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
for (const { stream: source, isStderr } of sources) {
|
|
236
|
+
const onData = (chunk) => {
|
|
237
|
+
if (cleanedUp) return;
|
|
238
|
+
const canContinue = params.logStream.write(chunk);
|
|
239
|
+
if (params.streamToTerminal) {
|
|
240
|
+
const terminalStream = isStderr ? process.stderr : process.stdout;
|
|
241
|
+
terminalStream.write(chunk);
|
|
242
|
+
}
|
|
243
|
+
if (!canContinue) {
|
|
244
|
+
source.pause();
|
|
245
|
+
params.logStream.once("drain", () => {
|
|
246
|
+
if (!cleanedUp) source.resume();
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
source.on("data", onData);
|
|
251
|
+
source.once("end", onSourceEnd);
|
|
252
|
+
source.once("close", onSourceEnd);
|
|
253
|
+
source.once("error", () => {
|
|
254
|
+
onSourceEnd();
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
const cleanup = () => {
|
|
258
|
+
if (cleanedUp) return;
|
|
259
|
+
cleanedUp = true;
|
|
260
|
+
for (const { stream: source } of sources) {
|
|
261
|
+
source.removeAllListeners("data");
|
|
262
|
+
source.removeAllListeners("end");
|
|
263
|
+
source.removeAllListeners("close");
|
|
264
|
+
source.removeAllListeners("error");
|
|
265
|
+
if ("destroy" in source && typeof source.destroy === "function") {
|
|
266
|
+
source.destroy();
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
try {
|
|
270
|
+
const stream = params.logStream;
|
|
271
|
+
if (!stream.writableEnded) {
|
|
272
|
+
params.logStream.end();
|
|
273
|
+
}
|
|
274
|
+
} catch {
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
return { cleanup };
|
|
278
|
+
}
|
|
279
|
+
async function writeEnvLocal(params) {
|
|
280
|
+
const filePath = path.join(params.appDir, ".env.local");
|
|
281
|
+
const content = `${Object.entries(params.values).map(([k, v]) => `${k}=${v}`).join("\n")}
|
|
282
|
+
`;
|
|
283
|
+
await writeFile(filePath, content, "utf-8");
|
|
284
|
+
}
|
|
285
|
+
async function readLastLines(filePath, lineCount) {
|
|
286
|
+
try {
|
|
287
|
+
if (!existsSync(filePath)) return null;
|
|
288
|
+
const content = await readFile(filePath, "utf-8");
|
|
289
|
+
const lines = content.split("\n");
|
|
290
|
+
const lastLines = lines.slice(-lineCount).join("\n");
|
|
291
|
+
return lastLines.trim() || null;
|
|
292
|
+
} catch {
|
|
293
|
+
return null;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
async function waitHttpOk(params) {
|
|
297
|
+
const { url, timeoutSeconds, logFilePath } = params;
|
|
298
|
+
const startTime = Date.now();
|
|
299
|
+
const deadline = startTime + timeoutSeconds * 1e3;
|
|
300
|
+
let lastError = null;
|
|
301
|
+
let lastStatus = null;
|
|
302
|
+
let lastStatusText = null;
|
|
303
|
+
while (Date.now() < deadline) {
|
|
304
|
+
try {
|
|
305
|
+
const res = await fetch(url, { method: "GET", redirect: "manual" });
|
|
306
|
+
lastStatus = res.status;
|
|
307
|
+
lastStatusText = res.statusText;
|
|
308
|
+
if (res.status < 400) return;
|
|
309
|
+
} catch (error) {
|
|
310
|
+
lastError = error;
|
|
311
|
+
lastStatus = null;
|
|
312
|
+
lastStatusText = null;
|
|
313
|
+
}
|
|
314
|
+
await new Promise((r) => setTimeout(r, 2e3));
|
|
315
|
+
}
|
|
316
|
+
const elapsedSeconds = Math.round((Date.now() - startTime) / 1e3);
|
|
317
|
+
const errorParts = [`App did not become ready: ${url}`];
|
|
318
|
+
errorParts.push(`Timeout: ${timeoutSeconds}s (waited ${elapsedSeconds}s)`);
|
|
319
|
+
if (lastStatus !== null) {
|
|
320
|
+
errorParts.push(`Last HTTP status: ${lastStatus} ${lastStatusText ?? ""}`);
|
|
321
|
+
}
|
|
322
|
+
if (lastError instanceof Error) {
|
|
323
|
+
errorParts.push(`Last error: ${lastError.message}`);
|
|
324
|
+
}
|
|
325
|
+
const hints = [];
|
|
326
|
+
if (logFilePath) {
|
|
327
|
+
const logTail = await readLastLines(logFilePath, 30);
|
|
328
|
+
if (logTail) {
|
|
329
|
+
errorParts.push("");
|
|
330
|
+
errorParts.push("\u2501\u2501\u2501 Last 30 lines of app.log \u2501\u2501\u2501");
|
|
331
|
+
errorParts.push(logTail);
|
|
332
|
+
errorParts.push("\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");
|
|
333
|
+
}
|
|
334
|
+
hints.push(`Full log: ${logFilePath}`);
|
|
335
|
+
} else {
|
|
336
|
+
hints.push("Check app logs under .runa/tmp/app.log");
|
|
337
|
+
}
|
|
338
|
+
hints.push("Verify build/start commands");
|
|
339
|
+
throw new CLIError(
|
|
340
|
+
errorParts.join("\n"),
|
|
341
|
+
"CI_APP_NOT_READY",
|
|
342
|
+
hints,
|
|
343
|
+
lastError instanceof Error ? lastError : void 0,
|
|
344
|
+
30
|
|
345
|
+
);
|
|
346
|
+
}
|
|
347
|
+
async function readPackageScripts(pkgPath) {
|
|
348
|
+
if (!existsSync(pkgPath)) return null;
|
|
349
|
+
try {
|
|
350
|
+
const raw = await readFile(pkgPath, "utf-8");
|
|
351
|
+
const parsed = JSON.parse(raw);
|
|
352
|
+
return z.object({ scripts: z.record(z.string(), z.string()).optional() }).passthrough().parse(parsed).scripts ?? null;
|
|
353
|
+
} catch {
|
|
354
|
+
return null;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
function selectScriptName(mode, scripts, ciScriptName) {
|
|
358
|
+
if (scripts?.[ciScriptName]) {
|
|
359
|
+
return ciScriptName;
|
|
360
|
+
}
|
|
361
|
+
if (mode === "start" && scripts?.start) {
|
|
362
|
+
return "start";
|
|
363
|
+
}
|
|
364
|
+
return null;
|
|
365
|
+
}
|
|
366
|
+
function getAppDirArgs(isMonorepo, repoRoot, appDir) {
|
|
367
|
+
return isMonorepo ? ["-C", path.relative(repoRoot, appDir)] : [];
|
|
368
|
+
}
|
|
369
|
+
function createDirectNextCommand(params) {
|
|
370
|
+
const nextCommand = params.mode === "dev" ? "dev" : "start";
|
|
371
|
+
const dirArgs = getAppDirArgs(params.isMonorepo, params.repoRoot, params.appDir);
|
|
372
|
+
const bundlerArgs = params.bundler ? [`--${params.bundler}`] : [];
|
|
373
|
+
return {
|
|
374
|
+
command: [
|
|
375
|
+
"pnpm",
|
|
376
|
+
...dirArgs,
|
|
377
|
+
"exec",
|
|
378
|
+
"next",
|
|
379
|
+
nextCommand,
|
|
380
|
+
...bundlerArgs,
|
|
381
|
+
"-p",
|
|
382
|
+
String(params.port)
|
|
383
|
+
],
|
|
384
|
+
useRootScript: false
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
function determineAppCommand(mode, isMonorepo, rootScripts, appScripts, repoRoot, appDir, port, bundler) {
|
|
388
|
+
const ciScriptName = mode === "dev" ? "dev:ci" : "start:ci";
|
|
389
|
+
const rootScriptName = selectScriptName(mode, rootScripts, ciScriptName);
|
|
390
|
+
const appScriptName = selectScriptName(mode, appScripts, ciScriptName);
|
|
391
|
+
if (isMonorepo && rootScriptName) {
|
|
392
|
+
return { command: ["pnpm", rootScriptName], useRootScript: true };
|
|
393
|
+
}
|
|
394
|
+
if (appScriptName) {
|
|
395
|
+
const dirArgs = getAppDirArgs(isMonorepo, repoRoot, appDir);
|
|
396
|
+
return { command: ["pnpm", ...dirArgs, appScriptName], useRootScript: false };
|
|
397
|
+
}
|
|
398
|
+
return createDirectNextCommand({ mode, isMonorepo, repoRoot, appDir, bundler, port });
|
|
399
|
+
}
|
|
400
|
+
async function startAppBackground(params) {
|
|
401
|
+
const mode = params.mode ?? "start";
|
|
402
|
+
const isMonorepo = params.appDir !== params.repoRoot;
|
|
403
|
+
const rootPkgPath = path.join(params.repoRoot, "package.json");
|
|
404
|
+
const appPkgPath = path.join(params.appDir, "package.json");
|
|
405
|
+
const rootScripts = await readPackageScripts(rootPkgPath);
|
|
406
|
+
const appScripts = isMonorepo ? await readPackageScripts(appPkgPath) : rootScripts;
|
|
407
|
+
const { command, useRootScript } = determineAppCommand(
|
|
408
|
+
mode,
|
|
409
|
+
isMonorepo,
|
|
410
|
+
rootScripts,
|
|
411
|
+
appScripts,
|
|
412
|
+
params.repoRoot,
|
|
413
|
+
params.appDir,
|
|
414
|
+
params.port,
|
|
415
|
+
params.bundler
|
|
416
|
+
);
|
|
417
|
+
const appLog = path.join(params.tmpDir, "app.log");
|
|
418
|
+
const out = createWriteStream(appLog, { flags: "a" });
|
|
419
|
+
const commandStr = command.join(" ");
|
|
420
|
+
const modeLabel = mode === "dev" ? "development (hot reload)" : "production";
|
|
421
|
+
const logHeader = [
|
|
422
|
+
`[runa] Starting app at ${(/* @__PURE__ */ new Date()).toISOString()}`,
|
|
423
|
+
`[runa] Mode: ${modeLabel}`,
|
|
424
|
+
`[runa] Command: ${commandStr}`,
|
|
425
|
+
`[runa] Working directory: ${params.repoRoot}`,
|
|
426
|
+
`[runa] App directory: ${path.relative(params.repoRoot, params.appDir) || "."}`,
|
|
427
|
+
useRootScript ? "[runa] Using root package.json script" : "[runa] Using app package.json script",
|
|
428
|
+
"---",
|
|
429
|
+
""
|
|
430
|
+
].join("\n");
|
|
431
|
+
out.write(logHeader);
|
|
432
|
+
const { spawn } = await import('child_process');
|
|
433
|
+
const child = spawn(command[0], command.slice(1), {
|
|
434
|
+
cwd: params.repoRoot,
|
|
435
|
+
env: params.env,
|
|
436
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
437
|
+
detached: true,
|
|
438
|
+
shell: true
|
|
439
|
+
});
|
|
440
|
+
const { cleanup: cleanupStreams } = pipeChildOutputToLog({
|
|
441
|
+
stdout: child.stdout,
|
|
442
|
+
stderr: child.stderr,
|
|
443
|
+
logStream: out,
|
|
444
|
+
streamToTerminal: params.stream
|
|
445
|
+
});
|
|
446
|
+
const pid = child.pid ?? -1;
|
|
447
|
+
await writeFile(path.join(params.tmpDir, "app.pid"), `${pid}
|
|
448
|
+
`, "utf-8");
|
|
449
|
+
return { pid, cleanupStreams };
|
|
450
|
+
}
|
|
451
|
+
async function waitForAppReady(params) {
|
|
452
|
+
const logFilePath = params.tmpDir ? path.join(params.tmpDir, "app.log") : void 0;
|
|
453
|
+
await waitHttpOk({
|
|
454
|
+
url: `http://127.0.0.1:${params.port}/`,
|
|
455
|
+
timeoutSeconds: params.timeoutSeconds,
|
|
456
|
+
logFilePath
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
export { createErrorOutput, detectApp, executePrSetupBase, startAppBackground, waitForAppReady, writeEnvLocal };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'module';
|
|
3
|
+
import { init_esm_shims } from './chunk-VRXHCR5K.js';
|
|
4
|
+
import { CLIError } from '@runa-ai/runa/cli-runtime';
|
|
5
|
+
|
|
6
|
+
createRequire(import.meta.url);
|
|
7
|
+
|
|
8
|
+
// src/cli/output-format.ts
|
|
9
|
+
init_esm_shims();
|
|
10
|
+
function isOutputFormat(value) {
|
|
11
|
+
return value === "text" || value === "json";
|
|
12
|
+
}
|
|
13
|
+
function getOutputFormatFromEnv() {
|
|
14
|
+
const raw = process.env.RUNA_OUTPUT_FORMAT;
|
|
15
|
+
if (!raw) return "text";
|
|
16
|
+
if (raw === "text" || raw === "json") return raw;
|
|
17
|
+
return "text";
|
|
18
|
+
}
|
|
19
|
+
function setOutputFormat(format) {
|
|
20
|
+
process.env.RUNA_OUTPUT_FORMAT = format;
|
|
21
|
+
if (format === "json") {
|
|
22
|
+
process.env.RUNA_NON_INTERACTIVE = "true";
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function parseOutputFormat(input) {
|
|
26
|
+
if (isOutputFormat(input)) return input;
|
|
27
|
+
throw new CLIError(
|
|
28
|
+
"Invalid --format value. Allowed: text, json",
|
|
29
|
+
"INVALID_OUTPUT_FORMAT",
|
|
30
|
+
["Use: --format text", "Use: --format json"],
|
|
31
|
+
void 0,
|
|
32
|
+
2
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { getOutputFormatFromEnv, parseOutputFormat, setOutputFormat };
|