feat(core): implement git worktree checkpoint system

Add comprehensive worktree management system to enable task isolation and rollback capabilities. This allows users to revert agent changes if they don't satisfy requirements or break functionality.

Key components:
- New WorktreeManager service for branch and worktree operations
- GitDiffPanel component for visualizing changes
- Enhanced UI components with worktree integration
- Auto-mode service enhancements for worktree workflow

Modified files: worktree-manager.js, git-diff-panel.tsx, main.js, preload.js, feature-loader.js, agent-output-modal.tsx, board-view.tsx, kanban-card.tsx, electron.ts, app-store.ts, electron.d.ts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
This commit is contained in:
Kacper
2025-12-10 12:28:13 +01:00
parent 364adeb151
commit a78b6763de
14 changed files with 2127 additions and 334 deletions

View File

@@ -383,6 +383,91 @@ export interface ElectronAPI {
message?: string;
error?: string;
}>;
// Worktree Management APIs
worktree: WorktreeAPI;
}
export interface WorktreeInfo {
worktreePath: string;
branchName: string;
head?: string;
baseBranch?: string;
}
export interface WorktreeStatus {
success: boolean;
modifiedFiles?: number;
files?: string[];
diffStat?: string;
recentCommits?: string[];
error?: string;
}
export interface FileStatus {
status: string;
path: string;
statusText: string;
}
export interface FileDiffsResult {
success: boolean;
diff?: string;
files?: FileStatus[];
hasChanges?: boolean;
error?: string;
}
export interface FileDiffResult {
success: boolean;
diff?: string;
filePath?: string;
error?: string;
}
export interface WorktreeAPI {
// Revert feature changes by removing the worktree
revertFeature: (projectPath: string, featureId: string) => Promise<{
success: boolean;
removedPath?: string;
error?: string;
}>;
// Merge feature worktree changes back to main branch
mergeFeature: (projectPath: string, featureId: string, options?: {
squash?: boolean;
commitMessage?: string;
squashMessage?: string;
}) => Promise<{
success: boolean;
mergedBranch?: string;
error?: string;
}>;
// Get worktree info for a feature
getInfo: (projectPath: string, featureId: string) => Promise<{
success: boolean;
worktreePath?: string;
branchName?: string;
head?: string;
error?: string;
}>;
// Get worktree status (changed files, commits)
getStatus: (projectPath: string, featureId: string) => Promise<WorktreeStatus>;
// List all feature worktrees
list: (projectPath: string) => Promise<{
success: boolean;
worktrees?: WorktreeInfo[];
error?: string;
}>;
// Get file diffs for a feature worktree
getDiffs: (projectPath: string, featureId: string) => Promise<FileDiffsResult>;
// Get diff for a specific file in a worktree
getFileDiff: (projectPath: string, featureId: string, filePath: string) => Promise<FileDiffResult>;
}
// Model definition type