@doist/todoist-mcp 12.3.2 → 12.4.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 Ss, McpServer as Cs } from "@modelcontextprotocol/sdk/server/mcp.js";
2
- import { createHash as _t, randomUUID as _e } from "node:crypto";
3
- import { readFileSync as $s } from "node:fs";
4
- import { dirname as Ut, join as Ue } from "node:path";
5
- import { fileURLToPath as Ds } from "node:url";
6
- import { registerAppResource as As, RESOURCE_MIME_TYPE as Mt, registerAppTool as xs } from "@modelcontextprotocol/ext-apps/server";
7
- import re, { ZodError as Es, z as s } from "zod";
8
- import { AsyncLocalStorage as Os } from "node:async_hooks";
9
- import { createRequire as Ps } from "node:module";
10
- import { TodoistApi as Rs, isWorkspaceProject as Te, isPersonalProject as q, colors as Me, LOCATION_TRIGGERS as Nt, REMINDER_TYPES as _s, createCommand as J, REMINDER_DELIVERY_SERVICES as Us, HEALTH_STATUSES as Je, getTaskUrl as Lt, getProjectUrl as Ft, WORKSPACE_ROLES as Ms, WORKSPACE_PLANS as Ns } from "@doist/todoist-sdk";
1
+ import { ResourceTemplate as Cs, McpServer as $s } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { createHash as Ut, randomUUID as _e } from "node:crypto";
3
+ import { readFileSync as Ds } from "node:fs";
4
+ import { dirname as Mt, join as Ue } from "node:path";
5
+ import { fileURLToPath as As } from "node:url";
6
+ import { registerAppResource as xs, RESOURCE_MIME_TYPE as Nt, registerAppTool as Es } from "@modelcontextprotocol/ext-apps/server";
7
+ import re, { ZodError as Os, z as s } from "zod";
8
+ import { AsyncLocalStorage as Ps } from "node:async_hooks";
9
+ import { createRequire as Rs } from "node:module";
10
+ import { TodoistApi as _s, isWorkspaceProject as Te, isPersonalProject as q, colors as Me, LOCATION_TRIGGERS as Lt, REMINDER_TYPES as Us, createCommand as J, REMINDER_DELIVERY_SERVICES as Ms, HEALTH_STATUSES as Je, getTaskUrl as Ft, getProjectUrl as Ht, WORKSPACE_ROLES as Ns, WORKSPACE_PLANS as Ls } from "@doist/todoist-sdk";
11
11
  import { addDays as Ne, formatISO as pt } from "date-fns";
