feat(worktree): enhance worktree management and git diff functionality

- Integrated git worktree isolation for feature execution, allowing agents to work in isolated branches.
- Added GitDiffPanel component to visualize changes in both worktree and main project contexts.
- Updated AutoModeService and IPC handlers to support worktree settings.
- Implemented Git API for non-worktree operations, enabling file diff retrieval for the main project.
- Enhanced UI components to reflect worktree settings and improve user experience.

These changes provide a more robust and flexible environment for feature development and testing.
This commit is contained in:
Kacper
2025-12-10 13:41:52 +01:00
parent 02b3275460
commit 7ab2aaaa23
13 changed files with 1190 additions and 3939 deletions

View File

@@ -229,7 +229,7 @@ export interface AutoModeAPI {
error?: string;
}>;
runFeature: (projectPath: string, featureId: string) => Promise<{
runFeature: (projectPath: string, featureId: string, useWorktrees?: boolean) => Promise<{
success: boolean;
passes?: boolean;
error?: string;
@@ -386,6 +386,9 @@ export interface ElectronAPI {
// Worktree Management APIs
worktree: WorktreeAPI;
// Git Operations APIs (for non-worktree operations)
git: GitAPI;
}
export interface WorktreeInfo {
@@ -470,6 +473,14 @@ export interface WorktreeAPI {
getFileDiff: (projectPath: string, featureId: string, filePath: string) => Promise<FileDiffResult>;
}
export interface GitAPI {
// Get diffs for the main project (not a worktree)
getDiffs: (projectPath: string) => Promise<FileDiffsResult>;
// Get diff for a specific file in the main project
getFileDiff: (projectPath: string, filePath: string) => Promise<FileDiffResult>;
}
// Model definition type
export interface ModelDefinition {
id: string;