import { type FixPlan } from './reviewFix.js'; import { ReviewResult } from './codeReview.js'; import { ProjectContext } from './project.js'; export type FailOn = 'error' | 'warning' | 'info' | 'none'; export interface ReviewArgs { files: string[]; json: boolean; failOn: FailOn; rules: boolean; ai: boolean; help: boolean; /** Hand the findings to an agent and let it edit the working tree. */ fix: boolean; /** Lowest severity the fix run may act on. Suggestions are never eligible. */ fixMinSeverity: 'error' | 'warning'; } export declare const REVIEW_HELP = "Usage: codeep review [options] [files...]\n\nRun a deterministic, offline code review (no API key required). With no files,\nreviews your unstaged git changes, falling back to a src/ scan when the tree is\nclean. Pass files (or let your CI pass the PR's changed files) to scope it.\n\nCustom/disabled rules come from .codeep/review.yml (or .json) in the repo.\n\nOptions:\n --json Print the result as JSON instead of the markdown report\n --fail-on Exit non-zero when an issue at or above is found:\n error | warning | info | none (default: error)\n --fix After the review, let an agent fix what it found. Edits the\n working tree and stops there \u2014 it never commits, branches\n or pushes. Runs under a files+tests boundary: no shell, no\n network, no git. Needs an API key.\n --fix-min-severity Lowest severity --fix may act on: error | warning\n (default: warning). Suggestions are never eligible.\n --rules List the built-in rule ids (for \"disable\" in .codeep/review.*) and exit\n --ai After the offline pass, ask your configured provider for a\n contextual second opinion on the working-tree diff\n (advisory; needs an API key; never affects the exit code)\n -h, --help Show this help\n\nExit code: 0 when nothing at/above --fail-on is found, 1 otherwise."; /** Parse `codeep review` argv (everything after the subcommand). Pure. */ export declare function parseReviewArgs(argv: string[]): ReviewArgs; /** Exit code for a result under a fail-on threshold. Pure. */ export declare function exitCodeForResult(result: ReviewResult, failOn: FailOn): number; /** Render the built-in rule ids for `--rules`. Pure. */ export declare function formatBuiltinRules(): string; export interface ReviewDeps { /** Run the review over optional specific files. */ review: (files?: string[]) => ReviewResult; /** Sink for the report (one call). */ write: (text: string) => void; /** List of built-in rule ids (for --rules). */ listRules: () => string; /** Optional AI second opinion; returns null when unavailable (no key / error). */ aiReview: (result: ReviewResult) => Promise; /** Provider/model label for the AI section header. */ aiMeta: () => { provider?: string; model?: string; }; /** Run an agent over a fix plan. Returns a human summary, or null when it * could not run at all (no API key, provider unreachable). */ applyFixes: (plan: FixPlan) => Promise; } /** * Orchestrate a headless review and return the process exit code. Side effects * (filesystem, stdout, provider call) live behind `deps` so the flow is * unit-testable. The exit code is ALWAYS deterministic — `--ai` is advisory. */ export declare function runHeadlessReview(argv: string[], deps?: ReviewDeps): Promise; /** * Run a fix plan through the agent. * * The plan's personality is passed as the active one, so the same enforcement * any custom bot gets applies here: the model is offered `files` and `tests` * and nothing else. It edits the working tree and stops — branching, committing * and opening a pull request belong to whatever called this, which in CI is the * action that holds the token. */ export declare function runFixPlan(plan: FixPlan, context: ProjectContext): Promise;