@vibescope/mcp-server 0.4.4 → 0.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +84 -84
- package/README.md +194 -194
- package/dist/api-client/bodies-of-work.d.ts +125 -0
- package/dist/api-client/bodies-of-work.js +78 -0
- package/dist/api-client/chat.d.ts +26 -0
- package/dist/api-client/chat.js +20 -0
- package/dist/api-client/connectors.d.ts +104 -0
- package/dist/api-client/connectors.js +46 -0
- package/dist/api-client/deployment.d.ts +190 -0
- package/dist/api-client/deployment.js +113 -0
- package/dist/api-client/file-checkouts.d.ts +71 -0
- package/dist/api-client/file-checkouts.js +43 -0
- package/dist/api-client/git-issues.d.ts +55 -0
- package/dist/api-client/git-issues.js +34 -0
- package/dist/api-client/index.d.ts +619 -1
- package/dist/api-client/index.js +148 -0
- package/dist/api-client/organizations.d.ts +101 -0
- package/dist/api-client/organizations.js +86 -0
- package/dist/api-client/progress.d.ts +61 -0
- package/dist/api-client/progress.js +34 -0
- package/dist/api-client/project.d.ts +1 -0
- package/dist/api-client/requests.d.ts +28 -0
- package/dist/api-client/requests.js +28 -0
- package/dist/api-client/sprints.d.ts +153 -0
- package/dist/api-client/sprints.js +82 -0
- package/dist/api-client/subtasks.d.ts +37 -0
- package/dist/api-client/subtasks.js +23 -0
- package/dist/api-client.d.ts +23 -0
- package/dist/api-client.js +15 -0
- package/dist/cli-init.js +21 -21
- package/dist/cli.js +26 -26
- package/dist/handlers/blockers.js +4 -0
- package/dist/handlers/chat.d.ts +23 -0
- package/dist/handlers/chat.js +84 -0
- package/dist/handlers/deployment.d.ts +3 -0
- package/dist/handlers/deployment.js +23 -0
- package/dist/handlers/discovery.js +13 -0
- package/dist/handlers/index.d.ts +1 -0
- package/dist/handlers/index.js +3 -0
- package/dist/handlers/project.js +4 -2
- package/dist/handlers/session.js +7 -0
- package/dist/handlers/tasks.js +7 -0
- package/dist/handlers/tool-docs.js +1204 -1131
- package/dist/index.js +73 -73
- package/dist/templates/agent-guidelines.d.ts +1 -1
- package/dist/templates/agent-guidelines.js +205 -187
- package/dist/templates/help-content.js +1621 -1621
- package/dist/tools/bodies-of-work.js +6 -6
- package/dist/tools/chat.d.ts +1 -0
- package/dist/tools/chat.js +24 -0
- package/dist/tools/cloud-agents.js +22 -22
- package/dist/tools/deployment.js +13 -0
- package/dist/tools/features.d.ts +13 -0
- package/dist/tools/features.js +151 -0
- package/dist/tools/index.d.ts +3 -1
- package/dist/tools/index.js +4 -1
- package/dist/tools/milestones.js +2 -2
- package/dist/tools/project.js +4 -0
- package/dist/tools/requests.js +1 -1
- package/dist/tools/session.js +11 -11
- package/dist/tools/sprints.js +9 -9
- package/dist/tools/tasks.js +35 -35
- package/dist/tools/worktrees.js +14 -14
- package/dist/tools.d.ts +2 -0
- package/dist/tools.js +3602 -0
- package/dist/utils.js +11 -11
- package/docs/TOOLS.md +2663 -2545
- package/package.json +53 -53
- package/scripts/generate-docs.ts +212 -212
- package/scripts/version-bump.ts +203 -203
- package/src/api-client/blockers.ts +86 -86
- package/src/api-client/bodies-of-work.ts +194 -0
- package/src/api-client/chat.ts +50 -0
- package/src/api-client/connectors.ts +152 -0
- package/src/api-client/cost.ts +185 -185
- package/src/api-client/decisions.ts +87 -87
- package/src/api-client/deployment.ts +313 -0
- package/src/api-client/discovery.ts +81 -81
- package/src/api-client/fallback.ts +52 -52
- package/src/api-client/file-checkouts.ts +115 -0
- package/src/api-client/findings.ts +100 -100
- package/src/api-client/git-issues.ts +88 -0
- package/src/api-client/ideas.ts +112 -112
- package/src/api-client/index.ts +592 -426
- package/src/api-client/milestones.ts +83 -83
- package/src/api-client/organizations.ts +185 -0
- package/src/api-client/progress.ts +94 -0
- package/src/api-client/project.ts +180 -179
- package/src/api-client/requests.ts +54 -0
- package/src/api-client/session.ts +220 -220
- package/src/api-client/sprints.ts +227 -0
- package/src/api-client/subtasks.ts +57 -0
- package/src/api-client/tasks.ts +450 -450
- package/src/api-client/types.ts +32 -32
- package/src/api-client/validation.ts +60 -60
- package/src/api-client/worktrees.ts +53 -53
- package/src/api-client.test.ts +847 -850
- package/src/api-client.ts +2707 -2672
- package/src/cli-init.ts +557 -557
- package/src/cli.test.ts +284 -284
- package/src/cli.ts +204 -204
- package/src/handlers/__test-setup__.ts +240 -236
- package/src/handlers/__test-utils__.ts +89 -89
- package/src/handlers/blockers.test.ts +468 -468
- package/src/handlers/blockers.ts +172 -163
- package/src/handlers/bodies-of-work.test.ts +704 -704
- package/src/handlers/bodies-of-work.ts +526 -526
- package/src/handlers/chat.test.ts +185 -0
- package/src/handlers/chat.ts +101 -0
- package/src/handlers/cloud-agents.test.ts +438 -438
- package/src/handlers/cloud-agents.ts +156 -156
- package/src/handlers/connectors.test.ts +834 -834
- package/src/handlers/connectors.ts +229 -229
- package/src/handlers/cost.test.ts +462 -462
- package/src/handlers/cost.ts +285 -285
- package/src/handlers/decisions.test.ts +382 -382
- package/src/handlers/decisions.ts +153 -153
- package/src/handlers/deployment.test.ts +551 -551
- package/src/handlers/deployment.ts +570 -541
- package/src/handlers/discovery.test.ts +206 -206
- package/src/handlers/discovery.ts +427 -414
- package/src/handlers/fallback.test.ts +537 -537
- package/src/handlers/fallback.ts +194 -194
- package/src/handlers/file-checkouts.test.ts +750 -750
- package/src/handlers/file-checkouts.ts +185 -185
- package/src/handlers/findings.test.ts +633 -633
- package/src/handlers/findings.ts +239 -239
- package/src/handlers/git-issues.test.ts +631 -631
- package/src/handlers/git-issues.ts +136 -136
- package/src/handlers/ideas.test.ts +644 -644
- package/src/handlers/ideas.ts +207 -207
- package/src/handlers/index.ts +93 -90
- package/src/handlers/milestones.test.ts +475 -475
- package/src/handlers/milestones.ts +180 -180
- package/src/handlers/organizations.test.ts +826 -826
- package/src/handlers/organizations.ts +315 -315
- package/src/handlers/progress.test.ts +269 -269
- package/src/handlers/progress.ts +77 -77
- package/src/handlers/project.test.ts +546 -546
- package/src/handlers/project.ts +242 -239
- package/src/handlers/requests.test.ts +303 -303
- package/src/handlers/requests.ts +99 -99
- package/src/handlers/roles.test.ts +305 -305
- package/src/handlers/roles.ts +219 -219
- package/src/handlers/session.test.ts +998 -998
- package/src/handlers/session.ts +1105 -1093
- package/src/handlers/sprints.test.ts +732 -732
- package/src/handlers/sprints.ts +537 -537
- package/src/handlers/tasks.test.ts +931 -931
- package/src/handlers/tasks.ts +1133 -1121
- package/src/handlers/tool-categories.test.ts +66 -66
- package/src/handlers/tool-docs.test.ts +511 -511
- package/src/handlers/tool-docs.ts +1571 -1491
- package/src/handlers/types.test.ts +259 -259
- package/src/handlers/types.ts +176 -176
- package/src/handlers/validation.test.ts +582 -582
- package/src/handlers/validation.ts +164 -164
- package/src/handlers/version.ts +63 -63
- package/src/index.test.ts +674 -674
- package/src/index.ts +807 -807
- package/src/setup.test.ts +233 -233
- package/src/setup.ts +404 -404
- package/src/templates/agent-guidelines.ts +233 -215
- package/src/templates/help-content.ts +1751 -1751
- package/src/token-tracking.test.ts +463 -463
- package/src/token-tracking.ts +167 -167
- package/src/tools/blockers.ts +122 -122
- package/src/tools/bodies-of-work.ts +283 -283
- package/src/tools/chat.ts +72 -46
- package/src/tools/cloud-agents.ts +101 -101
- package/src/tools/connectors.ts +191 -191
- package/src/tools/cost.ts +111 -111
- package/src/tools/decisions.ts +111 -111
- package/src/tools/deployment.ts +455 -442
- package/src/tools/discovery.ts +76 -76
- package/src/tools/fallback.ts +111 -111
- package/src/tools/features.ts +154 -0
- package/src/tools/file-checkouts.ts +145 -145
- package/src/tools/findings.ts +101 -101
- package/src/tools/git-issues.ts +130 -130
- package/src/tools/ideas.ts +162 -162
- package/src/tools/index.ts +141 -137
- package/src/tools/milestones.ts +118 -118
- package/src/tools/organizations.ts +224 -224
- package/src/tools/progress.ts +73 -73
- package/src/tools/project.ts +206 -202
- package/src/tools/requests.ts +68 -68
- package/src/tools/roles.ts +112 -112
- package/src/tools/session.ts +181 -181
- package/src/tools/sprints.ts +298 -298
- package/src/tools/tasks.ts +550 -550
- package/src/tools/tools.test.ts +222 -222
- package/src/tools/types.ts +9 -9
- package/src/tools/validation.ts +75 -75
- package/src/tools/version.ts +34 -34
- package/src/tools/worktrees.ts +66 -66
- package/src/tools.test.ts +416 -416
- package/src/utils.test.ts +1014 -1014
- package/src/utils.ts +586 -586
- package/src/validators.test.ts +223 -223
- package/src/validators.ts +249 -249
- package/src/version.ts +109 -109
- package/tsconfig.json +16 -16
- package/vitest.config.ts +14 -14
package/src/api-client/tasks.ts
CHANGED
|
@@ -1,450 +1,450 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tasks API Methods
|
|
3
|
-
*
|
|
4
|
-
* Methods for task management:
|
|
5
|
-
* - getTasks: List tasks for a project
|
|
6
|
-
* - createTask: Create a new task
|
|
7
|
-
* - getNextTask: Get highest priority pending task
|
|
8
|
-
* - getTask: Get a single task
|
|
9
|
-
* - getTaskById: Get task with optional subtasks/milestones
|
|
10
|
-
* - searchTasks: Search tasks by text query
|
|
11
|
-
* - getTasksByPriority: Get tasks filtered by priority
|
|
12
|
-
* - getRecentTasks: Get recently created/modified tasks
|
|
13
|
-
* - getTaskStats: Get task statistics
|
|
14
|
-
* - updateTask: Update task details
|
|
15
|
-
* - completeTask: Mark task as completed
|
|
16
|
-
* - deleteTask: Delete a task
|
|
17
|
-
* - releaseTask: Release task back to pending
|
|
18
|
-
* - cancelTask: Cancel a task
|
|
19
|
-
* - addTaskReference: Add reference URL to task
|
|
20
|
-
* - removeTaskReference: Remove reference from task
|
|
21
|
-
* - batchUpdateTasks: Update multiple tasks
|
|
22
|
-
* - batchCompleteTasks: Complete multiple tasks
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
import type { ApiResponse, RequestFn, ProxyFn } from './types.js';
|
|
26
|
-
|
|
27
|
-
export interface TasksMethods {
|
|
28
|
-
getTasks(projectId: string, params?: {
|
|
29
|
-
status?: string;
|
|
30
|
-
limit?: number;
|
|
31
|
-
offset?: number;
|
|
32
|
-
include_subtasks?: boolean;
|
|
33
|
-
search_query?: string;
|
|
34
|
-
include_metadata?: boolean;
|
|
35
|
-
}): Promise<ApiResponse<{
|
|
36
|
-
tasks: Array<{
|
|
37
|
-
id: string;
|
|
38
|
-
title: string;
|
|
39
|
-
description?: string;
|
|
40
|
-
priority: number;
|
|
41
|
-
status: string;
|
|
42
|
-
progress_percentage?: number;
|
|
43
|
-
estimated_minutes?: number;
|
|
44
|
-
started_at?: string;
|
|
45
|
-
completed_at?: string;
|
|
46
|
-
parent_task_id?: string;
|
|
47
|
-
}>;
|
|
48
|
-
total_count: number;
|
|
49
|
-
has_more: boolean;
|
|
50
|
-
}>>;
|
|
51
|
-
|
|
52
|
-
createTask(projectId: string, params: {
|
|
53
|
-
title: string;
|
|
54
|
-
description?: string;
|
|
55
|
-
priority?: number;
|
|
56
|
-
estimated_minutes?: number;
|
|
57
|
-
blocking?: boolean;
|
|
58
|
-
session_id?: string;
|
|
59
|
-
task_type?: string;
|
|
60
|
-
}): Promise<ApiResponse<{
|
|
61
|
-
success: boolean;
|
|
62
|
-
task_id: string;
|
|
63
|
-
title: string;
|
|
64
|
-
blocking?: boolean;
|
|
65
|
-
message?: string;
|
|
66
|
-
}>>;
|
|
67
|
-
|
|
68
|
-
getNextTask(projectId: string, sessionId?: string): Promise<ApiResponse<{
|
|
69
|
-
task?: {
|
|
70
|
-
id: string;
|
|
71
|
-
title: string;
|
|
72
|
-
description?: string;
|
|
73
|
-
priority: number;
|
|
74
|
-
estimated_minutes?: number;
|
|
75
|
-
blocking?: boolean;
|
|
76
|
-
} | null;
|
|
77
|
-
blocking_task?: boolean;
|
|
78
|
-
deployment_blocks_tasks?: boolean;
|
|
79
|
-
deployment?: {
|
|
80
|
-
id: string;
|
|
81
|
-
status: string;
|
|
82
|
-
env: string;
|
|
83
|
-
};
|
|
84
|
-
awaiting_validation?: Array<{
|
|
85
|
-
id: string;
|
|
86
|
-
title: string;
|
|
87
|
-
}>;
|
|
88
|
-
validation_priority?: string;
|
|
89
|
-
all_claimed?: boolean;
|
|
90
|
-
is_subtask?: boolean;
|
|
91
|
-
suggested_activity?: string;
|
|
92
|
-
directive?: string;
|
|
93
|
-
message?: string;
|
|
94
|
-
action?: string;
|
|
95
|
-
}>>;
|
|
96
|
-
|
|
97
|
-
getTask(taskId: string): Promise<ApiResponse<{
|
|
98
|
-
task: {
|
|
99
|
-
id: string;
|
|
100
|
-
title: string;
|
|
101
|
-
description?: string;
|
|
102
|
-
priority: number;
|
|
103
|
-
status: string;
|
|
104
|
-
progress_percentage?: number;
|
|
105
|
-
estimated_minutes?: number;
|
|
106
|
-
started_at?: string;
|
|
107
|
-
completed_at?: string;
|
|
108
|
-
git_branch?: string;
|
|
109
|
-
blocking?: boolean;
|
|
110
|
-
references?: Array<{ url: string; label?: string }>;
|
|
111
|
-
parent_task_id?: string;
|
|
112
|
-
working_agent_session_id?: string;
|
|
113
|
-
};
|
|
114
|
-
}>>;
|
|
115
|
-
|
|
116
|
-
getTaskById(taskId: string, params?: {
|
|
117
|
-
include_subtasks?: boolean;
|
|
118
|
-
include_milestones?: boolean;
|
|
119
|
-
}): Promise<ApiResponse<{
|
|
120
|
-
task: {
|
|
121
|
-
id: string;
|
|
122
|
-
title: string;
|
|
123
|
-
description?: string;
|
|
124
|
-
priority: number;
|
|
125
|
-
status: string;
|
|
126
|
-
progress_percentage?: number;
|
|
127
|
-
estimated_minutes?: number;
|
|
128
|
-
started_at?: string;
|
|
129
|
-
completed_at?: string;
|
|
130
|
-
git_branch?: string;
|
|
131
|
-
references?: Array<{ url: string; label?: string }>;
|
|
132
|
-
};
|
|
133
|
-
subtasks?: Array<{
|
|
134
|
-
id: string;
|
|
135
|
-
title: string;
|
|
136
|
-
status: string;
|
|
137
|
-
progress_percentage?: number;
|
|
138
|
-
}>;
|
|
139
|
-
milestones?: Array<{
|
|
140
|
-
id: string;
|
|
141
|
-
title: string;
|
|
142
|
-
status: string;
|
|
143
|
-
order_index: number;
|
|
144
|
-
}>;
|
|
145
|
-
}>>;
|
|
146
|
-
|
|
147
|
-
searchTasks(projectId: string, params: {
|
|
148
|
-
query: string;
|
|
149
|
-
status?: string[];
|
|
150
|
-
limit?: number;
|
|
151
|
-
offset?: number;
|
|
152
|
-
}): Promise<ApiResponse<{
|
|
153
|
-
tasks: Array<{
|
|
154
|
-
id: string;
|
|
155
|
-
title: string;
|
|
156
|
-
status: string;
|
|
157
|
-
priority: number;
|
|
158
|
-
snippet?: string;
|
|
159
|
-
}>;
|
|
160
|
-
total_matches: number;
|
|
161
|
-
hint?: string;
|
|
162
|
-
}>>;
|
|
163
|
-
|
|
164
|
-
getTasksByPriority(projectId: string, params?: {
|
|
165
|
-
priority?: number;
|
|
166
|
-
priority_max?: number;
|
|
167
|
-
status?: string;
|
|
168
|
-
limit?: number;
|
|
169
|
-
offset?: number;
|
|
170
|
-
}): Promise<ApiResponse<{
|
|
171
|
-
tasks: Array<{
|
|
172
|
-
id: string;
|
|
173
|
-
title: string;
|
|
174
|
-
priority: number;
|
|
175
|
-
status: string;
|
|
176
|
-
estimated_minutes?: number;
|
|
177
|
-
}>;
|
|
178
|
-
total_count: number;
|
|
179
|
-
}>>;
|
|
180
|
-
|
|
181
|
-
getRecentTasks(projectId: string, params?: {
|
|
182
|
-
order?: 'newest' | 'oldest';
|
|
183
|
-
status?: string;
|
|
184
|
-
limit?: number;
|
|
185
|
-
offset?: number;
|
|
186
|
-
}): Promise<ApiResponse<{
|
|
187
|
-
tasks: Array<{
|
|
188
|
-
id: string;
|
|
189
|
-
title: string;
|
|
190
|
-
status: string;
|
|
191
|
-
priority: number;
|
|
192
|
-
created_at: string;
|
|
193
|
-
age?: string;
|
|
194
|
-
}>;
|
|
195
|
-
total_count: number;
|
|
196
|
-
}>>;
|
|
197
|
-
|
|
198
|
-
getTaskStats(projectId: string): Promise<ApiResponse<{
|
|
199
|
-
total: number;
|
|
200
|
-
by_status: {
|
|
201
|
-
backlog: number;
|
|
202
|
-
pending: number;
|
|
203
|
-
in_progress: number;
|
|
204
|
-
completed: number;
|
|
205
|
-
cancelled: number;
|
|
206
|
-
};
|
|
207
|
-
by_priority: {
|
|
208
|
-
1: number;
|
|
209
|
-
2: number;
|
|
210
|
-
3: number;
|
|
211
|
-
4: number;
|
|
212
|
-
5: number;
|
|
213
|
-
};
|
|
214
|
-
awaiting_validation: number;
|
|
215
|
-
oldest_pending_days: number | null;
|
|
216
|
-
}>>;
|
|
217
|
-
|
|
218
|
-
updateTask(taskId: string, updates: {
|
|
219
|
-
title?: string;
|
|
220
|
-
description?: string;
|
|
221
|
-
priority?: number;
|
|
222
|
-
status?: string;
|
|
223
|
-
progress_percentage?: number;
|
|
224
|
-
progress_note?: string;
|
|
225
|
-
estimated_minutes?: number;
|
|
226
|
-
git_branch?: string;
|
|
227
|
-
worktree_path?: string;
|
|
228
|
-
session_id?: string;
|
|
229
|
-
}): Promise<ApiResponse<{
|
|
230
|
-
success: boolean;
|
|
231
|
-
task_id: string;
|
|
232
|
-
git_workflow?: {
|
|
233
|
-
workflow: string;
|
|
234
|
-
base_branch: string;
|
|
235
|
-
suggested_branch: string;
|
|
236
|
-
worktree_required: boolean;
|
|
237
|
-
};
|
|
238
|
-
worktree_setup?: {
|
|
239
|
-
message: string;
|
|
240
|
-
commands: string[];
|
|
241
|
-
worktree_path: string;
|
|
242
|
-
branch_name: string;
|
|
243
|
-
cleanup_command: string;
|
|
244
|
-
};
|
|
245
|
-
next_step?: string;
|
|
246
|
-
}>>;
|
|
247
|
-
|
|
248
|
-
completeTask(taskId: string, params: {
|
|
249
|
-
summary?: string;
|
|
250
|
-
session_id?: string;
|
|
251
|
-
}): Promise<ApiResponse<{
|
|
252
|
-
success: boolean;
|
|
253
|
-
directive: string;
|
|
254
|
-
auto_continue: boolean;
|
|
255
|
-
completed_task_id: string;
|
|
256
|
-
next_task?: {
|
|
257
|
-
id: string;
|
|
258
|
-
title: string;
|
|
259
|
-
priority: number;
|
|
260
|
-
estimated_minutes?: number;
|
|
261
|
-
} | null;
|
|
262
|
-
context?: {
|
|
263
|
-
validation?: number;
|
|
264
|
-
blockers?: number;
|
|
265
|
-
deployment?: string;
|
|
266
|
-
worktree_path?: string;
|
|
267
|
-
};
|
|
268
|
-
next_action: string;
|
|
269
|
-
warnings?: string[];
|
|
270
|
-
}>>;
|
|
271
|
-
|
|
272
|
-
deleteTask(taskId: string): Promise<ApiResponse<{
|
|
273
|
-
success: boolean;
|
|
274
|
-
deleted_id: string;
|
|
275
|
-
}>>;
|
|
276
|
-
|
|
277
|
-
releaseTask(taskId: string, params?: {
|
|
278
|
-
reason?: string;
|
|
279
|
-
session_id?: string;
|
|
280
|
-
}): Promise<ApiResponse<{
|
|
281
|
-
success: boolean;
|
|
282
|
-
task_id: string;
|
|
283
|
-
message: string;
|
|
284
|
-
reason?: string;
|
|
285
|
-
hint: string;
|
|
286
|
-
}>>;
|
|
287
|
-
|
|
288
|
-
cancelTask(taskId: string, params?: {
|
|
289
|
-
cancelled_reason?: 'pr_closed' | 'superseded' | 'user_cancelled' | 'validation_failed' | 'obsolete' | 'blocked';
|
|
290
|
-
cancellation_note?: string;
|
|
291
|
-
session_id?: string;
|
|
292
|
-
}): Promise<ApiResponse<{
|
|
293
|
-
success: boolean;
|
|
294
|
-
task_id: string;
|
|
295
|
-
cancelled_reason: string | null;
|
|
296
|
-
message: string;
|
|
297
|
-
}>>;
|
|
298
|
-
|
|
299
|
-
addTaskReference(taskId: string, url: string, label?: string): Promise<ApiResponse<{
|
|
300
|
-
success: boolean;
|
|
301
|
-
task_id: string;
|
|
302
|
-
reference: { url: string; label?: string };
|
|
303
|
-
}>>;
|
|
304
|
-
|
|
305
|
-
removeTaskReference(taskId: string, url: string): Promise<ApiResponse<{
|
|
306
|
-
success: boolean;
|
|
307
|
-
task_id: string;
|
|
308
|
-
}>>;
|
|
309
|
-
|
|
310
|
-
batchUpdateTasks(updates: Array<{
|
|
311
|
-
task_id: string;
|
|
312
|
-
priority?: number;
|
|
313
|
-
status?: string;
|
|
314
|
-
progress_percentage?: number;
|
|
315
|
-
}>): Promise<ApiResponse<{
|
|
316
|
-
success: boolean;
|
|
317
|
-
updated_count: number;
|
|
318
|
-
results: Array<{ task_id: string; success: boolean; error?: string }>;
|
|
319
|
-
}>>;
|
|
320
|
-
|
|
321
|
-
batchCompleteTasks(completions: Array<{
|
|
322
|
-
task_id: string;
|
|
323
|
-
summary?: string;
|
|
324
|
-
}>): Promise<ApiResponse<{
|
|
325
|
-
success: boolean;
|
|
326
|
-
completed_count: number;
|
|
327
|
-
results: Array<{ task_id: string; success: boolean; error?: string }>;
|
|
328
|
-
}>>;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
export function createTasksMethods(request: RequestFn, proxy: ProxyFn): TasksMethods {
|
|
332
|
-
return {
|
|
333
|
-
async getTasks(projectId, params) {
|
|
334
|
-
const queryParams = new URLSearchParams();
|
|
335
|
-
if (params?.status) queryParams.set('status', params.status);
|
|
336
|
-
if (params?.limit) queryParams.set('limit', params.limit.toString());
|
|
337
|
-
if (params?.offset) queryParams.set('offset', params.offset.toString());
|
|
338
|
-
if (params?.include_subtasks) queryParams.set('include_subtasks', 'true');
|
|
339
|
-
if (params?.search_query) queryParams.set('search_query', params.search_query);
|
|
340
|
-
if (params?.include_metadata) queryParams.set('include_metadata', 'true');
|
|
341
|
-
const query = queryParams.toString();
|
|
342
|
-
const url = `/api/mcp/projects/${projectId}/tasks${query ? `?${query}` : ''}`;
|
|
343
|
-
return request('GET', url);
|
|
344
|
-
},
|
|
345
|
-
|
|
346
|
-
async createTask(projectId, params) {
|
|
347
|
-
return request('POST', `/api/mcp/projects/${projectId}/tasks`, params);
|
|
348
|
-
},
|
|
349
|
-
|
|
350
|
-
async getNextTask(projectId, sessionId) {
|
|
351
|
-
const url = sessionId
|
|
352
|
-
? `/api/mcp/projects/${projectId}/next-task?session_id=${sessionId}`
|
|
353
|
-
: `/api/mcp/projects/${projectId}/next-task`;
|
|
354
|
-
return request('GET', url);
|
|
355
|
-
},
|
|
356
|
-
|
|
357
|
-
async getTask(taskId) {
|
|
358
|
-
return request('GET', `/api/mcp/tasks/${taskId}`);
|
|
359
|
-
},
|
|
360
|
-
|
|
361
|
-
async getTaskById(taskId, params) {
|
|
362
|
-
return proxy('get_task', {
|
|
363
|
-
task_id: taskId,
|
|
364
|
-
include_subtasks: params?.include_subtasks,
|
|
365
|
-
include_milestones: params?.include_milestones,
|
|
366
|
-
});
|
|
367
|
-
},
|
|
368
|
-
|
|
369
|
-
async searchTasks(projectId, params) {
|
|
370
|
-
return proxy('search_tasks', {
|
|
371
|
-
project_id: projectId,
|
|
372
|
-
query: params.query,
|
|
373
|
-
status: params.status,
|
|
374
|
-
limit: params.limit,
|
|
375
|
-
offset: params.offset,
|
|
376
|
-
});
|
|
377
|
-
},
|
|
378
|
-
|
|
379
|
-
async getTasksByPriority(projectId, params) {
|
|
380
|
-
return proxy('get_tasks_by_priority', {
|
|
381
|
-
project_id: projectId,
|
|
382
|
-
priority: params?.priority,
|
|
383
|
-
priority_max: params?.priority_max,
|
|
384
|
-
status: params?.status,
|
|
385
|
-
limit: params?.limit,
|
|
386
|
-
offset: params?.offset,
|
|
387
|
-
});
|
|
388
|
-
},
|
|
389
|
-
|
|
390
|
-
async getRecentTasks(projectId, params) {
|
|
391
|
-
return proxy('get_recent_tasks', {
|
|
392
|
-
project_id: projectId,
|
|
393
|
-
order: params?.order,
|
|
394
|
-
status: params?.status,
|
|
395
|
-
limit: params?.limit,
|
|
396
|
-
offset: params?.offset,
|
|
397
|
-
});
|
|
398
|
-
},
|
|
399
|
-
|
|
400
|
-
async getTaskStats(projectId) {
|
|
401
|
-
return proxy('get_task_stats', { project_id: projectId });
|
|
402
|
-
},
|
|
403
|
-
|
|
404
|
-
async updateTask(taskId, updates) {
|
|
405
|
-
return request('PATCH', `/api/mcp/tasks/${taskId}`, updates);
|
|
406
|
-
},
|
|
407
|
-
|
|
408
|
-
async completeTask(taskId, params) {
|
|
409
|
-
return proxy('complete_task', {
|
|
410
|
-
task_id: taskId,
|
|
411
|
-
summary: params.summary,
|
|
412
|
-
}, params.session_id ? { session_id: params.session_id } : undefined);
|
|
413
|
-
},
|
|
414
|
-
|
|
415
|
-
async deleteTask(taskId) {
|
|
416
|
-
return request('DELETE', `/api/mcp/tasks/${taskId}`);
|
|
417
|
-
},
|
|
418
|
-
|
|
419
|
-
async releaseTask(taskId, params) {
|
|
420
|
-
return proxy('release_task', {
|
|
421
|
-
task_id: taskId,
|
|
422
|
-
reason: params?.reason,
|
|
423
|
-
}, params?.session_id ? { session_id: params.session_id } : undefined);
|
|
424
|
-
},
|
|
425
|
-
|
|
426
|
-
async cancelTask(taskId, params) {
|
|
427
|
-
return proxy('cancel_task', {
|
|
428
|
-
task_id: taskId,
|
|
429
|
-
cancelled_reason: params?.cancelled_reason,
|
|
430
|
-
cancellation_note: params?.cancellation_note,
|
|
431
|
-
}, params?.session_id ? { session_id: params.session_id } : undefined);
|
|
432
|
-
},
|
|
433
|
-
|
|
434
|
-
async addTaskReference(taskId, url, label) {
|
|
435
|
-
return proxy('add_task_reference', { task_id: taskId, url, label });
|
|
436
|
-
},
|
|
437
|
-
|
|
438
|
-
async removeTaskReference(taskId, url) {
|
|
439
|
-
return proxy('remove_task_reference', { task_id: taskId, url });
|
|
440
|
-
},
|
|
441
|
-
|
|
442
|
-
async batchUpdateTasks(updates) {
|
|
443
|
-
return proxy('batch_update_tasks', { updates });
|
|
444
|
-
},
|
|
445
|
-
|
|
446
|
-
async batchCompleteTasks(completions) {
|
|
447
|
-
return proxy('batch_complete_tasks', { completions });
|
|
448
|
-
}
|
|
449
|
-
};
|
|
450
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Tasks API Methods
|
|
3
|
+
*
|
|
4
|
+
* Methods for task management:
|
|
5
|
+
* - getTasks: List tasks for a project
|
|
6
|
+
* - createTask: Create a new task
|
|
7
|
+
* - getNextTask: Get highest priority pending task
|
|
8
|
+
* - getTask: Get a single task
|
|
9
|
+
* - getTaskById: Get task with optional subtasks/milestones
|
|
10
|
+
* - searchTasks: Search tasks by text query
|
|
11
|
+
* - getTasksByPriority: Get tasks filtered by priority
|
|
12
|
+
* - getRecentTasks: Get recently created/modified tasks
|
|
13
|
+
* - getTaskStats: Get task statistics
|
|
14
|
+
* - updateTask: Update task details
|
|
15
|
+
* - completeTask: Mark task as completed
|
|
16
|
+
* - deleteTask: Delete a task
|
|
17
|
+
* - releaseTask: Release task back to pending
|
|
18
|
+
* - cancelTask: Cancel a task
|
|
19
|
+
* - addTaskReference: Add reference URL to task
|
|
20
|
+
* - removeTaskReference: Remove reference from task
|
|
21
|
+
* - batchUpdateTasks: Update multiple tasks
|
|
22
|
+
* - batchCompleteTasks: Complete multiple tasks
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import type { ApiResponse, RequestFn, ProxyFn } from './types.js';
|
|
26
|
+
|
|
27
|
+
export interface TasksMethods {
|
|
28
|
+
getTasks(projectId: string, params?: {
|
|
29
|
+
status?: string;
|
|
30
|
+
limit?: number;
|
|
31
|
+
offset?: number;
|
|
32
|
+
include_subtasks?: boolean;
|
|
33
|
+
search_query?: string;
|
|
34
|
+
include_metadata?: boolean;
|
|
35
|
+
}): Promise<ApiResponse<{
|
|
36
|
+
tasks: Array<{
|
|
37
|
+
id: string;
|
|
38
|
+
title: string;
|
|
39
|
+
description?: string;
|
|
40
|
+
priority: number;
|
|
41
|
+
status: string;
|
|
42
|
+
progress_percentage?: number;
|
|
43
|
+
estimated_minutes?: number;
|
|
44
|
+
started_at?: string;
|
|
45
|
+
completed_at?: string;
|
|
46
|
+
parent_task_id?: string;
|
|
47
|
+
}>;
|
|
48
|
+
total_count: number;
|
|
49
|
+
has_more: boolean;
|
|
50
|
+
}>>;
|
|
51
|
+
|
|
52
|
+
createTask(projectId: string, params: {
|
|
53
|
+
title: string;
|
|
54
|
+
description?: string;
|
|
55
|
+
priority?: number;
|
|
56
|
+
estimated_minutes?: number;
|
|
57
|
+
blocking?: boolean;
|
|
58
|
+
session_id?: string;
|
|
59
|
+
task_type?: string;
|
|
60
|
+
}): Promise<ApiResponse<{
|
|
61
|
+
success: boolean;
|
|
62
|
+
task_id: string;
|
|
63
|
+
title: string;
|
|
64
|
+
blocking?: boolean;
|
|
65
|
+
message?: string;
|
|
66
|
+
}>>;
|
|
67
|
+
|
|
68
|
+
getNextTask(projectId: string, sessionId?: string): Promise<ApiResponse<{
|
|
69
|
+
task?: {
|
|
70
|
+
id: string;
|
|
71
|
+
title: string;
|
|
72
|
+
description?: string;
|
|
73
|
+
priority: number;
|
|
74
|
+
estimated_minutes?: number;
|
|
75
|
+
blocking?: boolean;
|
|
76
|
+
} | null;
|
|
77
|
+
blocking_task?: boolean;
|
|
78
|
+
deployment_blocks_tasks?: boolean;
|
|
79
|
+
deployment?: {
|
|
80
|
+
id: string;
|
|
81
|
+
status: string;
|
|
82
|
+
env: string;
|
|
83
|
+
};
|
|
84
|
+
awaiting_validation?: Array<{
|
|
85
|
+
id: string;
|
|
86
|
+
title: string;
|
|
87
|
+
}>;
|
|
88
|
+
validation_priority?: string;
|
|
89
|
+
all_claimed?: boolean;
|
|
90
|
+
is_subtask?: boolean;
|
|
91
|
+
suggested_activity?: string;
|
|
92
|
+
directive?: string;
|
|
93
|
+
message?: string;
|
|
94
|
+
action?: string;
|
|
95
|
+
}>>;
|
|
96
|
+
|
|
97
|
+
getTask(taskId: string): Promise<ApiResponse<{
|
|
98
|
+
task: {
|
|
99
|
+
id: string;
|
|
100
|
+
title: string;
|
|
101
|
+
description?: string;
|
|
102
|
+
priority: number;
|
|
103
|
+
status: string;
|
|
104
|
+
progress_percentage?: number;
|
|
105
|
+
estimated_minutes?: number;
|
|
106
|
+
started_at?: string;
|
|
107
|
+
completed_at?: string;
|
|
108
|
+
git_branch?: string;
|
|
109
|
+
blocking?: boolean;
|
|
110
|
+
references?: Array<{ url: string; label?: string }>;
|
|
111
|
+
parent_task_id?: string;
|
|
112
|
+
working_agent_session_id?: string;
|
|
113
|
+
};
|
|
114
|
+
}>>;
|
|
115
|
+
|
|
116
|
+
getTaskById(taskId: string, params?: {
|
|
117
|
+
include_subtasks?: boolean;
|
|
118
|
+
include_milestones?: boolean;
|
|
119
|
+
}): Promise<ApiResponse<{
|
|
120
|
+
task: {
|
|
121
|
+
id: string;
|
|
122
|
+
title: string;
|
|
123
|
+
description?: string;
|
|
124
|
+
priority: number;
|
|
125
|
+
status: string;
|
|
126
|
+
progress_percentage?: number;
|
|
127
|
+
estimated_minutes?: number;
|
|
128
|
+
started_at?: string;
|
|
129
|
+
completed_at?: string;
|
|
130
|
+
git_branch?: string;
|
|
131
|
+
references?: Array<{ url: string; label?: string }>;
|
|
132
|
+
};
|
|
133
|
+
subtasks?: Array<{
|
|
134
|
+
id: string;
|
|
135
|
+
title: string;
|
|
136
|
+
status: string;
|
|
137
|
+
progress_percentage?: number;
|
|
138
|
+
}>;
|
|
139
|
+
milestones?: Array<{
|
|
140
|
+
id: string;
|
|
141
|
+
title: string;
|
|
142
|
+
status: string;
|
|
143
|
+
order_index: number;
|
|
144
|
+
}>;
|
|
145
|
+
}>>;
|
|
146
|
+
|
|
147
|
+
searchTasks(projectId: string, params: {
|
|
148
|
+
query: string;
|
|
149
|
+
status?: string[];
|
|
150
|
+
limit?: number;
|
|
151
|
+
offset?: number;
|
|
152
|
+
}): Promise<ApiResponse<{
|
|
153
|
+
tasks: Array<{
|
|
154
|
+
id: string;
|
|
155
|
+
title: string;
|
|
156
|
+
status: string;
|
|
157
|
+
priority: number;
|
|
158
|
+
snippet?: string;
|
|
159
|
+
}>;
|
|
160
|
+
total_matches: number;
|
|
161
|
+
hint?: string;
|
|
162
|
+
}>>;
|
|
163
|
+
|
|
164
|
+
getTasksByPriority(projectId: string, params?: {
|
|
165
|
+
priority?: number;
|
|
166
|
+
priority_max?: number;
|
|
167
|
+
status?: string;
|
|
168
|
+
limit?: number;
|
|
169
|
+
offset?: number;
|
|
170
|
+
}): Promise<ApiResponse<{
|
|
171
|
+
tasks: Array<{
|
|
172
|
+
id: string;
|
|
173
|
+
title: string;
|
|
174
|
+
priority: number;
|
|
175
|
+
status: string;
|
|
176
|
+
estimated_minutes?: number;
|
|
177
|
+
}>;
|
|
178
|
+
total_count: number;
|
|
179
|
+
}>>;
|
|
180
|
+
|
|
181
|
+
getRecentTasks(projectId: string, params?: {
|
|
182
|
+
order?: 'newest' | 'oldest';
|
|
183
|
+
status?: string;
|
|
184
|
+
limit?: number;
|
|
185
|
+
offset?: number;
|
|
186
|
+
}): Promise<ApiResponse<{
|
|
187
|
+
tasks: Array<{
|
|
188
|
+
id: string;
|
|
189
|
+
title: string;
|
|
190
|
+
status: string;
|
|
191
|
+
priority: number;
|
|
192
|
+
created_at: string;
|
|
193
|
+
age?: string;
|
|
194
|
+
}>;
|
|
195
|
+
total_count: number;
|
|
196
|
+
}>>;
|
|
197
|
+
|
|
198
|
+
getTaskStats(projectId: string): Promise<ApiResponse<{
|
|
199
|
+
total: number;
|
|
200
|
+
by_status: {
|
|
201
|
+
backlog: number;
|
|
202
|
+
pending: number;
|
|
203
|
+
in_progress: number;
|
|
204
|
+
completed: number;
|
|
205
|
+
cancelled: number;
|
|
206
|
+
};
|
|
207
|
+
by_priority: {
|
|
208
|
+
1: number;
|
|
209
|
+
2: number;
|
|
210
|
+
3: number;
|
|
211
|
+
4: number;
|
|
212
|
+
5: number;
|
|
213
|
+
};
|
|
214
|
+
awaiting_validation: number;
|
|
215
|
+
oldest_pending_days: number | null;
|
|
216
|
+
}>>;
|
|
217
|
+
|
|
218
|
+
updateTask(taskId: string, updates: {
|
|
219
|
+
title?: string;
|
|
220
|
+
description?: string;
|
|
221
|
+
priority?: number;
|
|
222
|
+
status?: string;
|
|
223
|
+
progress_percentage?: number;
|
|
224
|
+
progress_note?: string;
|
|
225
|
+
estimated_minutes?: number;
|
|
226
|
+
git_branch?: string;
|
|
227
|
+
worktree_path?: string;
|
|
228
|
+
session_id?: string;
|
|
229
|
+
}): Promise<ApiResponse<{
|
|
230
|
+
success: boolean;
|
|
231
|
+
task_id: string;
|
|
232
|
+
git_workflow?: {
|
|
233
|
+
workflow: string;
|
|
234
|
+
base_branch: string;
|
|
235
|
+
suggested_branch: string;
|
|
236
|
+
worktree_required: boolean;
|
|
237
|
+
};
|
|
238
|
+
worktree_setup?: {
|
|
239
|
+
message: string;
|
|
240
|
+
commands: string[];
|
|
241
|
+
worktree_path: string;
|
|
242
|
+
branch_name: string;
|
|
243
|
+
cleanup_command: string;
|
|
244
|
+
};
|
|
245
|
+
next_step?: string;
|
|
246
|
+
}>>;
|
|
247
|
+
|
|
248
|
+
completeTask(taskId: string, params: {
|
|
249
|
+
summary?: string;
|
|
250
|
+
session_id?: string;
|
|
251
|
+
}): Promise<ApiResponse<{
|
|
252
|
+
success: boolean;
|
|
253
|
+
directive: string;
|
|
254
|
+
auto_continue: boolean;
|
|
255
|
+
completed_task_id: string;
|
|
256
|
+
next_task?: {
|
|
257
|
+
id: string;
|
|
258
|
+
title: string;
|
|
259
|
+
priority: number;
|
|
260
|
+
estimated_minutes?: number;
|
|
261
|
+
} | null;
|
|
262
|
+
context?: {
|
|
263
|
+
validation?: number;
|
|
264
|
+
blockers?: number;
|
|
265
|
+
deployment?: string;
|
|
266
|
+
worktree_path?: string;
|
|
267
|
+
};
|
|
268
|
+
next_action: string;
|
|
269
|
+
warnings?: string[];
|
|
270
|
+
}>>;
|
|
271
|
+
|
|
272
|
+
deleteTask(taskId: string): Promise<ApiResponse<{
|
|
273
|
+
success: boolean;
|
|
274
|
+
deleted_id: string;
|
|
275
|
+
}>>;
|
|
276
|
+
|
|
277
|
+
releaseTask(taskId: string, params?: {
|
|
278
|
+
reason?: string;
|
|
279
|
+
session_id?: string;
|
|
280
|
+
}): Promise<ApiResponse<{
|
|
281
|
+
success: boolean;
|
|
282
|
+
task_id: string;
|
|
283
|
+
message: string;
|
|
284
|
+
reason?: string;
|
|
285
|
+
hint: string;
|
|
286
|
+
}>>;
|
|
287
|
+
|
|
288
|
+
cancelTask(taskId: string, params?: {
|
|
289
|
+
cancelled_reason?: 'pr_closed' | 'superseded' | 'user_cancelled' | 'validation_failed' | 'obsolete' | 'blocked';
|
|
290
|
+
cancellation_note?: string;
|
|
291
|
+
session_id?: string;
|
|
292
|
+
}): Promise<ApiResponse<{
|
|
293
|
+
success: boolean;
|
|
294
|
+
task_id: string;
|
|
295
|
+
cancelled_reason: string | null;
|
|
296
|
+
message: string;
|
|
297
|
+
}>>;
|
|
298
|
+
|
|
299
|
+
addTaskReference(taskId: string, url: string, label?: string): Promise<ApiResponse<{
|
|
300
|
+
success: boolean;
|
|
301
|
+
task_id: string;
|
|
302
|
+
reference: { url: string; label?: string };
|
|
303
|
+
}>>;
|
|
304
|
+
|
|
305
|
+
removeTaskReference(taskId: string, url: string): Promise<ApiResponse<{
|
|
306
|
+
success: boolean;
|
|
307
|
+
task_id: string;
|
|
308
|
+
}>>;
|
|
309
|
+
|
|
310
|
+
batchUpdateTasks(updates: Array<{
|
|
311
|
+
task_id: string;
|
|
312
|
+
priority?: number;
|
|
313
|
+
status?: string;
|
|
314
|
+
progress_percentage?: number;
|
|
315
|
+
}>): Promise<ApiResponse<{
|
|
316
|
+
success: boolean;
|
|
317
|
+
updated_count: number;
|
|
318
|
+
results: Array<{ task_id: string; success: boolean; error?: string }>;
|
|
319
|
+
}>>;
|
|
320
|
+
|
|
321
|
+
batchCompleteTasks(completions: Array<{
|
|
322
|
+
task_id: string;
|
|
323
|
+
summary?: string;
|
|
324
|
+
}>): Promise<ApiResponse<{
|
|
325
|
+
success: boolean;
|
|
326
|
+
completed_count: number;
|
|
327
|
+
results: Array<{ task_id: string; success: boolean; error?: string }>;
|
|
328
|
+
}>>;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
export function createTasksMethods(request: RequestFn, proxy: ProxyFn): TasksMethods {
|
|
332
|
+
return {
|
|
333
|
+
async getTasks(projectId, params) {
|
|
334
|
+
const queryParams = new URLSearchParams();
|
|
335
|
+
if (params?.status) queryParams.set('status', params.status);
|
|
336
|
+
if (params?.limit) queryParams.set('limit', params.limit.toString());
|
|
337
|
+
if (params?.offset) queryParams.set('offset', params.offset.toString());
|
|
338
|
+
if (params?.include_subtasks) queryParams.set('include_subtasks', 'true');
|
|
339
|
+
if (params?.search_query) queryParams.set('search_query', params.search_query);
|
|
340
|
+
if (params?.include_metadata) queryParams.set('include_metadata', 'true');
|
|
341
|
+
const query = queryParams.toString();
|
|
342
|
+
const url = `/api/mcp/projects/${projectId}/tasks${query ? `?${query}` : ''}`;
|
|
343
|
+
return request('GET', url);
|
|
344
|
+
},
|
|
345
|
+
|
|
346
|
+
async createTask(projectId, params) {
|
|
347
|
+
return request('POST', `/api/mcp/projects/${projectId}/tasks`, params);
|
|
348
|
+
},
|
|
349
|
+
|
|
350
|
+
async getNextTask(projectId, sessionId) {
|
|
351
|
+
const url = sessionId
|
|
352
|
+
? `/api/mcp/projects/${projectId}/next-task?session_id=${sessionId}`
|
|
353
|
+
: `/api/mcp/projects/${projectId}/next-task`;
|
|
354
|
+
return request('GET', url);
|
|
355
|
+
},
|
|
356
|
+
|
|
357
|
+
async getTask(taskId) {
|
|
358
|
+
return request('GET', `/api/mcp/tasks/${taskId}`);
|
|
359
|
+
},
|
|
360
|
+
|
|
361
|
+
async getTaskById(taskId, params) {
|
|
362
|
+
return proxy('get_task', {
|
|
363
|
+
task_id: taskId,
|
|
364
|
+
include_subtasks: params?.include_subtasks,
|
|
365
|
+
include_milestones: params?.include_milestones,
|
|
366
|
+
});
|
|
367
|
+
},
|
|
368
|
+
|
|
369
|
+
async searchTasks(projectId, params) {
|
|
370
|
+
return proxy('search_tasks', {
|
|
371
|
+
project_id: projectId,
|
|
372
|
+
query: params.query,
|
|
373
|
+
status: params.status,
|
|
374
|
+
limit: params.limit,
|
|
375
|
+
offset: params.offset,
|
|
376
|
+
});
|
|
377
|
+
},
|
|
378
|
+
|
|
379
|
+
async getTasksByPriority(projectId, params) {
|
|
380
|
+
return proxy('get_tasks_by_priority', {
|
|
381
|
+
project_id: projectId,
|
|
382
|
+
priority: params?.priority,
|
|
383
|
+
priority_max: params?.priority_max,
|
|
384
|
+
status: params?.status,
|
|
385
|
+
limit: params?.limit,
|
|
386
|
+
offset: params?.offset,
|
|
387
|
+
});
|
|
388
|
+
},
|
|
389
|
+
|
|
390
|
+
async getRecentTasks(projectId, params) {
|
|
391
|
+
return proxy('get_recent_tasks', {
|
|
392
|
+
project_id: projectId,
|
|
393
|
+
order: params?.order,
|
|
394
|
+
status: params?.status,
|
|
395
|
+
limit: params?.limit,
|
|
396
|
+
offset: params?.offset,
|
|
397
|
+
});
|
|
398
|
+
},
|
|
399
|
+
|
|
400
|
+
async getTaskStats(projectId) {
|
|
401
|
+
return proxy('get_task_stats', { project_id: projectId });
|
|
402
|
+
},
|
|
403
|
+
|
|
404
|
+
async updateTask(taskId, updates) {
|
|
405
|
+
return request('PATCH', `/api/mcp/tasks/${taskId}`, updates);
|
|
406
|
+
},
|
|
407
|
+
|
|
408
|
+
async completeTask(taskId, params) {
|
|
409
|
+
return proxy('complete_task', {
|
|
410
|
+
task_id: taskId,
|
|
411
|
+
summary: params.summary,
|
|
412
|
+
}, params.session_id ? { session_id: params.session_id } : undefined);
|
|
413
|
+
},
|
|
414
|
+
|
|
415
|
+
async deleteTask(taskId) {
|
|
416
|
+
return request('DELETE', `/api/mcp/tasks/${taskId}`);
|
|
417
|
+
},
|
|
418
|
+
|
|
419
|
+
async releaseTask(taskId, params) {
|
|
420
|
+
return proxy('release_task', {
|
|
421
|
+
task_id: taskId,
|
|
422
|
+
reason: params?.reason,
|
|
423
|
+
}, params?.session_id ? { session_id: params.session_id } : undefined);
|
|
424
|
+
},
|
|
425
|
+
|
|
426
|
+
async cancelTask(taskId, params) {
|
|
427
|
+
return proxy('cancel_task', {
|
|
428
|
+
task_id: taskId,
|
|
429
|
+
cancelled_reason: params?.cancelled_reason,
|
|
430
|
+
cancellation_note: params?.cancellation_note,
|
|
431
|
+
}, params?.session_id ? { session_id: params.session_id } : undefined);
|
|
432
|
+
},
|
|
433
|
+
|
|
434
|
+
async addTaskReference(taskId, url, label) {
|
|
435
|
+
return proxy('add_task_reference', { task_id: taskId, url, label });
|
|
436
|
+
},
|
|
437
|
+
|
|
438
|
+
async removeTaskReference(taskId, url) {
|
|
439
|
+
return proxy('remove_task_reference', { task_id: taskId, url });
|
|
440
|
+
},
|
|
441
|
+
|
|
442
|
+
async batchUpdateTasks(updates) {
|
|
443
|
+
return proxy('batch_update_tasks', { updates });
|
|
444
|
+
},
|
|
445
|
+
|
|
446
|
+
async batchCompleteTasks(completions) {
|
|
447
|
+
return proxy('batch_complete_tasks', { completions });
|
|
448
|
+
}
|
|
449
|
+
};
|
|
450
|
+
}
|