@runa-ai/runa-cli 0.7.0 → 0.7.2

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.
Files changed (139) hide show
  1. package/dist/{build-V66FAQXB.js → build-HQMSVN6N.js} +3 -3
  2. package/dist/{check-LOMVIRHX.js → check-PCSQPYDM.js} +2 -2
  3. package/dist/{chunk-QM53IQHM.js → chunk-2QX7T24B.js} +1 -1
  4. package/dist/{chunk-XDCHRVE3.js → chunk-4XHZQRRK.js} +2 -2
  5. package/dist/{chunk-7B5C6U2K.js → chunk-A6A7JIRD.js} +35 -2
  6. package/dist/{chunk-Z4Z5DNW4.js → chunk-B3POLMII.js} +12 -0
  7. package/dist/chunk-CKRLVEIO.js +119 -0
  8. package/dist/{chunk-HD74F6W2.js → chunk-FWMGC5FP.js} +1 -0
  9. package/dist/{chunk-H2AHNI75.js → chunk-LCK2LGVR.js} +1 -1
  10. package/dist/{chunk-FHG3ILE4.js → chunk-OBYZDT2E.js} +38 -8
  11. package/dist/{chunk-AIP6MR42.js → chunk-PMXE5XOJ.js} +1 -1
  12. package/dist/{chunk-VM3IWOT5.js → chunk-QSEF4T3Y.js} +13 -5
  13. package/dist/{chunk-NPSRD26F.js → chunk-UHDAYPHH.js} +1 -1
  14. package/dist/{chunk-2APB25TT.js → chunk-VSH3IXDQ.js} +7 -3
  15. package/dist/{chunk-644FVGIQ.js → chunk-WPMR7RQ4.js} +9 -2
  16. package/dist/chunk-XVNDDHAF.js +65 -0
  17. package/dist/{risk-detector-plpgsql-HWKS4OLR.js → chunk-Y5ANTCKE.js} +3 -412
  18. package/dist/{chunk-SGJG3BKD.js → chunk-Z7A4BEWF.js} +1 -1
  19. package/dist/{ci-ZWRVWNFX.js → ci-Z4525QW6.js} +3095 -709
  20. package/dist/{cli-2JNBJUBB.js → cli-Q2XIQDRS.js} +72 -54
  21. package/dist/commands/ci/commands/ci-prod-db-operations.d.ts +6 -4
  22. package/dist/commands/ci/commands/ci-prod-types.d.ts +3 -0
  23. package/dist/commands/ci/commands/ci-prod-workflow.d.ts +1 -1
  24. package/dist/commands/ci/commands/ci-resolvers.d.ts +1 -1
  25. package/dist/commands/ci/commands/ci-supabase-local.d.ts +4 -0
  26. package/dist/commands/ci/machine/actors/build/build-and-playwright.d.ts +1 -1
  27. package/dist/commands/ci/machine/actors/db/collect-schema-stats.d.ts +15 -2
  28. package/dist/commands/ci/machine/actors/db/production-preview.d.ts +32 -4
  29. package/dist/commands/ci/machine/actors/db/schema-canonical-diff.d.ts +30 -1
  30. package/dist/commands/ci/machine/actors/db/sync-schema.d.ts +1 -0
  31. package/dist/commands/ci/machine/actors/finalize/index.d.ts +0 -1
  32. package/dist/commands/ci/machine/actors/index.d.ts +1 -1
  33. package/dist/commands/ci/machine/actors/setup/local.d.ts +2 -0
  34. package/dist/commands/ci/machine/actors/setup/pr-common.d.ts +3 -0
  35. package/dist/commands/ci/machine/actors/setup/pr-local.d.ts +2 -0
  36. package/dist/commands/ci/machine/commands/machine-runner.d.ts +6 -0
  37. package/dist/commands/ci/machine/commands/step-telemetry.d.ts +16 -0
  38. package/dist/commands/ci/machine/contract.d.ts +40 -0
  39. package/dist/commands/ci/machine/formatters/github-comment-types.d.ts +7 -2
  40. package/dist/commands/ci/machine/formatters/github-comment.d.ts +2 -1
  41. package/dist/commands/ci/machine/formatters/sections/final-comment.d.ts +2 -1
  42. package/dist/commands/ci/machine/formatters/sections/index.d.ts +1 -1
  43. package/dist/commands/ci/machine/formatters/sections/production-schema-status.d.ts +30 -0
  44. package/dist/commands/ci/machine/formatters/summary.d.ts +4 -4
  45. package/dist/commands/ci/machine/guards.d.ts +4 -0
  46. package/dist/commands/ci/machine/helpers.d.ts +33 -0
  47. package/dist/commands/ci/machine/machine-state-helpers.d.ts +1 -1
  48. package/dist/commands/ci/machine/machine.d.ts +71 -11
  49. package/dist/commands/ci/machine/types.d.ts +9 -0
  50. package/dist/commands/ci/utils/ci-diagnostics.d.ts +67 -0
  51. package/dist/commands/ci/utils/ci-summary.d.ts +118 -0
  52. package/dist/commands/ci/utils/db-url-utils.d.ts +4 -77
  53. package/dist/commands/ci/utils/github-api.d.ts +14 -0
  54. package/dist/commands/db/apply/contract.d.ts +73 -0
  55. package/dist/commands/db/apply/helpers/alter-statement-parsers.d.ts +95 -0
  56. package/dist/commands/db/apply/helpers/data-compatibility-checker.d.ts +0 -61
  57. package/dist/commands/db/apply/helpers/function-plan-false-positive-filter.d.ts +36 -0
  58. package/dist/commands/db/apply/helpers/hazard-handler.d.ts +4 -4
  59. package/dist/commands/db/apply/helpers/index.d.ts +14 -5
  60. package/dist/commands/db/apply/helpers/partition-acl-cleaner.d.ts +3 -1
  61. package/dist/commands/db/apply/helpers/pg-schema-diff-helpers.d.ts +69 -6
  62. package/dist/commands/db/apply/helpers/plan-ast.d.ts +56 -0
  63. package/dist/commands/db/apply/helpers/plan-check-filter.d.ts +26 -0
  64. package/dist/commands/db/apply/helpers/plan-drop-protection.d.ts +43 -0
  65. package/dist/commands/db/apply/helpers/plan-ordering.d.ts +6 -0
  66. package/dist/commands/db/apply/helpers/plan-statement-parser.d.ts +39 -0
  67. package/dist/commands/db/apply/helpers/plan-validator.d.ts +8 -40
  68. package/dist/commands/db/apply/helpers/retry-logic.d.ts +1 -10
  69. package/dist/commands/db/apply/helpers/temp-db-bootstrap.d.ts +18 -0
  70. package/dist/commands/db/apply/helpers/temp-db-dsn.d.ts +14 -0
  71. package/dist/commands/db/apply/machine.d.ts +56 -32
  72. package/dist/commands/db/commands/db-apply-error.d.ts +5 -0
  73. package/dist/commands/db/commands/db-apply.d.ts +2 -0
  74. package/dist/commands/db/commands/db-sync/directory-placement-check.d.ts +4 -0
  75. package/dist/commands/db/commands/db-sync/error-classifier.d.ts +1 -1
  76. package/dist/commands/db/commands/db-sync/plan-boundary-reconciliation.d.ts +3 -0
  77. package/dist/commands/db/commands/db-sync/precheck-helpers.d.ts +18 -0
  78. package/dist/commands/db/commands/db-sync/production-precheck.d.ts +15 -0
  79. package/dist/commands/db/commands/db-sync/risk-scan-collectors.d.ts +11 -0
  80. package/dist/commands/db/commands/db-sync.d.ts +11 -5
  81. package/dist/commands/db/sync/contract.d.ts +80 -0
  82. package/dist/commands/db/sync/machine.d.ts +60 -1
  83. package/dist/commands/db/types.d.ts +5 -0
  84. package/dist/commands/db/utils/boundary-policy/rule-compiler.d.ts +2 -1
  85. package/dist/commands/db/utils/boundary-policy/types.d.ts +21 -0
  86. package/dist/commands/db/utils/boundary-policy-runtime.d.ts +12 -3
  87. package/dist/commands/db/utils/boundary-policy.d.ts +1 -1
  88. package/dist/commands/db/utils/db-target.d.ts +5 -3
  89. package/dist/commands/db/utils/declarative-dependency-collectors.d.ts +6 -0
  90. package/dist/commands/db/utils/declarative-dependency-contract.d.ts +78 -0
  91. package/dist/commands/db/utils/declarative-dependency-sql-utils.d.ts +49 -0
  92. package/dist/commands/db/utils/declarative-dependency-warning-governance.d.ts +24 -0
  93. package/dist/commands/db/utils/preflight-check.d.ts +1 -1
  94. package/dist/commands/db/utils/preflight-checks/declarative-dependency-checks.d.ts +4 -0
  95. package/dist/commands/db/utils/preflight-checks/idempotent-risk-checks.d.ts +4 -0
  96. package/dist/commands/db/utils/preflight-checks/schema-boundary-checks.d.ts +4 -0
  97. package/dist/commands/db/utils/preflight-checks/schema-risk-policy.d.ts +4 -0
  98. package/dist/commands/db/utils/preflight-checks/supabase-checks.d.ts +12 -0
  99. package/dist/commands/db/utils/psql.d.ts +23 -0
  100. package/dist/commands/db/utils/sql-table-extractor.d.ts +42 -1
  101. package/dist/commands/env/commands/setup/types.d.ts +1 -0
  102. package/dist/commands/env/constants/local-supabase.d.ts +4 -1
  103. package/dist/commands/observability.d.ts +72 -0
  104. package/dist/commands/observability.helpers.d.ts +25 -0
  105. package/dist/commands/template-check/commands/template-check.d.ts +1 -0
  106. package/dist/commands/template-check/contract.d.ts +4 -3
  107. package/dist/commands/template-check/machine.d.ts +1 -1
  108. package/dist/commands/workflow/commands/deploy-production.d.ts +0 -1
  109. package/dist/constants/versions.d.ts +1 -1
  110. package/dist/{db-XULCILOU.js → db-BPQ2TEQM.js} +14618 -11273
  111. package/dist/{dev-5YXNPTCJ.js → dev-MLRKIP7F.js} +5 -5
  112. package/dist/{doctor-MZLOA53G.js → doctor-ROSWSMLH.js} +2 -2
  113. package/dist/{env-SS66PZ4B.js → env-WNHJVLOT.js} +37 -20
  114. package/dist/{env-HMMRSYCI.js → env-XPPACZM4.js} +2 -2
  115. package/dist/{env-files-2UIUYLLR.js → env-files-HRNUGZ5O.js} +1 -1
  116. package/dist/{error-handler-HEXBRNVV.js → error-handler-YRQWRDEF.js} +17 -0
  117. package/dist/{hotfix-YA3DGLOM.js → hotfix-Z5EGVSMH.js} +4 -4
  118. package/dist/index.js +4 -4
  119. package/dist/{init-ZIL6LRFO.js → init-S2ATHLJ6.js} +1 -1
  120. package/dist/{inject-test-attrs-P44BVTQS.js → inject-test-attrs-XN4I2AOR.js} +2 -2
  121. package/dist/internal/machines/index.d.ts +1 -1
  122. package/dist/internal/machines/snapshot-helpers.d.ts +6 -0
  123. package/dist/{manifest-TMFLESHW.js → manifest-EGCAZ4TK.js} +1 -1
  124. package/dist/observability-CJA5UFIC.js +721 -0
  125. package/dist/{risk-detector-4U6ZJ2G5.js → risk-detector-VO5HJR4R.js} +1 -1
  126. package/dist/{risk-detector-core-TK4OAI3N.js → risk-detector-core-7WZJZ5ZI.js} +61 -3
  127. package/dist/risk-detector-plpgsql-ULV7NLDB.js +638 -0
  128. package/dist/{template-check-3P4HZXVY.js → template-check-BDFMT6ZO.js} +23 -6
  129. package/dist/{upgrade-NUK3ZBCL.js → upgrade-BDUWBRT5.js} +1 -1
  130. package/dist/utils/db-url-utils.d.ts +81 -0
  131. package/dist/validators/risk-detector-plpgsql.d.ts +3 -1
  132. package/dist/{vuln-check-2W7N5TA2.js → vuln-check-66RXX3TO.js} +1 -1
  133. package/dist/{vuln-checker-IQJ56RUV.js → vuln-checker-FFOGOJPT.js} +1 -1
  134. package/dist/{watch-PNTKZYFB.js → watch-ITYW57SL.js} +1 -1
  135. package/dist/{workflow-H75N4BXX.js → workflow-UZIZ2JUS.js} +2 -3
  136. package/package.json +3 -3
  137. package/dist/chunk-IBVVGH6X.js +0 -33
  138. package/dist/chunk-KWX3JHCY.js +0 -85
  139. package/dist/commands/ci/machine/actors/finalize/summary.d.ts +0 -32
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'module';
3
- import { getErrorMessage } from './chunk-IBVVGH6X.js';
3
+ import { getErrorMessage } from './chunk-XVNDDHAF.js';
4
4
  import { findRepoRoot } from './chunk-3WDV32GA.js';
