import * as z from "zod"; import { task } from "@wular/coder/flow"; //#region src/flow/builtin/review.d.ts declare const args: z.ZodObject<{ pr: z.ZodOptional>; base: z.ZodOptional; head: z.ZodOptional; since: z.ZodOptional; post: z.ZodOptional; author: z.ZodOptional; path: z.ZodOptional>; exclude: z.ZodOptional>; engine: z.ZodOptional; model: z.ZodOptional; effort: z.ZodOptional>; cwd: z.ZodOptional; }, z.core.$strip>; type ReviewArgs = z.infer; /** Tasks at once unless the caller sets a concurrency. */ declare const concurrency = 4; declare const Finding: z.ZodObject<{ file: z.ZodString; line: z.ZodNumber; severity: z.ZodEnum<{ critical: "critical"; major: "major"; minor: "minor"; nit: "nit"; }>; category: z.ZodEnum<{ correctness: "correctness"; security: "security"; reliability: "reliability"; performance: "performance"; maintainability: "maintainability"; testing: "testing"; documentation: "documentation"; }>; summary: z.ZodString; failure_scenario: z.ZodString; }, z.core.$strict>; type Finding = z.infer & { fingerprint: string; }; interface ReviewSummary { baseSha: string; headSha: string; /** Also covers uncommitted and untracked files on top of `headSha`. */ worktree: boolean; files: number; model: string | null; elapsedMs: number; posted?: number; /** Parts left out of the review, such as uninitialized submodules. */ warnings?: string[]; } interface ReviewResult { findings: Finding[]; summary: ReviewSummary; } type Exec = ReviewExec; /** New-side line ranges per file from a unified diff. */ declare function changedLines(patch: string): Map>; /** Stable dedupe key: prose may change between otherwise identical reviews. */ declare function fingerprint(file: string, line: number, category: string): string; /** AGENTS.md / CLAUDE.md, then .coder/review.md, all read at `sha`. */ declare function repositoryRules(exec: Exec, sha: string): string; interface ReviewServices { exec?: Exec; reviewTask?: typeof task; /** Test-only override for the transient task credential. */ integrationToken?: string; } declare function review(a: ReviewArgs, services?: ReviewServices): Promise; type ReviewExec = (command: string, args: string[], input?: string) => string; interface ReviewPostFinding { file: string; line: number; severity: 'critical' | 'major' | 'minor' | 'nit'; category: string; summary: string; failure_scenario: string; fingerprint: string; } interface ReviewPostSummary { author: string; baseSha: string; headSha: string; model: string | null; elapsedMs: number; } interface ReviewPostInput { repo: string; pr: number; cwd?: string; findings: ReviewPostFinding[]; summary: ReviewPostSummary; since?: string; } interface ReviewTargetInput { pr: number | string; /** The only repository the target may be in. */ repo?: string; cwd?: string; since?: string; author?: string; } interface ReviewTarget { pr?: { number: number; repo: string; author: string; }; baseSha: string; headSha: string; since?: string; } interface ReviewAuth { /** Installation token from the task context. Omit to use local gh auth. */ token?: string; exec?: ReviewExec; } /** The platform reviews post to; its tool server holds the token. */ declare const REVIEW_PLATFORM = "github"; interface ReviewComment { id: number; body?: string | null; user?: { login?: string; } | null; } declare function reviewCli(cwd?: string, token?: string): ReviewExec; declare function parseGithubPr(value: number | string): { number: number; repo?: string; }; declare function reviewFingerprints(comments: Array<{ body?: string | null; }>): Set; declare function lastReviewSummary(comments: Array<{ id: number; body?: string | null; }>): { id: number; head: string; } | undefined; declare function ownReviewComments(comments: ReviewComment[], author: string): ReviewComment[]; /** Resolve and fetch a GitHub pull request for the integration-generic review flow. */ declare function resolveReviewTarget(input: ReviewTargetInput, auth?: ReviewAuth): ReviewTarget; /** Post unseen findings and upsert the sticky summary through GitHub's integration. */ declare function postReview(input: ReviewPostInput, auth?: ReviewAuth): number; //#endregion export { Exec, Finding, REVIEW_PLATFORM, ReviewArgs, ReviewAuth, ReviewExec, ReviewPostFinding, ReviewPostInput, ReviewPostSummary, ReviewResult, ReviewServices, ReviewSummary, ReviewTarget, ReviewTargetInput, args, changedLines, concurrency, review as default, fingerprint, lastReviewSummary, ownReviewComments, parseGithubPr, postReview, repositoryRules, resolveReviewTarget, reviewCli, reviewFingerprints };