@doist/todoist-ai 0.1.1 → 0.1.2

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.
Files changed (85) hide show
  1. package/dist/cjs/index.js +72 -47
  2. package/dist/cjs/main.js +11 -6
  3. package/dist/cjs/mcp-helpers.js +3 -1
  4. package/dist/cjs/mcp-server.js +52 -50
  5. package/dist/cjs/todoist-tool.js +2 -1
  6. package/dist/cjs/tools/account-overview.js +4 -1
  7. package/dist/cjs/tools/project-overview.js +8 -5
  8. package/dist/cjs/tools/projects-add-one.js +8 -5
  9. package/dist/cjs/tools/projects-delete-one.js +6 -3
  10. package/dist/cjs/tools/projects-list.js +7 -4
  11. package/dist/cjs/tools/projects-search.js +10 -7
  12. package/dist/cjs/tools/projects-update-one.js +7 -4
  13. package/dist/cjs/tools/sections-add-one.js +7 -4
  14. package/dist/cjs/tools/sections-delete-one.js +6 -3
  15. package/dist/cjs/tools/sections-search.js +7 -4
  16. package/dist/cjs/tools/sections-update-one.js +7 -4
  17. package/dist/cjs/tools/shared.js +18 -11
  18. package/dist/cjs/tools/subtasks-list-for-parent-task.js +10 -7
  19. package/dist/cjs/tools/tasks-add-multiple.js +16 -13
  20. package/dist/cjs/tools/tasks-by-date-range.js +15 -12
  21. package/dist/cjs/tools/tasks-by-project.js +10 -7
  22. package/dist/cjs/tools/tasks-complete-multiple.js +7 -4
  23. package/dist/cjs/tools/tasks-delete-one.js +6 -3
  24. package/dist/cjs/tools/tasks-list-for-section.js +10 -7
  25. package/dist/cjs/tools/tasks-list-overdue.js +9 -6
  26. package/dist/cjs/tools/tasks-organize-multiple.js +12 -9
  27. package/dist/cjs/tools/tasks-search.js +10 -7
  28. package/dist/cjs/tools/tasks-update-one.js +13 -10
  29. package/package.json +1 -1
  30. package/dist/cjs/index.d.ts +0 -477
  31. package/dist/cjs/index.d.ts.map +0 -1
  32. package/dist/cjs/main.d.ts +0 -2
  33. package/dist/cjs/main.d.ts.map +0 -1
  34. package/dist/cjs/mcp-helpers.d.ts +0 -13
  35. package/dist/cjs/mcp-helpers.d.ts.map +0 -1
  36. package/dist/cjs/mcp-server.d.ts +0 -11
  37. package/dist/cjs/mcp-server.d.ts.map +0 -1
  38. package/dist/cjs/todoist-tool.d.ts +0 -35
  39. package/dist/cjs/todoist-tool.d.ts.map +0 -1
  40. package/dist/cjs/tools/account-overview.d.ts +0 -9
  41. package/dist/cjs/tools/account-overview.d.ts.map +0 -1
  42. package/dist/cjs/tools/project-overview.d.ts +0 -14
  43. package/dist/cjs/tools/project-overview.d.ts.map +0 -1
  44. package/dist/cjs/tools/projects-add-one.d.ts +0 -22
  45. package/dist/cjs/tools/projects-add-one.d.ts.map +0 -1
  46. package/dist/cjs/tools/projects-delete-one.d.ts +0 -15
  47. package/dist/cjs/tools/projects-delete-one.d.ts.map +0 -1
  48. package/dist/cjs/tools/projects-list.d.ts +0 -18
  49. package/dist/cjs/tools/projects-list.d.ts.map +0 -1
  50. package/dist/cjs/tools/projects-search.d.ts +0 -29
  51. package/dist/cjs/tools/projects-search.d.ts.map +0 -1
  52. package/dist/cjs/tools/projects-update-one.d.ts +0 -15
  53. package/dist/cjs/tools/projects-update-one.d.ts.map +0 -1
  54. package/dist/cjs/tools/sections-add-one.d.ts +0 -15
  55. package/dist/cjs/tools/sections-add-one.d.ts.map +0 -1
  56. package/dist/cjs/tools/sections-delete-one.d.ts +0 -15
  57. package/dist/cjs/tools/sections-delete-one.d.ts.map +0 -1
  58. package/dist/cjs/tools/sections-search.d.ts +0 -18
  59. package/dist/cjs/tools/sections-search.d.ts.map +0 -1
  60. package/dist/cjs/tools/sections-update-one.d.ts +0 -15
  61. package/dist/cjs/tools/sections-update-one.d.ts.map +0 -1
  62. package/dist/cjs/tools/shared.d.ts +0 -55
  63. package/dist/cjs/tools/shared.d.ts.map +0 -1
  64. package/dist/cjs/tools/subtasks-list-for-parent-task.d.ts +0 -31
  65. package/dist/cjs/tools/subtasks-list-for-parent-task.d.ts.map +0 -1
  66. package/dist/cjs/tools/tasks-add-multiple.d.ts +0 -50
  67. package/dist/cjs/tools/tasks-add-multiple.d.ts.map +0 -1
  68. package/dist/cjs/tools/tasks-by-date-range.d.ts +0 -33
  69. package/dist/cjs/tools/tasks-by-date-range.d.ts.map +0 -1
  70. package/dist/cjs/tools/tasks-by-project.d.ts +0 -31
  71. package/dist/cjs/tools/tasks-by-project.d.ts.map +0 -1
  72. package/dist/cjs/tools/tasks-complete-multiple.d.ts +0 -16
  73. package/dist/cjs/tools/tasks-complete-multiple.d.ts.map +0 -1
  74. package/dist/cjs/tools/tasks-delete-one.d.ts +0 -15
  75. package/dist/cjs/tools/tasks-delete-one.d.ts.map +0 -1
  76. package/dist/cjs/tools/tasks-list-for-section.d.ts +0 -31
  77. package/dist/cjs/tools/tasks-list-for-section.d.ts.map +0 -1
  78. package/dist/cjs/tools/tasks-list-overdue.d.ts +0 -29
  79. package/dist/cjs/tools/tasks-list-overdue.d.ts.map +0 -1
  80. package/dist/cjs/tools/tasks-organize-multiple.d.ts +0 -37
  81. package/dist/cjs/tools/tasks-organize-multiple.d.ts.map +0 -1
  82. package/dist/cjs/tools/tasks-search.d.ts +0 -31
  83. package/dist/cjs/tools/tasks-search.d.ts.map +0 -1
  84. package/dist/cjs/tools/tasks-update-one.d.ts +0 -27
  85. package/dist/cjs/tools/tasks-update-one.d.ts.map +0 -1
