import { MigrationDefinition } from '@voltro/database'; import { SeedDefinition } from '@voltro/database'; declare interface DiscoveredMigration { readonly file: string; readonly definition: MigrationDefinition; /** Sha256 (truncated) of the source file. Stored on the migration row so * drift between a committed migration file and the deployed one is detectable. */ readonly hash: string; } declare interface DiscoveredSeed { readonly file: string; readonly definition: SeedDefinition; readonly fingerprint: string; } declare class FrameworkInspectState { #private; registerMigration(m: DiscoveredMigration): void; recordMigrationStatus(rows: ReadonlyArray): void; recordMigrationResult(result: MigrationResult): void; registerSeed(s: DiscoveredSeed): void; recordSeedResult(result: SeedRunResult): void; recordReplication(snapshot: ReplicationSnapshot): void; replicationSnapshot(): ReplicationSnapshot | undefined; migrationsSnapshot(): ReadonlyArray; seedsSnapshot(): ReadonlyArray; onChange(listener: () => void): () => void; } /** Process-global state — one runtime, one set of migrations + seeds. */ export declare const frameworkInspectState: FrameworkInspectState; declare interface MigrationResult { readonly migrationId: string; readonly status: 'applied' | 'failed' | 'skipped'; readonly durationMs: number; readonly steps: ReadonlyArray; readonly error?: { stepName: string; message: string; stack?: string; }; } export declare interface MigrationSnapshot { readonly id: string; readonly name: string; readonly hash: string; readonly status: 'pending' | 'applied' | 'failed' | 'reverted'; readonly appliedAt?: string; readonly durationMs?: number; readonly stepCount: number; readonly lastError?: { stepName: string; message: string; }; } declare interface MigrationStatus { readonly id: string; readonly name: string; readonly status: 'pending' | 'applied' | 'failed' | 'reverted'; readonly appliedAt: Date | null; readonly hashMatches: boolean; } declare interface MigrationStepResult { readonly stepName: string; readonly status: 'applied' | 'failed'; readonly durationMs: number; readonly error?: { message: string; stack?: string; }; } export declare interface ReplicationSnapshot { readonly replicaCount: number; readonly rywPolicy: 'off' | 'fallback' | 'wait'; readonly rywStore: 'memory' | 'redis'; readonly region: string | null; readonly localityEnabled: boolean; } declare interface SeedRunResult { readonly seedId: string; /** `'skipped'` means the fingerprint matched a previous SUCCESS — the seed is * applied, it just did not need to run. Reporting it (rather than omitting * the seed from the results) is what stops the dashboards showing an applied * seed as never-run. */ readonly status: 'succeeded' | 'failed' | 'skipped'; readonly durationMs: number; readonly rowsTouched: number; readonly error?: { message: string; stack?: string; stepName?: string; }; } export declare interface SeedSnapshot { readonly id: string; readonly name: string; readonly lifecycle: string; readonly fingerprint: string; readonly cron?: string; readonly watchedTables?: ReadonlyArray; readonly lastRunStatus?: 'succeeded' | 'failed' | 'skipped'; readonly lastRunAt?: string; readonly lastRunDurationMs?: number; readonly lastRunRowsTouched?: number; readonly lastError?: { message: string; stepName?: string; }; } export { } declare module '@voltro/protocol' { interface VoltroTableNames { 'tasks': true; 'task_sub_tasks': true; '_voltro_workflow_runs': true; '_voltro_workflow_run_steps': true; '_voltro_workflow_run_events': true; '_voltro_workflow_events': true; '_voltro_workflow_event_deliveries': true; '_voltro_approvals': true; '_voltro_connections': true; '_voltro_undo_log': true; } } declare module '@voltro/protocol' { interface VoltroTableNames { 'invoices': true; 'invoice_lines': true; } }