/** * GitHub CLI Wrapper * * Wraps the `gh` CLI to provide a clean TypeScript interface for GitHub API operations. * Uses the existing `gh` authentication and handles rate limiting automatically. * * @see .dev/features/github-pr.md for full specification */ import type { IGhPrResponse, IGhCheckResponse, IGhReviewResponse, IGhReviewCommentResponse, IGhReviewThreadResponse, IGhIssueResponse, IGhUserResponse, IGithubClientOptions } from './types'; /** * GitHub CLI wrapper for PR operations. */ export declare class GithubClient { private readonly options; private cachedUser; constructor(options?: IGithubClientOptions); /** * Execute a gh CLI command and parse JSON output. * Uses spawnSync with shell: false to avoid shell injection. */ private execGh; /** * Execute a gh api command. * Uses stdin for POST data to avoid shell injection vulnerabilities. */ private execGhApi; /** * Execute a gh CLI command with stdin input. * Uses spawnSync with shell: false to avoid shell injection. */ private execGhWithStdin; private delay; /** * Get PR details. */ getPr(repo: string, prNumber: number): Promise; /** * Get CI check statuses for a PR. * Note: Returns empty array only when PR exists but has no checks. * Throws NOT_FOUND if the PR itself doesn't exist. */ getPrChecks(repo: string, prNumber: number): Promise; /** * Get PR reviews. */ getPrReviews(repo: string, prNumber: number): Promise; /** * Get PR review comments (inline comments on diff). */ getPrComments(repo: string, prNumber: number): Promise; /** * Get PR review threads with resolution status via GraphQL. * This provides the isResolved flag which is not available in the REST API. */ getPrReviewThreads(repo: string, prNumber: number): Promise; /** * Get the diff for a PR. */ getPrDiff(repo: string, prNumber: number): Promise; /** * Get issue details. */ getIssue(repo: string, issueNumber: number): Promise; /** * Reply to a PR review comment. */ replyToComment(repo: string, commentId: number, body: string): Promise; /** * Add a reaction to a PR comment. * @param reaction - One of: +1, -1, laugh, confused, heart, hooray, rocket, eyes */ addReaction(repo: string, commentId: number, reaction: '+1' | '-1' | 'laugh' | 'confused' | 'heart' | 'hooray' | 'rocket' | 'eyes'): Promise; /** * Get the currently authenticated GitHub user. * Cached after first call. */ getCurrentUser(): Promise; /** * Get the user ID in Lisa's format for user-scoped storage. * Returns format: "user:" */ getUserId(): Promise; /** * Get the current repository from git remote. * Returns format: "owner/repo" */ getCurrentRepo(): Promise; /** * Get the current PR number for the checked-out branch. */ getCurrentPrNumber(): Promise; /** * Get the current git branch name. */ getCurrentBranch(): Promise; /** * Get the default branch for a repository (usually main or master). */ getDefaultBranch(repo: string): Promise; /** * Get commit messages between base and head (or HEAD if not specified). */ getCommitMessages(base: string, head?: string): Promise; /** * Get list of changed files between base and head (or HEAD if not specified). */ getChangedFiles(base: string, head?: string): Promise; /** * Add a comment to an issue. */ commentOnIssue(repo: string, issueNumber: number, body: string): Promise; /** * Create a new PR. * Uses --body-file - to pass body via stdin, avoiding shell injection. */ createPr(options: { repo: string; title: string; body: string; base?: string; head?: string; draft?: boolean; }): Promise; /** * Check if gh CLI is installed and authenticated. */ isAvailable(): Promise; } //# sourceMappingURL=GithubClient.d.ts.map