@doist/todoist-mcp 10.1.2 → 10.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,34 +1,34 @@
1
- import { McpServer as ns } from "@modelcontextprotocol/sdk/server/mcp.js";
2
- import { createHash as as, randomUUID as Le } from "node:crypto";
3
- import { readFileSync as is } from "node:fs";
4
- import { dirname as $t, join as Ne } from "node:path";
5
- import { fileURLToPath as cs } from "node:url";
6
- import { registerAppResource as ds, RESOURCE_MIME_TYPE as ls, registerAppTool as us } from "@modelcontextprotocol/ext-apps/server";
7
- import Z, { ZodError as ps, z as s } from "zod";
8
- import { AsyncLocalStorage as ms } from "node:async_hooks";
9
- import { createRequire as hs } from "node:module";
10
- import { TodoistApi as fs, isWorkspaceProject as ke, isPersonalProject as ae, colors as Me, LOCATION_TRIGGERS as Dt, REMINDER_TYPES as bs, createCommand as Y, REMINDER_DELIVERY_SERVICES as gs, HEALTH_STATUSES as ze, getTaskUrl as xt, getProjectUrl as At, GOAL_OWNER_TYPES as ys, WORKSPACE_ROLES as ks, WORKSPACE_PLANS as Ts } from "@doist/todoist-sdk";
11
- import { addDays as Fe, formatISO as at } from "date-fns";
12
- const it = $t(cs(import.meta.url)), ws = [
13
- Ne(it, "task-list", "index.html"),
14
- Ne(it, "mcp-apps", "index.html")
15
- ], Is = `<!doctype html>
1
+ import { ResourceTemplate as is, McpServer as cs } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { createHash as ds, randomUUID as Le } from "node:crypto";
3
+ import { readFileSync as ls } from "node:fs";
4
+ import { dirname as xt, join as Ne } from "node:path";
5
+ import { fileURLToPath as us } from "node:url";
6
+ import { registerAppResource as ps, RESOURCE_MIME_TYPE as At, registerAppTool as ms } from "@modelcontextprotocol/ext-apps/server";
7
+ import Z, { ZodError as hs, z as s } from "zod";
8
+ import { AsyncLocalStorage as fs } from "node:async_hooks";
9
+ import { createRequire as bs } from "node:module";
10
+ import { TodoistApi as gs, isWorkspaceProject as ke, isPersonalProject as ae, colors as Me, LOCATION_TRIGGERS as Et, REMINDER_TYPES as ys, createCommand as Y, REMINDER_DELIVERY_SERVICES as ks, HEALTH_STATUSES as Ve, getTaskUrl as Ot, getProjectUrl as Ut, GOAL_OWNER_TYPES as Ts, WORKSPACE_ROLES as ws, WORKSPACE_PLANS as Is } from "@doist/todoist-sdk";
11
+ import { addDays as Fe, formatISO as ct } from "date-fns";
12
+ const dt = xt(us(import.meta.url)), vs = [
13
+ Ne(dt, "task-list", "index.html"),
14
+ Ne(dt, "mcp-apps", "index.html")
15
+ ], Ss = `<!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 vs() {
21
+ function js() {
22
22
  const e = [];
23
- for (const t of ws)
23
+ for (const t of vs)
24
24
  try {
25
- return is(t, "utf-8");
25
+ return ls(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), Is;
29
+ return console.error("Failed to load task list app HTML from any known path:", e), Ss;
30
30
  }
31
- const Et = vs(), Ss = as("sha256").update(Et).digest("hex").slice(0, 12), He = `ui://todoist/task-list@${Ss}`, Ot = "Interactive task list widget", js = "https://ai.todoist.net", ct = {
31
+ const _t = js(), Cs = ds("sha256").update(_t).digest("hex").slice(0, 12), He = `ui://todoist/task-list@${Cs}`, $s = "ui://todoist/task-list@{hash}", We = "Interactive task list widget", Ds = "https://ai.todoist.net", Ge = {
32
32
  ui: {
33
33
  prefersBorder: !0,
34
34
  csp: {
@@ -37,39 +37,51 @@ const Et = vs(), Ss = as("sha256").update(Et).digest("hex").slice(0, 12), He = `
37
37
  resourceDomains: []
38
38
  }
39
39
  },
40
- "openai/widgetDescription": Ot,
40
+ "openai/widgetDescription": We,
41
41
  "openai/widgetPrefersBorder": !0,
42
42
  "openai/widgetCSP": {
43
43
  connect_domains: [],
44
44
  resource_domains: []
45
45
  },
46
- "openai/widgetDomain": js
46
+ "openai/widgetDomain": Ds
47
47
  };
48
- function Cs(e) {
49
- ds(
48
+ function lt(e) {
49
+ return {
50
+ contents: [
51
+ {
52
+ uri: e,
53
+ mimeType: At,
54
+ text: _t,
55
+ _meta: Ge
56
+ }
57
+ ]
58
+ };
59
+ }
60
+ function xs(e) {
61
+ ps(
50
62
  e,
51
63
  "todoist-task-list",
52
64
  He,
53
65
  {
54
- description: Ot,
55
- _meta: ct
66
+ description: We,
67
+ _meta: Ge
56
68
  },
57
- async () => ({
58
- contents: [
59
- {
60
- uri: He,
61
- mimeType: ls,
62
- text: Et,
63
- _meta: ct
64
- }
65
- ]
66
- })
69
+ async () => lt(He)
70
+ ), e.registerResource(
71
+ "todoist-task-list-hash-fallback",
72
+ new is($s, { list: void 0 }),
73
+ {
74
+ description: `${We} compatibility fallback`,
75
+ mimeType: At,
76
+ _meta: Ge
77
+ },
78
+ async (t) => lt(t.toString())
67
79
  );
68
80
  }
69
81
  function q(e) {
70
82
  return typeof e == "object" && e !== null;
71
83
  }
72
- function We(...e) {
84
+ function Be(...e) {
73
85
  return e.find(q);
74
86
  }
75
87
  function L(...e) {
@@ -93,17 +105,17 @@ function Q(e) {
93
105
  const t = O(e);
94
106
  return t !== void 0 ? t : T(e);
95
107
  }
96
- function $s(e) {
108
+ function As(e) {
97
109
  return e.replace(/\b(Bearer)\s+[A-Za-z0-9._~+/=-]+/gi, "$1 [REDACTED]").replace(
98
110
  /\b(token|api[_-]?key|authorization)\s*[:=]\s*["']?[A-Za-z0-9._~+/=-]{6,}["']?/gi,
99
111
  "$1: [REDACTED]"
100
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]");
101
113
  }
102
114
  function _(e, t = 220) {
103
- const o = $s(e).replace(/\s+/g, " ").trim();
115
+ const o = As(e).replace(/\s+/g, " ").trim();
104
116
  return o.length <= t ? o : `${o.slice(0, t - 3)}...`;
105
117
  }
106
- function dt(e) {
118
+ function ut(e) {
107
119
  const t = e.trim();
108
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);
109
121
  }
@@ -141,7 +153,7 @@ function B(e) {
141
153
  }
142
154
  return r.length > 0 ? _(r.join("; ")) : void 0;
143
155
  }
144
- function Ds(e) {
156
+ function Es(e) {
145
157
  if (!e)
146
158
  return [];
147
159
  const t = /* @__PURE__ */ new Set(), o = (i) => {
@@ -153,7 +165,7 @@ function Ds(e) {
153
165
  T(e.path)
154
166
  );
155
167
  o(r);
156
- const n = We(
168
+ const n = Be(
157
169
  e.details,
158
170
  e.errorDetails,
159
171
  e.errorExtra,
@@ -204,7 +216,7 @@ function Ds(e) {
204
216
  }
205
217
  return Array.from(t).slice(0, 3);
206
218
  }
207
- const xs = [
219
+ const Os = [
208
220
  "error",
209
221
  "error_code",
210
222
  "error_tag",
@@ -215,14 +227,14 @@ const xs = [
215
227
  "httpCode",
216
228
  "errorExtra"
217
229
  ];
218
- function As(e) {
219
- return e ? xs.some((t) => e[t] !== void 0) : !1;
230
+ function Us(e) {
231
+ return e ? Os.some((t) => e[t] !== void 0) : !1;
220
232
  }
221
- function Es(e, t) {
233
+ function _s(e, t) {
222
234
  return e === 401 || e === 403 ? "Verify your API token and access permissions, then retry." : e === 404 ? "Confirm the referenced IDs exist and are accessible, then retry." : e === 429 ? "Rate limit reached. Wait briefly and retry." : e !== void 0 && e >= 500 ? "Todoist API may be temporarily unavailable. Retry shortly." : t ? "Fix the field hints above and retry." : e === 400 || e === 422 ? "Check parameter values and formats, then retry." : "Check the request parameters and retry.";
223
235
  }
224
- function Os(e) {
225
- const t = q(e) ? e : void 0, o = e instanceof Error && q(e.cause) ? e.cause : void 0, r = We(t?.response, o?.response), n = We(
236
+ function Ps(e) {
237
+ const t = q(e) ? e : void 0, o = e instanceof Error && q(e.cause) ? e.cause : void 0, r = Be(t?.response, o?.response), n = Be(
226
238
  t?.responseData,
227
239
  r?.data,
228
240
  t?.data,
@@ -262,15 +274,15 @@ function Os(e) {
262
274
  T(t?.message),
263
275
  T(o?.message),
264
276
  e instanceof Error ? e.message : T(e)
265
- ].filter((h) => !!h), l = d.find((h) => !dt(h)) || d[0], u = L(
277
+ ].filter((h) => !!h), l = d.find((h) => !ut(h)) || d[0], u = L(
266
278
  B(n?.errorExtra),
267
279
  B(n?.error_extra),
268
280
  B(n?.details),
269
281
  B(n?.errorDetails),
270
282
  B(n?.errors),
271
283
  B(t?.details)
272
- ), p = Ds(n);
273
- return a !== void 0 || As(n) || c !== void 0 || i !== void 0 || (l ? dt(l) : !1) ? {
284
+ ), p = Es(n);
285
+ return a !== void 0 || Us(n) || c !== void 0 || i !== void 0 || (l ? ut(l) : !1) ? {
274
286
  statusCode: a,
275
287
  code: i,
276
288
  tag: c ? _(c, 80) : void 0,
@@ -279,67 +291,67 @@ function Os(e) {
279
291
  fieldHints: p
280
292
  } : null;
281
293
  }
282
- function Us(e) {
294
+ function Rs(e) {
283
295
  const t = [];
284
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}`);
285
297
  const o = [
286
298
  t.length > 0 ? `Todoist API request failed (${t.join(", ")}).` : "Todoist API request failed."
287
299
  ];
288
- 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: ${Es(e.statusCode, e.fieldHints.length > 0)}`), o.join(`
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: ${_s(e.statusCode, e.fieldHints.length > 0)}`), o.join(`
289
301
  `);
290
302
  }
291
- function _s(e) {
303
+ function Ls(e) {
292
304
  return e instanceof Error ? _(e.message) : typeof e == "string" ? _(e) : "An unknown error occurred";
293
305
  }
294
- function Ps(e) {
295
- if (e instanceof ps)
306
+ function Ns(e) {
307
+ if (e instanceof hs)
296
308
  return e.message;
297
- const t = Os(e);
298
- return t ? Us(t) : _s(e);
309
+ const t = Ps(e);
310
+ return t ? Rs(t) : Ls(e);
299
311
  }
300
- const Rs = "10.1.2", Ls = {
301
- version: Rs
302
- }, Ns = "todoist-mcp", Ke = Ls.version, Ut = new ms(), lt = hs(import.meta.url);
312
+ const Ms = "10.1.4", Fs = {
313
+ version: Ms
314
+ }, Hs = "todoist-mcp", Je = Fs.version, Pt = new fs(), pt = bs(import.meta.url);
303
315
  let ye;
304
- const Ms = async () => {
305
- const e = lt.resolve("@doist/todoist-sdk"), t = Ne($t(e), "transport", "http-dispatcher.js");
306
- return lt(t);
316
+ const Ws = async () => {
317
+ const e = pt.resolve("@doist/todoist-sdk"), t = Ne(xt(e), "transport", "http-dispatcher.js");
318
+ return pt(t);
307
319
  };
308
- let Fs = Ms;
309
- function Hs() {
310
- return `${Ns}/${Ke}`;
320
+ let Gs = Ws;
321
+ function Bs() {
322
+ return `${Hs}/${Je}`;
311
323
  }
312
- function _t(e) {
324
+ function Rt(e) {
313
325
  return e.trim().toLowerCase();
314
326
  }
315
- function Ws(e, t) {
316
- return Ut.run(_t(e), t);
327
+ function Ys(e, t) {
328
+ return Pt.run(Rt(e), t);
317
329
  }
318
- function Gs({
330
+ function qs({
319
331
  label: e,
320
332
  platform: t = "mcp",
321
333
  sessionId: o = Le()
322
334
  } = {}) {
323
- const r = e ? _t(e) : Ut.getStore();
335
+ const r = e ? Rt(e) : Pt.getStore();
324
336
  return {
325
- "User-Agent": Hs(),
337
+ "User-Agent": Bs(),
326
338
  "doist-platform": t,
327
- "doist-version": Ke,
339
+ "doist-version": Je,
328
340
  "request-id": Le(),
329
341
  "session-id": o,
330
342
  "mcp-tool": r ?? "unknown"
331
343
  };
332
344
  }
333
- function Bs(e, t) {
345
+ function zs(e, t) {
334
346
  const o = new Headers(e);
335
- for (const [r, n] of Object.entries(Gs(t)))
347
+ for (const [r, n] of Object.entries(qs(t)))
336
348
  o.set(r, n);
337
349
  return Object.fromEntries(o.entries());
338
350
  }
339
- function ut() {
351
+ function mt() {
340
352
  return new DOMException("The operation was aborted due to timeout", "TimeoutError");
341
353
  }
342
- function Ys(e, t) {
354
+ function Ks(e, t) {
343
355
  if (!e && t === void 0)
344
356
  return {
345
357
  signal: void 0,
@@ -347,7 +359,7 @@ function Ys(e, t) {
347
359
  }
348
360
  };
349
361
  if (!e && t !== void 0) {
350
- const i = new AbortController(), c = setTimeout(() => i.abort(ut()), t);
362
+ const i = new AbortController(), c = setTimeout(() => i.abort(mt()), t);
351
363
  return {
352
364
  signal: i.signal,
353
365
  cleanup: () => clearTimeout(c)
@@ -368,7 +380,7 @@ function Ys(e, t) {
368
380
  const i = () => n(e.reason);
369
381
  e.addEventListener("abort", i, { once: !0 }), r.push(() => e.removeEventListener("abort", i));
370
382
  }
371
- const a = setTimeout(() => n(ut()), t);
383
+ const a = setTimeout(() => n(mt()), t);
372
384
  return r.push(() => clearTimeout(a)), {
373
385
  signal: o.signal,
374
386
  cleanup: () => {
@@ -377,20 +389,20 @@ function Ys(e, t) {
377
389
  }
378
390
  };
379
391
  }
380
- async function qs() {
381
- if (zs())
382
- return ye || (ye = Fs().then((e) => e.getDefaultDispatcher()).catch((e) => {
392
+ async function Vs() {
393
+ if (Js())
394
+ return ye || (ye = Gs().then((e) => e.getDefaultDispatcher()).catch((e) => {
383
395
  throw ye = void 0, e;
384
396
  })), ye;
385
397
  }
386
- function zs() {
398
+ function Js() {
387
399
  return typeof process < "u" && !!process.versions?.node;
388
400
  }
389
- async function Ks(e) {
390
- const t = await qs();
401
+ async function Xs(e) {
402
+ const t = await Vs();
391
403
  t !== void 0 && (e.dispatcher = t);
392
404
  }
393
- function Vs(e) {
405
+ function Zs(e) {
394
406
  return {
395
407
  ok: e.ok,
396
408
  status: e.status,
@@ -401,35 +413,35 @@ function Vs(e) {
401
413
  arrayBuffer: () => e.arrayBuffer()
402
414
  };
403
415
  }
404
- function Js(e = globalThis.fetch, t = {}) {
416
+ function Qs(e = globalThis.fetch, t = {}) {
405
417
  const o = e === globalThis.fetch, { enabled: r = !0, platform: n = "mcp", sessionId: a = Le() } = t;
406
418
  return async (i, c = {}) => {
407
- const { timeout: d, headers: l, signal: u, ...p } = c, { signal: m, cleanup: h } = Ys(u, d);
419
+ const { timeout: d, headers: l, signal: u, ...p } = c, { signal: m, cleanup: h } = Ks(u, d);
408
420
  try {
409
421
  const k = {
410
422
  ...p,
411
423
  signal: m,
412
- ...r ? { headers: Bs(l, { platform: n, sessionId: a }) } : l !== void 0 ? { headers: l } : {}
424
+ ...r ? { headers: zs(l, { platform: n, sessionId: a }) } : l !== void 0 ? { headers: l } : {}
413
425
  };
414
- o && await Ks(k);
426
+ o && await Xs(k);
415
427
  const b = await e(i, k);
416
- return Vs(b);
428
+ return Zs(b);
417
429
  } finally {
418
430
  h();
419
431
  }
420
432
  };
421
433
  }
422
- function Xs(e, {
434
+ function eo(e, {
423
435
  baseUrl: t,
424
436
  tracking: o
425
437
  } = {}) {
426
- return new fs(e, {
427
- customFetch: Js(globalThis.fetch, o),
438
+ return new gs(e, {
439
+ customFetch: Qs(globalThis.fetch, o),
428
440
  ...t ? { baseUrl: t } : {}
429
441
  });
430
442
  }
431
- const Zs = 2, Qs = 500, eo = 2e3, to = /* @__PURE__ */ new Set([502, 503, 504]);
432
- function so(e) {
443
+ const to = 2, so = 500, oo = 2e3, ro = /* @__PURE__ */ new Set([502, 503, 504]);
444
+ function no(e) {
433
445
  if (e == null || typeof e != "object")
434
446
  return;
435
447
  const t = e;
@@ -445,11 +457,11 @@ function so(e) {
445
457
  return Number(o[1]);
446
458
  }
447
459
  }
448
- function oo(e) {
449
- const t = so(e);
450
- return t !== void 0 && to.has(t);
460
+ function ao(e) {
461
+ const t = no(e);
462
+ return t !== void 0 && ro.has(t);
451
463
  }
452
- function ro({
464
+ function io({
453
465
  attempt: e,
454
466
  baseDelayMs: t,
455
467
  maxDelayMs: o
@@ -457,35 +469,35 @@ function ro({
457
469
  const r = t * 2 ** e;
458
470
  return Math.min(r, o);
459
471
  }
460
- function no(e) {
472
+ function co(e) {
461
473
  return new Promise((t) => setTimeout(t, e));
462
474
  }
463
- async function ao(e, t = {}) {
464
- const o = t.maxRetries ?? Zs, r = t.baseDelayMs ?? Qs, n = t.maxDelayMs ?? eo;
475
+ async function lo(e, t = {}) {
476
+ const o = t.maxRetries ?? to, r = t.baseDelayMs ?? so, n = t.maxDelayMs ?? oo;
465
477
  let a;
466
478
  for (let i = 0; i <= o; i++)
467
479
  try {
468
480
  return await e();
469
481
  } catch (c) {
470
- if (a = c, i < o && oo(c)) {
471
- const d = ro({ attempt: i, baseDelayMs: r, maxDelayMs: n });
472
- await no(d);
482
+ if (a = c, i < o && ao(c)) {
483
+ const d = io({ attempt: i, baseDelayMs: r, maxDelayMs: n });
484
+ await co(d);
473
485
  continue;
474
486
  }
475
487
  throw c;
476
488
  }
477
489
  throw a;
478
490
  }
479
- function Ge(e) {
491
+ function Ye(e) {
480
492
  if (e == null)
481
493
  return e;
482
494
  if (Array.isArray(e))
483
- return e.map((t) => Ge(t));
495
+ return e.map((t) => Ye(t));
484
496
  if (typeof e == "object") {
485
497
  const t = {};
486
498
  for (const [o, r] of Object.entries(e))
487
499
  if (r !== null) {
488
- const n = Ge(r);
500
+ const n = Ye(r);
489
501
  if (n !== null && typeof n == "object" && !Array.isArray(n) && Object.keys(n).length === 0)
490
502
  continue;
491
503
  t[o] = n;
@@ -560,60 +572,60 @@ const f = {
560
572
  // OpenAI MCP tools
561
573
  SEARCH: "search",
562
574
  FETCH: "fetch"
563
- }, Xc = {
575
+ }, ed = {
564
576
  /**
565
577
  * Strips email addresses from tool outputs that expose user data.
566
578
  * Affects: find-project-collaborators, find-completed-tasks
567
579
  */
568
580
  STRIP_EMAILS: "strip_emails"
569
- }, io = process.env.USE_STRUCTURED_CONTENT === "true" || process.env.NODE_ENV === "test";
570
- function co({
581
+ }, uo = process.env.USE_STRUCTURED_CONTENT === "true" || process.env.NODE_ENV === "test";
582
+ function po({
571
583
  textContent: e,
572
584
  structuredContent: t,
573
585
  contentItems: o
574
586
  }) {
575
- const r = Ge(t), n = {}, a = [];
576
- return o && a.push(...o), !io && t && a.push({
587
+ const r = Ye(t), n = {}, a = [];
588
+ return o && a.push(...o), !uo && t && a.push({
577
589
  type: "text",
578
590
  text: JSON.stringify(r)
579
591
  }), e && a.push({ type: "text", text: e }), a.length > 0 && (n.content = a), t && (n.structuredContent = r), n;
580
592
  }
581
- function lo(e) {
593
+ function mo(e) {
582
594
  return {
583
595
  content: [{ type: "text", text: e }],
584
596
  isError: !0
585
597
  };
586
598
  }
587
- function uo(e) {
599
+ function ho(e) {
588
600
  return { ...{
589
- title: `Todoist: ${po(e.name)}`,
601
+ title: `Todoist: ${fo(e.name)}`,
590
602
  openWorldHint: !1
591
603
  }, ...e.annotations };
592
604
  }
593
- function po(e) {
605
+ function fo(e) {
594
606
  return e.split("-").filter(Boolean).map((t) => `${t.charAt(0).toUpperCase()}${t.slice(1)}`).join(" ");
595
607
  }
596
- function mo(e) {
608
+ function bo(e) {
597
609
  return e ? typeof e["ui/resourceUri"] == "string" ? !0 : typeof e.ui == "object" && e.ui !== null : !1;
598
610
  }
599
- const ho = [
611
+ const go = [
600
612
  f.FIND_PROJECT_COLLABORATORS,
601
613
  f.FIND_COMPLETED_TASKS
602
614
  ];
603
- function Be(e) {
615
+ function qe(e) {
604
616
  if (e == null)
605
617
  return e;
606
618
  if (Array.isArray(e))
607
- return e.map((t) => Be(t));
619
+ return e.map((t) => qe(t));
608
620
  if (typeof e == "object") {
609
621
  const t = {};
610
622
  for (const [o, r] of Object.entries(e))
611
- o !== "email" && (t[o] = Be(r));
623
+ o !== "email" && (t[o] = qe(r));
612
624
  return t;
613
625
  }
614
626
  return e;
615
627
  }
616
- function fo(e) {
628
+ function yo(e) {
617
629
  const t = /\s*\([^)]*@[^)]+\)/g, o = /\S+@\S+\.\S+/g;
618
630
  return e.replace(t, "").replace(o, "[email hidden]");
619
631
  }
@@ -623,27 +635,27 @@ function g({
623
635
  client: o,
624
636
  features: r = []
625
637
  }) {
626
- const n = r.some((c) => c.name === "strip_emails") && ho.includes(e.name), a = async (c, d) => {
638
+ const n = r.some((c) => c.name === "strip_emails") && go.includes(e.name), a = async (c, d) => {
627
639
  try {
628
- let { textContent: l, structuredContent: u, contentItems: p } = await Ws(
640
+ let { textContent: l, structuredContent: u, contentItems: p } = await Ys(
629
641
  e.name,
630
- () => ao(
642
+ () => lo(
631
643
  () => e.execute(c, o)
632
644
  )
633
645
  );
634
- return n && (l && (l = fo(l)), u && (u = Be(u))), co({ textContent: l, structuredContent: u, contentItems: p });
646
+ return n && (l && (l = yo(l)), u && (u = qe(u))), po({ textContent: l, structuredContent: u, contentItems: p });
635
647
  } catch (l) {
636
- return console.error(`Error executing tool ${e.name}:`, { args: c, error: l }), lo(Ps(l));
648
+ return console.error(`Error executing tool ${e.name}:`, { args: c, error: l }), mo(Ns(l));
637
649
  }
638
650
  }, i = {
639
651
  description: e.description,
640
652
  inputSchema: e.parameters,
641
653
  ...e.outputSchema ? { outputSchema: e.outputSchema } : {},
642
- annotations: uo(e),
654
+ annotations: ho(e),
643
655
  ...e._meta ? { _meta: e._meta } : {}
644
656
  };
645
- if (mo(e._meta)) {
646
- us(
657
+ if (bo(e._meta)) {
658
+ ms(
647
659
  t,
648
660
  e.name,
649
661
  {
@@ -656,7 +668,7 @@ function g({
656
668
  }
657
669
  t.registerTool(e.name, i, a);
658
670
  }
659
- const bo = {
671
+ const ko = {
660
672
  period: s.enum(["today", "7d", "14d", "30d", "this-week", "this-month"]).default("7d").describe(
661
673
  '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.'
662
674
  ),
@@ -665,7 +677,7 @@ const bo = {
665
677
  ),
666
678
  projectId: s.string().optional().describe("Optional project ID to scope the analysis to a specific project.")
667
679
  };
668
- function go(e, t = /* @__PURE__ */ new Date()) {
680
+ function To(e, t = /* @__PURE__ */ new Date()) {
669
681
  const o = (n) => n.toISOString().slice(0, 10), r = o(t);
670
682
  switch (e) {
671
683
  case "today":
@@ -712,7 +724,7 @@ function go(e, t = /* @__PURE__ */ new Date()) {
712
724
  }
713
725
  }
714
726
  }
715
- function yo(e) {
727
+ function wo(e) {
716
728
  const t = {
717
729
  goals: `### Goal Tracking
718
730
  - Compare tasks completed today vs the daily goal
@@ -743,8 +755,8 @@ function yo(e) {
743
755
 
744
756
  `) : t[e] ?? "";
745
757
  }
746
- function ko(e) {
747
- const { since: t, until: o, periodDescription: r } = go(e.period), n = e.projectId ? `
758
+ function Io(e) {
759
+ const { since: t, until: o, periodDescription: r } = To(e.period), n = e.projectId ? `
748
760
  Scope this analysis to project ID: ${e.projectId}. Pass this projectId when calling find-completed-tasks and get-overview.` : "";
749
761
  return `Analyze my Todoist productivity for ${r} (${t} to ${o}).${n}
750
762
 
@@ -765,7 +777,7 @@ ${e.focus === "overall" || e.focus === "projects" ? `4. **get-overview** — Get
765
777
 
766
778
  Using the collected data, produce an analysis covering the following sections:
767
779
 
768
- ${yo(e.focus)}
780
+ ${wo(e.focus)}
769
781
 
770
782
  ### Step 3: Format
771
783
 
@@ -775,14 +787,14 @@ Present the analysis as a clear, well-structured markdown report with:
775
787
  - Specific numbers and comparisons (not vague statements)
776
788
  - Actionable takeaways highlighted clearly`;
777
789
  }
778
- function To(e) {
790
+ function vo(e) {
779
791
  return {
780
792
  messages: [
781
793
  {
782
794
  role: "user",
783
795
  content: {
784
796
  type: "text",
785
- text: ko(e)
797
+ text: Io(e)
786
798
  }
787
799
  }
788
800
  ]
@@ -792,8 +804,8 @@ const pe = {
792
804
  name: "productivity-analysis",
793
805
  title: "Productivity Analysis",
794
806
  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.",
795
- argsSchema: bo,
796
- callback: To
807
+ argsSchema: ko,
808
+ callback: vo
797
809
  }, $ = {
798
810
  /** Default limit for task listings */
799
811
  TASKS_DEFAULT: 10,
@@ -836,7 +848,7 @@ class U extends Error {
836
848
  super(`Invalid duration format "${t}": ${o}`), this.name = "DurationParseError";
837
849
  }
838
850
  }
839
- function Pt(e) {
851
+ function Lt(e) {
840
852
  if (!e || typeof e != "string")
841
853
  throw new U(e, "Duration must be a non-empty string");
842
854
  const t = e.trim().toLowerCase().replace(/\s+/g, "");
@@ -870,20 +882,20 @@ function Pt(e) {
870
882
  throw new U(e, "Duration cannot exceed 24 hours (1440 minutes)");
871
883
  return { minutes: r };
872
884
  }
873
- function wo(e) {
885
+ function So(e) {
874
886
  if (e <= 0) return "0m";
875
887
  const t = Math.floor(e / 60), o = e % 60;
876
888
  return t === 0 ? `${o}m` : o === 0 ? `${t}h` : `${t}h${o}m`;
877
889
  }
878
- const Io = ["p1", "p2", "p3", "p4"], Ve = '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.', Je = s.enum(Io).describe(Ve);
879
- function Rt(e) {
890
+ const jo = ["p1", "p2", "p3", "p4"], Xe = '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.', Ze = s.enum(jo).describe(Xe);
891
+ function Nt(e) {
880
892
  return { p1: 4, p2: 3, p3: 2, p4: 1 }[e];
881
893
  }
882
- function vo(e) {
894
+ function Co(e) {
883
895
  return { 4: "p1", 3: "p2", 2: "p3", 1: "p4" }[e];
884
896
  }
885
- const E = /* @__PURE__ */ new Map(), ee = /* @__PURE__ */ new Map(), Ue = 300 * 1e3, So = "me";
886
- class jo {
897
+ const E = /* @__PURE__ */ new Map(), ee = /* @__PURE__ */ new Map(), Ue = 300 * 1e3, $o = "me";
898
+ class Do {
887
899
  /**
888
900
  * Resolve a user name or ID to a user ID by looking up collaborators across all shared projects.
889
901
  * Supports exact name matches, partial matches, email matches, and the "me" keyword.
@@ -894,7 +906,7 @@ class jo {
894
906
  const r = o.trim(), n = E.get(r);
895
907
  if (n && Date.now() - n.timestamp < Ue)
896
908
  return n.result;
897
- if (r.toLowerCase() === So)
909
+ if (r.toLowerCase() === $o)
898
910
  try {
899
911
  const a = await t.getUser();
900
912
  return {
@@ -1018,15 +1030,15 @@ class jo {
1018
1030
  E.clear(), ee.clear();
1019
1031
  }
1020
1032
  }
1021
- const W = new jo();
1022
- async function Co(e, t) {
1033
+ const W = new Do();
1034
+ async function xo(e, t) {
1023
1035
  return W.resolveUser(e, t);
1024
1036
  }
1025
- const Lt = ["assigned", "unassignedOrMe", "all"];
1026
- async function Xe(e, t) {
1037
+ const Mt = ["assigned", "unassignedOrMe", "all"];
1038
+ async function Qe(e, t) {
1027
1039
  if (!t)
1028
1040
  return;
1029
- const o = await Co(e, t);
1041
+ const o = await xo(e, t);
1030
1042
  if (!o)
1031
1043
  throw new Error(
1032
1044
  `Could not find user: "${t}". Make sure the user is a collaborator on a shared project.`
@@ -1036,14 +1048,14 @@ async function Xe(e, t) {
1036
1048
  function ne(e, t) {
1037
1049
  return t.length === 0 ? e : e.length === 0 ? t : `${e} & ${t}`;
1038
1050
  }
1039
- function Nt({
1051
+ function Ft({
1040
1052
  resolvedAssigneeId: e,
1041
1053
  assigneeEmail: t,
1042
1054
  responsibleUserFiltering: o = "unassignedOrMe"
1043
1055
  }) {
1044
1056
  return e && t ? `assigned to: ${t}` : o === "unassignedOrMe" ? "!assigned to: others" : o === "assigned" ? "assigned to: others" : "";
1045
1057
  }
1046
- function $o({
1058
+ function Ao({
1047
1059
  tasks: e,
1048
1060
  resolvedAssigneeId: t,
1049
1061
  currentUserId: o,
@@ -1076,39 +1088,39 @@ async function z(e) {
1076
1088
  } while (a !== null);
1077
1089
  return n;
1078
1090
  }
1079
- function Ze(e) {
1091
+ function et(e) {
1080
1092
  return /(?<!\\)(?:\\\\)*\*/.test(e) ? e : `*${e.replaceAll(/\\(?!\*)/g, "\\\\")}*`;
1081
1093
  }
1082
- async function Mt(e, t) {
1094
+ async function Ht(e, t) {
1083
1095
  return z({
1084
1096
  apiMethod: e.searchProjects.bind(e),
1085
- args: { query: Ze(t) },
1097
+ args: { query: et(t) },
1086
1098
  limit: $.PROJECTS_MAX
1087
1099
  });
1088
1100
  }
1089
- async function Do(e, t) {
1101
+ async function Eo(e, t) {
1090
1102
  return z({
1091
1103
  apiMethod: e.searchLabels.bind(e),
1092
- args: { query: Ze(t) },
1104
+ args: { query: et(t) },
1093
1105
  limit: $.LABELS_MAX
1094
1106
  });
1095
1107
  }
1096
- async function xo(e) {
1108
+ async function Oo(e) {
1097
1109
  return z({
1098
1110
  apiMethod: e.getSharedLabels.bind(e),
1099
1111
  args: {},
1100
1112
  limit: $.LABELS_MAX
1101
1113
  });
1102
1114
  }
1103
- async function Ao(e, t, o) {
1104
- const r = Ze(t);
1115
+ async function Uo(e, t, o) {
1116
+ const r = et(t);
1105
1117
  return z({
1106
1118
  apiMethod: e.searchSections.bind(e),
1107
1119
  args: o ? { query: r, projectId: o } : { query: r },
1108
1120
  limit: $.SECTIONS_MAX
1109
1121
  });
1110
1122
  }
1111
- function Eo(e, t, o, r) {
1123
+ function _o(e, t, o, r) {
1112
1124
  const n = [t, o, r].filter(Boolean);
1113
1125
  if (n.length > 1)
1114
1126
  throw new Error(
@@ -1131,12 +1143,12 @@ function P(e) {
1131
1143
  dueDate: e.due?.date,
1132
1144
  recurring: e.due?.isRecurring && e.due.string ? e.due.string : !1,
1133
1145
  deadlineDate: e.deadline?.date,
1134
- priority: vo(e.priority) ?? "p4",
1146
+ priority: Co(e.priority) ?? "p4",
1135
1147
  projectId: e.projectId,
1136
1148
  sectionId: e.sectionId ?? void 0,
1137
1149
  parentId: e.parentId ?? void 0,
1138
1150
  labels: e.labels,
1139
- duration: e.duration ? wo(e.duration.amount) : void 0,
1151
+ duration: e.duration ? So(e.duration.amount) : void 0,
1140
1152
  responsibleUid: e.responsibleUid ?? void 0,
1141
1153
  assignedByUid: e.assignedByUid ?? void 0,
1142
1154
  checked: e.checked,
@@ -1195,7 +1207,7 @@ function Ie(e) {
1195
1207
  progress: e.progress
1196
1208
  };
1197
1209
  }
1198
- function Oo(e) {
1210
+ function Po(e) {
1199
1211
  return {
1200
1212
  id: e.id ?? void 0,
1201
1213
  objectType: e.objectType,
@@ -1208,7 +1220,7 @@ function Oo(e) {
1208
1220
  extraData: e.extraData ?? void 0
1209
1221
  };
1210
1222
  }
1211
- const Uo = Z.object({
1223
+ const Ro = Z.object({
1212
1224
  httpStatusCode: Z.number(),
1213
1225
  responseData: Z.object({
1214
1226
  error: Z.string(),
@@ -1216,7 +1228,7 @@ const Uo = Z.object({
1216
1228
  errorTag: Z.string()
1217
1229
  })
1218
1230
  });
1219
- async function Qe({
1231
+ async function tt({
1220
1232
  client: e,
1221
1233
  query: t,
1222
1234
  limit: o,
@@ -1226,7 +1238,7 @@ async function Qe({
1226
1238
  const { results: n, nextCursor: a } = await e.getTasksByFilter({ query: t, cursor: r, limit: o });
1227
1239
  return { tasks: n.map(P), nextCursor: a };
1228
1240
  } catch (n) {
1229
- const a = Uo.safeParse(n);
1241
+ const a = Ro.safeParse(n);
1230
1242
  if (!a.success)
1231
1243
  throw n;
1232
1244
  const { responseData: i } = a.data;
@@ -1235,7 +1247,7 @@ async function Qe({
1235
1247
  );
1236
1248
  }
1237
1249
  }
1238
- function pt(e) {
1250
+ function ht(e) {
1239
1251
  return {
1240
1252
  isRecurring: e.isRecurring,
1241
1253
  string: e.string,
@@ -1255,13 +1267,13 @@ function me(e) {
1255
1267
  return {
1256
1268
  ...t,
1257
1269
  minuteOffset: e.minuteOffset,
1258
- due: e.due ? pt(e.due) : void 0,
1270
+ due: e.due ? ht(e.due) : void 0,
1259
1271
  isUrgent: e.isUrgent
1260
1272
  };
1261
1273
  case "absolute":
1262
1274
  return {
1263
1275
  ...t,
1264
- due: pt(e.due),
1276
+ due: ht(e.due),
1265
1277
  isUrgent: e.isUrgent
1266
1278
  };
1267
1279
  case "location":
@@ -1275,19 +1287,19 @@ function me(e) {
1275
1287
  };
1276
1288
  }
1277
1289
  }
1278
- function Ft(e) {
1290
+ function Wt(e) {
1279
1291
  const t = e.filter(
1280
1292
  (r) => r.type === "relative" || r.type === "absolute"
1281
1293
  ).length, o = e.filter((r) => r.type === "location").length;
1282
1294
  return { timeBasedCount: t, locationCount: o };
1283
1295
  }
1284
1296
  const ve = Me.map((e) => e.key);
1285
- function _o(e) {
1297
+ function Lo(e) {
1286
1298
  if (typeof e != "string") return;
1287
1299
  const t = e.toLowerCase();
1288
1300
  return (Me.find((r) => r.key === t) ?? Me.find((r) => r.displayName.toLowerCase() === t))?.key;
1289
1301
  }
1290
- const Po = `Color for the entity. Accepts a color key (e.g. "berry_red") or display name (e.g. "Berry Red"). Valid colors: ${ve.join(", ")}. Unrecognized colors are omitted and charcoal will be used as the default.`, ce = s.preprocess(_o, s.enum(ve).optional()).describe(Po);
1302
+ const No = `Color for the entity. Accepts a color key (e.g. "berry_red") or display name (e.g. "Berry Red"). Valid colors: ${ve.join(", ")}. Unrecognized colors are omitted and charcoal will be used as the default.`, ce = s.preprocess(Lo, s.enum(ve).optional()).describe(No);
1291
1303
  s.enum(ve).describe("The color key of the entity.");
1292
1304
  const de = s.enum(ve).optional().catch(void 0).describe("The color key of the entity."), J = s.object({
1293
1305
  id: s.string().describe("The unique ID of the task."),
@@ -1296,7 +1308,7 @@ const de = s.enum(ve).optional().catch(void 0).describe("The color key of the en
1296
1308
  dueDate: s.string().optional().describe("The due date of the task (ISO 8601 format)."),
1297
1309
  recurring: s.union([s.boolean(), s.string()]).describe("Whether the task is recurring, or the recurrence string."),
1298
1310
  deadlineDate: s.string().optional().describe("The deadline date of the task (ISO 8601 format)."),
1299
- priority: Je.describe(
1311
+ priority: Ze.describe(
1300
1312
  "The priority level: p1 (highest), p2 (high), p3 (medium), p4 (lowest)."
1301
1313
  ),
1302
1314
  projectId: s.string().describe("The ID of the project this task belongs to."),
@@ -1330,7 +1342,7 @@ const de = s.enum(ve).optional().catch(void 0).describe("The color key of the en
1330
1342
  function fe({ id: e, name: t }) {
1331
1343
  return { id: e, name: t };
1332
1344
  }
1333
- const Ro = s.object({
1345
+ const Mo = s.object({
1334
1346
  resourceType: s.string().describe("The type of resource (file, url, image, etc)."),
1335
1347
  fileName: s.string().optional().describe("The name of the file."),
1336
1348
  fileSize: s.number().optional().describe("The size of the file in bytes."),
@@ -1350,8 +1362,8 @@ const Ro = s.object({
1350
1362
  content: s.string().describe("The content of the comment."),
1351
1363
  postedAt: s.string().describe("When the comment was posted (ISO 8601 format)."),
1352
1364
  postedUid: s.string().optional().describe("The UID of the user who posted this comment."),
1353
- fileAttachment: Ro.optional().describe("File attachment information, if any.")
1354
- }), Lo = s.object({
1365
+ fileAttachment: Mo.optional().describe("File attachment information, if any.")
1366
+ }), Fo = s.object({
1355
1367
  id: s.string().optional().describe("The unique ID of the activity event."),
1356
1368
  objectType: s.string().describe("The type of object this event relates to (task, project, etc)."),
1357
1369
  objectId: s.string().describe("The ID of the object this event relates to."),
@@ -1361,7 +1373,7 @@ const Ro = s.object({
1361
1373
  parentItemId: s.string().optional().describe("The ID of the parent item."),
1362
1374
  initiatorId: s.string().optional().describe("The ID of the user who initiated this event."),
1363
1375
  extraData: s.record(s.string(), s.unknown()).optional().describe("Additional event data.")
1364
- }), No = s.object({
1376
+ }), Ho = s.object({
1365
1377
  id: s.string().describe("The unique ID of the user."),
1366
1378
  name: s.string().describe("The full name of the user."),
1367
1379
  email: s.string().describe("The email address of the user.")
@@ -1371,24 +1383,24 @@ const Ro = s.object({
1371
1383
  color: de,
1372
1384
  order: s.number().optional().catch(void 0).describe("The display order of the label."),
1373
1385
  isFavorite: s.boolean().describe("Whether the label is marked as favorite.")
1374
- }), Mo = s.object({
1386
+ }), Wo = s.object({
1375
1387
  isRecurring: s.boolean().describe("Whether this is a recurring reminder."),
1376
1388
  string: s.string().describe("Human-readable due string."),
1377
1389
  date: s.string().describe("Due date in ISO format."),
1378
1390
  datetime: s.string().optional().describe("Due datetime in ISO format."),
1379
1391
  timezone: s.string().optional().describe("Timezone of the reminder.")
1380
- }), et = s.object({
1392
+ }), st = s.object({
1381
1393
  id: s.string().describe("The unique ID of the reminder."),
1382
1394
  taskId: s.string().describe("The task ID this reminder belongs to."),
1383
- type: s.enum(bs).describe("The type of reminder: relative, absolute, or location."),
1395
+ type: s.enum(ys).describe("The type of reminder: relative, absolute, or location."),
1384
1396
  minuteOffset: s.number().optional().describe("Minutes before due time to trigger (relative reminders only)."),
1385
- due: Mo.optional().describe(
1397
+ due: Wo.optional().describe(
1386
1398
  "Due date info (absolute and sometimes relative reminders)."
1387
1399
  ),
1388
1400
  name: s.string().optional().describe("Location name (location reminders only)."),
1389
1401
  locLat: s.string().optional().describe("Latitude (location reminders only)."),
1390
1402
  locLong: s.string().optional().describe("Longitude (location reminders only)."),
1391
- locTrigger: s.enum(Dt).optional().describe("Trigger type: on_enter or on_leave (location reminders only)."),
1403
+ locTrigger: s.enum(Et).optional().describe("Trigger type: on_enter or on_leave (location reminders only)."),
1392
1404
  radius: s.number().optional().describe("Geofence radius in meters (location reminders only)."),
1393
1405
  isUrgent: s.boolean().optional().describe("Whether this is an urgent reminder (relative and absolute reminders only).")
1394
1406
  }), je = s.object({
@@ -1409,23 +1421,23 @@ const Ro = s.object({
1409
1421
  item: s.string().describe("The item that failed (usually an ID or identifier)."),
1410
1422
  error: s.string().describe("The error message."),
1411
1423
  code: s.string().optional().describe("The error code, if available.")
1412
- }), Fo = s.object({
1424
+ }), Go = s.object({
1413
1425
  taskId: s.string().optional().describe("The ID of the task to comment on."),
1414
1426
  projectId: s.string().optional().describe(
1415
1427
  'The ID of the project to comment on. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
1416
1428
  ),
1417
1429
  content: s.string().min(1).describe("The content of the comment.")
1418
- }), Ho = {
1419
- comments: s.array(Fo).min(1).describe("The array of comments to add.")
1420
- }, Wo = {
1430
+ }), Bo = {
1431
+ comments: s.array(Go).min(1).describe("The array of comments to add.")
1432
+ }, Yo = {
1421
1433
  comments: s.array(Se).describe("The created comments."),
1422
1434
  totalCount: s.number().describe("The total number of comments created."),
1423
1435
  addedCommentIds: s.array(s.string()).describe("The IDs of the added comments.")
1424
- }, Go = {
1436
+ }, qo = {
1425
1437
  name: f.ADD_COMMENTS,
1426
1438
  description: "Add multiple comments to tasks or projects. Each comment must specify either taskId or projectId.",
1427
- parameters: Ho,
1428
- outputSchema: Wo,
1439
+ parameters: Bo,
1440
+ outputSchema: Yo,
1429
1441
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
1430
1442
  async execute(e, t) {
1431
1443
  const { comments: o } = e;
@@ -1451,7 +1463,7 @@ const Ro = s.object({
1451
1463
  });
1452
1464
  }), c = (await Promise.all(a)).map(we);
1453
1465
  return {
1454
- textContent: Bo({ comments: c }),
1466
+ textContent: zo({ comments: c }),
1455
1467
  structuredContent: {
1456
1468
  comments: c,
1457
1469
  totalCount: c.length,
@@ -1460,7 +1472,7 @@ const Ro = s.object({
1460
1472
  };
1461
1473
  }
1462
1474
  };
1463
- function Bo({ comments: e }) {
1475
+ function zo({ comments: e }) {
1464
1476
  const t = e.filter((a) => a.taskId).length, o = e.filter((a) => a.projectId).length, r = [];
1465
1477
  if (t > 0) {
1466
1478
  const a = t > 1 ? "comments" : "comment";
@@ -1472,25 +1484,25 @@ function Bo({ comments: e }) {
1472
1484
  }
1473
1485
  return r.length > 0 ? `Added ${r.join(" and ")}` : "No comments added";
1474
1486
  }
1475
- const Yo = {
1487
+ const Ko = {
1476
1488
  search: s.string().optional().describe(
1477
1489
  "Search for a filter by name (partial and case insensitive match). If omitted, all filters are returned."
1478
1490
  )
1479
- }, tt = s.object({
1491
+ }, ot = s.object({
1480
1492
  id: s.string().describe("The unique ID of the filter."),
1481
1493
  name: s.string().describe("The name of the filter."),
1482
1494
  query: s.string().describe('The filter query string (e.g. "today & p1", "#Work & overdue").'),
1483
1495
  color: de,
1484
1496
  isFavorite: s.boolean().describe("Whether the filter is marked as favorite."),
1485
1497
  itemOrder: s.number().describe("The display order of the filter.")
1486
- }), qo = {
1487
- filters: s.array(tt).describe("The found filters."),
1498
+ }), Vo = {
1499
+ filters: s.array(ot).describe("The found filters."),
1488
1500
  totalCount: s.number().describe("The total number of filters returned.")
1489
- }, zo = {
1501
+ }, Jo = {
1490
1502
  name: f.FIND_FILTERS,
1491
1503
  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").',
1492
- parameters: Yo,
1493
- outputSchema: qo,
1504
+ parameters: Ko,
1505
+ outputSchema: Vo,
1494
1506
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
1495
1507
  async execute(e, t) {
1496
1508
  let r = ((await t.sync({ resourceTypes: ["filters"], syncToken: "*" })).filters ?? []).filter((i) => !i.isDeleted);
@@ -1508,7 +1520,7 @@ const Yo = {
1508
1520
  itemOrder: i.itemOrder
1509
1521
  }));
1510
1522
  return {
1511
- textContent: Ko({ filters: n, search: e.search }),
1523
+ textContent: Xo({ filters: n, search: e.search }),
1512
1524
  structuredContent: {
1513
1525
  filters: n,
1514
1526
  totalCount: n.length
@@ -1516,7 +1528,7 @@ const Yo = {
1516
1528
  };
1517
1529
  }
1518
1530
  };
1519
- function Ko({
1531
+ function Xo({
1520
1532
  filters: e,
1521
1533
  search: t
1522
1534
  }) {
@@ -1537,23 +1549,23 @@ ${n.map((a) => `- ${a}`).join(`
1537
1549
  return r.join(`
1538
1550
  `);
1539
1551
  }
1540
- const Vo = s.object({
1552
+ const Zo = s.object({
1541
1553
  name: s.string().min(1).describe("The name of the filter."),
1542
1554
  query: s.string().min(1).describe(
1543
1555
  'The filter query string. Examples: "today & p1", "#Work & overdue", "@email & today", "(p1 | p2) & !assigned". Operators: | (OR), & (AND), ! (NOT), () grouping, , (multiple queries).'
1544
1556
  ),
1545
1557
  color: ce,
1546
1558
  isFavorite: s.boolean().optional().describe("Whether to mark the filter as a favorite. Defaults to false.")
1547
- }), Jo = {
1548
- filters: s.array(Vo).min(1).describe("The array of filters to add.")
1549
- }, Xo = {
1550
- filters: s.array(tt).describe("The created filters."),
1559
+ }), Qo = {
1560
+ filters: s.array(Zo).min(1).describe("The array of filters to add.")
1561
+ }, er = {
1562
+ filters: s.array(ot).describe("The created filters."),
1551
1563
  totalCount: s.number().describe("The total number of filters created.")
1552
- }, Zo = {
1564
+ }, tr = {
1553
1565
  name: f.ADD_FILTERS,
1554
1566
  description: "Add one or more new personal filters. Filters are saved custom views using query syntax to organize tasks.",
1555
- parameters: Jo,
1556
- outputSchema: Xo,
1567
+ parameters: Qo,
1568
+ outputSchema: er,
1557
1569
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
1558
1570
  async execute({ filters: e }, t) {
1559
1571
  const o = Date.now(), r = e.map((p, m) => `tempFilterAdd${m}${o}`), n = e.map((p, m) => Y(
@@ -1588,7 +1600,7 @@ ${l}`,
1588
1600
  }
1589
1601
  };
1590
1602
  }
1591
- }, mt = 25, Qo = s.object({
1603
+ }, ft = 25, sr = s.object({
1592
1604
  name: s.string().min(1).describe("The name of the goal."),
1593
1605
  workspaceId: s.string().optional().describe(
1594
1606
  "Workspace ID. If provided, creates a workspace goal. If omitted, creates a personal goal."
@@ -1596,16 +1608,16 @@ ${l}`,
1596
1608
  description: s.string().optional().describe("The description of the goal."),
1597
1609
  deadline: s.string().optional().describe("The target date (YYYY-MM-DD)."),
1598
1610
  responsibleUid: s.string().optional().describe("The user ID responsible for this goal.")
1599
- }), er = {
1600
- goals: s.array(Qo).min(1).max(mt).describe(`The array of goals to create (max ${mt}).`)
1601
- }, tr = {
1611
+ }), or = {
1612
+ goals: s.array(sr).min(1).max(ft).describe(`The array of goals to create (max ${ft}).`)
1613
+ }, rr = {
1602
1614
  goals: s.array(je).describe("The created goals."),
1603
1615
  totalCount: s.number().describe("The total number of goals created.")
1604
- }, sr = {
1616
+ }, nr = {
1605
1617
  name: f.ADD_GOALS,
1606
1618
  description: "Create one or more goals. Omit workspaceId for personal goals.",
1607
- parameters: er,
1608
- outputSchema: tr,
1619
+ parameters: or,
1620
+ outputSchema: rr,
1609
1621
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
1610
1622
  async execute({ goals: e }, t) {
1611
1623
  const r = (await Promise.all(e.map((c) => t.addGoal(c)))).map(Ie), n = r.length, a = r.map((c) => `• ${c.name} (id=${c.id}, owner=${c.ownerType})`).join(`
@@ -1619,26 +1631,26 @@ ${a}`,
1619
1631
  }
1620
1632
  };
1621
1633
  }
1622
- }, or = s.object({
1634
+ }, ar = s.object({
1623
1635
  name: s.string().min(1).max(128).describe("The name of the label."),
1624
1636
  color: ce,
1625
1637
  order: s.number().int().optional().describe("The position of the label in the label list."),
1626
1638
  isFavorite: s.boolean().optional().describe("Whether the label is a favorite. Defaults to false.")
1627
- }), rr = {
1628
- labels: s.array(or).min(1).describe("The array of labels to add.")
1629
- }, nr = {
1639
+ }), ir = {
1640
+ labels: s.array(ar).min(1).describe("The array of labels to add.")
1641
+ }, cr = {
1630
1642
  labels: s.array(ue).describe("The created labels."),
1631
1643
  totalCount: s.number().describe("The total number of labels created.")
1632
- }, ar = {
1644
+ }, dr = {
1633
1645
  name: f.ADD_LABELS,
1634
1646
  description: "Add one or more new personal labels.",
1635
- parameters: rr,
1636
- outputSchema: nr,
1647
+ parameters: ir,
1648
+ outputSchema: cr,
1637
1649
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
1638
1650
  async execute({ labels: e }, t) {
1639
1651
  const o = await Promise.all(e.map((n) => t.addLabel(n)));
1640
1652
  return {
1641
- textContent: ir({ labels: o }),
1653
+ textContent: lr({ labels: o }),
1642
1654
  structuredContent: {
1643
1655
  labels: o.map((n) => ue.parse(n)),
1644
1656
  totalCount: o.length
@@ -1646,22 +1658,22 @@ ${a}`,
1646
1658
  };
1647
1659
  }
1648
1660
  };
1649
- function ir({ labels: e }) {
1661
+ function lr({ labels: e }) {
1650
1662
  const t = e.length, o = e.map((r) => `• ${r.name} (id=${r.id})`).join(`
1651
1663
  `);
1652
1664
  return `Added ${t} label${t === 1 ? "" : "s"}:
1653
1665
  ${o}`;
1654
1666
  }
1655
- const cr = 300 * 1e3;
1656
- function dr(e) {
1667
+ const ur = 300 * 1e3;
1668
+ function pr(e) {
1657
1669
  return /^\d+$/.test(e);
1658
1670
  }
1659
- class lr {
1671
+ class mr {
1660
1672
  constructor() {
1661
1673
  this.cache = null;
1662
1674
  }
1663
1675
  async getWorkspaces(t) {
1664
- if (this.cache && Date.now() - this.cache.timestamp < cr)
1676
+ if (this.cache && Date.now() - this.cache.timestamp < ur)
1665
1677
  return this.cache.workspaces;
1666
1678
  const o = await t.getWorkspaces();
1667
1679
  return this.cache = { workspaces: o, timestamp: Date.now() }, o;
@@ -1684,7 +1696,7 @@ class lr {
1684
1696
  const n = await this.getWorkspaces(t), a = n.find((u) => u.id === r);
1685
1697
  if (a)
1686
1698
  return { workspaceId: a.id, workspaceName: a.name };
1687
- if (dr(r))
1699
+ if (pr(r))
1688
1700
  return { workspaceId: r, workspaceName: r };
1689
1701
  const i = r.toLowerCase(), c = n.find((u) => u.name.toLowerCase() === i);
1690
1702
  if (c)
@@ -1712,7 +1724,7 @@ ${u}` + (d.length > 5 ? `
1712
1724
  this.cache = null;
1713
1725
  }
1714
1726
  }
1715
- const Ht = new lr(), ur = s.object({
1727
+ const Gt = new mr(), hr = s.object({
1716
1728
  name: s.string().min(1).describe("The name of the project."),
1717
1729
  parentId: s.string().optional().describe("The ID of the parent project. If provided, creates this as a sub-project."),
1718
1730
  isFavorite: s.boolean().optional().describe("Whether the project is a favorite. Defaults to false."),
@@ -1721,23 +1733,23 @@ const Ht = new lr(), ur = s.object({
1721
1733
  workspace: s.string().trim().min(1).optional().describe(
1722
1734
  "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."
1723
1735
  )
1724
- }), pr = {
1725
- projects: s.array(ur).min(1).describe("The array of projects to add.")
1726
- }, mr = {
1736
+ }), fr = {
1737
+ projects: s.array(hr).min(1).describe("The array of projects to add.")
1738
+ }, br = {
1727
1739
  projects: s.array(le).describe("The created projects."),
1728
1740
  totalCount: s.number().describe("The total number of projects created.")
1729
- }, hr = {
1741
+ }, gr = {
1730
1742
  name: f.ADD_PROJECTS,
1731
1743
  description: "Add one or more new projects.",
1732
- parameters: pr,
1733
- outputSchema: mr,
1744
+ parameters: fr,
1745
+ outputSchema: br,
1734
1746
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
1735
1747
  async execute({ projects: e }, t) {
1736
1748
  const o = [
1737
1749
  ...new Set(e.map((c) => c.workspace).filter(Boolean))
1738
1750
  ], r = /* @__PURE__ */ new Map();
1739
1751
  for (const c of o) {
1740
- const d = await Ht.resolveWorkspace(t, c);
1752
+ const d = await Gt.resolveWorkspace(t, c);
1741
1753
  r.set(c, d.workspaceId);
1742
1754
  }
1743
1755
  const n = await Promise.all(
@@ -1745,7 +1757,7 @@ const Ht = new lr(), ur = s.object({
1745
1757
  const l = c ? r.get(c) : void 0;
1746
1758
  return t.addProject({ ...d, ...l ? { workspaceId: l } : {} });
1747
1759
  })
1748
- ), a = fr({ projects: n }), i = n.map(V);
1760
+ ), a = yr({ projects: n }), i = n.map(V);
1749
1761
  return {
1750
1762
  textContent: a,
1751
1763
  structuredContent: {
@@ -1755,18 +1767,18 @@ const Ht = new lr(), ur = s.object({
1755
1767
  };
1756
1768
  }
1757
1769
  };
1758
- function fr({ projects: e }) {
1770
+ function yr({ projects: e }) {
1759
1771
  const t = e.length, o = e.map((n) => `• ${n.name} (id=${n.id})`).join(`
1760
1772
  `);
1761
1773
  return `Added ${t} project${t === 1 ? "" : "s"}:
1762
1774
  ${o}`;
1763
1775
  }
1764
- const Te = 25, Ce = s.enum(gs), Wt = s.object({
1776
+ const Te = 25, Ce = s.enum(ks), Bt = s.object({
1765
1777
  date: s.string().optional().describe("Due date in YYYY-MM-DD format."),
1766
1778
  string: s.string().optional().describe('Natural language due string, e.g. "tomorrow at 3pm".'),
1767
1779
  timezone: s.string().optional().describe('Timezone for the reminder, e.g. "America/New_York".'),
1768
1780
  lang: s.string().optional().describe('Language for parsing the due string, e.g. "en".')
1769
- }), Gt = s.enum(Dt), $e = s.boolean().optional().describe("Whether this is an urgent reminder. Applies to relative and absolute reminders."), br = s.object({
1781
+ }), Yt = s.enum(Et), $e = s.boolean().optional().describe("Whether this is an urgent reminder. Applies to relative and absolute reminders."), kr = s.object({
1770
1782
  type: s.literal("relative"),
1771
1783
  taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
1772
1784
  minuteOffset: s.number().int().min(0).describe(
@@ -1776,41 +1788,41 @@ const Te = 25, Ce = s.enum(gs), Wt = s.object({
1776
1788
  'Delivery method: "email" or "push" notification. Defaults to push.'
1777
1789
  ),
1778
1790
  isUrgent: $e
1779
- }), gr = s.object({
1791
+ }), Tr = s.object({
1780
1792
  type: s.literal("absolute"),
1781
1793
  taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
1782
- due: Wt.describe("The specific date/time for the reminder."),
1794
+ due: Bt.describe("The specific date/time for the reminder."),
1783
1795
  service: Ce.optional().describe(
1784
1796
  'Delivery method: "email" or "push" notification. Defaults to push.'
1785
1797
  ),
1786
1798
  isUrgent: $e
1787
- }), yr = s.object({
1799
+ }), wr = s.object({
1788
1800
  type: s.literal("location"),
1789
1801
  taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
1790
1802
  name: s.string().min(1).describe('Name of the location, e.g. "Office", "Home".'),
1791
1803
  locLat: s.string().describe('Latitude of the location as a string, e.g. "37.7749".'),
1792
1804
  locLong: s.string().describe('Longitude of the location as a string, e.g. "-122.4194".'),
1793
- locTrigger: Gt.describe(
1805
+ locTrigger: Yt.describe(
1794
1806
  'When to trigger: "on_enter" (arriving) or "on_leave" (departing).'
1795
1807
  ),
1796
1808
  radius: s.number().int().optional().describe("Radius in meters for the geofence. Defaults to server default.")
1797
- }), kr = s.discriminatedUnion("type", [
1798
- br,
1799
- gr,
1800
- yr
1801
- ]), Tr = {
1802
- reminders: s.array(kr).min(1).max(Te).describe(
1809
+ }), Ir = s.discriminatedUnion("type", [
1810
+ kr,
1811
+ Tr,
1812
+ wr
1813
+ ]), vr = {
1814
+ reminders: s.array(Ir).min(1).max(Te).describe(
1803
1815
  `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).`
1804
1816
  )
1805
- }, wr = {
1806
- reminders: s.array(et).describe("The created reminders."),
1817
+ }, Sr = {
1818
+ reminders: s.array(st).describe("The created reminders."),
1807
1819
  totalCount: s.number().describe("Total number of reminders created."),
1808
1820
  addedReminderIds: s.array(s.string()).describe("IDs of the created reminders.")
1809
- }, Ir = {
1821
+ }, jr = {
1810
1822
  name: f.ADD_REMINDERS,
1811
1823
  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.',
1812
- parameters: Tr,
1813
- outputSchema: wr,
1824
+ parameters: vr,
1825
+ outputSchema: Sr,
1814
1826
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
1815
1827
  async execute(e, t) {
1816
1828
  const { reminders: o } = e, r = o.map(async (c) => {
@@ -1843,7 +1855,7 @@ const Te = 25, Ce = s.enum(gs), Wt = s.object({
1843
1855
  }
1844
1856
  }), a = (await Promise.all(r)).map(me);
1845
1857
  return {
1846
- textContent: vr(a),
1858
+ textContent: Cr(a),
1847
1859
  structuredContent: {
1848
1860
  reminders: a,
1849
1861
  totalCount: a.length,
@@ -1852,8 +1864,8 @@ const Te = 25, Ce = s.enum(gs), Wt = s.object({
1852
1864
  };
1853
1865
  }
1854
1866
  };
1855
- function vr(e) {
1856
- const { timeBasedCount: t, locationCount: o } = Ft(e), r = [];
1867
+ function Cr(e) {
1868
+ const { timeBasedCount: t, locationCount: o } = Wt(e), r = [];
1857
1869
  if (t > 0) {
1858
1870
  const n = t > 1 ? "reminders" : "reminder";
1859
1871
  r.push(`${t} time-based ${n}`);
@@ -1864,21 +1876,21 @@ function vr(e) {
1864
1876
  }
1865
1877
  return r.length > 0 ? `Added ${r.join(" and ")}` : "No reminders added";
1866
1878
  }
1867
- const Sr = s.object({
1879
+ const $r = s.object({
1868
1880
  name: s.string().min(1).describe("The name of the section."),
1869
1881
  projectId: s.string().min(1).describe(
1870
1882
  'The ID of the project to add the section to. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
1871
1883
  )
1872
- }), jr = {
1873
- sections: s.array(Sr).min(1).describe("The array of sections to add.")
1874
- }, Cr = {
1884
+ }), Dr = {
1885
+ sections: s.array($r).min(1).describe("The array of sections to add.")
1886
+ }, xr = {
1875
1887
  sections: s.array(ie).describe("The created sections."),
1876
1888
  totalCount: s.number().describe("The total number of sections created.")
1877
- }, $r = {
1889
+ }, Ar = {
1878
1890
  name: f.ADD_SECTIONS,
1879
1891
  description: "Add one or more new sections to projects.",
1880
- parameters: jr,
1881
- outputSchema: Cr,
1892
+ parameters: Dr,
1893
+ outputSchema: xr,
1882
1894
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
1883
1895
  async execute({ sections: e }, t) {
1884
1896
  const r = e.some((c) => he(c.projectId)) ? await t.getUser() : void 0, n = await Promise.all(
@@ -1894,7 +1906,7 @@ const Sr = s.object({
1894
1906
  n.map((c) => t.addSection(c))
1895
1907
  );
1896
1908
  return {
1897
- textContent: Dr({ sections: a }),
1909
+ textContent: Er({ sections: a }),
1898
1910
  structuredContent: {
1899
1911
  sections: a.map(fe),
1900
1912
  totalCount: a.length
@@ -1902,7 +1914,7 @@ const Sr = s.object({
1902
1914
  };
1903
1915
  }
1904
1916
  };
1905
- function Dr({ sections: e }) {
1917
+ function Er({ sections: e }) {
1906
1918
  const t = e.length, o = e.map((n) => `• ${n.name} (id=${n.id}, projectId=${n.projectId})`).join(`
1907
1919
  `);
1908
1920
  return `Added ${t} section${t === 1 ? "" : "s"}:
@@ -1917,7 +1929,7 @@ const te = {
1917
1929
  PROJECT_NOT_FOUND: "PROJECT_NOT_FOUND",
1918
1930
  TASK_NOT_FOUND: "TASK_NOT_FOUND"
1919
1931
  };
1920
- class xr {
1932
+ class Or {
1921
1933
  /**
1922
1934
  * Validate a single assignment operation
1923
1935
  */
@@ -2126,12 +2138,12 @@ class xr {
2126
2138
  };
2127
2139
  }
2128
2140
  }
2129
- const st = new xr();
2141
+ const rt = new Or();
2130
2142
  function oe(e = /* @__PURE__ */ new Date()) {
2131
2143
  const t = e.getFullYear(), o = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0");
2132
2144
  return `${t}-${o}-${r}`;
2133
2145
  }
2134
- function ot(e, t, o = {}) {
2146
+ function nt(e, t, o = {}) {
2135
2147
  const { context: r, showDetails: n = !1 } = o, a = t.length, i = [], d = `${e} ${a} ${a === 1 ? "task" : "tasks"}${r ? ` ${r}` : ""}.`;
2136
2148
  i.push(d);
2137
2149
  const l = 5;
@@ -2161,20 +2173,20 @@ ${i.slice(0, Oe.MAX_FAILURES_SHOWN).map((p) => ` ${p.item} (Error: ${p.error}
2161
2173
  return c.join(`
2162
2174
  `);
2163
2175
  }
2164
- function Ar(e) {
2176
+ function Ur(e) {
2165
2177
  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}` : "";
2166
2178
  return ` ${t}${o}${r}${n}${a}`;
2167
2179
  }
2168
- function Er(e) {
2180
+ function _r(e) {
2169
2181
  const t = ` (${e.color})`, o = e.isFavorite ? " • ⭐" : "", r = ` • id=${e.id}`;
2170
2182
  return ` ${e.name}${t}${o}${r}`;
2171
2183
  }
2172
- function Or(e) {
2184
+ function Pr(e) {
2173
2185
  const t = e.inboxProject ? " • Inbox" : "", o = e.isFavorite ? " • ⭐" : "", r = e.isShared ? " • Shared" : "", n = e.viewStyle && e.viewStyle !== "list" ? ` • ${e.viewStyle}` : "", a = ` • id=${e.id}`;
2174
2186
  return ` ${e.name}${t}${o}${r}${n}${a}`;
2175
2187
  }
2176
2188
  function De(e, t = 5) {
2177
- const r = e.slice(0, t).map(Ar).join(`
2189
+ const r = e.slice(0, t).map(Ur).join(`
2178
2190
  `);
2179
2191
  if (e.length > t) {
2180
2192
  const n = e.length - t;
@@ -2195,10 +2207,10 @@ function N({
2195
2207
  }) {
2196
2208
  const d = [], l = `${e}: ${t}${typeof o == "number" ? ` (limit ${o})` : ""}${r ? ", more available" : ""}.`;
2197
2209
  return d.push(l), n?.length && d.push(`Filter: ${n.join("; ")}.`), a?.length && d.push(`Preview:
2198
- ${a}`), !t && i?.length && d.push(`No results. ${i.join("; ")}.`), (c?.length || r) && d.push(Bt(c || [], r)), d.join(`
2210
+ ${a}`), !t && i?.length && d.push(`No results. ${i.join("; ")}.`), (c?.length || r) && d.push(qt(c || [], r)), d.join(`
2199
2211
  `);
2200
2212
  }
2201
- function Bt(e, t) {
2213
+ function qt(e, t) {
2202
2214
  const o = [...e];
2203
2215
  return t && o.push(`Pass cursor '${t}' to fetch more results.`), `${o.length === 1 ? "Possible suggested next step:" : "Possible suggested next steps:"}
2204
2216
  ${o.map((n) => `- ${n}`).join(`
@@ -2207,14 +2219,14 @@ ${o.map((n) => `- ${n}`).join(`
2207
2219
  function H(e) {
2208
2220
  return s.string().transform((t) => t === "" ? void 0 : t).optional().describe(e);
2209
2221
  }
2210
- const ht = 25, Ur = s.object({
2222
+ const bt = 25, Rr = s.object({
2211
2223
  content: s.string().min(1).describe(
2212
2224
  '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.'
2213
2225
  ),
2214
2226
  description: H(
2215
2227
  "Additional details, notes, or context for the task. Use this for longer content rather than putting it in the task name. Supports Markdown."
2216
2228
  ),
2217
- priority: Je.optional().describe(Ve),
2229
+ priority: Ze.optional().describe(Xe),
2218
2230
  dueString: H("The due date for the task, in natural language."),
2219
2231
  deadlineDate: H(
2220
2232
  '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.'
@@ -2235,25 +2247,25 @@ const ht = 25, Ur = s.object({
2235
2247
  isUncompletable: s.boolean().optional().describe(
2236
2248
  "Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
2237
2249
  )
2238
- }), ft = {
2239
- tasks: s.array(Ur).min(1).max(ht).describe(`The array of tasks to add (max ${ht}).`)
2240
- }, _r = {
2250
+ }), gt = {
2251
+ tasks: s.array(Rr).min(1).max(bt).describe(`The array of tasks to add (max ${bt}).`)
2252
+ }, Lr = {
2241
2253
  tasks: s.array(J).describe("The created tasks."),
2242
2254
  totalCount: s.number().describe("The total number of tasks created."),
2243
2255
  failures: s.array(be).describe("Failed task creations with error details."),
2244
2256
  totalRequested: s.number().describe("The total number of tasks requested."),
2245
2257
  successCount: s.number().describe("The number of successfully created tasks."),
2246
2258
  failureCount: s.number().describe("The number of failed task creations.")
2247
- }, Pr = {
2259
+ }, Nr = {
2248
2260
  name: f.ADD_TASKS,
2249
2261
  description: "Add one or more tasks to a project, section, or parent. Supports assignment to project collaborators.",
2250
- parameters: ft,
2251
- outputSchema: _r,
2262
+ parameters: gt,
2263
+ outputSchema: Lr,
2252
2264
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
2253
2265
  async execute(e, t) {
2254
- const { tasks: o } = s.object(ft).parse(e), r = /* @__PURE__ */ new Map();
2266
+ const { tasks: o } = s.object(gt).parse(e), r = /* @__PURE__ */ new Map();
2255
2267
  o.forEach((p, m) => {
2256
- const h = Rr(p), k = r.get(h);
2268
+ const h = Mr(p), k = r.get(h);
2257
2269
  k ? k.push({ task: p, index: m }) : r.set(h, [{ task: p, index: m }]);
2258
2270
  });
2259
2271
  const n = /* @__PURE__ */ new Map(), i = (await Promise.all(
@@ -2261,7 +2273,7 @@ const ht = 25, Ur = s.object({
2261
2273
  const m = [];
2262
2274
  for (const { task: h, index: k } of p)
2263
2275
  try {
2264
- const b = await Lr(h, t, n);
2276
+ const b = await Fr(h, t, n);
2265
2277
  m.push({ index: k, result: { status: "fulfilled", value: b } });
2266
2278
  } catch (b) {
2267
2279
  m.push({
@@ -2283,7 +2295,7 @@ const ht = 25, Ur = s.object({
2283
2295
  }
2284
2296
  const l = c.map(P);
2285
2297
  return {
2286
- textContent: Nr({
2298
+ textContent: Hr({
2287
2299
  tasks: l,
2288
2300
  failures: d,
2289
2301
  args: { tasks: o }
@@ -2299,10 +2311,10 @@ const ht = 25, Ur = s.object({
2299
2311
  };
2300
2312
  }
2301
2313
  };
2302
- function Rr(e) {
2314
+ function Mr(e) {
2303
2315
  return `${e.projectId ?? ""}|${e.sectionId ?? ""}|${e.parentId ?? ""}`;
2304
2316
  }
2305
- async function Lr(e, t, o) {
2317
+ async function Fr(e, t, o) {
2306
2318
  const {
2307
2319
  duration: r,
2308
2320
  projectId: n,
@@ -2331,13 +2343,13 @@ async function Lr(e, t, o) {
2331
2343
  labels: u,
2332
2344
  deadlineDate: p
2333
2345
  };
2334
- if (l && (k.priority = Rt(l)), d && !h && !a && !i)
2346
+ if (l && (k.priority = Nt(l)), d && !h && !a && !i)
2335
2347
  throw new Error(
2336
2348
  `Task "${e.content}": Cannot assign tasks without specifying project context. Please specify a projectId, sectionId, or parentId.`
2337
2349
  );
2338
2350
  if (r)
2339
2351
  try {
2340
- const { minutes: b } = Pt(r);
2352
+ const { minutes: b } = Lt(r);
2341
2353
  k = {
2342
2354
  ...k,
2343
2355
  duration: b,
@@ -2364,7 +2376,7 @@ async function Lr(e, t, o) {
2364
2376
  throw new Error(
2365
2377
  `Task "${e.content}": Cannot determine target project for assignment validation`
2366
2378
  );
2367
- const j = await st.validateTaskCreationAssignment(
2379
+ const j = await rt.validateTaskCreationAssignment(
2368
2380
  t,
2369
2381
  b,
2370
2382
  d
@@ -2379,7 +2391,7 @@ async function Lr(e, t, o) {
2379
2391
  }
2380
2392
  return await t.addTask(k);
2381
2393
  }
2382
- function Nr({
2394
+ function Hr({
2383
2395
  tasks: e,
2384
2396
  failures: t,
2385
2397
  args: o
@@ -2399,28 +2411,28 @@ function Nr({
2399
2411
  successItems: e.map((a) => a.content ?? "Untitled"),
2400
2412
  successLabel: "Created",
2401
2413
  failures: t
2402
- }) : ot("Added", e, {
2414
+ }) : nt("Added", e, {
2403
2415
  context: n,
2404
2416
  showDetails: !0
2405
2417
  });
2406
2418
  }
2407
- const Mr = {
2419
+ const Wr = {
2408
2420
  projectId: s.string().min(1).describe(
2409
2421
  "The ID of the project to analyze. This triggers a new health analysis which may take some time to complete."
2410
2422
  )
2411
- }, Fr = {
2423
+ }, Gr = {
2412
2424
  projectId: s.string().describe("The project ID."),
2413
2425
  health: s.object({
2414
- status: s.enum(ze).describe("The health status after triggering analysis."),
2426
+ status: s.enum(Ve).describe("The health status after triggering analysis."),
2415
2427
  isStale: s.boolean().describe("Whether the health data is still stale after the request."),
2416
2428
  updateInProgress: s.boolean().describe("Whether an analysis update is currently in progress.")
2417
2429
  }).describe("The health response returned after triggering analysis."),
2418
2430
  message: s.string().describe("A human-readable message about the analysis status.")
2419
- }, Hr = {
2431
+ }, Br = {
2420
2432
  name: f.ANALYZE_PROJECT_HEALTH,
2421
2433
  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.",
2422
- parameters: Mr,
2423
- outputSchema: Fr,
2434
+ parameters: Wr,
2435
+ outputSchema: Gr,
2424
2436
  annotations: {
2425
2437
  readOnlyHint: !1,
2426
2438
  destructiveHint: !1,
@@ -2443,22 +2455,22 @@ ${n}`,
2443
2455
  }
2444
2456
  };
2445
2457
  }
2446
- }, bt = 25, Wr = {
2447
- ids: s.array(s.string().min(1)).min(1).max(bt).describe(
2448
- `The IDs of the goals to complete or uncomplete (max ${bt}).`
2458
+ }, yt = 25, Yr = {
2459
+ ids: s.array(s.string().min(1)).min(1).max(yt).describe(
2460
+ `The IDs of the goals to complete or uncomplete (max ${yt}).`
2449
2461
  ),
2450
2462
  action: s.enum(["complete", "uncomplete"]).describe("Whether to complete or uncomplete the goals.")
2451
- }, Gr = {
2463
+ }, qr = {
2452
2464
  processed: s.array(s.string()).describe("The IDs of successfully processed goals."),
2453
2465
  failures: s.array(be).describe("Failed operations with error details."),
2454
2466
  totalRequested: s.number().describe("The total number of goals requested."),
2455
2467
  successCount: s.number().describe("The number of successfully processed goals."),
2456
2468
  failureCount: s.number().describe("The number of failed operations.")
2457
- }, Br = {
2469
+ }, zr = {
2458
2470
  name: f.COMPLETE_GOALS,
2459
2471
  description: "Complete or uncomplete one or more goals by their IDs.",
2460
- parameters: Wr,
2461
- outputSchema: Gr,
2472
+ parameters: Yr,
2473
+ outputSchema: qr,
2462
2474
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
2463
2475
  async execute(e, t) {
2464
2476
  const o = await Promise.allSettled(
@@ -2491,19 +2503,19 @@ ${n}`,
2491
2503
  }
2492
2504
  };
2493
2505
  }
2494
- }, Yr = {
2506
+ }, Kr = {
2495
2507
  ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to complete.")
2496
- }, qr = {
2508
+ }, Vr = {
2497
2509
  completed: s.array(s.string()).describe("The IDs of successfully completed tasks."),
2498
2510
  failures: s.array(be).describe("Failed task completions with error details."),
2499
2511
  totalRequested: s.number().describe("The total number of tasks requested to complete."),
2500
2512
  successCount: s.number().describe("The number of successfully completed tasks."),
2501
2513
  failureCount: s.number().describe("The number of failed task completions.")
2502
- }, zr = {
2514
+ }, Jr = {
2503
2515
  name: f.COMPLETE_TASKS,
2504
2516
  description: "Complete one or more tasks by their IDs.",
2505
- parameters: Yr,
2506
- outputSchema: qr,
2517
+ parameters: Kr,
2518
+ outputSchema: Vr,
2507
2519
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
2508
2520
  async execute(e, t) {
2509
2521
  const o = [], r = [];
@@ -2518,7 +2530,7 @@ ${n}`,
2518
2530
  });
2519
2531
  }
2520
2532
  return {
2521
- textContent: Kr({
2533
+ textContent: Xr({
2522
2534
  completed: o,
2523
2535
  failures: r,
2524
2536
  args: e
@@ -2533,7 +2545,7 @@ ${n}`,
2533
2545
  };
2534
2546
  }
2535
2547
  };
2536
- function Kr({
2548
+ function Xr({
2537
2549
  completed: e,
2538
2550
  failures: t,
2539
2551
  args: o
@@ -2546,7 +2558,7 @@ function Kr({
2546
2558
  failures: t
2547
2559
  });
2548
2560
  }
2549
- const Yt = [
2561
+ const zt = [
2550
2562
  "project",
2551
2563
  "section",
2552
2564
  "task",
@@ -2556,20 +2568,20 @@ const Yt = [
2556
2568
  "goal",
2557
2569
  "reminder",
2558
2570
  "location_reminder"
2559
- ], Vr = {
2560
- type: s.enum(Yt).describe("The type of entity to delete."),
2571
+ ], Zr = {
2572
+ type: s.enum(zt).describe("The type of entity to delete."),
2561
2573
  id: s.string().min(1).describe("The ID of the entity to delete.")
2562
- }, Jr = {
2574
+ }, Qr = {
2563
2575
  deletedEntity: s.object({
2564
- type: s.enum(Yt).describe("The type of deleted entity."),
2576
+ type: s.enum(zt).describe("The type of deleted entity."),
2565
2577
  id: s.string().describe("The ID of the deleted entity.")
2566
2578
  }).describe("Information about the deleted entity."),
2567
2579
  success: s.boolean().describe("Whether the deletion was successful.")
2568
- }, Xr = {
2580
+ }, en = {
2569
2581
  name: f.DELETE_OBJECT,
2570
2582
  description: "Delete a project, section, task, comment, label, filter, goal, reminder, or location_reminder by its ID.",
2571
- parameters: Vr,
2572
- outputSchema: Jr,
2583
+ parameters: Zr,
2584
+ outputSchema: Qr,
2573
2585
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !0 },
2574
2586
  async execute(e, t) {
2575
2587
  switch (e.type) {
@@ -2617,18 +2629,18 @@ const Yt = [
2617
2629
  }
2618
2630
  };
2619
2631
  }
2620
- }, qt = ["task", "project", "comment", "section", "goal"], Zr = {
2621
- type: s.enum(qt).describe("The type of object to fetch."),
2632
+ }, Kt = ["task", "project", "comment", "section", "goal"], tn = {
2633
+ type: s.enum(Kt).describe("The type of object to fetch."),
2622
2634
  id: s.string().min(1).describe("The unique ID of the object to fetch.")
2623
- }, Qr = {
2624
- type: s.enum(qt).describe("The type of object fetched."),
2635
+ }, sn = {
2636
+ type: s.enum(Kt).describe("The type of object fetched."),
2625
2637
  id: s.string().describe("The ID of the fetched object."),
2626
2638
  object: s.union([J, le, Se, ie, je]).describe("The fetched object data.")
2627
- }, en = {
2639
+ }, on = {
2628
2640
  name: f.FETCH_OBJECT,
2629
2641
  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.",
2630
- parameters: Zr,
2631
- outputSchema: Qr,
2642
+ parameters: tn,
2643
+ outputSchema: sn,
2632
2644
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
2633
2645
  async execute(e, t) {
2634
2646
  const { type: o, id: r } = e;
@@ -2702,21 +2714,21 @@ const Yt = [
2702
2714
  );
2703
2715
  }
2704
2716
  }
2705
- }, tn = {
2717
+ }, rn = {
2706
2718
  id: s.string().min(1).describe(
2707
2719
  'A unique identifier for the document in the format "task:{id}" or "project:{id}".'
2708
2720
  )
2709
- }, sn = {
2721
+ }, nn = {
2710
2722
  id: s.string().describe("The ID of the fetched document."),
2711
2723
  title: s.string().describe("The title of the document."),
2712
2724
  text: s.string().describe("The text content of the document."),
2713
2725
  url: s.string().describe("The URL of the document."),
2714
2726
  metadata: s.record(s.string(), s.unknown()).optional().describe("Additional metadata about the document.")
2715
- }, on = {
2727
+ }, an = {
2716
2728
  name: f.FETCH,
2717
2729
  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}".',
2718
- parameters: tn,
2719
- outputSchema: sn,
2730
+ parameters: rn,
2731
+ outputSchema: nn,
2720
2732
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
2721
2733
  async execute(e, t) {
2722
2734
  const { id: o } = e, [r, n] = o.split(":", 2);
@@ -2735,7 +2747,7 @@ Labels: ${c.labels.join(", ")}`), a = {
2735
2747
  id: `task:${c.id}`,
2736
2748
  title: c.content,
2737
2749
  text: d.join(""),
2738
- url: xt(c.id),
2750
+ url: Ot(c.id),
2739
2751
  metadata: {
2740
2752
  priority: c.priority,
2741
2753
  projectId: c.projectId,
@@ -2758,7 +2770,7 @@ Favorite: Yes`), a = {
2758
2770
  id: `project:${c.id}`,
2759
2771
  title: c.name,
2760
2772
  text: d.join(""),
2761
- url: At(c.id),
2773
+ url: Ut(c.id),
2762
2774
  metadata: {
2763
2775
  color: c.color,
2764
2776
  isFavorite: c.isFavorite,
@@ -2774,7 +2786,7 @@ Favorite: Yes`), a = {
2774
2786
  structuredContent: a
2775
2787
  };
2776
2788
  }
2777
- }, rn = {
2789
+ }, cn = {
2778
2790
  objectType: s.enum(["task", "project", "comment"]).optional().describe("Type of object to filter by."),
2779
2791
  objectId: s.string().optional().describe("Filter by specific object ID (task, project, or comment)."),
2780
2792
  eventType: s.enum([
@@ -2793,17 +2805,17 @@ Favorite: Yes`), a = {
2793
2805
  initiatorId: s.string().optional().describe("Filter by the user ID who initiated the event."),
2794
2806
  limit: s.number().int().min(1).max($.ACTIVITY_MAX).default($.ACTIVITY_DEFAULT).describe("Maximum number of activity events to return."),
2795
2807
  cursor: s.string().optional().describe("Pagination cursor for retrieving the next page of results.")
2796
- }, nn = {
2797
- events: s.array(Lo).describe("The activity events."),
2808
+ }, dn = {
2809
+ events: s.array(Fo).describe("The activity events."),
2798
2810
  nextCursor: s.string().optional().describe("Cursor for the next page of results."),
2799
2811
  totalCount: s.number().describe("The total number of events in this page."),
2800
2812
  hasMore: s.boolean().describe("Whether there are more results available."),
2801
2813
  appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
2802
- }, an = {
2814
+ }, ln = {
2803
2815
  name: f.FIND_ACTIVITY,
2804
2816
  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.",
2805
- parameters: rn,
2806
- outputSchema: nn,
2817
+ parameters: cn,
2818
+ outputSchema: dn,
2807
2819
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
2808
2820
  async execute(e, t) {
2809
2821
  const { objectType: o, objectId: r, eventType: n, projectId: a, taskId: i, initiatorId: c, limit: d, cursor: l } = e, u = {
@@ -2811,9 +2823,9 @@ Favorite: Yes`), a = {
2811
2823
  cursor: l ?? null
2812
2824
  };
2813
2825
  o && n ? u.objectEventTypes = `${o}:${n}` : o ? u.objectEventTypes = `${o}:` : n && (u.objectEventTypes = `:${n}`), r && r !== "remove" && (u.objectId = r), a && (u.parentProjectId = a), i && (u.parentItemId = i), c && (u.initiatorId = c);
2814
- const { results: p, nextCursor: m } = await t.getActivityLogs(u), h = p.map(Oo);
2826
+ const { results: p, nextCursor: m } = await t.getActivityLogs(u), h = p.map(Po);
2815
2827
  return {
2816
- textContent: cn({ events: h, args: e, nextCursor: m }),
2828
+ textContent: un({ events: h, args: e, nextCursor: m }),
2817
2829
  structuredContent: {
2818
2830
  events: h,
2819
2831
  nextCursor: m ?? void 0,
@@ -2824,7 +2836,7 @@ Favorite: Yes`), a = {
2824
2836
  };
2825
2837
  }
2826
2838
  };
2827
- function cn({
2839
+ function un({
2828
2840
  events: e,
2829
2841
  args: t,
2830
2842
  nextCursor: o
@@ -2845,12 +2857,12 @@ function cn({
2845
2857
  limit: t.limit,
2846
2858
  nextCursor: o ?? void 0,
2847
2859
  filterHints: a,
2848
- previewLines: dn(e, Math.min(e.length, t.limit)),
2860
+ previewLines: pn(e, Math.min(e.length, t.limit)),
2849
2861
  zeroReasonHints: i
2850
2862
  });
2851
2863
  }
2852
- function dn(e, t = 10) {
2853
- const r = e.slice(0, t).map(ln).join(`
2864
+ function pn(e, t = 10) {
2865
+ const r = e.slice(0, t).map(mn).join(`
2854
2866
  `);
2855
2867
  if (e.length > t) {
2856
2868
  const n = e.length - t;
@@ -2859,8 +2871,8 @@ function dn(e, t = 10) {
2859
2871
  }
2860
2872
  return r;
2861
2873
  }
2862
- function ln(e) {
2863
- const t = un(e.eventDate), o = `${e.eventType} ${e.objectType}`;
2874
+ function mn(e) {
2875
+ const t = hn(e.eventDate), o = `${e.eventType} ${e.objectType}`;
2864
2876
  let r = "";
2865
2877
  if (e.extraData) {
2866
2878
  const c = e.extraData.content || e.extraData.name || e.extraData.last_content;
@@ -2869,7 +2881,7 @@ function ln(e) {
2869
2881
  const n = e.objectId ? ` • id=${e.objectId}` : "", a = e.initiatorId ? ` • by=${e.initiatorId}` : " • system", i = e.parentProjectId ? ` • project=${e.parentProjectId}` : "";
2870
2882
  return ` [${t}] ${o}${r}${n}${a}${i}`;
2871
2883
  }
2872
- function un(e) {
2884
+ function hn(e) {
2873
2885
  try {
2874
2886
  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", {
2875
2887
  hour: "2-digit",
@@ -2882,7 +2894,7 @@ function un(e) {
2882
2894
  return e;
2883
2895
  }
2884
2896
  }
2885
- const pn = {
2897
+ const fn = {
2886
2898
  taskId: s.string().optional().describe("Find comments for a specific task."),
2887
2899
  projectId: s.string().optional().describe(
2888
2900
  'Find comments for a specific project. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
@@ -2890,7 +2902,7 @@ const pn = {
2890
2902
  commentId: s.string().optional().describe("Get a specific comment by ID."),
2891
2903
  cursor: s.string().optional().describe("Pagination cursor for retrieving more results."),
2892
2904
  limit: s.number().int().min(1).max($.COMMENTS_MAX).optional().describe("Maximum number of comments to return")
2893
- }, mn = {
2905
+ }, bn = {
2894
2906
  comments: s.array(Se).describe("The found comments."),
2895
2907
  searchType: s.string().describe(
2896
2908
  'The type of search performed: "single" (comment ID), "task" (task ID), or "project" (project ID).'
@@ -2899,11 +2911,11 @@ const pn = {
2899
2911
  hasMore: s.boolean().describe("Whether there are more results available."),
2900
2912
  nextCursor: s.string().optional().describe("Cursor for the next page of results."),
2901
2913
  totalCount: s.number().describe("The total number of comments in this page.")
2902
- }, hn = {
2914
+ }, gn = {
2903
2915
  name: f.FIND_COMMENTS,
2904
2916
  description: "Find comments by task, project, or get a specific comment by ID. Exactly one of taskId, projectId, or commentId must be provided.",
2905
- parameters: pn,
2906
- outputSchema: mn,
2917
+ parameters: fn,
2918
+ outputSchema: bn,
2907
2919
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
2908
2920
  async execute(e, t) {
2909
2921
  const o = [e.taskId, e.projectId, e.commentId].filter(Boolean);
@@ -2938,7 +2950,7 @@ const pn = {
2938
2950
  throw new Error("Invalid state: no search parameter provided");
2939
2951
  const c = i.map(we);
2940
2952
  return {
2941
- textContent: fn({
2953
+ textContent: yn({
2942
2954
  comments: c,
2943
2955
  searchType: e.commentId ? "single" : e.taskId ? "task" : "project",
2944
2956
  searchId: e.commentId || e.taskId || e.projectId || "",
@@ -2956,7 +2968,7 @@ const pn = {
2956
2968
  };
2957
2969
  }
2958
2970
  };
2959
- function fn({
2971
+ function yn({
2960
2972
  comments: e,
2961
2973
  searchType: t,
2962
2974
  searchId: o,
@@ -2976,59 +2988,59 @@ function fn({
2976
2988
  a = `Found ${e.length} ${d} for ${t} ${o}${c}`, r && (a += " • More available");
2977
2989
  }
2978
2990
  if (n) {
2979
- const i = Bt([], n);
2991
+ const i = qt([], n);
2980
2992
  return `${a}
2981
2993
  ${i}`;
2982
2994
  }
2983
2995
  return a;
2984
2996
  }
2985
- function zt(e) {
2997
+ function Vt(e) {
2986
2998
  const t = e.getUTCFullYear(), o = String(e.getUTCMonth() + 1).padStart(2, "0"), r = String(e.getUTCDate()).padStart(2, "0");
2987
2999
  return `${t}-${o}-${r}`;
2988
3000
  }
2989
- function bn(e) {
3001
+ function kn(e) {
2990
3002
  const t = /^([+-])(\d{2}):(\d{2})$/.exec(e);
2991
3003
  if (!t)
2992
3004
  return 0;
2993
3005
  const [, o, r, n] = t, a = Number(r) * 60 + Number(n);
2994
3006
  return o === "-" ? -a : a;
2995
3007
  }
2996
- function gn(e, t) {
3008
+ function Tn(e, t) {
2997
3009
  const o = new Date(e.getTime() + t * 60 * 1e3);
2998
- return zt(o);
3010
+ return Vt(o);
2999
3011
  }
3000
- function gt(e, t) {
3012
+ function kt(e, t) {
3001
3013
  const [o, r, n] = e.split("-"), a = Number(o), i = Number(r), c = Number(n);
3002
3014
  if (!Number.isFinite(a) || !Number.isFinite(i) || !Number.isFinite(c))
3003
3015
  throw new Error(`Invalid date format: ${e}. Expected YYYY-MM-DD.`);
3004
3016
  const d = new Date(Date.UTC(a, i - 1, c));
3005
- return d.setUTCDate(d.getUTCDate() + t), zt(d);
3017
+ return d.setUTCDate(d.getUTCDate() + t), Vt(d);
3006
3018
  }
3007
- const yn = ["and", "or"], rt = {
3019
+ const wn = ["and", "or"], at = {
3008
3020
  labels: s.string().array().optional().describe("The labels to filter the tasks by"),
3009
- labelsOperator: s.enum(yn).optional().describe(
3021
+ labelsOperator: s.enum(wn).optional().describe(
3010
3022
  'The operator to use when filtering by labels. This will dictate whether a task has all labels, or some of them. Default is "or".'
3011
3023
  )
3012
3024
  };
3013
- function nt(e = [], t = "or") {
3025
+ function it(e = [], t = "or") {
3014
3026
  if (e.length === 0) return "";
3015
3027
  const o = t === "and" ? " & " : " | ";
3016
3028
  return `(${e.map((a) => a.startsWith("@") ? a : `@${a}`).join(` ${o} `)})`;
3017
3029
  }
3018
- const kn = 7;
3019
- function Tn({
3030
+ const In = 7;
3031
+ function vn({
3020
3032
  since: e,
3021
3033
  until: t,
3022
3034
  userGmtOffset: o,
3023
3035
  now: r = /* @__PURE__ */ new Date()
3024
3036
  }) {
3025
- const n = bn(o), a = gn(r, n), i = kn - 1, c = t ?? (e ? gt(e, i) : a);
3037
+ const n = kn(o), a = Tn(r, n), i = In - 1, c = t ?? (e ? kt(e, i) : a);
3026
3038
  return {
3027
- since: e ?? gt(c, -i),
3039
+ since: e ?? kt(c, -i),
3028
3040
  until: c
3029
3041
  };
3030
3042
  }
3031
- const wn = {
3043
+ const Sn = {
3032
3044
  getBy: s.enum(["completion", "due"]).default("completion").describe(
3033
3045
  '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).'
3034
3046
  ),
@@ -3051,18 +3063,18 @@ const wn = {
3051
3063
  cursor: s.string().optional().describe(
3052
3064
  "The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters)."
3053
3065
  ),
3054
- ...rt
3055
- }, In = {
3066
+ ...at
3067
+ }, jn = {
3056
3068
  tasks: s.array(J).describe("The found completed tasks."),
3057
3069
  nextCursor: s.string().optional().describe("Cursor for the next page of results."),
3058
3070
  totalCount: s.number().describe("The total number of tasks in this page."),
3059
3071
  hasMore: s.boolean().describe("Whether there are more results available."),
3060
3072
  appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
3061
- }, vn = {
3073
+ }, Cn = {
3062
3074
  name: f.FIND_COMPLETED_TASKS,
3063
3075
  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.",
3064
- parameters: wn,
3065
- outputSchema: In,
3076
+ parameters: Sn,
3077
+ outputSchema: jn,
3066
3078
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3067
3079
  async execute(e, t) {
3068
3080
  const { getBy: o, labels: r, labelsOperator: n, since: a, until: i, responsibleUser: c, projectId: d, ...l } = e;
@@ -3070,13 +3082,13 @@ const wn = {
3070
3082
  throw new Error(
3071
3083
  "Cursor pagination requires explicit since and until. Reuse structuredContent.appliedFilters.since and structuredContent.appliedFilters.until from the previous page."
3072
3084
  );
3073
- const u = await Xe(t, c), p = u?.email;
3074
- let h = nt(r, n);
3085
+ const u = await Qe(t, c), p = u?.email;
3086
+ let h = it(r, n);
3075
3087
  u && p && (h = ne(h, `assigned to: ${p}`));
3076
3088
  const k = await t.getUser(), b = k.tzInfo?.gmtString || "+00:00", j = await K({
3077
3089
  projectId: d,
3078
3090
  user: k
3079
- }), v = Tn({
3091
+ }), v = vn({
3080
3092
  since: a,
3081
3093
  until: i,
3082
3094
  userGmtOffset: b
@@ -3098,7 +3110,7 @@ const wn = {
3098
3110
  ...h ? { filterQuery: h, filterLang: "en" } : {}
3099
3111
  }), S = I.map(P);
3100
3112
  return {
3101
- textContent: Sn({
3113
+ textContent: $n({
3102
3114
  tasks: S,
3103
3115
  args: R,
3104
3116
  nextCursor: C,
@@ -3114,7 +3126,7 @@ const wn = {
3114
3126
  };
3115
3127
  }
3116
3128
  };
3117
- function Sn({
3129
+ function $n({
3118
3130
  tasks: e,
3119
3131
  args: t,
3120
3132
  nextCursor: o,
@@ -3140,26 +3152,26 @@ function Sn({
3140
3152
  zeroReasonHints: c
3141
3153
  });
3142
3154
  }
3143
- const jn = {
3155
+ const Dn = {
3144
3156
  searchText: s.string().optional().describe(
3145
3157
  'Search for a goal by name (partial and case insensitive match). Supports wildcards (e.g. "ship*"). If omitted, all goals are returned.'
3146
3158
  ),
3147
- ownerType: s.enum(ys).optional().describe("Filter by ownership type. Omit for all accessible goals."),
3159
+ ownerType: s.enum(Ts).optional().describe("Filter by ownership type. Omit for all accessible goals."),
3148
3160
  limit: s.number().int().min(1).max($.GOALS_MAX).default($.GOALS_DEFAULT).describe("The maximum number of goals to return per page."),
3149
3161
  cursor: s.string().optional().describe(
3150
3162
  "The cursor to get the next page of goals (cursor is obtained from the previous call to this tool, with the same parameters)."
3151
3163
  )
3152
- }, Cn = {
3164
+ }, xn = {
3153
3165
  goals: s.array(je).describe("The found goals."),
3154
3166
  nextCursor: s.string().optional().describe("Cursor for the next page of results."),
3155
3167
  hasMore: s.boolean().describe("Whether there are more results available."),
3156
3168
  totalCount: s.number().describe("The total number of goals returned in this page."),
3157
3169
  appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
3158
- }, $n = {
3170
+ }, An = {
3159
3171
  name: f.FIND_GOALS,
3160
3172
  description: "Search for goals by name or list all accessible goals. Results are paginated — use the returned `nextCursor` to fetch subsequent pages.",
3161
- parameters: jn,
3162
- outputSchema: Cn,
3173
+ parameters: Dn,
3174
+ outputSchema: xn,
3163
3175
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3164
3176
  async execute(e, t) {
3165
3177
  const o = e.searchText ? await t.searchGoals({
@@ -3197,7 +3209,7 @@ const jn = {
3197
3209
  }
3198
3210
  };
3199
3211
  }
3200
- }, Dn = {
3212
+ }, En = {
3201
3213
  searchText: s.string().optional().describe(
3202
3214
  '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.'
3203
3215
  ),
@@ -3205,7 +3217,7 @@ const jn = {
3205
3217
  cursor: s.string().optional().describe(
3206
3218
  "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."
3207
3219
  )
3208
- }, xn = {
3220
+ }, On = {
3209
3221
  labels: s.array(ue).describe("The found personal labels."),
3210
3222
  nextCursor: s.string().optional().describe("Cursor for the next page of results."),
3211
3223
  totalCount: s.number().describe("The total number of labels in this page."),
@@ -3214,22 +3226,22 @@ const jn = {
3214
3226
  "Names of all shared labels visible to you. These have no IDs or metadata — use their names directly when filtering tasks."
3215
3227
  ),
3216
3228
  appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
3217
- }, An = {
3229
+ }, Un = {
3218
3230
  name: f.FIND_LABELS,
3219
3231
  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.",
3220
- parameters: Dn,
3221
- outputSchema: xn,
3232
+ parameters: En,
3233
+ outputSchema: On,
3222
3234
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3223
3235
  async execute(e, t) {
3224
3236
  const [o, r] = await Promise.all([
3225
- e.searchText ? Do(t, e.searchText).then((c) => ({
3237
+ e.searchText ? Eo(t, e.searchText).then((c) => ({
3226
3238
  results: c,
3227
3239
  nextCursor: null
3228
3240
  })) : t.getLabels({ limit: e.limit, cursor: e.cursor ?? null }),
3229
- xo(t)
3241
+ Oo(t)
3230
3242
  ]), { results: n, nextCursor: a } = o, i = e.searchText ? { searchText: e.searchText } : { limit: e.limit, cursor: e.cursor };
3231
3243
  return {
3232
- textContent: En({ labels: n, args: e, nextCursor: a, sharedLabels: r }),
3244
+ textContent: _n({ labels: n, args: e, nextCursor: a, sharedLabels: r }),
3233
3245
  structuredContent: {
3234
3246
  labels: n.map((c) => ue.parse(c)),
3235
3247
  nextCursor: a ?? void 0,
@@ -3241,7 +3253,7 @@ const jn = {
3241
3253
  };
3242
3254
  }
3243
3255
  };
3244
- function En({
3256
+ function _n({
3245
3257
  labels: e,
3246
3258
  args: t,
3247
3259
  nextCursor: o,
@@ -3249,7 +3261,7 @@ function En({
3249
3261
  }) {
3250
3262
  const n = t.searchText ? `All labels matching "${t.searchText}"` : "Labels", a = [];
3251
3263
  t.searchText && a.push(`searchText: "${t.searchText}"`);
3252
- const i = 10, d = e.slice(0, i).map(Er).join(`
3264
+ const i = 10, d = e.slice(0, i).map(_r).join(`
3253
3265
  `), l = e.length - i, u = l > 0 ? `${d}
3254
3266
  …and ${l} more` : d, p = [];
3255
3267
  e.length === 0 && (t.searchText ? (p.push("Try broader search terms"), p.push("Check spelling"), p.push("Remove searchText to see all labels")) : p.push("No personal labels created yet"));
@@ -3266,15 +3278,15 @@ No shared labels.`;
3266
3278
  zeroReasonHints: p
3267
3279
  }) + m;
3268
3280
  }
3269
- const { FIND_PROJECTS: Kt, ADD_TASKS: Vt, UPDATE_TASKS: Jt } = f, On = {
3281
+ const { FIND_PROJECTS: Jt, ADD_TASKS: Xt, UPDATE_TASKS: Zt } = f, Pn = {
3270
3282
  projectId: s.string().min(1).optional().describe(
3271
3283
  '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.'
3272
3284
  ),
3273
3285
  searchTerm: s.string().optional().describe(
3274
3286
  "Search for a user by name or email (partial and case insensitive match). If omitted, all users are returned."
3275
3287
  )
3276
- }, Un = {
3277
- collaborators: s.array(No).describe("The found users."),
3288
+ }, Rn = {
3289
+ collaborators: s.array(Ho).describe("The found users."),
3278
3290
  projectInfo: s.object({
3279
3291
  id: s.string().describe("The project ID."),
3280
3292
  name: s.string().describe("The project name."),
@@ -3283,16 +3295,16 @@ const { FIND_PROJECTS: Kt, ADD_TASKS: Vt, UPDATE_TASKS: Jt } = f, On = {
3283
3295
  totalCount: s.number().describe("The total number of users found."),
3284
3296
  totalAvailable: s.number().optional().describe("The total number of available users before the search filter was applied."),
3285
3297
  appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
3286
- }, _n = {
3298
+ }, Ln = {
3287
3299
  name: f.FIND_PROJECT_COLLABORATORS,
3288
3300
  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.`,
3289
- parameters: On,
3290
- outputSchema: Un,
3301
+ parameters: Pn,
3302
+ outputSchema: Rn,
3291
3303
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3292
3304
  async execute(e, t) {
3293
3305
  const { projectId: o, searchTerm: r } = e;
3294
3306
  if (!o)
3295
- return Pn({ searchTerm: r, client: t, appliedFilters: e });
3307
+ return Nn({ searchTerm: r, client: t, appliedFilters: e });
3296
3308
  let n = o, a;
3297
3309
  try {
3298
3310
  if (a = await t.getProject(o), !a)
@@ -3303,7 +3315,7 @@ const { FIND_PROJECTS: Kt, ADD_TASKS: Vt, UPDATE_TASKS: Jt } = f, On = {
3303
3315
 
3304
3316
  **Next steps:**
3305
3317
  • Share the project to enable collaboration
3306
- • Use ${Vt} and ${Jt} for assignment features once shared`,
3318
+ • Use ${Xt} and ${Zt} for assignment features once shared`,
3307
3319
  structuredContent: {
3308
3320
  collaborators: [],
3309
3321
  projectInfo: {
@@ -3340,9 +3352,9 @@ const { FIND_PROJECTS: Kt, ADD_TASKS: Vt, UPDATE_TASKS: Jt } = f, On = {
3340
3352
  appliedFilters: e
3341
3353
  }
3342
3354
  };
3343
- const c = Xt(i, r);
3355
+ const c = Qt(i, r);
3344
3356
  return {
3345
- textContent: Zt({
3357
+ textContent: es({
3346
3358
  collaborators: c,
3347
3359
  projectName: n,
3348
3360
  searchTerm: r,
@@ -3362,18 +3374,18 @@ const { FIND_PROJECTS: Kt, ADD_TASKS: Vt, UPDATE_TASKS: Jt } = f, On = {
3362
3374
  };
3363
3375
  }
3364
3376
  };
3365
- async function Pn({
3377
+ async function Nn({
3366
3378
  searchTerm: e,
3367
3379
  client: t,
3368
3380
  appliedFilters: o
3369
3381
  }) {
3370
- const r = await W.getAllCollaborators(t), n = await Rn(t, r);
3382
+ const r = await W.getAllCollaborators(t), n = await Mn(t, r);
3371
3383
  if (n.length === 0)
3372
3384
  return {
3373
3385
  textContent: `No users found. You may have no shared projects, or collaborator data is not accessible.
3374
3386
 
3375
3387
  **Next steps:**
3376
- • Use ${Kt} to find shared projects
3388
+ • Use ${Jt} to find shared projects
3377
3389
  • Share a project to add collaborators
3378
3390
  • Ensure you have permission to view collaborators`,
3379
3391
  structuredContent: {
@@ -3384,9 +3396,9 @@ async function Pn({
3384
3396
  appliedFilters: o
3385
3397
  }
3386
3398
  };
3387
- const a = Xt(n, e);
3399
+ const a = Qt(n, e);
3388
3400
  return {
3389
- textContent: Zt({
3401
+ textContent: es({
3390
3402
  collaborators: a,
3391
3403
  projectName: void 0,
3392
3404
  searchTerm: e,
@@ -3401,7 +3413,7 @@ async function Pn({
3401
3413
  }
3402
3414
  };
3403
3415
  }
3404
- async function Rn(e, t) {
3416
+ async function Mn(e, t) {
3405
3417
  try {
3406
3418
  const o = await e.getUser();
3407
3419
  return !o || t.some((r) => r.id === o.id) ? t : [
@@ -3412,7 +3424,7 @@ async function Rn(e, t) {
3412
3424
  return t;
3413
3425
  }
3414
3426
  }
3415
- function Xt(e, t) {
3427
+ function Qt(e, t) {
3416
3428
  if (!t)
3417
3429
  return e;
3418
3430
  const o = t.toLowerCase().trim();
@@ -3420,7 +3432,7 @@ function Xt(e, t) {
3420
3432
  (r) => r.name.toLowerCase().includes(o) || r.email.toLowerCase().includes(o)
3421
3433
  );
3422
3434
  }
3423
- function Zt({
3435
+ function es({
3424
3436
  collaborators: e,
3425
3437
  projectName: t,
3426
3438
  searchTerm: o,
@@ -3436,7 +3448,7 @@ function Zt({
3436
3448
  const l = [];
3437
3449
  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`));
3438
3450
  const u = [];
3439
- return e.length > 0 ? (u.push(`Use ${Vt} with responsibleUser to assign new tasks`), u.push(`Use ${Jt} with responsibleUser to reassign existing tasks`), u.push("Use user names, emails, or IDs for assignments")) : (u.push(`Use ${Kt} to find other projects`), o && r > 0 && u.push("Try searching without filters to see all users")), N({
3451
+ return e.length > 0 ? (u.push(`Use ${Xt} with responsibleUser to assign new tasks`), u.push(`Use ${Zt} with responsibleUser to reassign existing tasks`), u.push("Use user names, emails, or IDs for assignments")) : (u.push(`Use ${Jt} to find other projects`), o && r > 0 && u.push("Try searching without filters to see all users")), N({
3440
3452
  subject: i,
3441
3453
  count: e.length,
3442
3454
  filterHints: c,
@@ -3446,7 +3458,7 @@ function Zt({
3446
3458
  nextSteps: u
3447
3459
  });
3448
3460
  }
3449
- const { ADD_PROJECTS: Ln } = f, Nn = {
3461
+ const { ADD_PROJECTS: Fn } = f, Hn = {
3450
3462
  searchText: s.string().optional().describe(
3451
3463
  '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.'
3452
3464
  ),
@@ -3454,22 +3466,22 @@ const { ADD_PROJECTS: Ln } = f, Nn = {
3454
3466
  cursor: s.string().optional().describe(
3455
3467
  "The cursor to get the next page of projects (cursor is obtained from the previous call to this tool, with the same parameters)."
3456
3468
  )
3457
- }, Mn = {
3469
+ }, Wn = {
3458
3470
  projects: s.array(le).describe("The found projects."),
3459
3471
  nextCursor: s.string().optional().describe("Cursor for the next page of results."),
3460
3472
  totalCount: s.number().describe("The total number of projects in this page."),
3461
3473
  hasMore: s.boolean().describe("Whether there are more results available."),
3462
3474
  appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
3463
- }, Fn = {
3475
+ }, Gn = {
3464
3476
  name: f.FIND_PROJECTS,
3465
3477
  description: "List all projects or search for projects by name. When searching, all matching projects are returned (pagination is ignored). When not searching, projects are returned with pagination.",
3466
- parameters: Nn,
3467
- outputSchema: Mn,
3478
+ parameters: Hn,
3479
+ outputSchema: Wn,
3468
3480
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3469
3481
  async execute(e, t) {
3470
3482
  let o, r = null;
3471
3483
  if (e.searchText)
3472
- o = await Mt(t, e.searchText), r = null;
3484
+ o = await Ht(t, e.searchText), r = null;
3473
3485
  else {
3474
3486
  const a = await t.getProjects({
3475
3487
  limit: e.limit,
@@ -3479,7 +3491,7 @@ const { ADD_PROJECTS: Ln } = f, Nn = {
3479
3491
  }
3480
3492
  const n = o.map(V);
3481
3493
  return {
3482
- textContent: Hn({ projects: n, args: e, nextCursor: r }),
3494
+ textContent: Bn({ projects: n, args: e, nextCursor: r }),
3483
3495
  structuredContent: {
3484
3496
  projects: n,
3485
3497
  nextCursor: r ?? void 0,
@@ -3490,17 +3502,17 @@ const { ADD_PROJECTS: Ln } = f, Nn = {
3490
3502
  };
3491
3503
  }
3492
3504
  };
3493
- function Hn({
3505
+ function Bn({
3494
3506
  projects: e,
3495
3507
  args: t,
3496
3508
  nextCursor: o
3497
3509
  }) {
3498
3510
  const r = t.searchText ? `All projects matching "${t.searchText}"` : "Projects", n = [];
3499
3511
  t.searchText && n.push(`searchText: "${t.searchText}"`);
3500
- const a = 10, c = e.slice(0, a).map(Or).join(`
3512
+ const a = 10, c = e.slice(0, a).map(Pr).join(`
3501
3513
  `), d = e.length - a, l = d > 0 ? `${c}
3502
3514
  …and ${d} more` : c, u = [];
3503
- return e.length === 0 && (t.searchText ? (u.push("Try broader search terms"), u.push("Check spelling"), u.push("Remove searchText to see all projects")) : (u.push("No projects created yet"), u.push(`Use ${Ln} to create a project`))), N({
3515
+ return e.length === 0 && (t.searchText ? (u.push("Try broader search terms"), u.push("Check spelling"), u.push("Remove searchText to see all projects")) : (u.push("No projects created yet"), u.push(`Use ${Fn} to create a project`))), N({
3504
3516
  subject: r,
3505
3517
  count: e.length,
3506
3518
  limit: t.searchText ? void 0 : t.limit,
@@ -3510,22 +3522,22 @@ function Hn({
3510
3522
  zeroReasonHints: u
3511
3523
  });
3512
3524
  }
3513
- const Wn = {
3525
+ const Yn = {
3514
3526
  taskId: s.string().optional().describe(
3515
3527
  "Find all reminders for a specific task. Returns both time-based and location reminders."
3516
3528
  ),
3517
3529
  reminderId: s.string().optional().describe("Get a specific time-based reminder (relative or absolute) by its ID."),
3518
3530
  locationReminderId: s.string().optional().describe("Get a specific location reminder by its ID.")
3519
- }, Gn = {
3520
- reminders: s.array(et).describe("The found reminders (time-based and location)."),
3531
+ }, qn = {
3532
+ reminders: s.array(st).describe("The found reminders (time-based and location)."),
3521
3533
  searchType: s.string().describe('The search type used: "task", "reminder", or "location_reminder".'),
3522
3534
  searchId: s.string().describe("The ID used for the search."),
3523
3535
  totalCount: s.number().describe("Total reminders in this response.")
3524
- }, Bn = {
3536
+ }, zn = {
3525
3537
  name: f.FIND_REMINDERS,
3526
3538
  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.",
3527
- parameters: Wn,
3528
- outputSchema: Gn,
3539
+ parameters: Yn,
3540
+ outputSchema: qn,
3529
3541
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3530
3542
  async execute(e, t) {
3531
3543
  const { taskId: o, reminderId: r, locationReminderId: n } = e, a = [o, r, n].filter(Boolean);
@@ -3571,7 +3583,7 @@ const Wn = {
3571
3583
  })
3572
3584
  ]), l = [...i, ...c].map(me);
3573
3585
  return {
3574
- textContent: Yn(l, o),
3586
+ textContent: Kn(l, o),
3575
3587
  structuredContent: {
3576
3588
  reminders: l,
3577
3589
  searchType: "task",
@@ -3583,10 +3595,10 @@ const Wn = {
3583
3595
  throw new Error("One of taskId, reminderId, or locationReminderId must be provided.");
3584
3596
  }
3585
3597
  };
3586
- function Yn(e, t) {
3598
+ function Kn(e, t) {
3587
3599
  if (e.length === 0)
3588
3600
  return `No reminders found for task ${t}`;
3589
- const { timeBasedCount: o, locationCount: r } = Ft(e), n = [];
3601
+ const { timeBasedCount: o, locationCount: r } = Wt(e), n = [];
3590
3602
  if (o > 0) {
3591
3603
  const a = o > 1 ? "time-based reminders" : "time-based reminder";
3592
3604
  n.push(`${o} ${a}`);
@@ -3597,22 +3609,22 @@ function Yn(e, t) {
3597
3609
  }
3598
3610
  return `Found ${n.join(" and ")} for task ${t}`;
3599
3611
  }
3600
- const { ADD_SECTIONS: qn } = f, zn = {
3612
+ const { ADD_SECTIONS: Vn } = f, Jn = {
3601
3613
  projectId: s.string().min(1).describe(
3602
3614
  'The ID of the project to search sections in. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
3603
3615
  ),
3604
3616
  searchText: s.string().optional().describe(
3605
3617
  '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.'
3606
3618
  )
3607
- }, Kn = {
3619
+ }, Xn = {
3608
3620
  sections: s.array(ie).describe("The found sections."),
3609
3621
  totalCount: s.number().describe("The total number of sections found."),
3610
3622
  appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
3611
- }, Vn = {
3623
+ }, Zn = {
3612
3624
  name: f.FIND_SECTIONS,
3613
3625
  description: "Search for sections by name or other criteria in a project. When searching, uses server-side search to avoid fetching all sections.",
3614
- parameters: zn,
3615
- outputSchema: Kn,
3626
+ parameters: Jn,
3627
+ outputSchema: Xn,
3616
3628
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3617
3629
  async execute(e, t) {
3618
3630
  const o = await K({
@@ -3620,12 +3632,12 @@ const { ADD_SECTIONS: qn } = f, zn = {
3620
3632
  client: t
3621
3633
  });
3622
3634
  let r;
3623
- e.searchText ? r = await Ao(t, e.searchText, o) : r = (await t.getSections({
3635
+ e.searchText ? r = await Uo(t, e.searchText, o) : r = (await t.getSections({
3624
3636
  projectId: o
3625
3637
  })).results;
3626
3638
  const n = r.map(({ id: i, name: c }) => ({ id: i, name: c }));
3627
3639
  return {
3628
- textContent: Jn({
3640
+ textContent: Qn({
3629
3641
  sections: n,
3630
3642
  projectId: e.projectId,
3631
3643
  searchText: e.searchText
@@ -3638,13 +3650,13 @@ const { ADD_SECTIONS: qn } = f, zn = {
3638
3650
  };
3639
3651
  }
3640
3652
  };
3641
- function Jn({
3653
+ function Qn({
3642
3654
  sections: e,
3643
3655
  projectId: t,
3644
3656
  searchText: o
3645
3657
  }) {
3646
3658
  const r = [];
3647
- 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 ${qn} to create sections`));
3659
+ 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 ${Vn} to create sections`));
3648
3660
  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(`
3649
3661
  `) : void 0;
3650
3662
  return N({
@@ -3654,10 +3666,10 @@ function Jn({
3654
3666
  zeroReasonHints: r
3655
3667
  });
3656
3668
  }
3657
- function Qt(e) {
3669
+ function ts(e) {
3658
3670
  return /* @__PURE__ */ new Date(`${e}T00:00:00`);
3659
3671
  }
3660
- const Xn = {
3672
+ const ea = {
3661
3673
  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'."),
3662
3674
  overdueOption: s.enum(["overdue-only", "include-overdue", "exclude-overdue"]).optional().describe(
3663
3675
  "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'."
@@ -3672,57 +3684,57 @@ const Xn = {
3672
3684
  responsibleUser: s.string().optional().describe(
3673
3685
  "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."
3674
3686
  ),
3675
- responsibleUserFiltering: s.enum(Lt).optional().describe(
3687
+ responsibleUserFiltering: s.enum(Mt).optional().describe(
3676
3688
  "Filter when responsibleUser is omitted. 'assigned'=assigned to others; 'unassignedOrMe'=unassigned+mine; 'all'=everyone. Default: 'unassignedOrMe'."
3677
3689
  ),
3678
- ...rt
3679
- }, Zn = {
3690
+ ...at
3691
+ }, ta = {
3680
3692
  tasks: s.array(J).describe("The found tasks."),
3681
3693
  nextCursor: s.string().optional().describe("Cursor for the next page of results."),
3682
3694
  totalCount: s.number().describe("The total number of tasks in this page."),
3683
3695
  hasMore: s.boolean().describe("Whether there are more results available."),
3684
3696
  appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
3685
- }, Qn = {
3697
+ }, sa = {
3686
3698
  name: f.FIND_TASKS_BY_DATE,
3687
3699
  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.",
3688
- parameters: Xn,
3689
- outputSchema: Zn,
3700
+ parameters: ea,
3701
+ outputSchema: ta,
3690
3702
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3691
3703
  async execute(e, t) {
3692
3704
  if (!e.startDate && e.overdueOption !== "overdue-only")
3693
3705
  throw new Error(
3694
3706
  "Either startDate must be provided or overdueOption must be set to overdue-only"
3695
3707
  );
3696
- const o = await Xe(t, e.responsibleUser), r = o?.userId, n = o?.email;
3708
+ const o = await Qe(t, e.responsibleUser), r = o?.userId, n = o?.email;
3697
3709
  let a = "";
3698
3710
  if (e.overdueOption === "overdue-only")
3699
3711
  a = "overdue";
3700
3712
  else if (e.startDate === "today")
3701
3713
  if (e.daysCount > 1) {
3702
- const p = /* @__PURE__ */ new Date(), m = oe(p), h = Fe(p, e.daysCount), k = at(h, { representation: "date" }), b = `(due after: ${m} | due: ${m}) & due before: ${k}`;
3714
+ const p = /* @__PURE__ */ new Date(), m = oe(p), h = Fe(p, e.daysCount), k = ct(h, { representation: "date" }), b = `(due after: ${m} | due: ${m}) & due before: ${k}`;
3703
3715
  a = e.overdueOption === "exclude-overdue" ? b : `(${b} | overdue)`;
3704
3716
  } else
3705
3717
  a = e.overdueOption === "exclude-overdue" ? "today" : "(today | overdue)";
3706
3718
  else if (e.startDate) {
3707
- const p = e.startDate, m = Fe(Qt(p), e.daysCount), h = at(m, { representation: "date" });
3719
+ const p = e.startDate, m = Fe(ts(p), e.daysCount), h = ct(m, { representation: "date" });
3708
3720
  a = `(due after: ${p} | due: ${p}) & due before: ${h}`;
3709
3721
  }
3710
- const i = nt(e.labels, e.labelsOperator);
3722
+ const i = it(e.labels, e.labelsOperator);
3711
3723
  i.length > 0 && (a = ne(a, `(${i})`));
3712
- const c = Nt({
3724
+ const c = Ft({
3713
3725
  resolvedAssigneeId: r,
3714
3726
  assigneeEmail: n,
3715
3727
  responsibleUserFiltering: e.responsibleUserFiltering
3716
3728
  });
3717
3729
  a = ne(a, c);
3718
- const { tasks: d, nextCursor: l } = await Qe({
3730
+ const { tasks: d, nextCursor: l } = await tt({
3719
3731
  client: t,
3720
3732
  query: a,
3721
3733
  cursor: e.cursor,
3722
3734
  limit: e.limit
3723
3735
  });
3724
3736
  return {
3725
- textContent: ea({ tasks: d, args: e, nextCursor: l, assigneeEmail: n }),
3737
+ textContent: oa({ tasks: d, args: e, nextCursor: l, assigneeEmail: n }),
3726
3738
  structuredContent: {
3727
3739
  tasks: d,
3728
3740
  nextCursor: l ?? void 0,
@@ -3733,7 +3745,7 @@ const Xn = {
3733
3745
  };
3734
3746
  }
3735
3747
  };
3736
- function ea({
3748
+ function oa({
3737
3749
  tasks: e,
3738
3750
  args: t,
3739
3751
  nextCursor: o,
@@ -3748,7 +3760,7 @@ function ea({
3748
3760
  `today${c}${t.daysCount > 1 ? ` + ${t.daysCount - 1} more days` : ""}`
3749
3761
  );
3750
3762
  } else if (t.startDate) {
3751
- const c = t.daysCount > 1 ? ` to ${oe(Fe(Qt(t.startDate), t.daysCount))}` : "";
3763
+ const c = t.daysCount > 1 ? ` to ${oe(Fe(ts(t.startDate), t.daysCount))}` : "";
3752
3764
  n.push(`${t.startDate}${c}`);
3753
3765
  }
3754
3766
  if (t.labels && t.labels.length > 0) {
@@ -3783,13 +3795,13 @@ function ea({
3783
3795
  zeroReasonHints: i
3784
3796
  });
3785
3797
  }
3786
- const ta = 300 * 1e3;
3787
- class sa {
3798
+ const ra = 300 * 1e3;
3799
+ class na {
3788
3800
  constructor() {
3789
3801
  this.cache = null;
3790
3802
  }
3791
3803
  async getFilters(t) {
3792
- if (this.cache && Date.now() - this.cache.timestamp < ta)
3804
+ if (this.cache && Date.now() - this.cache.timestamp < ra)
3793
3805
  return this.cache.filters;
3794
3806
  const r = ((await t.sync({
3795
3807
  resourceTypes: ["filters"],
@@ -3846,7 +3858,7 @@ ${u}` + (d.length > 5 ? `
3846
3858
  this.cache = null;
3847
3859
  }
3848
3860
  }
3849
- const oa = new sa(), { FIND_COMPLETED_TASKS: yt, ADD_TASKS: kt } = f, ra = {
3861
+ const aa = new na(), { FIND_COMPLETED_TASKS: Tt, ADD_TASKS: wt } = f, ia = {
3850
3862
  searchText: s.string().optional().describe("The text to search for in tasks."),
3851
3863
  projectId: s.string().optional().describe(
3852
3864
  'Find tasks in this project. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
@@ -3854,7 +3866,7 @@ const oa = new sa(), { FIND_COMPLETED_TASKS: yt, ADD_TASKS: kt } = f, ra = {
3854
3866
  sectionId: s.string().optional().describe("Find tasks in this section."),
3855
3867
  parentId: s.string().optional().describe("Find subtasks of this parent task."),
3856
3868
  responsibleUser: s.string().optional().describe("Find tasks assigned to this user. Can be a user ID, name, or email address."),
3857
- responsibleUserFiltering: s.enum(Lt).optional().describe(
3869
+ responsibleUserFiltering: s.enum(Mt).optional().describe(
3858
3870
  '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`.'
3859
3871
  ),
3860
3872
  limit: s.number().int().min(1).max($.TASKS_MAX).default($.TASKS_DEFAULT).describe("The maximum number of tasks to return."),
@@ -3867,18 +3879,18 @@ const oa = new sa(), { FIND_COMPLETED_TASKS: yt, ADD_TASKS: kt } = f, ra = {
3867
3879
  filterIdOrName: s.string().optional().describe(
3868
3880
  "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."
3869
3881
  ),
3870
- ...rt
3871
- }, na = {
3882
+ ...at
3883
+ }, ca = {
3872
3884
  tasks: s.array(J).describe("The found tasks."),
3873
3885
  nextCursor: s.string().optional().describe("Cursor for the next page of results."),
3874
3886
  totalCount: s.number().describe("The total number of tasks in this page."),
3875
3887
  hasMore: s.boolean().describe("Whether there are more results available."),
3876
3888
  appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
3877
- }, aa = {
3889
+ }, da = {
3878
3890
  name: f.FIND_TASKS,
3879
3891
  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.",
3880
- parameters: ra,
3881
- outputSchema: na,
3892
+ parameters: ia,
3893
+ outputSchema: ca,
3882
3894
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3883
3895
  async execute(e, t) {
3884
3896
  const {
@@ -3908,8 +3920,8 @@ const oa = new sa(), { FIND_COMPLETED_TASKS: yt, ADD_TASKS: kt } = f, ra = {
3908
3920
  'The `filter`/`filterIdOrName` parameter cannot be combined with projectId, sectionId, or parentId. Use filter syntax instead (e.g. "##ProjectName").'
3909
3921
  );
3910
3922
  let j = m;
3911
- h && (j = (await oa.resolveFilter(t, h)).filterQuery);
3912
- const v = await Xe(t, i), A = v?.userId, w = v?.email;
3923
+ h && (j = (await aa.resolveFilter(t, h)).filterQuery);
3924
+ const v = await Qe(t, i), A = v?.userId, w = v?.email;
3913
3925
  if (r || n || a) {
3914
3926
  const x = {
3915
3927
  limit: d,
@@ -3920,7 +3932,7 @@ const oa = new sa(), { FIND_COMPLETED_TASKS: yt, ADD_TASKS: kt } = f, ra = {
3920
3932
  let F = o ? xe.filter(
3921
3933
  (X) => X.content.toLowerCase().includes(o.toLowerCase()) || X.description?.toLowerCase().includes(o.toLowerCase())
3922
3934
  ) : xe;
3923
- return F = $o({
3935
+ return F = Ao({
3924
3936
  tasks: F,
3925
3937
  resolvedAssigneeId: A,
3926
3938
  currentUserId: k.id,
@@ -3972,16 +3984,16 @@ const oa = new sa(), { FIND_COMPLETED_TASKS: yt, ADD_TASKS: kt } = f, ra = {
3972
3984
  }
3973
3985
  let y = j ? `(${j})` : "";
3974
3986
  o && (y = ne(y, `search: ${o}`));
3975
- const D = nt(u, p);
3987
+ const D = it(u, p);
3976
3988
  if (y = ne(y, D), !(h && !i && !c)) {
3977
- const x = Nt({
3989
+ const x = Ft({
3978
3990
  resolvedAssigneeId: A,
3979
3991
  assigneeEmail: w,
3980
3992
  responsibleUserFiltering: c
3981
3993
  });
3982
3994
  y = ne(y, x);
3983
3995
  }
3984
- const { tasks: I, nextCursor: C } = await Qe({
3996
+ const { tasks: I, nextCursor: C } = await tt({
3985
3997
  client: t,
3986
3998
  query: y,
3987
3999
  cursor: e.cursor,
@@ -4005,12 +4017,12 @@ const oa = new sa(), { FIND_COMPLETED_TASKS: yt, ADD_TASKS: kt } = f, ra = {
4005
4017
  };
4006
4018
  }
4007
4019
  };
4008
- function ia(e) {
4020
+ function la(e) {
4009
4021
  if (e.projectId) {
4010
4022
  const t = [
4011
4023
  e.searchText ? "No tasks in project match search" : "Project has no tasks yet"
4012
4024
  ];
4013
- return e.searchText || t.push(`Use ${kt} to create tasks`), t;
4025
+ return e.searchText || t.push(`Use ${wt} to create tasks`), t;
4014
4026
  }
4015
4027
  if (e.sectionId) {
4016
4028
  const t = [e.searchText ? "No tasks in section match search" : "Section is empty"];
@@ -4018,7 +4030,7 @@ function ia(e) {
4018
4030
  }
4019
4031
  if (e.parentId) {
4020
4032
  const t = [e.searchText ? "No subtasks match search" : "No subtasks created yet"];
4021
- return e.searchText || t.push(`Use ${kt} with parentId to add subtasks`), t;
4033
+ return e.searchText || t.push(`Use ${wt} with parentId to add subtasks`), t;
4022
4034
  }
4023
4035
  return [];
4024
4036
  }
@@ -4040,7 +4052,7 @@ function _e({
4040
4052
  const d = t.labels.map((l) => `@${l}`).join(t.labelsOperator === "and" ? " & " : " | ");
4041
4053
  i.push(`labels: ${d}`);
4042
4054
  }
4043
- e.length === 0 && c.push(...ia(t));
4055
+ e.length === 0 && c.push(...la(t));
4044
4056
  } else {
4045
4057
  const d = n || t.responsibleUser, l = [];
4046
4058
  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) {
@@ -4054,9 +4066,9 @@ function _e({
4054
4066
  if (e.length === 0) {
4055
4067
  if (t.responsibleUser) {
4056
4068
  const u = n || t.responsibleUser;
4057
- c.push(`No tasks assigned to ${u}`), c.push("Check if the user name is correct"), c.push(`Check completed tasks with ${yt}`);
4069
+ c.push(`No tasks assigned to ${u}`), c.push("Check if the user name is correct"), c.push(`Check completed tasks with ${Tt}`);
4058
4070
  }
4059
- t.searchText && (c.push("Try broader search terms"), c.push("Verify spelling and try partial words"), t.responsibleUser || c.push(`Check completed tasks with ${yt}`));
4071
+ t.searchText && (c.push("Try broader search terms"), c.push("Verify spelling and try partial words"), t.responsibleUser || c.push(`Check completed tasks with ${Tt}`));
4060
4072
  }
4061
4073
  }
4062
4074
  return N({
@@ -4069,11 +4081,11 @@ function _e({
4069
4081
  zeroReasonHints: c
4070
4082
  });
4071
4083
  }
4072
- const ca = {
4084
+ const ua = {
4073
4085
  projectId: s.string().min(1).optional().describe(
4074
4086
  "Optional project ID. If provided, shows detailed overview of that project. If omitted, shows overview of all projects."
4075
4087
  )
4076
- }, es = s.lazy(
4088
+ }, ss = s.lazy(
4077
4089
  () => s.object({
4078
4090
  id: s.string().describe("The project ID."),
4079
4091
  name: s.string().describe("The project name."),
@@ -4086,9 +4098,9 @@ const ca = {
4086
4098
  name: s.string()
4087
4099
  })
4088
4100
  ),
4089
- children: s.array(es).describe("Nested child projects.")
4101
+ children: s.array(ss).describe("Nested child projects.")
4090
4102
  })
4091
- ), da = {
4103
+ ), pa = {
4092
4104
  type: s.enum(["account_overview", "project_overview"]).describe("The type of overview returned."),
4093
4105
  totalProjects: s.number().optional().describe("Total number of projects (account overview only)."),
4094
4106
  totalTasks: s.number().optional().describe("Total number of tasks."),
@@ -4107,7 +4119,7 @@ const ca = {
4107
4119
  name: s.string().describe("The inbox project name."),
4108
4120
  sections: s.array(ie).describe("Sections in the inbox project.")
4109
4121
  }).nullable().optional().describe("Inbox information (account overview only)."),
4110
- projects: s.array(s.lazy(() => es)).optional().describe(
4122
+ projects: s.array(s.lazy(() => ss)).optional().describe(
4111
4123
  "List of projects with hierarchy, folders, and ordering (account overview only)."
4112
4124
  ),
4113
4125
  project: s.object({
@@ -4122,7 +4134,7 @@ const ca = {
4122
4134
  tasksWithoutSection: s.number()
4123
4135
  }).optional().describe("Statistics object (project overview only).")
4124
4136
  };
4125
- function la(e) {
4137
+ function ma(e) {
4126
4138
  const t = {};
4127
4139
  for (const n of e)
4128
4140
  t[n.id] = {
@@ -4147,7 +4159,7 @@ function la(e) {
4147
4159
  }
4148
4160
  return r(o), o;
4149
4161
  }
4150
- async function ua(e, t) {
4162
+ async function ha(e, t) {
4151
4163
  const o = {};
4152
4164
  return await Promise.all(
4153
4165
  t.map(async (r) => {
@@ -4156,17 +4168,17 @@ async function ua(e, t) {
4156
4168
  })
4157
4169
  ), o;
4158
4170
  }
4159
- function ts(e, t, o = "") {
4171
+ function os(e, t, o = "") {
4160
4172
  const r = [];
4161
4173
  r.push(`${o}- Project: ${e.name} (id=${e.id})`);
4162
4174
  const n = t[e.id] || [];
4163
4175
  for (const a of n)
4164
4176
  r.push(`${o} - Section: ${a.name} (id=${a.id})`);
4165
4177
  for (const a of e.children)
4166
- r.push(...ts(a, t, `${o} `));
4178
+ r.push(...os(a, t, `${o} `));
4167
4179
  return r;
4168
4180
  }
4169
- function Tt(e) {
4181
+ function It(e) {
4170
4182
  const t = {};
4171
4183
  for (const r of e)
4172
4184
  t[r.id] = { ...r, children: [] };
@@ -4183,15 +4195,15 @@ function Tt(e) {
4183
4195
  }
4184
4196
  return o;
4185
4197
  }
4186
- function Ye(e, t = "") {
4198
+ function ze(e, t = "") {
4187
4199
  const o = [];
4188
4200
  for (const r of e) {
4189
4201
  const n = `id=${r.id}`, a = r.dueDate ? `; due=${r.dueDate}` : "", i = `; content=${r.content}`;
4190
- o.push(`${t}- ${n}${a}${i}`), r.children.length > 0 && o.push(...Ye(r.children, `${t} `));
4202
+ o.push(`${t}- ${n}${a}${i}`), r.children.length > 0 && o.push(...ze(r.children, `${t} `));
4191
4203
  }
4192
4204
  return o;
4193
4205
  }
4194
- function ss(e, t) {
4206
+ function rs(e, t) {
4195
4207
  return {
4196
4208
  id: e.id,
4197
4209
  name: e.name,
@@ -4200,11 +4212,11 @@ function ss(e, t) {
4200
4212
  childOrder: e.childOrder,
4201
4213
  sections: (t[e.id] || []).map(fe),
4202
4214
  children: e.children.map(
4203
- (o) => ss(o, t)
4215
+ (o) => rs(o, t)
4204
4216
  )
4205
4217
  };
4206
4218
  }
4207
- async function pa(e, t) {
4219
+ async function fa(e, t) {
4208
4220
  let o = [], r;
4209
4221
  do {
4210
4222
  const { results: n, nextCursor: a } = await e.getTasks({
@@ -4216,12 +4228,12 @@ async function pa(e, t) {
4216
4228
  } while (r);
4217
4229
  return o;
4218
4230
  }
4219
- async function ma(e, t) {
4231
+ async function ba(e, t) {
4220
4232
  const { results: o } = await e.getSections({ projectId: t });
4221
4233
  return o;
4222
4234
  }
4223
- async function ha(e) {
4224
- const { results: t } = await e.getProjects({}), o = t.find((p) => ae(p) && p.inboxProject === !0), r = t.filter((p) => !ae(p) || p.inboxProject !== !0), n = la(r), a = t.map((p) => p.id), i = await ua(e, a), c = ["# Personal Projects", ""];
4235
+ async function ga(e) {
4236
+ const { results: t } = await e.getProjects({}), o = t.find((p) => ae(p) && p.inboxProject === !0), r = t.filter((p) => !ae(p) || p.inboxProject !== !0), n = ma(r), a = t.map((p) => p.id), i = await ha(e, a), c = ["# Personal Projects", ""];
4225
4237
  if (o) {
4226
4238
  c.push(`- Inbox Project: ${o.name} (id=${o.id})`);
4227
4239
  for (const p of i[o.id] || [])
@@ -4229,7 +4241,7 @@ async function ha(e) {
4229
4241
  }
4230
4242
  if (n.length)
4231
4243
  for (const p of n)
4232
- c.push(...ts(p, i));
4244
+ c.push(...os(p, i));
4233
4245
  else
4234
4246
  c.push("_No projects found._");
4235
4247
  c.push("");
@@ -4247,7 +4259,7 @@ async function ha(e) {
4247
4259
  sections: (i[o.id] || []).map(fe)
4248
4260
  } : null,
4249
4261
  projects: n.map(
4250
- (p) => ss(p, i)
4262
+ (p) => rs(p, i)
4251
4263
  ),
4252
4264
  totalProjects: t.length,
4253
4265
  totalSections: a.reduce(
@@ -4258,11 +4270,11 @@ async function ha(e) {
4258
4270
  };
4259
4271
  return { textContent: l, structuredContent: u };
4260
4272
  }
4261
- async function fa(e, t) {
4273
+ async function ya(e, t) {
4262
4274
  const [o, r, n] = await Promise.all([
4263
4275
  e.getProject(t),
4264
- ma(e, t),
4265
- pa(e, t)
4276
+ ba(e, t),
4277
+ fa(e, t)
4266
4278
  ]), a = {};
4267
4279
  for (const u of r)
4268
4280
  a[u.id] = [];
@@ -4272,16 +4284,16 @@ async function fa(e, t) {
4272
4284
  const c = [`# ${o.name}`];
4273
4285
  if (i.length > 0) {
4274
4286
  c.push("");
4275
- const u = Tt(i);
4276
- c.push(...Ye(u));
4287
+ const u = It(i);
4288
+ c.push(...ze(u));
4277
4289
  }
4278
4290
  for (const u of r) {
4279
4291
  c.push(""), c.push(`## ${u.name}`);
4280
4292
  const p = a[u.id];
4281
4293
  if (!p?.length)
4282
4294
  continue;
4283
- const m = Tt(p);
4284
- c.push(...Ye(m));
4295
+ const m = It(p);
4296
+ c.push(...ze(m));
4285
4297
  }
4286
4298
  const d = c.join(`
4287
4299
  `), l = {
@@ -4304,33 +4316,33 @@ async function fa(e, t) {
4304
4316
  };
4305
4317
  return { textContent: d, structuredContent: l };
4306
4318
  }
4307
- const ba = {
4319
+ const ka = {
4308
4320
  name: f.GET_OVERVIEW,
4309
4321
  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.",
4310
- parameters: ca,
4311
- outputSchema: da,
4322
+ parameters: ua,
4323
+ outputSchema: pa,
4312
4324
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
4313
4325
  async execute(e, t) {
4314
- const o = e.projectId ? await fa(t, e.projectId) : await ha(t);
4326
+ const o = e.projectId ? await ya(t, e.projectId) : await ga(t);
4315
4327
  return {
4316
4328
  textContent: o.textContent,
4317
4329
  structuredContent: o.structuredContent
4318
4330
  };
4319
4331
  }
4320
- }, ga = {}, se = s.object({
4332
+ }, Ta = {}, se = s.object({
4321
4333
  count: s.number().describe("Number of consecutive periods in this streak."),
4322
4334
  start: s.string().describe("Start date of the streak."),
4323
4335
  end: s.string().describe("End date of the streak.")
4324
- }), wt = s.object({
4336
+ }), vt = s.object({
4325
4337
  id: s.string().describe("Project ID."),
4326
4338
  completed: s.number().describe("Number of tasks completed in this project.")
4327
- }), ya = {
4339
+ }), wa = {
4328
4340
  completedCount: s.number().describe("Total number of completed tasks (all-time)."),
4329
4341
  daysItems: s.array(
4330
4342
  s.object({
4331
4343
  date: s.string().describe("Date string (YYYY-MM-DD)."),
4332
4344
  totalCompleted: s.number().describe("Total tasks completed on this day."),
4333
- items: s.array(wt).describe("Per-project completion breakdown for this day.")
4345
+ items: s.array(vt).describe("Per-project completion breakdown for this day.")
4334
4346
  })
4335
4347
  ).describe("Daily completion breakdown (most recent days)."),
4336
4348
  weekItems: s.array(
@@ -4338,7 +4350,7 @@ const ba = {
4338
4350
  from: s.string().describe("Start date of the week."),
4339
4351
  to: s.string().describe("End date of the week."),
4340
4352
  totalCompleted: s.number().describe("Total tasks completed in this week."),
4341
- items: s.array(wt).describe("Per-project completion breakdown for this week.")
4353
+ items: s.array(vt).describe("Per-project completion breakdown for this week.")
4342
4354
  })
4343
4355
  ).describe("Weekly completion breakdown (most recent weeks)."),
4344
4356
  goals: s.object({
@@ -4373,11 +4385,11 @@ const ba = {
4373
4385
  })
4374
4386
  ).describe("Recent karma change events with reasons."),
4375
4387
  projectColors: s.record(s.string(), s.string()).describe("Map of project ID to color key.")
4376
- }, ka = {
4388
+ }, Ia = {
4377
4389
  name: f.GET_PRODUCTIVITY_STATS,
4378
4390
  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.",
4379
- parameters: ga,
4380
- outputSchema: ya,
4391
+ parameters: Ta,
4392
+ outputSchema: wa,
4381
4393
  annotations: {
4382
4394
  readOnlyHint: !0,
4383
4395
  destructiveHint: !1,
@@ -4386,7 +4398,7 @@ const ba = {
4386
4398
  async execute(e, t) {
4387
4399
  const o = await t.getProductivityStats();
4388
4400
  return {
4389
- textContent: Ta(o),
4401
+ textContent: va(o),
4390
4402
  structuredContent: {
4391
4403
  completedCount: o.completedCount,
4392
4404
  daysItems: o.daysItems,
@@ -4413,7 +4425,7 @@ const ba = {
4413
4425
  };
4414
4426
  }
4415
4427
  };
4416
- function Ta(e) {
4428
+ function va(e) {
4417
4429
  const t = [
4418
4430
  "# Productivity Statistics",
4419
4431
  "",
@@ -4443,11 +4455,11 @@ function Ta(e) {
4443
4455
  return t.join(`
4444
4456
  `);
4445
4457
  }
4446
- const wa = {
4458
+ const Sa = {
4447
4459
  projectId: s.string().min(1).describe("The ID of the project to get activity stats for."),
4448
4460
  weeks: s.number().int().min(1).max(12).optional().describe("Number of weeks of activity data to retrieve (1-12, default 2)."),
4449
4461
  includeWeeklyCounts: s.boolean().optional().describe("Include weekly rollup counts alongside daily counts.")
4450
- }, Ia = {
4462
+ }, ja = {
4451
4463
  projectId: s.string().describe("The project ID."),
4452
4464
  dayItems: s.array(
4453
4465
  s.object({
@@ -4463,7 +4475,7 @@ const wa = {
4463
4475
  })
4464
4476
  ).nullable().describe("Weekly completion rollups. Only included when includeWeeklyCounts is true.")
4465
4477
  };
4466
- function va(e, t) {
4478
+ function Ca(e, t) {
4467
4479
  const o = [`# Activity Stats: Project ${e}`, ""];
4468
4480
  if (t.dayItems.length > 0) {
4469
4481
  o.push("## Daily Activity");
@@ -4479,11 +4491,11 @@ function va(e, t) {
4479
4491
  return o.join(`
4480
4492
  `);
4481
4493
  }
4482
- const Sa = {
4494
+ const $a = {
4483
4495
  name: f.GET_PROJECT_ACTIVITY_STATS,
4484
4496
  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.",
4485
- parameters: wa,
4486
- outputSchema: Ia,
4497
+ parameters: Sa,
4498
+ outputSchema: ja,
4487
4499
  annotations: {
4488
4500
  readOnlyHint: !0,
4489
4501
  destructiveHint: !1,
@@ -4495,7 +4507,7 @@ const Sa = {
4495
4507
  includeWeeklyCounts: n
4496
4508
  });
4497
4509
  return {
4498
- textContent: va(o, a),
4510
+ textContent: Ca(o, a),
4499
4511
  structuredContent: {
4500
4512
  projectId: o,
4501
4513
  dayItems: a.dayItems,
@@ -4503,15 +4515,15 @@ const Sa = {
4503
4515
  }
4504
4516
  };
4505
4517
  }
4506
- }, ja = {
4518
+ }, Da = {
4507
4519
  projectId: s.string().min(1).describe("The ID of the project to check health for."),
4508
4520
  includeContext: s.boolean().default(!1).describe(
4509
4521
  "Include detailed health context with project metrics and task-level data. May produce large output for projects with many tasks."
4510
4522
  )
4511
- }, Ca = s.object({
4523
+ }, xa = s.object({
4512
4524
  taskId: s.string().describe("The ID of the task this recommendation is for."),
4513
4525
  recommendation: s.string().describe("The recommendation for this task.")
4514
- }), $a = s.object({
4526
+ }), Aa = s.object({
4515
4527
  id: s.string().describe("The task ID."),
4516
4528
  content: s.string().describe("The task content/title."),
4517
4529
  priority: s.string().describe("The task priority (1-4)."),
@@ -4519,7 +4531,7 @@ const Sa = {
4519
4531
  deadline: s.string().nullable().optional().describe("The deadline date string, if set."),
4520
4532
  isCompleted: s.boolean().describe("Whether the task is completed."),
4521
4533
  labels: s.array(s.string()).describe("Labels applied to this task.")
4522
- }), Da = {
4534
+ }), Ea = {
4523
4535
  projectId: s.string().describe("The project ID."),
4524
4536
  projectName: s.string().describe("The project name."),
4525
4537
  progress: s.object({
@@ -4528,10 +4540,10 @@ const Sa = {
4528
4540
  progressPercent: s.number().describe("Completion percentage (0-100).")
4529
4541
  }).describe("Project completion progress."),
4530
4542
  health: s.object({
4531
- status: s.enum(ze).describe("The overall health status of the project."),
4543
+ status: s.enum(Ve).describe("The overall health status of the project."),
4532
4544
  description: s.string().nullable().optional().describe("Detailed description of the health assessment."),
4533
4545
  descriptionSummary: s.string().nullable().optional().describe("Brief summary of the health assessment."),
4534
- taskRecommendations: s.array(Ca).nullable().optional().describe("Specific recommendations for individual tasks."),
4546
+ taskRecommendations: s.array(xa).nullable().optional().describe("Specific recommendations for individual tasks."),
4535
4547
  isStale: s.boolean().describe("Whether the health data is stale and may need refreshing."),
4536
4548
  updateInProgress: s.boolean().describe("Whether a health analysis update is currently in progress."),
4537
4549
  updatedAt: s.string().nullable().optional().describe("When the health assessment was last updated.")
@@ -4546,12 +4558,12 @@ const Sa = {
4546
4558
  tasksCompletedThisWeek: s.number().describe("Tasks completed in the current week."),
4547
4559
  averageCompletionTime: s.number().nullable().describe("Average task completion time in days, if available.")
4548
4560
  }).describe("Aggregated project metrics."),
4549
- tasks: s.array($a).describe("Tasks in the project.")
4561
+ tasks: s.array(Aa).describe("Tasks in the project.")
4550
4562
  }).optional().describe(
4551
4563
  "Detailed project context with metrics and task data. Only included when includeContext is true."
4552
4564
  )
4553
4565
  };
4554
- async function xa(e, t, o) {
4566
+ async function Oa(e, t, o) {
4555
4567
  if (o) {
4556
4568
  const [a, i, c] = await Promise.all([
4557
4569
  e.getProjectProgress(t),
@@ -4566,7 +4578,7 @@ async function xa(e, t, o) {
4566
4578
  ]);
4567
4579
  return { progress: r, health: n };
4568
4580
  }
4569
- function Aa(e, { progress: t, health: o, context: r }) {
4581
+ function Ua(e, { progress: t, health: o, context: r }) {
4570
4582
  const n = [`# Project Health: ${e}`, ""];
4571
4583
  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(
4572
4584
  `**Completed:** ${t.completedCount} | **Active:** ${t.activeCount} | **Progress:** ${t.progressPercent}%`
@@ -4589,18 +4601,18 @@ function Aa(e, { progress: t, health: o, context: r }) {
4589
4601
  return n.join(`
4590
4602
  `);
4591
4603
  }
4592
- const Ea = {
4604
+ const _a = {
4593
4605
  name: f.GET_PROJECT_HEALTH,
4594
4606
  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.",
4595
- parameters: ja,
4596
- outputSchema: Da,
4607
+ parameters: Da,
4608
+ outputSchema: Ea,
4597
4609
  annotations: {
4598
4610
  readOnlyHint: !0,
4599
4611
  destructiveHint: !1,
4600
4612
  idempotentHint: !0
4601
4613
  },
4602
4614
  async execute(e, t) {
4603
- const { projectId: o, includeContext: r } = e, n = await xa(t, o, r), a = n.context?.projectName ?? `Project ${o}`, i = Aa(a, n), c = n.context ? {
4615
+ const { projectId: o, includeContext: r } = e, n = await Oa(t, o, r), a = n.context?.projectName ?? `Project ${o}`, i = Ua(a, n), c = n.context ? {
4604
4616
  projectDescription: n.context.projectDescription,
4605
4617
  projectMetrics: n.context.projectMetrics,
4606
4618
  tasks: n.context.tasks.map((d) => ({
@@ -4636,15 +4648,15 @@ const Ea = {
4636
4648
  }
4637
4649
  };
4638
4650
  }
4639
- }, Oa = {
4651
+ }, Pa = {
4640
4652
  workspaceIdOrName: s.string().min(1).describe(
4641
4653
  "The workspace ID or name. Supports exact ID, exact name match (case-insensitive), or unique partial name match."
4642
4654
  ),
4643
4655
  projectIds: s.array(s.string().min(1)).min(1).optional().describe("Optional list of project IDs to scope insights to specific projects.")
4644
- }, Ua = s.object({
4656
+ }, Ra = s.object({
4645
4657
  projectId: s.string().describe("The project ID."),
4646
4658
  health: s.object({
4647
- status: s.enum(ze).describe("The health status of the project."),
4659
+ status: s.enum(Ve).describe("The health status of the project."),
4648
4660
  isStale: s.boolean().describe("Whether the health data is stale."),
4649
4661
  updateInProgress: s.boolean().describe("Whether a health analysis update is in progress.")
4650
4662
  }).nullable().describe("Health data for this project, if available."),
@@ -4653,23 +4665,23 @@ const Ea = {
4653
4665
  activeCount: s.number().describe("Number of active tasks."),
4654
4666
  progressPercent: s.number().describe("Completion percentage (0-100).")
4655
4667
  }).nullable().describe("Progress data for this project, if available.")
4656
- }), _a = {
4668
+ }), La = {
4657
4669
  workspaceId: s.string().describe("The resolved workspace ID."),
4658
4670
  workspaceName: s.string().describe("The resolved workspace name."),
4659
4671
  folderId: s.string().nullable().describe("The folder ID, if applicable."),
4660
- projectInsights: s.array(Ua).describe("Health and progress insights for each project in the workspace.")
4661
- }, Pa = {
4672
+ projectInsights: s.array(Ra).describe("Health and progress insights for each project in the workspace.")
4673
+ }, Na = {
4662
4674
  name: f.GET_WORKSPACE_INSIGHTS,
4663
4675
  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.",
4664
- parameters: Oa,
4665
- outputSchema: _a,
4676
+ parameters: Pa,
4677
+ outputSchema: La,
4666
4678
  annotations: {
4667
4679
  readOnlyHint: !0,
4668
4680
  destructiveHint: !1,
4669
4681
  idempotentHint: !0
4670
4682
  },
4671
4683
  async execute(e, t) {
4672
- const { workspaceIdOrName: o, projectIds: r } = e, n = await Ht.resolveWorkspace(t, o), a = await t.getWorkspaceInsights(n.workspaceId, { projectIds: r }), i = a.projectInsights.map((d) => ({
4684
+ const { workspaceIdOrName: o, projectIds: r } = e, n = await Gt.resolveWorkspace(t, o), a = await t.getWorkspaceInsights(n.workspaceId, { projectIds: r }), i = a.projectInsights.map((d) => ({
4673
4685
  projectId: d.projectId,
4674
4686
  health: d.health ? {
4675
4687
  status: d.health.status,
@@ -4702,21 +4714,21 @@ const Ea = {
4702
4714
  }
4703
4715
  };
4704
4716
  }
4705
- }, It = 50, Ra = {
4717
+ }, St = 50, Ma = {
4706
4718
  goalId: s.string().min(1).describe("The ID of the goal."),
4707
- taskIds: s.array(s.string().min(1)).min(1).max(It).describe(`The IDs of the tasks to link or unlink (max ${It}).`),
4719
+ taskIds: s.array(s.string().min(1)).min(1).max(St).describe(`The IDs of the tasks to link or unlink (max ${St}).`),
4708
4720
  action: s.enum(["link", "unlink"]).describe("Whether to link or unlink the tasks.")
4709
- }, La = {
4721
+ }, Fa = {
4710
4722
  processed: s.array(s.string()).describe("The IDs of successfully processed tasks."),
4711
4723
  failures: s.array(be).describe("Failed operations with error details."),
4712
4724
  totalRequested: s.number().describe("The total number of tasks requested."),
4713
4725
  successCount: s.number().describe("The number of successfully processed tasks."),
4714
4726
  failureCount: s.number().describe("The number of failed operations.")
4715
- }, Na = {
4727
+ }, Ha = {
4716
4728
  name: f.LINK_GOAL_TASKS,
4717
4729
  description: "Link or unlink tasks to/from a goal.",
4718
- parameters: Ra,
4719
- outputSchema: La,
4730
+ parameters: Ma,
4731
+ outputSchema: Fa,
4720
4732
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
4721
4733
  async execute(e, t) {
4722
4734
  const o = await Promise.allSettled(
@@ -4749,21 +4761,21 @@ const Ea = {
4749
4761
  }
4750
4762
  };
4751
4763
  }
4752
- }, Ma = {}, Fa = {
4764
+ }, Wa = {}, Ga = {
4753
4765
  id: s.string().describe("The unique identifier for the workspace."),
4754
4766
  name: s.string().describe("The name of the workspace."),
4755
- plan: s.enum(Ts).describe("The workspace plan type."),
4756
- role: s.enum(ks).optional().describe("The user's role in the workspace, if available."),
4767
+ plan: s.enum(Is).describe("The workspace plan type."),
4768
+ role: s.enum(ws).optional().describe("The user's role in the workspace, if available."),
4757
4769
  isLinkSharingEnabled: s.boolean().describe("Whether link sharing is enabled for the workspace."),
4758
4770
  isGuestAllowed: s.boolean().describe("Whether guests are allowed in the workspace."),
4759
4771
  createdAt: s.string().optional().describe("The ISO 8601 timestamp when the workspace was created."),
4760
4772
  creatorId: s.string().describe("The ID of the user who created the workspace.")
4761
- }, Ha = {
4773
+ }, Ba = {
4762
4774
  type: s.literal("workspaces").describe("The type of the response."),
4763
- workspaces: s.array(s.object(Fa)).describe("List of workspaces."),
4775
+ workspaces: s.array(s.object(Ga)).describe("List of workspaces."),
4764
4776
  count: s.number().describe("The total number of workspaces.")
4765
4777
  };
4766
- async function Wa(e) {
4778
+ async function Ya(e) {
4767
4779
  const o = (await e.getWorkspaces()).map((i) => ({
4768
4780
  id: i.id,
4769
4781
  name: i.name,
@@ -4794,22 +4806,22 @@ async function Wa(e) {
4794
4806
  };
4795
4807
  return { textContent: n, structuredContent: a };
4796
4808
  }
4797
- const Ga = {
4809
+ const qa = {
4798
4810
  name: f.LIST_WORKSPACES,
4799
4811
  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.",
4800
- parameters: Ma,
4801
- outputSchema: Ha,
4812
+ parameters: Wa,
4813
+ outputSchema: Ba,
4802
4814
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
4803
4815
  async execute(e, t) {
4804
- const o = await Wa(t);
4816
+ const o = await Ya(t);
4805
4817
  return {
4806
4818
  textContent: o.textContent,
4807
4819
  structuredContent: o.structuredContent
4808
4820
  };
4809
4821
  }
4810
- }, { FIND_TASKS: Ba, FIND_PROJECT_COLLABORATORS: vt, UPDATE_TASKS: Ya } = f, qa = 50, za = {
4822
+ }, { FIND_TASKS: za, FIND_PROJECT_COLLABORATORS: jt, UPDATE_TASKS: Ka } = f, Va = 50, Ja = {
4811
4823
  operation: s.enum(["assign", "unassign", "reassign"]).describe("The assignment operation to perform."),
4812
- taskIds: s.array(s.string()).min(1).max(qa).describe("The IDs of the tasks to operate on (max 50)."),
4824
+ taskIds: s.array(s.string()).min(1).max(Va).describe("The IDs of the tasks to operate on (max 50)."),
4813
4825
  responsibleUser: s.string().optional().describe(
4814
4826
  '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.'
4815
4827
  ),
@@ -4817,7 +4829,7 @@ const Ga = {
4817
4829
  "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."
4818
4830
  ),
4819
4831
  dryRun: s.boolean().optional().default(!1).describe("If true, validates operations without executing them.")
4820
- }, Ka = {
4832
+ }, Xa = {
4821
4833
  results: s.array(
4822
4834
  s.object({
4823
4835
  taskId: s.string().describe("The ID of the task."),
@@ -4833,11 +4845,11 @@ const Ga = {
4833
4845
  failed: s.number().describe("Number of failed operations."),
4834
4846
  dryRun: s.boolean().describe("Whether this was a dry run.")
4835
4847
  }).optional().describe("Summary of the operation.")
4836
- }, Va = {
4848
+ }, Za = {
4837
4849
  name: f.MANAGE_ASSIGNMENTS,
4838
4850
  description: "Bulk assignment operations for multiple tasks. Supports assign, unassign, and reassign operations with atomic rollback on failures.",
4839
- parameters: za,
4840
- outputSchema: Ka,
4851
+ parameters: Ja,
4852
+ outputSchema: Xa,
4841
4853
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
4842
4854
  async execute(e, t) {
4843
4855
  const { operation: o, taskIds: r, responsibleUser: n, fromAssigneeUser: a, dryRun: i } = e;
@@ -4939,7 +4951,7 @@ const Ga = {
4939
4951
  }
4940
4952
  };
4941
4953
  }
4942
- const m = await st.validateBulkAssignment(
4954
+ const m = await rt.validateBulkAssignment(
4943
4955
  t,
4944
4956
  p
4945
4957
  ), h = [], k = [];
@@ -5060,30 +5072,30 @@ function Pe({
5060
5072
  `;
5061
5073
  }
5062
5074
  return !o && r.length > 0 ? (c += `**Next steps:**
5063
- `, c += `• Use ${Ba} with responsibleUser to see ${e === "unassign" ? "unassigned" : "newly assigned"} tasks
5064
- `, c += `• Use ${Ya} for individual assignment changes
5065
- `, n.length > 0 && (c += `• Check failed tasks and use ${vt} to verify collaborator access
5075
+ `, c += `• Use ${za} with responsibleUser to see ${e === "unassign" ? "unassigned" : "newly assigned"} tasks
5076
+ `, c += `• Use ${Ka} for individual assignment changes
5077
+ `, n.length > 0 && (c += `• Check failed tasks and use ${jt} to verify collaborator access
5066
5078
  `)) : o ? (c += `**To execute:**
5067
5079
  `, c += `• Remove dryRun parameter and run again to execute changes
5068
5080
  `, r.length > 0 && (c += `• ${r.length} task${r.length === 1 ? "" : "s"} ready for ${e} operation
5069
5081
  `), n.length > 0 && (c += `• Fix ${n.length} validation error${n.length === 1 ? "" : "s"} before executing
5070
5082
  `)) : r.length === 0 && (c += `**Suggestions:**
5071
- `, c += `• Use ${vt} to find valid assignees
5083
+ `, c += `• Use ${jt} to find valid assignees
5072
5084
  `, c += `• Check task IDs and assignee permissions
5073
5085
  `, c += `• Use dryRun=true to validate before executing
5074
5086
  `), c;
5075
5087
  }
5076
- const Ja = {
5088
+ const Qa = {
5077
5089
  action: s.enum(["archive", "unarchive"]).describe("The action to perform on the project."),
5078
5090
  projectId: s.string().min(1).describe("The ID of the project.")
5079
- }, Xa = {
5091
+ }, ei = {
5080
5092
  project: le.describe("The updated project."),
5081
5093
  success: s.boolean().describe("Whether the action was successful.")
5082
- }, Za = {
5094
+ }, ti = {
5083
5095
  name: f.PROJECT_MANAGEMENT,
5084
5096
  description: "Archive or unarchive a project by its ID.",
5085
- parameters: Ja,
5086
- outputSchema: Xa,
5097
+ parameters: Qa,
5098
+ outputSchema: ei,
5087
5099
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
5088
5100
  async execute(e, t) {
5089
5101
  const o = e.action === "archive" ? await t.archiveProject(e.projectId) : await t.unarchiveProject(e.projectId), r = V(o);
@@ -5095,7 +5107,7 @@ const Ja = {
5095
5107
  }
5096
5108
  };
5097
5109
  }
5098
- }, Qa = {
5110
+ }, si = {
5099
5111
  action: s.enum(["move-to-workspace", "move-to-personal"]).describe("The action to perform on the project."),
5100
5112
  projectId: s.string().min(1).describe("The ID of the project to move."),
5101
5113
  workspaceId: s.string().min(1).optional().describe("The target workspace ID. Required when action is move-to-workspace."),
@@ -5103,14 +5115,14 @@ const Ja = {
5103
5115
  visibility: s.enum(["restricted", "team", "public"]).optional().describe(
5104
5116
  "Optional access visibility for the project in the workspace (restricted, team, or public)."
5105
5117
  )
5106
- }, ei = {
5118
+ }, oi = {
5107
5119
  project: le.describe("The moved project."),
5108
5120
  success: s.boolean().describe("Whether the move was successful.")
5109
- }, ti = {
5121
+ }, ri = {
5110
5122
  name: f.PROJECT_MOVE,
5111
5123
  description: "Move a project between personal and workspace contexts.",
5112
- parameters: Qa,
5113
- outputSchema: ei,
5124
+ parameters: si,
5125
+ outputSchema: oi,
5114
5126
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
5115
5127
  async execute(e, t) {
5116
5128
  let o;
@@ -5133,8 +5145,8 @@ const Ja = {
5133
5145
  }
5134
5146
  };
5135
5147
  }
5136
- }, os = ["project", "section"], si = {
5137
- type: s.enum(os).describe(
5148
+ }, ns = ["project", "section"], ni = {
5149
+ type: s.enum(ns).describe(
5138
5150
  '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.'
5139
5151
  ),
5140
5152
  items: s.array(
@@ -5150,17 +5162,17 @@ const Ja = {
5150
5162
  ).min(1).describe(
5151
5163
  "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."
5152
5164
  )
5153
- }, oi = {
5154
- type: s.enum(os).describe("The type of entity that was reordered/moved."),
5165
+ }, ai = {
5166
+ type: s.enum(ns).describe("The type of entity that was reordered/moved."),
5155
5167
  movedCount: s.number().describe("The number of entities moved to a new parent."),
5156
5168
  reorderedCount: s.number().describe("The number of entities reordered."),
5157
5169
  affectedIds: s.array(s.string()).describe("The IDs of all affected entities."),
5158
5170
  success: s.boolean().describe("Whether the operation was successful.")
5159
- }, ri = {
5171
+ }, ii = {
5160
5172
  name: f.REORDER_OBJECTS,
5161
5173
  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.',
5162
- parameters: si,
5163
- outputSchema: oi,
5174
+ parameters: ni,
5175
+ outputSchema: ai,
5164
5176
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
5165
5177
  async execute(e, t) {
5166
5178
  const { type: o, items: r } = e, n = /* @__PURE__ */ new Set();
@@ -5222,22 +5234,22 @@ const Ja = {
5222
5234
  }
5223
5235
  };
5224
5236
  }
5225
- }, ni = s.object({
5237
+ }, ci = s.object({
5226
5238
  id: s.string().min(1).describe("The ID of the task to reschedule."),
5227
5239
  date: s.string().min(1).describe(
5228
5240
  "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."
5229
5241
  )
5230
- }), ai = {
5231
- tasks: s.array(ni).min(1).describe("The tasks to reschedule with their new dates.")
5232
- }, ii = {
5242
+ }), di = {
5243
+ tasks: s.array(ci).min(1).describe("The tasks to reschedule with their new dates.")
5244
+ }, li = {
5233
5245
  tasks: s.array(J).describe("The rescheduled tasks."),
5234
5246
  totalCount: s.number().describe("The total number of tasks rescheduled."),
5235
5247
  rescheduledTaskIds: s.array(s.string()).describe("The IDs of the rescheduled tasks.")
5236
- }, ci = {
5248
+ }, ui = {
5237
5249
  name: f.RESCHEDULE_TASKS,
5238
5250
  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.",
5239
- parameters: ai,
5240
- outputSchema: ii,
5251
+ parameters: di,
5252
+ outputSchema: li,
5241
5253
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
5242
5254
  async execute(e, t) {
5243
5255
  const { tasks: o } = e, n = (await Promise.all(
@@ -5250,7 +5262,7 @@ const Ja = {
5250
5262
  throw new Error(
5251
5263
  `Task "${l.content}" (${l.id}) has no due date. Rescheduling requires an existing due date.`
5252
5264
  );
5253
- const u = di(d.date, l.due);
5265
+ const u = pi(d.date, l.due);
5254
5266
  return Y("item_update", {
5255
5267
  id: d.id,
5256
5268
  due: {
@@ -5270,7 +5282,7 @@ const Ja = {
5270
5282
  }
5271
5283
  const a = await Promise.all(o.map((d) => t.getTask(d.id))), i = a.map(P);
5272
5284
  return {
5273
- textContent: ot("Rescheduled", i, {
5285
+ textContent: nt("Rescheduled", i, {
5274
5286
  showDetails: i.length <= 5
5275
5287
  }),
5276
5288
  structuredContent: {
@@ -5281,16 +5293,16 @@ const Ja = {
5281
5293
  };
5282
5294
  }
5283
5295
  };
5284
- function di(e, t) {
5296
+ function pi(e, t) {
5285
5297
  if (/^\d{4}-\d{2}-\d{2}$/.test(e) && t.datetime) {
5286
5298
  const r = t.datetime.substring(10);
5287
5299
  return e + r;
5288
5300
  }
5289
5301
  return e;
5290
5302
  }
5291
- const li = {
5303
+ const mi = {
5292
5304
  query: s.string().min(1).describe("The search query string to find tasks and projects.")
5293
- }, ui = {
5305
+ }, hi = {
5294
5306
  results: s.array(
5295
5307
  s.object({
5296
5308
  id: s.string().describe("The ID of the result."),
@@ -5299,52 +5311,52 @@ const li = {
5299
5311
  })
5300
5312
  ).describe("The search results."),
5301
5313
  totalCount: s.number().describe("Total number of results found.")
5302
- }, pi = {
5314
+ }, fi = {
5303
5315
  name: f.SEARCH,
5304
5316
  description: "Search across tasks and projects in Todoist. Returns a list of relevant results with IDs, titles, and URLs.",
5305
- parameters: li,
5306
- outputSchema: ui,
5317
+ parameters: mi,
5318
+ outputSchema: hi,
5307
5319
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
5308
5320
  async execute(e, t) {
5309
5321
  const { query: o } = e, [r, n] = await Promise.all([
5310
- Qe({
5322
+ tt({
5311
5323
  client: t,
5312
5324
  query: `search: ${o}`,
5313
5325
  limit: $.TASKS_MAX,
5314
5326
  cursor: void 0
5315
5327
  }),
5316
- Mt(t, o)
5328
+ Ht(t, o)
5317
5329
  ]), a = [];
5318
5330
  for (const i of r.tasks)
5319
5331
  a.push({
5320
5332
  id: `task:${i.id}`,
5321
5333
  title: i.content,
5322
- url: xt(i.id)
5334
+ url: Ot(i.id)
5323
5335
  });
5324
5336
  for (const i of n)
5325
5337
  a.push({
5326
5338
  id: `project:${i.id}`,
5327
5339
  title: i.name,
5328
- url: At(i.id)
5340
+ url: Ut(i.id)
5329
5341
  });
5330
5342
  return {
5331
5343
  textContent: JSON.stringify({ results: a }),
5332
5344
  structuredContent: { results: a, totalCount: a.length }
5333
5345
  };
5334
5346
  }
5335
- }, mi = {
5347
+ }, bi = {
5336
5348
  ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to uncomplete.")
5337
- }, hi = {
5349
+ }, gi = {
5338
5350
  uncompleted: s.array(s.string()).describe("The IDs of successfully uncompleted tasks."),
5339
5351
  failures: s.array(be).describe("Failed task uncompletion with error details."),
5340
5352
  totalRequested: s.number().describe("The total number of tasks requested to uncomplete."),
5341
5353
  successCount: s.number().describe("The number of successfully uncompleted tasks."),
5342
5354
  failureCount: s.number().describe("The number of failed task uncompletions.")
5343
- }, fi = {
5355
+ }, yi = {
5344
5356
  name: f.UNCOMPLETE_TASKS,
5345
5357
  description: "Uncomplete (reopen) one or more completed tasks by their IDs.",
5346
- parameters: mi,
5347
- outputSchema: hi,
5358
+ parameters: bi,
5359
+ outputSchema: gi,
5348
5360
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
5349
5361
  async execute(e, t) {
5350
5362
  const o = [], r = [];
@@ -5359,7 +5371,7 @@ const li = {
5359
5371
  });
5360
5372
  }
5361
5373
  return {
5362
- textContent: bi({
5374
+ textContent: ki({
5363
5375
  uncompleted: o,
5364
5376
  failures: r,
5365
5377
  args: e
@@ -5374,7 +5386,7 @@ const li = {
5374
5386
  };
5375
5387
  }
5376
5388
  };
5377
- function bi({
5389
+ function ki({
5378
5390
  uncompleted: e,
5379
5391
  failures: t,
5380
5392
  args: o
@@ -5388,28 +5400,28 @@ function bi({
5388
5400
  failures: t
5389
5401
  });
5390
5402
  }
5391
- const gi = s.object({
5403
+ const Ti = s.object({
5392
5404
  id: s.string().min(1).describe("The ID of the comment to update."),
5393
5405
  content: s.string().min(1).describe("The new content for the comment.")
5394
- }), yi = {
5395
- comments: s.array(gi).min(1).describe("The comments to update.")
5396
- }, ki = {
5406
+ }), wi = {
5407
+ comments: s.array(Ti).min(1).describe("The comments to update.")
5408
+ }, Ii = {
5397
5409
  comments: s.array(Se).describe("The updated comments."),
5398
5410
  totalCount: s.number().describe("The total number of comments updated."),
5399
5411
  updatedCommentIds: s.array(s.string()).describe("The IDs of the updated comments."),
5400
5412
  appliedOperations: s.object({
5401
5413
  updateCount: s.number().describe("The number of comments updated.")
5402
5414
  }).describe("Summary of operations performed.")
5403
- }, Ti = {
5415
+ }, vi = {
5404
5416
  name: f.UPDATE_COMMENTS,
5405
5417
  description: "Update multiple existing comments with new content.",
5406
- parameters: yi,
5407
- outputSchema: ki,
5418
+ parameters: wi,
5419
+ outputSchema: Ii,
5408
5420
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
5409
5421
  async execute(e, t) {
5410
5422
  const { comments: o } = e, r = o.map(async (c) => await t.updateComment(c.id, { content: c.content })), a = (await Promise.all(r)).map(we);
5411
5423
  return {
5412
- textContent: wi({
5424
+ textContent: Si({
5413
5425
  comments: a
5414
5426
  }),
5415
5427
  structuredContent: {
@@ -5423,7 +5435,7 @@ const gi = s.object({
5423
5435
  };
5424
5436
  }
5425
5437
  };
5426
- function wi({ comments: e }) {
5438
+ function Si({ comments: e }) {
5427
5439
  const t = e.filter((a) => a.taskId).length, o = e.filter((a) => a.projectId).length, r = [];
5428
5440
  if (t > 0) {
5429
5441
  const a = t > 1 ? "comments" : "comment";
@@ -5435,7 +5447,7 @@ function wi({ comments: e }) {
5435
5447
  }
5436
5448
  return r.length > 0 ? `Updated ${r.join(" and ")}` : "No comments updated";
5437
5449
  }
5438
- const Ii = s.object({
5450
+ const ji = s.object({
5439
5451
  id: s.string().min(1).describe("The ID of the filter to update."),
5440
5452
  name: s.string().min(1).optional().describe("The new name of the filter."),
5441
5453
  query: s.string().min(1).optional().describe(
@@ -5443,25 +5455,25 @@ const Ii = s.object({
5443
5455
  ),
5444
5456
  color: ce,
5445
5457
  isFavorite: s.boolean().optional().describe("Whether to mark the filter as a favorite.")
5446
- }), vi = {
5447
- filters: s.array(Ii).min(1).describe("The filters to update.")
5448
- }, Si = {
5449
- filters: s.array(tt).describe("The updated filters."),
5458
+ }), Ci = {
5459
+ filters: s.array(ji).min(1).describe("The filters to update.")
5460
+ }, $i = {
5461
+ filters: s.array(ot).describe("The updated filters."),
5450
5462
  totalCount: s.number().describe("The total number of filters updated."),
5451
5463
  updatedFilterIds: s.array(s.string()).describe("The IDs of the updated filters."),
5452
5464
  appliedOperations: s.object({
5453
5465
  updateCount: s.number().describe("The number of filters actually updated."),
5454
5466
  skippedCount: s.number().describe("The number of filters skipped (no changes).")
5455
5467
  }).describe("Summary of operations performed.")
5456
- }, ji = {
5468
+ }, Di = {
5457
5469
  name: f.UPDATE_FILTERS,
5458
5470
  description: "Update one or more existing personal filters with new values.",
5459
- parameters: vi,
5460
- outputSchema: Si,
5471
+ parameters: Ci,
5472
+ outputSchema: $i,
5461
5473
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
5462
5474
  async execute(e, t) {
5463
5475
  const { filters: o } = e, r = [], a = o.map((m) => {
5464
- const h = $i(m);
5476
+ const h = Ai(m);
5465
5477
  return h !== null ? { kind: "skipped", reason: h } : (r.push(m), { kind: "updated", filter: m });
5466
5478
  }).filter((m) => m.kind === "skipped").length;
5467
5479
  if (r.length === 0)
@@ -5492,7 +5504,7 @@ const Ii = s.object({
5492
5504
  itemOrder: m.itemOrder
5493
5505
  }));
5494
5506
  return {
5495
- textContent: Ci({ filters: u, skippedCount: a }),
5507
+ textContent: xi({ filters: u, skippedCount: a }),
5496
5508
  structuredContent: {
5497
5509
  filters: u,
5498
5510
  totalCount: u.length,
@@ -5505,7 +5517,7 @@ const Ii = s.object({
5505
5517
  };
5506
5518
  }
5507
5519
  };
5508
- function Ci({
5520
+ function xi({
5509
5521
  filters: e,
5510
5522
  skippedCount: t
5511
5523
  }) {
@@ -5519,10 +5531,10 @@ ${n}`;
5519
5531
  }
5520
5532
  return r;
5521
5533
  }
5522
- function $i({ id: e, ...t }) {
5534
+ function Ai({ id: e, ...t }) {
5523
5535
  return Object.values(t).every((r) => r === void 0) ? "no-fields" : null;
5524
5536
  }
5525
- const re = "remove", qe = "unassign", St = 25, Di = s.object({
5537
+ const re = "remove", Ke = "unassign", Ct = 25, Ei = s.object({
5526
5538
  id: s.string().min(1).describe("The ID of the goal to update."),
5527
5539
  name: s.string().min(1).optional().describe("New goal name."),
5528
5540
  description: s.preprocess(
@@ -5534,50 +5546,50 @@ const re = "remove", qe = "unassign", St = 25, Di = s.object({
5534
5546
  s.string().describe(`New deadline (YYYY-MM-DD). Use "${re}" to clear.`)
5535
5547
  ).optional(),
5536
5548
  responsibleUid: s.preprocess(
5537
- (e) => e === null ? qe : e,
5538
- s.string().describe(`New responsible user ID. Use "${qe}" to clear.`)
5549
+ (e) => e === null ? Ke : e,
5550
+ s.string().describe(`New responsible user ID. Use "${Ke}" to clear.`)
5539
5551
  ).optional()
5540
- }), xi = ["no-fields", "no-valid-values"], Ai = {
5541
- goals: s.array(Di).min(1).max(St).describe(`The array of goals to update (max ${St}).`)
5542
- }, Ei = s.object({
5552
+ }), Oi = ["no-fields", "no-valid-values"], Ui = {
5553
+ goals: s.array(Ei).min(1).max(Ct).describe(`The array of goals to update (max ${Ct}).`)
5554
+ }, _i = s.object({
5543
5555
  id: s.string().describe("The ID of the goal that was skipped."),
5544
- reason: s.enum(xi).describe(
5556
+ reason: s.enum(Oi).describe(
5545
5557
  '"no-fields" = only the id was supplied; "no-valid-values" = all updatable fields were undefined.'
5546
5558
  )
5547
- }), Oi = {
5559
+ }), Pi = {
5548
5560
  goals: s.array(je).describe("The updated goals."),
5549
5561
  totalCount: s.number().describe("The total number of goals updated."),
5550
5562
  updatedGoalIds: s.array(s.string()).describe("The IDs of the updated goals."),
5551
5563
  appliedOperations: s.object({
5552
5564
  updateCount: s.number().describe("The number of goals actually updated."),
5553
5565
  skippedCount: s.number().describe("The number of goals skipped (no changes)."),
5554
- skipped: s.array(Ei).describe("Per-goal skip details (id + reason).")
5566
+ skipped: s.array(_i).describe("Per-goal skip details (id + reason).")
5555
5567
  }).describe("Summary of operations performed.")
5556
5568
  };
5557
5569
  function Re(e, t) {
5558
5570
  return e === t ? null : e;
5559
5571
  }
5560
- function Ui({ id: e, ...t }) {
5572
+ function Ri({ id: e, ...t }) {
5561
5573
  const o = Object.values(t);
5562
5574
  return o.length === 0 ? "no-fields" : o.every((r) => r === void 0) ? "no-valid-values" : null;
5563
5575
  }
5564
- const _i = {
5576
+ const Li = {
5565
5577
  name: f.UPDATE_GOALS,
5566
5578
  description: "Update one or more goals by their IDs.",
5567
- parameters: Ai,
5568
- outputSchema: Oi,
5579
+ parameters: Ui,
5580
+ outputSchema: Pi,
5569
5581
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
5570
5582
  async execute({ goals: e }, t) {
5571
5583
  const o = await Promise.all(
5572
5584
  e.map(async (l) => {
5573
- const u = Ui(l);
5585
+ const u = Ri(l);
5574
5586
  if (u !== null)
5575
5587
  return { kind: "skipped", id: l.id, reason: u };
5576
5588
  const { id: p, description: m, deadline: h, responsibleUid: k, ...b } = l, j = await t.updateGoal(p, {
5577
5589
  ...b,
5578
5590
  description: Re(m, re),
5579
5591
  deadline: Re(h, re),
5580
- responsibleUid: Re(k, qe)
5592
+ responsibleUid: Re(k, Ke)
5581
5593
  });
5582
5594
  return { kind: "updated", goal: Ie(j) };
5583
5595
  })
@@ -5586,7 +5598,7 @@ const _i = {
5586
5598
  ).map((l) => l.goal), n = o.filter(
5587
5599
  (l) => l.kind === "skipped"
5588
5600
  ).map(({ id: l, reason: u }) => ({ id: l, reason: u })), a = r.length, i = r.map((l) => `• ${l.name} (id=${l.id})`).join(`
5589
- `), c = Pi(n);
5601
+ `), c = Ni(n);
5590
5602
  return {
5591
5603
  textContent: a > 0 ? `Updated ${a} goal${a === 1 ? "" : "s"}${c}:
5592
5604
  ${i}` : `Updated 0 goals${c}`,
@@ -5603,7 +5615,7 @@ ${i}` : `Updated 0 goals${c}`,
5603
5615
  };
5604
5616
  }
5605
5617
  };
5606
- function Pi(e) {
5618
+ function Ni(e) {
5607
5619
  if (e.length === 0) return "";
5608
5620
  const t = /* @__PURE__ */ new Map();
5609
5621
  for (const { id: r, reason: n } of e) {
@@ -5614,49 +5626,49 @@ function Pi(e) {
5614
5626
  ([r, n]) => `${n.length} skipped — ${r} (${n.join(", ")})`
5615
5627
  ).join("; ")})`;
5616
5628
  }
5617
- const Ri = s.object({
5629
+ const Mi = s.object({
5618
5630
  labelType: s.literal("personal").describe("Update a personal label, identified by its ID."),
5619
5631
  id: s.string().min(1).describe("The ID of the personal label to update."),
5620
5632
  name: s.string().min(1).max(128).optional().describe("The new name of the label."),
5621
5633
  color: ce,
5622
5634
  order: s.number().int().optional().describe("The new position of the label in the label list."),
5623
5635
  isFavorite: s.boolean().optional().describe("Whether to mark the label as a favorite.")
5624
- }), Li = s.object({
5636
+ }), Fi = s.object({
5625
5637
  labelType: s.literal("shared").describe(
5626
5638
  "Rename a shared label across all tasks. Shared labels are identified by name; only renaming is supported (no color, order, or favorite)."
5627
5639
  ),
5628
5640
  name: s.string().min(1).describe("The current name of the shared label."),
5629
5641
  newName: s.string().min(1).describe("The new name for the shared label.")
5630
- }), Ni = s.discriminatedUnion("labelType", [
5631
- Ri,
5632
- Li
5633
- ]), Mi = {
5634
- labels: s.array(Ni).min(1).describe(
5642
+ }), Hi = s.discriminatedUnion("labelType", [
5643
+ Mi,
5644
+ Fi
5645
+ ]), Wi = {
5646
+ labels: s.array(Hi).min(1).describe(
5635
5647
  '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.'
5636
5648
  )
5637
- }, Fi = s.object({
5649
+ }, Gi = s.object({
5638
5650
  name: s.string().describe("The previous name of the shared label."),
5639
5651
  newName: s.string().describe("The new name of the shared label.")
5640
- }), Hi = {
5652
+ }), Bi = {
5641
5653
  updatedLabels: s.array(ue).describe("The updated personal labels."),
5642
- renamedSharedLabels: s.array(Fi).describe("The shared labels that were renamed."),
5654
+ renamedSharedLabels: s.array(Gi).describe("The shared labels that were renamed."),
5643
5655
  totalCount: s.number().describe("The total number of successful operations (personal + shared)."),
5644
5656
  appliedOperations: s.object({
5645
5657
  updateCount: s.number().describe("Number of personal labels updated."),
5646
5658
  renameCount: s.number().describe("Number of shared labels renamed."),
5647
5659
  skippedCount: s.number().describe("Number of operations skipped (no changes or shared label not found).")
5648
5660
  }).describe("Summary of operations performed.")
5649
- }, Wi = {
5661
+ }, Yi = {
5650
5662
  name: f.UPDATE_LABELS,
5651
5663
  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.",
5652
- parameters: Mi,
5653
- outputSchema: Hi,
5664
+ parameters: Wi,
5665
+ outputSchema: Bi,
5654
5666
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
5655
5667
  async execute(e, t) {
5656
5668
  const { labels: o } = e, r = await Promise.all(
5657
5669
  o.map(async (u) => {
5658
5670
  if (u.labelType === "personal") {
5659
- const m = Bi(u);
5671
+ const m = zi(u);
5660
5672
  if (m !== null) return { kind: "skipped", reason: m };
5661
5673
  const { id: h, labelType: k, ...b } = u;
5662
5674
  return { kind: "updated", label: await t.updateLabel(h, b) };
@@ -5674,7 +5686,7 @@ const Ri = s.object({
5674
5686
  (u) => u.kind === "skipped" && u.reason === "not-found"
5675
5687
  ).length;
5676
5688
  return {
5677
- textContent: Gi({
5689
+ textContent: qi({
5678
5690
  updatedLabels: n,
5679
5691
  renamedSharedLabels: a,
5680
5692
  skippedNoFields: c,
@@ -5693,7 +5705,7 @@ const Ri = s.object({
5693
5705
  };
5694
5706
  }
5695
5707
  };
5696
- function Gi({
5708
+ function qi({
5697
5709
  updatedLabels: e,
5698
5710
  renamedSharedLabels: t,
5699
5711
  skippedNoFields: o,
@@ -5715,22 +5727,22 @@ function Gi({
5715
5727
  return c.join(`
5716
5728
  `);
5717
5729
  }
5718
- function Bi({
5730
+ function zi({
5719
5731
  id: e,
5720
5732
  labelType: t,
5721
5733
  ...o
5722
5734
  }) {
5723
5735
  return Object.values(o).every((n) => n === void 0) ? "no-fields" : null;
5724
5736
  }
5725
- const Yi = s.object({
5737
+ const Ki = s.object({
5726
5738
  id: s.string().min(1).describe("The ID of the project to update."),
5727
5739
  name: s.string().min(1).optional().describe("The new name of the project."),
5728
5740
  isFavorite: s.boolean().optional().describe("Whether the project is a favorite."),
5729
5741
  viewStyle: s.enum(["list", "board", "calendar"]).optional().describe("The project view style."),
5730
5742
  color: ce
5731
- }), qi = {
5732
- projects: s.array(Yi).min(1).describe("The projects to update.")
5733
- }, zi = {
5743
+ }), Vi = {
5744
+ projects: s.array(Ki).min(1).describe("The projects to update.")
5745
+ }, Ji = {
5734
5746
  projects: s.array(le).describe("The updated projects."),
5735
5747
  totalCount: s.number().describe("The total number of projects updated."),
5736
5748
  updatedProjectIds: s.array(s.string()).describe("The IDs of the updated projects."),
@@ -5738,16 +5750,16 @@ const Yi = s.object({
5738
5750
  updateCount: s.number().describe("The number of projects actually updated."),
5739
5751
  skippedCount: s.number().describe("The number of projects skipped (no changes).")
5740
5752
  }).describe("Summary of operations performed.")
5741
- }, Ki = {
5753
+ }, Xi = {
5742
5754
  name: f.UPDATE_PROJECTS,
5743
5755
  description: "Update multiple existing projects with new values.",
5744
- parameters: qi,
5745
- outputSchema: zi,
5756
+ parameters: Vi,
5757
+ outputSchema: Ji,
5746
5758
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
5747
5759
  async execute(e, t) {
5748
5760
  const { projects: o } = e, r = await Promise.all(
5749
5761
  o.map(async (d) => {
5750
- const l = Ji(d);
5762
+ const l = Qi(d);
5751
5763
  if (l !== null) return { kind: "skipped", reason: l };
5752
5764
  const { id: u, ...p } = d;
5753
5765
  return { kind: "updated", project: await t.updateProject(u, p) };
@@ -5760,7 +5772,7 @@ const Yi = s.object({
5760
5772
  (d) => d.kind === "skipped" && d.reason === "no-valid-values"
5761
5773
  ).length;
5762
5774
  return {
5763
- textContent: Vi({
5775
+ textContent: Zi({
5764
5776
  projects: n,
5765
5777
  skippedNoFields: a,
5766
5778
  skippedNoValidValues: i
@@ -5777,7 +5789,7 @@ const Yi = s.object({
5777
5789
  };
5778
5790
  }
5779
5791
  };
5780
- function Vi({
5792
+ function Zi({
5781
5793
  projects: e,
5782
5794
  skippedNoFields: t,
5783
5795
  skippedNoValidValues: o
@@ -5789,49 +5801,49 @@ function Vi({
5789
5801
  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 += `:
5790
5802
  ${n}`), a;
5791
5803
  }
5792
- function Ji({ id: e, ...t }) {
5804
+ function Qi({ id: e, ...t }) {
5793
5805
  const o = Object.values(t);
5794
5806
  return o.length === 0 ? "no-fields" : o.every((r) => r === void 0) ? "no-valid-values" : null;
5795
5807
  }
5796
- const Xi = s.object({
5808
+ const ec = s.object({
5797
5809
  type: s.literal("relative"),
5798
5810
  id: s.string().min(1).describe("The ID of the relative reminder to update."),
5799
5811
  minuteOffset: s.number().int().min(0).optional().describe("New minute offset before task due time."),
5800
5812
  service: Ce.optional().describe('New delivery method: "email" or "push".'),
5801
5813
  isUrgent: $e
5802
- }), Zi = s.object({
5814
+ }), tc = s.object({
5803
5815
  type: s.literal("absolute"),
5804
5816
  id: s.string().min(1).describe("The ID of the absolute reminder to update."),
5805
- due: Wt.optional().describe("New due date/time for the reminder."),
5817
+ due: Bt.optional().describe("New due date/time for the reminder."),
5806
5818
  service: Ce.optional().describe('New delivery method: "email" or "push".'),
5807
5819
  isUrgent: $e
5808
- }), Qi = s.object({
5820
+ }), sc = s.object({
5809
5821
  type: s.literal("location"),
5810
5822
  id: s.string().min(1).describe("The ID of the location reminder to update."),
5811
5823
  name: s.string().optional().describe("New location name."),
5812
5824
  locLat: s.string().optional().describe("New latitude."),
5813
5825
  locLong: s.string().optional().describe("New longitude."),
5814
- locTrigger: Gt.optional().describe(
5826
+ locTrigger: Yt.optional().describe(
5815
5827
  'New trigger condition: "on_enter" or "on_leave".'
5816
5828
  ),
5817
5829
  radius: s.number().int().optional().describe("New radius in meters.")
5818
- }), ec = s.discriminatedUnion("type", [
5819
- Xi,
5820
- Zi,
5821
- Qi
5822
- ]), tc = {
5823
- reminders: s.array(ec).min(1).max(Te).describe(
5830
+ }), oc = s.discriminatedUnion("type", [
5831
+ ec,
5832
+ tc,
5833
+ sc
5834
+ ]), rc = {
5835
+ reminders: s.array(oc).min(1).max(Te).describe(
5824
5836
  `Array of reminders to update (max ${Te}). Each must include the reminder type and ID. Only include fields that need to change.`
5825
5837
  )
5826
- }, sc = {
5827
- reminders: s.array(et).describe("The updated reminders."),
5838
+ }, nc = {
5839
+ reminders: s.array(st).describe("The updated reminders."),
5828
5840
  totalCount: s.number().describe("Total reminders updated."),
5829
5841
  updatedReminderIds: s.array(s.string()).describe("IDs of updated reminders.")
5830
- }, oc = {
5842
+ }, ac = {
5831
5843
  name: f.UPDATE_REMINDERS,
5832
5844
  description: 'Update existing reminders. Each reminder must specify its type ("relative", "absolute", or "location") and ID. Only include fields that need to change.',
5833
- parameters: tc,
5834
- outputSchema: sc,
5845
+ parameters: rc,
5846
+ outputSchema: nc,
5835
5847
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !0 },
5836
5848
  async execute(e, t) {
5837
5849
  const { reminders: o } = e, r = o.map(async (d) => {
@@ -5865,27 +5877,27 @@ const Xi = s.object({
5865
5877
  }
5866
5878
  };
5867
5879
  }
5868
- }, rc = s.object({
5880
+ }, ic = s.object({
5869
5881
  id: s.string().min(1).describe("The ID of the section to update."),
5870
5882
  name: s.string().min(1).describe("The new name of the section.")
5871
- }), nc = {
5872
- sections: s.array(rc).min(1).describe("The sections to update.")
5873
- }, ac = {
5883
+ }), cc = {
5884
+ sections: s.array(ic).min(1).describe("The sections to update.")
5885
+ }, dc = {
5874
5886
  sections: s.array(ie).describe("The updated sections."),
5875
5887
  totalCount: s.number().describe("The total number of sections updated."),
5876
5888
  updatedSectionIds: s.array(s.string()).describe("The IDs of the updated sections.")
5877
- }, ic = {
5889
+ }, lc = {
5878
5890
  name: f.UPDATE_SECTIONS,
5879
5891
  description: "Update multiple existing sections with new values.",
5880
- parameters: nc,
5881
- outputSchema: ac,
5892
+ parameters: cc,
5893
+ outputSchema: dc,
5882
5894
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
5883
5895
  async execute({ sections: e }, t) {
5884
5896
  const o = await Promise.all(
5885
5897
  e.map((n) => t.updateSection(n.id, { name: n.name }))
5886
5898
  );
5887
5899
  return {
5888
- textContent: cc({
5900
+ textContent: uc({
5889
5901
  sections: o
5890
5902
  }),
5891
5903
  structuredContent: {
@@ -5896,13 +5908,13 @@ const Xi = s.object({
5896
5908
  };
5897
5909
  }
5898
5910
  };
5899
- function cc({ sections: e }) {
5911
+ function uc({ sections: e }) {
5900
5912
  const t = e.length, o = e.map((n) => `• ${n.name} (id=${n.id}, projectId=${n.projectId})`).join(`
5901
5913
  `);
5902
5914
  return `Updated ${t} section${t === 1 ? "" : "s"}:
5903
5915
  ${o}`;
5904
5916
  }
5905
- const dc = s.object({
5917
+ const pc = s.object({
5906
5918
  id: s.string().min(1).describe("The ID of the task to update."),
5907
5919
  content: s.string().optional().describe(
5908
5920
  '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.'
@@ -5916,7 +5928,7 @@ const dc = s.object({
5916
5928
  sectionId: s.string().optional().describe("The new section ID for the task."),
5917
5929
  parentId: s.string().optional().describe("The new parent task ID (for subtasks)."),
5918
5930
  order: s.number().optional().describe("The new order of the task within its parent/section."),
5919
- priority: Je.optional().describe(Ve),
5931
+ priority: Ze.optional().describe(Xe),
5920
5932
  dueString: s.preprocess(
5921
5933
  // Keep accepting legacy null while exposing a Gemini-compatible string schema.
5922
5934
  (e) => e === null ? "remove" : e,
@@ -5941,9 +5953,9 @@ const dc = s.object({
5941
5953
  isUncompletable: s.boolean().optional().describe(
5942
5954
  "Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
5943
5955
  )
5944
- }), lc = ["remove", "no date"], uc = ["remove", "no date", "no deadline"], pc = "no date", mc = {
5945
- tasks: s.array(dc).min(1).describe("The tasks to update.")
5946
- }, hc = {
5956
+ }), mc = ["remove", "no date"], hc = ["remove", "no date", "no deadline"], fc = "no date", bc = {
5957
+ tasks: s.array(pc).min(1).describe("The tasks to update.")
5958
+ }, gc = {
5947
5959
  tasks: s.array(J).describe("The updated tasks."),
5948
5960
  totalCount: s.number().describe("The total number of tasks updated."),
5949
5961
  updatedTaskIds: s.array(s.string()).describe("The IDs of the updated tasks."),
@@ -5951,15 +5963,15 @@ const dc = s.object({
5951
5963
  updateCount: s.number().describe("The number of tasks actually updated."),
5952
5964
  skippedCount: s.number().describe("The number of tasks skipped (no changes).")
5953
5965
  }).describe("Summary of operations performed.")
5954
- }, fc = {
5966
+ }, yc = {
5955
5967
  name: f.UPDATE_TASKS,
5956
5968
  description: "Update existing tasks including content, dates, priorities, and assignments.",
5957
- parameters: mc,
5958
- outputSchema: hc,
5969
+ parameters: bc,
5970
+ outputSchema: gc,
5959
5971
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
5960
5972
  async execute(e, t) {
5961
5973
  const { tasks: o } = e, r = o.map(async (c) => {
5962
- if (!gc(c))
5974
+ if (!Tc(c))
5963
5975
  return;
5964
5976
  const {
5965
5977
  id: d,
@@ -5981,21 +5993,21 @@ const dc = s.object({
5981
5993
  ...A,
5982
5994
  ...j !== void 0 && { labels: j }
5983
5995
  };
5984
- b && (y.priority = Rt(b));
5985
- const D = jt(
5996
+ b && (y.priority = Nt(b));
5997
+ const D = $t(
5986
5998
  m,
5987
- lc,
5988
- pc
5999
+ mc,
6000
+ fc
5989
6001
  );
5990
6002
  D !== void 0 && (y = { ...y, dueString: D });
5991
- const R = jt(
6003
+ const R = $t(
5992
6004
  v,
5993
- uc,
6005
+ hc,
5994
6006
  null
5995
6007
  );
5996
6008
  if (R !== void 0 && (y = { ...y, deadlineDate: R }), h)
5997
6009
  try {
5998
- const { minutes: S } = Pt(h);
6010
+ const { minutes: S } = Lt(h);
5999
6011
  y = {
6000
6012
  ...y,
6001
6013
  duration: S,
@@ -6008,7 +6020,7 @@ const dc = s.object({
6008
6020
  if (k === null || k === "unassign")
6009
6021
  y = { ...y, assigneeId: null };
6010
6022
  else {
6011
- const S = await st.validateTaskUpdateAssignment(
6023
+ const S = await rt.validateTaskUpdateAssignment(
6012
6024
  t,
6013
6025
  d,
6014
6026
  k
@@ -6023,13 +6035,13 @@ const dc = s.object({
6023
6035
  }
6024
6036
  if (!w && !u && !p)
6025
6037
  return await t.updateTask(d, y);
6026
- const I = Eo(d, w, u, p), C = await t.moveTask(d, I);
6038
+ const I = _o(d, w, u, p), C = await t.moveTask(d, I);
6027
6039
  return Object.keys(y).length > 0 ? await t.updateTask(d, y) : C;
6028
6040
  }), n = (await Promise.all(r)).filter(
6029
6041
  (c) => c !== void 0
6030
6042
  ), a = n.map(P);
6031
6043
  return {
6032
- textContent: bc({
6044
+ textContent: kc({
6033
6045
  tasks: a,
6034
6046
  args: e
6035
6047
  }),
@@ -6045,21 +6057,21 @@ const dc = s.object({
6045
6057
  };
6046
6058
  }
6047
6059
  };
6048
- function bc({
6060
+ function kc({
6049
6061
  tasks: e,
6050
6062
  args: t
6051
6063
  }) {
6052
6064
  const o = t.tasks.length, r = e.length, n = o - r;
6053
6065
  let a = "";
6054
- return n > 0 && (a = ` (${n} skipped - no changes)`), ot("Updated", e, {
6066
+ return n > 0 && (a = ` (${n} skipped - no changes)`), nt("Updated", e, {
6055
6067
  context: a,
6056
6068
  showDetails: e.length <= 5
6057
6069
  });
6058
6070
  }
6059
- function gc({ id: e, ...t }) {
6071
+ function Tc({ id: e, ...t }) {
6060
6072
  return Object.keys(t).length > 0;
6061
6073
  }
6062
- function jt(e, t, o) {
6074
+ function $t(e, t, o) {
6063
6075
  if (e === void 0)
6064
6076
  return e;
6065
6077
  if (e === null)
@@ -6067,7 +6079,7 @@ function jt(e, t, o) {
6067
6079
  const r = e.trim().toLowerCase();
6068
6080
  return t.includes(r) ? o : e;
6069
6081
  }
6070
- const yc = {}, kc = {
6082
+ const wc = {}, Ic = {
6071
6083
  type: s.literal("user_info").describe("The type of the response."),
6072
6084
  userId: s.string().describe("The user ID."),
6073
6085
  fullName: s.string().describe("The full name of the user."),
@@ -6084,36 +6096,36 @@ const yc = {}, kc = {
6084
6096
  email: s.string().describe("The email address of the user."),
6085
6097
  plan: s.enum(["Todoist Free", "Todoist Pro", "Todoist Business"]).describe("The user plan.")
6086
6098
  };
6087
- function Tc(e) {
6099
+ function vc(e) {
6088
6100
  return e.businessAccountId ? "Todoist Business" : e.isPremium ? "Todoist Pro" : "Todoist Free";
6089
6101
  }
6090
- function wc(e, t) {
6102
+ function Sc(e, t) {
6091
6103
  const r = ((e.getDay() || 7) - t + 7) % 7, n = new Date(e);
6092
6104
  return n.setDate(e.getDate() - r), n;
6093
6105
  }
6094
- function Ic(e) {
6106
+ function jc(e) {
6095
6107
  const t = new Date(e);
6096
6108
  return t.setDate(e.getDate() + 6), t;
6097
6109
  }
6098
- function vc(e) {
6110
+ function Cc(e) {
6099
6111
  const t = new Date(e.getFullYear(), 0, 1), o = (e.getTime() - t.getTime()) / 864e5;
6100
6112
  return Math.ceil((o + t.getDay() + 1) / 7);
6101
6113
  }
6102
- function Sc(e) {
6114
+ function $c(e) {
6103
6115
  return ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"][e === 7 ? 0 : e] ?? "Unknown";
6104
6116
  }
6105
- function jc(e) {
6117
+ function Dc(e) {
6106
6118
  try {
6107
6119
  return new Intl.DateTimeFormat("en-US", { timeZone: e }), !0;
6108
6120
  } catch {
6109
6121
  return !1;
6110
6122
  }
6111
6123
  }
6112
- function rs(e) {
6113
- return jc(e) ? e : "UTC";
6124
+ function as(e) {
6125
+ return Dc(e) ? e : "UTC";
6114
6126
  }
6115
- function Cc(e, t) {
6116
- const o = rs(t);
6127
+ function xc(e, t) {
6128
+ const o = as(t);
6117
6129
  return e.toLocaleString("en-US", {
6118
6130
  timeZone: o,
6119
6131
  year: "numeric",
@@ -6125,8 +6137,8 @@ function Cc(e, t) {
6125
6137
  hour12: !1
6126
6138
  });
6127
6139
  }
6128
- async function $c(e) {
6129
- const t = await e.getUser(), o = t.tzInfo?.timezone ?? "UTC", r = rs(o), n = /* @__PURE__ */ new Date(), a = Cc(n, r), i = t.startDay ?? 1, c = Sc(i), d = Tc(t), l = new Date(n.toLocaleString("en-US", { timeZone: r })), u = wc(l, i), p = Ic(u), m = vc(l), k = [
6140
+ async function Ac(e) {
6141
+ const t = await e.getUser(), o = t.tzInfo?.timezone ?? "UTC", r = as(o), n = /* @__PURE__ */ new Date(), a = xc(n, r), i = t.startDay ?? 1, c = $c(i), d = vc(t), l = new Date(n.toLocaleString("en-US", { timeZone: r })), u = Sc(l, i), p = jc(u), m = Cc(l), k = [
6130
6142
  "# User Information",
6131
6143
  "",
6132
6144
  `**User ID:** ${t.id}`,
@@ -6168,26 +6180,26 @@ async function $c(e) {
6168
6180
  };
6169
6181
  return { textContent: k, structuredContent: b };
6170
6182
  }
6171
- const Dc = {
6183
+ const Ec = {
6172
6184
  name: f.USER_INFO,
6173
6185
  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).",
6174
- parameters: yc,
6175
- outputSchema: kc,
6186
+ parameters: wc,
6187
+ outputSchema: Ic,
6176
6188
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
6177
6189
  async execute(e, t) {
6178
- const o = await $c(t);
6190
+ const o = await Ac(t);
6179
6191
  return {
6180
6192
  textContent: o.textContent,
6181
6193
  structuredContent: o.structuredContent
6182
6194
  };
6183
6195
  }
6184
- }, Ct = 10 * 1024 * 1024, xc = /* @__PURE__ */ new Set([
6196
+ }, Dt = 10 * 1024 * 1024, Oc = /* @__PURE__ */ new Set([
6185
6197
  "image/png",
6186
6198
  "image/jpeg",
6187
6199
  "image/gif",
6188
6200
  "image/webp",
6189
6201
  "image/svg+xml"
6190
- ]), Ac = /* @__PURE__ */ new Set([
6202
+ ]), Uc = /* @__PURE__ */ new Set([
6191
6203
  "text/plain",
6192
6204
  "text/csv",
6193
6205
  "text/html",
@@ -6195,7 +6207,7 @@ const Dc = {
6195
6207
  "application/json",
6196
6208
  "application/xml",
6197
6209
  "text/xml"
6198
- ]), Ec = {
6210
+ ]), _c = {
6199
6211
  ".png": "image/png",
6200
6212
  ".jpg": "image/jpeg",
6201
6213
  ".jpeg": "image/jpeg",
@@ -6210,23 +6222,23 @@ const Dc = {
6210
6222
  ".xml": "application/xml",
6211
6223
  ".pdf": "application/pdf"
6212
6224
  };
6213
- function Oc(e) {
6214
- return xc.has(e) ? "image" : Ac.has(e) || e.startsWith("text/") ? "text" : "binary";
6225
+ function Pc(e) {
6226
+ return Oc.has(e) ? "image" : Uc.has(e) || e.startsWith("text/") ? "text" : "binary";
6215
6227
  }
6216
- function Uc(e) {
6228
+ function Rc(e) {
6217
6229
  return (e.split(";")[0] ?? e).trim().toLowerCase();
6218
6230
  }
6219
- function _c(e) {
6231
+ function Lc(e) {
6220
6232
  try {
6221
6233
  const t = new URL(e).pathname, o = t.lastIndexOf(".");
6222
6234
  if (o === -1) return;
6223
6235
  const r = t.slice(o).toLowerCase();
6224
- return Ec[r];
6236
+ return _c[r];
6225
6237
  } catch {
6226
6238
  return;
6227
6239
  }
6228
6240
  }
6229
- function Pc(e) {
6241
+ function Nc(e) {
6230
6242
  try {
6231
6243
  const t = new URL(e).pathname, o = t.lastIndexOf("/");
6232
6244
  return o === -1 ? void 0 : t.slice(o + 1) || void 0;
@@ -6234,31 +6246,31 @@ function Pc(e) {
6234
6246
  return;
6235
6247
  }
6236
6248
  }
6237
- const Rc = {
6249
+ const Mc = {
6238
6250
  fileUrl: s.url().describe(
6239
6251
  "The URL of the attachment file to view. Get this from the fileUrl field in a comment's fileAttachment."
6240
6252
  )
6241
- }, Lc = {
6253
+ }, Fc = {
6242
6254
  name: f.VIEW_ATTACHMENT,
6243
6255
  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).",
6244
- parameters: Rc,
6256
+ parameters: Mc,
6245
6257
  annotations: {
6246
6258
  readOnlyHint: !0,
6247
6259
  destructiveHint: !1,
6248
6260
  idempotentHint: !0
6249
6261
  },
6250
6262
  async execute({ fileUrl: e }, t) {
6251
- const o = await t.viewAttachment(e), r = o.headers["content-length"], n = r ? Number.parseInt(r, 10) : void 0, a = Pc(e), i = o.headers["content-type"], c = i ? Uc(i) : void 0, d = c && c !== "application/octet-stream" ? c : _c(e) ?? c ?? "application/octet-stream";
6252
- if (n && n > Ct)
6263
+ const o = await t.viewAttachment(e), r = o.headers["content-length"], n = r ? Number.parseInt(r, 10) : void 0, a = Nc(e), i = o.headers["content-type"], c = i ? Rc(i) : void 0, d = c && c !== "application/octet-stream" ? c : Lc(e) ?? c ?? "application/octet-stream";
6264
+ if (n && n > Dt)
6253
6265
  return {
6254
6266
  textContent: `Attachment "${a ?? e}" is too large to display inline (${(n / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
6255
6267
  };
6256
6268
  const l = Buffer.from(await o.arrayBuffer()), u = l.byteLength;
6257
- if (u > Ct)
6269
+ if (u > Dt)
6258
6270
  return {
6259
6271
  textContent: `Attachment "${a ?? e}" is too large to display inline (${(u / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
6260
6272
  };
6261
- const p = Oc(d), m = [];
6273
+ const p = Pc(d), m = [];
6262
6274
  return p === "image" ? m.push({
6263
6275
  type: "image",
6264
6276
  data: l.toString("base64"),
@@ -6278,7 +6290,7 @@ const Rc = {
6278
6290
  contentItems: m
6279
6291
  };
6280
6292
  }
6281
- }, Nc = `
6293
+ }, Hc = `
6282
6294
  ## Todoist Task and Project Management Tools
6283
6295
 
6284
6296
  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.
@@ -6379,31 +6391,31 @@ You have access to comprehensive Todoist management tools for personal productiv
6379
6391
 
6380
6392
  Always provide clear, actionable task titles and descriptions. Use the overview tools to give users context about their workload and project status.
6381
6393
  `;
6382
- function Zc({
6394
+ function td({
6383
6395
  todoistApiKey: e,
6384
6396
  baseUrl: t,
6385
6397
  features: o = []
6386
6398
  }) {
6387
- const r = new ns(
6388
- { name: "todoist-mcp-server", version: Ke },
6399
+ const r = new cs(
6400
+ { name: "todoist-mcp-server", version: Je },
6389
6401
  {
6390
6402
  capabilities: {
6391
6403
  tools: { listChanged: !0 },
6392
6404
  prompts: { listChanged: !0 }
6393
6405
  },
6394
- instructions: Nc
6406
+ instructions: Hc
6395
6407
  }
6396
- ), n = Xs(e, { baseUrl: t }), a = {
6397
- ...Qn,
6408
+ ), n = eo(e, { baseUrl: t }), a = {
6409
+ ...sa,
6398
6410
  _meta: {
6399
6411
  ui: {
6400
6412
  resourceUri: He
6401
6413
  }
6402
6414
  }
6403
6415
  };
6404
- Cs(r);
6416
+ xs(r);
6405
6417
  const i = { server: r, client: n, features: o };
6406
- return g({ tool: Pr, ...i }), g({ tool: zr, ...i }), g({ tool: fi, ...i }), g({ tool: fc, ...i }), g({ tool: ci, ...i }), g({ tool: aa, ...i }), g({ tool: a, ...i }), g({ tool: vn, ...i }), g({ tool: hr, ...i }), g({ tool: Ki, ...i }), g({ tool: Fn, ...i }), g({ tool: Za, ...i }), g({ tool: ti, ...i }), g({ tool: $r, ...i }), g({ tool: ic, ...i }), g({ tool: Vn, ...i }), g({ tool: $n, ...i }), g({ tool: sr, ...i }), g({ tool: _i, ...i }), g({ tool: Br, ...i }), g({ tool: Na, ...i }), g({ tool: Go, ...i }), g({ tool: hn, ...i }), g({ tool: Ti, ...i }), g({ tool: Ir, ...i }), g({ tool: Bn, ...i }), g({ tool: oc, ...i }), g({ tool: Lc, ...i }), g({ tool: ar, ...i }), g({ tool: Wi, ...i }), g({ tool: An, ...i }), g({ tool: zo, ...i }), g({ tool: Zo, ...i }), g({ tool: ji, ...i }), g({ tool: an, ...i }), g({ tool: ka, ...i }), g({ tool: Ea, ...i }), g({ tool: Sa, ...i }), g({ tool: Hr, ...i }), g({ tool: Pa, ...i }), g({ tool: ba, ...i }), g({ tool: Xr, ...i }), g({ tool: en, ...i }), g({ tool: ri, ...i }), g({ tool: Dc, ...i }), g({ tool: _n, ...i }), g({ tool: Va, ...i }), g({ tool: Ga, ...i }), g({ tool: pi, ...i }), g({ tool: on, ...i }), r.registerPrompt(
6418
+ return g({ tool: Nr, ...i }), g({ tool: Jr, ...i }), g({ tool: yi, ...i }), g({ tool: yc, ...i }), g({ tool: ui, ...i }), g({ tool: da, ...i }), g({ tool: a, ...i }), g({ tool: Cn, ...i }), g({ tool: gr, ...i }), g({ tool: Xi, ...i }), g({ tool: Gn, ...i }), g({ tool: ti, ...i }), g({ tool: ri, ...i }), g({ tool: Ar, ...i }), g({ tool: lc, ...i }), g({ tool: Zn, ...i }), g({ tool: An, ...i }), g({ tool: nr, ...i }), g({ tool: Li, ...i }), g({ tool: zr, ...i }), g({ tool: Ha, ...i }), g({ tool: qo, ...i }), g({ tool: gn, ...i }), g({ tool: vi, ...i }), g({ tool: jr, ...i }), g({ tool: zn, ...i }), g({ tool: ac, ...i }), g({ tool: Fc, ...i }), g({ tool: dr, ...i }), g({ tool: Yi, ...i }), g({ tool: Un, ...i }), g({ tool: Jo, ...i }), g({ tool: tr, ...i }), g({ tool: Di, ...i }), g({ tool: ln, ...i }), g({ tool: Ia, ...i }), g({ tool: _a, ...i }), g({ tool: $a, ...i }), g({ tool: Br, ...i }), g({ tool: Na, ...i }), g({ tool: ka, ...i }), g({ tool: en, ...i }), g({ tool: on, ...i }), g({ tool: ii, ...i }), g({ tool: Ec, ...i }), g({ tool: Ln, ...i }), g({ tool: Za, ...i }), g({ tool: qa, ...i }), g({ tool: fi, ...i }), g({ tool: an, ...i }), r.registerPrompt(
6407
6419
  pe.name,
6408
6420
  {
6409
6421
  title: pe.title,
@@ -6414,53 +6426,53 @@ function Zc({
6414
6426
  ), r;
6415
6427
  }
6416
6428
  export {
6417
- Na as A,
6418
- Br as B,
6419
- _i as C,
6420
- sr as D,
6421
- $n as E,
6422
- Vn as F,
6423
- ic as G,
6424
- $r as H,
6425
- Fn as I,
6426
- Ki as J,
6427
- hr as K,
6428
- ci as L,
6429
- vn as M,
6430
- Qn as N,
6431
- aa as O,
6432
- fc as P,
6433
- fi as Q,
6434
- zr as R,
6435
- Pr as S,
6436
- Xc as T,
6437
- Xs as U,
6438
- Ws as V,
6439
- so as W,
6440
- _n as a,
6441
- ba as b,
6442
- Pa as c,
6443
- Xr as d,
6444
- Hr as e,
6445
- on as f,
6446
- Zc as g,
6447
- Sa as h,
6448
- Ea as i,
6449
- ka as j,
6450
- an as k,
6451
- Ga as l,
6452
- Va as m,
6453
- ji as n,
6454
- Zo as o,
6455
- zo as p,
6456
- An as q,
6457
- ri as r,
6458
- pi as s,
6459
- Wi as t,
6460
- Dc as u,
6461
- ar as v,
6462
- Lc as w,
6463
- hn as x,
6464
- Ti as y,
6465
- Go as z
6429
+ Ha as A,
6430
+ zr as B,
6431
+ Li as C,
6432
+ nr as D,
6433
+ An as E,
6434
+ Zn as F,
6435
+ lc as G,
6436
+ Ar as H,
6437
+ Gn as I,
6438
+ Xi as J,
6439
+ gr as K,
6440
+ ui as L,
6441
+ Cn as M,
6442
+ sa as N,
6443
+ da as O,
6444
+ yc as P,
6445
+ yi as Q,
6446
+ Jr as R,
6447
+ Nr as S,
6448
+ ed as T,
6449
+ eo as U,
6450
+ Ys as V,
6451
+ no as W,
6452
+ Ln as a,
6453
+ ka as b,
6454
+ Na as c,
6455
+ en as d,
6456
+ Br as e,
6457
+ an as f,
6458
+ td as g,
6459
+ $a as h,
6460
+ _a as i,
6461
+ Ia as j,
6462
+ ln as k,
6463
+ qa as l,
6464
+ Za as m,
6465
+ Di as n,
6466
+ tr as o,
6467
+ Jo as p,
6468
+ Un as q,
6469
+ ii as r,
6470
+ fi as s,
6471
+ Yi as t,
6472
+ Ec as u,
6473
+ dr as v,
6474
+ Fc as w,
6475
+ gn as x,
6476
+ vi as y,
6477
+ qo as z
6466
6478
  };