import type { Marker } from '../types.js'; export interface Checkpoint { id: string; timestamp: string; commitHash: string; branchName: string; markers: MarkerSummary[]; pageUrl: string; pageTitle: string; agentName: string; status: 'pending' | 'applied' | 'reverted'; filesModified: number; linesChanged: number; } /** * Canonical definition of MarkerSummary. * Keep in sync with: client/src/types/index.ts (MarkerSummary) */ export interface MarkerSummary { id: string; identifier: string; notes: string; } export interface FileChange { checkpointId: string; filePath: string; changeType: 'created' | 'modified' | 'deleted'; linesAdded: number; linesRemoved: number; } export interface ChangeHistory { projectDir: string; checkpoints: Checkpoint[]; currentCheckpointId: string | null; } /** * Canonical definition of CheckpointInfo. * Keep in sync with: client/src/types/index.ts (CheckpointInfo) */ export interface CheckpointInfo { id: string; timestamp: string; markers: MarkerSummary[]; filesModified: number; linesChanged: number; agentName: string; pageUrl: string; status: 'pending' | 'applied' | 'reverted'; canUndo: boolean; } export declare class GitManager { private projectDir; private historyFile; private zingitDir; constructor(projectDir: string); /** * Initialize ZingIt tracking in the project */ initialize(): Promise; /** * Check if git repo exists and get status */ checkGitStatus(): Promise<{ isRepo: boolean; isClean: boolean; branch: string; error?: string; }>; /** * Create a checkpoint before AI modifications */ createCheckpoint(metadata: { markers: Marker[]; pageUrl: string; pageTitle: string; agentName: string; }): Promise; /** * Finalize checkpoint after AI modifications complete */ finalizeCheckpoint(checkpointId: string): Promise; /** * Undo the most recent checkpoint */ undoLastCheckpoint(): Promise<{ checkpointId: string; filesReverted: string[]; }>; /** * Revert to a specific checkpoint */ revertToCheckpoint(checkpointId: string): Promise<{ filesReverted: string[]; }>; /** * Get change history formatted for client */ getHistory(): Promise; /** * Clear all history (dangerous operation) */ clearHistory(): Promise; private loadHistory; private saveHistory; } /** * Custom error class for GitManager errors */ export declare class GitManagerError extends Error { readonly code: 'NOT_GIT_REPO' | 'DIRTY_WORKING_TREE' | 'CHECKPOINT_NOT_FOUND' | 'NO_CHANGES_TO_UNDO' | 'INVALID_CHECKPOINT_STATE'; constructor(message: string, code: 'NOT_GIT_REPO' | 'DIRTY_WORKING_TREE' | 'CHECKPOINT_NOT_FOUND' | 'NO_CHANGES_TO_UNDO' | 'INVALID_CHECKPOINT_STATE'); }