@doist/todoist-ai 4.14.4 → 4.14.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +4 -4
- package/dist/tool-helpers.d.ts +1 -8
- package/dist/tool-helpers.d.ts.map +1 -1
- package/dist/tool-helpers.js +1 -10
- package/dist/tools/__tests__/assignment-integration.test.js +14 -1
- package/dist/tools/__tests__/search.test.js +0 -2
- package/dist/tools/fetch.d.ts.map +1 -1
- package/dist/tools/fetch.js +4 -3
- package/dist/tools/search.d.ts.map +1 -1
- package/dist/tools/search.js +4 -3
- package/dist/tools/update-tasks.d.ts +4 -4
- package/dist/tools/update-tasks.d.ts.map +1 -1
- package/dist/tools/update-tasks.js +2 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -165,7 +165,7 @@ declare const tools: {
|
|
|
165
165
|
priority: import("zod").ZodOptional<import("zod").ZodEnum<["p1", "p2", "p3", "p4"]>>;
|
|
166
166
|
dueString: import("zod").ZodOptional<import("zod").ZodString>;
|
|
167
167
|
duration: import("zod").ZodOptional<import("zod").ZodString>;
|
|
168
|
-
responsibleUser: import("zod").ZodOptional<import("zod").
|
|
168
|
+
responsibleUser: import("zod").ZodOptional<import("zod").ZodString>;
|
|
169
169
|
labels: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
170
170
|
}, "strip", import("zod").ZodTypeAny, {
|
|
171
171
|
id: string;
|
|
@@ -178,7 +178,7 @@ declare const tools: {
|
|
|
178
178
|
duration?: string | undefined;
|
|
179
179
|
priority?: "p1" | "p2" | "p3" | "p4" | undefined;
|
|
180
180
|
dueString?: string | undefined;
|
|
181
|
-
responsibleUser?: string |
|
|
181
|
+
responsibleUser?: string | undefined;
|
|
182
182
|
order?: number | undefined;
|
|
183
183
|
}, {
|
|
184
184
|
id: string;
|
|
@@ -191,7 +191,7 @@ declare const tools: {
|
|
|
191
191
|
duration?: string | undefined;
|
|
192
192
|
priority?: "p1" | "p2" | "p3" | "p4" | undefined;
|
|
193
193
|
dueString?: string | undefined;
|
|
194
|
-
responsibleUser?: string |
|
|
194
|
+
responsibleUser?: string | undefined;
|
|
195
195
|
order?: number | undefined;
|
|
196
196
|
}>, "many">;
|
|
197
197
|
};
|
|
@@ -207,7 +207,7 @@ declare const tools: {
|
|
|
207
207
|
duration?: string | undefined;
|
|
208
208
|
priority?: "p1" | "p2" | "p3" | "p4" | undefined;
|
|
209
209
|
dueString?: string | undefined;
|
|
210
|
-
responsibleUser?: string |
|
|
210
|
+
responsibleUser?: string | undefined;
|
|
211
211
|
order?: number | undefined;
|
|
212
212
|
}[];
|
|
213
213
|
}, client: import("@doist/todoist-api-typescript").TodoistApi): Promise<{
|
package/dist/tool-helpers.d.ts
CHANGED
|
@@ -91,12 +91,5 @@ declare function getTasksByFilter({ client, query, limit, cursor, }: {
|
|
|
91
91
|
}[];
|
|
92
92
|
nextCursor: string | null;
|
|
93
93
|
}>;
|
|
94
|
-
|
|
95
|
-
* Build a Todoist URL for a task or project.
|
|
96
|
-
* @param type - The type of object ('task' or 'project')
|
|
97
|
-
* @param id - The ID of the object
|
|
98
|
-
* @returns The URL string
|
|
99
|
-
*/
|
|
100
|
-
declare function buildTodoistUrl(type: 'task' | 'project', id: string): string;
|
|
101
|
-
export { buildTodoistUrl, getTasksByFilter, mapActivityEvent, mapProject, mapTask };
|
|
94
|
+
export { getTasksByFilter, mapActivityEvent, mapProject, mapTask };
|
|
102
95
|
//# sourceMappingURL=tool-helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-helpers.d.ts","sourceRoot":"","sources":["../src/tool-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,aAAa,EACb,YAAY,EACZ,eAAe,EACf,IAAI,EACJ,UAAU,EACV,gBAAgB,EACnB,MAAM,+BAA+B,CAAA;AAKtC,OAAO,EACH,aAAa,EACb,+BAA+B,EAC/B,4BAA4B,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AA0B,EAC1B,KAAK,wBAAwB,EAC7B,sBAAsB,GACzB,MAAM,qBAAqB,CAAA;AAE5B,MAAM,MAAM,OAAO,GAAG,eAAe,GAAG,gBAAgB,CAAA;AAExD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,eAAe,CAE9E;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,gBAAgB,CAEhF;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAC9B,MAAM,EAAE,MAAM,EACd,SAAS,CAAC,EAAE,MAAM,EAClB,SAAS,CAAC,EAAE,MAAM,EAClB,QAAQ,CAAC,EAAE,MAAM,GAClB,YAAY,CAsBd;AAED;;;;GAIG;AACH,iBAAS,OAAO,CAAC,IAAI,EAAE,IAAI;;;;;;;;;;;;;;;;EAkB1B;AAED;;;;GAIG;AACH,iBAAS,UAAU,CAAC,OAAO,EAAE,OAAO;;;;;;;;;EAWnC;AAED;;;;GAIG;AACH,iBAAS,gBAAgB,CAAC,KAAK,EAAE,aAAa;;;;;;;;;;EAY7C;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;;;;;;;;;;;;;;;;;;;GAkBA;AAED,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,UAAU,EAAE,OAAO,EAAE,CAAA"}
|
package/dist/tool-helpers.js
CHANGED
|
@@ -121,13 +121,4 @@ async function getTasksByFilter({ client, query, limit, cursor, }) {
|
|
|
121
121
|
throw new Error(`${responseData.error} (tag: ${responseData.errorTag}, code: ${responseData.errorCode})`);
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
|
|
125
|
-
* Build a Todoist URL for a task or project.
|
|
126
|
-
* @param type - The type of object ('task' or 'project')
|
|
127
|
-
* @param id - The ID of the object
|
|
128
|
-
* @returns The URL string
|
|
129
|
-
*/
|
|
130
|
-
function buildTodoistUrl(type, id) {
|
|
131
|
-
return `https://app.todoist.com/app/${type}/${id}`;
|
|
132
|
-
}
|
|
133
|
-
export { buildTodoistUrl, getTasksByFilter, mapActivityEvent, mapProject, mapTask };
|
|
124
|
+
export { getTasksByFilter, mapActivityEvent, mapProject, mapTask };
|
|
@@ -176,7 +176,20 @@ describe('Assignment Integration Tests', () => {
|
|
|
176
176
|
}));
|
|
177
177
|
expect(extractTextContent(result)).toContain('Updated 1 task');
|
|
178
178
|
});
|
|
179
|
-
it('should unassign task when responsibleUser is
|
|
179
|
+
it('should unassign task when responsibleUser is "unassign"', async () => {
|
|
180
|
+
await updateTasks.execute({
|
|
181
|
+
tasks: [
|
|
182
|
+
{
|
|
183
|
+
id: 'task-123',
|
|
184
|
+
responsibleUser: 'unassign',
|
|
185
|
+
},
|
|
186
|
+
],
|
|
187
|
+
}, mockTodoistApi);
|
|
188
|
+
expect(mockTodoistApi.updateTask).toHaveBeenCalledWith('task-123', expect.objectContaining({
|
|
189
|
+
assigneeId: null,
|
|
190
|
+
}));
|
|
191
|
+
});
|
|
192
|
+
it('should unassign task when responsibleUser is null (backward compatibility)', async () => {
|
|
180
193
|
await updateTasks.execute({
|
|
181
194
|
tasks: [
|
|
182
195
|
{
|
|
@@ -4,10 +4,8 @@ import { createMappedTask, createMockApiResponse, createMockProject, TEST_IDS, }
|
|
|
4
4
|
import { ToolNames } from '../../utils/tool-names.js';
|
|
5
5
|
import { search } from '../search.js';
|
|
6
6
|
jest.mock('../../tool-helpers', () => {
|
|
7
|
-
const actual = jest.requireActual('../../tool-helpers');
|
|
8
7
|
return {
|
|
9
8
|
getTasksByFilter: jest.fn(),
|
|
10
|
-
buildTodoistUrl: actual.buildTodoistUrl,
|
|
11
9
|
};
|
|
12
10
|
});
|
|
13
11
|
const { SEARCH } = ToolNames;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/tools/fetch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/tools/fetch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAuBvB,KAAK,eAAe,GAAG;IACnB,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACzC,OAAO,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAED;;;;;GAKG;AACH,QAAA,MAAM,KAAK;;;;;;;;oEAKsB,OAAO,CAAC,eAAe,CAAC;CAwFf,CAAA;AAE1C,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
package/dist/tools/fetch.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { getProjectUrl, getTaskUrl } from '@doist/todoist-api-typescript';
|
|
1
2
|
import { z } from 'zod';
|
|
2
3
|
import { getErrorOutput } from '../mcp-helpers.js';
|
|
3
|
-
import {
|
|
4
|
+
import { mapProject, mapTask } from '../tool-helpers.js';
|
|
4
5
|
import { ToolNames } from '../utils/tool-names.js';
|
|
5
6
|
const ArgsSchema = {
|
|
6
7
|
id: z
|
|
@@ -46,7 +47,7 @@ const fetch = {
|
|
|
46
47
|
id: `task:${mappedTask.id}`,
|
|
47
48
|
title: mappedTask.content,
|
|
48
49
|
text: textParts.join(''),
|
|
49
|
-
url:
|
|
50
|
+
url: getTaskUrl(mappedTask.id),
|
|
50
51
|
metadata: {
|
|
51
52
|
priority: mappedTask.priority,
|
|
52
53
|
projectId: mappedTask.projectId,
|
|
@@ -77,7 +78,7 @@ const fetch = {
|
|
|
77
78
|
id: `project:${mappedProject.id}`,
|
|
78
79
|
title: mappedProject.name,
|
|
79
80
|
text: textParts.join(''),
|
|
80
|
-
url:
|
|
81
|
+
url: getProjectUrl(mappedProject.id),
|
|
81
82
|
metadata: {
|
|
82
83
|
color: mappedProject.color,
|
|
83
84
|
isFavorite: mappedProject.isFavorite,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAiBvB,KAAK,gBAAgB,GAAG;IACpB,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACzC,OAAO,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAED;;;;;GAKG;AACH,QAAA,MAAM,MAAM;;;;;;;;oEAKqB,OAAO,CAAC,gBAAgB,CAAC;CAmDhB,CAAA;AAE1C,OAAO,EAAE,MAAM,EAAE,CAAA"}
|
package/dist/tools/search.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { getProjectUrl, getTaskUrl } from '@doist/todoist-api-typescript';
|
|
1
2
|
import { z } from 'zod';
|
|
2
3
|
import { getErrorOutput } from '../mcp-helpers.js';
|
|
3
|
-
import {
|
|
4
|
+
import { getTasksByFilter } from '../tool-helpers.js';
|
|
4
5
|
import { ApiLimits } from '../utils/constants.js';
|
|
5
6
|
import { ToolNames } from '../utils/tool-names.js';
|
|
6
7
|
const ArgsSchema = {
|
|
@@ -40,7 +41,7 @@ const search = {
|
|
|
40
41
|
results.push({
|
|
41
42
|
id: `task:${task.id}`,
|
|
42
43
|
title: task.content,
|
|
43
|
-
url:
|
|
44
|
+
url: getTaskUrl(task.id),
|
|
44
45
|
});
|
|
45
46
|
}
|
|
46
47
|
// Add project results with composite IDs
|
|
@@ -48,7 +49,7 @@ const search = {
|
|
|
48
49
|
results.push({
|
|
49
50
|
id: `project:${project.id}`,
|
|
50
51
|
title: project.name,
|
|
51
|
-
url:
|
|
52
|
+
url: getProjectUrl(project.id),
|
|
52
53
|
});
|
|
53
54
|
}
|
|
54
55
|
// Return as JSON-encoded string in a text content item (OpenAI MCP spec)
|
|
@@ -14,7 +14,7 @@ declare const updateTasks: {
|
|
|
14
14
|
priority: z.ZodOptional<z.ZodEnum<["p1", "p2", "p3", "p4"]>>;
|
|
15
15
|
dueString: z.ZodOptional<z.ZodString>;
|
|
16
16
|
duration: z.ZodOptional<z.ZodString>;
|
|
17
|
-
responsibleUser: z.ZodOptional<z.
|
|
17
|
+
responsibleUser: z.ZodOptional<z.ZodString>;
|
|
18
18
|
labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
19
19
|
}, "strip", z.ZodTypeAny, {
|
|
20
20
|
id: string;
|
|
@@ -27,7 +27,7 @@ declare const updateTasks: {
|
|
|
27
27
|
duration?: string | undefined;
|
|
28
28
|
priority?: "p1" | "p2" | "p3" | "p4" | undefined;
|
|
29
29
|
dueString?: string | undefined;
|
|
30
|
-
responsibleUser?: string |
|
|
30
|
+
responsibleUser?: string | undefined;
|
|
31
31
|
order?: number | undefined;
|
|
32
32
|
}, {
|
|
33
33
|
id: string;
|
|
@@ -40,7 +40,7 @@ declare const updateTasks: {
|
|
|
40
40
|
duration?: string | undefined;
|
|
41
41
|
priority?: "p1" | "p2" | "p3" | "p4" | undefined;
|
|
42
42
|
dueString?: string | undefined;
|
|
43
|
-
responsibleUser?: string |
|
|
43
|
+
responsibleUser?: string | undefined;
|
|
44
44
|
order?: number | undefined;
|
|
45
45
|
}>, "many">;
|
|
46
46
|
};
|
|
@@ -56,7 +56,7 @@ declare const updateTasks: {
|
|
|
56
56
|
duration?: string | undefined;
|
|
57
57
|
priority?: "p1" | "p2" | "p3" | "p4" | undefined;
|
|
58
58
|
dueString?: string | undefined;
|
|
59
|
-
responsibleUser?: string |
|
|
59
|
+
responsibleUser?: string | undefined;
|
|
60
60
|
order?: number | undefined;
|
|
61
61
|
}[];
|
|
62
62
|
}, client: import("@doist/todoist-api-typescript").TodoistApi): Promise<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-tasks.d.ts","sourceRoot":"","sources":["../../src/tools/update-tasks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"update-tasks.d.ts","sourceRoot":"","sources":["../../src/tools/update-tasks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AA6DvB,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkHyB,CAAA;AAqC1C,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -32,9 +32,8 @@ const TasksUpdateSchema = z.object({
|
|
|
32
32
|
.describe('The duration of the task. Use format: "2h" (hours), "90m" (minutes), "2h30m" (combined), or "1.5h" (decimal hours). Max 24h.'),
|
|
33
33
|
responsibleUser: z
|
|
34
34
|
.string()
|
|
35
|
-
.nullable()
|
|
36
35
|
.optional()
|
|
37
|
-
.describe('Change task assignment. Use
|
|
36
|
+
.describe('Change task assignment. Use "unassign" to remove assignment. Can be user ID, name, or email. User must be a project collaborator.'),
|
|
38
37
|
labels: z
|
|
39
38
|
.array(z.string())
|
|
40
39
|
.optional()
|
|
@@ -81,7 +80,7 @@ const updateTasks = {
|
|
|
81
80
|
}
|
|
82
81
|
// Handle assignment changes if provided
|
|
83
82
|
if (responsibleUser !== undefined) {
|
|
84
|
-
if (responsibleUser === null) {
|
|
83
|
+
if (responsibleUser === null || responsibleUser === 'unassign') {
|
|
85
84
|
// Unassign task - no validation needed
|
|
86
85
|
updateArgs = { ...updateArgs, assigneeId: null };
|
|
87
86
|
}
|