/** * Transfer Claude Code sessions between computers. * * Export: Packs raw session files (.jsonl + sessions-index.json + subagent dirs) * into a portable tar.gz archive with relative paths and a manifest. * * Import: Unpacks the archive, re-resolves paths for the local machine, * and optionally triggers re-ingestion into the sessions DB. */ export interface TransferManifest { version: number; createdAt: string; sourceComputer: string; sourceUser: string; sourceClaudePath: string; projects: TransferProject[]; totalFiles: number; totalSize: number; } export interface TransferProject { /** Original filesystem path (e.g., /Users/alice/Workspace/foo) */ originalPath: string; /** Encoded directory name (e.g., -Users-alice-Workspace-foo) */ encodedDir: string; /** Number of session files in this project */ sessionCount: number; /** Number of .jsonl files */ jsonlCount: number; } export interface ExportOptions { /** Only export sessions for this project path (default: all) */ projectPath?: string; /** Output directory for the export (default: cwd) */ outputDir?: string; /** Custom archive name (default: sessions-export-YYYY-MM-DD.tar.gz) */ outputName?: string; /** Print detailed progress */ verbose?: boolean; /** Dry run - show what would be exported */ dryRun?: boolean; } export interface ExportResult { archivePath: string; manifest: TransferManifest; errors: Array<{ file: string; error: string; }>; } export interface ImportOptions { /** Remap the home directory (e.g., /Users/alice -> /Users/bob) */ remapHome?: string; /** Remap arbitrary path prefix (e.g., /old/path → /new/path) */ remapPath?: { from: string; to: string; }; /** Also re-ingest imported sessions into the DB */ reingest?: boolean; /** Print detailed progress */ verbose?: boolean; /** Dry run - show what would be imported */ dryRun?: boolean; /** Overwrite existing sessions */ overwrite?: boolean; } export interface ImportResult { projectsImported: number; filesImported: number; filesSkipped: number; pathsRemapped: number; errors: Array<{ file: string; error: string; }>; } /** * Export sessions to a staging directory that can be tar'd. * Returns the path to the staging directory and manifest. */ export declare function exportSessions(options?: ExportOptions): ExportResult; /** * Import sessions from an export directory. */ export declare function importSessions(importPath: string, options?: ImportOptions): ImportResult; /** * Format bytes into human-readable string. */ export declare function formatBytes(bytes: number): string; //# sourceMappingURL=transfer.d.ts.map