@runa-ai/runa-cli 0.7.3 → 0.9.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-HQMSVN6N.js → build-P2A6345N.js} +2 -2
- package/dist/{check-PCSQPYDM.js → check-4TZHNOZU.js} +4 -4
- package/dist/{chunk-DRSUEMAK.js → chunk-B7C7CLW2.js} +2 -5
- package/dist/{chunk-B3POLMII.js → chunk-BQ336L5T.js} +1 -1
- package/dist/{chunk-6FAU4IGR.js → chunk-ELXXQIGW.js} +4 -1
- package/dist/{chunk-FWMGC5FP.js → chunk-EXR4J2JT.js} +289 -16
- package/dist/{chunk-AO554K3G.js → chunk-GKBE7EIE.js} +1 -1
- package/dist/{chunk-JMJP4A47.js → chunk-GT5DMS5R.js} +20 -2
- package/dist/{chunk-3JO6YP3T.js → chunk-IEKYTCYA.js} +1 -1
- package/dist/{chunk-WPMR7RQ4.js → chunk-IWVXI5O4.js} +2 -2
- package/dist/chunk-KUH3G522.js +72 -0
- package/dist/{chunk-VSH3IXDQ.js → chunk-MAFJAA2P.js} +1 -1
- package/dist/{chunk-CCKG5R4Y.js → chunk-MILCC3B6.js} +1 -1
- package/dist/{chunk-5NKWR4FF.js → chunk-OERS32LW.js} +1 -1
- package/dist/{chunk-2QX7T24B.js → chunk-QKGL6Q2S.js} +1 -1
- package/dist/{chunk-OBYZDT2E.js → chunk-URWDB7YL.js} +15 -78
- package/dist/{chunk-CKRLVEIO.js → chunk-WGRVAGSR.js} +16 -11
- package/dist/chunk-YRNQEJQW.js +9043 -0
- package/dist/chunk-ZWDWFMOX.js +1514 -0
- package/dist/{ci-Z4525QW6.js → ci-S5KSBECX.js} +1226 -1207
- package/dist/{cli-SVXOSMW6.js → cli-TJZCAMB2.js} +30 -30
- package/dist/commands/ci/commands/ci-prod-db-operations.d.ts +12 -17
- package/dist/commands/ci/commands/ci-prod-utils.d.ts +7 -0
- package/dist/commands/ci/commands/ci-resolvers.d.ts +1 -2
- package/dist/commands/ci/commands/layer4-discovery.d.ts +2 -0
- package/dist/commands/ci/machine/actors/db/production-preview.d.ts +4 -3
- package/dist/commands/ci/machine/actors/db/sync-schema.d.ts +5 -1
- package/dist/commands/ci/machine/actors/setup/pr-common.d.ts +1 -1
- package/dist/commands/ci/machine/actors/test/capabilities.d.ts +2 -13
- package/dist/commands/ci/machine/actors/test/index.d.ts +1 -0
- package/dist/commands/ci/machine/actors/test/layer-content.d.ts +11 -0
- package/dist/commands/ci/machine/commands/ci-pr-internal-profile.d.ts +7 -0
- package/dist/commands/ci/machine/commands/ci-step-registry.d.ts +25 -0
- package/dist/commands/ci/machine/commands/step-telemetry.d.ts +1 -2
- package/dist/commands/ci/machine/contract.d.ts +9 -1
- package/dist/commands/ci/machine/guards.d.ts +19 -10
- package/dist/commands/ci/machine/helpers.d.ts +1 -1
- package/dist/commands/ci/machine/machine-execution-helpers.d.ts +5 -2
- package/dist/commands/ci/machine/machine.d.ts +34 -32
- package/dist/commands/ci/machine/selectors.d.ts +6 -0
- package/dist/commands/ci/machine/types.d.ts +3 -1
- package/dist/commands/ci/utils/ci-logging.d.ts +16 -0
- package/dist/commands/ci/utils/rls-verification.d.ts +3 -2
- package/dist/commands/db/apply/actors/pg-schema-diff-actors.d.ts +1 -0
- package/dist/commands/db/apply/actors/seed-actors.d.ts +1 -0
- package/dist/commands/db/apply/contract.d.ts +232 -0
- package/dist/commands/db/apply/helpers/fresh-db-handler.d.ts +3 -1
- package/dist/commands/db/apply/helpers/hazard-handler.d.ts +19 -8
- package/dist/commands/db/apply/helpers/index.d.ts +5 -2
- package/dist/commands/db/apply/helpers/no-change-plan.d.ts +2 -0
- package/dist/commands/db/apply/helpers/plan-ast-sql-helpers.d.ts +19 -0
- package/dist/commands/db/apply/helpers/plan-ast.d.ts +1 -2
- package/dist/commands/db/apply/helpers/plan-check-filter.d.ts +11 -14
- package/dist/commands/db/apply/helpers/plan-validator.d.ts +34 -0
- package/dist/commands/db/apply/helpers/planner-artifact.d.ts +65 -0
- package/dist/commands/db/apply/helpers/retry-logic.d.ts +5 -0
- package/dist/commands/db/apply/machine.d.ts +100 -14
- package/dist/commands/db/commands/db-apply-error.d.ts +6 -1
- package/dist/commands/db/commands/db-apply.d.ts +5 -0
- package/dist/commands/db/commands/db-plan.d.ts +3 -0
- package/dist/commands/db/commands/db-preview-profile.d.ts +23 -0
- package/dist/commands/db/commands/db-preview.d.ts +3 -0
- package/dist/commands/db/sync/actors.d.ts +1 -0
- package/dist/commands/db/sync/contract.d.ts +16 -0
- package/dist/commands/db/sync/guardrail-orchestrator.d.ts +15 -0
- package/dist/commands/db/sync/guardrail-reporting.d.ts +12 -0
- package/dist/commands/db/sync/index.d.ts +4 -0
- package/dist/commands/db/sync/machine.d.ts +18 -13
- package/dist/commands/db/sync/schema-guardrail-config-test-support.d.ts +15 -0
- package/dist/commands/db/sync/schema-guardrail-config.d.ts +11 -0
- package/dist/commands/db/sync/schema-guardrail-ddl-order.d.ts +36 -0
- package/dist/commands/db/sync/schema-guardrail-graph-guidance.d.ts +15 -0
- package/dist/commands/db/sync/schema-guardrail-graph-metadata.d.ts +41 -0
- package/dist/commands/db/sync/schema-guardrail-graph-nodes.d.ts +61 -0
- package/dist/commands/db/sync/schema-guardrail-graph-sql-helpers.d.ts +31 -0
- package/dist/commands/db/sync/schema-guardrail-graph-types.d.ts +56 -0
- package/dist/commands/db/sync/schema-guardrail-graph.d.ts +20 -0
- package/dist/commands/db/sync/schema-guardrail-local-blockers.d.ts +7 -0
- package/dist/commands/db/sync/schema-guardrail-phases.d.ts +26 -0
- package/dist/commands/db/sync/schema-guardrail-production-check.d.ts +23 -0
- package/dist/commands/db/sync/schema-guardrail-rewrite.d.ts +46 -0
- package/dist/commands/db/sync/schema-guardrail-runtime.d.ts +5 -0
- package/dist/commands/db/sync/schema-guardrail-semantic-warnings.d.ts +9 -0
- package/dist/commands/db/sync/schema-guardrail-types.d.ts +243 -0
- package/dist/commands/db/sync/schema-guardrail.d.ts +10 -0
- package/dist/commands/db/utils/declarative-dependency-sql-utils.d.ts +1 -1
- package/dist/commands/db/utils/duplicate-function-ownership.d.ts +61 -0
- package/dist/commands/db/utils/plan-size-guard.d.ts +16 -0
- package/dist/commands/db/utils/policy-cross-schema-refs.d.ts +12 -0
- package/dist/commands/db/utils/preflight-checks/duplicate-function-ownership-checks.d.ts +4 -0
- package/dist/commands/db/utils/sql-table-extractor.d.ts +6 -0
- package/dist/commands/test/commands/layer4-prereqs.d.ts +15 -0
- package/dist/{config-loader-GT3HAQ7U.js → config-loader-N5ODNMD5.js} +2 -2
- package/dist/db-D2OLJDYW.js +12757 -0
- package/dist/{dev-MLRKIP7F.js → dev-LGSMDFJN.js} +7 -6
- package/dist/{doctor-ROSWSMLH.js → doctor-GYX73IEW.js} +4 -4
- package/dist/{env-WNHJVLOT.js → env-KYR6Q7WO.js} +15 -10
- package/dist/{env-files-HRNUGZ5O.js → env-files-ONBC47I6.js} +3 -3
- package/dist/{hotfix-Z5EGVSMH.js → hotfix-RJIAPLAM.js} +4 -4
- package/dist/index.js +3 -3
- package/dist/{init-35JLDFHI.js → init-2O6ODG5Z.js} +2 -2
- package/dist/{inject-test-attrs-XN4I2AOR.js → inject-test-attrs-F5A346UV.js} +3 -3
- package/dist/{manifest-EGCAZ4TK.js → manifest-CI4BRWEB.js} +2 -2
- package/dist/{observability-CJA5UFIC.js → observability-WNSCJ5FV.js} +2 -2
- package/dist/pg-schema-diff-helpers-7377FS2D.js +7 -0
- package/dist/{sdk-XK6HQU7S.js → sdk-BTIVPEE5.js} +1 -1
- package/dist/{test-V4KQL574.js → test-QCPN6Z47.js} +74 -46
- package/dist/{upgrade-7L4JIE4K.js → upgrade-QZKEI3NJ.js} +2 -2
- package/dist/utils/db-url-utils.d.ts +4 -77
- package/dist/{vuln-check-D575VXIQ.js → vuln-check-5NUTETPW.js} +1 -1
- package/dist/{vuln-checker-QV6XODTJ.js → vuln-checker-UV342N66.js} +1 -1
- package/dist/{watch-AL4LCBRM.js → watch-RFVCEQLH.js} +3 -3
- package/dist/{workflow-UZIZ2JUS.js → workflow-UOG6ZZMH.js} +3 -3
- package/package.json +3 -3
- package/dist/chunk-4XHZQRRK.js +0 -215
- package/dist/db-S4V4ETDR.js +0 -17556
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createGuardrailOutcomePhases } from './schema-guardrail-phases.js';
|
|
2
|
+
import { runSchemaGuardrailRuntime } from './schema-guardrail-runtime.js';
|
|
3
|
+
import type { SchemaGuardrailReport, SchemaGuardrailStaticInput, SchemaGuardrailStaticResult } from './schema-guardrail-types.js';
|
|
4
|
+
export declare function runSchemaGuardrailStatic(input: SchemaGuardrailStaticInput): Promise<SchemaGuardrailStaticResult>;
|
|
5
|
+
export declare function createSyncApplyFailureReport(report: SchemaGuardrailReport, message: string, options?: {
|
|
6
|
+
applyCommitted?: boolean;
|
|
7
|
+
}): SchemaGuardrailReport;
|
|
8
|
+
export { createGuardrailOutcomePhases };
|
|
9
|
+
export { runSchemaGuardrailRuntime };
|
|
10
|
+
//# sourceMappingURL=schema-guardrail.d.ts.map
|
|
@@ -36,7 +36,7 @@ export declare const STATIC_EXECUTE_LITERAL_RE: RegExp;
|
|
|
36
36
|
export declare const DOLLAR_TAG_RE: RegExp;
|
|
37
37
|
export declare const PUBLIC_SCHEMA = "public";
|
|
38
38
|
export declare function countNewlines(text: string): number;
|
|
39
|
-
export declare function collectSqlFiles(targetDir: string, layer: SqlLayer): SqlFile[];
|
|
39
|
+
export declare function collectSqlFiles(targetDir: string, layer: SqlLayer, relativeDir?: string): SqlFile[];
|
|
40
40
|
export declare function blankQuotedStrings(content: string): string;
|
|
41
41
|
export declare function sanitizeTopLevelSql(statement: string): string;
|
|
42
42
|
export declare function sanitizeExecutableCode(content: string): string;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI HINT: Duplicate Function Ownership Detector
|
|
3
|
+
*
|
|
4
|
+
* Purpose: Detect functions defined in BOTH declarative and idempotent SQL layers.
|
|
5
|
+
* Declarative SQL owns function definitions (pg-schema-diff manages them);
|
|
6
|
+
* idempotent SQL must not redefine declarative-managed functions.
|
|
7
|
+
*
|
|
8
|
+
* Key Functions:
|
|
9
|
+
* - analyzeDuplicateFunctionOwnership(targetDir): Scan declarative/ and idempotent/
|
|
10
|
+
* directories, collect all CREATE FUNCTION definitions, and report duplicates.
|
|
11
|
+
* - formatDuplicateFunctionOwnershipFinding(finding): Format a finding for CLI display.
|
|
12
|
+
*
|
|
13
|
+
* SQL Parsing Approach:
|
|
14
|
+
* - Uses regex-based CREATE [OR REPLACE] FUNCTION detection (from FUNCTION_DEFINITION_RE)
|
|
15
|
+
* - Signature normalization: strips parameter names, canonicalizes type aliases,
|
|
16
|
+
* handles dollar-quoting, nested parens, and DEFAULT expressions
|
|
17
|
+
* - Groups by qualified name (schema.function) and matches by normalized signature
|
|
18
|
+
*
|
|
19
|
+
* Finding Codes:
|
|
20
|
+
* - DUPLICATE_FUNCTION_OWNERSHIP: Exact signature match across layers
|
|
21
|
+
* - DUPLICATE_FUNCTION_OWNERSHIP_AMBIGUOUS: Same name but signature could not be matched
|
|
22
|
+
*/
|
|
23
|
+
import { type SqlLayer } from './declarative-dependency-sql-utils.js';
|
|
24
|
+
export interface FunctionOwnershipDefinition {
|
|
25
|
+
qualifiedName: string;
|
|
26
|
+
signature: string | null;
|
|
27
|
+
file: string;
|
|
28
|
+
line: number;
|
|
29
|
+
layer: SqlLayer;
|
|
30
|
+
}
|
|
31
|
+
export interface DuplicateFunctionOwnershipFinding {
|
|
32
|
+
code: 'DUPLICATE_FUNCTION_OWNERSHIP' | 'DUPLICATE_FUNCTION_OWNERSHIP_AMBIGUOUS';
|
|
33
|
+
qualifiedName: string;
|
|
34
|
+
signature: string | null;
|
|
35
|
+
message: string;
|
|
36
|
+
suggestion: string;
|
|
37
|
+
declarativeDefinitions: FunctionOwnershipDefinition[];
|
|
38
|
+
idempotentDefinitions: FunctionOwnershipDefinition[];
|
|
39
|
+
}
|
|
40
|
+
export interface DuplicateFunctionOwnershipAnalysisResult {
|
|
41
|
+
contractNote: string;
|
|
42
|
+
findings: DuplicateFunctionOwnershipFinding[];
|
|
43
|
+
definitions: {
|
|
44
|
+
declarative: FunctionOwnershipDefinition[];
|
|
45
|
+
idempotent: FunctionOwnershipDefinition[];
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export interface FormattedDuplicateFunctionOwnershipFinding {
|
|
49
|
+
summary: string;
|
|
50
|
+
declarativeLocations: string[];
|
|
51
|
+
idempotentLocations: string[];
|
|
52
|
+
suggestion: string;
|
|
53
|
+
}
|
|
54
|
+
export declare const DUPLICATE_FUNCTION_OWNERSHIP_NOTE = "Function ownership belongs to declarative SQL; idempotent 2nd pass must not redefine declarative-managed functions.";
|
|
55
|
+
export declare function extractFunctionOwnershipDefinition(statement: string, file: string, line: number, layer: SqlLayer): FunctionOwnershipDefinition | null;
|
|
56
|
+
export declare function analyzeDuplicateFunctionOwnership(targetDir: string, options?: {
|
|
57
|
+
declarativeSqlDir?: string;
|
|
58
|
+
idempotentSqlDir?: string;
|
|
59
|
+
}): DuplicateFunctionOwnershipAnalysisResult;
|
|
60
|
+
export declare function formatDuplicateFunctionOwnershipFinding(finding: DuplicateFunctionOwnershipFinding): FormattedDuplicateFunctionOwnershipFinding;
|
|
61
|
+
//# sourceMappingURL=duplicate-function-ownership.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { DbApplyPlanSummary } from '../apply/contract.js';
|
|
2
|
+
export declare const PLAN_SIZE_WARNING_THRESHOLD: {
|
|
3
|
+
readonly effectiveStatements: 200;
|
|
4
|
+
readonly rawStatements: 500;
|
|
5
|
+
};
|
|
6
|
+
export declare const PLAN_SIZE_BLOCKER_THRESHOLD: {
|
|
7
|
+
readonly effectiveStatements: 500;
|
|
8
|
+
readonly rawStatements: 1000;
|
|
9
|
+
};
|
|
10
|
+
export interface PlanSizeAssessment {
|
|
11
|
+
severity: 'ok' | 'warning' | 'blocker';
|
|
12
|
+
reasons: string[];
|
|
13
|
+
}
|
|
14
|
+
export declare function assessPlanSize(summary: DbApplyPlanSummary | undefined): PlanSizeAssessment;
|
|
15
|
+
export declare function formatPlanSizeSummary(summary: DbApplyPlanSummary): string;
|
|
16
|
+
//# sourceMappingURL=plan-size-guard.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type PolicyCrossSchemaReference = {
|
|
2
|
+
policySchema: string;
|
|
3
|
+
refSchema: string;
|
|
4
|
+
refTable: string;
|
|
5
|
+
qualifiedRef: string;
|
|
6
|
+
line: number;
|
|
7
|
+
};
|
|
8
|
+
export declare function collectPolicyCrossSchemaReferences(params: {
|
|
9
|
+
content: string;
|
|
10
|
+
managedSchemas: Iterable<string>;
|
|
11
|
+
}): PolicyCrossSchemaReference[];
|
|
12
|
+
//# sourceMappingURL=policy-cross-schema-refs.d.ts.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { createCLILogger } from '@runa-ai/runa';
|
|
2
|
+
import type { PreflightCheckResult, StepCounter } from '../preflight-check.js';
|
|
3
|
+
export declare function runDuplicateFunctionOwnershipCheck(result: PreflightCheckResult, logger: ReturnType<typeof createCLILogger>, step: StepCounter): Promise<void>;
|
|
4
|
+
//# sourceMappingURL=duplicate-function-ownership-checks.d.ts.map
|
|
@@ -25,6 +25,11 @@ import type { ForeignKeyDefinition, TableEntry } from '@runa-ai/runa/manifests';
|
|
|
25
25
|
interface SqlParserUtils {
|
|
26
26
|
isSqlParserAvailable(): Promise<boolean>;
|
|
27
27
|
parseSchemaDocument(sqlContent: string): Promise<{
|
|
28
|
+
schemas: Array<{
|
|
29
|
+
name: string;
|
|
30
|
+
ifNotExists: boolean;
|
|
31
|
+
lineNumber?: number;
|
|
32
|
+
}>;
|
|
28
33
|
tables: Array<{
|
|
29
34
|
schema: string;
|
|
30
35
|
name: string;
|
|
@@ -58,6 +63,7 @@ interface SqlParserUtils {
|
|
|
58
63
|
for: 'select' | 'insert' | 'update' | 'delete' | 'all';
|
|
59
64
|
using?: string;
|
|
60
65
|
withCheck?: string;
|
|
66
|
+
lineNumber?: number;
|
|
61
67
|
}>;
|
|
62
68
|
}>;
|
|
63
69
|
parseCreateTables(sqlContent: string): Promise<unknown>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type Layer4ManifestFlagOptions = {
|
|
2
|
+
requireManifest?: boolean;
|
|
3
|
+
allowManifestFallback?: boolean;
|
|
4
|
+
};
|
|
5
|
+
type Layer4ManifestResolutionOptions = Layer4ManifestFlagOptions & {
|
|
6
|
+
exclusiveErrorCode: string;
|
|
7
|
+
};
|
|
8
|
+
type Layer4InjectOptions = {
|
|
9
|
+
verbose?: boolean;
|
|
10
|
+
requireManifest?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare function resolveLayer4RequireManifest(options: Layer4ManifestResolutionOptions): boolean | undefined;
|
|
13
|
+
export declare function injectLayer4TestAttrs(options?: Layer4InjectOptions): void;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=layer4-prereqs.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'module';
|
|
3
|
-
export { getAppConfig, getDatabaseConfig, getDatabasePackagePath, getDeployConfig, getSDKScriptsPath, getSDKTemplatesPath, isMonorepo, loadRunaConfig, validateRunaConfig } from './chunk-
|
|
4
|
-
import './chunk-
|
|
3
|
+
export { getAppConfig, getDatabaseConfig, getDatabasePackagePath, getDeployConfig, getSDKScriptsPath, getSDKTemplatesPath, isMonorepo, loadRunaConfig, validateRunaConfig } from './chunk-OERS32LW.js';
|
|
4
|
+
import './chunk-GT5DMS5R.js';
|
|
5
5
|
import './chunk-VRXHCR5K.js';
|
|
6
6
|
|
|
7
7
|
createRequire(import.meta.url);
|