@doist/todoist-ai 5.2.0 → 6.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/README.md +6 -0
- package/dist/index.d.ts +272 -901
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/main.js +1 -1
- package/dist/mcp-helpers.d.ts +7 -1
- package/dist/mcp-helpers.d.ts.map +1 -1
- package/dist/mcp-server-BhXFK7dP.js +3220 -0
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/todoist-tool.d.ts +6 -0
- package/dist/todoist-tool.d.ts.map +1 -1
- package/dist/tools/add-comments.d.ts +9 -82
- package/dist/tools/add-comments.d.ts.map +1 -1
- package/dist/tools/add-projects.d.ts +11 -73
- package/dist/tools/add-projects.d.ts.map +1 -1
- package/dist/tools/add-sections.d.ts +2 -14
- package/dist/tools/add-sections.d.ts.map +1 -1
- package/dist/tools/add-tasks.d.ts +24 -76
- package/dist/tools/add-tasks.d.ts.map +1 -1
- package/dist/tools/complete-tasks.d.ts +3 -11
- package/dist/tools/complete-tasks.d.ts.map +1 -1
- package/dist/tools/delete-object.d.ts +15 -11
- package/dist/tools/delete-object.d.ts.map +1 -1
- package/dist/tools/fetch.d.ts.map +1 -1
- package/dist/tools/find-activity.d.ts +25 -31
- package/dist/tools/find-activity.d.ts.map +1 -1
- package/dist/tools/find-comments.d.ts +9 -74
- package/dist/tools/find-comments.d.ts.map +1 -1
- package/dist/tools/find-completed-tasks.d.ts +28 -53
- package/dist/tools/find-completed-tasks.d.ts.map +1 -1
- package/dist/tools/find-project-collaborators.d.ts +2 -18
- package/dist/tools/find-project-collaborators.d.ts.map +1 -1
- package/dist/tools/find-projects.d.ts +3 -21
- package/dist/tools/find-projects.d.ts.map +1 -1
- package/dist/tools/find-sections.d.ts +1 -7
- package/dist/tools/find-sections.d.ts.map +1 -1
- package/dist/tools/find-tasks-by-date.d.ts +34 -54
- package/dist/tools/find-tasks-by-date.d.ts.map +1 -1
- package/dist/tools/find-tasks-by-date.resource.d.ts +28 -0
- package/dist/tools/find-tasks-by-date.resource.d.ts.map +1 -0
- package/dist/tools/find-tasks.d.ts +31 -55
- package/dist/tools/find-tasks.d.ts.map +1 -1
- package/dist/tools/get-overview.d.ts +8 -15
- package/dist/tools/get-overview.d.ts.map +1 -1
- package/dist/tools/manage-assignments.d.ts +9 -27
- package/dist/tools/manage-assignments.d.ts.map +1 -1
- package/dist/tools/search.d.ts +1 -9
- package/dist/tools/search.d.ts.map +1 -1
- package/dist/tools/update-comments.d.ts +10 -85
- package/dist/tools/update-comments.d.ts.map +1 -1
- package/dist/tools/update-projects.d.ts +12 -80
- package/dist/tools/update-projects.d.ts.map +1 -1
- package/dist/tools/update-sections.d.ts +4 -16
- package/dist/tools/update-sections.d.ts.map +1 -1
- package/dist/tools/update-tasks.d.ts +25 -87
- package/dist/tools/update-tasks.d.ts.map +1 -1
- package/dist/tools/user-info.d.ts +6 -2
- package/dist/tools/user-info.d.ts.map +1 -1
- package/dist/utils/labels.d.ts +5 -2
- package/dist/utils/labels.d.ts.map +1 -1
- package/dist/utils/output-schemas.d.ts +20 -176
- package/dist/utils/output-schemas.d.ts.map +1 -1
- package/dist/utils/priorities.d.ts +6 -1
- package/dist/utils/priorities.d.ts.map +1 -1
- package/dist/utils/widget-loader.d.ts +7 -0
- package/dist/utils/widget-loader.d.ts.map +1 -0
- package/package.json +21 -11
- package/scripts/inline-widget-builder.ts +87 -0
- package/scripts/inline-widgets-vite-plugin.ts +134 -0
- package/scripts/validate-schemas.ts +66 -65
- package/dist/mcp-server-D0ROki3I.js +0 -3171
|
@@ -11,44 +11,19 @@ declare const updateTasks: {
|
|
|
11
11
|
sectionId: z.ZodOptional<z.ZodString>;
|
|
12
12
|
parentId: z.ZodOptional<z.ZodString>;
|
|
13
13
|
order: z.ZodOptional<z.ZodNumber>;
|
|
14
|
-
priority: z.ZodOptional<z.ZodEnum<
|
|
14
|
+
priority: z.ZodOptional<z.ZodEnum<{
|
|
15
|
+
p1: "p1";
|
|
16
|
+
p2: "p2";
|
|
17
|
+
p3: "p3";
|
|
18
|
+
p4: "p4";
|
|
19
|
+
}>>;
|
|
15
20
|
dueString: z.ZodOptional<z.ZodString>;
|
|
16
21
|
deadlineDate: z.ZodOptional<z.ZodString>;
|
|
17
22
|
duration: z.ZodOptional<z.ZodString>;
|
|
18
23
|
responsibleUser: z.ZodOptional<z.ZodString>;
|
|
19
|
-
labels: z.ZodOptional<z.ZodArray<z.ZodString
|
|
24
|
+
labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
20
25
|
isUncompletable: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
-
},
|
|
22
|
-
id: string;
|
|
23
|
-
content?: string | undefined;
|
|
24
|
-
description?: string | undefined;
|
|
25
|
-
parentId?: string | undefined;
|
|
26
|
-
projectId?: string | undefined;
|
|
27
|
-
sectionId?: string | undefined;
|
|
28
|
-
labels?: string[] | undefined;
|
|
29
|
-
duration?: string | undefined;
|
|
30
|
-
priority?: "p1" | "p2" | "p3" | "p4" | undefined;
|
|
31
|
-
isUncompletable?: boolean | undefined;
|
|
32
|
-
deadlineDate?: string | undefined;
|
|
33
|
-
dueString?: string | undefined;
|
|
34
|
-
responsibleUser?: string | undefined;
|
|
35
|
-
order?: number | undefined;
|
|
36
|
-
}, {
|
|
37
|
-
id: string;
|
|
38
|
-
content?: string | undefined;
|
|
39
|
-
description?: string | undefined;
|
|
40
|
-
parentId?: string | undefined;
|
|
41
|
-
projectId?: string | undefined;
|
|
42
|
-
sectionId?: string | undefined;
|
|
43
|
-
labels?: string[] | undefined;
|
|
44
|
-
duration?: string | undefined;
|
|
45
|
-
priority?: "p1" | "p2" | "p3" | "p4" | undefined;
|
|
46
|
-
isUncompletable?: boolean | undefined;
|
|
47
|
-
deadlineDate?: string | undefined;
|
|
48
|
-
dueString?: string | undefined;
|
|
49
|
-
responsibleUser?: string | undefined;
|
|
50
|
-
order?: number | undefined;
|
|
51
|
-
}>, "many">;
|
|
26
|
+
}, z.core.$strip>>;
|
|
52
27
|
};
|
|
53
28
|
outputSchema: {
|
|
54
29
|
tasks: z.ZodArray<z.ZodObject<{
|
|
@@ -56,68 +31,31 @@ declare const updateTasks: {
|
|
|
56
31
|
content: z.ZodString;
|
|
57
32
|
description: z.ZodString;
|
|
58
33
|
dueDate: z.ZodOptional<z.ZodString>;
|
|
59
|
-
recurring: z.ZodUnion<[z.ZodBoolean, z.ZodString]>;
|
|
34
|
+
recurring: z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>;
|
|
60
35
|
deadlineDate: z.ZodOptional<z.ZodString>;
|
|
61
|
-
priority: z.ZodEnum<
|
|
36
|
+
priority: z.ZodEnum<{
|
|
37
|
+
p1: "p1";
|
|
38
|
+
p2: "p2";
|
|
39
|
+
p3: "p3";
|
|
40
|
+
p4: "p4";
|
|
41
|
+
}>;
|
|
62
42
|
projectId: z.ZodString;
|
|
63
43
|
sectionId: z.ZodOptional<z.ZodString>;
|
|
64
44
|
parentId: z.ZodOptional<z.ZodString>;
|
|
65
|
-
labels: z.ZodOptional<z.ZodArray<z.ZodString
|
|
45
|
+
labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
66
46
|
duration: z.ZodOptional<z.ZodString>;
|
|
67
47
|
responsibleUid: z.ZodOptional<z.ZodString>;
|
|
68
48
|
isUncompletable: z.ZodOptional<z.ZodBoolean>;
|
|
69
49
|
assignedByUid: z.ZodOptional<z.ZodString>;
|
|
70
50
|
checked: z.ZodBoolean;
|
|
71
51
|
completedAt: z.ZodOptional<z.ZodString>;
|
|
72
|
-
},
|
|
73
|
-
content: string;
|
|
74
|
-
description: string;
|
|
75
|
-
id: string;
|
|
76
|
-
projectId: string;
|
|
77
|
-
checked: boolean;
|
|
78
|
-
priority: "p1" | "p2" | "p3" | "p4";
|
|
79
|
-
recurring: string | boolean;
|
|
80
|
-
parentId?: string | undefined;
|
|
81
|
-
sectionId?: string | undefined;
|
|
82
|
-
assignedByUid?: string | undefined;
|
|
83
|
-
responsibleUid?: string | undefined;
|
|
84
|
-
labels?: string[] | undefined;
|
|
85
|
-
duration?: string | undefined;
|
|
86
|
-
completedAt?: string | undefined;
|
|
87
|
-
isUncompletable?: boolean | undefined;
|
|
88
|
-
dueDate?: string | undefined;
|
|
89
|
-
deadlineDate?: string | undefined;
|
|
90
|
-
}, {
|
|
91
|
-
content: string;
|
|
92
|
-
description: string;
|
|
93
|
-
id: string;
|
|
94
|
-
projectId: string;
|
|
95
|
-
checked: boolean;
|
|
96
|
-
priority: "p1" | "p2" | "p3" | "p4";
|
|
97
|
-
recurring: string | boolean;
|
|
98
|
-
parentId?: string | undefined;
|
|
99
|
-
sectionId?: string | undefined;
|
|
100
|
-
assignedByUid?: string | undefined;
|
|
101
|
-
responsibleUid?: string | undefined;
|
|
102
|
-
labels?: string[] | undefined;
|
|
103
|
-
duration?: string | undefined;
|
|
104
|
-
completedAt?: string | undefined;
|
|
105
|
-
isUncompletable?: boolean | undefined;
|
|
106
|
-
dueDate?: string | undefined;
|
|
107
|
-
deadlineDate?: string | undefined;
|
|
108
|
-
}>, "many">;
|
|
52
|
+
}, z.core.$strip>>;
|
|
109
53
|
totalCount: z.ZodNumber;
|
|
110
|
-
updatedTaskIds: z.ZodArray<z.ZodString
|
|
54
|
+
updatedTaskIds: z.ZodArray<z.ZodString>;
|
|
111
55
|
appliedOperations: z.ZodObject<{
|
|
112
56
|
updateCount: z.ZodNumber;
|
|
113
57
|
skippedCount: z.ZodNumber;
|
|
114
|
-
},
|
|
115
|
-
updateCount: number;
|
|
116
|
-
skippedCount: number;
|
|
117
|
-
}, {
|
|
118
|
-
updateCount: number;
|
|
119
|
-
skippedCount: number;
|
|
120
|
-
}>;
|
|
58
|
+
}, z.core.$strip>;
|
|
121
59
|
};
|
|
122
60
|
mutability: "mutating";
|
|
123
61
|
execute(args: {
|
|
@@ -125,17 +63,17 @@ declare const updateTasks: {
|
|
|
125
63
|
id: string;
|
|
126
64
|
content?: string | undefined;
|
|
127
65
|
description?: string | undefined;
|
|
128
|
-
parentId?: string | undefined;
|
|
129
66
|
projectId?: string | undefined;
|
|
130
67
|
sectionId?: string | undefined;
|
|
131
|
-
|
|
132
|
-
|
|
68
|
+
parentId?: string | undefined;
|
|
69
|
+
order?: number | undefined;
|
|
133
70
|
priority?: "p1" | "p2" | "p3" | "p4" | undefined;
|
|
134
|
-
isUncompletable?: boolean | undefined;
|
|
135
|
-
deadlineDate?: string | undefined;
|
|
136
71
|
dueString?: string | undefined;
|
|
72
|
+
deadlineDate?: string | undefined;
|
|
73
|
+
duration?: string | undefined;
|
|
137
74
|
responsibleUser?: string | undefined;
|
|
138
|
-
|
|
75
|
+
labels?: string[] | undefined;
|
|
76
|
+
isUncompletable?: boolean | undefined;
|
|
139
77
|
}[];
|
|
140
78
|
}, client: import('@doist/todoist-api-typescript').TodoistApi): Promise<{
|
|
141
79
|
textContent: string;
|
|
@@ -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;AAwFvB,QAAA,MAAM,WAAW
|
|
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;AAwFvB,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuI8C,CAAA;AA4B/D,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -37,10 +37,14 @@ declare const userInfo: {
|
|
|
37
37
|
dailyGoal: z.ZodNumber;
|
|
38
38
|
weeklyGoal: z.ZodNumber;
|
|
39
39
|
email: z.ZodString;
|
|
40
|
-
plan: z.ZodEnum<
|
|
40
|
+
plan: z.ZodEnum<{
|
|
41
|
+
"Todoist Free": "Todoist Free";
|
|
42
|
+
"Todoist Pro": "Todoist Pro";
|
|
43
|
+
"Todoist Business": "Todoist Business";
|
|
44
|
+
}>;
|
|
41
45
|
};
|
|
42
46
|
mutability: "readonly";
|
|
43
|
-
execute(_args:
|
|
47
|
+
execute(_args: Record<string, never>, client: TodoistApi): Promise<{
|
|
44
48
|
textContent: string;
|
|
45
49
|
structuredContent: UserInfoStructured;
|
|
46
50
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-info.d.ts","sourceRoot":"","sources":["../../src/tools/user-info.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAwBvB,KAAK,QAAQ,GAAG,cAAc,GAAG,aAAa,GAAG,kBAAkB,CAAA;AAEnE,KAAK,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAChD,IAAI,EAAE,WAAW,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,gBAAgB,EAAE,MAAM,CAAA;IACxB,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,MAAM,CAAA;IACnB,iBAAiB,EAAE,MAAM,CAAA;IACzB,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,QAAQ,CAAA;CACjB,CAAA;AAoJD,QAAA,MAAM,QAAQ
|
|
1
|
+
{"version":3,"file":"user-info.d.ts","sourceRoot":"","sources":["../../src/tools/user-info.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAwBvB,KAAK,QAAQ,GAAG,cAAc,GAAG,aAAa,GAAG,kBAAkB,CAAA;AAEnE,KAAK,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAChD,IAAI,EAAE,WAAW,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,gBAAgB,EAAE,MAAM,CAAA;IACxB,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,MAAM,CAAA;IACnB,iBAAiB,EAAE,MAAM,CAAA;IACzB,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,QAAQ,CAAA;CACjB,CAAA;AAoJD,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAeiD,CAAA;AAE/D,OAAO,EAAE,QAAQ,EAAE,KAAK,kBAAkB,EAAE,CAAA"}
|
package/dist/utils/labels.d.ts
CHANGED
|
@@ -2,8 +2,11 @@ import { z } from 'zod';
|
|
|
2
2
|
declare const LABELS_OPERATORS: readonly ["and", "or"];
|
|
3
3
|
type LabelsOperator = (typeof LABELS_OPERATORS)[number];
|
|
4
4
|
export declare const LabelsSchema: {
|
|
5
|
-
labels: z.ZodOptional<z.ZodArray<z.ZodString
|
|
6
|
-
labelsOperator: z.ZodOptional<z.ZodEnum<
|
|
5
|
+
labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
6
|
+
labelsOperator: z.ZodOptional<z.ZodEnum<{
|
|
7
|
+
and: "and";
|
|
8
|
+
or: "or";
|
|
9
|
+
}>>;
|
|
7
10
|
};
|
|
8
11
|
export declare function generateLabelsFilter(labels?: string[], labelsOperator?: LabelsOperator): string;
|
|
9
12
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"labels.d.ts","sourceRoot":"","sources":["../../src/utils/labels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,QAAA,MAAM,gBAAgB,wBAAyB,CAAA;AAC/C,KAAK,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEvD,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"labels.d.ts","sourceRoot":"","sources":["../../src/utils/labels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,QAAA,MAAM,gBAAgB,wBAAyB,CAAA;AAC/C,KAAK,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEvD,eAAO,MAAM,YAAY;;;;;;CAQxB,CAAA;AAED,wBAAgB,oBAAoB,CAAC,MAAM,GAAE,MAAM,EAAO,EAAE,cAAc,GAAE,cAAqB,UAOhG"}
|
|
@@ -7,56 +7,25 @@ declare const TaskSchema: z.ZodObject<{
|
|
|
7
7
|
content: z.ZodString;
|
|
8
8
|
description: z.ZodString;
|
|
9
9
|
dueDate: z.ZodOptional<z.ZodString>;
|
|
10
|
-
recurring: z.ZodUnion<[z.ZodBoolean, z.ZodString]>;
|
|
10
|
+
recurring: z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>;
|
|
11
11
|
deadlineDate: z.ZodOptional<z.ZodString>;
|
|
12
|
-
priority: z.ZodEnum<
|
|
12
|
+
priority: z.ZodEnum<{
|
|
13
|
+
p1: "p1";
|
|
14
|
+
p2: "p2";
|
|
15
|
+
p3: "p3";
|
|
16
|
+
p4: "p4";
|
|
17
|
+
}>;
|
|
13
18
|
projectId: z.ZodString;
|
|
14
19
|
sectionId: z.ZodOptional<z.ZodString>;
|
|
15
20
|
parentId: z.ZodOptional<z.ZodString>;
|
|
16
|
-
labels: z.ZodOptional<z.ZodArray<z.ZodString
|
|
21
|
+
labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
17
22
|
duration: z.ZodOptional<z.ZodString>;
|
|
18
23
|
responsibleUid: z.ZodOptional<z.ZodString>;
|
|
19
24
|
isUncompletable: z.ZodOptional<z.ZodBoolean>;
|
|
20
25
|
assignedByUid: z.ZodOptional<z.ZodString>;
|
|
21
26
|
checked: z.ZodBoolean;
|
|
22
27
|
completedAt: z.ZodOptional<z.ZodString>;
|
|
23
|
-
},
|
|
24
|
-
content: string;
|
|
25
|
-
description: string;
|
|
26
|
-
id: string;
|
|
27
|
-
projectId: string;
|
|
28
|
-
checked: boolean;
|
|
29
|
-
priority: "p1" | "p2" | "p3" | "p4";
|
|
30
|
-
recurring: string | boolean;
|
|
31
|
-
parentId?: string | undefined;
|
|
32
|
-
sectionId?: string | undefined;
|
|
33
|
-
assignedByUid?: string | undefined;
|
|
34
|
-
responsibleUid?: string | undefined;
|
|
35
|
-
labels?: string[] | undefined;
|
|
36
|
-
duration?: string | undefined;
|
|
37
|
-
completedAt?: string | undefined;
|
|
38
|
-
isUncompletable?: boolean | undefined;
|
|
39
|
-
dueDate?: string | undefined;
|
|
40
|
-
deadlineDate?: string | undefined;
|
|
41
|
-
}, {
|
|
42
|
-
content: string;
|
|
43
|
-
description: string;
|
|
44
|
-
id: string;
|
|
45
|
-
projectId: string;
|
|
46
|
-
checked: boolean;
|
|
47
|
-
priority: "p1" | "p2" | "p3" | "p4";
|
|
48
|
-
recurring: string | boolean;
|
|
49
|
-
parentId?: string | undefined;
|
|
50
|
-
sectionId?: string | undefined;
|
|
51
|
-
assignedByUid?: string | undefined;
|
|
52
|
-
responsibleUid?: string | undefined;
|
|
53
|
-
labels?: string[] | undefined;
|
|
54
|
-
duration?: string | undefined;
|
|
55
|
-
completedAt?: string | undefined;
|
|
56
|
-
isUncompletable?: boolean | undefined;
|
|
57
|
-
dueDate?: string | undefined;
|
|
58
|
-
deadlineDate?: string | undefined;
|
|
59
|
-
}>;
|
|
28
|
+
}, z.core.$strip>;
|
|
60
29
|
/**
|
|
61
30
|
* Schema for a mapped project object returned by tools
|
|
62
31
|
*/
|
|
@@ -69,38 +38,14 @@ declare const ProjectSchema: z.ZodObject<{
|
|
|
69
38
|
parentId: z.ZodOptional<z.ZodString>;
|
|
70
39
|
inboxProject: z.ZodBoolean;
|
|
71
40
|
viewStyle: z.ZodString;
|
|
72
|
-
},
|
|
73
|
-
name: string;
|
|
74
|
-
id: string;
|
|
75
|
-
color: string;
|
|
76
|
-
isFavorite: boolean;
|
|
77
|
-
viewStyle: string;
|
|
78
|
-
isShared: boolean;
|
|
79
|
-
inboxProject: boolean;
|
|
80
|
-
parentId?: string | undefined;
|
|
81
|
-
}, {
|
|
82
|
-
name: string;
|
|
83
|
-
id: string;
|
|
84
|
-
color: string;
|
|
85
|
-
isFavorite: boolean;
|
|
86
|
-
viewStyle: string;
|
|
87
|
-
isShared: boolean;
|
|
88
|
-
inboxProject: boolean;
|
|
89
|
-
parentId?: string | undefined;
|
|
90
|
-
}>;
|
|
41
|
+
}, z.core.$strip>;
|
|
91
42
|
/**
|
|
92
43
|
* Schema for a section object returned by tools
|
|
93
44
|
*/
|
|
94
45
|
declare const SectionSchema: z.ZodObject<{
|
|
95
46
|
id: z.ZodString;
|
|
96
47
|
name: z.ZodString;
|
|
97
|
-
},
|
|
98
|
-
name: string;
|
|
99
|
-
id: string;
|
|
100
|
-
}, {
|
|
101
|
-
name: string;
|
|
102
|
-
id: string;
|
|
103
|
-
}>;
|
|
48
|
+
}, z.core.$strip>;
|
|
104
49
|
/**
|
|
105
50
|
* Schema for a comment object returned by tools
|
|
106
51
|
*/
|
|
@@ -118,82 +63,17 @@ declare const CommentSchema: z.ZodObject<{
|
|
|
118
63
|
fileType: z.ZodOptional<z.ZodString>;
|
|
119
64
|
fileUrl: z.ZodOptional<z.ZodString>;
|
|
120
65
|
fileDuration: z.ZodOptional<z.ZodNumber>;
|
|
121
|
-
uploadState: z.ZodOptional<z.ZodEnum<
|
|
66
|
+
uploadState: z.ZodOptional<z.ZodEnum<{
|
|
67
|
+
pending: "pending";
|
|
68
|
+
completed: "completed";
|
|
69
|
+
}>>;
|
|
122
70
|
url: z.ZodOptional<z.ZodString>;
|
|
123
71
|
title: z.ZodOptional<z.ZodString>;
|
|
124
72
|
image: z.ZodOptional<z.ZodString>;
|
|
125
73
|
imageWidth: z.ZodOptional<z.ZodNumber>;
|
|
126
74
|
imageHeight: z.ZodOptional<z.ZodNumber>;
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
title?: string | undefined;
|
|
130
|
-
fileName?: string | undefined;
|
|
131
|
-
fileSize?: number | undefined;
|
|
132
|
-
fileType?: string | undefined;
|
|
133
|
-
fileUrl?: string | undefined;
|
|
134
|
-
fileDuration?: number | undefined;
|
|
135
|
-
uploadState?: "pending" | "completed" | undefined;
|
|
136
|
-
image?: string | undefined;
|
|
137
|
-
imageWidth?: number | undefined;
|
|
138
|
-
imageHeight?: number | undefined;
|
|
139
|
-
url?: string | undefined;
|
|
140
|
-
}, {
|
|
141
|
-
resourceType: string;
|
|
142
|
-
title?: string | undefined;
|
|
143
|
-
fileName?: string | undefined;
|
|
144
|
-
fileSize?: number | undefined;
|
|
145
|
-
fileType?: string | undefined;
|
|
146
|
-
fileUrl?: string | undefined;
|
|
147
|
-
fileDuration?: number | undefined;
|
|
148
|
-
uploadState?: "pending" | "completed" | undefined;
|
|
149
|
-
image?: string | undefined;
|
|
150
|
-
imageWidth?: number | undefined;
|
|
151
|
-
imageHeight?: number | undefined;
|
|
152
|
-
url?: string | undefined;
|
|
153
|
-
}>>;
|
|
154
|
-
}, "strip", z.ZodTypeAny, {
|
|
155
|
-
content: string;
|
|
156
|
-
id: string;
|
|
157
|
-
postedAt: string;
|
|
158
|
-
projectId?: string | undefined;
|
|
159
|
-
fileAttachment?: {
|
|
160
|
-
resourceType: string;
|
|
161
|
-
title?: string | undefined;
|
|
162
|
-
fileName?: string | undefined;
|
|
163
|
-
fileSize?: number | undefined;
|
|
164
|
-
fileType?: string | undefined;
|
|
165
|
-
fileUrl?: string | undefined;
|
|
166
|
-
fileDuration?: number | undefined;
|
|
167
|
-
uploadState?: "pending" | "completed" | undefined;
|
|
168
|
-
image?: string | undefined;
|
|
169
|
-
imageWidth?: number | undefined;
|
|
170
|
-
imageHeight?: number | undefined;
|
|
171
|
-
url?: string | undefined;
|
|
172
|
-
} | undefined;
|
|
173
|
-
postedUid?: string | undefined;
|
|
174
|
-
taskId?: string | undefined;
|
|
175
|
-
}, {
|
|
176
|
-
content: string;
|
|
177
|
-
id: string;
|
|
178
|
-
postedAt: string;
|
|
179
|
-
projectId?: string | undefined;
|
|
180
|
-
fileAttachment?: {
|
|
181
|
-
resourceType: string;
|
|
182
|
-
title?: string | undefined;
|
|
183
|
-
fileName?: string | undefined;
|
|
184
|
-
fileSize?: number | undefined;
|
|
185
|
-
fileType?: string | undefined;
|
|
186
|
-
fileUrl?: string | undefined;
|
|
187
|
-
fileDuration?: number | undefined;
|
|
188
|
-
uploadState?: "pending" | "completed" | undefined;
|
|
189
|
-
image?: string | undefined;
|
|
190
|
-
imageWidth?: number | undefined;
|
|
191
|
-
imageHeight?: number | undefined;
|
|
192
|
-
url?: string | undefined;
|
|
193
|
-
} | undefined;
|
|
194
|
-
postedUid?: string | undefined;
|
|
195
|
-
taskId?: string | undefined;
|
|
196
|
-
}>;
|
|
75
|
+
}, z.core.$strip>>;
|
|
76
|
+
}, z.core.$strip>;
|
|
197
77
|
/**
|
|
198
78
|
* Schema for an activity event object returned by tools
|
|
199
79
|
*/
|
|
@@ -207,27 +87,7 @@ declare const ActivityEventSchema: z.ZodObject<{
|
|
|
207
87
|
parentItemId: z.ZodOptional<z.ZodString>;
|
|
208
88
|
initiatorId: z.ZodOptional<z.ZodString>;
|
|
209
89
|
extraData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
210
|
-
},
|
|
211
|
-
objectType: string;
|
|
212
|
-
objectId: string;
|
|
213
|
-
eventType: string;
|
|
214
|
-
eventDate: string;
|
|
215
|
-
id?: string | undefined;
|
|
216
|
-
parentProjectId?: string | undefined;
|
|
217
|
-
parentItemId?: string | undefined;
|
|
218
|
-
initiatorId?: string | undefined;
|
|
219
|
-
extraData?: Record<string, unknown> | undefined;
|
|
220
|
-
}, {
|
|
221
|
-
objectType: string;
|
|
222
|
-
objectId: string;
|
|
223
|
-
eventType: string;
|
|
224
|
-
eventDate: string;
|
|
225
|
-
id?: string | undefined;
|
|
226
|
-
parentProjectId?: string | undefined;
|
|
227
|
-
parentItemId?: string | undefined;
|
|
228
|
-
initiatorId?: string | undefined;
|
|
229
|
-
extraData?: Record<string, unknown> | undefined;
|
|
230
|
-
}>;
|
|
90
|
+
}, z.core.$strip>;
|
|
231
91
|
/**
|
|
232
92
|
* Schema for a user/collaborator object returned by tools
|
|
233
93
|
*/
|
|
@@ -235,15 +95,7 @@ declare const CollaboratorSchema: z.ZodObject<{
|
|
|
235
95
|
id: z.ZodString;
|
|
236
96
|
name: z.ZodString;
|
|
237
97
|
email: z.ZodString;
|
|
238
|
-
},
|
|
239
|
-
name: string;
|
|
240
|
-
id: string;
|
|
241
|
-
email: string;
|
|
242
|
-
}, {
|
|
243
|
-
name: string;
|
|
244
|
-
id: string;
|
|
245
|
-
email: string;
|
|
246
|
-
}>;
|
|
98
|
+
}, z.core.$strip>;
|
|
247
99
|
/**
|
|
248
100
|
* Schema for batch operation failure
|
|
249
101
|
*/
|
|
@@ -251,14 +103,6 @@ declare const FailureSchema: z.ZodObject<{
|
|
|
251
103
|
item: z.ZodString;
|
|
252
104
|
error: z.ZodString;
|
|
253
105
|
code: z.ZodOptional<z.ZodString>;
|
|
254
|
-
},
|
|
255
|
-
error: string;
|
|
256
|
-
item: string;
|
|
257
|
-
code?: string | undefined;
|
|
258
|
-
}, {
|
|
259
|
-
error: string;
|
|
260
|
-
item: string;
|
|
261
|
-
code?: string | undefined;
|
|
262
|
-
}>;
|
|
106
|
+
}, z.core.$strip>;
|
|
263
107
|
export { ActivityEventSchema, CollaboratorSchema, CommentSchema, FailureSchema, ProjectSchema, SectionSchema, TaskSchema, };
|
|
264
108
|
//# sourceMappingURL=output-schemas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output-schemas.d.ts","sourceRoot":"","sources":["../../src/utils/output-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB;;GAEG;AACH,QAAA,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"output-schemas.d.ts","sourceRoot":"","sources":["../../src/utils/output-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB;;GAEG;AACH,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;iBA+Bd,CAAA;AAEF;;GAEG;AACH,QAAA,MAAM,aAAa;;;;;;;;;iBASjB,CAAA;AAEF;;GAEG;AACH,QAAA,MAAM,aAAa;;;iBAGjB,CAAA;AA0BF;;GAEG;AACH,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;iBAQjB,CAAA;AAEF;;GAEG;AACH,QAAA,MAAM,mBAAmB;;;;;;;;;;iBAYvB,CAAA;AAEF;;GAEG;AACH,QAAA,MAAM,kBAAkB;;;;iBAItB,CAAA;AAEF;;GAEG;AACH,QAAA,MAAM,aAAa;;;;iBAIjB,CAAA;AAEF,OAAO,EACH,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,UAAU,GACb,CAAA"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
declare const PRIORITY_VALUES: readonly ["p1", "p2", "p3", "p4"];
|
|
3
3
|
export type Priority = (typeof PRIORITY_VALUES)[number];
|
|
4
|
-
export declare const PrioritySchema: z.ZodEnum<
|
|
4
|
+
export declare const PrioritySchema: z.ZodEnum<{
|
|
5
|
+
p1: "p1";
|
|
6
|
+
p2: "p2";
|
|
7
|
+
p3: "p3";
|
|
8
|
+
p4: "p4";
|
|
9
|
+
}>;
|
|
5
10
|
export declare function convertPriorityToNumber(priority: Priority): number;
|
|
6
11
|
export declare function convertNumberToPriority(priority: number): Priority | undefined;
|
|
7
12
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"priorities.d.ts","sourceRoot":"","sources":["../../src/utils/priorities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,QAAA,MAAM,eAAe,mCAAoC,CAAA;AACzD,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAA;AAEvD,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"priorities.d.ts","sourceRoot":"","sources":["../../src/utils/priorities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,QAAA,MAAM,eAAe,mCAAoC,CAAA;AACzD,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAA;AAEvD,eAAO,MAAM,cAAc;;;;;EAE8D,CAAA;AAEzF,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAIlE;AAED,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAI9E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget-loader.d.ts","sourceRoot":"","sources":["../../src/utils/widget-loader.ts"],"names":[],"mappings":"AAEA,KAAK,cAAc,GAAG;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAClB,CAAA;AAYD,iBAAS,kBAAkB,CAAC,YAAY,GAAE,cAA+B,GAAG,cAAc,CAMzF;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doist/todoist-ai",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
12
|
"dist",
|
|
13
|
+
"!dist/dev",
|
|
13
14
|
"scripts",
|
|
14
15
|
"package.json",
|
|
15
16
|
"LICENSE.txt",
|
|
@@ -34,6 +35,7 @@
|
|
|
34
35
|
"postbuild": "chmod +x dist/main.js",
|
|
35
36
|
"start": "npm run build && npx @modelcontextprotocol/inspector node dist/main.js",
|
|
36
37
|
"dev": "concurrently \"vite build --watch\" \"npx @modelcontextprotocol/inspector npx nodemon --quiet --watch dist --ext js --exec node dist/main.js\"",
|
|
38
|
+
"dev:widget": "vite build --watch --minify false",
|
|
37
39
|
"setup": "cp .env.example .env && npm install && npm run build",
|
|
38
40
|
"test:executable": "npm run build && node scripts/test-executable.cjs",
|
|
39
41
|
"type-check": "npx tsc --noEmit",
|
|
@@ -48,26 +50,34 @@
|
|
|
48
50
|
"prepare": "husky"
|
|
49
51
|
},
|
|
50
52
|
"dependencies": {
|
|
51
|
-
"@doist/todoist-api-typescript": "6.2.
|
|
52
|
-
"@modelcontextprotocol/sdk": "1.
|
|
53
|
+
"@doist/todoist-api-typescript": "6.2.1",
|
|
54
|
+
"@modelcontextprotocol/sdk": "1.24.3",
|
|
53
55
|
"date-fns": "4.1.0",
|
|
56
|
+
"dompurify": "3.3.1",
|
|
54
57
|
"dotenv": "17.2.3",
|
|
55
|
-
"zod": "
|
|
58
|
+
"zod": "4.1.13"
|
|
56
59
|
},
|
|
57
60
|
"devDependencies": {
|
|
58
|
-
"@biomejs/biome": "2.3.
|
|
59
|
-
"@types/
|
|
61
|
+
"@biomejs/biome": "2.3.8",
|
|
62
|
+
"@types/dompurify": "3.0.5",
|
|
63
|
+
"@types/express": "5.0.6",
|
|
60
64
|
"@types/morgan": "1.9.10",
|
|
61
|
-
"@types/node": "22.19.
|
|
65
|
+
"@types/node": "22.19.2",
|
|
66
|
+
"@types/react": "19.2.2",
|
|
67
|
+
"@types/react-dom": "19.2.2",
|
|
62
68
|
"concurrently": "9.2.1",
|
|
63
|
-
"express": "5.1
|
|
69
|
+
"express": "5.2.1",
|
|
64
70
|
"husky": "9.1.7",
|
|
65
|
-
"lint-staged": "16.2.
|
|
71
|
+
"lint-staged": "16.2.7",
|
|
66
72
|
"morgan": "1.10.1",
|
|
67
73
|
"nodemon": "3.1.11",
|
|
68
|
-
"rimraf": "6.1.
|
|
74
|
+
"rimraf": "6.1.2",
|
|
75
|
+
"react": "19.2.0",
|
|
76
|
+
"react-dom": "19.2.0",
|
|
77
|
+
"snarkdown": "2.0.0",
|
|
78
|
+
"tsx": "4.20.6",
|
|
69
79
|
"typescript": "5.9.3",
|
|
70
|
-
"vite": "7.2.
|
|
80
|
+
"vite": "7.2.7",
|
|
71
81
|
"vite-plugin-dts": "4.5.4",
|
|
72
82
|
"vitest": "3.2.4"
|
|
73
83
|
},
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs'
|
|
2
|
+
import { dirname, join, resolve } from 'node:path'
|
|
3
|
+
import { fileURLToPath } from 'node:url'
|
|
4
|
+
import type { BuildResult } from 'esbuild'
|
|
5
|
+
import { build } from 'esbuild'
|
|
6
|
+
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url)
|
|
8
|
+
const __dirname = dirname(__filename)
|
|
9
|
+
|
|
10
|
+
const PLACEHOLDER = '<!-- INLINE_WIDGET_SCRIPT -->'
|
|
11
|
+
|
|
12
|
+
type InlineWidget = {
|
|
13
|
+
entryFile: string
|
|
14
|
+
htmlTemplate: string
|
|
15
|
+
outputName: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type InlineWidgetBuildResult = {
|
|
19
|
+
fileName: string
|
|
20
|
+
content: string
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export async function buildInlineWidget(
|
|
24
|
+
widget: InlineWidget,
|
|
25
|
+
{ buildTimestamp }: { buildTimestamp: string },
|
|
26
|
+
): Promise<InlineWidgetBuildResult> {
|
|
27
|
+
const projectRoot = resolve(__dirname, '..')
|
|
28
|
+
const entryPath = join(projectRoot, widget.entryFile)
|
|
29
|
+
const templatePath = join(projectRoot, widget.htmlTemplate)
|
|
30
|
+
const outputFileName = `${widget.outputName}-${buildTimestamp}.html`
|
|
31
|
+
|
|
32
|
+
if (!existsSync(templatePath)) {
|
|
33
|
+
throw new Error(`HTML template not found: ${templatePath}`)
|
|
34
|
+
}
|
|
35
|
+
const htmlTemplateContent = readFileSync(templatePath, 'utf-8')
|
|
36
|
+
if (!htmlTemplateContent.includes(PLACEHOLDER)) {
|
|
37
|
+
throw new Error(`Placeholder ${PLACEHOLDER} not found in ${templatePath}`)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const result: BuildResult = await build({
|
|
41
|
+
entryPoints: [entryPath],
|
|
42
|
+
bundle: true,
|
|
43
|
+
write: false,
|
|
44
|
+
format: 'iife',
|
|
45
|
+
platform: 'browser',
|
|
46
|
+
target: 'es2020',
|
|
47
|
+
minify: true,
|
|
48
|
+
jsx: 'automatic',
|
|
49
|
+
globalName: 'Widget',
|
|
50
|
+
outdir: 'out',
|
|
51
|
+
loader: {
|
|
52
|
+
'.svg': 'dataurl',
|
|
53
|
+
},
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
if (!result.outputFiles || result.outputFiles.length === 0) {
|
|
57
|
+
throw new Error(`Failed to build ${widget.entryFile}`)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const jsFile = result.outputFiles.find((file) => file.path.endsWith('.js'))
|
|
61
|
+
const cssFile = result.outputFiles.find((file) => file.path.endsWith('.css'))
|
|
62
|
+
|
|
63
|
+
if (!jsFile) {
|
|
64
|
+
throw new Error(`No JavaScript output found for ${widget.entryFile}`)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const bundledCode = jsFile.text
|
|
68
|
+
const sanitizedBundledCode = bundledCode
|
|
69
|
+
.replace(/<\/script/gi, '<\\/script')
|
|
70
|
+
.replace(/<!--/g, '<\\!--')
|
|
71
|
+
|
|
72
|
+
// Build the inline style tag if CSS exists
|
|
73
|
+
const inlinedStyle = cssFile ? `<style>${cssFile.text}</style>` : ''
|
|
74
|
+
|
|
75
|
+
const inlinedScript = `
|
|
76
|
+
${inlinedStyle}
|
|
77
|
+
<script>
|
|
78
|
+
${sanitizedBundledCode}
|
|
79
|
+
if (typeof Widget !== 'undefined' && typeof Widget.renderWidget === 'function') {
|
|
80
|
+
Widget.renderWidget();
|
|
81
|
+
}
|
|
82
|
+
</script>
|
|
83
|
+
`
|
|
84
|
+
const finalHtml = htmlTemplateContent.replace(PLACEHOLDER, () => inlinedScript)
|
|
85
|
+
|
|
86
|
+
return { fileName: outputFileName, content: finalHtml }
|
|
87
|
+
}
|