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