@doist/todoist-ai 0.1.4 → 1.1.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 (91) hide show
  1. package/README.md +27 -0
  2. package/dist/index.d.ts +74 -34
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +70 -68
  5. package/dist/main.js +7 -7
  6. package/dist/mcp-helpers.d.ts +4 -4
  7. package/dist/mcp-helpers.d.ts.map +1 -1
  8. package/dist/mcp-helpers.js +5 -7
  9. package/dist/mcp-server.d.ts +4 -2
  10. package/dist/mcp-server.d.ts.map +1 -1
  11. package/dist/mcp-server.js +52 -49
  12. package/dist/todoist-tool.d.ts +2 -2
  13. package/dist/todoist-tool.d.ts.map +1 -1
  14. package/dist/tools/account-overview.d.ts +1 -1
  15. package/dist/tools/account-overview.d.ts.map +1 -1
  16. package/dist/tools/account-overview.js +12 -11
  17. package/dist/tools/project-overview.d.ts +2 -2
  18. package/dist/tools/project-overview.d.ts.map +1 -1
  19. package/dist/tools/project-overview.js +9 -12
  20. package/dist/tools/projects-add-one.d.ts +1 -1
  21. package/dist/tools/projects-add-one.d.ts.map +1 -1
  22. package/dist/tools/projects-add-one.js +5 -5
  23. package/dist/tools/projects-delete-one.d.ts +1 -1
  24. package/dist/tools/projects-delete-one.d.ts.map +1 -1
  25. package/dist/tools/projects-delete-one.js +3 -3
  26. package/dist/tools/projects-list.d.ts +2 -2
  27. package/dist/tools/projects-list.d.ts.map +1 -1
  28. package/dist/tools/projects-list.js +4 -4
  29. package/dist/tools/projects-search.d.ts +1 -1
  30. package/dist/tools/projects-search.d.ts.map +1 -1
  31. package/dist/tools/projects-search.js +7 -7
  32. package/dist/tools/projects-update-one.d.ts +3 -3
  33. package/dist/tools/projects-update-one.d.ts.map +1 -1
  34. package/dist/tools/projects-update-one.js +3 -3
  35. package/dist/tools/sections-add-one.d.ts +1 -1
  36. package/dist/tools/sections-add-one.d.ts.map +1 -1
  37. package/dist/tools/sections-add-one.js +4 -7
  38. package/dist/tools/sections-delete-one.d.ts +1 -1
  39. package/dist/tools/sections-delete-one.d.ts.map +1 -1
  40. package/dist/tools/sections-delete-one.js +3 -3
  41. package/dist/tools/sections-search.d.ts +1 -1
  42. package/dist/tools/sections-search.d.ts.map +1 -1
  43. package/dist/tools/sections-search.js +4 -7
  44. package/dist/tools/sections-update-one.d.ts +2 -2
  45. package/dist/tools/sections-update-one.d.ts.map +1 -1
  46. package/dist/tools/sections-update-one.js +3 -3
  47. package/dist/tools/shared.d.ts +4 -1
  48. package/dist/tools/shared.d.ts.map +1 -1
  49. package/dist/tools/shared.js +11 -3
  50. package/dist/tools/shared.test.d.ts +2 -0
  51. package/dist/tools/shared.test.d.ts.map +1 -0
  52. package/dist/tools/shared.test.js +135 -0
  53. package/dist/tools/subtasks-list-for-parent-task.d.ts +2 -2
  54. package/dist/tools/subtasks-list-for-parent-task.d.ts.map +1 -1
  55. package/dist/tools/subtasks-list-for-parent-task.js +7 -10
  56. package/dist/tools/tasks-add-multiple.d.ts +2 -2
  57. package/dist/tools/tasks-add-multiple.d.ts.map +1 -1
  58. package/dist/tools/tasks-add-multiple.js +12 -30
  59. package/dist/tools/tasks-complete-multiple.d.ts +1 -1
  60. package/dist/tools/tasks-complete-multiple.d.ts.map +1 -1
  61. package/dist/tools/tasks-complete-multiple.js +3 -6
  62. package/dist/tools/tasks-delete-one.d.ts +1 -1
  63. package/dist/tools/tasks-delete-one.d.ts.map +1 -1
  64. package/dist/tools/tasks-delete-one.js +3 -3
  65. package/dist/tools/{tasks-by-date-range.d.ts → tasks-list-by-date.d.ts} +2 -2
  66. package/dist/tools/tasks-list-by-date.d.ts.map +1 -0
  67. package/dist/tools/{tasks-by-date-range.js → tasks-list-by-date.js} +10 -10
  68. package/dist/tools/tasks-list-completed.d.ts +43 -0
  69. package/dist/tools/tasks-list-completed.d.ts.map +1 -0
  70. package/dist/tools/tasks-list-completed.js +52 -0
  71. package/dist/tools/{tasks-by-project.d.ts → tasks-list-for-project.d.ts} +2 -2
  72. package/dist/tools/tasks-list-for-project.d.ts.map +1 -0
  73. package/dist/tools/{tasks-by-project.js → tasks-list-for-project.js} +7 -10
  74. package/dist/tools/tasks-list-for-section.d.ts +1 -1
  75. package/dist/tools/tasks-list-for-section.d.ts.map +1 -1
  76. package/dist/tools/tasks-list-for-section.js +7 -10
  77. package/dist/tools/tasks-list-overdue.d.ts +1 -1
  78. package/dist/tools/tasks-list-overdue.d.ts.map +1 -1
  79. package/dist/tools/tasks-list-overdue.js +7 -7
  80. package/dist/tools/tasks-organize-multiple.d.ts +4 -4
  81. package/dist/tools/tasks-organize-multiple.d.ts.map +1 -1
  82. package/dist/tools/tasks-organize-multiple.js +8 -23
  83. package/dist/tools/tasks-search.d.ts +1 -1
  84. package/dist/tools/tasks-search.d.ts.map +1 -1
  85. package/dist/tools/tasks-search.js +6 -6
  86. package/dist/tools/tasks-update-one.d.ts +3 -3
  87. package/dist/tools/tasks-update-one.d.ts.map +1 -1
  88. package/dist/tools/tasks-update-one.js +9 -21
  89. package/package.json +54 -58
  90. package/dist/tools/tasks-by-date-range.d.ts.map +0 -1
  91. package/dist/tools/tasks-by-project.d.ts.map +0 -1
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import { z } from 'zod';
2
2
  declare const sectionsUpdateOne: {
3
3
  name: string;
4
4
  description: string;
@@ -7,8 +7,8 @@ declare const sectionsUpdateOne: {
7
7
  name: z.ZodString;
8
8
  };
9
9
  execute(args: {
10
- name: string;
11
10
  id: string;
11
+ name: string;
12
12
  }, client: import("@doist/todoist-api-typescript").TodoistApi): Promise<import("@doist/todoist-api-typescript").Section>;
13
13
  };
