/** * IssueProvider — Abstract interface for issue tracker operations. * * Implementations: GitHub (gh CLI), GitLab (glab CLI). */ export const STATE_LABELS = [ "Planning", "To Do", "Doing", "To Test", "Testing", "Done", "To Improve", "Refining", ] as const; export type StateLabel = (typeof STATE_LABELS)[number]; export const LABEL_COLORS: Record = { Planning: "#95a5a6", "To Do": "#428bca", Doing: "#f0ad4e", "To Test": "#5bc0de", Testing: "#9b59b6", Done: "#5cb85c", "To Improve": "#d9534f", Refining: "#f39c12", }; export type Issue = { iid: number; title: string; description: string; labels: string[]; state: string; web_url: string; }; export type IssueComment = { author: string; body: string; created_at: string; }; export interface IssueProvider { ensureLabel(name: string, color: string): Promise; ensureAllStateLabels(): Promise; createIssue(title: string, description: string, label: StateLabel, assignees?: string[]): Promise; listIssuesByLabel(label: StateLabel): Promise; getIssue(issueId: number): Promise; listComments(issueId: number): Promise; transitionLabel(issueId: number, from: StateLabel, to: StateLabel): Promise; closeIssue(issueId: number): Promise; reopenIssue(issueId: number): Promise; hasStateLabel(issue: Issue, expected: StateLabel): boolean; getCurrentStateLabel(issue: Issue): StateLabel | null; hasMergedMR(issueId: number): Promise; getMergedMRUrl(issueId: number): Promise; addComment(issueId: number, body: string): Promise; healthCheck(): Promise; } /** @deprecated Use IssueProvider */ export type TaskManager = IssueProvider;