import { type Ocr18Language } from './ocr-18-language-routing.js'; export declare const OCR_18_PACKAGE = "@alibaba-group/open-code-review@1.13.1"; export type Ocr18State = 'ok' | 'no-routed-language' | 'ocr18-missing' | 'binary-missing' | 'llm-config-missing' | 'execution-failed' | 'language-unsupported'; export type Ocr18Finding = { readonly filePath: string; readonly line: number; readonly ruleId: string | null; readonly severity: 'error' | 'warn' | 'info'; readonly message: string; }; export type Ocr18Summary = { readonly total: number; readonly bySeverity: Readonly>; readonly byLanguage: Readonly>; }; export type Ocr18RunResult = { readonly state: Ocr18State; readonly findings: readonly Ocr18Finding[]; readonly summary: Ocr18Summary | null; readonly durationMs: number; readonly rawOutput: string; }; /** The git range a review covers; empty means "the workspace" (what `ocr review` defaults to). */ export type Ocr18Range = { readonly from?: string; readonly to?: string; readonly commit?: string; }; export type Ocr18RunOptions = Ocr18Range & { readonly cwd: string; /** Required for a review; ignored by delegation mode, which is not language-scoped. */ readonly language?: string; readonly delegate?: boolean; readonly timeoutMs?: number; }; /** * The one severity map: OCR comments (`parseComments`) and the delegated * envelope (`ocr-18-delegate-record`) both map through it, so the two cannot * disagree about what `high` means. */ export declare function severityFor(value: unknown): 'error' | 'warn' | 'info'; export declare function emptyByLanguage(): Readonly>; export declare function rangeArgs(range: Ocr18Range): string[]; /** The review argv — no language flag exists, and none is emitted. */ export declare function buildReviewArgs(range: Ocr18Range): string[]; export declare function buildOcr18Args(options: Ocr18RunOptions): string[]; export type Ocr18Invocation = { readonly ok: true; readonly stdout: string; readonly stderr: string; } | { readonly ok: false; readonly state: Ocr18State; readonly rawOutput: string; }; export declare function invokeOcr(args: readonly string[], cwd: string, timeoutMs?: number): Ocr18Invocation; export type ParsedComments = { readonly ok: true; readonly findings: readonly Ocr18Finding[]; } | { readonly ok: false; }; /** * `comments[]` from the real 1.13.1 envelope, mapped onto `Ocr18Finding`. * * A discriminated result rather than `null`: `{ ok: false }` is the execution * failure the caller must report, and it cannot be mistaken for an empty review * (which is `{ ok: true, findings: [] }`). */ export declare function parseComments(stdout: string): ParsedComments; export declare function summarize(findings: readonly Ocr18Finding[], counts: Readonly>): Ocr18Summary; export declare function runOcr18(options: Ocr18RunOptions): Ocr18RunResult;