@runa-ai/runa-cli 0.6.0 → 0.7.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.
Files changed (71) hide show
  1. package/dist/{build-BXUJKYHC.js → build-V66FAQXB.js} +152 -163
  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-AIP6MR42.js} +1 -1
  10. package/dist/chunk-FHG3ILE4.js +2011 -0
  11. package/dist/{chunk-22CS6EMA.js → chunk-H2AHNI75.js} +1 -1
  12. package/dist/{chunk-UU55OH7P.js → chunk-KE6QJBZG.js} +2 -3
  13. package/dist/{check-6AB5NGWK.js → chunk-QM53IQHM.js} +14 -12
  14. package/dist/{chunk-RRGQCUKT.js → chunk-WJXC4MVY.js} +30 -3
  15. package/dist/chunk-XDCHRVE3.js +215 -0
  16. package/dist/{chunk-P7U52PBY.js → chunk-Z4Z5DNW4.js} +49 -2
  17. package/dist/{ci-V3PIG2GI.js → ci-ZWRVWNFX.js} +1108 -132
  18. package/dist/cli/contract-output.d.ts +1 -0
  19. package/dist/{cli-GFRZCJQR.js → cli-2JNBJUBB.js} +216 -173
  20. package/dist/commands/build/actors/validate.d.ts +2 -0
  21. package/dist/commands/check/commands/check.d.ts +8 -3
  22. package/dist/commands/ci/machine/actors/db/collect-schema-stats.d.ts +9 -6
  23. package/dist/commands/ci/machine/actors/db/schema-canonical-diff.d.ts +55 -0
  24. package/dist/commands/ci/machine/actors/db/schema-stats.d.ts +11 -0
  25. package/dist/commands/ci/machine/actors/db/sync-schema.d.ts +9 -1
  26. package/dist/commands/ci/machine/formatters/sections/schema-matrix.d.ts +3 -3
  27. package/dist/commands/ci/machine/types.d.ts +2 -0
  28. package/dist/commands/ci/utils/execa-helpers.d.ts +1 -0
  29. package/dist/commands/db/commands/db-sync/error-classifier.d.ts +9 -0
  30. package/dist/commands/dev/actors/index.d.ts +5 -0
  31. package/dist/commands/dev/actors/tables-manifest.d.ts +16 -0
  32. package/dist/commands/dev/contract.d.ts +1 -1
  33. package/dist/commands/dev/guards.d.ts +24 -0
  34. package/dist/commands/dev/machine.d.ts +22 -3
  35. package/dist/commands/dev/types.d.ts +2 -0
  36. package/dist/commands/doctor.d.ts +9 -0
  37. package/dist/commands/inject-test-attrs/defaults.d.ts +9 -0
  38. package/dist/commands/utils/machine-state-logging.d.ts +20 -0
  39. package/dist/commands/utils/repo-root.d.ts +2 -0
  40. package/dist/{db-HR7CREX2.js → db-XULCILOU.js} +440 -2216
  41. package/dist/{dev-A7RW6XQV.js → dev-5YXNPTCJ.js} +168 -49
  42. package/dist/doctor-MZLOA53G.js +44 -0
  43. package/dist/{env-B47Z4747.js → env-SS66PZ4B.js} +6 -7
  44. package/dist/{env-files-K2C7O7L5.js → env-files-2UIUYLLR.js} +2 -2
  45. package/dist/{error-handler-4EYSDOSE.js → error-handler-HEXBRNVV.js} +2 -2
  46. package/dist/{hotfix-CULKKMGS.js → hotfix-YA3DGLOM.js} +3 -3
  47. package/dist/index.js +4 -4
  48. package/dist/{init-ELK5QCWR.js → init-ZIL6LRFO.js} +5 -6
  49. package/dist/{inject-test-attrs-Y5UD5P7Q.js → inject-test-attrs-P44BVTQS.js} +5 -18
  50. package/dist/{link-C43JRZWY.js → link-VSNDVZZD.js} +2 -3
  51. package/dist/manifest-TMFLESHW.js +19 -0
  52. package/dist/{risk-detector-BXUY2WKS.js → risk-detector-4U6ZJ2G5.js} +1 -1
  53. package/dist/{risk-detector-core-O7I7SPR7.js → risk-detector-core-TK4OAI3N.js} +2 -2
  54. package/dist/{risk-detector-plpgsql-SGMVKYJP.js → risk-detector-plpgsql-HWKS4OLR.js} +37 -7
  55. package/dist/{status-IJ4ZWHMX.js → status-UTKS63AB.js} +2 -3
  56. package/dist/{telemetry-FN7V727Y.js → telemetry-P56UBLZ2.js} +2 -3
  57. package/dist/{template-check-PNG5NQ5H.js → template-check-3P4HZXVY.js} +40 -29
  58. package/dist/{test-QYXE5UVW.js → test-V4KQL574.js} +34 -10
  59. package/dist/{test-gen-QPWOIEHU.js → test-gen-FS4CEY3P.js} +2 -3
  60. package/dist/{upgrade-3SLWVNAC.js → upgrade-NUK3ZBCL.js} +18 -6
  61. package/dist/{validate-SM4PXPS7.js → validate-CAAW4Y44.js} +2 -3
  62. package/dist/{vuln-check-TYQNEFS7.js → vuln-check-2W7N5TA2.js} +3 -4
  63. package/dist/{vuln-checker-2QXGN5YT.js → vuln-checker-IQJ56RUV.js} +413 -140
  64. package/dist/{watch-UCDVOQAH.js → watch-PNTKZYFB.js} +1 -1
  65. package/dist/{workflow-ZB5Q2PFY.js → workflow-H75N4BXX.js} +3 -4
  66. package/package.json +2 -2
  67. package/dist/chunk-JT5SUTWE.js +0 -9
  68. package/dist/chunk-M47WJJVS.js +0 -71
  69. package/dist/manifest-2NOQ2IMK.js +0 -32
  70. package/dist/{chunk-MNPMZERI.js → chunk-644FVGIQ.js} +1 -1
  71. package/dist/{chunk-XJBQINSA.js → chunk-SGJG3BKD.js} +1 -1
