@doist/todoist-ai 1.0.0 → 2.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 (81) hide show
  1. package/README.md +1 -22
  2. package/dist/index.d.ts +61 -166
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +19 -43
  5. package/dist/mcp-helpers.d.ts +8 -1
  6. package/dist/mcp-helpers.d.ts.map +1 -1
  7. package/dist/mcp-helpers.js +1 -0
  8. package/dist/mcp-server.d.ts.map +1 -1
  9. package/dist/mcp-server.js +12 -28
  10. package/dist/{tools/shared.d.ts → tool-helpers.d.ts} +1 -1
  11. package/dist/tool-helpers.d.ts.map +1 -0
  12. package/dist/tool-helpers.test.d.ts +2 -0
  13. package/dist/tool-helpers.test.d.ts.map +1 -0
  14. package/dist/{tools/shared.test.js → tool-helpers.test.js} +9 -9
  15. package/dist/tools/{tasks-delete-one.d.ts → delete-one.d.ts} +5 -3
  16. package/dist/tools/delete-one.d.ts.map +1 -0
  17. package/dist/tools/delete-one.js +28 -0
  18. package/dist/tools/{project-overview.d.ts → overview.d.ts} +5 -5
  19. package/dist/tools/overview.d.ts.map +1 -0
  20. package/dist/tools/overview.js +205 -0
  21. package/dist/tools/projects-list.d.ts +12 -1
  22. package/dist/tools/projects-list.d.ts.map +1 -1
  23. package/dist/tools/projects-list.js +11 -2
  24. package/dist/tools/{projects-add-one.d.ts → projects-manage.d.ts} +6 -4
  25. package/dist/tools/projects-manage.d.ts.map +1 -0
  26. package/dist/tools/projects-manage.js +29 -0
  27. package/dist/tools/sections-manage.d.ts +23 -0
  28. package/dist/tools/sections-manage.d.ts.map +1 -0
  29. package/dist/tools/sections-manage.js +40 -0
  30. package/dist/tools/tasks-add-multiple.js +2 -2
  31. package/dist/tools/tasks-list-by-date.d.ts.map +1 -1
  32. package/dist/tools/tasks-list-by-date.js +18 -12
  33. package/dist/tools/{tasks-list-overdue.d.ts → tasks-list-completed.d.ts} +17 -3
  34. package/dist/tools/tasks-list-completed.d.ts.map +1 -0
  35. package/dist/tools/tasks-list-completed.js +52 -0
  36. package/dist/tools/{tasks-list-for-project.d.ts → tasks-list-for-container.d.ts} +7 -5
  37. package/dist/tools/tasks-list-for-container.d.ts.map +1 -0
  38. package/dist/tools/tasks-list-for-container.js +51 -0
  39. package/dist/tools/tasks-search.js +2 -2
  40. package/package.json +15 -4
  41. package/dist/tools/account-overview.d.ts +0 -9
  42. package/dist/tools/account-overview.d.ts.map +0 -1
  43. package/dist/tools/account-overview.js +0 -98
  44. package/dist/tools/project-overview.d.ts.map +0 -1
  45. package/dist/tools/project-overview.js +0 -107
  46. package/dist/tools/projects-add-one.d.ts.map +0 -1
  47. package/dist/tools/projects-add-one.js +0 -18
  48. package/dist/tools/projects-delete-one.d.ts +0 -15
  49. package/dist/tools/projects-delete-one.d.ts.map +0 -1
  50. package/dist/tools/projects-delete-one.js +0 -17
  51. package/dist/tools/projects-search.d.ts +0 -29
  52. package/dist/tools/projects-search.d.ts.map +0 -1
  53. package/dist/tools/projects-search.js +0 -42
  54. package/dist/tools/projects-update-one.d.ts +0 -15
  55. package/dist/tools/projects-update-one.d.ts.map +0 -1
  56. package/dist/tools/projects-update-one.js +0 -19
  57. package/dist/tools/sections-add-one.d.ts +0 -15
  58. package/dist/tools/sections-add-one.d.ts.map +0 -1
  59. package/dist/tools/sections-add-one.js +0 -21
  60. package/dist/tools/sections-delete-one.d.ts +0 -15
  61. package/dist/tools/sections-delete-one.d.ts.map +0 -1
  62. package/dist/tools/sections-delete-one.js +0 -17
  63. package/dist/tools/sections-update-one.d.ts +0 -15
  64. package/dist/tools/sections-update-one.d.ts.map +0 -1
  65. package/dist/tools/sections-update-one.js +0 -19
  66. package/dist/tools/shared.d.ts.map +0 -1
  67. package/dist/tools/shared.test.d.ts +0 -2
  68. package/dist/tools/shared.test.d.ts.map +0 -1
  69. package/dist/tools/subtasks-list-for-parent-task.d.ts +0 -31
  70. package/dist/tools/subtasks-list-for-parent-task.d.ts.map +0 -1
  71. package/dist/tools/subtasks-list-for-parent-task.js +0 -37
  72. package/dist/tools/tasks-delete-one.d.ts.map +0 -1
  73. package/dist/tools/tasks-delete-one.js +0 -17
  74. package/dist/tools/tasks-list-for-project.d.ts.map +0 -1
  75. package/dist/tools/tasks-list-for-project.js +0 -37
  76. package/dist/tools/tasks-list-for-section.d.ts +0 -31
  77. package/dist/tools/tasks-list-for-section.d.ts.map +0 -1
  78. package/dist/tools/tasks-list-for-section.js +0 -37
  79. package/dist/tools/tasks-list-overdue.d.ts.map +0 -1
  80. package/dist/tools/tasks-list-overdue.js +0 -32
  81. /package/dist/{tools/shared.js → tool-helpers.js} +0 -0
