@runa-ai/runa-cli 0.6.0 → 0.7.1

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 (81) hide show
  1. package/dist/{build-BXUJKYHC.js → build-HUDIP6KU.js} +153 -164
  2. package/dist/{cache-H63JKFYH.js → cache-N7WNPEYF.js} +2 -3
  3. package/dist/check-LOMVIRHX.js +12 -0
  4. package/dist/{chunk-HPYJPB5Y.js → chunk-2APB25TT.js} +44 -10
  5. package/dist/chunk-3WDV32GA.js +33 -0
  6. package/dist/chunk-5FT3F36G.js +59 -0
  7. package/dist/{chunk-7QV7U6NI.js → chunk-6FAU4IGR.js} +2 -1
  8. package/dist/{chunk-CE3DEYFT.js → chunk-7B5C6U2K.js} +2 -208
  9. package/dist/{chunk-GOGRLQNP.js → chunk-AFY3TX4I.js} +1 -1
  10. package/dist/{chunk-KWX3JHCY.js → chunk-AKZAN4BC.js} +6 -1
  11. package/dist/{chunk-XJBQINSA.js → chunk-CCW3PLQY.js} +2 -2
  12. package/dist/{chunk-IBVVGH6X.js → chunk-EMB6IZFT.js} +17 -4
  13. package/dist/chunk-FHG3ILE4.js +2011 -0
  14. package/dist/{chunk-22CS6EMA.js → chunk-H2AHNI75.js} +1 -1
  15. package/dist/{chunk-UU55OH7P.js → chunk-KE6QJBZG.js} +2 -3
  16. package/dist/{check-6AB5NGWK.js → chunk-QM53IQHM.js} +14 -12
  17. package/dist/{chunk-RRGQCUKT.js → chunk-WJXC4MVY.js} +30 -3
  18. package/dist/chunk-XDCHRVE3.js +215 -0
  19. package/dist/{chunk-P7U52PBY.js → chunk-Z4Z5DNW4.js} +49 -2
  20. package/dist/{ci-V3PIG2GI.js → ci-XY6IKEDC.js} +1938 -238
  21. package/dist/cli/contract-output.d.ts +1 -0
  22. package/dist/{cli-GFRZCJQR.js → cli-UZA4RBNQ.js} +216 -173
  23. package/dist/commands/build/actors/validate.d.ts +2 -0
  24. package/dist/commands/check/commands/check.d.ts +8 -3
  25. package/dist/commands/ci/machine/actors/db/collect-schema-stats.d.ts +12 -6
  26. package/dist/commands/ci/machine/actors/db/production-preview.d.ts +10 -0
  27. package/dist/commands/ci/machine/actors/db/schema-canonical-diff.d.ts +77 -0
  28. package/dist/commands/ci/machine/actors/db/schema-stats.d.ts +11 -0
  29. package/dist/commands/ci/machine/actors/db/sync-schema.d.ts +9 -1
  30. package/dist/commands/ci/machine/commands/machine-runner.d.ts +2 -0
  31. package/dist/commands/ci/machine/formatters/sections/production-schema-status.d.ts +30 -0
  32. package/dist/commands/ci/machine/formatters/sections/schema-matrix.d.ts +3 -3
  33. package/dist/commands/ci/machine/helpers.d.ts +8 -0
  34. package/dist/commands/ci/machine/machine.d.ts +57 -4
  35. package/dist/commands/ci/machine/types.d.ts +2 -0
  36. package/dist/commands/ci/utils/execa-helpers.d.ts +1 -0
  37. package/dist/commands/db/commands/db-sync/error-classifier.d.ts +9 -0
  38. package/dist/commands/dev/actors/index.d.ts +5 -0
  39. package/dist/commands/dev/actors/tables-manifest.d.ts +16 -0
  40. package/dist/commands/dev/contract.d.ts +1 -1
  41. package/dist/commands/dev/guards.d.ts +24 -0
  42. package/dist/commands/dev/machine.d.ts +22 -3
  43. package/dist/commands/dev/types.d.ts +2 -0
  44. package/dist/commands/doctor.d.ts +9 -0
  45. package/dist/commands/inject-test-attrs/defaults.d.ts +9 -0
  46. package/dist/commands/template-check/commands/template-check.d.ts +1 -0
  47. package/dist/commands/template-check/contract.d.ts +1 -0
  48. package/dist/commands/utils/machine-state-logging.d.ts +20 -0
  49. package/dist/commands/utils/repo-root.d.ts +2 -0
  50. package/dist/constants/versions.d.ts +1 -1
  51. package/dist/{db-HR7CREX2.js → db-Q3GF7JWP.js} +518 -2234
  52. package/dist/{dev-A7RW6XQV.js → dev-5YXNPTCJ.js} +168 -49
  53. package/dist/doctor-MZLOA53G.js +44 -0
  54. package/dist/{env-B47Z4747.js → env-GMB3THRG.js} +6 -7
  55. package/dist/{env-files-K2C7O7L5.js → env-files-2UIUYLLR.js} +2 -2
  56. package/dist/{error-handler-4EYSDOSE.js → error-handler-HEXBRNVV.js} +2 -2
  57. package/dist/{hotfix-CULKKMGS.js → hotfix-NDTPY2T4.js} +4 -4
  58. package/dist/index.js +4 -4
  59. package/dist/{init-ELK5QCWR.js → init-U4VCRHTD.js} +5 -6
  60. package/dist/{inject-test-attrs-Y5UD5P7Q.js → inject-test-attrs-P44BVTQS.js} +5 -18
  61. package/dist/{link-C43JRZWY.js → link-VSNDVZZD.js} +2 -3
  62. package/dist/manifest-TMFLESHW.js +19 -0
  63. package/dist/{risk-detector-BXUY2WKS.js → risk-detector-4U6ZJ2G5.js} +1 -1
  64. package/dist/{risk-detector-core-O7I7SPR7.js → risk-detector-core-TK4OAI3N.js} +2 -2
  65. package/dist/{risk-detector-plpgsql-SGMVKYJP.js → risk-detector-plpgsql-HWKS4OLR.js} +37 -7
  66. package/dist/{status-IJ4ZWHMX.js → status-UTKS63AB.js} +2 -3
  67. package/dist/{telemetry-FN7V727Y.js → telemetry-P56UBLZ2.js} +2 -3
  68. package/dist/{template-check-PNG5NQ5H.js → template-check-FFJVDLBF.js} +63 -35
  69. package/dist/{test-QYXE5UVW.js → test-V4KQL574.js} +34 -10
  70. package/dist/{test-gen-QPWOIEHU.js → test-gen-FS4CEY3P.js} +2 -3
  71. package/dist/{upgrade-3SLWVNAC.js → upgrade-7TWORWBV.js} +18 -6
  72. package/dist/{validate-SM4PXPS7.js → validate-CAAW4Y44.js} +2 -3
  73. package/dist/{vuln-check-TYQNEFS7.js → vuln-check-6CMNPSBR.js} +3 -4
  74. package/dist/{vuln-checker-2QXGN5YT.js → vuln-checker-EJJTNDNE.js} +413 -140
  75. package/dist/{watch-UCDVOQAH.js → watch-PNTKZYFB.js} +1 -1
  76. package/dist/{workflow-ZB5Q2PFY.js → workflow-H75N4BXX.js} +3 -4
  77. package/package.json +2 -2
  78. package/dist/chunk-JT5SUTWE.js +0 -9
  79. package/dist/chunk-M47WJJVS.js +0 -71
  80. package/dist/manifest-2NOQ2IMK.js +0 -32
  81. package/dist/{chunk-MNPMZERI.js → chunk-644FVGIQ.js} +1 -1
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'module';
3
- import { stripSqlCommentsPreserveLines, buildLineStarts, lineNumberFromIndex, stripSqlForPatternMatching, detectRisksFromContent } from './chunk-3FDQW524.js';
3
+ import { stripSqlCommentsPreserveLines, buildLineStarts, lineNumberFromIndex, stripSqlStringsPreserveLines, detectRisksFromContent, stripSqlForPatternMatching } from './chunk-3FDQW524.js';
4
4
  import { init_esm_shims } from './chunk-VRXHCR5K.js';
