import { Octokit } from 'octokit';
import { type CrosscheckStepType } from '../lib/annotation.js';
export declare function createGithubClient(token: string): import("@octokit/core").Octokit & {
    paginate: import("@octokit/plugin-paginate-rest").PaginateInterface;
} & import("@octokit/plugin-paginate-graphql").paginateGraphQLInterface & import("@octokit/plugin-rest-endpoint-methods").Api & {
    retry: {
        retryRequest: (error: import("octokit").RequestError, retries: number, retryAfter: number) => import("octokit").RequestError;
    };
};
export declare function verifyWebhookSignature(payload: string, signature: string, secret: string): boolean;
export declare function getPRDiff(octokit: Octokit, owner: string, repo: string, pullNumber: number): Promise<string>;
export declare function registerRepoWebhook(owner: string, repo: string, webhookUrl: string, secret: string, token: string): Promise<number>;
export declare function patchRepoWebhookEvents(owner: string, repo: string, hookId: number, events: string[], token: string): Promise<void>;
export declare function deleteRepoWebhook(owner: string, repo: string, hookId: number, token: string): Promise<void>;
export declare function registerOrgWebhook(org: string, webhookUrl: string, secret: string, token: string): Promise<number>;
export declare function patchOrgWebhookEvents(org: string, hookId: number, events: string[], token: string): Promise<void>;
export declare function deleteOrgWebhook(org: string, hookId: number, token: string): Promise<void>;
export declare function listUserOrgs(token: string): Promise<string[]>;
export declare function checkRepoAccessible(owner: string, repo: string, token: string): Promise<boolean>;
export declare function listUserRepos(username: string, token: string, isSelf?: boolean): Promise<Array<{
    owner: string;
    name: string;
}>>;
export declare function listOrgRepos(org: string, token: string): Promise<Array<{
    owner: string;
    name: string;
    pushedAt: Date | null;
}>>;
export interface OpenPR {
    number: number;
    title: string;
    author: string;
    headSha: string;
    headRef: string;
    headRepo: string | null;
    baseRef: string;
    body: string | null;
    createdAt: string;
    updatedAt: string;
    url?: string;
}
export interface ScanOpenPR extends Omit<OpenPR, 'body'> {
    updatedAt: string;
    url: string;
}
export interface ScanIssueComment {
    id: number;
    author: string;
    body: string;
    createdAt: string;
    updatedAt: string;
}
export interface ScanRepo {
    owner: string;
    name: string;
}
export declare function listOpenPRs(owner: string, repo: string, token: string): Promise<OpenPR[]>;
export declare function listOrgReposForScan(org: string, token: string): Promise<ScanRepo[]>;
export declare function listUserReposForScan(username: string, token: string, isSelf: boolean): Promise<ScanRepo[]>;
export declare function listOpenPRsForScan(owner: string, repo: string, token: string): Promise<ScanOpenPR[]>;
export declare function listIssueCommentsForScan(owner: string, repo: string, issueNumber: number, token: string): Promise<ScanIssueComment[]>;
export interface PRComment {
    id: number;
    body: string;
    createdAt: string;
    updatedAt: string;
}
export declare function listPRComments(owner: string, repo: string, prNumber: number, token: string): Promise<PRComment[]>;
export interface PRCommitDetail {
    sha: string;
    committedAt: string;
}
export declare function listPRCommitsDetailed(owner: string, repo: string, prNumber: number, token: string): Promise<PRCommitDetail[]>;
export interface CommitStatusDetail {
    context: string;
    state: string;
    updatedAt: string;
}
export declare function listCommitStatuses(owner: string, repo: string, sha: string, token: string): Promise<CommitStatusDetail[]>;
export interface GitHubCommentActivity {
    body: string;
    createdAt: string;
    updatedAt?: string;
}
export interface GitHubCommitActivity {
    sha: string;
    committedAt: string;
}
export interface GitHubTimestampActivity {
    state?: string;
    name?: string;
    conclusion?: string | null;
    status?: string | null;
    updatedAt: string;
}
export declare function listIssueComments(owner: string, repo: string, issueNumber: number, token: string): Promise<GitHubCommentActivity[]>;
export declare function listPRReviewComments(owner: string, repo: string, pullNumber: number, token: string): Promise<GitHubCommentActivity[]>;
export declare function listPRCommitActivity(owner: string, repo: string, pullNumber: number, token: string): Promise<GitHubCommitActivity[]>;
export declare function listCheckRuns(owner: string, repo: string, ref: string, token: string): Promise<GitHubTimestampActivity[]>;
export declare function listTimelineEvents(owner: string, repo: string, issueNumber: number, token: string): Promise<GitHubTimestampActivity[]>;
export declare function prHasCrossCheckComment(owner: string, repo: string, prNumber: number, token: string): Promise<boolean>;
export declare function isFreshReviewComment(body: string): boolean;
export declare function getLastCrossCheckCommentId(owner: string, repo: string, prNumber: number, token: string): Promise<number | undefined>;
export interface CrossCheckReviewComment {
    id: number;
    body: string;
}
export declare function getLastCrossCheckReviewComment(owner: string, repo: string, prNumber: number, token: string): Promise<CrossCheckReviewComment | undefined>;
export type RawPRComment = {
    id: number;
    body: string;
    created_at: string;
};
export type RawPRCommit = {
    sha: string;
    commit: {
        message: string;
        author?: {
            date?: string | null;
        } | null;
        committer?: {
            date?: string | null;
        } | null;
    };
};
/**
 * Fetch one page of PR issue comments. All raw GitHub API calls for PR comments
 * are routed through this function so auth headers and URL construction stay in
 * the client layer.
 *
 * Returns the comments and the last-page number parsed from the Link header
 * (null when there is only one page or the header is absent).
 */