@@ -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 tool_helpers_1 = require("../tool-helpers");
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(tool_helpers_1.mapTask),
48
+ nextCursor,
49
+ };
50
+ },
51
+ };
52
+ exports.tasksListCompleted = tasksListCompleted;
@@ -1,15 +1,17 @@
1
1
  import { z } from 'zod';
2
- declare const tasksListForProject: {
2
+ declare const tasksListForContainer: {
3
3
  name: string;
4
4
  description: string;
5
5
  parameters: {
6
- projectId: z.ZodString;
6
+ type: z.ZodEnum<["project", "section", "parent"]>;
7
+ id: z.ZodString;
7
8
  limit: z.ZodDefault<z.ZodNumber>;
8
9
  cursor: z.ZodOptional<z.ZodString>;
9
10
  };
10
11
  execute(args: {
12
+ type: "project" | "section" | "parent";
13
+ id: string;
11
14
  limit: number;
12
- projectId: string;
13
15
  cursor?: string | undefined;
14
16
  }, client: import("@doist/todoist-api-typescript").TodoistApi): Promise<{
15
17
  tasks: {
@@ -27,5 +29,5 @@ declare const tasksListForProject: {
27
29
  nextCursor: string | null;
28
30
  }>;
29
31
  };
30
- export { tasksListForProject };
31
- //# sourceMappingURL=tasks-list-for-project.d.ts.map
32
+ export { tasksListForContainer };
33
+ //# sourceMappingURL=tasks-list-for-container.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tasksListForContainer = void 0;
4
+ const zod_1 = require("zod");
5
+ const tool_helpers_1 = require("../tool-helpers");
6
+ const ArgsSchema = {
7
+ type: zod_1.z
8
+ .enum(['project', 'section', 'parent'])
9
+ .describe('The type of container to get tasks for.'),
10
+ id: zod_1.z.string().min(1).describe('The ID of the container to get tasks for.'),
11
+ limit: zod_1.z
12
+ .number()
13
+ .int()
14
+ .min(1)
15
+ .max(50)
16
+ .default(10)
17
+ .describe('The maximum number of tasks to return.'),
18
+ cursor: zod_1.z
19
+ .string()
20
+ .optional()
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).'),
22
+ };
23
+ const tasksListForContainer = {
24
+ name: 'tasks-list-for-container',
25
+ description: 'Get tasks for a specific project, section, or parent task (subtasks).',
26
+ parameters: ArgsSchema,
27
+ async execute(args, client) {
28
+ const { type, id, limit, cursor } = args;
29
+ const taskParams = {
30
+ limit,
31
+ cursor: cursor ?? null,
32
+ };
33
+ switch (type) {
34
+ case 'project':
35
+ taskParams.projectId = id;
36
+ break;
37
+ case 'section':
38
+ taskParams.sectionId = id;
39
+ break;
40
+ case 'parent':
41
+ taskParams.parentId = id;
42
+ break;
43
+ }
44
+ const { results, nextCursor } = await client.getTasks(taskParams);
45
+ return {
46
+ tasks: results.map(tool_helpers_1.mapTask),
47
+ nextCursor,
48
+ };
49
+ },
50
+ };
51
+ exports.tasksListForContainer = tasksListForContainer;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.tasksSearch = void 0;
4
4
  const zod_1 = require("zod");
5
- const shared_1 = require("./shared");
5
+ const tool_helpers_1 = require("../tool-helpers");
6
6
  const ArgsSchema = {
7
7
  searchText: zod_1.z.string().min(1).describe('The text to search for in tasks.'),
8
8
  limit: zod_1.z
@@ -22,7 +22,7 @@ const tasksSearch = {
22
22
  description: "Search tasks by text using Todoist's filter query.",
23
23
  parameters: ArgsSchema,
24
24
  async execute(args, client) {
25
- return await (0, shared_1.getTasksByFilter)({
25
+ return await (0, tool_helpers_1.getTasksByFilter)({
26
26
  client,
27
27
  query: `search: ${args.searchText}`,
28
28
  cursor: args.cursor,
package/package.json CHANGED
@@ -1,16 +1,25 @@
1
1
  {
2
2
  "name": "@doist/todoist-ai",
3
- "version": "1.0.0",
3
+ "version": "2.0.0",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
- "files": ["dist", "package.json", "LICENSE.txt", "README.md"],
6
+ "files": [
7
+ "dist",
8
+ "package.json",
9
+ "LICENSE.txt",
10
+ "README.md"
11
+ ],
7
12
  "license": "MIT",
8
13
  "description": "A collection of tools for Todoist using AI",
9
14
  "repository": {
10
15
  "type": "git",
11
16
  "url": "https://github.com/Doist/todoist-ai"
12
17
  },
13
- "keywords": ["todoist", "ai", "tools"],
18
+ "keywords": [
19
+ "todoist",
20
+ "ai",
21
+ "tools"
22
+ ],
14
23
  "scripts": {
15
24
  "test": "jest",
16
25
  "build": "rimraf dist && npx tsc --project tsconfig.json",
@@ -51,6 +60,8 @@
51
60
  "typescript": "^5.8.3"
52
61
  },
53
62
  "lint-staged": {
54
- "*": ["biome check --write --no-errors-on-unmatched --files-ignore-unknown=true"]
63
+ "*": [
64
+ "biome check --write --no-errors-on-unmatched --files-ignore-unknown=true"
65
+ ]
55
66
  }
56
67
  }
@@ -1,9 +0,0 @@
1
- import type { TodoistApi } from '@doist/todoist-api-typescript';
2
- declare const accountOverview: {
3
- name: string;
4
- description: string;
5
- parameters: {};
6
- execute(_args: {}, client: TodoistApi): Promise<string>;
7
- };
8
- export { accountOverview };
9
- //# sourceMappingURL=account-overview.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"account-overview.d.ts","sourceRoot":"","sources":["../../src/tools/account-overview.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,UAAU,EAAE,MAAM,+BAA+B,CAAA;AA6ExE,QAAA,MAAM,eAAe;;;;;CAsCqB,CAAA;AAE1C,OAAO,EAAE,eAAe,EAAE,CAAA"}
@@ -1,98 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.accountOverview = void 0;
4
- const shared_1 = require("./shared");
5
- const ArgsSchema = {};
6
- function buildProjectTree(projects) {
7
- // Sort projects by childOrder, then build a tree
8
- const byId = {};
9
- for (const p of projects) {
10
- byId[p.id] = {
11
- ...p,
12
- children: [],
13
- childOrder: p.childOrder ?? 0,
14
- };
15
- }
16
- const roots = [];
17
- for (const p of projects) {
18
- const current = byId[p.id];
19
- if (!current)
20
- continue;
21
- if ((0, shared_1.isPersonalProject)(p) && p.parentId) {
22
- const parent = byId[p.parentId];
23
- if (parent) {
24
- parent.children.push(current);
25
- }
26
- else {
27
- roots.push(current);
28
- }
29
- }
30
- else {
31
- roots.push(current);
32
- }
33
- }
34
- function sortTree(nodes) {
35
- nodes.sort((a, b) => a.childOrder - b.childOrder);
36
- for (const n of nodes) {
37
- sortTree(n.children);
38
- }
39
- }
40
- sortTree(roots);
41
- return roots;
42
- }
43
- async function getSectionsByProject(client, projectIds) {
44
- const result = {};
45
- await Promise.all(projectIds.map(async (projectId) => {
46
- const { results } = await client.getSections({ projectId });
47
- result[projectId] = results;
48
- }));
49
- return result;
50
- }
51
- function renderProjectMarkdown(project, sectionsByProject, indent = '') {
52
- const lines = [];
53
- lines.push(`${indent}- Project: ${project.name} (id=${project.id})`);
54
- const sections = sectionsByProject[project.id] || [];
55
- for (const section of sections) {
56
- lines.push(`${indent} - Section: ${section.name} (id=${section.id})`);
57
- }
58
- for (const child of project.children) {
59
- lines.push(...renderProjectMarkdown(child, sectionsByProject, `${indent} `));
60
- }
61
- return lines;
62
- }
63
- const accountOverview = {
64
- name: 'account-overview',
65
- description: 'Get a Markdown overview of all projects (with hierarchy and sections) and the inbox project. Useful in almost any context before engaging with Todoist further.',
66
- parameters: ArgsSchema,
67
- async execute(_args, client) {
68
- const { results: projects } = await client.getProjects({});
69
- const inbox = projects.find((p) => (0, shared_1.isPersonalProject)(p) && p.inboxProject === true);
70
- const nonInbox = projects.filter((p) => !(0, shared_1.isPersonalProject)(p) || p.inboxProject !== true);
71
- const tree = buildProjectTree(nonInbox);
72
- const allProjectIds = projects.map((p) => p.id);
73
- const sectionsByProject = await getSectionsByProject(client, allProjectIds);
74
- const lines = ['# Personal Projects', ''];
75
- if (inbox) {
76
- lines.push(`- Inbox Project: ${inbox.name} (id=${inbox.id})`);
77
- for (const section of sectionsByProject[inbox.id] || []) {
78
- lines.push(` - Section: ${section.name} (id=${section.id})`);
79
- }
80
- }
81
- if (tree.length) {
82
- for (const project of tree) {
83
- lines.push(...renderProjectMarkdown(project, sectionsByProject));
84
- }
85
- }
86
- else {
87
- lines.push('_No projects found._');
88
- }
89
- lines.push('');
90
- // Add explanation about nesting if there are nested projects
91
- const hasNested = tree.some((p) => p.children.length > 0);
92
- if (hasNested) {
93
- lines.push('_Note: Indentation indicates that a project is a sub-project of the one above it. This allows for organizing projects hierarchically, with parent projects containing related sub-projects._', '');
94
- }
95
- return lines.join('\n');
96
- },
97
- };
98
- exports.accountOverview = accountOverview;
@@ -1 +0,0 @@
1
- {"version":3,"file":"project-overview.d.ts","sourceRoot":"","sources":["../../src/tools/project-overview.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,UAAU,EAAE,MAAM,+BAA+B,CAAA;AACxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAqEvB,QAAA,MAAM,eAAe;;;;;;;;;CA4CqB,CAAA;AAE1C,OAAO,EAAE,eAAe,EAAE,CAAA"}
@@ -1,107 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.projectOverview = void 0;
4
- const zod_1 = require("zod");
5
- const shared_1 = require("./shared");
6
- const ArgsSchema = {
7
- projectId: zod_1.z.string().min(1).describe('The ID of the project to get an overview for.'),
8
- };
9
- function buildTaskTree(tasks) {
10
- const byId = {};
11
- for (const task of tasks) {
12
- byId[task.id] = { ...task, children: [] };
13
- }
14
- const roots = [];
15
- for (const task of tasks) {
16
- const node = byId[task.id];
17
- if (!node)
18
- continue;
19
- if (!task.parentId) {
20
- roots.push(node);
21
- continue;
22
- }
23
- const parent = byId[task.parentId];
24
- if (parent) {
25
- parent.children.push(node);
26
- }
27
- else {
28
- roots.push(node);
29
- }
30
- }
31
- return roots;
32
- }
33
- function renderTaskTreeMarkdown(tasks, indent = '') {
34
- const lines = [];
35
- for (const task of tasks) {
36
- const idPart = `id=${task.id}`;
37
- const duePart = task.dueDate ? `; due=${task.dueDate}` : '';
38
- const contentPart = `; content=${task.content}`;
39
- lines.push(`${indent}- ${idPart}${duePart}${contentPart}`);
40
- if (task.children.length > 0) {
41
- lines.push(...renderTaskTreeMarkdown(task.children, `${indent} `));
42
- }
43
- }
44
- return lines;
45
- }
46
- async function getAllTasksForProject(client, projectId) {
47
- let allTasks = [];
48
- let cursor = undefined;
49
- do {
50
- const { results, nextCursor } = await client.getTasks({
51
- projectId,
52
- limit: 50,
53
- cursor: cursor ?? undefined,
54
- });
55
- allTasks = allTasks.concat(results.map(shared_1.mapTask));
56
- cursor = nextCursor ?? undefined;
57
- } while (cursor);
58
- return allTasks;
59
- }
60
- async function getProjectSections(client, projectId) {
61
- const { results } = await client.getSections({ projectId });
62
- return results;
63
- }
64
- const projectOverview = {
65
- name: 'project-overview',
66
- description: "Get a Markdown overview of a single project, including its sections and all tasks. Tasks are grouped by section, with tasks not in any section listed first. Each task is listed as '- id=TASKID; due=YYYY-MM-DD; content=TASK CONTENT' (omit due if not present). Subtasks are nested as indented list items.",
67
- parameters: ArgsSchema,
68
- async execute(args, client) {
69
- const { projectId } = args;
70
- const project = await client.getProject(projectId);
71
- const sections = await getProjectSections(client, projectId);
72
- const allTasks = await getAllTasksForProject(client, projectId);
73
- // Group tasks by sectionId
74
- const tasksBySection = {};
75
- for (const section of sections) {
76
- tasksBySection[section.id] = [];
77
- }
78
- const tasksWithoutSection = [];
79
- for (const task of allTasks) {
80
- if (task.sectionId && tasksBySection[task.sectionId]) {
81
- // biome-ignore lint/style/noNonNullAssertion: the "if" above ensures that it is defined
82
- tasksBySection[task.sectionId].push(task);
83
- }
84
- else {
85
- tasksWithoutSection.push(task);
86
- }
87
- }
88
- const lines = [`# ${project.name}`];
89
- if (tasksWithoutSection.length > 0) {
90
- lines.push('');
91
- const tree = buildTaskTree(tasksWithoutSection);
92
- lines.push(...renderTaskTreeMarkdown(tree));
93
- }
94
- for (const section of sections) {
95
- lines.push('');
96
- lines.push(`## ${section.name}`);
97
- const sectionTasks = tasksBySection[section.id];
98
- if (!sectionTasks?.length) {
99
- continue;
100
- }
101
- const tree = buildTaskTree(sectionTasks);
102
- lines.push(...renderTaskTreeMarkdown(tree));
103
- }
104
- return lines.join('\n');
105
- },
106
- };
107
- exports.projectOverview = projectOverview;
@@ -1 +0,0 @@
1
- {"version":3,"file":"projects-add-one.d.ts","sourceRoot":"","sources":["../../src/tools/projects-add-one.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAQvB,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;CAQsB,CAAA;AAE1C,OAAO,EAAE,cAAc,EAAE,CAAA"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.projectsAddOne = void 0;
4
- const zod_1 = require("zod");
5
- const shared_1 = require("./shared");
6
- const ArgsSchema = {
7
- name: zod_1.z.string().min(1).describe('The name of the project to add.'),
8
- };
9
- const projectsAddOne = {
10
- name: 'projects-add-one',
11
- description: 'Add a new project.',
12
- parameters: ArgsSchema,
13
- async execute(args, client) {
14
- const project = await client.addProject({ name: args.name });
15
- return (0, shared_1.mapProject)(project);
16
- },
17
- };
18
- exports.projectsAddOne = projectsAddOne;
@@ -1,15 +0,0 @@
1
- import { z } from 'zod';
2
- declare const projectsDeleteOne: {
3
- name: string;
4
- description: string;
5
- parameters: {
6
- id: z.ZodString;
7
- };
8
- execute(args: {
9
- id: string;
10
- }, client: import("@doist/todoist-api-typescript").TodoistApi): Promise<{
11
- success: boolean;
12
- }>;
13
- };
14
- export { projectsDeleteOne };
15
- //# sourceMappingURL=projects-delete-one.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"projects-delete-one.d.ts","sourceRoot":"","sources":["../../src/tools/projects-delete-one.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAOvB,QAAA,MAAM,iBAAiB;;;;;;;;;;;CAQmB,CAAA;AAE1C,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.projectsDeleteOne = void 0;
4
- const zod_1 = require("zod");
5
- const ArgsSchema = {
6
- id: zod_1.z.string().min(1).describe('The ID of the project to delete.'),
7
- };
8
- const projectsDeleteOne = {
9
- name: 'projects-delete-one',
10
- description: 'Delete a project by its ID.',
11
- parameters: ArgsSchema,
12
- async execute(args, client) {
13
- await client.deleteProject(args.id);
14
- return { success: true };
15
- },
16
- };
17
- exports.projectsDeleteOne = projectsDeleteOne;
@@ -1,29 +0,0 @@
1
- import { z } from 'zod';
2
- declare const projectsSearch: {
3
- name: string;
4
- description: string;
5
- parameters: {
6
- search: z.ZodOptional<z.ZodString>;
7
- limit: z.ZodDefault<z.ZodNumber>;
8
- cursor: z.ZodOptional<z.ZodString>;
9
- };
10
- execute(args: {
11
- limit: number;
12
- cursor?: string | undefined;
13
- search?: string | undefined;
14
- }, client: import("@doist/todoist-api-typescript").TodoistApi): Promise<{
15
- projects: {
16
- id: string;
17
- name: string;
18
- color: string;
19
- isFavorite: boolean;
20
- isShared: boolean;
21
- parentId: string | null;
22
- inboxProject: boolean;
23
- viewStyle: string;
24
- }[];
25
- nextCursor: string | null;
26
- }>;
27
- };
28
- export { projectsSearch };
29
- //# sourceMappingURL=projects-search.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"projects-search.d.ts","sourceRoot":"","sources":["../../src/tools/projects-search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AA0BvB,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;CAkBsB,CAAA;AAE1C,OAAO,EAAE,cAAc,EAAE,CAAA"}
@@ -1,42 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.projectsSearch = void 0;
4
- const zod_1 = require("zod");
5
- const shared_1 = require("./shared");
6
- const ArgsSchema = {
7
- search: zod_1.z
8
- .string()
9
- .optional()
10
- .describe('Search for a project by name (partial and case insensitive match). If omitted, all projects are returned.'),
11
- limit: zod_1.z
12
- .number()
13
- .int()
14
- .min(1)
15
- .max(100)
16
- .default(50)
17
- .describe('The maximum number of projects to return.'),
18
- cursor: zod_1.z
19
- .string()
20
- .optional()
21
- .describe('The cursor to get the next page of projects (cursor is obtained from the previous call to this tool, with the same parameters).'),
22
- };
23
- const projectsSearch = {
24
- name: 'projects-search',
25
- description: 'Search for projects by name or other criteria.',
26
- parameters: ArgsSchema,
27
- async execute(args, client) {
28
- const { results, nextCursor } = await client.getProjects({
29
- limit: args.limit,
30
- cursor: args.cursor ?? null,
31
- });
32
- const searchLower = args.search ? args.search.toLowerCase() : undefined;
33
- const filtered = searchLower
34
- ? results.filter((project) => project.name.toLowerCase().includes(searchLower))
35
- : results;
36
- return {
37
- projects: filtered.map(shared_1.mapProject),
38
- nextCursor,
39
- };
40
- },
41
- };
42
- exports.projectsSearch = projectsSearch;
@@ -1,15 +0,0 @@
1
- import { z } from 'zod';
2
- declare const projectsUpdateOne: {
3
- name: string;
4
- description: string;
5
- parameters: {
6
- id: z.ZodString;
7
- name: z.ZodString;
8
- };
9
- execute(args: {
10
- id: string;
11
- name: string;
12
- }, client: import("@doist/todoist-api-typescript").TodoistApi): Promise<import("@doist/todoist-api-typescript").PersonalProject | import("@doist/todoist-api-typescript").WorkspaceProject>;
13
- };
14
- export { projectsUpdateOne };
15
- //# sourceMappingURL=projects-update-one.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"projects-update-one.d.ts","sourceRoot":"","sources":["../../src/tools/projects-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"}
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.projectsUpdateOne = void 0;
4
- const zod_1 = require("zod");
5
- const ArgsSchema = {
6
- id: zod_1.z.string().min(1).describe('The ID of the project to update.'),
7
- name: zod_1.z.string().min(1).describe('The new name for the project.'),
8
- };
9
- const projectsUpdateOne = {
10
- name: 'projects-update-one',
11
- description: "Update a project's name by its ID.",
12
- parameters: ArgsSchema,
13
- async execute(args, client) {
14
- const { id, name } = args;
15
- const project = await client.updateProject(id, { name });
16
- return project;
17
- },
18
- };
19
- exports.projectsUpdateOne = projectsUpdateOne;
@@ -1,15 +0,0 @@
1
- import { z } from 'zod';
2
- declare const sectionsAddOne: {
3
- name: string;
4
- description: string;
5
- parameters: {
6
- name: z.ZodString;
7
- projectId: z.ZodString;
8
- };
9
- execute(args: {
10
- name: string;
11
- projectId: string;
12
- }, client: import("@doist/todoist-api-typescript").TodoistApi): Promise<import("@doist/todoist-api-typescript").Section>;
13
- };
14
- export { sectionsAddOne };
15
- //# sourceMappingURL=sections-add-one.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sections-add-one.d.ts","sourceRoot":"","sources":["../../src/tools/sections-add-one.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAQvB,QAAA,MAAM,cAAc;;;;;;;;;;;CAWsB,CAAA;AAE1C,OAAO,EAAE,cAAc,EAAE,CAAA"}
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sectionsAddOne = void 0;
4
- const zod_1 = require("zod");
5
- const ArgsSchema = {
6
- name: zod_1.z.string().min(1).describe('The name of the section to add.'),
7
- projectId: zod_1.z.string().min(1).describe('The ID of the project to add the section to.'),
8
- };
9
- const sectionsAddOne = {
10
- name: 'sections-add-one',
11
- description: 'Add a new section to a project.',
12
- parameters: ArgsSchema,
13
- async execute(args, client) {
14
- const section = await client.addSection({
15
- name: args.name,
16
- projectId: args.projectId,
17
- });
18
- return section;
19
- },
20
- };
21
- exports.sectionsAddOne = sectionsAddOne;
@@ -1,15 +0,0 @@
1
- import { z } from 'zod';
2
- declare const sectionsDeleteOne: {
3
- name: string;
4
- description: string;
5
- parameters: {
6
- id: z.ZodString;
7
- };
8
- execute(args: {
9
- id: string;
10
- }, client: import("@doist/todoist-api-typescript").TodoistApi): Promise<{
11
- success: boolean;
12
- }>;
13
- };
14
- export { sectionsDeleteOne };
15
- //# sourceMappingURL=sections-delete-one.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sections-delete-one.d.ts","sourceRoot":"","sources":["../../src/tools/sections-delete-one.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAOvB,QAAA,MAAM,iBAAiB;;;;;;;;;;;CAQmB,CAAA;AAE1C,OAAO,EAAE,iBAAiB,EAAE,CAAA"}