5
5
  import { createMachineStateChangeLogger } from './chunk-5FT3F36G.js';
6
6
  import { getOutputFormatFromEnv } from './chunk-HKUWEGUX.js';
@@ -694,7 +694,11 @@ function sortResults(results) {
694
694
  return pathA.localeCompare(pathB);
695
695
  });
696
696
  }
697
- function filterResults(results, category) {
697
+ function normalizeTemplatePath(templatePath) {
698
+ if (!templatePath) return null;
699
+ return `packages/runa-templates/templates/${templatePath}`;
700
+ }
701
+ function filterResults(results, category, paths) {
698
702
  let filtered = results.filter((r) => {
699
703
  const filePath = r.runaPath ?? r.templatePath ?? "";
700
704
  return isCodeFile(filePath);
@@ -702,6 +706,14 @@ function filterResults(results, category) {
702
706
  if (category) {
703
707
  filtered = filtered.filter((r) => r.category === category);
704
708
  }
709
+ if (paths && paths.length > 0) {
710
+ const pathSet = new Set(paths);
711
+ filtered = filtered.filter((r) => {
712
+ const runaPath = r.runaPath;
713
+ const templatePath = normalizeTemplatePath(r.templatePath);
714
+ return runaPath !== null && pathSet.has(runaPath) || templatePath !== null && pathSet.has(templatePath);
715
+ });
716
+ }
705
717
  return filtered;
706
718
  }
707
719
  var compareActor = fromPromise(async ({ input }) => {
@@ -736,7 +748,7 @@ var compareActor = fromPromise(async ({ input }) => {
736
748
  results.push(createTemplateOnlyResult(templateRelPath, templateFile.category));
737
749
  }
738
750
  sortResults(results);
739
- return { results: filterResults(results, options.category) };
751
+ return { results: filterResults(results, options.category, options.paths) };
740
752
  });
741
753
 
742
754
  // src/commands/template-check/actors/discover.ts
@@ -1126,7 +1138,7 @@ function getCategoryForPath(path3) {
1126
1138
  }
1127
1139
  return "other";
1128
1140
  }
1129
- function normalizeTemplatePath(templatePath) {
1141
+ function normalizeTemplatePath2(templatePath) {
1130
1142
  return templatePath.replace(/^_claude\//, ".claude/").replace(".claude/rules/sdk/", ".claude/rules/").replace(".claude/agents/sdk/", ".claude/agents/").replace(".claude/skills/sdk/", ".claude/skills/").replace(".claude/commands/sdk/", ".claude/commands/");
1131
1143
  }
1132
1144
  function applyReverseRename(normalized, rule, isTemplate) {
@@ -1141,7 +1153,7 @@ function applyReverseRename(normalized, rule, isTemplate) {
1141
1153
  return normalized;
1142
1154
  }
1143
1155
  function generateComparisonKey(path3, isTemplate) {
1144
- let normalized = isTemplate ? normalizeTemplatePath(path3) : path3;
1156
+ let normalized = isTemplate ? normalizeTemplatePath2(path3) : path3;
1145
1157
  for (const rule of PATH_MAPPING_RULES) {
1146
1158
  normalized = applyReverseRename(normalized, rule, isTemplate);
1147
1159
  }
@@ -1644,6 +1656,10 @@ var AHEAD_LABELS = {
1644
1656
  diverged: "diverged",
1645
1657
  equal: ""
1646
1658
  };
1659
+ function collectValues(value, previous) {
1660
+ previous.push(value);
1661
+ return previous;
1662
+ }
1647
1663
  var STATUS_SUFFIXES = {
1648
1664
  "runa-only": "(unexpected - missing in template)",
1649
1665
  "template-only": "(unexpected - missing in runa-repo)",
@@ -1929,11 +1945,12 @@ async function runTemplateCheckAction(options) {
1929
1945
  }
1930
1946
  var templateCheckCommand = new Command("template-check").description(
1931
1947
  "Compare runa-repo with SDK templates (runa-repo only)\n\n Exit codes:\n 0 = All files in sync\n 1 = Differences detected (action needed)\n 2 = Error occurred"
1932
- ).option("--verbose", "Show all files including identical ones").option("--diff", "Show unified diff for differences").option("--category <name>", "Filter by category (rules, agents, skills, etc.)").option("--json", "Output as JSON (for CI integration)").option("--quiet", "Only show summary and actions (for pre-commit hooks)").option("--target-dir <path>", "Target directory (defaults to repo root)").action(async (options) => {
1948
+ ).option("--verbose", "Show all files including identical ones").option("--diff", "Show unified diff for differences").option("--category <name>", "Filter by category (rules, agents, skills, etc.)").option("--path <file>", "Restrict results to a specific runa/template path", collectValues, []).option("--json", "Output as JSON (for CI integration)").option("--quiet", "Only show summary and actions (for pre-commit hooks)").option("--target-dir <path>", "Target directory (defaults to repo root)").action(async (options) => {
1933
1949
  const input = {
1934
1950
  verbose: options.verbose ?? false,
1935
1951
  diff: options.diff ?? false,
1936
1952
  category: options.category,
1953
+ paths: options.path?.length ? options.path : void 0,
1937
1954
  json: options.json ?? false,
1938
1955
  quiet: options.quiet ?? false,
1939
1956
  targetDir: options.targetDir
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'module';
3
- import { fetchTemplates } from './chunk-SGJG3BKD.js';
3
+ import { fetchTemplates } from './chunk-Z7A4BEWF.js';
4
4
  import { updateRunaConfigSdkVersion } from './chunk-6AALH2ED.js';
5
5
  import './chunk-DRSUEMAK.js';
6
6
  import './chunk-RZLYEO4U.js';
@@ -0,0 +1,81 @@
1
+ /**
2
+ * AI HINT: Database URL normalization utilities for CI operations
3
+ *
4
+ * Purpose: Normalize database URLs for DDL operations and catalog queries
5
+ * Shared: These utilities match SDK's behavior for consistent handling
6
+ *
7
+ * Key transformations:
8
+ * 1. Port conversion: Transaction Pooler (6543) → Session Pooler (5432)
9
+ * 2. pgbouncer cleanup: Remove pgbouncer parameter for Session Pooler
10
+ * 3. IPv4 resolution: GitHub Actions runners can't reach IPv6-only hosts
11
+ */
12
+ /**
13
+ * Resolve hostname to IPv4 address using getent (Linux).
14
+ *
15
+ * This is critical for GitHub Actions where IPv6 may not be routable to Supabase.
16
+ * Matches SDK's resolveHostToIPv4 behavior.
17
+ *
18
+ * @param hostname - The hostname to resolve
19
+ * @returns IPv4 address if resolvable, null otherwise
20
+ */
21
+ export declare function resolveHostToIPv4(hostname: string): string | null;
22
+ /**
23
+ * Normalize database URL for DDL reads and psql operations.
24
+ *
25
+ * Handles three critical issues:
26
+ * 1. Port conversion: Transaction Pooler (6543) → Session Pooler (5432)
27
+ * - DDL and catalog reads are more reliable via Session Pooler
28
+ * 2. pgbouncer cleanup: Remove pgbouncer parameter for Session Pooler
29
+ * - Session Pooler (5432) does NOT accept pgbouncer parameter
30
+ * 3. IPv4 resolution: GitHub Actions runners can't reach IPv6-only hosts
31
+ * - This matches SDK's normalizeDatabaseUrlForDDL behavior
32
+ *
33
+ * @param databaseUrl - The database URL to normalize
34
+ * @returns Normalized database URL suitable for DDL operations
35
+ */
36
+ export declare function normalizeDatabaseUrlForDdl(databaseUrl: string): string;
37
+ /**
38
+ * Get safe database target string for logging (without password).
39
+ *
40
+ * @param databaseUrl - The database URL
41
+ * @returns Safe string for logging
42
+ */
43
+ export declare function getSafeDatabaseTarget(databaseUrl: string): string;
44
+ /**
45
+ * Escape SQL literal value for safe inclusion in SQL strings.
46
+ *
47
+ * @param value - The string value to escape
48
+ * @returns Escaped string safe for SQL literals
49
+ */
50
+ export declare function escapeSqlLiteral(value: string): string;
51
+ /**
52
+ * Parse PostgreSQL boolean result to JavaScript boolean.
53
+ *
54
+ * PostgreSQL returns 't', 'true', or '1' for true values.
55
+ * This utility normalizes these variants.
56
+ *
57
+ * @param value - The PostgreSQL boolean string
58
+ * @returns JavaScript boolean
59
+ */
60
+ export declare function parseBoolish(value: string): boolean;
61
+ /**
62
+ * Check if a hostname resolves ONLY to IPv6 (no IPv4).
63
+ *
64
+ * This indicates that Supabase IPv4 Add-on is not enabled.
65
+ * GitHub Actions cannot reach IPv6-only hosts.
66
+ *
67
+ * @param hostname - The hostname to check
68
+ * @returns true if hostname resolves ONLY to IPv6, false otherwise
69
+ */
70
+ export declare function isIPv6Only(hostname: string): boolean;
71
+ /**
72
+ * Enhance error message with actionable advice.
73
+ *
74
+ * Detects common error patterns and adds clear guidance for users.
75
+ *
76
+ * @param error - Original error message
77
+ * @param databaseUrl - The database URL that failed (optional)
78
+ * @returns Enhanced error message with guidance
79
+ */
80
+ export declare function enhanceConnectionError(error: string, databaseUrl?: string): string;
81
+ //# sourceMappingURL=db-url-utils.d.ts.map
@@ -5,5 +5,7 @@
5
5
  * Design: Keep heavy PL/pgSQL parsing logic isolated from risk-detector-core import path.
6
6
  */
7
7
  import type { SchemaRisk } from './risk-detector-types.js';
8
- export declare function detectPlpgsqlDynamicExecutionRisks(content: string): SchemaRisk[];
8
+ export declare function detectPlpgsqlDynamicExecutionRisks(content: string, options?: {
9
+ filePath?: string;
10
+ }): Promise<SchemaRisk[]>;
9
11
  //# sourceMappingURL=risk-detector-plpgsql.d.ts.map
@@ -71,7 +71,7 @@ var vulnCheckCommand = new Command("vuln-check").description("Run comprehensive
71
71
  const logger = createCLILogger("vuln-check");
72
72
  const isJsonMode = getOutputFormatFromEnv() === "json" || options.format === "json";
73
73
  try {
74
- const { VulnChecker } = await import('./vuln-checker-IQJ56RUV.js');
74
+ const { VulnChecker } = await import('./vuln-checker-FFOGOJPT.js');
75
75
  const categoryMap = {
76
76
  code: ["injection", "auth", "crypto"],
77
77
  deps: ["dependency"],
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'module';
3
- import { CLI_VERSION } from './chunk-AIP6MR42.js';
3
+ import { CLI_VERSION } from './chunk-PMXE5XOJ.js';
4
4
  import { init_esm_shims } from './chunk-VRXHCR5K.js';
5
5
  import { glob } from 'glob';
6
6
  import { exec } from 'child_process';
@@ -284,7 +284,7 @@ function validateSqlSchema(content, errors, warnings) {
284
284
  var riskDetectorLoader = null;
285
285
  function loadRiskDetectorModule() {
286
286
  if (!riskDetectorLoader) {
287
- riskDetectorLoader = import('./risk-detector-4U6ZJ2G5.js').then((module) => ({
287
+ riskDetectorLoader = import('./risk-detector-VO5HJR4R.js').then((module) => ({
288
288
  detectSchemaRisks: module.detectSchemaRisks
289
289
  })).catch((error) => {
290
290
  riskDetectorLoader = null;
@@ -25,14 +25,13 @@ var DeployProductionOutputSchema = z.object({
25
25
  var deployProductionCommand = new Command("deploy-production").description("Deploy schema to production database (unified command)").requiredOption(
26
26
  "--db-url <url>",
27
27
  "Production database URL (admin/DDL)",
28
- process.env.GH_DATABASE_URL_ADMIN || process.env.GH_DATABASE_URL
28
+ process.env.GH_DATABASE_URL_ADMIN
29
29
  ).option("--skip-validation", "Skip schema validation (not recommended)", false).option("--skip-risk-detection", "Skip risk detection (not recommended)", false).option("--max-retries <number>", "Maximum retry attempts for schema application", "3").action(
30
30
  async (options) => {
31
31
  try {
32
32
  if (!options.dbUrl) {
33
33
  throw new CLIError("Production database URL not provided", "PRODUCTION_DB_URL_MISSING", [
34
- "Set GH_DATABASE_URL_ADMIN environment variable (recommended for DDL)",
35
- "Or set GH_DATABASE_URL environment variable",
34
+ "Set GH_DATABASE_URL_ADMIN environment variable (required for DDL)",
36
35
  "Or use --db-url <url>"
37
36
  ]);
38
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runa-ai/runa-cli",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "private": false,
5
5
  "description": "AI-powered DevOps CLI",
6
6
  "type": "module",
@@ -56,8 +56,8 @@
56
56
  "typescript": "5.9.3",
57
57
  "xstate": "5.28.0",
58
58
  "zod": "4.3.6",
59
- "@runa-ai/runa": "0.7.0",
60
- "@runa-ai/runa-xstate-test-plugin": "0.5.58"
59
+ "@runa-ai/runa-xstate-test-plugin": "0.5.58",
60
+ "@runa-ai/runa": "0.7.2"
61
61
  },
62
62
  "engines": {
63
63
  "node": ">=20.0.0"
@@ -1,33 +0,0 @@
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/internal/machines/snapshot-helpers.ts
8
- init_esm_shims();
9
- function getSnapshotStateName(snapshot) {
10
- if (typeof snapshot.value === "string") {
11
- return snapshot.value;
12
- }
13
- if (!snapshot.value || typeof snapshot.value !== "object") {
14
- return "unknown";
15
- }
16
- const entries = Object.entries(snapshot.value);
17
- if (entries.length === 0) {
18
- return "unknown";
19
- }
20
- const [parent, child] = entries[0];
21
- if (typeof child === "string") {
22
- return `${parent}.${child}`;
23
- }
24
- return parent;
25
- }
26
- function isSnapshotComplete(snapshot) {
27
- return snapshot.status === "done";
28
- }
29
- function getErrorMessage(error) {
30
- return error instanceof Error ? error.message : String(error);
31
- }
32
-
33
- export { getErrorMessage, getSnapshotStateName, isSnapshotComplete };
@@ -1,85 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire } from 'module';
3
- import { env } from './chunk-NPSRD26F.js';
4
- import { redactSecrets } from './chunk-II7VYQEM.js';
5
- import { init_local_supabase, buildLocalDatabaseUrl } from './chunk-VM3IWOT5.js';
6
- import { init_esm_shims } from './chunk-VRXHCR5K.js';
7
- import { CLIError } from '@runa-ai/runa';
8
-
9
- createRequire(import.meta.url);
10
-
11
- // src/commands/db/utils/db-target.ts
12
- init_esm_shims();
13
- init_local_supabase();
14
- function getLocalDatabaseUrl() {
15
- return buildLocalDatabaseUrl(process.cwd());
16
- }
17
- function isLocalHostname(hostname) {
18
- return hostname === "localhost" || hostname === "127.0.0.1" || hostname === "::1" || hostname === "host.docker.internal";
19
- }
20
- function isLocalDatabaseUrl(url) {
21
- try {
22
- const parsed = new URL(url);
23
- return isLocalHostname(parsed.hostname);
24
- } catch {
25
- return false;
26
- }
27
- }
28
- function resolveDatabaseUrl(environment) {
29
- switch (environment) {
30
- case "local": {
31
- const url = process.env.DATABASE_URL_ADMIN || getLocalDatabaseUrl();
32
- if (!isLocalDatabaseUrl(url)) {
33
- throw new CLIError("Local database URL appears to be a remote URL", "LOCAL_DB_URL_REMOTE", [
34
- "Local operations should use the local Supabase instance",
35
- // SECURITY (Issue #513): Redact credentials from database URL in error message
36
- `Current URL: ${redactSecrets(url)}`,
37
- "If you need to connect to a remote DB, use --env preview or --env production"
38
- ]);
39
- }
40
- return url;
41
- }
42
- case "preview": {
43
- const url = process.env.DATABASE_URL_ADMIN || env.DATABASE_URL || process.env.DATABASE_URL;
44
- if (!url) {
45
- throw new CLIError("Preview database URL not found", "PREVIEW_DB_URL_NOT_FOUND", [
46
- "Set DATABASE_URL_ADMIN environment variable (for DDL/migrations)",
47
- "Or set DATABASE_URL as fallback"
48
- ]);
49
- }
50
- return url;
51
- }
52
- case "main":
53
- case "production": {
54
- const url = process.env.GH_DATABASE_URL_ADMIN || process.env.DATABASE_URL_ADMIN || process.env.GH_DATABASE_URL || env.DATABASE_URL || process.env.DATABASE_URL;
55
- if (!url) {
56
- throw new CLIError("Production database URL not found", "PRODUCTION_DB_URL_NOT_FOUND", [
57
- "Set DATABASE_URL_ADMIN environment variable (for DDL/migrations)",
58
- "Or set GH_DATABASE_URL_ADMIN (CI) / DATABASE_URL as fallback"
59
- ]);
60
- }
61
- if (isLocalDatabaseUrl(url)) {
62
- throw new CLIError(
63
- "Production database URL points to localhost",
64
- "PRODUCTION_DB_URL_IS_LOCAL",
65
- [
66
- "Use --env local for local Supabase operations",
67
- "Production operations require a remote database URL",
68
- "Set DATABASE_URL_ADMIN or GH_DATABASE_URL_ADMIN to the production database URL"
69
- ]
70
- );
71
- }
72
- return url;
73
- }
74
- }
75
- }
76
- function tryResolveDatabaseUrl(environment) {
77
- try {
78
- return resolveDatabaseUrl(environment);
79
- } catch (error) {
80
- if (error instanceof CLIError) return void 0;
81
- throw error;
82
- }
83
- }
84
-
85
- export { resolveDatabaseUrl, tryResolveDatabaseUrl };
@@ -1,32 +0,0 @@
1
- /**
2
- * AI HINT: CI Summary Writer Actor
3
- *
4
- * Purpose: Write structured CI summary to .runa/tmp/ci-summary.json
5
- * Pattern: Fine-grained actor for single step
6
- *
7
- * Used in ci-pr-local mode (not ci-local):
8
- * - Write summary for PR
9
- *
10
- * Contract:
11
- * - Always writes .runa/tmp/ci-summary.json
12
- * - Shape is stable for AI + tooling consumption
13
- */
14
- import { type CiSummary } from '../../../utils/ci-summary.js';
15
- export interface WriteSummaryInput {
16
- cwd?: string;
17
- summary: CiSummary;
18
- }
19
- export interface WriteSummaryOutput {
20
- filePath: string;
21
- error?: string;
22
- }
23
- /**
24
- * Write CI summary to file.
25
- *
26
- * @param input - Summary data
27
- * @returns Path to written file
28
- */
29
- export declare const writeSummaryActor: import("xstate").PromiseActorLogic<WriteSummaryOutput, WriteSummaryInput, import("xstate").EventObject>;
30
- export type { CiSummary };
31
- export { type CiLayerStatus, CiLayerStatusSchema, type CiStepStatus, CiStepStatusSchema, CiSummarySchema, type LayerBlockingLevel, LayerBlockingLevelSchema, } from '../../../utils/ci-summary.js';
32
- //# sourceMappingURL=summary.d.ts.map