mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 08:13:37 +00:00
feat: Implement GitHub issue validation endpoint and UI integration
- Added a new endpoint for validating GitHub issues using the Claude SDK. - Introduced validation schema and logic to handle issue validation requests. - Updated GitHub routes to include the new validation route. - Enhanced the UI with a validation dialog and button to trigger issue validation. - Mapped issue complexity to feature priority for better task management. - Integrated validation results display in the UI, allowing users to convert validated issues into tasks.
This commit is contained in:
@@ -1,8 +1,26 @@
|
||||
// Type definitions for Electron IPC API
|
||||
import type { SessionListItem, Message } from '@/types/electron';
|
||||
import type { ClaudeUsageResponse } from '@/store/app-store';
|
||||
import type {
|
||||
IssueValidationVerdict,
|
||||
IssueValidationConfidence,
|
||||
IssueComplexity,
|
||||
IssueValidationInput,
|
||||
IssueValidationResult,
|
||||
IssueValidationResponse,
|
||||
} from '@automaker/types';
|
||||
import { getJSON, setJSON, removeItem } from './storage';
|
||||
|
||||
// Re-export issue validation types for use in components
|
||||
export type {
|
||||
IssueValidationVerdict,
|
||||
IssueValidationConfidence,
|
||||
IssueComplexity,
|
||||
IssueValidationInput,
|
||||
IssueValidationResult,
|
||||
IssueValidationResponse,
|
||||
};
|
||||
|
||||
export interface FileEntry {
|
||||
name: string;
|
||||
isDirectory: boolean;
|
||||
@@ -156,6 +174,10 @@ export interface GitHubAPI {
|
||||
mergedPRs?: GitHubPR[];
|
||||
error?: string;
|
||||
}>;
|
||||
validateIssue: (
|
||||
projectPath: string,
|
||||
issue: IssueValidationInput
|
||||
) => Promise<IssueValidationResponse | { success: false; error: string }>;
|
||||
}
|
||||
|
||||
// Feature Suggestions types
|
||||
@@ -2631,6 +2653,22 @@ function createMockGitHubAPI(): GitHubAPI {
|
||||
mergedPRs: [],
|
||||
};
|
||||
},
|
||||
validateIssue: async (projectPath: string, issue: IssueValidationInput) => {
|
||||
console.log('[Mock] Validating GitHub issue:', { projectPath, issue });
|
||||
// Return a mock validation result
|
||||
return {
|
||||
success: true as const,
|
||||
issueNumber: issue.issueNumber,
|
||||
validation: {
|
||||
verdict: 'valid' as const,
|
||||
confidence: 'medium' as const,
|
||||
reasoning:
|
||||
'This is a mock validation. In production, Claude SDK would analyze the codebase to validate this issue.',
|
||||
relatedFiles: ['src/components/example.tsx'],
|
||||
estimatedComplexity: 'moderate' as const,
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import type {
|
||||
GitHubAPI,
|
||||
GitHubIssue,
|
||||
GitHubPR,
|
||||
IssueValidationInput,
|
||||
} from './electron';
|
||||
import type { Message, SessionListItem } from '@/types/electron';
|
||||
import type { Feature, ClaudeUsageResponse } from '@/store/app-store';
|
||||
@@ -751,6 +752,8 @@ export class HttpApiClient implements ElectronAPI {
|
||||
checkRemote: (projectPath: string) => this.post('/api/github/check-remote', { projectPath }),
|
||||
listIssues: (projectPath: string) => this.post('/api/github/issues', { projectPath }),
|
||||
listPRs: (projectPath: string) => this.post('/api/github/prs', { projectPath }),
|
||||
validateIssue: (projectPath: string, issue: IssueValidationInput) =>
|
||||
this.post('/api/github/validate-issue', { projectPath, ...issue }),
|
||||
};
|
||||
|
||||
// Workspace API
|
||||
|
||||
Reference in New Issue
Block a user