/** * PR Address Handler * * Fetches pending PR comments and outputs them in a format suitable for * AI assistants to analyze and address. The handler provides: * - Comment details with file/line context * - Relevant code snippets * - Instructions for how to address each comment type * * The actual code changes and replies are made by the AI assistant, * not by this handler. * * @see .dev/features/github-pr.md for full specification */ import type { IGithubClient } from '../../../domain/interfaces/dal/IGithubClient'; import type { IPullRequestRepository } from '../../../domain/interfaces/dal/IPullRequestRepository'; import type { CommentStatus } from '../../../domain/interfaces/types/IPullRequest'; /** * Comment with context for addressing. */ export interface ICommentToAddress { readonly id: number; readonly file: string; readonly line?: number; readonly author: string; readonly body: string; readonly status: CommentStatus; readonly htmlUrl: string; readonly codeContext?: string; readonly diffHunk?: string; readonly commentType: CommentType; } /** * Type of comment - determines how to address it. */ export type CommentType = 'code_change' | 'question' | 'suggestion' | 'nitpick' | 'approval' | 'unknown'; /** * Result from PrAddressHandler. */ export interface IPrAddressResult { readonly success: boolean; readonly repo: string; readonly prNumber: number; readonly branch: string; readonly title?: string; readonly commentsToAddress: readonly ICommentToAddress[]; readonly summary: { readonly total: number; readonly codeChanges: number; readonly questions: number; readonly suggestions: number; readonly nitpicks: number; }; readonly instructions: string; readonly formattedOutput: string; } /** * Options for PrAddressHandler. */ export interface IPrAddressOptions { readonly repo?: string; readonly prNumber: number; readonly includeResolved?: boolean; readonly codeContextLines?: number; } /** * Handler for preparing PR comments to be addressed. */ export declare class PrAddressHandler { private readonly githubClient; private readonly prRepository; constructor(githubClient: IGithubClient, prRepository: IPullRequestRepository); /** * Fetch and prepare PR comments for addressing. */ execute(options: IPrAddressOptions): Promise; /** * Get existing comment statuses from Neo4j. */ private getExistingStatuses; /** * Categorize the comment type based on content analysis. */ private categorizeComment; /** * Get code context around the comment line. */ private getCodeContext; /** * Generate instructions for addressing comments. */ private generateInstructions; /** * Wrap content in a safe fenced code block. * Handles content that contains backticks by using a longer fence. */ private wrapFence; /** * Format output for display. */ private formatOutput; } //# sourceMappingURL=PrAddressHandler.d.ts.map