@doist/todoist-mcp 13.1.3 → 13.2.0

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 { ResourceTemplate as Os, McpServer as Ps } from "@modelcontextprotocol/server";
1
+ import { ResourceTemplate as Ps, McpServer as _s } from "@modelcontextprotocol/server";
2
2
  import { createHash as Mt, randomUUID as _e } from "node:crypto";
3
- import { readFileSync as _s } from "node:fs";
3
+ import { readFileSync as Us } from "node:fs";
4
4
  import { dirname as Ft, join as Ue } from "node:path";
5
- import { fileURLToPath as Us } from "node:url";
5
+ import { fileURLToPath as Rs } from "node:url";
6
6
  import { RESOURCE_MIME_TYPE as Re } from "@modelcontextprotocol/ext-apps/server";
7
- import re, { ZodError as Rs, z as s } from "zod";
8
- import { AsyncLocalStorage as Ls } from "node:async_hooks";
9
- import { createRequire as Ns } from "node:module";
10
- import { TodoistApi as Ms, isWorkspaceProject as we, isPersonalProject as z, colors as Le, LOCATION_TRIGGERS as Ht, REMINDER_TYPES as Fs, createCommand as J, REMINDER_DELIVERY_SERVICES as Hs, HEALTH_STATUSES as Xe, getTaskUrl as Wt, getProjectUrl as Bt, parseTodoistUrl as Ws, WORKSPACE_ROLES as Bs, WORKSPACE_PLANS as zs } from "@doist/todoist-sdk";
7
+ import re, { ZodError as Ls, z as s } from "zod";
8
+ import { AsyncLocalStorage as Ns } from "node:async_hooks";
9
+ import { createRequire as Ms } from "node:module";
10
+ import { TodoistApi as Fs, isWorkspaceProject as we, isPersonalProject as z, colors as Le, LOCATION_TRIGGERS as Ht, REMINDER_TYPES as Hs, createCommand as J, REMINDER_DELIVERY_SERVICES as Ws, HEALTH_STATUSES as Xe, getTaskUrl as Wt, getProjectUrl as Bt, parseTodoistUrl as Bs, WORKSPACE_ROLES as zs, WORKSPACE_PLANS as Ks } from "@doist/todoist-sdk";
11
11
  import { addDays as Ne, formatISO as ht } from "date-fns";
