import type { BreakpointBackend, BreakpointBackendCapabilities, SubmitBreakpointParams, WaitForAnswerOptions, SubmitAnswerParams, ListRespondersParams } from "../backend.js"; import type { Breakpoint, BreakpointAnswer, BreakpointWaitResult, ResponderProfile, GitHubIssuesBackendConfig } from "../types.js"; interface ParsedAnswer { text: string; confidence?: number; references?: string[]; responderId?: string; responderName?: string; breakpointId?: string; answeredAt?: string; } /** * Resolve a GitHub token by trying `gh auth token` first, * then falling back to the GITHUB_TOKEN environment variable. */ export declare function getGitHubToken(): string; /** * Parse an answer from a GitHub issue comment body. * Looks for a hidden JSON payload block, a "## Answer" heading anywhere * in the body, a JSON code block with an "answer" field, or a sufficiently * long plain-text comment (for assigned responders handled upstream). */ export declare function parseAnswerFromComment(body: string, options?: { isAssignedResponder?: boolean; }): ParsedAnswer | null; /** * BreakpointBackend implementation backed by GitHub Issues. * * Each breakpoint maps to a GitHub issue; answers are detected * from issue comments containing payload blocks, "## Answer" markers, or JSON blocks. */ export declare class GitHubIssuesBackend implements BreakpointBackend { readonly name = "github-issues"; private owner; private repo; private labels; private assignees; private defaultPollIntervalMs; private defaultTimeoutMs; /** * Maps breakpointId -> GitHub issue number. * * Used for legacy non-`gh-{number}` IDs within a single process. * New breakpoints always use `gh-{number}` IDs and remain durable * across backend restarts without this map. */ private issueMap; private tokenOverride?; /** * Resolve the GitHub issue number from a breakpoint ID. * Checks the in-memory map first, then parses the `gh-{number}` format * so that IDs survive across backend instances. */ private resolveIssueNumber; constructor(config: GitHubIssuesBackendConfig); capabilities(): BreakpointBackendCapabilities; /** * Override the token resolution for testing. * @internal */ setToken(token: string): void; private getToken; private githubFetch; private repoPath; private mapIssueToBreakpoint; private buildAnswerFromComment; private formatIssueBody; submitBreakpoint(params: SubmitBreakpointParams): Promise; getBreakpoint(id: string): Promise; waitForAnswer(id: string, options?: WaitForAnswerOptions): Promise; listResponders(_params?: ListRespondersParams): Promise; claimBreakpoint(id: string, responderId: string): Promise; answerBreakpoint(id: string, answer: SubmitAnswerParams): Promise; listPendingBreakpoints(responderId?: string): Promise; cancelBreakpoint(id: string): Promise; } export {}; //# sourceMappingURL=github-issues.d.ts.map