5
5
 
6
6
  createRequire(import.meta.url);
@@ -1578,6 +1578,18 @@ function findKeywordFromOffset(content, start, keyword) {
1578
1578
  return void 0;
1579
1579
  }
1580
1580
  var MAX_DOLLAR_QUOTE_DEPTH = 50;
1581
+ function skipUntilDollarClose(content, state, openTag, depth) {
1582
+ if (depth >= MAX_DOLLAR_QUOTE_DEPTH) return -1;
1583
+ const nestedTag = readDollarTag(content, state.cursor);
1584
+ if (nestedTag === void 0 || nestedTag === openTag) {
1585
+ return state.cursor;
1586
+ }
1587
+ const nestedStart = state.cursor + nestedTag.length;
1588
+ const nestedEnd = closeIndexForDollarTag(content, nestedStart, nestedTag, depth + 1);
1589
+ if (nestedEnd === -1) return -1;
1590
+ state.cursor = nestedEnd + nestedTag.length;
1591
+ return state.cursor;
1592
+ }
1581
1593
  function closeIndexForDollarTag(content, bodyStart, openTag, depth = 0) {
1582
1594
  if (depth >= MAX_DOLLAR_QUOTE_DEPTH) return -1;
1583
1595
  const state = {
@@ -1591,12 +1603,8 @@ function closeIndexForDollarTag(content, bodyStart, openTag, depth = 0) {
1591
1603
  if (content.startsWith(openTag, state.cursor)) {
1592
1604
  return state.cursor;
1593
1605
  }
1594
- const nestedTag = readDollarTag(content, state.cursor);
1595
- if (nestedTag !== void 0 && nestedTag !== openTag) {
1596
- const nestedStart = state.cursor + nestedTag.length;
1597
- const nestedEnd = closeIndexForDollarTag(content, nestedStart, nestedTag, depth + 1);
1598
- if (nestedEnd === -1) return -1;
1599
- state.cursor = nestedEnd + nestedTag.length;
1606
+ const nestedCursor = skipUntilDollarClose(content, state, openTag, depth);
1607
+ if (nestedCursor !== state.cursor) {
1600
1608
  continue;
1601
1609
  }
1602
1610
  if (tryStartSingleQuote(content, state)) continue;
@@ -1785,6 +1793,27 @@ function maybeBuildUsingClauseRisk(execute, executeLine) {
1785
1793
  }
1786
1794
  };
1787
1795
  }
1796
+ function pushBodyStaticRisks(risks, dedupe, body, bodyStartLine) {
1797
+ const searchableBody = stripSqlStringsPreserveLines(body);
1798
+ if (!searchableBody.trim()) return;
1799
+ const bodyLineStarts = buildLineStarts(body);
1800
+ const bodyRisks = detectRisksFromContent(searchableBody, body, bodyLineStarts);
1801
+ for (const risk of bodyRisks) {
1802
+ const line = bodyStartLine + ((risk.line ?? 1) - 1);
1803
+ const dedupeKey = `body:${risk.reasonCode ?? risk.description}:${line}`;
1804
+ if (dedupe.has(dedupeKey)) continue;
1805
+ dedupe.add(dedupeKey);
1806
+ risks.push({
1807
+ ...risk,
1808
+ line,
1809
+ evidence: {
1810
+ source: "plpgsql body",
1811
+ snippet: body.trim().slice(0, 200),
1812
+ detail: `Matched ${risk.reasonCode ?? "pattern"} inside PL/pgSQL body`
1813
+ }
1814
+ });
1815
+ }
1816
+ }
1788
1817
  function buildUnresolvedExecuteRisk(execute, executeLine, reason) {
1789
1818
  const clauseSuffix = execute.hasUsingClause ? " includes USING clause" : execute.hasIntoClause ? " includes INTO clause" : "";
1790
1819
  return {
@@ -1822,6 +1851,7 @@ function analyzeBodyRange(risks, dedupe, content, commentlessContent, lineStarts
1822
1851
  const declarationLine = lineNumberFromIndex(commentlessContent, range.bodyStart, lineStarts);
1823
1852
  maybeAddDoBlockRisk(risks, dedupe, commentlessContent, range, declarationLine);
1824
1853
  const body = commentlessContent.slice(range.bodyStart, range.bodyEnd);
1854
+ pushBodyStaticRisks(risks, dedupe, body, declarationLine);
1825
1855
  const stringEnv = /* @__PURE__ */ new Map();
1826
1856
  for (const statement of splitPlpgsqlStatementsWithOffsets(body)) {
1827
1857
  applyStatementAssignment(statement, stringEnv);
@@ -1,8 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'module';
3
- import { emitJsonSuccess } from './chunk-UU55OH7P.js';
4
- import './chunk-RRGQCUKT.js';
5
- import './chunk-JT5SUTWE.js';
3
+ import { emitJsonSuccess } from './chunk-KE6QJBZG.js';
4
+ import './chunk-WJXC4MVY.js';
6
5
  import { getOutputFormatFromEnv } from './chunk-HKUWEGUX.js';
7
6
  import { init_esm_shims } from './chunk-VRXHCR5K.js';
8
7
  import { createCLILogger, CLIError } from '@runa-ai/runa/cli-runtime';
@@ -1,8 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'module';
3
- import { emitJsonSuccess } from './chunk-UU55OH7P.js';
4
- import './chunk-RRGQCUKT.js';
5
- import './chunk-JT5SUTWE.js';
3
+ import { emitJsonSuccess } from './chunk-KE6QJBZG.js';
4
+ import './chunk-WJXC4MVY.js';
6
5
  import './chunk-HKUWEGUX.js';
7
6
  import { init_esm_shims } from './chunk-VRXHCR5K.js';
8
7
  import { createCLILogger, CLIError } from '@runa-ai/runa/cli-runtime';
@@ -1,6 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'module';
3
- import { getErrorMessage } from './chunk-IBVVGH6X.js';
3
+ import { getErrorMessage } from './chunk-EMB6IZFT.js';
4
+ import { findRepoRoot } from './chunk-3WDV32GA.js';
5
+ import { createMachineStateChangeLogger } from './chunk-5FT3F36G.js';
4
6
  import { getOutputFormatFromEnv } from './chunk-HKUWEGUX.js';
5
7
  import { __export, __esm, init_esm_shims, __require, __toCommonJS } from './chunk-VRXHCR5K.js';
6
8
  import { createCLILogger, CLIError } from '@runa-ai/runa';
@@ -128,6 +130,15 @@ var RUNA_ONLY_FILES = [
128
130
  "packages/database/scripts/db-sync-partition.test.ts",
129
131
  // Partition defense tests
130
132
  "packages/database/scripts/check-plpgsql.ts",
133
+ "packages/database/scripts/db-sync-apply-steps.test.ts",
134
+ "packages/database/scripts/db-sync-codegen-runtime.test.ts",
135
+ "packages/database/scripts/db-sync-db-state.test.ts",
136
+ "packages/database/scripts/db-sync-local-url.test.ts",
137
+ "packages/database/scripts/db-sync-pg-schema-diff.test.ts",
138
+ "packages/database/scripts/db-sync-schema-discovery.test.ts",
139
+ "packages/database/scripts/db-sync-schema-sort.ts",
140
+ "packages/database/scripts/db-sync-seeds-runtime.test.ts",
141
+ "packages/database/scripts/seed-writer.test.ts",
131
142
  "packages/database/scripts/run-splinter.ts",
132
143
  "packages/database/scripts/seed-generators/index.ts",
133
144
  "packages/database/scripts/seed-generators/loader.ts",
@@ -311,6 +322,10 @@ var INTENTIONALLY_DIFFERENT_FILES = [
311
322
  // Vercel pull vs generic setup
312
323
  "playwright.config.ts",
313
324
  // Internal paths + ESM/CJS fallback in template
325
+ "config/vitest/layer3-global-setup.ts",
326
+ // Dogfooding layer 3 setup differs
327
+ "config/vitest/vitest.config.layer1.ts",
328
+ // Dogfooding layer 1 test patterns differ
314
329
  "config/vitest/vitest.config.layer3.ts",
315
330
  // Internal SDK path vs package import
316
331
  // === Workflow Files ===
@@ -346,6 +361,18 @@ var INTENTIONALLY_DIFFERENT_FILES = [
346
361
  // Different schema exports
347
362
  "packages/database/src/schema/index.ts",
348
363
  // Different table exports
364
+ "packages/database/scripts/db-sync-codegen-runtime.ts",
365
+ // Dogfooding codegen runtime differs
366
+ "packages/database/scripts/db-sync-codegen.ts",
367
+ // PostGIS cleanup differs
368
+ "packages/database/scripts/db-sync-local-url.ts",
369
+ // Local DB discovery differs
370
+ "packages/database/scripts/db-sync-pg-schema-diff.ts",
371
+ // Direct apply helpers differ
372
+ "packages/database/scripts/db-sync-schema-discovery.ts",
373
+ // Schema cache behavior differs
374
+ "packages/database/scripts/db-sync-seeds-runtime.ts",
375
+ // Seed runtime orchestration differs
349
376
  "packages/database/scripts/generate-seeds.ts",
350
377
  // runa-specific seed logic
351
378
  "packages/database/scripts/validate-schema-consistency.ts",
@@ -358,6 +385,8 @@ var INTENTIONALLY_DIFFERENT_FILES = [
358
385
  // runa-specific seed writer
359
386
  "packages/database/scripts/seed-media/index.ts",
360
387
  // runa-specific media seeds
388
+ "packages/database/scripts/seed-engines/auto-seed-generator.ts",
389
+ // Dogfooding seed generation differs
361
390
  "packages/database/scripts/seed-engines/auto-seed-generator.test.ts",
362
391
  // runa-specific tests
363
392
  "packages/database/scripts/seed-engines/constants.test.ts",
@@ -366,6 +395,8 @@ var INTENTIONALLY_DIFFERENT_FILES = [
366
395
  // Re-export order differences
367
396
  "packages/database/scripts/seed-engines/generators/locale.ts",
368
397
  // Import style differences
398
+ "packages/database/scripts/seed-utils.ts",
399
+ // Dogfooding seed utils differ
369
400
  "packages/database/scripts/setup-db-roles.ts",
370
401
  // Role setup variations
371
402
  "packages/database/src/zod/index.ts",
@@ -663,7 +694,11 @@ function sortResults(results) {
663
694
  return pathA.localeCompare(pathB);
664
695
  });
665
696
  }
666
- 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) {
667
702
  let filtered = results.filter((r) => {
668
703
  const filePath = r.runaPath ?? r.templatePath ?? "";
669
704
  return isCodeFile(filePath);
@@ -671,6 +706,14 @@ function filterResults(results, category) {
671
706
  if (category) {
672
707
  filtered = filtered.filter((r) => r.category === category);
673
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
+ }
674
717
  return filtered;
675
718
  }
676
719
  var compareActor = fromPromise(async ({ input }) => {
@@ -705,7 +748,7 @@ var compareActor = fromPromise(async ({ input }) => {
705
748
  results.push(createTemplateOnlyResult(templateRelPath, templateFile.category));
706
749
  }
707
750
  sortResults(results);
708
- return { results: filterResults(results, options.category) };
751
+ return { results: filterResults(results, options.category, options.paths) };
709
752
  });
710
753
 
711
754
  // src/commands/template-check/actors/discover.ts
@@ -1095,7 +1138,7 @@ function getCategoryForPath(path3) {
1095
1138
  }
1096
1139
  return "other";
1097
1140
  }
1098
- function normalizeTemplatePath(templatePath) {
1141
+ function normalizeTemplatePath2(templatePath) {
1099
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/");
1100
1143
  }
1101
1144
  function applyReverseRename(normalized, rule, isTemplate) {
@@ -1110,7 +1153,7 @@ function applyReverseRename(normalized, rule, isTemplate) {
1110
1153
  return normalized;
1111
1154
  }
1112
1155
  function generateComparisonKey(path3, isTemplate) {
1113
- let normalized = isTemplate ? normalizeTemplatePath(path3) : path3;
1156
+ let normalized = isTemplate ? normalizeTemplatePath2(path3) : path3;
1114
1157
  for (const rule of PATH_MAPPING_RULES) {
1115
1158
  normalized = applyReverseRename(normalized, rule, isTemplate);
1116
1159
  }
@@ -1573,14 +1616,16 @@ var stateLogHandlers = {
1573
1616
  report: (_logger) => {
1574
1617
  }
1575
1618
  };
1576
- function handleStateChange(snapshot, prevState, logger, jsonMode, quietMode) {
1577
- if (jsonMode || quietMode) return;
1578
- const state = getStateName(snapshot);
1579
- if (state === prevState) return;
1580
- const handler = stateLogHandlers[state];
1581
- if (handler) {
1582
- handler(logger);
1619
+ var logStateChange = createMachineStateChangeLogger({
1620
+ getState: getStateName,
1621
+ getContext: (snapshot) => snapshot.context,
1622
+ handlers: stateLogHandlers,
1623
+ shouldSkipState: (_state, _prevState, _context, extra) => {
1624
+ return extra?.jsonMode === true || extra?.quietMode === true;
1583
1625
  }
1626
+ });
1627
+ function handleStateChange(snapshot, prevState, logger, jsonMode, quietMode) {
1628
+ logStateChange(snapshot, prevState, logger, { jsonMode, quietMode });
1584
1629
  }
1585
1630
  var CATEGORY_DISPLAY_NAMES2 = {
1586
1631
  rules: "Rules (.claude/rules/)",
@@ -1611,6 +1656,10 @@ var AHEAD_LABELS = {
1611
1656
  diverged: "diverged",
1612
1657
  equal: ""
1613
1658
  };
1659
+ function collectValues(value, previous) {
1660
+ previous.push(value);
1661
+ return previous;
1662
+ }
1614
1663
  var STATUS_SUFFIXES = {
1615
1664
  "runa-only": "(unexpected - missing in template)",
1616
1665
  "template-only": "(unexpected - missing in runa-repo)",
@@ -1753,28 +1802,6 @@ function printActionsNeeded(logger, actions) {
1753
1802
  (action) => [` ${action.path}`]
1754
1803
  );
1755
1804
  }
1756
- function findRepoRoot(startDir) {
1757
- const { existsSync: existsSync2, readFileSync: readFileSync2 } = __require("fs");
1758
- const { join: join3, dirname } = __require("path");
1759
- let current = startDir;
1760
- while (current !== dirname(current)) {
1761
- if (existsSync2(join3(current, "turbo.json"))) {
1762
- return current;
1763
- }
1764
- const pkgPath = join3(current, "package.json");
1765
- if (existsSync2(pkgPath)) {
1766
- try {
1767
- const pkg = JSON.parse(readFileSync2(pkgPath, "utf-8"));
1768
- if (pkg.workspaces) {
1769
- return current;
1770
- }
1771
- } catch {
1772
- }
1773
- }
1774
- current = dirname(current);
1775
- }
1776
- return startDir;
1777
- }
1778
1805
  function groupResultsByCategory(results) {
1779
1806
  const categoryMap = /* @__PURE__ */ new Map();
1780
1807
  for (const result of results) {
@@ -1918,11 +1945,12 @@ async function runTemplateCheckAction(options) {
1918
1945
  }
1919
1946
  var templateCheckCommand = new Command("template-check").description(
1920
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"
1921
- ).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) => {
1922
1949
  const input = {
1923
1950
  verbose: options.verbose ?? false,
1924
1951
  diff: options.diff ?? false,
1925
1952
  category: options.category,
1953
+ paths: options.path?.length ? options.path : void 0,
1926
1954
  json: options.json ?? false,
1927
1955
  quiet: options.quiet ?? false,
1928
1956
  targetDir: options.targetDir
@@ -1,8 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'module';
3
- import { emitJsonSuccess } from './chunk-UU55OH7P.js';
4
- import './chunk-RRGQCUKT.js';
5
- import './chunk-JT5SUTWE.js';
3
+ import { emitJsonSuccess } from './chunk-KE6QJBZG.js';
4
+ import './chunk-WJXC4MVY.js';
6
5
  import './chunk-HKUWEGUX.js';
7
6
  import { init_esm_shims } from './chunk-VRXHCR5K.js';
8
7
  import { runTest, TestRunOutputSchema, CLIError, runTestService, TestServiceOutputSchema, runTestIntegration, TestIntegrationOutputSchema, runTestStatic, TestStaticOutputSchema, createCLILogger, generateOwaspTop10Tests, TestOwaspGenerateOutputSchema } from '@runa-ai/runa';
@@ -80,7 +79,7 @@ var testDbCommand = new Command("test:db").description("Run Layer 2-3: Database
80
79
  ).option("--verbose", "Verbose output (full error details, environment info)").option("--changed", "Run only impacted layers based on git diff").option(
81
80
  "--base <ref>",
82
81
  "Base ref for --changed (default: $RUNA_TEST_BASE_REF or $GITHUB_BASE_REF)"
83
- ).option("--layer <layer>", "Run specific layer: 2/schema, 3/api, or all (default: all)").action(async (options) => {
82
+ ).option("--skip-seed", "Skip applying seed data before Layer 2 pgTAP tests").option("--layer <layer>", "Run specific layer: 2/schema, 3/api, or all (default: all)").action(async (options) => {
84
83
  try {
85
84
  const layers = options.layer === "2" || options.layer === "schema" ? [2] : options.layer === "3" || options.layer === "api" ? [3] : [2, 3];
86
85
  const output = await runTestService({
@@ -90,6 +89,7 @@ var testDbCommand = new Command("test:db").description("Run Layer 2-3: Database
90
89
  verbose: options.verbose,
91
90
  changed: options.changed,
92
91
  base: options.base,
92
+ skipSeed: options.skipSeed,
93
93
  layers
94
94
  });
95
95
  emitJsonSuccess(testDbCommand, TestServiceOutputSchema, output);
@@ -105,14 +105,15 @@ var testDbCommand = new Command("test:db").description("Run Layer 2-3: Database
105
105
  );
106
106
  }
107
107
  });
108
- var testSchemaCommand = new Command("test:schema").description("Run Layer 2: Schema tests (Drizzle, RLS, pgTAP) - Alias for test:layer2").option("--ci", "CI mode (fail fast, no interactive)").option("--record", "Record test results to database", true).option("--report-json <path>", "Export test report as JSON").option("--verbose", "Verbose output").action(async (options) => {
108
+ var testSchemaCommand = new Command("test:schema").description("Run Layer 2: Schema tests (Drizzle, RLS, pgTAP) - Alias for test:layer2").option("--ci", "CI mode (fail fast, no interactive)").option("--record", "Record test results to database", true).option("--report-json <path>", "Export test report as JSON").option("--verbose", "Verbose output").option("--skip-seed", "Skip applying seed data before Layer 2 pgTAP tests").action(async (options) => {
109
109
  try {
110
110
  const output = await runTestService({
111
111
  ci: options.ci ?? false,
112
112
  record: options.record,
113
113
  reportJson: options.reportJson,
114
114
  verbose: options.verbose,
115
- layers: [2]
115
+ layers: [2],
116
+ skipSeed: options.skipSeed
116
117
  });
117
118
  emitJsonSuccess(testSchemaCommand, TestServiceOutputSchema, output);
118
119
  } catch (error) {
@@ -127,14 +128,18 @@ var testSchemaCommand = new Command("test:schema").description("Run Layer 2: Sch
127
128
  );
128
129
  }
129
130
  });
130
- var testApiCommand = new Command("test:api").description("Run Layer 3: API tests (Hono RPC, Contract, Integration) - Alias for test:layer3").option("--ci", "CI mode (fail fast, no interactive)").option("--record", "Record test results to database", true).option("--report-json <path>", "Export test report as JSON").option("--verbose", "Verbose output").action(async (options) => {
131
+ var testApiCommand = new Command("test:api").description("Run Layer 3: API tests (Hono RPC, Contract, Integration) - Alias for test:layer3").option("--ci", "CI mode (fail fast, no interactive)").option("--record", "Record test results to database", true).option("--report-json <path>", "Export test report as JSON").option("--verbose", "Verbose output").option(
132
+ "--skip-seed",
133
+ "Include with test:api for command compatibility; effective only when Layer 2 is selected"
134
+ ).action(async (options) => {
131
135
  try {
132
136
  const output = await runTestService({
133
137
  ci: options.ci ?? false,
134
138
  record: options.record,
135
139
  reportJson: options.reportJson,
136
140
  verbose: options.verbose,
137
- layers: [3]
141
+ layers: [3],
142
+ skipSeed: options.skipSeed
138
143
  });
139
144
  emitJsonSuccess(testApiCommand, TestServiceOutputSchema, output);
140
145
  } catch (error) {
@@ -412,6 +417,9 @@ async function runSingleLayer(params) {
412
417
  forceRegenerate: params.options.force,
413
418
  skipGeneration: params.options.skipGeneration,
414
419
  requireManifest: effectiveRequireManifest,
420
+ skipSeed: params.options.skipSeed,
421
+ includePropertyTests: params.options.includePropertyTests,
422
+ strictGeneration: params.options.strictGeneration,
415
423
  invokedAs: `runa test:layer${params.layer}`
416
424
  });
417
425
  emitJsonSuccess(params.cmd, TestRunOutputSchema, output);
@@ -486,6 +494,15 @@ function createLayerCommand(layer) {
486
494
  "Require manifest to be present and valid (fail if missing or stale)"
487
495
  );
488
496
  }
497
+ if (layer === 1) {
498
+ cmd.option(
499
+ "--include-property-tests",
500
+ "Include property-based tests for Layer 1 (default: local off, CI on)"
501
+ ).option("--strict-generation", "Fail if Layer 1 test generation fails (default: false)").option("--require-manifest", "Require manifest to be present and valid for Layer 1");
502
+ }
503
+ if (layer === 2) {
504
+ cmd.option("--skip-seed", "Skip applying seed data before Layer 2 pgTAP tests");
505
+ }
489
506
  if (layer >= 4) {
490
507
  cmd.option("--generate", "Generate tests from XState before running (Layer 4)").option("--advanced", "Generate advanced tests (requires --generate)").option("--auto", "Zero-config auto-generation (implementation-driven)").option("--update-snapshots", "Update visual baselines (Layer 4)").option("--filter <pattern>", 'Filter tests by pattern (e.g., "checkout-*")').option("--review-snapshots", "Interactive review of changed visual snapshots (Layer 4)").option("--force", "Force regenerate all tests, bypassing cache").option(
491
508
  "--require-manifest",
@@ -509,6 +526,12 @@ function createAliasCommand(alias, layer, description) {
509
526
  ).action(async (options) => {
510
527
  await runSingleLayer({ cmd, layer, options });
511
528
  });
529
+ {
530
+ cmd.option(
531
+ "--include-property-tests",
532
+ "Include property-based tests for Layer 1 (default: local off, CI on)"
533
+ ).option("--strict-generation", "Fail if Layer 1 test generation fails (default: false)").option("--require-manifest", "Require manifest to be present and valid for Layer 1");
534
+ }
512
535
  return cmd;
513
536
  }
514
537
  var testLogicCommand = createAliasCommand(
@@ -563,7 +586,7 @@ var testServiceCommand = new Command("test:service").description("Run Layer 1-3:
563
586
  ).option("--verbose", "Verbose output (full error details, environment info)").option("--changed", "Run only impacted layers based on git diff").option(
564
587
  "--base <ref>",
565
588
  "Base ref for --changed (default: $RUNA_TEST_BASE_REF or $GITHUB_BASE_REF)"
566
- ).action(async (options) => {
589
+ ).option("--skip-seed", "Skip applying seed data before Layer 2 pgTAP tests").action(async (options) => {
567
590
  try {
568
591
  const output = await runTestService({
569
592
  ci: options.ci ?? false,
@@ -571,7 +594,8 @@ var testServiceCommand = new Command("test:service").description("Run Layer 1-3:
571
594
  reportJson: options.reportJson,
572
595
  verbose: options.verbose,
573
596
  changed: options.changed,
574
- base: options.base
597
+ base: options.base,
598
+ skipSeed: options.skipSeed
575
599
  });
576
600
  emitJsonSuccess(testServiceCommand, TestServiceOutputSchema, output);
577
601
  } catch (error) {
@@ -1,8 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'module';
3
- import { emitJsonSuccess } from './chunk-UU55OH7P.js';
4
- import './chunk-RRGQCUKT.js';
5
- import './chunk-JT5SUTWE.js';
3
+ import { emitJsonSuccess } from './chunk-KE6QJBZG.js';
4
+ import './chunk-WJXC4MVY.js';
6
5
  import './chunk-HKUWEGUX.js';
7
6
  import { init_esm_shims } from './chunk-VRXHCR5K.js';
8
7
  import { createCLILogger, updateGoldenRecord, CLIError, generateE2ETests, TestE2EGenerateOutputSchema, generateSecurityTests, TestSecurityGenOutputSchema, generateUnitTests, TestUnitGenOutputSchema, generateApiTests, TestApiGenOutputSchema, generateComponentTests, TestComponentGenOutputSchema, generateE2EScaffold } from '@runa-ai/runa';
@@ -1,15 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'module';
3
- import { fetchTemplates } from './chunk-XJBQINSA.js';
3
+ import { fetchTemplates } from './chunk-CCW3PLQY.js';
4
4
  import { updateRunaConfigSdkVersion } from './chunk-6AALH2ED.js';
5
- import './chunk-RZLYEO4U.js';
6
5
  import './chunk-DRSUEMAK.js';
7
- import { emitJsonSuccess } from './chunk-UU55OH7P.js';
8
- import './chunk-RRGQCUKT.js';
9
- import './chunk-JT5SUTWE.js';
6
+ import './chunk-RZLYEO4U.js';
7
+ import { emitJsonSuccess } from './chunk-KE6QJBZG.js';
8
+ import './chunk-WJXC4MVY.js';
10
9
  import './chunk-HKUWEGUX.js';
11
10
  import { init_esm_shims } from './chunk-VRXHCR5K.js';
12
- import { createCLILogger, CLIError, UpgradeTransaction, readRunaVersion, syncTemplates, SyncOutputSchema, preCheckSync, findConflictFiles } from '@runa-ai/runa';
11
+ import { createCLILogger, CLIError, UpgradeTransaction, readRunaVersion, syncTemplates, SyncOutputSchema, findConflictFiles, preCheckSync } from '@runa-ai/runa';
13
12
  import { Command } from 'commander';
14
13
  import { execa } from 'execa';
15
14
 
@@ -468,6 +467,19 @@ async function executeTemplateSync(ctx, templatesDir) {
468
467
  });
469
468
  emitJsonSuccess(upgradeCommand, SyncOutputSchema, result);
470
469
  logHumanOutput(logger, result, options);
470
+ if (result.summary.conflicts > 0 && !options.preview) {
471
+ const conflictFiles = findConflictFiles(result.changes);
472
+ throw new CLIError(
473
+ `${result.summary.conflicts} file(s) have unresolved merge markers`,
474
+ "UPGRADE_UNRESOLVED_CONFLICTS",
475
+ [
476
+ `Files: ${conflictFiles.slice(0, 5).join(", ")}${conflictFiles.length > 5 ? ` and ${conflictFiles.length - 5} more` : ""}`,
477
+ "Resolve merge markers in the files listed above",
478
+ "Then run: runa check (to verify no markers remain)",
479
+ "Or re-run: runa upgrade --force (to overwrite with SDK version)"
480
+ ]
481
+ );
482
+ }
471
483
  }
472
484
  async function executeVerification(logger) {
473
485
  const verificationPassed = await runVerification(logger);
@@ -1,8 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'module';
3
- import { emitJsonSuccess } from './chunk-UU55OH7P.js';
4
- import './chunk-RRGQCUKT.js';
5
- import './chunk-JT5SUTWE.js';
3
+ import { emitJsonSuccess } from './chunk-KE6QJBZG.js';
4
+ import './chunk-WJXC4MVY.js';
6
5
  import './chunk-HKUWEGUX.js';
7
6
  import { init_esm_shims } from './chunk-VRXHCR5K.js';
8
7
  import { createCLILogger, validateConfig, ValidateConfigOutputSchema, CLIError } from '@runa-ai/runa';
@@ -1,8 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'module';
3
- import { emitJsonSuccess } from './chunk-UU55OH7P.js';
4
- import './chunk-RRGQCUKT.js';
5
- import './chunk-JT5SUTWE.js';
3
+ import { emitJsonSuccess } from './chunk-KE6QJBZG.js';
4
+ import './chunk-WJXC4MVY.js';
6
5
  import { getOutputFormatFromEnv } from './chunk-HKUWEGUX.js';
7
6
  import { init_esm_shims } from './chunk-VRXHCR5K.js';
8
7
  import { createCLILogger } from '@runa-ai/runa';
@@ -72,7 +71,7 @@ var vulnCheckCommand = new Command("vuln-check").description("Run comprehensive
72
71
  const logger = createCLILogger("vuln-check");
73
72
  const isJsonMode = getOutputFormatFromEnv() === "json" || options.format === "json";
74
73
  try {
75
- const { VulnChecker } = await import('./vuln-checker-2QXGN5YT.js');
74
+ const { VulnChecker } = await import('./vuln-checker-EJJTNDNE.js');
76
75
  const categoryMap = {
77
76
  code: ["injection", "auth", "crypto"],
78
77
  deps: ["dependency"],