@doist/todoist-ai 2.2.2 → 3.0.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 +11 -3
- package/dist/index.d.ts +496 -255
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +41 -29
- package/dist/mcp-helpers.d.ts +25 -3
- package/dist/mcp-helpers.d.ts.map +1 -1
- package/dist/mcp-helpers.js +37 -19
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/mcp-server.js +32 -28
- package/dist/tools/__tests__/add-tasks.test.d.ts +2 -0
- package/dist/tools/__tests__/add-tasks.test.d.ts.map +1 -0
- package/dist/tools/__tests__/{tasks-add-multiple.test.js → add-tasks.test.js} +85 -81
- package/dist/tools/__tests__/complete-tasks.test.d.ts +2 -0
- package/dist/tools/__tests__/complete-tasks.test.d.ts.map +1 -0
- package/dist/tools/__tests__/complete-tasks.test.js +206 -0
- package/dist/tools/__tests__/delete-object.test.d.ts +2 -0
- package/dist/tools/__tests__/delete-object.test.d.ts.map +1 -0
- package/dist/tools/__tests__/{delete-one.test.js → delete-object.test.js} +42 -22
- package/dist/tools/__tests__/find-completed-tasks.test.d.ts +2 -0
- package/dist/tools/__tests__/find-completed-tasks.test.d.ts.map +1 -0
- package/dist/tools/__tests__/{tasks-list-completed.test.js → find-completed-tasks.test.js} +13 -36
- package/dist/tools/__tests__/find-projects.test.d.ts +2 -0
- package/dist/tools/__tests__/find-projects.test.d.ts.map +1 -0
- package/dist/tools/__tests__/{projects-list.test.js → find-projects.test.js} +55 -39
- package/dist/tools/__tests__/find-sections.test.d.ts +2 -0
- package/dist/tools/__tests__/find-sections.test.d.ts.map +1 -0
- package/dist/tools/__tests__/{sections-search.test.js → find-sections.test.js} +64 -50
- package/dist/tools/__tests__/find-tasks-by-date.test.d.ts +2 -0
- package/dist/tools/__tests__/find-tasks-by-date.test.d.ts.map +1 -0
- package/dist/tools/__tests__/{tasks-list-by-date.test.js → find-tasks-by-date.test.js} +96 -14
- package/dist/tools/__tests__/find-tasks.test.d.ts +2 -0
- package/dist/tools/__tests__/find-tasks.test.d.ts.map +1 -0
- package/dist/tools/__tests__/find-tasks.test.js +334 -0
- package/dist/tools/__tests__/get-overview.test.d.ts +2 -0
- package/dist/tools/__tests__/get-overview.test.d.ts.map +1 -0
- package/dist/tools/__tests__/{overview.test.js → get-overview.test.js} +77 -13
- package/dist/tools/__tests__/manage-projects.test.d.ts +2 -0
- package/dist/tools/__tests__/manage-projects.test.d.ts.map +1 -0
- package/dist/tools/__tests__/{projects-manage.test.js → manage-projects.test.js} +33 -30
- package/dist/tools/__tests__/manage-sections.test.d.ts +2 -0
- package/dist/tools/__tests__/manage-sections.test.d.ts.map +1 -0
- package/dist/tools/__tests__/manage-sections.test.js +162 -0
- package/dist/tools/__tests__/update-tasks.test.d.ts +2 -0
- package/dist/tools/__tests__/update-tasks.test.d.ts.map +1 -0
- package/dist/tools/__tests__/update-tasks.test.js +645 -0
- package/dist/tools/{tasks-add-multiple.d.ts → add-tasks.d.ts} +36 -16
- package/dist/tools/add-tasks.d.ts.map +1 -0
- package/dist/tools/{tasks-add-multiple.js → add-tasks.js} +39 -4
- package/dist/tools/complete-tasks.d.ts +40 -0
- package/dist/tools/complete-tasks.d.ts.map +1 -0
- package/dist/tools/complete-tasks.js +68 -0
- package/dist/tools/delete-object.d.ts +38 -0
- package/dist/tools/delete-object.d.ts.map +1 -0
- package/dist/tools/delete-object.js +69 -0
- package/dist/tools/find-completed-tasks.d.ts +74 -0
- package/dist/tools/find-completed-tasks.d.ts.map +1 -0
- package/dist/tools/find-completed-tasks.js +112 -0
- package/dist/tools/find-projects.d.ts +53 -0
- package/dist/tools/find-projects.d.ts.map +1 -0
- package/dist/tools/find-projects.js +101 -0
- package/dist/tools/find-sections.d.ts +42 -0
- package/dist/tools/find-sections.d.ts.map +1 -0
- package/dist/tools/find-sections.js +96 -0
- package/dist/tools/find-tasks-by-date.d.ts +59 -0
- package/dist/tools/find-tasks-by-date.d.ts.map +1 -0
- package/dist/tools/find-tasks-by-date.js +121 -0
- package/dist/tools/find-tasks.d.ts +65 -0
- package/dist/tools/find-tasks.d.ts.map +1 -0
- package/dist/tools/find-tasks.js +182 -0
- package/dist/tools/get-overview.d.ts +67 -0
- package/dist/tools/get-overview.d.ts.map +1 -0
- package/dist/tools/{overview.js → get-overview.js} +66 -19
- package/dist/tools/manage-projects.d.ts +35 -0
- package/dist/tools/manage-projects.d.ts.map +1 -0
- package/dist/tools/manage-projects.js +63 -0
- package/dist/tools/manage-sections.d.ts +38 -0
- package/dist/tools/manage-sections.d.ts.map +1 -0
- package/dist/tools/manage-sections.js +78 -0
- package/dist/tools/update-tasks.d.ts +94 -0
- package/dist/tools/update-tasks.d.ts.map +1 -0
- package/dist/tools/update-tasks.js +120 -0
- package/dist/utils/constants.d.ts +35 -0
- package/dist/utils/constants.d.ts.map +1 -0
- package/dist/utils/constants.js +37 -0
- package/dist/utils/response-builders.d.ts +88 -0
- package/dist/utils/response-builders.d.ts.map +1 -0
- package/dist/utils/response-builders.js +202 -0
- package/dist/{tools → utils}/test-helpers.d.ts +16 -0
- package/dist/utils/test-helpers.d.ts.map +1 -0
- package/dist/{tools → utils}/test-helpers.js +51 -0
- package/dist/utils/tool-names.d.ts +23 -0
- package/dist/utils/tool-names.d.ts.map +1 -0
- package/dist/utils/tool-names.js +25 -0
- package/package.json +1 -1
- package/dist/tools/__tests__/delete-one.test.d.ts +0 -2
- package/dist/tools/__tests__/delete-one.test.d.ts.map +0 -1
- package/dist/tools/__tests__/overview.test.d.ts +0 -2
- package/dist/tools/__tests__/overview.test.d.ts.map +0 -1
- package/dist/tools/__tests__/projects-list.test.d.ts +0 -2
- package/dist/tools/__tests__/projects-list.test.d.ts.map +0 -1
- package/dist/tools/__tests__/projects-manage.test.d.ts +0 -2
- package/dist/tools/__tests__/projects-manage.test.d.ts.map +0 -1
- package/dist/tools/__tests__/sections-manage.test.d.ts +0 -2
- package/dist/tools/__tests__/sections-manage.test.d.ts.map +0 -1
- package/dist/tools/__tests__/sections-manage.test.js +0 -138
- package/dist/tools/__tests__/sections-search.test.d.ts +0 -2
- package/dist/tools/__tests__/sections-search.test.d.ts.map +0 -1
- package/dist/tools/__tests__/tasks-add-multiple.test.d.ts +0 -2
- package/dist/tools/__tests__/tasks-add-multiple.test.d.ts.map +0 -1
- package/dist/tools/__tests__/tasks-complete-multiple.test.d.ts +0 -2
- package/dist/tools/__tests__/tasks-complete-multiple.test.d.ts.map +0 -1
- package/dist/tools/__tests__/tasks-complete-multiple.test.js +0 -146
- package/dist/tools/__tests__/tasks-list-by-date.test.d.ts +0 -2
- package/dist/tools/__tests__/tasks-list-by-date.test.d.ts.map +0 -1
- package/dist/tools/__tests__/tasks-list-completed.test.d.ts +0 -2
- package/dist/tools/__tests__/tasks-list-completed.test.d.ts.map +0 -1
- package/dist/tools/__tests__/tasks-list-for-container.test.d.ts +0 -2
- package/dist/tools/__tests__/tasks-list-for-container.test.d.ts.map +0 -1
- package/dist/tools/__tests__/tasks-list-for-container.test.js +0 -232
- package/dist/tools/__tests__/tasks-organize-multiple.test.d.ts +0 -2
- package/dist/tools/__tests__/tasks-organize-multiple.test.d.ts.map +0 -1
- package/dist/tools/__tests__/tasks-organize-multiple.test.js +0 -245
- package/dist/tools/__tests__/tasks-search.test.d.ts +0 -2
- package/dist/tools/__tests__/tasks-search.test.d.ts.map +0 -1
- package/dist/tools/__tests__/tasks-search.test.js +0 -106
- package/dist/tools/__tests__/tasks-update-one.test.d.ts +0 -2
- package/dist/tools/__tests__/tasks-update-one.test.d.ts.map +0 -1
- package/dist/tools/__tests__/tasks-update-one.test.js +0 -251
- package/dist/tools/delete-one.d.ts +0 -17
- package/dist/tools/delete-one.d.ts.map +0 -1
- package/dist/tools/delete-one.js +0 -25
- package/dist/tools/overview.d.ts +0 -14
- package/dist/tools/overview.d.ts.map +0 -1
- package/dist/tools/projects-list.d.ts +0 -29
- package/dist/tools/projects-list.d.ts.map +0 -1
- package/dist/tools/projects-list.js +0 -39
- package/dist/tools/projects-manage.d.ts +0 -24
- package/dist/tools/projects-manage.d.ts.map +0 -1
- package/dist/tools/projects-manage.js +0 -26
- package/dist/tools/sections-manage.d.ts +0 -23
- package/dist/tools/sections-manage.d.ts.map +0 -1
- package/dist/tools/sections-manage.js +0 -37
- package/dist/tools/sections-search.d.ts +0 -18
- package/dist/tools/sections-search.d.ts.map +0 -1
- package/dist/tools/sections-search.js +0 -27
- package/dist/tools/tasks-add-multiple.d.ts.map +0 -1
- package/dist/tools/tasks-complete-multiple.d.ts +0 -16
- package/dist/tools/tasks-complete-multiple.d.ts.map +0 -1
- package/dist/tools/tasks-complete-multiple.js +0 -23
- package/dist/tools/tasks-list-by-date.d.ts +0 -34
- package/dist/tools/tasks-list-by-date.d.ts.map +0 -1
- package/dist/tools/tasks-list-by-date.js +0 -53
- package/dist/tools/tasks-list-completed.d.ts +0 -44
- package/dist/tools/tasks-list-completed.d.ts.map +0 -1
- package/dist/tools/tasks-list-completed.js +0 -49
- package/dist/tools/tasks-list-for-container.d.ts +0 -34
- package/dist/tools/tasks-list-for-container.d.ts.map +0 -1
- package/dist/tools/tasks-list-for-container.js +0 -48
- package/dist/tools/tasks-organize-multiple.d.ts +0 -37
- package/dist/tools/tasks-organize-multiple.d.ts.map +0 -1
- package/dist/tools/tasks-organize-multiple.js +0 -34
- package/dist/tools/tasks-search.d.ts +0 -32
- package/dist/tools/tasks-search.d.ts.map +0 -1
- package/dist/tools/tasks-search.js +0 -30
- package/dist/tools/tasks-update-one.d.ts +0 -29
- package/dist/tools/tasks-update-one.d.ts.map +0 -1
- package/dist/tools/tasks-update-one.js +0 -63
- package/dist/tools/test-helpers.d.ts.map +0 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Application-wide constants
|
|
3
|
+
*
|
|
4
|
+
* This module centralizes magic numbers and configuration values
|
|
5
|
+
* to improve maintainability and provide a single source of truth.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ApiLimits: {
|
|
8
|
+
/** Default limit for task listings */
|
|
9
|
+
readonly TASKS_DEFAULT: 10;
|
|
10
|
+
/** Maximum limit for task search and list operations */
|
|
11
|
+
readonly TASKS_MAX: 50;
|
|
12
|
+
/** Default limit for completed tasks */
|
|
13
|
+
readonly COMPLETED_TASKS_DEFAULT: 50;
|
|
14
|
+
/** Maximum limit for completed tasks */
|
|
15
|
+
readonly COMPLETED_TASKS_MAX: 200;
|
|
16
|
+
/** Default limit for project listings */
|
|
17
|
+
readonly PROJECTS_DEFAULT: 50;
|
|
18
|
+
/** Maximum limit for project listings */
|
|
19
|
+
readonly PROJECTS_MAX: 100;
|
|
20
|
+
/** Batch size for fetching all tasks in a project */
|
|
21
|
+
readonly TASKS_BATCH_SIZE: 50;
|
|
22
|
+
};
|
|
23
|
+
export declare const DisplayLimits: {
|
|
24
|
+
/** Maximum number of failures to show in detailed error messages */
|
|
25
|
+
readonly MAX_FAILURES_SHOWN: 3;
|
|
26
|
+
/** Threshold for suggesting batch operations */
|
|
27
|
+
readonly BATCH_OPERATION_THRESHOLD: 10;
|
|
28
|
+
};
|
|
29
|
+
export declare const ResponseConfig: {
|
|
30
|
+
/** Maximum characters per line in text responses */
|
|
31
|
+
readonly MAX_LINE_LENGTH: 100;
|
|
32
|
+
/** Indentation for nested items */
|
|
33
|
+
readonly INDENT_SIZE: 2;
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,eAAO,MAAM,SAAS;IAClB,sCAAsC;;IAEtC,wDAAwD;;IAExD,wCAAwC;;IAExC,wCAAwC;;IAExC,yCAAyC;;IAEzC,yCAAyC;;IAEzC,qDAAqD;;CAE/C,CAAA;AAGV,eAAO,MAAM,aAAa;IACtB,oEAAoE;;IAEpE,gDAAgD;;CAE1C,CAAA;AAGV,eAAO,MAAM,cAAc;IACvB,oDAAoD;;IAEpD,mCAAmC;;CAE7B,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Application-wide constants
|
|
3
|
+
*
|
|
4
|
+
* This module centralizes magic numbers and configuration values
|
|
5
|
+
* to improve maintainability and provide a single source of truth.
|
|
6
|
+
*/
|
|
7
|
+
// API Pagination Limits
|
|
8
|
+
export const ApiLimits = {
|
|
9
|
+
/** Default limit for task listings */
|
|
10
|
+
TASKS_DEFAULT: 10,
|
|
11
|
+
/** Maximum limit for task search and list operations */
|
|
12
|
+
TASKS_MAX: 50,
|
|
13
|
+
/** Default limit for completed tasks */
|
|
14
|
+
COMPLETED_TASKS_DEFAULT: 50,
|
|
15
|
+
/** Maximum limit for completed tasks */
|
|
16
|
+
COMPLETED_TASKS_MAX: 200,
|
|
17
|
+
/** Default limit for project listings */
|
|
18
|
+
PROJECTS_DEFAULT: 50,
|
|
19
|
+
/** Maximum limit for project listings */
|
|
20
|
+
PROJECTS_MAX: 100,
|
|
21
|
+
/** Batch size for fetching all tasks in a project */
|
|
22
|
+
TASKS_BATCH_SIZE: 50,
|
|
23
|
+
};
|
|
24
|
+
// UI Display Limits
|
|
25
|
+
export const DisplayLimits = {
|
|
26
|
+
/** Maximum number of failures to show in detailed error messages */
|
|
27
|
+
MAX_FAILURES_SHOWN: 3,
|
|
28
|
+
/** Threshold for suggesting batch operations */
|
|
29
|
+
BATCH_OPERATION_THRESHOLD: 10,
|
|
30
|
+
};
|
|
31
|
+
// Response Builder Configuration
|
|
32
|
+
export const ResponseConfig = {
|
|
33
|
+
/** Maximum characters per line in text responses */
|
|
34
|
+
MAX_LINE_LENGTH: 100,
|
|
35
|
+
/** Indentation for nested items */
|
|
36
|
+
INDENT_SIZE: 2,
|
|
37
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper function to get date string in YYYY-MM-DD format
|
|
3
|
+
*/
|
|
4
|
+
export declare function getDateString(date?: Date): string;
|
|
5
|
+
type TaskLike = {
|
|
6
|
+
id?: string;
|
|
7
|
+
content?: string;
|
|
8
|
+
title?: string;
|
|
9
|
+
dueDate?: string;
|
|
10
|
+
priority?: number;
|
|
11
|
+
projectName?: string;
|
|
12
|
+
};
|
|
13
|
+
type ProjectLike = {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
color?: string;
|
|
17
|
+
isFavorite?: boolean;
|
|
18
|
+
isShared?: boolean;
|
|
19
|
+
parentId?: string | null;
|
|
20
|
+
inboxProject?: boolean;
|
|
21
|
+
viewStyle?: string;
|
|
22
|
+
};
|
|
23
|
+
type TaskOperationOptions = {
|
|
24
|
+
nextSteps?: string[];
|
|
25
|
+
context?: string;
|
|
26
|
+
showDetails?: boolean;
|
|
27
|
+
};
|
|
28
|
+
type BatchOperationParams = {
|
|
29
|
+
action: string;
|
|
30
|
+
success: number;
|
|
31
|
+
total: number;
|
|
32
|
+
successItems?: string[];
|
|
33
|
+
failures?: Array<{
|
|
34
|
+
item: string;
|
|
35
|
+
error: string;
|
|
36
|
+
code?: string;
|
|
37
|
+
}>;
|
|
38
|
+
nextSteps?: string[];
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Creates concise, actionable summaries for task operations instead of raw JSON
|
|
42
|
+
*/
|
|
43
|
+
export declare function summarizeTaskOperation(action: string, tasks: TaskLike[], options?: TaskOperationOptions): string;
|
|
44
|
+
/**
|
|
45
|
+
* Creates batch operation summaries with success/failure breakdown
|
|
46
|
+
*/
|
|
47
|
+
export declare function summarizeBatch(params: BatchOperationParams): string;
|
|
48
|
+
/**
|
|
49
|
+
* Formats a single project-like object into a readable preview line
|
|
50
|
+
*/
|
|
51
|
+
export declare function formatProjectPreview(project: ProjectLike): string;
|
|
52
|
+
/**
|
|
53
|
+
* Creates preview lines for task lists
|
|
54
|
+
*/
|
|
55
|
+
export declare function previewTasks(tasks: TaskLike[], limit?: number): string;
|
|
56
|
+
interface SummarizeListParams {
|
|
57
|
+
subject: string;
|
|
58
|
+
count: number;
|
|
59
|
+
limit?: number;
|
|
60
|
+
nextCursor?: string;
|
|
61
|
+
filterHints?: string[];
|
|
62
|
+
previewLines?: string;
|
|
63
|
+
zeroReasonHints?: string[];
|
|
64
|
+
nextSteps?: string[];
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Creates list summaries with counts, filters, and guidance
|
|
68
|
+
*/
|
|
69
|
+
export declare function summarizeList({ subject, count, limit, nextCursor, filterHints, previewLines, zeroReasonHints, nextSteps, }: SummarizeListParams): string;
|
|
70
|
+
/**
|
|
71
|
+
* Formats next steps array into a consistent "Next:" section
|
|
72
|
+
* If nextCursor is provided, adds cursor instruction to the steps
|
|
73
|
+
*/
|
|
74
|
+
export declare function formatNextSteps(nextSteps: string[], nextCursor?: string): string;
|
|
75
|
+
/**
|
|
76
|
+
* Helper to generate contextual next steps based on task operations
|
|
77
|
+
*/
|
|
78
|
+
export declare function generateTaskNextSteps(operation: 'added' | 'updated' | 'listed' | 'completed' | 'organized', tasks: TaskLike[], context?: {
|
|
79
|
+
hasToday?: boolean;
|
|
80
|
+
hasOverdue?: boolean;
|
|
81
|
+
hasHighPriority?: boolean;
|
|
82
|
+
projectName?: string;
|
|
83
|
+
count?: number;
|
|
84
|
+
timeOfDay?: 'morning' | 'afternoon' | 'evening';
|
|
85
|
+
isEmptyResult?: boolean;
|
|
86
|
+
}): string[];
|
|
87
|
+
export {};
|
|
88
|
+
//# sourceMappingURL=response-builders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response-builders.d.ts","sourceRoot":"","sources":["../../src/utils/response-builders.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,GAAE,IAAiB,GAAG,MAAM,CAG7D;AAID,KAAK,QAAQ,GAAG;IACZ,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,OAAO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A6EV"}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { DisplayLimits } from './constants.js';
|
|
2
|
+
import { ToolNames } from './tool-names.js';
|
|
3
|
+
/**
|
|
4
|
+
* Helper function to get date string in YYYY-MM-DD format
|
|
5
|
+
*/
|
|
6
|
+
export function getDateString(date = new Date()) {
|
|
7
|
+
const parts = date.toISOString().split('T');
|
|
8
|
+
return parts[0] ?? '';
|
|
9
|
+
}
|
|
10
|
+
const { FIND_TASKS_BY_DATE, ADD_TASKS, UPDATE_TASKS, COMPLETE_TASKS, GET_OVERVIEW } = ToolNames;
|
|
11
|
+
/**
|
|
12
|
+
* Creates concise, actionable summaries for task operations instead of raw JSON
|
|
13
|
+
*/
|
|
14
|
+
export function summarizeTaskOperation(action, tasks, options = {}) {
|
|
15
|
+
const { nextSteps, context, showDetails = false } = options;
|
|
16
|
+
const count = tasks.length;
|
|
17
|
+
const bits = [];
|
|
18
|
+
// Main action summary
|
|
19
|
+
const taskOrTasks = count === 1 ? 'task' : 'tasks';
|
|
20
|
+
const actionSummary = `${action} ${count} ${taskOrTasks}${context ? ` ${context}` : ''}.`;
|
|
21
|
+
bits.push(actionSummary);
|
|
22
|
+
// Task details preview (if requested or small batch)
|
|
23
|
+
const smallBatchLimit = 5;
|
|
24
|
+
if (showDetails || count <= smallBatchLimit) {
|
|
25
|
+
const previews = previewTasks(tasks, smallBatchLimit);
|
|
26
|
+
if (previews.length > 0) {
|
|
27
|
+
const moreInfo = count > smallBatchLimit ? `, +${count - smallBatchLimit} more` : '';
|
|
28
|
+
bits.push(`Tasks:\n${previews}${moreInfo}.`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
// Next steps guidance
|
|
32
|
+
if (nextSteps?.length) {
|
|
33
|
+
bits.push(formatNextSteps(nextSteps));
|
|
34
|
+
}
|
|
35
|
+
return bits.join('\n');
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Creates batch operation summaries with success/failure breakdown
|
|
39
|
+
*/
|
|
40
|
+
export function summarizeBatch(params) {
|
|
41
|
+
const { action, success, total, successItems, failures, nextSteps } = params;
|
|
42
|
+
const bits = [];
|
|
43
|
+
// Main result summary
|
|
44
|
+
const successBit = `${action}: ${success}/${total} successful.`;
|
|
45
|
+
bits.push(successBit);
|
|
46
|
+
// Success items (if provided and reasonable count)
|
|
47
|
+
if (successItems?.length && successItems.length <= 5) {
|
|
48
|
+
bits.push(`Completed:\n${successItems.map((item) => ` ${item}`).join('\n')}.`);
|
|
49
|
+
}
|
|
50
|
+
// Failure details (if any)
|
|
51
|
+
if (failures?.length) {
|
|
52
|
+
const failureCount = failures.length;
|
|
53
|
+
const failureBit = `Failed (${failureCount}):\n${failures
|
|
54
|
+
.slice(0, DisplayLimits.MAX_FAILURES_SHOWN)
|
|
55
|
+
.map((f) => ` ${f.item} (Error: ${f.error}${f.code ? ` [${f.code}]` : ''})`)
|
|
56
|
+
.join('\n')}${failureCount > DisplayLimits.MAX_FAILURES_SHOWN ? `, +${failureCount - DisplayLimits.MAX_FAILURES_SHOWN} more` : ''}.`;
|
|
57
|
+
bits.push(failureBit);
|
|
58
|
+
}
|
|
59
|
+
// Next steps
|
|
60
|
+
if (nextSteps?.length) {
|
|
61
|
+
bits.push(formatNextSteps(nextSteps));
|
|
62
|
+
}
|
|
63
|
+
return bits.join('\n');
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Formats a single task-like object into a readable preview line
|
|
67
|
+
*/
|
|
68
|
+
function formatTaskPreview(task) {
|
|
69
|
+
const content = task.content || task.title || 'Untitled';
|
|
70
|
+
const due = task.dueDate ? ` • due ${task.dueDate}` : '';
|
|
71
|
+
const priority = task.priority && task.priority < 4 ? ` • P${task.priority}` : '';
|
|
72
|
+
const project = task.projectName ? ` • ${task.projectName}` : '';
|
|
73
|
+
const id = task.id ? ` • id=${task.id}` : '';
|
|
74
|
+
return ` ${content}${due}${priority}${project}${id}`;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Formats a single project-like object into a readable preview line
|
|
78
|
+
*/
|
|
79
|
+
export function formatProjectPreview(project) {
|
|
80
|
+
const isInbox = project.inboxProject ? ' • Inbox' : '';
|
|
81
|
+
const isFavorite = project.isFavorite ? ' • ⭐' : '';
|
|
82
|
+
const isShared = project.isShared ? ' • Shared' : '';
|
|
83
|
+
const viewStyle = project.viewStyle && project.viewStyle !== 'list' ? ` • ${project.viewStyle}` : '';
|
|
84
|
+
const id = ` • id=${project.id}`;
|
|
85
|
+
return ` ${project.name}${isInbox}${isFavorite}${isShared}${viewStyle}${id}`;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Creates preview lines for task lists
|
|
89
|
+
*/
|
|
90
|
+
export function previewTasks(tasks, limit = 5) {
|
|
91
|
+
return tasks.slice(0, limit).map(formatTaskPreview).join('\n');
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Creates list summaries with counts, filters, and guidance
|
|
95
|
+
*/
|
|
96
|
+
export function summarizeList({ subject, count, limit, nextCursor, filterHints, previewLines, zeroReasonHints, nextSteps, }) {
|
|
97
|
+
const bits = [];
|
|
98
|
+
// Header with count and pagination info
|
|
99
|
+
const header = `${subject}: ${count}${typeof limit === 'number' ? ` (limit ${limit})` : ''}${nextCursor ? ', more available' : ''}.`;
|
|
100
|
+
bits.push(header);
|
|
101
|
+
// Filter information
|
|
102
|
+
if (filterHints?.length) {
|
|
103
|
+
bits.push(`Filter: ${filterHints.join('; ')}.`);
|
|
104
|
+
}
|
|
105
|
+
// Preview of items
|
|
106
|
+
if (previewLines?.length) {
|
|
107
|
+
bits.push(`Preview:\n${previewLines}`);
|
|
108
|
+
}
|
|
109
|
+
// Help for empty results
|
|
110
|
+
if (!count && zeroReasonHints?.length) {
|
|
111
|
+
bits.push(`No results. ${zeroReasonHints.join('; ')}.`);
|
|
112
|
+
}
|
|
113
|
+
// Next steps guidance
|
|
114
|
+
if (nextSteps?.length || nextCursor) {
|
|
115
|
+
bits.push(formatNextSteps(nextSteps || [], nextCursor));
|
|
116
|
+
}
|
|
117
|
+
return bits.join('\n');
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Formats next steps array into a consistent "Next:" section
|
|
121
|
+
* If nextCursor is provided, adds cursor instruction to the steps
|
|
122
|
+
*/
|
|
123
|
+
export function formatNextSteps(nextSteps, nextCursor) {
|
|
124
|
+
const allSteps = [...nextSteps];
|
|
125
|
+
if (nextCursor) {
|
|
126
|
+
allSteps.push(`Pass cursor '${nextCursor}' to fetch more results.`);
|
|
127
|
+
}
|
|
128
|
+
return `Next:\n${allSteps.map((step) => `- ${step}`).join('\n')}`;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Helper to generate contextual next steps based on task operations
|
|
132
|
+
*/
|
|
133
|
+
export function generateTaskNextSteps(operation, tasks, context) {
|
|
134
|
+
const nextSteps = [];
|
|
135
|
+
const count = context?.count ?? tasks.length;
|
|
136
|
+
switch (operation.toLowerCase()) {
|
|
137
|
+
case 'added':
|
|
138
|
+
// Context-aware suggestions for newly added tasks
|
|
139
|
+
if (context?.hasToday) {
|
|
140
|
+
nextSteps.push(`Use ${FIND_TASKS_BY_DATE}('today') to review today's updated schedule`);
|
|
141
|
+
}
|
|
142
|
+
else if (context?.hasOverdue) {
|
|
143
|
+
nextSteps.push(`Use ${FIND_TASKS_BY_DATE}('overdue') to prioritize past-due items`);
|
|
144
|
+
}
|
|
145
|
+
else if (context?.projectName) {
|
|
146
|
+
nextSteps.push(`Use ${GET_OVERVIEW} with projectId to see ${context.projectName} structure`);
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
nextSteps.push(`Use ${GET_OVERVIEW} to see your updated project organization`);
|
|
150
|
+
}
|
|
151
|
+
// Time-based suggestions
|
|
152
|
+
if (context?.timeOfDay === 'morning') {
|
|
153
|
+
nextSteps.push(`Use ${FIND_TASKS_BY_DATE}('today') to plan your day`);
|
|
154
|
+
}
|
|
155
|
+
break;
|
|
156
|
+
case 'updated':
|
|
157
|
+
case 'organized':
|
|
158
|
+
if (context?.hasToday) {
|
|
159
|
+
nextSteps.push(`Use ${FIND_TASKS_BY_DATE}('today') to see your prioritized schedule`);
|
|
160
|
+
}
|
|
161
|
+
else if (context?.hasHighPriority) {
|
|
162
|
+
nextSteps.push(`Use ${FIND_TASKS_BY_DATE} with filter to focus on high-priority items`);
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
nextSteps.push(`Use ${GET_OVERVIEW} to see your updated project structure`);
|
|
166
|
+
}
|
|
167
|
+
break;
|
|
168
|
+
case 'completed':
|
|
169
|
+
if (context?.timeOfDay === 'evening') {
|
|
170
|
+
nextSteps.push(`Use ${FIND_TASKS_BY_DATE}('tomorrow') to plan upcoming work`);
|
|
171
|
+
}
|
|
172
|
+
else if (context?.hasOverdue) {
|
|
173
|
+
nextSteps.push(`Use ${FIND_TASKS_BY_DATE}('overdue') to tackle remaining past-due items`);
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
nextSteps.push(`Use ${FIND_TASKS_BY_DATE}('today') to see remaining work`);
|
|
177
|
+
}
|
|
178
|
+
break;
|
|
179
|
+
case 'listed':
|
|
180
|
+
if (context?.isEmptyResult) {
|
|
181
|
+
nextSteps.push(`Use ${ADD_TASKS} to add tasks for this timeframe`);
|
|
182
|
+
nextSteps.push(`Use ${GET_OVERVIEW} with projectId to see tasks in other projects`);
|
|
183
|
+
}
|
|
184
|
+
else if (count > 0) {
|
|
185
|
+
// Tailor suggestions based on result size
|
|
186
|
+
if (count > DisplayLimits.BATCH_OPERATION_THRESHOLD) {
|
|
187
|
+
nextSteps.push(`Use ${UPDATE_TASKS} to batch-update priorities or dates`);
|
|
188
|
+
nextSteps.push('Consider breaking large tasks into subtasks');
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
nextSteps.push(`Use ${UPDATE_TASKS} to modify priorities or due dates`);
|
|
192
|
+
}
|
|
193
|
+
nextSteps.push(`Use ${COMPLETE_TASKS} to mark finished tasks`);
|
|
194
|
+
// Time-sensitive suggestions
|
|
195
|
+
if (context?.hasOverdue) {
|
|
196
|
+
nextSteps.push('Focus on overdue items first to get back on track');
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
break;
|
|
200
|
+
}
|
|
201
|
+
return nextSteps;
|
|
202
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PersonalProject, Section, Task } from '@doist/todoist-api-typescript';
|
|
2
|
+
import { getToolOutput } from '../mcp-helpers';
|
|
2
3
|
/**
|
|
3
4
|
* Mapped task type matching the output of mapTask function.
|
|
4
5
|
* Used for filter-based query test mocks.
|
|
@@ -63,6 +64,16 @@ export declare function createTestCases<T, E = unknown>(cases: Array<{
|
|
|
63
64
|
input: T;
|
|
64
65
|
expected?: E;
|
|
65
66
|
}[];
|
|
67
|
+
/**
|
|
68
|
+
* Extracts the text content from a tool output for snapshot testing.
|
|
69
|
+
* This allows tests to match against just the text content while tools return structured output.
|
|
70
|
+
*/
|
|
71
|
+
export declare function extractTextContent(toolOutput: unknown): string;
|
|
72
|
+
/**
|
|
73
|
+
* Extracts the structured content from a tool output for testing.
|
|
74
|
+
* This handles both the new `structuredContent` field and legacy JSON-encoded content.
|
|
75
|
+
*/
|
|
76
|
+
export declare function extractStructuredContent(output: ReturnType<typeof getToolOutput>): Record<string, unknown>;
|
|
66
77
|
/**
|
|
67
78
|
* Common mock IDs used across tests for consistency.
|
|
68
79
|
*/
|
|
@@ -77,4 +88,9 @@ export declare const TEST_IDS: {
|
|
|
77
88
|
readonly SECTION_2: "section-456";
|
|
78
89
|
readonly USER_ID: "713437";
|
|
79
90
|
};
|
|
91
|
+
/**
|
|
92
|
+
* Fixed date for consistent test snapshots.
|
|
93
|
+
* Use this instead of new Date() in tests to avoid snapshot drift.
|
|
94
|
+
*/
|
|
95
|
+
export declare const TODAY: "2025-08-17";
|
|
80
96
|
//# sourceMappingURL=test-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
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AAC,UAAU,CAAM,GAAG,UAAU,CAehF;AAED;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;CAKd,CAAA;AAEV;;GAEG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,EAC1C,KAAK,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,CAAC,CAAC;IAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;CAAE,CAAC;UAAjC,MAAM;WAAS,CAAC;eAAa,CAAC;IAGtD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,OAAO,GAAG,MAAM,CAqB9D;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACpC,MAAM,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,GACzC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAuBzB;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;CAUX,CAAA;AAEV;;;GAGG;AACH,eAAO,MAAM,KAAK,EAAG,YAAqB,CAAA"}
|
|
@@ -124,6 +124,52 @@ export const TEST_ERRORS = {
|
|
|
124
124
|
export function createTestCases(cases) {
|
|
125
125
|
return cases;
|
|
126
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* Extracts the text content from a tool output for snapshot testing.
|
|
129
|
+
* This allows tests to match against just the text content while tools return structured output.
|
|
130
|
+
*/
|
|
131
|
+
export function extractTextContent(toolOutput) {
|
|
132
|
+
if (typeof toolOutput === 'string') {
|
|
133
|
+
return toolOutput;
|
|
134
|
+
}
|
|
135
|
+
if (typeof toolOutput === 'object' && toolOutput !== null && 'content' in toolOutput) {
|
|
136
|
+
const output = toolOutput;
|
|
137
|
+
if (Array.isArray(output.content) &&
|
|
138
|
+
output.content[0] &&
|
|
139
|
+
typeof output.content[0] === 'object' &&
|
|
140
|
+
output.content[0] !== null &&
|
|
141
|
+
'type' in output.content[0] &&
|
|
142
|
+
'text' in output.content[0] &&
|
|
143
|
+
output.content[0].type === 'text') {
|
|
144
|
+
return output.content[0].text;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
throw new Error('Expected tool output to have text content');
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Extracts the structured content from a tool output for testing.
|
|
151
|
+
* This handles both the new `structuredContent` field and legacy JSON-encoded content.
|
|
152
|
+
*/
|
|
153
|
+
export function extractStructuredContent(output) {
|
|
154
|
+
// Check for new structuredContent field first
|
|
155
|
+
if ('structuredContent' in output && typeof output.structuredContent === 'object') {
|
|
156
|
+
return output.structuredContent;
|
|
157
|
+
}
|
|
158
|
+
// Fall back to checking for JSON content in the content array
|
|
159
|
+
if ('content' in output && Array.isArray(output.content)) {
|
|
160
|
+
for (const item of output.content) {
|
|
161
|
+
if (typeof item === 'object' &&
|
|
162
|
+
item !== null &&
|
|
163
|
+
'type' in item &&
|
|
164
|
+
'text' in item &&
|
|
165
|
+
item.type === 'text' &&
|
|
166
|
+
item.mimeType === 'application/json') {
|
|
167
|
+
return JSON.parse(item.text);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
throw new Error('Expected tool output to have structured content');
|
|
172
|
+
}
|
|
127
173
|
/**
|
|
128
174
|
* Common mock IDs used across tests for consistency.
|
|
129
175
|
*/
|
|
@@ -138,3 +184,8 @@ export const TEST_IDS = {
|
|
|
138
184
|
SECTION_2: 'section-456',
|
|
139
185
|
USER_ID: '713437',
|
|
140
186
|
};
|
|
187
|
+
/**
|
|
188
|
+
* Fixed date for consistent test snapshots.
|
|
189
|
+
* Use this instead of new Date() in tests to avoid snapshot drift.
|
|
190
|
+
*/
|
|
191
|
+
export const TODAY = '2025-08-17';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized tool names module
|
|
3
|
+
*
|
|
4
|
+
* This module provides a single source of truth for all tool names used throughout the codebase.
|
|
5
|
+
* Each tool should import its own name from this module to avoid hardcoded strings.
|
|
6
|
+
* This prevents outdated references when tool names change.
|
|
7
|
+
*/
|
|
8
|
+
export declare const ToolNames: {
|
|
9
|
+
readonly ADD_TASKS: "add-tasks";
|
|
10
|
+
readonly COMPLETE_TASKS: "complete-tasks";
|
|
11
|
+
readonly UPDATE_TASKS: "update-tasks";
|
|
12
|
+
readonly FIND_TASKS: "find-tasks";
|
|
13
|
+
readonly FIND_TASKS_BY_DATE: "find-tasks-by-date";
|
|
14
|
+
readonly FIND_COMPLETED_TASKS: "find-completed-tasks";
|
|
15
|
+
readonly FIND_PROJECTS: "find-projects";
|
|
16
|
+
readonly MANAGE_PROJECTS: "manage-projects";
|
|
17
|
+
readonly FIND_SECTIONS: "find-sections";
|
|
18
|
+
readonly MANAGE_SECTIONS: "manage-sections";
|
|
19
|
+
readonly GET_OVERVIEW: "get-overview";
|
|
20
|
+
readonly DELETE_OBJECT: "delete-object";
|
|
21
|
+
};
|
|
22
|
+
export type ToolName = (typeof ToolNames)[keyof typeof ToolNames];
|
|
23
|
+
//# sourceMappingURL=tool-names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-names.d.ts","sourceRoot":"","sources":["../../src/utils/tool-names.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;CAoBZ,CAAA;AAGV,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized tool names module
|
|
3
|
+
*
|
|
4
|
+
* This module provides a single source of truth for all tool names used throughout the codebase.
|
|
5
|
+
* Each tool should import its own name from this module to avoid hardcoded strings.
|
|
6
|
+
* This prevents outdated references when tool names change.
|
|
7
|
+
*/
|
|
8
|
+
export const ToolNames = {
|
|
9
|
+
// Task management tools
|
|
10
|
+
ADD_TASKS: 'add-tasks',
|
|
11
|
+
COMPLETE_TASKS: 'complete-tasks',
|
|
12
|
+
UPDATE_TASKS: 'update-tasks',
|
|
13
|
+
FIND_TASKS: 'find-tasks',
|
|
14
|
+
FIND_TASKS_BY_DATE: 'find-tasks-by-date',
|
|
15
|
+
FIND_COMPLETED_TASKS: 'find-completed-tasks',
|
|
16
|
+
// Project management tools
|
|
17
|
+
FIND_PROJECTS: 'find-projects',
|
|
18
|
+
MANAGE_PROJECTS: 'manage-projects',
|
|
19
|
+
// Section management tools
|
|
20
|
+
FIND_SECTIONS: 'find-sections',
|
|
21
|
+
MANAGE_SECTIONS: 'manage-sections',
|
|
22
|
+
// General tools
|
|
23
|
+
GET_OVERVIEW: 'get-overview',
|
|
24
|
+
DELETE_OBJECT: 'delete-object',
|
|
25
|
+
};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete-one.test.d.ts","sourceRoot":"","sources":["../../../src/tools/__tests__/delete-one.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"overview.test.d.ts","sourceRoot":"","sources":["../../../src/tools/__tests__/overview.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"projects-list.test.d.ts","sourceRoot":"","sources":["../../../src/tools/__tests__/projects-list.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"projects-manage.test.d.ts","sourceRoot":"","sources":["../../../src/tools/__tests__/projects-manage.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sections-manage.test.d.ts","sourceRoot":"","sources":["../../../src/tools/__tests__/sections-manage.test.ts"],"names":[],"mappings":""}
|