export declare function fetchPRCommentPage(owner: string, repo: string, prNumber: number, token: string, opts?: {
    page?: number;
    since?: string;
}): Promise<{
    comments: RawPRComment[];
    lastPage: number | null;
}>;
export declare function fetchPRCommitPage(owner: string, repo: string, prNumber: number, token: string, page?: number): Promise<RawPRCommit[]>;
export declare function getPRCommits(owner: string, repo: string, prNumber: number, token: string): Promise<string[]>;
export declare function getCommitMessage(owner: string, repo: string, sha: string, token: string): Promise<string | null>;
export declare function findOrgWebhook(org: string, url: string, token: string): Promise<number | null>;
export declare function findRepoWebhook(owner: string, repo: string, url: string, token: string): Promise<number | null>;
export interface RepoActivity {
    tier: 1 | 2 | 3;
    fullName: string;
    pushedAt: Date;
    createdAt: Date;
}
export declare function fetchActiveRepos(login: string, token: string): Promise<RepoActivity[]>;
export interface BrandOptions {
    service_name?: string;
    comment_header?: string;
    comment_footer?: string;
    reviewer_attribution?: string;
}
export interface ReviewCommentBodyInput {
    body: string;
    reviewer: string;
    brand?: BrandOptions;
    origin?: string;
    verdict?: string | null;
    replyToCommentId?: number;
    isRecheck?: boolean;
    model?: string;
    stepType?: CrosscheckStepType;
    round?: number;
    sha?: string;
    /** Pre-computed next workflow step embedded in the annotation for fast-path reads. */
    nextStep?: string;
    /** Workflow trigger (e.g. 'kickass') embedded so the issue_comment bridge only fires for one-step dispatches. */
    trigger?: string;
}
export declare function buildReviewCommentBody(input: ReviewCommentBodyInput): string;
export declare function postReviewComment(octokit: Octokit, owner: string, repo: string, pullNumber: number, body: string, reviewer: string, brand?: BrandOptions, origin?: string, verdict?: string | null, replyToCommentId?: number, isRecheck?: boolean, model?: string, stepType?: CrosscheckStepType, round?: number, sha?: string, nextStep?: string, trigger?: string): Promise<number>;
//# sourceMappingURL=client.d.ts.map