motionmcp 2.2.3 → 2.3.0
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/README.md +1 -1
- package/dist/handlers/ProjectHandler.js +4 -4
- package/dist/handlers/ProjectHandler.js.map +1 -1
- package/dist/handlers/RecurringTaskHandler.js +2 -2
- package/dist/handlers/RecurringTaskHandler.js.map +1 -1
- package/dist/handlers/SearchHandler.d.ts.map +1 -1
- package/dist/handlers/SearchHandler.js +20 -4
- package/dist/handlers/SearchHandler.js.map +1 -1
- package/dist/handlers/TaskHandler.d.ts.map +1 -1
- package/dist/handlers/TaskHandler.js +6 -4
- package/dist/handlers/TaskHandler.js.map +1 -1
- package/dist/mcp-server.js +1 -1
- package/dist/mcp-server.js.map +1 -1
- package/dist/schemas/motion.d.ts +313 -4259
- package/dist/schemas/motion.d.ts.map +1 -1
- package/dist/services/motionApi.d.ts +8 -7
- package/dist/services/motionApi.d.ts.map +1 -1
- package/dist/services/motionApi.js +160 -114
- package/dist/services/motionApi.js.map +1 -1
- package/dist/types/mcp.d.ts +10 -0
- package/dist/types/mcp.d.ts.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/paginationNew.d.ts +2 -0
- package/dist/utils/paginationNew.d.ts.map +1 -1
- package/dist/utils/paginationNew.js +10 -1
- package/dist/utils/paginationNew.js.map +1 -1
- package/dist/utils/responseFormatters.d.ts +9 -1
- package/dist/utils/responseFormatters.d.ts.map +1 -1
- package/dist/utils/responseFormatters.js +33 -7
- package/dist/utils/responseFormatters.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"motion.d.ts","sourceRoot":"","sources":["../../src/schemas/motion.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,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,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACzE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AACnE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AACnE,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACzE,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACjF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AACrF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAC3E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACvE,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAGvF,eAAO,MAAM,iBAAiB;;;;CAW7B,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { MotionWorkspace, MotionProject, MotionTask, MotionUser, MotionComment, CreateCommentData, MotionCustomField, CreateCustomFieldData, MotionRecurringTask, CreateRecurringTaskData, MotionSchedule, MotionStatus, MotionPaginatedResponse } from '../types/motion';
|
|
2
2
|
import { ValidPriority } from '../utils/constants';
|
|
3
|
+
import { ListResult } from '../types/mcp';
|
|
3
4
|
interface GetTasksOptions {
|
|
4
5
|
workspaceId: string;
|
|
5
6
|
projectId?: string;
|
|
@@ -48,13 +49,13 @@ export declare class MotionApiService {
|
|
|
48
49
|
getProjects(workspaceId: string, options?: {
|
|
49
50
|
maxPages?: number;
|
|
50
51
|
limit?: number;
|
|
51
|
-
}): Promise<MotionProject
|
|
52
|
-
getAllProjects(): Promise<MotionProject
|
|
52
|
+
}): Promise<ListResult<MotionProject>>;
|
|
53
|
+
getAllProjects(): Promise<ListResult<MotionProject>>;
|
|
53
54
|
getProject(projectId: string): Promise<MotionProject>;
|
|
54
55
|
createProject(projectData: Partial<MotionProject>): Promise<MotionProject>;
|
|
55
56
|
updateProject(projectId: string, updates: Partial<MotionProject>): Promise<MotionProject>;
|
|
56
57
|
deleteProject(projectId: string): Promise<void>;
|
|
57
|
-
getTasks(options: GetTasksOptions): Promise<MotionTask
|
|
58
|
+
getTasks(options: GetTasksOptions): Promise<ListResult<MotionTask>>;
|
|
58
59
|
getTask(taskId: string): Promise<MotionTask>;
|
|
59
60
|
createTask(taskData: Partial<MotionTask>): Promise<MotionTask>;
|
|
60
61
|
updateTask(taskId: string, updates: Partial<MotionTask>): Promise<MotionTask>;
|
|
@@ -87,8 +88,8 @@ export declare class MotionApiService {
|
|
|
87
88
|
userName?: string;
|
|
88
89
|
}, workspaceId?: string): Promise<MotionUser | undefined>;
|
|
89
90
|
getProjectByName(projectName: string, workspaceId: string): Promise<MotionProject | undefined>;
|
|
90
|
-
searchTasks(query: string, workspaceId: string, limit?: number): Promise<MotionTask
|
|
91
|
-
searchProjects(query: string, workspaceId: string, limit?: number): Promise<MotionProject
|
|
91
|
+
searchTasks(query: string, workspaceId: string, limit?: number): Promise<ListResult<MotionTask>>;
|
|
92
|
+
searchProjects(query: string, workspaceId: string, limit?: number): Promise<ListResult<MotionProject>>;
|
|
92
93
|
/**
|
|
93
94
|
* Get comments for a task with proper pagination support
|
|
94
95
|
* @param taskId Task ID to get comments for
|
|
@@ -162,7 +163,7 @@ export declare class MotionApiService {
|
|
|
162
163
|
getRecurringTasks(workspaceId?: string, options?: {
|
|
163
164
|
maxPages?: number;
|
|
164
165
|
limit?: number;
|
|
165
|
-
}): Promise<MotionRecurringTask
|
|
166
|
+
}): Promise<ListResult<MotionRecurringTask>>;
|
|
166
167
|
/**
|
|
167
168
|
* Create a new recurring task
|
|
168
169
|
* @param taskData - Data for creating the recurring task
|
|
@@ -202,7 +203,7 @@ export declare class MotionApiService {
|
|
|
202
203
|
* Get all uncompleted tasks across all workspaces and projects
|
|
203
204
|
* Filters tasks where status.isResolvedStatus is false or undefined
|
|
204
205
|
*/
|
|
205
|
-
getAllUncompletedTasks(limit?: number, assigneeId?: string): Promise<MotionTask
|
|
206
|
+
getAllUncompletedTasks(limit?: number, assigneeId?: string): Promise<ListResult<MotionTask>>;
|
|
206
207
|
}
|
|
207
208
|
export {};
|
|
208
209
|
//# sourceMappingURL=motionApi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"motionApi.d.ts","sourceRoot":"","sources":["../../src/services/motionApi.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EACf,aAAa,EACb,UAAU,EACV,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,EACd,YAAY,EAIZ,uBAAuB,EACxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAqE,aAAa,EAAc,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"motionApi.d.ts","sourceRoot":"","sources":["../../src/services/motionApi.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EACf,aAAa,EACb,UAAU,EACV,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,EACd,YAAY,EAIZ,uBAAuB,EACxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAqE,aAAa,EAAc,MAAM,oBAAoB,CAAC;AAMlI,OAAO,EAAkB,UAAU,EAAE,MAAM,cAAc,CAAC;AAoB1D,UAAU,eAAe;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IAC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C,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAyDhE;;;OAGG;IACG,sBAAsB,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;CAuGnG"}
|
|
@@ -230,70 +230,77 @@ class MotionApiService {
|
|
|
230
230
|
throw new Error('limit must be a non-negative integer');
|
|
231
231
|
}
|
|
232
232
|
const cacheKey = `projects:workspace:${workspaceId}`;
|
|
233
|
-
return
|
|
233
|
+
// Check cache - return items only (no stale truncation info)
|
|
234
|
+
const cachedItems = this.projectCache.get(cacheKey);
|
|
235
|
+
if (cachedItems !== null) {
|
|
236
|
+
return { items: cachedItems };
|
|
237
|
+
}
|
|
238
|
+
try {
|
|
239
|
+
(0, logger_1.mcpLog)(constants_1.LOG_LEVELS.DEBUG, 'Fetching projects from Motion API', {
|
|
240
|
+
method: 'getProjects',
|
|
241
|
+
workspaceId,
|
|
242
|
+
maxPages,
|
|
243
|
+
limit
|
|
244
|
+
});
|
|
245
|
+
// Create a fetch function for potential pagination
|
|
246
|
+
const fetchPage = async (cursor) => {
|
|
247
|
+
const params = new URLSearchParams();
|
|
248
|
+
params.append('workspaceId', workspaceId);
|
|
249
|
+
if (cursor) {
|
|
250
|
+
params.append('cursor', cursor);
|
|
251
|
+
}
|
|
252
|
+
const queryString = params.toString();
|
|
253
|
+
const url = `/projects?${queryString}`;
|
|
254
|
+
return this.requestWithRetry(() => this.client.get(url));
|
|
255
|
+
};
|
|
234
256
|
try {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
workspaceId,
|
|
257
|
+
// Attempt pagination-aware fetch with new response wrapper
|
|
258
|
+
const paginatedResult = await (0, paginationNew_1.fetchAllPages)(fetchPage, 'projects', {
|
|
238
259
|
maxPages,
|
|
239
|
-
|
|
260
|
+
logProgress: false,
|
|
261
|
+
...(limit ? { maxItems: limit } : {})
|
|
240
262
|
});
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
params.append('workspaceId', workspaceId);
|
|
245
|
-
if (cursor) {
|
|
246
|
-
params.append('cursor', cursor);
|
|
247
|
-
}
|
|
248
|
-
const queryString = params.toString();
|
|
249
|
-
const url = `/projects?${queryString}`;
|
|
250
|
-
return this.requestWithRetry(() => this.client.get(url));
|
|
251
|
-
};
|
|
252
|
-
try {
|
|
253
|
-
// Attempt pagination-aware fetch with new response wrapper
|
|
254
|
-
const paginatedResult = await (0, paginationNew_1.fetchAllPages)(fetchPage, 'projects', {
|
|
255
|
-
maxPages,
|
|
256
|
-
logProgress: false,
|
|
257
|
-
...(limit ? { maxItems: limit } : {})
|
|
258
|
-
});
|
|
259
|
-
if (paginatedResult.totalFetched > 0) {
|
|
260
|
-
let projects = paginatedResult.items;
|
|
261
|
-
(0, logger_1.mcpLog)(constants_1.LOG_LEVELS.INFO, 'Projects fetched successfully with pagination', {
|
|
262
|
-
method: 'getProjects',
|
|
263
|
-
totalCount: projects.length,
|
|
264
|
-
hasMore: paginatedResult.hasMore,
|
|
265
|
-
workspaceId
|
|
266
|
-
});
|
|
267
|
-
return projects;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
catch (paginationError) {
|
|
271
|
-
(0, logger_1.mcpLog)(constants_1.LOG_LEVELS.DEBUG, 'Pagination failed, falling back to simple fetch', {
|
|
263
|
+
if (paginatedResult.totalFetched > 0) {
|
|
264
|
+
let projects = paginatedResult.items;
|
|
265
|
+
(0, logger_1.mcpLog)(constants_1.LOG_LEVELS.INFO, 'Projects fetched successfully with pagination', {
|
|
272
266
|
method: 'getProjects',
|
|
273
|
-
|
|
267
|
+
totalCount: projects.length,
|
|
268
|
+
hasMore: paginatedResult.hasMore,
|
|
269
|
+
workspaceId
|
|
274
270
|
});
|
|
271
|
+
// Cache only items, not truncation metadata
|
|
272
|
+
this.projectCache.set(cacheKey, projects);
|
|
273
|
+
return { items: projects, truncation: paginatedResult.truncation };
|
|
275
274
|
}
|
|
276
|
-
// Use new response wrapper for single page fallback
|
|
277
|
-
const response = await fetchPage();
|
|
278
|
-
const unwrapped = (0, responseWrapper_1.unwrapApiResponse)(response.data, 'projects');
|
|
279
|
-
let projects = unwrapped.data;
|
|
280
|
-
(0, logger_1.mcpLog)(constants_1.LOG_LEVELS.INFO, 'Projects fetched successfully (single page)', {
|
|
281
|
-
method: 'getProjects',
|
|
282
|
-
count: projects.length,
|
|
283
|
-
workspaceId
|
|
284
|
-
});
|
|
285
|
-
return projects;
|
|
286
275
|
}
|
|
287
|
-
catch (
|
|
288
|
-
(0, logger_1.mcpLog)(constants_1.LOG_LEVELS.
|
|
276
|
+
catch (paginationError) {
|
|
277
|
+
(0, logger_1.mcpLog)(constants_1.LOG_LEVELS.DEBUG, 'Pagination failed, falling back to simple fetch', {
|
|
289
278
|
method: 'getProjects',
|
|
290
|
-
error:
|
|
291
|
-
apiStatus: (0, axios_1.isAxiosError)(error) ? error.response?.status : undefined,
|
|
292
|
-
apiMessage: (0, axios_1.isAxiosError)(error) ? error.response?.data?.message : undefined
|
|
279
|
+
error: paginationError instanceof Error ? paginationError.message : String(paginationError)
|
|
293
280
|
});
|
|
294
|
-
throw this.formatApiError(error, 'fetch', 'project');
|
|
295
281
|
}
|
|
296
|
-
|
|
282
|
+
// Use new response wrapper for single page fallback
|
|
283
|
+
const response = await fetchPage();
|
|
284
|
+
const unwrapped = (0, responseWrapper_1.unwrapApiResponse)(response.data, 'projects');
|
|
285
|
+
let projects = unwrapped.data;
|
|
286
|
+
(0, logger_1.mcpLog)(constants_1.LOG_LEVELS.INFO, 'Projects fetched successfully (single page)', {
|
|
287
|
+
method: 'getProjects',
|
|
288
|
+
count: projects.length,
|
|
289
|
+
workspaceId
|
|
290
|
+
});
|
|
291
|
+
// Cache only items
|
|
292
|
+
this.projectCache.set(cacheKey, projects);
|
|
293
|
+
return { items: projects };
|
|
294
|
+
}
|
|
295
|
+
catch (error) {
|
|
296
|
+
(0, logger_1.mcpLog)(constants_1.LOG_LEVELS.ERROR, 'Failed to fetch projects', {
|
|
297
|
+
method: 'getProjects',
|
|
298
|
+
error: getErrorMessage(error),
|
|
299
|
+
apiStatus: (0, axios_1.isAxiosError)(error) ? error.response?.status : undefined,
|
|
300
|
+
apiMessage: (0, axios_1.isAxiosError)(error) ? error.response?.data?.message : undefined
|
|
301
|
+
});
|
|
302
|
+
throw this.formatApiError(error, 'fetch', 'project');
|
|
303
|
+
}
|
|
297
304
|
}
|
|
298
305
|
async getAllProjects() {
|
|
299
306
|
try {
|
|
@@ -302,10 +309,14 @@ class MotionApiService {
|
|
|
302
309
|
});
|
|
303
310
|
const allWorkspaces = await this.getWorkspaces();
|
|
304
311
|
const allProjects = [];
|
|
312
|
+
let aggregateTruncation;
|
|
305
313
|
for (const workspace of allWorkspaces) {
|
|
306
314
|
try {
|
|
307
|
-
const
|
|
308
|
-
allProjects.push(...
|
|
315
|
+
const { items, truncation } = await this.getProjects(workspace.id);
|
|
316
|
+
allProjects.push(...items);
|
|
317
|
+
if (truncation?.wasTruncated && !aggregateTruncation) {
|
|
318
|
+
aggregateTruncation = { ...truncation, returnedCount: allProjects.length };
|
|
319
|
+
}
|
|
309
320
|
}
|
|
310
321
|
catch (workspaceError) {
|
|
311
322
|
// Log error but continue with other workspaces
|
|
@@ -322,7 +333,10 @@ class MotionApiService {
|
|
|
322
333
|
totalProjects: allProjects.length,
|
|
323
334
|
workspaceCount: allWorkspaces.length
|
|
324
335
|
});
|
|
325
|
-
|
|
336
|
+
if (aggregateTruncation) {
|
|
337
|
+
aggregateTruncation.returnedCount = allProjects.length;
|
|
338
|
+
}
|
|
339
|
+
return { items: allProjects, truncation: aggregateTruncation };
|
|
326
340
|
}
|
|
327
341
|
catch (error) {
|
|
328
342
|
(0, logger_1.mcpLog)(constants_1.LOG_LEVELS.ERROR, 'Failed to fetch projects from all workspaces', {
|
|
@@ -525,7 +539,7 @@ class MotionApiService {
|
|
|
525
539
|
projectId,
|
|
526
540
|
limitApplied: limit
|
|
527
541
|
});
|
|
528
|
-
return paginatedResult.items;
|
|
542
|
+
return { items: paginatedResult.items, truncation: paginatedResult.truncation };
|
|
529
543
|
}
|
|
530
544
|
}
|
|
531
545
|
catch (paginationError) {
|
|
@@ -550,7 +564,7 @@ class MotionApiService {
|
|
|
550
564
|
projectId,
|
|
551
565
|
limitApplied: limit
|
|
552
566
|
});
|
|
553
|
-
return tasks;
|
|
567
|
+
return { items: tasks };
|
|
554
568
|
}
|
|
555
569
|
catch (error) {
|
|
556
570
|
(0, logger_1.mcpLog)(constants_1.LOG_LEVELS.ERROR, 'Failed to fetch tasks', {
|
|
@@ -1010,7 +1024,7 @@ class MotionApiService {
|
|
|
1010
1024
|
workspaceId
|
|
1011
1025
|
});
|
|
1012
1026
|
// First, search in the specified workspace
|
|
1013
|
-
const projects = await this.getProjects(workspaceId);
|
|
1027
|
+
const { items: projects } = await this.getProjects(workspaceId);
|
|
1014
1028
|
const project = projects.find(p => p.name === projectName);
|
|
1015
1029
|
if (project) {
|
|
1016
1030
|
(0, logger_1.mcpLog)(constants_1.LOG_LEVELS.INFO, 'Project found by name in specified workspace', {
|
|
@@ -1037,7 +1051,7 @@ class MotionApiService {
|
|
|
1037
1051
|
searchingWorkspaceId: workspace.id,
|
|
1038
1052
|
searchingWorkspaceName: workspace.name
|
|
1039
1053
|
});
|
|
1040
|
-
const workspaceProjects = await this.getProjects(workspace.id);
|
|
1054
|
+
const { items: workspaceProjects } = await this.getProjects(workspace.id);
|
|
1041
1055
|
const foundProject = workspaceProjects.find(p => p.name === projectName);
|
|
1042
1056
|
if (foundProject) {
|
|
1043
1057
|
(0, logger_1.mcpLog)(constants_1.LOG_LEVELS.INFO, 'Project found by name in different workspace', {
|
|
@@ -1092,12 +1106,16 @@ class MotionApiService {
|
|
|
1092
1106
|
const effectiveLimit = limit || constants_1.LIMITS.MAX_SEARCH_RESULTS;
|
|
1093
1107
|
const lowerQuery = query.toLowerCase();
|
|
1094
1108
|
const allMatchingTasks = [];
|
|
1109
|
+
let aggregateTruncation;
|
|
1095
1110
|
// First, search in the specified workspace
|
|
1096
|
-
const primaryTasks = await this.getTasks({
|
|
1111
|
+
const { items: primaryTasks, truncation: primaryTruncation } = await this.getTasks({
|
|
1097
1112
|
workspaceId,
|
|
1098
1113
|
limit: (0, paginationNew_1.calculateAdaptiveFetchLimit)(allMatchingTasks.length, effectiveLimit),
|
|
1099
1114
|
maxPages: constants_1.LIMITS.MAX_PAGES
|
|
1100
1115
|
});
|
|
1116
|
+
if (primaryTruncation?.wasTruncated && !aggregateTruncation) {
|
|
1117
|
+
aggregateTruncation = primaryTruncation;
|
|
1118
|
+
}
|
|
1101
1119
|
const primaryMatches = primaryTasks.filter(task => task.name?.toLowerCase().includes(lowerQuery) ||
|
|
1102
1120
|
task.description?.toLowerCase().includes(lowerQuery));
|
|
1103
1121
|
allMatchingTasks.push(...primaryMatches.slice(0, effectiveLimit));
|
|
@@ -1128,11 +1146,14 @@ class MotionApiService {
|
|
|
1128
1146
|
searchingWorkspaceName: workspace.name,
|
|
1129
1147
|
remainingNeeded: effectiveLimit - allMatchingTasks.length
|
|
1130
1148
|
});
|
|
1131
|
-
const workspaceTasks = await this.getTasks({
|
|
1149
|
+
const { items: workspaceTasks, truncation: wsTruncation } = await this.getTasks({
|
|
1132
1150
|
workspaceId: workspace.id,
|
|
1133
1151
|
limit: fetchLimit,
|
|
1134
1152
|
maxPages: constants_1.LIMITS.MAX_PAGES
|
|
1135
1153
|
});
|
|
1154
|
+
if (wsTruncation?.wasTruncated && !aggregateTruncation) {
|
|
1155
|
+
aggregateTruncation = wsTruncation;
|
|
1156
|
+
}
|
|
1136
1157
|
const workspaceMatches = workspaceTasks.filter(task => task.name?.toLowerCase().includes(lowerQuery) ||
|
|
1137
1158
|
task.description?.toLowerCase().includes(lowerQuery));
|
|
1138
1159
|
// Only add as many as we still need
|
|
@@ -1176,7 +1197,10 @@ class MotionApiService {
|
|
|
1176
1197
|
returnedResults: allMatchingTasks.length,
|
|
1177
1198
|
limit: effectiveLimit
|
|
1178
1199
|
});
|
|
1179
|
-
|
|
1200
|
+
if (aggregateTruncation) {
|
|
1201
|
+
aggregateTruncation.returnedCount = allMatchingTasks.length;
|
|
1202
|
+
}
|
|
1203
|
+
return { items: allMatchingTasks, truncation: aggregateTruncation };
|
|
1180
1204
|
}
|
|
1181
1205
|
catch (error) {
|
|
1182
1206
|
(0, logger_1.mcpLog)(constants_1.LOG_LEVELS.ERROR, 'Failed to search tasks', {
|
|
@@ -1199,11 +1223,15 @@ class MotionApiService {
|
|
|
1199
1223
|
const effectiveLimit = limit || constants_1.LIMITS.MAX_SEARCH_RESULTS;
|
|
1200
1224
|
const lowerQuery = query.toLowerCase();
|
|
1201
1225
|
const allMatchingProjects = [];
|
|
1226
|
+
let aggregateTruncation;
|
|
1202
1227
|
// First, search in the specified workspace
|
|
1203
|
-
const primaryProjects = await this.getProjects(workspaceId, {
|
|
1228
|
+
const { items: primaryProjects, truncation: primaryTruncation } = await this.getProjects(workspaceId, {
|
|
1204
1229
|
maxPages: constants_1.LIMITS.MAX_PAGES,
|
|
1205
1230
|
limit: (0, paginationNew_1.calculateAdaptiveFetchLimit)(allMatchingProjects.length, effectiveLimit)
|
|
1206
1231
|
});
|
|
1232
|
+
if (primaryTruncation?.wasTruncated && !aggregateTruncation) {
|
|
1233
|
+
aggregateTruncation = primaryTruncation;
|
|
1234
|
+
}
|
|
1207
1235
|
const primaryMatches = primaryProjects.filter(project => project.name?.toLowerCase().includes(lowerQuery) ||
|
|
1208
1236
|
project.description?.toLowerCase().includes(lowerQuery));
|
|
1209
1237
|
allMatchingProjects.push(...primaryMatches.slice(0, effectiveLimit));
|
|
@@ -1234,10 +1262,13 @@ class MotionApiService {
|
|
|
1234
1262
|
searchingWorkspaceName: workspace.name,
|
|
1235
1263
|
remainingNeeded: effectiveLimit - allMatchingProjects.length
|
|
1236
1264
|
});
|
|
1237
|
-
const workspaceProjects = await this.getProjects(workspace.id, {
|
|
1265
|
+
const { items: workspaceProjects, truncation: wsTruncation } = await this.getProjects(workspace.id, {
|
|
1238
1266
|
maxPages: constants_1.LIMITS.MAX_PAGES,
|
|
1239
1267
|
limit: fetchLimit
|
|
1240
1268
|
});
|
|
1269
|
+
if (wsTruncation?.wasTruncated && !aggregateTruncation) {
|
|
1270
|
+
aggregateTruncation = wsTruncation;
|
|
1271
|
+
}
|
|
1241
1272
|
const workspaceMatches = workspaceProjects.filter(project => project.name?.toLowerCase().includes(lowerQuery) ||
|
|
1242
1273
|
project.description?.toLowerCase().includes(lowerQuery));
|
|
1243
1274
|
// Only add as many as we still need
|
|
@@ -1281,7 +1312,10 @@ class MotionApiService {
|
|
|
1281
1312
|
returnedResults: allMatchingProjects.length,
|
|
1282
1313
|
limit: effectiveLimit
|
|
1283
1314
|
});
|
|
1284
|
-
|
|
1315
|
+
if (aggregateTruncation) {
|
|
1316
|
+
aggregateTruncation.returnedCount = allMatchingProjects.length;
|
|
1317
|
+
}
|
|
1318
|
+
return { items: allMatchingProjects, truncation: aggregateTruncation };
|
|
1285
1319
|
}
|
|
1286
1320
|
catch (error) {
|
|
1287
1321
|
(0, logger_1.mcpLog)(constants_1.LOG_LEVELS.ERROR, 'Failed to search projects', {
|
|
@@ -1664,51 +1698,56 @@ class MotionApiService {
|
|
|
1664
1698
|
async getRecurringTasks(workspaceId, options) {
|
|
1665
1699
|
const { maxPages = 10, limit } = options || {};
|
|
1666
1700
|
const cacheKey = workspaceId ? `recurring-tasks:workspace:${workspaceId}` : 'recurring-tasks:all';
|
|
1667
|
-
return
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
const
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1701
|
+
// Check cache - return items only (no stale truncation info)
|
|
1702
|
+
const cachedItems = this.recurringTaskCache.get(cacheKey);
|
|
1703
|
+
if (cachedItems !== null) {
|
|
1704
|
+
return { items: cachedItems };
|
|
1705
|
+
}
|
|
1706
|
+
try {
|
|
1707
|
+
(0, logger_1.mcpLog)(constants_1.LOG_LEVELS.DEBUG, 'Fetching recurring tasks from Motion API with pagination', {
|
|
1708
|
+
method: 'getRecurringTasks',
|
|
1709
|
+
workspaceId,
|
|
1710
|
+
maxPages,
|
|
1711
|
+
limit
|
|
1712
|
+
});
|
|
1713
|
+
// Create a fetch function for pagination utility
|
|
1714
|
+
const fetchPage = async (cursor) => {
|
|
1715
|
+
const params = new URLSearchParams();
|
|
1716
|
+
if (workspaceId)
|
|
1717
|
+
params.append('workspaceId', workspaceId);
|
|
1718
|
+
if (cursor)
|
|
1719
|
+
params.append('cursor', cursor);
|
|
1720
|
+
const queryString = params.toString();
|
|
1721
|
+
const url = queryString ? `/recurring-tasks?${queryString}` : '/recurring-tasks';
|
|
1722
|
+
return this.requestWithRetry(() => this.client.get(url));
|
|
1723
|
+
};
|
|
1724
|
+
// Use pagination utility to fetch all pages
|
|
1725
|
+
const paginatedResult = await (0, paginationNew_1.fetchAllPages)(fetchPage, 'recurring-tasks', {
|
|
1726
|
+
maxPages,
|
|
1727
|
+
logProgress: true,
|
|
1728
|
+
...(limit ? { maxItems: limit } : {})
|
|
1729
|
+
});
|
|
1730
|
+
(0, logger_1.mcpLog)(constants_1.LOG_LEVELS.INFO, 'Recurring tasks fetched successfully with pagination', {
|
|
1731
|
+
method: 'getRecurringTasks',
|
|
1732
|
+
totalCount: paginatedResult.totalFetched,
|
|
1733
|
+
pagesProcessed: Math.ceil(paginatedResult.totalFetched / 50), // Assuming ~50 items per page
|
|
1734
|
+
hasMore: paginatedResult.hasMore,
|
|
1735
|
+
workspaceId
|
|
1736
|
+
});
|
|
1737
|
+
// Cache only items, not truncation metadata
|
|
1738
|
+
this.recurringTaskCache.set(cacheKey, paginatedResult.items);
|
|
1739
|
+
return { items: paginatedResult.items, truncation: paginatedResult.truncation };
|
|
1740
|
+
}
|
|
1741
|
+
catch (error) {
|
|
1742
|
+
(0, logger_1.mcpLog)(constants_1.LOG_LEVELS.ERROR, 'Failed to fetch recurring tasks', {
|
|
1743
|
+
method: 'getRecurringTasks',
|
|
1744
|
+
error: getErrorMessage(error),
|
|
1745
|
+
apiStatus: (0, axios_1.isAxiosError)(error) ? error.response?.status : undefined,
|
|
1746
|
+
apiMessage: (0, axios_1.isAxiosError)(error) ? error.response?.data?.message : undefined,
|
|
1747
|
+
workspaceId
|
|
1748
|
+
});
|
|
1749
|
+
throw this.formatApiError(error, 'fetch', 'recurring task');
|
|
1750
|
+
}
|
|
1712
1751
|
}
|
|
1713
1752
|
/**
|
|
1714
1753
|
* Create a new recurring task
|
|
@@ -1953,6 +1992,7 @@ class MotionApiService {
|
|
|
1953
1992
|
// Apply limit to prevent resource exhaustion
|
|
1954
1993
|
const effectiveLimit = limit || constants_1.LIMITS.MAX_SEARCH_RESULTS;
|
|
1955
1994
|
const allUncompletedTasks = [];
|
|
1995
|
+
let aggregateTruncation;
|
|
1956
1996
|
try {
|
|
1957
1997
|
// Get all workspaces
|
|
1958
1998
|
const workspaces = await this.getWorkspaces();
|
|
@@ -1971,12 +2011,15 @@ class MotionApiService {
|
|
|
1971
2011
|
if (fetchLimit <= 0)
|
|
1972
2012
|
break;
|
|
1973
2013
|
// Get tasks from this workspace with adaptive limit
|
|
1974
|
-
const workspaceTasks = await this.getTasks({
|
|
2014
|
+
const { items: workspaceTasks, truncation: wsTruncation } = await this.getTasks({
|
|
1975
2015
|
workspaceId: workspace.id,
|
|
1976
2016
|
assigneeId,
|
|
1977
2017
|
limit: fetchLimit,
|
|
1978
2018
|
maxPages: constants_1.LIMITS.MAX_PAGES
|
|
1979
2019
|
});
|
|
2020
|
+
if (wsTruncation?.wasTruncated && !aggregateTruncation) {
|
|
2021
|
+
aggregateTruncation = wsTruncation;
|
|
2022
|
+
}
|
|
1980
2023
|
// Filter for uncompleted tasks
|
|
1981
2024
|
const uncompletedTasks = workspaceTasks.filter(task => {
|
|
1982
2025
|
// Task is uncompleted if status is missing or isResolvedStatus is false
|
|
@@ -2024,7 +2067,10 @@ class MotionApiService {
|
|
|
2024
2067
|
returned: allUncompletedTasks.length,
|
|
2025
2068
|
limit: effectiveLimit
|
|
2026
2069
|
});
|
|
2027
|
-
|
|
2070
|
+
if (aggregateTruncation) {
|
|
2071
|
+
aggregateTruncation.returnedCount = allUncompletedTasks.length;
|
|
2072
|
+
}
|
|
2073
|
+
return { items: allUncompletedTasks, truncation: aggregateTruncation };
|
|
2028
2074
|
}
|
|
2029
2075
|
catch (error) {
|
|
2030
2076
|
(0, logger_1.mcpLog)(constants_1.LOG_LEVELS.ERROR, 'Failed to fetch all uncompleted tasks', {
|