@doist/todoist-mcp 10.4.0 → 10.4.2
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/README.md +0 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- package/dist/main-http.js +2 -2
- package/dist/main.js +1 -1
- package/dist/{mcp-server-DUs6oq-a.js → mcp-server-Q106qiDw.js} +880 -841
- package/dist/{require-valid-todoist-token-BeOx8xgI.js → require-valid-todoist-token-CgDIhI0W.js} +1 -1
- package/dist/tool-execution-error.d.ts +8 -2
- package/dist/tool-execution-error.d.ts.map +1 -1
- package/dist/tools/add-reminders.d.ts +4 -4
- package/dist/tools/add-tasks.d.ts.map +1 -1
- package/dist/tools/delete-object.d.ts +4 -4
- package/dist/tools/update-reminders.d.ts +4 -4
- package/dist/utils/reminder-schemas.d.ts +1 -1
- package/package.json +11 -11
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { ResourceTemplate as
|
|
2
|
-
import { createHash as
|
|
3
|
-
import { readFileSync as
|
|
4
|
-
import { dirname as
|
|
5
|
-
import { fileURLToPath as
|
|
6
|
-
import { registerAppResource as
|
|
7
|
-
import Q, { ZodError as
|
|
8
|
-
import { AsyncLocalStorage as
|
|
9
|
-
import { createRequire as
|
|
10
|
-
import { TodoistApi as
|
|
11
|
-
import { addDays as Fe, formatISO as
|
|
12
|
-
const
|
|
13
|
-
Le(
|
|
14
|
-
Le(
|
|
15
|
-
],
|
|
1
|
+
import { ResourceTemplate as ps, McpServer as ms } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { createHash as hs, randomUUID as Ne } from "node:crypto";
|
|
3
|
+
import { readFileSync as fs } from "node:fs";
|
|
4
|
+
import { dirname as Et, join as Le } from "node:path";
|
|
5
|
+
import { fileURLToPath as bs } from "node:url";
|
|
6
|
+
import { registerAppResource as gs, RESOURCE_MIME_TYPE as Ot, registerAppTool as ys } from "@modelcontextprotocol/ext-apps/server";
|
|
7
|
+
import Q, { ZodError as ks, z as s } from "zod";
|
|
8
|
+
import { AsyncLocalStorage as Ts } from "node:async_hooks";
|
|
9
|
+
import { createRequire as ws } from "node:module";
|
|
10
|
+
import { TodoistApi as vs, isWorkspaceProject as ke, isPersonalProject as ie, colors as Me, LOCATION_TRIGGERS as Ut, REMINDER_TYPES as Is, createCommand as q, REMINDER_DELIVERY_SERVICES as js, HEALTH_STATUSES as Xe, getTaskUrl as Pt, getProjectUrl as _t, GOAL_OWNER_TYPES as Ss, WORKSPACE_ROLES as Cs, WORKSPACE_PLANS as $s } from "@doist/todoist-sdk";
|
|
11
|
+
import { addDays as Fe, formatISO as lt } from "date-fns";
|
|
12
|
+
const ut = Et(bs(import.meta.url)), Ds = [
|
|
13
|
+
Le(ut, "task-list", "index.html"),
|
|
14
|
+
Le(ut, "mcp-apps", "index.html")
|
|
15
|
+
], As = `<!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 xs() {
|
|
22
22
|
const e = [];
|
|
23
|
-
for (const t of
|
|
23
|
+
for (const t of Ds)
|
|
24
24
|
try {
|
|
25
|
-
return
|
|
25
|
+
return fs(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), As;
|
|
30
30
|
}
|
|
31
|
-
const
|
|
31
|
+
const Rt = xs(), Es = hs("sha256").update(Rt).digest("hex").slice(0, 12), He = `ui://todoist/task-list@${Es}`, Os = "ui://todoist/task-list@{hash}", We = "Interactive task list widget", Us = "https://ai.todoist.net", Ge = {
|
|
32
32
|
ui: {
|
|
33
33
|
prefersBorder: !0,
|
|
34
34
|
csp: {
|
|
@@ -43,22 +43,22 @@ const _t = Cs(), $s = ls("sha256").update(_t).digest("hex").slice(0, 12), He = `
|
|
|
43
43
|
connect_domains: [],
|
|
44
44
|
resource_domains: []
|
|
45
45
|
},
|
|
46
|
-
"openai/widgetDomain":
|
|
46
|
+
"openai/widgetDomain": Us
|
|
47
47
|
};
|
|
48
|
-
function
|
|
48
|
+
function pt(e) {
|
|
49
49
|
return {
|
|
50
50
|
contents: [
|
|
51
51
|
{
|
|
52
52
|
uri: e,
|
|
53
|
-
mimeType:
|
|
54
|
-
text:
|
|
53
|
+
mimeType: Ot,
|
|
54
|
+
text: Rt,
|
|
55
55
|
_meta: Ge
|
|
56
56
|
}
|
|
57
57
|
]
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
|
|
60
|
+
function Ps(e) {
|
|
61
|
+
gs(
|
|
62
62
|
e,
|
|
63
63
|
"todoist-task-list",
|
|
64
64
|
He,
|
|
@@ -66,16 +66,16 @@ function xs(e) {
|
|
|
66
66
|
description: We,
|
|
67
67
|
_meta: Ge
|
|
68
68
|
},
|
|
69
|
-
async () =>
|
|
69
|
+
async () => pt(He)
|
|
70
70
|
), e.registerResource(
|
|
71
71
|
"todoist-task-list-hash-fallback",
|
|
72
|
-
new
|
|
72
|
+
new ps(Os, { list: void 0 }),
|
|
73
73
|
{
|
|
74
74
|
description: `${We} compatibility fallback`,
|
|
75
|
-
mimeType:
|
|
75
|
+
mimeType: Ot,
|
|
76
76
|
_meta: Ge
|
|
77
77
|
},
|
|
78
|
-
async (t) =>
|
|
78
|
+
async (t) => pt(t.toString())
|
|
79
79
|
);
|
|
80
80
|
}
|
|
81
81
|
function z(e) {
|
|
@@ -105,17 +105,17 @@ function ee(e) {
|
|
|
105
105
|
const t = O(e);
|
|
106
106
|
return t !== void 0 ? t : T(e);
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function _s(e) {
|
|
109
109
|
return e.replace(/\b(Bearer)\s+[A-Za-z0-9._~+/=-]+/gi, "$1 [REDACTED]").replace(
|
|
110
110
|
/\b(token|api[_-]?key|authorization)\s*[:=]\s*["']?[A-Za-z0-9._~+/=-]{6,}["']?/gi,
|
|
111
111
|
"$1: [REDACTED]"
|
|
112
112
|
).replace(/([?&](?:token|api[_-]?key|authorization)=)[^&\s]+/gi, "$1[REDACTED]").replace(/\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\b/g, "[REDACTED]");
|
|
113
113
|
}
|
|
114
114
|
function P(e, t = 220) {
|
|
115
|
-
const o =
|
|
115
|
+
const o = _s(e).replace(/\s+/g, " ").trim();
|
|
116
116
|
return o.length <= t ? o : `${o.slice(0, t - 3)}...`;
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function Ye(e) {
|
|
119
119
|
const t = e.trim();
|
|
120
120
|
return /\bHTTP\s*\d{3}\b/i.test(t) || /\bstatus code \d{3}\b/i.test(t) || /^bad request$/i.test(t) || /^unauthorized$/i.test(t) || /^forbidden$/i.test(t) || /^not found$/i.test(t);
|
|
121
121
|
}
|
|
@@ -153,7 +153,7 @@ function Y(e) {
|
|
|
153
153
|
}
|
|
154
154
|
return r.length > 0 ? P(r.join("; ")) : void 0;
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function Rs(e) {
|
|
157
157
|
if (!e)
|
|
158
158
|
return [];
|
|
159
159
|
const t = /* @__PURE__ */ new Set(), o = (i) => {
|
|
@@ -216,7 +216,7 @@ function Os(e) {
|
|
|
216
216
|
}
|
|
217
217
|
return Array.from(t).slice(0, 3);
|
|
218
218
|
}
|
|
219
|
-
const
|
|
219
|
+
const Ns = [
|
|
220
220
|
"error",
|
|
221
221
|
"error_code",
|
|
222
222
|
"error_tag",
|
|
@@ -227,13 +227,39 @@ const Us = [
|
|
|
227
227
|
"httpCode",
|
|
228
228
|
"errorExtra"
|
|
229
229
|
];
|
|
230
|
-
function
|
|
231
|
-
return e ?
|
|
230
|
+
function Ls(e) {
|
|
231
|
+
return e ? Ns.some((t) => e[t] !== void 0) : !1;
|
|
232
232
|
}
|
|
233
|
-
|
|
234
|
-
|
|
233
|
+
const qe = {
|
|
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
|
+
};
|
|
236
|
+
function Ms(...e) {
|
|
237
|
+
for (const t of e) {
|
|
238
|
+
if (!t)
|
|
239
|
+
continue;
|
|
240
|
+
const o = t.toUpperCase(), r = Object.keys(qe).find(
|
|
241
|
+
(n) => o.includes(n)
|
|
242
|
+
);
|
|
243
|
+
if (r)
|
|
244
|
+
return qe[r];
|
|
245
|
+
}
|
|
235
246
|
}
|
|
236
|
-
function
|
|
247
|
+
function Fs(e) {
|
|
248
|
+
if (e.tag) {
|
|
249
|
+
const t = qe[e.tag.toUpperCase()];
|
|
250
|
+
if (t)
|
|
251
|
+
return t;
|
|
252
|
+
}
|
|
253
|
+
return Ms(...e.rawText ?? [], e.message, e.details);
|
|
254
|
+
}
|
|
255
|
+
function Hs(e) {
|
|
256
|
+
const t = Fs(e);
|
|
257
|
+
if (t)
|
|
258
|
+
return t;
|
|
259
|
+
const { statusCode: o } = e, r = e.fieldHints.length > 0;
|
|
260
|
+
return o === 401 || o === 403 ? "Verify your API token and access permissions, then retry." : 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.";
|
|
261
|
+
}
|
|
262
|
+
function Nt(e) {
|
|
237
263
|
const t = z(e) ? e : void 0, o = e instanceof Error && z(e.cause) ? e.cause : void 0, r = Be(t?.response, o?.response), n = Be(
|
|
238
264
|
t?.responseData,
|
|
239
265
|
r?.data,
|
|
@@ -274,84 +300,94 @@ function Rs(e) {
|
|
|
274
300
|
T(t?.message),
|
|
275
301
|
T(o?.message),
|
|
276
302
|
e instanceof Error ? e.message : T(e)
|
|
277
|
-
].filter((h) => !!h), l = d.find((h) => !
|
|
303
|
+
].filter((h) => !!h), l = d.find((h) => !Ye(h)) || d[0], p = N(
|
|
278
304
|
Y(n?.errorExtra),
|
|
279
305
|
Y(n?.error_extra),
|
|
280
306
|
Y(n?.details),
|
|
281
307
|
Y(n?.errorDetails),
|
|
282
308
|
Y(n?.errors),
|
|
283
309
|
Y(t?.details)
|
|
284
|
-
), u =
|
|
285
|
-
return a !== void 0 ||
|
|
310
|
+
), u = Rs(n);
|
|
311
|
+
return a !== void 0 || Ls(n) || c !== void 0 || i !== void 0 || (l ? Ye(l) : !1) ? {
|
|
286
312
|
statusCode: a,
|
|
287
313
|
code: i,
|
|
288
314
|
tag: c ? P(c, 80) : void 0,
|
|
289
315
|
message: l ? P(l) : void 0,
|
|
290
316
|
details: p ? P(p) : void 0,
|
|
317
|
+
rawText: d,
|
|
291
318
|
fieldHints: u
|
|
292
319
|
} : null;
|
|
293
320
|
}
|
|
294
|
-
function
|
|
321
|
+
function Lt(e) {
|
|
295
322
|
const t = [];
|
|
296
|
-
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}`);
|
|
297
|
-
|
|
323
|
+
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;
|
|
324
|
+
}
|
|
325
|
+
function Ws(e) {
|
|
326
|
+
const t = Lt(e), o = [
|
|
298
327
|
t.length > 0 ? `Todoist API request failed (${t.join(", ")}).` : "Todoist API request failed."
|
|
299
328
|
];
|
|
300
|
-
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: ${
|
|
329
|
+
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: ${Hs(e)}`), o.join(`
|
|
301
330
|
`);
|
|
302
331
|
}
|
|
303
|
-
function
|
|
332
|
+
function Mt(e) {
|
|
304
333
|
return e instanceof Error ? P(e.message) : typeof e == "string" ? P(e) : "An unknown error occurred";
|
|
305
334
|
}
|
|
306
|
-
function
|
|
307
|
-
|
|
335
|
+
function Gs(e) {
|
|
336
|
+
const t = Nt(e);
|
|
337
|
+
if (!t)
|
|
338
|
+
return Mt(e);
|
|
339
|
+
const o = Lt(t), r = t.message && !(o.length > 0 && Ye(t.message)) ? t.message : "Todoist API request failed";
|
|
340
|
+
return o.length > 0 ? `${r} (${o.join(", ")})` : r;
|
|
341
|
+
}
|
|
342
|
+
function Bs(e) {
|
|
343
|
+
if (e instanceof ks)
|
|
308
344
|
return e.message;
|
|
309
|
-
const t =
|
|
310
|
-
return t ?
|
|
345
|
+
const t = Nt(e);
|
|
346
|
+
return t ? Ws(t) : Mt(e);
|
|
311
347
|
}
|
|
312
|
-
const
|
|
313
|
-
version:
|
|
314
|
-
},
|
|
348
|
+
const Ys = "10.4.2", qs = {
|
|
349
|
+
version: Ys
|
|
350
|
+
}, zs = "todoist-mcp", Ze = qs.version, Ft = new Ts(), mt = ws(import.meta.url);
|
|
315
351
|
let ye;
|
|
316
|
-
const
|
|
317
|
-
const e =
|
|
318
|
-
return
|
|
352
|
+
const Ks = async () => {
|
|
353
|
+
const e = mt.resolve("@doist/todoist-sdk"), t = Le(Et(e), "transport", "http-dispatcher.js");
|
|
354
|
+
return mt(t);
|
|
319
355
|
};
|
|
320
|
-
let
|
|
321
|
-
function
|
|
322
|
-
return `${
|
|
356
|
+
let Vs = Ks;
|
|
357
|
+
function Js() {
|
|
358
|
+
return `${zs}/${Ze}`;
|
|
323
359
|
}
|
|
324
|
-
function
|
|
360
|
+
function Ht(e) {
|
|
325
361
|
return e.trim().toLowerCase();
|
|
326
362
|
}
|
|
327
|
-
function
|
|
328
|
-
return
|
|
363
|
+
function Xs(e, t) {
|
|
364
|
+
return Ft.run(Ht(e), t);
|
|
329
365
|
}
|
|
330
|
-
function
|
|
366
|
+
function Zs({
|
|
331
367
|
label: e,
|
|
332
368
|
platform: t = "mcp",
|
|
333
369
|
sessionId: o = Ne()
|
|
334
370
|
} = {}) {
|
|
335
|
-
const r = e ?
|
|
371
|
+
const r = e ? Ht(e) : Ft.getStore();
|
|
336
372
|
return {
|
|
337
|
-
"User-Agent":
|
|
373
|
+
"User-Agent": Js(),
|
|
338
374
|
"doist-platform": t,
|
|
339
|
-
"doist-version":
|
|
375
|
+
"doist-version": Ze,
|
|
340
376
|
"request-id": Ne(),
|
|
341
377
|
"session-id": o,
|
|
342
378
|
"mcp-tool": r ?? "unknown"
|
|
343
379
|
};
|
|
344
380
|
}
|
|
345
|
-
function
|
|
381
|
+
function Qs(e, t) {
|
|
346
382
|
const o = new Headers(e);
|
|
347
|
-
for (const [r, n] of Object.entries(
|
|
383
|
+
for (const [r, n] of Object.entries(Zs(t)))
|
|
348
384
|
o.set(r, n);
|
|
349
385
|
return Object.fromEntries(o.entries());
|
|
350
386
|
}
|
|
351
|
-
function
|
|
387
|
+
function ht() {
|
|
352
388
|
return new DOMException("The operation was aborted due to timeout", "TimeoutError");
|
|
353
389
|
}
|
|
354
|
-
function
|
|
390
|
+
function eo(e, t) {
|
|
355
391
|
if (!e && t === void 0)
|
|
356
392
|
return {
|
|
357
393
|
signal: void 0,
|
|
@@ -359,7 +395,7 @@ function Vs(e, t) {
|
|
|
359
395
|
}
|
|
360
396
|
};
|
|
361
397
|
if (!e && t !== void 0) {
|
|
362
|
-
const i = new AbortController(), c = setTimeout(() => i.abort(
|
|
398
|
+
const i = new AbortController(), c = setTimeout(() => i.abort(ht()), t);
|
|
363
399
|
return {
|
|
364
400
|
signal: i.signal,
|
|
365
401
|
cleanup: () => clearTimeout(c)
|
|
@@ -380,7 +416,7 @@ function Vs(e, t) {
|
|
|
380
416
|
const i = () => n(e.reason);
|
|
381
417
|
e.addEventListener("abort", i, { once: !0 }), r.push(() => e.removeEventListener("abort", i));
|
|
382
418
|
}
|
|
383
|
-
const a = setTimeout(() => n(
|
|
419
|
+
const a = setTimeout(() => n(ht()), t);
|
|
384
420
|
return r.push(() => clearTimeout(a)), {
|
|
385
421
|
signal: o.signal,
|
|
386
422
|
cleanup: () => {
|
|
@@ -389,20 +425,20 @@ function Vs(e, t) {
|
|
|
389
425
|
}
|
|
390
426
|
};
|
|
391
427
|
}
|
|
392
|
-
async function
|
|
393
|
-
if (
|
|
394
|
-
return ye || (ye =
|
|
428
|
+
async function to() {
|
|
429
|
+
if (so())
|
|
430
|
+
return ye || (ye = Vs().then((e) => e.getDefaultDispatcher()).catch((e) => {
|
|
395
431
|
throw ye = void 0, e;
|
|
396
432
|
})), ye;
|
|
397
433
|
}
|
|
398
|
-
function
|
|
434
|
+
function so() {
|
|
399
435
|
return typeof process < "u" && !!process.versions?.node;
|
|
400
436
|
}
|
|
401
|
-
async function
|
|
402
|
-
const t = await
|
|
437
|
+
async function oo(e) {
|
|
438
|
+
const t = await to();
|
|
403
439
|
t !== void 0 && (e.dispatcher = t);
|
|
404
440
|
}
|
|
405
|
-
function
|
|
441
|
+
function ro(e) {
|
|
406
442
|
return {
|
|
407
443
|
ok: e.ok,
|
|
408
444
|
status: e.status,
|
|
@@ -413,35 +449,35 @@ function Qs(e) {
|
|
|
413
449
|
arrayBuffer: () => e.arrayBuffer()
|
|
414
450
|
};
|
|
415
451
|
}
|
|
416
|
-
function
|
|
452
|
+
function no(e = globalThis.fetch, t = {}) {
|
|
417
453
|
const o = e === globalThis.fetch, { enabled: r = !0, platform: n = "mcp", sessionId: a = Ne() } = t;
|
|
418
454
|
return async (i, c = {}) => {
|
|
419
|
-
const { timeout: d, headers: l, signal: p, ...u } = c, { signal: m, cleanup: h } =
|
|
455
|
+
const { timeout: d, headers: l, signal: p, ...u } = c, { signal: m, cleanup: h } = eo(p, d);
|
|
420
456
|
try {
|
|
421
457
|
const k = {
|
|
422
458
|
...u,
|
|
423
459
|
signal: m,
|
|
424
|
-
...r ? { headers:
|
|
460
|
+
...r ? { headers: Qs(l, { platform: n, sessionId: a }) } : l !== void 0 ? { headers: l } : {}
|
|
425
461
|
};
|
|
426
|
-
o && await
|
|
462
|
+
o && await oo(k);
|
|
427
463
|
const b = await e(i, k);
|
|
428
|
-
return
|
|
464
|
+
return ro(b);
|
|
429
465
|
} finally {
|
|
430
466
|
h();
|
|
431
467
|
}
|
|
432
468
|
};
|
|
433
469
|
}
|
|
434
|
-
function
|
|
470
|
+
function ao(e, {
|
|
435
471
|
baseUrl: t,
|
|
436
472
|
tracking: o
|
|
437
473
|
} = {}) {
|
|
438
|
-
return new
|
|
439
|
-
customFetch:
|
|
474
|
+
return new vs(e, {
|
|
475
|
+
customFetch: no(globalThis.fetch, o),
|
|
440
476
|
...t ? { baseUrl: t } : {}
|
|
441
477
|
});
|
|
442
478
|
}
|
|
443
|
-
const
|
|
444
|
-
function
|
|
479
|
+
const io = 2, co = 500, lo = 2e3, uo = /* @__PURE__ */ new Set([502, 503, 504]);
|
|
480
|
+
function po(e) {
|
|
445
481
|
if (e == null || typeof e != "object")
|
|
446
482
|
return;
|
|
447
483
|
const t = e;
|
|
@@ -457,11 +493,11 @@ function ao(e) {
|
|
|
457
493
|
return Number(o[1]);
|
|
458
494
|
}
|
|
459
495
|
}
|
|
460
|
-
function
|
|
461
|
-
const t =
|
|
462
|
-
return t !== void 0 &&
|
|
496
|
+
function mo(e) {
|
|
497
|
+
const t = po(e);
|
|
498
|
+
return t !== void 0 && uo.has(t);
|
|
463
499
|
}
|
|
464
|
-
function
|
|
500
|
+
function ho({
|
|
465
501
|
attempt: e,
|
|
466
502
|
baseDelayMs: t,
|
|
467
503
|
maxDelayMs: o
|
|
@@ -469,35 +505,35 @@ function co({
|
|
|
469
505
|
const r = t * 2 ** e;
|
|
470
506
|
return Math.min(r, o);
|
|
471
507
|
}
|
|
472
|
-
function
|
|
508
|
+
function fo(e) {
|
|
473
509
|
return new Promise((t) => setTimeout(t, e));
|
|
474
510
|
}
|
|
475
|
-
async function
|
|
476
|
-
const o = t.maxRetries ??
|
|
511
|
+
async function bo(e, t = {}) {
|
|
512
|
+
const o = t.maxRetries ?? io, r = t.baseDelayMs ?? co, n = t.maxDelayMs ?? lo;
|
|
477
513
|
let a;
|
|
478
514
|
for (let i = 0; i <= o; i++)
|
|
479
515
|
try {
|
|
480
516
|
return await e();
|
|
481
517
|
} catch (c) {
|
|
482
|
-
if (a = c, i < o &&
|
|
483
|
-
const d =
|
|
484
|
-
await
|
|
518
|
+
if (a = c, i < o && mo(c)) {
|
|
519
|
+
const d = ho({ attempt: i, baseDelayMs: r, maxDelayMs: n });
|
|
520
|
+
await fo(d);
|
|
485
521
|
continue;
|
|
486
522
|
}
|
|
487
523
|
throw c;
|
|
488
524
|
}
|
|
489
525
|
throw a;
|
|
490
526
|
}
|
|
491
|
-
function
|
|
527
|
+
function ze(e) {
|
|
492
528
|
if (e == null)
|
|
493
529
|
return e;
|
|
494
530
|
if (Array.isArray(e))
|
|
495
|
-
return e.map((t) =>
|
|
531
|
+
return e.map((t) => ze(t));
|
|
496
532
|
if (typeof e == "object") {
|
|
497
533
|
const t = {};
|
|
498
534
|
for (const [o, r] of Object.entries(e))
|
|
499
535
|
if (r !== null) {
|
|
500
|
-
const n =
|
|
536
|
+
const n = ze(r);
|
|
501
537
|
if (n !== null && typeof n == "object" && !Array.isArray(n) && Object.keys(n).length === 0)
|
|
502
538
|
continue;
|
|
503
539
|
t[o] = n;
|
|
@@ -572,60 +608,60 @@ const f = {
|
|
|
572
608
|
// OpenAI MCP tools
|
|
573
609
|
SEARCH: "search",
|
|
574
610
|
FETCH: "fetch"
|
|
575
|
-
},
|
|
611
|
+
}, dd = {
|
|
576
612
|
/**
|
|
577
613
|
* Strips email addresses from tool outputs that expose user data.
|
|
578
614
|
* Affects: find-project-collaborators, find-completed-tasks
|
|
579
615
|
*/
|
|
580
616
|
STRIP_EMAILS: "strip_emails"
|
|
581
|
-
},
|
|
582
|
-
function
|
|
617
|
+
}, go = process.env.USE_STRUCTURED_CONTENT === "true" || process.env.NODE_ENV === "test";
|
|
618
|
+
function yo({
|
|
583
619
|
textContent: e,
|
|
584
620
|
structuredContent: t,
|
|
585
621
|
contentItems: o
|
|
586
622
|
}) {
|
|
587
|
-
const r =
|
|
588
|
-
return o && a.push(...o), !
|
|
623
|
+
const r = ze(t), n = {}, a = [];
|
|
624
|
+
return o && a.push(...o), !go && t && a.push({
|
|
589
625
|
type: "text",
|
|
590
626
|
text: JSON.stringify(r)
|
|
591
627
|
}), e && a.push({ type: "text", text: e }), a.length > 0 && (n.content = a), t && (n.structuredContent = r), n;
|
|
592
628
|
}
|
|
593
|
-
function
|
|
629
|
+
function ko(e) {
|
|
594
630
|
return {
|
|
595
631
|
content: [{ type: "text", text: e }],
|
|
596
632
|
isError: !0
|
|
597
633
|
};
|
|
598
634
|
}
|
|
599
|
-
function
|
|
635
|
+
function To(e) {
|
|
600
636
|
return { ...{
|
|
601
|
-
title: `Todoist: ${
|
|
637
|
+
title: `Todoist: ${wo(e.name)}`,
|
|
602
638
|
openWorldHint: !1
|
|
603
639
|
}, ...e.annotations };
|
|
604
640
|
}
|
|
605
|
-
function
|
|
641
|
+
function wo(e) {
|
|
606
642
|
return e.split("-").filter(Boolean).map((t) => `${t.charAt(0).toUpperCase()}${t.slice(1)}`).join(" ");
|
|
607
643
|
}
|
|
608
|
-
function
|
|
644
|
+
function vo(e) {
|
|
609
645
|
return e ? typeof e["ui/resourceUri"] == "string" ? !0 : typeof e.ui == "object" && e.ui !== null : !1;
|
|
610
646
|
}
|
|
611
|
-
const
|
|
647
|
+
const Io = [
|
|
612
648
|
f.FIND_PROJECT_COLLABORATORS,
|
|
613
649
|
f.FIND_COMPLETED_TASKS
|
|
614
650
|
];
|
|
615
|
-
function
|
|
651
|
+
function Ke(e) {
|
|
616
652
|
if (e == null)
|
|
617
653
|
return e;
|
|
618
654
|
if (Array.isArray(e))
|
|
619
|
-
return e.map((t) =>
|
|
655
|
+
return e.map((t) => Ke(t));
|
|
620
656
|
if (typeof e == "object") {
|
|
621
657
|
const t = {};
|
|
622
658
|
for (const [o, r] of Object.entries(e))
|
|
623
|
-
o !== "email" && (t[o] =
|
|
659
|
+
o !== "email" && (t[o] = Ke(r));
|
|
624
660
|
return t;
|
|
625
661
|
}
|
|
626
662
|
return e;
|
|
627
663
|
}
|
|
628
|
-
function
|
|
664
|
+
function jo(e) {
|
|
629
665
|
const t = /\s*\([^)]*@[^)]+\)/g, o = /\S+@\S+\.\S+/g;
|
|
630
666
|
return e.replace(t, "").replace(o, "[email hidden]");
|
|
631
667
|
}
|
|
@@ -635,27 +671,27 @@ function g({
|
|
|
635
671
|
client: o,
|
|
636
672
|
features: r = []
|
|
637
673
|
}) {
|
|
638
|
-
const n = r.some((c) => c.name === "strip_emails") &&
|
|
674
|
+
const n = r.some((c) => c.name === "strip_emails") && Io.includes(e.name), a = async (c, d) => {
|
|
639
675
|
try {
|
|
640
|
-
let { textContent: l, structuredContent: p, contentItems: u } = await
|
|
676
|
+
let { textContent: l, structuredContent: p, contentItems: u } = await Xs(
|
|
641
677
|
e.name,
|
|
642
|
-
() =>
|
|
678
|
+
() => bo(
|
|
643
679
|
() => e.execute(c, o)
|
|
644
680
|
)
|
|
645
681
|
);
|
|
646
|
-
return n && (l && (l =
|
|
682
|
+
return n && (l && (l = jo(l)), p && (p = Ke(p))), yo({ textContent: l, structuredContent: p, contentItems: u });
|
|
647
683
|
} catch (l) {
|
|
648
|
-
return console.error(`Error executing tool ${e.name}:`, { args: c, error: l }),
|
|
684
|
+
return console.error(`Error executing tool ${e.name}:`, { args: c, error: l }), ko(Bs(l));
|
|
649
685
|
}
|
|
650
686
|
}, i = {
|
|
651
687
|
description: e.description,
|
|
652
688
|
inputSchema: e.parameters,
|
|
653
689
|
...e.outputSchema ? { outputSchema: e.outputSchema } : {},
|
|
654
|
-
annotations:
|
|
690
|
+
annotations: To(e),
|
|
655
691
|
...e._meta ? { _meta: e._meta } : {}
|
|
656
692
|
};
|
|
657
|
-
if (
|
|
658
|
-
|
|
693
|
+
if (vo(e._meta)) {
|
|
694
|
+
ys(
|
|
659
695
|
t,
|
|
660
696
|
e.name,
|
|
661
697
|
{
|
|
@@ -668,7 +704,7 @@ function g({
|
|
|
668
704
|
}
|
|
669
705
|
t.registerTool(e.name, i, a);
|
|
670
706
|
}
|
|
671
|
-
const
|
|
707
|
+
const So = {
|
|
672
708
|
period: s.enum(["today", "7d", "14d", "30d", "this-week", "this-month"]).default("7d").describe(
|
|
673
709
|
'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.'
|
|
674
710
|
),
|
|
@@ -677,7 +713,7 @@ const To = {
|
|
|
677
713
|
),
|
|
678
714
|
projectId: s.string().optional().describe("Optional project ID to scope the analysis to a specific project.")
|
|
679
715
|
};
|
|
680
|
-
function
|
|
716
|
+
function Co(e, t = /* @__PURE__ */ new Date()) {
|
|
681
717
|
const o = (n) => n.toISOString().slice(0, 10), r = o(t);
|
|
682
718
|
switch (e) {
|
|
683
719
|
case "today":
|
|
@@ -724,7 +760,7 @@ function wo(e, t = /* @__PURE__ */ new Date()) {
|
|
|
724
760
|
}
|
|
725
761
|
}
|
|
726
762
|
}
|
|
727
|
-
function
|
|
763
|
+
function $o(e) {
|
|
728
764
|
const t = {
|
|
729
765
|
goals: `### Goal Tracking
|
|
730
766
|
- Compare tasks completed today vs the daily goal
|
|
@@ -755,8 +791,8 @@ function vo(e) {
|
|
|
755
791
|
|
|
756
792
|
`) : t[e] ?? "";
|
|
757
793
|
}
|
|
758
|
-
function
|
|
759
|
-
const { since: t, until: o, periodDescription: r } =
|
|
794
|
+
function Do(e) {
|
|
795
|
+
const { since: t, until: o, periodDescription: r } = Co(e.period), n = e.projectId ? `
|
|
760
796
|
Scope this analysis to project ID: ${e.projectId}. Pass this projectId when calling find-completed-tasks and get-overview.` : "";
|
|
761
797
|
return `Analyze my Todoist productivity for ${r} (${t} to ${o}).${n}
|
|
762
798
|
|
|
@@ -777,7 +813,7 @@ ${e.focus === "overall" || e.focus === "projects" ? `4. **get-overview** — Get
|
|
|
777
813
|
|
|
778
814
|
Using the collected data, produce an analysis covering the following sections:
|
|
779
815
|
|
|
780
|
-
${
|
|
816
|
+
${$o(e.focus)}
|
|
781
817
|
|
|
782
818
|
### Step 3: Format
|
|
783
819
|
|
|
@@ -787,14 +823,14 @@ Present the analysis as a clear, well-structured markdown report with:
|
|
|
787
823
|
- Specific numbers and comparisons (not vague statements)
|
|
788
824
|
- Actionable takeaways highlighted clearly`;
|
|
789
825
|
}
|
|
790
|
-
function
|
|
826
|
+
function Ao(e) {
|
|
791
827
|
return {
|
|
792
828
|
messages: [
|
|
793
829
|
{
|
|
794
830
|
role: "user",
|
|
795
831
|
content: {
|
|
796
832
|
type: "text",
|
|
797
|
-
text:
|
|
833
|
+
text: Do(e)
|
|
798
834
|
}
|
|
799
835
|
}
|
|
800
836
|
]
|
|
@@ -804,8 +840,8 @@ const me = {
|
|
|
804
840
|
name: "productivity-analysis",
|
|
805
841
|
title: "Productivity Analysis",
|
|
806
842
|
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.",
|
|
807
|
-
argsSchema:
|
|
808
|
-
callback:
|
|
843
|
+
argsSchema: So,
|
|
844
|
+
callback: Ao
|
|
809
845
|
}, j = {
|
|
810
846
|
/** Default limit for task listings */
|
|
811
847
|
TASKS_DEFAULT: 10,
|
|
@@ -848,7 +884,7 @@ class U extends Error {
|
|
|
848
884
|
super(`Invalid duration format "${t}": ${o}`), this.name = "DurationParseError";
|
|
849
885
|
}
|
|
850
886
|
}
|
|
851
|
-
function
|
|
887
|
+
function Wt(e) {
|
|
852
888
|
if (!e || typeof e != "string")
|
|
853
889
|
throw new U(e, "Duration must be a non-empty string");
|
|
854
890
|
const t = e.trim().toLowerCase().replace(/\s+/g, "");
|
|
@@ -882,20 +918,20 @@ function Lt(e) {
|
|
|
882
918
|
throw new U(e, "Duration cannot exceed 24 hours (1440 minutes)");
|
|
883
919
|
return { minutes: r };
|
|
884
920
|
}
|
|
885
|
-
function
|
|
921
|
+
function xo(e) {
|
|
886
922
|
if (e <= 0) return "0m";
|
|
887
923
|
const t = Math.floor(e / 60), o = e % 60;
|
|
888
924
|
return t === 0 ? `${o}m` : o === 0 ? `${t}h` : `${t}h${o}m`;
|
|
889
925
|
}
|
|
890
|
-
const
|
|
891
|
-
function
|
|
926
|
+
const Eo = ["p1", "p2", "p3", "p4"], Qe = '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.', et = s.enum(Eo).describe(Qe);
|
|
927
|
+
function Gt(e) {
|
|
892
928
|
return { p1: 4, p2: 3, p3: 2, p4: 1 }[e];
|
|
893
929
|
}
|
|
894
|
-
function
|
|
930
|
+
function Oo(e) {
|
|
895
931
|
return { 4: "p1", 3: "p2", 2: "p3", 1: "p4" }[e];
|
|
896
932
|
}
|
|
897
|
-
const E = /* @__PURE__ */ new Map(), te = /* @__PURE__ */ new Map(), Ue = 300 * 1e3,
|
|
898
|
-
class
|
|
933
|
+
const E = /* @__PURE__ */ new Map(), te = /* @__PURE__ */ new Map(), Ue = 300 * 1e3, Uo = "me";
|
|
934
|
+
class Po {
|
|
899
935
|
/**
|
|
900
936
|
* Resolve a user name or ID to a user ID by looking up collaborators across all shared projects.
|
|
901
937
|
* Supports exact name matches, partial matches, email matches, and the "me" keyword.
|
|
@@ -906,7 +942,7 @@ class Ao {
|
|
|
906
942
|
const r = o.trim(), n = E.get(r);
|
|
907
943
|
if (n && Date.now() - n.timestamp < Ue)
|
|
908
944
|
return n.result;
|
|
909
|
-
if (r.toLowerCase() ===
|
|
945
|
+
if (r.toLowerCase() === Uo)
|
|
910
946
|
try {
|
|
911
947
|
const a = await t.getUser();
|
|
912
948
|
return {
|
|
@@ -1030,15 +1066,15 @@ class Ao {
|
|
|
1030
1066
|
E.clear(), te.clear();
|
|
1031
1067
|
}
|
|
1032
1068
|
}
|
|
1033
|
-
const G = new
|
|
1034
|
-
async function
|
|
1069
|
+
const G = new Po();
|
|
1070
|
+
async function _o(e, t) {
|
|
1035
1071
|
return G.resolveUser(e, t);
|
|
1036
1072
|
}
|
|
1037
|
-
const
|
|
1038
|
-
async function
|
|
1073
|
+
const Bt = ["assigned", "unassignedOrMe", "all"];
|
|
1074
|
+
async function tt(e, t) {
|
|
1039
1075
|
if (!t)
|
|
1040
1076
|
return;
|
|
1041
|
-
const o = await
|
|
1077
|
+
const o = await _o(e, t);
|
|
1042
1078
|
if (!o)
|
|
1043
1079
|
throw new Error(
|
|
1044
1080
|
`Could not find user: "${t}". Make sure the user is a collaborator on a shared project.`
|
|
@@ -1048,14 +1084,14 @@ async function Qe(e, t) {
|
|
|
1048
1084
|
function ae(e, t) {
|
|
1049
1085
|
return t.length === 0 ? e : e.length === 0 ? t : `${e} & ${t}`;
|
|
1050
1086
|
}
|
|
1051
|
-
function
|
|
1087
|
+
function Yt({
|
|
1052
1088
|
resolvedAssigneeId: e,
|
|
1053
1089
|
assigneeEmail: t,
|
|
1054
1090
|
responsibleUserFiltering: o = "unassignedOrMe"
|
|
1055
1091
|
}) {
|
|
1056
1092
|
return e && t ? `assigned to: ${t}` : o === "unassignedOrMe" ? "!assigned to: others" : o === "assigned" ? "assigned to: others" : "";
|
|
1057
1093
|
}
|
|
1058
|
-
function
|
|
1094
|
+
function Ro({
|
|
1059
1095
|
tasks: e,
|
|
1060
1096
|
resolvedAssigneeId: t,
|
|
1061
1097
|
currentUserId: o,
|
|
@@ -1088,31 +1124,31 @@ async function L(e) {
|
|
|
1088
1124
|
} while (a !== null);
|
|
1089
1125
|
return n;
|
|
1090
1126
|
}
|
|
1091
|
-
function
|
|
1127
|
+
function st(e) {
|
|
1092
1128
|
return /(?<!\\)(?:\\\\)*\*/.test(e) ? e : `*${e.replaceAll(/\\(?!\*)/g, "\\\\")}*`;
|
|
1093
1129
|
}
|
|
1094
|
-
async function
|
|
1130
|
+
async function qt(e, t) {
|
|
1095
1131
|
return L({
|
|
1096
1132
|
apiMethod: e.searchProjects.bind(e),
|
|
1097
|
-
args: { query:
|
|
1133
|
+
args: { query: st(t) },
|
|
1098
1134
|
limit: j.PROJECTS_MAX
|
|
1099
1135
|
});
|
|
1100
1136
|
}
|
|
1101
|
-
async function
|
|
1137
|
+
async function No(e) {
|
|
1102
1138
|
return L({
|
|
1103
1139
|
apiMethod: e.getProjects.bind(e),
|
|
1104
1140
|
args: {},
|
|
1105
1141
|
limit: j.PROJECTS_MAX
|
|
1106
1142
|
});
|
|
1107
1143
|
}
|
|
1108
|
-
async function
|
|
1144
|
+
async function Lo(e) {
|
|
1109
1145
|
return L({
|
|
1110
1146
|
apiMethod: e.getArchivedProjects.bind(e),
|
|
1111
1147
|
args: {},
|
|
1112
1148
|
limit: j.PROJECTS_MAX
|
|
1113
1149
|
});
|
|
1114
1150
|
}
|
|
1115
|
-
function
|
|
1151
|
+
function Mo(e) {
|
|
1116
1152
|
const t = (a) => a.replaceAll(/[.*+?^${}()|[\]\\]/g, "\\$&"), o = /(?<!\\)(?:\\\\)*\*/.test(e), r = [...e];
|
|
1117
1153
|
let n = "";
|
|
1118
1154
|
for (let a = 0; a < r.length; a++) {
|
|
@@ -1121,29 +1157,29 @@ function Po(e) {
|
|
|
1121
1157
|
}
|
|
1122
1158
|
return new RegExp(o ? `^${n}$` : n, "iu");
|
|
1123
1159
|
}
|
|
1124
|
-
async function
|
|
1160
|
+
async function Fo(e, t) {
|
|
1125
1161
|
return L({
|
|
1126
1162
|
apiMethod: e.searchLabels.bind(e),
|
|
1127
|
-
args: { query:
|
|
1163
|
+
args: { query: st(t) },
|
|
1128
1164
|
limit: j.LABELS_MAX
|
|
1129
1165
|
});
|
|
1130
1166
|
}
|
|
1131
|
-
async function
|
|
1167
|
+
async function Ho(e) {
|
|
1132
1168
|
return L({
|
|
1133
1169
|
apiMethod: e.getSharedLabels.bind(e),
|
|
1134
1170
|
args: {},
|
|
1135
1171
|
limit: j.LABELS_MAX
|
|
1136
1172
|
});
|
|
1137
1173
|
}
|
|
1138
|
-
async function
|
|
1139
|
-
const r =
|
|
1174
|
+
async function Wo(e, t, o) {
|
|
1175
|
+
const r = st(t);
|
|
1140
1176
|
return L({
|
|
1141
1177
|
apiMethod: e.searchSections.bind(e),
|
|
1142
1178
|
args: o ? { query: r, projectId: o } : { query: r },
|
|
1143
1179
|
limit: j.SECTIONS_MAX
|
|
1144
1180
|
});
|
|
1145
1181
|
}
|
|
1146
|
-
function
|
|
1182
|
+
function Go(e, t, o, r) {
|
|
1147
1183
|
const n = [t, o, r].filter(Boolean);
|
|
1148
1184
|
if (n.length > 1)
|
|
1149
1185
|
throw new Error(
|
|
@@ -1166,12 +1202,12 @@ function _(e) {
|
|
|
1166
1202
|
dueDate: e.due?.date,
|
|
1167
1203
|
recurring: e.due?.isRecurring && e.due.string ? e.due.string : !1,
|
|
1168
1204
|
deadlineDate: e.deadline?.date,
|
|
1169
|
-
priority:
|
|
1205
|
+
priority: Oo(e.priority) ?? "p4",
|
|
1170
1206
|
projectId: e.projectId,
|
|
1171
1207
|
sectionId: e.sectionId ?? void 0,
|
|
1172
1208
|
parentId: e.parentId ?? void 0,
|
|
1173
1209
|
labels: e.labels,
|
|
1174
|
-
duration: e.duration ?
|
|
1210
|
+
duration: e.duration ? xo(e.duration.amount) : void 0,
|
|
1175
1211
|
responsibleUid: e.responsibleUid ?? void 0,
|
|
1176
1212
|
assignedByUid: e.assignedByUid ?? void 0,
|
|
1177
1213
|
checked: e.checked,
|
|
@@ -1232,7 +1268,7 @@ function ve(e) {
|
|
|
1232
1268
|
progress: e.progress
|
|
1233
1269
|
};
|
|
1234
1270
|
}
|
|
1235
|
-
function
|
|
1271
|
+
function Bo(e) {
|
|
1236
1272
|
return {
|
|
1237
1273
|
id: e.id ?? void 0,
|
|
1238
1274
|
objectType: e.objectType,
|
|
@@ -1245,7 +1281,7 @@ function Mo(e) {
|
|
|
1245
1281
|
extraData: e.extraData ?? void 0
|
|
1246
1282
|
};
|
|
1247
1283
|
}
|
|
1248
|
-
const
|
|
1284
|
+
const Yo = Q.object({
|
|
1249
1285
|
httpStatusCode: Q.number(),
|
|
1250
1286
|
responseData: Q.object({
|
|
1251
1287
|
error: Q.string(),
|
|
@@ -1253,7 +1289,7 @@ const Fo = Q.object({
|
|
|
1253
1289
|
errorTag: Q.string()
|
|
1254
1290
|
})
|
|
1255
1291
|
});
|
|
1256
|
-
async function
|
|
1292
|
+
async function ot({
|
|
1257
1293
|
client: e,
|
|
1258
1294
|
query: t,
|
|
1259
1295
|
limit: o,
|
|
@@ -1263,7 +1299,7 @@ async function tt({
|
|
|
1263
1299
|
const { results: n, nextCursor: a } = await e.getTasksByFilter({ query: t, cursor: r, limit: o });
|
|
1264
1300
|
return { tasks: n.map(_), nextCursor: a };
|
|
1265
1301
|
} catch (n) {
|
|
1266
|
-
const a =
|
|
1302
|
+
const a = Yo.safeParse(n);
|
|
1267
1303
|
if (!a.success)
|
|
1268
1304
|
throw n;
|
|
1269
1305
|
const { responseData: i } = a.data;
|
|
@@ -1272,7 +1308,7 @@ async function tt({
|
|
|
1272
1308
|
);
|
|
1273
1309
|
}
|
|
1274
1310
|
}
|
|
1275
|
-
function
|
|
1311
|
+
function ft(e) {
|
|
1276
1312
|
return {
|
|
1277
1313
|
isRecurring: e.isRecurring,
|
|
1278
1314
|
string: e.string,
|
|
@@ -1292,13 +1328,13 @@ function he(e) {
|
|
|
1292
1328
|
return {
|
|
1293
1329
|
...t,
|
|
1294
1330
|
minuteOffset: e.minuteOffset,
|
|
1295
|
-
due: e.due ?
|
|
1331
|
+
due: e.due ? ft(e.due) : void 0,
|
|
1296
1332
|
isUrgent: e.isUrgent
|
|
1297
1333
|
};
|
|
1298
1334
|
case "absolute":
|
|
1299
1335
|
return {
|
|
1300
1336
|
...t,
|
|
1301
|
-
due:
|
|
1337
|
+
due: ft(e.due),
|
|
1302
1338
|
isUrgent: e.isUrgent
|
|
1303
1339
|
};
|
|
1304
1340
|
case "location":
|
|
@@ -1312,19 +1348,19 @@ function he(e) {
|
|
|
1312
1348
|
};
|
|
1313
1349
|
}
|
|
1314
1350
|
}
|
|
1315
|
-
function
|
|
1351
|
+
function zt(e) {
|
|
1316
1352
|
const t = e.filter(
|
|
1317
1353
|
(r) => r.type === "relative" || r.type === "absolute"
|
|
1318
1354
|
).length, o = e.filter((r) => r.type === "location").length;
|
|
1319
1355
|
return { timeBasedCount: t, locationCount: o };
|
|
1320
1356
|
}
|
|
1321
1357
|
const Ie = Me.map((e) => e.key);
|
|
1322
|
-
function
|
|
1358
|
+
function qo(e) {
|
|
1323
1359
|
if (typeof e != "string") return;
|
|
1324
1360
|
const t = e.toLowerCase();
|
|
1325
1361
|
return (Me.find((r) => r.key === t) ?? Me.find((r) => r.displayName.toLowerCase() === t))?.key;
|
|
1326
1362
|
}
|
|
1327
|
-
const
|
|
1363
|
+
const zo = `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.`, de = s.preprocess(qo, s.enum(Ie).optional()).describe(zo);
|
|
1328
1364
|
s.enum(Ie).describe("The color key of the entity.");
|
|
1329
1365
|
const le = s.enum(Ie).optional().catch(void 0).describe("The color key of the entity."), J = s.object({
|
|
1330
1366
|
id: s.string().describe("The unique ID of the task."),
|
|
@@ -1333,7 +1369,7 @@ const le = s.enum(Ie).optional().catch(void 0).describe("The color key of the en
|
|
|
1333
1369
|
dueDate: s.string().optional().describe("The due date of the task (ISO 8601 format)."),
|
|
1334
1370
|
recurring: s.union([s.boolean(), s.string()]).describe("Whether the task is recurring, or the recurrence string."),
|
|
1335
1371
|
deadlineDate: s.string().optional().describe("The deadline date of the task (ISO 8601 format)."),
|
|
1336
|
-
priority:
|
|
1372
|
+
priority: et.describe(
|
|
1337
1373
|
"The priority level: p1 (highest), p2 (high), p3 (medium), p4 (lowest)."
|
|
1338
1374
|
),
|
|
1339
1375
|
projectId: s.string().describe("The ID of the project this task belongs to."),
|
|
@@ -1370,7 +1406,7 @@ const le = s.enum(Ie).optional().catch(void 0).describe("The color key of the en
|
|
|
1370
1406
|
function X({ id: e, name: t, description: o }) {
|
|
1371
1407
|
return { id: e, name: t, description: o ?? void 0 };
|
|
1372
1408
|
}
|
|
1373
|
-
const
|
|
1409
|
+
const Ko = s.object({
|
|
1374
1410
|
resourceType: s.string().describe("The type of resource (file, url, image, etc)."),
|
|
1375
1411
|
fileName: s.string().optional().describe("The name of the file."),
|
|
1376
1412
|
fileSize: s.number().optional().describe("The size of the file in bytes."),
|
|
@@ -1390,8 +1426,8 @@ const Go = s.object({
|
|
|
1390
1426
|
content: s.string().describe("The content of the comment."),
|
|
1391
1427
|
postedAt: s.string().describe("When the comment was posted (ISO 8601 format)."),
|
|
1392
1428
|
postedUid: s.string().optional().describe("The UID of the user who posted this comment."),
|
|
1393
|
-
fileAttachment:
|
|
1394
|
-
}),
|
|
1429
|
+
fileAttachment: Ko.optional().describe("File attachment information, if any.")
|
|
1430
|
+
}), Vo = s.object({
|
|
1395
1431
|
id: s.string().optional().describe("The unique ID of the activity event."),
|
|
1396
1432
|
objectType: s.string().describe("The type of object this event relates to (task, project, etc)."),
|
|
1397
1433
|
objectId: s.string().describe("The ID of the object this event relates to."),
|
|
@@ -1401,7 +1437,7 @@ const Go = s.object({
|
|
|
1401
1437
|
parentItemId: s.string().optional().describe("The ID of the parent item."),
|
|
1402
1438
|
initiatorId: s.string().optional().describe("The ID of the user who initiated this event."),
|
|
1403
1439
|
extraData: s.record(s.string(), s.unknown()).optional().describe("Additional event data.")
|
|
1404
|
-
}),
|
|
1440
|
+
}), Jo = s.object({
|
|
1405
1441
|
id: s.string().describe("The unique ID of the user."),
|
|
1406
1442
|
name: s.string().describe("The full name of the user."),
|
|
1407
1443
|
email: s.string().describe("The email address of the user.")
|
|
@@ -1411,24 +1447,24 @@ const Go = s.object({
|
|
|
1411
1447
|
color: le,
|
|
1412
1448
|
order: s.number().optional().catch(void 0).describe("The display order of the label."),
|
|
1413
1449
|
isFavorite: s.boolean().describe("Whether the label is marked as favorite.")
|
|
1414
|
-
}),
|
|
1450
|
+
}), Xo = s.object({
|
|
1415
1451
|
isRecurring: s.boolean().describe("Whether this is a recurring reminder."),
|
|
1416
1452
|
string: s.string().describe("Human-readable due string."),
|
|
1417
1453
|
date: s.string().describe("Due date in ISO format."),
|
|
1418
1454
|
datetime: s.string().optional().describe("Due datetime in ISO format."),
|
|
1419
1455
|
timezone: s.string().optional().describe("Timezone of the reminder.")
|
|
1420
|
-
}),
|
|
1456
|
+
}), rt = s.object({
|
|
1421
1457
|
id: s.string().describe("The unique ID of the reminder."),
|
|
1422
1458
|
taskId: s.string().describe("The task ID this reminder belongs to."),
|
|
1423
|
-
type: s.enum(
|
|
1459
|
+
type: s.enum(Is).describe("The type of reminder: relative, absolute, or location."),
|
|
1424
1460
|
minuteOffset: s.number().optional().describe("Minutes before due time to trigger (relative reminders only)."),
|
|
1425
|
-
due:
|
|
1461
|
+
due: Xo.optional().describe(
|
|
1426
1462
|
"Due date info (absolute and sometimes relative reminders)."
|
|
1427
1463
|
),
|
|
1428
1464
|
name: s.string().optional().describe("Location name (location reminders only)."),
|
|
1429
1465
|
locLat: s.string().optional().describe("Latitude (location reminders only)."),
|
|
1430
1466
|
locLong: s.string().optional().describe("Longitude (location reminders only)."),
|
|
1431
|
-
locTrigger: s.enum(
|
|
1467
|
+
locTrigger: s.enum(Ut).optional().describe("Trigger type: on_enter or on_leave (location reminders only)."),
|
|
1432
1468
|
radius: s.number().optional().describe("Geofence radius in meters (location reminders only)."),
|
|
1433
1469
|
isUrgent: s.boolean().optional().describe("Whether this is an urgent reminder (relative and absolute reminders only).")
|
|
1434
1470
|
}), Se = s.object({
|
|
@@ -1449,23 +1485,23 @@ const Go = s.object({
|
|
|
1449
1485
|
item: s.string().describe("The item that failed (usually an ID or identifier)."),
|
|
1450
1486
|
error: s.string().describe("The error message."),
|
|
1451
1487
|
code: s.string().optional().describe("The error code, if available.")
|
|
1452
|
-
}),
|
|
1488
|
+
}), Zo = s.object({
|
|
1453
1489
|
taskId: s.string().optional().describe("The ID of the task to comment on."),
|
|
1454
1490
|
projectId: s.string().optional().describe(
|
|
1455
1491
|
'The ID of the project to comment on. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
1456
1492
|
),
|
|
1457
1493
|
content: s.string().min(1).describe("The content of the comment.")
|
|
1458
|
-
}),
|
|
1459
|
-
comments: s.array(
|
|
1460
|
-
},
|
|
1494
|
+
}), Qo = {
|
|
1495
|
+
comments: s.array(Zo).min(1).describe("The array of comments to add.")
|
|
1496
|
+
}, er = {
|
|
1461
1497
|
comments: s.array(je).describe("The created comments."),
|
|
1462
1498
|
totalCount: s.number().describe("The total number of comments created."),
|
|
1463
1499
|
addedCommentIds: s.array(s.string()).describe("The IDs of the added comments.")
|
|
1464
|
-
},
|
|
1500
|
+
}, tr = {
|
|
1465
1501
|
name: f.ADD_COMMENTS,
|
|
1466
1502
|
description: "Add multiple comments to tasks or projects. Each comment must specify either taskId or projectId.",
|
|
1467
|
-
parameters:
|
|
1468
|
-
outputSchema:
|
|
1503
|
+
parameters: Qo,
|
|
1504
|
+
outputSchema: er,
|
|
1469
1505
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1470
1506
|
async execute(e, t) {
|
|
1471
1507
|
const { comments: o } = e;
|
|
@@ -1491,7 +1527,7 @@ const Go = s.object({
|
|
|
1491
1527
|
});
|
|
1492
1528
|
}), c = (await Promise.all(a)).map(we);
|
|
1493
1529
|
return {
|
|
1494
|
-
textContent:
|
|
1530
|
+
textContent: sr({ comments: c }),
|
|
1495
1531
|
structuredContent: {
|
|
1496
1532
|
comments: c,
|
|
1497
1533
|
totalCount: c.length,
|
|
@@ -1500,7 +1536,7 @@ const Go = s.object({
|
|
|
1500
1536
|
};
|
|
1501
1537
|
}
|
|
1502
1538
|
};
|
|
1503
|
-
function
|
|
1539
|
+
function sr({ comments: e }) {
|
|
1504
1540
|
const t = e.filter((a) => a.taskId).length, o = e.filter((a) => a.projectId).length, r = [];
|
|
1505
1541
|
if (t > 0) {
|
|
1506
1542
|
const a = t > 1 ? "comments" : "comment";
|
|
@@ -1512,25 +1548,25 @@ function Xo({ comments: e }) {
|
|
|
1512
1548
|
}
|
|
1513
1549
|
return r.length > 0 ? `Added ${r.join(" and ")}` : "No comments added";
|
|
1514
1550
|
}
|
|
1515
|
-
const
|
|
1551
|
+
const or = {
|
|
1516
1552
|
search: s.string().optional().describe(
|
|
1517
1553
|
"Search for a filter by name (partial and case insensitive match). If omitted, all filters are returned."
|
|
1518
1554
|
)
|
|
1519
|
-
},
|
|
1555
|
+
}, nt = s.object({
|
|
1520
1556
|
id: s.string().describe("The unique ID of the filter."),
|
|
1521
1557
|
name: s.string().describe("The name of the filter."),
|
|
1522
1558
|
query: s.string().describe('The filter query string (e.g. "today & p1", "#Work & overdue").'),
|
|
1523
1559
|
color: le,
|
|
1524
1560
|
isFavorite: s.boolean().describe("Whether the filter is marked as favorite."),
|
|
1525
1561
|
itemOrder: s.number().describe("The display order of the filter.")
|
|
1526
|
-
}),
|
|
1527
|
-
filters: s.array(
|
|
1562
|
+
}), rr = {
|
|
1563
|
+
filters: s.array(nt).describe("The found filters."),
|
|
1528
1564
|
totalCount: s.number().describe("The total number of filters returned.")
|
|
1529
|
-
},
|
|
1565
|
+
}, nr = {
|
|
1530
1566
|
name: f.FIND_FILTERS,
|
|
1531
1567
|
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").',
|
|
1532
|
-
parameters:
|
|
1533
|
-
outputSchema:
|
|
1568
|
+
parameters: or,
|
|
1569
|
+
outputSchema: rr,
|
|
1534
1570
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
1535
1571
|
async execute(e, t) {
|
|
1536
1572
|
let r = ((await t.sync({ resourceTypes: ["filters"], syncToken: "*" })).filters ?? []).filter((i) => !i.isDeleted);
|
|
@@ -1548,7 +1584,7 @@ const Zo = {
|
|
|
1548
1584
|
itemOrder: i.itemOrder
|
|
1549
1585
|
}));
|
|
1550
1586
|
return {
|
|
1551
|
-
textContent:
|
|
1587
|
+
textContent: ar({ filters: n, search: e.search }),
|
|
1552
1588
|
structuredContent: {
|
|
1553
1589
|
filters: n,
|
|
1554
1590
|
totalCount: n.length
|
|
@@ -1556,7 +1592,7 @@ const Zo = {
|
|
|
1556
1592
|
};
|
|
1557
1593
|
}
|
|
1558
1594
|
};
|
|
1559
|
-
function
|
|
1595
|
+
function ar({
|
|
1560
1596
|
filters: e,
|
|
1561
1597
|
search: t
|
|
1562
1598
|
}) {
|
|
@@ -1577,23 +1613,23 @@ ${n.map((a) => `- ${a}`).join(`
|
|
|
1577
1613
|
return r.join(`
|
|
1578
1614
|
`);
|
|
1579
1615
|
}
|
|
1580
|
-
const
|
|
1616
|
+
const ir = s.object({
|
|
1581
1617
|
name: s.string().min(1).describe("The name of the filter."),
|
|
1582
1618
|
query: s.string().min(1).describe(
|
|
1583
1619
|
'The filter query string. Examples: "today & p1", "#Work & overdue", "@email & today", "(p1 | p2) & !assigned". Operators: | (OR), & (AND), ! (NOT), () grouping, , (multiple queries).'
|
|
1584
1620
|
),
|
|
1585
1621
|
color: de,
|
|
1586
1622
|
isFavorite: s.boolean().optional().describe("Whether to mark the filter as a favorite. Defaults to false.")
|
|
1587
|
-
}),
|
|
1588
|
-
filters: s.array(
|
|
1589
|
-
},
|
|
1590
|
-
filters: s.array(
|
|
1623
|
+
}), cr = {
|
|
1624
|
+
filters: s.array(ir).min(1).describe("The array of filters to add.")
|
|
1625
|
+
}, dr = {
|
|
1626
|
+
filters: s.array(nt).describe("The created filters."),
|
|
1591
1627
|
totalCount: s.number().describe("The total number of filters created.")
|
|
1592
|
-
},
|
|
1628
|
+
}, lr = {
|
|
1593
1629
|
name: f.ADD_FILTERS,
|
|
1594
1630
|
description: "Add one or more new personal filters. Filters are saved custom views using query syntax to organize tasks.",
|
|
1595
|
-
parameters:
|
|
1596
|
-
outputSchema:
|
|
1631
|
+
parameters: cr,
|
|
1632
|
+
outputSchema: dr,
|
|
1597
1633
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1598
1634
|
async execute({ filters: e }, t) {
|
|
1599
1635
|
const o = Date.now(), r = e.map((u, m) => `tempFilterAdd${m}${o}`), n = e.map((u, m) => q(
|
|
@@ -1628,7 +1664,7 @@ ${l}`,
|
|
|
1628
1664
|
}
|
|
1629
1665
|
};
|
|
1630
1666
|
}
|
|
1631
|
-
},
|
|
1667
|
+
}, bt = 25, ur = s.object({
|
|
1632
1668
|
name: s.string().min(1).describe("The name of the goal."),
|
|
1633
1669
|
workspaceId: s.string().optional().describe(
|
|
1634
1670
|
"Workspace ID. If provided, creates a workspace goal. If omitted, creates a personal goal."
|
|
@@ -1636,16 +1672,16 @@ ${l}`,
|
|
|
1636
1672
|
description: s.string().optional().describe("The description of the goal."),
|
|
1637
1673
|
deadline: s.string().optional().describe("The target date (YYYY-MM-DD)."),
|
|
1638
1674
|
responsibleUid: s.string().optional().describe("The user ID responsible for this goal.")
|
|
1639
|
-
}),
|
|
1640
|
-
goals: s.array(
|
|
1641
|
-
},
|
|
1675
|
+
}), pr = {
|
|
1676
|
+
goals: s.array(ur).min(1).max(bt).describe(`The array of goals to create (max ${bt}).`)
|
|
1677
|
+
}, mr = {
|
|
1642
1678
|
goals: s.array(Se).describe("The created goals."),
|
|
1643
1679
|
totalCount: s.number().describe("The total number of goals created.")
|
|
1644
|
-
},
|
|
1680
|
+
}, hr = {
|
|
1645
1681
|
name: f.ADD_GOALS,
|
|
1646
1682
|
description: "Create one or more goals. Omit workspaceId for personal goals.",
|
|
1647
|
-
parameters:
|
|
1648
|
-
outputSchema:
|
|
1683
|
+
parameters: pr,
|
|
1684
|
+
outputSchema: mr,
|
|
1649
1685
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1650
1686
|
async execute({ goals: e }, t) {
|
|
1651
1687
|
const r = (await Promise.all(e.map((c) => t.addGoal(c)))).map(ve), n = r.length, a = r.map((c) => `• ${c.name} (id=${c.id}, owner=${c.ownerType})`).join(`
|
|
@@ -1659,26 +1695,26 @@ ${a}`,
|
|
|
1659
1695
|
}
|
|
1660
1696
|
};
|
|
1661
1697
|
}
|
|
1662
|
-
},
|
|
1698
|
+
}, fr = s.object({
|
|
1663
1699
|
name: s.string().min(1).max(128).describe("The name of the label."),
|
|
1664
1700
|
color: de,
|
|
1665
1701
|
order: s.number().int().optional().describe("The position of the label in the label list."),
|
|
1666
1702
|
isFavorite: s.boolean().optional().describe("Whether the label is a favorite. Defaults to false.")
|
|
1667
|
-
}),
|
|
1668
|
-
labels: s.array(
|
|
1669
|
-
},
|
|
1703
|
+
}), br = {
|
|
1704
|
+
labels: s.array(fr).min(1).describe("The array of labels to add.")
|
|
1705
|
+
}, gr = {
|
|
1670
1706
|
labels: s.array(pe).describe("The created labels."),
|
|
1671
1707
|
totalCount: s.number().describe("The total number of labels created.")
|
|
1672
|
-
},
|
|
1708
|
+
}, yr = {
|
|
1673
1709
|
name: f.ADD_LABELS,
|
|
1674
1710
|
description: "Add one or more new personal labels.",
|
|
1675
|
-
parameters:
|
|
1676
|
-
outputSchema:
|
|
1711
|
+
parameters: br,
|
|
1712
|
+
outputSchema: gr,
|
|
1677
1713
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1678
1714
|
async execute({ labels: e }, t) {
|
|
1679
1715
|
const o = await Promise.all(e.map((n) => t.addLabel(n)));
|
|
1680
1716
|
return {
|
|
1681
|
-
textContent:
|
|
1717
|
+
textContent: kr({ labels: o }),
|
|
1682
1718
|
structuredContent: {
|
|
1683
1719
|
labels: o.map((n) => pe.parse(n)),
|
|
1684
1720
|
totalCount: o.length
|
|
@@ -1686,22 +1722,22 @@ ${a}`,
|
|
|
1686
1722
|
};
|
|
1687
1723
|
}
|
|
1688
1724
|
};
|
|
1689
|
-
function
|
|
1725
|
+
function kr({ labels: e }) {
|
|
1690
1726
|
const t = e.length, o = e.map((r) => `• ${r.name} (id=${r.id})`).join(`
|
|
1691
1727
|
`);
|
|
1692
1728
|
return `Added ${t} label${t === 1 ? "" : "s"}:
|
|
1693
1729
|
${o}`;
|
|
1694
1730
|
}
|
|
1695
|
-
const
|
|
1696
|
-
function
|
|
1731
|
+
const Tr = 300 * 1e3;
|
|
1732
|
+
function wr(e) {
|
|
1697
1733
|
return /^\d+$/.test(e);
|
|
1698
1734
|
}
|
|
1699
|
-
class
|
|
1735
|
+
class vr {
|
|
1700
1736
|
constructor() {
|
|
1701
1737
|
this.cache = null;
|
|
1702
1738
|
}
|
|
1703
1739
|
async getWorkspaces(t) {
|
|
1704
|
-
if (this.cache && Date.now() - this.cache.timestamp <
|
|
1740
|
+
if (this.cache && Date.now() - this.cache.timestamp < Tr)
|
|
1705
1741
|
return this.cache.workspaces;
|
|
1706
1742
|
const o = await t.getWorkspaces();
|
|
1707
1743
|
return this.cache = { workspaces: o, timestamp: Date.now() }, o;
|
|
@@ -1724,7 +1760,7 @@ class gr {
|
|
|
1724
1760
|
const n = await this.getWorkspaces(t), a = n.find((p) => p.id === r);
|
|
1725
1761
|
if (a)
|
|
1726
1762
|
return { workspaceId: a.id, workspaceName: a.name };
|
|
1727
|
-
if (
|
|
1763
|
+
if (wr(r))
|
|
1728
1764
|
return { workspaceId: r, workspaceName: r };
|
|
1729
1765
|
const i = r.toLowerCase(), c = n.find((p) => p.name.toLowerCase() === i);
|
|
1730
1766
|
if (c)
|
|
@@ -1752,7 +1788,7 @@ ${p}` + (d.length > 5 ? `
|
|
|
1752
1788
|
this.cache = null;
|
|
1753
1789
|
}
|
|
1754
1790
|
}
|
|
1755
|
-
const
|
|
1791
|
+
const Kt = new vr(), Ir = s.object({
|
|
1756
1792
|
name: s.string().min(1).describe("The name of the project."),
|
|
1757
1793
|
parentId: s.string().optional().describe("The ID of the parent project. If provided, creates this as a sub-project."),
|
|
1758
1794
|
isFavorite: s.boolean().optional().describe("Whether the project is a favorite. Defaults to false."),
|
|
@@ -1762,23 +1798,23 @@ const Bt = new gr(), yr = s.object({
|
|
|
1762
1798
|
workspace: s.string().trim().min(1).optional().describe(
|
|
1763
1799
|
"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."
|
|
1764
1800
|
)
|
|
1765
|
-
}),
|
|
1766
|
-
projects: s.array(
|
|
1767
|
-
},
|
|
1801
|
+
}), jr = {
|
|
1802
|
+
projects: s.array(Ir).min(1).describe("The array of projects to add.")
|
|
1803
|
+
}, Sr = {
|
|
1768
1804
|
projects: s.array(ue).describe("The created projects."),
|
|
1769
1805
|
totalCount: s.number().describe("The total number of projects created.")
|
|
1770
|
-
},
|
|
1806
|
+
}, Cr = {
|
|
1771
1807
|
name: f.ADD_PROJECTS,
|
|
1772
1808
|
description: "Add one or more new projects.",
|
|
1773
|
-
parameters:
|
|
1774
|
-
outputSchema:
|
|
1809
|
+
parameters: jr,
|
|
1810
|
+
outputSchema: Sr,
|
|
1775
1811
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1776
1812
|
async execute({ projects: e }, t) {
|
|
1777
1813
|
const o = [
|
|
1778
1814
|
...new Set(e.map((c) => c.workspace).filter(Boolean))
|
|
1779
1815
|
], r = /* @__PURE__ */ new Map();
|
|
1780
1816
|
for (const c of o) {
|
|
1781
|
-
const d = await
|
|
1817
|
+
const d = await Kt.resolveWorkspace(t, c);
|
|
1782
1818
|
r.set(c, d.workspaceId);
|
|
1783
1819
|
}
|
|
1784
1820
|
const n = await Promise.all(
|
|
@@ -1786,7 +1822,7 @@ const Bt = new gr(), yr = s.object({
|
|
|
1786
1822
|
const l = c ? r.get(c) : void 0;
|
|
1787
1823
|
return t.addProject({ ...d, ...l ? { workspaceId: l } : {} });
|
|
1788
1824
|
})
|
|
1789
|
-
), a =
|
|
1825
|
+
), a = $r({ projects: n }), i = n.map(V);
|
|
1790
1826
|
return {
|
|
1791
1827
|
textContent: a,
|
|
1792
1828
|
structuredContent: {
|
|
@@ -1796,18 +1832,18 @@ const Bt = new gr(), yr = s.object({
|
|
|
1796
1832
|
};
|
|
1797
1833
|
}
|
|
1798
1834
|
};
|
|
1799
|
-
function
|
|
1835
|
+
function $r({ projects: e }) {
|
|
1800
1836
|
const t = e.length, o = e.map((n) => `• ${n.name} (id=${n.id})`).join(`
|
|
1801
1837
|
`);
|
|
1802
1838
|
return `Added ${t} project${t === 1 ? "" : "s"}:
|
|
1803
1839
|
${o}`;
|
|
1804
1840
|
}
|
|
1805
|
-
const Te = 25, Ce = s.enum(
|
|
1841
|
+
const Te = 25, Ce = s.enum(js), Vt = s.object({
|
|
1806
1842
|
date: s.string().optional().describe("Due date in YYYY-MM-DD format."),
|
|
1807
1843
|
string: s.string().optional().describe('Natural language due string, e.g. "tomorrow at 3pm".'),
|
|
1808
1844
|
timezone: s.string().optional().describe('Timezone for the reminder, e.g. "America/New_York".'),
|
|
1809
1845
|
lang: s.string().optional().describe('Language for parsing the due string, e.g. "en".')
|
|
1810
|
-
}),
|
|
1846
|
+
}), Jt = s.enum(Ut), $e = s.boolean().optional().describe("Whether this is an urgent reminder. Applies to relative and absolute reminders."), Dr = s.object({
|
|
1811
1847
|
type: s.literal("relative"),
|
|
1812
1848
|
taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
|
|
1813
1849
|
minuteOffset: s.number().int().min(0).describe(
|
|
@@ -1817,41 +1853,41 @@ const Te = 25, Ce = s.enum(Ts), Yt = s.object({
|
|
|
1817
1853
|
'Delivery method: "email" or "push" notification. Defaults to push.'
|
|
1818
1854
|
),
|
|
1819
1855
|
isUrgent: $e
|
|
1820
|
-
}),
|
|
1856
|
+
}), Ar = s.object({
|
|
1821
1857
|
type: s.literal("absolute"),
|
|
1822
1858
|
taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
|
|
1823
|
-
due:
|
|
1859
|
+
due: Vt.describe("The specific date/time for the reminder."),
|
|
1824
1860
|
service: Ce.optional().describe(
|
|
1825
1861
|
'Delivery method: "email" or "push" notification. Defaults to push.'
|
|
1826
1862
|
),
|
|
1827
1863
|
isUrgent: $e
|
|
1828
|
-
}),
|
|
1864
|
+
}), xr = s.object({
|
|
1829
1865
|
type: s.literal("location"),
|
|
1830
1866
|
taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
|
|
1831
1867
|
name: s.string().min(1).describe('Name of the location, e.g. "Office", "Home".'),
|
|
1832
1868
|
locLat: s.string().describe('Latitude of the location as a string, e.g. "37.7749".'),
|
|
1833
1869
|
locLong: s.string().describe('Longitude of the location as a string, e.g. "-122.4194".'),
|
|
1834
|
-
locTrigger:
|
|
1870
|
+
locTrigger: Jt.describe(
|
|
1835
1871
|
'When to trigger: "on_enter" (arriving) or "on_leave" (departing).'
|
|
1836
1872
|
),
|
|
1837
1873
|
radius: s.number().int().optional().describe("Radius in meters for the geofence. Defaults to server default.")
|
|
1838
|
-
}),
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
]),
|
|
1843
|
-
reminders: s.array(
|
|
1874
|
+
}), Er = s.discriminatedUnion("type", [
|
|
1875
|
+
Dr,
|
|
1876
|
+
Ar,
|
|
1877
|
+
xr
|
|
1878
|
+
]), Or = {
|
|
1879
|
+
reminders: s.array(Er).min(1).max(Te).describe(
|
|
1844
1880
|
`Array of reminders to create (max ${Te}). Each reminder must specify a type: "relative" (minutes before due), "absolute" (specific date/time), or "location" (geofence trigger).`
|
|
1845
1881
|
)
|
|
1846
|
-
},
|
|
1847
|
-
reminders: s.array(
|
|
1882
|
+
}, Ur = {
|
|
1883
|
+
reminders: s.array(rt).describe("The created reminders."),
|
|
1848
1884
|
totalCount: s.number().describe("Total number of reminders created."),
|
|
1849
1885
|
addedReminderIds: s.array(s.string()).describe("IDs of the created reminders.")
|
|
1850
|
-
},
|
|
1886
|
+
}, Pr = {
|
|
1851
1887
|
name: f.ADD_REMINDERS,
|
|
1852
1888
|
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.',
|
|
1853
|
-
parameters:
|
|
1854
|
-
outputSchema:
|
|
1889
|
+
parameters: Or,
|
|
1890
|
+
outputSchema: Ur,
|
|
1855
1891
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1856
1892
|
async execute(e, t) {
|
|
1857
1893
|
const { reminders: o } = e, r = o.map(async (c) => {
|
|
@@ -1884,7 +1920,7 @@ const Te = 25, Ce = s.enum(Ts), Yt = s.object({
|
|
|
1884
1920
|
}
|
|
1885
1921
|
}), a = (await Promise.all(r)).map(he);
|
|
1886
1922
|
return {
|
|
1887
|
-
textContent:
|
|
1923
|
+
textContent: _r(a),
|
|
1888
1924
|
structuredContent: {
|
|
1889
1925
|
reminders: a,
|
|
1890
1926
|
totalCount: a.length,
|
|
@@ -1893,8 +1929,8 @@ const Te = 25, Ce = s.enum(Ts), Yt = s.object({
|
|
|
1893
1929
|
};
|
|
1894
1930
|
}
|
|
1895
1931
|
};
|
|
1896
|
-
function
|
|
1897
|
-
const { timeBasedCount: t, locationCount: o } =
|
|
1932
|
+
function _r(e) {
|
|
1933
|
+
const { timeBasedCount: t, locationCount: o } = zt(e), r = [];
|
|
1898
1934
|
if (t > 0) {
|
|
1899
1935
|
const n = t > 1 ? "reminders" : "reminder";
|
|
1900
1936
|
r.push(`${t} time-based ${n}`);
|
|
@@ -1905,22 +1941,22 @@ function xr(e) {
|
|
|
1905
1941
|
}
|
|
1906
1942
|
return r.length > 0 ? `Added ${r.join(" and ")}` : "No reminders added";
|
|
1907
1943
|
}
|
|
1908
|
-
const
|
|
1944
|
+
const Rr = s.object({
|
|
1909
1945
|
name: s.string().min(1).describe("The name of the section."),
|
|
1910
1946
|
projectId: s.string().min(1).describe(
|
|
1911
1947
|
'The ID of the project to add the section to. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
1912
1948
|
),
|
|
1913
1949
|
description: s.string().optional().describe("The description of the section. Supports Markdown.")
|
|
1914
|
-
}),
|
|
1915
|
-
sections: s.array(
|
|
1916
|
-
},
|
|
1950
|
+
}), Nr = {
|
|
1951
|
+
sections: s.array(Rr).min(1).describe("The array of sections to add.")
|
|
1952
|
+
}, Lr = {
|
|
1917
1953
|
sections: s.array(ce).describe("The created sections."),
|
|
1918
1954
|
totalCount: s.number().describe("The total number of sections created.")
|
|
1919
|
-
},
|
|
1955
|
+
}, Mr = {
|
|
1920
1956
|
name: f.ADD_SECTIONS,
|
|
1921
1957
|
description: "Add one or more new sections to projects.",
|
|
1922
|
-
parameters:
|
|
1923
|
-
outputSchema:
|
|
1958
|
+
parameters: Nr,
|
|
1959
|
+
outputSchema: Lr,
|
|
1924
1960
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1925
1961
|
async execute({ sections: e }, t) {
|
|
1926
1962
|
const r = e.some((c) => fe(c.projectId)) ? await t.getUser() : void 0, n = await Promise.all(
|
|
@@ -1936,7 +1972,7 @@ const Er = s.object({
|
|
|
1936
1972
|
n.map((c) => t.addSection(c))
|
|
1937
1973
|
);
|
|
1938
1974
|
return {
|
|
1939
|
-
textContent:
|
|
1975
|
+
textContent: Fr({ sections: a }),
|
|
1940
1976
|
structuredContent: {
|
|
1941
1977
|
sections: a.map(X),
|
|
1942
1978
|
totalCount: a.length
|
|
@@ -1944,7 +1980,7 @@ const Er = s.object({
|
|
|
1944
1980
|
};
|
|
1945
1981
|
}
|
|
1946
1982
|
};
|
|
1947
|
-
function
|
|
1983
|
+
function Fr({ sections: e }) {
|
|
1948
1984
|
const t = e.length, o = e.map((n) => `• ${n.name} (id=${n.id}, projectId=${n.projectId})`).join(`
|
|
1949
1985
|
`);
|
|
1950
1986
|
return `Added ${t} section${t === 1 ? "" : "s"}:
|
|
@@ -1959,7 +1995,7 @@ const se = {
|
|
|
1959
1995
|
PROJECT_NOT_FOUND: "PROJECT_NOT_FOUND",
|
|
1960
1996
|
TASK_NOT_FOUND: "TASK_NOT_FOUND"
|
|
1961
1997
|
};
|
|
1962
|
-
class
|
|
1998
|
+
class Hr {
|
|
1963
1999
|
/**
|
|
1964
2000
|
* Validate a single assignment operation
|
|
1965
2001
|
*/
|
|
@@ -2168,12 +2204,12 @@ class Rr {
|
|
|
2168
2204
|
};
|
|
2169
2205
|
}
|
|
2170
2206
|
}
|
|
2171
|
-
const
|
|
2207
|
+
const at = new Hr();
|
|
2172
2208
|
function re(e = /* @__PURE__ */ new Date()) {
|
|
2173
2209
|
const t = e.getFullYear(), o = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0");
|
|
2174
2210
|
return `${t}-${o}-${r}`;
|
|
2175
2211
|
}
|
|
2176
|
-
function
|
|
2212
|
+
function it(e, t, o = {}) {
|
|
2177
2213
|
const { context: r, showDetails: n = !1 } = o, a = t.length, i = [], d = `${e} ${a} ${a === 1 ? "task" : "tasks"}${r ? ` ${r}` : ""}.`;
|
|
2178
2214
|
i.push(d);
|
|
2179
2215
|
const l = 5;
|
|
@@ -2203,20 +2239,20 @@ ${i.slice(0, Oe.MAX_FAILURES_SHOWN).map((u) => ` ${u.item} (Error: ${u.error}
|
|
|
2203
2239
|
return c.join(`
|
|
2204
2240
|
`);
|
|
2205
2241
|
}
|
|
2206
|
-
function
|
|
2242
|
+
function Wr(e) {
|
|
2207
2243
|
const t = e.content || e.title || "Untitled", o = e.dueDate ? ` • due ${e.dueDate}` : "", r = e.priority ? ` • ${e.priority.toUpperCase()}` : "", n = e.projectName ? ` • ${e.projectName}` : "", a = e.id ? ` • id=${e.id}` : "";
|
|
2208
2244
|
return ` ${t}${o}${r}${n}${a}`;
|
|
2209
2245
|
}
|
|
2210
|
-
function
|
|
2246
|
+
function Gr(e) {
|
|
2211
2247
|
const t = ` (${e.color})`, o = e.isFavorite ? " • ⭐" : "", r = ` • id=${e.id}`;
|
|
2212
2248
|
return ` ${e.name}${t}${o}${r}`;
|
|
2213
2249
|
}
|
|
2214
|
-
function
|
|
2250
|
+
function Br(e) {
|
|
2215
2251
|
const t = e.inboxProject ? " • Inbox" : "", o = e.isFavorite ? " • ⭐" : "", r = e.isShared ? " • Shared" : "", n = e.isArchived ? " • Archived" : "", a = e.viewStyle && e.viewStyle !== "list" ? ` • ${e.viewStyle}` : "", i = ` • id=${e.id}`;
|
|
2216
2252
|
return ` ${e.name}${t}${o}${r}${n}${a}${i}`;
|
|
2217
2253
|
}
|
|
2218
2254
|
function De(e, t = 5) {
|
|
2219
|
-
const r = e.slice(0, t).map(
|
|
2255
|
+
const r = e.slice(0, t).map(Wr).join(`
|
|
2220
2256
|
`);
|
|
2221
2257
|
if (e.length > t) {
|
|
2222
2258
|
const n = e.length - t;
|
|
@@ -2237,10 +2273,10 @@ function M({
|
|
|
2237
2273
|
}) {
|
|
2238
2274
|
const d = [], l = `${e}: ${t}${typeof o == "number" ? ` (limit ${o})` : ""}${r ? ", more available" : ""}.`;
|
|
2239
2275
|
return d.push(l), n?.length && d.push(`Filter: ${n.join("; ")}.`), a?.length && d.push(`Preview:
|
|
2240
|
-
${a}`), !t && i?.length && d.push(`No results. ${i.join("; ")}.`), (c?.length || r) && d.push(
|
|
2276
|
+
${a}`), !t && i?.length && d.push(`No results. ${i.join("; ")}.`), (c?.length || r) && d.push(Xt(c || [], r)), d.join(`
|
|
2241
2277
|
`);
|
|
2242
2278
|
}
|
|
2243
|
-
function
|
|
2279
|
+
function Xt(e, t) {
|
|
2244
2280
|
const o = [...e];
|
|
2245
2281
|
return t && o.push(`Pass cursor '${t}' to fetch more results.`), `${o.length === 1 ? "Possible suggested next step:" : "Possible suggested next steps:"}
|
|
2246
2282
|
${o.map((n) => `- ${n}`).join(`
|
|
@@ -2249,14 +2285,14 @@ ${o.map((n) => `- ${n}`).join(`
|
|
|
2249
2285
|
function W(e) {
|
|
2250
2286
|
return s.string().transform((t) => t === "" ? void 0 : t).optional().describe(e);
|
|
2251
2287
|
}
|
|
2252
|
-
const
|
|
2288
|
+
const gt = 25, Yr = s.object({
|
|
2253
2289
|
content: s.string().min(1).describe(
|
|
2254
2290
|
'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.'
|
|
2255
2291
|
),
|
|
2256
2292
|
description: W(
|
|
2257
2293
|
"Additional details, notes, or context for the task. Use this for longer content rather than putting it in the task name. Supports Markdown."
|
|
2258
2294
|
),
|
|
2259
|
-
priority:
|
|
2295
|
+
priority: et.optional().describe(Qe),
|
|
2260
2296
|
dueString: W("The due date for the task, in natural language."),
|
|
2261
2297
|
deadlineDate: W(
|
|
2262
2298
|
'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.'
|
|
@@ -2277,25 +2313,25 @@ const bt = 25, Fr = s.object({
|
|
|
2277
2313
|
isUncompletable: s.boolean().optional().describe(
|
|
2278
2314
|
"Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
|
|
2279
2315
|
)
|
|
2280
|
-
}),
|
|
2281
|
-
tasks: s.array(
|
|
2282
|
-
},
|
|
2316
|
+
}), yt = {
|
|
2317
|
+
tasks: s.array(Yr).min(1).max(gt).describe(`The array of tasks to add (max ${gt}).`)
|
|
2318
|
+
}, qr = {
|
|
2283
2319
|
tasks: s.array(J).describe("The created tasks."),
|
|
2284
2320
|
totalCount: s.number().describe("The total number of tasks created."),
|
|
2285
2321
|
failures: s.array(be).describe("Failed task creations with error details."),
|
|
2286
2322
|
totalRequested: s.number().describe("The total number of tasks requested."),
|
|
2287
2323
|
successCount: s.number().describe("The number of successfully created tasks."),
|
|
2288
2324
|
failureCount: s.number().describe("The number of failed task creations.")
|
|
2289
|
-
},
|
|
2325
|
+
}, zr = {
|
|
2290
2326
|
name: f.ADD_TASKS,
|
|
2291
2327
|
description: "Add one or more tasks to a project, section, or parent. Supports assignment to project collaborators.",
|
|
2292
|
-
parameters:
|
|
2293
|
-
outputSchema:
|
|
2328
|
+
parameters: yt,
|
|
2329
|
+
outputSchema: qr,
|
|
2294
2330
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
2295
2331
|
async execute(e, t) {
|
|
2296
|
-
const { tasks: o } = s.object(
|
|
2332
|
+
const { tasks: o } = s.object(yt).parse(e), r = /* @__PURE__ */ new Map();
|
|
2297
2333
|
o.forEach((u, m) => {
|
|
2298
|
-
const h =
|
|
2334
|
+
const h = Kr(u), k = r.get(h);
|
|
2299
2335
|
k ? k.push({ task: u, index: m }) : r.set(h, [{ task: u, index: m }]);
|
|
2300
2336
|
});
|
|
2301
2337
|
const n = /* @__PURE__ */ new Map(), i = (await Promise.all(
|
|
@@ -2303,7 +2339,7 @@ const bt = 25, Fr = s.object({
|
|
|
2303
2339
|
const m = [];
|
|
2304
2340
|
for (const { task: h, index: k } of u)
|
|
2305
2341
|
try {
|
|
2306
|
-
const b = await
|
|
2342
|
+
const b = await Vr(h, t, n);
|
|
2307
2343
|
m.push({ index: k, result: { status: "fulfilled", value: b } });
|
|
2308
2344
|
} catch (b) {
|
|
2309
2345
|
m.push({
|
|
@@ -2317,7 +2353,10 @@ const bt = 25, Fr = s.object({
|
|
|
2317
2353
|
for (const { index: u, result: m } of i)
|
|
2318
2354
|
m.status === "fulfilled" ? c.push(m.value) : d.push({
|
|
2319
2355
|
item: o[u]?.content ?? `Task ${u + 1}`,
|
|
2320
|
-
|
|
2356
|
+
// Keep API error signals (status/code/tag) — `error.message`
|
|
2357
|
+
// alone collapses e.g. a full-project rejection into a bare
|
|
2358
|
+
// "HTTP 403: Forbidden"
|
|
2359
|
+
error: Gs(m.reason)
|
|
2321
2360
|
});
|
|
2322
2361
|
if (c.length === 0 && d.length > 0) {
|
|
2323
2362
|
const u = d.map((m) => `"${m.item}": ${m.error}`).join("; ");
|
|
@@ -2325,7 +2364,7 @@ const bt = 25, Fr = s.object({
|
|
|
2325
2364
|
}
|
|
2326
2365
|
const l = c.map(_);
|
|
2327
2366
|
return {
|
|
2328
|
-
textContent:
|
|
2367
|
+
textContent: Jr({
|
|
2329
2368
|
tasks: l,
|
|
2330
2369
|
failures: d,
|
|
2331
2370
|
args: { tasks: o }
|
|
@@ -2341,10 +2380,10 @@ const bt = 25, Fr = s.object({
|
|
|
2341
2380
|
};
|
|
2342
2381
|
}
|
|
2343
2382
|
};
|
|
2344
|
-
function
|
|
2383
|
+
function Kr(e) {
|
|
2345
2384
|
return `${e.projectId ?? ""}|${e.sectionId ?? ""}|${e.parentId ?? ""}`;
|
|
2346
2385
|
}
|
|
2347
|
-
async function
|
|
2386
|
+
async function Vr(e, t, o) {
|
|
2348
2387
|
const {
|
|
2349
2388
|
duration: r,
|
|
2350
2389
|
projectId: n,
|
|
@@ -2373,13 +2412,13 @@ async function Br(e, t, o) {
|
|
|
2373
2412
|
labels: p,
|
|
2374
2413
|
deadlineDate: u
|
|
2375
2414
|
};
|
|
2376
|
-
if (l && (k.priority =
|
|
2415
|
+
if (l && (k.priority = Gt(l)), d && !h && !a && !i)
|
|
2377
2416
|
throw new Error(
|
|
2378
2417
|
`Task "${e.content}": Cannot assign tasks without specifying project context. Please specify a projectId, sectionId, or parentId.`
|
|
2379
2418
|
);
|
|
2380
2419
|
if (r)
|
|
2381
2420
|
try {
|
|
2382
|
-
const { minutes: b } =
|
|
2421
|
+
const { minutes: b } = Wt(r);
|
|
2383
2422
|
k = {
|
|
2384
2423
|
...k,
|
|
2385
2424
|
duration: b,
|
|
@@ -2406,7 +2445,7 @@ async function Br(e, t, o) {
|
|
|
2406
2445
|
throw new Error(
|
|
2407
2446
|
`Task "${e.content}": Cannot determine target project for assignment validation`
|
|
2408
2447
|
);
|
|
2409
|
-
const C = await
|
|
2448
|
+
const C = await at.validateTaskCreationAssignment(
|
|
2410
2449
|
t,
|
|
2411
2450
|
b,
|
|
2412
2451
|
d
|
|
@@ -2421,7 +2460,7 @@ async function Br(e, t, o) {
|
|
|
2421
2460
|
}
|
|
2422
2461
|
return await t.addTask(k);
|
|
2423
2462
|
}
|
|
2424
|
-
function
|
|
2463
|
+
function Jr({
|
|
2425
2464
|
tasks: e,
|
|
2426
2465
|
failures: t,
|
|
2427
2466
|
args: o
|
|
@@ -2441,28 +2480,28 @@ function Yr({
|
|
|
2441
2480
|
successItems: e.map((a) => a.content ?? "Untitled"),
|
|
2442
2481
|
successLabel: "Created",
|
|
2443
2482
|
failures: t
|
|
2444
|
-
}) :
|
|
2483
|
+
}) : it("Added", e, {
|
|
2445
2484
|
context: n,
|
|
2446
2485
|
showDetails: !0
|
|
2447
2486
|
});
|
|
2448
2487
|
}
|
|
2449
|
-
const
|
|
2488
|
+
const Xr = {
|
|
2450
2489
|
projectId: s.string().min(1).describe(
|
|
2451
2490
|
"The ID of the project to analyze. This triggers a new health analysis which may take some time to complete."
|
|
2452
2491
|
)
|
|
2453
|
-
},
|
|
2492
|
+
}, Zr = {
|
|
2454
2493
|
projectId: s.string().describe("The project ID."),
|
|
2455
2494
|
health: s.object({
|
|
2456
|
-
status: s.enum(
|
|
2495
|
+
status: s.enum(Xe).describe("The health status after triggering analysis."),
|
|
2457
2496
|
isStale: s.boolean().describe("Whether the health data is still stale after the request."),
|
|
2458
2497
|
updateInProgress: s.boolean().describe("Whether an analysis update is currently in progress.")
|
|
2459
2498
|
}).describe("The health response returned after triggering analysis."),
|
|
2460
2499
|
message: s.string().describe("A human-readable message about the analysis status.")
|
|
2461
|
-
},
|
|
2500
|
+
}, Qr = {
|
|
2462
2501
|
name: f.ANALYZE_PROJECT_HEALTH,
|
|
2463
2502
|
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.",
|
|
2464
|
-
parameters:
|
|
2465
|
-
outputSchema:
|
|
2503
|
+
parameters: Xr,
|
|
2504
|
+
outputSchema: Zr,
|
|
2466
2505
|
annotations: {
|
|
2467
2506
|
readOnlyHint: !1,
|
|
2468
2507
|
destructiveHint: !1,
|
|
@@ -2485,22 +2524,22 @@ ${n}`,
|
|
|
2485
2524
|
}
|
|
2486
2525
|
};
|
|
2487
2526
|
}
|
|
2488
|
-
},
|
|
2489
|
-
ids: s.array(s.string().min(1)).min(1).max(
|
|
2490
|
-
`The IDs of the goals to complete or uncomplete (max ${
|
|
2527
|
+
}, kt = 25, en = {
|
|
2528
|
+
ids: s.array(s.string().min(1)).min(1).max(kt).describe(
|
|
2529
|
+
`The IDs of the goals to complete or uncomplete (max ${kt}).`
|
|
2491
2530
|
),
|
|
2492
2531
|
action: s.enum(["complete", "uncomplete"]).describe("Whether to complete or uncomplete the goals.")
|
|
2493
|
-
},
|
|
2532
|
+
}, tn = {
|
|
2494
2533
|
processed: s.array(s.string()).describe("The IDs of successfully processed goals."),
|
|
2495
2534
|
failures: s.array(be).describe("Failed operations with error details."),
|
|
2496
2535
|
totalRequested: s.number().describe("The total number of goals requested."),
|
|
2497
2536
|
successCount: s.number().describe("The number of successfully processed goals."),
|
|
2498
2537
|
failureCount: s.number().describe("The number of failed operations.")
|
|
2499
|
-
},
|
|
2538
|
+
}, sn = {
|
|
2500
2539
|
name: f.COMPLETE_GOALS,
|
|
2501
2540
|
description: "Complete or uncomplete one or more goals by their IDs.",
|
|
2502
|
-
parameters:
|
|
2503
|
-
outputSchema:
|
|
2541
|
+
parameters: en,
|
|
2542
|
+
outputSchema: tn,
|
|
2504
2543
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
2505
2544
|
async execute(e, t) {
|
|
2506
2545
|
const o = await Promise.allSettled(
|
|
@@ -2533,19 +2572,19 @@ ${n}`,
|
|
|
2533
2572
|
}
|
|
2534
2573
|
};
|
|
2535
2574
|
}
|
|
2536
|
-
},
|
|
2575
|
+
}, on = {
|
|
2537
2576
|
ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to complete.")
|
|
2538
|
-
},
|
|
2577
|
+
}, rn = {
|
|
2539
2578
|
completed: s.array(s.string()).describe("The IDs of successfully completed tasks."),
|
|
2540
2579
|
failures: s.array(be).describe("Failed task completions with error details."),
|
|
2541
2580
|
totalRequested: s.number().describe("The total number of tasks requested to complete."),
|
|
2542
2581
|
successCount: s.number().describe("The number of successfully completed tasks."),
|
|
2543
2582
|
failureCount: s.number().describe("The number of failed task completions.")
|
|
2544
|
-
},
|
|
2583
|
+
}, nn = {
|
|
2545
2584
|
name: f.COMPLETE_TASKS,
|
|
2546
2585
|
description: "Complete one or more tasks by their IDs.",
|
|
2547
|
-
parameters:
|
|
2548
|
-
outputSchema:
|
|
2586
|
+
parameters: on,
|
|
2587
|
+
outputSchema: rn,
|
|
2549
2588
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
2550
2589
|
async execute(e, t) {
|
|
2551
2590
|
const o = [], r = [];
|
|
@@ -2560,7 +2599,7 @@ ${n}`,
|
|
|
2560
2599
|
});
|
|
2561
2600
|
}
|
|
2562
2601
|
return {
|
|
2563
|
-
textContent:
|
|
2602
|
+
textContent: an({
|
|
2564
2603
|
completed: o,
|
|
2565
2604
|
failures: r,
|
|
2566
2605
|
args: e
|
|
@@ -2575,7 +2614,7 @@ ${n}`,
|
|
|
2575
2614
|
};
|
|
2576
2615
|
}
|
|
2577
2616
|
};
|
|
2578
|
-
function
|
|
2617
|
+
function an({
|
|
2579
2618
|
completed: e,
|
|
2580
2619
|
failures: t,
|
|
2581
2620
|
args: o
|
|
@@ -2588,7 +2627,7 @@ function tn({
|
|
|
2588
2627
|
failures: t
|
|
2589
2628
|
});
|
|
2590
2629
|
}
|
|
2591
|
-
const
|
|
2630
|
+
const Zt = [
|
|
2592
2631
|
"project",
|
|
2593
2632
|
"section",
|
|
2594
2633
|
"task",
|
|
@@ -2598,20 +2637,20 @@ const Kt = [
|
|
|
2598
2637
|
"goal",
|
|
2599
2638
|
"reminder",
|
|
2600
2639
|
"location_reminder"
|
|
2601
|
-
],
|
|
2602
|
-
type: s.enum(
|
|
2640
|
+
], cn = {
|
|
2641
|
+
type: s.enum(Zt).describe("The type of entity to delete."),
|
|
2603
2642
|
id: s.string().min(1).describe("The ID of the entity to delete.")
|
|
2604
|
-
},
|
|
2643
|
+
}, dn = {
|
|
2605
2644
|
deletedEntity: s.object({
|
|
2606
|
-
type: s.enum(
|
|
2645
|
+
type: s.enum(Zt).describe("The type of deleted entity."),
|
|
2607
2646
|
id: s.string().describe("The ID of the deleted entity.")
|
|
2608
2647
|
}).describe("Information about the deleted entity."),
|
|
2609
2648
|
success: s.boolean().describe("Whether the deletion was successful.")
|
|
2610
|
-
},
|
|
2649
|
+
}, ln = {
|
|
2611
2650
|
name: f.DELETE_OBJECT,
|
|
2612
2651
|
description: "Delete a project, section, task, comment, label, filter, goal, 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.",
|
|
2613
|
-
parameters:
|
|
2614
|
-
outputSchema:
|
|
2652
|
+
parameters: cn,
|
|
2653
|
+
outputSchema: dn,
|
|
2615
2654
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !0 },
|
|
2616
2655
|
async execute(e, t) {
|
|
2617
2656
|
switch (e.type) {
|
|
@@ -2659,18 +2698,18 @@ const Kt = [
|
|
|
2659
2698
|
}
|
|
2660
2699
|
};
|
|
2661
2700
|
}
|
|
2662
|
-
},
|
|
2663
|
-
type: s.enum(
|
|
2701
|
+
}, Qt = ["task", "project", "comment", "section", "goal"], un = {
|
|
2702
|
+
type: s.enum(Qt).describe("The type of object to fetch."),
|
|
2664
2703
|
id: s.string().min(1).describe("The unique ID of the object to fetch.")
|
|
2665
|
-
},
|
|
2666
|
-
type: s.enum(
|
|
2704
|
+
}, pn = {
|
|
2705
|
+
type: s.enum(Qt).describe("The type of object fetched."),
|
|
2667
2706
|
id: s.string().describe("The ID of the fetched object."),
|
|
2668
2707
|
object: s.union([J, ue, je, ce, Se]).describe("The fetched object data.")
|
|
2669
|
-
},
|
|
2708
|
+
}, mn = {
|
|
2670
2709
|
name: f.FETCH_OBJECT,
|
|
2671
2710
|
description: "Fetch a single task, project, comment, section, or goal by its ID. Use this when you have a specific object ID and want to retrieve its full details.",
|
|
2672
|
-
parameters:
|
|
2673
|
-
outputSchema:
|
|
2711
|
+
parameters: un,
|
|
2712
|
+
outputSchema: pn,
|
|
2674
2713
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
2675
2714
|
async execute(e, t) {
|
|
2676
2715
|
const { type: o, id: r } = e;
|
|
@@ -2741,21 +2780,21 @@ const Kt = [
|
|
|
2741
2780
|
);
|
|
2742
2781
|
}
|
|
2743
2782
|
}
|
|
2744
|
-
},
|
|
2783
|
+
}, hn = {
|
|
2745
2784
|
id: s.string().min(1).describe(
|
|
2746
2785
|
'A unique identifier for the document in the format "task:{id}" or "project:{id}".'
|
|
2747
2786
|
)
|
|
2748
|
-
},
|
|
2787
|
+
}, fn = {
|
|
2749
2788
|
id: s.string().describe("The ID of the fetched document."),
|
|
2750
2789
|
title: s.string().describe("The title of the document."),
|
|
2751
2790
|
text: s.string().describe("The text content of the document."),
|
|
2752
2791
|
url: s.string().describe("The URL of the document."),
|
|
2753
2792
|
metadata: s.record(s.string(), s.unknown()).optional().describe("Additional metadata about the document.")
|
|
2754
|
-
},
|
|
2793
|
+
}, bn = {
|
|
2755
2794
|
name: f.FETCH,
|
|
2756
2795
|
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}".',
|
|
2757
|
-
parameters:
|
|
2758
|
-
outputSchema:
|
|
2796
|
+
parameters: hn,
|
|
2797
|
+
outputSchema: fn,
|
|
2759
2798
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
2760
2799
|
async execute(e, t) {
|
|
2761
2800
|
const { id: o } = e, [r, n] = o.split(":", 2);
|
|
@@ -2774,7 +2813,7 @@ Labels: ${c.labels.join(", ")}`), a = {
|
|
|
2774
2813
|
id: `task:${c.id}`,
|
|
2775
2814
|
title: c.content,
|
|
2776
2815
|
text: d.join(""),
|
|
2777
|
-
url:
|
|
2816
|
+
url: Pt(c.id),
|
|
2778
2817
|
metadata: {
|
|
2779
2818
|
priority: c.priority,
|
|
2780
2819
|
projectId: c.projectId,
|
|
@@ -2799,7 +2838,7 @@ Favorite: Yes`), a = {
|
|
|
2799
2838
|
id: `project:${c.id}`,
|
|
2800
2839
|
title: c.name,
|
|
2801
2840
|
text: d.join(""),
|
|
2802
|
-
url:
|
|
2841
|
+
url: _t(c.id),
|
|
2803
2842
|
metadata: {
|
|
2804
2843
|
color: c.color,
|
|
2805
2844
|
isFavorite: c.isFavorite,
|
|
@@ -2815,7 +2854,7 @@ Favorite: Yes`), a = {
|
|
|
2815
2854
|
structuredContent: a
|
|
2816
2855
|
};
|
|
2817
2856
|
}
|
|
2818
|
-
},
|
|
2857
|
+
}, gn = {
|
|
2819
2858
|
objectType: s.enum(["task", "project", "comment"]).optional().describe("Type of object to filter by."),
|
|
2820
2859
|
objectId: s.string().optional().describe("Filter by specific object ID (task, project, or comment)."),
|
|
2821
2860
|
eventType: s.enum([
|
|
@@ -2834,17 +2873,17 @@ Favorite: Yes`), a = {
|
|
|
2834
2873
|
initiatorId: s.string().optional().describe("Filter by the user ID who initiated the event."),
|
|
2835
2874
|
limit: s.number().int().min(1).max(j.ACTIVITY_MAX).default(j.ACTIVITY_DEFAULT).describe("Maximum number of activity events to return."),
|
|
2836
2875
|
cursor: s.string().optional().describe("Pagination cursor for retrieving the next page of results.")
|
|
2837
|
-
},
|
|
2838
|
-
events: s.array(
|
|
2876
|
+
}, yn = {
|
|
2877
|
+
events: s.array(Vo).describe("The activity events."),
|
|
2839
2878
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
2840
2879
|
totalCount: s.number().describe("The total number of events in this page."),
|
|
2841
2880
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
2842
2881
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
2843
|
-
},
|
|
2882
|
+
}, kn = {
|
|
2844
2883
|
name: f.FIND_ACTIVITY,
|
|
2845
2884
|
description: "Retrieve recent activity logs to monitor and audit changes in Todoist. Shows events from all users by default (use initiatorId to filter by specific user). Track task completions, updates, deletions, project changes, and more with flexible filtering. Note: Date-based filtering is not supported by the Todoist API.",
|
|
2846
|
-
parameters:
|
|
2847
|
-
outputSchema:
|
|
2885
|
+
parameters: gn,
|
|
2886
|
+
outputSchema: yn,
|
|
2848
2887
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
2849
2888
|
async execute(e, t) {
|
|
2850
2889
|
const { objectType: o, objectId: r, eventType: n, projectId: a, taskId: i, initiatorId: c, limit: d, cursor: l } = e, p = {
|
|
@@ -2852,9 +2891,9 @@ Favorite: Yes`), a = {
|
|
|
2852
2891
|
cursor: l ?? null
|
|
2853
2892
|
};
|
|
2854
2893
|
o && n ? p.objectEventTypes = `${o}:${n}` : o ? p.objectEventTypes = `${o}:` : n && (p.objectEventTypes = `:${n}`), r && r !== "remove" && (p.objectId = r), a && (p.parentProjectId = a), i && (p.parentItemId = i), c && (p.initiatorId = c);
|
|
2855
|
-
const { results: u, nextCursor: m } = await t.getActivityLogs(p), h = u.map(
|
|
2894
|
+
const { results: u, nextCursor: m } = await t.getActivityLogs(p), h = u.map(Bo);
|
|
2856
2895
|
return {
|
|
2857
|
-
textContent:
|
|
2896
|
+
textContent: Tn({ events: h, args: e, nextCursor: m }),
|
|
2858
2897
|
structuredContent: {
|
|
2859
2898
|
events: h,
|
|
2860
2899
|
nextCursor: m ?? void 0,
|
|
@@ -2865,7 +2904,7 @@ Favorite: Yes`), a = {
|
|
|
2865
2904
|
};
|
|
2866
2905
|
}
|
|
2867
2906
|
};
|
|
2868
|
-
function
|
|
2907
|
+
function Tn({
|
|
2869
2908
|
events: e,
|
|
2870
2909
|
args: t,
|
|
2871
2910
|
nextCursor: o
|
|
@@ -2886,12 +2925,12 @@ function fn({
|
|
|
2886
2925
|
limit: t.limit,
|
|
2887
2926
|
nextCursor: o ?? void 0,
|
|
2888
2927
|
filterHints: a,
|
|
2889
|
-
previewLines:
|
|
2928
|
+
previewLines: wn(e, Math.min(e.length, t.limit)),
|
|
2890
2929
|
zeroReasonHints: i
|
|
2891
2930
|
});
|
|
2892
2931
|
}
|
|
2893
|
-
function
|
|
2894
|
-
const r = e.slice(0, t).map(
|
|
2932
|
+
function wn(e, t = 10) {
|
|
2933
|
+
const r = e.slice(0, t).map(vn).join(`
|
|
2895
2934
|
`);
|
|
2896
2935
|
if (e.length > t) {
|
|
2897
2936
|
const n = e.length - t;
|
|
@@ -2900,8 +2939,8 @@ function bn(e, t = 10) {
|
|
|
2900
2939
|
}
|
|
2901
2940
|
return r;
|
|
2902
2941
|
}
|
|
2903
|
-
function
|
|
2904
|
-
const t =
|
|
2942
|
+
function vn(e) {
|
|
2943
|
+
const t = In(e.eventDate), o = `${e.eventType} ${e.objectType}`;
|
|
2905
2944
|
let r = "";
|
|
2906
2945
|
if (e.extraData) {
|
|
2907
2946
|
const c = e.extraData.content || e.extraData.name || e.extraData.last_content;
|
|
@@ -2910,7 +2949,7 @@ function gn(e) {
|
|
|
2910
2949
|
const n = e.objectId ? ` • id=${e.objectId}` : "", a = e.initiatorId ? ` • by=${e.initiatorId}` : " • system", i = e.parentProjectId ? ` • project=${e.parentProjectId}` : "";
|
|
2911
2950
|
return ` [${t}] ${o}${r}${n}${a}${i}`;
|
|
2912
2951
|
}
|
|
2913
|
-
function
|
|
2952
|
+
function In(e) {
|
|
2914
2953
|
try {
|
|
2915
2954
|
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", {
|
|
2916
2955
|
hour: "2-digit",
|
|
@@ -2923,7 +2962,7 @@ function yn(e) {
|
|
|
2923
2962
|
return e;
|
|
2924
2963
|
}
|
|
2925
2964
|
}
|
|
2926
|
-
const
|
|
2965
|
+
const jn = {
|
|
2927
2966
|
taskId: s.string().optional().describe("Find comments for a specific task."),
|
|
2928
2967
|
projectId: s.string().optional().describe(
|
|
2929
2968
|
'Find comments for a specific project. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
@@ -2931,7 +2970,7 @@ const kn = {
|
|
|
2931
2970
|
commentId: s.string().optional().describe("Get a specific comment by ID."),
|
|
2932
2971
|
cursor: s.string().optional().describe("Pagination cursor for retrieving more results."),
|
|
2933
2972
|
limit: s.number().int().min(1).max(j.COMMENTS_MAX).optional().describe("Maximum number of comments to return")
|
|
2934
|
-
},
|
|
2973
|
+
}, Sn = {
|
|
2935
2974
|
comments: s.array(je).describe("The found comments."),
|
|
2936
2975
|
searchType: s.string().describe(
|
|
2937
2976
|
'The type of search performed: "single" (comment ID), "task" (task ID), or "project" (project ID).'
|
|
@@ -2940,11 +2979,11 @@ const kn = {
|
|
|
2940
2979
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
2941
2980
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
2942
2981
|
totalCount: s.number().describe("The total number of comments in this page.")
|
|
2943
|
-
},
|
|
2982
|
+
}, Cn = {
|
|
2944
2983
|
name: f.FIND_COMMENTS,
|
|
2945
2984
|
description: "Find comments by task, project, or get a specific comment by ID. Exactly one of taskId, projectId, or commentId must be provided.",
|
|
2946
|
-
parameters:
|
|
2947
|
-
outputSchema:
|
|
2985
|
+
parameters: jn,
|
|
2986
|
+
outputSchema: Sn,
|
|
2948
2987
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
2949
2988
|
async execute(e, t) {
|
|
2950
2989
|
const o = [e.taskId, e.projectId, e.commentId].filter(Boolean);
|
|
@@ -2979,7 +3018,7 @@ const kn = {
|
|
|
2979
3018
|
throw new Error("Invalid state: no search parameter provided");
|
|
2980
3019
|
const c = i.map(we);
|
|
2981
3020
|
return {
|
|
2982
|
-
textContent:
|
|
3021
|
+
textContent: $n({
|
|
2983
3022
|
comments: c,
|
|
2984
3023
|
searchType: e.commentId ? "single" : e.taskId ? "task" : "project",
|
|
2985
3024
|
searchId: e.commentId || e.taskId || e.projectId || "",
|
|
@@ -2997,7 +3036,7 @@ const kn = {
|
|
|
2997
3036
|
};
|
|
2998
3037
|
}
|
|
2999
3038
|
};
|
|
3000
|
-
function
|
|
3039
|
+
function $n({
|
|
3001
3040
|
comments: e,
|
|
3002
3041
|
searchType: t,
|
|
3003
3042
|
searchId: o,
|
|
@@ -3017,59 +3056,59 @@ function vn({
|
|
|
3017
3056
|
a = `Found ${e.length} ${d} for ${t} ${o}${c}`, r && (a += " • More available");
|
|
3018
3057
|
}
|
|
3019
3058
|
if (n) {
|
|
3020
|
-
const i =
|
|
3059
|
+
const i = Xt([], n);
|
|
3021
3060
|
return `${a}
|
|
3022
3061
|
${i}`;
|
|
3023
3062
|
}
|
|
3024
3063
|
return a;
|
|
3025
3064
|
}
|
|
3026
|
-
function
|
|
3065
|
+
function es(e) {
|
|
3027
3066
|
const t = e.getUTCFullYear(), o = String(e.getUTCMonth() + 1).padStart(2, "0"), r = String(e.getUTCDate()).padStart(2, "0");
|
|
3028
3067
|
return `${t}-${o}-${r}`;
|
|
3029
3068
|
}
|
|
3030
|
-
function
|
|
3069
|
+
function Dn(e) {
|
|
3031
3070
|
const t = /^([+-])(\d{2}):(\d{2})$/.exec(e);
|
|
3032
3071
|
if (!t)
|
|
3033
3072
|
return 0;
|
|
3034
3073
|
const [, o, r, n] = t, a = Number(r) * 60 + Number(n);
|
|
3035
3074
|
return o === "-" ? -a : a;
|
|
3036
3075
|
}
|
|
3037
|
-
function
|
|
3076
|
+
function An(e, t) {
|
|
3038
3077
|
const o = new Date(e.getTime() + t * 60 * 1e3);
|
|
3039
|
-
return
|
|
3078
|
+
return es(o);
|
|
3040
3079
|
}
|
|
3041
|
-
function
|
|
3080
|
+
function Tt(e, t) {
|
|
3042
3081
|
const [o, r, n] = e.split("-"), a = Number(o), i = Number(r), c = Number(n);
|
|
3043
3082
|
if (!Number.isFinite(a) || !Number.isFinite(i) || !Number.isFinite(c))
|
|
3044
3083
|
throw new Error(`Invalid date format: ${e}. Expected YYYY-MM-DD.`);
|
|
3045
3084
|
const d = new Date(Date.UTC(a, i - 1, c));
|
|
3046
|
-
return d.setUTCDate(d.getUTCDate() + t),
|
|
3085
|
+
return d.setUTCDate(d.getUTCDate() + t), es(d);
|
|
3047
3086
|
}
|
|
3048
|
-
const
|
|
3087
|
+
const xn = ["and", "or"], ct = {
|
|
3049
3088
|
labels: s.string().array().optional().describe("The labels to filter the tasks by"),
|
|
3050
|
-
labelsOperator: s.enum(
|
|
3089
|
+
labelsOperator: s.enum(xn).optional().describe(
|
|
3051
3090
|
'The operator to use when filtering by labels. This will dictate whether a task has all labels, or some of them. Default is "or".'
|
|
3052
3091
|
)
|
|
3053
3092
|
};
|
|
3054
|
-
function
|
|
3093
|
+
function dt(e = [], t = "or") {
|
|
3055
3094
|
if (e.length === 0) return "";
|
|
3056
3095
|
const o = t === "and" ? " & " : " | ";
|
|
3057
3096
|
return `(${e.map((a) => a.startsWith("@") ? a : `@${a}`).join(` ${o} `)})`;
|
|
3058
3097
|
}
|
|
3059
|
-
const
|
|
3060
|
-
function
|
|
3098
|
+
const En = 7;
|
|
3099
|
+
function On({
|
|
3061
3100
|
since: e,
|
|
3062
3101
|
until: t,
|
|
3063
3102
|
userGmtOffset: o,
|
|
3064
3103
|
now: r = /* @__PURE__ */ new Date()
|
|
3065
3104
|
}) {
|
|
3066
|
-
const n =
|
|
3105
|
+
const n = Dn(o), a = An(r, n), i = En - 1, c = t ?? (e ? Tt(e, i) : a);
|
|
3067
3106
|
return {
|
|
3068
|
-
since: e ??
|
|
3107
|
+
since: e ?? Tt(c, -i),
|
|
3069
3108
|
until: c
|
|
3070
3109
|
};
|
|
3071
3110
|
}
|
|
3072
|
-
const
|
|
3111
|
+
const Un = {
|
|
3073
3112
|
getBy: s.enum(["completion", "due"]).default("completion").describe(
|
|
3074
3113
|
'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).'
|
|
3075
3114
|
),
|
|
@@ -3092,18 +3131,18 @@ const Dn = {
|
|
|
3092
3131
|
cursor: s.string().optional().describe(
|
|
3093
3132
|
"The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters)."
|
|
3094
3133
|
),
|
|
3095
|
-
...
|
|
3096
|
-
},
|
|
3134
|
+
...ct
|
|
3135
|
+
}, Pn = {
|
|
3097
3136
|
tasks: s.array(J).describe("The found completed tasks."),
|
|
3098
3137
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
3099
3138
|
totalCount: s.number().describe("The total number of tasks in this page."),
|
|
3100
3139
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
3101
3140
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
3102
|
-
},
|
|
3141
|
+
}, _n = {
|
|
3103
3142
|
name: f.FIND_COMPLETED_TASKS,
|
|
3104
3143
|
description: "Get completed tasks. 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.",
|
|
3105
|
-
parameters:
|
|
3106
|
-
outputSchema:
|
|
3144
|
+
parameters: Un,
|
|
3145
|
+
outputSchema: Pn,
|
|
3107
3146
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3108
3147
|
async execute(e, t) {
|
|
3109
3148
|
const { getBy: o, labels: r, labelsOperator: n, since: a, until: i, responsibleUser: c, projectId: d, ...l } = e;
|
|
@@ -3111,13 +3150,13 @@ const Dn = {
|
|
|
3111
3150
|
throw new Error(
|
|
3112
3151
|
"Cursor pagination requires explicit since and until. Reuse structuredContent.appliedFilters.since and structuredContent.appliedFilters.until from the previous page."
|
|
3113
3152
|
);
|
|
3114
|
-
const p = await
|
|
3115
|
-
let h =
|
|
3153
|
+
const p = await tt(t, c), u = p?.email;
|
|
3154
|
+
let h = dt(r, n);
|
|
3116
3155
|
p && u && (h = ae(h, `assigned to: ${u}`));
|
|
3117
3156
|
const k = await t.getUser(), b = k.tzInfo?.gmtString || "+00:00", C = await K({
|
|
3118
3157
|
projectId: d,
|
|
3119
3158
|
user: k
|
|
3120
|
-
}), I =
|
|
3159
|
+
}), I = On({
|
|
3121
3160
|
since: a,
|
|
3122
3161
|
until: i,
|
|
3123
3162
|
userGmtOffset: b
|
|
@@ -3139,7 +3178,7 @@ const Dn = {
|
|
|
3139
3178
|
...h ? { filterQuery: h, filterLang: "en" } : {}
|
|
3140
3179
|
}), S = v.map(_);
|
|
3141
3180
|
return {
|
|
3142
|
-
textContent:
|
|
3181
|
+
textContent: Rn({
|
|
3143
3182
|
tasks: S,
|
|
3144
3183
|
args: R,
|
|
3145
3184
|
nextCursor: $,
|
|
@@ -3155,7 +3194,7 @@ const Dn = {
|
|
|
3155
3194
|
};
|
|
3156
3195
|
}
|
|
3157
3196
|
};
|
|
3158
|
-
function
|
|
3197
|
+
function Rn({
|
|
3159
3198
|
tasks: e,
|
|
3160
3199
|
args: t,
|
|
3161
3200
|
nextCursor: o,
|
|
@@ -3181,26 +3220,26 @@ function En({
|
|
|
3181
3220
|
zeroReasonHints: c
|
|
3182
3221
|
});
|
|
3183
3222
|
}
|
|
3184
|
-
const
|
|
3223
|
+
const Nn = {
|
|
3185
3224
|
searchText: s.string().optional().describe(
|
|
3186
3225
|
'Search for a goal by name (partial and case insensitive match). Supports wildcards (e.g. "ship*"). If omitted, all goals are returned.'
|
|
3187
3226
|
),
|
|
3188
|
-
ownerType: s.enum(
|
|
3227
|
+
ownerType: s.enum(Ss).optional().describe("Filter by ownership type. Omit for all accessible goals."),
|
|
3189
3228
|
limit: s.number().int().min(1).max(j.GOALS_MAX).default(j.GOALS_DEFAULT).describe("The maximum number of goals to return per page."),
|
|
3190
3229
|
cursor: s.string().optional().describe(
|
|
3191
3230
|
"The cursor to get the next page of goals (cursor is obtained from the previous call to this tool, with the same parameters)."
|
|
3192
3231
|
)
|
|
3193
|
-
},
|
|
3232
|
+
}, Ln = {
|
|
3194
3233
|
goals: s.array(Se).describe("The found goals."),
|
|
3195
3234
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
3196
3235
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
3197
3236
|
totalCount: s.number().describe("The total number of goals returned in this page."),
|
|
3198
3237
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
3199
|
-
},
|
|
3238
|
+
}, Mn = {
|
|
3200
3239
|
name: f.FIND_GOALS,
|
|
3201
3240
|
description: "Search for goals by name or list all accessible goals. Results are paginated — use the returned `nextCursor` to fetch subsequent pages.",
|
|
3202
|
-
parameters:
|
|
3203
|
-
outputSchema:
|
|
3241
|
+
parameters: Nn,
|
|
3242
|
+
outputSchema: Ln,
|
|
3204
3243
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3205
3244
|
async execute(e, t) {
|
|
3206
3245
|
const o = e.searchText ? await t.searchGoals({
|
|
@@ -3238,7 +3277,7 @@ const On = {
|
|
|
3238
3277
|
}
|
|
3239
3278
|
};
|
|
3240
3279
|
}
|
|
3241
|
-
},
|
|
3280
|
+
}, Fn = {
|
|
3242
3281
|
searchText: s.string().optional().describe(
|
|
3243
3282
|
'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.'
|
|
3244
3283
|
),
|
|
@@ -3246,7 +3285,7 @@ const On = {
|
|
|
3246
3285
|
cursor: s.string().optional().describe(
|
|
3247
3286
|
"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."
|
|
3248
3287
|
)
|
|
3249
|
-
},
|
|
3288
|
+
}, Hn = {
|
|
3250
3289
|
labels: s.array(pe).describe("The found personal labels."),
|
|
3251
3290
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
3252
3291
|
totalCount: s.number().describe("The total number of labels in this page."),
|
|
@@ -3255,22 +3294,22 @@ const On = {
|
|
|
3255
3294
|
"Names of all shared labels visible to you. These have no IDs or metadata — use their names directly when filtering tasks."
|
|
3256
3295
|
),
|
|
3257
3296
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
3258
|
-
},
|
|
3297
|
+
}, Wn = {
|
|
3259
3298
|
name: f.FIND_LABELS,
|
|
3260
3299
|
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.",
|
|
3261
|
-
parameters:
|
|
3262
|
-
outputSchema:
|
|
3300
|
+
parameters: Fn,
|
|
3301
|
+
outputSchema: Hn,
|
|
3263
3302
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3264
3303
|
async execute(e, t) {
|
|
3265
3304
|
const [o, r] = await Promise.all([
|
|
3266
|
-
e.searchText ?
|
|
3305
|
+
e.searchText ? Fo(t, e.searchText).then((c) => ({
|
|
3267
3306
|
results: c,
|
|
3268
3307
|
nextCursor: null
|
|
3269
3308
|
})) : t.getLabels({ limit: e.limit, cursor: e.cursor ?? null }),
|
|
3270
|
-
|
|
3309
|
+
Ho(t)
|
|
3271
3310
|
]), { results: n, nextCursor: a } = o, i = e.searchText ? { searchText: e.searchText } : { limit: e.limit, cursor: e.cursor };
|
|
3272
3311
|
return {
|
|
3273
|
-
textContent:
|
|
3312
|
+
textContent: Gn({ labels: n, args: e, nextCursor: a, sharedLabels: r }),
|
|
3274
3313
|
structuredContent: {
|
|
3275
3314
|
labels: n.map((c) => pe.parse(c)),
|
|
3276
3315
|
nextCursor: a ?? void 0,
|
|
@@ -3282,7 +3321,7 @@ const On = {
|
|
|
3282
3321
|
};
|
|
3283
3322
|
}
|
|
3284
3323
|
};
|
|
3285
|
-
function
|
|
3324
|
+
function Gn({
|
|
3286
3325
|
labels: e,
|
|
3287
3326
|
args: t,
|
|
3288
3327
|
nextCursor: o,
|
|
@@ -3290,7 +3329,7 @@ function Ln({
|
|
|
3290
3329
|
}) {
|
|
3291
3330
|
const n = t.searchText ? `All labels matching "${t.searchText}"` : "Labels", a = [];
|
|
3292
3331
|
t.searchText && a.push(`searchText: "${t.searchText}"`);
|
|
3293
|
-
const i = 10, d = e.slice(0, i).map(
|
|
3332
|
+
const i = 10, d = e.slice(0, i).map(Gr).join(`
|
|
3294
3333
|
`), l = e.length - i, p = l > 0 ? `${d}
|
|
3295
3334
|
…and ${l} more` : d, u = [];
|
|
3296
3335
|
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"));
|
|
@@ -3307,15 +3346,15 @@ No shared labels.`;
|
|
|
3307
3346
|
zeroReasonHints: u
|
|
3308
3347
|
}) + m;
|
|
3309
3348
|
}
|
|
3310
|
-
const { FIND_PROJECTS:
|
|
3349
|
+
const { FIND_PROJECTS: ts, ADD_TASKS: ss, UPDATE_TASKS: os } = f, Bn = {
|
|
3311
3350
|
projectId: s.string().min(1).optional().describe(
|
|
3312
3351
|
'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.'
|
|
3313
3352
|
),
|
|
3314
3353
|
searchTerm: s.string().optional().describe(
|
|
3315
3354
|
"Search for a user by name or email (partial and case insensitive match). If omitted, all users are returned."
|
|
3316
3355
|
)
|
|
3317
|
-
},
|
|
3318
|
-
collaborators: s.array(
|
|
3356
|
+
}, Yn = {
|
|
3357
|
+
collaborators: s.array(Jo).describe("The found users."),
|
|
3319
3358
|
projectInfo: s.object({
|
|
3320
3359
|
id: s.string().describe("The project ID."),
|
|
3321
3360
|
name: s.string().describe("The project name."),
|
|
@@ -3324,16 +3363,16 @@ const { FIND_PROJECTS: Xt, ADD_TASKS: Zt, UPDATE_TASKS: Qt } = f, Mn = {
|
|
|
3324
3363
|
totalCount: s.number().describe("The total number of users found."),
|
|
3325
3364
|
totalAvailable: s.number().optional().describe("The total number of available users before the search filter was applied."),
|
|
3326
3365
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
3327
|
-
},
|
|
3366
|
+
}, qn = {
|
|
3328
3367
|
name: f.FIND_PROJECT_COLLABORATORS,
|
|
3329
3368
|
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.`,
|
|
3330
|
-
parameters:
|
|
3331
|
-
outputSchema:
|
|
3369
|
+
parameters: Bn,
|
|
3370
|
+
outputSchema: Yn,
|
|
3332
3371
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3333
3372
|
async execute(e, t) {
|
|
3334
3373
|
const { projectId: o, searchTerm: r } = e;
|
|
3335
3374
|
if (!o)
|
|
3336
|
-
return
|
|
3375
|
+
return zn({ searchTerm: r, client: t, appliedFilters: e });
|
|
3337
3376
|
let n = o, a;
|
|
3338
3377
|
try {
|
|
3339
3378
|
if (a = await t.getProject(o), !a)
|
|
@@ -3344,7 +3383,7 @@ const { FIND_PROJECTS: Xt, ADD_TASKS: Zt, UPDATE_TASKS: Qt } = f, Mn = {
|
|
|
3344
3383
|
|
|
3345
3384
|
**Next steps:**
|
|
3346
3385
|
• Share the project to enable collaboration
|
|
3347
|
-
• Use ${
|
|
3386
|
+
• Use ${ss} and ${os} for assignment features once shared`,
|
|
3348
3387
|
structuredContent: {
|
|
3349
3388
|
collaborators: [],
|
|
3350
3389
|
projectInfo: {
|
|
@@ -3381,9 +3420,9 @@ const { FIND_PROJECTS: Xt, ADD_TASKS: Zt, UPDATE_TASKS: Qt } = f, Mn = {
|
|
|
3381
3420
|
appliedFilters: e
|
|
3382
3421
|
}
|
|
3383
3422
|
};
|
|
3384
|
-
const c =
|
|
3423
|
+
const c = rs(i, r);
|
|
3385
3424
|
return {
|
|
3386
|
-
textContent:
|
|
3425
|
+
textContent: ns({
|
|
3387
3426
|
collaborators: c,
|
|
3388
3427
|
projectName: n,
|
|
3389
3428
|
searchTerm: r,
|
|
@@ -3403,18 +3442,18 @@ const { FIND_PROJECTS: Xt, ADD_TASKS: Zt, UPDATE_TASKS: Qt } = f, Mn = {
|
|
|
3403
3442
|
};
|
|
3404
3443
|
}
|
|
3405
3444
|
};
|
|
3406
|
-
async function
|
|
3445
|
+
async function zn({
|
|
3407
3446
|
searchTerm: e,
|
|
3408
3447
|
client: t,
|
|
3409
3448
|
appliedFilters: o
|
|
3410
3449
|
}) {
|
|
3411
|
-
const r = await G.getAllCollaborators(t), n = await
|
|
3450
|
+
const r = await G.getAllCollaborators(t), n = await Kn(t, r);
|
|
3412
3451
|
if (n.length === 0)
|
|
3413
3452
|
return {
|
|
3414
3453
|
textContent: `No users found. You may have no shared projects, or collaborator data is not accessible.
|
|
3415
3454
|
|
|
3416
3455
|
**Next steps:**
|
|
3417
|
-
• Use ${
|
|
3456
|
+
• Use ${ts} to find shared projects
|
|
3418
3457
|
• Share a project to add collaborators
|
|
3419
3458
|
• Ensure you have permission to view collaborators`,
|
|
3420
3459
|
structuredContent: {
|
|
@@ -3425,9 +3464,9 @@ async function Wn({
|
|
|
3425
3464
|
appliedFilters: o
|
|
3426
3465
|
}
|
|
3427
3466
|
};
|
|
3428
|
-
const a =
|
|
3467
|
+
const a = rs(n, e);
|
|
3429
3468
|
return {
|
|
3430
|
-
textContent:
|
|
3469
|
+
textContent: ns({
|
|
3431
3470
|
collaborators: a,
|
|
3432
3471
|
projectName: void 0,
|
|
3433
3472
|
searchTerm: e,
|
|
@@ -3442,7 +3481,7 @@ async function Wn({
|
|
|
3442
3481
|
}
|
|
3443
3482
|
};
|
|
3444
3483
|
}
|
|
3445
|
-
async function
|
|
3484
|
+
async function Kn(e, t) {
|
|
3446
3485
|
try {
|
|
3447
3486
|
const o = await e.getUser();
|
|
3448
3487
|
return !o || t.some((r) => r.id === o.id) ? t : [
|
|
@@ -3453,7 +3492,7 @@ async function Gn(e, t) {
|
|
|
3453
3492
|
return t;
|
|
3454
3493
|
}
|
|
3455
3494
|
}
|
|
3456
|
-
function
|
|
3495
|
+
function rs(e, t) {
|
|
3457
3496
|
if (!t)
|
|
3458
3497
|
return e;
|
|
3459
3498
|
const o = t.toLowerCase().trim();
|
|
@@ -3461,7 +3500,7 @@ function es(e, t) {
|
|
|
3461
3500
|
(r) => r.name.toLowerCase().includes(o) || r.email.toLowerCase().includes(o)
|
|
3462
3501
|
);
|
|
3463
3502
|
}
|
|
3464
|
-
function
|
|
3503
|
+
function ns({
|
|
3465
3504
|
collaborators: e,
|
|
3466
3505
|
projectName: t,
|
|
3467
3506
|
searchTerm: o,
|
|
@@ -3477,7 +3516,7 @@ function ts({
|
|
|
3477
3516
|
const l = [];
|
|
3478
3517
|
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`));
|
|
3479
3518
|
const p = [];
|
|
3480
|
-
return e.length > 0 ? (p.push(`Use ${
|
|
3519
|
+
return e.length > 0 ? (p.push(`Use ${ss} with responsibleUser to assign new tasks`), p.push(`Use ${os} with responsibleUser to reassign existing tasks`), p.push("Use user names, emails, or IDs for assignments")) : (p.push(`Use ${ts} to find other projects`), o && r > 0 && p.push("Try searching without filters to see all users")), M({
|
|
3481
3520
|
subject: i,
|
|
3482
3521
|
count: e.length,
|
|
3483
3522
|
filterHints: c,
|
|
@@ -3487,11 +3526,11 @@ function ts({
|
|
|
3487
3526
|
nextSteps: p
|
|
3488
3527
|
});
|
|
3489
3528
|
}
|
|
3490
|
-
const { ADD_PROJECTS:
|
|
3529
|
+
const { ADD_PROJECTS: wt } = f, Vn = {
|
|
3491
3530
|
active: "projects",
|
|
3492
3531
|
archived: "archived projects",
|
|
3493
3532
|
all: "projects (active and archived)"
|
|
3494
|
-
},
|
|
3533
|
+
}, Jn = {
|
|
3495
3534
|
searchText: s.string().optional().describe(
|
|
3496
3535
|
'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.'
|
|
3497
3536
|
),
|
|
@@ -3502,26 +3541,26 @@ const { ADD_PROJECTS: Tt } = f, Bn = {
|
|
|
3502
3541
|
archivedStatus: s.enum(["active", "archived", "all"]).optional().describe(
|
|
3503
3542
|
"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')."
|
|
3504
3543
|
)
|
|
3505
|
-
},
|
|
3544
|
+
}, Xn = {
|
|
3506
3545
|
projects: s.array(ue).describe("The found projects."),
|
|
3507
3546
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
3508
3547
|
totalCount: s.number().describe("The total number of projects in this page."),
|
|
3509
3548
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
3510
3549
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
3511
|
-
},
|
|
3550
|
+
}, Zn = {
|
|
3512
3551
|
name: f.FIND_PROJECTS,
|
|
3513
3552
|
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.",
|
|
3514
|
-
parameters:
|
|
3515
|
-
outputSchema:
|
|
3553
|
+
parameters: Jn,
|
|
3554
|
+
outputSchema: Xn,
|
|
3516
3555
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3517
3556
|
async execute(e, t) {
|
|
3518
3557
|
const { searchText: o } = e, r = e.archivedStatus ?? "active";
|
|
3519
3558
|
let n, a = null;
|
|
3520
3559
|
if (o || r === "all") {
|
|
3521
3560
|
const c = Promise.resolve([]), [d, l] = await Promise.all([
|
|
3522
|
-
r === "archived" ? c : o ?
|
|
3523
|
-
r === "active" ? c :
|
|
3524
|
-
]), p = o ?
|
|
3561
|
+
r === "archived" ? c : o ? qt(t, o) : No(t),
|
|
3562
|
+
r === "active" ? c : Lo(t)
|
|
3563
|
+
]), p = o ? Mo(o) : null, u = p ? l.filter((m) => p.test(m.name)) : l;
|
|
3525
3564
|
n = [...d, ...u];
|
|
3526
3565
|
} else {
|
|
3527
3566
|
const c = r === "archived" ? await t.getArchivedProjects({
|
|
@@ -3532,7 +3571,7 @@ const { ADD_PROJECTS: Tt } = f, Bn = {
|
|
|
3532
3571
|
}
|
|
3533
3572
|
const i = n.map(V);
|
|
3534
3573
|
return {
|
|
3535
|
-
textContent:
|
|
3574
|
+
textContent: Qn({ projects: i, args: e, nextCursor: a }),
|
|
3536
3575
|
structuredContent: {
|
|
3537
3576
|
projects: i,
|
|
3538
3577
|
nextCursor: a ?? void 0,
|
|
@@ -3543,17 +3582,17 @@ const { ADD_PROJECTS: Tt } = f, Bn = {
|
|
|
3543
3582
|
};
|
|
3544
3583
|
}
|
|
3545
3584
|
};
|
|
3546
|
-
function
|
|
3585
|
+
function Qn({
|
|
3547
3586
|
projects: e,
|
|
3548
3587
|
args: t,
|
|
3549
3588
|
nextCursor: o
|
|
3550
3589
|
}) {
|
|
3551
|
-
const r =
|
|
3590
|
+
const r = Vn[t.archivedStatus ?? "active"], n = t.searchText ? `All ${r} matching "${t.searchText}"` : `${r.charAt(0).toUpperCase()}${r.slice(1)}`, a = [];
|
|
3552
3591
|
t.searchText && a.push(`searchText: "${t.searchText}"`), t.archivedStatus && t.archivedStatus !== "active" && a.push(`archivedStatus: "${t.archivedStatus}"`);
|
|
3553
|
-
const i = 10, d = e.slice(0, i).map(
|
|
3592
|
+
const i = 10, d = e.slice(0, i).map(Br).join(`
|
|
3554
3593
|
`), l = e.length - i, p = l > 0 ? `${d}
|
|
3555
3594
|
…and ${l} more` : d, u = [];
|
|
3556
|
-
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 ${
|
|
3595
|
+
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 ${wt} to create a project`)) : (u.push("No active projects"), u.push("Use archivedStatus: 'all' to include archived projects"), u.push(`Use ${wt} to create a project`))), M({
|
|
3557
3596
|
subject: n,
|
|
3558
3597
|
count: e.length,
|
|
3559
3598
|
limit: t.searchText || t.archivedStatus === "all" ? void 0 : t.limit,
|
|
@@ -3563,22 +3602,22 @@ function Kn({
|
|
|
3563
3602
|
zeroReasonHints: u
|
|
3564
3603
|
});
|
|
3565
3604
|
}
|
|
3566
|
-
const
|
|
3605
|
+
const ea = {
|
|
3567
3606
|
taskId: s.string().optional().describe(
|
|
3568
3607
|
"Find all reminders for a specific task. Returns both time-based and location reminders."
|
|
3569
3608
|
),
|
|
3570
3609
|
reminderId: s.string().optional().describe("Get a specific time-based reminder (relative or absolute) by its ID."),
|
|
3571
3610
|
locationReminderId: s.string().optional().describe("Get a specific location reminder by its ID.")
|
|
3572
|
-
},
|
|
3573
|
-
reminders: s.array(
|
|
3611
|
+
}, ta = {
|
|
3612
|
+
reminders: s.array(rt).describe("The found reminders (time-based and location)."),
|
|
3574
3613
|
searchType: s.string().describe('The search type used: "task", "reminder", or "location_reminder".'),
|
|
3575
3614
|
searchId: s.string().describe("The ID used for the search."),
|
|
3576
3615
|
totalCount: s.number().describe("Total reminders in this response.")
|
|
3577
|
-
},
|
|
3616
|
+
}, sa = {
|
|
3578
3617
|
name: f.FIND_REMINDERS,
|
|
3579
3618
|
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.",
|
|
3580
|
-
parameters:
|
|
3581
|
-
outputSchema:
|
|
3619
|
+
parameters: ea,
|
|
3620
|
+
outputSchema: ta,
|
|
3582
3621
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3583
3622
|
async execute(e, t) {
|
|
3584
3623
|
const { taskId: o, reminderId: r, locationReminderId: n } = e, a = [o, r, n].filter(Boolean);
|
|
@@ -3624,7 +3663,7 @@ const Vn = {
|
|
|
3624
3663
|
})
|
|
3625
3664
|
]), l = [...i, ...c].map(he);
|
|
3626
3665
|
return {
|
|
3627
|
-
textContent:
|
|
3666
|
+
textContent: oa(l, o),
|
|
3628
3667
|
structuredContent: {
|
|
3629
3668
|
reminders: l,
|
|
3630
3669
|
searchType: "task",
|
|
@@ -3636,10 +3675,10 @@ const Vn = {
|
|
|
3636
3675
|
throw new Error("One of taskId, reminderId, or locationReminderId must be provided.");
|
|
3637
3676
|
}
|
|
3638
3677
|
};
|
|
3639
|
-
function
|
|
3678
|
+
function oa(e, t) {
|
|
3640
3679
|
if (e.length === 0)
|
|
3641
3680
|
return `No reminders found for task ${t}`;
|
|
3642
|
-
const { timeBasedCount: o, locationCount: r } =
|
|
3681
|
+
const { timeBasedCount: o, locationCount: r } = zt(e), n = [];
|
|
3643
3682
|
if (o > 0) {
|
|
3644
3683
|
const a = o > 1 ? "time-based reminders" : "time-based reminder";
|
|
3645
3684
|
n.push(`${o} ${a}`);
|
|
@@ -3650,22 +3689,22 @@ function Zn(e, t) {
|
|
|
3650
3689
|
}
|
|
3651
3690
|
return `Found ${n.join(" and ")} for task ${t}`;
|
|
3652
3691
|
}
|
|
3653
|
-
const { ADD_SECTIONS:
|
|
3692
|
+
const { ADD_SECTIONS: ra } = f, na = {
|
|
3654
3693
|
projectId: s.string().min(1).describe(
|
|
3655
3694
|
'The ID of the project to search sections in. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
3656
3695
|
),
|
|
3657
3696
|
searchText: s.string().optional().describe(
|
|
3658
3697
|
'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.'
|
|
3659
3698
|
)
|
|
3660
|
-
},
|
|
3699
|
+
}, aa = {
|
|
3661
3700
|
sections: s.array(ce).describe("The found sections."),
|
|
3662
3701
|
totalCount: s.number().describe("The total number of sections found."),
|
|
3663
3702
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
3664
|
-
},
|
|
3703
|
+
}, ia = {
|
|
3665
3704
|
name: f.FIND_SECTIONS,
|
|
3666
3705
|
description: "Search for sections by name or other criteria in a project. When searching, uses server-side search to avoid fetching all sections.",
|
|
3667
|
-
parameters:
|
|
3668
|
-
outputSchema:
|
|
3706
|
+
parameters: na,
|
|
3707
|
+
outputSchema: aa,
|
|
3669
3708
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3670
3709
|
async execute(e, t) {
|
|
3671
3710
|
const o = await K({
|
|
@@ -3673,12 +3712,12 @@ const { ADD_SECTIONS: Qn } = f, ea = {
|
|
|
3673
3712
|
client: t
|
|
3674
3713
|
});
|
|
3675
3714
|
let r;
|
|
3676
|
-
e.searchText ? r = await
|
|
3715
|
+
e.searchText ? r = await Wo(t, e.searchText, o) : r = (await t.getSections({
|
|
3677
3716
|
projectId: o
|
|
3678
3717
|
})).results;
|
|
3679
3718
|
const n = r.map(X);
|
|
3680
3719
|
return {
|
|
3681
|
-
textContent:
|
|
3720
|
+
textContent: ca({
|
|
3682
3721
|
sections: n,
|
|
3683
3722
|
projectId: e.projectId,
|
|
3684
3723
|
searchText: e.searchText
|
|
@@ -3691,13 +3730,13 @@ const { ADD_SECTIONS: Qn } = f, ea = {
|
|
|
3691
3730
|
};
|
|
3692
3731
|
}
|
|
3693
3732
|
};
|
|
3694
|
-
function
|
|
3733
|
+
function ca({
|
|
3695
3734
|
sections: e,
|
|
3696
3735
|
projectId: t,
|
|
3697
3736
|
searchText: o
|
|
3698
3737
|
}) {
|
|
3699
3738
|
const r = [];
|
|
3700
|
-
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 ${
|
|
3739
|
+
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 ${ra} to create sections`));
|
|
3701
3740
|
const n = o ? `Sections in project ${t} matching "${o}"` : `Sections in project ${t}`, a = e.length > 0 ? e.map((i) => ` ${i.name} • id=${i.id}`).join(`
|
|
3702
3741
|
`) : void 0;
|
|
3703
3742
|
return M({
|
|
@@ -3707,10 +3746,10 @@ function oa({
|
|
|
3707
3746
|
zeroReasonHints: r
|
|
3708
3747
|
});
|
|
3709
3748
|
}
|
|
3710
|
-
function
|
|
3749
|
+
function as(e) {
|
|
3711
3750
|
return /* @__PURE__ */ new Date(`${e}T00:00:00`);
|
|
3712
3751
|
}
|
|
3713
|
-
const
|
|
3752
|
+
const da = {
|
|
3714
3753
|
startDate: s.string().regex(/^(\d{4}-\d{2}-\d{2}|today)$/).optional().describe("The start date to get the tasks for. Format: YYYY-MM-DD or 'today'."),
|
|
3715
3754
|
overdueOption: s.enum(["overdue-only", "include-overdue", "exclude-overdue"]).optional().describe(
|
|
3716
3755
|
"How to handle overdue tasks. 'overdue-only' to get only overdue tasks, 'include-overdue' to include overdue tasks along with tasks for the specified date(s), and 'exclude-overdue' to exclude overdue tasks. Default is 'include-overdue'."
|
|
@@ -3725,57 +3764,57 @@ const ra = {
|
|
|
3725
3764
|
responsibleUser: s.string().optional().describe(
|
|
3726
3765
|
"Filter tasks assigned to this user. User ID, name, or email. For personal queries (summaries, plans, reports), set to current user from user-info to exclude collaborators."
|
|
3727
3766
|
),
|
|
3728
|
-
responsibleUserFiltering: s.enum(
|
|
3767
|
+
responsibleUserFiltering: s.enum(Bt).optional().describe(
|
|
3729
3768
|
"Filter when responsibleUser is omitted. 'assigned'=assigned to others; 'unassignedOrMe'=unassigned+mine; 'all'=everyone. Default: 'unassignedOrMe'."
|
|
3730
3769
|
),
|
|
3731
|
-
...
|
|
3732
|
-
},
|
|
3770
|
+
...ct
|
|
3771
|
+
}, la = {
|
|
3733
3772
|
tasks: s.array(J).describe("The found tasks."),
|
|
3734
3773
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
3735
3774
|
totalCount: s.number().describe("The total number of tasks in this page."),
|
|
3736
3775
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
3737
3776
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
3738
|
-
},
|
|
3777
|
+
}, ua = {
|
|
3739
3778
|
name: f.FIND_TASKS_BY_DATE,
|
|
3740
3779
|
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.",
|
|
3741
|
-
parameters:
|
|
3742
|
-
outputSchema:
|
|
3780
|
+
parameters: da,
|
|
3781
|
+
outputSchema: la,
|
|
3743
3782
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3744
3783
|
async execute(e, t) {
|
|
3745
3784
|
if (!e.startDate && e.overdueOption !== "overdue-only")
|
|
3746
3785
|
throw new Error(
|
|
3747
3786
|
"Either startDate must be provided or overdueOption must be set to overdue-only"
|
|
3748
3787
|
);
|
|
3749
|
-
const o = await
|
|
3788
|
+
const o = await tt(t, e.responsibleUser), r = o?.userId, n = o?.email;
|
|
3750
3789
|
let a = "";
|
|
3751
3790
|
if (e.overdueOption === "overdue-only")
|
|
3752
3791
|
a = "overdue";
|
|
3753
3792
|
else if (e.startDate === "today")
|
|
3754
3793
|
if (e.daysCount > 1) {
|
|
3755
|
-
const u = /* @__PURE__ */ new Date(), m = re(u), h = Fe(u, e.daysCount), k =
|
|
3794
|
+
const u = /* @__PURE__ */ new Date(), m = re(u), h = Fe(u, e.daysCount), k = lt(h, { representation: "date" }), b = `(due after: ${m} | due: ${m}) & due before: ${k}`;
|
|
3756
3795
|
a = e.overdueOption === "exclude-overdue" ? b : `(${b} | overdue)`;
|
|
3757
3796
|
} else
|
|
3758
3797
|
a = e.overdueOption === "exclude-overdue" ? "today" : "(today | overdue)";
|
|
3759
3798
|
else if (e.startDate) {
|
|
3760
|
-
const u = e.startDate, m = Fe(
|
|
3799
|
+
const u = e.startDate, m = Fe(as(u), e.daysCount), h = lt(m, { representation: "date" });
|
|
3761
3800
|
a = `(due after: ${u} | due: ${u}) & due before: ${h}`;
|
|
3762
3801
|
}
|
|
3763
|
-
const i =
|
|
3802
|
+
const i = dt(e.labels, e.labelsOperator);
|
|
3764
3803
|
i.length > 0 && (a = ae(a, `(${i})`));
|
|
3765
|
-
const c =
|
|
3804
|
+
const c = Yt({
|
|
3766
3805
|
resolvedAssigneeId: r,
|
|
3767
3806
|
assigneeEmail: n,
|
|
3768
3807
|
responsibleUserFiltering: e.responsibleUserFiltering
|
|
3769
3808
|
});
|
|
3770
3809
|
a = ae(a, c);
|
|
3771
|
-
const { tasks: d, nextCursor: l } = await
|
|
3810
|
+
const { tasks: d, nextCursor: l } = await ot({
|
|
3772
3811
|
client: t,
|
|
3773
3812
|
query: a,
|
|
3774
3813
|
cursor: e.cursor,
|
|
3775
3814
|
limit: e.limit
|
|
3776
3815
|
});
|
|
3777
3816
|
return {
|
|
3778
|
-
textContent:
|
|
3817
|
+
textContent: pa({ tasks: d, args: e, nextCursor: l, assigneeEmail: n }),
|
|
3779
3818
|
structuredContent: {
|
|
3780
3819
|
tasks: d,
|
|
3781
3820
|
nextCursor: l ?? void 0,
|
|
@@ -3786,7 +3825,7 @@ const ra = {
|
|
|
3786
3825
|
};
|
|
3787
3826
|
}
|
|
3788
3827
|
};
|
|
3789
|
-
function
|
|
3828
|
+
function pa({
|
|
3790
3829
|
tasks: e,
|
|
3791
3830
|
args: t,
|
|
3792
3831
|
nextCursor: o,
|
|
@@ -3801,7 +3840,7 @@ function ia({
|
|
|
3801
3840
|
`today${c}${t.daysCount > 1 ? ` + ${t.daysCount - 1} more days` : ""}`
|
|
3802
3841
|
);
|
|
3803
3842
|
} else if (t.startDate) {
|
|
3804
|
-
const c = t.daysCount > 1 ? ` to ${re(Fe(
|
|
3843
|
+
const c = t.daysCount > 1 ? ` to ${re(Fe(as(t.startDate), t.daysCount))}` : "";
|
|
3805
3844
|
n.push(`${t.startDate}${c}`);
|
|
3806
3845
|
}
|
|
3807
3846
|
if (t.labels && t.labels.length > 0) {
|
|
@@ -3836,13 +3875,13 @@ function ia({
|
|
|
3836
3875
|
zeroReasonHints: i
|
|
3837
3876
|
});
|
|
3838
3877
|
}
|
|
3839
|
-
const
|
|
3840
|
-
class
|
|
3878
|
+
const ma = 300 * 1e3;
|
|
3879
|
+
class ha {
|
|
3841
3880
|
constructor() {
|
|
3842
3881
|
this.cache = null;
|
|
3843
3882
|
}
|
|
3844
3883
|
async getFilters(t) {
|
|
3845
|
-
if (this.cache && Date.now() - this.cache.timestamp <
|
|
3884
|
+
if (this.cache && Date.now() - this.cache.timestamp < ma)
|
|
3846
3885
|
return this.cache.filters;
|
|
3847
3886
|
const r = ((await t.sync({
|
|
3848
3887
|
resourceTypes: ["filters"],
|
|
@@ -3899,7 +3938,7 @@ ${p}` + (d.length > 5 ? `
|
|
|
3899
3938
|
this.cache = null;
|
|
3900
3939
|
}
|
|
3901
3940
|
}
|
|
3902
|
-
const
|
|
3941
|
+
const fa = new ha(), { FIND_COMPLETED_TASKS: vt, ADD_TASKS: It } = f, ba = {
|
|
3903
3942
|
searchText: s.string().optional().describe("The text to search for in tasks."),
|
|
3904
3943
|
projectId: s.string().optional().describe(
|
|
3905
3944
|
'Find tasks in this project. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
@@ -3907,7 +3946,7 @@ const la = new da(), { FIND_COMPLETED_TASKS: wt, ADD_TASKS: vt } = f, ua = {
|
|
|
3907
3946
|
sectionId: s.string().optional().describe("Find tasks in this section."),
|
|
3908
3947
|
parentId: s.string().optional().describe("Find subtasks of this parent task."),
|
|
3909
3948
|
responsibleUser: s.string().optional().describe("Find tasks assigned to this user. Can be a user ID, name, or email address."),
|
|
3910
|
-
responsibleUserFiltering: s.enum(
|
|
3949
|
+
responsibleUserFiltering: s.enum(Bt).optional().describe(
|
|
3911
3950
|
'How to filter by responsible user when responsibleUser is not provided. "assigned" = only tasks assigned to others; "unassignedOrMe" = only unassigned tasks or tasks assigned to me; "all" = all tasks regardless of assignment. Default value will be `unassignedOrMe`.'
|
|
3912
3951
|
),
|
|
3913
3952
|
limit: s.number().int().min(1).max(j.TASKS_MAX).default(j.TASKS_DEFAULT).describe("The maximum number of tasks to return."),
|
|
@@ -3920,18 +3959,18 @@ const la = new da(), { FIND_COMPLETED_TASKS: wt, ADD_TASKS: vt } = f, ua = {
|
|
|
3920
3959
|
filterIdOrName: s.string().optional().describe(
|
|
3921
3960
|
"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."
|
|
3922
3961
|
),
|
|
3923
|
-
...
|
|
3924
|
-
},
|
|
3962
|
+
...ct
|
|
3963
|
+
}, ga = {
|
|
3925
3964
|
tasks: s.array(J).describe("The found tasks."),
|
|
3926
3965
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
3927
3966
|
totalCount: s.number().describe("The total number of tasks in this page."),
|
|
3928
3967
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
3929
3968
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
3930
|
-
},
|
|
3969
|
+
}, ya = {
|
|
3931
3970
|
name: f.FIND_TASKS,
|
|
3932
3971
|
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.",
|
|
3933
|
-
parameters:
|
|
3934
|
-
outputSchema:
|
|
3972
|
+
parameters: ba,
|
|
3973
|
+
outputSchema: ga,
|
|
3935
3974
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3936
3975
|
async execute(e, t) {
|
|
3937
3976
|
const {
|
|
@@ -3961,8 +4000,8 @@ const la = new da(), { FIND_COMPLETED_TASKS: wt, ADD_TASKS: vt } = f, ua = {
|
|
|
3961
4000
|
'The `filter`/`filterIdOrName` parameter cannot be combined with projectId, sectionId, or parentId. Use filter syntax instead (e.g. "##ProjectName").'
|
|
3962
4001
|
);
|
|
3963
4002
|
let C = m;
|
|
3964
|
-
h && (C = (await
|
|
3965
|
-
const I = await
|
|
4003
|
+
h && (C = (await fa.resolveFilter(t, h)).filterQuery);
|
|
4004
|
+
const I = await tt(t, i), x = I?.userId, w = I?.email;
|
|
3966
4005
|
if (r || n || a) {
|
|
3967
4006
|
const A = {
|
|
3968
4007
|
limit: d,
|
|
@@ -3973,7 +4012,7 @@ const la = new da(), { FIND_COMPLETED_TASKS: wt, ADD_TASKS: vt } = f, ua = {
|
|
|
3973
4012
|
let H = o ? Ae.filter(
|
|
3974
4013
|
(Z) => Z.content.toLowerCase().includes(o.toLowerCase()) || Z.description?.toLowerCase().includes(o.toLowerCase())
|
|
3975
4014
|
) : Ae;
|
|
3976
|
-
return H =
|
|
4015
|
+
return H = Ro({
|
|
3977
4016
|
tasks: H,
|
|
3978
4017
|
resolvedAssigneeId: x,
|
|
3979
4018
|
currentUserId: k.id,
|
|
@@ -4025,16 +4064,16 @@ const la = new da(), { FIND_COMPLETED_TASKS: wt, ADD_TASKS: vt } = f, ua = {
|
|
|
4025
4064
|
}
|
|
4026
4065
|
let y = C ? `(${C})` : "";
|
|
4027
4066
|
o && (y = ae(y, `search: ${o}`));
|
|
4028
|
-
const D =
|
|
4067
|
+
const D = dt(p, u);
|
|
4029
4068
|
if (y = ae(y, D), !(h && !i && !c)) {
|
|
4030
|
-
const A =
|
|
4069
|
+
const A = Yt({
|
|
4031
4070
|
resolvedAssigneeId: x,
|
|
4032
4071
|
assigneeEmail: w,
|
|
4033
4072
|
responsibleUserFiltering: c
|
|
4034
4073
|
});
|
|
4035
4074
|
y = ae(y, A);
|
|
4036
4075
|
}
|
|
4037
|
-
const { tasks: v, nextCursor: $ } = await
|
|
4076
|
+
const { tasks: v, nextCursor: $ } = await ot({
|
|
4038
4077
|
client: t,
|
|
4039
4078
|
query: y,
|
|
4040
4079
|
cursor: e.cursor,
|
|
@@ -4058,12 +4097,12 @@ const la = new da(), { FIND_COMPLETED_TASKS: wt, ADD_TASKS: vt } = f, ua = {
|
|
|
4058
4097
|
};
|
|
4059
4098
|
}
|
|
4060
4099
|
};
|
|
4061
|
-
function
|
|
4100
|
+
function ka(e) {
|
|
4062
4101
|
if (e.projectId) {
|
|
4063
4102
|
const t = [
|
|
4064
4103
|
e.searchText ? "No tasks in project match search" : "Project has no tasks yet"
|
|
4065
4104
|
];
|
|
4066
|
-
return e.searchText || t.push(`Use ${
|
|
4105
|
+
return e.searchText || t.push(`Use ${It} to create tasks`), t;
|
|
4067
4106
|
}
|
|
4068
4107
|
if (e.sectionId) {
|
|
4069
4108
|
const t = [e.searchText ? "No tasks in section match search" : "Section is empty"];
|
|
@@ -4071,7 +4110,7 @@ function ha(e) {
|
|
|
4071
4110
|
}
|
|
4072
4111
|
if (e.parentId) {
|
|
4073
4112
|
const t = [e.searchText ? "No subtasks match search" : "No subtasks created yet"];
|
|
4074
|
-
return e.searchText || t.push(`Use ${
|
|
4113
|
+
return e.searchText || t.push(`Use ${It} with parentId to add subtasks`), t;
|
|
4075
4114
|
}
|
|
4076
4115
|
return [];
|
|
4077
4116
|
}
|
|
@@ -4093,7 +4132,7 @@ function Pe({
|
|
|
4093
4132
|
const d = t.labels.map((l) => `@${l}`).join(t.labelsOperator === "and" ? " & " : " | ");
|
|
4094
4133
|
i.push(`labels: ${d}`);
|
|
4095
4134
|
}
|
|
4096
|
-
e.length === 0 && c.push(...
|
|
4135
|
+
e.length === 0 && c.push(...ka(t));
|
|
4097
4136
|
} else {
|
|
4098
4137
|
const d = n || t.responsibleUser, l = [];
|
|
4099
4138
|
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) {
|
|
@@ -4107,9 +4146,9 @@ function Pe({
|
|
|
4107
4146
|
if (e.length === 0) {
|
|
4108
4147
|
if (t.responsibleUser) {
|
|
4109
4148
|
const p = n || t.responsibleUser;
|
|
4110
|
-
c.push(`No tasks assigned to ${p}`), c.push("Check if the user name is correct"), c.push(`Check completed tasks with ${
|
|
4149
|
+
c.push(`No tasks assigned to ${p}`), c.push("Check if the user name is correct"), c.push(`Check completed tasks with ${vt}`);
|
|
4111
4150
|
}
|
|
4112
|
-
t.searchText && (c.push("Try broader search terms"), c.push("Verify spelling and try partial words"), t.responsibleUser || c.push(`Check completed tasks with ${
|
|
4151
|
+
t.searchText && (c.push("Try broader search terms"), c.push("Verify spelling and try partial words"), t.responsibleUser || c.push(`Check completed tasks with ${vt}`));
|
|
4113
4152
|
}
|
|
4114
4153
|
}
|
|
4115
4154
|
return M({
|
|
@@ -4122,11 +4161,11 @@ function Pe({
|
|
|
4122
4161
|
zeroReasonHints: c
|
|
4123
4162
|
});
|
|
4124
4163
|
}
|
|
4125
|
-
const
|
|
4164
|
+
const Ta = {
|
|
4126
4165
|
projectId: s.string().min(1).optional().describe(
|
|
4127
4166
|
"Optional project ID. If provided, shows detailed overview of that project. If omitted, shows overview of all projects."
|
|
4128
4167
|
)
|
|
4129
|
-
},
|
|
4168
|
+
}, is = s.lazy(
|
|
4130
4169
|
() => s.object({
|
|
4131
4170
|
id: s.string().describe("The project ID."),
|
|
4132
4171
|
name: s.string().describe("The project name."),
|
|
@@ -4139,9 +4178,9 @@ const fa = {
|
|
|
4139
4178
|
name: s.string()
|
|
4140
4179
|
})
|
|
4141
4180
|
),
|
|
4142
|
-
children: s.array(
|
|
4181
|
+
children: s.array(is).describe("Nested child projects.")
|
|
4143
4182
|
})
|
|
4144
|
-
),
|
|
4183
|
+
), wa = {
|
|
4145
4184
|
type: s.enum(["account_overview", "project_overview"]).describe("The type of overview returned."),
|
|
4146
4185
|
totalProjects: s.number().optional().describe("Total number of projects (account overview only)."),
|
|
4147
4186
|
totalTasks: s.number().optional().describe("Total number of tasks."),
|
|
@@ -4160,7 +4199,7 @@ const fa = {
|
|
|
4160
4199
|
name: s.string().describe("The inbox project name."),
|
|
4161
4200
|
sections: s.array(ce).describe("Sections in the inbox project.")
|
|
4162
4201
|
}).nullable().optional().describe("Inbox information (account overview only)."),
|
|
4163
|
-
projects: s.array(s.lazy(() =>
|
|
4202
|
+
projects: s.array(s.lazy(() => is)).optional().describe(
|
|
4164
4203
|
"List of projects with hierarchy, folders, and ordering (account overview only)."
|
|
4165
4204
|
),
|
|
4166
4205
|
project: s.object({
|
|
@@ -4175,7 +4214,7 @@ const fa = {
|
|
|
4175
4214
|
tasksWithoutSection: s.number()
|
|
4176
4215
|
}).optional().describe("Statistics object (project overview only).")
|
|
4177
4216
|
};
|
|
4178
|
-
function
|
|
4217
|
+
function va(e) {
|
|
4179
4218
|
const t = {};
|
|
4180
4219
|
for (const n of e)
|
|
4181
4220
|
t[n.id] = {
|
|
@@ -4200,7 +4239,7 @@ function ga(e) {
|
|
|
4200
4239
|
}
|
|
4201
4240
|
return r(o), o;
|
|
4202
4241
|
}
|
|
4203
|
-
async function
|
|
4242
|
+
async function Ia(e, t) {
|
|
4204
4243
|
const o = {};
|
|
4205
4244
|
return await Promise.all(
|
|
4206
4245
|
t.map(async (r) => {
|
|
@@ -4209,17 +4248,17 @@ async function ya(e, t) {
|
|
|
4209
4248
|
})
|
|
4210
4249
|
), o;
|
|
4211
4250
|
}
|
|
4212
|
-
function
|
|
4251
|
+
function cs(e, t, o = "") {
|
|
4213
4252
|
const r = [];
|
|
4214
4253
|
r.push(`${o}- Project: ${e.name} (id=${e.id})`);
|
|
4215
4254
|
const n = t[e.id] || [];
|
|
4216
4255
|
for (const a of n)
|
|
4217
4256
|
r.push(`${o} - Section: ${a.name} (id=${a.id})`);
|
|
4218
4257
|
for (const a of e.children)
|
|
4219
|
-
r.push(...
|
|
4258
|
+
r.push(...cs(a, t, `${o} `));
|
|
4220
4259
|
return r;
|
|
4221
4260
|
}
|
|
4222
|
-
function
|
|
4261
|
+
function jt(e) {
|
|
4223
4262
|
const t = {};
|
|
4224
4263
|
for (const r of e)
|
|
4225
4264
|
t[r.id] = { ...r, children: [] };
|
|
@@ -4236,15 +4275,15 @@ function It(e) {
|
|
|
4236
4275
|
}
|
|
4237
4276
|
return o;
|
|
4238
4277
|
}
|
|
4239
|
-
function
|
|
4278
|
+
function Ve(e, t = "") {
|
|
4240
4279
|
const o = [];
|
|
4241
4280
|
for (const r of e) {
|
|
4242
4281
|
const n = `id=${r.id}`, a = r.dueDate ? `; due=${r.dueDate}` : "", i = `; content=${r.content}`;
|
|
4243
|
-
o.push(`${t}- ${n}${a}${i}`), r.children.length > 0 && o.push(...
|
|
4282
|
+
o.push(`${t}- ${n}${a}${i}`), r.children.length > 0 && o.push(...Ve(r.children, `${t} `));
|
|
4244
4283
|
}
|
|
4245
4284
|
return o;
|
|
4246
4285
|
}
|
|
4247
|
-
function
|
|
4286
|
+
function ds(e, t) {
|
|
4248
4287
|
return {
|
|
4249
4288
|
id: e.id,
|
|
4250
4289
|
name: e.name,
|
|
@@ -4253,11 +4292,11 @@ function ns(e, t) {
|
|
|
4253
4292
|
childOrder: e.childOrder,
|
|
4254
4293
|
sections: (t[e.id] || []).map(X),
|
|
4255
4294
|
children: e.children.map(
|
|
4256
|
-
(o) =>
|
|
4295
|
+
(o) => ds(o, t)
|
|
4257
4296
|
)
|
|
4258
4297
|
};
|
|
4259
4298
|
}
|
|
4260
|
-
async function
|
|
4299
|
+
async function ja(e, t) {
|
|
4261
4300
|
let o = [], r;
|
|
4262
4301
|
do {
|
|
4263
4302
|
const { results: n, nextCursor: a } = await e.getTasks({
|
|
@@ -4269,12 +4308,12 @@ async function ka(e, t) {
|
|
|
4269
4308
|
} while (r);
|
|
4270
4309
|
return o;
|
|
4271
4310
|
}
|
|
4272
|
-
async function
|
|
4311
|
+
async function Sa(e, t) {
|
|
4273
4312
|
const { results: o } = await e.getSections({ projectId: t });
|
|
4274
4313
|
return o;
|
|
4275
4314
|
}
|
|
4276
|
-
async function
|
|
4277
|
-
const { results: t } = await e.getProjects({}), o = t.find((u) => ie(u) && u.inboxProject === !0), r = t.filter((u) => !ie(u) || u.inboxProject !== !0), n =
|
|
4315
|
+
async function Ca(e) {
|
|
4316
|
+
const { results: t } = await e.getProjects({}), o = t.find((u) => ie(u) && u.inboxProject === !0), r = t.filter((u) => !ie(u) || u.inboxProject !== !0), n = va(r), a = t.map((u) => u.id), i = await Ia(e, a), c = ["# Personal Projects", ""];
|
|
4278
4317
|
if (o) {
|
|
4279
4318
|
c.push(`- Inbox Project: ${o.name} (id=${o.id})`);
|
|
4280
4319
|
for (const u of i[o.id] || [])
|
|
@@ -4282,7 +4321,7 @@ async function wa(e) {
|
|
|
4282
4321
|
}
|
|
4283
4322
|
if (n.length)
|
|
4284
4323
|
for (const u of n)
|
|
4285
|
-
c.push(...
|
|
4324
|
+
c.push(...cs(u, i));
|
|
4286
4325
|
else
|
|
4287
4326
|
c.push("_No projects found._");
|
|
4288
4327
|
c.push("");
|
|
@@ -4300,7 +4339,7 @@ async function wa(e) {
|
|
|
4300
4339
|
sections: (i[o.id] || []).map(X)
|
|
4301
4340
|
} : null,
|
|
4302
4341
|
projects: n.map(
|
|
4303
|
-
(u) =>
|
|
4342
|
+
(u) => ds(u, i)
|
|
4304
4343
|
),
|
|
4305
4344
|
totalProjects: t.length,
|
|
4306
4345
|
totalSections: a.reduce(
|
|
@@ -4311,11 +4350,11 @@ async function wa(e) {
|
|
|
4311
4350
|
};
|
|
4312
4351
|
return { textContent: l, structuredContent: p };
|
|
4313
4352
|
}
|
|
4314
|
-
async function
|
|
4353
|
+
async function $a(e, t) {
|
|
4315
4354
|
const [o, r, n] = await Promise.all([
|
|
4316
4355
|
e.getProject(t),
|
|
4317
|
-
|
|
4318
|
-
|
|
4356
|
+
Sa(e, t),
|
|
4357
|
+
ja(e, t)
|
|
4319
4358
|
]), a = {};
|
|
4320
4359
|
for (const p of r)
|
|
4321
4360
|
a[p.id] = [];
|
|
@@ -4325,16 +4364,16 @@ async function va(e, t) {
|
|
|
4325
4364
|
const c = [`# ${o.name}`];
|
|
4326
4365
|
if (i.length > 0) {
|
|
4327
4366
|
c.push("");
|
|
4328
|
-
const p =
|
|
4329
|
-
c.push(...
|
|
4367
|
+
const p = jt(i);
|
|
4368
|
+
c.push(...Ve(p));
|
|
4330
4369
|
}
|
|
4331
4370
|
for (const p of r) {
|
|
4332
4371
|
c.push(""), c.push(`## ${p.name}`);
|
|
4333
4372
|
const u = a[p.id];
|
|
4334
4373
|
if (!u?.length)
|
|
4335
4374
|
continue;
|
|
4336
|
-
const m =
|
|
4337
|
-
c.push(...
|
|
4375
|
+
const m = jt(u);
|
|
4376
|
+
c.push(...Ve(m));
|
|
4338
4377
|
}
|
|
4339
4378
|
const d = c.join(`
|
|
4340
4379
|
`), l = {
|
|
@@ -4357,33 +4396,33 @@ async function va(e, t) {
|
|
|
4357
4396
|
};
|
|
4358
4397
|
return { textContent: d, structuredContent: l };
|
|
4359
4398
|
}
|
|
4360
|
-
const
|
|
4399
|
+
const Da = {
|
|
4361
4400
|
name: f.GET_OVERVIEW,
|
|
4362
4401
|
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.",
|
|
4363
|
-
parameters:
|
|
4364
|
-
outputSchema:
|
|
4402
|
+
parameters: Ta,
|
|
4403
|
+
outputSchema: wa,
|
|
4365
4404
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4366
4405
|
async execute(e, t) {
|
|
4367
|
-
const o = e.projectId ? await
|
|
4406
|
+
const o = e.projectId ? await $a(t, e.projectId) : await Ca(t);
|
|
4368
4407
|
return {
|
|
4369
4408
|
textContent: o.textContent,
|
|
4370
4409
|
structuredContent: o.structuredContent
|
|
4371
4410
|
};
|
|
4372
4411
|
}
|
|
4373
|
-
},
|
|
4412
|
+
}, Aa = {}, oe = s.object({
|
|
4374
4413
|
count: s.number().describe("Number of consecutive periods in this streak."),
|
|
4375
4414
|
start: s.string().describe("Start date of the streak."),
|
|
4376
4415
|
end: s.string().describe("End date of the streak.")
|
|
4377
|
-
}),
|
|
4416
|
+
}), St = s.object({
|
|
4378
4417
|
id: s.string().describe("Project ID."),
|
|
4379
4418
|
completed: s.number().describe("Number of tasks completed in this project.")
|
|
4380
|
-
}),
|
|
4419
|
+
}), xa = {
|
|
4381
4420
|
completedCount: s.number().describe("Total number of completed tasks (all-time)."),
|
|
4382
4421
|
daysItems: s.array(
|
|
4383
4422
|
s.object({
|
|
4384
4423
|
date: s.string().describe("Date string (YYYY-MM-DD)."),
|
|
4385
4424
|
totalCompleted: s.number().describe("Total tasks completed on this day."),
|
|
4386
|
-
items: s.array(
|
|
4425
|
+
items: s.array(St).describe("Per-project completion breakdown for this day.")
|
|
4387
4426
|
})
|
|
4388
4427
|
).describe("Daily completion breakdown (most recent days)."),
|
|
4389
4428
|
weekItems: s.array(
|
|
@@ -4391,7 +4430,7 @@ const Ia = {
|
|
|
4391
4430
|
from: s.string().describe("Start date of the week."),
|
|
4392
4431
|
to: s.string().describe("End date of the week."),
|
|
4393
4432
|
totalCompleted: s.number().describe("Total tasks completed in this week."),
|
|
4394
|
-
items: s.array(
|
|
4433
|
+
items: s.array(St).describe("Per-project completion breakdown for this week.")
|
|
4395
4434
|
})
|
|
4396
4435
|
).describe("Weekly completion breakdown (most recent weeks)."),
|
|
4397
4436
|
goals: s.object({
|
|
@@ -4426,11 +4465,11 @@ const Ia = {
|
|
|
4426
4465
|
})
|
|
4427
4466
|
).describe("Recent karma change events with reasons."),
|
|
4428
4467
|
projectColors: s.record(s.string(), s.string()).describe("Map of project ID to color key.")
|
|
4429
|
-
},
|
|
4468
|
+
}, Ea = {
|
|
4430
4469
|
name: f.GET_PRODUCTIVITY_STATS,
|
|
4431
4470
|
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.",
|
|
4432
|
-
parameters:
|
|
4433
|
-
outputSchema:
|
|
4471
|
+
parameters: Aa,
|
|
4472
|
+
outputSchema: xa,
|
|
4434
4473
|
annotations: {
|
|
4435
4474
|
readOnlyHint: !0,
|
|
4436
4475
|
destructiveHint: !1,
|
|
@@ -4439,7 +4478,7 @@ const Ia = {
|
|
|
4439
4478
|
async execute(e, t) {
|
|
4440
4479
|
const o = await t.getProductivityStats();
|
|
4441
4480
|
return {
|
|
4442
|
-
textContent:
|
|
4481
|
+
textContent: Oa(o),
|
|
4443
4482
|
structuredContent: {
|
|
4444
4483
|
completedCount: o.completedCount,
|
|
4445
4484
|
daysItems: o.daysItems,
|
|
@@ -4466,7 +4505,7 @@ const Ia = {
|
|
|
4466
4505
|
};
|
|
4467
4506
|
}
|
|
4468
4507
|
};
|
|
4469
|
-
function
|
|
4508
|
+
function Oa(e) {
|
|
4470
4509
|
const t = [
|
|
4471
4510
|
"# Productivity Statistics",
|
|
4472
4511
|
"",
|
|
@@ -4496,11 +4535,11 @@ function $a(e) {
|
|
|
4496
4535
|
return t.join(`
|
|
4497
4536
|
`);
|
|
4498
4537
|
}
|
|
4499
|
-
const
|
|
4538
|
+
const Ua = {
|
|
4500
4539
|
projectId: s.string().min(1).describe("The ID of the project to get activity stats for."),
|
|
4501
4540
|
weeks: s.number().int().min(1).max(12).optional().describe("Number of weeks of activity data to retrieve (1-12, default 2)."),
|
|
4502
4541
|
includeWeeklyCounts: s.boolean().optional().describe("Include weekly rollup counts alongside daily counts.")
|
|
4503
|
-
},
|
|
4542
|
+
}, Pa = {
|
|
4504
4543
|
projectId: s.string().describe("The project ID."),
|
|
4505
4544
|
dayItems: s.array(
|
|
4506
4545
|
s.object({
|
|
@@ -4516,7 +4555,7 @@ const Da = {
|
|
|
4516
4555
|
})
|
|
4517
4556
|
).nullable().describe("Weekly completion rollups. Only included when includeWeeklyCounts is true.")
|
|
4518
4557
|
};
|
|
4519
|
-
function
|
|
4558
|
+
function _a(e, t) {
|
|
4520
4559
|
const o = [`# Activity Stats: Project ${e}`, ""];
|
|
4521
4560
|
if (t.dayItems.length > 0) {
|
|
4522
4561
|
o.push("## Daily Activity");
|
|
@@ -4532,11 +4571,11 @@ function xa(e, t) {
|
|
|
4532
4571
|
return o.join(`
|
|
4533
4572
|
`);
|
|
4534
4573
|
}
|
|
4535
|
-
const
|
|
4574
|
+
const Ra = {
|
|
4536
4575
|
name: f.GET_PROJECT_ACTIVITY_STATS,
|
|
4537
4576
|
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.",
|
|
4538
|
-
parameters:
|
|
4539
|
-
outputSchema:
|
|
4577
|
+
parameters: Ua,
|
|
4578
|
+
outputSchema: Pa,
|
|
4540
4579
|
annotations: {
|
|
4541
4580
|
readOnlyHint: !0,
|
|
4542
4581
|
destructiveHint: !1,
|
|
@@ -4548,7 +4587,7 @@ const Ea = {
|
|
|
4548
4587
|
includeWeeklyCounts: n
|
|
4549
4588
|
});
|
|
4550
4589
|
return {
|
|
4551
|
-
textContent:
|
|
4590
|
+
textContent: _a(o, a),
|
|
4552
4591
|
structuredContent: {
|
|
4553
4592
|
projectId: o,
|
|
4554
4593
|
dayItems: a.dayItems,
|
|
@@ -4556,15 +4595,15 @@ const Ea = {
|
|
|
4556
4595
|
}
|
|
4557
4596
|
};
|
|
4558
4597
|
}
|
|
4559
|
-
},
|
|
4598
|
+
}, Na = {
|
|
4560
4599
|
projectId: s.string().min(1).describe("The ID of the project to check health for."),
|
|
4561
4600
|
includeContext: s.boolean().default(!1).describe(
|
|
4562
4601
|
"Include detailed health context with project metrics and task-level data. May produce large output for projects with many tasks."
|
|
4563
4602
|
)
|
|
4564
|
-
},
|
|
4603
|
+
}, La = s.object({
|
|
4565
4604
|
taskId: s.string().describe("The ID of the task this recommendation is for."),
|
|
4566
4605
|
recommendation: s.string().describe("The recommendation for this task.")
|
|
4567
|
-
}),
|
|
4606
|
+
}), Ma = s.object({
|
|
4568
4607
|
id: s.string().describe("The task ID."),
|
|
4569
4608
|
content: s.string().describe("The task content/title."),
|
|
4570
4609
|
priority: s.string().describe("The task priority (1-4)."),
|
|
@@ -4572,7 +4611,7 @@ const Ea = {
|
|
|
4572
4611
|
deadline: s.string().nullable().optional().describe("The deadline date string, if set."),
|
|
4573
4612
|
isCompleted: s.boolean().describe("Whether the task is completed."),
|
|
4574
4613
|
labels: s.array(s.string()).describe("Labels applied to this task.")
|
|
4575
|
-
}),
|
|
4614
|
+
}), Fa = {
|
|
4576
4615
|
projectId: s.string().describe("The project ID."),
|
|
4577
4616
|
projectName: s.string().describe("The project name."),
|
|
4578
4617
|
progress: s.object({
|
|
@@ -4581,10 +4620,10 @@ const Ea = {
|
|
|
4581
4620
|
progressPercent: s.number().describe("Completion percentage (0-100).")
|
|
4582
4621
|
}).describe("Project completion progress."),
|
|
4583
4622
|
health: s.object({
|
|
4584
|
-
status: s.enum(
|
|
4623
|
+
status: s.enum(Xe).describe("The overall health status of the project."),
|
|
4585
4624
|
description: s.string().nullable().optional().describe("Detailed description of the health assessment."),
|
|
4586
4625
|
descriptionSummary: s.string().nullable().optional().describe("Brief summary of the health assessment."),
|
|
4587
|
-
taskRecommendations: s.array(
|
|
4626
|
+
taskRecommendations: s.array(La).nullable().optional().describe("Specific recommendations for individual tasks."),
|
|
4588
4627
|
isStale: s.boolean().describe("Whether the health data is stale and may need refreshing."),
|
|
4589
4628
|
updateInProgress: s.boolean().describe("Whether a health analysis update is currently in progress."),
|
|
4590
4629
|
updatedAt: s.string().nullable().optional().describe("When the health assessment was last updated.")
|
|
@@ -4599,12 +4638,12 @@ const Ea = {
|
|
|
4599
4638
|
tasksCompletedThisWeek: s.number().describe("Tasks completed in the current week."),
|
|
4600
4639
|
averageCompletionTime: s.number().nullable().describe("Average task completion time in days, if available.")
|
|
4601
4640
|
}).describe("Aggregated project metrics."),
|
|
4602
|
-
tasks: s.array(
|
|
4641
|
+
tasks: s.array(Ma).describe("Tasks in the project.")
|
|
4603
4642
|
}).optional().describe(
|
|
4604
4643
|
"Detailed project context with metrics and task data. Only included when includeContext is true."
|
|
4605
4644
|
)
|
|
4606
4645
|
};
|
|
4607
|
-
async function
|
|
4646
|
+
async function Ha(e, t, o) {
|
|
4608
4647
|
if (o) {
|
|
4609
4648
|
const [a, i, c] = await Promise.all([
|
|
4610
4649
|
e.getProjectProgress(t),
|
|
@@ -4619,7 +4658,7 @@ async function Ra(e, t, o) {
|
|
|
4619
4658
|
]);
|
|
4620
4659
|
return { progress: r, health: n };
|
|
4621
4660
|
}
|
|
4622
|
-
function
|
|
4661
|
+
function Wa(e, { progress: t, health: o, context: r }) {
|
|
4623
4662
|
const n = [`# Project Health: ${e}`, ""];
|
|
4624
4663
|
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(
|
|
4625
4664
|
`**Completed:** ${t.completedCount} | **Active:** ${t.activeCount} | **Progress:** ${t.progressPercent}%`
|
|
@@ -4642,18 +4681,18 @@ function Na(e, { progress: t, health: o, context: r }) {
|
|
|
4642
4681
|
return n.join(`
|
|
4643
4682
|
`);
|
|
4644
4683
|
}
|
|
4645
|
-
const
|
|
4684
|
+
const Ga = {
|
|
4646
4685
|
name: f.GET_PROJECT_HEALTH,
|
|
4647
4686
|
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 recommendations. Use includeContext=true for full detail including task data.",
|
|
4648
|
-
parameters:
|
|
4649
|
-
outputSchema:
|
|
4687
|
+
parameters: Na,
|
|
4688
|
+
outputSchema: Fa,
|
|
4650
4689
|
annotations: {
|
|
4651
4690
|
readOnlyHint: !0,
|
|
4652
4691
|
destructiveHint: !1,
|
|
4653
4692
|
idempotentHint: !0
|
|
4654
4693
|
},
|
|
4655
4694
|
async execute(e, t) {
|
|
4656
|
-
const { projectId: o, includeContext: r } = e, n = await
|
|
4695
|
+
const { projectId: o, includeContext: r } = e, n = await Ha(t, o, r), a = n.context?.projectName ?? `Project ${o}`, i = Wa(a, n), c = n.context ? {
|
|
4657
4696
|
projectDescription: n.context.projectDescription,
|
|
4658
4697
|
projectMetrics: n.context.projectMetrics,
|
|
4659
4698
|
tasks: n.context.tasks.map((d) => ({
|
|
@@ -4689,15 +4728,15 @@ const La = {
|
|
|
4689
4728
|
}
|
|
4690
4729
|
};
|
|
4691
4730
|
}
|
|
4692
|
-
},
|
|
4731
|
+
}, Ba = {
|
|
4693
4732
|
workspaceIdOrName: s.string().min(1).describe(
|
|
4694
4733
|
"The workspace ID or name. Supports exact ID, exact name match (case-insensitive), or unique partial name match."
|
|
4695
4734
|
),
|
|
4696
4735
|
projectIds: s.array(s.string().min(1)).min(1).optional().describe("Optional list of project IDs to scope insights to specific projects.")
|
|
4697
|
-
},
|
|
4736
|
+
}, Ya = s.object({
|
|
4698
4737
|
projectId: s.string().describe("The project ID."),
|
|
4699
4738
|
health: s.object({
|
|
4700
|
-
status: s.enum(
|
|
4739
|
+
status: s.enum(Xe).describe("The health status of the project."),
|
|
4701
4740
|
isStale: s.boolean().describe("Whether the health data is stale."),
|
|
4702
4741
|
updateInProgress: s.boolean().describe("Whether a health analysis update is in progress.")
|
|
4703
4742
|
}).nullable().describe("Health data for this project, if available."),
|
|
@@ -4706,23 +4745,23 @@ const La = {
|
|
|
4706
4745
|
activeCount: s.number().describe("Number of active tasks."),
|
|
4707
4746
|
progressPercent: s.number().describe("Completion percentage (0-100).")
|
|
4708
4747
|
}).nullable().describe("Progress data for this project, if available.")
|
|
4709
|
-
}),
|
|
4748
|
+
}), qa = {
|
|
4710
4749
|
workspaceId: s.string().describe("The resolved workspace ID."),
|
|
4711
4750
|
workspaceName: s.string().describe("The resolved workspace name."),
|
|
4712
4751
|
folderId: s.string().nullable().describe("The folder ID, if applicable."),
|
|
4713
|
-
projectInsights: s.array(
|
|
4714
|
-
},
|
|
4752
|
+
projectInsights: s.array(Ya).describe("Health and progress insights for each project in the workspace.")
|
|
4753
|
+
}, za = {
|
|
4715
4754
|
name: f.GET_WORKSPACE_INSIGHTS,
|
|
4716
4755
|
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.",
|
|
4717
|
-
parameters:
|
|
4718
|
-
outputSchema:
|
|
4756
|
+
parameters: Ba,
|
|
4757
|
+
outputSchema: qa,
|
|
4719
4758
|
annotations: {
|
|
4720
4759
|
readOnlyHint: !0,
|
|
4721
4760
|
destructiveHint: !1,
|
|
4722
4761
|
idempotentHint: !0
|
|
4723
4762
|
},
|
|
4724
4763
|
async execute(e, t) {
|
|
4725
|
-
const { workspaceIdOrName: o, projectIds: r } = e, n = await
|
|
4764
|
+
const { workspaceIdOrName: o, projectIds: r } = e, n = await Kt.resolveWorkspace(t, o), a = await t.getWorkspaceInsights(n.workspaceId, { projectIds: r }), i = a.projectInsights.map((d) => ({
|
|
4726
4765
|
projectId: d.projectId,
|
|
4727
4766
|
health: d.health ? {
|
|
4728
4767
|
status: d.health.status,
|
|
@@ -4755,21 +4794,21 @@ const La = {
|
|
|
4755
4794
|
}
|
|
4756
4795
|
};
|
|
4757
4796
|
}
|
|
4758
|
-
},
|
|
4797
|
+
}, Ct = 50, Ka = {
|
|
4759
4798
|
goalId: s.string().min(1).describe("The ID of the goal."),
|
|
4760
|
-
taskIds: s.array(s.string().min(1)).min(1).max(
|
|
4799
|
+
taskIds: s.array(s.string().min(1)).min(1).max(Ct).describe(`The IDs of the tasks to link or unlink (max ${Ct}).`),
|
|
4761
4800
|
action: s.enum(["link", "unlink"]).describe("Whether to link or unlink the tasks.")
|
|
4762
|
-
},
|
|
4801
|
+
}, Va = {
|
|
4763
4802
|
processed: s.array(s.string()).describe("The IDs of successfully processed tasks."),
|
|
4764
4803
|
failures: s.array(be).describe("Failed operations with error details."),
|
|
4765
4804
|
totalRequested: s.number().describe("The total number of tasks requested."),
|
|
4766
4805
|
successCount: s.number().describe("The number of successfully processed tasks."),
|
|
4767
4806
|
failureCount: s.number().describe("The number of failed operations.")
|
|
4768
|
-
},
|
|
4807
|
+
}, Ja = {
|
|
4769
4808
|
name: f.LINK_GOAL_TASKS,
|
|
4770
4809
|
description: "Link or unlink tasks to/from a goal.",
|
|
4771
|
-
parameters:
|
|
4772
|
-
outputSchema:
|
|
4810
|
+
parameters: Ka,
|
|
4811
|
+
outputSchema: Va,
|
|
4773
4812
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
|
|
4774
4813
|
async execute(e, t) {
|
|
4775
4814
|
const o = await Promise.allSettled(
|
|
@@ -4802,21 +4841,21 @@ const La = {
|
|
|
4802
4841
|
}
|
|
4803
4842
|
};
|
|
4804
4843
|
}
|
|
4805
|
-
},
|
|
4844
|
+
}, Xa = {}, Za = {
|
|
4806
4845
|
id: s.string().describe("The unique identifier for the workspace."),
|
|
4807
4846
|
name: s.string().describe("The name of the workspace."),
|
|
4808
|
-
plan: s.enum(
|
|
4809
|
-
role: s.enum(
|
|
4847
|
+
plan: s.enum($s).describe("The workspace plan type."),
|
|
4848
|
+
role: s.enum(Cs).optional().describe("The user's role in the workspace, if available."),
|
|
4810
4849
|
isLinkSharingEnabled: s.boolean().describe("Whether link sharing is enabled for the workspace."),
|
|
4811
4850
|
isGuestAllowed: s.boolean().describe("Whether guests are allowed in the workspace."),
|
|
4812
4851
|
createdAt: s.string().optional().describe("The ISO 8601 timestamp when the workspace was created."),
|
|
4813
4852
|
creatorId: s.string().describe("The ID of the user who created the workspace.")
|
|
4814
|
-
},
|
|
4853
|
+
}, Qa = {
|
|
4815
4854
|
type: s.literal("workspaces").describe("The type of the response."),
|
|
4816
|
-
workspaces: s.array(s.object(
|
|
4855
|
+
workspaces: s.array(s.object(Za)).describe("List of workspaces."),
|
|
4817
4856
|
count: s.number().describe("The total number of workspaces.")
|
|
4818
4857
|
};
|
|
4819
|
-
async function
|
|
4858
|
+
async function ei(e) {
|
|
4820
4859
|
const o = (await e.getWorkspaces()).map((i) => ({
|
|
4821
4860
|
id: i.id,
|
|
4822
4861
|
name: i.name,
|
|
@@ -4847,22 +4886,22 @@ async function Va(e) {
|
|
|
4847
4886
|
};
|
|
4848
4887
|
return { textContent: n, structuredContent: a };
|
|
4849
4888
|
}
|
|
4850
|
-
const
|
|
4889
|
+
const ti = {
|
|
4851
4890
|
name: f.LIST_WORKSPACES,
|
|
4852
4891
|
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.",
|
|
4853
|
-
parameters:
|
|
4854
|
-
outputSchema:
|
|
4892
|
+
parameters: Xa,
|
|
4893
|
+
outputSchema: Qa,
|
|
4855
4894
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4856
4895
|
async execute(e, t) {
|
|
4857
|
-
const o = await
|
|
4896
|
+
const o = await ei(t);
|
|
4858
4897
|
return {
|
|
4859
4898
|
textContent: o.textContent,
|
|
4860
4899
|
structuredContent: o.structuredContent
|
|
4861
4900
|
};
|
|
4862
4901
|
}
|
|
4863
|
-
}, { FIND_TASKS:
|
|
4902
|
+
}, { FIND_TASKS: si, FIND_PROJECT_COLLABORATORS: $t, UPDATE_TASKS: oi } = f, ri = 50, ni = {
|
|
4864
4903
|
operation: s.enum(["assign", "unassign", "reassign"]).describe("The assignment operation to perform."),
|
|
4865
|
-
taskIds: s.array(s.string()).min(1).max(
|
|
4904
|
+
taskIds: s.array(s.string()).min(1).max(ri).describe("The IDs of the tasks to operate on (max 50)."),
|
|
4866
4905
|
responsibleUser: s.string().optional().describe(
|
|
4867
4906
|
'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.'
|
|
4868
4907
|
),
|
|
@@ -4870,7 +4909,7 @@ const Ja = {
|
|
|
4870
4909
|
"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."
|
|
4871
4910
|
),
|
|
4872
4911
|
dryRun: s.boolean().optional().default(!1).describe("If true, validates operations without executing them.")
|
|
4873
|
-
},
|
|
4912
|
+
}, ai = {
|
|
4874
4913
|
results: s.array(
|
|
4875
4914
|
s.object({
|
|
4876
4915
|
taskId: s.string().describe("The ID of the task."),
|
|
@@ -4886,11 +4925,11 @@ const Ja = {
|
|
|
4886
4925
|
failed: s.number().describe("Number of failed operations."),
|
|
4887
4926
|
dryRun: s.boolean().describe("Whether this was a dry run.")
|
|
4888
4927
|
}).optional().describe("Summary of the operation.")
|
|
4889
|
-
},
|
|
4928
|
+
}, ii = {
|
|
4890
4929
|
name: f.MANAGE_ASSIGNMENTS,
|
|
4891
4930
|
description: "Bulk assignment operations for multiple tasks. Supports assign, unassign, and reassign operations with atomic rollback on failures.",
|
|
4892
|
-
parameters:
|
|
4893
|
-
outputSchema:
|
|
4931
|
+
parameters: ni,
|
|
4932
|
+
outputSchema: ai,
|
|
4894
4933
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
4895
4934
|
async execute(e, t) {
|
|
4896
4935
|
const { operation: o, taskIds: r, responsibleUser: n, fromAssigneeUser: a, dryRun: i } = e;
|
|
@@ -4992,7 +5031,7 @@ const Ja = {
|
|
|
4992
5031
|
}
|
|
4993
5032
|
};
|
|
4994
5033
|
}
|
|
4995
|
-
const m = await
|
|
5034
|
+
const m = await at.validateBulkAssignment(
|
|
4996
5035
|
t,
|
|
4997
5036
|
u
|
|
4998
5037
|
), h = [], k = [];
|
|
@@ -5113,30 +5152,30 @@ function _e({
|
|
|
5113
5152
|
`;
|
|
5114
5153
|
}
|
|
5115
5154
|
return !o && r.length > 0 ? (c += `**Next steps:**
|
|
5116
|
-
`, c += `• Use ${
|
|
5117
|
-
`, c += `• Use ${
|
|
5118
|
-
`, n.length > 0 && (c += `• Check failed tasks and use ${
|
|
5155
|
+
`, c += `• Use ${si} with responsibleUser to see ${e === "unassign" ? "unassigned" : "newly assigned"} tasks
|
|
5156
|
+
`, c += `• Use ${oi} for individual assignment changes
|
|
5157
|
+
`, n.length > 0 && (c += `• Check failed tasks and use ${$t} to verify collaborator access
|
|
5119
5158
|
`)) : o ? (c += `**To execute:**
|
|
5120
5159
|
`, c += `• Remove dryRun parameter and run again to execute changes
|
|
5121
5160
|
`, r.length > 0 && (c += `• ${r.length} task${r.length === 1 ? "" : "s"} ready for ${e} operation
|
|
5122
5161
|
`), n.length > 0 && (c += `• Fix ${n.length} validation error${n.length === 1 ? "" : "s"} before executing
|
|
5123
5162
|
`)) : r.length === 0 && (c += `**Suggestions:**
|
|
5124
|
-
`, c += `• Use ${
|
|
5163
|
+
`, c += `• Use ${$t} to find valid assignees
|
|
5125
5164
|
`, c += `• Check task IDs and assignee permissions
|
|
5126
5165
|
`, c += `• Use dryRun=true to validate before executing
|
|
5127
5166
|
`), c;
|
|
5128
5167
|
}
|
|
5129
|
-
const
|
|
5168
|
+
const ci = {
|
|
5130
5169
|
action: s.enum(["archive", "unarchive"]).describe("The action to perform on the project."),
|
|
5131
5170
|
projectId: s.string().min(1).describe("The ID of the project.")
|
|
5132
|
-
},
|
|
5171
|
+
}, di = {
|
|
5133
5172
|
project: ue.describe("The updated project."),
|
|
5134
5173
|
success: s.boolean().describe("Whether the action was successful.")
|
|
5135
|
-
},
|
|
5174
|
+
}, li = {
|
|
5136
5175
|
name: f.PROJECT_MANAGEMENT,
|
|
5137
5176
|
description: "Archive or unarchive a project by its ID.",
|
|
5138
|
-
parameters:
|
|
5139
|
-
outputSchema:
|
|
5177
|
+
parameters: ci,
|
|
5178
|
+
outputSchema: di,
|
|
5140
5179
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
|
|
5141
5180
|
async execute(e, t) {
|
|
5142
5181
|
const o = e.action === "archive" ? await t.archiveProject(e.projectId) : await t.unarchiveProject(e.projectId), r = V(o);
|
|
@@ -5148,7 +5187,7 @@ const oi = {
|
|
|
5148
5187
|
}
|
|
5149
5188
|
};
|
|
5150
5189
|
}
|
|
5151
|
-
},
|
|
5190
|
+
}, ui = {
|
|
5152
5191
|
action: s.enum(["move-to-workspace", "move-to-personal"]).describe("The action to perform on the project."),
|
|
5153
5192
|
projectId: s.string().min(1).describe("The ID of the project to move."),
|
|
5154
5193
|
workspaceId: s.string().min(1).optional().describe("The target workspace ID. Required when action is move-to-workspace."),
|
|
@@ -5156,14 +5195,14 @@ const oi = {
|
|
|
5156
5195
|
visibility: s.enum(["restricted", "team", "public"]).optional().describe(
|
|
5157
5196
|
"Optional access visibility for the project in the workspace (restricted, team, or public)."
|
|
5158
5197
|
)
|
|
5159
|
-
},
|
|
5198
|
+
}, pi = {
|
|
5160
5199
|
project: ue.describe("The moved project."),
|
|
5161
5200
|
success: s.boolean().describe("Whether the move was successful.")
|
|
5162
|
-
},
|
|
5201
|
+
}, mi = {
|
|
5163
5202
|
name: f.PROJECT_MOVE,
|
|
5164
5203
|
description: "Move a project between personal and workspace contexts.",
|
|
5165
|
-
parameters:
|
|
5166
|
-
outputSchema:
|
|
5204
|
+
parameters: ui,
|
|
5205
|
+
outputSchema: pi,
|
|
5167
5206
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
|
|
5168
5207
|
async execute(e, t) {
|
|
5169
5208
|
let o;
|
|
@@ -5186,8 +5225,8 @@ const oi = {
|
|
|
5186
5225
|
}
|
|
5187
5226
|
};
|
|
5188
5227
|
}
|
|
5189
|
-
},
|
|
5190
|
-
type: s.enum(
|
|
5228
|
+
}, ls = ["project", "section"], hi = {
|
|
5229
|
+
type: s.enum(ls).describe(
|
|
5191
5230
|
'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.'
|
|
5192
5231
|
),
|
|
5193
5232
|
items: s.array(
|
|
@@ -5203,17 +5242,17 @@ const oi = {
|
|
|
5203
5242
|
).min(1).describe(
|
|
5204
5243
|
"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."
|
|
5205
5244
|
)
|
|
5206
|
-
},
|
|
5207
|
-
type: s.enum(
|
|
5245
|
+
}, fi = {
|
|
5246
|
+
type: s.enum(ls).describe("The type of entity that was reordered/moved."),
|
|
5208
5247
|
movedCount: s.number().describe("The number of entities moved to a new parent."),
|
|
5209
5248
|
reorderedCount: s.number().describe("The number of entities reordered."),
|
|
5210
5249
|
affectedIds: s.array(s.string()).describe("The IDs of all affected entities."),
|
|
5211
5250
|
success: s.boolean().describe("Whether the operation was successful.")
|
|
5212
|
-
},
|
|
5251
|
+
}, bi = {
|
|
5213
5252
|
name: f.REORDER_OBJECTS,
|
|
5214
5253
|
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.',
|
|
5215
|
-
parameters:
|
|
5216
|
-
outputSchema:
|
|
5254
|
+
parameters: hi,
|
|
5255
|
+
outputSchema: fi,
|
|
5217
5256
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
|
|
5218
5257
|
async execute(e, t) {
|
|
5219
5258
|
const { type: o, items: r } = e, n = /* @__PURE__ */ new Set();
|
|
@@ -5275,22 +5314,22 @@ const oi = {
|
|
|
5275
5314
|
}
|
|
5276
5315
|
};
|
|
5277
5316
|
}
|
|
5278
|
-
},
|
|
5317
|
+
}, gi = s.object({
|
|
5279
5318
|
id: s.string().min(1).describe("The ID of the task to reschedule."),
|
|
5280
5319
|
date: s.string().min(1).describe(
|
|
5281
5320
|
"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."
|
|
5282
5321
|
)
|
|
5283
|
-
}),
|
|
5284
|
-
tasks: s.array(
|
|
5285
|
-
},
|
|
5322
|
+
}), yi = {
|
|
5323
|
+
tasks: s.array(gi).min(1).describe("The tasks to reschedule with their new dates.")
|
|
5324
|
+
}, ki = {
|
|
5286
5325
|
tasks: s.array(J).describe("The rescheduled tasks."),
|
|
5287
5326
|
totalCount: s.number().describe("The total number of tasks rescheduled."),
|
|
5288
5327
|
rescheduledTaskIds: s.array(s.string()).describe("The IDs of the rescheduled tasks.")
|
|
5289
|
-
},
|
|
5328
|
+
}, Ti = {
|
|
5290
5329
|
name: f.RESCHEDULE_TASKS,
|
|
5291
5330
|
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.",
|
|
5292
|
-
parameters:
|
|
5293
|
-
outputSchema:
|
|
5331
|
+
parameters: yi,
|
|
5332
|
+
outputSchema: ki,
|
|
5294
5333
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5295
5334
|
async execute(e, t) {
|
|
5296
5335
|
const { tasks: o } = e, n = (await Promise.all(
|
|
@@ -5303,7 +5342,7 @@ const oi = {
|
|
|
5303
5342
|
throw new Error(
|
|
5304
5343
|
`Task "${l.content}" (${l.id}) has no due date. Rescheduling requires an existing due date.`
|
|
5305
5344
|
);
|
|
5306
|
-
const p =
|
|
5345
|
+
const p = wi(d.date, l.due);
|
|
5307
5346
|
return q("item_update", {
|
|
5308
5347
|
id: d.id,
|
|
5309
5348
|
due: {
|
|
@@ -5323,7 +5362,7 @@ const oi = {
|
|
|
5323
5362
|
}
|
|
5324
5363
|
const a = await Promise.all(o.map((d) => t.getTask(d.id))), i = a.map(_);
|
|
5325
5364
|
return {
|
|
5326
|
-
textContent:
|
|
5365
|
+
textContent: it("Rescheduled", i, {
|
|
5327
5366
|
showDetails: i.length <= 5
|
|
5328
5367
|
}),
|
|
5329
5368
|
structuredContent: {
|
|
@@ -5334,16 +5373,16 @@ const oi = {
|
|
|
5334
5373
|
};
|
|
5335
5374
|
}
|
|
5336
5375
|
};
|
|
5337
|
-
function
|
|
5376
|
+
function wi(e, t) {
|
|
5338
5377
|
if (/^\d{4}-\d{2}-\d{2}$/.test(e) && t.datetime) {
|
|
5339
5378
|
const r = t.datetime.substring(10);
|
|
5340
5379
|
return e + r;
|
|
5341
5380
|
}
|
|
5342
5381
|
return e;
|
|
5343
5382
|
}
|
|
5344
|
-
const
|
|
5383
|
+
const vi = {
|
|
5345
5384
|
query: s.string().min(1).describe("The search query string to find tasks and projects.")
|
|
5346
|
-
},
|
|
5385
|
+
}, Ii = {
|
|
5347
5386
|
results: s.array(
|
|
5348
5387
|
s.object({
|
|
5349
5388
|
id: s.string().describe("The ID of the result."),
|
|
@@ -5352,52 +5391,52 @@ const gi = {
|
|
|
5352
5391
|
})
|
|
5353
5392
|
).describe("The search results."),
|
|
5354
5393
|
totalCount: s.number().describe("Total number of results found.")
|
|
5355
|
-
},
|
|
5394
|
+
}, ji = {
|
|
5356
5395
|
name: f.SEARCH,
|
|
5357
5396
|
description: "Search across tasks and projects in Todoist. Returns a list of relevant results with IDs, titles, and URLs.",
|
|
5358
|
-
parameters:
|
|
5359
|
-
outputSchema:
|
|
5397
|
+
parameters: vi,
|
|
5398
|
+
outputSchema: Ii,
|
|
5360
5399
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
5361
5400
|
async execute(e, t) {
|
|
5362
5401
|
const { query: o } = e, [r, n] = await Promise.all([
|
|
5363
|
-
|
|
5402
|
+
ot({
|
|
5364
5403
|
client: t,
|
|
5365
5404
|
query: `search: ${o}`,
|
|
5366
5405
|
limit: j.TASKS_MAX,
|
|
5367
5406
|
cursor: void 0
|
|
5368
5407
|
}),
|
|
5369
|
-
|
|
5408
|
+
qt(t, o)
|
|
5370
5409
|
]), a = [];
|
|
5371
5410
|
for (const i of r.tasks)
|
|
5372
5411
|
a.push({
|
|
5373
5412
|
id: `task:${i.id}`,
|
|
5374
5413
|
title: i.content,
|
|
5375
|
-
url:
|
|
5414
|
+
url: Pt(i.id)
|
|
5376
5415
|
});
|
|
5377
5416
|
for (const i of n)
|
|
5378
5417
|
a.push({
|
|
5379
5418
|
id: `project:${i.id}`,
|
|
5380
5419
|
title: i.name,
|
|
5381
|
-
url:
|
|
5420
|
+
url: _t(i.id)
|
|
5382
5421
|
});
|
|
5383
5422
|
return {
|
|
5384
5423
|
textContent: JSON.stringify({ results: a }),
|
|
5385
5424
|
structuredContent: { results: a, totalCount: a.length }
|
|
5386
5425
|
};
|
|
5387
5426
|
}
|
|
5388
|
-
},
|
|
5427
|
+
}, Si = {
|
|
5389
5428
|
ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to uncomplete.")
|
|
5390
|
-
},
|
|
5429
|
+
}, Ci = {
|
|
5391
5430
|
uncompleted: s.array(s.string()).describe("The IDs of successfully uncompleted tasks."),
|
|
5392
5431
|
failures: s.array(be).describe("Failed task uncompletion with error details."),
|
|
5393
5432
|
totalRequested: s.number().describe("The total number of tasks requested to uncomplete."),
|
|
5394
5433
|
successCount: s.number().describe("The number of successfully uncompleted tasks."),
|
|
5395
5434
|
failureCount: s.number().describe("The number of failed task uncompletions.")
|
|
5396
|
-
},
|
|
5435
|
+
}, $i = {
|
|
5397
5436
|
name: f.UNCOMPLETE_TASKS,
|
|
5398
5437
|
description: "Uncomplete (reopen) one or more completed tasks by their IDs.",
|
|
5399
|
-
parameters:
|
|
5400
|
-
outputSchema:
|
|
5438
|
+
parameters: Si,
|
|
5439
|
+
outputSchema: Ci,
|
|
5401
5440
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
5402
5441
|
async execute(e, t) {
|
|
5403
5442
|
const o = [], r = [];
|
|
@@ -5412,7 +5451,7 @@ const gi = {
|
|
|
5412
5451
|
});
|
|
5413
5452
|
}
|
|
5414
5453
|
return {
|
|
5415
|
-
textContent:
|
|
5454
|
+
textContent: Di({
|
|
5416
5455
|
uncompleted: o,
|
|
5417
5456
|
failures: r,
|
|
5418
5457
|
args: e
|
|
@@ -5427,7 +5466,7 @@ const gi = {
|
|
|
5427
5466
|
};
|
|
5428
5467
|
}
|
|
5429
5468
|
};
|
|
5430
|
-
function
|
|
5469
|
+
function Di({
|
|
5431
5470
|
uncompleted: e,
|
|
5432
5471
|
failures: t,
|
|
5433
5472
|
args: o
|
|
@@ -5441,28 +5480,28 @@ function Ii({
|
|
|
5441
5480
|
failures: t
|
|
5442
5481
|
});
|
|
5443
5482
|
}
|
|
5444
|
-
const
|
|
5483
|
+
const Ai = s.object({
|
|
5445
5484
|
id: s.string().min(1).describe("The ID of the comment to update."),
|
|
5446
5485
|
content: s.string().min(1).describe("The new content for the comment.")
|
|
5447
|
-
}),
|
|
5448
|
-
comments: s.array(
|
|
5449
|
-
},
|
|
5486
|
+
}), xi = {
|
|
5487
|
+
comments: s.array(Ai).min(1).describe("The comments to update.")
|
|
5488
|
+
}, Ei = {
|
|
5450
5489
|
comments: s.array(je).describe("The updated comments."),
|
|
5451
5490
|
totalCount: s.number().describe("The total number of comments updated."),
|
|
5452
5491
|
updatedCommentIds: s.array(s.string()).describe("The IDs of the updated comments."),
|
|
5453
5492
|
appliedOperations: s.object({
|
|
5454
5493
|
updateCount: s.number().describe("The number of comments updated.")
|
|
5455
5494
|
}).describe("Summary of operations performed.")
|
|
5456
|
-
},
|
|
5495
|
+
}, Oi = {
|
|
5457
5496
|
name: f.UPDATE_COMMENTS,
|
|
5458
5497
|
description: "Update multiple existing comments with new content.",
|
|
5459
|
-
parameters:
|
|
5460
|
-
outputSchema:
|
|
5498
|
+
parameters: xi,
|
|
5499
|
+
outputSchema: Ei,
|
|
5461
5500
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5462
5501
|
async execute(e, t) {
|
|
5463
5502
|
const { comments: o } = e, r = o.map(async (c) => await t.updateComment(c.id, { content: c.content })), a = (await Promise.all(r)).map(we);
|
|
5464
5503
|
return {
|
|
5465
|
-
textContent:
|
|
5504
|
+
textContent: Ui({
|
|
5466
5505
|
comments: a
|
|
5467
5506
|
}),
|
|
5468
5507
|
structuredContent: {
|
|
@@ -5476,7 +5515,7 @@ const ji = s.object({
|
|
|
5476
5515
|
};
|
|
5477
5516
|
}
|
|
5478
5517
|
};
|
|
5479
|
-
function
|
|
5518
|
+
function Ui({ comments: e }) {
|
|
5480
5519
|
const t = e.filter((a) => a.taskId).length, o = e.filter((a) => a.projectId).length, r = [];
|
|
5481
5520
|
if (t > 0) {
|
|
5482
5521
|
const a = t > 1 ? "comments" : "comment";
|
|
@@ -5488,7 +5527,7 @@ function Di({ comments: e }) {
|
|
|
5488
5527
|
}
|
|
5489
5528
|
return r.length > 0 ? `Updated ${r.join(" and ")}` : "No comments updated";
|
|
5490
5529
|
}
|
|
5491
|
-
const
|
|
5530
|
+
const Pi = s.object({
|
|
5492
5531
|
id: s.string().min(1).describe("The ID of the filter to update."),
|
|
5493
5532
|
name: s.string().min(1).optional().describe("The new name of the filter."),
|
|
5494
5533
|
query: s.string().min(1).optional().describe(
|
|
@@ -5496,25 +5535,25 @@ const Ai = s.object({
|
|
|
5496
5535
|
),
|
|
5497
5536
|
color: de,
|
|
5498
5537
|
isFavorite: s.boolean().optional().describe("Whether to mark the filter as a favorite.")
|
|
5499
|
-
}),
|
|
5500
|
-
filters: s.array(
|
|
5501
|
-
},
|
|
5502
|
-
filters: s.array(
|
|
5538
|
+
}), _i = {
|
|
5539
|
+
filters: s.array(Pi).min(1).describe("The filters to update.")
|
|
5540
|
+
}, Ri = {
|
|
5541
|
+
filters: s.array(nt).describe("The updated filters."),
|
|
5503
5542
|
totalCount: s.number().describe("The total number of filters updated."),
|
|
5504
5543
|
updatedFilterIds: s.array(s.string()).describe("The IDs of the updated filters."),
|
|
5505
5544
|
appliedOperations: s.object({
|
|
5506
5545
|
updateCount: s.number().describe("The number of filters actually updated."),
|
|
5507
5546
|
skippedCount: s.number().describe("The number of filters skipped (no changes).")
|
|
5508
5547
|
}).describe("Summary of operations performed.")
|
|
5509
|
-
},
|
|
5548
|
+
}, Ni = {
|
|
5510
5549
|
name: f.UPDATE_FILTERS,
|
|
5511
5550
|
description: "Update one or more existing personal filters with new values.",
|
|
5512
|
-
parameters:
|
|
5513
|
-
outputSchema:
|
|
5551
|
+
parameters: _i,
|
|
5552
|
+
outputSchema: Ri,
|
|
5514
5553
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5515
5554
|
async execute(e, t) {
|
|
5516
5555
|
const { filters: o } = e, r = [], a = o.map((m) => {
|
|
5517
|
-
const h =
|
|
5556
|
+
const h = Mi(m);
|
|
5518
5557
|
return h !== null ? { kind: "skipped", reason: h } : (r.push(m), { kind: "updated", filter: m });
|
|
5519
5558
|
}).filter((m) => m.kind === "skipped").length;
|
|
5520
5559
|
if (r.length === 0)
|
|
@@ -5545,7 +5584,7 @@ const Ai = s.object({
|
|
|
5545
5584
|
itemOrder: m.itemOrder
|
|
5546
5585
|
}));
|
|
5547
5586
|
return {
|
|
5548
|
-
textContent:
|
|
5587
|
+
textContent: Li({ filters: p, skippedCount: a }),
|
|
5549
5588
|
structuredContent: {
|
|
5550
5589
|
filters: p,
|
|
5551
5590
|
totalCount: p.length,
|
|
@@ -5558,7 +5597,7 @@ const Ai = s.object({
|
|
|
5558
5597
|
};
|
|
5559
5598
|
}
|
|
5560
5599
|
};
|
|
5561
|
-
function
|
|
5600
|
+
function Li({
|
|
5562
5601
|
filters: e,
|
|
5563
5602
|
skippedCount: t
|
|
5564
5603
|
}) {
|
|
@@ -5572,10 +5611,10 @@ ${n}`;
|
|
|
5572
5611
|
}
|
|
5573
5612
|
return r;
|
|
5574
5613
|
}
|
|
5575
|
-
function
|
|
5614
|
+
function Mi({ id: e, ...t }) {
|
|
5576
5615
|
return Object.values(t).every((r) => r === void 0) ? "no-fields" : null;
|
|
5577
5616
|
}
|
|
5578
|
-
const ne = "remove",
|
|
5617
|
+
const ne = "remove", Je = "unassign", Dt = 25, Fi = s.object({
|
|
5579
5618
|
id: s.string().min(1).describe("The ID of the goal to update."),
|
|
5580
5619
|
name: s.string().min(1).optional().describe("New goal name."),
|
|
5581
5620
|
description: s.preprocess(
|
|
@@ -5587,50 +5626,50 @@ const ne = "remove", Ke = "unassign", $t = 25, _i = s.object({
|
|
|
5587
5626
|
s.string().describe(`New deadline (YYYY-MM-DD). Use "${ne}" to clear.`)
|
|
5588
5627
|
).optional(),
|
|
5589
5628
|
responsibleUid: s.preprocess(
|
|
5590
|
-
(e) => e === null ?
|
|
5591
|
-
s.string().describe(`New responsible user ID. Use "${
|
|
5629
|
+
(e) => e === null ? Je : e,
|
|
5630
|
+
s.string().describe(`New responsible user ID. Use "${Je}" to clear.`)
|
|
5592
5631
|
).optional()
|
|
5593
|
-
}),
|
|
5594
|
-
goals: s.array(
|
|
5595
|
-
},
|
|
5632
|
+
}), Hi = ["no-fields", "no-valid-values"], Wi = {
|
|
5633
|
+
goals: s.array(Fi).min(1).max(Dt).describe(`The array of goals to update (max ${Dt}).`)
|
|
5634
|
+
}, Gi = s.object({
|
|
5596
5635
|
id: s.string().describe("The ID of the goal that was skipped."),
|
|
5597
|
-
reason: s.enum(
|
|
5636
|
+
reason: s.enum(Hi).describe(
|
|
5598
5637
|
'"no-fields" = only the id was supplied; "no-valid-values" = all updatable fields were undefined.'
|
|
5599
5638
|
)
|
|
5600
|
-
}),
|
|
5639
|
+
}), Bi = {
|
|
5601
5640
|
goals: s.array(Se).describe("The updated goals."),
|
|
5602
5641
|
totalCount: s.number().describe("The total number of goals updated."),
|
|
5603
5642
|
updatedGoalIds: s.array(s.string()).describe("The IDs of the updated goals."),
|
|
5604
5643
|
appliedOperations: s.object({
|
|
5605
5644
|
updateCount: s.number().describe("The number of goals actually updated."),
|
|
5606
5645
|
skippedCount: s.number().describe("The number of goals skipped (no changes)."),
|
|
5607
|
-
skipped: s.array(
|
|
5646
|
+
skipped: s.array(Gi).describe("Per-goal skip details (id + reason).")
|
|
5608
5647
|
}).describe("Summary of operations performed.")
|
|
5609
5648
|
};
|
|
5610
5649
|
function Re(e, t) {
|
|
5611
5650
|
return e === t ? null : e;
|
|
5612
5651
|
}
|
|
5613
|
-
function
|
|
5652
|
+
function Yi({ id: e, ...t }) {
|
|
5614
5653
|
const o = Object.values(t);
|
|
5615
5654
|
return o.length === 0 ? "no-fields" : o.every((r) => r === void 0) ? "no-valid-values" : null;
|
|
5616
5655
|
}
|
|
5617
|
-
const
|
|
5656
|
+
const qi = {
|
|
5618
5657
|
name: f.UPDATE_GOALS,
|
|
5619
5658
|
description: "Update one or more goals by their IDs.",
|
|
5620
|
-
parameters:
|
|
5621
|
-
outputSchema:
|
|
5659
|
+
parameters: Wi,
|
|
5660
|
+
outputSchema: Bi,
|
|
5622
5661
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
|
|
5623
5662
|
async execute({ goals: e }, t) {
|
|
5624
5663
|
const o = await Promise.all(
|
|
5625
5664
|
e.map(async (l) => {
|
|
5626
|
-
const p =
|
|
5665
|
+
const p = Yi(l);
|
|
5627
5666
|
if (p !== null)
|
|
5628
5667
|
return { kind: "skipped", id: l.id, reason: p };
|
|
5629
5668
|
const { id: u, description: m, deadline: h, responsibleUid: k, ...b } = l, C = await t.updateGoal(u, {
|
|
5630
5669
|
...b,
|
|
5631
5670
|
description: Re(m, ne),
|
|
5632
5671
|
deadline: Re(h, ne),
|
|
5633
|
-
responsibleUid: Re(k,
|
|
5672
|
+
responsibleUid: Re(k, Je)
|
|
5634
5673
|
});
|
|
5635
5674
|
return { kind: "updated", goal: ve(C) };
|
|
5636
5675
|
})
|
|
@@ -5639,7 +5678,7 @@ const Hi = {
|
|
|
5639
5678
|
).map((l) => l.goal), n = o.filter(
|
|
5640
5679
|
(l) => l.kind === "skipped"
|
|
5641
5680
|
).map(({ id: l, reason: p }) => ({ id: l, reason: p })), a = r.length, i = r.map((l) => `• ${l.name} (id=${l.id})`).join(`
|
|
5642
|
-
`), c =
|
|
5681
|
+
`), c = zi(n);
|
|
5643
5682
|
return {
|
|
5644
5683
|
textContent: a > 0 ? `Updated ${a} goal${a === 1 ? "" : "s"}${c}:
|
|
5645
5684
|
${i}` : `Updated 0 goals${c}`,
|
|
@@ -5656,7 +5695,7 @@ ${i}` : `Updated 0 goals${c}`,
|
|
|
5656
5695
|
};
|
|
5657
5696
|
}
|
|
5658
5697
|
};
|
|
5659
|
-
function
|
|
5698
|
+
function zi(e) {
|
|
5660
5699
|
if (e.length === 0) return "";
|
|
5661
5700
|
const t = /* @__PURE__ */ new Map();
|
|
5662
5701
|
for (const { id: r, reason: n } of e) {
|
|
@@ -5667,49 +5706,49 @@ function Wi(e) {
|
|
|
5667
5706
|
([r, n]) => `${n.length} skipped — ${r} (${n.join(", ")})`
|
|
5668
5707
|
).join("; ")})`;
|
|
5669
5708
|
}
|
|
5670
|
-
const
|
|
5709
|
+
const Ki = s.object({
|
|
5671
5710
|
labelType: s.literal("personal").describe("Update a personal label, identified by its ID."),
|
|
5672
5711
|
id: s.string().min(1).describe("The ID of the personal label to update."),
|
|
5673
5712
|
name: s.string().min(1).max(128).optional().describe("The new name of the label."),
|
|
5674
5713
|
color: de,
|
|
5675
5714
|
order: s.number().int().optional().describe("The new position of the label in the label list."),
|
|
5676
5715
|
isFavorite: s.boolean().optional().describe("Whether to mark the label as a favorite.")
|
|
5677
|
-
}),
|
|
5716
|
+
}), Vi = s.object({
|
|
5678
5717
|
labelType: s.literal("shared").describe(
|
|
5679
5718
|
"Rename a shared label across all tasks. Shared labels are identified by name; only renaming is supported (no color, order, or favorite)."
|
|
5680
5719
|
),
|
|
5681
5720
|
name: s.string().min(1).describe("The current name of the shared label."),
|
|
5682
5721
|
newName: s.string().min(1).describe("The new name for the shared label.")
|
|
5683
|
-
}),
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
]),
|
|
5687
|
-
labels: s.array(
|
|
5722
|
+
}), Ji = s.discriminatedUnion("labelType", [
|
|
5723
|
+
Ki,
|
|
5724
|
+
Vi
|
|
5725
|
+
]), Xi = {
|
|
5726
|
+
labels: s.array(Ji).min(1).describe(
|
|
5688
5727
|
'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.'
|
|
5689
5728
|
)
|
|
5690
|
-
},
|
|
5729
|
+
}, Zi = s.object({
|
|
5691
5730
|
name: s.string().describe("The previous name of the shared label."),
|
|
5692
5731
|
newName: s.string().describe("The new name of the shared label.")
|
|
5693
|
-
}),
|
|
5732
|
+
}), Qi = {
|
|
5694
5733
|
updatedLabels: s.array(pe).describe("The updated personal labels."),
|
|
5695
|
-
renamedSharedLabels: s.array(
|
|
5734
|
+
renamedSharedLabels: s.array(Zi).describe("The shared labels that were renamed."),
|
|
5696
5735
|
totalCount: s.number().describe("The total number of successful operations (personal + shared)."),
|
|
5697
5736
|
appliedOperations: s.object({
|
|
5698
5737
|
updateCount: s.number().describe("Number of personal labels updated."),
|
|
5699
5738
|
renameCount: s.number().describe("Number of shared labels renamed."),
|
|
5700
5739
|
skippedCount: s.number().describe("Number of operations skipped (no changes or shared label not found).")
|
|
5701
5740
|
}).describe("Summary of operations performed.")
|
|
5702
|
-
},
|
|
5741
|
+
}, ec = {
|
|
5703
5742
|
name: f.UPDATE_LABELS,
|
|
5704
5743
|
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.",
|
|
5705
|
-
parameters:
|
|
5706
|
-
outputSchema:
|
|
5744
|
+
parameters: Xi,
|
|
5745
|
+
outputSchema: Qi,
|
|
5707
5746
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5708
5747
|
async execute(e, t) {
|
|
5709
5748
|
const { labels: o } = e, r = await Promise.all(
|
|
5710
5749
|
o.map(async (p) => {
|
|
5711
5750
|
if (p.labelType === "personal") {
|
|
5712
|
-
const m =
|
|
5751
|
+
const m = sc(p);
|
|
5713
5752
|
if (m !== null) return { kind: "skipped", reason: m };
|
|
5714
5753
|
const { id: h, labelType: k, ...b } = p;
|
|
5715
5754
|
return { kind: "updated", label: await t.updateLabel(h, b) };
|
|
@@ -5727,7 +5766,7 @@ const Gi = s.object({
|
|
|
5727
5766
|
(p) => p.kind === "skipped" && p.reason === "not-found"
|
|
5728
5767
|
).length;
|
|
5729
5768
|
return {
|
|
5730
|
-
textContent:
|
|
5769
|
+
textContent: tc({
|
|
5731
5770
|
updatedLabels: n,
|
|
5732
5771
|
renamedSharedLabels: a,
|
|
5733
5772
|
skippedNoFields: c,
|
|
@@ -5746,7 +5785,7 @@ const Gi = s.object({
|
|
|
5746
5785
|
};
|
|
5747
5786
|
}
|
|
5748
5787
|
};
|
|
5749
|
-
function
|
|
5788
|
+
function tc({
|
|
5750
5789
|
updatedLabels: e,
|
|
5751
5790
|
renamedSharedLabels: t,
|
|
5752
5791
|
skippedNoFields: o,
|
|
@@ -5768,14 +5807,14 @@ function Ji({
|
|
|
5768
5807
|
return c.join(`
|
|
5769
5808
|
`);
|
|
5770
5809
|
}
|
|
5771
|
-
function
|
|
5810
|
+
function sc({
|
|
5772
5811
|
id: e,
|
|
5773
5812
|
labelType: t,
|
|
5774
5813
|
...o
|
|
5775
5814
|
}) {
|
|
5776
5815
|
return Object.values(o).every((n) => n === void 0) ? "no-fields" : null;
|
|
5777
5816
|
}
|
|
5778
|
-
const
|
|
5817
|
+
const oc = s.object({
|
|
5779
5818
|
id: s.string().min(1).describe("The ID of the project to update."),
|
|
5780
5819
|
name: s.string().min(1).optional().describe("The new name of the project."),
|
|
5781
5820
|
isFavorite: s.boolean().optional().describe("Whether the project is a favorite."),
|
|
@@ -5790,9 +5829,9 @@ const Zi = s.object({
|
|
|
5790
5829
|
)
|
|
5791
5830
|
).optional(),
|
|
5792
5831
|
color: de
|
|
5793
|
-
}),
|
|
5794
|
-
projects: s.array(
|
|
5795
|
-
},
|
|
5832
|
+
}), rc = {
|
|
5833
|
+
projects: s.array(oc).min(1).describe("The projects to update.")
|
|
5834
|
+
}, nc = {
|
|
5796
5835
|
projects: s.array(ue).describe("The updated projects."),
|
|
5797
5836
|
totalCount: s.number().describe("The total number of projects updated."),
|
|
5798
5837
|
updatedProjectIds: s.array(s.string()).describe("The IDs of the updated projects."),
|
|
@@ -5800,16 +5839,16 @@ const Zi = s.object({
|
|
|
5800
5839
|
updateCount: s.number().describe("The number of projects actually updated."),
|
|
5801
5840
|
skippedCount: s.number().describe("The number of projects skipped (no changes).")
|
|
5802
5841
|
}).describe("Summary of operations performed.")
|
|
5803
|
-
},
|
|
5842
|
+
}, ac = {
|
|
5804
5843
|
name: f.UPDATE_PROJECTS,
|
|
5805
5844
|
description: "Update multiple existing projects with new values.",
|
|
5806
|
-
parameters:
|
|
5807
|
-
outputSchema:
|
|
5845
|
+
parameters: rc,
|
|
5846
|
+
outputSchema: nc,
|
|
5808
5847
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5809
5848
|
async execute(e, t) {
|
|
5810
5849
|
const { projects: o } = e, r = await Promise.all(
|
|
5811
5850
|
o.map(async (d) => {
|
|
5812
|
-
const l =
|
|
5851
|
+
const l = cc(d);
|
|
5813
5852
|
if (l !== null) return { kind: "skipped", reason: l };
|
|
5814
5853
|
const { id: p, ...u } = d;
|
|
5815
5854
|
return { kind: "updated", project: await t.updateProject(p, u) };
|
|
@@ -5822,7 +5861,7 @@ const Zi = s.object({
|
|
|
5822
5861
|
(d) => d.kind === "skipped" && d.reason === "no-valid-values"
|
|
5823
5862
|
).length;
|
|
5824
5863
|
return {
|
|
5825
|
-
textContent:
|
|
5864
|
+
textContent: ic({
|
|
5826
5865
|
projects: n,
|
|
5827
5866
|
skippedNoFields: a,
|
|
5828
5867
|
skippedNoValidValues: i
|
|
@@ -5839,7 +5878,7 @@ const Zi = s.object({
|
|
|
5839
5878
|
};
|
|
5840
5879
|
}
|
|
5841
5880
|
};
|
|
5842
|
-
function
|
|
5881
|
+
function ic({
|
|
5843
5882
|
projects: e,
|
|
5844
5883
|
skippedNoFields: t,
|
|
5845
5884
|
skippedNoValidValues: o
|
|
@@ -5851,49 +5890,49 @@ function sc({
|
|
|
5851
5890
|
return t > 0 && i.push(`${t} skipped - no changes`), o > 0 && i.push(`${o} skipped - no valid field values`), i.length > 0 && (a += ` (${i.join(", ")})`), r > 0 && (a += `:
|
|
5852
5891
|
${n}`), a;
|
|
5853
5892
|
}
|
|
5854
|
-
function
|
|
5893
|
+
function cc({ id: e, ...t }) {
|
|
5855
5894
|
const o = Object.values(t);
|
|
5856
5895
|
return o.length === 0 ? "no-fields" : o.every((r) => r === void 0) ? "no-valid-values" : null;
|
|
5857
5896
|
}
|
|
5858
|
-
const
|
|
5897
|
+
const dc = s.object({
|
|
5859
5898
|
type: s.literal("relative"),
|
|
5860
5899
|
id: s.string().min(1).describe("The ID of the relative reminder to update."),
|
|
5861
5900
|
minuteOffset: s.number().int().min(0).optional().describe("New minute offset before task due time."),
|
|
5862
5901
|
service: Ce.optional().describe('New delivery method: "email" or "push".'),
|
|
5863
5902
|
isUrgent: $e
|
|
5864
|
-
}),
|
|
5903
|
+
}), lc = s.object({
|
|
5865
5904
|
type: s.literal("absolute"),
|
|
5866
5905
|
id: s.string().min(1).describe("The ID of the absolute reminder to update."),
|
|
5867
|
-
due:
|
|
5906
|
+
due: Vt.optional().describe("New due date/time for the reminder."),
|
|
5868
5907
|
service: Ce.optional().describe('New delivery method: "email" or "push".'),
|
|
5869
5908
|
isUrgent: $e
|
|
5870
|
-
}),
|
|
5909
|
+
}), uc = s.object({
|
|
5871
5910
|
type: s.literal("location"),
|
|
5872
5911
|
id: s.string().min(1).describe("The ID of the location reminder to update."),
|
|
5873
5912
|
name: s.string().optional().describe("New location name."),
|
|
5874
5913
|
locLat: s.string().optional().describe("New latitude."),
|
|
5875
5914
|
locLong: s.string().optional().describe("New longitude."),
|
|
5876
|
-
locTrigger:
|
|
5915
|
+
locTrigger: Jt.optional().describe(
|
|
5877
5916
|
'New trigger condition: "on_enter" or "on_leave".'
|
|
5878
5917
|
),
|
|
5879
5918
|
radius: s.number().int().optional().describe("New radius in meters.")
|
|
5880
|
-
}),
|
|
5881
|
-
|
|
5882
|
-
|
|
5883
|
-
|
|
5884
|
-
]),
|
|
5885
|
-
reminders: s.array(
|
|
5919
|
+
}), pc = s.discriminatedUnion("type", [
|
|
5920
|
+
dc,
|
|
5921
|
+
lc,
|
|
5922
|
+
uc
|
|
5923
|
+
]), mc = {
|
|
5924
|
+
reminders: s.array(pc).min(1).max(Te).describe(
|
|
5886
5925
|
`Array of reminders to update (max ${Te}). Each must include the reminder type and ID. Only include fields that need to change.`
|
|
5887
5926
|
)
|
|
5888
|
-
},
|
|
5889
|
-
reminders: s.array(
|
|
5927
|
+
}, hc = {
|
|
5928
|
+
reminders: s.array(rt).describe("The updated reminders."),
|
|
5890
5929
|
totalCount: s.number().describe("Total reminders updated."),
|
|
5891
5930
|
updatedReminderIds: s.array(s.string()).describe("IDs of updated reminders.")
|
|
5892
|
-
},
|
|
5931
|
+
}, fc = {
|
|
5893
5932
|
name: f.UPDATE_REMINDERS,
|
|
5894
5933
|
description: 'Update existing reminders. Each reminder must specify its type ("relative", "absolute", or "location") and ID. Only include fields that need to change.',
|
|
5895
|
-
parameters:
|
|
5896
|
-
outputSchema:
|
|
5934
|
+
parameters: mc,
|
|
5935
|
+
outputSchema: hc,
|
|
5897
5936
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !0 },
|
|
5898
5937
|
async execute(e, t) {
|
|
5899
5938
|
const { reminders: o } = e, r = o.map(async (d) => {
|
|
@@ -5927,7 +5966,7 @@ const rc = s.object({
|
|
|
5927
5966
|
}
|
|
5928
5967
|
};
|
|
5929
5968
|
}
|
|
5930
|
-
},
|
|
5969
|
+
}, bc = s.object({
|
|
5931
5970
|
id: s.string().min(1).describe("The ID of the section to update."),
|
|
5932
5971
|
name: s.string().min(1).optional().describe("The new name of the section."),
|
|
5933
5972
|
description: s.preprocess(
|
|
@@ -5942,17 +5981,17 @@ const rc = s.object({
|
|
|
5942
5981
|
).optional()
|
|
5943
5982
|
}).refine((e) => e.name !== void 0 || e.description !== void 0, {
|
|
5944
5983
|
message: 'Provide at least one of "name" or "description" to update.'
|
|
5945
|
-
}),
|
|
5946
|
-
sections: s.array(
|
|
5947
|
-
},
|
|
5984
|
+
}), gc = {
|
|
5985
|
+
sections: s.array(bc).min(1).describe("The sections to update.")
|
|
5986
|
+
}, yc = {
|
|
5948
5987
|
sections: s.array(ce).describe("The updated sections."),
|
|
5949
5988
|
totalCount: s.number().describe("The total number of sections updated."),
|
|
5950
5989
|
updatedSectionIds: s.array(s.string()).describe("The IDs of the updated sections.")
|
|
5951
|
-
},
|
|
5990
|
+
}, kc = {
|
|
5952
5991
|
name: f.UPDATE_SECTIONS,
|
|
5953
5992
|
description: "Update multiple existing sections with new values.",
|
|
5954
|
-
parameters:
|
|
5955
|
-
outputSchema:
|
|
5993
|
+
parameters: gc,
|
|
5994
|
+
outputSchema: yc,
|
|
5956
5995
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5957
5996
|
async execute({ sections: e }, t) {
|
|
5958
5997
|
const o = await Promise.all(
|
|
@@ -5965,7 +6004,7 @@ const rc = s.object({
|
|
|
5965
6004
|
})
|
|
5966
6005
|
);
|
|
5967
6006
|
return {
|
|
5968
|
-
textContent:
|
|
6007
|
+
textContent: Tc({
|
|
5969
6008
|
sections: o
|
|
5970
6009
|
}),
|
|
5971
6010
|
structuredContent: {
|
|
@@ -5976,13 +6015,13 @@ const rc = s.object({
|
|
|
5976
6015
|
};
|
|
5977
6016
|
}
|
|
5978
6017
|
};
|
|
5979
|
-
function
|
|
6018
|
+
function Tc({ sections: e }) {
|
|
5980
6019
|
const t = e.length, o = e.map((n) => `• ${n.name} (id=${n.id}, projectId=${n.projectId})`).join(`
|
|
5981
6020
|
`);
|
|
5982
6021
|
return `Updated ${t} section${t === 1 ? "" : "s"}:
|
|
5983
6022
|
${o}`;
|
|
5984
6023
|
}
|
|
5985
|
-
const
|
|
6024
|
+
const wc = s.object({
|
|
5986
6025
|
id: s.string().min(1).describe("The ID of the task to update."),
|
|
5987
6026
|
content: s.string().optional().describe(
|
|
5988
6027
|
'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.'
|
|
@@ -5996,7 +6035,7 @@ const bc = s.object({
|
|
|
5996
6035
|
sectionId: s.string().optional().describe("The new section ID for the task."),
|
|
5997
6036
|
parentId: s.string().optional().describe("The new parent task ID (for subtasks)."),
|
|
5998
6037
|
order: s.number().optional().describe("The new order of the task within its parent/section."),
|
|
5999
|
-
priority:
|
|
6038
|
+
priority: et.optional().describe(Qe),
|
|
6000
6039
|
dueString: s.preprocess(
|
|
6001
6040
|
// Keep accepting legacy null while exposing a Gemini-compatible string schema.
|
|
6002
6041
|
(e) => e === null ? "remove" : e,
|
|
@@ -6021,9 +6060,9 @@ const bc = s.object({
|
|
|
6021
6060
|
isUncompletable: s.boolean().optional().describe(
|
|
6022
6061
|
"Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
|
|
6023
6062
|
)
|
|
6024
|
-
}),
|
|
6025
|
-
tasks: s.array(
|
|
6026
|
-
},
|
|
6063
|
+
}), vc = ["remove", "no date"], Ic = ["remove", "no date", "no deadline"], jc = "no date", Sc = {
|
|
6064
|
+
tasks: s.array(wc).min(1).describe("The tasks to update.")
|
|
6065
|
+
}, Cc = {
|
|
6027
6066
|
tasks: s.array(J).describe("The updated tasks."),
|
|
6028
6067
|
totalCount: s.number().describe("The total number of tasks updated."),
|
|
6029
6068
|
updatedTaskIds: s.array(s.string()).describe("The IDs of the updated tasks."),
|
|
@@ -6031,15 +6070,15 @@ const bc = s.object({
|
|
|
6031
6070
|
updateCount: s.number().describe("The number of tasks actually updated."),
|
|
6032
6071
|
skippedCount: s.number().describe("The number of tasks skipped (no changes).")
|
|
6033
6072
|
}).describe("Summary of operations performed.")
|
|
6034
|
-
},
|
|
6073
|
+
}, $c = {
|
|
6035
6074
|
name: f.UPDATE_TASKS,
|
|
6036
6075
|
description: "Update existing tasks including content, dates, priorities, and assignments.",
|
|
6037
|
-
parameters:
|
|
6038
|
-
outputSchema:
|
|
6076
|
+
parameters: Sc,
|
|
6077
|
+
outputSchema: Cc,
|
|
6039
6078
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
6040
6079
|
async execute(e, t) {
|
|
6041
6080
|
const { tasks: o } = e, r = o.map(async (c) => {
|
|
6042
|
-
if (!
|
|
6081
|
+
if (!Ac(c))
|
|
6043
6082
|
return;
|
|
6044
6083
|
const {
|
|
6045
6084
|
id: d,
|
|
@@ -6061,21 +6100,21 @@ const bc = s.object({
|
|
|
6061
6100
|
...x,
|
|
6062
6101
|
...C !== void 0 && { labels: C }
|
|
6063
6102
|
};
|
|
6064
|
-
b && (y.priority =
|
|
6065
|
-
const D =
|
|
6103
|
+
b && (y.priority = Gt(b));
|
|
6104
|
+
const D = At(
|
|
6066
6105
|
m,
|
|
6067
|
-
|
|
6068
|
-
|
|
6106
|
+
vc,
|
|
6107
|
+
jc
|
|
6069
6108
|
);
|
|
6070
6109
|
D !== void 0 && (y = { ...y, dueString: D });
|
|
6071
|
-
const R =
|
|
6110
|
+
const R = At(
|
|
6072
6111
|
I,
|
|
6073
|
-
|
|
6112
|
+
Ic,
|
|
6074
6113
|
null
|
|
6075
6114
|
);
|
|
6076
6115
|
if (R !== void 0 && (y = { ...y, deadlineDate: R }), h)
|
|
6077
6116
|
try {
|
|
6078
|
-
const { minutes: S } =
|
|
6117
|
+
const { minutes: S } = Wt(h);
|
|
6079
6118
|
y = {
|
|
6080
6119
|
...y,
|
|
6081
6120
|
duration: S,
|
|
@@ -6088,7 +6127,7 @@ const bc = s.object({
|
|
|
6088
6127
|
if (k === null || k === "unassign")
|
|
6089
6128
|
y = { ...y, assigneeId: null };
|
|
6090
6129
|
else {
|
|
6091
|
-
const S = await
|
|
6130
|
+
const S = await at.validateTaskUpdateAssignment(
|
|
6092
6131
|
t,
|
|
6093
6132
|
d,
|
|
6094
6133
|
k
|
|
@@ -6103,13 +6142,13 @@ const bc = s.object({
|
|
|
6103
6142
|
}
|
|
6104
6143
|
if (!w && !p && !u)
|
|
6105
6144
|
return await t.updateTask(d, y);
|
|
6106
|
-
const v =
|
|
6145
|
+
const v = Go(d, w, p, u), $ = await t.moveTask(d, v);
|
|
6107
6146
|
return Object.keys(y).length > 0 ? await t.updateTask(d, y) : $;
|
|
6108
6147
|
}), n = (await Promise.all(r)).filter(
|
|
6109
6148
|
(c) => c !== void 0
|
|
6110
6149
|
), a = n.map(_);
|
|
6111
6150
|
return {
|
|
6112
|
-
textContent:
|
|
6151
|
+
textContent: Dc({
|
|
6113
6152
|
tasks: a,
|
|
6114
6153
|
args: e
|
|
6115
6154
|
}),
|
|
@@ -6125,21 +6164,21 @@ const bc = s.object({
|
|
|
6125
6164
|
};
|
|
6126
6165
|
}
|
|
6127
6166
|
};
|
|
6128
|
-
function
|
|
6167
|
+
function Dc({
|
|
6129
6168
|
tasks: e,
|
|
6130
6169
|
args: t
|
|
6131
6170
|
}) {
|
|
6132
6171
|
const o = t.tasks.length, r = e.length, n = o - r;
|
|
6133
6172
|
let a = "";
|
|
6134
|
-
return n > 0 && (a = ` (${n} skipped - no changes)`),
|
|
6173
|
+
return n > 0 && (a = ` (${n} skipped - no changes)`), it("Updated", e, {
|
|
6135
6174
|
context: a,
|
|
6136
6175
|
showDetails: e.length <= 5
|
|
6137
6176
|
});
|
|
6138
6177
|
}
|
|
6139
|
-
function
|
|
6178
|
+
function Ac({ id: e, ...t }) {
|
|
6140
6179
|
return Object.keys(t).length > 0;
|
|
6141
6180
|
}
|
|
6142
|
-
function
|
|
6181
|
+
function At(e, t, o) {
|
|
6143
6182
|
if (e === void 0)
|
|
6144
6183
|
return e;
|
|
6145
6184
|
if (e === null)
|
|
@@ -6147,7 +6186,7 @@ function Dt(e, t, o) {
|
|
|
6147
6186
|
const r = e.trim().toLowerCase();
|
|
6148
6187
|
return t.includes(r) ? o : e;
|
|
6149
6188
|
}
|
|
6150
|
-
const
|
|
6189
|
+
const xc = {}, Ec = {
|
|
6151
6190
|
type: s.literal("user_info").describe("The type of the response."),
|
|
6152
6191
|
userId: s.string().describe("The user ID."),
|
|
6153
6192
|
fullName: s.string().describe("The full name of the user."),
|
|
@@ -6164,36 +6203,36 @@ const Sc = {}, Cc = {
|
|
|
6164
6203
|
email: s.string().describe("The email address of the user."),
|
|
6165
6204
|
plan: s.enum(["Todoist Free", "Todoist Pro", "Todoist Business"]).describe("The user plan.")
|
|
6166
6205
|
};
|
|
6167
|
-
function
|
|
6206
|
+
function Oc(e) {
|
|
6168
6207
|
return e.businessAccountId ? "Todoist Business" : e.isPremium ? "Todoist Pro" : "Todoist Free";
|
|
6169
6208
|
}
|
|
6170
|
-
function
|
|
6209
|
+
function Uc(e, t) {
|
|
6171
6210
|
const r = ((e.getDay() || 7) - t + 7) % 7, n = new Date(e);
|
|
6172
6211
|
return n.setDate(e.getDate() - r), n;
|
|
6173
6212
|
}
|
|
6174
|
-
function
|
|
6213
|
+
function Pc(e) {
|
|
6175
6214
|
const t = new Date(e);
|
|
6176
6215
|
return t.setDate(e.getDate() + 6), t;
|
|
6177
6216
|
}
|
|
6178
|
-
function
|
|
6217
|
+
function _c(e) {
|
|
6179
6218
|
const t = new Date(e.getFullYear(), 0, 1), o = (e.getTime() - t.getTime()) / 864e5;
|
|
6180
6219
|
return Math.ceil((o + t.getDay() + 1) / 7);
|
|
6181
6220
|
}
|
|
6182
|
-
function
|
|
6221
|
+
function Rc(e) {
|
|
6183
6222
|
return ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"][e === 7 ? 0 : e] ?? "Unknown";
|
|
6184
6223
|
}
|
|
6185
|
-
function
|
|
6224
|
+
function Nc(e) {
|
|
6186
6225
|
try {
|
|
6187
6226
|
return new Intl.DateTimeFormat("en-US", { timeZone: e }), !0;
|
|
6188
6227
|
} catch {
|
|
6189
6228
|
return !1;
|
|
6190
6229
|
}
|
|
6191
6230
|
}
|
|
6192
|
-
function
|
|
6193
|
-
return
|
|
6231
|
+
function us(e) {
|
|
6232
|
+
return Nc(e) ? e : "UTC";
|
|
6194
6233
|
}
|
|
6195
|
-
function
|
|
6196
|
-
const o =
|
|
6234
|
+
function Lc(e, t) {
|
|
6235
|
+
const o = us(t);
|
|
6197
6236
|
return e.toLocaleString("en-US", {
|
|
6198
6237
|
timeZone: o,
|
|
6199
6238
|
year: "numeric",
|
|
@@ -6205,8 +6244,8 @@ function Uc(e, t) {
|
|
|
6205
6244
|
hour12: !1
|
|
6206
6245
|
});
|
|
6207
6246
|
}
|
|
6208
|
-
async function
|
|
6209
|
-
const t = await e.getUser(), o = t.tzInfo?.timezone ?? "UTC", r =
|
|
6247
|
+
async function Mc(e) {
|
|
6248
|
+
const t = await e.getUser(), o = t.tzInfo?.timezone ?? "UTC", r = us(o), n = /* @__PURE__ */ new Date(), a = Lc(n, r), i = t.startDay ?? 1, c = Rc(i), d = Oc(t), l = new Date(n.toLocaleString("en-US", { timeZone: r })), p = Uc(l, i), u = Pc(p), m = _c(l), k = [
|
|
6210
6249
|
"# User Information",
|
|
6211
6250
|
"",
|
|
6212
6251
|
`**User ID:** ${t.id}`,
|
|
@@ -6248,26 +6287,26 @@ async function Pc(e) {
|
|
|
6248
6287
|
};
|
|
6249
6288
|
return { textContent: k, structuredContent: b };
|
|
6250
6289
|
}
|
|
6251
|
-
const
|
|
6290
|
+
const Fc = {
|
|
6252
6291
|
name: f.USER_INFO,
|
|
6253
6292
|
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).",
|
|
6254
|
-
parameters:
|
|
6255
|
-
outputSchema:
|
|
6293
|
+
parameters: xc,
|
|
6294
|
+
outputSchema: Ec,
|
|
6256
6295
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
6257
6296
|
async execute(e, t) {
|
|
6258
|
-
const o = await
|
|
6297
|
+
const o = await Mc(t);
|
|
6259
6298
|
return {
|
|
6260
6299
|
textContent: o.textContent,
|
|
6261
6300
|
structuredContent: o.structuredContent
|
|
6262
6301
|
};
|
|
6263
6302
|
}
|
|
6264
|
-
},
|
|
6303
|
+
}, xt = 10 * 1024 * 1024, Hc = /* @__PURE__ */ new Set([
|
|
6265
6304
|
"image/png",
|
|
6266
6305
|
"image/jpeg",
|
|
6267
6306
|
"image/gif",
|
|
6268
6307
|
"image/webp",
|
|
6269
6308
|
"image/svg+xml"
|
|
6270
|
-
]),
|
|
6309
|
+
]), Wc = /* @__PURE__ */ new Set([
|
|
6271
6310
|
"text/plain",
|
|
6272
6311
|
"text/csv",
|
|
6273
6312
|
"text/html",
|
|
@@ -6275,7 +6314,7 @@ const _c = {
|
|
|
6275
6314
|
"application/json",
|
|
6276
6315
|
"application/xml",
|
|
6277
6316
|
"text/xml"
|
|
6278
|
-
]),
|
|
6317
|
+
]), Gc = {
|
|
6279
6318
|
".png": "image/png",
|
|
6280
6319
|
".jpg": "image/jpeg",
|
|
6281
6320
|
".jpeg": "image/jpeg",
|
|
@@ -6290,23 +6329,23 @@ const _c = {
|
|
|
6290
6329
|
".xml": "application/xml",
|
|
6291
6330
|
".pdf": "application/pdf"
|
|
6292
6331
|
};
|
|
6293
|
-
function
|
|
6294
|
-
return
|
|
6332
|
+
function Bc(e) {
|
|
6333
|
+
return Hc.has(e) ? "image" : Wc.has(e) || e.startsWith("text/") ? "text" : "binary";
|
|
6295
6334
|
}
|
|
6296
|
-
function
|
|
6335
|
+
function Yc(e) {
|
|
6297
6336
|
return (e.split(";")[0] ?? e).trim().toLowerCase();
|
|
6298
6337
|
}
|
|
6299
|
-
function
|
|
6338
|
+
function qc(e) {
|
|
6300
6339
|
try {
|
|
6301
6340
|
const t = new URL(e).pathname, o = t.lastIndexOf(".");
|
|
6302
6341
|
if (o === -1) return;
|
|
6303
6342
|
const r = t.slice(o).toLowerCase();
|
|
6304
|
-
return
|
|
6343
|
+
return Gc[r];
|
|
6305
6344
|
} catch {
|
|
6306
6345
|
return;
|
|
6307
6346
|
}
|
|
6308
6347
|
}
|
|
6309
|
-
function
|
|
6348
|
+
function zc(e) {
|
|
6310
6349
|
try {
|
|
6311
6350
|
const t = new URL(e).pathname, o = t.lastIndexOf("/");
|
|
6312
6351
|
return o === -1 ? void 0 : t.slice(o + 1) || void 0;
|
|
@@ -6314,31 +6353,31 @@ function Wc(e) {
|
|
|
6314
6353
|
return;
|
|
6315
6354
|
}
|
|
6316
6355
|
}
|
|
6317
|
-
const
|
|
6356
|
+
const Kc = {
|
|
6318
6357
|
fileUrl: s.url().describe(
|
|
6319
6358
|
"The URL of the attachment file to view. Get this from the fileUrl field in a comment's fileAttachment."
|
|
6320
6359
|
)
|
|
6321
|
-
},
|
|
6360
|
+
}, Vc = {
|
|
6322
6361
|
name: f.VIEW_ATTACHMENT,
|
|
6323
6362
|
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).",
|
|
6324
|
-
parameters:
|
|
6363
|
+
parameters: Kc,
|
|
6325
6364
|
annotations: {
|
|
6326
6365
|
readOnlyHint: !0,
|
|
6327
6366
|
destructiveHint: !1,
|
|
6328
6367
|
idempotentHint: !0
|
|
6329
6368
|
},
|
|
6330
6369
|
async execute({ fileUrl: e }, t) {
|
|
6331
|
-
const o = await t.viewAttachment(e), r = o.headers["content-length"], n = r ? Number.parseInt(r, 10) : void 0, a =
|
|
6332
|
-
if (n && n >
|
|
6370
|
+
const o = await t.viewAttachment(e), r = o.headers["content-length"], n = r ? Number.parseInt(r, 10) : void 0, a = zc(e), i = o.headers["content-type"], c = i ? Yc(i) : void 0, d = c && c !== "application/octet-stream" ? c : qc(e) ?? c ?? "application/octet-stream";
|
|
6371
|
+
if (n && n > xt)
|
|
6333
6372
|
return {
|
|
6334
6373
|
textContent: `Attachment "${a ?? e}" is too large to display inline (${(n / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
|
|
6335
6374
|
};
|
|
6336
6375
|
const l = Buffer.from(await o.arrayBuffer()), p = l.byteLength;
|
|
6337
|
-
if (p >
|
|
6376
|
+
if (p > xt)
|
|
6338
6377
|
return {
|
|
6339
6378
|
textContent: `Attachment "${a ?? e}" is too large to display inline (${(p / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
|
|
6340
6379
|
};
|
|
6341
|
-
const u =
|
|
6380
|
+
const u = Bc(d), m = [];
|
|
6342
6381
|
return u === "image" ? m.push({
|
|
6343
6382
|
type: "image",
|
|
6344
6383
|
data: l.toString("base64"),
|
|
@@ -6358,7 +6397,7 @@ const Gc = {
|
|
|
6358
6397
|
contentItems: m
|
|
6359
6398
|
};
|
|
6360
6399
|
}
|
|
6361
|
-
},
|
|
6400
|
+
}, Jc = `
|
|
6362
6401
|
## Todoist Task and Project Management Tools
|
|
6363
6402
|
|
|
6364
6403
|
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.
|
|
@@ -6460,31 +6499,31 @@ You have access to comprehensive Todoist management tools for personal productiv
|
|
|
6460
6499
|
|
|
6461
6500
|
Always provide clear, actionable task titles and descriptions. Use the overview tools to give users context about their workload and project status.
|
|
6462
6501
|
`;
|
|
6463
|
-
function
|
|
6502
|
+
function ld({
|
|
6464
6503
|
todoistApiKey: e,
|
|
6465
6504
|
baseUrl: t,
|
|
6466
6505
|
features: o = []
|
|
6467
6506
|
}) {
|
|
6468
|
-
const r = new
|
|
6469
|
-
{ name: "todoist-mcp-server", version:
|
|
6507
|
+
const r = new ms(
|
|
6508
|
+
{ name: "todoist-mcp-server", version: Ze },
|
|
6470
6509
|
{
|
|
6471
6510
|
capabilities: {
|
|
6472
6511
|
tools: { listChanged: !0 },
|
|
6473
6512
|
prompts: { listChanged: !0 }
|
|
6474
6513
|
},
|
|
6475
|
-
instructions:
|
|
6514
|
+
instructions: Jc
|
|
6476
6515
|
}
|
|
6477
|
-
), n =
|
|
6478
|
-
...
|
|
6516
|
+
), n = ao(e, { baseUrl: t }), a = {
|
|
6517
|
+
...ua,
|
|
6479
6518
|
_meta: {
|
|
6480
6519
|
ui: {
|
|
6481
6520
|
resourceUri: He
|
|
6482
6521
|
}
|
|
6483
6522
|
}
|
|
6484
6523
|
};
|
|
6485
|
-
|
|
6524
|
+
Ps(r);
|
|
6486
6525
|
const i = { server: r, client: n, features: o };
|
|
6487
|
-
return g({ tool:
|
|
6526
|
+
return g({ tool: zr, ...i }), g({ tool: nn, ...i }), g({ tool: $i, ...i }), g({ tool: $c, ...i }), g({ tool: Ti, ...i }), g({ tool: ya, ...i }), g({ tool: a, ...i }), g({ tool: _n, ...i }), g({ tool: Cr, ...i }), g({ tool: ac, ...i }), g({ tool: Zn, ...i }), g({ tool: li, ...i }), g({ tool: mi, ...i }), g({ tool: Mr, ...i }), g({ tool: kc, ...i }), g({ tool: ia, ...i }), g({ tool: Mn, ...i }), g({ tool: hr, ...i }), g({ tool: qi, ...i }), g({ tool: sn, ...i }), g({ tool: Ja, ...i }), g({ tool: tr, ...i }), g({ tool: Cn, ...i }), g({ tool: Oi, ...i }), g({ tool: Pr, ...i }), g({ tool: sa, ...i }), g({ tool: fc, ...i }), g({ tool: Vc, ...i }), g({ tool: yr, ...i }), g({ tool: ec, ...i }), g({ tool: Wn, ...i }), g({ tool: nr, ...i }), g({ tool: lr, ...i }), g({ tool: Ni, ...i }), g({ tool: kn, ...i }), g({ tool: Ea, ...i }), g({ tool: Ga, ...i }), g({ tool: Ra, ...i }), g({ tool: Qr, ...i }), g({ tool: za, ...i }), g({ tool: Da, ...i }), g({ tool: ln, ...i }), g({ tool: mn, ...i }), g({ tool: bi, ...i }), g({ tool: Fc, ...i }), g({ tool: qn, ...i }), g({ tool: ii, ...i }), g({ tool: ti, ...i }), g({ tool: ji, ...i }), g({ tool: bn, ...i }), r.registerPrompt(
|
|
6488
6527
|
me.name,
|
|
6489
6528
|
{
|
|
6490
6529
|
title: me.title,
|
|
@@ -6495,53 +6534,53 @@ function nd({
|
|
|
6495
6534
|
), r;
|
|
6496
6535
|
}
|
|
6497
6536
|
export {
|
|
6498
|
-
|
|
6499
|
-
|
|
6500
|
-
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
|
|
6506
|
-
|
|
6507
|
-
|
|
6508
|
-
|
|
6509
|
-
|
|
6510
|
-
|
|
6511
|
-
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
|
|
6515
|
-
|
|
6516
|
-
|
|
6517
|
-
|
|
6518
|
-
|
|
6519
|
-
|
|
6520
|
-
|
|
6521
|
-
|
|
6522
|
-
|
|
6523
|
-
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
6537
|
+
Ja as A,
|
|
6538
|
+
sn as B,
|
|
6539
|
+
qi as C,
|
|
6540
|
+
hr as D,
|
|
6541
|
+
Mn as E,
|
|
6542
|
+
ia as F,
|
|
6543
|
+
kc as G,
|
|
6544
|
+
Mr as H,
|
|
6545
|
+
Zn as I,
|
|
6546
|
+
ac as J,
|
|
6547
|
+
Cr as K,
|
|
6548
|
+
Ti as L,
|
|
6549
|
+
_n as M,
|
|
6550
|
+
ua as N,
|
|
6551
|
+
ya as O,
|
|
6552
|
+
$c as P,
|
|
6553
|
+
$i as Q,
|
|
6554
|
+
nn as R,
|
|
6555
|
+
zr as S,
|
|
6556
|
+
dd as T,
|
|
6557
|
+
ao as U,
|
|
6558
|
+
Xs as V,
|
|
6559
|
+
po as W,
|
|
6560
|
+
qn as a,
|
|
6561
|
+
Da as b,
|
|
6562
|
+
za as c,
|
|
6563
|
+
ln as d,
|
|
6564
|
+
Qr as e,
|
|
6565
|
+
bn as f,
|
|
6566
|
+
ld as g,
|
|
6567
|
+
Ra as h,
|
|
6568
|
+
Ga as i,
|
|
6569
|
+
Ea as j,
|
|
6570
|
+
kn as k,
|
|
6571
|
+
ti as l,
|
|
6572
|
+
ii as m,
|
|
6573
|
+
Ni as n,
|
|
6574
|
+
lr as o,
|
|
6575
|
+
nr as p,
|
|
6576
|
+
Wn as q,
|
|
6577
|
+
bi as r,
|
|
6578
|
+
ji as s,
|
|
6579
|
+
ec as t,
|
|
6580
|
+
Fc as u,
|
|
6581
|
+
yr as v,
|
|
6582
|
+
Vc as w,
|
|
6583
|
+
Cn as x,
|
|
6584
|
+
Oi as y,
|
|
6585
|
+
tr as z
|
|
6547
6586
|
};
|