import { Archive } from './archive'; /** * How portable a provider's session traces are across a folder/machine move: * - `full` — the conversation can be restored and resumed elsewhere. * - `partial` — some artifacts travel, but resume is best-effort/unverified. * - `none` — nothing resumable on disk (in-memory only or no store). */ export type Portability = 'full' | 'partial' | 'none'; export interface CollectResult { /** Session IDs discovered for this workspace (informational). */ discoveredIds: string[]; /** True if real conversation traces were written into the archive. */ tracesCaptured: boolean; } /** * Strategy for backing up and restoring one provider family's session traces. * Adding a provider is a new implementation — export/import never change * (Open/Closed). Each strategy is honest about its {@link Portability}. */ export interface SessionBackupProvider { /** Stable id — also the archive sub-folder and manifest key. */ readonly id: string; /** `session-state.json` keys this strategy owns. */ readonly sessionStateKeys: readonly string[]; /** Portability classification (drives honest manifest + UI messaging). */ readonly portability: Portability; /** Human-readable explanation of what is/isn't captured. */ readonly note: string; /** Capture this provider's sessions into the archive. */ collect(root: string, archive: Archive): Promise; /** Restore this provider's sessions for the destination workspace. Returns files written. */ restore(destRoot: string, archive: Archive): Promise; } /** * A path segment safe to `path.join()` onto a state directory: non-empty, not a * traversal token, and containing no separators or null bytes. Rejects the * zip-slip vector where a crafted archive entry (`copilot-cli/../evil/x`) yields * a `..` segment that would escape the destination directory. */ export declare function isSafeChildSegment(name: string): boolean; /** All registered session-backup strategies (covers every ProviderId). */ export declare const SESSION_BACKUP_PROVIDERS: readonly SessionBackupProvider[];