@@ -1,18 +1,21 @@
1
- import { z } from "zod";
2
- import { mapTask } from "./shared.js";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.subtasksListForParentTask = void 0;
4
+ const zod_1 = require("zod");
5
+ const shared_js_1 = require("./shared.js");
3
6
  const ArgsSchema = {
4
- parentId: z
7
+ parentId: zod_1.z
5
8
  .string()
6
9
  .min(1)
7
10
  .describe("The ID of the parent task to get subtasks for."),
8
- limit: z
11
+ limit: zod_1.z
9
12
  .number()
10
13
  .int()
11
14
  .min(1)
12
15
  .max(50)
13
16
  .default(10)
14
17
  .describe("The maximum number of subtasks to return."),
15
- cursor: z
18
+ cursor: zod_1.z
16
19
  .string()
17
20
  .optional()
18
21
  .describe("The cursor to get the next page of subtasks (from previous call)."),
@@ -29,9 +32,9 @@ const subtasksListForParentTask = {
29
32
  cursor: cursor ?? null,
30
33
  });
31
34
  return {
32
- tasks: results.map(mapTask),
35
+ tasks: results.map(shared_js_1.mapTask),
33
36
  nextCursor,
34
37
  };
35
38
  },
36
39
  };
37
- export { subtasksListForParentTask };
40
+ exports.subtasksListForParentTask = subtasksListForParentTask;
@@ -1,34 +1,37 @@
1
- import { z } from "zod";
2
- import { mapTask } from "./shared.js";
3
- const TaskSchema = z.object({
4
- content: z.string().min(1).describe("The content of the task to create."),
5
- description: z.string().optional().describe("The description of the task."),
6
- priority: z
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tasksAddMultiple = void 0;
4
+ const zod_1 = require("zod");
5
+ const shared_js_1 = require("./shared.js");
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
7
10
  .number()
8
11
  .int()
9
12
  .min(1)
10
13
  .max(4)
11
14
  .optional()
12
15
  .describe("The priority of the task (1-4)."),
13
- dueString: z
16
+ dueString: zod_1.z
14
17
  .string()
15
18
  .optional()
16
19
  .describe("The due date for the task, in natural language."),
17
20
  });
