@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
@@ -0,0 +1,77 @@
1
+ /**
2
+ * AI HINT: Canonical schema snapshot + semantic diff
3
+ *
4
+ * Purpose: Detect schema drift beyond simple T/F/P/I counts.
5
+ * Pattern: Normalize PostgreSQL catalog metadata into stable signatures.
6
+ *
7
+ * Detects semantic differences in:
8
+ * - Tables (columns, constraints, RLS flags)
9
+ * - Functions (signature, language, volatility, security, body)
10
+ * - Policies (command, roles, USING / WITH CHECK)
11
+ * - Indexes (definition, uniqueness, predicate)
12
+ * - Triggers (definition)
13
+ */
14
+ export type CanonicalSchemaObjectKind = 'table' | 'function' | 'policy' | 'index' | 'trigger';
15
+ export interface CanonicalSchemaObject {
16
+ kind: CanonicalSchemaObjectKind;
17
+ schema: string;
18
+ name: string;
19
+ key: string;
20
+ label: string;
21
+ parentName?: string;
22
+ signature: string;
23
+ }
24
+ export interface CanonicalSchemaSnapshot {
25
+ available: boolean;
26
+ objects: CanonicalSchemaObject[];
27
+ error?: string;
28
+ }
29
+ export interface CanonicalSchemaObjectPair {
30
+ reference: CanonicalSchemaObject;
31
+ target: CanonicalSchemaObject;
32
+ }
33
+ export interface CanonicalSchemaDiff {
34
+ missing: CanonicalSchemaObject[];
35
+ extra: CanonicalSchemaObject[];
36
+ changed: CanonicalSchemaObjectPair[];
37
+ renamed: CanonicalSchemaObjectPair[];
38
+ }
39
+ export interface SchemaSemanticSummary {
40
+ hasChanges: boolean;
41
+ changedKinds: CanonicalSchemaObjectKind[];
42
+ counts: {
43
+ missing: number;
44
+ extra: number;
45
+ changed: number;
46
+ renamed: number;
47
+ };
48
+ }
49
+ export type CanonicalDiffBySchema = Record<string, SchemaSemanticSummary>;
50
+ export declare function createUnavailableCanonicalSnapshot(error: string): CanonicalSchemaSnapshot;
51
+ interface TableColumnRow {
52
+ schema_name: string;
53
+ table_name: string;
54
+ attnum: number;
55
+ column_name: string;
56
+ data_type: string;
57
+ not_null: boolean;
58
+ default_expr?: string | null;
59
+ identity_kind?: string | null;
60
+ generated_kind?: string | null;
61
+ }
62
+ interface CanonicalTableColumnPayload {
63
+ name: string;
64
+ type: string;
65
+ notNull: boolean;
66
+ default: string;
67
+ identity: string;
68
+ generated: string;
69
+ }
70
+ export declare function createCanonicalTableColumnPayload(row: Pick<TableColumnRow, 'column_name' | 'data_type' | 'not_null' | 'default_expr' | 'identity_kind' | 'generated_kind'>): CanonicalTableColumnPayload;
71
+ export declare function sortCanonicalTableColumns(columns: readonly CanonicalTableColumnPayload[]): CanonicalTableColumnPayload[];
72
+ export declare function getCanonicalSchemaSnapshot(databaseUrl: string): Promise<CanonicalSchemaSnapshot>;
73
+ export declare function compareCanonicalSnapshots(reference: CanonicalSchemaSnapshot, target: CanonicalSchemaSnapshot): CanonicalSchemaDiff;
74
+ export declare function summarizeCanonicalDiffBySchema(diff: CanonicalSchemaDiff): CanonicalDiffBySchema;
75
+ export declare function hasCanonicalChanges(diff: CanonicalSchemaDiff): boolean;
76
+ export {};
77
+ //# sourceMappingURL=schema-canonical-diff.d.ts.map
@@ -32,6 +32,7 @@
32
32
  * - Supabase platform functions: supabase_* (not extension-owned)
