/** * Code Review Mode - AI-powered code review */ import { ProjectContext } from './project'; export interface ReviewIssue { file: string; line?: number; severity: 'error' | 'warning' | 'info' | 'suggestion'; category: ReviewCategory; message: string; suggestion?: string; } export type ReviewCategory = 'security' | 'performance' | 'maintainability' | 'bug' | 'style' | 'types' | 'best-practice' | 'documentation'; export interface ReviewResult { files: string[]; issues: ReviewIssue[]; summary: ReviewSummary; score: number; /** * Human-readable description of what was actually scanned. Users often assume * `/review` analyzes the entire codebase — spell out whether it was specific * files, git changes, or a fallback `src/` scan so the scope is obvious. */ scope: string; } export interface ReviewSummary { totalIssues: number; byCategory: Record; bySeverity: Record; } /** * A single deterministic review rule. Built-in rules and user rules from * `.codeep/review.json` share this shape. `id` is stable so a project can * disable a built-in rule by id (see utils/reviewConfig.ts). */ export interface RuleDef { id: string; pattern: RegExp; category: ReviewCategory; severity: ReviewIssue['severity']; message: string; suggestion?: string; extensions?: string[]; } /** * Perform code review */ export declare function performCodeReview(projectContext: ProjectContext, specificFiles?: string[]): ReviewResult; /** * Format review result for display */ export declare function formatReviewResult(result: ReviewResult): string; /** * Get review prompt for AI-enhanced review */ export declare function getReviewSystemPrompt(result: ReviewResult): string; export interface BuiltinRuleInfo { id: string; category: ReviewCategory; severity: ReviewIssue['severity']; description: string; } /** * Built-in rule metadata (id + what each flags) — the ids that * `.codeep/review.{json,yml}` "disable" accepts. Includes the two line-count * heuristics (long-file / long-function) that live outside CODE_PATTERNS. */ export declare function listBuiltinRules(): BuiltinRuleInfo[]; /** * Append an advisory "AI second opinion" section to a markdown review report. * Advisory only — it never changes the score or the exit code; the deterministic * review remains authoritative. */ export declare function appendAiSection(markdown: string, aiText: string | null, meta?: { provider?: string; model?: string; }): string;