@doist/todoist-ai 5.0.1 → 5.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/dist/index.d.ts +33 -10
- 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.map +1 -1
- package/dist/{mcp-server-CkfU2tuI.js → mcp-server-BHGnG8l8.js} +455 -382
- package/dist/todoist-tool.d.ts +15 -1
- package/dist/todoist-tool.d.ts.map +1 -1
- package/dist/tool-helpers.d.ts +53 -1
- package/dist/tool-helpers.d.ts.map +1 -1
- package/dist/tools/add-comments.d.ts +1 -0
- package/dist/tools/add-comments.d.ts.map +1 -1
- package/dist/tools/add-projects.d.ts +1 -0
- package/dist/tools/add-projects.d.ts.map +1 -1
- package/dist/tools/add-sections.d.ts +1 -0
- package/dist/tools/add-sections.d.ts.map +1 -1
- package/dist/tools/add-tasks.d.ts +1 -0
- package/dist/tools/add-tasks.d.ts.map +1 -1
- package/dist/tools/complete-tasks.d.ts +1 -0
- package/dist/tools/complete-tasks.d.ts.map +1 -1
- package/dist/tools/delete-object.d.ts +1 -0
- package/dist/tools/delete-object.d.ts.map +1 -1
- package/dist/tools/fetch.d.ts +1 -0
- package/dist/tools/fetch.d.ts.map +1 -1
- package/dist/tools/find-activity.d.ts +3 -2
- package/dist/tools/find-activity.d.ts.map +1 -1
- package/dist/tools/find-comments.d.ts +3 -2
- package/dist/tools/find-comments.d.ts.map +1 -1
- package/dist/tools/find-completed-tasks.d.ts +3 -2
- package/dist/tools/find-completed-tasks.d.ts.map +1 -1
- package/dist/tools/find-project-collaborators.d.ts +1 -0
- package/dist/tools/find-project-collaborators.d.ts.map +1 -1
- package/dist/tools/find-projects.d.ts +1 -0
- package/dist/tools/find-projects.d.ts.map +1 -1
- package/dist/tools/find-sections.d.ts +1 -0
- package/dist/tools/find-sections.d.ts.map +1 -1
- package/dist/tools/find-tasks-by-date.d.ts +3 -2
- package/dist/tools/find-tasks-by-date.d.ts.map +1 -1
- package/dist/tools/find-tasks.d.ts +3 -2
- package/dist/tools/find-tasks.d.ts.map +1 -1
- package/dist/tools/get-overview.d.ts +1 -0
- package/dist/tools/get-overview.d.ts.map +1 -1
- package/dist/tools/manage-assignments.d.ts +1 -0
- package/dist/tools/manage-assignments.d.ts.map +1 -1
- package/dist/tools/search.d.ts +1 -0
- package/dist/tools/search.d.ts.map +1 -1
- package/dist/tools/update-comments.d.ts +1 -0
- package/dist/tools/update-comments.d.ts.map +1 -1
- package/dist/tools/update-projects.d.ts +1 -0
- package/dist/tools/update-projects.d.ts.map +1 -1
- package/dist/tools/update-sections.d.ts +1 -0
- package/dist/tools/update-sections.d.ts.map +1 -1
- package/dist/tools/update-tasks.d.ts +1 -0
- package/dist/tools/update-tasks.d.ts.map +1 -1
- package/dist/tools/user-info.d.ts +1 -0
- package/dist/tools/user-info.d.ts.map +1 -1
- package/dist/utils/constants.d.ts +3 -1
- package/dist/utils/constants.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getTaskUrl as me, getProjectUrl as fe, TodoistApi as
|
|
2
|
-
import { McpServer as
|
|
1
|
+
import { getTaskUrl as me, getProjectUrl as fe, TodoistApi as Ae } from "@doist/todoist-api-typescript";
|
|
2
|
+
import { McpServer as Ue } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
3
|
import F, { z as s } from "zod";
|
|
4
|
-
import { addDays as be, formatISO as
|
|
4
|
+
import { addDays as be, formatISO as Pe } from "date-fns";
|
|
5
5
|
function X(e) {
|
|
6
6
|
if (e == null)
|
|
7
7
|
return e;
|
|
@@ -20,13 +20,13 @@ function X(e) {
|
|
|
20
20
|
}
|
|
21
21
|
return e;
|
|
22
22
|
}
|
|
23
|
-
const
|
|
24
|
-
function
|
|
23
|
+
const Ee = process.env.USE_STRUCTURED_CONTENT === "true" || process.env.NODE_ENV === "test";
|
|
24
|
+
function Oe({
|
|
25
25
|
textContent: e,
|
|
26
26
|
structuredContent: t
|
|
27
27
|
}) {
|
|
28
28
|
const o = X(t), n = {};
|
|
29
|
-
if (e && (n.content = [{ type: "text", text: e }]), t && (n.structuredContent = o), !
|
|
29
|
+
if (e && (n.content = [{ type: "text", text: e }]), t && (n.structuredContent = o), !Ee && t) {
|
|
30
30
|
const r = JSON.stringify(o);
|
|
31
31
|
n.content || (n.content = []), n.content.push({
|
|
32
32
|
type: "text",
|
|
@@ -36,12 +36,22 @@ function Pe({
|
|
|
36
36
|
}
|
|
37
37
|
return n;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function _e(e) {
|
|
40
40
|
return {
|
|
41
41
|
content: [{ type: "text", text: e }],
|
|
42
42
|
isError: !0
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
+
function Ne(e) {
|
|
46
|
+
switch (e) {
|
|
47
|
+
case "readonly":
|
|
48
|
+
return { readOnlyHint: !0, destructiveHint: !1 };
|
|
49
|
+
case "additive":
|
|
50
|
+
return { readOnlyHint: !1, destructiveHint: !1 };
|
|
51
|
+
case "mutating":
|
|
52
|
+
return { readOnlyHint: !1, destructiveHint: !0 };
|
|
53
|
+
}
|
|
54
|
+
}
|
|
45
55
|
function I(e, t, o) {
|
|
46
56
|
const n = async (r, i) => {
|
|
47
57
|
try {
|
|
@@ -49,11 +59,11 @@ function I(e, t, o) {
|
|
|
49
59
|
r,
|
|
50
60
|
o
|
|
51
61
|
);
|
|
52
|
-
return
|
|
62
|
+
return Oe({ textContent: c, structuredContent: a });
|
|
53
63
|
} catch (c) {
|
|
54
64
|
console.error(`Error executing tool ${e.name}:`, { args: r, error: c });
|
|
55
65
|
const a = c instanceof Error ? c.message : "An unknown error occurred";
|
|
56
|
-
return
|
|
66
|
+
return _e(a);
|
|
57
67
|
}
|
|
58
68
|
};
|
|
59
69
|
t.registerTool(
|
|
@@ -61,11 +71,41 @@ function I(e, t, o) {
|
|
|
61
71
|
{
|
|
62
72
|
description: e.description,
|
|
63
73
|
inputSchema: e.parameters,
|
|
64
|
-
outputSchema: e.outputSchema
|
|
74
|
+
outputSchema: e.outputSchema,
|
|
75
|
+
annotations: Ne(e.mutability)
|
|
65
76
|
},
|
|
66
77
|
n
|
|
67
78
|
);
|
|
68
79
|
}
|
|
80
|
+
const S = {
|
|
81
|
+
/** Default limit for task listings */
|
|
82
|
+
TASKS_DEFAULT: 10,
|
|
83
|
+
/** Maximum limit for task search and list operations */
|
|
84
|
+
TASKS_MAX: 100,
|
|
85
|
+
/** Default limit for completed tasks */
|
|
86
|
+
COMPLETED_TASKS_DEFAULT: 50,
|
|
87
|
+
/** Maximum limit for completed tasks */
|
|
88
|
+
COMPLETED_TASKS_MAX: 200,
|
|
89
|
+
/** Default limit for project listings */
|
|
90
|
+
PROJECTS_DEFAULT: 50,
|
|
91
|
+
/** Maximum limit for project listings */
|
|
92
|
+
PROJECTS_MAX: 200,
|
|
93
|
+
/** Maximum limit for section listings */
|
|
94
|
+
SECTIONS_MAX: 200,
|
|
95
|
+
/** Batch size for fetching all tasks in a project */
|
|
96
|
+
TASKS_BATCH_SIZE: 50,
|
|
97
|
+
/** Default limit for comment listings */
|
|
98
|
+
COMMENTS_DEFAULT: 10,
|
|
99
|
+
/** Maximum limit for comment search and list operations */
|
|
100
|
+
COMMENTS_MAX: 10,
|
|
101
|
+
/** Default limit for activity log listings */
|
|
102
|
+
ACTIVITY_DEFAULT: 20,
|
|
103
|
+
/** Maximum limit for activity log search and list operations */
|
|
104
|
+
ACTIVITY_MAX: 100
|
|
105
|
+
}, G = {
|
|
106
|
+
/** Maximum number of failures to show in detailed error messages */
|
|
107
|
+
MAX_FAILURES_SHOWN: 3
|
|
108
|
+
};
|
|
69
109
|
class U extends Error {
|
|
70
110
|
constructor(t, o) {
|
|
71
111
|
super(`Invalid duration format "${t}": ${o}`), this.name = "DurationParseError";
|
|
@@ -105,22 +145,22 @@ function ge(e) {
|
|
|
105
145
|
throw new U(e, "Duration cannot exceed 24 hours (1440 minutes)");
|
|
106
146
|
return { minutes: n };
|
|
107
147
|
}
|
|
108
|
-
function
|
|
148
|
+
function Me(e) {
|
|
109
149
|
if (e <= 0) return "0m";
|
|
110
150
|
const t = Math.floor(e / 60), o = e % 60;
|
|
111
151
|
return t === 0 ? `${o}m` : o === 0 ? `${t}h` : `${t}h${o}m`;
|
|
112
152
|
}
|
|
113
|
-
const
|
|
153
|
+
const Fe = ["p1", "p2", "p3", "p4"], Q = s.enum(Fe, {
|
|
114
154
|
description: "Task priority: p1 (highest), p2 (high), p3 (medium), p4 (lowest/default)"
|
|
115
155
|
});
|
|
116
156
|
function Te(e) {
|
|
117
157
|
return { p1: 4, p2: 3, p3: 2, p4: 1 }[e];
|
|
118
158
|
}
|
|
119
|
-
function
|
|
159
|
+
function Re(e) {
|
|
120
160
|
return { 4: "p1", 3: "p2", 2: "p3", 1: "p4" }[e];
|
|
121
161
|
}
|
|
122
|
-
const A = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new Map(),
|
|
123
|
-
class
|
|
162
|
+
const A = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new Map(), q = 300 * 1e3;
|
|
163
|
+
class Le {
|
|
124
164
|
/**
|
|
125
165
|
* Resolve a user name or ID to a user ID by looking up collaborators across all shared projects.
|
|
126
166
|
* Supports exact name matches, partial matches, and email matches.
|
|
@@ -129,7 +169,7 @@ class Me {
|
|
|
129
169
|
if (!o || o.trim().length === 0)
|
|
130
170
|
return null;
|
|
131
171
|
const n = o.trim(), r = A.get(n);
|
|
132
|
-
if (r && Date.now() - r.timestamp <
|
|
172
|
+
if (r && Date.now() - r.timestamp < q)
|
|
133
173
|
return r.result;
|
|
134
174
|
if (/^[0-9]+$/.test(n) || /^[a-f0-9-]{8,}$/i.test(n) && n.includes("-") || /^[a-z0-9_]{6,}$/i.test(n) && !/^[a-z]+[\s-]/.test(n) && /[0-9_]/.test(n)) {
|
|
135
175
|
const i = { userId: n, displayName: n, email: n };
|
|
@@ -178,7 +218,7 @@ class Me {
|
|
|
178
218
|
*/
|
|
179
219
|
async getProjectCollaborators(t, o) {
|
|
180
220
|
const n = `project_${o}`, r = R.get(n);
|
|
181
|
-
if (r && Date.now() - r.timestamp <
|
|
221
|
+
if (r && Date.now() - r.timestamp < q)
|
|
182
222
|
return r.result;
|
|
183
223
|
try {
|
|
184
224
|
const i = await t.getProjectCollaborators(o), a = (Array.isArray(i) ? i : i.results || []).filter((d) => d?.id && d.name && d.email);
|
|
@@ -195,7 +235,7 @@ class Me {
|
|
|
195
235
|
*/
|
|
196
236
|
async getAllCollaborators(t) {
|
|
197
237
|
const o = "all_collaborators", n = R.get(o);
|
|
198
|
-
if (n && Date.now() - n.timestamp <
|
|
238
|
+
if (n && Date.now() - n.timestamp < q)
|
|
199
239
|
return n.result;
|
|
200
240
|
try {
|
|
201
241
|
const { results: r } = await t.getProjects({}), i = r.filter((u) => u.isShared);
|
|
@@ -225,25 +265,25 @@ class Me {
|
|
|
225
265
|
A.clear(), R.clear();
|
|
226
266
|
}
|
|
227
267
|
}
|
|
228
|
-
const _ = new
|
|
229
|
-
async function
|
|
268
|
+
const _ = new Le();
|
|
269
|
+
async function Be(e, t) {
|
|
230
270
|
return _.resolveUser(e, t);
|
|
231
271
|
}
|
|
232
272
|
const ye = ["assigned", "unassignedOrMe", "all"];
|
|
233
273
|
async function ee(e, t) {
|
|
234
274
|
if (!t)
|
|
235
275
|
return;
|
|
236
|
-
const o = await
|
|
276
|
+
const o = await Be(e, t);
|
|
237
277
|
if (!o)
|
|
238
278
|
throw new Error(
|
|
239
279
|
`Could not find user: "${t}". Make sure the user is a collaborator on a shared project.`
|
|
240
280
|
);
|
|
241
281
|
return { userId: o.userId, email: o.email };
|
|
242
282
|
}
|
|
243
|
-
function
|
|
283
|
+
function z(e, t) {
|
|
244
284
|
return t.length === 0 ? e : e.length === 0 ? t : `${e} & ${t}`;
|
|
245
285
|
}
|
|
246
|
-
function
|
|
286
|
+
function We({
|
|
247
287
|
resolvedAssigneeId: e,
|
|
248
288
|
assigneeEmail: t,
|
|
249
289
|
responsibleUserFiltering: o = "unassignedOrMe"
|
|
@@ -261,7 +301,33 @@ function de({
|
|
|
261
301
|
function B(e) {
|
|
262
302
|
return "inboxProject" in e;
|
|
263
303
|
}
|
|
264
|
-
function
|
|
304
|
+
async function Ie(e) {
|
|
305
|
+
const { apiMethod: t, args: o, limit: n = 100 } = e, r = [];
|
|
306
|
+
let i = null;
|
|
307
|
+
do {
|
|
308
|
+
const c = await t({
|
|
309
|
+
...o,
|
|
310
|
+
cursor: i,
|
|
311
|
+
limit: n
|
|
312
|
+
});
|
|
313
|
+
r.push(...c.results), i = c.nextCursor ?? null;
|
|
314
|
+
} while (i !== null);
|
|
315
|
+
return r;
|
|
316
|
+
}
|
|
317
|
+
async function ke(e) {
|
|
318
|
+
return Ie({
|
|
319
|
+
apiMethod: (t) => e.getProjects(t),
|
|
320
|
+
limit: S.PROJECTS_MAX
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
async function Ye(e, t) {
|
|
324
|
+
return Ie({
|
|
325
|
+
apiMethod: (o) => e.getSections(o),
|
|
326
|
+
args: t ? { projectId: t } : {},
|
|
327
|
+
limit: S.SECTIONS_MAX
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
function He(e, t, o, n) {
|
|
265
331
|
const r = [t, o, n].filter(Boolean);
|
|
266
332
|
if (r.length > 1)
|
|
267
333
|
throw new Error(
|
|
@@ -284,19 +350,19 @@ function O(e) {
|
|
|
284
350
|
dueDate: e.due?.date,
|
|
285
351
|
recurring: e.due?.isRecurring && e.due.string ? e.due.string : !1,
|
|
286
352
|
deadlineDate: e.deadline?.date,
|
|
287
|
-
priority:
|
|
353
|
+
priority: Re(e.priority) ?? "p4",
|
|
288
354
|
projectId: e.projectId,
|
|
289
355
|
sectionId: e.sectionId ?? void 0,
|
|
290
356
|
parentId: e.parentId ?? void 0,
|
|
291
357
|
labels: e.labels,
|
|
292
|
-
duration: e.duration ?
|
|
358
|
+
duration: e.duration ? Me(e.duration.amount) : void 0,
|
|
293
359
|
responsibleUid: e.responsibleUid ?? void 0,
|
|
294
360
|
assignedByUid: e.assignedByUid ?? void 0,
|
|
295
361
|
checked: e.checked,
|
|
296
362
|
completedAt: e.completedAt ?? void 0
|
|
297
363
|
};
|
|
298
364
|
}
|
|
299
|
-
function
|
|
365
|
+
function we(e) {
|
|
300
366
|
return {
|
|
301
367
|
id: e.id,
|
|
302
368
|
name: e.name,
|
|
@@ -332,7 +398,7 @@ function te(e) {
|
|
|
332
398
|
} : void 0
|
|
333
399
|
};
|
|
334
400
|
}
|
|
335
|
-
function
|
|
401
|
+
function ze(e) {
|
|
336
402
|
return {
|
|
337
403
|
id: e.id ?? void 0,
|
|
338
404
|
objectType: e.objectType,
|
|
@@ -345,7 +411,7 @@ function Be(e) {
|
|
|
345
411
|
extraData: e.extraData ?? void 0
|
|
346
412
|
};
|
|
347
413
|
}
|
|
348
|
-
const
|
|
414
|
+
const Ke = F.object({
|
|
349
415
|
httpStatusCode: F.number(),
|
|
350
416
|
responseData: F.object({
|
|
351
417
|
error: F.string(),
|
|
@@ -363,7 +429,7 @@ async function se({
|
|
|
363
429
|
const { results: r, nextCursor: i } = await e.getTasksByFilter({ query: t, cursor: n, limit: o });
|
|
364
430
|
return { tasks: r.map(O), nextCursor: i };
|
|
365
431
|
} catch (r) {
|
|
366
|
-
const i =
|
|
432
|
+
const i = Ke.safeParse(r);
|
|
367
433
|
if (!i.success)
|
|
368
434
|
throw r;
|
|
369
435
|
const { responseData: c } = i.data;
|
|
@@ -403,7 +469,7 @@ const W = s.object({
|
|
|
403
469
|
}), ne = s.object({
|
|
404
470
|
id: s.string().describe("The unique ID of the section."),
|
|
405
471
|
name: s.string().describe("The name of the section.")
|
|
406
|
-
}),
|
|
472
|
+
}), Ve = s.object({
|
|
407
473
|
resourceType: s.string().describe("The type of resource (file, url, image, etc)."),
|
|
408
474
|
fileName: s.string().optional().describe("The name of the file."),
|
|
409
475
|
fileSize: s.number().optional().describe("The size of the file in bytes."),
|
|
@@ -423,8 +489,8 @@ const W = s.object({
|
|
|
423
489
|
content: s.string().describe("The content of the comment."),
|
|
424
490
|
postedAt: s.string().describe("When the comment was posted (ISO 8601 format)."),
|
|
425
491
|
postedUid: s.string().optional().describe("The UID of the user who posted this comment."),
|
|
426
|
-
fileAttachment:
|
|
427
|
-
}),
|
|
492
|
+
fileAttachment: Ve.optional().describe("File attachment information, if any.")
|
|
493
|
+
}), Ge = s.object({
|
|
428
494
|
id: s.string().optional().describe("The unique ID of the activity event."),
|
|
429
495
|
objectType: s.string().describe("The type of object this event relates to (task, project, etc)."),
|
|
430
496
|
objectId: s.string().describe("The ID of the object this event relates to."),
|
|
@@ -434,11 +500,11 @@ const W = s.object({
|
|
|
434
500
|
parentItemId: s.string().optional().describe("The ID of the parent item."),
|
|
435
501
|
initiatorId: s.string().optional().describe("The ID of the user who initiated this event."),
|
|
436
502
|
extraData: s.record(s.unknown()).optional().describe("Additional event data.")
|
|
437
|
-
}),
|
|
503
|
+
}), qe = s.object({
|
|
438
504
|
id: s.string().describe("The unique ID of the user."),
|
|
439
505
|
name: s.string().describe("The full name of the user."),
|
|
440
506
|
email: s.string().describe("The email address of the user.")
|
|
441
|
-
}),
|
|
507
|
+
}), Je = s.object({
|
|
442
508
|
item: s.string().describe("The item that failed (usually an ID or identifier)."),
|
|
443
509
|
error: s.string().describe("The error message."),
|
|
444
510
|
code: s.string().optional().describe("The error code, if available.")
|
|
@@ -474,23 +540,24 @@ const W = s.object({
|
|
|
474
540
|
// OpenAI MCP tools
|
|
475
541
|
SEARCH: "search",
|
|
476
542
|
FETCH: "fetch"
|
|
477
|
-
},
|
|
543
|
+
}, Xe = s.object({
|
|
478
544
|
taskId: s.string().optional().describe("The ID of the task to comment on."),
|
|
479
545
|
projectId: s.string().optional().describe(
|
|
480
546
|
'The ID of the project to comment on. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
481
547
|
),
|
|
482
548
|
content: s.string().min(1).describe("The content of the comment.")
|
|
483
|
-
}),
|
|
484
|
-
comments: s.array(
|
|
485
|
-
},
|
|
549
|
+
}), Ze = {
|
|
550
|
+
comments: s.array(Xe).min(1).describe("The array of comments to add.")
|
|
551
|
+
}, Qe = {
|
|
486
552
|
comments: s.array(re).describe("The created comments."),
|
|
487
553
|
totalCount: s.number().describe("The total number of comments created."),
|
|
488
554
|
addedCommentIds: s.array(s.string()).describe("The IDs of the added comments.")
|
|
489
|
-
},
|
|
555
|
+
}, et = {
|
|
490
556
|
name: g.ADD_COMMENTS,
|
|
491
557
|
description: "Add multiple comments to tasks or projects. Each comment must specify either taskId or projectId.",
|
|
492
|
-
parameters:
|
|
493
|
-
outputSchema:
|
|
558
|
+
parameters: Ze,
|
|
559
|
+
outputSchema: Qe,
|
|
560
|
+
mutability: "additive",
|
|
494
561
|
async execute(e, t) {
|
|
495
562
|
const { comments: o } = e;
|
|
496
563
|
for (const [l, u] of o.entries()) {
|
|
@@ -511,7 +578,7 @@ const W = s.object({
|
|
|
511
578
|
});
|
|
512
579
|
}), a = (await Promise.all(i)).map(te);
|
|
513
580
|
return {
|
|
514
|
-
textContent:
|
|
581
|
+
textContent: tt({ comments: a }),
|
|
515
582
|
structuredContent: {
|
|
516
583
|
comments: a,
|
|
517
584
|
totalCount: a.length,
|
|
@@ -520,7 +587,7 @@ const W = s.object({
|
|
|
520
587
|
};
|
|
521
588
|
}
|
|
522
589
|
};
|
|
523
|
-
function
|
|
590
|
+
function tt({ comments: e }) {
|
|
524
591
|
const t = e.filter((i) => i.taskId).length, o = e.filter((i) => i.projectId).length, n = [];
|
|
525
592
|
if (t > 0) {
|
|
526
593
|
const i = t > 1 ? "comments" : "comment";
|
|
@@ -532,23 +599,24 @@ function Xe({ comments: e }) {
|
|
|
532
599
|
}
|
|
533
600
|
return n.length > 0 ? `Added ${n.join(" and ")}` : "No comments added";
|
|
534
601
|
}
|
|
535
|
-
const
|
|
602
|
+
const st = s.object({
|
|
536
603
|
name: s.string().min(1).describe("The name of the project."),
|
|
537
604
|
parentId: s.string().optional().describe("The ID of the parent project. If provided, creates this as a sub-project."),
|
|
538
605
|
isFavorite: s.boolean().optional().describe("Whether the project is a favorite. Defaults to false."),
|
|
539
606
|
viewStyle: s.enum(["list", "board", "calendar"]).optional().describe('The project view style. Defaults to "list".')
|
|
540
|
-
}),
|
|
541
|
-
projects: s.array(
|
|
542
|
-
},
|
|
607
|
+
}), ot = {
|
|
608
|
+
projects: s.array(st).min(1).describe("The array of projects to add.")
|
|
609
|
+
}, nt = {
|
|
543
610
|
projects: s.array(oe).describe("The created projects."),
|
|
544
611
|
totalCount: s.number().describe("The total number of projects created.")
|
|
545
|
-
},
|
|
612
|
+
}, rt = {
|
|
546
613
|
name: g.ADD_PROJECTS,
|
|
547
614
|
description: "Add one or more new projects.",
|
|
548
|
-
parameters:
|
|
549
|
-
outputSchema:
|
|
615
|
+
parameters: ot,
|
|
616
|
+
outputSchema: nt,
|
|
617
|
+
mutability: "additive",
|
|
550
618
|
async execute({ projects: e }, t) {
|
|
551
|
-
const o = await Promise.all(e.map((i) => t.addProject(i))), n =
|
|
619
|
+
const o = await Promise.all(e.map((i) => t.addProject(i))), n = it({ projects: o }), r = o.map((i) => ({
|
|
552
620
|
...i,
|
|
553
621
|
parentId: "parentId" in i ? i.parentId ?? void 0 : void 0,
|
|
554
622
|
inboxProject: "inboxProject" in i ? i.inboxProject : !1
|
|
@@ -562,27 +630,28 @@ const Ze = s.object({
|
|
|
562
630
|
};
|
|
563
631
|
}
|
|
564
632
|
};
|
|
565
|
-
function
|
|
633
|
+
function it({ projects: e }) {
|
|
566
634
|
const t = e.length, o = e.map((r) => `• ${r.name} (id=${r.id})`).join(`
|
|
567
635
|
`);
|
|
568
636
|
return `Added ${t} project${t === 1 ? "" : "s"}:
|
|
569
637
|
${o}`;
|
|
570
638
|
}
|
|
571
|
-
const
|
|
639
|
+
const at = s.object({
|
|
572
640
|
name: s.string().min(1).describe("The name of the section."),
|
|
573
641
|
projectId: s.string().min(1).describe(
|
|
574
642
|
'The ID of the project to add the section to. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
575
643
|
)
|
|
576
|
-
}),
|
|
577
|
-
sections: s.array(
|
|
578
|
-
},
|
|
644
|
+
}), ct = {
|
|
645
|
+
sections: s.array(at).min(1).describe("The array of sections to add.")
|
|
646
|
+
}, dt = {
|
|
579
647
|
sections: s.array(ne).describe("The created sections."),
|
|
580
648
|
totalCount: s.number().describe("The total number of sections created.")
|
|
581
|
-
},
|
|
649
|
+
}, lt = {
|
|
582
650
|
name: g.ADD_SECTIONS,
|
|
583
651
|
description: "Add one or more new sections to projects.",
|
|
584
|
-
parameters:
|
|
585
|
-
outputSchema:
|
|
652
|
+
parameters: ct,
|
|
653
|
+
outputSchema: dt,
|
|
654
|
+
mutability: "additive",
|
|
586
655
|
async execute({ sections: e }, t) {
|
|
587
656
|
const n = e.some((a) => a.projectId === "inbox") ? await t.getUser() : null, r = e.map((a) => ({
|
|
588
657
|
...a,
|
|
@@ -591,7 +660,7 @@ const ot = s.object({
|
|
|
591
660
|
r.map((a) => t.addSection(a))
|
|
592
661
|
);
|
|
593
662
|
return {
|
|
594
|
-
textContent:
|
|
663
|
+
textContent: ut({ sections: i }),
|
|
595
664
|
structuredContent: {
|
|
596
665
|
sections: i,
|
|
597
666
|
totalCount: i.length
|
|
@@ -599,7 +668,7 @@ const ot = s.object({
|
|
|
599
668
|
};
|
|
600
669
|
}
|
|
601
670
|
};
|
|
602
|
-
function
|
|
671
|
+
function ut({ sections: e }) {
|
|
603
672
|
const t = e.length, o = e.map((r) => `• ${r.name} (id=${r.id}, projectId=${r.projectId})`).join(`
|
|
604
673
|
`);
|
|
605
674
|
return `Added ${t} section${t === 1 ? "" : "s"}:
|
|
@@ -614,7 +683,7 @@ const L = {
|
|
|
614
683
|
PROJECT_NOT_FOUND: "PROJECT_NOT_FOUND",
|
|
615
684
|
TASK_NOT_FOUND: "TASK_NOT_FOUND"
|
|
616
685
|
};
|
|
617
|
-
class
|
|
686
|
+
class pt {
|
|
618
687
|
/**
|
|
619
688
|
* Validate a single assignment operation
|
|
620
689
|
*/
|
|
@@ -823,42 +892,16 @@ class ct {
|
|
|
823
892
|
};
|
|
824
893
|
}
|
|
825
894
|
}
|
|
826
|
-
const ie = new
|
|
827
|
-
|
|
828
|
-
TASKS_DEFAULT: 10,
|
|
829
|
-
/** Maximum limit for task search and list operations */
|
|
830
|
-
TASKS_MAX: 100,
|
|
831
|
-
/** Default limit for completed tasks */
|
|
832
|
-
COMPLETED_TASKS_DEFAULT: 50,
|
|
833
|
-
/** Maximum limit for completed tasks */
|
|
834
|
-
COMPLETED_TASKS_MAX: 200,
|
|
835
|
-
/** Default limit for project listings */
|
|
836
|
-
PROJECTS_DEFAULT: 50,
|
|
837
|
-
/** Maximum limit for project listings */
|
|
838
|
-
PROJECTS_MAX: 100,
|
|
839
|
-
/** Batch size for fetching all tasks in a project */
|
|
840
|
-
TASKS_BATCH_SIZE: 50,
|
|
841
|
-
/** Default limit for comment listings */
|
|
842
|
-
COMMENTS_DEFAULT: 10,
|
|
843
|
-
/** Maximum limit for comment search and list operations */
|
|
844
|
-
COMMENTS_MAX: 10,
|
|
845
|
-
/** Default limit for activity log listings */
|
|
846
|
-
ACTIVITY_DEFAULT: 20,
|
|
847
|
-
/** Maximum limit for activity log search and list operations */
|
|
848
|
-
ACTIVITY_MAX: 100
|
|
849
|
-
}, q = {
|
|
850
|
-
/** Maximum number of failures to show in detailed error messages */
|
|
851
|
-
MAX_FAILURES_SHOWN: 3
|
|
852
|
-
};
|
|
853
|
-
function dt(e = /* @__PURE__ */ new Date()) {
|
|
895
|
+
const ie = new pt();
|
|
896
|
+
function ht(e = /* @__PURE__ */ new Date()) {
|
|
854
897
|
return e.toISOString().split("T")[0] ?? "";
|
|
855
898
|
}
|
|
856
|
-
function
|
|
899
|
+
function je(e, t, o = {}) {
|
|
857
900
|
const { context: n, showDetails: r = !1 } = o, i = t.length, c = [], d = `${e} ${i} ${i === 1 ? "task" : "tasks"}${n ? ` ${n}` : ""}.`;
|
|
858
901
|
c.push(d);
|
|
859
902
|
const l = 5;
|
|
860
903
|
if (r || i <= l) {
|
|
861
|
-
const u =
|
|
904
|
+
const u = K(t, l);
|
|
862
905
|
if (u.length > 0) {
|
|
863
906
|
const p = i > l ? `, +${i - l} more` : "";
|
|
864
907
|
c.push(`Tasks:
|
|
@@ -868,31 +911,31 @@ ${u}${p}.`);
|
|
|
868
911
|
return c.join(`
|
|
869
912
|
`);
|
|
870
913
|
}
|
|
871
|
-
function
|
|
914
|
+
function mt(e) {
|
|
872
915
|
const { action: t, success: o, total: n, successItems: r, failures: i } = e, c = [], a = `${t}: ${o}/${n} successful.`;
|
|
873
916
|
if (c.push(a), r?.length && r.length <= 5 && c.push(`Completed:
|
|
874
917
|
${r.map((d) => ` ${d}`).join(`
|
|
875
918
|
`)}.`), i?.length) {
|
|
876
919
|
const d = i.length, l = `Failed (${d}):
|
|
877
|
-
${i.slice(0,
|
|
920
|
+
${i.slice(0, G.MAX_FAILURES_SHOWN).map((u) => ` ${u.item} (Error: ${u.error}${u.code ? ` [${u.code}]` : ""})`).join(
|
|
878
921
|
`
|
|
879
922
|
`
|
|
880
|
-
)}${d >
|
|
923
|
+
)}${d > G.MAX_FAILURES_SHOWN ? `, +${d - G.MAX_FAILURES_SHOWN} more` : ""}.`;
|
|
881
924
|
c.push(l);
|
|
882
925
|
}
|
|
883
926
|
return c.join(`
|
|
884
927
|
`);
|
|
885
928
|
}
|
|
886
|
-
function
|
|
929
|
+
function ft(e) {
|
|
887
930
|
const t = e.content || e.title || "Untitled", o = e.dueDate ? ` • due ${e.dueDate}` : "", n = e.priority ? ` • ${e.priority.toUpperCase()}` : "", r = e.projectName ? ` • ${e.projectName}` : "", i = e.id ? ` • id=${e.id}` : "";
|
|
888
931
|
return ` ${t}${o}${n}${r}${i}`;
|
|
889
932
|
}
|
|
890
|
-
function
|
|
933
|
+
function bt(e) {
|
|
891
934
|
const t = e.inboxProject ? " • Inbox" : "", o = e.isFavorite ? " • ⭐" : "", n = e.isShared ? " • Shared" : "", r = e.viewStyle && e.viewStyle !== "list" ? ` • ${e.viewStyle}` : "", i = ` • id=${e.id}`;
|
|
892
935
|
return ` ${e.name}${t}${o}${n}${r}${i}`;
|
|
893
936
|
}
|
|
894
|
-
function
|
|
895
|
-
const n = e.slice(0, t).map(
|
|
937
|
+
function K(e, t = 5) {
|
|
938
|
+
const n = e.slice(0, t).map(ft).join(`
|
|
896
939
|
`);
|
|
897
940
|
if (e.length > t) {
|
|
898
941
|
const r = e.length - t;
|
|
@@ -913,16 +956,16 @@ function N({
|
|
|
913
956
|
}) {
|
|
914
957
|
const d = [], l = `${e}: ${t}${typeof o == "number" ? ` (limit ${o})` : ""}${n ? ", more available" : ""}.`;
|
|
915
958
|
return d.push(l), r?.length && d.push(`Filter: ${r.join("; ")}.`), i?.length && d.push(`Preview:
|
|
916
|
-
${i}`), !t && c?.length && d.push(`No results. ${c.join("; ")}.`), (a?.length || n) && d.push(
|
|
959
|
+
${i}`), !t && c?.length && d.push(`No results. ${c.join("; ")}.`), (a?.length || n) && d.push(ve(a || [], n)), d.join(`
|
|
917
960
|
`);
|
|
918
961
|
}
|
|
919
|
-
function
|
|
962
|
+
function ve(e, t) {
|
|
920
963
|
const o = [...e];
|
|
921
964
|
return t && o.push(`Pass cursor '${t}' to fetch more results.`), `${o.length === 1 ? "Possible suggested next step:" : "Possible suggested next steps:"}
|
|
922
965
|
${o.map((r) => `- ${r}`).join(`
|
|
923
966
|
`)}`;
|
|
924
967
|
}
|
|
925
|
-
const
|
|
968
|
+
const gt = s.object({
|
|
926
969
|
content: s.string().min(1).describe(
|
|
927
970
|
'The task name/title. Should be concise and actionable (e.g., "Review PR #123", "Call dentist"). For longer content, use the description field instead. Supports Markdown.'
|
|
928
971
|
),
|
|
@@ -948,20 +991,21 @@ const ht = s.object({
|
|
|
948
991
|
responsibleUser: s.string().optional().describe(
|
|
949
992
|
"Assign task to this user. Can be a user ID, name, or email address. User must be a collaborator on the target project."
|
|
950
993
|
)
|
|
951
|
-
}),
|
|
952
|
-
tasks: s.array(
|
|
953
|
-
},
|
|
994
|
+
}), Tt = {
|
|
995
|
+
tasks: s.array(gt).min(1).describe("The array of tasks to add.")
|
|
996
|
+
}, yt = {
|
|
954
997
|
tasks: s.array(W).describe("The created tasks."),
|
|
955
998
|
totalCount: s.number().describe("The total number of tasks created.")
|
|
956
|
-
},
|
|
999
|
+
}, It = {
|
|
957
1000
|
name: g.ADD_TASKS,
|
|
958
1001
|
description: "Add one or more tasks to a project, section, or parent. Supports assignment to project collaborators.",
|
|
959
|
-
parameters:
|
|
960
|
-
outputSchema:
|
|
1002
|
+
parameters: Tt,
|
|
1003
|
+
outputSchema: yt,
|
|
1004
|
+
mutability: "additive",
|
|
961
1005
|
async execute({ tasks: e }, t) {
|
|
962
|
-
const o = e.map((c) =>
|
|
1006
|
+
const o = e.map((c) => kt(c, t)), r = (await Promise.all(o)).map(O);
|
|
963
1007
|
return {
|
|
964
|
-
textContent:
|
|
1008
|
+
textContent: wt({
|
|
965
1009
|
tasks: r,
|
|
966
1010
|
args: { tasks: e }
|
|
967
1011
|
}),
|
|
@@ -972,7 +1016,7 @@ const ht = s.object({
|
|
|
972
1016
|
};
|
|
973
1017
|
}
|
|
974
1018
|
};
|
|
975
|
-
async function
|
|
1019
|
+
async function kt(e, t) {
|
|
976
1020
|
const {
|
|
977
1021
|
duration: o,
|
|
978
1022
|
projectId: n,
|
|
@@ -1040,7 +1084,7 @@ async function gt(e, t) {
|
|
|
1040
1084
|
}
|
|
1041
1085
|
return await t.addTask(b);
|
|
1042
1086
|
}
|
|
1043
|
-
function
|
|
1087
|
+
function wt({
|
|
1044
1088
|
tasks: e,
|
|
1045
1089
|
args: t
|
|
1046
1090
|
}) {
|
|
@@ -1052,24 +1096,25 @@ function Tt({
|
|
|
1052
1096
|
const r = Array.from(o)[0];
|
|
1053
1097
|
n = r === "inbox" ? "" : `to ${r}`;
|
|
1054
1098
|
} else o.size > 1 && (n = "to multiple contexts");
|
|
1055
|
-
return
|
|
1099
|
+
return je("Added", e, {
|
|
1056
1100
|
context: n,
|
|
1057
1101
|
showDetails: !0
|
|
1058
1102
|
});
|
|
1059
1103
|
}
|
|
1060
|
-
const
|
|
1104
|
+
const jt = {
|
|
1061
1105
|
ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to complete.")
|
|
1062
|
-
},
|
|
1106
|
+
}, vt = {
|
|
1063
1107
|
completed: s.array(s.string()).describe("The IDs of successfully completed tasks."),
|
|
1064
|
-
failures: s.array(
|
|
1108
|
+
failures: s.array(Je).describe("Failed task completions with error details."),
|
|
1065
1109
|
totalRequested: s.number().describe("The total number of tasks requested to complete."),
|
|
1066
1110
|
successCount: s.number().describe("The number of successfully completed tasks."),
|
|
1067
1111
|
failureCount: s.number().describe("The number of failed task completions.")
|
|
1068
|
-
},
|
|
1112
|
+
}, Ct = {
|
|
1069
1113
|
name: g.COMPLETE_TASKS,
|
|
1070
1114
|
description: "Complete one or more tasks by their IDs.",
|
|
1071
|
-
parameters:
|
|
1072
|
-
outputSchema:
|
|
1115
|
+
parameters: jt,
|
|
1116
|
+
outputSchema: vt,
|
|
1117
|
+
mutability: "mutating",
|
|
1073
1118
|
async execute(e, t) {
|
|
1074
1119
|
const o = [], n = [];
|
|
1075
1120
|
for (const i of e.ids)
|
|
@@ -1083,7 +1128,7 @@ const yt = {
|
|
|
1083
1128
|
});
|
|
1084
1129
|
}
|
|
1085
1130
|
return {
|
|
1086
|
-
textContent:
|
|
1131
|
+
textContent: St({
|
|
1087
1132
|
completed: o,
|
|
1088
1133
|
failures: n,
|
|
1089
1134
|
args: e
|
|
@@ -1098,12 +1143,12 @@ const yt = {
|
|
|
1098
1143
|
};
|
|
1099
1144
|
}
|
|
1100
1145
|
};
|
|
1101
|
-
function
|
|
1146
|
+
function St({
|
|
1102
1147
|
completed: e,
|
|
1103
1148
|
failures: t,
|
|
1104
1149
|
args: o
|
|
1105
1150
|
}) {
|
|
1106
|
-
return
|
|
1151
|
+
return mt({
|
|
1107
1152
|
action: "Completed tasks",
|
|
1108
1153
|
success: e.length,
|
|
1109
1154
|
total: o.ids.length,
|
|
@@ -1111,20 +1156,21 @@ function wt({
|
|
|
1111
1156
|
failures: t
|
|
1112
1157
|
});
|
|
1113
1158
|
}
|
|
1114
|
-
const
|
|
1159
|
+
const $t = {
|
|
1115
1160
|
type: s.enum(["project", "section", "task", "comment"]).describe("The type of entity to delete."),
|
|
1116
1161
|
id: s.string().min(1).describe("The ID of the entity to delete.")
|
|
1117
|
-
},
|
|
1162
|
+
}, Dt = {
|
|
1118
1163
|
deletedEntity: s.object({
|
|
1119
1164
|
type: s.enum(["project", "section", "task", "comment"]).describe("The type of deleted entity."),
|
|
1120
1165
|
id: s.string().describe("The ID of the deleted entity.")
|
|
1121
1166
|
}).describe("Information about the deleted entity."),
|
|
1122
1167
|
success: s.boolean().describe("Whether the deletion was successful.")
|
|
1123
|
-
},
|
|
1168
|
+
}, xt = {
|
|
1124
1169
|
name: g.DELETE_OBJECT,
|
|
1125
1170
|
description: "Delete a project, section, task, or comment by its ID.",
|
|
1126
|
-
parameters:
|
|
1127
|
-
outputSchema:
|
|
1171
|
+
parameters: $t,
|
|
1172
|
+
outputSchema: Dt,
|
|
1173
|
+
mutability: "mutating",
|
|
1128
1174
|
async execute(e, t) {
|
|
1129
1175
|
switch (e.type) {
|
|
1130
1176
|
case "project":
|
|
@@ -1148,21 +1194,22 @@ const jt = {
|
|
|
1148
1194
|
}
|
|
1149
1195
|
};
|
|
1150
1196
|
}
|
|
1151
|
-
},
|
|
1197
|
+
}, At = {
|
|
1152
1198
|
id: s.string().min(1).describe(
|
|
1153
1199
|
'A unique identifier for the document in the format "task:{id}" or "project:{id}".'
|
|
1154
1200
|
)
|
|
1155
|
-
},
|
|
1201
|
+
}, Ut = {
|
|
1156
1202
|
id: s.string().describe("The ID of the fetched document."),
|
|
1157
1203
|
title: s.string().describe("The title of the document."),
|
|
1158
1204
|
text: s.string().describe("The text content of the document."),
|
|
1159
1205
|
url: s.string().describe("The URL of the document."),
|
|
1160
1206
|
metadata: s.record(s.unknown()).optional().describe("Additional metadata about the document.")
|
|
1161
|
-
},
|
|
1207
|
+
}, Pt = {
|
|
1162
1208
|
name: g.FETCH,
|
|
1163
1209
|
description: 'Fetch the full contents of a task or project by its ID. The ID should be in the format "task:{id}" or "project:{id}".',
|
|
1164
|
-
parameters:
|
|
1165
|
-
outputSchema:
|
|
1210
|
+
parameters: At,
|
|
1211
|
+
outputSchema: Ut,
|
|
1212
|
+
mutability: "readonly",
|
|
1166
1213
|
async execute(e, t) {
|
|
1167
1214
|
const { id: o } = e, [n, r] = o.split(":", 2);
|
|
1168
1215
|
if (!r || n !== "task" && n !== "project")
|
|
@@ -1195,7 +1242,7 @@ Labels: ${a.labels.join(", ")}`), i = {
|
|
|
1195
1242
|
}
|
|
1196
1243
|
};
|
|
1197
1244
|
} else {
|
|
1198
|
-
const c = await t.getProject(r), a =
|
|
1245
|
+
const c = await t.getProject(r), a = we(c), d = [a.name];
|
|
1199
1246
|
a.isShared && d.push(`
|
|
1200
1247
|
|
|
1201
1248
|
Shared project`), a.isFavorite && d.push(`
|
|
@@ -1216,7 +1263,7 @@ Favorite: Yes`), i = {
|
|
|
1216
1263
|
}
|
|
1217
1264
|
return { textContent: JSON.stringify(i) };
|
|
1218
1265
|
}
|
|
1219
|
-
},
|
|
1266
|
+
}, Et = {
|
|
1220
1267
|
objectType: s.enum(["task", "project", "comment"]).optional().describe("Type of object to filter by."),
|
|
1221
1268
|
objectId: s.string().optional().describe("Filter by specific object ID (task, project, or comment)."),
|
|
1222
1269
|
eventType: s.enum([
|
|
@@ -1233,28 +1280,29 @@ Favorite: Yes`), i = {
|
|
|
1233
1280
|
projectId: s.string().optional().describe("Filter events by parent project ID."),
|
|
1234
1281
|
taskId: s.string().optional().describe("Filter events by parent task ID (for subtask events)."),
|
|
1235
1282
|
initiatorId: s.string().optional().describe("Filter by the user ID who initiated the event."),
|
|
1236
|
-
limit: s.number().int().min(1).max(
|
|
1283
|
+
limit: s.number().int().min(1).max(S.ACTIVITY_MAX).default(S.ACTIVITY_DEFAULT).describe("Maximum number of activity events to return."),
|
|
1237
1284
|
cursor: s.string().optional().describe("Pagination cursor for retrieving the next page of results.")
|
|
1238
|
-
},
|
|
1239
|
-
events: s.array(
|
|
1285
|
+
}, Ot = {
|
|
1286
|
+
events: s.array(Ge).describe("The activity events."),
|
|
1240
1287
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
1241
1288
|
totalCount: s.number().describe("The total number of events in this page."),
|
|
1242
1289
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
1243
1290
|
appliedFilters: s.record(s.unknown()).describe("The filters that were applied to the search.")
|
|
1244
|
-
},
|
|
1291
|
+
}, _t = {
|
|
1245
1292
|
name: g.FIND_ACTIVITY,
|
|
1246
1293
|
description: "Retrieve recent activity logs to monitor and audit changes in Todoist. Shows events from all users by default (use initiatorId to filter by specific user). Track task completions, updates, deletions, project changes, and more with flexible filtering. Note: Date-based filtering is not supported by the Todoist API.",
|
|
1247
|
-
parameters:
|
|
1248
|
-
outputSchema:
|
|
1294
|
+
parameters: Et,
|
|
1295
|
+
outputSchema: Ot,
|
|
1296
|
+
mutability: "readonly",
|
|
1249
1297
|
async execute(e, t) {
|
|
1250
1298
|
const { objectType: o, objectId: n, eventType: r, projectId: i, taskId: c, initiatorId: a, limit: d, cursor: l } = e, u = {
|
|
1251
1299
|
limit: d,
|
|
1252
1300
|
cursor: l ?? null
|
|
1253
1301
|
};
|
|
1254
1302
|
o && (u.objectType = o), n && n !== "remove" && (u.objectId = n), r && (u.eventType = r), i && (u.parentProjectId = i), c && (u.parentItemId = c), a && (u.initiatorId = a);
|
|
1255
|
-
const { results: p, nextCursor: b } = await t.getActivityLogs(u), m = p.map(
|
|
1303
|
+
const { results: p, nextCursor: b } = await t.getActivityLogs(u), m = p.map(ze);
|
|
1256
1304
|
return {
|
|
1257
|
-
textContent:
|
|
1305
|
+
textContent: Nt({ events: m, args: e, nextCursor: b }),
|
|
1258
1306
|
structuredContent: {
|
|
1259
1307
|
events: m,
|
|
1260
1308
|
nextCursor: b ?? void 0,
|
|
@@ -1265,7 +1313,7 @@ Favorite: Yes`), i = {
|
|
|
1265
1313
|
};
|
|
1266
1314
|
}
|
|
1267
1315
|
};
|
|
1268
|
-
function
|
|
1316
|
+
function Nt({
|
|
1269
1317
|
events: e,
|
|
1270
1318
|
args: t,
|
|
1271
1319
|
nextCursor: o
|
|
@@ -1286,12 +1334,12 @@ function Pt({
|
|
|
1286
1334
|
limit: t.limit,
|
|
1287
1335
|
nextCursor: o ?? void 0,
|
|
1288
1336
|
filterHints: i,
|
|
1289
|
-
previewLines:
|
|
1337
|
+
previewLines: Mt(e, Math.min(e.length, t.limit)),
|
|
1290
1338
|
zeroReasonHints: c
|
|
1291
1339
|
});
|
|
1292
1340
|
}
|
|
1293
|
-
function
|
|
1294
|
-
const n = e.slice(0, t).map(
|
|
1341
|
+
function Mt(e, t = 10) {
|
|
1342
|
+
const n = e.slice(0, t).map(Ft).join(`
|
|
1295
1343
|
`);
|
|
1296
1344
|
if (e.length > t) {
|
|
1297
1345
|
const r = e.length - t;
|
|
@@ -1300,8 +1348,8 @@ function Et(e, t = 10) {
|
|
|
1300
1348
|
}
|
|
1301
1349
|
return n;
|
|
1302
1350
|
}
|
|
1303
|
-
function
|
|
1304
|
-
const t =
|
|
1351
|
+
function Ft(e) {
|
|
1352
|
+
const t = Rt(e.eventDate), o = `${e.eventType} ${e.objectType}`;
|
|
1305
1353
|
let n = "";
|
|
1306
1354
|
if (e.extraData) {
|
|
1307
1355
|
const a = e.extraData.content || e.extraData.name || e.extraData.last_content;
|
|
@@ -1310,7 +1358,7 @@ function Ot(e) {
|
|
|
1310
1358
|
const r = e.objectId ? ` • id=${e.objectId}` : "", i = e.initiatorId ? ` • by=${e.initiatorId}` : " • system", c = e.parentProjectId ? ` • project=${e.parentProjectId}` : "";
|
|
1311
1359
|
return ` [${t}] ${o}${n}${r}${i}${c}`;
|
|
1312
1360
|
}
|
|
1313
|
-
function
|
|
1361
|
+
function Rt(e) {
|
|
1314
1362
|
try {
|
|
1315
1363
|
const t = new Date(e), o = t.toLocaleDateString("en-US", { month: "short", timeZone: "UTC" }), n = t.toLocaleDateString("en-US", { day: "numeric", timeZone: "UTC" }), r = t.toLocaleTimeString("en-US", {
|
|
1316
1364
|
hour: "2-digit",
|
|
@@ -1323,23 +1371,24 @@ function _t(e) {
|
|
|
1323
1371
|
return e;
|
|
1324
1372
|
}
|
|
1325
1373
|
}
|
|
1326
|
-
const
|
|
1374
|
+
const Lt = {
|
|
1327
1375
|
taskId: s.string().optional().describe("Find comments for a specific task."),
|
|
1328
1376
|
projectId: s.string().optional().describe(
|
|
1329
1377
|
'Find comments for a specific project. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
1330
1378
|
),
|
|
1331
1379
|
commentId: s.string().optional().describe("Get a specific comment by ID."),
|
|
1332
1380
|
cursor: s.string().optional().describe("Pagination cursor for retrieving more results."),
|
|
1333
|
-
limit: s.number().int().min(1).max(
|
|
1334
|
-
},
|
|
1381
|
+
limit: s.number().int().min(1).max(S.COMMENTS_MAX).optional().describe("Maximum number of comments to return")
|
|
1382
|
+
}, Bt = {
|
|
1335
1383
|
comments: s.array(re).describe("The found comments."),
|
|
1336
1384
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
1337
1385
|
totalCount: s.number().describe("The total number of comments in this page.")
|
|
1338
|
-
},
|
|
1386
|
+
}, Wt = {
|
|
1339
1387
|
name: g.FIND_COMMENTS,
|
|
1340
1388
|
description: "Find comments by task, project, or get a specific comment by ID. Exactly one of taskId, projectId, or commentId must be provided.",
|
|
1341
|
-
parameters:
|
|
1342
|
-
outputSchema:
|
|
1389
|
+
parameters: Lt,
|
|
1390
|
+
outputSchema: Bt,
|
|
1391
|
+
mutability: "readonly",
|
|
1343
1392
|
async execute(e, t) {
|
|
1344
1393
|
const o = [e.taskId, e.projectId, e.commentId].filter(Boolean);
|
|
1345
1394
|
if (o.length === 0)
|
|
@@ -1356,21 +1405,21 @@ const Nt = {
|
|
|
1356
1405
|
const l = await t.getComments({
|
|
1357
1406
|
taskId: e.taskId,
|
|
1358
1407
|
cursor: e.cursor || null,
|
|
1359
|
-
limit: e.limit ||
|
|
1408
|
+
limit: e.limit || S.COMMENTS_DEFAULT
|
|
1360
1409
|
});
|
|
1361
1410
|
c = l.results, r = l.nextCursor !== null, i = l.nextCursor;
|
|
1362
1411
|
} else if (n) {
|
|
1363
1412
|
const l = await t.getComments({
|
|
1364
1413
|
projectId: n,
|
|
1365
1414
|
cursor: e.cursor || null,
|
|
1366
|
-
limit: e.limit ||
|
|
1415
|
+
limit: e.limit || S.COMMENTS_DEFAULT
|
|
1367
1416
|
});
|
|
1368
1417
|
c = l.results, r = l.nextCursor !== null, i = l.nextCursor;
|
|
1369
1418
|
} else
|
|
1370
1419
|
throw new Error("Invalid state: no search parameter provided");
|
|
1371
1420
|
const a = c.map(te);
|
|
1372
1421
|
return {
|
|
1373
|
-
textContent:
|
|
1422
|
+
textContent: Yt({
|
|
1374
1423
|
comments: a,
|
|
1375
1424
|
searchType: e.commentId ? "single" : e.taskId ? "task" : "project",
|
|
1376
1425
|
searchId: e.commentId || e.taskId || e.projectId || "",
|
|
@@ -1388,7 +1437,7 @@ const Nt = {
|
|
|
1388
1437
|
};
|
|
1389
1438
|
}
|
|
1390
1439
|
};
|
|
1391
|
-
function
|
|
1440
|
+
function Yt({
|
|
1392
1441
|
comments: e,
|
|
1393
1442
|
searchType: t,
|
|
1394
1443
|
searchId: o,
|
|
@@ -1408,15 +1457,15 @@ function Rt({
|
|
|
1408
1457
|
i = `Found ${e.length} ${d} for ${t} ${o}${a}`, n && (i += " • More available");
|
|
1409
1458
|
}
|
|
1410
1459
|
if (r) {
|
|
1411
|
-
const c =
|
|
1460
|
+
const c = ve([], r);
|
|
1412
1461
|
return `${i}
|
|
1413
1462
|
${c}`;
|
|
1414
1463
|
}
|
|
1415
1464
|
return i;
|
|
1416
1465
|
}
|
|
1417
|
-
const
|
|
1466
|
+
const Ht = ["and", "or"], ae = {
|
|
1418
1467
|
labels: s.string().array().optional().describe("The labels to filter the tasks by"),
|
|
1419
|
-
labelsOperator: s.enum(
|
|
1468
|
+
labelsOperator: s.enum(Ht).optional().describe(
|
|
1420
1469
|
'The operator to use when filtering by labels. This will dictate whether a task has all labels, or some of them. Default is "or".'
|
|
1421
1470
|
)
|
|
1422
1471
|
};
|
|
@@ -1425,7 +1474,7 @@ function ce(e = [], t = "or") {
|
|
|
1425
1474
|
const o = t === "and" ? " & " : " | ";
|
|
1426
1475
|
return `(${e.map((i) => i.startsWith("@") ? i : `@${i}`).join(` ${o} `)})`;
|
|
1427
1476
|
}
|
|
1428
|
-
const
|
|
1477
|
+
const zt = {
|
|
1429
1478
|
getBy: s.enum(["completion", "due"]).default("completion").describe(
|
|
1430
1479
|
'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).'
|
|
1431
1480
|
),
|
|
@@ -1440,26 +1489,27 @@ const Bt = {
|
|
|
1440
1489
|
responsibleUser: s.string().optional().describe(
|
|
1441
1490
|
"Find tasks assigned to this user. Can be a user ID, name, or email address. Defaults to all collaborators when omitted."
|
|
1442
1491
|
),
|
|
1443
|
-
limit: s.number().int().min(1).max(
|
|
1492
|
+
limit: s.number().int().min(1).max(S.COMPLETED_TASKS_MAX).default(S.COMPLETED_TASKS_DEFAULT).describe("The maximum number of tasks to return."),
|
|
1444
1493
|
cursor: s.string().optional().describe(
|
|
1445
1494
|
"The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters)."
|
|
1446
1495
|
),
|
|
1447
1496
|
...ae
|
|
1448
|
-
},
|
|
1497
|
+
}, Kt = {
|
|
1449
1498
|
tasks: s.array(W).describe("The found completed tasks."),
|
|
1450
1499
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
1451
1500
|
totalCount: s.number().describe("The total number of tasks in this page."),
|
|
1452
1501
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
1453
1502
|
appliedFilters: s.record(s.unknown()).describe("The filters that were applied to the search.")
|
|
1454
|
-
},
|
|
1503
|
+
}, Vt = {
|
|
1455
1504
|
name: g.FIND_COMPLETED_TASKS,
|
|
1456
1505
|
description: "Get completed tasks (includes all collaborators by default—use responsibleUser to narrow).",
|
|
1457
|
-
parameters:
|
|
1458
|
-
outputSchema:
|
|
1506
|
+
parameters: zt,
|
|
1507
|
+
outputSchema: Kt,
|
|
1508
|
+
mutability: "readonly",
|
|
1459
1509
|
async execute(e, t) {
|
|
1460
1510
|
const { getBy: o, labels: n, labelsOperator: r, since: i, until: c, responsibleUser: a, projectId: d, ...l } = e, u = await ee(t, a), p = u?.email;
|
|
1461
1511
|
let m = ce(n, r);
|
|
1462
|
-
u && p && (m =
|
|
1512
|
+
u && p && (m = z(m, `assigned to: ${p}`));
|
|
1463
1513
|
const y = await t.getUser(), k = y.tzInfo?.gmtString || "+00:00", w = d === "inbox" ? y.inboxProjectId : d, D = `${i}T00:00:00${k}`, P = `${c}T23:59:59${k}`, h = new Date(D).toISOString(), T = new Date(P).toISOString(), { items: C, nextCursor: v } = o === "completion" ? await t.getCompletedTasksByCompletionDate({
|
|
1464
1514
|
...l,
|
|
1465
1515
|
projectId: w,
|
|
@@ -1474,7 +1524,7 @@ const Bt = {
|
|
|
1474
1524
|
...m ? { filterQuery: m, filterLang: "en" } : {}
|
|
1475
1525
|
}), f = C.map(O);
|
|
1476
1526
|
return {
|
|
1477
|
-
textContent:
|
|
1527
|
+
textContent: Gt({
|
|
1478
1528
|
tasks: f,
|
|
1479
1529
|
args: e,
|
|
1480
1530
|
nextCursor: v,
|
|
@@ -1490,7 +1540,7 @@ const Bt = {
|
|
|
1490
1540
|
};
|
|
1491
1541
|
}
|
|
1492
1542
|
};
|
|
1493
|
-
function
|
|
1543
|
+
function Gt({
|
|
1494
1544
|
tasks: e,
|
|
1495
1545
|
args: t,
|
|
1496
1546
|
nextCursor: o,
|
|
@@ -1512,17 +1562,17 @@ function zt({
|
|
|
1512
1562
|
limit: t.limit,
|
|
1513
1563
|
nextCursor: o ?? void 0,
|
|
1514
1564
|
filterHints: c,
|
|
1515
|
-
previewLines:
|
|
1565
|
+
previewLines: K(e, Math.min(e.length, t.limit)),
|
|
1516
1566
|
zeroReasonHints: a
|
|
1517
1567
|
});
|
|
1518
1568
|
}
|
|
1519
|
-
const { FIND_PROJECTS:
|
|
1569
|
+
const { FIND_PROJECTS: qt, ADD_TASKS: Ce, UPDATE_TASKS: Se } = g, Jt = {
|
|
1520
1570
|
projectId: s.string().min(1).describe("The ID of the project to search for collaborators in."),
|
|
1521
1571
|
searchTerm: s.string().optional().describe(
|
|
1522
1572
|
"Search for a collaborator by name or email (partial and case insensitive match). If omitted, all collaborators in the project are returned."
|
|
1523
1573
|
)
|
|
1524
|
-
},
|
|
1525
|
-
collaborators: s.array(
|
|
1574
|
+
}, Xt = {
|
|
1575
|
+
collaborators: s.array(qe).describe("The found collaborators."),
|
|
1526
1576
|
projectInfo: s.object({
|
|
1527
1577
|
id: s.string().describe("The project ID."),
|
|
1528
1578
|
name: s.string().describe("The project name."),
|
|
@@ -1531,11 +1581,12 @@ const { FIND_PROJECTS: Kt, ADD_TASKS: je, UPDATE_TASKS: ve } = g, Ht = {
|
|
|
1531
1581
|
totalCount: s.number().describe("The total number of collaborators found."),
|
|
1532
1582
|
totalAvailable: s.number().optional().describe("The total number of available collaborators in the project."),
|
|
1533
1583
|
appliedFilters: s.record(s.unknown()).describe("The filters that were applied to the search.")
|
|
1534
|
-
},
|
|
1584
|
+
}, Zt = {
|
|
1535
1585
|
name: g.FIND_PROJECT_COLLABORATORS,
|
|
1536
1586
|
description: "Search for collaborators by name or other criteria in a project.",
|
|
1537
|
-
parameters:
|
|
1538
|
-
outputSchema:
|
|
1587
|
+
parameters: Jt,
|
|
1588
|
+
outputSchema: Xt,
|
|
1589
|
+
mutability: "readonly",
|
|
1539
1590
|
async execute(e, t) {
|
|
1540
1591
|
const { projectId: o, searchTerm: n } = e;
|
|
1541
1592
|
let r = o, i;
|
|
@@ -1548,7 +1599,7 @@ const { FIND_PROJECTS: Kt, ADD_TASKS: je, UPDATE_TASKS: ve } = g, Ht = {
|
|
|
1548
1599
|
|
|
1549
1600
|
**Next steps:**
|
|
1550
1601
|
• Share the project to enable collaboration
|
|
1551
|
-
• Use ${
|
|
1602
|
+
• Use ${Ce} and ${Se} for assignment features once shared`,
|
|
1552
1603
|
structuredContent: {
|
|
1553
1604
|
collaborators: [],
|
|
1554
1605
|
projectInfo: {
|
|
@@ -1593,7 +1644,7 @@ const { FIND_PROJECTS: Kt, ADD_TASKS: je, UPDATE_TASKS: ve } = g, Ht = {
|
|
|
1593
1644
|
);
|
|
1594
1645
|
}
|
|
1595
1646
|
return {
|
|
1596
|
-
textContent:
|
|
1647
|
+
textContent: Qt({
|
|
1597
1648
|
collaborators: a,
|
|
1598
1649
|
projectName: r,
|
|
1599
1650
|
searchTerm: n,
|
|
@@ -1613,7 +1664,7 @@ const { FIND_PROJECTS: Kt, ADD_TASKS: je, UPDATE_TASKS: ve } = g, Ht = {
|
|
|
1613
1664
|
};
|
|
1614
1665
|
}
|
|
1615
1666
|
};
|
|
1616
|
-
function
|
|
1667
|
+
function Qt({
|
|
1617
1668
|
collaborators: e,
|
|
1618
1669
|
projectName: t,
|
|
1619
1670
|
searchTerm: o,
|
|
@@ -1629,7 +1680,7 @@ function qt({
|
|
|
1629
1680
|
const a = [];
|
|
1630
1681
|
e.length === 0 && (o ? (a.push(`No collaborators match "${o}"`), a.push("Try a broader search term or check spelling"), n > 0 && a.push(`${n} collaborators available without filter`)) : (a.push("Project has no collaborators"), a.push("Share the project to add collaborators")));
|
|
1631
1682
|
const d = [];
|
|
1632
|
-
return e.length > 0 ? (d.push(`Use ${
|
|
1683
|
+
return e.length > 0 ? (d.push(`Use ${Ce} with responsibleUser to assign new tasks`), d.push(`Use ${Se} with responsibleUser to reassign existing tasks`), d.push("Use collaborator names, emails, or IDs for assignments")) : (d.push(`Use ${qt} to find other projects`), o && n > 0 && d.push("Try searching without filters to see all collaborators")), N({
|
|
1633
1684
|
subject: r,
|
|
1634
1685
|
count: e.length,
|
|
1635
1686
|
filterHints: i,
|
|
@@ -1639,32 +1690,40 @@ function qt({
|
|
|
1639
1690
|
nextSteps: d
|
|
1640
1691
|
});
|
|
1641
1692
|
}
|
|
1642
|
-
const { ADD_PROJECTS:
|
|
1693
|
+
const { ADD_PROJECTS: es } = g, ts = {
|
|
1643
1694
|
search: s.string().optional().describe(
|
|
1644
1695
|
"Search for a project by name (partial and case insensitive match). If omitted, all projects are returned."
|
|
1645
1696
|
),
|
|
1646
|
-
limit: s.number().int().min(1).max(
|
|
1697
|
+
limit: s.number().int().min(1).max(S.PROJECTS_MAX).default(S.PROJECTS_DEFAULT).describe("The maximum number of projects to return."),
|
|
1647
1698
|
cursor: s.string().optional().describe(
|
|
1648
1699
|
"The cursor to get the next page of projects (cursor is obtained from the previous call to this tool, with the same parameters)."
|
|
1649
1700
|
)
|
|
1650
|
-
},
|
|
1701
|
+
}, ss = {
|
|
1651
1702
|
projects: s.array(oe).describe("The found projects."),
|
|
1652
1703
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
1653
1704
|
totalCount: s.number().describe("The total number of projects in this page."),
|
|
1654
1705
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
1655
1706
|
appliedFilters: s.record(s.unknown()).describe("The filters that were applied to the search.")
|
|
1656
|
-
},
|
|
1707
|
+
}, os = {
|
|
1657
1708
|
name: g.FIND_PROJECTS,
|
|
1658
|
-
description: "List all projects or search for projects by name.
|
|
1659
|
-
parameters:
|
|
1660
|
-
outputSchema:
|
|
1709
|
+
description: "List all projects or search for projects by name. When searching, all matching projects are returned (pagination is ignored). When not searching, projects are returned with pagination.",
|
|
1710
|
+
parameters: ts,
|
|
1711
|
+
outputSchema: ss,
|
|
1712
|
+
mutability: "readonly",
|
|
1661
1713
|
async execute(e, t) {
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1714
|
+
let o, n = null;
|
|
1715
|
+
if (e.search)
|
|
1716
|
+
o = await ke(t), n = null;
|
|
1717
|
+
else {
|
|
1718
|
+
const a = await t.getProjects({
|
|
1719
|
+
limit: e.limit,
|
|
1720
|
+
cursor: e.cursor ?? null
|
|
1721
|
+
});
|
|
1722
|
+
o = a.results, n = a.nextCursor;
|
|
1723
|
+
}
|
|
1724
|
+
const r = e.search ? e.search.toLowerCase() : void 0, c = (r ? o.filter((a) => a.name.toLowerCase().includes(r)) : o).map(we);
|
|
1666
1725
|
return {
|
|
1667
|
-
textContent:
|
|
1726
|
+
textContent: ns({ projects: c, args: e, nextCursor: n }),
|
|
1668
1727
|
structuredContent: {
|
|
1669
1728
|
projects: c,
|
|
1670
1729
|
nextCursor: n ?? void 0,
|
|
@@ -1675,17 +1734,17 @@ const { ADD_PROJECTS: Jt } = g, Xt = {
|
|
|
1675
1734
|
};
|
|
1676
1735
|
}
|
|
1677
1736
|
};
|
|
1678
|
-
function
|
|
1737
|
+
function ns({
|
|
1679
1738
|
projects: e,
|
|
1680
1739
|
args: t,
|
|
1681
1740
|
nextCursor: o
|
|
1682
1741
|
}) {
|
|
1683
|
-
const n = t.search ? `
|
|
1742
|
+
const n = t.search ? `All projects matching "${t.search}"` : "Projects", r = [];
|
|
1684
1743
|
t.search && r.push(`search: "${t.search}"`);
|
|
1685
|
-
const i = 10, a = e.slice(0, i).map(
|
|
1744
|
+
const i = 10, a = e.slice(0, i).map(bt).join(`
|
|
1686
1745
|
`), d = e.length - i, l = d > 0 ? `${a}
|
|
1687
1746
|
…and ${d} more` : a, u = [];
|
|
1688
|
-
return e.length === 0 && (t.search ? (u.push("Try broader search terms"), u.push("Check spelling"), u.push("Remove search to see all projects")) : (u.push("No projects created yet"), u.push(`Use ${
|
|
1747
|
+
return e.length === 0 && (t.search ? (u.push("Try broader search terms"), u.push("Check spelling"), u.push("Remove search to see all projects")) : (u.push("No projects created yet"), u.push(`Use ${es} to create a project`))), N({
|
|
1689
1748
|
subject: n,
|
|
1690
1749
|
count: e.length,
|
|
1691
1750
|
limit: t.limit,
|
|
@@ -1695,28 +1754,32 @@ function es({
|
|
|
1695
1754
|
zeroReasonHints: u
|
|
1696
1755
|
});
|
|
1697
1756
|
}
|
|
1698
|
-
const { ADD_SECTIONS:
|
|
1757
|
+
const { ADD_SECTIONS: rs } = g, is = {
|
|
1699
1758
|
projectId: s.string().min(1).describe(
|
|
1700
1759
|
'The ID of the project to search sections in. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
1701
1760
|
),
|
|
1702
1761
|
search: s.string().optional().describe(
|
|
1703
1762
|
"Search for a section by name (partial and case insensitive match). If omitted, all sections in the project are returned."
|
|
1704
1763
|
)
|
|
1705
|
-
},
|
|
1764
|
+
}, as = {
|
|
1706
1765
|
sections: s.array(ne).describe("The found sections."),
|
|
1707
1766
|
totalCount: s.number().describe("The total number of sections found."),
|
|
1708
1767
|
appliedFilters: s.record(s.unknown()).describe("The filters that were applied to the search.")
|
|
1709
|
-
},
|
|
1768
|
+
}, cs = {
|
|
1710
1769
|
name: g.FIND_SECTIONS,
|
|
1711
|
-
description: "Search for sections by name or other criteria in a project.",
|
|
1712
|
-
parameters:
|
|
1713
|
-
outputSchema:
|
|
1770
|
+
description: "Search for sections by name or other criteria in a project. When searching, all sections in the project are fetched to ensure complete results.",
|
|
1771
|
+
parameters: is,
|
|
1772
|
+
outputSchema: as,
|
|
1773
|
+
mutability: "readonly",
|
|
1714
1774
|
async execute(e, t) {
|
|
1715
|
-
const o = e.projectId === "inbox" ? (await t.getUser()).inboxProjectId : e.projectId
|
|
1775
|
+
const o = e.projectId === "inbox" ? (await t.getUser()).inboxProjectId : e.projectId;
|
|
1776
|
+
let n;
|
|
1777
|
+
e.search ? n = await Ye(t, o) : n = (await t.getSections({
|
|
1716
1778
|
projectId: o
|
|
1717
|
-
})
|
|
1779
|
+
})).results;
|
|
1780
|
+
const r = e.search ? e.search.toLowerCase() : void 0, c = (r ? n.filter((d) => d.name.toLowerCase().includes(r)) : n).map(({ id: d, name: l }) => ({ id: d, name: l }));
|
|
1718
1781
|
return {
|
|
1719
|
-
textContent:
|
|
1782
|
+
textContent: ds({
|
|
1720
1783
|
sections: c,
|
|
1721
1784
|
projectId: e.projectId,
|
|
1722
1785
|
search: e.search
|
|
@@ -1729,13 +1792,13 @@ const { ADD_SECTIONS: ts } = g, ss = {
|
|
|
1729
1792
|
};
|
|
1730
1793
|
}
|
|
1731
1794
|
};
|
|
1732
|
-
function
|
|
1795
|
+
function ds({
|
|
1733
1796
|
sections: e,
|
|
1734
1797
|
projectId: t,
|
|
1735
1798
|
search: o
|
|
1736
1799
|
}) {
|
|
1737
1800
|
const n = [];
|
|
1738
|
-
o ? (n.push("Try broader search terms"), n.push("Check spelling"), n.push("Remove search to see all sections")) : (n.push("Project has no sections yet"), n.push(`Use ${
|
|
1801
|
+
o ? (n.push("Try broader search terms"), n.push("Check spelling"), n.push("Remove search to see all sections")) : (n.push("Project has no sections yet"), n.push(`Use ${rs} to create sections`));
|
|
1739
1802
|
const r = o ? `Sections in project ${t} matching "${o}"` : `Sections in project ${t}`, i = e.length > 0 ? e.map((c) => ` ${c.name} • id=${c.id}`).join(`
|
|
1740
1803
|
`) : void 0;
|
|
1741
1804
|
return N({
|
|
@@ -1745,7 +1808,7 @@ function rs({
|
|
|
1745
1808
|
zeroReasonHints: n
|
|
1746
1809
|
});
|
|
1747
1810
|
}
|
|
1748
|
-
const { FIND_COMPLETED_TASKS: le, ADD_TASKS: ue } = g,
|
|
1811
|
+
const { FIND_COMPLETED_TASKS: le, ADD_TASKS: ue } = g, ls = {
|
|
1749
1812
|
searchText: s.string().optional().describe("The text to search for in tasks."),
|
|
1750
1813
|
projectId: s.string().optional().describe(
|
|
1751
1814
|
'Find tasks in this project. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
@@ -1756,22 +1819,23 @@ const { FIND_COMPLETED_TASKS: le, ADD_TASKS: ue } = g, is = {
|
|
|
1756
1819
|
responsibleUserFiltering: s.enum(ye).optional().describe(
|
|
1757
1820
|
'How to filter by responsible user when responsibleUser is not provided. "assigned" = only tasks assigned to others; "unassignedOrMe" = only unassigned tasks or tasks assigned to me; "all" = all tasks regardless of assignment. Default value will be `unassignedOrMe`.'
|
|
1758
1821
|
),
|
|
1759
|
-
limit: s.number().int().min(1).max(
|
|
1822
|
+
limit: s.number().int().min(1).max(S.TASKS_MAX).default(S.TASKS_DEFAULT).describe("The maximum number of tasks to return."),
|
|
1760
1823
|
cursor: s.string().optional().describe(
|
|
1761
1824
|
"The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters)."
|
|
1762
1825
|
),
|
|
1763
1826
|
...ae
|
|
1764
|
-
},
|
|
1827
|
+
}, us = {
|
|
1765
1828
|
tasks: s.array(W).describe("The found tasks."),
|
|
1766
1829
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
1767
1830
|
totalCount: s.number().describe("The total number of tasks in this page."),
|
|
1768
1831
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
1769
1832
|
appliedFilters: s.record(s.unknown()).describe("The filters that were applied to the search.")
|
|
1770
|
-
},
|
|
1833
|
+
}, ps = {
|
|
1771
1834
|
name: g.FIND_TASKS,
|
|
1772
1835
|
description: "Find tasks by text search, or by project/section/parent container/responsible user. At least one filter must be provided.",
|
|
1773
|
-
parameters:
|
|
1774
|
-
outputSchema:
|
|
1836
|
+
parameters: ls,
|
|
1837
|
+
outputSchema: us,
|
|
1838
|
+
mutability: "readonly",
|
|
1775
1839
|
async execute(e, t) {
|
|
1776
1840
|
const {
|
|
1777
1841
|
searchText: o,
|
|
@@ -1796,7 +1860,7 @@ const { FIND_COMPLETED_TASKS: le, ADD_TASKS: ue } = g, is = {
|
|
|
1796
1860
|
cursor: l ?? null
|
|
1797
1861
|
};
|
|
1798
1862
|
n && (f.projectId = n === "inbox" ? b.inboxProjectId : n), r && (f.sectionId = r), i && (f.parentId = i);
|
|
1799
|
-
const { results: j, nextCursor:
|
|
1863
|
+
const { results: j, nextCursor: $ } = await t.getTasks(f), x = j.map(O);
|
|
1800
1864
|
let E = o ? x.filter(
|
|
1801
1865
|
(M) => M.content.toLowerCase().includes(o.toLowerCase()) || M.description?.toLowerCase().includes(o.toLowerCase())
|
|
1802
1866
|
) : x;
|
|
@@ -1813,15 +1877,15 @@ const { FIND_COMPLETED_TASKS: le, ADD_TASKS: ue } = g, is = {
|
|
|
1813
1877
|
textContent: J({
|
|
1814
1878
|
tasks: E,
|
|
1815
1879
|
args: e,
|
|
1816
|
-
nextCursor:
|
|
1880
|
+
nextCursor: $,
|
|
1817
1881
|
isContainerSearch: !0,
|
|
1818
1882
|
assigneeEmail: w
|
|
1819
1883
|
}),
|
|
1820
1884
|
structuredContent: {
|
|
1821
1885
|
tasks: E,
|
|
1822
|
-
nextCursor:
|
|
1886
|
+
nextCursor: $ ?? void 0,
|
|
1823
1887
|
totalCount: E.length,
|
|
1824
|
-
hasMore:
|
|
1888
|
+
hasMore: !!$,
|
|
1825
1889
|
appliedFilters: e
|
|
1826
1890
|
}
|
|
1827
1891
|
};
|
|
@@ -1832,19 +1896,19 @@ const { FIND_COMPLETED_TASKS: le, ADD_TASKS: ue } = g, is = {
|
|
|
1832
1896
|
lang: "en",
|
|
1833
1897
|
limit: d,
|
|
1834
1898
|
cursor: l ?? null
|
|
1835
|
-
}),
|
|
1899
|
+
}), $ = f.map(O);
|
|
1836
1900
|
return {
|
|
1837
1901
|
textContent: J({
|
|
1838
|
-
tasks:
|
|
1902
|
+
tasks: $,
|
|
1839
1903
|
args: e,
|
|
1840
1904
|
nextCursor: j,
|
|
1841
1905
|
isContainerSearch: !1,
|
|
1842
1906
|
assigneeEmail: w
|
|
1843
1907
|
}),
|
|
1844
1908
|
structuredContent: {
|
|
1845
|
-
tasks:
|
|
1909
|
+
tasks: $,
|
|
1846
1910
|
nextCursor: j ?? void 0,
|
|
1847
|
-
totalCount:
|
|
1911
|
+
totalCount: $.length,
|
|
1848
1912
|
hasMore: !!j,
|
|
1849
1913
|
appliedFilters: e
|
|
1850
1914
|
}
|
|
@@ -1853,7 +1917,7 @@ const { FIND_COMPLETED_TASKS: le, ADD_TASKS: ue } = g, is = {
|
|
|
1853
1917
|
let D = "";
|
|
1854
1918
|
o && (D = `search: ${o}`);
|
|
1855
1919
|
const P = ce(u, p);
|
|
1856
|
-
D =
|
|
1920
|
+
D = z(D, P);
|
|
1857
1921
|
const { tasks: h, nextCursor: T } = await se({
|
|
1858
1922
|
client: t,
|
|
1859
1923
|
query: D,
|
|
@@ -1883,7 +1947,7 @@ const { FIND_COMPLETED_TASKS: le, ADD_TASKS: ue } = g, is = {
|
|
|
1883
1947
|
};
|
|
1884
1948
|
}
|
|
1885
1949
|
};
|
|
1886
|
-
function
|
|
1950
|
+
function hs(e) {
|
|
1887
1951
|
if (e.projectId) {
|
|
1888
1952
|
const t = [
|
|
1889
1953
|
e.searchText ? "No tasks in project match search" : "Project has no tasks yet"
|
|
@@ -1918,7 +1982,7 @@ function J({
|
|
|
1918
1982
|
const d = t.labels.map((l) => `@${l}`).join(t.labelsOperator === "and" ? " & " : " | ");
|
|
1919
1983
|
c.push(`labels: ${d}`);
|
|
1920
1984
|
}
|
|
1921
|
-
e.length === 0 && a.push(...
|
|
1985
|
+
e.length === 0 && a.push(...hs(t));
|
|
1922
1986
|
} else {
|
|
1923
1987
|
const d = r || t.responsibleUser, l = [];
|
|
1924
1988
|
if (t.searchText && l.push(`"${t.searchText}"`), t.responsibleUser && l.push(`assigned to ${d}`), t.labels && t.labels.length > 0) {
|
|
@@ -1943,11 +2007,11 @@ function J({
|
|
|
1943
2007
|
limit: t.limit,
|
|
1944
2008
|
nextCursor: o ?? void 0,
|
|
1945
2009
|
filterHints: c,
|
|
1946
|
-
previewLines:
|
|
2010
|
+
previewLines: K(e, Math.min(e.length, t.limit)),
|
|
1947
2011
|
zeroReasonHints: a
|
|
1948
2012
|
});
|
|
1949
2013
|
}
|
|
1950
|
-
const
|
|
2014
|
+
const ms = {
|
|
1951
2015
|
startDate: s.string().regex(/^(\d{4}-\d{2}-\d{2}|today)$/).optional().describe("The start date to get the tasks for. Format: YYYY-MM-DD or 'today'."),
|
|
1952
2016
|
overdueOption: s.enum(["overdue-only", "include-overdue", "exclude-overdue"]).optional().describe(
|
|
1953
2017
|
"How to handle overdue tasks. 'overdue-only' to get only overdue tasks, 'include-overdue' to include overdue tasks along with tasks for the specified date(s), and 'exclude-overdue' to exclude overdue tasks. Default is 'include-overdue'."
|
|
@@ -1955,7 +2019,7 @@ const ls = {
|
|
|
1955
2019
|
daysCount: s.number().int().min(1).max(30).default(1).describe(
|
|
1956
2020
|
"The number of days to get the tasks for, starting from the start date. Default is 1 which means only tasks for the start date."
|
|
1957
2021
|
),
|
|
1958
|
-
limit: s.number().int().min(1).max(
|
|
2022
|
+
limit: s.number().int().min(1).max(S.TASKS_MAX).default(S.TASKS_DEFAULT).describe("The maximum number of tasks to return."),
|
|
1959
2023
|
cursor: s.string().optional().describe(
|
|
1960
2024
|
"The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters)."
|
|
1961
2025
|
),
|
|
@@ -1964,17 +2028,18 @@ const ls = {
|
|
|
1964
2028
|
'How to filter by responsible user when responsibleUser is not provided. "assigned" = only tasks assigned to others; "unassignedOrMe" = only unassigned tasks or tasks assigned to me; "all" = all tasks regardless of assignment. Default is "unassignedOrMe".'
|
|
1965
2029
|
),
|
|
1966
2030
|
...ae
|
|
1967
|
-
},
|
|
2031
|
+
}, fs = {
|
|
1968
2032
|
tasks: s.array(W).describe("The found tasks."),
|
|
1969
2033
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
1970
2034
|
totalCount: s.number().describe("The total number of tasks in this page."),
|
|
1971
2035
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
1972
2036
|
appliedFilters: s.record(s.unknown()).describe("The filters that were applied to the search.")
|
|
1973
|
-
},
|
|
2037
|
+
}, bs = {
|
|
1974
2038
|
name: g.FIND_TASKS_BY_DATE,
|
|
1975
2039
|
description: "Get tasks by date range. Use startDate 'today' to get today's tasks including overdue items, or provide a specific date/date range.",
|
|
1976
|
-
parameters:
|
|
1977
|
-
outputSchema:
|
|
2040
|
+
parameters: ms,
|
|
2041
|
+
outputSchema: fs,
|
|
2042
|
+
mutability: "readonly",
|
|
1978
2043
|
async execute(e, t) {
|
|
1979
2044
|
if (!e.startDate && e.overdueOption !== "overdue-only")
|
|
1980
2045
|
throw new Error(
|
|
@@ -1987,17 +2052,17 @@ const ls = {
|
|
|
1987
2052
|
else if (e.startDate === "today")
|
|
1988
2053
|
i = e.overdueOption === "exclude-overdue" ? "today" : "(today | overdue)";
|
|
1989
2054
|
else if (e.startDate) {
|
|
1990
|
-
const p = e.startDate, b = be(p, e.daysCount), m =
|
|
2055
|
+
const p = e.startDate, b = be(p, e.daysCount), m = Pe(b, { representation: "date" });
|
|
1991
2056
|
i = `(due after: ${p} | due: ${p}) & due before: ${m}`;
|
|
1992
2057
|
}
|
|
1993
2058
|
const c = ce(e.labels, e.labelsOperator);
|
|
1994
|
-
c.length > 0 && (i =
|
|
1995
|
-
const a =
|
|
2059
|
+
c.length > 0 && (i = z(i, `(${c})`));
|
|
2060
|
+
const a = We({
|
|
1996
2061
|
resolvedAssigneeId: n,
|
|
1997
2062
|
assigneeEmail: r,
|
|
1998
2063
|
responsibleUserFiltering: e.responsibleUserFiltering
|
|
1999
2064
|
});
|
|
2000
|
-
i =
|
|
2065
|
+
i = z(i, a);
|
|
2001
2066
|
const { tasks: d, nextCursor: l } = await se({
|
|
2002
2067
|
client: t,
|
|
2003
2068
|
query: i,
|
|
@@ -2005,7 +2070,7 @@ const ls = {
|
|
|
2005
2070
|
limit: e.limit
|
|
2006
2071
|
});
|
|
2007
2072
|
return {
|
|
2008
|
-
textContent:
|
|
2073
|
+
textContent: gs({ tasks: d, args: e, nextCursor: l, assigneeEmail: r }),
|
|
2009
2074
|
structuredContent: {
|
|
2010
2075
|
tasks: d,
|
|
2011
2076
|
nextCursor: l ?? void 0,
|
|
@@ -2016,7 +2081,7 @@ const ls = {
|
|
|
2016
2081
|
};
|
|
2017
2082
|
}
|
|
2018
2083
|
};
|
|
2019
|
-
function
|
|
2084
|
+
function gs({
|
|
2020
2085
|
tasks: e,
|
|
2021
2086
|
args: t,
|
|
2022
2087
|
nextCursor: o,
|
|
@@ -2031,7 +2096,7 @@ function hs({
|
|
|
2031
2096
|
`today${a}${t.daysCount > 1 ? ` + ${t.daysCount - 1} more days` : ""}`
|
|
2032
2097
|
);
|
|
2033
2098
|
} else if (t.startDate) {
|
|
2034
|
-
const a = t.daysCount > 1 ? ` to ${
|
|
2099
|
+
const a = t.daysCount > 1 ? ` to ${ht(be(t.startDate, t.daysCount))}` : "";
|
|
2035
2100
|
r.push(`${t.startDate}${a}`);
|
|
2036
2101
|
}
|
|
2037
2102
|
if (t.labels && t.labels.length > 0) {
|
|
@@ -2062,15 +2127,15 @@ function hs({
|
|
|
2062
2127
|
limit: t.limit,
|
|
2063
2128
|
nextCursor: o ?? void 0,
|
|
2064
2129
|
filterHints: r,
|
|
2065
|
-
previewLines:
|
|
2130
|
+
previewLines: K(e, Math.min(e.length, t.limit)),
|
|
2066
2131
|
zeroReasonHints: c
|
|
2067
2132
|
});
|
|
2068
2133
|
}
|
|
2069
|
-
const
|
|
2134
|
+
const Ts = {
|
|
2070
2135
|
projectId: s.string().min(1).optional().describe(
|
|
2071
2136
|
"Optional project ID. If provided, shows detailed overview of that project. If omitted, shows overview of all projects."
|
|
2072
2137
|
)
|
|
2073
|
-
},
|
|
2138
|
+
}, ys = {
|
|
2074
2139
|
type: s.enum(["account_overview", "project_overview"]).describe("The type of overview returned."),
|
|
2075
2140
|
totalProjects: s.number().optional().describe("Total number of projects (account overview only)."),
|
|
2076
2141
|
totalTasks: s.number().optional().describe("Total number of tasks."),
|
|
@@ -2091,7 +2156,7 @@ const ms = {
|
|
|
2091
2156
|
tasks: s.array(s.any()).optional().describe("List of tasks (project overview only)."),
|
|
2092
2157
|
stats: s.any().optional().describe("Statistics object (project overview only).")
|
|
2093
2158
|
};
|
|
2094
|
-
function
|
|
2159
|
+
function Is(e) {
|
|
2095
2160
|
const t = {};
|
|
2096
2161
|
for (const r of e)
|
|
2097
2162
|
t[r.id] = {
|
|
@@ -2116,7 +2181,7 @@ function bs(e) {
|
|
|
2116
2181
|
}
|
|
2117
2182
|
return n(o), o;
|
|
2118
2183
|
}
|
|
2119
|
-
async function
|
|
2184
|
+
async function ks(e, t) {
|
|
2120
2185
|
const o = {};
|
|
2121
2186
|
return await Promise.all(
|
|
2122
2187
|
t.map(async (n) => {
|
|
@@ -2125,14 +2190,14 @@ async function gs(e, t) {
|
|
|
2125
2190
|
})
|
|
2126
2191
|
), o;
|
|
2127
2192
|
}
|
|
2128
|
-
function
|
|
2193
|
+
function $e(e, t, o = "") {
|
|
2129
2194
|
const n = [];
|
|
2130
2195
|
n.push(`${o}- Project: ${e.name} (id=${e.id})`);
|
|
2131
2196
|
const r = t[e.id] || [];
|
|
2132
2197
|
for (const i of r)
|
|
2133
2198
|
n.push(`${o} - Section: ${i.name} (id=${i.id})`);
|
|
2134
2199
|
for (const i of e.children)
|
|
2135
|
-
n.push(
|
|
2200
|
+
n.push(...$e(i, t, `${o} `));
|
|
2136
2201
|
return n;
|
|
2137
2202
|
}
|
|
2138
2203
|
function pe(e) {
|
|
@@ -2160,33 +2225,33 @@ function Z(e, t = "") {
|
|
|
2160
2225
|
}
|
|
2161
2226
|
return o;
|
|
2162
2227
|
}
|
|
2163
|
-
function
|
|
2228
|
+
function De(e, t) {
|
|
2164
2229
|
return {
|
|
2165
2230
|
id: e.id,
|
|
2166
2231
|
name: e.name,
|
|
2167
2232
|
parentId: B(e) ? e.parentId ?? null : null,
|
|
2168
2233
|
sections: t[e.id] || [],
|
|
2169
|
-
children: e.children.map((o) =>
|
|
2234
|
+
children: e.children.map((o) => De(o, t))
|
|
2170
2235
|
};
|
|
2171
2236
|
}
|
|
2172
|
-
async function
|
|
2237
|
+
async function ws(e, t) {
|
|
2173
2238
|
let o = [], n;
|
|
2174
2239
|
do {
|
|
2175
2240
|
const { results: r, nextCursor: i } = await e.getTasks({
|
|
2176
2241
|
projectId: t,
|
|
2177
|
-
limit:
|
|
2242
|
+
limit: S.TASKS_BATCH_SIZE,
|
|
2178
2243
|
cursor: n ?? void 0
|
|
2179
2244
|
});
|
|
2180
2245
|
o = o.concat(r.map(O)), n = i ?? void 0;
|
|
2181
2246
|
} while (n);
|
|
2182
2247
|
return o;
|
|
2183
2248
|
}
|
|
2184
|
-
async function
|
|
2249
|
+
async function js(e, t) {
|
|
2185
2250
|
const { results: o } = await e.getSections({ projectId: t });
|
|
2186
2251
|
return o;
|
|
2187
2252
|
}
|
|
2188
|
-
async function
|
|
2189
|
-
const { results: t } = await e.getProjects({}), o = t.find((p) => B(p) && p.inboxProject === !0), n = t.filter((p) => !B(p) || p.inboxProject !== !0), r =
|
|
2253
|
+
async function vs(e) {
|
|
2254
|
+
const { results: t } = await e.getProjects({}), o = t.find((p) => B(p) && p.inboxProject === !0), n = t.filter((p) => !B(p) || p.inboxProject !== !0), r = Is(n), i = t.map((p) => p.id), c = await ks(e, i), a = ["# Personal Projects", ""];
|
|
2190
2255
|
if (o) {
|
|
2191
2256
|
a.push(`- Inbox Project: ${o.name} (id=${o.id})`);
|
|
2192
2257
|
for (const p of c[o.id] || [])
|
|
@@ -2194,7 +2259,7 @@ async function Is(e) {
|
|
|
2194
2259
|
}
|
|
2195
2260
|
if (r.length)
|
|
2196
2261
|
for (const p of r)
|
|
2197
|
-
a.push(
|
|
2262
|
+
a.push(...$e(p, c));
|
|
2198
2263
|
else
|
|
2199
2264
|
a.push("_No projects found._");
|
|
2200
2265
|
a.push("");
|
|
@@ -2212,7 +2277,7 @@ async function Is(e) {
|
|
|
2212
2277
|
sections: c[o.id] || []
|
|
2213
2278
|
} : null,
|
|
2214
2279
|
projects: r.map(
|
|
2215
|
-
(p) =>
|
|
2280
|
+
(p) => De(p, c)
|
|
2216
2281
|
),
|
|
2217
2282
|
totalProjects: t.length,
|
|
2218
2283
|
totalSections: i.reduce(
|
|
@@ -2223,8 +2288,8 @@ async function Is(e) {
|
|
|
2223
2288
|
};
|
|
2224
2289
|
return { textContent: l, structuredContent: u };
|
|
2225
2290
|
}
|
|
2226
|
-
async function
|
|
2227
|
-
const o = await e.getProject(t), n = await
|
|
2291
|
+
async function Cs(e, t) {
|
|
2292
|
+
const o = await e.getProject(t), n = await js(e, t), r = await ws(e, t), i = {};
|
|
2228
2293
|
for (const u of n)
|
|
2229
2294
|
i[u.id] = [];
|
|
2230
2295
|
const c = [];
|
|
@@ -2265,21 +2330,22 @@ async function ks(e, t) {
|
|
|
2265
2330
|
};
|
|
2266
2331
|
return { textContent: d, structuredContent: l };
|
|
2267
2332
|
}
|
|
2268
|
-
const
|
|
2333
|
+
const Ss = {
|
|
2269
2334
|
name: g.GET_OVERVIEW,
|
|
2270
2335
|
description: "Get a Markdown overview. If no projectId is provided, shows all projects with hierarchy and sections (useful for navigation). If projectId is provided, shows detailed overview of that specific project including all tasks grouped by sections.",
|
|
2271
|
-
parameters:
|
|
2272
|
-
outputSchema:
|
|
2336
|
+
parameters: Ts,
|
|
2337
|
+
outputSchema: ys,
|
|
2338
|
+
mutability: "readonly",
|
|
2273
2339
|
async execute(e, t) {
|
|
2274
|
-
const o = e.projectId ? await
|
|
2340
|
+
const o = e.projectId ? await Cs(t, e.projectId) : await vs(t);
|
|
2275
2341
|
return {
|
|
2276
2342
|
textContent: o.textContent,
|
|
2277
2343
|
structuredContent: o.structuredContent
|
|
2278
2344
|
};
|
|
2279
2345
|
}
|
|
2280
|
-
}, { FIND_TASKS:
|
|
2346
|
+
}, { FIND_TASKS: $s, FIND_PROJECT_COLLABORATORS: he, UPDATE_TASKS: Ds } = g, xs = 50, As = {
|
|
2281
2347
|
operation: s.enum(["assign", "unassign", "reassign"]).describe("The assignment operation to perform."),
|
|
2282
|
-
taskIds: s.array(s.string()).min(1).max(
|
|
2348
|
+
taskIds: s.array(s.string()).min(1).max(xs).describe("The IDs of the tasks to operate on (max 50)."),
|
|
2283
2349
|
responsibleUser: s.string().optional().describe(
|
|
2284
2350
|
"The user to assign tasks to. Can be user ID, name, or email. Required for assign and reassign operations."
|
|
2285
2351
|
),
|
|
@@ -2287,7 +2353,7 @@ const ws = {
|
|
|
2287
2353
|
"For reassign operations: the current assignee to reassign from. Can be user ID, name, or email. Optional - if not provided, reassigns from any current assignee."
|
|
2288
2354
|
),
|
|
2289
2355
|
dryRun: s.boolean().optional().default(!1).describe("If true, validates operations without executing them.")
|
|
2290
|
-
},
|
|
2356
|
+
}, Us = {
|
|
2291
2357
|
results: s.array(
|
|
2292
2358
|
s.object({
|
|
2293
2359
|
taskId: s.string().describe("The ID of the task."),
|
|
@@ -2303,11 +2369,12 @@ const ws = {
|
|
|
2303
2369
|
failed: s.number().describe("Number of failed operations."),
|
|
2304
2370
|
dryRun: s.boolean().describe("Whether this was a dry run.")
|
|
2305
2371
|
}).optional().describe("Summary of the operation.")
|
|
2306
|
-
},
|
|
2372
|
+
}, Ps = {
|
|
2307
2373
|
name: g.MANAGE_ASSIGNMENTS,
|
|
2308
2374
|
description: "Bulk assignment operations for multiple tasks. Supports assign, unassign, and reassign operations with atomic rollback on failures.",
|
|
2309
|
-
parameters:
|
|
2310
|
-
outputSchema:
|
|
2375
|
+
parameters: As,
|
|
2376
|
+
outputSchema: Us,
|
|
2377
|
+
mutability: "mutating",
|
|
2311
2378
|
async execute(e, t) {
|
|
2312
2379
|
const { operation: o, taskIds: n, responsibleUser: r, fromAssigneeUser: i, dryRun: c } = e;
|
|
2313
2380
|
if ((o === "assign" || o === "reassign") && !r)
|
|
@@ -2361,10 +2428,10 @@ const ws = {
|
|
|
2361
2428
|
});
|
|
2362
2429
|
if (o === "unassign") {
|
|
2363
2430
|
if (c) {
|
|
2364
|
-
const f = d.map((
|
|
2365
|
-
taskId:
|
|
2431
|
+
const f = d.map(($) => ({
|
|
2432
|
+
taskId: $.id,
|
|
2366
2433
|
success: !0,
|
|
2367
|
-
originalAssigneeId:
|
|
2434
|
+
originalAssigneeId: $.responsibleUid ?? void 0,
|
|
2368
2435
|
newAssigneeId: void 0
|
|
2369
2436
|
}));
|
|
2370
2437
|
return {
|
|
@@ -2434,7 +2501,7 @@ const ws = {
|
|
|
2434
2501
|
);
|
|
2435
2502
|
if (!T)
|
|
2436
2503
|
return C.map(({ assignment: f, validation: j }) => {
|
|
2437
|
-
const
|
|
2504
|
+
const $ = d.find((x) => x.id === f.taskId);
|
|
2438
2505
|
if (!f.taskId || !j.resolvedUser?.userId)
|
|
2439
2506
|
throw new Error(
|
|
2440
2507
|
"Invalid assignment or validation data - this should not happen"
|
|
@@ -2442,19 +2509,19 @@ const ws = {
|
|
|
2442
2509
|
return {
|
|
2443
2510
|
taskId: f.taskId,
|
|
2444
2511
|
success: !0,
|
|
2445
|
-
originalAssigneeId:
|
|
2512
|
+
originalAssigneeId: $?.responsibleUid ?? void 0,
|
|
2446
2513
|
newAssigneeId: j.resolvedUser.userId
|
|
2447
2514
|
};
|
|
2448
2515
|
});
|
|
2449
2516
|
const v = C.map(
|
|
2450
2517
|
async ({ assignment: f, validation: j }) => {
|
|
2451
|
-
const
|
|
2518
|
+
const $ = d.find((x) => x.id === f.taskId);
|
|
2452
2519
|
if (!f.taskId || !j.resolvedUser?.userId)
|
|
2453
2520
|
return {
|
|
2454
2521
|
taskId: f.taskId || "unknown-task",
|
|
2455
2522
|
success: !1,
|
|
2456
2523
|
error: "Invalid assignment data - missing task ID or resolved user",
|
|
2457
|
-
originalAssigneeId:
|
|
2524
|
+
originalAssigneeId: $?.responsibleUid ?? void 0
|
|
2458
2525
|
};
|
|
2459
2526
|
try {
|
|
2460
2527
|
return await t.updateTask(f.taskId, {
|
|
@@ -2462,7 +2529,7 @@ const ws = {
|
|
|
2462
2529
|
}), {
|
|
2463
2530
|
taskId: f.taskId,
|
|
2464
2531
|
success: !0,
|
|
2465
|
-
originalAssigneeId:
|
|
2532
|
+
originalAssigneeId: $?.responsibleUid ?? void 0,
|
|
2466
2533
|
newAssigneeId: j.resolvedUser.userId
|
|
2467
2534
|
};
|
|
2468
2535
|
} catch (x) {
|
|
@@ -2470,7 +2537,7 @@ const ws = {
|
|
|
2470
2537
|
taskId: f.taskId,
|
|
2471
2538
|
success: !1,
|
|
2472
2539
|
error: x instanceof Error ? x.message : "Update failed",
|
|
2473
|
-
originalAssigneeId:
|
|
2540
|
+
originalAssigneeId: $?.responsibleUid ?? void 0
|
|
2474
2541
|
};
|
|
2475
2542
|
}
|
|
2476
2543
|
}
|
|
@@ -2533,8 +2600,8 @@ function Y({
|
|
|
2533
2600
|
`;
|
|
2534
2601
|
}
|
|
2535
2602
|
return !o && n.length > 0 ? (a += `**Next steps:**
|
|
2536
|
-
`, a += `• Use ${
|
|
2537
|
-
`, a += `• Use ${
|
|
2603
|
+
`, a += `• Use ${$s} with responsibleUser to see ${e === "unassign" ? "unassigned" : "newly assigned"} tasks
|
|
2604
|
+
`, a += `• Use ${Ds} for individual assignment changes
|
|
2538
2605
|
`, r.length > 0 && (a += `• Check failed tasks and use ${he} to verify collaborator access
|
|
2539
2606
|
`)) : o ? (a += `**To execute:**
|
|
2540
2607
|
`, a += `• Remove dryRun parameter and run again to execute changes
|
|
@@ -2546,9 +2613,9 @@ function Y({
|
|
|
2546
2613
|
`, a += `• Use dryRun=true to validate before executing
|
|
2547
2614
|
`), a;
|
|
2548
2615
|
}
|
|
2549
|
-
const
|
|
2616
|
+
const Es = {
|
|
2550
2617
|
query: s.string().min(1).describe("The search query string to find tasks and projects.")
|
|
2551
|
-
},
|
|
2618
|
+
}, Os = {
|
|
2552
2619
|
results: s.array(
|
|
2553
2620
|
s.object({
|
|
2554
2621
|
id: s.string().describe("The ID of the result."),
|
|
@@ -2557,21 +2624,22 @@ const xs = {
|
|
|
2557
2624
|
})
|
|
2558
2625
|
).describe("The search results."),
|
|
2559
2626
|
totalCount: s.number().describe("Total number of results found.")
|
|
2560
|
-
},
|
|
2627
|
+
}, _s = {
|
|
2561
2628
|
name: g.SEARCH,
|
|
2562
2629
|
description: "Search across tasks and projects in Todoist. Returns a list of relevant results with IDs, titles, and URLs.",
|
|
2563
|
-
parameters:
|
|
2564
|
-
outputSchema:
|
|
2630
|
+
parameters: Es,
|
|
2631
|
+
outputSchema: Os,
|
|
2632
|
+
mutability: "readonly",
|
|
2565
2633
|
async execute(e, t) {
|
|
2566
2634
|
const { query: o } = e, [n, r] = await Promise.all([
|
|
2567
2635
|
se({
|
|
2568
2636
|
client: t,
|
|
2569
2637
|
query: `search: ${o}`,
|
|
2570
|
-
limit:
|
|
2638
|
+
limit: S.TASKS_MAX,
|
|
2571
2639
|
cursor: void 0
|
|
2572
2640
|
}),
|
|
2573
|
-
t
|
|
2574
|
-
]), i = o.toLowerCase(), c = r.
|
|
2641
|
+
ke(t)
|
|
2642
|
+
]), i = o.toLowerCase(), c = r.filter(
|
|
2575
2643
|
(d) => d.name.toLowerCase().includes(i)
|
|
2576
2644
|
), a = [];
|
|
2577
2645
|
for (const d of n.tasks)
|
|
@@ -2591,27 +2659,28 @@ const xs = {
|
|
|
2591
2659
|
structuredContent: { results: a, totalCount: a.length }
|
|
2592
2660
|
};
|
|
2593
2661
|
}
|
|
2594
|
-
},
|
|
2662
|
+
}, Ns = s.object({
|
|
2595
2663
|
id: s.string().min(1).describe("The ID of the comment to update."),
|
|
2596
2664
|
content: s.string().min(1).describe("The new content for the comment.")
|
|
2597
|
-
}),
|
|
2598
|
-
comments: s.array(
|
|
2599
|
-
},
|
|
2665
|
+
}), Ms = {
|
|
2666
|
+
comments: s.array(Ns).min(1).describe("The comments to update.")
|
|
2667
|
+
}, Fs = {
|
|
2600
2668
|
comments: s.array(re).describe("The updated comments."),
|
|
2601
2669
|
totalCount: s.number().describe("The total number of comments updated."),
|
|
2602
2670
|
updatedCommentIds: s.array(s.string()).describe("The IDs of the updated comments."),
|
|
2603
2671
|
appliedOperations: s.object({
|
|
2604
2672
|
updateCount: s.number().describe("The number of comments updated.")
|
|
2605
2673
|
}).describe("Summary of operations performed.")
|
|
2606
|
-
},
|
|
2674
|
+
}, Rs = {
|
|
2607
2675
|
name: g.UPDATE_COMMENTS,
|
|
2608
2676
|
description: "Update multiple existing comments with new content.",
|
|
2609
|
-
parameters:
|
|
2610
|
-
outputSchema:
|
|
2677
|
+
parameters: Ms,
|
|
2678
|
+
outputSchema: Fs,
|
|
2679
|
+
mutability: "mutating",
|
|
2611
2680
|
async execute(e, t) {
|
|
2612
2681
|
const { comments: o } = e, n = o.map(async (a) => await t.updateComment(a.id, { content: a.content })), i = (await Promise.all(n)).map(te);
|
|
2613
2682
|
return {
|
|
2614
|
-
textContent:
|
|
2683
|
+
textContent: Ls({
|
|
2615
2684
|
comments: i
|
|
2616
2685
|
}),
|
|
2617
2686
|
structuredContent: {
|
|
@@ -2625,7 +2694,7 @@ const xs = {
|
|
|
2625
2694
|
};
|
|
2626
2695
|
}
|
|
2627
2696
|
};
|
|
2628
|
-
function
|
|
2697
|
+
function Ls({ comments: e }) {
|
|
2629
2698
|
const t = e.filter((i) => i.taskId).length, o = e.filter((i) => i.projectId).length, n = [];
|
|
2630
2699
|
if (t > 0) {
|
|
2631
2700
|
const i = t > 1 ? "comments" : "comment";
|
|
@@ -2637,14 +2706,14 @@ function Ns({ comments: e }) {
|
|
|
2637
2706
|
}
|
|
2638
2707
|
return n.length > 0 ? `Updated ${n.join(" and ")}` : "No comments updated";
|
|
2639
2708
|
}
|
|
2640
|
-
const
|
|
2709
|
+
const Bs = s.object({
|
|
2641
2710
|
id: s.string().min(1).describe("The ID of the project to update."),
|
|
2642
2711
|
name: s.string().min(1).optional().describe("The new name of the project."),
|
|
2643
2712
|
isFavorite: s.boolean().optional().describe("Whether the project is a favorite."),
|
|
2644
2713
|
viewStyle: s.enum(["list", "board", "calendar"]).optional().describe("The project view style.")
|
|
2645
|
-
}),
|
|
2646
|
-
projects: s.array(
|
|
2647
|
-
},
|
|
2714
|
+
}), Ws = {
|
|
2715
|
+
projects: s.array(Bs).min(1).describe("The projects to update.")
|
|
2716
|
+
}, Ys = {
|
|
2648
2717
|
projects: s.array(oe).describe("The updated projects."),
|
|
2649
2718
|
totalCount: s.number().describe("The total number of projects updated."),
|
|
2650
2719
|
updatedProjectIds: s.array(s.string()).describe("The IDs of the updated projects."),
|
|
@@ -2652,14 +2721,15 @@ const Ms = s.object({
|
|
|
2652
2721
|
updateCount: s.number().describe("The number of projects actually updated."),
|
|
2653
2722
|
skippedCount: s.number().describe("The number of projects skipped (no changes).")
|
|
2654
2723
|
}).describe("Summary of operations performed.")
|
|
2655
|
-
},
|
|
2724
|
+
}, Hs = {
|
|
2656
2725
|
name: g.UPDATE_PROJECTS,
|
|
2657
2726
|
description: "Update multiple existing projects with new values.",
|
|
2658
|
-
parameters:
|
|
2659
|
-
outputSchema:
|
|
2727
|
+
parameters: Ws,
|
|
2728
|
+
outputSchema: Ys,
|
|
2729
|
+
mutability: "mutating",
|
|
2660
2730
|
async execute(e, t) {
|
|
2661
2731
|
const { projects: o } = e, n = o.map(async (c) => {
|
|
2662
|
-
if (!
|
|
2732
|
+
if (!Ks(c))
|
|
2663
2733
|
return;
|
|
2664
2734
|
const { id: a, ...d } = c;
|
|
2665
2735
|
return await t.updateProject(a, d);
|
|
@@ -2671,7 +2741,7 @@ const Ms = s.object({
|
|
|
2671
2741
|
inboxProject: "inboxProject" in c ? c.inboxProject : !1
|
|
2672
2742
|
}));
|
|
2673
2743
|
return {
|
|
2674
|
-
textContent:
|
|
2744
|
+
textContent: zs({
|
|
2675
2745
|
projects: r,
|
|
2676
2746
|
args: e
|
|
2677
2747
|
}),
|
|
@@ -2687,7 +2757,7 @@ const Ms = s.object({
|
|
|
2687
2757
|
};
|
|
2688
2758
|
}
|
|
2689
2759
|
};
|
|
2690
|
-
function
|
|
2760
|
+
function zs({
|
|
2691
2761
|
projects: e,
|
|
2692
2762
|
args: t
|
|
2693
2763
|
}) {
|
|
@@ -2697,29 +2767,30 @@ function Bs({
|
|
|
2697
2767
|
return r > 0 && (a += ` (${r} skipped - no changes)`), i > 0 && (a += `:
|
|
2698
2768
|
${c}`), a;
|
|
2699
2769
|
}
|
|
2700
|
-
function
|
|
2770
|
+
function Ks({ id: e, ...t }) {
|
|
2701
2771
|
return Object.keys(t).length > 0;
|
|
2702
2772
|
}
|
|
2703
|
-
const
|
|
2773
|
+
const Vs = s.object({
|
|
2704
2774
|
id: s.string().min(1).describe("The ID of the section to update."),
|
|
2705
2775
|
name: s.string().min(1).describe("The new name of the section.")
|
|
2706
|
-
}),
|
|
2707
|
-
sections: s.array(
|
|
2708
|
-
},
|
|
2776
|
+
}), Gs = {
|
|
2777
|
+
sections: s.array(Vs).min(1).describe("The sections to update.")
|
|
2778
|
+
}, qs = {
|
|
2709
2779
|
sections: s.array(ne).describe("The updated sections."),
|
|
2710
2780
|
totalCount: s.number().describe("The total number of sections updated."),
|
|
2711
2781
|
updatedSectionIds: s.array(s.string()).describe("The IDs of the updated sections.")
|
|
2712
|
-
},
|
|
2782
|
+
}, Js = {
|
|
2713
2783
|
name: g.UPDATE_SECTIONS,
|
|
2714
2784
|
description: "Update multiple existing sections with new values.",
|
|
2715
|
-
parameters:
|
|
2716
|
-
outputSchema:
|
|
2785
|
+
parameters: Gs,
|
|
2786
|
+
outputSchema: qs,
|
|
2787
|
+
mutability: "mutating",
|
|
2717
2788
|
async execute({ sections: e }, t) {
|
|
2718
2789
|
const o = await Promise.all(
|
|
2719
2790
|
e.map((r) => t.updateSection(r.id, { name: r.name }))
|
|
2720
2791
|
);
|
|
2721
2792
|
return {
|
|
2722
|
-
textContent:
|
|
2793
|
+
textContent: Xs({
|
|
2723
2794
|
sections: o
|
|
2724
2795
|
}),
|
|
2725
2796
|
structuredContent: {
|
|
@@ -2730,13 +2801,13 @@ const Ys = s.object({
|
|
|
2730
2801
|
};
|
|
2731
2802
|
}
|
|
2732
2803
|
};
|
|
2733
|
-
function
|
|
2804
|
+
function Xs({ sections: e }) {
|
|
2734
2805
|
const t = e.length, o = e.map((r) => `• ${r.name} (id=${r.id}, projectId=${r.projectId})`).join(`
|
|
2735
2806
|
`);
|
|
2736
2807
|
return `Updated ${t} section${t === 1 ? "" : "s"}:
|
|
2737
2808
|
${o}`;
|
|
2738
2809
|
}
|
|
2739
|
-
const
|
|
2810
|
+
const Zs = s.object({
|
|
2740
2811
|
id: s.string().min(1).describe("The ID of the task to update."),
|
|
2741
2812
|
content: s.string().optional().describe(
|
|
2742
2813
|
'The new task name/title. Should be concise and actionable (e.g., "Review PR #123", "Call dentist"). For longer content, use the description field instead. Supports Markdown.'
|
|
@@ -2764,9 +2835,9 @@ const Gs = s.object({
|
|
|
2764
2835
|
'Change task assignment. Use "unassign" to remove assignment. Can be user ID, name, or email. User must be a project collaborator.'
|
|
2765
2836
|
),
|
|
2766
2837
|
labels: s.array(s.string()).optional().describe("The new labels for the task. Replaces all existing labels.")
|
|
2767
|
-
}),
|
|
2768
|
-
tasks: s.array(
|
|
2769
|
-
},
|
|
2838
|
+
}), Qs = {
|
|
2839
|
+
tasks: s.array(Zs).min(1).describe("The tasks to update.")
|
|
2840
|
+
}, eo = {
|
|
2770
2841
|
tasks: s.array(W).describe("The updated tasks."),
|
|
2771
2842
|
totalCount: s.number().describe("The total number of tasks updated."),
|
|
2772
2843
|
updatedTaskIds: s.array(s.string()).describe("The IDs of the updated tasks."),
|
|
@@ -2774,14 +2845,15 @@ const Gs = s.object({
|
|
|
2774
2845
|
updateCount: s.number().describe("The number of tasks actually updated."),
|
|
2775
2846
|
skippedCount: s.number().describe("The number of tasks skipped (no changes).")
|
|
2776
2847
|
}).describe("Summary of operations performed.")
|
|
2777
|
-
},
|
|
2848
|
+
}, to = {
|
|
2778
2849
|
name: g.UPDATE_TASKS,
|
|
2779
2850
|
description: "Update existing tasks including content, dates, priorities, and assignments.",
|
|
2780
|
-
parameters:
|
|
2781
|
-
outputSchema:
|
|
2851
|
+
parameters: Qs,
|
|
2852
|
+
outputSchema: eo,
|
|
2853
|
+
mutability: "mutating",
|
|
2782
2854
|
async execute(e, t) {
|
|
2783
2855
|
const { tasks: o } = e, n = o.map(async (a) => {
|
|
2784
|
-
if (!
|
|
2856
|
+
if (!oo(a))
|
|
2785
2857
|
return;
|
|
2786
2858
|
const {
|
|
2787
2859
|
id: d,
|
|
@@ -2831,13 +2903,13 @@ const Gs = s.object({
|
|
|
2831
2903
|
}
|
|
2832
2904
|
if (!P && !u && !p)
|
|
2833
2905
|
return await t.updateTask(d, h);
|
|
2834
|
-
const T =
|
|
2906
|
+
const T = He(d, P, u, p), C = await t.moveTask(d, T);
|
|
2835
2907
|
return Object.keys(h).length > 0 ? await t.updateTask(d, h) : C;
|
|
2836
2908
|
}), r = (await Promise.all(n)).filter(
|
|
2837
2909
|
(a) => a !== void 0
|
|
2838
2910
|
), i = r.map(O);
|
|
2839
2911
|
return {
|
|
2840
|
-
textContent:
|
|
2912
|
+
textContent: so({
|
|
2841
2913
|
tasks: i,
|
|
2842
2914
|
args: e
|
|
2843
2915
|
}),
|
|
@@ -2853,21 +2925,21 @@ const Gs = s.object({
|
|
|
2853
2925
|
};
|
|
2854
2926
|
}
|
|
2855
2927
|
};
|
|
2856
|
-
function
|
|
2928
|
+
function so({
|
|
2857
2929
|
tasks: e,
|
|
2858
2930
|
args: t
|
|
2859
2931
|
}) {
|
|
2860
2932
|
const o = t.tasks.length, n = e.length, r = o - n;
|
|
2861
2933
|
let i = "";
|
|
2862
|
-
return r > 0 && (i = ` (${r} skipped - no changes)`),
|
|
2934
|
+
return r > 0 && (i = ` (${r} skipped - no changes)`), je("Updated", e, {
|
|
2863
2935
|
context: i,
|
|
2864
2936
|
showDetails: e.length <= 5
|
|
2865
2937
|
});
|
|
2866
2938
|
}
|
|
2867
|
-
function
|
|
2939
|
+
function oo({ id: e, ...t }) {
|
|
2868
2940
|
return Object.keys(t).length > 0;
|
|
2869
2941
|
}
|
|
2870
|
-
const
|
|
2942
|
+
const no = {}, ro = {
|
|
2871
2943
|
type: s.literal("user_info").describe("The type of the response."),
|
|
2872
2944
|
userId: s.string().describe("The user ID."),
|
|
2873
2945
|
fullName: s.string().describe("The full name of the user."),
|
|
@@ -2884,39 +2956,39 @@ const eo = {}, to = {
|
|
|
2884
2956
|
email: s.string().describe("The email address of the user."),
|
|
2885
2957
|
plan: s.enum(["Todoist Free", "Todoist Pro", "Todoist Business"]).describe("The user plan.")
|
|
2886
2958
|
};
|
|
2887
|
-
function
|
|
2959
|
+
function io(e) {
|
|
2888
2960
|
return e.businessAccountId ? "Todoist Business" : e.isPremium ? "Todoist Pro" : "Todoist Free";
|
|
2889
2961
|
}
|
|
2890
|
-
function
|
|
2962
|
+
function ao(e, t) {
|
|
2891
2963
|
const n = ((e.getDay() || 7) - t + 7) % 7, r = new Date(e);
|
|
2892
2964
|
return r.setDate(e.getDate() - n), r;
|
|
2893
2965
|
}
|
|
2894
|
-
function
|
|
2966
|
+
function co(e) {
|
|
2895
2967
|
const t = new Date(e);
|
|
2896
2968
|
return t.setDate(e.getDate() + 6), t;
|
|
2897
2969
|
}
|
|
2898
|
-
function
|
|
2970
|
+
function lo(e) {
|
|
2899
2971
|
const t = new Date(e.getFullYear(), 0, 1), o = (e.getTime() - t.getTime()) / 864e5;
|
|
2900
2972
|
return Math.ceil((o + t.getDay() + 1) / 7);
|
|
2901
2973
|
}
|
|
2902
|
-
function
|
|
2974
|
+
function uo(e) {
|
|
2903
2975
|
return ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"][e === 7 ? 0 : e] ?? "Unknown";
|
|
2904
2976
|
}
|
|
2905
|
-
function
|
|
2977
|
+
function H(e) {
|
|
2906
2978
|
return e.toISOString().split("T")[0] ?? "";
|
|
2907
2979
|
}
|
|
2908
|
-
function
|
|
2980
|
+
function po(e) {
|
|
2909
2981
|
try {
|
|
2910
2982
|
return new Intl.DateTimeFormat("en-US", { timeZone: e }), !0;
|
|
2911
2983
|
} catch {
|
|
2912
2984
|
return !1;
|
|
2913
2985
|
}
|
|
2914
2986
|
}
|
|
2915
|
-
function
|
|
2916
|
-
return
|
|
2987
|
+
function xe(e) {
|
|
2988
|
+
return po(e) ? e : "UTC";
|
|
2917
2989
|
}
|
|
2918
|
-
function
|
|
2919
|
-
const o =
|
|
2990
|
+
function ho(e, t) {
|
|
2991
|
+
const o = xe(t);
|
|
2920
2992
|
return e.toLocaleString("en-US", {
|
|
2921
2993
|
timeZone: o,
|
|
2922
2994
|
year: "numeric",
|
|
@@ -2928,8 +3000,8 @@ function co(e, t) {
|
|
|
2928
3000
|
hour12: !1
|
|
2929
3001
|
});
|
|
2930
3002
|
}
|
|
2931
|
-
async function
|
|
2932
|
-
const t = await e.getUser(), o = t.tzInfo?.timezone ?? "UTC", n =
|
|
3003
|
+
async function mo(e) {
|
|
3004
|
+
const t = await e.getUser(), o = t.tzInfo?.timezone ?? "UTC", n = xe(o), r = /* @__PURE__ */ new Date(), i = ho(r, n), c = t.startDay ?? 1, a = uo(c), d = io(t), l = new Date(r.toLocaleString("en-US", { timeZone: n })), u = ao(l, c), p = co(u), b = lo(l), y = [
|
|
2933
3005
|
"# User Information",
|
|
2934
3006
|
"",
|
|
2935
3007
|
`**User ID:** ${t.id}`,
|
|
@@ -2941,8 +3013,8 @@ async function lo(e) {
|
|
|
2941
3013
|
"## Week Settings",
|
|
2942
3014
|
`**Week Start Day:** ${a} (${c})`,
|
|
2943
3015
|
`**Current Week:** Week ${b}`,
|
|
2944
|
-
`**Week Start Date:** ${
|
|
2945
|
-
`**Week End Date:** ${
|
|
3016
|
+
`**Week Start Date:** ${H(u)}`,
|
|
3017
|
+
`**Week End Date:** ${H(p)}`,
|
|
2946
3018
|
"",
|
|
2947
3019
|
"## Daily Progress",
|
|
2948
3020
|
`**Completed Today:** ${t.completedToday}`,
|
|
@@ -2960,8 +3032,8 @@ async function lo(e) {
|
|
|
2960
3032
|
currentLocalTime: i,
|
|
2961
3033
|
startDay: c,
|
|
2962
3034
|
startDayName: a,
|
|
2963
|
-
weekStartDate:
|
|
2964
|
-
weekEndDate:
|
|
3035
|
+
weekStartDate: H(u),
|
|
3036
|
+
weekEndDate: H(p),
|
|
2965
3037
|
currentWeekNumber: b,
|
|
2966
3038
|
completedToday: t.completedToday,
|
|
2967
3039
|
dailyGoal: t.dailyGoal,
|
|
@@ -2971,19 +3043,20 @@ async function lo(e) {
|
|
|
2971
3043
|
};
|
|
2972
3044
|
return { textContent: y, structuredContent: k };
|
|
2973
3045
|
}
|
|
2974
|
-
const
|
|
3046
|
+
const fo = {
|
|
2975
3047
|
name: g.USER_INFO,
|
|
2976
3048
|
description: "Get comprehensive user information including user ID, full name, email, timezone with current local time, week start day preferences, current week dates, daily/weekly goal progress, and user plan (Free/Pro/Business).",
|
|
2977
|
-
parameters:
|
|
2978
|
-
outputSchema:
|
|
3049
|
+
parameters: no,
|
|
3050
|
+
outputSchema: ro,
|
|
3051
|
+
mutability: "readonly",
|
|
2979
3052
|
async execute(e, t) {
|
|
2980
|
-
const o = await
|
|
3053
|
+
const o = await mo(t);
|
|
2981
3054
|
return {
|
|
2982
3055
|
textContent: o.textContent,
|
|
2983
3056
|
structuredContent: o.structuredContent
|
|
2984
3057
|
};
|
|
2985
3058
|
}
|
|
2986
|
-
},
|
|
3059
|
+
}, bo = `
|
|
2987
3060
|
## Todoist Task and Project Management Tools
|
|
2988
3061
|
|
|
2989
3062
|
You have access to comprehensive Todoist management tools for personal productivity and team collaboration. Use these tools to help users manage tasks, projects, sections, comments, and assignments effectively.
|
|
@@ -3051,41 +3124,41 @@ You have access to comprehensive Todoist management tools for personal productiv
|
|
|
3051
3124
|
|
|
3052
3125
|
Always provide clear, actionable task titles and descriptions. Use the overview tools to give users context about their workload and project status.
|
|
3053
3126
|
`;
|
|
3054
|
-
function
|
|
3055
|
-
const o = new
|
|
3127
|
+
function wo({ todoistApiKey: e, baseUrl: t }) {
|
|
3128
|
+
const o = new Ue(
|
|
3056
3129
|
{ name: "todoist-mcp-server", version: "0.1.0" },
|
|
3057
3130
|
{
|
|
3058
3131
|
capabilities: {
|
|
3059
3132
|
tools: { listChanged: !0 }
|
|
3060
3133
|
},
|
|
3061
|
-
instructions:
|
|
3134
|
+
instructions: bo
|
|
3062
3135
|
}
|
|
3063
|
-
), n = new
|
|
3064
|
-
return I(
|
|
3136
|
+
), n = new Ae(e, { baseUrl: t });
|
|
3137
|
+
return I(It, o, n), I(Ct, o, n), I(to, o, n), I(ps, o, n), I(bs, o, n), I(Vt, o, n), I(rt, o, n), I(Hs, o, n), I(os, o, n), I(lt, o, n), I(Js, o, n), I(cs, o, n), I(et, o, n), I(Wt, o, n), I(Rs, o, n), I(_t, o, n), I(Ss, o, n), I(xt, o, n), I(fo, o, n), I(Zt, o, n), I(Ps, o, n), I(_s, o, n), I(Pt, o, n), o;
|
|
3065
3138
|
}
|
|
3066
3139
|
export {
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3140
|
+
Zt as a,
|
|
3141
|
+
Ss as b,
|
|
3142
|
+
_t as c,
|
|
3143
|
+
xt as d,
|
|
3144
|
+
Wt as e,
|
|
3145
|
+
Pt as f,
|
|
3146
|
+
wo as g,
|
|
3147
|
+
Rs as h,
|
|
3148
|
+
et as i,
|
|
3149
|
+
cs as j,
|
|
3150
|
+
Js as k,
|
|
3151
|
+
lt as l,
|
|
3152
|
+
Ps as m,
|
|
3153
|
+
os as n,
|
|
3154
|
+
Hs as o,
|
|
3155
|
+
rt as p,
|
|
3156
|
+
Vt as q,
|
|
3157
|
+
bs as r,
|
|
3158
|
+
_s as s,
|
|
3159
|
+
ps as t,
|
|
3160
|
+
fo as u,
|
|
3161
|
+
to as v,
|
|
3162
|
+
Ct as w,
|
|
3163
|
+
It as x
|
|
3091
3164
|
};
|