@doist/todoist-ai 4.1.0 → 4.5.1
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/dist/index.d.ts +405 -50
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -16
- package/dist/mcp-helpers.d.ts.map +1 -1
- package/dist/mcp-helpers.js +1 -1
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/mcp-server.js +80 -17
- package/dist/tool-helpers.d.ts +4 -0
- package/dist/tool-helpers.d.ts.map +1 -1
- package/dist/tool-helpers.js +2 -0
- package/dist/tools/__tests__/add-projects.test.js +1 -1
- package/dist/tools/__tests__/add-sections.test.js +1 -1
- package/dist/tools/__tests__/add-tasks.test.js +52 -13
- package/dist/tools/__tests__/assignment-integration.test.d.ts +2 -0
- package/dist/tools/__tests__/assignment-integration.test.d.ts.map +1 -0
- package/dist/tools/__tests__/assignment-integration.test.js +415 -0
- package/dist/tools/__tests__/find-completed-tasks.test.js +136 -2
- package/dist/tools/__tests__/find-projects.test.js +1 -1
- package/dist/tools/__tests__/find-sections.test.js +1 -1
- package/dist/tools/__tests__/find-tasks-by-date.test.js +122 -3
- package/dist/tools/__tests__/find-tasks.test.js +258 -11
- package/dist/tools/__tests__/get-overview.test.js +1 -1
- package/dist/tools/__tests__/update-sections.test.js +1 -0
- package/dist/tools/__tests__/update-tasks.test.js +6 -6
- package/dist/tools/__tests__/user-info.test.d.ts +2 -0
- package/dist/tools/__tests__/user-info.test.d.ts.map +1 -0
- package/dist/tools/__tests__/user-info.test.js +139 -0
- package/dist/tools/add-comments.d.ts +28 -5
- package/dist/tools/add-comments.d.ts.map +1 -1
- package/dist/tools/add-comments.js +1 -1
- package/dist/tools/add-projects.d.ts +46 -2
- package/dist/tools/add-projects.d.ts.map +1 -1
- package/dist/tools/add-projects.js +1 -1
- package/dist/tools/add-sections.d.ts +14 -2
- package/dist/tools/add-sections.d.ts.map +1 -1
- package/dist/tools/add-sections.js +1 -1
- package/dist/tools/add-tasks.d.ts +16 -10
- package/dist/tools/add-tasks.d.ts.map +1 -1
- package/dist/tools/add-tasks.js +49 -3
- package/dist/tools/find-comments.d.ts +27 -4
- package/dist/tools/find-comments.d.ts.map +1 -1
- package/dist/tools/find-completed-tasks.d.ts +12 -4
- package/dist/tools/find-completed-tasks.d.ts.map +1 -1
- package/dist/tools/find-completed-tasks.js +20 -4
- package/dist/tools/find-project-collaborators.d.ts +64 -0
- package/dist/tools/find-project-collaborators.d.ts.map +1 -0
- package/dist/tools/find-project-collaborators.js +151 -0
- package/dist/tools/find-tasks-by-date.d.ts +8 -0
- package/dist/tools/find-tasks-by-date.d.ts.map +1 -1
- package/dist/tools/find-tasks-by-date.js +19 -2
- package/dist/tools/find-tasks.d.ts +13 -2
- package/dist/tools/find-tasks.d.ts.map +1 -1
- package/dist/tools/find-tasks.js +172 -23
- package/dist/tools/get-overview.d.ts +2 -2
- package/dist/tools/get-overview.d.ts.map +1 -1
- package/dist/tools/get-overview.js +1 -1
- package/dist/tools/manage-assignments.d.ts +52 -0
- package/dist/tools/manage-assignments.d.ts.map +1 -0
- package/dist/tools/manage-assignments.js +337 -0
- package/dist/tools/update-comments.d.ts +25 -2
- package/dist/tools/update-comments.d.ts.map +1 -1
- package/dist/tools/update-comments.js +1 -1
- package/dist/tools/update-projects.d.ts +46 -2
- package/dist/tools/update-projects.d.ts.map +1 -1
- package/dist/tools/update-sections.d.ts +14 -2
- package/dist/tools/update-sections.d.ts.map +1 -1
- package/dist/tools/update-sections.js +1 -1
- package/dist/tools/update-tasks.d.ts +16 -10
- package/dist/tools/update-tasks.d.ts.map +1 -1
- package/dist/tools/update-tasks.js +32 -9
- package/dist/tools/user-info.d.ts +44 -0
- package/dist/tools/user-info.d.ts.map +1 -0
- package/dist/tools/user-info.js +142 -0
- package/dist/utils/assignment-validator.d.ts +69 -0
- package/dist/utils/assignment-validator.d.ts.map +1 -0
- package/dist/utils/assignment-validator.js +253 -0
- package/dist/utils/duration-parser.d.ts +2 -2
- package/dist/utils/duration-parser.d.ts.map +1 -1
- package/dist/utils/labels.d.ts +10 -0
- package/dist/utils/labels.d.ts.map +1 -0
- package/dist/utils/labels.js +18 -0
- package/dist/utils/priorities.d.ts +8 -0
- package/dist/utils/priorities.d.ts.map +1 -0
- package/dist/utils/priorities.js +15 -0
- package/dist/utils/response-builders.d.ts +2 -2
- package/dist/utils/response-builders.d.ts.map +1 -1
- package/dist/utils/response-builders.js +8 -1
- package/dist/utils/test-helpers.d.ts +2 -0
- package/dist/utils/test-helpers.d.ts.map +1 -1
- package/dist/utils/test-helpers.js +3 -0
- package/dist/utils/tool-names.d.ts +3 -0
- package/dist/utils/tool-names.d.ts.map +1 -1
- package/dist/utils/tool-names.js +4 -0
- package/dist/utils/user-resolver.d.ts +39 -0
- package/dist/utils/user-resolver.d.ts.map +1 -0
- package/dist/utils/user-resolver.js +179 -0
- package/package.json +7 -7
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAErD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAErD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAEzD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,EA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAhCv8Y,CAAA;AAED,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,CAAA;AAE9B,OAAO,EAEH,QAAQ,EACR,aAAa,EACb,WAAW,EACX,SAAS,EACT,eAAe,EACf,kBAAkB,EAElB,WAAW,EACX,cAAc,EACd,YAAY,EAEZ,WAAW,EACX,cAAc,EACd,YAAY,EAEZ,WAAW,EACX,cAAc,EACd,YAAY,EAEZ,WAAW,EACX,YAAY,EACZ,QAAQ,EAER,wBAAwB,EACxB,iBAAiB,GACpB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
import { getMcpServer } from './mcp-server.js';
|
|
2
|
-
//
|
|
3
|
-
import {
|
|
4
|
-
import { completeTasks } from './tools/complete-tasks.js';
|
|
5
|
-
import { findCompletedTasks } from './tools/find-completed-tasks.js';
|
|
6
|
-
import { findTasksByDate } from './tools/find-tasks-by-date.js';
|
|
7
|
-
import { findTasks } from './tools/find-tasks.js';
|
|
8
|
-
import { updateTasks } from './tools/update-tasks.js';
|
|
2
|
+
// Comment management tools
|
|
3
|
+
import { addComments } from './tools/add-comments.js';
|
|
9
4
|
// Project management tools
|
|
10
5
|
import { addProjects } from './tools/add-projects.js';
|
|
11
|
-
import { findProjects } from './tools/find-projects.js';
|
|
12
|
-
import { updateProjects } from './tools/update-projects.js';
|
|
13
6
|
// Section management tools
|
|
14
7
|
import { addSections } from './tools/add-sections.js';
|
|
15
|
-
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
import { addComments } from './tools/add-comments.js';
|
|
19
|
-
import { findComments } from './tools/find-comments.js';
|
|
20
|
-
import { updateComments } from './tools/update-comments.js';
|
|
8
|
+
// Task management tools
|
|
9
|
+
import { addTasks } from './tools/add-tasks.js';
|
|
10
|
+
import { completeTasks } from './tools/complete-tasks.js';
|
|
21
11
|
// General tools
|
|
22
12
|
import { deleteObject } from './tools/delete-object.js';
|
|
13
|
+
import { findComments } from './tools/find-comments.js';
|
|
14
|
+
import { findCompletedTasks } from './tools/find-completed-tasks.js';
|
|
15
|
+
// Assignment and collaboration tools
|
|
16
|
+
import { findProjectCollaborators } from './tools/find-project-collaborators.js';
|
|
17
|
+
import { findProjects } from './tools/find-projects.js';
|
|
18
|
+
import { findSections } from './tools/find-sections.js';
|
|
19
|
+
import { findTasks } from './tools/find-tasks.js';
|
|
20
|
+
import { findTasksByDate } from './tools/find-tasks-by-date.js';
|
|
23
21
|
import { getOverview } from './tools/get-overview.js';
|
|
22
|
+
import { manageAssignments } from './tools/manage-assignments.js';
|
|
23
|
+
import { updateComments } from './tools/update-comments.js';
|
|
24
|
+
import { updateProjects } from './tools/update-projects.js';
|
|
25
|
+
import { updateSections } from './tools/update-sections.js';
|
|
26
|
+
import { updateTasks } from './tools/update-tasks.js';
|
|
27
|
+
import { userInfo } from './tools/user-info.js';
|
|
24
28
|
const tools = {
|
|
25
29
|
// Task management tools
|
|
26
30
|
addTasks,
|
|
@@ -44,6 +48,10 @@ const tools = {
|
|
|
44
48
|
// General tools
|
|
45
49
|
getOverview,
|
|
46
50
|
deleteObject,
|
|
51
|
+
userInfo,
|
|
52
|
+
// Assignment and collaboration tools
|
|
53
|
+
findProjectCollaborators,
|
|
54
|
+
manageAssignments,
|
|
47
55
|
};
|
|
48
56
|
export { tools, getMcpServer };
|
|
49
57
|
export {
|
|
@@ -56,4 +64,6 @@ addSections, updateSections, findSections,
|
|
|
56
64
|
// Comment management tools
|
|
57
65
|
addComments, updateComments, findComments,
|
|
58
66
|
// General tools
|
|
59
|
-
getOverview, deleteObject,
|
|
67
|
+
getOverview, deleteObject, userInfo,
|
|
68
|
+
// Assignment and collaboration tools
|
|
69
|
+
findProjectCollaborators, manageAssignments, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-helpers.d.ts","sourceRoot":"","sources":["../src/mcp-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAgB,MAAM,yCAAyC,CAAA;AACtF,OAAO,KAAK,EAAc,CAAC,EAAE,MAAM,KAAK,CAAA;AACxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAkBpD;;;;;;;GAOG;AACH,iBAAS,aAAa,CAAC,iBAAiB,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EACtE,WAAW,EACX,iBAAiB,GACpB,EAAE;
|
|
1
|
+
{"version":3,"file":"mcp-helpers.d.ts","sourceRoot":"","sources":["../src/mcp-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAgB,MAAM,yCAAyC,CAAA;AACtF,OAAO,KAAK,EAAc,CAAC,EAAE,MAAM,KAAK,CAAA;AACxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAkBpD;;;;;;;GAOG;AACH,iBAAS,aAAa,CAAC,iBAAiB,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EACtE,WAAW,EACX,iBAAiB,GACpB,EAAE;IACC,WAAW,EAAE,MAAM,CAAA;IACnB,iBAAiB,EAAE,iBAAiB,CAAA;CACvC;;;;;;;;;;;;;;;;;EAeA;AASD;;;;;GAKG;AACH,iBAAS,YAAY,CAAC,MAAM,SAAS,CAAC,CAAC,WAAW,EAC9C,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,EACzB,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,UAAU,QAqBrB;AAED,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,CAAA"}
|
package/dist/mcp-helpers.js
CHANGED
|
@@ -48,7 +48,7 @@ function getErrorOutput(error) {
|
|
|
48
48
|
* @param client - The Todoist API client to use to execute the tool.
|
|
49
49
|
*/
|
|
50
50
|
function registerTool(tool, server, client) {
|
|
51
|
-
// @ts-
|
|
51
|
+
// @ts-expect-error I give up
|
|
52
52
|
const cb = async (args, _context) => {
|
|
53
53
|
try {
|
|
54
54
|
const result = await tool.execute(args, client);
|
package/dist/mcp-server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../src/mcp-server.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;
|
|
1
|
+
{"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../src/mcp-server.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAwFnE;;;;;GAKG;AACH,iBAAS,YAAY,CAAC,EAAE,aAAa,EAAE,OAAO,EAAE,EAAE;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,aA8C5F;AAED,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
package/dist/mcp-server.js
CHANGED
|
@@ -1,30 +1,89 @@
|
|
|
1
1
|
import { TodoistApi } from '@doist/todoist-api-typescript';
|
|
2
2
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
3
|
import { registerTool } from './mcp-helpers.js';
|
|
4
|
-
|
|
4
|
+
import { addComments } from './tools/add-comments.js';
|
|
5
|
+
import { addProjects } from './tools/add-projects.js';
|
|
6
|
+
import { addSections } from './tools/add-sections.js';
|
|
5
7
|
import { addTasks } from './tools/add-tasks.js';
|
|
6
8
|
import { completeTasks } from './tools/complete-tasks.js';
|
|
9
|
+
import { deleteObject } from './tools/delete-object.js';
|
|
10
|
+
import { findComments } from './tools/find-comments.js';
|
|
7
11
|
import { findCompletedTasks } from './tools/find-completed-tasks.js';
|
|
8
|
-
import {
|
|
9
|
-
import { findTasks } from './tools/find-tasks.js';
|
|
10
|
-
import { updateTasks } from './tools/update-tasks.js';
|
|
11
|
-
// Project management tools
|
|
12
|
-
import { addProjects } from './tools/add-projects.js';
|
|
12
|
+
import { findProjectCollaborators } from './tools/find-project-collaborators.js';
|
|
13
13
|
import { findProjects } from './tools/find-projects.js';
|
|
14
|
-
import { updateProjects } from './tools/update-projects.js';
|
|
15
|
-
// Section management tools
|
|
16
|
-
import { addSections } from './tools/add-sections.js';
|
|
17
14
|
import { findSections } from './tools/find-sections.js';
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
import { addComments } from './tools/add-comments.js';
|
|
21
|
-
import { findComments } from './tools/find-comments.js';
|
|
22
|
-
import { updateComments } from './tools/update-comments.js';
|
|
23
|
-
// General tools
|
|
24
|
-
import { deleteObject } from './tools/delete-object.js';
|
|
15
|
+
import { findTasks } from './tools/find-tasks.js';
|
|
16
|
+
import { findTasksByDate } from './tools/find-tasks-by-date.js';
|
|
25
17
|
import { getOverview } from './tools/get-overview.js';
|
|
18
|
+
import { manageAssignments } from './tools/manage-assignments.js';
|
|
19
|
+
import { updateComments } from './tools/update-comments.js';
|
|
20
|
+
import { updateProjects } from './tools/update-projects.js';
|
|
21
|
+
import { updateSections } from './tools/update-sections.js';
|
|
22
|
+
import { updateTasks } from './tools/update-tasks.js';
|
|
23
|
+
import { userInfo } from './tools/user-info.js';
|
|
26
24
|
const instructions = `
|
|
27
|
-
|
|
25
|
+
## Todoist Task and Project Management Tools
|
|
26
|
+
|
|
27
|
+
You have access to comprehensive Todoist management tools for personal productivity and team collaboration. Use these tools to help users manage tasks, projects, sections, comments, and assignments effectively.
|
|
28
|
+
|
|
29
|
+
### Core Capabilities:
|
|
30
|
+
- Create, update, complete, and search tasks with rich metadata (priorities, due dates, durations, assignments)
|
|
31
|
+
- Manage projects and sections with flexible organization
|
|
32
|
+
- Handle comments and collaboration features
|
|
33
|
+
- Bulk assignment operations for team workflows
|
|
34
|
+
- Get overviews and insights about workload and progress
|
|
35
|
+
|
|
36
|
+
### Tool Usage Guidelines:
|
|
37
|
+
|
|
38
|
+
**Task Management:**
|
|
39
|
+
- **add-tasks**: Create tasks with content, description, priority (p1=highest, p2=high, p3=medium, p4=lowest/default), dueString (natural language like "tomorrow", "next Friday", "2024-12-25"), duration (formats like "2h", "90m", "2h30m"), and assignments to project collaborators
|
|
40
|
+
- **update-tasks**: Modify existing tasks - get task IDs from search results first, only include fields that need changes
|
|
41
|
+
- **complete-tasks**: Mark tasks as done using task IDs
|
|
42
|
+
- **find-tasks**: Search by text, project/section/parent container, responsible user, or labels. Requires at least one search parameter
|
|
43
|
+
- **find-tasks-by-date**: Get tasks by date range (startDate: YYYY-MM-DD, 'today', or 'overdue') or specific day counts
|
|
44
|
+
- **find-completed-tasks**: View completed tasks by completion date or original due date
|
|
45
|
+
|
|
46
|
+
**Project & Organization:**
|
|
47
|
+
- **add-projects/update-projects/find-projects**: Manage project lifecycle with names, favorites, and view styles (list/board/calendar)
|
|
48
|
+
- **add-sections/update-sections/find-sections**: Organize tasks within projects using sections
|
|
49
|
+
- **get-overview**: Get comprehensive Markdown overview of entire account or specific project with task hierarchies
|
|
50
|
+
|
|
51
|
+
**Collaboration & Comments:**
|
|
52
|
+
- **add-comments/update-comments/find-comments**: Manage task and project discussions
|
|
53
|
+
- **find-project-collaborators**: Find team members by name or email for assignments
|
|
54
|
+
- **manage-assignments**: Bulk assign/unassign/reassign up to 50 tasks with atomic operations and dry-run validation
|
|
55
|
+
|
|
56
|
+
**General Operations:**
|
|
57
|
+
- **delete-object**: Remove projects, sections, tasks, or comments by type and ID
|
|
58
|
+
- **user-info**: Get user details including timezone, goals, and plan information
|
|
59
|
+
|
|
60
|
+
### Best Practices:
|
|
61
|
+
|
|
62
|
+
1. **Task Creation**: Write clear, actionable task titles. Use natural language for due dates ("tomorrow", "next Monday"). Set appropriate priorities and include detailed descriptions when needed.
|
|
63
|
+
|
|
64
|
+
2. **Search Strategy**: Use specific search queries combining multiple filters for precise results. When searching for tasks, start with broader queries and narrow down as needed.
|
|
65
|
+
|
|
66
|
+
3. **Assignments**: Always validate project collaborators exist before assigning tasks. Use find-project-collaborators to verify user access.
|
|
67
|
+
|
|
68
|
+
4. **Bulk Operations**: When working with multiple items, prefer bulk tools (complete-tasks, manage-assignments) over individual operations for better performance.
|
|
69
|
+
|
|
70
|
+
5. **Date Handling**: All dates respect user timezone settings. Use 'today' and 'overdue' keywords for dynamic date filtering.
|
|
71
|
+
|
|
72
|
+
6. **Labels**: Use label filtering with AND/OR operators for advanced task organization. Most search tools support labels parameter.
|
|
73
|
+
|
|
74
|
+
7. **Pagination**: Large result sets use cursor-based pagination. Use limit parameter to control result size (default varies by tool).
|
|
75
|
+
|
|
76
|
+
8. **Error Handling**: All tools provide detailed error messages and next-step suggestions. Pay attention to validation feedback for corrective actions.
|
|
77
|
+
|
|
78
|
+
### Common Workflows:
|
|
79
|
+
|
|
80
|
+
- **Daily Planning**: Use find-tasks-by-date with 'today' and get-overview for project status
|
|
81
|
+
- **Team Assignment**: find-project-collaborators → add-tasks with responsibleUser → manage-assignments for bulk changes
|
|
82
|
+
- **Task Search**: find-tasks with multiple filters → update-tasks or complete-tasks based on results
|
|
83
|
+
- **Project Organization**: add-projects → add-sections → add-tasks with projectId and sectionId
|
|
84
|
+
- **Progress Reviews**: find-completed-tasks with date ranges → get-overview for project summaries
|
|
85
|
+
|
|
86
|
+
Always provide clear, actionable task titles and descriptions. Use the overview tools to give users context about their workload and project status.
|
|
28
87
|
`;
|
|
29
88
|
/**
|
|
30
89
|
* Create the MCP server.
|
|
@@ -62,6 +121,10 @@ function getMcpServer({ todoistApiKey, baseUrl }) {
|
|
|
62
121
|
// General tools
|
|
63
122
|
registerTool(getOverview, server, todoist);
|
|
64
123
|
registerTool(deleteObject, server, todoist);
|
|
124
|
+
registerTool(userInfo, server, todoist);
|
|
125
|
+
// Assignment and collaboration tools
|
|
126
|
+
registerTool(findProjectCollaborators, server, todoist);
|
|
127
|
+
registerTool(manageAssignments, server, todoist);
|
|
65
128
|
return server;
|
|
66
129
|
}
|
|
67
130
|
export { getMcpServer };
|
package/dist/tool-helpers.d.ts
CHANGED
|
@@ -29,6 +29,8 @@ declare function mapTask(task: Task): {
|
|
|
29
29
|
parentId: string | null;
|
|
30
30
|
labels: string[];
|
|
31
31
|
duration: string | null;
|
|
32
|
+
responsibleUid: string | null;
|
|
33
|
+
assignedByUid: string | null;
|
|
32
34
|
};
|
|
33
35
|
/**
|
|
34
36
|
* Map a single Todoist project to a more structured format, for LLM consumption.
|
|
@@ -63,6 +65,8 @@ declare function getTasksByFilter({ client, query, limit, cursor, }: {
|
|
|
63
65
|
parentId: string | null;
|
|
64
66
|
labels: string[];
|
|
65
67
|
duration: string | null;
|
|
68
|
+
responsibleUid: string | null;
|
|
69
|
+
assignedByUid: string | null;
|
|
66
70
|
}[];
|
|
67
71
|
nextCursor: string | null;
|
|
68
72
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-helpers.d.ts","sourceRoot":"","sources":["../src/tool-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"tool-helpers.d.ts","sourceRoot":"","sources":["../src/tool-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,IAAI,EACT,KAAK,UAAU,EACf,KAAK,gBAAgB,EACxB,MAAM,+BAA+B,CAAA;AAItC,MAAM,MAAM,OAAO,GAAG,eAAe,GAAG,gBAAgB,CAAA;AAExD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,eAAe,CAE9E;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,gBAAgB,CAEhF;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAC9B,MAAM,EAAE,MAAM,EACd,SAAS,CAAC,EAAE,MAAM,EAClB,SAAS,CAAC,EAAE,MAAM,EAClB,QAAQ,CAAC,EAAE,MAAM,GAClB,YAAY,CAsBd;AAED;;;;GAIG;AACH,iBAAS,OAAO,CAAC,IAAI,EAAE,IAAI;;;;;;;;;;;;;;EAgB1B;AAED;;;;GAIG;AACH,iBAAS,UAAU,CAAC,OAAO,EAAE,OAAO;;;;;;;;;EAWnC;AAWD,iBAAe,gBAAgB,CAAC,EAC5B,MAAM,EACN,KAAK,EACL,KAAK,EACL,MAAM,GACT,EAAE;IACC,MAAM,EAAE,UAAU,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;CAC7B;;;;;;;;;;;;;;;;;GAyBA;AAED,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
package/dist/tool-helpers.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jest } from '@jest/globals';
|
|
2
|
-
import {
|
|
2
|
+
import { createMockProject, extractStructuredContent, extractTextContent, TEST_IDS, } from '../../utils/test-helpers.js';
|
|
3
3
|
import { ToolNames } from '../../utils/tool-names.js';
|
|
4
4
|
import { addProjects } from '../add-projects.js';
|
|
5
5
|
// Mock the Todoist API
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jest } from '@jest/globals';
|
|
2
|
-
import {
|
|
2
|
+
import { createMockSection, extractStructuredContent, extractTextContent, TEST_IDS, } from '../../utils/test-helpers.js';
|
|
3
3
|
import { ToolNames } from '../../utils/tool-names.js';
|
|
4
4
|
import { addSections } from '../add-sections.js';
|
|
5
5
|
// Mock the Todoist API
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jest } from '@jest/globals';
|
|
2
|
-
import {
|
|
2
|
+
import { createMockTask, extractStructuredContent, extractTextContent, TODAY, } from '../../utils/test-helpers.js';
|
|
3
3
|
import { ToolNames } from '../../utils/tool-names.js';
|
|
4
4
|
import { addTasks } from '../add-tasks.js';
|
|
5
5
|
// Mock the Todoist API
|
|
@@ -42,11 +42,14 @@ describe(`${ADD_TASKS} tool`, () => {
|
|
|
42
42
|
.mockResolvedValueOnce(mockApiResponse2);
|
|
43
43
|
const result = await addTasks.execute({
|
|
44
44
|
tasks: [
|
|
45
|
-
{
|
|
45
|
+
{
|
|
46
|
+
content: 'First task content',
|
|
47
|
+
projectId: '6cfCcrrCFg2xP94Q',
|
|
48
|
+
},
|
|
46
49
|
{
|
|
47
50
|
content: 'Second task content',
|
|
48
51
|
description: 'Task description',
|
|
49
|
-
priority:
|
|
52
|
+
priority: 'p2',
|
|
50
53
|
dueString: 'Aug 15',
|
|
51
54
|
projectId: '6cfCcrrCFg2xP94Q',
|
|
52
55
|
},
|
|
@@ -63,7 +66,7 @@ describe(`${ADD_TASKS} tool`, () => {
|
|
|
63
66
|
expect(mockTodoistApi.addTask).toHaveBeenNthCalledWith(2, {
|
|
64
67
|
content: 'Second task content',
|
|
65
68
|
description: 'Task description',
|
|
66
|
-
priority:
|
|
69
|
+
priority: 3,
|
|
67
70
|
dueString: 'Aug 15',
|
|
68
71
|
projectId: '6cfCcrrCFg2xP94Q',
|
|
69
72
|
sectionId: undefined,
|
|
@@ -99,7 +102,7 @@ describe(`${ADD_TASKS} tool`, () => {
|
|
|
99
102
|
{
|
|
100
103
|
content: 'Subtask content',
|
|
101
104
|
description: 'Subtask description',
|
|
102
|
-
priority:
|
|
105
|
+
priority: 'p3',
|
|
103
106
|
projectId: '6cfCcrrCFg2xP94Q',
|
|
104
107
|
sectionId: 'section-123',
|
|
105
108
|
parentId: 'parent-task-456',
|
|
@@ -109,7 +112,7 @@ describe(`${ADD_TASKS} tool`, () => {
|
|
|
109
112
|
expect(mockTodoistApi.addTask).toHaveBeenCalledWith({
|
|
110
113
|
content: 'Subtask content',
|
|
111
114
|
description: 'Subtask description',
|
|
112
|
-
priority:
|
|
115
|
+
priority: 2,
|
|
113
116
|
projectId: '6cfCcrrCFg2xP94Q',
|
|
114
117
|
sectionId: 'section-123',
|
|
115
118
|
parentId: 'parent-task-456',
|
|
@@ -203,7 +206,15 @@ describe(`${ADD_TASKS} tool`, () => {
|
|
|
203
206
|
];
|
|
204
207
|
for (const testCase of testCases) {
|
|
205
208
|
mockTodoistApi.addTask.mockClear();
|
|
206
|
-
await addTasks.execute({
|
|
209
|
+
await addTasks.execute({
|
|
210
|
+
tasks: [
|
|
211
|
+
{
|
|
212
|
+
content: 'Test task',
|
|
213
|
+
duration: testCase.input,
|
|
214
|
+
projectId: '6cfCcrrCFg2xP94Q',
|
|
215
|
+
},
|
|
216
|
+
],
|
|
217
|
+
}, mockTodoistApi);
|
|
207
218
|
expect(mockTodoistApi.addTask).toHaveBeenCalledWith(expect.objectContaining({
|
|
208
219
|
duration: testCase.expectedMinutes,
|
|
209
220
|
durationUnit: 'minute',
|
|
@@ -213,15 +224,31 @@ describe(`${ADD_TASKS} tool`, () => {
|
|
|
213
224
|
});
|
|
214
225
|
describe('error handling', () => {
|
|
215
226
|
it('should throw error for invalid duration format', async () => {
|
|
216
|
-
await expect(addTasks.execute({
|
|
227
|
+
await expect(addTasks.execute({
|
|
228
|
+
tasks: [
|
|
229
|
+
{
|
|
230
|
+
content: 'Task with invalid duration',
|
|
231
|
+
duration: 'invalid',
|
|
232
|
+
projectId: '6cfCcrrCFg2xP94Q',
|
|
233
|
+
},
|
|
234
|
+
],
|
|
235
|
+
}, mockTodoistApi)).rejects.toThrow('Task "Task with invalid duration": Invalid duration format "invalid"');
|
|
217
236
|
});
|
|
218
237
|
it('should throw error for duration exceeding 24 hours', async () => {
|
|
219
|
-
await expect(addTasks.execute({
|
|
238
|
+
await expect(addTasks.execute({
|
|
239
|
+
tasks: [
|
|
240
|
+
{
|
|
241
|
+
content: 'Task with too long duration',
|
|
242
|
+
duration: '25h',
|
|
243
|
+
projectId: '6cfCcrrCFg2xP94Q',
|
|
244
|
+
},
|
|
245
|
+
],
|
|
246
|
+
}, mockTodoistApi)).rejects.toThrow('Task "Task with too long duration": Invalid duration format "25h": Duration cannot exceed 24 hours (1440 minutes)');
|
|
220
247
|
});
|
|
221
248
|
it('should propagate API errors', async () => {
|
|
222
249
|
const apiError = new Error('API Error: Task content is required');
|
|
223
250
|
mockTodoistApi.addTask.mockRejectedValue(apiError);
|
|
224
|
-
await expect(addTasks.execute({ tasks: [{ content: '' }] }, mockTodoistApi)).rejects.toThrow(apiError.message);
|
|
251
|
+
await expect(addTasks.execute({ tasks: [{ content: '', projectId: '6cfCcrrCFg2xP94Q' }] }, mockTodoistApi)).rejects.toThrow(apiError.message);
|
|
225
252
|
});
|
|
226
253
|
it('should handle partial failures when adding multiple tasks', async () => {
|
|
227
254
|
const mockApiResponse = createMockTask({
|
|
@@ -236,8 +263,8 @@ describe(`${ADD_TASKS} tool`, () => {
|
|
|
236
263
|
.mockRejectedValueOnce(apiError);
|
|
237
264
|
await expect(addTasks.execute({
|
|
238
265
|
tasks: [
|
|
239
|
-
{ content: 'First task content' },
|
|
240
|
-
{ content: 'Second task content' },
|
|
266
|
+
{ content: 'First task content', projectId: '6cfCcrrCFg2xP94Q' },
|
|
267
|
+
{ content: 'Second task content', projectId: '6cfCcrrCFg2xP94Q' },
|
|
241
268
|
],
|
|
242
269
|
}, mockTodoistApi)).rejects.toThrow('API Error: Second task failed');
|
|
243
270
|
// Verify first task was attempted
|
|
@@ -246,6 +273,8 @@ describe(`${ADD_TASKS} tool`, () => {
|
|
|
246
273
|
});
|
|
247
274
|
describe('next steps logic', () => {
|
|
248
275
|
it('should suggest find-tasks-by-date for today when hasToday is true', async () => {
|
|
276
|
+
// Clear any leftover mocks from previous tests
|
|
277
|
+
mockTodoistApi.addTask.mockClear();
|
|
249
278
|
const mockApiResponse = createMockTask({
|
|
250
279
|
id: '8485093755',
|
|
251
280
|
content: 'Task due today',
|
|
@@ -260,12 +289,22 @@ describe(`${ADD_TASKS} tool`, () => {
|
|
|
260
289
|
},
|
|
261
290
|
});
|
|
262
291
|
mockTodoistApi.addTask.mockResolvedValue(mockApiResponse);
|
|
263
|
-
const result = await addTasks.execute({
|
|
292
|
+
const result = await addTasks.execute({
|
|
293
|
+
tasks: [
|
|
294
|
+
{
|
|
295
|
+
content: 'Task due today',
|
|
296
|
+
dueString: 'today',
|
|
297
|
+
projectId: '6cfCcrrCFg2xP94Q',
|
|
298
|
+
},
|
|
299
|
+
],
|
|
300
|
+
}, mockTodoistApi);
|
|
264
301
|
const textContent = extractTextContent(result);
|
|
265
302
|
expect(textContent).toMatchSnapshot();
|
|
266
303
|
expect(textContent).toContain(`Use ${GET_OVERVIEW} to see your updated project organization`);
|
|
267
304
|
});
|
|
268
305
|
it('should suggest overview tool when no hasToday context', async () => {
|
|
306
|
+
// Clear any leftover mocks from previous tests
|
|
307
|
+
mockTodoistApi.addTask.mockClear();
|
|
269
308
|
const mockApiResponse = createMockTask({
|
|
270
309
|
id: '8485093756',
|
|
271
310
|
content: 'Regular task',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assignment-integration.test.d.ts","sourceRoot":"","sources":["../../../src/tools/__tests__/assignment-integration.test.ts"],"names":[],"mappings":""}
|