@doist/todoist-mcp 13.2.5 → 13.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/main-http.js +2 -2
- package/dist/main.js +1 -1
- package/dist/{mcp-server-B1r-n81f.js → mcp-server-8HYbbbyS.js} +912 -905
- package/dist/{require-valid-todoist-token-EELznAMG.js → require-valid-todoist-token-Cy3lFEOp.js} +1 -1
- package/dist/tool-helpers.d.ts +2 -0
- package/dist/tool-helpers.d.ts.map +1 -1
- package/dist/tool-registry.d.ts +16 -0
- package/dist/tool-registry.d.ts.map +1 -1
- package/dist/tools/add-tasks.d.ts +2 -0
- package/dist/tools/add-tasks.d.ts.map +1 -1
- package/dist/tools/fetch-object.d.ts +2 -0
- package/dist/tools/fetch-object.d.ts.map +1 -1
- package/dist/tools/fetch.d.ts.map +1 -1
- package/dist/tools/find-completed-tasks.d.ts +2 -0
- package/dist/tools/find-completed-tasks.d.ts.map +1 -1
- package/dist/tools/find-tasks-by-date.d.ts +2 -0
- package/dist/tools/find-tasks-by-date.d.ts.map +1 -1
- package/dist/tools/find-tasks.d.ts +2 -0
- package/dist/tools/find-tasks.d.ts.map +1 -1
- package/dist/tools/import-project-template.d.ts +2 -0
- package/dist/tools/import-project-template.d.ts.map +1 -1
- package/dist/tools/reschedule-tasks.d.ts +2 -0
- package/dist/tools/reschedule-tasks.d.ts.map +1 -1
- package/dist/tools/update-tasks.d.ts +2 -0
- package/dist/tools/update-tasks.d.ts.map +1 -1
- package/dist/utils/output-schemas.d.ts +1 -0
- package/dist/utils/output-schemas.d.ts.map +1 -1
- package/dist/utils/test-helpers.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -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.7", 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 Dr({ 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 && Dr(e.limiters);
|
|
508
508
|
}
|
|
509
509
|
function Ar(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
530
|
return Ar(e, r, t), r;
|
|
531
|
-
if (
|
|
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,14 +840,14 @@ 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
|
-
},
|
|
850
|
-
function
|
|
849
|
+
}, no = process.env.USE_STRUCTURED_CONTENT === "true" || process.env.NODE_ENV === "test", Dt = /* @__PURE__ */ new WeakMap();
|
|
850
|
+
function At(e, t) {
|
|
851
851
|
const r = s.toJSONSchema(e, { target: "draft-2020-12", io: t }), o = e["~standard"];
|
|
852
852
|
return {
|
|
853
853
|
"~standard": {
|
|
@@ -859,58 +859,58 @@ function Dt(e, t) {
|
|
|
859
859
|
}
|
|
860
860
|
};
|
|
861
861
|
}
|
|
862
|
-
function
|
|
863
|
-
const t =
|
|
862
|
+
function io(e) {
|
|
863
|
+
const t = Dt.get(e);
|
|
864
864
|
if (t)
|
|
865
865
|
return t;
|
|
866
866
|
const r = {
|
|
867
|
-
input:
|
|
868
|
-
...e.outputSchema ? { output:
|
|
867
|
+
input: At(s.object(e.parameters), "input"),
|
|
868
|
+
...e.outputSchema ? { output: At(s.object(e.outputSchema), "output") } : {}
|
|
869
869
|
};
|
|
870
|
-
return
|
|
870
|
+
return Dt.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, Do = 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,13 +1180,13 @@ 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
|
-
),
|
|
1185
|
+
hs
|
|
1186
|
+
), le = new ms(
|
|
1187
|
+
Do,
|
|
1188
|
+
hs
|
|
1189
|
+
), fs = "me";
|
|
1190
1190
|
class Ao {
|
|
1191
1191
|
/**
|
|
1192
1192
|
* Resolve a user name or ID to a user ID by looking up collaborators across all shared projects.
|
|
@@ -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 {
|
|
@@ -1323,10 +1323,10 @@ class Ao {
|
|
|
1323
1323
|
}
|
|
1324
1324
|
}
|
|
1325
1325
|
const H = new Ao();
|
|
1326
|
-
async function
|
|
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,14 +1467,17 @@ 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
|
+
// Only emitted when true: a deleted task is the exception, and every list
|
|
1479
|
+
// response would otherwise carry `isDeleted: false` on every task.
|
|
1480
|
+
isDeleted: e.isDeleted || void 0,
|
|
1478
1481
|
checked: e.checked,
|
|
1479
1482
|
completedAt: e.completedAt?.toISOString() ?? void 0,
|
|
1480
1483
|
addedAt: e.addedAt?.toISOString() ?? void 0
|
|
@@ -1522,7 +1525,7 @@ function we(e) {
|
|
|
1522
1525
|
} : void 0
|
|
1523
1526
|
};
|
|
1524
1527
|
}
|
|
1525
|
-
function
|
|
1528
|
+
function No(e) {
|
|
1526
1529
|
return {
|
|
1527
1530
|
id: e.id ?? void 0,
|
|
1528
1531
|
objectType: e.objectType,
|
|
@@ -1535,7 +1538,7 @@ function Lo(e) {
|
|
|
1535
1538
|
extraData: e.extraData ?? void 0
|
|
1536
1539
|
};
|
|
1537
1540
|
}
|
|
1538
|
-
const
|
|
1541
|
+
const Mo = ce.object({
|
|
1539
1542
|
httpStatusCode: ce.number(),
|
|
1540
1543
|
responseData: ce.object({
|
|
1541
1544
|
error: ce.string(),
|
|
@@ -1543,7 +1546,7 @@ const No = ce.object({
|
|
|
1543
1546
|
errorTag: ce.string()
|
|
1544
1547
|
})
|
|
1545
1548
|
});
|
|
1546
|
-
function
|
|
1549
|
+
function De(e) {
|
|
1547
1550
|
const t = e?.trim();
|
|
1548
1551
|
return t && t !== "0" ? e : void 0;
|
|
1549
1552
|
}
|
|
@@ -1557,7 +1560,7 @@ async function dt({
|
|
|
1557
1560
|
const { results: n, nextCursor: i } = await e.getTasksByFilter({ query: t, cursor: o, limit: r });
|
|
1558
1561
|
return { tasks: n.map(P), nextCursor: i };
|
|
1559
1562
|
} catch (n) {
|
|
1560
|
-
const i =
|
|
1563
|
+
const i = Mo.safeParse(n);
|
|
1561
1564
|
if (!i.success)
|
|
1562
1565
|
throw n;
|
|
1563
1566
|
const { responseData: a } = i.data;
|
|
@@ -1606,18 +1609,18 @@ function ke(e) {
|
|
|
1606
1609
|
};
|
|
1607
1610
|
}
|
|
1608
1611
|
}
|
|
1609
|
-
function
|
|
1612
|
+
function Ts(e) {
|
|
1610
1613
|
const t = e.filter(
|
|
1611
1614
|
(o) => o.type === "relative" || o.type === "absolute"
|
|
1612
1615
|
).length, r = e.filter((o) => o.type === "location").length;
|
|
1613
1616
|
return { timeBasedCount: t, locationCount: r };
|
|
1614
1617
|
}
|
|
1615
|
-
const
|
|
1616
|
-
function
|
|
1617
|
-
return e.length === 1 && e[0]?.trim().toLowerCase() ===
|
|
1618
|
+
const ks = "none";
|
|
1619
|
+
function Fo(e) {
|
|
1620
|
+
return e.length === 1 && e[0]?.trim().toLowerCase() === ks;
|
|
1618
1621
|
}
|
|
1619
|
-
async function
|
|
1620
|
-
const o = await
|
|
1622
|
+
async function Ho(e, t, r) {
|
|
1623
|
+
const o = await Wo(e, t);
|
|
1621
1624
|
if (o)
|
|
1622
1625
|
return Et(
|
|
1623
1626
|
[...o.uidsToNotify ?? [], o.postedUid],
|
|
@@ -1628,7 +1631,7 @@ async function Fo(e, t, r) {
|
|
|
1628
1631
|
const n = await e.getTask(t.taskId);
|
|
1629
1632
|
return Et([n.responsibleUid, n.assignedByUid, n.addedByUid], r);
|
|
1630
1633
|
}
|
|
1631
|
-
async function
|
|
1634
|
+
async function Wo(e, t) {
|
|
1632
1635
|
let r, o = null;
|
|
1633
1636
|
do {
|
|
1634
1637
|
const n = await e.getComments({
|
|
@@ -1647,15 +1650,15 @@ function Et(e, t) {
|
|
|
1647
1650
|
o && o !== t && r.add(o);
|
|
1648
1651
|
return [...r];
|
|
1649
1652
|
}
|
|
1650
|
-
const
|
|
1651
|
-
function
|
|
1653
|
+
const Ae = He.map((e) => e.key);
|
|
1654
|
+
function Bo(e) {
|
|
1652
1655
|
if (typeof e != "string") return;
|
|
1653
1656
|
const t = e.toLowerCase();
|
|
1654
1657
|
return (He.find((o) => o.key === t) ?? He.find((o) => o.displayName.toLowerCase() === t))?.key;
|
|
1655
1658
|
}
|
|
1656
|
-
const
|
|
1657
|
-
s.enum(
|
|
1658
|
-
const be = s.enum(
|
|
1659
|
+
const zo = `Color for the entity. Accepts a color key (e.g. "berry_red") or display name (e.g. "Berry Red"). Valid colors: ${Ae.join(", ")}. Unrecognized colors are omitted and charcoal will be used as the default.`, fe = s.preprocess(Bo, s.enum(Ae).optional()).describe(zo);
|
|
1660
|
+
s.enum(Ae);
|
|
1661
|
+
const be = s.enum(Ae).optional().catch(void 0), K = s.object({
|
|
1659
1662
|
id: s.string(),
|
|
1660
1663
|
content: s.string().describe("Task title."),
|
|
1661
1664
|
description: s.string(),
|
|
@@ -1671,6 +1674,7 @@ const be = s.enum(De).optional().catch(void 0), K = s.object({
|
|
|
1671
1674
|
responsibleUid: s.string().optional(),
|
|
1672
1675
|
isUncompletable: s.boolean().optional().describe("An organizational header, not a real task."),
|
|
1673
1676
|
assignedByUid: s.string().optional(),
|
|
1677
|
+
isDeleted: s.boolean().optional().describe("True when deleted; absent otherwise."),
|
|
1674
1678
|
checked: s.boolean().describe("Whether the task is completed."),
|
|
1675
1679
|
completedAt: s.string().optional().describe("ISO 8601."),
|
|
1676
1680
|
addedAt: s.string().optional().describe("ISO 8601.")
|
|
@@ -1697,7 +1701,7 @@ const be = s.enum(De).optional().catch(void 0), K = s.object({
|
|
|
1697
1701
|
function G({ id: e, name: t, sectionOrder: r, description: o }) {
|
|
1698
1702
|
return { id: e, name: t, sectionOrder: r, description: o ?? void 0 };
|
|
1699
1703
|
}
|
|
1700
|
-
const
|
|
1704
|
+
const Ko = s.object({
|
|
1701
1705
|
resourceType: s.string().describe("file, url, image, etc."),
|
|
1702
1706
|
fileName: s.string().optional(),
|
|
1703
1707
|
fileSize: s.number().optional().describe("Bytes."),
|
|
@@ -1718,8 +1722,8 @@ const zo = s.object({
|
|
|
1718
1722
|
postedAt: s.string().describe("ISO 8601."),
|
|
1719
1723
|
postedUid: s.string().optional(),
|
|
1720
1724
|
notifiedUserIds: s.array(s.string()).optional().describe("Users notified about this comment. Absent when nobody was notified."),
|
|
1721
|
-
fileAttachment:
|
|
1722
|
-
}),
|
|
1725
|
+
fileAttachment: Ko.optional()
|
|
1726
|
+
}), qo = s.object({
|
|
1723
1727
|
id: s.string().optional(),
|
|
1724
1728
|
objectType: s.string().describe("task, project, etc."),
|
|
1725
1729
|
objectId: s.string(),
|
|
@@ -1729,7 +1733,7 @@ const zo = s.object({
|
|
|
1729
1733
|
parentItemId: s.string().optional(),
|
|
1730
1734
|
initiatorId: s.string().optional().describe("User who initiated the event."),
|
|
1731
1735
|
extraData: s.record(s.string(), s.unknown()).optional()
|
|
1732
|
-
}),
|
|
1736
|
+
}), Yo = s.object({
|
|
1733
1737
|
id: s.string(),
|
|
1734
1738
|
name: s.string(),
|
|
1735
1739
|
email: s.string()
|
|
@@ -1739,7 +1743,7 @@ const zo = s.object({
|
|
|
1739
1743
|
color: be,
|
|
1740
1744
|
order: s.number().optional().catch(void 0).describe("Display order."),
|
|
1741
1745
|
isFavorite: s.boolean()
|
|
1742
|
-
}),
|
|
1746
|
+
}), Go = s.object({
|
|
1743
1747
|
isRecurring: s.boolean(),
|
|
1744
1748
|
string: s.string().describe("Human-readable due string."),
|
|
1745
1749
|
date: s.string().describe("ISO 8601."),
|
|
@@ -1748,9 +1752,9 @@ const zo = s.object({
|
|
|
1748
1752
|
}), lt = s.object({
|
|
1749
1753
|
id: s.string(),
|
|
1750
1754
|
taskId: s.string(),
|
|
1751
|
-
type: s.enum(
|
|
1755
|
+
type: s.enum(Qs),
|
|
1752
1756
|
minuteOffset: s.number().optional().describe("Minutes before due. Relative reminders only."),
|
|
1753
|
-
due:
|
|
1757
|
+
due: Go.optional().describe("Absolute, and sometimes relative, reminders."),
|
|
1754
1758
|
name: s.string().optional().describe("Location name. Location reminders only."),
|
|
1755
1759
|
locLat: s.string().optional().describe("Location reminders only."),
|
|
1756
1760
|
locLong: s.string().optional().describe("Location reminders only."),
|
|
@@ -1761,26 +1765,26 @@ const zo = s.object({
|
|
|
1761
1765
|
item: s.string().describe("Usually the ID of the item that failed."),
|
|
1762
1766
|
error: s.string(),
|
|
1763
1767
|
code: s.string().optional()
|
|
1764
|
-
}),
|
|
1768
|
+
}), Vo = s.object({
|
|
1765
1769
|
taskId: s.string().optional().describe("The ID of the task to comment on."),
|
|
1766
1770
|
projectId: s.string().optional().describe(
|
|
1767
1771
|
'The ID of the project to comment on. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
1768
1772
|
),
|
|
1769
1773
|
content: s.string().min(1).describe("The content of the comment."),
|
|
1770
1774
|
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 ["${
|
|
1775
|
+
`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
1776
|
)
|
|
1773
|
-
}),
|
|
1774
|
-
comments: s.array(
|
|
1775
|
-
},
|
|
1777
|
+
}), Jo = {
|
|
1778
|
+
comments: s.array(Vo).min(1).describe("The array of comments to add.")
|
|
1779
|
+
}, Xo = {
|
|
1776
1780
|
comments: s.array(ve).describe("The created comments."),
|
|
1777
1781
|
totalCount: s.number().describe("The total number of comments created."),
|
|
1778
1782
|
addedCommentIds: s.array(s.string()).describe("The IDs of the added comments.")
|
|
1779
|
-
},
|
|
1783
|
+
}, Qo = {
|
|
1780
1784
|
name: g.ADD_COMMENTS,
|
|
1781
1785
|
description: "Add multiple comments to tasks or projects, optionally notifying collaborators. Each comment must specify either taskId or projectId.",
|
|
1782
|
-
parameters:
|
|
1783
|
-
outputSchema:
|
|
1786
|
+
parameters: Jo,
|
|
1787
|
+
outputSchema: Xo,
|
|
1784
1788
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1785
1789
|
async execute(e, t) {
|
|
1786
1790
|
const { comments: r } = e;
|
|
@@ -1803,7 +1807,7 @@ const zo = s.object({
|
|
|
1803
1807
|
});
|
|
1804
1808
|
return p.taskId ? { taskId: p.taskId } : { projectId: h };
|
|
1805
1809
|
})
|
|
1806
|
-
), c = await
|
|
1810
|
+
), c = await Zo({
|
|
1807
1811
|
comments: r,
|
|
1808
1812
|
targets: a,
|
|
1809
1813
|
client: t,
|
|
@@ -1821,7 +1825,7 @@ const zo = s.object({
|
|
|
1821
1825
|
})
|
|
1822
1826
|
)).map(we);
|
|
1823
1827
|
return {
|
|
1824
|
-
textContent:
|
|
1828
|
+
textContent: en({ comments: u }),
|
|
1825
1829
|
structuredContent: {
|
|
1826
1830
|
comments: u,
|
|
1827
1831
|
totalCount: u.length,
|
|
@@ -1830,7 +1834,7 @@ const zo = s.object({
|
|
|
1830
1834
|
};
|
|
1831
1835
|
}
|
|
1832
1836
|
};
|
|
1833
|
-
async function
|
|
1837
|
+
async function Zo({
|
|
1834
1838
|
comments: e,
|
|
1835
1839
|
targets: t,
|
|
1836
1840
|
client: r,
|
|
@@ -1840,15 +1844,15 @@ async function Qo({
|
|
|
1840
1844
|
return await Promise.all(
|
|
1841
1845
|
e.map(async ({ notifyUsers: i }, a) => {
|
|
1842
1846
|
if (i)
|
|
1843
|
-
return
|
|
1847
|
+
return Fo(i) ? [] : (await Eo(r, i)).map((p) => p.userId);
|
|
1844
1848
|
const c = t[a];
|
|
1845
1849
|
if (!c || !o) return [];
|
|
1846
|
-
const d = c.taskId ? `task:${c.taskId}` : `project:${c.projectId}`, u = n.get(d) ??
|
|
1850
|
+
const d = c.taskId ? `task:${c.taskId}` : `project:${c.projectId}`, u = n.get(d) ?? Ho(r, c, o.id);
|
|
1847
1851
|
return n.set(d, u), await u;
|
|
1848
1852
|
})
|
|
1849
1853
|
);
|
|
1850
1854
|
}
|
|
1851
|
-
function
|
|
1855
|
+
function en({ comments: e }) {
|
|
1852
1856
|
const t = e.filter((c) => c.taskId).length, r = e.filter((c) => c.projectId).length, o = [];
|
|
1853
1857
|
if (t > 0) {
|
|
1854
1858
|
const c = t > 1 ? "comments" : "comment";
|
|
@@ -1867,10 +1871,10 @@ function Zo({ comments: e }) {
|
|
|
1867
1871
|
function R(e) {
|
|
1868
1872
|
return s.string().transform((t) => t === "" ? void 0 : t).optional().describe(e);
|
|
1869
1873
|
}
|
|
1870
|
-
function
|
|
1874
|
+
function ws(e) {
|
|
1871
1875
|
return e.description || void 0;
|
|
1872
1876
|
}
|
|
1873
|
-
const
|
|
1877
|
+
const tn = {
|
|
1874
1878
|
search: s.string().optional().describe(
|
|
1875
1879
|
"Search for a filter by name (partial and case insensitive match). If omitted, all filters are returned."
|
|
1876
1880
|
)
|
|
@@ -1884,14 +1888,14 @@ const en = {
|
|
|
1884
1888
|
color: be,
|
|
1885
1889
|
isFavorite: s.boolean().describe("Whether the filter is marked as favorite."),
|
|
1886
1890
|
itemOrder: s.number().describe("The display order of the filter.")
|
|
1887
|
-
}),
|
|
1891
|
+
}), sn = {
|
|
1888
1892
|
filters: s.array(ut).describe("The found filters."),
|
|
1889
1893
|
totalCount: s.number().describe("The total number of filters returned.")
|
|
1890
|
-
},
|
|
1894
|
+
}, rn = {
|
|
1891
1895
|
name: g.FIND_FILTERS,
|
|
1892
1896
|
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:
|
|
1897
|
+
parameters: tn,
|
|
1898
|
+
outputSchema: sn,
|
|
1895
1899
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
1896
1900
|
async execute(e, t) {
|
|
1897
1901
|
let o = ((await t.sync({ resourceTypes: ["filters"], syncToken: "*" })).filters ?? []).filter((a) => !a.isDeleted);
|
|
@@ -1904,13 +1908,13 @@ const en = {
|
|
|
1904
1908
|
id: a.id,
|
|
1905
1909
|
name: a.name,
|
|
1906
1910
|
query: a.query,
|
|
1907
|
-
description:
|
|
1911
|
+
description: ws(a),
|
|
1908
1912
|
color: be.parse(a.color),
|
|
1909
1913
|
isFavorite: a.isFavorite,
|
|
1910
1914
|
itemOrder: a.itemOrder
|
|
1911
1915
|
}));
|
|
1912
1916
|
return {
|
|
1913
|
-
textContent:
|
|
1917
|
+
textContent: on({ filters: n, search: e.search }),
|
|
1914
1918
|
structuredContent: {
|
|
1915
1919
|
filters: n,
|
|
1916
1920
|
totalCount: n.length
|
|
@@ -1918,7 +1922,7 @@ const en = {
|
|
|
1918
1922
|
};
|
|
1919
1923
|
}
|
|
1920
1924
|
};
|
|
1921
|
-
function
|
|
1925
|
+
function on({
|
|
1922
1926
|
filters: e,
|
|
1923
1927
|
search: t
|
|
1924
1928
|
}) {
|
|
@@ -1939,7 +1943,7 @@ ${n.map((i) => `- ${i}`).join(`
|
|
|
1939
1943
|
return o.join(`
|
|
1940
1944
|
`);
|
|
1941
1945
|
}
|
|
1942
|
-
const
|
|
1946
|
+
const nn = s.object({
|
|
1943
1947
|
name: s.string().min(1).describe("The name of the filter."),
|
|
1944
1948
|
query: s.string().min(1).describe(
|
|
1945
1949
|
'The filter query string. Examples: "today & p1", "#Work & overdue", "@email & today", "(p1 | p2) & !assigned". Operators: | (OR), & (AND), ! (NOT), () grouping, , (multiple queries).'
|
|
@@ -1947,16 +1951,16 @@ const on = s.object({
|
|
|
1947
1951
|
description: R("A markdown description explaining what the filter is for."),
|
|
1948
1952
|
color: fe,
|
|
1949
1953
|
isFavorite: s.boolean().optional().describe("Whether to mark the filter as a favorite. Defaults to false.")
|
|
1950
|
-
}),
|
|
1951
|
-
filters: s.array(
|
|
1952
|
-
},
|
|
1954
|
+
}), an = {
|
|
1955
|
+
filters: s.array(nn).min(1).describe("The array of filters to add.")
|
|
1956
|
+
}, cn = {
|
|
1953
1957
|
filters: s.array(ut).describe("The created filters."),
|
|
1954
1958
|
totalCount: s.number().describe("The total number of filters created.")
|
|
1955
|
-
},
|
|
1959
|
+
}, dn = {
|
|
1956
1960
|
name: g.ADD_FILTERS,
|
|
1957
1961
|
description: "Add one or more new personal filters. Filters are saved custom views using query syntax to organize tasks.",
|
|
1958
|
-
parameters:
|
|
1959
|
-
outputSchema:
|
|
1962
|
+
parameters: an,
|
|
1963
|
+
outputSchema: cn,
|
|
1960
1964
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1961
1965
|
async execute({ filters: e }, t) {
|
|
1962
1966
|
const r = Date.now(), o = e.map((p, h) => `tempFilterAdd${h}${r}`), n = e.map((p, h) => Q(
|
|
@@ -1996,26 +2000,26 @@ ${u}`,
|
|
|
1996
2000
|
}
|
|
1997
2001
|
};
|
|
1998
2002
|
}
|
|
1999
|
-
},
|
|
2003
|
+
}, ln = s.object({
|
|
2000
2004
|
name: s.string().min(1).max(128).describe("The name of the label."),
|
|
2001
2005
|
color: fe,
|
|
2002
2006
|
order: s.number().int().optional().describe("The position of the label in the label list."),
|
|
2003
2007
|
isFavorite: s.boolean().optional().describe("Whether the label is a favorite. Defaults to false.")
|
|
2004
|
-
}),
|
|
2005
|
-
labels: s.array(
|
|
2006
|
-
},
|
|
2008
|
+
}), un = {
|
|
2009
|
+
labels: s.array(ln).min(1).describe("The array of labels to add.")
|
|
2010
|
+
}, pn = {
|
|
2007
2011
|
labels: s.array(ge).describe("The created labels."),
|
|
2008
2012
|
totalCount: s.number().describe("The total number of labels created.")
|
|
2009
|
-
},
|
|
2013
|
+
}, hn = {
|
|
2010
2014
|
name: g.ADD_LABELS,
|
|
2011
2015
|
description: "Add one or more new personal labels.",
|
|
2012
|
-
parameters:
|
|
2013
|
-
outputSchema:
|
|
2016
|
+
parameters: un,
|
|
2017
|
+
outputSchema: pn,
|
|
2014
2018
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
2015
2019
|
async execute({ labels: e }, t) {
|
|
2016
2020
|
const r = await Promise.all(e.map((n) => t.addLabel(n)));
|
|
2017
2021
|
return {
|
|
2018
|
-
textContent:
|
|
2022
|
+
textContent: mn({ labels: r }),
|
|
2019
2023
|
structuredContent: {
|
|
2020
2024
|
labels: r.map((n) => ge.parse(n)),
|
|
2021
2025
|
totalCount: r.length
|
|
@@ -2023,21 +2027,21 @@ ${u}`,
|
|
|
2023
2027
|
};
|
|
2024
2028
|
}
|
|
2025
2029
|
};
|
|
2026
|
-
function
|
|
2030
|
+
function mn({ labels: e }) {
|
|
2027
2031
|
const t = e.length, r = e.map((o) => `• ${o.name} (id=${o.id})`).join(`
|
|
2028
2032
|
`);
|
|
2029
2033
|
return `Added ${t} label${t === 1 ? "" : "s"}:
|
|
2030
2034
|
${r}`;
|
|
2031
2035
|
}
|
|
2032
|
-
const
|
|
2036
|
+
const fn = "[redacted]";
|
|
2033
2037
|
function ne(e, t, r, o = {}) {
|
|
2034
2038
|
if (r.length === 0)
|
|
2035
2039
|
return;
|
|
2036
|
-
const n = r.slice(0,
|
|
2040
|
+
const n = r.slice(0, vr.MAX_FAILURES_LOGGED);
|
|
2037
2041
|
console.error(`${e}: items failed`, {
|
|
2038
2042
|
failed: r.length,
|
|
2039
2043
|
of: t,
|
|
2040
|
-
sample: o.redactItems ? n.map((i) => ({ ...i, item:
|
|
2044
|
+
sample: o.redactItems ? n.map((i) => ({ ...i, item: fn })) : n
|
|
2041
2045
|
});
|
|
2042
2046
|
}
|
|
2043
2047
|
function he(e = /* @__PURE__ */ new Date()) {
|
|
@@ -2084,20 +2088,20 @@ function mt(e, t) {
|
|
|
2084
2088
|
Failed (${t.length}) - address or drop these items:
|
|
2085
2089
|
${n}${i}`;
|
|
2086
2090
|
}
|
|
2087
|
-
function
|
|
2091
|
+
function bn(e) {
|
|
2088
2092
|
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
2093
|
return ` ${t}${r}${o}${n}${i}`;
|
|
2090
2094
|
}
|
|
2091
|
-
function
|
|
2095
|
+
function gn(e) {
|
|
2092
2096
|
const t = ` (${e.color})`, r = e.isFavorite ? " • ⭐" : "", o = ` • id=${e.id}`;
|
|
2093
2097
|
return ` ${e.name}${t}${r}${o}`;
|
|
2094
2098
|
}
|
|
2095
|
-
function
|
|
2099
|
+
function yn(e) {
|
|
2096
2100
|
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
2101
|
return ` ${e.name}${t}${r}${o}${n}${i}${a}`;
|
|
2098
2102
|
}
|
|
2099
2103
|
function xe(e, t = 5) {
|
|
2100
|
-
const o = e.slice(0, t).map(
|
|
2104
|
+
const o = e.slice(0, t).map(bn).join(`
|
|
2101
2105
|
`);
|
|
2102
2106
|
if (e.length > t) {
|
|
2103
2107
|
const n = e.length - t;
|
|
@@ -2118,25 +2122,25 @@ function V({
|
|
|
2118
2122
|
}) {
|
|
2119
2123
|
const d = [], u = `${e}: ${t}${typeof r == "number" ? ` (limit ${r})` : ""}${o ? ", more available" : ""}.`;
|
|
2120
2124
|
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(
|
|
2125
|
+
${i}`), !t && a?.length && d.push(`No results. ${a.join("; ")}.`), (c?.length || o) && d.push(vs(c || [], o)), d.join(`
|
|
2122
2126
|
`);
|
|
2123
2127
|
}
|
|
2124
|
-
function
|
|
2128
|
+
function vs(e, t) {
|
|
2125
2129
|
const r = [...e];
|
|
2126
2130
|
return t && r.push(`Pass cursor '${t}' to fetch more results.`), `${r.length === 1 ? "Possible suggested next step:" : "Possible suggested next steps:"}
|
|
2127
2131
|
${r.map((n) => `- ${n}`).join(`
|
|
2128
2132
|
`)}`;
|
|
2129
2133
|
}
|
|
2130
|
-
const
|
|
2131
|
-
function
|
|
2134
|
+
const Tn = 300 * 1e3;
|
|
2135
|
+
function kn(e) {
|
|
2132
2136
|
return /^\d+$/.test(e);
|
|
2133
2137
|
}
|
|
2134
|
-
class
|
|
2138
|
+
class wn {
|
|
2135
2139
|
constructor() {
|
|
2136
2140
|
this.cache = null, this.inFlightWorkspaces = null;
|
|
2137
2141
|
}
|
|
2138
2142
|
async getWorkspaces(t) {
|
|
2139
|
-
if (this.cache && Date.now() - this.cache.timestamp <
|
|
2143
|
+
if (this.cache && Date.now() - this.cache.timestamp < Tn)
|
|
2140
2144
|
return this.cache.workspaces;
|
|
2141
2145
|
if (this.inFlightWorkspaces)
|
|
2142
2146
|
return this.inFlightWorkspaces;
|
|
@@ -2163,7 +2167,7 @@ class kn {
|
|
|
2163
2167
|
const n = await this.getWorkspaces(t), i = n.find((l) => l.id === o);
|
|
2164
2168
|
if (i)
|
|
2165
2169
|
return { workspaceId: i.id, workspaceName: i.name };
|
|
2166
|
-
if (
|
|
2170
|
+
if (kn(o))
|
|
2167
2171
|
return { workspaceId: o, workspaceName: o };
|
|
2168
2172
|
const a = o.toLowerCase(), c = n.find((l) => l.name.toLowerCase() === a);
|
|
2169
2173
|
if (c)
|
|
@@ -2191,7 +2195,7 @@ ${l}` + (d.length > 5 ? `
|
|
|
2191
2195
|
this.cache = null;
|
|
2192
2196
|
}
|
|
2193
2197
|
}
|
|
2194
|
-
const
|
|
2198
|
+
const Is = new wn(), vn = s.object({
|
|
2195
2199
|
name: s.string().min(1).describe("The name of the project."),
|
|
2196
2200
|
parentId: s.string().optional().describe("The ID of the parent project. If provided, creates this as a sub-project."),
|
|
2197
2201
|
isFavorite: s.boolean().optional().describe("Whether the project is a favorite. Defaults to false."),
|
|
@@ -2201,9 +2205,9 @@ const vs = new kn(), wn = s.object({
|
|
|
2201
2205
|
workspace: s.string().trim().min(1).optional().describe(
|
|
2202
2206
|
"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
2207
|
)
|
|
2204
|
-
}),
|
|
2205
|
-
projects: s.array(
|
|
2206
|
-
},
|
|
2208
|
+
}), In = {
|
|
2209
|
+
projects: s.array(vn).min(1).describe("The array of projects to add.")
|
|
2210
|
+
}, Sn = {
|
|
2207
2211
|
projects: s.array(re).describe("The created projects."),
|
|
2208
2212
|
totalCount: s.number().describe("The total number of projects created."),
|
|
2209
2213
|
failures: s.array(oe).describe(
|
|
@@ -2212,11 +2216,11 @@ const vs = new kn(), wn = s.object({
|
|
|
2212
2216
|
totalRequested: s.number().describe("The total number of projects requested."),
|
|
2213
2217
|
successCount: s.number().describe("The number of successfully created projects."),
|
|
2214
2218
|
failureCount: s.number().describe("The number of failed project creations.")
|
|
2215
|
-
},
|
|
2219
|
+
}, Cn = {
|
|
2216
2220
|
name: g.ADD_PROJECTS,
|
|
2217
2221
|
description: "Add one or more new projects.",
|
|
2218
|
-
parameters:
|
|
2219
|
-
outputSchema:
|
|
2222
|
+
parameters: In,
|
|
2223
|
+
outputSchema: Sn,
|
|
2220
2224
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
2221
2225
|
async execute({ projects: e }, t) {
|
|
2222
2226
|
const r = /* @__PURE__ */ new Map(), o = (u) => {
|
|
@@ -2224,7 +2228,7 @@ const vs = new kn(), wn = s.object({
|
|
|
2224
2228
|
return Promise.resolve(void 0);
|
|
2225
2229
|
let l = r.get(u);
|
|
2226
2230
|
return l || (l = _(
|
|
2227
|
-
() =>
|
|
2231
|
+
() => Is.resolveWorkspace(t, u)
|
|
2228
2232
|
).then(({ workspaceId: p }) => p), r.set(u, l)), l;
|
|
2229
2233
|
}, n = await Promise.allSettled(
|
|
2230
2234
|
e.map(async ({ workspace: u, ...l }) => {
|
|
@@ -2242,7 +2246,7 @@ const vs = new kn(), wn = s.object({
|
|
|
2242
2246
|
});
|
|
2243
2247
|
const c = i.map(se);
|
|
2244
2248
|
return ne(g.ADD_PROJECTS, e.length, a, { redactItems: !0 }), {
|
|
2245
|
-
textContent:
|
|
2249
|
+
textContent: jn({ projects: i, failures: a }),
|
|
2246
2250
|
structuredContent: {
|
|
2247
2251
|
projects: c,
|
|
2248
2252
|
totalCount: c.length,
|
|
@@ -2254,7 +2258,7 @@ const vs = new kn(), wn = s.object({
|
|
|
2254
2258
|
};
|
|
2255
2259
|
}
|
|
2256
2260
|
};
|
|
2257
|
-
function
|
|
2261
|
+
function jn({
|
|
2258
2262
|
projects: e,
|
|
2259
2263
|
failures: t
|
|
2260
2264
|
}) {
|
|
@@ -2263,12 +2267,12 @@ function Cn({
|
|
|
2263
2267
|
${o}` : "Added 0 projects";
|
|
2264
2268
|
return mt(n, t);
|
|
2265
2269
|
}
|
|
2266
|
-
const je = 25, Ee = s.enum(
|
|
2270
|
+
const je = 25, Ee = s.enum(Zs), Ss = s.object({
|
|
2267
2271
|
date: s.string().optional().describe("Due date in YYYY-MM-DD format."),
|
|
2268
2272
|
string: s.string().optional().describe('Natural language due string, e.g. "tomorrow at 3pm".'),
|
|
2269
2273
|
timezone: s.string().optional().describe('Timezone for the reminder, e.g. "America/New_York".'),
|
|
2270
2274
|
lang: s.string().optional().describe('Language for parsing the due string, e.g. "en".')
|
|
2271
|
-
}),
|
|
2275
|
+
}), 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
2276
|
type: s.literal("relative"),
|
|
2273
2277
|
taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
|
|
2274
2278
|
minuteOffset: s.number().int().min(0).describe(
|
|
@@ -2278,10 +2282,10 @@ const je = 25, Ee = s.enum(Qs), Is = s.object({
|
|
|
2278
2282
|
'Delivery method: "email" or "push" notification. Defaults to push.'
|
|
2279
2283
|
),
|
|
2280
2284
|
isUrgent: Oe
|
|
2281
|
-
}),
|
|
2285
|
+
}), Dn = s.object({
|
|
2282
2286
|
type: s.literal("absolute"),
|
|
2283
2287
|
taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
|
|
2284
|
-
due:
|
|
2288
|
+
due: Ss.describe("The specific date/time for the reminder."),
|
|
2285
2289
|
service: Ee.optional().describe(
|
|
2286
2290
|
'Delivery method: "email" or "push" notification. Defaults to push.'
|
|
2287
2291
|
),
|
|
@@ -2292,27 +2296,27 @@ const je = 25, Ee = s.enum(Qs), Is = s.object({
|
|
|
2292
2296
|
name: s.string().min(1).describe('Name of the location, e.g. "Office", "Home".'),
|
|
2293
2297
|
locLat: s.string().describe('Latitude of the location as a string, e.g. "37.7749".'),
|
|
2294
2298
|
locLong: s.string().describe('Longitude of the location as a string, e.g. "-122.4194".'),
|
|
2295
|
-
locTrigger:
|
|
2299
|
+
locTrigger: Cs.describe(
|
|
2296
2300
|
'When to trigger: "on_enter" (arriving) or "on_leave" (departing).'
|
|
2297
2301
|
),
|
|
2298
2302
|
radius: s.number().int().optional().describe("Radius in meters for the geofence. Defaults to server default.")
|
|
2299
|
-
}),
|
|
2300
|
-
jn,
|
|
2303
|
+
}), xn = s.discriminatedUnion("type", [
|
|
2301
2304
|
$n,
|
|
2305
|
+
Dn,
|
|
2302
2306
|
An
|
|
2303
|
-
]),
|
|
2304
|
-
reminders: s.array(
|
|
2307
|
+
]), En = {
|
|
2308
|
+
reminders: s.array(xn).min(1).max(je).describe(
|
|
2305
2309
|
`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
2310
|
)
|
|
2307
|
-
},
|
|
2311
|
+
}, On = {
|
|
2308
2312
|
reminders: s.array(lt).describe("The created reminders."),
|
|
2309
2313
|
totalCount: s.number().describe("Total number of reminders created."),
|
|
2310
2314
|
addedReminderIds: s.array(s.string()).describe("IDs of the created reminders.")
|
|
2311
|
-
},
|
|
2315
|
+
}, _n = {
|
|
2312
2316
|
name: g.ADD_REMINDERS,
|
|
2313
2317
|
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:
|
|
2318
|
+
parameters: En,
|
|
2319
|
+
outputSchema: On,
|
|
2316
2320
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
2317
2321
|
async execute(e, t) {
|
|
2318
2322
|
const { reminders: r } = e, o = r.map(async (c) => {
|
|
@@ -2345,7 +2349,7 @@ const je = 25, Ee = s.enum(Qs), Is = s.object({
|
|
|
2345
2349
|
}
|
|
2346
2350
|
}), i = (await Promise.all(o)).map(ke);
|
|
2347
2351
|
return {
|
|
2348
|
-
textContent:
|
|
2352
|
+
textContent: Pn(i),
|
|
2349
2353
|
structuredContent: {
|
|
2350
2354
|
reminders: i,
|
|
2351
2355
|
totalCount: i.length,
|
|
@@ -2354,8 +2358,8 @@ const je = 25, Ee = s.enum(Qs), Is = s.object({
|
|
|
2354
2358
|
};
|
|
2355
2359
|
}
|
|
2356
2360
|
};
|
|
2357
|
-
function
|
|
2358
|
-
const { timeBasedCount: t, locationCount: r } =
|
|
2361
|
+
function Pn(e) {
|
|
2362
|
+
const { timeBasedCount: t, locationCount: r } = Ts(e), o = [];
|
|
2359
2363
|
if (t > 0) {
|
|
2360
2364
|
const n = t > 1 ? "reminders" : "reminder";
|
|
2361
2365
|
o.push(`${t} time-based ${n}`);
|
|
@@ -2366,15 +2370,15 @@ function _n(e) {
|
|
|
2366
2370
|
}
|
|
2367
2371
|
return o.length > 0 ? `Added ${o.join(" and ")}` : "No reminders added";
|
|
2368
2372
|
}
|
|
2369
|
-
const
|
|
2373
|
+
const Un = s.object({
|
|
2370
2374
|
name: s.string().min(1).describe("The name of the section."),
|
|
2371
2375
|
projectId: s.string().min(1).describe(
|
|
2372
2376
|
'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
2377
|
),
|
|
2374
2378
|
description: s.string().optional().describe("The description of the section. Supports Markdown.")
|
|
2375
|
-
}),
|
|
2376
|
-
sections: s.array(
|
|
2377
|
-
},
|
|
2379
|
+
}), Rn = {
|
|
2380
|
+
sections: s.array(Un).min(1).describe("The array of sections to add.")
|
|
2381
|
+
}, Ln = {
|
|
2378
2382
|
sections: s.array(Y).describe("The created sections."),
|
|
2379
2383
|
totalCount: s.number().describe("The total number of sections created."),
|
|
2380
2384
|
failures: s.array(oe).describe(
|
|
@@ -2383,11 +2387,11 @@ const Pn = s.object({
|
|
|
2383
2387
|
totalRequested: s.number().describe("The total number of sections requested."),
|
|
2384
2388
|
successCount: s.number().describe("The number of successfully created sections."),
|
|
2385
2389
|
failureCount: s.number().describe("The number of failed section creations.")
|
|
2386
|
-
},
|
|
2390
|
+
}, Nn = {
|
|
2387
2391
|
name: g.ADD_SECTIONS,
|
|
2388
2392
|
description: "Add one or more new sections to projects.",
|
|
2389
|
-
parameters:
|
|
2390
|
-
outputSchema:
|
|
2393
|
+
parameters: Rn,
|
|
2394
|
+
outputSchema: Ln,
|
|
2391
2395
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
2392
2396
|
async execute({ sections: e }, t) {
|
|
2393
2397
|
const r = e.some((c) => B(c.projectId)) ? _(() => t.getUser()) : void 0, o = await Promise.allSettled(
|
|
@@ -2406,7 +2410,7 @@ const Pn = s.object({
|
|
|
2406
2410
|
error: N(c.reason)
|
|
2407
2411
|
});
|
|
2408
2412
|
}), ne(g.ADD_SECTIONS, e.length, i, { redactItems: !0 }), {
|
|
2409
|
-
textContent:
|
|
2413
|
+
textContent: Mn({ sections: n, failures: i }),
|
|
2410
2414
|
structuredContent: {
|
|
2411
2415
|
sections: n.map(G),
|
|
2412
2416
|
totalCount: n.length,
|
|
@@ -2418,7 +2422,7 @@ const Pn = s.object({
|
|
|
2418
2422
|
};
|
|
2419
2423
|
}
|
|
2420
2424
|
};
|
|
2421
|
-
function
|
|
2425
|
+
function Mn({
|
|
2422
2426
|
sections: e,
|
|
2423
2427
|
failures: t
|
|
2424
2428
|
}) {
|
|
@@ -2436,7 +2440,7 @@ const ue = {
|
|
|
2436
2440
|
PROJECT_NOT_FOUND: "PROJECT_NOT_FOUND",
|
|
2437
2441
|
TASK_NOT_FOUND: "TASK_NOT_FOUND"
|
|
2438
2442
|
};
|
|
2439
|
-
class
|
|
2443
|
+
class Fn {
|
|
2440
2444
|
/**
|
|
2441
2445
|
* Validate a single assignment operation
|
|
2442
2446
|
*/
|
|
@@ -2645,7 +2649,7 @@ class Mn {
|
|
|
2645
2649
|
};
|
|
2646
2650
|
}
|
|
2647
2651
|
}
|
|
2648
|
-
const ft = new
|
|
2652
|
+
const ft = new Fn(), Ot = os.TASKS_PER_OPERATION, Hn = s.object({
|
|
2649
2653
|
content: s.string().min(1).describe(
|
|
2650
2654
|
'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
2655
|
),
|
|
@@ -2676,24 +2680,24 @@ const ft = new Mn(), Ot = rs.TASKS_PER_OPERATION, Fn = s.object({
|
|
|
2676
2680
|
"Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
|
|
2677
2681
|
)
|
|
2678
2682
|
}), _t = {
|
|
2679
|
-
tasks: s.array(
|
|
2680
|
-
},
|
|
2683
|
+
tasks: s.array(Hn).min(1).max(Ot).describe(`The array of tasks to add (max ${Ot}).`)
|
|
2684
|
+
}, Wn = {
|
|
2681
2685
|
tasks: s.array(K).describe("The created tasks."),
|
|
2682
2686
|
totalCount: s.number().describe("The total number of tasks created."),
|
|
2683
2687
|
failures: s.array(oe).describe("Failed task creations with error details."),
|
|
2684
2688
|
totalRequested: s.number().describe("The total number of tasks requested."),
|
|
2685
2689
|
successCount: s.number().describe("The number of successfully created tasks."),
|
|
2686
2690
|
failureCount: s.number().describe("The number of failed task creations.")
|
|
2687
|
-
},
|
|
2691
|
+
}, Bn = {
|
|
2688
2692
|
name: g.ADD_TASKS,
|
|
2689
2693
|
description: "Add one or more tasks to a project, section, or parent. Supports assignment to project collaborators.",
|
|
2690
2694
|
parameters: _t,
|
|
2691
|
-
outputSchema:
|
|
2695
|
+
outputSchema: Wn,
|
|
2692
2696
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
2693
2697
|
async execute(e, t) {
|
|
2694
2698
|
const { tasks: r } = s.object(_t).parse(e), o = /* @__PURE__ */ new Map();
|
|
2695
2699
|
r.forEach((h, m) => {
|
|
2696
|
-
const y =
|
|
2700
|
+
const y = zn(h), f = o.get(y);
|
|
2697
2701
|
f ? f.push({ task: h, index: m }) : o.set(y, [{ task: h, index: m }]);
|
|
2698
2702
|
});
|
|
2699
2703
|
const n = /* @__PURE__ */ new Map(), a = (await Promise.all(
|
|
@@ -2701,7 +2705,7 @@ const ft = new Mn(), Ot = rs.TASKS_PER_OPERATION, Fn = s.object({
|
|
|
2701
2705
|
const m = [];
|
|
2702
2706
|
for (const { task: y, index: f } of h)
|
|
2703
2707
|
try {
|
|
2704
|
-
const w = await
|
|
2708
|
+
const w = await Kn(y, t, n);
|
|
2705
2709
|
m.push({ index: f, result: { status: "fulfilled", value: w } });
|
|
2706
2710
|
} catch (w) {
|
|
2707
2711
|
m.push({
|
|
@@ -2723,11 +2727,11 @@ const ft = new Mn(), Ot = rs.TASKS_PER_OPERATION, Fn = s.object({
|
|
|
2723
2727
|
}));
|
|
2724
2728
|
if (c.length === 0 && d.length > 0) {
|
|
2725
2729
|
const h = d.map((y) => `"${y.item}": ${y.error}`).join("; "), m = `All ${d.length} task(s) failed to create: ${h}`;
|
|
2726
|
-
throw u ? new
|
|
2730
|
+
throw u ? new rs(m) : new Error(m);
|
|
2727
2731
|
}
|
|
2728
2732
|
const l = c.map(P);
|
|
2729
2733
|
return ne(g.ADD_TASKS, r.length, d, { redactItems: !0 }), {
|
|
2730
|
-
textContent:
|
|
2734
|
+
textContent: qn({
|
|
2731
2735
|
tasks: l,
|
|
2732
2736
|
failures: d,
|
|
2733
2737
|
args: { tasks: r }
|
|
@@ -2743,10 +2747,10 @@ const ft = new Mn(), Ot = rs.TASKS_PER_OPERATION, Fn = s.object({
|
|
|
2743
2747
|
};
|
|
2744
2748
|
}
|
|
2745
2749
|
};
|
|
2746
|
-
function
|
|
2750
|
+
function zn(e) {
|
|
2747
2751
|
return `${e.projectId ?? ""}|${e.sectionId ?? ""}|${e.parentId ?? ""}`;
|
|
2748
2752
|
}
|
|
2749
|
-
async function
|
|
2753
|
+
async function Kn(e, t, r) {
|
|
2750
2754
|
const {
|
|
2751
2755
|
duration: o,
|
|
2752
2756
|
projectId: n,
|
|
@@ -2775,13 +2779,13 @@ async function zn(e, t, r) {
|
|
|
2775
2779
|
labels: l,
|
|
2776
2780
|
deadlineDate: p
|
|
2777
2781
|
};
|
|
2778
|
-
if (u && (y.priority =
|
|
2782
|
+
if (u && (y.priority = ps(u)), d && !m && !i && !a)
|
|
2779
2783
|
throw new Error(
|
|
2780
2784
|
`Task "${e.content}": Cannot assign tasks without specifying project context. Please specify a projectId, sectionId, or parentId.`
|
|
2781
2785
|
);
|
|
2782
2786
|
if (o)
|
|
2783
2787
|
try {
|
|
2784
|
-
const { minutes: f } =
|
|
2788
|
+
const { minutes: f } = us(o);
|
|
2785
2789
|
y = {
|
|
2786
2790
|
...y,
|
|
2787
2791
|
duration: f,
|
|
@@ -2814,9 +2818,9 @@ async function zn(e, t, r) {
|
|
|
2814
2818
|
d
|
|
2815
2819
|
);
|
|
2816
2820
|
if (!w.isValid) {
|
|
2817
|
-
const C = w.error?.message || "Assignment validation failed",
|
|
2821
|
+
const C = w.error?.message || "Assignment validation failed", A = w.error?.suggestions?.join(". ") || "";
|
|
2818
2822
|
throw new Error(
|
|
2819
|
-
`Task "${e.content}": ${C}${
|
|
2823
|
+
`Task "${e.content}": ${C}${A ? `. ${A}` : ""}`
|
|
2820
2824
|
);
|
|
2821
2825
|
}
|
|
2822
2826
|
y.assigneeId = w.resolvedUser?.userId;
|
|
@@ -2824,7 +2828,7 @@ async function zn(e, t, r) {
|
|
|
2824
2828
|
try {
|
|
2825
2829
|
return await t.addTask(y);
|
|
2826
2830
|
} catch (f) {
|
|
2827
|
-
const w =
|
|
2831
|
+
const w = yr(f, {
|
|
2828
2832
|
taskContent: e.content,
|
|
2829
2833
|
dueString: e.dueString,
|
|
2830
2834
|
deadlineDate: e.deadlineDate
|
|
@@ -2832,7 +2836,7 @@ async function zn(e, t, r) {
|
|
|
2832
2836
|
throw w ? new $e(w) : f;
|
|
2833
2837
|
}
|
|
2834
2838
|
}
|
|
2835
|
-
function
|
|
2839
|
+
function qn({
|
|
2836
2840
|
tasks: e,
|
|
2837
2841
|
failures: t,
|
|
2838
2842
|
args: r
|
|
@@ -2857,11 +2861,11 @@ function Kn({
|
|
|
2857
2861
|
showDetails: !0
|
|
2858
2862
|
});
|
|
2859
2863
|
}
|
|
2860
|
-
const
|
|
2864
|
+
const Yn = {
|
|
2861
2865
|
projectId: s.string().min(1).describe(
|
|
2862
2866
|
"The ID of the project to analyze. This triggers a new health analysis which may take some time to complete."
|
|
2863
2867
|
)
|
|
2864
|
-
},
|
|
2868
|
+
}, Gn = {
|
|
2865
2869
|
projectId: s.string().describe("The project ID."),
|
|
2866
2870
|
health: s.object({
|
|
2867
2871
|
status: s.enum(tt).describe("The health status after triggering analysis."),
|
|
@@ -2869,11 +2873,11 @@ const qn = {
|
|
|
2869
2873
|
updateInProgress: s.boolean().describe("Whether an analysis update is currently in progress.")
|
|
2870
2874
|
}).describe("The health response returned after triggering analysis."),
|
|
2871
2875
|
message: s.string().describe("A human-readable message about the analysis status.")
|
|
2872
|
-
},
|
|
2876
|
+
}, Vn = {
|
|
2873
2877
|
name: g.ANALYZE_PROJECT_HEALTH,
|
|
2874
2878
|
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:
|
|
2879
|
+
parameters: Yn,
|
|
2880
|
+
outputSchema: Gn,
|
|
2877
2881
|
annotations: {
|
|
2878
2882
|
readOnlyHint: !1,
|
|
2879
2883
|
destructiveHint: !1,
|
|
@@ -2896,19 +2900,19 @@ ${n}`,
|
|
|
2896
2900
|
}
|
|
2897
2901
|
};
|
|
2898
2902
|
}
|
|
2899
|
-
}, Vn = {
|
|
2900
|
-
ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to complete.")
|
|
2901
2903
|
}, Jn = {
|
|
2904
|
+
ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to complete.")
|
|
2905
|
+
}, Xn = {
|
|
2902
2906
|
completed: s.array(s.string()).describe("The IDs of successfully completed tasks."),
|
|
2903
2907
|
failures: s.array(oe).describe("Failed task completions with error details."),
|
|
2904
2908
|
totalRequested: s.number().describe("The total number of tasks requested to complete."),
|
|
2905
2909
|
successCount: s.number().describe("The number of successfully completed tasks."),
|
|
2906
2910
|
failureCount: s.number().describe("The number of failed task completions.")
|
|
2907
|
-
},
|
|
2911
|
+
}, Qn = {
|
|
2908
2912
|
name: g.COMPLETE_TASKS,
|
|
2909
2913
|
description: "Complete one or more tasks by their IDs.",
|
|
2910
|
-
parameters:
|
|
2911
|
-
outputSchema:
|
|
2914
|
+
parameters: Jn,
|
|
2915
|
+
outputSchema: Xn,
|
|
2912
2916
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
2913
2917
|
async execute(e, t) {
|
|
2914
2918
|
const r = [], o = [];
|
|
@@ -2922,7 +2926,7 @@ ${n}`,
|
|
|
2922
2926
|
});
|
|
2923
2927
|
}
|
|
2924
2928
|
return ne(g.COMPLETE_TASKS, e.ids.length, o), {
|
|
2925
|
-
textContent:
|
|
2929
|
+
textContent: Zn({
|
|
2926
2930
|
completed: r,
|
|
2927
2931
|
failures: o,
|
|
2928
2932
|
args: e
|
|
@@ -2937,7 +2941,7 @@ ${n}`,
|
|
|
2937
2941
|
};
|
|
2938
2942
|
}
|
|
2939
2943
|
};
|
|
2940
|
-
function
|
|
2944
|
+
function Zn({
|
|
2941
2945
|
completed: e,
|
|
2942
2946
|
failures: t,
|
|
2943
2947
|
args: r
|
|
@@ -2950,7 +2954,7 @@ function Qn({
|
|
|
2950
2954
|
failures: t
|
|
2951
2955
|
});
|
|
2952
2956
|
}
|
|
2953
|
-
const
|
|
2957
|
+
const js = [
|
|
2954
2958
|
"project",
|
|
2955
2959
|
"section",
|
|
2956
2960
|
"task",
|
|
@@ -2959,20 +2963,20 @@ const Cs = [
|
|
|
2959
2963
|
"filter",
|
|
2960
2964
|
"reminder",
|
|
2961
2965
|
"location_reminder"
|
|
2962
|
-
],
|
|
2963
|
-
type: s.enum(
|
|
2966
|
+
], ei = {
|
|
2967
|
+
type: s.enum(js).describe("The type of entity to delete."),
|
|
2964
2968
|
id: s.string().min(1).describe("The ID of the entity to delete.")
|
|
2965
|
-
},
|
|
2969
|
+
}, ti = {
|
|
2966
2970
|
deletedEntity: s.object({
|
|
2967
|
-
type: s.enum(
|
|
2971
|
+
type: s.enum(js).describe("The type of deleted entity."),
|
|
2968
2972
|
id: s.string().describe("The ID of the deleted entity.")
|
|
2969
2973
|
}).describe("Information about the deleted entity."),
|
|
2970
2974
|
success: s.boolean().describe("Whether the deletion was successful.")
|
|
2971
|
-
},
|
|
2975
|
+
}, si = {
|
|
2972
2976
|
name: g.DELETE_OBJECT,
|
|
2973
2977
|
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:
|
|
2978
|
+
parameters: ei,
|
|
2979
|
+
outputSchema: ti,
|
|
2976
2980
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !0 },
|
|
2977
2981
|
async execute(e, t) {
|
|
2978
2982
|
switch (e.type) {
|
|
@@ -3017,25 +3021,25 @@ const Cs = [
|
|
|
3017
3021
|
}
|
|
3018
3022
|
};
|
|
3019
3023
|
}
|
|
3020
|
-
}, Pt = 5,
|
|
3024
|
+
}, Pt = 5, $s = ["file", "url"], ri = {
|
|
3021
3025
|
projectId: s.string().min(1).describe("The ID of the project to export as a template."),
|
|
3022
|
-
format: s.enum(
|
|
3026
|
+
format: s.enum($s).default("file").describe(
|
|
3023
3027
|
'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
3028
|
),
|
|
3025
3029
|
useRelativeDates: s.boolean().optional().describe(
|
|
3026
3030
|
'Export due dates relative to the import date (e.g. "day 3") instead of absolute dates. Defaults to false.'
|
|
3027
3031
|
)
|
|
3028
|
-
},
|
|
3029
|
-
format: s.enum(
|
|
3032
|
+
}, oi = {
|
|
3033
|
+
format: s.enum($s).describe("The format the template was exported in."),
|
|
3030
3034
|
content: s.string().optional().describe('The template as CSV content. Only present when format is "file".'),
|
|
3031
3035
|
lineCount: s.number().optional().describe('Number of rows in the exported CSV. Only present when format is "file".'),
|
|
3032
3036
|
fileName: s.string().optional().describe('The generated template file name. Only present when format is "url".'),
|
|
3033
3037
|
fileUrl: s.string().optional().describe('The shareable download URL. Only present when format is "url".')
|
|
3034
|
-
},
|
|
3038
|
+
}, ni = {
|
|
3035
3039
|
name: g.EXPORT_PROJECT_TEMPLATE,
|
|
3036
3040
|
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:
|
|
3041
|
+
parameters: ri,
|
|
3042
|
+
outputSchema: oi,
|
|
3039
3043
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3040
3044
|
// `format` is defaulted here as well as in the schema: scripts/run-tool.ts calls
|
|
3041
3045
|
// execute() with raw JSON, so schema defaults are not applied on that path.
|
|
@@ -3056,12 +3060,12 @@ ${c}`,
|
|
|
3056
3060
|
return {
|
|
3057
3061
|
// The full CSV already ships in structuredContent; a preview here keeps a large
|
|
3058
3062
|
// project from being spelled out twice in the response.
|
|
3059
|
-
textContent:
|
|
3063
|
+
textContent: ii({ projectId: e, lines: i }),
|
|
3060
3064
|
structuredContent: { format: t, content: n, lineCount: i.length }
|
|
3061
3065
|
};
|
|
3062
3066
|
}
|
|
3063
3067
|
};
|
|
3064
|
-
function
|
|
3068
|
+
function ii({ projectId: e, lines: t }) {
|
|
3065
3069
|
const r = `Exported project (id=${e}) as a template file (${t.length} row${t.length === 1 ? "" : "s"}).`, o = t.slice(0, Pt).join(`
|
|
3066
3070
|
`), n = t.length - Pt;
|
|
3067
3071
|
return n > 0 ? `${r}
|
|
@@ -3071,7 +3075,7 @@ ${o}
|
|
|
3071
3075
|
|
|
3072
3076
|
${o}`;
|
|
3073
3077
|
}
|
|
3074
|
-
const
|
|
3078
|
+
const ai = K.pick({
|
|
3075
3079
|
id: !0,
|
|
3076
3080
|
content: !0,
|
|
3077
3081
|
dueDate: !0,
|
|
@@ -3080,15 +3084,15 @@ const ii = K.pick({
|
|
|
3080
3084
|
hasChildren: s.boolean().describe(
|
|
3081
3085
|
"Whether this subtask has subtasks of its own. Fetch it with includeChildren to expand."
|
|
3082
3086
|
)
|
|
3083
|
-
}),
|
|
3087
|
+
}), ci = re.pick({ id: !0, name: !0 }).extend({
|
|
3084
3088
|
hasChildren: s.boolean().describe(
|
|
3085
3089
|
"Whether this sub-project has sub-projects of its own. Fetch it with includeChildren to expand."
|
|
3086
3090
|
)
|
|
3087
|
-
}),
|
|
3091
|
+
}), di = {
|
|
3088
3092
|
childCount: s.number().optional().describe(
|
|
3089
3093
|
"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
3094
|
),
|
|
3091
|
-
children: s.array(s.union([
|
|
3095
|
+
children: s.array(s.union([ai, ci])).optional().describe(
|
|
3092
3096
|
"Direct children only: subtasks for a task, sub-projects for a project. Completed subtasks and archived sub-projects are excluded."
|
|
3093
3097
|
),
|
|
3094
3098
|
hasMoreChildren: s.boolean().optional().describe(
|
|
@@ -3098,7 +3102,7 @@ const ii = K.pick({
|
|
|
3098
3102
|
'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
3103
|
)
|
|
3100
3104
|
};
|
|
3101
|
-
async function
|
|
3105
|
+
async function li(e, t) {
|
|
3102
3106
|
const { results: r, nextCursor: o } = await e.getTasks({
|
|
3103
3107
|
parentId: t,
|
|
3104
3108
|
limit: j.CHILDREN_MAX
|
|
@@ -3121,10 +3125,10 @@ async function di(e, t) {
|
|
|
3121
3125
|
childrenError: i ? `Could not check ${i} of ${r.length} subtasks for subtasks of their own; those are reported as hasChildren=false.` : void 0
|
|
3122
3126
|
};
|
|
3123
3127
|
}
|
|
3124
|
-
async function
|
|
3128
|
+
async function ui(e, t) {
|
|
3125
3129
|
if (!q(t))
|
|
3126
3130
|
return { childCount: 0, children: [] };
|
|
3127
|
-
const r = await
|
|
3131
|
+
const r = await ys(e), o = /* @__PURE__ */ new Map();
|
|
3128
3132
|
for (const a of r) {
|
|
3129
3133
|
if (!q(a) || !a.parentId) continue;
|
|
3130
3134
|
const c = o.get(a.parentId) ?? [];
|
|
@@ -3154,22 +3158,22 @@ function Rt(e, t) {
|
|
|
3154
3158
|
const r = t.hasMoreChildren ? "+" : "", o = t.childrenError ? " (partial)" : "";
|
|
3155
3159
|
return ` • ${e}=${t.childCount}${r}${o}`;
|
|
3156
3160
|
}
|
|
3157
|
-
const
|
|
3158
|
-
type: s.enum(
|
|
3161
|
+
const Ds = ["task", "project", "comment", "section"], pi = {
|
|
3162
|
+
type: s.enum(Ds).describe("The type of object to fetch."),
|
|
3159
3163
|
id: s.string().min(1).describe("The unique ID of the object to fetch."),
|
|
3160
3164
|
includeChildren: s.boolean().optional().describe(
|
|
3161
3165
|
"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
3166
|
)
|
|
3163
|
-
},
|
|
3164
|
-
type: s.enum(
|
|
3167
|
+
}, hi = {
|
|
3168
|
+
type: s.enum(Ds).describe("The type of object fetched."),
|
|
3165
3169
|
id: s.string().describe("The ID of the fetched object."),
|
|
3166
3170
|
object: s.union([K, re, ve, Y]).describe("The fetched object data."),
|
|
3167
|
-
...
|
|
3168
|
-
},
|
|
3171
|
+
...di
|
|
3172
|
+
}, mi = {
|
|
3169
3173
|
name: g.FETCH_OBJECT,
|
|
3170
3174
|
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:
|
|
3175
|
+
parameters: pi,
|
|
3176
|
+
outputSchema: hi,
|
|
3173
3177
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3174
3178
|
async execute(e, t) {
|
|
3175
3179
|
const { type: r, id: o, includeChildren: n } = e;
|
|
@@ -3178,7 +3182,7 @@ const $s = ["task", "project", "comment", "section"], ui = {
|
|
|
3178
3182
|
case "task": {
|
|
3179
3183
|
const [i, a] = await Promise.all([
|
|
3180
3184
|
t.getTask(o),
|
|
3181
|
-
n ? Ut(() =>
|
|
3185
|
+
n ? Ut(() => li(t, o)) : Promise.resolve({})
|
|
3182
3186
|
]), c = P(i);
|
|
3183
3187
|
return {
|
|
3184
3188
|
textContent: `Found task: ${c.content} • id=${c.id} • priority=${c.priority} • project=${c.projectId}${Rt("subtasks", a)}`,
|
|
@@ -3191,7 +3195,7 @@ const $s = ["task", "project", "comment", "section"], ui = {
|
|
|
3191
3195
|
};
|
|
3192
3196
|
}
|
|
3193
3197
|
case "project": {
|
|
3194
|
-
const i = await t.getProject(o), a = se(i), c = n ? await Ut(() =>
|
|
3198
|
+
const i = await t.getProject(o), a = se(i), c = n ? await Ut(() => ui(t, i)) : {};
|
|
3195
3199
|
return {
|
|
3196
3200
|
textContent: `Found project: ${a.name} • id=${a.id} • color=${a.color} • viewStyle=${a.viewStyle}${Rt("subProjects", c)}`,
|
|
3197
3201
|
structuredContent: {
|
|
@@ -3234,21 +3238,21 @@ const $s = ["task", "project", "comment", "section"], ui = {
|
|
|
3234
3238
|
);
|
|
3235
3239
|
}
|
|
3236
3240
|
}
|
|
3237
|
-
},
|
|
3241
|
+
}, fi = {
|
|
3238
3242
|
id: s.string().min(1).describe(
|
|
3239
3243
|
'A unique identifier for the document in the format "task:{id}" or "project:{id}".'
|
|
3240
3244
|
)
|
|
3241
|
-
},
|
|
3245
|
+
}, bi = {
|
|
3242
3246
|
id: s.string().describe("The ID of the fetched document."),
|
|
3243
3247
|
title: s.string().describe("The title of the document."),
|
|
3244
3248
|
text: s.string().describe("The text content of the document."),
|
|
3245
3249
|
url: s.string().describe("The URL of the document."),
|
|
3246
3250
|
metadata: s.record(s.string(), s.unknown()).optional().describe("Additional metadata about the document.")
|
|
3247
|
-
},
|
|
3251
|
+
}, gi = {
|
|
3248
3252
|
name: g.FETCH,
|
|
3249
3253
|
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:
|
|
3254
|
+
parameters: fi,
|
|
3255
|
+
outputSchema: bi,
|
|
3252
3256
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3253
3257
|
async execute(e, t) {
|
|
3254
3258
|
const { id: r } = e, [o, n] = r.split(":", 2);
|
|
@@ -3258,7 +3262,10 @@ const $s = ["task", "project", "comment", "section"], ui = {
|
|
|
3258
3262
|
);
|
|
3259
3263
|
let i;
|
|
3260
3264
|
if (o === "task") {
|
|
3261
|
-
const a = await t.getTask(n)
|
|
3265
|
+
const a = await t.getTask(n);
|
|
3266
|
+
if (a.isDeleted)
|
|
3267
|
+
throw new Error(`Task ${n} not found: it has been deleted.`);
|
|
3268
|
+
const c = P(a), d = [c.content];
|
|
3262
3269
|
c.description && d.push(`
|
|
3263
3270
|
|
|
3264
3271
|
Description: ${c.description}`), c.dueDate && d.push(`
|
|
@@ -3308,11 +3315,11 @@ Favorite: Yes`), i = {
|
|
|
3308
3315
|
structuredContent: i
|
|
3309
3316
|
};
|
|
3310
3317
|
}
|
|
3311
|
-
},
|
|
3318
|
+
}, yi = s.union([s.iso.date(), s.iso.datetime({ offset: !0 })]);
|
|
3312
3319
|
function Lt(e) {
|
|
3313
|
-
return R(e).pipe(
|
|
3320
|
+
return R(e).pipe(yi.optional());
|
|
3314
3321
|
}
|
|
3315
|
-
const
|
|
3322
|
+
const Ti = {
|
|
3316
3323
|
objectType: s.enum(["task", "project", "comment"]).optional().describe("Type of object to filter by."),
|
|
3317
3324
|
objectId: s.string().optional().describe("Filter by specific object ID (task, project, or comment)."),
|
|
3318
3325
|
eventType: s.enum([
|
|
@@ -3339,17 +3346,17 @@ const yi = {
|
|
|
3339
3346
|
),
|
|
3340
3347
|
limit: s.number().int().min(1).max(j.ACTIVITY_MAX).default(j.ACTIVITY_DEFAULT).describe("Maximum number of activity events to return."),
|
|
3341
3348
|
cursor: s.string().optional().describe("Pagination cursor for retrieving the next page of results.")
|
|
3342
|
-
},
|
|
3343
|
-
events: s.array(
|
|
3349
|
+
}, ki = {
|
|
3350
|
+
events: s.array(qo).describe("The activity events."),
|
|
3344
3351
|
nextCursor: s.string().optional(),
|
|
3345
3352
|
totalCount: s.number().describe("The total number of events in this page."),
|
|
3346
3353
|
hasMore: s.boolean(),
|
|
3347
3354
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
3348
|
-
},
|
|
3355
|
+
}, wi = {
|
|
3349
3356
|
name: g.FIND_ACTIVITY,
|
|
3350
3357
|
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:
|
|
3358
|
+
parameters: Ti,
|
|
3359
|
+
outputSchema: ki,
|
|
3353
3360
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3354
3361
|
async execute(e, t) {
|
|
3355
3362
|
const {
|
|
@@ -3368,9 +3375,9 @@ const yi = {
|
|
|
3368
3375
|
cursor: p ?? null
|
|
3369
3376
|
};
|
|
3370
3377
|
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(
|
|
3378
|
+
const { results: m, nextCursor: y } = await t.getActivityLogs(h), f = m.map(No);
|
|
3372
3379
|
return {
|
|
3373
|
-
textContent:
|
|
3380
|
+
textContent: vi({ events: f, args: e, nextCursor: y }),
|
|
3374
3381
|
structuredContent: {
|
|
3375
3382
|
events: f,
|
|
3376
3383
|
nextCursor: y ?? void 0,
|
|
@@ -3381,7 +3388,7 @@ const yi = {
|
|
|
3381
3388
|
};
|
|
3382
3389
|
}
|
|
3383
3390
|
};
|
|
3384
|
-
function
|
|
3391
|
+
function vi({
|
|
3385
3392
|
events: e,
|
|
3386
3393
|
args: t,
|
|
3387
3394
|
nextCursor: r
|
|
@@ -3402,12 +3409,12 @@ function wi({
|
|
|
3402
3409
|
limit: t.limit,
|
|
3403
3410
|
nextCursor: r ?? void 0,
|
|
3404
3411
|
filterHints: i,
|
|
3405
|
-
previewLines:
|
|
3412
|
+
previewLines: Ii(e, Math.min(e.length, t.limit)),
|
|
3406
3413
|
zeroReasonHints: a
|
|
3407
3414
|
});
|
|
3408
3415
|
}
|
|
3409
|
-
function
|
|
3410
|
-
const o = e.slice(0, t).map(
|
|
3416
|
+
function Ii(e, t = 10) {
|
|
3417
|
+
const o = e.slice(0, t).map(Si).join(`
|
|
3411
3418
|
`);
|
|
3412
3419
|
if (e.length > t) {
|
|
3413
3420
|
const n = e.length - t;
|
|
@@ -3416,8 +3423,8 @@ function vi(e, t = 10) {
|
|
|
3416
3423
|
}
|
|
3417
3424
|
return o;
|
|
3418
3425
|
}
|
|
3419
|
-
function
|
|
3420
|
-
const t =
|
|
3426
|
+
function Si(e) {
|
|
3427
|
+
const t = Ci(e.eventDate), r = `${e.eventType} ${e.objectType}`;
|
|
3421
3428
|
let o = "";
|
|
3422
3429
|
if (e.extraData) {
|
|
3423
3430
|
const c = e.extraData.content || e.extraData.name || e.extraData.last_content;
|
|
@@ -3426,7 +3433,7 @@ function Ii(e) {
|
|
|
3426
3433
|
const n = e.objectId ? ` • id=${e.objectId}` : "", i = e.initiatorId ? ` • by=${e.initiatorId}` : " • system", a = e.parentProjectId ? ` • project=${e.parentProjectId}` : "";
|
|
3427
3434
|
return ` [${t}] ${r}${o}${n}${i}${a}`;
|
|
3428
3435
|
}
|
|
3429
|
-
function
|
|
3436
|
+
function Ci(e) {
|
|
3430
3437
|
try {
|
|
3431
3438
|
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
3439
|
hour: "2-digit",
|
|
@@ -3439,7 +3446,7 @@ function Si(e) {
|
|
|
3439
3446
|
return e;
|
|
3440
3447
|
}
|
|
3441
3448
|
}
|
|
3442
|
-
const
|
|
3449
|
+
const ji = {
|
|
3443
3450
|
taskId: s.string().optional().describe("Find comments for a specific task."),
|
|
3444
3451
|
projectId: s.string().optional().describe(
|
|
3445
3452
|
'Find comments for a specific project. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
@@ -3447,7 +3454,7 @@ const Ci = {
|
|
|
3447
3454
|
commentId: s.string().optional().describe("Get a specific comment by ID."),
|
|
3448
3455
|
cursor: s.string().optional().describe("Pagination cursor for retrieving more results."),
|
|
3449
3456
|
limit: s.number().int().min(1).max(j.COMMENTS_MAX).optional().describe("Maximum number of comments to return")
|
|
3450
|
-
},
|
|
3457
|
+
}, $i = {
|
|
3451
3458
|
comments: s.array(ve).describe("The found comments."),
|
|
3452
3459
|
searchType: s.string().describe(
|
|
3453
3460
|
'The type of search performed: "single" (comment ID), "task" (task ID), or "project" (project ID).'
|
|
@@ -3456,14 +3463,14 @@ const Ci = {
|
|
|
3456
3463
|
hasMore: s.boolean(),
|
|
3457
3464
|
nextCursor: s.string().optional(),
|
|
3458
3465
|
totalCount: s.number().describe("The total number of comments in this page.")
|
|
3459
|
-
},
|
|
3466
|
+
}, Di = {
|
|
3460
3467
|
name: g.FIND_COMMENTS,
|
|
3461
3468
|
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:
|
|
3469
|
+
parameters: ji,
|
|
3470
|
+
outputSchema: $i,
|
|
3464
3471
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3465
3472
|
async execute(e, t) {
|
|
3466
|
-
const r =
|
|
3473
|
+
const r = De(e.cursor), o = [e.taskId, e.projectId, e.commentId].filter(Boolean);
|
|
3467
3474
|
if (o.length === 0)
|
|
3468
3475
|
throw new Error("Must provide exactly one of: taskId, projectId, or commentId.");
|
|
3469
3476
|
if (o.length > 1)
|
|
@@ -3533,7 +3540,7 @@ function Ai({
|
|
|
3533
3540
|
i = `Found ${e.length} ${d} for ${t} ${r}${c}`, o && (i += " • More available");
|
|
3534
3541
|
}
|
|
3535
3542
|
if (n) {
|
|
3536
|
-
const a =
|
|
3543
|
+
const a = vs([], n);
|
|
3537
3544
|
return `${i}
|
|
3538
3545
|
${a}`;
|
|
3539
3546
|
}
|
|
@@ -3543,14 +3550,14 @@ function As(e) {
|
|
|
3543
3550
|
const t = e.getUTCFullYear(), r = String(e.getUTCMonth() + 1).padStart(2, "0"), o = String(e.getUTCDate()).padStart(2, "0");
|
|
3544
3551
|
return `${t}-${r}-${o}`;
|
|
3545
3552
|
}
|
|
3546
|
-
function
|
|
3553
|
+
function xi(e) {
|
|
3547
3554
|
const t = /^([+-])(\d{2}):(\d{2})$/.exec(e);
|
|
3548
3555
|
if (!t)
|
|
3549
3556
|
return 0;
|
|
3550
3557
|
const [, r, o, n] = t, i = Number(o) * 60 + Number(n);
|
|
3551
3558
|
return r === "-" ? -i : i;
|
|
3552
3559
|
}
|
|
3553
|
-
function
|
|
3560
|
+
function Ei(e, t) {
|
|
3554
3561
|
const r = new Date(e.getTime() + t * 60 * 1e3);
|
|
3555
3562
|
return As(r);
|
|
3556
3563
|
}
|
|
@@ -3561,9 +3568,9 @@ function Nt(e, t) {
|
|
|
3561
3568
|
const d = new Date(Date.UTC(i, a - 1, c));
|
|
3562
3569
|
return d.setUTCDate(d.getUTCDate() + t), As(d);
|
|
3563
3570
|
}
|
|
3564
|
-
const
|
|
3571
|
+
const Oi = ["and", "or"], bt = {
|
|
3565
3572
|
labels: s.string().array().optional().describe("The labels to filter the tasks by"),
|
|
3566
|
-
labelsOperator: s.enum(
|
|
3573
|
+
labelsOperator: s.enum(Oi).optional().describe(
|
|
3567
3574
|
'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
3575
|
)
|
|
3569
3576
|
};
|
|
@@ -3572,20 +3579,20 @@ function gt(e = [], t = "or") {
|
|
|
3572
3579
|
const r = t === "and" ? " & " : " | ";
|
|
3573
3580
|
return `(${e.map((i) => i.startsWith("@") ? i : `@${i}`).join(` ${r} `)})`;
|
|
3574
3581
|
}
|
|
3575
|
-
const
|
|
3576
|
-
function
|
|
3582
|
+
const _i = 7;
|
|
3583
|
+
function Pi({
|
|
3577
3584
|
since: e,
|
|
3578
3585
|
until: t,
|
|
3579
3586
|
userGmtOffset: r,
|
|
3580
3587
|
now: o = /* @__PURE__ */ new Date()
|
|
3581
3588
|
}) {
|
|
3582
|
-
const n =
|
|
3589
|
+
const n = xi(r), i = Ei(o, n), a = _i - 1, c = t ?? (e ? Nt(e, a) : i);
|
|
3583
3590
|
return {
|
|
3584
3591
|
since: e ?? Nt(c, -a),
|
|
3585
3592
|
until: c
|
|
3586
3593
|
};
|
|
3587
3594
|
}
|
|
3588
|
-
const
|
|
3595
|
+
const Ui = {
|
|
3589
3596
|
getBy: s.enum(["completion", "due"]).default("completion").describe(
|
|
3590
3597
|
'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
3598
|
),
|
|
@@ -3609,17 +3616,17 @@ const Pi = {
|
|
|
3609
3616
|
"The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters)."
|
|
3610
3617
|
),
|
|
3611
3618
|
...bt
|
|
3612
|
-
},
|
|
3619
|
+
}, Ri = {
|
|
3613
3620
|
tasks: s.array(K).describe("The found completed tasks."),
|
|
3614
3621
|
nextCursor: s.string().optional(),
|
|
3615
3622
|
totalCount: s.number().describe("The total number of tasks in this page."),
|
|
3616
3623
|
hasMore: s.boolean(),
|
|
3617
3624
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
3618
|
-
},
|
|
3625
|
+
}, Li = {
|
|
3619
3626
|
name: g.FIND_COMPLETED_TASKS,
|
|
3620
3627
|
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:
|
|
3628
|
+
parameters: Ui,
|
|
3629
|
+
outputSchema: Ri,
|
|
3623
3630
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3624
3631
|
async execute(e, t) {
|
|
3625
3632
|
const {
|
|
@@ -3632,7 +3639,7 @@ const Pi = {
|
|
|
3632
3639
|
projectId: d,
|
|
3633
3640
|
cursor: u,
|
|
3634
3641
|
...l
|
|
3635
|
-
} = e, p =
|
|
3642
|
+
} = e, p = De(u);
|
|
3636
3643
|
if (p && (!i || !a))
|
|
3637
3644
|
throw new Error(
|
|
3638
3645
|
"Cursor pagination requires explicit since and until. Reuse structuredContent.appliedFilters.since and structuredContent.appliedFilters.until from the previous page."
|
|
@@ -3640,10 +3647,10 @@ const Pi = {
|
|
|
3640
3647
|
const h = await at(t, c), m = h?.email;
|
|
3641
3648
|
let f = gt(o, n);
|
|
3642
3649
|
h && m && (f = me(f, `assigned to: ${m}`));
|
|
3643
|
-
const w = await t.getUser(), C = w.tzInfo?.gmtString || "+00:00",
|
|
3650
|
+
const w = await t.getUser(), C = w.tzInfo?.gmtString || "+00:00", A = await te({
|
|
3644
3651
|
projectId: d,
|
|
3645
3652
|
user: w
|
|
3646
|
-
}), T =
|
|
3653
|
+
}), T = Pi({
|
|
3647
3654
|
since: i,
|
|
3648
3655
|
until: a,
|
|
3649
3656
|
userGmtOffset: C
|
|
@@ -3651,23 +3658,23 @@ const Pi = {
|
|
|
3651
3658
|
...e,
|
|
3652
3659
|
since: T.since,
|
|
3653
3660
|
until: T.until
|
|
3654
|
-
}, { items:
|
|
3661
|
+
}, { items: D, nextCursor: x } = r === "completion" ? await t.getCompletedTasksByCompletionDate({
|
|
3655
3662
|
...l,
|
|
3656
3663
|
...p ? { cursor: p } : {},
|
|
3657
|
-
projectId:
|
|
3664
|
+
projectId: A,
|
|
3658
3665
|
since: k,
|
|
3659
3666
|
until: b,
|
|
3660
3667
|
...f ? { filterQuery: f, filterLang: "en" } : {}
|
|
3661
3668
|
}) : await t.getCompletedTasksByDueDate({
|
|
3662
3669
|
...l,
|
|
3663
3670
|
...p ? { cursor: p } : {},
|
|
3664
|
-
projectId:
|
|
3671
|
+
projectId: A,
|
|
3665
3672
|
since: k,
|
|
3666
3673
|
until: b,
|
|
3667
3674
|
...f ? { filterQuery: f, filterLang: "en" } : {}
|
|
3668
|
-
}), E =
|
|
3675
|
+
}), E = D.map(P);
|
|
3669
3676
|
return {
|
|
3670
|
-
textContent:
|
|
3677
|
+
textContent: Ni({
|
|
3671
3678
|
tasks: E,
|
|
3672
3679
|
args: S,
|
|
3673
3680
|
nextCursor: x,
|
|
@@ -3683,7 +3690,7 @@ const Pi = {
|
|
|
3683
3690
|
};
|
|
3684
3691
|
}
|
|
3685
3692
|
};
|
|
3686
|
-
function
|
|
3693
|
+
function Ni({
|
|
3687
3694
|
tasks: e,
|
|
3688
3695
|
args: t,
|
|
3689
3696
|
nextCursor: r,
|
|
@@ -3709,7 +3716,7 @@ function Li({
|
|
|
3709
3716
|
zeroReasonHints: c
|
|
3710
3717
|
});
|
|
3711
3718
|
}
|
|
3712
|
-
const
|
|
3719
|
+
const Mi = {
|
|
3713
3720
|
searchText: s.string().optional().describe(
|
|
3714
3721
|
'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
3722
|
),
|
|
@@ -3717,7 +3724,7 @@ const Ni = {
|
|
|
3717
3724
|
cursor: s.string().optional().describe(
|
|
3718
3725
|
"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
3726
|
)
|
|
3720
|
-
},
|
|
3727
|
+
}, Fi = {
|
|
3721
3728
|
labels: s.array(ge).describe("The found personal labels."),
|
|
3722
3729
|
nextCursor: s.string().optional(),
|
|
3723
3730
|
totalCount: s.number().describe("The total number of labels in this page."),
|
|
@@ -3726,22 +3733,22 @@ const Ni = {
|
|
|
3726
3733
|
"Names of all shared labels visible to you. These have no IDs or metadata — use their names directly when filtering tasks."
|
|
3727
3734
|
),
|
|
3728
3735
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
3729
|
-
},
|
|
3736
|
+
}, Hi = {
|
|
3730
3737
|
name: g.FIND_LABELS,
|
|
3731
3738
|
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:
|
|
3739
|
+
parameters: Mi,
|
|
3740
|
+
outputSchema: Fi,
|
|
3734
3741
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3735
3742
|
async execute(e, t) {
|
|
3736
3743
|
const [r, o] = await Promise.all([
|
|
3737
|
-
e.searchText ?
|
|
3744
|
+
e.searchText ? Uo(t, e.searchText).then((c) => ({
|
|
3738
3745
|
results: c,
|
|
3739
3746
|
nextCursor: null
|
|
3740
3747
|
})) : t.getLabels({ limit: e.limit, cursor: e.cursor ?? null }),
|
|
3741
|
-
|
|
3748
|
+
Ro(t)
|
|
3742
3749
|
]), { results: n, nextCursor: i } = r, a = e.searchText ? { searchText: e.searchText } : { limit: e.limit, cursor: e.cursor };
|
|
3743
3750
|
return {
|
|
3744
|
-
textContent:
|
|
3751
|
+
textContent: Wi({ labels: n, args: e, nextCursor: i, sharedLabels: o }),
|
|
3745
3752
|
structuredContent: {
|
|
3746
3753
|
labels: n.map((c) => ge.parse(c)),
|
|
3747
3754
|
nextCursor: i ?? void 0,
|
|
@@ -3753,7 +3760,7 @@ const Ni = {
|
|
|
3753
3760
|
};
|
|
3754
3761
|
}
|
|
3755
3762
|
};
|
|
3756
|
-
function
|
|
3763
|
+
function Wi({
|
|
3757
3764
|
labels: e,
|
|
3758
3765
|
args: t,
|
|
3759
3766
|
nextCursor: r,
|
|
@@ -3761,7 +3768,7 @@ function Hi({
|
|
|
3761
3768
|
}) {
|
|
3762
3769
|
const n = t.searchText ? `All labels matching "${t.searchText}"` : "Labels", i = [];
|
|
3763
3770
|
t.searchText && i.push(`searchText: "${t.searchText}"`);
|
|
3764
|
-
const a = 10, d = e.slice(0, a).map(
|
|
3771
|
+
const a = 10, d = e.slice(0, a).map(gn).join(`
|
|
3765
3772
|
`), u = e.length - a, l = u > 0 ? `${d}
|
|
3766
3773
|
…and ${u} more` : d, p = [];
|
|
3767
3774
|
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 +3785,15 @@ No shared labels.`;
|
|
|
3778
3785
|
zeroReasonHints: p
|
|
3779
3786
|
}) + h;
|
|
3780
3787
|
}
|
|
3781
|
-
const { FIND_PROJECTS:
|
|
3788
|
+
const { FIND_PROJECTS: xs, ADD_TASKS: Es, UPDATE_TASKS: Os } = g, Bi = {
|
|
3782
3789
|
projectId: s.string().min(1).optional().describe(
|
|
3783
3790
|
'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
3791
|
),
|
|
3785
3792
|
searchTerm: s.string().optional().describe(
|
|
3786
3793
|
"Search for a user by name or email (partial and case insensitive match). If omitted, all users are returned."
|
|
3787
3794
|
)
|
|
3788
|
-
},
|
|
3789
|
-
collaborators: s.array(
|
|
3795
|
+
}, zi = {
|
|
3796
|
+
collaborators: s.array(Yo).describe("The found users."),
|
|
3790
3797
|
projectInfo: s.object({
|
|
3791
3798
|
id: s.string().describe("The project ID."),
|
|
3792
3799
|
name: s.string().describe("The project name."),
|
|
@@ -3795,16 +3802,16 @@ const { FIND_PROJECTS: Ds, ADD_TASKS: xs, UPDATE_TASKS: Es } = g, Wi = {
|
|
|
3795
3802
|
totalCount: s.number().describe("The total number of users found."),
|
|
3796
3803
|
totalAvailable: s.number().optional().describe("The total number of available users before the search filter was applied."),
|
|
3797
3804
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
3798
|
-
},
|
|
3805
|
+
}, Ki = {
|
|
3799
3806
|
name: g.FIND_PROJECT_COLLABORATORS,
|
|
3800
3807
|
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:
|
|
3808
|
+
parameters: Bi,
|
|
3809
|
+
outputSchema: zi,
|
|
3803
3810
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3804
3811
|
async execute(e, t) {
|
|
3805
3812
|
const { projectId: r, searchTerm: o } = e;
|
|
3806
3813
|
if (!r)
|
|
3807
|
-
return
|
|
3814
|
+
return qi({ searchTerm: o, client: t, appliedFilters: e });
|
|
3808
3815
|
let n = r, i;
|
|
3809
3816
|
try {
|
|
3810
3817
|
if (i = await t.getProject(r), !i)
|
|
@@ -3815,7 +3822,7 @@ const { FIND_PROJECTS: Ds, ADD_TASKS: xs, UPDATE_TASKS: Es } = g, Wi = {
|
|
|
3815
3822
|
|
|
3816
3823
|
**Next steps:**
|
|
3817
3824
|
• Share the project to enable collaboration
|
|
3818
|
-
• Use ${
|
|
3825
|
+
• Use ${Es} and ${Os} for assignment features once shared`,
|
|
3819
3826
|
structuredContent: {
|
|
3820
3827
|
collaborators: [],
|
|
3821
3828
|
projectInfo: {
|
|
@@ -3852,9 +3859,9 @@ const { FIND_PROJECTS: Ds, ADD_TASKS: xs, UPDATE_TASKS: Es } = g, Wi = {
|
|
|
3852
3859
|
appliedFilters: e
|
|
3853
3860
|
}
|
|
3854
3861
|
};
|
|
3855
|
-
const c =
|
|
3862
|
+
const c = _s(a, o);
|
|
3856
3863
|
return {
|
|
3857
|
-
textContent:
|
|
3864
|
+
textContent: Ps({
|
|
3858
3865
|
collaborators: c,
|
|
3859
3866
|
projectName: n,
|
|
3860
3867
|
searchTerm: o,
|
|
@@ -3874,18 +3881,18 @@ const { FIND_PROJECTS: Ds, ADD_TASKS: xs, UPDATE_TASKS: Es } = g, Wi = {
|
|
|
3874
3881
|
};
|
|
3875
3882
|
}
|
|
3876
3883
|
};
|
|
3877
|
-
async function
|
|
3884
|
+
async function qi({
|
|
3878
3885
|
searchTerm: e,
|
|
3879
3886
|
client: t,
|
|
3880
3887
|
appliedFilters: r
|
|
3881
3888
|
}) {
|
|
3882
|
-
const o = await H.getAllCollaborators(t), n = await
|
|
3889
|
+
const o = await H.getAllCollaborators(t), n = await Yi(t, o);
|
|
3883
3890
|
if (n.length === 0)
|
|
3884
3891
|
return {
|
|
3885
3892
|
textContent: `No users found. You may have no shared projects, or collaborator data is not accessible.
|
|
3886
3893
|
|
|
3887
3894
|
**Next steps:**
|
|
3888
|
-
• Use ${
|
|
3895
|
+
• Use ${xs} to find shared projects
|
|
3889
3896
|
• Share a project to add collaborators
|
|
3890
3897
|
• Ensure you have permission to view collaborators`,
|
|
3891
3898
|
structuredContent: {
|
|
@@ -3896,9 +3903,9 @@ async function Ki({
|
|
|
3896
3903
|
appliedFilters: r
|
|
3897
3904
|
}
|
|
3898
3905
|
};
|
|
3899
|
-
const i =
|
|
3906
|
+
const i = _s(n, e);
|
|
3900
3907
|
return {
|
|
3901
|
-
textContent:
|
|
3908
|
+
textContent: Ps({
|
|
3902
3909
|
collaborators: i,
|
|
3903
3910
|
projectName: void 0,
|
|
3904
3911
|
searchTerm: e,
|
|
@@ -3913,7 +3920,7 @@ async function Ki({
|
|
|
3913
3920
|
}
|
|
3914
3921
|
};
|
|
3915
3922
|
}
|
|
3916
|
-
async function
|
|
3923
|
+
async function Yi(e, t) {
|
|
3917
3924
|
try {
|
|
3918
3925
|
const r = await e.getUser();
|
|
3919
3926
|
return !r || t.some((o) => o.id === r.id) ? t : [
|
|
@@ -3924,7 +3931,7 @@ async function qi(e, t) {
|
|
|
3924
3931
|
return t;
|
|
3925
3932
|
}
|
|
3926
3933
|
}
|
|
3927
|
-
function
|
|
3934
|
+
function _s(e, t) {
|
|
3928
3935
|
if (!t)
|
|
3929
3936
|
return e;
|
|
3930
3937
|
const r = t.toLowerCase().trim();
|
|
@@ -3932,7 +3939,7 @@ function Os(e, t) {
|
|
|
3932
3939
|
(o) => o.name.toLowerCase().includes(r) || o.email.toLowerCase().includes(r)
|
|
3933
3940
|
);
|
|
3934
3941
|
}
|
|
3935
|
-
function
|
|
3942
|
+
function Ps({
|
|
3936
3943
|
collaborators: e,
|
|
3937
3944
|
projectName: t,
|
|
3938
3945
|
searchTerm: r,
|
|
@@ -3948,7 +3955,7 @@ function _s({
|
|
|
3948
3955
|
const u = [];
|
|
3949
3956
|
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
3957
|
const l = [];
|
|
3951
|
-
return e.length > 0 ? (l.push(`Use ${
|
|
3958
|
+
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
3959
|
subject: a,
|
|
3953
3960
|
count: e.length,
|
|
3954
3961
|
filterHints: c,
|
|
@@ -3958,11 +3965,11 @@ function _s({
|
|
|
3958
3965
|
nextSteps: l
|
|
3959
3966
|
});
|
|
3960
3967
|
}
|
|
3961
|
-
const { ADD_PROJECTS: Mt } = g,
|
|
3968
|
+
const { ADD_PROJECTS: Mt } = g, Gi = {
|
|
3962
3969
|
active: "projects",
|
|
3963
3970
|
archived: "archived projects",
|
|
3964
3971
|
all: "projects (active and archived)"
|
|
3965
|
-
},
|
|
3972
|
+
}, Vi = {
|
|
3966
3973
|
searchText: s.string().optional().describe(
|
|
3967
3974
|
'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
3975
|
),
|
|
@@ -3973,26 +3980,26 @@ const { ADD_PROJECTS: Mt } = g, Yi = {
|
|
|
3973
3980
|
archivedStatus: s.enum(["active", "archived", "all"]).optional().describe(
|
|
3974
3981
|
"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
3982
|
)
|
|
3976
|
-
},
|
|
3983
|
+
}, Ji = {
|
|
3977
3984
|
projects: s.array(re).describe("The found projects."),
|
|
3978
3985
|
nextCursor: s.string().optional(),
|
|
3979
3986
|
totalCount: s.number().describe("The total number of projects in this page."),
|
|
3980
3987
|
hasMore: s.boolean(),
|
|
3981
3988
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
3982
|
-
},
|
|
3989
|
+
}, Xi = {
|
|
3983
3990
|
name: g.FIND_PROJECTS,
|
|
3984
3991
|
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:
|
|
3992
|
+
parameters: Vi,
|
|
3993
|
+
outputSchema: Ji,
|
|
3987
3994
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3988
3995
|
async execute(e, t) {
|
|
3989
3996
|
const { searchText: r } = e, o = e.archivedStatus ?? "active";
|
|
3990
3997
|
let n, i = null;
|
|
3991
3998
|
if (r || o === "all") {
|
|
3992
3999
|
const c = Promise.resolve([]), [d, u] = await Promise.all([
|
|
3993
|
-
o === "archived" ? c : r ?
|
|
3994
|
-
o === "active" ? c :
|
|
3995
|
-
]), l = r ?
|
|
4000
|
+
o === "archived" ? c : r ? gs(t, r) : ys(t),
|
|
4001
|
+
o === "active" ? c : _o(t)
|
|
4002
|
+
]), l = r ? Po(r) : null, p = l ? u.filter((h) => l.test(h.name)) : u;
|
|
3996
4003
|
n = [...d, ...p];
|
|
3997
4004
|
} else {
|
|
3998
4005
|
const c = o === "archived" ? await t.getArchivedProjects({
|
|
@@ -4003,7 +4010,7 @@ const { ADD_PROJECTS: Mt } = g, Yi = {
|
|
|
4003
4010
|
}
|
|
4004
4011
|
const a = n.map(se);
|
|
4005
4012
|
return {
|
|
4006
|
-
textContent:
|
|
4013
|
+
textContent: Qi({ projects: a, args: e, nextCursor: i }),
|
|
4007
4014
|
structuredContent: {
|
|
4008
4015
|
projects: a,
|
|
4009
4016
|
nextCursor: i ?? void 0,
|
|
@@ -4014,14 +4021,14 @@ const { ADD_PROJECTS: Mt } = g, Yi = {
|
|
|
4014
4021
|
};
|
|
4015
4022
|
}
|
|
4016
4023
|
};
|
|
4017
|
-
function
|
|
4024
|
+
function Qi({
|
|
4018
4025
|
projects: e,
|
|
4019
4026
|
args: t,
|
|
4020
4027
|
nextCursor: r
|
|
4021
4028
|
}) {
|
|
4022
|
-
const o =
|
|
4029
|
+
const o = Gi[t.archivedStatus ?? "active"], n = t.searchText ? `All ${o} matching "${t.searchText}"` : `${o.charAt(0).toUpperCase()}${o.slice(1)}`, i = [];
|
|
4023
4030
|
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(
|
|
4031
|
+
const a = 10, d = e.slice(0, a).map(yn).join(`
|
|
4025
4032
|
`), u = e.length - a, l = u > 0 ? `${d}
|
|
4026
4033
|
…and ${u} more` : d, p = [];
|
|
4027
4034
|
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 +4041,22 @@ function Xi({
|
|
|
4034
4041
|
zeroReasonHints: p
|
|
4035
4042
|
});
|
|
4036
4043
|
}
|
|
4037
|
-
const
|
|
4044
|
+
const Zi = {
|
|
4038
4045
|
taskId: s.string().optional().describe(
|
|
4039
4046
|
"Find all reminders for a specific task. Returns both time-based and location reminders."
|
|
4040
4047
|
),
|
|
4041
4048
|
reminderId: s.string().optional().describe("Get a specific time-based reminder (relative or absolute) by its ID."),
|
|
4042
4049
|
locationReminderId: s.string().optional().describe("Get a specific location reminder by its ID.")
|
|
4043
|
-
},
|
|
4050
|
+
}, ea = {
|
|
4044
4051
|
reminders: s.array(lt).describe("The found reminders (time-based and location)."),
|
|
4045
4052
|
searchType: s.string().describe('The search type used: "task", "reminder", or "location_reminder".'),
|
|
4046
4053
|
searchId: s.string().describe("The ID used for the search."),
|
|
4047
4054
|
totalCount: s.number().describe("Total reminders in this response.")
|
|
4048
|
-
},
|
|
4055
|
+
}, ta = {
|
|
4049
4056
|
name: g.FIND_REMINDERS,
|
|
4050
4057
|
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:
|
|
4058
|
+
parameters: Zi,
|
|
4059
|
+
outputSchema: ea,
|
|
4053
4060
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4054
4061
|
async execute(e, t) {
|
|
4055
4062
|
const { taskId: r, reminderId: o, locationReminderId: n } = e, i = [r, o, n].filter(Boolean);
|
|
@@ -4095,7 +4102,7 @@ const Qi = {
|
|
|
4095
4102
|
})
|
|
4096
4103
|
]), u = [...a, ...c].map(ke);
|
|
4097
4104
|
return {
|
|
4098
|
-
textContent:
|
|
4105
|
+
textContent: sa(u, r),
|
|
4099
4106
|
structuredContent: {
|
|
4100
4107
|
reminders: u,
|
|
4101
4108
|
searchType: "task",
|
|
@@ -4107,10 +4114,10 @@ const Qi = {
|
|
|
4107
4114
|
throw new Error("One of taskId, reminderId, or locationReminderId must be provided.");
|
|
4108
4115
|
}
|
|
4109
4116
|
};
|
|
4110
|
-
function
|
|
4117
|
+
function sa(e, t) {
|
|
4111
4118
|
if (e.length === 0)
|
|
4112
4119
|
return `No reminders found for task ${t}`;
|
|
4113
|
-
const { timeBasedCount: r, locationCount: o } =
|
|
4120
|
+
const { timeBasedCount: r, locationCount: o } = Ts(e), n = [];
|
|
4114
4121
|
if (r > 0) {
|
|
4115
4122
|
const i = r > 1 ? "time-based reminders" : "time-based reminder";
|
|
4116
4123
|
n.push(`${r} ${i}`);
|
|
@@ -4121,22 +4128,22 @@ function ta(e, t) {
|
|
|
4121
4128
|
}
|
|
4122
4129
|
return `Found ${n.join(" and ")} for task ${t}`;
|
|
4123
4130
|
}
|
|
4124
|
-
const { ADD_SECTIONS:
|
|
4131
|
+
const { ADD_SECTIONS: ra } = g, oa = {
|
|
4125
4132
|
projectId: s.string().min(1).describe(
|
|
4126
4133
|
'The ID of the project to search sections in. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
4127
4134
|
),
|
|
4128
4135
|
searchText: s.string().optional().describe(
|
|
4129
4136
|
'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
4137
|
)
|
|
4131
|
-
},
|
|
4138
|
+
}, na = {
|
|
4132
4139
|
sections: s.array(Y).describe("The found sections."),
|
|
4133
4140
|
totalCount: s.number().describe("The total number of sections found."),
|
|
4134
4141
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
4135
|
-
},
|
|
4142
|
+
}, ia = {
|
|
4136
4143
|
name: g.FIND_SECTIONS,
|
|
4137
4144
|
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:
|
|
4145
|
+
parameters: oa,
|
|
4146
|
+
outputSchema: na,
|
|
4140
4147
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4141
4148
|
async execute(e, t) {
|
|
4142
4149
|
const r = await te({
|
|
@@ -4144,12 +4151,12 @@ const { ADD_SECTIONS: sa } = g, ra = {
|
|
|
4144
4151
|
client: t
|
|
4145
4152
|
});
|
|
4146
4153
|
let o;
|
|
4147
|
-
e.searchText ? o = await
|
|
4154
|
+
e.searchText ? o = await Lo(t, e.searchText, r) : o = (await t.getSections({
|
|
4148
4155
|
projectId: r
|
|
4149
4156
|
})).results;
|
|
4150
4157
|
const n = o.map(G);
|
|
4151
4158
|
return {
|
|
4152
|
-
textContent:
|
|
4159
|
+
textContent: aa({
|
|
4153
4160
|
sections: n,
|
|
4154
4161
|
projectId: e.projectId,
|
|
4155
4162
|
searchText: e.searchText
|
|
@@ -4162,13 +4169,13 @@ const { ADD_SECTIONS: sa } = g, ra = {
|
|
|
4162
4169
|
};
|
|
4163
4170
|
}
|
|
4164
4171
|
};
|
|
4165
|
-
function
|
|
4172
|
+
function aa({
|
|
4166
4173
|
sections: e,
|
|
4167
4174
|
projectId: t,
|
|
4168
4175
|
searchText: r
|
|
4169
4176
|
}) {
|
|
4170
4177
|
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 ${
|
|
4178
|
+
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
4179
|
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
4180
|
`) : void 0;
|
|
4174
4181
|
return V({
|
|
@@ -4178,10 +4185,10 @@ function ia({
|
|
|
4178
4185
|
zeroReasonHints: o
|
|
4179
4186
|
});
|
|
4180
4187
|
}
|
|
4181
|
-
function
|
|
4188
|
+
function Us(e) {
|
|
4182
4189
|
return /* @__PURE__ */ new Date(`${e}T00:00:00`);
|
|
4183
4190
|
}
|
|
4184
|
-
const
|
|
4191
|
+
const ca = {
|
|
4185
4192
|
startDate: s.string().regex(/^(\d{4}-\d{2}-\d{2}|today)$/).optional().describe(
|
|
4186
4193
|
"The start date to get the tasks for. Format: YYYY-MM-DD, or 'today', which by default also includes overdue tasks."
|
|
4187
4194
|
),
|
|
@@ -4198,40 +4205,40 @@ const aa = {
|
|
|
4198
4205
|
responsibleUser: s.string().optional().describe(
|
|
4199
4206
|
"Filter tasks assigned to this user. User ID, name, or email. The current user also includes unassigned tasks."
|
|
4200
4207
|
),
|
|
4201
|
-
responsibleUserFiltering: s.enum(
|
|
4208
|
+
responsibleUserFiltering: s.enum(bs).optional().describe(
|
|
4202
4209
|
"Filter when responsibleUser is omitted. 'assigned'=assigned to others; 'unassignedOrMe'=unassigned+mine; 'all'=everyone. Default: 'unassignedOrMe'."
|
|
4203
4210
|
),
|
|
4204
4211
|
...bt
|
|
4205
|
-
},
|
|
4212
|
+
}, da = {
|
|
4206
4213
|
tasks: s.array(K).describe("The found tasks."),
|
|
4207
4214
|
nextCursor: s.string().optional(),
|
|
4208
4215
|
totalCount: s.number().describe("The total number of tasks in this page."),
|
|
4209
4216
|
hasMore: s.boolean(),
|
|
4210
4217
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
4211
|
-
},
|
|
4218
|
+
}, la = {
|
|
4212
4219
|
name: g.FIND_TASKS_BY_DATE,
|
|
4213
4220
|
description: "Get tasks by date range. startDate='today' includes overdue items. Default responsibleUserFiltering='unassignedOrMe' excludes others' tasks.",
|
|
4214
|
-
parameters:
|
|
4215
|
-
outputSchema:
|
|
4221
|
+
parameters: ca,
|
|
4222
|
+
outputSchema: da,
|
|
4216
4223
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4217
4224
|
async execute(e, t) {
|
|
4218
|
-
const r =
|
|
4225
|
+
const r = De(e.cursor);
|
|
4219
4226
|
if (!e.startDate && e.overdueOption !== "overdue-only")
|
|
4220
4227
|
throw new Error(
|
|
4221
4228
|
"Either startDate must be provided or overdueOption must be set to overdue-only"
|
|
4222
4229
|
);
|
|
4223
|
-
const o = await at(t, e.responsibleUser), n = o?.userId, i = o?.email, c = e.responsibleUser?.trim().toLowerCase() ===
|
|
4230
|
+
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
4231
|
let d = "";
|
|
4225
4232
|
if (e.overdueOption === "overdue-only")
|
|
4226
4233
|
d = "overdue";
|
|
4227
4234
|
else if (e.startDate === "today")
|
|
4228
4235
|
if (e.daysCount > 1) {
|
|
4229
|
-
const y = /* @__PURE__ */ new Date(), f = he(y), w = We(y, e.daysCount), C = yt(w, { representation: "date" }),
|
|
4230
|
-
d = e.overdueOption === "exclude-overdue" ?
|
|
4236
|
+
const y = /* @__PURE__ */ new Date(), f = he(y), w = We(y, e.daysCount), C = yt(w, { representation: "date" }), A = `(due after: ${f} | due: ${f}) & due before: ${C}`;
|
|
4237
|
+
d = e.overdueOption === "exclude-overdue" ? A : `(${A} | overdue)`;
|
|
4231
4238
|
} else
|
|
4232
4239
|
d = e.overdueOption === "exclude-overdue" ? "today" : "(today | overdue)";
|
|
4233
4240
|
else if (e.startDate) {
|
|
4234
|
-
const y = e.startDate, f = We(
|
|
4241
|
+
const y = e.startDate, f = We(Us(y), e.daysCount), w = yt(f, { representation: "date" });
|
|
4235
4242
|
d = `(due after: ${y} | due: ${y}) & due before: ${w}`;
|
|
4236
4243
|
}
|
|
4237
4244
|
const u = gt(e.labels, e.labelsOperator);
|
|
@@ -4250,7 +4257,7 @@ const aa = {
|
|
|
4250
4257
|
limit: e.limit
|
|
4251
4258
|
});
|
|
4252
4259
|
return {
|
|
4253
|
-
textContent:
|
|
4260
|
+
textContent: ua({ tasks: p, args: e, nextCursor: h, assigneeEmail: i }),
|
|
4254
4261
|
structuredContent: {
|
|
4255
4262
|
tasks: p,
|
|
4256
4263
|
nextCursor: h ?? void 0,
|
|
@@ -4261,7 +4268,7 @@ const aa = {
|
|
|
4261
4268
|
};
|
|
4262
4269
|
}
|
|
4263
4270
|
};
|
|
4264
|
-
function
|
|
4271
|
+
function ua({
|
|
4265
4272
|
tasks: e,
|
|
4266
4273
|
args: t,
|
|
4267
4274
|
nextCursor: r,
|
|
@@ -4276,7 +4283,7 @@ function la({
|
|
|
4276
4283
|
`today${c}${t.daysCount > 1 ? ` + ${t.daysCount - 1} more days` : ""}`
|
|
4277
4284
|
);
|
|
4278
4285
|
} else if (t.startDate) {
|
|
4279
|
-
const c = t.daysCount > 1 ? ` to ${he(We(
|
|
4286
|
+
const c = t.daysCount > 1 ? ` to ${he(We(Us(t.startDate), t.daysCount))}` : "";
|
|
4280
4287
|
n.push(`${t.startDate}${c}`);
|
|
4281
4288
|
}
|
|
4282
4289
|
if (t.labels && t.labels.length > 0) {
|
|
@@ -4311,13 +4318,13 @@ function la({
|
|
|
4311
4318
|
zeroReasonHints: a
|
|
4312
4319
|
});
|
|
4313
4320
|
}
|
|
4314
|
-
const
|
|
4315
|
-
class
|
|
4321
|
+
const pa = 300 * 1e3;
|
|
4322
|
+
class ha {
|
|
4316
4323
|
constructor() {
|
|
4317
4324
|
this.cache = null;
|
|
4318
4325
|
}
|
|
4319
4326
|
async getFilters(t) {
|
|
4320
|
-
if (this.cache && Date.now() - this.cache.timestamp <
|
|
4327
|
+
if (this.cache && Date.now() - this.cache.timestamp < pa)
|
|
4321
4328
|
return this.cache.filters;
|
|
4322
4329
|
const o = ((await t.sync({
|
|
4323
4330
|
resourceTypes: ["filters"],
|
|
@@ -4374,7 +4381,7 @@ ${l}` + (d.length > 5 ? `
|
|
|
4374
4381
|
this.cache = null;
|
|
4375
4382
|
}
|
|
4376
4383
|
}
|
|
4377
|
-
const
|
|
4384
|
+
const ma = new ha(), { FIND_COMPLETED_TASKS: Ft, ADD_TASKS: Ht } = g, fa = {
|
|
4378
4385
|
searchText: s.string().optional().describe("The text to search for in tasks."),
|
|
4379
4386
|
projectId: s.string().optional().describe(
|
|
4380
4387
|
'Find tasks in this project. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
@@ -4384,7 +4391,7 @@ const ha = new pa(), { FIND_COMPLETED_TASKS: Ft, ADD_TASKS: Ht } = g, ma = {
|
|
|
4384
4391
|
responsibleUser: s.string().optional().describe(
|
|
4385
4392
|
"Find tasks assigned to this user. Can be a user ID, name, or email address. The current user also includes unassigned tasks."
|
|
4386
4393
|
),
|
|
4387
|
-
responsibleUserFiltering: s.enum(
|
|
4394
|
+
responsibleUserFiltering: s.enum(bs).optional().describe(
|
|
4388
4395
|
'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
4396
|
),
|
|
4390
4397
|
limit: s.number().int().min(1).max(j.TASKS_MAX).default(j.TASKS_DEFAULT).describe("The maximum number of tasks to return."),
|
|
@@ -4398,17 +4405,17 @@ const ha = new pa(), { FIND_COMPLETED_TASKS: Ft, ADD_TASKS: Ht } = g, ma = {
|
|
|
4398
4405
|
"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
4406
|
),
|
|
4400
4407
|
...bt
|
|
4401
|
-
},
|
|
4408
|
+
}, ba = {
|
|
4402
4409
|
tasks: s.array(K).describe("The found tasks."),
|
|
4403
4410
|
nextCursor: s.string().optional(),
|
|
4404
4411
|
totalCount: s.number().describe("The total number of tasks in this page."),
|
|
4405
4412
|
hasMore: s.boolean(),
|
|
4406
4413
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
4407
|
-
},
|
|
4414
|
+
}, ga = {
|
|
4408
4415
|
name: g.FIND_TASKS,
|
|
4409
4416
|
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:
|
|
4417
|
+
parameters: fa,
|
|
4418
|
+
outputSchema: ba,
|
|
4412
4419
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4413
4420
|
async execute(e, t) {
|
|
4414
4421
|
const {
|
|
@@ -4424,7 +4431,7 @@ const ha = new pa(), { FIND_COMPLETED_TASKS: Ft, ADD_TASKS: Ht } = g, ma = {
|
|
|
4424
4431
|
labelsOperator: p,
|
|
4425
4432
|
filter: h,
|
|
4426
4433
|
filterIdOrName: m
|
|
4427
|
-
} = e, y =
|
|
4434
|
+
} = e, y = De(u), f = await t.getUser(), w = l && l.length > 0;
|
|
4428
4435
|
if (!r && !o && !n && !i && !a && !w && !h && !m)
|
|
4429
4436
|
throw new Error(
|
|
4430
4437
|
"At least one filter must be provided: searchText, projectId, sectionId, parentId, responsibleUser, labels, filter, or filterIdOrName"
|
|
@@ -4438,8 +4445,8 @@ const ha = new pa(), { FIND_COMPLETED_TASKS: Ft, ADD_TASKS: Ht } = g, ma = {
|
|
|
4438
4445
|
'The `filter`/`filterIdOrName` parameter cannot be combined with projectId, sectionId, or parentId. Use filter syntax instead (e.g. "##ProjectName").'
|
|
4439
4446
|
);
|
|
4440
4447
|
let C = h;
|
|
4441
|
-
m && (C = (await
|
|
4442
|
-
const
|
|
4448
|
+
m && (C = (await ma.resolveFilter(t, m)).filterQuery);
|
|
4449
|
+
const A = await at(t, a), T = A?.userId, I = A?.email;
|
|
4443
4450
|
if (o || n || i) {
|
|
4444
4451
|
const E = {
|
|
4445
4452
|
limit: d,
|
|
@@ -4450,7 +4457,7 @@ const ha = new pa(), { FIND_COMPLETED_TASKS: Ft, ADD_TASKS: Ht } = g, ma = {
|
|
|
4450
4457
|
let M = r ? ie.filter(
|
|
4451
4458
|
(ae) => ae.content.toLowerCase().includes(r.toLowerCase()) || ae.description?.toLowerCase().includes(r.toLowerCase())
|
|
4452
4459
|
) : ie;
|
|
4453
|
-
return M =
|
|
4460
|
+
return M = Oo({
|
|
4454
4461
|
tasks: M,
|
|
4455
4462
|
resolvedAssigneeId: T,
|
|
4456
4463
|
currentUserId: f.id,
|
|
@@ -4506,7 +4513,7 @@ const ha = new pa(), { FIND_COMPLETED_TASKS: Ft, ADD_TASKS: Ht } = g, ma = {
|
|
|
4506
4513
|
};
|
|
4507
4514
|
}
|
|
4508
4515
|
let $ = C ? `(${C})` : "";
|
|
4509
|
-
r && ($ = me($, `search: ${r}`));
|
|
4516
|
+
r && ($ = me($, `search: ${Zt(r)}`));
|
|
4510
4517
|
const k = gt(l, p);
|
|
4511
4518
|
if ($ = me($, k), !(m && !a && !c)) {
|
|
4512
4519
|
const E = Qe({
|
|
@@ -4517,7 +4524,7 @@ const ha = new pa(), { FIND_COMPLETED_TASKS: Ft, ADD_TASKS: Ht } = g, ma = {
|
|
|
4517
4524
|
});
|
|
4518
4525
|
$ = me($, E);
|
|
4519
4526
|
}
|
|
4520
|
-
const { tasks: S, nextCursor:
|
|
4527
|
+
const { tasks: S, nextCursor: D } = await dt({
|
|
4521
4528
|
client: t,
|
|
4522
4529
|
query: $,
|
|
4523
4530
|
cursor: y,
|
|
@@ -4527,21 +4534,21 @@ const ha = new pa(), { FIND_COMPLETED_TASKS: Ft, ADD_TASKS: Ht } = g, ma = {
|
|
|
4527
4534
|
textContent: Re({
|
|
4528
4535
|
tasks: S,
|
|
4529
4536
|
args: e,
|
|
4530
|
-
nextCursor:
|
|
4537
|
+
nextCursor: D,
|
|
4531
4538
|
isContainerSearch: !1,
|
|
4532
4539
|
assigneeEmail: I
|
|
4533
4540
|
}),
|
|
4534
4541
|
structuredContent: {
|
|
4535
4542
|
tasks: S,
|
|
4536
|
-
nextCursor:
|
|
4543
|
+
nextCursor: D ?? void 0,
|
|
4537
4544
|
totalCount: S.length,
|
|
4538
|
-
hasMore: !!
|
|
4545
|
+
hasMore: !!D,
|
|
4539
4546
|
appliedFilters: e
|
|
4540
4547
|
}
|
|
4541
4548
|
};
|
|
4542
4549
|
}
|
|
4543
4550
|
};
|
|
4544
|
-
function
|
|
4551
|
+
function ya(e) {
|
|
4545
4552
|
if (e.projectId) {
|
|
4546
4553
|
const t = [
|
|
4547
4554
|
e.searchText ? "No tasks in project match search" : "Project has no tasks yet"
|
|
@@ -4576,7 +4583,7 @@ function Re({
|
|
|
4576
4583
|
const d = t.labels.map((u) => `@${u}`).join(t.labelsOperator === "and" ? " & " : " | ");
|
|
4577
4584
|
a.push(`labels: ${d}`);
|
|
4578
4585
|
}
|
|
4579
|
-
e.length === 0 && c.push(...
|
|
4586
|
+
e.length === 0 && c.push(...ya(t));
|
|
4580
4587
|
} else {
|
|
4581
4588
|
const d = n || t.responsibleUser, u = [];
|
|
4582
4589
|
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 +4612,11 @@ function Re({
|
|
|
4605
4612
|
zeroReasonHints: c
|
|
4606
4613
|
});
|
|
4607
4614
|
}
|
|
4608
|
-
const
|
|
4615
|
+
const Ta = {
|
|
4609
4616
|
projectId: s.string().min(1).optional().describe(
|
|
4610
4617
|
`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
4618
|
)
|
|
4612
|
-
},
|
|
4619
|
+
}, Rs = s.lazy(
|
|
4613
4620
|
() => s.object({
|
|
4614
4621
|
id: s.string().describe("The project ID."),
|
|
4615
4622
|
name: s.string().describe("The project name."),
|
|
@@ -4617,9 +4624,9 @@ const ya = {
|
|
|
4617
4624
|
folderId: s.string().optional().describe("The folder ID this project belongs to (workspace projects only)."),
|
|
4618
4625
|
childOrder: s.number().describe("The ordering index among siblings."),
|
|
4619
4626
|
sections: s.array(Y),
|
|
4620
|
-
children: s.array(
|
|
4627
|
+
children: s.array(Rs).describe("Nested child projects.")
|
|
4621
4628
|
})
|
|
4622
|
-
),
|
|
4629
|
+
), ka = {
|
|
4623
4630
|
type: s.enum(["account_overview", "project_overview"]).describe("The type of overview returned."),
|
|
4624
4631
|
totalProjects: s.number().optional().describe("Total number of projects (account overview only)."),
|
|
4625
4632
|
totalTasks: s.number().optional().describe("Total number of tasks."),
|
|
@@ -4638,7 +4645,7 @@ const ya = {
|
|
|
4638
4645
|
name: s.string().describe("The inbox project name."),
|
|
4639
4646
|
sections: s.array(Y).describe("Sections in the inbox project.")
|
|
4640
4647
|
}).optional().describe("Inbox information (account overview only)."),
|
|
4641
|
-
projects: s.array(s.lazy(() =>
|
|
4648
|
+
projects: s.array(s.lazy(() => Rs)).optional().describe(
|
|
4642
4649
|
"List of projects with hierarchy, folders, and ordering (account overview only)."
|
|
4643
4650
|
),
|
|
4644
4651
|
project: s.object({
|
|
@@ -4653,7 +4660,7 @@ const ya = {
|
|
|
4653
4660
|
tasksWithoutSection: s.number()
|
|
4654
4661
|
}).optional().describe("Statistics object (project overview only).")
|
|
4655
4662
|
};
|
|
4656
|
-
function
|
|
4663
|
+
function wa(e) {
|
|
4657
4664
|
const t = {};
|
|
4658
4665
|
for (const n of e)
|
|
4659
4666
|
t[n.id] = {
|
|
@@ -4678,7 +4685,7 @@ function ka(e) {
|
|
|
4678
4685
|
}
|
|
4679
4686
|
return o(r), r;
|
|
4680
4687
|
}
|
|
4681
|
-
async function
|
|
4688
|
+
async function va(e, t) {
|
|
4682
4689
|
const r = {};
|
|
4683
4690
|
return await Promise.all(
|
|
4684
4691
|
t.map(async (o) => {
|
|
@@ -4687,14 +4694,14 @@ async function wa(e, t) {
|
|
|
4687
4694
|
})
|
|
4688
4695
|
), r;
|
|
4689
4696
|
}
|
|
4690
|
-
function
|
|
4697
|
+
function Ls(e, t, r = "") {
|
|
4691
4698
|
const o = [];
|
|
4692
4699
|
o.push(`${r}- Project: ${e.name} (id=${e.id})`);
|
|
4693
4700
|
const n = t[e.id] || [];
|
|
4694
4701
|
for (const i of n)
|
|
4695
4702
|
o.push(`${r} - Section: ${i.name} (id=${i.id})`);
|
|
4696
4703
|
for (const i of e.children)
|
|
4697
|
-
o.push(...
|
|
4704
|
+
o.push(...Ls(i, t, `${r} `));
|
|
4698
4705
|
return o;
|
|
4699
4706
|
}
|
|
4700
4707
|
function Wt(e) {
|
|
@@ -4722,7 +4729,7 @@ function Ze(e, t = "") {
|
|
|
4722
4729
|
}
|
|
4723
4730
|
return r;
|
|
4724
4731
|
}
|
|
4725
|
-
function
|
|
4732
|
+
function Ns(e, t) {
|
|
4726
4733
|
return {
|
|
4727
4734
|
id: e.id,
|
|
4728
4735
|
name: e.name,
|
|
@@ -4731,11 +4738,11 @@ function Ls(e, t) {
|
|
|
4731
4738
|
childOrder: e.childOrder,
|
|
4732
4739
|
sections: (t[e.id] || []).map(G),
|
|
4733
4740
|
children: e.children.map(
|
|
4734
|
-
(r) =>
|
|
4741
|
+
(r) => Ns(r, t)
|
|
4735
4742
|
)
|
|
4736
4743
|
};
|
|
4737
4744
|
}
|
|
4738
|
-
async function
|
|
4745
|
+
async function Ia(e, t) {
|
|
4739
4746
|
let r = [], o;
|
|
4740
4747
|
do {
|
|
4741
4748
|
const { results: n, nextCursor: i } = await e.getTasks({
|
|
@@ -4747,12 +4754,12 @@ async function va(e, t) {
|
|
|
4747
4754
|
} while (o);
|
|
4748
4755
|
return r;
|
|
4749
4756
|
}
|
|
4750
|
-
async function
|
|
4757
|
+
async function Sa(e, t) {
|
|
4751
4758
|
const { results: r } = await e.getSections({ projectId: t });
|
|
4752
4759
|
return r;
|
|
4753
4760
|
}
|
|
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 =
|
|
4761
|
+
async function Ca(e) {
|
|
4762
|
+
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
4763
|
if (r) {
|
|
4757
4764
|
c.push(`- Inbox Project: ${r.name} (id=${r.id})`);
|
|
4758
4765
|
for (const p of a[r.id] || [])
|
|
@@ -4760,7 +4767,7 @@ async function Sa(e) {
|
|
|
4760
4767
|
}
|
|
4761
4768
|
if (n.length)
|
|
4762
4769
|
for (const p of n)
|
|
4763
|
-
c.push(...
|
|
4770
|
+
c.push(...Ls(p, a));
|
|
4764
4771
|
else
|
|
4765
4772
|
c.push("_No projects found._");
|
|
4766
4773
|
c.push(""), c.push(
|
|
@@ -4781,7 +4788,7 @@ async function Sa(e) {
|
|
|
4781
4788
|
sections: (a[r.id] || []).map(G)
|
|
4782
4789
|
} : void 0,
|
|
4783
4790
|
projects: n.map(
|
|
4784
|
-
(p) =>
|
|
4791
|
+
(p) => Ns(p, a)
|
|
4785
4792
|
),
|
|
4786
4793
|
totalProjects: t.length,
|
|
4787
4794
|
totalSections: i.reduce(
|
|
@@ -4792,11 +4799,11 @@ async function Sa(e) {
|
|
|
4792
4799
|
};
|
|
4793
4800
|
return { textContent: u, structuredContent: l };
|
|
4794
4801
|
}
|
|
4795
|
-
async function
|
|
4802
|
+
async function ja(e, t) {
|
|
4796
4803
|
const [r, o, n] = await Promise.all([
|
|
4797
4804
|
e.getProject(t),
|
|
4798
|
-
|
|
4799
|
-
|
|
4805
|
+
Sa(e, t),
|
|
4806
|
+
Ia(e, t)
|
|
4800
4807
|
]), i = {};
|
|
4801
4808
|
for (const l of o)
|
|
4802
4809
|
i[l.id] = [];
|
|
@@ -4838,20 +4845,20 @@ async function Ca(e, t) {
|
|
|
4838
4845
|
};
|
|
4839
4846
|
return { textContent: d, structuredContent: u };
|
|
4840
4847
|
}
|
|
4841
|
-
const
|
|
4848
|
+
const $a = {
|
|
4842
4849
|
name: g.GET_OVERVIEW,
|
|
4843
4850
|
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:
|
|
4851
|
+
parameters: Ta,
|
|
4852
|
+
outputSchema: ka,
|
|
4846
4853
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4847
4854
|
async execute(e, t) {
|
|
4848
|
-
const r = await te({ projectId: e.projectId, client: t }), o = r ? await
|
|
4855
|
+
const r = await te({ projectId: e.projectId, client: t }), o = r ? await ja(t, r) : await Ca(t);
|
|
4849
4856
|
return {
|
|
4850
4857
|
textContent: o.textContent,
|
|
4851
4858
|
structuredContent: o.structuredContent
|
|
4852
4859
|
};
|
|
4853
4860
|
}
|
|
4854
|
-
},
|
|
4861
|
+
}, Da = {}, pe = s.object({
|
|
4855
4862
|
count: s.number().describe("Number of consecutive periods in this streak."),
|
|
4856
4863
|
start: s.string().describe("Start date of the streak."),
|
|
4857
4864
|
end: s.string().describe("End date of the streak.")
|
|
@@ -4907,10 +4914,10 @@ const ja = {
|
|
|
4907
4914
|
})
|
|
4908
4915
|
).describe("Recent karma change events with reasons."),
|
|
4909
4916
|
projectColors: s.record(s.string(), s.string()).describe("Map of project ID to color key.")
|
|
4910
|
-
},
|
|
4917
|
+
}, xa = {
|
|
4911
4918
|
name: g.GET_PRODUCTIVITY_STATS,
|
|
4912
4919
|
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:
|
|
4920
|
+
parameters: Da,
|
|
4914
4921
|
outputSchema: Aa,
|
|
4915
4922
|
annotations: {
|
|
4916
4923
|
readOnlyHint: !0,
|
|
@@ -4920,7 +4927,7 @@ const ja = {
|
|
|
4920
4927
|
async execute(e, t) {
|
|
4921
4928
|
const r = await t.getProductivityStats();
|
|
4922
4929
|
return {
|
|
4923
|
-
textContent:
|
|
4930
|
+
textContent: Ea(r),
|
|
4924
4931
|
structuredContent: {
|
|
4925
4932
|
completedCount: r.completedCount,
|
|
4926
4933
|
daysItems: r.daysItems,
|
|
@@ -4947,7 +4954,7 @@ const ja = {
|
|
|
4947
4954
|
};
|
|
4948
4955
|
}
|
|
4949
4956
|
};
|
|
4950
|
-
function
|
|
4957
|
+
function Ea(e) {
|
|
4951
4958
|
const t = [
|
|
4952
4959
|
"# Productivity Statistics",
|
|
4953
4960
|
"",
|
|
@@ -4977,11 +4984,11 @@ function xa(e) {
|
|
|
4977
4984
|
return t.join(`
|
|
4978
4985
|
`);
|
|
4979
4986
|
}
|
|
4980
|
-
const
|
|
4987
|
+
const Oa = {
|
|
4981
4988
|
projectId: s.string().min(1).describe("The ID of the project to get activity stats for."),
|
|
4982
4989
|
weeks: s.number().int().min(1).max(12).optional().describe("Number of weeks of activity data to retrieve (1-12, default 2)."),
|
|
4983
4990
|
includeWeeklyCounts: s.boolean().optional().describe("Include weekly rollup counts alongside daily counts.")
|
|
4984
|
-
},
|
|
4991
|
+
}, _a = {
|
|
4985
4992
|
projectId: s.string().describe("The project ID."),
|
|
4986
4993
|
dayItems: s.array(
|
|
4987
4994
|
s.object({
|
|
@@ -4997,7 +5004,7 @@ const Ea = {
|
|
|
4997
5004
|
})
|
|
4998
5005
|
).optional().describe("Weekly completion rollups. Only included when includeWeeklyCounts is true.")
|
|
4999
5006
|
};
|
|
5000
|
-
function
|
|
5007
|
+
function Pa(e, t) {
|
|
5001
5008
|
const r = [`# Activity Stats: Project ${e}`, ""];
|
|
5002
5009
|
if (t.dayItems.length > 0) {
|
|
5003
5010
|
r.push("## Daily Activity");
|
|
@@ -5013,11 +5020,11 @@ function _a(e, t) {
|
|
|
5013
5020
|
return r.join(`
|
|
5014
5021
|
`);
|
|
5015
5022
|
}
|
|
5016
|
-
const
|
|
5023
|
+
const Ua = {
|
|
5017
5024
|
name: g.GET_PROJECT_ACTIVITY_STATS,
|
|
5018
5025
|
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:
|
|
5026
|
+
parameters: Oa,
|
|
5027
|
+
outputSchema: _a,
|
|
5021
5028
|
annotations: {
|
|
5022
5029
|
readOnlyHint: !0,
|
|
5023
5030
|
destructiveHint: !1,
|
|
@@ -5029,7 +5036,7 @@ const Pa = {
|
|
|
5029
5036
|
includeWeeklyCounts: n
|
|
5030
5037
|
});
|
|
5031
5038
|
return {
|
|
5032
|
-
textContent:
|
|
5039
|
+
textContent: Pa(r, i),
|
|
5033
5040
|
structuredContent: {
|
|
5034
5041
|
projectId: r,
|
|
5035
5042
|
dayItems: i.dayItems,
|
|
@@ -5037,12 +5044,12 @@ const Pa = {
|
|
|
5037
5044
|
}
|
|
5038
5045
|
};
|
|
5039
5046
|
}
|
|
5040
|
-
},
|
|
5047
|
+
}, Ra = {
|
|
5041
5048
|
projectId: s.string().min(1).describe("The ID of the project to check health for."),
|
|
5042
5049
|
includeContext: s.boolean().default(!1).describe(
|
|
5043
5050
|
"Include detailed health context with project metrics and task-level data. May produce large output for projects with many tasks."
|
|
5044
5051
|
)
|
|
5045
|
-
},
|
|
5052
|
+
}, La = s.object({
|
|
5046
5053
|
id: s.string().describe("The task ID."),
|
|
5047
5054
|
content: s.string().describe("The task content/title."),
|
|
5048
5055
|
priority: s.string().describe("The task priority (1-4)."),
|
|
@@ -5050,7 +5057,7 @@ const Pa = {
|
|
|
5050
5057
|
deadline: s.string().optional().describe("The deadline date string, if set."),
|
|
5051
5058
|
isCompleted: s.boolean().describe("Whether the task is completed."),
|
|
5052
5059
|
labels: s.array(s.string()).describe("Labels applied to this task.")
|
|
5053
|
-
}),
|
|
5060
|
+
}), Na = {
|
|
5054
5061
|
projectId: s.string().describe("The project ID."),
|
|
5055
5062
|
projectName: s.string().describe("The project name."),
|
|
5056
5063
|
progress: s.object({
|
|
@@ -5076,12 +5083,12 @@ const Pa = {
|
|
|
5076
5083
|
tasksCompletedThisWeek: s.number().describe("Tasks completed in the current week."),
|
|
5077
5084
|
averageCompletionTime: s.number().optional().describe("Average task completion time in days, if available.")
|
|
5078
5085
|
}).describe("Aggregated project metrics."),
|
|
5079
|
-
tasks: s.array(
|
|
5086
|
+
tasks: s.array(La).describe("Tasks in the project.")
|
|
5080
5087
|
}).optional().describe(
|
|
5081
5088
|
"Detailed project context with metrics and task data. Only included when includeContext is true."
|
|
5082
5089
|
)
|
|
5083
5090
|
};
|
|
5084
|
-
async function
|
|
5091
|
+
async function Ma(e, t, r) {
|
|
5085
5092
|
if (r) {
|
|
5086
5093
|
const [i, a, c] = await Promise.all([
|
|
5087
5094
|
e.getProjectProgress(t),
|
|
@@ -5096,7 +5103,7 @@ async function Na(e, t, r) {
|
|
|
5096
5103
|
]);
|
|
5097
5104
|
return { progress: o, health: n };
|
|
5098
5105
|
}
|
|
5099
|
-
function
|
|
5106
|
+
function Fa(e, { progress: t, health: r, context: o }) {
|
|
5100
5107
|
const n = [`# Project Health: ${e}`, ""];
|
|
5101
5108
|
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
5109
|
`**Completed:** ${t.completedCount} | **Active:** ${t.activeCount} | **Progress:** ${t.progressPercent}%`
|
|
@@ -5114,18 +5121,18 @@ function Ma(e, { progress: t, health: r, context: o }) {
|
|
|
5114
5121
|
return n.join(`
|
|
5115
5122
|
`);
|
|
5116
5123
|
}
|
|
5117
|
-
const
|
|
5124
|
+
const Ha = {
|
|
5118
5125
|
name: g.GET_PROJECT_HEALTH,
|
|
5119
5126
|
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:
|
|
5127
|
+
parameters: Ra,
|
|
5128
|
+
outputSchema: Na,
|
|
5122
5129
|
annotations: {
|
|
5123
5130
|
readOnlyHint: !0,
|
|
5124
5131
|
destructiveHint: !1,
|
|
5125
5132
|
idempotentHint: !0
|
|
5126
5133
|
},
|
|
5127
5134
|
async execute(e, t) {
|
|
5128
|
-
const { projectId: r, includeContext: o } = e, n = await
|
|
5135
|
+
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
5136
|
projectDescription: n.context.projectDescription ?? void 0,
|
|
5130
5137
|
projectMetrics: {
|
|
5131
5138
|
...n.context.projectMetrics,
|
|
@@ -5163,12 +5170,12 @@ const Fa = {
|
|
|
5163
5170
|
}
|
|
5164
5171
|
};
|
|
5165
5172
|
}
|
|
5166
|
-
},
|
|
5173
|
+
}, Wa = {
|
|
5167
5174
|
workspaceIdOrName: s.string().min(1).describe(
|
|
5168
5175
|
"The workspace ID or name. Supports exact ID, exact name match (case-insensitive), or unique partial name match."
|
|
5169
5176
|
),
|
|
5170
5177
|
projectIds: s.array(s.string().min(1)).min(1).optional().describe("Optional list of project IDs to scope insights to specific projects.")
|
|
5171
|
-
},
|
|
5178
|
+
}, Ba = s.object({
|
|
5172
5179
|
projectId: s.string().describe("The project ID."),
|
|
5173
5180
|
health: s.object({
|
|
5174
5181
|
status: s.enum(tt).describe("The health status of the project."),
|
|
@@ -5180,22 +5187,22 @@ const Fa = {
|
|
|
5180
5187
|
activeCount: s.number().describe("Number of active tasks."),
|
|
5181
5188
|
progressPercent: s.number().describe("Completion percentage (0-100).")
|
|
5182
5189
|
}).optional().describe("Progress data for this project. Omitted when the project has none.")
|
|
5183
|
-
}),
|
|
5190
|
+
}), za = {
|
|
5184
5191
|
workspaceId: s.string().describe("The resolved workspace ID."),
|
|
5185
5192
|
workspaceName: s.string().describe("The resolved workspace name."),
|
|
5186
|
-
projectInsights: s.array(
|
|
5187
|
-
},
|
|
5193
|
+
projectInsights: s.array(Ba).describe("Health and progress insights for each project in the workspace.")
|
|
5194
|
+
}, Ka = {
|
|
5188
5195
|
name: g.GET_WORKSPACE_INSIGHTS,
|
|
5189
5196
|
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:
|
|
5197
|
+
parameters: Wa,
|
|
5198
|
+
outputSchema: za,
|
|
5192
5199
|
annotations: {
|
|
5193
5200
|
readOnlyHint: !0,
|
|
5194
5201
|
destructiveHint: !1,
|
|
5195
5202
|
idempotentHint: !0
|
|
5196
5203
|
},
|
|
5197
5204
|
async execute(e, t) {
|
|
5198
|
-
const { workspaceIdOrName: r, projectIds: o } = e, n = await
|
|
5205
|
+
const { workspaceIdOrName: r, projectIds: o } = e, n = await Is.resolveWorkspace(t, r), a = (await t.getWorkspaceInsights(n.workspaceId, { projectIds: o })).projectInsights.map((d) => ({
|
|
5199
5206
|
projectId: d.projectId,
|
|
5200
5207
|
health: d.health ? {
|
|
5201
5208
|
status: d.health.status,
|
|
@@ -5228,7 +5235,7 @@ const Fa = {
|
|
|
5228
5235
|
};
|
|
5229
5236
|
}
|
|
5230
5237
|
};
|
|
5231
|
-
function
|
|
5238
|
+
function qa(e) {
|
|
5232
5239
|
const t = e.trim();
|
|
5233
5240
|
if (!/^https?:\/\//i.test(t))
|
|
5234
5241
|
return t;
|
|
@@ -5238,21 +5245,21 @@ function Ka(e) {
|
|
|
5238
5245
|
} catch {
|
|
5239
5246
|
throw new Error(`Could not read a template ID from "${t}".`);
|
|
5240
5247
|
}
|
|
5241
|
-
if (!
|
|
5248
|
+
if (!Ya(r.hostname))
|
|
5242
5249
|
throw new Error(
|
|
5243
5250
|
`"${r.hostname}" is not a Todoist domain. Pass a todoist.com template URL or the template ID itself.`
|
|
5244
5251
|
);
|
|
5245
5252
|
r.hostname = "todoist.com";
|
|
5246
|
-
const o =
|
|
5253
|
+
const o = er(r.toString());
|
|
5247
5254
|
if (o?.type !== "template")
|
|
5248
5255
|
throw new Error(`"${t}" is not a Todoist template URL.`);
|
|
5249
5256
|
return o.id;
|
|
5250
5257
|
}
|
|
5251
|
-
function
|
|
5258
|
+
function Ya(e) {
|
|
5252
5259
|
const t = e.toLowerCase();
|
|
5253
5260
|
return t === "todoist.com" || t.endsWith(".todoist.com");
|
|
5254
5261
|
}
|
|
5255
|
-
const
|
|
5262
|
+
const Ga = {
|
|
5256
5263
|
projectId: s.string().min(1).describe("The ID of the existing project to import the template into."),
|
|
5257
5264
|
templateId: s.string().optional().describe(
|
|
5258
5265
|
'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 +5268,16 @@ const Ya = {
|
|
|
5261
5268
|
"Raw CSV template content, as produced by export-project-template. Provide either this or `templateId`, not both."
|
|
5262
5269
|
),
|
|
5263
5270
|
locale: s.string().optional().describe('Locale for the imported content when using `templateId`. Defaults to "en".')
|
|
5264
|
-
},
|
|
5271
|
+
}, Va = {
|
|
5265
5272
|
sections: s.array(Y).describe("Sections created by the import."),
|
|
5266
5273
|
tasks: s.array(K).describe("Tasks created by the import."),
|
|
5267
5274
|
comments: s.array(ve).describe("Comments created by the import."),
|
|
5268
5275
|
totalCount: s.number().describe("The total number of objects created by the import.")
|
|
5269
|
-
},
|
|
5276
|
+
}, Ja = {
|
|
5270
5277
|
name: g.IMPORT_PROJECT_TEMPLATE,
|
|
5271
5278
|
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:
|
|
5279
|
+
parameters: Ga,
|
|
5280
|
+
outputSchema: Va,
|
|
5274
5281
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
5275
5282
|
async execute({ projectId: e, templateId: t, csvFileContent: r, locale: o }, n) {
|
|
5276
5283
|
if (!!t == !!r)
|
|
@@ -5279,7 +5286,7 @@ const Ya = {
|
|
|
5279
5286
|
);
|
|
5280
5287
|
const i = t ? await n.importTemplateFromId({
|
|
5281
5288
|
projectId: e,
|
|
5282
|
-
templateId:
|
|
5289
|
+
templateId: qa(t),
|
|
5283
5290
|
locale: o
|
|
5284
5291
|
}) : await n.importTemplateIntoProject({
|
|
5285
5292
|
projectId: e,
|
|
@@ -5287,7 +5294,7 @@ const Ya = {
|
|
|
5287
5294
|
fileName: "template.csv"
|
|
5288
5295
|
}), 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
5296
|
return {
|
|
5290
|
-
textContent:
|
|
5297
|
+
textContent: Xa({
|
|
5291
5298
|
projectId: e,
|
|
5292
5299
|
counts: {
|
|
5293
5300
|
projects: i.projects.length,
|
|
@@ -5301,7 +5308,7 @@ const Ya = {
|
|
|
5301
5308
|
};
|
|
5302
5309
|
}
|
|
5303
5310
|
};
|
|
5304
|
-
function
|
|
5311
|
+
function Xa({
|
|
5305
5312
|
projectId: e,
|
|
5306
5313
|
counts: t,
|
|
5307
5314
|
totalCount: r
|
|
@@ -5311,21 +5318,21 @@ function Ja({
|
|
|
5311
5318
|
const o = Object.entries(t).filter(([, n]) => n > 0).map(([n, i]) => `${i} ${i === 1 ? n.replace(/s$/, "") : n}`);
|
|
5312
5319
|
return `Imported template into project (id=${e}): ${o.join(", ")}.`;
|
|
5313
5320
|
}
|
|
5314
|
-
const
|
|
5321
|
+
const Qa = {}, Za = {
|
|
5315
5322
|
id: s.string().describe("The unique identifier for the workspace."),
|
|
5316
5323
|
name: s.string().describe("The name of the workspace."),
|
|
5317
|
-
plan: s.enum(
|
|
5318
|
-
role: s.enum(
|
|
5324
|
+
plan: s.enum(sr).describe("The workspace plan type."),
|
|
5325
|
+
role: s.enum(tr).optional().describe("The user's role in the workspace, if available."),
|
|
5319
5326
|
isLinkSharingEnabled: s.boolean().describe("Whether link sharing is enabled for the workspace."),
|
|
5320
5327
|
isGuestAllowed: s.boolean().describe("Whether guests are allowed in the workspace."),
|
|
5321
5328
|
createdAt: s.string().optional().describe("The ISO 8601 timestamp when the workspace was created."),
|
|
5322
5329
|
creatorId: s.string().describe("The ID of the user who created the workspace.")
|
|
5323
|
-
},
|
|
5330
|
+
}, ec = {
|
|
5324
5331
|
type: s.literal("workspaces").describe("The type of the response."),
|
|
5325
|
-
workspaces: s.array(s.object(
|
|
5332
|
+
workspaces: s.array(s.object(Za)).describe("List of workspaces."),
|
|
5326
5333
|
count: s.number().describe("The total number of workspaces.")
|
|
5327
5334
|
};
|
|
5328
|
-
async function
|
|
5335
|
+
async function tc(e) {
|
|
5329
5336
|
const r = (await e.getWorkspaces()).map((a) => ({
|
|
5330
5337
|
id: a.id,
|
|
5331
5338
|
name: a.name,
|
|
@@ -5356,22 +5363,22 @@ async function ec(e) {
|
|
|
5356
5363
|
};
|
|
5357
5364
|
return { textContent: n, structuredContent: i };
|
|
5358
5365
|
}
|
|
5359
|
-
const
|
|
5366
|
+
const sc = {
|
|
5360
5367
|
name: g.LIST_WORKSPACES,
|
|
5361
5368
|
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:
|
|
5369
|
+
parameters: Qa,
|
|
5370
|
+
outputSchema: ec,
|
|
5364
5371
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
5365
5372
|
async execute(e, t) {
|
|
5366
|
-
const r = await
|
|
5373
|
+
const r = await tc(t);
|
|
5367
5374
|
return {
|
|
5368
5375
|
textContent: r.textContent,
|
|
5369
5376
|
structuredContent: r.structuredContent
|
|
5370
5377
|
};
|
|
5371
5378
|
}
|
|
5372
|
-
}, { FIND_TASKS:
|
|
5379
|
+
}, { FIND_TASKS: rc, FIND_PROJECT_COLLABORATORS: zt, UPDATE_TASKS: oc } = g, nc = 50, ic = {
|
|
5373
5380
|
operation: s.enum(["assign", "unassign", "reassign"]).describe("The assignment operation to perform."),
|
|
5374
|
-
taskIds: s.array(s.string()).min(1).max(
|
|
5381
|
+
taskIds: s.array(s.string()).min(1).max(nc).describe("The IDs of the tasks to operate on (max 50)."),
|
|
5375
5382
|
responsibleUser: s.string().optional().describe(
|
|
5376
5383
|
'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
5384
|
),
|
|
@@ -5379,7 +5386,7 @@ const tc = {
|
|
|
5379
5386
|
"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
5387
|
),
|
|
5381
5388
|
dryRun: s.boolean().optional().default(!1).describe("If true, validates operations without executing them.")
|
|
5382
|
-
},
|
|
5389
|
+
}, ac = {
|
|
5383
5390
|
results: s.array(
|
|
5384
5391
|
s.object({
|
|
5385
5392
|
taskId: s.string().describe("The ID of the task."),
|
|
@@ -5395,11 +5402,11 @@ const tc = {
|
|
|
5395
5402
|
failed: s.number().describe("Number of failed operations."),
|
|
5396
5403
|
dryRun: s.boolean().describe("Whether this was a dry run.")
|
|
5397
5404
|
}).optional().describe("Summary of the operation.")
|
|
5398
|
-
},
|
|
5405
|
+
}, cc = {
|
|
5399
5406
|
name: g.MANAGE_ASSIGNMENTS,
|
|
5400
5407
|
description: "Bulk assignment operations for multiple tasks. Supports assign, unassign, and reassign operations with atomic rollback on failures.",
|
|
5401
|
-
parameters:
|
|
5402
|
-
outputSchema:
|
|
5408
|
+
parameters: ic,
|
|
5409
|
+
outputSchema: ac,
|
|
5403
5410
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5404
5411
|
async execute(e, t) {
|
|
5405
5412
|
const { operation: r, taskIds: o, responsibleUser: n, fromAssigneeUser: i, dryRun: a } = e;
|
|
@@ -5442,10 +5449,10 @@ const tc = {
|
|
|
5442
5449
|
});
|
|
5443
5450
|
if (r === "unassign") {
|
|
5444
5451
|
if (a) {
|
|
5445
|
-
const b = d.map((
|
|
5446
|
-
taskId:
|
|
5452
|
+
const b = d.map((D) => ({
|
|
5453
|
+
taskId: D.id,
|
|
5447
5454
|
success: !0,
|
|
5448
|
-
originalAssigneeId:
|
|
5455
|
+
originalAssigneeId: D.responsibleUid ?? void 0,
|
|
5449
5456
|
newAssigneeId: void 0
|
|
5450
5457
|
}));
|
|
5451
5458
|
return {
|
|
@@ -5519,7 +5526,7 @@ const tc = {
|
|
|
5519
5526
|
);
|
|
5520
5527
|
if (!I)
|
|
5521
5528
|
return $.map(({ assignment: b, validation: S }) => {
|
|
5522
|
-
const
|
|
5529
|
+
const D = d.find((x) => x.id === b.taskId);
|
|
5523
5530
|
if (!b.taskId || !S.resolvedUser?.userId)
|
|
5524
5531
|
throw new Error(
|
|
5525
5532
|
"Invalid assignment or validation data - this should not happen"
|
|
@@ -5527,19 +5534,19 @@ const tc = {
|
|
|
5527
5534
|
return {
|
|
5528
5535
|
taskId: b.taskId,
|
|
5529
5536
|
success: !0,
|
|
5530
|
-
originalAssigneeId:
|
|
5537
|
+
originalAssigneeId: D?.responsibleUid ?? void 0,
|
|
5531
5538
|
newAssigneeId: S.resolvedUser.userId
|
|
5532
5539
|
};
|
|
5533
5540
|
});
|
|
5534
5541
|
const k = $.map(
|
|
5535
5542
|
async ({ assignment: b, validation: S }) => {
|
|
5536
|
-
const
|
|
5543
|
+
const D = d.find((x) => x.id === b.taskId);
|
|
5537
5544
|
if (!b.taskId || !S.resolvedUser?.userId)
|
|
5538
5545
|
return {
|
|
5539
5546
|
taskId: b.taskId || "unknown-task",
|
|
5540
5547
|
success: !1,
|
|
5541
5548
|
error: "Invalid assignment data - missing task ID or resolved user",
|
|
5542
|
-
originalAssigneeId:
|
|
5549
|
+
originalAssigneeId: D?.responsibleUid ?? void 0
|
|
5543
5550
|
};
|
|
5544
5551
|
try {
|
|
5545
5552
|
return await t.updateTask(b.taskId, {
|
|
@@ -5547,7 +5554,7 @@ const tc = {
|
|
|
5547
5554
|
}), {
|
|
5548
5555
|
taskId: b.taskId,
|
|
5549
5556
|
success: !0,
|
|
5550
|
-
originalAssigneeId:
|
|
5557
|
+
originalAssigneeId: D?.responsibleUid ?? void 0,
|
|
5551
5558
|
newAssigneeId: S.resolvedUser.userId
|
|
5552
5559
|
};
|
|
5553
5560
|
} catch (x) {
|
|
@@ -5555,7 +5562,7 @@ const tc = {
|
|
|
5555
5562
|
taskId: b.taskId,
|
|
5556
5563
|
success: !1,
|
|
5557
5564
|
error: x instanceof Error ? x.message : "Update failed",
|
|
5558
|
-
originalAssigneeId:
|
|
5565
|
+
originalAssigneeId: D?.responsibleUid ?? void 0
|
|
5559
5566
|
};
|
|
5560
5567
|
}
|
|
5561
5568
|
}
|
|
@@ -5622,8 +5629,8 @@ function Le({
|
|
|
5622
5629
|
`;
|
|
5623
5630
|
}
|
|
5624
5631
|
return !r && o.length > 0 ? (c += `**Next steps:**
|
|
5625
|
-
`, c += `• Use ${
|
|
5626
|
-
`, c += `• Use ${
|
|
5632
|
+
`, c += `• Use ${rc} with responsibleUser to see ${e === "unassign" ? "unassigned" : "newly assigned"} tasks
|
|
5633
|
+
`, c += `• Use ${oc} for individual assignment changes
|
|
5627
5634
|
`, n.length > 0 && (c += `• Check failed tasks and use ${zt} to verify collaborator access
|
|
5628
5635
|
`)) : r ? (c += `**To execute:**
|
|
5629
5636
|
`, c += `• Remove dryRun parameter and run again to execute changes
|
|
@@ -5635,17 +5642,17 @@ function Le({
|
|
|
5635
5642
|
`, c += `• Use dryRun=true to validate before executing
|
|
5636
5643
|
`), c;
|
|
5637
5644
|
}
|
|
5638
|
-
const
|
|
5645
|
+
const dc = {
|
|
5639
5646
|
action: s.enum(["archive", "unarchive"]).describe("The action to perform on the project."),
|
|
5640
5647
|
projectId: s.string().min(1).describe("The ID of the project.")
|
|
5641
|
-
},
|
|
5648
|
+
}, lc = {
|
|
5642
5649
|
project: re.describe("The updated project."),
|
|
5643
5650
|
success: s.boolean().describe("Whether the action was successful.")
|
|
5644
|
-
},
|
|
5651
|
+
}, uc = {
|
|
5645
5652
|
name: g.PROJECT_MANAGEMENT,
|
|
5646
5653
|
description: "Archive or unarchive a project by its ID.",
|
|
5647
|
-
parameters:
|
|
5648
|
-
outputSchema:
|
|
5654
|
+
parameters: dc,
|
|
5655
|
+
outputSchema: lc,
|
|
5649
5656
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
|
|
5650
5657
|
async execute(e, t) {
|
|
5651
5658
|
const r = e.action === "archive" ? await t.archiveProject(e.projectId) : await t.unarchiveProject(e.projectId), o = se(r);
|
|
@@ -5657,7 +5664,7 @@ const cc = {
|
|
|
5657
5664
|
}
|
|
5658
5665
|
};
|
|
5659
5666
|
}
|
|
5660
|
-
},
|
|
5667
|
+
}, pc = {
|
|
5661
5668
|
action: s.enum(["move-to-workspace", "move-to-personal"]).describe("The action to perform on the project."),
|
|
5662
5669
|
projectId: s.string().min(1).describe("The ID of the project to move."),
|
|
5663
5670
|
workspaceId: s.string().min(1).optional().describe("The target workspace ID. Required when action is move-to-workspace."),
|
|
@@ -5665,14 +5672,14 @@ const cc = {
|
|
|
5665
5672
|
visibility: s.enum(["restricted", "team", "public"]).optional().describe(
|
|
5666
5673
|
"Optional access visibility for the project in the workspace (restricted, team, or public)."
|
|
5667
5674
|
)
|
|
5668
|
-
},
|
|
5675
|
+
}, hc = {
|
|
5669
5676
|
project: re.describe("The moved project."),
|
|
5670
5677
|
success: s.boolean().describe("Whether the move was successful.")
|
|
5671
|
-
},
|
|
5678
|
+
}, mc = {
|
|
5672
5679
|
name: g.PROJECT_MOVE,
|
|
5673
5680
|
description: "Move a project between personal and workspace contexts.",
|
|
5674
|
-
parameters:
|
|
5675
|
-
outputSchema:
|
|
5681
|
+
parameters: pc,
|
|
5682
|
+
outputSchema: hc,
|
|
5676
5683
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
|
|
5677
5684
|
async execute(e, t) {
|
|
5678
5685
|
let r;
|
|
@@ -5695,8 +5702,8 @@ const cc = {
|
|
|
5695
5702
|
}
|
|
5696
5703
|
};
|
|
5697
5704
|
}
|
|
5698
|
-
},
|
|
5699
|
-
type: s.enum(
|
|
5705
|
+
}, Ms = ["project", "section"], fc = {
|
|
5706
|
+
type: s.enum(Ms).describe(
|
|
5700
5707
|
'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
5708
|
),
|
|
5702
5709
|
items: s.array(
|
|
@@ -5712,17 +5719,17 @@ const cc = {
|
|
|
5712
5719
|
).min(1).describe(
|
|
5713
5720
|
"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
5721
|
)
|
|
5715
|
-
},
|
|
5716
|
-
type: s.enum(
|
|
5722
|
+
}, bc = {
|
|
5723
|
+
type: s.enum(Ms).describe("The type of entity that was reordered/moved."),
|
|
5717
5724
|
movedCount: s.number().describe("The number of entities moved to a new parent."),
|
|
5718
5725
|
reorderedCount: s.number().describe("The number of entities reordered."),
|
|
5719
5726
|
affectedIds: s.array(s.string()).describe("The IDs of all affected entities."),
|
|
5720
5727
|
success: s.boolean().describe("Whether the operation was successful.")
|
|
5721
|
-
},
|
|
5728
|
+
}, gc = {
|
|
5722
5729
|
name: g.REORDER_OBJECTS,
|
|
5723
5730
|
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:
|
|
5731
|
+
parameters: fc,
|
|
5732
|
+
outputSchema: bc,
|
|
5726
5733
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
|
|
5727
5734
|
async execute(e, t) {
|
|
5728
5735
|
const { type: r, items: o } = e, n = /* @__PURE__ */ new Set();
|
|
@@ -5784,22 +5791,22 @@ const cc = {
|
|
|
5784
5791
|
}
|
|
5785
5792
|
};
|
|
5786
5793
|
}
|
|
5787
|
-
},
|
|
5794
|
+
}, yc = s.object({
|
|
5788
5795
|
id: s.string().min(1).describe("The ID of the task to reschedule."),
|
|
5789
5796
|
date: s.string().min(1).describe(
|
|
5790
5797
|
"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
5798
|
)
|
|
5792
|
-
}),
|
|
5793
|
-
tasks: s.array(
|
|
5794
|
-
},
|
|
5799
|
+
}), Tc = {
|
|
5800
|
+
tasks: s.array(yc).min(1).describe("The tasks to reschedule with their new dates.")
|
|
5801
|
+
}, kc = {
|
|
5795
5802
|
tasks: s.array(K).describe("The rescheduled tasks."),
|
|
5796
5803
|
totalCount: s.number().describe("The total number of tasks rescheduled."),
|
|
5797
5804
|
rescheduledTaskIds: s.array(s.string()).describe("The IDs of the rescheduled tasks.")
|
|
5798
|
-
},
|
|
5805
|
+
}, wc = {
|
|
5799
5806
|
name: g.RESCHEDULE_TASKS,
|
|
5800
5807
|
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:
|
|
5808
|
+
parameters: Tc,
|
|
5809
|
+
outputSchema: kc,
|
|
5803
5810
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5804
5811
|
async execute(e, t) {
|
|
5805
5812
|
const { tasks: r } = e, n = (await Promise.all(
|
|
@@ -5812,7 +5819,7 @@ const cc = {
|
|
|
5812
5819
|
throw new Error(
|
|
5813
5820
|
`Task "${u.content}" (${u.id}) has no due date. Rescheduling requires an existing due date.`
|
|
5814
5821
|
);
|
|
5815
|
-
const l =
|
|
5822
|
+
const l = vc(d.date, u.due);
|
|
5816
5823
|
return Q("item_update", {
|
|
5817
5824
|
id: d.id,
|
|
5818
5825
|
due: {
|
|
@@ -5843,16 +5850,16 @@ const cc = {
|
|
|
5843
5850
|
};
|
|
5844
5851
|
}
|
|
5845
5852
|
};
|
|
5846
|
-
function
|
|
5853
|
+
function vc(e, t) {
|
|
5847
5854
|
if (/^\d{4}-\d{2}-\d{2}$/.test(e) && t.datetime) {
|
|
5848
5855
|
const o = t.datetime.substring(10);
|
|
5849
5856
|
return e + o;
|
|
5850
5857
|
}
|
|
5851
5858
|
return e;
|
|
5852
5859
|
}
|
|
5853
|
-
const
|
|
5860
|
+
const Ic = {
|
|
5854
5861
|
query: s.string().min(1).describe("The search query string to find tasks and projects.")
|
|
5855
|
-
},
|
|
5862
|
+
}, Sc = {
|
|
5856
5863
|
results: s.array(
|
|
5857
5864
|
s.object({
|
|
5858
5865
|
id: s.string().describe("The ID of the result."),
|
|
@@ -5861,21 +5868,21 @@ const vc = {
|
|
|
5861
5868
|
})
|
|
5862
5869
|
).describe("The search results."),
|
|
5863
5870
|
totalCount: s.number().describe("Total number of results found.")
|
|
5864
|
-
},
|
|
5871
|
+
}, Cc = {
|
|
5865
5872
|
name: g.SEARCH,
|
|
5866
5873
|
description: "Search across tasks and projects in Todoist. Returns a list of relevant results with IDs, titles, and URLs.",
|
|
5867
|
-
parameters:
|
|
5868
|
-
outputSchema:
|
|
5874
|
+
parameters: Ic,
|
|
5875
|
+
outputSchema: Sc,
|
|
5869
5876
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
5870
5877
|
async execute(e, t) {
|
|
5871
5878
|
const { query: r } = e, [o, n] = await Promise.all([
|
|
5872
5879
|
dt({
|
|
5873
5880
|
client: t,
|
|
5874
|
-
query: `search: ${r}`,
|
|
5881
|
+
query: `search: ${Zt(r)}`,
|
|
5875
5882
|
limit: j.TASKS_MAX,
|
|
5876
5883
|
cursor: void 0
|
|
5877
5884
|
}),
|
|
5878
|
-
|
|
5885
|
+
gs(t, r)
|
|
5879
5886
|
]), i = [];
|
|
5880
5887
|
for (const a of o.tasks)
|
|
5881
5888
|
i.push({
|
|
@@ -5894,19 +5901,19 @@ const vc = {
|
|
|
5894
5901
|
structuredContent: { results: i, totalCount: i.length }
|
|
5895
5902
|
};
|
|
5896
5903
|
}
|
|
5897
|
-
}, Cc = {
|
|
5898
|
-
ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to uncomplete.")
|
|
5899
5904
|
}, jc = {
|
|
5905
|
+
ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to uncomplete.")
|
|
5906
|
+
}, $c = {
|
|
5900
5907
|
uncompleted: s.array(s.string()).describe("The IDs of successfully uncompleted tasks."),
|
|
5901
5908
|
failures: s.array(oe).describe("Failed task uncompletion with error details."),
|
|
5902
5909
|
totalRequested: s.number().describe("The total number of tasks requested to uncomplete."),
|
|
5903
5910
|
successCount: s.number().describe("The number of successfully uncompleted tasks."),
|
|
5904
5911
|
failureCount: s.number().describe("The number of failed task uncompletions.")
|
|
5905
|
-
},
|
|
5912
|
+
}, Dc = {
|
|
5906
5913
|
name: g.UNCOMPLETE_TASKS,
|
|
5907
5914
|
description: "Uncomplete (reopen) one or more completed tasks by their IDs.",
|
|
5908
|
-
parameters:
|
|
5909
|
-
outputSchema:
|
|
5915
|
+
parameters: jc,
|
|
5916
|
+
outputSchema: $c,
|
|
5910
5917
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
5911
5918
|
async execute(e, t) {
|
|
5912
5919
|
const r = [], o = [];
|
|
@@ -5949,28 +5956,28 @@ function Ac({
|
|
|
5949
5956
|
failures: t
|
|
5950
5957
|
});
|
|
5951
5958
|
}
|
|
5952
|
-
const
|
|
5959
|
+
const xc = s.object({
|
|
5953
5960
|
id: s.string().min(1).describe("The ID of the comment to update."),
|
|
5954
5961
|
content: s.string().min(1).describe("The new content for the comment.")
|
|
5955
|
-
}),
|
|
5956
|
-
comments: s.array(
|
|
5957
|
-
},
|
|
5962
|
+
}), Ec = {
|
|
5963
|
+
comments: s.array(xc).min(1).describe("The comments to update.")
|
|
5964
|
+
}, Oc = {
|
|
5958
5965
|
comments: s.array(ve).describe("The updated comments."),
|
|
5959
5966
|
totalCount: s.number().describe("The total number of comments updated."),
|
|
5960
5967
|
updatedCommentIds: s.array(s.string()).describe("The IDs of the updated comments."),
|
|
5961
5968
|
appliedOperations: s.object({
|
|
5962
5969
|
updateCount: s.number().describe("The number of comments updated.")
|
|
5963
5970
|
}).describe("Summary of operations performed.")
|
|
5964
|
-
},
|
|
5971
|
+
}, _c = {
|
|
5965
5972
|
name: g.UPDATE_COMMENTS,
|
|
5966
5973
|
description: "Update multiple existing comments with new content.",
|
|
5967
|
-
parameters:
|
|
5968
|
-
outputSchema:
|
|
5974
|
+
parameters: Ec,
|
|
5975
|
+
outputSchema: Oc,
|
|
5969
5976
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5970
5977
|
async execute(e, t) {
|
|
5971
5978
|
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
5979
|
return {
|
|
5973
|
-
textContent:
|
|
5980
|
+
textContent: Pc({
|
|
5974
5981
|
comments: i
|
|
5975
5982
|
}),
|
|
5976
5983
|
structuredContent: {
|
|
@@ -5984,7 +5991,7 @@ const Dc = s.object({
|
|
|
5984
5991
|
};
|
|
5985
5992
|
}
|
|
5986
5993
|
};
|
|
5987
|
-
function
|
|
5994
|
+
function Pc({ comments: e }) {
|
|
5988
5995
|
const t = e.filter((i) => i.taskId).length, r = e.filter((i) => i.projectId).length, o = [];
|
|
5989
5996
|
if (t > 0) {
|
|
5990
5997
|
const i = t > 1 ? "comments" : "comment";
|
|
@@ -5996,7 +6003,7 @@ function _c({ comments: e }) {
|
|
|
5996
6003
|
}
|
|
5997
6004
|
return o.length > 0 ? `Updated ${o.join(" and ")}` : "No comments updated";
|
|
5998
6005
|
}
|
|
5999
|
-
const
|
|
6006
|
+
const Uc = s.object({
|
|
6000
6007
|
id: s.string().min(1).describe("The ID of the filter to update."),
|
|
6001
6008
|
name: s.string().min(1).optional().describe("The new name of the filter."),
|
|
6002
6009
|
query: s.string().min(1).optional().describe(
|
|
@@ -6011,9 +6018,9 @@ const Pc = s.object({
|
|
|
6011
6018
|
).optional(),
|
|
6012
6019
|
color: fe,
|
|
6013
6020
|
isFavorite: s.boolean().optional().describe("Whether to mark the filter as a favorite.")
|
|
6014
|
-
}),
|
|
6015
|
-
filters: s.array(
|
|
6016
|
-
},
|
|
6021
|
+
}), Rc = {
|
|
6022
|
+
filters: s.array(Uc).min(1).describe("The filters to update.")
|
|
6023
|
+
}, Lc = {
|
|
6017
6024
|
filters: s.array(ut).describe("The updated filters."),
|
|
6018
6025
|
totalCount: s.number().describe("The total number of filters updated."),
|
|
6019
6026
|
updatedFilterIds: s.array(s.string()).describe("The IDs of the updated filters."),
|
|
@@ -6021,15 +6028,15 @@ const Pc = s.object({
|
|
|
6021
6028
|
updateCount: s.number().describe("The number of filters actually updated."),
|
|
6022
6029
|
skippedCount: s.number().describe("The number of filters skipped (no changes).")
|
|
6023
6030
|
}).describe("Summary of operations performed.")
|
|
6024
|
-
},
|
|
6031
|
+
}, Nc = {
|
|
6025
6032
|
name: g.UPDATE_FILTERS,
|
|
6026
6033
|
description: "Update one or more existing personal filters with new values.",
|
|
6027
|
-
parameters:
|
|
6028
|
-
outputSchema:
|
|
6034
|
+
parameters: Rc,
|
|
6035
|
+
outputSchema: Lc,
|
|
6029
6036
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
6030
6037
|
async execute(e, t) {
|
|
6031
6038
|
const { filters: r } = e, o = [], i = r.map((h) => {
|
|
6032
|
-
const m =
|
|
6039
|
+
const m = Fc(h);
|
|
6033
6040
|
return m !== null ? { kind: "skipped", reason: m } : (o.push(h), { kind: "updated", filter: h });
|
|
6034
6041
|
}).filter((h) => h.kind === "skipped").length;
|
|
6035
6042
|
if (o.length === 0)
|
|
@@ -6057,13 +6064,13 @@ const Pc = s.object({
|
|
|
6057
6064
|
id: h.id,
|
|
6058
6065
|
name: h.name,
|
|
6059
6066
|
query: h.query,
|
|
6060
|
-
description:
|
|
6067
|
+
description: ws(h),
|
|
6061
6068
|
color: be.parse(h.color),
|
|
6062
6069
|
isFavorite: h.isFavorite,
|
|
6063
6070
|
itemOrder: h.itemOrder
|
|
6064
6071
|
}));
|
|
6065
6072
|
return {
|
|
6066
|
-
textContent:
|
|
6073
|
+
textContent: Mc({ filters: l, skippedCount: i }),
|
|
6067
6074
|
structuredContent: {
|
|
6068
6075
|
filters: l,
|
|
6069
6076
|
totalCount: l.length,
|
|
@@ -6076,7 +6083,7 @@ const Pc = s.object({
|
|
|
6076
6083
|
};
|
|
6077
6084
|
}
|
|
6078
6085
|
};
|
|
6079
|
-
function
|
|
6086
|
+
function Mc({
|
|
6080
6087
|
filters: e,
|
|
6081
6088
|
skippedCount: t
|
|
6082
6089
|
}) {
|
|
@@ -6090,52 +6097,52 @@ ${n}`;
|
|
|
6090
6097
|
}
|
|
6091
6098
|
return o;
|
|
6092
6099
|
}
|
|
6093
|
-
function
|
|
6100
|
+
function Fc({ id: e, ...t }) {
|
|
6094
6101
|
return Object.values(t).every((o) => o === void 0) ? "no-fields" : null;
|
|
6095
6102
|
}
|
|
6096
|
-
const
|
|
6103
|
+
const Hc = s.object({
|
|
6097
6104
|
labelType: s.literal("personal").describe("Update a personal label, identified by its ID."),
|
|
6098
6105
|
id: s.string().min(1).describe("The ID of the personal label to update."),
|
|
6099
6106
|
name: s.string().min(1).max(128).optional().describe("The new name of the label."),
|
|
6100
6107
|
color: fe,
|
|
6101
6108
|
order: s.number().int().optional().describe("The new position of the label in the label list."),
|
|
6102
6109
|
isFavorite: s.boolean().optional().describe("Whether to mark the label as a favorite.")
|
|
6103
|
-
}),
|
|
6110
|
+
}), Wc = s.object({
|
|
6104
6111
|
labelType: s.literal("shared").describe(
|
|
6105
6112
|
"Rename a shared label across all tasks. Shared labels are identified by name; only renaming is supported (no color, order, or favorite)."
|
|
6106
6113
|
),
|
|
6107
6114
|
name: s.string().min(1).describe("The current name of the shared label."),
|
|
6108
6115
|
newName: s.string().min(1).describe("The new name for the shared label.")
|
|
6109
|
-
}),
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
]),
|
|
6113
|
-
labels: s.array(
|
|
6116
|
+
}), Bc = s.discriminatedUnion("labelType", [
|
|
6117
|
+
Hc,
|
|
6118
|
+
Wc
|
|
6119
|
+
]), zc = {
|
|
6120
|
+
labels: s.array(Bc).min(1).describe(
|
|
6114
6121
|
'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
6122
|
)
|
|
6116
|
-
},
|
|
6123
|
+
}, Kc = s.object({
|
|
6117
6124
|
name: s.string().describe("The previous name of the shared label."),
|
|
6118
6125
|
newName: s.string().describe("The new name of the shared label.")
|
|
6119
|
-
}),
|
|
6126
|
+
}), qc = {
|
|
6120
6127
|
updatedLabels: s.array(ge).describe("The updated personal labels."),
|
|
6121
|
-
renamedSharedLabels: s.array(
|
|
6128
|
+
renamedSharedLabels: s.array(Kc).describe("The shared labels that were renamed."),
|
|
6122
6129
|
totalCount: s.number().describe("The total number of successful operations (personal + shared)."),
|
|
6123
6130
|
appliedOperations: s.object({
|
|
6124
6131
|
updateCount: s.number().describe("Number of personal labels updated."),
|
|
6125
6132
|
renameCount: s.number().describe("Number of shared labels renamed."),
|
|
6126
6133
|
skippedCount: s.number().describe("Number of operations skipped (no changes or shared label not found).")
|
|
6127
6134
|
}).describe("Summary of operations performed.")
|
|
6128
|
-
},
|
|
6135
|
+
}, Yc = {
|
|
6129
6136
|
name: g.UPDATE_LABELS,
|
|
6130
6137
|
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:
|
|
6138
|
+
parameters: zc,
|
|
6139
|
+
outputSchema: qc,
|
|
6133
6140
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
6134
6141
|
async execute(e, t) {
|
|
6135
6142
|
const { labels: r } = e, o = await Promise.all(
|
|
6136
6143
|
r.map(async (l) => {
|
|
6137
6144
|
if (l.labelType === "personal") {
|
|
6138
|
-
const h =
|
|
6145
|
+
const h = Vc(l);
|
|
6139
6146
|
if (h !== null) return { kind: "skipped", reason: h };
|
|
6140
6147
|
const { id: m, labelType: y, ...f } = l;
|
|
6141
6148
|
return { kind: "updated", label: await t.updateLabel(m, f) };
|
|
@@ -6153,7 +6160,7 @@ const Fc = s.object({
|
|
|
6153
6160
|
(l) => l.kind === "skipped" && l.reason === "not-found"
|
|
6154
6161
|
).length;
|
|
6155
6162
|
return {
|
|
6156
|
-
textContent:
|
|
6163
|
+
textContent: Gc({
|
|
6157
6164
|
updatedLabels: n,
|
|
6158
6165
|
renamedSharedLabels: i,
|
|
6159
6166
|
skippedNoFields: c,
|
|
@@ -6172,7 +6179,7 @@ const Fc = s.object({
|
|
|
6172
6179
|
};
|
|
6173
6180
|
}
|
|
6174
6181
|
};
|
|
6175
|
-
function
|
|
6182
|
+
function Gc({
|
|
6176
6183
|
updatedLabels: e,
|
|
6177
6184
|
renamedSharedLabels: t,
|
|
6178
6185
|
skippedNoFields: r,
|
|
@@ -6194,14 +6201,14 @@ function Yc({
|
|
|
6194
6201
|
return c.join(`
|
|
6195
6202
|
`);
|
|
6196
6203
|
}
|
|
6197
|
-
function
|
|
6204
|
+
function Vc({
|
|
6198
6205
|
id: e,
|
|
6199
6206
|
labelType: t,
|
|
6200
6207
|
...r
|
|
6201
6208
|
}) {
|
|
6202
6209
|
return Object.values(r).every((n) => n === void 0) ? "no-fields" : null;
|
|
6203
6210
|
}
|
|
6204
|
-
const
|
|
6211
|
+
const Jc = s.object({
|
|
6205
6212
|
id: s.string().min(1).describe("The ID of the project to update."),
|
|
6206
6213
|
name: s.string().min(1).optional().describe("The new name of the project."),
|
|
6207
6214
|
isFavorite: s.boolean().optional().describe("Whether the project is a favorite."),
|
|
@@ -6216,9 +6223,9 @@ const Vc = s.object({
|
|
|
6216
6223
|
)
|
|
6217
6224
|
).optional(),
|
|
6218
6225
|
color: fe
|
|
6219
|
-
}),
|
|
6220
|
-
projects: s.array(
|
|
6221
|
-
},
|
|
6226
|
+
}), Xc = {
|
|
6227
|
+
projects: s.array(Jc).min(1).describe("The projects to update.")
|
|
6228
|
+
}, Qc = {
|
|
6222
6229
|
projects: s.array(re).describe("The updated projects."),
|
|
6223
6230
|
totalCount: s.number().describe("The total number of projects updated."),
|
|
6224
6231
|
updatedProjectIds: s.array(s.string()).describe("The IDs of the updated projects."),
|
|
@@ -6230,16 +6237,16 @@ const Vc = s.object({
|
|
|
6230
6237
|
skippedCount: s.number().describe("The number of projects skipped (no changes)."),
|
|
6231
6238
|
failureCount: s.number().describe("The number of projects that failed to update.")
|
|
6232
6239
|
}).describe("Summary of operations performed.")
|
|
6233
|
-
},
|
|
6240
|
+
}, Zc = {
|
|
6234
6241
|
name: g.UPDATE_PROJECTS,
|
|
6235
6242
|
description: "Update multiple existing projects with new values.",
|
|
6236
|
-
parameters:
|
|
6237
|
-
outputSchema:
|
|
6243
|
+
parameters: Xc,
|
|
6244
|
+
outputSchema: Qc,
|
|
6238
6245
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
6239
6246
|
async execute(e, t) {
|
|
6240
6247
|
const { projects: r } = e, o = await Promise.allSettled(
|
|
6241
6248
|
r.map(async (u) => {
|
|
6242
|
-
const l =
|
|
6249
|
+
const l = td(u);
|
|
6243
6250
|
if (l !== null) return { kind: "skipped", reason: l };
|
|
6244
6251
|
const { id: p, ...h } = u;
|
|
6245
6252
|
return { kind: "updated", project: await _(() => t.updateProject(p, h)) };
|
|
@@ -6257,7 +6264,7 @@ const Vc = s.object({
|
|
|
6257
6264
|
l.value.kind === "updated" ? n.push(se(l.value.project)) : l.value.reason === "no-fields" ? a++ : c++;
|
|
6258
6265
|
}
|
|
6259
6266
|
return ne(g.UPDATE_PROJECTS, r.length, i), {
|
|
6260
|
-
textContent:
|
|
6267
|
+
textContent: ed({
|
|
6261
6268
|
projects: n,
|
|
6262
6269
|
skippedNoFields: a,
|
|
6263
6270
|
skippedNoValidValues: c,
|
|
@@ -6277,7 +6284,7 @@ const Vc = s.object({
|
|
|
6277
6284
|
};
|
|
6278
6285
|
}
|
|
6279
6286
|
};
|
|
6280
|
-
function
|
|
6287
|
+
function ed({
|
|
6281
6288
|
projects: e,
|
|
6282
6289
|
skippedNoFields: t,
|
|
6283
6290
|
skippedNoValidValues: r,
|
|
@@ -6290,49 +6297,49 @@ function Zc({
|
|
|
6290
6297
|
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
6298
|
${i}`), mt(a, o);
|
|
6292
6299
|
}
|
|
6293
|
-
function
|
|
6300
|
+
function td({ id: e, ...t }) {
|
|
6294
6301
|
const r = Object.values(t);
|
|
6295
6302
|
return r.length === 0 ? "no-fields" : r.every((o) => o === void 0) ? "no-valid-values" : null;
|
|
6296
6303
|
}
|
|
6297
|
-
const
|
|
6304
|
+
const sd = s.object({
|
|
6298
6305
|
type: s.literal("relative"),
|
|
6299
6306
|
id: s.string().min(1).describe("The ID of the relative reminder to update."),
|
|
6300
6307
|
minuteOffset: s.number().int().min(0).optional().describe("New minute offset before task due time."),
|
|
6301
6308
|
service: Ee.optional().describe('New delivery method: "email" or "push".'),
|
|
6302
6309
|
isUrgent: Oe
|
|
6303
|
-
}),
|
|
6310
|
+
}), rd = s.object({
|
|
6304
6311
|
type: s.literal("absolute"),
|
|
6305
6312
|
id: s.string().min(1).describe("The ID of the absolute reminder to update."),
|
|
6306
|
-
due:
|
|
6313
|
+
due: Ss.optional().describe("New due date/time for the reminder."),
|
|
6307
6314
|
service: Ee.optional().describe('New delivery method: "email" or "push".'),
|
|
6308
6315
|
isUrgent: Oe
|
|
6309
|
-
}),
|
|
6316
|
+
}), od = s.object({
|
|
6310
6317
|
type: s.literal("location"),
|
|
6311
6318
|
id: s.string().min(1).describe("The ID of the location reminder to update."),
|
|
6312
6319
|
name: s.string().optional().describe("New location name."),
|
|
6313
6320
|
locLat: s.string().optional().describe("New latitude."),
|
|
6314
6321
|
locLong: s.string().optional().describe("New longitude."),
|
|
6315
|
-
locTrigger:
|
|
6322
|
+
locTrigger: Cs.optional().describe(
|
|
6316
6323
|
'New trigger condition: "on_enter" or "on_leave".'
|
|
6317
6324
|
),
|
|
6318
6325
|
radius: s.number().int().optional().describe("New radius in meters.")
|
|
6319
|
-
}),
|
|
6320
|
-
td,
|
|
6326
|
+
}), nd = s.discriminatedUnion("type", [
|
|
6321
6327
|
sd,
|
|
6322
|
-
rd
|
|
6323
|
-
|
|
6324
|
-
|
|
6328
|
+
rd,
|
|
6329
|
+
od
|
|
6330
|
+
]), id = {
|
|
6331
|
+
reminders: s.array(nd).min(1).max(je).describe(
|
|
6325
6332
|
`Array of reminders to update (max ${je}). Each must include the reminder type and ID. Only include fields that need to change.`
|
|
6326
6333
|
)
|
|
6327
|
-
},
|
|
6334
|
+
}, ad = {
|
|
6328
6335
|
reminders: s.array(lt).describe("The updated reminders."),
|
|
6329
6336
|
totalCount: s.number().describe("Total reminders updated."),
|
|
6330
6337
|
updatedReminderIds: s.array(s.string()).describe("IDs of updated reminders.")
|
|
6331
|
-
},
|
|
6338
|
+
}, cd = {
|
|
6332
6339
|
name: g.UPDATE_REMINDERS,
|
|
6333
6340
|
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:
|
|
6341
|
+
parameters: id,
|
|
6342
|
+
outputSchema: ad,
|
|
6336
6343
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !0 },
|
|
6337
6344
|
async execute(e, t) {
|
|
6338
6345
|
const { reminders: r } = e, o = r.map(async (d) => {
|
|
@@ -6366,7 +6373,7 @@ const td = s.object({
|
|
|
6366
6373
|
}
|
|
6367
6374
|
};
|
|
6368
6375
|
}
|
|
6369
|
-
},
|
|
6376
|
+
}, dd = s.object({
|
|
6370
6377
|
id: s.string().min(1).describe("The ID of the section to update."),
|
|
6371
6378
|
name: s.string().min(1).optional().describe("The new name of the section."),
|
|
6372
6379
|
description: s.preprocess(
|
|
@@ -6381,17 +6388,17 @@ const td = s.object({
|
|
|
6381
6388
|
).optional()
|
|
6382
6389
|
}).refine((e) => e.name !== void 0 || e.description !== void 0, {
|
|
6383
6390
|
message: 'Provide at least one of "name" or "description" to update.'
|
|
6384
|
-
}),
|
|
6385
|
-
sections: s.array(
|
|
6386
|
-
},
|
|
6391
|
+
}), ld = {
|
|
6392
|
+
sections: s.array(dd).min(1).describe("The sections to update.")
|
|
6393
|
+
}, ud = {
|
|
6387
6394
|
sections: s.array(Y).describe("The updated sections."),
|
|
6388
6395
|
totalCount: s.number().describe("The total number of sections updated."),
|
|
6389
6396
|
updatedSectionIds: s.array(s.string()).describe("The IDs of the updated sections.")
|
|
6390
|
-
},
|
|
6397
|
+
}, pd = {
|
|
6391
6398
|
name: g.UPDATE_SECTIONS,
|
|
6392
6399
|
description: "Update multiple existing sections with new values.",
|
|
6393
|
-
parameters:
|
|
6394
|
-
outputSchema:
|
|
6400
|
+
parameters: ld,
|
|
6401
|
+
outputSchema: ud,
|
|
6395
6402
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
6396
6403
|
async execute({ sections: e }, t) {
|
|
6397
6404
|
const r = await Promise.all(
|
|
@@ -6404,7 +6411,7 @@ const td = s.object({
|
|
|
6404
6411
|
})
|
|
6405
6412
|
);
|
|
6406
6413
|
return {
|
|
6407
|
-
textContent:
|
|
6414
|
+
textContent: hd({
|
|
6408
6415
|
sections: r
|
|
6409
6416
|
}),
|
|
6410
6417
|
structuredContent: {
|
|
@@ -6415,36 +6422,36 @@ const td = s.object({
|
|
|
6415
6422
|
};
|
|
6416
6423
|
}
|
|
6417
6424
|
};
|
|
6418
|
-
function
|
|
6425
|
+
function hd({ sections: e }) {
|
|
6419
6426
|
const t = e.length, r = e.map((n) => `• ${n.name} (id=${n.id}, projectId=${n.projectId})`).join(`
|
|
6420
6427
|
`);
|
|
6421
6428
|
return `Updated ${t} section${t === 1 ? "" : "s"}:
|
|
6422
6429
|
${r}`;
|
|
6423
6430
|
}
|
|
6424
|
-
function
|
|
6431
|
+
function Fs(e, t) {
|
|
6425
6432
|
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
6433
|
}
|
|
6427
|
-
function
|
|
6434
|
+
function md(e, t) {
|
|
6428
6435
|
return t.projectId !== void 0 ? e.projectId === t.projectId : t.sectionId !== void 0 ? e.sectionId === t.sectionId : e.parentId === t.parentId;
|
|
6429
6436
|
}
|
|
6430
|
-
function
|
|
6437
|
+
function fd(e) {
|
|
6431
6438
|
return e.projectId !== void 0 ? `project:${e.projectId}` : e.sectionId !== void 0 ? `section:${e.sectionId}` : `parent:${e.parentId}`;
|
|
6432
6439
|
}
|
|
6433
|
-
function
|
|
6440
|
+
function bd(e) {
|
|
6434
6441
|
const t = [];
|
|
6435
6442
|
return e.projectId && t.push({ projectId: e.projectId }), e.sectionId && t.push({ sectionId: e.sectionId }), e.parentId && t.push({ parentId: e.parentId }), t;
|
|
6436
6443
|
}
|
|
6437
|
-
function
|
|
6444
|
+
function gd({
|
|
6438
6445
|
taskId: e,
|
|
6439
6446
|
request: t,
|
|
6440
6447
|
current: r
|
|
6441
6448
|
}) {
|
|
6442
|
-
const o =
|
|
6449
|
+
const o = bd(t);
|
|
6443
6450
|
if (o.length === 0)
|
|
6444
6451
|
return { redundantMoveSkipped: !1 };
|
|
6445
6452
|
let n = o, i = !1;
|
|
6446
6453
|
if (r) {
|
|
6447
|
-
const a = o.length === 1 ? (c) =>
|
|
6454
|
+
const a = o.length === 1 ? (c) => Fs(r, c) : (c) => md(r, c);
|
|
6448
6455
|
n = o.filter((c) => !a(c)), i = n.length < o.length;
|
|
6449
6456
|
}
|
|
6450
6457
|
if (n.length === 0)
|
|
@@ -6455,7 +6462,7 @@ function bd({
|
|
|
6455
6462
|
);
|
|
6456
6463
|
return { move: n[0], redundantMoveSkipped: i };
|
|
6457
6464
|
}
|
|
6458
|
-
const
|
|
6465
|
+
const yd = s.object({
|
|
6459
6466
|
id: s.string().min(1).describe("The ID of the task to update."),
|
|
6460
6467
|
content: s.string().optional().describe(
|
|
6461
6468
|
'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 +6507,9 @@ const gd = s.object({
|
|
|
6500
6507
|
isUncompletable: s.boolean().optional().describe(
|
|
6501
6508
|
"Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
|
|
6502
6509
|
)
|
|
6503
|
-
}),
|
|
6504
|
-
tasks: s.array(
|
|
6505
|
-
},
|
|
6510
|
+
}), 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 = {
|
|
6511
|
+
tasks: s.array(yd).min(1).max(et).describe(`The tasks to update (max ${et}).`)
|
|
6512
|
+
}, Id = {
|
|
6506
6513
|
tasks: s.array(K).describe("The updated tasks."),
|
|
6507
6514
|
totalCount: s.number().describe("The total number of tasks updated."),
|
|
6508
6515
|
updatedTaskIds: s.array(s.string()).describe("The IDs of the updated tasks."),
|
|
@@ -6517,38 +6524,38 @@ const gd = s.object({
|
|
|
6517
6524
|
"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
6525
|
)
|
|
6519
6526
|
}).describe("Summary of operations performed.")
|
|
6520
|
-
},
|
|
6527
|
+
}, Sd = {
|
|
6521
6528
|
name: g.UPDATE_TASKS,
|
|
6522
6529
|
description: "Update existing tasks including content, dates, priorities, and assignments. Send only the fields that change.",
|
|
6523
6530
|
parameters: Kt,
|
|
6524
|
-
outputSchema:
|
|
6531
|
+
outputSchema: Id,
|
|
6525
6532
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
6526
6533
|
async execute(e, t) {
|
|
6527
6534
|
const { tasks: r } = s.object(Kt).parse(e), o = r.map(() => ({ kind: "skipped" })), n = (k, b) => {
|
|
6528
6535
|
o[k] = { kind: "failed", error: b };
|
|
6529
6536
|
}, i = (k, b) => {
|
|
6530
6537
|
n(k, N(b));
|
|
6531
|
-
}, a = r.map((k, b) => ({ task: k, index: b })).filter(({ task: k }) =>
|
|
6538
|
+
}, a = r.map((k, b) => ({ task: k, index: b })).filter(({ task: k }) => _d(k)), c = await jd(
|
|
6532
6539
|
a.map(({ task: k }) => k),
|
|
6533
6540
|
t
|
|
6534
6541
|
), d = await Promise.allSettled(
|
|
6535
|
-
a.map(({ task: k, index: b }) =>
|
|
6542
|
+
a.map(({ task: k, index: b }) => xd({ task: k, index: b, client: t, inbox: c }))
|
|
6536
6543
|
), u = [];
|
|
6537
6544
|
for (const [k, b] of d.entries()) {
|
|
6538
6545
|
const S = a[k]?.index ?? k;
|
|
6539
6546
|
b.status === "fulfilled" ? u.push(b.value) : i(S, b.reason);
|
|
6540
6547
|
}
|
|
6541
|
-
const l = await
|
|
6548
|
+
const l = await Ws({
|
|
6542
6549
|
client: t,
|
|
6543
6550
|
ids: [
|
|
6544
6551
|
...new Set(
|
|
6545
|
-
u.filter((k) =>
|
|
6552
|
+
u.filter((k) => Td(k.moveRequest)).map((k) => k.id)
|
|
6546
6553
|
)
|
|
6547
6554
|
]
|
|
6548
6555
|
}), p = [];
|
|
6549
6556
|
for (const k of u)
|
|
6550
6557
|
try {
|
|
6551
|
-
const b =
|
|
6558
|
+
const b = gd({
|
|
6552
6559
|
taskId: k.id,
|
|
6553
6560
|
request: k.moveRequest,
|
|
6554
6561
|
current: l.get(k.id)
|
|
@@ -6563,34 +6570,34 @@ const gd = s.object({
|
|
|
6563
6570
|
Ad({
|
|
6564
6571
|
client: t,
|
|
6565
6572
|
items: b,
|
|
6566
|
-
onUpdated: (S,
|
|
6567
|
-
o[S.index] = { kind: "updated", task:
|
|
6573
|
+
onUpdated: (S, D) => {
|
|
6574
|
+
o[S.index] = { kind: "updated", task: D };
|
|
6568
6575
|
},
|
|
6569
|
-
onFailed: (S,
|
|
6576
|
+
onFailed: (S, D) => {
|
|
6570
6577
|
const x = h.get(S.index);
|
|
6571
6578
|
if (x && "task" in x) {
|
|
6572
6579
|
o[S.index] = {
|
|
6573
6580
|
kind: "partial",
|
|
6574
6581
|
task: x.task,
|
|
6575
|
-
error: `Move applied; field update failed: ${N(
|
|
6582
|
+
error: `Move applied; field update failed: ${N(D)}`
|
|
6576
6583
|
};
|
|
6577
6584
|
return;
|
|
6578
6585
|
}
|
|
6579
|
-
i(S.index,
|
|
6586
|
+
i(S.index, D);
|
|
6580
6587
|
}
|
|
6581
6588
|
})
|
|
6582
6589
|
);
|
|
6583
6590
|
}, f = new Set(p.map(({ item: k }) => k.index));
|
|
6584
|
-
y(u.filter((k) => !f.has(k.index))), await
|
|
6591
|
+
y(u.filter((k) => !f.has(k.index))), await $d({
|
|
6585
6592
|
client: t,
|
|
6586
6593
|
moving: p,
|
|
6587
6594
|
results: h,
|
|
6588
6595
|
onResolved: (k) => {
|
|
6589
6596
|
const b = [];
|
|
6590
6597
|
for (const { item: S } of k) {
|
|
6591
|
-
const
|
|
6592
|
-
if (
|
|
6593
|
-
n(S.index,
|
|
6598
|
+
const D = h.get(S.index);
|
|
6599
|
+
if (D && "error" in D) {
|
|
6600
|
+
n(S.index, D.error), S.failed = !0;
|
|
6594
6601
|
continue;
|
|
6595
6602
|
}
|
|
6596
6603
|
b.push(S);
|
|
@@ -6599,17 +6606,17 @@ const gd = s.object({
|
|
|
6599
6606
|
}
|
|
6600
6607
|
}), await Promise.all(m);
|
|
6601
6608
|
for (const k of u) {
|
|
6602
|
-
if (k.failed ||
|
|
6609
|
+
if (k.failed || Hs(k.updateArgs))
|
|
6603
6610
|
continue;
|
|
6604
6611
|
const b = h.get(k.index);
|
|
6605
6612
|
b && "task" in b && (o[k.index] = { kind: "updated", task: b.task });
|
|
6606
6613
|
}
|
|
6607
|
-
const { updatedTasks: w, failures: C, skippedCount:
|
|
6614
|
+
const { updatedTasks: w, failures: C, skippedCount: A } = Cd({ tasks: r, outcomes: o }), T = u.filter((k) => k.redundantMoveSkipped).length, I = w.map(P);
|
|
6608
6615
|
return ne(g.UPDATE_TASKS, r.length, C), {
|
|
6609
|
-
textContent:
|
|
6616
|
+
textContent: Od({
|
|
6610
6617
|
tasks: I,
|
|
6611
6618
|
failures: C,
|
|
6612
|
-
skippedCount:
|
|
6619
|
+
skippedCount: A,
|
|
6613
6620
|
redundantMovesSkipped: T
|
|
6614
6621
|
}),
|
|
6615
6622
|
structuredContent: {
|
|
@@ -6619,7 +6626,7 @@ const gd = s.object({
|
|
|
6619
6626
|
failures: C,
|
|
6620
6627
|
appliedOperations: {
|
|
6621
6628
|
updateCount: I.length,
|
|
6622
|
-
skippedCount:
|
|
6629
|
+
skippedCount: A,
|
|
6623
6630
|
failureCount: C.length,
|
|
6624
6631
|
redundantMovesSkipped: T
|
|
6625
6632
|
}
|
|
@@ -6627,7 +6634,7 @@ const gd = s.object({
|
|
|
6627
6634
|
};
|
|
6628
6635
|
}
|
|
6629
6636
|
};
|
|
6630
|
-
function
|
|
6637
|
+
function Cd({ tasks: e, outcomes: t }) {
|
|
6631
6638
|
const r = [], o = [];
|
|
6632
6639
|
let n = 0;
|
|
6633
6640
|
for (const [i, a] of t.entries()) {
|
|
@@ -6644,7 +6651,7 @@ function Sd({ tasks: e, outcomes: t }) {
|
|
|
6644
6651
|
}
|
|
6645
6652
|
return { updatedTasks: r, failures: o, skippedCount: n };
|
|
6646
6653
|
}
|
|
6647
|
-
async function
|
|
6654
|
+
async function jd(e, t) {
|
|
6648
6655
|
if (!e.some((r) => B(r.projectId)))
|
|
6649
6656
|
return {};
|
|
6650
6657
|
try {
|
|
@@ -6653,7 +6660,7 @@ async function Cd(e, t) {
|
|
|
6653
6660
|
return { error: r };
|
|
6654
6661
|
}
|
|
6655
6662
|
}
|
|
6656
|
-
async function
|
|
6663
|
+
async function Ws({
|
|
6657
6664
|
client: e,
|
|
6658
6665
|
ids: t
|
|
6659
6666
|
}) {
|
|
@@ -6671,7 +6678,7 @@ async function Hs({
|
|
|
6671
6678
|
}
|
|
6672
6679
|
return r;
|
|
6673
6680
|
}
|
|
6674
|
-
async function
|
|
6681
|
+
async function $d({
|
|
6675
6682
|
client: e,
|
|
6676
6683
|
moving: t,
|
|
6677
6684
|
results: r,
|
|
@@ -6681,10 +6688,10 @@ async function jd({
|
|
|
6681
6688
|
return;
|
|
6682
6689
|
const n = /* @__PURE__ */ new Map();
|
|
6683
6690
|
for (const c of t) {
|
|
6684
|
-
const d =
|
|
6691
|
+
const d = fd(c.move), u = n.get(d);
|
|
6685
6692
|
u ? u.push(c) : n.set(d, [c]);
|
|
6686
6693
|
}
|
|
6687
|
-
const i =
|
|
6694
|
+
const i = Pr(e), a = [];
|
|
6688
6695
|
for (const c of n.values()) {
|
|
6689
6696
|
const d = [...new Set(c.map(({ item: p }) => p.id))], u = c[0]?.move, l = c.length === 1 ? c[0] : void 0;
|
|
6690
6697
|
try {
|
|
@@ -6712,22 +6719,22 @@ async function jd({
|
|
|
6712
6719
|
}
|
|
6713
6720
|
}
|
|
6714
6721
|
if (a.length > 0) {
|
|
6715
|
-
await
|
|
6722
|
+
await Dd({ client: e, unresolved: a, results: r });
|
|
6716
6723
|
for (const { group: c } of a)
|
|
6717
6724
|
o(c);
|
|
6718
6725
|
}
|
|
6719
6726
|
}
|
|
6720
|
-
async function
|
|
6727
|
+
async function Dd({
|
|
6721
6728
|
client: e,
|
|
6722
6729
|
unresolved: t,
|
|
6723
6730
|
results: r
|
|
6724
6731
|
}) {
|
|
6725
|
-
const o = [...new Set(t.flatMap(({ group: i }) => i.map(({ item: a }) => a.id)))], n = await
|
|
6732
|
+
const o = [...new Set(t.flatMap(({ group: i }) => i.map(({ item: a }) => a.id)))], n = await Ws({ client: e, ids: o });
|
|
6726
6733
|
for (const { group: i, destination: a, error: c } of t) {
|
|
6727
6734
|
const d = c === void 0 ? "Task not returned by the move" : N(c);
|
|
6728
6735
|
for (const { item: u } of i) {
|
|
6729
6736
|
const l = n.get(u.id);
|
|
6730
|
-
if (l &&
|
|
6737
|
+
if (l && Fs(l, a)) {
|
|
6731
6738
|
r.set(u.index, { task: l });
|
|
6732
6739
|
continue;
|
|
6733
6740
|
}
|
|
@@ -6741,9 +6748,9 @@ async function Ad({
|
|
|
6741
6748
|
onUpdated: r,
|
|
6742
6749
|
onFailed: o
|
|
6743
6750
|
}) {
|
|
6744
|
-
const n =
|
|
6751
|
+
const n = Ur(e);
|
|
6745
6752
|
await Promise.all(
|
|
6746
|
-
t.filter((i) =>
|
|
6753
|
+
t.filter((i) => Hs(i.updateArgs)).map(async (i) => {
|
|
6747
6754
|
try {
|
|
6748
6755
|
const a = await n(
|
|
6749
6756
|
() => _(() => e.updateTask(i.id, i.updateArgs))
|
|
@@ -6755,7 +6762,7 @@ async function Ad({
|
|
|
6755
6762
|
})
|
|
6756
6763
|
);
|
|
6757
6764
|
}
|
|
6758
|
-
async function
|
|
6765
|
+
async function xd({
|
|
6759
6766
|
task: e,
|
|
6760
6767
|
index: t,
|
|
6761
6768
|
client: r,
|
|
@@ -6781,17 +6788,17 @@ async function Dd({
|
|
|
6781
6788
|
...y,
|
|
6782
6789
|
...h !== void 0 && { labels: h }
|
|
6783
6790
|
};
|
|
6784
|
-
p && (w.priority =
|
|
6791
|
+
p && (w.priority = ps(p));
|
|
6785
6792
|
const C = qt(
|
|
6786
6793
|
d,
|
|
6787
|
-
|
|
6788
|
-
|
|
6794
|
+
kd,
|
|
6795
|
+
vd
|
|
6789
6796
|
);
|
|
6790
6797
|
C !== void 0 && (w = { ...w, dueString: C });
|
|
6791
|
-
const
|
|
6792
|
-
if (
|
|
6798
|
+
const A = qt(m, wd, null);
|
|
6799
|
+
if (A !== void 0 && (w = { ...w, deadlineDate: A }), u)
|
|
6793
6800
|
try {
|
|
6794
|
-
const { minutes: T } =
|
|
6801
|
+
const { minutes: T } = us(u);
|
|
6795
6802
|
w = {
|
|
6796
6803
|
...w,
|
|
6797
6804
|
duration: T,
|
|
@@ -6802,7 +6809,7 @@ async function Dd({
|
|
|
6802
6809
|
}
|
|
6803
6810
|
return l !== void 0 && (w = {
|
|
6804
6811
|
...w,
|
|
6805
|
-
assigneeId: await
|
|
6812
|
+
assigneeId: await Ed(r, n, l)
|
|
6806
6813
|
}), {
|
|
6807
6814
|
index: t,
|
|
6808
6815
|
id: n,
|
|
@@ -6816,7 +6823,7 @@ async function Dd({
|
|
|
6816
6823
|
failed: !1
|
|
6817
6824
|
};
|
|
6818
6825
|
}
|
|
6819
|
-
async function
|
|
6826
|
+
async function Ed(e, t, r) {
|
|
6820
6827
|
if (r === null || r === "unassign")
|
|
6821
6828
|
return null;
|
|
6822
6829
|
const o = await ft.validateTaskUpdateAssignment(
|
|
@@ -6830,7 +6837,7 @@ async function xd(e, t, r) {
|
|
|
6830
6837
|
}
|
|
6831
6838
|
return o.resolvedUser?.userId;
|
|
6832
6839
|
}
|
|
6833
|
-
function
|
|
6840
|
+
function Od({
|
|
6834
6841
|
tasks: e,
|
|
6835
6842
|
failures: t,
|
|
6836
6843
|
skippedCount: r,
|
|
@@ -6851,7 +6858,7 @@ function Ed({
|
|
|
6851
6858
|
Failed (${t.length}) - address or drop these items:
|
|
6852
6859
|
${u}${l}`;
|
|
6853
6860
|
}
|
|
6854
|
-
function
|
|
6861
|
+
function _d({ id: e, ...t }) {
|
|
6855
6862
|
return Object.keys(t).length > 0;
|
|
6856
6863
|
}
|
|
6857
6864
|
function qt(e, t, r) {
|
|
@@ -6862,7 +6869,7 @@ function qt(e, t, r) {
|
|
|
6862
6869
|
const o = e.trim().toLowerCase();
|
|
6863
6870
|
return t.includes(o) ? r : e;
|
|
6864
6871
|
}
|
|
6865
|
-
const
|
|
6872
|
+
const Pd = {}, Ud = {
|
|
6866
6873
|
type: s.literal("user_info").describe("The type of the response."),
|
|
6867
6874
|
userId: s.string().describe("The user ID."),
|
|
6868
6875
|
fullName: s.string().describe("The full name of the user."),
|
|
@@ -6879,36 +6886,36 @@ const _d = {}, Pd = {
|
|
|
6879
6886
|
email: s.string().describe("The email address of the user."),
|
|
6880
6887
|
plan: s.enum(["Todoist Free", "Todoist Pro", "Todoist Business"]).describe("The user plan.")
|
|
6881
6888
|
};
|
|
6882
|
-
function
|
|
6889
|
+
function Rd(e) {
|
|
6883
6890
|
return e.businessAccountId ? "Todoist Business" : e.isPremium ? "Todoist Pro" : "Todoist Free";
|
|
6884
6891
|
}
|
|
6885
|
-
function
|
|
6892
|
+
function Ld(e, t) {
|
|
6886
6893
|
const o = ((e.getDay() || 7) - t + 7) % 7, n = new Date(e);
|
|
6887
6894
|
return n.setDate(e.getDate() - o), n;
|
|
6888
6895
|
}
|
|
6889
|
-
function
|
|
6896
|
+
function Nd(e) {
|
|
6890
6897
|
const t = new Date(e);
|
|
6891
6898
|
return t.setDate(e.getDate() + 6), t;
|
|
6892
6899
|
}
|
|
6893
|
-
function
|
|
6900
|
+
function Md(e) {
|
|
6894
6901
|
const t = new Date(e.getFullYear(), 0, 1), r = (e.getTime() - t.getTime()) / 864e5;
|
|
6895
6902
|
return Math.ceil((r + t.getDay() + 1) / 7);
|
|
6896
6903
|
}
|
|
6897
|
-
function
|
|
6904
|
+
function Fd(e) {
|
|
6898
6905
|
return ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"][e === 7 ? 0 : e] ?? "Unknown";
|
|
6899
6906
|
}
|
|
6900
|
-
function
|
|
6907
|
+
function Hd(e) {
|
|
6901
6908
|
try {
|
|
6902
6909
|
return new Intl.DateTimeFormat("en-US", { timeZone: e }), !0;
|
|
6903
6910
|
} catch {
|
|
6904
6911
|
return !1;
|
|
6905
6912
|
}
|
|
6906
6913
|
}
|
|
6907
|
-
function
|
|
6908
|
-
return
|
|
6914
|
+
function Bs(e) {
|
|
6915
|
+
return Hd(e) ? e : "UTC";
|
|
6909
6916
|
}
|
|
6910
|
-
function
|
|
6911
|
-
const r =
|
|
6917
|
+
function Wd(e, t) {
|
|
6918
|
+
const r = Bs(t);
|
|
6912
6919
|
return e.toLocaleString("en-US", {
|
|
6913
6920
|
timeZone: r,
|
|
6914
6921
|
year: "numeric",
|
|
@@ -6920,8 +6927,8 @@ function Hd(e, t) {
|
|
|
6920
6927
|
hour12: !1
|
|
6921
6928
|
});
|
|
6922
6929
|
}
|
|
6923
|
-
async function
|
|
6924
|
-
const t = await e.getUser(), r = t.tzInfo?.timezone ?? "UTC", o =
|
|
6930
|
+
async function Bd(e) {
|
|
6931
|
+
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
6932
|
"# User Information",
|
|
6926
6933
|
"",
|
|
6927
6934
|
`**User ID:** ${t.id}`,
|
|
@@ -6963,26 +6970,26 @@ async function Wd(e) {
|
|
|
6963
6970
|
};
|
|
6964
6971
|
return { textContent: y, structuredContent: f };
|
|
6965
6972
|
}
|
|
6966
|
-
const
|
|
6973
|
+
const zd = {
|
|
6967
6974
|
name: g.USER_INFO,
|
|
6968
6975
|
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:
|
|
6976
|
+
parameters: Pd,
|
|
6977
|
+
outputSchema: Ud,
|
|
6971
6978
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
6972
6979
|
async execute(e, t) {
|
|
6973
|
-
const r = await
|
|
6980
|
+
const r = await Bd(t);
|
|
6974
6981
|
return {
|
|
6975
6982
|
textContent: r.textContent,
|
|
6976
6983
|
structuredContent: r.structuredContent
|
|
6977
6984
|
};
|
|
6978
6985
|
}
|
|
6979
|
-
}, Yt = 10 * 1024 * 1024,
|
|
6986
|
+
}, Yt = 10 * 1024 * 1024, Kd = /* @__PURE__ */ new Set([
|
|
6980
6987
|
"image/png",
|
|
6981
6988
|
"image/jpeg",
|
|
6982
6989
|
"image/gif",
|
|
6983
6990
|
"image/webp",
|
|
6984
6991
|
"image/svg+xml"
|
|
6985
|
-
]),
|
|
6992
|
+
]), qd = /* @__PURE__ */ new Set([
|
|
6986
6993
|
"text/plain",
|
|
6987
6994
|
"text/csv",
|
|
6988
6995
|
"text/html",
|
|
@@ -6990,7 +6997,7 @@ const Bd = {
|
|
|
6990
6997
|
"application/json",
|
|
6991
6998
|
"application/xml",
|
|
6992
6999
|
"text/xml"
|
|
6993
|
-
]),
|
|
7000
|
+
]), Yd = {
|
|
6994
7001
|
".png": "image/png",
|
|
6995
7002
|
".jpg": "image/jpeg",
|
|
6996
7003
|
".jpeg": "image/jpeg",
|
|
@@ -7005,23 +7012,23 @@ const Bd = {
|
|
|
7005
7012
|
".xml": "application/xml",
|
|
7006
7013
|
".pdf": "application/pdf"
|
|
7007
7014
|
};
|
|
7008
|
-
function Yd(e) {
|
|
7009
|
-
return zd.has(e) ? "image" : Kd.has(e) || e.startsWith("text/") ? "text" : "binary";
|
|
7010
|
-
}
|
|
7011
7015
|
function Gd(e) {
|
|
7012
|
-
return (e
|
|
7016
|
+
return Kd.has(e) ? "image" : qd.has(e) || e.startsWith("text/") ? "text" : "binary";
|
|
7013
7017
|
}
|
|
7014
7018
|
function Vd(e) {
|
|
7019
|
+
return (e.split(";")[0] ?? e).trim().toLowerCase();
|
|
7020
|
+
}
|
|
7021
|
+
function Jd(e) {
|
|
7015
7022
|
try {
|
|
7016
7023
|
const t = new URL(e).pathname, r = t.lastIndexOf(".");
|
|
7017
7024
|
if (r === -1) return;
|
|
7018
7025
|
const o = t.slice(r).toLowerCase();
|
|
7019
|
-
return
|
|
7026
|
+
return Yd[o];
|
|
7020
7027
|
} catch {
|
|
7021
7028
|
return;
|
|
7022
7029
|
}
|
|
7023
7030
|
}
|
|
7024
|
-
function
|
|
7031
|
+
function Xd(e) {
|
|
7025
7032
|
try {
|
|
7026
7033
|
const t = new URL(e).pathname, r = t.lastIndexOf("/");
|
|
7027
7034
|
return r === -1 ? void 0 : t.slice(r + 1) || void 0;
|
|
@@ -7029,21 +7036,21 @@ function Jd(e) {
|
|
|
7029
7036
|
return;
|
|
7030
7037
|
}
|
|
7031
7038
|
}
|
|
7032
|
-
const
|
|
7039
|
+
const Qd = {
|
|
7033
7040
|
fileUrl: s.url().describe(
|
|
7034
7041
|
"The URL of the attachment file to view. Get this from the fileUrl field in a comment's fileAttachment."
|
|
7035
7042
|
)
|
|
7036
|
-
},
|
|
7043
|
+
}, Zd = {
|
|
7037
7044
|
name: g.VIEW_ATTACHMENT,
|
|
7038
7045
|
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:
|
|
7046
|
+
parameters: Qd,
|
|
7040
7047
|
annotations: {
|
|
7041
7048
|
readOnlyHint: !0,
|
|
7042
7049
|
destructiveHint: !1,
|
|
7043
7050
|
idempotentHint: !0
|
|
7044
7051
|
},
|
|
7045
7052
|
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 =
|
|
7053
|
+
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
7054
|
if (n && n > Yt)
|
|
7048
7055
|
return {
|
|
7049
7056
|
textContent: `Attachment "${i ?? e}" is too large to display inline (${(n / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
|
|
@@ -7053,7 +7060,7 @@ const Xd = {
|
|
|
7053
7060
|
return {
|
|
7054
7061
|
textContent: `Attachment "${i ?? e}" is too large to display inline (${(l / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
|
|
7055
7062
|
};
|
|
7056
|
-
const p =
|
|
7063
|
+
const p = Gd(d), h = [];
|
|
7057
7064
|
return p === "image" ? h.push({
|
|
7058
7065
|
type: "image",
|
|
7059
7066
|
data: u.toString("base64"),
|
|
@@ -7073,77 +7080,77 @@ const Xd = {
|
|
|
7073
7080
|
contentItems: h
|
|
7074
7081
|
};
|
|
7075
7082
|
}
|
|
7076
|
-
},
|
|
7077
|
-
...
|
|
7083
|
+
}, el = {
|
|
7084
|
+
...la,
|
|
7078
7085
|
_meta: {
|
|
7079
7086
|
ui: {
|
|
7080
7087
|
resourceUri: Be
|
|
7081
7088
|
}
|
|
7082
7089
|
}
|
|
7083
|
-
},
|
|
7090
|
+
}, tl = {
|
|
7084
7091
|
// Task management tools
|
|
7085
|
-
addTasks:
|
|
7086
|
-
completeTasks:
|
|
7087
|
-
uncompleteTasks:
|
|
7088
|
-
updateTasks:
|
|
7089
|
-
rescheduleTasks:
|
|
7090
|
-
findTasks:
|
|
7091
|
-
findTasksByDate:
|
|
7092
|
-
findCompletedTasks:
|
|
7092
|
+
addTasks: Bn,
|
|
7093
|
+
completeTasks: Qn,
|
|
7094
|
+
uncompleteTasks: Dc,
|
|
7095
|
+
updateTasks: Sd,
|
|
7096
|
+
rescheduleTasks: wc,
|
|
7097
|
+
findTasks: ga,
|
|
7098
|
+
findTasksByDate: el,
|
|
7099
|
+
findCompletedTasks: Li,
|
|
7093
7100
|
// Project management tools
|
|
7094
|
-
addProjects:
|
|
7095
|
-
updateProjects:
|
|
7096
|
-
findProjects:
|
|
7097
|
-
projectManagement:
|
|
7098
|
-
projectMove:
|
|
7101
|
+
addProjects: Cn,
|
|
7102
|
+
updateProjects: Zc,
|
|
7103
|
+
findProjects: Xi,
|
|
7104
|
+
projectManagement: uc,
|
|
7105
|
+
projectMove: mc,
|
|
7099
7106
|
// Section management tools
|
|
7100
|
-
addSections:
|
|
7101
|
-
updateSections:
|
|
7102
|
-
findSections:
|
|
7107
|
+
addSections: Nn,
|
|
7108
|
+
updateSections: pd,
|
|
7109
|
+
findSections: ia,
|
|
7103
7110
|
// Comment management tools
|
|
7104
|
-
addComments:
|
|
7105
|
-
findComments:
|
|
7106
|
-
updateComments:
|
|
7111
|
+
addComments: Qo,
|
|
7112
|
+
findComments: Di,
|
|
7113
|
+
updateComments: _c,
|
|
7107
7114
|
// Reminder management tools
|
|
7108
|
-
addReminders:
|
|
7109
|
-
findReminders:
|
|
7110
|
-
updateReminders:
|
|
7115
|
+
addReminders: _n,
|
|
7116
|
+
findReminders: ta,
|
|
7117
|
+
updateReminders: cd,
|
|
7111
7118
|
// Attachment tools
|
|
7112
|
-
viewAttachment:
|
|
7119
|
+
viewAttachment: Zd,
|
|
7113
7120
|
// Label management tools
|
|
7114
|
-
addLabels:
|
|
7115
|
-
updateLabels:
|
|
7116
|
-
findLabels:
|
|
7121
|
+
addLabels: hn,
|
|
7122
|
+
updateLabels: Yc,
|
|
7123
|
+
findLabels: Hi,
|
|
7117
7124
|
// Filter management tools
|
|
7118
|
-
findFilters:
|
|
7119
|
-
addFilters:
|
|
7120
|
-
updateFilters:
|
|
7125
|
+
findFilters: rn,
|
|
7126
|
+
addFilters: dn,
|
|
7127
|
+
updateFilters: Nc,
|
|
7121
7128
|
// Activity and audit tools
|
|
7122
|
-
findActivity:
|
|
7123
|
-
getProductivityStats:
|
|
7129
|
+
findActivity: wi,
|
|
7130
|
+
getProductivityStats: xa,
|
|
7124
7131
|
// Health and insights tools
|
|
7125
|
-
getProjectHealth:
|
|
7126
|
-
getProjectActivityStats:
|
|
7127
|
-
analyzeProjectHealth:
|
|
7128
|
-
getWorkspaceInsights:
|
|
7132
|
+
getProjectHealth: Ha,
|
|
7133
|
+
getProjectActivityStats: Ua,
|
|
7134
|
+
analyzeProjectHealth: Vn,
|
|
7135
|
+
getWorkspaceInsights: Ka,
|
|
7129
7136
|
// General tools
|
|
7130
|
-
getOverview:
|
|
7131
|
-
deleteObject:
|
|
7132
|
-
fetchObject:
|
|
7133
|
-
reorderObjects:
|
|
7134
|
-
userInfo:
|
|
7137
|
+
getOverview: $a,
|
|
7138
|
+
deleteObject: si,
|
|
7139
|
+
fetchObject: mi,
|
|
7140
|
+
reorderObjects: gc,
|
|
7141
|
+
userInfo: zd,
|
|
7135
7142
|
// Assignment and collaboration tools
|
|
7136
|
-
findProjectCollaborators:
|
|
7137
|
-
manageAssignments:
|
|
7143
|
+
findProjectCollaborators: Ki,
|
|
7144
|
+
manageAssignments: cc,
|
|
7138
7145
|
// Template tools
|
|
7139
|
-
exportProjectTemplate:
|
|
7140
|
-
importProjectTemplate:
|
|
7146
|
+
exportProjectTemplate: ni,
|
|
7147
|
+
importProjectTemplate: Ja,
|
|
7141
7148
|
// Workspace tools
|
|
7142
|
-
listWorkspaces:
|
|
7149
|
+
listWorkspaces: sc,
|
|
7143
7150
|
// OpenAI MCP tools
|
|
7144
|
-
search:
|
|
7145
|
-
fetch:
|
|
7146
|
-
},
|
|
7151
|
+
search: Cc,
|
|
7152
|
+
fetch: gi
|
|
7153
|
+
}, sl = Object.values(tl), rl = `
|
|
7147
7154
|
## Todoist Task and Project Management Tools
|
|
7148
7155
|
|
|
7149
7156
|
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 +7207,25 @@ Use the **productivity-analysis** prompt for a combined productivity review —
|
|
|
7200
7207
|
|
|
7201
7208
|
Always provide clear, actionable task titles and descriptions. Use the overview tools to give users context about their workload and project status.
|
|
7202
7209
|
`;
|
|
7203
|
-
function
|
|
7210
|
+
function gl({
|
|
7204
7211
|
todoistApiKey: e,
|
|
7205
7212
|
baseUrl: t,
|
|
7206
7213
|
features: r = []
|
|
7207
7214
|
}) {
|
|
7208
|
-
const o = new
|
|
7215
|
+
const o = new Ks(
|
|
7209
7216
|
{ name: "todoist-mcp-server", version: ot },
|
|
7210
7217
|
{
|
|
7211
7218
|
capabilities: {
|
|
7212
7219
|
tools: { listChanged: !0 },
|
|
7213
7220
|
prompts: { listChanged: !0 }
|
|
7214
7221
|
},
|
|
7215
|
-
instructions:
|
|
7222
|
+
instructions: rl
|
|
7216
7223
|
}
|
|
7217
|
-
), n =
|
|
7218
|
-
|
|
7224
|
+
), n = Vr(e, { baseUrl: t });
|
|
7225
|
+
dr(o);
|
|
7219
7226
|
const i = { server: o, client: n, features: r };
|
|
7220
|
-
for (const a of
|
|
7221
|
-
|
|
7227
|
+
for (const a of sl)
|
|
7228
|
+
yo({ tool: a, ...i });
|
|
7222
7229
|
return o.registerPrompt(
|
|
7223
7230
|
ye.name,
|
|
7224
7231
|
{
|
|
@@ -7230,58 +7237,58 @@ function bl({
|
|
|
7230
7237
|
), o;
|
|
7231
7238
|
}
|
|
7232
7239
|
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
|
-
|
|
7240
|
+
to as $,
|
|
7241
|
+
$a as A,
|
|
7242
|
+
xa as B,
|
|
7243
|
+
Ua as C,
|
|
7244
|
+
Ha as D,
|
|
7245
|
+
Ka as E,
|
|
7246
|
+
bl as F,
|
|
7247
|
+
Ja as G,
|
|
7248
|
+
sc as H,
|
|
7249
|
+
cc as I,
|
|
7250
|
+
uc as J,
|
|
7251
|
+
mc as K,
|
|
7252
|
+
sl as L,
|
|
7253
|
+
gc as M,
|
|
7254
|
+
wc as N,
|
|
7255
|
+
Cc as O,
|
|
7256
|
+
Dc as P,
|
|
7257
|
+
_c as Q,
|
|
7258
|
+
Nc as R,
|
|
7259
|
+
Yc as S,
|
|
7260
|
+
Zc as T,
|
|
7261
|
+
cd as U,
|
|
7262
|
+
pd as V,
|
|
7263
|
+
Sd as W,
|
|
7264
|
+
zd as X,
|
|
7265
|
+
Zd as Y,
|
|
7266
|
+
Vr as Z,
|
|
7267
|
+
Fr as _,
|
|
7268
|
+
Qo as a,
|
|
7269
|
+
dn as b,
|
|
7270
|
+
hn as c,
|
|
7271
|
+
Cn as d,
|
|
7272
|
+
_n as e,
|
|
7273
|
+
Nn as f,
|
|
7274
|
+
gl as g,
|
|
7275
|
+
Bn as h,
|
|
7276
|
+
Vn as i,
|
|
7277
|
+
Qn as j,
|
|
7278
|
+
si as k,
|
|
7279
|
+
ni as l,
|
|
7280
|
+
gi as m,
|
|
7281
|
+
mi as n,
|
|
7282
|
+
wi as o,
|
|
7283
|
+
Di as p,
|
|
7284
|
+
Li as q,
|
|
7285
|
+
rn as r,
|
|
7286
|
+
Hi as s,
|
|
7287
|
+
tl as t,
|
|
7288
|
+
Ki as u,
|
|
7289
|
+
Xi as v,
|
|
7290
|
+
ta as w,
|
|
7291
|
+
ia as x,
|
|
7292
|
+
ga as y,
|
|
7293
|
+
la as z
|
|
7287
7294
|
};
|