@doist/todoist-ai 0.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.
- package/LICENSE.txt +21 -0
- package/README.md +93 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +23 -0
- package/dist/mcp-helpers.d.ts +13 -0
- package/dist/mcp-helpers.d.ts.map +1 -0
- package/dist/mcp-helpers.js +52 -0
- package/dist/mcp-server.d.ts +11 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mcp-server.js +66 -0
- package/dist/todoist-tool.d.ts +35 -0
- package/dist/todoist-tool.d.ts.map +1 -0
- package/dist/todoist-tool.js +1 -0
- package/dist/tools/account-overview.d.ts +9 -0
- package/dist/tools/account-overview.d.ts.map +1 -0
- package/dist/tools/account-overview.js +94 -0
- package/dist/tools/index.d.ts +23 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +22 -0
- package/dist/tools/project-overview.d.ts +14 -0
- package/dist/tools/project-overview.d.ts.map +1 -0
- package/dist/tools/project-overview.js +107 -0
- package/dist/tools/projects-add-one.d.ts +22 -0
- package/dist/tools/projects-add-one.d.ts.map +1 -0
- package/dist/tools/projects-add-one.js +15 -0
- package/dist/tools/projects-delete-one.d.ts +15 -0
- package/dist/tools/projects-delete-one.d.ts.map +1 -0
- package/dist/tools/projects-delete-one.js +14 -0
- package/dist/tools/projects-list.d.ts +18 -0
- package/dist/tools/projects-list.d.ts.map +1 -0
- package/dist/tools/projects-list.js +30 -0
- package/dist/tools/projects-search.d.ts +29 -0
- package/dist/tools/projects-search.d.ts.map +1 -0
- package/dist/tools/projects-search.js +39 -0
- package/dist/tools/projects-update-one.d.ts +15 -0
- package/dist/tools/projects-update-one.d.ts.map +1 -0
- package/dist/tools/projects-update-one.js +16 -0
- package/dist/tools/sections-add-one.d.ts +15 -0
- package/dist/tools/sections-add-one.d.ts.map +1 -0
- package/dist/tools/sections-add-one.js +21 -0
- package/dist/tools/sections-delete-one.d.ts +15 -0
- package/dist/tools/sections-delete-one.d.ts.map +1 -0
- package/dist/tools/sections-delete-one.js +14 -0
- package/dist/tools/sections-search.d.ts +18 -0
- package/dist/tools/sections-search.d.ts.map +1 -0
- package/dist/tools/sections-search.js +30 -0
- package/dist/tools/sections-update-one.d.ts +15 -0
- package/dist/tools/sections-update-one.d.ts.map +1 -0
- package/dist/tools/sections-update-one.js +16 -0
- package/dist/tools/shared.d.ts +55 -0
- package/dist/tools/shared.d.ts.map +1 -0
- package/dist/tools/shared.js +71 -0
- package/dist/tools/subtasks-list-for-parent-task.d.ts +31 -0
- package/dist/tools/subtasks-list-for-parent-task.d.ts.map +1 -0
- package/dist/tools/subtasks-list-for-parent-task.js +37 -0
- package/dist/tools/tasks-add-multiple.d.ts +50 -0
- package/dist/tools/tasks-add-multiple.d.ts.map +1 -0
- package/dist/tools/tasks-add-multiple.js +47 -0
- package/dist/tools/tasks-by-date-range.d.ts +33 -0
- package/dist/tools/tasks-by-date-range.d.ts.map +1 -0
- package/dist/tools/tasks-by-date-range.js +47 -0
- package/dist/tools/tasks-by-project.d.ts +31 -0
- package/dist/tools/tasks-by-project.d.ts.map +1 -0
- package/dist/tools/tasks-by-project.js +37 -0
- package/dist/tools/tasks-complete-multiple.d.ts +16 -0
- package/dist/tools/tasks-complete-multiple.d.ts.map +1 -0
- package/dist/tools/tasks-complete-multiple.js +26 -0
- package/dist/tools/tasks-delete-one.d.ts +15 -0
- package/dist/tools/tasks-delete-one.d.ts.map +1 -0
- package/dist/tools/tasks-delete-one.js +14 -0
- package/dist/tools/tasks-list-for-section.d.ts +31 -0
- package/dist/tools/tasks-list-for-section.d.ts.map +1 -0
- package/dist/tools/tasks-list-for-section.js +37 -0
- package/dist/tools/tasks-list-overdue.d.ts +29 -0
- package/dist/tools/tasks-list-overdue.d.ts.map +1 -0
- package/dist/tools/tasks-list-overdue.js +29 -0
- package/dist/tools/tasks-organize-multiple.d.ts +37 -0
- package/dist/tools/tasks-organize-multiple.d.ts.map +1 -0
- package/dist/tools/tasks-organize-multiple.js +40 -0
- package/dist/tools/tasks-search.d.ts +31 -0
- package/dist/tools/tasks-search.d.ts.map +1 -0
- package/dist/tools/tasks-search.js +30 -0
- package/dist/tools/tasks-update-one.d.ts +27 -0
- package/dist/tools/tasks-update-one.d.ts.map +1 -0
- package/dist/tools/tasks-update-one.js +42 -0
- package/package.json +60 -0
- package/src/index.ts +1 -0
- package/src/main.ts +26 -0
- package/src/mcp-helpers.ts +76 -0
- package/src/mcp-server.ts +79 -0
- package/src/todoist-tool.ts +42 -0
- package/src/tools/account-overview.ts +130 -0
- package/src/tools/index.ts +26 -0
- package/src/tools/project-overview.ts +130 -0
- package/src/tools/projects-add-one.ts +19 -0
- package/src/tools/projects-delete-one.ts +18 -0
- package/src/tools/projects-list.ts +36 -0
- package/src/tools/projects-search.ts +49 -0
- package/src/tools/projects-update-one.ts +20 -0
- package/src/tools/sections-add-one.ts +25 -0
- package/src/tools/sections-delete-one.ts +18 -0
- package/src/tools/sections-search.ts +39 -0
- package/src/tools/sections-update-one.ts +20 -0
- package/src/tools/shared.ts +94 -0
- package/src/tools/subtasks-list-for-parent-task.ts +43 -0
- package/src/tools/tasks-add-multiple.ts +53 -0
- package/src/tools/tasks-by-date-range.ts +58 -0
- package/src/tools/tasks-by-project.ts +43 -0
- package/src/tools/tasks-complete-multiple.ts +29 -0
- package/src/tools/tasks-delete-one.ts +18 -0
- package/src/tools/tasks-list-for-section.ts +43 -0
- package/src/tools/tasks-list-overdue.ts +35 -0
- package/src/tools/tasks-organize-multiple.ts +45 -0
- package/src/tools/tasks-search.ts +36 -0
- package/src/tools/tasks-update-one.ts +48 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
declare const projectsAddOne: {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
parameters: {
|
|
6
|
+
name: z.ZodString;
|
|
7
|
+
};
|
|
8
|
+
execute(args: {
|
|
9
|
+
name: string;
|
|
10
|
+
}, client: import("@doist/todoist-api-typescript").TodoistApi): Promise<{
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
color: string;
|
|
14
|
+
isFavorite: boolean;
|
|
15
|
+
isShared: boolean;
|
|
16
|
+
parentId: string | null;
|
|
17
|
+
inboxProject: boolean;
|
|
18
|
+
viewStyle: string;
|
|
19
|
+
}>;
|
|
20
|
+
};
|
|
21
|
+
export { projectsAddOne };
|
|
22
|
+
//# sourceMappingURL=projects-add-one.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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,CAAC;AAQxB,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;CAQsB,CAAC;AAE3C,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { mapProject } from "./shared.js";
|
|
3
|
+
const ArgsSchema = {
|
|
4
|
+
name: z.string().min(1).describe("The name of the project to add."),
|
|
5
|
+
};
|
|
6
|
+
const projectsAddOne = {
|
|
7
|
+
name: "projects-add-one",
|
|
8
|
+
description: "Add a new project.",
|
|
9
|
+
parameters: ArgsSchema,
|
|
10
|
+
async execute(args, client) {
|
|
11
|
+
const project = await client.addProject({ name: args.name });
|
|
12
|
+
return mapProject(project);
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
export { projectsAddOne };
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,CAAC;AAOxB,QAAA,MAAM,iBAAiB;;;;;;;;;;;CAQmB,CAAC;AAE3C,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const ArgsSchema = {
|
|
3
|
+
id: z.string().min(1).describe("The ID of the project to delete."),
|
|
4
|
+
};
|
|
5
|
+
const projectsDeleteOne = {
|
|
6
|
+
name: "projects-delete-one",
|
|
7
|
+
description: "Delete a project by its ID.",
|
|
8
|
+
parameters: ArgsSchema,
|
|
9
|
+
async execute(args, client) {
|
|
10
|
+
await client.deleteProject(args.id);
|
|
11
|
+
return { success: true };
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
export { projectsDeleteOne };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
declare const projectsList: {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
parameters: {
|
|
6
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
7
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
8
|
+
};
|
|
9
|
+
execute(args: {
|
|
10
|
+
limit: number;
|
|
11
|
+
cursor?: string | undefined;
|
|
12
|
+
}, client: import("@doist/todoist-api-typescript").TodoistApi): Promise<{
|
|
13
|
+
projects: import("@doist/todoist-api-typescript").Project[];
|
|
14
|
+
nextCursor: string | null;
|
|
15
|
+
}>;
|
|
16
|
+
};
|
|
17
|
+
export { projectsList };
|
|
18
|
+
//# sourceMappingURL=projects-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projects-list.d.ts","sourceRoot":"","sources":["../../src/tools/projects-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmBxB,QAAA,MAAM,YAAY;;;;;;;;;;;;;;CAcwB,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const ArgsSchema = {
|
|
3
|
+
limit: z
|
|
4
|
+
.number()
|
|
5
|
+
.int()
|
|
6
|
+
.min(1)
|
|
7
|
+
.max(100)
|
|
8
|
+
.default(50)
|
|
9
|
+
.describe("The maximum number of projects to return."),
|
|
10
|
+
cursor: z
|
|
11
|
+
.string()
|
|
12
|
+
.optional()
|
|
13
|
+
.describe("The cursor to get the next page of projects (cursor is obtained from the previous call to this tool, with the same parameters)."),
|
|
14
|
+
};
|
|
15
|
+
const projectsList = {
|
|
16
|
+
name: "projects-list",
|
|
17
|
+
description: "List all projects for the user.",
|
|
18
|
+
parameters: ArgsSchema,
|
|
19
|
+
async execute(args, client) {
|
|
20
|
+
const { results, nextCursor } = await client.getProjects({
|
|
21
|
+
limit: args.limit,
|
|
22
|
+
cursor: args.cursor ?? null,
|
|
23
|
+
});
|
|
24
|
+
return {
|
|
25
|
+
projects: results,
|
|
26
|
+
nextCursor,
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
export { projectsList };
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projects-search.d.ts","sourceRoot":"","sources":["../../src/tools/projects-search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA0BxB,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;CAoBsB,CAAC;AAE3C,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { mapProject } from "./shared.js";
|
|
3
|
+
const ArgsSchema = {
|
|
4
|
+
search: z
|
|
5
|
+
.string()
|
|
6
|
+
.optional()
|
|
7
|
+
.describe("Search for a project by name (partial and case insensitive match). If omitted, all projects are returned."),
|
|
8
|
+
limit: z
|
|
9
|
+
.number()
|
|
10
|
+
.int()
|
|
11
|
+
.min(1)
|
|
12
|
+
.max(100)
|
|
13
|
+
.default(50)
|
|
14
|
+
.describe("The maximum number of projects to return."),
|
|
15
|
+
cursor: z
|
|
16
|
+
.string()
|
|
17
|
+
.optional()
|
|
18
|
+
.describe("The cursor to get the next page of projects (cursor is obtained from the previous call to this tool, with the same parameters)."),
|
|
19
|
+
};
|
|
20
|
+
const projectsSearch = {
|
|
21
|
+
name: "projects-search",
|
|
22
|
+
description: "Search for projects by name or other criteria.",
|
|
23
|
+
parameters: ArgsSchema,
|
|
24
|
+
async execute(args, client) {
|
|
25
|
+
const { results, nextCursor } = await client.getProjects({
|
|
26
|
+
limit: args.limit,
|
|
27
|
+
cursor: args.cursor ?? null,
|
|
28
|
+
});
|
|
29
|
+
const searchLower = args.search ? args.search.toLowerCase() : undefined;
|
|
30
|
+
const filtered = searchLower
|
|
31
|
+
? results.filter((project) => project.name.toLowerCase().includes(searchLower))
|
|
32
|
+
: results;
|
|
33
|
+
return {
|
|
34
|
+
projects: filtered.map(mapProject),
|
|
35
|
+
nextCursor,
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
export { projectsSearch };
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
name: string;
|
|
11
|
+
id: string;
|
|
12
|
+
}, client: import("@doist/todoist-api-typescript").TodoistApi): Promise<import("@doist/todoist-api-typescript").Project>;
|
|
13
|
+
};
|
|
14
|
+
export { projectsUpdateOne };
|
|
15
|
+
//# sourceMappingURL=projects-update-one.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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,CAAC;AAQxB,QAAA,MAAM,iBAAiB;;;;;;;;;;;CASmB,CAAC;AAE3C,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const ArgsSchema = {
|
|
3
|
+
id: z.string().min(1).describe("The ID of the project to update."),
|
|
4
|
+
name: z.string().min(1).describe("The new name for the project."),
|
|
5
|
+
};
|
|
6
|
+
const projectsUpdateOne = {
|
|
7
|
+
name: "projects-update-one",
|
|
8
|
+
description: "Update a project's name by its ID.",
|
|
9
|
+
parameters: ArgsSchema,
|
|
10
|
+
async execute(args, client) {
|
|
11
|
+
const { id, name } = args;
|
|
12
|
+
const project = await client.updateProject(id, { name });
|
|
13
|
+
return project;
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
export { projectsUpdateOne };
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,CAAC;AAWxB,QAAA,MAAM,cAAc;;;;;;;;;;;CAWsB,CAAC;AAE3C,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const ArgsSchema = {
|
|
3
|
+
name: z.string().min(1).describe("The name of the section to add."),
|
|
4
|
+
projectId: z
|
|
5
|
+
.string()
|
|
6
|
+
.min(1)
|
|
7
|
+
.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
|
+
export { sectionsAddOne };
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,CAAC;AAOxB,QAAA,MAAM,iBAAiB;;;;;;;;;;;CAQmB,CAAC;AAE3C,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const ArgsSchema = {
|
|
3
|
+
id: z.string().min(1).describe("The ID of the section to delete."),
|
|
4
|
+
};
|
|
5
|
+
const sectionsDeleteOne = {
|
|
6
|
+
name: "sections-delete-one",
|
|
7
|
+
description: "Delete a section by its ID.",
|
|
8
|
+
parameters: ArgsSchema,
|
|
9
|
+
async execute(args, client) {
|
|
10
|
+
await client.deleteSection(args.id);
|
|
11
|
+
return { success: true };
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
export { sectionsDeleteOne };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
declare const sectionsSearch: {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
parameters: {
|
|
6
|
+
projectId: z.ZodString;
|
|
7
|
+
search: z.ZodOptional<z.ZodString>;
|
|
8
|
+
};
|
|
9
|
+
execute(args: {
|
|
10
|
+
projectId: string;
|
|
11
|
+
search?: string | undefined;
|
|
12
|
+
}, client: import("@doist/todoist-api-typescript").TodoistApi): Promise<{
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
}[]>;
|
|
16
|
+
};
|
|
17
|
+
export { sectionsSearch };
|
|
18
|
+
//# sourceMappingURL=sections-search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sections-search.d.ts","sourceRoot":"","sources":["../../src/tools/sections-search.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgBxB,QAAA,MAAM,cAAc;;;;;;;;;;;;;;CAmBsB,CAAC;AAE3C,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const ArgsSchema = {
|
|
3
|
+
projectId: z
|
|
4
|
+
.string()
|
|
5
|
+
.min(1)
|
|
6
|
+
.describe("The ID of the project to search sections in."),
|
|
7
|
+
search: z
|
|
8
|
+
.string()
|
|
9
|
+
.optional()
|
|
10
|
+
.describe("Search for a section by name (partial and case insensitive match). If omitted, all sections in the project are returned."),
|
|
11
|
+
};
|
|
12
|
+
const sectionsSearch = {
|
|
13
|
+
name: "sections-search",
|
|
14
|
+
description: "Search for sections by name or other criteria in a project.",
|
|
15
|
+
parameters: ArgsSchema,
|
|
16
|
+
async execute(args, client) {
|
|
17
|
+
const { results } = await client.getSections({
|
|
18
|
+
projectId: args.projectId,
|
|
19
|
+
});
|
|
20
|
+
const searchLower = args.search ? args.search.toLowerCase() : undefined;
|
|
21
|
+
const filtered = searchLower
|
|
22
|
+
? results.filter((section) => section.name.toLowerCase().includes(searchLower))
|
|
23
|
+
: results;
|
|
24
|
+
return filtered.map((section) => ({
|
|
25
|
+
id: section.id,
|
|
26
|
+
name: section.name,
|
|
27
|
+
}));
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
export { sectionsSearch };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
declare const sectionsUpdateOne: {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
parameters: {
|
|
6
|
+
id: z.ZodString;
|
|
7
|
+
name: z.ZodString;
|
|
8
|
+
};
|
|
9
|
+
execute(args: {
|
|
10
|
+
name: string;
|
|
11
|
+
id: string;
|
|
12
|
+
}, client: import("@doist/todoist-api-typescript").TodoistApi): Promise<import("@doist/todoist-api-typescript").Section>;
|
|
13
|
+
};
|
|
14
|
+
export { sectionsUpdateOne };
|
|
15
|
+
//# sourceMappingURL=sections-update-one.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const ArgsSchema = {
|
|
3
|
+
id: z.string().min(1).describe("The ID of the section to update."),
|
|
4
|
+
name: z.string().min(1).describe("The new name for the section."),
|
|
5
|
+
};
|
|
6
|
+
const sectionsUpdateOne = {
|
|
7
|
+
name: "sections-update-one",
|
|
8
|
+
description: "Update a section's name by its ID.",
|
|
9
|
+
parameters: ArgsSchema,
|
|
10
|
+
async execute(args, client) {
|
|
11
|
+
const { id, name } = args;
|
|
12
|
+
const section = await client.updateSection(id, { name });
|
|
13
|
+
return section;
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
export { sectionsUpdateOne };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type Project, type Task, type TodoistApi } from "@doist/todoist-api-typescript";
|
|
2
|
+
/**
|
|
3
|
+
* Map a single Todoist task to a more structured format, for LLM consumption.
|
|
4
|
+
* @param task - The task to map.
|
|
5
|
+
* @returns The mapped task.
|
|
6
|
+
*/
|
|
7
|
+
declare function mapTask(task: Task): {
|
|
8
|
+
id: string;
|
|
9
|
+
content: string;
|
|
10
|
+
description: string;
|
|
11
|
+
dueDate: string | undefined;
|
|
12
|
+
recurring: string | boolean;
|
|
13
|
+
priority: number;
|
|
14
|
+
projectId: string;
|
|
15
|
+
sectionId: string | null;
|
|
16
|
+
parentId: string | null;
|
|
17
|
+
labels: string[];
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Map a single Todoist project to a more structured format, for LLM consumption.
|
|
21
|
+
* @param project - The project to map.
|
|
22
|
+
* @returns The mapped project.
|
|
23
|
+
*/
|
|
24
|
+
declare function mapProject(project: Project): {
|
|
25
|
+
id: string;
|
|
26
|
+
name: string;
|
|
27
|
+
color: string;
|
|
28
|
+
isFavorite: boolean;
|
|
29
|
+
isShared: boolean;
|
|
30
|
+
parentId: string | null;
|
|
31
|
+
inboxProject: boolean;
|
|
32
|
+
viewStyle: string;
|
|
33
|
+
};
|
|
34
|
+
declare function getTasksByFilter({ client, query, limit, cursor, }: {
|
|
35
|
+
client: TodoistApi;
|
|
36
|
+
query: string;
|
|
37
|
+
limit: number | undefined;
|
|
38
|
+
cursor: string | undefined;
|
|
39
|
+
}): Promise<{
|
|
40
|
+
tasks: {
|
|
41
|
+
id: string;
|
|
42
|
+
content: string;
|
|
43
|
+
description: string;
|
|
44
|
+
dueDate: string | undefined;
|
|
45
|
+
recurring: string | boolean;
|
|
46
|
+
priority: number;
|
|
47
|
+
projectId: string;
|
|
48
|
+
sectionId: string | null;
|
|
49
|
+
parentId: string | null;
|
|
50
|
+
labels: string[];
|
|
51
|
+
}[];
|
|
52
|
+
nextCursor: string | null;
|
|
53
|
+
}>;
|
|
54
|
+
export { getTasksByFilter, mapTask, mapProject };
|
|
55
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { getSanitizedContent, } from "@doist/todoist-api-typescript";
|
|
2
|
+
import z from "zod";
|
|
3
|
+
/**
|
|
4
|
+
* Map a single Todoist task to a more structured format, for LLM consumption.
|
|
5
|
+
* @param task - The task to map.
|
|
6
|
+
* @returns The mapped task.
|
|
7
|
+
*/
|
|
8
|
+
function mapTask(task) {
|
|
9
|
+
return {
|
|
10
|
+
id: task.id,
|
|
11
|
+
content: getSanitizedContent(task.content),
|
|
12
|
+
description: getSanitizedContent(task.description),
|
|
13
|
+
dueDate: task.due?.date,
|
|
14
|
+
recurring: task.due?.isRecurring && task.due.string ? task.due.string : false,
|
|
15
|
+
priority: task.priority,
|
|
16
|
+
projectId: task.projectId,
|
|
17
|
+
sectionId: task.sectionId,
|
|
18
|
+
parentId: task.parentId,
|
|
19
|
+
labels: task.labels,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Map a single Todoist project to a more structured format, for LLM consumption.
|
|
24
|
+
* @param project - The project to map.
|
|
25
|
+
* @returns The mapped project.
|
|
26
|
+
*/
|
|
27
|
+
function mapProject(project) {
|
|
28
|
+
return {
|
|
29
|
+
id: project.id,
|
|
30
|
+
name: project.name,
|
|
31
|
+
color: project.color,
|
|
32
|
+
isFavorite: project.isFavorite,
|
|
33
|
+
isShared: project.isShared,
|
|
34
|
+
parentId: project.parentId ?? null,
|
|
35
|
+
inboxProject: project.isInboxProject ?? false,
|
|
36
|
+
viewStyle: project.viewStyle,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
const ErrorSchema = z.object({
|
|
40
|
+
httpStatusCode: z.number(),
|
|
41
|
+
responseData: z.object({
|
|
42
|
+
error: z.string(),
|
|
43
|
+
errorCode: z.number(),
|
|
44
|
+
errorTag: z.string(),
|
|
45
|
+
}),
|
|
46
|
+
});
|
|
47
|
+
async function getTasksByFilter({ client, query, limit, cursor, }) {
|
|
48
|
+
try {
|
|
49
|
+
const { results, nextCursor } = await client.getTasksByFilter({
|
|
50
|
+
query,
|
|
51
|
+
cursor,
|
|
52
|
+
limit,
|
|
53
|
+
});
|
|
54
|
+
return {
|
|
55
|
+
tasks: results.map(mapTask),
|
|
56
|
+
nextCursor,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
const parsedError = ErrorSchema.safeParse(error);
|
|
61
|
+
if (!parsedError.success) {
|
|
62
|
+
throw error;
|
|
63
|
+
}
|
|
64
|
+
const { responseData } = parsedError.data;
|
|
65
|
+
if (responseData.errorTag === "INVALID_SEARCH_QUERY") {
|
|
66
|
+
throw new Error(`Invalid filter query: ${query}`);
|
|
67
|
+
}
|
|
68
|
+
throw new Error(`${responseData.error} (tag: ${responseData.errorTag}, code: ${responseData.errorCode})`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
export { getTasksByFilter, mapTask, mapProject };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
declare const subtasksListForParentTask: {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
parameters: {
|
|
6
|
+
parentId: z.ZodString;
|
|
7
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
8
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
9
|
+
};
|
|
10
|
+
execute(args: {
|
|
11
|
+
limit: number;
|
|
12
|
+
parentId: 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
|
+
}[];
|
|
27
|
+
nextCursor: string | null;
|
|
28
|
+
}>;
|
|
29
|
+
};
|
|
30
|
+
export { subtasksListForParentTask };
|
|
31
|
+
//# sourceMappingURL=subtasks-list-for-parent-task.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { mapTask } from "./shared.js";
|
|
3
|
+
const ArgsSchema = {
|
|
4
|
+
parentId: z
|
|
5
|
+
.string()
|
|
6
|
+
.min(1)
|
|
7
|
+
.describe("The ID of the parent task to get subtasks for."),
|
|
8
|
+
limit: z
|
|
9
|
+
.number()
|
|
10
|
+
.int()
|
|
11
|
+
.min(1)
|
|
12
|
+
.max(50)
|
|
13
|
+
.default(10)
|
|
14
|
+
.describe("The maximum number of subtasks to return."),
|
|
15
|
+
cursor: z
|
|
16
|
+
.string()
|
|
17
|
+
.optional()
|
|
18
|
+
.describe("The cursor to get the next page of subtasks (from previous call)."),
|
|
19
|
+
};
|
|
20
|
+
const subtasksListForParentTask = {
|
|
21
|
+
name: "subtasks-list-for-parent-task",
|
|
22
|
+
description: "List subtasks for a given parent task.",
|
|
23
|
+
parameters: ArgsSchema,
|
|
24
|
+
async execute(args, client) {
|
|
25
|
+
const { parentId, limit, cursor } = args;
|
|
26
|
+
const { results, nextCursor } = await client.getTasks({
|
|
27
|
+
parentId,
|
|
28
|
+
limit,
|
|
29
|
+
cursor: cursor ?? null,
|
|
30
|
+
});
|
|
31
|
+
return {
|
|
32
|
+
tasks: results.map(mapTask),
|
|
33
|
+
nextCursor,
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
export { subtasksListForParentTask };
|