14
14
  export { sectionsUpdateOne };
@@ -1 +1 @@
1
- {"version":3,"file":"sections-update-one.d.ts","sourceRoot":"","sources":["../../src/tools/sections-update-one.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,QAAA,MAAM,iBAAiB;;;;;;;;;;;CASmB,CAAC;AAE3C,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
1
+ {"version":3,"file":"sections-update-one.d.ts","sourceRoot":"","sources":["../../src/tools/sections-update-one.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAQvB,QAAA,MAAM,iBAAiB;;;;;;;;;;;CASmB,CAAA;AAE1C,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.sectionsUpdateOne = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const ArgsSchema = {
6
- id: zod_1.z.string().min(1).describe("The ID of the section to update."),
7
- name: zod_1.z.string().min(1).describe("The new name for the section."),
6
+ id: zod_1.z.string().min(1).describe('The ID of the section to update.'),
7
+ name: zod_1.z.string().min(1).describe('The new name for the section.'),
8
8
  };
9
9
  const sectionsUpdateOne = {
10
- name: "sections-update-one",
10
+ name: 'sections-update-one',
11
11
  description: "Update a section's name by its ID.",
12
12
  parameters: ArgsSchema,
13
13
  async execute(args, client) {
@@ -1,4 +1,7 @@
1
- import { type Project, type Task, type TodoistApi } from "@doist/todoist-api-typescript";
1
+ import { type PersonalProject, type Task, type TodoistApi, type WorkspaceProject } from '@doist/todoist-api-typescript';
2
+ export type Project = PersonalProject | WorkspaceProject;
3
+ export declare function isPersonalProject(project: Project): project is PersonalProject;
4
+ export declare function isWorkspaceProject(project: Project): project is WorkspaceProject;
2
5
  /**
3
6
  * Map a single Todoist task to a more structured format, for LLM consumption.
4
7
  * @param task - The task to map.
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/tools/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,OAAO,EACZ,KAAK,IAAI,EACT,KAAK,UAAU,EAEf,MAAM,+BAA+B,CAAC;AAGvC;;;;GAIG;AACH,iBAAS,OAAO,CAAC,IAAI,EAAE,IAAI;;;;;;;;;;;EAc1B;AAED;;;;GAIG;AACH,iBAAS,UAAU,CAAC,OAAO,EAAE,OAAO;;;;;;;;;EAWnC;AAWD,iBAAe,gBAAgB,CAAC,EAC/B,MAAM,EACN,KAAK,EACL,KAAK,EACL,MAAM,GACN,EAAE;IACF,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B;;;;;;;;;;;;;;GAyBA;AAED,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/tools/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,eAAe,EACpB,KAAK,IAAI,EACT,KAAK,UAAU,EACf,KAAK,gBAAgB,EAExB,MAAM,+BAA+B,CAAA;AAGtC,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;;;;GAIG;AACH,iBAAS,OAAO,CAAC,IAAI,EAAE,IAAI;;;;;;;;;;;EAa1B;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"}
@@ -3,11 +3,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.isPersonalProject = isPersonalProject;
7
+ exports.isWorkspaceProject = isWorkspaceProject;
6
8
  exports.getTasksByFilter = getTasksByFilter;
7
9
  exports.mapTask = mapTask;
8
10
  exports.mapProject = mapProject;
9
11
  const todoist_api_typescript_1 = require("@doist/todoist-api-typescript");
10
12
  const zod_1 = __importDefault(require("zod"));
13
+ function isPersonalProject(project) {
14
+ return 'inboxProject' in project;
15
+ }
16
+ function isWorkspaceProject(project) {
17
+ return 'accessLevel' in project;
18
+ }
11
19
  /**
12
20
  * Map a single Todoist task to a more structured format, for LLM consumption.
13
21
  * @param task - The task to map.
@@ -39,8 +47,8 @@ function mapProject(project) {
39
47
  color: project.color,
40
48
  isFavorite: project.isFavorite,
41
49
  isShared: project.isShared,
42
- parentId: project.parentId ?? null,
43
- inboxProject: project.isInboxProject ?? false,
50
+ parentId: isPersonalProject(project) ? (project.parentId ?? null) : null,
51
+ inboxProject: isPersonalProject(project) ? (project.inboxProject ?? false) : false,
44
52
  viewStyle: project.viewStyle,
45
53
  };
46
54
  }
@@ -70,7 +78,7 @@ async function getTasksByFilter({ client, query, limit, cursor, }) {
70
78
  throw error;
71
79
  }
72
80
  const { responseData } = parsedError.data;
73
- if (responseData.errorTag === "INVALID_SEARCH_QUERY") {
81
+ if (responseData.errorTag === 'INVALID_SEARCH_QUERY') {
74
82
  throw new Error(`Invalid filter query: ${query}`);
75
83
  }
76
84
  throw new Error(`${responseData.error} (tag: ${responseData.errorTag}, code: ${responseData.errorCode})`);
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=shared.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.test.d.ts","sourceRoot":"","sources":["../../src/tools/shared.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,135 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const shared_1 = require("./shared");
4
+ describe('shared utilities', () => {
5
+ describe('mapTask', () => {
6
+ it('should map a basic task correctly', () => {
7
+ const mockTask = {
8
+ id: '123',
9
+ content: 'Test task',
10
+ description: 'Test description',
11
+ projectId: 'proj-1',
12
+ sectionId: null,
13
+ parentId: null,
14
+ labels: ['work'],
15
+ priority: 1,
16
+ due: {
17
+ date: '2024-01-15',
18
+ isRecurring: false,
19
+ datetime: '2024-01-15T10:00:00Z',
20
+ string: 'Jan 15',
21
+ timezone: 'UTC',
22
+ },
23
+ };
24
+ const result = (0, shared_1.mapTask)(mockTask);
25
+ expect(result).toEqual({
26
+ id: '123',
27
+ content: 'Test task',
28
+ description: 'Test description',
29
+ dueDate: '2024-01-15',
30
+ recurring: false,
31
+ priority: 1,
32
+ projectId: 'proj-1',
33
+ sectionId: null,
34
+ parentId: null,
35
+ labels: ['work'],
36
+ });
37
+ });
38
+ it('should handle recurring tasks', () => {
39
+ const mockTask = {
40
+ id: '456',
41
+ content: 'Recurring task',
42
+ description: '',
43
+ projectId: 'proj-1',
44
+ sectionId: null,
45
+ parentId: null,
46
+ labels: [],
47
+ priority: 1,
48
+ due: {
49
+ date: '2024-01-15',
50
+ isRecurring: true,
51
+ datetime: '2024-01-15T10:00:00Z',
52
+ string: 'every day',
53
+ timezone: 'UTC',
54
+ },
55
+ };
56
+ const result = (0, shared_1.mapTask)(mockTask);
57
+ expect(result.recurring).toBe('every day');
58
+ });
59
+ });
60
+ describe('mapProject', () => {
61
+ it('should map a personal project correctly', () => {
62
+ const mockPersonalProject = {
63
+ id: 'proj-1',
64
+ name: 'Personal Project',
65
+ color: 'blue',
66
+ isFavorite: false,
67
+ isShared: false,
68
+ parentId: null,
69
+ inboxProject: false,
70
+ viewStyle: 'list',
71
+ };
72
+ const result = (0, shared_1.mapProject)(mockPersonalProject);
73
+ expect(result).toEqual({
74
+ id: 'proj-1',
75
+ name: 'Personal Project',
76
+ color: 'blue',
77
+ isFavorite: false,
78
+ isShared: false,
79
+ parentId: null,
80
+ inboxProject: false,
81
+ viewStyle: 'list',
82
+ });
83
+ });
84
+ it('should map a workspace project correctly', () => {
85
+ const mockWorkspaceProject = {
86
+ id: 'proj-2',
87
+ name: 'Workspace Project',
88
+ color: 'red',
89
+ isFavorite: true,
90
+ isShared: true,
91
+ viewStyle: 'board',
92
+ };
93
+ const result = (0, shared_1.mapProject)(mockWorkspaceProject);
94
+ expect(result).toEqual({
95
+ id: 'proj-2',
96
+ name: 'Workspace Project',
97
+ color: 'red',
98
+ isFavorite: true,
99
+ isShared: true,
100
+ parentId: null,
101
+ inboxProject: false,
102
+ viewStyle: 'board',
103
+ });
104
+ });
105
+ });
106
+ describe('type guards', () => {
107
+ it('should correctly identify personal projects', () => {
108
+ const personalProject = {
109
+ id: 'proj-1',
110
+ name: 'Personal',
111
+ color: 'blue',
112
+ isFavorite: false,
113
+ isShared: false,
114
+ parentId: null,
115
+ inboxProject: true,
116
+ viewStyle: 'list',
117
+ };
118
+ expect((0, shared_1.isPersonalProject)(personalProject)).toBe(true);
119
+ expect((0, shared_1.isWorkspaceProject)(personalProject)).toBe(false);
120
+ });
121
+ it('should correctly identify workspace projects', () => {
122
+ const workspaceProject = {
123
+ id: 'proj-2',
124
+ name: 'Workspace',
125
+ color: 'red',
126
+ isFavorite: false,
127
+ isShared: true,
128
+ viewStyle: 'board',
129
+ accessLevel: 'admin',
130
+ };
131
+ expect((0, shared_1.isWorkspaceProject)(workspaceProject)).toBe(true);
132
+ expect((0, shared_1.isPersonalProject)(workspaceProject)).toBe(false);
133
+ });
134
+ });
135
+ });
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import { z } from 'zod';
2
2
  declare const subtasksListForParentTask: {
3
3
  name: string;
4
4
  description: string;
@@ -8,8 +8,8 @@ declare const subtasksListForParentTask: {
8
8
  cursor: z.ZodOptional<z.ZodString>;
9
9
  };
10
10
  execute(args: {
11
- limit: number;
12
11
  parentId: string;
12
+ limit: number;
13
13
  cursor?: string | undefined;
14
14
  }, client: import("@doist/todoist-api-typescript").TodoistApi): Promise<{
15
15
  tasks: {
@@ -1 +1 @@
1
- {"version":3,"file":"subtasks-list-for-parent-task.d.ts","sourceRoot":"","sources":["../../src/tools/subtasks-list-for-parent-task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAwBxB,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBW,CAAC;AAE3C,OAAO,EAAE,yBAAyB,EAAE,CAAC"}
1
+ {"version":3,"file":"subtasks-list-for-parent-task.d.ts","sourceRoot":"","sources":["../../src/tools/subtasks-list-for-parent-task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAmBvB,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBW,CAAA;AAE1C,OAAO,EAAE,yBAAyB,EAAE,CAAA"}
@@ -2,27 +2,24 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.subtasksListForParentTask = void 0;
4
4
  const zod_1 = require("zod");
5
- const shared_js_1 = require("./shared.js");
5
+ const shared_1 = require("./shared");
6
6
  const ArgsSchema = {
7
- parentId: zod_1.z
8
- .string()
9
- .min(1)
10
- .describe("The ID of the parent task to get subtasks for."),
7
+ parentId: zod_1.z.string().min(1).describe('The ID of the parent task to get subtasks 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("The maximum number of subtasks to return."),
14
+ .describe('The maximum number of subtasks to return.'),
18
15
  cursor: zod_1.z
19
16
  .string()
20
17
  .optional()
21
- .describe("The cursor to get the next page of subtasks (from previous call)."),
18
+ .describe('The cursor to get the next page of subtasks (from previous call).'),
22
19
  };
23
20
  const subtasksListForParentTask = {
24
- name: "subtasks-list-for-parent-task",
25
- description: "List subtasks for a given parent task.",
21
+ name: 'subtasks-list-for-parent-task',
22
+ description: 'List subtasks for a given parent task.',
26
23
  parameters: ArgsSchema,
27
24
  async execute(args, client) {
28
25
  const { parentId, limit, cursor } = args;
@@ -32,7 +29,7 @@ const subtasksListForParentTask = {
32
29
  cursor: cursor ?? null,
33
30
  });
34
31
  return {
35
- tasks: results.map(shared_js_1.mapTask),
32
+ tasks: results.map(shared_1.mapTask),
36
33
  nextCursor,
37
34
  };
38
35
  },
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import { z } from 'zod';
2
2
  declare const tasksAddMultiple: {
3
3
  name: string;
4
4
  description: string;
@@ -30,8 +30,8 @@ declare const tasksAddMultiple: {
30
30
  priority?: number | undefined;
31
31
  dueString?: string | undefined;
32
32
  }[];
33
- projectId?: string | undefined;
34
33
  parentId?: string | undefined;
34
+ projectId?: string | undefined;
35
35
  sectionId?: string | undefined;
36
36
  }, client: import("@doist/todoist-api-typescript").TodoistApi): Promise<{
37
37
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"tasks-add-multiple.d.ts","sourceRoot":"","sources":["../../src/tools/tasks-add-multiple.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoCxB,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAaoB,CAAC;AAE3C,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"tasks-add-multiple.d.ts","sourceRoot":"","sources":["../../src/tools/tasks-add-multiple.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAkBvB,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAaoB,CAAA;AAE1C,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
@@ -2,40 +2,22 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.tasksAddMultiple = void 0;
4
4
  const zod_1 = require("zod");
5
- const shared_js_1 = require("./shared.js");
5
+ const shared_1 = require("./shared");
6
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
10
- .number()
11
- .int()
12
- .min(1)
13
- .max(4)
14
- .optional()
15
- .describe("The priority of the task (1-4)."),
16
- dueString: zod_1.z
17
- .string()
18
- .optional()
19
- .describe("The due date for the task, in natural language."),
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.'),
20
11
  });
21
12
  const ArgsSchema = {
22
- projectId: zod_1.z
23
- .string()
24
- .optional()
25
- .describe("The project ID to add the tasks to."),
26
- sectionId: zod_1.z
27
- .string()
28
- .optional()
29
- .describe("The section ID to add the tasks to."),
30
- parentId: zod_1.z
31
- .string()
32
- .optional()
33
- .describe("The parent task ID (for subtasks)."),
34
- tasks: zod_1.z.array(TaskSchema).min(1).describe("The array of tasks to add."),
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.'),
35
17
  };
36
18
  const tasksAddMultiple = {
37
- name: "tasks-add-multiple",
38
- description: "Add one or more tasks to a project, section, or parent.",
19
+ name: 'tasks-add-multiple',
20
+ description: 'Add one or more tasks to a project, section, or parent.',
39
21
  parameters: ArgsSchema,
40
22
  async execute(args, client) {
41
23
  const { projectId, sectionId, parentId, tasks } = args;
@@ -44,7 +26,7 @@ const tasksAddMultiple = {
44
26
  const taskArgs = { ...task, projectId, sectionId, parentId };
45
27
  newTasks.push(await client.addTask(taskArgs));
46
28
  }
47
- return newTasks.map(shared_js_1.mapTask);
29
+ return newTasks.map(shared_1.mapTask);
48
30
  },
49
31
  };
50
32
  exports.tasksAddMultiple = tasksAddMultiple;
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import { z } from 'zod';
2
2
  declare const tasksCompleteMultiple: {
3
3
  name: string;
4
4
  description: string;
@@ -1 +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,CAAC;AAUxB,QAAA,MAAM,qBAAqB;;;;;;;;;;;;CAgBe,CAAC;AAE3C,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
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: "tasks-complete-multiple",
13
- description: "Complete one or more tasks by their IDs.",
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 "zod";
1
+ import { z } from 'zod';
2
2
  declare const tasksDeleteOne: {
3
3
  name: string;
4
4
  description: string;
@@ -1 +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,CAAC;AAOxB,QAAA,MAAM,cAAc;;;;;;;;;;;CAQsB,CAAC;AAE3C,OAAO,EAAE,cAAc,EAAE,CAAC"}
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("The ID of the task to delete."),
6
+ id: zod_1.z.string().min(1).describe('The ID of the task to delete.'),
7
7
  };
8
8
  const tasksDeleteOne = {
9
- name: "tasks-delete-one",
10
- description: "Delete a task by its ID.",
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 "zod";
1
+ import { z } from 'zod';
2
2
  declare const tasksListByDate: {
3
3
  name: string;
4
4
  description: string;
@@ -30,4 +30,4 @@ declare const tasksListByDate: {
30
30
  }>;
31
31
  };
32
32
  export { tasksListByDate };
33
- //# sourceMappingURL=tasks-by-date-range.d.ts.map
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 shared_js_1 = require("./shared.js");
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("The number of days to get the tasks for, starting from the start date."),
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("The maximum number of tasks to return."),
25
+ .describe('The maximum number of tasks to return.'),
26
26
  cursor: zod_1.z
27
27
  .string()
28
28
  .optional()
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)."),
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: "tasks-list-by-date",
33
- description: "Get tasks by date range.",
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 === "today"
37
- ? (0, date_fns_1.formatISO)(new Date(), { representation: "date" })
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: "date" });
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, shared_js_1.getTasksByFilter)({
42
+ return await (0, shared_1.getTasksByFilter)({
43
43
  client,
44
44
  query,
45
45
  cursor: args.cursor,
@@ -0,0 +1,43 @@
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
+ cursor?: string | undefined;
24
+ projectId?: string | undefined;
25
+ sectionId?: 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
+ }[];
39
+ nextCursor: string | null;
40
+ }>;
41
+ };
42
+ export { tasksListCompleted };
43
+ //# sourceMappingURL=tasks-list-completed.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tasksListCompleted = void 0;
4
+ const zod_1 = require("zod");
5
+ const shared_1 = require("./shared");
6
+ const ArgsSchema = {
7
+ getBy: zod_1.z
8
+ .enum(['completion', 'due'])
9
+ .default('completion')
10
+ .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).'),
11
+ since: zod_1.z
12
+ .string()
13
+ .date()
14
+ .regex(/^\d{4}-\d{2}-\d{2}$/)
15
+ .describe('The start date to get the tasks for. Format: YYYY-MM-DD.'),
16
+ until: zod_1.z
17
+ .string()
18
+ .date()
19
+ .regex(/^\d{4}-\d{2}-\d{2}$/)
20
+ .describe('The start date to get the tasks for. Format: YYYY-MM-DD.'),
21
+ workspaceId: zod_1.z.string().optional().describe('The ID of the workspace to get the tasks for.'),
22
+ projectId: zod_1.z.string().optional().describe('The ID of the project to get the tasks for.'),
23
+ sectionId: zod_1.z.string().optional().describe('The ID of the section to get the tasks for.'),
24
+ parentId: zod_1.z.string().optional().describe('The ID of the parent task to get the tasks for.'),
25
+ limit: zod_1.z
26
+ .number()
27
+ .int()
28
+ .min(1)
29
+ .max(200)
30
+ .default(50)
31
+ .describe('The maximum number of tasks to return. Default is 50, maximum is 200.'),
32
+ cursor: zod_1.z
33
+ .string()
34
+ .optional()
35
+ .describe('The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters).'),
36
+ };
37
+ const tasksListCompleted = {
38
+ name: 'tasks-list-completed',
39
+ description: 'Get completed tasks.',
40
+ parameters: ArgsSchema,
41
+ async execute(args, client) {
42
+ const { getBy, ...rest } = args;
43
+ const { items, nextCursor } = getBy === 'completion'
44
+ ? await client.getCompletedTasksByCompletionDate(rest)
45
+ : await client.getCompletedTasksByDueDate(rest);
46
+ return {
47
+ tasks: items.map(shared_1.mapTask),
48
+ nextCursor,
49
+ };
50
+ },
51
+ };
52
+ exports.tasksListCompleted = tasksListCompleted;
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import { z } from 'zod';
2
2
  declare const tasksListForProject: {
3
3
  name: string;
4
4
  description: string;
@@ -28,4 +28,4 @@ declare const tasksListForProject: {
28
28
  }>;
29
29
  };
30
30
  export { tasksListForProject };
31
- //# sourceMappingURL=tasks-by-project.d.ts.map
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"}