@@ -1,22 +1,28 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'module';
3
+ import { generateTablesManifest, writeEnvLocalBridge } from './chunk-FHG3ILE4.js';
3
4
  import { startAppBackground, waitForAppReady, detectApp } from './chunk-HD74F6W2.js';
4
- import { writeEnvLocalBridge } from './chunk-M47WJJVS.js';
5
- import { supabaseStartActor, envCheckActor, depsInstallActor, detectDatabase } from './chunk-HPYJPB5Y.js';
6
- import { init_local_supabase, detectLocalSupabasePorts } from './chunk-VM3IWOT5.js';
5
+ import './chunk-7B5C6U2K.js';
6
+ import { manifestActor, supabaseStartActor, envCheckActor, depsInstallActor, detectManifestTask, detectDatabase } from './chunk-2APB25TT.js';
7
+ import { findRepoRoot } from './chunk-3WDV32GA.js';
8
+ import './chunk-6FAU4IGR.js';
9
+ import { createMachineStateChangeLogger } from './chunk-5FT3F36G.js';
10
+ import './chunk-II7VYQEM.js';
11
+ import { init_local_supabase, buildLocalDatabaseUrl, detectLocalSupabasePorts } from './chunk-VM3IWOT5.js';
7
12
  import { secureExeca } from './chunk-RZLYEO4U.js';
8
- import { emitJsonSuccess } from './chunk-UU55OH7P.js';
9
- import './chunk-RRGQCUKT.js';
10
- import './chunk-JT5SUTWE.js';
13
+ import { emitJsonSuccess } from './chunk-KE6QJBZG.js';
14
+ import './chunk-WJXC4MVY.js';
11
15
  import './chunk-HKUWEGUX.js';
16
+ import './chunk-5NKWR4FF.js';
17
+ import './chunk-JMJP4A47.js';
12
18
  import { init_esm_shims } from './chunk-VRXHCR5K.js';
13
19
  import { createCLILogger, CLIError } from '@runa-ai/runa';
14
20
  import { Command } from 'commander';
15
21
  import { fromPromise, setup, assign, createActor } from 'xstate';
16
- import { existsSync, rmSync, readFileSync, unlinkSync } from 'fs';
17
- import path4 from 'path';
18
22
  import { z } from 'zod';
19
23
  import net from 'net';
24
+ import { existsSync, rmSync, readFileSync, unlinkSync } from 'fs';
25
+ import path3 from 'path';
20
26
  import { mkdir } from 'fs/promises';
21
27
 
22
28
  createRequire(import.meta.url);
@@ -67,6 +73,31 @@ init_esm_shims();
67
73
  // src/commands/dev/actors/index.ts
68
74
  init_esm_shims();
69
75
 
76
+ // src/commands/dev/actors/tables-manifest.ts
77
+ init_esm_shims();
78
+ init_local_supabase();
79
+ var tablesManifestActor = fromPromise(
80
+ async ({ input }) => {
81
+ const startTime = Date.now();
82
+ try {
83
+ await generateTablesManifest(input.repoRoot, {
84
+ databaseUrl: buildLocalDatabaseUrl(input.repoRoot)
85
+ });
86
+ return {
87
+ passed: true,
88
+ durationMs: Date.now() - startTime
89
+ };
90
+ } catch (error) {
91
+ const errorMessage = error instanceof Error ? error.message : String(error);
92
+ return {
93
+ passed: false,
94
+ durationMs: Date.now() - startTime,
95
+ error: `Tables manifest refresh failed: ${errorMessage}`
96
+ };
97
+ }
98
+ }
99
+ );
100
+
70
101
  // src/commands/dev/actors/process-check.ts