18
21
  const ArgsSchema = {
19
- projectId: z
22
+ projectId: zod_1.z
20
23
  .string()
21
24
  .optional()
22
25
  .describe("The project ID to add the tasks to."),
23
- sectionId: z
26
+ sectionId: zod_1.z
24
27
  .string()
25
28
  .optional()
26
29
  .describe("The section ID to add the tasks to."),
27
- parentId: z
30
+ parentId: zod_1.z
28
31
  .string()
29
32
  .optional()
30
33
  .describe("The parent task ID (for subtasks)."),
31
- tasks: z.array(TaskSchema).min(1).describe("The array of tasks to add."),
34
+ tasks: zod_1.z.array(TaskSchema).min(1).describe("The array of tasks to add."),
32
35
  };
33
36
  const tasksAddMultiple = {
34
37
  name: "tasks-add-multiple",
@@ -41,7 +44,7 @@ const tasksAddMultiple = {
41
44
  const taskArgs = { ...task, projectId, sectionId, parentId };
42
45
  newTasks.push(await client.addTask(taskArgs));
43
46
  }
44
- return newTasks.map(mapTask);
47
+ return newTasks.map(shared_js_1.mapTask);
45
48
  },
46
49
  };
47
- export { tasksAddMultiple };
50
+ exports.tasksAddMultiple = tasksAddMultiple;
@@ -1,26 +1,29 @@
1
- import { addDays, formatISO } from "date-fns";
2
- import { z } from "zod";
3
- import { getTasksByFilter } from "./shared.js";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tasksListByDate = void 0;
4
+ const date_fns_1 = require("date-fns");
5
+ const zod_1 = require("zod");
6
+ const shared_js_1 = require("./shared.js");
4
7
  const ArgsSchema = {
5
- startDate: z
8
+ startDate: zod_1.z
6
9
  .string()
7
10
  .regex(/^(\d{4}-\d{2}-\d{2}|today)$/)
8
11
  .describe("The start date to get the tasks for. Format: YYYY-MM-DD or 'today'."),
9
- daysCount: z
12
+ daysCount: zod_1.z
10
13
  .number()
11
14
  .int()
12
15
  .min(1)
13
16
  .max(30)
14
17
  .default(1)
15
18
  .describe("The number of days to get the tasks for, starting from the start date."),
16
- limit: z
19
+ limit: zod_1.z
17
20
  .number()
18
21
  .int()
19
22
  .min(1)
20
23
  .max(50)
21
24
  .default(10)
22
25
  .describe("The maximum number of tasks to return."),
23
- cursor: z
26
+ cursor: zod_1.z
24
27
  .string()
25
28
  .optional()
26
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)."),
@@ -31,12 +34,12 @@ const tasksListByDate = {
31
34
  parameters: ArgsSchema,
32
35
  async execute(args, client) {
33
36
  const startDate = args.startDate === "today"
34
- ? formatISO(new Date(), { representation: "date" })
37
+ ? (0, date_fns_1.formatISO)(new Date(), { representation: "date" })
35
38
  : args.startDate;
36
- const endDate = addDays(startDate, args.daysCount + 1);
37
- const endDateStr = formatISO(endDate, { representation: "date" });
39
+ const endDate = (0, date_fns_1.addDays)(startDate, args.daysCount + 1);
40
+ const endDateStr = (0, date_fns_1.formatISO)(endDate, { representation: "date" });
38
41
  const query = `(due after: ${startDate} | due: ${startDate}) & due before: ${endDateStr}`;
39
- return await getTasksByFilter({
42
+ return await (0, shared_js_1.getTasksByFilter)({
40
43
  client,
41
44
  query,
42
45
  cursor: args.cursor,
@@ -44,4 +47,4 @@ const tasksListByDate = {
44
47
  });
45
48
  },
46
49
  };
47
- export { tasksListByDate };
50
+ exports.tasksListByDate = tasksListByDate;
@@ -1,18 +1,21 @@
1
- import { z } from "zod";
2
- import { mapTask } from "./shared.js";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tasksListForProject = void 0;
4
+ const zod_1 = require("zod");
5
+ const shared_js_1 = require("./shared.js");
3
6
  const ArgsSchema = {
4
- projectId: z
7
+ projectId: zod_1.z
5
8
  .string()
6
9
  .min(1)
7
10
  .describe("The ID of the project to get tasks for."),
8
- limit: z
11
+ limit: zod_1.z
9
12
  .number()
10
13
  .int()
11
14
  .min(1)
12
15
  .max(50)
13
16
  .default(10)
14
17
  .describe("The maximum number of tasks to return."),
15
- cursor: z
18
+ cursor: zod_1.z
16
19
  .string()
17
20
  .optional()
18
21
  .describe("The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters)."),
@@ -29,9 +32,9 @@ const tasksListForProject = {
29
32
  cursor: cursor ?? null,
30
33
  });
31
34
  return {
32
- tasks: results.map(mapTask),
35
+ tasks: results.map(shared_js_1.mapTask),
33
36
  nextCursor,
34
37
  };
35
38
  },
36
39
  };
37
- export { tasksListForProject };
40
+ exports.tasksListForProject = tasksListForProject;
@@ -1,7 +1,10 @@
1
- import { z } from "zod";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tasksCompleteMultiple = void 0;
4
+ const zod_1 = require("zod");
2
5
  const ArgsSchema = {
3
- ids: z
4
- .array(z.string().min(1))
6
+ ids: zod_1.z
7
+ .array(zod_1.z.string().min(1))
5
8
  .min(1)
6
9
  .describe("The IDs of the tasks to complete."),
7
10
  };
@@ -23,4 +26,4 @@ const tasksCompleteMultiple = {
23
26
  return { success: true, completed };
24
27
  },
25
28
  };
