@doist/todoist-ai 4.17.3 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +20 -20
- package/dist/index.js +2 -2
- package/dist/main.js +1 -1
- package/dist/{mcp-server-BSQxi0xQ.js → mcp-server-CLyVslzE.js} +137 -135
- package/dist/tool-helpers.d.ts +2 -2
- package/dist/tool-helpers.d.ts.map +1 -1
- package/dist/tools/add-tasks.d.ts +4 -4
- package/dist/tools/find-completed-tasks.d.ts +4 -4
- package/dist/tools/find-tasks-by-date.d.ts +4 -4
- package/dist/tools/find-tasks.d.ts +4 -4
- package/dist/tools/update-tasks.d.ts +4 -4
- package/dist/utils/output-schemas.d.ts +3 -3
- package/dist/utils/output-schemas.d.ts.map +1 -1
- package/dist/utils/priorities.d.ts +0 -1
- package/dist/utils/priorities.d.ts.map +1 -1
- package/dist/utils/response-builders.d.ts +2 -1
- package/dist/utils/response-builders.d.ts.map +1 -1
- package/dist/utils/test-helpers.d.ts +6 -1
- package/dist/utils/test-helpers.d.ts.map +1 -1
- package/package.json +7 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getTaskUrl as
|
|
1
|
+
import { getTaskUrl as me, getProjectUrl as fe, TodoistApi as De } from "@doist/todoist-api-typescript";
|
|
2
2
|
import { McpServer as xe } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
3
|
import F, { z as s } from "zod";
|
|
4
|
-
import { addDays as
|
|
4
|
+
import { addDays as be, formatISO as Ae } from "date-fns";
|
|
5
5
|
function X(e) {
|
|
6
6
|
if (e == null)
|
|
7
7
|
return e;
|
|
@@ -71,7 +71,7 @@ class U extends Error {
|
|
|
71
71
|
super(`Invalid duration format "${t}": ${o}`), this.name = "DurationParseError";
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function ge(e) {
|
|
75
75
|
if (!e || typeof e != "string")
|
|
76
76
|
throw new U(e, "Duration must be a non-empty string");
|
|
77
77
|
const t = e.trim().toLowerCase().replace(/\s+/g, "");
|
|
@@ -110,8 +110,17 @@ function Oe(e) {
|
|
|
110
110
|
const t = Math.floor(e / 60), o = e % 60;
|
|
111
111
|
return t === 0 ? `${o}m` : o === 0 ? `${t}h` : `${t}h${o}m`;
|
|
112
112
|
}
|
|
113
|
+
const _e = ["p1", "p2", "p3", "p4"], Q = s.enum(_e, {
|
|
114
|
+
description: "Task priority: p1 (highest), p2 (high), p3 (medium), p4 (lowest/default)"
|
|
115
|
+
});
|
|
116
|
+
function Te(e) {
|
|
117
|
+
return { p1: 4, p2: 3, p3: 2, p4: 1 }[e];
|
|
118
|
+
}
|
|
119
|
+
function Ne(e) {
|
|
120
|
+
return { 4: "p1", 3: "p2", 2: "p3", 1: "p4" }[e];
|
|
121
|
+
}
|
|
113
122
|
const A = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new Map(), G = 300 * 1e3;
|
|
114
|
-
class
|
|
123
|
+
class Me {
|
|
115
124
|
/**
|
|
116
125
|
* Resolve a user name or ID to a user ID by looking up collaborators across all shared projects.
|
|
117
126
|
* Supports exact name matches, partial matches, and email matches.
|
|
@@ -216,15 +225,15 @@ class _e {
|
|
|
216
225
|
A.clear(), R.clear();
|
|
217
226
|
}
|
|
218
227
|
}
|
|
219
|
-
const _ = new
|
|
220
|
-
async function
|
|
228
|
+
const _ = new Me();
|
|
229
|
+
async function Fe(e, t) {
|
|
221
230
|
return _.resolveUser(e, t);
|
|
222
231
|
}
|
|
223
|
-
const
|
|
224
|
-
async function
|
|
232
|
+
const ye = ["assigned", "unassignedOrMe", "all"];
|
|
233
|
+
async function ee(e, t) {
|
|
225
234
|
if (!t)
|
|
226
235
|
return;
|
|
227
|
-
const o = await
|
|
236
|
+
const o = await Fe(e, t);
|
|
228
237
|
if (!o)
|
|
229
238
|
throw new Error(
|
|
230
239
|
`Could not find user: "${t}". Make sure the user is a collaborator on a shared project.`
|
|
@@ -234,14 +243,14 @@ async function Q(e, t) {
|
|
|
234
243
|
function K(e, t) {
|
|
235
244
|
return t.length === 0 ? e : e.length === 0 ? t : `${e} & ${t}`;
|
|
236
245
|
}
|
|
237
|
-
function
|
|
246
|
+
function Re({
|
|
238
247
|
resolvedAssigneeId: e,
|
|
239
248
|
assigneeEmail: t,
|
|
240
249
|
responsibleUserFiltering: o = "unassignedOrMe"
|
|
241
250
|
}) {
|
|
242
251
|
return e && t ? `assigned to: ${t}` : o === "unassignedOrMe" ? "!assigned to: others" : o === "assigned" ? "assigned to: others" : "";
|
|
243
252
|
}
|
|
244
|
-
function
|
|
253
|
+
function de({
|
|
245
254
|
tasks: e,
|
|
246
255
|
resolvedAssigneeId: t,
|
|
247
256
|
currentUserId: o,
|
|
@@ -252,7 +261,7 @@ function ce({
|
|
|
252
261
|
function B(e) {
|
|
253
262
|
return "inboxProject" in e;
|
|
254
263
|
}
|
|
255
|
-
function
|
|
264
|
+
function Le(e, t, o, n) {
|
|
256
265
|
const r = [t, o, n].filter(Boolean);
|
|
257
266
|
if (r.length > 1)
|
|
258
267
|
throw new Error(
|
|
@@ -275,7 +284,7 @@ function O(e) {
|
|
|
275
284
|
dueDate: e.due?.date,
|
|
276
285
|
recurring: e.due?.isRecurring && e.due.string ? e.due.string : !1,
|
|
277
286
|
deadlineDate: e.deadline?.date,
|
|
278
|
-
priority: e.priority,
|
|
287
|
+
priority: Ne(e.priority) ?? "p4",
|
|
279
288
|
projectId: e.projectId,
|
|
280
289
|
sectionId: e.sectionId ?? void 0,
|
|
281
290
|
parentId: e.parentId ?? void 0,
|
|
@@ -287,7 +296,7 @@ function O(e) {
|
|
|
287
296
|
completedAt: e.completedAt ?? void 0
|
|
288
297
|
};
|
|
289
298
|
}
|
|
290
|
-
function
|
|
299
|
+
function Ie(e) {
|
|
291
300
|
return {
|
|
292
301
|
id: e.id,
|
|
293
302
|
name: e.name,
|
|
@@ -299,7 +308,7 @@ function Te(e) {
|
|
|
299
308
|
viewStyle: e.viewStyle
|
|
300
309
|
};
|
|
301
310
|
}
|
|
302
|
-
function
|
|
311
|
+
function te(e) {
|
|
303
312
|
return {
|
|
304
313
|
id: e.id,
|
|
305
314
|
taskId: e.taskId ?? void 0,
|
|
@@ -323,7 +332,7 @@ function ee(e) {
|
|
|
323
332
|
} : void 0
|
|
324
333
|
};
|
|
325
334
|
}
|
|
326
|
-
function
|
|
335
|
+
function Be(e) {
|
|
327
336
|
return {
|
|
328
337
|
id: e.id ?? void 0,
|
|
329
338
|
objectType: e.objectType,
|
|
@@ -336,7 +345,7 @@ function Re(e) {
|
|
|
336
345
|
extraData: e.extraData ?? void 0
|
|
337
346
|
};
|
|
338
347
|
}
|
|
339
|
-
const
|
|
348
|
+
const We = F.object({
|
|
340
349
|
httpStatusCode: F.number(),
|
|
341
350
|
responseData: F.object({
|
|
342
351
|
error: F.string(),
|
|
@@ -344,7 +353,7 @@ const Le = F.object({
|
|
|
344
353
|
errorTag: F.string()
|
|
345
354
|
})
|
|
346
355
|
});
|
|
347
|
-
async function
|
|
356
|
+
async function se({
|
|
348
357
|
client: e,
|
|
349
358
|
query: t,
|
|
350
359
|
limit: o,
|
|
@@ -354,7 +363,7 @@ async function te({
|
|
|
354
363
|
const { results: r, nextCursor: i } = await e.getTasksByFilter({ query: t, cursor: n, limit: o });
|
|
355
364
|
return { tasks: r.map(O), nextCursor: i };
|
|
356
365
|
} catch (r) {
|
|
357
|
-
const i =
|
|
366
|
+
const i = We.safeParse(r);
|
|
358
367
|
if (!i.success)
|
|
359
368
|
throw r;
|
|
360
369
|
const { responseData: c } = i.data;
|
|
@@ -370,7 +379,9 @@ const W = s.object({
|
|
|
370
379
|
dueDate: s.string().optional().describe("The due date of the task (ISO 8601 format)."),
|
|
371
380
|
recurring: s.union([s.boolean(), s.string()]).describe("Whether the task is recurring, or the recurrence string."),
|
|
372
381
|
deadlineDate: s.string().optional().describe("The deadline date of the task (ISO 8601 format)."),
|
|
373
|
-
priority:
|
|
382
|
+
priority: Q.describe(
|
|
383
|
+
"The priority level: p1 (highest), p2 (high), p3 (medium), p4 (lowest)."
|
|
384
|
+
),
|
|
374
385
|
projectId: s.string().describe("The ID of the project this task belongs to."),
|
|
375
386
|
sectionId: s.string().optional().describe("The ID of the section this task belongs to."),
|
|
376
387
|
parentId: s.string().optional().describe("The ID of the parent task (for subtasks)."),
|
|
@@ -380,7 +391,7 @@ const W = s.object({
|
|
|
380
391
|
assignedByUid: s.string().optional().describe("The UID of the user who assigned this task."),
|
|
381
392
|
checked: s.boolean().describe("Whether the task is checked/completed."),
|
|
382
393
|
completedAt: s.string().optional().describe("When the task was completed (ISO 8601 format).")
|
|
383
|
-
}),
|
|
394
|
+
}), oe = s.object({
|
|
384
395
|
id: s.string().describe("The unique ID of the project."),
|
|
385
396
|
name: s.string().describe("The name of the project."),
|
|
386
397
|
color: s.string().describe("The color of the project."),
|
|
@@ -389,10 +400,10 @@ const W = s.object({
|
|
|
389
400
|
parentId: s.string().optional().describe("The ID of the parent project (for sub-projects)."),
|
|
390
401
|
inboxProject: s.boolean().describe("Whether this is the inbox project."),
|
|
391
402
|
viewStyle: s.string().describe("The view style of the project (list, board, calendar).")
|
|
392
|
-
}),
|
|
403
|
+
}), ne = s.object({
|
|
393
404
|
id: s.string().describe("The unique ID of the section."),
|
|
394
405
|
name: s.string().describe("The name of the section.")
|
|
395
|
-
}),
|
|
406
|
+
}), Ye = s.object({
|
|
396
407
|
resourceType: s.string().describe("The type of resource (file, url, image, etc)."),
|
|
397
408
|
fileName: s.string().optional().describe("The name of the file."),
|
|
398
409
|
fileSize: s.number().optional().describe("The size of the file in bytes."),
|
|
@@ -405,15 +416,15 @@ const W = s.object({
|
|
|
405
416
|
image: s.string().optional().describe("The image URL for image resource types."),
|
|
406
417
|
imageWidth: s.number().optional().describe("The width of the image in pixels."),
|
|
407
418
|
imageHeight: s.number().optional().describe("The height of the image in pixels.")
|
|
408
|
-
}),
|
|
419
|
+
}), re = s.object({
|
|
409
420
|
id: s.string().describe("The unique ID of the comment."),
|
|
410
421
|
taskId: s.string().optional().describe("The ID of the task this comment belongs to."),
|
|
411
422
|
projectId: s.string().optional().describe("The ID of the project this comment belongs to."),
|
|
412
423
|
content: s.string().describe("The content of the comment."),
|
|
413
424
|
postedAt: s.string().describe("When the comment was posted (ISO 8601 format)."),
|
|
414
425
|
postedUid: s.string().optional().describe("The UID of the user who posted this comment."),
|
|
415
|
-
fileAttachment:
|
|
416
|
-
}),
|
|
426
|
+
fileAttachment: Ye.optional().describe("File attachment information, if any.")
|
|
427
|
+
}), ze = s.object({
|
|
417
428
|
id: s.string().optional().describe("The unique ID of the activity event."),
|
|
418
429
|
objectType: s.string().describe("The type of object this event relates to (task, project, etc)."),
|
|
419
430
|
objectId: s.string().describe("The ID of the object this event relates to."),
|
|
@@ -423,11 +434,11 @@ const W = s.object({
|
|
|
423
434
|
parentItemId: s.string().optional().describe("The ID of the parent item."),
|
|
424
435
|
initiatorId: s.string().optional().describe("The ID of the user who initiated this event."),
|
|
425
436
|
extraData: s.record(s.unknown()).optional().describe("Additional event data.")
|
|
426
|
-
}),
|
|
437
|
+
}), Ke = s.object({
|
|
427
438
|
id: s.string().describe("The unique ID of the user."),
|
|
428
439
|
name: s.string().describe("The full name of the user."),
|
|
429
440
|
email: s.string().describe("The email address of the user.")
|
|
430
|
-
}),
|
|
441
|
+
}), He = s.object({
|
|
431
442
|
item: s.string().describe("The item that failed (usually an ID or identifier)."),
|
|
432
443
|
error: s.string().describe("The error message."),
|
|
433
444
|
code: s.string().optional().describe("The error code, if available.")
|
|
@@ -463,23 +474,23 @@ const W = s.object({
|
|
|
463
474
|
// OpenAI MCP tools
|
|
464
475
|
SEARCH: "search",
|
|
465
476
|
FETCH: "fetch"
|
|
466
|
-
},
|
|
477
|
+
}, Ve = s.object({
|
|
467
478
|
taskId: s.string().optional().describe("The ID of the task to comment on."),
|
|
468
479
|
projectId: s.string().optional().describe(
|
|
469
480
|
'The ID of the project to comment on. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
470
481
|
),
|
|
471
482
|
content: s.string().min(1).describe("The content of the comment.")
|
|
472
|
-
}),
|
|
473
|
-
comments: s.array(
|
|
474
|
-
},
|
|
475
|
-
comments: s.array(
|
|
483
|
+
}), Ge = {
|
|
484
|
+
comments: s.array(Ve).min(1).describe("The array of comments to add.")
|
|
485
|
+
}, qe = {
|
|
486
|
+
comments: s.array(re).describe("The created comments."),
|
|
476
487
|
totalCount: s.number().describe("The total number of comments created."),
|
|
477
488
|
addedCommentIds: s.array(s.string()).describe("The IDs of the added comments.")
|
|
478
|
-
},
|
|
489
|
+
}, Je = {
|
|
479
490
|
name: g.ADD_COMMENTS,
|
|
480
491
|
description: "Add multiple comments to tasks or projects. Each comment must specify either taskId or projectId.",
|
|
481
|
-
parameters:
|
|
482
|
-
outputSchema:
|
|
492
|
+
parameters: Ge,
|
|
493
|
+
outputSchema: qe,
|
|
483
494
|
async execute(e, t) {
|
|
484
495
|
const { comments: o } = e;
|
|
485
496
|
for (const [l, u] of o.entries()) {
|
|
@@ -498,9 +509,9 @@ const W = s.object({
|
|
|
498
509
|
content: l,
|
|
499
510
|
...u ? { taskId: u } : { projectId: b }
|
|
500
511
|
});
|
|
501
|
-
}), a = (await Promise.all(i)).map(
|
|
512
|
+
}), a = (await Promise.all(i)).map(te);
|
|
502
513
|
return {
|
|
503
|
-
textContent:
|
|
514
|
+
textContent: Xe({ comments: a }),
|
|
504
515
|
structuredContent: {
|
|
505
516
|
comments: a,
|
|
506
517
|
totalCount: a.length,
|
|
@@ -509,7 +520,7 @@ const W = s.object({
|
|
|
509
520
|
};
|
|
510
521
|
}
|
|
511
522
|
};
|
|
512
|
-
function
|
|
523
|
+
function Xe({ comments: e }) {
|
|
513
524
|
const t = e.filter((i) => i.taskId).length, o = e.filter((i) => i.projectId).length, n = [];
|
|
514
525
|
if (t > 0) {
|
|
515
526
|
const i = t > 1 ? "comments" : "comment";
|
|
@@ -521,23 +532,23 @@ function qe({ comments: e }) {
|
|
|
521
532
|
}
|
|
522
533
|
return n.length > 0 ? `Added ${n.join(" and ")}` : "No comments added";
|
|
523
534
|
}
|
|
524
|
-
const
|
|
535
|
+
const Ze = s.object({
|
|
525
536
|
name: s.string().min(1).describe("The name of the project."),
|
|
526
537
|
parentId: s.string().optional().describe("The ID of the parent project. If provided, creates this as a sub-project."),
|
|
527
538
|
isFavorite: s.boolean().optional().describe("Whether the project is a favorite. Defaults to false."),
|
|
528
539
|
viewStyle: s.enum(["list", "board", "calendar"]).optional().describe('The project view style. Defaults to "list".')
|
|
529
|
-
}),
|
|
530
|
-
projects: s.array(
|
|
531
|
-
},
|
|
532
|
-
projects: s.array(
|
|
540
|
+
}), Qe = {
|
|
541
|
+
projects: s.array(Ze).min(1).describe("The array of projects to add.")
|
|
542
|
+
}, et = {
|
|
543
|
+
projects: s.array(oe).describe("The created projects."),
|
|
533
544
|
totalCount: s.number().describe("The total number of projects created.")
|
|
534
|
-
},
|
|
545
|
+
}, tt = {
|
|
535
546
|
name: g.ADD_PROJECTS,
|
|
536
547
|
description: "Add one or more new projects.",
|
|
537
|
-
parameters:
|
|
538
|
-
outputSchema:
|
|
548
|
+
parameters: Qe,
|
|
549
|
+
outputSchema: et,
|
|
539
550
|
async execute({ projects: e }, t) {
|
|
540
|
-
const o = await Promise.all(e.map((i) => t.addProject(i))), n =
|
|
551
|
+
const o = await Promise.all(e.map((i) => t.addProject(i))), n = st({ projects: o }), r = o.map((i) => ({
|
|
541
552
|
...i,
|
|
542
553
|
parentId: "parentId" in i ? i.parentId ?? void 0 : void 0,
|
|
543
554
|
inboxProject: "inboxProject" in i ? i.inboxProject : !1
|
|
@@ -551,27 +562,27 @@ const Je = s.object({
|
|
|
551
562
|
};
|
|
552
563
|
}
|
|
553
564
|
};
|
|
554
|
-
function
|
|
565
|
+
function st({ projects: e }) {
|
|
555
566
|
const t = e.length, o = e.map((r) => `• ${r.name} (id=${r.id})`).join(`
|
|
556
567
|
`);
|
|
557
568
|
return `Added ${t} project${t === 1 ? "" : "s"}:
|
|
558
569
|
${o}`;
|
|
559
570
|
}
|
|
560
|
-
const
|
|
571
|
+
const ot = s.object({
|
|
561
572
|
name: s.string().min(1).describe("The name of the section."),
|
|
562
573
|
projectId: s.string().min(1).describe(
|
|
563
574
|
'The ID of the project to add the section to. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
564
575
|
)
|
|
565
|
-
}),
|
|
566
|
-
sections: s.array(
|
|
567
|
-
},
|
|
568
|
-
sections: s.array(
|
|
576
|
+
}), nt = {
|
|
577
|
+
sections: s.array(ot).min(1).describe("The array of sections to add.")
|
|
578
|
+
}, rt = {
|
|
579
|
+
sections: s.array(ne).describe("The created sections."),
|
|
569
580
|
totalCount: s.number().describe("The total number of sections created.")
|
|
570
|
-
},
|
|
581
|
+
}, it = {
|
|
571
582
|
name: g.ADD_SECTIONS,
|
|
572
583
|
description: "Add one or more new sections to projects.",
|
|
573
|
-
parameters:
|
|
574
|
-
outputSchema:
|
|
584
|
+
parameters: nt,
|
|
585
|
+
outputSchema: rt,
|
|
575
586
|
async execute({ sections: e }, t) {
|
|
576
587
|
const n = e.some((a) => a.projectId === "inbox") ? await t.getUser() : null, r = e.map((a) => ({
|
|
577
588
|
...a,
|
|
@@ -580,7 +591,7 @@ const tt = s.object({
|
|
|
580
591
|
r.map((a) => t.addSection(a))
|
|
581
592
|
);
|
|
582
593
|
return {
|
|
583
|
-
textContent:
|
|
594
|
+
textContent: at({ sections: i }),
|
|
584
595
|
structuredContent: {
|
|
585
596
|
sections: i,
|
|
586
597
|
totalCount: i.length
|
|
@@ -588,7 +599,7 @@ const tt = s.object({
|
|
|
588
599
|
};
|
|
589
600
|
}
|
|
590
601
|
};
|
|
591
|
-
function
|
|
602
|
+
function at({ sections: e }) {
|
|
592
603
|
const t = e.length, o = e.map((r) => `• ${r.name} (id=${r.id}, projectId=${r.projectId})`).join(`
|
|
593
604
|
`);
|
|
594
605
|
return `Added ${t} section${t === 1 ? "" : "s"}:
|
|
@@ -603,7 +614,7 @@ const L = {
|
|
|
603
614
|
PROJECT_NOT_FOUND: "PROJECT_NOT_FOUND",
|
|
604
615
|
TASK_NOT_FOUND: "TASK_NOT_FOUND"
|
|
605
616
|
};
|
|
606
|
-
class
|
|
617
|
+
class ct {
|
|
607
618
|
/**
|
|
608
619
|
* Validate a single assignment operation
|
|
609
620
|
*/
|
|
@@ -812,16 +823,7 @@ class it {
|
|
|
812
823
|
};
|
|
813
824
|
}
|
|
814
825
|
}
|
|
815
|
-
const
|
|
816
|
-
description: "Task priority: p1 (highest), p2 (high), p3 (medium), p4 (lowest/default)"
|
|
817
|
-
});
|
|
818
|
-
function Ie(e) {
|
|
819
|
-
return { p1: 4, p2: 3, p3: 2, p4: 1 }[e];
|
|
820
|
-
}
|
|
821
|
-
function ct(e) {
|
|
822
|
-
return { 4: "P1", 3: "P2", 2: "P3", 1: "P4" }[e] || "";
|
|
823
|
-
}
|
|
824
|
-
const $ = {
|
|
826
|
+
const ie = new ct(), $ = {
|
|
825
827
|
/** Default limit for task listings */
|
|
826
828
|
TASKS_DEFAULT: 10,
|
|
827
829
|
/** Maximum limit for task search and list operations */
|
|
@@ -882,7 +884,7 @@ ${i.slice(0, q.MAX_FAILURES_SHOWN).map((u) => ` ${u.item} (Error: ${u.error}$
|
|
|
882
884
|
`);
|
|
883
885
|
}
|
|
884
886
|
function ut(e) {
|
|
885
|
-
const t = e.content || e.title || "Untitled", o = e.dueDate ? ` • due ${e.dueDate}` : "", n = e.priority ? ` • ${
|
|
887
|
+
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}` : "";
|
|
886
888
|
return ` ${t}${o}${n}${r}${i}`;
|
|
887
889
|
}
|
|
888
890
|
function pt(e) {
|
|
@@ -927,7 +929,7 @@ const ht = s.object({
|
|
|
927
929
|
description: s.string().optional().describe(
|
|
928
930
|
"Additional details, notes, or context for the task. Use this for longer content rather than putting it in the task name. Supports Markdown."
|
|
929
931
|
),
|
|
930
|
-
priority:
|
|
932
|
+
priority: Q.optional().describe(
|
|
931
933
|
"The priority of the task: p1 (highest), p2 (high), p3 (medium), p4 (lowest/default)."
|
|
932
934
|
),
|
|
933
935
|
dueString: s.string().optional().describe("The due date for the task, in natural language."),
|
|
@@ -992,13 +994,13 @@ async function gt(e, t) {
|
|
|
992
994
|
labels: d,
|
|
993
995
|
deadlineDate: l
|
|
994
996
|
};
|
|
995
|
-
if (a && (b.priority =
|
|
997
|
+
if (a && (b.priority = Te(a)), c && !p && !r && !i)
|
|
996
998
|
throw new Error(
|
|
997
999
|
`Task "${e.content}": Cannot assign tasks without specifying project context. Please specify a projectId, sectionId, or parentId.`
|
|
998
1000
|
);
|
|
999
1001
|
if (o)
|
|
1000
1002
|
try {
|
|
1001
|
-
const { minutes: m } =
|
|
1003
|
+
const { minutes: m } = ge(o);
|
|
1002
1004
|
b = {
|
|
1003
1005
|
...b,
|
|
1004
1006
|
duration: m,
|
|
@@ -1023,7 +1025,7 @@ async function gt(e, t) {
|
|
|
1023
1025
|
throw new Error(
|
|
1024
1026
|
`Task "${e.content}": Cannot determine target project for assignment validation`
|
|
1025
1027
|
);
|
|
1026
|
-
const y = await
|
|
1028
|
+
const y = await ie.validateTaskCreationAssignment(
|
|
1027
1029
|
t,
|
|
1028
1030
|
m,
|
|
1029
1031
|
c
|
|
@@ -1059,7 +1061,7 @@ const yt = {
|
|
|
1059
1061
|
ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to complete.")
|
|
1060
1062
|
}, It = {
|
|
1061
1063
|
completed: s.array(s.string()).describe("The IDs of successfully completed tasks."),
|
|
1062
|
-
failures: s.array(
|
|
1064
|
+
failures: s.array(He).describe("Failed task completions with error details."),
|
|
1063
1065
|
totalRequested: s.number().describe("The total number of tasks requested to complete."),
|
|
1064
1066
|
successCount: s.number().describe("The number of successfully completed tasks."),
|
|
1065
1067
|
failureCount: s.number().describe("The number of failed task completions.")
|
|
@@ -1178,7 +1180,7 @@ Labels: ${a.labels.join(", ")}`), i = {
|
|
|
1178
1180
|
id: `task:${a.id}`,
|
|
1179
1181
|
title: a.content,
|
|
1180
1182
|
text: d.join(""),
|
|
1181
|
-
url:
|
|
1183
|
+
url: me(a.id),
|
|
1182
1184
|
metadata: {
|
|
1183
1185
|
priority: a.priority,
|
|
1184
1186
|
projectId: a.projectId,
|
|
@@ -1193,7 +1195,7 @@ Labels: ${a.labels.join(", ")}`), i = {
|
|
|
1193
1195
|
}
|
|
1194
1196
|
};
|
|
1195
1197
|
} else {
|
|
1196
|
-
const c = await t.getProject(r), a =
|
|
1198
|
+
const c = await t.getProject(r), a = Ie(c), d = [a.name];
|
|
1197
1199
|
a.isShared && d.push(`
|
|
1198
1200
|
|
|
1199
1201
|
Shared project`), a.isFavorite && d.push(`
|
|
@@ -1201,7 +1203,7 @@ Favorite: Yes`), i = {
|
|
|
1201
1203
|
id: `project:${a.id}`,
|
|
1202
1204
|
title: a.name,
|
|
1203
1205
|
text: d.join(""),
|
|
1204
|
-
url:
|
|
1206
|
+
url: fe(a.id),
|
|
1205
1207
|
metadata: {
|
|
1206
1208
|
color: a.color,
|
|
1207
1209
|
isFavorite: a.isFavorite,
|
|
@@ -1234,7 +1236,7 @@ Favorite: Yes`), i = {
|
|
|
1234
1236
|
limit: s.number().int().min(1).max($.ACTIVITY_MAX).default($.ACTIVITY_DEFAULT).describe("Maximum number of activity events to return."),
|
|
1235
1237
|
cursor: s.string().optional().describe("Pagination cursor for retrieving the next page of results.")
|
|
1236
1238
|
}, At = {
|
|
1237
|
-
events: s.array(
|
|
1239
|
+
events: s.array(ze).describe("The activity events."),
|
|
1238
1240
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
1239
1241
|
totalCount: s.number().describe("The total number of events in this page."),
|
|
1240
1242
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
@@ -1250,7 +1252,7 @@ Favorite: Yes`), i = {
|
|
|
1250
1252
|
cursor: l ?? null
|
|
1251
1253
|
};
|
|
1252
1254
|
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);
|
|
1253
|
-
const { results: p, nextCursor: b } = await t.getActivityLogs(u), m = p.map(
|
|
1255
|
+
const { results: p, nextCursor: b } = await t.getActivityLogs(u), m = p.map(Be);
|
|
1254
1256
|
return {
|
|
1255
1257
|
textContent: Pt({ events: m, args: e, nextCursor: b }),
|
|
1256
1258
|
structuredContent: {
|
|
@@ -1330,7 +1332,7 @@ const Nt = {
|
|
|
1330
1332
|
cursor: s.string().optional().describe("Pagination cursor for retrieving more results."),
|
|
1331
1333
|
limit: s.number().int().min(1).max($.COMMENTS_MAX).optional().describe("Maximum number of comments to return")
|
|
1332
1334
|
}, Mt = {
|
|
1333
|
-
comments: s.array(
|
|
1335
|
+
comments: s.array(re).describe("The found comments."),
|
|
1334
1336
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
1335
1337
|
totalCount: s.number().describe("The total number of comments in this page.")
|
|
1336
1338
|
}, Ft = {
|
|
@@ -1366,7 +1368,7 @@ const Nt = {
|
|
|
1366
1368
|
c = l.results, r = l.nextCursor !== null, i = l.nextCursor;
|
|
1367
1369
|
} else
|
|
1368
1370
|
throw new Error("Invalid state: no search parameter provided");
|
|
1369
|
-
const a = c.map(
|
|
1371
|
+
const a = c.map(te);
|
|
1370
1372
|
return {
|
|
1371
1373
|
textContent: Rt({
|
|
1372
1374
|
comments: a,
|
|
@@ -1412,13 +1414,13 @@ ${c}`;
|
|
|
1412
1414
|
}
|
|
1413
1415
|
return i;
|
|
1414
1416
|
}
|
|
1415
|
-
const Lt = ["and", "or"],
|
|
1417
|
+
const Lt = ["and", "or"], ae = {
|
|
1416
1418
|
labels: s.string().array().optional().describe("The labels to filter the tasks by"),
|
|
1417
1419
|
labelsOperator: s.enum(Lt).optional().describe(
|
|
1418
1420
|
'The operator to use when filtering by labels. This will dictate whether a task has all labels, or some of them. Default is "or".'
|
|
1419
1421
|
)
|
|
1420
1422
|
};
|
|
1421
|
-
function
|
|
1423
|
+
function ce(e = [], t = "or") {
|
|
1422
1424
|
if (e.length === 0) return "";
|
|
1423
1425
|
const o = t === "and" ? " & " : " | ";
|
|
1424
1426
|
return `(${e.map((i) => i.startsWith("@") ? i : `@${i}`).join(` ${o} `)})`;
|
|
@@ -1442,7 +1444,7 @@ const Bt = {
|
|
|
1442
1444
|
cursor: s.string().optional().describe(
|
|
1443
1445
|
"The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters)."
|
|
1444
1446
|
),
|
|
1445
|
-
...
|
|
1447
|
+
...ae
|
|
1446
1448
|
}, Wt = {
|
|
1447
1449
|
tasks: s.array(W).describe("The found completed tasks."),
|
|
1448
1450
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
@@ -1455,8 +1457,8 @@ const Bt = {
|
|
|
1455
1457
|
parameters: Bt,
|
|
1456
1458
|
outputSchema: Wt,
|
|
1457
1459
|
async execute(e, t) {
|
|
1458
|
-
const { getBy: o, labels: n, labelsOperator: r, since: i, until: c, responsibleUser: a, projectId: d, ...l } = e, u = await
|
|
1459
|
-
let m =
|
|
1460
|
+
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
|
+
let m = ce(n, r);
|
|
1460
1462
|
u && p && (m = K(m, `assigned to: ${p}`));
|
|
1461
1463
|
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({
|
|
1462
1464
|
...l,
|
|
@@ -1520,7 +1522,7 @@ const { FIND_PROJECTS: Kt, ADD_TASKS: je, UPDATE_TASKS: ve } = g, Ht = {
|
|
|
1520
1522
|
"Search for a collaborator by name or email (partial and case insensitive match). If omitted, all collaborators in the project are returned."
|
|
1521
1523
|
)
|
|
1522
1524
|
}, Vt = {
|
|
1523
|
-
collaborators: s.array(
|
|
1525
|
+
collaborators: s.array(Ke).describe("The found collaborators."),
|
|
1524
1526
|
projectInfo: s.object({
|
|
1525
1527
|
id: s.string().describe("The project ID."),
|
|
1526
1528
|
name: s.string().describe("The project name."),
|
|
@@ -1646,7 +1648,7 @@ const { ADD_PROJECTS: Jt } = g, Xt = {
|
|
|
1646
1648
|
"The cursor to get the next page of projects (cursor is obtained from the previous call to this tool, with the same parameters)."
|
|
1647
1649
|
)
|
|
1648
1650
|
}, Zt = {
|
|
1649
|
-
projects: s.array(
|
|
1651
|
+
projects: s.array(oe).describe("The found projects."),
|
|
1650
1652
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
1651
1653
|
totalCount: s.number().describe("The total number of projects in this page."),
|
|
1652
1654
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
@@ -1660,7 +1662,7 @@ const { ADD_PROJECTS: Jt } = g, Xt = {
|
|
|
1660
1662
|
const { results: o, nextCursor: n } = await t.getProjects({
|
|
1661
1663
|
limit: e.limit,
|
|
1662
1664
|
cursor: e.cursor ?? null
|
|
1663
|
-
}), r = e.search ? e.search.toLowerCase() : void 0, c = (r ? o.filter((a) => a.name.toLowerCase().includes(r)) : o).map(
|
|
1665
|
+
}), r = e.search ? e.search.toLowerCase() : void 0, c = (r ? o.filter((a) => a.name.toLowerCase().includes(r)) : o).map(Ie);
|
|
1664
1666
|
return {
|
|
1665
1667
|
textContent: es({ projects: c, args: e, nextCursor: n }),
|
|
1666
1668
|
structuredContent: {
|
|
@@ -1701,7 +1703,7 @@ const { ADD_SECTIONS: ts } = g, ss = {
|
|
|
1701
1703
|
"Search for a section by name (partial and case insensitive match). If omitted, all sections in the project are returned."
|
|
1702
1704
|
)
|
|
1703
1705
|
}, os = {
|
|
1704
|
-
sections: s.array(
|
|
1706
|
+
sections: s.array(ne).describe("The found sections."),
|
|
1705
1707
|
totalCount: s.number().describe("The total number of sections found."),
|
|
1706
1708
|
appliedFilters: s.record(s.unknown()).describe("The filters that were applied to the search.")
|
|
1707
1709
|
}, ns = {
|
|
@@ -1743,7 +1745,7 @@ function rs({
|
|
|
1743
1745
|
zeroReasonHints: n
|
|
1744
1746
|
});
|
|
1745
1747
|
}
|
|
1746
|
-
const { FIND_COMPLETED_TASKS:
|
|
1748
|
+
const { FIND_COMPLETED_TASKS: le, ADD_TASKS: ue } = g, is = {
|
|
1747
1749
|
searchText: s.string().optional().describe("The text to search for in tasks."),
|
|
1748
1750
|
projectId: s.string().optional().describe(
|
|
1749
1751
|
'Find tasks in this project. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
@@ -1751,14 +1753,14 @@ const { FIND_COMPLETED_TASKS: de, ADD_TASKS: le } = g, is = {
|
|
|
1751
1753
|
sectionId: s.string().optional().describe("Find tasks in this section."),
|
|
1752
1754
|
parentId: s.string().optional().describe("Find subtasks of this parent task."),
|
|
1753
1755
|
responsibleUser: s.string().optional().describe("Find tasks assigned to this user. Can be a user ID, name, or email address."),
|
|
1754
|
-
responsibleUserFiltering: s.enum(
|
|
1756
|
+
responsibleUserFiltering: s.enum(ye).optional().describe(
|
|
1755
1757
|
'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`.'
|
|
1756
1758
|
),
|
|
1757
1759
|
limit: s.number().int().min(1).max($.TASKS_MAX).default($.TASKS_DEFAULT).describe("The maximum number of tasks to return."),
|
|
1758
1760
|
cursor: s.string().optional().describe(
|
|
1759
1761
|
"The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters)."
|
|
1760
1762
|
),
|
|
1761
|
-
...
|
|
1763
|
+
...ae
|
|
1762
1764
|
}, as = {
|
|
1763
1765
|
tasks: s.array(W).describe("The found tasks."),
|
|
1764
1766
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
@@ -1787,7 +1789,7 @@ const { FIND_COMPLETED_TASKS: de, ADD_TASKS: le } = g, is = {
|
|
|
1787
1789
|
throw new Error(
|
|
1788
1790
|
"At least one filter must be provided: searchText, projectId, sectionId, parentId, responsibleUser, or labels"
|
|
1789
1791
|
);
|
|
1790
|
-
const y = await
|
|
1792
|
+
const y = await ee(t, c), k = y?.userId, w = y?.email;
|
|
1791
1793
|
if (n || r || i) {
|
|
1792
1794
|
const f = {
|
|
1793
1795
|
limit: d,
|
|
@@ -1798,7 +1800,7 @@ const { FIND_COMPLETED_TASKS: de, ADD_TASKS: le } = g, is = {
|
|
|
1798
1800
|
let E = o ? x.filter(
|
|
1799
1801
|
(M) => M.content.toLowerCase().includes(o.toLowerCase()) || M.description?.toLowerCase().includes(o.toLowerCase())
|
|
1800
1802
|
) : x;
|
|
1801
|
-
return E =
|
|
1803
|
+
return E = de({
|
|
1802
1804
|
tasks: E,
|
|
1803
1805
|
resolvedAssigneeId: k,
|
|
1804
1806
|
currentUserId: b.id,
|
|
@@ -1850,14 +1852,14 @@ const { FIND_COMPLETED_TASKS: de, ADD_TASKS: le } = g, is = {
|
|
|
1850
1852
|
}
|
|
1851
1853
|
let D = "";
|
|
1852
1854
|
o && (D = `search: ${o}`);
|
|
1853
|
-
const P =
|
|
1855
|
+
const P = ce(u, p);
|
|
1854
1856
|
D = K(D, P);
|
|
1855
|
-
const { tasks: h, nextCursor: T } = await
|
|
1857
|
+
const { tasks: h, nextCursor: T } = await se({
|
|
1856
1858
|
client: t,
|
|
1857
1859
|
query: D,
|
|
1858
1860
|
cursor: e.cursor,
|
|
1859
1861
|
limit: e.limit
|
|
1860
|
-
}), C =
|
|
1862
|
+
}), C = de({
|
|
1861
1863
|
tasks: h,
|
|
1862
1864
|
resolvedAssigneeId: k,
|
|
1863
1865
|
currentUserId: b.id,
|
|
@@ -1886,7 +1888,7 @@ function ds(e) {
|
|
|
1886
1888
|
const t = [
|
|
1887
1889
|
e.searchText ? "No tasks in project match search" : "Project has no tasks yet"
|
|
1888
1890
|
];
|
|
1889
|
-
return e.searchText || t.push(`Use ${
|
|
1891
|
+
return e.searchText || t.push(`Use ${ue} to create tasks`), t;
|
|
1890
1892
|
}
|
|
1891
1893
|
if (e.sectionId) {
|
|
1892
1894
|
const t = [e.searchText ? "No tasks in section match search" : "Section is empty"];
|
|
@@ -1894,7 +1896,7 @@ function ds(e) {
|
|
|
1894
1896
|
}
|
|
1895
1897
|
if (e.parentId) {
|
|
1896
1898
|
const t = [e.searchText ? "No subtasks match search" : "No subtasks created yet"];
|
|
1897
|
-
return e.searchText || t.push(`Use ${
|
|
1899
|
+
return e.searchText || t.push(`Use ${ue} with parentId to add subtasks`), t;
|
|
1898
1900
|
}
|
|
1899
1901
|
return [];
|
|
1900
1902
|
}
|
|
@@ -1930,9 +1932,9 @@ function J({
|
|
|
1930
1932
|
if (e.length === 0) {
|
|
1931
1933
|
if (t.responsibleUser) {
|
|
1932
1934
|
const u = r || t.responsibleUser;
|
|
1933
|
-
a.push(`No tasks assigned to ${u}`), a.push("Check if the user name is correct"), a.push(`Check completed tasks with ${
|
|
1935
|
+
a.push(`No tasks assigned to ${u}`), a.push("Check if the user name is correct"), a.push(`Check completed tasks with ${le}`);
|
|
1934
1936
|
}
|
|
1935
|
-
t.searchText && (a.push("Try broader search terms"), a.push("Verify spelling and try partial words"), t.responsibleUser || a.push(`Check completed tasks with ${
|
|
1937
|
+
t.searchText && (a.push("Try broader search terms"), a.push("Verify spelling and try partial words"), t.responsibleUser || a.push(`Check completed tasks with ${le}`));
|
|
1936
1938
|
}
|
|
1937
1939
|
}
|
|
1938
1940
|
return N({
|
|
@@ -1958,10 +1960,10 @@ const ls = {
|
|
|
1958
1960
|
"The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters)."
|
|
1959
1961
|
),
|
|
1960
1962
|
responsibleUser: s.string().optional().describe("Find tasks assigned to this user. Can be a user ID, name, or email address."),
|
|
1961
|
-
responsibleUserFiltering: s.enum(
|
|
1963
|
+
responsibleUserFiltering: s.enum(ye).optional().describe(
|
|
1962
1964
|
'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".'
|
|
1963
1965
|
),
|
|
1964
|
-
...
|
|
1966
|
+
...ae
|
|
1965
1967
|
}, us = {
|
|
1966
1968
|
tasks: s.array(W).describe("The found tasks."),
|
|
1967
1969
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
@@ -1978,25 +1980,25 @@ const ls = {
|
|
|
1978
1980
|
throw new Error(
|
|
1979
1981
|
"Either startDate must be provided or overdueOption must be set to overdue-only"
|
|
1980
1982
|
);
|
|
1981
|
-
const o = await
|
|
1983
|
+
const o = await ee(t, e.responsibleUser), n = o?.userId, r = o?.email;
|
|
1982
1984
|
let i = "";
|
|
1983
1985
|
if (e.overdueOption === "overdue-only")
|
|
1984
1986
|
i = "overdue";
|
|
1985
1987
|
else if (e.startDate === "today")
|
|
1986
1988
|
i = e.overdueOption === "exclude-overdue" ? "today" : "(today | overdue)";
|
|
1987
1989
|
else if (e.startDate) {
|
|
1988
|
-
const p = e.startDate, b =
|
|
1990
|
+
const p = e.startDate, b = be(p, e.daysCount), m = Ae(b, { representation: "date" });
|
|
1989
1991
|
i = `(due after: ${p} | due: ${p}) & due before: ${m}`;
|
|
1990
1992
|
}
|
|
1991
|
-
const c =
|
|
1993
|
+
const c = ce(e.labels, e.labelsOperator);
|
|
1992
1994
|
c.length > 0 && (i = K(i, `(${c})`));
|
|
1993
|
-
const a =
|
|
1995
|
+
const a = Re({
|
|
1994
1996
|
resolvedAssigneeId: n,
|
|
1995
1997
|
assigneeEmail: r,
|
|
1996
1998
|
responsibleUserFiltering: e.responsibleUserFiltering
|
|
1997
1999
|
});
|
|
1998
2000
|
i = K(i, a);
|
|
1999
|
-
const { tasks: d, nextCursor: l } = await
|
|
2001
|
+
const { tasks: d, nextCursor: l } = await se({
|
|
2000
2002
|
client: t,
|
|
2001
2003
|
query: i,
|
|
2002
2004
|
cursor: e.cursor,
|
|
@@ -2029,7 +2031,7 @@ function hs({
|
|
|
2029
2031
|
`today${a}${t.daysCount > 1 ? ` + ${t.daysCount - 1} more days` : ""}`
|
|
2030
2032
|
);
|
|
2031
2033
|
} else if (t.startDate) {
|
|
2032
|
-
const a = t.daysCount > 1 ? ` to ${dt(
|
|
2034
|
+
const a = t.daysCount > 1 ? ` to ${dt(be(t.startDate, t.daysCount))}` : "";
|
|
2033
2035
|
r.push(`${t.startDate}${a}`);
|
|
2034
2036
|
}
|
|
2035
2037
|
if (t.labels && t.labels.length > 0) {
|
|
@@ -2133,7 +2135,7 @@ function Ce(e, t, o = "") {
|
|
|
2133
2135
|
n.push(...Ce(i, t, `${o} `));
|
|
2134
2136
|
return n;
|
|
2135
2137
|
}
|
|
2136
|
-
function
|
|
2138
|
+
function pe(e) {
|
|
2137
2139
|
const t = {};
|
|
2138
2140
|
for (const n of e)
|
|
2139
2141
|
t[n.id] = { ...n, children: [] };
|
|
@@ -2231,7 +2233,7 @@ async function ks(e, t) {
|
|
|
2231
2233
|
const a = [`# ${o.name}`];
|
|
2232
2234
|
if (c.length > 0) {
|
|
2233
2235
|
a.push("");
|
|
2234
|
-
const u =
|
|
2236
|
+
const u = pe(c);
|
|
2235
2237
|
a.push(...Z(u));
|
|
2236
2238
|
}
|
|
2237
2239
|
for (const u of n) {
|
|
@@ -2239,7 +2241,7 @@ async function ks(e, t) {
|
|
|
2239
2241
|
const p = i[u.id];
|
|
2240
2242
|
if (!p?.length)
|
|
2241
2243
|
continue;
|
|
2242
|
-
const b =
|
|
2244
|
+
const b = pe(p);
|
|
2243
2245
|
a.push(...Z(b));
|
|
2244
2246
|
}
|
|
2245
2247
|
const d = a.join(`
|
|
@@ -2275,7 +2277,7 @@ const ws = {
|
|
|
2275
2277
|
structuredContent: o.structuredContent
|
|
2276
2278
|
};
|
|
2277
2279
|
}
|
|
2278
|
-
}, { FIND_TASKS: js, FIND_PROJECT_COLLABORATORS:
|
|
2280
|
+
}, { FIND_TASKS: js, FIND_PROJECT_COLLABORATORS: he, UPDATE_TASKS: vs } = g, Cs = 50, Ss = {
|
|
2279
2281
|
operation: s.enum(["assign", "unassign", "reassign"]).describe("The assignment operation to perform."),
|
|
2280
2282
|
taskIds: s.array(s.string()).min(1).max(Cs).describe("The IDs of the tasks to operate on (max 50)."),
|
|
2281
2283
|
responsibleUser: s.string().optional().describe(
|
|
@@ -2414,7 +2416,7 @@ const ws = {
|
|
|
2414
2416
|
}
|
|
2415
2417
|
};
|
|
2416
2418
|
}
|
|
2417
|
-
const b = await
|
|
2419
|
+
const b = await ie.validateBulkAssignment(
|
|
2418
2420
|
t,
|
|
2419
2421
|
p
|
|
2420
2422
|
), m = [], y = [];
|
|
@@ -2533,13 +2535,13 @@ function Y({
|
|
|
2533
2535
|
return !o && n.length > 0 ? (a += `**Next steps:**
|
|
2534
2536
|
`, a += `• Use ${js} with responsibleUser to see ${e === "unassign" ? "unassigned" : "newly assigned"} tasks
|
|
2535
2537
|
`, a += `• Use ${vs} for individual assignment changes
|
|
2536
|
-
`, r.length > 0 && (a += `• Check failed tasks and use ${
|
|
2538
|
+
`, r.length > 0 && (a += `• Check failed tasks and use ${he} to verify collaborator access
|
|
2537
2539
|
`)) : o ? (a += `**To execute:**
|
|
2538
2540
|
`, a += `• Remove dryRun parameter and run again to execute changes
|
|
2539
2541
|
`, n.length > 0 && (a += `• ${n.length} task${n.length === 1 ? "" : "s"} ready for ${e} operation
|
|
2540
2542
|
`), r.length > 0 && (a += `• Fix ${r.length} validation error${r.length === 1 ? "" : "s"} before executing
|
|
2541
2543
|
`)) : n.length === 0 && (a += `**Suggestions:**
|
|
2542
|
-
`, a += `• Use ${
|
|
2544
|
+
`, a += `• Use ${he} to find valid assignees
|
|
2543
2545
|
`, a += `• Check task IDs and assignee permissions
|
|
2544
2546
|
`, a += `• Use dryRun=true to validate before executing
|
|
2545
2547
|
`), a;
|
|
@@ -2562,7 +2564,7 @@ const xs = {
|
|
|
2562
2564
|
outputSchema: As,
|
|
2563
2565
|
async execute(e, t) {
|
|
2564
2566
|
const { query: o } = e, [n, r] = await Promise.all([
|
|
2565
|
-
|
|
2567
|
+
se({
|
|
2566
2568
|
client: t,
|
|
2567
2569
|
query: `search: ${o}`,
|
|
2568
2570
|
limit: $.TASKS_MAX,
|
|
@@ -2576,13 +2578,13 @@ const xs = {
|
|
|
2576
2578
|
a.push({
|
|
2577
2579
|
id: `task:${d.id}`,
|
|
2578
2580
|
title: d.content,
|
|
2579
|
-
url:
|
|
2581
|
+
url: me(d.id)
|
|
2580
2582
|
});
|
|
2581
2583
|
for (const d of c)
|
|
2582
2584
|
a.push({
|
|
2583
2585
|
id: `project:${d.id}`,
|
|
2584
2586
|
title: d.name,
|
|
2585
|
-
url:
|
|
2587
|
+
url: fe(d.id)
|
|
2586
2588
|
});
|
|
2587
2589
|
return {
|
|
2588
2590
|
textContent: JSON.stringify({ results: a }),
|
|
@@ -2595,7 +2597,7 @@ const xs = {
|
|
|
2595
2597
|
}), Es = {
|
|
2596
2598
|
comments: s.array(Ps).min(1).describe("The comments to update.")
|
|
2597
2599
|
}, Os = {
|
|
2598
|
-
comments: s.array(
|
|
2600
|
+
comments: s.array(re).describe("The updated comments."),
|
|
2599
2601
|
totalCount: s.number().describe("The total number of comments updated."),
|
|
2600
2602
|
updatedCommentIds: s.array(s.string()).describe("The IDs of the updated comments."),
|
|
2601
2603
|
appliedOperations: s.object({
|
|
@@ -2607,7 +2609,7 @@ const xs = {
|
|
|
2607
2609
|
parameters: Es,
|
|
2608
2610
|
outputSchema: Os,
|
|
2609
2611
|
async execute(e, t) {
|
|
2610
|
-
const { comments: o } = e, n = o.map(async (a) => await t.updateComment(a.id, { content: a.content })), i = (await Promise.all(n)).map(
|
|
2612
|
+
const { comments: o } = e, n = o.map(async (a) => await t.updateComment(a.id, { content: a.content })), i = (await Promise.all(n)).map(te);
|
|
2611
2613
|
return {
|
|
2612
2614
|
textContent: Ns({
|
|
2613
2615
|
comments: i
|
|
@@ -2643,7 +2645,7 @@ const Ms = s.object({
|
|
|
2643
2645
|
}), Fs = {
|
|
2644
2646
|
projects: s.array(Ms).min(1).describe("The projects to update.")
|
|
2645
2647
|
}, Rs = {
|
|
2646
|
-
projects: s.array(
|
|
2648
|
+
projects: s.array(oe).describe("The updated projects."),
|
|
2647
2649
|
totalCount: s.number().describe("The total number of projects updated."),
|
|
2648
2650
|
updatedProjectIds: s.array(s.string()).describe("The IDs of the updated projects."),
|
|
2649
2651
|
appliedOperations: s.object({
|
|
@@ -2704,7 +2706,7 @@ const Ys = s.object({
|
|
|
2704
2706
|
}), zs = {
|
|
2705
2707
|
sections: s.array(Ys).min(1).describe("The sections to update.")
|
|
2706
2708
|
}, Ks = {
|
|
2707
|
-
sections: s.array(
|
|
2709
|
+
sections: s.array(ne).describe("The updated sections."),
|
|
2708
2710
|
totalCount: s.number().describe("The total number of sections updated."),
|
|
2709
2711
|
updatedSectionIds: s.array(s.string()).describe("The IDs of the updated sections.")
|
|
2710
2712
|
}, Hs = {
|
|
@@ -2748,7 +2750,7 @@ const Gs = s.object({
|
|
|
2748
2750
|
sectionId: s.string().optional().describe("The new section ID for the task."),
|
|
2749
2751
|
parentId: s.string().optional().describe("The new parent task ID (for subtasks)."),
|
|
2750
2752
|
order: s.number().optional().describe("The new order of the task within its parent/section."),
|
|
2751
|
-
priority:
|
|
2753
|
+
priority: Q.optional().describe(
|
|
2752
2754
|
"The new priority of the task: p1 (highest), p2 (high), p3 (medium), p4 (lowest/default)."
|
|
2753
2755
|
),
|
|
2754
2756
|
dueString: s.string().optional().describe("The new due date for the task, in natural language (e.g., 'tomorrow at 5pm')."),
|
|
@@ -2799,9 +2801,9 @@ const Gs = s.object({
|
|
|
2799
2801
|
...D,
|
|
2800
2802
|
...k !== void 0 && { labels: k }
|
|
2801
2803
|
};
|
|
2802
|
-
if (y && (h.priority =
|
|
2804
|
+
if (y && (h.priority = Te(y)), w !== void 0 && (w === null || w === "remove" ? h = { ...h, deadlineDate: null } : h = { ...h, deadlineDate: w }), b)
|
|
2803
2805
|
try {
|
|
2804
|
-
const { minutes: v } =
|
|
2806
|
+
const { minutes: v } = ge(b);
|
|
2805
2807
|
h = {
|
|
2806
2808
|
...h,
|
|
2807
2809
|
duration: v,
|
|
@@ -2814,7 +2816,7 @@ const Gs = s.object({
|
|
|
2814
2816
|
if (m === null || m === "unassign")
|
|
2815
2817
|
h = { ...h, assigneeId: null };
|
|
2816
2818
|
else {
|
|
2817
|
-
const v = await
|
|
2819
|
+
const v = await ie.validateTaskUpdateAssignment(
|
|
2818
2820
|
t,
|
|
2819
2821
|
d,
|
|
2820
2822
|
m
|
|
@@ -2829,7 +2831,7 @@ const Gs = s.object({
|
|
|
2829
2831
|
}
|
|
2830
2832
|
if (!P && !u && !p)
|
|
2831
2833
|
return await t.updateTask(d, h);
|
|
2832
|
-
const T =
|
|
2834
|
+
const T = Le(d, P, u, p), C = await t.moveTask(d, T);
|
|
2833
2835
|
return Object.keys(h).length > 0 ? await t.updateTask(d, h) : C;
|
|
2834
2836
|
}), r = (await Promise.all(n)).filter(
|
|
2835
2837
|
(a) => a !== void 0
|
|
@@ -3059,7 +3061,7 @@ function To({ todoistApiKey: e, baseUrl: t }) {
|
|
|
3059
3061
|
instructions: po
|
|
3060
3062
|
}
|
|
3061
3063
|
), n = new De(e, t);
|
|
3062
|
-
return I(bt, o, n), I(kt, o, n), I(Xs, o, n), I(cs, o, n), I(ps, o, n), I(Yt, o, n), I(
|
|
3064
|
+
return I(bt, o, n), I(kt, o, n), I(Xs, o, n), I(cs, o, n), I(ps, o, n), I(Yt, o, n), I(tt, o, n), I(Ls, o, n), I(Qt, o, n), I(it, o, n), I(Hs, o, n), I(ns, o, n), I(Je, o, n), I(Ft, o, n), I(_s, o, n), I(Ut, o, n), I(ws, o, n), I(Ct, o, n), I(uo, o, n), I(Gt, o, n), I(Ds, o, n), I(Us, o, n), I(Dt, o, n), o;
|
|
3063
3065
|
}
|
|
3064
3066
|
export {
|
|
3065
3067
|
Gt as a,
|
|
@@ -3070,14 +3072,14 @@ export {
|
|
|
3070
3072
|
Dt as f,
|
|
3071
3073
|
To as g,
|
|
3072
3074
|
_s as h,
|
|
3073
|
-
|
|
3075
|
+
Je as i,
|
|
3074
3076
|
ns as j,
|
|
3075
3077
|
Hs as k,
|
|
3076
|
-
|
|
3078
|
+
it as l,
|
|
3077
3079
|
Ds as m,
|
|
3078
3080
|
Qt as n,
|
|
3079
3081
|
Ls as o,
|
|
3080
|
-
|
|
3082
|
+
tt as p,
|
|
3081
3083
|
Yt as q,
|
|
3082
3084
|
ps as r,
|
|
3083
3085
|
Us as s,
|