import type { BreakpointBackend, BreakpointBackendCapabilities, ListRespondersParams, SubmitAnswerParams, SubmitBreakpointParams, WaitForAnswerOptions } from "../backend.js"; import type { Breakpoint, BreakpointPublicAnswer, BreakpointWaitResult, ExternalTrackerBackendConfig, ExternalTrackerProvider, ExternalTrackerStatus, ResponderProfile } from "../types.js"; export interface ExternalTrackerReference { provider: ExternalTrackerProvider; id: string; key?: string; url?: string; } export interface ExternalTrackerIssue { ref: ExternalTrackerReference; title: string; description?: string; status: ExternalTrackerStatus; labels: string[]; assignees: string[]; createdAt: string; updatedAt: string; comments: ExternalTrackerComment[]; metadata?: Record; } export interface ExternalTrackerComment { id: string; authorId: string; authorName: string; body: string; createdAt: string; } export interface ExternalTrackerWebhookEvent { provider: ExternalTrackerProvider; eventId: string; action: "issue.created" | "issue.updated" | "comment.created" | "issue.deleted"; issue: ExternalTrackerIssue; comment?: ExternalTrackerComment; receivedAt: string; } export interface ExternalTrackerWebhookResult { accepted: boolean; duplicate: boolean; event?: ExternalTrackerWebhookEvent; breakpoint?: Breakpoint; answer?: BreakpointPublicAnswer; } export interface ExternalTrackerCreateIssueInput { title: string; description: string; labels: string[]; assignees: string[]; fields: Record; metadata: Record; } export interface ExternalTrackerAdapter { readonly provider: ExternalTrackerProvider; createIssue(input: ExternalTrackerCreateIssueInput): Promise; getIssue(ref: ExternalTrackerReference): Promise; listIssues(): Promise; addComment(ref: ExternalTrackerReference, answer: SubmitAnswerParams): Promise; transitionIssue(ref: ExternalTrackerReference, status: ExternalTrackerStatus): Promise; claimIssue?(ref: ExternalTrackerReference, responderId: string): Promise; normalizeWebhook?(payload: unknown, headers?: Record): ExternalTrackerWebhookEvent | null; } export declare function redactExternalTrackerSecrets(value: T): T; declare abstract class HttpTrackerAdapter implements ExternalTrackerAdapter { protected readonly config: ExternalTrackerBackendConfig; abstract readonly provider: ExternalTrackerProvider; constructor(config: ExternalTrackerBackendConfig); abstract createIssue(input: ExternalTrackerCreateIssueInput): Promise; abstract getIssue(ref: ExternalTrackerReference): Promise; abstract listIssues(): Promise; abstract addComment(ref: ExternalTrackerReference, answer: SubmitAnswerParams): Promise; abstract transitionIssue(ref: ExternalTrackerReference, status: ExternalTrackerStatus): Promise; protected requestJson(pathOrUrl: string, init?: RequestInit): Promise; protected applyAuth(headers: Record): void; protected mapIssue(raw: unknown, fallbackId?: string): ExternalTrackerIssue; protected mapComments(raw: unknown): ExternalTrackerComment[]; normalizeWebhook(payload: unknown): ExternalTrackerWebhookEvent | null; } export declare class JiraTrackerAdapter extends HttpTrackerAdapter { readonly provider: "jira"; createIssue(input: ExternalTrackerCreateIssueInput): Promise; getIssue(ref: ExternalTrackerReference): Promise; listIssues(): Promise; addComment(ref: ExternalTrackerReference, answer: SubmitAnswerParams): Promise; transitionIssue(ref: ExternalTrackerReference, status: ExternalTrackerStatus): Promise; } export declare class LinearTrackerAdapter extends HttpTrackerAdapter { readonly provider: "linear"; protected applyAuth(headers: Record): void; private graphql; createIssue(input: ExternalTrackerCreateIssueInput): Promise; getIssue(ref: ExternalTrackerReference): Promise; listIssues(): Promise; addComment(ref: ExternalTrackerReference, answer: SubmitAnswerParams): Promise; transitionIssue(ref: ExternalTrackerReference, status: ExternalTrackerStatus): Promise; protected mapIssue(raw: unknown, fallbackId?: string): ExternalTrackerIssue; } export declare class GenericRestTrackerAdapter extends HttpTrackerAdapter { readonly provider: "generic-rest"; createIssue(input: ExternalTrackerCreateIssueInput): Promise; getIssue(ref: ExternalTrackerReference): Promise; listIssues(): Promise; addComment(ref: ExternalTrackerReference, answer: SubmitAnswerParams): Promise; transitionIssue(ref: ExternalTrackerReference, status: ExternalTrackerStatus): Promise; claimIssue(ref: ExternalTrackerReference, responderId: string): Promise; } export declare class ExternalTrackerBackend implements BreakpointBackend { private readonly config; readonly name = "external-tracker"; private readonly adapter?; private readonly delegatedGitHub?; private readonly refsByBreakpointId; private readonly seenWebhookEvents; private readonly defaultPollIntervalMs; private readonly defaultTimeoutMs; constructor(config: ExternalTrackerBackendConfig); capabilities(): BreakpointBackendCapabilities; submitBreakpoint(params: SubmitBreakpointParams): Promise; getBreakpoint(id: string): Promise; waitForAnswer(id: string, options?: WaitForAnswerOptions): Promise; listPendingBreakpoints(responderId?: string): Promise; answerBreakpoint(id: string, answer: SubmitAnswerParams): Promise; cancelBreakpoint(id: string): Promise; listResponders(_params?: ListRespondersParams): Promise; claimBreakpoint(id: string, responderId: string): Promise; handleWebhook(payload: unknown, headers?: Record): ExternalTrackerWebhookResult; private requireAdapter; private resolveRef; private issueToBreakpoint; private mapStatusToBreakpoint; private buildMappedFields; } export declare function createExternalTrackerAdapter(config: ExternalTrackerBackendConfig): ExternalTrackerAdapter; export {}; //# sourceMappingURL=external-tracker.d.ts.map