12
- const mt = Ft(Us(import.meta.url)), Ks = [
12
+ const mt = Ft(Rs(import.meta.url)), Ys = [
13
13
  Ue(mt, "task-list", "index.html"),
14
14
  Ue(mt, "mcp-apps", "index.html")
15
- ], Ys = `<!doctype html>
15
+ ], Gs = `<!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 Gs() {
21
+ function qs() {
22
22
  const e = [];
23
- for (const t of Ks)
23
+ for (const t of Ys)
24
24
  try {
25
- return _s(t, "utf-8");
25
+ return Us(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), Ys;
29
+ return console.error("Failed to load task list app HTML from any known path:", e), Gs;
30
30
  }
31
- const zt = Gs(), qs = Mt("sha256").update(zt).digest("hex").slice(0, 12), Me = `ui://todoist/task-list@${qs}`, Vs = "ui://todoist/task-list@{hash}", Fe = "Interactive task list widget", Js = "https://ai.todoist.net", He = {
31
+ const zt = qs(), Vs = Mt("sha256").update(zt).digest("hex").slice(0, 12), Me = `ui://todoist/task-list@${Vs}`, Js = "ui://todoist/task-list@{hash}", Fe = "Interactive task list widget", Xs = "https://ai.todoist.net", He = {
32
32
  ui: {
33
33
  prefersBorder: !0,
34
34
  csp: {
@@ -43,7 +43,7 @@ const zt = Gs(), qs = Mt("sha256").update(zt).digest("hex").slice(0, 12), Me = `
43
43
  connect_domains: [],
44
44
  resource_domains: []
45
45
  },
46
- "openai/widgetDomain": Js
46
+ "openai/widgetDomain": Xs
47
47
  };
48
48
  function ft(e) {
49
49
  return {
@@ -57,7 +57,7 @@ function ft(e) {
57
57
  ]
58
58
  };
59
59
  }
60
- function Xs(e) {
60
+ function Qs(e) {
61
61
  e.registerResource(
62
62
  "todoist-task-list",
63
63
  Me,
@@ -69,7 +69,7 @@ function Xs(e) {
69
69
  async () => ft(Me)
70
70
  ), e.registerResource(
71
71
  "todoist-task-list-hash-fallback",
72
- new Os(Vs, { list: void 0 }),
72
+ new Ps(Js, { list: void 0 }),
73
73
  {
74
74
  description: `${Fe} compatibility fallback`,
75
75
  mimeType: Re,
@@ -105,14 +105,14 @@ function ne(e) {
105
105
  const t = E(e);
106
106
  return t !== void 0 ? t : v(e);
107
107
  }
108
- function Qs(e) {
108
+ function Zs(e) {
109
109
  return e.replace(/\b(Bearer)\s+[A-Za-z0-9._~+/=-]+/gi, "$1 [REDACTED]").replace(
110
110
  /\b(token|api[_-]?key|authorization)\s*[:=]\s*["']?[A-Za-z0-9._~+/=-]{6,}["']?/gi,
111
111
  "$1: [REDACTED]"
112
112
  ).replace(/([?&](?:token|api[_-]?key|authorization)=)[^&\s]+/gi, "$1[REDACTED]").replace(/\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\b/g, "[REDACTED]");
113
113
  }
114
- function U(e, t = 220) {
115
- const o = Qs(e).replace(/\s+/g, " ").trim();
114
+ function R(e, t = 220) {
115
+ const o = Zs(e).replace(/\s+/g, " ").trim();
116
116
  return o.length <= t ? o : `${o.slice(0, t - 3)}...`;
117
117
  }
118
118
  function Be(e) {
@@ -129,10 +129,10 @@ function xe(e) {
129
129
  function V(e) {
130
130
  const t = v(e);
131
131
  if (t)
132
- return U(t);
132
+ return R(t);
133
133
  if (Array.isArray(e)) {
134
134
  const n = e.map((i) => X(i) ? v(i.message) || v(i.error) : v(i)).filter((i) => !!i);
135
- return n.length > 0 ? U(n.slice(0, 2).join("; ")) : void 0;
135
+ return n.length > 0 ? R(n.slice(0, 2).join("; ")) : void 0;
136
136
  }
137
137
  if (!X(e))
138
138
  return;
@@ -144,20 +144,20 @@ function V(e) {
144
144
  v(e.description)
145
145
  );
146
146
  if (o)
147
- return U(o);
147
+ return R(o);
148
148
  const r = [];
149
149
  for (const [n, i] of Object.entries(e)) {
150
150
  const a = v(i);
151
151
  if (a && (r.push(`${n}: ${a}`), r.length >= 2))
152
152
  break;
153
153
  }
154
- return r.length > 0 ? U(r.join("; ")) : void 0;
154
+ return r.length > 0 ? R(r.join("; ")) : void 0;
155
155
  }
156
- function Zs(e) {
156
+ function eo(e) {
157
157
  if (!e)
158
158
  return [];
159
159
  const t = /* @__PURE__ */ new Set(), o = (a) => {
160
- a && t.add(U(a, 120));
160
+ a && t.add(R(a, 120));
161
161
  }, r = M(
162
162
  v(e.field),
163
163
  v(e.parameter),
@@ -216,7 +216,7 @@ function Zs(e) {
216
216
  }
217
217
  return Array.from(t).slice(0, 3);
218
218
  }
219
- const eo = [
219
+ const to = [
220
220
  "error",
221
221
  "error_code",
222
222
  "error_tag",
@@ -227,14 +227,14 @@ const eo = [
227
227
  "httpCode",
228
228
  "errorExtra"
229
229
  ];
230
- function to(e) {
231
- return e ? eo.some((t) => e[t] !== void 0) : !1;
230
+ function so(e) {
231
+ return e ? to.some((t) => e[t] !== void 0) : !1;
232
232
  }
233
233
  const ze = {
234
234
  MAX_ITEMS_LIMIT_REACHED: "This project has reached the maximum number of active tasks per project (subtasks count toward it; completed tasks do not). The cap is the same on every Todoist plan — upgrading will not raise it — and it is not an authentication or permission problem. Complete, delete, or move existing tasks out of the project, or add the task to a different project, then retry.",
235
235
  USER_CANNOT_VIEW_TEMPLATE: "This template exists but belongs to another account. Personal templates are private to whoever saved them, and a link to one cannot be used by anyone else. Use a public gallery template instead, or ask the owner to export it with export-project-template and share the CSV."
236
236
  };
237
- function so(...e) {
237
+ function oo(...e) {
238
238
  for (const t of e) {
239
239
  if (!t)
240
240
  continue;
@@ -245,16 +245,16 @@ function so(...e) {
245
245
  return ze[r];
246
246
  }
247
247
  }
248
- function oo(e) {
248
+ function ro(e) {
249
249
  if (e.tag) {
250
250
  const t = ze[e.tag.toUpperCase()];
251
251
  if (t)
252
252
  return t;
253
253
  }
254
- return so(...e.rawText ?? [], e.message, e.details);
254
+ return oo(...e.rawText ?? [], e.message, e.details);
255
255
  }
256
- function ro(e) {
257
- const t = oo(e);
256
+ function no(e) {
257
+ const t = ro(e);
258
258
  if (t)
259
259
  return t;
260
260
  const { statusCode: o } = e, r = e.fieldHints.length > 0;
@@ -308,13 +308,13 @@ function Qe(e) {
308
308
  V(n?.errorDetails),
309
309
  V(n?.errors),
310
310
  V(t?.details)
311
- ), p = Zs(n);
312
- return i !== void 0 || to(n) || c !== void 0 || a !== void 0 || (l ? Be(l) : !1) ? {
311
+ ), p = eo(n);
312
+ return i !== void 0 || so(n) || c !== void 0 || a !== void 0 || (l ? Be(l) : !1) ? {
313
313
  statusCode: i,
314
314
  code: a,
315
- tag: c ? U(c, 80) : void 0,
316
- message: l ? U(l) : void 0,
317
- details: u ? U(u) : void 0,
315
+ tag: c ? R(c, 80) : void 0,
316
+ message: l ? R(l) : void 0,
317
+ details: u ? R(u) : void 0,
318
318
  rawText: d,
319
319
  fieldHints: p
320
320
  } : null;
@@ -323,15 +323,15 @@ function Kt(e) {
323
323
  const t = [];
324
324
  return e.statusCode !== void 0 && t.push(`HTTP ${e.statusCode}`), e.code !== void 0 && t.push(`code ${e.code}`), e.tag && t.push(`tag ${e.tag}`), t;
325
325
  }
326
- function no(e) {
326
+ function io(e) {
327
327
  const t = Kt(e), o = [
328
328
  t.length > 0 ? `Todoist API request failed (${t.join(", ")}).` : "Todoist API request failed."
329
329
  ];
330
- return e.message && o.push(`Message: ${e.message}`), e.details && e.details !== e.message && o.push(`Details: ${e.details}`), e.fieldHints.length > 0 && o.push(`Field hints: ${e.fieldHints.join("; ")}`), o.push(`Try next: ${ro(e)}`), o.join(`
330
+ return e.message && o.push(`Message: ${e.message}`), e.details && e.details !== e.message && o.push(`Details: ${e.details}`), e.fieldHints.length > 0 && o.push(`Field hints: ${e.fieldHints.join("; ")}`), o.push(`Try next: ${no(e)}`), o.join(`
331
331
  `);
332
332
  }
333
333
  function Yt(e) {
334
- return e instanceof Error ? U(e.message) : typeof e == "string" ? U(e) : "An unknown error occurred";
334
+ return e instanceof Error ? R(e.message) : typeof e == "string" ? R(e) : "An unknown error occurred";
335
335
  }
336
336
  class Ie extends Error {
337
337
  constructor(t) {
@@ -343,7 +343,7 @@ class Gt extends Error {
343
343
  super(t), this.name = "BatchDueStringParseError";
344
344
  }
345
345
  }
346
- function R(e) {
346
+ function L(e) {
347
347
  if (e instanceof Ie)
348
348
  return e.message;
349
349
  const t = Qe(e);
@@ -352,7 +352,7 @@ function R(e) {
352
352
  const o = Kt(t), r = t.message && !(o.length > 0 && Be(t.message)) ? t.message : "Todoist API request failed";
353
353
  return o.length > 0 ? `${r} (${o.join(", ")})` : r;
354
354
  }
355
- function io(e, {
355
+ function ao(e, {
356
356
  taskContent: t,
357
357
  dueString: o,
358
358
  deadlineDate: r
@@ -365,14 +365,14 @@ function io(e, {
365
365
  const d = o.trim().replace(/^recurring(?:\s+|$)/i, "").trim();
366
366
  return d !== o.trim() && d ? `Task "${t}" wasn't created because \`dueString\` could not be parsed. Use Todoist recurrence syntax, for example \`${d}\`; don't prefix it with \`recurring\`. Change only \`dueString\` and retry.` : d !== o.trim() ? `Task "${t}" wasn't created because \`dueString\` could not be parsed. Use a complete Todoist recurrence expression; \`recurring\` alone is not valid. Change only \`dueString\` and retry.` : `Task "${t}" wasn't created because \`dueString\` could not be parsed. Change only \`dueString\` and retry.`;
367
367
  }
368
- function ao(e) {
369
- if (e instanceof Rs || e instanceof Ie || e instanceof Gt)
368
+ function co(e) {
369
+ if (e instanceof Ls || e instanceof Ie || e instanceof Gt)
370
370
  return e.message;
371
371
  const t = Qe(e);
372
- return t ? no(t) : Yt(e);
372
+ return t ? io(t) : Yt(e);
373
373
  }
374
- const co = "13.1.3", lo = {
375
- version: co
374
+ const lo = "13.2.0", uo = {
375
+ version: lo
376
376
  }, j = {
377
377
  /** Default limit for task listings */
378
378
  TASKS_DEFAULT: 10,
@@ -409,7 +409,7 @@ const co = "13.1.3", lo = {
409
409
  }, be = {
410
410
  /** Maximum number of failures to show in detailed error messages */
411
411
  MAX_FAILURES_SHOWN: 3
412
- }, uo = {
412
+ }, po = {
413
413
  /** Maximum number of failed items named in one log line */
414
414
  MAX_FAILURES_LOGGED: 5
415
415
  }, qt = {
@@ -488,50 +488,50 @@ function Vt() {
488
488
  }
489
489
  const gt = /* @__PURE__ */ new Map(), Jt = /* @__PURE__ */ new WeakMap();
490
490
  let yt;
491
- function po() {
491
+ function ho() {
492
492
  return yt ??= Vt(), yt;
493
493
  }
494
- function ho(e) {
494
+ function mo(e) {
495
495
  return Mt("sha256").update(e).digest("hex");
496
496
  }
497
- function mo(e, t) {
498
- const o = ho(t);
497
+ function fo(e, t) {
498
+ const o = mo(t);
499
499
  let r = gt.get(o);
500
500
  r || (r = Vt(), gt.set(o, r)), Jt.set(e, r);
501
501
  }
502
502
  function Xt(e) {
503
- return Jt.get(e) ?? po();
503
+ return Jt.get(e) ?? ho();
504
504
  }
505
- function fo(e) {
505
+ function bo(e) {
506
506
  return Xt(e).moves;
507
507
  }
508
- function bo(e) {
508
+ function go(e) {
509
509
  return Xt(e).writes;
510
510
  }
511
- const go = "todoist-mcp", Ze = lo.version, Qt = new Ls(), Tt = Ns(import.meta.url);
511
+ const yo = "todoist-mcp", Ze = uo.version, Qt = new Ns(), Tt = Ms(import.meta.url);
512
512
  let ke;
513
- const yo = async () => {
513
+ const To = async () => {
514
514
  const e = Tt.resolve("@doist/todoist-sdk"), t = Ue(Ft(e), "transport", "http-dispatcher.js");
515
515
  return Tt(t);
516
516
  };
517
- let To = yo;
518
- function ko() {
519
- return `${go}/${Ze}`;
517
+ let ko = To;
518
+ function wo() {
519
+ return `${yo}/${Ze}`;
520
520
  }
521
521
  function Zt(e) {
522
522
  return e.trim().toLowerCase();
523
523
  }
524
- function wo(e, t) {
524
+ function vo(e, t) {
525
525
  return Qt.run(Zt(e), t);
526
526
  }
527
- function vo({
527
+ function Io({
528
528
  label: e,
529
529
  platform: t = "mcp",
530
530
  sessionId: o = _e()
531
531
  } = {}) {
532
532
  const r = e ? Zt(e) : Qt.getStore();
533
533
  return {
534
- "User-Agent": ko(),
534
+ "User-Agent": wo(),
535
535
  "doist-platform": t,
536
536
  "doist-version": Ze,
537
537
  "request-id": _e(),
@@ -539,16 +539,16 @@ function vo({
539
539
  "mcp-tool": r ?? "unknown"
540
540
  };
541
541
  }
542
- function Io(e, t) {
542
+ function So(e, t) {
543
543
  const o = new Headers(e);
544
- for (const [r, n] of Object.entries(vo(t)))
544
+ for (const [r, n] of Object.entries(Io(t)))
545
545
  o.set(r, n);
546
546
  return Object.fromEntries(o.entries());
547
547
  }
548
548
  function kt() {
549
549
  return new DOMException("The operation was aborted due to timeout", "TimeoutError");
550
550
  }
551
- function So(e, t) {
551
+ function Co(e, t) {
552
552
  if (!e && t === void 0)
553
553
  return {
554
554
  signal: void 0,
@@ -586,20 +586,20 @@ function So(e, t) {
586
586
  }
587
587
  };
588
588
  }
589
- async function Co() {
590
- if (jo())
591
- return ke || (ke = To().then((e) => e.getDefaultDispatcher()).catch((e) => {
589
+ async function jo() {
590
+ if ($o())
591
+ return ke || (ke = ko().then((e) => e.getDefaultDispatcher()).catch((e) => {
592
592
  throw ke = void 0, e;
593
593
  })), ke;
594
594
  }
595
- function jo() {
595
+ function $o() {
596
596
  return typeof process < "u" && !!process.versions?.node;
597
597
  }
598
- async function $o(e) {
599
- const t = await Co();
598
+ async function Do(e) {
599
+ const t = await jo();
600
600
  t !== void 0 && (e.dispatcher = t);
601
601
  }
602
- function Do(e) {
602
+ function Ao(e) {
603
603
  return {
604
604
  ok: e.ok,
605
605
  status: e.status,
@@ -610,36 +610,36 @@ function Do(e) {
610
610
  arrayBuffer: () => e.arrayBuffer()
611
611
  };
612
612
  }
613
- function Ao(e = globalThis.fetch, t = {}) {
613
+ function xo(e = globalThis.fetch, t = {}) {
614
614
  const o = e === globalThis.fetch, { enabled: r = !0, platform: n = "mcp", sessionId: i = _e() } = t;
615
615
  return async (a, c = {}) => {
616
- const { timeout: d, headers: l, signal: u, ...p } = c, { signal: h, cleanup: m } = So(u, d);
616
+ const { timeout: d, headers: l, signal: u, ...p } = c, { signal: h, cleanup: m } = Co(u, d);
617
617
  try {
618
618
  const y = {
619
619
  ...p,
620
620
  signal: h,
621
- ...r ? { headers: Io(l, { platform: n, sessionId: i }) } : l !== void 0 ? { headers: l } : {}
621
+ ...r ? { headers: So(l, { platform: n, sessionId: i }) } : l !== void 0 ? { headers: l } : {}
622
622
  };
623
- o && await $o(y);
623
+ o && await Do(y);
624
624
  const f = await e(a, y);
625
- return Do(f);
625
+ return Ao(f);
626
626
  } finally {
627
627
  m();
628
628
  }
629
629
  };
630
630
  }
631
- function xo(e, {
631
+ function Eo(e, {
632
632
  baseUrl: t,
633
633
  tracking: o
634
634
  } = {}) {
635
- const r = new Ms(e, {
636
- customFetch: Ao(globalThis.fetch, o),
635
+ const r = new Fs(e, {
636
+ customFetch: xo(globalThis.fetch, o),
637
637
  ...t ? { baseUrl: t } : {}
638
638
  });
639
- return mo(r, e), r;
639
+ return fo(r, e), r;
640
640
  }
641
- const Eo = 2, Oo = 500, Po = 2e3, _o = 50, Uo = /* @__PURE__ */ new Set([502, 503, 504]);
642
- function Ro(e) {
641
+ const Oo = 2, Po = 500, _o = 2e3, Uo = 50, Ro = /* @__PURE__ */ new Set([502, 503, 504]);
642
+ function Lo(e) {
643
643
  if (e == null || typeof e != "object")
644
644
  return;
645
645
  const t = e;
@@ -655,32 +655,32 @@ function Ro(e) {
655
655
  return Number(o[1]);
656
656
  }
657
657
  }
658
- function Lo(e) {
659
- const t = Ro(e);
660
- return t !== void 0 && Uo.has(t);
658
+ function No(e) {
659
+ const t = Lo(e);
660
+ return t !== void 0 && Ro.has(t);
661
661
  }
662
- function No({
662
+ function Mo({
663
663
  attempt: e,
664
664
  baseDelayMs: t,
665
665
  maxDelayMs: o,
666
666
  random: r = Math.random
667
667
  }) {
668
668
  const n = Math.min(t * 2 ** e, o), i = Math.round(r() * n);
669
- return Math.min(n, Math.max(_o, i));
669
+ return Math.min(n, Math.max(Uo, i));
670
670
  }
671
- function Mo(e) {
671
+ function Fo(e) {
672
672
  return new Promise((t) => setTimeout(t, e));
673
673
  }
674
674
  async function O(e, t = {}) {
675
- const o = t.maxRetries ?? Eo, r = t.baseDelayMs ?? Oo, n = t.maxDelayMs ?? Po, i = t.random;
675
+ const o = t.maxRetries ?? Oo, r = t.baseDelayMs ?? Po, n = t.maxDelayMs ?? _o, i = t.random;
676
676
  let a;
677
677
  for (let c = 0; c <= o; c++)
678
678
  try {
679
679
  return await e();
680
680
  } catch (d) {
681
- if (a = d, c < o && Lo(d)) {
682
- const l = No({ attempt: c, baseDelayMs: r, maxDelayMs: n, random: i });
683
- await Mo(l);
681
+ if (a = d, c < o && No(d)) {
682
+ const l = Mo({ attempt: c, baseDelayMs: r, maxDelayMs: n, random: i });
683
+ await Fo(l);
684
684
  continue;
685
685
  }
686
686
  throw d;
@@ -768,55 +768,55 @@ const g = {
768
768
  // OpenAI MCP tools
769
769
  SEARCH: "search",
770
770
  FETCH: "fetch"
771
- }, Vd = {
771
+ }, Jd = {
772
772
  /**
773
773
  * Strips email addresses from tool outputs that expose user data.
774
774
  * Affects: find-project-collaborators, find-completed-tasks
775
775
  */
776
776
  STRIP_EMAILS: "strip_emails"
777
- }, Fo = process.env.USE_STRUCTURED_CONTENT === "true" || process.env.NODE_ENV === "test";
778
- function Ho({
777
+ }, Ho = process.env.USE_STRUCTURED_CONTENT === "true" || process.env.NODE_ENV === "test";
778
+ function Wo({
779
779
  textContent: e,
780
780
  structuredContent: t,
781
781
  contentItems: o
782
782
  }) {
783
783
  const r = Ye(t), n = {}, i = [];
784
- return o && i.push(...o), !Fo && t && i.push({
784
+ return o && i.push(...o), !Ho && t && i.push({
785
785
  type: "text",
786
786
  text: JSON.stringify(r)
787
787
  }), e && i.push({ type: "text", text: e }), i.length > 0 && (n.content = i), t && (n.structuredContent = r), n;
788
788
  }
789
- function Wo(e) {
789
+ function Bo(e) {
790
790
  return {
791
791
  content: [{ type: "text", text: e }],
792
792
  isError: !0
793
793
  };
794
794
  }
795
- const Bo = /* @__PURE__ */ new Set(["file"]);
796
- function zo(e) {
795
+ const zo = /* @__PURE__ */ new Set(["file"]);
796
+ function Ko(e) {
797
797
  return !e || typeof e != "object" || Array.isArray(e) ? e : Object.fromEntries(
798
798
  Object.entries(e).map(
799
- ([t, o]) => Bo.has(t) && o !== void 0 ? [t, "[redacted]"] : [t, o]
799
+ ([t, o]) => zo.has(t) && o !== void 0 ? [t, "[redacted]"] : [t, o]
800
800
  )
801
801
  );
802
802
  }
803
- function Ko(e) {
803
+ function Yo(e) {
804
804
  return { ...{
805
- title: `Todoist: ${Yo(e.name)}`,
805
+ title: `Todoist: ${Go(e.name)}`,
806
806
  openWorldHint: !1
807
807
  }, ...e.annotations };
808
808
  }
809
- function Yo(e) {
809
+ function Go(e) {
810
810
  return e.split("-").filter(Boolean).map((t) => `${t.charAt(0).toUpperCase()}${t.slice(1)}`).join(" ");
811
811
  }
812
- function Go(e) {
812
+ function qo(e) {
813
813
  return e ? typeof e["ui/resourceUri"] == "string" ? !0 : typeof e.ui == "object" && e.ui !== null : !1;
814
814
  }
815
- function qo(e) {
815
+ function Vo(e) {
816
816
  const t = typeof e.ui == "object" && e.ui !== null ? e.ui : void 0, o = t?.resourceUri, r = e["ui/resourceUri"];
817
817
  return typeof o == "string" && typeof r != "string" ? { ...e, "ui/resourceUri": o } : typeof r == "string" && typeof o != "string" ? { ...e, ui: { ...t, resourceUri: r } } : e;
818
818
  }
819
- const Vo = [
819
+ const Jo = [
820
820
  g.FIND_PROJECT_COLLABORATORS,
821
821
  g.FIND_COMPLETED_TASKS
822
822
  ];
@@ -833,36 +833,36 @@ function Ge(e) {
833
833
  }
834
834
  return e;
835
835
  }
836
- function Jo(e) {
836
+ function Xo(e) {
837
837
  const t = /\s*\([^)]*@[^)]+\)/g, o = /\S+@\S+\.\S+/g;
838
838
  return e.replace(t, "").replace(o, "[email hidden]");
839
839
  }
840
- function Xo({
840
+ function Qo({
841
841
  tool: e,
842
842
  server: t,
843
843
  client: o,
844
844
  features: r = []
845
845
  }) {
846
- const n = r.some((u) => u.name === "strip_emails") && Vo.includes(e.name), i = e.execute, a = s.object(e.parameters), c = e.outputSchema ? s.object(e.outputSchema) : void 0, d = async (u, p) => {
846
+ const n = r.some((u) => u.name === "strip_emails") && Jo.includes(e.name), i = e.execute, a = s.object(e.parameters), c = e.outputSchema ? s.object(e.outputSchema) : void 0, d = async (u, p) => {
847
847
  try {
848
- let { textContent: h, structuredContent: m, contentItems: y } = await wo(
848
+ let { textContent: h, structuredContent: m, contentItems: y } = await vo(
849
849
  e.name,
850
850
  () => O(() => i(u, o))
851
851
  );
852
- return n && (h && (h = Jo(h)), m && (m = Ge(m))), Ho({ textContent: h, structuredContent: m, contentItems: y });
852
+ return n && (h && (h = Xo(h)), m && (m = Ge(m))), Wo({ textContent: h, structuredContent: m, contentItems: y });
853
853
  } catch (h) {
854
- return console.error(`Error executing tool ${e.name}:`, { args: zo(u), error: h }), Wo(ao(h));
854
+ return console.error(`Error executing tool ${e.name}:`, { args: Ko(u), error: h }), Bo(co(h));
855
855
  }
856
856
  }, l = {
857
857
  description: e.description,
858
858
  inputSchema: a,
859
859
  ...c ? { outputSchema: c } : {},
860
- annotations: Ko(e),
861
- ...e._meta ? { _meta: Go(e._meta) ? qo(e._meta) : e._meta } : {}
860
+ annotations: Yo(e),
861
+ ...e._meta ? { _meta: qo(e._meta) ? Vo(e._meta) : e._meta } : {}
862
862
  };
863
863
  t.registerTool(e.name, l, d);
864
864
  }
865
- const Qo = s.object({
865
+ const Zo = s.object({
866
866
  period: s.enum(["today", "7d", "14d", "30d", "this-week", "this-month"]).default("7d").describe(
867
867
  '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.'
868
868
  ),
@@ -871,7 +871,7 @@ const Qo = s.object({
871
871
  ),
872
872
  projectId: s.string().optional().describe("Optional project ID to scope the analysis to a specific project.")
873
873
  });
874
- function Zo(e, t = /* @__PURE__ */ new Date()) {
874
+ function er(e, t = /* @__PURE__ */ new Date()) {
875
875
  const o = (n) => n.toISOString().slice(0, 10), r = o(t);
876
876
  switch (e) {
877
877
  case "today":
@@ -918,7 +918,7 @@ function Zo(e, t = /* @__PURE__ */ new Date()) {
918
918
  }
919
919
  }
920
920
  }
921
- function er(e) {
921
+ function tr(e) {
922
922
  const t = {
923
923
  goals: `### Goal Tracking
924
924
  - Compare tasks completed today vs the daily goal
@@ -949,8 +949,8 @@ function er(e) {
949
949
 
950
950
  `) : t[e] ?? "";
951
951
  }
952
- function tr(e) {
953
- const { since: t, until: o, periodDescription: r } = Zo(e.period), n = e.projectId ? `
952
+ function sr(e) {
953
+ const { since: t, until: o, periodDescription: r } = er(e.period), n = e.projectId ? `
954
954
  Scope this analysis to project ID: ${e.projectId}. Pass this projectId when calling find-completed-tasks and get-overview.` : "";
955
955
  return `Analyze my Todoist productivity for ${r} (${t} to ${o}).${n}
956
956
 
@@ -971,7 +971,7 @@ ${e.focus === "overall" || e.focus === "projects" ? `4. **get-overview** — Get
971
971
 
972
972
  Using the collected data, produce an analysis covering the following sections:
973
973
 
974
- ${er(e.focus)}
974
+ ${tr(e.focus)}
975
975
 
976
976
  ### Step 3: Format
977
977
 
@@ -981,14 +981,14 @@ Present the analysis as a clear, well-structured markdown report with:
981
981
  - Specific numbers and comparisons (not vague statements)
982
982
  - Actionable takeaways highlighted clearly`;
983
983
  }
984
- function sr(e) {
984
+ function or(e) {
985
985
  return {
986
986
  messages: [
987
987
  {
988
988
  role: "user",
989
989
  content: {
990
990
  type: "text",
991
- text: tr(e)
991
+ text: sr(e)
992
992
  }
993
993
  }
994
994
  ]
@@ -998,8 +998,8 @@ const fe = {
998
998
  name: "productivity-analysis",
999
999
  title: "Productivity Analysis",
1000
1000
  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.",
1001
- argsSchema: Qo,
1002
- callback: sr
1001
+ argsSchema: Zo,
1002
+ callback: or
1003
1003
  };
1004
1004
  class _ extends Error {
1005
1005
  constructor(t, o) {
@@ -1040,19 +1040,19 @@ function es(e) {
1040
1040
  throw new _(e, "Duration cannot exceed 24 hours (1440 minutes)");
1041
1041
  return { minutes: r };
1042
1042
  }
1043
- function or(e) {
1043
+ function rr(e) {
1044
1044
  if (e <= 0) return "0m";
1045
1045
  const t = Math.floor(e / 60), o = e % 60;
1046
1046
  return t === 0 ? `${o}m` : o === 0 ? `${t}h` : `${t}h${o}m`;
1047
1047
  }
1048
- const rr = ["p1", "p2", "p3", "p4"], et = '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.', tt = s.enum(rr).describe(et);
1048
+ const nr = ["p1", "p2", "p3", "p4"], et = '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.', tt = s.enum(nr).describe(et);
1049
1049
  function ts(e) {
1050
1050
  return { p1: 4, p2: 3, p3: 2, p4: 1 }[e];
1051
1051
  }
1052
- function nr(e) {
1052
+ function ir(e) {
1053
1053
  return { 4: "p1", 3: "p2", 2: "p3", 1: "p4" }[e];
1054
1054
  }
1055
- const ss = 300 * 1e3, ir = 1e4, ar = 1e3;
1055
+ const ss = 300 * 1e3, ar = 1e4, cr = 1e3;
1056
1056
  class os {
1057
1057
  constructor(t, o) {
1058
1058
  this.maxEntries = t, this.ttl = o, this.entries = /* @__PURE__ */ new Map();
@@ -1087,13 +1087,13 @@ class os {
1087
1087
  }
1088
1088
  }
1089
1089
  const Ee = new os(
1090
- ir,
1090
+ ar,
1091
1091
  ss
1092
1092
  ), ie = new os(
1093
- ar,
1093
+ cr,
1094
1094
  ss
1095
1095
  ), rs = "me";
1096
- class cr {
1096
+ class dr {
1097
1097
  /**
1098
1098
  * Resolve a user name or ID to a user ID by looking up collaborators across all shared projects.
1099
1099
  * Supports exact name matches, partial matches, email matches, and the "me" keyword.
@@ -1228,11 +1228,11 @@ class cr {
1228
1228
  Ee.clear(), ie.clear();
1229
1229
  }
1230
1230
  }
1231
- const F = new cr();
1232
- async function dr(e, t) {
1231
+ const F = new dr();
1232
+ async function lr(e, t) {
1233
1233
  return F.resolveUser(e, t);
1234
1234
  }
1235
- async function lr(e, t) {
1235
+ async function ur(e, t) {
1236
1236
  const o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), n = [], i = [];
1237
1237
  for (const a of t) {
1238
1238
  const c = a.trim().toLowerCase();
@@ -1257,7 +1257,7 @@ const ns = ["assigned", "unassignedOrMe", "all"];
1257
1257
  async function st(e, t) {
1258
1258
  if (!t)
1259
1259
  return;
1260
- const o = await dr(e, t);
1260
+ const o = await lr(e, t);
1261
1261
  if (!o)
1262
1262
  throw new Error(
1263
1263
  `Could not find user: "${t}". Make sure the user is a collaborator on a shared project.`
@@ -1276,7 +1276,7 @@ function qe({
1276
1276
  const n = !!(e && t) && e === o;
1277
1277
  return e && t && !n ? `assigned to: ${t}` : n || r === "unassignedOrMe" ? "!assigned to: others" : r === "assigned" ? "assigned to: others" : "";
1278
1278
  }
1279
- function ur({
1279
+ function pr({
1280
1280
  tasks: e,
1281
1281
  resolvedAssigneeId: t,
1282
1282
  currentUserId: o,
@@ -1327,14 +1327,14 @@ async function as(e) {
1327
1327
  limit: j.PROJECTS_MAX
1328
1328
  });
1329
1329
  }
1330
- async function pr(e) {
1330
+ async function hr(e) {
1331
1331
  return W({
1332
1332
  apiMethod: e.getArchivedProjects.bind(e),
1333
1333
  args: {},
1334
1334
  limit: j.PROJECTS_MAX
1335
1335
  });
1336
1336
  }
1337
- function hr(e) {
1337
+ function mr(e) {
1338
1338
  const t = (i) => i.replaceAll(/[.*+?^${}()|[\]\\]/g, "\\$&"), o = /(?<!\\)(?:\\\\)*\*/.test(e), r = [...e];
1339
1339
  let n = "";
1340
1340
  for (let i = 0; i < r.length; i++) {
@@ -1343,21 +1343,21 @@ function hr(e) {
1343
1343
  }
1344
1344
  return new RegExp(o ? `^${n}$` : n, "iu");
1345
1345
  }
1346
- async function mr(e, t) {
1346
+ async function fr(e, t) {
1347
1347
  return W({
1348
1348
  apiMethod: e.searchLabels.bind(e),
1349
1349
  args: { query: ot(t) },
1350
1350
  limit: j.LABELS_MAX
1351
1351
  });
1352
1352
  }
1353
- async function fr(e) {
1353
+ async function br(e) {
1354
1354
  return W({
1355
1355
  apiMethod: e.getSharedLabels.bind(e),
1356
1356
  args: {},
1357
1357
  limit: j.LABELS_MAX
1358
1358
  });
1359
1359
  }
1360
- async function br(e, t, o) {
1360
+ async function gr(e, t, o) {
1361
1361
  const r = ot(t);
1362
1362
  return W({
1363
1363
  apiMethod: e.searchSections.bind(e),
@@ -1373,12 +1373,12 @@ function P(e) {
1373
1373
  dueDate: e.due?.date,
1374
1374
  recurring: e.due?.isRecurring && e.due.string ? e.due.string : !1,
1375
1375
  deadlineDate: e.deadline?.date,
1376
- priority: nr(e.priority) ?? "p4",
1376
+ priority: ir(e.priority) ?? "p4",
1377
1377
  projectId: e.projectId,
1378
1378
  sectionId: e.sectionId ?? void 0,
1379
1379
  parentId: e.parentId ?? void 0,
1380
1380
  labels: e.labels,
1381
- duration: e.duration ? or(e.duration.amount) : void 0,
1381
+ duration: e.duration ? rr(e.duration.amount) : void 0,
1382
1382
  responsibleUid: e.responsibleUid ?? void 0,
1383
1383
  assignedByUid: e.assignedByUid ?? void 0,
1384
1384
  checked: e.checked,
@@ -1428,7 +1428,7 @@ function ye(e) {
1428
1428
  } : void 0
1429
1429
  };
1430
1430
  }
1431
- function gr(e) {
1431
+ function yr(e) {
1432
1432
  return {
1433
1433
  id: e.id ?? void 0,
1434
1434
  objectType: e.objectType,
@@ -1441,7 +1441,7 @@ function gr(e) {
1441
1441
  extraData: e.extraData ?? void 0
1442
1442
  };
1443
1443
  }
1444
- const yr = re.object({
1444
+ const Tr = re.object({
1445
1445
  httpStatusCode: re.number(),
1446
1446
  responseData: re.object({
1447
1447
  error: re.string(),
@@ -1459,7 +1459,7 @@ async function rt({
1459
1459
  const { results: n, nextCursor: i } = await e.getTasksByFilter({ query: t, cursor: r, limit: o });
1460
1460
  return { tasks: n.map(P), nextCursor: i };
1461
1461
  } catch (n) {
1462
- const i = yr.safeParse(n);
1462
+ const i = Tr.safeParse(n);
1463
1463
  if (!i.success)
1464
1464
  throw n;
1465
1465
  const { responseData: a } = i.data;
@@ -1515,11 +1515,11 @@ function cs(e) {
1515
1515
  return { timeBasedCount: t, locationCount: o };
1516
1516
  }
1517
1517
  const ds = "none";
1518
- function Tr(e) {
1518
+ function kr(e) {
1519
1519
  return e.length === 1 && e[0]?.trim().toLowerCase() === ds;
1520
1520
  }
1521
- async function kr(e, t, o) {
1522
- const r = await wr(e, t);
1521
+ async function wr(e, t, o) {
1522
+ const r = await vr(e, t);
1523
1523
  if (r)
1524
1524
  return vt(
1525
1525
  [...r.uidsToNotify ?? [], r.postedUid],
@@ -1530,7 +1530,7 @@ async function kr(e, t, o) {
1530
1530
  const n = await e.getTask(t.taskId);
1531
1531
  return vt([n.responsibleUid, n.assignedByUid, n.addedByUid], o);
1532
1532
  }
1533
- async function wr(e, t) {
1533
+ async function vr(e, t) {
1534
1534
  let o, r = null;
1535
1535
  do {
1536
1536
  const n = await e.getComments({
@@ -1550,12 +1550,12 @@ function vt(e, t) {
1550
1550
  return [...o];
1551
1551
  }
1552
1552
  const Se = Le.map((e) => e.key);
1553
- function vr(e) {
1553
+ function Ir(e) {
1554
1554
  if (typeof e != "string") return;
1555
1555
  const t = e.toLowerCase();
1556
1556
  return (Le.find((r) => r.key === t) ?? Le.find((r) => r.displayName.toLowerCase() === t))?.key;
1557
1557
  }
1558
- const Ir = `Color for the entity. Accepts a color key (e.g. "berry_red") or display name (e.g. "Berry Red"). Valid colors: ${Se.join(", ")}. Unrecognized colors are omitted and charcoal will be used as the default.`, pe = s.preprocess(vr, s.enum(Se).optional()).describe(Ir);
1558
+ const Sr = `Color for the entity. Accepts a color key (e.g. "berry_red") or display name (e.g. "Berry Red"). Valid colors: ${Se.join(", ")}. Unrecognized colors are omitted and charcoal will be used as the default.`, pe = s.preprocess(Ir, s.enum(Se).optional()).describe(Sr);
1559
1559
  s.enum(Se);
1560
1560
  const he = s.enum(Se).optional().catch(void 0), B = s.object({
1561
1561
  id: s.string(),
@@ -1599,7 +1599,7 @@ const he = s.enum(Se).optional().catch(void 0), B = s.object({
1599
1599
  function Y({ id: e, name: t, sectionOrder: o, description: r }) {
1600
1600
  return { id: e, name: t, sectionOrder: o, description: r ?? void 0 };
1601
1601
  }
1602
- const Sr = s.object({
1602
+ const Cr = s.object({
1603
1603
  resourceType: s.string().describe("file, url, image, etc."),
1604
1604
  fileName: s.string().optional(),
1605
1605
  fileSize: s.number().optional().describe("Bytes."),
@@ -1620,8 +1620,8 @@ const Sr = s.object({
1620
1620
  postedAt: s.string().describe("ISO 8601."),
1621
1621
  postedUid: s.string().optional(),
1622
1622
  notifiedUserIds: s.array(s.string()).optional().describe("Users notified about this comment. Absent when nobody was notified."),
1623
- fileAttachment: Sr.optional()
1624
- }), Cr = s.object({
1623
+ fileAttachment: Cr.optional()
1624
+ }), jr = s.object({
1625
1625
  id: s.string().optional(),
1626
1626
  objectType: s.string().describe("task, project, etc."),
1627
1627
  objectId: s.string(),
@@ -1631,7 +1631,7 @@ const Sr = s.object({
1631
1631
  parentItemId: s.string().optional(),
1632
1632
  initiatorId: s.string().optional().describe("User who initiated the event."),
1633
1633
  extraData: s.record(s.string(), s.unknown()).optional()
1634
- }), jr = s.object({
1634
+ }), $r = s.object({
1635
1635
  id: s.string(),
1636
1636
  name: s.string(),
1637
1637
  email: s.string()
@@ -1641,7 +1641,7 @@ const Sr = s.object({
1641
1641
  color: he,
1642
1642
  order: s.number().optional().catch(void 0).describe("Display order."),
1643
1643
  isFavorite: s.boolean()
1644
- }), $r = s.object({
1644
+ }), Dr = s.object({
1645
1645
  isRecurring: s.boolean(),
1646
1646
  string: s.string().describe("Human-readable due string."),
1647
1647
  date: s.string().describe("ISO 8601."),
@@ -1650,9 +1650,9 @@ const Sr = s.object({
1650
1650
  }), nt = s.object({
1651
1651
  id: s.string(),
1652
1652
  taskId: s.string(),
1653
- type: s.enum(Fs),
1653
+ type: s.enum(Hs),
1654
1654
  minuteOffset: s.number().optional().describe("Minutes before due. Relative reminders only."),
1655
- due: $r.optional().describe("Absolute, and sometimes relative, reminders."),
1655
+ due: Dr.optional().describe("Absolute, and sometimes relative, reminders."),
1656
1656
  name: s.string().optional().describe("Location name. Location reminders only."),
1657
1657
  locLat: s.string().optional().describe("Location reminders only."),
1658
1658
  locLong: s.string().optional().describe("Location reminders only."),
@@ -1663,7 +1663,7 @@ const Sr = s.object({
1663
1663
  item: s.string().describe("Usually the ID of the item that failed."),
1664
1664
  error: s.string(),
1665
1665
  code: s.string().optional()
1666
- }), Dr = s.object({
1666
+ }), Ar = s.object({
1667
1667
  taskId: s.string().optional().describe("The ID of the task to comment on."),
1668
1668
  projectId: s.string().optional().describe(
1669
1669
  'The ID of the project to comment on. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
@@ -1672,17 +1672,17 @@ const Sr = s.object({
1672
1672
  notifyUsers: s.array(s.string().min(1)).min(1).max(j.NOTIFY_USERS_MAX).optional().describe(
1673
1673
  `Who to notify about this comment — a user ID, email, full name, or "me" for each person. Set this whenever the comment mentions someone; the text of an @mention notifies nobody on its own. Omit to notify whoever the Todoist apps would (the task's assignee, assigner and creator on a first comment, or the previous comment's participants on a reply). Pass ["${ds}"] to notify nobody.`
1674
1674
  )
1675
- }), Ar = {
1676
- comments: s.array(Dr).min(1).describe("The array of comments to add.")
1677
- }, xr = {
1675
+ }), xr = {
1676
+ comments: s.array(Ar).min(1).describe("The array of comments to add.")
1677
+ }, Er = {
1678
1678
  comments: s.array(Te).describe("The created comments."),
1679
1679
  totalCount: s.number().describe("The total number of comments created."),
1680
1680
  addedCommentIds: s.array(s.string()).describe("The IDs of the added comments.")
1681
- }, Er = {
1681
+ }, Or = {
1682
1682
  name: g.ADD_COMMENTS,
1683
1683
  description: "Add multiple comments to tasks or projects, optionally notifying collaborators. Each comment must specify either taskId or projectId.",
1684
- parameters: Ar,
1685
- outputSchema: xr,
1684
+ parameters: xr,
1685
+ outputSchema: Er,
1686
1686
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
1687
1687
  async execute(e, t) {
1688
1688
  const { comments: o } = e;
@@ -1705,7 +1705,7 @@ const Sr = s.object({
1705
1705
  });
1706
1706
  return p.taskId ? { taskId: p.taskId } : { projectId: h };
1707
1707
  })
1708
- ), c = await Or({
1708
+ ), c = await Pr({
1709
1709
  comments: o,
1710
1710
  targets: a,
1711
1711
  client: t,
@@ -1723,7 +1723,7 @@ const Sr = s.object({
1723
1723
  })
1724
1724
  )).map(ye);
1725
1725
  return {
1726
- textContent: Pr({ comments: l }),
1726
+ textContent: _r({ comments: l }),
1727
1727
  structuredContent: {
1728
1728
  comments: l,
1729
1729
  totalCount: l.length,
@@ -1732,7 +1732,7 @@ const Sr = s.object({
1732
1732
  };
1733
1733
  }
1734
1734
  };
1735
- async function Or({
1735
+ async function Pr({
1736
1736
  comments: e,
1737
1737
  targets: t,
1738
1738
  client: o,
@@ -1742,15 +1742,15 @@ async function Or({
1742
1742
  return await Promise.all(
1743
1743
  e.map(async ({ notifyUsers: i }, a) => {
1744
1744
  if (i)
1745
- return Tr(i) ? [] : (await lr(o, i)).map((p) => p.userId);
1745
+ return kr(i) ? [] : (await ur(o, i)).map((p) => p.userId);
1746
1746
  const c = t[a];
1747
1747
  if (!c || !r) return [];
1748
- const d = c.taskId ? `task:${c.taskId}` : `project:${c.projectId}`, l = n.get(d) ?? kr(o, c, r.id);
1748
+ const d = c.taskId ? `task:${c.taskId}` : `project:${c.projectId}`, l = n.get(d) ?? wr(o, c, r.id);
1749
1749
  return n.set(d, l), await l;
1750
1750
  })
1751
1751
  );
1752
1752
  }
1753
- function Pr({ comments: e }) {
1753
+ function _r({ comments: e }) {
1754
1754
  const t = e.filter((c) => c.taskId).length, o = e.filter((c) => c.projectId).length, r = [];
1755
1755
  if (t > 0) {
1756
1756
  const c = t > 1 ? "comments" : "comment";
@@ -1766,7 +1766,13 @@ function Pr({ comments: e }) {
1766
1766
  const a = i.size > 1 ? "people" : "person";
1767
1767
  return `${n}. Notified ${i.size} ${a}`;
1768
1768
  }
1769
- const _r = {
1769
+ function U(e) {
1770
+ return s.string().transform((t) => t === "" ? void 0 : t).optional().describe(e);
1771
+ }
1772
+ function ls(e) {
1773
+ return e.description || void 0;
1774
+ }
1775
+ const Ur = {
1770
1776
  search: s.string().optional().describe(
1771
1777
  "Search for a filter by name (partial and case insensitive match). If omitted, all filters are returned."
1772
1778
  )
@@ -1774,17 +1780,20 @@ const _r = {
1774
1780
  id: s.string().describe("The unique ID of the filter."),
1775
1781
  name: s.string().describe("The name of the filter."),
1776
1782
  query: s.string().describe('The filter query string (e.g. "today & p1", "#Work & overdue").'),
1783
+ description: s.string().optional().describe(
1784
+ "A markdown description explaining what the filter is for. Omitted when the filter has none."
1785
+ ),
1777
1786
  color: he,
1778
1787
  isFavorite: s.boolean().describe("Whether the filter is marked as favorite."),
1779
1788
  itemOrder: s.number().describe("The display order of the filter.")
1780
- }), Ur = {
1789
+ }), Rr = {
1781
1790
  filters: s.array(it).describe("The found filters."),
1782
1791
  totalCount: s.number().describe("The total number of filters returned.")
1783
- }, Rr = {
1792
+ }, Lr = {
1784
1793
  name: g.FIND_FILTERS,
1785
1794
  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").',
1786
- parameters: _r,
1787
- outputSchema: Ur,
1795
+ parameters: Ur,
1796
+ outputSchema: Rr,
1788
1797
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
1789
1798
  async execute(e, t) {
1790
1799
  let r = ((await t.sync({ resourceTypes: ["filters"], syncToken: "*" })).filters ?? []).filter((a) => !a.isDeleted);
@@ -1797,12 +1806,13 @@ const _r = {
1797
1806
  id: a.id,
1798
1807
  name: a.name,
1799
1808
  query: a.query,
1809
+ description: ls(a),
1800
1810
  color: he.parse(a.color),
1801
1811
  isFavorite: a.isFavorite,
1802
1812
  itemOrder: a.itemOrder
1803
1813
  }));
1804
1814
  return {
1805
- textContent: Lr({ filters: n, search: e.search }),
1815
+ textContent: Nr({ filters: n, search: e.search }),
1806
1816
  structuredContent: {
1807
1817
  filters: n,
1808
1818
  totalCount: n.length
@@ -1810,7 +1820,7 @@ const _r = {
1810
1820
  };
1811
1821
  }
1812
1822
  };
1813
- function Lr({
1823
+ function Nr({
1814
1824
  filters: e,
1815
1825
  search: t
1816
1826
  }) {
@@ -1831,23 +1841,24 @@ ${n.map((i) => `- ${i}`).join(`
1831
1841
  return r.join(`
1832
1842
  `);
1833
1843
  }
1834
- const Nr = s.object({
1844
+ const Mr = s.object({
1835
1845
  name: s.string().min(1).describe("The name of the filter."),
1836
1846
  query: s.string().min(1).describe(
1837
1847
  'The filter query string. Examples: "today & p1", "#Work & overdue", "@email & today", "(p1 | p2) & !assigned". Operators: | (OR), & (AND), ! (NOT), () grouping, , (multiple queries).'
1838
1848
  ),
1849
+ description: U("A markdown description explaining what the filter is for."),
1839
1850
  color: pe,
1840
1851
  isFavorite: s.boolean().optional().describe("Whether to mark the filter as a favorite. Defaults to false.")
1841
- }), Mr = {
1842
- filters: s.array(Nr).min(1).describe("The array of filters to add.")
1843
- }, Fr = {
1852
+ }), Fr = {
1853
+ filters: s.array(Mr).min(1).describe("The array of filters to add.")
1854
+ }, Hr = {
1844
1855
  filters: s.array(it).describe("The created filters."),
1845
1856
  totalCount: s.number().describe("The total number of filters created.")
1846
- }, Hr = {
1857
+ }, Wr = {
1847
1858
  name: g.ADD_FILTERS,
1848
1859
  description: "Add one or more new personal filters. Filters are saved custom views using query syntax to organize tasks.",
1849
- parameters: Mr,
1850
- outputSchema: Fr,
1860
+ parameters: Fr,
1861
+ outputSchema: Hr,
1851
1862
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
1852
1863
  async execute({ filters: e }, t) {
1853
1864
  const o = Date.now(), r = e.map((p, h) => `tempFilterAdd${h}${o}`), n = e.map((p, h) => J(
@@ -1855,6 +1866,7 @@ const Nr = s.object({
1855
1866
  {
1856
1867
  name: p.name,
1857
1868
  query: p.query,
1869
+ ...p.description !== void 0 ? { description: p.description } : {},
1858
1870
  ...p.color !== void 0 ? { color: p.color } : {},
1859
1871
  ...p.isFavorite !== void 0 ? { isFavorite: p.isFavorite } : {}
1860
1872
  },
@@ -1867,6 +1879,10 @@ const Nr = s.object({
1867
1879
  id: y,
1868
1880
  name: p.name,
1869
1881
  query: p.query,
1882
+ // Omitted rather than null when absent: structured content is sanitised
1883
+ // with `removeNullFields`, so a null would be stripped and then fail
1884
+ // validation against the declared output schema.
1885
+ ...p.description ? { description: p.description } : {},
1870
1886
  color: f,
1871
1887
  isFavorite: p.isFavorite ?? !1,
1872
1888
  itemOrder: 0
@@ -1882,26 +1898,26 @@ ${l}`,
1882
1898
  }
1883
1899
  };
1884
1900
  }
1885
- }, Wr = s.object({
1901
+ }, Br = s.object({
1886
1902
  name: s.string().min(1).max(128).describe("The name of the label."),
1887
1903
  color: pe,
1888
1904
  order: s.number().int().optional().describe("The position of the label in the label list."),
1889
1905
  isFavorite: s.boolean().optional().describe("Whether the label is a favorite. Defaults to false.")
1890
- }), Br = {
1891
- labels: s.array(Wr).min(1).describe("The array of labels to add.")
1892
- }, zr = {
1906
+ }), zr = {
1907
+ labels: s.array(Br).min(1).describe("The array of labels to add.")
1908
+ }, Kr = {
1893
1909
  labels: s.array(me).describe("The created labels."),
1894
1910
  totalCount: s.number().describe("The total number of labels created.")
1895
- }, Kr = {
1911
+ }, Yr = {
1896
1912
  name: g.ADD_LABELS,
1897
1913
  description: "Add one or more new personal labels.",
1898
- parameters: Br,
1899
- outputSchema: zr,
1914
+ parameters: zr,
1915
+ outputSchema: Kr,
1900
1916
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
1901
1917
  async execute({ labels: e }, t) {
1902
1918
  const o = await Promise.all(e.map((n) => t.addLabel(n)));
1903
1919
  return {
1904
- textContent: Yr({ labels: o }),
1920
+ textContent: Gr({ labels: o }),
1905
1921
  structuredContent: {
1906
1922
  labels: o.map((n) => me.parse(n)),
1907
1923
  totalCount: o.length
@@ -1909,21 +1925,21 @@ ${l}`,
1909
1925
  };
1910
1926
  }
1911
1927
  };
1912
- function Yr({ labels: e }) {
1928
+ function Gr({ labels: e }) {
1913
1929
  const t = e.length, o = e.map((r) => `• ${r.name} (id=${r.id})`).join(`
1914
1930
  `);
1915
1931
  return `Added ${t} label${t === 1 ? "" : "s"}:
1916
1932
  ${o}`;
1917
1933
  }
1918
- const Gr = "[redacted]";
1934
+ const qr = "[redacted]";
1919
1935
  function te(e, t, o, r = {}) {
1920
1936
  if (o.length === 0)
1921
1937
  return;
1922
- const n = o.slice(0, uo.MAX_FAILURES_LOGGED);
1938
+ const n = o.slice(0, po.MAX_FAILURES_LOGGED);
1923
1939
  console.error(`${e}: items failed`, {
1924
1940
  failed: o.length,
1925
1941
  of: t,
1926
- sample: r.redactItems ? n.map((i) => ({ ...i, item: Gr })) : n
1942
+ sample: r.redactItems ? n.map((i) => ({ ...i, item: qr })) : n
1927
1943
  });
1928
1944
  }
1929
1945
  function de(e = /* @__PURE__ */ new Date()) {
@@ -1970,20 +1986,20 @@ function dt(e, t) {
1970
1986
  Failed (${t.length}) - address or drop these items:
1971
1987
  ${n}${i}`;
1972
1988
  }
1973
- function qr(e) {
1989
+ function Vr(e) {
1974
1990
  const t = e.content || e.title || "Untitled", o = e.dueDate ? ` • due ${e.dueDate}` : "", r = e.priority ? ` • ${e.priority.toUpperCase()}` : "", n = e.projectName ? ` • ${e.projectName}` : "", i = e.id ? ` • id=${e.id}` : "";
1975
1991
  return ` ${t}${o}${r}${n}${i}`;
1976
1992
  }
1977
- function Vr(e) {
1993
+ function Jr(e) {
1978
1994
  const t = ` (${e.color})`, o = e.isFavorite ? " • ⭐" : "", r = ` • id=${e.id}`;
1979
1995
  return ` ${e.name}${t}${o}${r}`;
1980
1996
  }
1981
- function Jr(e) {
1997
+ function Xr(e) {
1982
1998
  const t = e.inboxProject ? " • Inbox" : "", o = e.isFavorite ? " • ⭐" : "", r = e.isShared ? " • Shared" : "", n = e.isArchived ? " • Archived" : "", i = e.viewStyle && e.viewStyle !== "list" ? ` • ${e.viewStyle}` : "", a = ` • id=${e.id}`;
1983
1999
  return ` ${e.name}${t}${o}${r}${n}${i}${a}`;
1984
2000
  }
1985
2001
  function Ce(e, t = 5) {
1986
- const r = e.slice(0, t).map(qr).join(`
2002
+ const r = e.slice(0, t).map(Vr).join(`
1987
2003
  `);
1988
2004
  if (e.length > t) {
1989
2005
  const n = e.length - t;
@@ -2004,25 +2020,25 @@ function G({
2004
2020
  }) {
2005
2021
  const d = [], l = `${e}: ${t}${typeof o == "number" ? ` (limit ${o})` : ""}${r ? ", more available" : ""}.`;
2006
2022
  return d.push(l), n?.length && d.push(`Filter: ${n.join("; ")}.`), i?.length && d.push(`Preview:
2007
- ${i}`), !t && a?.length && d.push(`No results. ${a.join("; ")}.`), (c?.length || r) && d.push(ls(c || [], r)), d.join(`
2023
+ ${i}`), !t && a?.length && d.push(`No results. ${a.join("; ")}.`), (c?.length || r) && d.push(us(c || [], r)), d.join(`
2008
2024
  `);
2009
2025
  }
2010
- function ls(e, t) {
2026
+ function us(e, t) {
2011
2027
  const o = [...e];
2012
2028
  return t && o.push(`Pass cursor '${t}' to fetch more results.`), `${o.length === 1 ? "Possible suggested next step:" : "Possible suggested next steps:"}
2013
2029
  ${o.map((n) => `- ${n}`).join(`
2014
2030
  `)}`;
2015
2031
  }
2016
- const Xr = 300 * 1e3;
2017
- function Qr(e) {
2032
+ const Qr = 300 * 1e3;
2033
+ function Zr(e) {
2018
2034
  return /^\d+$/.test(e);
2019
2035
  }
2020
- class Zr {
2036
+ class en {
2021
2037
  constructor() {
2022
2038
  this.cache = null, this.inFlightWorkspaces = null;
2023
2039
  }
2024
2040
  async getWorkspaces(t) {
2025
- if (this.cache && Date.now() - this.cache.timestamp < Xr)
2041
+ if (this.cache && Date.now() - this.cache.timestamp < Qr)
2026
2042
  return this.cache.workspaces;
2027
2043
  if (this.inFlightWorkspaces)
2028
2044
  return this.inFlightWorkspaces;
@@ -2049,7 +2065,7 @@ class Zr {
2049
2065
  const n = await this.getWorkspaces(t), i = n.find((u) => u.id === r);
2050
2066
  if (i)
2051
2067
  return { workspaceId: i.id, workspaceName: i.name };
2052
- if (Qr(r))
2068
+ if (Zr(r))
2053
2069
  return { workspaceId: r, workspaceName: r };
2054
2070
  const a = r.toLowerCase(), c = n.find((u) => u.name.toLowerCase() === a);
2055
2071
  if (c)
@@ -2077,7 +2093,7 @@ ${u}` + (d.length > 5 ? `
2077
2093
  this.cache = null;
2078
2094
  }
2079
2095
  }
2080
- const us = new Zr(), en = s.object({
2096
+ const ps = new en(), tn = s.object({
2081
2097
  name: s.string().min(1).describe("The name of the project."),
2082
2098
  parentId: s.string().optional().describe("The ID of the parent project. If provided, creates this as a sub-project."),
2083
2099
  isFavorite: s.boolean().optional().describe("Whether the project is a favorite. Defaults to false."),
@@ -2087,9 +2103,9 @@ const us = new Zr(), en = s.object({
2087
2103
  workspace: s.string().trim().min(1).optional().describe(
2088
2104
  "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."
2089
2105
  )
2090
- }), tn = {
2091
- projects: s.array(en).min(1).describe("The array of projects to add.")
2092
- }, sn = {
2106
+ }), sn = {
2107
+ projects: s.array(tn).min(1).describe("The array of projects to add.")
2108
+ }, on = {
2093
2109
  projects: s.array(Z).describe("The created projects."),
2094
2110
  totalCount: s.number().describe("The total number of projects created."),
2095
2111
  failures: s.array(ee).describe(
@@ -2098,11 +2114,11 @@ const us = new Zr(), en = s.object({
2098
2114
  totalRequested: s.number().describe("The total number of projects requested."),
2099
2115
  successCount: s.number().describe("The number of successfully created projects."),
2100
2116
  failureCount: s.number().describe("The number of failed project creations.")
2101
- }, on = {
2117
+ }, rn = {
2102
2118
  name: g.ADD_PROJECTS,
2103
2119
  description: "Add one or more new projects.",
2104
- parameters: tn,
2105
- outputSchema: sn,
2120
+ parameters: sn,
2121
+ outputSchema: on,
2106
2122
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
2107
2123
  async execute({ projects: e }, t) {
2108
2124
  const o = /* @__PURE__ */ new Map(), r = (l) => {
@@ -2110,7 +2126,7 @@ const us = new Zr(), en = s.object({
2110
2126
  return Promise.resolve(void 0);
2111
2127
  let u = o.get(l);
2112
2128
  return u || (u = O(
2113
- () => us.resolveWorkspace(t, l)
2129
+ () => ps.resolveWorkspace(t, l)
2114
2130
  ).then(({ workspaceId: p }) => p), o.set(l, u)), u;
2115
2131
  }, n = await Promise.allSettled(
2116
2132
  e.map(async ({ workspace: l, ...u }) => {
@@ -2123,12 +2139,12 @@ const us = new Zr(), en = s.object({
2123
2139
  n.forEach((l, u) => {
2124
2140
  l.status === "fulfilled" ? i.push(l.value) : a.push({
2125
2141
  item: e[u]?.name ?? `Project ${u + 1}`,
2126
- error: R(l.reason)
2142
+ error: L(l.reason)
2127
2143
  });
2128
2144
  });
2129
2145
  const c = i.map(Q);
2130
2146
  return te(g.ADD_PROJECTS, e.length, a, { redactItems: !0 }), {
2131
- textContent: rn({ projects: i, failures: a }),
2147
+ textContent: nn({ projects: i, failures: a }),
2132
2148
  structuredContent: {
2133
2149
  projects: c,
2134
2150
  totalCount: c.length,
@@ -2140,7 +2156,7 @@ const us = new Zr(), en = s.object({
2140
2156
  };
2141
2157
  }
2142
2158
  };
2143
- function rn({
2159
+ function nn({
2144
2160
  projects: e,
2145
2161
  failures: t
2146
2162
  }) {
@@ -2149,12 +2165,12 @@ function rn({
2149
2165
  ${r}` : "Added 0 projects";
2150
2166
  return dt(n, t);
2151
2167
  }
2152
- const ve = 25, je = s.enum(Hs), ps = s.object({
2168
+ const ve = 25, je = s.enum(Ws), hs = s.object({
2153
2169
  date: s.string().optional().describe("Due date in YYYY-MM-DD format."),
2154
2170
  string: s.string().optional().describe('Natural language due string, e.g. "tomorrow at 3pm".'),
2155
2171
  timezone: s.string().optional().describe('Timezone for the reminder, e.g. "America/New_York".'),
2156
2172
  lang: s.string().optional().describe('Language for parsing the due string, e.g. "en".')
2157
- }), hs = s.enum(Ht), $e = s.boolean().optional().describe("Whether this is an urgent reminder. Applies to relative and absolute reminders."), nn = s.object({
2173
+ }), ms = s.enum(Ht), $e = s.boolean().optional().describe("Whether this is an urgent reminder. Applies to relative and absolute reminders."), an = s.object({
2158
2174
  type: s.literal("relative"),
2159
2175
  taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
2160
2176
  minuteOffset: s.number().int().min(0).describe(
@@ -2164,41 +2180,41 @@ const ve = 25, je = s.enum(Hs), ps = s.object({
2164
2180
  'Delivery method: "email" or "push" notification. Defaults to push.'
2165
2181
  ),
2166
2182
  isUrgent: $e
2167
- }), an = s.object({
2183
+ }), cn = s.object({
2168
2184
  type: s.literal("absolute"),
2169
2185
  taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
2170
- due: ps.describe("The specific date/time for the reminder."),
2186
+ due: hs.describe("The specific date/time for the reminder."),
2171
2187
  service: je.optional().describe(
2172
2188
  'Delivery method: "email" or "push" notification. Defaults to push.'
2173
2189
  ),
2174
2190
  isUrgent: $e
2175
- }), cn = s.object({
2191
+ }), dn = s.object({
2176
2192
  type: s.literal("location"),
2177
2193
  taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
2178
2194
  name: s.string().min(1).describe('Name of the location, e.g. "Office", "Home".'),
2179
2195
  locLat: s.string().describe('Latitude of the location as a string, e.g. "37.7749".'),
2180
2196
  locLong: s.string().describe('Longitude of the location as a string, e.g. "-122.4194".'),
2181
- locTrigger: hs.describe(
2197
+ locTrigger: ms.describe(
2182
2198
  'When to trigger: "on_enter" (arriving) or "on_leave" (departing).'
2183
2199
  ),
2184
2200
  radius: s.number().int().optional().describe("Radius in meters for the geofence. Defaults to server default.")
2185
- }), dn = s.discriminatedUnion("type", [
2186
- nn,
2201
+ }), ln = s.discriminatedUnion("type", [
2187
2202
  an,
2188
- cn
2189
- ]), ln = {
2190
- reminders: s.array(dn).min(1).max(ve).describe(
2203
+ cn,
2204
+ dn
2205
+ ]), un = {
2206
+ reminders: s.array(ln).min(1).max(ve).describe(
2191
2207
  `Array of reminders to create (max ${ve}). Each reminder must specify a type: "relative" (minutes before due), "absolute" (specific date/time), or "location" (geofence trigger).`
2192
2208
  )
2193
- }, un = {
2209
+ }, pn = {
2194
2210
  reminders: s.array(nt).describe("The created reminders."),
2195
2211
  totalCount: s.number().describe("Total number of reminders created."),
2196
2212
  addedReminderIds: s.array(s.string()).describe("IDs of the created reminders.")
2197
- }, pn = {
2213
+ }, hn = {
2198
2214
  name: g.ADD_REMINDERS,
2199
2215
  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.',
2200
- parameters: ln,
2201
- outputSchema: un,
2216
+ parameters: un,
2217
+ outputSchema: pn,
2202
2218
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
2203
2219
  async execute(e, t) {
2204
2220
  const { reminders: o } = e, r = o.map(async (c) => {
@@ -2231,7 +2247,7 @@ const ve = 25, je = s.enum(Hs), ps = s.object({
2231
2247
  }
2232
2248
  }), i = (await Promise.all(r)).map(ge);
2233
2249
  return {
2234
- textContent: hn(i),
2250
+ textContent: mn(i),
2235
2251
  structuredContent: {
2236
2252
  reminders: i,
2237
2253
  totalCount: i.length,
@@ -2240,7 +2256,7 @@ const ve = 25, je = s.enum(Hs), ps = s.object({
2240
2256
  };
2241
2257
  }
2242
2258
  };
2243
- function hn(e) {
2259
+ function mn(e) {
2244
2260
  const { timeBasedCount: t, locationCount: o } = cs(e), r = [];
2245
2261
  if (t > 0) {
2246
2262
  const n = t > 1 ? "reminders" : "reminder";
@@ -2252,15 +2268,15 @@ function hn(e) {
2252
2268
  }
2253
2269
  return r.length > 0 ? `Added ${r.join(" and ")}` : "No reminders added";
2254
2270
  }
2255
- const mn = s.object({
2271
+ const fn = s.object({
2256
2272
  name: s.string().min(1).describe("The name of the section."),
2257
2273
  projectId: s.string().min(1).describe(
2258
2274
  'The ID of the project to add the section to. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
2259
2275
  ),
2260
2276
  description: s.string().optional().describe("The description of the section. Supports Markdown.")
2261
- }), fn = {
2262
- sections: s.array(mn).min(1).describe("The array of sections to add.")
2263
- }, bn = {
2277
+ }), bn = {
2278
+ sections: s.array(fn).min(1).describe("The array of sections to add.")
2279
+ }, gn = {
2264
2280
  sections: s.array(K).describe("The created sections."),
2265
2281
  totalCount: s.number().describe("The total number of sections created."),
2266
2282
  failures: s.array(ee).describe(
@@ -2269,11 +2285,11 @@ const mn = s.object({
2269
2285
  totalRequested: s.number().describe("The total number of sections requested."),
2270
2286
  successCount: s.number().describe("The number of successfully created sections."),
2271
2287
  failureCount: s.number().describe("The number of failed section creations.")
2272
- }, gn = {
2288
+ }, yn = {
2273
2289
  name: g.ADD_SECTIONS,
2274
2290
  description: "Add one or more new sections to projects.",
2275
- parameters: fn,
2276
- outputSchema: bn,
2291
+ parameters: bn,
2292
+ outputSchema: gn,
2277
2293
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
2278
2294
  async execute({ sections: e }, t) {
2279
2295
  const o = e.some((c) => H(c.projectId)) ? O(() => t.getUser()) : void 0, r = await Promise.allSettled(
@@ -2289,10 +2305,10 @@ const mn = s.object({
2289
2305
  return r.forEach((c, d) => {
2290
2306
  c.status === "fulfilled" ? n.push(c.value) : i.push({
2291
2307
  item: e[d]?.name ?? `Section ${d + 1}`,
2292
- error: R(c.reason)
2308
+ error: L(c.reason)
2293
2309
  });
2294
2310
  }), te(g.ADD_SECTIONS, e.length, i, { redactItems: !0 }), {
2295
- textContent: yn({ sections: n, failures: i }),
2311
+ textContent: Tn({ sections: n, failures: i }),
2296
2312
  structuredContent: {
2297
2313
  sections: n.map(Y),
2298
2314
  totalCount: n.length,
@@ -2304,7 +2320,7 @@ const mn = s.object({
2304
2320
  };
2305
2321
  }
2306
2322
  };
2307
- function yn({
2323
+ function Tn({
2308
2324
  sections: e,
2309
2325
  failures: t
2310
2326
  }) {
@@ -2322,7 +2338,7 @@ const ae = {
2322
2338
  PROJECT_NOT_FOUND: "PROJECT_NOT_FOUND",
2323
2339
  TASK_NOT_FOUND: "TASK_NOT_FOUND"
2324
2340
  };
2325
- class Tn {
2341
+ class kn {
2326
2342
  /**
2327
2343
  * Validate a single assignment operation
2328
2344
  */
@@ -2531,59 +2547,55 @@ class Tn {
2531
2547
  };
2532
2548
  }
2533
2549
  }
2534
- const lt = new Tn();
2535
- function N(e) {
2536
- return s.string().transform((t) => t === "" ? void 0 : t).optional().describe(e);
2537
- }
2538
- const It = qt.TASKS_PER_OPERATION, kn = s.object({
2550
+ const lt = new kn(), It = qt.TASKS_PER_OPERATION, wn = s.object({
2539
2551
  content: s.string().min(1).describe(
2540
2552
  '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.'
2541
2553
  ),
2542
- description: N(
2554
+ description: U(
2543
2555
  "Additional details, notes, or context for the task. Use this for longer content rather than putting it in the task name. Supports Markdown."
2544
2556
  ),
2545
2557
  priority: tt.optional().describe(et),
2546
- dueString: N(
2558
+ dueString: U(
2547
2559
  'The due date for the task, in natural language. Also use natural language for recurrences; do not prefix it with "recurring".'
2548
2560
  ),
2549
- deadlineDate: N(
2561
+ deadlineDate: U(
2550
2562
  '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.'
2551
2563
  ),
2552
- duration: N(
2564
+ duration: U(
2553
2565
  'The duration of the task. Use format: "2h" (hours), "90m" (minutes), "2h30m" (combined), or "1.5h" (decimal hours). Max 24h.'
2554
2566
  ),
2555
2567
  labels: s.array(s.string()).optional().describe("The labels to attach to the task."),
2556
- projectId: N(
2568
+ projectId: U(
2557
2569
  'The project ID to add this task to. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
2558
2570
  ),
2559
- sectionId: N("The section ID to add this task to."),
2560
- parentId: N("The parent task ID (for subtasks)."),
2571
+ sectionId: U("The section ID to add this task to."),
2572
+ parentId: U("The parent task ID (for subtasks)."),
2561
2573
  order: s.number().optional().describe("Position of the task among sibling tasks under the same parent/section."),
2562
- responsibleUser: N(
2574
+ responsibleUser: U(
2563
2575
  'Assign task to this user. Can be "me" (assigns to current user), a user ID, name, or email address. User must be a collaborator on the target project.'
2564
2576
  ),
2565
2577
  isUncompletable: s.boolean().optional().describe(
2566
2578
  "Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
2567
2579
  )
2568
2580
  }), St = {
2569
- tasks: s.array(kn).min(1).max(It).describe(`The array of tasks to add (max ${It}).`)
2570
- }, wn = {
2581
+ tasks: s.array(wn).min(1).max(It).describe(`The array of tasks to add (max ${It}).`)
2582
+ }, vn = {
2571
2583
  tasks: s.array(B).describe("The created tasks."),
2572
2584
  totalCount: s.number().describe("The total number of tasks created."),
2573
2585
  failures: s.array(ee).describe("Failed task creations with error details."),
2574
2586
  totalRequested: s.number().describe("The total number of tasks requested."),
2575
2587
  successCount: s.number().describe("The number of successfully created tasks."),
2576
2588
  failureCount: s.number().describe("The number of failed task creations.")
2577
- }, vn = {
2589
+ }, In = {
2578
2590
  name: g.ADD_TASKS,
2579
2591
  description: "Add one or more tasks to a project, section, or parent. Supports assignment to project collaborators.",
2580
2592
  parameters: St,
2581
- outputSchema: wn,
2593
+ outputSchema: vn,
2582
2594
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
2583
2595
  async execute(e, t) {
2584
2596
  const { tasks: o } = s.object(St).parse(e), r = /* @__PURE__ */ new Map();
2585
2597
  o.forEach((h, m) => {
2586
- const y = In(h), f = r.get(y);
2598
+ const y = Sn(h), f = r.get(y);
2587
2599
  f ? f.push({ task: h, index: m }) : r.set(y, [{ task: h, index: m }]);
2588
2600
  });
2589
2601
  const n = /* @__PURE__ */ new Map(), a = (await Promise.all(
@@ -2591,7 +2603,7 @@ const It = qt.TASKS_PER_OPERATION, kn = s.object({
2591
2603
  const m = [];
2592
2604
  for (const { task: y, index: f } of h)
2593
2605
  try {
2594
- const w = await Sn(y, t, n);
2606
+ const w = await Cn(y, t, n);
2595
2607
  m.push({ index: f, result: { status: "fulfilled", value: w } });
2596
2608
  } catch (w) {
2597
2609
  m.push({
@@ -2609,7 +2621,7 @@ const It = qt.TASKS_PER_OPERATION, kn = s.object({
2609
2621
  // Keep API error signals (status/code/tag) — `error.message`
2610
2622
  // alone collapses e.g. a full-project rejection into a bare
2611
2623
  // "HTTP 403: Forbidden"
2612
- error: R(m.reason)
2624
+ error: L(m.reason)
2613
2625
  }));
2614
2626
  if (c.length === 0 && d.length > 0) {
2615
2627
  const h = d.map((y) => `"${y.item}": ${y.error}`).join("; "), m = `All ${d.length} task(s) failed to create: ${h}`;
@@ -2617,7 +2629,7 @@ const It = qt.TASKS_PER_OPERATION, kn = s.object({
2617
2629
  }
2618
2630
  const u = c.map(P);
2619
2631
  return te(g.ADD_TASKS, o.length, d, { redactItems: !0 }), {
2620
- textContent: Cn({
2632
+ textContent: jn({
2621
2633
  tasks: u,
2622
2634
  failures: d,
2623
2635
  args: { tasks: o }
@@ -2633,10 +2645,10 @@ const It = qt.TASKS_PER_OPERATION, kn = s.object({
2633
2645
  };
2634
2646
  }
2635
2647
  };
2636
- function In(e) {
2648
+ function Sn(e) {
2637
2649
  return `${e.projectId ?? ""}|${e.sectionId ?? ""}|${e.parentId ?? ""}`;
2638
2650
  }
2639
- async function Sn(e, t, o) {
2651
+ async function Cn(e, t, o) {
2640
2652
  const {
2641
2653
  duration: r,
2642
2654
  projectId: n,
@@ -2714,7 +2726,7 @@ async function Sn(e, t, o) {
2714
2726
  try {
2715
2727
  return await t.addTask(y);
2716
2728
  } catch (f) {
2717
- const w = io(f, {
2729
+ const w = ao(f, {
2718
2730
  taskContent: e.content,
2719
2731
  dueString: e.dueString,
2720
2732
  deadlineDate: e.deadlineDate
@@ -2722,7 +2734,7 @@ async function Sn(e, t, o) {
2722
2734
  throw w ? new Ie(w) : f;
2723
2735
  }
2724
2736
  }
2725
- function Cn({
2737
+ function jn({
2726
2738
  tasks: e,
2727
2739
  failures: t,
2728
2740
  args: o
@@ -2747,11 +2759,11 @@ function Cn({
2747
2759
  showDetails: !0
2748
2760
  });
2749
2761
  }
2750
- const jn = {
2762
+ const $n = {
2751
2763
  projectId: s.string().min(1).describe(
2752
2764
  "The ID of the project to analyze. This triggers a new health analysis which may take some time to complete."
2753
2765
  )
2754
- }, $n = {
2766
+ }, Dn = {
2755
2767
  projectId: s.string().describe("The project ID."),
2756
2768
  health: s.object({
2757
2769
  status: s.enum(Xe).describe("The health status after triggering analysis."),
@@ -2759,11 +2771,11 @@ const jn = {
2759
2771
  updateInProgress: s.boolean().describe("Whether an analysis update is currently in progress.")
2760
2772
  }).describe("The health response returned after triggering analysis."),
2761
2773
  message: s.string().describe("A human-readable message about the analysis status.")
2762
- }, Dn = {
2774
+ }, An = {
2763
2775
  name: g.ANALYZE_PROJECT_HEALTH,
2764
2776
  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.",
2765
- parameters: jn,
2766
- outputSchema: $n,
2777
+ parameters: $n,
2778
+ outputSchema: Dn,
2767
2779
  annotations: {
2768
2780
  readOnlyHint: !1,
2769
2781
  destructiveHint: !1,
@@ -2786,19 +2798,19 @@ ${n}`,
2786
2798
  }
2787
2799
  };
2788
2800
  }
2789
- }, An = {
2790
- ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to complete.")
2791
2801
  }, xn = {
2802
+ ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to complete.")
2803
+ }, En = {
2792
2804
  completed: s.array(s.string()).describe("The IDs of successfully completed tasks."),
2793
2805
  failures: s.array(ee).describe("Failed task completions with error details."),
2794
2806
  totalRequested: s.number().describe("The total number of tasks requested to complete."),
2795
2807
  successCount: s.number().describe("The number of successfully completed tasks."),
2796
2808
  failureCount: s.number().describe("The number of failed task completions.")
2797
- }, En = {
2809
+ }, On = {
2798
2810
  name: g.COMPLETE_TASKS,
2799
2811
  description: "Complete one or more tasks by their IDs.",
2800
- parameters: An,
2801
- outputSchema: xn,
2812
+ parameters: xn,
2813
+ outputSchema: En,
2802
2814
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
2803
2815
  async execute(e, t) {
2804
2816
  const o = [], r = [];
@@ -2808,11 +2820,11 @@ ${n}`,
2808
2820
  } catch (a) {
2809
2821
  r.push({
2810
2822
  item: i,
2811
- error: R(a)
2823
+ error: L(a)
2812
2824
  });
2813
2825
  }
2814
2826
  return te(g.COMPLETE_TASKS, e.ids.length, r), {
2815
- textContent: On({
2827
+ textContent: Pn({
2816
2828
  completed: o,
2817
2829
  failures: r,
2818
2830
  args: e
@@ -2827,7 +2839,7 @@ ${n}`,
2827
2839
  };
2828
2840
  }
2829
2841
  };
2830
- function On({
2842
+ function Pn({
2831
2843
  completed: e,
2832
2844
  failures: t,
2833
2845
  args: o
@@ -2840,7 +2852,7 @@ function On({
2840
2852
  failures: t
2841
2853
  });
2842
2854
  }
2843
- const ms = [
2855
+ const fs = [
2844
2856
  "project",
2845
2857
  "section",
2846
2858
  "task",
@@ -2849,20 +2861,20 @@ const ms = [
2849
2861
  "filter",
2850
2862
  "reminder",
2851
2863
  "location_reminder"
2852
- ], Pn = {
2853
- type: s.enum(ms).describe("The type of entity to delete."),
2864
+ ], _n = {
2865
+ type: s.enum(fs).describe("The type of entity to delete."),
2854
2866
  id: s.string().min(1).describe("The ID of the entity to delete.")
2855
- }, _n = {
2867
+ }, Un = {
2856
2868
  deletedEntity: s.object({
2857
- type: s.enum(ms).describe("The type of deleted entity."),
2869
+ type: s.enum(fs).describe("The type of deleted entity."),
2858
2870
  id: s.string().describe("The ID of the deleted entity.")
2859
2871
  }).describe("Information about the deleted entity."),
2860
2872
  success: s.boolean().describe("Whether the deletion was successful.")
2861
- }, Un = {
2873
+ }, Rn = {
2862
2874
  name: g.DELETE_OBJECT,
2863
2875
  description: "Delete a project, section, task, comment, label, filter, reminder, or location_reminder by its ID. Projects can be deleted whether active or archived (find archived ones via find-projects with archivedStatus); note a workspace project must be archived before it can be deleted, while personal projects can be deleted regardless.",
2864
- parameters: Pn,
2865
- outputSchema: _n,
2876
+ parameters: _n,
2877
+ outputSchema: Un,
2866
2878
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !0 },
2867
2879
  async execute(e, t) {
2868
2880
  switch (e.type) {
@@ -2907,25 +2919,25 @@ const ms = [
2907
2919
  }
2908
2920
  };
2909
2921
  }
2910
- }, Ct = 5, fs = ["file", "url"], Rn = {
2922
+ }, Ct = 5, bs = ["file", "url"], Ln = {
2911
2923
  projectId: s.string().min(1).describe("The ID of the project to export as a template."),
2912
- format: s.enum(fs).default("file").describe(
2924
+ format: s.enum(bs).default("file").describe(
2913
2925
  'How to return the template. "file" returns the CSV content, which can be passed straight back to import-project-template. "url" returns a shareable download link instead, and is the better choice for large projects because it does not return the whole file.'
2914
2926
  ),
2915
2927
  useRelativeDates: s.boolean().optional().describe(
2916
2928
  'Export due dates relative to the import date (e.g. "day 3") instead of absolute dates. Defaults to false.'
2917
2929
  )
2918
- }, Ln = {
2919
- format: s.enum(fs).describe("The format the template was exported in."),
2930
+ }, Nn = {
2931
+ format: s.enum(bs).describe("The format the template was exported in."),
2920
2932
  content: s.string().optional().describe('The template as CSV content. Only present when format is "file".'),
2921
2933
  lineCount: s.number().optional().describe('Number of rows in the exported CSV. Only present when format is "file".'),
2922
2934
  fileName: s.string().optional().describe('The generated template file name. Only present when format is "url".'),
2923
2935
  fileUrl: s.string().optional().describe('The shareable download URL. Only present when format is "url".')
2924
- }, Nn = {
2936
+ }, Mn = {
2925
2937
  name: g.EXPORT_PROJECT_TEMPLATE,
2926
2938
  description: "Export an existing project as a Todoist template, either as CSV content or as a shareable URL. Use it to duplicate a project, share its structure, or hand the CSV to import-project-template. To read a project rather than export it, use find-tasks instead — it returns structured tasks rather than raw CSV. Nothing is modified.",
2927
- parameters: Rn,
2928
- outputSchema: Ln,
2939
+ parameters: Ln,
2940
+ outputSchema: Nn,
2929
2941
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
2930
2942
  // `format` is defaulted here as well as in the schema: scripts/run-tool.ts calls
2931
2943
  // execute() with raw JSON, so schema defaults are not applied on that path.
@@ -2946,12 +2958,12 @@ ${c}`,
2946
2958
  return {
2947
2959
  // The full CSV already ships in structuredContent; a preview here keeps a large
2948
2960
  // project from being spelled out twice in the response.
2949
- textContent: Mn({ projectId: e, lines: i }),
2961
+ textContent: Fn({ projectId: e, lines: i }),
2950
2962
  structuredContent: { format: t, content: n, lineCount: i.length }
2951
2963
  };
2952
2964
  }
2953
2965
  };
2954
- function Mn({ projectId: e, lines: t }) {
2966
+ function Fn({ projectId: e, lines: t }) {
2955
2967
  const o = `Exported project (id=${e}) as a template file (${t.length} row${t.length === 1 ? "" : "s"}).`, r = t.slice(0, Ct).join(`
2956
2968
  `), n = t.length - Ct;
2957
2969
  return n > 0 ? `${o}
@@ -2961,7 +2973,7 @@ ${r}
2961
2973
 
2962
2974
  ${r}`;
2963
2975
  }
2964
- const Fn = B.pick({
2976
+ const Hn = B.pick({
2965
2977
  id: !0,
2966
2978
  content: !0,
2967
2979
  dueDate: !0,
@@ -2970,15 +2982,15 @@ const Fn = B.pick({
2970
2982
  hasChildren: s.boolean().describe(
2971
2983
  "Whether this subtask has subtasks of its own. Fetch it with includeChildren to expand."
2972
2984
  )
2973
- }), Hn = Z.pick({ id: !0, name: !0 }).extend({
2985
+ }), Wn = Z.pick({ id: !0, name: !0 }).extend({
2974
2986
  hasChildren: s.boolean().describe(
2975
2987
  "Whether this sub-project has sub-projects of its own. Fetch it with includeChildren to expand."
2976
2988
  )
2977
- }), Wn = {
2989
+ }), Bn = {
2978
2990
  childCount: s.number().optional().describe(
2979
2991
  "The number of direct children listed in children. Only present when children were requested and the type supports them. 0 means the object definitively has none."
2980
2992
  ),
2981
- children: s.array(s.union([Fn, Hn])).optional().describe(
2993
+ children: s.array(s.union([Hn, Wn])).optional().describe(
2982
2994
  "Direct children only: subtasks for a task, sub-projects for a project. Completed subtasks and archived sub-projects are excluded."
2983
2995
  ),
2984
2996
  hasMoreChildren: s.boolean().optional().describe(
@@ -2988,7 +3000,7 @@ const Fn = B.pick({
2988
3000
  'Present when the children lookup failed or returned incomplete information. When no children are listed alongside it, childCount is unknown - do not read its absence as "no children".'
2989
3001
  )
2990
3002
  };
2991
- async function Bn(e, t) {
3003
+ async function zn(e, t) {
2992
3004
  const { results: o, nextCursor: r } = await e.getTasks({
2993
3005
  parentId: t,
2994
3006
  limit: j.CHILDREN_MAX
@@ -3011,7 +3023,7 @@ async function Bn(e, t) {
3011
3023
  childrenError: i ? `Could not check ${i} of ${o.length} subtasks for subtasks of their own; those are reported as hasChildren=false.` : void 0
3012
3024
  };
3013
3025
  }
3014
- async function zn(e, t) {
3026
+ async function Kn(e, t) {
3015
3027
  if (!z(t))
3016
3028
  return { childCount: 0, children: [] };
3017
3029
  const o = await as(e), r = /* @__PURE__ */ new Map();
@@ -3044,22 +3056,22 @@ function $t(e, t) {
3044
3056
  const o = t.hasMoreChildren ? "+" : "", r = t.childrenError ? " (partial)" : "";
3045
3057
  return ` • ${e}=${t.childCount}${o}${r}`;
3046
3058
  }
3047
- const bs = ["task", "project", "comment", "section"], Kn = {
3048
- type: s.enum(bs).describe("The type of object to fetch."),
3059
+ const gs = ["task", "project", "comment", "section"], Yn = {
3060
+ type: s.enum(gs).describe("The type of object to fetch."),
3049
3061
  id: s.string().min(1).describe("The unique ID of the object to fetch."),
3050
3062
  includeChildren: s.boolean().optional().describe(
3051
3063
  "Also return the direct children of the object: subtasks for a task, sub-projects for a project. Returns childCount plus a compact list, flagging each child that has children of its own. Use this to check whether a task hides subtasks instead of a speculative find-tasks lookup. Ignored for comments and sections."
3052
3064
  )
3053
- }, Yn = {
3054
- type: s.enum(bs).describe("The type of object fetched."),
3065
+ }, Gn = {
3066
+ type: s.enum(gs).describe("The type of object fetched."),
3055
3067
  id: s.string().describe("The ID of the fetched object."),
3056
3068
  object: s.union([B, Z, Te, K]).describe("The fetched object data."),
3057
- ...Wn
3058
- }, Gn = {
3069
+ ...Bn
3070
+ }, qn = {
3059
3071
  name: g.FETCH_OBJECT,
3060
3072
  description: "Fetch a single task, project, comment, or section by its ID. Use this when you have a specific object ID and want to retrieve its full details. Set includeChildren to also get its direct subtasks or sub-projects.",
3061
- parameters: Kn,
3062
- outputSchema: Yn,
3073
+ parameters: Yn,
3074
+ outputSchema: Gn,
3063
3075
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3064
3076
  async execute(e, t) {
3065
3077
  const { type: o, id: r, includeChildren: n } = e;
@@ -3068,7 +3080,7 @@ const bs = ["task", "project", "comment", "section"], Kn = {
3068
3080
  case "task": {
3069
3081
  const [i, a] = await Promise.all([
3070
3082
  t.getTask(r),
3071
- n ? jt(() => Bn(t, r)) : Promise.resolve({})
3083
+ n ? jt(() => zn(t, r)) : Promise.resolve({})
3072
3084
  ]), c = P(i);
3073
3085
  return {
3074
3086
  textContent: `Found task: ${c.content} • id=${c.id} • priority=${c.priority} • project=${c.projectId}${$t("subtasks", a)}`,
@@ -3081,7 +3093,7 @@ const bs = ["task", "project", "comment", "section"], Kn = {
3081
3093
  };
3082
3094
  }
3083
3095
  case "project": {
3084
- const i = await t.getProject(r), a = Q(i), c = n ? await jt(() => zn(t, i)) : {};
3096
+ const i = await t.getProject(r), a = Q(i), c = n ? await jt(() => Kn(t, i)) : {};
3085
3097
  return {
3086
3098
  textContent: `Found project: ${a.name} • id=${a.id} • color=${a.color} • viewStyle=${a.viewStyle}${$t("subProjects", c)}`,
3087
3099
  structuredContent: {
@@ -3124,21 +3136,21 @@ const bs = ["task", "project", "comment", "section"], Kn = {
3124
3136
  );
3125
3137
  }
3126
3138
  }
3127
- }, qn = {
3139
+ }, Vn = {
3128
3140
  id: s.string().min(1).describe(
3129
3141
  'A unique identifier for the document in the format "task:{id}" or "project:{id}".'
3130
3142
  )
3131
- }, Vn = {
3143
+ }, Jn = {
3132
3144
  id: s.string().describe("The ID of the fetched document."),
3133
3145
  title: s.string().describe("The title of the document."),
3134
3146
  text: s.string().describe("The text content of the document."),
3135
3147
  url: s.string().describe("The URL of the document."),
3136
3148
  metadata: s.record(s.string(), s.unknown()).optional().describe("Additional metadata about the document.")
3137
- }, Jn = {
3149
+ }, Xn = {
3138
3150
  name: g.FETCH,
3139
3151
  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}".',
3140
- parameters: qn,
3141
- outputSchema: Vn,
3152
+ parameters: Vn,
3153
+ outputSchema: Jn,
3142
3154
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3143
3155
  async execute(e, t) {
3144
3156
  const { id: o } = e, [r, n] = o.split(":", 2);
@@ -3198,11 +3210,11 @@ Favorite: Yes`), i = {
3198
3210
  structuredContent: i
3199
3211
  };
3200
3212
  }
3201
- }, Xn = s.union([s.iso.date(), s.iso.datetime({ offset: !0 })]);
3213
+ }, Qn = s.union([s.iso.date(), s.iso.datetime({ offset: !0 })]);
3202
3214
  function Dt(e) {
3203
- return N(e).pipe(Xn.optional());
3215
+ return U(e).pipe(Qn.optional());
3204
3216
  }
3205
- const Qn = {
3217
+ const Zn = {
3206
3218
  objectType: s.enum(["task", "project", "comment"]).optional().describe("Type of object to filter by."),
3207
3219
  objectId: s.string().optional().describe("Filter by specific object ID (task, project, or comment)."),
3208
3220
  eventType: s.enum([
@@ -3229,17 +3241,17 @@ const Qn = {
3229
3241
  ),
3230
3242
  limit: s.number().int().min(1).max(j.ACTIVITY_MAX).default(j.ACTIVITY_DEFAULT).describe("Maximum number of activity events to return."),
3231
3243
  cursor: s.string().optional().describe("Pagination cursor for retrieving the next page of results.")
3232
- }, Zn = {
3233
- events: s.array(Cr).describe("The activity events."),
3244
+ }, ei = {
3245
+ events: s.array(jr).describe("The activity events."),
3234
3246
  nextCursor: s.string().optional(),
3235
3247
  totalCount: s.number().describe("The total number of events in this page."),
3236
3248
  hasMore: s.boolean(),
3237
3249
  appliedFilters: s.record(s.string(), s.unknown())
3238
- }, ei = {
3250
+ }, ti = {
3239
3251
  name: g.FIND_ACTIVITY,
3240
3252
  description: `Retrieve activity logs to monitor and audit changes in Todoist. Shows events from all users by default (use initiatorId to filter by specific user). To answer what someone completed in a period, including recurring task occurrences, use objectType "task", eventType "completed", and dateFrom/dateTo. For a first-person question ("what did I get done"), also set initiatorId to the current user from user-info, or the answer includes collaborators' completions. Track task completions, updates, deletions, project changes, and more with flexible filtering. Activity history availability and retention depend on the user plan.`,
3241
- parameters: Qn,
3242
- outputSchema: Zn,
3253
+ parameters: Zn,
3254
+ outputSchema: ei,
3243
3255
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3244
3256
  async execute(e, t) {
3245
3257
  const {
@@ -3258,9 +3270,9 @@ const Qn = {
3258
3270
  cursor: p ?? null
3259
3271
  };
3260
3272
  o && n ? h.objectEventTypes = `${o}:${n}` : o ? h.objectEventTypes = `${o}:` : n && (h.objectEventTypes = `:${n}`), r && r !== "remove" && (h.objectId = r), i && (h.parentProjectId = i), a && (h.parentItemId = a), c && (h.initiatorId = c), d && (h.dateFrom = d), l && (h.dateTo = l);
3261
- const { results: m, nextCursor: y } = await t.getActivityLogs(h), f = m.map(gr);
3273
+ const { results: m, nextCursor: y } = await t.getActivityLogs(h), f = m.map(yr);
3262
3274
  return {
3263
- textContent: ti({ events: f, args: e, nextCursor: y }),
3275
+ textContent: si({ events: f, args: e, nextCursor: y }),
3264
3276
  structuredContent: {
3265
3277
  events: f,
3266
3278
  nextCursor: y ?? void 0,
@@ -3271,7 +3283,7 @@ const Qn = {
3271
3283
  };
3272
3284
  }
3273
3285
  };
3274
- function ti({
3286
+ function si({
3275
3287
  events: e,
3276
3288
  args: t,
3277
3289
  nextCursor: o
@@ -3292,12 +3304,12 @@ function ti({
3292
3304
  limit: t.limit,
3293
3305
  nextCursor: o ?? void 0,
3294
3306
  filterHints: i,
3295
- previewLines: si(e, Math.min(e.length, t.limit)),
3307
+ previewLines: oi(e, Math.min(e.length, t.limit)),
3296
3308
  zeroReasonHints: a
3297
3309
  });
3298
3310
  }
3299
- function si(e, t = 10) {
3300
- const r = e.slice(0, t).map(oi).join(`
3311
+ function oi(e, t = 10) {
3312
+ const r = e.slice(0, t).map(ri).join(`
3301
3313
  `);
3302
3314
  if (e.length > t) {
3303
3315
  const n = e.length - t;
@@ -3306,8 +3318,8 @@ function si(e, t = 10) {
3306
3318
  }
3307
3319
  return r;
3308
3320
  }
3309
- function oi(e) {
3310
- const t = ri(e.eventDate), o = `${e.eventType} ${e.objectType}`;
3321
+ function ri(e) {
3322
+ const t = ni(e.eventDate), o = `${e.eventType} ${e.objectType}`;
3311
3323
  let r = "";
3312
3324
  if (e.extraData) {
3313
3325
  const c = e.extraData.content || e.extraData.name || e.extraData.last_content;
@@ -3316,7 +3328,7 @@ function oi(e) {
3316
3328
  const n = e.objectId ? ` • id=${e.objectId}` : "", i = e.initiatorId ? ` • by=${e.initiatorId}` : " • system", a = e.parentProjectId ? ` • project=${e.parentProjectId}` : "";
3317
3329
  return ` [${t}] ${o}${r}${n}${i}${a}`;
3318
3330
  }
3319
- function ri(e) {
3331
+ function ni(e) {
3320
3332
  try {
3321
3333
  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", {
3322
3334
  hour: "2-digit",
@@ -3329,7 +3341,7 @@ function ri(e) {
3329
3341
  return e;
3330
3342
  }
3331
3343
  }
3332
- const ni = {
3344
+ const ii = {
3333
3345
  taskId: s.string().optional().describe("Find comments for a specific task."),
3334
3346
  projectId: s.string().optional().describe(
3335
3347
  'Find comments for a specific project. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
@@ -3337,7 +3349,7 @@ const ni = {
3337
3349
  commentId: s.string().optional().describe("Get a specific comment by ID."),
3338
3350
  cursor: s.string().optional().describe("Pagination cursor for retrieving more results."),
3339
3351
  limit: s.number().int().min(1).max(j.COMMENTS_MAX).optional().describe("Maximum number of comments to return")
3340
- }, ii = {
3352
+ }, ai = {
3341
3353
  comments: s.array(Te).describe("The found comments."),
3342
3354
  searchType: s.string().describe(
3343
3355
  'The type of search performed: "single" (comment ID), "task" (task ID), or "project" (project ID).'
@@ -3346,11 +3358,11 @@ const ni = {
3346
3358
  hasMore: s.boolean(),
3347
3359
  nextCursor: s.string().optional(),
3348
3360
  totalCount: s.number().describe("The total number of comments in this page.")
3349
- }, ai = {
3361
+ }, ci = {
3350
3362
  name: g.FIND_COMMENTS,
3351
3363
  description: "Find comments by task, project, or get a specific comment by ID. Exactly one of taskId, projectId, or commentId must be provided.",
3352
- parameters: ni,
3353
- outputSchema: ii,
3364
+ parameters: ii,
3365
+ outputSchema: ai,
3354
3366
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3355
3367
  async execute(e, t) {
3356
3368
  const o = [e.taskId, e.projectId, e.commentId].filter(Boolean);
@@ -3385,7 +3397,7 @@ const ni = {
3385
3397
  throw new Error("Invalid state: no search parameter provided");
3386
3398
  const c = a.map(ye);
3387
3399
  return {
3388
- textContent: ci({
3400
+ textContent: di({
3389
3401
  comments: c,
3390
3402
  searchType: e.commentId ? "single" : e.taskId ? "task" : "project",
3391
3403
  searchId: e.commentId || e.taskId || e.projectId || "",
@@ -3403,7 +3415,7 @@ const ni = {
3403
3415
  };
3404
3416
  }
3405
3417
  };
3406
- function ci({
3418
+ function di({
3407
3419
  comments: e,
3408
3420
  searchType: t,
3409
3421
  searchId: o,
@@ -3423,37 +3435,37 @@ function ci({
3423
3435
  i = `Found ${e.length} ${d} for ${t} ${o}${c}`, r && (i += " • More available");
3424
3436
  }
3425
3437
  if (n) {
3426
- const a = ls([], n);
3438
+ const a = us([], n);
3427
3439
  return `${i}
3428
3440
  ${a}`;
3429
3441
  }
3430
3442
  return i;
3431
3443
  }
3432
- function gs(e) {
3444
+ function ys(e) {
3433
3445
  const t = e.getUTCFullYear(), o = String(e.getUTCMonth() + 1).padStart(2, "0"), r = String(e.getUTCDate()).padStart(2, "0");
3434
3446
  return `${t}-${o}-${r}`;
3435
3447
  }
3436
- function di(e) {
3448
+ function li(e) {
3437
3449
  const t = /^([+-])(\d{2}):(\d{2})$/.exec(e);
3438
3450
  if (!t)
3439
3451
  return 0;
3440
3452
  const [, o, r, n] = t, i = Number(r) * 60 + Number(n);
3441
3453
  return o === "-" ? -i : i;
3442
3454
  }
3443
- function li(e, t) {
3455
+ function ui(e, t) {
3444
3456
  const o = new Date(e.getTime() + t * 60 * 1e3);
3445
- return gs(o);
3457
+ return ys(o);
3446
3458
  }
3447
3459
  function At(e, t) {
3448
3460
  const [o, r, n] = e.split("-"), i = Number(o), a = Number(r), c = Number(n);
3449
3461
  if (!Number.isFinite(i) || !Number.isFinite(a) || !Number.isFinite(c))
3450
3462
  throw new Error(`Invalid date format: ${e}. Expected YYYY-MM-DD.`);
3451
3463
  const d = new Date(Date.UTC(i, a - 1, c));
3452
- return d.setUTCDate(d.getUTCDate() + t), gs(d);
3464
+ return d.setUTCDate(d.getUTCDate() + t), ys(d);
3453
3465
  }
3454
- const ui = ["and", "or"], ut = {
3466
+ const pi = ["and", "or"], ut = {
3455
3467
  labels: s.string().array().optional().describe("The labels to filter the tasks by"),
3456
- labelsOperator: s.enum(ui).optional().describe(
3468
+ labelsOperator: s.enum(pi).optional().describe(
3457
3469
  'The operator to use when filtering by labels. This will dictate whether a task has all labels, or some of them. Default is "or".'
3458
3470
  )
3459
3471
  };
@@ -3462,20 +3474,20 @@ function pt(e = [], t = "or") {
3462
3474
  const o = t === "and" ? " & " : " | ";
3463
3475
  return `(${e.map((i) => i.startsWith("@") ? i : `@${i}`).join(` ${o} `)})`;
3464
3476
  }
3465
- const pi = 7;
3466
- function hi({
3477
+ const hi = 7;
3478
+ function mi({
3467
3479
  since: e,
3468
3480
  until: t,
3469
3481
  userGmtOffset: o,
3470
3482
  now: r = /* @__PURE__ */ new Date()
3471
3483
  }) {
3472
- const n = di(o), i = li(r, n), a = pi - 1, c = t ?? (e ? At(e, a) : i);
3484
+ const n = li(o), i = ui(r, n), a = hi - 1, c = t ?? (e ? At(e, a) : i);
3473
3485
  return {
3474
3486
  since: e ?? At(c, -a),
3475
3487
  until: c
3476
3488
  };
3477
3489
  }
3478
- const mi = {
3490
+ const fi = {
3479
3491
  getBy: s.enum(["completion", "due"]).default("completion").describe(
3480
3492
  '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).'
3481
3493
  ),
@@ -3499,17 +3511,17 @@ const mi = {
3499
3511
  "The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters)."
3500
3512
  ),
3501
3513
  ...ut
3502
- }, fi = {
3514
+ }, bi = {
3503
3515
  tasks: s.array(B).describe("The found completed tasks."),
3504
3516
  nextCursor: s.string().optional(),
3505
3517
  totalCount: s.number().describe("The total number of tasks in this page."),
3506
3518
  hasMore: s.boolean(),
3507
3519
  appliedFilters: s.record(s.string(), s.unknown())
3508
- }, bi = {
3520
+ }, gi = {
3509
3521
  name: g.FIND_COMPLETED_TASKS,
3510
3522
  description: 'Get completed tasks in a date range. For "what did I complete/get done" questions, use find-activity instead — it reports completion events, including every occurrence of a recurring task, which this tool does not. since/until are optional and default to a 7-day window when omitted. Includes all collaborators by default. Person-specific queries (summaries, plans, reports) require responsibleUser.',
3511
- parameters: mi,
3512
- outputSchema: fi,
3523
+ parameters: fi,
3524
+ outputSchema: bi,
3513
3525
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3514
3526
  async execute(e, t) {
3515
3527
  const { getBy: o, labels: r, labelsOperator: n, since: i, until: a, responsibleUser: c, projectId: d, ...l } = e;
@@ -3523,7 +3535,7 @@ const mi = {
3523
3535
  const y = await t.getUser(), f = y.tzInfo?.gmtString || "+00:00", w = await ue({
3524
3536
  projectId: d,
3525
3537
  user: y
3526
- }), C = hi({
3538
+ }), C = mi({
3527
3539
  since: i,
3528
3540
  until: a,
3529
3541
  userGmtOffset: f
@@ -3545,7 +3557,7 @@ const mi = {
3545
3557
  ...m ? { filterQuery: m, filterLang: "en" } : {}
3546
3558
  }), $ = b.map(P);
3547
3559
  return {
3548
- textContent: gi({
3560
+ textContent: yi({
3549
3561
  tasks: $,
3550
3562
  args: T,
3551
3563
  nextCursor: S,
@@ -3561,7 +3573,7 @@ const mi = {
3561
3573
  };
3562
3574
  }
3563
3575
  };
3564
- function gi({
3576
+ function yi({
3565
3577
  tasks: e,
3566
3578
  args: t,
3567
3579
  nextCursor: o,
@@ -3587,7 +3599,7 @@ function gi({
3587
3599
  zeroReasonHints: c
3588
3600
  });
3589
3601
  }
3590
- const yi = {
3602
+ const Ti = {
3591
3603
  searchText: s.string().optional().describe(
3592
3604
  '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.'
3593
3605
  ),
@@ -3595,7 +3607,7 @@ const yi = {
3595
3607
  cursor: s.string().optional().describe(
3596
3608
  "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."
3597
3609
  )
3598
- }, Ti = {
3610
+ }, ki = {
3599
3611
  labels: s.array(me).describe("The found personal labels."),
3600
3612
  nextCursor: s.string().optional(),
3601
3613
  totalCount: s.number().describe("The total number of labels in this page."),
@@ -3604,22 +3616,22 @@ const yi = {
3604
3616
  "Names of all shared labels visible to you. These have no IDs or metadata — use their names directly when filtering tasks."
3605
3617
  ),
3606
3618
  appliedFilters: s.record(s.string(), s.unknown())
3607
- }, ki = {
3619
+ }, wi = {
3608
3620
  name: g.FIND_LABELS,
3609
3621
  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.",
3610
- parameters: yi,
3611
- outputSchema: Ti,
3622
+ parameters: Ti,
3623
+ outputSchema: ki,
3612
3624
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3613
3625
  async execute(e, t) {
3614
3626
  const [o, r] = await Promise.all([
3615
- e.searchText ? mr(t, e.searchText).then((c) => ({
3627
+ e.searchText ? fr(t, e.searchText).then((c) => ({
3616
3628
  results: c,
3617
3629
  nextCursor: null
3618
3630
  })) : t.getLabels({ limit: e.limit, cursor: e.cursor ?? null }),
3619
- fr(t)
3631
+ br(t)
3620
3632
  ]), { results: n, nextCursor: i } = o, a = e.searchText ? { searchText: e.searchText } : { limit: e.limit, cursor: e.cursor };
3621
3633
  return {
3622
- textContent: wi({ labels: n, args: e, nextCursor: i, sharedLabels: r }),
3634
+ textContent: vi({ labels: n, args: e, nextCursor: i, sharedLabels: r }),
3623
3635
  structuredContent: {
3624
3636
  labels: n.map((c) => me.parse(c)),
3625
3637
  nextCursor: i ?? void 0,
@@ -3631,7 +3643,7 @@ const yi = {
3631
3643
  };
3632
3644
  }
3633
3645
  };
3634
- function wi({
3646
+ function vi({
3635
3647
  labels: e,
3636
3648
  args: t,
3637
3649
  nextCursor: o,
@@ -3639,7 +3651,7 @@ function wi({
3639
3651
  }) {
3640
3652
  const n = t.searchText ? `All labels matching "${t.searchText}"` : "Labels", i = [];
3641
3653
  t.searchText && i.push(`searchText: "${t.searchText}"`);
3642
- const a = 10, d = e.slice(0, a).map(Vr).join(`
3654
+ const a = 10, d = e.slice(0, a).map(Jr).join(`
3643
3655
  `), l = e.length - a, u = l > 0 ? `${d}
3644
3656
  …and ${l} more` : d, p = [];
3645
3657
  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"));
@@ -3656,15 +3668,15 @@ No shared labels.`;
3656
3668
  zeroReasonHints: p
3657
3669
  }) + h;
3658
3670
  }
3659
- const { FIND_PROJECTS: ys, ADD_TASKS: Ts, UPDATE_TASKS: ks } = g, vi = {
3671
+ const { FIND_PROJECTS: Ts, ADD_TASKS: ks, UPDATE_TASKS: ws } = g, Ii = {
3660
3672
  projectId: s.string().min(1).optional().describe(
3661
3673
  '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.'
3662
3674
  ),
3663
3675
  searchTerm: s.string().optional().describe(
3664
3676
  "Search for a user by name or email (partial and case insensitive match). If omitted, all users are returned."
3665
3677
  )
3666
- }, Ii = {
3667
- collaborators: s.array(jr).describe("The found users."),
3678
+ }, Si = {
3679
+ collaborators: s.array($r).describe("The found users."),
3668
3680
  projectInfo: s.object({
3669
3681
  id: s.string().describe("The project ID."),
3670
3682
  name: s.string().describe("The project name."),
@@ -3673,16 +3685,16 @@ const { FIND_PROJECTS: ys, ADD_TASKS: Ts, UPDATE_TASKS: ks } = g, vi = {
3673
3685
  totalCount: s.number().describe("The total number of users found."),
3674
3686
  totalAvailable: s.number().optional().describe("The total number of available users before the search filter was applied."),
3675
3687
  appliedFilters: s.record(s.string(), s.unknown())
3676
- }, Si = {
3688
+ }, Ci = {
3677
3689
  name: g.FIND_PROJECT_COLLABORATORS,
3678
3690
  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.`,
3679
- parameters: vi,
3680
- outputSchema: Ii,
3691
+ parameters: Ii,
3692
+ outputSchema: Si,
3681
3693
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3682
3694
  async execute(e, t) {
3683
3695
  const { projectId: o, searchTerm: r } = e;
3684
3696
  if (!o)
3685
- return Ci({ searchTerm: r, client: t, appliedFilters: e });
3697
+ return ji({ searchTerm: r, client: t, appliedFilters: e });
3686
3698
  let n = o, i;
3687
3699
  try {
3688
3700
  if (i = await t.getProject(o), !i)
@@ -3693,7 +3705,7 @@ const { FIND_PROJECTS: ys, ADD_TASKS: Ts, UPDATE_TASKS: ks } = g, vi = {
3693
3705
 
3694
3706
  **Next steps:**
3695
3707
  • Share the project to enable collaboration
3696
- • Use ${Ts} and ${ks} for assignment features once shared`,
3708
+ • Use ${ks} and ${ws} for assignment features once shared`,
3697
3709
  structuredContent: {
3698
3710
  collaborators: [],
3699
3711
  projectInfo: {
@@ -3730,9 +3742,9 @@ const { FIND_PROJECTS: ys, ADD_TASKS: Ts, UPDATE_TASKS: ks } = g, vi = {
3730
3742
  appliedFilters: e
3731
3743
  }
3732
3744
  };
3733
- const c = ws(a, r);
3745
+ const c = vs(a, r);
3734
3746
  return {
3735
- textContent: vs({
3747
+ textContent: Is({
3736
3748
  collaborators: c,
3737
3749
  projectName: n,
3738
3750
  searchTerm: r,
@@ -3752,18 +3764,18 @@ const { FIND_PROJECTS: ys, ADD_TASKS: Ts, UPDATE_TASKS: ks } = g, vi = {
3752
3764
  };
3753
3765
  }
3754
3766
  };
3755
- async function Ci({
3767
+ async function ji({
3756
3768
  searchTerm: e,
3757
3769
  client: t,
3758
3770
  appliedFilters: o
3759
3771
  }) {
3760
- const r = await F.getAllCollaborators(t), n = await ji(t, r);
3772
+ const r = await F.getAllCollaborators(t), n = await $i(t, r);
3761
3773
  if (n.length === 0)
3762
3774
  return {
3763
3775
  textContent: `No users found. You may have no shared projects, or collaborator data is not accessible.
3764
3776
 
3765
3777
  **Next steps:**
3766
- • Use ${ys} to find shared projects
3778
+ • Use ${Ts} to find shared projects
3767
3779
  • Share a project to add collaborators
3768
3780
  • Ensure you have permission to view collaborators`,
3769
3781
  structuredContent: {
@@ -3774,9 +3786,9 @@ async function Ci({
3774
3786
  appliedFilters: o
3775
3787
  }
3776
3788
  };
3777
- const i = ws(n, e);
3789
+ const i = vs(n, e);
3778
3790
  return {
3779
- textContent: vs({
3791
+ textContent: Is({
3780
3792
  collaborators: i,
3781
3793
  projectName: void 0,
3782
3794
  searchTerm: e,
@@ -3791,7 +3803,7 @@ async function Ci({
3791
3803
  }
3792
3804
  };
3793
3805
  }
3794
- async function ji(e, t) {
3806
+ async function $i(e, t) {
3795
3807
  try {
3796
3808
  const o = await e.getUser();
3797
3809
  return !o || t.some((r) => r.id === o.id) ? t : [
@@ -3802,7 +3814,7 @@ async function ji(e, t) {
3802
3814
  return t;
3803
3815
  }
3804
3816
  }
3805
- function ws(e, t) {
3817
+ function vs(e, t) {
3806
3818
  if (!t)
3807
3819
  return e;
3808
3820
  const o = t.toLowerCase().trim();
@@ -3810,7 +3822,7 @@ function ws(e, t) {
3810
3822
  (r) => r.name.toLowerCase().includes(o) || r.email.toLowerCase().includes(o)
3811
3823
  );
3812
3824
  }
3813
- function vs({
3825
+ function Is({
3814
3826
  collaborators: e,
3815
3827
  projectName: t,
3816
3828
  searchTerm: o,
@@ -3826,7 +3838,7 @@ function vs({
3826
3838
  const l = [];
3827
3839
  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`));
3828
3840
  const u = [];
3829
- return e.length > 0 ? (u.push(`Use ${Ts} with responsibleUser to assign new tasks`), u.push(`Use ${ks} with responsibleUser to reassign existing tasks`), u.push("Use user names, emails, or IDs for assignments")) : (u.push(`Use ${ys} to find other projects`), o && r > 0 && u.push("Try searching without filters to see all users")), G({
3841
+ return e.length > 0 ? (u.push(`Use ${ks} with responsibleUser to assign new tasks`), u.push(`Use ${ws} with responsibleUser to reassign existing tasks`), u.push("Use user names, emails, or IDs for assignments")) : (u.push(`Use ${Ts} to find other projects`), o && r > 0 && u.push("Try searching without filters to see all users")), G({
3830
3842
  subject: a,
3831
3843
  count: e.length,
3832
3844
  filterHints: c,
@@ -3836,11 +3848,11 @@ function vs({
3836
3848
  nextSteps: u
3837
3849
  });
3838
3850
  }
3839
- const { ADD_PROJECTS: xt } = g, $i = {
3851
+ const { ADD_PROJECTS: xt } = g, Di = {
3840
3852
  active: "projects",
3841
3853
  archived: "archived projects",
3842
3854
  all: "projects (active and archived)"
3843
- }, Di = {
3855
+ }, Ai = {
3844
3856
  searchText: s.string().optional().describe(
3845
3857
  '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.'
3846
3858
  ),
@@ -3851,17 +3863,17 @@ const { ADD_PROJECTS: xt } = g, $i = {
3851
3863
  archivedStatus: s.enum(["active", "archived", "all"]).optional().describe(
3852
3864
  "Which projects to return by archive status: 'active' (default, non-archived only), 'archived' (archived only), or 'all' (both active and archived). Each project includes an isArchived field. Archived projects can be deleted via the delete-object tool (type: 'project')."
3853
3865
  )
3854
- }, Ai = {
3866
+ }, xi = {
3855
3867
  projects: s.array(Z).describe("The found projects."),
3856
3868
  nextCursor: s.string().optional(),
3857
3869
  totalCount: s.number().describe("The total number of projects in this page."),
3858
3870
  hasMore: s.boolean(),
3859
3871
  appliedFilters: s.record(s.string(), s.unknown())
3860
- }, xi = {
3872
+ }, Ei = {
3861
3873
  name: g.FIND_PROJECTS,
3862
3874
  description: "List all projects or search for projects by name. By default only active projects are returned; use archivedStatus ('archived' or 'all') to include archived projects. When searching or when archivedStatus is 'all', all matching projects are returned (pagination is ignored). Otherwise projects are returned with pagination.",
3863
- parameters: Di,
3864
- outputSchema: Ai,
3875
+ parameters: Ai,
3876
+ outputSchema: xi,
3865
3877
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3866
3878
  async execute(e, t) {
3867
3879
  const { searchText: o } = e, r = e.archivedStatus ?? "active";
@@ -3869,8 +3881,8 @@ const { ADD_PROJECTS: xt } = g, $i = {
3869
3881
  if (o || r === "all") {
3870
3882
  const c = Promise.resolve([]), [d, l] = await Promise.all([
3871
3883
  r === "archived" ? c : o ? is(t, o) : as(t),
3872
- r === "active" ? c : pr(t)
3873
- ]), u = o ? hr(o) : null, p = u ? l.filter((h) => u.test(h.name)) : l;
3884
+ r === "active" ? c : hr(t)
3885
+ ]), u = o ? mr(o) : null, p = u ? l.filter((h) => u.test(h.name)) : l;
3874
3886
  n = [...d, ...p];
3875
3887
  } else {
3876
3888
  const c = r === "archived" ? await t.getArchivedProjects({
@@ -3881,7 +3893,7 @@ const { ADD_PROJECTS: xt } = g, $i = {
3881
3893
  }
3882
3894
  const a = n.map(Q);
3883
3895
  return {
3884
- textContent: Ei({ projects: a, args: e, nextCursor: i }),
3896
+ textContent: Oi({ projects: a, args: e, nextCursor: i }),
3885
3897
  structuredContent: {
3886
3898
  projects: a,
3887
3899
  nextCursor: i ?? void 0,
@@ -3892,14 +3904,14 @@ const { ADD_PROJECTS: xt } = g, $i = {
3892
3904
  };
3893
3905
  }
3894
3906
  };
3895
- function Ei({
3907
+ function Oi({
3896
3908
  projects: e,
3897
3909
  args: t,
3898
3910
  nextCursor: o
3899
3911
  }) {
3900
- const r = $i[t.archivedStatus ?? "active"], n = t.searchText ? `All ${r} matching "${t.searchText}"` : `${r.charAt(0).toUpperCase()}${r.slice(1)}`, i = [];
3912
+ const r = Di[t.archivedStatus ?? "active"], n = t.searchText ? `All ${r} matching "${t.searchText}"` : `${r.charAt(0).toUpperCase()}${r.slice(1)}`, i = [];
3901
3913
  t.searchText && i.push(`searchText: "${t.searchText}"`), t.archivedStatus && t.archivedStatus !== "active" && i.push(`archivedStatus: "${t.archivedStatus}"`);
3902
- const a = 10, d = e.slice(0, a).map(Jr).join(`
3914
+ const a = 10, d = e.slice(0, a).map(Xr).join(`
3903
3915
  `), l = e.length - a, u = l > 0 ? `${d}
3904
3916
  …and ${l} more` : d, p = [];
3905
3917
  return e.length === 0 && (t.searchText ? (p.push("Try broader search terms"), p.push("Check spelling"), p.push("Remove searchText to see all projects")) : t.archivedStatus === "archived" ? (p.push("No archived projects"), p.push("Use archivedStatus: 'all' to also see active projects")) : t.archivedStatus === "all" ? (p.push("No projects created yet"), p.push(`Use ${xt} to create a project`)) : (p.push("No active projects"), p.push("Use archivedStatus: 'all' to include archived projects"), p.push(`Use ${xt} to create a project`))), G({
@@ -3912,22 +3924,22 @@ function Ei({
3912
3924
  zeroReasonHints: p
3913
3925
  });
3914
3926
  }
3915
- const Oi = {
3927
+ const Pi = {
3916
3928
  taskId: s.string().optional().describe(
3917
3929
  "Find all reminders for a specific task. Returns both time-based and location reminders."
3918
3930
  ),
3919
3931
  reminderId: s.string().optional().describe("Get a specific time-based reminder (relative or absolute) by its ID."),
3920
3932
  locationReminderId: s.string().optional().describe("Get a specific location reminder by its ID.")
3921
- }, Pi = {
3933
+ }, _i = {
3922
3934
  reminders: s.array(nt).describe("The found reminders (time-based and location)."),
3923
3935
  searchType: s.string().describe('The search type used: "task", "reminder", or "location_reminder".'),
3924
3936
  searchId: s.string().describe("The ID used for the search."),
3925
3937
  totalCount: s.number().describe("Total reminders in this response.")
3926
- }, _i = {
3938
+ }, Ui = {
3927
3939
  name: g.FIND_REMINDERS,
3928
3940
  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.",
3929
- parameters: Oi,
3930
- outputSchema: Pi,
3941
+ parameters: Pi,
3942
+ outputSchema: _i,
3931
3943
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3932
3944
  async execute(e, t) {
3933
3945
  const { taskId: o, reminderId: r, locationReminderId: n } = e, i = [o, r, n].filter(Boolean);
@@ -3973,7 +3985,7 @@ const Oi = {
3973
3985
  })
3974
3986
  ]), l = [...a, ...c].map(ge);
3975
3987
  return {
3976
- textContent: Ui(l, o),
3988
+ textContent: Ri(l, o),
3977
3989
  structuredContent: {
3978
3990
  reminders: l,
3979
3991
  searchType: "task",
@@ -3985,7 +3997,7 @@ const Oi = {
3985
3997
  throw new Error("One of taskId, reminderId, or locationReminderId must be provided.");
3986
3998
  }
3987
3999
  };
3988
- function Ui(e, t) {
4000
+ function Ri(e, t) {
3989
4001
  if (e.length === 0)
3990
4002
  return `No reminders found for task ${t}`;
3991
4003
  const { timeBasedCount: o, locationCount: r } = cs(e), n = [];
@@ -3999,22 +4011,22 @@ function Ui(e, t) {
3999
4011
  }
4000
4012
  return `Found ${n.join(" and ")} for task ${t}`;
4001
4013
  }
4002
- const { ADD_SECTIONS: Ri } = g, Li = {
4014
+ const { ADD_SECTIONS: Li } = g, Ni = {
4003
4015
  projectId: s.string().min(1).describe(
4004
4016
  'The ID of the project to search sections in. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
4005
4017
  ),
4006
4018
  searchText: s.string().optional().describe(
4007
4019
  '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.'
4008
4020
  )
4009
- }, Ni = {
4021
+ }, Mi = {
4010
4022
  sections: s.array(K).describe("The found sections."),
4011
4023
  totalCount: s.number().describe("The total number of sections found."),
4012
4024
  appliedFilters: s.record(s.string(), s.unknown())
4013
- }, Mi = {
4025
+ }, Fi = {
4014
4026
  name: g.FIND_SECTIONS,
4015
4027
  description: "Search for sections by name or other criteria in a project. When searching, uses server-side search to avoid fetching all sections.",
4016
- parameters: Li,
4017
- outputSchema: Ni,
4028
+ parameters: Ni,
4029
+ outputSchema: Mi,
4018
4030
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
4019
4031
  async execute(e, t) {
4020
4032
  const o = await ue({
@@ -4022,12 +4034,12 @@ const { ADD_SECTIONS: Ri } = g, Li = {
4022
4034
  client: t
4023
4035
  });
4024
4036
  let r;
4025
- e.searchText ? r = await br(t, e.searchText, o) : r = (await t.getSections({
4037
+ e.searchText ? r = await gr(t, e.searchText, o) : r = (await t.getSections({
4026
4038
  projectId: o
4027
4039
  })).results;
4028
4040
  const n = r.map(Y);
4029
4041
  return {
4030
- textContent: Fi({
4042
+ textContent: Hi({
4031
4043
  sections: n,
4032
4044
  projectId: e.projectId,
4033
4045
  searchText: e.searchText
@@ -4040,13 +4052,13 @@ const { ADD_SECTIONS: Ri } = g, Li = {
4040
4052
  };
4041
4053
  }
4042
4054
  };
4043
- function Fi({
4055
+ function Hi({
4044
4056
  sections: e,
4045
4057
  projectId: t,
4046
4058
  searchText: o
4047
4059
  }) {
4048
4060
  const r = [];
4049
- 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 ${Ri} to create sections`));
4061
+ 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 ${Li} to create sections`));
4050
4062
  const n = o ? `Sections in project ${t} matching "${o}"` : `Sections in project ${t}`, i = e.length > 0 ? e.map((a) => ` ${a.name} • id=${a.id}`).join(`
4051
4063
  `) : void 0;
4052
4064
  return G({
@@ -4056,10 +4068,10 @@ function Fi({
4056
4068
  zeroReasonHints: r
4057
4069
  });
4058
4070
  }
4059
- function Is(e) {
4071
+ function Ss(e) {
4060
4072
  return /* @__PURE__ */ new Date(`${e}T00:00:00`);
4061
4073
  }
4062
- const Hi = {
4074
+ const Wi = {
4063
4075
  startDate: s.string().regex(/^(\d{4}-\d{2}-\d{2}|today)$/).optional().describe(
4064
4076
  "The start date to get the tasks for. Format: YYYY-MM-DD, or 'today', which by default also includes overdue tasks."
4065
4077
  ),
@@ -4080,17 +4092,17 @@ const Hi = {
4080
4092
  "Filter when responsibleUser is omitted. 'assigned'=assigned to others; 'unassignedOrMe'=unassigned+mine; 'all'=everyone. Default: 'unassignedOrMe'."
4081
4093
  ),
4082
4094
  ...ut
4083
- }, Wi = {
4095
+ }, Bi = {
4084
4096
  tasks: s.array(B).describe("The found tasks."),
4085
4097
  nextCursor: s.string().optional(),
4086
4098
  totalCount: s.number().describe("The total number of tasks in this page."),
4087
4099
  hasMore: s.boolean(),
4088
4100
  appliedFilters: s.record(s.string(), s.unknown())
4089
- }, Bi = {
4101
+ }, zi = {
4090
4102
  name: g.FIND_TASKS_BY_DATE,
4091
4103
  description: "Get tasks by date range. startDate='today' includes overdue items. Default responsibleUserFiltering='unassignedOrMe' excludes others' tasks.",
4092
- parameters: Hi,
4093
- outputSchema: Wi,
4104
+ parameters: Wi,
4105
+ outputSchema: Bi,
4094
4106
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
4095
4107
  async execute(e, t) {
4096
4108
  if (!e.startDate && e.overdueOption !== "overdue-only")
@@ -4108,7 +4120,7 @@ const Hi = {
4108
4120
  } else
4109
4121
  c = e.overdueOption === "exclude-overdue" ? "today" : "(today | overdue)";
4110
4122
  else if (e.startDate) {
4111
- const m = e.startDate, y = Ne(Is(m), e.daysCount), f = ht(y, { representation: "date" });
4123
+ const m = e.startDate, y = Ne(Ss(m), e.daysCount), f = ht(y, { representation: "date" });
4112
4124
  c = `(due after: ${m} | due: ${m}) & due before: ${f}`;
4113
4125
  }
4114
4126
  const d = pt(e.labels, e.labelsOperator);
@@ -4127,7 +4139,7 @@ const Hi = {
4127
4139
  limit: e.limit
4128
4140
  });
4129
4141
  return {
4130
- textContent: zi({ tasks: u, args: e, nextCursor: p, assigneeEmail: n }),
4142
+ textContent: Ki({ tasks: u, args: e, nextCursor: p, assigneeEmail: n }),
4131
4143
  structuredContent: {
4132
4144
  tasks: u,
4133
4145
  nextCursor: p ?? void 0,
@@ -4138,7 +4150,7 @@ const Hi = {
4138
4150
  };
4139
4151
  }
4140
4152
  };
4141
- function zi({
4153
+ function Ki({
4142
4154
  tasks: e,
4143
4155
  args: t,
4144
4156
  nextCursor: o,
@@ -4153,7 +4165,7 @@ function zi({
4153
4165
  `today${c}${t.daysCount > 1 ? ` + ${t.daysCount - 1} more days` : ""}`
4154
4166
  );
4155
4167
  } else if (t.startDate) {
4156
- const c = t.daysCount > 1 ? ` to ${de(Ne(Is(t.startDate), t.daysCount))}` : "";
4168
+ const c = t.daysCount > 1 ? ` to ${de(Ne(Ss(t.startDate), t.daysCount))}` : "";
4157
4169
  n.push(`${t.startDate}${c}`);
4158
4170
  }
4159
4171
  if (t.labels && t.labels.length > 0) {
@@ -4188,13 +4200,13 @@ function zi({
4188
4200
  zeroReasonHints: a
4189
4201
  });
4190
4202
  }
4191
- const Ki = 300 * 1e3;
4192
- class Yi {
4203
+ const Yi = 300 * 1e3;
4204
+ class Gi {
4193
4205
  constructor() {
4194
4206
  this.cache = null;
4195
4207
  }
4196
4208
  async getFilters(t) {
4197
- if (this.cache && Date.now() - this.cache.timestamp < Ki)
4209
+ if (this.cache && Date.now() - this.cache.timestamp < Yi)
4198
4210
  return this.cache.filters;
4199
4211
  const r = ((await t.sync({
4200
4212
  resourceTypes: ["filters"],
@@ -4251,7 +4263,7 @@ ${u}` + (d.length > 5 ? `
4251
4263
  this.cache = null;
4252
4264
  }
4253
4265
  }
4254
- const Gi = new Yi(), { FIND_COMPLETED_TASKS: Et, ADD_TASKS: Ot } = g, qi = {
4266
+ const qi = new Gi(), { FIND_COMPLETED_TASKS: Et, ADD_TASKS: Ot } = g, Vi = {
4255
4267
  searchText: s.string().optional().describe("The text to search for in tasks."),
4256
4268
  projectId: s.string().optional().describe(
4257
4269
  'Find tasks in this project. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
@@ -4275,17 +4287,17 @@ const Gi = new Yi(), { FIND_COMPLETED_TASKS: Et, ADD_TASKS: Ot } = g, qi = {
4275
4287
  "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."
4276
4288
  ),
4277
4289
  ...ut
4278
- }, Vi = {
4290
+ }, Ji = {
4279
4291
  tasks: s.array(B).describe("The found tasks."),
4280
4292
  nextCursor: s.string().optional(),
4281
4293
  totalCount: s.number().describe("The total number of tasks in this page."),
4282
4294
  hasMore: s.boolean(),
4283
4295
  appliedFilters: s.record(s.string(), s.unknown())
4284
- }, Ji = {
4296
+ }, Xi = {
4285
4297
  name: g.FIND_TASKS,
4286
4298
  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.",
4287
- parameters: qi,
4288
- outputSchema: Vi,
4299
+ parameters: Vi,
4300
+ outputSchema: Ji,
4289
4301
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
4290
4302
  async execute(e, t) {
4291
4303
  const {
@@ -4315,7 +4327,7 @@ const Gi = new Yi(), { FIND_COMPLETED_TASKS: Et, ADD_TASKS: Ot } = g, qi = {
4315
4327
  'The `filter`/`filterIdOrName` parameter cannot be combined with projectId, sectionId, or parentId. Use filter syntax instead (e.g. "##ProjectName").'
4316
4328
  );
4317
4329
  let w = h;
4318
- m && (w = (await Gi.resolveFilter(t, m)).filterQuery);
4330
+ m && (w = (await qi.resolveFilter(t, m)).filterQuery);
4319
4331
  const C = await st(t, a), x = C?.userId, k = C?.email;
4320
4332
  if (r || n || i) {
4321
4333
  const D = {
@@ -4324,30 +4336,30 @@ const Gi = new Yi(), { FIND_COMPLETED_TASKS: Et, ADD_TASKS: Ot } = g, qi = {
4324
4336
  };
4325
4337
  r && (D.projectId = await ue({ projectId: r, user: y })), n && (D.sectionId = n), i && (D.parentId = i);
4326
4338
  const { results: De, nextCursor: q } = await t.getTasks(D), se = De.map(P);
4327
- let L = o ? se.filter(
4339
+ let N = o ? se.filter(
4328
4340
  (oe) => oe.content.toLowerCase().includes(o.toLowerCase()) || oe.description?.toLowerCase().includes(o.toLowerCase())
4329
4341
  ) : se;
4330
- return L = ur({
4331
- tasks: L,
4342
+ return N = pr({
4343
+ tasks: N,
4332
4344
  resolvedAssigneeId: x,
4333
4345
  currentUserId: y.id,
4334
4346
  responsibleUserFiltering: c
4335
- }), u && u.length > 0 && (L = p === "and" ? L.filter(
4347
+ }), u && u.length > 0 && (N = p === "and" ? N.filter(
4336
4348
  (oe) => u.every((Ae) => oe.labels.includes(Ae))
4337
- ) : L.filter(
4349
+ ) : N.filter(
4338
4350
  (oe) => u.some((Ae) => oe.labels.includes(Ae))
4339
4351
  )), {
4340
4352
  textContent: Oe({
4341
- tasks: L,
4353
+ tasks: N,
4342
4354
  args: e,
4343
4355
  nextCursor: q,
4344
4356
  isContainerSearch: !0,
4345
4357
  assigneeEmail: k
4346
4358
  }),
4347
4359
  structuredContent: {
4348
- tasks: L,
4360
+ tasks: N,
4349
4361
  nextCursor: q ?? void 0,
4350
- totalCount: L.length,
4362
+ totalCount: N.length,
4351
4363
  hasMore: !!q,
4352
4364
  appliedFilters: e
4353
4365
  }
@@ -4418,7 +4430,7 @@ const Gi = new Yi(), { FIND_COMPLETED_TASKS: Et, ADD_TASKS: Ot } = g, qi = {
4418
4430
  };
4419
4431
  }
4420
4432
  };
4421
- function Xi(e) {
4433
+ function Qi(e) {
4422
4434
  if (e.projectId) {
4423
4435
  const t = [
4424
4436
  e.searchText ? "No tasks in project match search" : "Project has no tasks yet"
@@ -4453,7 +4465,7 @@ function Oe({
4453
4465
  const d = t.labels.map((l) => `@${l}`).join(t.labelsOperator === "and" ? " & " : " | ");
4454
4466
  a.push(`labels: ${d}`);
4455
4467
  }
4456
- e.length === 0 && c.push(...Xi(t));
4468
+ e.length === 0 && c.push(...Qi(t));
4457
4469
  } else {
4458
4470
  const d = n || t.responsibleUser, l = [];
4459
4471
  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) {
@@ -4482,11 +4494,11 @@ function Oe({
4482
4494
  zeroReasonHints: c
4483
4495
  });
4484
4496
  }
4485
- const Qi = {
4497
+ const Zi = {
4486
4498
  projectId: s.string().min(1).optional().describe(
4487
4499
  "Optional project ID. If provided, shows detailed overview of that project. If omitted, shows overview of all projects."
4488
4500
  )
4489
- }, Ss = s.lazy(
4501
+ }, Cs = s.lazy(
4490
4502
  () => s.object({
4491
4503
  id: s.string().describe("The project ID."),
4492
4504
  name: s.string().describe("The project name."),
@@ -4494,9 +4506,9 @@ const Qi = {
4494
4506
  folderId: s.string().optional().describe("The folder ID this project belongs to (workspace projects only)."),
4495
4507
  childOrder: s.number().describe("The ordering index among siblings."),
4496
4508
  sections: s.array(K),
4497
- children: s.array(Ss).describe("Nested child projects.")
4509
+ children: s.array(Cs).describe("Nested child projects.")
4498
4510
  })
4499
- ), Zi = {
4511
+ ), ea = {
4500
4512
  type: s.enum(["account_overview", "project_overview"]).describe("The type of overview returned."),
4501
4513
  totalProjects: s.number().optional().describe("Total number of projects (account overview only)."),
4502
4514
  totalTasks: s.number().optional().describe("Total number of tasks."),
@@ -4515,7 +4527,7 @@ const Qi = {
4515
4527
  name: s.string().describe("The inbox project name."),
4516
4528
  sections: s.array(K).describe("Sections in the inbox project.")
4517
4529
  }).optional().describe("Inbox information (account overview only)."),
4518
- projects: s.array(s.lazy(() => Ss)).optional().describe(
4530
+ projects: s.array(s.lazy(() => Cs)).optional().describe(
4519
4531
  "List of projects with hierarchy, folders, and ordering (account overview only)."
4520
4532
  ),
4521
4533
  project: s.object({
@@ -4530,7 +4542,7 @@ const Qi = {
4530
4542
  tasksWithoutSection: s.number()
4531
4543
  }).optional().describe("Statistics object (project overview only).")
4532
4544
  };
4533
- function ea(e) {
4545
+ function ta(e) {
4534
4546
  const t = {};
4535
4547
  for (const n of e)
4536
4548
  t[n.id] = {
@@ -4555,7 +4567,7 @@ function ea(e) {
4555
4567
  }
4556
4568
  return r(o), o;
4557
4569
  }
4558
- async function ta(e, t) {
4570
+ async function sa(e, t) {
4559
4571
  const o = {};
4560
4572
  return await Promise.all(
4561
4573
  t.map(async (r) => {
@@ -4564,14 +4576,14 @@ async function ta(e, t) {
4564
4576
  })
4565
4577
  ), o;
4566
4578
  }
4567
- function Cs(e, t, o = "") {
4579
+ function js(e, t, o = "") {
4568
4580
  const r = [];
4569
4581
  r.push(`${o}- Project: ${e.name} (id=${e.id})`);
4570
4582
  const n = t[e.id] || [];
4571
4583
  for (const i of n)
4572
4584
  r.push(`${o} - Section: ${i.name} (id=${i.id})`);
4573
4585
  for (const i of e.children)
4574
- r.push(...Cs(i, t, `${o} `));
4586
+ r.push(...js(i, t, `${o} `));
4575
4587
  return r;
4576
4588
  }
4577
4589
  function Pt(e) {
@@ -4599,7 +4611,7 @@ function Ve(e, t = "") {
4599
4611
  }
4600
4612
  return o;
4601
4613
  }
4602
- function js(e, t) {
4614
+ function $s(e, t) {
4603
4615
  return {
4604
4616
  id: e.id,
4605
4617
  name: e.name,
@@ -4608,11 +4620,11 @@ function js(e, t) {
4608
4620
  childOrder: e.childOrder,
4609
4621
  sections: (t[e.id] || []).map(Y),
4610
4622
  children: e.children.map(
4611
- (o) => js(o, t)
4623
+ (o) => $s(o, t)
4612
4624
  )
4613
4625
  };
4614
4626
  }
4615
- async function sa(e, t) {
4627
+ async function oa(e, t) {
4616
4628
  let o = [], r;
4617
4629
  do {
4618
4630
  const { results: n, nextCursor: i } = await e.getTasks({
@@ -4624,12 +4636,12 @@ async function sa(e, t) {
4624
4636
  } while (r);
4625
4637
  return o;
4626
4638
  }
4627
- async function oa(e, t) {
4639
+ async function ra(e, t) {
4628
4640
  const { results: o } = await e.getSections({ projectId: t });
4629
4641
  return o;
4630
4642
  }
4631
- async function ra(e) {
4632
- const { results: t } = await e.getProjects({}), o = t.find((p) => z(p) && p.inboxProject === !0), r = t.filter((p) => !z(p) || p.inboxProject !== !0), n = ea(r), i = t.map((p) => p.id), a = await ta(e, i), c = ["# Personal Projects", ""];
4643
+ async function na(e) {
4644
+ const { results: t } = await e.getProjects({}), o = t.find((p) => z(p) && p.inboxProject === !0), r = t.filter((p) => !z(p) || p.inboxProject !== !0), n = ta(r), i = t.map((p) => p.id), a = await sa(e, i), c = ["# Personal Projects", ""];
4633
4645
  if (o) {
4634
4646
  c.push(`- Inbox Project: ${o.name} (id=${o.id})`);
4635
4647
  for (const p of a[o.id] || [])
@@ -4637,7 +4649,7 @@ async function ra(e) {
4637
4649
  }
4638
4650
  if (n.length)
4639
4651
  for (const p of n)
4640
- c.push(...Cs(p, a));
4652
+ c.push(...js(p, a));
4641
4653
  else
4642
4654
  c.push("_No projects found._");
4643
4655
  c.push("");
@@ -4655,7 +4667,7 @@ async function ra(e) {
4655
4667
  sections: (a[o.id] || []).map(Y)
4656
4668
  } : void 0,
4657
4669
  projects: n.map(
4658
- (p) => js(p, a)
4670
+ (p) => $s(p, a)
4659
4671
  ),
4660
4672
  totalProjects: t.length,
4661
4673
  totalSections: i.reduce(
@@ -4666,11 +4678,11 @@ async function ra(e) {
4666
4678
  };
4667
4679
  return { textContent: l, structuredContent: u };
4668
4680
  }
4669
- async function na(e, t) {
4681
+ async function ia(e, t) {
4670
4682
  const [o, r, n] = await Promise.all([
4671
4683
  e.getProject(t),
4672
- oa(e, t),
4673
- sa(e, t)
4684
+ ra(e, t),
4685
+ oa(e, t)
4674
4686
  ]), i = {};
4675
4687
  for (const u of r)
4676
4688
  i[u.id] = [];
@@ -4712,27 +4724,27 @@ async function na(e, t) {
4712
4724
  };
4713
4725
  return { textContent: d, structuredContent: l };
4714
4726
  }
4715
- const ia = {
4727
+ const aa = {
4716
4728
  name: g.GET_OVERVIEW,
4717
4729
  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.",
4718
- parameters: Qi,
4719
- outputSchema: Zi,
4730
+ parameters: Zi,
4731
+ outputSchema: ea,
4720
4732
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
4721
4733
  async execute(e, t) {
4722
- const o = e.projectId ? await na(t, e.projectId) : await ra(t);
4734
+ const o = e.projectId ? await ia(t, e.projectId) : await na(t);
4723
4735
  return {
4724
4736
  textContent: o.textContent,
4725
4737
  structuredContent: o.structuredContent
4726
4738
  };
4727
4739
  }
4728
- }, aa = {}, ce = s.object({
4740
+ }, ca = {}, ce = s.object({
4729
4741
  count: s.number().describe("Number of consecutive periods in this streak."),
4730
4742
  start: s.string().describe("Start date of the streak."),
4731
4743
  end: s.string().describe("End date of the streak.")
4732
4744
  }), _t = s.object({
4733
4745
  id: s.string().describe("Project ID."),
4734
4746
  completed: s.number().describe("Number of tasks completed in this project.")
4735
- }), ca = {
4747
+ }), da = {
4736
4748
  completedCount: s.number().describe("Total number of completed tasks (all-time)."),
4737
4749
  daysItems: s.array(
4738
4750
  s.object({
@@ -4781,11 +4793,11 @@ const ia = {
4781
4793
  })
4782
4794
  ).describe("Recent karma change events with reasons."),
4783
4795
  projectColors: s.record(s.string(), s.string()).describe("Map of project ID to color key.")
4784
- }, da = {
4796
+ }, la = {
4785
4797
  name: g.GET_PRODUCTIVITY_STATS,
4786
4798
  description: 'Get comprehensive productivity statistics including daily/weekly completion breakdowns, goal streaks (current, last, max), karma score and trends, and historical karma data. Useful for productivity analysis and tracking goal progress. Reports counts, streaks and karma only, never the tasks themselves — for "what did I complete", use find-activity.',
4787
- parameters: aa,
4788
- outputSchema: ca,
4799
+ parameters: ca,
4800
+ outputSchema: da,
4789
4801
  annotations: {
4790
4802
  readOnlyHint: !0,
4791
4803
  destructiveHint: !1,
@@ -4794,7 +4806,7 @@ const ia = {
4794
4806
  async execute(e, t) {
4795
4807
  const o = await t.getProductivityStats();
4796
4808
  return {
4797
- textContent: la(o),
4809
+ textContent: ua(o),
4798
4810
  structuredContent: {
4799
4811
  completedCount: o.completedCount,
4800
4812
  daysItems: o.daysItems,
@@ -4821,7 +4833,7 @@ const ia = {
4821
4833
  };
4822
4834
  }
4823
4835
  };
4824
- function la(e) {
4836
+ function ua(e) {
4825
4837
  const t = [
4826
4838
  "# Productivity Statistics",
4827
4839
  "",
@@ -4851,11 +4863,11 @@ function la(e) {
4851
4863
  return t.join(`
4852
4864
  `);
4853
4865
  }
4854
- const ua = {
4866
+ const pa = {
4855
4867
  projectId: s.string().min(1).describe("The ID of the project to get activity stats for."),
4856
4868
  weeks: s.number().int().min(1).max(12).optional().describe("Number of weeks of activity data to retrieve (1-12, default 2)."),
4857
4869
  includeWeeklyCounts: s.boolean().optional().describe("Include weekly rollup counts alongside daily counts.")
4858
- }, pa = {
4870
+ }, ha = {
4859
4871
  projectId: s.string().describe("The project ID."),
4860
4872
  dayItems: s.array(
4861
4873
  s.object({
@@ -4871,7 +4883,7 @@ const ua = {
4871
4883
  })
4872
4884
  ).optional().describe("Weekly completion rollups. Only included when includeWeeklyCounts is true.")
4873
4885
  };
4874
- function ha(e, t) {
4886
+ function ma(e, t) {
4875
4887
  const o = [`# Activity Stats: Project ${e}`, ""];
4876
4888
  if (t.dayItems.length > 0) {
4877
4889
  o.push("## Daily Activity");
@@ -4887,11 +4899,11 @@ function ha(e, t) {
4887
4899
  return o.join(`
4888
4900
  `);
4889
4901
  }
4890
- const ma = {
4902
+ const fa = {
4891
4903
  name: g.GET_PROJECT_ACTIVITY_STATS,
4892
4904
  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.",
4893
- parameters: ua,
4894
- outputSchema: pa,
4905
+ parameters: pa,
4906
+ outputSchema: ha,
4895
4907
  annotations: {
4896
4908
  readOnlyHint: !0,
4897
4909
  destructiveHint: !1,
@@ -4903,7 +4915,7 @@ const ma = {
4903
4915
  includeWeeklyCounts: n
4904
4916
  });
4905
4917
  return {
4906
- textContent: ha(o, i),
4918
+ textContent: ma(o, i),
4907
4919
  structuredContent: {
4908
4920
  projectId: o,
4909
4921
  dayItems: i.dayItems,
@@ -4911,12 +4923,12 @@ const ma = {
4911
4923
  }
4912
4924
  };
4913
4925
  }
4914
- }, fa = {
4926
+ }, ba = {
4915
4927
  projectId: s.string().min(1).describe("The ID of the project to check health for."),
4916
4928
  includeContext: s.boolean().default(!1).describe(
4917
4929
  "Include detailed health context with project metrics and task-level data. May produce large output for projects with many tasks."
4918
4930
  )
4919
- }, ba = s.object({
4931
+ }, ga = s.object({
4920
4932
  id: s.string().describe("The task ID."),
4921
4933
  content: s.string().describe("The task content/title."),
4922
4934
  priority: s.string().describe("The task priority (1-4)."),
@@ -4924,7 +4936,7 @@ const ma = {
4924
4936
  deadline: s.string().optional().describe("The deadline date string, if set."),
4925
4937
  isCompleted: s.boolean().describe("Whether the task is completed."),
4926
4938
  labels: s.array(s.string()).describe("Labels applied to this task.")
4927
- }), ga = {
4939
+ }), ya = {
4928
4940
  projectId: s.string().describe("The project ID."),
4929
4941
  projectName: s.string().describe("The project name."),
4930
4942
  progress: s.object({
@@ -4950,12 +4962,12 @@ const ma = {
4950
4962
  tasksCompletedThisWeek: s.number().describe("Tasks completed in the current week."),
4951
4963
  averageCompletionTime: s.number().optional().describe("Average task completion time in days, if available.")
4952
4964
  }).describe("Aggregated project metrics."),
4953
- tasks: s.array(ba).describe("Tasks in the project.")
4965
+ tasks: s.array(ga).describe("Tasks in the project.")
4954
4966
  }).optional().describe(
4955
4967
  "Detailed project context with metrics and task data. Only included when includeContext is true."
4956
4968
  )
4957
4969
  };
4958
- async function ya(e, t, o) {
4970
+ async function Ta(e, t, o) {
4959
4971
  if (o) {
4960
4972
  const [i, a, c] = await Promise.all([
4961
4973
  e.getProjectProgress(t),
@@ -4970,7 +4982,7 @@ async function ya(e, t, o) {
4970
4982
  ]);
4971
4983
  return { progress: r, health: n };
4972
4984
  }
4973
- function Ta(e, { progress: t, health: o, context: r }) {
4985
+ function ka(e, { progress: t, health: o, context: r }) {
4974
4986
  const n = [`# Project Health: ${e}`, ""];
4975
4987
  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(
4976
4988
  `**Completed:** ${t.completedCount} | **Active:** ${t.activeCount} | **Progress:** ${t.progressPercent}%`
@@ -4988,18 +5000,18 @@ function Ta(e, { progress: t, health: o, context: r }) {
4988
5000
  return n.join(`
4989
5001
  `);
4990
5002
  }
4991
- const ka = {
5003
+ const wa = {
4992
5004
  name: g.GET_PROJECT_HEALTH,
4993
5005
  description: "Get a comprehensive health assessment for a project including completion progress, health status (EXCELLENT, ON_TRACK, AT_RISK, CRITICAL), and optional detailed context with project metrics and task-level data. Use includeContext=true for that full detail.",
4994
- parameters: fa,
4995
- outputSchema: ga,
5006
+ parameters: ba,
5007
+ outputSchema: ya,
4996
5008
  annotations: {
4997
5009
  readOnlyHint: !0,
4998
5010
  destructiveHint: !1,
4999
5011
  idempotentHint: !0
5000
5012
  },
5001
5013
  async execute(e, t) {
5002
- const { projectId: o, includeContext: r } = e, n = await ya(t, o, r), i = n.context?.projectName ?? `Project ${o}`, a = Ta(i, n), c = n.context ? {
5014
+ const { projectId: o, includeContext: r } = e, n = await Ta(t, o, r), i = n.context?.projectName ?? `Project ${o}`, a = ka(i, n), c = n.context ? {
5003
5015
  projectDescription: n.context.projectDescription ?? void 0,
5004
5016
  projectMetrics: {
5005
5017
  ...n.context.projectMetrics,
@@ -5037,12 +5049,12 @@ const ka = {
5037
5049
  }
5038
5050
  };
5039
5051
  }
5040
- }, wa = {
5052
+ }, va = {
5041
5053
  workspaceIdOrName: s.string().min(1).describe(
5042
5054
  "The workspace ID or name. Supports exact ID, exact name match (case-insensitive), or unique partial name match."
5043
5055
  ),
5044
5056
  projectIds: s.array(s.string().min(1)).min(1).optional().describe("Optional list of project IDs to scope insights to specific projects.")
5045
- }, va = s.object({
5057
+ }, Ia = s.object({
5046
5058
  projectId: s.string().describe("The project ID."),
5047
5059
  health: s.object({
5048
5060
  status: s.enum(Xe).describe("The health status of the project."),
@@ -5054,22 +5066,22 @@ const ka = {
5054
5066
  activeCount: s.number().describe("Number of active tasks."),
5055
5067
  progressPercent: s.number().describe("Completion percentage (0-100).")
5056
5068
  }).optional().describe("Progress data for this project. Omitted when the project has none.")
5057
- }), Ia = {
5069
+ }), Sa = {
5058
5070
  workspaceId: s.string().describe("The resolved workspace ID."),
5059
5071
  workspaceName: s.string().describe("The resolved workspace name."),
5060
- projectInsights: s.array(va).describe("Health and progress insights for each project in the workspace.")
5061
- }, Sa = {
5072
+ projectInsights: s.array(Ia).describe("Health and progress insights for each project in the workspace.")
5073
+ }, Ca = {
5062
5074
  name: g.GET_WORKSPACE_INSIGHTS,
5063
5075
  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.",
5064
- parameters: wa,
5065
- outputSchema: Ia,
5076
+ parameters: va,
5077
+ outputSchema: Sa,
5066
5078
  annotations: {
5067
5079
  readOnlyHint: !0,
5068
5080
  destructiveHint: !1,
5069
5081
  idempotentHint: !0
5070
5082
  },
5071
5083
  async execute(e, t) {
5072
- const { workspaceIdOrName: o, projectIds: r } = e, n = await us.resolveWorkspace(t, o), a = (await t.getWorkspaceInsights(n.workspaceId, { projectIds: r })).projectInsights.map((d) => ({
5084
+ const { workspaceIdOrName: o, projectIds: r } = e, n = await ps.resolveWorkspace(t, o), a = (await t.getWorkspaceInsights(n.workspaceId, { projectIds: r })).projectInsights.map((d) => ({
5073
5085
  projectId: d.projectId,
5074
5086
  health: d.health ? {
5075
5087
  status: d.health.status,
@@ -5102,7 +5114,7 @@ const ka = {
5102
5114
  };
5103
5115
  }
5104
5116
  };
5105
- function Ca(e) {
5117
+ function ja(e) {
5106
5118
  const t = e.trim();
5107
5119
  if (!/^https?:\/\//i.test(t))
5108
5120
  return t;
@@ -5112,21 +5124,21 @@ function Ca(e) {
5112
5124
  } catch {
5113
5125
  throw new Error(`Could not read a template ID from "${t}".`);
5114
5126
  }
5115
- if (!ja(o.hostname))
5127
+ if (!$a(o.hostname))
5116
5128
  throw new Error(
5117
5129
  `"${o.hostname}" is not a Todoist domain. Pass a todoist.com template URL or the template ID itself.`
5118
5130
  );
5119
5131
  o.hostname = "todoist.com";
5120
- const r = Ws(o.toString());
5132
+ const r = Bs(o.toString());
5121
5133
  if (r?.type !== "template")
5122
5134
  throw new Error(`"${t}" is not a Todoist template URL.`);
5123
5135
  return r.id;
5124
5136
  }
5125
- function ja(e) {
5137
+ function $a(e) {
5126
5138
  const t = e.toLowerCase();
5127
5139
  return t === "todoist.com" || t.endsWith(".todoist.com");
5128
5140
  }
5129
- const $a = {
5141
+ const Da = {
5130
5142
  projectId: s.string().min(1).describe("The ID of the existing project to import the template into."),
5131
5143
  templateId: s.string().optional().describe(
5132
5144
  'The template to import — either a gallery slug ("product-launch"), a personal template ID ("UT_28Ex..."), or a full Todoist template URL, which is reduced to the ID automatically. Gallery templates work for anyone; personal templates only for the account that owns them. There is no way to list templates through this server, so only use the ID or URL the user supplied. Provide either this or `csvFileContent`, not both.'
@@ -5135,16 +5147,16 @@ const $a = {
5135
5147
  "Raw CSV template content, as produced by export-project-template. Provide either this or `templateId`, not both."
5136
5148
  ),
5137
5149
  locale: s.string().optional().describe('Locale for the imported content when using `templateId`. Defaults to "en".')
5138
- }, Da = {
5150
+ }, Aa = {
5139
5151
  sections: s.array(K).describe("Sections created by the import."),
5140
5152
  tasks: s.array(B).describe("Tasks created by the import."),
5141
5153
  comments: s.array(Te).describe("Comments created by the import."),
5142
5154
  totalCount: s.number().describe("The total number of objects created by the import.")
5143
- }, Aa = {
5155
+ }, xa = {
5144
5156
  name: g.IMPORT_PROJECT_TEMPLATE,
5145
5157
  description: "Import a template into an existing project, adding its tasks, sections and comments to whatever is already there. Source it by template ID/URL or by passing CSV content from export-project-template. To start a new project from a template, create the project with add-projects first, then import into it. This writes immediately and cannot be undone, so only run it against a project the user named.",
5146
- parameters: $a,
5147
- outputSchema: Da,
5158
+ parameters: Da,
5159
+ outputSchema: Aa,
5148
5160
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
5149
5161
  async execute({ projectId: e, templateId: t, csvFileContent: o, locale: r }, n) {
5150
5162
  if (!!t == !!o)
@@ -5153,7 +5165,7 @@ const $a = {
5153
5165
  );
5154
5166
  const i = t ? await n.importTemplateFromId({
5155
5167
  projectId: e,
5156
- templateId: Ca(t),
5168
+ templateId: ja(t),
5157
5169
  locale: r
5158
5170
  }) : await n.importTemplateIntoProject({
5159
5171
  projectId: e,
@@ -5161,7 +5173,7 @@ const $a = {
5161
5173
  fileName: "template.csv"
5162
5174
  }), a = i.sections.map(Y), c = i.tasks.map(P), d = i.comments.map(ye), l = i.projects.length + a.length + c.length + d.length;
5163
5175
  return {
5164
- textContent: xa({
5176
+ textContent: Ea({
5165
5177
  projectId: e,
5166
5178
  counts: {
5167
5179
  projects: i.projects.length,
@@ -5175,7 +5187,7 @@ const $a = {
5175
5187
  };
5176
5188
  }
5177
5189
  };
5178
- function xa({
5190
+ function Ea({
5179
5191
  projectId: e,
5180
5192
  counts: t,
5181
5193
  totalCount: o
@@ -5185,21 +5197,21 @@ function xa({
5185
5197
  const r = Object.entries(t).filter(([, n]) => n > 0).map(([n, i]) => `${i} ${i === 1 ? n.replace(/s$/, "") : n}`);
5186
5198
  return `Imported template into project (id=${e}): ${r.join(", ")}.`;
5187
5199
  }
5188
- const Ea = {}, Oa = {
5200
+ const Oa = {}, Pa = {
5189
5201
  id: s.string().describe("The unique identifier for the workspace."),
5190
5202
  name: s.string().describe("The name of the workspace."),
5191
- plan: s.enum(zs).describe("The workspace plan type."),
5192
- role: s.enum(Bs).optional().describe("The user's role in the workspace, if available."),
5203
+ plan: s.enum(Ks).describe("The workspace plan type."),
5204
+ role: s.enum(zs).optional().describe("The user's role in the workspace, if available."),
5193
5205
  isLinkSharingEnabled: s.boolean().describe("Whether link sharing is enabled for the workspace."),
5194
5206
  isGuestAllowed: s.boolean().describe("Whether guests are allowed in the workspace."),
5195
5207
  createdAt: s.string().optional().describe("The ISO 8601 timestamp when the workspace was created."),
5196
5208
  creatorId: s.string().describe("The ID of the user who created the workspace.")
5197
- }, Pa = {
5209
+ }, _a = {
5198
5210
  type: s.literal("workspaces").describe("The type of the response."),
5199
- workspaces: s.array(s.object(Oa)).describe("List of workspaces."),
5211
+ workspaces: s.array(s.object(Pa)).describe("List of workspaces."),
5200
5212
  count: s.number().describe("The total number of workspaces.")
5201
5213
  };
5202
- async function _a(e) {
5214
+ async function Ua(e) {
5203
5215
  const o = (await e.getWorkspaces()).map((a) => ({
5204
5216
  id: a.id,
5205
5217
  name: a.name,
@@ -5230,22 +5242,22 @@ async function _a(e) {
5230
5242
  };
5231
5243
  return { textContent: n, structuredContent: i };
5232
5244
  }
5233
- const Ua = {
5245
+ const Ra = {
5234
5246
  name: g.LIST_WORKSPACES,
5235
5247
  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.",
5236
- parameters: Ea,
5237
- outputSchema: Pa,
5248
+ parameters: Oa,
5249
+ outputSchema: _a,
5238
5250
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
5239
5251
  async execute(e, t) {
5240
- const o = await _a(t);
5252
+ const o = await Ua(t);
5241
5253
  return {
5242
5254
  textContent: o.textContent,
5243
5255
  structuredContent: o.structuredContent
5244
5256
  };
5245
5257
  }
5246
- }, { FIND_TASKS: Ra, FIND_PROJECT_COLLABORATORS: Ut, UPDATE_TASKS: La } = g, Na = 50, Ma = {
5258
+ }, { FIND_TASKS: La, FIND_PROJECT_COLLABORATORS: Ut, UPDATE_TASKS: Na } = g, Ma = 50, Fa = {
5247
5259
  operation: s.enum(["assign", "unassign", "reassign"]).describe("The assignment operation to perform."),
5248
- taskIds: s.array(s.string()).min(1).max(Na).describe("The IDs of the tasks to operate on (max 50)."),
5260
+ taskIds: s.array(s.string()).min(1).max(Ma).describe("The IDs of the tasks to operate on (max 50)."),
5249
5261
  responsibleUser: s.string().optional().describe(
5250
5262
  '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.'
5251
5263
  ),
@@ -5253,7 +5265,7 @@ const Ua = {
5253
5265
  "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."
5254
5266
  ),
5255
5267
  dryRun: s.boolean().optional().default(!1).describe("If true, validates operations without executing them.")
5256
- }, Fa = {
5268
+ }, Ha = {
5257
5269
  results: s.array(
5258
5270
  s.object({
5259
5271
  taskId: s.string().describe("The ID of the task."),
@@ -5269,11 +5281,11 @@ const Ua = {
5269
5281
  failed: s.number().describe("Number of failed operations."),
5270
5282
  dryRun: s.boolean().describe("Whether this was a dry run.")
5271
5283
  }).optional().describe("Summary of the operation.")
5272
- }, Ha = {
5284
+ }, Wa = {
5273
5285
  name: g.MANAGE_ASSIGNMENTS,
5274
5286
  description: "Bulk assignment operations for multiple tasks. Supports assign, unassign, and reassign operations with atomic rollback on failures.",
5275
- parameters: Ma,
5276
- outputSchema: Fa,
5287
+ parameters: Fa,
5288
+ outputSchema: Ha,
5277
5289
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
5278
5290
  async execute(e, t) {
5279
5291
  const { operation: o, taskIds: r, responsibleUser: n, fromAssigneeUser: i, dryRun: a } = e;
@@ -5496,8 +5508,8 @@ function Pe({
5496
5508
  `;
5497
5509
  }
5498
5510
  return !o && r.length > 0 ? (c += `**Next steps:**
5499
- `, c += `• Use ${Ra} with responsibleUser to see ${e === "unassign" ? "unassigned" : "newly assigned"} tasks
5500
- `, c += `• Use ${La} for individual assignment changes
5511
+ `, c += `• Use ${La} with responsibleUser to see ${e === "unassign" ? "unassigned" : "newly assigned"} tasks
5512
+ `, c += `• Use ${Na} for individual assignment changes
5501
5513
  `, n.length > 0 && (c += `• Check failed tasks and use ${Ut} to verify collaborator access
5502
5514
  `)) : o ? (c += `**To execute:**
5503
5515
  `, c += `• Remove dryRun parameter and run again to execute changes
@@ -5509,17 +5521,17 @@ function Pe({
5509
5521
  `, c += `• Use dryRun=true to validate before executing
5510
5522
  `), c;
5511
5523
  }
5512
- const Wa = {
5524
+ const Ba = {
5513
5525
  action: s.enum(["archive", "unarchive"]).describe("The action to perform on the project."),
5514
5526
  projectId: s.string().min(1).describe("The ID of the project.")
5515
- }, Ba = {
5527
+ }, za = {
5516
5528
  project: Z.describe("The updated project."),
5517
5529
  success: s.boolean().describe("Whether the action was successful.")
5518
- }, za = {
5530
+ }, Ka = {
5519
5531
  name: g.PROJECT_MANAGEMENT,
5520
5532
  description: "Archive or unarchive a project by its ID.",
5521
- parameters: Wa,
5522
- outputSchema: Ba,
5533
+ parameters: Ba,
5534
+ outputSchema: za,
5523
5535
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
5524
5536
  async execute(e, t) {
5525
5537
  const o = e.action === "archive" ? await t.archiveProject(e.projectId) : await t.unarchiveProject(e.projectId), r = Q(o);
@@ -5531,7 +5543,7 @@ const Wa = {
5531
5543
  }
5532
5544
  };
5533
5545
  }
5534
- }, Ka = {
5546
+ }, Ya = {
5535
5547
  action: s.enum(["move-to-workspace", "move-to-personal"]).describe("The action to perform on the project."),
5536
5548
  projectId: s.string().min(1).describe("The ID of the project to move."),
5537
5549
  workspaceId: s.string().min(1).optional().describe("The target workspace ID. Required when action is move-to-workspace."),
@@ -5539,14 +5551,14 @@ const Wa = {
5539
5551
  visibility: s.enum(["restricted", "team", "public"]).optional().describe(
5540
5552
  "Optional access visibility for the project in the workspace (restricted, team, or public)."
5541
5553
  )
5542
- }, Ya = {
5554
+ }, Ga = {
5543
5555
  project: Z.describe("The moved project."),
5544
5556
  success: s.boolean().describe("Whether the move was successful.")
5545
- }, Ga = {
5557
+ }, qa = {
5546
5558
  name: g.PROJECT_MOVE,
5547
5559
  description: "Move a project between personal and workspace contexts.",
5548
- parameters: Ka,
5549
- outputSchema: Ya,
5560
+ parameters: Ya,
5561
+ outputSchema: Ga,
5550
5562
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
5551
5563
  async execute(e, t) {
5552
5564
  let o;
@@ -5569,8 +5581,8 @@ const Wa = {
5569
5581
  }
5570
5582
  };
5571
5583
  }
5572
- }, $s = ["project", "section"], qa = {
5573
- type: s.enum($s).describe(
5584
+ }, Ds = ["project", "section"], Va = {
5585
+ type: s.enum(Ds).describe(
5574
5586
  '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.'
5575
5587
  ),
5576
5588
  items: s.array(
@@ -5586,17 +5598,17 @@ const Wa = {
5586
5598
  ).min(1).describe(
5587
5599
  "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."
5588
5600
  )
5589
- }, Va = {
5590
- type: s.enum($s).describe("The type of entity that was reordered/moved."),
5601
+ }, Ja = {
5602
+ type: s.enum(Ds).describe("The type of entity that was reordered/moved."),
5591
5603
  movedCount: s.number().describe("The number of entities moved to a new parent."),
5592
5604
  reorderedCount: s.number().describe("The number of entities reordered."),
5593
5605
  affectedIds: s.array(s.string()).describe("The IDs of all affected entities."),
5594
5606
  success: s.boolean().describe("Whether the operation was successful.")
5595
- }, Ja = {
5607
+ }, Xa = {
5596
5608
  name: g.REORDER_OBJECTS,
5597
5609
  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.',
5598
- parameters: qa,
5599
- outputSchema: Va,
5610
+ parameters: Va,
5611
+ outputSchema: Ja,
5600
5612
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
5601
5613
  async execute(e, t) {
5602
5614
  const { type: o, items: r } = e, n = /* @__PURE__ */ new Set();
@@ -5658,22 +5670,22 @@ const Wa = {
5658
5670
  }
5659
5671
  };
5660
5672
  }
5661
- }, Xa = s.object({
5673
+ }, Qa = s.object({
5662
5674
  id: s.string().min(1).describe("The ID of the task to reschedule."),
5663
5675
  date: s.string().min(1).describe(
5664
5676
  "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."
5665
5677
  )
5666
- }), Qa = {
5667
- tasks: s.array(Xa).min(1).describe("The tasks to reschedule with their new dates.")
5668
- }, Za = {
5678
+ }), Za = {
5679
+ tasks: s.array(Qa).min(1).describe("The tasks to reschedule with their new dates.")
5680
+ }, ec = {
5669
5681
  tasks: s.array(B).describe("The rescheduled tasks."),
5670
5682
  totalCount: s.number().describe("The total number of tasks rescheduled."),
5671
5683
  rescheduledTaskIds: s.array(s.string()).describe("The IDs of the rescheduled tasks.")
5672
- }, ec = {
5684
+ }, tc = {
5673
5685
  name: g.RESCHEDULE_TASKS,
5674
5686
  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.",
5675
- parameters: Qa,
5676
- outputSchema: Za,
5687
+ parameters: Za,
5688
+ outputSchema: ec,
5677
5689
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
5678
5690
  async execute(e, t) {
5679
5691
  const { tasks: o } = e, n = (await Promise.all(
@@ -5686,7 +5698,7 @@ const Wa = {
5686
5698
  throw new Error(
5687
5699
  `Task "${l.content}" (${l.id}) has no due date. Rescheduling requires an existing due date.`
5688
5700
  );
5689
- const u = tc(d.date, l.due);
5701
+ const u = sc(d.date, l.due);
5690
5702
  return J("item_update", {
5691
5703
  id: d.id,
5692
5704
  due: {
@@ -5717,16 +5729,16 @@ const Wa = {
5717
5729
  };
5718
5730
  }
5719
5731
  };
5720
- function tc(e, t) {
5732
+ function sc(e, t) {
5721
5733
  if (/^\d{4}-\d{2}-\d{2}$/.test(e) && t.datetime) {
5722
5734
  const r = t.datetime.substring(10);
5723
5735
  return e + r;
5724
5736
  }
5725
5737
  return e;
5726
5738
  }
5727
- const sc = {
5739
+ const oc = {
5728
5740
  query: s.string().min(1).describe("The search query string to find tasks and projects.")
5729
- }, oc = {
5741
+ }, rc = {
5730
5742
  results: s.array(
5731
5743
  s.object({
5732
5744
  id: s.string().describe("The ID of the result."),
@@ -5735,11 +5747,11 @@ const sc = {
5735
5747
  })
5736
5748
  ).describe("The search results."),
5737
5749
  totalCount: s.number().describe("Total number of results found.")
5738
- }, rc = {
5750
+ }, nc = {
5739
5751
  name: g.SEARCH,
5740
5752
  description: "Search across tasks and projects in Todoist. Returns a list of relevant results with IDs, titles, and URLs.",
5741
- parameters: sc,
5742
- outputSchema: oc,
5753
+ parameters: oc,
5754
+ outputSchema: rc,
5743
5755
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
5744
5756
  async execute(e, t) {
5745
5757
  const { query: o } = e, [r, n] = await Promise.all([
@@ -5768,19 +5780,19 @@ const sc = {
5768
5780
  structuredContent: { results: i, totalCount: i.length }
5769
5781
  };
5770
5782
  }
5771
- }, nc = {
5772
- ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to uncomplete.")
5773
5783
  }, ic = {
5784
+ ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to uncomplete.")
5785
+ }, ac = {
5774
5786
  uncompleted: s.array(s.string()).describe("The IDs of successfully uncompleted tasks."),
5775
5787
  failures: s.array(ee).describe("Failed task uncompletion with error details."),
5776
5788
  totalRequested: s.number().describe("The total number of tasks requested to uncomplete."),
5777
5789
  successCount: s.number().describe("The number of successfully uncompleted tasks."),
5778
5790
  failureCount: s.number().describe("The number of failed task uncompletions.")
5779
- }, ac = {
5791
+ }, cc = {
5780
5792
  name: g.UNCOMPLETE_TASKS,
5781
5793
  description: "Uncomplete (reopen) one or more completed tasks by their IDs.",
5782
- parameters: nc,
5783
- outputSchema: ic,
5794
+ parameters: ic,
5795
+ outputSchema: ac,
5784
5796
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
5785
5797
  async execute(e, t) {
5786
5798
  const o = [], r = [];
@@ -5790,11 +5802,11 @@ const sc = {
5790
5802
  } catch (a) {
5791
5803
  r.push({
5792
5804
  item: i,
5793
- error: R(a)
5805
+ error: L(a)
5794
5806
  });
5795
5807
  }
5796
5808
  return te(g.UNCOMPLETE_TASKS, e.ids.length, r), {
5797
- textContent: cc({
5809
+ textContent: dc({
5798
5810
  uncompleted: o,
5799
5811
  failures: r,
5800
5812
  args: e
@@ -5809,7 +5821,7 @@ const sc = {
5809
5821
  };
5810
5822
  }
5811
5823
  };
5812
- function cc({
5824
+ function dc({
5813
5825
  uncompleted: e,
5814
5826
  failures: t,
5815
5827
  args: o
@@ -5823,28 +5835,28 @@ function cc({
5823
5835
  failures: t
5824
5836
  });
5825
5837
  }
5826
- const dc = s.object({
5838
+ const lc = s.object({
5827
5839
  id: s.string().min(1).describe("The ID of the comment to update."),
5828
5840
  content: s.string().min(1).describe("The new content for the comment.")
5829
- }), lc = {
5830
- comments: s.array(dc).min(1).describe("The comments to update.")
5831
- }, uc = {
5841
+ }), uc = {
5842
+ comments: s.array(lc).min(1).describe("The comments to update.")
5843
+ }, pc = {
5832
5844
  comments: s.array(Te).describe("The updated comments."),
5833
5845
  totalCount: s.number().describe("The total number of comments updated."),
5834
5846
  updatedCommentIds: s.array(s.string()).describe("The IDs of the updated comments."),
5835
5847
  appliedOperations: s.object({
5836
5848
  updateCount: s.number().describe("The number of comments updated.")
5837
5849
  }).describe("Summary of operations performed.")
5838
- }, pc = {
5850
+ }, hc = {
5839
5851
  name: g.UPDATE_COMMENTS,
5840
5852
  description: "Update multiple existing comments with new content.",
5841
- parameters: lc,
5842
- outputSchema: uc,
5853
+ parameters: uc,
5854
+ outputSchema: pc,
5843
5855
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
5844
5856
  async execute(e, t) {
5845
5857
  const { comments: o } = e, r = o.map(async (c) => await t.updateComment(c.id, { content: c.content })), i = (await Promise.all(r)).map(ye);
5846
5858
  return {
5847
- textContent: hc({
5859
+ textContent: mc({
5848
5860
  comments: i
5849
5861
  }),
5850
5862
  structuredContent: {
@@ -5858,7 +5870,7 @@ const dc = s.object({
5858
5870
  };
5859
5871
  }
5860
5872
  };
5861
- function hc({ comments: e }) {
5873
+ function mc({ comments: e }) {
5862
5874
  const t = e.filter((i) => i.taskId).length, o = e.filter((i) => i.projectId).length, r = [];
5863
5875
  if (t > 0) {
5864
5876
  const i = t > 1 ? "comments" : "comment";
@@ -5870,17 +5882,24 @@ function hc({ comments: e }) {
5870
5882
  }
5871
5883
  return r.length > 0 ? `Updated ${r.join(" and ")}` : "No comments updated";
5872
5884
  }
5873
- const mc = s.object({
5885
+ const fc = s.object({
5874
5886
  id: s.string().min(1).describe("The ID of the filter to update."),
5875
5887
  name: s.string().min(1).optional().describe("The new name of the filter."),
5876
5888
  query: s.string().min(1).optional().describe(
5877
5889
  'The new filter query string. Examples: "today & p1", "#Work & overdue", "@email & today".'
5878
5890
  ),
5891
+ description: s.preprocess(
5892
+ // Keep accepting legacy null while exposing a Gemini-compatible string schema.
5893
+ (e) => e === null ? "remove" : e,
5894
+ s.string().describe(
5895
+ 'A markdown description explaining what the filter is for. Use "remove" to clear the description; omit the field to leave it unchanged.'
5896
+ )
5897
+ ).optional(),
5879
5898
  color: pe,
5880
5899
  isFavorite: s.boolean().optional().describe("Whether to mark the filter as a favorite.")
5881
- }), fc = {
5882
- filters: s.array(mc).min(1).describe("The filters to update.")
5883
- }, bc = {
5900
+ }), bc = {
5901
+ filters: s.array(fc).min(1).describe("The filters to update.")
5902
+ }, gc = {
5884
5903
  filters: s.array(it).describe("The updated filters."),
5885
5904
  totalCount: s.number().describe("The total number of filters updated."),
5886
5905
  updatedFilterIds: s.array(s.string()).describe("The IDs of the updated filters."),
@@ -5888,15 +5907,15 @@ const mc = s.object({
5888
5907
  updateCount: s.number().describe("The number of filters actually updated."),
5889
5908
  skippedCount: s.number().describe("The number of filters skipped (no changes).")
5890
5909
  }).describe("Summary of operations performed.")
5891
- }, gc = {
5910
+ }, yc = {
5892
5911
  name: g.UPDATE_FILTERS,
5893
5912
  description: "Update one or more existing personal filters with new values.",
5894
- parameters: fc,
5895
- outputSchema: bc,
5913
+ parameters: bc,
5914
+ outputSchema: gc,
5896
5915
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
5897
5916
  async execute(e, t) {
5898
5917
  const { filters: o } = e, r = [], i = o.map((h) => {
5899
- const m = Tc(h);
5918
+ const m = kc(h);
5900
5919
  return m !== null ? { kind: "skipped", reason: m } : (r.push(h), { kind: "updated", filter: h });
5901
5920
  }).filter((h) => h.kind === "skipped").length;
5902
5921
  if (r.length === 0)
@@ -5910,10 +5929,12 @@ const mc = s.object({
5910
5929
  }
5911
5930
  };
5912
5931
  const a = r.map((h) => {
5913
- const { id: m, color: y, ...f } = h;
5932
+ const { id: m, color: y, description: f, ...w } = h;
5914
5933
  return J("filter_update", {
5915
5934
  id: m,
5916
- ...f,
5935
+ ...w,
5936
+ // "remove" is the house sentinel for clearing a field; the API clears on null.
5937
+ ...f !== void 0 ? { description: f === "remove" ? null : f } : {},
5917
5938
  ...y !== void 0 ? { color: y } : {}
5918
5939
  });
5919
5940
  });
@@ -5922,12 +5943,13 @@ const mc = s.object({
5922
5943
  id: h.id,
5923
5944
  name: h.name,
5924
5945
  query: h.query,
5946
+ description: ls(h),
5925
5947
  color: he.parse(h.color),
5926
5948
  isFavorite: h.isFavorite,
5927
5949
  itemOrder: h.itemOrder
5928
5950
  }));
5929
5951
  return {
5930
- textContent: yc({ filters: u, skippedCount: i }),
5952
+ textContent: Tc({ filters: u, skippedCount: i }),
5931
5953
  structuredContent: {
5932
5954
  filters: u,
5933
5955
  totalCount: u.length,
@@ -5940,7 +5962,7 @@ const mc = s.object({
5940
5962
  };
5941
5963
  }
5942
5964
  };
5943
- function yc({
5965
+ function Tc({
5944
5966
  filters: e,
5945
5967
  skippedCount: t
5946
5968
  }) {
@@ -5954,52 +5976,52 @@ ${n}`;
5954
5976
  }
5955
5977
  return r;
5956
5978
  }
5957
- function Tc({ id: e, ...t }) {
5979
+ function kc({ id: e, ...t }) {
5958
5980
  return Object.values(t).every((r) => r === void 0) ? "no-fields" : null;
5959
5981
  }
5960
- const kc = s.object({
5982
+ const wc = s.object({
5961
5983
  labelType: s.literal("personal").describe("Update a personal label, identified by its ID."),
5962
5984
  id: s.string().min(1).describe("The ID of the personal label to update."),
5963
5985
  name: s.string().min(1).max(128).optional().describe("The new name of the label."),
5964
5986
  color: pe,
5965
5987
  order: s.number().int().optional().describe("The new position of the label in the label list."),
5966
5988
  isFavorite: s.boolean().optional().describe("Whether to mark the label as a favorite.")
5967
- }), wc = s.object({
5989
+ }), vc = s.object({
5968
5990
  labelType: s.literal("shared").describe(
5969
5991
  "Rename a shared label across all tasks. Shared labels are identified by name; only renaming is supported (no color, order, or favorite)."
5970
5992
  ),
5971
5993
  name: s.string().min(1).describe("The current name of the shared label."),
5972
5994
  newName: s.string().min(1).describe("The new name for the shared label.")
5973
- }), vc = s.discriminatedUnion("labelType", [
5974
- kc,
5975
- wc
5976
- ]), Ic = {
5977
- labels: s.array(vc).min(1).describe(
5995
+ }), Ic = s.discriminatedUnion("labelType", [
5996
+ wc,
5997
+ vc
5998
+ ]), Sc = {
5999
+ labels: s.array(Ic).min(1).describe(
5978
6000
  '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.'
5979
6001
  )
5980
- }, Sc = s.object({
6002
+ }, Cc = s.object({
5981
6003
  name: s.string().describe("The previous name of the shared label."),
5982
6004
  newName: s.string().describe("The new name of the shared label.")
5983
- }), Cc = {
6005
+ }), jc = {
5984
6006
  updatedLabels: s.array(me).describe("The updated personal labels."),
5985
- renamedSharedLabels: s.array(Sc).describe("The shared labels that were renamed."),
6007
+ renamedSharedLabels: s.array(Cc).describe("The shared labels that were renamed."),
5986
6008
  totalCount: s.number().describe("The total number of successful operations (personal + shared)."),
5987
6009
  appliedOperations: s.object({
5988
6010
  updateCount: s.number().describe("Number of personal labels updated."),
5989
6011
  renameCount: s.number().describe("Number of shared labels renamed."),
5990
6012
  skippedCount: s.number().describe("Number of operations skipped (no changes or shared label not found).")
5991
6013
  }).describe("Summary of operations performed.")
5992
- }, jc = {
6014
+ }, $c = {
5993
6015
  name: g.UPDATE_LABELS,
5994
6016
  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.",
5995
- parameters: Ic,
5996
- outputSchema: Cc,
6017
+ parameters: Sc,
6018
+ outputSchema: jc,
5997
6019
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
5998
6020
  async execute(e, t) {
5999
6021
  const { labels: o } = e, r = await Promise.all(
6000
6022
  o.map(async (u) => {
6001
6023
  if (u.labelType === "personal") {
6002
- const h = Dc(u);
6024
+ const h = Ac(u);
6003
6025
  if (h !== null) return { kind: "skipped", reason: h };
6004
6026
  const { id: m, labelType: y, ...f } = u;
6005
6027
  return { kind: "updated", label: await t.updateLabel(m, f) };
@@ -6017,7 +6039,7 @@ const kc = s.object({
6017
6039
  (u) => u.kind === "skipped" && u.reason === "not-found"
6018
6040
  ).length;
6019
6041
  return {
6020
- textContent: $c({
6042
+ textContent: Dc({
6021
6043
  updatedLabels: n,
6022
6044
  renamedSharedLabels: i,
6023
6045
  skippedNoFields: c,
@@ -6036,7 +6058,7 @@ const kc = s.object({
6036
6058
  };
6037
6059
  }
6038
6060
  };
6039
- function $c({
6061
+ function Dc({
6040
6062
  updatedLabels: e,
6041
6063
  renamedSharedLabels: t,
6042
6064
  skippedNoFields: o,
@@ -6058,14 +6080,14 @@ function $c({
6058
6080
  return c.join(`
6059
6081
  `);
6060
6082
  }
6061
- function Dc({
6083
+ function Ac({
6062
6084
  id: e,
6063
6085
  labelType: t,
6064
6086
  ...o
6065
6087
  }) {
6066
6088
  return Object.values(o).every((n) => n === void 0) ? "no-fields" : null;
6067
6089
  }
6068
- const Ac = s.object({
6090
+ const xc = s.object({
6069
6091
  id: s.string().min(1).describe("The ID of the project to update."),
6070
6092
  name: s.string().min(1).optional().describe("The new name of the project."),
6071
6093
  isFavorite: s.boolean().optional().describe("Whether the project is a favorite."),
@@ -6080,9 +6102,9 @@ const Ac = s.object({
6080
6102
  )
6081
6103
  ).optional(),
6082
6104
  color: pe
6083
- }), xc = {
6084
- projects: s.array(Ac).min(1).describe("The projects to update.")
6085
- }, Ec = {
6105
+ }), Ec = {
6106
+ projects: s.array(xc).min(1).describe("The projects to update.")
6107
+ }, Oc = {
6086
6108
  projects: s.array(Z).describe("The updated projects."),
6087
6109
  totalCount: s.number().describe("The total number of projects updated."),
6088
6110
  updatedProjectIds: s.array(s.string()).describe("The IDs of the updated projects."),
@@ -6094,16 +6116,16 @@ const Ac = s.object({
6094
6116
  skippedCount: s.number().describe("The number of projects skipped (no changes)."),
6095
6117
  failureCount: s.number().describe("The number of projects that failed to update.")
6096
6118
  }).describe("Summary of operations performed.")
6097
- }, Oc = {
6119
+ }, Pc = {
6098
6120
  name: g.UPDATE_PROJECTS,
6099
6121
  description: "Update multiple existing projects with new values.",
6100
- parameters: xc,
6101
- outputSchema: Ec,
6122
+ parameters: Ec,
6123
+ outputSchema: Oc,
6102
6124
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
6103
6125
  async execute(e, t) {
6104
6126
  const { projects: o } = e, r = await Promise.allSettled(
6105
6127
  o.map(async (l) => {
6106
- const u = _c(l);
6128
+ const u = Uc(l);
6107
6129
  if (u !== null) return { kind: "skipped", reason: u };
6108
6130
  const { id: p, ...h } = l;
6109
6131
  return { kind: "updated", project: await O(() => t.updateProject(p, h)) };
@@ -6114,14 +6136,14 @@ const Ac = s.object({
6114
6136
  if (u.status === "rejected") {
6115
6137
  i.push({
6116
6138
  item: o[l]?.id ?? `Project ${l + 1}`,
6117
- error: R(u.reason)
6139
+ error: L(u.reason)
6118
6140
  });
6119
6141
  continue;
6120
6142
  }
6121
6143
  u.value.kind === "updated" ? n.push(Q(u.value.project)) : u.value.reason === "no-fields" ? a++ : c++;
6122
6144
  }
6123
6145
  return te(g.UPDATE_PROJECTS, o.length, i), {
6124
- textContent: Pc({
6146
+ textContent: _c({
6125
6147
  projects: n,
6126
6148
  skippedNoFields: a,
6127
6149
  skippedNoValidValues: c,
@@ -6141,7 +6163,7 @@ const Ac = s.object({
6141
6163
  };
6142
6164
  }
6143
6165
  };
6144
- function Pc({
6166
+ function _c({
6145
6167
  projects: e,
6146
6168
  skippedNoFields: t,
6147
6169
  skippedNoValidValues: o,
@@ -6154,49 +6176,49 @@ function Pc({
6154
6176
  return t > 0 && c.push(`${t} skipped - no changes`), o > 0 && c.push(`${o} skipped - no valid field values`), c.length > 0 && (a += ` (${c.join(", ")})`), n > 0 && (a += `:
6155
6177
  ${i}`), dt(a, r);
6156
6178
  }
6157
- function _c({ id: e, ...t }) {
6179
+ function Uc({ id: e, ...t }) {
6158
6180
  const o = Object.values(t);
6159
6181
  return o.length === 0 ? "no-fields" : o.every((r) => r === void 0) ? "no-valid-values" : null;
6160
6182
  }
6161
- const Uc = s.object({
6183
+ const Rc = s.object({
6162
6184
  type: s.literal("relative"),
6163
6185
  id: s.string().min(1).describe("The ID of the relative reminder to update."),
6164
6186
  minuteOffset: s.number().int().min(0).optional().describe("New minute offset before task due time."),
6165
6187
  service: je.optional().describe('New delivery method: "email" or "push".'),
6166
6188
  isUrgent: $e
6167
- }), Rc = s.object({
6189
+ }), Lc = s.object({
6168
6190
  type: s.literal("absolute"),
6169
6191
  id: s.string().min(1).describe("The ID of the absolute reminder to update."),
6170
- due: ps.optional().describe("New due date/time for the reminder."),
6192
+ due: hs.optional().describe("New due date/time for the reminder."),
6171
6193
  service: je.optional().describe('New delivery method: "email" or "push".'),
6172
6194
  isUrgent: $e
6173
- }), Lc = s.object({
6195
+ }), Nc = s.object({
6174
6196
  type: s.literal("location"),
6175
6197
  id: s.string().min(1).describe("The ID of the location reminder to update."),
6176
6198
  name: s.string().optional().describe("New location name."),
6177
6199
  locLat: s.string().optional().describe("New latitude."),
6178
6200
  locLong: s.string().optional().describe("New longitude."),
6179
- locTrigger: hs.optional().describe(
6201
+ locTrigger: ms.optional().describe(
6180
6202
  'New trigger condition: "on_enter" or "on_leave".'
6181
6203
  ),
6182
6204
  radius: s.number().int().optional().describe("New radius in meters.")
6183
- }), Nc = s.discriminatedUnion("type", [
6184
- Uc,
6205
+ }), Mc = s.discriminatedUnion("type", [
6185
6206
  Rc,
6186
- Lc
6187
- ]), Mc = {
6188
- reminders: s.array(Nc).min(1).max(ve).describe(
6207
+ Lc,
6208
+ Nc
6209
+ ]), Fc = {
6210
+ reminders: s.array(Mc).min(1).max(ve).describe(
6189
6211
  `Array of reminders to update (max ${ve}). Each must include the reminder type and ID. Only include fields that need to change.`
6190
6212
  )
6191
- }, Fc = {
6213
+ }, Hc = {
6192
6214
  reminders: s.array(nt).describe("The updated reminders."),
6193
6215
  totalCount: s.number().describe("Total reminders updated."),
6194
6216
  updatedReminderIds: s.array(s.string()).describe("IDs of updated reminders.")
6195
- }, Hc = {
6217
+ }, Wc = {
6196
6218
  name: g.UPDATE_REMINDERS,
6197
6219
  description: 'Update existing reminders. Each reminder must specify its type ("relative", "absolute", or "location") and ID. Only include fields that need to change.',
6198
- parameters: Mc,
6199
- outputSchema: Fc,
6220
+ parameters: Fc,
6221
+ outputSchema: Hc,
6200
6222
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !0 },
6201
6223
  async execute(e, t) {
6202
6224
  const { reminders: o } = e, r = o.map(async (d) => {
@@ -6230,7 +6252,7 @@ const Uc = s.object({
6230
6252
  }
6231
6253
  };
6232
6254
  }
6233
- }, Wc = s.object({
6255
+ }, Bc = s.object({
6234
6256
  id: s.string().min(1).describe("The ID of the section to update."),
6235
6257
  name: s.string().min(1).optional().describe("The new name of the section."),
6236
6258
  description: s.preprocess(
@@ -6245,17 +6267,17 @@ const Uc = s.object({
6245
6267
  ).optional()
6246
6268
  }).refine((e) => e.name !== void 0 || e.description !== void 0, {
6247
6269
  message: 'Provide at least one of "name" or "description" to update.'
6248
- }), Bc = {
6249
- sections: s.array(Wc).min(1).describe("The sections to update.")
6250
- }, zc = {
6270
+ }), zc = {
6271
+ sections: s.array(Bc).min(1).describe("The sections to update.")
6272
+ }, Kc = {
6251
6273
  sections: s.array(K).describe("The updated sections."),
6252
6274
  totalCount: s.number().describe("The total number of sections updated."),
6253
6275
  updatedSectionIds: s.array(s.string()).describe("The IDs of the updated sections.")
6254
- }, Kc = {
6276
+ }, Yc = {
6255
6277
  name: g.UPDATE_SECTIONS,
6256
6278
  description: "Update multiple existing sections with new values.",
6257
- parameters: Bc,
6258
- outputSchema: zc,
6279
+ parameters: zc,
6280
+ outputSchema: Kc,
6259
6281
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
6260
6282
  async execute({ sections: e }, t) {
6261
6283
  const o = await Promise.all(
@@ -6268,7 +6290,7 @@ const Uc = s.object({
6268
6290
  })
6269
6291
  );
6270
6292
  return {
6271
- textContent: Yc({
6293
+ textContent: Gc({
6272
6294
  sections: o
6273
6295
  }),
6274
6296
  structuredContent: {
@@ -6279,36 +6301,36 @@ const Uc = s.object({
6279
6301
  };
6280
6302
  }
6281
6303
  };
6282
- function Yc({ sections: e }) {
6304
+ function Gc({ sections: e }) {
6283
6305
  const t = e.length, o = e.map((n) => `• ${n.name} (id=${n.id}, projectId=${n.projectId})`).join(`
6284
6306
  `);
6285
6307
  return `Updated ${t} section${t === 1 ? "" : "s"}:
6286
6308
  ${o}`;
6287
6309
  }
6288
- function Ds(e, t) {
6310
+ function As(e, t) {
6289
6311
  return t.projectId !== void 0 ? e.projectId === t.projectId && !e.sectionId && !e.parentId : t.sectionId !== void 0 ? e.sectionId === t.sectionId && !e.parentId : e.parentId === t.parentId;
6290
6312
  }
6291
- function Gc(e, t) {
6313
+ function qc(e, t) {
6292
6314
  return t.projectId !== void 0 ? e.projectId === t.projectId : t.sectionId !== void 0 ? e.sectionId === t.sectionId : e.parentId === t.parentId;
6293
6315
  }
6294
- function qc(e) {
6316
+ function Vc(e) {
6295
6317
  return e.projectId !== void 0 ? `project:${e.projectId}` : e.sectionId !== void 0 ? `section:${e.sectionId}` : `parent:${e.parentId}`;
6296
6318
  }
6297
- function Vc(e) {
6319
+ function Jc(e) {
6298
6320
  const t = [];
6299
6321
  return e.projectId && t.push({ projectId: e.projectId }), e.sectionId && t.push({ sectionId: e.sectionId }), e.parentId && t.push({ parentId: e.parentId }), t;
6300
6322
  }
6301
- function Jc({
6323
+ function Xc({
6302
6324
  taskId: e,
6303
6325
  request: t,
6304
6326
  current: o
6305
6327
  }) {
6306
- const r = Vc(t);
6328
+ const r = Jc(t);
6307
6329
  if (r.length === 0)
6308
6330
  return { redundantMoveSkipped: !1 };
6309
6331
  let n = r, i = !1;
6310
6332
  if (o) {
6311
- const a = r.length === 1 ? (c) => Ds(o, c) : (c) => Gc(o, c);
6333
+ const a = r.length === 1 ? (c) => As(o, c) : (c) => qc(o, c);
6312
6334
  n = r.filter((c) => !a(c)), i = n.length < r.length;
6313
6335
  }
6314
6336
  if (n.length === 0)
@@ -6319,7 +6341,7 @@ function Jc({
6319
6341
  );
6320
6342
  return { move: n[0], redundantMoveSkipped: i };
6321
6343
  }
6322
- const Xc = s.object({
6344
+ const Qc = s.object({
6323
6345
  id: s.string().min(1).describe("The ID of the task to update."),
6324
6346
  content: s.string().optional().describe(
6325
6347
  '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.'
@@ -6364,9 +6386,9 @@ const Xc = s.object({
6364
6386
  isUncompletable: s.boolean().optional().describe(
6365
6387
  "Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
6366
6388
  )
6367
- }), Qc = (e) => !!(e.projectId || e.sectionId || e.parentId), As = (e) => Object.keys(e).length > 0, Zc = ["remove", "no date"], ed = ["remove", "no date", "no deadline"], td = "no date", Je = qt.TASKS_PER_OPERATION, Rt = {
6368
- tasks: s.array(Xc).min(1).max(Je).describe(`The tasks to update (max ${Je}).`)
6369
- }, sd = {
6389
+ }), Zc = (e) => !!(e.projectId || e.sectionId || e.parentId), xs = (e) => Object.keys(e).length > 0, ed = ["remove", "no date"], td = ["remove", "no date", "no deadline"], sd = "no date", Je = qt.TASKS_PER_OPERATION, Rt = {
6390
+ tasks: s.array(Qc).min(1).max(Je).describe(`The tasks to update (max ${Je}).`)
6391
+ }, od = {
6370
6392
  tasks: s.array(B).describe("The updated tasks."),
6371
6393
  totalCount: s.number().describe("The total number of tasks updated."),
6372
6394
  updatedTaskIds: s.array(s.string()).describe("The IDs of the updated tasks."),
@@ -6381,38 +6403,38 @@ const Xc = s.object({
6381
6403
  "Moves not performed because the task was already in the requested destination. A non-zero count means container fields were sent that did not need to be."
6382
6404
  )
6383
6405
  }).describe("Summary of operations performed.")
6384
- }, od = {
6406
+ }, rd = {
6385
6407
  name: g.UPDATE_TASKS,
6386
6408
  description: "Update existing tasks including content, dates, priorities, and assignments. Send only the fields that change.",
6387
6409
  parameters: Rt,
6388
- outputSchema: sd,
6410
+ outputSchema: od,
6389
6411
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
6390
6412
  async execute(e, t) {
6391
6413
  const { tasks: o } = s.object(Rt).parse(e), r = o.map(() => ({ kind: "skipped" })), n = (T, b) => {
6392
6414
  r[T] = { kind: "failed", error: b };
6393
6415
  }, i = (T, b) => {
6394
- n(T, R(b));
6395
- }, a = o.map((T, b) => ({ task: T, index: b })).filter(({ task: T }) => pd(T)), c = await nd(
6416
+ n(T, L(b));
6417
+ }, a = o.map((T, b) => ({ task: T, index: b })).filter(({ task: T }) => hd(T)), c = await id(
6396
6418
  a.map(({ task: T }) => T),
6397
6419
  t
6398
6420
  ), d = await Promise.allSettled(
6399
- a.map(({ task: T, index: b }) => dd({ task: T, index: b, client: t, inbox: c }))
6421
+ a.map(({ task: T, index: b }) => ld({ task: T, index: b, client: t, inbox: c }))
6400
6422
  ), l = [];
6401
6423
  for (const [T, b] of d.entries()) {
6402
6424
  const S = a[T]?.index ?? T;
6403
6425
  b.status === "fulfilled" ? l.push(b.value) : i(S, b.reason);
6404
6426
  }
6405
- const u = await xs({
6427
+ const u = await Es({
6406
6428
  client: t,
6407
6429
  ids: [
6408
6430
  ...new Set(
6409
- l.filter((T) => Qc(T.moveRequest)).map((T) => T.id)
6431
+ l.filter((T) => Zc(T.moveRequest)).map((T) => T.id)
6410
6432
  )
6411
6433
  ]
6412
6434
  }), p = [];
6413
6435
  for (const T of l)
6414
6436
  try {
6415
- const b = Jc({
6437
+ const b = Xc({
6416
6438
  taskId: T.id,
6417
6439
  request: T.moveRequest,
6418
6440
  current: u.get(T.id)
@@ -6424,7 +6446,7 @@ const Xc = s.object({
6424
6446
  const h = /* @__PURE__ */ new Map(), m = [], y = (T) => {
6425
6447
  const b = T.filter((S) => !S.failed);
6426
6448
  b.length !== 0 && m.push(
6427
- cd({
6449
+ dd({
6428
6450
  client: t,
6429
6451
  items: b,
6430
6452
  onUpdated: (S, $) => {
@@ -6436,7 +6458,7 @@ const Xc = s.object({
6436
6458
  r[S.index] = {
6437
6459
  kind: "partial",
6438
6460
  task: D.task,
6439
- error: `Move applied; field update failed: ${R($)}`
6461
+ error: `Move applied; field update failed: ${L($)}`
6440
6462
  };
6441
6463
  return;
6442
6464
  }
@@ -6445,7 +6467,7 @@ const Xc = s.object({
6445
6467
  })
6446
6468
  );
6447
6469
  }, f = new Set(p.map(({ item: T }) => T.index));
6448
- y(l.filter((T) => !f.has(T.index))), await id({
6470
+ y(l.filter((T) => !f.has(T.index))), await ad({
6449
6471
  client: t,
6450
6472
  moving: p,
6451
6473
  results: h,
@@ -6463,14 +6485,14 @@ const Xc = s.object({
6463
6485
  }
6464
6486
  }), await Promise.all(m);
6465
6487
  for (const T of l) {
6466
- if (T.failed || As(T.updateArgs))
6488
+ if (T.failed || xs(T.updateArgs))
6467
6489
  continue;
6468
6490
  const b = h.get(T.index);
6469
6491
  b && "task" in b && (r[T.index] = { kind: "updated", task: b.task });
6470
6492
  }
6471
- const { updatedTasks: w, failures: C, skippedCount: x } = rd({ tasks: o, outcomes: r }), k = l.filter((T) => T.redundantMoveSkipped).length, I = w.map(P);
6493
+ const { updatedTasks: w, failures: C, skippedCount: x } = nd({ tasks: o, outcomes: r }), k = l.filter((T) => T.redundantMoveSkipped).length, I = w.map(P);
6472
6494
  return te(g.UPDATE_TASKS, o.length, C), {
6473
- textContent: ud({
6495
+ textContent: pd({
6474
6496
  tasks: I,
6475
6497
  failures: C,
6476
6498
  skippedCount: x,
@@ -6491,7 +6513,7 @@ const Xc = s.object({
6491
6513
  };
6492
6514
  }
6493
6515
  };
6494
- function rd({ tasks: e, outcomes: t }) {
6516
+ function nd({ tasks: e, outcomes: t }) {
6495
6517
  const o = [], r = [];
6496
6518
  let n = 0;
6497
6519
  for (const [i, a] of t.entries()) {
@@ -6508,7 +6530,7 @@ function rd({ tasks: e, outcomes: t }) {
6508
6530
  }
6509
6531
  return { updatedTasks: o, failures: r, skippedCount: n };
6510
6532
  }
6511
- async function nd(e, t) {
6533
+ async function id(e, t) {
6512
6534
  if (!e.some((o) => H(o.projectId)))
6513
6535
  return {};
6514
6536
  try {
@@ -6517,7 +6539,7 @@ async function nd(e, t) {
6517
6539
  return { error: o };
6518
6540
  }
6519
6541
  }
6520
- async function xs({
6542
+ async function Es({
6521
6543
  client: e,
6522
6544
  ids: t
6523
6545
  }) {
@@ -6535,7 +6557,7 @@ async function xs({
6535
6557
  }
6536
6558
  return o;
6537
6559
  }
6538
- async function id({
6560
+ async function ad({
6539
6561
  client: e,
6540
6562
  moving: t,
6541
6563
  results: o,
@@ -6545,10 +6567,10 @@ async function id({
6545
6567
  return;
6546
6568
  const n = /* @__PURE__ */ new Map();
6547
6569
  for (const c of t) {
6548
- const d = qc(c.move), l = n.get(d);
6570
+ const d = Vc(c.move), l = n.get(d);
6549
6571
  l ? l.push(c) : n.set(d, [c]);
6550
6572
  }
6551
- const i = fo(e), a = [];
6573
+ const i = bo(e), a = [];
6552
6574
  for (const c of n.values()) {
6553
6575
  const d = [...new Set(c.map(({ item: p }) => p.id))], l = c[0]?.move, u = c.length === 1 ? c[0] : void 0;
6554
6576
  try {
@@ -6569,29 +6591,29 @@ async function id({
6569
6591
  r(y), m.length > 0 && a.push({ group: m, destination: l });
6570
6592
  } catch (p) {
6571
6593
  if (u) {
6572
- o.set(u.item.index, { error: R(p) }), r(c);
6594
+ o.set(u.item.index, { error: L(p) }), r(c);
6573
6595
  continue;
6574
6596
  }
6575
6597
  a.push({ group: c, destination: l, error: p });
6576
6598
  }
6577
6599
  }
6578
6600
  if (a.length > 0) {
6579
- await ad({ client: e, unresolved: a, results: o });
6601
+ await cd({ client: e, unresolved: a, results: o });
6580
6602
  for (const { group: c } of a)
6581
6603
  r(c);
6582
6604
  }
6583
6605
  }
6584
- async function ad({
6606
+ async function cd({
6585
6607
  client: e,
6586
6608
  unresolved: t,
6587
6609
  results: o
6588
6610
  }) {
6589
- const r = [...new Set(t.flatMap(({ group: i }) => i.map(({ item: a }) => a.id)))], n = await xs({ client: e, ids: r });
6611
+ const r = [...new Set(t.flatMap(({ group: i }) => i.map(({ item: a }) => a.id)))], n = await Es({ client: e, ids: r });
6590
6612
  for (const { group: i, destination: a, error: c } of t) {
6591
- const d = c === void 0 ? "Task not returned by the move" : R(c);
6613
+ const d = c === void 0 ? "Task not returned by the move" : L(c);
6592
6614
  for (const { item: l } of i) {
6593
6615
  const u = n.get(l.id);
6594
- if (u && Ds(u, a)) {
6616
+ if (u && As(u, a)) {
6595
6617
  o.set(l.index, { task: u });
6596
6618
  continue;
6597
6619
  }
@@ -6599,15 +6621,15 @@ async function ad({
6599
6621
  }
6600
6622
  }
6601
6623
  }
6602
- async function cd({
6624
+ async function dd({
6603
6625
  client: e,
6604
6626
  items: t,
6605
6627
  onUpdated: o,
6606
6628
  onFailed: r
6607
6629
  }) {
6608
- const n = bo(e);
6630
+ const n = go(e);
6609
6631
  await Promise.all(
6610
- t.filter((i) => As(i.updateArgs)).map(async (i) => {
6632
+ t.filter((i) => xs(i.updateArgs)).map(async (i) => {
6611
6633
  try {
6612
6634
  const a = await n(
6613
6635
  () => O(() => e.updateTask(i.id, i.updateArgs))
@@ -6619,7 +6641,7 @@ async function cd({
6619
6641
  })
6620
6642
  );
6621
6643
  }
6622
- async function dd({
6644
+ async function ld({
6623
6645
  task: e,
6624
6646
  index: t,
6625
6647
  client: o,
@@ -6648,11 +6670,11 @@ async function dd({
6648
6670
  p && (w.priority = ts(p));
6649
6671
  const C = Lt(
6650
6672
  d,
6651
- Zc,
6652
- td
6673
+ ed,
6674
+ sd
6653
6675
  );
6654
6676
  C !== void 0 && (w = { ...w, dueString: C });
6655
- const x = Lt(m, ed, null);
6677
+ const x = Lt(m, td, null);
6656
6678
  if (x !== void 0 && (w = { ...w, deadlineDate: x }), l)
6657
6679
  try {
6658
6680
  const { minutes: k } = es(l);
@@ -6666,7 +6688,7 @@ async function dd({
6666
6688
  }
6667
6689
  return u !== void 0 && (w = {
6668
6690
  ...w,
6669
- assigneeId: await ld(o, n, u)
6691
+ assigneeId: await ud(o, n, u)
6670
6692
  }), {
6671
6693
  index: t,
6672
6694
  id: n,
@@ -6680,7 +6702,7 @@ async function dd({
6680
6702
  failed: !1
6681
6703
  };
6682
6704
  }
6683
- async function ld(e, t, o) {
6705
+ async function ud(e, t, o) {
6684
6706
  if (o === null || o === "unassign")
6685
6707
  return null;
6686
6708
  const r = await lt.validateTaskUpdateAssignment(
@@ -6694,7 +6716,7 @@ async function ld(e, t, o) {
6694
6716
  }
6695
6717
  return r.resolvedUser?.userId;
6696
6718
  }
6697
- function ud({
6719
+ function pd({
6698
6720
  tasks: e,
6699
6721
  failures: t,
6700
6722
  skippedCount: o,
@@ -6715,7 +6737,7 @@ function ud({
6715
6737
  Failed (${t.length}) - address or drop these items:
6716
6738
  ${l}${u}`;
6717
6739
  }
6718
- function pd({ id: e, ...t }) {
6740
+ function hd({ id: e, ...t }) {
6719
6741
  return Object.keys(t).length > 0;
6720
6742
  }
6721
6743
  function Lt(e, t, o) {
@@ -6726,7 +6748,7 @@ function Lt(e, t, o) {
6726
6748
  const r = e.trim().toLowerCase();
6727
6749
  return t.includes(r) ? o : e;
6728
6750
  }
6729
- const hd = {}, md = {
6751
+ const md = {}, fd = {
6730
6752
  type: s.literal("user_info").describe("The type of the response."),
6731
6753
  userId: s.string().describe("The user ID."),
6732
6754
  fullName: s.string().describe("The full name of the user."),
@@ -6743,36 +6765,36 @@ const hd = {}, md = {
6743
6765
  email: s.string().describe("The email address of the user."),
6744
6766
  plan: s.enum(["Todoist Free", "Todoist Pro", "Todoist Business"]).describe("The user plan.")
6745
6767
  };
6746
- function fd(e) {
6768
+ function bd(e) {
6747
6769
  return e.businessAccountId ? "Todoist Business" : e.isPremium ? "Todoist Pro" : "Todoist Free";
6748
6770
  }
6749
- function bd(e, t) {
6771
+ function gd(e, t) {
6750
6772
  const r = ((e.getDay() || 7) - t + 7) % 7, n = new Date(e);
6751
6773
  return n.setDate(e.getDate() - r), n;
6752
6774
  }
6753
- function gd(e) {
6775
+ function yd(e) {
6754
6776
  const t = new Date(e);
6755
6777
  return t.setDate(e.getDate() + 6), t;
6756
6778
  }
6757
- function yd(e) {
6779
+ function Td(e) {
6758
6780
  const t = new Date(e.getFullYear(), 0, 1), o = (e.getTime() - t.getTime()) / 864e5;
6759
6781
  return Math.ceil((o + t.getDay() + 1) / 7);
6760
6782
  }
6761
- function Td(e) {
6783
+ function kd(e) {
6762
6784
  return ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"][e === 7 ? 0 : e] ?? "Unknown";
6763
6785
  }
6764
- function kd(e) {
6786
+ function wd(e) {
6765
6787
  try {
6766
6788
  return new Intl.DateTimeFormat("en-US", { timeZone: e }), !0;
6767
6789
  } catch {
6768
6790
  return !1;
6769
6791
  }
6770
6792
  }
6771
- function Es(e) {
6772
- return kd(e) ? e : "UTC";
6793
+ function Os(e) {
6794
+ return wd(e) ? e : "UTC";
6773
6795
  }
6774
- function wd(e, t) {
6775
- const o = Es(t);
6796
+ function vd(e, t) {
6797
+ const o = Os(t);
6776
6798
  return e.toLocaleString("en-US", {
6777
6799
  timeZone: o,
6778
6800
  year: "numeric",
@@ -6784,8 +6806,8 @@ function wd(e, t) {
6784
6806
  hour12: !1
6785
6807
  });
6786
6808
  }
6787
- async function vd(e) {
6788
- const t = await e.getUser(), o = t.tzInfo?.timezone ?? "UTC", r = Es(o), n = /* @__PURE__ */ new Date(), i = wd(n, r), a = t.startDay ?? 1, c = Td(a), d = fd(t), l = new Date(n.toLocaleString("en-US", { timeZone: r })), u = bd(l, a), p = gd(u), h = yd(l), y = [
6809
+ async function Id(e) {
6810
+ const t = await e.getUser(), o = t.tzInfo?.timezone ?? "UTC", r = Os(o), n = /* @__PURE__ */ new Date(), i = vd(n, r), a = t.startDay ?? 1, c = kd(a), d = bd(t), l = new Date(n.toLocaleString("en-US", { timeZone: r })), u = gd(l, a), p = yd(u), h = Td(l), y = [
6789
6811
  "# User Information",
6790
6812
  "",
6791
6813
  `**User ID:** ${t.id}`,
@@ -6827,26 +6849,26 @@ async function vd(e) {
6827
6849
  };
6828
6850
  return { textContent: y, structuredContent: f };
6829
6851
  }
6830
- const Id = {
6852
+ const Sd = {
6831
6853
  name: g.USER_INFO,
6832
6854
  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).",
6833
- parameters: hd,
6834
- outputSchema: md,
6855
+ parameters: md,
6856
+ outputSchema: fd,
6835
6857
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
6836
6858
  async execute(e, t) {
6837
- const o = await vd(t);
6859
+ const o = await Id(t);
6838
6860
  return {
6839
6861
  textContent: o.textContent,
6840
6862
  structuredContent: o.structuredContent
6841
6863
  };
6842
6864
  }
6843
- }, Nt = 10 * 1024 * 1024, Sd = /* @__PURE__ */ new Set([
6865
+ }, Nt = 10 * 1024 * 1024, Cd = /* @__PURE__ */ new Set([
6844
6866
  "image/png",
6845
6867
  "image/jpeg",
6846
6868
  "image/gif",
6847
6869
  "image/webp",
6848
6870
  "image/svg+xml"
6849
- ]), Cd = /* @__PURE__ */ new Set([
6871
+ ]), jd = /* @__PURE__ */ new Set([
6850
6872
  "text/plain",
6851
6873
  "text/csv",
6852
6874
  "text/html",
@@ -6854,7 +6876,7 @@ const Id = {
6854
6876
  "application/json",
6855
6877
  "application/xml",
6856
6878
  "text/xml"
6857
- ]), jd = {
6879
+ ]), $d = {
6858
6880
  ".png": "image/png",
6859
6881
  ".jpg": "image/jpeg",
6860
6882
  ".jpeg": "image/jpeg",
@@ -6869,23 +6891,23 @@ const Id = {
6869
6891
  ".xml": "application/xml",
6870
6892
  ".pdf": "application/pdf"
6871
6893
  };
6872
- function $d(e) {
6873
- return Sd.has(e) ? "image" : Cd.has(e) || e.startsWith("text/") ? "text" : "binary";
6874
- }
6875
6894
  function Dd(e) {
6876
- return (e.split(";")[0] ?? e).trim().toLowerCase();
6895
+ return Cd.has(e) ? "image" : jd.has(e) || e.startsWith("text/") ? "text" : "binary";
6877
6896
  }
6878
6897
  function Ad(e) {
6898
+ return (e.split(";")[0] ?? e).trim().toLowerCase();
6899
+ }
6900
+ function xd(e) {
6879
6901
  try {
6880
6902
  const t = new URL(e).pathname, o = t.lastIndexOf(".");
6881
6903
  if (o === -1) return;
6882
6904
  const r = t.slice(o).toLowerCase();
6883
- return jd[r];
6905
+ return $d[r];
6884
6906
  } catch {
6885
6907
  return;
6886
6908
  }
6887
6909
  }
6888
- function xd(e) {
6910
+ function Ed(e) {
6889
6911
  try {
6890
6912
  const t = new URL(e).pathname, o = t.lastIndexOf("/");
6891
6913
  return o === -1 ? void 0 : t.slice(o + 1) || void 0;
@@ -6893,21 +6915,21 @@ function xd(e) {
6893
6915
  return;
6894
6916
  }
6895
6917
  }
6896
- const Ed = {
6918
+ const Od = {
6897
6919
  fileUrl: s.url().describe(
6898
6920
  "The URL of the attachment file to view. Get this from the fileUrl field in a comment's fileAttachment."
6899
6921
  )
6900
- }, Od = {
6922
+ }, Pd = {
6901
6923
  name: g.VIEW_ATTACHMENT,
6902
6924
  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).",
6903
- parameters: Ed,
6925
+ parameters: Od,
6904
6926
  annotations: {
6905
6927
  readOnlyHint: !0,
6906
6928
  destructiveHint: !1,
6907
6929
  idempotentHint: !0
6908
6930
  },
6909
6931
  async execute({ fileUrl: e }, t) {
6910
- const o = await t.viewAttachment(e), r = o.headers["content-length"], n = r ? Number.parseInt(r, 10) : void 0, i = xd(e), a = o.headers["content-type"], c = a ? Dd(a) : void 0, d = c && c !== "application/octet-stream" ? c : Ad(e) ?? c ?? "application/octet-stream";
6932
+ const o = await t.viewAttachment(e), r = o.headers["content-length"], n = r ? Number.parseInt(r, 10) : void 0, i = Ed(e), a = o.headers["content-type"], c = a ? Ad(a) : void 0, d = c && c !== "application/octet-stream" ? c : xd(e) ?? c ?? "application/octet-stream";
6911
6933
  if (n && n > Nt)
6912
6934
  return {
6913
6935
  textContent: `Attachment "${i ?? e}" is too large to display inline (${(n / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
@@ -6917,7 +6939,7 @@ const Ed = {
6917
6939
  return {
6918
6940
  textContent: `Attachment "${i ?? e}" is too large to display inline (${(u / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
6919
6941
  };
6920
- const p = $d(d), h = [];
6942
+ const p = Dd(d), h = [];
6921
6943
  return p === "image" ? h.push({
6922
6944
  type: "image",
6923
6945
  data: l.toString("base64"),
@@ -6937,77 +6959,77 @@ const Ed = {
6937
6959
  contentItems: h
6938
6960
  };
6939
6961
  }
6940
- }, Pd = {
6941
- ...Bi,
6962
+ }, _d = {
6963
+ ...zi,
6942
6964
  _meta: {
6943
6965
  ui: {
6944
6966
  resourceUri: Me
6945
6967
  }
6946
6968
  }
6947
- }, _d = {
6969
+ }, Ud = {
6948
6970
  // Task management tools
6949
- addTasks: vn,
6950
- completeTasks: En,
6951
- uncompleteTasks: ac,
6952
- updateTasks: od,
6953
- rescheduleTasks: ec,
6954
- findTasks: Ji,
6955
- findTasksByDate: Pd,
6956
- findCompletedTasks: bi,
6971
+ addTasks: In,
6972
+ completeTasks: On,
6973
+ uncompleteTasks: cc,
6974
+ updateTasks: rd,
6975
+ rescheduleTasks: tc,
6976
+ findTasks: Xi,
6977
+ findTasksByDate: _d,
6978
+ findCompletedTasks: gi,
6957
6979
  // Project management tools
6958
- addProjects: on,
6959
- updateProjects: Oc,
6960
- findProjects: xi,
6961
- projectManagement: za,
6962
- projectMove: Ga,
6980
+ addProjects: rn,
6981
+ updateProjects: Pc,
6982
+ findProjects: Ei,
6983
+ projectManagement: Ka,
6984
+ projectMove: qa,
6963
6985
  // Section management tools
6964
- addSections: gn,
6965
- updateSections: Kc,
6966
- findSections: Mi,
6986
+ addSections: yn,
6987
+ updateSections: Yc,
6988
+ findSections: Fi,
6967
6989
  // Comment management tools
6968
- addComments: Er,
6969
- findComments: ai,
6970
- updateComments: pc,
6990
+ addComments: Or,
6991
+ findComments: ci,
6992
+ updateComments: hc,
6971
6993
  // Reminder management tools
6972
- addReminders: pn,
6973
- findReminders: _i,
6974
- updateReminders: Hc,
6994
+ addReminders: hn,
6995
+ findReminders: Ui,
6996
+ updateReminders: Wc,
6975
6997
  // Attachment tools
6976
- viewAttachment: Od,
6998
+ viewAttachment: Pd,
6977
6999
  // Label management tools
6978
- addLabels: Kr,
6979
- updateLabels: jc,
6980
- findLabels: ki,
7000
+ addLabels: Yr,
7001
+ updateLabels: $c,
7002
+ findLabels: wi,
6981
7003
  // Filter management tools
6982
- findFilters: Rr,
6983
- addFilters: Hr,
6984
- updateFilters: gc,
7004
+ findFilters: Lr,
7005
+ addFilters: Wr,
7006
+ updateFilters: yc,
6985
7007
  // Activity and audit tools
6986
- findActivity: ei,
6987
- getProductivityStats: da,
7008
+ findActivity: ti,
7009
+ getProductivityStats: la,
6988
7010
  // Health and insights tools
6989
- getProjectHealth: ka,
6990
- getProjectActivityStats: ma,
6991
- analyzeProjectHealth: Dn,
6992
- getWorkspaceInsights: Sa,
7011
+ getProjectHealth: wa,
7012
+ getProjectActivityStats: fa,
7013
+ analyzeProjectHealth: An,
7014
+ getWorkspaceInsights: Ca,
6993
7015
  // General tools
6994
- getOverview: ia,
6995
- deleteObject: Un,
6996
- fetchObject: Gn,
6997
- reorderObjects: Ja,
6998
- userInfo: Id,
7016
+ getOverview: aa,
7017
+ deleteObject: Rn,
7018
+ fetchObject: qn,
7019
+ reorderObjects: Xa,
7020
+ userInfo: Sd,
6999
7021
  // Assignment and collaboration tools
7000
- findProjectCollaborators: Si,
7001
- manageAssignments: Ha,
7022
+ findProjectCollaborators: Ci,
7023
+ manageAssignments: Wa,
7002
7024
  // Template tools
7003
- exportProjectTemplate: Nn,
7004
- importProjectTemplate: Aa,
7025
+ exportProjectTemplate: Mn,
7026
+ importProjectTemplate: xa,
7005
7027
  // Workspace tools
7006
- listWorkspaces: Ua,
7028
+ listWorkspaces: Ra,
7007
7029
  // OpenAI MCP tools
7008
- search: rc,
7009
- fetch: Jn
7010
- }, Ud = Object.values(_d), Rd = `
7030
+ search: nc,
7031
+ fetch: Xn
7032
+ }, Rd = Object.values(Ud), Ld = `
7011
7033
  ## Todoist Task and Project Management Tools
7012
7034
 
7013
7035
  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.
@@ -7064,25 +7086,25 @@ Use the **productivity-analysis** prompt for a combined productivity review —
7064
7086
 
7065
7087
  Always provide clear, actionable task titles and descriptions. Use the overview tools to give users context about their workload and project status.
7066
7088
  `;
7067
- function Jd({
7089
+ function Xd({
7068
7090
  todoistApiKey: e,
7069
7091
  baseUrl: t,
7070
7092
  features: o = []
7071
7093
  }) {
7072
- const r = new Ps(
7094
+ const r = new _s(
7073
7095
  { name: "todoist-mcp-server", version: Ze },
7074
7096
  {
7075
7097
  capabilities: {
7076
7098
  tools: { listChanged: !0 },
7077
7099
  prompts: { listChanged: !0 }
7078
7100
  },
7079
- instructions: Rd
7101
+ instructions: Ld
7080
7102
  }
7081
- ), n = xo(e, { baseUrl: t });
7082
- Xs(r);
7103
+ ), n = Eo(e, { baseUrl: t });
7104
+ Qs(r);
7083
7105
  const i = { server: r, client: n, features: o };
7084
- for (const a of Ud)
7085
- Xo({ tool: a, ...i });
7106
+ for (const a of Rd)
7107
+ Qo({ tool: a, ...i });
7086
7108
  return r.registerPrompt(
7087
7109
  fe.name,
7088
7110
  {
@@ -7094,58 +7116,58 @@ function Jd({
7094
7116
  ), r;
7095
7117
  }
7096
7118
  export {
7097
- Ro as $,
7098
- ia as A,
7099
- da as B,
7100
- ma as C,
7101
- ka as D,
7102
- Sa as E,
7103
- Vd as F,
7104
- Aa as G,
7105
- Ua as H,
7106
- Ha as I,
7107
- za as J,
7108
- Ga as K,
7109
- Ud as L,
7110
- Ja as M,
7111
- ec as N,
7112
- rc as O,
7113
- ac as P,
7114
- pc as Q,
7115
- gc as R,
7116
- jc as S,
7117
- Oc as T,
7118
- Hc as U,
7119
- Kc as V,
7120
- od as W,
7121
- Id as X,
7122
- Od as Y,
7123
- xo as Z,
7124
- wo as _,
7125
- Er as a,
7126
- Hr as b,
7127
- Kr as c,
7128
- on as d,
7129
- pn as e,
7130
- gn as f,
7131
- Jd as g,
7132
- vn as h,
7133
- Dn as i,
7134
- En as j,
7135
- Un as k,
7136
- Nn as l,
7137
- Jn as m,
7138
- Gn as n,
7139
- ei as o,
7140
- ai as p,
7141
- bi as q,
7142
- Rr as r,
7143
- ki as s,
7144
- _d as t,
7145
- Si as u,
7146
- xi as v,
7147
- _i as w,
7148
- Mi as x,
7149
- Ji as y,
7150
- Bi as z
7119
+ Lo as $,
7120
+ aa as A,
7121
+ la as B,
7122
+ fa as C,
7123
+ wa as D,
7124
+ Ca as E,
7125
+ Jd as F,
7126
+ xa as G,
7127
+ Ra as H,
7128
+ Wa as I,
7129
+ Ka as J,
7130
+ qa as K,
7131
+ Rd as L,
7132
+ Xa as M,
7133
+ tc as N,
7134
+ nc as O,
7135
+ cc as P,
7136
+ hc as Q,
7137
+ yc as R,
7138
+ $c as S,
7139
+ Pc as T,
7140
+ Wc as U,
7141
+ Yc as V,
7142
+ rd as W,
7143
+ Sd as X,
7144
+ Pd as Y,
7145
+ Eo as Z,
7146
+ vo as _,
7147
+ Or as a,
7148
+ Wr as b,
7149
+ Yr as c,
7150
+ rn as d,
7151
+ hn as e,
7152
+ yn as f,
7153
+ Xd as g,
7154
+ In as h,
7155
+ An as i,
7156
+ On as j,
7157
+ Rn as k,
7158
+ Mn as l,
7159
+ Xn as m,
7160
+ qn as n,
7161
+ ti as o,
7162
+ ci as p,
7163
+ gi as q,
7164
+ Lr as r,
7165
+ wi as s,
7166
+ Ud as t,
7167
+ Ci as u,
7168
+ Ei as v,
7169
+ Ui as w,
7170
+ Fi as x,
7171
+ Xi as y,
7172
+ zi as z
7151
7173
  };