@doist/todoist-mcp 13.2.5 → 13.2.6
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.
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { ResourceTemplate as
|
|
1
|
+
import { ResourceTemplate as zs, McpServer as Ks } from "@modelcontextprotocol/server";
|
|
2
2
|
import { createHash as Gt, randomUUID as Ne } from "node:crypto";
|
|
3
|
-
import { readFileSync as
|
|
3
|
+
import { readFileSync as qs } from "node:fs";
|
|
4
4
|
import { dirname as Vt, join as Me } from "node:path";
|
|
5
|
-
import { fileURLToPath as
|
|
5
|
+
import { fileURLToPath as Ys } from "node:url";
|
|
6
6
|
import { RESOURCE_MIME_TYPE as Fe } from "@modelcontextprotocol/ext-apps/server";
|
|
7
|
-
import ce, { ZodError as
|
|
8
|
-
import { AsyncLocalStorage as
|
|
9
|
-
import { createRequire as
|
|
10
|
-
import { TodoistApi as
|
|
7
|
+
import ce, { ZodError as Gs, z as s } from "zod";
|
|
8
|
+
import { AsyncLocalStorage as Vs } from "node:async_hooks";
|
|
9
|
+
import { createRequire as Js } from "node:module";
|
|
10
|
+
import { TodoistApi as Xs, isWorkspaceProject as Ce, isPersonalProject as q, colors as He, LOCATION_TRIGGERS as Jt, REMINDER_TYPES as Qs, createCommand as Q, REMINDER_DELIVERY_SERVICES as Zs, HEALTH_STATUSES as tt, getTaskUrl as Xt, getProjectUrl as Qt, escapeFilterToken as Zt, parseTodoistUrl as er, WORKSPACE_ROLES as tr, WORKSPACE_PLANS as sr } from "@doist/todoist-sdk";
|
|
11
11
|
import { addDays as We, formatISO as yt } from "date-fns";
|
|
12
|
-
const Tt = Vt(
|
|
12
|
+
const Tt = Vt(Ys(import.meta.url)), rr = [
|
|
13
13
|
Me(Tt, "task-list", "index.html"),
|
|
14
14
|
Me(Tt, "mcp-apps", "index.html")
|
|
15
|
-
],
|
|
15
|
+
], or = `<!doctype html>
|
|
16
16
|
<html>
|
|
17
17
|
<body>
|
|
18
18
|
<p>Task list app is missing. Run "npm run build" to generate it.</p>
|
|
19
19
|
</body>
|
|
20
20
|
</html>`;
|
|
21
|
-
function
|
|
21
|
+
function nr() {
|
|
22
22
|
const e = [];
|
|
23
|
-
for (const t of
|
|
23
|
+
for (const t of rr)
|
|
24
24
|
try {
|
|
25
|
-
return
|
|
25
|
+
return qs(t, "utf-8");
|
|
26
26
|
} catch (r) {
|
|
27
27
|
e.push(r);
|
|
28
28
|
}
|
|
29
|
-
return console.error("Failed to load task list app HTML from any known path:", e),
|
|
29
|
+
return console.error("Failed to load task list app HTML from any known path:", e), or;
|
|
30
30
|
}
|
|
31
|
-
const
|
|
31
|
+
const es = nr(), ir = Gt("sha256").update(es).digest("hex").slice(0, 12), Be = `ui://todoist/task-list@${ir}`, ar = "ui://todoist/task-list@{hash}", ze = "Interactive task list widget", cr = "https://ai.todoist.net", Ke = {
|
|
32
32
|
ui: {
|
|
33
33
|
prefersBorder: !0,
|
|
34
34
|
csp: {
|
|
@@ -43,7 +43,7 @@ const Zt = or(), nr = Gt("sha256").update(Zt).digest("hex").slice(0, 12), Be = `
|
|
|
43
43
|
connect_domains: [],
|
|
44
44
|
resource_domains: []
|
|
45
45
|
},
|
|
46
|
-
"openai/widgetDomain":
|
|
46
|
+
"openai/widgetDomain": cr
|
|
47
47
|
};
|
|
48
48
|
function kt(e) {
|
|
49
49
|
return {
|
|
@@ -51,13 +51,13 @@ function kt(e) {
|
|
|
51
51
|
{
|
|
52
52
|
uri: e,
|
|
53
53
|
mimeType: Fe,
|
|
54
|
-
text:
|
|
54
|
+
text: es,
|
|
55
55
|
_meta: Ke
|
|
56
56
|
}
|
|
57
57
|
]
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function dr(e) {
|
|
61
61
|
e.registerResource(
|
|
62
62
|
"todoist-task-list",
|
|
63
63
|
Be,
|
|
@@ -69,7 +69,7 @@ function cr(e) {
|
|
|
69
69
|
async () => kt(Be)
|
|
70
70
|
), e.registerResource(
|
|
71
71
|
"todoist-task-list-hash-fallback",
|
|
72
|
-
new
|
|
72
|
+
new zs(ar, { list: void 0 }),
|
|
73
73
|
{
|
|
74
74
|
description: `${ze} compatibility fallback`,
|
|
75
75
|
mimeType: Fe,
|
|
@@ -105,14 +105,14 @@ function de(e) {
|
|
|
105
105
|
const t = O(e);
|
|
106
106
|
return t !== void 0 ? t : v(e);
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function lr(e) {
|
|
109
109
|
return e.replace(/\b(Bearer)\s+[A-Za-z0-9._~+/=-]+/gi, "$1 [REDACTED]").replace(
|
|
110
110
|
/\b(token|api[_-]?key|authorization)\s*[:=]\s*["']?[A-Za-z0-9._~+/=-]{6,}["']?/gi,
|
|
111
111
|
"$1: [REDACTED]"
|
|
112
112
|
).replace(/([?&](?:token|api[_-]?key|authorization)=)[^&\s]+/gi, "$1[REDACTED]").replace(/\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\b/g, "[REDACTED]");
|
|
113
113
|
}
|
|
114
114
|
function L(e, t = 220) {
|
|
115
|
-
const r =
|
|
115
|
+
const r = lr(e).replace(/\s+/g, " ").trim();
|
|
116
116
|
return r.length <= t ? r : `${r.slice(0, t - 3)}...`;
|
|
117
117
|
}
|
|
118
118
|
function Ye(e) {
|
|
@@ -153,7 +153,7 @@ function X(e) {
|
|
|
153
153
|
}
|
|
154
154
|
return o.length > 0 ? L(o.join("; ")) : void 0;
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function ur(e) {
|
|
157
157
|
if (!e)
|
|
158
158
|
return [];
|
|
159
159
|
const t = /* @__PURE__ */ new Set(), r = (a) => {
|
|
@@ -216,7 +216,7 @@ function lr(e) {
|
|
|
216
216
|
}
|
|
217
217
|
return Array.from(t).slice(0, 3);
|
|
218
218
|
}
|
|
219
|
-
const
|
|
219
|
+
const pr = [
|
|
220
220
|
"error",
|
|
221
221
|
"error_code",
|
|
222
222
|
"error_tag",
|
|
@@ -227,14 +227,14 @@ const ur = [
|
|
|
227
227
|
"httpCode",
|
|
228
228
|
"errorExtra"
|
|
229
229
|
];
|
|
230
|
-
function
|
|
231
|
-
return e ?
|
|
230
|
+
function hr(e) {
|
|
231
|
+
return e ? pr.some((t) => e[t] !== void 0) : !1;
|
|
232
232
|
}
|
|
233
233
|
const Ge = {
|
|
234
234
|
MAX_ITEMS_LIMIT_REACHED: "This project has reached the maximum number of active tasks per project (subtasks count toward it; completed tasks do not). The cap is the same on every Todoist plan — upgrading will not raise it — and it is not an authentication or permission problem. Complete, delete, or move existing tasks out of the project, or add the task to a different project, then retry.",
|
|
235
235
|
USER_CANNOT_VIEW_TEMPLATE: "This template exists but belongs to another account. Personal templates are private to whoever saved them, and a link to one cannot be used by anyone else. Use a public gallery template instead, or ask the owner to export it with export-project-template and share the CSV."
|
|
236
236
|
};
|
|
237
|
-
function
|
|
237
|
+
function mr(...e) {
|
|
238
238
|
for (const t of e) {
|
|
239
239
|
if (!t)
|
|
240
240
|
continue;
|
|
@@ -245,16 +245,16 @@ function hr(...e) {
|
|
|
245
245
|
return Ge[o];
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
|
-
function
|
|
248
|
+
function fr(e) {
|
|
249
249
|
if (e.tag) {
|
|
250
250
|
const t = Ge[e.tag.toUpperCase()];
|
|
251
251
|
if (t)
|
|
252
252
|
return t;
|
|
253
253
|
}
|
|
254
|
-
return
|
|
254
|
+
return mr(...e.rawText ?? [], e.message, e.details);
|
|
255
255
|
}
|
|
256
|
-
function
|
|
257
|
-
const t =
|
|
256
|
+
function br(e) {
|
|
257
|
+
const t = fr(e);
|
|
258
258
|
if (t)
|
|
259
259
|
return t;
|
|
260
260
|
const { statusCode: r } = e, o = e.fieldHints.length > 0;
|
|
@@ -308,8 +308,8 @@ function st(e) {
|
|
|
308
308
|
X(n?.errorDetails),
|
|
309
309
|
X(n?.errors),
|
|
310
310
|
X(t?.details)
|
|
311
|
-
), p =
|
|
312
|
-
return i !== void 0 ||
|
|
311
|
+
), p = ur(n);
|
|
312
|
+
return i !== void 0 || hr(n) || c !== void 0 || a !== void 0 || (u ? Ye(u) : !1) ? {
|
|
313
313
|
statusCode: i,
|
|
314
314
|
code: a,
|
|
315
315
|
tag: c ? L(c, 80) : void 0,
|
|
@@ -319,18 +319,18 @@ function st(e) {
|
|
|
319
319
|
fieldHints: p
|
|
320
320
|
} : null;
|
|
321
321
|
}
|
|
322
|
-
function
|
|
322
|
+
function ts(e) {
|
|
323
323
|
const t = [];
|
|
324
324
|
return e.statusCode !== void 0 && t.push(`HTTP ${e.statusCode}`), e.code !== void 0 && t.push(`code ${e.code}`), e.tag && t.push(`tag ${e.tag}`), t;
|
|
325
325
|
}
|
|
326
|
-
function
|
|
327
|
-
const t =
|
|
326
|
+
function gr(e) {
|
|
327
|
+
const t = ts(e), r = [
|
|
328
328
|
t.length > 0 ? `Todoist API request failed (${t.join(", ")}).` : "Todoist API request failed."
|
|
329
329
|
];
|
|
330
|
-
return e.message && r.push(`Message: ${e.message}`), e.details && e.details !== e.message && r.push(`Details: ${e.details}`), e.fieldHints.length > 0 && r.push(`Field hints: ${e.fieldHints.join("; ")}`), r.push(`Try next: ${
|
|
330
|
+
return e.message && r.push(`Message: ${e.message}`), e.details && e.details !== e.message && r.push(`Details: ${e.details}`), e.fieldHints.length > 0 && r.push(`Field hints: ${e.fieldHints.join("; ")}`), r.push(`Try next: ${br(e)}`), r.join(`
|
|
331
331
|
`);
|
|
332
332
|
}
|
|
333
|
-
function
|
|
333
|
+
function ss(e) {
|
|
334
334
|
return e instanceof Error ? L(e.message) : typeof e == "string" ? L(e) : "An unknown error occurred";
|
|
335
335
|
}
|
|
336
336
|
class $e extends Error {
|
|
@@ -338,7 +338,7 @@ class $e extends Error {
|
|
|
338
338
|
super(t), this.name = "DueStringParseError";
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
|
-
class
|
|
341
|
+
class rs extends Error {
|
|
342
342
|
constructor(t) {
|
|
343
343
|
super(t), this.name = "BatchDueStringParseError";
|
|
344
344
|
}
|
|
@@ -348,11 +348,11 @@ function N(e) {
|
|
|
348
348
|
return e.message;
|
|
349
349
|
const t = st(e);
|
|
350
350
|
if (!t)
|
|
351
|
-
return
|
|
352
|
-
const r =
|
|
351
|
+
return ss(e);
|
|
352
|
+
const r = ts(t), o = t.message && !(r.length > 0 && Ye(t.message)) ? t.message : "Todoist API request failed";
|
|
353
353
|
return r.length > 0 ? `${o} (${r.join(", ")})` : o;
|
|
354
354
|
}
|
|
355
|
-
function
|
|
355
|
+
function yr(e, {
|
|
356
356
|
taskContent: t,
|
|
357
357
|
dueString: r,
|
|
358
358
|
deadlineDate: o
|
|
@@ -365,14 +365,14 @@ function gr(e, {
|
|
|
365
365
|
const d = r.trim().replace(/^recurring(?:\s+|$)/i, "").trim();
|
|
366
366
|
return d !== r.trim() && d ? `Task "${t}" wasn't created because \`dueString\` could not be parsed. Use Todoist recurrence syntax, for example \`${d}\`; don't prefix it with \`recurring\`. Change only \`dueString\` and retry.` : d !== r.trim() ? `Task "${t}" wasn't created because \`dueString\` could not be parsed. Use a complete Todoist recurrence expression; \`recurring\` alone is not valid. Change only \`dueString\` and retry.` : `Task "${t}" wasn't created because \`dueString\` could not be parsed. Change only \`dueString\` and retry.`;
|
|
367
367
|
}
|
|
368
|
-
function
|
|
369
|
-
if (e instanceof
|
|
368
|
+
function Tr(e) {
|
|
369
|
+
if (e instanceof Gs || e instanceof $e || e instanceof rs)
|
|
370
370
|
return e.message;
|
|
371
371
|
const t = st(e);
|
|
372
|
-
return t ?
|
|
372
|
+
return t ? gr(t) : ss(e);
|
|
373
373
|
}
|
|
374
|
-
const
|
|
375
|
-
version:
|
|
374
|
+
const kr = "13.2.6", wr = {
|
|
375
|
+
version: kr
|
|
376
376
|
}, j = {
|
|
377
377
|
/** Default limit for task listings */
|
|
378
378
|
TASKS_DEFAULT: 10,
|
|
@@ -409,10 +409,10 @@ const Tr = "13.2.5", kr = {
|
|
|
409
409
|
}, Te = {
|
|
410
410
|
/** Maximum number of failures to show in detailed error messages */
|
|
411
411
|
MAX_FAILURES_SHOWN: 3
|
|
412
|
-
},
|
|
412
|
+
}, vr = {
|
|
413
413
|
/** Maximum number of failed items named in one log line */
|
|
414
414
|
MAX_FAILURES_LOGGED: 5
|
|
415
|
-
},
|
|
415
|
+
}, os = {
|
|
416
416
|
/** Maximum tasks accepted by one task create or update operation */
|
|
417
417
|
TASKS_PER_OPERATION: 25
|
|
418
418
|
}, Ve = {
|
|
@@ -487,60 +487,60 @@ function rt() {
|
|
|
487
487
|
writes: wt(Ve.WRITES)
|
|
488
488
|
};
|
|
489
489
|
}
|
|
490
|
-
const
|
|
491
|
-
let
|
|
492
|
-
const
|
|
490
|
+
const Ir = 1e4, Sr = 5 * 6e4, W = /* @__PURE__ */ new Map();
|
|
491
|
+
let Cr = Ir;
|
|
492
|
+
const ns = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new Map();
|
|
493
493
|
let vt, It;
|
|
494
|
-
function
|
|
494
|
+
function jr() {
|
|
495
495
|
return vt ??= rt(), vt;
|
|
496
496
|
}
|
|
497
497
|
function St() {
|
|
498
498
|
return It ??= rt(), It;
|
|
499
499
|
}
|
|
500
|
-
function
|
|
500
|
+
function $r(e) {
|
|
501
501
|
return Gt("sha256").update(e).digest("hex");
|
|
502
502
|
}
|
|
503
|
-
function
|
|
503
|
+
function Ar({ moves: e, writes: t }) {
|
|
504
504
|
return e.isIdle() && t.isIdle();
|
|
505
505
|
}
|
|
506
|
-
function
|
|
507
|
-
return e.leases === 0 &&
|
|
506
|
+
function is(e) {
|
|
507
|
+
return e.leases === 0 && Ar(e.limiters);
|
|
508
508
|
}
|
|
509
|
-
function
|
|
509
|
+
function Dr(e, t, r) {
|
|
510
510
|
W.delete(e), t.lastUsedAt = r, W.set(e, t);
|
|
511
511
|
}
|
|
512
|
-
function
|
|
512
|
+
function xr(e) {
|
|
513
513
|
for (const [t, r] of W) {
|
|
514
|
-
if (e - r.lastUsedAt <
|
|
514
|
+
if (e - r.lastUsedAt < Sr)
|
|
515
515
|
break;
|
|
516
|
-
|
|
516
|
+
is(r) && W.delete(t);
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
|
-
function
|
|
519
|
+
function Er() {
|
|
520
520
|
for (const [e, t] of W)
|
|
521
|
-
if (
|
|
521
|
+
if (is(t))
|
|
522
522
|
return W.delete(e), !0;
|
|
523
523
|
return !1;
|
|
524
524
|
}
|
|
525
|
-
function
|
|
525
|
+
function as(e, t) {
|
|
526
526
|
if (Z.has(e))
|
|
527
527
|
return;
|
|
528
528
|
const r = W.get(e);
|
|
529
529
|
if (r)
|
|
530
|
-
return
|
|
531
|
-
if (
|
|
530
|
+
return Dr(e, r, t), r;
|
|
531
|
+
if (xr(t), W.size >= Cr && !Er())
|
|
532
532
|
return;
|
|
533
533
|
const o = { limiters: rt(), lastUsedAt: t, leases: 0 };
|
|
534
534
|
return W.set(e, o), o;
|
|
535
535
|
}
|
|
536
|
-
function
|
|
536
|
+
function Or(e) {
|
|
537
537
|
const t = Z.get(e);
|
|
538
538
|
if (t !== void 0)
|
|
539
539
|
return Z.set(e, t + 1), {
|
|
540
540
|
limiters: St(),
|
|
541
541
|
release: () => Ct(e)
|
|
542
542
|
};
|
|
543
|
-
const r =
|
|
543
|
+
const r = as(e, Date.now());
|
|
544
544
|
return r ? (r.leases++, {
|
|
545
545
|
limiters: r.limiters,
|
|
546
546
|
release: () => {
|
|
@@ -559,51 +559,51 @@ function Ct(e) {
|
|
|
559
559
|
}
|
|
560
560
|
Z.set(e, t - 1);
|
|
561
561
|
}
|
|
562
|
-
function
|
|
563
|
-
const r =
|
|
564
|
-
|
|
562
|
+
function _r(e, t) {
|
|
563
|
+
const r = $r(t);
|
|
564
|
+
ns.set(e, r);
|
|
565
565
|
}
|
|
566
|
-
function
|
|
567
|
-
const r =
|
|
568
|
-
return r ? (
|
|
569
|
-
const n =
|
|
566
|
+
function cs(e, t) {
|
|
567
|
+
const r = ns.get(e);
|
|
568
|
+
return r ? (as(r, Date.now()), async (o) => {
|
|
569
|
+
const n = Or(r);
|
|
570
570
|
try {
|
|
571
571
|
return await n.limiters[t](o);
|
|
572
572
|
} finally {
|
|
573
573
|
n.release();
|
|
574
574
|
}
|
|
575
|
-
}) :
|
|
576
|
-
}
|
|
577
|
-
function _r(e) {
|
|
578
|
-
return as(e, "moves");
|
|
575
|
+
}) : jr()[t];
|
|
579
576
|
}
|
|
580
577
|
function Pr(e) {
|
|
581
|
-
return
|
|
578
|
+
return cs(e, "moves");
|
|
579
|
+
}
|
|
580
|
+
function Ur(e) {
|
|
581
|
+
return cs(e, "writes");
|
|
582
582
|
}
|
|
583
|
-
const
|
|
583
|
+
const Rr = "todoist-mcp", ot = wr.version, ds = new Vs(), jt = Js(import.meta.url);
|
|
584
584
|
let Se;
|
|
585
|
-
const
|
|
585
|
+
const Lr = async () => {
|
|
586
586
|
const e = jt.resolve("@doist/todoist-sdk"), t = Me(Vt(e), "transport", "http-dispatcher.js");
|
|
587
587
|
return jt(t);
|
|
588
588
|
};
|
|
589
|
-
let
|
|
590
|
-
function
|
|
591
|
-
return `${
|
|
589
|
+
let Nr = Lr;
|
|
590
|
+
function Mr() {
|
|
591
|
+
return `${Rr}/${ot}`;
|
|
592
592
|
}
|
|
593
|
-
function
|
|
593
|
+
function ls(e) {
|
|
594
594
|
return e.trim().toLowerCase();
|
|
595
595
|
}
|
|
596
|
-
function
|
|
597
|
-
return
|
|
596
|
+
function Fr(e, t) {
|
|
597
|
+
return ds.run(ls(e), t);
|
|
598
598
|
}
|
|
599
|
-
function
|
|
599
|
+
function Hr({
|
|
600
600
|
label: e,
|
|
601
601
|
platform: t = "mcp",
|
|
602
602
|
sessionId: r = Ne()
|
|
603
603
|
} = {}) {
|
|
604
|
-
const o = e ?
|
|
604
|
+
const o = e ? ls(e) : ds.getStore();
|
|
605
605
|
return {
|
|
606
|
-
"User-Agent":
|
|
606
|
+
"User-Agent": Mr(),
|
|
607
607
|
"doist-platform": t,
|
|
608
608
|
"doist-version": ot,
|
|
609
609
|
"request-id": Ne(),
|
|
@@ -611,16 +611,16 @@ function Fr({
|
|
|
611
611
|
"mcp-tool": o ?? "unknown"
|
|
612
612
|
};
|
|
613
613
|
}
|
|
614
|
-
function
|
|
614
|
+
function Wr(e, t) {
|
|
615
615
|
const r = new Headers(e);
|
|
616
|
-
for (const [o, n] of Object.entries(
|
|
616
|
+
for (const [o, n] of Object.entries(Hr(t)))
|
|
617
617
|
r.set(o, n);
|
|
618
618
|
return Object.fromEntries(r.entries());
|
|
619
619
|
}
|
|
620
620
|
function $t() {
|
|
621
621
|
return new DOMException("The operation was aborted due to timeout", "TimeoutError");
|
|
622
622
|
}
|
|
623
|
-
function
|
|
623
|
+
function Br(e, t) {
|
|
624
624
|
if (!e && t === void 0)
|
|
625
625
|
return {
|
|
626
626
|
signal: void 0,
|
|
@@ -658,22 +658,22 @@ function Wr(e, t) {
|
|
|
658
658
|
}
|
|
659
659
|
};
|
|
660
660
|
}
|
|
661
|
-
async function
|
|
662
|
-
if (
|
|
663
|
-
return Se || (Se =
|
|
661
|
+
async function zr() {
|
|
662
|
+
if (Kr())
|
|
663
|
+
return Se || (Se = Nr().then((e) => e.getDefaultTransport()).catch((e) => {
|
|
664
664
|
throw Se = void 0, e;
|
|
665
665
|
})), Se;
|
|
666
666
|
}
|
|
667
|
-
function
|
|
667
|
+
function Kr() {
|
|
668
668
|
return typeof process < "u" && !!process.versions?.node;
|
|
669
669
|
}
|
|
670
|
-
async function
|
|
670
|
+
async function qr(e, t) {
|
|
671
671
|
if ("dispatcher" in t)
|
|
672
672
|
return e;
|
|
673
|
-
const r = await
|
|
673
|
+
const r = await zr();
|
|
674
674
|
return r ? (t.dispatcher = r.dispatcher, r.fetch ?? e) : e;
|
|
675
675
|
}
|
|
676
|
-
function
|
|
676
|
+
function Yr(e) {
|
|
677
677
|
return {
|
|
678
678
|
ok: e.ok,
|
|
679
679
|
status: e.status,
|
|
@@ -684,34 +684,34 @@ function qr(e) {
|
|
|
684
684
|
arrayBuffer: () => e.arrayBuffer()
|
|
685
685
|
};
|
|
686
686
|
}
|
|
687
|
-
function
|
|
687
|
+
function Gr(e = globalThis.fetch, t = {}) {
|
|
688
688
|
const r = e === globalThis.fetch, { enabled: o = !0, platform: n = "mcp", sessionId: i = Ne() } = t;
|
|
689
689
|
return async (a, c = {}) => {
|
|
690
|
-
const { timeout: d, headers: u, signal: l, ...p } = c, { signal: h, cleanup: m } =
|
|
690
|
+
const { timeout: d, headers: u, signal: l, ...p } = c, { signal: h, cleanup: m } = Br(l, d);
|
|
691
691
|
try {
|
|
692
692
|
const y = {
|
|
693
693
|
...p,
|
|
694
694
|
signal: h,
|
|
695
|
-
...o ? { headers:
|
|
696
|
-
}, w = await (r ? await
|
|
697
|
-
return
|
|
695
|
+
...o ? { headers: Wr(u, { platform: n, sessionId: i }) } : u !== void 0 ? { headers: u } : {}
|
|
696
|
+
}, w = await (r ? await qr(e, y) : e)(a, y);
|
|
697
|
+
return Yr(w);
|
|
698
698
|
} finally {
|
|
699
699
|
m();
|
|
700
700
|
}
|
|
701
701
|
};
|
|
702
702
|
}
|
|
703
|
-
function
|
|
703
|
+
function Vr(e, {
|
|
704
704
|
baseUrl: t,
|
|
705
705
|
tracking: r
|
|
706
706
|
} = {}) {
|
|
707
|
-
const o = new
|
|
708
|
-
customFetch:
|
|
707
|
+
const o = new Xs(e, {
|
|
708
|
+
customFetch: Gr(globalThis.fetch, r),
|
|
709
709
|
...t ? { baseUrl: t } : {}
|
|
710
710
|
});
|
|
711
|
-
return
|
|
711
|
+
return _r(o, e), o;
|
|
712
712
|
}
|
|
713
|
-
const
|
|
714
|
-
function
|
|
713
|
+
const Jr = 2, Xr = 500, Qr = 2e3, Zr = 50, eo = /* @__PURE__ */ new Set([502, 503, 504]);
|
|
714
|
+
function to(e) {
|
|
715
715
|
if (e == null || typeof e != "object")
|
|
716
716
|
return;
|
|
717
717
|
const t = e;
|
|
@@ -727,32 +727,32 @@ function eo(e) {
|
|
|
727
727
|
return Number(r[1]);
|
|
728
728
|
}
|
|
729
729
|
}
|
|
730
|
-
function
|
|
731
|
-
const t =
|
|
732
|
-
return t !== void 0 &&
|
|
730
|
+
function so(e) {
|
|
731
|
+
const t = to(e);
|
|
732
|
+
return t !== void 0 && eo.has(t);
|
|
733
733
|
}
|
|
734
|
-
function
|
|
734
|
+
function ro({
|
|
735
735
|
attempt: e,
|
|
736
736
|
baseDelayMs: t,
|
|
737
737
|
maxDelayMs: r,
|
|
738
738
|
random: o = Math.random
|
|
739
739
|
}) {
|
|
740
740
|
const n = Math.min(t * 2 ** e, r), i = Math.round(o() * n);
|
|
741
|
-
return Math.min(n, Math.max(
|
|
741
|
+
return Math.min(n, Math.max(Zr, i));
|
|
742
742
|
}
|
|
743
|
-
function
|
|
743
|
+
function oo(e) {
|
|
744
744
|
return new Promise((t) => setTimeout(t, e));
|
|
745
745
|
}
|
|
746
746
|
async function _(e, t = {}) {
|
|
747
|
-
const r = t.maxRetries ??
|
|
747
|
+
const r = t.maxRetries ?? Jr, o = t.baseDelayMs ?? Xr, n = t.maxDelayMs ?? Qr, i = t.random;
|
|
748
748
|
let a;
|
|
749
749
|
for (let c = 0; c <= r; c++)
|
|
750
750
|
try {
|
|
751
751
|
return await e();
|
|
752
752
|
} catch (d) {
|
|
753
|
-
if (a = d, c < r &&
|
|
754
|
-
const u =
|
|
755
|
-
await
|
|
753
|
+
if (a = d, c < r && so(d)) {
|
|
754
|
+
const u = ro({ attempt: c, baseDelayMs: o, maxDelayMs: n, random: i });
|
|
755
|
+
await oo(u);
|
|
756
756
|
continue;
|
|
757
757
|
}
|
|
758
758
|
throw d;
|
|
@@ -840,13 +840,13 @@ const g = {
|
|
|
840
840
|
// OpenAI MCP tools
|
|
841
841
|
SEARCH: "search",
|
|
842
842
|
FETCH: "fetch"
|
|
843
|
-
},
|
|
843
|
+
}, bl = {
|
|
844
844
|
/**
|
|
845
845
|
* Strips email addresses from tool outputs that expose user data.
|
|
846
846
|
* Affects: find-project-collaborators, find-completed-tasks
|
|
847
847
|
*/
|
|
848
848
|
STRIP_EMAILS: "strip_emails"
|
|
849
|
-
},
|
|
849
|
+
}, no = process.env.USE_STRUCTURED_CONTENT === "true" || process.env.NODE_ENV === "test", At = /* @__PURE__ */ new WeakMap();
|
|
850
850
|
function Dt(e, t) {
|
|
851
851
|
const r = s.toJSONSchema(e, { target: "draft-2020-12", io: t }), o = e["~standard"];
|
|
852
852
|
return {
|
|
@@ -859,7 +859,7 @@ function Dt(e, t) {
|
|
|
859
859
|
}
|
|
860
860
|
};
|
|
861
861
|
}
|
|
862
|
-
function
|
|
862
|
+
function io(e) {
|
|
863
863
|
const t = At.get(e);
|
|
864
864
|
if (t)
|
|
865
865
|
return t;
|
|
@@ -869,48 +869,48 @@ function no(e) {
|
|
|
869
869
|
};
|
|
870
870
|
return At.set(e, r), r;
|
|
871
871
|
}
|
|
872
|
-
function
|
|
872
|
+
function ao({
|
|
873
873
|
textContent: e,
|
|
874
874
|
structuredContent: t,
|
|
875
875
|
contentItems: r
|
|
876
876
|
}) {
|
|
877
877
|
const o = Je(t), n = {}, i = [];
|
|
878
|
-
return r && i.push(...r), !
|
|
878
|
+
return r && i.push(...r), !no && t && i.push({
|
|
879
879
|
type: "text",
|
|
880
880
|
text: JSON.stringify(o)
|
|
881
881
|
}), e && i.push({ type: "text", text: e }), i.length > 0 && (n.content = i), t && (n.structuredContent = o), n;
|
|
882
882
|
}
|
|
883
|
-
function
|
|
883
|
+
function co(e) {
|
|
884
884
|
return {
|
|
885
885
|
content: [{ type: "text", text: e }],
|
|
886
886
|
isError: !0
|
|
887
887
|
};
|
|
888
888
|
}
|
|
889
|
-
const
|
|
890
|
-
function
|
|
889
|
+
const lo = /* @__PURE__ */ new Set(["file"]);
|
|
890
|
+
function uo(e) {
|
|
891
891
|
return !e || typeof e != "object" || Array.isArray(e) ? e : Object.fromEntries(
|
|
892
892
|
Object.entries(e).map(
|
|
893
|
-
([t, r]) =>
|
|
893
|
+
([t, r]) => lo.has(t) && r !== void 0 ? [t, "[redacted]"] : [t, r]
|
|
894
894
|
)
|
|
895
895
|
);
|
|
896
896
|
}
|
|
897
|
-
function
|
|
897
|
+
function po(e) {
|
|
898
898
|
return { ...{
|
|
899
|
-
title: `Todoist: ${
|
|
899
|
+
title: `Todoist: ${ho(e.name)}`,
|
|
900
900
|
openWorldHint: !1
|
|
901
901
|
}, ...e.annotations };
|
|
902
902
|
}
|
|
903
|
-
function
|
|
903
|
+
function ho(e) {
|
|
904
904
|
return e.split("-").filter(Boolean).map((t) => `${t.charAt(0).toUpperCase()}${t.slice(1)}`).join(" ");
|
|
905
905
|
}
|
|
906
|
-
function
|
|
906
|
+
function mo(e) {
|
|
907
907
|
return e ? typeof e["ui/resourceUri"] == "string" ? !0 : typeof e.ui == "object" && e.ui !== null : !1;
|
|
908
908
|
}
|
|
909
|
-
function
|
|
909
|
+
function fo(e) {
|
|
910
910
|
const t = typeof e.ui == "object" && e.ui !== null ? e.ui : void 0, r = t?.resourceUri, o = e["ui/resourceUri"];
|
|
911
911
|
return typeof r == "string" && typeof o != "string" ? { ...e, "ui/resourceUri": r } : typeof o == "string" && typeof r != "string" ? { ...e, ui: { ...t, resourceUri: o } } : e;
|
|
912
912
|
}
|
|
913
|
-
const
|
|
913
|
+
const bo = [
|
|
914
914
|
g.FIND_PROJECT_COLLABORATORS,
|
|
915
915
|
g.FIND_COMPLETED_TASKS
|
|
916
916
|
];
|
|
@@ -927,36 +927,36 @@ function Xe(e) {
|
|
|
927
927
|
}
|
|
928
928
|
return e;
|
|
929
929
|
}
|
|
930
|
-
function
|
|
930
|
+
function go(e) {
|
|
931
931
|
const t = /\s*\([^)]*@[^)]+\)/g, r = /\S+@\S+\.\S+/g;
|
|
932
932
|
return e.replace(t, "").replace(r, "[email hidden]");
|
|
933
933
|
}
|
|
934
|
-
function
|
|
934
|
+
function yo({
|
|
935
935
|
tool: e,
|
|
936
936
|
server: t,
|
|
937
937
|
client: r,
|
|
938
938
|
features: o = []
|
|
939
939
|
}) {
|
|
940
|
-
const n = o.some((l) => l.name === "strip_emails") &&
|
|
940
|
+
const n = o.some((l) => l.name === "strip_emails") && bo.includes(e.name), i = e.execute, { input: a, output: c } = io(e), d = async (l, p) => {
|
|
941
941
|
try {
|
|
942
|
-
let { textContent: h, structuredContent: m, contentItems: y } = await
|
|
942
|
+
let { textContent: h, structuredContent: m, contentItems: y } = await Fr(
|
|
943
943
|
e.name,
|
|
944
944
|
() => _(() => i(l, r))
|
|
945
945
|
);
|
|
946
|
-
return n && (h && (h =
|
|
946
|
+
return n && (h && (h = go(h)), m && (m = Xe(m))), ao({ textContent: h, structuredContent: m, contentItems: y });
|
|
947
947
|
} catch (h) {
|
|
948
|
-
return console.error(`Error executing tool ${e.name}:`, { args:
|
|
948
|
+
return console.error(`Error executing tool ${e.name}:`, { args: uo(l), error: h }), co(Tr(h));
|
|
949
949
|
}
|
|
950
950
|
}, u = {
|
|
951
951
|
description: e.description,
|
|
952
952
|
inputSchema: a,
|
|
953
953
|
...c ? { outputSchema: c } : {},
|
|
954
|
-
annotations:
|
|
955
|
-
...e._meta ? { _meta:
|
|
954
|
+
annotations: po(e),
|
|
955
|
+
...e._meta ? { _meta: mo(e._meta) ? fo(e._meta) : e._meta } : {}
|
|
956
956
|
};
|
|
957
957
|
t.registerTool(e.name, u, d);
|
|
958
958
|
}
|
|
959
|
-
const
|
|
959
|
+
const To = s.object({
|
|
960
960
|
period: s.enum(["today", "7d", "14d", "30d", "this-week", "this-month"]).default("7d").describe(
|
|
961
961
|
'Time period for the analysis. "today" analyzes the current day, "7d"/"14d"/"30d" analyze the last N days, "this-week" and "this-month" analyze the current week or month.'
|
|
962
962
|
),
|
|
@@ -965,7 +965,7 @@ const yo = s.object({
|
|
|
965
965
|
),
|
|
966
966
|
projectId: s.string().optional().describe("Optional project ID to scope the analysis to a specific project.")
|
|
967
967
|
});
|
|
968
|
-
function
|
|
968
|
+
function ko(e, t = /* @__PURE__ */ new Date()) {
|
|
969
969
|
const r = (n) => n.toISOString().slice(0, 10), o = r(t);
|
|
970
970
|
switch (e) {
|
|
971
971
|
case "today":
|
|
@@ -1012,7 +1012,7 @@ function To(e, t = /* @__PURE__ */ new Date()) {
|
|
|
1012
1012
|
}
|
|
1013
1013
|
}
|
|
1014
1014
|
}
|
|
1015
|
-
function
|
|
1015
|
+
function wo(e) {
|
|
1016
1016
|
const t = {
|
|
1017
1017
|
goals: `### Goal Tracking
|
|
1018
1018
|
- Compare tasks completed today vs the daily goal
|
|
@@ -1043,8 +1043,8 @@ function ko(e) {
|
|
|
1043
1043
|
|
|
1044
1044
|
`) : t[e] ?? "";
|
|
1045
1045
|
}
|
|
1046
|
-
function
|
|
1047
|
-
const { since: t, until: r, periodDescription: o } =
|
|
1046
|
+
function vo(e) {
|
|
1047
|
+
const { since: t, until: r, periodDescription: o } = ko(e.period), n = e.projectId ? `
|
|
1048
1048
|
Scope this analysis to project ID: ${e.projectId}. Pass this projectId when calling find-completed-tasks and get-overview.` : "";
|
|
1049
1049
|
return `Analyze my Todoist productivity for ${o} (${t} to ${r}).${n}
|
|
1050
1050
|
|
|
@@ -1065,7 +1065,7 @@ ${e.focus === "overall" || e.focus === "projects" ? `4. **get-overview** — Get
|
|
|
1065
1065
|
|
|
1066
1066
|
Using the collected data, produce an analysis covering the following sections:
|
|
1067
1067
|
|
|
1068
|
-
${
|
|
1068
|
+
${wo(e.focus)}
|
|
1069
1069
|
|
|
1070
1070
|
### Step 3: Format
|
|
1071
1071
|
|
|
@@ -1075,14 +1075,14 @@ Present the analysis as a clear, well-structured markdown report with:
|
|
|
1075
1075
|
- Specific numbers and comparisons (not vague statements)
|
|
1076
1076
|
- Actionable takeaways highlighted clearly`;
|
|
1077
1077
|
}
|
|
1078
|
-
function
|
|
1078
|
+
function Io(e) {
|
|
1079
1079
|
return {
|
|
1080
1080
|
messages: [
|
|
1081
1081
|
{
|
|
1082
1082
|
role: "user",
|
|
1083
1083
|
content: {
|
|
1084
1084
|
type: "text",
|
|
1085
|
-
text:
|
|
1085
|
+
text: vo(e)
|
|
1086
1086
|
}
|
|
1087
1087
|
}
|
|
1088
1088
|
]
|
|
@@ -1092,15 +1092,15 @@ const ye = {
|
|
|
1092
1092
|
name: "productivity-analysis",
|
|
1093
1093
|
title: "Productivity Analysis",
|
|
1094
1094
|
description: "Analyze your Todoist productivity with insights on completion trends, goal streaks, project distribution, and actionable recommendations. Gathers data from multiple tools and synthesizes a comprehensive report.",
|
|
1095
|
-
argsSchema:
|
|
1096
|
-
callback:
|
|
1095
|
+
argsSchema: To,
|
|
1096
|
+
callback: Io
|
|
1097
1097
|
};
|
|
1098
1098
|
class U extends Error {
|
|
1099
1099
|
constructor(t, r) {
|
|
1100
1100
|
super(`Invalid duration format "${t}": ${r}`), this.name = "DurationParseError";
|
|
1101
1101
|
}
|
|
1102
1102
|
}
|
|
1103
|
-
function
|
|
1103
|
+
function us(e) {
|
|
1104
1104
|
if (!e || typeof e != "string")
|
|
1105
1105
|
throw new U(e, "Duration must be a non-empty string");
|
|
1106
1106
|
const t = e.trim().toLowerCase().replace(/\s+/g, "");
|
|
@@ -1134,20 +1134,20 @@ function ls(e) {
|
|
|
1134
1134
|
throw new U(e, "Duration cannot exceed 24 hours (1440 minutes)");
|
|
1135
1135
|
return { minutes: o };
|
|
1136
1136
|
}
|
|
1137
|
-
function
|
|
1137
|
+
function So(e) {
|
|
1138
1138
|
if (e <= 0) return "0m";
|
|
1139
1139
|
const t = Math.floor(e / 60), r = e % 60;
|
|
1140
1140
|
return t === 0 ? `${r}m` : r === 0 ? `${t}h` : `${t}h${r}m`;
|
|
1141
1141
|
}
|
|
1142
|
-
const
|
|
1143
|
-
function
|
|
1142
|
+
const Co = ["p1", "p2", "p3", "p4"], nt = 'Task priority as a string: "p1" (highest), "p2" (high), "p3" (medium), or "p4" (lowest/default). Integers like 1, 2, 3, or 4 are not accepted.', it = s.enum(Co).describe(nt);
|
|
1143
|
+
function ps(e) {
|
|
1144
1144
|
return { p1: 4, p2: 3, p3: 2, p4: 1 }[e];
|
|
1145
1145
|
}
|
|
1146
|
-
function
|
|
1146
|
+
function jo(e) {
|
|
1147
1147
|
return { 4: "p1", 3: "p2", 2: "p3", 1: "p4" }[e];
|
|
1148
1148
|
}
|
|
1149
|
-
const
|
|
1150
|
-
class
|
|
1149
|
+
const hs = 300 * 1e3, $o = 1e4, Ao = 1e3;
|
|
1150
|
+
class ms {
|
|
1151
1151
|
constructor(t, r) {
|
|
1152
1152
|
this.maxEntries = t, this.ttl = r, this.entries = /* @__PURE__ */ new Map();
|
|
1153
1153
|
}
|
|
@@ -1180,14 +1180,14 @@ class hs {
|
|
|
1180
1180
|
t - o.timestamp >= this.ttl && this.entries.delete(r);
|
|
1181
1181
|
}
|
|
1182
1182
|
}
|
|
1183
|
-
const Ue = new
|
|
1184
|
-
jo,
|
|
1185
|
-
ps
|
|
1186
|
-
), le = new hs(
|
|
1183
|
+
const Ue = new ms(
|
|
1187
1184
|
$o,
|
|
1188
|
-
|
|
1189
|
-
),
|
|
1190
|
-
|
|
1185
|
+
hs
|
|
1186
|
+
), le = new ms(
|
|
1187
|
+
Ao,
|
|
1188
|
+
hs
|
|
1189
|
+
), fs = "me";
|
|
1190
|
+
class Do {
|
|
1191
1191
|
/**
|
|
1192
1192
|
* Resolve a user name or ID to a user ID by looking up collaborators across all shared projects.
|
|
1193
1193
|
* Supports exact name matches, partial matches, email matches, and the "me" keyword.
|
|
@@ -1196,7 +1196,7 @@ class Ao {
|
|
|
1196
1196
|
if (!r || r.trim().length === 0)
|
|
1197
1197
|
return null;
|
|
1198
1198
|
const o = r.trim();
|
|
1199
|
-
if (o.toLowerCase() ===
|
|
1199
|
+
if (o.toLowerCase() === fs)
|
|
1200
1200
|
try {
|
|
1201
1201
|
const d = await t.getUser();
|
|
1202
1202
|
return {
|
|
@@ -1322,11 +1322,11 @@ class Ao {
|
|
|
1322
1322
|
Ue.clear(), le.clear();
|
|
1323
1323
|
}
|
|
1324
1324
|
}
|
|
1325
|
-
const H = new
|
|
1326
|
-
async function
|
|
1325
|
+
const H = new Do();
|
|
1326
|
+
async function xo(e, t) {
|
|
1327
1327
|
return H.resolveUser(e, t);
|
|
1328
1328
|
}
|
|
1329
|
-
async function
|
|
1329
|
+
async function Eo(e, t) {
|
|
1330
1330
|
const r = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), n = [], i = [];
|
|
1331
1331
|
for (const a of t) {
|
|
1332
1332
|
const c = a.trim().toLowerCase();
|
|
@@ -1347,11 +1347,11 @@ async function xo(e, t) {
|
|
|
1347
1347
|
}
|
|
1348
1348
|
return n;
|
|
1349
1349
|
}
|
|
1350
|
-
const
|
|
1350
|
+
const bs = ["assigned", "unassignedOrMe", "all"];
|
|
1351
1351
|
async function at(e, t) {
|
|
1352
1352
|
if (!t)
|
|
1353
1353
|
return;
|
|
1354
|
-
const r = await
|
|
1354
|
+
const r = await xo(e, t);
|
|
1355
1355
|
if (!r)
|
|
1356
1356
|
throw new Error(
|
|
1357
1357
|
`Could not find user: "${t}". Make sure the user is a collaborator on a shared project.`
|
|
@@ -1370,7 +1370,7 @@ function Qe({
|
|
|
1370
1370
|
const n = !!(e && t) && e === r;
|
|
1371
1371
|
return e && t && !n ? `assigned to: ${t}` : n || o === "unassignedOrMe" ? "!assigned to: others" : o === "assigned" ? "assigned to: others" : "";
|
|
1372
1372
|
}
|
|
1373
|
-
function
|
|
1373
|
+
function Oo({
|
|
1374
1374
|
tasks: e,
|
|
1375
1375
|
resolvedAssigneeId: t,
|
|
1376
1376
|
currentUserId: r,
|
|
@@ -1407,28 +1407,28 @@ async function z(e) {
|
|
|
1407
1407
|
function ct(e) {
|
|
1408
1408
|
return /(?<!\\)(?:\\\\)*\*/.test(e) ? e : `*${e.replaceAll(/\\(?!\*)/g, "\\\\")}*`;
|
|
1409
1409
|
}
|
|
1410
|
-
async function
|
|
1410
|
+
async function gs(e, t) {
|
|
1411
1411
|
return z({
|
|
1412
1412
|
apiMethod: e.searchProjects.bind(e),
|
|
1413
1413
|
args: { query: ct(t) },
|
|
1414
1414
|
limit: j.PROJECTS_MAX
|
|
1415
1415
|
});
|
|
1416
1416
|
}
|
|
1417
|
-
async function
|
|
1417
|
+
async function ys(e) {
|
|
1418
1418
|
return z({
|
|
1419
1419
|
apiMethod: e.getProjects.bind(e),
|
|
1420
1420
|
args: {},
|
|
1421
1421
|
limit: j.PROJECTS_MAX
|
|
1422
1422
|
});
|
|
1423
1423
|
}
|
|
1424
|
-
async function
|
|
1424
|
+
async function _o(e) {
|
|
1425
1425
|
return z({
|
|
1426
1426
|
apiMethod: e.getArchivedProjects.bind(e),
|
|
1427
1427
|
args: {},
|
|
1428
1428
|
limit: j.PROJECTS_MAX
|
|
1429
1429
|
});
|
|
1430
1430
|
}
|
|
1431
|
-
function
|
|
1431
|
+
function Po(e) {
|
|
1432
1432
|
const t = (i) => i.replaceAll(/[.*+?^${}()|[\]\\]/g, "\\$&"), r = /(?<!\\)(?:\\\\)*\*/.test(e), o = [...e];
|
|
1433
1433
|
let n = "";
|
|
1434
1434
|
for (let i = 0; i < o.length; i++) {
|
|
@@ -1437,21 +1437,21 @@ function _o(e) {
|
|
|
1437
1437
|
}
|
|
1438
1438
|
return new RegExp(r ? `^${n}$` : n, "iu");
|
|
1439
1439
|
}
|
|
1440
|
-
async function
|
|
1440
|
+
async function Uo(e, t) {
|
|
1441
1441
|
return z({
|
|
1442
1442
|
apiMethod: e.searchLabels.bind(e),
|
|
1443
1443
|
args: { query: ct(t) },
|
|
1444
1444
|
limit: j.LABELS_MAX
|
|
1445
1445
|
});
|
|
1446
1446
|
}
|
|
1447
|
-
async function
|
|
1447
|
+
async function Ro(e) {
|
|
1448
1448
|
return z({
|
|
1449
1449
|
apiMethod: e.getSharedLabels.bind(e),
|
|
1450
1450
|
args: {},
|
|
1451
1451
|
limit: j.LABELS_MAX
|
|
1452
1452
|
});
|
|
1453
1453
|
}
|
|
1454
|
-
async function
|
|
1454
|
+
async function Lo(e, t, r) {
|
|
1455
1455
|
const o = ct(t);
|
|
1456
1456
|
return z({
|
|
1457
1457
|
apiMethod: e.searchSections.bind(e),
|
|
@@ -1467,12 +1467,12 @@ function P(e) {
|
|
|
1467
1467
|
dueDate: e.due?.date,
|
|
1468
1468
|
recurring: e.due?.isRecurring && e.due.string ? e.due.string : !1,
|
|
1469
1469
|
deadlineDate: e.deadline?.date,
|
|
1470
|
-
priority:
|
|
1470
|
+
priority: jo(e.priority) ?? "p4",
|
|
1471
1471
|
projectId: e.projectId,
|
|
1472
1472
|
sectionId: e.sectionId ?? void 0,
|
|
1473
1473
|
parentId: e.parentId ?? void 0,
|
|
1474
1474
|
labels: e.labels,
|
|
1475
|
-
duration: e.duration ?
|
|
1475
|
+
duration: e.duration ? So(e.duration.amount) : void 0,
|
|
1476
1476
|
responsibleUid: e.responsibleUid ?? void 0,
|
|
1477
1477
|
assignedByUid: e.assignedByUid ?? void 0,
|
|
1478
1478
|
checked: e.checked,
|
|
@@ -1522,7 +1522,7 @@ function we(e) {
|
|
|
1522
1522
|
} : void 0
|
|
1523
1523
|
};
|
|
1524
1524
|
}
|
|
1525
|
-
function
|
|
1525
|
+
function No(e) {
|
|
1526
1526
|
return {
|
|
1527
1527
|
id: e.id ?? void 0,
|
|
1528
1528
|
objectType: e.objectType,
|
|
@@ -1535,7 +1535,7 @@ function Lo(e) {
|
|
|
1535
1535
|
extraData: e.extraData ?? void 0
|
|
1536
1536
|
};
|
|
1537
1537
|
}
|
|
1538
|
-
const
|
|
1538
|
+
const Mo = ce.object({
|
|
1539
1539
|
httpStatusCode: ce.number(),
|
|
1540
1540
|
responseData: ce.object({
|
|
1541
1541
|
error: ce.string(),
|
|
@@ -1557,7 +1557,7 @@ async function dt({
|
|
|
1557
1557
|
const { results: n, nextCursor: i } = await e.getTasksByFilter({ query: t, cursor: o, limit: r });
|
|
1558
1558
|
return { tasks: n.map(P), nextCursor: i };
|
|
1559
1559
|
} catch (n) {
|
|
1560
|
-
const i =
|
|
1560
|
+
const i = Mo.safeParse(n);
|
|
1561
1561
|
if (!i.success)
|
|
1562
1562
|
throw n;
|
|
1563
1563
|
const { responseData: a } = i.data;
|
|
@@ -1606,18 +1606,18 @@ function ke(e) {
|
|
|
1606
1606
|
};
|
|
1607
1607
|
}
|
|
1608
1608
|
}
|
|
1609
|
-
function
|
|
1609
|
+
function Ts(e) {
|
|
1610
1610
|
const t = e.filter(
|
|
1611
1611
|
(o) => o.type === "relative" || o.type === "absolute"
|
|
1612
1612
|
).length, r = e.filter((o) => o.type === "location").length;
|
|
1613
1613
|
return { timeBasedCount: t, locationCount: r };
|
|
1614
1614
|
}
|
|
1615
|
-
const
|
|
1616
|
-
function
|
|
1617
|
-
return e.length === 1 && e[0]?.trim().toLowerCase() ===
|
|
1615
|
+
const ks = "none";
|
|
1616
|
+
function Fo(e) {
|
|
1617
|
+
return e.length === 1 && e[0]?.trim().toLowerCase() === ks;
|
|
1618
1618
|
}
|
|
1619
|
-
async function
|
|
1620
|
-
const o = await
|
|
1619
|
+
async function Ho(e, t, r) {
|
|
1620
|
+
const o = await Wo(e, t);
|
|
1621
1621
|
if (o)
|
|
1622
1622
|
return Et(
|
|
1623
1623
|
[...o.uidsToNotify ?? [], o.postedUid],
|
|
@@ -1628,7 +1628,7 @@ async function Fo(e, t, r) {
|
|
|
1628
1628
|
const n = await e.getTask(t.taskId);
|
|
1629
1629
|
return Et([n.responsibleUid, n.assignedByUid, n.addedByUid], r);
|
|
1630
1630
|
}
|
|
1631
|
-
async function
|
|
1631
|
+
async function Wo(e, t) {
|
|
1632
1632
|
let r, o = null;
|
|
1633
1633
|
do {
|
|
1634
1634
|
const n = await e.getComments({
|
|
@@ -1648,12 +1648,12 @@ function Et(e, t) {
|
|
|
1648
1648
|
return [...r];
|
|
1649
1649
|
}
|
|
1650
1650
|
const De = He.map((e) => e.key);
|
|
1651
|
-
function
|
|
1651
|
+
function Bo(e) {
|
|
1652
1652
|
if (typeof e != "string") return;
|
|
1653
1653
|
const t = e.toLowerCase();
|
|
1654
1654
|
return (He.find((o) => o.key === t) ?? He.find((o) => o.displayName.toLowerCase() === t))?.key;
|
|
1655
1655
|
}
|
|
1656
|
-
const
|
|
1656
|
+
const zo = `Color for the entity. Accepts a color key (e.g. "berry_red") or display name (e.g. "Berry Red"). Valid colors: ${De.join(", ")}. Unrecognized colors are omitted and charcoal will be used as the default.`, fe = s.preprocess(Bo, s.enum(De).optional()).describe(zo);
|
|
1657
1657
|
s.enum(De);
|
|
1658
1658
|
const be = s.enum(De).optional().catch(void 0), K = s.object({
|
|
1659
1659
|
id: s.string(),
|
|
@@ -1697,7 +1697,7 @@ const be = s.enum(De).optional().catch(void 0), K = s.object({
|
|
|
1697
1697
|
function G({ id: e, name: t, sectionOrder: r, description: o }) {
|
|
1698
1698
|
return { id: e, name: t, sectionOrder: r, description: o ?? void 0 };
|
|
1699
1699
|
}
|
|
1700
|
-
const
|
|
1700
|
+
const Ko = s.object({
|
|
1701
1701
|
resourceType: s.string().describe("file, url, image, etc."),
|
|
1702
1702
|
fileName: s.string().optional(),
|
|
1703
1703
|
fileSize: s.number().optional().describe("Bytes."),
|
|
@@ -1718,8 +1718,8 @@ const zo = s.object({
|
|
|
1718
1718
|
postedAt: s.string().describe("ISO 8601."),
|
|
1719
1719
|
postedUid: s.string().optional(),
|
|
1720
1720
|
notifiedUserIds: s.array(s.string()).optional().describe("Users notified about this comment. Absent when nobody was notified."),
|
|
1721
|
-
fileAttachment:
|
|
1722
|
-
}),
|
|
1721
|
+
fileAttachment: Ko.optional()
|
|
1722
|
+
}), qo = s.object({
|
|
1723
1723
|
id: s.string().optional(),
|
|
1724
1724
|
objectType: s.string().describe("task, project, etc."),
|
|
1725
1725
|
objectId: s.string(),
|
|
@@ -1729,7 +1729,7 @@ const zo = s.object({
|
|
|
1729
1729
|
parentItemId: s.string().optional(),
|
|
1730
1730
|
initiatorId: s.string().optional().describe("User who initiated the event."),
|
|
1731
1731
|
extraData: s.record(s.string(), s.unknown()).optional()
|
|
1732
|
-
}),
|
|
1732
|
+
}), Yo = s.object({
|
|
1733
1733
|
id: s.string(),
|
|
1734
1734
|
name: s.string(),
|
|
1735
1735
|
email: s.string()
|
|
@@ -1739,7 +1739,7 @@ const zo = s.object({
|
|
|
1739
1739
|
color: be,
|
|
1740
1740
|
order: s.number().optional().catch(void 0).describe("Display order."),
|
|
1741
1741
|
isFavorite: s.boolean()
|
|
1742
|
-
}),
|
|
1742
|
+
}), Go = s.object({
|
|
1743
1743
|
isRecurring: s.boolean(),
|
|
1744
1744
|
string: s.string().describe("Human-readable due string."),
|
|
1745
1745
|
date: s.string().describe("ISO 8601."),
|
|
@@ -1748,9 +1748,9 @@ const zo = s.object({
|
|
|
1748
1748
|
}), lt = s.object({
|
|
1749
1749
|
id: s.string(),
|
|
1750
1750
|
taskId: s.string(),
|
|
1751
|
-
type: s.enum(
|
|
1751
|
+
type: s.enum(Qs),
|
|
1752
1752
|
minuteOffset: s.number().optional().describe("Minutes before due. Relative reminders only."),
|
|
1753
|
-
due:
|
|
1753
|
+
due: Go.optional().describe("Absolute, and sometimes relative, reminders."),
|
|
1754
1754
|
name: s.string().optional().describe("Location name. Location reminders only."),
|
|
1755
1755
|
locLat: s.string().optional().describe("Location reminders only."),
|
|
1756
1756
|
locLong: s.string().optional().describe("Location reminders only."),
|
|
@@ -1761,26 +1761,26 @@ const zo = s.object({
|
|
|
1761
1761
|
item: s.string().describe("Usually the ID of the item that failed."),
|
|
1762
1762
|
error: s.string(),
|
|
1763
1763
|
code: s.string().optional()
|
|
1764
|
-
}),
|
|
1764
|
+
}), Vo = s.object({
|
|
1765
1765
|
taskId: s.string().optional().describe("The ID of the task to comment on."),
|
|
1766
1766
|
projectId: s.string().optional().describe(
|
|
1767
1767
|
'The ID of the project to comment on. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
1768
1768
|
),
|
|
1769
1769
|
content: s.string().min(1).describe("The content of the comment."),
|
|
1770
1770
|
notifyUsers: s.array(s.string().min(1)).min(1).max(j.NOTIFY_USERS_MAX).optional().describe(
|
|
1771
|
-
`Who to notify about this comment — a user ID, email, full name, or "me" for each person. Set this whenever the comment mentions someone; the text of an @mention notifies nobody on its own. Omit to notify whoever the Todoist apps would (the task's assignee, assigner and creator on a first comment, or the previous comment's participants on a reply). Pass ["${
|
|
1771
|
+
`Who to notify about this comment — a user ID, email, full name, or "me" for each person. Set this whenever the comment mentions someone; the text of an @mention notifies nobody on its own. Omit to notify whoever the Todoist apps would (the task's assignee, assigner and creator on a first comment, or the previous comment's participants on a reply). Pass ["${ks}"] to notify nobody.`
|
|
1772
1772
|
)
|
|
1773
|
-
}),
|
|
1774
|
-
comments: s.array(
|
|
1775
|
-
},
|
|
1773
|
+
}), Jo = {
|
|
1774
|
+
comments: s.array(Vo).min(1).describe("The array of comments to add.")
|
|
1775
|
+
}, Xo = {
|
|
1776
1776
|
comments: s.array(ve).describe("The created comments."),
|
|
1777
1777
|
totalCount: s.number().describe("The total number of comments created."),
|
|
1778
1778
|
addedCommentIds: s.array(s.string()).describe("The IDs of the added comments.")
|
|
1779
|
-
},
|
|
1779
|
+
}, Qo = {
|
|
1780
1780
|
name: g.ADD_COMMENTS,
|
|
1781
1781
|
description: "Add multiple comments to tasks or projects, optionally notifying collaborators. Each comment must specify either taskId or projectId.",
|
|
1782
|
-
parameters:
|
|
1783
|
-
outputSchema:
|
|
1782
|
+
parameters: Jo,
|
|
1783
|
+
outputSchema: Xo,
|
|
1784
1784
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1785
1785
|
async execute(e, t) {
|
|
1786
1786
|
const { comments: r } = e;
|
|
@@ -1803,7 +1803,7 @@ const zo = s.object({
|
|
|
1803
1803
|
});
|
|
1804
1804
|
return p.taskId ? { taskId: p.taskId } : { projectId: h };
|
|
1805
1805
|
})
|
|
1806
|
-
), c = await
|
|
1806
|
+
), c = await Zo({
|
|
1807
1807
|
comments: r,
|
|
1808
1808
|
targets: a,
|
|
1809
1809
|
client: t,
|
|
@@ -1821,7 +1821,7 @@ const zo = s.object({
|
|
|
1821
1821
|
})
|
|
1822
1822
|
)).map(we);
|
|
1823
1823
|
return {
|
|
1824
|
-
textContent:
|
|
1824
|
+
textContent: en({ comments: u }),
|
|
1825
1825
|
structuredContent: {
|
|
1826
1826
|
comments: u,
|
|
1827
1827
|
totalCount: u.length,
|
|
@@ -1830,7 +1830,7 @@ const zo = s.object({
|
|
|
1830
1830
|
};
|
|
1831
1831
|
}
|
|
1832
1832
|
};
|
|
1833
|
-
async function
|
|
1833
|
+
async function Zo({
|
|
1834
1834
|
comments: e,
|
|
1835
1835
|
targets: t,
|
|
1836
1836
|
client: r,
|
|
@@ -1840,15 +1840,15 @@ async function Qo({
|
|
|
1840
1840
|
return await Promise.all(
|
|
1841
1841
|
e.map(async ({ notifyUsers: i }, a) => {
|
|
1842
1842
|
if (i)
|
|
1843
|
-
return
|
|
1843
|
+
return Fo(i) ? [] : (await Eo(r, i)).map((p) => p.userId);
|
|
1844
1844
|
const c = t[a];
|
|
1845
1845
|
if (!c || !o) return [];
|
|
1846
|
-
const d = c.taskId ? `task:${c.taskId}` : `project:${c.projectId}`, u = n.get(d) ??
|
|
1846
|
+
const d = c.taskId ? `task:${c.taskId}` : `project:${c.projectId}`, u = n.get(d) ?? Ho(r, c, o.id);
|
|
1847
1847
|
return n.set(d, u), await u;
|
|
1848
1848
|
})
|
|
1849
1849
|
);
|
|
1850
1850
|
}
|
|
1851
|
-
function
|
|
1851
|
+
function en({ comments: e }) {
|
|
1852
1852
|
const t = e.filter((c) => c.taskId).length, r = e.filter((c) => c.projectId).length, o = [];
|
|
1853
1853
|
if (t > 0) {
|
|
1854
1854
|
const c = t > 1 ? "comments" : "comment";
|
|
@@ -1867,10 +1867,10 @@ function Zo({ comments: e }) {
|
|
|
1867
1867
|
function R(e) {
|
|
1868
1868
|
return s.string().transform((t) => t === "" ? void 0 : t).optional().describe(e);
|
|
1869
1869
|
}
|
|
1870
|
-
function
|
|
1870
|
+
function ws(e) {
|
|
1871
1871
|
return e.description || void 0;
|
|
1872
1872
|
}
|
|
1873
|
-
const
|
|
1873
|
+
const tn = {
|
|
1874
1874
|
search: s.string().optional().describe(
|
|
1875
1875
|
"Search for a filter by name (partial and case insensitive match). If omitted, all filters are returned."
|
|
1876
1876
|
)
|
|
@@ -1884,14 +1884,14 @@ const en = {
|
|
|
1884
1884
|
color: be,
|
|
1885
1885
|
isFavorite: s.boolean().describe("Whether the filter is marked as favorite."),
|
|
1886
1886
|
itemOrder: s.number().describe("The display order of the filter.")
|
|
1887
|
-
}),
|
|
1887
|
+
}), sn = {
|
|
1888
1888
|
filters: s.array(ut).describe("The found filters."),
|
|
1889
1889
|
totalCount: s.number().describe("The total number of filters returned.")
|
|
1890
|
-
},
|
|
1890
|
+
}, rn = {
|
|
1891
1891
|
name: g.FIND_FILTERS,
|
|
1892
1892
|
description: 'List all personal filters or search for filters by name. Filters are saved custom views that use query syntax to organize tasks (e.g. "today & p1", "#Work & overdue").',
|
|
1893
|
-
parameters:
|
|
1894
|
-
outputSchema:
|
|
1893
|
+
parameters: tn,
|
|
1894
|
+
outputSchema: sn,
|
|
1895
1895
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
1896
1896
|
async execute(e, t) {
|
|
1897
1897
|
let o = ((await t.sync({ resourceTypes: ["filters"], syncToken: "*" })).filters ?? []).filter((a) => !a.isDeleted);
|
|
@@ -1904,13 +1904,13 @@ const en = {
|
|
|
1904
1904
|
id: a.id,
|
|
1905
1905
|
name: a.name,
|
|
1906
1906
|
query: a.query,
|
|
1907
|
-
description:
|
|
1907
|
+
description: ws(a),
|
|
1908
1908
|
color: be.parse(a.color),
|
|
1909
1909
|
isFavorite: a.isFavorite,
|
|
1910
1910
|
itemOrder: a.itemOrder
|
|
1911
1911
|
}));
|
|
1912
1912
|
return {
|
|
1913
|
-
textContent:
|
|
1913
|
+
textContent: on({ filters: n, search: e.search }),
|
|
1914
1914
|
structuredContent: {
|
|
1915
1915
|
filters: n,
|
|
1916
1916
|
totalCount: n.length
|
|
@@ -1918,7 +1918,7 @@ const en = {
|
|
|
1918
1918
|
};
|
|
1919
1919
|
}
|
|
1920
1920
|
};
|
|
1921
|
-
function
|
|
1921
|
+
function on({
|
|
1922
1922
|
filters: e,
|
|
1923
1923
|
search: t
|
|
1924
1924
|
}) {
|
|
@@ -1939,7 +1939,7 @@ ${n.map((i) => `- ${i}`).join(`
|
|
|
1939
1939
|
return o.join(`
|
|
1940
1940
|
`);
|
|
1941
1941
|
}
|
|
1942
|
-
const
|
|
1942
|
+
const nn = s.object({
|
|
1943
1943
|
name: s.string().min(1).describe("The name of the filter."),
|
|
1944
1944
|
query: s.string().min(1).describe(
|
|
1945
1945
|
'The filter query string. Examples: "today & p1", "#Work & overdue", "@email & today", "(p1 | p2) & !assigned". Operators: | (OR), & (AND), ! (NOT), () grouping, , (multiple queries).'
|
|
@@ -1947,16 +1947,16 @@ const on = s.object({
|
|
|
1947
1947
|
description: R("A markdown description explaining what the filter is for."),
|
|
1948
1948
|
color: fe,
|
|
1949
1949
|
isFavorite: s.boolean().optional().describe("Whether to mark the filter as a favorite. Defaults to false.")
|
|
1950
|
-
}),
|
|
1951
|
-
filters: s.array(
|
|
1952
|
-
},
|
|
1950
|
+
}), an = {
|
|
1951
|
+
filters: s.array(nn).min(1).describe("The array of filters to add.")
|
|
1952
|
+
}, cn = {
|
|
1953
1953
|
filters: s.array(ut).describe("The created filters."),
|
|
1954
1954
|
totalCount: s.number().describe("The total number of filters created.")
|
|
1955
|
-
},
|
|
1955
|
+
}, dn = {
|
|
1956
1956
|
name: g.ADD_FILTERS,
|
|
1957
1957
|
description: "Add one or more new personal filters. Filters are saved custom views using query syntax to organize tasks.",
|
|
1958
|
-
parameters:
|
|
1959
|
-
outputSchema:
|
|
1958
|
+
parameters: an,
|
|
1959
|
+
outputSchema: cn,
|
|
1960
1960
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1961
1961
|
async execute({ filters: e }, t) {
|
|
1962
1962
|
const r = Date.now(), o = e.map((p, h) => `tempFilterAdd${h}${r}`), n = e.map((p, h) => Q(
|
|
@@ -1996,26 +1996,26 @@ ${u}`,
|
|
|
1996
1996
|
}
|
|
1997
1997
|
};
|
|
1998
1998
|
}
|
|
1999
|
-
},
|
|
1999
|
+
}, ln = s.object({
|
|
2000
2000
|
name: s.string().min(1).max(128).describe("The name of the label."),
|
|
2001
2001
|
color: fe,
|
|
2002
2002
|
order: s.number().int().optional().describe("The position of the label in the label list."),
|
|
2003
2003
|
isFavorite: s.boolean().optional().describe("Whether the label is a favorite. Defaults to false.")
|
|
2004
|
-
}),
|
|
2005
|
-
labels: s.array(
|
|
2006
|
-
},
|
|
2004
|
+
}), un = {
|
|
2005
|
+
labels: s.array(ln).min(1).describe("The array of labels to add.")
|
|
2006
|
+
}, pn = {
|
|
2007
2007
|
labels: s.array(ge).describe("The created labels."),
|
|
2008
2008
|
totalCount: s.number().describe("The total number of labels created.")
|
|
2009
|
-
},
|
|
2009
|
+
}, hn = {
|
|
2010
2010
|
name: g.ADD_LABELS,
|
|
2011
2011
|
description: "Add one or more new personal labels.",
|
|
2012
|
-
parameters:
|
|
2013
|
-
outputSchema:
|
|
2012
|
+
parameters: un,
|
|
2013
|
+
outputSchema: pn,
|
|
2014
2014
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
2015
2015
|
async execute({ labels: e }, t) {
|
|
2016
2016
|
const r = await Promise.all(e.map((n) => t.addLabel(n)));
|
|
2017
2017
|
return {
|
|
2018
|
-
textContent:
|
|
2018
|
+
textContent: mn({ labels: r }),
|
|
2019
2019
|
structuredContent: {
|
|
2020
2020
|
labels: r.map((n) => ge.parse(n)),
|
|
2021
2021
|
totalCount: r.length
|
|
@@ -2023,21 +2023,21 @@ ${u}`,
|
|
|
2023
2023
|
};
|
|
2024
2024
|
}
|
|
2025
2025
|
};
|
|
2026
|
-
function
|
|
2026
|
+
function mn({ labels: e }) {
|
|
2027
2027
|
const t = e.length, r = e.map((o) => `• ${o.name} (id=${o.id})`).join(`
|
|
2028
2028
|
`);
|
|
2029
2029
|
return `Added ${t} label${t === 1 ? "" : "s"}:
|
|
2030
2030
|
${r}`;
|
|
2031
2031
|
}
|
|
2032
|
-
const
|
|
2032
|
+
const fn = "[redacted]";
|
|
2033
2033
|
function ne(e, t, r, o = {}) {
|
|
2034
2034
|
if (r.length === 0)
|
|
2035
2035
|
return;
|
|
2036
|
-
const n = r.slice(0,
|
|
2036
|
+
const n = r.slice(0, vr.MAX_FAILURES_LOGGED);
|
|
2037
2037
|
console.error(`${e}: items failed`, {
|
|
2038
2038
|
failed: r.length,
|
|
2039
2039
|
of: t,
|
|
2040
|
-
sample: o.redactItems ? n.map((i) => ({ ...i, item:
|
|
2040
|
+
sample: o.redactItems ? n.map((i) => ({ ...i, item: fn })) : n
|
|
2041
2041
|
});
|
|
2042
2042
|
}
|
|
2043
2043
|
function he(e = /* @__PURE__ */ new Date()) {
|
|
@@ -2084,20 +2084,20 @@ function mt(e, t) {
|
|
|
2084
2084
|
Failed (${t.length}) - address or drop these items:
|
|
2085
2085
|
${n}${i}`;
|
|
2086
2086
|
}
|
|
2087
|
-
function
|
|
2087
|
+
function bn(e) {
|
|
2088
2088
|
const t = e.content || e.title || "Untitled", r = e.dueDate ? ` • due ${e.dueDate}` : "", o = e.priority ? ` • ${e.priority.toUpperCase()}` : "", n = e.projectName ? ` • ${e.projectName}` : "", i = e.id ? ` • id=${e.id}` : "";
|
|
2089
2089
|
return ` ${t}${r}${o}${n}${i}`;
|
|
2090
2090
|
}
|
|
2091
|
-
function
|
|
2091
|
+
function gn(e) {
|
|
2092
2092
|
const t = ` (${e.color})`, r = e.isFavorite ? " • ⭐" : "", o = ` • id=${e.id}`;
|
|
2093
2093
|
return ` ${e.name}${t}${r}${o}`;
|
|
2094
2094
|
}
|
|
2095
|
-
function
|
|
2095
|
+
function yn(e) {
|
|
2096
2096
|
const t = e.inboxProject ? " • Inbox" : "", r = e.isFavorite ? " • ⭐" : "", o = e.isShared ? " • Shared" : "", n = e.isArchived ? " • Archived" : "", i = e.viewStyle && e.viewStyle !== "list" ? ` • ${e.viewStyle}` : "", a = ` • id=${e.id}`;
|
|
2097
2097
|
return ` ${e.name}${t}${r}${o}${n}${i}${a}`;
|
|
2098
2098
|
}
|
|
2099
2099
|
function xe(e, t = 5) {
|
|
2100
|
-
const o = e.slice(0, t).map(
|
|
2100
|
+
const o = e.slice(0, t).map(bn).join(`
|
|
2101
2101
|
`);
|
|
2102
2102
|
if (e.length > t) {
|
|
2103
2103
|
const n = e.length - t;
|
|
@@ -2118,25 +2118,25 @@ function V({
|
|
|
2118
2118
|
}) {
|
|
2119
2119
|
const d = [], u = `${e}: ${t}${typeof r == "number" ? ` (limit ${r})` : ""}${o ? ", more available" : ""}.`;
|
|
2120
2120
|
return d.push(u), n?.length && d.push(`Filter: ${n.join("; ")}.`), i?.length && d.push(`Preview:
|
|
2121
|
-
${i}`), !t && a?.length && d.push(`No results. ${a.join("; ")}.`), (c?.length || o) && d.push(
|
|
2121
|
+
${i}`), !t && a?.length && d.push(`No results. ${a.join("; ")}.`), (c?.length || o) && d.push(vs(c || [], o)), d.join(`
|
|
2122
2122
|
`);
|
|
2123
2123
|
}
|
|
2124
|
-
function
|
|
2124
|
+
function vs(e, t) {
|
|
2125
2125
|
const r = [...e];
|
|
2126
2126
|
return t && r.push(`Pass cursor '${t}' to fetch more results.`), `${r.length === 1 ? "Possible suggested next step:" : "Possible suggested next steps:"}
|
|
2127
2127
|
${r.map((n) => `- ${n}`).join(`
|
|
2128
2128
|
`)}`;
|
|
2129
2129
|
}
|
|
2130
|
-
const
|
|
2131
|
-
function
|
|
2130
|
+
const Tn = 300 * 1e3;
|
|
2131
|
+
function kn(e) {
|
|
2132
2132
|
return /^\d+$/.test(e);
|
|
2133
2133
|
}
|
|
2134
|
-
class
|
|
2134
|
+
class wn {
|
|
2135
2135
|
constructor() {
|
|
2136
2136
|
this.cache = null, this.inFlightWorkspaces = null;
|
|
2137
2137
|
}
|
|
2138
2138
|
async getWorkspaces(t) {
|
|
2139
|
-
if (this.cache && Date.now() - this.cache.timestamp <
|
|
2139
|
+
if (this.cache && Date.now() - this.cache.timestamp < Tn)
|
|
2140
2140
|
return this.cache.workspaces;
|
|
2141
2141
|
if (this.inFlightWorkspaces)
|
|
2142
2142
|
return this.inFlightWorkspaces;
|
|
@@ -2163,7 +2163,7 @@ class kn {
|
|
|
2163
2163
|
const n = await this.getWorkspaces(t), i = n.find((l) => l.id === o);
|
|
2164
2164
|
if (i)
|
|
2165
2165
|
return { workspaceId: i.id, workspaceName: i.name };
|
|
2166
|
-
if (
|
|
2166
|
+
if (kn(o))
|
|
2167
2167
|
return { workspaceId: o, workspaceName: o };
|
|
2168
2168
|
const a = o.toLowerCase(), c = n.find((l) => l.name.toLowerCase() === a);
|
|
2169
2169
|
if (c)
|
|
@@ -2191,7 +2191,7 @@ ${l}` + (d.length > 5 ? `
|
|
|
2191
2191
|
this.cache = null;
|
|
2192
2192
|
}
|
|
2193
2193
|
}
|
|
2194
|
-
const
|
|
2194
|
+
const Is = new wn(), vn = s.object({
|
|
2195
2195
|
name: s.string().min(1).describe("The name of the project."),
|
|
2196
2196
|
parentId: s.string().optional().describe("The ID of the parent project. If provided, creates this as a sub-project."),
|
|
2197
2197
|
isFavorite: s.boolean().optional().describe("Whether the project is a favorite. Defaults to false."),
|
|
@@ -2201,9 +2201,9 @@ const vs = new kn(), wn = s.object({
|
|
|
2201
2201
|
workspace: s.string().trim().min(1).optional().describe(
|
|
2202
2202
|
"The workspace to create the project in. Accepts a workspace name or workspace ID. If not provided, creates a personal project. Use list-workspaces to see available workspaces."
|
|
2203
2203
|
)
|
|
2204
|
-
}),
|
|
2205
|
-
projects: s.array(
|
|
2206
|
-
},
|
|
2204
|
+
}), In = {
|
|
2205
|
+
projects: s.array(vn).min(1).describe("The array of projects to add.")
|
|
2206
|
+
}, Sn = {
|
|
2207
2207
|
projects: s.array(re).describe("The created projects."),
|
|
2208
2208
|
totalCount: s.number().describe("The total number of projects created."),
|
|
2209
2209
|
failures: s.array(oe).describe(
|
|
@@ -2212,11 +2212,11 @@ const vs = new kn(), wn = s.object({
|
|
|
2212
2212
|
totalRequested: s.number().describe("The total number of projects requested."),
|
|
2213
2213
|
successCount: s.number().describe("The number of successfully created projects."),
|
|
2214
2214
|
failureCount: s.number().describe("The number of failed project creations.")
|
|
2215
|
-
},
|
|
2215
|
+
}, Cn = {
|
|
2216
2216
|
name: g.ADD_PROJECTS,
|
|
2217
2217
|
description: "Add one or more new projects.",
|
|
2218
|
-
parameters:
|
|
2219
|
-
outputSchema:
|
|
2218
|
+
parameters: In,
|
|
2219
|
+
outputSchema: Sn,
|
|
2220
2220
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
2221
2221
|
async execute({ projects: e }, t) {
|
|
2222
2222
|
const r = /* @__PURE__ */ new Map(), o = (u) => {
|
|
@@ -2224,7 +2224,7 @@ const vs = new kn(), wn = s.object({
|
|
|
2224
2224
|
return Promise.resolve(void 0);
|
|
2225
2225
|
let l = r.get(u);
|
|
2226
2226
|
return l || (l = _(
|
|
2227
|
-
() =>
|
|
2227
|
+
() => Is.resolveWorkspace(t, u)
|
|
2228
2228
|
).then(({ workspaceId: p }) => p), r.set(u, l)), l;
|
|
2229
2229
|
}, n = await Promise.allSettled(
|
|
2230
2230
|
e.map(async ({ workspace: u, ...l }) => {
|
|
@@ -2242,7 +2242,7 @@ const vs = new kn(), wn = s.object({
|
|
|
2242
2242
|
});
|
|
2243
2243
|
const c = i.map(se);
|
|
2244
2244
|
return ne(g.ADD_PROJECTS, e.length, a, { redactItems: !0 }), {
|
|
2245
|
-
textContent:
|
|
2245
|
+
textContent: jn({ projects: i, failures: a }),
|
|
2246
2246
|
structuredContent: {
|
|
2247
2247
|
projects: c,
|
|
2248
2248
|
totalCount: c.length,
|
|
@@ -2254,7 +2254,7 @@ const vs = new kn(), wn = s.object({
|
|
|
2254
2254
|
};
|
|
2255
2255
|
}
|
|
2256
2256
|
};
|
|
2257
|
-
function
|
|
2257
|
+
function jn({
|
|
2258
2258
|
projects: e,
|
|
2259
2259
|
failures: t
|
|
2260
2260
|
}) {
|
|
@@ -2263,12 +2263,12 @@ function Cn({
|
|
|
2263
2263
|
${o}` : "Added 0 projects";
|
|
2264
2264
|
return mt(n, t);
|
|
2265
2265
|
}
|
|
2266
|
-
const je = 25, Ee = s.enum(
|
|
2266
|
+
const je = 25, Ee = s.enum(Zs), Ss = s.object({
|
|
2267
2267
|
date: s.string().optional().describe("Due date in YYYY-MM-DD format."),
|
|
2268
2268
|
string: s.string().optional().describe('Natural language due string, e.g. "tomorrow at 3pm".'),
|
|
2269
2269
|
timezone: s.string().optional().describe('Timezone for the reminder, e.g. "America/New_York".'),
|
|
2270
2270
|
lang: s.string().optional().describe('Language for parsing the due string, e.g. "en".')
|
|
2271
|
-
}),
|
|
2271
|
+
}), Cs = s.enum(Jt), Oe = s.boolean().optional().describe("Whether this is an urgent reminder. Applies to relative and absolute reminders."), $n = s.object({
|
|
2272
2272
|
type: s.literal("relative"),
|
|
2273
2273
|
taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
|
|
2274
2274
|
minuteOffset: s.number().int().min(0).describe(
|
|
@@ -2278,41 +2278,41 @@ const je = 25, Ee = s.enum(Qs), Is = s.object({
|
|
|
2278
2278
|
'Delivery method: "email" or "push" notification. Defaults to push.'
|
|
2279
2279
|
),
|
|
2280
2280
|
isUrgent: Oe
|
|
2281
|
-
}),
|
|
2281
|
+
}), An = s.object({
|
|
2282
2282
|
type: s.literal("absolute"),
|
|
2283
2283
|
taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
|
|
2284
|
-
due:
|
|
2284
|
+
due: Ss.describe("The specific date/time for the reminder."),
|
|
2285
2285
|
service: Ee.optional().describe(
|
|
2286
2286
|
'Delivery method: "email" or "push" notification. Defaults to push.'
|
|
2287
2287
|
),
|
|
2288
2288
|
isUrgent: Oe
|
|
2289
|
-
}),
|
|
2289
|
+
}), Dn = s.object({
|
|
2290
2290
|
type: s.literal("location"),
|
|
2291
2291
|
taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
|
|
2292
2292
|
name: s.string().min(1).describe('Name of the location, e.g. "Office", "Home".'),
|
|
2293
2293
|
locLat: s.string().describe('Latitude of the location as a string, e.g. "37.7749".'),
|
|
2294
2294
|
locLong: s.string().describe('Longitude of the location as a string, e.g. "-122.4194".'),
|
|
2295
|
-
locTrigger:
|
|
2295
|
+
locTrigger: Cs.describe(
|
|
2296
2296
|
'When to trigger: "on_enter" (arriving) or "on_leave" (departing).'
|
|
2297
2297
|
),
|
|
2298
2298
|
radius: s.number().int().optional().describe("Radius in meters for the geofence. Defaults to server default.")
|
|
2299
|
-
}),
|
|
2300
|
-
jn,
|
|
2299
|
+
}), xn = s.discriminatedUnion("type", [
|
|
2301
2300
|
$n,
|
|
2302
|
-
An
|
|
2303
|
-
|
|
2304
|
-
|
|
2301
|
+
An,
|
|
2302
|
+
Dn
|
|
2303
|
+
]), En = {
|
|
2304
|
+
reminders: s.array(xn).min(1).max(je).describe(
|
|
2305
2305
|
`Array of reminders to create (max ${je}). Each reminder must specify a type: "relative" (minutes before due), "absolute" (specific date/time), or "location" (geofence trigger).`
|
|
2306
2306
|
)
|
|
2307
|
-
},
|
|
2307
|
+
}, On = {
|
|
2308
2308
|
reminders: s.array(lt).describe("The created reminders."),
|
|
2309
2309
|
totalCount: s.number().describe("Total number of reminders created."),
|
|
2310
2310
|
addedReminderIds: s.array(s.string()).describe("IDs of the created reminders.")
|
|
2311
|
-
},
|
|
2311
|
+
}, _n = {
|
|
2312
2312
|
name: g.ADD_REMINDERS,
|
|
2313
2313
|
description: 'Add reminders to tasks. Supports three types: "relative" (minutes before due), "absolute" (specific date/time), or "location" (geofence-triggered). Each reminder must specify a taskId.',
|
|
2314
|
-
parameters:
|
|
2315
|
-
outputSchema:
|
|
2314
|
+
parameters: En,
|
|
2315
|
+
outputSchema: On,
|
|
2316
2316
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
2317
2317
|
async execute(e, t) {
|
|
2318
2318
|
const { reminders: r } = e, o = r.map(async (c) => {
|
|
@@ -2345,7 +2345,7 @@ const je = 25, Ee = s.enum(Qs), Is = s.object({
|
|
|
2345
2345
|
}
|
|
2346
2346
|
}), i = (await Promise.all(o)).map(ke);
|
|
2347
2347
|
return {
|
|
2348
|
-
textContent:
|
|
2348
|
+
textContent: Pn(i),
|
|
2349
2349
|
structuredContent: {
|
|
2350
2350
|
reminders: i,
|
|
2351
2351
|
totalCount: i.length,
|
|
@@ -2354,8 +2354,8 @@ const je = 25, Ee = s.enum(Qs), Is = s.object({
|
|
|
2354
2354
|
};
|
|
2355
2355
|
}
|
|
2356
2356
|
};
|
|
2357
|
-
function
|
|
2358
|
-
const { timeBasedCount: t, locationCount: r } =
|
|
2357
|
+
function Pn(e) {
|
|
2358
|
+
const { timeBasedCount: t, locationCount: r } = Ts(e), o = [];
|
|
2359
2359
|
if (t > 0) {
|
|
2360
2360
|
const n = t > 1 ? "reminders" : "reminder";
|
|
2361
2361
|
o.push(`${t} time-based ${n}`);
|
|
@@ -2366,15 +2366,15 @@ function _n(e) {
|
|
|
2366
2366
|
}
|
|
2367
2367
|
return o.length > 0 ? `Added ${o.join(" and ")}` : "No reminders added";
|
|
2368
2368
|
}
|
|
2369
|
-
const
|
|
2369
|
+
const Un = s.object({
|
|
2370
2370
|
name: s.string().min(1).describe("The name of the section."),
|
|
2371
2371
|
projectId: s.string().min(1).describe(
|
|
2372
2372
|
'The ID of the project to add the section to. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
2373
2373
|
),
|
|
2374
2374
|
description: s.string().optional().describe("The description of the section. Supports Markdown.")
|
|
2375
|
-
}),
|
|
2376
|
-
sections: s.array(
|
|
2377
|
-
},
|
|
2375
|
+
}), Rn = {
|
|
2376
|
+
sections: s.array(Un).min(1).describe("The array of sections to add.")
|
|
2377
|
+
}, Ln = {
|
|
2378
2378
|
sections: s.array(Y).describe("The created sections."),
|
|
2379
2379
|
totalCount: s.number().describe("The total number of sections created."),
|
|
2380
2380
|
failures: s.array(oe).describe(
|
|
@@ -2383,11 +2383,11 @@ const Pn = s.object({
|
|
|
2383
2383
|
totalRequested: s.number().describe("The total number of sections requested."),
|
|
2384
2384
|
successCount: s.number().describe("The number of successfully created sections."),
|
|
2385
2385
|
failureCount: s.number().describe("The number of failed section creations.")
|
|
2386
|
-
},
|
|
2386
|
+
}, Nn = {
|
|
2387
2387
|
name: g.ADD_SECTIONS,
|
|
2388
2388
|
description: "Add one or more new sections to projects.",
|
|
2389
|
-
parameters:
|
|
2390
|
-
outputSchema:
|
|
2389
|
+
parameters: Rn,
|
|
2390
|
+
outputSchema: Ln,
|
|
2391
2391
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
2392
2392
|
async execute({ sections: e }, t) {
|
|
2393
2393
|
const r = e.some((c) => B(c.projectId)) ? _(() => t.getUser()) : void 0, o = await Promise.allSettled(
|
|
@@ -2406,7 +2406,7 @@ const Pn = s.object({
|
|
|
2406
2406
|
error: N(c.reason)
|
|
2407
2407
|
});
|
|
2408
2408
|
}), ne(g.ADD_SECTIONS, e.length, i, { redactItems: !0 }), {
|
|
2409
|
-
textContent:
|
|
2409
|
+
textContent: Mn({ sections: n, failures: i }),
|
|
2410
2410
|
structuredContent: {
|
|
2411
2411
|
sections: n.map(G),
|
|
2412
2412
|
totalCount: n.length,
|
|
@@ -2418,7 +2418,7 @@ const Pn = s.object({
|
|
|
2418
2418
|
};
|
|
2419
2419
|
}
|
|
2420
2420
|
};
|
|
2421
|
-
function
|
|
2421
|
+
function Mn({
|
|
2422
2422
|
sections: e,
|
|
2423
2423
|
failures: t
|
|
2424
2424
|
}) {
|
|
@@ -2436,7 +2436,7 @@ const ue = {
|
|
|
2436
2436
|
PROJECT_NOT_FOUND: "PROJECT_NOT_FOUND",
|
|
2437
2437
|
TASK_NOT_FOUND: "TASK_NOT_FOUND"
|
|
2438
2438
|
};
|
|
2439
|
-
class
|
|
2439
|
+
class Fn {
|
|
2440
2440
|
/**
|
|
2441
2441
|
* Validate a single assignment operation
|
|
2442
2442
|
*/
|
|
@@ -2645,7 +2645,7 @@ class Mn {
|
|
|
2645
2645
|
};
|
|
2646
2646
|
}
|
|
2647
2647
|
}
|
|
2648
|
-
const ft = new
|
|
2648
|
+
const ft = new Fn(), Ot = os.TASKS_PER_OPERATION, Hn = s.object({
|
|
2649
2649
|
content: s.string().min(1).describe(
|
|
2650
2650
|
'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.'
|
|
2651
2651
|
),
|
|
@@ -2676,24 +2676,24 @@ const ft = new Mn(), Ot = rs.TASKS_PER_OPERATION, Fn = s.object({
|
|
|
2676
2676
|
"Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
|
|
2677
2677
|
)
|
|
2678
2678
|
}), _t = {
|
|
2679
|
-
tasks: s.array(
|
|
2680
|
-
},
|
|
2679
|
+
tasks: s.array(Hn).min(1).max(Ot).describe(`The array of tasks to add (max ${Ot}).`)
|
|
2680
|
+
}, Wn = {
|
|
2681
2681
|
tasks: s.array(K).describe("The created tasks."),
|
|
2682
2682
|
totalCount: s.number().describe("The total number of tasks created."),
|
|
2683
2683
|
failures: s.array(oe).describe("Failed task creations with error details."),
|
|
2684
2684
|
totalRequested: s.number().describe("The total number of tasks requested."),
|
|
2685
2685
|
successCount: s.number().describe("The number of successfully created tasks."),
|
|
2686
2686
|
failureCount: s.number().describe("The number of failed task creations.")
|
|
2687
|
-
},
|
|
2687
|
+
}, Bn = {
|
|
2688
2688
|
name: g.ADD_TASKS,
|
|
2689
2689
|
description: "Add one or more tasks to a project, section, or parent. Supports assignment to project collaborators.",
|
|
2690
2690
|
parameters: _t,
|
|
2691
|
-
outputSchema:
|
|
2691
|
+
outputSchema: Wn,
|
|
2692
2692
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
2693
2693
|
async execute(e, t) {
|
|
2694
2694
|
const { tasks: r } = s.object(_t).parse(e), o = /* @__PURE__ */ new Map();
|
|
2695
2695
|
r.forEach((h, m) => {
|
|
2696
|
-
const y =
|
|
2696
|
+
const y = zn(h), f = o.get(y);
|
|
2697
2697
|
f ? f.push({ task: h, index: m }) : o.set(y, [{ task: h, index: m }]);
|
|
2698
2698
|
});
|
|
2699
2699
|
const n = /* @__PURE__ */ new Map(), a = (await Promise.all(
|
|
@@ -2701,7 +2701,7 @@ const ft = new Mn(), Ot = rs.TASKS_PER_OPERATION, Fn = s.object({
|
|
|
2701
2701
|
const m = [];
|
|
2702
2702
|
for (const { task: y, index: f } of h)
|
|
2703
2703
|
try {
|
|
2704
|
-
const w = await
|
|
2704
|
+
const w = await Kn(y, t, n);
|
|
2705
2705
|
m.push({ index: f, result: { status: "fulfilled", value: w } });
|
|
2706
2706
|
} catch (w) {
|
|
2707
2707
|
m.push({
|
|
@@ -2723,11 +2723,11 @@ const ft = new Mn(), Ot = rs.TASKS_PER_OPERATION, Fn = s.object({
|
|
|
2723
2723
|
}));
|
|
2724
2724
|
if (c.length === 0 && d.length > 0) {
|
|
2725
2725
|
const h = d.map((y) => `"${y.item}": ${y.error}`).join("; "), m = `All ${d.length} task(s) failed to create: ${h}`;
|
|
2726
|
-
throw u ? new
|
|
2726
|
+
throw u ? new rs(m) : new Error(m);
|
|
2727
2727
|
}
|
|
2728
2728
|
const l = c.map(P);
|
|
2729
2729
|
return ne(g.ADD_TASKS, r.length, d, { redactItems: !0 }), {
|
|
2730
|
-
textContent:
|
|
2730
|
+
textContent: qn({
|
|
2731
2731
|
tasks: l,
|
|
2732
2732
|
failures: d,
|
|
2733
2733
|
args: { tasks: r }
|
|
@@ -2743,10 +2743,10 @@ const ft = new Mn(), Ot = rs.TASKS_PER_OPERATION, Fn = s.object({
|
|
|
2743
2743
|
};
|
|
2744
2744
|
}
|
|
2745
2745
|
};
|
|
2746
|
-
function
|
|
2746
|
+
function zn(e) {
|
|
2747
2747
|
return `${e.projectId ?? ""}|${e.sectionId ?? ""}|${e.parentId ?? ""}`;
|
|
2748
2748
|
}
|
|
2749
|
-
async function
|
|
2749
|
+
async function Kn(e, t, r) {
|
|
2750
2750
|
const {
|
|
2751
2751
|
duration: o,
|
|
2752
2752
|
projectId: n,
|
|
@@ -2775,13 +2775,13 @@ async function zn(e, t, r) {
|
|
|
2775
2775
|
labels: l,
|
|
2776
2776
|
deadlineDate: p
|
|
2777
2777
|
};
|
|
2778
|
-
if (u && (y.priority =
|
|
2778
|
+
if (u && (y.priority = ps(u)), d && !m && !i && !a)
|
|
2779
2779
|
throw new Error(
|
|
2780
2780
|
`Task "${e.content}": Cannot assign tasks without specifying project context. Please specify a projectId, sectionId, or parentId.`
|
|
2781
2781
|
);
|
|
2782
2782
|
if (o)
|
|
2783
2783
|
try {
|
|
2784
|
-
const { minutes: f } =
|
|
2784
|
+
const { minutes: f } = us(o);
|
|
2785
2785
|
y = {
|
|
2786
2786
|
...y,
|
|
2787
2787
|
duration: f,
|
|
@@ -2824,7 +2824,7 @@ async function zn(e, t, r) {
|
|
|
2824
2824
|
try {
|
|
2825
2825
|
return await t.addTask(y);
|
|
2826
2826
|
} catch (f) {
|
|
2827
|
-
const w =
|
|
2827
|
+
const w = yr(f, {
|
|
2828
2828
|
taskContent: e.content,
|
|
2829
2829
|
dueString: e.dueString,
|
|
2830
2830
|
deadlineDate: e.deadlineDate
|
|
@@ -2832,7 +2832,7 @@ async function zn(e, t, r) {
|
|
|
2832
2832
|
throw w ? new $e(w) : f;
|
|
2833
2833
|
}
|
|
2834
2834
|
}
|
|
2835
|
-
function
|
|
2835
|
+
function qn({
|
|
2836
2836
|
tasks: e,
|
|
2837
2837
|
failures: t,
|
|
2838
2838
|
args: r
|
|
@@ -2857,11 +2857,11 @@ function Kn({
|
|
|
2857
2857
|
showDetails: !0
|
|
2858
2858
|
});
|
|
2859
2859
|
}
|
|
2860
|
-
const
|
|
2860
|
+
const Yn = {
|
|
2861
2861
|
projectId: s.string().min(1).describe(
|
|
2862
2862
|
"The ID of the project to analyze. This triggers a new health analysis which may take some time to complete."
|
|
2863
2863
|
)
|
|
2864
|
-
},
|
|
2864
|
+
}, Gn = {
|
|
2865
2865
|
projectId: s.string().describe("The project ID."),
|
|
2866
2866
|
health: s.object({
|
|
2867
2867
|
status: s.enum(tt).describe("The health status after triggering analysis."),
|
|
@@ -2869,11 +2869,11 @@ const qn = {
|
|
|
2869
2869
|
updateInProgress: s.boolean().describe("Whether an analysis update is currently in progress.")
|
|
2870
2870
|
}).describe("The health response returned after triggering analysis."),
|
|
2871
2871
|
message: s.string().describe("A human-readable message about the analysis status.")
|
|
2872
|
-
},
|
|
2872
|
+
}, Vn = {
|
|
2873
2873
|
name: g.ANALYZE_PROJECT_HEALTH,
|
|
2874
2874
|
description: "Trigger a new health analysis for a project. Use this when the health data is stale or you want a fresh assessment. The analysis may take time to complete — use get-project-health afterward to see updated results.",
|
|
2875
|
-
parameters:
|
|
2876
|
-
outputSchema:
|
|
2875
|
+
parameters: Yn,
|
|
2876
|
+
outputSchema: Gn,
|
|
2877
2877
|
annotations: {
|
|
2878
2878
|
readOnlyHint: !1,
|
|
2879
2879
|
destructiveHint: !1,
|
|
@@ -2896,19 +2896,19 @@ ${n}`,
|
|
|
2896
2896
|
}
|
|
2897
2897
|
};
|
|
2898
2898
|
}
|
|
2899
|
-
}, Vn = {
|
|
2900
|
-
ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to complete.")
|
|
2901
2899
|
}, Jn = {
|
|
2900
|
+
ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to complete.")
|
|
2901
|
+
}, Xn = {
|
|
2902
2902
|
completed: s.array(s.string()).describe("The IDs of successfully completed tasks."),
|
|
2903
2903
|
failures: s.array(oe).describe("Failed task completions with error details."),
|
|
2904
2904
|
totalRequested: s.number().describe("The total number of tasks requested to complete."),
|
|
2905
2905
|
successCount: s.number().describe("The number of successfully completed tasks."),
|
|
2906
2906
|
failureCount: s.number().describe("The number of failed task completions.")
|
|
2907
|
-
},
|
|
2907
|
+
}, Qn = {
|
|
2908
2908
|
name: g.COMPLETE_TASKS,
|
|
2909
2909
|
description: "Complete one or more tasks by their IDs.",
|
|
2910
|
-
parameters:
|
|
2911
|
-
outputSchema:
|
|
2910
|
+
parameters: Jn,
|
|
2911
|
+
outputSchema: Xn,
|
|
2912
2912
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
2913
2913
|
async execute(e, t) {
|
|
2914
2914
|
const r = [], o = [];
|
|
@@ -2922,7 +2922,7 @@ ${n}`,
|
|
|
2922
2922
|
});
|
|
2923
2923
|
}
|
|
2924
2924
|
return ne(g.COMPLETE_TASKS, e.ids.length, o), {
|
|
2925
|
-
textContent:
|
|
2925
|
+
textContent: Zn({
|
|
2926
2926
|
completed: r,
|
|
2927
2927
|
failures: o,
|
|
2928
2928
|
args: e
|
|
@@ -2937,7 +2937,7 @@ ${n}`,
|
|
|
2937
2937
|
};
|
|
2938
2938
|
}
|
|
2939
2939
|
};
|
|
2940
|
-
function
|
|
2940
|
+
function Zn({
|
|
2941
2941
|
completed: e,
|
|
2942
2942
|
failures: t,
|
|
2943
2943
|
args: r
|
|
@@ -2950,7 +2950,7 @@ function Qn({
|
|
|
2950
2950
|
failures: t
|
|
2951
2951
|
});
|
|
2952
2952
|
}
|
|
2953
|
-
const
|
|
2953
|
+
const js = [
|
|
2954
2954
|
"project",
|
|
2955
2955
|
"section",
|
|
2956
2956
|
"task",
|
|
@@ -2959,20 +2959,20 @@ const Cs = [
|
|
|
2959
2959
|
"filter",
|
|
2960
2960
|
"reminder",
|
|
2961
2961
|
"location_reminder"
|
|
2962
|
-
],
|
|
2963
|
-
type: s.enum(
|
|
2962
|
+
], ei = {
|
|
2963
|
+
type: s.enum(js).describe("The type of entity to delete."),
|
|
2964
2964
|
id: s.string().min(1).describe("The ID of the entity to delete.")
|
|
2965
|
-
},
|
|
2965
|
+
}, ti = {
|
|
2966
2966
|
deletedEntity: s.object({
|
|
2967
|
-
type: s.enum(
|
|
2967
|
+
type: s.enum(js).describe("The type of deleted entity."),
|
|
2968
2968
|
id: s.string().describe("The ID of the deleted entity.")
|
|
2969
2969
|
}).describe("Information about the deleted entity."),
|
|
2970
2970
|
success: s.boolean().describe("Whether the deletion was successful.")
|
|
2971
|
-
},
|
|
2971
|
+
}, si = {
|
|
2972
2972
|
name: g.DELETE_OBJECT,
|
|
2973
2973
|
description: "Delete a project, section, task, comment, label, filter, reminder, or location_reminder by its ID. Projects can be deleted whether active or archived (find archived ones via find-projects with archivedStatus); note a workspace project must be archived before it can be deleted, while personal projects can be deleted regardless.",
|
|
2974
|
-
parameters:
|
|
2975
|
-
outputSchema:
|
|
2974
|
+
parameters: ei,
|
|
2975
|
+
outputSchema: ti,
|
|
2976
2976
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !0 },
|
|
2977
2977
|
async execute(e, t) {
|
|
2978
2978
|
switch (e.type) {
|
|
@@ -3017,25 +3017,25 @@ const Cs = [
|
|
|
3017
3017
|
}
|
|
3018
3018
|
};
|
|
3019
3019
|
}
|
|
3020
|
-
}, Pt = 5,
|
|
3020
|
+
}, Pt = 5, $s = ["file", "url"], ri = {
|
|
3021
3021
|
projectId: s.string().min(1).describe("The ID of the project to export as a template."),
|
|
3022
|
-
format: s.enum(
|
|
3022
|
+
format: s.enum($s).default("file").describe(
|
|
3023
3023
|
'How to return the template. "file" returns the CSV content, which can be passed straight back to import-project-template. "url" returns a shareable download link instead, and is the better choice for large projects because it does not return the whole file.'
|
|
3024
3024
|
),
|
|
3025
3025
|
useRelativeDates: s.boolean().optional().describe(
|
|
3026
3026
|
'Export due dates relative to the import date (e.g. "day 3") instead of absolute dates. Defaults to false.'
|
|
3027
3027
|
)
|
|
3028
|
-
},
|
|
3029
|
-
format: s.enum(
|
|
3028
|
+
}, oi = {
|
|
3029
|
+
format: s.enum($s).describe("The format the template was exported in."),
|
|
3030
3030
|
content: s.string().optional().describe('The template as CSV content. Only present when format is "file".'),
|
|
3031
3031
|
lineCount: s.number().optional().describe('Number of rows in the exported CSV. Only present when format is "file".'),
|
|
3032
3032
|
fileName: s.string().optional().describe('The generated template file name. Only present when format is "url".'),
|
|
3033
3033
|
fileUrl: s.string().optional().describe('The shareable download URL. Only present when format is "url".')
|
|
3034
|
-
},
|
|
3034
|
+
}, ni = {
|
|
3035
3035
|
name: g.EXPORT_PROJECT_TEMPLATE,
|
|
3036
3036
|
description: "Export an existing project as a Todoist template, either as CSV content or as a shareable URL. Use it to duplicate a project, share its structure, or hand the CSV to import-project-template. To read a project rather than export it, use find-tasks instead — it returns structured tasks rather than raw CSV. Nothing is modified.",
|
|
3037
|
-
parameters:
|
|
3038
|
-
outputSchema:
|
|
3037
|
+
parameters: ri,
|
|
3038
|
+
outputSchema: oi,
|
|
3039
3039
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3040
3040
|
// `format` is defaulted here as well as in the schema: scripts/run-tool.ts calls
|
|
3041
3041
|
// execute() with raw JSON, so schema defaults are not applied on that path.
|
|
@@ -3056,12 +3056,12 @@ ${c}`,
|
|
|
3056
3056
|
return {
|
|
3057
3057
|
// The full CSV already ships in structuredContent; a preview here keeps a large
|
|
3058
3058
|
// project from being spelled out twice in the response.
|
|
3059
|
-
textContent:
|
|
3059
|
+
textContent: ii({ projectId: e, lines: i }),
|
|
3060
3060
|
structuredContent: { format: t, content: n, lineCount: i.length }
|
|
3061
3061
|
};
|
|
3062
3062
|
}
|
|
3063
3063
|
};
|
|
3064
|
-
function
|
|
3064
|
+
function ii({ projectId: e, lines: t }) {
|
|
3065
3065
|
const r = `Exported project (id=${e}) as a template file (${t.length} row${t.length === 1 ? "" : "s"}).`, o = t.slice(0, Pt).join(`
|
|
3066
3066
|
`), n = t.length - Pt;
|
|
3067
3067
|
return n > 0 ? `${r}
|
|
@@ -3071,7 +3071,7 @@ ${o}
|
|
|
3071
3071
|
|
|
3072
3072
|
${o}`;
|
|
3073
3073
|
}
|
|
3074
|
-
const
|
|
3074
|
+
const ai = K.pick({
|
|
3075
3075
|
id: !0,
|
|
3076
3076
|
content: !0,
|
|
3077
3077
|
dueDate: !0,
|
|
@@ -3080,15 +3080,15 @@ const ii = K.pick({
|
|
|
3080
3080
|
hasChildren: s.boolean().describe(
|
|
3081
3081
|
"Whether this subtask has subtasks of its own. Fetch it with includeChildren to expand."
|
|
3082
3082
|
)
|
|
3083
|
-
}),
|
|
3083
|
+
}), ci = re.pick({ id: !0, name: !0 }).extend({
|
|
3084
3084
|
hasChildren: s.boolean().describe(
|
|
3085
3085
|
"Whether this sub-project has sub-projects of its own. Fetch it with includeChildren to expand."
|
|
3086
3086
|
)
|
|
3087
|
-
}),
|
|
3087
|
+
}), di = {
|
|
3088
3088
|
childCount: s.number().optional().describe(
|
|
3089
3089
|
"The number of direct children listed in children. Only present when children were requested and the type supports them. 0 means the object definitively has none."
|
|
3090
3090
|
),
|
|
3091
|
-
children: s.array(s.union([
|
|
3091
|
+
children: s.array(s.union([ai, ci])).optional().describe(
|
|
3092
3092
|
"Direct children only: subtasks for a task, sub-projects for a project. Completed subtasks and archived sub-projects are excluded."
|
|
3093
3093
|
),
|
|
3094
3094
|
hasMoreChildren: s.boolean().optional().describe(
|
|
@@ -3098,7 +3098,7 @@ const ii = K.pick({
|
|
|
3098
3098
|
'Present when the children lookup failed or returned incomplete information. When no children are listed alongside it, childCount is unknown - do not read its absence as "no children".'
|
|
3099
3099
|
)
|
|
3100
3100
|
};
|
|
3101
|
-
async function
|
|
3101
|
+
async function li(e, t) {
|
|
3102
3102
|
const { results: r, nextCursor: o } = await e.getTasks({
|
|
3103
3103
|
parentId: t,
|
|
3104
3104
|
limit: j.CHILDREN_MAX
|
|
@@ -3121,10 +3121,10 @@ async function di(e, t) {
|
|
|
3121
3121
|
childrenError: i ? `Could not check ${i} of ${r.length} subtasks for subtasks of their own; those are reported as hasChildren=false.` : void 0
|
|
3122
3122
|
};
|
|
3123
3123
|
}
|
|
3124
|
-
async function
|
|
3124
|
+
async function ui(e, t) {
|
|
3125
3125
|
if (!q(t))
|
|
3126
3126
|
return { childCount: 0, children: [] };
|
|
3127
|
-
const r = await
|
|
3127
|
+
const r = await ys(e), o = /* @__PURE__ */ new Map();
|
|
3128
3128
|
for (const a of r) {
|
|
3129
3129
|
if (!q(a) || !a.parentId) continue;
|
|
3130
3130
|
const c = o.get(a.parentId) ?? [];
|
|
@@ -3154,22 +3154,22 @@ function Rt(e, t) {
|
|
|
3154
3154
|
const r = t.hasMoreChildren ? "+" : "", o = t.childrenError ? " (partial)" : "";
|
|
3155
3155
|
return ` • ${e}=${t.childCount}${r}${o}`;
|
|
3156
3156
|
}
|
|
3157
|
-
const
|
|
3158
|
-
type: s.enum(
|
|
3157
|
+
const As = ["task", "project", "comment", "section"], pi = {
|
|
3158
|
+
type: s.enum(As).describe("The type of object to fetch."),
|
|
3159
3159
|
id: s.string().min(1).describe("The unique ID of the object to fetch."),
|
|
3160
3160
|
includeChildren: s.boolean().optional().describe(
|
|
3161
3161
|
"Also return the direct children of the object: subtasks for a task, sub-projects for a project. Returns childCount plus a compact list, flagging each child that has children of its own. Use this to check whether a task hides subtasks instead of a speculative find-tasks lookup. Ignored for comments and sections."
|
|
3162
3162
|
)
|
|
3163
|
-
},
|
|
3164
|
-
type: s.enum(
|
|
3163
|
+
}, hi = {
|
|
3164
|
+
type: s.enum(As).describe("The type of object fetched."),
|
|
3165
3165
|
id: s.string().describe("The ID of the fetched object."),
|
|
3166
3166
|
object: s.union([K, re, ve, Y]).describe("The fetched object data."),
|
|
3167
|
-
...
|
|
3168
|
-
},
|
|
3167
|
+
...di
|
|
3168
|
+
}, mi = {
|
|
3169
3169
|
name: g.FETCH_OBJECT,
|
|
3170
3170
|
description: "Fetch a single task, project, comment, or section by its ID. Use this when you have a specific object ID and want to retrieve its full details. Set includeChildren to also get its direct subtasks or sub-projects.",
|
|
3171
|
-
parameters:
|
|
3172
|
-
outputSchema:
|
|
3171
|
+
parameters: pi,
|
|
3172
|
+
outputSchema: hi,
|
|
3173
3173
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3174
3174
|
async execute(e, t) {
|
|
3175
3175
|
const { type: r, id: o, includeChildren: n } = e;
|
|
@@ -3178,7 +3178,7 @@ const $s = ["task", "project", "comment", "section"], ui = {
|
|
|
3178
3178
|
case "task": {
|
|
3179
3179
|
const [i, a] = await Promise.all([
|
|
3180
3180
|
t.getTask(o),
|
|
3181
|
-
n ? Ut(() =>
|
|
3181
|
+
n ? Ut(() => li(t, o)) : Promise.resolve({})
|
|
3182
3182
|
]), c = P(i);
|
|
3183
3183
|
return {
|
|
3184
3184
|
textContent: `Found task: ${c.content} • id=${c.id} • priority=${c.priority} • project=${c.projectId}${Rt("subtasks", a)}`,
|
|
@@ -3191,7 +3191,7 @@ const $s = ["task", "project", "comment", "section"], ui = {
|
|
|
3191
3191
|
};
|
|
3192
3192
|
}
|
|
3193
3193
|
case "project": {
|
|
3194
|
-
const i = await t.getProject(o), a = se(i), c = n ? await Ut(() =>
|
|
3194
|
+
const i = await t.getProject(o), a = se(i), c = n ? await Ut(() => ui(t, i)) : {};
|
|
3195
3195
|
return {
|
|
3196
3196
|
textContent: `Found project: ${a.name} • id=${a.id} • color=${a.color} • viewStyle=${a.viewStyle}${Rt("subProjects", c)}`,
|
|
3197
3197
|
structuredContent: {
|
|
@@ -3234,21 +3234,21 @@ const $s = ["task", "project", "comment", "section"], ui = {
|
|
|
3234
3234
|
);
|
|
3235
3235
|
}
|
|
3236
3236
|
}
|
|
3237
|
-
},
|
|
3237
|
+
}, fi = {
|
|
3238
3238
|
id: s.string().min(1).describe(
|
|
3239
3239
|
'A unique identifier for the document in the format "task:{id}" or "project:{id}".'
|
|
3240
3240
|
)
|
|
3241
|
-
},
|
|
3241
|
+
}, bi = {
|
|
3242
3242
|
id: s.string().describe("The ID of the fetched document."),
|
|
3243
3243
|
title: s.string().describe("The title of the document."),
|
|
3244
3244
|
text: s.string().describe("The text content of the document."),
|
|
3245
3245
|
url: s.string().describe("The URL of the document."),
|
|
3246
3246
|
metadata: s.record(s.string(), s.unknown()).optional().describe("Additional metadata about the document.")
|
|
3247
|
-
},
|
|
3247
|
+
}, gi = {
|
|
3248
3248
|
name: g.FETCH,
|
|
3249
3249
|
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}".',
|
|
3250
|
-
parameters:
|
|
3251
|
-
outputSchema:
|
|
3250
|
+
parameters: fi,
|
|
3251
|
+
outputSchema: bi,
|
|
3252
3252
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3253
3253
|
async execute(e, t) {
|
|
3254
3254
|
const { id: r } = e, [o, n] = r.split(":", 2);
|
|
@@ -3308,11 +3308,11 @@ Favorite: Yes`), i = {
|
|
|
3308
3308
|
structuredContent: i
|
|
3309
3309
|
};
|
|
3310
3310
|
}
|
|
3311
|
-
},
|
|
3311
|
+
}, yi = s.union([s.iso.date(), s.iso.datetime({ offset: !0 })]);
|
|
3312
3312
|
function Lt(e) {
|
|
3313
|
-
return R(e).pipe(
|
|
3313
|
+
return R(e).pipe(yi.optional());
|
|
3314
3314
|
}
|
|
3315
|
-
const
|
|
3315
|
+
const Ti = {
|
|
3316
3316
|
objectType: s.enum(["task", "project", "comment"]).optional().describe("Type of object to filter by."),
|
|
3317
3317
|
objectId: s.string().optional().describe("Filter by specific object ID (task, project, or comment)."),
|
|
3318
3318
|
eventType: s.enum([
|
|
@@ -3339,17 +3339,17 @@ const yi = {
|
|
|
3339
3339
|
),
|
|
3340
3340
|
limit: s.number().int().min(1).max(j.ACTIVITY_MAX).default(j.ACTIVITY_DEFAULT).describe("Maximum number of activity events to return."),
|
|
3341
3341
|
cursor: s.string().optional().describe("Pagination cursor for retrieving the next page of results.")
|
|
3342
|
-
},
|
|
3343
|
-
events: s.array(
|
|
3342
|
+
}, ki = {
|
|
3343
|
+
events: s.array(qo).describe("The activity events."),
|
|
3344
3344
|
nextCursor: s.string().optional(),
|
|
3345
3345
|
totalCount: s.number().describe("The total number of events in this page."),
|
|
3346
3346
|
hasMore: s.boolean(),
|
|
3347
3347
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
3348
|
-
},
|
|
3348
|
+
}, wi = {
|
|
3349
3349
|
name: g.FIND_ACTIVITY,
|
|
3350
3350
|
description: `Retrieve activity logs to monitor and audit changes in Todoist. Shows events from all users by default (use initiatorId to filter by specific user). To answer what someone completed in a period, including recurring task occurrences, use objectType "task", eventType "completed", and dateFrom/dateTo. For a first-person question ("what did I get done"), also set initiatorId to the current user from user-info, or the answer includes collaborators' completions. Track task completions, updates, deletions, project changes, and more with flexible filtering. Activity history availability and retention depend on the user plan.`,
|
|
3351
|
-
parameters:
|
|
3352
|
-
outputSchema:
|
|
3351
|
+
parameters: Ti,
|
|
3352
|
+
outputSchema: ki,
|
|
3353
3353
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3354
3354
|
async execute(e, t) {
|
|
3355
3355
|
const {
|
|
@@ -3368,9 +3368,9 @@ const yi = {
|
|
|
3368
3368
|
cursor: p ?? null
|
|
3369
3369
|
};
|
|
3370
3370
|
r && n ? h.objectEventTypes = `${r}:${n}` : r ? h.objectEventTypes = `${r}:` : n && (h.objectEventTypes = `:${n}`), o && o !== "remove" && (h.objectId = o), i && (h.parentProjectId = i), a && (h.parentItemId = a), c && (h.initiatorId = c), d && (h.dateFrom = d), u && (h.dateTo = u);
|
|
3371
|
-
const { results: m, nextCursor: y } = await t.getActivityLogs(h), f = m.map(
|
|
3371
|
+
const { results: m, nextCursor: y } = await t.getActivityLogs(h), f = m.map(No);
|
|
3372
3372
|
return {
|
|
3373
|
-
textContent:
|
|
3373
|
+
textContent: vi({ events: f, args: e, nextCursor: y }),
|
|
3374
3374
|
structuredContent: {
|
|
3375
3375
|
events: f,
|
|
3376
3376
|
nextCursor: y ?? void 0,
|
|
@@ -3381,7 +3381,7 @@ const yi = {
|
|
|
3381
3381
|
};
|
|
3382
3382
|
}
|
|
3383
3383
|
};
|
|
3384
|
-
function
|
|
3384
|
+
function vi({
|
|
3385
3385
|
events: e,
|
|
3386
3386
|
args: t,
|
|
3387
3387
|
nextCursor: r
|
|
@@ -3402,12 +3402,12 @@ function wi({
|
|
|
3402
3402
|
limit: t.limit,
|
|
3403
3403
|
nextCursor: r ?? void 0,
|
|
3404
3404
|
filterHints: i,
|
|
3405
|
-
previewLines:
|
|
3405
|
+
previewLines: Ii(e, Math.min(e.length, t.limit)),
|
|
3406
3406
|
zeroReasonHints: a
|
|
3407
3407
|
});
|
|
3408
3408
|
}
|
|
3409
|
-
function
|
|
3410
|
-
const o = e.slice(0, t).map(
|
|
3409
|
+
function Ii(e, t = 10) {
|
|
3410
|
+
const o = e.slice(0, t).map(Si).join(`
|
|
3411
3411
|
`);
|
|
3412
3412
|
if (e.length > t) {
|
|
3413
3413
|
const n = e.length - t;
|
|
@@ -3416,8 +3416,8 @@ function vi(e, t = 10) {
|
|
|
3416
3416
|
}
|
|
3417
3417
|
return o;
|
|
3418
3418
|
}
|
|
3419
|
-
function
|
|
3420
|
-
const t =
|
|
3419
|
+
function Si(e) {
|
|
3420
|
+
const t = Ci(e.eventDate), r = `${e.eventType} ${e.objectType}`;
|
|
3421
3421
|
let o = "";
|
|
3422
3422
|
if (e.extraData) {
|
|
3423
3423
|
const c = e.extraData.content || e.extraData.name || e.extraData.last_content;
|
|
@@ -3426,7 +3426,7 @@ function Ii(e) {
|
|
|
3426
3426
|
const n = e.objectId ? ` • id=${e.objectId}` : "", i = e.initiatorId ? ` • by=${e.initiatorId}` : " • system", a = e.parentProjectId ? ` • project=${e.parentProjectId}` : "";
|
|
3427
3427
|
return ` [${t}] ${r}${o}${n}${i}${a}`;
|
|
3428
3428
|
}
|
|
3429
|
-
function
|
|
3429
|
+
function Ci(e) {
|
|
3430
3430
|
try {
|
|
3431
3431
|
const t = new Date(e), r = t.toLocaleDateString("en-US", { month: "short", timeZone: "UTC" }), o = t.toLocaleDateString("en-US", { day: "numeric", timeZone: "UTC" }), n = t.toLocaleTimeString("en-US", {
|
|
3432
3432
|
hour: "2-digit",
|
|
@@ -3439,7 +3439,7 @@ function Si(e) {
|
|
|
3439
3439
|
return e;
|
|
3440
3440
|
}
|
|
3441
3441
|
}
|
|
3442
|
-
const
|
|
3442
|
+
const ji = {
|
|
3443
3443
|
taskId: s.string().optional().describe("Find comments for a specific task."),
|
|
3444
3444
|
projectId: s.string().optional().describe(
|
|
3445
3445
|
'Find comments for a specific project. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
@@ -3447,7 +3447,7 @@ const Ci = {
|
|
|
3447
3447
|
commentId: s.string().optional().describe("Get a specific comment by ID."),
|
|
3448
3448
|
cursor: s.string().optional().describe("Pagination cursor for retrieving more results."),
|
|
3449
3449
|
limit: s.number().int().min(1).max(j.COMMENTS_MAX).optional().describe("Maximum number of comments to return")
|
|
3450
|
-
},
|
|
3450
|
+
}, $i = {
|
|
3451
3451
|
comments: s.array(ve).describe("The found comments."),
|
|
3452
3452
|
searchType: s.string().describe(
|
|
3453
3453
|
'The type of search performed: "single" (comment ID), "task" (task ID), or "project" (project ID).'
|
|
@@ -3456,11 +3456,11 @@ const Ci = {
|
|
|
3456
3456
|
hasMore: s.boolean(),
|
|
3457
3457
|
nextCursor: s.string().optional(),
|
|
3458
3458
|
totalCount: s.number().describe("The total number of comments in this page.")
|
|
3459
|
-
},
|
|
3459
|
+
}, Ai = {
|
|
3460
3460
|
name: g.FIND_COMMENTS,
|
|
3461
3461
|
description: "Find comments by task, project, or get a specific comment by ID. Exactly one of taskId, projectId, or commentId must be provided.",
|
|
3462
|
-
parameters:
|
|
3463
|
-
outputSchema:
|
|
3462
|
+
parameters: ji,
|
|
3463
|
+
outputSchema: $i,
|
|
3464
3464
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3465
3465
|
async execute(e, t) {
|
|
3466
3466
|
const r = Ae(e.cursor), o = [e.taskId, e.projectId, e.commentId].filter(Boolean);
|
|
@@ -3495,7 +3495,7 @@ const Ci = {
|
|
|
3495
3495
|
throw new Error("Invalid state: no search parameter provided");
|
|
3496
3496
|
const d = c.map(we);
|
|
3497
3497
|
return {
|
|
3498
|
-
textContent:
|
|
3498
|
+
textContent: Di({
|
|
3499
3499
|
comments: d,
|
|
3500
3500
|
searchType: e.commentId ? "single" : e.taskId ? "task" : "project",
|
|
3501
3501
|
searchId: e.commentId || e.taskId || e.projectId || "",
|
|
@@ -3513,7 +3513,7 @@ const Ci = {
|
|
|
3513
3513
|
};
|
|
3514
3514
|
}
|
|
3515
3515
|
};
|
|
3516
|
-
function
|
|
3516
|
+
function Di({
|
|
3517
3517
|
comments: e,
|
|
3518
3518
|
searchType: t,
|
|
3519
3519
|
searchId: r,
|
|
@@ -3533,37 +3533,37 @@ function Ai({
|
|
|
3533
3533
|
i = `Found ${e.length} ${d} for ${t} ${r}${c}`, o && (i += " • More available");
|
|
3534
3534
|
}
|
|
3535
3535
|
if (n) {
|
|
3536
|
-
const a =
|
|
3536
|
+
const a = vs([], n);
|
|
3537
3537
|
return `${i}
|
|
3538
3538
|
${a}`;
|
|
3539
3539
|
}
|
|
3540
3540
|
return i;
|
|
3541
3541
|
}
|
|
3542
|
-
function
|
|
3542
|
+
function Ds(e) {
|
|
3543
3543
|
const t = e.getUTCFullYear(), r = String(e.getUTCMonth() + 1).padStart(2, "0"), o = String(e.getUTCDate()).padStart(2, "0");
|
|
3544
3544
|
return `${t}-${r}-${o}`;
|
|
3545
3545
|
}
|
|
3546
|
-
function
|
|
3546
|
+
function xi(e) {
|
|
3547
3547
|
const t = /^([+-])(\d{2}):(\d{2})$/.exec(e);
|
|
3548
3548
|
if (!t)
|
|
3549
3549
|
return 0;
|
|
3550
3550
|
const [, r, o, n] = t, i = Number(o) * 60 + Number(n);
|
|
3551
3551
|
return r === "-" ? -i : i;
|
|
3552
3552
|
}
|
|
3553
|
-
function
|
|
3553
|
+
function Ei(e, t) {
|
|
3554
3554
|
const r = new Date(e.getTime() + t * 60 * 1e3);
|
|
3555
|
-
return
|
|
3555
|
+
return Ds(r);
|
|
3556
3556
|
}
|
|
3557
3557
|
function Nt(e, t) {
|
|
3558
3558
|
const [r, o, n] = e.split("-"), i = Number(r), a = Number(o), c = Number(n);
|
|
3559
3559
|
if (!Number.isFinite(i) || !Number.isFinite(a) || !Number.isFinite(c))
|
|
3560
3560
|
throw new Error(`Invalid date format: ${e}. Expected YYYY-MM-DD.`);
|
|
3561
3561
|
const d = new Date(Date.UTC(i, a - 1, c));
|
|
3562
|
-
return d.setUTCDate(d.getUTCDate() + t),
|
|
3562
|
+
return d.setUTCDate(d.getUTCDate() + t), Ds(d);
|
|
3563
3563
|
}
|
|
3564
|
-
const
|
|
3564
|
+
const Oi = ["and", "or"], bt = {
|
|
3565
3565
|
labels: s.string().array().optional().describe("The labels to filter the tasks by"),
|
|
3566
|
-
labelsOperator: s.enum(
|
|
3566
|
+
labelsOperator: s.enum(Oi).optional().describe(
|
|
3567
3567
|
'The operator to use when filtering by labels. This will dictate whether a task has all labels, or some of them. Default is "or".'
|
|
3568
3568
|
)
|
|
3569
3569
|
};
|
|
@@ -3572,20 +3572,20 @@ function gt(e = [], t = "or") {
|
|
|
3572
3572
|
const r = t === "and" ? " & " : " | ";
|
|
3573
3573
|
return `(${e.map((i) => i.startsWith("@") ? i : `@${i}`).join(` ${r} `)})`;
|
|
3574
3574
|
}
|
|
3575
|
-
const
|
|
3576
|
-
function
|
|
3575
|
+
const _i = 7;
|
|
3576
|
+
function Pi({
|
|
3577
3577
|
since: e,
|
|
3578
3578
|
until: t,
|
|
3579
3579
|
userGmtOffset: r,
|
|
3580
3580
|
now: o = /* @__PURE__ */ new Date()
|
|
3581
3581
|
}) {
|
|
3582
|
-
const n =
|
|
3582
|
+
const n = xi(r), i = Ei(o, n), a = _i - 1, c = t ?? (e ? Nt(e, a) : i);
|
|
3583
3583
|
return {
|
|
3584
3584
|
since: e ?? Nt(c, -a),
|
|
3585
3585
|
until: c
|
|
3586
3586
|
};
|
|
3587
3587
|
}
|
|
3588
|
-
const
|
|
3588
|
+
const Ui = {
|
|
3589
3589
|
getBy: s.enum(["completion", "due"]).default("completion").describe(
|
|
3590
3590
|
'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).'
|
|
3591
3591
|
),
|
|
@@ -3609,17 +3609,17 @@ const Pi = {
|
|
|
3609
3609
|
"The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters)."
|
|
3610
3610
|
),
|
|
3611
3611
|
...bt
|
|
3612
|
-
},
|
|
3612
|
+
}, Ri = {
|
|
3613
3613
|
tasks: s.array(K).describe("The found completed tasks."),
|
|
3614
3614
|
nextCursor: s.string().optional(),
|
|
3615
3615
|
totalCount: s.number().describe("The total number of tasks in this page."),
|
|
3616
3616
|
hasMore: s.boolean(),
|
|
3617
3617
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
3618
|
-
},
|
|
3618
|
+
}, Li = {
|
|
3619
3619
|
name: g.FIND_COMPLETED_TASKS,
|
|
3620
3620
|
description: 'Get completed tasks in a date range. For "what did I complete/get done" questions, use find-activity instead — it reports completion events, including every occurrence of a recurring task, which this tool does not. since/until are optional and default to a 7-day window when omitted. Includes all collaborators by default. Person-specific queries (summaries, plans, reports) require responsibleUser.',
|
|
3621
|
-
parameters:
|
|
3622
|
-
outputSchema:
|
|
3621
|
+
parameters: Ui,
|
|
3622
|
+
outputSchema: Ri,
|
|
3623
3623
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3624
3624
|
async execute(e, t) {
|
|
3625
3625
|
const {
|
|
@@ -3643,7 +3643,7 @@ const Pi = {
|
|
|
3643
3643
|
const w = await t.getUser(), C = w.tzInfo?.gmtString || "+00:00", D = await te({
|
|
3644
3644
|
projectId: d,
|
|
3645
3645
|
user: w
|
|
3646
|
-
}), T =
|
|
3646
|
+
}), T = Pi({
|
|
3647
3647
|
since: i,
|
|
3648
3648
|
until: a,
|
|
3649
3649
|
userGmtOffset: C
|
|
@@ -3667,7 +3667,7 @@ const Pi = {
|
|
|
3667
3667
|
...f ? { filterQuery: f, filterLang: "en" } : {}
|
|
3668
3668
|
}), E = A.map(P);
|
|
3669
3669
|
return {
|
|
3670
|
-
textContent:
|
|
3670
|
+
textContent: Ni({
|
|
3671
3671
|
tasks: E,
|
|
3672
3672
|
args: S,
|
|
3673
3673
|
nextCursor: x,
|
|
@@ -3683,7 +3683,7 @@ const Pi = {
|
|
|
3683
3683
|
};
|
|
3684
3684
|
}
|
|
3685
3685
|
};
|
|
3686
|
-
function
|
|
3686
|
+
function Ni({
|
|
3687
3687
|
tasks: e,
|
|
3688
3688
|
args: t,
|
|
3689
3689
|
nextCursor: r,
|
|
@@ -3709,7 +3709,7 @@ function Li({
|
|
|
3709
3709
|
zeroReasonHints: c
|
|
3710
3710
|
});
|
|
3711
3711
|
}
|
|
3712
|
-
const
|
|
3712
|
+
const Mi = {
|
|
3713
3713
|
searchText: s.string().optional().describe(
|
|
3714
3714
|
'Search for a label by name (partial and case insensitive match). Supports wildcards (e.g. "work*" for prefix match). Use "\\*" for a literal asterisk. If omitted, all labels are returned.'
|
|
3715
3715
|
),
|
|
@@ -3717,7 +3717,7 @@ const Ni = {
|
|
|
3717
3717
|
cursor: s.string().optional().describe(
|
|
3718
3718
|
"The cursor to get the next page of labels (cursor is obtained from the previous call to this tool, with the same parameters). Ignored when searchText is provided."
|
|
3719
3719
|
)
|
|
3720
|
-
},
|
|
3720
|
+
}, Fi = {
|
|
3721
3721
|
labels: s.array(ge).describe("The found personal labels."),
|
|
3722
3722
|
nextCursor: s.string().optional(),
|
|
3723
3723
|
totalCount: s.number().describe("The total number of labels in this page."),
|
|
@@ -3726,22 +3726,22 @@ const Ni = {
|
|
|
3726
3726
|
"Names of all shared labels visible to you. These have no IDs or metadata — use their names directly when filtering tasks."
|
|
3727
3727
|
),
|
|
3728
3728
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
3729
|
-
},
|
|
3729
|
+
}, Hi = {
|
|
3730
3730
|
name: g.FIND_LABELS,
|
|
3731
3731
|
description: "List personal labels and shared labels. Personal labels have full metadata (id, name, color, order, isFavorite) and support pagination and name search (partial, case insensitive). Shared labels are labels used on tasks shared with you — they are returned as names only (no IDs or metadata). When searching, all matching personal labels are fetched across all pages and returned as a single result set (limit and cursor are ignored). When not searching, personal labels are returned with pagination.",
|
|
3732
|
-
parameters:
|
|
3733
|
-
outputSchema:
|
|
3732
|
+
parameters: Mi,
|
|
3733
|
+
outputSchema: Fi,
|
|
3734
3734
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3735
3735
|
async execute(e, t) {
|
|
3736
3736
|
const [r, o] = await Promise.all([
|
|
3737
|
-
e.searchText ?
|
|
3737
|
+
e.searchText ? Uo(t, e.searchText).then((c) => ({
|
|
3738
3738
|
results: c,
|
|
3739
3739
|
nextCursor: null
|
|
3740
3740
|
})) : t.getLabels({ limit: e.limit, cursor: e.cursor ?? null }),
|
|
3741
|
-
|
|
3741
|
+
Ro(t)
|
|
3742
3742
|
]), { results: n, nextCursor: i } = r, a = e.searchText ? { searchText: e.searchText } : { limit: e.limit, cursor: e.cursor };
|
|
3743
3743
|
return {
|
|
3744
|
-
textContent:
|
|
3744
|
+
textContent: Wi({ labels: n, args: e, nextCursor: i, sharedLabels: o }),
|
|
3745
3745
|
structuredContent: {
|
|
3746
3746
|
labels: n.map((c) => ge.parse(c)),
|
|
3747
3747
|
nextCursor: i ?? void 0,
|
|
@@ -3753,7 +3753,7 @@ const Ni = {
|
|
|
3753
3753
|
};
|
|
3754
3754
|
}
|
|
3755
3755
|
};
|
|
3756
|
-
function
|
|
3756
|
+
function Wi({
|
|
3757
3757
|
labels: e,
|
|
3758
3758
|
args: t,
|
|
3759
3759
|
nextCursor: r,
|
|
@@ -3761,7 +3761,7 @@ function Hi({
|
|
|
3761
3761
|
}) {
|
|
3762
3762
|
const n = t.searchText ? `All labels matching "${t.searchText}"` : "Labels", i = [];
|
|
3763
3763
|
t.searchText && i.push(`searchText: "${t.searchText}"`);
|
|
3764
|
-
const a = 10, d = e.slice(0, a).map(
|
|
3764
|
+
const a = 10, d = e.slice(0, a).map(gn).join(`
|
|
3765
3765
|
`), u = e.length - a, l = u > 0 ? `${d}
|
|
3766
3766
|
…and ${u} more` : d, p = [];
|
|
3767
3767
|
e.length === 0 && (t.searchText ? (p.push("Try broader search terms"), p.push("Check spelling"), p.push("Remove searchText to see all labels")) : p.push("No personal labels created yet"));
|
|
@@ -3778,15 +3778,15 @@ No shared labels.`;
|
|
|
3778
3778
|
zeroReasonHints: p
|
|
3779
3779
|
}) + h;
|
|
3780
3780
|
}
|
|
3781
|
-
const { FIND_PROJECTS:
|
|
3781
|
+
const { FIND_PROJECTS: xs, ADD_TASKS: Es, UPDATE_TASKS: Os } = g, Bi = {
|
|
3782
3782
|
projectId: s.string().min(1).optional().describe(
|
|
3783
3783
|
'Optional. If provided, searches only collaborators of this project. If omitted, searches across the collaborators of all shared projects the authenticated user can access (plus the authenticated user themselves) — use this for general "find a user" / "who is X" lookups.'
|
|
3784
3784
|
),
|
|
3785
3785
|
searchTerm: s.string().optional().describe(
|
|
3786
3786
|
"Search for a user by name or email (partial and case insensitive match). If omitted, all users are returned."
|
|
3787
3787
|
)
|
|
3788
|
-
},
|
|
3789
|
-
collaborators: s.array(
|
|
3788
|
+
}, zi = {
|
|
3789
|
+
collaborators: s.array(Yo).describe("The found users."),
|
|
3790
3790
|
projectInfo: s.object({
|
|
3791
3791
|
id: s.string().describe("The project ID."),
|
|
3792
3792
|
name: s.string().describe("The project name."),
|
|
@@ -3795,16 +3795,16 @@ const { FIND_PROJECTS: Ds, ADD_TASKS: xs, UPDATE_TASKS: Es } = g, Wi = {
|
|
|
3795
3795
|
totalCount: s.number().describe("The total number of users found."),
|
|
3796
3796
|
totalAvailable: s.number().optional().describe("The total number of available users before the search filter was applied."),
|
|
3797
3797
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
3798
|
-
},
|
|
3798
|
+
}, Ki = {
|
|
3799
3799
|
name: g.FIND_PROJECT_COLLABORATORS,
|
|
3800
3800
|
description: `Find Todoist users (collaborators, teammates) by name or email to look up their user ID. Use this whenever the user asks to find, look up, or identify a person — e.g. "find Carrie's user ID", "who is Ernesto", "look up a user". When projectId is omitted, searches across the collaborators of every shared project the authenticated user has access to, plus the authenticated user themselves — an empty result means the person is not a collaborator on any project you share with them, not necessarily that they do not exist in Todoist. When projectId is provided, searches only that project. Partial, case-insensitive match on name and email.`,
|
|
3801
|
-
parameters:
|
|
3802
|
-
outputSchema:
|
|
3801
|
+
parameters: Bi,
|
|
3802
|
+
outputSchema: zi,
|
|
3803
3803
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3804
3804
|
async execute(e, t) {
|
|
3805
3805
|
const { projectId: r, searchTerm: o } = e;
|
|
3806
3806
|
if (!r)
|
|
3807
|
-
return
|
|
3807
|
+
return qi({ searchTerm: o, client: t, appliedFilters: e });
|
|
3808
3808
|
let n = r, i;
|
|
3809
3809
|
try {
|
|
3810
3810
|
if (i = await t.getProject(r), !i)
|
|
@@ -3815,7 +3815,7 @@ const { FIND_PROJECTS: Ds, ADD_TASKS: xs, UPDATE_TASKS: Es } = g, Wi = {
|
|
|
3815
3815
|
|
|
3816
3816
|
**Next steps:**
|
|
3817
3817
|
• Share the project to enable collaboration
|
|
3818
|
-
• Use ${
|
|
3818
|
+
• Use ${Es} and ${Os} for assignment features once shared`,
|
|
3819
3819
|
structuredContent: {
|
|
3820
3820
|
collaborators: [],
|
|
3821
3821
|
projectInfo: {
|
|
@@ -3852,9 +3852,9 @@ const { FIND_PROJECTS: Ds, ADD_TASKS: xs, UPDATE_TASKS: Es } = g, Wi = {
|
|
|
3852
3852
|
appliedFilters: e
|
|
3853
3853
|
}
|
|
3854
3854
|
};
|
|
3855
|
-
const c =
|
|
3855
|
+
const c = _s(a, o);
|
|
3856
3856
|
return {
|
|
3857
|
-
textContent:
|
|
3857
|
+
textContent: Ps({
|
|
3858
3858
|
collaborators: c,
|
|
3859
3859
|
projectName: n,
|
|
3860
3860
|
searchTerm: o,
|
|
@@ -3874,18 +3874,18 @@ const { FIND_PROJECTS: Ds, ADD_TASKS: xs, UPDATE_TASKS: Es } = g, Wi = {
|
|
|
3874
3874
|
};
|
|
3875
3875
|
}
|
|
3876
3876
|
};
|
|
3877
|
-
async function
|
|
3877
|
+
async function qi({
|
|
3878
3878
|
searchTerm: e,
|
|
3879
3879
|
client: t,
|
|
3880
3880
|
appliedFilters: r
|
|
3881
3881
|
}) {
|
|
3882
|
-
const o = await H.getAllCollaborators(t), n = await
|
|
3882
|
+
const o = await H.getAllCollaborators(t), n = await Yi(t, o);
|
|
3883
3883
|
if (n.length === 0)
|
|
3884
3884
|
return {
|
|
3885
3885
|
textContent: `No users found. You may have no shared projects, or collaborator data is not accessible.
|
|
3886
3886
|
|
|
3887
3887
|
**Next steps:**
|
|
3888
|
-
• Use ${
|
|
3888
|
+
• Use ${xs} to find shared projects
|
|
3889
3889
|
• Share a project to add collaborators
|
|
3890
3890
|
• Ensure you have permission to view collaborators`,
|
|
3891
3891
|
structuredContent: {
|
|
@@ -3896,9 +3896,9 @@ async function Ki({
|
|
|
3896
3896
|
appliedFilters: r
|
|
3897
3897
|
}
|
|
3898
3898
|
};
|
|
3899
|
-
const i =
|
|
3899
|
+
const i = _s(n, e);
|
|
3900
3900
|
return {
|
|
3901
|
-
textContent:
|
|
3901
|
+
textContent: Ps({
|
|
3902
3902
|
collaborators: i,
|
|
3903
3903
|
projectName: void 0,
|
|
3904
3904
|
searchTerm: e,
|
|
@@ -3913,7 +3913,7 @@ async function Ki({
|
|
|
3913
3913
|
}
|
|
3914
3914
|
};
|
|
3915
3915
|
}
|
|
3916
|
-
async function
|
|
3916
|
+
async function Yi(e, t) {
|
|
3917
3917
|
try {
|
|
3918
3918
|
const r = await e.getUser();
|
|
3919
3919
|
return !r || t.some((o) => o.id === r.id) ? t : [
|
|
@@ -3924,7 +3924,7 @@ async function qi(e, t) {
|
|
|
3924
3924
|
return t;
|
|
3925
3925
|
}
|
|
3926
3926
|
}
|
|
3927
|
-
function
|
|
3927
|
+
function _s(e, t) {
|
|
3928
3928
|
if (!t)
|
|
3929
3929
|
return e;
|
|
3930
3930
|
const r = t.toLowerCase().trim();
|
|
@@ -3932,7 +3932,7 @@ function Os(e, t) {
|
|
|
3932
3932
|
(o) => o.name.toLowerCase().includes(r) || o.email.toLowerCase().includes(r)
|
|
3933
3933
|
);
|
|
3934
3934
|
}
|
|
3935
|
-
function
|
|
3935
|
+
function Ps({
|
|
3936
3936
|
collaborators: e,
|
|
3937
3937
|
projectName: t,
|
|
3938
3938
|
searchTerm: r,
|
|
@@ -3948,7 +3948,7 @@ function _s({
|
|
|
3948
3948
|
const u = [];
|
|
3949
3949
|
e.length === 0 && r && (u.push(`No users match "${r}"`), u.push("Try a broader search term or check spelling"), o > 0 && u.push(`${o} users available without filter`));
|
|
3950
3950
|
const l = [];
|
|
3951
|
-
return e.length > 0 ? (l.push(`Use ${
|
|
3951
|
+
return e.length > 0 ? (l.push(`Use ${Es} with responsibleUser to assign new tasks`), l.push(`Use ${Os} with responsibleUser to reassign existing tasks`), l.push("Use user names, emails, or IDs for assignments")) : (l.push(`Use ${xs} to find other projects`), r && o > 0 && l.push("Try searching without filters to see all users")), V({
|
|
3952
3952
|
subject: a,
|
|
3953
3953
|
count: e.length,
|
|
3954
3954
|
filterHints: c,
|
|
@@ -3958,11 +3958,11 @@ function _s({
|
|
|
3958
3958
|
nextSteps: l
|
|
3959
3959
|
});
|
|
3960
3960
|
}
|
|
3961
|
-
const { ADD_PROJECTS: Mt } = g,
|
|
3961
|
+
const { ADD_PROJECTS: Mt } = g, Gi = {
|
|
3962
3962
|
active: "projects",
|
|
3963
3963
|
archived: "archived projects",
|
|
3964
3964
|
all: "projects (active and archived)"
|
|
3965
|
-
},
|
|
3965
|
+
}, Vi = {
|
|
3966
3966
|
searchText: s.string().optional().describe(
|
|
3967
3967
|
'Search for a project by name (partial and case insensitive match). Supports wildcards (e.g. "work*" for prefix match). Use "\\*" for a literal asterisk. If omitted, all projects are returned.'
|
|
3968
3968
|
),
|
|
@@ -3973,26 +3973,26 @@ const { ADD_PROJECTS: Mt } = g, Yi = {
|
|
|
3973
3973
|
archivedStatus: s.enum(["active", "archived", "all"]).optional().describe(
|
|
3974
3974
|
"Which projects to return by archive status: 'active' (default, non-archived only), 'archived' (archived only), or 'all' (both active and archived). Each project includes an isArchived field. Archived projects can be deleted via the delete-object tool (type: 'project')."
|
|
3975
3975
|
)
|
|
3976
|
-
},
|
|
3976
|
+
}, Ji = {
|
|
3977
3977
|
projects: s.array(re).describe("The found projects."),
|
|
3978
3978
|
nextCursor: s.string().optional(),
|
|
3979
3979
|
totalCount: s.number().describe("The total number of projects in this page."),
|
|
3980
3980
|
hasMore: s.boolean(),
|
|
3981
3981
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
3982
|
-
},
|
|
3982
|
+
}, Xi = {
|
|
3983
3983
|
name: g.FIND_PROJECTS,
|
|
3984
3984
|
description: "List all projects or search for projects by name. By default only active projects are returned; use archivedStatus ('archived' or 'all') to include archived projects. When searching or when archivedStatus is 'all', all matching projects are returned (pagination is ignored). Otherwise projects are returned with pagination.",
|
|
3985
|
-
parameters:
|
|
3986
|
-
outputSchema:
|
|
3985
|
+
parameters: Vi,
|
|
3986
|
+
outputSchema: Ji,
|
|
3987
3987
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3988
3988
|
async execute(e, t) {
|
|
3989
3989
|
const { searchText: r } = e, o = e.archivedStatus ?? "active";
|
|
3990
3990
|
let n, i = null;
|
|
3991
3991
|
if (r || o === "all") {
|
|
3992
3992
|
const c = Promise.resolve([]), [d, u] = await Promise.all([
|
|
3993
|
-
o === "archived" ? c : r ?
|
|
3994
|
-
o === "active" ? c :
|
|
3995
|
-
]), l = r ?
|
|
3993
|
+
o === "archived" ? c : r ? gs(t, r) : ys(t),
|
|
3994
|
+
o === "active" ? c : _o(t)
|
|
3995
|
+
]), l = r ? Po(r) : null, p = l ? u.filter((h) => l.test(h.name)) : u;
|
|
3996
3996
|
n = [...d, ...p];
|
|
3997
3997
|
} else {
|
|
3998
3998
|
const c = o === "archived" ? await t.getArchivedProjects({
|
|
@@ -4003,7 +4003,7 @@ const { ADD_PROJECTS: Mt } = g, Yi = {
|
|
|
4003
4003
|
}
|
|
4004
4004
|
const a = n.map(se);
|
|
4005
4005
|
return {
|
|
4006
|
-
textContent:
|
|
4006
|
+
textContent: Qi({ projects: a, args: e, nextCursor: i }),
|
|
4007
4007
|
structuredContent: {
|
|
4008
4008
|
projects: a,
|
|
4009
4009
|
nextCursor: i ?? void 0,
|
|
@@ -4014,14 +4014,14 @@ const { ADD_PROJECTS: Mt } = g, Yi = {
|
|
|
4014
4014
|
};
|
|
4015
4015
|
}
|
|
4016
4016
|
};
|
|
4017
|
-
function
|
|
4017
|
+
function Qi({
|
|
4018
4018
|
projects: e,
|
|
4019
4019
|
args: t,
|
|
4020
4020
|
nextCursor: r
|
|
4021
4021
|
}) {
|
|
4022
|
-
const o =
|
|
4022
|
+
const o = Gi[t.archivedStatus ?? "active"], n = t.searchText ? `All ${o} matching "${t.searchText}"` : `${o.charAt(0).toUpperCase()}${o.slice(1)}`, i = [];
|
|
4023
4023
|
t.searchText && i.push(`searchText: "${t.searchText}"`), t.archivedStatus && t.archivedStatus !== "active" && i.push(`archivedStatus: "${t.archivedStatus}"`);
|
|
4024
|
-
const a = 10, d = e.slice(0, a).map(
|
|
4024
|
+
const a = 10, d = e.slice(0, a).map(yn).join(`
|
|
4025
4025
|
`), u = e.length - a, l = u > 0 ? `${d}
|
|
4026
4026
|
…and ${u} more` : d, p = [];
|
|
4027
4027
|
return e.length === 0 && (t.searchText ? (p.push("Try broader search terms"), p.push("Check spelling"), p.push("Remove searchText to see all projects")) : t.archivedStatus === "archived" ? (p.push("No archived projects"), p.push("Use archivedStatus: 'all' to also see active projects")) : t.archivedStatus === "all" ? (p.push("No projects created yet"), p.push(`Use ${Mt} to create a project`)) : (p.push("No active projects"), p.push("Use archivedStatus: 'all' to include archived projects"), p.push(`Use ${Mt} to create a project`))), V({
|
|
@@ -4034,22 +4034,22 @@ function Xi({
|
|
|
4034
4034
|
zeroReasonHints: p
|
|
4035
4035
|
});
|
|
4036
4036
|
}
|
|
4037
|
-
const
|
|
4037
|
+
const Zi = {
|
|
4038
4038
|
taskId: s.string().optional().describe(
|
|
4039
4039
|
"Find all reminders for a specific task. Returns both time-based and location reminders."
|
|
4040
4040
|
),
|
|
4041
4041
|
reminderId: s.string().optional().describe("Get a specific time-based reminder (relative or absolute) by its ID."),
|
|
4042
4042
|
locationReminderId: s.string().optional().describe("Get a specific location reminder by its ID.")
|
|
4043
|
-
},
|
|
4043
|
+
}, ea = {
|
|
4044
4044
|
reminders: s.array(lt).describe("The found reminders (time-based and location)."),
|
|
4045
4045
|
searchType: s.string().describe('The search type used: "task", "reminder", or "location_reminder".'),
|
|
4046
4046
|
searchId: s.string().describe("The ID used for the search."),
|
|
4047
4047
|
totalCount: s.number().describe("Total reminders in this response.")
|
|
4048
|
-
},
|
|
4048
|
+
}, ta = {
|
|
4049
4049
|
name: g.FIND_REMINDERS,
|
|
4050
4050
|
description: "Find reminders by task ID (returns all reminder types), or get a specific reminder by its ID. Use reminderId for time-based reminders and locationReminderId for location reminders.",
|
|
4051
|
-
parameters:
|
|
4052
|
-
outputSchema:
|
|
4051
|
+
parameters: Zi,
|
|
4052
|
+
outputSchema: ea,
|
|
4053
4053
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4054
4054
|
async execute(e, t) {
|
|
4055
4055
|
const { taskId: r, reminderId: o, locationReminderId: n } = e, i = [r, o, n].filter(Boolean);
|
|
@@ -4095,7 +4095,7 @@ const Qi = {
|
|
|
4095
4095
|
})
|
|
4096
4096
|
]), u = [...a, ...c].map(ke);
|
|
4097
4097
|
return {
|
|
4098
|
-
textContent:
|
|
4098
|
+
textContent: sa(u, r),
|
|
4099
4099
|
structuredContent: {
|
|
4100
4100
|
reminders: u,
|
|
4101
4101
|
searchType: "task",
|
|
@@ -4107,10 +4107,10 @@ const Qi = {
|
|
|
4107
4107
|
throw new Error("One of taskId, reminderId, or locationReminderId must be provided.");
|
|
4108
4108
|
}
|
|
4109
4109
|
};
|
|
4110
|
-
function
|
|
4110
|
+
function sa(e, t) {
|
|
4111
4111
|
if (e.length === 0)
|
|
4112
4112
|
return `No reminders found for task ${t}`;
|
|
4113
|
-
const { timeBasedCount: r, locationCount: o } =
|
|
4113
|
+
const { timeBasedCount: r, locationCount: o } = Ts(e), n = [];
|
|
4114
4114
|
if (r > 0) {
|
|
4115
4115
|
const i = r > 1 ? "time-based reminders" : "time-based reminder";
|
|
4116
4116
|
n.push(`${r} ${i}`);
|
|
@@ -4121,22 +4121,22 @@ function ta(e, t) {
|
|
|
4121
4121
|
}
|
|
4122
4122
|
return `Found ${n.join(" and ")} for task ${t}`;
|
|
4123
4123
|
}
|
|
4124
|
-
const { ADD_SECTIONS:
|
|
4124
|
+
const { ADD_SECTIONS: ra } = g, oa = {
|
|
4125
4125
|
projectId: s.string().min(1).describe(
|
|
4126
4126
|
'The ID of the project to search sections in. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
4127
4127
|
),
|
|
4128
4128
|
searchText: s.string().optional().describe(
|
|
4129
4129
|
'Search for a section by name (partial and case insensitive match). Supports wildcards (e.g. "work*" for prefix match). Use "\\*" for a literal asterisk. If omitted, all sections in the project are returned.'
|
|
4130
4130
|
)
|
|
4131
|
-
},
|
|
4131
|
+
}, na = {
|
|
4132
4132
|
sections: s.array(Y).describe("The found sections."),
|
|
4133
4133
|
totalCount: s.number().describe("The total number of sections found."),
|
|
4134
4134
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
4135
|
-
},
|
|
4135
|
+
}, ia = {
|
|
4136
4136
|
name: g.FIND_SECTIONS,
|
|
4137
4137
|
description: "Search for sections by name or other criteria in a project. When searching, uses server-side search to avoid fetching all sections.",
|
|
4138
|
-
parameters:
|
|
4139
|
-
outputSchema:
|
|
4138
|
+
parameters: oa,
|
|
4139
|
+
outputSchema: na,
|
|
4140
4140
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4141
4141
|
async execute(e, t) {
|
|
4142
4142
|
const r = await te({
|
|
@@ -4144,12 +4144,12 @@ const { ADD_SECTIONS: sa } = g, ra = {
|
|
|
4144
4144
|
client: t
|
|
4145
4145
|
});
|
|
4146
4146
|
let o;
|
|
4147
|
-
e.searchText ? o = await
|
|
4147
|
+
e.searchText ? o = await Lo(t, e.searchText, r) : o = (await t.getSections({
|
|
4148
4148
|
projectId: r
|
|
4149
4149
|
})).results;
|
|
4150
4150
|
const n = o.map(G);
|
|
4151
4151
|
return {
|
|
4152
|
-
textContent:
|
|
4152
|
+
textContent: aa({
|
|
4153
4153
|
sections: n,
|
|
4154
4154
|
projectId: e.projectId,
|
|
4155
4155
|
searchText: e.searchText
|
|
@@ -4162,13 +4162,13 @@ const { ADD_SECTIONS: sa } = g, ra = {
|
|
|
4162
4162
|
};
|
|
4163
4163
|
}
|
|
4164
4164
|
};
|
|
4165
|
-
function
|
|
4165
|
+
function aa({
|
|
4166
4166
|
sections: e,
|
|
4167
4167
|
projectId: t,
|
|
4168
4168
|
searchText: r
|
|
4169
4169
|
}) {
|
|
4170
4170
|
const o = [];
|
|
4171
|
-
r ? (o.push("Try broader search terms"), o.push("Check spelling"), o.push("Remove searchText to see all sections")) : (o.push("Project has no sections yet"), o.push(`Use ${
|
|
4171
|
+
r ? (o.push("Try broader search terms"), o.push("Check spelling"), o.push("Remove searchText to see all sections")) : (o.push("Project has no sections yet"), o.push(`Use ${ra} to create sections`));
|
|
4172
4172
|
const n = r ? `Sections in project ${t} matching "${r}"` : `Sections in project ${t}`, i = e.length > 0 ? e.map((a) => ` ${a.name} • id=${a.id}`).join(`
|
|
4173
4173
|
`) : void 0;
|
|
4174
4174
|
return V({
|
|
@@ -4178,10 +4178,10 @@ function ia({
|
|
|
4178
4178
|
zeroReasonHints: o
|
|
4179
4179
|
});
|
|
4180
4180
|
}
|
|
4181
|
-
function
|
|
4181
|
+
function Us(e) {
|
|
4182
4182
|
return /* @__PURE__ */ new Date(`${e}T00:00:00`);
|
|
4183
4183
|
}
|
|
4184
|
-
const
|
|
4184
|
+
const ca = {
|
|
4185
4185
|
startDate: s.string().regex(/^(\d{4}-\d{2}-\d{2}|today)$/).optional().describe(
|
|
4186
4186
|
"The start date to get the tasks for. Format: YYYY-MM-DD, or 'today', which by default also includes overdue tasks."
|
|
4187
4187
|
),
|
|
@@ -4198,21 +4198,21 @@ const aa = {
|
|
|
4198
4198
|
responsibleUser: s.string().optional().describe(
|
|
4199
4199
|
"Filter tasks assigned to this user. User ID, name, or email. The current user also includes unassigned tasks."
|
|
4200
4200
|
),
|
|
4201
|
-
responsibleUserFiltering: s.enum(
|
|
4201
|
+
responsibleUserFiltering: s.enum(bs).optional().describe(
|
|
4202
4202
|
"Filter when responsibleUser is omitted. 'assigned'=assigned to others; 'unassignedOrMe'=unassigned+mine; 'all'=everyone. Default: 'unassignedOrMe'."
|
|
4203
4203
|
),
|
|
4204
4204
|
...bt
|
|
4205
|
-
},
|
|
4205
|
+
}, da = {
|
|
4206
4206
|
tasks: s.array(K).describe("The found tasks."),
|
|
4207
4207
|
nextCursor: s.string().optional(),
|
|
4208
4208
|
totalCount: s.number().describe("The total number of tasks in this page."),
|
|
4209
4209
|
hasMore: s.boolean(),
|
|
4210
4210
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
4211
|
-
},
|
|
4211
|
+
}, la = {
|
|
4212
4212
|
name: g.FIND_TASKS_BY_DATE,
|
|
4213
4213
|
description: "Get tasks by date range. startDate='today' includes overdue items. Default responsibleUserFiltering='unassignedOrMe' excludes others' tasks.",
|
|
4214
|
-
parameters:
|
|
4215
|
-
outputSchema:
|
|
4214
|
+
parameters: ca,
|
|
4215
|
+
outputSchema: da,
|
|
4216
4216
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4217
4217
|
async execute(e, t) {
|
|
4218
4218
|
const r = Ae(e.cursor);
|
|
@@ -4220,7 +4220,7 @@ const aa = {
|
|
|
4220
4220
|
throw new Error(
|
|
4221
4221
|
"Either startDate must be provided or overdueOption must be set to overdue-only"
|
|
4222
4222
|
);
|
|
4223
|
-
const o = await at(t, e.responsibleUser), n = o?.userId, i = o?.email, c = e.responsibleUser?.trim().toLowerCase() ===
|
|
4223
|
+
const o = await at(t, e.responsibleUser), n = o?.userId, i = o?.email, c = e.responsibleUser?.trim().toLowerCase() === fs ? n : n ? (await t.getUser()).id : void 0;
|
|
4224
4224
|
let d = "";
|
|
4225
4225
|
if (e.overdueOption === "overdue-only")
|
|
4226
4226
|
d = "overdue";
|
|
@@ -4231,7 +4231,7 @@ const aa = {
|
|
|
4231
4231
|
} else
|
|
4232
4232
|
d = e.overdueOption === "exclude-overdue" ? "today" : "(today | overdue)";
|
|
4233
4233
|
else if (e.startDate) {
|
|
4234
|
-
const y = e.startDate, f = We(
|
|
4234
|
+
const y = e.startDate, f = We(Us(y), e.daysCount), w = yt(f, { representation: "date" });
|
|
4235
4235
|
d = `(due after: ${y} | due: ${y}) & due before: ${w}`;
|
|
4236
4236
|
}
|
|
4237
4237
|
const u = gt(e.labels, e.labelsOperator);
|
|
@@ -4250,7 +4250,7 @@ const aa = {
|
|
|
4250
4250
|
limit: e.limit
|
|
4251
4251
|
});
|
|
4252
4252
|
return {
|
|
4253
|
-
textContent:
|
|
4253
|
+
textContent: ua({ tasks: p, args: e, nextCursor: h, assigneeEmail: i }),
|
|
4254
4254
|
structuredContent: {
|
|
4255
4255
|
tasks: p,
|
|
4256
4256
|
nextCursor: h ?? void 0,
|
|
@@ -4261,7 +4261,7 @@ const aa = {
|
|
|
4261
4261
|
};
|
|
4262
4262
|
}
|
|
4263
4263
|
};
|
|
4264
|
-
function
|
|
4264
|
+
function ua({
|
|
4265
4265
|
tasks: e,
|
|
4266
4266
|
args: t,
|
|
4267
4267
|
nextCursor: r,
|
|
@@ -4276,7 +4276,7 @@ function la({
|
|
|
4276
4276
|
`today${c}${t.daysCount > 1 ? ` + ${t.daysCount - 1} more days` : ""}`
|
|
4277
4277
|
);
|
|
4278
4278
|
} else if (t.startDate) {
|
|
4279
|
-
const c = t.daysCount > 1 ? ` to ${he(We(
|
|
4279
|
+
const c = t.daysCount > 1 ? ` to ${he(We(Us(t.startDate), t.daysCount))}` : "";
|
|
4280
4280
|
n.push(`${t.startDate}${c}`);
|
|
4281
4281
|
}
|
|
4282
4282
|
if (t.labels && t.labels.length > 0) {
|
|
@@ -4311,13 +4311,13 @@ function la({
|
|
|
4311
4311
|
zeroReasonHints: a
|
|
4312
4312
|
});
|
|
4313
4313
|
}
|
|
4314
|
-
const
|
|
4315
|
-
class
|
|
4314
|
+
const pa = 300 * 1e3;
|
|
4315
|
+
class ha {
|
|
4316
4316
|
constructor() {
|
|
4317
4317
|
this.cache = null;
|
|
4318
4318
|
}
|
|
4319
4319
|
async getFilters(t) {
|
|
4320
|
-
if (this.cache && Date.now() - this.cache.timestamp <
|
|
4320
|
+
if (this.cache && Date.now() - this.cache.timestamp < pa)
|
|
4321
4321
|
return this.cache.filters;
|
|
4322
4322
|
const o = ((await t.sync({
|
|
4323
4323
|
resourceTypes: ["filters"],
|
|
@@ -4374,7 +4374,7 @@ ${l}` + (d.length > 5 ? `
|
|
|
4374
4374
|
this.cache = null;
|
|
4375
4375
|
}
|
|
4376
4376
|
}
|
|
4377
|
-
const
|
|
4377
|
+
const ma = new ha(), { FIND_COMPLETED_TASKS: Ft, ADD_TASKS: Ht } = g, fa = {
|
|
4378
4378
|
searchText: s.string().optional().describe("The text to search for in tasks."),
|
|
4379
4379
|
projectId: s.string().optional().describe(
|
|
4380
4380
|
'Find tasks in this project. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
@@ -4384,7 +4384,7 @@ const ha = new pa(), { FIND_COMPLETED_TASKS: Ft, ADD_TASKS: Ht } = g, ma = {
|
|
|
4384
4384
|
responsibleUser: s.string().optional().describe(
|
|
4385
4385
|
"Find tasks assigned to this user. Can be a user ID, name, or email address. The current user also includes unassigned tasks."
|
|
4386
4386
|
),
|
|
4387
|
-
responsibleUserFiltering: s.enum(
|
|
4387
|
+
responsibleUserFiltering: s.enum(bs).optional().describe(
|
|
4388
4388
|
'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`.'
|
|
4389
4389
|
),
|
|
4390
4390
|
limit: s.number().int().min(1).max(j.TASKS_MAX).default(j.TASKS_DEFAULT).describe("The maximum number of tasks to return."),
|
|
@@ -4398,17 +4398,17 @@ const ha = new pa(), { FIND_COMPLETED_TASKS: Ft, ADD_TASKS: Ht } = g, ma = {
|
|
|
4398
4398
|
"The ID or name of a saved Todoist filter. The filter's query will be fetched and used to find tasks. Cannot be used with the `filter` parameter, projectId, sectionId, or parentId."
|
|
4399
4399
|
),
|
|
4400
4400
|
...bt
|
|
4401
|
-
},
|
|
4401
|
+
}, ba = {
|
|
4402
4402
|
tasks: s.array(K).describe("The found tasks."),
|
|
4403
4403
|
nextCursor: s.string().optional(),
|
|
4404
4404
|
totalCount: s.number().describe("The total number of tasks in this page."),
|
|
4405
4405
|
hasMore: s.boolean(),
|
|
4406
4406
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
4407
|
-
},
|
|
4407
|
+
}, ga = {
|
|
4408
4408
|
name: g.FIND_TASKS,
|
|
4409
4409
|
description: "Find tasks by text search, project/section/parent container, responsible user, labels, a raw Todoist filter string, or a saved filter by ID or name (filterIdOrName). At least one filter must be provided.",
|
|
4410
|
-
parameters:
|
|
4411
|
-
outputSchema:
|
|
4410
|
+
parameters: fa,
|
|
4411
|
+
outputSchema: ba,
|
|
4412
4412
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4413
4413
|
async execute(e, t) {
|
|
4414
4414
|
const {
|
|
@@ -4438,7 +4438,7 @@ const ha = new pa(), { FIND_COMPLETED_TASKS: Ft, ADD_TASKS: Ht } = g, ma = {
|
|
|
4438
4438
|
'The `filter`/`filterIdOrName` parameter cannot be combined with projectId, sectionId, or parentId. Use filter syntax instead (e.g. "##ProjectName").'
|
|
4439
4439
|
);
|
|
4440
4440
|
let C = h;
|
|
4441
|
-
m && (C = (await
|
|
4441
|
+
m && (C = (await ma.resolveFilter(t, m)).filterQuery);
|
|
4442
4442
|
const D = await at(t, a), T = D?.userId, I = D?.email;
|
|
4443
4443
|
if (o || n || i) {
|
|
4444
4444
|
const E = {
|
|
@@ -4450,7 +4450,7 @@ const ha = new pa(), { FIND_COMPLETED_TASKS: Ft, ADD_TASKS: Ht } = g, ma = {
|
|
|
4450
4450
|
let M = r ? ie.filter(
|
|
4451
4451
|
(ae) => ae.content.toLowerCase().includes(r.toLowerCase()) || ae.description?.toLowerCase().includes(r.toLowerCase())
|
|
4452
4452
|
) : ie;
|
|
4453
|
-
return M =
|
|
4453
|
+
return M = Oo({
|
|
4454
4454
|
tasks: M,
|
|
4455
4455
|
resolvedAssigneeId: T,
|
|
4456
4456
|
currentUserId: f.id,
|
|
@@ -4506,7 +4506,7 @@ const ha = new pa(), { FIND_COMPLETED_TASKS: Ft, ADD_TASKS: Ht } = g, ma = {
|
|
|
4506
4506
|
};
|
|
4507
4507
|
}
|
|
4508
4508
|
let $ = C ? `(${C})` : "";
|
|
4509
|
-
r && ($ = me($, `search: ${r}`));
|
|
4509
|
+
r && ($ = me($, `search: ${Zt(r)}`));
|
|
4510
4510
|
const k = gt(l, p);
|
|
4511
4511
|
if ($ = me($, k), !(m && !a && !c)) {
|
|
4512
4512
|
const E = Qe({
|
|
@@ -4541,7 +4541,7 @@ const ha = new pa(), { FIND_COMPLETED_TASKS: Ft, ADD_TASKS: Ht } = g, ma = {
|
|
|
4541
4541
|
};
|
|
4542
4542
|
}
|
|
4543
4543
|
};
|
|
4544
|
-
function
|
|
4544
|
+
function ya(e) {
|
|
4545
4545
|
if (e.projectId) {
|
|
4546
4546
|
const t = [
|
|
4547
4547
|
e.searchText ? "No tasks in project match search" : "Project has no tasks yet"
|
|
@@ -4576,7 +4576,7 @@ function Re({
|
|
|
4576
4576
|
const d = t.labels.map((u) => `@${u}`).join(t.labelsOperator === "and" ? " & " : " | ");
|
|
4577
4577
|
a.push(`labels: ${d}`);
|
|
4578
4578
|
}
|
|
4579
|
-
e.length === 0 && c.push(...
|
|
4579
|
+
e.length === 0 && c.push(...ya(t));
|
|
4580
4580
|
} else {
|
|
4581
4581
|
const d = n || t.responsibleUser, u = [];
|
|
4582
4582
|
if (t.filter && u.push(`filter: ${t.filter}`), t.searchText && u.push(`"${t.searchText}"`), t.responsibleUser && u.push(`assigned to ${d}`), t.labels && t.labels.length > 0) {
|
|
@@ -4605,11 +4605,11 @@ function Re({
|
|
|
4605
4605
|
zeroReasonHints: c
|
|
4606
4606
|
});
|
|
4607
4607
|
}
|
|
4608
|
-
const
|
|
4608
|
+
const Ta = {
|
|
4609
4609
|
projectId: s.string().min(1).optional().describe(
|
|
4610
4610
|
`Optional project ID. Use "inbox" for the Inbox. If provided, returns that project's tasks grouped by section. If omitted, returns the project and section structure for the whole account with no tasks.`
|
|
4611
4611
|
)
|
|
4612
|
-
},
|
|
4612
|
+
}, Rs = s.lazy(
|
|
4613
4613
|
() => s.object({
|
|
4614
4614
|
id: s.string().describe("The project ID."),
|
|
4615
4615
|
name: s.string().describe("The project name."),
|
|
@@ -4617,9 +4617,9 @@ const ya = {
|
|
|
4617
4617
|
folderId: s.string().optional().describe("The folder ID this project belongs to (workspace projects only)."),
|
|
4618
4618
|
childOrder: s.number().describe("The ordering index among siblings."),
|
|
4619
4619
|
sections: s.array(Y),
|
|
4620
|
-
children: s.array(
|
|
4620
|
+
children: s.array(Rs).describe("Nested child projects.")
|
|
4621
4621
|
})
|
|
4622
|
-
),
|
|
4622
|
+
), ka = {
|
|
4623
4623
|
type: s.enum(["account_overview", "project_overview"]).describe("The type of overview returned."),
|
|
4624
4624
|
totalProjects: s.number().optional().describe("Total number of projects (account overview only)."),
|
|
4625
4625
|
totalTasks: s.number().optional().describe("Total number of tasks."),
|
|
@@ -4638,7 +4638,7 @@ const ya = {
|
|
|
4638
4638
|
name: s.string().describe("The inbox project name."),
|
|
4639
4639
|
sections: s.array(Y).describe("Sections in the inbox project.")
|
|
4640
4640
|
}).optional().describe("Inbox information (account overview only)."),
|
|
4641
|
-
projects: s.array(s.lazy(() =>
|
|
4641
|
+
projects: s.array(s.lazy(() => Rs)).optional().describe(
|
|
4642
4642
|
"List of projects with hierarchy, folders, and ordering (account overview only)."
|
|
4643
4643
|
),
|
|
4644
4644
|
project: s.object({
|
|
@@ -4653,7 +4653,7 @@ const ya = {
|
|
|
4653
4653
|
tasksWithoutSection: s.number()
|
|
4654
4654
|
}).optional().describe("Statistics object (project overview only).")
|
|
4655
4655
|
};
|
|
4656
|
-
function
|
|
4656
|
+
function wa(e) {
|
|
4657
4657
|
const t = {};
|
|
4658
4658
|
for (const n of e)
|
|
4659
4659
|
t[n.id] = {
|
|
@@ -4678,7 +4678,7 @@ function ka(e) {
|
|
|
4678
4678
|
}
|
|
4679
4679
|
return o(r), r;
|
|
4680
4680
|
}
|
|
4681
|
-
async function
|
|
4681
|
+
async function va(e, t) {
|
|
4682
4682
|
const r = {};
|
|
4683
4683
|
return await Promise.all(
|
|
4684
4684
|
t.map(async (o) => {
|
|
@@ -4687,14 +4687,14 @@ async function wa(e, t) {
|
|
|
4687
4687
|
})
|
|
4688
4688
|
), r;
|
|
4689
4689
|
}
|
|
4690
|
-
function
|
|
4690
|
+
function Ls(e, t, r = "") {
|
|
4691
4691
|
const o = [];
|
|
4692
4692
|
o.push(`${r}- Project: ${e.name} (id=${e.id})`);
|
|
4693
4693
|
const n = t[e.id] || [];
|
|
4694
4694
|
for (const i of n)
|
|
4695
4695
|
o.push(`${r} - Section: ${i.name} (id=${i.id})`);
|
|
4696
4696
|
for (const i of e.children)
|
|
4697
|
-
o.push(...
|
|
4697
|
+
o.push(...Ls(i, t, `${r} `));
|
|
4698
4698
|
return o;
|
|
4699
4699
|
}
|
|
4700
4700
|
function Wt(e) {
|
|
@@ -4722,7 +4722,7 @@ function Ze(e, t = "") {
|
|
|
4722
4722
|
}
|
|
4723
4723
|
return r;
|
|
4724
4724
|
}
|
|
4725
|
-
function
|
|
4725
|
+
function Ns(e, t) {
|
|
4726
4726
|
return {
|
|
4727
4727
|
id: e.id,
|
|
4728
4728
|
name: e.name,
|
|
@@ -4731,11 +4731,11 @@ function Ls(e, t) {
|
|
|
4731
4731
|
childOrder: e.childOrder,
|
|
4732
4732
|
sections: (t[e.id] || []).map(G),
|
|
4733
4733
|
children: e.children.map(
|
|
4734
|
-
(r) =>
|
|
4734
|
+
(r) => Ns(r, t)
|
|
4735
4735
|
)
|
|
4736
4736
|
};
|
|
4737
4737
|
}
|
|
4738
|
-
async function
|
|
4738
|
+
async function Ia(e, t) {
|
|
4739
4739
|
let r = [], o;
|
|
4740
4740
|
do {
|
|
4741
4741
|
const { results: n, nextCursor: i } = await e.getTasks({
|
|
@@ -4747,12 +4747,12 @@ async function va(e, t) {
|
|
|
4747
4747
|
} while (o);
|
|
4748
4748
|
return r;
|
|
4749
4749
|
}
|
|
4750
|
-
async function
|
|
4750
|
+
async function Sa(e, t) {
|
|
4751
4751
|
const { results: r } = await e.getSections({ projectId: t });
|
|
4752
4752
|
return r;
|
|
4753
4753
|
}
|
|
4754
|
-
async function
|
|
4755
|
-
const { results: t } = await e.getProjects({}), r = t.find((p) => q(p) && p.inboxProject === !0), o = t.filter((p) => !q(p) || p.inboxProject !== !0), n =
|
|
4754
|
+
async function Ca(e) {
|
|
4755
|
+
const { results: t } = await e.getProjects({}), r = t.find((p) => q(p) && p.inboxProject === !0), o = t.filter((p) => !q(p) || p.inboxProject !== !0), n = wa(o), i = t.map((p) => p.id), a = await va(e, i), c = ["# Personal Projects", ""];
|
|
4756
4756
|
if (r) {
|
|
4757
4757
|
c.push(`- Inbox Project: ${r.name} (id=${r.id})`);
|
|
4758
4758
|
for (const p of a[r.id] || [])
|
|
@@ -4760,7 +4760,7 @@ async function Sa(e) {
|
|
|
4760
4760
|
}
|
|
4761
4761
|
if (n.length)
|
|
4762
4762
|
for (const p of n)
|
|
4763
|
-
c.push(...
|
|
4763
|
+
c.push(...Ls(p, a));
|
|
4764
4764
|
else
|
|
4765
4765
|
c.push("_No projects found._");
|
|
4766
4766
|
c.push(""), c.push(
|
|
@@ -4781,7 +4781,7 @@ async function Sa(e) {
|
|
|
4781
4781
|
sections: (a[r.id] || []).map(G)
|
|
4782
4782
|
} : void 0,
|
|
4783
4783
|
projects: n.map(
|
|
4784
|
-
(p) =>
|
|
4784
|
+
(p) => Ns(p, a)
|
|
4785
4785
|
),
|
|
4786
4786
|
totalProjects: t.length,
|
|
4787
4787
|
totalSections: i.reduce(
|
|
@@ -4792,11 +4792,11 @@ async function Sa(e) {
|
|
|
4792
4792
|
};
|
|
4793
4793
|
return { textContent: u, structuredContent: l };
|
|
4794
4794
|
}
|
|
4795
|
-
async function
|
|
4795
|
+
async function ja(e, t) {
|
|
4796
4796
|
const [r, o, n] = await Promise.all([
|
|
4797
4797
|
e.getProject(t),
|
|
4798
|
-
|
|
4799
|
-
|
|
4798
|
+
Sa(e, t),
|
|
4799
|
+
Ia(e, t)
|
|
4800
4800
|
]), i = {};
|
|
4801
4801
|
for (const l of o)
|
|
4802
4802
|
i[l.id] = [];
|
|
@@ -4838,27 +4838,27 @@ async function Ca(e, t) {
|
|
|
4838
4838
|
};
|
|
4839
4839
|
return { textContent: d, structuredContent: u };
|
|
4840
4840
|
}
|
|
4841
|
-
const
|
|
4841
|
+
const $a = {
|
|
4842
4842
|
name: g.GET_OVERVIEW,
|
|
4843
4843
|
description: `Get a Markdown overview. Called without a projectId, returns the account's project and section structure only — no tasks — for navigation. Pass a projectId (or "inbox" for the Inbox) to get that project's tasks grouped by section.`,
|
|
4844
|
-
parameters:
|
|
4845
|
-
outputSchema:
|
|
4844
|
+
parameters: Ta,
|
|
4845
|
+
outputSchema: ka,
|
|
4846
4846
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4847
4847
|
async execute(e, t) {
|
|
4848
|
-
const r = await te({ projectId: e.projectId, client: t }), o = r ? await
|
|
4848
|
+
const r = await te({ projectId: e.projectId, client: t }), o = r ? await ja(t, r) : await Ca(t);
|
|
4849
4849
|
return {
|
|
4850
4850
|
textContent: o.textContent,
|
|
4851
4851
|
structuredContent: o.structuredContent
|
|
4852
4852
|
};
|
|
4853
4853
|
}
|
|
4854
|
-
},
|
|
4854
|
+
}, Aa = {}, pe = s.object({
|
|
4855
4855
|
count: s.number().describe("Number of consecutive periods in this streak."),
|
|
4856
4856
|
start: s.string().describe("Start date of the streak."),
|
|
4857
4857
|
end: s.string().describe("End date of the streak.")
|
|
4858
4858
|
}), Bt = s.object({
|
|
4859
4859
|
id: s.string().describe("Project ID."),
|
|
4860
4860
|
completed: s.number().describe("Number of tasks completed in this project.")
|
|
4861
|
-
}),
|
|
4861
|
+
}), Da = {
|
|
4862
4862
|
completedCount: s.number().describe("Total number of completed tasks (all-time)."),
|
|
4863
4863
|
daysItems: s.array(
|
|
4864
4864
|
s.object({
|
|
@@ -4907,11 +4907,11 @@ const ja = {
|
|
|
4907
4907
|
})
|
|
4908
4908
|
).describe("Recent karma change events with reasons."),
|
|
4909
4909
|
projectColors: s.record(s.string(), s.string()).describe("Map of project ID to color key.")
|
|
4910
|
-
},
|
|
4910
|
+
}, xa = {
|
|
4911
4911
|
name: g.GET_PRODUCTIVITY_STATS,
|
|
4912
4912
|
description: 'Get comprehensive productivity statistics including daily/weekly completion breakdowns, goal streaks (current, last, max), karma score and trends, and historical karma data. Useful for productivity analysis and tracking goal progress. Reports counts, streaks and karma only, never the tasks themselves — for "what did I complete", use find-activity.',
|
|
4913
|
-
parameters:
|
|
4914
|
-
outputSchema:
|
|
4913
|
+
parameters: Aa,
|
|
4914
|
+
outputSchema: Da,
|
|
4915
4915
|
annotations: {
|
|
4916
4916
|
readOnlyHint: !0,
|
|
4917
4917
|
destructiveHint: !1,
|
|
@@ -4920,7 +4920,7 @@ const ja = {
|
|
|
4920
4920
|
async execute(e, t) {
|
|
4921
4921
|
const r = await t.getProductivityStats();
|
|
4922
4922
|
return {
|
|
4923
|
-
textContent:
|
|
4923
|
+
textContent: Ea(r),
|
|
4924
4924
|
structuredContent: {
|
|
4925
4925
|
completedCount: r.completedCount,
|
|
4926
4926
|
daysItems: r.daysItems,
|
|
@@ -4947,7 +4947,7 @@ const ja = {
|
|
|
4947
4947
|
};
|
|
4948
4948
|
}
|
|
4949
4949
|
};
|
|
4950
|
-
function
|
|
4950
|
+
function Ea(e) {
|
|
4951
4951
|
const t = [
|
|
4952
4952
|
"# Productivity Statistics",
|
|
4953
4953
|
"",
|
|
@@ -4977,11 +4977,11 @@ function xa(e) {
|
|
|
4977
4977
|
return t.join(`
|
|
4978
4978
|
`);
|
|
4979
4979
|
}
|
|
4980
|
-
const
|
|
4980
|
+
const Oa = {
|
|
4981
4981
|
projectId: s.string().min(1).describe("The ID of the project to get activity stats for."),
|
|
4982
4982
|
weeks: s.number().int().min(1).max(12).optional().describe("Number of weeks of activity data to retrieve (1-12, default 2)."),
|
|
4983
4983
|
includeWeeklyCounts: s.boolean().optional().describe("Include weekly rollup counts alongside daily counts.")
|
|
4984
|
-
},
|
|
4984
|
+
}, _a = {
|
|
4985
4985
|
projectId: s.string().describe("The project ID."),
|
|
4986
4986
|
dayItems: s.array(
|
|
4987
4987
|
s.object({
|
|
@@ -4997,7 +4997,7 @@ const Ea = {
|
|
|
4997
4997
|
})
|
|
4998
4998
|
).optional().describe("Weekly completion rollups. Only included when includeWeeklyCounts is true.")
|
|
4999
4999
|
};
|
|
5000
|
-
function
|
|
5000
|
+
function Pa(e, t) {
|
|
5001
5001
|
const r = [`# Activity Stats: Project ${e}`, ""];
|
|
5002
5002
|
if (t.dayItems.length > 0) {
|
|
5003
5003
|
r.push("## Daily Activity");
|
|
@@ -5013,11 +5013,11 @@ function _a(e, t) {
|
|
|
5013
5013
|
return r.join(`
|
|
5014
5014
|
`);
|
|
5015
5015
|
}
|
|
5016
|
-
const
|
|
5016
|
+
const Ua = {
|
|
5017
5017
|
name: g.GET_PROJECT_ACTIVITY_STATS,
|
|
5018
5018
|
description: "Get daily and optional weekly task completion counts for a project over a configurable time window (1-12 weeks). Useful for identifying completion trends and patterns.",
|
|
5019
|
-
parameters:
|
|
5020
|
-
outputSchema:
|
|
5019
|
+
parameters: Oa,
|
|
5020
|
+
outputSchema: _a,
|
|
5021
5021
|
annotations: {
|
|
5022
5022
|
readOnlyHint: !0,
|
|
5023
5023
|
destructiveHint: !1,
|
|
@@ -5029,7 +5029,7 @@ const Pa = {
|
|
|
5029
5029
|
includeWeeklyCounts: n
|
|
5030
5030
|
});
|
|
5031
5031
|
return {
|
|
5032
|
-
textContent:
|
|
5032
|
+
textContent: Pa(r, i),
|
|
5033
5033
|
structuredContent: {
|
|
5034
5034
|
projectId: r,
|
|
5035
5035
|
dayItems: i.dayItems,
|
|
@@ -5037,12 +5037,12 @@ const Pa = {
|
|
|
5037
5037
|
}
|
|
5038
5038
|
};
|
|
5039
5039
|
}
|
|
5040
|
-
},
|
|
5040
|
+
}, Ra = {
|
|
5041
5041
|
projectId: s.string().min(1).describe("The ID of the project to check health for."),
|
|
5042
5042
|
includeContext: s.boolean().default(!1).describe(
|
|
5043
5043
|
"Include detailed health context with project metrics and task-level data. May produce large output for projects with many tasks."
|
|
5044
5044
|
)
|
|
5045
|
-
},
|
|
5045
|
+
}, La = s.object({
|
|
5046
5046
|
id: s.string().describe("The task ID."),
|
|
5047
5047
|
content: s.string().describe("The task content/title."),
|
|
5048
5048
|
priority: s.string().describe("The task priority (1-4)."),
|
|
@@ -5050,7 +5050,7 @@ const Pa = {
|
|
|
5050
5050
|
deadline: s.string().optional().describe("The deadline date string, if set."),
|
|
5051
5051
|
isCompleted: s.boolean().describe("Whether the task is completed."),
|
|
5052
5052
|
labels: s.array(s.string()).describe("Labels applied to this task.")
|
|
5053
|
-
}),
|
|
5053
|
+
}), Na = {
|
|
5054
5054
|
projectId: s.string().describe("The project ID."),
|
|
5055
5055
|
projectName: s.string().describe("The project name."),
|
|
5056
5056
|
progress: s.object({
|
|
@@ -5076,12 +5076,12 @@ const Pa = {
|
|
|
5076
5076
|
tasksCompletedThisWeek: s.number().describe("Tasks completed in the current week."),
|
|
5077
5077
|
averageCompletionTime: s.number().optional().describe("Average task completion time in days, if available.")
|
|
5078
5078
|
}).describe("Aggregated project metrics."),
|
|
5079
|
-
tasks: s.array(
|
|
5079
|
+
tasks: s.array(La).describe("Tasks in the project.")
|
|
5080
5080
|
}).optional().describe(
|
|
5081
5081
|
"Detailed project context with metrics and task data. Only included when includeContext is true."
|
|
5082
5082
|
)
|
|
5083
5083
|
};
|
|
5084
|
-
async function
|
|
5084
|
+
async function Ma(e, t, r) {
|
|
5085
5085
|
if (r) {
|
|
5086
5086
|
const [i, a, c] = await Promise.all([
|
|
5087
5087
|
e.getProjectProgress(t),
|
|
@@ -5096,7 +5096,7 @@ async function Na(e, t, r) {
|
|
|
5096
5096
|
]);
|
|
5097
5097
|
return { progress: o, health: n };
|
|
5098
5098
|
}
|
|
5099
|
-
function
|
|
5099
|
+
function Fa(e, { progress: t, health: r, context: o }) {
|
|
5100
5100
|
const n = [`# Project Health: ${e}`, ""];
|
|
5101
5101
|
if (n.push(`**Status:** ${r.status}`), r.isStale && n.push("**Note:** Health data is stale and may not reflect recent changes."), r.updateInProgress && n.push("**Note:** A health analysis update is currently in progress."), r.updatedAt && n.push(`**Last Updated:** ${r.updatedAt.toISOString()}`), n.push(""), n.push("## Progress"), n.push(
|
|
5102
5102
|
`**Completed:** ${t.completedCount} | **Active:** ${t.activeCount} | **Progress:** ${t.progressPercent}%`
|
|
@@ -5114,18 +5114,18 @@ function Ma(e, { progress: t, health: r, context: o }) {
|
|
|
5114
5114
|
return n.join(`
|
|
5115
5115
|
`);
|
|
5116
5116
|
}
|
|
5117
|
-
const
|
|
5117
|
+
const Ha = {
|
|
5118
5118
|
name: g.GET_PROJECT_HEALTH,
|
|
5119
5119
|
description: "Get a comprehensive health assessment for a project including completion progress, health status (EXCELLENT, ON_TRACK, AT_RISK, CRITICAL), and optional detailed context with project metrics and task-level data. Use includeContext=true for that full detail.",
|
|
5120
|
-
parameters:
|
|
5121
|
-
outputSchema:
|
|
5120
|
+
parameters: Ra,
|
|
5121
|
+
outputSchema: Na,
|
|
5122
5122
|
annotations: {
|
|
5123
5123
|
readOnlyHint: !0,
|
|
5124
5124
|
destructiveHint: !1,
|
|
5125
5125
|
idempotentHint: !0
|
|
5126
5126
|
},
|
|
5127
5127
|
async execute(e, t) {
|
|
5128
|
-
const { projectId: r, includeContext: o } = e, n = await
|
|
5128
|
+
const { projectId: r, includeContext: o } = e, n = await Ma(t, r, o), i = n.context?.projectName ?? `Project ${r}`, a = Fa(i, n), c = n.context ? {
|
|
5129
5129
|
projectDescription: n.context.projectDescription ?? void 0,
|
|
5130
5130
|
projectMetrics: {
|
|
5131
5131
|
...n.context.projectMetrics,
|
|
@@ -5163,12 +5163,12 @@ const Fa = {
|
|
|
5163
5163
|
}
|
|
5164
5164
|
};
|
|
5165
5165
|
}
|
|
5166
|
-
},
|
|
5166
|
+
}, Wa = {
|
|
5167
5167
|
workspaceIdOrName: s.string().min(1).describe(
|
|
5168
5168
|
"The workspace ID or name. Supports exact ID, exact name match (case-insensitive), or unique partial name match."
|
|
5169
5169
|
),
|
|
5170
5170
|
projectIds: s.array(s.string().min(1)).min(1).optional().describe("Optional list of project IDs to scope insights to specific projects.")
|
|
5171
|
-
},
|
|
5171
|
+
}, Ba = s.object({
|
|
5172
5172
|
projectId: s.string().describe("The project ID."),
|
|
5173
5173
|
health: s.object({
|
|
5174
5174
|
status: s.enum(tt).describe("The health status of the project."),
|
|
@@ -5180,22 +5180,22 @@ const Fa = {
|
|
|
5180
5180
|
activeCount: s.number().describe("Number of active tasks."),
|
|
5181
5181
|
progressPercent: s.number().describe("Completion percentage (0-100).")
|
|
5182
5182
|
}).optional().describe("Progress data for this project. Omitted when the project has none.")
|
|
5183
|
-
}),
|
|
5183
|
+
}), za = {
|
|
5184
5184
|
workspaceId: s.string().describe("The resolved workspace ID."),
|
|
5185
5185
|
workspaceName: s.string().describe("The resolved workspace name."),
|
|
5186
|
-
projectInsights: s.array(
|
|
5187
|
-
},
|
|
5186
|
+
projectInsights: s.array(Ba).describe("Health and progress insights for each project in the workspace.")
|
|
5187
|
+
}, Ka = {
|
|
5188
5188
|
name: g.GET_WORKSPACE_INSIGHTS,
|
|
5189
5189
|
description: "Get aggregated health and progress insights across all projects in a workspace. Accepts workspace name or ID, with optional project ID filtering. Useful for a cross-project health overview.",
|
|
5190
|
-
parameters:
|
|
5191
|
-
outputSchema:
|
|
5190
|
+
parameters: Wa,
|
|
5191
|
+
outputSchema: za,
|
|
5192
5192
|
annotations: {
|
|
5193
5193
|
readOnlyHint: !0,
|
|
5194
5194
|
destructiveHint: !1,
|
|
5195
5195
|
idempotentHint: !0
|
|
5196
5196
|
},
|
|
5197
5197
|
async execute(e, t) {
|
|
5198
|
-
const { workspaceIdOrName: r, projectIds: o } = e, n = await
|
|
5198
|
+
const { workspaceIdOrName: r, projectIds: o } = e, n = await Is.resolveWorkspace(t, r), a = (await t.getWorkspaceInsights(n.workspaceId, { projectIds: o })).projectInsights.map((d) => ({
|
|
5199
5199
|
projectId: d.projectId,
|
|
5200
5200
|
health: d.health ? {
|
|
5201
5201
|
status: d.health.status,
|
|
@@ -5228,7 +5228,7 @@ const Fa = {
|
|
|
5228
5228
|
};
|
|
5229
5229
|
}
|
|
5230
5230
|
};
|
|
5231
|
-
function
|
|
5231
|
+
function qa(e) {
|
|
5232
5232
|
const t = e.trim();
|
|
5233
5233
|
if (!/^https?:\/\//i.test(t))
|
|
5234
5234
|
return t;
|
|
@@ -5238,21 +5238,21 @@ function Ka(e) {
|
|
|
5238
5238
|
} catch {
|
|
5239
5239
|
throw new Error(`Could not read a template ID from "${t}".`);
|
|
5240
5240
|
}
|
|
5241
|
-
if (!
|
|
5241
|
+
if (!Ya(r.hostname))
|
|
5242
5242
|
throw new Error(
|
|
5243
5243
|
`"${r.hostname}" is not a Todoist domain. Pass a todoist.com template URL or the template ID itself.`
|
|
5244
5244
|
);
|
|
5245
5245
|
r.hostname = "todoist.com";
|
|
5246
|
-
const o =
|
|
5246
|
+
const o = er(r.toString());
|
|
5247
5247
|
if (o?.type !== "template")
|
|
5248
5248
|
throw new Error(`"${t}" is not a Todoist template URL.`);
|
|
5249
5249
|
return o.id;
|
|
5250
5250
|
}
|
|
5251
|
-
function
|
|
5251
|
+
function Ya(e) {
|
|
5252
5252
|
const t = e.toLowerCase();
|
|
5253
5253
|
return t === "todoist.com" || t.endsWith(".todoist.com");
|
|
5254
5254
|
}
|
|
5255
|
-
const
|
|
5255
|
+
const Ga = {
|
|
5256
5256
|
projectId: s.string().min(1).describe("The ID of the existing project to import the template into."),
|
|
5257
5257
|
templateId: s.string().optional().describe(
|
|
5258
5258
|
'The template to import — either a gallery slug ("product-launch"), a personal template ID ("UT_28Ex..."), or a full Todoist template URL, which is reduced to the ID automatically. Gallery templates work for anyone; personal templates only for the account that owns them. There is no way to list templates through this server, so only use the ID or URL the user supplied. Provide either this or `csvFileContent`, not both.'
|
|
@@ -5261,16 +5261,16 @@ const Ya = {
|
|
|
5261
5261
|
"Raw CSV template content, as produced by export-project-template. Provide either this or `templateId`, not both."
|
|
5262
5262
|
),
|
|
5263
5263
|
locale: s.string().optional().describe('Locale for the imported content when using `templateId`. Defaults to "en".')
|
|
5264
|
-
},
|
|
5264
|
+
}, Va = {
|
|
5265
5265
|
sections: s.array(Y).describe("Sections created by the import."),
|
|
5266
5266
|
tasks: s.array(K).describe("Tasks created by the import."),
|
|
5267
5267
|
comments: s.array(ve).describe("Comments created by the import."),
|
|
5268
5268
|
totalCount: s.number().describe("The total number of objects created by the import.")
|
|
5269
|
-
},
|
|
5269
|
+
}, Ja = {
|
|
5270
5270
|
name: g.IMPORT_PROJECT_TEMPLATE,
|
|
5271
5271
|
description: "Import a template into an existing project, adding its tasks, sections and comments to whatever is already there. Source it by template ID/URL or by passing CSV content from export-project-template. To start a new project from a template, create the project with add-projects first, then import into it. This writes immediately and cannot be undone, so only run it against a project the user named.",
|
|
5272
|
-
parameters:
|
|
5273
|
-
outputSchema:
|
|
5272
|
+
parameters: Ga,
|
|
5273
|
+
outputSchema: Va,
|
|
5274
5274
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
5275
5275
|
async execute({ projectId: e, templateId: t, csvFileContent: r, locale: o }, n) {
|
|
5276
5276
|
if (!!t == !!r)
|
|
@@ -5279,7 +5279,7 @@ const Ya = {
|
|
|
5279
5279
|
);
|
|
5280
5280
|
const i = t ? await n.importTemplateFromId({
|
|
5281
5281
|
projectId: e,
|
|
5282
|
-
templateId:
|
|
5282
|
+
templateId: qa(t),
|
|
5283
5283
|
locale: o
|
|
5284
5284
|
}) : await n.importTemplateIntoProject({
|
|
5285
5285
|
projectId: e,
|
|
@@ -5287,7 +5287,7 @@ const Ya = {
|
|
|
5287
5287
|
fileName: "template.csv"
|
|
5288
5288
|
}), a = i.sections.map(G), c = i.tasks.map(P), d = i.comments.map(we), u = i.projects.length + a.length + c.length + d.length;
|
|
5289
5289
|
return {
|
|
5290
|
-
textContent:
|
|
5290
|
+
textContent: Xa({
|
|
5291
5291
|
projectId: e,
|
|
5292
5292
|
counts: {
|
|
5293
5293
|
projects: i.projects.length,
|
|
@@ -5301,7 +5301,7 @@ const Ya = {
|
|
|
5301
5301
|
};
|
|
5302
5302
|
}
|
|
5303
5303
|
};
|
|
5304
|
-
function
|
|
5304
|
+
function Xa({
|
|
5305
5305
|
projectId: e,
|
|
5306
5306
|
counts: t,
|
|
5307
5307
|
totalCount: r
|
|
@@ -5311,21 +5311,21 @@ function Ja({
|
|
|
5311
5311
|
const o = Object.entries(t).filter(([, n]) => n > 0).map(([n, i]) => `${i} ${i === 1 ? n.replace(/s$/, "") : n}`);
|
|
5312
5312
|
return `Imported template into project (id=${e}): ${o.join(", ")}.`;
|
|
5313
5313
|
}
|
|
5314
|
-
const
|
|
5314
|
+
const Qa = {}, Za = {
|
|
5315
5315
|
id: s.string().describe("The unique identifier for the workspace."),
|
|
5316
5316
|
name: s.string().describe("The name of the workspace."),
|
|
5317
|
-
plan: s.enum(
|
|
5318
|
-
role: s.enum(
|
|
5317
|
+
plan: s.enum(sr).describe("The workspace plan type."),
|
|
5318
|
+
role: s.enum(tr).optional().describe("The user's role in the workspace, if available."),
|
|
5319
5319
|
isLinkSharingEnabled: s.boolean().describe("Whether link sharing is enabled for the workspace."),
|
|
5320
5320
|
isGuestAllowed: s.boolean().describe("Whether guests are allowed in the workspace."),
|
|
5321
5321
|
createdAt: s.string().optional().describe("The ISO 8601 timestamp when the workspace was created."),
|
|
5322
5322
|
creatorId: s.string().describe("The ID of the user who created the workspace.")
|
|
5323
|
-
},
|
|
5323
|
+
}, ec = {
|
|
5324
5324
|
type: s.literal("workspaces").describe("The type of the response."),
|
|
5325
|
-
workspaces: s.array(s.object(
|
|
5325
|
+
workspaces: s.array(s.object(Za)).describe("List of workspaces."),
|
|
5326
5326
|
count: s.number().describe("The total number of workspaces.")
|
|
5327
5327
|
};
|
|
5328
|
-
async function
|
|
5328
|
+
async function tc(e) {
|
|
5329
5329
|
const r = (await e.getWorkspaces()).map((a) => ({
|
|
5330
5330
|
id: a.id,
|
|
5331
5331
|
name: a.name,
|
|
@@ -5356,22 +5356,22 @@ async function ec(e) {
|
|
|
5356
5356
|
};
|
|
5357
5357
|
return { textContent: n, structuredContent: i };
|
|
5358
5358
|
}
|
|
5359
|
-
const
|
|
5359
|
+
const sc = {
|
|
5360
5360
|
name: g.LIST_WORKSPACES,
|
|
5361
5361
|
description: "Get all workspaces for the authenticated user. Returns workspace details including ID, name, plan type (STARTER/BUSINESS), user role (ADMIN/MEMBER/GUEST), link sharing settings, guest permissions, creation date, and creator ID.",
|
|
5362
|
-
parameters:
|
|
5363
|
-
outputSchema:
|
|
5362
|
+
parameters: Qa,
|
|
5363
|
+
outputSchema: ec,
|
|
5364
5364
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
5365
5365
|
async execute(e, t) {
|
|
5366
|
-
const r = await
|
|
5366
|
+
const r = await tc(t);
|
|
5367
5367
|
return {
|
|
5368
5368
|
textContent: r.textContent,
|
|
5369
5369
|
structuredContent: r.structuredContent
|
|
5370
5370
|
};
|
|
5371
5371
|
}
|
|
5372
|
-
}, { FIND_TASKS:
|
|
5372
|
+
}, { FIND_TASKS: rc, FIND_PROJECT_COLLABORATORS: zt, UPDATE_TASKS: oc } = g, nc = 50, ic = {
|
|
5373
5373
|
operation: s.enum(["assign", "unassign", "reassign"]).describe("The assignment operation to perform."),
|
|
5374
|
-
taskIds: s.array(s.string()).min(1).max(
|
|
5374
|
+
taskIds: s.array(s.string()).min(1).max(nc).describe("The IDs of the tasks to operate on (max 50)."),
|
|
5375
5375
|
responsibleUser: s.string().optional().describe(
|
|
5376
5376
|
'The user to assign tasks to. Can be "me" (assigns to current user), a user ID, name, or email. Required for assign and reassign operations.'
|
|
5377
5377
|
),
|
|
@@ -5379,7 +5379,7 @@ const tc = {
|
|
|
5379
5379
|
"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."
|
|
5380
5380
|
),
|
|
5381
5381
|
dryRun: s.boolean().optional().default(!1).describe("If true, validates operations without executing them.")
|
|
5382
|
-
},
|
|
5382
|
+
}, ac = {
|
|
5383
5383
|
results: s.array(
|
|
5384
5384
|
s.object({
|
|
5385
5385
|
taskId: s.string().describe("The ID of the task."),
|
|
@@ -5395,11 +5395,11 @@ const tc = {
|
|
|
5395
5395
|
failed: s.number().describe("Number of failed operations."),
|
|
5396
5396
|
dryRun: s.boolean().describe("Whether this was a dry run.")
|
|
5397
5397
|
}).optional().describe("Summary of the operation.")
|
|
5398
|
-
},
|
|
5398
|
+
}, cc = {
|
|
5399
5399
|
name: g.MANAGE_ASSIGNMENTS,
|
|
5400
5400
|
description: "Bulk assignment operations for multiple tasks. Supports assign, unassign, and reassign operations with atomic rollback on failures.",
|
|
5401
|
-
parameters:
|
|
5402
|
-
outputSchema:
|
|
5401
|
+
parameters: ic,
|
|
5402
|
+
outputSchema: ac,
|
|
5403
5403
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5404
5404
|
async execute(e, t) {
|
|
5405
5405
|
const { operation: r, taskIds: o, responsibleUser: n, fromAssigneeUser: i, dryRun: a } = e;
|
|
@@ -5622,8 +5622,8 @@ function Le({
|
|
|
5622
5622
|
`;
|
|
5623
5623
|
}
|
|
5624
5624
|
return !r && o.length > 0 ? (c += `**Next steps:**
|
|
5625
|
-
`, c += `• Use ${
|
|
5626
|
-
`, c += `• Use ${
|
|
5625
|
+
`, c += `• Use ${rc} with responsibleUser to see ${e === "unassign" ? "unassigned" : "newly assigned"} tasks
|
|
5626
|
+
`, c += `• Use ${oc} for individual assignment changes
|
|
5627
5627
|
`, n.length > 0 && (c += `• Check failed tasks and use ${zt} to verify collaborator access
|
|
5628
5628
|
`)) : r ? (c += `**To execute:**
|
|
5629
5629
|
`, c += `• Remove dryRun parameter and run again to execute changes
|
|
@@ -5635,17 +5635,17 @@ function Le({
|
|
|
5635
5635
|
`, c += `• Use dryRun=true to validate before executing
|
|
5636
5636
|
`), c;
|
|
5637
5637
|
}
|
|
5638
|
-
const
|
|
5638
|
+
const dc = {
|
|
5639
5639
|
action: s.enum(["archive", "unarchive"]).describe("The action to perform on the project."),
|
|
5640
5640
|
projectId: s.string().min(1).describe("The ID of the project.")
|
|
5641
|
-
},
|
|
5641
|
+
}, lc = {
|
|
5642
5642
|
project: re.describe("The updated project."),
|
|
5643
5643
|
success: s.boolean().describe("Whether the action was successful.")
|
|
5644
|
-
},
|
|
5644
|
+
}, uc = {
|
|
5645
5645
|
name: g.PROJECT_MANAGEMENT,
|
|
5646
5646
|
description: "Archive or unarchive a project by its ID.",
|
|
5647
|
-
parameters:
|
|
5648
|
-
outputSchema:
|
|
5647
|
+
parameters: dc,
|
|
5648
|
+
outputSchema: lc,
|
|
5649
5649
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
|
|
5650
5650
|
async execute(e, t) {
|
|
5651
5651
|
const r = e.action === "archive" ? await t.archiveProject(e.projectId) : await t.unarchiveProject(e.projectId), o = se(r);
|
|
@@ -5657,7 +5657,7 @@ const cc = {
|
|
|
5657
5657
|
}
|
|
5658
5658
|
};
|
|
5659
5659
|
}
|
|
5660
|
-
},
|
|
5660
|
+
}, pc = {
|
|
5661
5661
|
action: s.enum(["move-to-workspace", "move-to-personal"]).describe("The action to perform on the project."),
|
|
5662
5662
|
projectId: s.string().min(1).describe("The ID of the project to move."),
|
|
5663
5663
|
workspaceId: s.string().min(1).optional().describe("The target workspace ID. Required when action is move-to-workspace."),
|
|
@@ -5665,14 +5665,14 @@ const cc = {
|
|
|
5665
5665
|
visibility: s.enum(["restricted", "team", "public"]).optional().describe(
|
|
5666
5666
|
"Optional access visibility for the project in the workspace (restricted, team, or public)."
|
|
5667
5667
|
)
|
|
5668
|
-
},
|
|
5668
|
+
}, hc = {
|
|
5669
5669
|
project: re.describe("The moved project."),
|
|
5670
5670
|
success: s.boolean().describe("Whether the move was successful.")
|
|
5671
|
-
},
|
|
5671
|
+
}, mc = {
|
|
5672
5672
|
name: g.PROJECT_MOVE,
|
|
5673
5673
|
description: "Move a project between personal and workspace contexts.",
|
|
5674
|
-
parameters:
|
|
5675
|
-
outputSchema:
|
|
5674
|
+
parameters: pc,
|
|
5675
|
+
outputSchema: hc,
|
|
5676
5676
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
|
|
5677
5677
|
async execute(e, t) {
|
|
5678
5678
|
let r;
|
|
@@ -5695,8 +5695,8 @@ const cc = {
|
|
|
5695
5695
|
}
|
|
5696
5696
|
};
|
|
5697
5697
|
}
|
|
5698
|
-
},
|
|
5699
|
-
type: s.enum(
|
|
5698
|
+
}, Ms = ["project", "section"], fc = {
|
|
5699
|
+
type: s.enum(Ms).describe(
|
|
5700
5700
|
'The type of entity to reorder. "project" reorders sibling projects within the same parent (and can move projects to a new parent). "section" reorders sections within the same project.'
|
|
5701
5701
|
),
|
|
5702
5702
|
items: s.array(
|
|
@@ -5712,17 +5712,17 @@ const cc = {
|
|
|
5712
5712
|
).min(1).describe(
|
|
5713
5713
|
"The items to reorder or move. Each item must have at least order or parentId. Items with parentId will be moved first, then items with order will be reordered. All items being reordered should be siblings for predictable results."
|
|
5714
5714
|
)
|
|
5715
|
-
},
|
|
5716
|
-
type: s.enum(
|
|
5715
|
+
}, bc = {
|
|
5716
|
+
type: s.enum(Ms).describe("The type of entity that was reordered/moved."),
|
|
5717
5717
|
movedCount: s.number().describe("The number of entities moved to a new parent."),
|
|
5718
5718
|
reorderedCount: s.number().describe("The number of entities reordered."),
|
|
5719
5719
|
affectedIds: s.array(s.string()).describe("The IDs of all affected entities."),
|
|
5720
5720
|
success: s.boolean().describe("Whether the operation was successful.")
|
|
5721
|
-
},
|
|
5721
|
+
}, gc = {
|
|
5722
5722
|
name: g.REORDER_OBJECTS,
|
|
5723
5723
|
description: 'Reorder sibling projects or sections, and optionally move projects to a new parent. For projects: set order to reorder siblings, and/or set parentId to move under a new parent (use "root" for top level). For sections: set order to reorder within a project.',
|
|
5724
|
-
parameters:
|
|
5725
|
-
outputSchema:
|
|
5724
|
+
parameters: fc,
|
|
5725
|
+
outputSchema: bc,
|
|
5726
5726
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
|
|
5727
5727
|
async execute(e, t) {
|
|
5728
5728
|
const { type: r, items: o } = e, n = /* @__PURE__ */ new Set();
|
|
@@ -5784,22 +5784,22 @@ const cc = {
|
|
|
5784
5784
|
}
|
|
5785
5785
|
};
|
|
5786
5786
|
}
|
|
5787
|
-
},
|
|
5787
|
+
}, yc = s.object({
|
|
5788
5788
|
id: s.string().min(1).describe("The ID of the task to reschedule."),
|
|
5789
5789
|
date: s.string().min(1).describe(
|
|
5790
5790
|
"The new date for the task. Use YYYY-MM-DD for date-only, or YYYY-MM-DDTHH:MM:SS for datetime. If date-only is provided and the task already has a specific time, the existing time is preserved."
|
|
5791
5791
|
)
|
|
5792
|
-
}),
|
|
5793
|
-
tasks: s.array(
|
|
5794
|
-
},
|
|
5792
|
+
}), Tc = {
|
|
5793
|
+
tasks: s.array(yc).min(1).describe("The tasks to reschedule with their new dates.")
|
|
5794
|
+
}, kc = {
|
|
5795
5795
|
tasks: s.array(K).describe("The rescheduled tasks."),
|
|
5796
5796
|
totalCount: s.number().describe("The total number of tasks rescheduled."),
|
|
5797
5797
|
rescheduledTaskIds: s.array(s.string()).describe("The IDs of the rescheduled tasks.")
|
|
5798
|
-
},
|
|
5798
|
+
}, wc = {
|
|
5799
5799
|
name: g.RESCHEDULE_TASKS,
|
|
5800
5800
|
description: "Reschedule tasks to new dates while preserving recurring schedules. Unlike update-tasks (which replaces the entire due string and can wipe recurrence), this tool changes only the date, keeping recurrence patterns intact. Use this when moving recurring tasks to a different date without altering their repeat pattern.",
|
|
5801
|
-
parameters:
|
|
5802
|
-
outputSchema:
|
|
5801
|
+
parameters: Tc,
|
|
5802
|
+
outputSchema: kc,
|
|
5803
5803
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5804
5804
|
async execute(e, t) {
|
|
5805
5805
|
const { tasks: r } = e, n = (await Promise.all(
|
|
@@ -5812,7 +5812,7 @@ const cc = {
|
|
|
5812
5812
|
throw new Error(
|
|
5813
5813
|
`Task "${u.content}" (${u.id}) has no due date. Rescheduling requires an existing due date.`
|
|
5814
5814
|
);
|
|
5815
|
-
const l =
|
|
5815
|
+
const l = vc(d.date, u.due);
|
|
5816
5816
|
return Q("item_update", {
|
|
5817
5817
|
id: d.id,
|
|
5818
5818
|
due: {
|
|
@@ -5843,16 +5843,16 @@ const cc = {
|
|
|
5843
5843
|
};
|
|
5844
5844
|
}
|
|
5845
5845
|
};
|
|
5846
|
-
function
|
|
5846
|
+
function vc(e, t) {
|
|
5847
5847
|
if (/^\d{4}-\d{2}-\d{2}$/.test(e) && t.datetime) {
|
|
5848
5848
|
const o = t.datetime.substring(10);
|
|
5849
5849
|
return e + o;
|
|
5850
5850
|
}
|
|
5851
5851
|
return e;
|
|
5852
5852
|
}
|
|
5853
|
-
const
|
|
5853
|
+
const Ic = {
|
|
5854
5854
|
query: s.string().min(1).describe("The search query string to find tasks and projects.")
|
|
5855
|
-
},
|
|
5855
|
+
}, Sc = {
|
|
5856
5856
|
results: s.array(
|
|
5857
5857
|
s.object({
|
|
5858
5858
|
id: s.string().describe("The ID of the result."),
|
|
@@ -5861,21 +5861,21 @@ const vc = {
|
|
|
5861
5861
|
})
|
|
5862
5862
|
).describe("The search results."),
|
|
5863
5863
|
totalCount: s.number().describe("Total number of results found.")
|
|
5864
|
-
},
|
|
5864
|
+
}, Cc = {
|
|
5865
5865
|
name: g.SEARCH,
|
|
5866
5866
|
description: "Search across tasks and projects in Todoist. Returns a list of relevant results with IDs, titles, and URLs.",
|
|
5867
|
-
parameters:
|
|
5868
|
-
outputSchema:
|
|
5867
|
+
parameters: Ic,
|
|
5868
|
+
outputSchema: Sc,
|
|
5869
5869
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
5870
5870
|
async execute(e, t) {
|
|
5871
5871
|
const { query: r } = e, [o, n] = await Promise.all([
|
|
5872
5872
|
dt({
|
|
5873
5873
|
client: t,
|
|
5874
|
-
query: `search: ${r}`,
|
|
5874
|
+
query: `search: ${Zt(r)}`,
|
|
5875
5875
|
limit: j.TASKS_MAX,
|
|
5876
5876
|
cursor: void 0
|
|
5877
5877
|
}),
|
|
5878
|
-
|
|
5878
|
+
gs(t, r)
|
|
5879
5879
|
]), i = [];
|
|
5880
5880
|
for (const a of o.tasks)
|
|
5881
5881
|
i.push({
|
|
@@ -5894,19 +5894,19 @@ const vc = {
|
|
|
5894
5894
|
structuredContent: { results: i, totalCount: i.length }
|
|
5895
5895
|
};
|
|
5896
5896
|
}
|
|
5897
|
-
}, Cc = {
|
|
5898
|
-
ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to uncomplete.")
|
|
5899
5897
|
}, jc = {
|
|
5898
|
+
ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to uncomplete.")
|
|
5899
|
+
}, $c = {
|
|
5900
5900
|
uncompleted: s.array(s.string()).describe("The IDs of successfully uncompleted tasks."),
|
|
5901
5901
|
failures: s.array(oe).describe("Failed task uncompletion with error details."),
|
|
5902
5902
|
totalRequested: s.number().describe("The total number of tasks requested to uncomplete."),
|
|
5903
5903
|
successCount: s.number().describe("The number of successfully uncompleted tasks."),
|
|
5904
5904
|
failureCount: s.number().describe("The number of failed task uncompletions.")
|
|
5905
|
-
},
|
|
5905
|
+
}, Ac = {
|
|
5906
5906
|
name: g.UNCOMPLETE_TASKS,
|
|
5907
5907
|
description: "Uncomplete (reopen) one or more completed tasks by their IDs.",
|
|
5908
|
-
parameters:
|
|
5909
|
-
outputSchema:
|
|
5908
|
+
parameters: jc,
|
|
5909
|
+
outputSchema: $c,
|
|
5910
5910
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
5911
5911
|
async execute(e, t) {
|
|
5912
5912
|
const r = [], o = [];
|
|
@@ -5920,7 +5920,7 @@ const vc = {
|
|
|
5920
5920
|
});
|
|
5921
5921
|
}
|
|
5922
5922
|
return ne(g.UNCOMPLETE_TASKS, e.ids.length, o), {
|
|
5923
|
-
textContent:
|
|
5923
|
+
textContent: Dc({
|
|
5924
5924
|
uncompleted: r,
|
|
5925
5925
|
failures: o,
|
|
5926
5926
|
args: e
|
|
@@ -5935,7 +5935,7 @@ const vc = {
|
|
|
5935
5935
|
};
|
|
5936
5936
|
}
|
|
5937
5937
|
};
|
|
5938
|
-
function
|
|
5938
|
+
function Dc({
|
|
5939
5939
|
uncompleted: e,
|
|
5940
5940
|
failures: t,
|
|
5941
5941
|
args: r
|
|
@@ -5949,28 +5949,28 @@ function Ac({
|
|
|
5949
5949
|
failures: t
|
|
5950
5950
|
});
|
|
5951
5951
|
}
|
|
5952
|
-
const
|
|
5952
|
+
const xc = s.object({
|
|
5953
5953
|
id: s.string().min(1).describe("The ID of the comment to update."),
|
|
5954
5954
|
content: s.string().min(1).describe("The new content for the comment.")
|
|
5955
|
-
}),
|
|
5956
|
-
comments: s.array(
|
|
5957
|
-
},
|
|
5955
|
+
}), Ec = {
|
|
5956
|
+
comments: s.array(xc).min(1).describe("The comments to update.")
|
|
5957
|
+
}, Oc = {
|
|
5958
5958
|
comments: s.array(ve).describe("The updated comments."),
|
|
5959
5959
|
totalCount: s.number().describe("The total number of comments updated."),
|
|
5960
5960
|
updatedCommentIds: s.array(s.string()).describe("The IDs of the updated comments."),
|
|
5961
5961
|
appliedOperations: s.object({
|
|
5962
5962
|
updateCount: s.number().describe("The number of comments updated.")
|
|
5963
5963
|
}).describe("Summary of operations performed.")
|
|
5964
|
-
},
|
|
5964
|
+
}, _c = {
|
|
5965
5965
|
name: g.UPDATE_COMMENTS,
|
|
5966
5966
|
description: "Update multiple existing comments with new content.",
|
|
5967
|
-
parameters:
|
|
5968
|
-
outputSchema:
|
|
5967
|
+
parameters: Ec,
|
|
5968
|
+
outputSchema: Oc,
|
|
5969
5969
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5970
5970
|
async execute(e, t) {
|
|
5971
5971
|
const { comments: r } = e, o = r.map(async (c) => await t.updateComment(c.id, { content: c.content })), i = (await Promise.all(o)).map(we);
|
|
5972
5972
|
return {
|
|
5973
|
-
textContent:
|
|
5973
|
+
textContent: Pc({
|
|
5974
5974
|
comments: i
|
|
5975
5975
|
}),
|
|
5976
5976
|
structuredContent: {
|
|
@@ -5984,7 +5984,7 @@ const Dc = s.object({
|
|
|
5984
5984
|
};
|
|
5985
5985
|
}
|
|
5986
5986
|
};
|
|
5987
|
-
function
|
|
5987
|
+
function Pc({ comments: e }) {
|
|
5988
5988
|
const t = e.filter((i) => i.taskId).length, r = e.filter((i) => i.projectId).length, o = [];
|
|
5989
5989
|
if (t > 0) {
|
|
5990
5990
|
const i = t > 1 ? "comments" : "comment";
|
|
@@ -5996,7 +5996,7 @@ function _c({ comments: e }) {
|
|
|
5996
5996
|
}
|
|
5997
5997
|
return o.length > 0 ? `Updated ${o.join(" and ")}` : "No comments updated";
|
|
5998
5998
|
}
|
|
5999
|
-
const
|
|
5999
|
+
const Uc = s.object({
|
|
6000
6000
|
id: s.string().min(1).describe("The ID of the filter to update."),
|
|
6001
6001
|
name: s.string().min(1).optional().describe("The new name of the filter."),
|
|
6002
6002
|
query: s.string().min(1).optional().describe(
|
|
@@ -6011,9 +6011,9 @@ const Pc = s.object({
|
|
|
6011
6011
|
).optional(),
|
|
6012
6012
|
color: fe,
|
|
6013
6013
|
isFavorite: s.boolean().optional().describe("Whether to mark the filter as a favorite.")
|
|
6014
|
-
}),
|
|
6015
|
-
filters: s.array(
|
|
6016
|
-
},
|
|
6014
|
+
}), Rc = {
|
|
6015
|
+
filters: s.array(Uc).min(1).describe("The filters to update.")
|
|
6016
|
+
}, Lc = {
|
|
6017
6017
|
filters: s.array(ut).describe("The updated filters."),
|
|
6018
6018
|
totalCount: s.number().describe("The total number of filters updated."),
|
|
6019
6019
|
updatedFilterIds: s.array(s.string()).describe("The IDs of the updated filters."),
|
|
@@ -6021,15 +6021,15 @@ const Pc = s.object({
|
|
|
6021
6021
|
updateCount: s.number().describe("The number of filters actually updated."),
|
|
6022
6022
|
skippedCount: s.number().describe("The number of filters skipped (no changes).")
|
|
6023
6023
|
}).describe("Summary of operations performed.")
|
|
6024
|
-
},
|
|
6024
|
+
}, Nc = {
|
|
6025
6025
|
name: g.UPDATE_FILTERS,
|
|
6026
6026
|
description: "Update one or more existing personal filters with new values.",
|
|
6027
|
-
parameters:
|
|
6028
|
-
outputSchema:
|
|
6027
|
+
parameters: Rc,
|
|
6028
|
+
outputSchema: Lc,
|
|
6029
6029
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
6030
6030
|
async execute(e, t) {
|
|
6031
6031
|
const { filters: r } = e, o = [], i = r.map((h) => {
|
|
6032
|
-
const m =
|
|
6032
|
+
const m = Fc(h);
|
|
6033
6033
|
return m !== null ? { kind: "skipped", reason: m } : (o.push(h), { kind: "updated", filter: h });
|
|
6034
6034
|
}).filter((h) => h.kind === "skipped").length;
|
|
6035
6035
|
if (o.length === 0)
|
|
@@ -6057,13 +6057,13 @@ const Pc = s.object({
|
|
|
6057
6057
|
id: h.id,
|
|
6058
6058
|
name: h.name,
|
|
6059
6059
|
query: h.query,
|
|
6060
|
-
description:
|
|
6060
|
+
description: ws(h),
|
|
6061
6061
|
color: be.parse(h.color),
|
|
6062
6062
|
isFavorite: h.isFavorite,
|
|
6063
6063
|
itemOrder: h.itemOrder
|
|
6064
6064
|
}));
|
|
6065
6065
|
return {
|
|
6066
|
-
textContent:
|
|
6066
|
+
textContent: Mc({ filters: l, skippedCount: i }),
|
|
6067
6067
|
structuredContent: {
|
|
6068
6068
|
filters: l,
|
|
6069
6069
|
totalCount: l.length,
|
|
@@ -6076,7 +6076,7 @@ const Pc = s.object({
|
|
|
6076
6076
|
};
|
|
6077
6077
|
}
|
|
6078
6078
|
};
|
|
6079
|
-
function
|
|
6079
|
+
function Mc({
|
|
6080
6080
|
filters: e,
|
|
6081
6081
|
skippedCount: t
|
|
6082
6082
|
}) {
|
|
@@ -6090,52 +6090,52 @@ ${n}`;
|
|
|
6090
6090
|
}
|
|
6091
6091
|
return o;
|
|
6092
6092
|
}
|
|
6093
|
-
function
|
|
6093
|
+
function Fc({ id: e, ...t }) {
|
|
6094
6094
|
return Object.values(t).every((o) => o === void 0) ? "no-fields" : null;
|
|
6095
6095
|
}
|
|
6096
|
-
const
|
|
6096
|
+
const Hc = s.object({
|
|
6097
6097
|
labelType: s.literal("personal").describe("Update a personal label, identified by its ID."),
|
|
6098
6098
|
id: s.string().min(1).describe("The ID of the personal label to update."),
|
|
6099
6099
|
name: s.string().min(1).max(128).optional().describe("The new name of the label."),
|
|
6100
6100
|
color: fe,
|
|
6101
6101
|
order: s.number().int().optional().describe("The new position of the label in the label list."),
|
|
6102
6102
|
isFavorite: s.boolean().optional().describe("Whether to mark the label as a favorite.")
|
|
6103
|
-
}),
|
|
6103
|
+
}), Wc = s.object({
|
|
6104
6104
|
labelType: s.literal("shared").describe(
|
|
6105
6105
|
"Rename a shared label across all tasks. Shared labels are identified by name; only renaming is supported (no color, order, or favorite)."
|
|
6106
6106
|
),
|
|
6107
6107
|
name: s.string().min(1).describe("The current name of the shared label."),
|
|
6108
6108
|
newName: s.string().min(1).describe("The new name for the shared label.")
|
|
6109
|
-
}),
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
]),
|
|
6113
|
-
labels: s.array(
|
|
6109
|
+
}), Bc = s.discriminatedUnion("labelType", [
|
|
6110
|
+
Hc,
|
|
6111
|
+
Wc
|
|
6112
|
+
]), zc = {
|
|
6113
|
+
labels: s.array(Bc).min(1).describe(
|
|
6114
6114
|
'The labels to update. Use labelType="personal" with an ID to update a personal label, or labelType="shared" with name+newName to rename a shared label.'
|
|
6115
6115
|
)
|
|
6116
|
-
},
|
|
6116
|
+
}, Kc = s.object({
|
|
6117
6117
|
name: s.string().describe("The previous name of the shared label."),
|
|
6118
6118
|
newName: s.string().describe("The new name of the shared label.")
|
|
6119
|
-
}),
|
|
6119
|
+
}), qc = {
|
|
6120
6120
|
updatedLabels: s.array(ge).describe("The updated personal labels."),
|
|
6121
|
-
renamedSharedLabels: s.array(
|
|
6121
|
+
renamedSharedLabels: s.array(Kc).describe("The shared labels that were renamed."),
|
|
6122
6122
|
totalCount: s.number().describe("The total number of successful operations (personal + shared)."),
|
|
6123
6123
|
appliedOperations: s.object({
|
|
6124
6124
|
updateCount: s.number().describe("Number of personal labels updated."),
|
|
6125
6125
|
renameCount: s.number().describe("Number of shared labels renamed."),
|
|
6126
6126
|
skippedCount: s.number().describe("Number of operations skipped (no changes or shared label not found).")
|
|
6127
6127
|
}).describe("Summary of operations performed.")
|
|
6128
|
-
},
|
|
6128
|
+
}, Yc = {
|
|
6129
6129
|
name: g.UPDATE_LABELS,
|
|
6130
6130
|
description: "Update one or more existing labels. Personal labels (identified by ID) can have their name, color, order, and favorite flag updated. Shared labels (identified by name) can only be renamed.",
|
|
6131
|
-
parameters:
|
|
6132
|
-
outputSchema:
|
|
6131
|
+
parameters: zc,
|
|
6132
|
+
outputSchema: qc,
|
|
6133
6133
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
6134
6134
|
async execute(e, t) {
|
|
6135
6135
|
const { labels: r } = e, o = await Promise.all(
|
|
6136
6136
|
r.map(async (l) => {
|
|
6137
6137
|
if (l.labelType === "personal") {
|
|
6138
|
-
const h =
|
|
6138
|
+
const h = Vc(l);
|
|
6139
6139
|
if (h !== null) return { kind: "skipped", reason: h };
|
|
6140
6140
|
const { id: m, labelType: y, ...f } = l;
|
|
6141
6141
|
return { kind: "updated", label: await t.updateLabel(m, f) };
|
|
@@ -6153,7 +6153,7 @@ const Fc = s.object({
|
|
|
6153
6153
|
(l) => l.kind === "skipped" && l.reason === "not-found"
|
|
6154
6154
|
).length;
|
|
6155
6155
|
return {
|
|
6156
|
-
textContent:
|
|
6156
|
+
textContent: Gc({
|
|
6157
6157
|
updatedLabels: n,
|
|
6158
6158
|
renamedSharedLabels: i,
|
|
6159
6159
|
skippedNoFields: c,
|
|
@@ -6172,7 +6172,7 @@ const Fc = s.object({
|
|
|
6172
6172
|
};
|
|
6173
6173
|
}
|
|
6174
6174
|
};
|
|
6175
|
-
function
|
|
6175
|
+
function Gc({
|
|
6176
6176
|
updatedLabels: e,
|
|
6177
6177
|
renamedSharedLabels: t,
|
|
6178
6178
|
skippedNoFields: r,
|
|
@@ -6194,14 +6194,14 @@ function Yc({
|
|
|
6194
6194
|
return c.join(`
|
|
6195
6195
|
`);
|
|
6196
6196
|
}
|
|
6197
|
-
function
|
|
6197
|
+
function Vc({
|
|
6198
6198
|
id: e,
|
|
6199
6199
|
labelType: t,
|
|
6200
6200
|
...r
|
|
6201
6201
|
}) {
|
|
6202
6202
|
return Object.values(r).every((n) => n === void 0) ? "no-fields" : null;
|
|
6203
6203
|
}
|
|
6204
|
-
const
|
|
6204
|
+
const Jc = s.object({
|
|
6205
6205
|
id: s.string().min(1).describe("The ID of the project to update."),
|
|
6206
6206
|
name: s.string().min(1).optional().describe("The new name of the project."),
|
|
6207
6207
|
isFavorite: s.boolean().optional().describe("Whether the project is a favorite."),
|
|
@@ -6216,9 +6216,9 @@ const Vc = s.object({
|
|
|
6216
6216
|
)
|
|
6217
6217
|
).optional(),
|
|
6218
6218
|
color: fe
|
|
6219
|
-
}),
|
|
6220
|
-
projects: s.array(
|
|
6221
|
-
},
|
|
6219
|
+
}), Xc = {
|
|
6220
|
+
projects: s.array(Jc).min(1).describe("The projects to update.")
|
|
6221
|
+
}, Qc = {
|
|
6222
6222
|
projects: s.array(re).describe("The updated projects."),
|
|
6223
6223
|
totalCount: s.number().describe("The total number of projects updated."),
|
|
6224
6224
|
updatedProjectIds: s.array(s.string()).describe("The IDs of the updated projects."),
|
|
@@ -6230,16 +6230,16 @@ const Vc = s.object({
|
|
|
6230
6230
|
skippedCount: s.number().describe("The number of projects skipped (no changes)."),
|
|
6231
6231
|
failureCount: s.number().describe("The number of projects that failed to update.")
|
|
6232
6232
|
}).describe("Summary of operations performed.")
|
|
6233
|
-
},
|
|
6233
|
+
}, Zc = {
|
|
6234
6234
|
name: g.UPDATE_PROJECTS,
|
|
6235
6235
|
description: "Update multiple existing projects with new values.",
|
|
6236
|
-
parameters:
|
|
6237
|
-
outputSchema:
|
|
6236
|
+
parameters: Xc,
|
|
6237
|
+
outputSchema: Qc,
|
|
6238
6238
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
6239
6239
|
async execute(e, t) {
|
|
6240
6240
|
const { projects: r } = e, o = await Promise.allSettled(
|
|
6241
6241
|
r.map(async (u) => {
|
|
6242
|
-
const l =
|
|
6242
|
+
const l = td(u);
|
|
6243
6243
|
if (l !== null) return { kind: "skipped", reason: l };
|
|
6244
6244
|
const { id: p, ...h } = u;
|
|
6245
6245
|
return { kind: "updated", project: await _(() => t.updateProject(p, h)) };
|
|
@@ -6257,7 +6257,7 @@ const Vc = s.object({
|
|
|
6257
6257
|
l.value.kind === "updated" ? n.push(se(l.value.project)) : l.value.reason === "no-fields" ? a++ : c++;
|
|
6258
6258
|
}
|
|
6259
6259
|
return ne(g.UPDATE_PROJECTS, r.length, i), {
|
|
6260
|
-
textContent:
|
|
6260
|
+
textContent: ed({
|
|
6261
6261
|
projects: n,
|
|
6262
6262
|
skippedNoFields: a,
|
|
6263
6263
|
skippedNoValidValues: c,
|
|
@@ -6277,7 +6277,7 @@ const Vc = s.object({
|
|
|
6277
6277
|
};
|
|
6278
6278
|
}
|
|
6279
6279
|
};
|
|
6280
|
-
function
|
|
6280
|
+
function ed({
|
|
6281
6281
|
projects: e,
|
|
6282
6282
|
skippedNoFields: t,
|
|
6283
6283
|
skippedNoValidValues: r,
|
|
@@ -6290,49 +6290,49 @@ function Zc({
|
|
|
6290
6290
|
return t > 0 && c.push(`${t} skipped - no changes`), r > 0 && c.push(`${r} skipped - no valid field values`), c.length > 0 && (a += ` (${c.join(", ")})`), n > 0 && (a += `:
|
|
6291
6291
|
${i}`), mt(a, o);
|
|
6292
6292
|
}
|
|
6293
|
-
function
|
|
6293
|
+
function td({ id: e, ...t }) {
|
|
6294
6294
|
const r = Object.values(t);
|
|
6295
6295
|
return r.length === 0 ? "no-fields" : r.every((o) => o === void 0) ? "no-valid-values" : null;
|
|
6296
6296
|
}
|
|
6297
|
-
const
|
|
6297
|
+
const sd = s.object({
|
|
6298
6298
|
type: s.literal("relative"),
|
|
6299
6299
|
id: s.string().min(1).describe("The ID of the relative reminder to update."),
|
|
6300
6300
|
minuteOffset: s.number().int().min(0).optional().describe("New minute offset before task due time."),
|
|
6301
6301
|
service: Ee.optional().describe('New delivery method: "email" or "push".'),
|
|
6302
6302
|
isUrgent: Oe
|
|
6303
|
-
}),
|
|
6303
|
+
}), rd = s.object({
|
|
6304
6304
|
type: s.literal("absolute"),
|
|
6305
6305
|
id: s.string().min(1).describe("The ID of the absolute reminder to update."),
|
|
6306
|
-
due:
|
|
6306
|
+
due: Ss.optional().describe("New due date/time for the reminder."),
|
|
6307
6307
|
service: Ee.optional().describe('New delivery method: "email" or "push".'),
|
|
6308
6308
|
isUrgent: Oe
|
|
6309
|
-
}),
|
|
6309
|
+
}), od = s.object({
|
|
6310
6310
|
type: s.literal("location"),
|
|
6311
6311
|
id: s.string().min(1).describe("The ID of the location reminder to update."),
|
|
6312
6312
|
name: s.string().optional().describe("New location name."),
|
|
6313
6313
|
locLat: s.string().optional().describe("New latitude."),
|
|
6314
6314
|
locLong: s.string().optional().describe("New longitude."),
|
|
6315
|
-
locTrigger:
|
|
6315
|
+
locTrigger: Cs.optional().describe(
|
|
6316
6316
|
'New trigger condition: "on_enter" or "on_leave".'
|
|
6317
6317
|
),
|
|
6318
6318
|
radius: s.number().int().optional().describe("New radius in meters.")
|
|
6319
|
-
}),
|
|
6320
|
-
td,
|
|
6319
|
+
}), nd = s.discriminatedUnion("type", [
|
|
6321
6320
|
sd,
|
|
6322
|
-
rd
|
|
6323
|
-
|
|
6324
|
-
|
|
6321
|
+
rd,
|
|
6322
|
+
od
|
|
6323
|
+
]), id = {
|
|
6324
|
+
reminders: s.array(nd).min(1).max(je).describe(
|
|
6325
6325
|
`Array of reminders to update (max ${je}). Each must include the reminder type and ID. Only include fields that need to change.`
|
|
6326
6326
|
)
|
|
6327
|
-
},
|
|
6327
|
+
}, ad = {
|
|
6328
6328
|
reminders: s.array(lt).describe("The updated reminders."),
|
|
6329
6329
|
totalCount: s.number().describe("Total reminders updated."),
|
|
6330
6330
|
updatedReminderIds: s.array(s.string()).describe("IDs of updated reminders.")
|
|
6331
|
-
},
|
|
6331
|
+
}, cd = {
|
|
6332
6332
|
name: g.UPDATE_REMINDERS,
|
|
6333
6333
|
description: 'Update existing reminders. Each reminder must specify its type ("relative", "absolute", or "location") and ID. Only include fields that need to change.',
|
|
6334
|
-
parameters:
|
|
6335
|
-
outputSchema:
|
|
6334
|
+
parameters: id,
|
|
6335
|
+
outputSchema: ad,
|
|
6336
6336
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !0 },
|
|
6337
6337
|
async execute(e, t) {
|
|
6338
6338
|
const { reminders: r } = e, o = r.map(async (d) => {
|
|
@@ -6366,7 +6366,7 @@ const td = s.object({
|
|
|
6366
6366
|
}
|
|
6367
6367
|
};
|
|
6368
6368
|
}
|
|
6369
|
-
},
|
|
6369
|
+
}, dd = s.object({
|
|
6370
6370
|
id: s.string().min(1).describe("The ID of the section to update."),
|
|
6371
6371
|
name: s.string().min(1).optional().describe("The new name of the section."),
|
|
6372
6372
|
description: s.preprocess(
|
|
@@ -6381,17 +6381,17 @@ const td = s.object({
|
|
|
6381
6381
|
).optional()
|
|
6382
6382
|
}).refine((e) => e.name !== void 0 || e.description !== void 0, {
|
|
6383
6383
|
message: 'Provide at least one of "name" or "description" to update.'
|
|
6384
|
-
}),
|
|
6385
|
-
sections: s.array(
|
|
6386
|
-
},
|
|
6384
|
+
}), ld = {
|
|
6385
|
+
sections: s.array(dd).min(1).describe("The sections to update.")
|
|
6386
|
+
}, ud = {
|
|
6387
6387
|
sections: s.array(Y).describe("The updated sections."),
|
|
6388
6388
|
totalCount: s.number().describe("The total number of sections updated."),
|
|
6389
6389
|
updatedSectionIds: s.array(s.string()).describe("The IDs of the updated sections.")
|
|
6390
|
-
},
|
|
6390
|
+
}, pd = {
|
|
6391
6391
|
name: g.UPDATE_SECTIONS,
|
|
6392
6392
|
description: "Update multiple existing sections with new values.",
|
|
6393
|
-
parameters:
|
|
6394
|
-
outputSchema:
|
|
6393
|
+
parameters: ld,
|
|
6394
|
+
outputSchema: ud,
|
|
6395
6395
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
6396
6396
|
async execute({ sections: e }, t) {
|
|
6397
6397
|
const r = await Promise.all(
|
|
@@ -6404,7 +6404,7 @@ const td = s.object({
|
|
|
6404
6404
|
})
|
|
6405
6405
|
);
|
|
6406
6406
|
return {
|
|
6407
|
-
textContent:
|
|
6407
|
+
textContent: hd({
|
|
6408
6408
|
sections: r
|
|
6409
6409
|
}),
|
|
6410
6410
|
structuredContent: {
|
|
@@ -6415,36 +6415,36 @@ const td = s.object({
|
|
|
6415
6415
|
};
|
|
6416
6416
|
}
|
|
6417
6417
|
};
|
|
6418
|
-
function
|
|
6418
|
+
function hd({ sections: e }) {
|
|
6419
6419
|
const t = e.length, r = e.map((n) => `• ${n.name} (id=${n.id}, projectId=${n.projectId})`).join(`
|
|
6420
6420
|
`);
|
|
6421
6421
|
return `Updated ${t} section${t === 1 ? "" : "s"}:
|
|
6422
6422
|
${r}`;
|
|
6423
6423
|
}
|
|
6424
|
-
function
|
|
6424
|
+
function Fs(e, t) {
|
|
6425
6425
|
return t.projectId !== void 0 ? e.projectId === t.projectId && !e.sectionId && !e.parentId : t.sectionId !== void 0 ? e.sectionId === t.sectionId && !e.parentId : e.parentId === t.parentId;
|
|
6426
6426
|
}
|
|
6427
|
-
function
|
|
6427
|
+
function md(e, t) {
|
|
6428
6428
|
return t.projectId !== void 0 ? e.projectId === t.projectId : t.sectionId !== void 0 ? e.sectionId === t.sectionId : e.parentId === t.parentId;
|
|
6429
6429
|
}
|
|
6430
|
-
function
|
|
6430
|
+
function fd(e) {
|
|
6431
6431
|
return e.projectId !== void 0 ? `project:${e.projectId}` : e.sectionId !== void 0 ? `section:${e.sectionId}` : `parent:${e.parentId}`;
|
|
6432
6432
|
}
|
|
6433
|
-
function
|
|
6433
|
+
function bd(e) {
|
|
6434
6434
|
const t = [];
|
|
6435
6435
|
return e.projectId && t.push({ projectId: e.projectId }), e.sectionId && t.push({ sectionId: e.sectionId }), e.parentId && t.push({ parentId: e.parentId }), t;
|
|
6436
6436
|
}
|
|
6437
|
-
function
|
|
6437
|
+
function gd({
|
|
6438
6438
|
taskId: e,
|
|
6439
6439
|
request: t,
|
|
6440
6440
|
current: r
|
|
6441
6441
|
}) {
|
|
6442
|
-
const o =
|
|
6442
|
+
const o = bd(t);
|
|
6443
6443
|
if (o.length === 0)
|
|
6444
6444
|
return { redundantMoveSkipped: !1 };
|
|
6445
6445
|
let n = o, i = !1;
|
|
6446
6446
|
if (r) {
|
|
6447
|
-
const a = o.length === 1 ? (c) =>
|
|
6447
|
+
const a = o.length === 1 ? (c) => Fs(r, c) : (c) => md(r, c);
|
|
6448
6448
|
n = o.filter((c) => !a(c)), i = n.length < o.length;
|
|
6449
6449
|
}
|
|
6450
6450
|
if (n.length === 0)
|
|
@@ -6455,7 +6455,7 @@ function bd({
|
|
|
6455
6455
|
);
|
|
6456
6456
|
return { move: n[0], redundantMoveSkipped: i };
|
|
6457
6457
|
}
|
|
6458
|
-
const
|
|
6458
|
+
const yd = s.object({
|
|
6459
6459
|
id: s.string().min(1).describe("The ID of the task to update."),
|
|
6460
6460
|
content: s.string().optional().describe(
|
|
6461
6461
|
'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.'
|
|
@@ -6500,9 +6500,9 @@ const gd = s.object({
|
|
|
6500
6500
|
isUncompletable: s.boolean().optional().describe(
|
|
6501
6501
|
"Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
|
|
6502
6502
|
)
|
|
6503
|
-
}),
|
|
6504
|
-
tasks: s.array(
|
|
6505
|
-
},
|
|
6503
|
+
}), Td = (e) => !!(e.projectId || e.sectionId || e.parentId), Hs = (e) => Object.keys(e).length > 0, kd = ["remove", "no date"], wd = ["remove", "no date", "no deadline"], vd = "no date", et = os.TASKS_PER_OPERATION, Kt = {
|
|
6504
|
+
tasks: s.array(yd).min(1).max(et).describe(`The tasks to update (max ${et}).`)
|
|
6505
|
+
}, Id = {
|
|
6506
6506
|
tasks: s.array(K).describe("The updated tasks."),
|
|
6507
6507
|
totalCount: s.number().describe("The total number of tasks updated."),
|
|
6508
6508
|
updatedTaskIds: s.array(s.string()).describe("The IDs of the updated tasks."),
|
|
@@ -6517,38 +6517,38 @@ const gd = s.object({
|
|
|
6517
6517
|
"Moves not performed because the task was already in the requested destination. A non-zero count means container fields were sent that did not need to be."
|
|
6518
6518
|
)
|
|
6519
6519
|
}).describe("Summary of operations performed.")
|
|
6520
|
-
},
|
|
6520
|
+
}, Sd = {
|
|
6521
6521
|
name: g.UPDATE_TASKS,
|
|
6522
6522
|
description: "Update existing tasks including content, dates, priorities, and assignments. Send only the fields that change.",
|
|
6523
6523
|
parameters: Kt,
|
|
6524
|
-
outputSchema:
|
|
6524
|
+
outputSchema: Id,
|
|
6525
6525
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
6526
6526
|
async execute(e, t) {
|
|
6527
6527
|
const { tasks: r } = s.object(Kt).parse(e), o = r.map(() => ({ kind: "skipped" })), n = (k, b) => {
|
|
6528
6528
|
o[k] = { kind: "failed", error: b };
|
|
6529
6529
|
}, i = (k, b) => {
|
|
6530
6530
|
n(k, N(b));
|
|
6531
|
-
}, a = r.map((k, b) => ({ task: k, index: b })).filter(({ task: k }) =>
|
|
6531
|
+
}, a = r.map((k, b) => ({ task: k, index: b })).filter(({ task: k }) => _d(k)), c = await jd(
|
|
6532
6532
|
a.map(({ task: k }) => k),
|
|
6533
6533
|
t
|
|
6534
6534
|
), d = await Promise.allSettled(
|
|
6535
|
-
a.map(({ task: k, index: b }) =>
|
|
6535
|
+
a.map(({ task: k, index: b }) => xd({ task: k, index: b, client: t, inbox: c }))
|
|
6536
6536
|
), u = [];
|
|
6537
6537
|
for (const [k, b] of d.entries()) {
|
|
6538
6538
|
const S = a[k]?.index ?? k;
|
|
6539
6539
|
b.status === "fulfilled" ? u.push(b.value) : i(S, b.reason);
|
|
6540
6540
|
}
|
|
6541
|
-
const l = await
|
|
6541
|
+
const l = await Ws({
|
|
6542
6542
|
client: t,
|
|
6543
6543
|
ids: [
|
|
6544
6544
|
...new Set(
|
|
6545
|
-
u.filter((k) =>
|
|
6545
|
+
u.filter((k) => Td(k.moveRequest)).map((k) => k.id)
|
|
6546
6546
|
)
|
|
6547
6547
|
]
|
|
6548
6548
|
}), p = [];
|
|
6549
6549
|
for (const k of u)
|
|
6550
6550
|
try {
|
|
6551
|
-
const b =
|
|
6551
|
+
const b = gd({
|
|
6552
6552
|
taskId: k.id,
|
|
6553
6553
|
request: k.moveRequest,
|
|
6554
6554
|
current: l.get(k.id)
|
|
@@ -6560,7 +6560,7 @@ const gd = s.object({
|
|
|
6560
6560
|
const h = /* @__PURE__ */ new Map(), m = [], y = (k) => {
|
|
6561
6561
|
const b = k.filter((S) => !S.failed);
|
|
6562
6562
|
b.length !== 0 && m.push(
|
|
6563
|
-
|
|
6563
|
+
Dd({
|
|
6564
6564
|
client: t,
|
|
6565
6565
|
items: b,
|
|
6566
6566
|
onUpdated: (S, A) => {
|
|
@@ -6581,7 +6581,7 @@ const gd = s.object({
|
|
|
6581
6581
|
})
|
|
6582
6582
|
);
|
|
6583
6583
|
}, f = new Set(p.map(({ item: k }) => k.index));
|
|
6584
|
-
y(u.filter((k) => !f.has(k.index))), await
|
|
6584
|
+
y(u.filter((k) => !f.has(k.index))), await $d({
|
|
6585
6585
|
client: t,
|
|
6586
6586
|
moving: p,
|
|
6587
6587
|
results: h,
|
|
@@ -6599,14 +6599,14 @@ const gd = s.object({
|
|
|
6599
6599
|
}
|
|
6600
6600
|
}), await Promise.all(m);
|
|
6601
6601
|
for (const k of u) {
|
|
6602
|
-
if (k.failed ||
|
|
6602
|
+
if (k.failed || Hs(k.updateArgs))
|
|
6603
6603
|
continue;
|
|
6604
6604
|
const b = h.get(k.index);
|
|
6605
6605
|
b && "task" in b && (o[k.index] = { kind: "updated", task: b.task });
|
|
6606
6606
|
}
|
|
6607
|
-
const { updatedTasks: w, failures: C, skippedCount: D } =
|
|
6607
|
+
const { updatedTasks: w, failures: C, skippedCount: D } = Cd({ tasks: r, outcomes: o }), T = u.filter((k) => k.redundantMoveSkipped).length, I = w.map(P);
|
|
6608
6608
|
return ne(g.UPDATE_TASKS, r.length, C), {
|
|
6609
|
-
textContent:
|
|
6609
|
+
textContent: Od({
|
|
6610
6610
|
tasks: I,
|
|
6611
6611
|
failures: C,
|
|
6612
6612
|
skippedCount: D,
|
|
@@ -6627,7 +6627,7 @@ const gd = s.object({
|
|
|
6627
6627
|
};
|
|
6628
6628
|
}
|
|
6629
6629
|
};
|
|
6630
|
-
function
|
|
6630
|
+
function Cd({ tasks: e, outcomes: t }) {
|
|
6631
6631
|
const r = [], o = [];
|
|
6632
6632
|
let n = 0;
|
|
6633
6633
|
for (const [i, a] of t.entries()) {
|
|
@@ -6644,7 +6644,7 @@ function Sd({ tasks: e, outcomes: t }) {
|
|
|
6644
6644
|
}
|
|
6645
6645
|
return { updatedTasks: r, failures: o, skippedCount: n };
|
|
6646
6646
|
}
|
|
6647
|
-
async function
|
|
6647
|
+
async function jd(e, t) {
|
|
6648
6648
|
if (!e.some((r) => B(r.projectId)))
|
|
6649
6649
|
return {};
|
|
6650
6650
|
try {
|
|
@@ -6653,7 +6653,7 @@ async function Cd(e, t) {
|
|
|
6653
6653
|
return { error: r };
|
|
6654
6654
|
}
|
|
6655
6655
|
}
|
|
6656
|
-
async function
|
|
6656
|
+
async function Ws({
|
|
6657
6657
|
client: e,
|
|
6658
6658
|
ids: t
|
|
6659
6659
|
}) {
|
|
@@ -6671,7 +6671,7 @@ async function Hs({
|
|
|
6671
6671
|
}
|
|
6672
6672
|
return r;
|
|
6673
6673
|
}
|
|
6674
|
-
async function
|
|
6674
|
+
async function $d({
|
|
6675
6675
|
client: e,
|
|
6676
6676
|
moving: t,
|
|
6677
6677
|
results: r,
|
|
@@ -6681,10 +6681,10 @@ async function jd({
|
|
|
6681
6681
|
return;
|
|
6682
6682
|
const n = /* @__PURE__ */ new Map();
|
|
6683
6683
|
for (const c of t) {
|
|
6684
|
-
const d =
|
|
6684
|
+
const d = fd(c.move), u = n.get(d);
|
|
6685
6685
|
u ? u.push(c) : n.set(d, [c]);
|
|
6686
6686
|
}
|
|
6687
|
-
const i =
|
|
6687
|
+
const i = Pr(e), a = [];
|
|
6688
6688
|
for (const c of n.values()) {
|
|
6689
6689
|
const d = [...new Set(c.map(({ item: p }) => p.id))], u = c[0]?.move, l = c.length === 1 ? c[0] : void 0;
|
|
6690
6690
|
try {
|
|
@@ -6712,22 +6712,22 @@ async function jd({
|
|
|
6712
6712
|
}
|
|
6713
6713
|
}
|
|
6714
6714
|
if (a.length > 0) {
|
|
6715
|
-
await
|
|
6715
|
+
await Ad({ client: e, unresolved: a, results: r });
|
|
6716
6716
|
for (const { group: c } of a)
|
|
6717
6717
|
o(c);
|
|
6718
6718
|
}
|
|
6719
6719
|
}
|
|
6720
|
-
async function
|
|
6720
|
+
async function Ad({
|
|
6721
6721
|
client: e,
|
|
6722
6722
|
unresolved: t,
|
|
6723
6723
|
results: r
|
|
6724
6724
|
}) {
|
|
6725
|
-
const o = [...new Set(t.flatMap(({ group: i }) => i.map(({ item: a }) => a.id)))], n = await
|
|
6725
|
+
const o = [...new Set(t.flatMap(({ group: i }) => i.map(({ item: a }) => a.id)))], n = await Ws({ client: e, ids: o });
|
|
6726
6726
|
for (const { group: i, destination: a, error: c } of t) {
|
|
6727
6727
|
const d = c === void 0 ? "Task not returned by the move" : N(c);
|
|
6728
6728
|
for (const { item: u } of i) {
|
|
6729
6729
|
const l = n.get(u.id);
|
|
6730
|
-
if (l &&
|
|
6730
|
+
if (l && Fs(l, a)) {
|
|
6731
6731
|
r.set(u.index, { task: l });
|
|
6732
6732
|
continue;
|
|
6733
6733
|
}
|
|
@@ -6735,15 +6735,15 @@ async function $d({
|
|
|
6735
6735
|
}
|
|
6736
6736
|
}
|
|
6737
6737
|
}
|
|
6738
|
-
async function
|
|
6738
|
+
async function Dd({
|
|
6739
6739
|
client: e,
|
|
6740
6740
|
items: t,
|
|
6741
6741
|
onUpdated: r,
|
|
6742
6742
|
onFailed: o
|
|
6743
6743
|
}) {
|
|
6744
|
-
const n =
|
|
6744
|
+
const n = Ur(e);
|
|
6745
6745
|
await Promise.all(
|
|
6746
|
-
t.filter((i) =>
|
|
6746
|
+
t.filter((i) => Hs(i.updateArgs)).map(async (i) => {
|
|
6747
6747
|
try {
|
|
6748
6748
|
const a = await n(
|
|
6749
6749
|
() => _(() => e.updateTask(i.id, i.updateArgs))
|
|
@@ -6755,7 +6755,7 @@ async function Ad({
|
|
|
6755
6755
|
})
|
|
6756
6756
|
);
|
|
6757
6757
|
}
|
|
6758
|
-
async function
|
|
6758
|
+
async function xd({
|
|
6759
6759
|
task: e,
|
|
6760
6760
|
index: t,
|
|
6761
6761
|
client: r,
|
|
@@ -6781,17 +6781,17 @@ async function Dd({
|
|
|
6781
6781
|
...y,
|
|
6782
6782
|
...h !== void 0 && { labels: h }
|
|
6783
6783
|
};
|
|
6784
|
-
p && (w.priority =
|
|
6784
|
+
p && (w.priority = ps(p));
|
|
6785
6785
|
const C = qt(
|
|
6786
6786
|
d,
|
|
6787
|
-
|
|
6788
|
-
|
|
6787
|
+
kd,
|
|
6788
|
+
vd
|
|
6789
6789
|
);
|
|
6790
6790
|
C !== void 0 && (w = { ...w, dueString: C });
|
|
6791
|
-
const D = qt(m,
|
|
6791
|
+
const D = qt(m, wd, null);
|
|
6792
6792
|
if (D !== void 0 && (w = { ...w, deadlineDate: D }), u)
|
|
6793
6793
|
try {
|
|
6794
|
-
const { minutes: T } =
|
|
6794
|
+
const { minutes: T } = us(u);
|
|
6795
6795
|
w = {
|
|
6796
6796
|
...w,
|
|
6797
6797
|
duration: T,
|
|
@@ -6802,7 +6802,7 @@ async function Dd({
|
|
|
6802
6802
|
}
|
|
6803
6803
|
return l !== void 0 && (w = {
|
|
6804
6804
|
...w,
|
|
6805
|
-
assigneeId: await
|
|
6805
|
+
assigneeId: await Ed(r, n, l)
|
|
6806
6806
|
}), {
|
|
6807
6807
|
index: t,
|
|
6808
6808
|
id: n,
|
|
@@ -6816,7 +6816,7 @@ async function Dd({
|
|
|
6816
6816
|
failed: !1
|
|
6817
6817
|
};
|
|
6818
6818
|
}
|
|
6819
|
-
async function
|
|
6819
|
+
async function Ed(e, t, r) {
|
|
6820
6820
|
if (r === null || r === "unassign")
|
|
6821
6821
|
return null;
|
|
6822
6822
|
const o = await ft.validateTaskUpdateAssignment(
|
|
@@ -6830,7 +6830,7 @@ async function xd(e, t, r) {
|
|
|
6830
6830
|
}
|
|
6831
6831
|
return o.resolvedUser?.userId;
|
|
6832
6832
|
}
|
|
6833
|
-
function
|
|
6833
|
+
function Od({
|
|
6834
6834
|
tasks: e,
|
|
6835
6835
|
failures: t,
|
|
6836
6836
|
skippedCount: r,
|
|
@@ -6851,7 +6851,7 @@ function Ed({
|
|
|
6851
6851
|
Failed (${t.length}) - address or drop these items:
|
|
6852
6852
|
${u}${l}`;
|
|
6853
6853
|
}
|
|
6854
|
-
function
|
|
6854
|
+
function _d({ id: e, ...t }) {
|
|
6855
6855
|
return Object.keys(t).length > 0;
|
|
6856
6856
|
}
|
|
6857
6857
|
function qt(e, t, r) {
|
|
@@ -6862,7 +6862,7 @@ function qt(e, t, r) {
|
|
|
6862
6862
|
const o = e.trim().toLowerCase();
|
|
6863
6863
|
return t.includes(o) ? r : e;
|
|
6864
6864
|
}
|
|
6865
|
-
const
|
|
6865
|
+
const Pd = {}, Ud = {
|
|
6866
6866
|
type: s.literal("user_info").describe("The type of the response."),
|
|
6867
6867
|
userId: s.string().describe("The user ID."),
|
|
6868
6868
|
fullName: s.string().describe("The full name of the user."),
|
|
@@ -6879,36 +6879,36 @@ const _d = {}, Pd = {
|
|
|
6879
6879
|
email: s.string().describe("The email address of the user."),
|
|
6880
6880
|
plan: s.enum(["Todoist Free", "Todoist Pro", "Todoist Business"]).describe("The user plan.")
|
|
6881
6881
|
};
|
|
6882
|
-
function
|
|
6882
|
+
function Rd(e) {
|
|
6883
6883
|
return e.businessAccountId ? "Todoist Business" : e.isPremium ? "Todoist Pro" : "Todoist Free";
|
|
6884
6884
|
}
|
|
6885
|
-
function
|
|
6885
|
+
function Ld(e, t) {
|
|
6886
6886
|
const o = ((e.getDay() || 7) - t + 7) % 7, n = new Date(e);
|
|
6887
6887
|
return n.setDate(e.getDate() - o), n;
|
|
6888
6888
|
}
|
|
6889
|
-
function
|
|
6889
|
+
function Nd(e) {
|
|
6890
6890
|
const t = new Date(e);
|
|
6891
6891
|
return t.setDate(e.getDate() + 6), t;
|
|
6892
6892
|
}
|
|
6893
|
-
function
|
|
6893
|
+
function Md(e) {
|
|
6894
6894
|
const t = new Date(e.getFullYear(), 0, 1), r = (e.getTime() - t.getTime()) / 864e5;
|
|
6895
6895
|
return Math.ceil((r + t.getDay() + 1) / 7);
|
|
6896
6896
|
}
|
|
6897
|
-
function
|
|
6897
|
+
function Fd(e) {
|
|
6898
6898
|
return ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"][e === 7 ? 0 : e] ?? "Unknown";
|
|
6899
6899
|
}
|
|
6900
|
-
function
|
|
6900
|
+
function Hd(e) {
|
|
6901
6901
|
try {
|
|
6902
6902
|
return new Intl.DateTimeFormat("en-US", { timeZone: e }), !0;
|
|
6903
6903
|
} catch {
|
|
6904
6904
|
return !1;
|
|
6905
6905
|
}
|
|
6906
6906
|
}
|
|
6907
|
-
function
|
|
6908
|
-
return
|
|
6907
|
+
function Bs(e) {
|
|
6908
|
+
return Hd(e) ? e : "UTC";
|
|
6909
6909
|
}
|
|
6910
|
-
function
|
|
6911
|
-
const r =
|
|
6910
|
+
function Wd(e, t) {
|
|
6911
|
+
const r = Bs(t);
|
|
6912
6912
|
return e.toLocaleString("en-US", {
|
|
6913
6913
|
timeZone: r,
|
|
6914
6914
|
year: "numeric",
|
|
@@ -6920,8 +6920,8 @@ function Hd(e, t) {
|
|
|
6920
6920
|
hour12: !1
|
|
6921
6921
|
});
|
|
6922
6922
|
}
|
|
6923
|
-
async function
|
|
6924
|
-
const t = await e.getUser(), r = t.tzInfo?.timezone ?? "UTC", o =
|
|
6923
|
+
async function Bd(e) {
|
|
6924
|
+
const t = await e.getUser(), r = t.tzInfo?.timezone ?? "UTC", o = Bs(r), n = /* @__PURE__ */ new Date(), i = Wd(n, o), a = t.startDay ?? 1, c = Fd(a), d = Rd(t), u = new Date(n.toLocaleString("en-US", { timeZone: o })), l = Ld(u, a), p = Nd(l), h = Md(u), y = [
|
|
6925
6925
|
"# User Information",
|
|
6926
6926
|
"",
|
|
6927
6927
|
`**User ID:** ${t.id}`,
|
|
@@ -6963,26 +6963,26 @@ async function Wd(e) {
|
|
|
6963
6963
|
};
|
|
6964
6964
|
return { textContent: y, structuredContent: f };
|
|
6965
6965
|
}
|
|
6966
|
-
const
|
|
6966
|
+
const zd = {
|
|
6967
6967
|
name: g.USER_INFO,
|
|
6968
6968
|
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).",
|
|
6969
|
-
parameters:
|
|
6970
|
-
outputSchema:
|
|
6969
|
+
parameters: Pd,
|
|
6970
|
+
outputSchema: Ud,
|
|
6971
6971
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
6972
6972
|
async execute(e, t) {
|
|
6973
|
-
const r = await
|
|
6973
|
+
const r = await Bd(t);
|
|
6974
6974
|
return {
|
|
6975
6975
|
textContent: r.textContent,
|
|
6976
6976
|
structuredContent: r.structuredContent
|
|
6977
6977
|
};
|
|
6978
6978
|
}
|
|
6979
|
-
}, Yt = 10 * 1024 * 1024,
|
|
6979
|
+
}, Yt = 10 * 1024 * 1024, Kd = /* @__PURE__ */ new Set([
|
|
6980
6980
|
"image/png",
|
|
6981
6981
|
"image/jpeg",
|
|
6982
6982
|
"image/gif",
|
|
6983
6983
|
"image/webp",
|
|
6984
6984
|
"image/svg+xml"
|
|
6985
|
-
]),
|
|
6985
|
+
]), qd = /* @__PURE__ */ new Set([
|
|
6986
6986
|
"text/plain",
|
|
6987
6987
|
"text/csv",
|
|
6988
6988
|
"text/html",
|
|
@@ -6990,7 +6990,7 @@ const Bd = {
|
|
|
6990
6990
|
"application/json",
|
|
6991
6991
|
"application/xml",
|
|
6992
6992
|
"text/xml"
|
|
6993
|
-
]),
|
|
6993
|
+
]), Yd = {
|
|
6994
6994
|
".png": "image/png",
|
|
6995
6995
|
".jpg": "image/jpeg",
|
|
6996
6996
|
".jpeg": "image/jpeg",
|
|
@@ -7005,23 +7005,23 @@ const Bd = {
|
|
|
7005
7005
|
".xml": "application/xml",
|
|
7006
7006
|
".pdf": "application/pdf"
|
|
7007
7007
|
};
|
|
7008
|
-
function Yd(e) {
|
|
7009
|
-
return zd.has(e) ? "image" : Kd.has(e) || e.startsWith("text/") ? "text" : "binary";
|
|
7010
|
-
}
|
|
7011
7008
|
function Gd(e) {
|
|
7012
|
-
return (e
|
|
7009
|
+
return Kd.has(e) ? "image" : qd.has(e) || e.startsWith("text/") ? "text" : "binary";
|
|
7013
7010
|
}
|
|
7014
7011
|
function Vd(e) {
|
|
7012
|
+
return (e.split(";")[0] ?? e).trim().toLowerCase();
|
|
7013
|
+
}
|
|
7014
|
+
function Jd(e) {
|
|
7015
7015
|
try {
|
|
7016
7016
|
const t = new URL(e).pathname, r = t.lastIndexOf(".");
|
|
7017
7017
|
if (r === -1) return;
|
|
7018
7018
|
const o = t.slice(r).toLowerCase();
|
|
7019
|
-
return
|
|
7019
|
+
return Yd[o];
|
|
7020
7020
|
} catch {
|
|
7021
7021
|
return;
|
|
7022
7022
|
}
|
|
7023
7023
|
}
|
|
7024
|
-
function
|
|
7024
|
+
function Xd(e) {
|
|
7025
7025
|
try {
|
|
7026
7026
|
const t = new URL(e).pathname, r = t.lastIndexOf("/");
|
|
7027
7027
|
return r === -1 ? void 0 : t.slice(r + 1) || void 0;
|
|
@@ -7029,21 +7029,21 @@ function Jd(e) {
|
|
|
7029
7029
|
return;
|
|
7030
7030
|
}
|
|
7031
7031
|
}
|
|
7032
|
-
const
|
|
7032
|
+
const Qd = {
|
|
7033
7033
|
fileUrl: s.url().describe(
|
|
7034
7034
|
"The URL of the attachment file to view. Get this from the fileUrl field in a comment's fileAttachment."
|
|
7035
7035
|
)
|
|
7036
|
-
},
|
|
7036
|
+
}, Zd = {
|
|
7037
7037
|
name: g.VIEW_ATTACHMENT,
|
|
7038
7038
|
description: "View a file attachment from a Todoist comment. Pass the fileUrl from a comment's fileAttachment field. Supports images (returned inline), text files (returned as text), and binary files like PDFs (returned as embedded resources).",
|
|
7039
|
-
parameters:
|
|
7039
|
+
parameters: Qd,
|
|
7040
7040
|
annotations: {
|
|
7041
7041
|
readOnlyHint: !0,
|
|
7042
7042
|
destructiveHint: !1,
|
|
7043
7043
|
idempotentHint: !0
|
|
7044
7044
|
},
|
|
7045
7045
|
async execute({ fileUrl: e }, t) {
|
|
7046
|
-
const r = await t.viewAttachment(e), o = r.headers["content-length"], n = o ? Number.parseInt(o, 10) : void 0, i =
|
|
7046
|
+
const r = await t.viewAttachment(e), o = r.headers["content-length"], n = o ? Number.parseInt(o, 10) : void 0, i = Xd(e), a = r.headers["content-type"], c = a ? Vd(a) : void 0, d = c && c !== "application/octet-stream" ? c : Jd(e) ?? c ?? "application/octet-stream";
|
|
7047
7047
|
if (n && n > Yt)
|
|
7048
7048
|
return {
|
|
7049
7049
|
textContent: `Attachment "${i ?? e}" is too large to display inline (${(n / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
|
|
@@ -7053,7 +7053,7 @@ const Xd = {
|
|
|
7053
7053
|
return {
|
|
7054
7054
|
textContent: `Attachment "${i ?? e}" is too large to display inline (${(l / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
|
|
7055
7055
|
};
|
|
7056
|
-
const p =
|
|
7056
|
+
const p = Gd(d), h = [];
|
|
7057
7057
|
return p === "image" ? h.push({
|
|
7058
7058
|
type: "image",
|
|
7059
7059
|
data: u.toString("base64"),
|
|
@@ -7073,77 +7073,77 @@ const Xd = {
|
|
|
7073
7073
|
contentItems: h
|
|
7074
7074
|
};
|
|
7075
7075
|
}
|
|
7076
|
-
},
|
|
7077
|
-
...
|
|
7076
|
+
}, el = {
|
|
7077
|
+
...la,
|
|
7078
7078
|
_meta: {
|
|
7079
7079
|
ui: {
|
|
7080
7080
|
resourceUri: Be
|
|
7081
7081
|
}
|
|
7082
7082
|
}
|
|
7083
|
-
},
|
|
7083
|
+
}, tl = {
|
|
7084
7084
|
// Task management tools
|
|
7085
|
-
addTasks:
|
|
7086
|
-
completeTasks:
|
|
7087
|
-
uncompleteTasks:
|
|
7088
|
-
updateTasks:
|
|
7089
|
-
rescheduleTasks:
|
|
7090
|
-
findTasks:
|
|
7091
|
-
findTasksByDate:
|
|
7092
|
-
findCompletedTasks:
|
|
7085
|
+
addTasks: Bn,
|
|
7086
|
+
completeTasks: Qn,
|
|
7087
|
+
uncompleteTasks: Ac,
|
|
7088
|
+
updateTasks: Sd,
|
|
7089
|
+
rescheduleTasks: wc,
|
|
7090
|
+
findTasks: ga,
|
|
7091
|
+
findTasksByDate: el,
|
|
7092
|
+
findCompletedTasks: Li,
|
|
7093
7093
|
// Project management tools
|
|
7094
|
-
addProjects:
|
|
7095
|
-
updateProjects:
|
|
7096
|
-
findProjects:
|
|
7097
|
-
projectManagement:
|
|
7098
|
-
projectMove:
|
|
7094
|
+
addProjects: Cn,
|
|
7095
|
+
updateProjects: Zc,
|
|
7096
|
+
findProjects: Xi,
|
|
7097
|
+
projectManagement: uc,
|
|
7098
|
+
projectMove: mc,
|
|
7099
7099
|
// Section management tools
|
|
7100
|
-
addSections:
|
|
7101
|
-
updateSections:
|
|
7102
|
-
findSections:
|
|
7100
|
+
addSections: Nn,
|
|
7101
|
+
updateSections: pd,
|
|
7102
|
+
findSections: ia,
|
|
7103
7103
|
// Comment management tools
|
|
7104
|
-
addComments:
|
|
7105
|
-
findComments:
|
|
7106
|
-
updateComments:
|
|
7104
|
+
addComments: Qo,
|
|
7105
|
+
findComments: Ai,
|
|
7106
|
+
updateComments: _c,
|
|
7107
7107
|
// Reminder management tools
|
|
7108
|
-
addReminders:
|
|
7109
|
-
findReminders:
|
|
7110
|
-
updateReminders:
|
|
7108
|
+
addReminders: _n,
|
|
7109
|
+
findReminders: ta,
|
|
7110
|
+
updateReminders: cd,
|
|
7111
7111
|
// Attachment tools
|
|
7112
|
-
viewAttachment:
|
|
7112
|
+
viewAttachment: Zd,
|
|
7113
7113
|
// Label management tools
|
|
7114
|
-
addLabels:
|
|
7115
|
-
updateLabels:
|
|
7116
|
-
findLabels:
|
|
7114
|
+
addLabels: hn,
|
|
7115
|
+
updateLabels: Yc,
|
|
7116
|
+
findLabels: Hi,
|
|
7117
7117
|
// Filter management tools
|
|
7118
|
-
findFilters:
|
|
7119
|
-
addFilters:
|
|
7120
|
-
updateFilters:
|
|
7118
|
+
findFilters: rn,
|
|
7119
|
+
addFilters: dn,
|
|
7120
|
+
updateFilters: Nc,
|
|
7121
7121
|
// Activity and audit tools
|
|
7122
|
-
findActivity:
|
|
7123
|
-
getProductivityStats:
|
|
7122
|
+
findActivity: wi,
|
|
7123
|
+
getProductivityStats: xa,
|
|
7124
7124
|
// Health and insights tools
|
|
7125
|
-
getProjectHealth:
|
|
7126
|
-
getProjectActivityStats:
|
|
7127
|
-
analyzeProjectHealth:
|
|
7128
|
-
getWorkspaceInsights:
|
|
7125
|
+
getProjectHealth: Ha,
|
|
7126
|
+
getProjectActivityStats: Ua,
|
|
7127
|
+
analyzeProjectHealth: Vn,
|
|
7128
|
+
getWorkspaceInsights: Ka,
|
|
7129
7129
|
// General tools
|
|
7130
|
-
getOverview:
|
|
7131
|
-
deleteObject:
|
|
7132
|
-
fetchObject:
|
|
7133
|
-
reorderObjects:
|
|
7134
|
-
userInfo:
|
|
7130
|
+
getOverview: $a,
|
|
7131
|
+
deleteObject: si,
|
|
7132
|
+
fetchObject: mi,
|
|
7133
|
+
reorderObjects: gc,
|
|
7134
|
+
userInfo: zd,
|
|
7135
7135
|
// Assignment and collaboration tools
|
|
7136
|
-
findProjectCollaborators:
|
|
7137
|
-
manageAssignments:
|
|
7136
|
+
findProjectCollaborators: Ki,
|
|
7137
|
+
manageAssignments: cc,
|
|
7138
7138
|
// Template tools
|
|
7139
|
-
exportProjectTemplate:
|
|
7140
|
-
importProjectTemplate:
|
|
7139
|
+
exportProjectTemplate: ni,
|
|
7140
|
+
importProjectTemplate: Ja,
|
|
7141
7141
|
// Workspace tools
|
|
7142
|
-
listWorkspaces:
|
|
7142
|
+
listWorkspaces: sc,
|
|
7143
7143
|
// OpenAI MCP tools
|
|
7144
|
-
search:
|
|
7145
|
-
fetch:
|
|
7146
|
-
},
|
|
7144
|
+
search: Cc,
|
|
7145
|
+
fetch: gi
|
|
7146
|
+
}, sl = Object.values(tl), rl = `
|
|
7147
7147
|
## Todoist Task and Project Management Tools
|
|
7148
7148
|
|
|
7149
7149
|
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.
|
|
@@ -7200,25 +7200,25 @@ Use the **productivity-analysis** prompt for a combined productivity review —
|
|
|
7200
7200
|
|
|
7201
7201
|
Always provide clear, actionable task titles and descriptions. Use the overview tools to give users context about their workload and project status.
|
|
7202
7202
|
`;
|
|
7203
|
-
function
|
|
7203
|
+
function gl({
|
|
7204
7204
|
todoistApiKey: e,
|
|
7205
7205
|
baseUrl: t,
|
|
7206
7206
|
features: r = []
|
|
7207
7207
|
}) {
|
|
7208
|
-
const o = new
|
|
7208
|
+
const o = new Ks(
|
|
7209
7209
|
{ name: "todoist-mcp-server", version: ot },
|
|
7210
7210
|
{
|
|
7211
7211
|
capabilities: {
|
|
7212
7212
|
tools: { listChanged: !0 },
|
|
7213
7213
|
prompts: { listChanged: !0 }
|
|
7214
7214
|
},
|
|
7215
|
-
instructions:
|
|
7215
|
+
instructions: rl
|
|
7216
7216
|
}
|
|
7217
|
-
), n =
|
|
7218
|
-
|
|
7217
|
+
), n = Vr(e, { baseUrl: t });
|
|
7218
|
+
dr(o);
|
|
7219
7219
|
const i = { server: o, client: n, features: r };
|
|
7220
|
-
for (const a of
|
|
7221
|
-
|
|
7220
|
+
for (const a of sl)
|
|
7221
|
+
yo({ tool: a, ...i });
|
|
7222
7222
|
return o.registerPrompt(
|
|
7223
7223
|
ye.name,
|
|
7224
7224
|
{
|
|
@@ -7230,58 +7230,58 @@ function bl({
|
|
|
7230
7230
|
), o;
|
|
7231
7231
|
}
|
|
7232
7232
|
export {
|
|
7233
|
-
|
|
7234
|
-
|
|
7235
|
-
|
|
7236
|
-
|
|
7237
|
-
|
|
7238
|
-
|
|
7239
|
-
|
|
7240
|
-
|
|
7241
|
-
|
|
7242
|
-
|
|
7243
|
-
|
|
7244
|
-
|
|
7245
|
-
|
|
7246
|
-
|
|
7247
|
-
|
|
7248
|
-
|
|
7249
|
-
|
|
7250
|
-
|
|
7251
|
-
|
|
7252
|
-
|
|
7253
|
-
|
|
7254
|
-
|
|
7255
|
-
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
|
|
7261
|
-
|
|
7262
|
-
|
|
7263
|
-
|
|
7264
|
-
|
|
7265
|
-
|
|
7266
|
-
|
|
7267
|
-
|
|
7268
|
-
|
|
7269
|
-
|
|
7270
|
-
|
|
7271
|
-
|
|
7272
|
-
|
|
7273
|
-
|
|
7274
|
-
|
|
7275
|
-
|
|
7276
|
-
|
|
7277
|
-
|
|
7278
|
-
|
|
7279
|
-
|
|
7280
|
-
|
|
7281
|
-
|
|
7282
|
-
|
|
7283
|
-
|
|
7284
|
-
|
|
7285
|
-
|
|
7286
|
-
|
|
7233
|
+
to as $,
|
|
7234
|
+
$a as A,
|
|
7235
|
+
xa as B,
|
|
7236
|
+
Ua as C,
|
|
7237
|
+
Ha as D,
|
|
7238
|
+
Ka as E,
|
|
7239
|
+
bl as F,
|
|
7240
|
+
Ja as G,
|
|
7241
|
+
sc as H,
|
|
7242
|
+
cc as I,
|
|
7243
|
+
uc as J,
|
|
7244
|
+
mc as K,
|
|
7245
|
+
sl as L,
|
|
7246
|
+
gc as M,
|
|
7247
|
+
wc as N,
|
|
7248
|
+
Cc as O,
|
|
7249
|
+
Ac as P,
|
|
7250
|
+
_c as Q,
|
|
7251
|
+
Nc as R,
|
|
7252
|
+
Yc as S,
|
|
7253
|
+
Zc as T,
|
|
7254
|
+
cd as U,
|
|
7255
|
+
pd as V,
|
|
7256
|
+
Sd as W,
|
|
7257
|
+
zd as X,
|
|
7258
|
+
Zd as Y,
|
|
7259
|
+
Vr as Z,
|
|
7260
|
+
Fr as _,
|
|
7261
|
+
Qo as a,
|
|
7262
|
+
dn as b,
|
|
7263
|
+
hn as c,
|
|
7264
|
+
Cn as d,
|
|
7265
|
+
_n as e,
|
|
7266
|
+
Nn as f,
|
|
7267
|
+
gl as g,
|
|
7268
|
+
Bn as h,
|
|
7269
|
+
Vn as i,
|
|
7270
|
+
Qn as j,
|
|
7271
|
+
si as k,
|
|
7272
|
+
ni as l,
|
|
7273
|
+
gi as m,
|
|
7274
|
+
mi as n,
|
|
7275
|
+
wi as o,
|
|
7276
|
+
Ai as p,
|
|
7277
|
+
Li as q,
|
|
7278
|
+
rn as r,
|
|
7279
|
+
Hi as s,
|
|
7280
|
+
tl as t,
|
|
7281
|
+
Ki as u,
|
|
7282
|
+
Xi as v,
|
|
7283
|
+
ta as w,
|
|
7284
|
+
ia as x,
|
|
7285
|
+
ga as y,
|
|
7286
|
+
la as z
|
|
7287
7287
|
};
|