@doist/todoist-mcp 12.6.0 → 13.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,34 +1,34 @@
1
- import { ResourceTemplate as As, McpServer as Es } from "@modelcontextprotocol/sdk/server/mcp.js";
2
- import { createHash as Ut, randomUUID as Pe } from "node:crypto";
1
+ import { ResourceTemplate as As, McpServer as Es } from "@modelcontextprotocol/server";
2
+ import { createHash as Lt, randomUUID as Pe } from "node:crypto";
3
3
  import { readFileSync as Os } from "node:fs";
4
- import { dirname as Lt, join as _e } from "node:path";
4
+ import { dirname as Nt, join as _e } from "node:path";
5
5
  import { fileURLToPath as Ps } from "node:url";
6
- import { registerAppResource as _s, RESOURCE_MIME_TYPE as Nt, registerAppTool as Rs } from "@modelcontextprotocol/ext-apps/server";
7
- import se, { ZodError as Us, z as s } from "zod";
8
- import { AsyncLocalStorage as Ls } from "node:async_hooks";
9
- import { createRequire as Ns } from "node:module";
10
- import { TodoistApi as Ms, isWorkspaceProject as ke, isPersonalProject as B, colors as Re, LOCATION_TRIGGERS as Mt, REMINDER_TYPES as Fs, createCommand as V, REMINDER_DELIVERY_SERVICES as Hs, HEALTH_STATUSES as Ge, getTaskUrl as Ft, getProjectUrl as Ht, WORKSPACE_ROLES as Ws, WORKSPACE_PLANS as Bs } from "@doist/todoist-sdk";
11
- import { addDays as Ue, formatISO as lt } from "date-fns";
12
- const ut = Lt(Ps(import.meta.url)), zs = [
13
- _e(ut, "task-list", "index.html"),
14
- _e(ut, "mcp-apps", "index.html")
15
- ], Ks = `<!doctype html>
6
+ import { RESOURCE_MIME_TYPE as Re } from "@modelcontextprotocol/ext-apps/server";
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";
11
+ import { addDays as Le, formatISO as ut } from "date-fns";
12
+ const pt = Nt(Ps(import.meta.url)), Ws = [
13
+ _e(pt, "task-list", "index.html"),
14
+ _e(pt, "mcp-apps", "index.html")
15
+ ], Bs = `<!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 Ys() {
21
+ function zs() {
22
22
  const e = [];
23
- for (const t of zs)
23
+ for (const t of Ws)
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), Ks;
29
+ return console.error("Failed to load task list app HTML from any known path:", e), Bs;
30
30
  }