71
102
  init_esm_shims();
72
103
 
@@ -303,7 +334,7 @@ async function recoverPortConflict(port, portError) {
303
334
  }
304
335
  var processCheckActor = fromPromise(
305
336
  async ({ input }) => {
306
- const pidFile = path4.join(input.repoRoot, input.tmpDir, "app.pid");
337
+ const pidFile = path3.join(input.repoRoot, input.tmpDir, "app.pid");
307
338
  let staleProcessRecovered = false;
308
339
  await handlePidFile(pidFile, input.replace);
309
340
  if (!input.skipApp) {
@@ -322,9 +353,9 @@ init_esm_shims();
322
353
  var appStartActor = fromPromise(
323
354
  async ({ input }) => {
324
355
  const { repoRoot, appDir, port, tmpDir, stream, bundler } = input;
325
- const fullTmpDir = path4.join(repoRoot, tmpDir);
356
+ const fullTmpDir = path3.join(repoRoot, tmpDir);
326
357
  await mkdir(fullTmpDir, { recursive: true });
327
- const nextDir = path4.join(appDir, ".next");
358
+ const nextDir = path3.join(appDir, ".next");
328
359
  if (existsSync(nextDir)) {
329
360
  rmSync(nextDir, { recursive: true, force: true });
330
361
  console.log("[runa dev] Cleaned .next cache for fresh start");
@@ -367,9 +398,23 @@ function shouldSkipDb({ context }) {
367
398
  function shouldSkipApp({ context }) {
368
399
  return context.input.skipApp;
369
400
  }
401
+ function shouldSkipManifest({ context }) {
402
+ return context.input.skipApp || !context.hasManifestTask;
403
+ }
404
+ function shouldSkipTablesManifest({ context }) {
405
+ return context.input.skipApp || context.input.skipDb || !context.hasDatabase || !context.supabaseStarted;
406
+ }
407
+ function phaseFailed({
408
+ event
409
+ }) {
410
+ return event?.output?.passed === false;
411
+ }
370
412
  var guards = {
371
413
  shouldSkipDb,
372
- shouldSkipApp
414
+ shouldSkipApp,
415
+ shouldSkipManifest,
416
+ shouldSkipTablesManifest,
417
+ phaseFailed
373
418
  };
374
419
 
375
420
  // src/commands/dev/types.ts
@@ -423,6 +468,26 @@ var e2eMeta = {
423
468
  assertions: ["expect(log).toContain('Starting app')", "expect(ctx.appPid).toBeGreaterThan(0)"],
424
469
  nextStates: ["running", "failed"]
425
470
  },
471
+ manifest: {
472
+ description: "Refresh manifest.json before starting the dev app",
473
+ severity: "blocking",
474
+ observables: {
475
+ log: "Refreshing manifest",
476
+ fs: ".runa/manifests/manifest.json updated"
477
+ },
478
+ assertions: ["expect(log).toContain('Refreshing manifest')"],
479
+ nextStates: ["appStart", "failed"]
480
+ },
481
+ tablesManifest: {
482
+ description: "Refresh tables.json from the local database before starting the dev app",
483
+ severity: "blocking",
484
+ observables: {
485
+ log: "Refreshing tables manifest",
486
+ fs: ".runa/manifests/tables.json updated"
487
+ },
488
+ assertions: ["expect(log).toContain('Refreshing tables manifest')"],
489
+ nextStates: ["manifest", "failed"]
490
+ },
426
491
  running: {
427
492
  description: "Dev server running until STOP signal",
428
493
  severity: "non-critical",
@@ -477,12 +542,17 @@ var devMachine = setup({
477
542
  depsInstall: depsInstallActor,
478
543
  envCheck: envCheckActor,
479
544
  supabaseStart: supabaseStartActor,
545
+ tablesManifest: tablesManifestActor,
546
+ manifest: manifestActor,
480
547
  appStart: appStartActor,
481
548
  shutdown: shutdownActor
482
549
  },
483
550
  guards: {
484
551
  shouldSkipDb: guards.shouldSkipDb,
485
- shouldSkipApp: guards.shouldSkipApp
552
+ shouldSkipApp: guards.shouldSkipApp,
553
+ shouldSkipTablesManifest: guards.shouldSkipTablesManifest,
554
+ shouldSkipManifest: guards.shouldSkipManifest,
555
+ phaseFailed: guards.phaseFailed
486
556
  }
487
557
  }).createMachine({
488
558
  id: "dev",
@@ -495,6 +565,7 @@ var devMachine = setup({
495
565
  repoRoot,
496
566
  tmpDir: ".runa/tmp/dev",
497
567
  hasDatabase: detectDatabase(repoRoot),
568
+ hasManifestTask: detectManifestTask(repoRoot),
498
569
  appPid: null,
499
570
  supabaseStarted: false,
500
571
  staleProcessRecovered: false,
@@ -600,7 +671,66 @@ var devMachine = setup({
600
671
  type: "final"
601
672
  }
602
673
  },
603
- onDone: [{ guard: "shouldSkipApp", target: "running" }, { target: "appStart" }]
674
+ onDone: [{ guard: "shouldSkipApp", target: "running" }, { target: "tablesManifest" }]
675
+ },
676
+ // ============================================================
677
+ // Tables Manifest Refresh Phase
678
+ // ============================================================
679
+ tablesManifest: {
680
+ meta: { e2e: e2eMeta.tablesManifest },
681
+ always: [{ guard: "shouldSkipTablesManifest", target: "manifest" }],
682
+ invoke: {
683
+ src: "tablesManifest",
684
+ input: ({ context }) => ({
685
+ repoRoot: context.repoRoot
686
+ }),
687
+ onDone: [
688
+ {
689
+ guard: "phaseFailed",
690
+ target: "failed",
691
+ actions: assign({
692
+ error: ({ event }) => event.output.error ?? "Tables manifest refresh failed during dev startup"
693
+ })
694
+ },
695
+ { target: "manifest" }
696
+ ],
697
+ onError: {
698
+ target: "failed",
699
+ actions: assign({
700
+ error: ({ event }) => `Tables manifest refresh failed: ${event.error instanceof Error ? event.error.message : String(event.error)}`
701
+ })
702
+ }
703
+ }
704
+ },
705
+ // ============================================================
706
+ // Manifest Refresh Phase
707
+ // ============================================================
708
+ manifest: {
709
+ meta: { e2e: e2eMeta.manifest },
710
+ always: [{ guard: "shouldSkipManifest", target: "appStart" }],
711
+ invoke: {
712
+ src: "manifest",
713
+ input: ({ context }) => ({
714
+ repoRoot: context.repoRoot,
715
+ tmpDir: context.tmpDir
716
+ }),
717
+ onDone: [
718
+ {
719
+ guard: "phaseFailed",
720
+ target: "failed",
721
+ actions: assign({
722
+ error: ({ event }) => event.output.error ?? "Manifest refresh failed during dev startup"
723
+ })
724
+ },
725
+ { target: "appStart" }
726
+ ],
727
+ onError: {
728
+ target: "failed",
729
+ actions: assign({
730
+ error: ({ event }) => `Manifest refresh failed: ${event.error instanceof Error ? event.error.message : String(event.error)}`
731
+ })
732
+ }
733
+ }
604
734
  },
605
735
  // ============================================================
606
736
  // App Start Phase
@@ -711,13 +841,21 @@ var stateLogHandlers = {
711
841
  "setup.supabaseStart": (logger) => {
712
842
  logger.info(" Starting Supabase...");
713
843
  },
844
+ tablesManifest: (logger) => {
845
+ logger.section("Phase 1: Tables");
846
+ logger.info("Refreshing tables manifest...");
847
+ },
848
+ manifest: (logger) => {
849
+ logger.section("Phase 2: Manifest");
850
+ logger.info("Refreshing manifest artifacts...");
851
+ },
714
852
  appStart: (logger) => {
715
- logger.section("Phase 1: App Start");
853
+ logger.section("Phase 3: App Start");
716
854
  logger.info("Starting Next.js dev server...");
717
855
  },
718
- running: (logger, context) => {
856
+ running: (logger, _context, extra) => {
719
857
  logger.section("Development Server Running");
720
- logger.success(`App running at http://localhost:${context?.port ?? 3e3}`);
858
+ logger.success(`App running at http://localhost:${extra?.port ?? 3e3}`);
721
859
  logger.info("");
722
860
  logger.info("Press Ctrl+C to stop");
723
861
  },
@@ -727,16 +865,14 @@ var stateLogHandlers = {
727
865
  logger.info("Stopping dev server...");
728
866
  }
729
867
  };
730
- function handleStateChange(snapshot, prevState, logger, port) {
731
- const state = getStateName(snapshot);
732
- if (state === prevState) return;
733
- const handler = stateLogHandlers[state] ?? stateLogHandlers[state.split(".")[0]];
734
- if (handler) {
735
- handler(logger, { port });
736
- }
737
- if (prevState === "processCheck" && state.startsWith("setup") && snapshot.context.staleProcessRecovered) {
738
- logger.success(" Stale process recovered. Port is now available.");
739
- }
868
+ var handleStateChange = createMachineStateChangeLogger({
869
+ getState: getStateName,
870
+ getContext: (snapshot) => snapshot.context,
871
+ handlers: stateLogHandlers,
872
+ useParentState: true
873
+ });
874
+ function shouldLogStaleRecovery(state, prevState, snapshot) {
875
+ return prevState === "processCheck" && state.startsWith("setup") && snapshot.context.staleProcessRecovered;
740
876
  }
741
877
  function printSummary(logger, output) {
742
878
  if (output.success) {
@@ -769,7 +905,7 @@ function tryWritePortBridge(snapshot, previousState, currentState, logger) {
769
905
  detectLocalSupabasePorts(snapshot.context.repoRoot)
770
906
  );
771
907
  logPortBridgeResult(logger, bridgeResult);
772
- } catch {
908
+ } catch (error) {
773
909
  }
774
910
  }
775
911
  function resolveOutputIfComplete(snapshot, resolve) {
@@ -779,26 +915,6 @@ function resolveOutputIfComplete(snapshot, resolve) {
779
915
  resolve(output);
780
916
  }
781
917
  }
782
- function findRepoRoot(startDir) {
783
- let current = startDir;
784
- while (current !== path4.dirname(current)) {
785
- if (existsSync(path4.join(current, "turbo.json"))) {
786
- return current;
787
- }
788
- const pkgPath = path4.join(current, "package.json");
789
- if (existsSync(pkgPath)) {
790
- try {
791
- const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
792
- if (pkg.workspaces) {
793
- return current;
794
- }
795
- } catch {
796
- }
797
- }
798
- current = path4.dirname(current);
799
- }
800
- return startDir;
801
- }
802
918
  async function runDevMachine(input, logger) {
803
919
  const repoRoot = input.targetDir ?? findRepoRoot(process.cwd());
804
920
  return new Promise((resolve, reject) => {
@@ -809,7 +925,10 @@ async function runDevMachine(input, logger) {
809
925
  actor.subscribe((snapshot) => {
810
926
  const currentState = getStateName(snapshot);
811
927
  if (currentState !== previousState) {
812
- handleStateChange(snapshot, previousState, logger, input.port);
928
+ handleStateChange(snapshot, previousState, logger, { port: input.port ?? 3e3 });
929
+ if (shouldLogStaleRecovery(currentState, previousState, snapshot)) {
930
+ logger.success(" Stale process recovered. Port is now available.");
931
+ }
813
932
  tryWritePortBridge(snapshot, previousState, currentState, logger);
814
933
  previousState = currentState;
815
934
  }
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from 'module';
3
+ import { runCheckCommand } from './chunk-QM53IQHM.js';
4
+ import './chunk-644FVGIQ.js';
5
+ import './chunk-DRSUEMAK.js';
6
+ import './chunk-KE6QJBZG.js';
7
+ import './chunk-WJXC4MVY.js';
8
+ import './chunk-HKUWEGUX.js';
9
+ import './chunk-JMJP4A47.js';
10
+ import { init_esm_shims } from './chunk-VRXHCR5K.js';
11
+ import { CLIError } from '@runa-ai/runa/cli-runtime';
12
+ import { Command } from 'commander';
13
+
14
+ createRequire(import.meta.url);
15
+
16
+ // src/commands/doctor.ts
17
+ init_esm_shims();
18
+ var DOCTOR_DEPRECATION_NOTICE = "`runa doctor` is deprecated. Use `runa check` instead.";
19
+ var doctorCommand = new Command("doctor").description("Run diagnostic checks (deprecated alias for `runa check`)").option(
20
+ "-s, --scope <scope>",
21
+ "Check scope: all | build | ci | deploy | testing | layer1 | layer2 | layer3 | layer4",
22
+ "all"
23
+ ).option("--fix", "Attempt to auto-fix issues").option("-v, --verbose", "Show detailed output with fix hints").option("--dry-run", "Show what would be checked without running").option("--cwd <path>", "Working directory (default: current directory)").action(async (options, command) => {
24
+ try {
25
+ await runCheckCommand(options, {
26
+ command,
27
+ loggerName: "doctor",
28
+ deprecationNotice: DOCTOR_DEPRECATION_NOTICE
29
+ });
30
+ } catch (error) {
31
+ if (error instanceof CLIError) {
32
+ throw error;
33
+ }
34
+ const err = error instanceof Error ? error : new Error(String(error));
35
+ throw new CLIError(
36
+ `Doctor check failed: ${err.message}`,
37
+ "DOCTOR_ERROR",
38
+ ["Check error details above", "Try: runa check --verbose"],
39
+ err
40
+ );
41
+ }
42
+ });
43
+
44
+ export { doctorCommand };
@@ -1,20 +1,19 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'module';
3
+ import { tryResolveDatabaseUrl } from './chunk-KWX3JHCY.js';
3
4
  import { registerCleanup } from './chunk-TYIAD6SB.js';
4
5
  import { isNonInteractiveEnabled } from './chunk-6Y3LAUGL.js';
5
- import { tryResolveDatabaseUrl } from './chunk-KWX3JHCY.js';
6
6
  import './chunk-NPSRD26F.js';
7
- import { loadEnvFiles } from './chunk-MNPMZERI.js';
8
- import './chunk-JMJP4A47.js';
7
+ import { loadEnvFiles } from './chunk-644FVGIQ.js';
9
8
  import { getVercelRootDirectory } from './chunk-MXRWBNIY.js';
10
9
  import { syncRunaConfigWithVercel } from './chunk-6AALH2ED.js';
10
+ import './chunk-DRSUEMAK.js';
11
11
  import './chunk-II7VYQEM.js';
12
12
  import { init_local_supabase, getLocalSupabaseEnvValues, getLocalValueDescriptions } from './chunk-VM3IWOT5.js';
13
- import './chunk-DRSUEMAK.js';
14
- import { emitJsonSuccess } from './chunk-UU55OH7P.js';
15
- import './chunk-RRGQCUKT.js';
16
- import './chunk-JT5SUTWE.js';
13
+ import { emitJsonSuccess } from './chunk-KE6QJBZG.js';
14
+ import './chunk-WJXC4MVY.js';
17
15
  import './chunk-HKUWEGUX.js';
16
+ import './chunk-JMJP4A47.js';
18
17
  import { init_esm_shims } from './chunk-VRXHCR5K.js';
19
18
  import { Command } from 'commander';
20
19
  import { existsSync, rmSync, readFileSync, mkdtempSync, writeFileSync, chmodSync, realpathSync, unlinkSync } from 'fs';
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'module';
3
- export { loadEnvFiles } from './chunk-MNPMZERI.js';
4
- import './chunk-JMJP4A47.js';
3
+ export { loadEnvFiles } from './chunk-644FVGIQ.js';
5
4
  import './chunk-DRSUEMAK.js';
5
+ import './chunk-JMJP4A47.js';
6
6
  import './chunk-VRXHCR5K.js';
7
7
 
8
8
  createRequire(import.meta.url);
@@ -2,7 +2,7 @@
2
2
  import { createRequire } from 'module';
3
3
  import './chunk-ZZOXM6Q4.js';
4
4
  import { ERROR_CATALOG } from './chunk-JQXOVCOP.js';
5
- import { ErrorEnvelopeSchema, CLI_CONTRACT_VERSION } from './chunk-JT5SUTWE.js';
5
+ import { ErrorEnvelopeSchema, CLI_CONTRACT_VERSION, writeJsonEnvelope } from './chunk-WJXC4MVY.js';
6
6
  import { getOutputFormatFromEnv } from './chunk-HKUWEGUX.js';
7
7
  import { init_esm_shims } from './chunk-VRXHCR5K.js';
8
8
  import { formatCLIError, CLIError, createCLILogger } from '@runa-ai/runa/cli-runtime';
@@ -398,7 +398,7 @@ function outputJsonError(formatted, allSuggestions) {
398
398
  const parsed = ErrorEnvelopeSchema.parse(payload);
399
399
  process.env.RUNA_JSON_EMITTING = "true";
400
400
  try {
401
- process.stdout.write(`${JSON.stringify(parsed)}
401
+ writeJsonEnvelope(`${JSON.stringify(parsed)}
402
402
  `);
403
403
  } finally {
404
404
  process.env.RUNA_JSON_EMITTING = "false";
@@ -4,11 +4,11 @@ import './chunk-ZZOXM6Q4.js';
4
4
  import { createError } from './chunk-JQXOVCOP.js';
5
5
  import { tryResolveDatabaseUrl } from './chunk-KWX3JHCY.js';
6
6
  import './chunk-NPSRD26F.js';
7
- import { loadEnvFiles } from './chunk-MNPMZERI.js';
8
- import './chunk-JMJP4A47.js';
7
+ import { loadEnvFiles } from './chunk-644FVGIQ.js';
8
+ import { isPathContained } from './chunk-DRSUEMAK.js';
9
9
  import './chunk-II7VYQEM.js';
10
10
  import './chunk-VM3IWOT5.js';
11
- import { isPathContained } from './chunk-DRSUEMAK.js';
11
+ import './chunk-JMJP4A47.js';
12
12
  import { init_esm_shims } from './chunk-VRXHCR5K.js';
13
13
  import { Command } from 'commander';
14
14
  import { CLIError, createCLILogger, createDbSnapshot } from '@runa-ai/runa';
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'module';
3
3
  import { getRequestedCommandNameFromArgv } from './chunk-UWWSAPDR.js';
4
- import { CLI_VERSION } from './chunk-GOGRLQNP.js';
4
+ import { CLI_VERSION } from './chunk-AIP6MR42.js';
5
5
  import { init_esm_shims } from './chunk-VRXHCR5K.js';
6
6
  import { realpathSync } from 'fs';
7
7
  import { fileURLToPath } from 'url';
@@ -36,7 +36,7 @@ async function getProgram(options) {
36
36
  };
37
37
  const nextKey = getProgramCacheKey(resolvedOptions);
38
38
  if (!programInstance || programCacheKey !== nextKey) {
39
- const { createProgram } = await import('./cli-GFRZCJQR.js');
39
+ const { createProgram } = await import('./cli-2JNBJUBB.js');
40
40
  programInstance = await createProgram(resolvedOptions);
41
41
  programCacheKey = nextKey;
42
42
  }
@@ -60,7 +60,7 @@ async function runCliFromProcessArgv() {
60
60
  return;
61
61
  }
62
62
  const { setupSignalHandlers } = await import('./signal-handler-DO3OANW5.js');
63
- const { executeProgram } = await import('./cli-GFRZCJQR.js');
63
+ const { executeProgram } = await import('./cli-2JNBJUBB.js');
64
64
  setupSignalHandlers();
65
65
  const options = getProgramLoadOptions(argv);
66
66
  const program = await getProgram(options);
@@ -68,7 +68,7 @@ async function runCliFromProcessArgv() {
68
68
  }
69
69
  if (isDirectlyExecuted()) {
70
70
  runCliFromProcessArgv().catch(async (error) => {
71
- const { handleCLIError } = await import('./error-handler-4EYSDOSE.js');
71
+ const { handleCLIError } = await import('./error-handler-HEXBRNVV.js');
72
72
  handleCLIError(error);
73
73
  });
74
74
  }
@@ -1,14 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'module';
3
- import { getVercelRootDirectory } from './chunk-MXRWBNIY.js';
4
3
  import { diagnoseInitFailure } from './chunk-AAIE4F2U.js';
5
- import { fetchTemplates } from './chunk-XJBQINSA.js';
4
+ import { getVercelRootDirectory } from './chunk-MXRWBNIY.js';
5
+ import { fetchTemplates } from './chunk-SGJG3BKD.js';
6
6
  import { syncRunaConfigWithVercel } from './chunk-6AALH2ED.js';
7
- import './chunk-RZLYEO4U.js';
8
7
  import './chunk-DRSUEMAK.js';
9
- import { emitJsonSuccess } from './chunk-UU55OH7P.js';
10
- import './chunk-RRGQCUKT.js';
11
- import './chunk-JT5SUTWE.js';
8
+ import './chunk-RZLYEO4U.js';
9
+ import { emitJsonSuccess } from './chunk-KE6QJBZG.js';
10
+ import './chunk-WJXC4MVY.js';
12
11
  import './chunk-HKUWEGUX.js';
13
12
  import { init_esm_shims } from './chunk-VRXHCR5K.js';
14
13
  import fs from 'fs';
@@ -1,11 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'module';
3
- import { injectTestAttrsAction } from './chunk-P7U52PBY.js';
4
- export { processFiles } from './chunk-P7U52PBY.js';
3
+ import { DEFAULT_INCLUDE_PATTERNS, DEFAULT_EXCLUDE_PATTERNS, injectTestAttrsAction } from './chunk-Z4Z5DNW4.js';
4
+ export { processFiles } from './chunk-Z4Z5DNW4.js';
5
5
  import './chunk-DRSUEMAK.js';
6
- import './chunk-UU55OH7P.js';
7
- import './chunk-RRGQCUKT.js';
8
- import './chunk-JT5SUTWE.js';
6
+ import './chunk-KE6QJBZG.js';
7
+ import './chunk-WJXC4MVY.js';
9
8
  import './chunk-HKUWEGUX.js';
10
9
  import { init_esm_shims } from './chunk-VRXHCR5K.js';
11
10
  import { Command } from 'commander';
@@ -17,19 +16,7 @@ init_esm_shims();
17
16
 
18
17
  // src/commands/inject-test-attrs/commands/inject-test-attrs.ts
19
18
  init_esm_shims();
20
- var injectTestAttrsCommand = new Command("inject-test-attrs").description("Inject XState test attributes into source files (git-managed)").option("--check", "Check if files need injection without modifying (CI mode)").option("--force", "Force re-injection even if marker exists").option("--verbose", "Show detailed output").option("--include <patterns...>", "Glob patterns to include", [
21
- "apps/**/*.tsx",
22
- "apps/**/*.ts",
23
- "packages/**/*.tsx",
24
- "packages/**/*.ts"
25
- ]).option("--exclude <patterns...>", "Glob patterns to exclude", [
26
- "**/node_modules/**",
27
- "**/.next/**",
28
- "**/dist/**",
29
- "**/*.test.*",
30
- "**/*.spec.*",
31
- "**/*.stories.*"
32
- ]).option("--no-manifest", "Skip E2E selector manifest generation").option("--manifest-dir <dir>", "Output directory for manifest files", ".runa").option("--strict-detect", "Fail when fallback machine detection is used (for deterministic CI)").action(async (rawOptions) => {
19
+ var injectTestAttrsCommand = new Command("inject-test-attrs").description("Inject XState test attributes into source files (git-managed)").option("--check", "Check if files need injection without modifying (CI mode)").option("--force", "Force re-injection even if marker exists").option("--verbose", "Show detailed output").option("--include <patterns...>", "Glob patterns to include", [...DEFAULT_INCLUDE_PATTERNS]).option("--exclude <patterns...>", "Glob patterns to exclude", [...DEFAULT_EXCLUDE_PATTERNS]).option("--no-manifest", "Skip E2E selector manifest generation").option("--manifest-dir <dir>", "Output directory for manifest files", ".runa").option("--strict-detect", "Fail when fallback machine detection is used (for deterministic CI)").action(async (rawOptions) => {
33
20
  await injectTestAttrsAction(rawOptions, injectTestAttrsCommand);
34
21
  });
35
22
 
@@ -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';
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from 'module';
3
+ import { DEFAULT_INCLUDE_PATTERNS, DEFAULT_EXCLUDE_PATTERNS, injectTestAttrsAction } from './chunk-Z4Z5DNW4.js';
4
+ import './chunk-DRSUEMAK.js';
5
+ import './chunk-KE6QJBZG.js';
6
+ import './chunk-WJXC4MVY.js';
7
+ import './chunk-HKUWEGUX.js';
8
+ import { init_esm_shims } from './chunk-VRXHCR5K.js';
9
+ import { Command } from 'commander';
10
+
11
+ createRequire(import.meta.url);
12
+
13
+ // src/commands/manifest/index.ts
14
+ init_esm_shims();
15
+ var manifestCommand = new Command("manifest").description("Generate E2E manifest (manifest.json) - alias for inject-test-attrs").option("--check", "Check if manifest needs regeneration (CI mode)").option("--force", "Force regeneration even if up-to-date").option("--verbose", "Show detailed output").option("--include <patterns...>", "Glob patterns to include", [...DEFAULT_INCLUDE_PATTERNS]).option("--exclude <patterns...>", "Glob patterns to exclude", [...DEFAULT_EXCLUDE_PATTERNS]).option("--no-manifest", "Skip manifest file generation (attributes only)").option("--manifest-dir <dir>", "Output directory for manifest files", ".runa").option("--strict-detect", "Fail when fallback machine detection is used (for deterministic CI)").action(async (options) => {
16
+ await injectTestAttrsAction(options, manifestCommand);
17
+ });
18
+
19
+ export { manifestCommand };
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'module';
3
- export { categorizeRisks, detectSchemaRisks } from './chunk-22CS6EMA.js';
3
+ export { categorizeRisks, detectSchemaRisks } from './chunk-H2AHNI75.js';
4
4
  import './chunk-VRXHCR5K.js';
5
5
 
6
6
  createRequire(import.meta.url);
@@ -38,7 +38,7 @@ var SCAN_ABORT_REASON_CODE = "SCHEMA_SCAN_TOO_LARGE";
38
38
  var plpgsqlModulePromise = null;
39
39
  async function loadPlpgsqlRiskDetectorModule() {
40
40
  if (!plpgsqlModulePromise) {
41
- plpgsqlModulePromise = import('./risk-detector-plpgsql-SGMVKYJP.js').catch((error) => {
41
+ plpgsqlModulePromise = import('./risk-detector-plpgsql-HWKS4OLR.js').catch((error) => {
42
42
  plpgsqlModulePromise = null;
43
43
  throw error;
44
44
  });
@@ -98,7 +98,7 @@ async function detectSchemaRisks(filePath) {
98
98
  const contentLineStarts = buildLineStarts(content);
99
99
  const contentRisks = detectRisksFromContent(searchableContent, content, contentLineStarts);
100
100
  const { detectPlpgsqlDynamicExecutionRisks } = await loadPlpgsqlRiskDetectorModule();
101
- const plpgsqlRisks = detectPlpgsqlDynamicExecutionRisks(content);
101
+ const plpgsqlRisks = detectPlpgsqlDynamicExecutionRisks(maskedContent);
102
102
  const fkRisks = detectForeignKeyRisks(searchableContent, content, contentLineStarts);
103
103
  const risks = deduplicateSchemaRisksBySeverity([...contentRisks, ...plpgsqlRisks, ...fkRisks]);
104
104
  return risks;