@doist/todoist-mcp 13.11.2 → 14.0.1
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 +22 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/main-http.js +3 -3
- package/dist/main.js +4 -4
- package/dist/{mcp-server-Ch2evDzx.js → mcp-server-Ct6wMUZG.js} +668 -626
- package/dist/mcp-server.d.ts +3 -4
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/middleware/require-valid-todoist-token.d.ts +2 -1
- package/dist/middleware/require-valid-todoist-token.d.ts.map +1 -1
- package/dist/require-valid-todoist-token-Bt965UvN.js +79 -0
- package/dist/tool-registry.d.ts +22 -11
- package/dist/tool-registry.d.ts.map +1 -1
- package/dist/tools/reschedule-tasks.d.ts +22 -11
- package/dist/tools/reschedule-tasks.d.ts.map +1 -1
- package/dist/usage-tracking.d.ts +5 -0
- package/dist/usage-tracking.d.ts.map +1 -1
- package/dist/utils/validate-todoist-token.d.ts +12 -4
- package/dist/utils/validate-todoist-token.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/require-valid-todoist-token-hnihbsSe.js +0 -72
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { ResourceTemplate as
|
|
1
|
+
import { ResourceTemplate as jo, McpServer as $o } from "@modelcontextprotocol/server";
|
|
2
2
|
import { createHash as ps, randomUUID as Ke } from "node:crypto";
|
|
3
|
-
import { readFileSync as
|
|
3
|
+
import { readFileSync as Ao } from "node:fs";
|
|
4
4
|
import { dirname as hs, join as qe } from "node:path";
|
|
5
|
-
import { fileURLToPath as
|
|
5
|
+
import { fileURLToPath as Eo } from "node:url";
|
|
6
6
|
import { RESOURCE_MIME_TYPE as Ge } from "@modelcontextprotocol/ext-apps/server";
|
|
7
7
|
import { createToolRegistrar as Do } from "@doist/mcp-core";
|
|
8
|
-
import ue, { ZodError as
|
|
9
|
-
import { AsyncLocalStorage as
|
|
10
|
-
import { createRequire as
|
|
11
|
-
import { TodoistApi as
|
|
8
|
+
import ue, { ZodError as xo, z as o } from "zod";
|
|
9
|
+
import { AsyncLocalStorage as Oo } from "node:async_hooks";
|
|
10
|
+
import { createRequire as Uo } from "node:module";
|
|
11
|
+
import { TodoistApi as _o, formatUserShortName as ms, isWorkspaceProject as F, isPersonalProject as z, colors as ze, LOCATION_TRIGGERS as fs, REMINDER_TYPES as Ro, TodoistSyncError as Po, TodoistRequestError as No, createCommand as ne, PROJECT_VIEW_STYLES as bs, REMINDER_DELIVERY_SERVICES as Lo, HEALTH_STATUSES as ct, getTaskUrl as gs, getProjectUrl as ys, ACTIVITY_EVENT_TYPES as Mo, ACTIVITY_OBJECT_TYPES as Ts, escapeFilterToken as ws, parseTodoistUrl as Fo, WORKSPACE_ROLES as Ho, WORKSPACE_PLANS as Wo } from "@doist/todoist-sdk";
|
|
12
12
|
import { addDays as Ye, formatISO as xt } from "date-fns";
|
|
13
13
|
import { generateNKeysBetween as ks } from "fractional-indexing";
|
|
14
|
-
const dt = 3600 * 1e3,
|
|
14
|
+
const dt = 3600 * 1e3, Bo = 365 * 24 * dt, E = {
|
|
15
15
|
/** Default limit for task listings */
|
|
16
16
|
TASKS_DEFAULT: 10,
|
|
17
17
|
/** Maximum limit for task search and list operations */
|
|
@@ -44,10 +44,10 @@ const dt = 3600 * 1e3, Wo = 365 * 24 * dt, D = {
|
|
|
44
44
|
LABELS_DEFAULT: 50,
|
|
45
45
|
/** Maximum limit for label listings */
|
|
46
46
|
LABELS_MAX: 200
|
|
47
|
-
},
|
|
47
|
+
}, Ce = {
|
|
48
48
|
/** Maximum number of failures to show in detailed error messages */
|
|
49
49
|
MAX_FAILURES_SHOWN: 3
|
|
50
|
-
},
|
|
50
|
+
}, Ko = {
|
|
51
51
|
/** Maximum number of failed items named in one log line */
|
|
52
52
|
MAX_FAILURES_LOGGED: 5
|
|
53
53
|
}, vs = {
|
|
@@ -76,26 +76,26 @@ const dt = 3600 * 1e3, Wo = 365 * 24 * dt, D = {
|
|
|
76
76
|
* queue (serialised moves to 100 distinct destinations is roughly 15s).
|
|
77
77
|
*/
|
|
78
78
|
QUEUE_WAIT_MS: 3e4
|
|
79
|
-
}, Ot = hs(
|
|
79
|
+
}, Ot = hs(Eo(import.meta.url)), qo = [
|
|
80
80
|
qe(Ot, "task-list", "index.html"),
|
|
81
81
|
qe(Ot, "mcp-apps", "index.html")
|
|
82
|
-
],
|
|
82
|
+
], Go = `<!doctype html>
|
|
83
83
|
<html>
|
|
84
84
|
<body>
|
|
85
85
|
<p>Task list app is missing. Run "npm run build" to generate it.</p>
|
|
86
86
|
</body>
|
|
87
87
|
</html>`;
|
|
88
|
-
function
|
|
88
|
+
function zo() {
|
|
89
89
|
const e = [];
|
|
90
|
-
for (const t of
|
|
90
|
+
for (const t of qo)
|
|
91
91
|
try {
|
|
92
|
-
return
|
|
92
|
+
return Ao(t, "utf-8");
|
|
93
93
|
} catch (s) {
|
|
94
94
|
e.push(s);
|
|
95
95
|
}
|
|
96
|
-
return console.error("Failed to load task list app HTML from any known path:", e),
|
|
96
|
+
return console.error("Failed to load task list app HTML from any known path:", e), Go;
|
|
97
97
|
}
|
|
98
|
-
const Is =
|
|
98
|
+
const Is = zo(), Yo = ps("sha256").update(Is).digest("hex").slice(0, 12), Je = `ui://todoist/task-list@${Yo}`, Vo = "ui://todoist/task-list@{hash}", Xe = "Interactive task list widget", Jo = "https://ai.todoist.net", Ze = {
|
|
99
99
|
ui: {
|
|
100
100
|
prefersBorder: !0,
|
|
101
101
|
csp: {
|
|
@@ -110,8 +110,8 @@ const Is = Go(), zo = ps("sha256").update(Is).digest("hex").slice(0, 12), Je = `
|
|
|
110
110
|
connect_domains: [],
|
|
111
111
|
resource_domains: []
|
|
112
112
|
},
|
|
113
|
-
"openai/widgetDomain":
|
|
114
|
-
},
|
|
113
|
+
"openai/widgetDomain": Jo
|
|
114
|
+
}, Xo = { ttlMs: Bo, cacheScope: "public" }, Zo = { ttlMs: dt, cacheScope: "private" };
|
|
115
115
|
function Ut(e) {
|
|
116
116
|
return {
|
|
117
117
|
contents: [
|
|
@@ -124,7 +124,7 @@ function Ut(e) {
|
|
|
124
124
|
]
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function Qo(e) {
|
|
128
128
|
e.registerResource(
|
|
129
129
|
"todoist-task-list",
|
|
130
130
|
Je,
|
|
@@ -132,17 +132,17 @@ function Zo(e) {
|
|
|
132
132
|
description: Xe,
|
|
133
133
|
mimeType: Ge,
|
|
134
134
|
_meta: Ze,
|
|
135
|
-
cacheHint:
|
|
135
|
+
cacheHint: Xo
|
|
136
136
|
},
|
|
137
137
|
async () => Ut(Je)
|
|
138
138
|
), e.registerResource(
|
|
139
139
|
"todoist-task-list-hash-fallback",
|
|
140
|
-
new
|
|
140
|
+
new jo(Vo, { list: void 0 }),
|
|
141
141
|
{
|
|
142
142
|
description: `${Xe} compatibility fallback`,
|
|
143
143
|
mimeType: Ge,
|
|
144
144
|
_meta: Ze,
|
|
145
|
-
cacheHint:
|
|
145
|
+
cacheHint: Zo
|
|
146
146
|
},
|
|
147
147
|
async (t) => Ut(t.toString())
|
|
148
148
|
);
|
|
@@ -174,14 +174,14 @@ function pe(e) {
|
|
|
174
174
|
const t = M(e);
|
|
175
175
|
return t !== void 0 ? t : S(e);
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function er(e) {
|
|
178
178
|
return e.replace(/\b(Bearer)\s+[A-Za-z0-9._~+/=-]+/gi, "$1 [REDACTED]").replace(
|
|
179
179
|
/\b(token|api[_-]?key|authorization)\s*[:=]\s*["']?[A-Za-z0-9._~+/=-]{6,}["']?/gi,
|
|
180
180
|
"$1: [REDACTED]"
|
|
181
181
|
).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]");
|
|
182
182
|
}
|
|
183
183
|
function B(e, t = 220) {
|
|
184
|
-
const s =
|
|
184
|
+
const s = er(e).replace(/\s+/g, " ").trim();
|
|
185
185
|
return s.length <= t ? s : `${s.slice(0, t - 3)}...`;
|
|
186
186
|
}
|
|
187
187
|
function et(e) {
|
|
@@ -222,7 +222,7 @@ function oe(e) {
|
|
|
222
222
|
}
|
|
223
223
|
return r.length > 0 ? B(r.join("; ")) : void 0;
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function tr(e) {
|
|
226
226
|
if (!e)
|
|
227
227
|
return [];
|
|
228
228
|
const t = /* @__PURE__ */ new Set(), s = (a) => {
|
|
@@ -285,7 +285,7 @@ function er(e) {
|
|
|
285
285
|
}
|
|
286
286
|
return Array.from(t).slice(0, 3);
|
|
287
287
|
}
|
|
288
|
-
const
|
|
288
|
+
const sr = [
|
|
289
289
|
"error",
|
|
290
290
|
"error_code",
|
|
291
291
|
"error_tag",
|
|
@@ -296,14 +296,14 @@ const tr = [
|
|
|
296
296
|
"httpCode",
|
|
297
297
|
"errorExtra"
|
|
298
298
|
];
|
|
299
|
-
function
|
|
300
|
-
return e ?
|
|
299
|
+
function or(e) {
|
|
300
|
+
return e ? sr.some((t) => e[t] !== void 0) : !1;
|
|
301
301
|
}
|
|
302
302
|
const tt = {
|
|
303
303
|
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.",
|
|
304
304
|
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."
|
|
305
305
|
};
|
|
306
|
-
function
|
|
306
|
+
function rr(...e) {
|
|
307
307
|
for (const t of e) {
|
|
308
308
|
if (!t)
|
|
309
309
|
continue;
|
|
@@ -314,16 +314,16 @@ function or(...e) {
|
|
|
314
314
|
return tt[r];
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
|
-
function
|
|
317
|
+
function nr(e) {
|
|
318
318
|
if (e.tag) {
|
|
319
319
|
const t = tt[e.tag.toUpperCase()];
|
|
320
320
|
if (t)
|
|
321
321
|
return t;
|
|
322
322
|
}
|
|
323
|
-
return
|
|
323
|
+
return rr(...e.rawText ?? [], e.message, e.details);
|
|
324
324
|
}
|
|
325
|
-
function
|
|
326
|
-
const t =
|
|
325
|
+
function ir(e) {
|
|
326
|
+
const t = nr(e);
|
|
327
327
|
if (t)
|
|
328
328
|
return t;
|
|
329
329
|
const { statusCode: s } = e, r = e.fieldHints.length > 0;
|
|
@@ -377,8 +377,8 @@ function lt(e) {
|
|
|
377
377
|
oe(n?.errorDetails),
|
|
378
378
|
oe(n?.errors),
|
|
379
379
|
oe(t?.details)
|
|
380
|
-
), p =
|
|
381
|
-
return i !== void 0 ||
|
|
380
|
+
), p = tr(n);
|
|
381
|
+
return i !== void 0 || or(n) || c !== void 0 || a !== void 0 || (l ? et(l) : !1) ? {
|
|
382
382
|
statusCode: i,
|
|
383
383
|
code: a,
|
|
384
384
|
tag: c ? B(c, 80) : void 0,
|
|
@@ -392,11 +392,11 @@ function Ss(e) {
|
|
|
392
392
|
const t = [];
|
|
393
393
|
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;
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function ar(e) {
|
|
396
396
|
const t = Ss(e), s = [
|
|
397
397
|
t.length > 0 ? `Todoist API request failed (${t.join(", ")}).` : "Todoist API request failed."
|
|
398
398
|
];
|
|
399
|
-
return e.message && s.push(`Message: ${e.message}`), e.details && e.details !== e.message && s.push(`Details: ${e.details}`), e.fieldHints.length > 0 && s.push(`Field hints: ${e.fieldHints.join("; ")}`), s.push(`Try next: ${
|
|
399
|
+
return e.message && s.push(`Message: ${e.message}`), e.details && e.details !== e.message && s.push(`Details: ${e.details}`), e.fieldHints.length > 0 && s.push(`Field hints: ${e.fieldHints.join("; ")}`), s.push(`Try next: ${ir(e)}`), s.join(`
|
|
400
400
|
`);
|
|
401
401
|
}
|
|
402
402
|
function Cs(e) {
|
|
@@ -407,7 +407,7 @@ class ut extends Error {
|
|
|
407
407
|
super(t), this.name = "DueStringParseError";
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
|
-
function
|
|
410
|
+
function D(e) {
|
|
411
411
|
if (e instanceof ut)
|
|
412
412
|
return e.message;
|
|
413
413
|
const t = lt(e);
|
|
@@ -416,7 +416,7 @@ function E(e) {
|
|
|
416
416
|
const s = Ss(t), r = t.message && !(s.length > 0 && et(t.message)) ? t.message : "Todoist API request failed";
|
|
417
417
|
return s.length > 0 ? `${r} (${s.join(", ")})` : r;
|
|
418
418
|
}
|
|
419
|
-
function
|
|
419
|
+
function cr(e, {
|
|
420
420
|
taskContent: t,
|
|
421
421
|
dueString: s,
|
|
422
422
|
deadlineDate: r
|
|
@@ -429,14 +429,14 @@ function ar(e, {
|
|
|
429
429
|
const d = s.trim().replace(/^recurring(?:\s+|$)/i, "").trim();
|
|
430
430
|
return d !== s.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 !== s.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.`;
|
|
431
431
|
}
|
|
432
|
-
function
|
|
433
|
-
if (e instanceof
|
|
432
|
+
function dr(e) {
|
|
433
|
+
if (e instanceof xo || e instanceof ut)
|
|
434
434
|
return e.message;
|
|
435
435
|
const t = lt(e);
|
|
436
|
-
return t ?
|
|
436
|
+
return t ? ar(t) : Cs(e);
|
|
437
437
|
}
|
|
438
|
-
const
|
|
439
|
-
version:
|
|
438
|
+
const lr = "14.0.1", ur = {
|
|
439
|
+
version: lr
|
|
440
440
|
};
|
|
441
441
|
function _t(e, { queueTimeoutMs: t = Ve.QUEUE_WAIT_MS } = {}) {
|
|
442
442
|
if (!Number.isInteger(e) || e < 1)
|
|
@@ -486,36 +486,36 @@ function pt() {
|
|
|
486
486
|
writes: _t(Ve.WRITES)
|
|
487
487
|
};
|
|
488
488
|
}
|
|
489
|
-
const
|
|
490
|
-
let
|
|
489
|
+
const pr = 1e4, hr = 5 * 6e4, G = /* @__PURE__ */ new Map();
|
|
490
|
+
let mr = pr;
|
|
491
491
|
const js = /* @__PURE__ */ new WeakMap(), re = /* @__PURE__ */ new Map();
|
|
492
|
-
let
|
|
493
|
-
function
|
|
494
|
-
return
|
|
492
|
+
let Rt, Pt;
|
|
493
|
+
function fr() {
|
|
494
|
+
return Rt ??= pt(), Rt;
|
|
495
495
|
}
|
|
496
496
|
function Nt() {
|
|
497
|
-
return
|
|
497
|
+
return Pt ??= pt(), Pt;
|
|
498
498
|
}
|
|
499
|
-
function
|
|
499
|
+
function br(e) {
|
|
500
500
|
return ps("sha256").update(e).digest("hex");
|
|
501
501
|
}
|
|
502
|
-
function
|
|
502
|
+
function gr({ moves: e, writes: t }) {
|
|
503
503
|
return e.isIdle() && t.isIdle();
|
|
504
504
|
}
|
|
505
505
|
function $s(e) {
|
|
506
|
-
return e.leases === 0 &&
|
|
506
|
+
return e.leases === 0 && gr(e.limiters);
|
|
507
507
|
}
|
|
508
|
-
function
|
|
508
|
+
function yr(e, t, s) {
|
|
509
509
|
G.delete(e), t.lastUsedAt = s, G.set(e, t);
|
|
510
510
|
}
|
|
511
|
-
function
|
|
511
|
+
function Tr(e) {
|
|
512
512
|
for (const [t, s] of G) {
|
|
513
|
-
if (e - s.lastUsedAt <
|
|
513
|
+
if (e - s.lastUsedAt < hr)
|
|
514
514
|
break;
|
|
515
515
|
$s(s) && G.delete(t);
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
|
-
function
|
|
518
|
+
function wr() {
|
|
519
519
|
for (const [e, t] of G)
|
|
520
520
|
if ($s(t))
|
|
521
521
|
return G.delete(e), !0;
|
|
@@ -526,13 +526,13 @@ function As(e, t) {
|
|
|
526
526
|
return;
|
|
527
527
|
const s = G.get(e);
|
|
528
528
|
if (s)
|
|
529
|
-
return
|
|
530
|
-
if (
|
|
529
|
+
return yr(e, s, t), s;
|
|
530
|
+
if (Tr(t), G.size >= mr && !wr())
|
|
531
531
|
return;
|
|
532
532
|
const r = { limiters: pt(), lastUsedAt: t, leases: 0 };
|
|
533
533
|
return G.set(e, r), r;
|
|
534
534
|
}
|
|
535
|
-
function
|
|
535
|
+
function kr(e) {
|
|
536
536
|
const t = re.get(e);
|
|
537
537
|
if (t !== void 0)
|
|
538
538
|
return re.set(e, t + 1), {
|
|
@@ -558,51 +558,51 @@ function Lt(e) {
|
|
|
558
558
|
}
|
|
559
559
|
re.set(e, t - 1);
|
|
560
560
|
}
|
|
561
|
-
function
|
|
562
|
-
const s =
|
|
561
|
+
function vr(e, t) {
|
|
562
|
+
const s = br(t);
|
|
563
563
|
js.set(e, s);
|
|
564
564
|
}
|
|
565
|
-
function
|
|
565
|
+
function Es(e, t) {
|
|
566
566
|
const s = js.get(e);
|
|
567
567
|
return s ? (As(s, Date.now()), async (r) => {
|
|
568
|
-
const n =
|
|
568
|
+
const n = kr(s);
|
|
569
569
|
try {
|
|
570
570
|
return await n.limiters[t](r);
|
|
571
571
|
} finally {
|
|
572
572
|
n.release();
|
|
573
573
|
}
|
|
574
|
-
}) :
|
|
575
|
-
}
|
|
576
|
-
function vr(e) {
|
|
577
|
-
return Ds(e, "moves");
|
|
574
|
+
}) : fr()[t];
|
|
578
575
|
}
|
|
579
576
|
function Ir(e) {
|
|
580
|
-
return
|
|
577
|
+
return Es(e, "moves");
|
|
578
|
+
}
|
|
579
|
+
function Sr(e) {
|
|
580
|
+
return Es(e, "writes");
|
|
581
581
|
}
|
|
582
|
-
const
|
|
583
|
-
let
|
|
584
|
-
const
|
|
582
|
+
const Cr = "todoist-mcp", ht = ur.version, Ds = new Oo(), Mt = Uo(import.meta.url);
|
|
583
|
+
let De;
|
|
584
|
+
const jr = async () => {
|
|
585
585
|
const e = Mt.resolve("@doist/todoist-sdk"), t = qe(hs(e), "transport", "http-dispatcher.js");
|
|
586
586
|
return Mt(t);
|
|
587
587
|
};
|
|
588
|
-
let
|
|
589
|
-
function
|
|
590
|
-
return `${
|
|
588
|
+
let $r = jr;
|
|
589
|
+
function Ar() {
|
|
590
|
+
return `${Cr}/${ht}`;
|
|
591
591
|
}
|
|
592
592
|
function xs(e) {
|
|
593
593
|
return e.trim().toLowerCase();
|
|
594
594
|
}
|
|
595
|
-
function
|
|
596
|
-
return
|
|
595
|
+
function Er(e, t) {
|
|
596
|
+
return Ds.run(xs(e), t);
|
|
597
597
|
}
|
|
598
598
|
function Dr({
|
|
599
599
|
label: e,
|
|
600
600
|
platform: t = "mcp",
|
|
601
601
|
sessionId: s = Ke()
|
|
602
602
|
} = {}) {
|
|
603
|
-
const r = e ? xs(e) :
|
|
603
|
+
const r = e ? xs(e) : Ds.getStore();
|
|
604
604
|
return {
|
|
605
|
-
"User-Agent":
|
|
605
|
+
"User-Agent": Ar(),
|
|
606
606
|
"doist-platform": t,
|
|
607
607
|
"doist-version": ht,
|
|
608
608
|
"request-id": Ke(),
|
|
@@ -610,7 +610,7 @@ function Dr({
|
|
|
610
610
|
"mcp-tool": r ?? "unknown"
|
|
611
611
|
};
|
|
612
612
|
}
|
|
613
|
-
function
|
|
613
|
+
function xr(e, t) {
|
|
614
614
|
const s = new Headers(e);
|
|
615
615
|
for (const [r, n] of Object.entries(Dr(t)))
|
|
616
616
|
s.set(r, n);
|
|
@@ -619,7 +619,7 @@ function Er(e, t) {
|
|
|
619
619
|
function Ft() {
|
|
620
620
|
return new DOMException("The operation was aborted due to timeout", "TimeoutError");
|
|
621
621
|
}
|
|
622
|
-
function
|
|
622
|
+
function Or(e, t) {
|
|
623
623
|
if (!e && t === void 0)
|
|
624
624
|
return {
|
|
625
625
|
signal: void 0,
|
|
@@ -657,22 +657,26 @@ function xr(e, t) {
|
|
|
657
657
|
}
|
|
658
658
|
};
|
|
659
659
|
}
|
|
660
|
-
async function
|
|
661
|
-
if (
|
|
662
|
-
return
|
|
663
|
-
throw
|
|
664
|
-
})),
|
|
660
|
+
async function Ur() {
|
|
661
|
+
if (_r())
|
|
662
|
+
return De || (De = $r().then((e) => e.getDefaultTransport()).catch((e) => {
|
|
663
|
+
throw De = void 0, e;
|
|
664
|
+
})), De;
|
|
665
665
|
}
|
|
666
|
-
function
|
|
666
|
+
function _r() {
|
|
667
667
|
return typeof process < "u" && !!process.versions?.node;
|
|
668
668
|
}
|
|
669
|
-
async function
|
|
669
|
+
async function Os(e, t) {
|
|
670
670
|
if ("dispatcher" in t)
|
|
671
671
|
return e;
|
|
672
|
-
const s = await
|
|
672
|
+
const s = await Ur();
|
|
673
673
|
return s ? (t.dispatcher = s.dispatcher, s.fetch ?? e) : e;
|
|
674
674
|
}
|
|
675
|
-
function
|
|
675
|
+
async function Ou(e, t) {
|
|
676
|
+
const s = { ...t };
|
|
677
|
+
return (await Os(globalThis.fetch, s))(e, s);
|
|
678
|
+
}
|
|
679
|
+
function Rr(e) {
|
|
676
680
|
return {
|
|
677
681
|
ok: e.ok,
|
|
678
682
|
status: e.status,
|
|
@@ -683,17 +687,17 @@ function Pr(e) {
|
|
|
683
687
|
arrayBuffer: () => e.arrayBuffer()
|
|
684
688
|
};
|
|
685
689
|
}
|
|
686
|
-
function
|
|
690
|
+
function Pr(e = globalThis.fetch, t = {}) {
|
|
687
691
|
const s = e === globalThis.fetch, { enabled: r = !0, platform: n = "mcp", sessionId: i = Ke() } = t;
|
|
688
692
|
return async (a, c = {}) => {
|
|
689
|
-
const { timeout: d, headers: l, signal: u, ...p } = c, { signal: h, cleanup: f } =
|
|
693
|
+
const { timeout: d, headers: l, signal: u, ...p } = c, { signal: h, cleanup: f } = Or(u, d);
|
|
690
694
|
try {
|
|
691
695
|
const b = {
|
|
692
696
|
...p,
|
|
693
697
|
signal: h,
|
|
694
|
-
...r ? { headers:
|
|
695
|
-
}, g = await (s ? await
|
|
696
|
-
return
|
|
698
|
+
...r ? { headers: xr(l, { platform: n, sessionId: i }) } : l !== void 0 ? { headers: l } : {}
|
|
699
|
+
}, g = await (s ? await Os(e, b) : e)(a, b);
|
|
700
|
+
return Rr(g);
|
|
697
701
|
} finally {
|
|
698
702
|
f();
|
|
699
703
|
}
|
|
@@ -703,14 +707,14 @@ function Nr(e, {
|
|
|
703
707
|
baseUrl: t,
|
|
704
708
|
tracking: s
|
|
705
709
|
} = {}) {
|
|
706
|
-
const r = new
|
|
707
|
-
customFetch:
|
|
710
|
+
const r = new _o(e, {
|
|
711
|
+
customFetch: Pr(globalThis.fetch, s),
|
|
708
712
|
...t ? { baseUrl: t } : {}
|
|
709
713
|
});
|
|
710
|
-
return
|
|
714
|
+
return vr(r, e), r;
|
|
711
715
|
}
|
|
712
716
|
const Lr = 2, Mr = 500, Fr = 2e3, Hr = 50, Wr = /* @__PURE__ */ new Set([502, 503, 504]), Br = /* @__PURE__ */ new Set([503]);
|
|
713
|
-
function
|
|
717
|
+
function Us(e) {
|
|
714
718
|
if (e == null || typeof e != "object")
|
|
715
719
|
return;
|
|
716
720
|
const t = e;
|
|
@@ -727,7 +731,7 @@ function Os(e) {
|
|
|
727
731
|
}
|
|
728
732
|
}
|
|
729
733
|
function Kr(e, t = Wr) {
|
|
730
|
-
const s =
|
|
734
|
+
const s = Us(e);
|
|
731
735
|
return s !== void 0 && t.has(s);
|
|
732
736
|
}
|
|
733
737
|
function qr({
|
|
@@ -826,7 +830,7 @@ const T = {
|
|
|
826
830
|
// OpenAI MCP tools
|
|
827
831
|
SEARCH: "search",
|
|
828
832
|
FETCH: "fetch"
|
|
829
|
-
},
|
|
833
|
+
}, Uu = {
|
|
830
834
|
/**
|
|
831
835
|
* Strips email addresses from tool outputs that expose user data.
|
|
832
836
|
* Affects: find-project-collaborators, find-completed-tasks
|
|
@@ -873,10 +877,10 @@ function Qr({
|
|
|
873
877
|
const n = r.some((a) => a.name === "strip_emails"), i = Do({
|
|
874
878
|
titlePrefix: "Todoist",
|
|
875
879
|
createContext: () => s,
|
|
876
|
-
formatError:
|
|
880
|
+
formatError: dr,
|
|
877
881
|
structuredContentAsText: !zr,
|
|
878
882
|
wrapExecute: async (a, c) => {
|
|
879
|
-
const d = await
|
|
883
|
+
const d = await Er(a.name, () => $(c));
|
|
880
884
|
return !n || !Zr(a.name) ? d : {
|
|
881
885
|
...d,
|
|
882
886
|
textContent: d.textContent && Xr(d.textContent),
|
|
@@ -1022,31 +1026,31 @@ function rn(e) {
|
|
|
1022
1026
|
]
|
|
1023
1027
|
};
|
|
1024
1028
|
}
|
|
1025
|
-
const
|
|
1029
|
+
const Ie = {
|
|
1026
1030
|
name: "productivity-analysis",
|
|
1027
1031
|
title: "Productivity Analysis",
|
|
1028
1032
|
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.",
|
|
1029
1033
|
argsSchema: en,
|
|
1030
1034
|
callback: rn
|
|
1031
|
-
},
|
|
1032
|
-
class
|
|
1035
|
+
}, _s = 'The duration of the task. Use format: "2h" (hours), "90m" (minutes), "2h30m" (combined), "1.5h" (decimal hours), or "3d" (whole days; days cannot be combined with hours or minutes). Todoist apps only display durations under 24 hours: a longer or day-based duration is stored and reported by this server, but the apps show the task as having no duration.', Rs = 'Use format like "2h", "30m", "2h30m", "1.5h", or "3d"';
|
|
1036
|
+
class R extends Error {
|
|
1033
1037
|
constructor(t, s) {
|
|
1034
1038
|
super(`Invalid duration format "${t}": ${s}`), this.name = "DurationParseError";
|
|
1035
1039
|
}
|
|
1036
1040
|
}
|
|
1037
1041
|
function nn(e) {
|
|
1038
1042
|
if (!e || typeof e != "string")
|
|
1039
|
-
throw new
|
|
1043
|
+
throw new R(e, "Duration must be a non-empty string");
|
|
1040
1044
|
const t = e.trim().toLowerCase().replace(/\s+/g, "");
|
|
1041
1045
|
if (!t)
|
|
1042
|
-
throw new
|
|
1046
|
+
throw new R(e, "Duration must be a non-empty string");
|
|
1043
1047
|
const s = t.match(/^(\d+(?:\.\d+)?)d$/)?.[1];
|
|
1044
1048
|
if (s !== void 0)
|
|
1045
1049
|
return { amount: cn(e, s), unit: "day" };
|
|
1046
1050
|
if (an(t))
|
|
1047
|
-
throw new
|
|
1051
|
+
throw new R(
|
|
1048
1052
|
e,
|
|
1049
|
-
`${
|
|
1053
|
+
`${Rs} (days cannot be combined with hours or minutes)`
|
|
1050
1054
|
);
|
|
1051
1055
|
return { amount: dn(e, t), unit: "minute" };
|
|
1052
1056
|
}
|
|
@@ -1057,51 +1061,51 @@ const ot = "Duration is too large";
|
|
|
1057
1061
|
function cn(e, t) {
|
|
1058
1062
|
const s = Number.parseFloat(t);
|
|
1059
1063
|
if (Number.isNaN(s) || s < 0)
|
|
1060
|
-
throw new
|
|
1064
|
+
throw new R(e, "Days must be a positive number");
|
|
1061
1065
|
if (!Number.isFinite(s))
|
|
1062
|
-
throw new
|
|
1066
|
+
throw new R(e, ot);
|
|
1063
1067
|
if (s % 1 !== 0)
|
|
1064
|
-
throw new
|
|
1068
|
+
throw new R(e, "Days must be a whole number");
|
|
1065
1069
|
if (s === 0)
|
|
1066
|
-
throw new
|
|
1070
|
+
throw new R(e, "Duration must be at least 1 day");
|
|
1067
1071
|
return s;
|
|
1068
1072
|
}
|
|
1069
1073
|
function dn(e, t) {
|
|
1070
1074
|
const s = t.match(/^(?:(\d+(?:\.\d+)?)h)?(?:(\d+(?:\.\d+)?)m)?$/);
|
|
1071
1075
|
if (!s || !s[1] && !s[2])
|
|
1072
|
-
throw new
|
|
1076
|
+
throw new R(e, Rs);
|
|
1073
1077
|
let r = 0;
|
|
1074
1078
|
const [, n, i] = s;
|
|
1075
1079
|
if (n) {
|
|
1076
1080
|
const a = Number.parseFloat(n);
|
|
1077
1081
|
if (Number.isNaN(a) || a < 0)
|
|
1078
|
-
throw new
|
|
1082
|
+
throw new R(e, "Hours must be a positive number");
|
|
1079
1083
|
r += a * 60;
|
|
1080
1084
|
}
|
|
1081
1085
|
if (i) {
|
|
1082
1086
|
const a = Number.parseFloat(i);
|
|
1083
1087
|
if (Number.isNaN(a) || a < 0)
|
|
1084
|
-
throw new
|
|
1088
|
+
throw new R(e, "Minutes must be a positive number");
|
|
1085
1089
|
if (!Number.isFinite(a))
|
|
1086
|
-
throw new
|
|
1090
|
+
throw new R(e, ot);
|
|
1087
1091
|
if (a % 1 !== 0)
|
|
1088
|
-
throw new
|
|
1092
|
+
throw new R(
|
|
1089
1093
|
e,
|
|
1090
1094
|
"Minutes must be a whole number (use decimal hours instead)"
|
|
1091
1095
|
);
|
|
1092
1096
|
r += a;
|
|
1093
1097
|
}
|
|
1094
1098
|
if (r = Math.round(r), !Number.isFinite(r))
|
|
1095
|
-
throw new
|
|
1099
|
+
throw new R(e, ot);
|
|
1096
1100
|
if (r === 0)
|
|
1097
|
-
throw new
|
|
1101
|
+
throw new R(e, "Duration must be greater than 0 minutes");
|
|
1098
1102
|
return r;
|
|
1099
1103
|
}
|
|
1100
1104
|
function mt(e, t) {
|
|
1101
1105
|
try {
|
|
1102
1106
|
return nn(t);
|
|
1103
1107
|
} catch (s) {
|
|
1104
|
-
throw s instanceof
|
|
1108
|
+
throw s instanceof R ? new Error(`${e}: ${s.message}`) : s;
|
|
1105
1109
|
}
|
|
1106
1110
|
}
|
|
1107
1111
|
function ln(e, t = "minute") {
|
|
@@ -1118,8 +1122,8 @@ function Ps(e) {
|
|
|
1118
1122
|
function pn(e) {
|
|
1119
1123
|
return { 4: "p1", 3: "p2", 2: "p3", 1: "p4" }[e];
|
|
1120
1124
|
}
|
|
1121
|
-
const
|
|
1122
|
-
class
|
|
1125
|
+
const Ns = 300 * 1e3, hn = 1e4, mn = 1e3;
|
|
1126
|
+
class Ls {
|
|
1123
1127
|
constructor(t, s) {
|
|
1124
1128
|
this.maxEntries = t, this.ttl = s, this.entries = /* @__PURE__ */ new Map();
|
|
1125
1129
|
}
|
|
@@ -1152,13 +1156,13 @@ class Ns {
|
|
|
1152
1156
|
t - r.timestamp >= this.ttl && this.entries.delete(s);
|
|
1153
1157
|
}
|
|
1154
1158
|
}
|
|
1155
|
-
const Me = new
|
|
1159
|
+
const Me = new Ls(
|
|
1156
1160
|
hn,
|
|
1157
|
-
|
|
1158
|
-
), he = new
|
|
1161
|
+
Ns
|
|
1162
|
+
), he = new Ls(
|
|
1159
1163
|
mn,
|
|
1160
|
-
|
|
1161
|
-
),
|
|
1164
|
+
Ns
|
|
1165
|
+
), Ms = "me";
|
|
1162
1166
|
class fn {
|
|
1163
1167
|
/**
|
|
1164
1168
|
* Resolve a user name or ID to a user ID by looking up collaborators across all shared projects.
|
|
@@ -1168,7 +1172,7 @@ class fn {
|
|
|
1168
1172
|
if (!s || s.trim().length === 0)
|
|
1169
1173
|
return null;
|
|
1170
1174
|
const r = s.trim();
|
|
1171
|
-
if (r.toLowerCase() ===
|
|
1175
|
+
if (r.toLowerCase() === Ms)
|
|
1172
1176
|
try {
|
|
1173
1177
|
const d = await t.getUser();
|
|
1174
1178
|
return {
|
|
@@ -1328,7 +1332,7 @@ function ge(e, t, s) {
|
|
|
1328
1332
|
async function bn(e, t) {
|
|
1329
1333
|
return L.resolveUser(e, t);
|
|
1330
1334
|
}
|
|
1331
|
-
async function
|
|
1335
|
+
async function Fs(e, t) {
|
|
1332
1336
|
const s = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), n = [], i = [];
|
|
1333
1337
|
for (const a of t) {
|
|
1334
1338
|
const c = a.trim().toLowerCase();
|
|
@@ -1349,7 +1353,7 @@ async function Ms(e, t) {
|
|
|
1349
1353
|
}
|
|
1350
1354
|
return n;
|
|
1351
1355
|
}
|
|
1352
|
-
const
|
|
1356
|
+
const Hs = ["assigned", "unassignedOrMe", "all"];
|
|
1353
1357
|
async function gt(e, t) {
|
|
1354
1358
|
if (!t)
|
|
1355
1359
|
return;
|
|
@@ -1409,25 +1413,25 @@ async function K(e) {
|
|
|
1409
1413
|
function yt(e) {
|
|
1410
1414
|
return /(?<!\\)(?:\\\\)*\*/.test(e) ? e : `*${e.replaceAll(/\\(?!\*)/g, "\\\\")}*`;
|
|
1411
1415
|
}
|
|
1412
|
-
async function
|
|
1416
|
+
async function Ws(e, t) {
|
|
1413
1417
|
return K({
|
|
1414
1418
|
apiMethod: e.searchProjects.bind(e),
|
|
1415
1419
|
args: { query: yt(t) },
|
|
1416
|
-
limit:
|
|
1420
|
+
limit: E.PROJECTS_MAX
|
|
1417
1421
|
});
|
|
1418
1422
|
}
|
|
1419
|
-
async function
|
|
1423
|
+
async function Bs(e) {
|
|
1420
1424
|
return K({
|
|
1421
1425
|
apiMethod: (t) => $(() => e.getProjects(t)),
|
|
1422
1426
|
args: {},
|
|
1423
|
-
limit:
|
|
1427
|
+
limit: E.PROJECTS_MAX
|
|
1424
1428
|
});
|
|
1425
1429
|
}
|
|
1426
1430
|
async function yn(e) {
|
|
1427
1431
|
return K({
|
|
1428
1432
|
apiMethod: e.getArchivedProjects.bind(e),
|
|
1429
1433
|
args: {},
|
|
1430
|
-
limit:
|
|
1434
|
+
limit: E.PROJECTS_MAX
|
|
1431
1435
|
});
|
|
1432
1436
|
}
|
|
1433
1437
|
function Tn(e) {
|
|
@@ -1443,14 +1447,14 @@ async function wn(e, t) {
|
|
|
1443
1447
|
return K({
|
|
1444
1448
|
apiMethod: e.searchLabels.bind(e),
|
|
1445
1449
|
args: { query: yt(t) },
|
|
1446
|
-
limit:
|
|
1450
|
+
limit: E.LABELS_MAX
|
|
1447
1451
|
});
|
|
1448
1452
|
}
|
|
1449
1453
|
async function kn(e) {
|
|
1450
1454
|
return K({
|
|
1451
1455
|
apiMethod: e.getSharedLabels.bind(e),
|
|
1452
1456
|
args: {},
|
|
1453
|
-
limit:
|
|
1457
|
+
limit: E.LABELS_MAX
|
|
1454
1458
|
});
|
|
1455
1459
|
}
|
|
1456
1460
|
async function vn(e, t, s) {
|
|
@@ -1458,7 +1462,7 @@ async function vn(e, t, s) {
|
|
|
1458
1462
|
return K({
|
|
1459
1463
|
apiMethod: e.searchSections.bind(e),
|
|
1460
1464
|
args: s ? { query: r, projectId: s } : { query: r },
|
|
1461
|
-
limit:
|
|
1465
|
+
limit: E.SECTIONS_MAX
|
|
1462
1466
|
});
|
|
1463
1467
|
}
|
|
1464
1468
|
function H(e) {
|
|
@@ -1502,7 +1506,7 @@ function ce(e) {
|
|
|
1502
1506
|
isArchived: e.isArchived
|
|
1503
1507
|
};
|
|
1504
1508
|
}
|
|
1505
|
-
function
|
|
1509
|
+
function $e(e) {
|
|
1506
1510
|
return {
|
|
1507
1511
|
id: e.id,
|
|
1508
1512
|
taskId: e.taskId ?? void 0,
|
|
@@ -1580,7 +1584,7 @@ function Ht(e) {
|
|
|
1580
1584
|
timezone: e.timezone ?? void 0
|
|
1581
1585
|
};
|
|
1582
1586
|
}
|
|
1583
|
-
function
|
|
1587
|
+
function je(e) {
|
|
1584
1588
|
const t = {
|
|
1585
1589
|
id: e.id,
|
|
1586
1590
|
taskId: e.itemId,
|
|
@@ -1612,7 +1616,7 @@ function Ce(e) {
|
|
|
1612
1616
|
};
|
|
1613
1617
|
}
|
|
1614
1618
|
}
|
|
1615
|
-
function
|
|
1619
|
+
function Ks(e) {
|
|
1616
1620
|
const t = e.filter(
|
|
1617
1621
|
(r) => r.type === "relative" || r.type === "absolute"
|
|
1618
1622
|
).length, s = e.filter((r) => r.type === "location").length;
|
|
@@ -1622,7 +1626,7 @@ const Wt = "[redacted]", Cn = /"[^"]*"/g;
|
|
|
1622
1626
|
function U(e, t, s, r = {}) {
|
|
1623
1627
|
if (s.length === 0)
|
|
1624
1628
|
return;
|
|
1625
|
-
const n = s.slice(0,
|
|
1629
|
+
const n = s.slice(0, Ko.MAX_FAILURES_LOGGED);
|
|
1626
1630
|
console.error(`${e}: items failed`, {
|
|
1627
1631
|
failed: s.length,
|
|
1628
1632
|
of: t,
|
|
@@ -1633,9 +1637,9 @@ function U(e, t, s, r = {}) {
|
|
|
1633
1637
|
}))
|
|
1634
1638
|
});
|
|
1635
1639
|
}
|
|
1636
|
-
const
|
|
1640
|
+
const qs = "none";
|
|
1637
1641
|
function jn(e) {
|
|
1638
|
-
return e.length === 1 && e[0]?.trim().toLowerCase() ===
|
|
1642
|
+
return e.length === 1 && e[0]?.trim().toLowerCase() === qs;
|
|
1639
1643
|
}
|
|
1640
1644
|
async function $n(e, t, s, r = (n) => e.getTask(n)) {
|
|
1641
1645
|
const n = await An(e, t);
|
|
@@ -1669,12 +1673,12 @@ function Bt(e, t) {
|
|
|
1669
1673
|
return [...s];
|
|
1670
1674
|
}
|
|
1671
1675
|
const Ue = ze.map((e) => e.key);
|
|
1672
|
-
function
|
|
1676
|
+
function En(e) {
|
|
1673
1677
|
if (typeof e != "string") return;
|
|
1674
1678
|
const t = e.toLowerCase();
|
|
1675
1679
|
return (ze.find((r) => r.key === t) ?? ze.find((r) => r.displayName.toLowerCase() === t))?.key;
|
|
1676
1680
|
}
|
|
1677
|
-
const
|
|
1681
|
+
const Dn = `Color for the entity. Accepts a color key (e.g. "berry_red") or display name (e.g. "Berry Red"). Valid colors: ${Ue.join(", ")}. Unrecognized colors are omitted and charcoal will be used as the default.`, Te = o.preprocess(En, o.enum(Ue).optional()).describe(Dn);
|
|
1678
1682
|
o.enum(Ue);
|
|
1679
1683
|
const we = o.enum(Ue).optional().catch(void 0), V = o.object({
|
|
1680
1684
|
id: o.string(),
|
|
@@ -1732,7 +1736,7 @@ const xn = o.object({
|
|
|
1732
1736
|
image: o.string().optional().describe("For image resource types."),
|
|
1733
1737
|
imageWidth: o.number().optional().describe("Pixels."),
|
|
1734
1738
|
imageHeight: o.number().optional().describe("Pixels.")
|
|
1735
|
-
}),
|
|
1739
|
+
}), Ae = o.object({
|
|
1736
1740
|
id: o.string(),
|
|
1737
1741
|
taskId: o.string().optional(),
|
|
1738
1742
|
projectId: o.string().optional(),
|
|
@@ -1770,7 +1774,7 @@ const xn = o.object({
|
|
|
1770
1774
|
}), wt = o.object({
|
|
1771
1775
|
id: o.string(),
|
|
1772
1776
|
taskId: o.string(),
|
|
1773
|
-
type: o.enum(
|
|
1777
|
+
type: o.enum(Ro),
|
|
1774
1778
|
notifyUid: o.string().optional().describe("User ID the reminder notifies."),
|
|
1775
1779
|
minuteOffset: o.number().optional().describe("Minutes before due. Relative reminders only."),
|
|
1776
1780
|
due: _n.optional().describe("Absolute, and sometimes relative, reminders."),
|
|
@@ -1810,30 +1814,30 @@ function vt(e) {
|
|
|
1810
1814
|
${n.map((l) => ` ${l}`).join(`
|
|
1811
1815
|
`)}.`), a?.length) {
|
|
1812
1816
|
const l = a.length, u = `Failed (${l}):
|
|
1813
|
-
${a.slice(0,
|
|
1817
|
+
${a.slice(0, Ce.MAX_FAILURES_SHOWN).map((p) => ` ${p.item} (Error: ${p.error}${p.code ? ` [${p.code}]` : ""})`).join(
|
|
1814
1818
|
`
|
|
1815
1819
|
`
|
|
1816
|
-
)}${l >
|
|
1820
|
+
)}${l > Ce.MAX_FAILURES_SHOWN ? `, +${l - Ce.MAX_FAILURES_SHOWN} more` : ""}.`;
|
|
1817
1821
|
c.push(u);
|
|
1818
1822
|
}
|
|
1819
1823
|
return c.join(`
|
|
1820
1824
|
`);
|
|
1821
1825
|
}
|
|
1822
|
-
function
|
|
1826
|
+
function P(e, t) {
|
|
1823
1827
|
if (t.length === 0)
|
|
1824
1828
|
return e;
|
|
1825
|
-
const s = t.slice(0,
|
|
1829
|
+
const s = t.slice(0, Ce.MAX_FAILURES_SHOWN), r = t.length - s.length, n = s.map((a) => ` ${a.item}: ${a.error}`).join(`
|
|
1826
1830
|
`), i = r > 0 ? `
|
|
1827
1831
|
+${r} more` : "";
|
|
1828
1832
|
return `${e}
|
|
1829
1833
|
Failed (${t.length}) - address or drop these items:
|
|
1830
1834
|
${n}${i}`;
|
|
1831
1835
|
}
|
|
1832
|
-
function
|
|
1836
|
+
function Rn(e, t) {
|
|
1833
1837
|
const s = e.content || e.title || "Untitled", r = e.dueDate ? ` • due ${e.dueDate}` : "", n = e.priority ? ` • ${e.priority.toUpperCase()}` : "", i = e.projectName ? ` • ${e.projectName}` : "", a = t && e.responsibleUid ? ` • +${t.get(e.responsibleUid) ?? e.responsibleUid}` : "", c = e.id ? ` • id=${e.id}` : "";
|
|
1834
1838
|
return ` ${s}${r}${n}${i}${a}${c}`;
|
|
1835
1839
|
}
|
|
1836
|
-
function
|
|
1840
|
+
function Pn(e) {
|
|
1837
1841
|
const t = ` (${e.color})`, s = e.isFavorite ? " • ⭐" : "", r = ` • id=${e.id}`;
|
|
1838
1842
|
return ` ${e.name}${t}${s}${r}`;
|
|
1839
1843
|
}
|
|
@@ -1842,7 +1846,7 @@ function Nn(e) {
|
|
|
1842
1846
|
return ` ${e.name}${t}${s}${r}${n}${i}${a}`;
|
|
1843
1847
|
}
|
|
1844
1848
|
function _e(e, t = 5, s) {
|
|
1845
|
-
const n = e.slice(0, t).map((i) =>
|
|
1849
|
+
const n = e.slice(0, t).map((i) => Rn(i, s)).join(`
|
|
1846
1850
|
`);
|
|
1847
1851
|
if (e.length > t) {
|
|
1848
1852
|
const i = e.length - t;
|
|
@@ -1863,10 +1867,10 @@ function ee({
|
|
|
1863
1867
|
}) {
|
|
1864
1868
|
const d = [], l = `${e}: ${t}${typeof s == "number" ? ` (limit ${s})` : ""}${r ? ", more available" : ""}.`;
|
|
1865
1869
|
return d.push(l), n?.length && d.push(`Filter: ${n.join("; ")}.`), i?.length && d.push(`Preview:
|
|
1866
|
-
${i}`), !t && a?.length && d.push(`No results. ${a.join("; ")}.`), (c?.length || r) && d.push(
|
|
1870
|
+
${i}`), !t && a?.length && d.push(`No results. ${a.join("; ")}.`), (c?.length || r) && d.push(Gs(c || [], r)), d.join(`
|
|
1867
1871
|
`);
|
|
1868
1872
|
}
|
|
1869
|
-
function
|
|
1873
|
+
function Gs(e, t) {
|
|
1870
1874
|
const s = [...e];
|
|
1871
1875
|
return t && s.push(`Pass cursor '${t}' to fetch more results.`), `${s.length === 1 ? "Possible suggested next step:" : "Possible suggested next steps:"}
|
|
1872
1876
|
${s.map((n) => `- ${n}`).join(`
|
|
@@ -1878,13 +1882,13 @@ const Ln = o.object({
|
|
|
1878
1882
|
'The ID of the project to comment on. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
1879
1883
|
),
|
|
1880
1884
|
content: o.string().min(1).describe("The content of the comment."),
|
|
1881
|
-
notifyUsers: o.array(o.string().min(1)).min(1).max(
|
|
1882
|
-
`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 ["${
|
|
1885
|
+
notifyUsers: o.array(o.string().min(1)).min(1).max(E.NOTIFY_USERS_MAX).optional().describe(
|
|
1886
|
+
`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 ["${qs}"] to notify nobody.`
|
|
1883
1887
|
)
|
|
1884
1888
|
}), Mn = {
|
|
1885
1889
|
comments: o.array(Ln).min(1).describe("The array of comments to add.")
|
|
1886
1890
|
}, Fn = {
|
|
1887
|
-
comments: o.array(
|
|
1891
|
+
comments: o.array(Ae).describe("The created comments."),
|
|
1888
1892
|
totalCount: o.number().describe("The total number of comments created."),
|
|
1889
1893
|
addedCommentIds: o.array(o.string()).describe("The IDs of the added comments."),
|
|
1890
1894
|
failures: o.array(_).describe(
|
|
@@ -1916,7 +1920,7 @@ const Ln = o.object({
|
|
|
1916
1920
|
const c = /* @__PURE__ */ new Map();
|
|
1917
1921
|
async function d({ notifyUsers: m }, g) {
|
|
1918
1922
|
if (m)
|
|
1919
|
-
return jn(m) ? [] : (await $(() =>
|
|
1923
|
+
return jn(m) ? [] : (await $(() => Fs(t, m))).map((j) => j.userId);
|
|
1920
1924
|
const { id: w } = await n(), I = g.taskId ? `task:${g.taskId}` : `project:${g.projectId}`;
|
|
1921
1925
|
let k = c.get(I);
|
|
1922
1926
|
return k || (k = $n(t, g, w, a), c.set(I, k)), await k;
|
|
@@ -1943,9 +1947,9 @@ const Ln = o.object({
|
|
|
1943
1947
|
})
|
|
1944
1948
|
), p = [], h = [];
|
|
1945
1949
|
u.forEach((m, g) => {
|
|
1946
|
-
m.status === "fulfilled" ? p.push(
|
|
1950
|
+
m.status === "fulfilled" ? p.push($e(m.value)) : h.push({
|
|
1947
1951
|
item: s[g]?.content ?? `Comment ${g + 1}`,
|
|
1948
|
-
error:
|
|
1952
|
+
error: D(m.reason)
|
|
1949
1953
|
});
|
|
1950
1954
|
}), U(T.ADD_COMMENTS, s.length, h, { redactItems: !0 });
|
|
1951
1955
|
const f = await Bn(t, p, {
|
|
@@ -1953,7 +1957,7 @@ const Ln = o.object({
|
|
|
1953
1957
|
getCurrentUser: n
|
|
1954
1958
|
});
|
|
1955
1959
|
return {
|
|
1956
|
-
textContent:
|
|
1960
|
+
textContent: P(
|
|
1957
1961
|
Kn({ comments: p, notifiedNames: f }),
|
|
1958
1962
|
h
|
|
1959
1963
|
),
|
|
@@ -2017,7 +2021,7 @@ function N(e) {
|
|
|
2017
2021
|
return o.string().transform((t) => t === "" ? void 0 : t).optional().describe(e);
|
|
2018
2022
|
}
|
|
2019
2023
|
const qn = { status: "fulfilled", value: void 0 };
|
|
2020
|
-
async function
|
|
2024
|
+
async function ve(e, t) {
|
|
2021
2025
|
let s, r;
|
|
2022
2026
|
try {
|
|
2023
2027
|
const i = await $(() => e.sync({ commands: t }));
|
|
@@ -2037,11 +2041,11 @@ async function Ae(e, t) {
|
|
|
2037
2041
|
reason: new Error("Todoist did not report whether this change was applied")
|
|
2038
2042
|
} : {
|
|
2039
2043
|
status: "rejected",
|
|
2040
|
-
reason: new
|
|
2044
|
+
reason: new No(a.error, a.httpCode, a)
|
|
2041
2045
|
};
|
|
2042
2046
|
}), tempIdMapping: r };
|
|
2043
2047
|
}
|
|
2044
|
-
function
|
|
2048
|
+
function zs(e) {
|
|
2045
2049
|
return e.description || void 0;
|
|
2046
2050
|
}
|
|
2047
2051
|
const Gn = {
|
|
@@ -2078,7 +2082,7 @@ const Gn = {
|
|
|
2078
2082
|
id: a.id,
|
|
2079
2083
|
name: a.name,
|
|
2080
2084
|
query: a.query,
|
|
2081
|
-
description:
|
|
2085
|
+
description: zs(a),
|
|
2082
2086
|
color: we.parse(a.color),
|
|
2083
2087
|
isFavorite: a.isFavorite,
|
|
2084
2088
|
itemOrder: a.itemOrder
|
|
@@ -2147,13 +2151,13 @@ const Jn = o.object({
|
|
|
2147
2151
|
...h.isFavorite !== void 0 ? { isFavorite: h.isFavorite } : {}
|
|
2148
2152
|
},
|
|
2149
2153
|
r[f]
|
|
2150
|
-
)), { outcomes: i, tempIdMapping: a } = await
|
|
2154
|
+
)), { outcomes: i, tempIdMapping: a } = await ve(t, n), c = [], d = [];
|
|
2151
2155
|
e.forEach((h, f) => {
|
|
2152
2156
|
const b = i[f], m = r[f], g = m !== void 0 ? a[m] : void 0;
|
|
2153
2157
|
if (b?.status !== "fulfilled" || !g) {
|
|
2154
2158
|
d.push({
|
|
2155
2159
|
item: h.name,
|
|
2156
|
-
error: b?.status === "rejected" ?
|
|
2160
|
+
error: b?.status === "rejected" ? D(b.reason) : "Todoist did not return an ID for the created filter"
|
|
2157
2161
|
});
|
|
2158
2162
|
return;
|
|
2159
2163
|
}
|
|
@@ -2174,7 +2178,7 @@ const Jn = o.object({
|
|
|
2174
2178
|
`), p = l > 0 ? `Added ${l} filter${l === 1 ? "" : "s"}:
|
|
2175
2179
|
${u}` : "Added 0 filters";
|
|
2176
2180
|
return {
|
|
2177
|
-
textContent:
|
|
2181
|
+
textContent: P(p, d),
|
|
2178
2182
|
structuredContent: {
|
|
2179
2183
|
filters: c,
|
|
2180
2184
|
totalCount: c.length,
|
|
@@ -2212,7 +2216,7 @@ ${u}` : "Added 0 filters";
|
|
|
2212
2216
|
return s.forEach((a, c) => {
|
|
2213
2217
|
a.status === "fulfilled" ? r.push(a.value) : n.push({
|
|
2214
2218
|
item: e[c]?.name ?? `Label ${c + 1}`,
|
|
2215
|
-
error:
|
|
2219
|
+
error: D(a.reason)
|
|
2216
2220
|
});
|
|
2217
2221
|
}), U(T.ADD_LABELS, e.length, n, { redactItems: !0 }), {
|
|
2218
2222
|
textContent: ri({ labels: r, failures: n }),
|
|
@@ -2234,7 +2238,7 @@ function ri({
|
|
|
2234
2238
|
const s = e.length, r = e.map((i) => `• ${i.name} (id=${i.id})`).join(`
|
|
2235
2239
|
`), n = s > 0 ? `Added ${s} label${s === 1 ? "" : "s"}:
|
|
2236
2240
|
${r}` : "Added 0 labels";
|
|
2237
|
-
return
|
|
2241
|
+
return P(n, t);
|
|
2238
2242
|
}
|
|
2239
2243
|
async function St(e, t) {
|
|
2240
2244
|
try {
|
|
@@ -2320,7 +2324,7 @@ ${u}` + (d.length > 5 ? `
|
|
|
2320
2324
|
this.stateByClient = /* @__PURE__ */ new WeakMap();
|
|
2321
2325
|
}
|
|
2322
2326
|
}
|
|
2323
|
-
const
|
|
2327
|
+
const Ys = new ai(), ci = o.object({
|
|
2324
2328
|
name: o.string().min(1).describe("The name of the project."),
|
|
2325
2329
|
parentId: o.string().optional().describe("The ID of the parent project. If provided, creates this as a sub-project."),
|
|
2326
2330
|
isFavorite: o.boolean().optional().describe("Whether the project is a favorite. Defaults to false."),
|
|
@@ -2353,7 +2357,7 @@ const zs = new ai(), ci = o.object({
|
|
|
2353
2357
|
return Promise.resolve(void 0);
|
|
2354
2358
|
let p = s.get(u);
|
|
2355
2359
|
return p || (p = $(
|
|
2356
|
-
() =>
|
|
2360
|
+
() => Ys.resolveWorkspace(t, u)
|
|
2357
2361
|
).then(({ workspaceId: h }) => h), s.set(u, p)), p;
|
|
2358
2362
|
}, i = await Promise.allSettled(
|
|
2359
2363
|
e.map(async ({ workspace: u, ...p }) => {
|
|
@@ -2366,7 +2370,7 @@ const zs = new ai(), ci = o.object({
|
|
|
2366
2370
|
i.forEach((u, p) => {
|
|
2367
2371
|
u.status === "fulfilled" ? a.push(u.value) : c.push({
|
|
2368
2372
|
item: e[p]?.name ?? `Project ${p + 1}`,
|
|
2369
|
-
error:
|
|
2373
|
+
error: D(u.reason)
|
|
2370
2374
|
});
|
|
2371
2375
|
});
|
|
2372
2376
|
const d = a.map(ce);
|
|
@@ -2406,7 +2410,7 @@ function pi(e) {
|
|
|
2406
2410
|
};
|
|
2407
2411
|
}
|
|
2408
2412
|
function hi(e) {
|
|
2409
|
-
const t =
|
|
2413
|
+
const t = Us(e);
|
|
2410
2414
|
return t === void 0 || t >= 500 && t !== 503;
|
|
2411
2415
|
}
|
|
2412
2416
|
function mi({
|
|
@@ -2416,9 +2420,9 @@ function mi({
|
|
|
2416
2420
|
const s = e.length, r = e.map((i) => `• ${i.name} (id=${i.id})`).join(`
|
|
2417
2421
|
`), n = s > 0 ? `Added ${s} project${s === 1 ? "" : "s"}:
|
|
2418
2422
|
${r}` : "Added 0 projects";
|
|
2419
|
-
return
|
|
2423
|
+
return P(n, t);
|
|
2420
2424
|
}
|
|
2421
|
-
async function
|
|
2425
|
+
async function Vs(e, t) {
|
|
2422
2426
|
const s = /* @__PURE__ */ new Map();
|
|
2423
2427
|
for (const i of t) {
|
|
2424
2428
|
const a = i?.trim();
|
|
@@ -2427,7 +2431,7 @@ async function Ys(e, t) {
|
|
|
2427
2431
|
const r = /* @__PURE__ */ new Map();
|
|
2428
2432
|
for (const [i, a] of s)
|
|
2429
2433
|
try {
|
|
2430
|
-
const [c] = await $(() =>
|
|
2434
|
+
const [c] = await $(() => Fs(e, [a]));
|
|
2431
2435
|
r.set(i, { status: "fulfilled", value: c?.userId });
|
|
2432
2436
|
} catch (c) {
|
|
2433
2437
|
r.set(i, { status: "rejected", reason: c });
|
|
@@ -2440,7 +2444,7 @@ async function Ys(e, t) {
|
|
|
2440
2444
|
function Fe(e) {
|
|
2441
2445
|
return e.trim().toLowerCase();
|
|
2442
2446
|
}
|
|
2443
|
-
function
|
|
2447
|
+
function Js(e, t) {
|
|
2444
2448
|
return e.flatMap((s, r) => {
|
|
2445
2449
|
const n = t[r];
|
|
2446
2450
|
return !n || s.notifyUid === n ? [] : [
|
|
@@ -2448,34 +2452,34 @@ function Vs(e, t) {
|
|
|
2448
2452
|
];
|
|
2449
2453
|
});
|
|
2450
2454
|
}
|
|
2451
|
-
const xe = 25,
|
|
2455
|
+
const xe = 25, Re = o.enum(Lo), Xs = o.object({
|
|
2452
2456
|
date: o.string().optional().describe("Due date in YYYY-MM-DD format."),
|
|
2453
2457
|
string: o.string().optional().describe('Natural language due string, e.g. "tomorrow at 3pm".'),
|
|
2454
2458
|
timezone: o.string().optional().describe('Timezone for the reminder, e.g. "America/New_York".'),
|
|
2455
2459
|
lang: o.string().optional().describe('Language for parsing the due string, e.g. "en".')
|
|
2456
|
-
}),
|
|
2457
|
-
`${
|
|
2460
|
+
}), Zs = o.enum(fs), Pe = o.boolean().optional().describe("Whether this is an urgent reminder. Applies to relative and absolute reminders."), Qs = `Who to remind: user ID, email, name, or "me". Must collaborate on the task's project.`, jt = N(
|
|
2461
|
+
`${Qs} Defaults to the creator.`
|
|
2458
2462
|
), $t = N(
|
|
2459
|
-
`${
|
|
2463
|
+
`${Qs} Omit to keep the current one.`
|
|
2460
2464
|
), fi = o.object({
|
|
2461
2465
|
type: o.literal("relative"),
|
|
2462
2466
|
taskId: o.string().min(1).describe("The ID of the task to set a reminder for."),
|
|
2463
2467
|
minuteOffset: o.number().int().min(0).describe(
|
|
2464
2468
|
"Minutes before the task due time to trigger the reminder. E.g., 30 for 30 minutes before, 60 for 1 hour before, 1440 for 1 day before."
|
|
2465
2469
|
),
|
|
2466
|
-
service:
|
|
2470
|
+
service: Re.optional().describe(
|
|
2467
2471
|
'Delivery method: "email" or "push" notification. Defaults to push.'
|
|
2468
2472
|
),
|
|
2469
|
-
isUrgent:
|
|
2473
|
+
isUrgent: Pe,
|
|
2470
2474
|
notifyUser: jt
|
|
2471
2475
|
}), bi = o.object({
|
|
2472
2476
|
type: o.literal("absolute"),
|
|
2473
2477
|
taskId: o.string().min(1).describe("The ID of the task to set a reminder for."),
|
|
2474
|
-
due:
|
|
2475
|
-
service:
|
|
2478
|
+
due: Xs.describe("The specific date/time for the reminder."),
|
|
2479
|
+
service: Re.optional().describe(
|
|
2476
2480
|
'Delivery method: "email" or "push" notification. Defaults to push.'
|
|
2477
2481
|
),
|
|
2478
|
-
isUrgent:
|
|
2482
|
+
isUrgent: Pe,
|
|
2479
2483
|
notifyUser: jt
|
|
2480
2484
|
}), gi = o.object({
|
|
2481
2485
|
type: o.literal("location"),
|
|
@@ -2483,7 +2487,7 @@ const xe = 25, Pe = o.enum(No), Js = o.object({
|
|
|
2483
2487
|
name: o.string().min(1).describe('Name of the location, e.g. "Office", "Home".'),
|
|
2484
2488
|
locLat: o.string().describe('Latitude of the location as a string, e.g. "37.7749".'),
|
|
2485
2489
|
locLong: o.string().describe('Longitude of the location as a string, e.g. "-122.4194".'),
|
|
2486
|
-
locTrigger:
|
|
2490
|
+
locTrigger: Zs.describe(
|
|
2487
2491
|
'When to trigger: "on_enter" (arriving) or "on_leave" (departing).'
|
|
2488
2492
|
),
|
|
2489
2493
|
radius: o.number().int().optional().describe("Radius in meters for the geofence. Defaults to server default."),
|
|
@@ -2516,7 +2520,7 @@ const xe = 25, Pe = o.enum(No), Js = o.object({
|
|
|
2516
2520
|
openWorldHint: !0
|
|
2517
2521
|
},
|
|
2518
2522
|
async execute(e, t) {
|
|
2519
|
-
const { reminders: s } = e, r = await
|
|
2523
|
+
const { reminders: s } = e, r = await Vs(
|
|
2520
2524
|
t,
|
|
2521
2525
|
s.map((l) => l.notifyUser)
|
|
2522
2526
|
), n = await Promise.allSettled(
|
|
@@ -2565,19 +2569,19 @@ const xe = 25, Pe = o.enum(No), Js = o.object({
|
|
|
2565
2569
|
), i = [], a = [], c = [];
|
|
2566
2570
|
return n.forEach((l, u) => {
|
|
2567
2571
|
if (l.status === "fulfilled") {
|
|
2568
|
-
i.push(
|
|
2572
|
+
i.push(je(l.value));
|
|
2569
2573
|
const p = r[u];
|
|
2570
2574
|
a.push(p?.status === "fulfilled" ? p.value : void 0);
|
|
2571
2575
|
} else
|
|
2572
2576
|
c.push({
|
|
2573
2577
|
item: `Reminder ${u + 1} on task ${s[u]?.taskId}`,
|
|
2574
|
-
error:
|
|
2578
|
+
error: D(l.reason)
|
|
2575
2579
|
});
|
|
2576
2580
|
}), U(T.ADD_REMINDERS, s.length, c), {
|
|
2577
|
-
textContent:
|
|
2581
|
+
textContent: P(
|
|
2578
2582
|
[
|
|
2579
2583
|
vi(i),
|
|
2580
|
-
...
|
|
2584
|
+
...Js(i, a)
|
|
2581
2585
|
].join(`
|
|
2582
2586
|
`),
|
|
2583
2587
|
c
|
|
@@ -2595,7 +2599,7 @@ const xe = 25, Pe = o.enum(No), Js = o.object({
|
|
|
2595
2599
|
}
|
|
2596
2600
|
};
|
|
2597
2601
|
function vi(e) {
|
|
2598
|
-
const { timeBasedCount: t, locationCount: s } =
|
|
2602
|
+
const { timeBasedCount: t, locationCount: s } = Ks(e), r = [];
|
|
2599
2603
|
if (t > 0) {
|
|
2600
2604
|
const n = t > 1 ? "reminders" : "reminder";
|
|
2601
2605
|
r.push(`${t} time-based ${n}`);
|
|
@@ -2641,7 +2645,7 @@ const Ii = o.object({
|
|
|
2641
2645
|
return r.forEach((c, d) => {
|
|
2642
2646
|
c.status === "fulfilled" ? n.push(c.value) : i.push({
|
|
2643
2647
|
item: e[d]?.name ?? `Section ${d + 1}`,
|
|
2644
|
-
error:
|
|
2648
|
+
error: D(c.reason)
|
|
2645
2649
|
});
|
|
2646
2650
|
}), U(T.ADD_SECTIONS, e.length, i, { redactItems: !0 }), {
|
|
2647
2651
|
textContent: $i({ sections: n, failures: i }),
|
|
@@ -2663,7 +2667,7 @@ function $i({
|
|
|
2663
2667
|
const s = e.length, r = e.map((i) => `• ${i.name} (id=${i.id}, projectId=${i.projectId})`).join(`
|
|
2664
2668
|
`), n = s > 0 ? `Added ${s} section${s === 1 ? "" : "s"}:
|
|
2665
2669
|
${r}` : "Added 0 sections";
|
|
2666
|
-
return
|
|
2670
|
+
return P(n, t);
|
|
2667
2671
|
}
|
|
2668
2672
|
const me = {
|
|
2669
2673
|
USER_NOT_FOUND: "USER_NOT_FOUND",
|
|
@@ -2883,7 +2887,7 @@ class Ai {
|
|
|
2883
2887
|
};
|
|
2884
2888
|
}
|
|
2885
2889
|
}
|
|
2886
|
-
const At = new Ai(), Kt = vs.TASKS_PER_OPERATION,
|
|
2890
|
+
const At = new Ai(), Kt = vs.TASKS_PER_OPERATION, Ei = o.object({
|
|
2887
2891
|
content: o.string().min(1).describe(
|
|
2888
2892
|
'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.'
|
|
2889
2893
|
),
|
|
@@ -2897,7 +2901,7 @@ const At = new Ai(), Kt = vs.TASKS_PER_OPERATION, Di = o.object({
|
|
|
2897
2901
|
deadlineDate: N(
|
|
2898
2902
|
'The deadline date for the task in ISO 8601 format (YYYY-MM-DD, e.g., "2025-12-31"). Deadlines are immovable constraints shown with a different indicator than due dates.'
|
|
2899
2903
|
),
|
|
2900
|
-
duration: N(
|
|
2904
|
+
duration: N(_s),
|
|
2901
2905
|
labels: o.array(o.string()).optional().describe("The labels to attach to the task."),
|
|
2902
2906
|
projectId: N(
|
|
2903
2907
|
'The project ID to add this task to. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
@@ -2912,8 +2916,8 @@ const At = new Ai(), Kt = vs.TASKS_PER_OPERATION, Di = o.object({
|
|
|
2912
2916
|
"Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
|
|
2913
2917
|
)
|
|
2914
2918
|
}), qt = {
|
|
2915
|
-
tasks: o.array(
|
|
2916
|
-
},
|
|
2919
|
+
tasks: o.array(Ei).min(1).max(Kt).describe(`The array of tasks to add (max ${Kt}).`)
|
|
2920
|
+
}, Di = {
|
|
2917
2921
|
tasks: o.array(V).describe("The created tasks."),
|
|
2918
2922
|
totalCount: o.number().describe("The total number of tasks created."),
|
|
2919
2923
|
failures: o.array(_).describe("Tasks that could not be created, with the reason for each."),
|
|
@@ -2924,7 +2928,7 @@ const At = new Ai(), Kt = vs.TASKS_PER_OPERATION, Di = o.object({
|
|
|
2924
2928
|
name: T.ADD_TASKS,
|
|
2925
2929
|
description: "Add one or more tasks to a project, section, or parent. Supports assignment to project collaborators.",
|
|
2926
2930
|
parameters: qt,
|
|
2927
|
-
outputSchema:
|
|
2931
|
+
outputSchema: Di,
|
|
2928
2932
|
// Open world: assigning a task notifies the new assignee.
|
|
2929
2933
|
annotations: {
|
|
2930
2934
|
readOnlyHint: !1,
|
|
@@ -2960,7 +2964,7 @@ const At = new Ai(), Kt = vs.TASKS_PER_OPERATION, Di = o.object({
|
|
|
2960
2964
|
// Keep API error signals (status/code/tag) — `error.message`
|
|
2961
2965
|
// alone collapses e.g. a full-project rejection into a bare
|
|
2962
2966
|
// "HTTP 403: Forbidden"
|
|
2963
|
-
error:
|
|
2967
|
+
error: D(h.reason)
|
|
2964
2968
|
});
|
|
2965
2969
|
const l = c.map(H);
|
|
2966
2970
|
return U(T.ADD_TASKS, s.length, d, { redactItems: !0 }), {
|
|
@@ -3054,7 +3058,7 @@ async function Ui(e, t, s) {
|
|
|
3054
3058
|
try {
|
|
3055
3059
|
return await X(() => t.addTask(b));
|
|
3056
3060
|
} catch (m) {
|
|
3057
|
-
const g =
|
|
3061
|
+
const g = cr(m, {
|
|
3058
3062
|
taskContent: e.content,
|
|
3059
3063
|
dueString: e.dueString,
|
|
3060
3064
|
deadlineDate: e.deadlineDate
|
|
@@ -3087,11 +3091,11 @@ function _i({
|
|
|
3087
3091
|
showDetails: !0
|
|
3088
3092
|
});
|
|
3089
3093
|
}
|
|
3090
|
-
const
|
|
3094
|
+
const Ri = {
|
|
3091
3095
|
projectId: o.string().min(1).describe(
|
|
3092
3096
|
"The ID of the project to analyze. This triggers a new health analysis which may take some time to complete."
|
|
3093
3097
|
)
|
|
3094
|
-
},
|
|
3098
|
+
}, Pi = {
|
|
3095
3099
|
projectId: o.string().describe("The project ID."),
|
|
3096
3100
|
health: o.object({
|
|
3097
3101
|
status: o.enum(ct).describe("The health status after triggering analysis."),
|
|
@@ -3102,8 +3106,8 @@ const Pi = {
|
|
|
3102
3106
|
}, Ni = {
|
|
3103
3107
|
name: T.ANALYZE_PROJECT_HEALTH,
|
|
3104
3108
|
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.",
|
|
3105
|
-
parameters:
|
|
3106
|
-
outputSchema:
|
|
3109
|
+
parameters: Ri,
|
|
3110
|
+
outputSchema: Pi,
|
|
3107
3111
|
annotations: {
|
|
3108
3112
|
readOnlyHint: !1,
|
|
3109
3113
|
destructiveHint: !1,
|
|
@@ -3148,7 +3152,7 @@ ${n}`,
|
|
|
3148
3152
|
} catch (a) {
|
|
3149
3153
|
r.push({
|
|
3150
3154
|
item: i,
|
|
3151
|
-
error:
|
|
3155
|
+
error: D(a)
|
|
3152
3156
|
});
|
|
3153
3157
|
}
|
|
3154
3158
|
return U(T.COMPLETE_TASKS, e.ids.length, r), {
|
|
@@ -3180,7 +3184,7 @@ function Hi({
|
|
|
3180
3184
|
failures: t
|
|
3181
3185
|
});
|
|
3182
3186
|
}
|
|
3183
|
-
const
|
|
3187
|
+
const eo = [
|
|
3184
3188
|
"project",
|
|
3185
3189
|
"section",
|
|
3186
3190
|
"task",
|
|
@@ -3190,11 +3194,11 @@ const Qs = [
|
|
|
3190
3194
|
"reminder",
|
|
3191
3195
|
"location_reminder"
|
|
3192
3196
|
], Wi = {
|
|
3193
|
-
type: o.enum(
|
|
3197
|
+
type: o.enum(eo).describe("The type of entity to delete."),
|
|
3194
3198
|
id: o.string().min(1).describe("The ID of the entity to delete.")
|
|
3195
3199
|
}, Bi = {
|
|
3196
3200
|
deletedEntity: o.object({
|
|
3197
|
-
type: o.enum(
|
|
3201
|
+
type: o.enum(eo).describe("The type of deleted entity."),
|
|
3198
3202
|
id: o.string().describe("The ID of the deleted entity.")
|
|
3199
3203
|
}).describe("Information about the deleted entity."),
|
|
3200
3204
|
success: o.boolean().describe("Whether the deletion was successful.")
|
|
@@ -3245,16 +3249,16 @@ const Qs = [
|
|
|
3245
3249
|
}
|
|
3246
3250
|
};
|
|
3247
3251
|
}
|
|
3248
|
-
}, Gt = 5,
|
|
3252
|
+
}, Gt = 5, to = ["file", "url"], qi = {
|
|
3249
3253
|
projectId: o.string().min(1).describe("The ID of the project to export as a template."),
|
|
3250
|
-
format: o.enum(
|
|
3254
|
+
format: o.enum(to).default("file").describe(
|
|
3251
3255
|
'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.'
|
|
3252
3256
|
),
|
|
3253
3257
|
useRelativeDates: o.boolean().optional().describe(
|
|
3254
3258
|
'Export due dates relative to the import date (e.g. "day 3") instead of absolute dates. Defaults to false.'
|
|
3255
3259
|
)
|
|
3256
3260
|
}, Gi = {
|
|
3257
|
-
format: o.enum(
|
|
3261
|
+
format: o.enum(to).describe("The format the template was exported in."),
|
|
3258
3262
|
content: o.string().optional().describe('The template as CSV content. Only present when format is "file".'),
|
|
3259
3263
|
lineCount: o.number().optional().describe('Number of rows in the exported CSV. Only present when format is "file".'),
|
|
3260
3264
|
fileName: o.string().optional().describe('The generated template file name. Only present when format is "url".'),
|
|
@@ -3326,7 +3330,7 @@ const Vi = V.pick({
|
|
|
3326
3330
|
"Direct children only: subtasks for a task, sub-projects for a project. Completed subtasks and archived sub-projects are excluded."
|
|
3327
3331
|
),
|
|
3328
3332
|
hasMoreChildren: o.boolean().optional().describe(
|
|
3329
|
-
`Present when the object has more than ${
|
|
3333
|
+
`Present when the object has more than ${E.CHILDREN_MAX} direct children and the list was truncated. Page through the rest with find-tasks by parentId for subtasks, or find-projects for sub-projects.`
|
|
3330
3334
|
),
|
|
3331
3335
|
childrenError: o.string().optional().describe(
|
|
3332
3336
|
'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".'
|
|
@@ -3335,7 +3339,7 @@ const Vi = V.pick({
|
|
|
3335
3339
|
async function Zi(e, t) {
|
|
3336
3340
|
const { results: s, nextCursor: r } = await e.getTasks({
|
|
3337
3341
|
parentId: t,
|
|
3338
|
-
limit:
|
|
3342
|
+
limit: E.CHILDREN_MAX
|
|
3339
3343
|
}), n = await Promise.allSettled(
|
|
3340
3344
|
s.map(({ id: a }) => e.getTasks({ parentId: a, limit: 1 }))
|
|
3341
3345
|
), i = n.filter((a) => a.status === "rejected").length;
|
|
@@ -3358,13 +3362,13 @@ async function Zi(e, t) {
|
|
|
3358
3362
|
async function Qi(e, t) {
|
|
3359
3363
|
if (!z(t))
|
|
3360
3364
|
return { childCount: 0, children: [] };
|
|
3361
|
-
const s = await
|
|
3365
|
+
const s = await Bs(e), r = /* @__PURE__ */ new Map();
|
|
3362
3366
|
for (const a of s) {
|
|
3363
3367
|
if (!z(a) || !a.parentId) continue;
|
|
3364
3368
|
const c = r.get(a.parentId) ?? [];
|
|
3365
3369
|
c.push(a), r.set(a.parentId, c);
|
|
3366
3370
|
}
|
|
3367
|
-
const n = [...r.get(t.id) ?? []].sort((a, c) => a.childOrder - c.childOrder), i = n.slice(0,
|
|
3371
|
+
const n = [...r.get(t.id) ?? []].sort((a, c) => a.childOrder - c.childOrder), i = n.slice(0, E.CHILDREN_MAX);
|
|
3368
3372
|
return {
|
|
3369
3373
|
childCount: i.length,
|
|
3370
3374
|
children: i.map((a) => ({
|
|
@@ -3388,16 +3392,16 @@ function Yt(e, t) {
|
|
|
3388
3392
|
const s = t.hasMoreChildren ? "+" : "", r = t.childrenError ? " (partial)" : "";
|
|
3389
3393
|
return ` • ${e}=${t.childCount}${s}${r}`;
|
|
3390
3394
|
}
|
|
3391
|
-
const
|
|
3392
|
-
type: o.enum(
|
|
3395
|
+
const so = ["task", "project", "comment", "section"], ea = {
|
|
3396
|
+
type: o.enum(so).describe("The type of object to fetch."),
|
|
3393
3397
|
id: o.string().min(1).describe("The unique ID of the object to fetch."),
|
|
3394
3398
|
includeChildren: o.boolean().optional().describe(
|
|
3395
3399
|
"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."
|
|
3396
3400
|
)
|
|
3397
3401
|
}, ta = {
|
|
3398
|
-
type: o.enum(
|
|
3402
|
+
type: o.enum(so).describe("The type of object fetched."),
|
|
3399
3403
|
id: o.string().describe("The ID of the fetched object."),
|
|
3400
|
-
object: o.union([V, de,
|
|
3404
|
+
object: o.union([V, de, Ae, Z]).describe("The fetched object data."),
|
|
3401
3405
|
...Xi
|
|
3402
3406
|
}, sa = {
|
|
3403
3407
|
name: T.FETCH_OBJECT,
|
|
@@ -3437,7 +3441,7 @@ const to = ["task", "project", "comment", "section"], ea = {
|
|
|
3437
3441
|
};
|
|
3438
3442
|
}
|
|
3439
3443
|
case "comment": {
|
|
3440
|
-
const i = await t.getComment(r), a =
|
|
3444
|
+
const i = await t.getComment(r), a = $e(i), c = a.content.length > 50 ? `${a.content.substring(0, 50)}...` : a.content;
|
|
3441
3445
|
return {
|
|
3442
3446
|
textContent: `Found comment • id=${a.id} • content="${c}" • posted=${a.postedAt}`,
|
|
3443
3447
|
structuredContent: {
|
|
@@ -3552,7 +3556,7 @@ function Vt(e) {
|
|
|
3552
3556
|
const aa = {
|
|
3553
3557
|
objectType: o.enum(Ts).optional().describe("Type of object to filter by."),
|
|
3554
3558
|
objectId: o.string().optional().describe("Filter by specific object ID (task, project, or comment). Requires objectType."),
|
|
3555
|
-
eventType: o.enum(
|
|
3559
|
+
eventType: o.enum(Mo).optional().describe("Type of event to filter by."),
|
|
3556
3560
|
projectId: o.string().optional().describe("Filter events by parent project ID."),
|
|
3557
3561
|
taskId: o.string().optional().describe("Filter events by parent task ID (for subtask events)."),
|
|
3558
3562
|
initiatorId: o.string().optional().describe(
|
|
@@ -3564,7 +3568,7 @@ const aa = {
|
|
|
3564
3568
|
dateTo: Vt(
|
|
3565
3569
|
'Exclusive end of the activity range, as an ISO 8601 date or date-time. For all events on 2026-08-02, use "2026-08-03T00:00:00-04:00". Natural-language dates such as "tomorrow" are not supported.'
|
|
3566
3570
|
),
|
|
3567
|
-
limit: o.number().int().min(1).max(
|
|
3571
|
+
limit: o.number().int().min(1).max(E.ACTIVITY_MAX).default(E.ACTIVITY_DEFAULT).describe("Maximum number of activity events to return."),
|
|
3568
3572
|
cursor: o.string().optional().describe("Pagination cursor for retrieving the next page of results.")
|
|
3569
3573
|
}, ca = {
|
|
3570
3574
|
events: o.array(On).describe("The activity events."),
|
|
@@ -3694,9 +3698,9 @@ const ma = {
|
|
|
3694
3698
|
),
|
|
3695
3699
|
commentId: o.string().optional().describe("Get a specific comment by ID."),
|
|
3696
3700
|
cursor: o.string().optional().describe("Pagination cursor for retrieving more results."),
|
|
3697
|
-
limit: o.number().int().min(1).max(
|
|
3701
|
+
limit: o.number().int().min(1).max(E.COMMENTS_MAX).optional().describe("Maximum number of comments to return")
|
|
3698
3702
|
}, fa = {
|
|
3699
|
-
comments: o.array(
|
|
3703
|
+
comments: o.array(Ae).describe("The found comments."),
|
|
3700
3704
|
searchType: o.string().describe(
|
|
3701
3705
|
'The type of search performed: "single" (comment ID), "task" (task ID), or "project" (project ID).'
|
|
3702
3706
|
),
|
|
@@ -3729,19 +3733,19 @@ const ma = {
|
|
|
3729
3733
|
const u = await t.getComments({
|
|
3730
3734
|
taskId: e.taskId,
|
|
3731
3735
|
cursor: s ?? null,
|
|
3732
|
-
limit: e.limit ||
|
|
3736
|
+
limit: e.limit || E.COMMENTS_DEFAULT
|
|
3733
3737
|
});
|
|
3734
3738
|
c = u.results, i = u.nextCursor !== null, a = u.nextCursor;
|
|
3735
3739
|
} else if (n) {
|
|
3736
3740
|
const u = await t.getComments({
|
|
3737
3741
|
projectId: n,
|
|
3738
3742
|
cursor: s ?? null,
|
|
3739
|
-
limit: e.limit ||
|
|
3743
|
+
limit: e.limit || E.COMMENTS_DEFAULT
|
|
3740
3744
|
});
|
|
3741
3745
|
c = u.results, i = u.nextCursor !== null, a = u.nextCursor;
|
|
3742
3746
|
} else
|
|
3743
3747
|
throw new Error("Invalid state: no search parameter provided");
|
|
3744
|
-
const d = c.map(
|
|
3748
|
+
const d = c.map($e);
|
|
3745
3749
|
return {
|
|
3746
3750
|
textContent: ga({
|
|
3747
3751
|
comments: d,
|
|
@@ -3781,17 +3785,17 @@ function ga({
|
|
|
3781
3785
|
i = `Found ${e.length} ${d} for ${t} ${s}${c}`, r && (i += " • More available");
|
|
3782
3786
|
}
|
|
3783
3787
|
if (n) {
|
|
3784
|
-
const a =
|
|
3788
|
+
const a = Gs([], n);
|
|
3785
3789
|
return `${i}
|
|
3786
3790
|
${a}`;
|
|
3787
3791
|
}
|
|
3788
3792
|
return i;
|
|
3789
3793
|
}
|
|
3790
|
-
function
|
|
3794
|
+
function oo(e) {
|
|
3791
3795
|
const t = e.getUTCFullYear(), s = String(e.getUTCMonth() + 1).padStart(2, "0"), r = String(e.getUTCDate()).padStart(2, "0");
|
|
3792
3796
|
return `${t}-${s}-${r}`;
|
|
3793
3797
|
}
|
|
3794
|
-
function
|
|
3798
|
+
function ro(e) {
|
|
3795
3799
|
const t = /^([+-])(\d{2}):(\d{2})$/.exec(e);
|
|
3796
3800
|
if (!t)
|
|
3797
3801
|
return 0;
|
|
@@ -3800,22 +3804,22 @@ function oo(e) {
|
|
|
3800
3804
|
}
|
|
3801
3805
|
function ya(e, t) {
|
|
3802
3806
|
const s = new Date(e.getTime() + t * 60 * 1e3);
|
|
3803
|
-
return
|
|
3807
|
+
return oo(s);
|
|
3804
3808
|
}
|
|
3805
3809
|
function Jt(e, t) {
|
|
3806
3810
|
const [s, r, n] = e.split("-"), i = Number(s), a = Number(r), c = Number(n);
|
|
3807
3811
|
if (!Number.isFinite(i) || !Number.isFinite(a) || !Number.isFinite(c))
|
|
3808
3812
|
throw new Error(`Invalid date format: ${e}. Expected YYYY-MM-DD.`);
|
|
3809
3813
|
const d = new Date(Date.UTC(i, a - 1, c));
|
|
3810
|
-
return d.setUTCDate(d.getUTCDate() + t),
|
|
3814
|
+
return d.setUTCDate(d.getUTCDate() + t), oo(d);
|
|
3811
3815
|
}
|
|
3812
|
-
const Ta = ["and", "or"],
|
|
3816
|
+
const Ta = ["and", "or"], Et = {
|
|
3813
3817
|
labels: o.string().array().optional().describe("The labels to filter the tasks by"),
|
|
3814
3818
|
labelsOperator: o.enum(Ta).optional().describe(
|
|
3815
3819
|
'The operator to use when filtering by labels. This will dictate whether a task has all labels, or some of them. Default is "or".'
|
|
3816
3820
|
)
|
|
3817
3821
|
};
|
|
3818
|
-
function
|
|
3822
|
+
function Dt(e = [], t = "or") {
|
|
3819
3823
|
if (e.length === 0) return "";
|
|
3820
3824
|
const s = t === "and" ? " & " : " | ";
|
|
3821
3825
|
return `(${e.map((i) => i.startsWith("@") ? i : `@${i}`).join(` ${s} `)})`;
|
|
@@ -3827,7 +3831,7 @@ function ka({
|
|
|
3827
3831
|
userGmtOffset: s,
|
|
3828
3832
|
now: r = /* @__PURE__ */ new Date()
|
|
3829
3833
|
}) {
|
|
3830
|
-
const n =
|
|
3834
|
+
const n = ro(s), i = ya(r, n), a = wa - 1, c = t ?? (e ? Jt(e, a) : i);
|
|
3831
3835
|
return {
|
|
3832
3836
|
since: e ?? Jt(c, -a),
|
|
3833
3837
|
until: c
|
|
@@ -3852,11 +3856,11 @@ const va = {
|
|
|
3852
3856
|
responsibleUser: o.string().optional().describe(
|
|
3853
3857
|
"Filter completed tasks assigned to this user. User ID, name, or email. For personal queries (summaries, plans, reports), set to current user from user-info to exclude collaborators. Defaults to all collaborators."
|
|
3854
3858
|
),
|
|
3855
|
-
limit: o.number().int().min(1).max(
|
|
3859
|
+
limit: o.number().int().min(1).max(E.COMPLETED_TASKS_MAX).default(E.COMPLETED_TASKS_DEFAULT).describe("The maximum number of tasks to return."),
|
|
3856
3860
|
cursor: o.string().optional().describe(
|
|
3857
3861
|
"The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters)."
|
|
3858
3862
|
),
|
|
3859
|
-
...
|
|
3863
|
+
...Et
|
|
3860
3864
|
}, Ia = {
|
|
3861
3865
|
tasks: o.array(V).describe("The found completed tasks."),
|
|
3862
3866
|
nextCursor: o.string().optional(),
|
|
@@ -3886,7 +3890,7 @@ const va = {
|
|
|
3886
3890
|
"Cursor pagination requires explicit since and until. Reuse structuredContent.appliedFilters.since and structuredContent.appliedFilters.until from the previous page."
|
|
3887
3891
|
);
|
|
3888
3892
|
const h = await gt(t, c), f = h?.email;
|
|
3889
|
-
let m =
|
|
3893
|
+
let m = Dt(r, n);
|
|
3890
3894
|
h && f && (m = ye(m, `assigned to: ${f}`));
|
|
3891
3895
|
const g = await t.getUser(), w = g.tzInfo?.gmtString || "+00:00", I = await ae({
|
|
3892
3896
|
projectId: d,
|
|
@@ -3963,7 +3967,7 @@ const ja = {
|
|
|
3963
3967
|
searchText: o.string().optional().describe(
|
|
3964
3968
|
'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.'
|
|
3965
3969
|
),
|
|
3966
|
-
limit: o.number().int().min(1).max(
|
|
3970
|
+
limit: o.number().int().min(1).max(E.LABELS_MAX).default(E.LABELS_DEFAULT).describe("The maximum number of labels to return."),
|
|
3967
3971
|
cursor: o.string().optional().describe(
|
|
3968
3972
|
"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."
|
|
3969
3973
|
)
|
|
@@ -3991,7 +3995,7 @@ const ja = {
|
|
|
3991
3995
|
kn(t)
|
|
3992
3996
|
]), { results: n, nextCursor: i } = s, a = e.searchText ? { searchText: e.searchText } : { limit: e.limit, cursor: e.cursor };
|
|
3993
3997
|
return {
|
|
3994
|
-
textContent:
|
|
3998
|
+
textContent: Ea({ labels: n, args: e, nextCursor: i, sharedLabels: r }),
|
|
3995
3999
|
structuredContent: {
|
|
3996
4000
|
labels: n.map((c) => ke.parse(c)),
|
|
3997
4001
|
nextCursor: i ?? void 0,
|
|
@@ -4003,7 +4007,7 @@ const ja = {
|
|
|
4003
4007
|
};
|
|
4004
4008
|
}
|
|
4005
4009
|
};
|
|
4006
|
-
function
|
|
4010
|
+
function Ea({
|
|
4007
4011
|
labels: e,
|
|
4008
4012
|
args: t,
|
|
4009
4013
|
nextCursor: s,
|
|
@@ -4011,7 +4015,7 @@ function Da({
|
|
|
4011
4015
|
}) {
|
|
4012
4016
|
const n = t.searchText ? `All labels matching "${t.searchText}"` : "Labels", i = [];
|
|
4013
4017
|
t.searchText && i.push(`searchText: "${t.searchText}"`);
|
|
4014
|
-
const a = 10, d = e.slice(0, a).map(
|
|
4018
|
+
const a = 10, d = e.slice(0, a).map(Pn).join(`
|
|
4015
4019
|
`), l = e.length - a, u = l > 0 ? `${d}
|
|
4016
4020
|
…and ${l} more` : d, p = [];
|
|
4017
4021
|
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"));
|
|
@@ -4028,7 +4032,7 @@ No shared labels.`;
|
|
|
4028
4032
|
zeroReasonHints: p
|
|
4029
4033
|
}) + h;
|
|
4030
4034
|
}
|
|
4031
|
-
const { FIND_PROJECTS:
|
|
4035
|
+
const { FIND_PROJECTS: no, ADD_TASKS: io, UPDATE_TASKS: ao } = T, Da = {
|
|
4032
4036
|
projectId: o.string().min(1).optional().describe(
|
|
4033
4037
|
'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.'
|
|
4034
4038
|
),
|
|
@@ -4048,7 +4052,7 @@ const { FIND_PROJECTS: ro, ADD_TASKS: no, UPDATE_TASKS: io } = T, Ea = {
|
|
|
4048
4052
|
}, Oa = {
|
|
4049
4053
|
name: T.FIND_PROJECT_COLLABORATORS,
|
|
4050
4054
|
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.`,
|
|
4051
|
-
parameters:
|
|
4055
|
+
parameters: Da,
|
|
4052
4056
|
outputSchema: xa,
|
|
4053
4057
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4054
4058
|
async execute(e, t) {
|
|
@@ -4065,7 +4069,7 @@ const { FIND_PROJECTS: ro, ADD_TASKS: no, UPDATE_TASKS: io } = T, Ea = {
|
|
|
4065
4069
|
|
|
4066
4070
|
**Next steps:**
|
|
4067
4071
|
• Share the project to enable collaboration
|
|
4068
|
-
• Use ${
|
|
4072
|
+
• Use ${io} and ${ao} for assignment features once shared`,
|
|
4069
4073
|
structuredContent: {
|
|
4070
4074
|
collaborators: [],
|
|
4071
4075
|
projectInfo: {
|
|
@@ -4102,9 +4106,9 @@ const { FIND_PROJECTS: ro, ADD_TASKS: no, UPDATE_TASKS: io } = T, Ea = {
|
|
|
4102
4106
|
appliedFilters: e
|
|
4103
4107
|
}
|
|
4104
4108
|
};
|
|
4105
|
-
const c =
|
|
4109
|
+
const c = co(a, r);
|
|
4106
4110
|
return {
|
|
4107
|
-
textContent:
|
|
4111
|
+
textContent: lo({
|
|
4108
4112
|
collaborators: c,
|
|
4109
4113
|
projectName: n,
|
|
4110
4114
|
searchTerm: r,
|
|
@@ -4135,7 +4139,7 @@ async function Ua({
|
|
|
4135
4139
|
textContent: `No users found. You may have no shared projects, or collaborator data is not accessible.
|
|
4136
4140
|
|
|
4137
4141
|
**Next steps:**
|
|
4138
|
-
• Use ${
|
|
4142
|
+
• Use ${no} to find shared projects
|
|
4139
4143
|
• Share a project to add collaborators
|
|
4140
4144
|
• Ensure you have permission to view collaborators`,
|
|
4141
4145
|
structuredContent: {
|
|
@@ -4146,9 +4150,9 @@ async function Ua({
|
|
|
4146
4150
|
appliedFilters: s
|
|
4147
4151
|
}
|
|
4148
4152
|
};
|
|
4149
|
-
const i =
|
|
4153
|
+
const i = co(n, e);
|
|
4150
4154
|
return {
|
|
4151
|
-
textContent:
|
|
4155
|
+
textContent: lo({
|
|
4152
4156
|
collaborators: i,
|
|
4153
4157
|
projectName: void 0,
|
|
4154
4158
|
searchTerm: e,
|
|
@@ -4174,7 +4178,7 @@ async function _a(e, t) {
|
|
|
4174
4178
|
return t;
|
|
4175
4179
|
}
|
|
4176
4180
|
}
|
|
4177
|
-
function
|
|
4181
|
+
function co(e, t) {
|
|
4178
4182
|
if (!t)
|
|
4179
4183
|
return e;
|
|
4180
4184
|
const s = t.toLowerCase().trim();
|
|
@@ -4182,7 +4186,7 @@ function ao(e, t) {
|
|
|
4182
4186
|
(r) => r.name.toLowerCase().includes(s) || r.email.toLowerCase().includes(s)
|
|
4183
4187
|
);
|
|
4184
4188
|
}
|
|
4185
|
-
function
|
|
4189
|
+
function lo({
|
|
4186
4190
|
collaborators: e,
|
|
4187
4191
|
projectName: t,
|
|
4188
4192
|
searchTerm: s,
|
|
@@ -4198,7 +4202,7 @@ function co({
|
|
|
4198
4202
|
const l = [];
|
|
4199
4203
|
e.length === 0 && s && (l.push(`No users match "${s}"`), l.push("Try a broader search term or check spelling"), r > 0 && l.push(`${r} users available without filter`));
|
|
4200
4204
|
const u = [];
|
|
4201
|
-
return e.length > 0 ? (u.push(`Use ${
|
|
4205
|
+
return e.length > 0 ? (u.push(`Use ${io} with responsibleUser to assign new tasks`), u.push(`Use ${ao} with responsibleUser to reassign existing tasks`), u.push("Use user names, emails, or IDs for assignments")) : (u.push(`Use ${no} to find other projects`), s && r > 0 && u.push("Try searching without filters to see all users")), ee({
|
|
4202
4206
|
subject: a,
|
|
4203
4207
|
count: e.length,
|
|
4204
4208
|
filterHints: c,
|
|
@@ -4208,15 +4212,15 @@ function co({
|
|
|
4208
4212
|
nextSteps: u
|
|
4209
4213
|
});
|
|
4210
4214
|
}
|
|
4211
|
-
const { ADD_PROJECTS: Xt } = T,
|
|
4215
|
+
const { ADD_PROJECTS: Xt } = T, Ra = {
|
|
4212
4216
|
active: "projects",
|
|
4213
4217
|
archived: "archived projects",
|
|
4214
4218
|
all: "projects (active and archived)"
|
|
4215
|
-
},
|
|
4219
|
+
}, Pa = {
|
|
4216
4220
|
searchText: o.string().optional().describe(
|
|
4217
4221
|
'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.'
|
|
4218
4222
|
),
|
|
4219
|
-
limit: o.number().int().min(1).max(
|
|
4223
|
+
limit: o.number().int().min(1).max(E.PROJECTS_MAX).default(E.PROJECTS_DEFAULT).describe("The maximum number of projects to return."),
|
|
4220
4224
|
cursor: o.string().optional().describe(
|
|
4221
4225
|
"The cursor to get the next page of projects (cursor is obtained from the previous call to this tool, with the same parameters)."
|
|
4222
4226
|
),
|
|
@@ -4232,7 +4236,7 @@ const { ADD_PROJECTS: Xt } = T, Pa = {
|
|
|
4232
4236
|
}, La = {
|
|
4233
4237
|
name: T.FIND_PROJECTS,
|
|
4234
4238
|
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.",
|
|
4235
|
-
parameters:
|
|
4239
|
+
parameters: Pa,
|
|
4236
4240
|
outputSchema: Na,
|
|
4237
4241
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4238
4242
|
async execute(e, t) {
|
|
@@ -4240,7 +4244,7 @@ const { ADD_PROJECTS: Xt } = T, Pa = {
|
|
|
4240
4244
|
let n, i = null;
|
|
4241
4245
|
if (s || r === "all") {
|
|
4242
4246
|
const c = Promise.resolve([]), [d, l] = await Promise.all([
|
|
4243
|
-
r === "archived" ? c : s ?
|
|
4247
|
+
r === "archived" ? c : s ? Ws(t, s) : Bs(t),
|
|
4244
4248
|
r === "active" ? c : yn(t)
|
|
4245
4249
|
]), u = s ? Tn(s) : null, p = u ? l.filter((h) => u.test(h.name)) : l;
|
|
4246
4250
|
n = [...d, ...p];
|
|
@@ -4269,7 +4273,7 @@ function Ma({
|
|
|
4269
4273
|
args: t,
|
|
4270
4274
|
nextCursor: s
|
|
4271
4275
|
}) {
|
|
4272
|
-
const r =
|
|
4276
|
+
const r = Ra[t.archivedStatus ?? "active"], n = t.searchText ? `All ${r} matching "${t.searchText}"` : `${r.charAt(0).toUpperCase()}${r.slice(1)}`, i = [];
|
|
4273
4277
|
t.searchText && i.push(`searchText: "${t.searchText}"`), t.archivedStatus && t.archivedStatus !== "active" && i.push(`archivedStatus: "${t.archivedStatus}"`);
|
|
4274
4278
|
const a = 10, d = e.slice(0, a).map(Nn).join(`
|
|
4275
4279
|
`), l = e.length - a, u = l > 0 ? `${d}
|
|
@@ -4310,7 +4314,7 @@ const Fa = {
|
|
|
4310
4314
|
"Only one of taskId, reminderId, or locationReminderId can be provided at a time."
|
|
4311
4315
|
);
|
|
4312
4316
|
if (r) {
|
|
4313
|
-
const a = await t.getReminder(r), c =
|
|
4317
|
+
const a = await t.getReminder(r), c = je(a);
|
|
4314
4318
|
return {
|
|
4315
4319
|
textContent: `Found ${a.type} reminder (id=${r})`,
|
|
4316
4320
|
structuredContent: {
|
|
@@ -4322,7 +4326,7 @@ const Fa = {
|
|
|
4322
4326
|
};
|
|
4323
4327
|
}
|
|
4324
4328
|
if (n) {
|
|
4325
|
-
const a = await t.getLocationReminder(n), c =
|
|
4329
|
+
const a = await t.getLocationReminder(n), c = je(a);
|
|
4326
4330
|
return {
|
|
4327
4331
|
textContent: `Found location reminder (id=${n})`,
|
|
4328
4332
|
structuredContent: {
|
|
@@ -4343,7 +4347,7 @@ const Fa = {
|
|
|
4343
4347
|
apiMethod: (p) => t.getLocationReminders(p),
|
|
4344
4348
|
args: { taskId: s }
|
|
4345
4349
|
})
|
|
4346
|
-
]), l = [...a, ...c].map(
|
|
4350
|
+
]), l = [...a, ...c].map(je);
|
|
4347
4351
|
return {
|
|
4348
4352
|
textContent: Ba(l, s),
|
|
4349
4353
|
structuredContent: {
|
|
@@ -4360,7 +4364,7 @@ const Fa = {
|
|
|
4360
4364
|
function Ba(e, t) {
|
|
4361
4365
|
if (e.length === 0)
|
|
4362
4366
|
return `No reminders found for task ${t}`;
|
|
4363
|
-
const { timeBasedCount: s, locationCount: r } =
|
|
4367
|
+
const { timeBasedCount: s, locationCount: r } = Ks(e), n = [];
|
|
4364
4368
|
if (s > 0) {
|
|
4365
4369
|
const i = s > 1 ? "time-based reminders" : "time-based reminder";
|
|
4366
4370
|
n.push(`${s} ${i}`);
|
|
@@ -4428,7 +4432,7 @@ function Ya({
|
|
|
4428
4432
|
zeroReasonHints: r
|
|
4429
4433
|
});
|
|
4430
4434
|
}
|
|
4431
|
-
function
|
|
4435
|
+
function uo(e) {
|
|
4432
4436
|
return /* @__PURE__ */ new Date(`${e}T00:00:00`);
|
|
4433
4437
|
}
|
|
4434
4438
|
const Va = {
|
|
@@ -4441,17 +4445,17 @@ const Va = {
|
|
|
4441
4445
|
daysCount: o.number().int().min(1).max(30).default(1).describe(
|
|
4442
4446
|
"The number of days to get the tasks for, starting from the start date. Default is 1 which means only tasks for the start date."
|
|
4443
4447
|
),
|
|
4444
|
-
limit: o.number().int().min(1).max(
|
|
4448
|
+
limit: o.number().int().min(1).max(E.TASKS_MAX).default(E.TASKS_DEFAULT).describe("The maximum number of tasks to return. Default is 10."),
|
|
4445
4449
|
cursor: o.string().optional().describe(
|
|
4446
4450
|
"The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters)."
|
|
4447
4451
|
),
|
|
4448
4452
|
responsibleUser: o.string().optional().describe(
|
|
4449
4453
|
"Filter tasks assigned to this user. User ID, name, or email. The current user also includes unassigned tasks."
|
|
4450
4454
|
),
|
|
4451
|
-
responsibleUserFiltering: o.enum(
|
|
4455
|
+
responsibleUserFiltering: o.enum(Hs).optional().describe(
|
|
4452
4456
|
"Filter when responsibleUser is omitted. 'assigned'=assigned to others; 'unassignedOrMe'=unassigned+mine; 'all'=everyone. Default: 'unassignedOrMe'."
|
|
4453
4457
|
),
|
|
4454
|
-
...
|
|
4458
|
+
...Et
|
|
4455
4459
|
}, Ja = {
|
|
4456
4460
|
tasks: o.array(V).describe("The found tasks."),
|
|
4457
4461
|
nextCursor: o.string().optional(),
|
|
@@ -4470,7 +4474,7 @@ const Va = {
|
|
|
4470
4474
|
throw new Error(
|
|
4471
4475
|
"Either startDate must be provided or overdueOption must be set to overdue-only"
|
|
4472
4476
|
);
|
|
4473
|
-
const r = await gt(t, e.responsibleUser), n = r?.userId, i = r?.email, c = e.responsibleUser?.trim().toLowerCase() ===
|
|
4477
|
+
const r = await gt(t, e.responsibleUser), n = r?.userId, i = r?.email, c = e.responsibleUser?.trim().toLowerCase() === Ms ? n : n ? (await t.getUser()).id : void 0;
|
|
4474
4478
|
let d = "";
|
|
4475
4479
|
if (e.overdueOption === "overdue-only")
|
|
4476
4480
|
d = "overdue";
|
|
@@ -4481,10 +4485,10 @@ const Va = {
|
|
|
4481
4485
|
} else
|
|
4482
4486
|
d = e.overdueOption === "exclude-overdue" ? "today" : "(today | overdue)";
|
|
4483
4487
|
else if (e.startDate) {
|
|
4484
|
-
const b = e.startDate, m = Ye(
|
|
4488
|
+
const b = e.startDate, m = Ye(uo(b), e.daysCount), g = xt(m, { representation: "date" });
|
|
4485
4489
|
d = `(due after: ${b} | due: ${b}) & due before: ${g}`;
|
|
4486
4490
|
}
|
|
4487
|
-
const l =
|
|
4491
|
+
const l = Dt(e.labels, e.labelsOperator);
|
|
4488
4492
|
l.length > 0 && (d = ye(d, `(${l})`));
|
|
4489
4493
|
const u = rt({
|
|
4490
4494
|
resolvedAssigneeId: n,
|
|
@@ -4533,7 +4537,7 @@ function Za({
|
|
|
4533
4537
|
`today${d}${t.daysCount > 1 ? ` + ${t.daysCount - 1} more days` : ""}`
|
|
4534
4538
|
);
|
|
4535
4539
|
} else if (t.startDate) {
|
|
4536
|
-
const d = t.daysCount > 1 ? ` to ${be(Ye(
|
|
4540
|
+
const d = t.daysCount > 1 ? ` to ${be(Ye(uo(t.startDate), t.daysCount))}` : "";
|
|
4537
4541
|
i.push(`${t.startDate}${d}`);
|
|
4538
4542
|
}
|
|
4539
4543
|
if (t.labels && t.labels.length > 0) {
|
|
@@ -4642,10 +4646,10 @@ const tc = new ec(), { FIND_COMPLETED_TASKS: Zt, ADD_TASKS: Qt } = T, sc = {
|
|
|
4642
4646
|
responsibleUser: o.string().optional().describe(
|
|
4643
4647
|
"Find tasks assigned to this user. Can be a user ID, name, or email address. The current user also includes unassigned tasks."
|
|
4644
4648
|
),
|
|
4645
|
-
responsibleUserFiltering: o.enum(
|
|
4649
|
+
responsibleUserFiltering: o.enum(Hs).optional().describe(
|
|
4646
4650
|
'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`.'
|
|
4647
4651
|
),
|
|
4648
|
-
limit: o.number().int().min(1).max(
|
|
4652
|
+
limit: o.number().int().min(1).max(E.TASKS_MAX).default(E.TASKS_DEFAULT).describe("The maximum number of tasks to return."),
|
|
4649
4653
|
cursor: o.string().optional().describe(
|
|
4650
4654
|
"The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters)."
|
|
4651
4655
|
),
|
|
@@ -4655,7 +4659,7 @@ const tc = new ec(), { FIND_COMPLETED_TASKS: Zt, ADD_TASKS: Qt } = T, sc = {
|
|
|
4655
4659
|
filterIdOrName: o.string().optional().describe(
|
|
4656
4660
|
"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."
|
|
4657
4661
|
),
|
|
4658
|
-
...
|
|
4662
|
+
...Et
|
|
4659
4663
|
}, oc = {
|
|
4660
4664
|
tasks: o.array(V).describe("The found tasks."),
|
|
4661
4665
|
nextCursor: o.string().optional(),
|
|
@@ -4704,7 +4708,7 @@ const tc = new ec(), { FIND_COMPLETED_TASKS: Zt, ADD_TASKS: Qt } = T, sc = {
|
|
|
4704
4708
|
cursor: b ?? null
|
|
4705
4709
|
};
|
|
4706
4710
|
r && (O.projectId = await ae({ projectId: r, user: m })), n && (O.sectionId = n), i && (O.parentId = i);
|
|
4707
|
-
const { results:
|
|
4711
|
+
const { results: Ee, nextCursor: te } = await t.getTasks(O), se = Ee.map(H);
|
|
4708
4712
|
let W = s ? se.filter(
|
|
4709
4713
|
(le) => le.content.toLowerCase().includes(s.toLowerCase()) || le.description?.toLowerCase().includes(s.toLowerCase())
|
|
4710
4714
|
) : se;
|
|
@@ -4741,12 +4745,12 @@ const tc = new ec(), { FIND_COMPLETED_TASKS: Zt, ADD_TASKS: Qt } = T, sc = {
|
|
|
4741
4745
|
assigneeEmail: C,
|
|
4742
4746
|
currentUserId: m.id,
|
|
4743
4747
|
responsibleUserFiltering: c
|
|
4744
|
-
}), { results:
|
|
4748
|
+
}), { results: Ee, nextCursor: te } = await t.getTasksByFilter({
|
|
4745
4749
|
query: O,
|
|
4746
4750
|
lang: "en",
|
|
4747
4751
|
limit: d,
|
|
4748
4752
|
cursor: b ?? null
|
|
4749
|
-
}), se =
|
|
4753
|
+
}), se = Ee.map(H);
|
|
4750
4754
|
return {
|
|
4751
4755
|
textContent: He({
|
|
4752
4756
|
tasks: se,
|
|
@@ -4767,7 +4771,7 @@ const tc = new ec(), { FIND_COMPLETED_TASKS: Zt, ADD_TASKS: Qt } = T, sc = {
|
|
|
4767
4771
|
}
|
|
4768
4772
|
let j = w ? `(${w})` : "";
|
|
4769
4773
|
s && (j = ye(j, `search: ${ws(s)}`));
|
|
4770
|
-
const J =
|
|
4774
|
+
const J = Dt(u, p);
|
|
4771
4775
|
if (j = ye(j, J), !(f && !a && !c)) {
|
|
4772
4776
|
const O = rt({
|
|
4773
4777
|
resolvedAssigneeId: k,
|
|
@@ -4871,7 +4875,7 @@ const ic = {
|
|
|
4871
4875
|
projectId: o.string().min(1).optional().describe(
|
|
4872
4876
|
`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.`
|
|
4873
4877
|
)
|
|
4874
|
-
},
|
|
4878
|
+
}, po = o.lazy(
|
|
4875
4879
|
() => o.object({
|
|
4876
4880
|
id: o.string().describe("The project ID."),
|
|
4877
4881
|
name: o.string().describe("The project name."),
|
|
@@ -4879,7 +4883,7 @@ const ic = {
|
|
|
4879
4883
|
folderId: o.string().optional().describe("The folder ID this project belongs to (workspace projects only)."),
|
|
4880
4884
|
childOrder: o.number().describe("The ordering index among siblings."),
|
|
4881
4885
|
sections: o.array(Z),
|
|
4882
|
-
children: o.array(
|
|
4886
|
+
children: o.array(po).describe("Nested child projects.")
|
|
4883
4887
|
})
|
|
4884
4888
|
), ac = {
|
|
4885
4889
|
type: o.enum(["account_overview", "project_overview"]).describe("The type of overview returned."),
|
|
@@ -4900,7 +4904,7 @@ const ic = {
|
|
|
4900
4904
|
name: o.string().describe("The inbox project name."),
|
|
4901
4905
|
sections: o.array(Z).describe("Sections in the inbox project.")
|
|
4902
4906
|
}).optional().describe("Inbox information (account overview only)."),
|
|
4903
|
-
projects: o.array(o.lazy(() =>
|
|
4907
|
+
projects: o.array(o.lazy(() => po)).optional().describe(
|
|
4904
4908
|
"List of projects with hierarchy, folders, and ordering (account overview only)."
|
|
4905
4909
|
),
|
|
4906
4910
|
project: o.object({
|
|
@@ -4949,14 +4953,14 @@ async function dc(e, t) {
|
|
|
4949
4953
|
})
|
|
4950
4954
|
), s;
|
|
4951
4955
|
}
|
|
4952
|
-
function
|
|
4956
|
+
function ho(e, t, s = "") {
|
|
4953
4957
|
const r = [];
|
|
4954
4958
|
r.push(`${s}- Project: ${e.name} (id=${e.id})`);
|
|
4955
4959
|
const n = t[e.id] || [];
|
|
4956
4960
|
for (const i of n)
|
|
4957
4961
|
r.push(`${s} - Section: ${i.name} (id=${i.id})`);
|
|
4958
4962
|
for (const i of e.children)
|
|
4959
|
-
r.push(...
|
|
4963
|
+
r.push(...ho(i, t, `${s} `));
|
|
4960
4964
|
return r;
|
|
4961
4965
|
}
|
|
4962
4966
|
function es(e) {
|
|
@@ -4984,7 +4988,7 @@ function nt(e, t, s = "") {
|
|
|
4984
4988
|
}
|
|
4985
4989
|
return r;
|
|
4986
4990
|
}
|
|
4987
|
-
function
|
|
4991
|
+
function mo(e, t) {
|
|
4988
4992
|
return {
|
|
4989
4993
|
id: e.id,
|
|
4990
4994
|
name: e.name,
|
|
@@ -4993,7 +4997,7 @@ function ho(e, t) {
|
|
|
4993
4997
|
childOrder: e.childOrder,
|
|
4994
4998
|
sections: (t[e.id] || []).map(Q),
|
|
4995
4999
|
children: e.children.map(
|
|
4996
|
-
(s) =>
|
|
5000
|
+
(s) => mo(s, t)
|
|
4997
5001
|
)
|
|
4998
5002
|
};
|
|
4999
5003
|
}
|
|
@@ -5002,7 +5006,7 @@ async function lc(e, t) {
|
|
|
5002
5006
|
do {
|
|
5003
5007
|
const { results: n, nextCursor: i } = await e.getTasks({
|
|
5004
5008
|
projectId: t,
|
|
5005
|
-
limit:
|
|
5009
|
+
limit: E.TASKS_BATCH_SIZE,
|
|
5006
5010
|
cursor: r ?? void 0
|
|
5007
5011
|
});
|
|
5008
5012
|
s = s.concat(n.map(H)), r = i ?? void 0;
|
|
@@ -5022,7 +5026,7 @@ async function pc(e) {
|
|
|
5022
5026
|
}
|
|
5023
5027
|
if (n.length)
|
|
5024
5028
|
for (const p of n)
|
|
5025
|
-
c.push(...
|
|
5029
|
+
c.push(...ho(p, a));
|
|
5026
5030
|
else
|
|
5027
5031
|
c.push("_No projects found._");
|
|
5028
5032
|
c.push(""), c.push(
|
|
@@ -5043,7 +5047,7 @@ async function pc(e) {
|
|
|
5043
5047
|
sections: (a[s.id] || []).map(Q)
|
|
5044
5048
|
} : void 0,
|
|
5045
5049
|
projects: n.map(
|
|
5046
|
-
(p) =>
|
|
5050
|
+
(p) => mo(p, a)
|
|
5047
5051
|
),
|
|
5048
5052
|
totalProjects: t.length,
|
|
5049
5053
|
totalSections: i.reduce(
|
|
@@ -5425,26 +5429,26 @@ const Ac = {
|
|
|
5425
5429
|
}
|
|
5426
5430
|
};
|
|
5427
5431
|
}
|
|
5428
|
-
},
|
|
5432
|
+
}, Ec = o.object({
|
|
5429
5433
|
message: o.string(),
|
|
5430
5434
|
emoji: o.string().optional(),
|
|
5431
5435
|
activeUntil: o.string().optional().describe("ISO 8601 end. Omitted when it has no end."),
|
|
5432
5436
|
pauseNotifications: o.boolean().describe("Comms notifications held back."),
|
|
5433
5437
|
pauseActivity: o.boolean().describe("Karma and streaks paused.")
|
|
5434
|
-
}),
|
|
5438
|
+
}), fo = {
|
|
5435
5439
|
hasStatus: o.boolean(),
|
|
5436
|
-
status:
|
|
5440
|
+
status: Ec.optional().describe("Omitted when there is no active status.")
|
|
5437
5441
|
};
|
|
5438
|
-
function
|
|
5442
|
+
function Dc(e) {
|
|
5439
5443
|
if (!e.user)
|
|
5440
5444
|
throw new Error("Todoist did not return the user, so the status is unknown.");
|
|
5441
5445
|
return e.user.status ?? null;
|
|
5442
5446
|
}
|
|
5443
|
-
async function
|
|
5447
|
+
async function bo(e) {
|
|
5444
5448
|
const t = await $(
|
|
5445
5449
|
() => e.sync({ resourceTypes: ["user"], syncToken: "*" })
|
|
5446
5450
|
);
|
|
5447
|
-
return
|
|
5451
|
+
return Dc(t);
|
|
5448
5452
|
}
|
|
5449
5453
|
function xc(e) {
|
|
5450
5454
|
const t = e.activeUntil ? new Date(e.activeUntil).toISOString() : void 0;
|
|
@@ -5478,17 +5482,17 @@ const Oc = {}, Uc = {
|
|
|
5478
5482
|
name: T.GET_USER_STATUS,
|
|
5479
5483
|
description: "Get the user's status, the message and emoji shown next to their name in Todoist and Comms, with when it ends and whether it pauses Comms notifications or Karma and streaks. Returns no status when none is set or it has expired.",
|
|
5480
5484
|
parameters: Oc,
|
|
5481
|
-
outputSchema:
|
|
5485
|
+
outputSchema: fo,
|
|
5482
5486
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
5483
5487
|
async execute(e, t) {
|
|
5484
|
-
return it(await
|
|
5488
|
+
return it(await bo(t), "Status");
|
|
5485
5489
|
}
|
|
5486
5490
|
}, _c = {
|
|
5487
5491
|
workspaceIdOrName: o.string().min(1).describe(
|
|
5488
5492
|
"The workspace ID or name. Supports exact ID, exact name match (case-insensitive), or unique partial name match."
|
|
5489
5493
|
),
|
|
5490
5494
|
projectIds: o.array(o.string().min(1)).min(1).optional().describe("Optional list of project IDs to scope insights to specific projects.")
|
|
5491
|
-
},
|
|
5495
|
+
}, Rc = o.object({
|
|
5492
5496
|
projectId: o.string().describe("The project ID."),
|
|
5493
5497
|
health: o.object({
|
|
5494
5498
|
status: o.enum(ct).describe("The health status of the project."),
|
|
@@ -5500,22 +5504,22 @@ const Oc = {}, Uc = {
|
|
|
5500
5504
|
activeCount: o.number().describe("Number of active tasks."),
|
|
5501
5505
|
progressPercent: o.number().describe("Completion percentage (0-100).")
|
|
5502
5506
|
}).optional().describe("Progress data for this project. Omitted when the project has none.")
|
|
5503
|
-
}),
|
|
5507
|
+
}), Pc = {
|
|
5504
5508
|
workspaceId: o.string().describe("The resolved workspace ID."),
|
|
5505
5509
|
workspaceName: o.string().describe("The resolved workspace name."),
|
|
5506
|
-
projectInsights: o.array(
|
|
5510
|
+
projectInsights: o.array(Rc).describe("Health and progress insights for each project in the workspace.")
|
|
5507
5511
|
}, Nc = {
|
|
5508
5512
|
name: T.GET_WORKSPACE_INSIGHTS,
|
|
5509
5513
|
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.",
|
|
5510
5514
|
parameters: _c,
|
|
5511
|
-
outputSchema:
|
|
5515
|
+
outputSchema: Pc,
|
|
5512
5516
|
annotations: {
|
|
5513
5517
|
readOnlyHint: !0,
|
|
5514
5518
|
destructiveHint: !1,
|
|
5515
5519
|
idempotentHint: !0
|
|
5516
5520
|
},
|
|
5517
5521
|
async execute(e, t) {
|
|
5518
|
-
const { workspaceIdOrName: s, projectIds: r } = e, n = await
|
|
5522
|
+
const { workspaceIdOrName: s, projectIds: r } = e, n = await Ys.resolveWorkspace(t, s), a = (await t.getWorkspaceInsights(n.workspaceId, { projectIds: r })).projectInsights.map((d) => ({
|
|
5519
5523
|
projectId: d.projectId,
|
|
5520
5524
|
health: d.health ? {
|
|
5521
5525
|
status: d.health.status,
|
|
@@ -5563,7 +5567,7 @@ function Lc(e) {
|
|
|
5563
5567
|
`"${s.hostname}" is not a Todoist domain. Pass a todoist.com template URL or the template ID itself.`
|
|
5564
5568
|
);
|
|
5565
5569
|
s.hostname = "todoist.com";
|
|
5566
|
-
const r =
|
|
5570
|
+
const r = Fo(s.toString());
|
|
5567
5571
|
if (r?.type !== "template")
|
|
5568
5572
|
throw new Error(`"${t}" is not a Todoist template URL.`);
|
|
5569
5573
|
return r.id;
|
|
@@ -5584,7 +5588,7 @@ const Fc = {
|
|
|
5584
5588
|
}, Hc = {
|
|
5585
5589
|
sections: o.array(Z).describe("Sections created by the import."),
|
|
5586
5590
|
tasks: o.array(V).describe("Tasks created by the import."),
|
|
5587
|
-
comments: o.array(
|
|
5591
|
+
comments: o.array(Ae).describe("Comments created by the import."),
|
|
5588
5592
|
totalCount: o.number().describe("The total number of objects created by the import.")
|
|
5589
5593
|
}, Wc = {
|
|
5590
5594
|
name: T.IMPORT_PROJECT_TEMPLATE,
|
|
@@ -5606,7 +5610,7 @@ const Fc = {
|
|
|
5606
5610
|
// The SDK treats strings as filesystem paths, not file content.
|
|
5607
5611
|
file: new Blob([s ?? ""], { type: "text/csv" }),
|
|
5608
5612
|
fileName: "template.csv"
|
|
5609
|
-
}), a = i.sections.map(Q), c = i.tasks.map(H), d = i.comments.map(
|
|
5613
|
+
}), a = i.sections.map(Q), c = i.tasks.map(H), d = i.comments.map($e), l = i.projects.length + a.length + c.length + d.length;
|
|
5610
5614
|
return {
|
|
5611
5615
|
textContent: Bc({
|
|
5612
5616
|
projectId: e,
|
|
@@ -5635,8 +5639,8 @@ function Bc({
|
|
|
5635
5639
|
const Kc = {}, qc = {
|
|
5636
5640
|
id: o.string().describe("The unique identifier for the workspace."),
|
|
5637
5641
|
name: o.string().describe("The name of the workspace."),
|
|
5638
|
-
plan: o.enum(
|
|
5639
|
-
role: o.enum(
|
|
5642
|
+
plan: o.enum(Wo).describe("The workspace plan type."),
|
|
5643
|
+
role: o.enum(Ho).optional().describe("The user's role in the workspace, if available."),
|
|
5640
5644
|
isLinkSharingEnabled: o.boolean().describe("Whether link sharing is enabled for the workspace."),
|
|
5641
5645
|
isGuestAllowed: o.boolean().describe("Whether guests are allowed in the workspace."),
|
|
5642
5646
|
createdAt: o.string().optional().describe("The ISO 8601 timestamp when the workspace was created."),
|
|
@@ -5690,9 +5694,9 @@ const Yc = {
|
|
|
5690
5694
|
structuredContent: s.structuredContent
|
|
5691
5695
|
};
|
|
5692
5696
|
}
|
|
5693
|
-
}, { FIND_TASKS: Vc, FIND_PROJECT_COLLABORATORS: ss, UPDATE_TASKS: Jc } = T,
|
|
5697
|
+
}, { FIND_TASKS: Vc, FIND_PROJECT_COLLABORATORS: ss, UPDATE_TASKS: Jc } = T, go = 50, Xc = {
|
|
5694
5698
|
operation: o.enum(["assign", "unassign", "reassign"]).describe("The assignment operation to perform."),
|
|
5695
|
-
taskIds: o.array(o.string()).min(1).max(
|
|
5699
|
+
taskIds: o.array(o.string()).min(1).max(go).describe("The IDs of the tasks to operate on (max 50)."),
|
|
5696
5700
|
responsibleUser: o.string().optional().describe(
|
|
5697
5701
|
'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.'
|
|
5698
5702
|
),
|
|
@@ -5718,7 +5722,7 @@ const Yc = {
|
|
|
5718
5722
|
}).optional().describe("Summary of the operation.")
|
|
5719
5723
|
}, Qc = {
|
|
5720
5724
|
name: T.MANAGE_ASSIGNMENTS,
|
|
5721
|
-
description: `Assign, unassign or reassign up to ${
|
|
5725
|
+
description: `Assign, unassign or reassign up to ${go} tasks at once. Assigning notifies the new assignee. Each task is updated independently, so one failure does not undo the others; failures are reported per task. Use dryRun to check the changes first.`,
|
|
5722
5726
|
parameters: Xc,
|
|
5723
5727
|
outputSchema: Zc,
|
|
5724
5728
|
// Open world: assigning a task notifies the new assignee.
|
|
@@ -6036,7 +6040,7 @@ const ed = {
|
|
|
6036
6040
|
};
|
|
6037
6041
|
}
|
|
6038
6042
|
};
|
|
6039
|
-
function
|
|
6043
|
+
function yo(e, t) {
|
|
6040
6044
|
const s = new Map(e.map((h) => [h.id, h])), r = new Set(t.map((h) => h.id));
|
|
6041
6045
|
for (const h of r)
|
|
6042
6046
|
if (!s.has(h))
|
|
@@ -6104,7 +6108,7 @@ function dd(e, t) {
|
|
|
6104
6108
|
function ld(e, t) {
|
|
6105
6109
|
return e.legacyOrder - t.legacyOrder;
|
|
6106
6110
|
}
|
|
6107
|
-
const
|
|
6111
|
+
const To = ["project", "section"], ud = o.object({
|
|
6108
6112
|
id: o.string().min(1).describe("The ID of the entity."),
|
|
6109
6113
|
order: o.number().int().min(0).optional().describe(
|
|
6110
6114
|
"0-based position among its siblings after the reorder: 0 is first, past the end is last. Unlisted siblings keep their relative order."
|
|
@@ -6113,14 +6117,14 @@ const yo = ["project", "section"], ud = o.object({
|
|
|
6113
6117
|
'Move a personal project under this parent project ID, or "root" for the top level. Personal projects only.'
|
|
6114
6118
|
)
|
|
6115
6119
|
}), pd = {
|
|
6116
|
-
type: o.enum(
|
|
6120
|
+
type: o.enum(To).describe(
|
|
6117
6121
|
'"project": personal projects among the siblings under their parent, or workspace projects within their folder. "section": sections within their project.'
|
|
6118
6122
|
),
|
|
6119
6123
|
items: o.array(ud).min(1).describe(
|
|
6120
6124
|
"Each item needs order and/or parentId. Moves happen first, so order is a position under the new parent."
|
|
6121
6125
|
)
|
|
6122
6126
|
}, hd = {
|
|
6123
|
-
type: o.enum(
|
|
6127
|
+
type: o.enum(To).describe("The type of entity that was reordered/moved."),
|
|
6124
6128
|
movedCount: o.number().describe("The number of entities moved to a new parent."),
|
|
6125
6129
|
reorderedCount: o.number().describe("The number of entities reordered."),
|
|
6126
6130
|
affectedIds: o.array(o.string()).describe("The IDs of the entities moved or reordered."),
|
|
@@ -6152,7 +6156,7 @@ const yo = ["project", "section"], ud = o.object({
|
|
|
6152
6156
|
i.movedIds.size > 0 && d.push(`moved ${i.movedIds.size}`), (i.reorderedIds.size > 0 || d.length === 0) && d.push(`reordered ${i.reorderedIds.size}`);
|
|
6153
6157
|
const l = c.length > 0 ? `${d.join(" and ")} ${a}: ${c.map((u) => `id=${u}`).join(", ")}` : `${d.join(" and ")} ${a}`;
|
|
6154
6158
|
return {
|
|
6155
|
-
textContent:
|
|
6159
|
+
textContent: P(l, i.failures),
|
|
6156
6160
|
structuredContent: {
|
|
6157
6161
|
type: s,
|
|
6158
6162
|
movedCount: i.movedIds.size,
|
|
@@ -6174,7 +6178,7 @@ async function fd(e, t) {
|
|
|
6174
6178
|
}
|
|
6175
6179
|
const c = a.filter((b) => b.parentId !== void 0), d = /* @__PURE__ */ new Set();
|
|
6176
6180
|
if (c.length > 0) {
|
|
6177
|
-
const { outcomes: b } = await
|
|
6181
|
+
const { outcomes: b } = await ve(
|
|
6178
6182
|
e,
|
|
6179
6183
|
c.map(
|
|
6180
6184
|
(m) => ne("project_move", {
|
|
@@ -6185,7 +6189,7 @@ async function fd(e, t) {
|
|
|
6185
6189
|
);
|
|
6186
6190
|
b.forEach((m, g) => {
|
|
6187
6191
|
const w = c[g]?.id;
|
|
6188
|
-
w !== void 0 && (m.status === "fulfilled" ? s.add(w) : (d.add(w), n.push({ item: w, error:
|
|
6192
|
+
w !== void 0 && (m.status === "fulfilled" ? s.add(w) : (d.add(w), n.push({ item: w, error: D(m.reason) })));
|
|
6189
6193
|
});
|
|
6190
6194
|
}
|
|
6191
6195
|
const l = a.filter(
|
|
@@ -6197,7 +6201,7 @@ async function fd(e, t) {
|
|
|
6197
6201
|
try {
|
|
6198
6202
|
i = await ns(e);
|
|
6199
6203
|
} catch (b) {
|
|
6200
|
-
const m =
|
|
6204
|
+
const m = D(b);
|
|
6201
6205
|
for (const g of l)
|
|
6202
6206
|
n.push({
|
|
6203
6207
|
item: g.id,
|
|
@@ -6205,7 +6209,7 @@ async function fd(e, t) {
|
|
|
6205
6209
|
});
|
|
6206
6210
|
return { movedIds: s, reorderedIds: r, failures: n };
|
|
6207
6211
|
}
|
|
6208
|
-
const u =
|
|
6212
|
+
const u = wo([...i.values()].filter(yd), rs), p = /* @__PURE__ */ new Map(), h = [];
|
|
6209
6213
|
for (const b of l) {
|
|
6210
6214
|
const m = i.get(b.id);
|
|
6211
6215
|
if (!m) {
|
|
@@ -6218,7 +6222,7 @@ async function fd(e, t) {
|
|
|
6218
6222
|
}
|
|
6219
6223
|
const f = [];
|
|
6220
6224
|
for (const [b, m] of p) {
|
|
6221
|
-
const g = u.get(b) ?? [], w =
|
|
6225
|
+
const g = u.get(b) ?? [], w = yo(g.map(Td), m);
|
|
6222
6226
|
for (const [I, k] of w) {
|
|
6223
6227
|
const C = i.get(I);
|
|
6224
6228
|
f.push({
|
|
@@ -6230,10 +6234,10 @@ async function fd(e, t) {
|
|
|
6230
6234
|
});
|
|
6231
6235
|
}
|
|
6232
6236
|
}
|
|
6233
|
-
return await
|
|
6237
|
+
return await ko(e, f, h, r, n), { movedIds: s, reorderedIds: r, failures: n };
|
|
6234
6238
|
}
|
|
6235
6239
|
async function bd(e, t) {
|
|
6236
|
-
const s = /* @__PURE__ */ new Set(), r = [], n = await wd(e), i =
|
|
6240
|
+
const s = /* @__PURE__ */ new Set(), r = [], n = await wd(e), i = wo(
|
|
6237
6241
|
[...n.values()].filter((u) => !u.isDeleted && !u.isArchived),
|
|
6238
6242
|
(u) => u.projectId
|
|
6239
6243
|
), a = t.filter((u) => u.order !== void 0), c = /* @__PURE__ */ new Map(), d = [];
|
|
@@ -6256,7 +6260,7 @@ async function bd(e, t) {
|
|
|
6256
6260
|
}
|
|
6257
6261
|
const l = [];
|
|
6258
6262
|
for (const [u, p] of c) {
|
|
6259
|
-
const h = i.get(u) ?? [], f =
|
|
6263
|
+
const h = i.get(u) ?? [], f = yo(
|
|
6260
6264
|
h.map((b) => ({
|
|
6261
6265
|
id: b.id,
|
|
6262
6266
|
key: b.orderKey ?? null,
|
|
@@ -6267,9 +6271,9 @@ async function bd(e, t) {
|
|
|
6267
6271
|
for (const [b, m] of f)
|
|
6268
6272
|
l.push({ id: b, command: ne("section_update", { id: b, orderKey: m }) });
|
|
6269
6273
|
}
|
|
6270
|
-
return await
|
|
6274
|
+
return await ko(e, l, d, s, r), { movedIds: /* @__PURE__ */ new Set(), reorderedIds: s, failures: r };
|
|
6271
6275
|
}
|
|
6272
|
-
function
|
|
6276
|
+
function wo(e, t) {
|
|
6273
6277
|
const s = /* @__PURE__ */ new Map();
|
|
6274
6278
|
for (const r of e) {
|
|
6275
6279
|
const n = t(r), i = s.get(n) ?? [];
|
|
@@ -6277,16 +6281,16 @@ function To(e, t) {
|
|
|
6277
6281
|
}
|
|
6278
6282
|
return s;
|
|
6279
6283
|
}
|
|
6280
|
-
async function
|
|
6284
|
+
async function ko(e, t, s, r, n) {
|
|
6281
6285
|
const i = /* @__PURE__ */ new Set();
|
|
6282
6286
|
if (t.length > 0) {
|
|
6283
|
-
const { outcomes: a } = await
|
|
6287
|
+
const { outcomes: a } = await ve(
|
|
6284
6288
|
e,
|
|
6285
6289
|
t.map((c) => c.command)
|
|
6286
6290
|
);
|
|
6287
6291
|
a.forEach((c, d) => {
|
|
6288
6292
|
const l = t[d]?.id;
|
|
6289
|
-
l === void 0 || c.status === "fulfilled" || (i.add(l), n.push({ item: l, error:
|
|
6293
|
+
l === void 0 || c.status === "fulfilled" || (i.add(l), n.push({ item: l, error: D(c.reason) }));
|
|
6290
6294
|
});
|
|
6291
6295
|
}
|
|
6292
6296
|
for (const { id: a } of s)
|
|
@@ -6338,68 +6342,107 @@ const kd = o.object({
|
|
|
6338
6342
|
}, Id = {
|
|
6339
6343
|
tasks: o.array(V).describe("The rescheduled tasks."),
|
|
6340
6344
|
totalCount: o.number().describe("The total number of tasks rescheduled."),
|
|
6341
|
-
rescheduledTaskIds: o.array(o.string()).describe("The IDs of the rescheduled tasks.")
|
|
6345
|
+
rescheduledTaskIds: o.array(o.string()).describe("The IDs of the rescheduled tasks."),
|
|
6346
|
+
failures: o.array(_).describe("Tasks that could not be rescheduled, with reasons.")
|
|
6342
6347
|
}, Sd = {
|
|
6343
6348
|
name: T.RESCHEDULE_TASKS,
|
|
6344
|
-
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 (and duration, if given), keeping recurrence patterns intact. Use this when moving recurring tasks to a different date or time without altering their repeat pattern.",
|
|
6349
|
+
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 (and duration, if given), keeping recurrence patterns intact. Use this when moving recurring tasks to a different date or time without altering their repeat pattern. Without a due date, the deadline moves.",
|
|
6345
6350
|
parameters: vd,
|
|
6346
6351
|
outputSchema: Id,
|
|
6347
6352
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
6348
6353
|
async execute(e, t) {
|
|
6349
6354
|
const { tasks: s } = e, r = s.map(
|
|
6350
|
-
(
|
|
6351
|
-
), i =
|
|
6352
|
-
s.map(
|
|
6353
|
-
|
|
6354
|
-
|
|
6355
|
-
|
|
6356
|
-
|
|
6357
|
-
if (
|
|
6358
|
-
|
|
6359
|
-
|
|
6360
|
-
|
|
6361
|
-
const h = Cd(
|
|
6362
|
-
|
|
6363
|
-
id:
|
|
6364
|
-
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6369
|
-
lang: u.due.lang ?? void 0
|
|
6370
|
-
},
|
|
6371
|
-
...r[p] && { duration: r[p] }
|
|
6355
|
+
(h) => h.duration ? mt(`Task ${h.id}`, h.duration) : void 0
|
|
6356
|
+
), n = [], i = await Promise.allSettled(
|
|
6357
|
+
s.map((h) => $(() => t.getTask(h.id)))
|
|
6358
|
+
), a = [];
|
|
6359
|
+
i.forEach((h, f) => {
|
|
6360
|
+
const b = s[f];
|
|
6361
|
+
if (!b) return;
|
|
6362
|
+
if (h.status === "rejected") {
|
|
6363
|
+
n.push({ item: b.id, error: D(h.reason) });
|
|
6364
|
+
return;
|
|
6365
|
+
}
|
|
6366
|
+
const m = h.value, g = Cd(b.date, m);
|
|
6367
|
+
g && a.push({
|
|
6368
|
+
id: b.id,
|
|
6369
|
+
command: ne("item_update", {
|
|
6370
|
+
id: b.id,
|
|
6371
|
+
...g,
|
|
6372
|
+
...r[f] && { duration: r[f] }
|
|
6373
|
+
})
|
|
6372
6374
|
});
|
|
6373
6375
|
});
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
|
|
6378
|
-
|
|
6376
|
+
const c = [];
|
|
6377
|
+
if (a.length > 0) {
|
|
6378
|
+
const { outcomes: h } = await ve(
|
|
6379
|
+
t,
|
|
6380
|
+
a.map(({ command: f }) => f)
|
|
6381
|
+
);
|
|
6382
|
+
h.forEach((f, b) => {
|
|
6383
|
+
const m = a[b]?.id ?? `Task ${b + 1}`;
|
|
6384
|
+
f.status === "fulfilled" ? c.push(m) : n.push({ item: m, error: D(f.reason) });
|
|
6385
|
+
});
|
|
6386
|
+
}
|
|
6387
|
+
U(T.RESCHEDULE_TASKS, s.length, n);
|
|
6388
|
+
const d = [], l = [];
|
|
6389
|
+
let u;
|
|
6390
|
+
if (c.length > 0) {
|
|
6391
|
+
const h = await Promise.allSettled(
|
|
6392
|
+
c.map((f) => $(() => t.getTask(f)))
|
|
6393
|
+
);
|
|
6394
|
+
for (const [f, b] of h.entries()) {
|
|
6395
|
+
if (b.status === "fulfilled") {
|
|
6396
|
+
d.push(H(b.value));
|
|
6397
|
+
continue;
|
|
6398
|
+
}
|
|
6399
|
+
l.push(c[f] ?? `Task ${f + 1}`), u ??= D(b.reason);
|
|
6400
|
+
}
|
|
6401
|
+
u && console.error(`${T.RESCHEDULE_TASKS}: read-back failed`, {
|
|
6402
|
+
updated: c.length,
|
|
6403
|
+
unread: l.length,
|
|
6404
|
+
error: u
|
|
6405
|
+
});
|
|
6379
6406
|
}
|
|
6380
|
-
const
|
|
6407
|
+
const p = u ? `Rescheduled ${c.length} task${c.length === 1 ? "" : "s"}: ${c.join(", ")}
|
|
6408
|
+
Could not read back ${l.join(", ")}: ${u}` : kt("Rescheduled", d, {
|
|
6409
|
+
showDetails: d.length <= 5
|
|
6410
|
+
});
|
|
6381
6411
|
return {
|
|
6382
|
-
textContent:
|
|
6383
|
-
showDetails: c.length <= 5
|
|
6384
|
-
}),
|
|
6412
|
+
textContent: P(p, n),
|
|
6385
6413
|
structuredContent: {
|
|
6386
|
-
tasks:
|
|
6414
|
+
tasks: d,
|
|
6387
6415
|
totalCount: c.length,
|
|
6388
|
-
rescheduledTaskIds:
|
|
6416
|
+
rescheduledTaskIds: c,
|
|
6417
|
+
failures: n
|
|
6389
6418
|
}
|
|
6390
6419
|
};
|
|
6391
6420
|
}
|
|
6392
6421
|
};
|
|
6393
6422
|
function Cd(e, t) {
|
|
6423
|
+
if (t.due)
|
|
6424
|
+
return {
|
|
6425
|
+
due: {
|
|
6426
|
+
date: jd(e, t.due),
|
|
6427
|
+
string: t.due.string,
|
|
6428
|
+
isRecurring: t.due.isRecurring,
|
|
6429
|
+
timezone: t.due.timezone ?? void 0,
|
|
6430
|
+
lang: t.due.lang ?? void 0
|
|
6431
|
+
}
|
|
6432
|
+
};
|
|
6433
|
+
if (t.deadline)
|
|
6434
|
+
return { deadline: { date: e.slice(0, 10) } };
|
|
6435
|
+
}
|
|
6436
|
+
function jd(e, t) {
|
|
6394
6437
|
if (/^\d{4}-\d{2}-\d{2}$/.test(e) && t.datetime) {
|
|
6395
6438
|
const r = t.datetime.substring(10);
|
|
6396
6439
|
return e + r;
|
|
6397
6440
|
}
|
|
6398
6441
|
return e;
|
|
6399
6442
|
}
|
|
6400
|
-
const
|
|
6443
|
+
const $d = {
|
|
6401
6444
|
query: o.string().min(1).describe("The search query string to find tasks and projects.")
|
|
6402
|
-
},
|
|
6445
|
+
}, Ad = {
|
|
6403
6446
|
results: o.array(
|
|
6404
6447
|
o.object({
|
|
6405
6448
|
id: o.string().describe("The ID of the result."),
|
|
@@ -6408,21 +6451,21 @@ const jd = {
|
|
|
6408
6451
|
})
|
|
6409
6452
|
).describe("The search results."),
|
|
6410
6453
|
totalCount: o.number().describe("Total number of results found.")
|
|
6411
|
-
},
|
|
6454
|
+
}, Ed = {
|
|
6412
6455
|
name: T.SEARCH,
|
|
6413
6456
|
description: "Search across tasks and projects in Todoist. Returns a list of relevant results with IDs, titles, and URLs.",
|
|
6414
|
-
parameters:
|
|
6415
|
-
outputSchema:
|
|
6457
|
+
parameters: $d,
|
|
6458
|
+
outputSchema: Ad,
|
|
6416
6459
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
6417
6460
|
async execute(e, t) {
|
|
6418
6461
|
const { query: s } = e, [r, n] = await Promise.all([
|
|
6419
6462
|
Tt({
|
|
6420
6463
|
client: t,
|
|
6421
6464
|
query: `search: ${ws(s)}`,
|
|
6422
|
-
limit:
|
|
6465
|
+
limit: E.TASKS_MAX,
|
|
6423
6466
|
cursor: void 0
|
|
6424
6467
|
}),
|
|
6425
|
-
|
|
6468
|
+
Ws(t, s)
|
|
6426
6469
|
]), i = [];
|
|
6427
6470
|
for (const a of r.tasks)
|
|
6428
6471
|
i.push({
|
|
@@ -6441,7 +6484,7 @@ const jd = {
|
|
|
6441
6484
|
structuredContent: { results: i, totalCount: i.length }
|
|
6442
6485
|
};
|
|
6443
6486
|
}
|
|
6444
|
-
}, Dd = 80,
|
|
6487
|
+
}, Dd = 80, xd = {
|
|
6445
6488
|
message: o.string().trim().min(1).max(Dd).optional().describe("Required unless clear is true."),
|
|
6446
6489
|
emoji: o.string().trim().min(1).optional().describe("A Unicode emoji, such as 🏝️."),
|
|
6447
6490
|
activeUntil: o.string().trim().optional().describe(
|
|
@@ -6450,20 +6493,20 @@ const jd = {
|
|
|
6450
6493
|
pauseNotifications: o.boolean().optional().describe("Hold back Comms notifications while active. They are not sent later."),
|
|
6451
6494
|
pauseActivity: o.boolean().optional().describe("Pause Karma and streaks while active."),
|
|
6452
6495
|
clear: o.boolean().optional().describe("Remove the status. Use alone.")
|
|
6453
|
-
},
|
|
6496
|
+
}, Od = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(Z|([+-])(\d{2}):(\d{2}))$/i, Ud = -720, _d = 840;
|
|
6454
6497
|
function Be(e) {
|
|
6455
6498
|
return new Error(
|
|
6456
6499
|
`activeUntil must be an ISO 8601 timestamp with Z or an offset, such as "2026-11-10T00:00:00+00:00". Got "${e}".`
|
|
6457
6500
|
);
|
|
6458
6501
|
}
|
|
6459
|
-
function
|
|
6460
|
-
const s =
|
|
6502
|
+
function Rd(e, t) {
|
|
6503
|
+
const s = Od.exec(e);
|
|
6461
6504
|
if (!s)
|
|
6462
6505
|
throw Be(e);
|
|
6463
6506
|
const [, r, n, i, a, c, d = "0", l = ""] = s, [u, p, h, f, b, m] = [r, n, i, a, c, d].map(Number), g = /* @__PURE__ */ new Date(0);
|
|
6464
6507
|
g.setUTCFullYear(u, p - 1, h), g.setUTCHours(f, b, m);
|
|
6465
|
-
const w = g.getUTCFullYear() === u && g.getUTCMonth() === p - 1 && g.getUTCDate() === h && g.getUTCHours() === f && g.getUTCMinutes() === b && g.getUTCSeconds() === m, I = l.toUpperCase() === "Z" ? 0 :
|
|
6466
|
-
if (!w || I <
|
|
6508
|
+
const w = g.getUTCFullYear() === u && g.getUTCMonth() === p - 1 && g.getUTCDate() === h && g.getUTCHours() === f && g.getUTCMinutes() === b && g.getUTCSeconds() === m, I = l.toUpperCase() === "Z" ? 0 : ro(l);
|
|
6509
|
+
if (!w || I < Ud || I > _d)
|
|
6467
6510
|
throw Be(e);
|
|
6468
6511
|
const k = new Date(e);
|
|
6469
6512
|
if (Number.isNaN(k.getTime()))
|
|
@@ -6485,7 +6528,7 @@ function Pd(e, t) {
|
|
|
6485
6528
|
return {
|
|
6486
6529
|
message: r,
|
|
6487
6530
|
emoji: n ?? null,
|
|
6488
|
-
activeUntil: i !== void 0 ?
|
|
6531
|
+
activeUntil: i !== void 0 ? Rd(i, t) : null,
|
|
6489
6532
|
effects: a || c ? {
|
|
6490
6533
|
pauseNotifications: a ? is : null,
|
|
6491
6534
|
pauseActivity: c ? is : null
|
|
@@ -6495,15 +6538,15 @@ function Pd(e, t) {
|
|
|
6495
6538
|
function as(e) {
|
|
6496
6539
|
return e ? e.replace(/\uFE0F/g, "") : null;
|
|
6497
6540
|
}
|
|
6498
|
-
function
|
|
6541
|
+
function Nd(e, t) {
|
|
6499
6542
|
const s = e.activeUntil ? new Date(e.activeUntil).getTime() : null, r = t.activeUntil ? new Date(t.activeUntil).getTime() : null;
|
|
6500
6543
|
return e.message === t.message && as(e.emoji) === as(t.emoji) && s === r && !!e.effects?.pauseNotifications == !!t.effects?.pauseNotifications && !!e.effects?.pauseActivity == !!t.effects?.pauseActivity;
|
|
6501
6544
|
}
|
|
6502
|
-
const
|
|
6545
|
+
const Ld = {
|
|
6503
6546
|
name: T.SET_USER_STATUS,
|
|
6504
6547
|
description: "Set or clear the user's status, shown next to their name in Todoist and Comms. Replaces the whole status: an omitted emoji, end or effect is removed, not kept. Use clear to remove the status.",
|
|
6505
|
-
parameters:
|
|
6506
|
-
outputSchema:
|
|
6548
|
+
parameters: xd,
|
|
6549
|
+
outputSchema: fo,
|
|
6507
6550
|
annotations: {
|
|
6508
6551
|
readOnlyHint: !1,
|
|
6509
6552
|
destructiveHint: !0,
|
|
@@ -6513,10 +6556,10 @@ const Nd = {
|
|
|
6513
6556
|
async execute(e, t) {
|
|
6514
6557
|
const s = Pd(e, /* @__PURE__ */ new Date()), {
|
|
6515
6558
|
outcomes: [r]
|
|
6516
|
-
} = await
|
|
6559
|
+
} = await ve(t, [ne("user_update", { status: s })]);
|
|
6517
6560
|
if (r?.status !== "fulfilled")
|
|
6518
6561
|
throw r?.reason ?? new Error("Todoist did not report whether the status was applied.");
|
|
6519
|
-
const n = await
|
|
6562
|
+
const n = await bo(t).catch(() => {
|
|
6520
6563
|
throw new Error(
|
|
6521
6564
|
`The status was written, but reading it back failed, so it is unconfirmed. Use ${T.GET_USER_STATUS} to check it.`
|
|
6522
6565
|
);
|
|
@@ -6532,25 +6575,25 @@ const Nd = {
|
|
|
6532
6575
|
throw new Error(
|
|
6533
6576
|
"Todoist accepted the status but reports no active status, so it may have expired already."
|
|
6534
6577
|
);
|
|
6535
|
-
if (!
|
|
6578
|
+
if (!Nd(n, s))
|
|
6536
6579
|
throw new Error(
|
|
6537
6580
|
`Todoist accepted the status but reports a different one. Another app may have changed it at the same moment; use ${T.GET_USER_STATUS} to see it.`
|
|
6538
6581
|
);
|
|
6539
6582
|
return it(n, "Status set");
|
|
6540
6583
|
}
|
|
6541
|
-
}, Ld = {
|
|
6542
|
-
ids: o.array(o.string().min(1)).min(1).describe("The IDs of the tasks to uncomplete.")
|
|
6543
6584
|
}, Md = {
|
|
6585
|
+
ids: o.array(o.string().min(1)).min(1).describe("The IDs of the tasks to uncomplete.")
|
|
6586
|
+
}, Fd = {
|
|
6544
6587
|
uncompleted: o.array(o.string()).describe("The IDs of successfully uncompleted tasks."),
|
|
6545
6588
|
failures: o.array(_).describe("Failed task uncompletion with error details."),
|
|
6546
6589
|
totalRequested: o.number().describe("The total number of tasks requested to uncomplete."),
|
|
6547
6590
|
successCount: o.number().describe("The number of successfully uncompleted tasks."),
|
|
6548
6591
|
failureCount: o.number().describe("The number of failed task uncompletions.")
|
|
6549
|
-
},
|
|
6592
|
+
}, Hd = {
|
|
6550
6593
|
name: T.UNCOMPLETE_TASKS,
|
|
6551
6594
|
description: "Uncomplete (reopen) one or more completed tasks by their IDs.",
|
|
6552
|
-
parameters:
|
|
6553
|
-
outputSchema:
|
|
6595
|
+
parameters: Md,
|
|
6596
|
+
outputSchema: Fd,
|
|
6554
6597
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
6555
6598
|
async execute(e, t) {
|
|
6556
6599
|
const s = [], r = [];
|
|
@@ -6560,11 +6603,11 @@ const Nd = {
|
|
|
6560
6603
|
} catch (a) {
|
|
6561
6604
|
r.push({
|
|
6562
6605
|
item: i,
|
|
6563
|
-
error:
|
|
6606
|
+
error: D(a)
|
|
6564
6607
|
});
|
|
6565
6608
|
}
|
|
6566
6609
|
return U(T.UNCOMPLETE_TASKS, e.ids.length, r), {
|
|
6567
|
-
textContent:
|
|
6610
|
+
textContent: Wd({
|
|
6568
6611
|
uncompleted: s,
|
|
6569
6612
|
failures: r,
|
|
6570
6613
|
args: e
|
|
@@ -6579,7 +6622,7 @@ const Nd = {
|
|
|
6579
6622
|
};
|
|
6580
6623
|
}
|
|
6581
6624
|
};
|
|
6582
|
-
function
|
|
6625
|
+
function Wd({
|
|
6583
6626
|
uncompleted: e,
|
|
6584
6627
|
failures: t,
|
|
6585
6628
|
args: s
|
|
@@ -6593,13 +6636,13 @@ function Hd({
|
|
|
6593
6636
|
failures: t
|
|
6594
6637
|
});
|
|
6595
6638
|
}
|
|
6596
|
-
const
|
|
6639
|
+
const Bd = o.object({
|
|
6597
6640
|
id: o.string().min(1).describe("The ID of the comment to update."),
|
|
6598
6641
|
content: o.string().min(1).describe("The new content for the comment.")
|
|
6599
|
-
}),
|
|
6600
|
-
comments: o.array(
|
|
6601
|
-
},
|
|
6602
|
-
comments: o.array(
|
|
6642
|
+
}), Kd = {
|
|
6643
|
+
comments: o.array(Bd).min(1).describe("The comments to update.")
|
|
6644
|
+
}, qd = {
|
|
6645
|
+
comments: o.array(Ae).describe("The updated comments."),
|
|
6603
6646
|
totalCount: o.number().describe("The total number of comments updated."),
|
|
6604
6647
|
updatedCommentIds: o.array(o.string()).describe("The IDs of the updated comments."),
|
|
6605
6648
|
failures: o.array(_).describe("Comments that could not be updated, with the reason for each."),
|
|
@@ -6607,11 +6650,11 @@ const Wd = o.object({
|
|
|
6607
6650
|
updateCount: o.number().describe("The number of comments updated."),
|
|
6608
6651
|
failureCount: o.number()
|
|
6609
6652
|
}).describe("Summary of operations performed.")
|
|
6610
|
-
},
|
|
6653
|
+
}, Gd = {
|
|
6611
6654
|
name: T.UPDATE_COMMENTS,
|
|
6612
6655
|
description: "Update multiple existing comments with new content.",
|
|
6613
|
-
parameters:
|
|
6614
|
-
outputSchema:
|
|
6656
|
+
parameters: Kd,
|
|
6657
|
+
outputSchema: qd,
|
|
6615
6658
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
6616
6659
|
async execute(e, t) {
|
|
6617
6660
|
const { comments: s } = e, r = await Promise.allSettled(
|
|
@@ -6622,13 +6665,13 @@ const Wd = o.object({
|
|
|
6622
6665
|
)
|
|
6623
6666
|
), n = [], i = [];
|
|
6624
6667
|
return r.forEach((c, d) => {
|
|
6625
|
-
c.status === "fulfilled" ? n.push(
|
|
6668
|
+
c.status === "fulfilled" ? n.push($e(c.value)) : i.push({
|
|
6626
6669
|
item: s[d]?.id ?? `Comment ${d + 1}`,
|
|
6627
|
-
error:
|
|
6670
|
+
error: D(c.reason)
|
|
6628
6671
|
});
|
|
6629
6672
|
}), U(T.UPDATE_COMMENTS, s.length, i), {
|
|
6630
|
-
textContent:
|
|
6631
|
-
|
|
6673
|
+
textContent: P(
|
|
6674
|
+
zd({ comments: n }),
|
|
6632
6675
|
i
|
|
6633
6676
|
),
|
|
6634
6677
|
structuredContent: {
|
|
@@ -6644,7 +6687,7 @@ const Wd = o.object({
|
|
|
6644
6687
|
};
|
|
6645
6688
|
}
|
|
6646
6689
|
};
|
|
6647
|
-
function
|
|
6690
|
+
function zd({ comments: e }) {
|
|
6648
6691
|
const t = e.filter((i) => i.taskId).length, s = e.filter((i) => i.projectId).length, r = [];
|
|
6649
6692
|
if (t > 0) {
|
|
6650
6693
|
const i = t > 1 ? "comments" : "comment";
|
|
@@ -6656,7 +6699,7 @@ function Gd({ comments: e }) {
|
|
|
6656
6699
|
}
|
|
6657
6700
|
return r.length > 0 ? `Updated ${r.join(" and ")}` : "No comments updated";
|
|
6658
6701
|
}
|
|
6659
|
-
const
|
|
6702
|
+
const Yd = o.object({
|
|
6660
6703
|
id: o.string().min(1).describe("The ID of the filter to update."),
|
|
6661
6704
|
name: o.string().min(1).optional().describe("The new name of the filter."),
|
|
6662
6705
|
query: o.string().min(1).optional().describe(
|
|
@@ -6671,9 +6714,9 @@ const zd = o.object({
|
|
|
6671
6714
|
).optional(),
|
|
6672
6715
|
color: Te,
|
|
6673
6716
|
isFavorite: o.boolean().optional().describe("Whether to mark the filter as a favorite.")
|
|
6674
|
-
}),
|
|
6675
|
-
filters: o.array(
|
|
6676
|
-
},
|
|
6717
|
+
}), Vd = {
|
|
6718
|
+
filters: o.array(Yd).min(1).describe("The filters to update.")
|
|
6719
|
+
}, Jd = {
|
|
6677
6720
|
filters: o.array(It).describe(
|
|
6678
6721
|
"The updated filters, as read back after the update. Empty if they could not be read back; updatedFilterIds still lists what was updated."
|
|
6679
6722
|
),
|
|
@@ -6685,15 +6728,15 @@ const zd = o.object({
|
|
|
6685
6728
|
skippedCount: o.number().describe("The number of filters skipped (no changes)."),
|
|
6686
6729
|
failureCount: o.number()
|
|
6687
6730
|
}).describe("Summary of operations performed.")
|
|
6688
|
-
},
|
|
6731
|
+
}, Xd = {
|
|
6689
6732
|
name: T.UPDATE_FILTERS,
|
|
6690
6733
|
description: "Update one or more existing personal filters with new values.",
|
|
6691
|
-
parameters:
|
|
6692
|
-
outputSchema:
|
|
6734
|
+
parameters: Vd,
|
|
6735
|
+
outputSchema: Jd,
|
|
6693
6736
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
6694
6737
|
async execute(e, t) {
|
|
6695
6738
|
const { filters: s } = e, r = [], i = s.map((f) => {
|
|
6696
|
-
const b =
|
|
6739
|
+
const b = el(f);
|
|
6697
6740
|
return b !== null ? { kind: "skipped", reason: b } : (r.push(f), { kind: "updated", filter: f });
|
|
6698
6741
|
}).filter((f) => f.kind === "skipped").length;
|
|
6699
6742
|
if (r.length === 0)
|
|
@@ -6716,10 +6759,10 @@ const zd = o.object({
|
|
|
6716
6759
|
...g !== void 0 ? { description: g === "remove" ? null : g } : {},
|
|
6717
6760
|
...m !== void 0 ? { color: m } : {}
|
|
6718
6761
|
});
|
|
6719
|
-
}), { outcomes: c } = await
|
|
6762
|
+
}), { outcomes: c } = await ve(t, a), d = [], l = [];
|
|
6720
6763
|
c.forEach((f, b) => {
|
|
6721
6764
|
const m = r[b]?.id ?? `Filter ${b + 1}`;
|
|
6722
|
-
f.status === "fulfilled" ? d.push(m) : l.push({ item: m, error:
|
|
6765
|
+
f.status === "fulfilled" ? d.push(m) : l.push({ item: m, error: D(f.reason) });
|
|
6723
6766
|
}), U(T.UPDATE_FILTERS, s.length, l);
|
|
6724
6767
|
let u = [], p;
|
|
6725
6768
|
if (d.length > 0) {
|
|
@@ -6729,16 +6772,16 @@ const zd = o.object({
|
|
|
6729
6772
|
() => t.sync({ resourceTypes: ["filters"], syncToken: "*" })
|
|
6730
6773
|
)).filters ?? [];
|
|
6731
6774
|
} catch (b) {
|
|
6732
|
-
p =
|
|
6775
|
+
p = D(b), console.error(`${T.UPDATE_FILTERS}: read-back failed`, {
|
|
6733
6776
|
updated: d.length,
|
|
6734
6777
|
error: p
|
|
6735
6778
|
});
|
|
6736
6779
|
}
|
|
6737
|
-
f && (u =
|
|
6780
|
+
f && (u = Zd(f, new Set(d)));
|
|
6738
6781
|
}
|
|
6739
6782
|
return {
|
|
6740
|
-
textContent:
|
|
6741
|
-
|
|
6783
|
+
textContent: P(
|
|
6784
|
+
Qd({
|
|
6742
6785
|
filters: u,
|
|
6743
6786
|
updatedIds: d,
|
|
6744
6787
|
skippedCount: i,
|
|
@@ -6760,18 +6803,18 @@ const zd = o.object({
|
|
|
6760
6803
|
};
|
|
6761
6804
|
}
|
|
6762
6805
|
};
|
|
6763
|
-
function
|
|
6806
|
+
function Zd(e, t) {
|
|
6764
6807
|
return e.filter((s) => !s.isDeleted && t.has(s.id)).map((s) => ({
|
|
6765
6808
|
id: s.id,
|
|
6766
6809
|
name: s.name,
|
|
6767
6810
|
query: s.query,
|
|
6768
|
-
description:
|
|
6811
|
+
description: zs(s),
|
|
6769
6812
|
color: we.parse(s.color),
|
|
6770
6813
|
isFavorite: s.isFavorite,
|
|
6771
6814
|
itemOrder: s.itemOrder
|
|
6772
6815
|
}));
|
|
6773
6816
|
}
|
|
6774
|
-
function
|
|
6817
|
+
function Qd({
|
|
6775
6818
|
filters: e,
|
|
6776
6819
|
updatedIds: t,
|
|
6777
6820
|
skippedCount: s,
|
|
@@ -6790,35 +6833,35 @@ ${a}`;
|
|
|
6790
6833
|
}
|
|
6791
6834
|
return i;
|
|
6792
6835
|
}
|
|
6793
|
-
function
|
|
6836
|
+
function el({ id: e, ...t }) {
|
|
6794
6837
|
return Object.values(t).every((r) => r === void 0) ? "no-fields" : null;
|
|
6795
6838
|
}
|
|
6796
|
-
const
|
|
6839
|
+
const tl = o.object({
|
|
6797
6840
|
labelType: o.literal("personal").describe("Update a personal label, identified by its ID."),
|
|
6798
6841
|
id: o.string().min(1).describe("The ID of the personal label to update."),
|
|
6799
6842
|
name: o.string().min(1).max(128).optional().describe("The new name of the label."),
|
|
6800
6843
|
color: Te,
|
|
6801
6844
|
order: o.number().int().optional().describe("The new position of the label in the label list."),
|
|
6802
6845
|
isFavorite: o.boolean().optional().describe("Whether to mark the label as a favorite.")
|
|
6803
|
-
}),
|
|
6846
|
+
}), sl = o.object({
|
|
6804
6847
|
labelType: o.literal("shared").describe(
|
|
6805
6848
|
"Rename a shared label across all tasks. Shared labels are identified by name; only renaming is supported (no color, order, or favorite)."
|
|
6806
6849
|
),
|
|
6807
6850
|
name: o.string().min(1).describe("The current name of the shared label."),
|
|
6808
6851
|
newName: o.string().min(1).describe("The new name for the shared label.")
|
|
6809
|
-
}),
|
|
6810
|
-
|
|
6811
|
-
|
|
6812
|
-
]),
|
|
6813
|
-
labels: o.array(
|
|
6852
|
+
}), ol = o.discriminatedUnion("labelType", [
|
|
6853
|
+
tl,
|
|
6854
|
+
sl
|
|
6855
|
+
]), rl = {
|
|
6856
|
+
labels: o.array(ol).min(1).describe(
|
|
6814
6857
|
'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.'
|
|
6815
6858
|
)
|
|
6816
|
-
},
|
|
6859
|
+
}, nl = o.object({
|
|
6817
6860
|
name: o.string().describe("The previous name of the shared label."),
|
|
6818
6861
|
newName: o.string().describe("The new name of the shared label.")
|
|
6819
|
-
}),
|
|
6862
|
+
}), il = {
|
|
6820
6863
|
updatedLabels: o.array(ke).describe("The updated personal labels."),
|
|
6821
|
-
renamedSharedLabels: o.array(
|
|
6864
|
+
renamedSharedLabels: o.array(nl).describe("The shared labels that were renamed."),
|
|
6822
6865
|
totalCount: o.number().describe("The total number of successful operations (personal + shared)."),
|
|
6823
6866
|
failures: o.array(_).describe(
|
|
6824
6867
|
"Labels that could not be updated, identified by ID (personal) or name (shared), with the reason for each."
|
|
@@ -6829,17 +6872,17 @@ const el = o.object({
|
|
|
6829
6872
|
skippedCount: o.number().describe("Number of operations skipped (no changes or shared label not found)."),
|
|
6830
6873
|
failureCount: o.number()
|
|
6831
6874
|
}).describe("Summary of operations performed.")
|
|
6832
|
-
},
|
|
6875
|
+
}, al = {
|
|
6833
6876
|
name: T.UPDATE_LABELS,
|
|
6834
6877
|
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.",
|
|
6835
|
-
parameters:
|
|
6836
|
-
outputSchema:
|
|
6878
|
+
parameters: rl,
|
|
6879
|
+
outputSchema: il,
|
|
6837
6880
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
6838
6881
|
async execute(e, t) {
|
|
6839
6882
|
const { labels: s } = e, r = await Promise.allSettled(
|
|
6840
6883
|
s.map(async (h) => {
|
|
6841
6884
|
if (h.labelType === "personal") {
|
|
6842
|
-
const b =
|
|
6885
|
+
const b = dl(h);
|
|
6843
6886
|
if (b !== null) return { kind: "skipped", reason: b };
|
|
6844
6887
|
const { id: m, labelType: g, ...w } = h;
|
|
6845
6888
|
return { kind: "updated", label: await $(() => t.updateLabel(m, w)) };
|
|
@@ -6857,7 +6900,7 @@ const el = o.object({
|
|
|
6857
6900
|
const b = s[f];
|
|
6858
6901
|
i.push({
|
|
6859
6902
|
item: b ? b.labelType === "personal" ? b.id : b.name : `Label ${f + 1}`,
|
|
6860
|
-
error:
|
|
6903
|
+
error: D(h.reason)
|
|
6861
6904
|
});
|
|
6862
6905
|
}), U(T.UPDATE_LABELS, s.length, i, { redactItems: !0 });
|
|
6863
6906
|
const a = n.filter((h) => h.kind === "updated").map((h) => ke.parse(h.label)), c = n.filter(
|
|
@@ -6868,8 +6911,8 @@ const el = o.object({
|
|
|
6868
6911
|
(h) => h.kind === "skipped" && h.reason === "not-found"
|
|
6869
6912
|
).length;
|
|
6870
6913
|
return {
|
|
6871
|
-
textContent:
|
|
6872
|
-
|
|
6914
|
+
textContent: P(
|
|
6915
|
+
cl({
|
|
6873
6916
|
updatedLabels: a,
|
|
6874
6917
|
renamedSharedLabels: c,
|
|
6875
6918
|
skippedNoFields: l,
|
|
@@ -6892,7 +6935,7 @@ const el = o.object({
|
|
|
6892
6935
|
};
|
|
6893
6936
|
}
|
|
6894
6937
|
};
|
|
6895
|
-
function
|
|
6938
|
+
function cl({
|
|
6896
6939
|
updatedLabels: e,
|
|
6897
6940
|
renamedSharedLabels: t,
|
|
6898
6941
|
skippedNoFields: s,
|
|
@@ -6914,14 +6957,14 @@ function al({
|
|
|
6914
6957
|
return c.join(`
|
|
6915
6958
|
`);
|
|
6916
6959
|
}
|
|
6917
|
-
function
|
|
6960
|
+
function dl({
|
|
6918
6961
|
id: e,
|
|
6919
6962
|
labelType: t,
|
|
6920
6963
|
...s
|
|
6921
6964
|
}) {
|
|
6922
6965
|
return Object.values(s).every((n) => n === void 0) ? "no-fields" : null;
|
|
6923
6966
|
}
|
|
6924
|
-
const
|
|
6967
|
+
const ll = o.object({
|
|
6925
6968
|
id: o.string().min(1).describe("The ID of the project to update."),
|
|
6926
6969
|
name: o.string().min(1).optional().describe("The new name of the project."),
|
|
6927
6970
|
isFavorite: o.boolean().optional().describe("Whether the project is a favorite."),
|
|
@@ -6936,9 +6979,9 @@ const dl = o.object({
|
|
|
6936
6979
|
)
|
|
6937
6980
|
).optional(),
|
|
6938
6981
|
color: Te
|
|
6939
|
-
}),
|
|
6940
|
-
projects: o.array(
|
|
6941
|
-
},
|
|
6982
|
+
}), ul = {
|
|
6983
|
+
projects: o.array(ll).min(1).describe("The projects to update.")
|
|
6984
|
+
}, pl = {
|
|
6942
6985
|
projects: o.array(de).describe("The updated projects."),
|
|
6943
6986
|
totalCount: o.number().describe("The total number of projects updated."),
|
|
6944
6987
|
updatedProjectIds: o.array(o.string()).describe("The IDs of the updated projects."),
|
|
@@ -6948,16 +6991,16 @@ const dl = o.object({
|
|
|
6948
6991
|
skippedCount: o.number().describe("The number of projects skipped (no changes)."),
|
|
6949
6992
|
failureCount: o.number()
|
|
6950
6993
|
}).describe("Summary of operations performed.")
|
|
6951
|
-
},
|
|
6994
|
+
}, hl = {
|
|
6952
6995
|
name: T.UPDATE_PROJECTS,
|
|
6953
6996
|
description: "Update multiple existing projects with new values.",
|
|
6954
|
-
parameters:
|
|
6955
|
-
outputSchema:
|
|
6997
|
+
parameters: ul,
|
|
6998
|
+
outputSchema: pl,
|
|
6956
6999
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
6957
7000
|
async execute(e, t) {
|
|
6958
7001
|
const { projects: s } = e, r = await Promise.allSettled(
|
|
6959
7002
|
s.map(async (l) => {
|
|
6960
|
-
const u =
|
|
7003
|
+
const u = fl(l);
|
|
6961
7004
|
if (u !== null) return { kind: "skipped", reason: u };
|
|
6962
7005
|
const { id: p, ...h } = l;
|
|
6963
7006
|
return { kind: "updated", project: await $(() => t.updateProject(p, h)) };
|
|
@@ -6968,14 +7011,14 @@ const dl = o.object({
|
|
|
6968
7011
|
if (u.status === "rejected") {
|
|
6969
7012
|
i.push({
|
|
6970
7013
|
item: s[l]?.id ?? `Project ${l + 1}`,
|
|
6971
|
-
error:
|
|
7014
|
+
error: D(u.reason)
|
|
6972
7015
|
});
|
|
6973
7016
|
continue;
|
|
6974
7017
|
}
|
|
6975
7018
|
u.value.kind === "updated" ? n.push(ce(u.value.project)) : u.value.reason === "no-fields" ? a++ : c++;
|
|
6976
7019
|
}
|
|
6977
7020
|
return U(T.UPDATE_PROJECTS, s.length, i), {
|
|
6978
|
-
textContent:
|
|
7021
|
+
textContent: ml({
|
|
6979
7022
|
projects: n,
|
|
6980
7023
|
skippedNoFields: a,
|
|
6981
7024
|
skippedNoValidValues: c,
|
|
@@ -6995,7 +7038,7 @@ const dl = o.object({
|
|
|
6995
7038
|
};
|
|
6996
7039
|
}
|
|
6997
7040
|
};
|
|
6998
|
-
function
|
|
7041
|
+
function ml({
|
|
6999
7042
|
projects: e,
|
|
7000
7043
|
skippedNoFields: t,
|
|
7001
7044
|
skippedNoValidValues: s,
|
|
@@ -7006,46 +7049,46 @@ function hl({
|
|
|
7006
7049
|
let a = `Updated ${n} project${n === 1 ? "" : "s"}`;
|
|
7007
7050
|
const c = [];
|
|
7008
7051
|
return t > 0 && c.push(`${t} skipped - no changes`), s > 0 && c.push(`${s} skipped - no valid field values`), c.length > 0 && (a += ` (${c.join(", ")})`), n > 0 && (a += `:
|
|
7009
|
-
${i}`),
|
|
7052
|
+
${i}`), P(a, r);
|
|
7010
7053
|
}
|
|
7011
|
-
function
|
|
7054
|
+
function fl({ id: e, ...t }) {
|
|
7012
7055
|
const s = Object.values(t);
|
|
7013
7056
|
return s.length === 0 ? "no-fields" : s.every((r) => r === void 0) ? "no-valid-values" : null;
|
|
7014
7057
|
}
|
|
7015
|
-
const
|
|
7058
|
+
const bl = o.object({
|
|
7016
7059
|
type: o.literal("relative"),
|
|
7017
7060
|
id: o.string().min(1).describe("The ID of the relative reminder to update."),
|
|
7018
7061
|
minuteOffset: o.number().int().min(0).optional().describe("New minute offset before task due time."),
|
|
7019
|
-
service:
|
|
7020
|
-
isUrgent:
|
|
7062
|
+
service: Re.optional().describe('New delivery method: "email" or "push".'),
|
|
7063
|
+
isUrgent: Pe,
|
|
7021
7064
|
notifyUser: $t
|
|
7022
|
-
}),
|
|
7065
|
+
}), gl = o.object({
|
|
7023
7066
|
type: o.literal("absolute"),
|
|
7024
7067
|
id: o.string().min(1).describe("The ID of the absolute reminder to update."),
|
|
7025
|
-
due:
|
|
7026
|
-
service:
|
|
7027
|
-
isUrgent:
|
|
7068
|
+
due: Xs.optional().describe("New due date/time for the reminder."),
|
|
7069
|
+
service: Re.optional().describe('New delivery method: "email" or "push".'),
|
|
7070
|
+
isUrgent: Pe,
|
|
7028
7071
|
notifyUser: $t
|
|
7029
|
-
}),
|
|
7072
|
+
}), yl = o.object({
|
|
7030
7073
|
type: o.literal("location"),
|
|
7031
7074
|
id: o.string().min(1).describe("The ID of the location reminder to update."),
|
|
7032
7075
|
name: o.string().optional().describe("New location name."),
|
|
7033
7076
|
locLat: o.string().optional().describe("New latitude."),
|
|
7034
7077
|
locLong: o.string().optional().describe("New longitude."),
|
|
7035
|
-
locTrigger:
|
|
7078
|
+
locTrigger: Zs.optional().describe(
|
|
7036
7079
|
'New trigger condition: "on_enter" or "on_leave".'
|
|
7037
7080
|
),
|
|
7038
7081
|
radius: o.number().int().optional().describe("New radius in meters."),
|
|
7039
7082
|
notifyUser: $t
|
|
7040
|
-
}),
|
|
7041
|
-
fl,
|
|
7083
|
+
}), Tl = o.discriminatedUnion("type", [
|
|
7042
7084
|
bl,
|
|
7043
|
-
gl
|
|
7044
|
-
|
|
7045
|
-
|
|
7085
|
+
gl,
|
|
7086
|
+
yl
|
|
7087
|
+
]), wl = {
|
|
7088
|
+
reminders: o.array(Tl).min(1).max(xe).describe(
|
|
7046
7089
|
`Array of reminders to update (max ${xe}). Each must include the reminder type and ID. Only include fields that need to change.`
|
|
7047
7090
|
)
|
|
7048
|
-
},
|
|
7091
|
+
}, kl = {
|
|
7049
7092
|
reminders: o.array(wt).describe("The updated reminders."),
|
|
7050
7093
|
totalCount: o.number().describe("Total reminders updated."),
|
|
7051
7094
|
updatedReminderIds: o.array(o.string()).describe("IDs of updated reminders."),
|
|
@@ -7054,11 +7097,11 @@ const fl = o.object({
|
|
|
7054
7097
|
updateCount: o.number(),
|
|
7055
7098
|
failureCount: o.number()
|
|
7056
7099
|
})
|
|
7057
|
-
},
|
|
7100
|
+
}, vl = {
|
|
7058
7101
|
name: T.UPDATE_REMINDERS,
|
|
7059
7102
|
description: 'Update existing reminders. Each reminder must specify its type ("relative", "absolute", or "location") and ID. Only include fields that need to change.',
|
|
7060
|
-
parameters:
|
|
7061
|
-
outputSchema:
|
|
7103
|
+
parameters: wl,
|
|
7104
|
+
outputSchema: kl,
|
|
7062
7105
|
annotations: {
|
|
7063
7106
|
readOnlyHint: !1,
|
|
7064
7107
|
destructiveHint: !0,
|
|
@@ -7066,7 +7109,7 @@ const fl = o.object({
|
|
|
7066
7109
|
openWorldHint: !0
|
|
7067
7110
|
},
|
|
7068
7111
|
async execute(e, t) {
|
|
7069
|
-
const { reminders: s } = e, r = await
|
|
7112
|
+
const { reminders: s } = e, r = await Vs(
|
|
7070
7113
|
t,
|
|
7071
7114
|
s.map((u) => u.notifyUser)
|
|
7072
7115
|
), n = await Promise.allSettled(
|
|
@@ -7107,21 +7150,21 @@ const fl = o.object({
|
|
|
7107
7150
|
), i = [], a = [], c = [];
|
|
7108
7151
|
n.forEach((u, p) => {
|
|
7109
7152
|
if (u.status === "fulfilled") {
|
|
7110
|
-
i.push(
|
|
7153
|
+
i.push(je(u.value));
|
|
7111
7154
|
const h = r[p];
|
|
7112
7155
|
a.push(h?.status === "fulfilled" ? h.value : void 0);
|
|
7113
7156
|
} else
|
|
7114
7157
|
c.push({
|
|
7115
7158
|
item: s[p]?.id ?? `Reminder ${p + 1}`,
|
|
7116
|
-
error:
|
|
7159
|
+
error: D(u.reason)
|
|
7117
7160
|
});
|
|
7118
7161
|
}), U(T.UPDATE_REMINDERS, s.length, c);
|
|
7119
7162
|
const d = i.length === 1 ? "reminder" : "reminders";
|
|
7120
7163
|
return {
|
|
7121
|
-
textContent:
|
|
7164
|
+
textContent: P(
|
|
7122
7165
|
[
|
|
7123
7166
|
`Updated ${i.length} ${d}`,
|
|
7124
|
-
...
|
|
7167
|
+
...Js(i, a)
|
|
7125
7168
|
].join(`
|
|
7126
7169
|
`),
|
|
7127
7170
|
c
|
|
@@ -7138,7 +7181,7 @@ const fl = o.object({
|
|
|
7138
7181
|
}
|
|
7139
7182
|
};
|
|
7140
7183
|
}
|
|
7141
|
-
},
|
|
7184
|
+
}, Il = o.object({
|
|
7142
7185
|
id: o.string().min(1).describe("The ID of the section to update."),
|
|
7143
7186
|
name: o.string().min(1).optional().describe("The new name of the section."),
|
|
7144
7187
|
description: o.preprocess(
|
|
@@ -7153,9 +7196,9 @@ const fl = o.object({
|
|
|
7153
7196
|
).optional()
|
|
7154
7197
|
}).refine((e) => e.name !== void 0 || e.description !== void 0, {
|
|
7155
7198
|
message: 'Provide at least one of "name" or "description" to update.'
|
|
7156
|
-
}),
|
|
7157
|
-
sections: o.array(
|
|
7158
|
-
},
|
|
7199
|
+
}), Sl = {
|
|
7200
|
+
sections: o.array(Il).min(1).describe("The sections to update.")
|
|
7201
|
+
}, Cl = {
|
|
7159
7202
|
sections: o.array(Z).describe("The updated sections."),
|
|
7160
7203
|
totalCount: o.number().describe("The total number of sections updated."),
|
|
7161
7204
|
updatedSectionIds: o.array(o.string()).describe("The IDs of the updated sections."),
|
|
@@ -7164,11 +7207,11 @@ const fl = o.object({
|
|
|
7164
7207
|
updateCount: o.number(),
|
|
7165
7208
|
failureCount: o.number()
|
|
7166
7209
|
})
|
|
7167
|
-
},
|
|
7210
|
+
}, jl = {
|
|
7168
7211
|
name: T.UPDATE_SECTIONS,
|
|
7169
7212
|
description: "Update multiple existing sections with new values.",
|
|
7170
|
-
parameters:
|
|
7171
|
-
outputSchema:
|
|
7213
|
+
parameters: Sl,
|
|
7214
|
+
outputSchema: Cl,
|
|
7172
7215
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
7173
7216
|
async execute({ sections: e }, t) {
|
|
7174
7217
|
const s = await Promise.allSettled(
|
|
@@ -7183,10 +7226,10 @@ const fl = o.object({
|
|
|
7183
7226
|
return s.forEach((a, c) => {
|
|
7184
7227
|
a.status === "fulfilled" ? r.push(a.value) : n.push({
|
|
7185
7228
|
item: e[c]?.id ?? `Section ${c + 1}`,
|
|
7186
|
-
error:
|
|
7229
|
+
error: D(a.reason)
|
|
7187
7230
|
});
|
|
7188
7231
|
}), U(T.UPDATE_SECTIONS, e.length, n), {
|
|
7189
|
-
textContent:
|
|
7232
|
+
textContent: $l({
|
|
7190
7233
|
sections: r,
|
|
7191
7234
|
failures: n
|
|
7192
7235
|
}),
|
|
@@ -7203,29 +7246,29 @@ const fl = o.object({
|
|
|
7203
7246
|
};
|
|
7204
7247
|
}
|
|
7205
7248
|
};
|
|
7206
|
-
function
|
|
7249
|
+
function $l({
|
|
7207
7250
|
sections: e,
|
|
7208
7251
|
failures: t
|
|
7209
7252
|
}) {
|
|
7210
7253
|
const s = e.length, r = e.map((i) => `• ${i.name} (id=${i.id}, projectId=${i.projectId})`).join(`
|
|
7211
7254
|
`), n = s > 0 ? `Updated ${s} section${s === 1 ? "" : "s"}:
|
|
7212
7255
|
${r}` : "Updated 0 sections";
|
|
7213
|
-
return
|
|
7256
|
+
return P(n, t);
|
|
7214
7257
|
}
|
|
7215
|
-
function
|
|
7258
|
+
function vo(e, t) {
|
|
7216
7259
|
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;
|
|
7217
7260
|
}
|
|
7218
|
-
function
|
|
7261
|
+
function Al(e, t) {
|
|
7219
7262
|
return t.projectId !== void 0 ? e.projectId === t.projectId : t.sectionId !== void 0 ? e.sectionId === t.sectionId : e.parentId === t.parentId;
|
|
7220
7263
|
}
|
|
7221
|
-
function
|
|
7264
|
+
function El(e) {
|
|
7222
7265
|
return e.projectId !== void 0 ? `project:${e.projectId}` : e.sectionId !== void 0 ? `section:${e.sectionId}` : `parent:${e.parentId}`;
|
|
7223
7266
|
}
|
|
7224
7267
|
function Dl(e) {
|
|
7225
7268
|
const t = [];
|
|
7226
7269
|
return e.projectId && t.push({ projectId: e.projectId }), e.sectionId && t.push({ sectionId: e.sectionId }), e.parentId && t.push({ parentId: e.parentId }), t;
|
|
7227
7270
|
}
|
|
7228
|
-
function
|
|
7271
|
+
function xl({
|
|
7229
7272
|
taskId: e,
|
|
7230
7273
|
request: t,
|
|
7231
7274
|
current: s
|
|
@@ -7235,7 +7278,7 @@ function El({
|
|
|
7235
7278
|
return { redundantMoveSkipped: !1 };
|
|
7236
7279
|
let n = r, i = !1;
|
|
7237
7280
|
if (s) {
|
|
7238
|
-
const a = r.length === 1 ? (c) =>
|
|
7281
|
+
const a = r.length === 1 ? (c) => vo(s, c) : (c) => Al(s, c);
|
|
7239
7282
|
n = r.filter((c) => !a(c)), i = n.length < r.length;
|
|
7240
7283
|
}
|
|
7241
7284
|
if (n.length === 0)
|
|
@@ -7246,7 +7289,7 @@ function El({
|
|
|
7246
7289
|
);
|
|
7247
7290
|
return { move: n[0], redundantMoveSkipped: i };
|
|
7248
7291
|
}
|
|
7249
|
-
const
|
|
7292
|
+
const Ol = o.object({
|
|
7250
7293
|
id: o.string().min(1).describe("The ID of the task to update."),
|
|
7251
7294
|
content: o.string().optional().describe(
|
|
7252
7295
|
'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.'
|
|
@@ -7280,7 +7323,7 @@ const xl = o.object({
|
|
|
7280
7323
|
'The new deadline date for the task in ISO 8601 format (YYYY-MM-DD, e.g., "2025-12-31"). Deadlines are immovable constraints shown with a different indicator than due dates. Use "remove" to clear the deadline.'
|
|
7281
7324
|
)
|
|
7282
7325
|
).optional(),
|
|
7283
|
-
duration: o.string().optional().describe(
|
|
7326
|
+
duration: o.string().optional().describe(_s),
|
|
7284
7327
|
responsibleUser: o.preprocess(
|
|
7285
7328
|
// Keep accepting legacy null while exposing a Gemini-compatible string schema.
|
|
7286
7329
|
(e) => e === null ? "unassign" : e,
|
|
@@ -7292,8 +7335,8 @@ const xl = o.object({
|
|
|
7292
7335
|
isUncompletable: o.boolean().optional().describe(
|
|
7293
7336
|
"Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
|
|
7294
7337
|
)
|
|
7295
|
-
}),
|
|
7296
|
-
tasks: o.array(
|
|
7338
|
+
}), Ul = (e) => !!(e.projectId || e.sectionId || e.parentId), Io = (e) => Object.keys(e).length > 0, _l = ["remove", "no date"], Rl = ["remove", "no date", "no deadline"], cs = "no date", at = vs.TASKS_PER_OPERATION, ds = {
|
|
7339
|
+
tasks: o.array(Ol).min(1).max(at).describe(`The tasks to update (max ${at}).`)
|
|
7297
7340
|
}, Pl = {
|
|
7298
7341
|
tasks: o.array(V).describe("The updated tasks."),
|
|
7299
7342
|
totalCount: o.number().describe("The total number of tasks updated."),
|
|
@@ -7307,7 +7350,7 @@ const xl = o.object({
|
|
|
7307
7350
|
"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."
|
|
7308
7351
|
)
|
|
7309
7352
|
}).describe("Summary of operations performed.")
|
|
7310
|
-
},
|
|
7353
|
+
}, Nl = {
|
|
7311
7354
|
name: T.UPDATE_TASKS,
|
|
7312
7355
|
description: "Update existing tasks including content, dates, priorities, and assignments. Send only the fields that change.",
|
|
7313
7356
|
parameters: ds,
|
|
@@ -7323,29 +7366,29 @@ const xl = o.object({
|
|
|
7323
7366
|
const { tasks: s } = o.object(ds).parse(e), r = s.map(() => ({ kind: "skipped" })), n = (y, v) => {
|
|
7324
7367
|
r[y] = { kind: "failed", error: v };
|
|
7325
7368
|
}, i = (y, v) => {
|
|
7326
|
-
n(y,
|
|
7327
|
-
}, a = s.map((y, v) => ({ task: y, index: v })).filter(({ task: y }) =>
|
|
7369
|
+
n(y, D(v));
|
|
7370
|
+
}, a = s.map((y, v) => ({ task: y, index: v })).filter(({ task: y }) => zl(y)), c = await Ml(
|
|
7328
7371
|
a.map(({ task: y }) => y),
|
|
7329
7372
|
t
|
|
7330
7373
|
), d = await Promise.allSettled(
|
|
7331
|
-
a.map(({ task: y, index: v }) =>
|
|
7374
|
+
a.map(({ task: y, index: v }) => Kl({ task: y, index: v, client: t, inbox: c }))
|
|
7332
7375
|
), l = [];
|
|
7333
7376
|
for (const [y, v] of d.entries()) {
|
|
7334
7377
|
const A = a[y]?.index ?? y;
|
|
7335
7378
|
v.status === "fulfilled" ? l.push(v.value) : i(A, v.reason);
|
|
7336
7379
|
}
|
|
7337
|
-
const { states: u, readFailed: p } = await
|
|
7380
|
+
const { states: u, readFailed: p } = await So({
|
|
7338
7381
|
client: t,
|
|
7339
7382
|
ids: [
|
|
7340
7383
|
...new Set(
|
|
7341
|
-
l.filter((y) =>
|
|
7384
|
+
l.filter((y) => Ul(y.moveRequest) || y.checkRecurrence).map((y) => y.id)
|
|
7342
7385
|
)
|
|
7343
7386
|
]
|
|
7344
7387
|
});
|
|
7345
7388
|
for (const y of l) {
|
|
7346
7389
|
if (!y.checkRecurrence)
|
|
7347
7390
|
continue;
|
|
7348
|
-
const v =
|
|
7391
|
+
const v = Fl({
|
|
7349
7392
|
id: y.id,
|
|
7350
7393
|
current: u.get(y.id),
|
|
7351
7394
|
readFailed: p
|
|
@@ -7356,7 +7399,7 @@ const xl = o.object({
|
|
|
7356
7399
|
for (const y of l)
|
|
7357
7400
|
if (!y.failed)
|
|
7358
7401
|
try {
|
|
7359
|
-
const v =
|
|
7402
|
+
const v = xl({
|
|
7360
7403
|
taskId: y.id,
|
|
7361
7404
|
request: y.moveRequest,
|
|
7362
7405
|
current: u.get(y.id)
|
|
@@ -7368,7 +7411,7 @@ const xl = o.object({
|
|
|
7368
7411
|
const f = /* @__PURE__ */ new Map(), b = [], m = (y) => {
|
|
7369
7412
|
const v = y.filter((A) => !A.failed);
|
|
7370
7413
|
v.length !== 0 && b.push(
|
|
7371
|
-
|
|
7414
|
+
Bl({
|
|
7372
7415
|
client: t,
|
|
7373
7416
|
items: v,
|
|
7374
7417
|
onUpdated: (A, x) => {
|
|
@@ -7380,7 +7423,7 @@ const xl = o.object({
|
|
|
7380
7423
|
r[A.index] = {
|
|
7381
7424
|
kind: "partial",
|
|
7382
7425
|
task: O.task,
|
|
7383
|
-
error: `Move applied; field update failed: ${
|
|
7426
|
+
error: `Move applied; field update failed: ${D(x)}`
|
|
7384
7427
|
};
|
|
7385
7428
|
return;
|
|
7386
7429
|
}
|
|
@@ -7389,7 +7432,7 @@ const xl = o.object({
|
|
|
7389
7432
|
})
|
|
7390
7433
|
);
|
|
7391
7434
|
}, g = new Set(h.map(({ item: y }) => y.index));
|
|
7392
|
-
m(l.filter((y) => !g.has(y.index))), await
|
|
7435
|
+
m(l.filter((y) => !g.has(y.index))), await Hl({
|
|
7393
7436
|
client: t,
|
|
7394
7437
|
moving: h,
|
|
7395
7438
|
results: f,
|
|
@@ -7407,14 +7450,14 @@ const xl = o.object({
|
|
|
7407
7450
|
}
|
|
7408
7451
|
}), await Promise.all(b);
|
|
7409
7452
|
for (const y of l) {
|
|
7410
|
-
if (y.failed ||
|
|
7453
|
+
if (y.failed || Io(y.updateArgs))
|
|
7411
7454
|
continue;
|
|
7412
7455
|
const v = f.get(y.index);
|
|
7413
7456
|
v && "task" in v && (r[y.index] = { kind: "updated", task: v.task });
|
|
7414
7457
|
}
|
|
7415
|
-
const { updatedTasks: w, failures: I, skippedCount: k } =
|
|
7458
|
+
const { updatedTasks: w, failures: I, skippedCount: k } = Ll({ tasks: s, outcomes: r }), C = l.filter((y) => y.redundantMoveSkipped).length, j = w.map(H);
|
|
7416
7459
|
return U(T.UPDATE_TASKS, s.length, I), {
|
|
7417
|
-
textContent:
|
|
7460
|
+
textContent: Gl({
|
|
7418
7461
|
tasks: j,
|
|
7419
7462
|
failures: I,
|
|
7420
7463
|
skippedCount: k,
|
|
@@ -7435,7 +7478,7 @@ const xl = o.object({
|
|
|
7435
7478
|
};
|
|
7436
7479
|
}
|
|
7437
7480
|
};
|
|
7438
|
-
function
|
|
7481
|
+
function Ll({ tasks: e, outcomes: t }) {
|
|
7439
7482
|
const s = [], r = [];
|
|
7440
7483
|
let n = 0;
|
|
7441
7484
|
for (const [i, a] of t.entries()) {
|
|
@@ -7452,7 +7495,7 @@ function Nl({ tasks: e, outcomes: t }) {
|
|
|
7452
7495
|
}
|
|
7453
7496
|
return { updatedTasks: s, failures: r, skippedCount: n };
|
|
7454
7497
|
}
|
|
7455
|
-
async function
|
|
7498
|
+
async function Ml(e, t) {
|
|
7456
7499
|
if (!e.some((s) => Y(s.projectId)))
|
|
7457
7500
|
return {};
|
|
7458
7501
|
try {
|
|
@@ -7461,7 +7504,7 @@ async function Ll(e, t) {
|
|
|
7461
7504
|
return { error: s };
|
|
7462
7505
|
}
|
|
7463
7506
|
}
|
|
7464
|
-
async function
|
|
7507
|
+
async function So({
|
|
7465
7508
|
client: e,
|
|
7466
7509
|
ids: t
|
|
7467
7510
|
}) {
|
|
@@ -7477,7 +7520,7 @@ async function Io({
|
|
|
7477
7520
|
}
|
|
7478
7521
|
return { states: s, readFailed: !1 };
|
|
7479
7522
|
}
|
|
7480
|
-
function
|
|
7523
|
+
function Fl({
|
|
7481
7524
|
id: e,
|
|
7482
7525
|
current: t,
|
|
7483
7526
|
readFailed: s
|
|
@@ -7487,7 +7530,7 @@ function Ml({
|
|
|
7487
7530
|
if (t?.due?.isRecurring)
|
|
7488
7531
|
return `Task ${e} recurs ("${t.due.string}"). dueString would replace that rule and make it a one-time task, so nothing was changed. To move it to another date or time, use ${T.RESCHEDULE_TASKS} (it also accepts duration). To change or drop the recurrence on purpose, resend with replaceRecurrence: true.`;
|
|
7489
7532
|
}
|
|
7490
|
-
async function
|
|
7533
|
+
async function Hl({
|
|
7491
7534
|
client: e,
|
|
7492
7535
|
moving: t,
|
|
7493
7536
|
results: s,
|
|
@@ -7497,10 +7540,10 @@ async function Fl({
|
|
|
7497
7540
|
return;
|
|
7498
7541
|
const n = /* @__PURE__ */ new Map();
|
|
7499
7542
|
for (const c of t) {
|
|
7500
|
-
const d =
|
|
7543
|
+
const d = El(c.move), l = n.get(d);
|
|
7501
7544
|
l ? l.push(c) : n.set(d, [c]);
|
|
7502
7545
|
}
|
|
7503
|
-
const i =
|
|
7546
|
+
const i = Ir(e), a = [];
|
|
7504
7547
|
for (const c of n.values()) {
|
|
7505
7548
|
const d = [...new Set(c.map(({ item: p }) => p.id))], l = c[0]?.move, u = c.length === 1 ? c[0] : void 0;
|
|
7506
7549
|
try {
|
|
@@ -7521,29 +7564,29 @@ async function Fl({
|
|
|
7521
7564
|
r(b), f.length > 0 && a.push({ group: f, destination: l });
|
|
7522
7565
|
} catch (p) {
|
|
7523
7566
|
if (u) {
|
|
7524
|
-
s.set(u.item.index, { error:
|
|
7567
|
+
s.set(u.item.index, { error: D(p) }), r(c);
|
|
7525
7568
|
continue;
|
|
7526
7569
|
}
|
|
7527
7570
|
a.push({ group: c, destination: l, error: p });
|
|
7528
7571
|
}
|
|
7529
7572
|
}
|
|
7530
7573
|
if (a.length > 0) {
|
|
7531
|
-
await
|
|
7574
|
+
await Wl({ client: e, unresolved: a, results: s });
|
|
7532
7575
|
for (const { group: c } of a)
|
|
7533
7576
|
r(c);
|
|
7534
7577
|
}
|
|
7535
7578
|
}
|
|
7536
|
-
async function
|
|
7579
|
+
async function Wl({
|
|
7537
7580
|
client: e,
|
|
7538
7581
|
unresolved: t,
|
|
7539
7582
|
results: s
|
|
7540
7583
|
}) {
|
|
7541
|
-
const r = [...new Set(t.flatMap(({ group: i }) => i.map(({ item: a }) => a.id)))], { states: n } = await
|
|
7584
|
+
const r = [...new Set(t.flatMap(({ group: i }) => i.map(({ item: a }) => a.id)))], { states: n } = await So({ client: e, ids: r });
|
|
7542
7585
|
for (const { group: i, destination: a, error: c } of t) {
|
|
7543
|
-
const d = c === void 0 ? "Task not returned by the move" :
|
|
7586
|
+
const d = c === void 0 ? "Task not returned by the move" : D(c);
|
|
7544
7587
|
for (const { item: l } of i) {
|
|
7545
7588
|
const u = n.get(l.id);
|
|
7546
|
-
if (u &&
|
|
7589
|
+
if (u && vo(u, a)) {
|
|
7547
7590
|
s.set(l.index, { task: u });
|
|
7548
7591
|
continue;
|
|
7549
7592
|
}
|
|
@@ -7551,15 +7594,15 @@ async function Hl({
|
|
|
7551
7594
|
}
|
|
7552
7595
|
}
|
|
7553
7596
|
}
|
|
7554
|
-
async function
|
|
7597
|
+
async function Bl({
|
|
7555
7598
|
client: e,
|
|
7556
7599
|
items: t,
|
|
7557
7600
|
onUpdated: s,
|
|
7558
7601
|
onFailed: r
|
|
7559
7602
|
}) {
|
|
7560
|
-
const n =
|
|
7603
|
+
const n = Sr(e);
|
|
7561
7604
|
await Promise.all(
|
|
7562
|
-
t.filter((i) =>
|
|
7605
|
+
t.filter((i) => Io(i.updateArgs)).map(async (i) => {
|
|
7563
7606
|
try {
|
|
7564
7607
|
const a = await n(
|
|
7565
7608
|
() => $(() => e.updateTask(i.id, i.updateArgs))
|
|
@@ -7571,7 +7614,7 @@ async function Wl({
|
|
|
7571
7614
|
})
|
|
7572
7615
|
);
|
|
7573
7616
|
}
|
|
7574
|
-
async function
|
|
7617
|
+
async function Kl({
|
|
7575
7618
|
task: e,
|
|
7576
7619
|
index: t,
|
|
7577
7620
|
client: s,
|
|
@@ -7601,18 +7644,18 @@ async function Bl({
|
|
|
7601
7644
|
p && (w.priority = Ps(p));
|
|
7602
7645
|
const I = ls(
|
|
7603
7646
|
d,
|
|
7604
|
-
|
|
7647
|
+
_l,
|
|
7605
7648
|
cs
|
|
7606
7649
|
);
|
|
7607
7650
|
I !== void 0 && (w = { ...w, dueString: I });
|
|
7608
|
-
const k = ls(f,
|
|
7651
|
+
const k = ls(f, Rl, null);
|
|
7609
7652
|
if (k !== void 0 && (w = { ...w, deadlineDate: k }), l) {
|
|
7610
7653
|
const { amount: C, unit: j } = mt(`Task ${n}`, l);
|
|
7611
7654
|
w = { ...w, duration: C, durationUnit: j };
|
|
7612
7655
|
}
|
|
7613
7656
|
return u !== void 0 && (w = {
|
|
7614
7657
|
...w,
|
|
7615
|
-
assigneeId: await
|
|
7658
|
+
assigneeId: await ql(s, n, u)
|
|
7616
7659
|
}), {
|
|
7617
7660
|
index: t,
|
|
7618
7661
|
id: n,
|
|
@@ -7627,7 +7670,7 @@ async function Bl({
|
|
|
7627
7670
|
failed: !1
|
|
7628
7671
|
};
|
|
7629
7672
|
}
|
|
7630
|
-
async function
|
|
7673
|
+
async function ql(e, t, s) {
|
|
7631
7674
|
if (s === null || s === "unassign")
|
|
7632
7675
|
return null;
|
|
7633
7676
|
const r = await At.validateTaskUpdateAssignment(
|
|
@@ -7641,7 +7684,7 @@ async function Kl(e, t, s) {
|
|
|
7641
7684
|
}
|
|
7642
7685
|
return r.resolvedUser?.userId;
|
|
7643
7686
|
}
|
|
7644
|
-
function
|
|
7687
|
+
function Gl({
|
|
7645
7688
|
tasks: e,
|
|
7646
7689
|
failures: t,
|
|
7647
7690
|
skippedCount: s,
|
|
@@ -7655,14 +7698,14 @@ function ql({
|
|
|
7655
7698
|
});
|
|
7656
7699
|
if (t.length === 0)
|
|
7657
7700
|
return a;
|
|
7658
|
-
const c = t.slice(0,
|
|
7701
|
+
const c = t.slice(0, Ce.MAX_FAILURES_SHOWN), d = t.length - c.length, l = c.map((p) => ` ${p.item}: ${p.error}`).join(`
|
|
7659
7702
|
`), u = d > 0 ? `
|
|
7660
7703
|
+${d} more` : "";
|
|
7661
7704
|
return `${a}
|
|
7662
7705
|
Failed (${t.length}) - address or drop these items:
|
|
7663
7706
|
${l}${u}`;
|
|
7664
7707
|
}
|
|
7665
|
-
function
|
|
7708
|
+
function zl({
|
|
7666
7709
|
id: e,
|
|
7667
7710
|
replaceRecurrence: t,
|
|
7668
7711
|
...s
|
|
@@ -7677,7 +7720,7 @@ function ls(e, t, s) {
|
|
|
7677
7720
|
const r = e.trim().toLowerCase();
|
|
7678
7721
|
return t.includes(r) ? s : e;
|
|
7679
7722
|
}
|
|
7680
|
-
const
|
|
7723
|
+
const Yl = {}, Vl = {
|
|
7681
7724
|
type: o.literal("user_info").describe("The type of the response."),
|
|
7682
7725
|
userId: o.string().describe("The user ID."),
|
|
7683
7726
|
fullName: o.string().describe("The full name of the user."),
|
|
@@ -7694,36 +7737,36 @@ const zl = {}, Yl = {
|
|
|
7694
7737
|
email: o.string().describe("The email address of the user."),
|
|
7695
7738
|
plan: o.enum(["Todoist Free", "Todoist Pro", "Todoist Business"]).describe("The user plan.")
|
|
7696
7739
|
};
|
|
7697
|
-
function
|
|
7740
|
+
function Jl(e) {
|
|
7698
7741
|
return e.businessAccountId ? "Todoist Business" : e.isPremium ? "Todoist Pro" : "Todoist Free";
|
|
7699
7742
|
}
|
|
7700
|
-
function
|
|
7743
|
+
function Xl(e, t) {
|
|
7701
7744
|
const r = ((e.getDay() || 7) - t + 7) % 7, n = new Date(e);
|
|
7702
7745
|
return n.setDate(e.getDate() - r), n;
|
|
7703
7746
|
}
|
|
7704
|
-
function
|
|
7747
|
+
function Zl(e) {
|
|
7705
7748
|
const t = new Date(e);
|
|
7706
7749
|
return t.setDate(e.getDate() + 6), t;
|
|
7707
7750
|
}
|
|
7708
|
-
function
|
|
7751
|
+
function Ql(e) {
|
|
7709
7752
|
const t = new Date(e.getFullYear(), 0, 1), s = (e.getTime() - t.getTime()) / 864e5;
|
|
7710
7753
|
return Math.ceil((s + t.getDay() + 1) / 7);
|
|
7711
7754
|
}
|
|
7712
|
-
function
|
|
7755
|
+
function eu(e) {
|
|
7713
7756
|
return ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"][e === 7 ? 0 : e] ?? "Unknown";
|
|
7714
7757
|
}
|
|
7715
|
-
function
|
|
7758
|
+
function tu(e) {
|
|
7716
7759
|
try {
|
|
7717
7760
|
return new Intl.DateTimeFormat("en-US", { timeZone: e }), !0;
|
|
7718
7761
|
} catch {
|
|
7719
7762
|
return !1;
|
|
7720
7763
|
}
|
|
7721
7764
|
}
|
|
7722
|
-
function
|
|
7723
|
-
return
|
|
7765
|
+
function Co(e) {
|
|
7766
|
+
return tu(e) ? e : "UTC";
|
|
7724
7767
|
}
|
|
7725
|
-
function
|
|
7726
|
-
const s =
|
|
7768
|
+
function su(e, t) {
|
|
7769
|
+
const s = Co(t);
|
|
7727
7770
|
return e.toLocaleString("en-US", {
|
|
7728
7771
|
timeZone: s,
|
|
7729
7772
|
year: "numeric",
|
|
@@ -7735,8 +7778,8 @@ function tu(e, t) {
|
|
|
7735
7778
|
hour12: !1
|
|
7736
7779
|
});
|
|
7737
7780
|
}
|
|
7738
|
-
async function
|
|
7739
|
-
const t = await e.getUser(), s = t.tzInfo?.timezone ?? "UTC", r =
|
|
7781
|
+
async function ou(e) {
|
|
7782
|
+
const t = await e.getUser(), s = t.tzInfo?.timezone ?? "UTC", r = Co(s), n = /* @__PURE__ */ new Date(), i = su(n, r), a = t.startDay ?? 1, c = eu(a), d = Jl(t), l = new Date(n.toLocaleString("en-US", { timeZone: r })), u = Xl(l, a), p = Zl(u), h = Ql(l), b = [
|
|
7740
7783
|
"# User Information",
|
|
7741
7784
|
"",
|
|
7742
7785
|
`**User ID:** ${t.id}`,
|
|
@@ -7778,26 +7821,26 @@ async function su(e) {
|
|
|
7778
7821
|
};
|
|
7779
7822
|
return { textContent: b, structuredContent: m };
|
|
7780
7823
|
}
|
|
7781
|
-
const
|
|
7824
|
+
const ru = {
|
|
7782
7825
|
name: T.USER_INFO,
|
|
7783
7826
|
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).",
|
|
7784
|
-
parameters:
|
|
7785
|
-
outputSchema:
|
|
7827
|
+
parameters: Yl,
|
|
7828
|
+
outputSchema: Vl,
|
|
7786
7829
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
7787
7830
|
async execute(e, t) {
|
|
7788
|
-
const s = await
|
|
7831
|
+
const s = await ou(t);
|
|
7789
7832
|
return {
|
|
7790
7833
|
textContent: s.textContent,
|
|
7791
7834
|
structuredContent: s.structuredContent
|
|
7792
7835
|
};
|
|
7793
7836
|
}
|
|
7794
|
-
}, us = 10 * 1024 * 1024,
|
|
7837
|
+
}, us = 10 * 1024 * 1024, nu = /* @__PURE__ */ new Set([
|
|
7795
7838
|
"image/png",
|
|
7796
7839
|
"image/jpeg",
|
|
7797
7840
|
"image/gif",
|
|
7798
7841
|
"image/webp",
|
|
7799
7842
|
"image/svg+xml"
|
|
7800
|
-
]),
|
|
7843
|
+
]), iu = /* @__PURE__ */ new Set([
|
|
7801
7844
|
"text/plain",
|
|
7802
7845
|
"text/csv",
|
|
7803
7846
|
"text/html",
|
|
@@ -7805,7 +7848,7 @@ const ou = {
|
|
|
7805
7848
|
"application/json",
|
|
7806
7849
|
"application/xml",
|
|
7807
7850
|
"text/xml"
|
|
7808
|
-
]),
|
|
7851
|
+
]), au = {
|
|
7809
7852
|
".png": "image/png",
|
|
7810
7853
|
".jpg": "image/jpeg",
|
|
7811
7854
|
".jpeg": "image/jpeg",
|
|
@@ -7820,23 +7863,23 @@ const ou = {
|
|
|
7820
7863
|
".xml": "application/xml",
|
|
7821
7864
|
".pdf": "application/pdf"
|
|
7822
7865
|
};
|
|
7823
|
-
function au(e) {
|
|
7824
|
-
return ru.has(e) ? "image" : nu.has(e) || e.startsWith("text/") ? "text" : "binary";
|
|
7825
|
-
}
|
|
7826
7866
|
function cu(e) {
|
|
7827
|
-
return (e
|
|
7867
|
+
return nu.has(e) ? "image" : iu.has(e) || e.startsWith("text/") ? "text" : "binary";
|
|
7828
7868
|
}
|
|
7829
7869
|
function du(e) {
|
|
7870
|
+
return (e.split(";")[0] ?? e).trim().toLowerCase();
|
|
7871
|
+
}
|
|
7872
|
+
function lu(e) {
|
|
7830
7873
|
try {
|
|
7831
7874
|
const t = new URL(e).pathname, s = t.lastIndexOf(".");
|
|
7832
7875
|
if (s === -1) return;
|
|
7833
7876
|
const r = t.slice(s).toLowerCase();
|
|
7834
|
-
return
|
|
7877
|
+
return au[r];
|
|
7835
7878
|
} catch {
|
|
7836
7879
|
return;
|
|
7837
7880
|
}
|
|
7838
7881
|
}
|
|
7839
|
-
function
|
|
7882
|
+
function uu(e) {
|
|
7840
7883
|
try {
|
|
7841
7884
|
const t = new URL(e).pathname, s = t.lastIndexOf("/");
|
|
7842
7885
|
return s === -1 ? void 0 : t.slice(s + 1) || void 0;
|
|
@@ -7844,21 +7887,21 @@ function lu(e) {
|
|
|
7844
7887
|
return;
|
|
7845
7888
|
}
|
|
7846
7889
|
}
|
|
7847
|
-
const
|
|
7890
|
+
const pu = {
|
|
7848
7891
|
fileUrl: o.url().describe(
|
|
7849
7892
|
"The URL of the attachment file to view. Get this from the fileUrl field in a comment's fileAttachment."
|
|
7850
7893
|
)
|
|
7851
|
-
},
|
|
7894
|
+
}, hu = {
|
|
7852
7895
|
name: T.VIEW_ATTACHMENT,
|
|
7853
7896
|
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).",
|
|
7854
|
-
parameters:
|
|
7897
|
+
parameters: pu,
|
|
7855
7898
|
annotations: {
|
|
7856
7899
|
readOnlyHint: !0,
|
|
7857
7900
|
destructiveHint: !1,
|
|
7858
7901
|
idempotentHint: !0
|
|
7859
7902
|
},
|
|
7860
7903
|
async execute({ fileUrl: e }, t) {
|
|
7861
|
-
const s = await t.viewAttachment(e), r = s.headers["content-length"], n = r ? Number.parseInt(r, 10) : void 0, i =
|
|
7904
|
+
const s = await t.viewAttachment(e), r = s.headers["content-length"], n = r ? Number.parseInt(r, 10) : void 0, i = uu(e), a = s.headers["content-type"], c = a ? du(a) : void 0, d = c && c !== "application/octet-stream" ? c : lu(e) ?? c ?? "application/octet-stream";
|
|
7862
7905
|
if (n && n > us)
|
|
7863
7906
|
return {
|
|
7864
7907
|
textContent: `Attachment "${i ?? e}" is too large to display inline (${(n / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
|
|
@@ -7868,7 +7911,7 @@ const uu = {
|
|
|
7868
7911
|
return {
|
|
7869
7912
|
textContent: `Attachment "${i ?? e}" is too large to display inline (${(u / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
|
|
7870
7913
|
};
|
|
7871
|
-
const p =
|
|
7914
|
+
const p = cu(d), h = [];
|
|
7872
7915
|
return p === "image" ? h.push({
|
|
7873
7916
|
type: "image",
|
|
7874
7917
|
data: l.toString("base64"),
|
|
@@ -7888,51 +7931,51 @@ const uu = {
|
|
|
7888
7931
|
contentItems: h
|
|
7889
7932
|
};
|
|
7890
7933
|
}
|
|
7891
|
-
},
|
|
7934
|
+
}, mu = {
|
|
7892
7935
|
...Xa,
|
|
7893
7936
|
_meta: {
|
|
7894
7937
|
ui: {
|
|
7895
7938
|
resourceUri: Je
|
|
7896
7939
|
}
|
|
7897
7940
|
}
|
|
7898
|
-
},
|
|
7941
|
+
}, fu = {
|
|
7899
7942
|
// Task management tools
|
|
7900
7943
|
addTasks: xi,
|
|
7901
7944
|
completeTasks: Fi,
|
|
7902
|
-
uncompleteTasks:
|
|
7903
|
-
updateTasks:
|
|
7945
|
+
uncompleteTasks: Hd,
|
|
7946
|
+
updateTasks: Nl,
|
|
7904
7947
|
rescheduleTasks: Sd,
|
|
7905
7948
|
findTasks: rc,
|
|
7906
|
-
findTasksByDate:
|
|
7949
|
+
findTasksByDate: mu,
|
|
7907
7950
|
findCompletedTasks: Sa,
|
|
7908
7951
|
// Project management tools
|
|
7909
7952
|
addProjects: ui,
|
|
7910
|
-
updateProjects:
|
|
7953
|
+
updateProjects: hl,
|
|
7911
7954
|
findProjects: La,
|
|
7912
7955
|
projectManagement: sd,
|
|
7913
7956
|
projectMove: nd,
|
|
7914
7957
|
// Section management tools
|
|
7915
7958
|
addSections: ji,
|
|
7916
|
-
updateSections:
|
|
7959
|
+
updateSections: jl,
|
|
7917
7960
|
findSections: za,
|
|
7918
7961
|
// Comment management tools
|
|
7919
7962
|
addComments: Hn,
|
|
7920
7963
|
findComments: ba,
|
|
7921
|
-
updateComments:
|
|
7964
|
+
updateComments: Gd,
|
|
7922
7965
|
// Reminder management tools
|
|
7923
7966
|
addReminders: ki,
|
|
7924
7967
|
findReminders: Wa,
|
|
7925
|
-
updateReminders:
|
|
7968
|
+
updateReminders: vl,
|
|
7926
7969
|
// Attachment tools
|
|
7927
|
-
viewAttachment:
|
|
7970
|
+
viewAttachment: hu,
|
|
7928
7971
|
// Label management tools
|
|
7929
7972
|
addLabels: oi,
|
|
7930
|
-
updateLabels:
|
|
7973
|
+
updateLabels: al,
|
|
7931
7974
|
findLabels: Aa,
|
|
7932
7975
|
// Filter management tools
|
|
7933
7976
|
findFilters: Yn,
|
|
7934
7977
|
addFilters: Qn,
|
|
7935
|
-
updateFilters:
|
|
7978
|
+
updateFilters: Xd,
|
|
7936
7979
|
// Activity and audit tools
|
|
7937
7980
|
findActivity: da,
|
|
7938
7981
|
getProductivityStats: gc,
|
|
@@ -7946,9 +7989,9 @@ const uu = {
|
|
|
7946
7989
|
deleteObject: Ki,
|
|
7947
7990
|
fetchObject: sa,
|
|
7948
7991
|
reorderObjects: md,
|
|
7949
|
-
userInfo:
|
|
7992
|
+
userInfo: ru,
|
|
7950
7993
|
getUserStatus: Uc,
|
|
7951
|
-
setUserStatus:
|
|
7994
|
+
setUserStatus: Ld,
|
|
7952
7995
|
// Assignment and collaboration tools
|
|
7953
7996
|
findProjectCollaborators: Oa,
|
|
7954
7997
|
manageAssignments: Qc,
|
|
@@ -7958,9 +8001,9 @@ const uu = {
|
|
|
7958
8001
|
// Workspace tools
|
|
7959
8002
|
listWorkspaces: Yc,
|
|
7960
8003
|
// OpenAI MCP tools
|
|
7961
|
-
search:
|
|
8004
|
+
search: Ed,
|
|
7962
8005
|
fetch: na
|
|
7963
|
-
},
|
|
8006
|
+
}, bu = Object.values(fu), gu = `
|
|
7964
8007
|
## Todoist Task and Project Management Tools
|
|
7965
8008
|
|
|
7966
8009
|
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.
|
|
@@ -8017,77 +8060,76 @@ What each tool does and how to fill its parameters is in the tool's own descript
|
|
|
8017
8060
|
Use the **productivity-analysis** prompt for a combined productivity review — it pulls together user-info, get-productivity-stats and find-completed-tasks.
|
|
8018
8061
|
|
|
8019
8062
|
Always provide clear, actionable task titles and descriptions. Use the overview tools to give users context about their workload and project status.
|
|
8020
|
-
`,
|
|
8021
|
-
function
|
|
8022
|
-
|
|
8063
|
+
`, Se = { ttlMs: dt, cacheScope: "private" };
|
|
8064
|
+
function _u({
|
|
8065
|
+
token: e,
|
|
8023
8066
|
baseUrl: t,
|
|
8024
8067
|
features: s = []
|
|
8025
8068
|
}) {
|
|
8026
|
-
const r = new
|
|
8069
|
+
const r = new $o(
|
|
8027
8070
|
{ name: "todoist-mcp-server", version: ht },
|
|
8028
8071
|
{
|
|
8029
8072
|
capabilities: {
|
|
8030
8073
|
tools: { listChanged: !0 },
|
|
8031
8074
|
prompts: { listChanged: !0 }
|
|
8032
8075
|
},
|
|
8033
|
-
instructions:
|
|
8076
|
+
instructions: gu,
|
|
8034
8077
|
cacheHints: {
|
|
8035
|
-
"server/discover":
|
|
8036
|
-
"tools/list":
|
|
8037
|
-
"prompts/list":
|
|
8038
|
-
"resources/list":
|
|
8039
|
-
"resources/templates/list":
|
|
8078
|
+
"server/discover": Se,
|
|
8079
|
+
"tools/list": Se,
|
|
8080
|
+
"prompts/list": Se,
|
|
8081
|
+
"resources/list": Se,
|
|
8082
|
+
"resources/templates/list": Se
|
|
8040
8083
|
}
|
|
8041
8084
|
}
|
|
8042
8085
|
), n = Nr(e, { baseUrl: t });
|
|
8043
|
-
return
|
|
8044
|
-
|
|
8086
|
+
return Qo(r), Qr({ tools: bu, server: r, client: n, features: s }), r.registerPrompt(
|
|
8087
|
+
Ie.name,
|
|
8045
8088
|
{
|
|
8046
|
-
title:
|
|
8047
|
-
description:
|
|
8048
|
-
argsSchema:
|
|
8089
|
+
title: Ie.title,
|
|
8090
|
+
description: Ie.description,
|
|
8091
|
+
argsSchema: Ie.argsSchema
|
|
8049
8092
|
},
|
|
8050
|
-
|
|
8093
|
+
Ie.callback
|
|
8051
8094
|
), r;
|
|
8052
8095
|
}
|
|
8053
8096
|
export {
|
|
8054
|
-
|
|
8097
|
+
Ou as $,
|
|
8055
8098
|
mc as A,
|
|
8056
8099
|
gc as B,
|
|
8057
8100
|
vc as C,
|
|
8058
8101
|
Ac as D,
|
|
8059
8102
|
Uc as E,
|
|
8060
|
-
|
|
8103
|
+
Uu as F,
|
|
8061
8104
|
Nc as G,
|
|
8062
8105
|
Wc as H,
|
|
8063
8106
|
Yc as I,
|
|
8064
8107
|
Qc as J,
|
|
8065
8108
|
sd as K,
|
|
8066
8109
|
nd as L,
|
|
8067
|
-
|
|
8110
|
+
bu as M,
|
|
8068
8111
|
md as N,
|
|
8069
8112
|
Sd as O,
|
|
8070
|
-
|
|
8071
|
-
|
|
8072
|
-
|
|
8073
|
-
|
|
8074
|
-
|
|
8075
|
-
|
|
8076
|
-
|
|
8077
|
-
|
|
8078
|
-
|
|
8079
|
-
|
|
8080
|
-
|
|
8081
|
-
|
|
8113
|
+
Ed as P,
|
|
8114
|
+
Ld as Q,
|
|
8115
|
+
Hd as R,
|
|
8116
|
+
Gd as S,
|
|
8117
|
+
Xd as T,
|
|
8118
|
+
al as U,
|
|
8119
|
+
hl as V,
|
|
8120
|
+
vl as W,
|
|
8121
|
+
jl as X,
|
|
8122
|
+
Nl as Y,
|
|
8123
|
+
ru as Z,
|
|
8124
|
+
hu as _,
|
|
8082
8125
|
Hn as a,
|
|
8083
|
-
|
|
8084
|
-
Os as a1,
|
|
8126
|
+
Dr as a0,
|
|
8085
8127
|
Qn as b,
|
|
8086
8128
|
oi as c,
|
|
8087
8129
|
ui as d,
|
|
8088
8130
|
ki as e,
|
|
8089
8131
|
ji as f,
|
|
8090
|
-
|
|
8132
|
+
_u as g,
|
|
8091
8133
|
xi as h,
|
|
8092
8134
|
Ni as i,
|
|
8093
8135
|
Fi as j,
|
|
@@ -8100,7 +8142,7 @@ export {
|
|
|
8100
8142
|
Sa as q,
|
|
8101
8143
|
Yn as r,
|
|
8102
8144
|
Aa as s,
|
|
8103
|
-
|
|
8145
|
+
fu as t,
|
|
8104
8146
|
Oa as u,
|
|
8105
8147
|
La as v,
|
|
8106
8148
|
Wa as w,
|