@doist/todoist-mcp 13.0.0 → 13.1.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 +2 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/main-http.js +2 -2
- package/dist/main.js +1 -1
- package/dist/{mcp-server-DmDfXvc6.js → mcp-server-DicqL5ml.js} +820 -827
- package/dist/{require-valid-todoist-token-CmLQViiY.js → require-valid-todoist-token-BYd0I37Y.js} +1 -1
- package/dist/tool-registry.d.ts +2 -8
- package/dist/tool-registry.d.ts.map +1 -1
- package/dist/tools/get-overview.d.ts +2 -8
- package/dist/tools/get-overview.d.ts.map +1 -1
- package/dist/tools/import-project-template.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -3,32 +3,32 @@ import { createHash as Lt, randomUUID as Pe } from "node:crypto";
|
|
|
3
3
|
import { readFileSync as Os } from "node:fs";
|
|
4
4
|
import { dirname as Nt, join as _e } from "node:path";
|
|
5
5
|
import { fileURLToPath as Ps } from "node:url";
|
|
6
|
-
import { RESOURCE_MIME_TYPE as
|
|
6
|
+
import { RESOURCE_MIME_TYPE as Ue } from "@modelcontextprotocol/ext-apps/server";
|
|
7
7
|
import se, { ZodError as _s, z as s } from "zod";
|
|
8
|
-
import { AsyncLocalStorage as
|
|
9
|
-
import { createRequire as
|
|
10
|
-
import { TodoistApi as Ls, isWorkspaceProject as ke, isPersonalProject as B, colors as
|
|
8
|
+
import { AsyncLocalStorage as Us } from "node:async_hooks";
|
|
9
|
+
import { createRequire as Rs } from "node:module";
|
|
10
|
+
import { TodoistApi as Ls, isWorkspaceProject as ke, isPersonalProject as B, colors as Re, LOCATION_TRIGGERS as Mt, REMINDER_TYPES as Ns, createCommand as J, REMINDER_DELIVERY_SERVICES as Ms, HEALTH_STATUSES as Ve, getTaskUrl as Ft, getProjectUrl as Ht, parseTodoistUrl as Fs, WORKSPACE_ROLES as Hs, WORKSPACE_PLANS as Ws } from "@doist/todoist-sdk";
|
|
11
11
|
import { addDays as Le, formatISO as ut } from "date-fns";
|
|
12
|
-
const pt = Nt(Ps(import.meta.url)),
|
|
12
|
+
const pt = Nt(Ps(import.meta.url)), Bs = [
|
|
13
13
|
_e(pt, "task-list", "index.html"),
|
|
14
14
|
_e(pt, "mcp-apps", "index.html")
|
|
15
|
-
],
|
|
15
|
+
], zs = `<!doctype html>
|
|
16
16
|
<html>
|
|
17
17
|
<body>
|
|
18
18
|
<p>Task list app is missing. Run "npm run build" to generate it.</p>
|
|
19
19
|
</body>
|
|
20
20
|
</html>`;
|
|
21
|
-
function
|
|
21
|
+
function Ks() {
|
|
22
22
|
const e = [];
|
|
23
|
-
for (const t of
|
|
23
|
+
for (const t of Bs)
|
|
24
24
|
try {
|
|
25
25
|
return Os(t, "utf-8");
|
|
26
26
|
} catch (o) {
|
|
27
27
|
e.push(o);
|
|
28
28
|
}
|
|
29
|
-
return console.error("Failed to load task list app HTML from any known path:", e),
|
|
29
|
+
return console.error("Failed to load task list app HTML from any known path:", e), zs;
|
|
30
30
|
}
|
|
31
|
-
const Wt =
|
|
31
|
+
const Wt = Ks(), Ys = Lt("sha256").update(Wt).digest("hex").slice(0, 12), Ne = `ui://todoist/task-list@${Ys}`, qs = "ui://todoist/task-list@{hash}", Me = "Interactive task list widget", Gs = "https://ai.todoist.net", Fe = {
|
|
32
32
|
ui: {
|
|
33
33
|
prefersBorder: !0,
|
|
34
34
|
csp: {
|
|
@@ -43,46 +43,46 @@ const Wt = zs(), Ks = Lt("sha256").update(Wt).digest("hex").slice(0, 12), Ne = `
|
|
|
43
43
|
connect_domains: [],
|
|
44
44
|
resource_domains: []
|
|
45
45
|
},
|
|
46
|
-
"openai/widgetDomain":
|
|
46
|
+
"openai/widgetDomain": Gs
|
|
47
47
|
};
|
|
48
48
|
function ht(e) {
|
|
49
49
|
return {
|
|
50
50
|
contents: [
|
|
51
51
|
{
|
|
52
52
|
uri: e,
|
|
53
|
-
mimeType:
|
|
53
|
+
mimeType: Ue,
|
|
54
54
|
text: Wt,
|
|
55
55
|
_meta: Fe
|
|
56
56
|
}
|
|
57
57
|
]
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function Vs(e) {
|
|
61
61
|
e.registerResource(
|
|
62
62
|
"todoist-task-list",
|
|
63
63
|
Ne,
|
|
64
64
|
{
|
|
65
65
|
description: Me,
|
|
66
|
-
mimeType:
|
|
66
|
+
mimeType: Ue,
|
|
67
67
|
_meta: Fe
|
|
68
68
|
},
|
|
69
69
|
async () => ht(Ne)
|
|
70
70
|
), e.registerResource(
|
|
71
71
|
"todoist-task-list-hash-fallback",
|
|
72
|
-
new As(
|
|
72
|
+
new As(qs, { list: void 0 }),
|
|
73
73
|
{
|
|
74
74
|
description: `${Me} compatibility fallback`,
|
|
75
|
-
mimeType:
|
|
75
|
+
mimeType: Ue,
|
|
76
76
|
_meta: Fe
|
|
77
77
|
},
|
|
78
78
|
async (t) => ht(t.toString())
|
|
79
79
|
);
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function X(e) {
|
|
82
82
|
return typeof e == "object" && e !== null;
|
|
83
83
|
}
|
|
84
84
|
function He(...e) {
|
|
85
|
-
return e.find(
|
|
85
|
+
return e.find(X);
|
|
86
86
|
}
|
|
87
87
|
function L(...e) {
|
|
88
88
|
return e.find((t) => t !== void 0);
|
|
@@ -105,14 +105,14 @@ function oe(e) {
|
|
|
105
105
|
const t = E(e);
|
|
106
106
|
return t !== void 0 ? t : w(e);
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function Js(e) {
|
|
109
109
|
return e.replace(/\b(Bearer)\s+[A-Za-z0-9._~+/=-]+/gi, "$1 [REDACTED]").replace(
|
|
110
110
|
/\b(token|api[_-]?key|authorization)\s*[:=]\s*["']?[A-Za-z0-9._~+/=-]{6,}["']?/gi,
|
|
111
111
|
"$1: [REDACTED]"
|
|
112
112
|
).replace(/([?&](?:token|api[_-]?key|authorization)=)[^&\s]+/gi, "$1[REDACTED]").replace(/\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\b/g, "[REDACTED]");
|
|
113
113
|
}
|
|
114
|
-
function
|
|
115
|
-
const o =
|
|
114
|
+
function U(e, t = 220) {
|
|
115
|
+
const o = Js(e).replace(/\s+/g, " ").trim();
|
|
116
116
|
return o.length <= t ? o : `${o.slice(0, t - 3)}...`;
|
|
117
117
|
}
|
|
118
118
|
function We(e) {
|
|
@@ -126,15 +126,15 @@ function xe(e) {
|
|
|
126
126
|
if (t?.[1])
|
|
127
127
|
return E(t[1]);
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function V(e) {
|
|
130
130
|
const t = w(e);
|
|
131
131
|
if (t)
|
|
132
|
-
return
|
|
132
|
+
return U(t);
|
|
133
133
|
if (Array.isArray(e)) {
|
|
134
|
-
const n = e.map((i) =>
|
|
135
|
-
return n.length > 0 ?
|
|
134
|
+
const n = e.map((i) => X(i) ? w(i.message) || w(i.error) : w(i)).filter((i) => !!i);
|
|
135
|
+
return n.length > 0 ? U(n.slice(0, 2).join("; ")) : void 0;
|
|
136
136
|
}
|
|
137
|
-
if (!
|
|
137
|
+
if (!X(e))
|
|
138
138
|
return;
|
|
139
139
|
const o = L(
|
|
140
140
|
w(e.detail),
|
|
@@ -144,20 +144,20 @@ function G(e) {
|
|
|
144
144
|
w(e.description)
|
|
145
145
|
);
|
|
146
146
|
if (o)
|
|
147
|
-
return
|
|
147
|
+
return U(o);
|
|
148
148
|
const r = [];
|
|
149
149
|
for (const [n, i] of Object.entries(e)) {
|
|
150
150
|
const a = w(i);
|
|
151
151
|
if (a && (r.push(`${n}: ${a}`), r.length >= 2))
|
|
152
152
|
break;
|
|
153
153
|
}
|
|
154
|
-
return r.length > 0 ?
|
|
154
|
+
return r.length > 0 ? U(r.join("; ")) : void 0;
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function Xs(e) {
|
|
157
157
|
if (!e)
|
|
158
158
|
return [];
|
|
159
159
|
const t = /* @__PURE__ */ new Set(), o = (a) => {
|
|
160
|
-
a && t.add(
|
|
160
|
+
a && t.add(U(a, 120));
|
|
161
161
|
}, r = L(
|
|
162
162
|
w(e.field),
|
|
163
163
|
w(e.parameter),
|
|
@@ -184,7 +184,7 @@ function Js(e) {
|
|
|
184
184
|
const i = e.errors;
|
|
185
185
|
if (Array.isArray(i))
|
|
186
186
|
for (const a of i) {
|
|
187
|
-
if (!
|
|
187
|
+
if (!X(a)) {
|
|
188
188
|
o(w(a));
|
|
189
189
|
continue;
|
|
190
190
|
}
|
|
@@ -202,7 +202,7 @@ function Js(e) {
|
|
|
202
202
|
);
|
|
203
203
|
o(c && d ? `${c}: ${d}` : c || d);
|
|
204
204
|
}
|
|
205
|
-
else if (
|
|
205
|
+
else if (X(i))
|
|
206
206
|
for (const [a, c] of Object.entries(i)) {
|
|
207
207
|
const d = w(c);
|
|
208
208
|
if (d) {
|
|
@@ -216,7 +216,7 @@ function Js(e) {
|
|
|
216
216
|
}
|
|
217
217
|
return Array.from(t).slice(0, 3);
|
|
218
218
|
}
|
|
219
|
-
const
|
|
219
|
+
const Zs = [
|
|
220
220
|
"error",
|
|
221
221
|
"error_code",
|
|
222
222
|
"error_tag",
|
|
@@ -227,14 +227,14 @@ const Xs = [
|
|
|
227
227
|
"httpCode",
|
|
228
228
|
"errorExtra"
|
|
229
229
|
];
|
|
230
|
-
function
|
|
231
|
-
return e ?
|
|
230
|
+
function Qs(e) {
|
|
231
|
+
return e ? Zs.some((t) => e[t] !== void 0) : !1;
|
|
232
232
|
}
|
|
233
233
|
const Be = {
|
|
234
234
|
MAX_ITEMS_LIMIT_REACHED: "This project has reached the maximum number of active tasks per project (subtasks count toward it; completed tasks do not). The cap is the same on every Todoist plan — upgrading will not raise it — and it is not an authentication or permission problem. Complete, delete, or move existing tasks out of the project, or add the task to a different project, then retry.",
|
|
235
235
|
USER_CANNOT_VIEW_TEMPLATE: "This template exists but belongs to another account. Personal templates are private to whoever saved them, and a link to one cannot be used by anyone else. Use a public gallery template instead, or ask the owner to export it with export-project-template and share the CSV."
|
|
236
236
|
};
|
|
237
|
-
function
|
|
237
|
+
function eo(...e) {
|
|
238
238
|
for (const t of e) {
|
|
239
239
|
if (!t)
|
|
240
240
|
continue;
|
|
@@ -245,23 +245,23 @@ function Qs(...e) {
|
|
|
245
245
|
return Be[r];
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
|
-
function
|
|
248
|
+
function to(e) {
|
|
249
249
|
if (e.tag) {
|
|
250
250
|
const t = Be[e.tag.toUpperCase()];
|
|
251
251
|
if (t)
|
|
252
252
|
return t;
|
|
253
253
|
}
|
|
254
|
-
return
|
|
254
|
+
return eo(...e.rawText ?? [], e.message, e.details);
|
|
255
255
|
}
|
|
256
|
-
function
|
|
257
|
-
const t =
|
|
256
|
+
function so(e) {
|
|
257
|
+
const t = to(e);
|
|
258
258
|
if (t)
|
|
259
259
|
return t;
|
|
260
260
|
const { statusCode: o } = e, r = e.fieldHints.length > 0;
|
|
261
261
|
return o === 401 ? "Authentication failed. Verify your API token, then retry." : o === 403 ? "Access denied. Retrying the same request will not help. If it's a scope/access problem (for example, insufficient token scope), use a token or account with the required access. Otherwise, change the request or target instead." : o === 404 ? "Confirm the referenced IDs exist and are accessible, then retry." : o === 429 ? "Rate limit reached. Wait briefly and retry." : o !== void 0 && o >= 500 ? "Todoist API may be temporarily unavailable. Retry shortly." : r ? "Fix the field hints above and retry." : o === 400 || o === 422 ? "Check parameter values and formats, then retry." : "Check the request parameters and retry.";
|
|
262
262
|
}
|
|
263
263
|
function Je(e) {
|
|
264
|
-
const t =
|
|
264
|
+
const t = X(e) ? e : void 0, o = e instanceof Error && X(e.cause) ? e.cause : void 0, r = He(t?.response, o?.response), n = He(
|
|
265
265
|
t?.responseData,
|
|
266
266
|
r?.data,
|
|
267
267
|
t?.data,
|
|
@@ -297,24 +297,24 @@ function Je(e) {
|
|
|
297
297
|
), d = [
|
|
298
298
|
w(n?.error),
|
|
299
299
|
w(n?.message),
|
|
300
|
-
|
|
300
|
+
V(n?.message),
|
|
301
301
|
w(t?.message),
|
|
302
302
|
w(o?.message),
|
|
303
303
|
e instanceof Error ? e.message : w(e)
|
|
304
304
|
].filter((m) => !!m), l = d.find((m) => !We(m)) || d[0], p = L(
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
), u =
|
|
312
|
-
return i !== void 0 ||
|
|
305
|
+
V(n?.errorExtra),
|
|
306
|
+
V(n?.error_extra),
|
|
307
|
+
V(n?.details),
|
|
308
|
+
V(n?.errorDetails),
|
|
309
|
+
V(n?.errors),
|
|
310
|
+
V(t?.details)
|
|
311
|
+
), u = Xs(n);
|
|
312
|
+
return i !== void 0 || Qs(n) || c !== void 0 || a !== void 0 || (l ? We(l) : !1) ? {
|
|
313
313
|
statusCode: i,
|
|
314
314
|
code: a,
|
|
315
|
-
tag: c ?
|
|
316
|
-
message: l ?
|
|
317
|
-
details: p ?
|
|
315
|
+
tag: c ? U(c, 80) : void 0,
|
|
316
|
+
message: l ? U(l) : void 0,
|
|
317
|
+
details: p ? U(p) : void 0,
|
|
318
318
|
rawText: d,
|
|
319
319
|
fieldHints: u
|
|
320
320
|
} : null;
|
|
@@ -323,15 +323,15 @@ function Bt(e) {
|
|
|
323
323
|
const t = [];
|
|
324
324
|
return e.statusCode !== void 0 && t.push(`HTTP ${e.statusCode}`), e.code !== void 0 && t.push(`code ${e.code}`), e.tag && t.push(`tag ${e.tag}`), t;
|
|
325
325
|
}
|
|
326
|
-
function
|
|
326
|
+
function oo(e) {
|
|
327
327
|
const t = Bt(e), o = [
|
|
328
328
|
t.length > 0 ? `Todoist API request failed (${t.join(", ")}).` : "Todoist API request failed."
|
|
329
329
|
];
|
|
330
|
-
return e.message && o.push(`Message: ${e.message}`), e.details && e.details !== e.message && o.push(`Details: ${e.details}`), e.fieldHints.length > 0 && o.push(`Field hints: ${e.fieldHints.join("; ")}`), o.push(`Try next: ${
|
|
330
|
+
return e.message && o.push(`Message: ${e.message}`), e.details && e.details !== e.message && o.push(`Details: ${e.details}`), e.fieldHints.length > 0 && o.push(`Field hints: ${e.fieldHints.join("; ")}`), o.push(`Try next: ${so(e)}`), o.join(`
|
|
331
331
|
`);
|
|
332
332
|
}
|
|
333
333
|
function zt(e) {
|
|
334
|
-
return e instanceof Error ?
|
|
334
|
+
return e instanceof Error ? U(e.message) : typeof e == "string" ? U(e) : "An unknown error occurred";
|
|
335
335
|
}
|
|
336
336
|
class ve extends Error {
|
|
337
337
|
constructor(t) {
|
|
@@ -352,7 +352,7 @@ function z(e) {
|
|
|
352
352
|
const o = Bt(t), r = t.message && !(o.length > 0 && We(t.message)) ? t.message : "Todoist API request failed";
|
|
353
353
|
return o.length > 0 ? `${r} (${o.join(", ")})` : r;
|
|
354
354
|
}
|
|
355
|
-
function
|
|
355
|
+
function ro(e, {
|
|
356
356
|
taskContent: t,
|
|
357
357
|
dueString: o,
|
|
358
358
|
deadlineDate: r
|
|
@@ -365,14 +365,14 @@ function oo(e, {
|
|
|
365
365
|
const d = o.trim().replace(/^recurring(?:\s+|$)/i, "").trim();
|
|
366
366
|
return d !== o.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 !== o.trim() ? `Task "${t}" wasn't created because \`dueString\` could not be parsed. Use a complete Todoist recurrence expression; \`recurring\` alone is not valid. Change only \`dueString\` and retry.` : `Task "${t}" wasn't created because \`dueString\` could not be parsed. Change only \`dueString\` and retry.`;
|
|
367
367
|
}
|
|
368
|
-
function
|
|
368
|
+
function no(e) {
|
|
369
369
|
if (e instanceof _s || e instanceof ve || e instanceof Kt)
|
|
370
370
|
return e.message;
|
|
371
371
|
const t = Je(e);
|
|
372
|
-
return t ?
|
|
372
|
+
return t ? oo(t) : zt(e);
|
|
373
373
|
}
|
|
374
|
-
const
|
|
375
|
-
version:
|
|
374
|
+
const io = "13.1.1", ao = {
|
|
375
|
+
version: io
|
|
376
376
|
}, C = {
|
|
377
377
|
/** Default limit for task listings */
|
|
378
378
|
TASKS_DEFAULT: 10,
|
|
@@ -485,50 +485,50 @@ function qt() {
|
|
|
485
485
|
}
|
|
486
486
|
const ft = /* @__PURE__ */ new Map(), Gt = /* @__PURE__ */ new WeakMap();
|
|
487
487
|
let bt;
|
|
488
|
-
function
|
|
488
|
+
function co() {
|
|
489
489
|
return bt ??= qt(), bt;
|
|
490
490
|
}
|
|
491
|
-
function
|
|
491
|
+
function lo(e) {
|
|
492
492
|
return Lt("sha256").update(e).digest("hex");
|
|
493
493
|
}
|
|
494
|
-
function
|
|
495
|
-
const o =
|
|
494
|
+
function uo(e, t) {
|
|
495
|
+
const o = lo(t);
|
|
496
496
|
let r = ft.get(o);
|
|
497
497
|
r || (r = qt(), ft.set(o, r)), Gt.set(e, r);
|
|
498
498
|
}
|
|
499
499
|
function Vt(e) {
|
|
500
|
-
return Gt.get(e) ??
|
|
500
|
+
return Gt.get(e) ?? co();
|
|
501
501
|
}
|
|
502
|
-
function
|
|
502
|
+
function po(e) {
|
|
503
503
|
return Vt(e).moves;
|
|
504
504
|
}
|
|
505
|
-
function
|
|
505
|
+
function ho(e) {
|
|
506
506
|
return Vt(e).writes;
|
|
507
507
|
}
|
|
508
|
-
const
|
|
508
|
+
const mo = "todoist-mcp", Xe = ao.version, Jt = new Us(), gt = Rs(import.meta.url);
|
|
509
509
|
let Te;
|
|
510
|
-
const
|
|
510
|
+
const fo = async () => {
|
|
511
511
|
const e = gt.resolve("@doist/todoist-sdk"), t = _e(Nt(e), "transport", "http-dispatcher.js");
|
|
512
512
|
return gt(t);
|
|
513
513
|
};
|
|
514
|
-
let
|
|
515
|
-
function
|
|
516
|
-
return `${
|
|
514
|
+
let bo = fo;
|
|
515
|
+
function go() {
|
|
516
|
+
return `${mo}/${Xe}`;
|
|
517
517
|
}
|
|
518
518
|
function Xt(e) {
|
|
519
519
|
return e.trim().toLowerCase();
|
|
520
520
|
}
|
|
521
|
-
function
|
|
521
|
+
function yo(e, t) {
|
|
522
522
|
return Jt.run(Xt(e), t);
|
|
523
523
|
}
|
|
524
|
-
function
|
|
524
|
+
function To({
|
|
525
525
|
label: e,
|
|
526
526
|
platform: t = "mcp",
|
|
527
527
|
sessionId: o = Pe()
|
|
528
528
|
} = {}) {
|
|
529
529
|
const r = e ? Xt(e) : Jt.getStore();
|
|
530
530
|
return {
|
|
531
|
-
"User-Agent":
|
|
531
|
+
"User-Agent": go(),
|
|
532
532
|
"doist-platform": t,
|
|
533
533
|
"doist-version": Xe,
|
|
534
534
|
"request-id": Pe(),
|
|
@@ -536,16 +536,16 @@ function yo({
|
|
|
536
536
|
"mcp-tool": r ?? "unknown"
|
|
537
537
|
};
|
|
538
538
|
}
|
|
539
|
-
function
|
|
539
|
+
function ko(e, t) {
|
|
540
540
|
const o = new Headers(e);
|
|
541
|
-
for (const [r, n] of Object.entries(
|
|
541
|
+
for (const [r, n] of Object.entries(To(t)))
|
|
542
542
|
o.set(r, n);
|
|
543
543
|
return Object.fromEntries(o.entries());
|
|
544
544
|
}
|
|
545
545
|
function yt() {
|
|
546
546
|
return new DOMException("The operation was aborted due to timeout", "TimeoutError");
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function wo(e, t) {
|
|
549
549
|
if (!e && t === void 0)
|
|
550
550
|
return {
|
|
551
551
|
signal: void 0,
|
|
@@ -583,20 +583,20 @@ function ko(e, t) {
|
|
|
583
583
|
}
|
|
584
584
|
};
|
|
585
585
|
}
|
|
586
|
-
async function
|
|
587
|
-
if (
|
|
588
|
-
return Te || (Te =
|
|
586
|
+
async function vo() {
|
|
587
|
+
if (Io())
|
|
588
|
+
return Te || (Te = bo().then((e) => e.getDefaultDispatcher()).catch((e) => {
|
|
589
589
|
throw Te = void 0, e;
|
|
590
590
|
})), Te;
|
|
591
591
|
}
|
|
592
|
-
function
|
|
592
|
+
function Io() {
|
|
593
593
|
return typeof process < "u" && !!process.versions?.node;
|
|
594
594
|
}
|
|
595
|
-
async function
|
|
596
|
-
const t = await
|
|
595
|
+
async function So(e) {
|
|
596
|
+
const t = await vo();
|
|
597
597
|
t !== void 0 && (e.dispatcher = t);
|
|
598
598
|
}
|
|
599
|
-
function
|
|
599
|
+
function jo(e) {
|
|
600
600
|
return {
|
|
601
601
|
ok: e.ok,
|
|
602
602
|
status: e.status,
|
|
@@ -607,36 +607,36 @@ function So(e) {
|
|
|
607
607
|
arrayBuffer: () => e.arrayBuffer()
|
|
608
608
|
};
|
|
609
609
|
}
|
|
610
|
-
function
|
|
610
|
+
function Co(e = globalThis.fetch, t = {}) {
|
|
611
611
|
const o = e === globalThis.fetch, { enabled: r = !0, platform: n = "mcp", sessionId: i = Pe() } = t;
|
|
612
612
|
return async (a, c = {}) => {
|
|
613
|
-
const { timeout: d, headers: l, signal: p, ...u } = c, { signal: h, cleanup: m } =
|
|
613
|
+
const { timeout: d, headers: l, signal: p, ...u } = c, { signal: h, cleanup: m } = wo(p, d);
|
|
614
614
|
try {
|
|
615
615
|
const g = {
|
|
616
616
|
...u,
|
|
617
617
|
signal: h,
|
|
618
|
-
...r ? { headers:
|
|
618
|
+
...r ? { headers: ko(l, { platform: n, sessionId: i }) } : l !== void 0 ? { headers: l } : {}
|
|
619
619
|
};
|
|
620
|
-
o && await
|
|
620
|
+
o && await So(g);
|
|
621
621
|
const f = await e(a, g);
|
|
622
|
-
return
|
|
622
|
+
return jo(f);
|
|
623
623
|
} finally {
|
|
624
624
|
m();
|
|
625
625
|
}
|
|
626
626
|
};
|
|
627
627
|
}
|
|
628
|
-
function
|
|
628
|
+
function $o(e, {
|
|
629
629
|
baseUrl: t,
|
|
630
630
|
tracking: o
|
|
631
631
|
} = {}) {
|
|
632
632
|
const r = new Ls(e, {
|
|
633
|
-
customFetch:
|
|
633
|
+
customFetch: Co(globalThis.fetch, o),
|
|
634
634
|
...t ? { baseUrl: t } : {}
|
|
635
635
|
});
|
|
636
|
-
return
|
|
636
|
+
return uo(r, e), r;
|
|
637
637
|
}
|
|
638
|
-
const
|
|
639
|
-
function
|
|
638
|
+
const Do = 2, xo = 500, Ao = 2e3, Eo = 50, Oo = /* @__PURE__ */ new Set([502, 503, 504]);
|
|
639
|
+
function Po(e) {
|
|
640
640
|
if (e == null || typeof e != "object")
|
|
641
641
|
return;
|
|
642
642
|
const t = e;
|
|
@@ -652,31 +652,31 @@ function Oo(e) {
|
|
|
652
652
|
return Number(o[1]);
|
|
653
653
|
}
|
|
654
654
|
}
|
|
655
|
-
function
|
|
656
|
-
const t =
|
|
657
|
-
return t !== void 0 &&
|
|
655
|
+
function _o(e) {
|
|
656
|
+
const t = Po(e);
|
|
657
|
+
return t !== void 0 && Oo.has(t);
|
|
658
658
|
}
|
|
659
|
-
function
|
|
659
|
+
function Uo({
|
|
660
660
|
attempt: e,
|
|
661
661
|
baseDelayMs: t,
|
|
662
662
|
maxDelayMs: o,
|
|
663
663
|
random: r = Math.random
|
|
664
664
|
}) {
|
|
665
665
|
const n = Math.min(t * 2 ** e, o), i = Math.round(r() * n);
|
|
666
|
-
return Math.min(n, Math.max(
|
|
666
|
+
return Math.min(n, Math.max(Eo, i));
|
|
667
667
|
}
|
|
668
668
|
function Ro(e) {
|
|
669
669
|
return new Promise((t) => setTimeout(t, e));
|
|
670
670
|
}
|
|
671
671
|
async function O(e, t = {}) {
|
|
672
|
-
const o = t.maxRetries ??
|
|
672
|
+
const o = t.maxRetries ?? Do, r = t.baseDelayMs ?? xo, n = t.maxDelayMs ?? Ao, i = t.random;
|
|
673
673
|
let a;
|
|
674
674
|
for (let c = 0; c <= o; c++)
|
|
675
675
|
try {
|
|
676
676
|
return await e();
|
|
677
677
|
} catch (d) {
|
|
678
|
-
if (a = d, c < o &&
|
|
679
|
-
const l =
|
|
678
|
+
if (a = d, c < o && _o(d)) {
|
|
679
|
+
const l = Uo({ attempt: c, baseDelayMs: r, maxDelayMs: n, random: i });
|
|
680
680
|
await Ro(l);
|
|
681
681
|
continue;
|
|
682
682
|
}
|
|
@@ -765,55 +765,55 @@ const y = {
|
|
|
765
765
|
// OpenAI MCP tools
|
|
766
766
|
SEARCH: "search",
|
|
767
767
|
FETCH: "fetch"
|
|
768
|
-
},
|
|
768
|
+
}, Yd = {
|
|
769
769
|
/**
|
|
770
770
|
* Strips email addresses from tool outputs that expose user data.
|
|
771
771
|
* Affects: find-project-collaborators, find-completed-tasks
|
|
772
772
|
*/
|
|
773
773
|
STRIP_EMAILS: "strip_emails"
|
|
774
|
-
},
|
|
775
|
-
function
|
|
774
|
+
}, Lo = process.env.USE_STRUCTURED_CONTENT === "true" || process.env.NODE_ENV === "test";
|
|
775
|
+
function No({
|
|
776
776
|
textContent: e,
|
|
777
777
|
structuredContent: t,
|
|
778
778
|
contentItems: o
|
|
779
779
|
}) {
|
|
780
780
|
const r = Ke(t), n = {}, i = [];
|
|
781
|
-
return o && i.push(...o), !
|
|
781
|
+
return o && i.push(...o), !Lo && t && i.push({
|
|
782
782
|
type: "text",
|
|
783
783
|
text: JSON.stringify(r)
|
|
784
784
|
}), e && i.push({ type: "text", text: e }), i.length > 0 && (n.content = i), t && (n.structuredContent = r), n;
|
|
785
785
|
}
|
|
786
|
-
function
|
|
786
|
+
function Mo(e) {
|
|
787
787
|
return {
|
|
788
788
|
content: [{ type: "text", text: e }],
|
|
789
789
|
isError: !0
|
|
790
790
|
};
|
|
791
791
|
}
|
|
792
|
-
const
|
|
793
|
-
function
|
|
792
|
+
const Fo = /* @__PURE__ */ new Set(["file"]);
|
|
793
|
+
function Ho(e) {
|
|
794
794
|
return !e || typeof e != "object" || Array.isArray(e) ? e : Object.fromEntries(
|
|
795
795
|
Object.entries(e).map(
|
|
796
|
-
([t, o]) =>
|
|
796
|
+
([t, o]) => Fo.has(t) && o !== void 0 ? [t, "[redacted]"] : [t, o]
|
|
797
797
|
)
|
|
798
798
|
);
|
|
799
799
|
}
|
|
800
|
-
function
|
|
800
|
+
function Wo(e) {
|
|
801
801
|
return { ...{
|
|
802
|
-
title: `Todoist: ${
|
|
802
|
+
title: `Todoist: ${Bo(e.name)}`,
|
|
803
803
|
openWorldHint: !1
|
|
804
804
|
}, ...e.annotations };
|
|
805
805
|
}
|
|
806
|
-
function
|
|
806
|
+
function Bo(e) {
|
|
807
807
|
return e.split("-").filter(Boolean).map((t) => `${t.charAt(0).toUpperCase()}${t.slice(1)}`).join(" ");
|
|
808
808
|
}
|
|
809
|
-
function
|
|
809
|
+
function zo(e) {
|
|
810
810
|
return e ? typeof e["ui/resourceUri"] == "string" ? !0 : typeof e.ui == "object" && e.ui !== null : !1;
|
|
811
811
|
}
|
|
812
|
-
function
|
|
812
|
+
function Ko(e) {
|
|
813
813
|
const t = typeof e.ui == "object" && e.ui !== null ? e.ui : void 0, o = t?.resourceUri, r = e["ui/resourceUri"];
|
|
814
814
|
return typeof o == "string" && typeof r != "string" ? { ...e, "ui/resourceUri": o } : typeof r == "string" && typeof o != "string" ? { ...e, ui: { ...t, resourceUri: r } } : e;
|
|
815
815
|
}
|
|
816
|
-
const
|
|
816
|
+
const Yo = [
|
|
817
817
|
y.FIND_PROJECT_COLLABORATORS,
|
|
818
818
|
y.FIND_COMPLETED_TASKS
|
|
819
819
|
];
|
|
@@ -830,36 +830,36 @@ function Ye(e) {
|
|
|
830
830
|
}
|
|
831
831
|
return e;
|
|
832
832
|
}
|
|
833
|
-
function
|
|
833
|
+
function qo(e) {
|
|
834
834
|
const t = /\s*\([^)]*@[^)]+\)/g, o = /\S+@\S+\.\S+/g;
|
|
835
835
|
return e.replace(t, "").replace(o, "[email hidden]");
|
|
836
836
|
}
|
|
837
|
-
function
|
|
837
|
+
function Go({
|
|
838
838
|
tool: e,
|
|
839
839
|
server: t,
|
|
840
840
|
client: o,
|
|
841
841
|
features: r = []
|
|
842
842
|
}) {
|
|
843
|
-
const n = r.some((p) => p.name === "strip_emails") &&
|
|
843
|
+
const n = r.some((p) => p.name === "strip_emails") && Yo.includes(e.name), i = e.execute, a = s.object(e.parameters), c = e.outputSchema ? s.object(e.outputSchema) : void 0, d = async (p, u) => {
|
|
844
844
|
try {
|
|
845
|
-
let { textContent: h, structuredContent: m, contentItems: g } = await
|
|
845
|
+
let { textContent: h, structuredContent: m, contentItems: g } = await yo(
|
|
846
846
|
e.name,
|
|
847
847
|
() => O(() => i(p, o))
|
|
848
848
|
);
|
|
849
|
-
return n && (h && (h =
|
|
849
|
+
return n && (h && (h = qo(h)), m && (m = Ye(m))), No({ textContent: h, structuredContent: m, contentItems: g });
|
|
850
850
|
} catch (h) {
|
|
851
|
-
return console.error(`Error executing tool ${e.name}:`, { args:
|
|
851
|
+
return console.error(`Error executing tool ${e.name}:`, { args: Ho(p), error: h }), Mo(no(h));
|
|
852
852
|
}
|
|
853
853
|
}, l = {
|
|
854
854
|
description: e.description,
|
|
855
855
|
inputSchema: a,
|
|
856
856
|
...c ? { outputSchema: c } : {},
|
|
857
|
-
annotations:
|
|
858
|
-
...e._meta ? { _meta:
|
|
857
|
+
annotations: Wo(e),
|
|
858
|
+
...e._meta ? { _meta: zo(e._meta) ? Ko(e._meta) : e._meta } : {}
|
|
859
859
|
};
|
|
860
860
|
t.registerTool(e.name, l, d);
|
|
861
861
|
}
|
|
862
|
-
const
|
|
862
|
+
const Vo = s.object({
|
|
863
863
|
period: s.enum(["today", "7d", "14d", "30d", "this-week", "this-month"]).default("7d").describe(
|
|
864
864
|
'Time period for the analysis. "today" analyzes the current day, "7d"/"14d"/"30d" analyze the last N days, "this-week" and "this-month" analyze the current week or month.'
|
|
865
865
|
),
|
|
@@ -868,7 +868,7 @@ const Go = s.object({
|
|
|
868
868
|
),
|
|
869
869
|
projectId: s.string().optional().describe("Optional project ID to scope the analysis to a specific project.")
|
|
870
870
|
});
|
|
871
|
-
function
|
|
871
|
+
function Jo(e, t = /* @__PURE__ */ new Date()) {
|
|
872
872
|
const o = (n) => n.toISOString().slice(0, 10), r = o(t);
|
|
873
873
|
switch (e) {
|
|
874
874
|
case "today":
|
|
@@ -915,7 +915,7 @@ function Vo(e, t = /* @__PURE__ */ new Date()) {
|
|
|
915
915
|
}
|
|
916
916
|
}
|
|
917
917
|
}
|
|
918
|
-
function
|
|
918
|
+
function Xo(e) {
|
|
919
919
|
const t = {
|
|
920
920
|
goals: `### Goal Tracking
|
|
921
921
|
- Compare tasks completed today vs the daily goal
|
|
@@ -946,8 +946,8 @@ function Jo(e) {
|
|
|
946
946
|
|
|
947
947
|
`) : t[e] ?? "";
|
|
948
948
|
}
|
|
949
|
-
function
|
|
950
|
-
const { since: t, until: o, periodDescription: r } =
|
|
949
|
+
function Zo(e) {
|
|
950
|
+
const { since: t, until: o, periodDescription: r } = Jo(e.period), n = e.projectId ? `
|
|
951
951
|
Scope this analysis to project ID: ${e.projectId}. Pass this projectId when calling find-completed-tasks and get-overview.` : "";
|
|
952
952
|
return `Analyze my Todoist productivity for ${r} (${t} to ${o}).${n}
|
|
953
953
|
|
|
@@ -968,7 +968,7 @@ ${e.focus === "overall" || e.focus === "projects" ? `4. **get-overview** — Get
|
|
|
968
968
|
|
|
969
969
|
Using the collected data, produce an analysis covering the following sections:
|
|
970
970
|
|
|
971
|
-
${
|
|
971
|
+
${Xo(e.focus)}
|
|
972
972
|
|
|
973
973
|
### Step 3: Format
|
|
974
974
|
|
|
@@ -978,14 +978,14 @@ Present the analysis as a clear, well-structured markdown report with:
|
|
|
978
978
|
- Specific numbers and comparisons (not vague statements)
|
|
979
979
|
- Actionable takeaways highlighted clearly`;
|
|
980
980
|
}
|
|
981
|
-
function
|
|
981
|
+
function Qo(e) {
|
|
982
982
|
return {
|
|
983
983
|
messages: [
|
|
984
984
|
{
|
|
985
985
|
role: "user",
|
|
986
986
|
content: {
|
|
987
987
|
type: "text",
|
|
988
|
-
text:
|
|
988
|
+
text: Zo(e)
|
|
989
989
|
}
|
|
990
990
|
}
|
|
991
991
|
]
|
|
@@ -995,8 +995,8 @@ const me = {
|
|
|
995
995
|
name: "productivity-analysis",
|
|
996
996
|
title: "Productivity Analysis",
|
|
997
997
|
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.",
|
|
998
|
-
argsSchema:
|
|
999
|
-
callback:
|
|
998
|
+
argsSchema: Vo,
|
|
999
|
+
callback: Qo
|
|
1000
1000
|
};
|
|
1001
1001
|
class _ extends Error {
|
|
1002
1002
|
constructor(t, o) {
|
|
@@ -1037,19 +1037,19 @@ function Zt(e) {
|
|
|
1037
1037
|
throw new _(e, "Duration cannot exceed 24 hours (1440 minutes)");
|
|
1038
1038
|
return { minutes: r };
|
|
1039
1039
|
}
|
|
1040
|
-
function
|
|
1040
|
+
function er(e) {
|
|
1041
1041
|
if (e <= 0) return "0m";
|
|
1042
1042
|
const t = Math.floor(e / 60), o = e % 60;
|
|
1043
1043
|
return t === 0 ? `${o}m` : o === 0 ? `${t}h` : `${t}h${o}m`;
|
|
1044
1044
|
}
|
|
1045
|
-
const
|
|
1045
|
+
const tr = ["p1", "p2", "p3", "p4"], Ze = 'Task priority as a string: "p1" (highest), "p2" (high), "p3" (medium), or "p4" (lowest/default). Integers like 1, 2, 3, or 4 are not accepted.', Qe = s.enum(tr).describe(Ze);
|
|
1046
1046
|
function Qt(e) {
|
|
1047
1047
|
return { p1: 4, p2: 3, p3: 2, p4: 1 }[e];
|
|
1048
1048
|
}
|
|
1049
|
-
function
|
|
1049
|
+
function sr(e) {
|
|
1050
1050
|
return { 4: "p1", 3: "p2", 2: "p3", 1: "p4" }[e];
|
|
1051
1051
|
}
|
|
1052
|
-
const es = 300 * 1e3,
|
|
1052
|
+
const es = 300 * 1e3, or = 1e4, rr = 1e3;
|
|
1053
1053
|
class ts {
|
|
1054
1054
|
constructor(t, o) {
|
|
1055
1055
|
this.maxEntries = t, this.ttl = o, this.entries = /* @__PURE__ */ new Map();
|
|
@@ -1084,13 +1084,13 @@ class ts {
|
|
|
1084
1084
|
}
|
|
1085
1085
|
}
|
|
1086
1086
|
const Ae = new ts(
|
|
1087
|
-
|
|
1087
|
+
or,
|
|
1088
1088
|
es
|
|
1089
1089
|
), re = new ts(
|
|
1090
|
-
|
|
1090
|
+
rr,
|
|
1091
1091
|
es
|
|
1092
|
-
),
|
|
1093
|
-
class
|
|
1092
|
+
), nr = "me";
|
|
1093
|
+
class ir {
|
|
1094
1094
|
/**
|
|
1095
1095
|
* Resolve a user name or ID to a user ID by looking up collaborators across all shared projects.
|
|
1096
1096
|
* Supports exact name matches, partial matches, email matches, and the "me" keyword.
|
|
@@ -1099,7 +1099,7 @@ class nr {
|
|
|
1099
1099
|
if (!o || o.trim().length === 0)
|
|
1100
1100
|
return null;
|
|
1101
1101
|
const r = o.trim();
|
|
1102
|
-
if (r.toLowerCase() ===
|
|
1102
|
+
if (r.toLowerCase() === nr)
|
|
1103
1103
|
try {
|
|
1104
1104
|
const d = await t.getUser();
|
|
1105
1105
|
return {
|
|
@@ -1225,11 +1225,11 @@ class nr {
|
|
|
1225
1225
|
Ae.clear(), re.clear();
|
|
1226
1226
|
}
|
|
1227
1227
|
}
|
|
1228
|
-
const N = new
|
|
1229
|
-
async function
|
|
1228
|
+
const N = new ir();
|
|
1229
|
+
async function ar(e, t) {
|
|
1230
1230
|
return N.resolveUser(e, t);
|
|
1231
1231
|
}
|
|
1232
|
-
async function
|
|
1232
|
+
async function cr(e, t) {
|
|
1233
1233
|
const o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), n = [], i = [];
|
|
1234
1234
|
for (const a of t) {
|
|
1235
1235
|
const c = a.trim().toLowerCase();
|
|
@@ -1254,7 +1254,7 @@ const ss = ["assigned", "unassignedOrMe", "all"];
|
|
|
1254
1254
|
async function et(e, t) {
|
|
1255
1255
|
if (!t)
|
|
1256
1256
|
return;
|
|
1257
|
-
const o = await
|
|
1257
|
+
const o = await ar(e, t);
|
|
1258
1258
|
if (!o)
|
|
1259
1259
|
throw new Error(
|
|
1260
1260
|
`Could not find user: "${t}". Make sure the user is a collaborator on a shared project.`
|
|
@@ -1271,7 +1271,7 @@ function os({
|
|
|
1271
1271
|
}) {
|
|
1272
1272
|
return e && t ? `assigned to: ${t}` : o === "unassignedOrMe" ? "!assigned to: others" : o === "assigned" ? "assigned to: others" : "";
|
|
1273
1273
|
}
|
|
1274
|
-
function
|
|
1274
|
+
function dr({
|
|
1275
1275
|
tasks: e,
|
|
1276
1276
|
resolvedAssigneeId: t,
|
|
1277
1277
|
currentUserId: o,
|
|
@@ -1321,14 +1321,14 @@ async function ns(e) {
|
|
|
1321
1321
|
limit: C.PROJECTS_MAX
|
|
1322
1322
|
});
|
|
1323
1323
|
}
|
|
1324
|
-
async function
|
|
1324
|
+
async function lr(e) {
|
|
1325
1325
|
return F({
|
|
1326
1326
|
apiMethod: e.getArchivedProjects.bind(e),
|
|
1327
1327
|
args: {},
|
|
1328
1328
|
limit: C.PROJECTS_MAX
|
|
1329
1329
|
});
|
|
1330
1330
|
}
|
|
1331
|
-
function
|
|
1331
|
+
function ur(e) {
|
|
1332
1332
|
const t = (i) => i.replaceAll(/[.*+?^${}()|[\]\\]/g, "\\$&"), o = /(?<!\\)(?:\\\\)*\*/.test(e), r = [...e];
|
|
1333
1333
|
let n = "";
|
|
1334
1334
|
for (let i = 0; i < r.length; i++) {
|
|
@@ -1337,21 +1337,21 @@ function lr(e) {
|
|
|
1337
1337
|
}
|
|
1338
1338
|
return new RegExp(o ? `^${n}$` : n, "iu");
|
|
1339
1339
|
}
|
|
1340
|
-
async function
|
|
1340
|
+
async function pr(e, t) {
|
|
1341
1341
|
return F({
|
|
1342
1342
|
apiMethod: e.searchLabels.bind(e),
|
|
1343
1343
|
args: { query: tt(t) },
|
|
1344
1344
|
limit: C.LABELS_MAX
|
|
1345
1345
|
});
|
|
1346
1346
|
}
|
|
1347
|
-
async function
|
|
1347
|
+
async function hr(e) {
|
|
1348
1348
|
return F({
|
|
1349
1349
|
apiMethod: e.getSharedLabels.bind(e),
|
|
1350
1350
|
args: {},
|
|
1351
1351
|
limit: C.LABELS_MAX
|
|
1352
1352
|
});
|
|
1353
1353
|
}
|
|
1354
|
-
async function
|
|
1354
|
+
async function mr(e, t, o) {
|
|
1355
1355
|
const r = tt(t);
|
|
1356
1356
|
return F({
|
|
1357
1357
|
apiMethod: e.searchSections.bind(e),
|
|
@@ -1367,12 +1367,12 @@ function P(e) {
|
|
|
1367
1367
|
dueDate: e.due?.date,
|
|
1368
1368
|
recurring: e.due?.isRecurring && e.due.string ? e.due.string : !1,
|
|
1369
1369
|
deadlineDate: e.deadline?.date,
|
|
1370
|
-
priority:
|
|
1370
|
+
priority: sr(e.priority) ?? "p4",
|
|
1371
1371
|
projectId: e.projectId,
|
|
1372
1372
|
sectionId: e.sectionId ?? void 0,
|
|
1373
1373
|
parentId: e.parentId ?? void 0,
|
|
1374
1374
|
labels: e.labels,
|
|
1375
|
-
duration: e.duration ?
|
|
1375
|
+
duration: e.duration ? er(e.duration.amount) : void 0,
|
|
1376
1376
|
responsibleUid: e.responsibleUid ?? void 0,
|
|
1377
1377
|
assignedByUid: e.assignedByUid ?? void 0,
|
|
1378
1378
|
checked: e.checked,
|
|
@@ -1422,7 +1422,7 @@ function ge(e) {
|
|
|
1422
1422
|
} : void 0
|
|
1423
1423
|
};
|
|
1424
1424
|
}
|
|
1425
|
-
function
|
|
1425
|
+
function fr(e) {
|
|
1426
1426
|
return {
|
|
1427
1427
|
id: e.id ?? void 0,
|
|
1428
1428
|
objectType: e.objectType,
|
|
@@ -1435,7 +1435,7 @@ function mr(e) {
|
|
|
1435
1435
|
extraData: e.extraData ?? void 0
|
|
1436
1436
|
};
|
|
1437
1437
|
}
|
|
1438
|
-
const
|
|
1438
|
+
const br = se.object({
|
|
1439
1439
|
httpStatusCode: se.number(),
|
|
1440
1440
|
responseData: se.object({
|
|
1441
1441
|
error: se.string(),
|
|
@@ -1453,7 +1453,7 @@ async function st({
|
|
|
1453
1453
|
const { results: n, nextCursor: i } = await e.getTasksByFilter({ query: t, cursor: r, limit: o });
|
|
1454
1454
|
return { tasks: n.map(P), nextCursor: i };
|
|
1455
1455
|
} catch (n) {
|
|
1456
|
-
const i =
|
|
1456
|
+
const i = br.safeParse(n);
|
|
1457
1457
|
if (!i.success)
|
|
1458
1458
|
throw n;
|
|
1459
1459
|
const { responseData: a } = i.data;
|
|
@@ -1509,11 +1509,11 @@ function is(e) {
|
|
|
1509
1509
|
return { timeBasedCount: t, locationCount: o };
|
|
1510
1510
|
}
|
|
1511
1511
|
const as = "none";
|
|
1512
|
-
function
|
|
1512
|
+
function gr(e) {
|
|
1513
1513
|
return e.length === 1 && e[0]?.trim().toLowerCase() === as;
|
|
1514
1514
|
}
|
|
1515
|
-
async function
|
|
1516
|
-
const r = await
|
|
1515
|
+
async function yr(e, t, o) {
|
|
1516
|
+
const r = await Tr(e, t);
|
|
1517
1517
|
if (r)
|
|
1518
1518
|
return kt(
|
|
1519
1519
|
[...r.uidsToNotify ?? [], r.postedUid],
|
|
@@ -1524,7 +1524,7 @@ async function gr(e, t, o) {
|
|
|
1524
1524
|
const n = await e.getTask(t.taskId);
|
|
1525
1525
|
return kt([n.responsibleUid, n.assignedByUid, n.addedByUid], o);
|
|
1526
1526
|
}
|
|
1527
|
-
async function
|
|
1527
|
+
async function Tr(e, t) {
|
|
1528
1528
|
let o, r = null;
|
|
1529
1529
|
do {
|
|
1530
1530
|
const n = await e.getComments({
|
|
@@ -1543,13 +1543,13 @@ function kt(e, t) {
|
|
|
1543
1543
|
r && r !== t && o.add(r);
|
|
1544
1544
|
return [...o];
|
|
1545
1545
|
}
|
|
1546
|
-
const Ie =
|
|
1547
|
-
function
|
|
1546
|
+
const Ie = Re.map((e) => e.key);
|
|
1547
|
+
function kr(e) {
|
|
1548
1548
|
if (typeof e != "string") return;
|
|
1549
1549
|
const t = e.toLowerCase();
|
|
1550
|
-
return (
|
|
1550
|
+
return (Re.find((r) => r.key === t) ?? Re.find((r) => r.displayName.toLowerCase() === t))?.key;
|
|
1551
1551
|
}
|
|
1552
|
-
const
|
|
1552
|
+
const wr = `Color for the entity. Accepts a color key (e.g. "berry_red") or display name (e.g. "Berry Red"). Valid colors: ${Ie.join(", ")}. Unrecognized colors are omitted and charcoal will be used as the default.`, le = s.preprocess(kr, s.enum(Ie).optional()).describe(wr);
|
|
1553
1553
|
s.enum(Ie);
|
|
1554
1554
|
const ue = s.enum(Ie).optional().catch(void 0), H = s.object({
|
|
1555
1555
|
id: s.string(),
|
|
@@ -1584,16 +1584,16 @@ const ue = s.enum(Ie).optional().catch(void 0), H = s.object({
|
|
|
1584
1584
|
folderId: s.string().optional().describe("Workspace projects only."),
|
|
1585
1585
|
childOrder: s.number().describe("Ordering index among siblings."),
|
|
1586
1586
|
isArchived: s.boolean()
|
|
1587
|
-
}),
|
|
1587
|
+
}), K = s.object({
|
|
1588
1588
|
id: s.string(),
|
|
1589
1589
|
name: s.string(),
|
|
1590
1590
|
sectionOrder: s.number().describe("Ordering index within the project."),
|
|
1591
1591
|
description: s.string().optional().describe("Supports Markdown.")
|
|
1592
1592
|
});
|
|
1593
|
-
function
|
|
1593
|
+
function Y({ id: e, name: t, sectionOrder: o, description: r }) {
|
|
1594
1594
|
return { id: e, name: t, sectionOrder: o, description: r ?? void 0 };
|
|
1595
1595
|
}
|
|
1596
|
-
const
|
|
1596
|
+
const vr = s.object({
|
|
1597
1597
|
resourceType: s.string().describe("file, url, image, etc."),
|
|
1598
1598
|
fileName: s.string().optional(),
|
|
1599
1599
|
fileSize: s.number().optional().describe("Bytes."),
|
|
@@ -1614,8 +1614,8 @@ const wr = s.object({
|
|
|
1614
1614
|
postedAt: s.string().describe("ISO 8601."),
|
|
1615
1615
|
postedUid: s.string().optional(),
|
|
1616
1616
|
notifiedUserIds: s.array(s.string()).optional().describe("Users notified about this comment. Absent when nobody was notified."),
|
|
1617
|
-
fileAttachment:
|
|
1618
|
-
}),
|
|
1617
|
+
fileAttachment: vr.optional()
|
|
1618
|
+
}), Ir = s.object({
|
|
1619
1619
|
id: s.string().optional(),
|
|
1620
1620
|
objectType: s.string().describe("task, project, etc."),
|
|
1621
1621
|
objectId: s.string(),
|
|
@@ -1625,7 +1625,7 @@ const wr = s.object({
|
|
|
1625
1625
|
parentItemId: s.string().optional(),
|
|
1626
1626
|
initiatorId: s.string().optional().describe("User who initiated the event."),
|
|
1627
1627
|
extraData: s.record(s.string(), s.unknown()).optional()
|
|
1628
|
-
}),
|
|
1628
|
+
}), Sr = s.object({
|
|
1629
1629
|
id: s.string(),
|
|
1630
1630
|
name: s.string(),
|
|
1631
1631
|
email: s.string()
|
|
@@ -1635,7 +1635,7 @@ const wr = s.object({
|
|
|
1635
1635
|
color: ue,
|
|
1636
1636
|
order: s.number().optional().catch(void 0).describe("Display order."),
|
|
1637
1637
|
isFavorite: s.boolean()
|
|
1638
|
-
}),
|
|
1638
|
+
}), jr = s.object({
|
|
1639
1639
|
isRecurring: s.boolean(),
|
|
1640
1640
|
string: s.string().describe("Human-readable due string."),
|
|
1641
1641
|
date: s.string().describe("ISO 8601."),
|
|
@@ -1646,7 +1646,7 @@ const wr = s.object({
|
|
|
1646
1646
|
taskId: s.string(),
|
|
1647
1647
|
type: s.enum(Ns),
|
|
1648
1648
|
minuteOffset: s.number().optional().describe("Minutes before due. Relative reminders only."),
|
|
1649
|
-
due:
|
|
1649
|
+
due: jr.optional().describe("Absolute, and sometimes relative, reminders."),
|
|
1650
1650
|
name: s.string().optional().describe("Location name. Location reminders only."),
|
|
1651
1651
|
locLat: s.string().optional().describe("Location reminders only."),
|
|
1652
1652
|
locLong: s.string().optional().describe("Location reminders only."),
|
|
@@ -1657,7 +1657,7 @@ const wr = s.object({
|
|
|
1657
1657
|
item: s.string().describe("Usually the ID of the item that failed."),
|
|
1658
1658
|
error: s.string(),
|
|
1659
1659
|
code: s.string().optional()
|
|
1660
|
-
}),
|
|
1660
|
+
}), Cr = s.object({
|
|
1661
1661
|
taskId: s.string().optional().describe("The ID of the task to comment on."),
|
|
1662
1662
|
projectId: s.string().optional().describe(
|
|
1663
1663
|
'The ID of the project to comment on. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
@@ -1666,17 +1666,17 @@ const wr = s.object({
|
|
|
1666
1666
|
notifyUsers: s.array(s.string().min(1)).min(1).max(C.NOTIFY_USERS_MAX).optional().describe(
|
|
1667
1667
|
`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 ["${as}"] to notify nobody.`
|
|
1668
1668
|
)
|
|
1669
|
-
}),
|
|
1670
|
-
comments: s.array(
|
|
1671
|
-
},
|
|
1669
|
+
}), $r = {
|
|
1670
|
+
comments: s.array(Cr).min(1).describe("The array of comments to add.")
|
|
1671
|
+
}, Dr = {
|
|
1672
1672
|
comments: s.array(ye).describe("The created comments."),
|
|
1673
1673
|
totalCount: s.number().describe("The total number of comments created."),
|
|
1674
1674
|
addedCommentIds: s.array(s.string()).describe("The IDs of the added comments.")
|
|
1675
|
-
},
|
|
1675
|
+
}, xr = {
|
|
1676
1676
|
name: y.ADD_COMMENTS,
|
|
1677
1677
|
description: "Add multiple comments to tasks or projects, optionally notifying collaborators. Each comment must specify either taskId or projectId.",
|
|
1678
|
-
parameters:
|
|
1679
|
-
outputSchema:
|
|
1678
|
+
parameters: $r,
|
|
1679
|
+
outputSchema: Dr,
|
|
1680
1680
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1681
1681
|
async execute(e, t) {
|
|
1682
1682
|
const { comments: o } = e;
|
|
@@ -1699,7 +1699,7 @@ const wr = s.object({
|
|
|
1699
1699
|
});
|
|
1700
1700
|
return u.taskId ? { taskId: u.taskId } : { projectId: h };
|
|
1701
1701
|
})
|
|
1702
|
-
), c = await
|
|
1702
|
+
), c = await Ar({
|
|
1703
1703
|
comments: o,
|
|
1704
1704
|
targets: a,
|
|
1705
1705
|
client: t,
|
|
@@ -1717,7 +1717,7 @@ const wr = s.object({
|
|
|
1717
1717
|
})
|
|
1718
1718
|
)).map(ge);
|
|
1719
1719
|
return {
|
|
1720
|
-
textContent:
|
|
1720
|
+
textContent: Er({ comments: l }),
|
|
1721
1721
|
structuredContent: {
|
|
1722
1722
|
comments: l,
|
|
1723
1723
|
totalCount: l.length,
|
|
@@ -1726,7 +1726,7 @@ const wr = s.object({
|
|
|
1726
1726
|
};
|
|
1727
1727
|
}
|
|
1728
1728
|
};
|
|
1729
|
-
async function
|
|
1729
|
+
async function Ar({
|
|
1730
1730
|
comments: e,
|
|
1731
1731
|
targets: t,
|
|
1732
1732
|
client: o,
|
|
@@ -1736,15 +1736,15 @@ async function xr({
|
|
|
1736
1736
|
return await Promise.all(
|
|
1737
1737
|
e.map(async ({ notifyUsers: i }, a) => {
|
|
1738
1738
|
if (i)
|
|
1739
|
-
return
|
|
1739
|
+
return gr(i) ? [] : (await cr(o, i)).map((u) => u.userId);
|
|
1740
1740
|
const c = t[a];
|
|
1741
1741
|
if (!c || !r) return [];
|
|
1742
|
-
const d = c.taskId ? `task:${c.taskId}` : `project:${c.projectId}`, l = n.get(d) ??
|
|
1742
|
+
const d = c.taskId ? `task:${c.taskId}` : `project:${c.projectId}`, l = n.get(d) ?? yr(o, c, r.id);
|
|
1743
1743
|
return n.set(d, l), await l;
|
|
1744
1744
|
})
|
|
1745
1745
|
);
|
|
1746
1746
|
}
|
|
1747
|
-
function
|
|
1747
|
+
function Er({ comments: e }) {
|
|
1748
1748
|
const t = e.filter((c) => c.taskId).length, o = e.filter((c) => c.projectId).length, r = [];
|
|
1749
1749
|
if (t > 0) {
|
|
1750
1750
|
const c = t > 1 ? "comments" : "comment";
|
|
@@ -1760,7 +1760,7 @@ function Ar({ comments: e }) {
|
|
|
1760
1760
|
const a = i.size > 1 ? "people" : "person";
|
|
1761
1761
|
return `${n}. Notified ${i.size} ${a}`;
|
|
1762
1762
|
}
|
|
1763
|
-
const
|
|
1763
|
+
const Or = {
|
|
1764
1764
|
search: s.string().optional().describe(
|
|
1765
1765
|
"Search for a filter by name (partial and case insensitive match). If omitted, all filters are returned."
|
|
1766
1766
|
)
|
|
@@ -1771,14 +1771,14 @@ const Er = {
|
|
|
1771
1771
|
color: ue,
|
|
1772
1772
|
isFavorite: s.boolean().describe("Whether the filter is marked as favorite."),
|
|
1773
1773
|
itemOrder: s.number().describe("The display order of the filter.")
|
|
1774
|
-
}),
|
|
1774
|
+
}), Pr = {
|
|
1775
1775
|
filters: s.array(rt).describe("The found filters."),
|
|
1776
1776
|
totalCount: s.number().describe("The total number of filters returned.")
|
|
1777
|
-
},
|
|
1777
|
+
}, _r = {
|
|
1778
1778
|
name: y.FIND_FILTERS,
|
|
1779
1779
|
description: 'List all personal filters or search for filters by name. Filters are saved custom views that use query syntax to organize tasks (e.g. "today & p1", "#Work & overdue").',
|
|
1780
|
-
parameters:
|
|
1781
|
-
outputSchema:
|
|
1780
|
+
parameters: Or,
|
|
1781
|
+
outputSchema: Pr,
|
|
1782
1782
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
1783
1783
|
async execute(e, t) {
|
|
1784
1784
|
let r = ((await t.sync({ resourceTypes: ["filters"], syncToken: "*" })).filters ?? []).filter((a) => !a.isDeleted);
|
|
@@ -1796,7 +1796,7 @@ const Er = {
|
|
|
1796
1796
|
itemOrder: a.itemOrder
|
|
1797
1797
|
}));
|
|
1798
1798
|
return {
|
|
1799
|
-
textContent:
|
|
1799
|
+
textContent: Ur({ filters: n, search: e.search }),
|
|
1800
1800
|
structuredContent: {
|
|
1801
1801
|
filters: n,
|
|
1802
1802
|
totalCount: n.length
|
|
@@ -1804,7 +1804,7 @@ const Er = {
|
|
|
1804
1804
|
};
|
|
1805
1805
|
}
|
|
1806
1806
|
};
|
|
1807
|
-
function
|
|
1807
|
+
function Ur({
|
|
1808
1808
|
filters: e,
|
|
1809
1809
|
search: t
|
|
1810
1810
|
}) {
|
|
@@ -1832,19 +1832,19 @@ const Rr = s.object({
|
|
|
1832
1832
|
),
|
|
1833
1833
|
color: le,
|
|
1834
1834
|
isFavorite: s.boolean().optional().describe("Whether to mark the filter as a favorite. Defaults to false.")
|
|
1835
|
-
}),
|
|
1835
|
+
}), Lr = {
|
|
1836
1836
|
filters: s.array(Rr).min(1).describe("The array of filters to add.")
|
|
1837
|
-
},
|
|
1837
|
+
}, Nr = {
|
|
1838
1838
|
filters: s.array(rt).describe("The created filters."),
|
|
1839
1839
|
totalCount: s.number().describe("The total number of filters created.")
|
|
1840
|
-
},
|
|
1840
|
+
}, Mr = {
|
|
1841
1841
|
name: y.ADD_FILTERS,
|
|
1842
1842
|
description: "Add one or more new personal filters. Filters are saved custom views using query syntax to organize tasks.",
|
|
1843
|
-
parameters:
|
|
1844
|
-
outputSchema:
|
|
1843
|
+
parameters: Lr,
|
|
1844
|
+
outputSchema: Nr,
|
|
1845
1845
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1846
1846
|
async execute({ filters: e }, t) {
|
|
1847
|
-
const o = Date.now(), r = e.map((u, h) => `tempFilterAdd${h}${o}`), n = e.map((u, h) =>
|
|
1847
|
+
const o = Date.now(), r = e.map((u, h) => `tempFilterAdd${h}${o}`), n = e.map((u, h) => J(
|
|
1848
1848
|
"filter_add",
|
|
1849
1849
|
{
|
|
1850
1850
|
name: u.name,
|
|
@@ -1876,26 +1876,26 @@ ${l}`,
|
|
|
1876
1876
|
}
|
|
1877
1877
|
};
|
|
1878
1878
|
}
|
|
1879
|
-
},
|
|
1879
|
+
}, Fr = s.object({
|
|
1880
1880
|
name: s.string().min(1).max(128).describe("The name of the label."),
|
|
1881
1881
|
color: le,
|
|
1882
1882
|
order: s.number().int().optional().describe("The position of the label in the label list."),
|
|
1883
1883
|
isFavorite: s.boolean().optional().describe("Whether the label is a favorite. Defaults to false.")
|
|
1884
|
-
}),
|
|
1885
|
-
labels: s.array(
|
|
1886
|
-
},
|
|
1884
|
+
}), Hr = {
|
|
1885
|
+
labels: s.array(Fr).min(1).describe("The array of labels to add.")
|
|
1886
|
+
}, Wr = {
|
|
1887
1887
|
labels: s.array(pe).describe("The created labels."),
|
|
1888
1888
|
totalCount: s.number().describe("The total number of labels created.")
|
|
1889
|
-
},
|
|
1889
|
+
}, Br = {
|
|
1890
1890
|
name: y.ADD_LABELS,
|
|
1891
1891
|
description: "Add one or more new personal labels.",
|
|
1892
|
-
parameters:
|
|
1893
|
-
outputSchema:
|
|
1892
|
+
parameters: Hr,
|
|
1893
|
+
outputSchema: Wr,
|
|
1894
1894
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1895
1895
|
async execute({ labels: e }, t) {
|
|
1896
1896
|
const o = await Promise.all(e.map((n) => t.addLabel(n)));
|
|
1897
1897
|
return {
|
|
1898
|
-
textContent:
|
|
1898
|
+
textContent: zr({ labels: o }),
|
|
1899
1899
|
structuredContent: {
|
|
1900
1900
|
labels: o.map((n) => pe.parse(n)),
|
|
1901
1901
|
totalCount: o.length
|
|
@@ -1903,7 +1903,7 @@ ${l}`,
|
|
|
1903
1903
|
};
|
|
1904
1904
|
}
|
|
1905
1905
|
};
|
|
1906
|
-
function
|
|
1906
|
+
function zr({ labels: e }) {
|
|
1907
1907
|
const t = e.length, o = e.map((r) => `• ${r.name} (id=${r.id})`).join(`
|
|
1908
1908
|
`);
|
|
1909
1909
|
return `Added ${t} label${t === 1 ? "" : "s"}:
|
|
@@ -1953,20 +1953,20 @@ function at(e, t) {
|
|
|
1953
1953
|
Failed (${t.length}) - address or drop these items:
|
|
1954
1954
|
${n}${i}`;
|
|
1955
1955
|
}
|
|
1956
|
-
function
|
|
1956
|
+
function Kr(e) {
|
|
1957
1957
|
const t = e.content || e.title || "Untitled", o = e.dueDate ? ` • due ${e.dueDate}` : "", r = e.priority ? ` • ${e.priority.toUpperCase()}` : "", n = e.projectName ? ` • ${e.projectName}` : "", i = e.id ? ` • id=${e.id}` : "";
|
|
1958
1958
|
return ` ${t}${o}${r}${n}${i}`;
|
|
1959
1959
|
}
|
|
1960
|
-
function
|
|
1960
|
+
function Yr(e) {
|
|
1961
1961
|
const t = ` (${e.color})`, o = e.isFavorite ? " • ⭐" : "", r = ` • id=${e.id}`;
|
|
1962
1962
|
return ` ${e.name}${t}${o}${r}`;
|
|
1963
1963
|
}
|
|
1964
|
-
function
|
|
1964
|
+
function qr(e) {
|
|
1965
1965
|
const t = e.inboxProject ? " • Inbox" : "", o = e.isFavorite ? " • ⭐" : "", r = e.isShared ? " • Shared" : "", n = e.isArchived ? " • Archived" : "", i = e.viewStyle && e.viewStyle !== "list" ? ` • ${e.viewStyle}` : "", a = ` • id=${e.id}`;
|
|
1966
1966
|
return ` ${e.name}${t}${o}${r}${n}${i}${a}`;
|
|
1967
1967
|
}
|
|
1968
1968
|
function Se(e, t = 5) {
|
|
1969
|
-
const r = e.slice(0, t).map(
|
|
1969
|
+
const r = e.slice(0, t).map(Kr).join(`
|
|
1970
1970
|
`);
|
|
1971
1971
|
if (e.length > t) {
|
|
1972
1972
|
const n = e.length - t;
|
|
@@ -1975,7 +1975,7 @@ function Se(e, t = 5) {
|
|
|
1975
1975
|
}
|
|
1976
1976
|
return r;
|
|
1977
1977
|
}
|
|
1978
|
-
function
|
|
1978
|
+
function q({
|
|
1979
1979
|
subject: e,
|
|
1980
1980
|
count: t,
|
|
1981
1981
|
limit: o,
|
|
@@ -1996,16 +1996,16 @@ function cs(e, t) {
|
|
|
1996
1996
|
${o.map((n) => `- ${n}`).join(`
|
|
1997
1997
|
`)}`;
|
|
1998
1998
|
}
|
|
1999
|
-
const
|
|
2000
|
-
function
|
|
1999
|
+
const Gr = 300 * 1e3;
|
|
2000
|
+
function Vr(e) {
|
|
2001
2001
|
return /^\d+$/.test(e);
|
|
2002
2002
|
}
|
|
2003
|
-
class
|
|
2003
|
+
class Jr {
|
|
2004
2004
|
constructor() {
|
|
2005
2005
|
this.cache = null, this.inFlightWorkspaces = null;
|
|
2006
2006
|
}
|
|
2007
2007
|
async getWorkspaces(t) {
|
|
2008
|
-
if (this.cache && Date.now() - this.cache.timestamp <
|
|
2008
|
+
if (this.cache && Date.now() - this.cache.timestamp < Gr)
|
|
2009
2009
|
return this.cache.workspaces;
|
|
2010
2010
|
if (this.inFlightWorkspaces)
|
|
2011
2011
|
return this.inFlightWorkspaces;
|
|
@@ -2032,7 +2032,7 @@ class Vr {
|
|
|
2032
2032
|
const n = await this.getWorkspaces(t), i = n.find((p) => p.id === r);
|
|
2033
2033
|
if (i)
|
|
2034
2034
|
return { workspaceId: i.id, workspaceName: i.name };
|
|
2035
|
-
if (
|
|
2035
|
+
if (Vr(r))
|
|
2036
2036
|
return { workspaceId: r, workspaceName: r };
|
|
2037
2037
|
const a = r.toLowerCase(), c = n.find((p) => p.name.toLowerCase() === a);
|
|
2038
2038
|
if (c)
|
|
@@ -2060,7 +2060,7 @@ ${p}` + (d.length > 5 ? `
|
|
|
2060
2060
|
this.cache = null;
|
|
2061
2061
|
}
|
|
2062
2062
|
}
|
|
2063
|
-
const ds = new
|
|
2063
|
+
const ds = new Jr(), Xr = s.object({
|
|
2064
2064
|
name: s.string().min(1).describe("The name of the project."),
|
|
2065
2065
|
parentId: s.string().optional().describe("The ID of the parent project. If provided, creates this as a sub-project."),
|
|
2066
2066
|
isFavorite: s.boolean().optional().describe("Whether the project is a favorite. Defaults to false."),
|
|
@@ -2070,9 +2070,9 @@ const ds = new Vr(), Jr = s.object({
|
|
|
2070
2070
|
workspace: s.string().trim().min(1).optional().describe(
|
|
2071
2071
|
"The workspace to create the project in. Accepts a workspace name or workspace ID. If not provided, creates a personal project. Use list-workspaces to see available workspaces."
|
|
2072
2072
|
)
|
|
2073
|
-
}),
|
|
2074
|
-
projects: s.array(
|
|
2075
|
-
},
|
|
2073
|
+
}), Zr = {
|
|
2074
|
+
projects: s.array(Xr).min(1).describe("The array of projects to add.")
|
|
2075
|
+
}, Qr = {
|
|
2076
2076
|
projects: s.array(Q).describe("The created projects."),
|
|
2077
2077
|
totalCount: s.number().describe("The total number of projects created."),
|
|
2078
2078
|
failures: s.array(ee).describe(
|
|
@@ -2081,11 +2081,11 @@ const ds = new Vr(), Jr = s.object({
|
|
|
2081
2081
|
totalRequested: s.number().describe("The total number of projects requested."),
|
|
2082
2082
|
successCount: s.number().describe("The number of successfully created projects."),
|
|
2083
2083
|
failureCount: s.number().describe("The number of failed project creations.")
|
|
2084
|
-
},
|
|
2084
|
+
}, en = {
|
|
2085
2085
|
name: y.ADD_PROJECTS,
|
|
2086
2086
|
description: "Add one or more new projects.",
|
|
2087
|
-
parameters:
|
|
2088
|
-
outputSchema:
|
|
2087
|
+
parameters: Zr,
|
|
2088
|
+
outputSchema: Qr,
|
|
2089
2089
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
2090
2090
|
async execute({ projects: e }, t) {
|
|
2091
2091
|
const o = /* @__PURE__ */ new Map(), r = (l) => {
|
|
@@ -2111,7 +2111,7 @@ const ds = new Vr(), Jr = s.object({
|
|
|
2111
2111
|
});
|
|
2112
2112
|
const c = i.map(Z);
|
|
2113
2113
|
return {
|
|
2114
|
-
textContent:
|
|
2114
|
+
textContent: tn({ projects: i, failures: a }),
|
|
2115
2115
|
structuredContent: {
|
|
2116
2116
|
projects: c,
|
|
2117
2117
|
totalCount: c.length,
|
|
@@ -2123,7 +2123,7 @@ const ds = new Vr(), Jr = s.object({
|
|
|
2123
2123
|
};
|
|
2124
2124
|
}
|
|
2125
2125
|
};
|
|
2126
|
-
function
|
|
2126
|
+
function tn({
|
|
2127
2127
|
projects: e,
|
|
2128
2128
|
failures: t
|
|
2129
2129
|
}) {
|
|
@@ -2137,7 +2137,7 @@ const we = 25, je = s.enum(Ms), ls = s.object({
|
|
|
2137
2137
|
string: s.string().optional().describe('Natural language due string, e.g. "tomorrow at 3pm".'),
|
|
2138
2138
|
timezone: s.string().optional().describe('Timezone for the reminder, e.g. "America/New_York".'),
|
|
2139
2139
|
lang: s.string().optional().describe('Language for parsing the due string, e.g. "en".')
|
|
2140
|
-
}), us = s.enum(Mt), Ce = s.boolean().optional().describe("Whether this is an urgent reminder. Applies to relative and absolute reminders."),
|
|
2140
|
+
}), us = s.enum(Mt), Ce = s.boolean().optional().describe("Whether this is an urgent reminder. Applies to relative and absolute reminders."), sn = s.object({
|
|
2141
2141
|
type: s.literal("relative"),
|
|
2142
2142
|
taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
|
|
2143
2143
|
minuteOffset: s.number().int().min(0).describe(
|
|
@@ -2147,7 +2147,7 @@ const we = 25, je = s.enum(Ms), ls = s.object({
|
|
|
2147
2147
|
'Delivery method: "email" or "push" notification. Defaults to push.'
|
|
2148
2148
|
),
|
|
2149
2149
|
isUrgent: Ce
|
|
2150
|
-
}),
|
|
2150
|
+
}), on = s.object({
|
|
2151
2151
|
type: s.literal("absolute"),
|
|
2152
2152
|
taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
|
|
2153
2153
|
due: ls.describe("The specific date/time for the reminder."),
|
|
@@ -2155,7 +2155,7 @@ const we = 25, je = s.enum(Ms), ls = s.object({
|
|
|
2155
2155
|
'Delivery method: "email" or "push" notification. Defaults to push.'
|
|
2156
2156
|
),
|
|
2157
2157
|
isUrgent: Ce
|
|
2158
|
-
}),
|
|
2158
|
+
}), rn = s.object({
|
|
2159
2159
|
type: s.literal("location"),
|
|
2160
2160
|
taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
|
|
2161
2161
|
name: s.string().min(1).describe('Name of the location, e.g. "Office", "Home".'),
|
|
@@ -2165,23 +2165,23 @@ const we = 25, je = s.enum(Ms), ls = s.object({
|
|
|
2165
2165
|
'When to trigger: "on_enter" (arriving) or "on_leave" (departing).'
|
|
2166
2166
|
),
|
|
2167
2167
|
radius: s.number().int().optional().describe("Radius in meters for the geofence. Defaults to server default.")
|
|
2168
|
-
}),
|
|
2169
|
-
tn,
|
|
2168
|
+
}), nn = s.discriminatedUnion("type", [
|
|
2170
2169
|
sn,
|
|
2171
|
-
on
|
|
2172
|
-
|
|
2173
|
-
|
|
2170
|
+
on,
|
|
2171
|
+
rn
|
|
2172
|
+
]), an = {
|
|
2173
|
+
reminders: s.array(nn).min(1).max(we).describe(
|
|
2174
2174
|
`Array of reminders to create (max ${we}). Each reminder must specify a type: "relative" (minutes before due), "absolute" (specific date/time), or "location" (geofence trigger).`
|
|
2175
2175
|
)
|
|
2176
|
-
},
|
|
2176
|
+
}, cn = {
|
|
2177
2177
|
reminders: s.array(ot).describe("The created reminders."),
|
|
2178
2178
|
totalCount: s.number().describe("Total number of reminders created."),
|
|
2179
2179
|
addedReminderIds: s.array(s.string()).describe("IDs of the created reminders.")
|
|
2180
|
-
},
|
|
2180
|
+
}, dn = {
|
|
2181
2181
|
name: y.ADD_REMINDERS,
|
|
2182
2182
|
description: 'Add reminders to tasks. Supports three types: "relative" (minutes before due), "absolute" (specific date/time), or "location" (geofence-triggered). Each reminder must specify a taskId.',
|
|
2183
|
-
parameters:
|
|
2184
|
-
outputSchema:
|
|
2183
|
+
parameters: an,
|
|
2184
|
+
outputSchema: cn,
|
|
2185
2185
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
2186
2186
|
async execute(e, t) {
|
|
2187
2187
|
const { reminders: o } = e, r = o.map(async (c) => {
|
|
@@ -2214,7 +2214,7 @@ const we = 25, je = s.enum(Ms), ls = s.object({
|
|
|
2214
2214
|
}
|
|
2215
2215
|
}), i = (await Promise.all(r)).map(be);
|
|
2216
2216
|
return {
|
|
2217
|
-
textContent:
|
|
2217
|
+
textContent: ln(i),
|
|
2218
2218
|
structuredContent: {
|
|
2219
2219
|
reminders: i,
|
|
2220
2220
|
totalCount: i.length,
|
|
@@ -2223,7 +2223,7 @@ const we = 25, je = s.enum(Ms), ls = s.object({
|
|
|
2223
2223
|
};
|
|
2224
2224
|
}
|
|
2225
2225
|
};
|
|
2226
|
-
function
|
|
2226
|
+
function ln(e) {
|
|
2227
2227
|
const { timeBasedCount: t, locationCount: o } = is(e), r = [];
|
|
2228
2228
|
if (t > 0) {
|
|
2229
2229
|
const n = t > 1 ? "reminders" : "reminder";
|
|
@@ -2235,16 +2235,16 @@ function dn(e) {
|
|
|
2235
2235
|
}
|
|
2236
2236
|
return r.length > 0 ? `Added ${r.join(" and ")}` : "No reminders added";
|
|
2237
2237
|
}
|
|
2238
|
-
const
|
|
2238
|
+
const un = s.object({
|
|
2239
2239
|
name: s.string().min(1).describe("The name of the section."),
|
|
2240
2240
|
projectId: s.string().min(1).describe(
|
|
2241
2241
|
'The ID of the project to add the section to. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
2242
2242
|
),
|
|
2243
2243
|
description: s.string().optional().describe("The description of the section. Supports Markdown.")
|
|
2244
|
-
}),
|
|
2245
|
-
sections: s.array(
|
|
2246
|
-
},
|
|
2247
|
-
sections: s.array(
|
|
2244
|
+
}), pn = {
|
|
2245
|
+
sections: s.array(un).min(1).describe("The array of sections to add.")
|
|
2246
|
+
}, hn = {
|
|
2247
|
+
sections: s.array(K).describe("The created sections."),
|
|
2248
2248
|
totalCount: s.number().describe("The total number of sections created."),
|
|
2249
2249
|
failures: s.array(ee).describe(
|
|
2250
2250
|
"Sections that could not be created, with the reason for each. A failure here does not affect the other sections in the batch — do not retry the whole batch; address or drop the failed items."
|
|
@@ -2252,11 +2252,11 @@ const ln = s.object({
|
|
|
2252
2252
|
totalRequested: s.number().describe("The total number of sections requested."),
|
|
2253
2253
|
successCount: s.number().describe("The number of successfully created sections."),
|
|
2254
2254
|
failureCount: s.number().describe("The number of failed section creations.")
|
|
2255
|
-
},
|
|
2255
|
+
}, mn = {
|
|
2256
2256
|
name: y.ADD_SECTIONS,
|
|
2257
2257
|
description: "Add one or more new sections to projects.",
|
|
2258
|
-
parameters:
|
|
2259
|
-
outputSchema:
|
|
2258
|
+
parameters: pn,
|
|
2259
|
+
outputSchema: hn,
|
|
2260
2260
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
2261
2261
|
async execute({ sections: e }, t) {
|
|
2262
2262
|
const o = e.some((c) => M(c.projectId)) ? O(() => t.getUser()) : void 0, r = await Promise.allSettled(
|
|
@@ -2275,9 +2275,9 @@ const ln = s.object({
|
|
|
2275
2275
|
error: z(c.reason)
|
|
2276
2276
|
});
|
|
2277
2277
|
}), {
|
|
2278
|
-
textContent:
|
|
2278
|
+
textContent: fn({ sections: n, failures: i }),
|
|
2279
2279
|
structuredContent: {
|
|
2280
|
-
sections: n.map(
|
|
2280
|
+
sections: n.map(Y),
|
|
2281
2281
|
totalCount: n.length,
|
|
2282
2282
|
failures: i,
|
|
2283
2283
|
totalRequested: e.length,
|
|
@@ -2287,7 +2287,7 @@ const ln = s.object({
|
|
|
2287
2287
|
};
|
|
2288
2288
|
}
|
|
2289
2289
|
};
|
|
2290
|
-
function
|
|
2290
|
+
function fn({
|
|
2291
2291
|
sections: e,
|
|
2292
2292
|
failures: t
|
|
2293
2293
|
}) {
|
|
@@ -2305,7 +2305,7 @@ const ne = {
|
|
|
2305
2305
|
PROJECT_NOT_FOUND: "PROJECT_NOT_FOUND",
|
|
2306
2306
|
TASK_NOT_FOUND: "TASK_NOT_FOUND"
|
|
2307
2307
|
};
|
|
2308
|
-
class
|
|
2308
|
+
class bn {
|
|
2309
2309
|
/**
|
|
2310
2310
|
* Validate a single assignment operation
|
|
2311
2311
|
*/
|
|
@@ -2514,59 +2514,59 @@ class fn {
|
|
|
2514
2514
|
};
|
|
2515
2515
|
}
|
|
2516
2516
|
}
|
|
2517
|
-
const ct = new
|
|
2518
|
-
function
|
|
2517
|
+
const ct = new bn();
|
|
2518
|
+
function R(e) {
|
|
2519
2519
|
return s.string().transform((t) => t === "" ? void 0 : t).optional().describe(e);
|
|
2520
2520
|
}
|
|
2521
|
-
const wt = Yt.TASKS_PER_OPERATION,
|
|
2521
|
+
const wt = Yt.TASKS_PER_OPERATION, gn = s.object({
|
|
2522
2522
|
content: s.string().min(1).describe(
|
|
2523
2523
|
'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.'
|
|
2524
2524
|
),
|
|
2525
|
-
description:
|
|
2525
|
+
description: R(
|
|
2526
2526
|
"Additional details, notes, or context for the task. Use this for longer content rather than putting it in the task name. Supports Markdown."
|
|
2527
2527
|
),
|
|
2528
2528
|
priority: Qe.optional().describe(Ze),
|
|
2529
|
-
dueString:
|
|
2529
|
+
dueString: R(
|
|
2530
2530
|
'The due date for the task, in natural language. Also use natural language for recurrences; do not prefix it with "recurring".'
|
|
2531
2531
|
),
|
|
2532
|
-
deadlineDate:
|
|
2532
|
+
deadlineDate: R(
|
|
2533
2533
|
'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.'
|
|
2534
2534
|
),
|
|
2535
|
-
duration:
|
|
2535
|
+
duration: R(
|
|
2536
2536
|
'The duration of the task. Use format: "2h" (hours), "90m" (minutes), "2h30m" (combined), or "1.5h" (decimal hours). Max 24h.'
|
|
2537
2537
|
),
|
|
2538
2538
|
labels: s.array(s.string()).optional().describe("The labels to attach to the task."),
|
|
2539
|
-
projectId:
|
|
2539
|
+
projectId: R(
|
|
2540
2540
|
'The project ID to add this task to. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
2541
2541
|
),
|
|
2542
|
-
sectionId:
|
|
2543
|
-
parentId:
|
|
2542
|
+
sectionId: R("The section ID to add this task to."),
|
|
2543
|
+
parentId: R("The parent task ID (for subtasks)."),
|
|
2544
2544
|
order: s.number().optional().describe("Position of the task among sibling tasks under the same parent/section."),
|
|
2545
|
-
responsibleUser:
|
|
2545
|
+
responsibleUser: R(
|
|
2546
2546
|
'Assign task to this user. Can be "me" (assigns to current user), a user ID, name, or email address. User must be a collaborator on the target project.'
|
|
2547
2547
|
),
|
|
2548
2548
|
isUncompletable: s.boolean().optional().describe(
|
|
2549
2549
|
"Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
|
|
2550
2550
|
)
|
|
2551
2551
|
}), vt = {
|
|
2552
|
-
tasks: s.array(
|
|
2553
|
-
},
|
|
2552
|
+
tasks: s.array(gn).min(1).max(wt).describe(`The array of tasks to add (max ${wt}).`)
|
|
2553
|
+
}, yn = {
|
|
2554
2554
|
tasks: s.array(H).describe("The created tasks."),
|
|
2555
2555
|
totalCount: s.number().describe("The total number of tasks created."),
|
|
2556
2556
|
failures: s.array(ee).describe("Failed task creations with error details."),
|
|
2557
2557
|
totalRequested: s.number().describe("The total number of tasks requested."),
|
|
2558
2558
|
successCount: s.number().describe("The number of successfully created tasks."),
|
|
2559
2559
|
failureCount: s.number().describe("The number of failed task creations.")
|
|
2560
|
-
},
|
|
2560
|
+
}, Tn = {
|
|
2561
2561
|
name: y.ADD_TASKS,
|
|
2562
2562
|
description: "Add one or more tasks to a project, section, or parent. Supports assignment to project collaborators.",
|
|
2563
2563
|
parameters: vt,
|
|
2564
|
-
outputSchema:
|
|
2564
|
+
outputSchema: yn,
|
|
2565
2565
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
2566
2566
|
async execute(e, t) {
|
|
2567
2567
|
const { tasks: o } = s.object(vt).parse(e), r = /* @__PURE__ */ new Map();
|
|
2568
2568
|
o.forEach((h, m) => {
|
|
2569
|
-
const g =
|
|
2569
|
+
const g = kn(h), f = r.get(g);
|
|
2570
2570
|
f ? f.push({ task: h, index: m }) : r.set(g, [{ task: h, index: m }]);
|
|
2571
2571
|
});
|
|
2572
2572
|
const n = /* @__PURE__ */ new Map(), a = (await Promise.all(
|
|
@@ -2574,7 +2574,7 @@ const wt = Yt.TASKS_PER_OPERATION, bn = s.object({
|
|
|
2574
2574
|
const m = [];
|
|
2575
2575
|
for (const { task: g, index: f } of h)
|
|
2576
2576
|
try {
|
|
2577
|
-
const v = await
|
|
2577
|
+
const v = await wn(g, t, n);
|
|
2578
2578
|
m.push({ index: f, result: { status: "fulfilled", value: v } });
|
|
2579
2579
|
} catch (v) {
|
|
2580
2580
|
m.push({
|
|
@@ -2600,7 +2600,7 @@ const wt = Yt.TASKS_PER_OPERATION, bn = s.object({
|
|
|
2600
2600
|
}
|
|
2601
2601
|
const p = c.map(P);
|
|
2602
2602
|
return {
|
|
2603
|
-
textContent:
|
|
2603
|
+
textContent: vn({
|
|
2604
2604
|
tasks: p,
|
|
2605
2605
|
failures: d,
|
|
2606
2606
|
args: { tasks: o }
|
|
@@ -2616,10 +2616,10 @@ const wt = Yt.TASKS_PER_OPERATION, bn = s.object({
|
|
|
2616
2616
|
};
|
|
2617
2617
|
}
|
|
2618
2618
|
};
|
|
2619
|
-
function
|
|
2619
|
+
function kn(e) {
|
|
2620
2620
|
return `${e.projectId ?? ""}|${e.sectionId ?? ""}|${e.parentId ?? ""}`;
|
|
2621
2621
|
}
|
|
2622
|
-
async function
|
|
2622
|
+
async function wn(e, t, o) {
|
|
2623
2623
|
const {
|
|
2624
2624
|
duration: r,
|
|
2625
2625
|
projectId: n,
|
|
@@ -2697,7 +2697,7 @@ async function kn(e, t, o) {
|
|
|
2697
2697
|
try {
|
|
2698
2698
|
return await t.addTask(g);
|
|
2699
2699
|
} catch (f) {
|
|
2700
|
-
const v =
|
|
2700
|
+
const v = ro(f, {
|
|
2701
2701
|
taskContent: e.content,
|
|
2702
2702
|
dueString: e.dueString,
|
|
2703
2703
|
deadlineDate: e.deadlineDate
|
|
@@ -2705,7 +2705,7 @@ async function kn(e, t, o) {
|
|
|
2705
2705
|
throw v ? new ve(v) : f;
|
|
2706
2706
|
}
|
|
2707
2707
|
}
|
|
2708
|
-
function
|
|
2708
|
+
function vn({
|
|
2709
2709
|
tasks: e,
|
|
2710
2710
|
failures: t,
|
|
2711
2711
|
args: o
|
|
@@ -2730,11 +2730,11 @@ function wn({
|
|
|
2730
2730
|
showDetails: !0
|
|
2731
2731
|
});
|
|
2732
2732
|
}
|
|
2733
|
-
const
|
|
2733
|
+
const In = {
|
|
2734
2734
|
projectId: s.string().min(1).describe(
|
|
2735
2735
|
"The ID of the project to analyze. This triggers a new health analysis which may take some time to complete."
|
|
2736
2736
|
)
|
|
2737
|
-
},
|
|
2737
|
+
}, Sn = {
|
|
2738
2738
|
projectId: s.string().describe("The project ID."),
|
|
2739
2739
|
health: s.object({
|
|
2740
2740
|
status: s.enum(Ve).describe("The health status after triggering analysis."),
|
|
@@ -2742,11 +2742,11 @@ const vn = {
|
|
|
2742
2742
|
updateInProgress: s.boolean().describe("Whether an analysis update is currently in progress.")
|
|
2743
2743
|
}).describe("The health response returned after triggering analysis."),
|
|
2744
2744
|
message: s.string().describe("A human-readable message about the analysis status.")
|
|
2745
|
-
},
|
|
2745
|
+
}, jn = {
|
|
2746
2746
|
name: y.ANALYZE_PROJECT_HEALTH,
|
|
2747
2747
|
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.",
|
|
2748
|
-
parameters:
|
|
2749
|
-
outputSchema:
|
|
2748
|
+
parameters: In,
|
|
2749
|
+
outputSchema: Sn,
|
|
2750
2750
|
annotations: {
|
|
2751
2751
|
readOnlyHint: !1,
|
|
2752
2752
|
destructiveHint: !1,
|
|
@@ -2769,19 +2769,19 @@ ${n}`,
|
|
|
2769
2769
|
}
|
|
2770
2770
|
};
|
|
2771
2771
|
}
|
|
2772
|
-
}, jn = {
|
|
2773
|
-
ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to complete.")
|
|
2774
2772
|
}, Cn = {
|
|
2773
|
+
ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to complete.")
|
|
2774
|
+
}, $n = {
|
|
2775
2775
|
completed: s.array(s.string()).describe("The IDs of successfully completed tasks."),
|
|
2776
2776
|
failures: s.array(ee).describe("Failed task completions with error details."),
|
|
2777
2777
|
totalRequested: s.number().describe("The total number of tasks requested to complete."),
|
|
2778
2778
|
successCount: s.number().describe("The number of successfully completed tasks."),
|
|
2779
2779
|
failureCount: s.number().describe("The number of failed task completions.")
|
|
2780
|
-
},
|
|
2780
|
+
}, Dn = {
|
|
2781
2781
|
name: y.COMPLETE_TASKS,
|
|
2782
2782
|
description: "Complete one or more tasks by their IDs.",
|
|
2783
|
-
parameters:
|
|
2784
|
-
outputSchema:
|
|
2783
|
+
parameters: Cn,
|
|
2784
|
+
outputSchema: $n,
|
|
2785
2785
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
2786
2786
|
async execute(e, t) {
|
|
2787
2787
|
const o = [], r = [];
|
|
@@ -2796,7 +2796,7 @@ ${n}`,
|
|
|
2796
2796
|
});
|
|
2797
2797
|
}
|
|
2798
2798
|
return {
|
|
2799
|
-
textContent:
|
|
2799
|
+
textContent: xn({
|
|
2800
2800
|
completed: o,
|
|
2801
2801
|
failures: r,
|
|
2802
2802
|
args: e
|
|
@@ -2811,7 +2811,7 @@ ${n}`,
|
|
|
2811
2811
|
};
|
|
2812
2812
|
}
|
|
2813
2813
|
};
|
|
2814
|
-
function
|
|
2814
|
+
function xn({
|
|
2815
2815
|
completed: e,
|
|
2816
2816
|
failures: t,
|
|
2817
2817
|
args: o
|
|
@@ -2833,20 +2833,20 @@ const ps = [
|
|
|
2833
2833
|
"filter",
|
|
2834
2834
|
"reminder",
|
|
2835
2835
|
"location_reminder"
|
|
2836
|
-
],
|
|
2836
|
+
], An = {
|
|
2837
2837
|
type: s.enum(ps).describe("The type of entity to delete."),
|
|
2838
2838
|
id: s.string().min(1).describe("The ID of the entity to delete.")
|
|
2839
|
-
},
|
|
2839
|
+
}, En = {
|
|
2840
2840
|
deletedEntity: s.object({
|
|
2841
2841
|
type: s.enum(ps).describe("The type of deleted entity."),
|
|
2842
2842
|
id: s.string().describe("The ID of the deleted entity.")
|
|
2843
2843
|
}).describe("Information about the deleted entity."),
|
|
2844
2844
|
success: s.boolean().describe("Whether the deletion was successful.")
|
|
2845
|
-
},
|
|
2845
|
+
}, On = {
|
|
2846
2846
|
name: y.DELETE_OBJECT,
|
|
2847
2847
|
description: "Delete a project, section, task, comment, label, filter, reminder, or location_reminder by its ID. Projects can be deleted whether active or archived (find archived ones via find-projects with archivedStatus); note a workspace project must be archived before it can be deleted, while personal projects can be deleted regardless.",
|
|
2848
|
-
parameters:
|
|
2849
|
-
outputSchema:
|
|
2848
|
+
parameters: An,
|
|
2849
|
+
outputSchema: En,
|
|
2850
2850
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !0 },
|
|
2851
2851
|
async execute(e, t) {
|
|
2852
2852
|
switch (e.type) {
|
|
@@ -2873,7 +2873,7 @@ const ps = [
|
|
|
2873
2873
|
break;
|
|
2874
2874
|
case "filter":
|
|
2875
2875
|
await t.sync({
|
|
2876
|
-
commands: [
|
|
2876
|
+
commands: [J("filter_delete", { id: e.id })]
|
|
2877
2877
|
});
|
|
2878
2878
|
break;
|
|
2879
2879
|
case "reminder":
|
|
@@ -2891,7 +2891,7 @@ const ps = [
|
|
|
2891
2891
|
}
|
|
2892
2892
|
};
|
|
2893
2893
|
}
|
|
2894
|
-
}, It = 5, hs = ["file", "url"],
|
|
2894
|
+
}, It = 5, hs = ["file", "url"], Pn = {
|
|
2895
2895
|
projectId: s.string().min(1).describe("The ID of the project to export as a template."),
|
|
2896
2896
|
format: s.enum(hs).default("file").describe(
|
|
2897
2897
|
'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.'
|
|
@@ -2899,17 +2899,17 @@ const ps = [
|
|
|
2899
2899
|
useRelativeDates: s.boolean().optional().describe(
|
|
2900
2900
|
'Export due dates relative to the import date (e.g. "day 3") instead of absolute dates. Defaults to false.'
|
|
2901
2901
|
)
|
|
2902
|
-
},
|
|
2902
|
+
}, _n = {
|
|
2903
2903
|
format: s.enum(hs).describe("The format the template was exported in."),
|
|
2904
2904
|
content: s.string().optional().describe('The template as CSV content. Only present when format is "file".'),
|
|
2905
2905
|
lineCount: s.number().optional().describe('Number of rows in the exported CSV. Only present when format is "file".'),
|
|
2906
2906
|
fileName: s.string().optional().describe('The generated template file name. Only present when format is "url".'),
|
|
2907
2907
|
fileUrl: s.string().optional().describe('The shareable download URL. Only present when format is "url".')
|
|
2908
|
-
},
|
|
2908
|
+
}, Un = {
|
|
2909
2909
|
name: y.EXPORT_PROJECT_TEMPLATE,
|
|
2910
2910
|
description: "Export an existing project as a Todoist template, either as CSV content or as a shareable URL. Use it to duplicate a project, share its structure, or hand the CSV to import-project-template. To read a project rather than export it, use find-tasks instead — it returns structured tasks rather than raw CSV. Nothing is modified.",
|
|
2911
|
-
parameters:
|
|
2912
|
-
outputSchema:
|
|
2911
|
+
parameters: Pn,
|
|
2912
|
+
outputSchema: _n,
|
|
2913
2913
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
2914
2914
|
// `format` is defaulted here as well as in the schema: scripts/run-tool.ts calls
|
|
2915
2915
|
// execute() with raw JSON, so schema defaults are not applied on that path.
|
|
@@ -2945,7 +2945,7 @@ ${r}
|
|
|
2945
2945
|
|
|
2946
2946
|
${r}`;
|
|
2947
2947
|
}
|
|
2948
|
-
const
|
|
2948
|
+
const Ln = H.pick({
|
|
2949
2949
|
id: !0,
|
|
2950
2950
|
content: !0,
|
|
2951
2951
|
dueDate: !0,
|
|
@@ -2954,15 +2954,15 @@ const Un = H.pick({
|
|
|
2954
2954
|
hasChildren: s.boolean().describe(
|
|
2955
2955
|
"Whether this subtask has subtasks of its own. Fetch it with includeChildren to expand."
|
|
2956
2956
|
)
|
|
2957
|
-
}),
|
|
2957
|
+
}), Nn = Q.pick({ id: !0, name: !0 }).extend({
|
|
2958
2958
|
hasChildren: s.boolean().describe(
|
|
2959
2959
|
"Whether this sub-project has sub-projects of its own. Fetch it with includeChildren to expand."
|
|
2960
2960
|
)
|
|
2961
|
-
}),
|
|
2961
|
+
}), Mn = {
|
|
2962
2962
|
childCount: s.number().optional().describe(
|
|
2963
2963
|
"The number of direct children listed in children. Only present when children were requested and the type supports them. 0 means the object definitively has none."
|
|
2964
2964
|
),
|
|
2965
|
-
children: s.array(s.union([
|
|
2965
|
+
children: s.array(s.union([Ln, Nn])).optional().describe(
|
|
2966
2966
|
"Direct children only: subtasks for a task, sub-projects for a project. Completed subtasks and archived sub-projects are excluded."
|
|
2967
2967
|
),
|
|
2968
2968
|
hasMoreChildren: s.boolean().optional().describe(
|
|
@@ -2972,7 +2972,7 @@ const Un = H.pick({
|
|
|
2972
2972
|
'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".'
|
|
2973
2973
|
)
|
|
2974
2974
|
};
|
|
2975
|
-
async function
|
|
2975
|
+
async function Fn(e, t) {
|
|
2976
2976
|
const { results: o, nextCursor: r } = await e.getTasks({
|
|
2977
2977
|
parentId: t,
|
|
2978
2978
|
limit: C.CHILDREN_MAX
|
|
@@ -2995,7 +2995,7 @@ async function Mn(e, t) {
|
|
|
2995
2995
|
childrenError: i ? `Could not check ${i} of ${o.length} subtasks for subtasks of their own; those are reported as hasChildren=false.` : void 0
|
|
2996
2996
|
};
|
|
2997
2997
|
}
|
|
2998
|
-
async function
|
|
2998
|
+
async function Hn(e, t) {
|
|
2999
2999
|
if (!B(t))
|
|
3000
3000
|
return { childCount: 0, children: [] };
|
|
3001
3001
|
const o = await ns(e), r = /* @__PURE__ */ new Map();
|
|
@@ -3028,22 +3028,22 @@ function jt(e, t) {
|
|
|
3028
3028
|
const o = t.hasMoreChildren ? "+" : "", r = t.childrenError ? " (partial)" : "";
|
|
3029
3029
|
return ` • ${e}=${t.childCount}${o}${r}`;
|
|
3030
3030
|
}
|
|
3031
|
-
const ms = ["task", "project", "comment", "section"],
|
|
3031
|
+
const ms = ["task", "project", "comment", "section"], Wn = {
|
|
3032
3032
|
type: s.enum(ms).describe("The type of object to fetch."),
|
|
3033
3033
|
id: s.string().min(1).describe("The unique ID of the object to fetch."),
|
|
3034
3034
|
includeChildren: s.boolean().optional().describe(
|
|
3035
3035
|
"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."
|
|
3036
3036
|
)
|
|
3037
|
-
},
|
|
3037
|
+
}, Bn = {
|
|
3038
3038
|
type: s.enum(ms).describe("The type of object fetched."),
|
|
3039
3039
|
id: s.string().describe("The ID of the fetched object."),
|
|
3040
|
-
object: s.union([H, Q, ye,
|
|
3041
|
-
...
|
|
3042
|
-
},
|
|
3040
|
+
object: s.union([H, Q, ye, K]).describe("The fetched object data."),
|
|
3041
|
+
...Mn
|
|
3042
|
+
}, zn = {
|
|
3043
3043
|
name: y.FETCH_OBJECT,
|
|
3044
3044
|
description: "Fetch a single task, project, comment, or section by its ID. Use this when you have a specific object ID and want to retrieve its full details. Set includeChildren to also get its direct subtasks or sub-projects.",
|
|
3045
|
-
parameters:
|
|
3046
|
-
outputSchema:
|
|
3045
|
+
parameters: Wn,
|
|
3046
|
+
outputSchema: Bn,
|
|
3047
3047
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3048
3048
|
async execute(e, t) {
|
|
3049
3049
|
const { type: o, id: r, includeChildren: n } = e;
|
|
@@ -3052,7 +3052,7 @@ const ms = ["task", "project", "comment", "section"], Hn = {
|
|
|
3052
3052
|
case "task": {
|
|
3053
3053
|
const [i, a] = await Promise.all([
|
|
3054
3054
|
t.getTask(r),
|
|
3055
|
-
n ? St(() =>
|
|
3055
|
+
n ? St(() => Fn(t, r)) : Promise.resolve({})
|
|
3056
3056
|
]), c = P(i);
|
|
3057
3057
|
return {
|
|
3058
3058
|
textContent: `Found task: ${c.content} • id=${c.id} • priority=${c.priority} • project=${c.projectId}${jt("subtasks", a)}`,
|
|
@@ -3065,7 +3065,7 @@ const ms = ["task", "project", "comment", "section"], Hn = {
|
|
|
3065
3065
|
};
|
|
3066
3066
|
}
|
|
3067
3067
|
case "project": {
|
|
3068
|
-
const i = await t.getProject(r), a = Z(i), c = n ? await St(() =>
|
|
3068
|
+
const i = await t.getProject(r), a = Z(i), c = n ? await St(() => Hn(t, i)) : {};
|
|
3069
3069
|
return {
|
|
3070
3070
|
textContent: `Found project: ${a.name} • id=${a.id} • color=${a.color} • viewStyle=${a.viewStyle}${jt("subProjects", c)}`,
|
|
3071
3071
|
structuredContent: {
|
|
@@ -3091,7 +3091,7 @@ const ms = ["task", "project", "comment", "section"], Hn = {
|
|
|
3091
3091
|
const i = await t.getSection(r);
|
|
3092
3092
|
if (!i)
|
|
3093
3093
|
throw new Error(`Section ${r} not found.`);
|
|
3094
|
-
const a =
|
|
3094
|
+
const a = Y(i);
|
|
3095
3095
|
return {
|
|
3096
3096
|
textContent: `Found section: ${a.name} • id=${a.id}`,
|
|
3097
3097
|
structuredContent: {
|
|
@@ -3108,21 +3108,21 @@ const ms = ["task", "project", "comment", "section"], Hn = {
|
|
|
3108
3108
|
);
|
|
3109
3109
|
}
|
|
3110
3110
|
}
|
|
3111
|
-
},
|
|
3111
|
+
}, Kn = {
|
|
3112
3112
|
id: s.string().min(1).describe(
|
|
3113
3113
|
'A unique identifier for the document in the format "task:{id}" or "project:{id}".'
|
|
3114
3114
|
)
|
|
3115
|
-
},
|
|
3115
|
+
}, Yn = {
|
|
3116
3116
|
id: s.string().describe("The ID of the fetched document."),
|
|
3117
3117
|
title: s.string().describe("The title of the document."),
|
|
3118
3118
|
text: s.string().describe("The text content of the document."),
|
|
3119
3119
|
url: s.string().describe("The URL of the document."),
|
|
3120
3120
|
metadata: s.record(s.string(), s.unknown()).optional().describe("Additional metadata about the document.")
|
|
3121
|
-
},
|
|
3121
|
+
}, qn = {
|
|
3122
3122
|
name: y.FETCH,
|
|
3123
3123
|
description: 'Fetch the full contents of a task or project by its ID. The ID should be in the format "task:{id}" or "project:{id}".',
|
|
3124
|
-
parameters:
|
|
3125
|
-
outputSchema:
|
|
3124
|
+
parameters: Kn,
|
|
3125
|
+
outputSchema: Yn,
|
|
3126
3126
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3127
3127
|
async execute(e, t) {
|
|
3128
3128
|
const { id: o } = e, [r, n] = o.split(":", 2);
|
|
@@ -3182,11 +3182,11 @@ Favorite: Yes`), i = {
|
|
|
3182
3182
|
structuredContent: i
|
|
3183
3183
|
};
|
|
3184
3184
|
}
|
|
3185
|
-
},
|
|
3185
|
+
}, Gn = s.union([s.iso.date(), s.iso.datetime({ offset: !0 })]);
|
|
3186
3186
|
function Ct(e) {
|
|
3187
|
-
return
|
|
3187
|
+
return R(e).pipe(Gn.optional());
|
|
3188
3188
|
}
|
|
3189
|
-
const
|
|
3189
|
+
const Vn = {
|
|
3190
3190
|
objectType: s.enum(["task", "project", "comment"]).optional().describe("Type of object to filter by."),
|
|
3191
3191
|
objectId: s.string().optional().describe("Filter by specific object ID (task, project, or comment)."),
|
|
3192
3192
|
eventType: s.enum([
|
|
@@ -3213,17 +3213,17 @@ const Gn = {
|
|
|
3213
3213
|
),
|
|
3214
3214
|
limit: s.number().int().min(1).max(C.ACTIVITY_MAX).default(C.ACTIVITY_DEFAULT).describe("Maximum number of activity events to return."),
|
|
3215
3215
|
cursor: s.string().optional().describe("Pagination cursor for retrieving the next page of results.")
|
|
3216
|
-
},
|
|
3217
|
-
events: s.array(
|
|
3216
|
+
}, Jn = {
|
|
3217
|
+
events: s.array(Ir).describe("The activity events."),
|
|
3218
3218
|
nextCursor: s.string().optional(),
|
|
3219
3219
|
totalCount: s.number().describe("The total number of events in this page."),
|
|
3220
3220
|
hasMore: s.boolean(),
|
|
3221
3221
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
3222
|
-
},
|
|
3222
|
+
}, Xn = {
|
|
3223
3223
|
name: y.FIND_ACTIVITY,
|
|
3224
3224
|
description: `Retrieve activity logs to monitor and audit changes in Todoist. Shows events from all users by default (use initiatorId to filter by specific user). To answer what someone completed in a period, including recurring task occurrences, use objectType "task", eventType "completed", and dateFrom/dateTo. For a first-person question ("what did I get done"), also set initiatorId to the current user from user-info, or the answer includes collaborators' completions. Track task completions, updates, deletions, project changes, and more with flexible filtering. Activity history availability and retention depend on the user plan.`,
|
|
3225
|
-
parameters:
|
|
3226
|
-
outputSchema:
|
|
3225
|
+
parameters: Vn,
|
|
3226
|
+
outputSchema: Jn,
|
|
3227
3227
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3228
3228
|
async execute(e, t) {
|
|
3229
3229
|
const {
|
|
@@ -3242,9 +3242,9 @@ const Gn = {
|
|
|
3242
3242
|
cursor: u ?? null
|
|
3243
3243
|
};
|
|
3244
3244
|
o && n ? h.objectEventTypes = `${o}:${n}` : o ? h.objectEventTypes = `${o}:` : n && (h.objectEventTypes = `:${n}`), r && r !== "remove" && (h.objectId = r), i && (h.parentProjectId = i), a && (h.parentItemId = a), c && (h.initiatorId = c), d && (h.dateFrom = d), l && (h.dateTo = l);
|
|
3245
|
-
const { results: m, nextCursor: g } = await t.getActivityLogs(h), f = m.map(
|
|
3245
|
+
const { results: m, nextCursor: g } = await t.getActivityLogs(h), f = m.map(fr);
|
|
3246
3246
|
return {
|
|
3247
|
-
textContent:
|
|
3247
|
+
textContent: Zn({ events: f, args: e, nextCursor: g }),
|
|
3248
3248
|
structuredContent: {
|
|
3249
3249
|
events: f,
|
|
3250
3250
|
nextCursor: g ?? void 0,
|
|
@@ -3255,7 +3255,7 @@ const Gn = {
|
|
|
3255
3255
|
};
|
|
3256
3256
|
}
|
|
3257
3257
|
};
|
|
3258
|
-
function
|
|
3258
|
+
function Zn({
|
|
3259
3259
|
events: e,
|
|
3260
3260
|
args: t,
|
|
3261
3261
|
nextCursor: o
|
|
@@ -3270,18 +3270,18 @@ function Xn({
|
|
|
3270
3270
|
const i = [];
|
|
3271
3271
|
t.objectId && i.push(`object ID: ${t.objectId}`), t.projectId && i.push(`project: ${t.projectId}`), t.taskId && i.push(`task: ${t.taskId}`), t.initiatorId && i.push(`initiator: ${t.initiatorId}`), t.dateFrom && i.push(`from: ${t.dateFrom}`), t.dateTo && i.push(`until (exclusive): ${t.dateTo}`);
|
|
3272
3272
|
const a = [];
|
|
3273
|
-
return e.length === 0 && (a.push("No activity events match the specified filters"), a.push("Note: Activity logs only show recent events"), t.eventType && a.push(`Try removing the eventType filter (${t.eventType})`), t.objectType && a.push(`Try removing the objectType filter (${t.objectType})`), (t.objectId || t.projectId || t.taskId) && a.push("Verify the object ID is correct")),
|
|
3273
|
+
return e.length === 0 && (a.push("No activity events match the specified filters"), a.push("Note: Activity logs only show recent events"), t.eventType && a.push(`Try removing the eventType filter (${t.eventType})`), t.objectType && a.push(`Try removing the objectType filter (${t.objectType})`), (t.objectId || t.projectId || t.taskId) && a.push("Verify the object ID is correct")), q({
|
|
3274
3274
|
subject: r,
|
|
3275
3275
|
count: e.length,
|
|
3276
3276
|
limit: t.limit,
|
|
3277
3277
|
nextCursor: o ?? void 0,
|
|
3278
3278
|
filterHints: i,
|
|
3279
|
-
previewLines:
|
|
3279
|
+
previewLines: Qn(e, Math.min(e.length, t.limit)),
|
|
3280
3280
|
zeroReasonHints: a
|
|
3281
3281
|
});
|
|
3282
3282
|
}
|
|
3283
|
-
function
|
|
3284
|
-
const r = e.slice(0, t).map(
|
|
3283
|
+
function Qn(e, t = 10) {
|
|
3284
|
+
const r = e.slice(0, t).map(ei).join(`
|
|
3285
3285
|
`);
|
|
3286
3286
|
if (e.length > t) {
|
|
3287
3287
|
const n = e.length - t;
|
|
@@ -3290,8 +3290,8 @@ function Zn(e, t = 10) {
|
|
|
3290
3290
|
}
|
|
3291
3291
|
return r;
|
|
3292
3292
|
}
|
|
3293
|
-
function
|
|
3294
|
-
const t =
|
|
3293
|
+
function ei(e) {
|
|
3294
|
+
const t = ti(e.eventDate), o = `${e.eventType} ${e.objectType}`;
|
|
3295
3295
|
let r = "";
|
|
3296
3296
|
if (e.extraData) {
|
|
3297
3297
|
const c = e.extraData.content || e.extraData.name || e.extraData.last_content;
|
|
@@ -3300,7 +3300,7 @@ function Qn(e) {
|
|
|
3300
3300
|
const n = e.objectId ? ` • id=${e.objectId}` : "", i = e.initiatorId ? ` • by=${e.initiatorId}` : " • system", a = e.parentProjectId ? ` • project=${e.parentProjectId}` : "";
|
|
3301
3301
|
return ` [${t}] ${o}${r}${n}${i}${a}`;
|
|
3302
3302
|
}
|
|
3303
|
-
function
|
|
3303
|
+
function ti(e) {
|
|
3304
3304
|
try {
|
|
3305
3305
|
const t = new Date(e), o = t.toLocaleDateString("en-US", { month: "short", timeZone: "UTC" }), r = t.toLocaleDateString("en-US", { day: "numeric", timeZone: "UTC" }), n = t.toLocaleTimeString("en-US", {
|
|
3306
3306
|
hour: "2-digit",
|
|
@@ -3313,7 +3313,7 @@ function ei(e) {
|
|
|
3313
3313
|
return e;
|
|
3314
3314
|
}
|
|
3315
3315
|
}
|
|
3316
|
-
const
|
|
3316
|
+
const si = {
|
|
3317
3317
|
taskId: s.string().optional().describe("Find comments for a specific task."),
|
|
3318
3318
|
projectId: s.string().optional().describe(
|
|
3319
3319
|
'Find comments for a specific project. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
@@ -3321,7 +3321,7 @@ const ti = {
|
|
|
3321
3321
|
commentId: s.string().optional().describe("Get a specific comment by ID."),
|
|
3322
3322
|
cursor: s.string().optional().describe("Pagination cursor for retrieving more results."),
|
|
3323
3323
|
limit: s.number().int().min(1).max(C.COMMENTS_MAX).optional().describe("Maximum number of comments to return")
|
|
3324
|
-
},
|
|
3324
|
+
}, oi = {
|
|
3325
3325
|
comments: s.array(ye).describe("The found comments."),
|
|
3326
3326
|
searchType: s.string().describe(
|
|
3327
3327
|
'The type of search performed: "single" (comment ID), "task" (task ID), or "project" (project ID).'
|
|
@@ -3330,11 +3330,11 @@ const ti = {
|
|
|
3330
3330
|
hasMore: s.boolean(),
|
|
3331
3331
|
nextCursor: s.string().optional(),
|
|
3332
3332
|
totalCount: s.number().describe("The total number of comments in this page.")
|
|
3333
|
-
},
|
|
3333
|
+
}, ri = {
|
|
3334
3334
|
name: y.FIND_COMMENTS,
|
|
3335
3335
|
description: "Find comments by task, project, or get a specific comment by ID. Exactly one of taskId, projectId, or commentId must be provided.",
|
|
3336
|
-
parameters:
|
|
3337
|
-
outputSchema:
|
|
3336
|
+
parameters: si,
|
|
3337
|
+
outputSchema: oi,
|
|
3338
3338
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3339
3339
|
async execute(e, t) {
|
|
3340
3340
|
const o = [e.taskId, e.projectId, e.commentId].filter(Boolean);
|
|
@@ -3369,7 +3369,7 @@ const ti = {
|
|
|
3369
3369
|
throw new Error("Invalid state: no search parameter provided");
|
|
3370
3370
|
const c = a.map(ge);
|
|
3371
3371
|
return {
|
|
3372
|
-
textContent:
|
|
3372
|
+
textContent: ni({
|
|
3373
3373
|
comments: c,
|
|
3374
3374
|
searchType: e.commentId ? "single" : e.taskId ? "task" : "project",
|
|
3375
3375
|
searchId: e.commentId || e.taskId || e.projectId || "",
|
|
@@ -3387,7 +3387,7 @@ const ti = {
|
|
|
3387
3387
|
};
|
|
3388
3388
|
}
|
|
3389
3389
|
};
|
|
3390
|
-
function
|
|
3390
|
+
function ni({
|
|
3391
3391
|
comments: e,
|
|
3392
3392
|
searchType: t,
|
|
3393
3393
|
searchId: o,
|
|
@@ -3417,14 +3417,14 @@ function fs(e) {
|
|
|
3417
3417
|
const t = e.getUTCFullYear(), o = String(e.getUTCMonth() + 1).padStart(2, "0"), r = String(e.getUTCDate()).padStart(2, "0");
|
|
3418
3418
|
return `${t}-${o}-${r}`;
|
|
3419
3419
|
}
|
|
3420
|
-
function
|
|
3420
|
+
function ii(e) {
|
|
3421
3421
|
const t = /^([+-])(\d{2}):(\d{2})$/.exec(e);
|
|
3422
3422
|
if (!t)
|
|
3423
3423
|
return 0;
|
|
3424
3424
|
const [, o, r, n] = t, i = Number(r) * 60 + Number(n);
|
|
3425
3425
|
return o === "-" ? -i : i;
|
|
3426
3426
|
}
|
|
3427
|
-
function
|
|
3427
|
+
function ai(e, t) {
|
|
3428
3428
|
const o = new Date(e.getTime() + t * 60 * 1e3);
|
|
3429
3429
|
return fs(o);
|
|
3430
3430
|
}
|
|
@@ -3435,9 +3435,9 @@ function $t(e, t) {
|
|
|
3435
3435
|
const d = new Date(Date.UTC(i, a - 1, c));
|
|
3436
3436
|
return d.setUTCDate(d.getUTCDate() + t), fs(d);
|
|
3437
3437
|
}
|
|
3438
|
-
const
|
|
3438
|
+
const ci = ["and", "or"], dt = {
|
|
3439
3439
|
labels: s.string().array().optional().describe("The labels to filter the tasks by"),
|
|
3440
|
-
labelsOperator: s.enum(
|
|
3440
|
+
labelsOperator: s.enum(ci).optional().describe(
|
|
3441
3441
|
'The operator to use when filtering by labels. This will dictate whether a task has all labels, or some of them. Default is "or".'
|
|
3442
3442
|
)
|
|
3443
3443
|
};
|
|
@@ -3446,20 +3446,20 @@ function lt(e = [], t = "or") {
|
|
|
3446
3446
|
const o = t === "and" ? " & " : " | ";
|
|
3447
3447
|
return `(${e.map((i) => i.startsWith("@") ? i : `@${i}`).join(` ${o} `)})`;
|
|
3448
3448
|
}
|
|
3449
|
-
const
|
|
3450
|
-
function
|
|
3449
|
+
const di = 7;
|
|
3450
|
+
function li({
|
|
3451
3451
|
since: e,
|
|
3452
3452
|
until: t,
|
|
3453
3453
|
userGmtOffset: o,
|
|
3454
3454
|
now: r = /* @__PURE__ */ new Date()
|
|
3455
3455
|
}) {
|
|
3456
|
-
const n =
|
|
3456
|
+
const n = ii(o), i = ai(r, n), a = di - 1, c = t ?? (e ? $t(e, a) : i);
|
|
3457
3457
|
return {
|
|
3458
3458
|
since: e ?? $t(c, -a),
|
|
3459
3459
|
until: c
|
|
3460
3460
|
};
|
|
3461
3461
|
}
|
|
3462
|
-
const
|
|
3462
|
+
const ui = {
|
|
3463
3463
|
getBy: s.enum(["completion", "due"]).default("completion").describe(
|
|
3464
3464
|
'The method to use to get the tasks: "completion" to get tasks by completion date (ie, when the task was actually completed), "due" to get tasks by due date (ie, when the task was due to be completed by).'
|
|
3465
3465
|
),
|
|
@@ -3483,17 +3483,17 @@ const li = {
|
|
|
3483
3483
|
"The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters)."
|
|
3484
3484
|
),
|
|
3485
3485
|
...dt
|
|
3486
|
-
},
|
|
3486
|
+
}, pi = {
|
|
3487
3487
|
tasks: s.array(H).describe("The found completed tasks."),
|
|
3488
3488
|
nextCursor: s.string().optional(),
|
|
3489
3489
|
totalCount: s.number().describe("The total number of tasks in this page."),
|
|
3490
3490
|
hasMore: s.boolean(),
|
|
3491
3491
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
3492
|
-
},
|
|
3492
|
+
}, hi = {
|
|
3493
3493
|
name: y.FIND_COMPLETED_TASKS,
|
|
3494
3494
|
description: 'Get completed tasks in a date range. For "what did I complete/get done" questions, use find-activity instead — it reports completion events, including every occurrence of a recurring task, which this tool does not. since/until are optional and default to a 7-day window when omitted. Includes all collaborators by default. Person-specific queries (summaries, plans, reports) require responsibleUser.',
|
|
3495
|
-
parameters:
|
|
3496
|
-
outputSchema:
|
|
3495
|
+
parameters: ui,
|
|
3496
|
+
outputSchema: pi,
|
|
3497
3497
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3498
3498
|
async execute(e, t) {
|
|
3499
3499
|
const { getBy: o, labels: r, labelsOperator: n, since: i, until: a, responsibleUser: c, projectId: d, ...l } = e;
|
|
@@ -3507,7 +3507,7 @@ const li = {
|
|
|
3507
3507
|
const g = await t.getUser(), f = g.tzInfo?.gmtString || "+00:00", v = await de({
|
|
3508
3508
|
projectId: d,
|
|
3509
3509
|
user: g
|
|
3510
|
-
}), j =
|
|
3510
|
+
}), j = li({
|
|
3511
3511
|
since: i,
|
|
3512
3512
|
until: a,
|
|
3513
3513
|
userGmtOffset: f
|
|
@@ -3529,7 +3529,7 @@ const li = {
|
|
|
3529
3529
|
...m ? { filterQuery: m, filterLang: "en" } : {}
|
|
3530
3530
|
}), $ = b.map(P);
|
|
3531
3531
|
return {
|
|
3532
|
-
textContent:
|
|
3532
|
+
textContent: mi({
|
|
3533
3533
|
tasks: $,
|
|
3534
3534
|
args: T,
|
|
3535
3535
|
nextCursor: S,
|
|
@@ -3545,7 +3545,7 @@ const li = {
|
|
|
3545
3545
|
};
|
|
3546
3546
|
}
|
|
3547
3547
|
};
|
|
3548
|
-
function
|
|
3548
|
+
function mi({
|
|
3549
3549
|
tasks: e,
|
|
3550
3550
|
args: t,
|
|
3551
3551
|
nextCursor: o,
|
|
@@ -3561,7 +3561,7 @@ function hi({
|
|
|
3561
3561
|
a.push(`assigned to: ${d}`);
|
|
3562
3562
|
}
|
|
3563
3563
|
const c = [];
|
|
3564
|
-
return e.length === 0 && (c.push("No tasks completed in this date range"), c.push("Try expanding the date range"), (t.projectId || t.sectionId || t.parentId) && c.push("Try removing project/section/parent filters"), t.getBy === "due" && c.push('Try switching to "completion" date instead')),
|
|
3564
|
+
return e.length === 0 && (c.push("No tasks completed in this date range"), c.push("Try expanding the date range"), (t.projectId || t.sectionId || t.parentId) && c.push("Try removing project/section/parent filters"), t.getBy === "due" && c.push('Try switching to "completion" date instead')), q({
|
|
3565
3565
|
subject: i,
|
|
3566
3566
|
count: e.length,
|
|
3567
3567
|
limit: t.limit,
|
|
@@ -3571,7 +3571,7 @@ function hi({
|
|
|
3571
3571
|
zeroReasonHints: c
|
|
3572
3572
|
});
|
|
3573
3573
|
}
|
|
3574
|
-
const
|
|
3574
|
+
const fi = {
|
|
3575
3575
|
searchText: s.string().optional().describe(
|
|
3576
3576
|
'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.'
|
|
3577
3577
|
),
|
|
@@ -3579,7 +3579,7 @@ const mi = {
|
|
|
3579
3579
|
cursor: s.string().optional().describe(
|
|
3580
3580
|
"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."
|
|
3581
3581
|
)
|
|
3582
|
-
},
|
|
3582
|
+
}, bi = {
|
|
3583
3583
|
labels: s.array(pe).describe("The found personal labels."),
|
|
3584
3584
|
nextCursor: s.string().optional(),
|
|
3585
3585
|
totalCount: s.number().describe("The total number of labels in this page."),
|
|
@@ -3588,22 +3588,22 @@ const mi = {
|
|
|
3588
3588
|
"Names of all shared labels visible to you. These have no IDs or metadata — use their names directly when filtering tasks."
|
|
3589
3589
|
),
|
|
3590
3590
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
3591
|
-
},
|
|
3591
|
+
}, gi = {
|
|
3592
3592
|
name: y.FIND_LABELS,
|
|
3593
3593
|
description: "List personal labels and shared labels. Personal labels have full metadata (id, name, color, order, isFavorite) and support pagination and name search (partial, case insensitive). Shared labels are labels used on tasks shared with you — they are returned as names only (no IDs or metadata). When searching, all matching personal labels are fetched across all pages and returned as a single result set (limit and cursor are ignored). When not searching, personal labels are returned with pagination.",
|
|
3594
|
-
parameters:
|
|
3595
|
-
outputSchema:
|
|
3594
|
+
parameters: fi,
|
|
3595
|
+
outputSchema: bi,
|
|
3596
3596
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3597
3597
|
async execute(e, t) {
|
|
3598
3598
|
const [o, r] = await Promise.all([
|
|
3599
|
-
e.searchText ?
|
|
3599
|
+
e.searchText ? pr(t, e.searchText).then((c) => ({
|
|
3600
3600
|
results: c,
|
|
3601
3601
|
nextCursor: null
|
|
3602
3602
|
})) : t.getLabels({ limit: e.limit, cursor: e.cursor ?? null }),
|
|
3603
|
-
|
|
3603
|
+
hr(t)
|
|
3604
3604
|
]), { results: n, nextCursor: i } = o, a = e.searchText ? { searchText: e.searchText } : { limit: e.limit, cursor: e.cursor };
|
|
3605
3605
|
return {
|
|
3606
|
-
textContent:
|
|
3606
|
+
textContent: yi({ labels: n, args: e, nextCursor: i, sharedLabels: r }),
|
|
3607
3607
|
structuredContent: {
|
|
3608
3608
|
labels: n.map((c) => pe.parse(c)),
|
|
3609
3609
|
nextCursor: i ?? void 0,
|
|
@@ -3615,7 +3615,7 @@ const mi = {
|
|
|
3615
3615
|
};
|
|
3616
3616
|
}
|
|
3617
3617
|
};
|
|
3618
|
-
function
|
|
3618
|
+
function yi({
|
|
3619
3619
|
labels: e,
|
|
3620
3620
|
args: t,
|
|
3621
3621
|
nextCursor: o,
|
|
@@ -3623,14 +3623,14 @@ function gi({
|
|
|
3623
3623
|
}) {
|
|
3624
3624
|
const n = t.searchText ? `All labels matching "${t.searchText}"` : "Labels", i = [];
|
|
3625
3625
|
t.searchText && i.push(`searchText: "${t.searchText}"`);
|
|
3626
|
-
const a = 10, d = e.slice(0, a).map(
|
|
3626
|
+
const a = 10, d = e.slice(0, a).map(Yr).join(`
|
|
3627
3627
|
`), l = e.length - a, p = l > 0 ? `${d}
|
|
3628
3628
|
…and ${l} more` : d, u = [];
|
|
3629
3629
|
e.length === 0 && (t.searchText ? (u.push("Try broader search terms"), u.push("Check spelling"), u.push("Remove searchText to see all labels")) : u.push("No personal labels created yet"));
|
|
3630
3630
|
const h = r.length > 0 ? `
|
|
3631
3631
|
Shared labels (${r.length}): ${r.join(", ")}` : `
|
|
3632
3632
|
No shared labels.`;
|
|
3633
|
-
return
|
|
3633
|
+
return q({
|
|
3634
3634
|
subject: n,
|
|
3635
3635
|
count: e.length,
|
|
3636
3636
|
limit: t.searchText ? void 0 : t.limit,
|
|
@@ -3640,15 +3640,15 @@ No shared labels.`;
|
|
|
3640
3640
|
zeroReasonHints: u
|
|
3641
3641
|
}) + h;
|
|
3642
3642
|
}
|
|
3643
|
-
const { FIND_PROJECTS: bs, ADD_TASKS: gs, UPDATE_TASKS: ys } = y,
|
|
3643
|
+
const { FIND_PROJECTS: bs, ADD_TASKS: gs, UPDATE_TASKS: ys } = y, Ti = {
|
|
3644
3644
|
projectId: s.string().min(1).optional().describe(
|
|
3645
3645
|
'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.'
|
|
3646
3646
|
),
|
|
3647
3647
|
searchTerm: s.string().optional().describe(
|
|
3648
3648
|
"Search for a user by name or email (partial and case insensitive match). If omitted, all users are returned."
|
|
3649
3649
|
)
|
|
3650
|
-
},
|
|
3651
|
-
collaborators: s.array(
|
|
3650
|
+
}, ki = {
|
|
3651
|
+
collaborators: s.array(Sr).describe("The found users."),
|
|
3652
3652
|
projectInfo: s.object({
|
|
3653
3653
|
id: s.string().describe("The project ID."),
|
|
3654
3654
|
name: s.string().describe("The project name."),
|
|
@@ -3657,16 +3657,16 @@ const { FIND_PROJECTS: bs, ADD_TASKS: gs, UPDATE_TASKS: ys } = y, yi = {
|
|
|
3657
3657
|
totalCount: s.number().describe("The total number of users found."),
|
|
3658
3658
|
totalAvailable: s.number().optional().describe("The total number of available users before the search filter was applied."),
|
|
3659
3659
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
3660
|
-
},
|
|
3660
|
+
}, wi = {
|
|
3661
3661
|
name: y.FIND_PROJECT_COLLABORATORS,
|
|
3662
3662
|
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.`,
|
|
3663
|
-
parameters:
|
|
3664
|
-
outputSchema:
|
|
3663
|
+
parameters: Ti,
|
|
3664
|
+
outputSchema: ki,
|
|
3665
3665
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3666
3666
|
async execute(e, t) {
|
|
3667
3667
|
const { projectId: o, searchTerm: r } = e;
|
|
3668
3668
|
if (!o)
|
|
3669
|
-
return
|
|
3669
|
+
return vi({ searchTerm: r, client: t, appliedFilters: e });
|
|
3670
3670
|
let n = o, i;
|
|
3671
3671
|
try {
|
|
3672
3672
|
if (i = await t.getProject(o), !i)
|
|
@@ -3736,12 +3736,12 @@ const { FIND_PROJECTS: bs, ADD_TASKS: gs, UPDATE_TASKS: ys } = y, yi = {
|
|
|
3736
3736
|
};
|
|
3737
3737
|
}
|
|
3738
3738
|
};
|
|
3739
|
-
async function
|
|
3739
|
+
async function vi({
|
|
3740
3740
|
searchTerm: e,
|
|
3741
3741
|
client: t,
|
|
3742
3742
|
appliedFilters: o
|
|
3743
3743
|
}) {
|
|
3744
|
-
const r = await N.getAllCollaborators(t), n = await
|
|
3744
|
+
const r = await N.getAllCollaborators(t), n = await Ii(t, r);
|
|
3745
3745
|
if (n.length === 0)
|
|
3746
3746
|
return {
|
|
3747
3747
|
textContent: `No users found. You may have no shared projects, or collaborator data is not accessible.
|
|
@@ -3775,7 +3775,7 @@ async function wi({
|
|
|
3775
3775
|
}
|
|
3776
3776
|
};
|
|
3777
3777
|
}
|
|
3778
|
-
async function
|
|
3778
|
+
async function Ii(e, t) {
|
|
3779
3779
|
try {
|
|
3780
3780
|
const o = await e.getUser();
|
|
3781
3781
|
return !o || t.some((r) => r.id === o.id) ? t : [
|
|
@@ -3810,7 +3810,7 @@ function ks({
|
|
|
3810
3810
|
const l = [];
|
|
3811
3811
|
e.length === 0 && o && (l.push(`No users match "${o}"`), l.push("Try a broader search term or check spelling"), r > 0 && l.push(`${r} users available without filter`));
|
|
3812
3812
|
const p = [];
|
|
3813
|
-
return e.length > 0 ? (p.push(`Use ${gs} with responsibleUser to assign new tasks`), p.push(`Use ${ys} with responsibleUser to reassign existing tasks`), p.push("Use user names, emails, or IDs for assignments")) : (p.push(`Use ${bs} to find other projects`), o && r > 0 && p.push("Try searching without filters to see all users")),
|
|
3813
|
+
return e.length > 0 ? (p.push(`Use ${gs} with responsibleUser to assign new tasks`), p.push(`Use ${ys} with responsibleUser to reassign existing tasks`), p.push("Use user names, emails, or IDs for assignments")) : (p.push(`Use ${bs} to find other projects`), o && r > 0 && p.push("Try searching without filters to see all users")), q({
|
|
3814
3814
|
subject: a,
|
|
3815
3815
|
count: e.length,
|
|
3816
3816
|
filterHints: c,
|
|
@@ -3820,11 +3820,11 @@ function ks({
|
|
|
3820
3820
|
nextSteps: p
|
|
3821
3821
|
});
|
|
3822
3822
|
}
|
|
3823
|
-
const { ADD_PROJECTS: Dt } = y,
|
|
3823
|
+
const { ADD_PROJECTS: Dt } = y, Si = {
|
|
3824
3824
|
active: "projects",
|
|
3825
3825
|
archived: "archived projects",
|
|
3826
3826
|
all: "projects (active and archived)"
|
|
3827
|
-
},
|
|
3827
|
+
}, ji = {
|
|
3828
3828
|
searchText: s.string().optional().describe(
|
|
3829
3829
|
'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.'
|
|
3830
3830
|
),
|
|
@@ -3835,17 +3835,17 @@ const { ADD_PROJECTS: Dt } = y, Ii = {
|
|
|
3835
3835
|
archivedStatus: s.enum(["active", "archived", "all"]).optional().describe(
|
|
3836
3836
|
"Which projects to return by archive status: 'active' (default, non-archived only), 'archived' (archived only), or 'all' (both active and archived). Each project includes an isArchived field. Archived projects can be deleted via the delete-object tool (type: 'project')."
|
|
3837
3837
|
)
|
|
3838
|
-
},
|
|
3838
|
+
}, Ci = {
|
|
3839
3839
|
projects: s.array(Q).describe("The found projects."),
|
|
3840
3840
|
nextCursor: s.string().optional(),
|
|
3841
3841
|
totalCount: s.number().describe("The total number of projects in this page."),
|
|
3842
3842
|
hasMore: s.boolean(),
|
|
3843
3843
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
3844
|
-
},
|
|
3844
|
+
}, $i = {
|
|
3845
3845
|
name: y.FIND_PROJECTS,
|
|
3846
3846
|
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.",
|
|
3847
|
-
parameters:
|
|
3848
|
-
outputSchema:
|
|
3847
|
+
parameters: ji,
|
|
3848
|
+
outputSchema: Ci,
|
|
3849
3849
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3850
3850
|
async execute(e, t) {
|
|
3851
3851
|
const { searchText: o } = e, r = e.archivedStatus ?? "active";
|
|
@@ -3853,8 +3853,8 @@ const { ADD_PROJECTS: Dt } = y, Ii = {
|
|
|
3853
3853
|
if (o || r === "all") {
|
|
3854
3854
|
const c = Promise.resolve([]), [d, l] = await Promise.all([
|
|
3855
3855
|
r === "archived" ? c : o ? rs(t, o) : ns(t),
|
|
3856
|
-
r === "active" ? c :
|
|
3857
|
-
]), p = o ?
|
|
3856
|
+
r === "active" ? c : lr(t)
|
|
3857
|
+
]), p = o ? ur(o) : null, u = p ? l.filter((h) => p.test(h.name)) : l;
|
|
3858
3858
|
n = [...d, ...u];
|
|
3859
3859
|
} else {
|
|
3860
3860
|
const c = r === "archived" ? await t.getArchivedProjects({
|
|
@@ -3865,7 +3865,7 @@ const { ADD_PROJECTS: Dt } = y, Ii = {
|
|
|
3865
3865
|
}
|
|
3866
3866
|
const a = n.map(Z);
|
|
3867
3867
|
return {
|
|
3868
|
-
textContent:
|
|
3868
|
+
textContent: Di({ projects: a, args: e, nextCursor: i }),
|
|
3869
3869
|
structuredContent: {
|
|
3870
3870
|
projects: a,
|
|
3871
3871
|
nextCursor: i ?? void 0,
|
|
@@ -3876,17 +3876,17 @@ const { ADD_PROJECTS: Dt } = y, Ii = {
|
|
|
3876
3876
|
};
|
|
3877
3877
|
}
|
|
3878
3878
|
};
|
|
3879
|
-
function
|
|
3879
|
+
function Di({
|
|
3880
3880
|
projects: e,
|
|
3881
3881
|
args: t,
|
|
3882
3882
|
nextCursor: o
|
|
3883
3883
|
}) {
|
|
3884
|
-
const r =
|
|
3884
|
+
const r = Si[t.archivedStatus ?? "active"], n = t.searchText ? `All ${r} matching "${t.searchText}"` : `${r.charAt(0).toUpperCase()}${r.slice(1)}`, i = [];
|
|
3885
3885
|
t.searchText && i.push(`searchText: "${t.searchText}"`), t.archivedStatus && t.archivedStatus !== "active" && i.push(`archivedStatus: "${t.archivedStatus}"`);
|
|
3886
|
-
const a = 10, d = e.slice(0, a).map(
|
|
3886
|
+
const a = 10, d = e.slice(0, a).map(qr).join(`
|
|
3887
3887
|
`), l = e.length - a, p = l > 0 ? `${d}
|
|
3888
3888
|
…and ${l} more` : d, u = [];
|
|
3889
|
-
return e.length === 0 && (t.searchText ? (u.push("Try broader search terms"), u.push("Check spelling"), u.push("Remove searchText to see all projects")) : t.archivedStatus === "archived" ? (u.push("No archived projects"), u.push("Use archivedStatus: 'all' to also see active projects")) : t.archivedStatus === "all" ? (u.push("No projects created yet"), u.push(`Use ${Dt} to create a project`)) : (u.push("No active projects"), u.push("Use archivedStatus: 'all' to include archived projects"), u.push(`Use ${Dt} to create a project`))),
|
|
3889
|
+
return e.length === 0 && (t.searchText ? (u.push("Try broader search terms"), u.push("Check spelling"), u.push("Remove searchText to see all projects")) : t.archivedStatus === "archived" ? (u.push("No archived projects"), u.push("Use archivedStatus: 'all' to also see active projects")) : t.archivedStatus === "all" ? (u.push("No projects created yet"), u.push(`Use ${Dt} to create a project`)) : (u.push("No active projects"), u.push("Use archivedStatus: 'all' to include archived projects"), u.push(`Use ${Dt} to create a project`))), q({
|
|
3890
3890
|
subject: n,
|
|
3891
3891
|
count: e.length,
|
|
3892
3892
|
limit: t.searchText || t.archivedStatus === "all" ? void 0 : t.limit,
|
|
@@ -3896,22 +3896,22 @@ function $i({
|
|
|
3896
3896
|
zeroReasonHints: u
|
|
3897
3897
|
});
|
|
3898
3898
|
}
|
|
3899
|
-
const
|
|
3899
|
+
const xi = {
|
|
3900
3900
|
taskId: s.string().optional().describe(
|
|
3901
3901
|
"Find all reminders for a specific task. Returns both time-based and location reminders."
|
|
3902
3902
|
),
|
|
3903
3903
|
reminderId: s.string().optional().describe("Get a specific time-based reminder (relative or absolute) by its ID."),
|
|
3904
3904
|
locationReminderId: s.string().optional().describe("Get a specific location reminder by its ID.")
|
|
3905
|
-
},
|
|
3905
|
+
}, Ai = {
|
|
3906
3906
|
reminders: s.array(ot).describe("The found reminders (time-based and location)."),
|
|
3907
3907
|
searchType: s.string().describe('The search type used: "task", "reminder", or "location_reminder".'),
|
|
3908
3908
|
searchId: s.string().describe("The ID used for the search."),
|
|
3909
3909
|
totalCount: s.number().describe("Total reminders in this response.")
|
|
3910
|
-
},
|
|
3910
|
+
}, Ei = {
|
|
3911
3911
|
name: y.FIND_REMINDERS,
|
|
3912
3912
|
description: "Find reminders by task ID (returns all reminder types), or get a specific reminder by its ID. Use reminderId for time-based reminders and locationReminderId for location reminders.",
|
|
3913
|
-
parameters:
|
|
3914
|
-
outputSchema:
|
|
3913
|
+
parameters: xi,
|
|
3914
|
+
outputSchema: Ai,
|
|
3915
3915
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3916
3916
|
async execute(e, t) {
|
|
3917
3917
|
const { taskId: o, reminderId: r, locationReminderId: n } = e, i = [o, r, n].filter(Boolean);
|
|
@@ -3957,7 +3957,7 @@ const Di = {
|
|
|
3957
3957
|
})
|
|
3958
3958
|
]), l = [...a, ...c].map(be);
|
|
3959
3959
|
return {
|
|
3960
|
-
textContent:
|
|
3960
|
+
textContent: Oi(l, o),
|
|
3961
3961
|
structuredContent: {
|
|
3962
3962
|
reminders: l,
|
|
3963
3963
|
searchType: "task",
|
|
@@ -3969,7 +3969,7 @@ const Di = {
|
|
|
3969
3969
|
throw new Error("One of taskId, reminderId, or locationReminderId must be provided.");
|
|
3970
3970
|
}
|
|
3971
3971
|
};
|
|
3972
|
-
function
|
|
3972
|
+
function Oi(e, t) {
|
|
3973
3973
|
if (e.length === 0)
|
|
3974
3974
|
return `No reminders found for task ${t}`;
|
|
3975
3975
|
const { timeBasedCount: o, locationCount: r } = is(e), n = [];
|
|
@@ -3983,22 +3983,22 @@ function Ei(e, t) {
|
|
|
3983
3983
|
}
|
|
3984
3984
|
return `Found ${n.join(" and ")} for task ${t}`;
|
|
3985
3985
|
}
|
|
3986
|
-
const { ADD_SECTIONS:
|
|
3986
|
+
const { ADD_SECTIONS: Pi } = y, _i = {
|
|
3987
3987
|
projectId: s.string().min(1).describe(
|
|
3988
3988
|
'The ID of the project to search sections in. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
3989
3989
|
),
|
|
3990
3990
|
searchText: s.string().optional().describe(
|
|
3991
3991
|
'Search for a section by name (partial and case insensitive match). Supports wildcards (e.g. "work*" for prefix match). Use "\\*" for a literal asterisk. If omitted, all sections in the project are returned.'
|
|
3992
3992
|
)
|
|
3993
|
-
},
|
|
3994
|
-
sections: s.array(
|
|
3993
|
+
}, Ui = {
|
|
3994
|
+
sections: s.array(K).describe("The found sections."),
|
|
3995
3995
|
totalCount: s.number().describe("The total number of sections found."),
|
|
3996
3996
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
3997
3997
|
}, Ri = {
|
|
3998
3998
|
name: y.FIND_SECTIONS,
|
|
3999
3999
|
description: "Search for sections by name or other criteria in a project. When searching, uses server-side search to avoid fetching all sections.",
|
|
4000
|
-
parameters:
|
|
4001
|
-
outputSchema:
|
|
4000
|
+
parameters: _i,
|
|
4001
|
+
outputSchema: Ui,
|
|
4002
4002
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4003
4003
|
async execute(e, t) {
|
|
4004
4004
|
const o = await de({
|
|
@@ -4006,12 +4006,12 @@ const { ADD_SECTIONS: Oi } = y, Pi = {
|
|
|
4006
4006
|
client: t
|
|
4007
4007
|
});
|
|
4008
4008
|
let r;
|
|
4009
|
-
e.searchText ? r = await
|
|
4009
|
+
e.searchText ? r = await mr(t, e.searchText, o) : r = (await t.getSections({
|
|
4010
4010
|
projectId: o
|
|
4011
4011
|
})).results;
|
|
4012
|
-
const n = r.map(
|
|
4012
|
+
const n = r.map(Y);
|
|
4013
4013
|
return {
|
|
4014
|
-
textContent:
|
|
4014
|
+
textContent: Li({
|
|
4015
4015
|
sections: n,
|
|
4016
4016
|
projectId: e.projectId,
|
|
4017
4017
|
searchText: e.searchText
|
|
@@ -4024,16 +4024,16 @@ const { ADD_SECTIONS: Oi } = y, Pi = {
|
|
|
4024
4024
|
};
|
|
4025
4025
|
}
|
|
4026
4026
|
};
|
|
4027
|
-
function
|
|
4027
|
+
function Li({
|
|
4028
4028
|
sections: e,
|
|
4029
4029
|
projectId: t,
|
|
4030
4030
|
searchText: o
|
|
4031
4031
|
}) {
|
|
4032
4032
|
const r = [];
|
|
4033
|
-
o ? (r.push("Try broader search terms"), r.push("Check spelling"), r.push("Remove searchText to see all sections")) : (r.push("Project has no sections yet"), r.push(`Use ${
|
|
4033
|
+
o ? (r.push("Try broader search terms"), r.push("Check spelling"), r.push("Remove searchText to see all sections")) : (r.push("Project has no sections yet"), r.push(`Use ${Pi} to create sections`));
|
|
4034
4034
|
const n = o ? `Sections in project ${t} matching "${o}"` : `Sections in project ${t}`, i = e.length > 0 ? e.map((a) => ` ${a.name} • id=${a.id}`).join(`
|
|
4035
4035
|
`) : void 0;
|
|
4036
|
-
return
|
|
4036
|
+
return q({
|
|
4037
4037
|
subject: n,
|
|
4038
4038
|
count: e.length,
|
|
4039
4039
|
previewLines: i,
|
|
@@ -4043,7 +4043,7 @@ function Ui({
|
|
|
4043
4043
|
function ws(e) {
|
|
4044
4044
|
return /* @__PURE__ */ new Date(`${e}T00:00:00`);
|
|
4045
4045
|
}
|
|
4046
|
-
const
|
|
4046
|
+
const Ni = {
|
|
4047
4047
|
startDate: s.string().regex(/^(\d{4}-\d{2}-\d{2}|today)$/).optional().describe(
|
|
4048
4048
|
"The start date to get the tasks for. Format: YYYY-MM-DD, or 'today', which by default also includes overdue tasks."
|
|
4049
4049
|
),
|
|
@@ -4064,17 +4064,17 @@ const Li = {
|
|
|
4064
4064
|
"Filter when responsibleUser is omitted. 'assigned'=assigned to others; 'unassignedOrMe'=unassigned+mine; 'all'=everyone. Default: 'unassignedOrMe'."
|
|
4065
4065
|
),
|
|
4066
4066
|
...dt
|
|
4067
|
-
},
|
|
4067
|
+
}, Mi = {
|
|
4068
4068
|
tasks: s.array(H).describe("The found tasks."),
|
|
4069
4069
|
nextCursor: s.string().optional(),
|
|
4070
4070
|
totalCount: s.number().describe("The total number of tasks in this page."),
|
|
4071
4071
|
hasMore: s.boolean(),
|
|
4072
4072
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
4073
|
-
},
|
|
4073
|
+
}, Fi = {
|
|
4074
4074
|
name: y.FIND_TASKS_BY_DATE,
|
|
4075
4075
|
description: "Get tasks by date range. startDate='today' includes overdue items. Default responsibleUserFiltering='unassignedOrMe' excludes others' tasks. Person-specific queries (summaries, plans, reports) require responsibleUser.",
|
|
4076
|
-
parameters:
|
|
4077
|
-
outputSchema:
|
|
4076
|
+
parameters: Ni,
|
|
4077
|
+
outputSchema: Mi,
|
|
4078
4078
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4079
4079
|
async execute(e, t) {
|
|
4080
4080
|
if (!e.startDate && e.overdueOption !== "overdue-only")
|
|
@@ -4110,7 +4110,7 @@ const Li = {
|
|
|
4110
4110
|
limit: e.limit
|
|
4111
4111
|
});
|
|
4112
4112
|
return {
|
|
4113
|
-
textContent:
|
|
4113
|
+
textContent: Hi({ tasks: d, args: e, nextCursor: l, assigneeEmail: n }),
|
|
4114
4114
|
structuredContent: {
|
|
4115
4115
|
tasks: d,
|
|
4116
4116
|
nextCursor: l ?? void 0,
|
|
@@ -4121,7 +4121,7 @@ const Li = {
|
|
|
4121
4121
|
};
|
|
4122
4122
|
}
|
|
4123
4123
|
};
|
|
4124
|
-
function
|
|
4124
|
+
function Hi({
|
|
4125
4125
|
tasks: e,
|
|
4126
4126
|
args: t,
|
|
4127
4127
|
nextCursor: o,
|
|
@@ -4161,7 +4161,7 @@ function Fi({
|
|
|
4161
4161
|
a.push(`Great job! No tasks for today${c}`);
|
|
4162
4162
|
} else
|
|
4163
4163
|
a.push("Expand date range with larger 'daysCount'"), a.push("Check today's tasks with startDate='today'");
|
|
4164
|
-
return
|
|
4164
|
+
return q({
|
|
4165
4165
|
subject: i,
|
|
4166
4166
|
count: e.length,
|
|
4167
4167
|
limit: t.limit,
|
|
@@ -4171,13 +4171,13 @@ function Fi({
|
|
|
4171
4171
|
zeroReasonHints: a
|
|
4172
4172
|
});
|
|
4173
4173
|
}
|
|
4174
|
-
const
|
|
4175
|
-
class
|
|
4174
|
+
const Wi = 300 * 1e3;
|
|
4175
|
+
class Bi {
|
|
4176
4176
|
constructor() {
|
|
4177
4177
|
this.cache = null;
|
|
4178
4178
|
}
|
|
4179
4179
|
async getFilters(t) {
|
|
4180
|
-
if (this.cache && Date.now() - this.cache.timestamp <
|
|
4180
|
+
if (this.cache && Date.now() - this.cache.timestamp < Wi)
|
|
4181
4181
|
return this.cache.filters;
|
|
4182
4182
|
const r = ((await t.sync({
|
|
4183
4183
|
resourceTypes: ["filters"],
|
|
@@ -4234,7 +4234,7 @@ ${p}` + (d.length > 5 ? `
|
|
|
4234
4234
|
this.cache = null;
|
|
4235
4235
|
}
|
|
4236
4236
|
}
|
|
4237
|
-
const
|
|
4237
|
+
const zi = new Bi(), { FIND_COMPLETED_TASKS: xt, ADD_TASKS: At } = y, Ki = {
|
|
4238
4238
|
searchText: s.string().optional().describe("The text to search for in tasks."),
|
|
4239
4239
|
projectId: s.string().optional().describe(
|
|
4240
4240
|
'Find tasks in this project. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
@@ -4256,17 +4256,17 @@ const Bi = new Wi(), { FIND_COMPLETED_TASKS: xt, ADD_TASKS: At } = y, zi = {
|
|
|
4256
4256
|
"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."
|
|
4257
4257
|
),
|
|
4258
4258
|
...dt
|
|
4259
|
-
},
|
|
4259
|
+
}, Yi = {
|
|
4260
4260
|
tasks: s.array(H).describe("The found tasks."),
|
|
4261
4261
|
nextCursor: s.string().optional(),
|
|
4262
4262
|
totalCount: s.number().describe("The total number of tasks in this page."),
|
|
4263
4263
|
hasMore: s.boolean(),
|
|
4264
4264
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
4265
|
-
},
|
|
4265
|
+
}, qi = {
|
|
4266
4266
|
name: y.FIND_TASKS,
|
|
4267
4267
|
description: "Find tasks by text search, project/section/parent container, responsible user, labels, a raw Todoist filter string, or a saved filter by ID or name (filterIdOrName). At least one filter must be provided.",
|
|
4268
|
-
parameters:
|
|
4269
|
-
outputSchema:
|
|
4268
|
+
parameters: Ki,
|
|
4269
|
+
outputSchema: Yi,
|
|
4270
4270
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4271
4271
|
async execute(e, t) {
|
|
4272
4272
|
const {
|
|
@@ -4296,7 +4296,7 @@ const Bi = new Wi(), { FIND_COMPLETED_TASKS: xt, ADD_TASKS: At } = y, zi = {
|
|
|
4296
4296
|
'The `filter`/`filterIdOrName` parameter cannot be combined with projectId, sectionId, or parentId. Use filter syntax instead (e.g. "##ProjectName").'
|
|
4297
4297
|
);
|
|
4298
4298
|
let v = h;
|
|
4299
|
-
m && (v = (await
|
|
4299
|
+
m && (v = (await zi.resolveFilter(t, m)).filterQuery);
|
|
4300
4300
|
const j = await et(t, a), A = j?.userId, k = j?.email;
|
|
4301
4301
|
if (r || n || i) {
|
|
4302
4302
|
const D = {
|
|
@@ -4304,11 +4304,11 @@ const Bi = new Wi(), { FIND_COMPLETED_TASKS: xt, ADD_TASKS: At } = y, zi = {
|
|
|
4304
4304
|
cursor: l ?? null
|
|
4305
4305
|
};
|
|
4306
4306
|
r && (D.projectId = await de({ projectId: r, user: g })), n && (D.sectionId = n), i && (D.parentId = i);
|
|
4307
|
-
const { results: he, nextCursor:
|
|
4307
|
+
const { results: he, nextCursor: G } = await t.getTasks(D), $e = he.map(P);
|
|
4308
4308
|
let W = o ? $e.filter(
|
|
4309
4309
|
(te) => te.content.toLowerCase().includes(o.toLowerCase()) || te.description?.toLowerCase().includes(o.toLowerCase())
|
|
4310
4310
|
) : $e;
|
|
4311
|
-
return W =
|
|
4311
|
+
return W = dr({
|
|
4312
4312
|
tasks: W,
|
|
4313
4313
|
resolvedAssigneeId: A,
|
|
4314
4314
|
currentUserId: g.id,
|
|
@@ -4321,15 +4321,15 @@ const Bi = new Wi(), { FIND_COMPLETED_TASKS: xt, ADD_TASKS: At } = y, zi = {
|
|
|
4321
4321
|
textContent: Ee({
|
|
4322
4322
|
tasks: W,
|
|
4323
4323
|
args: e,
|
|
4324
|
-
nextCursor:
|
|
4324
|
+
nextCursor: G,
|
|
4325
4325
|
isContainerSearch: !0,
|
|
4326
4326
|
assigneeEmail: k
|
|
4327
4327
|
}),
|
|
4328
4328
|
structuredContent: {
|
|
4329
4329
|
tasks: W,
|
|
4330
|
-
nextCursor:
|
|
4330
|
+
nextCursor: G ?? void 0,
|
|
4331
4331
|
totalCount: W.length,
|
|
4332
|
-
hasMore: !!
|
|
4332
|
+
hasMore: !!G,
|
|
4333
4333
|
appliedFilters: e
|
|
4334
4334
|
}
|
|
4335
4335
|
};
|
|
@@ -4340,19 +4340,19 @@ const Bi = new Wi(), { FIND_COMPLETED_TASKS: xt, ADD_TASKS: At } = y, zi = {
|
|
|
4340
4340
|
lang: "en",
|
|
4341
4341
|
limit: d,
|
|
4342
4342
|
cursor: l ?? null
|
|
4343
|
-
}),
|
|
4343
|
+
}), G = D.map(P);
|
|
4344
4344
|
return {
|
|
4345
4345
|
textContent: Ee({
|
|
4346
|
-
tasks:
|
|
4346
|
+
tasks: G,
|
|
4347
4347
|
args: e,
|
|
4348
4348
|
nextCursor: he,
|
|
4349
4349
|
isContainerSearch: !1,
|
|
4350
4350
|
assigneeEmail: k
|
|
4351
4351
|
}),
|
|
4352
4352
|
structuredContent: {
|
|
4353
|
-
tasks:
|
|
4353
|
+
tasks: G,
|
|
4354
4354
|
nextCursor: he ?? void 0,
|
|
4355
|
-
totalCount:
|
|
4355
|
+
totalCount: G.length,
|
|
4356
4356
|
hasMore: !!he,
|
|
4357
4357
|
appliedFilters: e
|
|
4358
4358
|
}
|
|
@@ -4393,7 +4393,7 @@ const Bi = new Wi(), { FIND_COMPLETED_TASKS: xt, ADD_TASKS: At } = y, zi = {
|
|
|
4393
4393
|
};
|
|
4394
4394
|
}
|
|
4395
4395
|
};
|
|
4396
|
-
function
|
|
4396
|
+
function Gi(e) {
|
|
4397
4397
|
if (e.projectId) {
|
|
4398
4398
|
const t = [
|
|
4399
4399
|
e.searchText ? "No tasks in project match search" : "Project has no tasks yet"
|
|
@@ -4428,7 +4428,7 @@ function Ee({
|
|
|
4428
4428
|
const d = t.labels.map((l) => `@${l}`).join(t.labelsOperator === "and" ? " & " : " | ");
|
|
4429
4429
|
a.push(`labels: ${d}`);
|
|
4430
4430
|
}
|
|
4431
|
-
e.length === 0 && c.push(...
|
|
4431
|
+
e.length === 0 && c.push(...Gi(t));
|
|
4432
4432
|
} else {
|
|
4433
4433
|
const d = n || t.responsibleUser, l = [];
|
|
4434
4434
|
if (t.filter && l.push(`filter: ${t.filter}`), t.searchText && l.push(`"${t.searchText}"`), t.responsibleUser && l.push(`assigned to ${d}`), t.labels && t.labels.length > 0) {
|
|
@@ -4447,7 +4447,7 @@ function Ee({
|
|
|
4447
4447
|
t.searchText && (c.push("Try broader search terms"), c.push("Verify spelling and try partial words"), t.responsibleUser || c.push(`Check completed tasks with ${xt}`));
|
|
4448
4448
|
}
|
|
4449
4449
|
}
|
|
4450
|
-
return
|
|
4450
|
+
return q({
|
|
4451
4451
|
subject: i,
|
|
4452
4452
|
count: e.length,
|
|
4453
4453
|
limit: t.limit,
|
|
@@ -4457,7 +4457,7 @@ function Ee({
|
|
|
4457
4457
|
zeroReasonHints: c
|
|
4458
4458
|
});
|
|
4459
4459
|
}
|
|
4460
|
-
const
|
|
4460
|
+
const Vi = {
|
|
4461
4461
|
projectId: s.string().min(1).optional().describe(
|
|
4462
4462
|
"Optional project ID. If provided, shows detailed overview of that project. If omitted, shows overview of all projects."
|
|
4463
4463
|
)
|
|
@@ -4468,15 +4468,10 @@ const Gi = {
|
|
|
4468
4468
|
parentId: s.string().optional().describe("The parent project ID (for sub-projects, personal projects only)."),
|
|
4469
4469
|
folderId: s.string().optional().describe("The folder ID this project belongs to (workspace projects only)."),
|
|
4470
4470
|
childOrder: s.number().describe("The ordering index among siblings."),
|
|
4471
|
-
sections: s.array(
|
|
4472
|
-
s.object({
|
|
4473
|
-
id: s.string(),
|
|
4474
|
-
name: s.string()
|
|
4475
|
-
})
|
|
4476
|
-
),
|
|
4471
|
+
sections: s.array(K),
|
|
4477
4472
|
children: s.array(vs).describe("Nested child projects.")
|
|
4478
4473
|
})
|
|
4479
|
-
),
|
|
4474
|
+
), Ji = {
|
|
4480
4475
|
type: s.enum(["account_overview", "project_overview"]).describe("The type of overview returned."),
|
|
4481
4476
|
totalProjects: s.number().optional().describe("Total number of projects (account overview only)."),
|
|
4482
4477
|
totalTasks: s.number().optional().describe("Total number of tasks."),
|
|
@@ -4493,7 +4488,7 @@ const Gi = {
|
|
|
4493
4488
|
inbox: s.object({
|
|
4494
4489
|
id: s.string().describe("The inbox project ID."),
|
|
4495
4490
|
name: s.string().describe("The inbox project name."),
|
|
4496
|
-
sections: s.array(
|
|
4491
|
+
sections: s.array(K).describe("Sections in the inbox project.")
|
|
4497
4492
|
}).optional().describe("Inbox information (account overview only)."),
|
|
4498
4493
|
projects: s.array(s.lazy(() => vs)).optional().describe(
|
|
4499
4494
|
"List of projects with hierarchy, folders, and ordering (account overview only)."
|
|
@@ -4502,7 +4497,7 @@ const Gi = {
|
|
|
4502
4497
|
id: s.string().describe("The project ID."),
|
|
4503
4498
|
name: s.string().describe("The project name.")
|
|
4504
4499
|
}).optional().describe("Project details (project overview only)."),
|
|
4505
|
-
sections: s.array(
|
|
4500
|
+
sections: s.array(K).optional().describe("List of sections (project overview only)."),
|
|
4506
4501
|
tasks: s.array(s.any()).optional().describe("List of tasks (project overview only)."),
|
|
4507
4502
|
stats: s.object({
|
|
4508
4503
|
totalTasks: s.number(),
|
|
@@ -4510,7 +4505,7 @@ const Gi = {
|
|
|
4510
4505
|
tasksWithoutSection: s.number()
|
|
4511
4506
|
}).optional().describe("Statistics object (project overview only).")
|
|
4512
4507
|
};
|
|
4513
|
-
function
|
|
4508
|
+
function Xi(e) {
|
|
4514
4509
|
const t = {};
|
|
4515
4510
|
for (const n of e)
|
|
4516
4511
|
t[n.id] = {
|
|
@@ -4535,7 +4530,7 @@ function Ji(e) {
|
|
|
4535
4530
|
}
|
|
4536
4531
|
return r(o), o;
|
|
4537
4532
|
}
|
|
4538
|
-
async function
|
|
4533
|
+
async function Zi(e, t) {
|
|
4539
4534
|
const o = {};
|
|
4540
4535
|
return await Promise.all(
|
|
4541
4536
|
t.map(async (r) => {
|
|
@@ -4586,13 +4581,13 @@ function Ss(e, t) {
|
|
|
4586
4581
|
parentId: B(e) ? e.parentId ?? void 0 : void 0,
|
|
4587
4582
|
folderId: ke(e) ? e.folderId ?? void 0 : void 0,
|
|
4588
4583
|
childOrder: e.childOrder,
|
|
4589
|
-
sections: (t[e.id] || []).map(
|
|
4584
|
+
sections: (t[e.id] || []).map(Y),
|
|
4590
4585
|
children: e.children.map(
|
|
4591
4586
|
(o) => Ss(o, t)
|
|
4592
4587
|
)
|
|
4593
4588
|
};
|
|
4594
4589
|
}
|
|
4595
|
-
async function
|
|
4590
|
+
async function Qi(e, t) {
|
|
4596
4591
|
let o = [], r;
|
|
4597
4592
|
do {
|
|
4598
4593
|
const { results: n, nextCursor: i } = await e.getTasks({
|
|
@@ -4604,12 +4599,12 @@ async function Zi(e, t) {
|
|
|
4604
4599
|
} while (r);
|
|
4605
4600
|
return o;
|
|
4606
4601
|
}
|
|
4607
|
-
async function
|
|
4602
|
+
async function ea(e, t) {
|
|
4608
4603
|
const { results: o } = await e.getSections({ projectId: t });
|
|
4609
4604
|
return o;
|
|
4610
4605
|
}
|
|
4611
|
-
async function
|
|
4612
|
-
const { results: t } = await e.getProjects({}), o = t.find((u) => B(u) && u.inboxProject === !0), r = t.filter((u) => !B(u) || u.inboxProject !== !0), n =
|
|
4606
|
+
async function ta(e) {
|
|
4607
|
+
const { results: t } = await e.getProjects({}), o = t.find((u) => B(u) && u.inboxProject === !0), r = t.filter((u) => !B(u) || u.inboxProject !== !0), n = Xi(r), i = t.map((u) => u.id), a = await Zi(e, i), c = ["# Personal Projects", ""];
|
|
4613
4608
|
if (o) {
|
|
4614
4609
|
c.push(`- Inbox Project: ${o.name} (id=${o.id})`);
|
|
4615
4610
|
for (const u of a[o.id] || [])
|
|
@@ -4632,7 +4627,7 @@ async function ea(e) {
|
|
|
4632
4627
|
inbox: o ? {
|
|
4633
4628
|
id: o.id,
|
|
4634
4629
|
name: o.name,
|
|
4635
|
-
sections: (a[o.id] || []).map(
|
|
4630
|
+
sections: (a[o.id] || []).map(Y)
|
|
4636
4631
|
} : void 0,
|
|
4637
4632
|
projects: n.map(
|
|
4638
4633
|
(u) => Ss(u, a)
|
|
@@ -4646,11 +4641,11 @@ async function ea(e) {
|
|
|
4646
4641
|
};
|
|
4647
4642
|
return { textContent: l, structuredContent: p };
|
|
4648
4643
|
}
|
|
4649
|
-
async function
|
|
4644
|
+
async function sa(e, t) {
|
|
4650
4645
|
const [o, r, n] = await Promise.all([
|
|
4651
4646
|
e.getProject(t),
|
|
4652
|
-
|
|
4653
|
-
|
|
4647
|
+
ea(e, t),
|
|
4648
|
+
Qi(e, t)
|
|
4654
4649
|
]), i = {};
|
|
4655
4650
|
for (const p of r)
|
|
4656
4651
|
i[p.id] = [];
|
|
@@ -4678,7 +4673,7 @@ async function ta(e, t) {
|
|
|
4678
4673
|
id: o.id,
|
|
4679
4674
|
name: o.name
|
|
4680
4675
|
},
|
|
4681
|
-
sections: r.map(
|
|
4676
|
+
sections: r.map(Y),
|
|
4682
4677
|
tasks: n.map((p) => ({
|
|
4683
4678
|
...p,
|
|
4684
4679
|
children: []
|
|
@@ -4692,27 +4687,27 @@ async function ta(e, t) {
|
|
|
4692
4687
|
};
|
|
4693
4688
|
return { textContent: d, structuredContent: l };
|
|
4694
4689
|
}
|
|
4695
|
-
const
|
|
4690
|
+
const oa = {
|
|
4696
4691
|
name: y.GET_OVERVIEW,
|
|
4697
4692
|
description: "Get a Markdown overview. If no projectId is provided, shows all projects with hierarchy and sections (useful for navigation). If projectId is provided, shows detailed overview of that specific project including all tasks grouped by sections.",
|
|
4698
|
-
parameters:
|
|
4699
|
-
outputSchema:
|
|
4693
|
+
parameters: Vi,
|
|
4694
|
+
outputSchema: Ji,
|
|
4700
4695
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4701
4696
|
async execute(e, t) {
|
|
4702
|
-
const o = e.projectId ? await
|
|
4697
|
+
const o = e.projectId ? await sa(t, e.projectId) : await ta(t);
|
|
4703
4698
|
return {
|
|
4704
4699
|
textContent: o.textContent,
|
|
4705
4700
|
structuredContent: o.structuredContent
|
|
4706
4701
|
};
|
|
4707
4702
|
}
|
|
4708
|
-
},
|
|
4703
|
+
}, ra = {}, ie = s.object({
|
|
4709
4704
|
count: s.number().describe("Number of consecutive periods in this streak."),
|
|
4710
4705
|
start: s.string().describe("Start date of the streak."),
|
|
4711
4706
|
end: s.string().describe("End date of the streak.")
|
|
4712
4707
|
}), Ot = s.object({
|
|
4713
4708
|
id: s.string().describe("Project ID."),
|
|
4714
4709
|
completed: s.number().describe("Number of tasks completed in this project.")
|
|
4715
|
-
}),
|
|
4710
|
+
}), na = {
|
|
4716
4711
|
completedCount: s.number().describe("Total number of completed tasks (all-time)."),
|
|
4717
4712
|
daysItems: s.array(
|
|
4718
4713
|
s.object({
|
|
@@ -4761,11 +4756,11 @@ const sa = {
|
|
|
4761
4756
|
})
|
|
4762
4757
|
).describe("Recent karma change events with reasons."),
|
|
4763
4758
|
projectColors: s.record(s.string(), s.string()).describe("Map of project ID to color key.")
|
|
4764
|
-
},
|
|
4759
|
+
}, ia = {
|
|
4765
4760
|
name: y.GET_PRODUCTIVITY_STATS,
|
|
4766
4761
|
description: 'Get comprehensive productivity statistics including daily/weekly completion breakdowns, goal streaks (current, last, max), karma score and trends, and historical karma data. Useful for productivity analysis and tracking goal progress. Reports counts, streaks and karma only, never the tasks themselves — for "what did I complete", use find-activity.',
|
|
4767
|
-
parameters:
|
|
4768
|
-
outputSchema:
|
|
4762
|
+
parameters: ra,
|
|
4763
|
+
outputSchema: na,
|
|
4769
4764
|
annotations: {
|
|
4770
4765
|
readOnlyHint: !0,
|
|
4771
4766
|
destructiveHint: !1,
|
|
@@ -4774,7 +4769,7 @@ const sa = {
|
|
|
4774
4769
|
async execute(e, t) {
|
|
4775
4770
|
const o = await t.getProductivityStats();
|
|
4776
4771
|
return {
|
|
4777
|
-
textContent:
|
|
4772
|
+
textContent: aa(o),
|
|
4778
4773
|
structuredContent: {
|
|
4779
4774
|
completedCount: o.completedCount,
|
|
4780
4775
|
daysItems: o.daysItems,
|
|
@@ -4801,7 +4796,7 @@ const sa = {
|
|
|
4801
4796
|
};
|
|
4802
4797
|
}
|
|
4803
4798
|
};
|
|
4804
|
-
function
|
|
4799
|
+
function aa(e) {
|
|
4805
4800
|
const t = [
|
|
4806
4801
|
"# Productivity Statistics",
|
|
4807
4802
|
"",
|
|
@@ -4831,11 +4826,11 @@ function ia(e) {
|
|
|
4831
4826
|
return t.join(`
|
|
4832
4827
|
`);
|
|
4833
4828
|
}
|
|
4834
|
-
const
|
|
4829
|
+
const ca = {
|
|
4835
4830
|
projectId: s.string().min(1).describe("The ID of the project to get activity stats for."),
|
|
4836
4831
|
weeks: s.number().int().min(1).max(12).optional().describe("Number of weeks of activity data to retrieve (1-12, default 2)."),
|
|
4837
4832
|
includeWeeklyCounts: s.boolean().optional().describe("Include weekly rollup counts alongside daily counts.")
|
|
4838
|
-
},
|
|
4833
|
+
}, da = {
|
|
4839
4834
|
projectId: s.string().describe("The project ID."),
|
|
4840
4835
|
dayItems: s.array(
|
|
4841
4836
|
s.object({
|
|
@@ -4851,7 +4846,7 @@ const aa = {
|
|
|
4851
4846
|
})
|
|
4852
4847
|
).optional().describe("Weekly completion rollups. Only included when includeWeeklyCounts is true.")
|
|
4853
4848
|
};
|
|
4854
|
-
function
|
|
4849
|
+
function la(e, t) {
|
|
4855
4850
|
const o = [`# Activity Stats: Project ${e}`, ""];
|
|
4856
4851
|
if (t.dayItems.length > 0) {
|
|
4857
4852
|
o.push("## Daily Activity");
|
|
@@ -4867,11 +4862,11 @@ function da(e, t) {
|
|
|
4867
4862
|
return o.join(`
|
|
4868
4863
|
`);
|
|
4869
4864
|
}
|
|
4870
|
-
const
|
|
4865
|
+
const ua = {
|
|
4871
4866
|
name: y.GET_PROJECT_ACTIVITY_STATS,
|
|
4872
4867
|
description: "Get daily and optional weekly task completion counts for a project over a configurable time window (1-12 weeks). Useful for identifying completion trends and patterns.",
|
|
4873
|
-
parameters:
|
|
4874
|
-
outputSchema:
|
|
4868
|
+
parameters: ca,
|
|
4869
|
+
outputSchema: da,
|
|
4875
4870
|
annotations: {
|
|
4876
4871
|
readOnlyHint: !0,
|
|
4877
4872
|
destructiveHint: !1,
|
|
@@ -4883,7 +4878,7 @@ const la = {
|
|
|
4883
4878
|
includeWeeklyCounts: n
|
|
4884
4879
|
});
|
|
4885
4880
|
return {
|
|
4886
|
-
textContent:
|
|
4881
|
+
textContent: la(o, i),
|
|
4887
4882
|
structuredContent: {
|
|
4888
4883
|
projectId: o,
|
|
4889
4884
|
dayItems: i.dayItems,
|
|
@@ -4891,12 +4886,12 @@ const la = {
|
|
|
4891
4886
|
}
|
|
4892
4887
|
};
|
|
4893
4888
|
}
|
|
4894
|
-
},
|
|
4889
|
+
}, pa = {
|
|
4895
4890
|
projectId: s.string().min(1).describe("The ID of the project to check health for."),
|
|
4896
4891
|
includeContext: s.boolean().default(!1).describe(
|
|
4897
4892
|
"Include detailed health context with project metrics and task-level data. May produce large output for projects with many tasks."
|
|
4898
4893
|
)
|
|
4899
|
-
},
|
|
4894
|
+
}, ha = s.object({
|
|
4900
4895
|
id: s.string().describe("The task ID."),
|
|
4901
4896
|
content: s.string().describe("The task content/title."),
|
|
4902
4897
|
priority: s.string().describe("The task priority (1-4)."),
|
|
@@ -4904,7 +4899,7 @@ const la = {
|
|
|
4904
4899
|
deadline: s.string().optional().describe("The deadline date string, if set."),
|
|
4905
4900
|
isCompleted: s.boolean().describe("Whether the task is completed."),
|
|
4906
4901
|
labels: s.array(s.string()).describe("Labels applied to this task.")
|
|
4907
|
-
}),
|
|
4902
|
+
}), ma = {
|
|
4908
4903
|
projectId: s.string().describe("The project ID."),
|
|
4909
4904
|
projectName: s.string().describe("The project name."),
|
|
4910
4905
|
progress: s.object({
|
|
@@ -4930,12 +4925,12 @@ const la = {
|
|
|
4930
4925
|
tasksCompletedThisWeek: s.number().describe("Tasks completed in the current week."),
|
|
4931
4926
|
averageCompletionTime: s.number().optional().describe("Average task completion time in days, if available.")
|
|
4932
4927
|
}).describe("Aggregated project metrics."),
|
|
4933
|
-
tasks: s.array(
|
|
4928
|
+
tasks: s.array(ha).describe("Tasks in the project.")
|
|
4934
4929
|
}).optional().describe(
|
|
4935
4930
|
"Detailed project context with metrics and task data. Only included when includeContext is true."
|
|
4936
4931
|
)
|
|
4937
4932
|
};
|
|
4938
|
-
async function
|
|
4933
|
+
async function fa(e, t, o) {
|
|
4939
4934
|
if (o) {
|
|
4940
4935
|
const [i, a, c] = await Promise.all([
|
|
4941
4936
|
e.getProjectProgress(t),
|
|
@@ -4950,7 +4945,7 @@ async function ma(e, t, o) {
|
|
|
4950
4945
|
]);
|
|
4951
4946
|
return { progress: r, health: n };
|
|
4952
4947
|
}
|
|
4953
|
-
function
|
|
4948
|
+
function ba(e, { progress: t, health: o, context: r }) {
|
|
4954
4949
|
const n = [`# Project Health: ${e}`, ""];
|
|
4955
4950
|
if (n.push(`**Status:** ${o.status}`), o.isStale && n.push("**Note:** Health data is stale and may not reflect recent changes."), o.updateInProgress && n.push("**Note:** A health analysis update is currently in progress."), o.updatedAt && n.push(`**Last Updated:** ${o.updatedAt.toISOString()}`), n.push(""), n.push("## Progress"), n.push(
|
|
4956
4951
|
`**Completed:** ${t.completedCount} | **Active:** ${t.activeCount} | **Progress:** ${t.progressPercent}%`
|
|
@@ -4968,18 +4963,18 @@ function fa(e, { progress: t, health: o, context: r }) {
|
|
|
4968
4963
|
return n.join(`
|
|
4969
4964
|
`);
|
|
4970
4965
|
}
|
|
4971
|
-
const
|
|
4966
|
+
const ga = {
|
|
4972
4967
|
name: y.GET_PROJECT_HEALTH,
|
|
4973
4968
|
description: "Get a comprehensive health assessment for a project including completion progress, health status (EXCELLENT, ON_TRACK, AT_RISK, CRITICAL), and optional detailed context with project metrics and task-level data. Use includeContext=true for that full detail.",
|
|
4974
|
-
parameters:
|
|
4975
|
-
outputSchema:
|
|
4969
|
+
parameters: pa,
|
|
4970
|
+
outputSchema: ma,
|
|
4976
4971
|
annotations: {
|
|
4977
4972
|
readOnlyHint: !0,
|
|
4978
4973
|
destructiveHint: !1,
|
|
4979
4974
|
idempotentHint: !0
|
|
4980
4975
|
},
|
|
4981
4976
|
async execute(e, t) {
|
|
4982
|
-
const { projectId: o, includeContext: r } = e, n = await
|
|
4977
|
+
const { projectId: o, includeContext: r } = e, n = await fa(t, o, r), i = n.context?.projectName ?? `Project ${o}`, a = ba(i, n), c = n.context ? {
|
|
4983
4978
|
projectDescription: n.context.projectDescription ?? void 0,
|
|
4984
4979
|
projectMetrics: {
|
|
4985
4980
|
...n.context.projectMetrics,
|
|
@@ -5017,12 +5012,12 @@ const ba = {
|
|
|
5017
5012
|
}
|
|
5018
5013
|
};
|
|
5019
5014
|
}
|
|
5020
|
-
},
|
|
5015
|
+
}, ya = {
|
|
5021
5016
|
workspaceIdOrName: s.string().min(1).describe(
|
|
5022
5017
|
"The workspace ID or name. Supports exact ID, exact name match (case-insensitive), or unique partial name match."
|
|
5023
5018
|
),
|
|
5024
5019
|
projectIds: s.array(s.string().min(1)).min(1).optional().describe("Optional list of project IDs to scope insights to specific projects.")
|
|
5025
|
-
},
|
|
5020
|
+
}, Ta = s.object({
|
|
5026
5021
|
projectId: s.string().describe("The project ID."),
|
|
5027
5022
|
health: s.object({
|
|
5028
5023
|
status: s.enum(Ve).describe("The health status of the project."),
|
|
@@ -5034,15 +5029,15 @@ const ba = {
|
|
|
5034
5029
|
activeCount: s.number().describe("Number of active tasks."),
|
|
5035
5030
|
progressPercent: s.number().describe("Completion percentage (0-100).")
|
|
5036
5031
|
}).optional().describe("Progress data for this project. Omitted when the project has none.")
|
|
5037
|
-
}),
|
|
5032
|
+
}), ka = {
|
|
5038
5033
|
workspaceId: s.string().describe("The resolved workspace ID."),
|
|
5039
5034
|
workspaceName: s.string().describe("The resolved workspace name."),
|
|
5040
|
-
projectInsights: s.array(
|
|
5041
|
-
},
|
|
5035
|
+
projectInsights: s.array(Ta).describe("Health and progress insights for each project in the workspace.")
|
|
5036
|
+
}, wa = {
|
|
5042
5037
|
name: y.GET_WORKSPACE_INSIGHTS,
|
|
5043
5038
|
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.",
|
|
5044
|
-
parameters:
|
|
5045
|
-
outputSchema:
|
|
5039
|
+
parameters: ya,
|
|
5040
|
+
outputSchema: ka,
|
|
5046
5041
|
annotations: {
|
|
5047
5042
|
readOnlyHint: !0,
|
|
5048
5043
|
destructiveHint: !1,
|
|
@@ -5082,7 +5077,7 @@ const ba = {
|
|
|
5082
5077
|
};
|
|
5083
5078
|
}
|
|
5084
5079
|
};
|
|
5085
|
-
function
|
|
5080
|
+
function va(e) {
|
|
5086
5081
|
const t = e.trim();
|
|
5087
5082
|
if (!/^https?:\/\//i.test(t))
|
|
5088
5083
|
return t;
|
|
@@ -5092,23 +5087,21 @@ function wa(e) {
|
|
|
5092
5087
|
} catch {
|
|
5093
5088
|
throw new Error(`Could not read a template ID from "${t}".`);
|
|
5094
5089
|
}
|
|
5095
|
-
if (!
|
|
5090
|
+
if (!Ia(o.hostname))
|
|
5096
5091
|
throw new Error(
|
|
5097
5092
|
`"${o.hostname}" is not a Todoist domain. Pass a todoist.com template URL or the template ID itself.`
|
|
5098
5093
|
);
|
|
5099
|
-
|
|
5100
|
-
|
|
5094
|
+
o.hostname = "todoist.com";
|
|
5095
|
+
const r = Fs(o.toString());
|
|
5096
|
+
if (r?.type !== "template")
|
|
5101
5097
|
throw new Error(`"${t}" is not a Todoist template URL.`);
|
|
5102
|
-
|
|
5103
|
-
if (!i)
|
|
5104
|
-
throw new Error(`Could not read a template ID from "${t}".`);
|
|
5105
|
-
return i;
|
|
5098
|
+
return r.id;
|
|
5106
5099
|
}
|
|
5107
|
-
function
|
|
5100
|
+
function Ia(e) {
|
|
5108
5101
|
const t = e.toLowerCase();
|
|
5109
5102
|
return t === "todoist.com" || t.endsWith(".todoist.com");
|
|
5110
5103
|
}
|
|
5111
|
-
const
|
|
5104
|
+
const Sa = {
|
|
5112
5105
|
projectId: s.string().min(1).describe("The ID of the existing project to import the template into."),
|
|
5113
5106
|
templateId: s.string().optional().describe(
|
|
5114
5107
|
'The template to import — either a gallery slug ("product-launch"), a personal template ID ("UT_28Ex..."), or a full Todoist template URL, which is reduced to the ID automatically. Gallery templates work for anyone; personal templates only for the account that owns them. There is no way to list templates through this server, so only use the ID or URL the user supplied. Provide either this or `csvFileContent`, not both.'
|
|
@@ -5117,16 +5110,16 @@ const Ia = {
|
|
|
5117
5110
|
"Raw CSV template content, as produced by export-project-template. Provide either this or `templateId`, not both."
|
|
5118
5111
|
),
|
|
5119
5112
|
locale: s.string().optional().describe('Locale for the imported content when using `templateId`. Defaults to "en".')
|
|
5120
|
-
},
|
|
5121
|
-
sections: s.array(
|
|
5113
|
+
}, ja = {
|
|
5114
|
+
sections: s.array(K).describe("Sections created by the import."),
|
|
5122
5115
|
tasks: s.array(H).describe("Tasks created by the import."),
|
|
5123
5116
|
comments: s.array(ye).describe("Comments created by the import."),
|
|
5124
5117
|
totalCount: s.number().describe("The total number of objects created by the import.")
|
|
5125
|
-
},
|
|
5118
|
+
}, Ca = {
|
|
5126
5119
|
name: y.IMPORT_PROJECT_TEMPLATE,
|
|
5127
5120
|
description: "Import a template into an existing project, adding its tasks, sections and comments to whatever is already there. Source it by template ID/URL or by passing CSV content from export-project-template. To start a new project from a template, create the project with add-projects first, then import into it. This writes immediately and cannot be undone, so only run it against a project the user named.",
|
|
5128
|
-
parameters:
|
|
5129
|
-
outputSchema:
|
|
5121
|
+
parameters: Sa,
|
|
5122
|
+
outputSchema: ja,
|
|
5130
5123
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
5131
5124
|
async execute({ projectId: e, templateId: t, csvFileContent: o, locale: r }, n) {
|
|
5132
5125
|
if (!!t == !!o)
|
|
@@ -5135,15 +5128,15 @@ const Ia = {
|
|
|
5135
5128
|
);
|
|
5136
5129
|
const i = t ? await n.importTemplateFromId({
|
|
5137
5130
|
projectId: e,
|
|
5138
|
-
templateId:
|
|
5131
|
+
templateId: va(t),
|
|
5139
5132
|
locale: r
|
|
5140
5133
|
}) : await n.importTemplateIntoProject({
|
|
5141
5134
|
projectId: e,
|
|
5142
5135
|
file: o ?? "",
|
|
5143
5136
|
fileName: "template.csv"
|
|
5144
|
-
}), a = i.sections.map(
|
|
5137
|
+
}), a = i.sections.map(Y), c = i.tasks.map(P), d = i.comments.map(ge), l = i.projects.length + a.length + c.length + d.length;
|
|
5145
5138
|
return {
|
|
5146
|
-
textContent:
|
|
5139
|
+
textContent: $a({
|
|
5147
5140
|
projectId: e,
|
|
5148
5141
|
counts: {
|
|
5149
5142
|
projects: i.projects.length,
|
|
@@ -5157,7 +5150,7 @@ const Ia = {
|
|
|
5157
5150
|
};
|
|
5158
5151
|
}
|
|
5159
5152
|
};
|
|
5160
|
-
function
|
|
5153
|
+
function $a({
|
|
5161
5154
|
projectId: e,
|
|
5162
5155
|
counts: t,
|
|
5163
5156
|
totalCount: o
|
|
@@ -5167,21 +5160,21 @@ function Ca({
|
|
|
5167
5160
|
const r = Object.entries(t).filter(([, n]) => n > 0).map(([n, i]) => `${i} ${i === 1 ? n.replace(/s$/, "") : n}`);
|
|
5168
5161
|
return `Imported template into project (id=${e}): ${r.join(", ")}.`;
|
|
5169
5162
|
}
|
|
5170
|
-
const
|
|
5163
|
+
const Da = {}, xa = {
|
|
5171
5164
|
id: s.string().describe("The unique identifier for the workspace."),
|
|
5172
5165
|
name: s.string().describe("The name of the workspace."),
|
|
5173
|
-
plan: s.enum(
|
|
5174
|
-
role: s.enum(
|
|
5166
|
+
plan: s.enum(Ws).describe("The workspace plan type."),
|
|
5167
|
+
role: s.enum(Hs).optional().describe("The user's role in the workspace, if available."),
|
|
5175
5168
|
isLinkSharingEnabled: s.boolean().describe("Whether link sharing is enabled for the workspace."),
|
|
5176
5169
|
isGuestAllowed: s.boolean().describe("Whether guests are allowed in the workspace."),
|
|
5177
5170
|
createdAt: s.string().optional().describe("The ISO 8601 timestamp when the workspace was created."),
|
|
5178
5171
|
creatorId: s.string().describe("The ID of the user who created the workspace.")
|
|
5179
|
-
},
|
|
5172
|
+
}, Aa = {
|
|
5180
5173
|
type: s.literal("workspaces").describe("The type of the response."),
|
|
5181
|
-
workspaces: s.array(s.object(
|
|
5174
|
+
workspaces: s.array(s.object(xa)).describe("List of workspaces."),
|
|
5182
5175
|
count: s.number().describe("The total number of workspaces.")
|
|
5183
5176
|
};
|
|
5184
|
-
async function
|
|
5177
|
+
async function Ea(e) {
|
|
5185
5178
|
const o = (await e.getWorkspaces()).map((a) => ({
|
|
5186
5179
|
id: a.id,
|
|
5187
5180
|
name: a.name,
|
|
@@ -5212,22 +5205,22 @@ async function Aa(e) {
|
|
|
5212
5205
|
};
|
|
5213
5206
|
return { textContent: n, structuredContent: i };
|
|
5214
5207
|
}
|
|
5215
|
-
const
|
|
5208
|
+
const Oa = {
|
|
5216
5209
|
name: y.LIST_WORKSPACES,
|
|
5217
5210
|
description: "Get all workspaces for the authenticated user. Returns workspace details including ID, name, plan type (STARTER/BUSINESS), user role (ADMIN/MEMBER/GUEST), link sharing settings, guest permissions, creation date, and creator ID.",
|
|
5218
|
-
parameters:
|
|
5219
|
-
outputSchema:
|
|
5211
|
+
parameters: Da,
|
|
5212
|
+
outputSchema: Aa,
|
|
5220
5213
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
5221
5214
|
async execute(e, t) {
|
|
5222
|
-
const o = await
|
|
5215
|
+
const o = await Ea(t);
|
|
5223
5216
|
return {
|
|
5224
5217
|
textContent: o.textContent,
|
|
5225
5218
|
structuredContent: o.structuredContent
|
|
5226
5219
|
};
|
|
5227
5220
|
}
|
|
5228
|
-
}, { FIND_TASKS:
|
|
5221
|
+
}, { FIND_TASKS: Pa, FIND_PROJECT_COLLABORATORS: Pt, UPDATE_TASKS: _a } = y, Ua = 50, Ra = {
|
|
5229
5222
|
operation: s.enum(["assign", "unassign", "reassign"]).describe("The assignment operation to perform."),
|
|
5230
|
-
taskIds: s.array(s.string()).min(1).max(
|
|
5223
|
+
taskIds: s.array(s.string()).min(1).max(Ua).describe("The IDs of the tasks to operate on (max 50)."),
|
|
5231
5224
|
responsibleUser: s.string().optional().describe(
|
|
5232
5225
|
'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.'
|
|
5233
5226
|
),
|
|
@@ -5235,7 +5228,7 @@ const Ea = {
|
|
|
5235
5228
|
"For reassign operations: the current assignee to reassign from. Can be user ID, name, or email. Optional - if not provided, reassigns from any current assignee."
|
|
5236
5229
|
),
|
|
5237
5230
|
dryRun: s.boolean().optional().default(!1).describe("If true, validates operations without executing them.")
|
|
5238
|
-
},
|
|
5231
|
+
}, La = {
|
|
5239
5232
|
results: s.array(
|
|
5240
5233
|
s.object({
|
|
5241
5234
|
taskId: s.string().describe("The ID of the task."),
|
|
@@ -5251,11 +5244,11 @@ const Ea = {
|
|
|
5251
5244
|
failed: s.number().describe("Number of failed operations."),
|
|
5252
5245
|
dryRun: s.boolean().describe("Whether this was a dry run.")
|
|
5253
5246
|
}).optional().describe("Summary of the operation.")
|
|
5254
|
-
},
|
|
5247
|
+
}, Na = {
|
|
5255
5248
|
name: y.MANAGE_ASSIGNMENTS,
|
|
5256
5249
|
description: "Bulk assignment operations for multiple tasks. Supports assign, unassign, and reassign operations with atomic rollback on failures.",
|
|
5257
5250
|
parameters: Ra,
|
|
5258
|
-
outputSchema:
|
|
5251
|
+
outputSchema: La,
|
|
5259
5252
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5260
5253
|
async execute(e, t) {
|
|
5261
5254
|
const { operation: o, taskIds: r, responsibleUser: n, fromAssigneeUser: i, dryRun: a } = e;
|
|
@@ -5478,8 +5471,8 @@ function Oe({
|
|
|
5478
5471
|
`;
|
|
5479
5472
|
}
|
|
5480
5473
|
return !o && r.length > 0 ? (c += `**Next steps:**
|
|
5481
|
-
`, c += `• Use ${
|
|
5482
|
-
`, c += `• Use ${
|
|
5474
|
+
`, c += `• Use ${Pa} with responsibleUser to see ${e === "unassign" ? "unassigned" : "newly assigned"} tasks
|
|
5475
|
+
`, c += `• Use ${_a} for individual assignment changes
|
|
5483
5476
|
`, n.length > 0 && (c += `• Check failed tasks and use ${Pt} to verify collaborator access
|
|
5484
5477
|
`)) : o ? (c += `**To execute:**
|
|
5485
5478
|
`, c += `• Remove dryRun parameter and run again to execute changes
|
|
@@ -5491,17 +5484,17 @@ function Oe({
|
|
|
5491
5484
|
`, c += `• Use dryRun=true to validate before executing
|
|
5492
5485
|
`), c;
|
|
5493
5486
|
}
|
|
5494
|
-
const
|
|
5487
|
+
const Ma = {
|
|
5495
5488
|
action: s.enum(["archive", "unarchive"]).describe("The action to perform on the project."),
|
|
5496
5489
|
projectId: s.string().min(1).describe("The ID of the project.")
|
|
5497
|
-
},
|
|
5490
|
+
}, Fa = {
|
|
5498
5491
|
project: Q.describe("The updated project."),
|
|
5499
5492
|
success: s.boolean().describe("Whether the action was successful.")
|
|
5500
|
-
},
|
|
5493
|
+
}, Ha = {
|
|
5501
5494
|
name: y.PROJECT_MANAGEMENT,
|
|
5502
5495
|
description: "Archive or unarchive a project by its ID.",
|
|
5503
|
-
parameters:
|
|
5504
|
-
outputSchema:
|
|
5496
|
+
parameters: Ma,
|
|
5497
|
+
outputSchema: Fa,
|
|
5505
5498
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
|
|
5506
5499
|
async execute(e, t) {
|
|
5507
5500
|
const o = e.action === "archive" ? await t.archiveProject(e.projectId) : await t.unarchiveProject(e.projectId), r = Z(o);
|
|
@@ -5513,7 +5506,7 @@ const Na = {
|
|
|
5513
5506
|
}
|
|
5514
5507
|
};
|
|
5515
5508
|
}
|
|
5516
|
-
},
|
|
5509
|
+
}, Wa = {
|
|
5517
5510
|
action: s.enum(["move-to-workspace", "move-to-personal"]).describe("The action to perform on the project."),
|
|
5518
5511
|
projectId: s.string().min(1).describe("The ID of the project to move."),
|
|
5519
5512
|
workspaceId: s.string().min(1).optional().describe("The target workspace ID. Required when action is move-to-workspace."),
|
|
@@ -5521,14 +5514,14 @@ const Na = {
|
|
|
5521
5514
|
visibility: s.enum(["restricted", "team", "public"]).optional().describe(
|
|
5522
5515
|
"Optional access visibility for the project in the workspace (restricted, team, or public)."
|
|
5523
5516
|
)
|
|
5524
|
-
},
|
|
5517
|
+
}, Ba = {
|
|
5525
5518
|
project: Q.describe("The moved project."),
|
|
5526
5519
|
success: s.boolean().describe("Whether the move was successful.")
|
|
5527
|
-
},
|
|
5520
|
+
}, za = {
|
|
5528
5521
|
name: y.PROJECT_MOVE,
|
|
5529
5522
|
description: "Move a project between personal and workspace contexts.",
|
|
5530
|
-
parameters:
|
|
5531
|
-
outputSchema:
|
|
5523
|
+
parameters: Wa,
|
|
5524
|
+
outputSchema: Ba,
|
|
5532
5525
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
|
|
5533
5526
|
async execute(e, t) {
|
|
5534
5527
|
let o;
|
|
@@ -5551,7 +5544,7 @@ const Na = {
|
|
|
5551
5544
|
}
|
|
5552
5545
|
};
|
|
5553
5546
|
}
|
|
5554
|
-
}, js = ["project", "section"],
|
|
5547
|
+
}, js = ["project", "section"], Ka = {
|
|
5555
5548
|
type: s.enum(js).describe(
|
|
5556
5549
|
'The type of entity to reorder. "project" reorders sibling projects within the same parent (and can move projects to a new parent). "section" reorders sections within the same project.'
|
|
5557
5550
|
),
|
|
@@ -5568,17 +5561,17 @@ const Na = {
|
|
|
5568
5561
|
).min(1).describe(
|
|
5569
5562
|
"The items to reorder or move. Each item must have at least order or parentId. Items with parentId will be moved first, then items with order will be reordered. All items being reordered should be siblings for predictable results."
|
|
5570
5563
|
)
|
|
5571
|
-
},
|
|
5564
|
+
}, Ya = {
|
|
5572
5565
|
type: s.enum(js).describe("The type of entity that was reordered/moved."),
|
|
5573
5566
|
movedCount: s.number().describe("The number of entities moved to a new parent."),
|
|
5574
5567
|
reorderedCount: s.number().describe("The number of entities reordered."),
|
|
5575
5568
|
affectedIds: s.array(s.string()).describe("The IDs of all affected entities."),
|
|
5576
5569
|
success: s.boolean().describe("Whether the operation was successful.")
|
|
5577
|
-
},
|
|
5570
|
+
}, qa = {
|
|
5578
5571
|
name: y.REORDER_OBJECTS,
|
|
5579
5572
|
description: 'Reorder sibling projects or sections, and optionally move projects to a new parent. For projects: set order to reorder siblings, and/or set parentId to move under a new parent (use "root" for top level). For sections: set order to reorder within a project.',
|
|
5580
|
-
parameters:
|
|
5581
|
-
outputSchema:
|
|
5573
|
+
parameters: Ka,
|
|
5574
|
+
outputSchema: Ya,
|
|
5582
5575
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
|
|
5583
5576
|
async execute(e, t) {
|
|
5584
5577
|
const { type: o, items: r } = e, n = /* @__PURE__ */ new Set();
|
|
@@ -5598,7 +5591,7 @@ const Na = {
|
|
|
5598
5591
|
for (const u of a) {
|
|
5599
5592
|
const h = u.parentId;
|
|
5600
5593
|
i.push(
|
|
5601
|
-
|
|
5594
|
+
J("project_move", {
|
|
5602
5595
|
id: u.id,
|
|
5603
5596
|
parentId: h === "root" ? null : h
|
|
5604
5597
|
})
|
|
@@ -5608,14 +5601,14 @@ const Na = {
|
|
|
5608
5601
|
(u) => u.order !== void 0
|
|
5609
5602
|
);
|
|
5610
5603
|
c.length > 0 && (o === "project" ? i.push(
|
|
5611
|
-
|
|
5604
|
+
J("project_reorder", {
|
|
5612
5605
|
projects: c.map((u) => ({
|
|
5613
5606
|
id: u.id,
|
|
5614
5607
|
childOrder: u.order
|
|
5615
5608
|
}))
|
|
5616
5609
|
})
|
|
5617
5610
|
) : i.push(
|
|
5618
|
-
|
|
5611
|
+
J("section_reorder", {
|
|
5619
5612
|
sections: c.map((u) => ({
|
|
5620
5613
|
id: u.id,
|
|
5621
5614
|
sectionOrder: u.order
|
|
@@ -5640,22 +5633,22 @@ const Na = {
|
|
|
5640
5633
|
}
|
|
5641
5634
|
};
|
|
5642
5635
|
}
|
|
5643
|
-
},
|
|
5636
|
+
}, Ga = s.object({
|
|
5644
5637
|
id: s.string().min(1).describe("The ID of the task to reschedule."),
|
|
5645
5638
|
date: s.string().min(1).describe(
|
|
5646
5639
|
"The new date for the task. Use YYYY-MM-DD for date-only, or YYYY-MM-DDTHH:MM:SS for datetime. If date-only is provided and the task already has a specific time, the existing time is preserved."
|
|
5647
5640
|
)
|
|
5648
|
-
}),
|
|
5649
|
-
tasks: s.array(
|
|
5650
|
-
},
|
|
5641
|
+
}), Va = {
|
|
5642
|
+
tasks: s.array(Ga).min(1).describe("The tasks to reschedule with their new dates.")
|
|
5643
|
+
}, Ja = {
|
|
5651
5644
|
tasks: s.array(H).describe("The rescheduled tasks."),
|
|
5652
5645
|
totalCount: s.number().describe("The total number of tasks rescheduled."),
|
|
5653
5646
|
rescheduledTaskIds: s.array(s.string()).describe("The IDs of the rescheduled tasks.")
|
|
5654
|
-
},
|
|
5647
|
+
}, Xa = {
|
|
5655
5648
|
name: y.RESCHEDULE_TASKS,
|
|
5656
5649
|
description: "Reschedule tasks to new dates while preserving recurring schedules. Unlike update-tasks (which replaces the entire due string and can wipe recurrence), this tool changes only the date, keeping recurrence patterns intact. Use this when moving recurring tasks to a different date without altering their repeat pattern.",
|
|
5657
|
-
parameters:
|
|
5658
|
-
outputSchema:
|
|
5650
|
+
parameters: Va,
|
|
5651
|
+
outputSchema: Ja,
|
|
5659
5652
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5660
5653
|
async execute(e, t) {
|
|
5661
5654
|
const { tasks: o } = e, n = (await Promise.all(
|
|
@@ -5668,8 +5661,8 @@ const Na = {
|
|
|
5668
5661
|
throw new Error(
|
|
5669
5662
|
`Task "${l.content}" (${l.id}) has no due date. Rescheduling requires an existing due date.`
|
|
5670
5663
|
);
|
|
5671
|
-
const p =
|
|
5672
|
-
return
|
|
5664
|
+
const p = Za(d.date, l.due);
|
|
5665
|
+
return J("item_update", {
|
|
5673
5666
|
id: d.id,
|
|
5674
5667
|
due: {
|
|
5675
5668
|
date: p,
|
|
@@ -5699,16 +5692,16 @@ const Na = {
|
|
|
5699
5692
|
};
|
|
5700
5693
|
}
|
|
5701
5694
|
};
|
|
5702
|
-
function
|
|
5695
|
+
function Za(e, t) {
|
|
5703
5696
|
if (/^\d{4}-\d{2}-\d{2}$/.test(e) && t.datetime) {
|
|
5704
5697
|
const r = t.datetime.substring(10);
|
|
5705
5698
|
return e + r;
|
|
5706
5699
|
}
|
|
5707
5700
|
return e;
|
|
5708
5701
|
}
|
|
5709
|
-
const
|
|
5702
|
+
const Qa = {
|
|
5710
5703
|
query: s.string().min(1).describe("The search query string to find tasks and projects.")
|
|
5711
|
-
},
|
|
5704
|
+
}, ec = {
|
|
5712
5705
|
results: s.array(
|
|
5713
5706
|
s.object({
|
|
5714
5707
|
id: s.string().describe("The ID of the result."),
|
|
@@ -5717,11 +5710,11 @@ const Za = {
|
|
|
5717
5710
|
})
|
|
5718
5711
|
).describe("The search results."),
|
|
5719
5712
|
totalCount: s.number().describe("Total number of results found.")
|
|
5720
|
-
},
|
|
5713
|
+
}, tc = {
|
|
5721
5714
|
name: y.SEARCH,
|
|
5722
5715
|
description: "Search across tasks and projects in Todoist. Returns a list of relevant results with IDs, titles, and URLs.",
|
|
5723
|
-
parameters:
|
|
5724
|
-
outputSchema:
|
|
5716
|
+
parameters: Qa,
|
|
5717
|
+
outputSchema: ec,
|
|
5725
5718
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
5726
5719
|
async execute(e, t) {
|
|
5727
5720
|
const { query: o } = e, [r, n] = await Promise.all([
|
|
@@ -5750,19 +5743,19 @@ const Za = {
|
|
|
5750
5743
|
structuredContent: { results: i, totalCount: i.length }
|
|
5751
5744
|
};
|
|
5752
5745
|
}
|
|
5753
|
-
}, tc = {
|
|
5754
|
-
ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to uncomplete.")
|
|
5755
5746
|
}, sc = {
|
|
5747
|
+
ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to uncomplete.")
|
|
5748
|
+
}, oc = {
|
|
5756
5749
|
uncompleted: s.array(s.string()).describe("The IDs of successfully uncompleted tasks."),
|
|
5757
5750
|
failures: s.array(ee).describe("Failed task uncompletion with error details."),
|
|
5758
5751
|
totalRequested: s.number().describe("The total number of tasks requested to uncomplete."),
|
|
5759
5752
|
successCount: s.number().describe("The number of successfully uncompleted tasks."),
|
|
5760
5753
|
failureCount: s.number().describe("The number of failed task uncompletions.")
|
|
5761
|
-
},
|
|
5754
|
+
}, rc = {
|
|
5762
5755
|
name: y.UNCOMPLETE_TASKS,
|
|
5763
5756
|
description: "Uncomplete (reopen) one or more completed tasks by their IDs.",
|
|
5764
|
-
parameters:
|
|
5765
|
-
outputSchema:
|
|
5757
|
+
parameters: sc,
|
|
5758
|
+
outputSchema: oc,
|
|
5766
5759
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
5767
5760
|
async execute(e, t) {
|
|
5768
5761
|
const o = [], r = [];
|
|
@@ -5777,7 +5770,7 @@ const Za = {
|
|
|
5777
5770
|
});
|
|
5778
5771
|
}
|
|
5779
5772
|
return {
|
|
5780
|
-
textContent:
|
|
5773
|
+
textContent: nc({
|
|
5781
5774
|
uncompleted: o,
|
|
5782
5775
|
failures: r,
|
|
5783
5776
|
args: e
|
|
@@ -5792,7 +5785,7 @@ const Za = {
|
|
|
5792
5785
|
};
|
|
5793
5786
|
}
|
|
5794
5787
|
};
|
|
5795
|
-
function
|
|
5788
|
+
function nc({
|
|
5796
5789
|
uncompleted: e,
|
|
5797
5790
|
failures: t,
|
|
5798
5791
|
args: o
|
|
@@ -5806,28 +5799,28 @@ function rc({
|
|
|
5806
5799
|
failures: t
|
|
5807
5800
|
});
|
|
5808
5801
|
}
|
|
5809
|
-
const
|
|
5802
|
+
const ic = s.object({
|
|
5810
5803
|
id: s.string().min(1).describe("The ID of the comment to update."),
|
|
5811
5804
|
content: s.string().min(1).describe("The new content for the comment.")
|
|
5812
|
-
}),
|
|
5813
|
-
comments: s.array(
|
|
5814
|
-
},
|
|
5805
|
+
}), ac = {
|
|
5806
|
+
comments: s.array(ic).min(1).describe("The comments to update.")
|
|
5807
|
+
}, cc = {
|
|
5815
5808
|
comments: s.array(ye).describe("The updated comments."),
|
|
5816
5809
|
totalCount: s.number().describe("The total number of comments updated."),
|
|
5817
5810
|
updatedCommentIds: s.array(s.string()).describe("The IDs of the updated comments."),
|
|
5818
5811
|
appliedOperations: s.object({
|
|
5819
5812
|
updateCount: s.number().describe("The number of comments updated.")
|
|
5820
5813
|
}).describe("Summary of operations performed.")
|
|
5821
|
-
},
|
|
5814
|
+
}, dc = {
|
|
5822
5815
|
name: y.UPDATE_COMMENTS,
|
|
5823
5816
|
description: "Update multiple existing comments with new content.",
|
|
5824
|
-
parameters:
|
|
5825
|
-
outputSchema:
|
|
5817
|
+
parameters: ac,
|
|
5818
|
+
outputSchema: cc,
|
|
5826
5819
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5827
5820
|
async execute(e, t) {
|
|
5828
5821
|
const { comments: o } = e, r = o.map(async (c) => await t.updateComment(c.id, { content: c.content })), i = (await Promise.all(r)).map(ge);
|
|
5829
5822
|
return {
|
|
5830
|
-
textContent:
|
|
5823
|
+
textContent: lc({
|
|
5831
5824
|
comments: i
|
|
5832
5825
|
}),
|
|
5833
5826
|
structuredContent: {
|
|
@@ -5841,7 +5834,7 @@ const nc = s.object({
|
|
|
5841
5834
|
};
|
|
5842
5835
|
}
|
|
5843
5836
|
};
|
|
5844
|
-
function
|
|
5837
|
+
function lc({ comments: e }) {
|
|
5845
5838
|
const t = e.filter((i) => i.taskId).length, o = e.filter((i) => i.projectId).length, r = [];
|
|
5846
5839
|
if (t > 0) {
|
|
5847
5840
|
const i = t > 1 ? "comments" : "comment";
|
|
@@ -5853,7 +5846,7 @@ function dc({ comments: e }) {
|
|
|
5853
5846
|
}
|
|
5854
5847
|
return r.length > 0 ? `Updated ${r.join(" and ")}` : "No comments updated";
|
|
5855
5848
|
}
|
|
5856
|
-
const
|
|
5849
|
+
const uc = s.object({
|
|
5857
5850
|
id: s.string().min(1).describe("The ID of the filter to update."),
|
|
5858
5851
|
name: s.string().min(1).optional().describe("The new name of the filter."),
|
|
5859
5852
|
query: s.string().min(1).optional().describe(
|
|
@@ -5861,9 +5854,9 @@ const lc = s.object({
|
|
|
5861
5854
|
),
|
|
5862
5855
|
color: le,
|
|
5863
5856
|
isFavorite: s.boolean().optional().describe("Whether to mark the filter as a favorite.")
|
|
5864
|
-
}),
|
|
5865
|
-
filters: s.array(
|
|
5866
|
-
},
|
|
5857
|
+
}), pc = {
|
|
5858
|
+
filters: s.array(uc).min(1).describe("The filters to update.")
|
|
5859
|
+
}, hc = {
|
|
5867
5860
|
filters: s.array(rt).describe("The updated filters."),
|
|
5868
5861
|
totalCount: s.number().describe("The total number of filters updated."),
|
|
5869
5862
|
updatedFilterIds: s.array(s.string()).describe("The IDs of the updated filters."),
|
|
@@ -5871,15 +5864,15 @@ const lc = s.object({
|
|
|
5871
5864
|
updateCount: s.number().describe("The number of filters actually updated."),
|
|
5872
5865
|
skippedCount: s.number().describe("The number of filters skipped (no changes).")
|
|
5873
5866
|
}).describe("Summary of operations performed.")
|
|
5874
|
-
},
|
|
5867
|
+
}, mc = {
|
|
5875
5868
|
name: y.UPDATE_FILTERS,
|
|
5876
5869
|
description: "Update one or more existing personal filters with new values.",
|
|
5877
|
-
parameters:
|
|
5878
|
-
outputSchema:
|
|
5870
|
+
parameters: pc,
|
|
5871
|
+
outputSchema: hc,
|
|
5879
5872
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5880
5873
|
async execute(e, t) {
|
|
5881
5874
|
const { filters: o } = e, r = [], i = o.map((h) => {
|
|
5882
|
-
const m =
|
|
5875
|
+
const m = bc(h);
|
|
5883
5876
|
return m !== null ? { kind: "skipped", reason: m } : (r.push(h), { kind: "updated", filter: h });
|
|
5884
5877
|
}).filter((h) => h.kind === "skipped").length;
|
|
5885
5878
|
if (r.length === 0)
|
|
@@ -5894,7 +5887,7 @@ const lc = s.object({
|
|
|
5894
5887
|
};
|
|
5895
5888
|
const a = r.map((h) => {
|
|
5896
5889
|
const { id: m, color: g, ...f } = h;
|
|
5897
|
-
return
|
|
5890
|
+
return J("filter_update", {
|
|
5898
5891
|
id: m,
|
|
5899
5892
|
...f,
|
|
5900
5893
|
...g !== void 0 ? { color: g } : {}
|
|
@@ -5910,7 +5903,7 @@ const lc = s.object({
|
|
|
5910
5903
|
itemOrder: h.itemOrder
|
|
5911
5904
|
}));
|
|
5912
5905
|
return {
|
|
5913
|
-
textContent:
|
|
5906
|
+
textContent: fc({ filters: p, skippedCount: i }),
|
|
5914
5907
|
structuredContent: {
|
|
5915
5908
|
filters: p,
|
|
5916
5909
|
totalCount: p.length,
|
|
@@ -5923,7 +5916,7 @@ const lc = s.object({
|
|
|
5923
5916
|
};
|
|
5924
5917
|
}
|
|
5925
5918
|
};
|
|
5926
|
-
function
|
|
5919
|
+
function fc({
|
|
5927
5920
|
filters: e,
|
|
5928
5921
|
skippedCount: t
|
|
5929
5922
|
}) {
|
|
@@ -5937,52 +5930,52 @@ ${n}`;
|
|
|
5937
5930
|
}
|
|
5938
5931
|
return r;
|
|
5939
5932
|
}
|
|
5940
|
-
function
|
|
5933
|
+
function bc({ id: e, ...t }) {
|
|
5941
5934
|
return Object.values(t).every((r) => r === void 0) ? "no-fields" : null;
|
|
5942
5935
|
}
|
|
5943
|
-
const
|
|
5936
|
+
const gc = s.object({
|
|
5944
5937
|
labelType: s.literal("personal").describe("Update a personal label, identified by its ID."),
|
|
5945
5938
|
id: s.string().min(1).describe("The ID of the personal label to update."),
|
|
5946
5939
|
name: s.string().min(1).max(128).optional().describe("The new name of the label."),
|
|
5947
5940
|
color: le,
|
|
5948
5941
|
order: s.number().int().optional().describe("The new position of the label in the label list."),
|
|
5949
5942
|
isFavorite: s.boolean().optional().describe("Whether to mark the label as a favorite.")
|
|
5950
|
-
}),
|
|
5943
|
+
}), yc = s.object({
|
|
5951
5944
|
labelType: s.literal("shared").describe(
|
|
5952
5945
|
"Rename a shared label across all tasks. Shared labels are identified by name; only renaming is supported (no color, order, or favorite)."
|
|
5953
5946
|
),
|
|
5954
5947
|
name: s.string().min(1).describe("The current name of the shared label."),
|
|
5955
5948
|
newName: s.string().min(1).describe("The new name for the shared label.")
|
|
5956
|
-
}),
|
|
5957
|
-
|
|
5958
|
-
|
|
5959
|
-
]),
|
|
5960
|
-
labels: s.array(
|
|
5949
|
+
}), Tc = s.discriminatedUnion("labelType", [
|
|
5950
|
+
gc,
|
|
5951
|
+
yc
|
|
5952
|
+
]), kc = {
|
|
5953
|
+
labels: s.array(Tc).min(1).describe(
|
|
5961
5954
|
'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.'
|
|
5962
5955
|
)
|
|
5963
|
-
},
|
|
5956
|
+
}, wc = s.object({
|
|
5964
5957
|
name: s.string().describe("The previous name of the shared label."),
|
|
5965
5958
|
newName: s.string().describe("The new name of the shared label.")
|
|
5966
|
-
}),
|
|
5959
|
+
}), vc = {
|
|
5967
5960
|
updatedLabels: s.array(pe).describe("The updated personal labels."),
|
|
5968
|
-
renamedSharedLabels: s.array(
|
|
5961
|
+
renamedSharedLabels: s.array(wc).describe("The shared labels that were renamed."),
|
|
5969
5962
|
totalCount: s.number().describe("The total number of successful operations (personal + shared)."),
|
|
5970
5963
|
appliedOperations: s.object({
|
|
5971
5964
|
updateCount: s.number().describe("Number of personal labels updated."),
|
|
5972
5965
|
renameCount: s.number().describe("Number of shared labels renamed."),
|
|
5973
5966
|
skippedCount: s.number().describe("Number of operations skipped (no changes or shared label not found).")
|
|
5974
5967
|
}).describe("Summary of operations performed.")
|
|
5975
|
-
},
|
|
5968
|
+
}, Ic = {
|
|
5976
5969
|
name: y.UPDATE_LABELS,
|
|
5977
5970
|
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.",
|
|
5978
|
-
parameters:
|
|
5979
|
-
outputSchema:
|
|
5971
|
+
parameters: kc,
|
|
5972
|
+
outputSchema: vc,
|
|
5980
5973
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5981
5974
|
async execute(e, t) {
|
|
5982
5975
|
const { labels: o } = e, r = await Promise.all(
|
|
5983
5976
|
o.map(async (p) => {
|
|
5984
5977
|
if (p.labelType === "personal") {
|
|
5985
|
-
const h =
|
|
5978
|
+
const h = jc(p);
|
|
5986
5979
|
if (h !== null) return { kind: "skipped", reason: h };
|
|
5987
5980
|
const { id: m, labelType: g, ...f } = p;
|
|
5988
5981
|
return { kind: "updated", label: await t.updateLabel(m, f) };
|
|
@@ -6000,7 +5993,7 @@ const bc = s.object({
|
|
|
6000
5993
|
(p) => p.kind === "skipped" && p.reason === "not-found"
|
|
6001
5994
|
).length;
|
|
6002
5995
|
return {
|
|
6003
|
-
textContent:
|
|
5996
|
+
textContent: Sc({
|
|
6004
5997
|
updatedLabels: n,
|
|
6005
5998
|
renamedSharedLabels: i,
|
|
6006
5999
|
skippedNoFields: c,
|
|
@@ -6019,7 +6012,7 @@ const bc = s.object({
|
|
|
6019
6012
|
};
|
|
6020
6013
|
}
|
|
6021
6014
|
};
|
|
6022
|
-
function
|
|
6015
|
+
function Sc({
|
|
6023
6016
|
updatedLabels: e,
|
|
6024
6017
|
renamedSharedLabels: t,
|
|
6025
6018
|
skippedNoFields: o,
|
|
@@ -6041,14 +6034,14 @@ function Ic({
|
|
|
6041
6034
|
return c.join(`
|
|
6042
6035
|
`);
|
|
6043
6036
|
}
|
|
6044
|
-
function
|
|
6037
|
+
function jc({
|
|
6045
6038
|
id: e,
|
|
6046
6039
|
labelType: t,
|
|
6047
6040
|
...o
|
|
6048
6041
|
}) {
|
|
6049
6042
|
return Object.values(o).every((n) => n === void 0) ? "no-fields" : null;
|
|
6050
6043
|
}
|
|
6051
|
-
const
|
|
6044
|
+
const Cc = s.object({
|
|
6052
6045
|
id: s.string().min(1).describe("The ID of the project to update."),
|
|
6053
6046
|
name: s.string().min(1).optional().describe("The new name of the project."),
|
|
6054
6047
|
isFavorite: s.boolean().optional().describe("Whether the project is a favorite."),
|
|
@@ -6063,9 +6056,9 @@ const jc = s.object({
|
|
|
6063
6056
|
)
|
|
6064
6057
|
).optional(),
|
|
6065
6058
|
color: le
|
|
6066
|
-
}),
|
|
6067
|
-
projects: s.array(
|
|
6068
|
-
},
|
|
6059
|
+
}), $c = {
|
|
6060
|
+
projects: s.array(Cc).min(1).describe("The projects to update.")
|
|
6061
|
+
}, Dc = {
|
|
6069
6062
|
projects: s.array(Q).describe("The updated projects."),
|
|
6070
6063
|
totalCount: s.number().describe("The total number of projects updated."),
|
|
6071
6064
|
updatedProjectIds: s.array(s.string()).describe("The IDs of the updated projects."),
|
|
@@ -6077,16 +6070,16 @@ const jc = s.object({
|
|
|
6077
6070
|
skippedCount: s.number().describe("The number of projects skipped (no changes)."),
|
|
6078
6071
|
failureCount: s.number().describe("The number of projects that failed to update.")
|
|
6079
6072
|
}).describe("Summary of operations performed.")
|
|
6080
|
-
},
|
|
6073
|
+
}, xc = {
|
|
6081
6074
|
name: y.UPDATE_PROJECTS,
|
|
6082
6075
|
description: "Update multiple existing projects with new values.",
|
|
6083
|
-
parameters:
|
|
6084
|
-
outputSchema:
|
|
6076
|
+
parameters: $c,
|
|
6077
|
+
outputSchema: Dc,
|
|
6085
6078
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
6086
6079
|
async execute(e, t) {
|
|
6087
6080
|
const { projects: o } = e, r = await Promise.allSettled(
|
|
6088
6081
|
o.map(async (l) => {
|
|
6089
|
-
const p =
|
|
6082
|
+
const p = Ec(l);
|
|
6090
6083
|
if (p !== null) return { kind: "skipped", reason: p };
|
|
6091
6084
|
const { id: u, ...h } = l;
|
|
6092
6085
|
return { kind: "updated", project: await O(() => t.updateProject(u, h)) };
|
|
@@ -6104,7 +6097,7 @@ const jc = s.object({
|
|
|
6104
6097
|
p.value.kind === "updated" ? n.push(Z(p.value.project)) : p.value.reason === "no-fields" ? a++ : c++;
|
|
6105
6098
|
}
|
|
6106
6099
|
return {
|
|
6107
|
-
textContent:
|
|
6100
|
+
textContent: Ac({
|
|
6108
6101
|
projects: n,
|
|
6109
6102
|
skippedNoFields: a,
|
|
6110
6103
|
skippedNoValidValues: c,
|
|
@@ -6124,7 +6117,7 @@ const jc = s.object({
|
|
|
6124
6117
|
};
|
|
6125
6118
|
}
|
|
6126
6119
|
};
|
|
6127
|
-
function
|
|
6120
|
+
function Ac({
|
|
6128
6121
|
projects: e,
|
|
6129
6122
|
skippedNoFields: t,
|
|
6130
6123
|
skippedNoValidValues: o,
|
|
@@ -6137,23 +6130,23 @@ function xc({
|
|
|
6137
6130
|
return t > 0 && c.push(`${t} skipped - no changes`), o > 0 && c.push(`${o} skipped - no valid field values`), c.length > 0 && (a += ` (${c.join(", ")})`), n > 0 && (a += `:
|
|
6138
6131
|
${i}`), at(a, r);
|
|
6139
6132
|
}
|
|
6140
|
-
function
|
|
6133
|
+
function Ec({ id: e, ...t }) {
|
|
6141
6134
|
const o = Object.values(t);
|
|
6142
6135
|
return o.length === 0 ? "no-fields" : o.every((r) => r === void 0) ? "no-valid-values" : null;
|
|
6143
6136
|
}
|
|
6144
|
-
const
|
|
6137
|
+
const Oc = s.object({
|
|
6145
6138
|
type: s.literal("relative"),
|
|
6146
6139
|
id: s.string().min(1).describe("The ID of the relative reminder to update."),
|
|
6147
6140
|
minuteOffset: s.number().int().min(0).optional().describe("New minute offset before task due time."),
|
|
6148
6141
|
service: je.optional().describe('New delivery method: "email" or "push".'),
|
|
6149
6142
|
isUrgent: Ce
|
|
6150
|
-
}),
|
|
6143
|
+
}), Pc = s.object({
|
|
6151
6144
|
type: s.literal("absolute"),
|
|
6152
6145
|
id: s.string().min(1).describe("The ID of the absolute reminder to update."),
|
|
6153
6146
|
due: ls.optional().describe("New due date/time for the reminder."),
|
|
6154
6147
|
service: je.optional().describe('New delivery method: "email" or "push".'),
|
|
6155
6148
|
isUrgent: Ce
|
|
6156
|
-
}),
|
|
6149
|
+
}), _c = s.object({
|
|
6157
6150
|
type: s.literal("location"),
|
|
6158
6151
|
id: s.string().min(1).describe("The ID of the location reminder to update."),
|
|
6159
6152
|
name: s.string().optional().describe("New location name."),
|
|
@@ -6163,23 +6156,23 @@ const Ec = s.object({
|
|
|
6163
6156
|
'New trigger condition: "on_enter" or "on_leave".'
|
|
6164
6157
|
),
|
|
6165
6158
|
radius: s.number().int().optional().describe("New radius in meters.")
|
|
6166
|
-
}),
|
|
6167
|
-
Ec,
|
|
6159
|
+
}), Uc = s.discriminatedUnion("type", [
|
|
6168
6160
|
Oc,
|
|
6169
|
-
Pc
|
|
6161
|
+
Pc,
|
|
6162
|
+
_c
|
|
6170
6163
|
]), Rc = {
|
|
6171
|
-
reminders: s.array(
|
|
6164
|
+
reminders: s.array(Uc).min(1).max(we).describe(
|
|
6172
6165
|
`Array of reminders to update (max ${we}). Each must include the reminder type and ID. Only include fields that need to change.`
|
|
6173
6166
|
)
|
|
6174
|
-
},
|
|
6167
|
+
}, Lc = {
|
|
6175
6168
|
reminders: s.array(ot).describe("The updated reminders."),
|
|
6176
6169
|
totalCount: s.number().describe("Total reminders updated."),
|
|
6177
6170
|
updatedReminderIds: s.array(s.string()).describe("IDs of updated reminders.")
|
|
6178
|
-
},
|
|
6171
|
+
}, Nc = {
|
|
6179
6172
|
name: y.UPDATE_REMINDERS,
|
|
6180
6173
|
description: 'Update existing reminders. Each reminder must specify its type ("relative", "absolute", or "location") and ID. Only include fields that need to change.',
|
|
6181
6174
|
parameters: Rc,
|
|
6182
|
-
outputSchema:
|
|
6175
|
+
outputSchema: Lc,
|
|
6183
6176
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !0 },
|
|
6184
6177
|
async execute(e, t) {
|
|
6185
6178
|
const { reminders: o } = e, r = o.map(async (d) => {
|
|
@@ -6213,7 +6206,7 @@ const Ec = s.object({
|
|
|
6213
6206
|
}
|
|
6214
6207
|
};
|
|
6215
6208
|
}
|
|
6216
|
-
},
|
|
6209
|
+
}, Mc = s.object({
|
|
6217
6210
|
id: s.string().min(1).describe("The ID of the section to update."),
|
|
6218
6211
|
name: s.string().min(1).optional().describe("The new name of the section."),
|
|
6219
6212
|
description: s.preprocess(
|
|
@@ -6228,17 +6221,17 @@ const Ec = s.object({
|
|
|
6228
6221
|
).optional()
|
|
6229
6222
|
}).refine((e) => e.name !== void 0 || e.description !== void 0, {
|
|
6230
6223
|
message: 'Provide at least one of "name" or "description" to update.'
|
|
6231
|
-
}),
|
|
6232
|
-
sections: s.array(
|
|
6233
|
-
},
|
|
6234
|
-
sections: s.array(
|
|
6224
|
+
}), Fc = {
|
|
6225
|
+
sections: s.array(Mc).min(1).describe("The sections to update.")
|
|
6226
|
+
}, Hc = {
|
|
6227
|
+
sections: s.array(K).describe("The updated sections."),
|
|
6235
6228
|
totalCount: s.number().describe("The total number of sections updated."),
|
|
6236
6229
|
updatedSectionIds: s.array(s.string()).describe("The IDs of the updated sections.")
|
|
6237
|
-
},
|
|
6230
|
+
}, Wc = {
|
|
6238
6231
|
name: y.UPDATE_SECTIONS,
|
|
6239
6232
|
description: "Update multiple existing sections with new values.",
|
|
6240
|
-
parameters:
|
|
6241
|
-
outputSchema:
|
|
6233
|
+
parameters: Fc,
|
|
6234
|
+
outputSchema: Hc,
|
|
6242
6235
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
6243
6236
|
async execute({ sections: e }, t) {
|
|
6244
6237
|
const o = await Promise.all(
|
|
@@ -6251,18 +6244,18 @@ const Ec = s.object({
|
|
|
6251
6244
|
})
|
|
6252
6245
|
);
|
|
6253
6246
|
return {
|
|
6254
|
-
textContent:
|
|
6247
|
+
textContent: Bc({
|
|
6255
6248
|
sections: o
|
|
6256
6249
|
}),
|
|
6257
6250
|
structuredContent: {
|
|
6258
|
-
sections: o.map(
|
|
6251
|
+
sections: o.map(Y),
|
|
6259
6252
|
totalCount: o.length,
|
|
6260
6253
|
updatedSectionIds: o.map((n) => n.id)
|
|
6261
6254
|
}
|
|
6262
6255
|
};
|
|
6263
6256
|
}
|
|
6264
6257
|
};
|
|
6265
|
-
function
|
|
6258
|
+
function Bc({ sections: e }) {
|
|
6266
6259
|
const t = e.length, o = e.map((n) => `• ${n.name} (id=${n.id}, projectId=${n.projectId})`).join(`
|
|
6267
6260
|
`);
|
|
6268
6261
|
return `Updated ${t} section${t === 1 ? "" : "s"}:
|
|
@@ -6271,27 +6264,27 @@ ${o}`;
|
|
|
6271
6264
|
function Cs(e, t) {
|
|
6272
6265
|
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;
|
|
6273
6266
|
}
|
|
6274
|
-
function
|
|
6267
|
+
function zc(e, t) {
|
|
6275
6268
|
return t.projectId !== void 0 ? e.projectId === t.projectId : t.sectionId !== void 0 ? e.sectionId === t.sectionId : e.parentId === t.parentId;
|
|
6276
6269
|
}
|
|
6277
|
-
function
|
|
6270
|
+
function Kc(e) {
|
|
6278
6271
|
return e.projectId !== void 0 ? `project:${e.projectId}` : e.sectionId !== void 0 ? `section:${e.sectionId}` : `parent:${e.parentId}`;
|
|
6279
6272
|
}
|
|
6280
|
-
function
|
|
6273
|
+
function Yc(e) {
|
|
6281
6274
|
const t = [];
|
|
6282
6275
|
return e.projectId && t.push({ projectId: e.projectId }), e.sectionId && t.push({ sectionId: e.sectionId }), e.parentId && t.push({ parentId: e.parentId }), t;
|
|
6283
6276
|
}
|
|
6284
|
-
function
|
|
6277
|
+
function qc({
|
|
6285
6278
|
taskId: e,
|
|
6286
6279
|
request: t,
|
|
6287
6280
|
current: o
|
|
6288
6281
|
}) {
|
|
6289
|
-
const r =
|
|
6282
|
+
const r = Yc(t);
|
|
6290
6283
|
if (r.length === 0)
|
|
6291
6284
|
return { redundantMoveSkipped: !1 };
|
|
6292
6285
|
let n = r, i = !1;
|
|
6293
6286
|
if (o) {
|
|
6294
|
-
const a = r.length === 1 ? (c) => Cs(o, c) : (c) =>
|
|
6287
|
+
const a = r.length === 1 ? (c) => Cs(o, c) : (c) => zc(o, c);
|
|
6295
6288
|
n = r.filter((c) => !a(c)), i = n.length < r.length;
|
|
6296
6289
|
}
|
|
6297
6290
|
if (n.length === 0)
|
|
@@ -6302,7 +6295,7 @@ function Yc({
|
|
|
6302
6295
|
);
|
|
6303
6296
|
return { move: n[0], redundantMoveSkipped: i };
|
|
6304
6297
|
}
|
|
6305
|
-
const
|
|
6298
|
+
const Gc = s.object({
|
|
6306
6299
|
id: s.string().min(1).describe("The ID of the task to update."),
|
|
6307
6300
|
content: s.string().optional().describe(
|
|
6308
6301
|
'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.'
|
|
@@ -6347,9 +6340,9 @@ const qc = s.object({
|
|
|
6347
6340
|
isUncompletable: s.boolean().optional().describe(
|
|
6348
6341
|
"Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
|
|
6349
6342
|
)
|
|
6350
|
-
}),
|
|
6351
|
-
tasks: s.array(
|
|
6352
|
-
},
|
|
6343
|
+
}), Vc = (e) => !!(e.projectId || e.sectionId || e.parentId), $s = (e) => Object.keys(e).length > 0, Jc = ["remove", "no date"], Xc = ["remove", "no date", "no deadline"], Zc = "no date", Ge = Yt.TASKS_PER_OPERATION, _t = {
|
|
6344
|
+
tasks: s.array(Gc).min(1).max(Ge).describe(`The tasks to update (max ${Ge}).`)
|
|
6345
|
+
}, Qc = {
|
|
6353
6346
|
tasks: s.array(H).describe("The updated tasks."),
|
|
6354
6347
|
totalCount: s.number().describe("The total number of tasks updated."),
|
|
6355
6348
|
updatedTaskIds: s.array(s.string()).describe("The IDs of the updated tasks."),
|
|
@@ -6364,22 +6357,22 @@ const qc = s.object({
|
|
|
6364
6357
|
"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."
|
|
6365
6358
|
)
|
|
6366
6359
|
}).describe("Summary of operations performed.")
|
|
6367
|
-
},
|
|
6360
|
+
}, ed = {
|
|
6368
6361
|
name: y.UPDATE_TASKS,
|
|
6369
6362
|
description: "Update existing tasks including content, dates, priorities, and assignments. Send only the fields that change.",
|
|
6370
6363
|
parameters: _t,
|
|
6371
|
-
outputSchema:
|
|
6364
|
+
outputSchema: Qc,
|
|
6372
6365
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
6373
6366
|
async execute(e, t) {
|
|
6374
6367
|
const { tasks: o } = s.object(_t).parse(e), r = o.map(() => ({ kind: "skipped" })), n = (T, b) => {
|
|
6375
6368
|
r[T] = { kind: "failed", error: b };
|
|
6376
6369
|
}, i = (T, b) => {
|
|
6377
6370
|
n(T, z(b));
|
|
6378
|
-
}, a = o.map((T, b) => ({ task: T, index: b })).filter(({ task: T }) =>
|
|
6371
|
+
}, a = o.map((T, b) => ({ task: T, index: b })).filter(({ task: T }) => dd(T)), c = await sd(
|
|
6379
6372
|
a.map(({ task: T }) => T),
|
|
6380
6373
|
t
|
|
6381
6374
|
), d = await Promise.allSettled(
|
|
6382
|
-
a.map(({ task: T, index: b }) =>
|
|
6375
|
+
a.map(({ task: T, index: b }) => id({ task: T, index: b, client: t, inbox: c }))
|
|
6383
6376
|
), l = [];
|
|
6384
6377
|
for (const [T, b] of d.entries()) {
|
|
6385
6378
|
const S = a[T]?.index ?? T;
|
|
@@ -6389,13 +6382,13 @@ const qc = s.object({
|
|
|
6389
6382
|
client: t,
|
|
6390
6383
|
ids: [
|
|
6391
6384
|
...new Set(
|
|
6392
|
-
l.filter((T) =>
|
|
6385
|
+
l.filter((T) => Vc(T.moveRequest)).map((T) => T.id)
|
|
6393
6386
|
)
|
|
6394
6387
|
]
|
|
6395
6388
|
}), u = [];
|
|
6396
6389
|
for (const T of l)
|
|
6397
6390
|
try {
|
|
6398
|
-
const b =
|
|
6391
|
+
const b = qc({
|
|
6399
6392
|
taskId: T.id,
|
|
6400
6393
|
request: T.moveRequest,
|
|
6401
6394
|
current: p.get(T.id)
|
|
@@ -6407,7 +6400,7 @@ const qc = s.object({
|
|
|
6407
6400
|
const h = /* @__PURE__ */ new Map(), m = [], g = (T) => {
|
|
6408
6401
|
const b = T.filter((S) => !S.failed);
|
|
6409
6402
|
b.length !== 0 && m.push(
|
|
6410
|
-
|
|
6403
|
+
nd({
|
|
6411
6404
|
client: t,
|
|
6412
6405
|
items: b,
|
|
6413
6406
|
onUpdated: (S, $) => {
|
|
@@ -6428,7 +6421,7 @@ const qc = s.object({
|
|
|
6428
6421
|
})
|
|
6429
6422
|
);
|
|
6430
6423
|
}, f = new Set(u.map(({ item: T }) => T.index));
|
|
6431
|
-
g(l.filter((T) => !f.has(T.index))), await
|
|
6424
|
+
g(l.filter((T) => !f.has(T.index))), await od({
|
|
6432
6425
|
client: t,
|
|
6433
6426
|
moving: u,
|
|
6434
6427
|
results: h,
|
|
@@ -6451,9 +6444,9 @@ const qc = s.object({
|
|
|
6451
6444
|
const b = h.get(T.index);
|
|
6452
6445
|
b && "task" in b && (r[T.index] = { kind: "updated", task: b.task });
|
|
6453
6446
|
}
|
|
6454
|
-
const { updatedTasks: v, failures: j, skippedCount: A } =
|
|
6447
|
+
const { updatedTasks: v, failures: j, skippedCount: A } = td({ tasks: o, outcomes: r }), k = l.filter((T) => T.redundantMoveSkipped).length, I = v.map(P);
|
|
6455
6448
|
return {
|
|
6456
|
-
textContent:
|
|
6449
|
+
textContent: cd({
|
|
6457
6450
|
tasks: I,
|
|
6458
6451
|
failures: j,
|
|
6459
6452
|
skippedCount: A,
|
|
@@ -6474,7 +6467,7 @@ const qc = s.object({
|
|
|
6474
6467
|
};
|
|
6475
6468
|
}
|
|
6476
6469
|
};
|
|
6477
|
-
function
|
|
6470
|
+
function td({ tasks: e, outcomes: t }) {
|
|
6478
6471
|
const o = [], r = [];
|
|
6479
6472
|
let n = 0;
|
|
6480
6473
|
for (const [i, a] of t.entries()) {
|
|
@@ -6491,7 +6484,7 @@ function ed({ tasks: e, outcomes: t }) {
|
|
|
6491
6484
|
}
|
|
6492
6485
|
return { updatedTasks: o, failures: r, skippedCount: n };
|
|
6493
6486
|
}
|
|
6494
|
-
async function
|
|
6487
|
+
async function sd(e, t) {
|
|
6495
6488
|
if (!e.some((o) => M(o.projectId)))
|
|
6496
6489
|
return {};
|
|
6497
6490
|
try {
|
|
@@ -6518,7 +6511,7 @@ async function Ds({
|
|
|
6518
6511
|
}
|
|
6519
6512
|
return o;
|
|
6520
6513
|
}
|
|
6521
|
-
async function
|
|
6514
|
+
async function od({
|
|
6522
6515
|
client: e,
|
|
6523
6516
|
moving: t,
|
|
6524
6517
|
results: o,
|
|
@@ -6528,10 +6521,10 @@ async function sd({
|
|
|
6528
6521
|
return;
|
|
6529
6522
|
const n = /* @__PURE__ */ new Map();
|
|
6530
6523
|
for (const c of t) {
|
|
6531
|
-
const d =
|
|
6524
|
+
const d = Kc(c.move), l = n.get(d);
|
|
6532
6525
|
l ? l.push(c) : n.set(d, [c]);
|
|
6533
6526
|
}
|
|
6534
|
-
const i =
|
|
6527
|
+
const i = po(e), a = [];
|
|
6535
6528
|
for (const c of n.values()) {
|
|
6536
6529
|
const d = [...new Set(c.map(({ item: u }) => u.id))], l = c[0]?.move, p = c.length === 1 ? c[0] : void 0;
|
|
6537
6530
|
try {
|
|
@@ -6559,12 +6552,12 @@ async function sd({
|
|
|
6559
6552
|
}
|
|
6560
6553
|
}
|
|
6561
6554
|
if (a.length > 0) {
|
|
6562
|
-
await
|
|
6555
|
+
await rd({ client: e, unresolved: a, results: o });
|
|
6563
6556
|
for (const { group: c } of a)
|
|
6564
6557
|
r(c);
|
|
6565
6558
|
}
|
|
6566
6559
|
}
|
|
6567
|
-
async function
|
|
6560
|
+
async function rd({
|
|
6568
6561
|
client: e,
|
|
6569
6562
|
unresolved: t,
|
|
6570
6563
|
results: o
|
|
@@ -6582,13 +6575,13 @@ async function od({
|
|
|
6582
6575
|
}
|
|
6583
6576
|
}
|
|
6584
6577
|
}
|
|
6585
|
-
async function
|
|
6578
|
+
async function nd({
|
|
6586
6579
|
client: e,
|
|
6587
6580
|
items: t,
|
|
6588
6581
|
onUpdated: o,
|
|
6589
6582
|
onFailed: r
|
|
6590
6583
|
}) {
|
|
6591
|
-
const n =
|
|
6584
|
+
const n = ho(e);
|
|
6592
6585
|
await Promise.all(
|
|
6593
6586
|
t.filter((i) => $s(i.updateArgs)).map(async (i) => {
|
|
6594
6587
|
try {
|
|
@@ -6602,7 +6595,7 @@ async function rd({
|
|
|
6602
6595
|
})
|
|
6603
6596
|
);
|
|
6604
6597
|
}
|
|
6605
|
-
async function
|
|
6598
|
+
async function id({
|
|
6606
6599
|
task: e,
|
|
6607
6600
|
index: t,
|
|
6608
6601
|
client: o,
|
|
@@ -6629,13 +6622,13 @@ async function nd({
|
|
|
6629
6622
|
...h !== void 0 && { labels: h }
|
|
6630
6623
|
};
|
|
6631
6624
|
u && (v.priority = Qt(u));
|
|
6632
|
-
const j =
|
|
6625
|
+
const j = Ut(
|
|
6633
6626
|
d,
|
|
6634
|
-
|
|
6635
|
-
|
|
6627
|
+
Jc,
|
|
6628
|
+
Zc
|
|
6636
6629
|
);
|
|
6637
6630
|
j !== void 0 && (v = { ...v, dueString: j });
|
|
6638
|
-
const A =
|
|
6631
|
+
const A = Ut(m, Xc, null);
|
|
6639
6632
|
if (A !== void 0 && (v = { ...v, deadlineDate: A }), l)
|
|
6640
6633
|
try {
|
|
6641
6634
|
const { minutes: k } = Zt(l);
|
|
@@ -6649,7 +6642,7 @@ async function nd({
|
|
|
6649
6642
|
}
|
|
6650
6643
|
return p !== void 0 && (v = {
|
|
6651
6644
|
...v,
|
|
6652
|
-
assigneeId: await
|
|
6645
|
+
assigneeId: await ad(o, n, p)
|
|
6653
6646
|
}), {
|
|
6654
6647
|
index: t,
|
|
6655
6648
|
id: n,
|
|
@@ -6663,7 +6656,7 @@ async function nd({
|
|
|
6663
6656
|
failed: !1
|
|
6664
6657
|
};
|
|
6665
6658
|
}
|
|
6666
|
-
async function
|
|
6659
|
+
async function ad(e, t, o) {
|
|
6667
6660
|
if (o === null || o === "unassign")
|
|
6668
6661
|
return null;
|
|
6669
6662
|
const r = await ct.validateTaskUpdateAssignment(
|
|
@@ -6677,7 +6670,7 @@ async function id(e, t, o) {
|
|
|
6677
6670
|
}
|
|
6678
6671
|
return r.resolvedUser?.userId;
|
|
6679
6672
|
}
|
|
6680
|
-
function
|
|
6673
|
+
function cd({
|
|
6681
6674
|
tasks: e,
|
|
6682
6675
|
failures: t,
|
|
6683
6676
|
skippedCount: o,
|
|
@@ -6698,10 +6691,10 @@ function ad({
|
|
|
6698
6691
|
Failed (${t.length}) - address or drop these items:
|
|
6699
6692
|
${l}${p}`;
|
|
6700
6693
|
}
|
|
6701
|
-
function
|
|
6694
|
+
function dd({ id: e, ...t }) {
|
|
6702
6695
|
return Object.keys(t).length > 0;
|
|
6703
6696
|
}
|
|
6704
|
-
function
|
|
6697
|
+
function Ut(e, t, o) {
|
|
6705
6698
|
if (e === void 0)
|
|
6706
6699
|
return e;
|
|
6707
6700
|
if (e === null)
|
|
@@ -6709,7 +6702,7 @@ function Rt(e, t, o) {
|
|
|
6709
6702
|
const r = e.trim().toLowerCase();
|
|
6710
6703
|
return t.includes(r) ? o : e;
|
|
6711
6704
|
}
|
|
6712
|
-
const
|
|
6705
|
+
const ld = {}, ud = {
|
|
6713
6706
|
type: s.literal("user_info").describe("The type of the response."),
|
|
6714
6707
|
userId: s.string().describe("The user ID."),
|
|
6715
6708
|
fullName: s.string().describe("The full name of the user."),
|
|
@@ -6726,25 +6719,25 @@ const dd = {}, ld = {
|
|
|
6726
6719
|
email: s.string().describe("The email address of the user."),
|
|
6727
6720
|
plan: s.enum(["Todoist Free", "Todoist Pro", "Todoist Business"]).describe("The user plan.")
|
|
6728
6721
|
};
|
|
6729
|
-
function
|
|
6722
|
+
function pd(e) {
|
|
6730
6723
|
return e.businessAccountId ? "Todoist Business" : e.isPremium ? "Todoist Pro" : "Todoist Free";
|
|
6731
6724
|
}
|
|
6732
|
-
function
|
|
6725
|
+
function hd(e, t) {
|
|
6733
6726
|
const r = ((e.getDay() || 7) - t + 7) % 7, n = new Date(e);
|
|
6734
6727
|
return n.setDate(e.getDate() - r), n;
|
|
6735
6728
|
}
|
|
6736
|
-
function
|
|
6729
|
+
function md(e) {
|
|
6737
6730
|
const t = new Date(e);
|
|
6738
6731
|
return t.setDate(e.getDate() + 6), t;
|
|
6739
6732
|
}
|
|
6740
|
-
function
|
|
6733
|
+
function fd(e) {
|
|
6741
6734
|
const t = new Date(e.getFullYear(), 0, 1), o = (e.getTime() - t.getTime()) / 864e5;
|
|
6742
6735
|
return Math.ceil((o + t.getDay() + 1) / 7);
|
|
6743
6736
|
}
|
|
6744
|
-
function
|
|
6737
|
+
function bd(e) {
|
|
6745
6738
|
return ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"][e === 7 ? 0 : e] ?? "Unknown";
|
|
6746
6739
|
}
|
|
6747
|
-
function
|
|
6740
|
+
function gd(e) {
|
|
6748
6741
|
try {
|
|
6749
6742
|
return new Intl.DateTimeFormat("en-US", { timeZone: e }), !0;
|
|
6750
6743
|
} catch {
|
|
@@ -6752,9 +6745,9 @@ function bd(e) {
|
|
|
6752
6745
|
}
|
|
6753
6746
|
}
|
|
6754
6747
|
function xs(e) {
|
|
6755
|
-
return
|
|
6748
|
+
return gd(e) ? e : "UTC";
|
|
6756
6749
|
}
|
|
6757
|
-
function
|
|
6750
|
+
function yd(e, t) {
|
|
6758
6751
|
const o = xs(t);
|
|
6759
6752
|
return e.toLocaleString("en-US", {
|
|
6760
6753
|
timeZone: o,
|
|
@@ -6767,8 +6760,8 @@ function gd(e, t) {
|
|
|
6767
6760
|
hour12: !1
|
|
6768
6761
|
});
|
|
6769
6762
|
}
|
|
6770
|
-
async function
|
|
6771
|
-
const t = await e.getUser(), o = t.tzInfo?.timezone ?? "UTC", r = xs(o), n = /* @__PURE__ */ new Date(), i =
|
|
6763
|
+
async function Td(e) {
|
|
6764
|
+
const t = await e.getUser(), o = t.tzInfo?.timezone ?? "UTC", r = xs(o), n = /* @__PURE__ */ new Date(), i = yd(n, r), a = t.startDay ?? 1, c = bd(a), d = pd(t), l = new Date(n.toLocaleString("en-US", { timeZone: r })), p = hd(l, a), u = md(p), h = fd(l), g = [
|
|
6772
6765
|
"# User Information",
|
|
6773
6766
|
"",
|
|
6774
6767
|
`**User ID:** ${t.id}`,
|
|
@@ -6810,26 +6803,26 @@ async function yd(e) {
|
|
|
6810
6803
|
};
|
|
6811
6804
|
return { textContent: g, structuredContent: f };
|
|
6812
6805
|
}
|
|
6813
|
-
const
|
|
6806
|
+
const kd = {
|
|
6814
6807
|
name: y.USER_INFO,
|
|
6815
6808
|
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).",
|
|
6816
|
-
parameters:
|
|
6817
|
-
outputSchema:
|
|
6809
|
+
parameters: ld,
|
|
6810
|
+
outputSchema: ud,
|
|
6818
6811
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
6819
6812
|
async execute(e, t) {
|
|
6820
|
-
const o = await
|
|
6813
|
+
const o = await Td(t);
|
|
6821
6814
|
return {
|
|
6822
6815
|
textContent: o.textContent,
|
|
6823
6816
|
structuredContent: o.structuredContent
|
|
6824
6817
|
};
|
|
6825
6818
|
}
|
|
6826
|
-
},
|
|
6819
|
+
}, Rt = 10 * 1024 * 1024, wd = /* @__PURE__ */ new Set([
|
|
6827
6820
|
"image/png",
|
|
6828
6821
|
"image/jpeg",
|
|
6829
6822
|
"image/gif",
|
|
6830
6823
|
"image/webp",
|
|
6831
6824
|
"image/svg+xml"
|
|
6832
|
-
]),
|
|
6825
|
+
]), vd = /* @__PURE__ */ new Set([
|
|
6833
6826
|
"text/plain",
|
|
6834
6827
|
"text/csv",
|
|
6835
6828
|
"text/html",
|
|
@@ -6837,7 +6830,7 @@ const Td = {
|
|
|
6837
6830
|
"application/json",
|
|
6838
6831
|
"application/xml",
|
|
6839
6832
|
"text/xml"
|
|
6840
|
-
]),
|
|
6833
|
+
]), Id = {
|
|
6841
6834
|
".png": "image/png",
|
|
6842
6835
|
".jpg": "image/jpeg",
|
|
6843
6836
|
".jpeg": "image/jpeg",
|
|
@@ -6852,23 +6845,23 @@ const Td = {
|
|
|
6852
6845
|
".xml": "application/xml",
|
|
6853
6846
|
".pdf": "application/pdf"
|
|
6854
6847
|
};
|
|
6855
|
-
function Id(e) {
|
|
6856
|
-
return kd.has(e) ? "image" : wd.has(e) || e.startsWith("text/") ? "text" : "binary";
|
|
6857
|
-
}
|
|
6858
6848
|
function Sd(e) {
|
|
6859
|
-
return (e
|
|
6849
|
+
return wd.has(e) ? "image" : vd.has(e) || e.startsWith("text/") ? "text" : "binary";
|
|
6860
6850
|
}
|
|
6861
6851
|
function jd(e) {
|
|
6852
|
+
return (e.split(";")[0] ?? e).trim().toLowerCase();
|
|
6853
|
+
}
|
|
6854
|
+
function Cd(e) {
|
|
6862
6855
|
try {
|
|
6863
6856
|
const t = new URL(e).pathname, o = t.lastIndexOf(".");
|
|
6864
6857
|
if (o === -1) return;
|
|
6865
6858
|
const r = t.slice(o).toLowerCase();
|
|
6866
|
-
return
|
|
6859
|
+
return Id[r];
|
|
6867
6860
|
} catch {
|
|
6868
6861
|
return;
|
|
6869
6862
|
}
|
|
6870
6863
|
}
|
|
6871
|
-
function
|
|
6864
|
+
function $d(e) {
|
|
6872
6865
|
try {
|
|
6873
6866
|
const t = new URL(e).pathname, o = t.lastIndexOf("/");
|
|
6874
6867
|
return o === -1 ? void 0 : t.slice(o + 1) || void 0;
|
|
@@ -6876,31 +6869,31 @@ function Cd(e) {
|
|
|
6876
6869
|
return;
|
|
6877
6870
|
}
|
|
6878
6871
|
}
|
|
6879
|
-
const
|
|
6872
|
+
const Dd = {
|
|
6880
6873
|
fileUrl: s.url().describe(
|
|
6881
6874
|
"The URL of the attachment file to view. Get this from the fileUrl field in a comment's fileAttachment."
|
|
6882
6875
|
)
|
|
6883
|
-
},
|
|
6876
|
+
}, xd = {
|
|
6884
6877
|
name: y.VIEW_ATTACHMENT,
|
|
6885
6878
|
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).",
|
|
6886
|
-
parameters:
|
|
6879
|
+
parameters: Dd,
|
|
6887
6880
|
annotations: {
|
|
6888
6881
|
readOnlyHint: !0,
|
|
6889
6882
|
destructiveHint: !1,
|
|
6890
6883
|
idempotentHint: !0
|
|
6891
6884
|
},
|
|
6892
6885
|
async execute({ fileUrl: e }, t) {
|
|
6893
|
-
const o = await t.viewAttachment(e), r = o.headers["content-length"], n = r ? Number.parseInt(r, 10) : void 0, i =
|
|
6894
|
-
if (n && n >
|
|
6886
|
+
const o = await t.viewAttachment(e), r = o.headers["content-length"], n = r ? Number.parseInt(r, 10) : void 0, i = $d(e), a = o.headers["content-type"], c = a ? jd(a) : void 0, d = c && c !== "application/octet-stream" ? c : Cd(e) ?? c ?? "application/octet-stream";
|
|
6887
|
+
if (n && n > Rt)
|
|
6895
6888
|
return {
|
|
6896
6889
|
textContent: `Attachment "${i ?? e}" is too large to display inline (${(n / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
|
|
6897
6890
|
};
|
|
6898
6891
|
const l = Buffer.from(await o.arrayBuffer()), p = l.byteLength;
|
|
6899
|
-
if (p >
|
|
6892
|
+
if (p > Rt)
|
|
6900
6893
|
return {
|
|
6901
6894
|
textContent: `Attachment "${i ?? e}" is too large to display inline (${(p / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
|
|
6902
6895
|
};
|
|
6903
|
-
const u =
|
|
6896
|
+
const u = Sd(d), h = [];
|
|
6904
6897
|
return u === "image" ? h.push({
|
|
6905
6898
|
type: "image",
|
|
6906
6899
|
data: l.toString("base64"),
|
|
@@ -6920,77 +6913,77 @@ const $d = {
|
|
|
6920
6913
|
contentItems: h
|
|
6921
6914
|
};
|
|
6922
6915
|
}
|
|
6923
|
-
},
|
|
6924
|
-
...
|
|
6916
|
+
}, Ad = {
|
|
6917
|
+
...Fi,
|
|
6925
6918
|
_meta: {
|
|
6926
6919
|
ui: {
|
|
6927
6920
|
resourceUri: Ne
|
|
6928
6921
|
}
|
|
6929
6922
|
}
|
|
6930
|
-
},
|
|
6923
|
+
}, Ed = {
|
|
6931
6924
|
// Task management tools
|
|
6932
|
-
addTasks:
|
|
6933
|
-
completeTasks:
|
|
6934
|
-
uncompleteTasks:
|
|
6935
|
-
updateTasks:
|
|
6936
|
-
rescheduleTasks:
|
|
6937
|
-
findTasks:
|
|
6938
|
-
findTasksByDate:
|
|
6939
|
-
findCompletedTasks:
|
|
6925
|
+
addTasks: Tn,
|
|
6926
|
+
completeTasks: Dn,
|
|
6927
|
+
uncompleteTasks: rc,
|
|
6928
|
+
updateTasks: ed,
|
|
6929
|
+
rescheduleTasks: Xa,
|
|
6930
|
+
findTasks: qi,
|
|
6931
|
+
findTasksByDate: Ad,
|
|
6932
|
+
findCompletedTasks: hi,
|
|
6940
6933
|
// Project management tools
|
|
6941
|
-
addProjects:
|
|
6942
|
-
updateProjects:
|
|
6943
|
-
findProjects:
|
|
6944
|
-
projectManagement:
|
|
6945
|
-
projectMove:
|
|
6934
|
+
addProjects: en,
|
|
6935
|
+
updateProjects: xc,
|
|
6936
|
+
findProjects: $i,
|
|
6937
|
+
projectManagement: Ha,
|
|
6938
|
+
projectMove: za,
|
|
6946
6939
|
// Section management tools
|
|
6947
|
-
addSections:
|
|
6948
|
-
updateSections:
|
|
6940
|
+
addSections: mn,
|
|
6941
|
+
updateSections: Wc,
|
|
6949
6942
|
findSections: Ri,
|
|
6950
6943
|
// Comment management tools
|
|
6951
|
-
addComments:
|
|
6952
|
-
findComments:
|
|
6953
|
-
updateComments:
|
|
6944
|
+
addComments: xr,
|
|
6945
|
+
findComments: ri,
|
|
6946
|
+
updateComments: dc,
|
|
6954
6947
|
// Reminder management tools
|
|
6955
|
-
addReminders:
|
|
6956
|
-
findReminders:
|
|
6957
|
-
updateReminders:
|
|
6948
|
+
addReminders: dn,
|
|
6949
|
+
findReminders: Ei,
|
|
6950
|
+
updateReminders: Nc,
|
|
6958
6951
|
// Attachment tools
|
|
6959
|
-
viewAttachment:
|
|
6952
|
+
viewAttachment: xd,
|
|
6960
6953
|
// Label management tools
|
|
6961
|
-
addLabels:
|
|
6962
|
-
updateLabels:
|
|
6963
|
-
findLabels:
|
|
6954
|
+
addLabels: Br,
|
|
6955
|
+
updateLabels: Ic,
|
|
6956
|
+
findLabels: gi,
|
|
6964
6957
|
// Filter management tools
|
|
6965
|
-
findFilters:
|
|
6966
|
-
addFilters:
|
|
6967
|
-
updateFilters:
|
|
6958
|
+
findFilters: _r,
|
|
6959
|
+
addFilters: Mr,
|
|
6960
|
+
updateFilters: mc,
|
|
6968
6961
|
// Activity and audit tools
|
|
6969
|
-
findActivity:
|
|
6970
|
-
getProductivityStats:
|
|
6962
|
+
findActivity: Xn,
|
|
6963
|
+
getProductivityStats: ia,
|
|
6971
6964
|
// Health and insights tools
|
|
6972
|
-
getProjectHealth:
|
|
6973
|
-
getProjectActivityStats:
|
|
6974
|
-
analyzeProjectHealth:
|
|
6975
|
-
getWorkspaceInsights:
|
|
6965
|
+
getProjectHealth: ga,
|
|
6966
|
+
getProjectActivityStats: ua,
|
|
6967
|
+
analyzeProjectHealth: jn,
|
|
6968
|
+
getWorkspaceInsights: wa,
|
|
6976
6969
|
// General tools
|
|
6977
|
-
getOverview:
|
|
6978
|
-
deleteObject:
|
|
6979
|
-
fetchObject:
|
|
6980
|
-
reorderObjects:
|
|
6981
|
-
userInfo:
|
|
6970
|
+
getOverview: oa,
|
|
6971
|
+
deleteObject: On,
|
|
6972
|
+
fetchObject: zn,
|
|
6973
|
+
reorderObjects: qa,
|
|
6974
|
+
userInfo: kd,
|
|
6982
6975
|
// Assignment and collaboration tools
|
|
6983
|
-
findProjectCollaborators:
|
|
6984
|
-
manageAssignments:
|
|
6976
|
+
findProjectCollaborators: wi,
|
|
6977
|
+
manageAssignments: Na,
|
|
6985
6978
|
// Template tools
|
|
6986
|
-
exportProjectTemplate:
|
|
6987
|
-
importProjectTemplate:
|
|
6979
|
+
exportProjectTemplate: Un,
|
|
6980
|
+
importProjectTemplate: Ca,
|
|
6988
6981
|
// Workspace tools
|
|
6989
|
-
listWorkspaces:
|
|
6982
|
+
listWorkspaces: Oa,
|
|
6990
6983
|
// OpenAI MCP tools
|
|
6991
|
-
search:
|
|
6992
|
-
fetch:
|
|
6993
|
-
},
|
|
6984
|
+
search: tc,
|
|
6985
|
+
fetch: qn
|
|
6986
|
+
}, Od = Object.values(Ed), Pd = `
|
|
6994
6987
|
## Todoist Task and Project Management Tools
|
|
6995
6988
|
|
|
6996
6989
|
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.
|
|
@@ -7047,7 +7040,7 @@ Use the **productivity-analysis** prompt for a combined productivity review —
|
|
|
7047
7040
|
|
|
7048
7041
|
Always provide clear, actionable task titles and descriptions. Use the overview tools to give users context about their workload and project status.
|
|
7049
7042
|
`;
|
|
7050
|
-
function
|
|
7043
|
+
function qd({
|
|
7051
7044
|
todoistApiKey: e,
|
|
7052
7045
|
baseUrl: t,
|
|
7053
7046
|
features: o = []
|
|
@@ -7059,13 +7052,13 @@ function Yd({
|
|
|
7059
7052
|
tools: { listChanged: !0 },
|
|
7060
7053
|
prompts: { listChanged: !0 }
|
|
7061
7054
|
},
|
|
7062
|
-
instructions:
|
|
7055
|
+
instructions: Pd
|
|
7063
7056
|
}
|
|
7064
|
-
), n =
|
|
7065
|
-
|
|
7057
|
+
), n = $o(e, { baseUrl: t });
|
|
7058
|
+
Vs(r);
|
|
7066
7059
|
const i = { server: r, client: n, features: o };
|
|
7067
|
-
for (const a of
|
|
7068
|
-
|
|
7060
|
+
for (const a of Od)
|
|
7061
|
+
Go({ tool: a, ...i });
|
|
7069
7062
|
return r.registerPrompt(
|
|
7070
7063
|
me.name,
|
|
7071
7064
|
{
|
|
@@ -7077,58 +7070,58 @@ function Yd({
|
|
|
7077
7070
|
), r;
|
|
7078
7071
|
}
|
|
7079
7072
|
export {
|
|
7080
|
-
|
|
7081
|
-
|
|
7082
|
-
|
|
7083
|
-
|
|
7084
|
-
|
|
7085
|
-
|
|
7086
|
-
|
|
7087
|
-
|
|
7088
|
-
|
|
7089
|
-
|
|
7090
|
-
|
|
7091
|
-
|
|
7092
|
-
|
|
7093
|
-
|
|
7094
|
-
|
|
7095
|
-
|
|
7096
|
-
|
|
7097
|
-
|
|
7098
|
-
|
|
7099
|
-
|
|
7100
|
-
|
|
7101
|
-
|
|
7102
|
-
|
|
7103
|
-
|
|
7104
|
-
|
|
7105
|
-
|
|
7106
|
-
|
|
7107
|
-
|
|
7108
|
-
|
|
7109
|
-
|
|
7110
|
-
|
|
7111
|
-
|
|
7112
|
-
|
|
7113
|
-
|
|
7114
|
-
|
|
7115
|
-
|
|
7116
|
-
|
|
7117
|
-
|
|
7118
|
-
|
|
7119
|
-
|
|
7120
|
-
|
|
7121
|
-
|
|
7122
|
-
|
|
7123
|
-
|
|
7124
|
-
|
|
7125
|
-
|
|
7126
|
-
|
|
7127
|
-
|
|
7128
|
-
|
|
7129
|
-
|
|
7130
|
-
|
|
7073
|
+
Po as $,
|
|
7074
|
+
oa as A,
|
|
7075
|
+
ia as B,
|
|
7076
|
+
ua as C,
|
|
7077
|
+
ga as D,
|
|
7078
|
+
wa as E,
|
|
7079
|
+
Yd as F,
|
|
7080
|
+
Ca as G,
|
|
7081
|
+
Oa as H,
|
|
7082
|
+
Na as I,
|
|
7083
|
+
Ha as J,
|
|
7084
|
+
za as K,
|
|
7085
|
+
Od as L,
|
|
7086
|
+
qa as M,
|
|
7087
|
+
Xa as N,
|
|
7088
|
+
tc as O,
|
|
7089
|
+
rc as P,
|
|
7090
|
+
dc as Q,
|
|
7091
|
+
mc as R,
|
|
7092
|
+
Ic as S,
|
|
7093
|
+
xc as T,
|
|
7094
|
+
Nc as U,
|
|
7095
|
+
Wc as V,
|
|
7096
|
+
ed as W,
|
|
7097
|
+
kd as X,
|
|
7098
|
+
xd as Y,
|
|
7099
|
+
$o as Z,
|
|
7100
|
+
yo as _,
|
|
7101
|
+
xr as a,
|
|
7102
|
+
Mr as b,
|
|
7103
|
+
Br as c,
|
|
7104
|
+
en as d,
|
|
7105
|
+
dn as e,
|
|
7106
|
+
mn as f,
|
|
7107
|
+
qd as g,
|
|
7108
|
+
Tn as h,
|
|
7109
|
+
jn as i,
|
|
7110
|
+
Dn as j,
|
|
7111
|
+
On as k,
|
|
7112
|
+
Un as l,
|
|
7113
|
+
qn as m,
|
|
7114
|
+
zn as n,
|
|
7115
|
+
Xn as o,
|
|
7116
|
+
ri as p,
|
|
7117
|
+
hi as q,
|
|
7118
|
+
_r as r,
|
|
7119
|
+
gi as s,
|
|
7120
|
+
Ed as t,
|
|
7121
|
+
wi as u,
|
|
7122
|
+
$i as v,
|
|
7123
|
+
Ei as w,
|
|
7131
7124
|
Ri as x,
|
|
7132
|
-
|
|
7133
|
-
|
|
7125
|
+
qi as y,
|
|
7126
|
+
Fi as z
|
|
7134
7127
|
};
|