/** * Local-to-Supabase Migration * * Migrates existing free-tier local .gitmem/ data to Supabase when * a user upgrades to Pro. Called during `activate` after schema is * verified and credentials are saved. * * Collections migrated: * - learnings (scars, wins, patterns, anti-patterns) * - sessions * - decisions * - scar_usage * * Threads are NOT migrated — they remain local (thread lifecycle is * tied to .gitmem/threads.json and managed by session_start). * * Migration is idempotent: uses Supabase upsert (merge-duplicates) * so re-running is safe. Existing Supabase records with same ID are * updated, not duplicated. */ export interface MigrationResult { migrated: Record; skipped: Record; errors: Record; total: number; hasLocalData: boolean; } /** * Check if there is local data worth migrating */ export declare function hasLocalData(gitmemDir?: string): boolean; /** * Migrate local .gitmem data to Supabase * * @param supabaseUrl - User's Supabase project URL * @param supabaseKey - User's service role key * @param tablePrefix - Table prefix (default: "gitmem_") * @param gitmemDir - Override .gitmem directory path * @param onProgress - Callback for progress reporting */ export declare function migrateLocalToSupabase(opts: { supabaseUrl: string; supabaseKey: string; tablePrefix?: string; gitmemDir?: string; onProgress?: (msg: string) => void; }): Promise; /** * Check if there are .pre-migration backup files that can be re-imported. * This handles the case where a previous migration partially failed — * the user runs `activate` again and we pick up from the backups. */ export declare function hasPreMigrationData(gitmemDir?: string): boolean; /** * Re-import from .pre-migration backup files. * Same as migrateLocalToSupabase but reads from *.json.pre-migration files. * Idempotent: uses upsert (merge-duplicates) so re-running is safe. */ export declare function reimportFromBackups(opts: { supabaseUrl: string; supabaseKey: string; tablePrefix?: string; gitmemDir?: string; onProgress?: (msg: string) => void; }): Promise; /** * Rename local collection files after successful migration * Adds .pre-migration suffix so data isn't lost but won't be re-read by free tier */ export declare function archiveLocalData(gitmemDir?: string): string[]; //# sourceMappingURL=migrate-local.d.ts.map