12
- const ht = Ut(Ds(import.meta.url)), Ls = [
12
+ const ht = Mt(As(import.meta.url)), Fs = [
13
13
  Ue(ht, "task-list", "index.html"),
14
14
  Ue(ht, "mcp-apps", "index.html")
15
- ], Fs = `<!doctype html>
15
+ ], Hs = `<!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 Hs() {
21
+ function Ws() {
22
22
  const e = [];
23
- for (const t of Ls)
23
+ for (const t of Fs)
24
24
  try {
25
- return $s(t, "utf-8");
25
+ return Ds(t, "utf-8");
26
26
  } catch (r) {
27
27
  e.push(r);
28
28
  }
29
- return console.error("Failed to load task list app HTML from any known path:", e), Fs;
29
+ return console.error("Failed to load task list app HTML from any known path:", e), Hs;
30
30
  }
31
- const Ht = Hs(), Ws = _t("sha256").update(Ht).digest("hex").slice(0, 12), Le = `ui://todoist/task-list@${Ws}`, Bs = "ui://todoist/task-list@{hash}", Fe = "Interactive task list widget", qs = "https://ai.todoist.net", He = {
31
+ const Wt = Ws(), Bs = Ut("sha256").update(Wt).digest("hex").slice(0, 12), Le = `ui://todoist/task-list@${Bs}`, qs = "ui://todoist/task-list@{hash}", Fe = "Interactive task list widget", Ys = "https://ai.todoist.net", He = {
32
32
  ui: {
33
33
  prefersBorder: !0,
34
34
  csp: {
@@ -43,22 +43,22 @@ const Ht = Hs(), Ws = _t("sha256").update(Ht).digest("hex").slice(0, 12), Le = `
43
43
  connect_domains: [],
44
44
  resource_domains: []
45
45
  },
46
- "openai/widgetDomain": qs
46
+ "openai/widgetDomain": Ys
47
47
  };
48
48
  function mt(e) {
49
49
  return {
50
50
  contents: [
51
51
  {
52
52
  uri: e,
53
- mimeType: Mt,
54
- text: Ht,
53
+ mimeType: Nt,
54
+ text: Wt,
55
55
  _meta: He
56
56
  }
57
57
  ]
58
58
  };
59
59
  }
60
- function Ys(e) {
61
- As(
60
+ function zs(e) {
61
+ xs(
62
62
  e,
63
63
  "todoist-task-list",
64
64
  Le,
@@ -69,10 +69,10 @@ function Ys(e) {
69
69
  async () => mt(Le)
70
70
  ), e.registerResource(
71
71
  "todoist-task-list-hash-fallback",
72
- new Ss(Bs, { list: void 0 }),
72
+ new Cs(qs, { list: void 0 }),
73
73
  {
74
74
  description: `${Fe} compatibility fallback`,
75
- mimeType: Mt,
75
+ mimeType: Nt,
76
76
  _meta: He
77
77
  },
78
78
  async (t) => mt(t.toString())
@@ -84,7 +84,7 @@ function X(e) {
84
84
  function We(...e) {
85
85
  return e.find(X);
86
86
  }
87
- function N(...e) {
87
+ function L(...e) {
88
88
  return e.find((t) => t !== void 0);
89
89
  }
90
90
  function P(e) {
@@ -93,7 +93,7 @@ function P(e) {
93
93
  if (typeof e == "string" && /^\d+$/.test(e.trim()))
94
94
  return Number(e.trim());
95
95
  }
96
- function v(e) {
96
+ function w(e) {
97
97
  if (typeof e == "string") {
98
98
  const t = e.trim();
99
99
  return t.length > 0 ? t : void 0;
@@ -103,16 +103,16 @@ function v(e) {
103
103
  }
104
104
  function oe(e) {
105
105
  const t = P(e);
106
- return t !== void 0 ? t : v(e);
106
+ return t !== void 0 ? t : w(e);
107
107
  }
108
- function zs(e) {
108
+ function Gs(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 U(e, t = 220) {
115
- const r = zs(e).replace(/\s+/g, " ").trim();
115
+ const r = Gs(e).replace(/\s+/g, " ").trim();
116
116
  return r.length <= t ? r : `${r.slice(0, t - 3)}...`;
117
117
  }
118
118
  function Be(e) {
@@ -127,42 +127,42 @@ function Ee(e) {
127
127
  return P(t[1]);
128
128
  }
129
129
  function V(e) {
130
- const t = v(e);
130
+ const t = w(e);
131
131
  if (t)
132
132
  return U(t);
133
133
  if (Array.isArray(e)) {
134
- const n = e.map((a) => X(a) ? v(a.message) || v(a.error) : v(a)).filter((a) => !!a);
134
+ const n = e.map((a) => X(a) ? w(a.message) || w(a.error) : w(a)).filter((a) => !!a);
135
135
  return n.length > 0 ? U(n.slice(0, 2).join("; ")) : void 0;
136
136
  }
137
137
  if (!X(e))
138
138
  return;
139
- const r = N(
140
- v(e.detail),
141
- v(e.details),
142
- v(e.message),
143
- v(e.error),
144
- v(e.description)
139
+ const r = L(
140
+ w(e.detail),
141
+ w(e.details),
142
+ w(e.message),
143
+ w(e.error),
144
+ w(e.description)
145
145
  );
146
146
  if (r)
147
147
  return U(r);
148
148
  const o = [];
149
149
  for (const [n, a] of Object.entries(e)) {
150
- const i = v(a);
150
+ const i = w(a);
151
151
  if (i && (o.push(`${n}: ${i}`), o.length >= 2))
152
152
  break;
153
153
  }
154
154
  return o.length > 0 ? U(o.join("; ")) : void 0;
155
155
  }
156
- function Gs(e) {
156
+ function Ks(e) {
157
157
  if (!e)
158
158
  return [];
159
159
  const t = /* @__PURE__ */ new Set(), r = (i) => {
160
160
  i && t.add(U(i, 120));
161
- }, o = N(
162
- v(e.field),
163
- v(e.parameter),
164
- v(e.param),
165
- v(e.path)
161
+ }, o = L(
162
+ w(e.field),
163
+ w(e.parameter),
164
+ w(e.param),
165
+ w(e.path)
166
166
  );
167
167
  r(o);
168
168
  const n = We(
@@ -172,12 +172,12 @@ function Gs(e) {
172
172
  e.error_extra
173
173
  );
174
174
  if (n) {
175
- const i = N(
176
- v(n.field),
177
- v(n.parameter),
178
- v(n.param),
179
- v(n.path),
180
- v(n.argument)
175
+ const i = L(
176
+ w(n.field),
177
+ w(n.parameter),
178
+ w(n.param),
179
+ w(n.path),
180
+ w(n.argument)
181
181
  );
182
182
  r(i);
183
183
  }
@@ -185,38 +185,38 @@ function Gs(e) {
185
185
  if (Array.isArray(a))
186
186
  for (const i of a) {
187
187
  if (!X(i)) {
188
- r(v(i));
188
+ r(w(i));
189
189
  continue;
190
190
  }
191
- const c = N(
192
- v(i.field),
193
- v(i.parameter),
194
- v(i.param),
195
- v(i.path),
196
- v(i.name)
197
- ), l = N(
198
- v(i.message),
199
- v(i.error),
200
- v(i.detail),
201
- v(i.description)
191
+ const c = L(
192
+ w(i.field),
193
+ w(i.parameter),
194
+ w(i.param),
195
+ w(i.path),
196
+ w(i.name)
197
+ ), l = L(
198
+ w(i.message),
199
+ w(i.error),
200
+ w(i.detail),
201
+ w(i.description)
202
202
  );
203
203
  r(c && l ? `${c}: ${l}` : c || l);
204
204
  }
205
205
  else if (X(a))
206
206
  for (const [i, c] of Object.entries(a)) {
207
- const l = v(c);
207
+ const l = w(c);
208
208
  if (l) {
209
209
  r(`${i}: ${l}`);
210
210
  continue;
211
211
  }
212
212
  if (Array.isArray(c)) {
213
- const d = c.map((u) => v(u)).filter((u) => !!u).join(", ");
213
+ const d = c.map((u) => w(u)).filter((u) => !!u).join(", ");
214
214
  r(d ? `${i}: ${d}` : i);
215
215
  }
216
216
  }
217
217
  return Array.from(t).slice(0, 3);
218
218
  }
219
- const Ks = [
219
+ const Vs = [
220
220
  "error",
221
221
  "error_code",
222
222
  "error_tag",
@@ -227,13 +227,13 @@ const Ks = [
227
227
  "httpCode",
228
228
  "errorExtra"
229
229
  ];
230
- function Vs(e) {
231
- return e ? Ks.some((t) => e[t] !== void 0) : !1;
230
+ function Js(e) {
231
+ return e ? Vs.some((t) => e[t] !== void 0) : !1;
232
232
  }
233
233
  const qe = {
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
  };
236
- function Js(...e) {
236
+ function Xs(...e) {
237
237
  for (const t of e) {
238
238
  if (!t)
239
239
  continue;
@@ -244,16 +244,16 @@ function Js(...e) {
244
244
  return qe[o];
245
245
  }
246
246
  }
247
- function Xs(e) {
247
+ function Zs(e) {
248
248
  if (e.tag) {
249
249
  const t = qe[e.tag.toUpperCase()];
250
250
  if (t)
251
251
  return t;
252
252
  }
253
- return Js(...e.rawText ?? [], e.message, e.details);
253
+ return Xs(...e.rawText ?? [], e.message, e.details);
254
254
  }
255
- function Zs(e) {
256
- const t = Xs(e);
255
+ function Qs(e) {
256
+ const t = Zs(e);
257
257
  if (t)
258
258
  return t;
259
259
  const { statusCode: r } = e, o = e.fieldHints.length > 0;
@@ -266,7 +266,7 @@ function Xe(e) {
266
266
  t?.data,
267
267
  r?.responseData,
268
268
  r?.data
269
- ), a = N(
269
+ ), a = L(
270
270
  P(t?.httpStatusCode),
271
271
  P(t?.statusCode),
272
272
  P(t?.status),
@@ -276,39 +276,39 @@ function Xe(e) {
276
276
  P(n?.status),
277
277
  P(n?.httpCode),
278
278
  P(n?.http_code),
279
- Ee(v(t?.message)),
280
- Ee(v(r?.message)),
279
+ Ee(w(t?.message)),
280
+ Ee(w(r?.message)),
281
281
  Ee(typeof e == "string" ? e : void 0)
282
- ), i = N(
282
+ ), i = L(
283
283
  oe(n?.errorCode),
284
284
  oe(n?.error_code),
285
285
  oe(n?.code),
286
286
  oe(t?.errorCode),
287
287
  oe(t?.error_code),
288
288
  oe(t?.code)
289
- ), c = N(
290
- v(n?.errorTag),
291
- v(n?.error_tag),
292
- v(n?.tag),
293
- v(t?.errorTag),
294
- v(t?.error_tag),
295
- v(t?.tag)
289
+ ), c = L(
290
+ w(n?.errorTag),
291
+ w(n?.error_tag),
292
+ w(n?.tag),
293
+ w(t?.errorTag),
294
+ w(t?.error_tag),
295
+ w(t?.tag)
296
296
  ), l = [
297
- v(n?.error),
298
- v(n?.message),
297
+ w(n?.error),
298
+ w(n?.message),
299
299
  V(n?.message),
300
- v(t?.message),
301
- v(r?.message),
302
- e instanceof Error ? e.message : v(e)
303
- ].filter((m) => !!m), d = l.find((m) => !Be(m)) || l[0], u = N(
300
+ w(t?.message),
301
+ w(r?.message),
302
+ e instanceof Error ? e.message : w(e)
303
+ ].filter((m) => !!m), d = l.find((m) => !Be(m)) || l[0], u = L(
304
304
  V(n?.errorExtra),
305
305
  V(n?.error_extra),
306
306
  V(n?.details),
307
307
  V(n?.errorDetails),
308
308
  V(n?.errors),
309
309
  V(t?.details)
310
- ), p = Gs(n);
311
- return a !== void 0 || Vs(n) || c !== void 0 || i !== void 0 || (d ? Be(d) : !1) ? {
310
+ ), p = Ks(n);
311
+ return a !== void 0 || Js(n) || c !== void 0 || i !== void 0 || (d ? Be(d) : !1) ? {
312
312
  statusCode: a,
313
313
  code: i,
314
314
  tag: c ? U(c, 80) : void 0,
@@ -318,40 +318,40 @@ function Xe(e) {
318
318
  fieldHints: p
319
319
  } : null;
320
320
  }
321
- function Wt(e) {
321
+ function Bt(e) {
322
322
  const t = [];
323
323
  return e.statusCode !== void 0 && t.push(`HTTP ${e.statusCode}`), e.code !== void 0 && t.push(`code ${e.code}`), e.tag && t.push(`tag ${e.tag}`), t;
324
324
  }
325
- function Qs(e) {
326
- const t = Wt(e), r = [
325
+ function er(e) {
326
+ const t = Bt(e), r = [
327
327
  t.length > 0 ? `Todoist API request failed (${t.join(", ")}).` : "Todoist API request failed."
328
328
  ];
329
- return e.message && r.push(`Message: ${e.message}`), e.details && e.details !== e.message && r.push(`Details: ${e.details}`), e.fieldHints.length > 0 && r.push(`Field hints: ${e.fieldHints.join("; ")}`), r.push(`Try next: ${Zs(e)}`), r.join(`
329
+ return e.message && r.push(`Message: ${e.message}`), e.details && e.details !== e.message && r.push(`Details: ${e.details}`), e.fieldHints.length > 0 && r.push(`Field hints: ${e.fieldHints.join("; ")}`), r.push(`Try next: ${Qs(e)}`), r.join(`
330
330
  `);
331
331
  }
332
- function Bt(e) {
332
+ function qt(e) {
333
333
  return e instanceof Error ? U(e.message) : typeof e == "string" ? U(e) : "An unknown error occurred";
334
334
  }
335
- class ve extends Error {
335
+ class we extends Error {
336
336
  constructor(t) {
337
337
  super(t), this.name = "DueStringParseError";
338
338
  }
339
339
  }
340
- class qt extends Error {
340
+ class Yt extends Error {
341
341
  constructor(t) {
342
342
  super(t), this.name = "BatchDueStringParseError";
343
343
  }
344
344
  }
345
345
  function Y(e) {
346
- if (e instanceof ve)
346
+ if (e instanceof we)
347
347
  return e.message;
348
348
  const t = Xe(e);
349
349
  if (!t)
350
- return Bt(e);
351
- const r = Wt(t), o = t.message && !(r.length > 0 && Be(t.message)) ? t.message : "Todoist API request failed";
350
+ return qt(e);
351
+ const r = Bt(t), o = t.message && !(r.length > 0 && Be(t.message)) ? t.message : "Todoist API request failed";
352
352
  return r.length > 0 ? `${o} (${r.join(", ")})` : o;
353
353
  }
354
- function er(e, {
354
+ function tr(e, {
355
355
  taskContent: t,
356
356
  dueString: r,
357
357
  deadlineDate: o
@@ -364,14 +364,14 @@ function er(e, {
364
364
  const l = r.trim().replace(/^recurring(?:\s+|$)/i, "").trim();
365
365
  return l !== r.trim() && l ? `Task "${t}" wasn't created because \`dueString\` could not be parsed. Use Todoist recurrence syntax, for example \`${l}\`; don't prefix it with \`recurring\`. Change only \`dueString\` and retry.` : l !== r.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.`;
366
366
  }
367
- function tr(e) {
368
- if (e instanceof Es || e instanceof ve || e instanceof qt)
367
+ function sr(e) {
368
+ if (e instanceof Os || e instanceof we || e instanceof Yt)
369
369
  return e.message;
370
370
  const t = Xe(e);
371
- return t ? Qs(t) : Bt(e);
371
+ return t ? er(t) : qt(e);
372
372
  }
373
- const sr = "12.3.2", rr = {
374
- version: sr
373
+ const rr = "12.4.0", or = {
374
+ version: rr
375
375
  }, $ = {
376
376
  /** Default limit for task listings */
377
377
  TASKS_DEFAULT: 10,
@@ -406,7 +406,7 @@ const sr = "12.3.2", rr = {
406
406
  }, ge = {
407
407
  /** Maximum number of failures to show in detailed error messages */
408
408
  MAX_FAILURES_SHOWN: 3
409
- }, Yt = {
409
+ }, zt = {
410
410
  /** Maximum tasks accepted by one task create or update operation */
411
411
  TASKS_PER_OPERATION: 25
412
412
  }, Ye = {
@@ -474,58 +474,58 @@ function ft(e, { queueTimeoutMs: t = Ye.QUEUE_WAIT_MS } = {}) {
474
474
  }
475
475
  };
476
476
  }
477
- function zt() {
477
+ function Gt() {
478
478
  return {
479
479
  moves: ft(Ye.TASK_MOVES),
480
480
  writes: ft(Ye.WRITES)
481
481
  };
482
482
  }
483
- const bt = /* @__PURE__ */ new Map(), Gt = /* @__PURE__ */ new WeakMap();
483
+ const bt = /* @__PURE__ */ new Map(), Kt = /* @__PURE__ */ new WeakMap();
484
484
  let gt;
485
- function or() {
486
- return gt ??= zt(), gt;
485
+ function nr() {
486
+ return gt ??= Gt(), gt;
487
487
  }
488
- function nr(e) {
489
- return _t("sha256").update(e).digest("hex");
488
+ function ar(e) {
489
+ return Ut("sha256").update(e).digest("hex");
490
490
  }
491
- function ar(e, t) {
492
- const r = nr(t);
491
+ function ir(e, t) {
492
+ const r = ar(t);
493
493
  let o = bt.get(r);
494
- o || (o = zt(), bt.set(r, o)), Gt.set(e, o);
494
+ o || (o = Gt(), bt.set(r, o)), Kt.set(e, o);
495
495
  }
496
- function Kt(e) {
497
- return Gt.get(e) ?? or();
498
- }
499
- function ir(e) {
500
- return Kt(e).moves;
496
+ function Vt(e) {
497
+ return Kt.get(e) ?? nr();
501
498
  }
502
499
  function cr(e) {
503
- return Kt(e).writes;
500
+ return Vt(e).moves;
501
+ }
502
+ function dr(e) {
503
+ return Vt(e).writes;
504
504
  }
505
- const dr = "todoist-mcp", Ze = rr.version, Vt = new Os(), yt = Ps(import.meta.url);
505
+ const lr = "todoist-mcp", Ze = or.version, Jt = new Ps(), yt = Rs(import.meta.url);
506
506
  let ke;
507
- const lr = async () => {
508
- const e = yt.resolve("@doist/todoist-sdk"), t = Ue(Ut(e), "transport", "http-dispatcher.js");
507
+ const ur = async () => {
508
+ const e = yt.resolve("@doist/todoist-sdk"), t = Ue(Mt(e), "transport", "http-dispatcher.js");
509
509
  return yt(t);
510
510
  };
511
- let ur = lr;
512
- function pr() {
513
- return `${dr}/${Ze}`;
511
+ let pr = ur;
512
+ function hr() {
513
+ return `${lr}/${Ze}`;
514
514
  }
515
- function Jt(e) {
515
+ function Xt(e) {
516
516
  return e.trim().toLowerCase();
517
517
  }
518
- function hr(e, t) {
519
- return Vt.run(Jt(e), t);
518
+ function mr(e, t) {
519
+ return Jt.run(Xt(e), t);
520
520
  }
521
- function mr({
521
+ function fr({
522
522
  label: e,
523
523
  platform: t = "mcp",
524
524
  sessionId: r = _e()
525
525
  } = {}) {
526
- const o = e ? Jt(e) : Vt.getStore();
526
+ const o = e ? Xt(e) : Jt.getStore();
527
527
  return {
528
- "User-Agent": pr(),
528
+ "User-Agent": hr(),
529
529
  "doist-platform": t,
530
530
  "doist-version": Ze,
531
531
  "request-id": _e(),
@@ -533,16 +533,16 @@ function mr({
533
533
  "mcp-tool": o ?? "unknown"
534
534
  };
535
535
  }
536
- function fr(e, t) {
536
+ function br(e, t) {
537
537
  const r = new Headers(e);
538
- for (const [o, n] of Object.entries(mr(t)))
538
+ for (const [o, n] of Object.entries(fr(t)))
539
539
  r.set(o, n);
540
540
  return Object.fromEntries(r.entries());
541
541
  }
542
542
  function kt() {
543
543
  return new DOMException("The operation was aborted due to timeout", "TimeoutError");
544
544
  }
545
- function br(e, t) {
545
+ function gr(e, t) {
546
546
  if (!e && t === void 0)
547
547
  return {
548
548
  signal: void 0,
@@ -580,20 +580,20 @@ function br(e, t) {
580
580
  }
581
581
  };
582
582
  }
583
- async function gr() {
584
- if (yr())
585
- return ke || (ke = ur().then((e) => e.getDefaultDispatcher()).catch((e) => {
583
+ async function yr() {
584
+ if (kr())
585
+ return ke || (ke = pr().then((e) => e.getDefaultDispatcher()).catch((e) => {
586
586
  throw ke = void 0, e;
587
587
  })), ke;
588
588
  }
589
- function yr() {
589
+ function kr() {
590
590
  return typeof process < "u" && !!process.versions?.node;
591
591
  }
592
- async function kr(e) {
593
- const t = await gr();
592
+ async function Tr(e) {
593
+ const t = await yr();
594
594
  t !== void 0 && (e.dispatcher = t);
595
595
  }
596
- function Tr(e) {
596
+ function vr(e) {
597
597
  return {
598
598
  ok: e.ok,
599
599
  status: e.status,
@@ -607,33 +607,33 @@ function Tr(e) {
607
607
  function wr(e = globalThis.fetch, t = {}) {
608
608
  const r = e === globalThis.fetch, { enabled: o = !0, platform: n = "mcp", sessionId: a = _e() } = t;
609
609
  return async (i, c = {}) => {
610
- const { timeout: l, headers: d, signal: u, ...p } = c, { signal: h, cleanup: m } = br(u, l);
610
+ const { timeout: l, headers: d, signal: u, ...p } = c, { signal: h, cleanup: m } = gr(u, l);
611
611
  try {
612
- const y = {
612
+ const g = {
613
613
  ...p,
614
614
  signal: h,
615
- ...o ? { headers: fr(d, { platform: n, sessionId: a }) } : d !== void 0 ? { headers: d } : {}
615
+ ...o ? { headers: br(d, { platform: n, sessionId: a }) } : d !== void 0 ? { headers: d } : {}
616
616
  };
617
- r && await kr(y);
618
- const f = await e(i, y);
619
- return Tr(f);
617
+ r && await Tr(g);
618
+ const f = await e(i, g);
619
+ return vr(f);
620
620
  } finally {
621
621
  m();
622
622
  }
623
623
  };
624
624
  }
625
- function vr(e, {
625
+ function Ir(e, {
626
626
  baseUrl: t,
627
627
  tracking: r
628
628
  } = {}) {
629
- const o = new Rs(e, {
629
+ const o = new _s(e, {
630
630
  customFetch: wr(globalThis.fetch, r),
631
631
  ...t ? { baseUrl: t } : {}
632
632
  });
633
- return ar(o, e), o;
633
+ return ir(o, e), o;
634
634
  }
635
- const Ir = 2, jr = 500, Sr = 2e3, Cr = 50, $r = /* @__PURE__ */ new Set([502, 503, 504]);
636
- function Dr(e) {
635
+ const jr = 2, Sr = 500, Cr = 2e3, $r = 50, Dr = /* @__PURE__ */ new Set([502, 503, 504]);
636
+ function Ar(e) {
637
637
  if (e == null || typeof e != "object")
638
638
  return;
639
639
  const t = e;
@@ -649,32 +649,32 @@ function Dr(e) {
649
649
  return Number(r[1]);
650
650
  }
651
651
  }
652
- function Ar(e) {
653
- const t = Dr(e);
654
- return t !== void 0 && $r.has(t);
652
+ function xr(e) {
653
+ const t = Ar(e);
654
+ return t !== void 0 && Dr.has(t);
655
655
  }
656
- function xr({
656
+ function Er({
657
657
  attempt: e,
658
658
  baseDelayMs: t,
659
659
  maxDelayMs: r,
660
660
  random: o = Math.random
661
661
  }) {
662
662
  const n = Math.min(t * 2 ** e, r), a = Math.round(o() * n);
663
- return Math.min(n, Math.max(Cr, a));
663
+ return Math.min(n, Math.max($r, a));
664
664
  }
665
- function Er(e) {
665
+ function Or(e) {
666
666
  return new Promise((t) => setTimeout(t, e));
667
667
  }
668
668
  async function R(e, t = {}) {
669
- const r = t.maxRetries ?? Ir, o = t.baseDelayMs ?? jr, n = t.maxDelayMs ?? Sr, a = t.random;
669
+ const r = t.maxRetries ?? jr, o = t.baseDelayMs ?? Sr, n = t.maxDelayMs ?? Cr, a = t.random;
670
670
  let i;
671
671
  for (let c = 0; c <= r; c++)
672
672
  try {
673
673
  return await e();
674
674
  } catch (l) {
675
- if (i = l, c < r && Ar(l)) {
676
- const d = xr({ attempt: c, baseDelayMs: o, maxDelayMs: n, random: a });
677
- await Er(d);
675
+ if (i = l, c < r && xr(l)) {
676
+ const d = Er({ attempt: c, baseDelayMs: o, maxDelayMs: n, random: a });
677
+ await Or(d);
678
678
  continue;
679
679
  }
680
680
  throw l;
@@ -699,7 +699,7 @@ function ze(e) {
699
699
  }
700
700
  return e;
701
701
  }
702
- const g = {
702
+ const y = {
703
703
  // Task management tools
704
704
  ADD_TASKS: "add-tasks",
705
705
  COMPLETE_TASKS: "complete-tasks",
@@ -759,45 +759,45 @@ const g = {
759
759
  // OpenAI MCP tools
760
760
  SEARCH: "search",
761
761
  FETCH: "fetch"
762
- }, yd = {
762
+ }, Td = {
763
763
  /**
764
764
  * Strips email addresses from tool outputs that expose user data.
765
765
  * Affects: find-project-collaborators, find-completed-tasks
766
766
  */
767
767
  STRIP_EMAILS: "strip_emails"
768
- }, Or = process.env.USE_STRUCTURED_CONTENT === "true" || process.env.NODE_ENV === "test";
769
- function Pr({
768
+ }, Pr = process.env.USE_STRUCTURED_CONTENT === "true" || process.env.NODE_ENV === "test";
769
+ function Rr({
770
770
  textContent: e,
771
771
  structuredContent: t,
772
772
  contentItems: r
773
773
  }) {
774
774
  const o = ze(t), n = {}, a = [];
775
- return r && a.push(...r), !Or && t && a.push({
775
+ return r && a.push(...r), !Pr && t && a.push({
776
776
  type: "text",
777
777
  text: JSON.stringify(o)
778
778
  }), e && a.push({ type: "text", text: e }), a.length > 0 && (n.content = a), t && (n.structuredContent = o), n;
779
779
  }
780
- function Rr(e) {
780
+ function _r(e) {
781
781
  return {
782
782
  content: [{ type: "text", text: e }],
783
783
  isError: !0
784
784
  };
785
785
  }
786
- function _r(e) {
786
+ function Ur(e) {
787
787
  return { ...{
788
- title: `Todoist: ${Ur(e.name)}`,
788
+ title: `Todoist: ${Mr(e.name)}`,
789
789
  openWorldHint: !1
790
790
  }, ...e.annotations };
791
791
  }
792
- function Ur(e) {
792
+ function Mr(e) {
793
793
  return e.split("-").filter(Boolean).map((t) => `${t.charAt(0).toUpperCase()}${t.slice(1)}`).join(" ");
794
794
  }
795
- function Mr(e) {
795
+ function Nr(e) {
796
796
  return e ? typeof e["ui/resourceUri"] == "string" ? !0 : typeof e.ui == "object" && e.ui !== null : !1;
797
797
  }
798
- const Nr = [
799
- g.FIND_PROJECT_COLLABORATORS,
800
- g.FIND_COMPLETED_TASKS
798
+ const Lr = [
799
+ y.FIND_PROJECT_COLLABORATORS,
800
+ y.FIND_COMPLETED_TASKS
801
801
  ];
802
802
  function Ge(e) {
803
803
  if (e == null)
@@ -812,37 +812,37 @@ function Ge(e) {
812
812
  }
813
813
  return e;
814
814
  }
815
- function Lr(e) {
815
+ function Fr(e) {
816
816
  const t = /\s*\([^)]*@[^)]+\)/g, r = /\S+@\S+\.\S+/g;
817
817
  return e.replace(t, "").replace(r, "[email hidden]");
818
818
  }
819
- function w({
819
+ function v({
820
820
  tool: e,
821
821
  server: t,
822
822
  client: r,
823
823
  features: o = []
824
824
  }) {
825
- const n = o.some((c) => c.name === "strip_emails") && Nr.includes(e.name), a = async (c, l) => {
825
+ const n = o.some((c) => c.name === "strip_emails") && Lr.includes(e.name), a = async (c, l) => {
826
826
  try {
827
- let { textContent: d, structuredContent: u, contentItems: p } = await hr(
827
+ let { textContent: d, structuredContent: u, contentItems: p } = await mr(
828
828
  e.name,
829
829
  () => R(
830
830
  () => e.execute(c, r)
831
831
  )
832
832
  );
833
- return n && (d && (d = Lr(d)), u && (u = Ge(u))), Pr({ textContent: d, structuredContent: u, contentItems: p });
833
+ return n && (d && (d = Fr(d)), u && (u = Ge(u))), Rr({ textContent: d, structuredContent: u, contentItems: p });
834
834
  } catch (d) {
835
- return console.error(`Error executing tool ${e.name}:`, { args: c, error: d }), Rr(tr(d));
835
+ return console.error(`Error executing tool ${e.name}:`, { args: c, error: d }), _r(sr(d));
836
836
  }
837
837
  }, i = {
838
838
  description: e.description,
839
839
  inputSchema: e.parameters,
840
840
  ...e.outputSchema ? { outputSchema: e.outputSchema } : {},
841
- annotations: _r(e),
841
+ annotations: Ur(e),
842
842
  ...e._meta ? { _meta: e._meta } : {}
843
843
  };
844
- if (Mr(e._meta)) {
845
- xs(
844
+ if (Nr(e._meta)) {
845
+ Es(
846
846
  t,
847
847
  e.name,
848
848
  {
@@ -855,7 +855,7 @@ function w({
855
855
  }
856
856
  t.registerTool(e.name, i, a);
857
857
  }
858
- const Fr = {
858
+ const Hr = {
859
859
  period: s.enum(["today", "7d", "14d", "30d", "this-week", "this-month"]).default("7d").describe(
860
860
  '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.'
861
861
  ),
@@ -864,7 +864,7 @@ const Fr = {
864
864
  ),
865
865
  projectId: s.string().optional().describe("Optional project ID to scope the analysis to a specific project.")
866
866
  };
867
- function Hr(e, t = /* @__PURE__ */ new Date()) {
867
+ function Wr(e, t = /* @__PURE__ */ new Date()) {
868
868
  const r = (n) => n.toISOString().slice(0, 10), o = r(t);
869
869
  switch (e) {
870
870
  case "today":
@@ -911,7 +911,7 @@ function Hr(e, t = /* @__PURE__ */ new Date()) {
911
911
  }
912
912
  }
913
913
  }
914
- function Wr(e) {
914
+ function Br(e) {
915
915
  const t = {
916
916
  goals: `### Goal Tracking
917
917
  - Compare tasks completed today vs the daily goal
@@ -942,8 +942,8 @@ function Wr(e) {
942
942
 
943
943
  `) : t[e] ?? "";
944
944
  }
945
- function Br(e) {
946
- const { since: t, until: r, periodDescription: o } = Hr(e.period), n = e.projectId ? `
945
+ function qr(e) {
946
+ const { since: t, until: r, periodDescription: o } = Wr(e.period), n = e.projectId ? `
947
947
  Scope this analysis to project ID: ${e.projectId}. Pass this projectId when calling find-completed-tasks and get-overview.` : "";
948
948
  return `Analyze my Todoist productivity for ${o} (${t} to ${r}).${n}
949
949
 
@@ -964,7 +964,7 @@ ${e.focus === "overall" || e.focus === "projects" ? `4. **get-overview** — Get
964
964
 
965
965
  Using the collected data, produce an analysis covering the following sections:
966
966
 
967
- ${Wr(e.focus)}
967
+ ${Br(e.focus)}
968
968
 
969
969
  ### Step 3: Format
970
970
 
@@ -974,14 +974,14 @@ Present the analysis as a clear, well-structured markdown report with:
974
974
  - Specific numbers and comparisons (not vague statements)
975
975
  - Actionable takeaways highlighted clearly`;
976
976
  }
977
- function qr(e) {
977
+ function Yr(e) {
978
978
  return {
979
979
  messages: [
980
980
  {
981
981
  role: "user",
982
982
  content: {
983
983
  type: "text",
984
- text: Br(e)
984
+ text: qr(e)
985
985
  }
986
986
  }
987
987
  ]
@@ -991,15 +991,15 @@ const be = {
991
991
  name: "productivity-analysis",
992
992
  title: "Productivity Analysis",
993
993
  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.",
994
- argsSchema: Fr,
995
- callback: qr
994
+ argsSchema: Hr,
995
+ callback: Yr
996
996
  };
997
997
  class _ extends Error {
998
998
  constructor(t, r) {
999
999
  super(`Invalid duration format "${t}": ${r}`), this.name = "DurationParseError";
1000
1000
  }
1001
1001
  }
1002
- function Xt(e) {
1002
+ function Zt(e) {
1003
1003
  if (!e || typeof e != "string")
1004
1004
  throw new _(e, "Duration must be a non-empty string");
1005
1005
  const t = e.trim().toLowerCase().replace(/\s+/g, "");
@@ -1033,20 +1033,20 @@ function Xt(e) {
1033
1033
  throw new _(e, "Duration cannot exceed 24 hours (1440 minutes)");
1034
1034
  return { minutes: o };
1035
1035
  }
1036
- function Yr(e) {
1036
+ function zr(e) {
1037
1037
  if (e <= 0) return "0m";
1038
1038
  const t = Math.floor(e / 60), r = e % 60;
1039
1039
  return t === 0 ? `${r}m` : r === 0 ? `${t}h` : `${t}h${r}m`;
1040
1040
  }
1041
- const zr = ["p1", "p2", "p3", "p4"], Qe = 'Task priority as a string: "p1" (highest), "p2" (high), "p3" (medium), or "p4" (lowest/default). Integers like 1, 2, 3, or 4 are not accepted.', et = s.enum(zr).describe(Qe);
1042
- function Zt(e) {
1041
+ const Gr = ["p1", "p2", "p3", "p4"], Qe = 'Task priority as a string: "p1" (highest), "p2" (high), "p3" (medium), or "p4" (lowest/default). Integers like 1, 2, 3, or 4 are not accepted.', et = s.enum(Gr).describe(Qe);
1042
+ function Qt(e) {
1043
1043
  return { p1: 4, p2: 3, p3: 2, p4: 1 }[e];
1044
1044
  }
1045
- function Gr(e) {
1045
+ function Kr(e) {
1046
1046
  return { 4: "p1", 3: "p2", 2: "p3", 1: "p4" }[e];
1047
1047
  }
1048
- const O = /* @__PURE__ */ new Map(), ne = /* @__PURE__ */ new Map(), Oe = 300 * 1e3, Kr = "me";
1049
- class Vr {
1048
+ const O = /* @__PURE__ */ new Map(), ne = /* @__PURE__ */ new Map(), Oe = 300 * 1e3, Vr = "me";
1049
+ class Jr {
1050
1050
  /**
1051
1051
  * Resolve a user name or ID to a user ID by looking up collaborators across all shared projects.
1052
1052
  * Supports exact name matches, partial matches, email matches, and the "me" keyword.
@@ -1057,7 +1057,7 @@ class Vr {
1057
1057
  const o = r.trim(), n = O.get(o);
1058
1058
  if (n && Date.now() - n.timestamp < Oe)
1059
1059
  return n.result;
1060
- if (o.toLowerCase() === Kr)
1060
+ if (o.toLowerCase() === Vr)
1061
1061
  try {
1062
1062
  const a = await t.getUser();
1063
1063
  return {
@@ -1151,7 +1151,7 @@ class Vr {
1151
1151
  if (o && Date.now() - o.timestamp < Oe)
1152
1152
  return o.result;
1153
1153
  try {
1154
- const a = (await F({
1154
+ const a = (await H({
1155
1155
  apiMethod: t.getProjects.bind(t),
1156
1156
  args: {}
1157
1157
  })).filter((u) => u.isShared);
@@ -1181,15 +1181,15 @@ class Vr {
1181
1181
  O.clear(), ne.clear();
1182
1182
  }
1183
1183
  }
1184
- const B = new Vr();
1185
- async function Jr(e, t) {
1184
+ const B = new Jr();
1185
+ async function Xr(e, t) {
1186
1186
  return B.resolveUser(e, t);
1187
1187
  }
1188
- const Qt = ["assigned", "unassignedOrMe", "all"];
1188
+ const es = ["assigned", "unassignedOrMe", "all"];
1189
1189
  async function tt(e, t) {
1190
1190
  if (!t)
1191
1191
  return;
1192
- const r = await Jr(e, t);
1192
+ const r = await Xr(e, t);
1193
1193
  if (!r)
1194
1194
  throw new Error(
1195
1195
  `Could not find user: "${t}". Make sure the user is a collaborator on a shared project.`
@@ -1199,14 +1199,14 @@ async function tt(e, t) {
1199
1199
  function de(e, t) {
1200
1200
  return t.length === 0 ? e : e.length === 0 ? t : `${e} & ${t}`;
1201
1201
  }
1202
- function es({
1202
+ function ts({
1203
1203
  resolvedAssigneeId: e,
1204
1204
  assigneeEmail: t,
1205
1205
  responsibleUserFiltering: r = "unassignedOrMe"
1206
1206
  }) {
1207
1207
  return e && t ? `assigned to: ${t}` : r === "unassignedOrMe" ? "!assigned to: others" : r === "assigned" ? "assigned to: others" : "";
1208
1208
  }
1209
- function Xr({
1209
+ function Zr({
1210
1210
  tasks: e,
1211
1211
  resolvedAssigneeId: t,
1212
1212
  currentUserId: r,
@@ -1214,19 +1214,19 @@ function Xr({
1214
1214
  }) {
1215
1215
  return t ? e.filter((n) => n.responsibleUid === t) : o === "unassignedOrMe" ? e.filter((n) => !n.responsibleUid || n.responsibleUid === r) : o === "assigned" ? e.filter((n) => n.responsibleUid && n.responsibleUid !== r) : e;
1216
1216
  }
1217
- function L(e) {
1217
+ function F(e) {
1218
1218
  return e?.toLowerCase() === "inbox";
1219
1219
  }
1220
1220
  async function ue(e) {
1221
1221
  const { projectId: t, user: r, client: o } = e;
1222
- if (!L(t))
1222
+ if (!F(t))
1223
1223
  return t;
1224
1224
  const n = r || (o ? await o.getUser() : null);
1225
1225
  if (!n)
1226
1226
  throw new Error("Either user or client must be provided when resolving inbox project ID");
1227
1227
  return n.inboxProjectId;
1228
1228
  }
1229
- async function F(e) {
1229
+ async function H(e) {
1230
1230
  const { apiMethod: t, args: r, limit: o = 100 } = e, n = [];
1231
1231
  let a = null;
1232
1232
  do {
@@ -1242,28 +1242,28 @@ async function F(e) {
1242
1242
  function st(e) {
1243
1243
  return /(?<!\\)(?:\\\\)*\*/.test(e) ? e : `*${e.replaceAll(/\\(?!\*)/g, "\\\\")}*`;
1244
1244
  }
1245
- async function ts(e, t) {
1246
- return F({
1245
+ async function ss(e, t) {
1246
+ return H({
1247
1247
  apiMethod: e.searchProjects.bind(e),
1248
1248
  args: { query: st(t) },
1249
1249
  limit: $.PROJECTS_MAX
1250
1250
  });
1251
1251
  }
1252
- async function ss(e) {
1253
- return F({
1252
+ async function rs(e) {
1253
+ return H({
1254
1254
  apiMethod: e.getProjects.bind(e),
1255
1255
  args: {},
1256
1256
  limit: $.PROJECTS_MAX
1257
1257
  });
1258
1258
  }
1259
- async function Zr(e) {
1260
- return F({
1259
+ async function Qr(e) {
1260
+ return H({
1261
1261
  apiMethod: e.getArchivedProjects.bind(e),
1262
1262
  args: {},
1263
1263
  limit: $.PROJECTS_MAX
1264
1264
  });
1265
1265
  }
1266
- function Qr(e) {
1266
+ function eo(e) {
1267
1267
  const t = (a) => a.replaceAll(/[.*+?^${}()|[\]\\]/g, "\\$&"), r = /(?<!\\)(?:\\\\)*\*/.test(e), o = [...e];
1268
1268
  let n = "";
1269
1269
  for (let a = 0; a < o.length; a++) {
@@ -1272,23 +1272,23 @@ function Qr(e) {
1272
1272
  }
1273
1273
  return new RegExp(r ? `^${n}$` : n, "iu");
1274
1274
  }
1275
- async function eo(e, t) {
1276
- return F({
1275
+ async function to(e, t) {
1276
+ return H({
1277
1277
  apiMethod: e.searchLabels.bind(e),
1278
1278
  args: { query: st(t) },
1279
1279
  limit: $.LABELS_MAX
1280
1280
  });
1281
1281
  }
1282
- async function to(e) {
1283
- return F({
1282
+ async function so(e) {
1283
+ return H({
1284
1284
  apiMethod: e.getSharedLabels.bind(e),
1285
1285
  args: {},
1286
1286
  limit: $.LABELS_MAX
1287
1287
  });
1288
1288
  }
1289
- async function so(e, t, r) {
1289
+ async function ro(e, t, r) {
1290
1290
  const o = st(t);
1291
- return F({
1291
+ return H({
1292
1292
  apiMethod: e.searchSections.bind(e),
1293
1293
  args: r ? { query: o, projectId: r } : { query: o },
1294
1294
  limit: $.SECTIONS_MAX
@@ -1302,12 +1302,12 @@ function M(e) {
1302
1302
  dueDate: e.due?.date,
1303
1303
  recurring: e.due?.isRecurring && e.due.string ? e.due.string : !1,
1304
1304
  deadlineDate: e.deadline?.date,
1305
- priority: Gr(e.priority) ?? "p4",
1305
+ priority: Kr(e.priority) ?? "p4",
1306
1306
  projectId: e.projectId,
1307
1307
  sectionId: e.sectionId ?? void 0,
1308
1308
  parentId: e.parentId ?? void 0,
1309
1309
  labels: e.labels,
1310
- duration: e.duration ? Yr(e.duration.amount) : void 0,
1310
+ duration: e.duration ? zr(e.duration.amount) : void 0,
1311
1311
  responsibleUid: e.responsibleUid ?? void 0,
1312
1312
  assignedByUid: e.assignedByUid ?? void 0,
1313
1313
  checked: e.checked,
@@ -1356,7 +1356,7 @@ function Ie(e) {
1356
1356
  } : void 0
1357
1357
  };
1358
1358
  }
1359
- function ro(e) {
1359
+ function oo(e) {
1360
1360
  return {
1361
1361
  id: e.id ?? void 0,
1362
1362
  objectType: e.objectType,
@@ -1369,7 +1369,7 @@ function ro(e) {
1369
1369
  extraData: e.extraData ?? void 0
1370
1370
  };
1371
1371
  }
1372
- const oo = re.object({
1372
+ const no = re.object({
1373
1373
  httpStatusCode: re.number(),
1374
1374
  responseData: re.object({
1375
1375
  error: re.string(),
@@ -1387,7 +1387,7 @@ async function rt({
1387
1387
  const { results: n, nextCursor: a } = await e.getTasksByFilter({ query: t, cursor: o, limit: r });
1388
1388
  return { tasks: n.map(M), nextCursor: a };
1389
1389
  } catch (n) {
1390
- const a = oo.safeParse(n);
1390
+ const a = no.safeParse(n);
1391
1391
  if (!a.success)
1392
1392
  throw n;
1393
1393
  const { responseData: i } = a.data;
@@ -1436,19 +1436,19 @@ function ye(e) {
1436
1436
  };
1437
1437
  }
1438
1438
  }
1439
- function rs(e) {
1439
+ function os(e) {
1440
1440
  const t = e.filter(
1441
1441
  (o) => o.type === "relative" || o.type === "absolute"
1442
1442
  ).length, r = e.filter((o) => o.type === "location").length;
1443
1443
  return { timeBasedCount: t, locationCount: r };
1444
1444
  }
1445
1445
  const je = Me.map((e) => e.key);
1446
- function no(e) {
1446
+ function ao(e) {
1447
1447
  if (typeof e != "string") return;
1448
1448
  const t = e.toLowerCase();
1449
1449
  return (Me.find((o) => o.key === t) ?? Me.find((o) => o.displayName.toLowerCase() === t))?.key;
1450
1450
  }
1451
- const ao = `Color for the entity. Accepts a color key (e.g. "berry_red") or display name (e.g. "Berry Red"). Valid colors: ${je.join(", ")}. Unrecognized colors are omitted and charcoal will be used as the default.`, pe = s.preprocess(no, s.enum(je).optional()).describe(ao);
1451
+ const io = `Color for the entity. Accepts a color key (e.g. "berry_red") or display name (e.g. "Berry Red"). Valid colors: ${je.join(", ")}. Unrecognized colors are omitted and charcoal will be used as the default.`, pe = s.preprocess(ao, s.enum(je).optional()).describe(io);
1452
1452
  s.enum(je).describe("The color key of the entity.");
1453
1453
  const he = s.enum(je).optional().catch(void 0).describe("The color key of the entity."), z = s.object({
1454
1454
  id: s.string().describe("The unique ID of the task."),
@@ -1496,7 +1496,7 @@ const he = s.enum(je).optional().catch(void 0).describe("The color key of the en
1496
1496
  function ee({ id: e, name: t, sectionOrder: r, description: o }) {
1497
1497
  return { id: e, name: t, sectionOrder: r, description: o ?? void 0 };
1498
1498
  }
1499
- const io = s.object({
1499
+ const co = s.object({
1500
1500
  resourceType: s.string().describe("The type of resource (file, url, image, etc)."),
1501
1501
  fileName: s.string().optional().describe("The name of the file."),
1502
1502
  fileSize: s.number().optional().describe("The size of the file in bytes."),
@@ -1516,8 +1516,8 @@ const io = s.object({
1516
1516
  content: s.string().describe("The content of the comment."),
1517
1517
  postedAt: s.string().describe("When the comment was posted (ISO 8601 format)."),
1518
1518
  postedUid: s.string().optional().describe("The UID of the user who posted this comment."),
1519
- fileAttachment: io.optional().describe("File attachment information, if any.")
1520
- }), co = s.object({
1519
+ fileAttachment: co.optional().describe("File attachment information, if any.")
1520
+ }), lo = s.object({
1521
1521
  id: s.string().optional().describe("The unique ID of the activity event."),
1522
1522
  objectType: s.string().describe("The type of object this event relates to (task, project, etc)."),
1523
1523
  objectId: s.string().describe("The ID of the object this event relates to."),
@@ -1527,7 +1527,7 @@ const io = s.object({
1527
1527
  parentItemId: s.string().optional().describe("The ID of the parent item."),
1528
1528
  initiatorId: s.string().optional().describe("The ID of the user who initiated this event."),
1529
1529
  extraData: s.record(s.string(), s.unknown()).optional().describe("Additional event data.")
1530
- }), lo = s.object({
1530
+ }), uo = s.object({
1531
1531
  id: s.string().describe("The unique ID of the user."),
1532
1532
  name: s.string().describe("The full name of the user."),
1533
1533
  email: s.string().describe("The email address of the user.")
@@ -1537,7 +1537,7 @@ const io = s.object({
1537
1537
  color: he,
1538
1538
  order: s.number().optional().catch(void 0).describe("The display order of the label."),
1539
1539
  isFavorite: s.boolean().describe("Whether the label is marked as favorite.")
1540
- }), uo = s.object({
1540
+ }), po = s.object({
1541
1541
  isRecurring: s.boolean().describe("Whether this is a recurring reminder."),
1542
1542
  string: s.string().describe("Human-readable due string."),
1543
1543
  date: s.string().describe("Due date in ISO format."),
@@ -1546,38 +1546,38 @@ const io = s.object({
1546
1546
  }), ot = s.object({
1547
1547
  id: s.string().describe("The unique ID of the reminder."),
1548
1548
  taskId: s.string().describe("The task ID this reminder belongs to."),
1549
- type: s.enum(_s).describe("The type of reminder: relative, absolute, or location."),
1549
+ type: s.enum(Us).describe("The type of reminder: relative, absolute, or location."),
1550
1550
  minuteOffset: s.number().optional().describe("Minutes before due time to trigger (relative reminders only)."),
1551
- due: uo.optional().describe(
1551
+ due: po.optional().describe(
1552
1552
  "Due date info (absolute and sometimes relative reminders)."
1553
1553
  ),
1554
1554
  name: s.string().optional().describe("Location name (location reminders only)."),
1555
1555
  locLat: s.string().optional().describe("Latitude (location reminders only)."),
1556
1556
  locLong: s.string().optional().describe("Longitude (location reminders only)."),
1557
- locTrigger: s.enum(Nt).optional().describe("Trigger type: on_enter or on_leave (location reminders only)."),
1557
+ locTrigger: s.enum(Lt).optional().describe("Trigger type: on_enter or on_leave (location reminders only)."),
1558
1558
  radius: s.number().optional().describe("Geofence radius in meters (location reminders only)."),
1559
1559
  isUrgent: s.boolean().optional().describe("Whether this is an urgent reminder (relative and absolute reminders only).")
1560
1560
  }), te = s.object({
1561
1561
  item: s.string().describe("The item that failed (usually an ID or identifier)."),
1562
1562
  error: s.string().describe("The error message."),
1563
1563
  code: s.string().optional().describe("The error code, if available.")
1564
- }), po = s.object({
1564
+ }), ho = s.object({
1565
1565
  taskId: s.string().optional().describe("The ID of the task to comment on."),
1566
1566
  projectId: s.string().optional().describe(
1567
1567
  'The ID of the project to comment on. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
1568
1568
  ),
1569
1569
  content: s.string().min(1).describe("The content of the comment.")
1570
- }), ho = {
1571
- comments: s.array(po).min(1).describe("The array of comments to add.")
1572
- }, mo = {
1570
+ }), mo = {
1571
+ comments: s.array(ho).min(1).describe("The array of comments to add.")
1572
+ }, fo = {
1573
1573
  comments: s.array(Se).describe("The created comments."),
1574
1574
  totalCount: s.number().describe("The total number of comments created."),
1575
1575
  addedCommentIds: s.array(s.string()).describe("The IDs of the added comments.")
1576
- }, fo = {
1577
- name: g.ADD_COMMENTS,
1576
+ }, bo = {
1577
+ name: y.ADD_COMMENTS,
1578
1578
  description: "Add multiple comments to tasks or projects. Each comment must specify either taskId or projectId.",
1579
- parameters: ho,
1580
- outputSchema: mo,
1579
+ parameters: mo,
1580
+ outputSchema: fo,
1581
1581
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
1582
1582
  async execute(e, t) {
1583
1583
  const { comments: r } = e;
@@ -1591,7 +1591,7 @@ const io = s.object({
1591
1591
  `Comment ${d + 1}: Cannot provide both taskId and projectId. Choose one.`
1592
1592
  );
1593
1593
  }
1594
- const n = r.some((d) => L(d.projectId)) ? await t.getUser() : void 0, a = r.map(async ({ content: d, taskId: u, projectId: p }) => {
1594
+ const n = r.some((d) => F(d.projectId)) ? await t.getUser() : void 0, a = r.map(async ({ content: d, taskId: u, projectId: p }) => {
1595
1595
  const h = await ue({
1596
1596
  projectId: p,
1597
1597
  user: n,
@@ -1603,7 +1603,7 @@ const io = s.object({
1603
1603
  });
1604
1604
  }), c = (await Promise.all(a)).map(Ie);
1605
1605
  return {
1606
- textContent: bo({ comments: c }),
1606
+ textContent: go({ comments: c }),
1607
1607
  structuredContent: {
1608
1608
  comments: c,
1609
1609
  totalCount: c.length,
@@ -1612,7 +1612,7 @@ const io = s.object({
1612
1612
  };
1613
1613
  }
1614
1614
  };
1615
- function bo({ comments: e }) {
1615
+ function go({ comments: e }) {
1616
1616
  const t = e.filter((a) => a.taskId).length, r = e.filter((a) => a.projectId).length, o = [];
1617
1617
  if (t > 0) {
1618
1618
  const a = t > 1 ? "comments" : "comment";
@@ -1624,7 +1624,7 @@ function bo({ comments: e }) {
1624
1624
  }
1625
1625
  return o.length > 0 ? `Added ${o.join(" and ")}` : "No comments added";
1626
1626
  }
1627
- const go = {
1627
+ const yo = {
1628
1628
  search: s.string().optional().describe(
1629
1629
  "Search for a filter by name (partial and case insensitive match). If omitted, all filters are returned."
1630
1630
  )
@@ -1635,14 +1635,14 @@ const go = {
1635
1635
  color: he,
1636
1636
  isFavorite: s.boolean().describe("Whether the filter is marked as favorite."),
1637
1637
  itemOrder: s.number().describe("The display order of the filter.")
1638
- }), yo = {
1638
+ }), ko = {
1639
1639
  filters: s.array(nt).describe("The found filters."),
1640
1640
  totalCount: s.number().describe("The total number of filters returned.")
1641
- }, ko = {
1642
- name: g.FIND_FILTERS,
1641
+ }, To = {
1642
+ name: y.FIND_FILTERS,
1643
1643
  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").',
1644
- parameters: go,
1645
- outputSchema: yo,
1644
+ parameters: yo,
1645
+ outputSchema: ko,
1646
1646
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
1647
1647
  async execute(e, t) {
1648
1648
  let o = ((await t.sync({ resourceTypes: ["filters"], syncToken: "*" })).filters ?? []).filter((i) => !i.isDeleted);
@@ -1660,7 +1660,7 @@ const go = {
1660
1660
  itemOrder: i.itemOrder
1661
1661
  }));
1662
1662
  return {
1663
- textContent: To({ filters: n, search: e.search }),
1663
+ textContent: vo({ filters: n, search: e.search }),
1664
1664
  structuredContent: {
1665
1665
  filters: n,
1666
1666
  totalCount: n.length
@@ -1668,13 +1668,13 @@ const go = {
1668
1668
  };
1669
1669
  }
1670
1670
  };
1671
- function To({
1671
+ function vo({
1672
1672
  filters: e,
1673
1673
  search: t
1674
1674
  }) {
1675
1675
  const r = t ? `Filters matching "${t}"` : "Filters";
1676
1676
  if (e.length === 0) {
1677
- 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`];
1677
+ 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`];
1678
1678
  return `${r}: 0 found
1679
1679
 
1680
1680
  Suggestions:
@@ -1696,16 +1696,16 @@ const wo = s.object({
1696
1696
  ),
1697
1697
  color: pe,
1698
1698
  isFavorite: s.boolean().optional().describe("Whether to mark the filter as a favorite. Defaults to false.")
1699
- }), vo = {
1699
+ }), Io = {
1700
1700
  filters: s.array(wo).min(1).describe("The array of filters to add.")
1701
- }, Io = {
1701
+ }, jo = {
1702
1702
  filters: s.array(nt).describe("The created filters."),
1703
1703
  totalCount: s.number().describe("The total number of filters created.")
1704
- }, jo = {
1705
- name: g.ADD_FILTERS,
1704
+ }, So = {
1705
+ name: y.ADD_FILTERS,
1706
1706
  description: "Add one or more new personal filters. Filters are saved custom views using query syntax to organize tasks.",
1707
- parameters: vo,
1708
- outputSchema: Io,
1707
+ parameters: Io,
1708
+ outputSchema: jo,
1709
1709
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
1710
1710
  async execute({ filters: e }, t) {
1711
1711
  const r = Date.now(), o = e.map((p, h) => `tempFilterAdd${h}${r}`), n = e.map((p, h) => J(
@@ -1718,11 +1718,11 @@ const wo = s.object({
1718
1718
  },
1719
1719
  o[h]
1720
1720
  )), i = (await t.sync({ commands: n })).tempIdMapping ?? {}, c = e.map((p, h) => {
1721
- const m = o[h], y = m !== void 0 ? i[m] : void 0;
1722
- if (!y) return null;
1721
+ const m = o[h], g = m !== void 0 ? i[m] : void 0;
1722
+ if (!g) return null;
1723
1723
  const f = p.color !== void 0 ? he.parse(p.color) : void 0;
1724
1724
  return {
1725
- id: y,
1725
+ id: g,
1726
1726
  name: p.name,
1727
1727
  query: p.query,
1728
1728
  color: f,
@@ -1740,26 +1740,26 @@ ${d}`,
1740
1740
  }
1741
1741
  };
1742
1742
  }
1743
- }, So = s.object({
1743
+ }, Co = s.object({
1744
1744
  name: s.string().min(1).max(128).describe("The name of the label."),
1745
1745
  color: pe,
1746
1746
  order: s.number().int().optional().describe("The position of the label in the label list."),
1747
1747
  isFavorite: s.boolean().optional().describe("Whether the label is a favorite. Defaults to false.")
1748
- }), Co = {
1749
- labels: s.array(So).min(1).describe("The array of labels to add.")
1750
- }, $o = {
1748
+ }), $o = {
1749
+ labels: s.array(Co).min(1).describe("The array of labels to add.")
1750
+ }, Do = {
1751
1751
  labels: s.array(me).describe("The created labels."),
1752
1752
  totalCount: s.number().describe("The total number of labels created.")
1753
- }, Do = {
1754
- name: g.ADD_LABELS,
1753
+ }, Ao = {
1754
+ name: y.ADD_LABELS,
1755
1755
  description: "Add one or more new personal labels.",
1756
- parameters: Co,
1757
- outputSchema: $o,
1756
+ parameters: $o,
1757
+ outputSchema: Do,
1758
1758
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
1759
1759
  async execute({ labels: e }, t) {
1760
1760
  const r = await Promise.all(e.map((n) => t.addLabel(n)));
1761
1761
  return {
1762
- textContent: Ao({ labels: r }),
1762
+ textContent: xo({ labels: r }),
1763
1763
  structuredContent: {
1764
1764
  labels: r.map((n) => me.parse(n)),
1765
1765
  totalCount: r.length
@@ -1767,7 +1767,7 @@ ${d}`,
1767
1767
  };
1768
1768
  }
1769
1769
  };
1770
- function Ao({ labels: e }) {
1770
+ function xo({ labels: e }) {
1771
1771
  const t = e.length, r = e.map((o) => `• ${o.name} (id=${o.id})`).join(`
1772
1772
  `);
1773
1773
  return `Added ${t} label${t === 1 ? "" : "s"}:
@@ -1817,20 +1817,20 @@ function ct(e, t) {
1817
1817
  Failed (${t.length}) - address or drop these items:
1818
1818
  ${n}${a}`;
1819
1819
  }
1820
- function xo(e) {
1820
+ function Eo(e) {
1821
1821
  const t = e.content || e.title || "Untitled", r = e.dueDate ? ` • due ${e.dueDate}` : "", o = e.priority ? ` • ${e.priority.toUpperCase()}` : "", n = e.projectName ? ` • ${e.projectName}` : "", a = e.id ? ` • id=${e.id}` : "";
1822
1822
  return ` ${t}${r}${o}${n}${a}`;
1823
1823
  }
1824
- function Eo(e) {
1824
+ function Oo(e) {
1825
1825
  const t = ` (${e.color})`, r = e.isFavorite ? " • ⭐" : "", o = ` • id=${e.id}`;
1826
1826
  return ` ${e.name}${t}${r}${o}`;
1827
1827
  }
1828
- function Oo(e) {
1828
+ function Po(e) {
1829
1829
  const t = e.inboxProject ? " • Inbox" : "", r = e.isFavorite ? " • ⭐" : "", o = e.isShared ? " • Shared" : "", n = e.isArchived ? " • Archived" : "", a = e.viewStyle && e.viewStyle !== "list" ? ` • ${e.viewStyle}` : "", i = ` • id=${e.id}`;
1830
1830
  return ` ${e.name}${t}${r}${o}${n}${a}${i}`;
1831
1831
  }
1832
1832
  function Ce(e, t = 5) {
1833
- const o = e.slice(0, t).map(xo).join(`
1833
+ const o = e.slice(0, t).map(Eo).join(`
1834
1834
  `);
1835
1835
  if (e.length > t) {
1836
1836
  const n = e.length - t;
@@ -1851,25 +1851,25 @@ function G({
1851
1851
  }) {
1852
1852
  const l = [], d = `${e}: ${t}${typeof r == "number" ? ` (limit ${r})` : ""}${o ? ", more available" : ""}.`;
1853
1853
  return l.push(d), n?.length && l.push(`Filter: ${n.join("; ")}.`), a?.length && l.push(`Preview:
1854
- ${a}`), !t && i?.length && l.push(`No results. ${i.join("; ")}.`), (c?.length || o) && l.push(os(c || [], o)), l.join(`
1854
+ ${a}`), !t && i?.length && l.push(`No results. ${i.join("; ")}.`), (c?.length || o) && l.push(ns(c || [], o)), l.join(`
1855
1855
  `);
1856
1856
  }
1857
- function os(e, t) {
1857
+ function ns(e, t) {
1858
1858
  const r = [...e];
1859
1859
  return t && r.push(`Pass cursor '${t}' to fetch more results.`), `${r.length === 1 ? "Possible suggested next step:" : "Possible suggested next steps:"}
1860
1860
  ${r.map((n) => `- ${n}`).join(`
1861
1861
  `)}`;
1862
1862
  }
1863
- const Po = 300 * 1e3;
1864
- function Ro(e) {
1863
+ const Ro = 300 * 1e3;
1864
+ function _o(e) {
1865
1865
  return /^\d+$/.test(e);
1866
1866
  }
1867
- class _o {
1867
+ class Uo {
1868
1868
  constructor() {
1869
1869
  this.cache = null, this.inFlightWorkspaces = null;
1870
1870
  }
1871
1871
  async getWorkspaces(t) {
1872
- if (this.cache && Date.now() - this.cache.timestamp < Po)
1872
+ if (this.cache && Date.now() - this.cache.timestamp < Ro)
1873
1873
  return this.cache.workspaces;
1874
1874
  if (this.inFlightWorkspaces)
1875
1875
  return this.inFlightWorkspaces;
@@ -1896,7 +1896,7 @@ class _o {
1896
1896
  const n = await this.getWorkspaces(t), a = n.find((u) => u.id === o);
1897
1897
  if (a)
1898
1898
  return { workspaceId: a.id, workspaceName: a.name };
1899
- if (Ro(o))
1899
+ if (_o(o))
1900
1900
  return { workspaceId: o, workspaceName: o };
1901
1901
  const i = o.toLowerCase(), c = n.find((u) => u.name.toLowerCase() === i);
1902
1902
  if (c)
@@ -1924,7 +1924,7 @@ ${u}` + (l.length > 5 ? `
1924
1924
  this.cache = null;
1925
1925
  }
1926
1926
  }
1927
- const ns = new _o(), Uo = s.object({
1927
+ const as = new Uo(), Mo = s.object({
1928
1928
  name: s.string().min(1).describe("The name of the project."),
1929
1929
  parentId: s.string().optional().describe("The ID of the parent project. If provided, creates this as a sub-project."),
1930
1930
  isFavorite: s.boolean().optional().describe("Whether the project is a favorite. Defaults to false."),
@@ -1934,9 +1934,9 @@ const ns = new _o(), Uo = s.object({
1934
1934
  workspace: s.string().trim().min(1).optional().describe(
1935
1935
  "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."
1936
1936
  )
1937
- }), Mo = {
1938
- projects: s.array(Uo).min(1).describe("The array of projects to add.")
1939
- }, No = {
1937
+ }), No = {
1938
+ projects: s.array(Mo).min(1).describe("The array of projects to add.")
1939
+ }, Lo = {
1940
1940
  projects: s.array(Q).describe("The created projects."),
1941
1941
  totalCount: s.number().describe("The total number of projects created."),
1942
1942
  failures: s.array(te).describe(
@@ -1945,11 +1945,11 @@ const ns = new _o(), Uo = s.object({
1945
1945
  totalRequested: s.number().describe("The total number of projects requested."),
1946
1946
  successCount: s.number().describe("The number of successfully created projects."),
1947
1947
  failureCount: s.number().describe("The number of failed project creations.")
1948
- }, Lo = {
1949
- name: g.ADD_PROJECTS,
1948
+ }, Fo = {
1949
+ name: y.ADD_PROJECTS,
1950
1950
  description: "Add one or more new projects.",
1951
- parameters: Mo,
1952
- outputSchema: No,
1951
+ parameters: No,
1952
+ outputSchema: Lo,
1953
1953
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
1954
1954
  async execute({ projects: e }, t) {
1955
1955
  const r = /* @__PURE__ */ new Map(), o = (d) => {
@@ -1957,7 +1957,7 @@ const ns = new _o(), Uo = s.object({
1957
1957
  return Promise.resolve(void 0);
1958
1958
  let u = r.get(d);
1959
1959
  return u || (u = R(
1960
- () => ns.resolveWorkspace(t, d)
1960
+ () => as.resolveWorkspace(t, d)
1961
1961
  ).then(({ workspaceId: p }) => p), r.set(d, u)), u;
1962
1962
  }, n = await Promise.allSettled(
1963
1963
  e.map(async ({ workspace: d, ...u }) => {
@@ -1975,7 +1975,7 @@ const ns = new _o(), Uo = s.object({
1975
1975
  });
1976
1976
  const c = a.map(Z);
1977
1977
  return {
1978
- textContent: Fo({ projects: a, failures: i }),
1978
+ textContent: Ho({ projects: a, failures: i }),
1979
1979
  structuredContent: {
1980
1980
  projects: c,
1981
1981
  totalCount: c.length,
@@ -1987,7 +1987,7 @@ const ns = new _o(), Uo = s.object({
1987
1987
  };
1988
1988
  }
1989
1989
  };
1990
- function Fo({
1990
+ function Ho({
1991
1991
  projects: e,
1992
1992
  failures: t
1993
1993
  }) {
@@ -1996,12 +1996,12 @@ function Fo({
1996
1996
  ${o}` : "Added 0 projects";
1997
1997
  return ct(n, t);
1998
1998
  }
1999
- const we = 25, $e = s.enum(Us), as = s.object({
1999
+ const ve = 25, $e = s.enum(Ms), is = s.object({
2000
2000
  date: s.string().optional().describe("Due date in YYYY-MM-DD format."),
2001
2001
  string: s.string().optional().describe('Natural language due string, e.g. "tomorrow at 3pm".'),
2002
2002
  timezone: s.string().optional().describe('Timezone for the reminder, e.g. "America/New_York".'),
2003
2003
  lang: s.string().optional().describe('Language for parsing the due string, e.g. "en".')
2004
- }), is = s.enum(Nt), De = s.boolean().optional().describe("Whether this is an urgent reminder. Applies to relative and absolute reminders."), Ho = s.object({
2004
+ }), cs = s.enum(Lt), De = s.boolean().optional().describe("Whether this is an urgent reminder. Applies to relative and absolute reminders."), Wo = s.object({
2005
2005
  type: s.literal("relative"),
2006
2006
  taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
2007
2007
  minuteOffset: s.number().int().min(0).describe(
@@ -2011,41 +2011,41 @@ const we = 25, $e = s.enum(Us), as = s.object({
2011
2011
  'Delivery method: "email" or "push" notification. Defaults to push.'
2012
2012
  ),
2013
2013
  isUrgent: De
2014
- }), Wo = s.object({
2014
+ }), Bo = s.object({
2015
2015
  type: s.literal("absolute"),
2016
2016
  taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
2017
- due: as.describe("The specific date/time for the reminder."),
2017
+ due: is.describe("The specific date/time for the reminder."),
2018
2018
  service: $e.optional().describe(
2019
2019
  'Delivery method: "email" or "push" notification. Defaults to push.'
2020
2020
  ),
2021
2021
  isUrgent: De
2022
- }), Bo = s.object({
2022
+ }), qo = s.object({
2023
2023
  type: s.literal("location"),
2024
2024
  taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
2025
2025
  name: s.string().min(1).describe('Name of the location, e.g. "Office", "Home".'),
2026
2026
  locLat: s.string().describe('Latitude of the location as a string, e.g. "37.7749".'),
2027
2027
  locLong: s.string().describe('Longitude of the location as a string, e.g. "-122.4194".'),
2028
- locTrigger: is.describe(
2028
+ locTrigger: cs.describe(
2029
2029
  'When to trigger: "on_enter" (arriving) or "on_leave" (departing).'
2030
2030
  ),
2031
2031
  radius: s.number().int().optional().describe("Radius in meters for the geofence. Defaults to server default.")
2032
- }), qo = s.discriminatedUnion("type", [
2033
- Ho,
2032
+ }), Yo = s.discriminatedUnion("type", [
2034
2033
  Wo,
2035
- Bo
2036
- ]), Yo = {
2037
- reminders: s.array(qo).min(1).max(we).describe(
2038
- `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).`
2034
+ Bo,
2035
+ qo
2036
+ ]), zo = {
2037
+ reminders: s.array(Yo).min(1).max(ve).describe(
2038
+ `Array of reminders to create (max ${ve}). Each reminder must specify a type: "relative" (minutes before due), "absolute" (specific date/time), or "location" (geofence trigger).`
2039
2039
  )
2040
- }, zo = {
2040
+ }, Go = {
2041
2041
  reminders: s.array(ot).describe("The created reminders."),
2042
2042
  totalCount: s.number().describe("Total number of reminders created."),
2043
2043
  addedReminderIds: s.array(s.string()).describe("IDs of the created reminders.")
2044
- }, Go = {
2045
- name: g.ADD_REMINDERS,
2044
+ }, Ko = {
2045
+ name: y.ADD_REMINDERS,
2046
2046
  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.',
2047
- parameters: Yo,
2048
- outputSchema: zo,
2047
+ parameters: zo,
2048
+ outputSchema: Go,
2049
2049
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
2050
2050
  async execute(e, t) {
2051
2051
  const { reminders: r } = e, o = r.map(async (c) => {
@@ -2078,7 +2078,7 @@ const we = 25, $e = s.enum(Us), as = s.object({
2078
2078
  }
2079
2079
  }), a = (await Promise.all(o)).map(ye);
2080
2080
  return {
2081
- textContent: Ko(a),
2081
+ textContent: Vo(a),
2082
2082
  structuredContent: {
2083
2083
  reminders: a,
2084
2084
  totalCount: a.length,
@@ -2087,8 +2087,8 @@ const we = 25, $e = s.enum(Us), as = s.object({
2087
2087
  };
2088
2088
  }
2089
2089
  };
2090
- function Ko(e) {
2091
- const { timeBasedCount: t, locationCount: r } = rs(e), o = [];
2090
+ function Vo(e) {
2091
+ const { timeBasedCount: t, locationCount: r } = os(e), o = [];
2092
2092
  if (t > 0) {
2093
2093
  const n = t > 1 ? "reminders" : "reminder";
2094
2094
  o.push(`${t} time-based ${n}`);
@@ -2099,15 +2099,15 @@ function Ko(e) {
2099
2099
  }
2100
2100
  return o.length > 0 ? `Added ${o.join(" and ")}` : "No reminders added";
2101
2101
  }
2102
- const Vo = s.object({
2102
+ const Jo = s.object({
2103
2103
  name: s.string().min(1).describe("The name of the section."),
2104
2104
  projectId: s.string().min(1).describe(
2105
2105
  'The ID of the project to add the section to. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
2106
2106
  ),
2107
2107
  description: s.string().optional().describe("The description of the section. Supports Markdown.")
2108
- }), Jo = {
2109
- sections: s.array(Vo).min(1).describe("The array of sections to add.")
2110
- }, Xo = {
2108
+ }), Xo = {
2109
+ sections: s.array(Jo).min(1).describe("The array of sections to add.")
2110
+ }, Zo = {
2111
2111
  sections: s.array(le).describe("The created sections."),
2112
2112
  totalCount: s.number().describe("The total number of sections created."),
2113
2113
  failures: s.array(te).describe(
@@ -2116,16 +2116,16 @@ const Vo = s.object({
2116
2116
  totalRequested: s.number().describe("The total number of sections requested."),
2117
2117
  successCount: s.number().describe("The number of successfully created sections."),
2118
2118
  failureCount: s.number().describe("The number of failed section creations.")
2119
- }, Zo = {
2120
- name: g.ADD_SECTIONS,
2119
+ }, Qo = {
2120
+ name: y.ADD_SECTIONS,
2121
2121
  description: "Add one or more new sections to projects.",
2122
- parameters: Jo,
2123
- outputSchema: Xo,
2122
+ parameters: Xo,
2123
+ outputSchema: Zo,
2124
2124
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
2125
2125
  async execute({ sections: e }, t) {
2126
- const r = e.some((c) => L(c.projectId)) ? R(() => t.getUser()) : void 0, o = await Promise.allSettled(
2126
+ const r = e.some((c) => F(c.projectId)) ? R(() => t.getUser()) : void 0, o = await Promise.allSettled(
2127
2127
  e.map(async (c) => {
2128
- const l = L(c.projectId) ? await r : void 0, d = await ue({
2128
+ const l = F(c.projectId) ? await r : void 0, d = await ue({
2129
2129
  projectId: c.projectId,
2130
2130
  user: l,
2131
2131
  client: void 0
@@ -2139,7 +2139,7 @@ const Vo = s.object({
2139
2139
  error: Y(c.reason)
2140
2140
  });
2141
2141
  }), {
2142
- textContent: Qo({ sections: n, failures: a }),
2142
+ textContent: en({ sections: n, failures: a }),
2143
2143
  structuredContent: {
2144
2144
  sections: n.map(ee),
2145
2145
  totalCount: n.length,
@@ -2151,7 +2151,7 @@ const Vo = s.object({
2151
2151
  };
2152
2152
  }
2153
2153
  };
2154
- function Qo({
2154
+ function en({
2155
2155
  sections: e,
2156
2156
  failures: t
2157
2157
  }) {
@@ -2169,7 +2169,7 @@ const ae = {
2169
2169
  PROJECT_NOT_FOUND: "PROJECT_NOT_FOUND",
2170
2170
  TASK_NOT_FOUND: "TASK_NOT_FOUND"
2171
2171
  };
2172
- class en {
2172
+ class tn {
2173
2173
  /**
2174
2174
  * Validate a single assignment operation
2175
2175
  */
@@ -2350,7 +2350,7 @@ class en {
2350
2350
  const u = await B.resolveUser(t, o);
2351
2351
  if (!u)
2352
2352
  return a.push("User not found - check spelling or invite to a shared project"), { canAssign: !1, projectInfo: d, recommendations: a };
2353
- const p = l.some((y) => y.id === u.userId), h = {
2353
+ const p = l.some((g) => g.id === u.userId), h = {
2354
2354
  resolvedName: u.displayName,
2355
2355
  isCollaborator: p
2356
2356
  };
@@ -2360,14 +2360,14 @@ class en {
2360
2360
  ), { canAssign: !1, projectInfo: d, userInfo: h, recommendations: a };
2361
2361
  let m;
2362
2362
  if (n && n.length > 0) {
2363
- let y = 0, f = 0;
2363
+ let g = 0, f = 0;
2364
2364
  for (const I of n)
2365
2365
  try {
2366
- await t.getTask(I), y++;
2366
+ await t.getTask(I), g++;
2367
2367
  } catch {
2368
2368
  f++;
2369
2369
  }
2370
- m = { accessibleTasks: y, inaccessibleTasks: f }, f > 0 && a.push(`${f} task(s) are not accessible`);
2370
+ m = { accessibleTasks: g, inaccessibleTasks: f }, f > 0 && a.push(`${f} task(s) are not accessible`);
2371
2371
  }
2372
2372
  return i = !0, a.push(`Ready to assign tasks to ${u.displayName}`), {
2373
2373
  canAssign: i,
@@ -2378,67 +2378,67 @@ class en {
2378
2378
  };
2379
2379
  }
2380
2380
  }
2381
- const dt = new en();
2382
- function W(e) {
2381
+ const dt = new tn();
2382
+ function N(e) {
2383
2383
  return s.string().transform((t) => t === "" ? void 0 : t).optional().describe(e);
2384
2384
  }
2385
- const wt = Yt.TASKS_PER_OPERATION, tn = s.object({
2385
+ const vt = zt.TASKS_PER_OPERATION, sn = s.object({
2386
2386
  content: s.string().min(1).describe(
2387
2387
  '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.'
2388
2388
  ),
2389
- description: W(
2389
+ description: N(
2390
2390
  "Additional details, notes, or context for the task. Use this for longer content rather than putting it in the task name. Supports Markdown."
2391
2391
  ),
2392
2392
  priority: et.optional().describe(Qe),
2393
- dueString: W(
2393
+ dueString: N(
2394
2394
  'The due date for the task, in natural language. Also use natural language for recurrences; do not prefix it with "recurring".'
2395
2395
  ),
2396
- deadlineDate: W(
2396
+ deadlineDate: N(
2397
2397
  'The deadline date for the task in ISO 8601 format (YYYY-MM-DD, e.g., "2025-12-31"). Deadlines are immovable constraints shown with a different indicator than due dates.'
2398
2398
  ),
2399
- duration: W(
2399
+ duration: N(
2400
2400
  'The duration of the task. Use format: "2h" (hours), "90m" (minutes), "2h30m" (combined), or "1.5h" (decimal hours). Max 24h.'
2401
2401
  ),
2402
2402
  labels: s.array(s.string()).optional().describe("The labels to attach to the task."),
2403
- projectId: W(
2403
+ projectId: N(
2404
2404
  'The project ID to add this task to. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
2405
2405
  ),
2406
- sectionId: W("The section ID to add this task to."),
2407
- parentId: W("The parent task ID (for subtasks)."),
2406
+ sectionId: N("The section ID to add this task to."),
2407
+ parentId: N("The parent task ID (for subtasks)."),
2408
2408
  order: s.number().optional().describe("Position of the task among sibling tasks under the same parent/section."),
2409
- responsibleUser: W(
2409
+ responsibleUser: N(
2410
2410
  'Assign task to this user. Can be "me" (assigns to current user), a user ID, name, or email address. User must be a collaborator on the target project.'
2411
2411
  ),
2412
2412
  isUncompletable: s.boolean().optional().describe(
2413
2413
  "Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
2414
2414
  )
2415
- }), vt = {
2416
- tasks: s.array(tn).min(1).max(wt).describe(`The array of tasks to add (max ${wt}).`)
2417
- }, sn = {
2415
+ }), wt = {
2416
+ tasks: s.array(sn).min(1).max(vt).describe(`The array of tasks to add (max ${vt}).`)
2417
+ }, rn = {
2418
2418
  tasks: s.array(z).describe("The created tasks."),
2419
2419
  totalCount: s.number().describe("The total number of tasks created."),
2420
2420
  failures: s.array(te).describe("Failed task creations with error details."),
2421
2421
  totalRequested: s.number().describe("The total number of tasks requested."),
2422
2422
  successCount: s.number().describe("The number of successfully created tasks."),
2423
2423
  failureCount: s.number().describe("The number of failed task creations.")
2424
- }, rn = {
2425
- name: g.ADD_TASKS,
2424
+ }, on = {
2425
+ name: y.ADD_TASKS,
2426
2426
  description: "Add one or more tasks to a project, section, or parent. Supports assignment to project collaborators.",
2427
- parameters: vt,
2428
- outputSchema: sn,
2427
+ parameters: wt,
2428
+ outputSchema: rn,
2429
2429
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
2430
2430
  async execute(e, t) {
2431
- const { tasks: r } = s.object(vt).parse(e), o = /* @__PURE__ */ new Map();
2431
+ const { tasks: r } = s.object(wt).parse(e), o = /* @__PURE__ */ new Map();
2432
2432
  r.forEach((h, m) => {
2433
- const y = on(h), f = o.get(y);
2434
- f ? f.push({ task: h, index: m }) : o.set(y, [{ task: h, index: m }]);
2433
+ const g = nn(h), f = o.get(g);
2434
+ f ? f.push({ task: h, index: m }) : o.set(g, [{ task: h, index: m }]);
2435
2435
  });
2436
2436
  const n = /* @__PURE__ */ new Map(), i = (await Promise.all(
2437
2437
  [...o.values()].map(async (h) => {
2438
2438
  const m = [];
2439
- for (const { task: y, index: f } of h)
2439
+ for (const { task: g, index: f } of h)
2440
2440
  try {
2441
- const I = await nn(y, t, n);
2441
+ const I = await an(g, t, n);
2442
2442
  m.push({ index: f, result: { status: "fulfilled", value: I } });
2443
2443
  } catch (I) {
2444
2444
  m.push({
@@ -2451,7 +2451,7 @@ const wt = Yt.TASKS_PER_OPERATION, tn = s.object({
2451
2451
  )).flat().sort((h, m) => h.index - m.index), c = [], l = [];
2452
2452
  let d = !1;
2453
2453
  for (const { index: h, result: m } of i)
2454
- m.status === "fulfilled" ? c.push(m.value) : (d ||= m.reason instanceof ve, l.push({
2454
+ m.status === "fulfilled" ? c.push(m.value) : (d ||= m.reason instanceof we, l.push({
2455
2455
  item: r[h]?.content ?? `Task ${h + 1}`,
2456
2456
  // Keep API error signals (status/code/tag) — `error.message`
2457
2457
  // alone collapses e.g. a full-project rejection into a bare
@@ -2459,12 +2459,12 @@ const wt = Yt.TASKS_PER_OPERATION, tn = s.object({
2459
2459
  error: Y(m.reason)
2460
2460
  }));
2461
2461
  if (c.length === 0 && l.length > 0) {
2462
- const h = l.map((y) => `"${y.item}": ${y.error}`).join("; "), m = `All ${l.length} task(s) failed to create: ${h}`;
2463
- throw d ? new qt(m) : new Error(m);
2462
+ const h = l.map((g) => `"${g.item}": ${g.error}`).join("; "), m = `All ${l.length} task(s) failed to create: ${h}`;
2463
+ throw d ? new Yt(m) : new Error(m);
2464
2464
  }
2465
2465
  const u = c.map(M);
2466
2466
  return {
2467
- textContent: an({
2467
+ textContent: cn({
2468
2468
  tasks: u,
2469
2469
  failures: l,
2470
2470
  args: { tasks: r }
@@ -2480,10 +2480,10 @@ const wt = Yt.TASKS_PER_OPERATION, tn = s.object({
2480
2480
  };
2481
2481
  }
2482
2482
  };
2483
- function on(e) {
2483
+ function nn(e) {
2484
2484
  return `${e.projectId ?? ""}|${e.sectionId ?? ""}|${e.parentId ?? ""}`;
2485
2485
  }
2486
- async function nn(e, t, r) {
2486
+ async function an(e, t, r) {
2487
2487
  const {
2488
2488
  duration: o,
2489
2489
  projectId: n,
@@ -2495,7 +2495,7 @@ async function nn(e, t, r) {
2495
2495
  labels: u,
2496
2496
  deadlineDate: p,
2497
2497
  ...h
2498
- } = e, m = L(n) ? void 0 : n;
2498
+ } = e, m = F(n) ? void 0 : n;
2499
2499
  if (m) {
2500
2500
  const f = await t.getProject(m);
2501
2501
  if (f.isArchived)
@@ -2503,7 +2503,7 @@ async function nn(e, t, r) {
2503
2503
  `Task "${e.content}": Cannot create task in archived project "${f.name}"`
2504
2504
  );
2505
2505
  }
2506
- let y = {
2506
+ let g = {
2507
2507
  ...h,
2508
2508
  projectId: m,
2509
2509
  sectionId: a,
@@ -2512,15 +2512,15 @@ async function nn(e, t, r) {
2512
2512
  labels: u,
2513
2513
  deadlineDate: p
2514
2514
  };
2515
- if (d && (y.priority = Zt(d)), l && !m && !a && !i)
2515
+ if (d && (g.priority = Qt(d)), l && !m && !a && !i)
2516
2516
  throw new Error(
2517
2517
  `Task "${e.content}": Cannot assign tasks without specifying project context. Please specify a projectId, sectionId, or parentId.`
2518
2518
  );
2519
2519
  if (o)
2520
2520
  try {
2521
- const { minutes: f } = Xt(o);
2522
- y = {
2523
- ...y,
2521
+ const { minutes: f } = Zt(o);
2522
+ g = {
2523
+ ...g,
2524
2524
  duration: f,
2525
2525
  durationUnit: "minute"
2526
2526
  };
@@ -2556,27 +2556,27 @@ async function nn(e, t, r) {
2556
2556
  `Task "${e.content}": ${C}${E ? `. ${E}` : ""}`
2557
2557
  );
2558
2558
  }
2559
- y.assigneeId = I.resolvedUser?.userId;
2559
+ g.assigneeId = I.resolvedUser?.userId;
2560
2560
  }
2561
2561
  try {
2562
- return await t.addTask(y);
2562
+ return await t.addTask(g);
2563
2563
  } catch (f) {
2564
- const I = er(f, {
2564
+ const I = tr(f, {
2565
2565
  taskContent: e.content,
2566
2566
  dueString: e.dueString,
2567
2567
  deadlineDate: e.deadlineDate
2568
2568
  });
2569
- throw I ? new ve(I) : f;
2569
+ throw I ? new we(I) : f;
2570
2570
  }
2571
2571
  }
2572
- function an({
2572
+ function cn({
2573
2573
  tasks: e,
2574
2574
  failures: t,
2575
2575
  args: r
2576
2576
  }) {
2577
2577
  const o = /* @__PURE__ */ new Set();
2578
2578
  for (const a of r.tasks)
2579
- a.projectId && !L(a.projectId) ? o.add("projects") : a.sectionId ? o.add("sections") : a.parentId ? o.add("subtasks") : o.add("inbox");
2579
+ a.projectId && !F(a.projectId) ? o.add("projects") : a.sectionId ? o.add("sections") : a.parentId ? o.add("subtasks") : o.add("inbox");
2580
2580
  let n = "";
2581
2581
  if (o.size === 1) {
2582
2582
  const a = Array.from(o)[0];
@@ -2594,11 +2594,11 @@ function an({
2594
2594
  showDetails: !0
2595
2595
  });
2596
2596
  }
2597
- const cn = {
2597
+ const dn = {
2598
2598
  projectId: s.string().min(1).describe(
2599
2599
  "The ID of the project to analyze. This triggers a new health analysis which may take some time to complete."
2600
2600
  )
2601
- }, dn = {
2601
+ }, ln = {
2602
2602
  projectId: s.string().describe("The project ID."),
2603
2603
  health: s.object({
2604
2604
  status: s.enum(Je).describe("The health status after triggering analysis."),
@@ -2606,11 +2606,11 @@ const cn = {
2606
2606
  updateInProgress: s.boolean().describe("Whether an analysis update is currently in progress.")
2607
2607
  }).describe("The health response returned after triggering analysis."),
2608
2608
  message: s.string().describe("A human-readable message about the analysis status.")
2609
- }, ln = {
2610
- name: g.ANALYZE_PROJECT_HEALTH,
2609
+ }, un = {
2610
+ name: y.ANALYZE_PROJECT_HEALTH,
2611
2611
  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.",
2612
- parameters: cn,
2613
- outputSchema: dn,
2612
+ parameters: dn,
2613
+ outputSchema: ln,
2614
2614
  annotations: {
2615
2615
  readOnlyHint: !1,
2616
2616
  destructiveHint: !1,
@@ -2633,19 +2633,19 @@ ${n}`,
2633
2633
  }
2634
2634
  };
2635
2635
  }
2636
- }, un = {
2637
- ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to complete.")
2638
2636
  }, pn = {
2637
+ ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to complete.")
2638
+ }, hn = {
2639
2639
  completed: s.array(s.string()).describe("The IDs of successfully completed tasks."),
2640
2640
  failures: s.array(te).describe("Failed task completions with error details."),
2641
2641
  totalRequested: s.number().describe("The total number of tasks requested to complete."),
2642
2642
  successCount: s.number().describe("The number of successfully completed tasks."),
2643
2643
  failureCount: s.number().describe("The number of failed task completions.")
2644
- }, hn = {
2645
- name: g.COMPLETE_TASKS,
2644
+ }, mn = {
2645
+ name: y.COMPLETE_TASKS,
2646
2646
  description: "Complete one or more tasks by their IDs.",
2647
- parameters: un,
2648
- outputSchema: pn,
2647
+ parameters: pn,
2648
+ outputSchema: hn,
2649
2649
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
2650
2650
  async execute(e, t) {
2651
2651
  const r = [], o = [];
@@ -2660,7 +2660,7 @@ ${n}`,
2660
2660
  });
2661
2661
  }
2662
2662
  return {
2663
- textContent: mn({
2663
+ textContent: fn({
2664
2664
  completed: r,
2665
2665
  failures: o,
2666
2666
  args: e
@@ -2675,7 +2675,7 @@ ${n}`,
2675
2675
  };
2676
2676
  }
2677
2677
  };
2678
- function mn({
2678
+ function fn({
2679
2679
  completed: e,
2680
2680
  failures: t,
2681
2681
  args: r
@@ -2688,7 +2688,7 @@ function mn({
2688
2688
  failures: t
2689
2689
  });
2690
2690
  }
2691
- const cs = [
2691
+ const ds = [
2692
2692
  "project",
2693
2693
  "section",
2694
2694
  "task",
@@ -2697,20 +2697,20 @@ const cs = [
2697
2697
  "filter",
2698
2698
  "reminder",
2699
2699
  "location_reminder"
2700
- ], fn = {
2701
- type: s.enum(cs).describe("The type of entity to delete."),
2700
+ ], bn = {
2701
+ type: s.enum(ds).describe("The type of entity to delete."),
2702
2702
  id: s.string().min(1).describe("The ID of the entity to delete.")
2703
- }, bn = {
2703
+ }, gn = {
2704
2704
  deletedEntity: s.object({
2705
- type: s.enum(cs).describe("The type of deleted entity."),
2705
+ type: s.enum(ds).describe("The type of deleted entity."),
2706
2706
  id: s.string().describe("The ID of the deleted entity.")
2707
2707
  }).describe("Information about the deleted entity."),
2708
2708
  success: s.boolean().describe("Whether the deletion was successful.")
2709
- }, gn = {
2710
- name: g.DELETE_OBJECT,
2709
+ }, yn = {
2710
+ name: y.DELETE_OBJECT,
2711
2711
  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.",
2712
- parameters: fn,
2713
- outputSchema: bn,
2712
+ parameters: bn,
2713
+ outputSchema: gn,
2714
2714
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !0 },
2715
2715
  async execute(e, t) {
2716
2716
  switch (e.type) {
@@ -2755,7 +2755,7 @@ const cs = [
2755
2755
  }
2756
2756
  };
2757
2757
  }
2758
- }, yn = z.pick({
2758
+ }, kn = z.pick({
2759
2759
  id: !0,
2760
2760
  content: !0,
2761
2761
  dueDate: !0,
@@ -2764,15 +2764,15 @@ const cs = [
2764
2764
  hasChildren: s.boolean().describe(
2765
2765
  "Whether this subtask has subtasks of its own. Fetch it with includeChildren to expand."
2766
2766
  )
2767
- }), kn = Q.pick({ id: !0, name: !0 }).extend({
2767
+ }), Tn = Q.pick({ id: !0, name: !0 }).extend({
2768
2768
  hasChildren: s.boolean().describe(
2769
2769
  "Whether this sub-project has sub-projects of its own. Fetch it with includeChildren to expand."
2770
2770
  )
2771
- }), Tn = {
2771
+ }), vn = {
2772
2772
  childCount: s.number().optional().describe(
2773
2773
  "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."
2774
2774
  ),
2775
- children: s.array(s.union([yn, kn])).optional().describe(
2775
+ children: s.array(s.union([kn, Tn])).optional().describe(
2776
2776
  "Direct children only: subtasks for a task, sub-projects for a project. Completed subtasks and archived sub-projects are excluded."
2777
2777
  ),
2778
2778
  hasMoreChildren: s.boolean().optional().describe(
@@ -2805,10 +2805,10 @@ async function wn(e, t) {
2805
2805
  childrenError: a ? `Could not check ${a} of ${r.length} subtasks for subtasks of their own; those are reported as hasChildren=false.` : void 0
2806
2806
  };
2807
2807
  }
2808
- async function vn(e, t) {
2808
+ async function In(e, t) {
2809
2809
  if (!q(t))
2810
2810
  return { childCount: 0, children: [] };
2811
- const r = await ss(e), o = /* @__PURE__ */ new Map();
2811
+ const r = await rs(e), o = /* @__PURE__ */ new Map();
2812
2812
  for (const i of r) {
2813
2813
  if (!q(i) || !i.parentId) continue;
2814
2814
  const c = o.get(i.parentId) ?? [];
@@ -2838,22 +2838,22 @@ function jt(e, t) {
2838
2838
  const r = t.hasMoreChildren ? "+" : "", o = t.childrenError ? " (partial)" : "";
2839
2839
  return ` • ${e}=${t.childCount}${r}${o}`;
2840
2840
  }
2841
- const ds = ["task", "project", "comment", "section"], In = {
2842
- type: s.enum(ds).describe("The type of object to fetch."),
2841
+ const ls = ["task", "project", "comment", "section"], jn = {
2842
+ type: s.enum(ls).describe("The type of object to fetch."),
2843
2843
  id: s.string().min(1).describe("The unique ID of the object to fetch."),
2844
2844
  includeChildren: s.boolean().optional().describe(
2845
2845
  "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."
2846
2846
  )
2847
- }, jn = {
2848
- type: s.enum(ds).describe("The type of object fetched."),
2847
+ }, Sn = {
2848
+ type: s.enum(ls).describe("The type of object fetched."),
2849
2849
  id: s.string().describe("The ID of the fetched object."),
2850
2850
  object: s.union([z, Q, Se, le]).describe("The fetched object data."),
2851
- ...Tn
2852
- }, Sn = {
2853
- name: g.FETCH_OBJECT,
2851
+ ...vn
2852
+ }, Cn = {
2853
+ name: y.FETCH_OBJECT,
2854
2854
  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.",
2855
- parameters: In,
2856
- outputSchema: jn,
2855
+ parameters: jn,
2856
+ outputSchema: Sn,
2857
2857
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
2858
2858
  async execute(e, t) {
2859
2859
  const { type: r, id: o, includeChildren: n } = e;
@@ -2875,7 +2875,7 @@ const ds = ["task", "project", "comment", "section"], In = {
2875
2875
  };
2876
2876
  }
2877
2877
  case "project": {
2878
- const a = await t.getProject(o), i = Z(a), c = n ? await It(() => vn(t, a)) : {};
2878
+ const a = await t.getProject(o), i = Z(a), c = n ? await It(() => In(t, a)) : {};
2879
2879
  return {
2880
2880
  textContent: `Found project: ${i.name} • id=${i.id} • color=${i.color} • viewStyle=${i.viewStyle}${jt("subProjects", c)}`,
2881
2881
  structuredContent: {
@@ -2918,21 +2918,21 @@ const ds = ["task", "project", "comment", "section"], In = {
2918
2918
  );
2919
2919
  }
2920
2920
  }
2921
- }, Cn = {
2921
+ }, $n = {
2922
2922
  id: s.string().min(1).describe(
2923
2923
  'A unique identifier for the document in the format "task:{id}" or "project:{id}".'
2924
2924
  )
2925
- }, $n = {
2925
+ }, Dn = {
2926
2926
  id: s.string().describe("The ID of the fetched document."),
2927
2927
  title: s.string().describe("The title of the document."),
2928
2928
  text: s.string().describe("The text content of the document."),
2929
2929
  url: s.string().describe("The URL of the document."),
2930
2930
  metadata: s.record(s.string(), s.unknown()).optional().describe("Additional metadata about the document.")
2931
- }, Dn = {
2932
- name: g.FETCH,
2931
+ }, An = {
2932
+ name: y.FETCH,
2933
2933
  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}".',
2934
- parameters: Cn,
2935
- outputSchema: $n,
2934
+ parameters: $n,
2935
+ outputSchema: Dn,
2936
2936
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
2937
2937
  async execute(e, t) {
2938
2938
  const { id: r } = e, [o, n] = r.split(":", 2);
@@ -2951,7 +2951,7 @@ Labels: ${c.labels.join(", ")}`), a = {
2951
2951
  id: `task:${c.id}`,
2952
2952
  title: c.content,
2953
2953
  text: l.join(""),
2954
- url: Lt(c.id),
2954
+ url: Ft(c.id),
2955
2955
  metadata: {
2956
2956
  priority: c.priority,
2957
2957
  projectId: c.projectId,
@@ -2976,7 +2976,7 @@ Favorite: Yes`), a = {
2976
2976
  id: `project:${c.id}`,
2977
2977
  title: c.name,
2978
2978
  text: l.join(""),
2979
- url: Ft(c.id),
2979
+ url: Ht(c.id),
2980
2980
  metadata: {
2981
2981
  color: c.color,
2982
2982
  isFavorite: c.isFavorite,
@@ -2992,7 +2992,11 @@ Favorite: Yes`), a = {
2992
2992
  structuredContent: a
2993
2993
  };
2994
2994
  }
2995
- }, An = {
2995
+ }, xn = s.union([s.iso.date(), s.iso.datetime({ offset: !0 })]);
2996
+ function St(e) {
2997
+ return N(e).pipe(xn.optional());
2998
+ }
2999
+ const En = {
2996
3000
  objectType: s.enum(["task", "project", "comment"]).optional().describe("Type of object to filter by."),
2997
3001
  objectId: s.string().optional().describe("Filter by specific object ID (task, project, or comment)."),
2998
3002
  eventType: s.enum([
@@ -3009,40 +3013,57 @@ Favorite: Yes`), a = {
3009
3013
  projectId: s.string().optional().describe("Filter events by parent project ID."),
3010
3014
  taskId: s.string().optional().describe("Filter events by parent task ID (for subtask events)."),
3011
3015
  initiatorId: s.string().optional().describe("Filter by the user ID who initiated the event."),
3016
+ dateFrom: St(
3017
+ `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.`
3018
+ ),
3019
+ dateTo: St(
3020
+ '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.'
3021
+ ),
3012
3022
  limit: s.number().int().min(1).max($.ACTIVITY_MAX).default($.ACTIVITY_DEFAULT).describe("Maximum number of activity events to return."),
3013
3023
  cursor: s.string().optional().describe("Pagination cursor for retrieving the next page of results.")
3014
- }, xn = {
3015
- events: s.array(co).describe("The activity events."),
3024
+ }, On = {
3025
+ events: s.array(lo).describe("The activity events."),
3016
3026
  nextCursor: s.string().optional().describe("Cursor for the next page of results."),
3017
3027
  totalCount: s.number().describe("The total number of events in this page."),
3018
3028
  hasMore: s.boolean().describe("Whether there are more results available."),
3019
3029
  appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
3020
- }, En = {
3021
- name: g.FIND_ACTIVITY,
3022
- description: "Retrieve recent activity logs to monitor and audit changes in Todoist. Shows events from all users by default (use initiatorId to filter by specific user). Track task completions, updates, deletions, project changes, and more with flexible filtering. Note: Date-based filtering is not supported by the Todoist API.",
3023
- parameters: An,
3024
- outputSchema: xn,
3030
+ }, Pn = {
3031
+ name: y.FIND_ACTIVITY,
3032
+ 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. Track task completions, updates, deletions, project changes, and more with flexible filtering. Activity history availability and retention depend on the user plan.',
3033
+ parameters: En,
3034
+ outputSchema: On,
3025
3035
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3026
3036
  async execute(e, t) {
3027
- const { objectType: r, objectId: o, eventType: n, projectId: a, taskId: i, initiatorId: c, limit: l, cursor: d } = e, u = {
3028
- limit: l,
3029
- cursor: d ?? null
3037
+ const {
3038
+ objectType: r,
3039
+ objectId: o,
3040
+ eventType: n,
3041
+ projectId: a,
3042
+ taskId: i,
3043
+ initiatorId: c,
3044
+ dateFrom: l,
3045
+ dateTo: d,
3046
+ limit: u,
3047
+ cursor: p
3048
+ } = e, h = {
3049
+ limit: u,
3050
+ cursor: p ?? null
3030
3051
  };
3031
- r && n ? u.objectEventTypes = `${r}:${n}` : r ? u.objectEventTypes = `${r}:` : n && (u.objectEventTypes = `:${n}`), o && o !== "remove" && (u.objectId = o), a && (u.parentProjectId = a), i && (u.parentItemId = i), c && (u.initiatorId = c);
3032
- const { results: p, nextCursor: h } = await t.getActivityLogs(u), m = p.map(ro);
3052
+ r && n ? h.objectEventTypes = `${r}:${n}` : r ? h.objectEventTypes = `${r}:` : n && (h.objectEventTypes = `:${n}`), o && o !== "remove" && (h.objectId = o), a && (h.parentProjectId = a), i && (h.parentItemId = i), c && (h.initiatorId = c), l && (h.dateFrom = l), d && (h.dateTo = d);
3053
+ const { results: m, nextCursor: g } = await t.getActivityLogs(h), f = m.map(oo);
3033
3054
  return {
3034
- textContent: On({ events: m, args: e, nextCursor: h }),
3055
+ textContent: Rn({ events: f, args: e, nextCursor: g }),
3035
3056
  structuredContent: {
3036
- events: m,
3037
- nextCursor: h ?? void 0,
3038
- totalCount: m.length,
3039
- hasMore: !!h,
3057
+ events: f,
3058
+ nextCursor: g ?? void 0,
3059
+ totalCount: f.length,
3060
+ hasMore: !!g,
3040
3061
  appliedFilters: e
3041
3062
  }
3042
3063
  };
3043
3064
  }
3044
3065
  };
3045
- function On({
3066
+ function Rn({
3046
3067
  events: e,
3047
3068
  args: t,
3048
3069
  nextCursor: r
@@ -3055,7 +3076,7 @@ function On({
3055
3076
  }
3056
3077
  n.length > 0 && (o = `Activity: ${n.join(" ")}`);
3057
3078
  const a = [];
3058
- t.objectId && a.push(`object ID: ${t.objectId}`), t.projectId && a.push(`project: ${t.projectId}`), t.taskId && a.push(`task: ${t.taskId}`), t.initiatorId && a.push(`initiator: ${t.initiatorId}`);
3079
+ t.objectId && a.push(`object ID: ${t.objectId}`), t.projectId && a.push(`project: ${t.projectId}`), t.taskId && a.push(`task: ${t.taskId}`), t.initiatorId && a.push(`initiator: ${t.initiatorId}`), t.dateFrom && a.push(`from: ${t.dateFrom}`), t.dateTo && a.push(`until (exclusive): ${t.dateTo}`);
3059
3080
  const i = [];
3060
3081
  return e.length === 0 && (i.push("No activity events match the specified filters"), i.push("Note: Activity logs only show recent events"), t.eventType && i.push(`Try removing the eventType filter (${t.eventType})`), t.objectType && i.push(`Try removing the objectType filter (${t.objectType})`), (t.objectId || t.projectId || t.taskId) && i.push("Verify the object ID is correct")), G({
3061
3082
  subject: o,
@@ -3063,12 +3084,12 @@ function On({
3063
3084
  limit: t.limit,
3064
3085
  nextCursor: r ?? void 0,
3065
3086
  filterHints: a,
3066
- previewLines: Pn(e, Math.min(e.length, t.limit)),
3087
+ previewLines: _n(e, Math.min(e.length, t.limit)),
3067
3088
  zeroReasonHints: i
3068
3089
  });
3069
3090
  }
3070
- function Pn(e, t = 10) {
3071
- const o = e.slice(0, t).map(Rn).join(`
3091
+ function _n(e, t = 10) {
3092
+ const o = e.slice(0, t).map(Un).join(`
3072
3093
  `);
3073
3094
  if (e.length > t) {
3074
3095
  const n = e.length - t;
@@ -3077,8 +3098,8 @@ function Pn(e, t = 10) {
3077
3098
  }
3078
3099
  return o;
3079
3100
  }
3080
- function Rn(e) {
3081
- const t = _n(e.eventDate), r = `${e.eventType} ${e.objectType}`;
3101
+ function Un(e) {
3102
+ const t = Mn(e.eventDate), r = `${e.eventType} ${e.objectType}`;
3082
3103
  let o = "";
3083
3104
  if (e.extraData) {
3084
3105
  const c = e.extraData.content || e.extraData.name || e.extraData.last_content;
@@ -3087,7 +3108,7 @@ function Rn(e) {
3087
3108
  const n = e.objectId ? ` • id=${e.objectId}` : "", a = e.initiatorId ? ` • by=${e.initiatorId}` : " • system", i = e.parentProjectId ? ` • project=${e.parentProjectId}` : "";
3088
3109
  return ` [${t}] ${r}${o}${n}${a}${i}`;
3089
3110
  }
3090
- function _n(e) {
3111
+ function Mn(e) {
3091
3112
  try {
3092
3113
  const t = new Date(e), r = t.toLocaleDateString("en-US", { month: "short", timeZone: "UTC" }), o = t.toLocaleDateString("en-US", { day: "numeric", timeZone: "UTC" }), n = t.toLocaleTimeString("en-US", {
3093
3114
  hour: "2-digit",
@@ -3100,7 +3121,7 @@ function _n(e) {
3100
3121
  return e;
3101
3122
  }
3102
3123
  }
3103
- const Un = {
3124
+ const Nn = {
3104
3125
  taskId: s.string().optional().describe("Find comments for a specific task."),
3105
3126
  projectId: s.string().optional().describe(
3106
3127
  'Find comments for a specific project. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
@@ -3108,7 +3129,7 @@ const Un = {
3108
3129
  commentId: s.string().optional().describe("Get a specific comment by ID."),
3109
3130
  cursor: s.string().optional().describe("Pagination cursor for retrieving more results."),
3110
3131
  limit: s.number().int().min(1).max($.COMMENTS_MAX).optional().describe("Maximum number of comments to return")
3111
- }, Mn = {
3132
+ }, Ln = {
3112
3133
  comments: s.array(Se).describe("The found comments."),
3113
3134
  searchType: s.string().describe(
3114
3135
  'The type of search performed: "single" (comment ID), "task" (task ID), or "project" (project ID).'
@@ -3117,11 +3138,11 @@ const Un = {
3117
3138
  hasMore: s.boolean().describe("Whether there are more results available."),
3118
3139
  nextCursor: s.string().optional().describe("Cursor for the next page of results."),
3119
3140
  totalCount: s.number().describe("The total number of comments in this page.")
3120
- }, Nn = {
3121
- name: g.FIND_COMMENTS,
3141
+ }, Fn = {
3142
+ name: y.FIND_COMMENTS,
3122
3143
  description: "Find comments by task, project, or get a specific comment by ID. Exactly one of taskId, projectId, or commentId must be provided.",
3123
- parameters: Un,
3124
- outputSchema: Mn,
3144
+ parameters: Nn,
3145
+ outputSchema: Ln,
3125
3146
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3126
3147
  async execute(e, t) {
3127
3148
  const r = [e.taskId, e.projectId, e.commentId].filter(Boolean);
@@ -3156,7 +3177,7 @@ const Un = {
3156
3177
  throw new Error("Invalid state: no search parameter provided");
3157
3178
  const c = i.map(Ie);
3158
3179
  return {
3159
- textContent: Ln({
3180
+ textContent: Hn({
3160
3181
  comments: c,
3161
3182
  searchType: e.commentId ? "single" : e.taskId ? "task" : "project",
3162
3183
  searchId: e.commentId || e.taskId || e.projectId || "",
@@ -3174,7 +3195,7 @@ const Un = {
3174
3195
  };
3175
3196
  }
3176
3197
  };
3177
- function Ln({
3198
+ function Hn({
3178
3199
  comments: e,
3179
3200
  searchType: t,
3180
3201
  searchId: r,
@@ -3194,37 +3215,37 @@ function Ln({
3194
3215
  a = `Found ${e.length} ${l} for ${t} ${r}${c}`, o && (a += " • More available");
3195
3216
  }
3196
3217
  if (n) {
3197
- const i = os([], n);
3218
+ const i = ns([], n);
3198
3219
  return `${a}
3199
3220
  ${i}`;
3200
3221
  }
3201
3222
  return a;
3202
3223
  }
3203
- function ls(e) {
3224
+ function us(e) {
3204
3225
  const t = e.getUTCFullYear(), r = String(e.getUTCMonth() + 1).padStart(2, "0"), o = String(e.getUTCDate()).padStart(2, "0");
3205
3226
  return `${t}-${r}-${o}`;
3206
3227
  }
3207
- function Fn(e) {
3228
+ function Wn(e) {
3208
3229
  const t = /^([+-])(\d{2}):(\d{2})$/.exec(e);
3209
3230
  if (!t)
3210
3231
  return 0;
3211
3232
  const [, r, o, n] = t, a = Number(o) * 60 + Number(n);
3212
3233
  return r === "-" ? -a : a;
3213
3234
  }
3214
- function Hn(e, t) {
3235
+ function Bn(e, t) {
3215
3236
  const r = new Date(e.getTime() + t * 60 * 1e3);
3216
- return ls(r);
3237
+ return us(r);
3217
3238
  }
3218
- function St(e, t) {
3239
+ function Ct(e, t) {
3219
3240
  const [r, o, n] = e.split("-"), a = Number(r), i = Number(o), c = Number(n);
3220
3241
  if (!Number.isFinite(a) || !Number.isFinite(i) || !Number.isFinite(c))
3221
3242
  throw new Error(`Invalid date format: ${e}. Expected YYYY-MM-DD.`);
3222
3243
  const l = new Date(Date.UTC(a, i - 1, c));
3223
- return l.setUTCDate(l.getUTCDate() + t), ls(l);
3244
+ return l.setUTCDate(l.getUTCDate() + t), us(l);
3224
3245
  }
3225
- const Wn = ["and", "or"], lt = {
3246
+ const qn = ["and", "or"], lt = {
3226
3247
  labels: s.string().array().optional().describe("The labels to filter the tasks by"),
3227
- labelsOperator: s.enum(Wn).optional().describe(
3248
+ labelsOperator: s.enum(qn).optional().describe(
3228
3249
  'The operator to use when filtering by labels. This will dictate whether a task has all labels, or some of them. Default is "or".'
3229
3250
  )
3230
3251
  };
@@ -3233,20 +3254,20 @@ function ut(e = [], t = "or") {
3233
3254
  const r = t === "and" ? " & " : " | ";
3234
3255
  return `(${e.map((a) => a.startsWith("@") ? a : `@${a}`).join(` ${r} `)})`;
3235
3256
  }
3236
- const Bn = 7;
3237
- function qn({
3257
+ const Yn = 7;
3258
+ function zn({
3238
3259
  since: e,
3239
3260
  until: t,
3240
3261
  userGmtOffset: r,
3241
3262
  now: o = /* @__PURE__ */ new Date()
3242
3263
  }) {
3243
- const n = Fn(r), a = Hn(o, n), i = Bn - 1, c = t ?? (e ? St(e, i) : a);
3264
+ const n = Wn(r), a = Bn(o, n), i = Yn - 1, c = t ?? (e ? Ct(e, i) : a);
3244
3265
  return {
3245
- since: e ?? St(c, -i),
3266
+ since: e ?? Ct(c, -i),
3246
3267
  until: c
3247
3268
  };
3248
3269
  }
3249
- const Yn = {
3270
+ const Gn = {
3250
3271
  getBy: s.enum(["completion", "due"]).default("completion").describe(
3251
3272
  '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).'
3252
3273
  ),
@@ -3270,17 +3291,17 @@ const Yn = {
3270
3291
  "The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters)."
3271
3292
  ),
3272
3293
  ...lt
3273
- }, zn = {
3294
+ }, Kn = {
3274
3295
  tasks: s.array(z).describe("The found completed tasks."),
3275
3296
  nextCursor: s.string().optional().describe("Cursor for the next page of results."),
3276
3297
  totalCount: s.number().describe("The total number of tasks in this page."),
3277
3298
  hasMore: s.boolean().describe("Whether there are more results available."),
3278
3299
  appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
3279
- }, Gn = {
3280
- name: g.FIND_COMPLETED_TASKS,
3300
+ }, Vn = {
3301
+ name: y.FIND_COMPLETED_TASKS,
3281
3302
  description: "Get completed tasks. since/until are optional and default to a 7-day window when omitted. Includes all collaborators by default. Person-specific queries (summaries, plans, reports) require responsibleUser.",
3282
- parameters: Yn,
3283
- outputSchema: zn,
3303
+ parameters: Gn,
3304
+ outputSchema: Kn,
3284
3305
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3285
3306
  async execute(e, t) {
3286
3307
  const { getBy: r, labels: o, labelsOperator: n, since: a, until: i, responsibleUser: c, projectId: l, ...d } = e;
@@ -3291,10 +3312,10 @@ const Yn = {
3291
3312
  const u = await tt(t, c), p = u?.email;
3292
3313
  let m = ut(o, n);
3293
3314
  u && p && (m = de(m, `assigned to: ${p}`));
3294
- const y = await t.getUser(), f = y.tzInfo?.gmtString || "+00:00", I = await ue({
3315
+ const g = await t.getUser(), f = g.tzInfo?.gmtString || "+00:00", I = await ue({
3295
3316
  projectId: l,
3296
- user: y
3297
- }), C = qn({
3317
+ user: g
3318
+ }), C = zn({
3298
3319
  since: a,
3299
3320
  until: i,
3300
3321
  userGmtOffset: f
@@ -3316,7 +3337,7 @@ const Yn = {
3316
3337
  ...m ? { filterQuery: m, filterLang: "en" } : {}
3317
3338
  }), D = b.map(M);
3318
3339
  return {
3319
- textContent: Kn({
3340
+ textContent: Jn({
3320
3341
  tasks: D,
3321
3342
  args: k,
3322
3343
  nextCursor: S,
@@ -3332,7 +3353,7 @@ const Yn = {
3332
3353
  };
3333
3354
  }
3334
3355
  };
3335
- function Kn({
3356
+ function Jn({
3336
3357
  tasks: e,
3337
3358
  args: t,
3338
3359
  nextCursor: r,
@@ -3358,7 +3379,7 @@ function Kn({
3358
3379
  zeroReasonHints: c
3359
3380
  });
3360
3381
  }
3361
- const Vn = {
3382
+ const Xn = {
3362
3383
  searchText: s.string().optional().describe(
3363
3384
  '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.'
3364
3385
  ),
@@ -3366,7 +3387,7 @@ const Vn = {
3366
3387
  cursor: s.string().optional().describe(
3367
3388
  "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."
3368
3389
  )
3369
- }, Jn = {
3390
+ }, Zn = {
3370
3391
  labels: s.array(me).describe("The found personal labels."),
3371
3392
  nextCursor: s.string().optional().describe("Cursor for the next page of results."),
3372
3393
  totalCount: s.number().describe("The total number of labels in this page."),
@@ -3375,22 +3396,22 @@ const Vn = {
3375
3396
  "Names of all shared labels visible to you. These have no IDs or metadata — use their names directly when filtering tasks."
3376
3397
  ),
3377
3398
  appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
3378
- }, Xn = {
3379
- name: g.FIND_LABELS,
3399
+ }, Qn = {
3400
+ name: y.FIND_LABELS,
3380
3401
  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.",
3381
- parameters: Vn,
3382
- outputSchema: Jn,
3402
+ parameters: Xn,
3403
+ outputSchema: Zn,
3383
3404
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3384
3405
  async execute(e, t) {
3385
3406
  const [r, o] = await Promise.all([
3386
- e.searchText ? eo(t, e.searchText).then((c) => ({
3407
+ e.searchText ? to(t, e.searchText).then((c) => ({
3387
3408
  results: c,
3388
3409
  nextCursor: null
3389
3410
  })) : t.getLabels({ limit: e.limit, cursor: e.cursor ?? null }),
3390
- to(t)
3411
+ so(t)
3391
3412
  ]), { results: n, nextCursor: a } = r, i = e.searchText ? { searchText: e.searchText } : { limit: e.limit, cursor: e.cursor };
3392
3413
  return {
3393
- textContent: Zn({ labels: n, args: e, nextCursor: a, sharedLabels: o }),
3414
+ textContent: ea({ labels: n, args: e, nextCursor: a, sharedLabels: o }),
3394
3415
  structuredContent: {
3395
3416
  labels: n.map((c) => me.parse(c)),
3396
3417
  nextCursor: a ?? void 0,
@@ -3402,7 +3423,7 @@ const Vn = {
3402
3423
  };
3403
3424
  }
3404
3425
  };
3405
- function Zn({
3426
+ function ea({
3406
3427
  labels: e,
3407
3428
  args: t,
3408
3429
  nextCursor: r,
@@ -3410,7 +3431,7 @@ function Zn({
3410
3431
  }) {
3411
3432
  const n = t.searchText ? `All labels matching "${t.searchText}"` : "Labels", a = [];
3412
3433
  t.searchText && a.push(`searchText: "${t.searchText}"`);
3413
- const i = 10, l = e.slice(0, i).map(Eo).join(`
3434
+ const i = 10, l = e.slice(0, i).map(Oo).join(`
3414
3435
  `), d = e.length - i, u = d > 0 ? `${l}
3415
3436
  …and ${d} more` : l, p = [];
3416
3437
  e.length === 0 && (t.searchText ? (p.push("Try broader search terms"), p.push("Check spelling"), p.push("Remove searchText to see all labels")) : p.push("No personal labels created yet"));
@@ -3427,15 +3448,15 @@ No shared labels.`;
3427
3448
  zeroReasonHints: p
3428
3449
  }) + h;
3429
3450
  }
3430
- const { FIND_PROJECTS: us, ADD_TASKS: ps, UPDATE_TASKS: hs } = g, Qn = {
3451
+ const { FIND_PROJECTS: ps, ADD_TASKS: hs, UPDATE_TASKS: ms } = y, ta = {
3431
3452
  projectId: s.string().min(1).optional().describe(
3432
3453
  '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.'
3433
3454
  ),
3434
3455
  searchTerm: s.string().optional().describe(
3435
3456
  "Search for a user by name or email (partial and case insensitive match). If omitted, all users are returned."
3436
3457
  )
3437
- }, ea = {
3438
- collaborators: s.array(lo).describe("The found users."),
3458
+ }, sa = {
3459
+ collaborators: s.array(uo).describe("The found users."),
3439
3460
  projectInfo: s.object({
3440
3461
  id: s.string().describe("The project ID."),
3441
3462
  name: s.string().describe("The project name."),
@@ -3444,16 +3465,16 @@ const { FIND_PROJECTS: us, ADD_TASKS: ps, UPDATE_TASKS: hs } = g, Qn = {
3444
3465
  totalCount: s.number().describe("The total number of users found."),
3445
3466
  totalAvailable: s.number().optional().describe("The total number of available users before the search filter was applied."),
3446
3467
  appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
3447
- }, ta = {
3448
- name: g.FIND_PROJECT_COLLABORATORS,
3468
+ }, ra = {
3469
+ name: y.FIND_PROJECT_COLLABORATORS,
3449
3470
  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.`,
3450
- parameters: Qn,
3451
- outputSchema: ea,
3471
+ parameters: ta,
3472
+ outputSchema: sa,
3452
3473
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3453
3474
  async execute(e, t) {
3454
3475
  const { projectId: r, searchTerm: o } = e;
3455
3476
  if (!r)
3456
- return sa({ searchTerm: o, client: t, appliedFilters: e });
3477
+ return oa({ searchTerm: o, client: t, appliedFilters: e });
3457
3478
  let n = r, a;
3458
3479
  try {
3459
3480
  if (a = await t.getProject(r), !a)
@@ -3464,7 +3485,7 @@ const { FIND_PROJECTS: us, ADD_TASKS: ps, UPDATE_TASKS: hs } = g, Qn = {
3464
3485
 
3465
3486
  **Next steps:**
3466
3487
  • Share the project to enable collaboration
3467
- • Use ${ps} and ${hs} for assignment features once shared`,
3488
+ • Use ${hs} and ${ms} for assignment features once shared`,
3468
3489
  structuredContent: {
3469
3490
  collaborators: [],
3470
3491
  projectInfo: {
@@ -3501,9 +3522,9 @@ const { FIND_PROJECTS: us, ADD_TASKS: ps, UPDATE_TASKS: hs } = g, Qn = {
3501
3522
  appliedFilters: e
3502
3523
  }
3503
3524
  };
3504
- const c = ms(i, o);
3525
+ const c = fs(i, o);
3505
3526
  return {
3506
- textContent: fs({
3527
+ textContent: bs({
3507
3528
  collaborators: c,
3508
3529
  projectName: n,
3509
3530
  searchTerm: o,
@@ -3523,18 +3544,18 @@ const { FIND_PROJECTS: us, ADD_TASKS: ps, UPDATE_TASKS: hs } = g, Qn = {
3523
3544
  };
3524
3545
  }
3525
3546
  };
3526
- async function sa({
3547
+ async function oa({
3527
3548
  searchTerm: e,
3528
3549
  client: t,
3529
3550
  appliedFilters: r
3530
3551
  }) {
3531
- const o = await B.getAllCollaborators(t), n = await ra(t, o);
3552
+ const o = await B.getAllCollaborators(t), n = await na(t, o);
3532
3553
  if (n.length === 0)
3533
3554
  return {
3534
3555
  textContent: `No users found. You may have no shared projects, or collaborator data is not accessible.
3535
3556
 
3536
3557
  **Next steps:**
3537
- • Use ${us} to find shared projects
3558
+ • Use ${ps} to find shared projects
3538
3559
  • Share a project to add collaborators
3539
3560
  • Ensure you have permission to view collaborators`,
3540
3561
  structuredContent: {
@@ -3545,9 +3566,9 @@ async function sa({
3545
3566
  appliedFilters: r
3546
3567
  }
3547
3568
  };
3548
- const a = ms(n, e);
3569
+ const a = fs(n, e);
3549
3570
  return {
3550
- textContent: fs({
3571
+ textContent: bs({
3551
3572
  collaborators: a,
3552
3573
  projectName: void 0,
3553
3574
  searchTerm: e,
@@ -3562,7 +3583,7 @@ async function sa({
3562
3583
  }
3563
3584
  };
3564
3585
  }
3565
- async function ra(e, t) {
3586
+ async function na(e, t) {
3566
3587
  try {
3567
3588
  const r = await e.getUser();
3568
3589
  return !r || t.some((o) => o.id === r.id) ? t : [
@@ -3573,7 +3594,7 @@ async function ra(e, t) {
3573
3594
  return t;
3574
3595
  }
3575
3596
  }
3576
- function ms(e, t) {
3597
+ function fs(e, t) {
3577
3598
  if (!t)
3578
3599
  return e;
3579
3600
  const r = t.toLowerCase().trim();
@@ -3581,7 +3602,7 @@ function ms(e, t) {
3581
3602
  (o) => o.name.toLowerCase().includes(r) || o.email.toLowerCase().includes(r)
3582
3603
  );
3583
3604
  }
3584
- function fs({
3605
+ function bs({
3585
3606
  collaborators: e,
3586
3607
  projectName: t,
3587
3608
  searchTerm: r,
@@ -3597,7 +3618,7 @@ function fs({
3597
3618
  const d = [];
3598
3619
  e.length === 0 && r && (d.push(`No users match "${r}"`), d.push("Try a broader search term or check spelling"), o > 0 && d.push(`${o} users available without filter`));
3599
3620
  const u = [];
3600
- return e.length > 0 ? (u.push(`Use ${ps} with responsibleUser to assign new tasks`), u.push(`Use ${hs} with responsibleUser to reassign existing tasks`), u.push("Use user names, emails, or IDs for assignments")) : (u.push(`Use ${us} to find other projects`), r && o > 0 && u.push("Try searching without filters to see all users")), G({
3621
+ return e.length > 0 ? (u.push(`Use ${hs} with responsibleUser to assign new tasks`), u.push(`Use ${ms} with responsibleUser to reassign existing tasks`), u.push("Use user names, emails, or IDs for assignments")) : (u.push(`Use ${ps} to find other projects`), r && o > 0 && u.push("Try searching without filters to see all users")), G({
3601
3622
  subject: i,
3602
3623
  count: e.length,
3603
3624
  filterHints: c,
@@ -3607,11 +3628,11 @@ function fs({
3607
3628
  nextSteps: u
3608
3629
  });
3609
3630
  }
3610
- const { ADD_PROJECTS: Ct } = g, oa = {
3631
+ const { ADD_PROJECTS: $t } = y, aa = {
3611
3632
  active: "projects",
3612
3633
  archived: "archived projects",
3613
3634
  all: "projects (active and archived)"
3614
- }, na = {
3635
+ }, ia = {
3615
3636
  searchText: s.string().optional().describe(
3616
3637
  '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.'
3617
3638
  ),
@@ -3622,26 +3643,26 @@ const { ADD_PROJECTS: Ct } = g, oa = {
3622
3643
  archivedStatus: s.enum(["active", "archived", "all"]).optional().describe(
3623
3644
  "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')."
3624
3645
  )
3625
- }, aa = {
3646
+ }, ca = {
3626
3647
  projects: s.array(Q).describe("The found projects."),
3627
3648
  nextCursor: s.string().optional().describe("Cursor for the next page of results."),
3628
3649
  totalCount: s.number().describe("The total number of projects in this page."),
3629
3650
  hasMore: s.boolean().describe("Whether there are more results available."),
3630
3651
  appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
3631
- }, ia = {
3632
- name: g.FIND_PROJECTS,
3652
+ }, da = {
3653
+ name: y.FIND_PROJECTS,
3633
3654
  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.",
3634
- parameters: na,
3635
- outputSchema: aa,
3655
+ parameters: ia,
3656
+ outputSchema: ca,
3636
3657
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3637
3658
  async execute(e, t) {
3638
3659
  const { searchText: r } = e, o = e.archivedStatus ?? "active";
3639
3660
  let n, a = null;
3640
3661
  if (r || o === "all") {
3641
3662
  const c = Promise.resolve([]), [l, d] = await Promise.all([
3642
- o === "archived" ? c : r ? ts(t, r) : ss(t),
3643
- o === "active" ? c : Zr(t)
3644
- ]), u = r ? Qr(r) : null, p = u ? d.filter((h) => u.test(h.name)) : d;
3663
+ o === "archived" ? c : r ? ss(t, r) : rs(t),
3664
+ o === "active" ? c : Qr(t)
3665
+ ]), u = r ? eo(r) : null, p = u ? d.filter((h) => u.test(h.name)) : d;
3645
3666
  n = [...l, ...p];
3646
3667
  } else {
3647
3668
  const c = o === "archived" ? await t.getArchivedProjects({
@@ -3652,7 +3673,7 @@ const { ADD_PROJECTS: Ct } = g, oa = {
3652
3673
  }
3653
3674
  const i = n.map(Z);
3654
3675
  return {
3655
- textContent: ca({ projects: i, args: e, nextCursor: a }),
3676
+ textContent: la({ projects: i, args: e, nextCursor: a }),
3656
3677
  structuredContent: {
3657
3678
  projects: i,
3658
3679
  nextCursor: a ?? void 0,
@@ -3663,17 +3684,17 @@ const { ADD_PROJECTS: Ct } = g, oa = {
3663
3684
  };
3664
3685
  }
3665
3686
  };
3666
- function ca({
3687
+ function la({
3667
3688
  projects: e,
3668
3689
  args: t,
3669
3690
  nextCursor: r
3670
3691
  }) {
3671
- const o = oa[t.archivedStatus ?? "active"], n = t.searchText ? `All ${o} matching "${t.searchText}"` : `${o.charAt(0).toUpperCase()}${o.slice(1)}`, a = [];
3692
+ const o = aa[t.archivedStatus ?? "active"], n = t.searchText ? `All ${o} matching "${t.searchText}"` : `${o.charAt(0).toUpperCase()}${o.slice(1)}`, a = [];
3672
3693
  t.searchText && a.push(`searchText: "${t.searchText}"`), t.archivedStatus && t.archivedStatus !== "active" && a.push(`archivedStatus: "${t.archivedStatus}"`);
3673
- const i = 10, l = e.slice(0, i).map(Oo).join(`
3694
+ const i = 10, l = e.slice(0, i).map(Po).join(`
3674
3695
  `), d = e.length - i, u = d > 0 ? `${l}
3675
3696
  …and ${d} more` : l, p = [];
3676
- return e.length === 0 && (t.searchText ? (p.push("Try broader search terms"), p.push("Check spelling"), p.push("Remove searchText to see all projects")) : t.archivedStatus === "archived" ? (p.push("No archived projects"), p.push("Use archivedStatus: 'all' to also see active projects")) : t.archivedStatus === "all" ? (p.push("No projects created yet"), p.push(`Use ${Ct} to create a project`)) : (p.push("No active projects"), p.push("Use archivedStatus: 'all' to include archived projects"), p.push(`Use ${Ct} to create a project`))), G({
3697
+ return e.length === 0 && (t.searchText ? (p.push("Try broader search terms"), p.push("Check spelling"), p.push("Remove searchText to see all projects")) : t.archivedStatus === "archived" ? (p.push("No archived projects"), p.push("Use archivedStatus: 'all' to also see active projects")) : t.archivedStatus === "all" ? (p.push("No projects created yet"), p.push(`Use ${$t} to create a project`)) : (p.push("No active projects"), p.push("Use archivedStatus: 'all' to include archived projects"), p.push(`Use ${$t} to create a project`))), G({
3677
3698
  subject: n,
3678
3699
  count: e.length,
3679
3700
  limit: t.searchText || t.archivedStatus === "all" ? void 0 : t.limit,
@@ -3683,22 +3704,22 @@ function ca({
3683
3704
  zeroReasonHints: p
3684
3705
  });
3685
3706
  }
3686
- const da = {
3707
+ const ua = {
3687
3708
  taskId: s.string().optional().describe(
3688
3709
  "Find all reminders for a specific task. Returns both time-based and location reminders."
3689
3710
  ),
3690
3711
  reminderId: s.string().optional().describe("Get a specific time-based reminder (relative or absolute) by its ID."),
3691
3712
  locationReminderId: s.string().optional().describe("Get a specific location reminder by its ID.")
3692
- }, la = {
3713
+ }, pa = {
3693
3714
  reminders: s.array(ot).describe("The found reminders (time-based and location)."),
3694
3715
  searchType: s.string().describe('The search type used: "task", "reminder", or "location_reminder".'),
3695
3716
  searchId: s.string().describe("The ID used for the search."),
3696
3717
  totalCount: s.number().describe("Total reminders in this response.")
3697
- }, ua = {
3698
- name: g.FIND_REMINDERS,
3718
+ }, ha = {
3719
+ name: y.FIND_REMINDERS,
3699
3720
  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.",
3700
- parameters: da,
3701
- outputSchema: la,
3721
+ parameters: ua,
3722
+ outputSchema: pa,
3702
3723
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3703
3724
  async execute(e, t) {
3704
3725
  const { taskId: r, reminderId: o, locationReminderId: n } = e, a = [r, o, n].filter(Boolean);
@@ -3734,17 +3755,17 @@ const da = {
3734
3755
  }
3735
3756
  if (r) {
3736
3757
  const [i, c] = await Promise.all([
3737
- F({
3758
+ H({
3738
3759
  apiMethod: (p) => t.getReminders(p),
3739
3760
  args: { taskId: r }
3740
3761
  }),
3741
- F({
3762
+ H({
3742
3763
  apiMethod: (p) => t.getLocationReminders(p),
3743
3764
  args: { taskId: r }
3744
3765
  })
3745
3766
  ]), d = [...i, ...c].map(ye);
3746
3767
  return {
3747
- textContent: pa(d, r),
3768
+ textContent: ma(d, r),
3748
3769
  structuredContent: {
3749
3770
  reminders: d,
3750
3771
  searchType: "task",
@@ -3756,10 +3777,10 @@ const da = {
3756
3777
  throw new Error("One of taskId, reminderId, or locationReminderId must be provided.");
3757
3778
  }
3758
3779
  };
3759
- function pa(e, t) {
3780
+ function ma(e, t) {
3760
3781
  if (e.length === 0)
3761
3782
  return `No reminders found for task ${t}`;
3762
- const { timeBasedCount: r, locationCount: o } = rs(e), n = [];
3783
+ const { timeBasedCount: r, locationCount: o } = os(e), n = [];
3763
3784
  if (r > 0) {
3764
3785
  const a = r > 1 ? "time-based reminders" : "time-based reminder";
3765
3786
  n.push(`${r} ${a}`);
@@ -3770,22 +3791,22 @@ function pa(e, t) {
3770
3791
  }
3771
3792
  return `Found ${n.join(" and ")} for task ${t}`;
3772
3793
  }
3773
- const { ADD_SECTIONS: ha } = g, ma = {
3794
+ const { ADD_SECTIONS: fa } = y, ba = {
3774
3795
  projectId: s.string().min(1).describe(
3775
3796
  'The ID of the project to search sections in. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
3776
3797
  ),
3777
3798
  searchText: s.string().optional().describe(
3778
3799
  '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.'
3779
3800
  )
3780
- }, fa = {
3801
+ }, ga = {
3781
3802
  sections: s.array(le).describe("The found sections."),
3782
3803
  totalCount: s.number().describe("The total number of sections found."),
3783
3804
  appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
3784
- }, ba = {
3785
- name: g.FIND_SECTIONS,
3805
+ }, ya = {
3806
+ name: y.FIND_SECTIONS,
3786
3807
  description: "Search for sections by name or other criteria in a project. When searching, uses server-side search to avoid fetching all sections.",
3787
- parameters: ma,
3788
- outputSchema: fa,
3808
+ parameters: ba,
3809
+ outputSchema: ga,
3789
3810
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3790
3811
  async execute(e, t) {
3791
3812
  const r = await ue({
@@ -3793,12 +3814,12 @@ const { ADD_SECTIONS: ha } = g, ma = {
3793
3814
  client: t
3794
3815
  });
3795
3816
  let o;
3796
- e.searchText ? o = await so(t, e.searchText, r) : o = (await t.getSections({
3817
+ e.searchText ? o = await ro(t, e.searchText, r) : o = (await t.getSections({
3797
3818
  projectId: r
3798
3819
  })).results;
3799
3820
  const n = o.map(ee);
3800
3821
  return {
3801
- textContent: ga({
3822
+ textContent: ka({
3802
3823
  sections: n,
3803
3824
  projectId: e.projectId,
3804
3825
  searchText: e.searchText
@@ -3811,13 +3832,13 @@ const { ADD_SECTIONS: ha } = g, ma = {
3811
3832
  };
3812
3833
  }
3813
3834
  };
3814
- function ga({
3835
+ function ka({
3815
3836
  sections: e,
3816
3837
  projectId: t,
3817
3838
  searchText: r
3818
3839
  }) {
3819
3840
  const o = [];
3820
- r ? (o.push("Try broader search terms"), o.push("Check spelling"), o.push("Remove searchText to see all sections")) : (o.push("Project has no sections yet"), o.push(`Use ${ha} to create sections`));
3841
+ r ? (o.push("Try broader search terms"), o.push("Check spelling"), o.push("Remove searchText to see all sections")) : (o.push("Project has no sections yet"), o.push(`Use ${fa} to create sections`));
3821
3842
  const n = r ? `Sections in project ${t} matching "${r}"` : `Sections in project ${t}`, a = e.length > 0 ? e.map((i) => ` ${i.name} • id=${i.id}`).join(`
3822
3843
  `) : void 0;
3823
3844
  return G({
@@ -3827,10 +3848,10 @@ function ga({
3827
3848
  zeroReasonHints: o
3828
3849
  });
3829
3850
  }
3830
- function bs(e) {
3851
+ function gs(e) {
3831
3852
  return /* @__PURE__ */ new Date(`${e}T00:00:00`);
3832
3853
  }
3833
- const ya = {
3854
+ const Ta = {
3834
3855
  startDate: s.string().regex(/^(\d{4}-\d{2}-\d{2}|today)$/).optional().describe("The start date to get the tasks for. Format: YYYY-MM-DD or 'today'."),
3835
3856
  overdueOption: s.enum(["overdue-only", "include-overdue", "exclude-overdue"]).optional().describe(
3836
3857
  "How to handle overdue tasks. 'overdue-only' to get only overdue tasks, 'include-overdue' to include overdue tasks along with tasks for the specified date(s), and 'exclude-overdue' to exclude overdue tasks. Default is 'include-overdue'."
@@ -3845,21 +3866,21 @@ const ya = {
3845
3866
  responsibleUser: s.string().optional().describe(
3846
3867
  "Filter tasks assigned to this user. User ID, name, or email. For personal queries (summaries, plans, reports), set to current user from user-info to exclude collaborators."
3847
3868
  ),
3848
- responsibleUserFiltering: s.enum(Qt).optional().describe(
3869
+ responsibleUserFiltering: s.enum(es).optional().describe(
3849
3870
  "Filter when responsibleUser is omitted. 'assigned'=assigned to others; 'unassignedOrMe'=unassigned+mine; 'all'=everyone. Default: 'unassignedOrMe'."
3850
3871
  ),
3851
3872
  ...lt
3852
- }, ka = {
3873
+ }, va = {
3853
3874
  tasks: s.array(z).describe("The found tasks."),
3854
3875
  nextCursor: s.string().optional().describe("Cursor for the next page of results."),
3855
3876
  totalCount: s.number().describe("The total number of tasks in this page."),
3856
3877
  hasMore: s.boolean().describe("Whether there are more results available."),
3857
3878
  appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
3858
- }, Ta = {
3859
- name: g.FIND_TASKS_BY_DATE,
3879
+ }, wa = {
3880
+ name: y.FIND_TASKS_BY_DATE,
3860
3881
  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.",
3861
- parameters: ya,
3862
- outputSchema: ka,
3882
+ parameters: Ta,
3883
+ outputSchema: va,
3863
3884
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3864
3885
  async execute(e, t) {
3865
3886
  if (!e.startDate && e.overdueOption !== "overdue-only")
@@ -3872,17 +3893,17 @@ const ya = {
3872
3893
  a = "overdue";
3873
3894
  else if (e.startDate === "today")
3874
3895
  if (e.daysCount > 1) {
3875
- const p = /* @__PURE__ */ new Date(), h = ce(p), m = Ne(p, e.daysCount), y = pt(m, { representation: "date" }), f = `(due after: ${h} | due: ${h}) & due before: ${y}`;
3896
+ const p = /* @__PURE__ */ new Date(), h = ce(p), m = Ne(p, e.daysCount), g = pt(m, { representation: "date" }), f = `(due after: ${h} | due: ${h}) & due before: ${g}`;
3876
3897
  a = e.overdueOption === "exclude-overdue" ? f : `(${f} | overdue)`;
3877
3898
  } else
3878
3899
  a = e.overdueOption === "exclude-overdue" ? "today" : "(today | overdue)";
3879
3900
  else if (e.startDate) {
3880
- const p = e.startDate, h = Ne(bs(p), e.daysCount), m = pt(h, { representation: "date" });
3901
+ const p = e.startDate, h = Ne(gs(p), e.daysCount), m = pt(h, { representation: "date" });
3881
3902
  a = `(due after: ${p} | due: ${p}) & due before: ${m}`;
3882
3903
  }
3883
3904
  const i = ut(e.labels, e.labelsOperator);
3884
3905
  i.length > 0 && (a = de(a, `(${i})`));
3885
- const c = es({
3906
+ const c = ts({
3886
3907
  resolvedAssigneeId: o,
3887
3908
  assigneeEmail: n,
3888
3909
  responsibleUserFiltering: e.responsibleUserFiltering
@@ -3895,7 +3916,7 @@ const ya = {
3895
3916
  limit: e.limit
3896
3917
  });
3897
3918
  return {
3898
- textContent: wa({ tasks: l, args: e, nextCursor: d, assigneeEmail: n }),
3919
+ textContent: Ia({ tasks: l, args: e, nextCursor: d, assigneeEmail: n }),
3899
3920
  structuredContent: {
3900
3921
  tasks: l,
3901
3922
  nextCursor: d ?? void 0,
@@ -3906,7 +3927,7 @@ const ya = {
3906
3927
  };
3907
3928
  }
3908
3929
  };
3909
- function wa({
3930
+ function Ia({
3910
3931
  tasks: e,
3911
3932
  args: t,
3912
3933
  nextCursor: r,
@@ -3921,7 +3942,7 @@ function wa({
3921
3942
  `today${c}${t.daysCount > 1 ? ` + ${t.daysCount - 1} more days` : ""}`
3922
3943
  );
3923
3944
  } else if (t.startDate) {
3924
- const c = t.daysCount > 1 ? ` to ${ce(Ne(bs(t.startDate), t.daysCount))}` : "";
3945
+ const c = t.daysCount > 1 ? ` to ${ce(Ne(gs(t.startDate), t.daysCount))}` : "";
3925
3946
  n.push(`${t.startDate}${c}`);
3926
3947
  }
3927
3948
  if (t.labels && t.labels.length > 0) {
@@ -3956,13 +3977,13 @@ function wa({
3956
3977
  zeroReasonHints: i
3957
3978
  });
3958
3979
  }
3959
- const va = 300 * 1e3;
3960
- class Ia {
3980
+ const ja = 300 * 1e3;
3981
+ class Sa {
3961
3982
  constructor() {
3962
3983
  this.cache = null;
3963
3984
  }
3964
3985
  async getFilters(t) {
3965
- if (this.cache && Date.now() - this.cache.timestamp < va)
3986
+ if (this.cache && Date.now() - this.cache.timestamp < ja)
3966
3987
  return this.cache.filters;
3967
3988
  const o = ((await t.sync({
3968
3989
  resourceTypes: ["filters"],
@@ -4019,7 +4040,7 @@ ${u}` + (l.length > 5 ? `
4019
4040
  this.cache = null;
4020
4041
  }
4021
4042
  }
4022
- const ja = new Ia(), { FIND_COMPLETED_TASKS: $t, ADD_TASKS: Dt } = g, Sa = {
4043
+ const Ca = new Sa(), { FIND_COMPLETED_TASKS: Dt, ADD_TASKS: At } = y, $a = {
4023
4044
  searchText: s.string().optional().describe("The text to search for in tasks."),
4024
4045
  projectId: s.string().optional().describe(
4025
4046
  'Find tasks in this project. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
@@ -4027,7 +4048,7 @@ const ja = new Ia(), { FIND_COMPLETED_TASKS: $t, ADD_TASKS: Dt } = g, Sa = {
4027
4048
  sectionId: s.string().optional().describe("Find tasks in this section."),
4028
4049
  parentId: s.string().optional().describe("Find subtasks of this parent task."),
4029
4050
  responsibleUser: s.string().optional().describe("Find tasks assigned to this user. Can be a user ID, name, or email address."),
4030
- responsibleUserFiltering: s.enum(Qt).optional().describe(
4051
+ responsibleUserFiltering: s.enum(es).optional().describe(
4031
4052
  'How to filter by responsible user when responsibleUser is not provided. "assigned" = only tasks assigned to others; "unassignedOrMe" = only unassigned tasks or tasks assigned to me; "all" = all tasks regardless of assignment. Default value will be `unassignedOrMe`.'
4032
4053
  ),
4033
4054
  limit: s.number().int().min(1).max($.TASKS_MAX).default($.TASKS_DEFAULT).describe("The maximum number of tasks to return."),
@@ -4041,17 +4062,17 @@ const ja = new Ia(), { FIND_COMPLETED_TASKS: $t, ADD_TASKS: Dt } = g, Sa = {
4041
4062
  "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."
4042
4063
  ),
4043
4064
  ...lt
4044
- }, Ca = {
4065
+ }, Da = {
4045
4066
  tasks: s.array(z).describe("The found tasks."),
4046
4067
  nextCursor: s.string().optional().describe("Cursor for the next page of results."),
4047
4068
  totalCount: s.number().describe("The total number of tasks in this page."),
4048
4069
  hasMore: s.boolean().describe("Whether there are more results available."),
4049
4070
  appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
4050
- }, $a = {
4051
- name: g.FIND_TASKS,
4071
+ }, Aa = {
4072
+ name: y.FIND_TASKS,
4052
4073
  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.",
4053
- parameters: Sa,
4054
- outputSchema: Ca,
4074
+ parameters: $a,
4075
+ outputSchema: Da,
4055
4076
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
4056
4077
  async execute(e, t) {
4057
4078
  const {
@@ -4067,7 +4088,7 @@ const ja = new Ia(), { FIND_COMPLETED_TASKS: $t, ADD_TASKS: Dt } = g, Sa = {
4067
4088
  labelsOperator: p,
4068
4089
  filter: h,
4069
4090
  filterIdOrName: m
4070
- } = e, y = await t.getUser(), f = u && u.length > 0;
4091
+ } = e, g = await t.getUser(), f = u && u.length > 0;
4071
4092
  if (!r && !o && !n && !a && !i && !f && !h && !m)
4072
4093
  throw new Error(
4073
4094
  "At least one filter must be provided: searchText, projectId, sectionId, parentId, responsibleUser, labels, filter, or filterIdOrName"
@@ -4081,39 +4102,39 @@ const ja = new Ia(), { FIND_COMPLETED_TASKS: $t, ADD_TASKS: Dt } = g, Sa = {
4081
4102
  'The `filter`/`filterIdOrName` parameter cannot be combined with projectId, sectionId, or parentId. Use filter syntax instead (e.g. "##ProjectName").'
4082
4103
  );
4083
4104
  let I = h;
4084
- m && (I = (await ja.resolveFilter(t, m)).filterQuery);
4105
+ m && (I = (await Ca.resolveFilter(t, m)).filterQuery);
4085
4106
  const C = await tt(t, i), E = C?.userId, T = C?.email;
4086
4107
  if (o || n || a) {
4087
4108
  const A = {
4088
4109
  limit: l,
4089
4110
  cursor: d ?? null
4090
4111
  };
4091
- o && (A.projectId = await ue({ projectId: o, user: y })), n && (A.sectionId = n), a && (A.parentId = a);
4112
+ o && (A.projectId = await ue({ projectId: o, user: g })), n && (A.sectionId = n), a && (A.parentId = a);
4092
4113
  const { results: fe, nextCursor: K } = await t.getTasks(A), Ae = fe.map(M);
4093
- let H = r ? Ae.filter(
4114
+ let W = r ? Ae.filter(
4094
4115
  (se) => se.content.toLowerCase().includes(r.toLowerCase()) || se.description?.toLowerCase().includes(r.toLowerCase())
4095
4116
  ) : Ae;
4096
- return H = Xr({
4097
- tasks: H,
4117
+ return W = Zr({
4118
+ tasks: W,
4098
4119
  resolvedAssigneeId: E,
4099
- currentUserId: y.id,
4120
+ currentUserId: g.id,
4100
4121
  responsibleUserFiltering: c
4101
- }), u && u.length > 0 && (H = p === "and" ? H.filter(
4122
+ }), u && u.length > 0 && (W = p === "and" ? W.filter(
4102
4123
  (se) => u.every((xe) => se.labels.includes(xe))
4103
- ) : H.filter(
4124
+ ) : W.filter(
4104
4125
  (se) => u.some((xe) => se.labels.includes(xe))
4105
4126
  )), {
4106
4127
  textContent: Pe({
4107
- tasks: H,
4128
+ tasks: W,
4108
4129
  args: e,
4109
4130
  nextCursor: K,
4110
4131
  isContainerSearch: !0,
4111
4132
  assigneeEmail: T
4112
4133
  }),
4113
4134
  structuredContent: {
4114
- tasks: H,
4135
+ tasks: W,
4115
4136
  nextCursor: K ?? void 0,
4116
- totalCount: H.length,
4137
+ totalCount: W.length,
4117
4138
  hasMore: !!K,
4118
4139
  appliedFilters: e
4119
4140
  }
@@ -4147,7 +4168,7 @@ const ja = new Ia(), { FIND_COMPLETED_TASKS: $t, ADD_TASKS: Dt } = g, Sa = {
4147
4168
  r && (j = de(j, `search: ${r}`));
4148
4169
  const x = ut(u, p);
4149
4170
  if (j = de(j, x), !(m && !i && !c)) {
4150
- const A = es({
4171
+ const A = ts({
4151
4172
  resolvedAssigneeId: E,
4152
4173
  assigneeEmail: T,
4153
4174
  responsibleUserFiltering: c
@@ -4178,12 +4199,12 @@ const ja = new Ia(), { FIND_COMPLETED_TASKS: $t, ADD_TASKS: Dt } = g, Sa = {
4178
4199
  };
4179
4200
  }
4180
4201
  };
4181
- function Da(e) {
4202
+ function xa(e) {
4182
4203
  if (e.projectId) {
4183
4204
  const t = [
4184
4205
  e.searchText ? "No tasks in project match search" : "Project has no tasks yet"
4185
4206
  ];
4186
- return e.searchText || t.push(`Use ${Dt} to create tasks`), t;
4207
+ return e.searchText || t.push(`Use ${At} to create tasks`), t;
4187
4208
  }
4188
4209
  if (e.sectionId) {
4189
4210
  const t = [e.searchText ? "No tasks in section match search" : "Section is empty"];
@@ -4191,7 +4212,7 @@ function Da(e) {
4191
4212
  }
4192
4213
  if (e.parentId) {
4193
4214
  const t = [e.searchText ? "No subtasks match search" : "No subtasks created yet"];
4194
- return e.searchText || t.push(`Use ${Dt} with parentId to add subtasks`), t;
4215
+ return e.searchText || t.push(`Use ${At} with parentId to add subtasks`), t;
4195
4216
  }
4196
4217
  return [];
4197
4218
  }
@@ -4213,7 +4234,7 @@ function Pe({
4213
4234
  const l = t.labels.map((d) => `@${d}`).join(t.labelsOperator === "and" ? " & " : " | ");
4214
4235
  i.push(`labels: ${l}`);
4215
4236
  }
4216
- e.length === 0 && c.push(...Da(t));
4237
+ e.length === 0 && c.push(...xa(t));
4217
4238
  } else {
4218
4239
  const l = n || t.responsibleUser, d = [];
4219
4240
  if (t.filter && d.push(`filter: ${t.filter}`), t.searchText && d.push(`"${t.searchText}"`), t.responsibleUser && d.push(`assigned to ${l}`), t.labels && t.labels.length > 0) {
@@ -4227,9 +4248,9 @@ function Pe({
4227
4248
  if (e.length === 0) {
4228
4249
  if (t.responsibleUser) {
4229
4250
  const u = n || t.responsibleUser;
4230
- c.push(`No tasks assigned to ${u}`), c.push("Check if the user name is correct"), c.push(`Check completed tasks with ${$t}`);
4251
+ c.push(`No tasks assigned to ${u}`), c.push("Check if the user name is correct"), c.push(`Check completed tasks with ${Dt}`);
4231
4252
  }
4232
- t.searchText && (c.push("Try broader search terms"), c.push("Verify spelling and try partial words"), t.responsibleUser || c.push(`Check completed tasks with ${$t}`));
4253
+ 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}`));
4233
4254
  }
4234
4255
  }
4235
4256
  return G({
@@ -4242,11 +4263,11 @@ function Pe({
4242
4263
  zeroReasonHints: c
4243
4264
  });
4244
4265
  }
4245
- const Aa = {
4266
+ const Ea = {
4246
4267
  projectId: s.string().min(1).optional().describe(
4247
4268
  "Optional project ID. If provided, shows detailed overview of that project. If omitted, shows overview of all projects."
4248
4269
  )
4249
- }, gs = s.lazy(
4270
+ }, ys = s.lazy(
4250
4271
  () => s.object({
4251
4272
  id: s.string().describe("The project ID."),
4252
4273
  name: s.string().describe("The project name."),
@@ -4259,9 +4280,9 @@ const Aa = {
4259
4280
  name: s.string()
4260
4281
  })
4261
4282
  ),
4262
- children: s.array(gs).describe("Nested child projects.")
4283
+ children: s.array(ys).describe("Nested child projects.")
4263
4284
  })
4264
- ), xa = {
4285
+ ), Oa = {
4265
4286
  type: s.enum(["account_overview", "project_overview"]).describe("The type of overview returned."),
4266
4287
  totalProjects: s.number().optional().describe("Total number of projects (account overview only)."),
4267
4288
  totalTasks: s.number().optional().describe("Total number of tasks."),
@@ -4280,7 +4301,7 @@ const Aa = {
4280
4301
  name: s.string().describe("The inbox project name."),
4281
4302
  sections: s.array(le).describe("Sections in the inbox project.")
4282
4303
  }).nullable().optional().describe("Inbox information (account overview only)."),
4283
- projects: s.array(s.lazy(() => gs)).optional().describe(
4304
+ projects: s.array(s.lazy(() => ys)).optional().describe(
4284
4305
  "List of projects with hierarchy, folders, and ordering (account overview only)."
4285
4306
  ),
4286
4307
  project: s.object({
@@ -4295,7 +4316,7 @@ const Aa = {
4295
4316
  tasksWithoutSection: s.number()
4296
4317
  }).optional().describe("Statistics object (project overview only).")
4297
4318
  };
4298
- function Ea(e) {
4319
+ function Pa(e) {
4299
4320
  const t = {};
4300
4321
  for (const n of e)
4301
4322
  t[n.id] = {
@@ -4320,7 +4341,7 @@ function Ea(e) {
4320
4341
  }
4321
4342
  return o(r), r;
4322
4343
  }
4323
- async function Oa(e, t) {
4344
+ async function Ra(e, t) {
4324
4345
  const r = {};
4325
4346
  return await Promise.all(
4326
4347
  t.map(async (o) => {
@@ -4329,17 +4350,17 @@ async function Oa(e, t) {
4329
4350
  })
4330
4351
  ), r;
4331
4352
  }
4332
- function ys(e, t, r = "") {
4353
+ function ks(e, t, r = "") {
4333
4354
  const o = [];
4334
4355
  o.push(`${r}- Project: ${e.name} (id=${e.id})`);
4335
4356
  const n = t[e.id] || [];
4336
4357
  for (const a of n)
4337
4358
  o.push(`${r} - Section: ${a.name} (id=${a.id})`);
4338
4359
  for (const a of e.children)
4339
- o.push(...ys(a, t, `${r} `));
4360
+ o.push(...ks(a, t, `${r} `));
4340
4361
  return o;
4341
4362
  }
4342
- function At(e) {
4363
+ function xt(e) {
4343
4364
  const t = {};
4344
4365
  for (const o of e)
4345
4366
  t[o.id] = { ...o, children: [] };
@@ -4364,7 +4385,7 @@ function Ke(e, t = "") {
4364
4385
  }
4365
4386
  return r;
4366
4387
  }
4367
- function ks(e, t) {
4388
+ function Ts(e, t) {
4368
4389
  return {
4369
4390
  id: e.id,
4370
4391
  name: e.name,
@@ -4373,11 +4394,11 @@ function ks(e, t) {
4373
4394
  childOrder: e.childOrder,
4374
4395
  sections: (t[e.id] || []).map(ee),
4375
4396
  children: e.children.map(
4376
- (r) => ks(r, t)
4397
+ (r) => Ts(r, t)
4377
4398
  )
4378
4399
  };
4379
4400
  }
4380
- async function Pa(e, t) {
4401
+ async function _a(e, t) {
4381
4402
  let r = [], o;
4382
4403
  do {
4383
4404
  const { results: n, nextCursor: a } = await e.getTasks({
@@ -4389,12 +4410,12 @@ async function Pa(e, t) {
4389
4410
  } while (o);
4390
4411
  return r;
4391
4412
  }
4392
- async function Ra(e, t) {
4413
+ async function Ua(e, t) {
4393
4414
  const { results: r } = await e.getSections({ projectId: t });
4394
4415
  return r;
4395
4416
  }
4396
- async function _a(e) {
4397
- const { results: t } = await e.getProjects({}), r = t.find((p) => q(p) && p.inboxProject === !0), o = t.filter((p) => !q(p) || p.inboxProject !== !0), n = Ea(o), a = t.map((p) => p.id), i = await Oa(e, a), c = ["# Personal Projects", ""];
4417
+ async function Ma(e) {
4418
+ const { results: t } = await e.getProjects({}), r = t.find((p) => q(p) && p.inboxProject === !0), o = t.filter((p) => !q(p) || p.inboxProject !== !0), n = Pa(o), a = t.map((p) => p.id), i = await Ra(e, a), c = ["# Personal Projects", ""];
4398
4419
  if (r) {
4399
4420
  c.push(`- Inbox Project: ${r.name} (id=${r.id})`);
4400
4421
  for (const p of i[r.id] || [])
@@ -4402,7 +4423,7 @@ async function _a(e) {
4402
4423
  }
4403
4424
  if (n.length)
4404
4425
  for (const p of n)
4405
- c.push(...ys(p, i));
4426
+ c.push(...ks(p, i));
4406
4427
  else
4407
4428
  c.push("_No projects found._");
4408
4429
  c.push("");
@@ -4420,7 +4441,7 @@ async function _a(e) {
4420
4441
  sections: (i[r.id] || []).map(ee)
4421
4442
  } : null,
4422
4443
  projects: n.map(
4423
- (p) => ks(p, i)
4444
+ (p) => Ts(p, i)
4424
4445
  ),
4425
4446
  totalProjects: t.length,
4426
4447
  totalSections: a.reduce(
@@ -4431,11 +4452,11 @@ async function _a(e) {
4431
4452
  };
4432
4453
  return { textContent: d, structuredContent: u };
4433
4454
  }
4434
- async function Ua(e, t) {
4455
+ async function Na(e, t) {
4435
4456
  const [r, o, n] = await Promise.all([
4436
4457
  e.getProject(t),
4437
- Ra(e, t),
4438
- Pa(e, t)
4458
+ Ua(e, t),
4459
+ _a(e, t)
4439
4460
  ]), a = {};
4440
4461
  for (const u of o)
4441
4462
  a[u.id] = [];
@@ -4445,7 +4466,7 @@ async function Ua(e, t) {
4445
4466
  const c = [`# ${r.name}`];
4446
4467
  if (i.length > 0) {
4447
4468
  c.push("");
4448
- const u = At(i);
4469
+ const u = xt(i);
4449
4470
  c.push(...Ke(u));
4450
4471
  }
4451
4472
  for (const u of o) {
@@ -4453,7 +4474,7 @@ async function Ua(e, t) {
4453
4474
  const p = a[u.id];
4454
4475
  if (!p?.length)
4455
4476
  continue;
4456
- const h = At(p);
4477
+ const h = xt(p);
4457
4478
  c.push(...Ke(h));
4458
4479
  }
4459
4480
  const l = c.join(`
@@ -4477,33 +4498,33 @@ async function Ua(e, t) {
4477
4498
  };
4478
4499
  return { textContent: l, structuredContent: d };
4479
4500
  }
4480
- const Ma = {
4481
- name: g.GET_OVERVIEW,
4501
+ const La = {
4502
+ name: y.GET_OVERVIEW,
4482
4503
  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.",
4483
- parameters: Aa,
4484
- outputSchema: xa,
4504
+ parameters: Ea,
4505
+ outputSchema: Oa,
4485
4506
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
4486
4507
  async execute(e, t) {
4487
- const r = e.projectId ? await Ua(t, e.projectId) : await _a(t);
4508
+ const r = e.projectId ? await Na(t, e.projectId) : await Ma(t);
4488
4509
  return {
4489
4510
  textContent: r.textContent,
4490
4511
  structuredContent: r.structuredContent
4491
4512
  };
4492
4513
  }
4493
- }, Na = {}, ie = s.object({
4514
+ }, Fa = {}, ie = s.object({
4494
4515
  count: s.number().describe("Number of consecutive periods in this streak."),
4495
4516
  start: s.string().describe("Start date of the streak."),
4496
4517
  end: s.string().describe("End date of the streak.")
4497
- }), xt = s.object({
4518
+ }), Et = s.object({
4498
4519
  id: s.string().describe("Project ID."),
4499
4520
  completed: s.number().describe("Number of tasks completed in this project.")
4500
- }), La = {
4521
+ }), Ha = {
4501
4522
  completedCount: s.number().describe("Total number of completed tasks (all-time)."),
4502
4523
  daysItems: s.array(
4503
4524
  s.object({
4504
4525
  date: s.string().describe("Date string (YYYY-MM-DD)."),
4505
4526
  totalCompleted: s.number().describe("Total tasks completed on this day."),
4506
- items: s.array(xt).describe("Per-project completion breakdown for this day.")
4527
+ items: s.array(Et).describe("Per-project completion breakdown for this day.")
4507
4528
  })
4508
4529
  ).describe("Daily completion breakdown (most recent days)."),
4509
4530
  weekItems: s.array(
@@ -4511,7 +4532,7 @@ const Ma = {
4511
4532
  from: s.string().describe("Start date of the week."),
4512
4533
  to: s.string().describe("End date of the week."),
4513
4534
  totalCompleted: s.number().describe("Total tasks completed in this week."),
4514
- items: s.array(xt).describe("Per-project completion breakdown for this week.")
4535
+ items: s.array(Et).describe("Per-project completion breakdown for this week.")
4515
4536
  })
4516
4537
  ).describe("Weekly completion breakdown (most recent weeks)."),
4517
4538
  goals: s.object({
@@ -4546,11 +4567,11 @@ const Ma = {
4546
4567
  })
4547
4568
  ).describe("Recent karma change events with reasons."),
4548
4569
  projectColors: s.record(s.string(), s.string()).describe("Map of project ID to color key.")
4549
- }, Fa = {
4550
- name: g.GET_PRODUCTIVITY_STATS,
4570
+ }, Wa = {
4571
+ name: y.GET_PRODUCTIVITY_STATS,
4551
4572
  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.",
4552
- parameters: Na,
4553
- outputSchema: La,
4573
+ parameters: Fa,
4574
+ outputSchema: Ha,
4554
4575
  annotations: {
4555
4576
  readOnlyHint: !0,
4556
4577
  destructiveHint: !1,
@@ -4559,7 +4580,7 @@ const Ma = {
4559
4580
  async execute(e, t) {
4560
4581
  const r = await t.getProductivityStats();
4561
4582
  return {
4562
- textContent: Ha(r),
4583
+ textContent: Ba(r),
4563
4584
  structuredContent: {
4564
4585
  completedCount: r.completedCount,
4565
4586
  daysItems: r.daysItems,
@@ -4586,7 +4607,7 @@ const Ma = {
4586
4607
  };
4587
4608
  }
4588
4609
  };
4589
- function Ha(e) {
4610
+ function Ba(e) {
4590
4611
  const t = [
4591
4612
  "# Productivity Statistics",
4592
4613
  "",
@@ -4616,11 +4637,11 @@ function Ha(e) {
4616
4637
  return t.join(`
4617
4638
  `);
4618
4639
  }
4619
- const Wa = {
4640
+ const qa = {
4620
4641
  projectId: s.string().min(1).describe("The ID of the project to get activity stats for."),
4621
4642
  weeks: s.number().int().min(1).max(12).optional().describe("Number of weeks of activity data to retrieve (1-12, default 2)."),
4622
4643
  includeWeeklyCounts: s.boolean().optional().describe("Include weekly rollup counts alongside daily counts.")
4623
- }, Ba = {
4644
+ }, Ya = {
4624
4645
  projectId: s.string().describe("The project ID."),
4625
4646
  dayItems: s.array(
4626
4647
  s.object({
@@ -4636,7 +4657,7 @@ const Wa = {
4636
4657
  })
4637
4658
  ).nullable().describe("Weekly completion rollups. Only included when includeWeeklyCounts is true.")
4638
4659
  };
4639
- function qa(e, t) {
4660
+ function za(e, t) {
4640
4661
  const r = [`# Activity Stats: Project ${e}`, ""];
4641
4662
  if (t.dayItems.length > 0) {
4642
4663
  r.push("## Daily Activity");
@@ -4652,11 +4673,11 @@ function qa(e, t) {
4652
4673
  return r.join(`
4653
4674
  `);
4654
4675
  }
4655
- const Ya = {
4656
- name: g.GET_PROJECT_ACTIVITY_STATS,
4676
+ const Ga = {
4677
+ name: y.GET_PROJECT_ACTIVITY_STATS,
4657
4678
  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.",
4658
- parameters: Wa,
4659
- outputSchema: Ba,
4679
+ parameters: qa,
4680
+ outputSchema: Ya,
4660
4681
  annotations: {
4661
4682
  readOnlyHint: !0,
4662
4683
  destructiveHint: !1,
@@ -4668,7 +4689,7 @@ const Ya = {
4668
4689
  includeWeeklyCounts: n
4669
4690
  });
4670
4691
  return {
4671
- textContent: qa(r, a),
4692
+ textContent: za(r, a),
4672
4693
  structuredContent: {
4673
4694
  projectId: r,
4674
4695
  dayItems: a.dayItems,
@@ -4676,15 +4697,15 @@ const Ya = {
4676
4697
  }
4677
4698
  };
4678
4699
  }
4679
- }, za = {
4700
+ }, Ka = {
4680
4701
  projectId: s.string().min(1).describe("The ID of the project to check health for."),
4681
4702
  includeContext: s.boolean().default(!1).describe(
4682
4703
  "Include detailed health context with project metrics and task-level data. May produce large output for projects with many tasks."
4683
4704
  )
4684
- }, Ga = s.object({
4705
+ }, Va = s.object({
4685
4706
  taskId: s.string().describe("The ID of the task this recommendation is for."),
4686
4707
  recommendation: s.string().describe("The recommendation for this task.")
4687
- }), Ka = s.object({
4708
+ }), Ja = s.object({
4688
4709
  id: s.string().describe("The task ID."),
4689
4710
  content: s.string().describe("The task content/title."),
4690
4711
  priority: s.string().describe("The task priority (1-4)."),
@@ -4692,7 +4713,7 @@ const Ya = {
4692
4713
  deadline: s.string().nullable().optional().describe("The deadline date string, if set."),
4693
4714
  isCompleted: s.boolean().describe("Whether the task is completed."),
4694
4715
  labels: s.array(s.string()).describe("Labels applied to this task.")
4695
- }), Va = {
4716
+ }), Xa = {
4696
4717
  projectId: s.string().describe("The project ID."),
4697
4718
  projectName: s.string().describe("The project name."),
4698
4719
  progress: s.object({
@@ -4704,7 +4725,7 @@ const Ya = {
4704
4725
  status: s.enum(Je).describe("The overall health status of the project."),
4705
4726
  description: s.string().nullable().optional().describe("Detailed description of the health assessment."),
4706
4727
  descriptionSummary: s.string().nullable().optional().describe("Brief summary of the health assessment."),
4707
- taskRecommendations: s.array(Ga).nullable().optional().describe("Specific recommendations for individual tasks."),
4728
+ taskRecommendations: s.array(Va).nullable().optional().describe("Specific recommendations for individual tasks."),
4708
4729
  isStale: s.boolean().describe("Whether the health data is stale and may need refreshing."),
4709
4730
  updateInProgress: s.boolean().describe("Whether a health analysis update is currently in progress."),
4710
4731
  updatedAt: s.string().nullable().optional().describe("When the health assessment was last updated.")
@@ -4719,12 +4740,12 @@ const Ya = {
4719
4740
  tasksCompletedThisWeek: s.number().describe("Tasks completed in the current week."),
4720
4741
  averageCompletionTime: s.number().nullable().describe("Average task completion time in days, if available.")
4721
4742
  }).describe("Aggregated project metrics."),
4722
- tasks: s.array(Ka).describe("Tasks in the project.")
4743
+ tasks: s.array(Ja).describe("Tasks in the project.")
4723
4744
  }).optional().describe(
4724
4745
  "Detailed project context with metrics and task data. Only included when includeContext is true."
4725
4746
  )
4726
4747
  };
4727
- async function Ja(e, t, r) {
4748
+ async function Za(e, t, r) {
4728
4749
  if (r) {
4729
4750
  const [a, i, c] = await Promise.all([
4730
4751
  e.getProjectProgress(t),
@@ -4739,7 +4760,7 @@ async function Ja(e, t, r) {
4739
4760
  ]);
4740
4761
  return { progress: o, health: n };
4741
4762
  }
4742
- function Xa(e, { progress: t, health: r, context: o }) {
4763
+ function Qa(e, { progress: t, health: r, context: o }) {
4743
4764
  const n = [`# Project Health: ${e}`, ""];
4744
4765
  if (n.push(`**Status:** ${r.status}`), r.isStale && n.push("**Note:** Health data is stale and may not reflect recent changes."), r.updateInProgress && n.push("**Note:** A health analysis update is currently in progress."), r.updatedAt && n.push(`**Last Updated:** ${r.updatedAt.toISOString()}`), n.push(""), n.push("## Progress"), n.push(
4745
4766
  `**Completed:** ${t.completedCount} | **Active:** ${t.activeCount} | **Progress:** ${t.progressPercent}%`
@@ -4762,18 +4783,18 @@ function Xa(e, { progress: t, health: r, context: o }) {
4762
4783
  return n.join(`
4763
4784
  `);
4764
4785
  }
4765
- const Za = {
4766
- name: g.GET_PROJECT_HEALTH,
4786
+ const ei = {
4787
+ name: y.GET_PROJECT_HEALTH,
4767
4788
  description: "Get a comprehensive health assessment for a project including completion progress, health status (EXCELLENT, ON_TRACK, AT_RISK, CRITICAL), and optional detailed context with project metrics and task-level recommendations. Use includeContext=true for full detail including task data.",
4768
- parameters: za,
4769
- outputSchema: Va,
4789
+ parameters: Ka,
4790
+ outputSchema: Xa,
4770
4791
  annotations: {
4771
4792
  readOnlyHint: !0,
4772
4793
  destructiveHint: !1,
4773
4794
  idempotentHint: !0
4774
4795
  },
4775
4796
  async execute(e, t) {
4776
- const { projectId: r, includeContext: o } = e, n = await Ja(t, r, o), a = n.context?.projectName ?? `Project ${r}`, i = Xa(a, n), c = n.context ? {
4797
+ const { projectId: r, includeContext: o } = e, n = await Za(t, r, o), a = n.context?.projectName ?? `Project ${r}`, i = Qa(a, n), c = n.context ? {
4777
4798
  projectDescription: n.context.projectDescription,
4778
4799
  projectMetrics: n.context.projectMetrics,
4779
4800
  tasks: n.context.tasks.map((l) => ({
@@ -4809,12 +4830,12 @@ const Za = {
4809
4830
  }
4810
4831
  };
4811
4832
  }
4812
- }, Qa = {
4833
+ }, ti = {
4813
4834
  workspaceIdOrName: s.string().min(1).describe(
4814
4835
  "The workspace ID or name. Supports exact ID, exact name match (case-insensitive), or unique partial name match."
4815
4836
  ),
4816
4837
  projectIds: s.array(s.string().min(1)).min(1).optional().describe("Optional list of project IDs to scope insights to specific projects.")
4817
- }, ei = s.object({
4838
+ }, si = s.object({
4818
4839
  projectId: s.string().describe("The project ID."),
4819
4840
  health: s.object({
4820
4841
  status: s.enum(Je).describe("The health status of the project."),
@@ -4826,23 +4847,23 @@ const Za = {
4826
4847
  activeCount: s.number().describe("Number of active tasks."),
4827
4848
  progressPercent: s.number().describe("Completion percentage (0-100).")
4828
4849
  }).nullable().describe("Progress data for this project, if available.")
4829
- }), ti = {
4850
+ }), ri = {
4830
4851
  workspaceId: s.string().describe("The resolved workspace ID."),
4831
4852
  workspaceName: s.string().describe("The resolved workspace name."),
4832
4853
  folderId: s.string().nullable().describe("The folder ID, if applicable."),
4833
- projectInsights: s.array(ei).describe("Health and progress insights for each project in the workspace.")
4834
- }, si = {
4835
- name: g.GET_WORKSPACE_INSIGHTS,
4854
+ projectInsights: s.array(si).describe("Health and progress insights for each project in the workspace.")
4855
+ }, oi = {
4856
+ name: y.GET_WORKSPACE_INSIGHTS,
4836
4857
  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.",
4837
- parameters: Qa,
4838
- outputSchema: ti,
4858
+ parameters: ti,
4859
+ outputSchema: ri,
4839
4860
  annotations: {
4840
4861
  readOnlyHint: !0,
4841
4862
  destructiveHint: !1,
4842
4863
  idempotentHint: !0
4843
4864
  },
4844
4865
  async execute(e, t) {
4845
- const { workspaceIdOrName: r, projectIds: o } = e, n = await ns.resolveWorkspace(t, r), a = await t.getWorkspaceInsights(n.workspaceId, { projectIds: o }), i = a.projectInsights.map((l) => ({
4866
+ const { workspaceIdOrName: r, projectIds: o } = e, n = await as.resolveWorkspace(t, r), a = await t.getWorkspaceInsights(n.workspaceId, { projectIds: o }), i = a.projectInsights.map((l) => ({
4846
4867
  projectId: l.projectId,
4847
4868
  health: l.health ? {
4848
4869
  status: l.health.status,
@@ -4875,21 +4896,21 @@ const Za = {
4875
4896
  }
4876
4897
  };
4877
4898
  }
4878
- }, ri = {}, oi = {
4899
+ }, ni = {}, ai = {
4879
4900
  id: s.string().describe("The unique identifier for the workspace."),
4880
4901
  name: s.string().describe("The name of the workspace."),
4881
- plan: s.enum(Ns).describe("The workspace plan type."),
4882
- role: s.enum(Ms).optional().describe("The user's role in the workspace, if available."),
4902
+ plan: s.enum(Ls).describe("The workspace plan type."),
4903
+ role: s.enum(Ns).optional().describe("The user's role in the workspace, if available."),
4883
4904
  isLinkSharingEnabled: s.boolean().describe("Whether link sharing is enabled for the workspace."),
4884
4905
  isGuestAllowed: s.boolean().describe("Whether guests are allowed in the workspace."),
4885
4906
  createdAt: s.string().optional().describe("The ISO 8601 timestamp when the workspace was created."),
4886
4907
  creatorId: s.string().describe("The ID of the user who created the workspace.")
4887
- }, ni = {
4908
+ }, ii = {
4888
4909
  type: s.literal("workspaces").describe("The type of the response."),
4889
- workspaces: s.array(s.object(oi)).describe("List of workspaces."),
4910
+ workspaces: s.array(s.object(ai)).describe("List of workspaces."),
4890
4911
  count: s.number().describe("The total number of workspaces.")
4891
4912
  };
4892
- async function ai(e) {
4913
+ async function ci(e) {
4893
4914
  const r = (await e.getWorkspaces()).map((i) => ({
4894
4915
  id: i.id,
4895
4916
  name: i.name,
@@ -4920,22 +4941,22 @@ async function ai(e) {
4920
4941
  };
4921
4942
  return { textContent: n, structuredContent: a };
4922
4943
  }
4923
- const ii = {
4924
- name: g.LIST_WORKSPACES,
4944
+ const di = {
4945
+ name: y.LIST_WORKSPACES,
4925
4946
  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.",
4926
- parameters: ri,
4927
- outputSchema: ni,
4947
+ parameters: ni,
4948
+ outputSchema: ii,
4928
4949
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
4929
4950
  async execute(e, t) {
4930
- const r = await ai(t);
4951
+ const r = await ci(t);
4931
4952
  return {
4932
4953
  textContent: r.textContent,
4933
4954
  structuredContent: r.structuredContent
4934
4955
  };
4935
4956
  }
4936
- }, { FIND_TASKS: ci, FIND_PROJECT_COLLABORATORS: Et, UPDATE_TASKS: di } = g, li = 50, ui = {
4957
+ }, { FIND_TASKS: li, FIND_PROJECT_COLLABORATORS: Ot, UPDATE_TASKS: ui } = y, pi = 50, hi = {
4937
4958
  operation: s.enum(["assign", "unassign", "reassign"]).describe("The assignment operation to perform."),
4938
- taskIds: s.array(s.string()).min(1).max(li).describe("The IDs of the tasks to operate on (max 50)."),
4959
+ taskIds: s.array(s.string()).min(1).max(pi).describe("The IDs of the tasks to operate on (max 50)."),
4939
4960
  responsibleUser: s.string().optional().describe(
4940
4961
  '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.'
4941
4962
  ),
@@ -4943,7 +4964,7 @@ const ii = {
4943
4964
  "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."
4944
4965
  ),
4945
4966
  dryRun: s.boolean().optional().default(!1).describe("If true, validates operations without executing them.")
4946
- }, pi = {
4967
+ }, mi = {
4947
4968
  results: s.array(
4948
4969
  s.object({
4949
4970
  taskId: s.string().describe("The ID of the task."),
@@ -4959,11 +4980,11 @@ const ii = {
4959
4980
  failed: s.number().describe("Number of failed operations."),
4960
4981
  dryRun: s.boolean().describe("Whether this was a dry run.")
4961
4982
  }).optional().describe("Summary of the operation.")
4962
- }, hi = {
4963
- name: g.MANAGE_ASSIGNMENTS,
4983
+ }, fi = {
4984
+ name: y.MANAGE_ASSIGNMENTS,
4964
4985
  description: "Bulk assignment operations for multiple tasks. Supports assign, unassign, and reassign operations with atomic rollback on failures.",
4965
- parameters: ui,
4966
- outputSchema: pi,
4986
+ parameters: hi,
4987
+ outputSchema: mi,
4967
4988
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
4968
4989
  async execute(e, t) {
4969
4990
  const { operation: r, taskIds: o, responsibleUser: n, fromAssigneeUser: a, dryRun: i } = e;
@@ -5068,10 +5089,10 @@ const ii = {
5068
5089
  const h = await dt.validateBulkAssignment(
5069
5090
  t,
5070
5091
  p
5071
- ), m = [], y = [];
5092
+ ), m = [], g = [];
5072
5093
  for (let T = 0; T < p.length; T++) {
5073
5094
  const j = p[T], x = h[T];
5074
- j && x?.isValid ? m.push({ assignment: j, validation: x }) : j?.taskId && y.push({
5095
+ j && x?.isValid ? m.push({ assignment: j, validation: x }) : j?.taskId && g.push({
5075
5096
  taskId: j.taskId,
5076
5097
  success: !1,
5077
5098
  error: x?.error?.message || "Validation failed"
@@ -5126,7 +5147,7 @@ const ii = {
5126
5147
  );
5127
5148
  return Promise.all(k);
5128
5149
  }
5129
- const I = await f(m, !i), C = [...I, ...y, ...d];
5150
+ const I = await f(m, !i), C = [...I, ...g, ...d];
5130
5151
  if (C.length > 0 && C.every((T) => !T.success)) {
5131
5152
  const T = C.map((j) => `"${j.taskId}": ${j.error}`).join("; ");
5132
5153
  throw new Error(`All ${C.length} ${r} operation(s) failed: ${T}`);
@@ -5186,30 +5207,30 @@ function Re({
5186
5207
  `;
5187
5208
  }
5188
5209
  return !r && o.length > 0 ? (c += `**Next steps:**
5189
- `, c += `• Use ${ci} with responsibleUser to see ${e === "unassign" ? "unassigned" : "newly assigned"} tasks
5190
- `, c += `• Use ${di} for individual assignment changes
5191
- `, n.length > 0 && (c += `• Check failed tasks and use ${Et} to verify collaborator access
5210
+ `, c += `• Use ${li} with responsibleUser to see ${e === "unassign" ? "unassigned" : "newly assigned"} tasks
5211
+ `, c += `• Use ${ui} for individual assignment changes
5212
+ `, n.length > 0 && (c += `• Check failed tasks and use ${Ot} to verify collaborator access
5192
5213
  `)) : r ? (c += `**To execute:**
5193
5214
  `, c += `• Remove dryRun parameter and run again to execute changes
5194
5215
  `, o.length > 0 && (c += `• ${o.length} task${o.length === 1 ? "" : "s"} ready for ${e} operation
5195
5216
  `), n.length > 0 && (c += `• Fix ${n.length} validation error${n.length === 1 ? "" : "s"} before executing
5196
5217
  `)) : o.length === 0 && (c += `**Suggestions:**
5197
- `, c += `• Use ${Et} to find valid assignees
5218
+ `, c += `• Use ${Ot} to find valid assignees
5198
5219
  `, c += `• Check task IDs and assignee permissions
5199
5220
  `, c += `• Use dryRun=true to validate before executing
5200
5221
  `), c;
5201
5222
  }
5202
- const mi = {
5223
+ const bi = {
5203
5224
  action: s.enum(["archive", "unarchive"]).describe("The action to perform on the project."),
5204
5225
  projectId: s.string().min(1).describe("The ID of the project.")
5205
- }, fi = {
5226
+ }, gi = {
5206
5227
  project: Q.describe("The updated project."),
5207
5228
  success: s.boolean().describe("Whether the action was successful.")
5208
- }, bi = {
5209
- name: g.PROJECT_MANAGEMENT,
5229
+ }, yi = {
5230
+ name: y.PROJECT_MANAGEMENT,
5210
5231
  description: "Archive or unarchive a project by its ID.",
5211
- parameters: mi,
5212
- outputSchema: fi,
5232
+ parameters: bi,
5233
+ outputSchema: gi,
5213
5234
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
5214
5235
  async execute(e, t) {
5215
5236
  const r = e.action === "archive" ? await t.archiveProject(e.projectId) : await t.unarchiveProject(e.projectId), o = Z(r);
@@ -5221,7 +5242,7 @@ const mi = {
5221
5242
  }
5222
5243
  };
5223
5244
  }
5224
- }, gi = {
5245
+ }, ki = {
5225
5246
  action: s.enum(["move-to-workspace", "move-to-personal"]).describe("The action to perform on the project."),
5226
5247
  projectId: s.string().min(1).describe("The ID of the project to move."),
5227
5248
  workspaceId: s.string().min(1).optional().describe("The target workspace ID. Required when action is move-to-workspace."),
@@ -5229,14 +5250,14 @@ const mi = {
5229
5250
  visibility: s.enum(["restricted", "team", "public"]).optional().describe(
5230
5251
  "Optional access visibility for the project in the workspace (restricted, team, or public)."
5231
5252
  )
5232
- }, yi = {
5253
+ }, Ti = {
5233
5254
  project: Q.describe("The moved project."),
5234
5255
  success: s.boolean().describe("Whether the move was successful.")
5235
- }, ki = {
5236
- name: g.PROJECT_MOVE,
5256
+ }, vi = {
5257
+ name: y.PROJECT_MOVE,
5237
5258
  description: "Move a project between personal and workspace contexts.",
5238
- parameters: gi,
5239
- outputSchema: yi,
5259
+ parameters: ki,
5260
+ outputSchema: Ti,
5240
5261
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
5241
5262
  async execute(e, t) {
5242
5263
  let r;
@@ -5259,8 +5280,8 @@ const mi = {
5259
5280
  }
5260
5281
  };
5261
5282
  }
5262
- }, Ts = ["project", "section"], Ti = {
5263
- type: s.enum(Ts).describe(
5283
+ }, vs = ["project", "section"], wi = {
5284
+ type: s.enum(vs).describe(
5264
5285
  '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.'
5265
5286
  ),
5266
5287
  items: s.array(
@@ -5276,17 +5297,17 @@ const mi = {
5276
5297
  ).min(1).describe(
5277
5298
  "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."
5278
5299
  )
5279
- }, wi = {
5280
- type: s.enum(Ts).describe("The type of entity that was reordered/moved."),
5300
+ }, Ii = {
5301
+ type: s.enum(vs).describe("The type of entity that was reordered/moved."),
5281
5302
  movedCount: s.number().describe("The number of entities moved to a new parent."),
5282
5303
  reorderedCount: s.number().describe("The number of entities reordered."),
5283
5304
  affectedIds: s.array(s.string()).describe("The IDs of all affected entities."),
5284
5305
  success: s.boolean().describe("Whether the operation was successful.")
5285
- }, vi = {
5286
- name: g.REORDER_OBJECTS,
5306
+ }, ji = {
5307
+ name: y.REORDER_OBJECTS,
5287
5308
  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.',
5288
- parameters: Ti,
5289
- outputSchema: wi,
5309
+ parameters: wi,
5310
+ outputSchema: Ii,
5290
5311
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
5291
5312
  async execute(e, t) {
5292
5313
  const { type: r, items: o } = e, n = /* @__PURE__ */ new Set();
@@ -5348,22 +5369,22 @@ const mi = {
5348
5369
  }
5349
5370
  };
5350
5371
  }
5351
- }, Ii = s.object({
5372
+ }, Si = s.object({
5352
5373
  id: s.string().min(1).describe("The ID of the task to reschedule."),
5353
5374
  date: s.string().min(1).describe(
5354
5375
  "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."
5355
5376
  )
5356
- }), ji = {
5357
- tasks: s.array(Ii).min(1).describe("The tasks to reschedule with their new dates.")
5358
- }, Si = {
5377
+ }), Ci = {
5378
+ tasks: s.array(Si).min(1).describe("The tasks to reschedule with their new dates.")
5379
+ }, $i = {
5359
5380
  tasks: s.array(z).describe("The rescheduled tasks."),
5360
5381
  totalCount: s.number().describe("The total number of tasks rescheduled."),
5361
5382
  rescheduledTaskIds: s.array(s.string()).describe("The IDs of the rescheduled tasks.")
5362
- }, Ci = {
5363
- name: g.RESCHEDULE_TASKS,
5383
+ }, Di = {
5384
+ name: y.RESCHEDULE_TASKS,
5364
5385
  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.",
5365
- parameters: ji,
5366
- outputSchema: Si,
5386
+ parameters: Ci,
5387
+ outputSchema: $i,
5367
5388
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
5368
5389
  async execute(e, t) {
5369
5390
  const { tasks: r } = e, n = (await Promise.all(
@@ -5376,7 +5397,7 @@ const mi = {
5376
5397
  throw new Error(
5377
5398
  `Task "${d.content}" (${d.id}) has no due date. Rescheduling requires an existing due date.`
5378
5399
  );
5379
- const u = $i(l.date, d.due);
5400
+ const u = Ai(l.date, d.due);
5380
5401
  return J("item_update", {
5381
5402
  id: l.id,
5382
5403
  due: {
@@ -5407,16 +5428,16 @@ const mi = {
5407
5428
  };
5408
5429
  }
5409
5430
  };
5410
- function $i(e, t) {
5431
+ function Ai(e, t) {
5411
5432
  if (/^\d{4}-\d{2}-\d{2}$/.test(e) && t.datetime) {
5412
5433
  const o = t.datetime.substring(10);
5413
5434
  return e + o;
5414
5435
  }
5415
5436
  return e;
5416
5437
  }
5417
- const Di = {
5438
+ const xi = {
5418
5439
  query: s.string().min(1).describe("The search query string to find tasks and projects.")
5419
- }, Ai = {
5440
+ }, Ei = {
5420
5441
  results: s.array(
5421
5442
  s.object({
5422
5443
  id: s.string().describe("The ID of the result."),
@@ -5425,11 +5446,11 @@ const Di = {
5425
5446
  })
5426
5447
  ).describe("The search results."),
5427
5448
  totalCount: s.number().describe("Total number of results found.")
5428
- }, xi = {
5429
- name: g.SEARCH,
5449
+ }, Oi = {
5450
+ name: y.SEARCH,
5430
5451
  description: "Search across tasks and projects in Todoist. Returns a list of relevant results with IDs, titles, and URLs.",
5431
- parameters: Di,
5432
- outputSchema: Ai,
5452
+ parameters: xi,
5453
+ outputSchema: Ei,
5433
5454
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
5434
5455
  async execute(e, t) {
5435
5456
  const { query: r } = e, [o, n] = await Promise.all([
@@ -5439,38 +5460,38 @@ const Di = {
5439
5460
  limit: $.TASKS_MAX,
5440
5461
  cursor: void 0
5441
5462
  }),
5442
- ts(t, r)
5463
+ ss(t, r)
5443
5464
  ]), a = [];
5444
5465
  for (const i of o.tasks)
5445
5466
  a.push({
5446
5467
  id: `task:${i.id}`,
5447
5468
  title: i.content,
5448
- url: Lt(i.id)
5469
+ url: Ft(i.id)
5449
5470
  });
5450
5471
  for (const i of n)
5451
5472
  a.push({
5452
5473
  id: `project:${i.id}`,
5453
5474
  title: i.name,
5454
- url: Ft(i.id)
5475
+ url: Ht(i.id)
5455
5476
  });
5456
5477
  return {
5457
5478
  textContent: JSON.stringify({ results: a }),
5458
5479
  structuredContent: { results: a, totalCount: a.length }
5459
5480
  };
5460
5481
  }
5461
- }, Ei = {
5482
+ }, Pi = {
5462
5483
  ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to uncomplete.")
5463
- }, Oi = {
5484
+ }, Ri = {
5464
5485
  uncompleted: s.array(s.string()).describe("The IDs of successfully uncompleted tasks."),
5465
5486
  failures: s.array(te).describe("Failed task uncompletion with error details."),
5466
5487
  totalRequested: s.number().describe("The total number of tasks requested to uncomplete."),
5467
5488
  successCount: s.number().describe("The number of successfully uncompleted tasks."),
5468
5489
  failureCount: s.number().describe("The number of failed task uncompletions.")
5469
- }, Pi = {
5470
- name: g.UNCOMPLETE_TASKS,
5490
+ }, _i = {
5491
+ name: y.UNCOMPLETE_TASKS,
5471
5492
  description: "Uncomplete (reopen) one or more completed tasks by their IDs.",
5472
- parameters: Ei,
5473
- outputSchema: Oi,
5493
+ parameters: Pi,
5494
+ outputSchema: Ri,
5474
5495
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
5475
5496
  async execute(e, t) {
5476
5497
  const r = [], o = [];
@@ -5485,7 +5506,7 @@ const Di = {
5485
5506
  });
5486
5507
  }
5487
5508
  return {
5488
- textContent: Ri({
5509
+ textContent: Ui({
5489
5510
  uncompleted: r,
5490
5511
  failures: o,
5491
5512
  args: e
@@ -5500,7 +5521,7 @@ const Di = {
5500
5521
  };
5501
5522
  }
5502
5523
  };
5503
- function Ri({
5524
+ function Ui({
5504
5525
  uncompleted: e,
5505
5526
  failures: t,
5506
5527
  args: r
@@ -5514,28 +5535,28 @@ function Ri({
5514
5535
  failures: t
5515
5536
  });
5516
5537
  }
5517
- const _i = s.object({
5538
+ const Mi = s.object({
5518
5539
  id: s.string().min(1).describe("The ID of the comment to update."),
5519
5540
  content: s.string().min(1).describe("The new content for the comment.")
5520
- }), Ui = {
5521
- comments: s.array(_i).min(1).describe("The comments to update.")
5522
- }, Mi = {
5541
+ }), Ni = {
5542
+ comments: s.array(Mi).min(1).describe("The comments to update.")
5543
+ }, Li = {
5523
5544
  comments: s.array(Se).describe("The updated comments."),
5524
5545
  totalCount: s.number().describe("The total number of comments updated."),
5525
5546
  updatedCommentIds: s.array(s.string()).describe("The IDs of the updated comments."),
5526
5547
  appliedOperations: s.object({
5527
5548
  updateCount: s.number().describe("The number of comments updated.")
5528
5549
  }).describe("Summary of operations performed.")
5529
- }, Ni = {
5530
- name: g.UPDATE_COMMENTS,
5550
+ }, Fi = {
5551
+ name: y.UPDATE_COMMENTS,
5531
5552
  description: "Update multiple existing comments with new content.",
5532
- parameters: Ui,
5533
- outputSchema: Mi,
5553
+ parameters: Ni,
5554
+ outputSchema: Li,
5534
5555
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
5535
5556
  async execute(e, t) {
5536
5557
  const { comments: r } = e, o = r.map(async (c) => await t.updateComment(c.id, { content: c.content })), a = (await Promise.all(o)).map(Ie);
5537
5558
  return {
5538
- textContent: Li({
5559
+ textContent: Hi({
5539
5560
  comments: a
5540
5561
  }),
5541
5562
  structuredContent: {
@@ -5549,7 +5570,7 @@ const _i = s.object({
5549
5570
  };
5550
5571
  }
5551
5572
  };
5552
- function Li({ comments: e }) {
5573
+ function Hi({ comments: e }) {
5553
5574
  const t = e.filter((a) => a.taskId).length, r = e.filter((a) => a.projectId).length, o = [];
5554
5575
  if (t > 0) {
5555
5576
  const a = t > 1 ? "comments" : "comment";
@@ -5561,7 +5582,7 @@ function Li({ comments: e }) {
5561
5582
  }
5562
5583
  return o.length > 0 ? `Updated ${o.join(" and ")}` : "No comments updated";
5563
5584
  }
5564
- const Fi = s.object({
5585
+ const Wi = s.object({
5565
5586
  id: s.string().min(1).describe("The ID of the filter to update."),
5566
5587
  name: s.string().min(1).optional().describe("The new name of the filter."),
5567
5588
  query: s.string().min(1).optional().describe(
@@ -5569,9 +5590,9 @@ const Fi = s.object({
5569
5590
  ),
5570
5591
  color: pe,
5571
5592
  isFavorite: s.boolean().optional().describe("Whether to mark the filter as a favorite.")
5572
- }), Hi = {
5573
- filters: s.array(Fi).min(1).describe("The filters to update.")
5574
- }, Wi = {
5593
+ }), Bi = {
5594
+ filters: s.array(Wi).min(1).describe("The filters to update.")
5595
+ }, qi = {
5575
5596
  filters: s.array(nt).describe("The updated filters."),
5576
5597
  totalCount: s.number().describe("The total number of filters updated."),
5577
5598
  updatedFilterIds: s.array(s.string()).describe("The IDs of the updated filters."),
@@ -5579,15 +5600,15 @@ const Fi = s.object({
5579
5600
  updateCount: s.number().describe("The number of filters actually updated."),
5580
5601
  skippedCount: s.number().describe("The number of filters skipped (no changes).")
5581
5602
  }).describe("Summary of operations performed.")
5582
- }, Bi = {
5583
- name: g.UPDATE_FILTERS,
5603
+ }, Yi = {
5604
+ name: y.UPDATE_FILTERS,
5584
5605
  description: "Update one or more existing personal filters with new values.",
5585
- parameters: Hi,
5586
- outputSchema: Wi,
5606
+ parameters: Bi,
5607
+ outputSchema: qi,
5587
5608
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
5588
5609
  async execute(e, t) {
5589
5610
  const { filters: r } = e, o = [], a = r.map((h) => {
5590
- const m = Yi(h);
5611
+ const m = Gi(h);
5591
5612
  return m !== null ? { kind: "skipped", reason: m } : (o.push(h), { kind: "updated", filter: h });
5592
5613
  }).filter((h) => h.kind === "skipped").length;
5593
5614
  if (o.length === 0)
@@ -5601,11 +5622,11 @@ const Fi = s.object({
5601
5622
  }
5602
5623
  };
5603
5624
  const i = o.map((h) => {
5604
- const { id: m, color: y, ...f } = h;
5625
+ const { id: m, color: g, ...f } = h;
5605
5626
  return J("filter_update", {
5606
5627
  id: m,
5607
5628
  ...f,
5608
- ...y !== void 0 ? { color: y } : {}
5629
+ ...g !== void 0 ? { color: g } : {}
5609
5630
  });
5610
5631
  });
5611
5632
  await t.sync({ commands: i });
@@ -5618,7 +5639,7 @@ const Fi = s.object({
5618
5639
  itemOrder: h.itemOrder
5619
5640
  }));
5620
5641
  return {
5621
- textContent: qi({ filters: u, skippedCount: a }),
5642
+ textContent: zi({ filters: u, skippedCount: a }),
5622
5643
  structuredContent: {
5623
5644
  filters: u,
5624
5645
  totalCount: u.length,
@@ -5631,7 +5652,7 @@ const Fi = s.object({
5631
5652
  };
5632
5653
  }
5633
5654
  };
5634
- function qi({
5655
+ function zi({
5635
5656
  filters: e,
5636
5657
  skippedCount: t
5637
5658
  }) {
@@ -5645,54 +5666,54 @@ ${n}`;
5645
5666
  }
5646
5667
  return o;
5647
5668
  }
5648
- function Yi({ id: e, ...t }) {
5669
+ function Gi({ id: e, ...t }) {
5649
5670
  return Object.values(t).every((o) => o === void 0) ? "no-fields" : null;
5650
5671
  }
5651
- const zi = s.object({
5672
+ const Ki = s.object({
5652
5673
  labelType: s.literal("personal").describe("Update a personal label, identified by its ID."),
5653
5674
  id: s.string().min(1).describe("The ID of the personal label to update."),
5654
5675
  name: s.string().min(1).max(128).optional().describe("The new name of the label."),
5655
5676
  color: pe,
5656
5677
  order: s.number().int().optional().describe("The new position of the label in the label list."),
5657
5678
  isFavorite: s.boolean().optional().describe("Whether to mark the label as a favorite.")
5658
- }), Gi = s.object({
5679
+ }), Vi = s.object({
5659
5680
  labelType: s.literal("shared").describe(
5660
5681
  "Rename a shared label across all tasks. Shared labels are identified by name; only renaming is supported (no color, order, or favorite)."
5661
5682
  ),
5662
5683
  name: s.string().min(1).describe("The current name of the shared label."),
5663
5684
  newName: s.string().min(1).describe("The new name for the shared label.")
5664
- }), Ki = s.discriminatedUnion("labelType", [
5665
- zi,
5666
- Gi
5667
- ]), Vi = {
5668
- labels: s.array(Ki).min(1).describe(
5685
+ }), Ji = s.discriminatedUnion("labelType", [
5686
+ Ki,
5687
+ Vi
5688
+ ]), Xi = {
5689
+ labels: s.array(Ji).min(1).describe(
5669
5690
  '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.'
5670
5691
  )
5671
- }, Ji = s.object({
5692
+ }, Zi = s.object({
5672
5693
  name: s.string().describe("The previous name of the shared label."),
5673
5694
  newName: s.string().describe("The new name of the shared label.")
5674
- }), Xi = {
5695
+ }), Qi = {
5675
5696
  updatedLabels: s.array(me).describe("The updated personal labels."),
5676
- renamedSharedLabels: s.array(Ji).describe("The shared labels that were renamed."),
5697
+ renamedSharedLabels: s.array(Zi).describe("The shared labels that were renamed."),
5677
5698
  totalCount: s.number().describe("The total number of successful operations (personal + shared)."),
5678
5699
  appliedOperations: s.object({
5679
5700
  updateCount: s.number().describe("Number of personal labels updated."),
5680
5701
  renameCount: s.number().describe("Number of shared labels renamed."),
5681
5702
  skippedCount: s.number().describe("Number of operations skipped (no changes or shared label not found).")
5682
5703
  }).describe("Summary of operations performed.")
5683
- }, Zi = {
5684
- name: g.UPDATE_LABELS,
5704
+ }, ec = {
5705
+ name: y.UPDATE_LABELS,
5685
5706
  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.",
5686
- parameters: Vi,
5687
- outputSchema: Xi,
5707
+ parameters: Xi,
5708
+ outputSchema: Qi,
5688
5709
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
5689
5710
  async execute(e, t) {
5690
5711
  const { labels: r } = e, o = await Promise.all(
5691
5712
  r.map(async (u) => {
5692
5713
  if (u.labelType === "personal") {
5693
- const h = ec(u);
5714
+ const h = sc(u);
5694
5715
  if (h !== null) return { kind: "skipped", reason: h };
5695
- const { id: m, labelType: y, ...f } = u;
5716
+ const { id: m, labelType: g, ...f } = u;
5696
5717
  return { kind: "updated", label: await t.updateLabel(m, f) };
5697
5718
  }
5698
5719
  return await t.renameSharedLabel({
@@ -5708,7 +5729,7 @@ const zi = s.object({
5708
5729
  (u) => u.kind === "skipped" && u.reason === "not-found"
5709
5730
  ).length;
5710
5731
  return {
5711
- textContent: Qi({
5732
+ textContent: tc({
5712
5733
  updatedLabels: n,
5713
5734
  renamedSharedLabels: a,
5714
5735
  skippedNoFields: c,
@@ -5727,7 +5748,7 @@ const zi = s.object({
5727
5748
  };
5728
5749
  }
5729
5750
  };
5730
- function Qi({
5751
+ function tc({
5731
5752
  updatedLabels: e,
5732
5753
  renamedSharedLabels: t,
5733
5754
  skippedNoFields: r,
@@ -5749,14 +5770,14 @@ function Qi({
5749
5770
  return c.join(`
5750
5771
  `);
5751
5772
  }
5752
- function ec({
5773
+ function sc({
5753
5774
  id: e,
5754
5775
  labelType: t,
5755
5776
  ...r
5756
5777
  }) {
5757
5778
  return Object.values(r).every((n) => n === void 0) ? "no-fields" : null;
5758
5779
  }
5759
- const tc = s.object({
5780
+ const rc = s.object({
5760
5781
  id: s.string().min(1).describe("The ID of the project to update."),
5761
5782
  name: s.string().min(1).optional().describe("The new name of the project."),
5762
5783
  isFavorite: s.boolean().optional().describe("Whether the project is a favorite."),
@@ -5771,9 +5792,9 @@ const tc = s.object({
5771
5792
  )
5772
5793
  ).optional(),
5773
5794
  color: pe
5774
- }), sc = {
5775
- projects: s.array(tc).min(1).describe("The projects to update.")
5776
- }, rc = {
5795
+ }), oc = {
5796
+ projects: s.array(rc).min(1).describe("The projects to update.")
5797
+ }, nc = {
5777
5798
  projects: s.array(Q).describe("The updated projects."),
5778
5799
  totalCount: s.number().describe("The total number of projects updated."),
5779
5800
  updatedProjectIds: s.array(s.string()).describe("The IDs of the updated projects."),
@@ -5785,16 +5806,16 @@ const tc = s.object({
5785
5806
  skippedCount: s.number().describe("The number of projects skipped (no changes)."),
5786
5807
  failureCount: s.number().describe("The number of projects that failed to update.")
5787
5808
  }).describe("Summary of operations performed.")
5788
- }, oc = {
5789
- name: g.UPDATE_PROJECTS,
5809
+ }, ac = {
5810
+ name: y.UPDATE_PROJECTS,
5790
5811
  description: "Update multiple existing projects with new values.",
5791
- parameters: sc,
5792
- outputSchema: rc,
5812
+ parameters: oc,
5813
+ outputSchema: nc,
5793
5814
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
5794
5815
  async execute(e, t) {
5795
5816
  const { projects: r } = e, o = await Promise.allSettled(
5796
5817
  r.map(async (d) => {
5797
- const u = ac(d);
5818
+ const u = cc(d);
5798
5819
  if (u !== null) return { kind: "skipped", reason: u };
5799
5820
  const { id: p, ...h } = d;
5800
5821
  return { kind: "updated", project: await R(() => t.updateProject(p, h)) };
@@ -5812,7 +5833,7 @@ const tc = s.object({
5812
5833
  u.value.kind === "updated" ? n.push(Z(u.value.project)) : u.value.reason === "no-fields" ? i++ : c++;
5813
5834
  }
5814
5835
  return {
5815
- textContent: nc({
5836
+ textContent: ic({
5816
5837
  projects: n,
5817
5838
  skippedNoFields: i,
5818
5839
  skippedNoValidValues: c,
@@ -5832,7 +5853,7 @@ const tc = s.object({
5832
5853
  };
5833
5854
  }
5834
5855
  };
5835
- function nc({
5856
+ function ic({
5836
5857
  projects: e,
5837
5858
  skippedNoFields: t,
5838
5859
  skippedNoValidValues: r,
@@ -5845,49 +5866,49 @@ function nc({
5845
5866
  return t > 0 && c.push(`${t} skipped - no changes`), r > 0 && c.push(`${r} skipped - no valid field values`), c.length > 0 && (i += ` (${c.join(", ")})`), n > 0 && (i += `:
5846
5867
  ${a}`), ct(i, o);
5847
5868
  }
5848
- function ac({ id: e, ...t }) {
5869
+ function cc({ id: e, ...t }) {
5849
5870
  const r = Object.values(t);
5850
5871
  return r.length === 0 ? "no-fields" : r.every((o) => o === void 0) ? "no-valid-values" : null;
5851
5872
  }
5852
- const ic = s.object({
5873
+ const dc = s.object({
5853
5874
  type: s.literal("relative"),
5854
5875
  id: s.string().min(1).describe("The ID of the relative reminder to update."),
5855
5876
  minuteOffset: s.number().int().min(0).optional().describe("New minute offset before task due time."),
5856
5877
  service: $e.optional().describe('New delivery method: "email" or "push".'),
5857
5878
  isUrgent: De
5858
- }), cc = s.object({
5879
+ }), lc = s.object({
5859
5880
  type: s.literal("absolute"),
5860
5881
  id: s.string().min(1).describe("The ID of the absolute reminder to update."),
5861
- due: as.optional().describe("New due date/time for the reminder."),
5882
+ due: is.optional().describe("New due date/time for the reminder."),
5862
5883
  service: $e.optional().describe('New delivery method: "email" or "push".'),
5863
5884
  isUrgent: De
5864
- }), dc = s.object({
5885
+ }), uc = s.object({
5865
5886
  type: s.literal("location"),
5866
5887
  id: s.string().min(1).describe("The ID of the location reminder to update."),
5867
5888
  name: s.string().optional().describe("New location name."),
5868
5889
  locLat: s.string().optional().describe("New latitude."),
5869
5890
  locLong: s.string().optional().describe("New longitude."),
5870
- locTrigger: is.optional().describe(
5891
+ locTrigger: cs.optional().describe(
5871
5892
  'New trigger condition: "on_enter" or "on_leave".'
5872
5893
  ),
5873
5894
  radius: s.number().int().optional().describe("New radius in meters.")
5874
- }), lc = s.discriminatedUnion("type", [
5875
- ic,
5876
- cc,
5877
- dc
5878
- ]), uc = {
5879
- reminders: s.array(lc).min(1).max(we).describe(
5880
- `Array of reminders to update (max ${we}). Each must include the reminder type and ID. Only include fields that need to change.`
5895
+ }), pc = s.discriminatedUnion("type", [
5896
+ dc,
5897
+ lc,
5898
+ uc
5899
+ ]), hc = {
5900
+ reminders: s.array(pc).min(1).max(ve).describe(
5901
+ `Array of reminders to update (max ${ve}). Each must include the reminder type and ID. Only include fields that need to change.`
5881
5902
  )
5882
- }, pc = {
5903
+ }, mc = {
5883
5904
  reminders: s.array(ot).describe("The updated reminders."),
5884
5905
  totalCount: s.number().describe("Total reminders updated."),
5885
5906
  updatedReminderIds: s.array(s.string()).describe("IDs of updated reminders.")
5886
- }, hc = {
5887
- name: g.UPDATE_REMINDERS,
5907
+ }, fc = {
5908
+ name: y.UPDATE_REMINDERS,
5888
5909
  description: 'Update existing reminders. Each reminder must specify its type ("relative", "absolute", or "location") and ID. Only include fields that need to change.',
5889
- parameters: uc,
5890
- outputSchema: pc,
5910
+ parameters: hc,
5911
+ outputSchema: mc,
5891
5912
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !0 },
5892
5913
  async execute(e, t) {
5893
5914
  const { reminders: r } = e, o = r.map(async (l) => {
@@ -5921,7 +5942,7 @@ const ic = s.object({
5921
5942
  }
5922
5943
  };
5923
5944
  }
5924
- }, mc = s.object({
5945
+ }, bc = s.object({
5925
5946
  id: s.string().min(1).describe("The ID of the section to update."),
5926
5947
  name: s.string().min(1).optional().describe("The new name of the section."),
5927
5948
  description: s.preprocess(
@@ -5936,17 +5957,17 @@ const ic = s.object({
5936
5957
  ).optional()
5937
5958
  }).refine((e) => e.name !== void 0 || e.description !== void 0, {
5938
5959
  message: 'Provide at least one of "name" or "description" to update.'
5939
- }), fc = {
5940
- sections: s.array(mc).min(1).describe("The sections to update.")
5941
- }, bc = {
5960
+ }), gc = {
5961
+ sections: s.array(bc).min(1).describe("The sections to update.")
5962
+ }, yc = {
5942
5963
  sections: s.array(le).describe("The updated sections."),
5943
5964
  totalCount: s.number().describe("The total number of sections updated."),
5944
5965
  updatedSectionIds: s.array(s.string()).describe("The IDs of the updated sections.")
5945
- }, gc = {
5946
- name: g.UPDATE_SECTIONS,
5966
+ }, kc = {
5967
+ name: y.UPDATE_SECTIONS,
5947
5968
  description: "Update multiple existing sections with new values.",
5948
- parameters: fc,
5949
- outputSchema: bc,
5969
+ parameters: gc,
5970
+ outputSchema: yc,
5950
5971
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
5951
5972
  async execute({ sections: e }, t) {
5952
5973
  const r = await Promise.all(
@@ -5959,7 +5980,7 @@ const ic = s.object({
5959
5980
  })
5960
5981
  );
5961
5982
  return {
5962
- textContent: yc({
5983
+ textContent: Tc({
5963
5984
  sections: r
5964
5985
  }),
5965
5986
  structuredContent: {
@@ -5970,7 +5991,7 @@ const ic = s.object({
5970
5991
  };
5971
5992
  }
5972
5993
  };
5973
- function yc({ sections: e }) {
5994
+ function Tc({ sections: e }) {
5974
5995
  const t = e.length, r = e.map((n) => `• ${n.name} (id=${n.id}, projectId=${n.projectId})`).join(`
5975
5996
  `);
5976
5997
  return `Updated ${t} section${t === 1 ? "" : "s"}:
@@ -5979,27 +6000,27 @@ ${r}`;
5979
6000
  function ws(e, t) {
5980
6001
  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;
5981
6002
  }
5982
- function kc(e, t) {
6003
+ function vc(e, t) {
5983
6004
  return t.projectId !== void 0 ? e.projectId === t.projectId : t.sectionId !== void 0 ? e.sectionId === t.sectionId : e.parentId === t.parentId;
5984
6005
  }
5985
- function Tc(e) {
6006
+ function wc(e) {
5986
6007
  return e.projectId !== void 0 ? `project:${e.projectId}` : e.sectionId !== void 0 ? `section:${e.sectionId}` : `parent:${e.parentId}`;
5987
6008
  }
5988
- function wc(e) {
6009
+ function Ic(e) {
5989
6010
  const t = [];
5990
6011
  return e.projectId && t.push({ projectId: e.projectId }), e.sectionId && t.push({ sectionId: e.sectionId }), e.parentId && t.push({ parentId: e.parentId }), t;
5991
6012
  }
5992
- function vc({
6013
+ function jc({
5993
6014
  taskId: e,
5994
6015
  request: t,
5995
6016
  current: r
5996
6017
  }) {
5997
- const o = wc(t);
6018
+ const o = Ic(t);
5998
6019
  if (o.length === 0)
5999
6020
  return { redundantMoveSkipped: !1 };
6000
6021
  let n = o, a = !1;
6001
6022
  if (r) {
6002
- const i = o.length === 1 ? (c) => ws(r, c) : (c) => kc(r, c);
6023
+ const i = o.length === 1 ? (c) => ws(r, c) : (c) => vc(r, c);
6003
6024
  n = o.filter((c) => !i(c)), a = n.length < o.length;
6004
6025
  }
6005
6026
  if (n.length === 0)
@@ -6010,7 +6031,7 @@ function vc({
6010
6031
  );
6011
6032
  return { move: n[0], redundantMoveSkipped: a };
6012
6033
  }
6013
- const Ic = s.object({
6034
+ const Sc = s.object({
6014
6035
  id: s.string().min(1).describe("The ID of the task to update."),
6015
6036
  content: s.string().optional().describe(
6016
6037
  '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.'
@@ -6055,9 +6076,9 @@ const Ic = s.object({
6055
6076
  isUncompletable: s.boolean().optional().describe(
6056
6077
  "Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
6057
6078
  )
6058
- }), jc = (e) => !!(e.projectId || e.sectionId || e.parentId), vs = (e) => Object.keys(e).length > 0, Sc = ["remove", "no date"], Cc = ["remove", "no date", "no deadline"], $c = "no date", Ve = Yt.TASKS_PER_OPERATION, Ot = {
6059
- tasks: s.array(Ic).min(1).max(Ve).describe(`The tasks to update (max ${Ve}).`)
6060
- }, Dc = {
6079
+ }), Cc = (e) => !!(e.projectId || e.sectionId || e.parentId), Is = (e) => Object.keys(e).length > 0, $c = ["remove", "no date"], Dc = ["remove", "no date", "no deadline"], Ac = "no date", Ve = zt.TASKS_PER_OPERATION, Pt = {
6080
+ tasks: s.array(Sc).min(1).max(Ve).describe(`The tasks to update (max ${Ve}).`)
6081
+ }, xc = {
6061
6082
  tasks: s.array(z).describe("The updated tasks."),
6062
6083
  totalCount: s.number().describe("The total number of tasks updated."),
6063
6084
  updatedTaskIds: s.array(s.string()).describe("The IDs of the updated tasks."),
@@ -6072,38 +6093,38 @@ const Ic = s.object({
6072
6093
  "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."
6073
6094
  )
6074
6095
  }).describe("Summary of operations performed.")
6075
- }, Ac = {
6076
- name: g.UPDATE_TASKS,
6096
+ }, Ec = {
6097
+ name: y.UPDATE_TASKS,
6077
6098
  description: "Update existing tasks including content, dates, priorities, and assignments. Send only the fields that change.",
6078
- parameters: Ot,
6079
- outputSchema: Dc,
6099
+ parameters: Pt,
6100
+ outputSchema: xc,
6080
6101
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
6081
6102
  async execute(e, t) {
6082
- const { tasks: r } = s.object(Ot).parse(e), o = r.map(() => ({ kind: "skipped" })), n = (k, b) => {
6103
+ const { tasks: r } = s.object(Pt).parse(e), o = r.map(() => ({ kind: "skipped" })), n = (k, b) => {
6083
6104
  o[k] = { kind: "failed", error: b };
6084
6105
  }, a = (k, b) => {
6085
6106
  n(k, Y(b));
6086
- }, i = r.map((k, b) => ({ task: k, index: b })).filter(({ task: k }) => Nc(k)), c = await Ec(
6107
+ }, i = r.map((k, b) => ({ task: k, index: b })).filter(({ task: k }) => Fc(k)), c = await Pc(
6087
6108
  i.map(({ task: k }) => k),
6088
6109
  t
6089
6110
  ), l = await Promise.allSettled(
6090
- i.map(({ task: k, index: b }) => _c({ task: k, index: b, client: t, inbox: c }))
6111
+ i.map(({ task: k, index: b }) => Mc({ task: k, index: b, client: t, inbox: c }))
6091
6112
  ), d = [];
6092
6113
  for (const [k, b] of l.entries()) {
6093
6114
  const S = i[k]?.index ?? k;
6094
6115
  b.status === "fulfilled" ? d.push(b.value) : a(S, b.reason);
6095
6116
  }
6096
- const u = await Is({
6117
+ const u = await js({
6097
6118
  client: t,
6098
6119
  ids: [
6099
6120
  ...new Set(
6100
- d.filter((k) => jc(k.moveRequest)).map((k) => k.id)
6121
+ d.filter((k) => Cc(k.moveRequest)).map((k) => k.id)
6101
6122
  )
6102
6123
  ]
6103
6124
  }), p = [];
6104
6125
  for (const k of d)
6105
6126
  try {
6106
- const b = vc({
6127
+ const b = jc({
6107
6128
  taskId: k.id,
6108
6129
  request: k.moveRequest,
6109
6130
  current: u.get(k.id)
@@ -6112,10 +6133,10 @@ const Ic = s.object({
6112
6133
  } catch (b) {
6113
6134
  a(k.index, b), k.failed = !0;
6114
6135
  }
6115
- const h = /* @__PURE__ */ new Map(), m = [], y = (k) => {
6136
+ const h = /* @__PURE__ */ new Map(), m = [], g = (k) => {
6116
6137
  const b = k.filter((S) => !S.failed);
6117
6138
  b.length !== 0 && m.push(
6118
- Rc({
6139
+ Uc({
6119
6140
  client: t,
6120
6141
  items: b,
6121
6142
  onUpdated: (S, D) => {
@@ -6136,7 +6157,7 @@ const Ic = s.object({
6136
6157
  })
6137
6158
  );
6138
6159
  }, f = new Set(p.map(({ item: k }) => k.index));
6139
- y(d.filter((k) => !f.has(k.index))), await Oc({
6160
+ g(d.filter((k) => !f.has(k.index))), await Rc({
6140
6161
  client: t,
6141
6162
  moving: p,
6142
6163
  results: h,
@@ -6150,18 +6171,18 @@ const Ic = s.object({
6150
6171
  }
6151
6172
  b.push(S);
6152
6173
  }
6153
- y(b);
6174
+ g(b);
6154
6175
  }
6155
6176
  }), await Promise.all(m);
6156
6177
  for (const k of d) {
6157
- if (k.failed || vs(k.updateArgs))
6178
+ if (k.failed || Is(k.updateArgs))
6158
6179
  continue;
6159
6180
  const b = h.get(k.index);
6160
6181
  b && "task" in b && (o[k.index] = { kind: "updated", task: b.task });
6161
6182
  }
6162
- const { updatedTasks: I, failures: C, skippedCount: E } = xc({ tasks: r, outcomes: o }), T = d.filter((k) => k.redundantMoveSkipped).length, j = I.map(M);
6183
+ const { updatedTasks: I, failures: C, skippedCount: E } = Oc({ tasks: r, outcomes: o }), T = d.filter((k) => k.redundantMoveSkipped).length, j = I.map(M);
6163
6184
  return {
6164
- textContent: Mc({
6185
+ textContent: Lc({
6165
6186
  tasks: j,
6166
6187
  failures: C,
6167
6188
  skippedCount: E,
@@ -6182,7 +6203,7 @@ const Ic = s.object({
6182
6203
  };
6183
6204
  }
6184
6205
  };
6185
- function xc({ tasks: e, outcomes: t }) {
6206
+ function Oc({ tasks: e, outcomes: t }) {
6186
6207
  const r = [], o = [];
6187
6208
  let n = 0;
6188
6209
  for (const [a, i] of t.entries()) {
@@ -6199,8 +6220,8 @@ function xc({ tasks: e, outcomes: t }) {
6199
6220
  }
6200
6221
  return { updatedTasks: r, failures: o, skippedCount: n };
6201
6222
  }
6202
- async function Ec(e, t) {
6203
- if (!e.some((r) => L(r.projectId)))
6223
+ async function Pc(e, t) {
6224
+ if (!e.some((r) => F(r.projectId)))
6204
6225
  return {};
6205
6226
  try {
6206
6227
  return { projectId: (await R(() => t.getUser())).inboxProjectId };
@@ -6208,7 +6229,7 @@ async function Ec(e, t) {
6208
6229
  return { error: r };
6209
6230
  }
6210
6231
  }
6211
- async function Is({
6232
+ async function js({
6212
6233
  client: e,
6213
6234
  ids: t
6214
6235
  }) {
@@ -6226,7 +6247,7 @@ async function Is({
6226
6247
  }
6227
6248
  return r;
6228
6249
  }
6229
- async function Oc({
6250
+ async function Rc({
6230
6251
  client: e,
6231
6252
  moving: t,
6232
6253
  results: r,
@@ -6236,10 +6257,10 @@ async function Oc({
6236
6257
  return;
6237
6258
  const n = /* @__PURE__ */ new Map();
6238
6259
  for (const c of t) {
6239
- const l = Tc(c.move), d = n.get(l);
6260
+ const l = wc(c.move), d = n.get(l);
6240
6261
  d ? d.push(c) : n.set(l, [c]);
6241
6262
  }
6242
- const a = ir(e), i = [];
6263
+ const a = cr(e), i = [];
6243
6264
  for (const c of n.values()) {
6244
6265
  const l = [...new Set(c.map(({ item: p }) => p.id))], d = c[0]?.move, u = c.length === 1 ? c[0] : void 0;
6245
6266
  try {
@@ -6252,12 +6273,12 @@ async function Oc({
6252
6273
  }
6253
6274
  const p = await a(
6254
6275
  () => R(() => e.moveTasks(l, d))
6255
- ), h = new Map(p.map((f) => [f.id, f])), m = [], y = [];
6276
+ ), h = new Map(p.map((f) => [f.id, f])), m = [], g = [];
6256
6277
  for (const f of c) {
6257
6278
  const I = h.get(f.item.id);
6258
- I ? (r.set(f.item.index, { task: I }), y.push(f)) : m.push(f);
6279
+ I ? (r.set(f.item.index, { task: I }), g.push(f)) : m.push(f);
6259
6280
  }
6260
- o(y), m.length > 0 && i.push({ group: m, destination: d });
6281
+ o(g), m.length > 0 && i.push({ group: m, destination: d });
6261
6282
  } catch (p) {
6262
6283
  if (u) {
6263
6284
  r.set(u.item.index, { error: Y(p) }), o(c);
@@ -6267,17 +6288,17 @@ async function Oc({
6267
6288
  }
6268
6289
  }
6269
6290
  if (i.length > 0) {
6270
- await Pc({ client: e, unresolved: i, results: r });
6291
+ await _c({ client: e, unresolved: i, results: r });
6271
6292
  for (const { group: c } of i)
6272
6293
  o(c);
6273
6294
  }
6274
6295
  }
6275
- async function Pc({
6296
+ async function _c({
6276
6297
  client: e,
6277
6298
  unresolved: t,
6278
6299
  results: r
6279
6300
  }) {
6280
- const o = [...new Set(t.flatMap(({ group: a }) => a.map(({ item: i }) => i.id)))], n = await Is({ client: e, ids: o });
6301
+ const o = [...new Set(t.flatMap(({ group: a }) => a.map(({ item: i }) => i.id)))], n = await js({ client: e, ids: o });
6281
6302
  for (const { group: a, destination: i, error: c } of t) {
6282
6303
  const l = c === void 0 ? "Task not returned by the move" : Y(c);
6283
6304
  for (const { item: d } of a) {
@@ -6290,15 +6311,15 @@ async function Pc({
6290
6311
  }
6291
6312
  }
6292
6313
  }
6293
- async function Rc({
6314
+ async function Uc({
6294
6315
  client: e,
6295
6316
  items: t,
6296
6317
  onUpdated: r,
6297
6318
  onFailed: o
6298
6319
  }) {
6299
- const n = cr(e);
6320
+ const n = dr(e);
6300
6321
  await Promise.all(
6301
- t.filter((a) => vs(a.updateArgs)).map(async (a) => {
6322
+ t.filter((a) => Is(a.updateArgs)).map(async (a) => {
6302
6323
  try {
6303
6324
  const i = await n(
6304
6325
  () => R(() => e.updateTask(a.id, a.updateArgs))
@@ -6310,7 +6331,7 @@ async function Rc({
6310
6331
  })
6311
6332
  );
6312
6333
  }
6313
- async function _c({
6334
+ async function Mc({
6314
6335
  task: e,
6315
6336
  index: t,
6316
6337
  client: r,
@@ -6327,26 +6348,26 @@ async function _c({
6327
6348
  priority: p,
6328
6349
  labels: h,
6329
6350
  deadlineDate: m,
6330
- ...y
6351
+ ...g
6331
6352
  } = e;
6332
- if (L(a) && o.error !== void 0)
6353
+ if (F(a) && o.error !== void 0)
6333
6354
  throw o.error;
6334
- const f = L(a) ? o.projectId : a;
6355
+ const f = F(a) ? o.projectId : a;
6335
6356
  let I = {
6336
- ...y,
6357
+ ...g,
6337
6358
  ...h !== void 0 && { labels: h }
6338
6359
  };
6339
- p && (I.priority = Zt(p));
6340
- const C = Pt(
6360
+ p && (I.priority = Qt(p));
6361
+ const C = Rt(
6341
6362
  l,
6342
- Sc,
6343
- $c
6363
+ $c,
6364
+ Ac
6344
6365
  );
6345
6366
  C !== void 0 && (I = { ...I, dueString: C });
6346
- const E = Pt(m, Cc, null);
6367
+ const E = Rt(m, Dc, null);
6347
6368
  if (E !== void 0 && (I = { ...I, deadlineDate: E }), d)
6348
6369
  try {
6349
- const { minutes: T } = Xt(d);
6370
+ const { minutes: T } = Zt(d);
6350
6371
  I = {
6351
6372
  ...I,
6352
6373
  duration: T,
@@ -6357,7 +6378,7 @@ async function _c({
6357
6378
  }
6358
6379
  return u !== void 0 && (I = {
6359
6380
  ...I,
6360
- assigneeId: await Uc(r, n, u)
6381
+ assigneeId: await Nc(r, n, u)
6361
6382
  }), {
6362
6383
  index: t,
6363
6384
  id: n,
@@ -6371,7 +6392,7 @@ async function _c({
6371
6392
  failed: !1
6372
6393
  };
6373
6394
  }
6374
- async function Uc(e, t, r) {
6395
+ async function Nc(e, t, r) {
6375
6396
  if (r === null || r === "unassign")
6376
6397
  return null;
6377
6398
  const o = await dt.validateTaskUpdateAssignment(
@@ -6385,7 +6406,7 @@ async function Uc(e, t, r) {
6385
6406
  }
6386
6407
  return o.resolvedUser?.userId;
6387
6408
  }
6388
- function Mc({
6409
+ function Lc({
6389
6410
  tasks: e,
6390
6411
  failures: t,
6391
6412
  skippedCount: r,
@@ -6406,10 +6427,10 @@ function Mc({
6406
6427
  Failed (${t.length}) - address or drop these items:
6407
6428
  ${d}${u}`;
6408
6429
  }
6409
- function Nc({ id: e, ...t }) {
6430
+ function Fc({ id: e, ...t }) {
6410
6431
  return Object.keys(t).length > 0;
6411
6432
  }
6412
- function Pt(e, t, r) {
6433
+ function Rt(e, t, r) {
6413
6434
  if (e === void 0)
6414
6435
  return e;
6415
6436
  if (e === null)
@@ -6417,7 +6438,7 @@ function Pt(e, t, r) {
6417
6438
  const o = e.trim().toLowerCase();
6418
6439
  return t.includes(o) ? r : e;
6419
6440
  }
6420
- const Lc = {}, Fc = {
6441
+ const Hc = {}, Wc = {
6421
6442
  type: s.literal("user_info").describe("The type of the response."),
6422
6443
  userId: s.string().describe("The user ID."),
6423
6444
  fullName: s.string().describe("The full name of the user."),
@@ -6434,36 +6455,36 @@ const Lc = {}, Fc = {
6434
6455
  email: s.string().describe("The email address of the user."),
6435
6456
  plan: s.enum(["Todoist Free", "Todoist Pro", "Todoist Business"]).describe("The user plan.")
6436
6457
  };
6437
- function Hc(e) {
6458
+ function Bc(e) {
6438
6459
  return e.businessAccountId ? "Todoist Business" : e.isPremium ? "Todoist Pro" : "Todoist Free";
6439
6460
  }
6440
- function Wc(e, t) {
6461
+ function qc(e, t) {
6441
6462
  const o = ((e.getDay() || 7) - t + 7) % 7, n = new Date(e);
6442
6463
  return n.setDate(e.getDate() - o), n;
6443
6464
  }
6444
- function Bc(e) {
6465
+ function Yc(e) {
6445
6466
  const t = new Date(e);
6446
6467
  return t.setDate(e.getDate() + 6), t;
6447
6468
  }
6448
- function qc(e) {
6469
+ function zc(e) {
6449
6470
  const t = new Date(e.getFullYear(), 0, 1), r = (e.getTime() - t.getTime()) / 864e5;
6450
6471
  return Math.ceil((r + t.getDay() + 1) / 7);
6451
6472
  }
6452
- function Yc(e) {
6473
+ function Gc(e) {
6453
6474
  return ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"][e === 7 ? 0 : e] ?? "Unknown";
6454
6475
  }
6455
- function zc(e) {
6476
+ function Kc(e) {
6456
6477
  try {
6457
6478
  return new Intl.DateTimeFormat("en-US", { timeZone: e }), !0;
6458
6479
  } catch {
6459
6480
  return !1;
6460
6481
  }
6461
6482
  }
6462
- function js(e) {
6463
- return zc(e) ? e : "UTC";
6483
+ function Ss(e) {
6484
+ return Kc(e) ? e : "UTC";
6464
6485
  }
6465
- function Gc(e, t) {
6466
- const r = js(t);
6486
+ function Vc(e, t) {
6487
+ const r = Ss(t);
6467
6488
  return e.toLocaleString("en-US", {
6468
6489
  timeZone: r,
6469
6490
  year: "numeric",
@@ -6475,8 +6496,8 @@ function Gc(e, t) {
6475
6496
  hour12: !1
6476
6497
  });
6477
6498
  }
6478
- async function Kc(e) {
6479
- const t = await e.getUser(), r = t.tzInfo?.timezone ?? "UTC", o = js(r), n = /* @__PURE__ */ new Date(), a = Gc(n, o), i = t.startDay ?? 1, c = Yc(i), l = Hc(t), d = new Date(n.toLocaleString("en-US", { timeZone: o })), u = Wc(d, i), p = Bc(u), h = qc(d), y = [
6499
+ async function Jc(e) {
6500
+ const t = await e.getUser(), r = t.tzInfo?.timezone ?? "UTC", o = Ss(r), n = /* @__PURE__ */ new Date(), a = Vc(n, o), i = t.startDay ?? 1, c = Gc(i), l = Bc(t), d = new Date(n.toLocaleString("en-US", { timeZone: o })), u = qc(d, i), p = Yc(u), h = zc(d), g = [
6480
6501
  "# User Information",
6481
6502
  "",
6482
6503
  `**User ID:** ${t.id}`,
@@ -6516,28 +6537,28 @@ async function Kc(e) {
6516
6537
  email: t.email,
6517
6538
  plan: l
6518
6539
  };
6519
- return { textContent: y, structuredContent: f };
6540
+ return { textContent: g, structuredContent: f };
6520
6541
  }
6521
- const Vc = {
6522
- name: g.USER_INFO,
6542
+ const Xc = {
6543
+ name: y.USER_INFO,
6523
6544
  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).",
6524
- parameters: Lc,
6525
- outputSchema: Fc,
6545
+ parameters: Hc,
6546
+ outputSchema: Wc,
6526
6547
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
6527
6548
  async execute(e, t) {
6528
- const r = await Kc(t);
6549
+ const r = await Jc(t);
6529
6550
  return {
6530
6551
  textContent: r.textContent,
6531
6552
  structuredContent: r.structuredContent
6532
6553
  };
6533
6554
  }
6534
- }, Rt = 10 * 1024 * 1024, Jc = /* @__PURE__ */ new Set([
6555
+ }, _t = 10 * 1024 * 1024, Zc = /* @__PURE__ */ new Set([
6535
6556
  "image/png",
6536
6557
  "image/jpeg",
6537
6558
  "image/gif",
6538
6559
  "image/webp",
6539
6560
  "image/svg+xml"
6540
- ]), Xc = /* @__PURE__ */ new Set([
6561
+ ]), Qc = /* @__PURE__ */ new Set([
6541
6562
  "text/plain",
6542
6563
  "text/csv",
6543
6564
  "text/html",
@@ -6545,7 +6566,7 @@ const Vc = {
6545
6566
  "application/json",
6546
6567
  "application/xml",
6547
6568
  "text/xml"
6548
- ]), Zc = {
6569
+ ]), ed = {
6549
6570
  ".png": "image/png",
6550
6571
  ".jpg": "image/jpeg",
6551
6572
  ".jpeg": "image/jpeg",
@@ -6560,23 +6581,23 @@ const Vc = {
6560
6581
  ".xml": "application/xml",
6561
6582
  ".pdf": "application/pdf"
6562
6583
  };
6563
- function Qc(e) {
6564
- return Jc.has(e) ? "image" : Xc.has(e) || e.startsWith("text/") ? "text" : "binary";
6584
+ function td(e) {
6585
+ return Zc.has(e) ? "image" : Qc.has(e) || e.startsWith("text/") ? "text" : "binary";
6565
6586
  }
6566
- function ed(e) {
6587
+ function sd(e) {
6567
6588
  return (e.split(";")[0] ?? e).trim().toLowerCase();
6568
6589
  }
6569
- function td(e) {
6590
+ function rd(e) {
6570
6591
  try {
6571
6592
  const t = new URL(e).pathname, r = t.lastIndexOf(".");
6572
6593
  if (r === -1) return;
6573
6594
  const o = t.slice(r).toLowerCase();
6574
- return Zc[o];
6595
+ return ed[o];
6575
6596
  } catch {
6576
6597
  return;
6577
6598
  }
6578
6599
  }
6579
- function sd(e) {
6600
+ function od(e) {
6580
6601
  try {
6581
6602
  const t = new URL(e).pathname, r = t.lastIndexOf("/");
6582
6603
  return r === -1 ? void 0 : t.slice(r + 1) || void 0;
@@ -6584,31 +6605,31 @@ function sd(e) {
6584
6605
  return;
6585
6606
  }
6586
6607
  }
6587
- const rd = {
6608
+ const nd = {
6588
6609
  fileUrl: s.url().describe(
6589
6610
  "The URL of the attachment file to view. Get this from the fileUrl field in a comment's fileAttachment."
6590
6611
  )
6591
- }, od = {
6592
- name: g.VIEW_ATTACHMENT,
6612
+ }, ad = {
6613
+ name: y.VIEW_ATTACHMENT,
6593
6614
  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).",
6594
- parameters: rd,
6615
+ parameters: nd,
6595
6616
  annotations: {
6596
6617
  readOnlyHint: !0,
6597
6618
  destructiveHint: !1,
6598
6619
  idempotentHint: !0
6599
6620
  },
6600
6621
  async execute({ fileUrl: e }, t) {
6601
- const r = await t.viewAttachment(e), o = r.headers["content-length"], n = o ? Number.parseInt(o, 10) : void 0, a = sd(e), i = r.headers["content-type"], c = i ? ed(i) : void 0, l = c && c !== "application/octet-stream" ? c : td(e) ?? c ?? "application/octet-stream";
6602
- if (n && n > Rt)
6622
+ const r = await t.viewAttachment(e), o = r.headers["content-length"], n = o ? Number.parseInt(o, 10) : void 0, a = od(e), i = r.headers["content-type"], c = i ? sd(i) : void 0, l = c && c !== "application/octet-stream" ? c : rd(e) ?? c ?? "application/octet-stream";
6623
+ if (n && n > _t)
6603
6624
  return {
6604
6625
  textContent: `Attachment "${a ?? e}" is too large to display inline (${(n / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${l}`
6605
6626
  };
6606
6627
  const d = Buffer.from(await r.arrayBuffer()), u = d.byteLength;
6607
- if (u > Rt)
6628
+ if (u > _t)
6608
6629
  return {
6609
6630
  textContent: `Attachment "${a ?? e}" is too large to display inline (${(u / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${l}`
6610
6631
  };
6611
- const p = Qc(l), h = [];
6632
+ const p = td(l), h = [];
6612
6633
  return p === "image" ? h.push({
6613
6634
  type: "image",
6614
6635
  data: d.toString("base64"),
@@ -6628,7 +6649,7 @@ const rd = {
6628
6649
  contentItems: h
6629
6650
  };
6630
6651
  }
6631
- }, nd = `
6652
+ }, id = `
6632
6653
  ## Todoist Task and Project Management Tools
6633
6654
 
6634
6655
  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.
@@ -6650,7 +6671,7 @@ You have access to comprehensive Todoist management tools for personal productiv
6650
6671
  - **uncomplete-tasks**: Reopen completed tasks using task IDs
6651
6672
  - **find-tasks**: Search by text, project/section/parent container, responsible user, labels, a raw Todoist \`filter\` string (e.g. "today", "p1", "##Work", "(today | overdue) & p1"), or a saved filter by ID or name (\`filterIdOrName\`). Requires at least one search parameter. \`filter\`/\`filterIdOrName\` cannot be combined with projectId/sectionId/parentId, and \`filter\` and \`filterIdOrName\` are mutually exclusive.
6652
6673
  - **find-tasks-by-date**: Get tasks by date range (startDate: YYYY-MM-DD or 'today' which includes overdue tasks) or specific day counts
6653
- - **find-completed-tasks**: View completed tasks by completion date or original due date; if since/until are omitted, defaults to the last 7 days (returns all collaborators unless filtered)
6674
+ - **find-completed-tasks**: View completed tasks by completion date or original due date; if since/until are omitted, defaults to the last 7 days (returns all collaborators unless filtered). For a history of actual task-completion events, including recurring task occurrences, use find-activity instead.
6654
6675
 
6655
6676
  **Project & Organization:**
6656
6677
  - **add-projects/update-projects/find-projects**: Manage project lifecycle with names, descriptions (Markdown), favorites, view styles (list/board/calendar), and workspace assignment for new projects (by name or ID). find-projects returns active projects by default; pass archivedStatus ('archived' or 'all') to include archived projects. Every returned project includes an isArchived field
@@ -6680,7 +6701,7 @@ You have access to comprehensive Todoist management tools for personal productiv
6680
6701
  - **update-filters**: Modify existing filters' name, query, color, or favorite status
6681
6702
 
6682
6703
  **Activity & Audit:**
6683
- - **find-activity**: Retrieve recent activity logs to monitor and audit changes. Shows events from all users by default; use initiatorId to filter by specific user. Filter by object type (task/project/comment), event type (added/updated/deleted/completed/uncompleted/archived/unarchived/shared/left), and specific objects (objectId, projectId, taskId). Useful for tracking who did what and when. Note: Date-based filtering is not supported.
6704
+ - **find-activity**: Retrieve activity logs to monitor and audit changes. Shows events from all users by default; use initiatorId to filter by specific user. Filter by object type (task/project/comment), event type (added/updated/deleted/completed/uncompleted/archived/unarchived/shared/left), objects (objectId, projectId, taskId), and an inclusive dateFrom/exclusive dateTo range. For “what did I complete?” or “what got done?” questions, including recurring task occurrences, use objectType="task", eventType="completed", and the requested date range. Activity history retention depends on the user plan.
6684
6705
  - **get-productivity-stats**: Get comprehensive productivity statistics including daily/weekly completion breakdowns, goal streaks (current, last, max), karma score and trends, and historical karma data. No parameters required.
6685
6706
 
6686
6707
  **Project Health & Insights:**
@@ -6720,6 +6741,7 @@ You have access to comprehensive Todoist management tools for personal productiv
6720
6741
  - **User Lookup**: find-project-collaborators with just a searchTerm (no projectId) to resolve a name or email to a Todoist user ID across all shared-project collaborators you can access
6721
6742
  - **Task Search**: find-tasks with multiple filters → update-tasks or complete-tasks based on results
6722
6743
  - **Project Organization**: add-projects → add-sections → add-tasks with projectId and sectionId
6744
+ - **Completion History**: find-activity with objectType="task", eventType="completed", dateFrom, and dateTo to report what was actually completed in a period, including recurring task occurrences; use initiatorId for one collaborator
6723
6745
  - **Progress Reviews**: find-completed-tasks (defaults to last 7 days; optionally use explicit date ranges) → get-overview for project summaries
6724
6746
  - **Activity Auditing**: find-activity with event/object filters to track changes, monitor team activity, or investigate specific actions
6725
6747
  - **Productivity Analysis**: Use the productivity-analysis prompt for comprehensive analysis combining user-info, get-productivity-stats, and find-completed-tasks data into actionable insights
@@ -6727,31 +6749,31 @@ You have access to comprehensive Todoist management tools for personal productiv
6727
6749
 
6728
6750
  Always provide clear, actionable task titles and descriptions. Use the overview tools to give users context about their workload and project status.
6729
6751
  `;
6730
- function kd({
6752
+ function vd({
6731
6753
  todoistApiKey: e,
6732
6754
  baseUrl: t,
6733
6755
  features: r = []
6734
6756
  }) {
6735
- const o = new Cs(
6757
+ const o = new $s(
6736
6758
  { name: "todoist-mcp-server", version: Ze },
6737
6759
  {
6738
6760
  capabilities: {
6739
6761
  tools: { listChanged: !0 },
6740
6762
  prompts: { listChanged: !0 }
6741
6763
  },
6742
- instructions: nd
6764
+ instructions: id
6743
6765
  }
6744
- ), n = vr(e, { baseUrl: t }), a = {
6745
- ...Ta,
6766
+ ), n = Ir(e, { baseUrl: t }), a = {
6767
+ ...wa,
6746
6768
  _meta: {
6747
6769
  ui: {
6748
6770
  resourceUri: Le
6749
6771
  }
6750
6772
  }
6751
6773
  };
6752
- Ys(o);
6774
+ zs(o);
6753
6775
  const i = { server: o, client: n, features: r };
6754
- return w({ tool: rn, ...i }), w({ tool: hn, ...i }), w({ tool: Pi, ...i }), w({ tool: Ac, ...i }), w({ tool: Ci, ...i }), w({ tool: $a, ...i }), w({ tool: a, ...i }), w({ tool: Gn, ...i }), w({ tool: Lo, ...i }), w({ tool: oc, ...i }), w({ tool: ia, ...i }), w({ tool: bi, ...i }), w({ tool: ki, ...i }), w({ tool: Zo, ...i }), w({ tool: gc, ...i }), w({ tool: ba, ...i }), w({ tool: fo, ...i }), w({ tool: Nn, ...i }), w({ tool: Ni, ...i }), w({ tool: Go, ...i }), w({ tool: ua, ...i }), w({ tool: hc, ...i }), w({ tool: od, ...i }), w({ tool: Do, ...i }), w({ tool: Zi, ...i }), w({ tool: Xn, ...i }), w({ tool: ko, ...i }), w({ tool: jo, ...i }), w({ tool: Bi, ...i }), w({ tool: En, ...i }), w({ tool: Fa, ...i }), w({ tool: Za, ...i }), w({ tool: Ya, ...i }), w({ tool: ln, ...i }), w({ tool: si, ...i }), w({ tool: Ma, ...i }), w({ tool: gn, ...i }), w({ tool: Sn, ...i }), w({ tool: vi, ...i }), w({ tool: Vc, ...i }), w({ tool: ta, ...i }), w({ tool: hi, ...i }), w({ tool: ii, ...i }), w({ tool: xi, ...i }), w({ tool: Dn, ...i }), o.registerPrompt(
6776
+ return v({ tool: on, ...i }), v({ tool: mn, ...i }), v({ tool: _i, ...i }), v({ tool: Ec, ...i }), v({ tool: Di, ...i }), v({ tool: Aa, ...i }), v({ tool: a, ...i }), v({ tool: Vn, ...i }), v({ tool: Fo, ...i }), v({ tool: ac, ...i }), v({ tool: da, ...i }), v({ tool: yi, ...i }), v({ tool: vi, ...i }), v({ tool: Qo, ...i }), v({ tool: kc, ...i }), v({ tool: ya, ...i }), v({ tool: bo, ...i }), v({ tool: Fn, ...i }), v({ tool: Fi, ...i }), v({ tool: Ko, ...i }), v({ tool: ha, ...i }), v({ tool: fc, ...i }), v({ tool: ad, ...i }), v({ tool: Ao, ...i }), v({ tool: ec, ...i }), v({ tool: Qn, ...i }), v({ tool: To, ...i }), v({ tool: So, ...i }), v({ tool: Yi, ...i }), v({ tool: Pn, ...i }), v({ tool: Wa, ...i }), v({ tool: ei, ...i }), v({ tool: Ga, ...i }), v({ tool: un, ...i }), v({ tool: oi, ...i }), v({ tool: La, ...i }), v({ tool: yn, ...i }), v({ tool: Cn, ...i }), v({ tool: ji, ...i }), v({ tool: Xc, ...i }), v({ tool: ra, ...i }), v({ tool: fi, ...i }), v({ tool: di, ...i }), v({ tool: Oi, ...i }), v({ tool: An, ...i }), o.registerPrompt(
6755
6777
  be.name,
6756
6778
  {
6757
6779
  title: be.title,
@@ -6762,48 +6784,48 @@ function kd({
6762
6784
  ), o;
6763
6785
  }
6764
6786
  export {
6765
- ba as A,
6766
- gc as B,
6767
- Zo as C,
6768
- ia as D,
6769
- oc as E,
6770
- Lo as F,
6771
- Ci as G,
6772
- Gn as H,
6773
- Ta as I,
6774
- $a as J,
6775
- Ac as K,
6776
- Pi as L,
6777
- hn as M,
6778
- rn as N,
6779
- yd as O,
6780
- vr as P,
6781
- hr as Q,
6782
- Dr as R,
6783
- ta as a,
6784
- Ma as b,
6785
- si as c,
6786
- gn as d,
6787
- ln as e,
6788
- Dn as f,
6789
- kd as g,
6790
- Ya as h,
6791
- Za as i,
6792
- Fa as j,
6793
- En as k,
6794
- ii as l,
6795
- hi as m,
6796
- Bi as n,
6797
- jo as o,
6798
- ko as p,
6799
- Xn as q,
6800
- vi as r,
6801
- xi as s,
6802
- Zi as t,
6803
- Vc as u,
6804
- Do as v,
6805
- od as w,
6806
- Nn as x,
6807
- Ni as y,
6808
- fo as z
6787
+ ya as A,
6788
+ kc as B,
6789
+ Qo as C,
6790
+ da as D,
6791
+ ac as E,
6792
+ Fo as F,
6793
+ Di as G,
6794
+ Vn as H,
6795
+ wa as I,
6796
+ Aa as J,
6797
+ Ec as K,
6798
+ _i as L,
6799
+ mn as M,
6800
+ on as N,
6801
+ Td as O,
6802
+ Ir as P,
6803
+ mr as Q,
6804
+ Ar as R,
6805
+ ra as a,
6806
+ La as b,
6807
+ oi as c,
6808
+ yn as d,
6809
+ un as e,
6810
+ An as f,
6811
+ vd as g,
6812
+ Ga as h,
6813
+ ei as i,
6814
+ Wa as j,
6815
+ Pn as k,
6816
+ di as l,
6817
+ fi as m,
6818
+ Yi as n,
6819
+ So as o,
6820
+ To as p,
6821
+ Qn as q,
6822
+ ji as r,
6823
+ Oi as s,
6824
+ ec as t,
6825
+ Xc as u,
6826
+ Ao as v,
6827
+ ad as w,
6828
+ Fn as x,
6829
+ Fi as y,
6830
+ bo as z
6809
6831
  };