@runa-ai/runa-cli 0.5.72 → 0.7.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-V66FAQXB.js +1719 -0
- package/dist/cache-N7WNPEYF.js +111 -0
- package/dist/check-LOMVIRHX.js +12 -0
- package/dist/chunk-2APB25TT.js +442 -0
- package/dist/chunk-3FDQW524.js +544 -0
- package/dist/chunk-3WDV32GA.js +33 -0
- package/dist/chunk-5FT3F36G.js +59 -0
- package/dist/chunk-5NKWR4FF.js +254 -0
- package/dist/chunk-644FVGIQ.js +194 -0
- package/dist/chunk-6AALH2ED.js +121 -0
- package/dist/chunk-6FAU4IGR.js +63 -0
- package/dist/chunk-6Y3LAUGL.js +35 -0
- package/dist/chunk-7B5C6U2K.js +274 -0
- package/dist/chunk-AAIE4F2U.js +140 -0
- package/dist/chunk-AIP6MR42.js +12 -0
- package/dist/chunk-CCKG5R4Y.js +59 -0
- package/dist/chunk-DRSUEMAK.js +123 -0
- package/dist/chunk-FHG3ILE4.js +2011 -0
- package/dist/chunk-H2AHNI75.js +31 -0
- package/dist/chunk-HD74F6W2.js +460 -0
- package/dist/chunk-HKUWEGUX.js +36 -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-KE6QJBZG.js +41 -0
- package/dist/chunk-KWX3JHCY.js +85 -0
- package/dist/chunk-MXRWBNIY.js +74 -0
- package/dist/chunk-NPSRD26F.js +149 -0
- package/dist/chunk-QDF7QXBL.js +67 -0
- package/dist/chunk-QM53IQHM.js +209 -0
- package/dist/chunk-RZLYEO4U.js +219 -0
- package/dist/chunk-SGJG3BKD.js +351 -0
- package/dist/chunk-TYIAD6SB.js +74 -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-WJXC4MVY.js +75 -0
- package/dist/chunk-XDCHRVE3.js +215 -0
- package/dist/chunk-Z4Z5DNW4.js +1196 -0
- package/dist/chunk-ZZOXM6Q4.js +8 -0
- package/dist/ci-ZWRVWNFX.js +9298 -0
- package/dist/cli/contract-output.d.ts +1 -0
- package/dist/cli/index.d.ts +7 -1
- package/dist/cli/requested-command.d.ts +8 -0
- package/dist/cli-2JNBJUBB.js +704 -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/actors/validate.d.ts +2 -0
- 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/check/commands/check.d.ts +8 -3
- package/dist/commands/ci/machine/actors/db/collect-schema-stats.d.ts +9 -6
- package/dist/commands/ci/machine/actors/db/schema-canonical-diff.d.ts +55 -0
- package/dist/commands/ci/machine/actors/db/schema-stats.d.ts +11 -0
- package/dist/commands/ci/machine/actors/db/sync-schema.d.ts +9 -1
- 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/formatters/sections/schema-matrix.d.ts +3 -3
- 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 +2 -5
- package/dist/commands/ci/utils/ci-summary.d.ts +15 -15
- package/dist/commands/ci/utils/execa-helpers.d.ts +2 -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/error-classifier.d.ts +9 -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 +12 -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/actors/tables-manifest.d.ts +16 -0
- package/dist/commands/dev/contract.d.ts +3 -3
- package/dist/commands/dev/guards.d.ts +24 -0
- package/dist/commands/dev/machine.d.ts +27 -32
- package/dist/commands/dev/types.d.ts +2 -0
- package/dist/commands/doctor.d.ts +9 -0
- 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/inject-test-attrs/defaults.d.ts +9 -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/commands/utils/machine-state-logging.d.ts +20 -0
- package/dist/commands/utils/repo-root.d.ts +2 -0
- package/dist/config/env.d.ts +4 -4
- package/dist/config-loader-GT3HAQ7U.js +7 -0
- package/dist/db-XULCILOU.js +14137 -0
- package/dist/dev-5YXNPTCJ.js +992 -0
- package/dist/doctor-MZLOA53G.js +44 -0
- package/dist/env-HMMRSYCI.js +7 -0
- package/dist/env-SS66PZ4B.js +2623 -0
- package/dist/env-files-2UIUYLLR.js +8 -0
- package/dist/error-handler-HEXBRNVV.js +460 -0
- package/dist/hotfix-YA3DGLOM.js +1477 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +48 -42995
- package/dist/init-ZIL6LRFO.js +631 -0
- package/dist/inject-test-attrs-P44BVTQS.js +23 -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-VSNDVZZD.js +59 -0
- package/dist/manifest-TMFLESHW.js +19 -0
- package/dist/prepare-32DOVHTE.js +250 -0
- package/dist/risk-detector-4U6ZJ2G5.js +6 -0
- package/dist/risk-detector-core-TK4OAI3N.js +166 -0
- package/dist/risk-detector-plpgsql-HWKS4OLR.js +1886 -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-UTKS63AB.js +94 -0
- package/dist/telemetry-P56UBLZ2.js +93 -0
- package/dist/template-check-3P4HZXVY.js +1944 -0
- package/dist/test-V4KQL574.js +650 -0
- package/dist/test-gen-FS4CEY3P.js +88 -0
- package/dist/ui-RJAMCWUI.js +331 -0
- package/dist/upgrade-NUK3ZBCL.js +637 -0
- package/dist/utils/config-loader.d.ts +0 -3
- package/dist/validate-CAAW4Y44.js +54 -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-2W7N5TA2.js +121 -0
- package/dist/vuln-checker-IQJ56RUV.js +3223 -0
- package/dist/watch-PNTKZYFB.js +911 -0
- package/dist/workflow-H75N4BXX.js +897 -0
- package/package.json +5 -2
- 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,274 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'module';
|
|
3
|
+
import { init_esm_shims } from './chunk-VRXHCR5K.js';
|
|
4
|
+
import { spawnSync } from 'child_process';
|
|
5
|
+
import { execa } from 'execa';
|
|
6
|
+
|
|
7
|
+
createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// src/commands/db/utils/psql.ts
|
|
10
|
+
init_esm_shims();
|
|
11
|
+
function parsePostgresUrl(url) {
|
|
12
|
+
const u = new URL(url);
|
|
13
|
+
const host = u.hostname;
|
|
14
|
+
const port = u.port || "5432";
|
|
15
|
+
const user = u.username || "postgres";
|
|
16
|
+
const password = u.password || void 0;
|
|
17
|
+
const database = u.pathname.replace(/^\//, "") || "postgres";
|
|
18
|
+
return { host, port, user, database, password };
|
|
19
|
+
}
|
|
20
|
+
function buildPsqlArgs(conn, options) {
|
|
21
|
+
const args = ["-X", "-h", conn.host, "-p", conn.port, "-U", conn.user, "-d", conn.database];
|
|
22
|
+
if (options?.onErrorStop !== false) {
|
|
23
|
+
args.splice(1, 0, "-v", "ON_ERROR_STOP=1");
|
|
24
|
+
}
|
|
25
|
+
return args;
|
|
26
|
+
}
|
|
27
|
+
function buildPsqlEnv(conn) {
|
|
28
|
+
if (!conn.password) return { ...process.env };
|
|
29
|
+
return { ...process.env, PGPASSWORD: conn.password };
|
|
30
|
+
}
|
|
31
|
+
function psqlSyncQuery(params) {
|
|
32
|
+
const conn = parsePostgresUrl(params.databaseUrl);
|
|
33
|
+
const args = buildPsqlArgs(conn, { onErrorStop: false });
|
|
34
|
+
const result = spawnSync("psql", [...args, "-t", "-c", params.sql], {
|
|
35
|
+
encoding: "utf-8",
|
|
36
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
37
|
+
env: buildPsqlEnv(conn),
|
|
38
|
+
timeout: params.timeout ?? 1e4
|
|
39
|
+
});
|
|
40
|
+
return {
|
|
41
|
+
status: result.status,
|
|
42
|
+
stdout: result.stdout || "",
|
|
43
|
+
stderr: result.stderr || ""
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function psqlSyncFile(params) {
|
|
47
|
+
const conn = parsePostgresUrl(params.databaseUrl);
|
|
48
|
+
const args = buildPsqlArgs(conn, { onErrorStop: params.onErrorStop ?? true });
|
|
49
|
+
const result = spawnSync("psql", [...args, "-f", params.filePath], {
|
|
50
|
+
encoding: "utf-8",
|
|
51
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
52
|
+
env: buildPsqlEnv(conn)
|
|
53
|
+
});
|
|
54
|
+
return {
|
|
55
|
+
status: result.status,
|
|
56
|
+
stdout: result.stdout || "",
|
|
57
|
+
stderr: result.stderr || ""
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
async function psqlQuery(params) {
|
|
61
|
+
const conn = parsePostgresUrl(params.databaseUrl);
|
|
62
|
+
const args = buildPsqlArgs(conn);
|
|
63
|
+
if (params.mode === "scalar") {
|
|
64
|
+
const { stdout: stdout2 } = await execa("psql", [...args, "-A", "-t", "-c", params.sql], {
|
|
65
|
+
env: buildPsqlEnv(conn),
|
|
66
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
67
|
+
});
|
|
68
|
+
return stdout2.trim();
|
|
69
|
+
}
|
|
70
|
+
const { stdout } = await execa("psql", [...args, "-A", "-t", "-c", params.sql], {
|
|
71
|
+
env: buildPsqlEnv(conn),
|
|
72
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
73
|
+
});
|
|
74
|
+
return stdout.trim();
|
|
75
|
+
}
|
|
76
|
+
async function psqlExec(params) {
|
|
77
|
+
const conn = parsePostgresUrl(params.databaseUrl);
|
|
78
|
+
const args = buildPsqlArgs(conn);
|
|
79
|
+
await execa("psql", [...args, "-c", params.sql], {
|
|
80
|
+
env: buildPsqlEnv(conn),
|
|
81
|
+
stdio: "inherit"
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// src/lib/sql-comment-utils.ts
|
|
86
|
+
init_esm_shims();
|
|
87
|
+
var DOLLAR_TAG_PATTERN = /^\$([a-zA-Z_][a-zA-Z0-9_]*)?\$/;
|
|
88
|
+
function isOutsideAllQuotes(state) {
|
|
89
|
+
return !state.inSingleQuote && !state.inDoubleQuote && !state.inDollarQuote;
|
|
90
|
+
}
|
|
91
|
+
function tryConsumeLineComment(content, state) {
|
|
92
|
+
if (!isOutsideAllQuotes(state)) return false;
|
|
93
|
+
if (content[state.i] !== "-" || content[state.i + 1] !== "-") return false;
|
|
94
|
+
while (state.i < content.length && content[state.i] !== "\n") {
|
|
95
|
+
state.result += " ";
|
|
96
|
+
state.i += 1;
|
|
97
|
+
}
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
function tryConsumeBlockComment(content, state) {
|
|
101
|
+
if (!isOutsideAllQuotes(state)) return false;
|
|
102
|
+
if (content[state.i] !== "/" || content[state.i + 1] !== "*") return false;
|
|
103
|
+
let depth = 1;
|
|
104
|
+
state.result += " ";
|
|
105
|
+
state.i += 2;
|
|
106
|
+
while (state.i < content.length && depth > 0) {
|
|
107
|
+
const current = content[state.i] ?? "";
|
|
108
|
+
const next = content[state.i + 1] ?? "";
|
|
109
|
+
if (current === "/" && next === "*") {
|
|
110
|
+
depth += 1;
|
|
111
|
+
state.result += " ";
|
|
112
|
+
state.i += 2;
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
if (current === "*" && next === "/") {
|
|
116
|
+
depth -= 1;
|
|
117
|
+
state.result += " ";
|
|
118
|
+
state.i += 2;
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
state.result += current === "\n" ? "\n" : " ";
|
|
122
|
+
state.i += 1;
|
|
123
|
+
}
|
|
124
|
+
return true;
|
|
125
|
+
}
|
|
126
|
+
function tryConsumeDollarQuoteDelimiter(content, state) {
|
|
127
|
+
if (state.inSingleQuote || state.inDoubleQuote) return false;
|
|
128
|
+
if (content[state.i] !== "$") return false;
|
|
129
|
+
if (state.inDollarQuote) {
|
|
130
|
+
const closeTag = `$${state.dollarTag}$`;
|
|
131
|
+
if (content.slice(state.i).startsWith(closeTag)) {
|
|
132
|
+
state.result += closeTag;
|
|
133
|
+
state.i += closeTag.length;
|
|
134
|
+
state.inDollarQuote = false;
|
|
135
|
+
state.dollarTag = "";
|
|
136
|
+
return true;
|
|
137
|
+
}
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
const tagMatch = content.slice(state.i).match(DOLLAR_TAG_PATTERN);
|
|
141
|
+
if (!tagMatch) return false;
|
|
142
|
+
state.inDollarQuote = true;
|
|
143
|
+
state.dollarTag = tagMatch[1] ?? "";
|
|
144
|
+
state.result += tagMatch[0];
|
|
145
|
+
state.i += tagMatch[0].length;
|
|
146
|
+
return true;
|
|
147
|
+
}
|
|
148
|
+
function consumeEQuotedString(content, state) {
|
|
149
|
+
state.result += content[state.i] ?? "";
|
|
150
|
+
state.result += "'";
|
|
151
|
+
state.i += 2;
|
|
152
|
+
while (state.i < content.length) {
|
|
153
|
+
const current = content[state.i] ?? "";
|
|
154
|
+
const next = content[state.i + 1] ?? "";
|
|
155
|
+
if (current === "\\" && state.i + 1 < content.length) {
|
|
156
|
+
state.result += current;
|
|
157
|
+
state.result += next;
|
|
158
|
+
state.i += 2;
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
if (current === "'") {
|
|
162
|
+
if (next === "'") {
|
|
163
|
+
state.result += "''";
|
|
164
|
+
state.i += 2;
|
|
165
|
+
continue;
|
|
166
|
+
}
|
|
167
|
+
state.result += current;
|
|
168
|
+
state.i += 1;
|
|
169
|
+
break;
|
|
170
|
+
}
|
|
171
|
+
state.result += current;
|
|
172
|
+
state.i += 1;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
function tryConsumeEQuotedString(content, state) {
|
|
176
|
+
if (!isOutsideAllQuotes(state)) return false;
|
|
177
|
+
const current = content[state.i] ?? "";
|
|
178
|
+
const next = content[state.i + 1] ?? "";
|
|
179
|
+
if (current !== "E" && current !== "e" || next !== "'") return false;
|
|
180
|
+
consumeEQuotedString(content, state);
|
|
181
|
+
return true;
|
|
182
|
+
}
|
|
183
|
+
function tryToggleSingleQuote(content, state) {
|
|
184
|
+
if (state.inDoubleQuote || state.inDollarQuote) return false;
|
|
185
|
+
if (content[state.i] !== "'") return false;
|
|
186
|
+
if (state.inSingleQuote && content[state.i + 1] === "'") {
|
|
187
|
+
state.result += "''";
|
|
188
|
+
state.i += 2;
|
|
189
|
+
return true;
|
|
190
|
+
}
|
|
191
|
+
state.inSingleQuote = !state.inSingleQuote;
|
|
192
|
+
state.result += "'";
|
|
193
|
+
state.i += 1;
|
|
194
|
+
return true;
|
|
195
|
+
}
|
|
196
|
+
function tryToggleDoubleQuote(content, state) {
|
|
197
|
+
if (state.inSingleQuote || state.inDollarQuote) return false;
|
|
198
|
+
if (content[state.i] !== '"') return false;
|
|
199
|
+
if (state.inDoubleQuote && content[state.i + 1] === '"') {
|
|
200
|
+
state.result += '""';
|
|
201
|
+
state.i += 2;
|
|
202
|
+
return true;
|
|
203
|
+
}
|
|
204
|
+
state.inDoubleQuote = !state.inDoubleQuote;
|
|
205
|
+
state.result += '"';
|
|
206
|
+
state.i += 1;
|
|
207
|
+
return true;
|
|
208
|
+
}
|
|
209
|
+
function stripSqlComments(content) {
|
|
210
|
+
const state = {
|
|
211
|
+
i: 0,
|
|
212
|
+
result: "",
|
|
213
|
+
inSingleQuote: false,
|
|
214
|
+
inDoubleQuote: false,
|
|
215
|
+
inDollarQuote: false,
|
|
216
|
+
dollarTag: ""
|
|
217
|
+
};
|
|
218
|
+
while (state.i < content.length) {
|
|
219
|
+
if (tryConsumeLineComment(content, state)) continue;
|
|
220
|
+
if (tryConsumeBlockComment(content, state)) continue;
|
|
221
|
+
if (tryConsumeDollarQuoteDelimiter(content, state)) continue;
|
|
222
|
+
if (tryConsumeEQuotedString(content, state)) continue;
|
|
223
|
+
if (tryToggleSingleQuote(content, state)) continue;
|
|
224
|
+
if (tryToggleDoubleQuote(content, state)) continue;
|
|
225
|
+
state.result += content[state.i] ?? "";
|
|
226
|
+
state.i += 1;
|
|
227
|
+
}
|
|
228
|
+
return state.result;
|
|
229
|
+
}
|
|
230
|
+
function blankDollarQuotedBodies(content) {
|
|
231
|
+
let result = "";
|
|
232
|
+
let i = 0;
|
|
233
|
+
while (i < content.length) {
|
|
234
|
+
const handled = consumeDollarQuotedBody(content, i);
|
|
235
|
+
if (!handled) {
|
|
236
|
+
result += content[i] ?? "";
|
|
237
|
+
i += 1;
|
|
238
|
+
continue;
|
|
239
|
+
}
|
|
240
|
+
result += handled.value;
|
|
241
|
+
i = handled.next;
|
|
242
|
+
}
|
|
243
|
+
return result;
|
|
244
|
+
}
|
|
245
|
+
function parseDollarTagAt(content, index) {
|
|
246
|
+
if (content[index] !== "$") return null;
|
|
247
|
+
const tagMatch = content.slice(index).match(DOLLAR_TAG_PATTERN);
|
|
248
|
+
return tagMatch ? tagMatch[0] : null;
|
|
249
|
+
}
|
|
250
|
+
function blankRangePreservingNewlines(content, start, end) {
|
|
251
|
+
let result = "";
|
|
252
|
+
for (let i = start; i < end; i += 1) {
|
|
253
|
+
result += content[i] === "\n" ? "\n" : " ";
|
|
254
|
+
}
|
|
255
|
+
return result;
|
|
256
|
+
}
|
|
257
|
+
function consumeDollarQuotedBody(content, index) {
|
|
258
|
+
const openTag = parseDollarTagAt(content, index);
|
|
259
|
+
if (!openTag) return null;
|
|
260
|
+
const bodyStart = index + openTag.length;
|
|
261
|
+
const closeIdx = content.indexOf(openTag, bodyStart);
|
|
262
|
+
if (closeIdx < 0) {
|
|
263
|
+
return {
|
|
264
|
+
value: `${openTag}${blankRangePreservingNewlines(content, bodyStart, content.length)}`,
|
|
265
|
+
next: content.length
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
return {
|
|
269
|
+
value: `${openTag}${blankRangePreservingNewlines(content, bodyStart, closeIdx)}${openTag}`,
|
|
270
|
+
next: closeIdx + openTag.length
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export { blankDollarQuotedBodies, buildPsqlArgs, buildPsqlEnv, parsePostgresUrl, psqlExec, psqlQuery, psqlSyncFile, psqlSyncQuery, stripSqlComments };
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'module';
|
|
3
|
+
import { secureDocker, secureExeca } from './chunk-RZLYEO4U.js';
|
|
4
|
+
import { init_esm_shims } from './chunk-VRXHCR5K.js';
|
|
5
|
+
import { existsSync, readFileSync } from 'fs';
|
|
6
|
+
import path from 'path';
|
|
7
|
+
|
|
8
|
+
createRequire(import.meta.url);
|
|
9
|
+
|
|
10
|
+
// src/utils/diagnostics.ts
|
|
11
|
+
init_esm_shims();
|
|
12
|
+
async function checkDocker() {
|
|
13
|
+
try {
|
|
14
|
+
await secureDocker(["ps"]);
|
|
15
|
+
return {
|
|
16
|
+
severity: "info",
|
|
17
|
+
message: "Docker is running"
|
|
18
|
+
};
|
|
19
|
+
} catch {
|
|
20
|
+
return {
|
|
21
|
+
severity: "error",
|
|
22
|
+
message: "Docker is not running or not installed",
|
|
23
|
+
fixInstructions: [
|
|
24
|
+
"Start Colima: colima start --cpu 4 --memory 8 --disk 60 --vm-type vz --mount-type virtiofs",
|
|
25
|
+
"Install Colima: brew install colima docker",
|
|
26
|
+
"Linux: sudo systemctl start docker"
|
|
27
|
+
]
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
async function checkPort(port) {
|
|
32
|
+
try {
|
|
33
|
+
const result = await secureExeca("lsof", ["-i", `:${port}`]);
|
|
34
|
+
const stdout = typeof result.stdout === "string" ? result.stdout : "";
|
|
35
|
+
const lines = stdout.trim().split("\n");
|
|
36
|
+
if (lines.length > 1) {
|
|
37
|
+
const processInfo = lines[1].split(/\s+/);
|
|
38
|
+
const processName = processInfo[0];
|
|
39
|
+
const pid = processInfo[1];
|
|
40
|
+
return {
|
|
41
|
+
severity: "warning",
|
|
42
|
+
message: `Port ${port} is in use by ${processName} (PID: ${pid})`,
|
|
43
|
+
fixInstructions: [
|
|
44
|
+
`Kill the process: kill ${pid}`,
|
|
45
|
+
"Or use a different port in your configuration"
|
|
46
|
+
]
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
} catch {
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
severity: "info",
|
|
53
|
+
message: `Port ${port} is available`
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function detectSupabasePortsFromConfig() {
|
|
57
|
+
const configPath = path.join(process.cwd(), "supabase", "config.toml");
|
|
58
|
+
const BASE_PORTS = { api: 54321, db: 54322, studio: 54323, inbucket: 54324 };
|
|
59
|
+
if (!existsSync(configPath)) {
|
|
60
|
+
return Object.values(BASE_PORTS);
|
|
61
|
+
}
|
|
62
|
+
try {
|
|
63
|
+
const content = readFileSync(configPath, "utf-8");
|
|
64
|
+
const ports = [];
|
|
65
|
+
const apiMatch = content.match(/\[api\][\s\S]*?port\s*=\s*(\d+)/);
|
|
66
|
+
ports.push(apiMatch ? Number.parseInt(apiMatch[1], 10) : BASE_PORTS.api);
|
|
67
|
+
const dbMatch = content.match(/\[db\][\s\S]*?port\s*=\s*(\d+)/);
|
|
68
|
+
ports.push(dbMatch ? Number.parseInt(dbMatch[1], 10) : BASE_PORTS.db);
|
|
69
|
+
const studioMatch = content.match(/\[studio\][\s\S]*?port\s*=\s*(\d+)/);
|
|
70
|
+
ports.push(studioMatch ? Number.parseInt(studioMatch[1], 10) : BASE_PORTS.studio);
|
|
71
|
+
const inbucketMatch = content.match(/\[inbucket\][\s\S]*?port\s*=\s*(\d+)/);
|
|
72
|
+
ports.push(inbucketMatch ? Number.parseInt(inbucketMatch[1], 10) : BASE_PORTS.inbucket);
|
|
73
|
+
return ports;
|
|
74
|
+
} catch {
|
|
75
|
+
return Object.values(BASE_PORTS);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
async function checkSupabasePorts() {
|
|
79
|
+
const ports = detectSupabasePortsFromConfig();
|
|
80
|
+
const results = [];
|
|
81
|
+
for (const port of ports) {
|
|
82
|
+
const result = await checkPort(port);
|
|
83
|
+
if (result.severity !== "info") {
|
|
84
|
+
results.push(result);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return results;
|
|
88
|
+
}
|
|
89
|
+
function checkRequiredFiles(files) {
|
|
90
|
+
const results = [];
|
|
91
|
+
for (const file of files) {
|
|
92
|
+
if (!existsSync(file)) {
|
|
93
|
+
results.push({
|
|
94
|
+
severity: "error",
|
|
95
|
+
message: `Required file not found: ${file}`,
|
|
96
|
+
fixInstructions: [`Create ${file} or run 'runa init' to set up the project`]
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return results;
|
|
101
|
+
}
|
|
102
|
+
async function diagnoseSupabaseStart() {
|
|
103
|
+
const results = [];
|
|
104
|
+
const dockerCheck = await checkDocker();
|
|
105
|
+
if (dockerCheck.severity === "error") {
|
|
106
|
+
results.push(dockerCheck);
|
|
107
|
+
}
|
|
108
|
+
const portChecks = await checkSupabasePorts();
|
|
109
|
+
results.push(...portChecks);
|
|
110
|
+
const configCheck = checkRequiredFiles(["supabase/config.toml"]);
|
|
111
|
+
results.push(...configCheck);
|
|
112
|
+
return results;
|
|
113
|
+
}
|
|
114
|
+
function diagnoseInitFailure(errorMessage) {
|
|
115
|
+
const results = [];
|
|
116
|
+
if (errorMessage.includes("templates directory not found")) {
|
|
117
|
+
results.push({
|
|
118
|
+
severity: "error",
|
|
119
|
+
message: "@runa-ai/runa is not installed correctly",
|
|
120
|
+
fixInstructions: [
|
|
121
|
+
"Verify installation: pnpm list @runa-ai/runa",
|
|
122
|
+
"Reinstall: pnpm add -D @runa-ai/runa",
|
|
123
|
+
"Ensure you are in the project root directory"
|
|
124
|
+
]
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
if (errorMessage.includes("package.json")) {
|
|
128
|
+
results.push({
|
|
129
|
+
severity: "error",
|
|
130
|
+
message: "Not in a valid Node.js project",
|
|
131
|
+
fixInstructions: [
|
|
132
|
+
"Run from project root (where package.json exists)",
|
|
133
|
+
"Or initialize new project: pnpm init"
|
|
134
|
+
]
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
return results;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export { diagnoseInitFailure, diagnoseSupabaseStart };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'module';
|
|
3
|
+
import { init_esm_shims } from './chunk-VRXHCR5K.js';
|
|
4
|
+
|
|
5
|
+
createRequire(import.meta.url);
|
|
6
|
+
|
|
7
|
+
// src/version.ts
|
|
8
|
+
init_esm_shims();
|
|
9
|
+
var CLI_VERSION = "0.7.0";
|
|
10
|
+
var HAS_ADMIN_COMMAND = false;
|
|
11
|
+
|
|
12
|
+
export { CLI_VERSION, HAS_ADMIN_COMMAND };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'module';
|
|
3
|
+
import { getDatabasePackagePath } from './chunk-5NKWR4FF.js';
|
|
4
|
+
import { init_esm_shims } from './chunk-VRXHCR5K.js';
|
|
5
|
+
import { existsSync } from 'fs';
|
|
6
|
+
import { join } from 'path';
|
|
7
|
+
|
|
8
|
+
createRequire(import.meta.url);
|
|
9
|
+
|
|
10
|
+
// src/commands/db/utils/stack-detector.ts
|
|
11
|
+
init_esm_shims();
|
|
12
|
+
async function detectDatabaseStack(cwd = process.cwd()) {
|
|
13
|
+
try {
|
|
14
|
+
const dbPackagePath = await getDatabasePackagePath(cwd);
|
|
15
|
+
const drizzleConfig = join(dbPackagePath, "drizzle.config.ts");
|
|
16
|
+
if (existsSync(drizzleConfig)) {
|
|
17
|
+
return {
|
|
18
|
+
stack: "drizzle",
|
|
19
|
+
confidence: "high",
|
|
20
|
+
reason: `Found drizzle.config.ts at ${dbPackagePath}`,
|
|
21
|
+
paths: { drizzleConfig }
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
} catch {
|
|
25
|
+
}
|
|
26
|
+
const supabaseSchemas = join(cwd, "supabase/schemas");
|
|
27
|
+
if (existsSync(supabaseSchemas)) {
|
|
28
|
+
return {
|
|
29
|
+
stack: "supabase",
|
|
30
|
+
confidence: "high",
|
|
31
|
+
reason: "Found supabase/schemas/ directory",
|
|
32
|
+
paths: { supabaseSchemas }
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
throw new Error(
|
|
36
|
+
"Unable to detect database stack.\nExpected one of:\n - drizzle.config.ts in database package (Drizzle ORM)\n - supabase/schemas/ (Supabase SQL)\n\nRun `runa init` to set up your database structure."
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
async function getStackPaths(stack, cwd = process.cwd()) {
|
|
40
|
+
if (stack === "drizzle") {
|
|
41
|
+
const dbPath = await getDatabasePackagePath(cwd);
|
|
42
|
+
return {
|
|
43
|
+
rootDir: dbPath,
|
|
44
|
+
schemaDir: join(dbPath, "src/schema"),
|
|
45
|
+
configFile: join(dbPath, "drizzle.config.ts")
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
if (stack === "supabase") {
|
|
49
|
+
const schemasDir = join(cwd, "supabase/schemas");
|
|
50
|
+
return {
|
|
51
|
+
rootDir: join(cwd, "supabase"),
|
|
52
|
+
schemaDir: schemasDir,
|
|
53
|
+
configFile: join(cwd, "supabase/config.toml")
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
throw new Error(`Unknown stack: ${stack}`);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export { detectDatabaseStack, getStackPaths };
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'module';
|
|
3
|
+
import { init_esm_shims } from './chunk-VRXHCR5K.js';
|
|
4
|
+
import { existsSync, realpathSync } from 'fs';
|
|
5
|
+
import { resolve, sep, isAbsolute, relative, normalize } from 'path';
|
|
6
|
+
|
|
7
|
+
createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// src/utils/path-security.ts
|
|
10
|
+
init_esm_shims();
|
|
11
|
+
function safeRealpath(targetPath) {
|
|
12
|
+
try {
|
|
13
|
+
if (existsSync(targetPath)) {
|
|
14
|
+
return realpathSync(targetPath);
|
|
15
|
+
}
|
|
16
|
+
return targetPath;
|
|
17
|
+
} catch {
|
|
18
|
+
return targetPath;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
var SHELL_METACHARACTERS = /[|;`$&<>]/;
|
|
22
|
+
function isControlChar(charCode) {
|
|
23
|
+
return charCode <= 31 || charCode === 127;
|
|
24
|
+
}
|
|
25
|
+
function hasNoDangerousChars(userPath) {
|
|
26
|
+
if (SHELL_METACHARACTERS.test(userPath)) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
for (let i = 0; i < userPath.length; i++) {
|
|
30
|
+
if (isControlChar(userPath.charCodeAt(i))) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
function containsPathTraversal(userPath) {
|
|
37
|
+
const normalized = normalize(userPath);
|
|
38
|
+
if (normalized.includes("..")) {
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
if (normalized.startsWith("/") || normalized.startsWith("\\")) {
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
function validateSafePath(userPath, baseDir) {
|
|
47
|
+
if (!userPath || userPath.trim() === "") {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
if (!hasNoDangerousChars(userPath)) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
if (containsPathTraversal(userPath)) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
const absoluteBase = resolve(baseDir);
|
|
57
|
+
const absolutePath = resolve(baseDir, userPath);
|
|
58
|
+
const realBase = safeRealpath(absoluteBase);
|
|
59
|
+
const realPath = safeRealpath(absolutePath);
|
|
60
|
+
const relativePath = relative(realBase, realPath);
|
|
61
|
+
if (relativePath.startsWith("..") || isAbsolute(relativePath)) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
function resolveSafePath(baseDir, userPath) {
|
|
67
|
+
if (!validateSafePath(userPath, baseDir)) {
|
|
68
|
+
throw new Error(
|
|
69
|
+
`Invalid path: '${userPath}' is not allowed. Path must be relative and within the base directory.`
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
return resolve(baseDir, userPath);
|
|
73
|
+
}
|
|
74
|
+
function filterSafePaths(paths, baseDir, logger) {
|
|
75
|
+
return paths.filter((p) => {
|
|
76
|
+
const safe = validateSafePath(p, baseDir);
|
|
77
|
+
if (!safe && logger) {
|
|
78
|
+
logger.warn(`Rejected unsafe path: '${p}'`);
|
|
79
|
+
}
|
|
80
|
+
return safe;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
var MAX_DIRECTORY_TRAVERSAL_DEPTH = 10;
|
|
84
|
+
var SAFE_ENV_SUFFIX_PATTERN = /^[a-zA-Z0-9._-]+$/;
|
|
85
|
+
function validateEnvSuffix(suffix) {
|
|
86
|
+
if (!suffix || suffix.trim() === "") {
|
|
87
|
+
throw new Error("Environment suffix cannot be empty");
|
|
88
|
+
}
|
|
89
|
+
if (suffix.includes("..") || suffix.includes("/") || suffix.includes("\\")) {
|
|
90
|
+
throw new Error(`Environment suffix '${suffix}' contains path traversal sequences`);
|
|
91
|
+
}
|
|
92
|
+
if (!SAFE_ENV_SUFFIX_PATTERN.test(suffix)) {
|
|
93
|
+
throw new Error(
|
|
94
|
+
`Environment suffix '${suffix}' contains invalid characters. Only alphanumeric, dots, hyphens, and underscores are allowed.`
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
function isPathContained(basePath, targetPath) {
|
|
99
|
+
const normalizedBase = resolve(basePath);
|
|
100
|
+
const normalizedTarget = resolve(targetPath);
|
|
101
|
+
const realBase = safeRealpath(normalizedBase);
|
|
102
|
+
const realTarget = safeRealpath(normalizedTarget);
|
|
103
|
+
return realTarget === realBase || realTarget.startsWith(realBase + sep);
|
|
104
|
+
}
|
|
105
|
+
function validateUserFilePath(filePath, baseDir) {
|
|
106
|
+
if (!filePath || filePath.trim() === "") {
|
|
107
|
+
throw new Error("File path cannot be empty");
|
|
108
|
+
}
|
|
109
|
+
if (!hasNoDangerousChars(filePath)) {
|
|
110
|
+
throw new Error(
|
|
111
|
+
"File path contains dangerous characters. Shell metacharacters and control characters are not allowed."
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
const resolvedPath = isAbsolute(filePath) ? resolve(filePath) : resolve(baseDir, filePath);
|
|
115
|
+
if (!isPathContained(baseDir, resolvedPath)) {
|
|
116
|
+
throw new Error(
|
|
117
|
+
"File path resolves outside the allowed directory. Path must be within the project root."
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
return resolvedPath;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export { MAX_DIRECTORY_TRAVERSAL_DEPTH, filterSafePaths, isPathContained, resolveSafePath, validateEnvSuffix, validateUserFilePath };
|