refactor: reorganize task management imports and update task handling tools
- Updated import paths for task management providers in task-comment, task-create, and task-update tools. - Removed deprecated task-complete and task-pickup tools, replacing them with work-finish and work-start tools for improved task handling. - Enhanced work-finish and work-start tools to streamline task completion and pickup processes, including context-aware detection and auto-scheduling features. - Updated package.json to include build scripts and main entry point. - Modified tsconfig.json to enable output directory, declaration files, and source maps for better TypeScript support.
This commit is contained in:
45
lib/providers/provider.ts
Normal file
45
lib/providers/provider.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* 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<StateLabel, string> = {
|
||||
Planning: "#6699cc", "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 interface IssueProvider {
|
||||
ensureLabel(name: string, color: string): Promise<void>;
|
||||
ensureAllStateLabels(): Promise<void>;
|
||||
createIssue(title: string, description: string, label: StateLabel, assignees?: string[]): Promise<Issue>;
|
||||
listIssuesByLabel(label: StateLabel): Promise<Issue[]>;
|
||||
getIssue(issueId: number): Promise<Issue>;
|
||||
transitionLabel(issueId: number, from: StateLabel, to: StateLabel): Promise<void>;
|
||||
closeIssue(issueId: number): Promise<void>;
|
||||
reopenIssue(issueId: number): Promise<void>;
|
||||
hasStateLabel(issue: Issue, expected: StateLabel): boolean;
|
||||
getCurrentStateLabel(issue: Issue): StateLabel | null;
|
||||
hasMergedMR(issueId: number): Promise<boolean>;
|
||||
getMergedMRUrl(issueId: number): Promise<string | null>;
|
||||
addComment(issueId: number, body: string): Promise<void>;
|
||||
healthCheck(): Promise<boolean>;
|
||||
}
|
||||
|
||||
/** @deprecated Use IssueProvider */
|
||||
export type TaskManager = IssueProvider;
|
||||
Reference in New Issue
Block a user