33
33
  * - PostgREST platform functions: postgrest_*, pgrst_*, _pgrst_* (not extension-owned)
34
34
  */
35
+ import type { CanonicalSchemaSnapshot } from './schema-canonical-diff.js';
35
36
  /**
36
37
  * Statistics for a single schema.
37
38
  */
@@ -59,6 +60,10 @@ export interface IndexInfo {
59
60
  isPartial: boolean;
60
61
  /** WHERE clause for partial indexes (e.g., 'check_run_id IS NOT NULL') */
61
62
  whereClause?: string;
63
+ /** Access method (e.g., btree, gin) */
64
+ accessMethod?: string;
65
+ /** Normalized index definition for semantic comparison */
66
+ definition?: string;
62
67
  }
63
68
  /**
64
69
  * Statistics for all schemas in an environment.
@@ -70,6 +75,12 @@ export interface EnvironmentSchemaStats {
70
75
  total: SchemaStats;
71
76
  /** Detailed index list for diff detection (optional for backward compatibility) */
72
77
  indexList?: IndexInfo[];
78
+ /** Canonical snapshot for semantic diff detection */
79
+ canonicalSnapshot?: CanonicalSchemaSnapshot;
80
+ /** False when stats collection failed and counts should not be trusted */
81
+ available?: boolean;
82
+ /** Collection error summary for degraded display */
83
+ error?: string;
73
84
  }
74
85
  /**
75
86
  * Snapshot of schema statistics across all environments.
@@ -25,7 +25,7 @@
25
25
  * - Captures hazards from pg-schema-diff
26
26
  * - Reports all changes in PR comment
27
27
  */
