@runa-ai/runa-cli 0.5.40 → 0.5.41

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.
@@ -1 +1 @@
1
- {"version":3,"file":"db-cleanup.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/commands/db-cleanup.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA4NpC,eAAO,MAAM,cAAc,SAMoE,CAAC"}
1
+ {"version":3,"file":"db-cleanup.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/commands/db-cleanup.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA4OpC,eAAO,MAAM,cAAc,SAMoE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"db-sync.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/commands/db-sync.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsKpC,eAAO,MAAM,YAAY,SAIgE,CAAC"}
1
+ {"version":3,"file":"db-sync.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/commands/db-sync.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0LpC,eAAO,MAAM,YAAY,SAIgE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"actors.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/sync/actors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAuBH,OAAO,KAAK,EACV,kBAAkB,EAIlB,WAAW,EAEZ,MAAM,eAAe,CAAC;AAMvB,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,kBAAkB,CAAC;CAC3B;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,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W,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;CACvB;AA+CD;;GAEG;AACH,eAAO,MAAM,YAAY,2FAuBxB,CAAC;AAMF,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,WAAW,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;GAEG;AACH,eAAO,MAAM,SAAS;;;;;gDA8FrB,CAAC;AAMF,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,WAAW,CAAC;CAClB;AAED;;GAEG;AACH,eAAO,MAAM,SAAS;;;;gDA2BrB,CAAC;AAMF,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,WAAW,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;CACvB;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;;+CAsCpB,CAAC;AAMF,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,WAAW,CAAC;CAClB;AAED;;GAEG;AACH,eAAO,MAAM,UAAU;;;;2CA8BtB,CAAC;AAMF,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,WAAW,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,6FA0FvB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"preflight-check.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/utils/preflight-check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAiBH,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAqqBD;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAenF"}
1
+ {"version":3,"file":"preflight-check.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/utils/preflight-check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAsBH,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAwrBD;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAenF"}
@@ -76,4 +76,27 @@ export declare function diffSchema(params: {
76
76
  /** Tables to exclude from orphan detection (supports glob patterns) */
77
77
  excludeFromOrphanDetection?: string[];
78
78
  }): SyncDiff;
79
+ /**
80
+ * Extract table names from CREATE TABLE statements in idempotent SQL files.
81
+ *
82
+ * This function scans idempotent/*.sql files and extracts table names from
83
+ * CREATE TABLE statements. These tables are automatically excluded from
84
+ * orphan detection because they are intentionally managed outside of
85
+ * declarative SQL (e.g., partitioned tables, extension-dependent tables).
86
+ *
87
+ * Supported patterns:
88
+ * - CREATE TABLE schema.table
89
+ * - CREATE TABLE IF NOT EXISTS schema.table
90
+ * - CREATE TABLE "schema"."table"
91
+ * - CREATE TABLE table (defaults to public schema)
92
+ *
93
+ * @param idempotentDir - Path to idempotent SQL directory
94
+ * @param projectRoot - Project root for path resolution
95
+ * @returns Array of table names in 'schema.table' format
96
+ *
97
+ * @example
98
+ * const tables = extractTablesFromIdempotentSql('supabase/schemas/idempotent');
99
+ * // Returns: ['public.area_metrics', 'public.floor_metrics', ...]
100
+ */
101
+ export declare function extractTablesFromIdempotentSql(idempotentDir: string, projectRoot?: string): string[];
79
102
  //# sourceMappingURL=schema-sync.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema-sync.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/utils/schema-sync.ts"],"names":[],"mappings":"AA0KA,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,QAAQ;IACvB,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5B,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAC3C,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACtB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAErC,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,mBAAmB,EAAE,KAAK,CAAC;QACzB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,YAAY,EAAE,MAAM,EAAE,CAAC;QACvB,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,OAAO,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC,CAAC;CACJ;AAMD;;;;;;;;;;;GAWG;AACH,wBAAsB,2BAA2B,CAC/C,aAAa,EAAE,MAAM,EACrB,WAAW,GAAE,MAAsB,GAClC,OAAO,CAAC;IACT,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5B,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;CAC5C,CAAC,CAoCD;AAED;;;;;;;GAOG;AACH,wBAAsB,qBAAqB,CACzC,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE;IACR,SAAS,CA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CV"}
@@ -39,6 +39,7 @@ export declare function parseVercelUrl(url: string): {
39
39
  * - https://github.com/owner/repo/tree/main
40
40
  * - https://github.com/owner/repo.git
41
41
  * - github.com/owner/repo
42
+ * - git@github.com:owner/repo.git (SSH)
42
43
  * - owner/repo (shorthand)
43
44
  *
44
45
  * Note: Subpaths like /tree/main, /pulls are ignored
@@ -1 +1 @@
1
- {"version":3,"file":"parsers.d.ts","sourceRoot":"","sources":["../../../../../src/commands/env/commands/setup/parsers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH;;GAEG;AACH,wBAAgB,0BAA0B,IAAI,MAAM,CAEnD;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,IAAI,MAAM,CAEvD;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,CAElD;AAMD;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAUpF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CA4BlF;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAwB3D;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE7D"}
1
+ {"version":3,"file":"parsers.d.ts","sourceRoot":"","sources":["../../../../../src/commands/env/commands/setup/parsers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH;;GAEG;AACH,wBAAgB,0BAA0B,IAAI,MAAM,CAEnD;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,IAAI,MAAM,CAEvD;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,CAElD;AAMD;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAUpF;AAqDD;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAsClF;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAwB3D;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE7D"}
@@ -1 +1 @@
1
- {"version":3,"file":"path-mapping.d.ts","sourceRoot":"","sources":["../../../../src/commands/template-check/utils/path-mapping.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAMhD,MAAM,WAAW,eAAe;IAC9B,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,iFAAiF;IACjF,QAAQ,EAAE,MAAM,CAAC;IACjB,oBAAoB;IACpB,QAAQ,EAAE,YAAY,CAAC;IACvB,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAMD,eAAO,MAAM,kBAAkB,EAAE,eAAe,EA+V/C,CAAC;AAMF;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAyB3E;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAyB/E;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAO7D;AAmCD;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,GAAG,MAAM,CAQ/E"}
1
+ {"version":3,"file":"path-mapping.d.ts","sourceRoot":"","sources":["../../../../src/commands/template-check/utils/path-mapping.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAMhD,MAAM,WAAW,eAAe;IAC9B,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,iFAAiF;IACjF,QAAQ,EAAE,MAAM,CAAC;IACjB,oBAAoB;IACpB,QAAQ,EAAE,YAAY,CAAC;IACvB,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAMD,eAAO,MAAM,kBAAkB,EAAE,eAAe,EAiY/C,CAAC;AAMF;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAyB3E;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAyB/E;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAO7D;AAmCD;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,GAAG,MAAM,CAQ/E"}
@@ -20,7 +20,7 @@
20
20
  *
21
21
  * Sync strategy: Keep this in sync with packages/runa-templates/package.json version.
22
22
  */
23
- export declare const COMPATIBLE_TEMPLATES_VERSION = "0.5.40";
23
+ export declare const COMPATIBLE_TEMPLATES_VERSION = "0.5.41";
24
24
  /**
25
25
  * Templates package name on GitHub Packages.
26
26
  * Published to npm.pkg.github.com (requires NODE_AUTH_TOKEN).
package/dist/index.js CHANGED
@@ -925,7 +925,7 @@ var CLI_VERSION, HAS_ADMIN_COMMAND;
925
925
  var init_version = __esm({
926
926
  "src/version.ts"() {
927
927
  init_esm_shims();
928
- CLI_VERSION = "0.5.40";
928
+ CLI_VERSION = "0.5.41";
929
929
  HAS_ADMIN_COMMAND = false;
930
930
  }
931
931
  });
@@ -7220,7 +7220,7 @@ function printSummary(logger16, output3) {
7220
7220
  }
7221
7221
  }
7222
7222
  function findRepoRoot(startDir) {
7223
- const { existsSync: existsSync50, readFileSync: readFileSync27 } = __require("fs");
7223
+ const { existsSync: existsSync50, readFileSync: readFileSync28 } = __require("fs");
7224
7224
  const { join: join22, dirname: dirname5 } = __require("path");
7225
7225
  let current = startDir;
7226
7226
  while (current !== dirname5(current)) {
@@ -7230,7 +7230,7 @@ function findRepoRoot(startDir) {
7230
7230
  const pkgPath = join22(current, "package.json");
7231
7231
  if (existsSync50(pkgPath)) {
7232
7232
  try {
7233
- const pkg = JSON.parse(readFileSync27(pkgPath, "utf-8"));
7233
+ const pkg = JSON.parse(readFileSync28(pkgPath, "utf-8"));
7234
7234
  if (pkg.workspaces) {
7235
7235
  return current;
7236
7236
  }
@@ -7527,8 +7527,8 @@ function readPortFromScripts(appDir) {
7527
7527
  const pkgPath = path10__default.join(appDir, "package.json");
7528
7528
  if (!existsSync(pkgPath)) return 3e3;
7529
7529
  try {
7530
- const { readFileSync: readFileSync27 } = __require("fs");
7531
- const raw = readFileSync27(pkgPath, "utf-8");
7530
+ const { readFileSync: readFileSync28 } = __require("fs");
7531
+ const raw = readFileSync28(pkgPath, "utf-8");
7532
7532
  const parsed = JSON.parse(raw);
7533
7533
  const scripts = parsed.scripts;
7534
7534
  for (const key of ["start:ci", "start", "dev"]) {
@@ -7546,8 +7546,8 @@ function findWebAppUnderApps(repoRoot) {
7546
7546
  const appsDir = path10__default.join(repoRoot, "apps");
7547
7547
  if (!existsSync(appsDir)) return null;
7548
7548
  try {
7549
- const { readdirSync: readdirSync10 } = __require("fs");
7550
- const entries = readdirSync10(appsDir, { withFileTypes: true });
7549
+ const { readdirSync: readdirSync11 } = __require("fs");
7550
+ const entries = readdirSync11(appsDir, { withFileTypes: true });
7551
7551
  const priority = ["web", "dashboard", "app", "frontend", "client"];
7552
7552
  for (const name of priority) {
7553
7553
  const candidate = path10__default.join(appsDir, name);
@@ -9559,8 +9559,8 @@ async function detectRisks(repoRoot, tmpDir) {
9559
9559
  } catch (error) {
9560
9560
  let logContent = "";
9561
9561
  try {
9562
- const { readFileSync: readFileSync27 } = await import('fs');
9563
- logContent = readFileSync27(logFile, "utf-8");
9562
+ const { readFileSync: readFileSync28 } = await import('fs');
9563
+ logContent = readFileSync28(logFile, "utf-8");
9564
9564
  } catch {
9565
9565
  }
9566
9566
  const isInitialDeployment = logContent.includes("No common ancestor") || logContent.includes("INITIAL DEPLOYMENT");
@@ -9688,8 +9688,8 @@ async function applyProductionSchema(repoRoot, tmpDir, productionDbUrlAdmin, pro
9688
9688
  const totalMs = Date.now() - startTime;
9689
9689
  let logContent = "";
9690
9690
  try {
9691
- const { readFileSync: readFileSync27 } = await import('fs');
9692
- logContent = readFileSync27(logPath, "utf-8");
9691
+ const { readFileSync: readFileSync28 } = await import('fs');
9692
+ logContent = readFileSync28(logPath, "utf-8");
9693
9693
  } catch {
9694
9694
  }
9695
9695
  const parsed = parseApplyLog(logContent);
@@ -19853,6 +19853,32 @@ function diffSchema(params) {
19853
19853
  enumValueMismatches
19854
19854
  };
19855
19855
  }
19856
+ function extractTablesFromIdempotentSql(idempotentDir, projectRoot = process.cwd()) {
19857
+ const fullPath = path10__default.resolve(projectRoot, idempotentDir);
19858
+ if (!existsSync(fullPath)) {
19859
+ return [];
19860
+ }
19861
+ const tables = [];
19862
+ const createTablePattern = /CREATE\s+TABLE\s+(?:IF\s+NOT\s+EXISTS\s+)?(?:"?([a-zA-Z_][a-zA-Z0-9_]*)"?\.)?(?:"?([a-zA-Z_][a-zA-Z0-9_]*)"?)/gi;
19863
+ try {
19864
+ const files = readdirSync(fullPath).filter((f) => f.endsWith(".sql"));
19865
+ for (const file of files) {
19866
+ const filePath = path10__default.join(fullPath, file);
19867
+ const content = readFileSync(filePath, "utf-8");
19868
+ const contentWithoutComments = content.replace(/--.*$/gm, "").replace(/\/\*[\s\S]*?\*\//g, "");
19869
+ for (const match of contentWithoutComments.matchAll(createTablePattern)) {
19870
+ const schema = match[1] || "public";
19871
+ const tableName = match[2];
19872
+ if (tableName) {
19873
+ tables.push(`${schema}.${tableName}`);
19874
+ }
19875
+ }
19876
+ }
19877
+ } catch {
19878
+ return [];
19879
+ }
19880
+ return [...new Set(tables)].sort();
19881
+ }
19856
19882
 
19857
19883
  // src/commands/db/commands/db-cleanup.ts
19858
19884
  function quoteIdentifier(identifier) {
@@ -19966,18 +19992,30 @@ async function runCleanupAction(env2, options) {
19966
19992
  const databaseUrl = resolveDatabaseUrl(runaEnv);
19967
19993
  const { expectedTables, expectedEnums } = await extractSchemaTablesAndEnums(dbPackagePath);
19968
19994
  const { dbTables, dbEnums } = await fetchDbTablesAndEnums(databaseUrl);
19969
- let excludeFromOrphanDetection;
19995
+ let excludeFromOrphanDetection = [];
19996
+ let idempotentSqlDir = "supabase/schemas/idempotent";
19970
19997
  try {
19971
19998
  const config = loadRunaConfig2();
19972
- excludeFromOrphanDetection = config.database?.pgSchemaDiff?.excludeFromOrphanDetection;
19999
+ if (config.database?.pgSchemaDiff?.excludeFromOrphanDetection) {
20000
+ excludeFromOrphanDetection = [...config.database.pgSchemaDiff.excludeFromOrphanDetection];
20001
+ }
20002
+ if (config.database?.pgSchemaDiff?.idempotentSqlDir) {
20003
+ idempotentSqlDir = config.database.pgSchemaDiff.idempotentSqlDir;
20004
+ }
19973
20005
  } catch {
19974
20006
  }
20007
+ const idempotentTables = extractTablesFromIdempotentSql(idempotentSqlDir);
20008
+ if (idempotentTables.length > 0) {
20009
+ excludeFromOrphanDetection = [
20010
+ .../* @__PURE__ */ new Set([...excludeFromOrphanDetection, ...idempotentTables])
20011
+ ];
20012
+ }
19975
20013
  const diff = diffSchema({
19976
20014
  expectedTables,
19977
20015
  expectedEnums,
19978
20016
  dbTables,
19979
20017
  dbEnums,
19980
- excludeFromOrphanDetection
20018
+ excludeFromOrphanDetection: excludeFromOrphanDetection.length > 0 ? excludeFromOrphanDetection : void 0
19981
20019
  });
19982
20020
  if (diff.orphanTables.length === 0 && diff.extraEnums.length === 0) {
19983
20021
  logger16.success("\u2705 No orphan tables/enums to cleanup");
@@ -21105,6 +21143,10 @@ function logOrphanDetails(diff, result, logger16) {
21105
21143
  logger16.info(" 2. Cleanup orphans: runa db cleanup local --force");
21106
21144
  logger16.info(" 3. Auto-cleanup before sync: runa db sync --reconcile");
21107
21145
  logger16.info("");
21146
+ logger16.info(" If these tables are managed by idempotent SQL (e.g., partitions, PostGIS):");
21147
+ logger16.info(" \u2022 Add to runa.config.ts: database.pgSchemaDiff.excludeFromOrphanDetection");
21148
+ logger16.info(" \u2022 Or set idempotentSqlDir to auto-detect CREATE TABLE statements");
21149
+ logger16.info("");
21108
21150
  }
21109
21151
  async function runOrphanCheck(env2, dbPackagePath, result, logger16, step) {
21110
21152
  if (env2 !== "local" || !dbPackagePath) return;
@@ -21115,18 +21157,30 @@ async function runOrphanCheck(env2, dbPackagePath, result, logger16, step) {
21115
21157
  const { dbTables, dbEnums } = await fetchDbTablesAndEnums(databaseUrl, {
21116
21158
  schemaDir: path10__default.join(dbPackagePath, "src", "schema")
21117
21159
  });
21118
- let excludeFromOrphanDetection;
21160
+ let excludeFromOrphanDetection = [];
21161
+ let idempotentSqlDir = "supabase/schemas/idempotent";
21119
21162
  try {
21120
21163
  const config = loadRunaConfig2();
21121
- excludeFromOrphanDetection = config.database?.pgSchemaDiff?.excludeFromOrphanDetection;
21164
+ if (config.database?.pgSchemaDiff?.excludeFromOrphanDetection) {
21165
+ excludeFromOrphanDetection = [...config.database.pgSchemaDiff.excludeFromOrphanDetection];
21166
+ }
21167
+ if (config.database?.pgSchemaDiff?.idempotentSqlDir) {
21168
+ idempotentSqlDir = config.database.pgSchemaDiff.idempotentSqlDir;
21169
+ }
21122
21170
  } catch {
21123
21171
  }
21172
+ const idempotentTables = extractTablesFromIdempotentSql(idempotentSqlDir);
21173
+ if (idempotentTables.length > 0) {
21174
+ excludeFromOrphanDetection = [
21175
+ .../* @__PURE__ */ new Set([...excludeFromOrphanDetection, ...idempotentTables])
21176
+ ];
21177
+ }
21124
21178
  const diff = diffSchema({
21125
21179
  expectedTables,
21126
21180
  expectedEnums,
21127
21181
  dbTables,
21128
21182
  dbEnums,
21129
- excludeFromOrphanDetection
21183
+ excludeFromOrphanDetection: excludeFromOrphanDetection.length > 0 ? excludeFromOrphanDetection : void 0
21130
21184
  });
21131
21185
  const hasOrphans = diff.orphanTables.length > 0 || diff.extraEnums.length > 0;
21132
21186
  if (hasOrphans) {
@@ -21323,12 +21377,24 @@ var reconcile = fromPromise(
21323
21377
  ctx.dbPackagePath
21324
21378
  );
21325
21379
  const { dbTables, dbEnums } = await fetchDbTablesAndEnums(ctx.databaseUrl);
21326
- let excludeFromOrphanDetection;
21380
+ let excludeFromOrphanDetection = [];
21381
+ let idempotentSqlDir = "supabase/schemas/idempotent";
21327
21382
  try {
21328
21383
  const config = loadRunaConfig2();
21329
- excludeFromOrphanDetection = config.database?.pgSchemaDiff?.excludeFromOrphanDetection;
21384
+ if (config.database?.pgSchemaDiff?.excludeFromOrphanDetection) {
21385
+ excludeFromOrphanDetection = [...config.database.pgSchemaDiff.excludeFromOrphanDetection];
21386
+ }
21387
+ if (config.database?.pgSchemaDiff?.idempotentSqlDir) {
21388
+ idempotentSqlDir = config.database.pgSchemaDiff.idempotentSqlDir;
21389
+ }
21330
21390
  } catch {
21331
21391
  }
21392
+ const idempotentTables = extractTablesFromIdempotentSql(idempotentSqlDir);
21393
+ if (idempotentTables.length > 0) {
21394
+ excludeFromOrphanDetection = [
21395
+ .../* @__PURE__ */ new Set([...excludeFromOrphanDetection, ...idempotentTables])
21396
+ ];
21397
+ }
21332
21398
  const diff = diffSchema({
21333
21399
  expectedTables,
21334
21400
  expectedEnums,
@@ -24720,6 +24786,10 @@ Enum value mismatches (${diff.enumValueMismatches.length}):`);
24720
24786
  " \u2022 If you only see orphan empty tables / unused enums: runa db cleanup <env> --empty-only --force"
24721
24787
  );
24722
24788
  logger16.info(" \u2022 Then re-run: runa db sync <env> --force");
24789
+ logger16.info("");
24790
+ logger16.info(" If orphan tables are managed by idempotent SQL (e.g., partitions, PostGIS):");
24791
+ logger16.info(" \u2022 Add to runa.config.ts: database.pgSchemaDiff.excludeFromOrphanDetection");
24792
+ logger16.info(" \u2022 Or set idempotentSqlDir to auto-detect CREATE TABLE statements");
24723
24793
  }
24724
24794
  async function runSyncAction(env2, options) {
24725
24795
  const logger16 = createCLILogger("db:sync");
@@ -24731,18 +24801,30 @@ async function runSyncAction(env2, options) {
24731
24801
  const databaseUrl = resolveDatabaseUrl(runaEnv);
24732
24802
  const { expectedTables, expectedEnums } = await extractSchemaTablesAndEnums(dbPackagePath);
24733
24803
  const { dbTables, dbEnums } = await fetchDbTablesAndEnums(databaseUrl);
24734
- let excludeFromOrphanDetection;
24804
+ let excludeFromOrphanDetection = [];
24805
+ let idempotentSqlDir = "supabase/schemas/idempotent";
24735
24806
  try {
24736
24807
  const config = loadRunaConfig2();
24737
- excludeFromOrphanDetection = config.database?.pgSchemaDiff?.excludeFromOrphanDetection;
24808
+ if (config.database?.pgSchemaDiff?.excludeFromOrphanDetection) {
24809
+ excludeFromOrphanDetection = [...config.database.pgSchemaDiff.excludeFromOrphanDetection];
24810
+ }
24811
+ if (config.database?.pgSchemaDiff?.idempotentSqlDir) {
24812
+ idempotentSqlDir = config.database.pgSchemaDiff.idempotentSqlDir;
24813
+ }
24738
24814
  } catch {
24739
24815
  }
24816
+ const idempotentTables = extractTablesFromIdempotentSql(idempotentSqlDir);
24817
+ if (idempotentTables.length > 0) {
24818
+ excludeFromOrphanDetection = [
24819
+ .../* @__PURE__ */ new Set([...excludeFromOrphanDetection, ...idempotentTables])
24820
+ ];
24821
+ }
24740
24822
  const diff = diffSchema({
24741
24823
  expectedTables,
24742
24824
  expectedEnums,
24743
24825
  dbTables,
24744
24826
  dbEnums,
24745
- excludeFromOrphanDetection
24827
+ excludeFromOrphanDetection: excludeFromOrphanDetection.length > 0 ? excludeFromOrphanDetection : void 0
24746
24828
  });
24747
24829
  if (options.json) {
24748
24830
  process.stdout.write(
@@ -26713,18 +26795,42 @@ function parseVercelUrl(url) {
26713
26795
  if (!match) return null;
26714
26796
  return { team: match[1], project: match[2] };
26715
26797
  }
26798
+ function isValidGitHubOwner(name) {
26799
+ if (!name || name.length > 39) return false;
26800
+ if (!/^[a-zA-Z0-9-]+$/.test(name)) return false;
26801
+ if (name.startsWith("-") || name.endsWith("-")) return false;
26802
+ return true;
26803
+ }
26804
+ function isValidGitHubRepo(name) {
26805
+ if (!name || name.length > 100) return false;
26806
+ if (!/^[a-zA-Z0-9._-]+$/.test(name)) return false;
26807
+ if (name.startsWith(".") && name !== ".github") return false;
26808
+ if (/\.\./.test(name)) return false;
26809
+ return true;
26810
+ }
26716
26811
  function parseGitHubUrl(url) {
26717
26812
  const cleanUrl = url.trim().replace(/^https?:\/\//, "").replace(/\.git$/, "").replace(/\/$/, "");
26718
- const githubMatch = cleanUrl.match(/^github\.com\/([a-zA-Z0-9_-]+)\/([a-zA-Z0-9._-]+)/);
26813
+ const githubMatch = cleanUrl.match(/^github\.com\/([^/]+)\/([^/]+)/);
26719
26814
  if (githubMatch) {
26720
- const repo = githubMatch[2].split("/")[0];
26721
- return { owner: githubMatch[1], repo };
26815
+ const owner = githubMatch[1];
26816
+ const repo = githubMatch[2];
26817
+ if (isValidGitHubOwner(owner) && isValidGitHubRepo(repo)) {
26818
+ return { owner, repo };
26819
+ }
26820
+ }
26821
+ const sshMatch = url.trim().match(/^git@github\.com:([^/]+)\/([^/]+?)(?:\.git)?$/);
26822
+ if (sshMatch) {
26823
+ const owner = sshMatch[1];
26824
+ const repo = sshMatch[2];
26825
+ if (isValidGitHubOwner(owner) && isValidGitHubRepo(repo)) {
26826
+ return { owner, repo };
26827
+ }
26722
26828
  }
26723
26829
  const parts = cleanUrl.split("/");
26724
- if (parts.length >= 2 && !cleanUrl.includes(".")) {
26830
+ if (parts.length === 2 && !cleanUrl.includes(".")) {
26725
26831
  const owner = parts[0];
26726
26832
  const repo = parts[1];
26727
- if (/^[a-zA-Z0-9_-]+$/.test(owner) && /^[a-zA-Z0-9._-]+$/.test(repo)) {
26833
+ if (isValidGitHubOwner(owner) && isValidGitHubRepo(repo)) {
26728
26834
  return { owner, repo };
26729
26835
  }
26730
26836
  }
@@ -29660,7 +29766,7 @@ init_esm_shims();
29660
29766
 
29661
29767
  // src/constants/versions.ts
29662
29768
  init_esm_shims();
29663
- var COMPATIBLE_TEMPLATES_VERSION = "0.5.40";
29769
+ var COMPATIBLE_TEMPLATES_VERSION = "0.5.41";
29664
29770
  var TEMPLATES_PACKAGE_NAME = "@r06-dev/runa-templates";
29665
29771
  var GITHUB_PACKAGES_REGISTRY = "https://npm.pkg.github.com";
29666
29772
 
@@ -33238,6 +33344,39 @@ var PATH_MAPPING_RULES = [
33238
33344
  category: "other"
33239
33345
  },
33240
33346
  // ============================================================
33347
+ // .CODEX DIRECTORY (mirrors .claude policies for Codex)
33348
+ // ============================================================
33349
+ {
33350
+ runa: ".codex/README.md",
33351
+ template: "_codex/README.md",
33352
+ category: "config"
33353
+ },
33354
+ {
33355
+ runa: ".codex/AGENTS.md",
33356
+ template: "_codex/AGENTS.md",
33357
+ category: "config"
33358
+ },
33359
+ {
33360
+ runa: ".codex/CODEX.md",
33361
+ template: "_codex/CODEX.md",
33362
+ category: "config"
33363
+ },
33364
+ {
33365
+ runa: ".codex/config.toml",
33366
+ template: "_codex/config.toml",
33367
+ category: "config"
33368
+ },
33369
+ {
33370
+ runa: ".codex/rules/devops.md",
33371
+ template: "_codex/rules/devops.md",
33372
+ category: "rules"
33373
+ },
33374
+ {
33375
+ runa: ".codex/rules/permissions.toml",
33376
+ template: "_codex/rules/permissions.toml",
33377
+ category: "rules"
33378
+ },
33379
+ // ============================================================
33241
33380
  // ROOT DOCUMENTATION (LOWEST PRIORITY)
33242
33381
  // ============================================================
33243
33382
  {
@@ -33928,7 +34067,7 @@ function printActionsNeeded(logger16, actions) {
33928
34067
  );
33929
34068
  }
33930
34069
  function findRepoRoot3(startDir) {
33931
- const { existsSync: existsSync50, readFileSync: readFileSync27 } = __require("fs");
34070
+ const { existsSync: existsSync50, readFileSync: readFileSync28 } = __require("fs");
33932
34071
  const { join: join22, dirname: dirname5 } = __require("path");
33933
34072
  let current = startDir;
33934
34073
  while (current !== dirname5(current)) {
@@ -33938,7 +34077,7 @@ function findRepoRoot3(startDir) {
33938
34077
  const pkgPath = join22(current, "package.json");
33939
34078
  if (existsSync50(pkgPath)) {
33940
34079
  try {
33941
- const pkg = JSON.parse(readFileSync27(pkgPath, "utf-8"));
34080
+ const pkg = JSON.parse(readFileSync28(pkgPath, "utf-8"));
33942
34081
  if (pkg.workspaces) {
33943
34082
  return current;
33944
34083
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runa-ai/runa-cli",
3
- "version": "0.5.40",
3
+ "version": "0.5.41",
4
4
  "private": false,
5
5
  "description": "AI-powered DevOps CLI",
6
6
  "type": "module",
@@ -53,8 +53,8 @@
53
53
  "typescript": "5.9.3",
54
54
  "xstate": "5.25.0",
55
55
  "zod": "4.3.5",
56
- "@runa-ai/runa-xstate-test-plugin": "0.5.35",
57
- "@runa-ai/runa": "0.5.39"
56
+ "@runa-ai/runa": "0.5.41",
57
+ "@runa-ai/runa-xstate-test-plugin": "0.5.35"
58
58
  },
59
59
  "engines": {
60
60
  "node": ">=20.0.0"