@doist/todoist-mcp 12.5.1 → 12.5.2

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.
@@ -7,7 +7,7 @@ import { registerAppResource as Os, RESOURCE_MIME_TYPE as Lt, registerAppTool as
7
7
  import se, { ZodError as Rs, z as s } from "zod";
8
8
  import { AsyncLocalStorage as _s } from "node:async_hooks";
9
9
  import { createRequire as Us } from "node:module";
10
- import { TodoistApi as Ls, isWorkspaceProject as ke, isPersonalProject as B, colors as _e, LOCATION_TRIGGERS as Mt, REMINDER_TYPES as Ms, createCommand as V, REMINDER_DELIVERY_SERVICES as Ns, HEALTH_STATUSES as Ke, getTaskUrl as Nt, getProjectUrl as Ft, WORKSPACE_ROLES as Fs, WORKSPACE_PLANS as Hs } from "@doist/todoist-sdk";
10
+ import { TodoistApi as Ls, isWorkspaceProject as Te, isPersonalProject as B, colors as _e, LOCATION_TRIGGERS as Mt, REMINDER_TYPES as Ms, createCommand as V, REMINDER_DELIVERY_SERVICES as Ns, HEALTH_STATUSES as Ke, getTaskUrl as Nt, getProjectUrl as Ft, WORKSPACE_ROLES as Fs, WORKSPACE_PLANS as Hs } from "@doist/todoist-sdk";
11
11
  import { addDays as Ue, formatISO as lt } from "date-fns";
12
12
  const ut = Ut(Es(import.meta.url)), Ws = [
13
13
  Re(ut, "task-list", "index.html"),
@@ -18,7 +18,7 @@ const ut = Ut(Es(import.meta.url)), Ws = [
18
18
  <p>Task list app is missing. Run "npm run build" to generate it.</p>
19
19
  </body>
20
20
  </html>`;
21
- function qs() {
21
+ function Ys() {
22
22
  const e = [];
23
23
  for (const t of Ws)
24
24
  try {
@@ -28,7 +28,7 @@ function qs() {
28
28
  }
29
29
  return console.error("Failed to load task list app HTML from any known path:", e), Bs;
30
30
  }
31
- const Ht = qs(), zs = _t("sha256").update(Ht).digest("hex").slice(0, 12), Le = `ui://todoist/task-list@${zs}`, Ys = "ui://todoist/task-list@{hash}", Me = "Interactive task list widget", Gs = "https://ai.todoist.net", Ne = {
31
+ const Ht = Ys(), zs = _t("sha256").update(Ht).digest("hex").slice(0, 12), Le = `ui://todoist/task-list@${zs}`, qs = "ui://todoist/task-list@{hash}", Me = "Interactive task list widget", Gs = "https://ai.todoist.net", Ne = {
32
32
  ui: {
33
33
  prefersBorder: !0,
34
34
  csp: {
@@ -69,7 +69,7 @@ function Ks(e) {
69
69
  async () => pt(Le)
70
70
  ), e.registerResource(
71
71
  "todoist-task-list-hash-fallback",
72
- new Ds(Ys, { list: void 0 }),
72
+ new Ds(qs, { list: void 0 }),
73
73
  {
74
74
  description: `${Me} compatibility fallback`,
75
75
  mimeType: Lt,
@@ -301,7 +301,7 @@ function Ve(e) {
301
301
  w(t?.message),
302
302
  w(r?.message),
303
303
  e instanceof Error ? e.message : w(e)
304
- ].filter((m) => !!m), l = d.find((m) => !He(m)) || d[0], u = L(
304
+ ].filter((h) => !!h), l = d.find((h) => !He(h)) || d[0], u = L(
305
305
  K(n?.errorExtra),
306
306
  K(n?.error_extra),
307
307
  K(n?.details),
@@ -338,12 +338,12 @@ class ve extends Error {
338
338
  super(t), this.name = "DueStringParseError";
339
339
  }
340
340
  }
341
- class qt extends Error {
341
+ class Yt extends Error {
342
342
  constructor(t) {
343
343
  super(t), this.name = "BatchDueStringParseError";
344
344
  }
345
345
  }
346
- function q(e) {
346
+ function Y(e) {
347
347
  if (e instanceof ve)
348
348
  return e.message;
349
349
  const t = Ve(e);
@@ -366,12 +366,12 @@ function rr(e, {
366
366
  return d !== r.trim() && d ? `Task "${t}" wasn't created because \`dueString\` could not be parsed. Use Todoist recurrence syntax, for example \`${d}\`; don't prefix it with \`recurring\`. Change only \`dueString\` and retry.` : d !== 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.`;
367
367
  }
368
368
  function or(e) {
369
- if (e instanceof Rs || e instanceof ve || e instanceof qt)
369
+ if (e instanceof Rs || e instanceof ve || e instanceof Yt)
370
370
  return e.message;
371
371
  const t = Ve(e);
372
372
  return t ? sr(t) : Bt(e);
373
373
  }
374
- const nr = "12.5.1", ar = {
374
+ const nr = "12.5.2", ar = {
375
375
  version: nr
376
376
  }, C = {
377
377
  /** Default limit for task listings */
@@ -434,7 +434,7 @@ const nr = "12.5.1", ar = {
434
434
  */
435
435
  QUEUE_WAIT_MS: 3e4
436
436
  };
437
- function ht(e, { queueTimeoutMs: t = Be.QUEUE_WAIT_MS } = {}) {
437
+ function mt(e, { queueTimeoutMs: t = Be.QUEUE_WAIT_MS } = {}) {
438
438
  if (!Number.isInteger(e) || e < 1)
439
439
  throw new Error(
440
440
  `maxConcurrent must be a positive integer, received ${String(e)}`
@@ -475,24 +475,24 @@ function ht(e, { queueTimeoutMs: t = Be.QUEUE_WAIT_MS } = {}) {
475
475
  }
476
476
  };
477
477
  }
478
- function Yt() {
478
+ function qt() {
479
479
  return {
480
- moves: ht(Be.TASK_MOVES),
481
- writes: ht(Be.WRITES)
480
+ moves: mt(Be.TASK_MOVES),
481
+ writes: mt(Be.WRITES)
482
482
  };
483
483
  }
484
- const mt = /* @__PURE__ */ new Map(), Gt = /* @__PURE__ */ new WeakMap();
484
+ const ht = /* @__PURE__ */ new Map(), Gt = /* @__PURE__ */ new WeakMap();
485
485
  let ft;
486
486
  function ir() {
487
- return ft ??= Yt(), ft;
487
+ return ft ??= qt(), ft;
488
488
  }
489
489
  function cr(e) {
490
490
  return _t("sha256").update(e).digest("hex");
491
491
  }
492
492
  function dr(e, t) {
493
493
  const r = cr(t);
494
- let o = mt.get(r);
495
- o || (o = Yt(), mt.set(r, o)), Gt.set(e, o);
494
+ let o = ht.get(r);
495
+ o || (o = qt(), ht.set(r, o)), Gt.set(e, o);
496
496
  }
497
497
  function Kt(e) {
498
498
  return Gt.get(e) ?? ir();
@@ -504,12 +504,12 @@ function ur(e) {
504
504
  return Kt(e).writes;
505
505
  }
506
506
  const pr = "todoist-mcp", Je = ar.version, Vt = new _s(), bt = Us(import.meta.url);
507
- let Te;
508
- const hr = async () => {
507
+ let ke;
508
+ const mr = async () => {
509
509
  const e = bt.resolve("@doist/todoist-sdk"), t = Re(Ut(e), "transport", "http-dispatcher.js");
510
510
  return bt(t);
511
511
  };
512
- let mr = hr;
512
+ let hr = mr;
513
513
  function fr() {
514
514
  return `${pr}/${Je}`;
515
515
  }
@@ -543,7 +543,7 @@ function yr(e, t) {
543
543
  function gt() {
544
544
  return new DOMException("The operation was aborted due to timeout", "TimeoutError");
545
545
  }
546
- function Tr(e, t) {
546
+ function kr(e, t) {
547
547
  if (!e && t === void 0)
548
548
  return {
549
549
  signal: void 0,
@@ -581,17 +581,17 @@ function Tr(e, t) {
581
581
  }
582
582
  };
583
583
  }
584
- async function kr() {
584
+ async function Tr() {
585
585
  if (wr())
586
- return Te || (Te = mr().then((e) => e.getDefaultDispatcher()).catch((e) => {
587
- throw Te = void 0, e;
588
- })), Te;
586
+ return ke || (ke = hr().then((e) => e.getDefaultDispatcher()).catch((e) => {
587
+ throw ke = void 0, e;
588
+ })), ke;
589
589
  }
590
590
  function wr() {
591
591
  return typeof process < "u" && !!process.versions?.node;
592
592
  }
593
593
  async function vr(e) {
594
- const t = await kr();
594
+ const t = await Tr();
595
595
  t !== void 0 && (e.dispatcher = t);
596
596
  }
597
597
  function Ir(e) {
@@ -608,18 +608,18 @@ function Ir(e) {
608
608
  function jr(e = globalThis.fetch, t = {}) {
609
609
  const r = e === globalThis.fetch, { enabled: o = !0, platform: n = "mcp", sessionId: a = Pe() } = t;
610
610
  return async (i, c = {}) => {
611
- const { timeout: d, headers: l, signal: u, ...p } = c, { signal: h, cleanup: m } = Tr(u, d);
611
+ const { timeout: d, headers: l, signal: u, ...p } = c, { signal: m, cleanup: h } = kr(u, d);
612
612
  try {
613
613
  const y = {
614
614
  ...p,
615
- signal: h,
615
+ signal: m,
616
616
  ...o ? { headers: yr(l, { platform: n, sessionId: a }) } : l !== void 0 ? { headers: l } : {}
617
617
  };
618
618
  r && await vr(y);
619
619
  const f = await e(i, y);
620
620
  return Ir(f);
621
621
  } finally {
622
- m();
622
+ h();
623
623
  }
624
624
  };
625
625
  }
@@ -682,16 +682,16 @@ async function O(e, t = {}) {
682
682
  }
683
683
  throw i;
684
684
  }
685
- function qe(e) {
685
+ function Ye(e) {
686
686
  if (e == null)
687
687
  return e;
688
688
  if (Array.isArray(e))
689
- return e.map((t) => qe(t));
689
+ return e.map((t) => Ye(t));
690
690
  if (typeof e == "object") {
691
691
  const t = {};
692
692
  for (const [r, o] of Object.entries(e))
693
693
  if (o !== null) {
694
- const n = qe(o);
694
+ const n = Ye(o);
695
695
  if (n !== null && typeof n == "object" && !Array.isArray(n) && Object.keys(n).length === 0)
696
696
  continue;
697
697
  t[r] = n;
@@ -775,7 +775,7 @@ function Ur({
775
775
  structuredContent: t,
776
776
  contentItems: r
777
777
  }) {
778
- const o = qe(t), n = {}, a = [];
778
+ const o = Ye(t), n = {}, a = [];
779
779
  return r && a.push(...r), !_r && t && a.push({
780
780
  type: "text",
781
781
  text: JSON.stringify(o)
@@ -824,7 +824,7 @@ function ze(e) {
824
824
  }
825
825
  return e;
826
826
  }
827
- function qr(e) {
827
+ function Yr(e) {
828
828
  const t = /\s*\([^)]*@[^)]+\)/g, r = /\S+@\S+\.\S+/g;
829
829
  return e.replace(t, "").replace(r, "[email hidden]");
830
830
  }
@@ -836,11 +836,11 @@ function zr({
836
836
  }) {
837
837
  const n = o.some((d) => d.name === "strip_emails") && Br.includes(e.name), a = e.execute, i = async (d, l) => {
838
838
  try {
839
- let { textContent: u, structuredContent: p, contentItems: h } = await br(
839
+ let { textContent: u, structuredContent: p, contentItems: m } = await br(
840
840
  e.name,
841
841
  () => O(() => a(d, r))
842
842
  );
843
- return n && (u && (u = qr(u)), p && (p = ze(p))), Ur({ textContent: u, structuredContent: p, contentItems: h });
843
+ return n && (u && (u = Yr(u)), p && (p = ze(p))), Ur({ textContent: u, structuredContent: p, contentItems: m });
844
844
  } catch (u) {
845
845
  return console.error(`Error executing tool ${e.name}:`, { args: Nr(d), error: u }), Lr(or(u));
846
846
  }
@@ -865,7 +865,7 @@ function zr({
865
865
  }
866
866
  t.registerTool(e.name, c, i);
867
867
  }
868
- const Yr = {
868
+ const qr = {
869
869
  period: s.enum(["today", "7d", "14d", "30d", "this-week", "this-month"]).default("7d").describe(
870
870
  '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.'
871
871
  ),
@@ -997,11 +997,11 @@ function Jr(e) {
997
997
  ]
998
998
  };
999
999
  }
1000
- const me = {
1000
+ const he = {
1001
1001
  name: "productivity-analysis",
1002
1002
  title: "Productivity Analysis",
1003
1003
  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.",
1004
- argsSchema: Yr,
1004
+ argsSchema: qr,
1005
1005
  callback: Jr
1006
1006
  };
1007
1007
  class R extends Error {
@@ -1126,12 +1126,12 @@ class ro {
1126
1126
  try {
1127
1127
  const p = await t.getUser();
1128
1128
  if (p) {
1129
- const h = {
1129
+ const m = {
1130
1130
  id: p.id,
1131
1131
  name: p.fullName,
1132
1132
  email: p.email
1133
1133
  };
1134
- d.some((m) => m.id === p.id) || (d = [h, ...d]);
1134
+ d.some((h) => h.id === p.id) || (d = [m, ...d]);
1135
1135
  }
1136
1136
  } catch {
1137
1137
  }
@@ -1197,18 +1197,18 @@ class ro {
1197
1197
  const c = (await N({
1198
1198
  apiMethod: t.getProjects.bind(t),
1199
1199
  args: {}
1200
- })).filter((h) => h.isShared);
1200
+ })).filter((m) => m.isShared);
1201
1201
  if (c.length === 0) {
1202
- const h = [];
1203
- return n && oe.set(n, h), h;
1202
+ const m = [];
1203
+ return n && oe.set(n, m), m;
1204
1204
  }
1205
1205
  const d = [], l = /* @__PURE__ */ new Set(), u = c.map(
1206
- (h) => this.getProjectCollaborators(t, h.id, o)
1206
+ (m) => this.getProjectCollaborators(t, m.id, o)
1207
1207
  ), p = await Promise.allSettled(u);
1208
- for (const h of p)
1209
- if (h.status === "fulfilled")
1210
- for (const m of h.value)
1211
- m && !l.has(m.id) && (d.push(m), l.add(m.id));
1208
+ for (const m of p)
1209
+ if (m.status === "fulfilled")
1210
+ for (const h of m.value)
1211
+ h && !l.has(h.id) && (d.push(h), l.add(h.id));
1212
1212
  return n && oe.set(n, d), d;
1213
1213
  } catch {
1214
1214
  return [];
@@ -1376,8 +1376,8 @@ function Z(e) {
1376
1376
  parentId: B(e) ? e.parentId ?? void 0 : void 0,
1377
1377
  inboxProject: B(e) ? e.inboxProject ?? !1 : !1,
1378
1378
  viewStyle: e.viewStyle,
1379
- workspaceId: ke(e) ? e.workspaceId : void 0,
1380
- folderId: ke(e) ? e.folderId ?? void 0 : void 0,
1379
+ workspaceId: Te(e) ? e.workspaceId : void 0,
1380
+ folderId: Te(e) ? e.folderId ?? void 0 : void 0,
1381
1381
  childOrder: e.childOrder,
1382
1382
  isArchived: e.isArchived
1383
1383
  };
@@ -1419,7 +1419,7 @@ function po(e) {
1419
1419
  extraData: e.extraData ?? void 0
1420
1420
  };
1421
1421
  }
1422
- const ho = se.object({
1422
+ const mo = se.object({
1423
1423
  httpStatusCode: se.number(),
1424
1424
  responseData: se.object({
1425
1425
  error: se.string(),
@@ -1437,7 +1437,7 @@ async function tt({
1437
1437
  const { results: n, nextCursor: a } = await e.getTasksByFilter({ query: t, cursor: o, limit: r });
1438
1438
  return { tasks: n.map(P), nextCursor: a };
1439
1439
  } catch (n) {
1440
- const a = ho.safeParse(n);
1440
+ const a = mo.safeParse(n);
1441
1441
  if (!a.success)
1442
1442
  throw n;
1443
1443
  const { responseData: i } = a.data;
@@ -1493,132 +1493,126 @@ function ns(e) {
1493
1493
  return { timeBasedCount: t, locationCount: r };
1494
1494
  }
1495
1495
  const Ie = _e.map((e) => e.key);
1496
- function mo(e) {
1496
+ function ho(e) {
1497
1497
  if (typeof e != "string") return;
1498
1498
  const t = e.toLowerCase();
1499
1499
  return (_e.find((o) => o.key === t) ?? _e.find((o) => o.displayName.toLowerCase() === t))?.key;
1500
1500
  }
1501
- const fo = `Color for the entity. Accepts a color key (e.g. "berry_red") or display name (e.g. "Berry Red"). Valid colors: ${Ie.join(", ")}. Unrecognized colors are omitted and charcoal will be used as the default.`, le = s.preprocess(mo, s.enum(Ie).optional()).describe(fo);
1502
- s.enum(Ie).describe("The color key of the entity.");
1503
- const ue = s.enum(Ie).optional().catch(void 0).describe("The color key of the entity."), F = s.object({
1504
- id: s.string().describe("The unique ID of the task."),
1505
- content: s.string().describe("The task title/content."),
1506
- description: s.string().describe("The task description."),
1507
- dueDate: s.string().optional().describe("The due date of the task (ISO 8601 format)."),
1508
- recurring: s.union([s.boolean(), s.string()]).describe("Whether the task is recurring, or the recurrence string."),
1509
- deadlineDate: s.string().optional().describe("The deadline date of the task (ISO 8601 format)."),
1510
- priority: Ze.describe(
1511
- "The priority level: p1 (highest), p2 (high), p3 (medium), p4 (lowest)."
1512
- ),
1513
- projectId: s.string().describe("The ID of the project this task belongs to."),
1514
- sectionId: s.string().optional().describe("The ID of the section this task belongs to."),
1515
- parentId: s.string().optional().describe("The ID of the parent task (for subtasks)."),
1516
- labels: s.array(s.string()).optional().describe("The labels attached to this task."),
1517
- duration: s.string().optional().describe('The duration of the task (e.g., "2h30m").'),
1518
- responsibleUid: s.string().optional().describe("The UID of the user responsible for this task."),
1519
- isUncompletable: s.boolean().optional().describe("Whether the task is uncompletable (organizational header)."),
1520
- assignedByUid: s.string().optional().describe("The UID of the user who assigned this task."),
1521
- checked: s.boolean().describe("Whether the task is checked/completed."),
1522
- completedAt: s.string().optional().describe("When the task was completed (ISO 8601 format)."),
1523
- addedAt: s.string().optional().describe("When the task was created (ISO 8601 format).")
1501
+ const fo = `Color for the entity. Accepts a color key (e.g. "berry_red") or display name (e.g. "Berry Red"). Valid colors: ${Ie.join(", ")}. Unrecognized colors are omitted and charcoal will be used as the default.`, le = s.preprocess(ho, s.enum(Ie).optional()).describe(fo);
1502
+ s.enum(Ie);
1503
+ const ue = s.enum(Ie).optional().catch(void 0), F = s.object({
1504
+ id: s.string(),
1505
+ content: s.string().describe("Task title."),
1506
+ description: s.string(),
1507
+ dueDate: s.string().optional().describe("ISO 8601."),
1508
+ recurring: s.union([s.boolean(), s.string()]).describe("False when not recurring, otherwise the recurrence string."),
1509
+ deadlineDate: s.string().optional().describe("ISO 8601."),
1510
+ priority: Ze.describe("p1 is highest, p4 lowest."),
1511
+ projectId: s.string(),
1512
+ sectionId: s.string().optional(),
1513
+ parentId: s.string().optional(),
1514
+ labels: s.array(s.string()).optional(),
1515
+ duration: s.string().optional().describe('e.g. "2h30m".'),
1516
+ responsibleUid: s.string().optional(),
1517
+ isUncompletable: s.boolean().optional().describe("An organizational header, not a real task."),
1518
+ assignedByUid: s.string().optional(),
1519
+ checked: s.boolean().describe("Whether the task is completed."),
1520
+ completedAt: s.string().optional().describe("ISO 8601."),
1521
+ addedAt: s.string().optional().describe("ISO 8601.")
1524
1522
  }), Q = s.object({
1525
- id: s.string().describe("The unique ID of the project."),
1526
- name: s.string().describe("The name of the project."),
1527
- description: s.string().describe("The description of the project (empty string if none)."),
1523
+ id: s.string(),
1524
+ name: s.string(),
1525
+ description: s.string().describe("Empty string when none."),
1528
1526
  color: ue,
1529
- isFavorite: s.boolean().describe("Whether the project is marked as favorite."),
1530
- isShared: s.boolean().describe("Whether the project is shared."),
1531
- parentId: s.string().optional().describe("The ID of the parent project (for sub-projects)."),
1532
- inboxProject: s.boolean().describe("Whether this is the inbox project."),
1533
- viewStyle: s.string().describe("The view style of the project (list, board, calendar)."),
1534
- workspaceId: s.string().optional().describe(
1535
- "The ID of the workspace this project belongs to (undefined for personal projects)."
1536
- ),
1537
- folderId: s.string().optional().describe("The ID of the folder this project belongs to (workspace projects only)."),
1538
- childOrder: s.number().describe("The ordering index of the project among its siblings."),
1539
- isArchived: s.boolean().describe("Whether the project is archived.")
1527
+ isFavorite: s.boolean(),
1528
+ isShared: s.boolean(),
1529
+ parentId: s.string().optional(),
1530
+ inboxProject: s.boolean(),
1531
+ viewStyle: s.string().describe("list, board or calendar."),
1532
+ workspaceId: s.string().optional().describe("Undefined for personal projects."),
1533
+ folderId: s.string().optional().describe("Workspace projects only."),
1534
+ childOrder: s.number().describe("Ordering index among siblings."),
1535
+ isArchived: s.boolean()
1540
1536
  }), X = s.object({
1541
- id: s.string().describe("The unique ID of the section."),
1542
- name: s.string().describe("The name of the section."),
1543
- sectionOrder: s.number().describe("The ordering index of the section within its project."),
1544
- description: s.string().optional().describe("The description of the section. Supports Markdown.")
1537
+ id: s.string(),
1538
+ name: s.string(),
1539
+ sectionOrder: s.number().describe("Ordering index within the project."),
1540
+ description: s.string().optional().describe("Supports Markdown.")
1545
1541
  });
1546
1542
  function z({ id: e, name: t, sectionOrder: r, description: o }) {
1547
1543
  return { id: e, name: t, sectionOrder: r, description: o ?? void 0 };
1548
1544
  }
1549
1545
  const bo = s.object({
1550
- resourceType: s.string().describe("The type of resource (file, url, image, etc)."),
1551
- fileName: s.string().optional().describe("The name of the file."),
1552
- fileSize: s.number().optional().describe("The size of the file in bytes."),
1553
- fileType: s.string().optional().describe("The MIME type of the file."),
1554
- fileUrl: s.string().optional().describe("The URL to access the file."),
1555
- fileDuration: s.number().optional().describe("The duration in milliseconds (for audio/video files)."),
1556
- uploadState: s.enum(["pending", "completed"]).optional().describe("The upload state of the file."),
1557
- url: s.string().optional().describe("The URL for link/url resource types."),
1558
- title: s.string().optional().describe("The title for link/url resource types."),
1559
- image: s.string().optional().describe("The image URL for image resource types."),
1560
- imageWidth: s.number().optional().describe("The width of the image in pixels."),
1561
- imageHeight: s.number().optional().describe("The height of the image in pixels.")
1546
+ resourceType: s.string().describe("file, url, image, etc."),
1547
+ fileName: s.string().optional(),
1548
+ fileSize: s.number().optional().describe("Bytes."),
1549
+ fileType: s.string().optional().describe("MIME type."),
1550
+ fileUrl: s.string().optional(),
1551
+ fileDuration: s.number().optional().describe("Milliseconds, for audio/video."),
1552
+ uploadState: s.enum(["pending", "completed"]).optional(),
1553
+ url: s.string().optional().describe("For link/url resource types."),
1554
+ title: s.string().optional().describe("For link/url resource types."),
1555
+ image: s.string().optional().describe("For image resource types."),
1556
+ imageWidth: s.number().optional().describe("Pixels."),
1557
+ imageHeight: s.number().optional().describe("Pixels.")
1562
1558
  }), ye = s.object({
1563
- id: s.string().describe("The unique ID of the comment."),
1564
- taskId: s.string().optional().describe("The ID of the task this comment belongs to."),
1565
- projectId: s.string().optional().describe("The ID of the project this comment belongs to."),
1566
- content: s.string().describe("The content of the comment."),
1567
- postedAt: s.string().describe("When the comment was posted (ISO 8601 format)."),
1568
- postedUid: s.string().optional().describe("The UID of the user who posted this comment."),
1569
- fileAttachment: bo.optional().describe("File attachment information, if any.")
1559
+ id: s.string(),
1560
+ taskId: s.string().optional(),
1561
+ projectId: s.string().optional(),
1562
+ content: s.string(),
1563
+ postedAt: s.string().describe("ISO 8601."),
1564
+ postedUid: s.string().optional(),
1565
+ fileAttachment: bo.optional()
1570
1566
  }), go = s.object({
1571
- id: s.string().optional().describe("The unique ID of the activity event."),
1572
- objectType: s.string().describe("The type of object this event relates to (task, project, etc)."),
1573
- objectId: s.string().describe("The ID of the object this event relates to."),
1574
- eventType: s.string().describe("The type of event (added, updated, deleted, completed, etc)."),
1575
- eventDate: s.string().describe("When the event occurred (ISO 8601 format)."),
1576
- parentProjectId: s.string().optional().describe("The ID of the parent project."),
1577
- parentItemId: s.string().optional().describe("The ID of the parent item."),
1578
- initiatorId: s.string().optional().describe("The ID of the user who initiated this event."),
1579
- extraData: s.record(s.string(), s.unknown()).optional().describe("Additional event data.")
1567
+ id: s.string().optional(),
1568
+ objectType: s.string().describe("task, project, etc."),
1569
+ objectId: s.string(),
1570
+ eventType: s.string().describe("added, updated, deleted, completed, etc."),
1571
+ eventDate: s.string().describe("ISO 8601."),
1572
+ parentProjectId: s.string().optional(),
1573
+ parentItemId: s.string().optional(),
1574
+ initiatorId: s.string().optional().describe("User who initiated the event."),
1575
+ extraData: s.record(s.string(), s.unknown()).optional()
1580
1576
  }), yo = s.object({
1581
- id: s.string().describe("The unique ID of the user."),
1582
- name: s.string().describe("The full name of the user."),
1583
- email: s.string().describe("The email address of the user.")
1577
+ id: s.string(),
1578
+ name: s.string(),
1579
+ email: s.string()
1584
1580
  }), pe = s.object({
1585
- id: s.string().describe("The unique ID of the label."),
1586
- name: s.string().describe("The name of the label."),
1581
+ id: s.string(),
1582
+ name: s.string(),
1587
1583
  color: ue,
1588
- order: s.number().optional().catch(void 0).describe("The display order of the label."),
1589
- isFavorite: s.boolean().describe("Whether the label is marked as favorite.")
1590
- }), To = s.object({
1591
- isRecurring: s.boolean().describe("Whether this is a recurring reminder."),
1584
+ order: s.number().optional().catch(void 0).describe("Display order."),
1585
+ isFavorite: s.boolean()
1586
+ }), ko = s.object({
1587
+ isRecurring: s.boolean(),
1592
1588
  string: s.string().describe("Human-readable due string."),
1593
- date: s.string().describe("Due date in ISO format."),
1594
- datetime: s.string().optional().describe("Due datetime in ISO format."),
1595
- timezone: s.string().optional().describe("Timezone of the reminder.")
1589
+ date: s.string().describe("ISO 8601."),
1590
+ datetime: s.string().optional().describe("ISO 8601."),
1591
+ timezone: s.string().optional()
1596
1592
  }), st = s.object({
1597
- id: s.string().describe("The unique ID of the reminder."),
1598
- taskId: s.string().describe("The task ID this reminder belongs to."),
1599
- type: s.enum(Ms).describe("The type of reminder: relative, absolute, or location."),
1600
- minuteOffset: s.number().optional().describe("Minutes before due time to trigger (relative reminders only)."),
1601
- due: To.optional().describe(
1602
- "Due date info (absolute and sometimes relative reminders)."
1603
- ),
1604
- name: s.string().optional().describe("Location name (location reminders only)."),
1605
- locLat: s.string().optional().describe("Latitude (location reminders only)."),
1606
- locLong: s.string().optional().describe("Longitude (location reminders only)."),
1607
- locTrigger: s.enum(Mt).optional().describe("Trigger type: on_enter or on_leave (location reminders only)."),
1608
- radius: s.number().optional().describe("Geofence radius in meters (location reminders only)."),
1609
- isUrgent: s.boolean().optional().describe("Whether this is an urgent reminder (relative and absolute reminders only).")
1593
+ id: s.string(),
1594
+ taskId: s.string(),
1595
+ type: s.enum(Ms),
1596
+ minuteOffset: s.number().optional().describe("Minutes before due. Relative reminders only."),
1597
+ due: ko.optional().describe("Absolute, and sometimes relative, reminders."),
1598
+ name: s.string().optional().describe("Location name. Location reminders only."),
1599
+ locLat: s.string().optional().describe("Location reminders only."),
1600
+ locLong: s.string().optional().describe("Location reminders only."),
1601
+ locTrigger: s.enum(Mt).optional().describe("Location reminders only."),
1602
+ radius: s.number().optional().describe("Geofence radius in metres. Location reminders only."),
1603
+ isUrgent: s.boolean().optional().describe("Relative and absolute reminders only.")
1610
1604
  }), ee = s.object({
1611
- item: s.string().describe("The item that failed (usually an ID or identifier)."),
1612
- error: s.string().describe("The error message."),
1613
- code: s.string().optional().describe("The error code, if available.")
1614
- }), ko = s.object({
1605
+ item: s.string().describe("Usually the ID of the item that failed."),
1606
+ error: s.string(),
1607
+ code: s.string().optional()
1608
+ }), To = s.object({
1615
1609
  taskId: s.string().optional().describe("The ID of the task to comment on."),
1616
1610
  projectId: s.string().optional().describe(
1617
1611
  'The ID of the project to comment on. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
1618
1612
  ),
1619
1613
  content: s.string().min(1).describe("The content of the comment.")
1620
1614
  }), wo = {
1621
- comments: s.array(ko).min(1).describe("The array of comments to add.")
1615
+ comments: s.array(To).min(1).describe("The array of comments to add.")
1622
1616
  }, vo = {
1623
1617
  comments: s.array(ye).describe("The created comments."),
1624
1618
  totalCount: s.number().describe("The total number of comments created."),
@@ -1642,14 +1636,14 @@ const bo = s.object({
1642
1636
  );
1643
1637
  }
1644
1638
  const n = r.some((l) => M(l.projectId)) ? await t.getUser() : void 0, a = r.map(async ({ content: l, taskId: u, projectId: p }) => {
1645
- const h = await de({
1639
+ const m = await de({
1646
1640
  projectId: p,
1647
1641
  user: n,
1648
1642
  client: n ? void 0 : t
1649
1643
  });
1650
1644
  return await t.addComment({
1651
1645
  content: l,
1652
- ...u ? { taskId: u } : { projectId: h }
1646
+ ...u ? { taskId: u } : { projectId: m }
1653
1647
  });
1654
1648
  }), c = (await Promise.all(a)).map(ge);
1655
1649
  return {
@@ -1758,7 +1752,7 @@ const xo = s.object({
1758
1752
  outputSchema: Eo,
1759
1753
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
1760
1754
  async execute({ filters: e }, t) {
1761
- const r = Date.now(), o = e.map((p, h) => `tempFilterAdd${h}${r}`), n = e.map((p, h) => V(
1755
+ const r = Date.now(), o = e.map((p, m) => `tempFilterAdd${m}${r}`), n = e.map((p, m) => V(
1762
1756
  "filter_add",
1763
1757
  {
1764
1758
  name: p.name,
@@ -1766,9 +1760,9 @@ const xo = s.object({
1766
1760
  ...p.color !== void 0 ? { color: p.color } : {},
1767
1761
  ...p.isFavorite !== void 0 ? { isFavorite: p.isFavorite } : {}
1768
1762
  },
1769
- o[h]
1770
- )), i = (await t.sync({ commands: n })).tempIdMapping ?? {}, c = e.map((p, h) => {
1771
- const m = o[h], y = m !== void 0 ? i[m] : void 0;
1763
+ o[m]
1764
+ )), i = (await t.sync({ commands: n })).tempIdMapping ?? {}, c = e.map((p, m) => {
1765
+ const h = o[m], y = h !== void 0 ? i[h] : void 0;
1772
1766
  if (!y) return null;
1773
1767
  const f = p.color !== void 0 ? ue.parse(p.color) : void 0;
1774
1768
  return {
@@ -1889,7 +1883,7 @@ function je(e, t = 5) {
1889
1883
  }
1890
1884
  return o;
1891
1885
  }
1892
- function Y({
1886
+ function q({
1893
1887
  subject: e,
1894
1888
  count: t,
1895
1889
  limit: r,
@@ -1974,7 +1968,7 @@ ${u}` + (d.length > 5 ? `
1974
1968
  this.cache = null;
1975
1969
  }
1976
1970
  }
1977
- const is = new Bo(), qo = s.object({
1971
+ const is = new Bo(), Yo = s.object({
1978
1972
  name: s.string().min(1).describe("The name of the project."),
1979
1973
  parentId: s.string().optional().describe("The ID of the parent project. If provided, creates this as a sub-project."),
1980
1974
  isFavorite: s.boolean().optional().describe("Whether the project is a favorite. Defaults to false."),
@@ -1985,8 +1979,8 @@ const is = new Bo(), qo = s.object({
1985
1979
  "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."
1986
1980
  )
1987
1981
  }), zo = {
1988
- projects: s.array(qo).min(1).describe("The array of projects to add.")
1989
- }, Yo = {
1982
+ projects: s.array(Yo).min(1).describe("The array of projects to add.")
1983
+ }, qo = {
1990
1984
  projects: s.array(Q).describe("The created projects."),
1991
1985
  totalCount: s.number().describe("The total number of projects created."),
1992
1986
  failures: s.array(ee).describe(
@@ -1999,7 +1993,7 @@ const is = new Bo(), qo = s.object({
1999
1993
  name: g.ADD_PROJECTS,
2000
1994
  description: "Add one or more new projects.",
2001
1995
  parameters: zo,
2002
- outputSchema: Yo,
1996
+ outputSchema: qo,
2003
1997
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
2004
1998
  async execute({ projects: e }, t) {
2005
1999
  const r = /* @__PURE__ */ new Map(), o = (l) => {
@@ -2020,7 +2014,7 @@ const is = new Bo(), qo = s.object({
2020
2014
  n.forEach((l, u) => {
2021
2015
  l.status === "fulfilled" ? a.push(l.value) : i.push({
2022
2016
  item: e[u]?.name ?? `Project ${u + 1}`,
2023
- error: q(l.reason)
2017
+ error: Y(l.reason)
2024
2018
  });
2025
2019
  });
2026
2020
  const c = a.map(Z);
@@ -2186,7 +2180,7 @@ const rn = s.object({
2186
2180
  return o.forEach((c, d) => {
2187
2181
  c.status === "fulfilled" ? n.push(c.value) : a.push({
2188
2182
  item: e[d]?.name ?? `Section ${d + 1}`,
2189
- error: q(c.reason)
2183
+ error: Y(c.reason)
2190
2184
  });
2191
2185
  }), {
2192
2186
  textContent: cn({ sections: n, failures: a }),
@@ -2400,15 +2394,15 @@ class dn {
2400
2394
  const u = await W.resolveUser(t, o);
2401
2395
  if (!u)
2402
2396
  return a.push("User not found - check spelling or invite to a shared project"), { canAssign: !1, projectInfo: l, recommendations: a };
2403
- const p = d.some((y) => y.id === u.userId), h = {
2397
+ const p = d.some((y) => y.id === u.userId), m = {
2404
2398
  resolvedName: u.displayName,
2405
2399
  isCollaborator: p
2406
2400
  };
2407
2401
  if (!p)
2408
2402
  return a.push(
2409
2403
  `Invite ${u.displayName} to collaborate on project "${c.name}"`
2410
- ), { canAssign: !1, projectInfo: l, userInfo: h, recommendations: a };
2411
- let m;
2404
+ ), { canAssign: !1, projectInfo: l, userInfo: m, recommendations: a };
2405
+ let h;
2412
2406
  if (n && n.length > 0) {
2413
2407
  let y = 0, f = 0;
2414
2408
  for (const v of n)
@@ -2417,13 +2411,13 @@ class dn {
2417
2411
  } catch {
2418
2412
  f++;
2419
2413
  }
2420
- m = { accessibleTasks: y, inaccessibleTasks: f }, f > 0 && a.push(`${f} task(s) are not accessible`);
2414
+ h = { accessibleTasks: y, inaccessibleTasks: f }, f > 0 && a.push(`${f} task(s) are not accessible`);
2421
2415
  }
2422
2416
  return i = !0, a.push(`Ready to assign tasks to ${u.displayName}`), {
2423
2417
  canAssign: i,
2424
2418
  projectInfo: l,
2425
- userInfo: h,
2426
- taskInfo: m,
2419
+ userInfo: m,
2420
+ taskInfo: h,
2427
2421
  recommendations: a
2428
2422
  };
2429
2423
  }
@@ -2432,7 +2426,7 @@ const it = new dn();
2432
2426
  function U(e) {
2433
2427
  return s.string().transform((t) => t === "" ? void 0 : t).optional().describe(e);
2434
2428
  }
2435
- const Tt = zt.TASKS_PER_OPERATION, ln = s.object({
2429
+ const kt = zt.TASKS_PER_OPERATION, ln = s.object({
2436
2430
  content: s.string().min(1).describe(
2437
2431
  '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.'
2438
2432
  ),
@@ -2462,8 +2456,8 @@ const Tt = zt.TASKS_PER_OPERATION, ln = s.object({
2462
2456
  isUncompletable: s.boolean().optional().describe(
2463
2457
  "Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
2464
2458
  )
2465
- }), kt = {
2466
- tasks: s.array(ln).min(1).max(Tt).describe(`The array of tasks to add (max ${Tt}).`)
2459
+ }), Tt = {
2460
+ tasks: s.array(ln).min(1).max(kt).describe(`The array of tasks to add (max ${kt}).`)
2467
2461
  }, un = {
2468
2462
  tasks: s.array(F).describe("The created tasks."),
2469
2463
  totalCount: s.number().describe("The total number of tasks created."),
@@ -2474,43 +2468,43 @@ const Tt = zt.TASKS_PER_OPERATION, ln = s.object({
2474
2468
  }, pn = {
2475
2469
  name: g.ADD_TASKS,
2476
2470
  description: "Add one or more tasks to a project, section, or parent. Supports assignment to project collaborators.",
2477
- parameters: kt,
2471
+ parameters: Tt,
2478
2472
  outputSchema: un,
2479
2473
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
2480
2474
  async execute(e, t) {
2481
- const { tasks: r } = s.object(kt).parse(e), o = /* @__PURE__ */ new Map();
2482
- r.forEach((h, m) => {
2483
- const y = hn(h), f = o.get(y);
2484
- f ? f.push({ task: h, index: m }) : o.set(y, [{ task: h, index: m }]);
2475
+ const { tasks: r } = s.object(Tt).parse(e), o = /* @__PURE__ */ new Map();
2476
+ r.forEach((m, h) => {
2477
+ const y = mn(m), f = o.get(y);
2478
+ f ? f.push({ task: m, index: h }) : o.set(y, [{ task: m, index: h }]);
2485
2479
  });
2486
2480
  const n = /* @__PURE__ */ new Map(), i = (await Promise.all(
2487
- [...o.values()].map(async (h) => {
2488
- const m = [];
2489
- for (const { task: y, index: f } of h)
2481
+ [...o.values()].map(async (m) => {
2482
+ const h = [];
2483
+ for (const { task: y, index: f } of m)
2490
2484
  try {
2491
- const v = await mn(y, t, n);
2492
- m.push({ index: f, result: { status: "fulfilled", value: v } });
2485
+ const v = await hn(y, t, n);
2486
+ h.push({ index: f, result: { status: "fulfilled", value: v } });
2493
2487
  } catch (v) {
2494
- m.push({
2488
+ h.push({
2495
2489
  index: f,
2496
2490
  result: { status: "rejected", reason: v }
2497
2491
  });
2498
2492
  }
2499
- return m;
2493
+ return h;
2500
2494
  })
2501
- )).flat().sort((h, m) => h.index - m.index), c = [], d = [];
2495
+ )).flat().sort((m, h) => m.index - h.index), c = [], d = [];
2502
2496
  let l = !1;
2503
- for (const { index: h, result: m } of i)
2504
- m.status === "fulfilled" ? c.push(m.value) : (l ||= m.reason instanceof ve, d.push({
2505
- item: r[h]?.content ?? `Task ${h + 1}`,
2497
+ for (const { index: m, result: h } of i)
2498
+ h.status === "fulfilled" ? c.push(h.value) : (l ||= h.reason instanceof ve, d.push({
2499
+ item: r[m]?.content ?? `Task ${m + 1}`,
2506
2500
  // Keep API error signals (status/code/tag) — `error.message`
2507
2501
  // alone collapses e.g. a full-project rejection into a bare
2508
2502
  // "HTTP 403: Forbidden"
2509
- error: q(m.reason)
2503
+ error: Y(h.reason)
2510
2504
  }));
2511
2505
  if (c.length === 0 && d.length > 0) {
2512
- const h = d.map((y) => `"${y.item}": ${y.error}`).join("; "), m = `All ${d.length} task(s) failed to create: ${h}`;
2513
- throw l ? new qt(m) : new Error(m);
2506
+ const m = d.map((y) => `"${y.item}": ${y.error}`).join("; "), h = `All ${d.length} task(s) failed to create: ${m}`;
2507
+ throw l ? new Yt(h) : new Error(h);
2514
2508
  }
2515
2509
  const u = c.map(P);
2516
2510
  return {
@@ -2530,10 +2524,10 @@ const Tt = zt.TASKS_PER_OPERATION, ln = s.object({
2530
2524
  };
2531
2525
  }
2532
2526
  };
2533
- function hn(e) {
2527
+ function mn(e) {
2534
2528
  return `${e.projectId ?? ""}|${e.sectionId ?? ""}|${e.parentId ?? ""}`;
2535
2529
  }
2536
- async function mn(e, t, r) {
2530
+ async function hn(e, t, r) {
2537
2531
  const {
2538
2532
  duration: o,
2539
2533
  projectId: n,
@@ -2544,25 +2538,25 @@ async function mn(e, t, r) {
2544
2538
  priority: l,
2545
2539
  labels: u,
2546
2540
  deadlineDate: p,
2547
- ...h
2548
- } = e, m = M(n) ? void 0 : n;
2549
- if (m) {
2550
- const f = await t.getProject(m);
2541
+ ...m
2542
+ } = e, h = M(n) ? void 0 : n;
2543
+ if (h) {
2544
+ const f = await t.getProject(h);
2551
2545
  if (f.isArchived)
2552
2546
  throw new Error(
2553
2547
  `Task "${e.content}": Cannot create task in archived project "${f.name}"`
2554
2548
  );
2555
2549
  }
2556
2550
  let y = {
2557
- ...h,
2558
- projectId: m,
2551
+ ...m,
2552
+ projectId: h,
2559
2553
  sectionId: a,
2560
2554
  parentId: i,
2561
2555
  order: c,
2562
2556
  labels: u,
2563
2557
  deadlineDate: p
2564
2558
  };
2565
- if (l && (y.priority = Zt(l)), d && !m && !a && !i)
2559
+ if (l && (y.priority = Zt(l)), d && !h && !a && !i)
2566
2560
  throw new Error(
2567
2561
  `Task "${e.content}": Cannot assign tasks without specifying project context. Please specify a projectId, sectionId, or parentId.`
2568
2562
  );
@@ -2578,7 +2572,7 @@ async function mn(e, t, r) {
2578
2572
  throw f instanceof R ? new Error(`Task "${e.content}": ${f.message}`) : f;
2579
2573
  }
2580
2574
  if (d) {
2581
- let f = m;
2575
+ let f = h;
2582
2576
  if (!f && i)
2583
2577
  try {
2584
2578
  f = (await t.getTask(i)).projectId;
@@ -2683,9 +2677,9 @@ ${n}`,
2683
2677
  }
2684
2678
  };
2685
2679
  }
2686
- }, Tn = {
2687
- ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to complete.")
2688
2680
  }, kn = {
2681
+ ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to complete.")
2682
+ }, Tn = {
2689
2683
  completed: s.array(s.string()).describe("The IDs of successfully completed tasks."),
2690
2684
  failures: s.array(ee).describe("Failed task completions with error details."),
2691
2685
  totalRequested: s.number().describe("The total number of tasks requested to complete."),
@@ -2694,8 +2688,8 @@ ${n}`,
2694
2688
  }, wn = {
2695
2689
  name: g.COMPLETE_TASKS,
2696
2690
  description: "Complete one or more tasks by their IDs.",
2697
- parameters: Tn,
2698
- outputSchema: kn,
2691
+ parameters: kn,
2692
+ outputSchema: Tn,
2699
2693
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
2700
2694
  async execute(e, t) {
2701
2695
  const r = [], o = [];
@@ -2766,7 +2760,7 @@ const ls = [
2766
2760
  switch (e.type) {
2767
2761
  case "project": {
2768
2762
  const r = await t.getProject(e.id);
2769
- if (ke(r) && !r.isArchived)
2763
+ if (Te(r) && !r.isArchived)
2770
2764
  throw new Error(
2771
2765
  `Workspace project "${r.name}" must be archived before it can be deleted. Archive the project first, then delete it.`
2772
2766
  );
@@ -3127,11 +3121,11 @@ const Wn = {
3127
3121
  cursor: s.string().optional().describe("Pagination cursor for retrieving the next page of results.")
3128
3122
  }, Bn = {
3129
3123
  events: s.array(go).describe("The activity events."),
3130
- nextCursor: s.string().optional().describe("Cursor for the next page of results."),
3124
+ nextCursor: s.string().optional(),
3131
3125
  totalCount: s.number().describe("The total number of events in this page."),
3132
- hasMore: s.boolean().describe("Whether there are more results available."),
3133
- appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
3134
- }, qn = {
3126
+ hasMore: s.boolean(),
3127
+ appliedFilters: s.record(s.string(), s.unknown())
3128
+ }, Yn = {
3135
3129
  name: g.FIND_ACTIVITY,
3136
3130
  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.',
3137
3131
  parameters: Wn,
@@ -3149,12 +3143,12 @@ const Wn = {
3149
3143
  dateTo: l,
3150
3144
  limit: u,
3151
3145
  cursor: p
3152
- } = e, h = {
3146
+ } = e, m = {
3153
3147
  limit: u,
3154
3148
  cursor: p ?? null
3155
3149
  };
3156
- 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), d && (h.dateFrom = d), l && (h.dateTo = l);
3157
- const { results: m, nextCursor: y } = await t.getActivityLogs(h), f = m.map(po);
3150
+ r && n ? m.objectEventTypes = `${r}:${n}` : r ? m.objectEventTypes = `${r}:` : n && (m.objectEventTypes = `:${n}`), o && o !== "remove" && (m.objectId = o), a && (m.parentProjectId = a), i && (m.parentItemId = i), c && (m.initiatorId = c), d && (m.dateFrom = d), l && (m.dateTo = l);
3151
+ const { results: h, nextCursor: y } = await t.getActivityLogs(m), f = h.map(po);
3158
3152
  return {
3159
3153
  textContent: zn({ events: f, args: e, nextCursor: y }),
3160
3154
  structuredContent: {
@@ -3182,17 +3176,17 @@ function zn({
3182
3176
  const a = [];
3183
3177
  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}`);
3184
3178
  const i = [];
3185
- 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")), Y({
3179
+ 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")), q({
3186
3180
  subject: o,
3187
3181
  count: e.length,
3188
3182
  limit: t.limit,
3189
3183
  nextCursor: r ?? void 0,
3190
3184
  filterHints: a,
3191
- previewLines: Yn(e, Math.min(e.length, t.limit)),
3185
+ previewLines: qn(e, Math.min(e.length, t.limit)),
3192
3186
  zeroReasonHints: i
3193
3187
  });
3194
3188
  }
3195
- function Yn(e, t = 10) {
3189
+ function qn(e, t = 10) {
3196
3190
  const o = e.slice(0, t).map(Gn).join(`
3197
3191
  `);
3198
3192
  if (e.length > t) {
@@ -3239,8 +3233,8 @@ const Vn = {
3239
3233
  'The type of search performed: "single" (comment ID), "task" (task ID), or "project" (project ID).'
3240
3234
  ),
3241
3235
  searchId: s.string().describe("The ID that was searched for (comment, task, or project ID)."),
3242
- hasMore: s.boolean().describe("Whether there are more results available."),
3243
- nextCursor: s.string().optional().describe("Cursor for the next page of results."),
3236
+ hasMore: s.boolean(),
3237
+ nextCursor: s.string().optional(),
3244
3238
  totalCount: s.number().describe("The total number of comments in this page.")
3245
3239
  }, Xn = {
3246
3240
  name: g.FIND_COMMENTS,
@@ -3325,7 +3319,7 @@ ${i}`;
3325
3319
  }
3326
3320
  return a;
3327
3321
  }
3328
- function hs(e) {
3322
+ function ms(e) {
3329
3323
  const t = e.getUTCFullYear(), r = String(e.getUTCMonth() + 1).padStart(2, "0"), o = String(e.getUTCDate()).padStart(2, "0");
3330
3324
  return `${t}-${r}-${o}`;
3331
3325
  }
@@ -3338,14 +3332,14 @@ function Qn(e) {
3338
3332
  }
3339
3333
  function ea(e, t) {
3340
3334
  const r = new Date(e.getTime() + t * 60 * 1e3);
3341
- return hs(r);
3335
+ return ms(r);
3342
3336
  }
3343
3337
  function St(e, t) {
3344
3338
  const [r, o, n] = e.split("-"), a = Number(r), i = Number(o), c = Number(n);
3345
3339
  if (!Number.isFinite(a) || !Number.isFinite(i) || !Number.isFinite(c))
3346
3340
  throw new Error(`Invalid date format: ${e}. Expected YYYY-MM-DD.`);
3347
3341
  const d = new Date(Date.UTC(a, i - 1, c));
3348
- return d.setUTCDate(d.getUTCDate() + t), hs(d);
3342
+ return d.setUTCDate(d.getUTCDate() + t), ms(d);
3349
3343
  }
3350
3344
  const ta = ["and", "or"], ct = {
3351
3345
  labels: s.string().array().optional().describe("The labels to filter the tasks by"),
@@ -3397,10 +3391,10 @@ const oa = {
3397
3391
  ...ct
3398
3392
  }, na = {
3399
3393
  tasks: s.array(F).describe("The found completed tasks."),
3400
- nextCursor: s.string().optional().describe("Cursor for the next page of results."),
3394
+ nextCursor: s.string().optional(),
3401
3395
  totalCount: s.number().describe("The total number of tasks in this page."),
3402
- hasMore: s.boolean().describe("Whether there are more results available."),
3403
- appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
3396
+ hasMore: s.boolean(),
3397
+ appliedFilters: s.record(s.string(), s.unknown())
3404
3398
  }, aa = {
3405
3399
  name: g.FIND_COMPLETED_TASKS,
3406
3400
  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.",
@@ -3414,8 +3408,8 @@ const oa = {
3414
3408
  "Cursor pagination requires explicit since and until. Reuse structuredContent.appliedFilters.since and structuredContent.appliedFilters.until from the previous page."
3415
3409
  );
3416
3410
  const u = await Qe(t, c), p = u?.email;
3417
- let m = dt(o, n);
3418
- u && p && (m = ce(m, `assigned to: ${p}`));
3411
+ let h = dt(o, n);
3412
+ u && p && (h = ce(h, `assigned to: ${p}`));
3419
3413
  const y = await t.getUser(), f = y.tzInfo?.gmtString || "+00:00", v = await de({
3420
3414
  projectId: d,
3421
3415
  user: y
@@ -3423,7 +3417,7 @@ const oa = {
3423
3417
  since: a,
3424
3418
  until: i,
3425
3419
  userGmtOffset: f
3426
- }), A = `${S.since}T00:00:00${f}`, k = `${S.until}T23:59:59${f}`, I = new Date(A).toISOString(), x = new Date(k).toISOString(), T = {
3420
+ }), A = `${S.since}T00:00:00${f}`, T = `${S.until}T23:59:59${f}`, I = new Date(A).toISOString(), x = new Date(T).toISOString(), k = {
3427
3421
  ...e,
3428
3422
  since: S.since,
3429
3423
  until: S.until
@@ -3432,18 +3426,18 @@ const oa = {
3432
3426
  projectId: v,
3433
3427
  since: I,
3434
3428
  until: x,
3435
- ...m ? { filterQuery: m, filterLang: "en" } : {}
3429
+ ...h ? { filterQuery: h, filterLang: "en" } : {}
3436
3430
  }) : await t.getCompletedTasksByDueDate({
3437
3431
  ...l,
3438
3432
  projectId: v,
3439
3433
  since: I,
3440
3434
  until: x,
3441
- ...m ? { filterQuery: m, filterLang: "en" } : {}
3435
+ ...h ? { filterQuery: h, filterLang: "en" } : {}
3442
3436
  }), $ = b.map(P);
3443
3437
  return {
3444
3438
  textContent: ia({
3445
3439
  tasks: $,
3446
- args: T,
3440
+ args: k,
3447
3441
  nextCursor: j,
3448
3442
  assigneeEmail: p
3449
3443
  }),
@@ -3452,7 +3446,7 @@ const oa = {
3452
3446
  nextCursor: j ?? void 0,
3453
3447
  totalCount: $.length,
3454
3448
  hasMore: !!j,
3455
- appliedFilters: T
3449
+ appliedFilters: k
3456
3450
  }
3457
3451
  };
3458
3452
  }
@@ -3473,7 +3467,7 @@ function ia({
3473
3467
  i.push(`assigned to: ${d}`);
3474
3468
  }
3475
3469
  const c = [];
3476
- return e.length === 0 && (c.push("No tasks completed in this date range"), c.push("Try expanding the date range"), (t.projectId || t.sectionId || t.parentId) && c.push("Try removing project/section/parent filters"), t.getBy === "due" && c.push('Try switching to "completion" date instead')), Y({
3470
+ return e.length === 0 && (c.push("No tasks completed in this date range"), c.push("Try expanding the date range"), (t.projectId || t.sectionId || t.parentId) && c.push("Try removing project/section/parent filters"), t.getBy === "due" && c.push('Try switching to "completion" date instead')), q({
3477
3471
  subject: a,
3478
3472
  count: e.length,
3479
3473
  limit: t.limit,
@@ -3493,13 +3487,13 @@ const ca = {
3493
3487
  )
3494
3488
  }, da = {
3495
3489
  labels: s.array(pe).describe("The found personal labels."),
3496
- nextCursor: s.string().optional().describe("Cursor for the next page of results."),
3490
+ nextCursor: s.string().optional(),
3497
3491
  totalCount: s.number().describe("The total number of labels in this page."),
3498
- hasMore: s.boolean().describe("Whether there are more results available."),
3492
+ hasMore: s.boolean(),
3499
3493
  sharedLabels: s.array(s.string()).describe(
3500
3494
  "Names of all shared labels visible to you. These have no IDs or metadata — use their names directly when filtering tasks."
3501
3495
  ),
3502
- appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
3496
+ appliedFilters: s.record(s.string(), s.unknown())
3503
3497
  }, la = {
3504
3498
  name: g.FIND_LABELS,
3505
3499
  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.",
@@ -3539,10 +3533,10 @@ function ua({
3539
3533
  `), l = e.length - i, u = l > 0 ? `${d}
3540
3534
  …and ${l} more` : d, p = [];
3541
3535
  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"));
3542
- const h = o.length > 0 ? `
3536
+ const m = o.length > 0 ? `
3543
3537
  Shared labels (${o.length}): ${o.join(", ")}` : `
3544
3538
  No shared labels.`;
3545
- return Y({
3539
+ return q({
3546
3540
  subject: n,
3547
3541
  count: e.length,
3548
3542
  limit: t.searchText ? void 0 : t.limit,
@@ -3550,16 +3544,16 @@ No shared labels.`;
3550
3544
  filterHints: a,
3551
3545
  previewLines: u,
3552
3546
  zeroReasonHints: p
3553
- }) + h;
3547
+ }) + m;
3554
3548
  }
3555
- const { FIND_PROJECTS: ms, ADD_TASKS: fs, UPDATE_TASKS: bs } = g, pa = {
3549
+ const { FIND_PROJECTS: hs, ADD_TASKS: fs, UPDATE_TASKS: bs } = g, pa = {
3556
3550
  projectId: s.string().min(1).optional().describe(
3557
3551
  '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.'
3558
3552
  ),
3559
3553
  searchTerm: s.string().optional().describe(
3560
3554
  "Search for a user by name or email (partial and case insensitive match). If omitted, all users are returned."
3561
3555
  )
3562
- }, ha = {
3556
+ }, ma = {
3563
3557
  collaborators: s.array(yo).describe("The found users."),
3564
3558
  projectInfo: s.object({
3565
3559
  id: s.string().describe("The project ID."),
@@ -3568,12 +3562,12 @@ const { FIND_PROJECTS: ms, ADD_TASKS: fs, UPDATE_TASKS: bs } = g, pa = {
3568
3562
  }).optional().describe("Information about the project (only present when projectId was provided)."),
3569
3563
  totalCount: s.number().describe("The total number of users found."),
3570
3564
  totalAvailable: s.number().optional().describe("The total number of available users before the search filter was applied."),
3571
- appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
3572
- }, ma = {
3565
+ appliedFilters: s.record(s.string(), s.unknown())
3566
+ }, ha = {
3573
3567
  name: g.FIND_PROJECT_COLLABORATORS,
3574
3568
  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.`,
3575
3569
  parameters: pa,
3576
- outputSchema: ha,
3570
+ outputSchema: ma,
3577
3571
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3578
3572
  async execute(e, t) {
3579
3573
  const { projectId: r, searchTerm: o } = e;
@@ -3659,7 +3653,7 @@ async function fa({
3659
3653
  textContent: `No users found. You may have no shared projects, or collaborator data is not accessible.
3660
3654
 
3661
3655
  **Next steps:**
3662
- • Use ${ms} to find shared projects
3656
+ • Use ${hs} to find shared projects
3663
3657
  • Share a project to add collaborators
3664
3658
  • Ensure you have permission to view collaborators`,
3665
3659
  structuredContent: {
@@ -3716,13 +3710,13 @@ function ys({
3716
3710
  r && c.push(`matching "${r}"`), c.push(`in ${n}`);
3717
3711
  let d = [];
3718
3712
  e.length > 0 && (d = e.slice(0, 10).map((p) => {
3719
- const h = p.name || "Unknown Name", m = p.email || "No email";
3720
- return `• ${h} (${m}) - ID: ${p.id}`;
3713
+ const m = p.name || "Unknown Name", h = p.email || "No email";
3714
+ return `• ${m} (${h}) - ID: ${p.id}`;
3721
3715
  }), e.length > 10 && d.push(`... and ${e.length - 10} more`));
3722
3716
  const l = [];
3723
3717
  e.length === 0 && r && (l.push(`No users match "${r}"`), l.push("Try a broader search term or check spelling"), o > 0 && l.push(`${o} users available without filter`));
3724
3718
  const u = [];
3725
- return e.length > 0 ? (u.push(`Use ${fs} with responsibleUser to assign new tasks`), u.push(`Use ${bs} with responsibleUser to reassign existing tasks`), u.push("Use user names, emails, or IDs for assignments")) : (u.push(`Use ${ms} to find other projects`), r && o > 0 && u.push("Try searching without filters to see all users")), Y({
3719
+ return e.length > 0 ? (u.push(`Use ${fs} with responsibleUser to assign new tasks`), u.push(`Use ${bs} with responsibleUser to reassign existing tasks`), u.push("Use user names, emails, or IDs for assignments")) : (u.push(`Use ${hs} to find other projects`), r && o > 0 && u.push("Try searching without filters to see all users")), q({
3726
3720
  subject: i,
3727
3721
  count: e.length,
3728
3722
  filterHints: c,
@@ -3747,17 +3741,17 @@ const { ADD_PROJECTS: Ct } = g, ga = {
3747
3741
  archivedStatus: s.enum(["active", "archived", "all"]).optional().describe(
3748
3742
  "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')."
3749
3743
  )
3750
- }, Ta = {
3744
+ }, ka = {
3751
3745
  projects: s.array(Q).describe("The found projects."),
3752
- nextCursor: s.string().optional().describe("Cursor for the next page of results."),
3746
+ nextCursor: s.string().optional(),
3753
3747
  totalCount: s.number().describe("The total number of projects in this page."),
3754
- hasMore: s.boolean().describe("Whether there are more results available."),
3755
- appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
3756
- }, ka = {
3748
+ hasMore: s.boolean(),
3749
+ appliedFilters: s.record(s.string(), s.unknown())
3750
+ }, Ta = {
3757
3751
  name: g.FIND_PROJECTS,
3758
3752
  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.",
3759
3753
  parameters: ya,
3760
- outputSchema: Ta,
3754
+ outputSchema: ka,
3761
3755
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
3762
3756
  async execute(e, t) {
3763
3757
  const { searchText: r } = e, o = e.archivedStatus ?? "active";
@@ -3766,7 +3760,7 @@ const { ADD_PROJECTS: Ct } = g, ga = {
3766
3760
  const c = Promise.resolve([]), [d, l] = await Promise.all([
3767
3761
  o === "archived" ? c : r ? rs(t, r) : os(t),
3768
3762
  o === "active" ? c : ao(t)
3769
- ]), u = r ? io(r) : null, p = u ? l.filter((h) => u.test(h.name)) : l;
3763
+ ]), u = r ? io(r) : null, p = u ? l.filter((m) => u.test(m.name)) : l;
3770
3764
  n = [...d, ...p];
3771
3765
  } else {
3772
3766
  const c = o === "archived" ? await t.getArchivedProjects({
@@ -3798,7 +3792,7 @@ function wa({
3798
3792
  const i = 10, d = e.slice(0, i).map(Fo).join(`
3799
3793
  `), l = e.length - i, u = l > 0 ? `${d}
3800
3794
  …and ${l} more` : d, p = [];
3801
- 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`))), Y({
3795
+ 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`))), q({
3802
3796
  subject: n,
3803
3797
  count: e.length,
3804
3798
  limit: t.searchText || t.archivedStatus === "all" ? void 0 : t.limit,
@@ -3905,7 +3899,7 @@ const { ADD_SECTIONS: Ca } = g, $a = {
3905
3899
  }, Da = {
3906
3900
  sections: s.array(X).describe("The found sections."),
3907
3901
  totalCount: s.number().describe("The total number of sections found."),
3908
- appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
3902
+ appliedFilters: s.record(s.string(), s.unknown())
3909
3903
  }, xa = {
3910
3904
  name: g.FIND_SECTIONS,
3911
3905
  description: "Search for sections by name or other criteria in a project. When searching, uses server-side search to avoid fetching all sections.",
@@ -3945,14 +3939,14 @@ function Aa({
3945
3939
  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 ${Ca} to create sections`));
3946
3940
  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(`
3947
3941
  `) : void 0;
3948
- return Y({
3942
+ return q({
3949
3943
  subject: n,
3950
3944
  count: e.length,
3951
3945
  previewLines: a,
3952
3946
  zeroReasonHints: o
3953
3947
  });
3954
3948
  }
3955
- function Ts(e) {
3949
+ function ks(e) {
3956
3950
  return /* @__PURE__ */ new Date(`${e}T00:00:00`);
3957
3951
  }
3958
3952
  const Ea = {
@@ -3976,10 +3970,10 @@ const Ea = {
3976
3970
  ...ct
3977
3971
  }, Oa = {
3978
3972
  tasks: s.array(F).describe("The found tasks."),
3979
- nextCursor: s.string().optional().describe("Cursor for the next page of results."),
3973
+ nextCursor: s.string().optional(),
3980
3974
  totalCount: s.number().describe("The total number of tasks in this page."),
3981
- hasMore: s.boolean().describe("Whether there are more results available."),
3982
- appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
3975
+ hasMore: s.boolean(),
3976
+ appliedFilters: s.record(s.string(), s.unknown())
3983
3977
  }, Pa = {
3984
3978
  name: g.FIND_TASKS_BY_DATE,
3985
3979
  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.",
@@ -3997,13 +3991,13 @@ const Ea = {
3997
3991
  a = "overdue";
3998
3992
  else if (e.startDate === "today")
3999
3993
  if (e.daysCount > 1) {
4000
- const p = /* @__PURE__ */ new Date(), h = ie(p), m = Ue(p, e.daysCount), y = lt(m, { representation: "date" }), f = `(due after: ${h} | due: ${h}) & due before: ${y}`;
3994
+ const p = /* @__PURE__ */ new Date(), m = ie(p), h = Ue(p, e.daysCount), y = lt(h, { representation: "date" }), f = `(due after: ${m} | due: ${m}) & due before: ${y}`;
4001
3995
  a = e.overdueOption === "exclude-overdue" ? f : `(${f} | overdue)`;
4002
3996
  } else
4003
3997
  a = e.overdueOption === "exclude-overdue" ? "today" : "(today | overdue)";
4004
3998
  else if (e.startDate) {
4005
- const p = e.startDate, h = Ue(Ts(p), e.daysCount), m = lt(h, { representation: "date" });
4006
- a = `(due after: ${p} | due: ${p}) & due before: ${m}`;
3999
+ const p = e.startDate, m = Ue(ks(p), e.daysCount), h = lt(m, { representation: "date" });
4000
+ a = `(due after: ${p} | due: ${p}) & due before: ${h}`;
4007
4001
  }
4008
4002
  const i = dt(e.labels, e.labelsOperator);
4009
4003
  i.length > 0 && (a = ce(a, `(${i})`));
@@ -4046,7 +4040,7 @@ function Ra({
4046
4040
  `today${c}${t.daysCount > 1 ? ` + ${t.daysCount - 1} more days` : ""}`
4047
4041
  );
4048
4042
  } else if (t.startDate) {
4049
- const c = t.daysCount > 1 ? ` to ${ie(Ue(Ts(t.startDate), t.daysCount))}` : "";
4043
+ const c = t.daysCount > 1 ? ` to ${ie(Ue(ks(t.startDate), t.daysCount))}` : "";
4050
4044
  n.push(`${t.startDate}${c}`);
4051
4045
  }
4052
4046
  if (t.labels && t.labels.length > 0) {
@@ -4071,7 +4065,7 @@ function Ra({
4071
4065
  i.push(`Great job! No tasks for today${c}`);
4072
4066
  } else
4073
4067
  i.push("Expand date range with larger 'daysCount'"), i.push("Check today's tasks with startDate='today'");
4074
- return Y({
4068
+ return q({
4075
4069
  subject: a,
4076
4070
  count: e.length,
4077
4071
  limit: t.limit,
@@ -4168,10 +4162,10 @@ const La = new Ua(), { FIND_COMPLETED_TASKS: $t, ADD_TASKS: Dt } = g, Ma = {
4168
4162
  ...ct
4169
4163
  }, Na = {
4170
4164
  tasks: s.array(F).describe("The found tasks."),
4171
- nextCursor: s.string().optional().describe("Cursor for the next page of results."),
4165
+ nextCursor: s.string().optional(),
4172
4166
  totalCount: s.number().describe("The total number of tasks in this page."),
4173
- hasMore: s.boolean().describe("Whether there are more results available."),
4174
- appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
4167
+ hasMore: s.boolean(),
4168
+ appliedFilters: s.record(s.string(), s.unknown())
4175
4169
  }, Fa = {
4176
4170
  name: g.FIND_TASKS,
4177
4171
  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.",
@@ -4190,31 +4184,31 @@ const La = new Ua(), { FIND_COMPLETED_TASKS: $t, ADD_TASKS: Dt } = g, Ma = {
4190
4184
  cursor: l,
4191
4185
  labels: u,
4192
4186
  labelsOperator: p,
4193
- filter: h,
4194
- filterIdOrName: m
4187
+ filter: m,
4188
+ filterIdOrName: h
4195
4189
  } = e, y = await t.getUser(), f = u && u.length > 0;
4196
- if (!r && !o && !n && !a && !i && !f && !h && !m)
4190
+ if (!r && !o && !n && !a && !i && !f && !m && !h)
4197
4191
  throw new Error(
4198
4192
  "At least one filter must be provided: searchText, projectId, sectionId, parentId, responsibleUser, labels, filter, or filterIdOrName"
4199
4193
  );
4200
- if (h && m)
4194
+ if (m && h)
4201
4195
  throw new Error(
4202
4196
  "The `filter` and `filterIdOrName` parameters cannot be used together. Provide only one."
4203
4197
  );
4204
- if ((h || m) && (o || n || a))
4198
+ if ((m || h) && (o || n || a))
4205
4199
  throw new Error(
4206
4200
  'The `filter`/`filterIdOrName` parameter cannot be combined with projectId, sectionId, or parentId. Use filter syntax instead (e.g. "##ProjectName").'
4207
4201
  );
4208
- let v = h;
4209
- m && (v = (await La.resolveFilter(t, m)).filterQuery);
4210
- const S = await Qe(t, i), A = S?.userId, k = S?.email;
4202
+ let v = m;
4203
+ h && (v = (await La.resolveFilter(t, h)).filterQuery);
4204
+ const S = await Qe(t, i), A = S?.userId, T = S?.email;
4211
4205
  if (o || n || a) {
4212
4206
  const D = {
4213
4207
  limit: d,
4214
4208
  cursor: l ?? null
4215
4209
  };
4216
4210
  o && (D.projectId = await de({ projectId: o, user: y })), n && (D.sectionId = n), a && (D.parentId = a);
4217
- const { results: he, nextCursor: G } = await t.getTasks(D), $e = he.map(P);
4211
+ const { results: me, nextCursor: G } = await t.getTasks(D), $e = me.map(P);
4218
4212
  let H = r ? $e.filter(
4219
4213
  (te) => te.content.toLowerCase().includes(r.toLowerCase()) || te.description?.toLowerCase().includes(r.toLowerCase())
4220
4214
  ) : $e;
@@ -4233,7 +4227,7 @@ const La = new Ua(), { FIND_COMPLETED_TASKS: $t, ADD_TASKS: Dt } = g, Ma = {
4233
4227
  args: e,
4234
4228
  nextCursor: G,
4235
4229
  isContainerSearch: !0,
4236
- assigneeEmail: k
4230
+ assigneeEmail: T
4237
4231
  }),
4238
4232
  structuredContent: {
4239
4233
  tasks: H,
@@ -4245,8 +4239,8 @@ const La = new Ua(), { FIND_COMPLETED_TASKS: $t, ADD_TASKS: Dt } = g, Ma = {
4245
4239
  };
4246
4240
  }
4247
4241
  if (A && !r && !f && !v) {
4248
- const { results: D, nextCursor: he } = await t.getTasksByFilter({
4249
- query: `assigned to: ${k}`,
4242
+ const { results: D, nextCursor: me } = await t.getTasksByFilter({
4243
+ query: `assigned to: ${T}`,
4250
4244
  lang: "en",
4251
4245
  limit: d,
4252
4246
  cursor: l ?? null
@@ -4255,15 +4249,15 @@ const La = new Ua(), { FIND_COMPLETED_TASKS: $t, ADD_TASKS: Dt } = g, Ma = {
4255
4249
  textContent: Ee({
4256
4250
  tasks: G,
4257
4251
  args: e,
4258
- nextCursor: he,
4252
+ nextCursor: me,
4259
4253
  isContainerSearch: !1,
4260
- assigneeEmail: k
4254
+ assigneeEmail: T
4261
4255
  }),
4262
4256
  structuredContent: {
4263
4257
  tasks: G,
4264
- nextCursor: he ?? void 0,
4258
+ nextCursor: me ?? void 0,
4265
4259
  totalCount: G.length,
4266
- hasMore: !!he,
4260
+ hasMore: !!me,
4267
4261
  appliedFilters: e
4268
4262
  }
4269
4263
  };
@@ -4271,10 +4265,10 @@ const La = new Ua(), { FIND_COMPLETED_TASKS: $t, ADD_TASKS: Dt } = g, Ma = {
4271
4265
  let I = v ? `(${v})` : "";
4272
4266
  r && (I = ce(I, `search: ${r}`));
4273
4267
  const x = dt(u, p);
4274
- if (I = ce(I, x), !(m && !i && !c)) {
4268
+ if (I = ce(I, x), !(h && !i && !c)) {
4275
4269
  const D = ss({
4276
4270
  resolvedAssigneeId: A,
4277
- assigneeEmail: k,
4271
+ assigneeEmail: T,
4278
4272
  responsibleUserFiltering: c
4279
4273
  });
4280
4274
  I = ce(I, D);
@@ -4291,7 +4285,7 @@ const La = new Ua(), { FIND_COMPLETED_TASKS: $t, ADD_TASKS: Dt } = g, Ma = {
4291
4285
  args: e,
4292
4286
  nextCursor: j,
4293
4287
  isContainerSearch: !1,
4294
- assigneeEmail: k
4288
+ assigneeEmail: T
4295
4289
  }),
4296
4290
  structuredContent: {
4297
4291
  tasks: b,
@@ -4357,7 +4351,7 @@ function Ee({
4357
4351
  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}`));
4358
4352
  }
4359
4353
  }
4360
- return Y({
4354
+ return q({
4361
4355
  subject: a,
4362
4356
  count: e.length,
4363
4357
  limit: t.limit,
@@ -4371,7 +4365,7 @@ const Wa = {
4371
4365
  projectId: s.string().min(1).optional().describe(
4372
4366
  "Optional project ID. If provided, shows detailed overview of that project. If omitted, shows overview of all projects."
4373
4367
  )
4374
- }, ks = s.lazy(
4368
+ }, Ts = s.lazy(
4375
4369
  () => s.object({
4376
4370
  id: s.string().describe("The project ID."),
4377
4371
  name: s.string().describe("The project name."),
@@ -4384,7 +4378,7 @@ const Wa = {
4384
4378
  name: s.string()
4385
4379
  })
4386
4380
  ),
4387
- children: s.array(ks).describe("Nested child projects.")
4381
+ children: s.array(Ts).describe("Nested child projects.")
4388
4382
  })
4389
4383
  ), Ba = {
4390
4384
  type: s.enum(["account_overview", "project_overview"]).describe("The type of overview returned."),
@@ -4405,7 +4399,7 @@ const Wa = {
4405
4399
  name: s.string().describe("The inbox project name."),
4406
4400
  sections: s.array(X).describe("Sections in the inbox project.")
4407
4401
  }).nullable().optional().describe("Inbox information (account overview only)."),
4408
- projects: s.array(s.lazy(() => ks)).optional().describe(
4402
+ projects: s.array(s.lazy(() => Ts)).optional().describe(
4409
4403
  "List of projects with hierarchy, folders, and ordering (account overview only)."
4410
4404
  ),
4411
4405
  project: s.object({
@@ -4420,7 +4414,7 @@ const Wa = {
4420
4414
  tasksWithoutSection: s.number()
4421
4415
  }).optional().describe("Statistics object (project overview only).")
4422
4416
  };
4423
- function qa(e) {
4417
+ function Ya(e) {
4424
4418
  const t = {};
4425
4419
  for (const n of e)
4426
4420
  t[n.id] = {
@@ -4481,11 +4475,11 @@ function xt(e) {
4481
4475
  }
4482
4476
  return r;
4483
4477
  }
4484
- function Ye(e, t = "") {
4478
+ function qe(e, t = "") {
4485
4479
  const r = [];
4486
4480
  for (const o of e) {
4487
4481
  const n = `id=${o.id}`, a = o.dueDate ? `; due=${o.dueDate}` : "", i = `; content=${o.content}`;
4488
- r.push(`${t}- ${n}${a}${i}`), o.children.length > 0 && r.push(...Ye(o.children, `${t} `));
4482
+ r.push(`${t}- ${n}${a}${i}`), o.children.length > 0 && r.push(...qe(o.children, `${t} `));
4489
4483
  }
4490
4484
  return r;
4491
4485
  }
@@ -4494,7 +4488,7 @@ function vs(e, t) {
4494
4488
  id: e.id,
4495
4489
  name: e.name,
4496
4490
  parentId: B(e) ? e.parentId ?? void 0 : void 0,
4497
- folderId: ke(e) ? e.folderId ?? void 0 : void 0,
4491
+ folderId: Te(e) ? e.folderId ?? void 0 : void 0,
4498
4492
  childOrder: e.childOrder,
4499
4493
  sections: (t[e.id] || []).map(z),
4500
4494
  children: e.children.map(
@@ -4502,7 +4496,7 @@ function vs(e, t) {
4502
4496
  )
4503
4497
  };
4504
4498
  }
4505
- async function Ya(e, t) {
4499
+ async function qa(e, t) {
4506
4500
  let r = [], o;
4507
4501
  do {
4508
4502
  const { results: n, nextCursor: a } = await e.getTasks({
@@ -4519,7 +4513,7 @@ async function Ga(e, t) {
4519
4513
  return r;
4520
4514
  }
4521
4515
  async function Ka(e) {
4522
- const { results: t } = await e.getProjects({}), r = t.find((p) => B(p) && p.inboxProject === !0), o = t.filter((p) => !B(p) || p.inboxProject !== !0), n = qa(o), a = t.map((p) => p.id), i = await za(e, a), c = ["# Personal Projects", ""];
4516
+ const { results: t } = await e.getProjects({}), r = t.find((p) => B(p) && p.inboxProject === !0), o = t.filter((p) => !B(p) || p.inboxProject !== !0), n = Ya(o), a = t.map((p) => p.id), i = await za(e, a), c = ["# Personal Projects", ""];
4523
4517
  if (r) {
4524
4518
  c.push(`- Inbox Project: ${r.name} (id=${r.id})`);
4525
4519
  for (const p of i[r.id] || [])
@@ -4549,7 +4543,7 @@ async function Ka(e) {
4549
4543
  ),
4550
4544
  totalProjects: t.length,
4551
4545
  totalSections: a.reduce(
4552
- (p, h) => p + (i[h]?.length || 0),
4546
+ (p, m) => p + (i[m]?.length || 0),
4553
4547
  0
4554
4548
  ),
4555
4549
  hasNestedProjects: d
@@ -4560,7 +4554,7 @@ async function Va(e, t) {
4560
4554
  const [r, o, n] = await Promise.all([
4561
4555
  e.getProject(t),
4562
4556
  Ga(e, t),
4563
- Ya(e, t)
4557
+ qa(e, t)
4564
4558
  ]), a = {};
4565
4559
  for (const u of o)
4566
4560
  a[u.id] = [];
@@ -4571,15 +4565,15 @@ async function Va(e, t) {
4571
4565
  if (i.length > 0) {
4572
4566
  c.push("");
4573
4567
  const u = xt(i);
4574
- c.push(...Ye(u));
4568
+ c.push(...qe(u));
4575
4569
  }
4576
4570
  for (const u of o) {
4577
4571
  c.push(""), c.push(`## ${u.name}`);
4578
4572
  const p = a[u.id];
4579
4573
  if (!p?.length)
4580
4574
  continue;
4581
- const h = xt(p);
4582
- c.push(...Ye(h));
4575
+ const m = xt(p);
4576
+ c.push(...qe(m));
4583
4577
  }
4584
4578
  const d = c.join(`
4585
4579
  `), l = {
@@ -4939,7 +4933,7 @@ const ui = {
4939
4933
  "The workspace ID or name. Supports exact ID, exact name match (case-insensitive), or unique partial name match."
4940
4934
  ),
4941
4935
  projectIds: s.array(s.string().min(1)).min(1).optional().describe("Optional list of project IDs to scope insights to specific projects.")
4942
- }, hi = s.object({
4936
+ }, mi = s.object({
4943
4937
  projectId: s.string().describe("The project ID."),
4944
4938
  health: s.object({
4945
4939
  status: s.enum(Ke).describe("The health status of the project."),
@@ -4951,16 +4945,16 @@ const ui = {
4951
4945
  activeCount: s.number().describe("Number of active tasks."),
4952
4946
  progressPercent: s.number().describe("Completion percentage (0-100).")
4953
4947
  }).nullable().describe("Progress data for this project, if available.")
4954
- }), mi = {
4948
+ }), hi = {
4955
4949
  workspaceId: s.string().describe("The resolved workspace ID."),
4956
4950
  workspaceName: s.string().describe("The resolved workspace name."),
4957
4951
  folderId: s.string().nullable().describe("The folder ID, if applicable."),
4958
- projectInsights: s.array(hi).describe("Health and progress insights for each project in the workspace.")
4952
+ projectInsights: s.array(mi).describe("Health and progress insights for each project in the workspace.")
4959
4953
  }, fi = {
4960
4954
  name: g.GET_WORKSPACE_INSIGHTS,
4961
4955
  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.",
4962
4956
  parameters: pi,
4963
- outputSchema: mi,
4957
+ outputSchema: hi,
4964
4958
  annotations: {
4965
4959
  readOnlyHint: !0,
4966
4960
  destructiveHint: !1,
@@ -5036,16 +5030,16 @@ const yi = {
5036
5030
  "Raw CSV template content, as produced by export-project-template. Provide either this or `templateId`, not both."
5037
5031
  ),
5038
5032
  locale: s.string().optional().describe('Locale for the imported content when using `templateId`. Defaults to "en".')
5039
- }, Ti = {
5033
+ }, ki = {
5040
5034
  sections: s.array(X).describe("Sections created by the import."),
5041
5035
  tasks: s.array(F).describe("Tasks created by the import."),
5042
5036
  comments: s.array(ye).describe("Comments created by the import."),
5043
5037
  totalCount: s.number().describe("The total number of objects created by the import.")
5044
- }, ki = {
5038
+ }, Ti = {
5045
5039
  name: g.IMPORT_PROJECT_TEMPLATE,
5046
5040
  description: "Import a template into an existing project, adding its tasks, sections and comments to whatever is already there. Source it by template ID/URL or by passing CSV content from export-project-template. To start a new project from a template, create the project with add-projects first, then import into it. This writes immediately and cannot be undone, so only run it against a project the user named.",
5047
5041
  parameters: yi,
5048
- outputSchema: Ti,
5042
+ outputSchema: ki,
5049
5043
  annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
5050
5044
  async execute({ projectId: e, templateId: t, csvFileContent: r, locale: o }, n) {
5051
5045
  if (!!t == !!r)
@@ -5181,37 +5175,37 @@ const Ci = {
5181
5175
  if ((r === "assign" || r === "reassign") && !n)
5182
5176
  throw new Error(`${r} operation requires responsibleUser parameter`);
5183
5177
  const c = await Promise.allSettled(
5184
- o.map(async (k) => {
5178
+ o.map(async (T) => {
5185
5179
  try {
5186
- return await t.getTask(k);
5180
+ return await t.getTask(T);
5187
5181
  } catch {
5188
- throw new Error(`Task ${k} not found or not accessible`);
5182
+ throw new Error(`Task ${T} not found or not accessible`);
5189
5183
  }
5190
5184
  })
5191
5185
  ), d = [], l = [];
5192
- for (let k = 0; k < c.length; k++) {
5193
- const I = c[k];
5186
+ for (let T = 0; T < c.length; T++) {
5187
+ const I = c[T];
5194
5188
  I && I.status === "fulfilled" ? d.push(I.value) : I && I.status === "rejected" ? l.push({
5195
- taskId: o[k] || "invalid-task-id",
5189
+ taskId: o[T] || "invalid-task-id",
5196
5190
  success: !1,
5197
5191
  error: I.reason?.message || "Task not accessible"
5198
5192
  }) : l.push({
5199
- taskId: o[k] || "invalid-task-id",
5193
+ taskId: o[T] || "invalid-task-id",
5200
5194
  success: !1,
5201
5195
  error: "Task not accessible"
5202
5196
  });
5203
5197
  }
5204
5198
  if (d.length === 0) {
5205
- const k = l.map((I) => `"${I.taskId}": ${I.error}`).join("; ");
5206
- throw new Error(`All ${l.length} task(s) failed: ${k}`);
5199
+ const T = l.map((I) => `"${I.taskId}": ${I.error}`).join("; ");
5200
+ throw new Error(`All ${l.length} task(s) failed: ${T}`);
5207
5201
  }
5208
5202
  let u;
5209
5203
  r === "reassign" && a && (u = (await W.resolveUser(t, a))?.userId || a);
5210
5204
  const p = [];
5211
- for (const k of d)
5212
- r === "reassign" && u && k.responsibleUid !== u || p.push({
5213
- taskId: k.id,
5214
- projectId: k.projectId,
5205
+ for (const T of d)
5206
+ r === "reassign" && u && T.responsibleUid !== u || p.push({
5207
+ taskId: T.id,
5208
+ projectId: T.projectId,
5215
5209
  responsibleUid: n || ""
5216
5210
  // Will be validated appropriately
5217
5211
  });
@@ -5239,7 +5233,7 @@ const Ci = {
5239
5233
  }
5240
5234
  };
5241
5235
  }
5242
- const k = d.map(async (b) => {
5236
+ const T = d.map(async (b) => {
5243
5237
  try {
5244
5238
  return await t.updateTask(b.id, { assigneeId: null }), {
5245
5239
  taskId: b.id,
@@ -5255,7 +5249,7 @@ const Ci = {
5255
5249
  originalAssigneeId: b.responsibleUid ?? void 0
5256
5250
  };
5257
5251
  }
5258
- }), I = await Promise.all(k), x = [...I, ...l];
5252
+ }), I = await Promise.all(T), x = [...I, ...l];
5259
5253
  if (x.length > 0 && x.every((b) => !b.success)) {
5260
5254
  const b = x.map((j) => `"${j.taskId}": ${j.error}`).join("; ");
5261
5255
  throw new Error(`All ${x.length} unassign operation(s) failed: ${b}`);
@@ -5276,20 +5270,20 @@ const Ci = {
5276
5270
  }
5277
5271
  };
5278
5272
  }
5279
- const h = await it.validateBulkAssignment(
5273
+ const m = await it.validateBulkAssignment(
5280
5274
  t,
5281
5275
  p
5282
- ), m = [], y = [];
5283
- for (let k = 0; k < p.length; k++) {
5284
- const I = p[k], x = h[k];
5285
- I && x?.isValid ? m.push({ assignment: I, validation: x }) : I?.taskId && y.push({
5276
+ ), h = [], y = [];
5277
+ for (let T = 0; T < p.length; T++) {
5278
+ const I = p[T], x = m[T];
5279
+ I && x?.isValid ? h.push({ assignment: I, validation: x }) : I?.taskId && y.push({
5286
5280
  taskId: I.taskId,
5287
5281
  success: !1,
5288
5282
  error: x?.error?.message || "Validation failed"
5289
5283
  });
5290
5284
  }
5291
- async function f(k, I) {
5292
- const x = k.filter(
5285
+ async function f(T, I) {
5286
+ const x = T.filter(
5293
5287
  (b) => b.assignment != null && b.validation != null
5294
5288
  );
5295
5289
  if (!I)
@@ -5306,7 +5300,7 @@ const Ci = {
5306
5300
  newAssigneeId: j.resolvedUser.userId
5307
5301
  };
5308
5302
  });
5309
- const T = x.map(
5303
+ const k = x.map(
5310
5304
  async ({ assignment: b, validation: j }) => {
5311
5305
  const $ = d.find((D) => D.id === b.taskId);
5312
5306
  if (!b.taskId || !j.resolvedUser?.userId)
@@ -5335,12 +5329,12 @@ const Ci = {
5335
5329
  }
5336
5330
  }
5337
5331
  );
5338
- return Promise.all(T);
5332
+ return Promise.all(k);
5339
5333
  }
5340
- const v = await f(m, !i), S = [...v, ...y, ...l];
5341
- if (S.length > 0 && S.every((k) => !k.success)) {
5342
- const k = S.map((I) => `"${I.taskId}": ${I.error}`).join("; ");
5343
- throw new Error(`All ${S.length} ${r} operation(s) failed: ${k}`);
5334
+ const v = await f(h, !i), S = [...v, ...y, ...l];
5335
+ if (S.length > 0 && S.every((T) => !T.success)) {
5336
+ const T = S.map((I) => `"${I.taskId}": ${I.error}`).join("; ");
5337
+ throw new Error(`All ${S.length} ${r} operation(s) failed: ${T}`);
5344
5338
  }
5345
5339
  return {
5346
5340
  textContent: Oe({
@@ -5352,8 +5346,8 @@ const Ci = {
5352
5346
  operation: r,
5353
5347
  results: S,
5354
5348
  totalRequested: o.length,
5355
- successful: v.filter((k) => k.success).length,
5356
- failed: S.filter((k) => !k.success).length,
5349
+ successful: v.filter((T) => T.success).length,
5350
+ failed: S.filter((T) => !T.success).length,
5357
5351
  dryRun: i
5358
5352
  }
5359
5353
  };
@@ -5515,11 +5509,11 @@ const Pi = {
5515
5509
  }
5516
5510
  const a = [], i = o.filter((p) => p.parentId !== void 0);
5517
5511
  for (const p of i) {
5518
- const h = p.parentId;
5512
+ const m = p.parentId;
5519
5513
  a.push(
5520
5514
  V("project_move", {
5521
5515
  id: p.id,
5522
- parentId: h === "root" ? null : h
5516
+ parentId: m === "root" ? null : m
5523
5517
  })
5524
5518
  );
5525
5519
  }
@@ -5544,8 +5538,8 @@ const Pi = {
5544
5538
  try {
5545
5539
  await t.sync({ commands: a });
5546
5540
  } catch (p) {
5547
- const h = p instanceof Error ? p.message : String(p);
5548
- throw new Error(`Reorder failed: ${h}`);
5541
+ const m = p instanceof Error ? p.message : String(p);
5542
+ throw new Error(`Reorder failed: ${m}`);
5549
5543
  }
5550
5544
  const d = r === "project" ? "projects" : "sections", l = o.map((p) => p.id), u = [];
5551
5545
  return i.length > 0 && u.push(`moved ${i.length}`), c.length > 0 && u.push(`reordered ${c.length}`), {
@@ -5566,7 +5560,7 @@ const Pi = {
5566
5560
  )
5567
5561
  }), Bi = {
5568
5562
  tasks: s.array(Wi).min(1).describe("The tasks to reschedule with their new dates.")
5569
- }, qi = {
5563
+ }, Yi = {
5570
5564
  tasks: s.array(F).describe("The rescheduled tasks."),
5571
5565
  totalCount: s.number().describe("The total number of tasks rescheduled."),
5572
5566
  rescheduledTaskIds: s.array(s.string()).describe("The IDs of the rescheduled tasks.")
@@ -5574,7 +5568,7 @@ const Pi = {
5574
5568
  name: g.RESCHEDULE_TASKS,
5575
5569
  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.",
5576
5570
  parameters: Bi,
5577
- outputSchema: qi,
5571
+ outputSchema: Yi,
5578
5572
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
5579
5573
  async execute(e, t) {
5580
5574
  const { tasks: r } = e, n = (await Promise.all(
@@ -5587,7 +5581,7 @@ const Pi = {
5587
5581
  throw new Error(
5588
5582
  `Task "${l.content}" (${l.id}) has no due date. Rescheduling requires an existing due date.`
5589
5583
  );
5590
- const u = Yi(d.date, l.due);
5584
+ const u = qi(d.date, l.due);
5591
5585
  return V("item_update", {
5592
5586
  id: d.id,
5593
5587
  due: {
@@ -5618,7 +5612,7 @@ const Pi = {
5618
5612
  };
5619
5613
  }
5620
5614
  };
5621
- function Yi(e, t) {
5615
+ function qi(e, t) {
5622
5616
  if (/^\d{4}-\d{2}-\d{2}$/.test(e) && t.datetime) {
5623
5617
  const o = t.datetime.substring(10);
5624
5618
  return e + o;
@@ -5797,10 +5791,10 @@ const nc = s.object({
5797
5791
  outputSchema: ic,
5798
5792
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
5799
5793
  async execute(e, t) {
5800
- const { filters: r } = e, o = [], a = r.map((h) => {
5801
- const m = lc(h);
5802
- return m !== null ? { kind: "skipped", reason: m } : (o.push(h), { kind: "updated", filter: h });
5803
- }).filter((h) => h.kind === "skipped").length;
5794
+ const { filters: r } = e, o = [], a = r.map((m) => {
5795
+ const h = lc(m);
5796
+ return h !== null ? { kind: "skipped", reason: h } : (o.push(m), { kind: "updated", filter: m });
5797
+ }).filter((m) => m.kind === "skipped").length;
5804
5798
  if (o.length === 0)
5805
5799
  return {
5806
5800
  textContent: `Updated 0 filters (${a} skipped - no changes)`,
@@ -5811,29 +5805,29 @@ const nc = s.object({
5811
5805
  appliedOperations: { updateCount: 0, skippedCount: a }
5812
5806
  }
5813
5807
  };
5814
- const i = o.map((h) => {
5815
- const { id: m, color: y, ...f } = h;
5808
+ const i = o.map((m) => {
5809
+ const { id: h, color: y, ...f } = m;
5816
5810
  return V("filter_update", {
5817
- id: m,
5811
+ id: h,
5818
5812
  ...f,
5819
5813
  ...y !== void 0 ? { color: y } : {}
5820
5814
  });
5821
5815
  });
5822
5816
  await t.sync({ commands: i });
5823
- const d = ((await t.sync({ resourceTypes: ["filters"], syncToken: "*" })).filters ?? []).filter((h) => !h.isDeleted), l = new Set(o.map((h) => h.id)), u = d.filter((h) => l.has(h.id)).map((h) => ({
5824
- id: h.id,
5825
- name: h.name,
5826
- query: h.query,
5827
- color: ue.parse(h.color),
5828
- isFavorite: h.isFavorite,
5829
- itemOrder: h.itemOrder
5817
+ const d = ((await t.sync({ resourceTypes: ["filters"], syncToken: "*" })).filters ?? []).filter((m) => !m.isDeleted), l = new Set(o.map((m) => m.id)), u = d.filter((m) => l.has(m.id)).map((m) => ({
5818
+ id: m.id,
5819
+ name: m.name,
5820
+ query: m.query,
5821
+ color: ue.parse(m.color),
5822
+ isFavorite: m.isFavorite,
5823
+ itemOrder: m.itemOrder
5830
5824
  }));
5831
5825
  return {
5832
5826
  textContent: dc({ filters: u, skippedCount: a }),
5833
5827
  structuredContent: {
5834
5828
  filters: u,
5835
5829
  totalCount: u.length,
5836
- updatedFilterIds: u.map((h) => h.id),
5830
+ updatedFilterIds: u.map((m) => m.id),
5837
5831
  appliedOperations: {
5838
5832
  updateCount: u.length,
5839
5833
  skippedCount: a
@@ -5872,11 +5866,11 @@ const uc = s.object({
5872
5866
  ),
5873
5867
  name: s.string().min(1).describe("The current name of the shared label."),
5874
5868
  newName: s.string().min(1).describe("The new name for the shared label.")
5875
- }), hc = s.discriminatedUnion("labelType", [
5869
+ }), mc = s.discriminatedUnion("labelType", [
5876
5870
  uc,
5877
5871
  pc
5878
- ]), mc = {
5879
- labels: s.array(hc).min(1).describe(
5872
+ ]), hc = {
5873
+ labels: s.array(mc).min(1).describe(
5880
5874
  '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.'
5881
5875
  )
5882
5876
  }, fc = s.object({
@@ -5894,17 +5888,17 @@ const uc = s.object({
5894
5888
  }, gc = {
5895
5889
  name: g.UPDATE_LABELS,
5896
5890
  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.",
5897
- parameters: mc,
5891
+ parameters: hc,
5898
5892
  outputSchema: bc,
5899
5893
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
5900
5894
  async execute(e, t) {
5901
5895
  const { labels: r } = e, o = await Promise.all(
5902
5896
  r.map(async (u) => {
5903
5897
  if (u.labelType === "personal") {
5904
- const h = Tc(u);
5905
- if (h !== null) return { kind: "skipped", reason: h };
5906
- const { id: m, labelType: y, ...f } = u;
5907
- return { kind: "updated", label: await t.updateLabel(m, f) };
5898
+ const m = kc(u);
5899
+ if (m !== null) return { kind: "skipped", reason: m };
5900
+ const { id: h, labelType: y, ...f } = u;
5901
+ return { kind: "updated", label: await t.updateLabel(h, f) };
5908
5902
  }
5909
5903
  return await t.renameSharedLabel({
5910
5904
  name: u.name,
@@ -5960,14 +5954,14 @@ function yc({
5960
5954
  return c.join(`
5961
5955
  `);
5962
5956
  }
5963
- function Tc({
5957
+ function kc({
5964
5958
  id: e,
5965
5959
  labelType: t,
5966
5960
  ...r
5967
5961
  }) {
5968
5962
  return Object.values(r).every((n) => n === void 0) ? "no-fields" : null;
5969
5963
  }
5970
- const kc = s.object({
5964
+ const Tc = s.object({
5971
5965
  id: s.string().min(1).describe("The ID of the project to update."),
5972
5966
  name: s.string().min(1).optional().describe("The new name of the project."),
5973
5967
  isFavorite: s.boolean().optional().describe("Whether the project is a favorite."),
@@ -5983,7 +5977,7 @@ const kc = s.object({
5983
5977
  ).optional(),
5984
5978
  color: le
5985
5979
  }), wc = {
5986
- projects: s.array(kc).min(1).describe("The projects to update.")
5980
+ projects: s.array(Tc).min(1).describe("The projects to update.")
5987
5981
  }, vc = {
5988
5982
  projects: s.array(Q).describe("The updated projects."),
5989
5983
  totalCount: s.number().describe("The total number of projects updated."),
@@ -6007,8 +6001,8 @@ const kc = s.object({
6007
6001
  r.map(async (l) => {
6008
6002
  const u = Sc(l);
6009
6003
  if (u !== null) return { kind: "skipped", reason: u };
6010
- const { id: p, ...h } = l;
6011
- return { kind: "updated", project: await O(() => t.updateProject(p, h)) };
6004
+ const { id: p, ...m } = l;
6005
+ return { kind: "updated", project: await O(() => t.updateProject(p, m)) };
6012
6006
  })
6013
6007
  ), n = [], a = [];
6014
6008
  let i = 0, c = 0;
@@ -6016,7 +6010,7 @@ const kc = s.object({
6016
6010
  if (u.status === "rejected") {
6017
6011
  a.push({
6018
6012
  item: r[l]?.id ?? `Project ${l + 1}`,
6019
- error: q(u.reason)
6013
+ error: Y(u.reason)
6020
6014
  });
6021
6015
  continue;
6022
6016
  }
@@ -6266,7 +6260,7 @@ const Wc = s.object({
6266
6260
  isUncompletable: s.boolean().optional().describe(
6267
6261
  "Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
6268
6262
  )
6269
- }), Bc = (e) => !!(e.projectId || e.sectionId || e.parentId), Ss = (e) => Object.keys(e).length > 0, qc = ["remove", "no date"], zc = ["remove", "no date", "no deadline"], Yc = "no date", Ge = zt.TASKS_PER_OPERATION, Ot = {
6263
+ }), Bc = (e) => !!(e.projectId || e.sectionId || e.parentId), Ss = (e) => Object.keys(e).length > 0, Yc = ["remove", "no date"], zc = ["remove", "no date", "no deadline"], qc = "no date", Ge = zt.TASKS_PER_OPERATION, Ot = {
6270
6264
  tasks: s.array(Wc).min(1).max(Ge).describe(`The tasks to update (max ${Ge}).`)
6271
6265
  }, Gc = {
6272
6266
  tasks: s.array(F).describe("The updated tasks."),
@@ -6290,42 +6284,42 @@ const Wc = s.object({
6290
6284
  outputSchema: Gc,
6291
6285
  annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
6292
6286
  async execute(e, t) {
6293
- const { tasks: r } = s.object(Ot).parse(e), o = r.map(() => ({ kind: "skipped" })), n = (T, b) => {
6294
- o[T] = { kind: "failed", error: b };
6295
- }, a = (T, b) => {
6296
- n(T, q(b));
6297
- }, i = r.map((T, b) => ({ task: T, index: b })).filter(({ task: T }) => rd(T)), c = await Jc(
6298
- i.map(({ task: T }) => T),
6287
+ const { tasks: r } = s.object(Ot).parse(e), o = r.map(() => ({ kind: "skipped" })), n = (k, b) => {
6288
+ o[k] = { kind: "failed", error: b };
6289
+ }, a = (k, b) => {
6290
+ n(k, Y(b));
6291
+ }, i = r.map((k, b) => ({ task: k, index: b })).filter(({ task: k }) => rd(k)), c = await Jc(
6292
+ i.map(({ task: k }) => k),
6299
6293
  t
6300
6294
  ), d = await Promise.allSettled(
6301
- i.map(({ task: T, index: b }) => ed({ task: T, index: b, client: t, inbox: c }))
6295
+ i.map(({ task: k, index: b }) => ed({ task: k, index: b, client: t, inbox: c }))
6302
6296
  ), l = [];
6303
- for (const [T, b] of d.entries()) {
6304
- const j = i[T]?.index ?? T;
6297
+ for (const [k, b] of d.entries()) {
6298
+ const j = i[k]?.index ?? k;
6305
6299
  b.status === "fulfilled" ? l.push(b.value) : a(j, b.reason);
6306
6300
  }
6307
6301
  const u = await Cs({
6308
6302
  client: t,
6309
6303
  ids: [
6310
6304
  ...new Set(
6311
- l.filter((T) => Bc(T.moveRequest)).map((T) => T.id)
6305
+ l.filter((k) => Bc(k.moveRequest)).map((k) => k.id)
6312
6306
  )
6313
6307
  ]
6314
6308
  }), p = [];
6315
- for (const T of l)
6309
+ for (const k of l)
6316
6310
  try {
6317
6311
  const b = Hc({
6318
- taskId: T.id,
6319
- request: T.moveRequest,
6320
- current: u.get(T.id)
6312
+ taskId: k.id,
6313
+ request: k.moveRequest,
6314
+ current: u.get(k.id)
6321
6315
  });
6322
- T.redundantMoveSkipped = b.redundantMoveSkipped, b.move && p.push({ item: T, move: b.move });
6316
+ k.redundantMoveSkipped = b.redundantMoveSkipped, b.move && p.push({ item: k, move: b.move });
6323
6317
  } catch (b) {
6324
- a(T.index, b), T.failed = !0;
6318
+ a(k.index, b), k.failed = !0;
6325
6319
  }
6326
- const h = /* @__PURE__ */ new Map(), m = [], y = (T) => {
6327
- const b = T.filter((j) => !j.failed);
6328
- b.length !== 0 && m.push(
6320
+ const m = /* @__PURE__ */ new Map(), h = [], y = (k) => {
6321
+ const b = k.filter((j) => !j.failed);
6322
+ b.length !== 0 && h.push(
6329
6323
  Qc({
6330
6324
  client: t,
6331
6325
  items: b,
@@ -6333,12 +6327,12 @@ const Wc = s.object({
6333
6327
  o[j.index] = { kind: "updated", task: $ };
6334
6328
  },
6335
6329
  onFailed: (j, $) => {
6336
- const D = h.get(j.index);
6330
+ const D = m.get(j.index);
6337
6331
  if (D && "task" in D) {
6338
6332
  o[j.index] = {
6339
6333
  kind: "partial",
6340
6334
  task: D.task,
6341
- error: `Move applied; field update failed: ${q($)}`
6335
+ error: `Move applied; field update failed: ${Y($)}`
6342
6336
  };
6343
6337
  return;
6344
6338
  }
@@ -6346,15 +6340,15 @@ const Wc = s.object({
6346
6340
  }
6347
6341
  })
6348
6342
  );
6349
- }, f = new Set(p.map(({ item: T }) => T.index));
6350
- y(l.filter((T) => !f.has(T.index))), await Xc({
6343
+ }, f = new Set(p.map(({ item: k }) => k.index));
6344
+ y(l.filter((k) => !f.has(k.index))), await Xc({
6351
6345
  client: t,
6352
6346
  moving: p,
6353
- results: h,
6354
- onResolved: (T) => {
6347
+ results: m,
6348
+ onResolved: (k) => {
6355
6349
  const b = [];
6356
- for (const { item: j } of T) {
6357
- const $ = h.get(j.index);
6350
+ for (const { item: j } of k) {
6351
+ const $ = m.get(j.index);
6358
6352
  if ($ && "error" in $) {
6359
6353
  n(j.index, $.error), j.failed = !0;
6360
6354
  continue;
@@ -6363,31 +6357,31 @@ const Wc = s.object({
6363
6357
  }
6364
6358
  y(b);
6365
6359
  }
6366
- }), await Promise.all(m);
6367
- for (const T of l) {
6368
- if (T.failed || Ss(T.updateArgs))
6360
+ }), await Promise.all(h);
6361
+ for (const k of l) {
6362
+ if (k.failed || Ss(k.updateArgs))
6369
6363
  continue;
6370
- const b = h.get(T.index);
6371
- b && "task" in b && (o[T.index] = { kind: "updated", task: b.task });
6364
+ const b = m.get(k.index);
6365
+ b && "task" in b && (o[k.index] = { kind: "updated", task: b.task });
6372
6366
  }
6373
- const { updatedTasks: v, failures: S, skippedCount: A } = Vc({ tasks: r, outcomes: o }), k = l.filter((T) => T.redundantMoveSkipped).length, I = v.map(P);
6367
+ const { updatedTasks: v, failures: S, skippedCount: A } = Vc({ tasks: r, outcomes: o }), T = l.filter((k) => k.redundantMoveSkipped).length, I = v.map(P);
6374
6368
  return {
6375
6369
  textContent: sd({
6376
6370
  tasks: I,
6377
6371
  failures: S,
6378
6372
  skippedCount: A,
6379
- redundantMovesSkipped: k
6373
+ redundantMovesSkipped: T
6380
6374
  }),
6381
6375
  structuredContent: {
6382
6376
  tasks: I,
6383
6377
  totalCount: I.length,
6384
- updatedTaskIds: v.map((T) => T.id),
6378
+ updatedTaskIds: v.map((k) => k.id),
6385
6379
  failures: S,
6386
6380
  appliedOperations: {
6387
6381
  updateCount: I.length,
6388
6382
  skippedCount: A,
6389
6383
  failureCount: S.length,
6390
- redundantMovesSkipped: k
6384
+ redundantMovesSkipped: T
6391
6385
  }
6392
6386
  }
6393
6387
  };
@@ -6463,15 +6457,15 @@ async function Xc({
6463
6457
  }
6464
6458
  const p = await a(
6465
6459
  () => O(() => e.moveTasks(d, l))
6466
- ), h = new Map(p.map((f) => [f.id, f])), m = [], y = [];
6460
+ ), m = new Map(p.map((f) => [f.id, f])), h = [], y = [];
6467
6461
  for (const f of c) {
6468
- const v = h.get(f.item.id);
6469
- v ? (r.set(f.item.index, { task: v }), y.push(f)) : m.push(f);
6462
+ const v = m.get(f.item.id);
6463
+ v ? (r.set(f.item.index, { task: v }), y.push(f)) : h.push(f);
6470
6464
  }
6471
- o(y), m.length > 0 && i.push({ group: m, destination: l });
6465
+ o(y), h.length > 0 && i.push({ group: h, destination: l });
6472
6466
  } catch (p) {
6473
6467
  if (u) {
6474
- r.set(u.item.index, { error: q(p) }), o(c);
6468
+ r.set(u.item.index, { error: Y(p) }), o(c);
6475
6469
  continue;
6476
6470
  }
6477
6471
  i.push({ group: c, destination: l, error: p });
@@ -6490,7 +6484,7 @@ async function Zc({
6490
6484
  }) {
6491
6485
  const o = [...new Set(t.flatMap(({ group: a }) => a.map(({ item: i }) => i.id)))], n = await Cs({ client: e, ids: o });
6492
6486
  for (const { group: a, destination: i, error: c } of t) {
6493
- const d = c === void 0 ? "Task not returned by the move" : q(c);
6487
+ const d = c === void 0 ? "Task not returned by the move" : Y(c);
6494
6488
  for (const { item: l } of a) {
6495
6489
  const u = n.get(l.id);
6496
6490
  if (u && js(u, i)) {
@@ -6536,8 +6530,8 @@ async function ed({
6536
6530
  duration: l,
6537
6531
  responsibleUser: u,
6538
6532
  priority: p,
6539
- labels: h,
6540
- deadlineDate: m,
6533
+ labels: m,
6534
+ deadlineDate: h,
6541
6535
  ...y
6542
6536
  } = e;
6543
6537
  if (M(a) && o.error !== void 0)
@@ -6545,26 +6539,26 @@ async function ed({
6545
6539
  const f = M(a) ? o.projectId : a;
6546
6540
  let v = {
6547
6541
  ...y,
6548
- ...h !== void 0 && { labels: h }
6542
+ ...m !== void 0 && { labels: m }
6549
6543
  };
6550
6544
  p && (v.priority = Zt(p));
6551
6545
  const S = Pt(
6552
6546
  d,
6553
- qc,
6554
- Yc
6547
+ Yc,
6548
+ qc
6555
6549
  );
6556
6550
  S !== void 0 && (v = { ...v, dueString: S });
6557
- const A = Pt(m, zc, null);
6551
+ const A = Pt(h, zc, null);
6558
6552
  if (A !== void 0 && (v = { ...v, deadlineDate: A }), l)
6559
6553
  try {
6560
- const { minutes: k } = Xt(l);
6554
+ const { minutes: T } = Xt(l);
6561
6555
  v = {
6562
6556
  ...v,
6563
- duration: k,
6557
+ duration: T,
6564
6558
  durationUnit: "minute"
6565
6559
  };
6566
- } catch (k) {
6567
- throw k instanceof R ? new Error(`Task ${n}: ${k.message}`) : k;
6560
+ } catch (T) {
6561
+ throw T instanceof R ? new Error(`Task ${n}: ${T.message}`) : T;
6568
6562
  }
6569
6563
  return u !== void 0 && (v = {
6570
6564
  ...v,
@@ -6686,8 +6680,8 @@ function pd(e, t) {
6686
6680
  hour12: !1
6687
6681
  });
6688
6682
  }
6689
- async function hd(e) {
6690
- const t = await e.getUser(), r = t.tzInfo?.timezone ?? "UTC", o = $s(r), n = /* @__PURE__ */ new Date(), a = pd(n, o), i = t.startDay ?? 1, c = ld(i), d = ad(t), l = new Date(n.toLocaleString("en-US", { timeZone: o })), u = id(l, i), p = cd(u), h = dd(l), y = [
6683
+ async function md(e) {
6684
+ const t = await e.getUser(), r = t.tzInfo?.timezone ?? "UTC", o = $s(r), n = /* @__PURE__ */ new Date(), a = pd(n, o), i = t.startDay ?? 1, c = ld(i), d = ad(t), l = new Date(n.toLocaleString("en-US", { timeZone: o })), u = id(l, i), p = cd(u), m = dd(l), y = [
6691
6685
  "# User Information",
6692
6686
  "",
6693
6687
  `**User ID:** ${t.id}`,
@@ -6698,7 +6692,7 @@ async function hd(e) {
6698
6692
  "",
6699
6693
  "## Week Settings",
6700
6694
  `**Week Start Day:** ${c} (${i})`,
6701
- `**Current Week:** Week ${h}`,
6695
+ `**Current Week:** Week ${m}`,
6702
6696
  `**Week Start Date:** ${ie(u)}`,
6703
6697
  `**Week End Date:** ${ie(p)}`,
6704
6698
  "",
@@ -6720,7 +6714,7 @@ async function hd(e) {
6720
6714
  startDayName: c,
6721
6715
  weekStartDate: ie(u),
6722
6716
  weekEndDate: ie(p),
6723
- currentWeekNumber: h,
6717
+ currentWeekNumber: m,
6724
6718
  completedToday: t.completedToday,
6725
6719
  dailyGoal: t.dailyGoal,
6726
6720
  weeklyGoal: t.weeklyGoal,
@@ -6729,14 +6723,14 @@ async function hd(e) {
6729
6723
  };
6730
6724
  return { textContent: y, structuredContent: f };
6731
6725
  }
6732
- const md = {
6726
+ const hd = {
6733
6727
  name: g.USER_INFO,
6734
6728
  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).",
6735
6729
  parameters: od,
6736
6730
  outputSchema: nd,
6737
6731
  annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
6738
6732
  async execute(e, t) {
6739
- const r = await hd(t);
6733
+ const r = await md(t);
6740
6734
  return {
6741
6735
  textContent: r.textContent,
6742
6736
  structuredContent: r.structuredContent
@@ -6774,10 +6768,10 @@ const md = {
6774
6768
  function yd(e) {
6775
6769
  return fd.has(e) ? "image" : bd.has(e) || e.startsWith("text/") ? "text" : "binary";
6776
6770
  }
6777
- function Td(e) {
6771
+ function kd(e) {
6778
6772
  return (e.split(";")[0] ?? e).trim().toLowerCase();
6779
6773
  }
6780
- function kd(e) {
6774
+ function Td(e) {
6781
6775
  try {
6782
6776
  const t = new URL(e).pathname, r = t.lastIndexOf(".");
6783
6777
  if (r === -1) return;
@@ -6809,7 +6803,7 @@ const vd = {
6809
6803
  idempotentHint: !0
6810
6804
  },
6811
6805
  async execute({ fileUrl: e }, t) {
6812
- const r = await t.viewAttachment(e), o = r.headers["content-length"], n = o ? Number.parseInt(o, 10) : void 0, a = wd(e), i = r.headers["content-type"], c = i ? Td(i) : void 0, d = c && c !== "application/octet-stream" ? c : kd(e) ?? c ?? "application/octet-stream";
6806
+ const r = await t.viewAttachment(e), o = r.headers["content-length"], n = o ? Number.parseInt(o, 10) : void 0, a = wd(e), i = r.headers["content-type"], c = i ? kd(i) : void 0, d = c && c !== "application/octet-stream" ? c : Td(e) ?? c ?? "application/octet-stream";
6813
6807
  if (n && n > Rt)
6814
6808
  return {
6815
6809
  textContent: `Attachment "${a ?? e}" is too large to display inline (${(n / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
@@ -6819,15 +6813,15 @@ const vd = {
6819
6813
  return {
6820
6814
  textContent: `Attachment "${a ?? e}" is too large to display inline (${(u / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
6821
6815
  };
6822
- const p = yd(d), h = [];
6823
- return p === "image" ? h.push({
6816
+ const p = yd(d), m = [];
6817
+ return p === "image" ? m.push({
6824
6818
  type: "image",
6825
6819
  data: l.toString("base64"),
6826
6820
  mimeType: d
6827
- }) : p === "text" ? h.push({
6821
+ }) : p === "text" ? m.push({
6828
6822
  type: "text",
6829
6823
  text: l.toString("utf-8")
6830
- }) : h.push({
6824
+ }) : m.push({
6831
6825
  type: "resource",
6832
6826
  resource: {
6833
6827
  uri: e,
@@ -6836,7 +6830,7 @@ const vd = {
6836
6830
  }
6837
6831
  }), {
6838
6832
  textContent: `Attachment: ${a ?? "unknown"} (${d}, ${(u / 1024).toFixed(1)}KB)`,
6839
- contentItems: h
6833
+ contentItems: m
6840
6834
  };
6841
6835
  }
6842
6836
  }, jd = {
@@ -6859,7 +6853,7 @@ const vd = {
6859
6853
  // Project management tools
6860
6854
  addProjects: Go,
6861
6855
  updateProjects: Ic,
6862
- findProjects: ka,
6856
+ findProjects: Ta,
6863
6857
  projectManagement: _i,
6864
6858
  projectMove: Mi,
6865
6859
  // Section management tools
@@ -6885,7 +6879,7 @@ const vd = {
6885
6879
  addFilters: Oo,
6886
6880
  updateFilters: cc,
6887
6881
  // Activity and audit tools
6888
- findActivity: qn,
6882
+ findActivity: Yn,
6889
6883
  getProductivityStats: Qa,
6890
6884
  // Health and insights tools
6891
6885
  getProjectHealth: ui,
@@ -6897,13 +6891,13 @@ const vd = {
6897
6891
  deleteObject: Sn,
6898
6892
  fetchObject: Ln,
6899
6893
  reorderObjects: Hi,
6900
- userInfo: md,
6894
+ userInfo: hd,
6901
6895
  // Assignment and collaboration tools
6902
- findProjectCollaborators: ma,
6896
+ findProjectCollaborators: ha,
6903
6897
  manageAssignments: Oi,
6904
6898
  // Template tools
6905
6899
  exportProjectTemplate: Dn,
6906
- importProjectTemplate: ki,
6900
+ importProjectTemplate: Ti,
6907
6901
  // Workspace tools
6908
6902
  listWorkspaces: Ci,
6909
6903
  // OpenAI MCP tools
@@ -7033,13 +7027,13 @@ function Hd({
7033
7027
  for (const i of Cd)
7034
7028
  zr({ tool: i, ...a });
7035
7029
  return o.registerPrompt(
7036
- me.name,
7030
+ he.name,
7037
7031
  {
7038
- title: me.title,
7039
- description: me.description,
7040
- argsSchema: me.argsSchema
7032
+ title: he.title,
7033
+ description: he.description,
7034
+ argsSchema: he.argsSchema
7041
7035
  },
7042
- me.callback
7036
+ he.callback
7043
7037
  ), o;
7044
7038
  }
7045
7039
  export {
@@ -7050,7 +7044,7 @@ export {
7050
7044
  ui as D,
7051
7045
  fi as E,
7052
7046
  Fd as F,
7053
- ki as G,
7047
+ Ti as G,
7054
7048
  Ci as H,
7055
7049
  Oi as I,
7056
7050
  _i as J,
@@ -7067,7 +7061,7 @@ export {
7067
7061
  Oc as U,
7068
7062
  Uc as V,
7069
7063
  Kc as W,
7070
- md as X,
7064
+ hd as X,
7071
7065
  Id as Y,
7072
7066
  Sr as Z,
7073
7067
  br as _,
@@ -7085,14 +7079,14 @@ export {
7085
7079
  Dn as l,
7086
7080
  Fn as m,
7087
7081
  Ln as n,
7088
- qn as o,
7082
+ Yn as o,
7089
7083
  Xn as p,
7090
7084
  aa as q,
7091
7085
  $o as r,
7092
7086
  la as s,
7093
7087
  Sd as t,
7094
- ma as u,
7095
- ka as v,
7088
+ ha as u,
7089
+ Ta as v,
7096
7090
  ja as w,
7097
7091
  xa as x,
7098
7092
  Fa as y,