31
- const Wt = Ys(), qs = Ut("sha256").update(Wt).digest("hex").slice(0, 12), Le = `ui://todoist/task-list@${qs}`, Gs = "ui://todoist/task-list@{hash}", Ne = "Interactive task list widget", Vs = "https://ai.todoist.net", Me = {
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 = {
32
32
  ui: {
33
33
  prefersBorder: !0,
34
34
  csp: {
@@ -37,51 +37,51 @@ const Wt = Ys(), qs = Ut("sha256").update(Wt).digest("hex").slice(0, 12), Le = `
37
37
  resourceDomains: []
38
38
  }
39
39
  },
40
- "openai/widgetDescription": Ne,
40
+ "openai/widgetDescription": Me,
41
41
  "openai/widgetPrefersBorder": !0,
42
42
  "openai/widgetCSP": {
43
43
  connect_domains: [],
44
44
  resource_domains: []
45
45
  },
46
- "openai/widgetDomain": Vs
46
+ "openai/widgetDomain": qs
47
47
  };
48
- function pt(e) {
48
+ function ht(e) {
49
49
  return {
50
50
  contents: [
51
51
  {
52
52
  uri: e,
53
- mimeType: Nt,
53
+ mimeType: Re,
54
54
  text: Wt,
55
- _meta: Me
55
+ _meta: Fe
56
56
  }
57
57
  ]
58
58
  };
59
59
  }
60
- function Js(e) {
61
- _s(
62
- e,
60
+ function Gs(e) {
61
+ e.registerResource(
63
62
  "todoist-task-list",
64
- Le,
63
+ Ne,
65
64
  {
66
- description: Ne,
67
- _meta: Me
65
+ description: Me,
66
+ mimeType: Re,
67
+ _meta: Fe
68
68
  },
69
- async () => pt(Le)
69
+ async () => ht(Ne)
70
70
  ), e.registerResource(
71
71
  "todoist-task-list-hash-fallback",
72
- new As(Gs, { list: void 0 }),
72
+ new As(Ys, { list: void 0 }),
73
73
  {
74
- description: `${Ne} compatibility fallback`,
75
- mimeType: Nt,
76
- _meta: Me
74
+ description: `${Me} compatibility fallback`,
75
+ mimeType: Re,
76
+ _meta: Fe
77
77
  },
78
- async (t) => pt(t.toString())
78
+ async (t) => ht(t.toString())
79
79
  );
80
80
  }
81
81
  function J(e) {
82
82
  return typeof e == "object" && e !== null;
83
83
  }
84
- function Fe(...e) {
84
+ function He(...e) {
85
85
  return e.find(J);
86
86
  }
87
87
  function L(...e) {
@@ -105,17 +105,17 @@ function oe(e) {
105
105
  const t = E(e);
106
106
  return t !== void 0 ? t : w(e);
107
107
  }
108
- function Xs(e) {
108
+ function Vs(e) {
109
109
  return e.replace(/\b(Bearer)\s+[A-Za-z0-9._~+/=-]+/gi, "$1 [REDACTED]").replace(
110
110
  /\b(token|api[_-]?key|authorization)\s*[:=]\s*["']?[A-Za-z0-9._~+/=-]{6,}["']?/gi,
111
111
  "$1: [REDACTED]"
112
112
  ).replace(/([?&](?:token|api[_-]?key|authorization)=)[^&\s]+/gi, "$1[REDACTED]").replace(/\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\b/g, "[REDACTED]");
113
113
  }
114
114
  function R(e, t = 220) {
115
- const o = Xs(e).replace(/\s+/g, " ").trim();
115
+ const o = Vs(e).replace(/\s+/g, " ").trim();
116
116
  return o.length <= t ? o : `${o.slice(0, t - 3)}...`;
117
117
  }
118
- function He(e) {
118
+ function We(e) {
119
119
  const t = e.trim();
120
120
  return /\bHTTP\s*\d{3}\b/i.test(t) || /\bstatus code \d{3}\b/i.test(t) || /^bad request$/i.test(t) || /^unauthorized$/i.test(t) || /^forbidden$/i.test(t) || /^not found$/i.test(t);
121
121
  }
@@ -153,7 +153,7 @@ function G(e) {
153
153
  }
154
154
  return r.length > 0 ? R(r.join("; ")) : void 0;
155
155
  }
156
- function Zs(e) {
156
+ function Js(e) {
157
157
  if (!e)
158
158
  return [];
159
159
  const t = /* @__PURE__ */ new Set(), o = (a) => {
@@ -165,7 +165,7 @@ function Zs(e) {
165
165
  w(e.path)
166
166
  );
167
167
  o(r);
168
- const n = Fe(
168
+ const n = He(
169
169
  e.details,
170
170
  e.errorDetails,
171
171
  e.errorExtra,
@@ -216,7 +216,7 @@ function Zs(e) {
216
216
  }
217
217
  return Array.from(t).slice(0, 3);
218
218
  }
219
- const Qs = [
219
+ const Xs = [
220
220
  "error",
221
221
  "error_code",
222
222
  "error_tag",
@@ -227,41 +227,41 @@ const Qs = [
227
227
  "httpCode",
228
228
  "errorExtra"
229
229
  ];
230
- function eo(e) {
231
- return e ? Qs.some((t) => e[t] !== void 0) : !1;
230
+ function Zs(e) {
231
+ return e ? Xs.some((t) => e[t] !== void 0) : !1;
232
232
  }
233
- const We = {
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 to(...e) {
237
+ function Qs(...e) {
238
238
  for (const t of e) {
239
239
  if (!t)
240
240
  continue;
241
- const o = t.toUpperCase(), r = Object.keys(We).find(
241
+ const o = t.toUpperCase(), r = Object.keys(Be).find(
242
242
  (n) => o.includes(n)
243
243
  );
244
244
  if (r)
245
- return We[r];
245
+ return Be[r];
246
246
  }
247
247
  }
248
- function so(e) {
248
+ function eo(e) {
249
249
  if (e.tag) {
250
- const t = We[e.tag.toUpperCase()];
250
+ const t = Be[e.tag.toUpperCase()];
251
251
  if (t)
252
252
  return t;
253
253
  }
254
- return to(...e.rawText ?? [], e.message, e.details);
254
+ return Qs(...e.rawText ?? [], e.message, e.details);
255
255
  }
256
- function oo(e) {
257
- const t = so(e);
256
+ function to(e) {
257
+ const t = eo(e);
258
258
  if (t)
259
259
  return t;
260
260
  const { statusCode: o } = e, r = e.fieldHints.length > 0;
261
261
  return o === 401 ? "Authentication failed. Verify your API token, then retry." : o === 403 ? "Access denied. Retrying the same request will not help. If it's a scope/access problem (for example, insufficient token scope), use a token or account with the required access. Otherwise, change the request or target instead." : o === 404 ? "Confirm the referenced IDs exist and are accessible, then retry." : o === 429 ? "Rate limit reached. Wait briefly and retry." : o !== void 0 && o >= 500 ? "Todoist API may be temporarily unavailable. Retry shortly." : r ? "Fix the field hints above and retry." : o === 400 || o === 422 ? "Check parameter values and formats, then retry." : "Check the request parameters and retry.";
262
262
  }
263
- function Ve(e) {
264
- const t = J(e) ? e : void 0, o = e instanceof Error && J(e.cause) ? e.cause : void 0, r = Fe(t?.response, o?.response), n = Fe(
263
+ function Je(e) {
264
+ const t = J(e) ? e : void 0, o = e instanceof Error && J(e.cause) ? e.cause : void 0, r = He(t?.response, o?.response), n = He(
265
265
  t?.responseData,
266
266
  r?.data,
267
267
  t?.data,
@@ -301,15 +301,15 @@ function Ve(e) {
301
301
  w(t?.message),
302
302
  w(o?.message),
303
303
  e instanceof Error ? e.message : w(e)
304
- ].filter((m) => !!m), l = d.find((m) => !He(m)) || d[0], p = L(
304
+ ].filter((m) => !!m), l = d.find((m) => !We(m)) || d[0], p = L(
305
305
  G(n?.errorExtra),
306
306
  G(n?.error_extra),
307
307
  G(n?.details),
308
308
  G(n?.errorDetails),
309
309
  G(n?.errors),
310
310
  G(t?.details)
311
- ), u = Zs(n);
312
- return i !== void 0 || eo(n) || c !== void 0 || a !== void 0 || (l ? He(l) : !1) ? {
311
+ ), u = Js(n);
312
+ return i !== void 0 || Zs(n) || c !== void 0 || a !== void 0 || (l ? We(l) : !1) ? {
313
313
  statusCode: i,
314
314
  code: a,
315
315
  tag: c ? R(c, 80) : void 0,
@@ -323,11 +323,11 @@ 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 ro(e) {
326
+ function so(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: ${oo(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: ${to(e)}`), o.join(`
331
331
  `);
332
332
  }
333
333
  function zt(e) {
@@ -346,33 +346,33 @@ class Kt extends Error {
346
346
  function z(e) {
347
347
  if (e instanceof ve)
348
348
  return e.message;
349
- const t = Ve(e);
349
+ const t = Je(e);
350
350
  if (!t)
351
351
  return zt(e);
352
- const o = Bt(t), r = t.message && !(o.length > 0 && He(t.message)) ? t.message : "Todoist API request failed";
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 no(e, {
355
+ function oo(e, {
356
356
  taskContent: t,
357
357
  dueString: o,
358
358
  deadlineDate: r
359
359
  }) {
360
360
  if (!o)
361
361
  return;
362
- const n = Ve(e), a = n?.tag?.toUpperCase() === "INVALID_DUE_STRING", c = !r && /^invalid date format\.?$/i.test(n?.message ?? "");
362
+ const n = Je(e), a = n?.tag?.toUpperCase() === "INVALID_DUE_STRING", c = !r && /^invalid date format\.?$/i.test(n?.message ?? "");
363
363
  if (!a && !c)
364
364
  return;
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 io(e) {
369
- if (e instanceof Us || e instanceof ve || e instanceof Kt)
368
+ function ro(e) {
369
+ if (e instanceof _s || e instanceof ve || e instanceof Kt)
370
370
  return e.message;
371
- const t = Ve(e);
372
- return t ? ro(t) : zt(e);
371
+ const t = Je(e);
372
+ return t ? so(t) : zt(e);
373
373
  }
374
- const ao = "12.6.0", co = {
375
- version: ao
374
+ const no = "13.0.0", io = {
375
+ version: no
376
376
  }, C = {
377
377
  /** Default limit for task listings */
378
378
  TASKS_DEFAULT: 10,
@@ -412,7 +412,7 @@ const ao = "12.6.0", co = {
412
412
  }, Yt = {
413
413
  /** Maximum tasks accepted by one task create or update operation */
414
414
  TASKS_PER_OPERATION: 25
415
- }, Be = {
415
+ }, ze = {
416
416
  /**
417
417
  * In-flight task-move requests per account, per process.
418
418
  *
@@ -436,7 +436,7 @@ const ao = "12.6.0", co = {
436
436
  */
437
437
  QUEUE_WAIT_MS: 3e4
438
438
  };
439
- function ht(e, { queueTimeoutMs: t = Be.QUEUE_WAIT_MS } = {}) {
439
+ function mt(e, { queueTimeoutMs: t = ze.QUEUE_WAIT_MS } = {}) {
440
440
  if (!Number.isInteger(e) || e < 1)
441
441
  throw new Error(
442
442
  `maxConcurrent must be a positive integer, received ${String(e)}`
@@ -479,73 +479,73 @@ function ht(e, { queueTimeoutMs: t = Be.QUEUE_WAIT_MS } = {}) {
479
479
  }
480
480
  function qt() {
481
481
  return {
482
- moves: ht(Be.TASK_MOVES),
483
- writes: ht(Be.WRITES)
482
+ moves: mt(ze.TASK_MOVES),
483
+ writes: mt(ze.WRITES)
484
484
  };
485
485
  }
486
- const mt = /* @__PURE__ */ new Map(), Gt = /* @__PURE__ */ new WeakMap();
487
- let ft;
488
- function lo() {
489
- return ft ??= qt(), ft;
486
+ const ft = /* @__PURE__ */ new Map(), Gt = /* @__PURE__ */ new WeakMap();
487
+ let bt;
488
+ function ao() {
489
+ return bt ??= qt(), bt;
490
490
  }
491
- function uo(e) {
492
- return Ut("sha256").update(e).digest("hex");
491
+ function co(e) {
492
+ return Lt("sha256").update(e).digest("hex");
493
493
  }
494
- function po(e, t) {
495
- const o = uo(t);
496
- let r = mt.get(o);
497
- r || (r = qt(), mt.set(o, r)), Gt.set(e, r);
494
+ function lo(e, t) {
495
+ const o = co(t);
496
+ let r = ft.get(o);
497
+ r || (r = qt(), ft.set(o, r)), Gt.set(e, r);
498
498
  }
499
499
  function Vt(e) {
500
- return Gt.get(e) ?? lo();
500
+ return Gt.get(e) ?? ao();
501
501
  }
502
- function ho(e) {
502
+ function uo(e) {
503
503
  return Vt(e).moves;
504
504
  }
505
- function mo(e) {
505
+ function po(e) {
506
506
  return Vt(e).writes;
507
507
  }
508
- const fo = "todoist-mcp", Je = co.version, Jt = new Ls(), bt = Ns(import.meta.url);
508
+ const ho = "todoist-mcp", Xe = io.version, Jt = new Rs(), gt = Us(import.meta.url);
509
509
  let Te;
510
- const bo = async () => {
511
- const e = bt.resolve("@doist/todoist-sdk"), t = _e(Lt(e), "transport", "http-dispatcher.js");
512
- return bt(t);
510
+ const mo = async () => {
511
+ const e = gt.resolve("@doist/todoist-sdk"), t = _e(Nt(e), "transport", "http-dispatcher.js");
512
+ return gt(t);
513
513
  };
514
- let go = bo;
515
- function yo() {
516
- return `${fo}/${Je}`;
514
+ let fo = mo;
515
+ function bo() {
516
+ return `${ho}/${Xe}`;
517
517
  }
518
518
  function Xt(e) {
519
519
  return e.trim().toLowerCase();
520
520
  }
521
- function To(e, t) {
521
+ function go(e, t) {
522
522
  return Jt.run(Xt(e), t);
523
523
  }
524
- function ko({
524
+ function yo({
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": yo(),
531
+ "User-Agent": bo(),
532
532
  "doist-platform": t,
533
- "doist-version": Je,
533
+ "doist-version": Xe,
534
534
  "request-id": Pe(),
535
535
  "session-id": o,
536
536
  "mcp-tool": r ?? "unknown"
537
537
  };
538
538
  }
539
- function wo(e, t) {
539
+ function To(e, t) {
540
540
  const o = new Headers(e);
541
- for (const [r, n] of Object.entries(ko(t)))
541
+ for (const [r, n] of Object.entries(yo(t)))
542
542
  o.set(r, n);
543
543
  return Object.fromEntries(o.entries());
544
544
  }
545
- function gt() {
545
+ function yt() {
546
546
  return new DOMException("The operation was aborted due to timeout", "TimeoutError");
547
547
  }
548
- function vo(e, t) {
548
+ function ko(e, t) {
549
549
  if (!e && t === void 0)
550
550
  return {
551
551
  signal: void 0,
@@ -553,7 +553,7 @@ function vo(e, t) {
553
553
  }
554
554
  };
555
555
  if (!e && t !== void 0) {
556
- const a = new AbortController(), c = setTimeout(() => a.abort(gt()), t);
556
+ const a = new AbortController(), c = setTimeout(() => a.abort(yt()), t);
557
557
  return {
558
558
  signal: a.signal,
559
559
  cleanup: () => clearTimeout(c)
@@ -574,7 +574,7 @@ function vo(e, t) {
574
574
  const a = () => n(e.reason);
575
575
  e.addEventListener("abort", a, { once: !0 }), r.push(() => e.removeEventListener("abort", a));
576
576
  }
577
- const i = setTimeout(() => n(gt()), t);
577
+ const i = setTimeout(() => n(yt()), t);
578
578
  return r.push(() => clearTimeout(i)), {
579
579
  signal: o.signal,
580
580
  cleanup: () => {
@@ -583,20 +583,20 @@ function vo(e, t) {
583
583
  }
584
584
  };
585
585
  }
586
- async function Io() {
587
- if (So())
588
- return Te || (Te = go().then((e) => e.getDefaultDispatcher()).catch((e) => {
586
+ async function wo() {
587
+ if (vo())
588
+ return Te || (Te = fo().then((e) => e.getDefaultDispatcher()).catch((e) => {
589
589
  throw Te = void 0, e;
590
590
  })), Te;
591
591
  }
592
- function So() {
592
+ function vo() {
593
593
  return typeof process < "u" && !!process.versions?.node;
594
594
  }
595
- async function jo(e) {
596
- const t = await Io();
595
+ async function Io(e) {
596
+ const t = await wo();
597
597
  t !== void 0 && (e.dispatcher = t);
598
598
  }
599
- function Co(e) {
599
+ function So(e) {
600
600
  return {
601
601
  ok: e.ok,
602
602
  status: e.status,
@@ -607,36 +607,36 @@ function Co(e) {
607
607
  arrayBuffer: () => e.arrayBuffer()
608
608
  };
609
609
  }
610
- function $o(e = globalThis.fetch, t = {}) {
610
+ function jo(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 } = vo(p, d);
613
+ const { timeout: d, headers: l, signal: p, ...u } = c, { signal: h, cleanup: m } = ko(p, d);
614
614
  try {
615
- const y = {
615
+ const g = {
616
616
  ...u,
617
617
  signal: h,
618
- ...r ? { headers: wo(l, { platform: n, sessionId: i }) } : l !== void 0 ? { headers: l } : {}
618
+ ...r ? { headers: To(l, { platform: n, sessionId: i }) } : l !== void 0 ? { headers: l } : {}
619
619
  };
620
- o && await jo(y);
621
- const f = await e(a, y);
622
- return Co(f);
620
+ o && await Io(g);
621
+ const f = await e(a, g);
622
+ return So(f);
623
623
  } finally {
624
624
  m();
625
625
  }
626
626
  };
627
627
  }
628
- function Do(e, {
628
+ function Co(e, {
629
629
  baseUrl: t,
630
630
  tracking: o
631
631
  } = {}) {
632
- const r = new Ms(e, {
633
- customFetch: $o(globalThis.fetch, o),
632
+ const r = new Ls(e, {
633
+ customFetch: jo(globalThis.fetch, o),
634
634
  ...t ? { baseUrl: t } : {}
635
635
  });
636
- return po(r, e), r;
636
+ return lo(r, e), r;
637
637
  }
638
- const xo = 2, Ao = 500, Eo = 2e3, Oo = 50, Po = /* @__PURE__ */ new Set([502, 503, 504]);
639
- function _o(e) {
638
+ const $o = 2, Do = 500, xo = 2e3, Ao = 50, Eo = /* @__PURE__ */ new Set([502, 503, 504]);
639
+ function Oo(e) {
640
640
  if (e == null || typeof e != "object")
641
641
  return;
642
642
  const t = e;
@@ -652,48 +652,48 @@ function _o(e) {
652
652
  return Number(o[1]);
653
653
  }
654
654
  }
655
- function Ro(e) {
656
- const t = _o(e);
657
- return t !== void 0 && Po.has(t);
655
+ function Po(e) {
656
+ const t = Oo(e);
657
+ return t !== void 0 && Eo.has(t);
658
658
  }
659
- function Uo({
659
+ function _o({
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(Oo, i));
666
+ return Math.min(n, Math.max(Ao, i));
667
667
  }
668
- function Lo(e) {
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 ?? xo, r = t.baseDelayMs ?? Ao, n = t.maxDelayMs ?? Eo, i = t.random;
672
+ const o = t.maxRetries ?? $o, r = t.baseDelayMs ?? Do, n = t.maxDelayMs ?? xo, 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 && Ro(d)) {
679
- const l = Uo({ attempt: c, baseDelayMs: r, maxDelayMs: n, random: i });
680
- await Lo(l);
678
+ if (a = d, c < o && Po(d)) {
679
+ const l = _o({ attempt: c, baseDelayMs: r, maxDelayMs: n, random: i });
680
+ await Ro(l);
681
681
  continue;
682
682
  }
683
683
  throw d;
684
684
  }
685
685
  throw a;
686
686
  }
687
- function ze(e) {
687
+ function Ke(e) {
688
688
  if (e == null)
689
689
  return e;
690
690
  if (Array.isArray(e))
691
- return e.map((t) => ze(t));
691
+ return e.map((t) => Ke(t));
692
692
  if (typeof e == "object") {
693
693
  const t = {};
694
694
  for (const [o, r] of Object.entries(e))
695
695
  if (r !== null) {
696
- const n = ze(r);
696
+ const n = Ke(r);
697
697
  if (n !== null && typeof n == "object" && !Array.isArray(n) && Object.keys(n).length === 0)
698
698
  continue;
699
699
  t[o] = n;
@@ -702,7 +702,7 @@ function ze(e) {
702
702
  }
703
703
  return e;
704
704
  }
705
- const g = {
705
+ const y = {
706
706
  // Task management tools
707
707
  ADD_TASKS: "add-tasks",
708
708
  COMPLETE_TASKS: "complete-tasks",
@@ -765,109 +765,101 @@ const g = {
765
765
  // OpenAI MCP tools
766
766
  SEARCH: "search",
767
767
  FETCH: "fetch"
768
- }, Yd = {
768
+ }, Kd = {
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
- }, No = process.env.USE_STRUCTURED_CONTENT === "true" || process.env.NODE_ENV === "test";
775
- function Mo({
774
+ }, Uo = process.env.USE_STRUCTURED_CONTENT === "true" || process.env.NODE_ENV === "test";
775
+ function Lo({
776
776
  textContent: e,
777
777
  structuredContent: t,
778
778
  contentItems: o
779
779
  }) {
780
- const r = ze(t), n = {}, i = [];
781
- return o && i.push(...o), !No && t && i.push({
780
+ const r = Ke(t), n = {}, i = [];
781
+ return o && i.push(...o), !Uo && 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 Fo(e) {
786
+ function No(e) {
787
787
  return {
788
788
  content: [{ type: "text", text: e }],
789
789
  isError: !0
790
790
  };
791
791
  }
792
- const Ho = /* @__PURE__ */ new Set(["file"]);
793
- function Wo(e) {
792
+ const Mo = /* @__PURE__ */ new Set(["file"]);
793
+ function Fo(e) {
794
794
  return !e || typeof e != "object" || Array.isArray(e) ? e : Object.fromEntries(
795
795
  Object.entries(e).map(
796
- ([t, o]) => Ho.has(t) && o !== void 0 ? [t, "[redacted]"] : [t, o]
796
+ ([t, o]) => Mo.has(t) && o !== void 0 ? [t, "[redacted]"] : [t, o]
797
797
  )
798
798
  );
799
799
  }
800
- function Bo(e) {
800
+ function Ho(e) {
801
801
  return { ...{
802
- title: `Todoist: ${zo(e.name)}`,
802
+ title: `Todoist: ${Wo(e.name)}`,
803
803
  openWorldHint: !1
804
804
  }, ...e.annotations };
805
805
  }
806
- function zo(e) {
806
+ function Wo(e) {
807
807
  return e.split("-").filter(Boolean).map((t) => `${t.charAt(0).toUpperCase()}${t.slice(1)}`).join(" ");
808
808
  }
809
- function Ko(e) {
809
+ function Bo(e) {
810
810
  return e ? typeof e["ui/resourceUri"] == "string" ? !0 : typeof e.ui == "object" && e.ui !== null : !1;
811
811
  }
812
- const Yo = [
813
- g.FIND_PROJECT_COLLABORATORS,
814
- g.FIND_COMPLETED_TASKS
812
+ function zo(e) {
813
+ const t = typeof e.ui == "object" && e.ui !== null ? e.ui : void 0, o = t?.resourceUri, r = e["ui/resourceUri"];
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
+ }
816
+ const Ko = [
817
+ y.FIND_PROJECT_COLLABORATORS,
818
+ y.FIND_COMPLETED_TASKS
815
819
  ];
816
- function Ke(e) {
820
+ function Ye(e) {
817
821
  if (e == null)
818
822
  return e;
819
823
  if (Array.isArray(e))
820
- return e.map((t) => Ke(t));
824
+ return e.map((t) => Ye(t));
821
825
  if (typeof e == "object") {
822
826
  const t = {};
823
827
  for (const [o, r] of Object.entries(e))
824
- o !== "email" && (t[o] = Ke(r));
828
+ o !== "email" && (t[o] = Ye(r));
825
829
  return t;
826
830
  }
827
831
  return e;
828
832
  }
829
- function qo(e) {
833
+ function Yo(e) {
830
834
  const t = /\s*\([^)]*@[^)]+\)/g, o = /\S+@\S+\.\S+/g;
831
835
  return e.replace(t, "").replace(o, "[email hidden]");
832
836
  }
833
- function Go({
837
+ function qo({
834
838
  tool: e,
835
839
  server: t,
836
840
  client: o,
837
841
  features: r = []
838
842
  }) {
839
- const n = r.some((d) => d.name === "strip_emails") && Yo.includes(e.name), i = e.execute, a = async (d, l) => {
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) => {
840
844
  try {
841
- let { textContent: p, structuredContent: u, contentItems: h } = await To(
845
+ let { textContent: h, structuredContent: m, contentItems: g } = await go(
842
846
  e.name,
843
- () => O(() => i(d, o))
847
+ () => O(() => i(p, o))
844
848
  );
845
- return n && (p && (p = qo(p)), u && (u = Ke(u))), Mo({ textContent: p, structuredContent: u, contentItems: h });
846
- } catch (p) {
847
- return console.error(`Error executing tool ${e.name}:`, { args: Wo(d), error: p }), Fo(io(p));
849
+ return n && (h && (h = Yo(h)), m && (m = Ye(m))), Lo({ textContent: h, structuredContent: m, contentItems: g });
850
+ } catch (h) {
851
+ return console.error(`Error executing tool ${e.name}:`, { args: Fo(p), error: h }), No(ro(h));
848
852
  }
849
- }, c = {
853
+ }, l = {
850
854
  description: e.description,
851
- inputSchema: e.parameters,
852
- ...e.outputSchema ? { outputSchema: e.outputSchema } : {},
853
- annotations: Bo(e),
854
- ...e._meta ? { _meta: e._meta } : {}
855
+ inputSchema: a,
856
+ ...c ? { outputSchema: c } : {},
857
+ annotations: Ho(e),
858
+ ...e._meta ? { _meta: Bo(e._meta) ? zo(e._meta) : e._meta } : {}
855
859
  };
856
- if (Ko(e._meta)) {
857
- Rs(
858
- t,
859
- e.name,
860
- {
861
- ...c,
862
- _meta: e._meta
863
- },
864
- a
865
- );
866
- return;
867
- }
868
- t.registerTool(e.name, c, a);
860
+ t.registerTool(e.name, l, d);
869
861
  }
870
- const Vo = {
862
+ const Go = s.object({
871
863
  period: s.enum(["today", "7d", "14d", "30d", "this-week", "this-month"]).default("7d").describe(
872
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.'
873
865
  ),
@@ -875,8 +867,8 @@ const Vo = {
875
867
  'Focus area for the analysis. "overall" provides a comprehensive report covering all areas. Other values focus on a specific aspect.'
876
868
  ),
877
869
  projectId: s.string().optional().describe("Optional project ID to scope the analysis to a specific project.")
878
- };
879
- function Jo(e, t = /* @__PURE__ */ new Date()) {
870
+ });
871
+ function Vo(e, t = /* @__PURE__ */ new Date()) {
880
872
  const o = (n) => n.toISOString().slice(0, 10), r = o(t);
881
873
  switch (e) {
882
874
  case "today":
@@ -923,7 +915,7 @@ function Jo(e, t = /* @__PURE__ */ new Date()) {
923
915
  }
924
916
  }
925
917
  }
926
- function Xo(e) {
918
+ function Jo(e) {
927
919
  const t = {
928
920
  goals: `### Goal Tracking
929
921
  - Compare tasks completed today vs the daily goal
@@ -954,8 +946,8 @@ function Xo(e) {
954
946
 
955
947
  `) : t[e] ?? "";
956
948
  }
957
- function Zo(e) {
958
- const { since: t, until: o, periodDescription: r } = Jo(e.period), n = e.projectId ? `
949
+ function Xo(e) {
950
+ const { since: t, until: o, periodDescription: r } = Vo(e.period), n = e.projectId ? `
959
951
  Scope this analysis to project ID: ${e.projectId}. Pass this projectId when calling find-completed-tasks and get-overview.` : "";
960
952
  return `Analyze my Todoist productivity for ${r} (${t} to ${o}).${n}
961
953
 
@@ -976,7 +968,7 @@ ${e.focus === "overall" || e.focus === "projects" ? `4. **get-overview** — Get
976
968
 
977
969
  Using the collected data, produce an analysis covering the following sections:
978
970
 
979
- ${Xo(e.focus)}
971
+ ${Jo(e.focus)}
980
972
 
981
973
  ### Step 3: Format
982
974
 
@@ -986,14 +978,14 @@ Present the analysis as a clear, well-structured markdown report with:
986
978
  - Specific numbers and comparisons (not vague statements)
987
979
  - Actionable takeaways highlighted clearly`;
988
980
  }
989
- function Qo(e) {
981
+ function Zo(e) {
990
982
  return {
991
983
  messages: [
992
984
  {
993
985
  role: "user",
994
986
  content: {
995
987
  type: "text",
996
- text: Zo(e)
988
+ text: Xo(e)
997
989
  }
998
990
  }
999
991
  ]
@@ -1003,8 +995,8 @@ const me = {
1003
995
  name: "productivity-analysis",
1004
996
  title: "Productivity Analysis",
1005
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.",
1006
- argsSchema: Vo,
1007
- callback: Qo
998
+ argsSchema: Go,
999
+ callback: Zo
1008
1000
  };
1009
1001
  class _ extends Error {
1010
1002
  constructor(t, o) {
@@ -1045,19 +1037,19 @@ function Zt(e) {
1045
1037
  throw new _(e, "Duration cannot exceed 24 hours (1440 minutes)");
1046
1038
  return { minutes: r };
1047
1039
  }
1048
- function er(e) {
1040
+ function Qo(e) {
1049
1041
  if (e <= 0) return "0m";
1050
1042
  const t = Math.floor(e / 60), o = e % 60;
1051
1043
  return t === 0 ? `${o}m` : o === 0 ? `${t}h` : `${t}h${o}m`;
1052
1044
  }
1053
- const tr = ["p1", "p2", "p3", "p4"], Xe = 'Task priority as a string: "p1" (highest), "p2" (high), "p3" (medium), or "p4" (lowest/default). Integers like 1, 2, 3, or 4 are not accepted.', Ze = s.enum(tr).describe(Xe);
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);
1054
1046
  function Qt(e) {
1055
1047
  return { p1: 4, p2: 3, p3: 2, p4: 1 }[e];
1056
1048
  }
1057
- function sr(e) {
1049
+ function tr(e) {
1058
1050
  return { 4: "p1", 3: "p2", 2: "p3", 1: "p4" }[e];
1059
1051
  }
1060
- const es = 300 * 1e3, or = 1e4, rr = 1e3;
1052
+ const es = 300 * 1e3, sr = 1e4, or = 1e3;
1061
1053
  class ts {
1062
1054
  constructor(t, o) {
1063
1055
  this.maxEntries = t, this.ttl = o, this.entries = /* @__PURE__ */ new Map();
@@ -1092,13 +1084,13 @@ class ts {
1092
1084
  }
1093
1085
  }
1094
1086
  const Ae = new ts(
1095
- or,
1087
+ sr,
1096
1088
  es
1097
1089
  ), re = new ts(
1098
- rr,
1090
+ or,
1099
1091
  es
1100
- ), nr = "me";
1101
- class ir {
1092
+ ), rr = "me";
1093
+ class nr {
1102
1094
  /**
1103
1095
  * Resolve a user name or ID to a user ID by looking up collaborators across all shared projects.
1104
1096
  * Supports exact name matches, partial matches, email matches, and the "me" keyword.
@@ -1107,7 +1099,7 @@ class ir {
1107
1099
  if (!o || o.trim().length === 0)
1108
1100
  return null;
1109
1101
  const r = o.trim();
1110
- if (r.toLowerCase() === nr)
1102
+ if (r.toLowerCase() === rr)
1111
1103
  try {
1112
1104
  const d = await t.getUser();
1113
1105
  return {
@@ -1233,11 +1225,11 @@ class ir {
1233
1225
  Ae.clear(), re.clear();
1234
1226
  }
1235
1227
  }
1236
- const N = new ir();
1237
- async function ar(e, t) {
1228
+ const N = new nr();
1229
+ async function ir(e, t) {
1238
1230
  return N.resolveUser(e, t);
1239
1231
  }
1240
- async function cr(e, t) {
1232
+ async function ar(e, t) {
1241
1233
  const o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), n = [], i = [];
1242
1234
  for (const a of t) {
1243
1235
  const c = a.trim().toLowerCase();
@@ -1259,10 +1251,10 @@ async function cr(e, t) {
1259
1251
  return n;
1260
1252
  }
1261
1253
  const ss = ["assigned", "unassignedOrMe", "all"];
1262
- async function Qe(e, t) {
1254
+ async function et(e, t) {
1263
1255
  if (!t)
1264
1256
  return;
1265
- const o = await ar(e, t);
1257
+ const o = await ir(e, t);
1266
1258
  if (!o)
1267
1259
  throw new Error(
1268
1260
  `Could not find user: "${t}". Make sure the user is a collaborator on a shared project.`
@@ -1279,7 +1271,7 @@ function os({
1279
1271
  }) {
1280
1272
  return e && t ? `assigned to: ${t}` : o === "unassignedOrMe" ? "!assigned to: others" : o === "assigned" ? "assigned to: others" : "";
1281
1273
  }
1282
- function dr({
1274
+ function cr({
1283
1275
  tasks: e,
1284
1276
  resolvedAssigneeId: t,
1285
1277
  currentUserId: o,
@@ -1312,13 +1304,13 @@ async function F(e) {
1312
1304
  } while (i !== null);
1313
1305
  return n;
1314
1306
  }
1315
- function et(e) {
1307
+ function tt(e) {
1316
1308
  return /(?<!\\)(?:\\\\)*\*/.test(e) ? e : `*${e.replaceAll(/\\(?!\*)/g, "\\\\")}*`;
1317
1309
  }
1318
1310
  async function rs(e, t) {
1319
1311
  return F({
1320
1312
  apiMethod: e.searchProjects.bind(e),
1321
- args: { query: et(t) },
1313
+ args: { query: tt(t) },
1322
1314
  limit: C.PROJECTS_MAX
1323
1315
  });
1324
1316
  }
@@ -1329,14 +1321,14 @@ async function ns(e) {
1329
1321
  limit: C.PROJECTS_MAX
1330
1322
  });
1331
1323
  }
1332
- async function lr(e) {
1324
+ async function dr(e) {
1333
1325
  return F({
1334
1326
  apiMethod: e.getArchivedProjects.bind(e),
1335
1327
  args: {},
1336
1328
  limit: C.PROJECTS_MAX
1337
1329
  });
1338
1330
  }
1339
- function ur(e) {
1331
+ function lr(e) {
1340
1332
  const t = (i) => i.replaceAll(/[.*+?^${}()|[\]\\]/g, "\\$&"), o = /(?<!\\)(?:\\\\)*\*/.test(e), r = [...e];
1341
1333
  let n = "";
1342
1334
  for (let i = 0; i < r.length; i++) {
@@ -1345,22 +1337,22 @@ function ur(e) {
1345
1337
  }
1346
1338
  return new RegExp(o ? `^${n}$` : n, "iu");
1347
1339
  }
1348
- async function pr(e, t) {
1340
+ async function ur(e, t) {
1349
1341
  return F({
1350
1342
  apiMethod: e.searchLabels.bind(e),
1351
- args: { query: et(t) },
1343
+ args: { query: tt(t) },
1352
1344
  limit: C.LABELS_MAX
1353
1345
  });
1354
1346
  }
1355
- async function hr(e) {
1347
+ async function pr(e) {
1356
1348
  return F({
1357
1349
  apiMethod: e.getSharedLabels.bind(e),
1358
1350
  args: {},
1359
1351
  limit: C.LABELS_MAX
1360
1352
  });
1361
1353
  }
1362
- async function mr(e, t, o) {
1363
- const r = et(t);
1354
+ async function hr(e, t, o) {
1355
+ const r = tt(t);
1364
1356
  return F({
1365
1357
  apiMethod: e.searchSections.bind(e),
1366
1358
  args: o ? { query: r, projectId: o } : { query: r },
@@ -1375,12 +1367,12 @@ function P(e) {
1375
1367
  dueDate: e.due?.date,
1376
1368
  recurring: e.due?.isRecurring && e.due.string ? e.due.string : !1,
1377
1369
  deadlineDate: e.deadline?.date,
1378
- priority: sr(e.priority) ?? "p4",
1370
+ priority: tr(e.priority) ?? "p4",
1379
1371
  projectId: e.projectId,
1380
1372
  sectionId: e.sectionId ?? void 0,
1381
1373
  parentId: e.parentId ?? void 0,
1382
1374
  labels: e.labels,
1383
- duration: e.duration ? er(e.duration.amount) : void 0,
1375
+ duration: e.duration ? Qo(e.duration.amount) : void 0,
1384
1376
  responsibleUid: e.responsibleUid ?? void 0,
1385
1377
  assignedByUid: e.assignedByUid ?? void 0,
1386
1378
  checked: e.checked,
@@ -1430,7 +1422,7 @@ function ge(e) {
1430
1422
  } : void 0
1431
1423
  };
1432
1424
  }
1433
- function fr(e) {
1425
+ function mr(e) {
1434
1426
  return {
1435
1427
  id: e.id ?? void 0,
1436
1428
  objectType: e.objectType,
@@ -1443,7 +1435,7 @@ function fr(e) {
1443
1435
  extraData: e.extraData ?? void 0
1444
1436
  };
1445
1437
  }
1446
- const br = se.object({
1438
+ const fr = se.object({
1447
1439
  httpStatusCode: se.number(),
1448
1440
  responseData: se.object({
1449
1441
  error: se.string(),
@@ -1451,7 +1443,7 @@ const br = se.object({
1451
1443
  errorTag: se.string()
1452
1444
  })
1453
1445
  });
1454
- async function tt({
1446
+ async function st({
1455
1447
  client: e,
1456
1448
  query: t,
1457
1449
  limit: o,
@@ -1461,7 +1453,7 @@ async function tt({
1461
1453
  const { results: n, nextCursor: i } = await e.getTasksByFilter({ query: t, cursor: r, limit: o });
1462
1454
  return { tasks: n.map(P), nextCursor: i };
1463
1455
  } catch (n) {
1464
- const i = br.safeParse(n);
1456
+ const i = fr.safeParse(n);
1465
1457
  if (!i.success)
1466
1458
  throw n;
1467
1459
  const { responseData: a } = i.data;
@@ -1470,7 +1462,7 @@ async function tt({
1470
1462
  );
1471
1463
  }
1472
1464
  }
1473
- function yt(e) {
1465
+ function Tt(e) {
1474
1466
  return {
1475
1467
  isRecurring: e.isRecurring,
1476
1468
  string: e.string,
@@ -1490,13 +1482,13 @@ function be(e) {
1490
1482
  return {
1491
1483
  ...t,
1492
1484
  minuteOffset: e.minuteOffset,
1493
- due: e.due ? yt(e.due) : void 0,
1485
+ due: e.due ? Tt(e.due) : void 0,
1494
1486
  isUrgent: e.isUrgent
1495
1487
  };
1496
1488
  case "absolute":
1497
1489
  return {
1498
1490
  ...t,
1499
- due: yt(e.due),
1491
+ due: Tt(e.due),
1500
1492
  isUrgent: e.isUrgent
1501
1493
  };
1502
1494
  case "location":
@@ -1517,22 +1509,22 @@ function is(e) {
1517
1509
  return { timeBasedCount: t, locationCount: o };
1518
1510
  }
1519
1511
  const as = "none";
1520
- function gr(e) {
1512
+ function br(e) {
1521
1513
  return e.length === 1 && e[0]?.trim().toLowerCase() === as;
1522
1514
  }
1523
- async function yr(e, t, o) {
1524
- const r = await Tr(e, t);
1515
+ async function gr(e, t, o) {
1516
+ const r = await yr(e, t);
1525
1517
  if (r)
1526
- return Tt(
1518
+ return kt(
1527
1519
  [...r.uidsToNotify ?? [], r.postedUid],
1528
1520
  o
1529
1521
  );
1530
1522
  if (!t.taskId)
1531
1523
  return [];
1532
1524
  const n = await e.getTask(t.taskId);
1533
- return Tt([n.responsibleUid, n.assignedByUid, n.addedByUid], o);
1525
+ return kt([n.responsibleUid, n.assignedByUid, n.addedByUid], o);
1534
1526
  }
1535
- async function Tr(e, t) {
1527
+ async function yr(e, t) {
1536
1528
  let o, r = null;
1537
1529
  do {
1538
1530
  const n = await e.getComments({
@@ -1545,19 +1537,19 @@ async function Tr(e, t) {
1545
1537
  } while (r);
1546
1538
  return o;
1547
1539
  }
1548
- function Tt(e, t) {
1540
+ function kt(e, t) {
1549
1541
  const o = /* @__PURE__ */ new Set();
1550
1542
  for (const r of e)
1551
1543
  r && r !== t && o.add(r);
1552
1544
  return [...o];
1553
1545
  }
1554
- const Ie = Re.map((e) => e.key);
1555
- function kr(e) {
1546
+ const Ie = Ue.map((e) => e.key);
1547
+ function Tr(e) {
1556
1548
  if (typeof e != "string") return;
1557
1549
  const t = e.toLowerCase();
1558
- return (Re.find((r) => r.key === t) ?? Re.find((r) => r.displayName.toLowerCase() === t))?.key;
1550
+ return (Ue.find((r) => r.key === t) ?? Ue.find((r) => r.displayName.toLowerCase() === t))?.key;
1559
1551
  }
1560
- 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);
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);
1561
1553
  s.enum(Ie);
1562
1554
  const ue = s.enum(Ie).optional().catch(void 0), H = s.object({
1563
1555
  id: s.string(),
@@ -1566,7 +1558,7 @@ const ue = s.enum(Ie).optional().catch(void 0), H = s.object({
1566
1558
  dueDate: s.string().optional().describe("ISO 8601."),
1567
1559
  recurring: s.union([s.boolean(), s.string()]).describe("False when not recurring, otherwise the recurrence string."),
1568
1560
  deadlineDate: s.string().optional().describe("ISO 8601."),
1569
- priority: Ze.describe("p1 is highest, p4 lowest."),
1561
+ priority: Qe.describe("p1 is highest, p4 lowest."),
1570
1562
  projectId: s.string(),
1571
1563
  sectionId: s.string().optional(),
1572
1564
  parentId: s.string().optional(),
@@ -1601,7 +1593,7 @@ const ue = s.enum(Ie).optional().catch(void 0), H = s.object({
1601
1593
  function K({ id: e, name: t, sectionOrder: o, description: r }) {
1602
1594
  return { id: e, name: t, sectionOrder: o, description: r ?? void 0 };
1603
1595
  }
1604
- const vr = s.object({
1596
+ const wr = s.object({
1605
1597
  resourceType: s.string().describe("file, url, image, etc."),
1606
1598
  fileName: s.string().optional(),
1607
1599
  fileSize: s.number().optional().describe("Bytes."),
@@ -1622,8 +1614,8 @@ const vr = s.object({
1622
1614
  postedAt: s.string().describe("ISO 8601."),
1623
1615
  postedUid: s.string().optional(),
1624
1616
  notifiedUserIds: s.array(s.string()).optional().describe("Users notified about this comment. Absent when nobody was notified."),
1625
- fileAttachment: vr.optional()
1626
- }), Ir = s.object({
1617
+ fileAttachment: wr.optional()
1618
+ }), vr = s.object({
1627
1619
  id: s.string().optional(),
1628
1620
  objectType: s.string().describe("task, project, etc."),
1629
1621
  objectId: s.string(),
@@ -1633,7 +1625,7 @@ const vr = s.object({
1633
1625
  parentItemId: s.string().optional(),
1634
1626
  initiatorId: s.string().optional().describe("User who initiated the event."),
1635
1627
  extraData: s.record(s.string(), s.unknown()).optional()
1636
- }), Sr = s.object({
1628
+ }), Ir = s.object({
1637
1629
  id: s.string(),
1638
1630
  name: s.string(),
1639
1631
  email: s.string()
@@ -1643,18 +1635,18 @@ const vr = s.object({
1643
1635
  color: ue,
1644
1636
  order: s.number().optional().catch(void 0).describe("Display order."),
1645
1637
  isFavorite: s.boolean()
1646
- }), jr = s.object({
1638
+ }), Sr = s.object({
1647
1639
  isRecurring: s.boolean(),
1648
1640
  string: s.string().describe("Human-readable due string."),
1649
1641
  date: s.string().describe("ISO 8601."),
1650
1642
  datetime: s.string().optional().describe("ISO 8601."),
1651
1643
  timezone: s.string().optional()
1652
- }), st = s.object({
1644
+ }), ot = s.object({
1653
1645
  id: s.string(),
1654
1646
  taskId: s.string(),
1655
- type: s.enum(Fs),
1647
+ type: s.enum(Ns),
1656
1648
  minuteOffset: s.number().optional().describe("Minutes before due. Relative reminders only."),
1657
- due: jr.optional().describe("Absolute, and sometimes relative, reminders."),
1649
+ due: Sr.optional().describe("Absolute, and sometimes relative, reminders."),
1658
1650
  name: s.string().optional().describe("Location name. Location reminders only."),
1659
1651
  locLat: s.string().optional().describe("Location reminders only."),
1660
1652
  locLong: s.string().optional().describe("Location reminders only."),
@@ -1665,7 +1657,7 @@ const vr = s.object({
1665
1657
  item: s.string().describe("Usually the ID of the item that failed."),
1666
1658
  error: s.string(),
1667
1659
  code: s.string().optional()
1668
- }), Cr = s.object({
1660
+ }), jr = s.object({
1669
1661
  taskId: s.string().optional().describe("The ID of the task to comment on."),
1670
1662
  projectId: s.string().optional().describe(
1671
1663
  'The ID of the project to comment on. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
@@ -1674,17 +1666,17 @@ const vr = s.object({
1674
1666
  notifyUsers: s.array(s.string().min(1)).min(1).max(C.NOTIFY_USERS_MAX).optional().describe(
1675
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.`
1676
1668
  )
1677
- }), $r = {
1678
- comments: s.array(Cr).min(1).describe("The array of comments to add.")
1679
- }, Dr = {
1669
+ }), Cr = {
1670
+ comments: s.array(jr).min(1).describe("The array of comments to add.")
1671
+ }, $r = {
1680
1672
  comments: s.array(ye).describe("The created comments."),
1681
1673
  totalCount: s.number().describe("The total number of comments created."),
1682
1674
  addedCommentIds: s.array(s.string()).describe("The IDs of the added comments.")
1683
- }, xr = {
1684
- name: g.ADD_COMMENTS,
1675
+ }, Dr = {
1676
+ name: y.ADD_COMMENTS,
1685
1677
  description: "Add multiple comments to tasks or projects, optionally notifying collaborators. Each comment must specify either taskId or projectId.",
1686
- parameters: $r,
1687
- outputSchema: Dr,
1678
+ parameters: Cr,
1679
+ outputSchema: $r,
1688
1680
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
1689
1681
  async execute(e, t) {
1690
1682
  const { comments: o } = e;
@@ -1707,7 +1699,7 @@ const vr = s.object({
1707
1699
  });
1708
1700
  return u.taskId ? { taskId: u.taskId } : { projectId: h };
1709
1701
  })
1710
- ), c = await Ar({
1702
+ ), c = await xr({
1711
1703
  comments: o,
1712
1704
  targets: a,
1713
1705
  client: t,
@@ -1725,7 +1717,7 @@ const vr = s.object({
1725
1717
  })
1726
1718
  )).map(ge);
1727
1719
  return {
1728
- textContent: Er({ comments: l }),
1720
+ textContent: Ar({ comments: l }),
1729
1721
  structuredContent: {
1730
1722
  comments: l,
1731
1723
  totalCount: l.length,
@@ -1734,7 +1726,7 @@ const vr = s.object({
1734
1726
  };
1735
1727
  }
1736
1728
  };
1737
- async function Ar({
1729
+ async function xr({
1738
1730
  comments: e,
1739
1731
  targets: t,
1740
1732
  client: o,
@@ -1744,15 +1736,15 @@ async function Ar({
1744
1736
  return await Promise.all(
1745
1737
  e.map(async ({ notifyUsers: i }, a) => {
1746
1738
  if (i)
1747
- return gr(i) ? [] : (await cr(o, i)).map((u) => u.userId);
1739
+ return br(i) ? [] : (await ar(o, i)).map((u) => u.userId);
1748
1740
  const c = t[a];
1749
1741
  if (!c || !r) return [];
1750
- const d = c.taskId ? `task:${c.taskId}` : `project:${c.projectId}`, l = n.get(d) ?? yr(o, c, r.id);
1742
+ const d = c.taskId ? `task:${c.taskId}` : `project:${c.projectId}`, l = n.get(d) ?? gr(o, c, r.id);
1751
1743
  return n.set(d, l), await l;
1752
1744
  })
1753
1745
  );
1754
1746
  }
1755
- function Er({ comments: e }) {
1747
+ function Ar({ comments: e }) {
1756
1748
  const t = e.filter((c) => c.taskId).length, o = e.filter((c) => c.projectId).length, r = [];
1757
1749
  if (t > 0) {
1758
1750
  const c = t > 1 ? "comments" : "comment";
@@ -1768,25 +1760,25 @@ function Er({ comments: e }) {
1768
1760
  const a = i.size > 1 ? "people" : "person";
1769
1761
  return `${n}. Notified ${i.size} ${a}`;
1770
1762
  }
1771
- const Or = {
1763
+ const Er = {
1772
1764
  search: s.string().optional().describe(
1773
1765
  "Search for a filter by name (partial and case insensitive match). If omitted, all filters are returned."
1774
1766
  )
1775
- }, ot = s.object({
1767
+ }, rt = s.object({
1776
1768
  id: s.string().describe("The unique ID of the filter."),
1777
1769
  name: s.string().describe("The name of the filter."),
1778
1770
  query: s.string().describe('The filter query string (e.g. "today & p1", "#Work & overdue").'),
1779
1771
  color: ue,
1780
1772
  isFavorite: s.boolean().describe("Whether the filter is marked as favorite."),
1781
1773
  itemOrder: s.number().describe("The display order of the filter.")
1782
- }), Pr = {
1783
- filters: s.array(ot).describe("The found filters."),
1774
+ }), Or = {
1775
+ filters: s.array(rt).describe("The found filters."),
1784
1776
  totalCount: s.number().describe("The total number of filters returned.")
1785
- }, _r = {
1786
- name: g.FIND_FILTERS,
1777
+ }, Pr = {
1778
+ name: y.FIND_FILTERS,
1787
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").',
1788
- parameters: Or,
1789
- outputSchema: Pr,
1780
+ parameters: Er,
1781
+ outputSchema: Or,
1790
1782
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
1791
1783
  async execute(e, t) {
1792
1784
  let r = ((await t.sync({ resourceTypes: ["filters"], syncToken: "*" })).filters ?? []).filter((a) => !a.isDeleted);
@@ -1804,7 +1796,7 @@ const Or = {
1804
1796
  itemOrder: a.itemOrder
1805
1797
  }));
1806
1798
  return {
1807
- textContent: Rr({ filters: n, search: e.search }),
1799
+ textContent: _r({ filters: n, search: e.search }),
1808
1800
  structuredContent: {
1809
1801
  filters: n,
1810
1802
  totalCount: n.length
@@ -1812,13 +1804,13 @@ const Or = {
1812
1804
  };
1813
1805
  }
1814
1806
  };
1815
- function Rr({
1807
+ function _r({
1816
1808
  filters: e,
1817
1809
  search: t
1818
1810
  }) {
1819
1811
  const o = t ? `Filters matching "${t}"` : "Filters";
1820
1812
  if (e.length === 0) {
1821
- const n = t ? ["Try broader search terms", "Check spelling", "Remove search to see all filters"] : ["No filters created yet", `Use ${g.ADD_FILTERS} to create a filter`];
1813
+ const n = t ? ["Try broader search terms", "Check spelling", "Remove search to see all filters"] : ["No filters created yet", `Use ${y.ADD_FILTERS} to create a filter`];
1822
1814
  return `${o}: 0 found
1823
1815
 
1824
1816
  Suggestions:
@@ -1833,23 +1825,23 @@ ${n.map((i) => `- ${i}`).join(`
1833
1825
  return r.join(`
1834
1826
  `);
1835
1827
  }
1836
- const Ur = s.object({
1828
+ const Rr = s.object({
1837
1829
  name: s.string().min(1).describe("The name of the filter."),
1838
1830
  query: s.string().min(1).describe(
1839
1831
  'The filter query string. Examples: "today & p1", "#Work & overdue", "@email & today", "(p1 | p2) & !assigned". Operators: | (OR), & (AND), ! (NOT), () grouping, , (multiple queries).'
1840
1832
  ),
1841
1833
  color: le,
1842
1834
  isFavorite: s.boolean().optional().describe("Whether to mark the filter as a favorite. Defaults to false.")
1843
- }), Lr = {
1844
- filters: s.array(Ur).min(1).describe("The array of filters to add.")
1845
- }, Nr = {
1846
- filters: s.array(ot).describe("The created filters."),
1835
+ }), Ur = {
1836
+ filters: s.array(Rr).min(1).describe("The array of filters to add.")
1837
+ }, Lr = {
1838
+ filters: s.array(rt).describe("The created filters."),
1847
1839
  totalCount: s.number().describe("The total number of filters created.")
1848
- }, Mr = {
1849
- name: g.ADD_FILTERS,
1840
+ }, Nr = {
1841
+ name: y.ADD_FILTERS,
1850
1842
  description: "Add one or more new personal filters. Filters are saved custom views using query syntax to organize tasks.",
1851
- parameters: Lr,
1852
- outputSchema: Nr,
1843
+ parameters: Ur,
1844
+ outputSchema: Lr,
1853
1845
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
1854
1846
  async execute({ filters: e }, t) {
1855
1847
  const o = Date.now(), r = e.map((u, h) => `tempFilterAdd${h}${o}`), n = e.map((u, h) => V(
@@ -1862,11 +1854,11 @@ const Ur = s.object({
1862
1854
  },
1863
1855
  r[h]
1864
1856
  )), a = (await t.sync({ commands: n })).tempIdMapping ?? {}, c = e.map((u, h) => {
1865
- const m = r[h], y = m !== void 0 ? a[m] : void 0;
1866
- if (!y) return null;
1857
+ const m = r[h], g = m !== void 0 ? a[m] : void 0;
1858
+ if (!g) return null;
1867
1859
  const f = u.color !== void 0 ? ue.parse(u.color) : void 0;
1868
1860
  return {
1869
- id: y,
1861
+ id: g,
1870
1862
  name: u.name,
1871
1863
  query: u.query,
1872
1864
  color: f,
@@ -1884,26 +1876,26 @@ ${l}`,
1884
1876
  }
1885
1877
  };
1886
1878
  }
1887
- }, Fr = s.object({
1879
+ }, Mr = s.object({
1888
1880
  name: s.string().min(1).max(128).describe("The name of the label."),
1889
1881
  color: le,
1890
1882
  order: s.number().int().optional().describe("The position of the label in the label list."),
1891
1883
  isFavorite: s.boolean().optional().describe("Whether the label is a favorite. Defaults to false.")
1892
- }), Hr = {
1893
- labels: s.array(Fr).min(1).describe("The array of labels to add.")
1894
- }, Wr = {
1884
+ }), Fr = {
1885
+ labels: s.array(Mr).min(1).describe("The array of labels to add.")
1886
+ }, Hr = {
1895
1887
  labels: s.array(pe).describe("The created labels."),
1896
1888
  totalCount: s.number().describe("The total number of labels created.")
1897
- }, Br = {
1898
- name: g.ADD_LABELS,
1889
+ }, Wr = {
1890
+ name: y.ADD_LABELS,
1899
1891
  description: "Add one or more new personal labels.",
1900
- parameters: Hr,
1901
- outputSchema: Wr,
1892
+ parameters: Fr,
1893
+ outputSchema: Hr,
1902
1894
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
1903
1895
  async execute({ labels: e }, t) {
1904
1896
  const o = await Promise.all(e.map((n) => t.addLabel(n)));
1905
1897
  return {
1906
- textContent: zr({ labels: o }),
1898
+ textContent: Br({ labels: o }),
1907
1899
  structuredContent: {
1908
1900
  labels: o.map((n) => pe.parse(n)),
1909
1901
  totalCount: o.length
@@ -1911,7 +1903,7 @@ ${l}`,
1911
1903
  };
1912
1904
  }
1913
1905
  };
1914
- function zr({ labels: e }) {
1906
+ function Br({ labels: e }) {
1915
1907
  const t = e.length, o = e.map((r) => `• ${r.name} (id=${r.id})`).join(`
1916
1908
  `);
1917
1909
  return `Added ${t} label${t === 1 ? "" : "s"}:
@@ -1921,7 +1913,7 @@ function ae(e = /* @__PURE__ */ new Date()) {
1921
1913
  const t = e.getFullYear(), o = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0");
1922
1914
  return `${t}-${o}-${r}`;
1923
1915
  }
1924
- function rt(e, t, o = {}) {
1916
+ function nt(e, t, o = {}) {
1925
1917
  const { context: r, showDetails: n = !1 } = o, i = t.length, a = [], d = `${e} ${i} ${i === 1 ? "task" : "tasks"}${r ? ` ${r}` : ""}.`;
1926
1918
  a.push(d);
1927
1919
  const l = 5;
@@ -1936,7 +1928,7 @@ ${p}${u}.`);
1936
1928
  return a.join(`
1937
1929
  `);
1938
1930
  }
1939
- function nt(e) {
1931
+ function it(e) {
1940
1932
  const { action: t, success: o, total: r, successItems: n, successLabel: i = "Completed", failures: a } = e, c = [], d = `${t}: ${o}/${r} successful.`;
1941
1933
  if (c.push(d), n?.length && n.length <= 5 && c.push(`${i}:
1942
1934
  ${n.map((l) => ` ${l}`).join(`
@@ -1951,7 +1943,7 @@ ${a.slice(0, fe.MAX_FAILURES_SHOWN).map((u) => ` ${u.item} (Error: ${u.error}
1951
1943
  return c.join(`
1952
1944
  `);
1953
1945
  }
1954
- function it(e, t) {
1946
+ function at(e, t) {
1955
1947
  if (t.length === 0)
1956
1948
  return e;
1957
1949
  const o = t.slice(0, fe.MAX_FAILURES_SHOWN), r = t.length - o.length, n = o.map((a) => ` ${a.item}: ${a.error}`).join(`
@@ -1961,20 +1953,20 @@ function it(e, t) {
1961
1953
  Failed (${t.length}) - address or drop these items:
1962
1954
  ${n}${i}`;
1963
1955
  }
1964
- function Kr(e) {
1956
+ function zr(e) {
1965
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}` : "";
1966
1958
  return ` ${t}${o}${r}${n}${i}`;
1967
1959
  }
1968
- function Yr(e) {
1960
+ function Kr(e) {
1969
1961
  const t = ` (${e.color})`, o = e.isFavorite ? " • ⭐" : "", r = ` • id=${e.id}`;
1970
1962
  return ` ${e.name}${t}${o}${r}`;
1971
1963
  }
1972
- function qr(e) {
1964
+ function Yr(e) {
1973
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}`;
1974
1966
  return ` ${e.name}${t}${o}${r}${n}${i}${a}`;
1975
1967
  }
1976
1968
  function Se(e, t = 5) {
1977
- const r = e.slice(0, t).map(Kr).join(`
1969
+ const r = e.slice(0, t).map(zr).join(`
1978
1970
  `);
1979
1971
  if (e.length > t) {
1980
1972
  const n = e.length - t;
@@ -2004,16 +1996,16 @@ function cs(e, t) {
2004
1996
  ${o.map((n) => `- ${n}`).join(`
2005
1997
  `)}`;
2006
1998
  }
2007
- const Gr = 300 * 1e3;
2008
- function Vr(e) {
1999
+ const qr = 300 * 1e3;
2000
+ function Gr(e) {
2009
2001
  return /^\d+$/.test(e);
2010
2002
  }
2011
- class Jr {
2003
+ class Vr {
2012
2004
  constructor() {
2013
2005
  this.cache = null, this.inFlightWorkspaces = null;
2014
2006
  }
2015
2007
  async getWorkspaces(t) {
2016
- if (this.cache && Date.now() - this.cache.timestamp < Gr)
2008
+ if (this.cache && Date.now() - this.cache.timestamp < qr)
2017
2009
  return this.cache.workspaces;
2018
2010
  if (this.inFlightWorkspaces)
2019
2011
  return this.inFlightWorkspaces;
@@ -2040,7 +2032,7 @@ class Jr {
2040
2032
  const n = await this.getWorkspaces(t), i = n.find((p) => p.id === r);
2041
2033
  if (i)
2042
2034
  return { workspaceId: i.id, workspaceName: i.name };
2043
- if (Vr(r))
2035
+ if (Gr(r))
2044
2036
  return { workspaceId: r, workspaceName: r };
2045
2037
  const a = r.toLowerCase(), c = n.find((p) => p.name.toLowerCase() === a);
2046
2038
  if (c)
@@ -2068,7 +2060,7 @@ ${p}` + (d.length > 5 ? `
2068
2060
  this.cache = null;
2069
2061
  }
2070
2062
  }
2071
- const ds = new Jr(), Xr = s.object({
2063
+ const ds = new Vr(), Jr = s.object({
2072
2064
  name: s.string().min(1).describe("The name of the project."),
2073
2065
  parentId: s.string().optional().describe("The ID of the parent project. If provided, creates this as a sub-project."),
2074
2066
  isFavorite: s.boolean().optional().describe("Whether the project is a favorite. Defaults to false."),
@@ -2078,9 +2070,9 @@ const ds = new Jr(), Xr = s.object({
2078
2070
  workspace: s.string().trim().min(1).optional().describe(
2079
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."
2080
2072
  )
2081
- }), Zr = {
2082
- projects: s.array(Xr).min(1).describe("The array of projects to add.")
2083
- }, Qr = {
2073
+ }), Xr = {
2074
+ projects: s.array(Jr).min(1).describe("The array of projects to add.")
2075
+ }, Zr = {
2084
2076
  projects: s.array(Q).describe("The created projects."),
2085
2077
  totalCount: s.number().describe("The total number of projects created."),
2086
2078
  failures: s.array(ee).describe(
@@ -2089,11 +2081,11 @@ const ds = new Jr(), Xr = s.object({
2089
2081
  totalRequested: s.number().describe("The total number of projects requested."),
2090
2082
  successCount: s.number().describe("The number of successfully created projects."),
2091
2083
  failureCount: s.number().describe("The number of failed project creations.")
2092
- }, en = {
2093
- name: g.ADD_PROJECTS,
2084
+ }, Qr = {
2085
+ name: y.ADD_PROJECTS,
2094
2086
  description: "Add one or more new projects.",
2095
- parameters: Zr,
2096
- outputSchema: Qr,
2087
+ parameters: Xr,
2088
+ outputSchema: Zr,
2097
2089
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
2098
2090
  async execute({ projects: e }, t) {
2099
2091
  const o = /* @__PURE__ */ new Map(), r = (l) => {
@@ -2119,7 +2111,7 @@ const ds = new Jr(), Xr = s.object({
2119
2111
  });
2120
2112
  const c = i.map(Z);
2121
2113
  return {
2122
- textContent: tn({ projects: i, failures: a }),
2114
+ textContent: en({ projects: i, failures: a }),
2123
2115
  structuredContent: {
2124
2116
  projects: c,
2125
2117
  totalCount: c.length,
@@ -2131,21 +2123,21 @@ const ds = new Jr(), Xr = s.object({
2131
2123
  };
2132
2124
  }
2133
2125
  };
2134
- function tn({
2126
+ function en({
2135
2127
  projects: e,
2136
2128
  failures: t
2137
2129
  }) {
2138
2130
  const o = e.length, r = e.map((i) => `• ${i.name} (id=${i.id})`).join(`
2139
2131
  `), n = o > 0 ? `Added ${o} project${o === 1 ? "" : "s"}:
2140
2132
  ${r}` : "Added 0 projects";
2141
- return it(n, t);
2133
+ return at(n, t);
2142
2134
  }
2143
- const we = 25, je = s.enum(Hs), ls = s.object({
2135
+ const we = 25, je = s.enum(Ms), ls = s.object({
2144
2136
  date: s.string().optional().describe("Due date in YYYY-MM-DD format."),
2145
2137
  string: s.string().optional().describe('Natural language due string, e.g. "tomorrow at 3pm".'),
2146
2138
  timezone: s.string().optional().describe('Timezone for the reminder, e.g. "America/New_York".'),
2147
2139
  lang: s.string().optional().describe('Language for parsing the due string, e.g. "en".')
2148
- }), us = s.enum(Mt), Ce = s.boolean().optional().describe("Whether this is an urgent reminder. Applies to relative and absolute reminders."), sn = s.object({
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({
2149
2141
  type: s.literal("relative"),
2150
2142
  taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
2151
2143
  minuteOffset: s.number().int().min(0).describe(
@@ -2155,7 +2147,7 @@ const we = 25, je = s.enum(Hs), ls = s.object({
2155
2147
  'Delivery method: "email" or "push" notification. Defaults to push.'
2156
2148
  ),
2157
2149
  isUrgent: Ce
2158
- }), on = s.object({
2150
+ }), sn = s.object({
2159
2151
  type: s.literal("absolute"),
2160
2152
  taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
2161
2153
  due: ls.describe("The specific date/time for the reminder."),
@@ -2163,7 +2155,7 @@ const we = 25, je = s.enum(Hs), ls = s.object({
2163
2155
  'Delivery method: "email" or "push" notification. Defaults to push.'
2164
2156
  ),
2165
2157
  isUrgent: Ce
2166
- }), rn = s.object({
2158
+ }), on = s.object({
2167
2159
  type: s.literal("location"),
2168
2160
  taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
2169
2161
  name: s.string().min(1).describe('Name of the location, e.g. "Office", "Home".'),
@@ -2173,23 +2165,23 @@ const we = 25, je = s.enum(Hs), ls = s.object({
2173
2165
  'When to trigger: "on_enter" (arriving) or "on_leave" (departing).'
2174
2166
  ),
2175
2167
  radius: s.number().int().optional().describe("Radius in meters for the geofence. Defaults to server default.")
2176
- }), nn = s.discriminatedUnion("type", [
2168
+ }), rn = s.discriminatedUnion("type", [
2169
+ tn,
2177
2170
  sn,
2178
- on,
2179
- rn
2180
- ]), an = {
2181
- reminders: s.array(nn).min(1).max(we).describe(
2171
+ on
2172
+ ]), nn = {
2173
+ reminders: s.array(rn).min(1).max(we).describe(
2182
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).`
2183
2175
  )
2184
- }, cn = {
2185
- reminders: s.array(st).describe("The created reminders."),
2176
+ }, an = {
2177
+ reminders: s.array(ot).describe("The created reminders."),
2186
2178
  totalCount: s.number().describe("Total number of reminders created."),
2187
2179
  addedReminderIds: s.array(s.string()).describe("IDs of the created reminders.")
2188
- }, dn = {
2189
- name: g.ADD_REMINDERS,
2180
+ }, cn = {
2181
+ name: y.ADD_REMINDERS,
2190
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.',
2191
- parameters: an,
2192
- outputSchema: cn,
2183
+ parameters: nn,
2184
+ outputSchema: an,
2193
2185
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
2194
2186
  async execute(e, t) {
2195
2187
  const { reminders: o } = e, r = o.map(async (c) => {
@@ -2222,7 +2214,7 @@ const we = 25, je = s.enum(Hs), ls = s.object({
2222
2214
  }
2223
2215
  }), i = (await Promise.all(r)).map(be);
2224
2216
  return {
2225
- textContent: ln(i),
2217
+ textContent: dn(i),
2226
2218
  structuredContent: {
2227
2219
  reminders: i,
2228
2220
  totalCount: i.length,
@@ -2231,7 +2223,7 @@ const we = 25, je = s.enum(Hs), ls = s.object({
2231
2223
  };
2232
2224
  }
2233
2225
  };
2234
- function ln(e) {
2226
+ function dn(e) {
2235
2227
  const { timeBasedCount: t, locationCount: o } = is(e), r = [];
2236
2228
  if (t > 0) {
2237
2229
  const n = t > 1 ? "reminders" : "reminder";
@@ -2243,15 +2235,15 @@ function ln(e) {
2243
2235
  }
2244
2236
  return r.length > 0 ? `Added ${r.join(" and ")}` : "No reminders added";
2245
2237
  }
2246
- const un = s.object({
2238
+ const ln = s.object({
2247
2239
  name: s.string().min(1).describe("The name of the section."),
2248
2240
  projectId: s.string().min(1).describe(
2249
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.'
2250
2242
  ),
2251
2243
  description: s.string().optional().describe("The description of the section. Supports Markdown.")
2252
- }), pn = {
2253
- sections: s.array(un).min(1).describe("The array of sections to add.")
2254
- }, hn = {
2244
+ }), un = {
2245
+ sections: s.array(ln).min(1).describe("The array of sections to add.")
2246
+ }, pn = {
2255
2247
  sections: s.array(X).describe("The created sections."),
2256
2248
  totalCount: s.number().describe("The total number of sections created."),
2257
2249
  failures: s.array(ee).describe(
@@ -2260,11 +2252,11 @@ const un = s.object({
2260
2252
  totalRequested: s.number().describe("The total number of sections requested."),
2261
2253
  successCount: s.number().describe("The number of successfully created sections."),
2262
2254
  failureCount: s.number().describe("The number of failed section creations.")
2263
- }, mn = {
2264
- name: g.ADD_SECTIONS,
2255
+ }, hn = {
2256
+ name: y.ADD_SECTIONS,
2265
2257
  description: "Add one or more new sections to projects.",
2266
- parameters: pn,
2267
- outputSchema: hn,
2258
+ parameters: un,
2259
+ outputSchema: pn,
2268
2260
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
2269
2261
  async execute({ sections: e }, t) {
2270
2262
  const o = e.some((c) => M(c.projectId)) ? O(() => t.getUser()) : void 0, r = await Promise.allSettled(
@@ -2283,7 +2275,7 @@ const un = s.object({
2283
2275
  error: z(c.reason)
2284
2276
  });
2285
2277
  }), {
2286
- textContent: fn({ sections: n, failures: i }),
2278
+ textContent: mn({ sections: n, failures: i }),
2287
2279
  structuredContent: {
2288
2280
  sections: n.map(K),
2289
2281
  totalCount: n.length,
@@ -2295,14 +2287,14 @@ const un = s.object({
2295
2287
  };
2296
2288
  }
2297
2289
  };
2298
- function fn({
2290
+ function mn({
2299
2291
  sections: e,
2300
2292
  failures: t
2301
2293
  }) {
2302
2294
  const o = e.length, r = e.map((i) => `• ${i.name} (id=${i.id}, projectId=${i.projectId})`).join(`
2303
2295
  `), n = o > 0 ? `Added ${o} section${o === 1 ? "" : "s"}:
2304
2296
  ${r}` : "Added 0 sections";
2305
- return it(n, t);
2297
+ return at(n, t);
2306
2298
  }
2307
2299
  const ne = {
2308
2300
  USER_NOT_FOUND: "USER_NOT_FOUND",
@@ -2313,7 +2305,7 @@ const ne = {
2313
2305
  PROJECT_NOT_FOUND: "PROJECT_NOT_FOUND",
2314
2306
  TASK_NOT_FOUND: "TASK_NOT_FOUND"
2315
2307
  };
2316
- class bn {
2308
+ class fn {
2317
2309
  /**
2318
2310
  * Validate a single assignment operation
2319
2311
  */
@@ -2494,7 +2486,7 @@ class bn {
2494
2486
  const p = await N.resolveUser(t, r);
2495
2487
  if (!p)
2496
2488
  return i.push("User not found - check spelling or invite to a shared project"), { canAssign: !1, projectInfo: l, recommendations: i };
2497
- const u = d.some((y) => y.id === p.userId), h = {
2489
+ const u = d.some((g) => g.id === p.userId), h = {
2498
2490
  resolvedName: p.displayName,
2499
2491
  isCollaborator: u
2500
2492
  };
@@ -2504,14 +2496,14 @@ class bn {
2504
2496
  ), { canAssign: !1, projectInfo: l, userInfo: h, recommendations: i };
2505
2497
  let m;
2506
2498
  if (n && n.length > 0) {
2507
- let y = 0, f = 0;
2499
+ let g = 0, f = 0;
2508
2500
  for (const v of n)
2509
2501
  try {
2510
- await t.getTask(v), y++;
2502
+ await t.getTask(v), g++;
2511
2503
  } catch {
2512
2504
  f++;
2513
2505
  }
2514
- m = { accessibleTasks: y, inaccessibleTasks: f }, f > 0 && i.push(`${f} task(s) are not accessible`);
2506
+ m = { accessibleTasks: g, inaccessibleTasks: f }, f > 0 && i.push(`${f} task(s) are not accessible`);
2515
2507
  }
2516
2508
  return a = !0, i.push(`Ready to assign tasks to ${p.displayName}`), {
2517
2509
  canAssign: a,
@@ -2522,18 +2514,18 @@ class bn {
2522
2514
  };
2523
2515
  }
2524
2516
  }
2525
- const at = new bn();
2517
+ const ct = new fn();
2526
2518
  function U(e) {
2527
2519
  return s.string().transform((t) => t === "" ? void 0 : t).optional().describe(e);
2528
2520
  }
2529
- const kt = Yt.TASKS_PER_OPERATION, gn = s.object({
2521
+ const wt = Yt.TASKS_PER_OPERATION, bn = s.object({
2530
2522
  content: s.string().min(1).describe(
2531
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.'
2532
2524
  ),
2533
2525
  description: U(
2534
2526
  "Additional details, notes, or context for the task. Use this for longer content rather than putting it in the task name. Supports Markdown."
2535
2527
  ),
2536
- priority: Ze.optional().describe(Xe),
2528
+ priority: Qe.optional().describe(Ze),
2537
2529
  dueString: U(
2538
2530
  'The due date for the task, in natural language. Also use natural language for recurrences; do not prefix it with "recurring".'
2539
2531
  ),
@@ -2556,33 +2548,33 @@ const kt = Yt.TASKS_PER_OPERATION, gn = s.object({
2556
2548
  isUncompletable: s.boolean().optional().describe(
2557
2549
  "Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
2558
2550
  )
2559
- }), wt = {
2560
- tasks: s.array(gn).min(1).max(kt).describe(`The array of tasks to add (max ${kt}).`)
2561
- }, yn = {
2551
+ }), vt = {
2552
+ tasks: s.array(bn).min(1).max(wt).describe(`The array of tasks to add (max ${wt}).`)
2553
+ }, gn = {
2562
2554
  tasks: s.array(H).describe("The created tasks."),
2563
2555
  totalCount: s.number().describe("The total number of tasks created."),
2564
2556
  failures: s.array(ee).describe("Failed task creations with error details."),
2565
2557
  totalRequested: s.number().describe("The total number of tasks requested."),
2566
2558
  successCount: s.number().describe("The number of successfully created tasks."),
2567
2559
  failureCount: s.number().describe("The number of failed task creations.")
2568
- }, Tn = {
2569
- name: g.ADD_TASKS,
2560
+ }, yn = {
2561
+ name: y.ADD_TASKS,
2570
2562
  description: "Add one or more tasks to a project, section, or parent. Supports assignment to project collaborators.",
2571
- parameters: wt,
2572
- outputSchema: yn,
2563
+ parameters: vt,
2564
+ outputSchema: gn,
2573
2565
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
2574
2566
  async execute(e, t) {
2575
- const { tasks: o } = s.object(wt).parse(e), r = /* @__PURE__ */ new Map();
2567
+ const { tasks: o } = s.object(vt).parse(e), r = /* @__PURE__ */ new Map();
2576
2568
  o.forEach((h, m) => {
2577
- const y = kn(h), f = r.get(y);
2578
- f ? f.push({ task: h, index: m }) : r.set(y, [{ task: h, index: m }]);
2569
+ const g = Tn(h), f = r.get(g);
2570
+ f ? f.push({ task: h, index: m }) : r.set(g, [{ task: h, index: m }]);
2579
2571
  });
2580
2572
  const n = /* @__PURE__ */ new Map(), a = (await Promise.all(
2581
2573
  [...r.values()].map(async (h) => {
2582
2574
  const m = [];
2583
- for (const { task: y, index: f } of h)
2575
+ for (const { task: g, index: f } of h)
2584
2576
  try {
2585
- const v = await wn(y, t, n);
2577
+ const v = await kn(g, t, n);
2586
2578
  m.push({ index: f, result: { status: "fulfilled", value: v } });
2587
2579
  } catch (v) {
2588
2580
  m.push({
@@ -2603,12 +2595,12 @@ const kt = Yt.TASKS_PER_OPERATION, gn = s.object({
2603
2595
  error: z(m.reason)
2604
2596
  }));
2605
2597
  if (c.length === 0 && d.length > 0) {
2606
- const h = d.map((y) => `"${y.item}": ${y.error}`).join("; "), m = `All ${d.length} task(s) failed to create: ${h}`;
2598
+ const h = d.map((g) => `"${g.item}": ${g.error}`).join("; "), m = `All ${d.length} task(s) failed to create: ${h}`;
2607
2599
  throw l ? new Kt(m) : new Error(m);
2608
2600
  }
2609
2601
  const p = c.map(P);
2610
2602
  return {
2611
- textContent: vn({
2603
+ textContent: wn({
2612
2604
  tasks: p,
2613
2605
  failures: d,
2614
2606
  args: { tasks: o }
@@ -2624,10 +2616,10 @@ const kt = Yt.TASKS_PER_OPERATION, gn = s.object({
2624
2616
  };
2625
2617
  }
2626
2618
  };
2627
- function kn(e) {
2619
+ function Tn(e) {
2628
2620
  return `${e.projectId ?? ""}|${e.sectionId ?? ""}|${e.parentId ?? ""}`;
2629
2621
  }
2630
- async function wn(e, t, o) {
2622
+ async function kn(e, t, o) {
2631
2623
  const {
2632
2624
  duration: r,
2633
2625
  projectId: n,
@@ -2647,7 +2639,7 @@ async function wn(e, t, o) {
2647
2639
  `Task "${e.content}": Cannot create task in archived project "${f.name}"`
2648
2640
  );
2649
2641
  }
2650
- let y = {
2642
+ let g = {
2651
2643
  ...h,
2652
2644
  projectId: m,
2653
2645
  sectionId: i,
@@ -2656,15 +2648,15 @@ async function wn(e, t, o) {
2656
2648
  labels: p,
2657
2649
  deadlineDate: u
2658
2650
  };
2659
- if (l && (y.priority = Qt(l)), d && !m && !i && !a)
2651
+ if (l && (g.priority = Qt(l)), d && !m && !i && !a)
2660
2652
  throw new Error(
2661
2653
  `Task "${e.content}": Cannot assign tasks without specifying project context. Please specify a projectId, sectionId, or parentId.`
2662
2654
  );
2663
2655
  if (r)
2664
2656
  try {
2665
2657
  const { minutes: f } = Zt(r);
2666
- y = {
2667
- ...y,
2658
+ g = {
2659
+ ...g,
2668
2660
  duration: f,
2669
2661
  durationUnit: "minute"
2670
2662
  };
@@ -2689,7 +2681,7 @@ async function wn(e, t, o) {
2689
2681
  throw new Error(
2690
2682
  `Task "${e.content}": Cannot determine target project for assignment validation`
2691
2683
  );
2692
- const v = await at.validateTaskCreationAssignment(
2684
+ const v = await ct.validateTaskCreationAssignment(
2693
2685
  t,
2694
2686
  f,
2695
2687
  d
@@ -2700,12 +2692,12 @@ async function wn(e, t, o) {
2700
2692
  `Task "${e.content}": ${j}${A ? `. ${A}` : ""}`
2701
2693
  );
2702
2694
  }
2703
- y.assigneeId = v.resolvedUser?.userId;
2695
+ g.assigneeId = v.resolvedUser?.userId;
2704
2696
  }
2705
2697
  try {
2706
- return await t.addTask(y);
2698
+ return await t.addTask(g);
2707
2699
  } catch (f) {
2708
- const v = no(f, {
2700
+ const v = oo(f, {
2709
2701
  taskContent: e.content,
2710
2702
  dueString: e.dueString,
2711
2703
  deadlineDate: e.deadlineDate
@@ -2713,7 +2705,7 @@ async function wn(e, t, o) {
2713
2705
  throw v ? new ve(v) : f;
2714
2706
  }
2715
2707
  }
2716
- function vn({
2708
+ function wn({
2717
2709
  tasks: e,
2718
2710
  failures: t,
2719
2711
  args: o
@@ -2726,35 +2718,35 @@ function vn({
2726
2718
  const i = Array.from(r)[0];
2727
2719
  n = i === "inbox" ? "" : `to ${i}`;
2728
2720
  } else r.size > 1 && (n = "to multiple contexts");
2729
- return t.length > 0 ? nt({
2721
+ return t.length > 0 ? it({
2730
2722
  action: `Added tasks${n ? ` ${n}` : ""}`,
2731
2723
  success: e.length,
2732
2724
  total: o.tasks.length,
2733
2725
  successItems: e.map((i) => i.content ?? "Untitled"),
2734
2726
  successLabel: "Created",
2735
2727
  failures: t
2736
- }) : rt("Added", e, {
2728
+ }) : nt("Added", e, {
2737
2729
  context: n,
2738
2730
  showDetails: !0
2739
2731
  });
2740
2732
  }
2741
- const In = {
2733
+ const vn = {
2742
2734
  projectId: s.string().min(1).describe(
2743
2735
  "The ID of the project to analyze. This triggers a new health analysis which may take some time to complete."
2744
2736
  )
2745
- }, Sn = {
2737
+ }, In = {
2746
2738
  projectId: s.string().describe("The project ID."),
2747
2739
  health: s.object({
2748
- status: s.enum(Ge).describe("The health status after triggering analysis."),
2740
+ status: s.enum(Ve).describe("The health status after triggering analysis."),
2749
2741
  isStale: s.boolean().describe("Whether the health data is still stale after the request."),
2750
2742
  updateInProgress: s.boolean().describe("Whether an analysis update is currently in progress.")
2751
2743
  }).describe("The health response returned after triggering analysis."),
2752
2744
  message: s.string().describe("A human-readable message about the analysis status.")
2753
- }, jn = {
2754
- name: g.ANALYZE_PROJECT_HEALTH,
2745
+ }, Sn = {
2746
+ name: y.ANALYZE_PROJECT_HEALTH,
2755
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.",
2756
- parameters: In,
2757
- outputSchema: Sn,
2748
+ parameters: vn,
2749
+ outputSchema: In,
2758
2750
  annotations: {
2759
2751
  readOnlyHint: !1,
2760
2752
  destructiveHint: !1,
@@ -2777,19 +2769,19 @@ ${n}`,
2777
2769
  }
2778
2770
  };
2779
2771
  }
2780
- }, Cn = {
2772
+ }, jn = {
2781
2773
  ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to complete.")
2782
- }, $n = {
2774
+ }, Cn = {
2783
2775
  completed: s.array(s.string()).describe("The IDs of successfully completed tasks."),
2784
2776
  failures: s.array(ee).describe("Failed task completions with error details."),
2785
2777
  totalRequested: s.number().describe("The total number of tasks requested to complete."),
2786
2778
  successCount: s.number().describe("The number of successfully completed tasks."),
2787
2779
  failureCount: s.number().describe("The number of failed task completions.")
2788
- }, Dn = {
2789
- name: g.COMPLETE_TASKS,
2780
+ }, $n = {
2781
+ name: y.COMPLETE_TASKS,
2790
2782
  description: "Complete one or more tasks by their IDs.",
2791
- parameters: Cn,
2792
- outputSchema: $n,
2783
+ parameters: jn,
2784
+ outputSchema: Cn,
2793
2785
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
2794
2786
  async execute(e, t) {
2795
2787
  const o = [], r = [];
@@ -2804,7 +2796,7 @@ ${n}`,
2804
2796
  });
2805
2797
  }
2806
2798
  return {
2807
- textContent: xn({
2799
+ textContent: Dn({
2808
2800
  completed: o,
2809
2801
  failures: r,
2810
2802
  args: e
@@ -2819,12 +2811,12 @@ ${n}`,
2819
2811
  };
2820
2812
  }
2821
2813
  };
2822
- function xn({
2814
+ function Dn({
2823
2815
  completed: e,
2824
2816
  failures: t,
2825
2817
  args: o
2826
2818
  }) {
2827
- return nt({
2819
+ return it({
2828
2820
  action: "Completed tasks",
2829
2821
  success: e.length,
2830
2822
  total: o.ids.length,
@@ -2841,20 +2833,20 @@ const ps = [
2841
2833
  "filter",
2842
2834
  "reminder",
2843
2835
  "location_reminder"
2844
- ], An = {
2836
+ ], xn = {
2845
2837
  type: s.enum(ps).describe("The type of entity to delete."),
2846
2838
  id: s.string().min(1).describe("The ID of the entity to delete.")
2847
- }, En = {
2839
+ }, An = {
2848
2840
  deletedEntity: s.object({
2849
2841
  type: s.enum(ps).describe("The type of deleted entity."),
2850
2842
  id: s.string().describe("The ID of the deleted entity.")
2851
2843
  }).describe("Information about the deleted entity."),
2852
2844
  success: s.boolean().describe("Whether the deletion was successful.")
2853
- }, On = {
2854
- name: g.DELETE_OBJECT,
2845
+ }, En = {
2846
+ name: y.DELETE_OBJECT,
2855
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.",
2856
- parameters: An,
2857
- outputSchema: En,
2848
+ parameters: xn,
2849
+ outputSchema: An,
2858
2850
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !0 },
2859
2851
  async execute(e, t) {
2860
2852
  switch (e.type) {
@@ -2899,7 +2891,7 @@ const ps = [
2899
2891
  }
2900
2892
  };
2901
2893
  }
2902
- }, vt = 5, hs = ["file", "url"], Pn = {
2894
+ }, It = 5, hs = ["file", "url"], On = {
2903
2895
  projectId: s.string().min(1).describe("The ID of the project to export as a template."),
2904
2896
  format: s.enum(hs).default("file").describe(
2905
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.'
@@ -2907,17 +2899,17 @@ const ps = [
2907
2899
  useRelativeDates: s.boolean().optional().describe(
2908
2900
  'Export due dates relative to the import date (e.g. "day 3") instead of absolute dates. Defaults to false.'
2909
2901
  )
2910
- }, _n = {
2902
+ }, Pn = {
2911
2903
  format: s.enum(hs).describe("The format the template was exported in."),
2912
2904
  content: s.string().optional().describe('The template as CSV content. Only present when format is "file".'),
2913
2905
  lineCount: s.number().optional().describe('Number of rows in the exported CSV. Only present when format is "file".'),
2914
2906
  fileName: s.string().optional().describe('The generated template file name. Only present when format is "url".'),
2915
2907
  fileUrl: s.string().optional().describe('The shareable download URL. Only present when format is "url".')
2916
- }, Rn = {
2917
- name: g.EXPORT_PROJECT_TEMPLATE,
2908
+ }, _n = {
2909
+ name: y.EXPORT_PROJECT_TEMPLATE,
2918
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.",
2919
- parameters: Pn,
2920
- outputSchema: _n,
2911
+ parameters: On,
2912
+ outputSchema: Pn,
2921
2913
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
2922
2914
  // `format` is defaulted here as well as in the schema: scripts/run-tool.ts calls
2923
2915
  // execute() with raw JSON, so schema defaults are not applied on that path.
@@ -2938,14 +2930,14 @@ ${c}`,
2938
2930
  return {
2939
2931
  // The full CSV already ships in structuredContent; a preview here keeps a large
2940
2932
  // project from being spelled out twice in the response.
2941
- textContent: Un({ projectId: e, lines: i }),
2933
+ textContent: Rn({ projectId: e, lines: i }),
2942
2934
  structuredContent: { format: t, content: n, lineCount: i.length }
2943
2935
  };
2944
2936
  }
2945
2937
  };
2946
- function Un({ projectId: e, lines: t }) {
2947
- const o = `Exported project (id=${e}) as a template file (${t.length} row${t.length === 1 ? "" : "s"}).`, r = t.slice(0, vt).join(`
2948
- `), n = t.length - vt;
2938
+ function Rn({ projectId: e, lines: t }) {
2939
+ const o = `Exported project (id=${e}) as a template file (${t.length} row${t.length === 1 ? "" : "s"}).`, r = t.slice(0, It).join(`
2940
+ `), n = t.length - It;
2949
2941
  return n > 0 ? `${o}
2950
2942
 
2951
2943
  ${r}
@@ -2953,7 +2945,7 @@ ${r}
2953
2945
 
2954
2946
  ${r}`;
2955
2947
  }
2956
- const Ln = H.pick({
2948
+ const Un = H.pick({
2957
2949
  id: !0,
2958
2950
  content: !0,
2959
2951
  dueDate: !0,
@@ -2962,15 +2954,15 @@ const Ln = H.pick({
2962
2954
  hasChildren: s.boolean().describe(
2963
2955
  "Whether this subtask has subtasks of its own. Fetch it with includeChildren to expand."
2964
2956
  )
2965
- }), Nn = Q.pick({ id: !0, name: !0 }).extend({
2957
+ }), Ln = Q.pick({ id: !0, name: !0 }).extend({
2966
2958
  hasChildren: s.boolean().describe(
2967
2959
  "Whether this sub-project has sub-projects of its own. Fetch it with includeChildren to expand."
2968
2960
  )
2969
- }), Mn = {
2961
+ }), Nn = {
2970
2962
  childCount: s.number().optional().describe(
2971
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."
2972
2964
  ),
2973
- children: s.array(s.union([Ln, Nn])).optional().describe(
2965
+ children: s.array(s.union([Un, Ln])).optional().describe(
2974
2966
  "Direct children only: subtasks for a task, sub-projects for a project. Completed subtasks and archived sub-projects are excluded."
2975
2967
  ),
2976
2968
  hasMoreChildren: s.boolean().optional().describe(
@@ -2980,7 +2972,7 @@ const Ln = H.pick({
2980
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".'
2981
2973
  )
2982
2974
  };
2983
- async function Fn(e, t) {
2975
+ async function Mn(e, t) {
2984
2976
  const { results: o, nextCursor: r } = await e.getTasks({
2985
2977
  parentId: t,
2986
2978
  limit: C.CHILDREN_MAX
@@ -3003,7 +2995,7 @@ async function Fn(e, t) {
3003
2995
  childrenError: i ? `Could not check ${i} of ${o.length} subtasks for subtasks of their own; those are reported as hasChildren=false.` : void 0
3004
2996
  };
3005
2997
  }
3006
- async function Hn(e, t) {
2998
+ async function Fn(e, t) {
3007
2999
  if (!B(t))
3008
3000
  return { childCount: 0, children: [] };
3009
3001
  const o = await ns(e), r = /* @__PURE__ */ new Map();
@@ -3023,35 +3015,35 @@ async function Hn(e, t) {
3023
3015
  hasMoreChildren: n.length > i.length ? !0 : void 0
3024
3016
  };
3025
3017
  }
3026
- async function It(e) {
3018
+ async function St(e) {
3027
3019
  try {
3028
3020
  return await e();
3029
3021
  } catch (t) {
3030
3022
  return { childrenError: t instanceof Error ? t.message : String(t) };
3031
3023
  }
3032
3024
  }
3033
- function St(e, t) {
3025
+ function jt(e, t) {
3034
3026
  if (t.childCount === void 0)
3035
3027
  return t.childrenError ? ` • ${e}=unavailable` : "";
3036
3028
  const o = t.hasMoreChildren ? "+" : "", r = t.childrenError ? " (partial)" : "";
3037
3029
  return ` • ${e}=${t.childCount}${o}${r}`;
3038
3030
  }
3039
- const ms = ["task", "project", "comment", "section"], Wn = {
3031
+ const ms = ["task", "project", "comment", "section"], Hn = {
3040
3032
  type: s.enum(ms).describe("The type of object to fetch."),
3041
3033
  id: s.string().min(1).describe("The unique ID of the object to fetch."),
3042
3034
  includeChildren: s.boolean().optional().describe(
3043
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."
3044
3036
  )
3045
- }, Bn = {
3037
+ }, Wn = {
3046
3038
  type: s.enum(ms).describe("The type of object fetched."),
3047
3039
  id: s.string().describe("The ID of the fetched object."),
3048
3040
  object: s.union([H, Q, ye, X]).describe("The fetched object data."),
3049
- ...Mn
3050
- }, zn = {
3051
- name: g.FETCH_OBJECT,
3041
+ ...Nn
3042
+ }, Bn = {
3043
+ name: y.FETCH_OBJECT,
3052
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.",
3053
- parameters: Wn,
3054
- outputSchema: Bn,
3045
+ parameters: Hn,
3046
+ outputSchema: Wn,
3055
3047
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3056
3048
  async execute(e, t) {
3057
3049
  const { type: o, id: r, includeChildren: n } = e;
@@ -3060,10 +3052,10 @@ const ms = ["task", "project", "comment", "section"], Wn = {
3060
3052
  case "task": {
3061
3053
  const [i, a] = await Promise.all([
3062
3054
  t.getTask(r),
3063
- n ? It(() => Fn(t, r)) : Promise.resolve({})
3055
+ n ? St(() => Mn(t, r)) : Promise.resolve({})
3064
3056
  ]), c = P(i);
3065
3057
  return {
3066
- textContent: `Found task: ${c.content} • id=${c.id} • priority=${c.priority} • project=${c.projectId}${St("subtasks", a)}`,
3058
+ textContent: `Found task: ${c.content} • id=${c.id} • priority=${c.priority} • project=${c.projectId}${jt("subtasks", a)}`,
3067
3059
  structuredContent: {
3068
3060
  type: o,
3069
3061
  id: r,
@@ -3073,9 +3065,9 @@ const ms = ["task", "project", "comment", "section"], Wn = {
3073
3065
  };
3074
3066
  }
3075
3067
  case "project": {
3076
- const i = await t.getProject(r), a = Z(i), c = n ? await It(() => Hn(t, i)) : {};
3068
+ const i = await t.getProject(r), a = Z(i), c = n ? await St(() => Fn(t, i)) : {};
3077
3069
  return {
3078
- textContent: `Found project: ${a.name} • id=${a.id} • color=${a.color} • viewStyle=${a.viewStyle}${St("subProjects", c)}`,
3070
+ textContent: `Found project: ${a.name} • id=${a.id} • color=${a.color} • viewStyle=${a.viewStyle}${jt("subProjects", c)}`,
3079
3071
  structuredContent: {
3080
3072
  type: o,
3081
3073
  id: r,
@@ -3116,21 +3108,21 @@ const ms = ["task", "project", "comment", "section"], Wn = {
3116
3108
  );
3117
3109
  }
3118
3110
  }
3119
- }, Kn = {
3111
+ }, zn = {
3120
3112
  id: s.string().min(1).describe(
3121
3113
  'A unique identifier for the document in the format "task:{id}" or "project:{id}".'
3122
3114
  )
3123
- }, Yn = {
3115
+ }, Kn = {
3124
3116
  id: s.string().describe("The ID of the fetched document."),
3125
3117
  title: s.string().describe("The title of the document."),
3126
3118
  text: s.string().describe("The text content of the document."),
3127
3119
  url: s.string().describe("The URL of the document."),
3128
3120
  metadata: s.record(s.string(), s.unknown()).optional().describe("Additional metadata about the document.")
3129
- }, qn = {
3130
- name: g.FETCH,
3121
+ }, Yn = {
3122
+ name: y.FETCH,
3131
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}".',
3132
- parameters: Kn,
3133
- outputSchema: Yn,
3124
+ parameters: zn,
3125
+ outputSchema: Kn,
3134
3126
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3135
3127
  async execute(e, t) {
3136
3128
  const { id: o } = e, [r, n] = o.split(":", 2);
@@ -3190,11 +3182,11 @@ Favorite: Yes`), i = {
3190
3182
  structuredContent: i
3191
3183
  };
3192
3184
  }
3193
- }, Gn = s.union([s.iso.date(), s.iso.datetime({ offset: !0 })]);
3194
- function jt(e) {
3195
- return U(e).pipe(Gn.optional());
3185
+ }, qn = s.union([s.iso.date(), s.iso.datetime({ offset: !0 })]);
3186
+ function Ct(e) {
3187
+ return U(e).pipe(qn.optional());
3196
3188
  }
3197
- const Vn = {
3189
+ const Gn = {
3198
3190
  objectType: s.enum(["task", "project", "comment"]).optional().describe("Type of object to filter by."),
3199
3191
  objectId: s.string().optional().describe("Filter by specific object ID (task, project, or comment)."),
3200
3192
  eventType: s.enum([
@@ -3213,25 +3205,25 @@ const Vn = {
3213
3205
  initiatorId: s.string().optional().describe(
3214
3206
  'Filter by the user ID who initiated the event. A first-person question ("what did I complete") needs this: without it the results cover every collaborator. Get the ID from user-info when you do not already have it.'
3215
3207
  ),
3216
- dateFrom: jt(
3208
+ dateFrom: Ct(
3217
3209
  `Inclusive start of the activity range, as an ISO 8601 date or date-time. For all events on one local calendar day, use that day's start, for example "2026-08-02T00:00:00-04:00". Natural-language dates such as "tomorrow" are not supported.`
3218
3210
  ),
3219
- dateTo: jt(
3211
+ dateTo: Ct(
3220
3212
  'Exclusive end of the activity range, as an ISO 8601 date or date-time. For all events on 2026-08-02, use "2026-08-03T00:00:00-04:00". Natural-language dates such as "tomorrow" are not supported.'
3221
3213
  ),
3222
3214
  limit: s.number().int().min(1).max(C.ACTIVITY_MAX).default(C.ACTIVITY_DEFAULT).describe("Maximum number of activity events to return."),
3223
3215
  cursor: s.string().optional().describe("Pagination cursor for retrieving the next page of results.")
3224
- }, Jn = {
3225
- events: s.array(Ir).describe("The activity events."),
3216
+ }, Vn = {
3217
+ events: s.array(vr).describe("The activity events."),
3226
3218
  nextCursor: s.string().optional(),
3227
3219
  totalCount: s.number().describe("The total number of events in this page."),
3228
3220
  hasMore: s.boolean(),
3229
3221
  appliedFilters: s.record(s.string(), s.unknown())
3230
- }, Xn = {
3231
- name: g.FIND_ACTIVITY,
3222
+ }, Jn = {
3223
+ name: y.FIND_ACTIVITY,
3232
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.`,
3233
- parameters: Vn,
3234
- outputSchema: Jn,
3225
+ parameters: Gn,
3226
+ outputSchema: Vn,
3235
3227
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3236
3228
  async execute(e, t) {
3237
3229
  const {
@@ -3250,20 +3242,20 @@ const Vn = {
3250
3242
  cursor: u ?? null
3251
3243
  };
3252
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);
3253
- const { results: m, nextCursor: y } = await t.getActivityLogs(h), f = m.map(fr);
3245
+ const { results: m, nextCursor: g } = await t.getActivityLogs(h), f = m.map(mr);
3254
3246
  return {
3255
- textContent: Zn({ events: f, args: e, nextCursor: y }),
3247
+ textContent: Xn({ events: f, args: e, nextCursor: g }),
3256
3248
  structuredContent: {
3257
3249
  events: f,
3258
- nextCursor: y ?? void 0,
3250
+ nextCursor: g ?? void 0,
3259
3251
  totalCount: f.length,
3260
- hasMore: !!y,
3252
+ hasMore: !!g,
3261
3253
  appliedFilters: e
3262
3254
  }
3263
3255
  };
3264
3256
  }
3265
3257
  };
3266
- function Zn({
3258
+ function Xn({
3267
3259
  events: e,
3268
3260
  args: t,
3269
3261
  nextCursor: o
@@ -3284,12 +3276,12 @@ function Zn({
3284
3276
  limit: t.limit,
3285
3277
  nextCursor: o ?? void 0,
3286
3278
  filterHints: i,
3287
- previewLines: Qn(e, Math.min(e.length, t.limit)),
3279
+ previewLines: Zn(e, Math.min(e.length, t.limit)),
3288
3280
  zeroReasonHints: a
3289
3281
  });
3290
3282
  }
3291
- function Qn(e, t = 10) {
3292
- const r = e.slice(0, t).map(ei).join(`
3283
+ function Zn(e, t = 10) {
3284
+ const r = e.slice(0, t).map(Qn).join(`
3293
3285
  `);
3294
3286
  if (e.length > t) {
3295
3287
  const n = e.length - t;
@@ -3298,8 +3290,8 @@ function Qn(e, t = 10) {
3298
3290
  }
3299
3291
  return r;
3300
3292
  }
3301
- function ei(e) {
3302
- const t = ti(e.eventDate), o = `${e.eventType} ${e.objectType}`;
3293
+ function Qn(e) {
3294
+ const t = ei(e.eventDate), o = `${e.eventType} ${e.objectType}`;
3303
3295
  let r = "";
3304
3296
  if (e.extraData) {
3305
3297
  const c = e.extraData.content || e.extraData.name || e.extraData.last_content;
@@ -3308,7 +3300,7 @@ function ei(e) {
3308
3300
  const n = e.objectId ? ` • id=${e.objectId}` : "", i = e.initiatorId ? ` • by=${e.initiatorId}` : " • system", a = e.parentProjectId ? ` • project=${e.parentProjectId}` : "";
3309
3301
  return ` [${t}] ${o}${r}${n}${i}${a}`;
3310
3302
  }
3311
- function ti(e) {
3303
+ function ei(e) {
3312
3304
  try {
3313
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", {
3314
3306
  hour: "2-digit",
@@ -3321,7 +3313,7 @@ function ti(e) {
3321
3313
  return e;
3322
3314
  }
3323
3315
  }
3324
- const si = {
3316
+ const ti = {
3325
3317
  taskId: s.string().optional().describe("Find comments for a specific task."),
3326
3318
  projectId: s.string().optional().describe(
3327
3319
  'Find comments for a specific project. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
@@ -3329,7 +3321,7 @@ const si = {
3329
3321
  commentId: s.string().optional().describe("Get a specific comment by ID."),
3330
3322
  cursor: s.string().optional().describe("Pagination cursor for retrieving more results."),
3331
3323
  limit: s.number().int().min(1).max(C.COMMENTS_MAX).optional().describe("Maximum number of comments to return")
3332
- }, oi = {
3324
+ }, si = {
3333
3325
  comments: s.array(ye).describe("The found comments."),
3334
3326
  searchType: s.string().describe(
3335
3327
  'The type of search performed: "single" (comment ID), "task" (task ID), or "project" (project ID).'
@@ -3338,11 +3330,11 @@ const si = {
3338
3330
  hasMore: s.boolean(),
3339
3331
  nextCursor: s.string().optional(),
3340
3332
  totalCount: s.number().describe("The total number of comments in this page.")
3341
- }, ri = {
3342
- name: g.FIND_COMMENTS,
3333
+ }, oi = {
3334
+ name: y.FIND_COMMENTS,
3343
3335
  description: "Find comments by task, project, or get a specific comment by ID. Exactly one of taskId, projectId, or commentId must be provided.",
3344
- parameters: si,
3345
- outputSchema: oi,
3336
+ parameters: ti,
3337
+ outputSchema: si,
3346
3338
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3347
3339
  async execute(e, t) {
3348
3340
  const o = [e.taskId, e.projectId, e.commentId].filter(Boolean);
@@ -3377,7 +3369,7 @@ const si = {
3377
3369
  throw new Error("Invalid state: no search parameter provided");
3378
3370
  const c = a.map(ge);
3379
3371
  return {
3380
- textContent: ni({
3372
+ textContent: ri({
3381
3373
  comments: c,
3382
3374
  searchType: e.commentId ? "single" : e.taskId ? "task" : "project",
3383
3375
  searchId: e.commentId || e.taskId || e.projectId || "",
@@ -3395,7 +3387,7 @@ const si = {
3395
3387
  };
3396
3388
  }
3397
3389
  };
3398
- function ni({
3390
+ function ri({
3399
3391
  comments: e,
3400
3392
  searchType: t,
3401
3393
  searchId: o,
@@ -3425,49 +3417,49 @@ function fs(e) {
3425
3417
  const t = e.getUTCFullYear(), o = String(e.getUTCMonth() + 1).padStart(2, "0"), r = String(e.getUTCDate()).padStart(2, "0");
3426
3418
  return `${t}-${o}-${r}`;
3427
3419
  }
3428
- function ii(e) {
3420
+ function ni(e) {
3429
3421
  const t = /^([+-])(\d{2}):(\d{2})$/.exec(e);
3430
3422
  if (!t)
3431
3423
  return 0;
3432
3424
  const [, o, r, n] = t, i = Number(r) * 60 + Number(n);
3433
3425
  return o === "-" ? -i : i;
3434
3426
  }
3435
- function ai(e, t) {
3427
+ function ii(e, t) {
3436
3428
  const o = new Date(e.getTime() + t * 60 * 1e3);
3437
3429
  return fs(o);
3438
3430
  }
3439
- function Ct(e, t) {
3431
+ function $t(e, t) {
3440
3432
  const [o, r, n] = e.split("-"), i = Number(o), a = Number(r), c = Number(n);
3441
3433
  if (!Number.isFinite(i) || !Number.isFinite(a) || !Number.isFinite(c))
3442
3434
  throw new Error(`Invalid date format: ${e}. Expected YYYY-MM-DD.`);
3443
3435
  const d = new Date(Date.UTC(i, a - 1, c));
3444
3436
  return d.setUTCDate(d.getUTCDate() + t), fs(d);
3445
3437
  }
3446
- const ci = ["and", "or"], ct = {
3438
+ const ai = ["and", "or"], dt = {
3447
3439
  labels: s.string().array().optional().describe("The labels to filter the tasks by"),
3448
- labelsOperator: s.enum(ci).optional().describe(
3440
+ labelsOperator: s.enum(ai).optional().describe(
3449
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".'
3450
3442
  )
3451
3443
  };
3452
- function dt(e = [], t = "or") {
3444
+ function lt(e = [], t = "or") {
3453
3445
  if (e.length === 0) return "";
3454
3446
  const o = t === "and" ? " & " : " | ";
3455
3447
  return `(${e.map((i) => i.startsWith("@") ? i : `@${i}`).join(` ${o} `)})`;
3456
3448
  }
3457
- const di = 7;
3458
- function li({
3449
+ const ci = 7;
3450
+ function di({
3459
3451
  since: e,
3460
3452
  until: t,
3461
3453
  userGmtOffset: o,
3462
3454
  now: r = /* @__PURE__ */ new Date()
3463
3455
  }) {
3464
- const n = ii(o), i = ai(r, n), a = di - 1, c = t ?? (e ? Ct(e, a) : i);
3456
+ const n = ni(o), i = ii(r, n), a = ci - 1, c = t ?? (e ? $t(e, a) : i);
3465
3457
  return {
3466
- since: e ?? Ct(c, -a),
3458
+ since: e ?? $t(c, -a),
3467
3459
  until: c
3468
3460
  };
3469
3461
  }
3470
- const ui = {
3462
+ const li = {
3471
3463
  getBy: s.enum(["completion", "due"]).default("completion").describe(
3472
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).'
3473
3465
  ),
@@ -3490,18 +3482,18 @@ const ui = {
3490
3482
  cursor: s.string().optional().describe(
3491
3483
  "The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters)."
3492
3484
  ),
3493
- ...ct
3494
- }, pi = {
3485
+ ...dt
3486
+ }, ui = {
3495
3487
  tasks: s.array(H).describe("The found completed tasks."),
3496
3488
  nextCursor: s.string().optional(),
3497
3489
  totalCount: s.number().describe("The total number of tasks in this page."),
3498
3490
  hasMore: s.boolean(),
3499
3491
  appliedFilters: s.record(s.string(), s.unknown())
3500
- }, hi = {
3501
- name: g.FIND_COMPLETED_TASKS,
3492
+ }, pi = {
3493
+ name: y.FIND_COMPLETED_TASKS,
3502
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.',
3503
- parameters: ui,
3504
- outputSchema: pi,
3495
+ parameters: li,
3496
+ outputSchema: ui,
3505
3497
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3506
3498
  async execute(e, t) {
3507
3499
  const { getBy: o, labels: r, labelsOperator: n, since: i, until: a, responsibleUser: c, projectId: d, ...l } = e;
@@ -3509,13 +3501,13 @@ const ui = {
3509
3501
  throw new Error(
3510
3502
  "Cursor pagination requires explicit since and until. Reuse structuredContent.appliedFilters.since and structuredContent.appliedFilters.until from the previous page."
3511
3503
  );
3512
- const p = await Qe(t, c), u = p?.email;
3513
- let m = dt(r, n);
3504
+ const p = await et(t, c), u = p?.email;
3505
+ let m = lt(r, n);
3514
3506
  p && u && (m = ce(m, `assigned to: ${u}`));
3515
- const y = await t.getUser(), f = y.tzInfo?.gmtString || "+00:00", v = await de({
3507
+ const g = await t.getUser(), f = g.tzInfo?.gmtString || "+00:00", v = await de({
3516
3508
  projectId: d,
3517
- user: y
3518
- }), j = li({
3509
+ user: g
3510
+ }), j = di({
3519
3511
  since: i,
3520
3512
  until: a,
3521
3513
  userGmtOffset: f
@@ -3537,7 +3529,7 @@ const ui = {
3537
3529
  ...m ? { filterQuery: m, filterLang: "en" } : {}
3538
3530
  }), $ = b.map(P);
3539
3531
  return {
3540
- textContent: mi({
3532
+ textContent: hi({
3541
3533
  tasks: $,
3542
3534
  args: T,
3543
3535
  nextCursor: S,
@@ -3553,7 +3545,7 @@ const ui = {
3553
3545
  };
3554
3546
  }
3555
3547
  };
3556
- function mi({
3548
+ function hi({
3557
3549
  tasks: e,
3558
3550
  args: t,
3559
3551
  nextCursor: o,
@@ -3579,7 +3571,7 @@ function mi({
3579
3571
  zeroReasonHints: c
3580
3572
  });
3581
3573
  }
3582
- const fi = {
3574
+ const mi = {
3583
3575
  searchText: s.string().optional().describe(
3584
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.'
3585
3577
  ),
@@ -3587,7 +3579,7 @@ const fi = {
3587
3579
  cursor: s.string().optional().describe(
3588
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."
3589
3581
  )
3590
- }, bi = {
3582
+ }, fi = {
3591
3583
  labels: s.array(pe).describe("The found personal labels."),
3592
3584
  nextCursor: s.string().optional(),
3593
3585
  totalCount: s.number().describe("The total number of labels in this page."),
@@ -3596,22 +3588,22 @@ const fi = {
3596
3588
  "Names of all shared labels visible to you. These have no IDs or metadata — use their names directly when filtering tasks."
3597
3589
  ),
3598
3590
  appliedFilters: s.record(s.string(), s.unknown())
3599
- }, gi = {
3600
- name: g.FIND_LABELS,
3591
+ }, bi = {
3592
+ name: y.FIND_LABELS,
3601
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.",
3602
- parameters: fi,
3603
- outputSchema: bi,
3594
+ parameters: mi,
3595
+ outputSchema: fi,
3604
3596
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3605
3597
  async execute(e, t) {
3606
3598
  const [o, r] = await Promise.all([
3607
- e.searchText ? pr(t, e.searchText).then((c) => ({
3599
+ e.searchText ? ur(t, e.searchText).then((c) => ({
3608
3600
  results: c,
3609
3601
  nextCursor: null
3610
3602
  })) : t.getLabels({ limit: e.limit, cursor: e.cursor ?? null }),
3611
- hr(t)
3603
+ pr(t)
3612
3604
  ]), { results: n, nextCursor: i } = o, a = e.searchText ? { searchText: e.searchText } : { limit: e.limit, cursor: e.cursor };
3613
3605
  return {
3614
- textContent: yi({ labels: n, args: e, nextCursor: i, sharedLabels: r }),
3606
+ textContent: gi({ labels: n, args: e, nextCursor: i, sharedLabels: r }),
3615
3607
  structuredContent: {
3616
3608
  labels: n.map((c) => pe.parse(c)),
3617
3609
  nextCursor: i ?? void 0,
@@ -3623,7 +3615,7 @@ const fi = {
3623
3615
  };
3624
3616
  }
3625
3617
  };
3626
- function yi({
3618
+ function gi({
3627
3619
  labels: e,
3628
3620
  args: t,
3629
3621
  nextCursor: o,
@@ -3631,7 +3623,7 @@ function yi({
3631
3623
  }) {
3632
3624
  const n = t.searchText ? `All labels matching "${t.searchText}"` : "Labels", i = [];
3633
3625
  t.searchText && i.push(`searchText: "${t.searchText}"`);
3634
- const a = 10, d = e.slice(0, a).map(Yr).join(`
3626
+ const a = 10, d = e.slice(0, a).map(Kr).join(`
3635
3627
  `), l = e.length - a, p = l > 0 ? `${d}
3636
3628
  …and ${l} more` : d, u = [];
3637
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"));
@@ -3648,15 +3640,15 @@ No shared labels.`;
3648
3640
  zeroReasonHints: u
3649
3641
  }) + h;
3650
3642
  }
3651
- const { FIND_PROJECTS: bs, ADD_TASKS: gs, UPDATE_TASKS: ys } = g, Ti = {
3643
+ const { FIND_PROJECTS: bs, ADD_TASKS: gs, UPDATE_TASKS: ys } = y, yi = {
3652
3644
  projectId: s.string().min(1).optional().describe(
3653
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.'
3654
3646
  ),
3655
3647
  searchTerm: s.string().optional().describe(
3656
3648
  "Search for a user by name or email (partial and case insensitive match). If omitted, all users are returned."
3657
3649
  )
3658
- }, ki = {
3659
- collaborators: s.array(Sr).describe("The found users."),
3650
+ }, Ti = {
3651
+ collaborators: s.array(Ir).describe("The found users."),
3660
3652
  projectInfo: s.object({
3661
3653
  id: s.string().describe("The project ID."),
3662
3654
  name: s.string().describe("The project name."),
@@ -3665,16 +3657,16 @@ const { FIND_PROJECTS: bs, ADD_TASKS: gs, UPDATE_TASKS: ys } = g, Ti = {
3665
3657
  totalCount: s.number().describe("The total number of users found."),
3666
3658
  totalAvailable: s.number().optional().describe("The total number of available users before the search filter was applied."),
3667
3659
  appliedFilters: s.record(s.string(), s.unknown())
3668
- }, wi = {
3669
- name: g.FIND_PROJECT_COLLABORATORS,
3660
+ }, ki = {
3661
+ name: y.FIND_PROJECT_COLLABORATORS,
3670
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.`,
3671
- parameters: Ti,
3672
- outputSchema: ki,
3663
+ parameters: yi,
3664
+ outputSchema: Ti,
3673
3665
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3674
3666
  async execute(e, t) {
3675
3667
  const { projectId: o, searchTerm: r } = e;
3676
3668
  if (!o)
3677
- return vi({ searchTerm: r, client: t, appliedFilters: e });
3669
+ return wi({ searchTerm: r, client: t, appliedFilters: e });
3678
3670
  let n = o, i;
3679
3671
  try {
3680
3672
  if (i = await t.getProject(o), !i)
@@ -3744,12 +3736,12 @@ const { FIND_PROJECTS: bs, ADD_TASKS: gs, UPDATE_TASKS: ys } = g, Ti = {
3744
3736
  };
3745
3737
  }
3746
3738
  };
3747
- async function vi({
3739
+ async function wi({
3748
3740
  searchTerm: e,
3749
3741
  client: t,
3750
3742
  appliedFilters: o
3751
3743
  }) {
3752
- const r = await N.getAllCollaborators(t), n = await Ii(t, r);
3744
+ const r = await N.getAllCollaborators(t), n = await vi(t, r);
3753
3745
  if (n.length === 0)
3754
3746
  return {
3755
3747
  textContent: `No users found. You may have no shared projects, or collaborator data is not accessible.
@@ -3783,7 +3775,7 @@ async function vi({
3783
3775
  }
3784
3776
  };
3785
3777
  }
3786
- async function Ii(e, t) {
3778
+ async function vi(e, t) {
3787
3779
  try {
3788
3780
  const o = await e.getUser();
3789
3781
  return !o || t.some((r) => r.id === o.id) ? t : [
@@ -3828,11 +3820,11 @@ function ks({
3828
3820
  nextSteps: p
3829
3821
  });
3830
3822
  }
3831
- const { ADD_PROJECTS: $t } = g, Si = {
3823
+ const { ADD_PROJECTS: Dt } = y, Ii = {
3832
3824
  active: "projects",
3833
3825
  archived: "archived projects",
3834
3826
  all: "projects (active and archived)"
3835
- }, ji = {
3827
+ }, Si = {
3836
3828
  searchText: s.string().optional().describe(
3837
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.'
3838
3830
  ),
@@ -3843,17 +3835,17 @@ const { ADD_PROJECTS: $t } = g, Si = {
3843
3835
  archivedStatus: s.enum(["active", "archived", "all"]).optional().describe(
3844
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')."
3845
3837
  )
3846
- }, Ci = {
3838
+ }, ji = {
3847
3839
  projects: s.array(Q).describe("The found projects."),
3848
3840
  nextCursor: s.string().optional(),
3849
3841
  totalCount: s.number().describe("The total number of projects in this page."),
3850
3842
  hasMore: s.boolean(),
3851
3843
  appliedFilters: s.record(s.string(), s.unknown())
3852
- }, $i = {
3853
- name: g.FIND_PROJECTS,
3844
+ }, Ci = {
3845
+ name: y.FIND_PROJECTS,
3854
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.",
3855
- parameters: ji,
3856
- outputSchema: Ci,
3847
+ parameters: Si,
3848
+ outputSchema: ji,
3857
3849
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3858
3850
  async execute(e, t) {
3859
3851
  const { searchText: o } = e, r = e.archivedStatus ?? "active";
@@ -3861,8 +3853,8 @@ const { ADD_PROJECTS: $t } = g, Si = {
3861
3853
  if (o || r === "all") {
3862
3854
  const c = Promise.resolve([]), [d, l] = await Promise.all([
3863
3855
  r === "archived" ? c : o ? rs(t, o) : ns(t),
3864
- r === "active" ? c : lr(t)
3865
- ]), p = o ? ur(o) : null, u = p ? l.filter((h) => p.test(h.name)) : l;
3856
+ r === "active" ? c : dr(t)
3857
+ ]), p = o ? lr(o) : null, u = p ? l.filter((h) => p.test(h.name)) : l;
3866
3858
  n = [...d, ...u];
3867
3859
  } else {
3868
3860
  const c = r === "archived" ? await t.getArchivedProjects({
@@ -3873,7 +3865,7 @@ const { ADD_PROJECTS: $t } = g, Si = {
3873
3865
  }
3874
3866
  const a = n.map(Z);
3875
3867
  return {
3876
- textContent: Di({ projects: a, args: e, nextCursor: i }),
3868
+ textContent: $i({ projects: a, args: e, nextCursor: i }),
3877
3869
  structuredContent: {
3878
3870
  projects: a,
3879
3871
  nextCursor: i ?? void 0,
@@ -3884,17 +3876,17 @@ const { ADD_PROJECTS: $t } = g, Si = {
3884
3876
  };
3885
3877
  }
3886
3878
  };
3887
- function Di({
3879
+ function $i({
3888
3880
  projects: e,
3889
3881
  args: t,
3890
3882
  nextCursor: o
3891
3883
  }) {
3892
- const r = Si[t.archivedStatus ?? "active"], n = t.searchText ? `All ${r} matching "${t.searchText}"` : `${r.charAt(0).toUpperCase()}${r.slice(1)}`, i = [];
3884
+ const r = Ii[t.archivedStatus ?? "active"], n = t.searchText ? `All ${r} matching "${t.searchText}"` : `${r.charAt(0).toUpperCase()}${r.slice(1)}`, i = [];
3893
3885
  t.searchText && i.push(`searchText: "${t.searchText}"`), t.archivedStatus && t.archivedStatus !== "active" && i.push(`archivedStatus: "${t.archivedStatus}"`);
3894
- const a = 10, d = e.slice(0, a).map(qr).join(`
3886
+ const a = 10, d = e.slice(0, a).map(Yr).join(`
3895
3887
  `), l = e.length - a, p = l > 0 ? `${d}
3896
3888
  …and ${l} more` : d, u = [];
3897
- 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 ${$t} to create a project`)) : (u.push("No active projects"), u.push("Use archivedStatus: 'all' to include archived projects"), u.push(`Use ${$t} to create a project`))), Y({
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({
3898
3890
  subject: n,
3899
3891
  count: e.length,
3900
3892
  limit: t.searchText || t.archivedStatus === "all" ? void 0 : t.limit,
@@ -3904,22 +3896,22 @@ function Di({
3904
3896
  zeroReasonHints: u
3905
3897
  });
3906
3898
  }
3907
- const xi = {
3899
+ const Di = {
3908
3900
  taskId: s.string().optional().describe(
3909
3901
  "Find all reminders for a specific task. Returns both time-based and location reminders."
3910
3902
  ),
3911
3903
  reminderId: s.string().optional().describe("Get a specific time-based reminder (relative or absolute) by its ID."),
3912
3904
  locationReminderId: s.string().optional().describe("Get a specific location reminder by its ID.")
3913
- }, Ai = {
3914
- reminders: s.array(st).describe("The found reminders (time-based and location)."),
3905
+ }, xi = {
3906
+ reminders: s.array(ot).describe("The found reminders (time-based and location)."),
3915
3907
  searchType: s.string().describe('The search type used: "task", "reminder", or "location_reminder".'),
3916
3908
  searchId: s.string().describe("The ID used for the search."),
3917
3909
  totalCount: s.number().describe("Total reminders in this response.")
3918
- }, Ei = {
3919
- name: g.FIND_REMINDERS,
3910
+ }, Ai = {
3911
+ name: y.FIND_REMINDERS,
3920
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.",
3921
- parameters: xi,
3922
- outputSchema: Ai,
3913
+ parameters: Di,
3914
+ outputSchema: xi,
3923
3915
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3924
3916
  async execute(e, t) {
3925
3917
  const { taskId: o, reminderId: r, locationReminderId: n } = e, i = [o, r, n].filter(Boolean);
@@ -3965,7 +3957,7 @@ const xi = {
3965
3957
  })
3966
3958
  ]), l = [...a, ...c].map(be);
3967
3959
  return {
3968
- textContent: Oi(l, o),
3960
+ textContent: Ei(l, o),
3969
3961
  structuredContent: {
3970
3962
  reminders: l,
3971
3963
  searchType: "task",
@@ -3977,7 +3969,7 @@ const xi = {
3977
3969
  throw new Error("One of taskId, reminderId, or locationReminderId must be provided.");
3978
3970
  }
3979
3971
  };
3980
- function Oi(e, t) {
3972
+ function Ei(e, t) {
3981
3973
  if (e.length === 0)
3982
3974
  return `No reminders found for task ${t}`;
3983
3975
  const { timeBasedCount: o, locationCount: r } = is(e), n = [];
@@ -3991,22 +3983,22 @@ function Oi(e, t) {
3991
3983
  }
3992
3984
  return `Found ${n.join(" and ")} for task ${t}`;
3993
3985
  }
3994
- const { ADD_SECTIONS: Pi } = g, _i = {
3986
+ const { ADD_SECTIONS: Oi } = y, Pi = {
3995
3987
  projectId: s.string().min(1).describe(
3996
3988
  'The ID of the project to search sections in. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
3997
3989
  ),
3998
3990
  searchText: s.string().optional().describe(
3999
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.'
4000
3992
  )
4001
- }, Ri = {
3993
+ }, _i = {
4002
3994
  sections: s.array(X).describe("The found sections."),
4003
3995
  totalCount: s.number().describe("The total number of sections found."),
4004
3996
  appliedFilters: s.record(s.string(), s.unknown())
4005
- }, Ui = {
4006
- name: g.FIND_SECTIONS,
3997
+ }, Ri = {
3998
+ name: y.FIND_SECTIONS,
4007
3999
  description: "Search for sections by name or other criteria in a project. When searching, uses server-side search to avoid fetching all sections.",
4008
- parameters: _i,
4009
- outputSchema: Ri,
4000
+ parameters: Pi,
4001
+ outputSchema: _i,
4010
4002
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
4011
4003
  async execute(e, t) {
4012
4004
  const o = await de({
@@ -4014,12 +4006,12 @@ const { ADD_SECTIONS: Pi } = g, _i = {
4014
4006
  client: t
4015
4007
  });
4016
4008
  let r;
4017
- e.searchText ? r = await mr(t, e.searchText, o) : r = (await t.getSections({
4009
+ e.searchText ? r = await hr(t, e.searchText, o) : r = (await t.getSections({
4018
4010
  projectId: o
4019
4011
  })).results;
4020
4012
  const n = r.map(K);
4021
4013
  return {
4022
- textContent: Li({
4014
+ textContent: Ui({
4023
4015
  sections: n,
4024
4016
  projectId: e.projectId,
4025
4017
  searchText: e.searchText
@@ -4032,13 +4024,13 @@ const { ADD_SECTIONS: Pi } = g, _i = {
4032
4024
  };
4033
4025
  }
4034
4026
  };
4035
- function Li({
4027
+ function Ui({
4036
4028
  sections: e,
4037
4029
  projectId: t,
4038
4030
  searchText: o
4039
4031
  }) {
4040
4032
  const r = [];
4041
- 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`));
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`));
4042
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(`
4043
4035
  `) : void 0;
4044
4036
  return Y({
@@ -4051,7 +4043,7 @@ function Li({
4051
4043
  function ws(e) {
4052
4044
  return /* @__PURE__ */ new Date(`${e}T00:00:00`);
4053
4045
  }
4054
- const Ni = {
4046
+ const Li = {
4055
4047
  startDate: s.string().regex(/^(\d{4}-\d{2}-\d{2}|today)$/).optional().describe(
4056
4048
  "The start date to get the tasks for. Format: YYYY-MM-DD, or 'today', which by default also includes overdue tasks."
4057
4049
  ),
@@ -4071,39 +4063,39 @@ const Ni = {
4071
4063
  responsibleUserFiltering: s.enum(ss).optional().describe(
4072
4064
  "Filter when responsibleUser is omitted. 'assigned'=assigned to others; 'unassignedOrMe'=unassigned+mine; 'all'=everyone. Default: 'unassignedOrMe'."
4073
4065
  ),
4074
- ...ct
4075
- }, Mi = {
4066
+ ...dt
4067
+ }, Ni = {
4076
4068
  tasks: s.array(H).describe("The found tasks."),
4077
4069
  nextCursor: s.string().optional(),
4078
4070
  totalCount: s.number().describe("The total number of tasks in this page."),
4079
4071
  hasMore: s.boolean(),
4080
4072
  appliedFilters: s.record(s.string(), s.unknown())
4081
- }, Fi = {
4082
- name: g.FIND_TASKS_BY_DATE,
4073
+ }, Mi = {
4074
+ name: y.FIND_TASKS_BY_DATE,
4083
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.",
4084
- parameters: Ni,
4085
- outputSchema: Mi,
4076
+ parameters: Li,
4077
+ outputSchema: Ni,
4086
4078
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
4087
4079
  async execute(e, t) {
4088
4080
  if (!e.startDate && e.overdueOption !== "overdue-only")
4089
4081
  throw new Error(
4090
4082
  "Either startDate must be provided or overdueOption must be set to overdue-only"
4091
4083
  );
4092
- const o = await Qe(t, e.responsibleUser), r = o?.userId, n = o?.email;
4084
+ const o = await et(t, e.responsibleUser), r = o?.userId, n = o?.email;
4093
4085
  let i = "";
4094
4086
  if (e.overdueOption === "overdue-only")
4095
4087
  i = "overdue";
4096
4088
  else if (e.startDate === "today")
4097
4089
  if (e.daysCount > 1) {
4098
- const u = /* @__PURE__ */ new Date(), h = ae(u), m = Ue(u, e.daysCount), y = lt(m, { representation: "date" }), f = `(due after: ${h} | due: ${h}) & due before: ${y}`;
4090
+ const u = /* @__PURE__ */ new Date(), h = ae(u), m = Le(u, e.daysCount), g = ut(m, { representation: "date" }), f = `(due after: ${h} | due: ${h}) & due before: ${g}`;
4099
4091
  i = e.overdueOption === "exclude-overdue" ? f : `(${f} | overdue)`;
4100
4092
  } else
4101
4093
  i = e.overdueOption === "exclude-overdue" ? "today" : "(today | overdue)";
4102
4094
  else if (e.startDate) {
4103
- const u = e.startDate, h = Ue(ws(u), e.daysCount), m = lt(h, { representation: "date" });
4095
+ const u = e.startDate, h = Le(ws(u), e.daysCount), m = ut(h, { representation: "date" });
4104
4096
  i = `(due after: ${u} | due: ${u}) & due before: ${m}`;
4105
4097
  }
4106
- const a = dt(e.labels, e.labelsOperator);
4098
+ const a = lt(e.labels, e.labelsOperator);
4107
4099
  a.length > 0 && (i = ce(i, `(${a})`));
4108
4100
  const c = os({
4109
4101
  resolvedAssigneeId: r,
@@ -4111,14 +4103,14 @@ const Ni = {
4111
4103
  responsibleUserFiltering: e.responsibleUserFiltering
4112
4104
  });
4113
4105
  i = ce(i, c);
4114
- const { tasks: d, nextCursor: l } = await tt({
4106
+ const { tasks: d, nextCursor: l } = await st({
4115
4107
  client: t,
4116
4108
  query: i,
4117
4109
  cursor: e.cursor,
4118
4110
  limit: e.limit
4119
4111
  });
4120
4112
  return {
4121
- textContent: Hi({ tasks: d, args: e, nextCursor: l, assigneeEmail: n }),
4113
+ textContent: Fi({ tasks: d, args: e, nextCursor: l, assigneeEmail: n }),
4122
4114
  structuredContent: {
4123
4115
  tasks: d,
4124
4116
  nextCursor: l ?? void 0,
@@ -4129,7 +4121,7 @@ const Ni = {
4129
4121
  };
4130
4122
  }
4131
4123
  };
4132
- function Hi({
4124
+ function Fi({
4133
4125
  tasks: e,
4134
4126
  args: t,
4135
4127
  nextCursor: o,
@@ -4144,7 +4136,7 @@ function Hi({
4144
4136
  `today${c}${t.daysCount > 1 ? ` + ${t.daysCount - 1} more days` : ""}`
4145
4137
  );
4146
4138
  } else if (t.startDate) {
4147
- const c = t.daysCount > 1 ? ` to ${ae(Ue(ws(t.startDate), t.daysCount))}` : "";
4139
+ const c = t.daysCount > 1 ? ` to ${ae(Le(ws(t.startDate), t.daysCount))}` : "";
4148
4140
  n.push(`${t.startDate}${c}`);
4149
4141
  }
4150
4142
  if (t.labels && t.labels.length > 0) {
@@ -4179,13 +4171,13 @@ function Hi({
4179
4171
  zeroReasonHints: a
4180
4172
  });
4181
4173
  }
4182
- const Wi = 300 * 1e3;
4183
- class Bi {
4174
+ const Hi = 300 * 1e3;
4175
+ class Wi {
4184
4176
  constructor() {
4185
4177
  this.cache = null;
4186
4178
  }
4187
4179
  async getFilters(t) {
4188
- if (this.cache && Date.now() - this.cache.timestamp < Wi)
4180
+ if (this.cache && Date.now() - this.cache.timestamp < Hi)
4189
4181
  return this.cache.filters;
4190
4182
  const r = ((await t.sync({
4191
4183
  resourceTypes: ["filters"],
@@ -4242,7 +4234,7 @@ ${p}` + (d.length > 5 ? `
4242
4234
  this.cache = null;
4243
4235
  }
4244
4236
  }
4245
- const zi = new Bi(), { FIND_COMPLETED_TASKS: Dt, ADD_TASKS: xt } = g, Ki = {
4237
+ const Bi = new Wi(), { FIND_COMPLETED_TASKS: xt, ADD_TASKS: At } = y, zi = {
4246
4238
  searchText: s.string().optional().describe("The text to search for in tasks."),
4247
4239
  projectId: s.string().optional().describe(
4248
4240
  'Find tasks in this project. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
@@ -4263,18 +4255,18 @@ const zi = new Bi(), { FIND_COMPLETED_TASKS: Dt, ADD_TASKS: xt } = g, Ki = {
4263
4255
  filterIdOrName: s.string().optional().describe(
4264
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."
4265
4257
  ),
4266
- ...ct
4267
- }, Yi = {
4258
+ ...dt
4259
+ }, Ki = {
4268
4260
  tasks: s.array(H).describe("The found tasks."),
4269
4261
  nextCursor: s.string().optional(),
4270
4262
  totalCount: s.number().describe("The total number of tasks in this page."),
4271
4263
  hasMore: s.boolean(),
4272
4264
  appliedFilters: s.record(s.string(), s.unknown())
4273
- }, qi = {
4274
- name: g.FIND_TASKS,
4265
+ }, Yi = {
4266
+ name: y.FIND_TASKS,
4275
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.",
4276
- parameters: Ki,
4277
- outputSchema: Yi,
4268
+ parameters: zi,
4269
+ outputSchema: Ki,
4278
4270
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
4279
4271
  async execute(e, t) {
4280
4272
  const {
@@ -4290,7 +4282,7 @@ const zi = new Bi(), { FIND_COMPLETED_TASKS: Dt, ADD_TASKS: xt } = g, Ki = {
4290
4282
  labelsOperator: u,
4291
4283
  filter: h,
4292
4284
  filterIdOrName: m
4293
- } = e, y = await t.getUser(), f = p && p.length > 0;
4285
+ } = e, g = await t.getUser(), f = p && p.length > 0;
4294
4286
  if (!o && !r && !n && !i && !a && !f && !h && !m)
4295
4287
  throw new Error(
4296
4288
  "At least one filter must be provided: searchText, projectId, sectionId, parentId, responsibleUser, labels, filter, or filterIdOrName"
@@ -4304,22 +4296,22 @@ const zi = new Bi(), { FIND_COMPLETED_TASKS: Dt, ADD_TASKS: xt } = g, Ki = {
4304
4296
  'The `filter`/`filterIdOrName` parameter cannot be combined with projectId, sectionId, or parentId. Use filter syntax instead (e.g. "##ProjectName").'
4305
4297
  );
4306
4298
  let v = h;
4307
- m && (v = (await zi.resolveFilter(t, m)).filterQuery);
4308
- const j = await Qe(t, a), A = j?.userId, k = j?.email;
4299
+ m && (v = (await Bi.resolveFilter(t, m)).filterQuery);
4300
+ const j = await et(t, a), A = j?.userId, k = j?.email;
4309
4301
  if (r || n || i) {
4310
4302
  const D = {
4311
4303
  limit: d,
4312
4304
  cursor: l ?? null
4313
4305
  };
4314
- r && (D.projectId = await de({ projectId: r, user: y })), n && (D.sectionId = n), i && (D.parentId = i);
4306
+ r && (D.projectId = await de({ projectId: r, user: g })), n && (D.sectionId = n), i && (D.parentId = i);
4315
4307
  const { results: he, nextCursor: q } = await t.getTasks(D), $e = he.map(P);
4316
4308
  let W = o ? $e.filter(
4317
4309
  (te) => te.content.toLowerCase().includes(o.toLowerCase()) || te.description?.toLowerCase().includes(o.toLowerCase())
4318
4310
  ) : $e;
4319
- return W = dr({
4311
+ return W = cr({
4320
4312
  tasks: W,
4321
4313
  resolvedAssigneeId: A,
4322
- currentUserId: y.id,
4314
+ currentUserId: g.id,
4323
4315
  responsibleUserFiltering: c
4324
4316
  }), p && p.length > 0 && (W = u === "and" ? W.filter(
4325
4317
  (te) => p.every((De) => te.labels.includes(De))
@@ -4368,7 +4360,7 @@ const zi = new Bi(), { FIND_COMPLETED_TASKS: Dt, ADD_TASKS: xt } = g, Ki = {
4368
4360
  }
4369
4361
  let I = v ? `(${v})` : "";
4370
4362
  o && (I = ce(I, `search: ${o}`));
4371
- const x = dt(p, u);
4363
+ const x = lt(p, u);
4372
4364
  if (I = ce(I, x), !(m && !a && !c)) {
4373
4365
  const D = os({
4374
4366
  resolvedAssigneeId: A,
@@ -4377,7 +4369,7 @@ const zi = new Bi(), { FIND_COMPLETED_TASKS: Dt, ADD_TASKS: xt } = g, Ki = {
4377
4369
  });
4378
4370
  I = ce(I, D);
4379
4371
  }
4380
- const { tasks: b, nextCursor: S } = await tt({
4372
+ const { tasks: b, nextCursor: S } = await st({
4381
4373
  client: t,
4382
4374
  query: I,
4383
4375
  cursor: e.cursor,
@@ -4401,12 +4393,12 @@ const zi = new Bi(), { FIND_COMPLETED_TASKS: Dt, ADD_TASKS: xt } = g, Ki = {
4401
4393
  };
4402
4394
  }
4403
4395
  };
4404
- function Gi(e) {
4396
+ function qi(e) {
4405
4397
  if (e.projectId) {
4406
4398
  const t = [
4407
4399
  e.searchText ? "No tasks in project match search" : "Project has no tasks yet"
4408
4400
  ];
4409
- return e.searchText || t.push(`Use ${xt} to create tasks`), t;
4401
+ return e.searchText || t.push(`Use ${At} to create tasks`), t;
4410
4402
  }
4411
4403
  if (e.sectionId) {
4412
4404
  const t = [e.searchText ? "No tasks in section match search" : "Section is empty"];
@@ -4414,7 +4406,7 @@ function Gi(e) {
4414
4406
  }
4415
4407
  if (e.parentId) {
4416
4408
  const t = [e.searchText ? "No subtasks match search" : "No subtasks created yet"];
4417
- return e.searchText || t.push(`Use ${xt} with parentId to add subtasks`), t;
4409
+ return e.searchText || t.push(`Use ${At} with parentId to add subtasks`), t;
4418
4410
  }
4419
4411
  return [];
4420
4412
  }
@@ -4436,7 +4428,7 @@ function Ee({
4436
4428
  const d = t.labels.map((l) => `@${l}`).join(t.labelsOperator === "and" ? " & " : " | ");
4437
4429
  a.push(`labels: ${d}`);
4438
4430
  }
4439
- e.length === 0 && c.push(...Gi(t));
4431
+ e.length === 0 && c.push(...qi(t));
4440
4432
  } else {
4441
4433
  const d = n || t.responsibleUser, l = [];
4442
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) {
@@ -4450,9 +4442,9 @@ function Ee({
4450
4442
  if (e.length === 0) {
4451
4443
  if (t.responsibleUser) {
4452
4444
  const p = n || t.responsibleUser;
4453
- c.push(`No tasks assigned to ${p}`), c.push("Check if the user name is correct"), c.push(`Check completed tasks with ${Dt}`);
4445
+ c.push(`No tasks assigned to ${p}`), c.push("Check if the user name is correct"), c.push(`Check completed tasks with ${xt}`);
4454
4446
  }
4455
- t.searchText && (c.push("Try broader search terms"), c.push("Verify spelling and try partial words"), t.responsibleUser || c.push(`Check completed tasks with ${Dt}`));
4447
+ t.searchText && (c.push("Try broader search terms"), c.push("Verify spelling and try partial words"), t.responsibleUser || c.push(`Check completed tasks with ${xt}`));
4456
4448
  }
4457
4449
  }
4458
4450
  return Y({
@@ -4465,7 +4457,7 @@ function Ee({
4465
4457
  zeroReasonHints: c
4466
4458
  });
4467
4459
  }
4468
- const Vi = {
4460
+ const Gi = {
4469
4461
  projectId: s.string().min(1).optional().describe(
4470
4462
  "Optional project ID. If provided, shows detailed overview of that project. If omitted, shows overview of all projects."
4471
4463
  )
@@ -4484,7 +4476,7 @@ const Vi = {
4484
4476
  ),
4485
4477
  children: s.array(vs).describe("Nested child projects.")
4486
4478
  })
4487
- ), Ji = {
4479
+ ), Vi = {
4488
4480
  type: s.enum(["account_overview", "project_overview"]).describe("The type of overview returned."),
4489
4481
  totalProjects: s.number().optional().describe("Total number of projects (account overview only)."),
4490
4482
  totalTasks: s.number().optional().describe("Total number of tasks."),
@@ -4518,7 +4510,7 @@ const Vi = {
4518
4510
  tasksWithoutSection: s.number()
4519
4511
  }).optional().describe("Statistics object (project overview only).")
4520
4512
  };
4521
- function Xi(e) {
4513
+ function Ji(e) {
4522
4514
  const t = {};
4523
4515
  for (const n of e)
4524
4516
  t[n.id] = {
@@ -4543,7 +4535,7 @@ function Xi(e) {
4543
4535
  }
4544
4536
  return r(o), o;
4545
4537
  }
4546
- async function Zi(e, t) {
4538
+ async function Xi(e, t) {
4547
4539
  const o = {};
4548
4540
  return await Promise.all(
4549
4541
  t.map(async (r) => {
@@ -4562,7 +4554,7 @@ function Is(e, t, o = "") {
4562
4554
  r.push(...Is(i, t, `${o} `));
4563
4555
  return r;
4564
4556
  }
4565
- function At(e) {
4557
+ function Et(e) {
4566
4558
  const t = {};
4567
4559
  for (const r of e)
4568
4560
  t[r.id] = { ...r, children: [] };
@@ -4579,11 +4571,11 @@ function At(e) {
4579
4571
  }
4580
4572
  return o;
4581
4573
  }
4582
- function Ye(e, t = "") {
4574
+ function qe(e, t = "") {
4583
4575
  const o = [];
4584
4576
  for (const r of e) {
4585
4577
  const n = `id=${r.id}`, i = r.dueDate ? `; due=${r.dueDate}` : "", a = `; content=${r.content}`;
4586
- o.push(`${t}- ${n}${i}${a}`), r.children.length > 0 && o.push(...Ye(r.children, `${t} `));
4578
+ o.push(`${t}- ${n}${i}${a}`), r.children.length > 0 && o.push(...qe(r.children, `${t} `));
4587
4579
  }
4588
4580
  return o;
4589
4581
  }
@@ -4600,7 +4592,7 @@ function Ss(e, t) {
4600
4592
  )
4601
4593
  };
4602
4594
  }
4603
- async function Qi(e, t) {
4595
+ async function Zi(e, t) {
4604
4596
  let o = [], r;
4605
4597
  do {
4606
4598
  const { results: n, nextCursor: i } = await e.getTasks({
@@ -4612,12 +4604,12 @@ async function Qi(e, t) {
4612
4604
  } while (r);
4613
4605
  return o;
4614
4606
  }
4615
- async function ea(e, t) {
4607
+ async function Qi(e, t) {
4616
4608
  const { results: o } = await e.getSections({ projectId: t });
4617
4609
  return o;
4618
4610
  }
4619
- async function ta(e) {
4620
- 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", ""];
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", ""];
4621
4613
  if (o) {
4622
4614
  c.push(`- Inbox Project: ${o.name} (id=${o.id})`);
4623
4615
  for (const u of a[o.id] || [])
@@ -4654,11 +4646,11 @@ async function ta(e) {
4654
4646
  };
4655
4647
  return { textContent: l, structuredContent: p };
4656
4648
  }
4657
- async function sa(e, t) {
4649
+ async function ta(e, t) {
4658
4650
  const [o, r, n] = await Promise.all([
4659
4651
  e.getProject(t),
4660
- ea(e, t),
4661
- Qi(e, t)
4652
+ Qi(e, t),
4653
+ Zi(e, t)
4662
4654
  ]), i = {};
4663
4655
  for (const p of r)
4664
4656
  i[p.id] = [];
@@ -4668,16 +4660,16 @@ async function sa(e, t) {
4668
4660
  const c = [`# ${o.name}`];
4669
4661
  if (a.length > 0) {
4670
4662
  c.push("");
4671
- const p = At(a);
4672
- c.push(...Ye(p));
4663
+ const p = Et(a);
4664
+ c.push(...qe(p));
4673
4665
  }
4674
4666
  for (const p of r) {
4675
4667
  c.push(""), c.push(`## ${p.name}`);
4676
4668
  const u = i[p.id];
4677
4669
  if (!u?.length)
4678
4670
  continue;
4679
- const h = At(u);
4680
- c.push(...Ye(h));
4671
+ const h = Et(u);
4672
+ c.push(...qe(h));
4681
4673
  }
4682
4674
  const d = c.join(`
4683
4675
  `), l = {
@@ -4700,33 +4692,33 @@ async function sa(e, t) {
4700
4692
  };
4701
4693
  return { textContent: d, structuredContent: l };
4702
4694
  }
4703
- const oa = {
4704
- name: g.GET_OVERVIEW,
4695
+ const sa = {
4696
+ name: y.GET_OVERVIEW,
4705
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.",
4706
- parameters: Vi,
4707
- outputSchema: Ji,
4698
+ parameters: Gi,
4699
+ outputSchema: Vi,
4708
4700
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
4709
4701
  async execute(e, t) {
4710
- const o = e.projectId ? await sa(t, e.projectId) : await ta(t);
4702
+ const o = e.projectId ? await ta(t, e.projectId) : await ea(t);
4711
4703
  return {
4712
4704
  textContent: o.textContent,
4713
4705
  structuredContent: o.structuredContent
4714
4706
  };
4715
4707
  }
4716
- }, ra = {}, ie = s.object({
4708
+ }, oa = {}, ie = s.object({
4717
4709
  count: s.number().describe("Number of consecutive periods in this streak."),
4718
4710
  start: s.string().describe("Start date of the streak."),
4719
4711
  end: s.string().describe("End date of the streak.")
4720
- }), Et = s.object({
4712
+ }), Ot = s.object({
4721
4713
  id: s.string().describe("Project ID."),
4722
4714
  completed: s.number().describe("Number of tasks completed in this project.")
4723
- }), na = {
4715
+ }), ra = {
4724
4716
  completedCount: s.number().describe("Total number of completed tasks (all-time)."),
4725
4717
  daysItems: s.array(
4726
4718
  s.object({
4727
4719
  date: s.string().describe("Date string (YYYY-MM-DD)."),
4728
4720
  totalCompleted: s.number().describe("Total tasks completed on this day."),
4729
- items: s.array(Et).describe("Per-project completion breakdown for this day.")
4721
+ items: s.array(Ot).describe("Per-project completion breakdown for this day.")
4730
4722
  })
4731
4723
  ).describe("Daily completion breakdown (most recent days)."),
4732
4724
  weekItems: s.array(
@@ -4734,7 +4726,7 @@ const oa = {
4734
4726
  from: s.string().describe("Start date of the week."),
4735
4727
  to: s.string().describe("End date of the week."),
4736
4728
  totalCompleted: s.number().describe("Total tasks completed in this week."),
4737
- items: s.array(Et).describe("Per-project completion breakdown for this week.")
4729
+ items: s.array(Ot).describe("Per-project completion breakdown for this week.")
4738
4730
  })
4739
4731
  ).describe("Weekly completion breakdown (most recent weeks)."),
4740
4732
  goals: s.object({
@@ -4769,11 +4761,11 @@ const oa = {
4769
4761
  })
4770
4762
  ).describe("Recent karma change events with reasons."),
4771
4763
  projectColors: s.record(s.string(), s.string()).describe("Map of project ID to color key.")
4772
- }, ia = {
4773
- name: g.GET_PRODUCTIVITY_STATS,
4764
+ }, na = {
4765
+ name: y.GET_PRODUCTIVITY_STATS,
4774
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.',
4775
- parameters: ra,
4776
- outputSchema: na,
4767
+ parameters: oa,
4768
+ outputSchema: ra,
4777
4769
  annotations: {
4778
4770
  readOnlyHint: !0,
4779
4771
  destructiveHint: !1,
@@ -4782,7 +4774,7 @@ const oa = {
4782
4774
  async execute(e, t) {
4783
4775
  const o = await t.getProductivityStats();
4784
4776
  return {
4785
- textContent: aa(o),
4777
+ textContent: ia(o),
4786
4778
  structuredContent: {
4787
4779
  completedCount: o.completedCount,
4788
4780
  daysItems: o.daysItems,
@@ -4809,7 +4801,7 @@ const oa = {
4809
4801
  };
4810
4802
  }
4811
4803
  };
4812
- function aa(e) {
4804
+ function ia(e) {
4813
4805
  const t = [
4814
4806
  "# Productivity Statistics",
4815
4807
  "",
@@ -4839,11 +4831,11 @@ function aa(e) {
4839
4831
  return t.join(`
4840
4832
  `);
4841
4833
  }
4842
- const ca = {
4834
+ const aa = {
4843
4835
  projectId: s.string().min(1).describe("The ID of the project to get activity stats for."),
4844
4836
  weeks: s.number().int().min(1).max(12).optional().describe("Number of weeks of activity data to retrieve (1-12, default 2)."),
4845
4837
  includeWeeklyCounts: s.boolean().optional().describe("Include weekly rollup counts alongside daily counts.")
4846
- }, da = {
4838
+ }, ca = {
4847
4839
  projectId: s.string().describe("The project ID."),
4848
4840
  dayItems: s.array(
4849
4841
  s.object({
@@ -4859,7 +4851,7 @@ const ca = {
4859
4851
  })
4860
4852
  ).optional().describe("Weekly completion rollups. Only included when includeWeeklyCounts is true.")
4861
4853
  };
4862
- function la(e, t) {
4854
+ function da(e, t) {
4863
4855
  const o = [`# Activity Stats: Project ${e}`, ""];
4864
4856
  if (t.dayItems.length > 0) {
4865
4857
  o.push("## Daily Activity");
@@ -4875,11 +4867,11 @@ function la(e, t) {
4875
4867
  return o.join(`
4876
4868
  `);
4877
4869
  }
4878
- const ua = {
4879
- name: g.GET_PROJECT_ACTIVITY_STATS,
4870
+ const la = {
4871
+ name: y.GET_PROJECT_ACTIVITY_STATS,
4880
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.",
4881
- parameters: ca,
4882
- outputSchema: da,
4873
+ parameters: aa,
4874
+ outputSchema: ca,
4883
4875
  annotations: {
4884
4876
  readOnlyHint: !0,
4885
4877
  destructiveHint: !1,
@@ -4891,7 +4883,7 @@ const ua = {
4891
4883
  includeWeeklyCounts: n
4892
4884
  });
4893
4885
  return {
4894
- textContent: la(o, i),
4886
+ textContent: da(o, i),
4895
4887
  structuredContent: {
4896
4888
  projectId: o,
4897
4889
  dayItems: i.dayItems,
@@ -4899,12 +4891,12 @@ const ua = {
4899
4891
  }
4900
4892
  };
4901
4893
  }
4902
- }, pa = {
4894
+ }, ua = {
4903
4895
  projectId: s.string().min(1).describe("The ID of the project to check health for."),
4904
4896
  includeContext: s.boolean().default(!1).describe(
4905
4897
  "Include detailed health context with project metrics and task-level data. May produce large output for projects with many tasks."
4906
4898
  )
4907
- }, ha = s.object({
4899
+ }, pa = s.object({
4908
4900
  id: s.string().describe("The task ID."),
4909
4901
  content: s.string().describe("The task content/title."),
4910
4902
  priority: s.string().describe("The task priority (1-4)."),
@@ -4912,7 +4904,7 @@ const ua = {
4912
4904
  deadline: s.string().optional().describe("The deadline date string, if set."),
4913
4905
  isCompleted: s.boolean().describe("Whether the task is completed."),
4914
4906
  labels: s.array(s.string()).describe("Labels applied to this task.")
4915
- }), ma = {
4907
+ }), ha = {
4916
4908
  projectId: s.string().describe("The project ID."),
4917
4909
  projectName: s.string().describe("The project name."),
4918
4910
  progress: s.object({
@@ -4921,7 +4913,7 @@ const ua = {
4921
4913
  progressPercent: s.number().describe("Completion percentage (0-100).")
4922
4914
  }).describe("Project completion progress."),
4923
4915
  health: s.object({
4924
- status: s.enum(Ge).describe("The overall health status of the project."),
4916
+ status: s.enum(Ve).describe("The overall health status of the project."),
4925
4917
  description: s.string().optional().describe("Detailed description of the health assessment."),
4926
4918
  descriptionSummary: s.string().optional().describe("Brief summary of the health assessment."),
4927
4919
  isStale: s.boolean().describe("Whether the health data is stale and may need refreshing."),
@@ -4938,12 +4930,12 @@ const ua = {
4938
4930
  tasksCompletedThisWeek: s.number().describe("Tasks completed in the current week."),
4939
4931
  averageCompletionTime: s.number().optional().describe("Average task completion time in days, if available.")
4940
4932
  }).describe("Aggregated project metrics."),
4941
- tasks: s.array(ha).describe("Tasks in the project.")
4933
+ tasks: s.array(pa).describe("Tasks in the project.")
4942
4934
  }).optional().describe(
4943
4935
  "Detailed project context with metrics and task data. Only included when includeContext is true."
4944
4936
  )
4945
4937
  };
4946
- async function fa(e, t, o) {
4938
+ async function ma(e, t, o) {
4947
4939
  if (o) {
4948
4940
  const [i, a, c] = await Promise.all([
4949
4941
  e.getProjectProgress(t),
@@ -4958,7 +4950,7 @@ async function fa(e, t, o) {
4958
4950
  ]);
4959
4951
  return { progress: r, health: n };
4960
4952
  }
4961
- function ba(e, { progress: t, health: o, context: r }) {
4953
+ function fa(e, { progress: t, health: o, context: r }) {
4962
4954
  const n = [`# Project Health: ${e}`, ""];
4963
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(
4964
4956
  `**Completed:** ${t.completedCount} | **Active:** ${t.activeCount} | **Progress:** ${t.progressPercent}%`
@@ -4976,18 +4968,18 @@ function ba(e, { progress: t, health: o, context: r }) {
4976
4968
  return n.join(`
4977
4969
  `);
4978
4970
  }
4979
- const ga = {
4980
- name: g.GET_PROJECT_HEALTH,
4971
+ const ba = {
4972
+ name: y.GET_PROJECT_HEALTH,
4981
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.",
4982
- parameters: pa,
4983
- outputSchema: ma,
4974
+ parameters: ua,
4975
+ outputSchema: ha,
4984
4976
  annotations: {
4985
4977
  readOnlyHint: !0,
4986
4978
  destructiveHint: !1,
4987
4979
  idempotentHint: !0
4988
4980
  },
4989
4981
  async execute(e, t) {
4990
- 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 ? {
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 ? {
4991
4983
  projectDescription: n.context.projectDescription ?? void 0,
4992
4984
  projectMetrics: {
4993
4985
  ...n.context.projectMetrics,
@@ -5025,15 +5017,15 @@ const ga = {
5025
5017
  }
5026
5018
  };
5027
5019
  }
5028
- }, ya = {
5020
+ }, ga = {
5029
5021
  workspaceIdOrName: s.string().min(1).describe(
5030
5022
  "The workspace ID or name. Supports exact ID, exact name match (case-insensitive), or unique partial name match."
5031
5023
  ),
5032
5024
  projectIds: s.array(s.string().min(1)).min(1).optional().describe("Optional list of project IDs to scope insights to specific projects.")
5033
- }, Ta = s.object({
5025
+ }, ya = s.object({
5034
5026
  projectId: s.string().describe("The project ID."),
5035
5027
  health: s.object({
5036
- status: s.enum(Ge).describe("The health status of the project."),
5028
+ status: s.enum(Ve).describe("The health status of the project."),
5037
5029
  isStale: s.boolean().describe("Whether the health data is stale."),
5038
5030
  updateInProgress: s.boolean().describe("Whether a health analysis update is in progress.")
5039
5031
  }).optional().describe("Health data for this project. Omitted when the project has none."),
@@ -5042,15 +5034,15 @@ const ga = {
5042
5034
  activeCount: s.number().describe("Number of active tasks."),
5043
5035
  progressPercent: s.number().describe("Completion percentage (0-100).")
5044
5036
  }).optional().describe("Progress data for this project. Omitted when the project has none.")
5045
- }), ka = {
5037
+ }), Ta = {
5046
5038
  workspaceId: s.string().describe("The resolved workspace ID."),
5047
5039
  workspaceName: s.string().describe("The resolved workspace name."),
5048
- projectInsights: s.array(Ta).describe("Health and progress insights for each project in the workspace.")
5049
- }, wa = {
5050
- name: g.GET_WORKSPACE_INSIGHTS,
5040
+ projectInsights: s.array(ya).describe("Health and progress insights for each project in the workspace.")
5041
+ }, ka = {
5042
+ name: y.GET_WORKSPACE_INSIGHTS,
5051
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.",
5052
- parameters: ya,
5053
- outputSchema: ka,
5044
+ parameters: ga,
5045
+ outputSchema: Ta,
5054
5046
  annotations: {
5055
5047
  readOnlyHint: !0,
5056
5048
  destructiveHint: !1,
@@ -5090,7 +5082,7 @@ const ga = {
5090
5082
  };
5091
5083
  }
5092
5084
  };
5093
- function va(e) {
5085
+ function wa(e) {
5094
5086
  const t = e.trim();
5095
5087
  if (!/^https?:\/\//i.test(t))
5096
5088
  return t;
@@ -5100,7 +5092,7 @@ function va(e) {
5100
5092
  } catch {
5101
5093
  throw new Error(`Could not read a template ID from "${t}".`);
5102
5094
  }
5103
- if (!Ia(o.hostname))
5095
+ if (!va(o.hostname))
5104
5096
  throw new Error(
5105
5097
  `"${o.hostname}" is not a Todoist domain. Pass a todoist.com template URL or the template ID itself.`
5106
5098
  );
@@ -5112,11 +5104,11 @@ function va(e) {
5112
5104
  throw new Error(`Could not read a template ID from "${t}".`);
5113
5105
  return i;
5114
5106
  }
5115
- function Ia(e) {
5107
+ function va(e) {
5116
5108
  const t = e.toLowerCase();
5117
5109
  return t === "todoist.com" || t.endsWith(".todoist.com");
5118
5110
  }
5119
- const Sa = {
5111
+ const Ia = {
5120
5112
  projectId: s.string().min(1).describe("The ID of the existing project to import the template into."),
5121
5113
  templateId: s.string().optional().describe(
5122
5114
  '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.'
@@ -5125,16 +5117,16 @@ const Sa = {
5125
5117
  "Raw CSV template content, as produced by export-project-template. Provide either this or `templateId`, not both."
5126
5118
  ),
5127
5119
  locale: s.string().optional().describe('Locale for the imported content when using `templateId`. Defaults to "en".')
5128
- }, ja = {
5120
+ }, Sa = {
5129
5121
  sections: s.array(X).describe("Sections created by the import."),
5130
5122
  tasks: s.array(H).describe("Tasks created by the import."),
5131
5123
  comments: s.array(ye).describe("Comments created by the import."),
5132
5124
  totalCount: s.number().describe("The total number of objects created by the import.")
5133
- }, Ca = {
5134
- name: g.IMPORT_PROJECT_TEMPLATE,
5125
+ }, ja = {
5126
+ name: y.IMPORT_PROJECT_TEMPLATE,
5135
5127
  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.",
5136
- parameters: Sa,
5137
- outputSchema: ja,
5128
+ parameters: Ia,
5129
+ outputSchema: Sa,
5138
5130
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
5139
5131
  async execute({ projectId: e, templateId: t, csvFileContent: o, locale: r }, n) {
5140
5132
  if (!!t == !!o)
@@ -5143,7 +5135,7 @@ const Sa = {
5143
5135
  );
5144
5136
  const i = t ? await n.importTemplateFromId({
5145
5137
  projectId: e,
5146
- templateId: va(t),
5138
+ templateId: wa(t),
5147
5139
  locale: r
5148
5140
  }) : await n.importTemplateIntoProject({
5149
5141
  projectId: e,
@@ -5151,7 +5143,7 @@ const Sa = {
5151
5143
  fileName: "template.csv"
5152
5144
  }), 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;
5153
5145
  return {
5154
- textContent: $a({
5146
+ textContent: Ca({
5155
5147
  projectId: e,
5156
5148
  counts: {
5157
5149
  projects: i.projects.length,
@@ -5165,7 +5157,7 @@ const Sa = {
5165
5157
  };
5166
5158
  }
5167
5159
  };
5168
- function $a({
5160
+ function Ca({
5169
5161
  projectId: e,
5170
5162
  counts: t,
5171
5163
  totalCount: o
@@ -5175,21 +5167,21 @@ function $a({
5175
5167
  const r = Object.entries(t).filter(([, n]) => n > 0).map(([n, i]) => `${i} ${i === 1 ? n.replace(/s$/, "") : n}`);
5176
5168
  return `Imported template into project (id=${e}): ${r.join(", ")}.`;
5177
5169
  }
5178
- const Da = {}, xa = {
5170
+ const $a = {}, Da = {
5179
5171
  id: s.string().describe("The unique identifier for the workspace."),
5180
5172
  name: s.string().describe("The name of the workspace."),
5181
- plan: s.enum(Bs).describe("The workspace plan type."),
5182
- role: s.enum(Ws).optional().describe("The user's role in the workspace, if available."),
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."),
5183
5175
  isLinkSharingEnabled: s.boolean().describe("Whether link sharing is enabled for the workspace."),
5184
5176
  isGuestAllowed: s.boolean().describe("Whether guests are allowed in the workspace."),
5185
5177
  createdAt: s.string().optional().describe("The ISO 8601 timestamp when the workspace was created."),
5186
5178
  creatorId: s.string().describe("The ID of the user who created the workspace.")
5187
- }, Aa = {
5179
+ }, xa = {
5188
5180
  type: s.literal("workspaces").describe("The type of the response."),
5189
- workspaces: s.array(s.object(xa)).describe("List of workspaces."),
5181
+ workspaces: s.array(s.object(Da)).describe("List of workspaces."),
5190
5182
  count: s.number().describe("The total number of workspaces.")
5191
5183
  };
5192
- async function Ea(e) {
5184
+ async function Aa(e) {
5193
5185
  const o = (await e.getWorkspaces()).map((a) => ({
5194
5186
  id: a.id,
5195
5187
  name: a.name,
@@ -5220,22 +5212,22 @@ async function Ea(e) {
5220
5212
  };
5221
5213
  return { textContent: n, structuredContent: i };
5222
5214
  }
5223
- const Oa = {
5224
- name: g.LIST_WORKSPACES,
5215
+ const Ea = {
5216
+ name: y.LIST_WORKSPACES,
5225
5217
  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.",
5226
- parameters: Da,
5227
- outputSchema: Aa,
5218
+ parameters: $a,
5219
+ outputSchema: xa,
5228
5220
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
5229
5221
  async execute(e, t) {
5230
- const o = await Ea(t);
5222
+ const o = await Aa(t);
5231
5223
  return {
5232
5224
  textContent: o.textContent,
5233
5225
  structuredContent: o.structuredContent
5234
5226
  };
5235
5227
  }
5236
- }, { FIND_TASKS: Pa, FIND_PROJECT_COLLABORATORS: Ot, UPDATE_TASKS: _a } = g, Ra = 50, Ua = {
5228
+ }, { FIND_TASKS: Oa, FIND_PROJECT_COLLABORATORS: Pt, UPDATE_TASKS: Pa } = y, _a = 50, Ra = {
5237
5229
  operation: s.enum(["assign", "unassign", "reassign"]).describe("The assignment operation to perform."),
5238
- taskIds: s.array(s.string()).min(1).max(Ra).describe("The IDs of the tasks to operate on (max 50)."),
5230
+ taskIds: s.array(s.string()).min(1).max(_a).describe("The IDs of the tasks to operate on (max 50)."),
5239
5231
  responsibleUser: s.string().optional().describe(
5240
5232
  '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.'
5241
5233
  ),
@@ -5243,7 +5235,7 @@ const Oa = {
5243
5235
  "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."
5244
5236
  ),
5245
5237
  dryRun: s.boolean().optional().default(!1).describe("If true, validates operations without executing them.")
5246
- }, La = {
5238
+ }, Ua = {
5247
5239
  results: s.array(
5248
5240
  s.object({
5249
5241
  taskId: s.string().describe("The ID of the task."),
@@ -5259,11 +5251,11 @@ const Oa = {
5259
5251
  failed: s.number().describe("Number of failed operations."),
5260
5252
  dryRun: s.boolean().describe("Whether this was a dry run.")
5261
5253
  }).optional().describe("Summary of the operation.")
5262
- }, Na = {
5263
- name: g.MANAGE_ASSIGNMENTS,
5254
+ }, La = {
5255
+ name: y.MANAGE_ASSIGNMENTS,
5264
5256
  description: "Bulk assignment operations for multiple tasks. Supports assign, unassign, and reassign operations with atomic rollback on failures.",
5265
- parameters: Ua,
5266
- outputSchema: La,
5257
+ parameters: Ra,
5258
+ outputSchema: Ua,
5267
5259
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
5268
5260
  async execute(e, t) {
5269
5261
  const { operation: o, taskIds: r, responsibleUser: n, fromAssigneeUser: i, dryRun: a } = e;
@@ -5365,13 +5357,13 @@ const Oa = {
5365
5357
  }
5366
5358
  };
5367
5359
  }
5368
- const h = await at.validateBulkAssignment(
5360
+ const h = await ct.validateBulkAssignment(
5369
5361
  t,
5370
5362
  u
5371
- ), m = [], y = [];
5363
+ ), m = [], g = [];
5372
5364
  for (let k = 0; k < u.length; k++) {
5373
5365
  const I = u[k], x = h[k];
5374
- I && x?.isValid ? m.push({ assignment: I, validation: x }) : I?.taskId && y.push({
5366
+ I && x?.isValid ? m.push({ assignment: I, validation: x }) : I?.taskId && g.push({
5375
5367
  taskId: I.taskId,
5376
5368
  success: !1,
5377
5369
  error: x?.error?.message || "Validation failed"
@@ -5426,7 +5418,7 @@ const Oa = {
5426
5418
  );
5427
5419
  return Promise.all(T);
5428
5420
  }
5429
- const v = await f(m, !a), j = [...v, ...y, ...l];
5421
+ const v = await f(m, !a), j = [...v, ...g, ...l];
5430
5422
  if (j.length > 0 && j.every((k) => !k.success)) {
5431
5423
  const k = j.map((I) => `"${I.taskId}": ${I.error}`).join("; ");
5432
5424
  throw new Error(`All ${j.length} ${o} operation(s) failed: ${k}`);
@@ -5486,30 +5478,30 @@ function Oe({
5486
5478
  `;
5487
5479
  }
5488
5480
  return !o && r.length > 0 ? (c += `**Next steps:**
5489
- `, c += `• Use ${Pa} with responsibleUser to see ${e === "unassign" ? "unassigned" : "newly assigned"} tasks
5490
- `, c += `• Use ${_a} for individual assignment changes
5491
- `, n.length > 0 && (c += `• Check failed tasks and use ${Ot} to verify collaborator access
5481
+ `, c += `• Use ${Oa} with responsibleUser to see ${e === "unassign" ? "unassigned" : "newly assigned"} tasks
5482
+ `, c += `• Use ${Pa} for individual assignment changes
5483
+ `, n.length > 0 && (c += `• Check failed tasks and use ${Pt} to verify collaborator access
5492
5484
  `)) : o ? (c += `**To execute:**
5493
5485
  `, c += `• Remove dryRun parameter and run again to execute changes
5494
5486
  `, r.length > 0 && (c += `• ${r.length} task${r.length === 1 ? "" : "s"} ready for ${e} operation
5495
5487
  `), n.length > 0 && (c += `• Fix ${n.length} validation error${n.length === 1 ? "" : "s"} before executing
5496
5488
  `)) : r.length === 0 && (c += `**Suggestions:**
5497
- `, c += `• Use ${Ot} to find valid assignees
5489
+ `, c += `• Use ${Pt} to find valid assignees
5498
5490
  `, c += `• Check task IDs and assignee permissions
5499
5491
  `, c += `• Use dryRun=true to validate before executing
5500
5492
  `), c;
5501
5493
  }
5502
- const Ma = {
5494
+ const Na = {
5503
5495
  action: s.enum(["archive", "unarchive"]).describe("The action to perform on the project."),
5504
5496
  projectId: s.string().min(1).describe("The ID of the project.")
5505
- }, Fa = {
5497
+ }, Ma = {
5506
5498
  project: Q.describe("The updated project."),
5507
5499
  success: s.boolean().describe("Whether the action was successful.")
5508
- }, Ha = {
5509
- name: g.PROJECT_MANAGEMENT,
5500
+ }, Fa = {
5501
+ name: y.PROJECT_MANAGEMENT,
5510
5502
  description: "Archive or unarchive a project by its ID.",
5511
- parameters: Ma,
5512
- outputSchema: Fa,
5503
+ parameters: Na,
5504
+ outputSchema: Ma,
5513
5505
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
5514
5506
  async execute(e, t) {
5515
5507
  const o = e.action === "archive" ? await t.archiveProject(e.projectId) : await t.unarchiveProject(e.projectId), r = Z(o);
@@ -5521,7 +5513,7 @@ const Ma = {
5521
5513
  }
5522
5514
  };
5523
5515
  }
5524
- }, Wa = {
5516
+ }, Ha = {
5525
5517
  action: s.enum(["move-to-workspace", "move-to-personal"]).describe("The action to perform on the project."),
5526
5518
  projectId: s.string().min(1).describe("The ID of the project to move."),
5527
5519
  workspaceId: s.string().min(1).optional().describe("The target workspace ID. Required when action is move-to-workspace."),
@@ -5529,14 +5521,14 @@ const Ma = {
5529
5521
  visibility: s.enum(["restricted", "team", "public"]).optional().describe(
5530
5522
  "Optional access visibility for the project in the workspace (restricted, team, or public)."
5531
5523
  )
5532
- }, Ba = {
5524
+ }, Wa = {
5533
5525
  project: Q.describe("The moved project."),
5534
5526
  success: s.boolean().describe("Whether the move was successful.")
5535
- }, za = {
5536
- name: g.PROJECT_MOVE,
5527
+ }, Ba = {
5528
+ name: y.PROJECT_MOVE,
5537
5529
  description: "Move a project between personal and workspace contexts.",
5538
- parameters: Wa,
5539
- outputSchema: Ba,
5530
+ parameters: Ha,
5531
+ outputSchema: Wa,
5540
5532
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
5541
5533
  async execute(e, t) {
5542
5534
  let o;
@@ -5559,7 +5551,7 @@ const Ma = {
5559
5551
  }
5560
5552
  };
5561
5553
  }
5562
- }, js = ["project", "section"], Ka = {
5554
+ }, js = ["project", "section"], za = {
5563
5555
  type: s.enum(js).describe(
5564
5556
  '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.'
5565
5557
  ),
@@ -5576,17 +5568,17 @@ const Ma = {
5576
5568
  ).min(1).describe(
5577
5569
  "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."
5578
5570
  )
5579
- }, Ya = {
5571
+ }, Ka = {
5580
5572
  type: s.enum(js).describe("The type of entity that was reordered/moved."),
5581
5573
  movedCount: s.number().describe("The number of entities moved to a new parent."),
5582
5574
  reorderedCount: s.number().describe("The number of entities reordered."),
5583
5575
  affectedIds: s.array(s.string()).describe("The IDs of all affected entities."),
5584
5576
  success: s.boolean().describe("Whether the operation was successful.")
5585
- }, qa = {
5586
- name: g.REORDER_OBJECTS,
5577
+ }, Ya = {
5578
+ name: y.REORDER_OBJECTS,
5587
5579
  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.',
5588
- parameters: Ka,
5589
- outputSchema: Ya,
5580
+ parameters: za,
5581
+ outputSchema: Ka,
5590
5582
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
5591
5583
  async execute(e, t) {
5592
5584
  const { type: o, items: r } = e, n = /* @__PURE__ */ new Set();
@@ -5648,22 +5640,22 @@ const Ma = {
5648
5640
  }
5649
5641
  };
5650
5642
  }
5651
- }, Ga = s.object({
5643
+ }, qa = s.object({
5652
5644
  id: s.string().min(1).describe("The ID of the task to reschedule."),
5653
5645
  date: s.string().min(1).describe(
5654
5646
  "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."
5655
5647
  )
5656
- }), Va = {
5657
- tasks: s.array(Ga).min(1).describe("The tasks to reschedule with their new dates.")
5658
- }, Ja = {
5648
+ }), Ga = {
5649
+ tasks: s.array(qa).min(1).describe("The tasks to reschedule with their new dates.")
5650
+ }, Va = {
5659
5651
  tasks: s.array(H).describe("The rescheduled tasks."),
5660
5652
  totalCount: s.number().describe("The total number of tasks rescheduled."),
5661
5653
  rescheduledTaskIds: s.array(s.string()).describe("The IDs of the rescheduled tasks.")
5662
- }, Xa = {
5663
- name: g.RESCHEDULE_TASKS,
5654
+ }, Ja = {
5655
+ name: y.RESCHEDULE_TASKS,
5664
5656
  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.",
5665
- parameters: Va,
5666
- outputSchema: Ja,
5657
+ parameters: Ga,
5658
+ outputSchema: Va,
5667
5659
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
5668
5660
  async execute(e, t) {
5669
5661
  const { tasks: o } = e, n = (await Promise.all(
@@ -5676,7 +5668,7 @@ const Ma = {
5676
5668
  throw new Error(
5677
5669
  `Task "${l.content}" (${l.id}) has no due date. Rescheduling requires an existing due date.`
5678
5670
  );
5679
- const p = Za(d.date, l.due);
5671
+ const p = Xa(d.date, l.due);
5680
5672
  return V("item_update", {
5681
5673
  id: d.id,
5682
5674
  due: {
@@ -5696,7 +5688,7 @@ const Ma = {
5696
5688
  }
5697
5689
  const i = await Promise.all(o.map((d) => t.getTask(d.id))), a = i.map(P);
5698
5690
  return {
5699
- textContent: rt("Rescheduled", a, {
5691
+ textContent: nt("Rescheduled", a, {
5700
5692
  showDetails: a.length <= 5
5701
5693
  }),
5702
5694
  structuredContent: {
@@ -5707,16 +5699,16 @@ const Ma = {
5707
5699
  };
5708
5700
  }
5709
5701
  };
5710
- function Za(e, t) {
5702
+ function Xa(e, t) {
5711
5703
  if (/^\d{4}-\d{2}-\d{2}$/.test(e) && t.datetime) {
5712
5704
  const r = t.datetime.substring(10);
5713
5705
  return e + r;
5714
5706
  }
5715
5707
  return e;
5716
5708
  }
5717
- const Qa = {
5709
+ const Za = {
5718
5710
  query: s.string().min(1).describe("The search query string to find tasks and projects.")
5719
- }, ec = {
5711
+ }, Qa = {
5720
5712
  results: s.array(
5721
5713
  s.object({
5722
5714
  id: s.string().describe("The ID of the result."),
@@ -5725,15 +5717,15 @@ const Qa = {
5725
5717
  })
5726
5718
  ).describe("The search results."),
5727
5719
  totalCount: s.number().describe("Total number of results found.")
5728
- }, tc = {
5729
- name: g.SEARCH,
5720
+ }, ec = {
5721
+ name: y.SEARCH,
5730
5722
  description: "Search across tasks and projects in Todoist. Returns a list of relevant results with IDs, titles, and URLs.",
5731
- parameters: Qa,
5732
- outputSchema: ec,
5723
+ parameters: Za,
5724
+ outputSchema: Qa,
5733
5725
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
5734
5726
  async execute(e, t) {
5735
5727
  const { query: o } = e, [r, n] = await Promise.all([
5736
- tt({
5728
+ st({
5737
5729
  client: t,
5738
5730
  query: `search: ${o}`,
5739
5731
  limit: C.TASKS_MAX,
@@ -5758,19 +5750,19 @@ const Qa = {
5758
5750
  structuredContent: { results: i, totalCount: i.length }
5759
5751
  };
5760
5752
  }
5761
- }, sc = {
5753
+ }, tc = {
5762
5754
  ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to uncomplete.")
5763
- }, oc = {
5755
+ }, sc = {
5764
5756
  uncompleted: s.array(s.string()).describe("The IDs of successfully uncompleted tasks."),
5765
5757
  failures: s.array(ee).describe("Failed task uncompletion with error details."),
5766
5758
  totalRequested: s.number().describe("The total number of tasks requested to uncomplete."),
5767
5759
  successCount: s.number().describe("The number of successfully uncompleted tasks."),
5768
5760
  failureCount: s.number().describe("The number of failed task uncompletions.")
5769
- }, rc = {
5770
- name: g.UNCOMPLETE_TASKS,
5761
+ }, oc = {
5762
+ name: y.UNCOMPLETE_TASKS,
5771
5763
  description: "Uncomplete (reopen) one or more completed tasks by their IDs.",
5772
- parameters: sc,
5773
- outputSchema: oc,
5764
+ parameters: tc,
5765
+ outputSchema: sc,
5774
5766
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
5775
5767
  async execute(e, t) {
5776
5768
  const o = [], r = [];
@@ -5785,7 +5777,7 @@ const Qa = {
5785
5777
  });
5786
5778
  }
5787
5779
  return {
5788
- textContent: nc({
5780
+ textContent: rc({
5789
5781
  uncompleted: o,
5790
5782
  failures: r,
5791
5783
  args: e
@@ -5800,12 +5792,12 @@ const Qa = {
5800
5792
  };
5801
5793
  }
5802
5794
  };
5803
- function nc({
5795
+ function rc({
5804
5796
  uncompleted: e,
5805
5797
  failures: t,
5806
5798
  args: o
5807
5799
  }) {
5808
- return nt({
5800
+ return it({
5809
5801
  action: "Uncompleted tasks",
5810
5802
  success: e.length,
5811
5803
  total: o.ids.length,
@@ -5814,28 +5806,28 @@ function nc({
5814
5806
  failures: t
5815
5807
  });
5816
5808
  }
5817
- const ic = s.object({
5809
+ const nc = s.object({
5818
5810
  id: s.string().min(1).describe("The ID of the comment to update."),
5819
5811
  content: s.string().min(1).describe("The new content for the comment.")
5820
- }), ac = {
5821
- comments: s.array(ic).min(1).describe("The comments to update.")
5822
- }, cc = {
5812
+ }), ic = {
5813
+ comments: s.array(nc).min(1).describe("The comments to update.")
5814
+ }, ac = {
5823
5815
  comments: s.array(ye).describe("The updated comments."),
5824
5816
  totalCount: s.number().describe("The total number of comments updated."),
5825
5817
  updatedCommentIds: s.array(s.string()).describe("The IDs of the updated comments."),
5826
5818
  appliedOperations: s.object({
5827
5819
  updateCount: s.number().describe("The number of comments updated.")
5828
5820
  }).describe("Summary of operations performed.")
5829
- }, dc = {
5830
- name: g.UPDATE_COMMENTS,
5821
+ }, cc = {
5822
+ name: y.UPDATE_COMMENTS,
5831
5823
  description: "Update multiple existing comments with new content.",
5832
- parameters: ac,
5833
- outputSchema: cc,
5824
+ parameters: ic,
5825
+ outputSchema: ac,
5834
5826
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
5835
5827
  async execute(e, t) {
5836
5828
  const { comments: o } = e, r = o.map(async (c) => await t.updateComment(c.id, { content: c.content })), i = (await Promise.all(r)).map(ge);
5837
5829
  return {
5838
- textContent: lc({
5830
+ textContent: dc({
5839
5831
  comments: i
5840
5832
  }),
5841
5833
  structuredContent: {
@@ -5849,7 +5841,7 @@ const ic = s.object({
5849
5841
  };
5850
5842
  }
5851
5843
  };
5852
- function lc({ comments: e }) {
5844
+ function dc({ comments: e }) {
5853
5845
  const t = e.filter((i) => i.taskId).length, o = e.filter((i) => i.projectId).length, r = [];
5854
5846
  if (t > 0) {
5855
5847
  const i = t > 1 ? "comments" : "comment";
@@ -5861,7 +5853,7 @@ function lc({ comments: e }) {
5861
5853
  }
5862
5854
  return r.length > 0 ? `Updated ${r.join(" and ")}` : "No comments updated";
5863
5855
  }
5864
- const uc = s.object({
5856
+ const lc = s.object({
5865
5857
  id: s.string().min(1).describe("The ID of the filter to update."),
5866
5858
  name: s.string().min(1).optional().describe("The new name of the filter."),
5867
5859
  query: s.string().min(1).optional().describe(
@@ -5869,25 +5861,25 @@ const uc = s.object({
5869
5861
  ),
5870
5862
  color: le,
5871
5863
  isFavorite: s.boolean().optional().describe("Whether to mark the filter as a favorite.")
5872
- }), pc = {
5873
- filters: s.array(uc).min(1).describe("The filters to update.")
5874
- }, hc = {
5875
- filters: s.array(ot).describe("The updated filters."),
5864
+ }), uc = {
5865
+ filters: s.array(lc).min(1).describe("The filters to update.")
5866
+ }, pc = {
5867
+ filters: s.array(rt).describe("The updated filters."),
5876
5868
  totalCount: s.number().describe("The total number of filters updated."),
5877
5869
  updatedFilterIds: s.array(s.string()).describe("The IDs of the updated filters."),
5878
5870
  appliedOperations: s.object({
5879
5871
  updateCount: s.number().describe("The number of filters actually updated."),
5880
5872
  skippedCount: s.number().describe("The number of filters skipped (no changes).")
5881
5873
  }).describe("Summary of operations performed.")
5882
- }, mc = {
5883
- name: g.UPDATE_FILTERS,
5874
+ }, hc = {
5875
+ name: y.UPDATE_FILTERS,
5884
5876
  description: "Update one or more existing personal filters with new values.",
5885
- parameters: pc,
5886
- outputSchema: hc,
5877
+ parameters: uc,
5878
+ outputSchema: pc,
5887
5879
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
5888
5880
  async execute(e, t) {
5889
5881
  const { filters: o } = e, r = [], i = o.map((h) => {
5890
- const m = bc(h);
5882
+ const m = fc(h);
5891
5883
  return m !== null ? { kind: "skipped", reason: m } : (r.push(h), { kind: "updated", filter: h });
5892
5884
  }).filter((h) => h.kind === "skipped").length;
5893
5885
  if (r.length === 0)
@@ -5901,11 +5893,11 @@ const uc = s.object({
5901
5893
  }
5902
5894
  };
5903
5895
  const a = r.map((h) => {
5904
- const { id: m, color: y, ...f } = h;
5896
+ const { id: m, color: g, ...f } = h;
5905
5897
  return V("filter_update", {
5906
5898
  id: m,
5907
5899
  ...f,
5908
- ...y !== void 0 ? { color: y } : {}
5900
+ ...g !== void 0 ? { color: g } : {}
5909
5901
  });
5910
5902
  });
5911
5903
  await t.sync({ commands: a });
@@ -5918,7 +5910,7 @@ const uc = s.object({
5918
5910
  itemOrder: h.itemOrder
5919
5911
  }));
5920
5912
  return {
5921
- textContent: fc({ filters: p, skippedCount: i }),
5913
+ textContent: mc({ filters: p, skippedCount: i }),
5922
5914
  structuredContent: {
5923
5915
  filters: p,
5924
5916
  totalCount: p.length,
@@ -5931,7 +5923,7 @@ const uc = s.object({
5931
5923
  };
5932
5924
  }
5933
5925
  };
5934
- function fc({
5926
+ function mc({
5935
5927
  filters: e,
5936
5928
  skippedCount: t
5937
5929
  }) {
@@ -5945,54 +5937,54 @@ ${n}`;
5945
5937
  }
5946
5938
  return r;
5947
5939
  }
5948
- function bc({ id: e, ...t }) {
5940
+ function fc({ id: e, ...t }) {
5949
5941
  return Object.values(t).every((r) => r === void 0) ? "no-fields" : null;
5950
5942
  }
5951
- const gc = s.object({
5943
+ const bc = s.object({
5952
5944
  labelType: s.literal("personal").describe("Update a personal label, identified by its ID."),
5953
5945
  id: s.string().min(1).describe("The ID of the personal label to update."),
5954
5946
  name: s.string().min(1).max(128).optional().describe("The new name of the label."),
5955
5947
  color: le,
5956
5948
  order: s.number().int().optional().describe("The new position of the label in the label list."),
5957
5949
  isFavorite: s.boolean().optional().describe("Whether to mark the label as a favorite.")
5958
- }), yc = s.object({
5950
+ }), gc = s.object({
5959
5951
  labelType: s.literal("shared").describe(
5960
5952
  "Rename a shared label across all tasks. Shared labels are identified by name; only renaming is supported (no color, order, or favorite)."
5961
5953
  ),
5962
5954
  name: s.string().min(1).describe("The current name of the shared label."),
5963
5955
  newName: s.string().min(1).describe("The new name for the shared label.")
5964
- }), Tc = s.discriminatedUnion("labelType", [
5965
- gc,
5966
- yc
5967
- ]), kc = {
5968
- labels: s.array(Tc).min(1).describe(
5956
+ }), yc = s.discriminatedUnion("labelType", [
5957
+ bc,
5958
+ gc
5959
+ ]), Tc = {
5960
+ labels: s.array(yc).min(1).describe(
5969
5961
  '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.'
5970
5962
  )
5971
- }, wc = s.object({
5963
+ }, kc = s.object({
5972
5964
  name: s.string().describe("The previous name of the shared label."),
5973
5965
  newName: s.string().describe("The new name of the shared label.")
5974
- }), vc = {
5966
+ }), wc = {
5975
5967
  updatedLabels: s.array(pe).describe("The updated personal labels."),
5976
- renamedSharedLabels: s.array(wc).describe("The shared labels that were renamed."),
5968
+ renamedSharedLabels: s.array(kc).describe("The shared labels that were renamed."),
5977
5969
  totalCount: s.number().describe("The total number of successful operations (personal + shared)."),
5978
5970
  appliedOperations: s.object({
5979
5971
  updateCount: s.number().describe("Number of personal labels updated."),
5980
5972
  renameCount: s.number().describe("Number of shared labels renamed."),
5981
5973
  skippedCount: s.number().describe("Number of operations skipped (no changes or shared label not found).")
5982
5974
  }).describe("Summary of operations performed.")
5983
- }, Ic = {
5984
- name: g.UPDATE_LABELS,
5975
+ }, vc = {
5976
+ name: y.UPDATE_LABELS,
5985
5977
  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.",
5986
- parameters: kc,
5987
- outputSchema: vc,
5978
+ parameters: Tc,
5979
+ outputSchema: wc,
5988
5980
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
5989
5981
  async execute(e, t) {
5990
5982
  const { labels: o } = e, r = await Promise.all(
5991
5983
  o.map(async (p) => {
5992
5984
  if (p.labelType === "personal") {
5993
- const h = jc(p);
5985
+ const h = Sc(p);
5994
5986
  if (h !== null) return { kind: "skipped", reason: h };
5995
- const { id: m, labelType: y, ...f } = p;
5987
+ const { id: m, labelType: g, ...f } = p;
5996
5988
  return { kind: "updated", label: await t.updateLabel(m, f) };
5997
5989
  }
5998
5990
  return await t.renameSharedLabel({
@@ -6008,7 +6000,7 @@ const gc = s.object({
6008
6000
  (p) => p.kind === "skipped" && p.reason === "not-found"
6009
6001
  ).length;
6010
6002
  return {
6011
- textContent: Sc({
6003
+ textContent: Ic({
6012
6004
  updatedLabels: n,
6013
6005
  renamedSharedLabels: i,
6014
6006
  skippedNoFields: c,
@@ -6027,7 +6019,7 @@ const gc = s.object({
6027
6019
  };
6028
6020
  }
6029
6021
  };
6030
- function Sc({
6022
+ function Ic({
6031
6023
  updatedLabels: e,
6032
6024
  renamedSharedLabels: t,
6033
6025
  skippedNoFields: o,
@@ -6049,14 +6041,14 @@ function Sc({
6049
6041
  return c.join(`
6050
6042
  `);
6051
6043
  }
6052
- function jc({
6044
+ function Sc({
6053
6045
  id: e,
6054
6046
  labelType: t,
6055
6047
  ...o
6056
6048
  }) {
6057
6049
  return Object.values(o).every((n) => n === void 0) ? "no-fields" : null;
6058
6050
  }
6059
- const Cc = s.object({
6051
+ const jc = s.object({
6060
6052
  id: s.string().min(1).describe("The ID of the project to update."),
6061
6053
  name: s.string().min(1).optional().describe("The new name of the project."),
6062
6054
  isFavorite: s.boolean().optional().describe("Whether the project is a favorite."),
@@ -6071,9 +6063,9 @@ const Cc = s.object({
6071
6063
  )
6072
6064
  ).optional(),
6073
6065
  color: le
6074
- }), $c = {
6075
- projects: s.array(Cc).min(1).describe("The projects to update.")
6076
- }, Dc = {
6066
+ }), Cc = {
6067
+ projects: s.array(jc).min(1).describe("The projects to update.")
6068
+ }, $c = {
6077
6069
  projects: s.array(Q).describe("The updated projects."),
6078
6070
  totalCount: s.number().describe("The total number of projects updated."),
6079
6071
  updatedProjectIds: s.array(s.string()).describe("The IDs of the updated projects."),
@@ -6085,16 +6077,16 @@ const Cc = s.object({
6085
6077
  skippedCount: s.number().describe("The number of projects skipped (no changes)."),
6086
6078
  failureCount: s.number().describe("The number of projects that failed to update.")
6087
6079
  }).describe("Summary of operations performed.")
6088
- }, xc = {
6089
- name: g.UPDATE_PROJECTS,
6080
+ }, Dc = {
6081
+ name: y.UPDATE_PROJECTS,
6090
6082
  description: "Update multiple existing projects with new values.",
6091
- parameters: $c,
6092
- outputSchema: Dc,
6083
+ parameters: Cc,
6084
+ outputSchema: $c,
6093
6085
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
6094
6086
  async execute(e, t) {
6095
6087
  const { projects: o } = e, r = await Promise.allSettled(
6096
6088
  o.map(async (l) => {
6097
- const p = Ec(l);
6089
+ const p = Ac(l);
6098
6090
  if (p !== null) return { kind: "skipped", reason: p };
6099
6091
  const { id: u, ...h } = l;
6100
6092
  return { kind: "updated", project: await O(() => t.updateProject(u, h)) };
@@ -6112,7 +6104,7 @@ const Cc = s.object({
6112
6104
  p.value.kind === "updated" ? n.push(Z(p.value.project)) : p.value.reason === "no-fields" ? a++ : c++;
6113
6105
  }
6114
6106
  return {
6115
- textContent: Ac({
6107
+ textContent: xc({
6116
6108
  projects: n,
6117
6109
  skippedNoFields: a,
6118
6110
  skippedNoValidValues: c,
@@ -6132,7 +6124,7 @@ const Cc = s.object({
6132
6124
  };
6133
6125
  }
6134
6126
  };
6135
- function Ac({
6127
+ function xc({
6136
6128
  projects: e,
6137
6129
  skippedNoFields: t,
6138
6130
  skippedNoValidValues: o,
@@ -6143,25 +6135,25 @@ function Ac({
6143
6135
  let a = `Updated ${n} project${n === 1 ? "" : "s"}`;
6144
6136
  const c = [];
6145
6137
  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 += `:
6146
- ${i}`), it(a, r);
6138
+ ${i}`), at(a, r);
6147
6139
  }
6148
- function Ec({ id: e, ...t }) {
6140
+ function Ac({ id: e, ...t }) {
6149
6141
  const o = Object.values(t);
6150
6142
  return o.length === 0 ? "no-fields" : o.every((r) => r === void 0) ? "no-valid-values" : null;
6151
6143
  }
6152
- const Oc = s.object({
6144
+ const Ec = s.object({
6153
6145
  type: s.literal("relative"),
6154
6146
  id: s.string().min(1).describe("The ID of the relative reminder to update."),
6155
6147
  minuteOffset: s.number().int().min(0).optional().describe("New minute offset before task due time."),
6156
6148
  service: je.optional().describe('New delivery method: "email" or "push".'),
6157
6149
  isUrgent: Ce
6158
- }), Pc = s.object({
6150
+ }), Oc = s.object({
6159
6151
  type: s.literal("absolute"),
6160
6152
  id: s.string().min(1).describe("The ID of the absolute reminder to update."),
6161
6153
  due: ls.optional().describe("New due date/time for the reminder."),
6162
6154
  service: je.optional().describe('New delivery method: "email" or "push".'),
6163
6155
  isUrgent: Ce
6164
- }), _c = s.object({
6156
+ }), Pc = s.object({
6165
6157
  type: s.literal("location"),
6166
6158
  id: s.string().min(1).describe("The ID of the location reminder to update."),
6167
6159
  name: s.string().optional().describe("New location name."),
@@ -6171,23 +6163,23 @@ const Oc = s.object({
6171
6163
  'New trigger condition: "on_enter" or "on_leave".'
6172
6164
  ),
6173
6165
  radius: s.number().int().optional().describe("New radius in meters.")
6174
- }), Rc = s.discriminatedUnion("type", [
6166
+ }), _c = s.discriminatedUnion("type", [
6167
+ Ec,
6175
6168
  Oc,
6176
- Pc,
6177
- _c
6178
- ]), Uc = {
6179
- reminders: s.array(Rc).min(1).max(we).describe(
6169
+ Pc
6170
+ ]), Rc = {
6171
+ reminders: s.array(_c).min(1).max(we).describe(
6180
6172
  `Array of reminders to update (max ${we}). Each must include the reminder type and ID. Only include fields that need to change.`
6181
6173
  )
6182
- }, Lc = {
6183
- reminders: s.array(st).describe("The updated reminders."),
6174
+ }, Uc = {
6175
+ reminders: s.array(ot).describe("The updated reminders."),
6184
6176
  totalCount: s.number().describe("Total reminders updated."),
6185
6177
  updatedReminderIds: s.array(s.string()).describe("IDs of updated reminders.")
6186
- }, Nc = {
6187
- name: g.UPDATE_REMINDERS,
6178
+ }, Lc = {
6179
+ name: y.UPDATE_REMINDERS,
6188
6180
  description: 'Update existing reminders. Each reminder must specify its type ("relative", "absolute", or "location") and ID. Only include fields that need to change.',
6189
- parameters: Uc,
6190
- outputSchema: Lc,
6181
+ parameters: Rc,
6182
+ outputSchema: Uc,
6191
6183
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !0 },
6192
6184
  async execute(e, t) {
6193
6185
  const { reminders: o } = e, r = o.map(async (d) => {
@@ -6221,7 +6213,7 @@ const Oc = s.object({
6221
6213
  }
6222
6214
  };
6223
6215
  }
6224
- }, Mc = s.object({
6216
+ }, Nc = s.object({
6225
6217
  id: s.string().min(1).describe("The ID of the section to update."),
6226
6218
  name: s.string().min(1).optional().describe("The new name of the section."),
6227
6219
  description: s.preprocess(
@@ -6236,17 +6228,17 @@ const Oc = s.object({
6236
6228
  ).optional()
6237
6229
  }).refine((e) => e.name !== void 0 || e.description !== void 0, {
6238
6230
  message: 'Provide at least one of "name" or "description" to update.'
6239
- }), Fc = {
6240
- sections: s.array(Mc).min(1).describe("The sections to update.")
6241
- }, Hc = {
6231
+ }), Mc = {
6232
+ sections: s.array(Nc).min(1).describe("The sections to update.")
6233
+ }, Fc = {
6242
6234
  sections: s.array(X).describe("The updated sections."),
6243
6235
  totalCount: s.number().describe("The total number of sections updated."),
6244
6236
  updatedSectionIds: s.array(s.string()).describe("The IDs of the updated sections.")
6245
- }, Wc = {
6246
- name: g.UPDATE_SECTIONS,
6237
+ }, Hc = {
6238
+ name: y.UPDATE_SECTIONS,
6247
6239
  description: "Update multiple existing sections with new values.",
6248
- parameters: Fc,
6249
- outputSchema: Hc,
6240
+ parameters: Mc,
6241
+ outputSchema: Fc,
6250
6242
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
6251
6243
  async execute({ sections: e }, t) {
6252
6244
  const o = await Promise.all(
@@ -6259,7 +6251,7 @@ const Oc = s.object({
6259
6251
  })
6260
6252
  );
6261
6253
  return {
6262
- textContent: Bc({
6254
+ textContent: Wc({
6263
6255
  sections: o
6264
6256
  }),
6265
6257
  structuredContent: {
@@ -6270,7 +6262,7 @@ const Oc = s.object({
6270
6262
  };
6271
6263
  }
6272
6264
  };
6273
- function Bc({ sections: e }) {
6265
+ function Wc({ sections: e }) {
6274
6266
  const t = e.length, o = e.map((n) => `• ${n.name} (id=${n.id}, projectId=${n.projectId})`).join(`
6275
6267
  `);
6276
6268
  return `Updated ${t} section${t === 1 ? "" : "s"}:
@@ -6279,27 +6271,27 @@ ${o}`;
6279
6271
  function Cs(e, t) {
6280
6272
  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;
6281
6273
  }
6282
- function zc(e, t) {
6274
+ function Bc(e, t) {
6283
6275
  return t.projectId !== void 0 ? e.projectId === t.projectId : t.sectionId !== void 0 ? e.sectionId === t.sectionId : e.parentId === t.parentId;
6284
6276
  }
6285
- function Kc(e) {
6277
+ function zc(e) {
6286
6278
  return e.projectId !== void 0 ? `project:${e.projectId}` : e.sectionId !== void 0 ? `section:${e.sectionId}` : `parent:${e.parentId}`;
6287
6279
  }
6288
- function Yc(e) {
6280
+ function Kc(e) {
6289
6281
  const t = [];
6290
6282
  return e.projectId && t.push({ projectId: e.projectId }), e.sectionId && t.push({ sectionId: e.sectionId }), e.parentId && t.push({ parentId: e.parentId }), t;
6291
6283
  }
6292
- function qc({
6284
+ function Yc({
6293
6285
  taskId: e,
6294
6286
  request: t,
6295
6287
  current: o
6296
6288
  }) {
6297
- const r = Yc(t);
6289
+ const r = Kc(t);
6298
6290
  if (r.length === 0)
6299
6291
  return { redundantMoveSkipped: !1 };
6300
6292
  let n = r, i = !1;
6301
6293
  if (o) {
6302
- const a = r.length === 1 ? (c) => Cs(o, c) : (c) => zc(o, c);
6294
+ const a = r.length === 1 ? (c) => Cs(o, c) : (c) => Bc(o, c);
6303
6295
  n = r.filter((c) => !a(c)), i = n.length < r.length;
6304
6296
  }
6305
6297
  if (n.length === 0)
@@ -6310,7 +6302,7 @@ function qc({
6310
6302
  );
6311
6303
  return { move: n[0], redundantMoveSkipped: i };
6312
6304
  }
6313
- const Gc = s.object({
6305
+ const qc = s.object({
6314
6306
  id: s.string().min(1).describe("The ID of the task to update."),
6315
6307
  content: s.string().optional().describe(
6316
6308
  '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.'
@@ -6326,7 +6318,7 @@ const Gc = s.object({
6326
6318
  ),
6327
6319
  parentId: s.string().optional().describe("Make the task a subtask of this task ID. Omit unless the parent should change."),
6328
6320
  order: s.number().optional().describe("The new order of the task within its parent/section."),
6329
- priority: Ze.optional().describe(Xe),
6321
+ priority: Qe.optional().describe(Ze),
6330
6322
  dueString: s.preprocess(
6331
6323
  // Keep accepting legacy null while exposing a Gemini-compatible string schema.
6332
6324
  (e) => e === null ? "remove" : e,
@@ -6355,9 +6347,9 @@ const Gc = s.object({
6355
6347
  isUncompletable: s.boolean().optional().describe(
6356
6348
  "Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
6357
6349
  )
6358
- }), 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", qe = Yt.TASKS_PER_OPERATION, Pt = {
6359
- tasks: s.array(Gc).min(1).max(qe).describe(`The tasks to update (max ${qe}).`)
6360
- }, Qc = {
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 = {
6361
6353
  tasks: s.array(H).describe("The updated tasks."),
6362
6354
  totalCount: s.number().describe("The total number of tasks updated."),
6363
6355
  updatedTaskIds: s.array(s.string()).describe("The IDs of the updated tasks."),
@@ -6372,22 +6364,22 @@ const Gc = s.object({
6372
6364
  "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."
6373
6365
  )
6374
6366
  }).describe("Summary of operations performed.")
6375
- }, ed = {
6376
- name: g.UPDATE_TASKS,
6367
+ }, Qc = {
6368
+ name: y.UPDATE_TASKS,
6377
6369
  description: "Update existing tasks including content, dates, priorities, and assignments. Send only the fields that change.",
6378
- parameters: Pt,
6379
- outputSchema: Qc,
6370
+ parameters: _t,
6371
+ outputSchema: Zc,
6380
6372
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
6381
6373
  async execute(e, t) {
6382
- const { tasks: o } = s.object(Pt).parse(e), r = o.map(() => ({ kind: "skipped" })), n = (T, b) => {
6374
+ const { tasks: o } = s.object(_t).parse(e), r = o.map(() => ({ kind: "skipped" })), n = (T, b) => {
6383
6375
  r[T] = { kind: "failed", error: b };
6384
6376
  }, i = (T, b) => {
6385
6377
  n(T, z(b));
6386
- }, a = o.map((T, b) => ({ task: T, index: b })).filter(({ task: T }) => dd(T)), c = await sd(
6378
+ }, a = o.map((T, b) => ({ task: T, index: b })).filter(({ task: T }) => cd(T)), c = await td(
6387
6379
  a.map(({ task: T }) => T),
6388
6380
  t
6389
6381
  ), d = await Promise.allSettled(
6390
- a.map(({ task: T, index: b }) => id({ task: T, index: b, client: t, inbox: c }))
6382
+ a.map(({ task: T, index: b }) => nd({ task: T, index: b, client: t, inbox: c }))
6391
6383
  ), l = [];
6392
6384
  for (const [T, b] of d.entries()) {
6393
6385
  const S = a[T]?.index ?? T;
@@ -6397,13 +6389,13 @@ const Gc = s.object({
6397
6389
  client: t,
6398
6390
  ids: [
6399
6391
  ...new Set(
6400
- l.filter((T) => Vc(T.moveRequest)).map((T) => T.id)
6392
+ l.filter((T) => Gc(T.moveRequest)).map((T) => T.id)
6401
6393
  )
6402
6394
  ]
6403
6395
  }), u = [];
6404
6396
  for (const T of l)
6405
6397
  try {
6406
- const b = qc({
6398
+ const b = Yc({
6407
6399
  taskId: T.id,
6408
6400
  request: T.moveRequest,
6409
6401
  current: p.get(T.id)
@@ -6412,10 +6404,10 @@ const Gc = s.object({
6412
6404
  } catch (b) {
6413
6405
  i(T.index, b), T.failed = !0;
6414
6406
  }
6415
- const h = /* @__PURE__ */ new Map(), m = [], y = (T) => {
6407
+ const h = /* @__PURE__ */ new Map(), m = [], g = (T) => {
6416
6408
  const b = T.filter((S) => !S.failed);
6417
6409
  b.length !== 0 && m.push(
6418
- nd({
6410
+ rd({
6419
6411
  client: t,
6420
6412
  items: b,
6421
6413
  onUpdated: (S, $) => {
@@ -6436,7 +6428,7 @@ const Gc = s.object({
6436
6428
  })
6437
6429
  );
6438
6430
  }, f = new Set(u.map(({ item: T }) => T.index));
6439
- y(l.filter((T) => !f.has(T.index))), await od({
6431
+ g(l.filter((T) => !f.has(T.index))), await sd({
6440
6432
  client: t,
6441
6433
  moving: u,
6442
6434
  results: h,
@@ -6450,7 +6442,7 @@ const Gc = s.object({
6450
6442
  }
6451
6443
  b.push(S);
6452
6444
  }
6453
- y(b);
6445
+ g(b);
6454
6446
  }
6455
6447
  }), await Promise.all(m);
6456
6448
  for (const T of l) {
@@ -6459,9 +6451,9 @@ const Gc = s.object({
6459
6451
  const b = h.get(T.index);
6460
6452
  b && "task" in b && (r[T.index] = { kind: "updated", task: b.task });
6461
6453
  }
6462
- const { updatedTasks: v, failures: j, skippedCount: A } = td({ tasks: o, outcomes: r }), k = l.filter((T) => T.redundantMoveSkipped).length, I = v.map(P);
6454
+ const { updatedTasks: v, failures: j, skippedCount: A } = ed({ tasks: o, outcomes: r }), k = l.filter((T) => T.redundantMoveSkipped).length, I = v.map(P);
6463
6455
  return {
6464
- textContent: cd({
6456
+ textContent: ad({
6465
6457
  tasks: I,
6466
6458
  failures: j,
6467
6459
  skippedCount: A,
@@ -6482,7 +6474,7 @@ const Gc = s.object({
6482
6474
  };
6483
6475
  }
6484
6476
  };
6485
- function td({ tasks: e, outcomes: t }) {
6477
+ function ed({ tasks: e, outcomes: t }) {
6486
6478
  const o = [], r = [];
6487
6479
  let n = 0;
6488
6480
  for (const [i, a] of t.entries()) {
@@ -6499,7 +6491,7 @@ function td({ tasks: e, outcomes: t }) {
6499
6491
  }
6500
6492
  return { updatedTasks: o, failures: r, skippedCount: n };
6501
6493
  }
6502
- async function sd(e, t) {
6494
+ async function td(e, t) {
6503
6495
  if (!e.some((o) => M(o.projectId)))
6504
6496
  return {};
6505
6497
  try {
@@ -6518,7 +6510,7 @@ async function Ds({
6518
6510
  try {
6519
6511
  const r = new Set(t), n = {
6520
6512
  ids: t.join(","),
6521
- limit: qe
6513
+ limit: Ge
6522
6514
  }, { results: i } = await O(() => e.getTasks(n));
6523
6515
  for (const a of i)
6524
6516
  r.has(a.id) && o.set(a.id, a);
@@ -6526,7 +6518,7 @@ async function Ds({
6526
6518
  }
6527
6519
  return o;
6528
6520
  }
6529
- async function od({
6521
+ async function sd({
6530
6522
  client: e,
6531
6523
  moving: t,
6532
6524
  results: o,
@@ -6536,10 +6528,10 @@ async function od({
6536
6528
  return;
6537
6529
  const n = /* @__PURE__ */ new Map();
6538
6530
  for (const c of t) {
6539
- const d = Kc(c.move), l = n.get(d);
6531
+ const d = zc(c.move), l = n.get(d);
6540
6532
  l ? l.push(c) : n.set(d, [c]);
6541
6533
  }
6542
- const i = ho(e), a = [];
6534
+ const i = uo(e), a = [];
6543
6535
  for (const c of n.values()) {
6544
6536
  const d = [...new Set(c.map(({ item: u }) => u.id))], l = c[0]?.move, p = c.length === 1 ? c[0] : void 0;
6545
6537
  try {
@@ -6552,12 +6544,12 @@ async function od({
6552
6544
  }
6553
6545
  const u = await i(
6554
6546
  () => O(() => e.moveTasks(d, l))
6555
- ), h = new Map(u.map((f) => [f.id, f])), m = [], y = [];
6547
+ ), h = new Map(u.map((f) => [f.id, f])), m = [], g = [];
6556
6548
  for (const f of c) {
6557
6549
  const v = h.get(f.item.id);
6558
- v ? (o.set(f.item.index, { task: v }), y.push(f)) : m.push(f);
6550
+ v ? (o.set(f.item.index, { task: v }), g.push(f)) : m.push(f);
6559
6551
  }
6560
- r(y), m.length > 0 && a.push({ group: m, destination: l });
6552
+ r(g), m.length > 0 && a.push({ group: m, destination: l });
6561
6553
  } catch (u) {
6562
6554
  if (p) {
6563
6555
  o.set(p.item.index, { error: z(u) }), r(c);
@@ -6567,12 +6559,12 @@ async function od({
6567
6559
  }
6568
6560
  }
6569
6561
  if (a.length > 0) {
6570
- await rd({ client: e, unresolved: a, results: o });
6562
+ await od({ client: e, unresolved: a, results: o });
6571
6563
  for (const { group: c } of a)
6572
6564
  r(c);
6573
6565
  }
6574
6566
  }
6575
- async function rd({
6567
+ async function od({
6576
6568
  client: e,
6577
6569
  unresolved: t,
6578
6570
  results: o
@@ -6590,13 +6582,13 @@ async function rd({
6590
6582
  }
6591
6583
  }
6592
6584
  }
6593
- async function nd({
6585
+ async function rd({
6594
6586
  client: e,
6595
6587
  items: t,
6596
6588
  onUpdated: o,
6597
6589
  onFailed: r
6598
6590
  }) {
6599
- const n = mo(e);
6591
+ const n = po(e);
6600
6592
  await Promise.all(
6601
6593
  t.filter((i) => $s(i.updateArgs)).map(async (i) => {
6602
6594
  try {
@@ -6610,7 +6602,7 @@ async function nd({
6610
6602
  })
6611
6603
  );
6612
6604
  }
6613
- async function id({
6605
+ async function nd({
6614
6606
  task: e,
6615
6607
  index: t,
6616
6608
  client: o,
@@ -6627,23 +6619,23 @@ async function id({
6627
6619
  priority: u,
6628
6620
  labels: h,
6629
6621
  deadlineDate: m,
6630
- ...y
6622
+ ...g
6631
6623
  } = e;
6632
6624
  if (M(i) && r.error !== void 0)
6633
6625
  throw r.error;
6634
6626
  const f = M(i) ? r.projectId : i;
6635
6627
  let v = {
6636
- ...y,
6628
+ ...g,
6637
6629
  ...h !== void 0 && { labels: h }
6638
6630
  };
6639
6631
  u && (v.priority = Qt(u));
6640
- const j = _t(
6632
+ const j = Rt(
6641
6633
  d,
6642
- Jc,
6643
- Zc
6634
+ Vc,
6635
+ Xc
6644
6636
  );
6645
6637
  j !== void 0 && (v = { ...v, dueString: j });
6646
- const A = _t(m, Xc, null);
6638
+ const A = Rt(m, Jc, null);
6647
6639
  if (A !== void 0 && (v = { ...v, deadlineDate: A }), l)
6648
6640
  try {
6649
6641
  const { minutes: k } = Zt(l);
@@ -6657,7 +6649,7 @@ async function id({
6657
6649
  }
6658
6650
  return p !== void 0 && (v = {
6659
6651
  ...v,
6660
- assigneeId: await ad(o, n, p)
6652
+ assigneeId: await id(o, n, p)
6661
6653
  }), {
6662
6654
  index: t,
6663
6655
  id: n,
@@ -6671,10 +6663,10 @@ async function id({
6671
6663
  failed: !1
6672
6664
  };
6673
6665
  }
6674
- async function ad(e, t, o) {
6666
+ async function id(e, t, o) {
6675
6667
  if (o === null || o === "unassign")
6676
6668
  return null;
6677
- const r = await at.validateTaskUpdateAssignment(
6669
+ const r = await ct.validateTaskUpdateAssignment(
6678
6670
  e,
6679
6671
  t,
6680
6672
  o
@@ -6685,7 +6677,7 @@ async function ad(e, t, o) {
6685
6677
  }
6686
6678
  return r.resolvedUser?.userId;
6687
6679
  }
6688
- function cd({
6680
+ function ad({
6689
6681
  tasks: e,
6690
6682
  failures: t,
6691
6683
  skippedCount: o,
@@ -6693,7 +6685,7 @@ function cd({
6693
6685
  }) {
6694
6686
  const n = [];
6695
6687
  o > 0 && n.push(`${o} skipped - no changes`), r > 0 && n.push(`${r} already in requested destination`), t.length > 0 && n.push(`${t.length} failed`);
6696
- const i = n.length > 0 ? ` (${n.join(", ")})` : "", a = rt("Updated", e, {
6688
+ const i = n.length > 0 ? ` (${n.join(", ")})` : "", a = nt("Updated", e, {
6697
6689
  context: i,
6698
6690
  showDetails: e.length <= 5
6699
6691
  });
@@ -6706,10 +6698,10 @@ function cd({
6706
6698
  Failed (${t.length}) - address or drop these items:
6707
6699
  ${l}${p}`;
6708
6700
  }
6709
- function dd({ id: e, ...t }) {
6701
+ function cd({ id: e, ...t }) {
6710
6702
  return Object.keys(t).length > 0;
6711
6703
  }
6712
- function _t(e, t, o) {
6704
+ function Rt(e, t, o) {
6713
6705
  if (e === void 0)
6714
6706
  return e;
6715
6707
  if (e === null)
@@ -6717,7 +6709,7 @@ function _t(e, t, o) {
6717
6709
  const r = e.trim().toLowerCase();
6718
6710
  return t.includes(r) ? o : e;
6719
6711
  }
6720
- const ld = {}, ud = {
6712
+ const dd = {}, ld = {
6721
6713
  type: s.literal("user_info").describe("The type of the response."),
6722
6714
  userId: s.string().describe("The user ID."),
6723
6715
  fullName: s.string().describe("The full name of the user."),
@@ -6734,25 +6726,25 @@ const ld = {}, ud = {
6734
6726
  email: s.string().describe("The email address of the user."),
6735
6727
  plan: s.enum(["Todoist Free", "Todoist Pro", "Todoist Business"]).describe("The user plan.")
6736
6728
  };
6737
- function pd(e) {
6729
+ function ud(e) {
6738
6730
  return e.businessAccountId ? "Todoist Business" : e.isPremium ? "Todoist Pro" : "Todoist Free";
6739
6731
  }
6740
- function hd(e, t) {
6732
+ function pd(e, t) {
6741
6733
  const r = ((e.getDay() || 7) - t + 7) % 7, n = new Date(e);
6742
6734
  return n.setDate(e.getDate() - r), n;
6743
6735
  }
6744
- function md(e) {
6736
+ function hd(e) {
6745
6737
  const t = new Date(e);
6746
6738
  return t.setDate(e.getDate() + 6), t;
6747
6739
  }
6748
- function fd(e) {
6740
+ function md(e) {
6749
6741
  const t = new Date(e.getFullYear(), 0, 1), o = (e.getTime() - t.getTime()) / 864e5;
6750
6742
  return Math.ceil((o + t.getDay() + 1) / 7);
6751
6743
  }
6752
- function bd(e) {
6744
+ function fd(e) {
6753
6745
  return ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"][e === 7 ? 0 : e] ?? "Unknown";
6754
6746
  }
6755
- function gd(e) {
6747
+ function bd(e) {
6756
6748
  try {
6757
6749
  return new Intl.DateTimeFormat("en-US", { timeZone: e }), !0;
6758
6750
  } catch {
@@ -6760,9 +6752,9 @@ function gd(e) {
6760
6752
  }
6761
6753
  }
6762
6754
  function xs(e) {
6763
- return gd(e) ? e : "UTC";
6755
+ return bd(e) ? e : "UTC";
6764
6756
  }
6765
- function yd(e, t) {
6757
+ function gd(e, t) {
6766
6758
  const o = xs(t);
6767
6759
  return e.toLocaleString("en-US", {
6768
6760
  timeZone: o,
@@ -6775,8 +6767,8 @@ function yd(e, t) {
6775
6767
  hour12: !1
6776
6768
  });
6777
6769
  }
6778
- async function Td(e) {
6779
- 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), y = [
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 = [
6780
6772
  "# User Information",
6781
6773
  "",
6782
6774
  `**User ID:** ${t.id}`,
@@ -6816,28 +6808,28 @@ async function Td(e) {
6816
6808
  email: t.email,
6817
6809
  plan: d
6818
6810
  };
6819
- return { textContent: y, structuredContent: f };
6811
+ return { textContent: g, structuredContent: f };
6820
6812
  }
6821
- const kd = {
6822
- name: g.USER_INFO,
6813
+ const Td = {
6814
+ name: y.USER_INFO,
6823
6815
  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).",
6824
- parameters: ld,
6825
- outputSchema: ud,
6816
+ parameters: dd,
6817
+ outputSchema: ld,
6826
6818
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
6827
6819
  async execute(e, t) {
6828
- const o = await Td(t);
6820
+ const o = await yd(t);
6829
6821
  return {
6830
6822
  textContent: o.textContent,
6831
6823
  structuredContent: o.structuredContent
6832
6824
  };
6833
6825
  }
6834
- }, Rt = 10 * 1024 * 1024, wd = /* @__PURE__ */ new Set([
6826
+ }, Ut = 10 * 1024 * 1024, kd = /* @__PURE__ */ new Set([
6835
6827
  "image/png",
6836
6828
  "image/jpeg",
6837
6829
  "image/gif",
6838
6830
  "image/webp",
6839
6831
  "image/svg+xml"
6840
- ]), vd = /* @__PURE__ */ new Set([
6832
+ ]), wd = /* @__PURE__ */ new Set([
6841
6833
  "text/plain",
6842
6834
  "text/csv",
6843
6835
  "text/html",
@@ -6845,7 +6837,7 @@ const kd = {
6845
6837
  "application/json",
6846
6838
  "application/xml",
6847
6839
  "text/xml"
6848
- ]), Id = {
6840
+ ]), vd = {
6849
6841
  ".png": "image/png",
6850
6842
  ".jpg": "image/jpeg",
6851
6843
  ".jpeg": "image/jpeg",
@@ -6860,23 +6852,23 @@ const kd = {
6860
6852
  ".xml": "application/xml",
6861
6853
  ".pdf": "application/pdf"
6862
6854
  };
6863
- function Sd(e) {
6864
- return wd.has(e) ? "image" : vd.has(e) || e.startsWith("text/") ? "text" : "binary";
6855
+ function Id(e) {
6856
+ return kd.has(e) ? "image" : wd.has(e) || e.startsWith("text/") ? "text" : "binary";
6865
6857
  }
6866
- function jd(e) {
6858
+ function Sd(e) {
6867
6859
  return (e.split(";")[0] ?? e).trim().toLowerCase();
6868
6860
  }
6869
- function Cd(e) {
6861
+ function jd(e) {
6870
6862
  try {
6871
6863
  const t = new URL(e).pathname, o = t.lastIndexOf(".");
6872
6864
  if (o === -1) return;
6873
6865
  const r = t.slice(o).toLowerCase();
6874
- return Id[r];
6866
+ return vd[r];
6875
6867
  } catch {
6876
6868
  return;
6877
6869
  }
6878
6870
  }
6879
- function $d(e) {
6871
+ function Cd(e) {
6880
6872
  try {
6881
6873
  const t = new URL(e).pathname, o = t.lastIndexOf("/");
6882
6874
  return o === -1 ? void 0 : t.slice(o + 1) || void 0;
@@ -6884,31 +6876,31 @@ function $d(e) {
6884
6876
  return;
6885
6877
  }
6886
6878
  }
6887
- const Dd = {
6879
+ const $d = {
6888
6880
  fileUrl: s.url().describe(
6889
6881
  "The URL of the attachment file to view. Get this from the fileUrl field in a comment's fileAttachment."
6890
6882
  )
6891
- }, xd = {
6892
- name: g.VIEW_ATTACHMENT,
6883
+ }, Dd = {
6884
+ name: y.VIEW_ATTACHMENT,
6893
6885
  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).",
6894
- parameters: Dd,
6886
+ parameters: $d,
6895
6887
  annotations: {
6896
6888
  readOnlyHint: !0,
6897
6889
  destructiveHint: !1,
6898
6890
  idempotentHint: !0
6899
6891
  },
6900
6892
  async execute({ fileUrl: e }, t) {
6901
- 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";
6902
- if (n && n > Rt)
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)
6903
6895
  return {
6904
6896
  textContent: `Attachment "${i ?? e}" is too large to display inline (${(n / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
6905
6897
  };
6906
6898
  const l = Buffer.from(await o.arrayBuffer()), p = l.byteLength;
6907
- if (p > Rt)
6899
+ if (p > Ut)
6908
6900
  return {
6909
6901
  textContent: `Attachment "${i ?? e}" is too large to display inline (${(p / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
6910
6902
  };
6911
- const u = Sd(d), h = [];
6903
+ const u = Id(d), h = [];
6912
6904
  return u === "image" ? h.push({
6913
6905
  type: "image",
6914
6906
  data: l.toString("base64"),
@@ -6928,77 +6920,77 @@ const Dd = {
6928
6920
  contentItems: h
6929
6921
  };
6930
6922
  }
6931
- }, Ad = {
6932
- ...Fi,
6923
+ }, xd = {
6924
+ ...Mi,
6933
6925
  _meta: {
6934
6926
  ui: {
6935
- resourceUri: Le
6927
+ resourceUri: Ne
6936
6928
  }
6937
6929
  }
6938
- }, Ed = {
6930
+ }, Ad = {
6939
6931
  // Task management tools
6940
- addTasks: Tn,
6941
- completeTasks: Dn,
6942
- uncompleteTasks: rc,
6943
- updateTasks: ed,
6944
- rescheduleTasks: Xa,
6945
- findTasks: qi,
6946
- findTasksByDate: Ad,
6947
- findCompletedTasks: hi,
6932
+ addTasks: yn,
6933
+ completeTasks: $n,
6934
+ uncompleteTasks: oc,
6935
+ updateTasks: Qc,
6936
+ rescheduleTasks: Ja,
6937
+ findTasks: Yi,
6938
+ findTasksByDate: xd,
6939
+ findCompletedTasks: pi,
6948
6940
  // Project management tools
6949
- addProjects: en,
6950
- updateProjects: xc,
6951
- findProjects: $i,
6952
- projectManagement: Ha,
6953
- projectMove: za,
6941
+ addProjects: Qr,
6942
+ updateProjects: Dc,
6943
+ findProjects: Ci,
6944
+ projectManagement: Fa,
6945
+ projectMove: Ba,
6954
6946
  // Section management tools
6955
- addSections: mn,
6956
- updateSections: Wc,
6957
- findSections: Ui,
6947
+ addSections: hn,
6948
+ updateSections: Hc,
6949
+ findSections: Ri,
6958
6950
  // Comment management tools
6959
- addComments: xr,
6960
- findComments: ri,
6961
- updateComments: dc,
6951
+ addComments: Dr,
6952
+ findComments: oi,
6953
+ updateComments: cc,
6962
6954
  // Reminder management tools
6963
- addReminders: dn,
6964
- findReminders: Ei,
6965
- updateReminders: Nc,
6955
+ addReminders: cn,
6956
+ findReminders: Ai,
6957
+ updateReminders: Lc,
6966
6958
  // Attachment tools
6967
- viewAttachment: xd,
6959
+ viewAttachment: Dd,
6968
6960
  // Label management tools
6969
- addLabels: Br,
6970
- updateLabels: Ic,
6971
- findLabels: gi,
6961
+ addLabels: Wr,
6962
+ updateLabels: vc,
6963
+ findLabels: bi,
6972
6964
  // Filter management tools
6973
- findFilters: _r,
6974
- addFilters: Mr,
6975
- updateFilters: mc,
6965
+ findFilters: Pr,
6966
+ addFilters: Nr,
6967
+ updateFilters: hc,
6976
6968
  // Activity and audit tools
6977
- findActivity: Xn,
6978
- getProductivityStats: ia,
6969
+ findActivity: Jn,
6970
+ getProductivityStats: na,
6979
6971
  // Health and insights tools
6980
- getProjectHealth: ga,
6981
- getProjectActivityStats: ua,
6982
- analyzeProjectHealth: jn,
6983
- getWorkspaceInsights: wa,
6972
+ getProjectHealth: ba,
6973
+ getProjectActivityStats: la,
6974
+ analyzeProjectHealth: Sn,
6975
+ getWorkspaceInsights: ka,
6984
6976
  // General tools
6985
- getOverview: oa,
6986
- deleteObject: On,
6987
- fetchObject: zn,
6988
- reorderObjects: qa,
6989
- userInfo: kd,
6977
+ getOverview: sa,
6978
+ deleteObject: En,
6979
+ fetchObject: Bn,
6980
+ reorderObjects: Ya,
6981
+ userInfo: Td,
6990
6982
  // Assignment and collaboration tools
6991
- findProjectCollaborators: wi,
6992
- manageAssignments: Na,
6983
+ findProjectCollaborators: ki,
6984
+ manageAssignments: La,
6993
6985
  // Template tools
6994
- exportProjectTemplate: Rn,
6995
- importProjectTemplate: Ca,
6986
+ exportProjectTemplate: _n,
6987
+ importProjectTemplate: ja,
6996
6988
  // Workspace tools
6997
- listWorkspaces: Oa,
6989
+ listWorkspaces: Ea,
6998
6990
  // OpenAI MCP tools
6999
- search: tc,
7000
- fetch: qn
7001
- }, Od = Object.values(Ed), Pd = `
6991
+ search: ec,
6992
+ fetch: Yn
6993
+ }, Ed = Object.values(Ad), Od = `
7002
6994
  ## Todoist Task and Project Management Tools
7003
6995
 
7004
6996
  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.
@@ -7055,25 +7047,25 @@ Use the **productivity-analysis** prompt for a combined productivity review —
7055
7047
 
7056
7048
  Always provide clear, actionable task titles and descriptions. Use the overview tools to give users context about their workload and project status.
7057
7049
  `;
7058
- function qd({
7050
+ function Yd({
7059
7051
  todoistApiKey: e,
7060
7052
  baseUrl: t,
7061
7053
  features: o = []
7062
7054
  }) {
7063
7055
  const r = new Es(
7064
- { name: "todoist-mcp-server", version: Je },
7056
+ { name: "todoist-mcp-server", version: Xe },
7065
7057
  {
7066
7058
  capabilities: {
7067
7059
  tools: { listChanged: !0 },
7068
7060
  prompts: { listChanged: !0 }
7069
7061
  },
7070
- instructions: Pd
7062
+ instructions: Od
7071
7063
  }
7072
- ), n = Do(e, { baseUrl: t });
7073
- Js(r);
7064
+ ), n = Co(e, { baseUrl: t });
7065
+ Gs(r);
7074
7066
  const i = { server: r, client: n, features: o };
7075
- for (const a of Od)
7076
- Go({ tool: a, ...i });
7067
+ for (const a of Ed)
7068
+ qo({ tool: a, ...i });
7077
7069
  return r.registerPrompt(
7078
7070
  me.name,
7079
7071
  {
@@ -7085,58 +7077,58 @@ function qd({
7085
7077
  ), r;
7086
7078
  }
7087
7079
  export {
7088
- _o as $,
7089
- oa as A,
7090
- ia as B,
7091
- ua as C,
7092
- ga as D,
7093
- wa as E,
7094
- Yd as F,
7095
- Ca as G,
7096
- Oa as H,
7097
- Na as I,
7098
- Ha as J,
7099
- za as K,
7100
- Od as L,
7101
- qa as M,
7102
- Xa as N,
7103
- tc as O,
7104
- rc as P,
7105
- dc as Q,
7106
- mc as R,
7107
- Ic as S,
7108
- xc as T,
7109
- Nc as U,
7110
- Wc as V,
7111
- ed as W,
7112
- kd as X,
7113
- xd as Y,
7114
- Do as Z,
7115
- To as _,
7116
- xr as a,
7117
- Mr as b,
7118
- Br as c,
7119
- en as d,
7120
- dn as e,
7121
- mn as f,
7122
- qd as g,
7123
- Tn as h,
7124
- jn as i,
7125
- Dn as j,
7126
- On as k,
7127
- Rn as l,
7128
- qn as m,
7129
- zn as n,
7130
- Xn as o,
7131
- ri as p,
7132
- hi as q,
7133
- _r as r,
7134
- gi as s,
7135
- Ed as t,
7136
- wi as u,
7137
- $i as v,
7138
- Ei as w,
7139
- Ui as x,
7140
- qi as y,
7141
- Fi as z
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,
7131
+ Ri as x,
7132
+ Yi as y,
7133
+ Mi as z
7142
7134
  };