@runa-ai/runa-cli 0.7.1 → 0.7.3
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-HUDIP6KU.js → build-HQMSVN6N.js} +3 -3
- package/dist/{check-LOMVIRHX.js → check-PCSQPYDM.js} +2 -2
- package/dist/{chunk-QM53IQHM.js → chunk-2QX7T24B.js} +1 -1
- package/dist/{chunk-CCW3PLQY.js → chunk-3JO6YP3T.js} +1 -1
- package/dist/{chunk-XDCHRVE3.js → chunk-4XHZQRRK.js} +2 -2
- package/dist/{chunk-7B5C6U2K.js → chunk-A6A7JIRD.js} +35 -2
- package/dist/{chunk-AFY3TX4I.js → chunk-AO554K3G.js} +1 -1
- package/dist/{chunk-Z4Z5DNW4.js → chunk-B3POLMII.js} +12 -0
- package/dist/chunk-CKRLVEIO.js +119 -0
- package/dist/{chunk-HD74F6W2.js → chunk-FWMGC5FP.js} +1 -0
- package/dist/{chunk-FHG3ILE4.js → chunk-OBYZDT2E.js} +38 -8
- package/dist/{chunk-H2AHNI75.js → chunk-PAWNJA3N.js} +1 -1
- package/dist/{chunk-VM3IWOT5.js → chunk-QSEF4T3Y.js} +13 -5
- package/dist/{chunk-NPSRD26F.js → chunk-UHDAYPHH.js} +1 -1
- package/dist/{chunk-2APB25TT.js → chunk-VSH3IXDQ.js} +7 -3
- package/dist/{chunk-644FVGIQ.js → chunk-WPMR7RQ4.js} +9 -2
- package/dist/{chunk-EMB6IZFT.js → chunk-XVNDDHAF.js} +20 -1
- package/dist/{risk-detector-plpgsql-HWKS4OLR.js → chunk-Y5ANTCKE.js} +3 -412
- package/dist/{ci-XY6IKEDC.js → ci-Z4525QW6.js} +2150 -488
- package/dist/{cli-UZA4RBNQ.js → cli-SVXOSMW6.js} +72 -54
- package/dist/commands/ci/commands/ci-prod-db-operations.d.ts +6 -4
- package/dist/commands/ci/commands/ci-prod-types.d.ts +3 -0
- package/dist/commands/ci/commands/ci-prod-workflow.d.ts +1 -1
- package/dist/commands/ci/commands/ci-resolvers.d.ts +1 -1
- package/dist/commands/ci/commands/ci-supabase-local.d.ts +4 -0
- package/dist/commands/ci/machine/actors/build/build-and-playwright.d.ts +1 -1
- package/dist/commands/ci/machine/actors/db/collect-schema-stats.d.ts +11 -1
- package/dist/commands/ci/machine/actors/db/production-preview.d.ts +22 -4
- package/dist/commands/ci/machine/actors/db/schema-canonical-diff.d.ts +8 -1
- package/dist/commands/ci/machine/actors/db/sync-schema.d.ts +1 -0
- package/dist/commands/ci/machine/actors/finalize/index.d.ts +0 -1
- package/dist/commands/ci/machine/actors/index.d.ts +1 -1
- package/dist/commands/ci/machine/actors/setup/local.d.ts +2 -0
- package/dist/commands/ci/machine/actors/setup/pr-common.d.ts +3 -0
- package/dist/commands/ci/machine/actors/setup/pr-local.d.ts +2 -0
- package/dist/commands/ci/machine/commands/machine-runner.d.ts +5 -1
- package/dist/commands/ci/machine/commands/step-telemetry.d.ts +16 -0
- package/dist/commands/ci/machine/contract.d.ts +40 -0
- package/dist/commands/ci/machine/formatters/github-comment-types.d.ts +7 -2
- package/dist/commands/ci/machine/formatters/github-comment.d.ts +2 -1
- package/dist/commands/ci/machine/formatters/sections/final-comment.d.ts +2 -1
- package/dist/commands/ci/machine/formatters/sections/index.d.ts +1 -1
- package/dist/commands/ci/machine/formatters/summary.d.ts +4 -4
- package/dist/commands/ci/machine/guards.d.ts +4 -0
- package/dist/commands/ci/machine/helpers.d.ts +25 -0
- package/dist/commands/ci/machine/machine-state-helpers.d.ts +1 -1
- package/dist/commands/ci/machine/machine.d.ts +15 -8
- package/dist/commands/ci/machine/types.d.ts +9 -0
- package/dist/commands/ci/utils/ci-diagnostics.d.ts +67 -0
- package/dist/commands/ci/utils/ci-summary.d.ts +118 -0
- package/dist/commands/ci/utils/db-url-utils.d.ts +4 -77
- package/dist/commands/ci/utils/github-api.d.ts +14 -0
- package/dist/commands/db/apply/contract.d.ts +73 -0
- package/dist/commands/db/apply/helpers/alter-statement-parsers.d.ts +95 -0
- package/dist/commands/db/apply/helpers/data-compatibility-checker.d.ts +0 -61
- package/dist/commands/db/apply/helpers/function-plan-false-positive-filter.d.ts +36 -0
- package/dist/commands/db/apply/helpers/hazard-handler.d.ts +4 -4
- package/dist/commands/db/apply/helpers/index.d.ts +14 -5
- package/dist/commands/db/apply/helpers/partition-acl-cleaner.d.ts +3 -1
- package/dist/commands/db/apply/helpers/pg-schema-diff-helpers.d.ts +69 -6
- package/dist/commands/db/apply/helpers/plan-ast.d.ts +56 -0
- package/dist/commands/db/apply/helpers/plan-check-filter.d.ts +26 -0
- package/dist/commands/db/apply/helpers/plan-drop-protection.d.ts +43 -0
- package/dist/commands/db/apply/helpers/plan-ordering.d.ts +6 -0
- package/dist/commands/db/apply/helpers/plan-statement-parser.d.ts +39 -0
- package/dist/commands/db/apply/helpers/plan-validator.d.ts +8 -40
- package/dist/commands/db/apply/helpers/retry-logic.d.ts +1 -10
- package/dist/commands/db/apply/helpers/temp-db-bootstrap.d.ts +18 -0
- package/dist/commands/db/apply/helpers/temp-db-dsn.d.ts +14 -0
- package/dist/commands/db/apply/machine.d.ts +56 -32
- package/dist/commands/db/commands/db-apply-error.d.ts +5 -0
- package/dist/commands/db/commands/db-apply.d.ts +2 -0
- package/dist/commands/db/commands/db-sync/directory-placement-check.d.ts +4 -0
- package/dist/commands/db/commands/db-sync/error-classifier.d.ts +1 -1
- package/dist/commands/db/commands/db-sync/plan-boundary-reconciliation.d.ts +3 -0
- package/dist/commands/db/commands/db-sync/precheck-helpers.d.ts +18 -0
- package/dist/commands/db/commands/db-sync/production-precheck.d.ts +15 -0
- package/dist/commands/db/commands/db-sync/risk-scan-collectors.d.ts +11 -0
- package/dist/commands/db/commands/db-sync.d.ts +11 -5
- package/dist/commands/db/sync/contract.d.ts +80 -0
- package/dist/commands/db/sync/machine.d.ts +60 -1
- package/dist/commands/db/types.d.ts +5 -0
- package/dist/commands/db/utils/boundary-policy/rule-compiler.d.ts +2 -1
- package/dist/commands/db/utils/boundary-policy/types.d.ts +23 -0
- package/dist/commands/db/utils/boundary-policy-runtime.d.ts +12 -3
- package/dist/commands/db/utils/boundary-policy.d.ts +1 -1
- package/dist/commands/db/utils/db-target.d.ts +5 -3
- package/dist/commands/db/utils/declarative-dependency-collectors.d.ts +6 -0
- package/dist/commands/db/utils/declarative-dependency-contract.d.ts +78 -0
- package/dist/commands/db/utils/declarative-dependency-sql-utils.d.ts +49 -0
- package/dist/commands/db/utils/declarative-dependency-warning-governance.d.ts +24 -0
- package/dist/commands/db/utils/preflight-check.d.ts +1 -1
- package/dist/commands/db/utils/preflight-checks/declarative-dependency-checks.d.ts +4 -0
- package/dist/commands/db/utils/preflight-checks/idempotent-risk-checks.d.ts +4 -0
- package/dist/commands/db/utils/preflight-checks/schema-boundary-checks.d.ts +4 -0
- package/dist/commands/db/utils/preflight-checks/schema-risk-policy.d.ts +4 -0
- package/dist/commands/db/utils/preflight-checks/supabase-checks.d.ts +12 -0
- package/dist/commands/db/utils/psql.d.ts +23 -0
- package/dist/commands/db/utils/sql-table-extractor.d.ts +42 -1
- package/dist/commands/env/commands/setup/types.d.ts +1 -0
- package/dist/commands/env/constants/local-supabase.d.ts +4 -1
- package/dist/commands/observability.d.ts +72 -0
- package/dist/commands/observability.helpers.d.ts +25 -0
- package/dist/commands/template-check/contract.d.ts +3 -3
- package/dist/commands/template-check/machine.d.ts +1 -1
- package/dist/commands/workflow/commands/deploy-production.d.ts +0 -1
- package/dist/constants/versions.d.ts +1 -1
- package/dist/{db-Q3GF7JWP.js → db-S4V4ETDR.js} +14629 -11270
- package/dist/{dev-5YXNPTCJ.js → dev-MLRKIP7F.js} +5 -5
- package/dist/{doctor-MZLOA53G.js → doctor-ROSWSMLH.js} +2 -2
- package/dist/{env-GMB3THRG.js → env-WNHJVLOT.js} +37 -20
- package/dist/{env-HMMRSYCI.js → env-XPPACZM4.js} +2 -2
- package/dist/{env-files-2UIUYLLR.js → env-files-HRNUGZ5O.js} +1 -1
- package/dist/{error-handler-HEXBRNVV.js → error-handler-YRQWRDEF.js} +17 -0
- package/dist/{hotfix-NDTPY2T4.js → hotfix-Z5EGVSMH.js} +4 -4
- package/dist/index.js +4 -4
- package/dist/{init-U4VCRHTD.js → init-35JLDFHI.js} +1 -1
- package/dist/{inject-test-attrs-P44BVTQS.js → inject-test-attrs-XN4I2AOR.js} +2 -2
- package/dist/internal/machines/index.d.ts +1 -1
- package/dist/internal/machines/snapshot-helpers.d.ts +6 -0
- package/dist/{manifest-TMFLESHW.js → manifest-EGCAZ4TK.js} +1 -1
- package/dist/observability-CJA5UFIC.js +721 -0
- package/dist/{risk-detector-4U6ZJ2G5.js → risk-detector-S7XQF4I2.js} +1 -1
- package/dist/{risk-detector-core-TK4OAI3N.js → risk-detector-core-TGFKWHRS.js} +61 -3
- package/dist/risk-detector-plpgsql-O32TUR34.js +736 -0
- package/dist/{template-check-FFJVDLBF.js → template-check-BDFMT6ZO.js} +1 -1
- package/dist/{upgrade-7TWORWBV.js → upgrade-7L4JIE4K.js} +1 -1
- package/dist/utils/db-url-utils.d.ts +81 -0
- package/dist/validators/risk-detector-plpgsql.d.ts +3 -1
- package/dist/{vuln-check-6CMNPSBR.js → vuln-check-D575VXIQ.js} +1 -1
- package/dist/{vuln-checker-EJJTNDNE.js → vuln-checker-QV6XODTJ.js} +1 -1
- package/dist/{watch-PNTKZYFB.js → watch-AL4LCBRM.js} +1 -1
- package/dist/{workflow-H75N4BXX.js → workflow-UZIZ2JUS.js} +2 -3
- package/package.json +3 -3
- package/dist/chunk-AKZAN4BC.js +0 -90
- 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-
|
|
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';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'module';
|
|
3
|
-
import { fetchTemplates } from './chunk-
|
|
3
|
+
import { fetchTemplates } from './chunk-3JO6YP3T.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
|
|
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-
|
|
74
|
+
const { VulnChecker } = await import('./vuln-checker-QV6XODTJ.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-
|
|
3
|
+
import { CLI_VERSION } from './chunk-AO554K3G.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-
|
|
287
|
+
riskDetectorLoader = import('./risk-detector-S7XQF4I2.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
|
|
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 (
|
|
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.
|
|
3
|
+
"version": "0.7.3",
|
|
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.
|
|
60
|
-
"@runa-ai/runa
|
|
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"
|
package/dist/chunk-AKZAN4BC.js
DELETED
|
@@ -1,90 +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 getExplicitLocalAdminUrl() {
|
|
29
|
-
const explicitAdminUrl = process.env.DATABASE_URL_ADMIN?.trim();
|
|
30
|
-
if (!explicitAdminUrl) return void 0;
|
|
31
|
-
return isLocalDatabaseUrl(explicitAdminUrl) ? explicitAdminUrl : void 0;
|
|
32
|
-
}
|
|
33
|
-
function resolveDatabaseUrl(environment) {
|
|
34
|
-
switch (environment) {
|
|
35
|
-
case "local": {
|
|
36
|
-
const url = getExplicitLocalAdminUrl() || getLocalDatabaseUrl();
|
|
37
|
-
if (!isLocalDatabaseUrl(url)) {
|
|
38
|
-
throw new CLIError("Local database URL appears to be a remote URL", "LOCAL_DB_URL_REMOTE", [
|
|
39
|
-
"Local operations should use the local Supabase instance",
|
|
40
|
-
// SECURITY (Issue #513): Redact credentials from database URL in error message
|
|
41
|
-
`Current URL: ${redactSecrets(url)}`,
|
|
42
|
-
"If you need to connect to a remote DB, use --env preview or --env production"
|
|
43
|
-
]);
|
|
44
|
-
}
|
|
45
|
-
return url;
|
|
46
|
-
}
|
|
47
|
-
case "preview": {
|
|
48
|
-
const url = process.env.DATABASE_URL_ADMIN || env.DATABASE_URL || process.env.DATABASE_URL;
|
|
49
|
-
if (!url) {
|
|
50
|
-
throw new CLIError("Preview database URL not found", "PREVIEW_DB_URL_NOT_FOUND", [
|
|
51
|
-
"Set DATABASE_URL_ADMIN environment variable (for DDL/migrations)",
|
|
52
|
-
"Or set DATABASE_URL as fallback"
|
|
53
|
-
]);
|
|
54
|
-
}
|
|
55
|
-
return url;
|
|
56
|
-
}
|
|
57
|
-
case "main":
|
|
58
|
-
case "production": {
|
|
59
|
-
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;
|
|
60
|
-
if (!url) {
|
|
61
|
-
throw new CLIError("Production database URL not found", "PRODUCTION_DB_URL_NOT_FOUND", [
|
|
62
|
-
"Set DATABASE_URL_ADMIN environment variable (for DDL/migrations)",
|
|
63
|
-
"Or set GH_DATABASE_URL_ADMIN (CI) / DATABASE_URL as fallback"
|
|
64
|
-
]);
|
|
65
|
-
}
|
|
66
|
-
if (isLocalDatabaseUrl(url)) {
|
|
67
|
-
throw new CLIError(
|
|
68
|
-
"Production database URL points to localhost",
|
|
69
|
-
"PRODUCTION_DB_URL_IS_LOCAL",
|
|
70
|
-
[
|
|
71
|
-
"Use --env local for local Supabase operations",
|
|
72
|
-
"Production operations require a remote database URL",
|
|
73
|
-
"Set DATABASE_URL_ADMIN or GH_DATABASE_URL_ADMIN to the production database URL"
|
|
74
|
-
]
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
return url;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
function tryResolveDatabaseUrl(environment) {
|
|
82
|
-
try {
|
|
83
|
-
return resolveDatabaseUrl(environment);
|
|
84
|
-
} catch (error) {
|
|
85
|
-
if (error instanceof CLIError) return void 0;
|
|
86
|
-
throw error;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
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
|