@doist/todoist-ai 2.2.2 → 4.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.
Files changed (202) hide show
  1. package/README.md +6 -14
  2. package/dist/index.d.ts +619 -250
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +45 -29
  5. package/dist/main.js +2 -1
  6. package/dist/mcp-helpers.d.ts +25 -3
  7. package/dist/mcp-helpers.d.ts.map +1 -1
  8. package/dist/mcp-helpers.js +37 -19
  9. package/dist/mcp-server.d.ts.map +1 -1
  10. package/dist/mcp-server.js +44 -28
  11. package/dist/tools/__tests__/add-comments.test.d.ts +2 -0
  12. package/dist/tools/__tests__/add-comments.test.d.ts.map +1 -0
  13. package/dist/tools/__tests__/add-comments.test.js +241 -0
  14. package/dist/tools/__tests__/add-projects.test.d.ts +2 -0
  15. package/dist/tools/__tests__/add-projects.test.d.ts.map +1 -0
  16. package/dist/tools/__tests__/add-projects.test.js +152 -0
  17. package/dist/tools/__tests__/add-sections.test.d.ts +2 -0
  18. package/dist/tools/__tests__/add-sections.test.d.ts.map +1 -0
  19. package/dist/tools/__tests__/add-sections.test.js +181 -0
  20. package/dist/tools/__tests__/add-tasks.test.d.ts +2 -0
  21. package/dist/tools/__tests__/add-tasks.test.d.ts.map +1 -0
  22. package/dist/tools/__tests__/{tasks-add-multiple.test.js → add-tasks.test.js} +89 -79
  23. package/dist/tools/__tests__/complete-tasks.test.d.ts +2 -0
  24. package/dist/tools/__tests__/complete-tasks.test.d.ts.map +1 -0
  25. package/dist/tools/__tests__/complete-tasks.test.js +206 -0
  26. package/dist/tools/__tests__/delete-object.test.d.ts +2 -0
  27. package/dist/tools/__tests__/delete-object.test.d.ts.map +1 -0
  28. package/dist/tools/__tests__/{delete-one.test.js → delete-object.test.js} +42 -22
  29. package/dist/tools/__tests__/find-comments.test.d.ts +2 -0
  30. package/dist/tools/__tests__/find-comments.test.d.ts.map +1 -0
  31. package/dist/tools/__tests__/find-comments.test.js +242 -0
  32. package/dist/tools/__tests__/find-completed-tasks.test.d.ts +2 -0
  33. package/dist/tools/__tests__/find-completed-tasks.test.d.ts.map +1 -0
  34. package/dist/tools/__tests__/{tasks-list-completed.test.js → find-completed-tasks.test.js} +13 -36
  35. package/dist/tools/__tests__/find-projects.test.d.ts +2 -0
  36. package/dist/tools/__tests__/find-projects.test.d.ts.map +1 -0
  37. package/dist/tools/__tests__/{projects-list.test.js → find-projects.test.js} +55 -39
  38. package/dist/tools/__tests__/find-sections.test.d.ts +2 -0
  39. package/dist/tools/__tests__/find-sections.test.d.ts.map +1 -0
  40. package/dist/tools/__tests__/{sections-search.test.js → find-sections.test.js} +64 -50
  41. package/dist/tools/__tests__/find-tasks-by-date.test.d.ts +2 -0
  42. package/dist/tools/__tests__/find-tasks-by-date.test.d.ts.map +1 -0
  43. package/dist/tools/__tests__/{tasks-list-by-date.test.js → find-tasks-by-date.test.js} +96 -14
  44. package/dist/tools/__tests__/find-tasks.test.d.ts +2 -0
  45. package/dist/tools/__tests__/find-tasks.test.d.ts.map +1 -0
  46. package/dist/tools/__tests__/find-tasks.test.js +334 -0
  47. package/dist/tools/__tests__/get-overview.test.d.ts +2 -0
  48. package/dist/tools/__tests__/get-overview.test.d.ts.map +1 -0
  49. package/dist/tools/__tests__/{overview.test.js → get-overview.test.js} +77 -13
  50. package/dist/tools/__tests__/update-comments.test.d.ts +2 -0
  51. package/dist/tools/__tests__/update-comments.test.d.ts.map +1 -0
  52. package/dist/tools/__tests__/update-comments.test.js +296 -0
  53. package/dist/tools/__tests__/update-projects.test.d.ts +2 -0
  54. package/dist/tools/__tests__/update-projects.test.d.ts.map +1 -0
  55. package/dist/tools/__tests__/update-projects.test.js +205 -0
  56. package/dist/tools/__tests__/update-sections.test.d.ts +2 -0
  57. package/dist/tools/__tests__/update-sections.test.d.ts.map +1 -0
  58. package/dist/tools/__tests__/update-sections.test.js +156 -0
  59. package/dist/tools/__tests__/update-tasks.test.d.ts +2 -0
  60. package/dist/tools/__tests__/update-tasks.test.d.ts.map +1 -0
  61. package/dist/tools/__tests__/update-tasks.test.js +645 -0
  62. package/dist/tools/add-comments.d.ts +51 -0
  63. package/dist/tools/add-comments.d.ts.map +1 -0
  64. package/dist/tools/add-comments.js +79 -0
  65. package/dist/tools/add-projects.d.ts +50 -0
  66. package/dist/tools/add-projects.d.ts.map +1 -0
  67. package/dist/tools/add-projects.js +59 -0
  68. package/dist/tools/add-sections.d.ts +46 -0
  69. package/dist/tools/add-sections.d.ts.map +1 -0
  70. package/dist/tools/add-sections.js +61 -0
  71. package/dist/tools/add-tasks.d.ts +82 -0
  72. package/dist/tools/add-tasks.d.ts.map +1 -0
  73. package/dist/tools/add-tasks.js +96 -0
  74. package/dist/tools/complete-tasks.d.ts +40 -0
  75. package/dist/tools/complete-tasks.d.ts.map +1 -0
  76. package/dist/tools/complete-tasks.js +68 -0
  77. package/dist/tools/delete-object.d.ts +38 -0
  78. package/dist/tools/delete-object.d.ts.map +1 -0
  79. package/dist/tools/delete-object.js +79 -0
  80. package/dist/tools/find-comments.d.ts +46 -0
  81. package/dist/tools/find-comments.d.ts.map +1 -0
  82. package/dist/tools/find-comments.js +143 -0
  83. package/dist/tools/find-completed-tasks.d.ts +74 -0
  84. package/dist/tools/find-completed-tasks.d.ts.map +1 -0
  85. package/dist/tools/find-completed-tasks.js +112 -0
  86. package/dist/tools/find-projects.d.ts +53 -0
  87. package/dist/tools/find-projects.d.ts.map +1 -0
  88. package/dist/tools/find-projects.js +101 -0
  89. package/dist/tools/find-sections.d.ts +42 -0
  90. package/dist/tools/find-sections.d.ts.map +1 -0
  91. package/dist/tools/find-sections.js +96 -0
  92. package/dist/tools/find-tasks-by-date.d.ts +59 -0
  93. package/dist/tools/find-tasks-by-date.d.ts.map +1 -0
  94. package/dist/tools/find-tasks-by-date.js +121 -0
  95. package/dist/tools/find-tasks.d.ts +65 -0
  96. package/dist/tools/find-tasks.d.ts.map +1 -0
  97. package/dist/tools/find-tasks.js +182 -0
  98. package/dist/tools/get-overview.d.ts +67 -0
  99. package/dist/tools/get-overview.d.ts.map +1 -0
  100. package/dist/tools/{overview.js → get-overview.js} +66 -19
  101. package/dist/tools/update-comments.d.ts +50 -0
  102. package/dist/tools/update-comments.d.ts.map +1 -0
  103. package/dist/tools/update-comments.js +82 -0
  104. package/dist/tools/update-projects.d.ts +59 -0
  105. package/dist/tools/update-projects.d.ts.map +1 -0
  106. package/dist/tools/update-projects.js +84 -0
  107. package/dist/tools/update-sections.d.ts +47 -0
  108. package/dist/tools/update-sections.d.ts.map +1 -0
  109. package/dist/tools/update-sections.js +70 -0
  110. package/dist/tools/update-tasks.d.ts +94 -0
  111. package/dist/tools/update-tasks.d.ts.map +1 -0
  112. package/dist/tools/update-tasks.js +120 -0
  113. package/dist/utils/constants.d.ts +39 -0
  114. package/dist/utils/constants.d.ts.map +1 -0
  115. package/dist/utils/constants.js +41 -0
  116. package/dist/utils/response-builders.d.ts +88 -0
  117. package/dist/utils/response-builders.d.ts.map +1 -0
  118. package/dist/utils/response-builders.js +202 -0
  119. package/dist/{tools → utils}/test-helpers.d.ts +16 -0
  120. package/dist/utils/test-helpers.d.ts.map +1 -0
  121. package/dist/{tools → utils}/test-helpers.js +51 -0
  122. package/dist/utils/tool-names.d.ts +28 -0
  123. package/dist/utils/tool-names.d.ts.map +1 -0
  124. package/dist/utils/tool-names.js +31 -0
  125. package/package.json +1 -1
  126. package/dist/tools/__tests__/delete-one.test.d.ts +0 -2
  127. package/dist/tools/__tests__/delete-one.test.d.ts.map +0 -1
  128. package/dist/tools/__tests__/overview.test.d.ts +0 -2
  129. package/dist/tools/__tests__/overview.test.d.ts.map +0 -1
  130. package/dist/tools/__tests__/projects-list.test.d.ts +0 -2
  131. package/dist/tools/__tests__/projects-list.test.d.ts.map +0 -1
  132. package/dist/tools/__tests__/projects-manage.test.d.ts +0 -2
  133. package/dist/tools/__tests__/projects-manage.test.d.ts.map +0 -1
  134. package/dist/tools/__tests__/projects-manage.test.js +0 -106
  135. package/dist/tools/__tests__/sections-manage.test.d.ts +0 -2
  136. package/dist/tools/__tests__/sections-manage.test.d.ts.map +0 -1
  137. package/dist/tools/__tests__/sections-manage.test.js +0 -138
  138. package/dist/tools/__tests__/sections-search.test.d.ts +0 -2
  139. package/dist/tools/__tests__/sections-search.test.d.ts.map +0 -1
  140. package/dist/tools/__tests__/tasks-add-multiple.test.d.ts +0 -2
  141. package/dist/tools/__tests__/tasks-add-multiple.test.d.ts.map +0 -1
  142. package/dist/tools/__tests__/tasks-complete-multiple.test.d.ts +0 -2
  143. package/dist/tools/__tests__/tasks-complete-multiple.test.d.ts.map +0 -1
  144. package/dist/tools/__tests__/tasks-complete-multiple.test.js +0 -146
  145. package/dist/tools/__tests__/tasks-list-by-date.test.d.ts +0 -2
  146. package/dist/tools/__tests__/tasks-list-by-date.test.d.ts.map +0 -1
  147. package/dist/tools/__tests__/tasks-list-completed.test.d.ts +0 -2
  148. package/dist/tools/__tests__/tasks-list-completed.test.d.ts.map +0 -1
  149. package/dist/tools/__tests__/tasks-list-for-container.test.d.ts +0 -2
  150. package/dist/tools/__tests__/tasks-list-for-container.test.d.ts.map +0 -1
  151. package/dist/tools/__tests__/tasks-list-for-container.test.js +0 -232
  152. package/dist/tools/__tests__/tasks-organize-multiple.test.d.ts +0 -2
  153. package/dist/tools/__tests__/tasks-organize-multiple.test.d.ts.map +0 -1
  154. package/dist/tools/__tests__/tasks-organize-multiple.test.js +0 -245
  155. package/dist/tools/__tests__/tasks-search.test.d.ts +0 -2
  156. package/dist/tools/__tests__/tasks-search.test.d.ts.map +0 -1
  157. package/dist/tools/__tests__/tasks-search.test.js +0 -106
  158. package/dist/tools/__tests__/tasks-update-one.test.d.ts +0 -2
  159. package/dist/tools/__tests__/tasks-update-one.test.d.ts.map +0 -1
  160. package/dist/tools/__tests__/tasks-update-one.test.js +0 -251
  161. package/dist/tools/delete-one.d.ts +0 -17
  162. package/dist/tools/delete-one.d.ts.map +0 -1
  163. package/dist/tools/delete-one.js +0 -25
  164. package/dist/tools/overview.d.ts +0 -14
  165. package/dist/tools/overview.d.ts.map +0 -1
  166. package/dist/tools/projects-list.d.ts +0 -29
  167. package/dist/tools/projects-list.d.ts.map +0 -1
  168. package/dist/tools/projects-list.js +0 -39
  169. package/dist/tools/projects-manage.d.ts +0 -24
  170. package/dist/tools/projects-manage.d.ts.map +0 -1
  171. package/dist/tools/projects-manage.js +0 -26
  172. package/dist/tools/sections-manage.d.ts +0 -23
  173. package/dist/tools/sections-manage.d.ts.map +0 -1
  174. package/dist/tools/sections-manage.js +0 -37
  175. package/dist/tools/sections-search.d.ts +0 -18
  176. package/dist/tools/sections-search.d.ts.map +0 -1
  177. package/dist/tools/sections-search.js +0 -27
  178. package/dist/tools/tasks-add-multiple.d.ts +0 -55
  179. package/dist/tools/tasks-add-multiple.d.ts.map +0 -1
  180. package/dist/tools/tasks-add-multiple.js +0 -52
  181. package/dist/tools/tasks-complete-multiple.d.ts +0 -16
  182. package/dist/tools/tasks-complete-multiple.d.ts.map +0 -1
  183. package/dist/tools/tasks-complete-multiple.js +0 -23
  184. package/dist/tools/tasks-list-by-date.d.ts +0 -34
  185. package/dist/tools/tasks-list-by-date.d.ts.map +0 -1
  186. package/dist/tools/tasks-list-by-date.js +0 -53
  187. package/dist/tools/tasks-list-completed.d.ts +0 -44
  188. package/dist/tools/tasks-list-completed.d.ts.map +0 -1
  189. package/dist/tools/tasks-list-completed.js +0 -49
  190. package/dist/tools/tasks-list-for-container.d.ts +0 -34
  191. package/dist/tools/tasks-list-for-container.d.ts.map +0 -1
  192. package/dist/tools/tasks-list-for-container.js +0 -48
  193. package/dist/tools/tasks-organize-multiple.d.ts +0 -37
  194. package/dist/tools/tasks-organize-multiple.d.ts.map +0 -1
  195. package/dist/tools/tasks-organize-multiple.js +0 -34
  196. package/dist/tools/tasks-search.d.ts +0 -32
  197. package/dist/tools/tasks-search.d.ts.map +0 -1
  198. package/dist/tools/tasks-search.js +0 -30
  199. package/dist/tools/tasks-update-one.d.ts +0 -29
  200. package/dist/tools/tasks-update-one.d.ts.map +0 -1
  201. package/dist/tools/tasks-update-one.js +0 -63
  202. package/dist/tools/test-helpers.d.ts.map +0 -1
