export type PrExecResult = { code: number; stdout: string; stderr: string; stdout_truncated?: true; }; export type PrExec = (argv: string[], options?: { cwd?: string; }) => Promise; export type PrOptions = { exec?: PrExec; timeoutMs?: number; cwd?: string; }; export type PrRepoInput = { cwd?: string; }; export type PrFindInput = PrRepoInput & { branch?: string; }; export type PrLocalInput = PrRepoInput & { base?: string; }; export type PrCandidate = { number: number; url: string; state: string; headRefName: string; }; export type PrLocator = { owner: string; name: string; pr: number | string; }; export type PrFilesInput = PrLocator & { paginate: true; include_corvus?: boolean; names_only?: boolean; }; export type PrConfigInput = { owner: string; name: string; ref: string; }; export type PrMetadata = { number: number; url: string; title: string; body: string; labels: Record[]; closingIssuesReferences: Record[]; latestReviews: Record[]; reviewDecision: string | null; state: string; isDraft: boolean; mergeable: string; author: { login: string; } | null; baseRefName: string; baseRefOid: string; headRefName: string; headRefOid: string; head_sha: string; code_head: string; isCrossRepository: boolean; changedFiles: number; }; export type PrFile = { filename: string; status: string; additions: number; deletions: number; has_patch: boolean; patch?: string; }; export type PrReview = { id: number; user: string | null; state: string; commit_id: string | null; submitted_at: string | null; html_url: string; body: string; body_marker?: string; }; type FindingIdentity = { finding_id: string; axis?: "standards" | "spec"; dimension?: "architecture" | "correctness" | "conventions" | "security"; }; export type PrComment = FindingIdentity & { id: number; pull_request_review_id: number; in_reply_to_id: number | null; html_url: string; body: string; path: string; line: number | null; original_line: number | null; user: string | null; commit_id: string; original_commit_id: string; }; export type PrThread = { root: PrComment; replies: PrComment[]; }; export type PrDisposition = FindingIdentity & { thread_url: string; state: "unknown"; evidence: string; }; export type PrCheck = { name: string; state: string; link: string; }; export type PrData = { repo: { owner: string; name: string; source: "gh" | "git-remote"; }; find: { found: true; number: number; url: string; state: string; } | { found: false; candidates: PrCandidate[]; }; local: { branch: string | null; head_sha: string; code_head: string; default_branch: string; merge_base: string; excluded_corvus: number; ahead: number; changed_files: string[]; stat: string; diff: string; oversized: boolean; dirty: boolean; }; metadata: PrMetadata; head: { head_sha: string; code_head: string; base_sha: string; }; files: { files: PrFile[] | string[]; complete_pagination: boolean; excluded_corvus: number; }; diff: { oversized: false; text: string; excluded_corvus: number; } | { oversized: true; http_status?: number; }; reviews: { reviews: PrReview[]; threads: PrThread[]; dispositions: PrDisposition[]; complete_pagination: boolean; complete_threads: boolean; }; checks: { checks: PrCheck[]; }; identity: { login: string; }; config: { present: false; http_status: 404; } | { present: true; yaml: string; }; }; export type PrOperation = keyof PrData; /** * Host agent identity and the requested operation are read before PR I/O by both * hosts. Unknown callers/ops reject; detectors get only the six evidence reads, * writer only anchor/history reads, and orchestrators/gatherer all listed operations. * No tool argument or option disables this caller fence. */ export declare function isPrCallerAllowed(caller: unknown, op: unknown): boolean; export type PrFailure = { reason: string; http_status?: number; unavailable?: true; login?: null; files?: PrFile[] | string[]; excluded_corvus?: number; reviews?: PrReview[]; threads?: PrThread[]; dispositions?: PrDisposition[]; complete_pagination?: false; complete_threads?: boolean; }; export type PrResult = ({ ok: true; } & T | { ok: false; } & PrFailure) & { api_calls: number; }; export type PrInput = ({ op: "metadata" | "head" | "diff" | "reviews" | "checks"; } & PrLocator) | ({ op: "files"; } & PrFilesInput) | ({ op: "config"; } & PrConfigInput) | { op: "identity"; } | ({ op: "repo"; } & PrRepoInput) | ({ op: "find"; } & PrFindInput) | ({ op: "local"; } & PrLocalInput); export declare const MAX_DIFF_BYTES = 512000; export declare function parseReviewMarker(body: unknown): { head: string; path?: string; round?: number; marker: string; } | undefined; export declare const metadata: (input: PrLocator, opts?: PrOptions) => Promise>; export declare const head: (input: PrLocator, opts?: PrOptions) => Promise>; export declare const files: (input: PrFilesInput, opts?: PrOptions) => Promise>; export declare const diff: (input: PrLocator, opts?: PrOptions) => Promise>; export declare const reviews: (input: PrLocator, opts?: PrOptions) => Promise>; export declare const checks: (input: PrLocator, opts?: PrOptions) => Promise>; export declare const identity: (opts?: PrOptions) => Promise>; export declare const repo: (input?: PrRepoInput, opts?: PrOptions) => Promise>; export declare const find: (input?: PrFindInput, opts?: PrOptions) => Promise>; export declare const local: (input?: PrLocalInput, opts?: PrOptions) => Promise>; export declare const config: (input: PrConfigInput, opts?: PrOptions) => Promise>; /** Capture host-only exec/deadline options; tool callers receive JSON strings. */ export declare function createPrExecutor(options?: PrOptions): (input: unknown) => Promise; export {}; //# sourceMappingURL=review-pr.d.ts.map