26
- export { tasksCompleteMultiple };
29
+ exports.tasksCompleteMultiple = tasksCompleteMultiple;
@@ -1,6 +1,9 @@
1
- import { z } from "zod";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tasksDeleteOne = void 0;
4
+ const zod_1 = require("zod");
2
5
  const ArgsSchema = {
3
- id: z.string().min(1).describe("The ID of the task to delete."),
6
+ id: zod_1.z.string().min(1).describe("The ID of the task to delete."),
4
7
  };
5
8
  const tasksDeleteOne = {
6
9
  name: "tasks-delete-one",
@@ -11,4 +14,4 @@ const tasksDeleteOne = {
11
14
  return { success: true };
12
15
  },
13
16
  };
14
- export { tasksDeleteOne };
17
+ exports.tasksDeleteOne = tasksDeleteOne;
@@ -1,18 +1,21 @@
1
- import { z } from "zod";
2
- import { mapTask } from "./shared.js";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tasksListForSection = void 0;
4
+ const zod_1 = require("zod");
5
+ const shared_js_1 = require("./shared.js");
3
6
  const ArgsSchema = {
4
- sectionId: z
7
+ sectionId: zod_1.z
5
8
  .string()
6
9
  .min(1)
7
10
  .describe("The ID of the section to get tasks for."),
8
- limit: z
11
+ limit: zod_1.z
9
12
  .number()
10
13
  .int()
11
14
  .min(1)
12
15
  .max(50)
13
16
  .default(10)
14
17
  .describe("The maximum number of tasks to return."),
15
- cursor: z
18
+ cursor: zod_1.z
16
19
  .string()
17
20
  .optional()
18
21
  .describe("The cursor to get the next page of tasks (from previous call)."),
@@ -29,9 +32,9 @@ const tasksListForSection = {
29
32
  cursor: cursor ?? null,
30
33
  });
31
34
  return {
32
- tasks: results.map(mapTask),
35
+ tasks: results.map(shared_js_1.mapTask),
33
36
  nextCursor,
34
37
  };
35
38
  },
36
39
  };
