//#region src/github/review-threads.d.ts /** * Pull-request review-thread operations over the GitHub GraphQL API. * * Built for sweep-style workflows that read CodeRabbit findings on a PR, * post replies (for audit trail), optionally resolve threads, and react * on individual comments. */ interface ReviewComment { /** * GraphQL node id of this comment. Pass to `addReaction`. Note: * `replyToThread` expects a *thread* id (`ReviewThread.id`), not a * comment id — passing this here will be rejected by the GraphQL API. */ id: string; /** REST databaseId — needed when REST endpoints don't accept node ids. */ databaseId: number; body: string; author: string | null; path: string | null; /** GitHub's view URL for the comment, useful for logs. */ url: string; } interface ReviewThread { /** GraphQL node id — pass to `resolveThread`. */ id: string; isResolved: boolean; isOutdated: boolean; path: string | null; comments: ReviewComment[]; } interface RepoSlug { owner: string; name: string; } interface FetchUnresolvedThreadsOptions { /** Repo working directory; defaults to the caller's cwd. */ cwd?: string; /** Override the detected `owner/name`. */ repo?: RepoSlug; } /** * Fetch the unresolved (and not outdated) review threads on a PR. Outdated * threads — comments on lines that have since changed — are dropped: * replying or resolving them is rarely useful and CodeRabbit re-files * them as needed. */ declare function fetchUnresolvedThreads(prNumber: number, options?: FetchUnresolvedThreadsOptions): Promise; /** * Post a reply on a review thread. `threadId` is the GraphQL node id — * the `id` field on `ReviewThread`, not on a `ReviewComment`. */ declare function replyToThread(threadId: string, body: string, cwd?: string): Promise; /** * Mark a review thread as resolved. Off by default in workflow prompts — * see plan §10 #9 — but exposed for projects that prefer the auto-resolve path. */ declare function resolveThread(threadId: string, cwd?: string): Promise; type Reaction = "+1" | "-1" | "heart" | "hooray" | "confused" | "rocket"; /** * React on a review comment. `commentId` is the GraphQL node id (the `id` * field on `ReviewComment`). */ declare function addReaction(commentId: string, reaction: Reaction, cwd?: string): Promise; //#endregion export { addReaction as a, resolveThread as c, ReviewThread as i, Reaction as n, fetchUnresolvedThreads as o, ReviewComment as r, replyToThread as s, FetchUnresolvedThreadsOptions as t };