28
- import type { CiMode, SchemaDriftSnapshot } from '../../types.js';
28
+ import type { CiMode, SchemaChangeStats, SchemaDriftSnapshot } from '../../types.js';
29
29
  export interface SyncSchemaInput {
30
30
  repoRoot: string;
31
31
  tmpDir: string;
@@ -38,6 +38,14 @@ export interface SyncSchemaOutput {
38
38
  error?: string;
39
39
  schemaDrift?: SchemaDriftSnapshot;
40
40
  }
41
+ export declare function analyzePostCheckResult(params: {
42
+ exitCode: number;
43
+ output: string;
44
+ residualStats: SchemaChangeStats;
45
+ }): {
46
+ hasDrift: boolean;
47
+ commandFailed: boolean;
48
+ };
41
49
  /**
42
50
  * Sync database schema using runa db sync.
43
51
  * ALWAYS applies changes - NO dry-run mode in CI.
@@ -10,8 +10,10 @@
10
10
  * - Fire-and-forget pattern (non-blocking)
11
11
  */
12
12
  import type { CLILogger } from '@runa-ai/runa';
13
+ import { type CiStep } from '../formatters/github-comment.js';
13
14
  import { type CiSnapshot } from '../machine.js';
14
15
  import type { CiInput, CiOutput, LayerResult } from '../types.js';
16
+ export declare function resolveStepForState(state: string): CiStep | undefined;
15
17
  /**
16
18
  * State change callback type.
17
19
  */
@@ -0,0 +1,30 @@
1
+ import { type ExpectedDriftEntry, type IndexDiff, type SchemaStats, type SchemaStatsSnapshot } from '../../actors/db/schema-stats.js';
2
+ import { type CanonicalSchemaDiff } from '../../actors/db/schema-canonical-diff.js';
3
+ import type { ProductionPreview } from '../../types.js';
4
+ export interface ProductionSchemaSignals {
5
+ previewHasChanges: boolean;
6
+ indexDiff: IndexDiff | null;
7
+ semanticDiff: CanonicalSchemaDiff | null;
8
+ countDiffs: CountDiffEntry[];
9
+ hasIndexChanges: boolean;
10
+ hasUnexpectedIndexChanges: boolean;
11
+ hasSemanticChanges: boolean;
12
+ hasCountChanges: boolean;
13
+ hasUnexpectedCountChanges: boolean;
14
+ hasKnownDriftOnly: boolean;
15
+ knownDriftReasons: string[];
16
+ requiresDeploy: boolean;
17
+ previewMissedChanges: boolean;
18
+ previewOnlyChanges: boolean;
19
+ }
20
+ export interface CountDiffEntry {
21
+ schema: string;
22
+ field: keyof SchemaStats;
23
+ value: number;
24
+ reference: number;
25
+ delta: number;
26
+ expected: boolean;
27
+ reason?: string;
28
+ }
29
+ export declare function getProductionSchemaSignals(productionPreview: ProductionPreview | null, schemaStats: SchemaStatsSnapshot | null, expectedDrift?: ExpectedDriftEntry[]): ProductionSchemaSignals;
30
+ //# sourceMappingURL=production-schema-status.d.ts.map
@@ -5,13 +5,13 @@
5
5
  * Pattern: Pure function - takes schema stats, returns markdown lines
6
6
  *
7
7
  * Output format (includes I for Indexes, with diff highlighting):
8
- * | Schema | 📄 Local | 🔬 CI | 🏭 Prod |
8
+ * | Schema | 📄 Reference | 🔬 CI | 🏭 Prod |
9
9
  * |--------|:--------:|:-----:|:-------:|
10
10
  * | accounts | 5T 3F 12P 3I | 5T 3F 12P 3I | 📝 5T 3F 12P **2I** |
11
11
  *
12
12
  * Diff highlighting:
13
- * - ⚠️ = CI differs from Local (SSOT) - unexpected
14
- * - 📝 = Prod differs from Local (schema changes pending)
13
+ * - ⚠️ = CI differs from Reference (count diff or semantic diff)
14
+ * - 📝 = Prod differs from Reference (count diff or semantic diff)
15
15
  * - 📋 = Known drift (matches expectedDrift config)
16
16
  * - **bold** = specific field that differs
17
17
  */
@@ -29,6 +29,14 @@ export declare function getLayersForCorePhase(selectedLayers: number[], mode: st
29
29
  * Check if E2E layer (4) is selected.
30
30
  */
31
31
  export declare function hasE2ELayer(selectedLayers: number[]): boolean;
32
+ /**
33
+ * Determine whether schema stats can safely reuse the synced CI database
34
+ * instead of rebuilding a temporary reference database.
35
+ *
36
+ * This optimization is only valid for PR CI runs where local-only overlays
37
+ * such as ci.custom.sql are never applied.
38
+ */
39
+ export declare function shouldReuseCiReferenceStats(context: CiContext): boolean;
32
40
  /** Layer result status type */
33
41
  export type LayerStatus = 'passed' | 'failed' | 'skipped' | 'timeout' | 'killed';
34
42
  /**
@@ -8,9 +8,10 @@
8
8
  * 1. idle → START → setup (mode-aware: localSetup or prLocalSetup)
9
9
  * 2. [ci-local] setup → dbReset → pullProduction? → syncSchema → applySeeds
10
10
  * → productionPreview → collectSchemaStats → installPgTap → runCoreTests → done
11
- * 3. [ci-pr] setup → initialComment → syncSchema → applySeeds → productionPreview
12
- * collectSchemaStatssetupRolesstaticChecksbuildAndPlaywright
13
- * appStart → capabilities → runCoreTests → e2ePhase → finalize → done
11
+ * 3. [ci-pr] setup → initialComment → syncSchema → applySeeds → postSeedPr
12
+ * execution: setupRolesstaticChecksbuildAndPlaywrightappStart
13
+ * → capabilities → runCoreTests → e2ePhase → finalize → done
14
+ * observability: productionPreview ∥ collectSchemaStats
14
15
  *
15
16
  * State Flow (detailed):
16
17
  * idle → setup → initialComment? → dbReset? → pullProduction? → syncSchema → applySeeds
@@ -168,10 +169,20 @@ export declare const ciMachine: import("xstate").StateMachine<CiContext, CiEvent
168
169
  } | {
169
170
  type: "allTestsPassed";
170
171
  params: unknown;
171
- }, never, "done" | "failed" | "staticChecks" | "idle" | "capabilities" | "appStart" | "syncSchema" | "applySeeds" | "productionPreview" | "pullProduction" | "collectSchemaStats" | "setupRoles" | "installPgTap" | "buildAndPlaywright" | "initialComment" | "dbReset" | "decidePath" | "runCoreTests" | "coreTestsFailed" | "coreTestsComplete" | {
172
+ }, never, "done" | "failed" | "staticChecks" | "idle" | "capabilities" | "appStart" | "syncSchema" | "applySeeds" | "productionPreview" | "pullProduction" | "collectSchemaStats" | "setupRoles" | "installPgTap" | "buildAndPlaywright" | "initialComment" | "dbReset" | "runCoreTests" | "coreTestsFailed" | "coreTestsComplete" | "decidePath" | {
172
173
  setup: "local" | "resolving" | "prLocal" | "complete";
173
174
  } | {
174
175
  finalize: "writeSummary" | "complete" | "postComment";
176
+ } | {
177
+ postSeedPr: {
178
+ execution: "done" | "failed" | "staticChecks" | "capabilities" | "appStart" | "setupRoles" | "buildAndPlaywright" | "runCoreTests" | "coreTestsFailed" | "coreTestsComplete" | {
179
+ e2ePhase: {
180
+ intermediateComment: "done" | "checking" | "posting";
181
+ e2eTests: "done" | "running";
182
+ };
183
+ };
184
+ observability: "done" | "productionPreview" | "collectSchemaStats";
185
+ };
175
186
  } | {
176
187
  e2ePhase: {
177
188
  intermediateComment: "done" | "checking" | "posting";
@@ -257,6 +268,48 @@ export declare const ciMachine: import("xstate").StateMachine<CiContext, CiEvent
257
268
  readonly pullProduction: {};
258
269
  readonly syncSchema: {};
259
270
  readonly applySeeds: {};
271
+ readonly postSeedPr: {
272
+ states: {
273
+ readonly execution: {
274
+ states: {
275
+ readonly setupRoles: {};
276
+ readonly staticChecks: {};
277
+ readonly buildAndPlaywright: {};
278
+ readonly appStart: {};
279
+ readonly capabilities: {};
280
+ readonly runCoreTests: {};
281
+ readonly coreTestsComplete: {};
282
+ readonly coreTestsFailed: {};
283
+ readonly e2ePhase: {
284
+ states: {
285
+ readonly intermediateComment: {
286
+ states: {
287
+ readonly checking: {};
288
+ readonly posting: {};
289
+ readonly done: {};
290
+ };
291
+ };
292
+ readonly e2eTests: {
293
+ states: {
294
+ readonly running: {};
295
+ readonly done: {};
296
+ };
297
+ };
298
+ };
299
+ };
300
+ readonly failed: {};
301
+ readonly done: {};
302
+ };
303
+ };
304
+ readonly observability: {
305
+ states: {
306
+ readonly productionPreview: {};
307
+ readonly collectSchemaStats: {};
308
+ readonly done: {};
309
+ };
310
+ };
311
+ };
312
+ };
260
313
  readonly productionPreview: {};
261
314
  readonly collectSchemaStats: {};
262
315
  readonly decidePath: {};
@@ -73,6 +73,8 @@ export interface SchemaDriftSnapshot {
73
73
  beforeSql: string | null;
74
74
  /** SQL preview (may be truncated) from check-after */
75
75
  afterSql: string | null;
76
+ /** Whether a post-apply check was executed */
77
+ checkExecuted: boolean;
76
78
  /** True if check-after indicates remaining changes (drift) */
77
79
  hasDrift: boolean;
78
80
  /** Schema change statistics (parsed from beforeSql) */
@@ -15,5 +15,6 @@ export declare function runLogged(params: {
15
15
  args: string[];
16
16
  logFile: string;
17
17
  timeoutMs?: number;
18
+ reject?: boolean;
18
19
  }): ResultPromise;
19
20
  //# sourceMappingURL=execa-helpers.d.ts.map
@@ -0,0 +1,9 @@
1
+ import { type RunaDbEnv } from '../../utils/db-target.js';
2
+ export interface DbSyncCommandFailure {
3
+ code: string;
4
+ message: string;
5
+ suggestions: string[];
6
+ }
7
+ export declare function classifyDbSyncCommandFailure(error: unknown, environment: RunaDbEnv): DbSyncCommandFailure | null;
8
+ export declare function getDbSyncFallbackSuggestions(): string[];
9
+ //# sourceMappingURL=error-classifier.d.ts.map
@@ -7,11 +7,16 @@
7
7
  * - depsInstallActor: Check/install dependencies
8
8
  * - envCheckActor: Check environment variables
9
9
  * - supabaseStartActor: Start Supabase local
10
+ * - tablesManifestActor: Refresh tables.json from local Supabase
10
11
  * - processCheckActor: Check for existing processes and port availability
11
12
  * - appStartActor: Start Next.js dev server
12
13
  * - shutdownActor: Gracefully shut down dev server
13
14
  */
14
15
  export { depsInstallActor, envCheckActor, supabaseStartActor, } from '../../build/actors/setup.js';
16
+ export { manifestActor } from '../../build/actors/manifest.js';
17
+ export type { ManifestInput, ManifestOutput } from '../../build/actors/manifest.js';
18
+ export { tablesManifestActor } from './tables-manifest.js';
19
+ export type { TablesManifestInput, TablesManifestOutput } from './tables-manifest.js';
15
20
  export { processCheckActor } from './process-check.js';
16
21
  export type { ProcessCheckInput, ProcessCheckOutput } from './process-check.js';
17
22
  export { appStartActor, shutdownActor } from './app-lifecycle.js';
@@ -0,0 +1,16 @@
1
+ /**
2
+ * AI HINT: Tables Manifest Refresh Actor
3
+ *
4
+ * Purpose: Refresh .runa/manifests/tables.json from the local Supabase database
5
+ * Pattern: Lightweight introspection refresh for `runa dev`
6
+ */
7
+ export interface TablesManifestInput {
8
+ repoRoot: string;
9
+ }
10
+ export interface TablesManifestOutput {
11
+ passed: boolean;
12
+ durationMs: number;
13
+ error?: string;
14
+ }
15
+ export declare const tablesManifestActor: import("xstate").PromiseActorLogic<TablesManifestOutput, TablesManifestInput, import("xstate").EventObject>;
16
+ //# sourceMappingURL=tables-manifest.d.ts.map
@@ -22,8 +22,8 @@ export declare const DevInputSchema: z.ZodObject<{
22
22
  targetDir: z.ZodOptional<z.ZodString>;
23
23
  replace: z.ZodDefault<z.ZodBoolean>;
24
24
  bundler: z.ZodOptional<z.ZodEnum<{
25
- turbopack: "turbopack";
26
25
  webpack: "webpack";
26
+ turbopack: "turbopack";
27
27
  }>>;
28
28
  }, z.core.$strict>;
29
29
  export type DevInput = z.infer<typeof DevInputSchema>;
@@ -18,9 +18,33 @@ export declare function shouldSkipDb({ context }: GuardParams): boolean;
18
18
  * Skipped when --skip-app is specified.
19
19
  */
20
20
  export declare function shouldSkipApp({ context }: GuardParams): boolean;
21
+ /**
22
+ * Check if manifest generation should be skipped.
23
+ * Skipped when app startup is disabled or manifest generation is not applicable.
24
+ */
25
+ export declare function shouldSkipManifest({ context }: GuardParams): boolean;
26
+ /**
27
+ * Check if tables manifest refresh should be skipped.
28
+ * Skipped when app startup is disabled, DB setup is disabled, or Supabase is unavailable.
29
+ */
30
+ export declare function shouldSkipTablesManifest({ context }: GuardParams): boolean;
31
+ /**
32
+ * Check if an actor phase reported a failed result.
33
+ */
34
+ export declare function phaseFailed({ event, }: {
35
+ event: {
36
+ output?: {
37
+ passed?: boolean;
38
+ };
39
+ [key: string]: unknown;
40
+ };
41
+ }): boolean;
21
42
  export declare const guards: {
22
43
  shouldSkipDb: typeof shouldSkipDb;
23
44
  shouldSkipApp: typeof shouldSkipApp;
45
+ shouldSkipManifest: typeof shouldSkipManifest;
46
+ shouldSkipTablesManifest: typeof shouldSkipTablesManifest;
47
+ phaseFailed: typeof phaseFailed;
24
48
  };
25
49
  export {};
26
50
  //# sourceMappingURL=guards.d.ts.map
@@ -11,7 +11,7 @@
11
11
  *
12
12
  * State Flow:
13
13
  * idle → START → processCheck → setup{depsInstall → envCheck → supabaseStart}
14
- * → appStart → running → (STOP) → shutdown → done
14
+ * → tablesManifest → manifest → appStart → running → (STOP) → shutdown → done
15
15
  * Any error → failed
16
16
  *
17
17
  * E2E Test Mapping (CLI observable behavior):
@@ -38,8 +38,12 @@ export declare const devMachine: import("xstate").StateMachine<DevContext, {
38
38
  type: "error.platform";
39
39
  error: Error;
40
40
  }, {
41
- [x: string]: import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<import("../build/actors/setup.js").DepsInstallOutput, import("../build/actors/setup.js").SetupInput, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<import("../build/actors/setup.js").EnvCheckOutput, import("../build/actors/setup.js").SetupInput, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<import("../build/actors/setup.js").SupabaseStartOutput, import("../build/actors/setup.js").SetupInput, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<ProcessCheckOutput, import("./actors/process-check.js").ProcessCheckInput, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<import("./actors/app-lifecycle.js").AppStartOutput, import("./actors/app-lifecycle.js").AppStartInput, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<void, import("./actors/app-lifecycle.js").ShutdownInput, import("xstate").EventObject>> | undefined;
41
+ [x: string]: import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<import("./actors/index.js").ManifestOutput, import("./actors/index.js").ManifestInput, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<import("../build/actors/setup.js").DepsInstallOutput, import("../build/actors/setup.js").SetupInput, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<import("../build/actors/setup.js").EnvCheckOutput, import("../build/actors/setup.js").SetupInput, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<import("../build/actors/setup.js").SupabaseStartOutput, import("../build/actors/setup.js").SetupInput, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<ProcessCheckOutput, import("./actors/process-check.js").ProcessCheckInput, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<import("./actors/app-lifecycle.js").AppStartOutput, import("./actors/app-lifecycle.js").AppStartInput, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<void, import("./actors/app-lifecycle.js").ShutdownInput, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<import("./actors/tables-manifest.js").TablesManifestOutput, import("./actors/tables-manifest.js").TablesManifestInput, import("xstate").EventObject>> | undefined;
42
42
  }, {
43
+ src: "manifest";
44
+ logic: import("xstate").PromiseActorLogic<import("./actors/index.js").ManifestOutput, import("./actors/index.js").ManifestInput, import("xstate").EventObject>;
45
+ id: string | undefined;
46
+ } | {
43
47
  src: "depsInstall";
44
48
  logic: import("xstate").PromiseActorLogic<import("../build/actors/setup.js").DepsInstallOutput, import("../build/actors/setup.js").SetupInput, import("xstate").EventObject>;
45
49
  id: string | undefined;
@@ -63,13 +67,26 @@ export declare const devMachine: import("xstate").StateMachine<DevContext, {
63
67
  src: "shutdown";
64
68
  logic: import("xstate").PromiseActorLogic<void, import("./actors/app-lifecycle.js").ShutdownInput, import("xstate").EventObject>;
65
69
  id: string | undefined;
70
+ } | {
71
+ src: "tablesManifest";
72
+ logic: import("xstate").PromiseActorLogic<import("./actors/tables-manifest.js").TablesManifestOutput, import("./actors/tables-manifest.js").TablesManifestInput, import("xstate").EventObject>;
73
+ id: string | undefined;
66
74
  }, never, {
67
75
  type: "shouldSkipDb";
68
76
  params: unknown;
77
+ } | {
78
+ type: "shouldSkipManifest";
79
+ params: unknown;
69
80
  } | {
70
81
  type: "shouldSkipApp";
71
82
  params: unknown;
72
- }, never, "done" | "failed" | "running" | "idle" | "processCheck" | "appStart" | "shutdown" | {
83
+ } | {
84
+ type: "shouldSkipTablesManifest";
85
+ params: unknown;
86
+ } | {
87
+ type: "phaseFailed";
88
+ params: unknown;
89
+ }, never, "done" | "failed" | "manifest" | "running" | "idle" | "processCheck" | "appStart" | "shutdown" | "tablesManifest" | {
73
90
  setup: "done" | "depsInstall" | "envCheck" | "supabaseStart";
74
91
  }, string, DevMachineInput, {
75
92
  success: boolean;
@@ -90,6 +107,8 @@ export declare const devMachine: import("xstate").StateMachine<DevContext, {
90
107
  readonly done: {};
91
108
  };
92
109
  };
110
+ readonly tablesManifest: {};
111
+ readonly manifest: {};
93
112
  readonly appStart: {};
94
113
  readonly running: {};
95
114
  readonly shutdown: {};
@@ -20,6 +20,8 @@ export interface DevContext {
20
20
  tmpDir: string;
21
21
  /** Whether Supabase is configured */
22
22
  hasDatabase: boolean;
23
+ /** Whether manifest generation is applicable */
24
+ hasManifestTask: boolean;
23
25
  /** App process PID (when running) */
24
26
  appPid: number | null;
25
27
  /** Whether Supabase was started */
@@ -0,0 +1,9 @@
1
+ /**
2
+ * AI HINT: runa doctor
3
+ *
4
+ * Purpose: Deprecated alias for `runa check`
5
+ * Contract: JSON output must match `runa check`
6
+ */
7
+ import { Command } from 'commander';
8
+ export declare const doctorCommand: Command;
9
+ //# sourceMappingURL=doctor.d.ts.map
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Shared default file discovery patterns for manifest generation.
3
+ *
4
+ * These defaults intentionally cover both monorepo layouts and common single-app layouts.
5
+ * The processor still filters files later, so broader discovery is preferred over silent misses.
6
+ */
7
+ export declare const DEFAULT_INCLUDE_PATTERNS: readonly ["app/**/*.tsx", "app/**/*.ts", "pages/**/*.tsx", "pages/**/*.ts", "src/**/*.tsx", "src/**/*.ts", "components/**/*.tsx", "components/**/*.ts", "hooks/**/*.tsx", "hooks/**/*.ts", "lib/**/*.tsx", "lib/**/*.ts", "machines/**/*.tsx", "machines/**/*.ts", "features/**/*.tsx", "features/**/*.ts", "modules/**/*.tsx", "modules/**/*.ts", "domain/**/*.tsx", "domain/**/*.ts", "screens/**/*.tsx", "screens/**/*.ts", "views/**/*.tsx", "views/**/*.ts", "routes/**/*.tsx", "routes/**/*.ts", "api/**/*.tsx", "api/**/*.ts", "server/**/*.tsx", "server/**/*.ts", "apps/**/*.tsx", "apps/**/*.ts", "packages/**/*.tsx", "packages/**/*.ts"];
8
+ export declare const DEFAULT_EXCLUDE_PATTERNS: readonly ["**/node_modules/**", "**/.next/**", "**/dist/**", "**/*.test.*", "**/*.spec.*", "**/*.stories.*"];
9
+ //# sourceMappingURL=defaults.d.ts.map
@@ -9,6 +9,7 @@
9
9
  * - runa template-check --verbose # Show all files including identical
10
10
  * - runa template-check --diff # Show unified diff for differences
11
11
  * - runa template-check --category rules # Filter by category
12
+ * - runa template-check --path <file> # Restrict to specific paths
12
13
  * - runa template-check --json # Output as JSON (for CI)
13
14
  * - runa template-check --quiet # Only summary + actions (for pre-commit)
14
15
  */
@@ -17,6 +17,7 @@ export declare const SyncCheckInputSchema: z.ZodObject<{
17
17
  verbose: z.ZodDefault<z.ZodBoolean>;
18
18
  diff: z.ZodDefault<z.ZodBoolean>;
19
19
  category: z.ZodOptional<z.ZodString>;
20
+ paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
20
21
  json: z.ZodDefault<z.ZodBoolean>;
21
22
  targetDir: z.ZodOptional<z.ZodString>;
22
23
  quiet: z.ZodDefault<z.ZodBoolean>;
@@ -0,0 +1,20 @@
1
+ import type { CLILogger } from '@runa-ai/runa';
2
+ export type MachineStateLoggerArgOrder = 'logger-first' | 'context-first';
3
+ export type MachineStateLogger<TContext, TExtra = undefined, TOrder extends MachineStateLoggerArgOrder = 'logger-first'> = TOrder extends 'context-first' ? (context: TContext, logger: CLILogger, extra?: TExtra) => void : (logger: CLILogger, context: TContext, extra?: TExtra) => void;
4
+ type MachineStateChangeLoggerOptionsBase<TSnapshot, TContext, TExtra = undefined, TOrder extends MachineStateLoggerArgOrder = 'logger-first'> = {
5
+ getState: (snapshot: TSnapshot) => string;
6
+ getContext: (snapshot: TSnapshot) => TContext;
7
+ handlers: Record<string, MachineStateLogger<TContext, TExtra, TOrder>>;
8
+ useParentState?: boolean;
9
+ shouldSkipState?: (state: string, prevState: string, context: TContext, extra: TExtra | undefined) => boolean;
10
+ onUnknownState?: (state: string, logger: CLILogger, context: TContext, extra: TExtra | undefined, prevState: string) => void;
11
+ handlerArgumentOrder?: MachineStateLoggerArgOrder;
12
+ };
13
+ export type MachineStateChangeLoggerOptions<TSnapshot, TContext, TExtra = undefined, TOrder extends MachineStateLoggerArgOrder = 'logger-first'> = MachineStateChangeLoggerOptionsBase<TSnapshot, TContext, TExtra, TOrder> & (TOrder extends 'context-first' ? {
14
+ handlerArgumentOrder: 'context-first';
15
+ } : {
16
+ handlerArgumentOrder?: 'logger-first';
17
+ });
18
+ export declare function createMachineStateChangeLogger<TSnapshot, TContext, TExtra = undefined, TOrder extends MachineStateLoggerArgOrder = 'logger-first'>(options: MachineStateChangeLoggerOptions<TSnapshot, TContext, TExtra, TOrder>): (snapshot: TSnapshot, prevState: string, logger: CLILogger, extra?: TExtra) => void;
19
+ export {};
20
+ //# sourceMappingURL=machine-state-logging.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare function findRepoRoot(startDir: string): string;
2
+ //# sourceMappingURL=repo-root.d.ts.map
@@ -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.71";
23
+ export declare const COMPATIBLE_TEMPLATES_VERSION = "0.7.1";
24
24
  /**
25
25
  * Templates package name on GitHub Packages.
26
26
  * Published to npm.pkg.github.com (requires NODE_AUTH_TOKEN).