@@ -1,52 +0,0 @@
1
- import { z } from 'zod';
2
- import { mapTask } from '../tool-helpers.js';
3
- import { DurationParseError, parseDuration } from '../utils/duration-parser.js';
4
- const TaskSchema = z.object({
5
- content: z.string().min(1).describe('The content of the task to create.'),
6
- description: z.string().optional().describe('The description of the task.'),
7
- priority: z.number().int().min(1).max(4).optional().describe('The priority of the task (1-4).'),
8
- dueString: z.string().optional().describe('The due date for the task, in natural language.'),
9
- duration: z
10
- .string()
11
- .optional()
12
- .describe('The duration of the task. Use format: "2h" (hours), "90m" (minutes), "2h30m" (combined), or "1.5h" (decimal hours). Max 24h.'),
13
- });
14
- const ArgsSchema = {
15
- projectId: z.string().optional().describe('The project ID to add the tasks to.'),
16
- sectionId: z.string().optional().describe('The section ID to add the tasks to.'),
17
- parentId: z.string().optional().describe('The parent task ID (for subtasks).'),
18
- tasks: z.array(TaskSchema).min(1).describe('The array of tasks to add.'),
19
- };
20
- const tasksAddMultiple = {
21
- name: 'tasks-add-multiple',
22
- description: 'Add one or more tasks to a project, section, or parent.',
23
- parameters: ArgsSchema,
24
- async execute(args, client) {
25
- const { projectId, sectionId, parentId, tasks } = args;
26
- const newTasks = [];
27
- for (const task of tasks) {
28
- const { duration: durationStr, ...otherTaskArgs } = task;
29
- let taskArgs = { ...otherTaskArgs, projectId, sectionId, parentId };
30
- // Parse duration if provided
31
- if (durationStr) {
32
- try {
33
- const { minutes } = parseDuration(durationStr);
34
- taskArgs = {
35
- ...taskArgs,
36
- duration: minutes,
37
- durationUnit: 'minute',
38
- };
39
- }
40
- catch (error) {
41
- if (error instanceof DurationParseError) {
42
- throw new Error(`Task "${task.content}": ${error.message}`);
43
- }
44
- throw error;
45
- }
46
- }
47
- newTasks.push(await client.addTask(taskArgs));
48
- }
49
- return newTasks.map(mapTask);
50
- },
51
- };
52
- export { tasksAddMultiple };
@@ -1,16 +0,0 @@
1
- import { z } from 'zod';
2
- declare const tasksCompleteMultiple: {
3
- name: string;
4
- description: string;
5
- parameters: {
6
- ids: z.ZodArray<z.ZodString, "many">;
7
- };
8
- execute(args: {
9
- ids: string[];
10
- }, client: import("@doist/todoist-api-typescript").TodoistApi): Promise<{
11
- success: boolean;
12
- completed: string[];
13
- }>;
14
- };
15
- export { tasksCompleteMultiple };
16
- //# sourceMappingURL=tasks-complete-multiple.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,23 +0,0 @@
1
- import { z } from 'zod';
2
- const ArgsSchema = {
3
- ids: z.array(z.string().min(1)).min(1).describe('The IDs of the tasks to complete.'),
4
- };
5
- const tasksCompleteMultiple = {
6
- name: 'tasks-complete-multiple',
7
- description: 'Complete one or more tasks by their IDs.',
8
- parameters: ArgsSchema,
9
- async execute(args, client) {
10
- const completed = [];
11
- for (const id of args.ids) {
12
- try {
13
- await client.closeTask(id);
14
- completed.push(id);
15
- }
16
- catch {
17
- // Ignore errors for individual tasks, continue with others
18
- }
19
- }
20
- return { success: true, completed };
21
- },
22
- };
23
- export { tasksCompleteMultiple };
@@ -1,34 +0,0 @@
1
- import { z } from 'zod';
2
- declare const tasksListByDate: {
3
- name: string;
4
- description: string;
5
- parameters: {
6
- startDate: z.ZodString;
7
- daysCount: z.ZodDefault<z.ZodNumber>;
8
- limit: z.ZodDefault<z.ZodNumber>;
9
- cursor: z.ZodOptional<z.ZodString>;
10
- };
11
- execute(args: {
12
- limit: number;
13
- startDate: string;
14
- daysCount: number;
15
- cursor?: string | undefined;
16
- }, client: import("@doist/todoist-api-typescript").TodoistApi): Promise<{
17
- tasks: {
18
- id: string;
19
- content: string;
20
- description: string;
21
- dueDate: string | undefined;
22
- recurring: string | boolean;
23
- priority: number;
24
- projectId: string;
25
- sectionId: string | null;
26
- parentId: string | null;
27
- labels: string[];
28
- duration: string | null;
29
- }[];
30
- nextCursor: string | null;
31
- }>;
32
- };
33
- export { tasksListByDate };
34
- //# sourceMappingURL=tasks-list-by-date.d.ts.map
@@ -1 +0,0 @@
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;AAmCvB,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BqB,CAAA;AAE1C,OAAO,EAAE,eAAe,EAAE,CAAA"}
@@ -1,53 +0,0 @@
1
- import { addDays, formatISO } from 'date-fns';
2
- import { z } from 'zod';
3
- import { getTasksByFilter } from '../tool-helpers.js';
4
- const ArgsSchema = {
5
- startDate: z
6
- .string()
7
- .regex(/^(\d{4}-\d{2}-\d{2}|today|overdue)$/)
8
- .describe("The start date to get the tasks for. Format: YYYY-MM-DD, 'today', or 'overdue'."),
9
- daysCount: z
10
- .number()
11
- .int()
12
- .min(1)
13
- .max(30)
14
- .default(1)
15
- .describe("The number of days to get the tasks for, starting from the start date. Ignored when startDate is 'overdue'."),
16
- limit: z
17
- .number()
18
- .int()
19
- .min(1)
20
- .max(50)
21
- .default(10)
22
- .describe('The maximum number of tasks to return.'),
23
- cursor: z
24
- .string()
25
- .optional()
26
- .describe('The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters).'),
27
- };
28
- const tasksListByDate = {
29
- name: 'tasks-list-by-date',
30
- description: "Get tasks by date range or overdue tasks. Use startDate 'overdue' for overdue tasks, or provide a date/date range.",
31
- parameters: ArgsSchema,
32
- async execute(args, client) {
33
- let query;
34
- if (args.startDate === 'overdue') {
35
- query = 'overdue';
36
- }
37
- else {
38
- const startDate = args.startDate === 'today'
39
- ? formatISO(new Date(), { representation: 'date' })
40
- : args.startDate;
41
- const endDate = addDays(startDate, args.daysCount + 1);
42
- const endDateStr = formatISO(endDate, { representation: 'date' });
43
- query = `(due after: ${startDate} | due: ${startDate}) & due before: ${endDateStr}`;
44
- }
45
- return await getTasksByFilter({
46
- client,
47
- query,
48
- cursor: args.cursor,
49
- limit: args.limit,
50
- });
51
- },
52
- };
53
- export { tasksListByDate };
@@ -1,44 +0,0 @@
1
- import { z } from 'zod';
2
- declare const tasksListCompleted: {
3
- name: string;
4
- description: string;
5
- parameters: {
6
- getBy: z.ZodDefault<z.ZodEnum<["completion", "due"]>>;
7
- since: z.ZodString;
8
- until: z.ZodString;
9
- workspaceId: z.ZodOptional<z.ZodString>;
10
- projectId: z.ZodOptional<z.ZodString>;
11
- sectionId: z.ZodOptional<z.ZodString>;
12
- parentId: z.ZodOptional<z.ZodString>;
13
- limit: z.ZodDefault<z.ZodNumber>;
14
- cursor: z.ZodOptional<z.ZodString>;
15
- };
16
- execute(args: {
17
- limit: number;
18
- getBy: "completion" | "due";
19
- since: string;
20
- until: string;
21
- parentId?: string | undefined;
22
- workspaceId?: string | undefined;
23
- projectId?: string | undefined;
24
- sectionId?: string | undefined;
25
- cursor?: string | undefined;
26
- }, client: import("@doist/todoist-api-typescript").TodoistApi): Promise<{
27
- tasks: {
28
- id: string;
29
- content: string;
30
- description: string;
31
- dueDate: string | undefined;
32
- recurring: string | boolean;
33
- priority: number;
34
- projectId: string;
35
- sectionId: string | null;
36
- parentId: string | null;
37
- labels: string[];
38
- duration: string | null;
39
- }[];
40
- nextCursor: string | null;
41
- }>;
42
- };
43
- export { tasksListCompleted };
44
- //# sourceMappingURL=tasks-list-completed.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tasks-list-completed.d.ts","sourceRoot":"","sources":["../../src/tools/tasks-list-completed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAwCvB,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAekB,CAAA;AAE1C,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
@@ -1,49 +0,0 @@
1
- import { z } from 'zod';
2
- import { mapTask } from '../tool-helpers.js';
3
- const ArgsSchema = {
4
- getBy: z
5
- .enum(['completion', 'due'])
6
- .default('completion')
7
- .describe('The method to use to get the tasks: "completion" to get tasks by completion date (ie, when the task was actually completed), "due" to get tasks by due date (ie, when the task was due to be completed by).'),
8
- since: z
9
- .string()
10
- .date()
11
- .regex(/^\d{4}-\d{2}-\d{2}$/)
12
- .describe('The start date to get the tasks for. Format: YYYY-MM-DD.'),
13
- until: z
14
- .string()
15
- .date()
16
- .regex(/^\d{4}-\d{2}-\d{2}$/)
17
- .describe('The start date to get the tasks for. Format: YYYY-MM-DD.'),
18
- workspaceId: z.string().optional().describe('The ID of the workspace to get the tasks for.'),
19
- projectId: z.string().optional().describe('The ID of the project to get the tasks for.'),
20
- sectionId: z.string().optional().describe('The ID of the section to get the tasks for.'),
21
- parentId: z.string().optional().describe('The ID of the parent task to get the tasks for.'),
22
- limit: z
23
- .number()
24
- .int()
25
- .min(1)
26
- .max(200)
27
- .default(50)
28
- .describe('The maximum number of tasks to return. Default is 50, maximum is 200.'),
29
- cursor: z
30
- .string()
31
- .optional()
32
- .describe('The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters).'),
33
- };
34
- const tasksListCompleted = {
35
- name: 'tasks-list-completed',
36
- description: 'Get completed tasks.',
37
- parameters: ArgsSchema,
38
- async execute(args, client) {
39
- const { getBy, ...rest } = args;
40
- const { items, nextCursor } = getBy === 'completion'
41
- ? await client.getCompletedTasksByCompletionDate(rest)
42
- : await client.getCompletedTasksByDueDate(rest);
43
- return {
44
- tasks: items.map(mapTask),
45
- nextCursor,
46
- };
47
- },
48
- };
49
- export { tasksListCompleted };
@@ -1,34 +0,0 @@
1
- import { z } from 'zod';
2
- declare const tasksListForContainer: {
3
- name: string;
4
- description: string;
5
- parameters: {
6
- type: z.ZodEnum<["project", "section", "parent"]>;
7
- id: z.ZodString;
8
- limit: z.ZodDefault<z.ZodNumber>;
9
- cursor: z.ZodOptional<z.ZodString>;
10
- };
11
- execute(args: {
12
- type: "project" | "section" | "parent";
13
- id: string;
14
- limit: number;
15
- cursor?: string | undefined;
16
- }, client: import("@doist/todoist-api-typescript").TodoistApi): Promise<{
17
- tasks: {
18
- id: string;
19
- content: string;
20
- description: string;
21
- dueDate: string | undefined;
22
- recurring: string | boolean;
23
- priority: number;
24
- projectId: string;
25
- sectionId: string | null;
26
- parentId: string | null;
27
- labels: string[];
28
- duration: string | null;
29
- }[];
30
- nextCursor: string | null;
31
- }>;
32
- };
33
- export { tasksListForContainer };
34
- //# sourceMappingURL=tasks-list-for-container.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tasks-list-for-container.d.ts","sourceRoot":"","sources":["../../src/tools/tasks-list-for-container.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAwBvB,QAAA,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+Be,CAAA;AAE1C,OAAO,EAAE,qBAAqB,EAAE,CAAA"}
@@ -1,48 +0,0 @@
1
- import { z } from 'zod';
2
- import { mapTask } from '../tool-helpers.js';
3
- const ArgsSchema = {
4
- type: z
5
- .enum(['project', 'section', 'parent'])
6
- .describe('The type of container to get tasks for.'),
7
- id: z.string().min(1).describe('The ID of the container to get tasks for.'),
8
- limit: z
9
- .number()
10
- .int()
11
- .min(1)
12
- .max(50)
13
- .default(10)
14
- .describe('The maximum number of tasks to return.'),
15
- cursor: z
16
- .string()
17
- .optional()
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
- };
20
- const tasksListForContainer = {
21
- name: 'tasks-list-for-container',
22
- description: 'Get tasks for a specific project, section, or parent task (subtasks).',
23
- parameters: ArgsSchema,
24
- async execute(args, client) {
25
- const { type, id, limit, cursor } = args;
26
- const taskParams = {
27
- limit,
28
- cursor: cursor ?? null,
29
- };
30
- switch (type) {
31
- case 'project':
32
- taskParams.projectId = id;
33
- break;
34
- case 'section':
35
- taskParams.sectionId = id;
36
- break;
37
- case 'parent':
38
- taskParams.parentId = id;
39
- break;
40
- }
41
- const { results, nextCursor } = await client.getTasks(taskParams);
42
- return {
43
- tasks: results.map(mapTask),
44
- nextCursor,
45
- };
46
- },
47
- };
48
- export { tasksListForContainer };
@@ -1,37 +0,0 @@
1
- import { z } from 'zod';
2
- declare const tasksOrganizeMultiple: {
3
- name: string;
4
- description: string;
5
- parameters: {
6
- tasks: z.ZodArray<z.ZodObject<{
7
- id: z.ZodString;
8
- projectId: z.ZodOptional<z.ZodString>;
9
- sectionId: z.ZodOptional<z.ZodString>;
10
- parentId: z.ZodOptional<z.ZodString>;
11
- order: z.ZodOptional<z.ZodNumber>;
12
- }, "strip", z.ZodTypeAny, {
13
- id: string;
14
- parentId?: string | undefined;
15
- projectId?: string | undefined;
16
- sectionId?: string | undefined;
17
- order?: number | undefined;
18
- }, {
19
- id: string;
20
- parentId?: string | undefined;
21
- projectId?: string | undefined;
22
- sectionId?: string | undefined;
23
- order?: number | undefined;
24
- }>, "many">;
25
- };
26
- execute(args: {
27
- tasks: {
28
- id: string;
29
- parentId?: string | undefined;
30
- projectId?: string | undefined;
31
- sectionId?: string | undefined;
32
- order?: number | undefined;
33
- }[];
34
- }, client: import("@doist/todoist-api-typescript").TodoistApi): Promise<import("@doist/todoist-api-typescript").Task[]>;
35
- };
36
- export { tasksOrganizeMultiple };
37
- //# sourceMappingURL=tasks-organize-multiple.d.ts.map
@@ -1 +0,0 @@
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;AAgBvB,QAAA,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwBe,CAAA;AAE1C,OAAO,EAAE,qBAAqB,EAAE,CAAA"}
@@ -1,34 +0,0 @@
1
- import { z } from 'zod';
2
- import { createMoveTaskArgs } from '../tool-helpers.js';
3
- const TaskUpdateSchema = z.object({
4
- id: z.string().min(1).describe('The ID of the task to update.'),
5
- projectId: z.string().optional().describe('The new project ID for the task.'),
6
- sectionId: z.string().optional().describe('The new section ID for the task.'),
7
- parentId: z.string().optional().describe('The new parent task ID (for subtasks).'),
8
- order: z.number().optional().describe('The new order of the task within its parent/section.'),
9
- });
10
- const ArgsSchema = {
11
- tasks: z.array(TaskUpdateSchema).min(1).describe('Array of task updates to apply.'),
12
- };
13
- const tasksOrganizeMultiple = {
14
- name: 'tasks-organize-multiple',
15
- description: 'Organize multiple tasks (move, reorder, etc.) in bulk.',
16
- parameters: ArgsSchema,
17
- async execute(args, client) {
18
- const results = [];
19
- // Process each task individually for move operations
20
- for (const update of args.tasks) {
21
- const { id, projectId, sectionId, parentId } = update;
22
- if (!projectId && !sectionId && !parentId) {
23
- continue;
24
- }
25
- // Create and validate move arguments using helper
26
- const moveArgs = createMoveTaskArgs(id, projectId, sectionId, parentId);
27
- // Move each task individually to avoid bulk operation issues
28
- const movedTasks = await client.moveTasks([id], moveArgs);
29
- results.push(...movedTasks);
30
- }
31
- return results;
32
- },
33
- };
34
- export { tasksOrganizeMultiple };
@@ -1,32 +0,0 @@
1
- import { z } from 'zod';
2
- declare const tasksSearch: {
3
- name: string;
4
- description: string;
5
- parameters: {
6
- searchText: z.ZodString;
7
- limit: z.ZodDefault<z.ZodNumber>;
8
- cursor: z.ZodOptional<z.ZodString>;
9
- };
10
- execute(args: {
11
- limit: number;
12
- searchText: string;
13
- cursor?: string | undefined;
14
- }, client: import("@doist/todoist-api-typescript").TodoistApi): Promise<{
15
- tasks: {
16
- id: string;
17
- content: string;
18
- description: string;
19
- dueDate: string | undefined;
20
- recurring: string | boolean;
21
- priority: number;
22
- projectId: string;
23
- sectionId: string | null;
24
- parentId: string | null;
25
- labels: string[];
26
- duration: string | null;
27
- }[];
28
- nextCursor: string | null;
29
- }>;
30
- };
31
- export { tasksSearch };
32
- //# sourceMappingURL=tasks-search.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,30 +0,0 @@
1
- import { z } from 'zod';
2
- import { getTasksByFilter } from '../tool-helpers.js';
3
- const ArgsSchema = {
4
- searchText: z.string().min(1).describe('The text to search for in tasks.'),
5
- limit: z
6
- .number()
7
- .int()
8
- .min(1)
9
- .max(50)
10
- .default(10)
11
- .describe('The maximum number of tasks to return.'),
12
- cursor: z
13
- .string()
14
- .optional()
15
- .describe('The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters).'),
16
- };
17
- const tasksSearch = {
18
- name: 'tasks-search',
19
- description: "Search tasks by text using Todoist's filter query.",
20
- parameters: ArgsSchema,
21
- async execute(args, client) {
22
- return await getTasksByFilter({
23
- client,
24
- query: `search: ${args.searchText}`,
25
- cursor: args.cursor,
26
- limit: args.limit,
27
- });
28
- },
29
- };
30
- export { tasksSearch };
@@ -1,29 +0,0 @@
1
- import { z } from 'zod';
2
- declare const tasksUpdateOne: {
3
- name: string;
4
- description: string;
5
- parameters: {
6
- id: z.ZodString;
7
- content: z.ZodOptional<z.ZodString>;
8
- description: z.ZodOptional<z.ZodString>;
9
- projectId: z.ZodOptional<z.ZodString>;
10
- sectionId: z.ZodOptional<z.ZodString>;
11
- parentId: z.ZodOptional<z.ZodString>;
12
- priority: z.ZodOptional<z.ZodNumber>;
13
- dueString: z.ZodOptional<z.ZodString>;
14
- duration: z.ZodOptional<z.ZodString>;
15
- };
16
- execute(args: {
17
- id: string;
18
- content?: string | undefined;
19
- description?: string | undefined;
20
- parentId?: string | undefined;
21
- projectId?: string | undefined;
22
- sectionId?: string | undefined;
23
- priority?: number | undefined;
24
- dueString?: string | undefined;
25
- duration?: string | undefined;
26
- }, client: import("@doist/todoist-api-typescript").TodoistApi): Promise<import("@doist/todoist-api-typescript").Task | undefined>;
27
- };
28
- export { tasksUpdateOne };
29
- //# sourceMappingURL=tasks-update-one.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tasks-update-one.d.ts","sourceRoot":"","sources":["../../src/tools/tasks-update-one.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AA+BvB,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;CA+CsB,CAAA;AAE1C,OAAO,EAAE,cAAc,EAAE,CAAA"}
@@ -1,63 +0,0 @@
1
- import { z } from 'zod';
2
- import { createMoveTaskArgs } from '../tool-helpers.js';
3
- import { DurationParseError, parseDuration } from '../utils/duration-parser.js';
4
- const ArgsSchema = {
5
- id: z.string().min(1).describe('The ID of the task to update.'),
6
- content: z.string().optional().describe('The new content of the task.'),
7
- description: z.string().optional().describe('The new description of the task.'),
8
- projectId: z.string().optional().describe('The new project ID for the task.'),
9
- sectionId: z.string().optional().describe('The new section ID for the task.'),
10
- parentId: z.string().optional().describe('The new parent task ID (for subtasks).'),
11
- priority: z
12
- .number()
13
- .int()
14
- .min(1)
15
- .max(4)
16
- .optional()
17
- .describe('The new priority of the task (1-4).'),
18
- dueString: z
19
- .string()
20
- .optional()
21
- .describe("The new due date for the task, in natural language (e.g., 'tomorrow at 5pm')."),
22
- duration: z
23
- .string()
24
- .optional()
25
- .describe('The duration of the task. Use format: "2h" (hours), "90m" (minutes), "2h30m" (combined), or "1.5h" (decimal hours). Max 24h.'),
26
- };
27
- const tasksUpdateOne = {
28
- name: 'tasks-update-one',
29
- description: 'Update an existing task with new values.',
30
- parameters: ArgsSchema,
31
- async execute(args, client) {
32
- const { id, projectId, sectionId, parentId, duration: durationStr, ...otherUpdateArgs } = args;
33
- let updateArgs = { ...otherUpdateArgs };
34
- // Parse duration if provided
35
- if (durationStr) {
36
- try {
37
- const { minutes } = parseDuration(durationStr);
38
- updateArgs = {
39
- ...updateArgs,
40
- duration: minutes,
41
- durationUnit: 'minute',
42
- };
43
- }
44
- catch (error) {
45
- if (error instanceof DurationParseError) {
46
- throw new Error(`Task ${id}: ${error.message}`);
47
- }
48
- throw error;
49
- }
50
- }
51
- // If no move parameters are provided, use updateTask without moveTasks
52
- if (!projectId && !sectionId && !parentId) {
53
- return await client.updateTask(id, updateArgs);
54
- }
55
- const moveArgs = createMoveTaskArgs(id, projectId, sectionId, parentId);
56
- const movedTasks = await client.moveTasks([id], moveArgs);
57
- if (Object.keys(updateArgs).length > 0) {
58
- return await client.updateTask(id, updateArgs);
59
- }
60
- return movedTasks[0];
61
- },
62
- };
63
- export { tasksUpdateOne };
@@ -1 +0,0 @@
1
- {"version":3,"file":"test-helpers.d.ts","sourceRoot":"","sources":["../../src/tools/test-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAA;AAEnF;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG;IACrB,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,SAAS,EAAE,MAAM,GAAG,OAAO,CAAA;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B,CAAA;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,SAAS,GAAE,OAAO,CAAC,IAAI,CAAM,GAAG,IAAI,CA8BlE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,GAAE,OAAO,CAAC,OAAO,CAAM,GAAG,OAAO,CAe3E;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,GAAE,OAAO,CAAC,eAAe,CAAM,GAAG,eAAe,CAuB3F;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EACnC,OAAO,EAAE,CAAC,EAAE,EACZ,UAAU,GAAE,MAAM,GAAG,IAAW,GACjC;IACC,OAAO,EAAE,CAAC,EAAE,CAAA;IACZ,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAC5B,CAKA;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,GAAE,OAAO,CAAC,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;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;CAUX,CAAA"}