@doist/todoist-ai 0.1.3 → 1.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 +27 -0
- package/dist/{esm/index.d.ts → index.d.ts} +34 -34
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +74 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/{cjs/main.js → main.js} +7 -7
- package/dist/{types/mcp-helpers.d.ts → mcp-helpers.d.ts} +5 -4
- package/dist/mcp-helpers.d.ts.map +1 -0
- package/dist/{cjs/mcp-helpers.js → mcp-helpers.js} +5 -7
- package/dist/mcp-server.d.ts +13 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mcp-server.js +69 -0
- package/dist/{types/todoist-tool.d.ts → todoist-tool.d.ts} +3 -2
- package/dist/todoist-tool.d.ts.map +1 -0
- package/dist/{types/tools → tools}/account-overview.d.ts +2 -1
- package/dist/tools/account-overview.d.ts.map +1 -0
- package/dist/{cjs/tools → tools}/account-overview.js +12 -11
- package/dist/{esm/tools → tools}/project-overview.d.ts +2 -2
- package/dist/tools/project-overview.d.ts.map +1 -0
- package/dist/{cjs/tools → tools}/project-overview.js +9 -12
- package/dist/{esm/tools → tools}/projects-add-one.d.ts +1 -1
- package/dist/tools/projects-add-one.d.ts.map +1 -0
- package/dist/{cjs/tools → tools}/projects-add-one.js +5 -5
- package/dist/{types/tools → tools}/projects-delete-one.d.ts +2 -1
- package/dist/tools/projects-delete-one.d.ts.map +1 -0
- package/dist/{cjs/tools → tools}/projects-delete-one.js +3 -3
- package/dist/{esm/tools → tools}/projects-list.d.ts +2 -2
- package/dist/tools/projects-list.d.ts.map +1 -0
- package/dist/{cjs/tools → tools}/projects-list.js +4 -4
- package/dist/{esm/tools → tools}/projects-search.d.ts +1 -1
- package/dist/tools/projects-search.d.ts.map +1 -0
- package/dist/{cjs/tools → tools}/projects-search.js +7 -7
- package/dist/{types/tools → tools}/projects-update-one.d.ts +4 -3
- package/dist/tools/projects-update-one.d.ts.map +1 -0
- package/dist/{cjs/tools → tools}/projects-update-one.js +3 -3
- package/dist/{types/tools → tools}/sections-add-one.d.ts +2 -1
- package/dist/tools/sections-add-one.d.ts.map +1 -0
- package/dist/{cjs/tools → tools}/sections-add-one.js +4 -7
- package/dist/{esm/tools → tools}/sections-delete-one.d.ts +1 -1
- package/dist/tools/sections-delete-one.d.ts.map +1 -0
- package/dist/{cjs/tools → tools}/sections-delete-one.js +3 -3
- package/dist/{types/tools → tools}/sections-search.d.ts +2 -1
- package/dist/tools/sections-search.d.ts.map +1 -0
- package/dist/{cjs/tools → tools}/sections-search.js +4 -7
- package/dist/{esm/tools → tools}/sections-update-one.d.ts +2 -2
- package/dist/tools/sections-update-one.d.ts.map +1 -0
- package/dist/{cjs/tools → tools}/sections-update-one.js +3 -3
- package/dist/{types/tools → tools}/shared.d.ts +5 -1
- package/dist/tools/shared.d.ts.map +1 -0
- package/dist/{cjs/tools → tools}/shared.js +11 -3
- package/dist/tools/shared.test.d.ts +2 -0
- package/dist/tools/shared.test.d.ts.map +1 -0
- package/dist/tools/shared.test.js +135 -0
- package/dist/{types/tools → tools}/subtasks-list-for-parent-task.d.ts +3 -2
- package/dist/tools/subtasks-list-for-parent-task.d.ts.map +1 -0
- package/dist/{cjs/tools → tools}/subtasks-list-for-parent-task.js +7 -10
- package/dist/{types/tools → tools}/tasks-add-multiple.d.ts +3 -2
- package/dist/tools/tasks-add-multiple.d.ts.map +1 -0
- package/dist/tools/tasks-add-multiple.js +32 -0
- package/dist/{types/tools → tools}/tasks-complete-multiple.d.ts +2 -1
- package/dist/tools/tasks-complete-multiple.d.ts.map +1 -0
- package/dist/{cjs/tools → tools}/tasks-complete-multiple.js +3 -6
- package/dist/{types/tools → tools}/tasks-delete-one.d.ts +2 -1
- package/dist/tools/tasks-delete-one.d.ts.map +1 -0
- package/dist/{cjs/tools → tools}/tasks-delete-one.js +3 -3
- package/dist/{types/tools/tasks-by-date-range.d.ts → tools/tasks-list-by-date.d.ts} +2 -1
- package/dist/tools/tasks-list-by-date.d.ts.map +1 -0
- package/dist/{cjs/tools/tasks-by-date-range.js → tools/tasks-list-by-date.js} +10 -10
- package/dist/{types/tools/tasks-by-project.d.ts → tools/tasks-list-for-project.d.ts} +2 -1
- package/dist/tools/tasks-list-for-project.d.ts.map +1 -0
- package/dist/{cjs/tools/tasks-by-project.js → tools/tasks-list-for-project.js} +7 -10
- package/dist/{esm/tools → tools}/tasks-list-for-section.d.ts +1 -1
- package/dist/tools/tasks-list-for-section.d.ts.map +1 -0
- package/dist/{cjs/tools → tools}/tasks-list-for-section.js +7 -10
- package/dist/{types/tools → tools}/tasks-list-overdue.d.ts +2 -1
- package/dist/tools/tasks-list-overdue.d.ts.map +1 -0
- package/dist/{cjs/tools → tools}/tasks-list-overdue.js +7 -7
- package/dist/{esm/tools → tools}/tasks-organize-multiple.d.ts +4 -4
- package/dist/tools/tasks-organize-multiple.d.ts.map +1 -0
- package/dist/tools/tasks-organize-multiple.js +28 -0
- package/dist/{types/tools → tools}/tasks-search.d.ts +2 -1
- package/dist/tools/tasks-search.d.ts.map +1 -0
- package/dist/{cjs/tools → tools}/tasks-search.js +6 -6
- package/dist/{esm/tools → tools}/tasks-update-one.d.ts +3 -3
- package/dist/tools/tasks-update-one.d.ts.map +1 -0
- package/dist/tools/tasks-update-one.js +33 -0
- package/package.json +54 -76
- package/dist/cjs/index.js +0 -74
- package/dist/cjs/mcp-server.js +0 -68
- package/dist/cjs/tools/tasks-add-multiple.js +0 -50
- package/dist/cjs/tools/tasks-organize-multiple.js +0 -43
- package/dist/cjs/tools/tasks-update-one.js +0 -45
- package/dist/esm/index.d.ts.map +0 -1
- package/dist/esm/index.js +0 -49
- package/dist/esm/main.d.ts.map +0 -1
- package/dist/esm/main.js +0 -23
- package/dist/esm/mcp-helpers.d.ts +0 -13
- package/dist/esm/mcp-helpers.d.ts.map +0 -1
- package/dist/esm/mcp-helpers.js +0 -52
- package/dist/esm/mcp-server.d.ts +0 -11
- package/dist/esm/mcp-server.d.ts.map +0 -1
- package/dist/esm/mcp-server.js +0 -66
- package/dist/esm/todoist-tool.d.ts +0 -35
- package/dist/esm/todoist-tool.d.ts.map +0 -1
- package/dist/esm/todoist-tool.js +0 -1
- package/dist/esm/tools/account-overview.d.ts +0 -9
- package/dist/esm/tools/account-overview.d.ts.map +0 -1
- package/dist/esm/tools/account-overview.js +0 -94
- package/dist/esm/tools/project-overview.d.ts.map +0 -1
- package/dist/esm/tools/project-overview.js +0 -107
- package/dist/esm/tools/projects-add-one.d.ts.map +0 -1
- package/dist/esm/tools/projects-add-one.js +0 -15
- package/dist/esm/tools/projects-delete-one.d.ts +0 -15
- package/dist/esm/tools/projects-delete-one.d.ts.map +0 -1
- package/dist/esm/tools/projects-delete-one.js +0 -14
- package/dist/esm/tools/projects-list.d.ts.map +0 -1
- package/dist/esm/tools/projects-list.js +0 -30
- package/dist/esm/tools/projects-search.d.ts.map +0 -1
- package/dist/esm/tools/projects-search.js +0 -39
- package/dist/esm/tools/projects-update-one.d.ts +0 -15
- package/dist/esm/tools/projects-update-one.d.ts.map +0 -1
- package/dist/esm/tools/projects-update-one.js +0 -16
- package/dist/esm/tools/sections-add-one.d.ts +0 -15
- package/dist/esm/tools/sections-add-one.d.ts.map +0 -1
- package/dist/esm/tools/sections-add-one.js +0 -21
- package/dist/esm/tools/sections-delete-one.d.ts.map +0 -1
- package/dist/esm/tools/sections-delete-one.js +0 -14
- package/dist/esm/tools/sections-search.d.ts +0 -18
- package/dist/esm/tools/sections-search.d.ts.map +0 -1
- package/dist/esm/tools/sections-search.js +0 -30
- package/dist/esm/tools/sections-update-one.d.ts.map +0 -1
- package/dist/esm/tools/sections-update-one.js +0 -16
- package/dist/esm/tools/shared.d.ts +0 -55
- package/dist/esm/tools/shared.d.ts.map +0 -1
- package/dist/esm/tools/shared.js +0 -71
- package/dist/esm/tools/subtasks-list-for-parent-task.d.ts +0 -31
- package/dist/esm/tools/subtasks-list-for-parent-task.d.ts.map +0 -1
- package/dist/esm/tools/subtasks-list-for-parent-task.js +0 -37
- package/dist/esm/tools/tasks-add-multiple.d.ts +0 -50
- package/dist/esm/tools/tasks-add-multiple.d.ts.map +0 -1
- package/dist/esm/tools/tasks-add-multiple.js +0 -47
- package/dist/esm/tools/tasks-by-date-range.d.ts +0 -33
- package/dist/esm/tools/tasks-by-date-range.d.ts.map +0 -1
- package/dist/esm/tools/tasks-by-date-range.js +0 -47
- package/dist/esm/tools/tasks-by-project.d.ts +0 -31
- package/dist/esm/tools/tasks-by-project.d.ts.map +0 -1
- package/dist/esm/tools/tasks-by-project.js +0 -37
- package/dist/esm/tools/tasks-complete-multiple.d.ts +0 -16
- package/dist/esm/tools/tasks-complete-multiple.d.ts.map +0 -1
- package/dist/esm/tools/tasks-complete-multiple.js +0 -26
- package/dist/esm/tools/tasks-delete-one.d.ts +0 -15
- package/dist/esm/tools/tasks-delete-one.d.ts.map +0 -1
- package/dist/esm/tools/tasks-delete-one.js +0 -14
- package/dist/esm/tools/tasks-list-for-section.d.ts.map +0 -1
- package/dist/esm/tools/tasks-list-for-section.js +0 -37
- package/dist/esm/tools/tasks-list-overdue.d.ts +0 -29
- package/dist/esm/tools/tasks-list-overdue.d.ts.map +0 -1
- package/dist/esm/tools/tasks-list-overdue.js +0 -29
- package/dist/esm/tools/tasks-organize-multiple.d.ts.map +0 -1
- package/dist/esm/tools/tasks-organize-multiple.js +0 -40
- package/dist/esm/tools/tasks-search.d.ts +0 -31
- package/dist/esm/tools/tasks-search.d.ts.map +0 -1
- package/dist/esm/tools/tasks-search.js +0 -30
- package/dist/esm/tools/tasks-update-one.d.ts.map +0 -1
- package/dist/esm/tools/tasks-update-one.js +0 -42
- package/dist/types/index.d.ts +0 -476
- package/dist/types/main.d.ts +0 -1
- package/dist/types/mcp-server.d.ts +0 -10
- package/dist/types/tools/project-overview.d.ts +0 -13
- package/dist/types/tools/projects-add-one.d.ts +0 -21
- package/dist/types/tools/projects-list.d.ts +0 -17
- package/dist/types/tools/projects-search.d.ts +0 -28
- package/dist/types/tools/sections-delete-one.d.ts +0 -14
- package/dist/types/tools/sections-update-one.d.ts +0 -14
- package/dist/types/tools/tasks-list-for-section.d.ts +0 -30
- package/dist/types/tools/tasks-organize-multiple.d.ts +0 -36
- package/dist/types/tools/tasks-update-one.d.ts +0 -26
- /package/dist/{esm/main.d.ts → main.d.ts} +0 -0
- /package/dist/{cjs/todoist-tool.js → todoist-tool.js} +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tasksAddMultiple = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const shared_1 = require("./shared");
|
|
6
|
+
const TaskSchema = zod_1.z.object({
|
|
7
|
+
content: zod_1.z.string().min(1).describe('The content of the task to create.'),
|
|
8
|
+
description: zod_1.z.string().optional().describe('The description of the task.'),
|
|
9
|
+
priority: zod_1.z.number().int().min(1).max(4).optional().describe('The priority of the task (1-4).'),
|
|
10
|
+
dueString: zod_1.z.string().optional().describe('The due date for the task, in natural language.'),
|
|
11
|
+
});
|
|
12
|
+
const ArgsSchema = {
|
|
13
|
+
projectId: zod_1.z.string().optional().describe('The project ID to add the tasks to.'),
|
|
14
|
+
sectionId: zod_1.z.string().optional().describe('The section ID to add the tasks to.'),
|
|
15
|
+
parentId: zod_1.z.string().optional().describe('The parent task ID (for subtasks).'),
|
|
16
|
+
tasks: zod_1.z.array(TaskSchema).min(1).describe('The array of tasks to add.'),
|
|
17
|
+
};
|
|
18
|
+
const tasksAddMultiple = {
|
|
19
|
+
name: 'tasks-add-multiple',
|
|
20
|
+
description: 'Add one or more tasks to a project, section, or parent.',
|
|
21
|
+
parameters: ArgsSchema,
|
|
22
|
+
async execute(args, client) {
|
|
23
|
+
const { projectId, sectionId, parentId, tasks } = args;
|
|
24
|
+
const newTasks = [];
|
|
25
|
+
for (const task of tasks) {
|
|
26
|
+
const taskArgs = { ...task, projectId, sectionId, parentId };
|
|
27
|
+
newTasks.push(await client.addTask(taskArgs));
|
|
28
|
+
}
|
|
29
|
+
return newTasks.map(shared_1.mapTask);
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
exports.tasksAddMultiple = tasksAddMultiple;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
declare const tasksCompleteMultiple: {
|
|
3
3
|
name: string;
|
|
4
4
|
description: string;
|
|
@@ -13,3 +13,4 @@ declare const tasksCompleteMultiple: {
|
|
|
13
13
|
}>;
|
|
14
14
|
};
|
|
15
15
|
export { tasksCompleteMultiple };
|
|
16
|
+
//# sourceMappingURL=tasks-complete-multiple.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks-complete-multiple.d.ts","sourceRoot":"","sources":["../../src/tools/tasks-complete-multiple.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAOvB,QAAA,MAAM,qBAAqB;;;;;;;;;;;;CAgBe,CAAA;AAE1C,OAAO,EAAE,qBAAqB,EAAE,CAAA"}
|
|
@@ -3,14 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.tasksCompleteMultiple = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const ArgsSchema = {
|
|
6
|
-
ids: zod_1.z
|
|
7
|
-
.array(zod_1.z.string().min(1))
|
|
8
|
-
.min(1)
|
|
9
|
-
.describe("The IDs of the tasks to complete."),
|
|
6
|
+
ids: zod_1.z.array(zod_1.z.string().min(1)).min(1).describe('The IDs of the tasks to complete.'),
|
|
10
7
|
};
|
|
11
8
|
const tasksCompleteMultiple = {
|
|
12
|
-
name:
|
|
13
|
-
description:
|
|
9
|
+
name: 'tasks-complete-multiple',
|
|
10
|
+
description: 'Complete one or more tasks by their IDs.',
|
|
14
11
|
parameters: ArgsSchema,
|
|
15
12
|
async execute(args, client) {
|
|
16
13
|
const completed = [];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
declare const tasksDeleteOne: {
|
|
3
3
|
name: string;
|
|
4
4
|
description: string;
|
|
@@ -12,3 +12,4 @@ declare const tasksDeleteOne: {
|
|
|
12
12
|
}>;
|
|
13
13
|
};
|
|
14
14
|
export { tasksDeleteOne };
|
|
15
|
+
//# sourceMappingURL=tasks-delete-one.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks-delete-one.d.ts","sourceRoot":"","sources":["../../src/tools/tasks-delete-one.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAOvB,QAAA,MAAM,cAAc;;;;;;;;;;;CAQsB,CAAA;AAE1C,OAAO,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.tasksDeleteOne = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const ArgsSchema = {
|
|
6
|
-
id: zod_1.z.string().min(1).describe(
|
|
6
|
+
id: zod_1.z.string().min(1).describe('The ID of the task to delete.'),
|
|
7
7
|
};
|
|
8
8
|
const tasksDeleteOne = {
|
|
9
|
-
name:
|
|
10
|
-
description:
|
|
9
|
+
name: 'tasks-delete-one',
|
|
10
|
+
description: 'Delete a task by its ID.',
|
|
11
11
|
parameters: ArgsSchema,
|
|
12
12
|
async execute(args, client) {
|
|
13
13
|
await client.deleteTask(args.id);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
declare const tasksListByDate: {
|
|
3
3
|
name: string;
|
|
4
4
|
description: string;
|
|
@@ -30,3 +30,4 @@ declare const tasksListByDate: {
|
|
|
30
30
|
}>;
|
|
31
31
|
};
|
|
32
32
|
export { tasksListByDate };
|
|
33
|
+
//# sourceMappingURL=tasks-list-by-date.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks-list-by-date.d.ts","sourceRoot":"","sources":["../../src/tools/tasks-list-by-date.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AA+BvB,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmBqB,CAAA;AAE1C,OAAO,EAAE,eAAe,EAAE,CAAA"}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.tasksListByDate = void 0;
|
|
4
4
|
const date_fns_1 = require("date-fns");
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
|
-
const
|
|
6
|
+
const shared_1 = require("./shared");
|
|
7
7
|
const ArgsSchema = {
|
|
8
8
|
startDate: zod_1.z
|
|
9
9
|
.string()
|
|
@@ -15,31 +15,31 @@ const ArgsSchema = {
|
|
|
15
15
|
.min(1)
|
|
16
16
|
.max(30)
|
|
17
17
|
.default(1)
|
|
18
|
-
.describe(
|
|
18
|
+
.describe('The number of days to get the tasks for, starting from the start date.'),
|
|
19
19
|
limit: zod_1.z
|
|
20
20
|
.number()
|
|
21
21
|
.int()
|
|
22
22
|
.min(1)
|
|
23
23
|
.max(50)
|
|
24
24
|
.default(10)
|
|
25
|
-
.describe(
|
|
25
|
+
.describe('The maximum number of tasks to return.'),
|
|
26
26
|
cursor: zod_1.z
|
|
27
27
|
.string()
|
|
28
28
|
.optional()
|
|
29
|
-
.describe(
|
|
29
|
+
.describe('The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters).'),
|
|
30
30
|
};
|
|
31
31
|
const tasksListByDate = {
|
|
32
|
-
name:
|
|
33
|
-
description:
|
|
32
|
+
name: 'tasks-list-by-date',
|
|
33
|
+
description: 'Get tasks by date range.',
|
|
34
34
|
parameters: ArgsSchema,
|
|
35
35
|
async execute(args, client) {
|
|
36
|
-
const startDate = args.startDate ===
|
|
37
|
-
? (0, date_fns_1.formatISO)(new Date(), { representation:
|
|
36
|
+
const startDate = args.startDate === 'today'
|
|
37
|
+
? (0, date_fns_1.formatISO)(new Date(), { representation: 'date' })
|
|
38
38
|
: args.startDate;
|
|
39
39
|
const endDate = (0, date_fns_1.addDays)(startDate, args.daysCount + 1);
|
|
40
|
-
const endDateStr = (0, date_fns_1.formatISO)(endDate, { representation:
|
|
40
|
+
const endDateStr = (0, date_fns_1.formatISO)(endDate, { representation: 'date' });
|
|
41
41
|
const query = `(due after: ${startDate} | due: ${startDate}) & due before: ${endDateStr}`;
|
|
42
|
-
return await (0,
|
|
42
|
+
return await (0, shared_1.getTasksByFilter)({
|
|
43
43
|
client,
|
|
44
44
|
query,
|
|
45
45
|
cursor: args.cursor,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
declare const tasksListForProject: {
|
|
3
3
|
name: string;
|
|
4
4
|
description: string;
|
|
@@ -28,3 +28,4 @@ declare const tasksListForProject: {
|
|
|
28
28
|
}>;
|
|
29
29
|
};
|
|
30
30
|
export { tasksListForProject };
|
|
31
|
+
//# sourceMappingURL=tasks-list-for-project.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks-list-for-project.d.ts","sourceRoot":"","sources":["../../src/tools/tasks-list-for-project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAqBvB,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBiB,CAAA;AAE1C,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
|
|
@@ -2,27 +2,24 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.tasksListForProject = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
5
|
+
const shared_1 = require("./shared");
|
|
6
6
|
const ArgsSchema = {
|
|
7
|
-
projectId: zod_1.z
|
|
8
|
-
.string()
|
|
9
|
-
.min(1)
|
|
10
|
-
.describe("The ID of the project to get tasks for."),
|
|
7
|
+
projectId: zod_1.z.string().min(1).describe('The ID of the project to get tasks for.'),
|
|
11
8
|
limit: zod_1.z
|
|
12
9
|
.number()
|
|
13
10
|
.int()
|
|
14
11
|
.min(1)
|
|
15
12
|
.max(50)
|
|
16
13
|
.default(10)
|
|
17
|
-
.describe(
|
|
14
|
+
.describe('The maximum number of tasks to return.'),
|
|
18
15
|
cursor: zod_1.z
|
|
19
16
|
.string()
|
|
20
17
|
.optional()
|
|
21
|
-
.describe(
|
|
18
|
+
.describe('The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters).'),
|
|
22
19
|
};
|
|
23
20
|
const tasksListForProject = {
|
|
24
|
-
name:
|
|
25
|
-
description:
|
|
21
|
+
name: 'tasks-list-for-project',
|
|
22
|
+
description: 'Get tasks by project ID.',
|
|
26
23
|
parameters: ArgsSchema,
|
|
27
24
|
async execute(args, client) {
|
|
28
25
|
const { projectId, limit, cursor } = args;
|
|
@@ -32,7 +29,7 @@ const tasksListForProject = {
|
|
|
32
29
|
cursor: cursor ?? null,
|
|
33
30
|
});
|
|
34
31
|
return {
|
|
35
|
-
tasks: results.map(
|
|
32
|
+
tasks: results.map(shared_1.mapTask),
|
|
36
33
|
nextCursor,
|
|
37
34
|
};
|
|
38
35
|
},
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks-list-for-section.d.ts","sourceRoot":"","sources":["../../src/tools/tasks-list-for-section.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAmBvB,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBiB,CAAA;AAE1C,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
|
|
@@ -2,27 +2,24 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.tasksListForSection = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
5
|
+
const shared_1 = require("./shared");
|
|
6
6
|
const ArgsSchema = {
|
|
7
|
-
sectionId: zod_1.z
|
|
8
|
-
.string()
|
|
9
|
-
.min(1)
|
|
10
|
-
.describe("The ID of the section to get tasks for."),
|
|
7
|
+
sectionId: zod_1.z.string().min(1).describe('The ID of the section to get tasks for.'),
|
|
11
8
|
limit: zod_1.z
|
|
12
9
|
.number()
|
|
13
10
|
.int()
|
|
14
11
|
.min(1)
|
|
15
12
|
.max(50)
|
|
16
13
|
.default(10)
|
|
17
|
-
.describe(
|
|
14
|
+
.describe('The maximum number of tasks to return.'),
|
|
18
15
|
cursor: zod_1.z
|
|
19
16
|
.string()
|
|
20
17
|
.optional()
|
|
21
|
-
.describe(
|
|
18
|
+
.describe('The cursor to get the next page of tasks (from previous call).'),
|
|
22
19
|
};
|
|
23
20
|
const tasksListForSection = {
|
|
24
|
-
name:
|
|
25
|
-
description:
|
|
21
|
+
name: 'tasks-list-for-section',
|
|
22
|
+
description: 'List tasks for a given section.',
|
|
26
23
|
parameters: ArgsSchema,
|
|
27
24
|
async execute(args, client) {
|
|
28
25
|
const { sectionId, limit, cursor } = args;
|
|
@@ -32,7 +29,7 @@ const tasksListForSection = {
|
|
|
32
29
|
cursor: cursor ?? null,
|
|
33
30
|
});
|
|
34
31
|
return {
|
|
35
|
-
tasks: results.map(
|
|
32
|
+
tasks: results.map(shared_1.mapTask),
|
|
36
33
|
nextCursor,
|
|
37
34
|
};
|
|
38
35
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
declare const tasksListOverdue: {
|
|
3
3
|
name: string;
|
|
4
4
|
description: string;
|
|
@@ -26,3 +26,4 @@ declare const tasksListOverdue: {
|
|
|
26
26
|
}>;
|
|
27
27
|
};
|
|
28
28
|
export { tasksListOverdue };
|
|
29
|
+
//# sourceMappingURL=tasks-list-overdue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks-list-overdue.d.ts","sourceRoot":"","sources":["../../src/tools/tasks-list-overdue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAoBvB,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;CAYoB,CAAA;AAE1C,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.tasksListOverdue = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
5
|
+
const shared_1 = require("./shared");
|
|
6
6
|
const ArgsSchema = {
|
|
7
7
|
limit: zod_1.z
|
|
8
8
|
.number()
|
|
@@ -10,20 +10,20 @@ const ArgsSchema = {
|
|
|
10
10
|
.min(1)
|
|
11
11
|
.max(50)
|
|
12
12
|
.default(10)
|
|
13
|
-
.describe(
|
|
13
|
+
.describe('The maximum number of overdue tasks to return.'),
|
|
14
14
|
cursor: zod_1.z
|
|
15
15
|
.string()
|
|
16
16
|
.optional()
|
|
17
|
-
.describe(
|
|
17
|
+
.describe('The cursor to get the next page of overdue tasks (cursor is obtained from the previous call to this tool, with the same parameters).'),
|
|
18
18
|
};
|
|
19
19
|
const tasksListOverdue = {
|
|
20
|
-
name:
|
|
21
|
-
description:
|
|
20
|
+
name: 'tasks-list-overdue',
|
|
21
|
+
description: 'Get overdue tasks.',
|
|
22
22
|
parameters: ArgsSchema,
|
|
23
23
|
async execute(args, client) {
|
|
24
|
-
return await (0,
|
|
24
|
+
return await (0, shared_1.getTasksByFilter)({
|
|
25
25
|
client,
|
|
26
|
-
query:
|
|
26
|
+
query: 'overdue',
|
|
27
27
|
cursor: args.cursor,
|
|
28
28
|
limit: args.limit,
|
|
29
29
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
declare const tasksOrganizeMultiple: {
|
|
3
3
|
name: string;
|
|
4
4
|
description: string;
|
|
@@ -11,14 +11,14 @@ declare const tasksOrganizeMultiple: {
|
|
|
11
11
|
order: z.ZodOptional<z.ZodNumber>;
|
|
12
12
|
}, "strip", z.ZodTypeAny, {
|
|
13
13
|
id: string;
|
|
14
|
-
projectId?: string | undefined;
|
|
15
14
|
parentId?: string | undefined;
|
|
15
|
+
projectId?: string | undefined;
|
|
16
16
|
sectionId?: string | undefined;
|
|
17
17
|
order?: number | undefined;
|
|
18
18
|
}, {
|
|
19
19
|
id: string;
|
|
20
|
-
projectId?: string | undefined;
|
|
21
20
|
parentId?: string | undefined;
|
|
21
|
+
projectId?: string | undefined;
|
|
22
22
|
sectionId?: string | undefined;
|
|
23
23
|
order?: number | undefined;
|
|
24
24
|
}>, "many">;
|
|
@@ -26,8 +26,8 @@ declare const tasksOrganizeMultiple: {
|
|
|
26
26
|
execute(args: {
|
|
27
27
|
tasks: {
|
|
28
28
|
id: string;
|
|
29
|
-
projectId?: string | undefined;
|
|
30
29
|
parentId?: string | undefined;
|
|
30
|
+
projectId?: string | undefined;
|
|
31
31
|
sectionId?: string | undefined;
|
|
32
32
|
order?: number | undefined;
|
|
33
33
|
}[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks-organize-multiple.d.ts","sourceRoot":"","sources":["../../src/tools/tasks-organize-multiple.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAevB,QAAA,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAYe,CAAA;AAE1C,OAAO,EAAE,qBAAqB,EAAE,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tasksOrganizeMultiple = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const TaskUpdateSchema = zod_1.z.object({
|
|
6
|
+
id: zod_1.z.string().min(1).describe('The ID of the task to update.'),
|
|
7
|
+
projectId: zod_1.z.string().optional().describe('The new project ID for the task.'),
|
|
8
|
+
sectionId: zod_1.z.string().optional().describe('The new section ID for the task.'),
|
|
9
|
+
parentId: zod_1.z.string().optional().describe('The new parent task ID (for subtasks).'),
|
|
10
|
+
order: zod_1.z.number().optional().describe('The new order of the task within its parent/section.'),
|
|
11
|
+
});
|
|
12
|
+
const ArgsSchema = {
|
|
13
|
+
tasks: zod_1.z.array(TaskUpdateSchema).min(1).describe('Array of task updates to apply.'),
|
|
14
|
+
};
|
|
15
|
+
const tasksOrganizeMultiple = {
|
|
16
|
+
name: 'tasks-organize-multiple',
|
|
17
|
+
description: 'Organize multiple tasks (move, reorder, etc.) in bulk.',
|
|
18
|
+
parameters: ArgsSchema,
|
|
19
|
+
async execute(args, client) {
|
|
20
|
+
const results = [];
|
|
21
|
+
for (const update of args.tasks) {
|
|
22
|
+
const { id, ...updateArgs } = update;
|
|
23
|
+
results.push(await client.updateTask(id, updateArgs));
|
|
24
|
+
}
|
|
25
|
+
return results;
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
exports.tasksOrganizeMultiple = tasksOrganizeMultiple;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks-search.d.ts","sourceRoot":"","sources":["../../src/tools/tasks-search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAqBvB,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;CAYyB,CAAA;AAE1C,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -2,27 +2,27 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.tasksSearch = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
5
|
+
const shared_1 = require("./shared");
|
|
6
6
|
const ArgsSchema = {
|
|
7
|
-
searchText: zod_1.z.string().min(1).describe(
|
|
7
|
+
searchText: zod_1.z.string().min(1).describe('The text to search for in tasks.'),
|
|
8
8
|
limit: zod_1.z
|
|
9
9
|
.number()
|
|
10
10
|
.int()
|
|
11
11
|
.min(1)
|
|
12
12
|
.max(50)
|
|
13
13
|
.default(10)
|
|
14
|
-
.describe(
|
|
14
|
+
.describe('The maximum number of tasks to return.'),
|
|
15
15
|
cursor: zod_1.z
|
|
16
16
|
.string()
|
|
17
17
|
.optional()
|
|
18
|
-
.describe(
|
|
18
|
+
.describe('The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters).'),
|
|
19
19
|
};
|
|
20
20
|
const tasksSearch = {
|
|
21
|
-
name:
|
|
21
|
+
name: 'tasks-search',
|
|
22
22
|
description: "Search tasks by text using Todoist's filter query.",
|
|
23
23
|
parameters: ArgsSchema,
|
|
24
24
|
async execute(args, client) {
|
|
25
|
-
return await (0,
|
|
25
|
+
return await (0, shared_1.getTasksByFilter)({
|
|
26
26
|
client,
|
|
27
27
|
query: `search: ${args.searchText}`,
|
|
28
28
|
cursor: args.cursor,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
declare const tasksUpdateOne: {
|
|
3
3
|
name: string;
|
|
4
4
|
description: string;
|
|
@@ -15,9 +15,9 @@ declare const tasksUpdateOne: {
|
|
|
15
15
|
execute(args: {
|
|
16
16
|
id: string;
|
|
17
17
|
content?: string | undefined;
|
|
18
|
-
projectId?: string | undefined;
|
|
19
|
-
parentId?: string | undefined;
|
|
20
18
|
description?: string | undefined;
|
|
19
|
+
parentId?: string | undefined;
|
|
20
|
+
projectId?: string | undefined;
|
|
21
21
|
priority?: number | undefined;
|
|
22
22
|
dueString?: string | undefined;
|
|
23
23
|
sectionId?: string | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks-update-one.d.ts","sourceRoot":"","sources":["../../src/tools/tasks-update-one.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAuBvB,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;CAQsB,CAAA;AAE1C,OAAO,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tasksUpdateOne = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const ArgsSchema = {
|
|
6
|
+
id: zod_1.z.string().min(1).describe('The ID of the task to update.'),
|
|
7
|
+
content: zod_1.z.string().optional().describe('The new content of the task.'),
|
|
8
|
+
description: zod_1.z.string().optional().describe('The new description of the task.'),
|
|
9
|
+
projectId: zod_1.z.string().optional().describe('The new project ID for the task.'),
|
|
10
|
+
sectionId: zod_1.z.string().optional().describe('The new section ID for the task.'),
|
|
11
|
+
parentId: zod_1.z.string().optional().describe('The new parent task ID (for subtasks).'),
|
|
12
|
+
priority: zod_1.z
|
|
13
|
+
.number()
|
|
14
|
+
.int()
|
|
15
|
+
.min(1)
|
|
16
|
+
.max(4)
|
|
17
|
+
.optional()
|
|
18
|
+
.describe('The new priority of the task (1-4).'),
|
|
19
|
+
dueString: zod_1.z
|
|
20
|
+
.string()
|
|
21
|
+
.optional()
|
|
22
|
+
.describe("The new due date for the task, in natural language (e.g., 'tomorrow at 5pm')."),
|
|
23
|
+
};
|
|
24
|
+
const tasksUpdateOne = {
|
|
25
|
+
name: 'tasks-update-one',
|
|
26
|
+
description: 'Update an existing task with new values.',
|
|
27
|
+
parameters: ArgsSchema,
|
|
28
|
+
async execute(args, client) {
|
|
29
|
+
const { id, ...updateArgs } = args;
|
|
30
|
+
return await client.updateTask(id, updateArgs);
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
exports.tasksUpdateOne = tasksUpdateOne;
|
package/package.json
CHANGED
|
@@ -1,78 +1,56 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"dotenv": "^16.5.0",
|
|
57
|
-
"zod": "^3.25.7"
|
|
58
|
-
},
|
|
59
|
-
"devDependencies": {
|
|
60
|
-
"@biomejs/biome": "1.9.4",
|
|
61
|
-
"@types/express": "^5.0.2",
|
|
62
|
-
"@types/morgan": "^1.9.9",
|
|
63
|
-
"@types/node": "^22.15.17",
|
|
64
|
-
"concurrently": "^8.2.2",
|
|
65
|
-
"express": "^4.19.2",
|
|
66
|
-
"husky": "^9.1.7",
|
|
67
|
-
"lint-staged": "^16.0.0",
|
|
68
|
-
"morgan": "^1.10.0",
|
|
69
|
-
"nodemon": "^3.1.10",
|
|
70
|
-
"rimraf": "^6.0.1",
|
|
71
|
-
"typescript": "^5.8.3"
|
|
72
|
-
},
|
|
73
|
-
"lint-staged": {
|
|
74
|
-
"*": [
|
|
75
|
-
"biome check --write --no-errors-on-unmatched --files-ignore-unknown=true"
|
|
76
|
-
]
|
|
77
|
-
}
|
|
2
|
+
"name": "@doist/todoist-ai",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"main": "./dist/index.js",
|
|
5
|
+
"types": "./dist/index.d.ts",
|
|
6
|
+
"files": ["dist", "package.json", "LICENSE.txt", "README.md"],
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"description": "A collection of tools for Todoist using AI",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/Doist/todoist-ai"
|
|
12
|
+
},
|
|
13
|
+
"keywords": ["todoist", "ai", "tools"],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"test": "jest",
|
|
16
|
+
"build": "rimraf dist && npx tsc --project tsconfig.json",
|
|
17
|
+
"dev": "concurrently \"npx tsc --watch\" \"nodemon --watch dist --ext js --exec 'npx -y @modelcontextprotocol/inspector npx node dist/main.js\"",
|
|
18
|
+
"setup": "cp .env.example .env && npm install && npm run build",
|
|
19
|
+
"type-check": "npx tsc --noEmit",
|
|
20
|
+
"biome:sort-imports": "biome check --formatter-enabled=false --linter-enabled=false --organize-imports-enabled=true --write .",
|
|
21
|
+
"lint:check": "biome lint",
|
|
22
|
+
"lint:write": "biome lint --write",
|
|
23
|
+
"format:check": "biome format",
|
|
24
|
+
"format:write": "biome format --write",
|
|
25
|
+
"check": "biome check",
|
|
26
|
+
"check:fix": "biome check --fix --unsafe",
|
|
27
|
+
"prepare": "husky"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@doist/todoist-api-typescript": "5.1.1",
|
|
31
|
+
"@modelcontextprotocol/sdk": "^1.11.1",
|
|
32
|
+
"date-fns": "^4.1.0",
|
|
33
|
+
"dotenv": "^16.5.0",
|
|
34
|
+
"zod": "^3.25.7"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@biomejs/biome": "1.9.4",
|
|
38
|
+
"@types/express": "^5.0.2",
|
|
39
|
+
"@types/jest": "30.0.0",
|
|
40
|
+
"@types/morgan": "^1.9.9",
|
|
41
|
+
"@types/node": "^22.15.17",
|
|
42
|
+
"concurrently": "^8.2.2",
|
|
43
|
+
"express": "^4.19.2",
|
|
44
|
+
"husky": "^9.1.7",
|
|
45
|
+
"jest": "30.0.5",
|
|
46
|
+
"lint-staged": "^16.0.0",
|
|
47
|
+
"morgan": "^1.10.0",
|
|
48
|
+
"nodemon": "^3.1.10",
|
|
49
|
+
"rimraf": "^6.0.1",
|
|
50
|
+
"ts-jest": "29.4.1",
|
|
51
|
+
"typescript": "^5.8.3"
|
|
52
|
+
},
|
|
53
|
+
"lint-staged": {
|
|
54
|
+
"*": ["biome check --write --no-errors-on-unmatched --files-ignore-unknown=true"]
|
|
55
|
+
}
|
|
78
56
|
}
|