/**
 * Run Code Review Use Case
 *
 * Orchestrates the full code review lifecycle:
 *   1. Parse PR identifier (number or URL)
 *   2. Fetch PR metadata and diff (local git or GitHub API)
 *   3. Annotate diff with line numbers
 *   4. Build reviewer prompt with XML boundary tags
 *   5. Invoke IStructuredAgentCaller for structured review output
 *   6. Parse and validate comments against diff ranges
 *   7. Persist CodeReview entity with status tracking
 *
 * Status transitions: Pending → InProgress → Completed | Failed
 */
import type { CodeReview } from '../../../domain/generated/output.js';
import type { ICodeReviewRepository } from '../../ports/output/repositories/code-review-repository.interface.js';
import type { IPlatformReviewService } from '../../ports/output/services/platform-review-service.interface.js';
import type { IStructuredAgentCaller } from '../../ports/output/agents/structured-agent-caller.interface.js';
import type { IGitPrService, FileDiff } from '../../ports/output/services/git-pr-service.interface.js';
import type { ReviewOutputComment } from './types.js';
export interface RunCodeReviewInput {
    /** PR number, PR URL (https://github.com/owner/repo/pull/42) */
    target: string;
    /** Repository owner (required when target is a plain PR number) */
    owner?: string;
    /** Repository name (required when target is a plain PR number) */
    repo?: string;
    /** Repository path for local git diff; if omitted, falls back to GitHub API */
    repositoryPath?: string;
    /** Optional feature ID to link the review to */
    featureId?: string;
}
export interface RunCodeReviewResult {
    ok: true;
    review: CodeReview;
}
export interface RunCodeReviewError {
    ok: false;
    error: string;
}
export type RunCodeReviewOutput = RunCodeReviewResult | RunCodeReviewError;
interface ParsedPrTarget {
    owner: string;
    repo: string;
    prNumber: number;
}
/**
 * Parse a GitHub PR URL into owner, repo, and PR number.
 * Supports: https://github.com/owner/repo/pull/42
 */
export declare function parsePrUrl(url: string): ParsedPrTarget | null;
/**
 * Build a set of valid line numbers per file per side from parsed diffs.
 */
export declare function buildValidLineMap(diffs: FileDiff[]): Map<string, {
    left: Set<number>;
    right: Set<number>;
}>;
/**
 * Validate a comment's line against the diff valid-line map.
 */
export declare function isCommentInDiffRange(comment: ReviewOutputComment, validLines: Map<string, {
    left: Set<number>;
    right: Set<number>;
}>): boolean;
export type DiffAnnotator = (diffs: FileDiff[]) => string;
export type PromptBuilder = (input: {
    prMetadata: {
        title: string;
        description?: string;
        baseBranch: string;
        headBranch: string;
        commits?: string[];
    };
    annotatedDiff: string;
    existingComments?: {
        path: string;
        line: number;
        body: string;
        author: string;
    }[];
    guidelines?: string;
}) => {
    systemPrompt: string;
    userPrompt: string;
};
export type OutputParser = (raw: string) => {
    summary: string;
    comments: ReviewOutputComment[];
};
export declare class RunCodeReviewUseCase {
    private readonly codeReviewRepo;
    private readonly platformReviewService;
    private readonly structuredCaller;
    private readonly gitPrService;
    private readonly annotateFileDiffs;
    private readonly buildReviewPrompt;
    private readonly parseReviewOutput;
    constructor(codeReviewRepo: ICodeReviewRepository, platformReviewService: IPlatformReviewService, structuredCaller: IStructuredAgentCaller, gitPrService: IGitPrService, annotateFileDiffs: DiffAnnotator, buildReviewPrompt: PromptBuilder, parseReviewOutput: OutputParser);
    execute(input: RunCodeReviewInput): Promise<RunCodeReviewOutput>;
    /**
     * Resolve the target string into owner/repo/prNumber.
     * Supports: PR URL or PR number with explicit owner/repo.
     */
    private resolveTarget;
    /**
     * Read repository-level review guidelines from .shep/review-guidelines.md.
     */
    private readGuidelines;
}
export {};
//# sourceMappingURL=run-code-review.use-case.d.ts.map