@runa-ai/runa-cli 0.5.71 → 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 +7 -1
- 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 +30 -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 -42912
- 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,458 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'module';
|
|
3
|
+
import { __esm, init_esm_shims, __export } from './chunk-VRXHCR5K.js';
|
|
4
|
+
import { existsSync, readFileSync } from 'fs';
|
|
5
|
+
import { spawnSync } from 'child_process';
|
|
6
|
+
import path from 'path';
|
|
7
|
+
import { BASE_PORTS } from '@runa-ai/runa';
|
|
8
|
+
|
|
9
|
+
createRequire(import.meta.url);
|
|
10
|
+
function isValidPort(value) {
|
|
11
|
+
if (typeof value !== "number") {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
return Number.isInteger(value) && value > 0 && value < 65536;
|
|
15
|
+
}
|
|
16
|
+
function asPort(value, fallback) {
|
|
17
|
+
const parsed = typeof value === "number" ? value : typeof value === "string" ? Number.parseInt(value, 10) : NaN;
|
|
18
|
+
return isValidPort(parsed) ? parsed : fallback;
|
|
19
|
+
}
|
|
20
|
+
function asHost(value) {
|
|
21
|
+
if (!value) return null;
|
|
22
|
+
const trimmed = value.trim();
|
|
23
|
+
return trimmed.length > 0 ? trimmed : null;
|
|
24
|
+
}
|
|
25
|
+
function getStatusValue(status, keys) {
|
|
26
|
+
for (const key of keys) {
|
|
27
|
+
const value = status[key];
|
|
28
|
+
if (typeof value === "string" && value.trim()) {
|
|
29
|
+
return value.trim();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
function extractHost(rawUrl) {
|
|
35
|
+
if (!rawUrl) return null;
|
|
36
|
+
try {
|
|
37
|
+
return new URL(rawUrl).hostname;
|
|
38
|
+
} catch {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function extractPort(rawUrl) {
|
|
43
|
+
if (!rawUrl) return null;
|
|
44
|
+
try {
|
|
45
|
+
const port = new URL(rawUrl).port;
|
|
46
|
+
if (!port) return null;
|
|
47
|
+
const parsed = Number.parseInt(port, 10);
|
|
48
|
+
return isValidPort(parsed) ? parsed : null;
|
|
49
|
+
} catch {
|
|
50
|
+
const match = rawUrl.match(/:(\d+)\//);
|
|
51
|
+
if (!match) return null;
|
|
52
|
+
const parsed = Number.parseInt(match[1], 10);
|
|
53
|
+
return isValidPort(parsed) ? parsed : null;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function parseTomlPort(content, section, key) {
|
|
57
|
+
const sectionRegex = new RegExp(`\\[${section}\\]([\\s\\S]*?)(?=\\n\\[|$)`);
|
|
58
|
+
const sectionMatch = sectionRegex.exec(content);
|
|
59
|
+
if (!sectionMatch) return null;
|
|
60
|
+
const sectionContent = sectionMatch[1];
|
|
61
|
+
const keyRegex = new RegExp(`^\\s*${key}\\s*=\\s*(\\d+)`, "m");
|
|
62
|
+
const keyMatch = keyRegex.exec(sectionContent);
|
|
63
|
+
if (!keyMatch) return null;
|
|
64
|
+
const parsed = Number.parseInt(keyMatch[1], 10);
|
|
65
|
+
return isValidPort(parsed) ? parsed : null;
|
|
66
|
+
}
|
|
67
|
+
function parseTomlPorts(configRoot) {
|
|
68
|
+
const configPath = path.join(configRoot, "supabase", "config.toml");
|
|
69
|
+
if (!existsSync(configPath)) return null;
|
|
70
|
+
try {
|
|
71
|
+
const content = readFileSync(configPath, "utf-8");
|
|
72
|
+
return {
|
|
73
|
+
api: parseTomlPort(content, "api", "port"),
|
|
74
|
+
db: parseTomlPort(content, "db", "port")
|
|
75
|
+
};
|
|
76
|
+
} catch {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function detectStatus(projectRoot) {
|
|
81
|
+
try {
|
|
82
|
+
const result = spawnSync("supabase", ["status", "--output", "json"], {
|
|
83
|
+
cwd: projectRoot,
|
|
84
|
+
encoding: "utf-8",
|
|
85
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
86
|
+
timeout: 5e3
|
|
87
|
+
});
|
|
88
|
+
if (result.status !== 0 || !result.stdout) return null;
|
|
89
|
+
const jsonMatch = result.stdout.match(/\{[\s\S]*\}/);
|
|
90
|
+
if (!jsonMatch) return null;
|
|
91
|
+
return JSON.parse(jsonMatch[0]);
|
|
92
|
+
} catch {
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
function resolveSupabaseRoot(projectRoot) {
|
|
97
|
+
const start = path.resolve(projectRoot);
|
|
98
|
+
let current = start;
|
|
99
|
+
while (true) {
|
|
100
|
+
if (existsSync(path.join(current, "supabase", "config.toml"))) {
|
|
101
|
+
return current;
|
|
102
|
+
}
|
|
103
|
+
const parent = path.dirname(current);
|
|
104
|
+
if (parent === current) {
|
|
105
|
+
return start;
|
|
106
|
+
}
|
|
107
|
+
current = parent;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function isAllowedLocalhostHost(host) {
|
|
111
|
+
return host === "127.0.0.1" || host === "localhost" || host === "host.docker.internal";
|
|
112
|
+
}
|
|
113
|
+
function buildDetectionCacheKey(projectRoot) {
|
|
114
|
+
return [
|
|
115
|
+
projectRoot,
|
|
116
|
+
process.env.LOCAL_SUPABASE_HOST ?? "",
|
|
117
|
+
process.env.LOCAL_SUPABASE_API_PORT ?? "",
|
|
118
|
+
process.env.LOCAL_SUPABASE_DB_PORT ?? "",
|
|
119
|
+
process.env.LOCAL_SUPABASE_STUDIO_PORT ?? ""
|
|
120
|
+
].join("|");
|
|
121
|
+
}
|
|
122
|
+
function readSupabaseOverrides() {
|
|
123
|
+
return {
|
|
124
|
+
host: asHost(process.env.LOCAL_SUPABASE_HOST),
|
|
125
|
+
api: asPort(process.env.LOCAL_SUPABASE_API_PORT, DEFAULT_API_PORT),
|
|
126
|
+
db: asPort(process.env.LOCAL_SUPABASE_DB_PORT, DEFAULT_DB_PORT),
|
|
127
|
+
studio: asPort(process.env.LOCAL_SUPABASE_STUDIO_PORT, DEFAULT_STUDIO_PORT)
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
function detectLocalSupabasePorts(projectRoot = process.cwd()) {
|
|
131
|
+
const resolvedRoot = resolveSupabaseRoot(projectRoot);
|
|
132
|
+
const cacheKey = buildDetectionCacheKey(resolvedRoot);
|
|
133
|
+
if (detectionCache?.key === cacheKey) {
|
|
134
|
+
return detectionCache.config;
|
|
135
|
+
}
|
|
136
|
+
const overrides = readSupabaseOverrides();
|
|
137
|
+
const explicitHost = asHost(process.env.LOCAL_SUPABASE_HOST);
|
|
138
|
+
const explicitApiPort = process.env.LOCAL_SUPABASE_API_PORT;
|
|
139
|
+
const explicitDbPort = process.env.LOCAL_SUPABASE_DB_PORT;
|
|
140
|
+
const explicitStudioPort = process.env.LOCAL_SUPABASE_STUDIO_PORT;
|
|
141
|
+
if (explicitHost && explicitApiPort && explicitDbPort) {
|
|
142
|
+
const explicitConfig = {
|
|
143
|
+
host: explicitHost,
|
|
144
|
+
api: asPort(explicitApiPort, DEFAULT_API_PORT),
|
|
145
|
+
db: asPort(explicitDbPort, DEFAULT_DB_PORT),
|
|
146
|
+
studio: asPort(explicitStudioPort, DEFAULT_STUDIO_PORT)
|
|
147
|
+
};
|
|
148
|
+
detectionCache = {
|
|
149
|
+
key: cacheKey,
|
|
150
|
+
config: explicitConfig
|
|
151
|
+
};
|
|
152
|
+
return explicitConfig;
|
|
153
|
+
}
|
|
154
|
+
const status = detectStatus(resolvedRoot);
|
|
155
|
+
const tomlPorts = parseTomlPorts(resolvedRoot);
|
|
156
|
+
const statusApiUrl = status ? getStatusValue(status, ["API_URL", "API URL", "api_url"]) : null;
|
|
157
|
+
const statusDbUrl = status ? getStatusValue(status, ["DB_URL", "DB URL", "db_url"]) : null;
|
|
158
|
+
const statusStudioUrl = status ? getStatusValue(status, ["STUDIO_URL", "Studio URL", "studio_url"]) : null;
|
|
159
|
+
const detectedHost = asHost(
|
|
160
|
+
overrides.host ?? extractHost(statusApiUrl) ?? extractHost(statusDbUrl) ?? extractHost(statusStudioUrl)
|
|
161
|
+
);
|
|
162
|
+
const detectedApiPort = asPort(
|
|
163
|
+
overrides.api !== DEFAULT_API_PORT ? overrides.api : void 0,
|
|
164
|
+
extractPort(statusApiUrl) ?? tomlPorts?.api ?? DEFAULT_API_PORT
|
|
165
|
+
);
|
|
166
|
+
const detectedDbPort = asPort(
|
|
167
|
+
overrides.db !== DEFAULT_DB_PORT ? overrides.db : void 0,
|
|
168
|
+
extractPort(statusDbUrl) ?? tomlPorts?.db ?? DEFAULT_DB_PORT
|
|
169
|
+
);
|
|
170
|
+
const detectedStudioPort = asPort(
|
|
171
|
+
overrides.studio !== DEFAULT_STUDIO_PORT ? overrides.studio : void 0,
|
|
172
|
+
extractPort(statusStudioUrl) ?? detectedApiPort + 2
|
|
173
|
+
);
|
|
174
|
+
const detectedConfig = {
|
|
175
|
+
host: detectedHost ?? DEFAULT_HOST,
|
|
176
|
+
api: detectedApiPort,
|
|
177
|
+
db: detectedDbPort,
|
|
178
|
+
studio: detectedStudioPort
|
|
179
|
+
};
|
|
180
|
+
detectionCache = {
|
|
181
|
+
key: cacheKey,
|
|
182
|
+
config: detectedConfig
|
|
183
|
+
};
|
|
184
|
+
return detectedConfig;
|
|
185
|
+
}
|
|
186
|
+
function buildLocalSupabaseUrl(projectRoot = process.cwd()) {
|
|
187
|
+
const config = detectLocalSupabasePorts(projectRoot);
|
|
188
|
+
return `http://${config.host}:${config.api}`;
|
|
189
|
+
}
|
|
190
|
+
function buildLocalDatabaseUrl(projectRoot = process.cwd()) {
|
|
191
|
+
const config = detectLocalSupabasePorts(projectRoot);
|
|
192
|
+
return `postgresql://postgres:postgres@${config.host}:${config.db}/postgres`;
|
|
193
|
+
}
|
|
194
|
+
function getLocalSupabaseEnvValues(projectRoot = process.cwd()) {
|
|
195
|
+
const config = detectLocalSupabasePorts(projectRoot);
|
|
196
|
+
const supabaseUrl = buildLocalSupabaseUrl(projectRoot);
|
|
197
|
+
const databaseUrl = buildLocalDatabaseUrl(projectRoot);
|
|
198
|
+
return {
|
|
199
|
+
LOCAL_SUPABASE_HOST: config.host,
|
|
200
|
+
LOCAL_SUPABASE_API_PORT: String(config.api),
|
|
201
|
+
LOCAL_SUPABASE_DB_PORT: String(config.db),
|
|
202
|
+
DATABASE_URL: databaseUrl,
|
|
203
|
+
DATABASE_URL_ADMIN: databaseUrl,
|
|
204
|
+
DATABASE_URL_SERVICE: databaseUrl,
|
|
205
|
+
NEXT_PUBLIC_SUPABASE_URL: supabaseUrl,
|
|
206
|
+
NEXT_PUBLIC_SUPABASE_ANON_KEY: LOCAL_SUPABASE_ANON_KEY,
|
|
207
|
+
SUPABASE_SERVICE_ROLE_KEY: LOCAL_SUPABASE_SERVICE_ROLE_KEY
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
function getLocalValueDescriptions(projectRoot = process.cwd()) {
|
|
211
|
+
const config = detectLocalSupabasePorts(projectRoot);
|
|
212
|
+
return {
|
|
213
|
+
LOCAL_SUPABASE_HOST: `supabase local host ${config.host}`,
|
|
214
|
+
LOCAL_SUPABASE_API_PORT: `supabase local api port ${config.api}`,
|
|
215
|
+
LOCAL_SUPABASE_DB_PORT: `supabase local db port ${config.db}`,
|
|
216
|
+
DATABASE_URL: `supabase local DB ${config.host}:${config.db}`,
|
|
217
|
+
DATABASE_URL_ADMIN: `supabase local DB ${config.host}:${config.db}`,
|
|
218
|
+
DATABASE_URL_SERVICE: `supabase local DB ${config.host}:${config.db}`,
|
|
219
|
+
NEXT_PUBLIC_SUPABASE_URL: `supabase local API ${config.host}:${config.api}`,
|
|
220
|
+
NEXT_PUBLIC_SUPABASE_ANON_KEY: "local anon key (supabase-demo)",
|
|
221
|
+
SUPABASE_SERVICE_ROLE_KEY: "local service key (supabase-demo)"
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
function validateLocalhostValues(envValues) {
|
|
225
|
+
const urlKeys = [
|
|
226
|
+
"DATABASE_URL",
|
|
227
|
+
"DATABASE_URL_ADMIN",
|
|
228
|
+
"DATABASE_URL_SERVICE",
|
|
229
|
+
"NEXT_PUBLIC_SUPABASE_URL"
|
|
230
|
+
];
|
|
231
|
+
const invalidEntries = [];
|
|
232
|
+
for (const key of urlKeys) {
|
|
233
|
+
const value = envValues[key];
|
|
234
|
+
if (!value) continue;
|
|
235
|
+
try {
|
|
236
|
+
const hostname = new URL(value).hostname;
|
|
237
|
+
if (!isAllowedLocalhostHost(hostname)) {
|
|
238
|
+
invalidEntries.push(key);
|
|
239
|
+
}
|
|
240
|
+
} catch {
|
|
241
|
+
invalidEntries.push(key);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
if (invalidEntries.length > 0) {
|
|
245
|
+
throw new Error(
|
|
246
|
+
`Local Supabase replacement aborted: not a local endpoint. The following keys are not local: ${invalidEntries.join(", ")}`
|
|
247
|
+
);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
var DEFAULT_HOST, DEFAULT_API_PORT, DEFAULT_DB_PORT, DEFAULT_STUDIO_PORT, detectionCache, LOCAL_SUPABASE_ANON_KEY, LOCAL_SUPABASE_SERVICE_ROLE_KEY, LOCAL_SUPABASE_ENV_VALUES;
|
|
251
|
+
var init_local_supabase = __esm({
|
|
252
|
+
"src/commands/env/constants/local-supabase.ts"() {
|
|
253
|
+
init_esm_shims();
|
|
254
|
+
DEFAULT_HOST = "127.0.0.1";
|
|
255
|
+
DEFAULT_API_PORT = BASE_PORTS.api;
|
|
256
|
+
DEFAULT_DB_PORT = BASE_PORTS.db;
|
|
257
|
+
DEFAULT_STUDIO_PORT = BASE_PORTS.studio;
|
|
258
|
+
detectionCache = null;
|
|
259
|
+
LOCAL_SUPABASE_ANON_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0";
|
|
260
|
+
LOCAL_SUPABASE_SERVICE_ROLE_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU";
|
|
261
|
+
LOCAL_SUPABASE_ENV_VALUES = getLocalSupabaseEnvValues();
|
|
262
|
+
getLocalValueDescriptions();
|
|
263
|
+
validateLocalhostValues(LOCAL_SUPABASE_ENV_VALUES);
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
// src/commands/db/constants.ts
|
|
268
|
+
var constants_exports = {};
|
|
269
|
+
__export(constants_exports, {
|
|
270
|
+
DATABASE_DEFAULTS: () => DATABASE_DEFAULTS,
|
|
271
|
+
ERROR_MESSAGES: () => ERROR_MESSAGES,
|
|
272
|
+
SCRIPT_LOCATIONS: () => SCRIPT_LOCATIONS,
|
|
273
|
+
SEED_DEFAULTS: () => SEED_DEFAULTS,
|
|
274
|
+
detectSupabasePorts: () => detectSupabasePorts,
|
|
275
|
+
getSupabaseAccessPoints: () => getSupabaseAccessPoints
|
|
276
|
+
});
|
|
277
|
+
function detectSupabasePorts(projectRoot) {
|
|
278
|
+
const cwd = projectRoot || process.cwd();
|
|
279
|
+
const result = spawnSync("supabase", ["status", "--output", "json"], {
|
|
280
|
+
encoding: "utf-8",
|
|
281
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
282
|
+
timeout: 5e3,
|
|
283
|
+
// 5 second timeout
|
|
284
|
+
cwd
|
|
285
|
+
});
|
|
286
|
+
if (result.status !== 0 || !result.stdout) {
|
|
287
|
+
throw new Error(
|
|
288
|
+
"Supabase is not running.\n\nStart Supabase with: supabase start\nOr run: runa check --fix"
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
let status;
|
|
292
|
+
try {
|
|
293
|
+
status = JSON.parse(result.stdout);
|
|
294
|
+
} catch {
|
|
295
|
+
throw new Error(
|
|
296
|
+
"Failed to parse Supabase status output.\n\nTry restarting Supabase: supabase stop && supabase start"
|
|
297
|
+
);
|
|
298
|
+
}
|
|
299
|
+
const apiUrl = status.API_URL || status["API URL"] || status.api_url;
|
|
300
|
+
const dbUrl = status.DB_URL || status["DB URL"] || status.db_url;
|
|
301
|
+
const studioUrl = status.STUDIO_URL || status["Studio URL"] || status.studio_url;
|
|
302
|
+
const extractPort2 = (url) => {
|
|
303
|
+
try {
|
|
304
|
+
const parsed = new URL(url);
|
|
305
|
+
return parsed.port ? Number.parseInt(parsed.port, 10) : null;
|
|
306
|
+
} catch {
|
|
307
|
+
const match = url.match(/:(\d+)\//);
|
|
308
|
+
return match ? Number.parseInt(match[1], 10) : null;
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
const apiPort = apiUrl ? extractPort2(apiUrl) : null;
|
|
312
|
+
const dbPort = dbUrl ? extractPort2(dbUrl) : null;
|
|
313
|
+
const studioPort = studioUrl ? extractPort2(studioUrl) : null;
|
|
314
|
+
if (!apiPort || !dbPort) {
|
|
315
|
+
throw new Error(
|
|
316
|
+
"Could not detect Supabase ports from status output.\n\nTry restarting Supabase: supabase stop && supabase start"
|
|
317
|
+
);
|
|
318
|
+
}
|
|
319
|
+
return {
|
|
320
|
+
api: apiPort,
|
|
321
|
+
db: dbPort,
|
|
322
|
+
studio: studioPort ?? apiPort + 2
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
function getSupabaseAccessPoints(projectRoot) {
|
|
326
|
+
const ports = detectLocalSupabasePorts(projectRoot);
|
|
327
|
+
const buildSupabaseUrl = (port) => {
|
|
328
|
+
const url = new URL(buildLocalSupabaseUrl(projectRoot));
|
|
329
|
+
url.port = String(port);
|
|
330
|
+
return url.toString().replace(/\/$/, "");
|
|
331
|
+
};
|
|
332
|
+
return {
|
|
333
|
+
studio: buildSupabaseUrl(ports.studio),
|
|
334
|
+
api: buildLocalSupabaseUrl(projectRoot),
|
|
335
|
+
db: buildLocalDatabaseUrl(projectRoot)
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
var DATABASE_DEFAULTS, SEED_DEFAULTS, SCRIPT_LOCATIONS, ERROR_MESSAGES;
|
|
339
|
+
var init_constants = __esm({
|
|
340
|
+
"src/commands/db/constants.ts"() {
|
|
341
|
+
init_esm_shims();
|
|
342
|
+
init_local_supabase();
|
|
343
|
+
DATABASE_DEFAULTS = {
|
|
344
|
+
// Supabase Local defaults (for development)
|
|
345
|
+
// Note: PORT is detected from running Supabase instance
|
|
346
|
+
// AI HINT: Local Supabase Default Credentials (Non-Production)
|
|
347
|
+
// postgres:postgres is the standard default for `supabase start`.
|
|
348
|
+
// This is a documented public value, not a secret.
|
|
349
|
+
// Production uses environment variables via .env.production.
|
|
350
|
+
SUPABASE_LOCAL: {
|
|
351
|
+
get HOST() {
|
|
352
|
+
return detectLocalSupabasePorts().host;
|
|
353
|
+
},
|
|
354
|
+
get PORT() {
|
|
355
|
+
return detectSupabasePorts().db;
|
|
356
|
+
},
|
|
357
|
+
USER: "postgres",
|
|
358
|
+
PASSWORD: "postgres",
|
|
359
|
+
DATABASE: "postgres"
|
|
360
|
+
},
|
|
361
|
+
// Standard PostgreSQL defaults (more generic)
|
|
362
|
+
POSTGRES: {
|
|
363
|
+
HOST: "127.0.0.1",
|
|
364
|
+
PORT: 5432,
|
|
365
|
+
USER: "postgres",
|
|
366
|
+
PASSWORD: "",
|
|
367
|
+
DATABASE: "postgres"
|
|
368
|
+
},
|
|
369
|
+
// Timeouts
|
|
370
|
+
CONNECTION_TIMEOUT_MS: 5e3,
|
|
371
|
+
SCRIPT_TIMEOUT_MS: 3e5,
|
|
372
|
+
// 5 minutes for schema/seed operations
|
|
373
|
+
// Get actual connection URL from environment or default
|
|
374
|
+
get defaultUrl() {
|
|
375
|
+
if (process.env.NODE_ENV === "production") {
|
|
376
|
+
if (!process.env.DATABASE_URL) {
|
|
377
|
+
throw new Error(
|
|
378
|
+
"DATABASE_URL is required in production environment.\nSet DATABASE_URL environment variable or configure in .env file."
|
|
379
|
+
);
|
|
380
|
+
}
|
|
381
|
+
return process.env.DATABASE_URL;
|
|
382
|
+
}
|
|
383
|
+
const databaseUrl = process.env.DATABASE_URL;
|
|
384
|
+
if (databaseUrl) {
|
|
385
|
+
try {
|
|
386
|
+
const url2 = new URL(databaseUrl);
|
|
387
|
+
const isLocalhost = url2.hostname === "127.0.0.1" || url2.hostname === "localhost" || url2.hostname === "host.docker.internal";
|
|
388
|
+
if (isLocalhost) {
|
|
389
|
+
return databaseUrl;
|
|
390
|
+
}
|
|
391
|
+
} catch {
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
const host = process.env.LOCAL_DB_HOST || process.env.DB_HOST || process.env.LOCAL_SUPABASE_HOST || this.SUPABASE_LOCAL.HOST;
|
|
395
|
+
const port = process.env.LOCAL_DB_PORT || process.env.DB_PORT || process.env.LOCAL_SUPABASE_DB_PORT || String(this.SUPABASE_LOCAL.PORT);
|
|
396
|
+
const user = process.env.LOCAL_DB_USER || process.env.DB_USER || this.SUPABASE_LOCAL.USER;
|
|
397
|
+
const password = process.env.LOCAL_DB_PASSWORD || process.env.DB_PASSWORD || this.SUPABASE_LOCAL.PASSWORD;
|
|
398
|
+
const database = process.env.LOCAL_DB_NAME || process.env.DB_NAME || this.SUPABASE_LOCAL.DATABASE;
|
|
399
|
+
const url = `postgresql://${user}:${password}@${host}:${port}/${database}`;
|
|
400
|
+
if (!process.env.DATABASE_URL && !process.env.LOCAL_DB_HOST && !process.env.DB_HOST) ;
|
|
401
|
+
return url;
|
|
402
|
+
}
|
|
403
|
+
};
|
|
404
|
+
SEED_DEFAULTS = {
|
|
405
|
+
// Unified 'ci.sql' for local and CI/preview (production does not use seeds)
|
|
406
|
+
REQUIRED_FILES: ["ci.sql"],
|
|
407
|
+
// Generic default paths (used only if config.toml parse fails)
|
|
408
|
+
// Projects should define their own sql_paths in config.toml
|
|
409
|
+
DEFAULT_PATHS: [
|
|
410
|
+
"./seeds/[0-9]*.sql",
|
|
411
|
+
// Prerequisite seeds (e.g., 00_auth_users.sql)
|
|
412
|
+
"./seeds/ci.sql"
|
|
413
|
+
// Unified seed for local and CI/preview
|
|
414
|
+
],
|
|
415
|
+
CONFIG_SECTION: "[db.seed]"
|
|
416
|
+
};
|
|
417
|
+
SCRIPT_LOCATIONS = {
|
|
418
|
+
VALIDATE_SCHEMAS: {
|
|
419
|
+
relativePath: "supabase/validate-schemas.sh",
|
|
420
|
+
description: "Schema validation script",
|
|
421
|
+
required: true
|
|
422
|
+
},
|
|
423
|
+
DETECT_RISKS: {
|
|
424
|
+
relativePath: "supabase/detect-risks.sh",
|
|
425
|
+
description: "Risk detection script",
|
|
426
|
+
required: true
|
|
427
|
+
},
|
|
428
|
+
APPLY_SCHEMAS: {
|
|
429
|
+
relativePath: "supabase/apply-schemas.sh",
|
|
430
|
+
description: "Schema application script",
|
|
431
|
+
required: true
|
|
432
|
+
},
|
|
433
|
+
APPLY_SEEDS: {
|
|
434
|
+
relativePath: "packages/sdk/scripts/apply-seeds.sh",
|
|
435
|
+
description: "Seed application script (SDK)",
|
|
436
|
+
required: false
|
|
437
|
+
},
|
|
438
|
+
GENERATE_TYPES: {
|
|
439
|
+
relativePath: "packages/sdk/scripts/generate-types.sh",
|
|
440
|
+
description: "Type generation script (SDK)",
|
|
441
|
+
required: false
|
|
442
|
+
}
|
|
443
|
+
};
|
|
444
|
+
ERROR_MESSAGES = {
|
|
445
|
+
SCRIPT_NOT_FOUND: (scriptName, expectedPath) => `${scriptName} not found
|
|
446
|
+
|
|
447
|
+
Expected location: ${expectedPath}`,
|
|
448
|
+
SEED_DIR_NOT_FOUND: "Seed directory not found\n\nRun: runa db seed init",
|
|
449
|
+
CONFIG_PARSE_FAILED: "Failed to parse config.toml, using default seed paths",
|
|
450
|
+
VALIDATION_FAILED: "Schema validation failed",
|
|
451
|
+
RISK_DETECTION_FAILED: "Risk detection failed",
|
|
452
|
+
SEED_VALIDATION_FAILED: "Seed validation failed",
|
|
453
|
+
TYPE_GENERATION_FAILED: "Type generation failed"
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
});
|
|
457
|
+
|
|
458
|
+
export { DATABASE_DEFAULTS, SCRIPT_LOCATIONS, SEED_DEFAULTS, buildLocalDatabaseUrl, constants_exports, detectLocalSupabasePorts, detectSupabasePorts, getLocalSupabaseEnvValues, getLocalValueDescriptions, init_constants, init_local_supabase };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'module';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
|
|
6
|
+
const require$1 = createRequire(import.meta.url);
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __require = /* @__PURE__ */ ((x) => typeof require$1 !== "undefined" ? require$1 : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
12
|
+
get: (a, b) => (typeof require$1 !== "undefined" ? require$1 : a)[b]
|
|
13
|
+
}) : x)(function(x) {
|
|
14
|
+
if (typeof require$1 !== "undefined") return require$1.apply(this, arguments);
|
|
15
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
16
|
+
});
|
|
17
|
+
var __esm = (fn, res) => function __init() {
|
|
18
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
19
|
+
};
|
|
20
|
+
var __export = (target, all) => {
|
|
21
|
+
for (var name in all)
|
|
22
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
23
|
+
};
|
|
24
|
+
var __copyProps = (to, from, except, desc) => {
|
|
25
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
26
|
+
for (let key of __getOwnPropNames(from))
|
|
27
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
28
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
29
|
+
}
|
|
30
|
+
return to;
|
|
31
|
+
};
|
|
32
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
33
|
+
var getFilename, getDirname, __dirname$1;
|
|
34
|
+
var init_esm_shims = __esm({
|
|
35
|
+
"../../node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_tsx@4.21.0_typescript@5.9.3_yaml@2.8.2/node_modules/tsup/assets/esm_shims.js"() {
|
|
36
|
+
getFilename = () => fileURLToPath(import.meta.url);
|
|
37
|
+
getDirname = () => path.dirname(getFilename());
|
|
38
|
+
__dirname$1 = /* @__PURE__ */ getDirname();
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export { __dirname$1 as __dirname, __esm, __export, __require, __toCommonJS, init_esm_shims };
|