/** * GitHub backlog provider implementation. * * Provides access to GitHub Issues as a ticket/backlog system. * Uses the Octokit REST API client for GitHub API interactions. * * @example * ```typescript * import { GitHubProvider } from './github.js'; * * const provider = new GitHubProvider(config); * * // Check authentication * const auth = await provider.checkAuth(); * if (!auth.ok) throw new Error(auth.message); * * // Fetch a ticket * const ticket = await provider.getTicket('#123'); * ``` */ import type { TicketRef } from '../types/ticket.js'; import type { BacklogProvider, BacklogProviderName, Ticket, TicketCreateParams, TicketUpdates, AuthCheckResult } from './types.js'; import type { SpecKitConfig } from '../config.js'; /** * GitHub backlog provider. * * Implements the BacklogProvider interface for GitHub Issues. * Requires GITHUB_TOKEN environment variable for authentication. */ export declare class GitHubProvider implements BacklogProvider { readonly name: BacklogProviderName; private readonly octokit; private readonly config; private repoContext; /** * Create a new GitHub provider. * * @param config - SpecKit configuration */ constructor(config: SpecKitConfig); /** * Set the repository context for resolving local references. * * @param owner - Repository owner * @param repo - Repository name */ setRepoContext(owner: string, repo: string): void; /** * Fetch a ticket by reference string. * * @param ref - GitHub reference (#123, owner/repo#123, or full URL) * @returns Normalized Ticket object * @throws NotFoundError if issue doesn't exist * @throws AuthError if authentication fails */ getTicket(ref: string): Promise; /** * Create a new ticket. * * @param params - Ticket creation parameters * @returns Created Ticket object * @throws AuthError if authentication fails */ createTicket(params: TicketCreateParams): Promise; /** * Update an existing ticket. * * @param ref - GitHub reference * @param updates - Fields to update * @returns Updated Ticket object * @throws NotFoundError if issue doesn't exist * @throws AuthError if authentication fails */ updateTicket(ref: string, updates: TicketUpdates): Promise; /** * Replace all labels on a ticket. * * @param ref - GitHub reference * @param labels - Labels to set */ setLabels(ref: string, labels: string[]): Promise; /** * Get current labels on a ticket. * * @param ref - GitHub reference * @returns Array of label names */ getLabels(ref: string): Promise; /** * Search for tickets matching a query. * * @param query - GitHub search syntax (e.g., 'is:open label:bug') * @returns Array of matching tickets */ searchTickets(query: string): Promise; /** * Check if authentication is valid. * * @returns Authentication check result */ checkAuth(): Promise; /** * Generate the web URL for a ticket. * * @param ref - GitHub reference * @returns Full URL to view the issue */ getTicketUrl(ref: string): string; /** * Parse user input to a TicketRef. * * Handles various GitHub input formats: * - #123 * - owner/repo#123 * - https://github.com/owner/repo/issues/123 * * @param input - User-provided reference string * @returns Parsed TicketRef or null if invalid */ parseRef(input: string): TicketRef | null; /** * Resolve a TicketRef to owner, repo, and issue number. */ private resolveRef; /** * Get the repository context, throwing if not set. */ private getRepoContext; /** * Map a GitHub issue to normalized Ticket format. */ private mapIssueToTicket; /** * Map GitHub issue state to normalized TicketState. */ private mapState; /** * Handle Octokit API errors and convert to provider errors. */ private handleApiError; } //# sourceMappingURL=github.d.ts.map