@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,637 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'module';
|
|
3
|
+
import { fetchTemplates } from './chunk-SGJG3BKD.js';
|
|
4
|
+
import { updateRunaConfigSdkVersion } from './chunk-6AALH2ED.js';
|
|
5
|
+
import './chunk-DRSUEMAK.js';
|
|
6
|
+
import './chunk-RZLYEO4U.js';
|
|
7
|
+
import { emitJsonSuccess } from './chunk-KE6QJBZG.js';
|
|
8
|
+
import './chunk-WJXC4MVY.js';
|
|
9
|
+
import './chunk-HKUWEGUX.js';
|
|
10
|
+
import { init_esm_shims } from './chunk-VRXHCR5K.js';
|
|
11
|
+
import { createCLILogger, CLIError, UpgradeTransaction, readRunaVersion, syncTemplates, SyncOutputSchema, findConflictFiles, preCheckSync } from '@runa-ai/runa';
|
|
12
|
+
import { Command } from 'commander';
|
|
13
|
+
import { execa } from 'execa';
|
|
14
|
+
|
|
15
|
+
createRequire(import.meta.url);
|
|
16
|
+
|
|
17
|
+
// src/commands/upgrade.ts
|
|
18
|
+
init_esm_shims();
|
|
19
|
+
var VALID_CATEGORIES = ["rules", "workflows", "config", "packages"];
|
|
20
|
+
function parseOnlyOption(only) {
|
|
21
|
+
if (!only) return [];
|
|
22
|
+
const categories = only.split(",").map((c) => c.trim().toLowerCase());
|
|
23
|
+
const valid = [];
|
|
24
|
+
const invalid = [];
|
|
25
|
+
for (const cat of categories) {
|
|
26
|
+
if (VALID_CATEGORIES.includes(cat)) {
|
|
27
|
+
valid.push(cat);
|
|
28
|
+
} else {
|
|
29
|
+
invalid.push(cat);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (invalid.length > 0) {
|
|
33
|
+
throw new CLIError(`Invalid category: ${invalid.join(", ")}`, "INVALID_UPGRADE_CATEGORY", [
|
|
34
|
+
`Valid categories: ${VALID_CATEGORIES.join(", ")}`
|
|
35
|
+
]);
|
|
36
|
+
}
|
|
37
|
+
return valid;
|
|
38
|
+
}
|
|
39
|
+
function logVersionInfo(logger, preCheck) {
|
|
40
|
+
if (preCheck.versionJump) {
|
|
41
|
+
const { from, to, isMajor, distance } = preCheck.versionJump;
|
|
42
|
+
logger.info("");
|
|
43
|
+
if (isMajor) {
|
|
44
|
+
logger.warn(`\u26A0\uFE0F MAJOR version jump: v${from} \u2192 v${to}`);
|
|
45
|
+
logger.warn(" Breaking changes may require manual migration.");
|
|
46
|
+
} else if (distance >= 5) {
|
|
47
|
+
logger.warn(`\u26A0\uFE0F Version jump: v${from} \u2192 v${to} (${distance} minor versions)`);
|
|
48
|
+
} else {
|
|
49
|
+
logger.info(`Version: v${from} \u2192 v${to}`);
|
|
50
|
+
}
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (preCheck.currentVersion) {
|
|
54
|
+
logger.info(`Version: v${preCheck.currentVersion} (no update)`);
|
|
55
|
+
} else {
|
|
56
|
+
logger.info(`Version: v${preCheck.targetVersion} (first sync)`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function logConflictSummary(logger, preCheck, isNonInteractive, isPreview) {
|
|
60
|
+
if (preCheck.summary.willConflict === 0) return;
|
|
61
|
+
logger.info("");
|
|
62
|
+
logger.warn(`\u26A0\uFE0F ${preCheck.summary.willConflict} file(s) will have conflicts:`);
|
|
63
|
+
for (const conflict of preCheck.conflicts.slice(0, 5)) {
|
|
64
|
+
logger.warn(` - ${conflict}`);
|
|
65
|
+
}
|
|
66
|
+
if (preCheck.conflicts.length > 5) {
|
|
67
|
+
logger.warn(` ... and ${preCheck.conflicts.length - 5} more`);
|
|
68
|
+
}
|
|
69
|
+
logger.info("");
|
|
70
|
+
logger.info("Options:");
|
|
71
|
+
logger.info(" \u2022 Continue: Merge markers will be added (resolve manually)");
|
|
72
|
+
logger.info(" \u2022 --force: Overwrite all files with SDK versions");
|
|
73
|
+
logger.info(" \u2022 --keep-local: Skip conflicts, keep your versions");
|
|
74
|
+
if (!isNonInteractive && !isPreview) {
|
|
75
|
+
logger.info("");
|
|
76
|
+
logger.info("Continue with upgrade? (use --yes to skip this prompt)");
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function logPreCheckSummary(logger, preCheck) {
|
|
80
|
+
const { willCreate, willUpdate, willConflict, unchanged } = preCheck.summary;
|
|
81
|
+
if (willCreate + willUpdate + willConflict > 0) {
|
|
82
|
+
logger.info("");
|
|
83
|
+
logger.info(
|
|
84
|
+
`Pre-check: ${willCreate} create, ${willUpdate} update, ${willConflict} conflict, ${unchanged} unchanged`
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function logTier2Info(logger, preCheck, isPreview) {
|
|
89
|
+
if (!isPreview || !preCheck.tier2Files || preCheck.tier2Files.length === 0) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
93
|
+
for (const file of preCheck.tier2Files) {
|
|
94
|
+
const existing = grouped.get(file.reason) ?? [];
|
|
95
|
+
existing.push(file.path);
|
|
96
|
+
grouped.set(file.reason, existing);
|
|
97
|
+
}
|
|
98
|
+
logger.info("");
|
|
99
|
+
logger.warn("\u2501\u2501\u2501 TIER2 Files (init-only, will NOT be synced) \u2501\u2501\u2501");
|
|
100
|
+
logger.info("");
|
|
101
|
+
logger.info("These files were copied during `runa init` but are NOT updated on `runa upgrade`.");
|
|
102
|
+
logger.info("If you need SDK updates for these files, manually review the SDK templates.");
|
|
103
|
+
logger.info("");
|
|
104
|
+
for (const [reason, files] of grouped) {
|
|
105
|
+
logger.info(`${reason}:`);
|
|
106
|
+
const shown = files.slice(0, 3);
|
|
107
|
+
for (const file of shown) {
|
|
108
|
+
logger.info(` - ${file}`);
|
|
109
|
+
}
|
|
110
|
+
if (files.length > 3) {
|
|
111
|
+
logger.info(` ... and ${files.length - 3} more`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
logger.info("");
|
|
115
|
+
logger.info("Note: Some TIER2 files have TIER1 overrides (SDK-managed):");
|
|
116
|
+
logger.info(" - config/vitest/ \u2192 Test configs (SDK-managed)");
|
|
117
|
+
logger.info(" - supabase/schemas/idempotent/ \u2192 Extensions (SDK-managed)");
|
|
118
|
+
logger.info(" - supabase/tests/ \u2192 pgTAP helpers (SDK-managed)");
|
|
119
|
+
logger.info("");
|
|
120
|
+
}
|
|
121
|
+
function logModeInfo(logger, options, categories) {
|
|
122
|
+
if (options.preview) {
|
|
123
|
+
logger.info("");
|
|
124
|
+
logger.info("Mode: preview (dry-run)");
|
|
125
|
+
}
|
|
126
|
+
if (options.force) {
|
|
127
|
+
logger.warn("Mode: force (overwrite all)");
|
|
128
|
+
logger.warn("");
|
|
129
|
+
logger.warn("\u26A0\uFE0F TIER2 files will also be overwritten:");
|
|
130
|
+
logger.warn(" - biome.json (linter config)");
|
|
131
|
+
logger.warn(" - runa.config.ts (project config)");
|
|
132
|
+
logger.warn(" - supabase/config.toml (local dev config)");
|
|
133
|
+
logger.warn(" - .npmrc (npm registry config)");
|
|
134
|
+
logger.warn("");
|
|
135
|
+
logger.warn("To preserve these files, add them to .runaignore");
|
|
136
|
+
}
|
|
137
|
+
if (options.keepLocal) {
|
|
138
|
+
logger.info("Mode: keep-local (skip conflicts)");
|
|
139
|
+
}
|
|
140
|
+
if (categories && categories.length > 0) {
|
|
141
|
+
logger.info(`Mode: partial upgrade (only: ${categories.join(", ")})`);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
function logChanges(logger, changes, isPreview) {
|
|
145
|
+
const created = changes.filter((c) => c.action === "create");
|
|
146
|
+
const updated = changes.filter((c) => c.action === "update");
|
|
147
|
+
const conflicts = changes.filter((c) => c.action === "conflict");
|
|
148
|
+
const skipped = changes.filter((c) => c.action === "skipped");
|
|
149
|
+
if (created.length > 0) {
|
|
150
|
+
logger.info("Created:");
|
|
151
|
+
for (const c of created) {
|
|
152
|
+
logger.info(` + ${c.path}`);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
if (updated.length > 0) {
|
|
156
|
+
logger.info("Updated:");
|
|
157
|
+
for (const c of updated) {
|
|
158
|
+
logger.info(` ~ ${c.path}`);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
if (conflicts.length > 0) {
|
|
162
|
+
logger.warn("Conflicts (merge markers added):");
|
|
163
|
+
for (const c of conflicts) {
|
|
164
|
+
logger.warn(` ! ${c.path}`);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
if (skipped.length > 0 && isPreview) {
|
|
168
|
+
logSkippedWithDiff(logger, skipped);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
function logSkippedWithDiff(logger, skipped) {
|
|
172
|
+
logger.info("Skipped:");
|
|
173
|
+
for (const c of skipped) {
|
|
174
|
+
const reason = c.reason ? ` (${c.reason})` : "";
|
|
175
|
+
logger.info(` - ${c.path}${reason}`);
|
|
176
|
+
if (c.diff) {
|
|
177
|
+
logger.info("");
|
|
178
|
+
logDiffLines(logger, c.diff);
|
|
179
|
+
logger.info("");
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
function logDiffLines(logger, diff) {
|
|
184
|
+
for (const line of diff.split("\n")) {
|
|
185
|
+
if (line.startsWith("+") && !line.startsWith("+++")) {
|
|
186
|
+
logger.info(` \x1B[32m${line}\x1B[0m`);
|
|
187
|
+
} else if (line.startsWith("-") && !line.startsWith("---")) {
|
|
188
|
+
logger.info(` \x1B[31m${line}\x1B[0m`);
|
|
189
|
+
} else if (line.startsWith("@@")) {
|
|
190
|
+
logger.info(` \x1B[36m${line}\x1B[0m`);
|
|
191
|
+
} else {
|
|
192
|
+
logger.info(` ${line}`);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
function logConflictGuidance(logger, conflictFiles) {
|
|
197
|
+
if (conflictFiles.length === 0) return;
|
|
198
|
+
logger.warn("");
|
|
199
|
+
logger.warn(`${conflictFiles.length} file(s) have merge markers.`);
|
|
200
|
+
logger.warn("");
|
|
201
|
+
logger.warn("\u2501\u2501\u2501 Conflict Resolution Steps \u2501\u2501\u2501");
|
|
202
|
+
logger.warn("");
|
|
203
|
+
logger.warn("1. Open each file and look for merge markers:");
|
|
204
|
+
logger.warn(" <<<<<<< LOCAL (your version)");
|
|
205
|
+
logger.warn(" [your customized content]");
|
|
206
|
+
logger.warn(" =======");
|
|
207
|
+
logger.warn(" [SDK updated content]");
|
|
208
|
+
logger.warn(" >>>>>>> SDK (vX.Y.Z)");
|
|
209
|
+
logger.warn("");
|
|
210
|
+
logger.warn("2. For each conflict, choose:");
|
|
211
|
+
logger.warn(" - Keep LOCAL: Remove SDK section and markers");
|
|
212
|
+
logger.warn(" - Use SDK: Remove LOCAL section and markers");
|
|
213
|
+
logger.warn(" - Merge both: Combine changes and remove markers");
|
|
214
|
+
logger.warn("");
|
|
215
|
+
logger.warn("Files to resolve:");
|
|
216
|
+
for (const file of conflictFiles) {
|
|
217
|
+
logger.warn(` - ${file}`);
|
|
218
|
+
}
|
|
219
|
+
logger.warn("");
|
|
220
|
+
logger.warn("3. After resolving, validate:");
|
|
221
|
+
logger.warn(" runa test --layer 0");
|
|
222
|
+
logger.warn("");
|
|
223
|
+
logger.warn("Tip: Use --force to overwrite all, --keep-local to skip conflicts");
|
|
224
|
+
}
|
|
225
|
+
async function runVerification(logger) {
|
|
226
|
+
logger.info("");
|
|
227
|
+
logger.section("Post-Upgrade Verification");
|
|
228
|
+
const steps = [
|
|
229
|
+
{ name: "type-check", command: "turbo", args: ["type-check"] },
|
|
230
|
+
{ name: "lint", command: "turbo", args: ["lint"] },
|
|
231
|
+
{ name: "build", command: "turbo", args: ["build"] }
|
|
232
|
+
];
|
|
233
|
+
let allPassed = true;
|
|
234
|
+
for (const step of steps) {
|
|
235
|
+
logger.info(`Running ${step.name}...`);
|
|
236
|
+
try {
|
|
237
|
+
await execa(step.command, step.args, {
|
|
238
|
+
cwd: process.cwd(),
|
|
239
|
+
stdio: "inherit"
|
|
240
|
+
});
|
|
241
|
+
logger.info(`\u2713 ${step.name} passed`);
|
|
242
|
+
} catch {
|
|
243
|
+
logger.warn(`\u2717 ${step.name} failed`);
|
|
244
|
+
allPassed = false;
|
|
245
|
+
}
|
|
246
|
+
logger.info("");
|
|
247
|
+
}
|
|
248
|
+
if (allPassed) {
|
|
249
|
+
logger.info("All verification steps passed.");
|
|
250
|
+
} else {
|
|
251
|
+
logger.warn("Some verification steps failed. Please fix the issues above.");
|
|
252
|
+
logger.info("");
|
|
253
|
+
logger.info("Common fixes:");
|
|
254
|
+
logger.info(" \u2022 Type errors: Check updated dependencies or API changes");
|
|
255
|
+
logger.info(" \u2022 Lint errors: Run `turbo lint --fix` to auto-fix");
|
|
256
|
+
logger.info(" \u2022 Build errors: Check runa.config.ts or package versions");
|
|
257
|
+
}
|
|
258
|
+
return allPassed;
|
|
259
|
+
}
|
|
260
|
+
async function findWorkspacesWithSdkPackages(rootDir, packageNames) {
|
|
261
|
+
const fs = await import('fs/promises');
|
|
262
|
+
const path = await import('path');
|
|
263
|
+
const { glob } = await import('glob');
|
|
264
|
+
const result = [];
|
|
265
|
+
const packageJsonPaths = await glob("**/package.json", {
|
|
266
|
+
cwd: rootDir,
|
|
267
|
+
ignore: ["**/node_modules/**", "package.json"]
|
|
268
|
+
// Exclude root
|
|
269
|
+
});
|
|
270
|
+
for (const relPath of packageJsonPaths) {
|
|
271
|
+
const fullPath = path.join(rootDir, relPath);
|
|
272
|
+
try {
|
|
273
|
+
const content = await fs.readFile(fullPath, "utf-8");
|
|
274
|
+
const pkg = JSON.parse(content);
|
|
275
|
+
let hasAnySdkPackage = false;
|
|
276
|
+
for (const pkgName of packageNames) {
|
|
277
|
+
if (pkg.dependencies?.[pkgName] || pkg.devDependencies?.[pkgName]) {
|
|
278
|
+
hasAnySdkPackage = true;
|
|
279
|
+
break;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
if (hasAnySdkPackage) {
|
|
283
|
+
result.push({
|
|
284
|
+
dir: path.dirname(fullPath),
|
|
285
|
+
packages: packageNames
|
|
286
|
+
// All packages, not just found ones
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
} catch {
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
return result;
|
|
293
|
+
}
|
|
294
|
+
function getRelativeDir(absoluteDir) {
|
|
295
|
+
return absoluteDir.replace(`${process.cwd()}/`, "");
|
|
296
|
+
}
|
|
297
|
+
function logDryRunPackageInfo(logger, packages, workspacesWithPackages) {
|
|
298
|
+
logger.info("Would install at workspace root:");
|
|
299
|
+
for (const pkg of packages) {
|
|
300
|
+
logger.info(` + ${pkg}`);
|
|
301
|
+
}
|
|
302
|
+
if (workspacesWithPackages.length > 0) {
|
|
303
|
+
logger.info("");
|
|
304
|
+
logger.info("Would update in workspace packages:");
|
|
305
|
+
for (const ws of workspacesWithPackages) {
|
|
306
|
+
const relDir = getRelativeDir(ws.dir);
|
|
307
|
+
for (const pkg of ws.packages) {
|
|
308
|
+
logger.info(` + ${relDir}: ${pkg}@latest`);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
logger.info("");
|
|
313
|
+
}
|
|
314
|
+
async function updateIndividualWorkspaces(logger, workspacesWithPackages) {
|
|
315
|
+
if (workspacesWithPackages.length === 0) return;
|
|
316
|
+
logger.info("");
|
|
317
|
+
logger.info("Updating packages in workspace directories...");
|
|
318
|
+
for (const ws of workspacesWithPackages) {
|
|
319
|
+
const relDir = getRelativeDir(ws.dir);
|
|
320
|
+
const wsPackages = ws.packages.map((p) => `${p}@latest`);
|
|
321
|
+
logger.info(` ${relDir}: ${wsPackages.join(", ")}`);
|
|
322
|
+
await execa("pnpm", ["add", "-D", ...wsPackages], {
|
|
323
|
+
cwd: ws.dir,
|
|
324
|
+
stdio: "inherit"
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
async function logInstalledVersions(logger, workspacesCount) {
|
|
329
|
+
const runaVersion = await getInstalledVersion("@runa-ai/runa");
|
|
330
|
+
const cliVersion = await getInstalledVersion("@runa-ai/runa-cli");
|
|
331
|
+
const xstatePluginVersion = await getInstalledVersion("@runa-ai/runa-xstate-test-plugin");
|
|
332
|
+
logger.info("");
|
|
333
|
+
logger.info("Installed:");
|
|
334
|
+
logger.info(` @runa-ai/runa@${runaVersion}`);
|
|
335
|
+
logger.info(` @runa-ai/runa-cli@${cliVersion}`);
|
|
336
|
+
logger.info(` @runa-ai/runa-xstate-test-plugin@${xstatePluginVersion}`);
|
|
337
|
+
if (workspacesCount > 0) {
|
|
338
|
+
logger.info("");
|
|
339
|
+
logger.info(`Updated ${workspacesCount} workspace package(s)`);
|
|
340
|
+
}
|
|
341
|
+
logger.info("");
|
|
342
|
+
return { runa: runaVersion, cli: cliVersion, xstatePlugin: xstatePluginVersion };
|
|
343
|
+
}
|
|
344
|
+
async function updatePackages(logger, isDryRun) {
|
|
345
|
+
logger.section("Update SDK Packages");
|
|
346
|
+
const packageNames = ["@runa-ai/runa", "@runa-ai/runa-cli", "@runa-ai/runa-xstate-test-plugin"];
|
|
347
|
+
const packages = packageNames.map((p) => `${p}@latest`);
|
|
348
|
+
const workspacesWithPackages = await findWorkspacesWithSdkPackages(process.cwd(), packageNames);
|
|
349
|
+
if (isDryRun) {
|
|
350
|
+
logDryRunPackageInfo(logger, packages, workspacesWithPackages);
|
|
351
|
+
return { success: true };
|
|
352
|
+
}
|
|
353
|
+
logger.info("Installing latest SDK packages...");
|
|
354
|
+
logger.info(` pnpm add -wD ${packages.join(" ")}`);
|
|
355
|
+
logger.info("");
|
|
356
|
+
try {
|
|
357
|
+
await execa("pnpm", ["add", "-wD", ...packages], {
|
|
358
|
+
cwd: process.cwd(),
|
|
359
|
+
stdio: "inherit"
|
|
360
|
+
});
|
|
361
|
+
await updateIndividualWorkspaces(logger, workspacesWithPackages);
|
|
362
|
+
const versions = await logInstalledVersions(logger, workspacesWithPackages.length);
|
|
363
|
+
return { success: true, versions };
|
|
364
|
+
} catch (error) {
|
|
365
|
+
logger.error("Failed to update packages");
|
|
366
|
+
if (error instanceof Error) {
|
|
367
|
+
logger.error(` ${error.message}`);
|
|
368
|
+
}
|
|
369
|
+
return { success: false };
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
async function getInstalledVersion(packageName) {
|
|
373
|
+
try {
|
|
374
|
+
const result = await execa("pnpm", ["list", packageName, "--json", "--depth=0"], {
|
|
375
|
+
cwd: process.cwd()
|
|
376
|
+
});
|
|
377
|
+
const parsed = JSON.parse(result.stdout);
|
|
378
|
+
const deps = parsed[0]?.devDependencies ?? parsed[0]?.dependencies ?? {};
|
|
379
|
+
return deps[packageName]?.version ?? "unknown";
|
|
380
|
+
} catch {
|
|
381
|
+
return "unknown";
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
async function runPreCheck(logger, options, isNonInteractive, templatesDir) {
|
|
385
|
+
if (options.force || options.keepLocal) return;
|
|
386
|
+
const preCheck = await preCheckSync({
|
|
387
|
+
targetDir: process.cwd(),
|
|
388
|
+
mode: "sync",
|
|
389
|
+
templatesDir
|
|
390
|
+
});
|
|
391
|
+
logVersionInfo(logger, preCheck);
|
|
392
|
+
logConflictSummary(logger, preCheck, isNonInteractive, options.preview === true);
|
|
393
|
+
logPreCheckSummary(logger, preCheck);
|
|
394
|
+
logTier2Info(logger, preCheck, options.preview === true);
|
|
395
|
+
}
|
|
396
|
+
function logBackupInfo(logger, transactionId) {
|
|
397
|
+
if (!transactionId) return;
|
|
398
|
+
logger.info("");
|
|
399
|
+
logger.info("Backup created (use --rollback to restore):");
|
|
400
|
+
logger.info(` Transaction ID: ${transactionId}`);
|
|
401
|
+
logger.info(" Commands:");
|
|
402
|
+
logger.info(` runa upgrade --rollback ${transactionId}`);
|
|
403
|
+
logger.info(" runa upgrade --rollback-latest");
|
|
404
|
+
logger.info(" runa upgrade --list-backups");
|
|
405
|
+
}
|
|
406
|
+
function logHumanOutput(logger, result, options) {
|
|
407
|
+
if (process.env.RUNA_OUTPUT_FORMAT === "json") return;
|
|
408
|
+
const { summary, changes } = result;
|
|
409
|
+
logger.info("");
|
|
410
|
+
logger.info(`SDK Version: v${result.sdkVersion}`);
|
|
411
|
+
logger.info("");
|
|
412
|
+
const summaryParts = [
|
|
413
|
+
`Created: ${summary.created}`,
|
|
414
|
+
`Updated: ${summary.updated}`,
|
|
415
|
+
`Unchanged: ${summary.unchanged}`,
|
|
416
|
+
`Skipped: ${summary.skipped}`
|
|
417
|
+
];
|
|
418
|
+
if (summary.conflicts > 0) {
|
|
419
|
+
summaryParts.push(`Conflicts: ${summary.conflicts}`);
|
|
420
|
+
}
|
|
421
|
+
logger.info(`Summary: ${summaryParts.join(", ")}`);
|
|
422
|
+
logger.info("");
|
|
423
|
+
logChanges(logger, changes, options.preview === true);
|
|
424
|
+
const conflictFiles = findConflictFiles(changes);
|
|
425
|
+
if (conflictFiles.length > 0 && !options.preview) {
|
|
426
|
+
logConflictGuidance(logger, conflictFiles);
|
|
427
|
+
}
|
|
428
|
+
if (summary.conflicts === 0) {
|
|
429
|
+
logger.info("");
|
|
430
|
+
logger.info("Upgrade complete.");
|
|
431
|
+
}
|
|
432
|
+
if (options.backup && result.transactionId) {
|
|
433
|
+
logBackupInfo(logger, result.transactionId);
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
async function executePackageUpdate(logger, options) {
|
|
437
|
+
const packageResult = await updatePackages(logger, options.preview === true);
|
|
438
|
+
if (!packageResult.success && !options.preview) {
|
|
439
|
+
throw new CLIError("Package update failed", "PACKAGE_UPDATE_FAILED", [
|
|
440
|
+
"Check your network connection",
|
|
441
|
+
"Ensure gh auth is valid: gh auth status",
|
|
442
|
+
"Ensure NODE_AUTH_TOKEN is set: echo $NODE_AUTH_TOKEN",
|
|
443
|
+
"Try with --no-packages to skip package updates"
|
|
444
|
+
]);
|
|
445
|
+
}
|
|
446
|
+
if (packageResult.success && packageResult.versions?.runa && !options.preview) {
|
|
447
|
+
const configUpdateResult = updateRunaConfigSdkVersion(packageResult.versions.runa);
|
|
448
|
+
if (configUpdateResult.updated) {
|
|
449
|
+
logger.info(`Updated runa.config.ts sdkVersion: ${configUpdateResult.reason}`);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
async function executeTemplateSync(ctx, templatesDir) {
|
|
454
|
+
const { logger, options, onlyCategories, isNonInteractive } = ctx;
|
|
455
|
+
logger.section("Upgrade SDK Templates");
|
|
456
|
+
await runPreCheck(logger, options, isNonInteractive, templatesDir);
|
|
457
|
+
logModeInfo(logger, options, onlyCategories);
|
|
458
|
+
const result = await syncTemplates({
|
|
459
|
+
targetDir: process.cwd(),
|
|
460
|
+
mode: "sync",
|
|
461
|
+
dryRun: options.preview === true,
|
|
462
|
+
force: options.force === true,
|
|
463
|
+
keepLocal: options.keepLocal === true,
|
|
464
|
+
keepBackup: options.backup === true,
|
|
465
|
+
only: onlyCategories.length > 0 ? onlyCategories : void 0,
|
|
466
|
+
templatesDir
|
|
467
|
+
});
|
|
468
|
+
emitJsonSuccess(upgradeCommand, SyncOutputSchema, result);
|
|
469
|
+
logHumanOutput(logger, result, options);
|
|
470
|
+
if (result.summary.conflicts > 0 && !options.preview) {
|
|
471
|
+
const conflictFiles = findConflictFiles(result.changes);
|
|
472
|
+
throw new CLIError(
|
|
473
|
+
`${result.summary.conflicts} file(s) have unresolved merge markers`,
|
|
474
|
+
"UPGRADE_UNRESOLVED_CONFLICTS",
|
|
475
|
+
[
|
|
476
|
+
`Files: ${conflictFiles.slice(0, 5).join(", ")}${conflictFiles.length > 5 ? ` and ${conflictFiles.length - 5} more` : ""}`,
|
|
477
|
+
"Resolve merge markers in the files listed above",
|
|
478
|
+
"Then run: runa check (to verify no markers remain)",
|
|
479
|
+
"Or re-run: runa upgrade --force (to overwrite with SDK version)"
|
|
480
|
+
]
|
|
481
|
+
);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
async function executeVerification(logger) {
|
|
485
|
+
const verificationPassed = await runVerification(logger);
|
|
486
|
+
if (!verificationPassed) {
|
|
487
|
+
throw new CLIError("Verification failed", "VERIFICATION_FAILED", [
|
|
488
|
+
"Fix the errors above and re-run verification",
|
|
489
|
+
"Run `runa test --layer 0` for static analysis only",
|
|
490
|
+
"Run `turbo lint --fix` to auto-fix lint issues"
|
|
491
|
+
]);
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
async function executeUpgrade(ctx) {
|
|
495
|
+
const { logger, options, shouldUpdatePackages } = ctx;
|
|
496
|
+
logger.section("Fetching Templates");
|
|
497
|
+
const templateResult = await fetchTemplates({
|
|
498
|
+
version: options.templatesVersion,
|
|
499
|
+
fresh: options.fresh,
|
|
500
|
+
verbose: process.env.DEBUG === "true"
|
|
501
|
+
});
|
|
502
|
+
logger.info(
|
|
503
|
+
templateResult.cached ? `Using ${templateResult.version === "workspace" ? "workspace" : "cached"} templates v${templateResult.version}` : `Fetched templates v${templateResult.version}`
|
|
504
|
+
);
|
|
505
|
+
if (shouldUpdatePackages) {
|
|
506
|
+
await executePackageUpdate(logger, options);
|
|
507
|
+
}
|
|
508
|
+
await executeTemplateSync(ctx, templateResult.templatesDir);
|
|
509
|
+
if (options.verify && !options.preview) {
|
|
510
|
+
await executeVerification(logger);
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
async function handleRollbackOperations(logger, options) {
|
|
514
|
+
if (options.listBackups) {
|
|
515
|
+
await listBackupsAction(logger);
|
|
516
|
+
return true;
|
|
517
|
+
}
|
|
518
|
+
if (options.rollbackLatest) {
|
|
519
|
+
await rollbackLatestAction(logger);
|
|
520
|
+
return true;
|
|
521
|
+
}
|
|
522
|
+
if (options.rollback) {
|
|
523
|
+
await rollbackAction(logger, options.rollback);
|
|
524
|
+
return true;
|
|
525
|
+
}
|
|
526
|
+
return false;
|
|
527
|
+
}
|
|
528
|
+
async function listBackupsAction(logger) {
|
|
529
|
+
logger.section("Available Backups");
|
|
530
|
+
const transactions = await UpgradeTransaction.listTransactions();
|
|
531
|
+
if (transactions.length === 0) {
|
|
532
|
+
logger.info("No backups available.");
|
|
533
|
+
logger.info("");
|
|
534
|
+
logger.info("Backups are created when you run:");
|
|
535
|
+
logger.info(" runa upgrade --backup");
|
|
536
|
+
return;
|
|
537
|
+
}
|
|
538
|
+
const currentVersion = readRunaVersion(process.cwd());
|
|
539
|
+
const lastTransactionId = currentVersion?.lastTransactionId;
|
|
540
|
+
logger.info(`Found ${transactions.length} backup(s):`);
|
|
541
|
+
logger.info("");
|
|
542
|
+
for (const tx of transactions) {
|
|
543
|
+
const isLatest = tx.id === lastTransactionId;
|
|
544
|
+
const marker = isLatest ? " \u2190 (current)" : "";
|
|
545
|
+
const date = new Date(tx.timestamp).toLocaleString();
|
|
546
|
+
logger.info(` ${tx.id} ${date}${marker}`);
|
|
547
|
+
}
|
|
548
|
+
logger.info("");
|
|
549
|
+
logger.info("To rollback:");
|
|
550
|
+
logger.info(" runa upgrade --rollback <id>");
|
|
551
|
+
logger.info(" runa upgrade --rollback-latest");
|
|
552
|
+
}
|
|
553
|
+
async function rollbackAction(logger, transactionId) {
|
|
554
|
+
logger.section("Rollback");
|
|
555
|
+
logger.info(`Rolling back to transaction: ${transactionId}`);
|
|
556
|
+
try {
|
|
557
|
+
const metadata = await UpgradeTransaction.loadMetadata(transactionId);
|
|
558
|
+
if (!metadata) {
|
|
559
|
+
throw new CLIError(
|
|
560
|
+
`Transaction ${transactionId} not found`,
|
|
561
|
+
"ROLLBACK_TRANSACTION_NOT_FOUND",
|
|
562
|
+
["Run `runa upgrade --list-backups` to see available backups"]
|
|
563
|
+
);
|
|
564
|
+
}
|
|
565
|
+
logger.info("");
|
|
566
|
+
logger.info(`Files to restore: ${metadata.files.length}`);
|
|
567
|
+
for (const file of metadata.files.slice(0, 5)) {
|
|
568
|
+
logger.info(` - ${file.original}`);
|
|
569
|
+
}
|
|
570
|
+
if (metadata.files.length > 5) {
|
|
571
|
+
logger.info(` ... and ${metadata.files.length - 5} more`);
|
|
572
|
+
}
|
|
573
|
+
logger.info("");
|
|
574
|
+
await UpgradeTransaction.rollbackFromMetadata(transactionId);
|
|
575
|
+
logger.info("Rollback complete.");
|
|
576
|
+
logger.info("");
|
|
577
|
+
logger.info("Note: The backup has been consumed and is no longer available.");
|
|
578
|
+
logger.info("Run `runa upgrade` to upgrade again.");
|
|
579
|
+
} catch (error) {
|
|
580
|
+
if (error instanceof CLIError) throw error;
|
|
581
|
+
throw new CLIError(
|
|
582
|
+
`Rollback failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
583
|
+
"ROLLBACK_FAILED",
|
|
584
|
+
["Check if the backup files still exist", "Run `runa upgrade --list-backups` to verify"]
|
|
585
|
+
);
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
async function rollbackLatestAction(logger) {
|
|
589
|
+
const currentVersion = readRunaVersion(process.cwd());
|
|
590
|
+
if (currentVersion?.lastTransactionId) {
|
|
591
|
+
await rollbackAction(logger, currentVersion.lastTransactionId);
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
594
|
+
const transactions = await UpgradeTransaction.listTransactions();
|
|
595
|
+
if (transactions.length === 0) {
|
|
596
|
+
throw new CLIError("No backups available", "NO_BACKUPS_AVAILABLE", [
|
|
597
|
+
"Run `runa upgrade --backup` to create a backup during upgrade",
|
|
598
|
+
"Backups are automatically created but cleaned up unless --backup is used"
|
|
599
|
+
]);
|
|
600
|
+
}
|
|
601
|
+
await rollbackAction(logger, transactions[0].id);
|
|
602
|
+
}
|
|
603
|
+
var upgradeCommand = new Command("upgrade").description("Upgrade SDK packages and templates to latest version").option("--preview", "Preview changes without writing files (dry-run)").option("--force", "Overwrite all files, even if modified locally").option("--keep-local", "Skip conflicts and keep local versions").option("-y, --yes", "Skip confirmation prompts").option("--verify", "Run type-check, lint, and build after upgrade").option("--no-packages", "Skip package updates (templates only)").option("--backup", "Keep backup after upgrade (for manual rollback)").option("--rollback <id>", "Rollback to a specific backup by transaction ID").option("--rollback-latest", "Rollback to the most recent backup").option("--list-backups", "List available backups for rollback").option("--only <categories>", "Only sync specific categories (rules,workflows,config,packages)").option("--templates-version <version>", "Override templates version").option("--fresh", "Clear templates cache before fetching").action(async (options) => {
|
|
604
|
+
const logger = createCLILogger("upgrade");
|
|
605
|
+
if (await handleRollbackOperations(logger, options)) {
|
|
606
|
+
return;
|
|
607
|
+
}
|
|
608
|
+
const onlyCategories = parseOnlyOption(options.only);
|
|
609
|
+
const shouldUpdatePackages = options.packages !== false && (onlyCategories.length === 0 || onlyCategories.includes("packages"));
|
|
610
|
+
const isJsonMode = process.env.RUNA_OUTPUT_FORMAT === "json";
|
|
611
|
+
const isNonInteractive = options.yes || isJsonMode || !process.stdin.isTTY;
|
|
612
|
+
const ctx = {
|
|
613
|
+
logger,
|
|
614
|
+
options,
|
|
615
|
+
onlyCategories,
|
|
616
|
+
shouldUpdatePackages,
|
|
617
|
+
isNonInteractive
|
|
618
|
+
};
|
|
619
|
+
try {
|
|
620
|
+
await executeUpgrade(ctx);
|
|
621
|
+
} catch (error) {
|
|
622
|
+
if (error instanceof CLIError) throw error;
|
|
623
|
+
throw new CLIError(
|
|
624
|
+
"Upgrade failed",
|
|
625
|
+
"UPGRADE_FAILED",
|
|
626
|
+
[
|
|
627
|
+
"Run with --preview to see what would change",
|
|
628
|
+
"Run with --force to overwrite all files",
|
|
629
|
+
"Run with --keep-local to keep your modifications",
|
|
630
|
+
"Run with --no-packages to skip package updates"
|
|
631
|
+
],
|
|
632
|
+
error instanceof Error ? error : void 0
|
|
633
|
+
);
|
|
634
|
+
}
|
|
635
|
+
});
|
|
636
|
+
|
|
637
|
+
export { upgradeCommand };
|
|
@@ -10,9 +10,6 @@
|
|
|
10
10
|
* - Config-first with smart fallbacks
|
|
11
11
|
*/
|
|
12
12
|
import type { RunaConfig } from '@runa-ai/runa';
|
|
13
|
-
/**
|
|
14
|
-
* Load runa.config.ts from project root (synchronous)
|
|
15
|
-
*/
|
|
16
13
|
export declare function loadRunaConfig(cwd?: string): RunaConfig;
|
|
17
14
|
/**
|
|
18
15
|
* Get database configuration with defaults
|