37
- export { tasksListForSection };
40
+ exports.tasksListForSection = tasksListForSection;
@@ -1,14 +1,17 @@
1
- import { z } from "zod";
2
- import { getTasksByFilter } from "./shared.js";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tasksListOverdue = void 0;
4
+ const zod_1 = require("zod");
5
+ const shared_js_1 = require("./shared.js");
3
6
  const ArgsSchema = {
4
- limit: z
7
+ limit: zod_1.z
5
8
  .number()
6
9
  .int()
7
10
  .min(1)
8
11
  .max(50)
9
12
  .default(10)
10
13
  .describe("The maximum number of overdue tasks to return."),
11
- cursor: z
14
+ cursor: zod_1.z
12
15
  .string()
13
16
  .optional()
14
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,7 +21,7 @@ const tasksListOverdue = {
18
21
  description: "Get overdue tasks.",
19
22
  parameters: ArgsSchema,
20
23
  async execute(args, client) {
21
- return await getTasksByFilter({
24
+ return await (0, shared_js_1.getTasksByFilter)({
22
25
  client,
23
26
  query: "overdue",
24
27
  cursor: args.cursor,
@@ -26,4 +29,4 @@ const tasksListOverdue = {
26
29
  });
27
30
  },
28
31
  };
29
- export { tasksListOverdue };
32
+ exports.tasksListOverdue = tasksListOverdue;
@@ -1,25 +1,28 @@
1
- import { z } from "zod";
2
- const TaskUpdateSchema = z.object({
3
- id: z.string().min(1).describe("The ID of the task to update."),
4
- projectId: z
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
5
8
  .string()
6
9
  .optional()
7
10
  .describe("The new project ID for the task."),
8
- sectionId: z
11
+ sectionId: zod_1.z
9
12
  .string()
10
13
  .optional()
11
14
  .describe("The new section ID for the task."),
12
- parentId: z
15
+ parentId: zod_1.z
13
16
  .string()
14
17
  .optional()
15
18
  .describe("The new parent task ID (for subtasks)."),
16
- order: z
19
+ order: zod_1.z
17
20
  .number()
18
21
  .optional()
19
22
  .describe("The new order of the task within its parent/section."),
20
23
  });
21
24
  const ArgsSchema = {
22
- tasks: z
25
+ tasks: zod_1.z
23
26
  .array(TaskUpdateSchema)
24
27
  .min(1)
25
28
  .describe("Array of task updates to apply."),
@@ -37,4 +40,4 @@ const tasksOrganizeMultiple = {
37
40
  return results;
38
41
  },
39
42
  };
40
- export { tasksOrganizeMultiple };
43
+ exports.tasksOrganizeMultiple = tasksOrganizeMultiple;
@@ -1,15 +1,18 @@
1
- import { z } from "zod";
2
- import { getTasksByFilter } from "./shared.js";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tasksSearch = void 0;
4
+ const zod_1 = require("zod");
5
+ const shared_js_1 = require("./shared.js");
3
6
  const ArgsSchema = {
4
- searchText: z.string().min(1).describe("The text to search for in tasks."),
5
- limit: z
7
+ searchText: zod_1.z.string().min(1).describe("The text to search for in tasks."),
8
+ limit: zod_1.z
6
9
  .number()
7
10
  .int()
8
11
  .min(1)
9
12
  .max(50)
10
13
  .default(10)
11
14
  .describe("The maximum number of tasks to return."),
12
- cursor: z
15
+ cursor: zod_1.z
13
16
  .string()
14
17
  .optional()
15
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,7 +22,7 @@ const tasksSearch = {
19
22
  description: "Search tasks by text using Todoist's filter query.",
20
23
  parameters: ArgsSchema,
21
24
  async execute(args, client) {
22
- return await getTasksByFilter({
25
+ return await (0, shared_js_1.getTasksByFilter)({
23
26
  client,
24
27
  query: `search: ${args.searchText}`,
25
28
  cursor: args.cursor,
@@ -27,4 +30,4 @@ const tasksSearch = {
27
30
  });
28
31
  },
29
32
  };
30
- export { tasksSearch };
33
+ exports.tasksSearch = tasksSearch;
@@ -1,31 +1,34 @@
1
- import { z } from "zod";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tasksUpdateOne = void 0;
4
+ const zod_1 = require("zod");
2
5
  const ArgsSchema = {
3
- id: z.string().min(1).describe("The ID of the task to update."),
4
- content: z.string().optional().describe("The new content of the task."),
5
- description: z
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
6
9
  .string()
7
10
  .optional()
8
11
  .describe("The new description of the task."),
9
- projectId: z
12
+ projectId: zod_1.z
10
13
  .string()
11
14
  .optional()
12
15
  .describe("The new project ID for the task."),
13
- sectionId: z
16
+ sectionId: zod_1.z
14
17
  .string()
15
18
  .optional()
16
19
  .describe("The new section ID for the task."),
17
- parentId: z
20
+ parentId: zod_1.z
18
21
  .string()
19
22
  .optional()
20
23
  .describe("The new parent task ID (for subtasks)."),
21
- priority: z
24
+ priority: zod_1.z
22
25
  .number()
23
26
  .int()
24
27
  .min(1)
25
28
  .max(4)
26
29
  .optional()
27
30
  .describe("The new priority of the task (1-4)."),
28
- dueString: z
31
+ dueString: zod_1.z
29
32
  .string()
30
33
  .optional()
31
34
  .describe("The new due date for the task, in natural language (e.g., 'tomorrow at 5pm')."),
@@ -39,4 +42,4 @@ const tasksUpdateOne = {
39
42
  return await client.updateTask(id, updateArgs);
40
43
  },
41
44
  };
42
- export { tasksUpdateOne };
45
+ exports.tasksUpdateOne = tasksUpdateOne;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doist/todoist-ai",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",