/** * PR Review Handler * * Runs local AI code review on the current branch diff before creating a PR. * Uses Claude/Codex to analyze changes and categorize issues by severity. * * Uses IGitClient and IClaudeCliClient interfaces — no direct child_process dependency. * * @see .dev/features/github-pr.md for full specification */ import type { IGitClient } from '../../../domain/interfaces/IGitClient'; import type { IClaudeCliClient } from '../../../domain/interfaces/IClaudeCliClient'; /** * Options for PR review. */ export interface IPrReviewOptions { /** Base branch to diff against (default: main or master). */ readonly base?: string; /** Exit non-zero if critical issues found. */ readonly block?: boolean; /** Output as JSON. */ readonly json?: boolean; } /** * A single review issue found in the code. */ export interface IReviewIssue { /** Severity level. */ readonly severity: 'critical' | 'warning' | 'suggestion'; /** File path where the issue was found. */ readonly file: string; /** Line number (if available). */ readonly line?: number; /** Description of the issue. */ readonly message: string; /** Code snippet (if available). */ readonly snippet?: string; } /** * Result from PR review. */ export interface IPrReviewResult { readonly success: boolean; readonly message: string; /** Base branch used for diff. */ readonly base: string; /** Number of files changed. */ readonly filesChanged: number; /** List of changed files. */ readonly files: readonly string[]; /** Issues found during review. */ readonly issues: readonly IReviewIssue[]; /** Summary counts by severity. */ readonly counts: { readonly critical: number; readonly warning: number; readonly suggestion: number; }; /** Passed checks (things that look good). */ readonly passed: readonly string[]; /** Whether review should block (has critical issues and --block flag). */ readonly shouldBlock: boolean; /** Error message if AI review failed. */ readonly reviewError?: string; } /** * Handler for running local AI code review. */ export declare class PrReviewHandler { private readonly git; private readonly claude; constructor(git: IGitClient, claude: IClaudeCliClient); /** * Run AI review on the current branch diff. */ execute(options?: IPrReviewOptions): Promise; /** * Get diff between base and HEAD. */ private getDiff; /** * Get list of changed files. */ private getChangedFiles; /** * Run AI review using Claude CLI (claude command). */ private runAiReview; /** * Create the review prompt for the AI. */ private createReviewPrompt; /** * Parse AI response into structured format. */ private parseAiResponse; /** * Fallback review using simple heuristics when AI is not available. */ private fallbackReview; } //# sourceMappingURL=PrReviewHandler.d.ts.map