/** * Database maintenance commands * * Commands: * - lex db vacuum: Optimize database * - lex db backup [--rotate N]: Create timestamped backup with rotation * - lex db encrypt: Encrypt existing database with SQLCipher */ export interface DbVacuumOptions { json?: boolean; } export interface DbBackupOptions { rotate?: number; json?: boolean; } export interface DbEncryptOptions { input?: string; output?: string; verify?: boolean; json?: boolean; /** * Create a timestamped backup of the input database before encryption. * Defaults to true for safety. Use --no-backup to disable. */ backup?: boolean; /** * Number of rows to insert per batch/transaction. Reduces memory usage * for large migrations. Defaults to processing all rows in one transaction. */ batchSize?: number; /** * Dry-run mode: estimate migration time and row counts without writing. */ dryRun?: boolean; /** * Show progress indicator during migration. */ progress?: boolean; } export interface DbStatsOptions { json?: boolean; detailed?: boolean; } /** * Vacuum (optimize) the database */ export declare function dbVacuum(options?: DbVacuumOptions): Promise; /** * Backup the database with optional rotation */ export declare function dbBackup(options?: DbBackupOptions): Promise; /** * Encrypt an existing database with SQLCipher * * Migrates an unencrypted database to an encrypted one, with data integrity verification. * * Security features: * - Creates a timestamped backup before encryption (unless --no-backup) * - Uses atomic file creation via temp+rename pattern to prevent TOCTOU race conditions * * Performance features: * - Optional batch size for memory-efficient large migrations (--batch-size N) * - Progress indicator showing rows processed and ETA (--progress) * - Dry-run mode to estimate migration without writing (--dry-run) */ export declare function dbEncrypt(options?: DbEncryptOptions): Promise; /** * Receipt CLI command options */ export interface ReceiptCreateOptions { action: string; rationale: string; confidence: "high" | "medium" | "low" | "uncertain"; reversibility: "reversible" | "partially-reversible" | "irreversible"; outcome?: "success" | "failure" | "partial" | "deferred"; rollbackPath?: string; output?: string; json?: boolean; } export interface ReceiptValidateOptions { input: string; json?: boolean; } /** * Create a receipt and optionally save to file */ export declare function receiptCreate(options: ReceiptCreateOptions): Promise; /** * Validate a receipt from file */ export declare function receiptValidate(options: ReceiptValidateOptions): Promise; /** * Show database statistics */ export declare function dbStats(options?: DbStatsOptions): Promise;