/** * PR Status Handler * * Provides a multi-PR summary dashboard showing all watched PRs * grouped by repository with status indicators. * * @see .dev/features/github-pr.md for full specification */ import type { IPullRequestRepository } from '../../../domain/interfaces/dal/IPullRequestRepository'; import type { CheckStatus } from '../../../domain/interfaces/types/IPullRequest'; /** * Ready state for a PR. */ export type ReadyState = 'ready' | 'blocked' | 'draft' | 'merged' | 'closed' | 'pending'; /** * PR status item with ready-for-merge analysis. */ export interface IPrStatusItem { readonly number: number; readonly repo: string; readonly title: string; readonly status: 'open' | 'merged' | 'closed'; readonly isDraft: boolean; readonly checksStatus: CheckStatus; readonly checksTotal?: number; readonly checksPassed?: number; readonly unresolvedComments: number; readonly hasApproval: boolean; readonly readyState: ReadyState; readonly lastPolled?: string; } /** * PRs grouped by repository. */ export interface IPrsByRepo { readonly repo: string; readonly prs: readonly IPrStatusItem[]; } /** * Summary counts. */ export interface IPrStatusSummary { readonly total: number; readonly ready: number; readonly blocked: number; readonly draft: number; readonly merged: number; readonly closed: number; readonly pending: number; } /** * Result from PrStatusHandler. */ export interface IPrStatusResult { readonly success: boolean; readonly message: string; readonly user: string; readonly byRepo: readonly IPrsByRepo[]; readonly summary: IPrStatusSummary; readonly formattedOutput: string; } /** * Options for status command. */ export interface IPrStatusOptions { readonly repo?: string; } /** * Handler for PR status summary. */ export declare class PrStatusHandler { private readonly prRepository; constructor(prRepository: IPullRequestRepository); /** * Get status summary of all watched PRs. */ execute(options?: IPrStatusOptions): Promise; /** * Convert IPullRequest to IPrStatusItem with ready-state analysis. */ private toStatusItem; /** * Determine ready-for-merge state. * * Ready when: * - Status is open (not draft, not merged, not closed) * - All checks passed * - No unresolved comments * - Has at least one approval (if required) */ private determineReadyState; /** * Group PRs by repository. */ private groupByRepo; /** * Sort repos alphabetically, PRs by priority. * Priority: blocked > pending > ready > draft > merged > closed */ private sortByPriority; /** * Calculate summary counts. */ private calculateSummary; /** * Create empty summary. */ private createEmptySummary; /** * Format user ID for display (extract username from group_id). */ private formatUserId; /** * Format output when no results. */ private formatNoResults; /** * Format the full status output. */ private formatOutput; /** * Format a single PR line. */ private formatPrLine; /** * Format summary line. */ private formatSummaryLine; /** * Get status icon for PR state. */ private getStatusIcon; /** * Get checks icon. */ private getChecksIcon; /** * Get checks status text when counts are not available. */ private getChecksStatusText; /** * Get ready state icon. */ private getReadyIcon; /** * Capitalize first letter. */ private capitalizeFirst; } //# sourceMappingURL=PrStatusHandler.d.ts.map