@doist/todoist-mcp 14.0.0 → 14.0.1
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.
- package/dist/index.d.ts +22 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/main-http.js +2 -2
- package/dist/main.js +1 -1
- package/dist/{mcp-server-DY_eceeG.js → mcp-server-Ct6wMUZG.js} +469 -430
- package/dist/{require-valid-todoist-token-B0G0XLuO.js → require-valid-todoist-token-Bt965UvN.js} +1 -1
- package/dist/tool-registry.d.ts +22 -11
- package/dist/tool-registry.d.ts.map +1 -1
- package/dist/tools/reschedule-tasks.d.ts +22 -11
- package/dist/tools/reschedule-tasks.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -2,16 +2,16 @@ import { ResourceTemplate as jo, McpServer as $o } from "@modelcontextprotocol/s
|
|
|
2
2
|
import { createHash as ps, randomUUID as Ke } from "node:crypto";
|
|
3
3
|
import { readFileSync as Ao } from "node:fs";
|
|
4
4
|
import { dirname as hs, join as qe } from "node:path";
|
|
5
|
-
import { fileURLToPath as
|
|
5
|
+
import { fileURLToPath as Eo } from "node:url";
|
|
6
6
|
import { RESOURCE_MIME_TYPE as Ge } from "@modelcontextprotocol/ext-apps/server";
|
|
7
|
-
import { createToolRegistrar as
|
|
7
|
+
import { createToolRegistrar as Do } from "@doist/mcp-core";
|
|
8
8
|
import ue, { ZodError as xo, z as o } from "zod";
|
|
9
9
|
import { AsyncLocalStorage as Oo } from "node:async_hooks";
|
|
10
10
|
import { createRequire as Uo } from "node:module";
|
|
11
|
-
import { TodoistApi as _o, formatUserShortName as ms, isWorkspaceProject as F, isPersonalProject as z, colors as ze, LOCATION_TRIGGERS as fs, REMINDER_TYPES as
|
|
11
|
+
import { TodoistApi as _o, formatUserShortName as ms, isWorkspaceProject as F, isPersonalProject as z, colors as ze, LOCATION_TRIGGERS as fs, REMINDER_TYPES as Ro, TodoistSyncError as Po, TodoistRequestError as No, createCommand as ne, PROJECT_VIEW_STYLES as bs, REMINDER_DELIVERY_SERVICES as Lo, HEALTH_STATUSES as ct, getTaskUrl as gs, getProjectUrl as ys, ACTIVITY_EVENT_TYPES as Mo, ACTIVITY_OBJECT_TYPES as Ts, escapeFilterToken as ws, parseTodoistUrl as Fo, WORKSPACE_ROLES as Ho, WORKSPACE_PLANS as Wo } from "@doist/todoist-sdk";
|
|
12
12
|
import { addDays as Ye, formatISO as xt } from "date-fns";
|
|
13
13
|
import { generateNKeysBetween as ks } from "fractional-indexing";
|
|
14
|
-
const dt = 3600 * 1e3, Bo = 365 * 24 * dt,
|
|
14
|
+
const dt = 3600 * 1e3, Bo = 365 * 24 * dt, E = {
|
|
15
15
|
/** Default limit for task listings */
|
|
16
16
|
TASKS_DEFAULT: 10,
|
|
17
17
|
/** Maximum limit for task search and list operations */
|
|
@@ -44,7 +44,7 @@ const dt = 3600 * 1e3, Bo = 365 * 24 * dt, D = {
|
|
|
44
44
|
LABELS_DEFAULT: 50,
|
|
45
45
|
/** Maximum limit for label listings */
|
|
46
46
|
LABELS_MAX: 200
|
|
47
|
-
},
|
|
47
|
+
}, Ce = {
|
|
48
48
|
/** Maximum number of failures to show in detailed error messages */
|
|
49
49
|
MAX_FAILURES_SHOWN: 3
|
|
50
50
|
}, Ko = {
|
|
@@ -76,7 +76,7 @@ const dt = 3600 * 1e3, Bo = 365 * 24 * dt, D = {
|
|
|
76
76
|
* queue (serialised moves to 100 distinct destinations is roughly 15s).
|
|
77
77
|
*/
|
|
78
78
|
QUEUE_WAIT_MS: 3e4
|
|
79
|
-
}, Ot = hs(
|
|
79
|
+
}, Ot = hs(Eo(import.meta.url)), qo = [
|
|
80
80
|
qe(Ot, "task-list", "index.html"),
|
|
81
81
|
qe(Ot, "mcp-apps", "index.html")
|
|
82
82
|
], Go = `<!doctype html>
|
|
@@ -407,7 +407,7 @@ class ut extends Error {
|
|
|
407
407
|
super(t), this.name = "DueStringParseError";
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
|
-
function
|
|
410
|
+
function D(e) {
|
|
411
411
|
if (e instanceof ut)
|
|
412
412
|
return e.message;
|
|
413
413
|
const t = lt(e);
|
|
@@ -435,7 +435,7 @@ function dr(e) {
|
|
|
435
435
|
const t = lt(e);
|
|
436
436
|
return t ? ar(t) : Cs(e);
|
|
437
437
|
}
|
|
438
|
-
const lr = "14.0.
|
|
438
|
+
const lr = "14.0.1", ur = {
|
|
439
439
|
version: lr
|
|
440
440
|
};
|
|
441
441
|
function _t(e, { queueTimeoutMs: t = Ve.QUEUE_WAIT_MS } = {}) {
|
|
@@ -489,12 +489,12 @@ function pt() {
|
|
|
489
489
|
const pr = 1e4, hr = 5 * 6e4, G = /* @__PURE__ */ new Map();
|
|
490
490
|
let mr = pr;
|
|
491
491
|
const js = /* @__PURE__ */ new WeakMap(), re = /* @__PURE__ */ new Map();
|
|
492
|
-
let
|
|
492
|
+
let Rt, Pt;
|
|
493
493
|
function fr() {
|
|
494
|
-
return
|
|
494
|
+
return Rt ??= pt(), Rt;
|
|
495
495
|
}
|
|
496
496
|
function Nt() {
|
|
497
|
-
return
|
|
497
|
+
return Pt ??= pt(), Pt;
|
|
498
498
|
}
|
|
499
499
|
function br(e) {
|
|
500
500
|
return ps("sha256").update(e).digest("hex");
|
|
@@ -562,7 +562,7 @@ function vr(e, t) {
|
|
|
562
562
|
const s = br(t);
|
|
563
563
|
js.set(e, s);
|
|
564
564
|
}
|
|
565
|
-
function
|
|
565
|
+
function Es(e, t) {
|
|
566
566
|
const s = js.get(e);
|
|
567
567
|
return s ? (As(s, Date.now()), async (r) => {
|
|
568
568
|
const n = kr(s);
|
|
@@ -574,13 +574,13 @@ function Ds(e, t) {
|
|
|
574
574
|
}) : fr()[t];
|
|
575
575
|
}
|
|
576
576
|
function Ir(e) {
|
|
577
|
-
return
|
|
577
|
+
return Es(e, "moves");
|
|
578
578
|
}
|
|
579
579
|
function Sr(e) {
|
|
580
|
-
return
|
|
580
|
+
return Es(e, "writes");
|
|
581
581
|
}
|
|
582
|
-
const Cr = "todoist-mcp", ht = ur.version,
|
|
583
|
-
let
|
|
582
|
+
const Cr = "todoist-mcp", ht = ur.version, Ds = new Oo(), Mt = Uo(import.meta.url);
|
|
583
|
+
let De;
|
|
584
584
|
const jr = async () => {
|
|
585
585
|
const e = Mt.resolve("@doist/todoist-sdk"), t = qe(hs(e), "transport", "http-dispatcher.js");
|
|
586
586
|
return Mt(t);
|
|
@@ -592,15 +592,15 @@ function Ar() {
|
|
|
592
592
|
function xs(e) {
|
|
593
593
|
return e.trim().toLowerCase();
|
|
594
594
|
}
|
|
595
|
-
function
|
|
596
|
-
return
|
|
595
|
+
function Er(e, t) {
|
|
596
|
+
return Ds.run(xs(e), t);
|
|
597
597
|
}
|
|
598
|
-
function
|
|
598
|
+
function Dr({
|
|
599
599
|
label: e,
|
|
600
600
|
platform: t = "mcp",
|
|
601
601
|
sessionId: s = Ke()
|
|
602
602
|
} = {}) {
|
|
603
|
-
const r = e ? xs(e) :
|
|
603
|
+
const r = e ? xs(e) : Ds.getStore();
|
|
604
604
|
return {
|
|
605
605
|
"User-Agent": Ar(),
|
|
606
606
|
"doist-platform": t,
|
|
@@ -612,7 +612,7 @@ function Er({
|
|
|
612
612
|
}
|
|
613
613
|
function xr(e, t) {
|
|
614
614
|
const s = new Headers(e);
|
|
615
|
-
for (const [r, n] of Object.entries(
|
|
615
|
+
for (const [r, n] of Object.entries(Dr(t)))
|
|
616
616
|
s.set(r, n);
|
|
617
617
|
return Object.fromEntries(s.entries());
|
|
618
618
|
}
|
|
@@ -659,9 +659,9 @@ function Or(e, t) {
|
|
|
659
659
|
}
|
|
660
660
|
async function Ur() {
|
|
661
661
|
if (_r())
|
|
662
|
-
return
|
|
663
|
-
throw
|
|
664
|
-
})),
|
|
662
|
+
return De || (De = $r().then((e) => e.getDefaultTransport()).catch((e) => {
|
|
663
|
+
throw De = void 0, e;
|
|
664
|
+
})), De;
|
|
665
665
|
}
|
|
666
666
|
function _r() {
|
|
667
667
|
return typeof process < "u" && !!process.versions?.node;
|
|
@@ -672,11 +672,11 @@ async function Os(e, t) {
|
|
|
672
672
|
const s = await Ur();
|
|
673
673
|
return s ? (t.dispatcher = s.dispatcher, s.fetch ?? e) : e;
|
|
674
674
|
}
|
|
675
|
-
async function
|
|
675
|
+
async function Ou(e, t) {
|
|
676
676
|
const s = { ...t };
|
|
677
677
|
return (await Os(globalThis.fetch, s))(e, s);
|
|
678
678
|
}
|
|
679
|
-
function
|
|
679
|
+
function Rr(e) {
|
|
680
680
|
return {
|
|
681
681
|
ok: e.ok,
|
|
682
682
|
status: e.status,
|
|
@@ -687,7 +687,7 @@ function Pr(e) {
|
|
|
687
687
|
arrayBuffer: () => e.arrayBuffer()
|
|
688
688
|
};
|
|
689
689
|
}
|
|
690
|
-
function
|
|
690
|
+
function Pr(e = globalThis.fetch, t = {}) {
|
|
691
691
|
const s = e === globalThis.fetch, { enabled: r = !0, platform: n = "mcp", sessionId: i = Ke() } = t;
|
|
692
692
|
return async (a, c = {}) => {
|
|
693
693
|
const { timeout: d, headers: l, signal: u, ...p } = c, { signal: h, cleanup: f } = Or(u, d);
|
|
@@ -697,7 +697,7 @@ function Rr(e = globalThis.fetch, t = {}) {
|
|
|
697
697
|
signal: h,
|
|
698
698
|
...r ? { headers: xr(l, { platform: n, sessionId: i }) } : l !== void 0 ? { headers: l } : {}
|
|
699
699
|
}, g = await (s ? await Os(e, b) : e)(a, b);
|
|
700
|
-
return
|
|
700
|
+
return Rr(g);
|
|
701
701
|
} finally {
|
|
702
702
|
f();
|
|
703
703
|
}
|
|
@@ -708,7 +708,7 @@ function Nr(e, {
|
|
|
708
708
|
tracking: s
|
|
709
709
|
} = {}) {
|
|
710
710
|
const r = new _o(e, {
|
|
711
|
-
customFetch:
|
|
711
|
+
customFetch: Pr(globalThis.fetch, s),
|
|
712
712
|
...t ? { baseUrl: t } : {}
|
|
713
713
|
});
|
|
714
714
|
return vr(r, e), r;
|
|
@@ -830,7 +830,7 @@ const T = {
|
|
|
830
830
|
// OpenAI MCP tools
|
|
831
831
|
SEARCH: "search",
|
|
832
832
|
FETCH: "fetch"
|
|
833
|
-
},
|
|
833
|
+
}, Uu = {
|
|
834
834
|
/**
|
|
835
835
|
* Strips email addresses from tool outputs that expose user data.
|
|
836
836
|
* Affects: find-project-collaborators, find-completed-tasks
|
|
@@ -874,13 +874,13 @@ function Qr({
|
|
|
874
874
|
client: s,
|
|
875
875
|
features: r = []
|
|
876
876
|
}) {
|
|
877
|
-
const n = r.some((a) => a.name === "strip_emails"), i =
|
|
877
|
+
const n = r.some((a) => a.name === "strip_emails"), i = Do({
|
|
878
878
|
titlePrefix: "Todoist",
|
|
879
879
|
createContext: () => s,
|
|
880
880
|
formatError: dr,
|
|
881
881
|
structuredContentAsText: !zr,
|
|
882
882
|
wrapExecute: async (a, c) => {
|
|
883
|
-
const d = await
|
|
883
|
+
const d = await Er(a.name, () => $(c));
|
|
884
884
|
return !n || !Zr(a.name) ? d : {
|
|
885
885
|
...d,
|
|
886
886
|
textContent: d.textContent && Xr(d.textContent),
|
|
@@ -1026,31 +1026,31 @@ function rn(e) {
|
|
|
1026
1026
|
]
|
|
1027
1027
|
};
|
|
1028
1028
|
}
|
|
1029
|
-
const
|
|
1029
|
+
const Ie = {
|
|
1030
1030
|
name: "productivity-analysis",
|
|
1031
1031
|
title: "Productivity Analysis",
|
|
1032
1032
|
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.",
|
|
1033
1033
|
argsSchema: en,
|
|
1034
1034
|
callback: rn
|
|
1035
|
-
}, _s = 'The duration of the task. Use format: "2h" (hours), "90m" (minutes), "2h30m" (combined), "1.5h" (decimal hours), or "3d" (whole days; days cannot be combined with hours or minutes). Todoist apps only display durations under 24 hours: a longer or day-based duration is stored and reported by this server, but the apps show the task as having no duration.',
|
|
1036
|
-
class
|
|
1035
|
+
}, _s = 'The duration of the task. Use format: "2h" (hours), "90m" (minutes), "2h30m" (combined), "1.5h" (decimal hours), or "3d" (whole days; days cannot be combined with hours or minutes). Todoist apps only display durations under 24 hours: a longer or day-based duration is stored and reported by this server, but the apps show the task as having no duration.', Rs = 'Use format like "2h", "30m", "2h30m", "1.5h", or "3d"';
|
|
1036
|
+
class R extends Error {
|
|
1037
1037
|
constructor(t, s) {
|
|
1038
1038
|
super(`Invalid duration format "${t}": ${s}`), this.name = "DurationParseError";
|
|
1039
1039
|
}
|
|
1040
1040
|
}
|
|
1041
1041
|
function nn(e) {
|
|
1042
1042
|
if (!e || typeof e != "string")
|
|
1043
|
-
throw new
|
|
1043
|
+
throw new R(e, "Duration must be a non-empty string");
|
|
1044
1044
|
const t = e.trim().toLowerCase().replace(/\s+/g, "");
|
|
1045
1045
|
if (!t)
|
|
1046
|
-
throw new
|
|
1046
|
+
throw new R(e, "Duration must be a non-empty string");
|
|
1047
1047
|
const s = t.match(/^(\d+(?:\.\d+)?)d$/)?.[1];
|
|
1048
1048
|
if (s !== void 0)
|
|
1049
1049
|
return { amount: cn(e, s), unit: "day" };
|
|
1050
1050
|
if (an(t))
|
|
1051
|
-
throw new
|
|
1051
|
+
throw new R(
|
|
1052
1052
|
e,
|
|
1053
|
-
`${
|
|
1053
|
+
`${Rs} (days cannot be combined with hours or minutes)`
|
|
1054
1054
|
);
|
|
1055
1055
|
return { amount: dn(e, t), unit: "minute" };
|
|
1056
1056
|
}
|
|
@@ -1061,51 +1061,51 @@ const ot = "Duration is too large";
|
|
|
1061
1061
|
function cn(e, t) {
|
|
1062
1062
|
const s = Number.parseFloat(t);
|
|
1063
1063
|
if (Number.isNaN(s) || s < 0)
|
|
1064
|
-
throw new
|
|
1064
|
+
throw new R(e, "Days must be a positive number");
|
|
1065
1065
|
if (!Number.isFinite(s))
|
|
1066
|
-
throw new
|
|
1066
|
+
throw new R(e, ot);
|
|
1067
1067
|
if (s % 1 !== 0)
|
|
1068
|
-
throw new
|
|
1068
|
+
throw new R(e, "Days must be a whole number");
|
|
1069
1069
|
if (s === 0)
|
|
1070
|
-
throw new
|
|
1070
|
+
throw new R(e, "Duration must be at least 1 day");
|
|
1071
1071
|
return s;
|
|
1072
1072
|
}
|
|
1073
1073
|
function dn(e, t) {
|
|
1074
1074
|
const s = t.match(/^(?:(\d+(?:\.\d+)?)h)?(?:(\d+(?:\.\d+)?)m)?$/);
|
|
1075
1075
|
if (!s || !s[1] && !s[2])
|
|
1076
|
-
throw new
|
|
1076
|
+
throw new R(e, Rs);
|
|
1077
1077
|
let r = 0;
|
|
1078
1078
|
const [, n, i] = s;
|
|
1079
1079
|
if (n) {
|
|
1080
1080
|
const a = Number.parseFloat(n);
|
|
1081
1081
|
if (Number.isNaN(a) || a < 0)
|
|
1082
|
-
throw new
|
|
1082
|
+
throw new R(e, "Hours must be a positive number");
|
|
1083
1083
|
r += a * 60;
|
|
1084
1084
|
}
|
|
1085
1085
|
if (i) {
|
|
1086
1086
|
const a = Number.parseFloat(i);
|
|
1087
1087
|
if (Number.isNaN(a) || a < 0)
|
|
1088
|
-
throw new
|
|
1088
|
+
throw new R(e, "Minutes must be a positive number");
|
|
1089
1089
|
if (!Number.isFinite(a))
|
|
1090
|
-
throw new
|
|
1090
|
+
throw new R(e, ot);
|
|
1091
1091
|
if (a % 1 !== 0)
|
|
1092
|
-
throw new
|
|
1092
|
+
throw new R(
|
|
1093
1093
|
e,
|
|
1094
1094
|
"Minutes must be a whole number (use decimal hours instead)"
|
|
1095
1095
|
);
|
|
1096
1096
|
r += a;
|
|
1097
1097
|
}
|
|
1098
1098
|
if (r = Math.round(r), !Number.isFinite(r))
|
|
1099
|
-
throw new
|
|
1099
|
+
throw new R(e, ot);
|
|
1100
1100
|
if (r === 0)
|
|
1101
|
-
throw new
|
|
1101
|
+
throw new R(e, "Duration must be greater than 0 minutes");
|
|
1102
1102
|
return r;
|
|
1103
1103
|
}
|
|
1104
1104
|
function mt(e, t) {
|
|
1105
1105
|
try {
|
|
1106
1106
|
return nn(t);
|
|
1107
1107
|
} catch (s) {
|
|
1108
|
-
throw s instanceof
|
|
1108
|
+
throw s instanceof R ? new Error(`${e}: ${s.message}`) : s;
|
|
1109
1109
|
}
|
|
1110
1110
|
}
|
|
1111
1111
|
function ln(e, t = "minute") {
|
|
@@ -1116,7 +1116,7 @@ function ln(e, t = "minute") {
|
|
|
1116
1116
|
return s === 0 ? `${r}m` : r === 0 ? `${s}h` : `${s}h${r}m`;
|
|
1117
1117
|
}
|
|
1118
1118
|
const un = ["p1", "p2", "p3", "p4"], ft = 'Task priority as a string: "p1" (highest), "p2" (high), "p3" (medium), or "p4" (lowest/default). Integers like 1, 2, 3, or 4 are not accepted.', bt = o.enum(un).describe(ft);
|
|
1119
|
-
function
|
|
1119
|
+
function Ps(e) {
|
|
1120
1120
|
return { p1: 4, p2: 3, p3: 2, p4: 1 }[e];
|
|
1121
1121
|
}
|
|
1122
1122
|
function pn(e) {
|
|
@@ -1417,21 +1417,21 @@ async function Ws(e, t) {
|
|
|
1417
1417
|
return K({
|
|
1418
1418
|
apiMethod: e.searchProjects.bind(e),
|
|
1419
1419
|
args: { query: yt(t) },
|
|
1420
|
-
limit:
|
|
1420
|
+
limit: E.PROJECTS_MAX
|
|
1421
1421
|
});
|
|
1422
1422
|
}
|
|
1423
1423
|
async function Bs(e) {
|
|
1424
1424
|
return K({
|
|
1425
1425
|
apiMethod: (t) => $(() => e.getProjects(t)),
|
|
1426
1426
|
args: {},
|
|
1427
|
-
limit:
|
|
1427
|
+
limit: E.PROJECTS_MAX
|
|
1428
1428
|
});
|
|
1429
1429
|
}
|
|
1430
1430
|
async function yn(e) {
|
|
1431
1431
|
return K({
|
|
1432
1432
|
apiMethod: e.getArchivedProjects.bind(e),
|
|
1433
1433
|
args: {},
|
|
1434
|
-
limit:
|
|
1434
|
+
limit: E.PROJECTS_MAX
|
|
1435
1435
|
});
|
|
1436
1436
|
}
|
|
1437
1437
|
function Tn(e) {
|
|
@@ -1447,14 +1447,14 @@ async function wn(e, t) {
|
|
|
1447
1447
|
return K({
|
|
1448
1448
|
apiMethod: e.searchLabels.bind(e),
|
|
1449
1449
|
args: { query: yt(t) },
|
|
1450
|
-
limit:
|
|
1450
|
+
limit: E.LABELS_MAX
|
|
1451
1451
|
});
|
|
1452
1452
|
}
|
|
1453
1453
|
async function kn(e) {
|
|
1454
1454
|
return K({
|
|
1455
1455
|
apiMethod: e.getSharedLabels.bind(e),
|
|
1456
1456
|
args: {},
|
|
1457
|
-
limit:
|
|
1457
|
+
limit: E.LABELS_MAX
|
|
1458
1458
|
});
|
|
1459
1459
|
}
|
|
1460
1460
|
async function vn(e, t, s) {
|
|
@@ -1462,7 +1462,7 @@ async function vn(e, t, s) {
|
|
|
1462
1462
|
return K({
|
|
1463
1463
|
apiMethod: e.searchSections.bind(e),
|
|
1464
1464
|
args: s ? { query: r, projectId: s } : { query: r },
|
|
1465
|
-
limit:
|
|
1465
|
+
limit: E.SECTIONS_MAX
|
|
1466
1466
|
});
|
|
1467
1467
|
}
|
|
1468
1468
|
function H(e) {
|
|
@@ -1506,7 +1506,7 @@ function ce(e) {
|
|
|
1506
1506
|
isArchived: e.isArchived
|
|
1507
1507
|
};
|
|
1508
1508
|
}
|
|
1509
|
-
function
|
|
1509
|
+
function $e(e) {
|
|
1510
1510
|
return {
|
|
1511
1511
|
id: e.id,
|
|
1512
1512
|
taskId: e.taskId ?? void 0,
|
|
@@ -1584,7 +1584,7 @@ function Ht(e) {
|
|
|
1584
1584
|
timezone: e.timezone ?? void 0
|
|
1585
1585
|
};
|
|
1586
1586
|
}
|
|
1587
|
-
function
|
|
1587
|
+
function je(e) {
|
|
1588
1588
|
const t = {
|
|
1589
1589
|
id: e.id,
|
|
1590
1590
|
taskId: e.itemId,
|
|
@@ -1673,12 +1673,12 @@ function Bt(e, t) {
|
|
|
1673
1673
|
return [...s];
|
|
1674
1674
|
}
|
|
1675
1675
|
const Ue = ze.map((e) => e.key);
|
|
1676
|
-
function
|
|
1676
|
+
function En(e) {
|
|
1677
1677
|
if (typeof e != "string") return;
|
|
1678
1678
|
const t = e.toLowerCase();
|
|
1679
1679
|
return (ze.find((r) => r.key === t) ?? ze.find((r) => r.displayName.toLowerCase() === t))?.key;
|
|
1680
1680
|
}
|
|
1681
|
-
const
|
|
1681
|
+
const Dn = `Color for the entity. Accepts a color key (e.g. "berry_red") or display name (e.g. "Berry Red"). Valid colors: ${Ue.join(", ")}. Unrecognized colors are omitted and charcoal will be used as the default.`, Te = o.preprocess(En, o.enum(Ue).optional()).describe(Dn);
|
|
1682
1682
|
o.enum(Ue);
|
|
1683
1683
|
const we = o.enum(Ue).optional().catch(void 0), V = o.object({
|
|
1684
1684
|
id: o.string(),
|
|
@@ -1736,7 +1736,7 @@ const xn = o.object({
|
|
|
1736
1736
|
image: o.string().optional().describe("For image resource types."),
|
|
1737
1737
|
imageWidth: o.number().optional().describe("Pixels."),
|
|
1738
1738
|
imageHeight: o.number().optional().describe("Pixels.")
|
|
1739
|
-
}),
|
|
1739
|
+
}), Ae = o.object({
|
|
1740
1740
|
id: o.string(),
|
|
1741
1741
|
taskId: o.string().optional(),
|
|
1742
1742
|
projectId: o.string().optional(),
|
|
@@ -1774,7 +1774,7 @@ const xn = o.object({
|
|
|
1774
1774
|
}), wt = o.object({
|
|
1775
1775
|
id: o.string(),
|
|
1776
1776
|
taskId: o.string(),
|
|
1777
|
-
type: o.enum(
|
|
1777
|
+
type: o.enum(Ro),
|
|
1778
1778
|
notifyUid: o.string().optional().describe("User ID the reminder notifies."),
|
|
1779
1779
|
minuteOffset: o.number().optional().describe("Minutes before due. Relative reminders only."),
|
|
1780
1780
|
due: _n.optional().describe("Absolute, and sometimes relative, reminders."),
|
|
@@ -1814,30 +1814,30 @@ function vt(e) {
|
|
|
1814
1814
|
${n.map((l) => ` ${l}`).join(`
|
|
1815
1815
|
`)}.`), a?.length) {
|
|
1816
1816
|
const l = a.length, u = `Failed (${l}):
|
|
1817
|
-
${a.slice(0,
|
|
1817
|
+
${a.slice(0, Ce.MAX_FAILURES_SHOWN).map((p) => ` ${p.item} (Error: ${p.error}${p.code ? ` [${p.code}]` : ""})`).join(
|
|
1818
1818
|
`
|
|
1819
1819
|
`
|
|
1820
|
-
)}${l >
|
|
1820
|
+
)}${l > Ce.MAX_FAILURES_SHOWN ? `, +${l - Ce.MAX_FAILURES_SHOWN} more` : ""}.`;
|
|
1821
1821
|
c.push(u);
|
|
1822
1822
|
}
|
|
1823
1823
|
return c.join(`
|
|
1824
1824
|
`);
|
|
1825
1825
|
}
|
|
1826
|
-
function
|
|
1826
|
+
function P(e, t) {
|
|
1827
1827
|
if (t.length === 0)
|
|
1828
1828
|
return e;
|
|
1829
|
-
const s = t.slice(0,
|
|
1829
|
+
const s = t.slice(0, Ce.MAX_FAILURES_SHOWN), r = t.length - s.length, n = s.map((a) => ` ${a.item}: ${a.error}`).join(`
|
|
1830
1830
|
`), i = r > 0 ? `
|
|
1831
1831
|
+${r} more` : "";
|
|
1832
1832
|
return `${e}
|
|
1833
1833
|
Failed (${t.length}) - address or drop these items:
|
|
1834
1834
|
${n}${i}`;
|
|
1835
1835
|
}
|
|
1836
|
-
function
|
|
1836
|
+
function Rn(e, t) {
|
|
1837
1837
|
const s = e.content || e.title || "Untitled", r = e.dueDate ? ` • due ${e.dueDate}` : "", n = e.priority ? ` • ${e.priority.toUpperCase()}` : "", i = e.projectName ? ` • ${e.projectName}` : "", a = t && e.responsibleUid ? ` • +${t.get(e.responsibleUid) ?? e.responsibleUid}` : "", c = e.id ? ` • id=${e.id}` : "";
|
|
1838
1838
|
return ` ${s}${r}${n}${i}${a}${c}`;
|
|
1839
1839
|
}
|
|
1840
|
-
function
|
|
1840
|
+
function Pn(e) {
|
|
1841
1841
|
const t = ` (${e.color})`, s = e.isFavorite ? " • ⭐" : "", r = ` • id=${e.id}`;
|
|
1842
1842
|
return ` ${e.name}${t}${s}${r}`;
|
|
1843
1843
|
}
|
|
@@ -1846,7 +1846,7 @@ function Nn(e) {
|
|
|
1846
1846
|
return ` ${e.name}${t}${s}${r}${n}${i}${a}`;
|
|
1847
1847
|
}
|
|
1848
1848
|
function _e(e, t = 5, s) {
|
|
1849
|
-
const n = e.slice(0, t).map((i) =>
|
|
1849
|
+
const n = e.slice(0, t).map((i) => Rn(i, s)).join(`
|
|
1850
1850
|
`);
|
|
1851
1851
|
if (e.length > t) {
|
|
1852
1852
|
const i = e.length - t;
|
|
@@ -1882,13 +1882,13 @@ const Ln = o.object({
|
|
|
1882
1882
|
'The ID of the project to comment on. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
1883
1883
|
),
|
|
1884
1884
|
content: o.string().min(1).describe("The content of the comment."),
|
|
1885
|
-
notifyUsers: o.array(o.string().min(1)).min(1).max(
|
|
1885
|
+
notifyUsers: o.array(o.string().min(1)).min(1).max(E.NOTIFY_USERS_MAX).optional().describe(
|
|
1886
1886
|
`Who to notify about this comment — a user ID, email, full name, or "me" for each person. Set this whenever the comment mentions someone; the text of an @mention notifies nobody on its own. Omit to notify whoever the Todoist apps would (the task's assignee, assigner and creator on a first comment, or the previous comment's participants on a reply). Pass ["${qs}"] to notify nobody.`
|
|
1887
1887
|
)
|
|
1888
1888
|
}), Mn = {
|
|
1889
1889
|
comments: o.array(Ln).min(1).describe("The array of comments to add.")
|
|
1890
1890
|
}, Fn = {
|
|
1891
|
-
comments: o.array(
|
|
1891
|
+
comments: o.array(Ae).describe("The created comments."),
|
|
1892
1892
|
totalCount: o.number().describe("The total number of comments created."),
|
|
1893
1893
|
addedCommentIds: o.array(o.string()).describe("The IDs of the added comments."),
|
|
1894
1894
|
failures: o.array(_).describe(
|
|
@@ -1947,9 +1947,9 @@ const Ln = o.object({
|
|
|
1947
1947
|
})
|
|
1948
1948
|
), p = [], h = [];
|
|
1949
1949
|
u.forEach((m, g) => {
|
|
1950
|
-
m.status === "fulfilled" ? p.push(
|
|
1950
|
+
m.status === "fulfilled" ? p.push($e(m.value)) : h.push({
|
|
1951
1951
|
item: s[g]?.content ?? `Comment ${g + 1}`,
|
|
1952
|
-
error:
|
|
1952
|
+
error: D(m.reason)
|
|
1953
1953
|
});
|
|
1954
1954
|
}), U(T.ADD_COMMENTS, s.length, h, { redactItems: !0 });
|
|
1955
1955
|
const f = await Bn(t, p, {
|
|
@@ -1957,7 +1957,7 @@ const Ln = o.object({
|
|
|
1957
1957
|
getCurrentUser: n
|
|
1958
1958
|
});
|
|
1959
1959
|
return {
|
|
1960
|
-
textContent:
|
|
1960
|
+
textContent: P(
|
|
1961
1961
|
Kn({ comments: p, notifiedNames: f }),
|
|
1962
1962
|
h
|
|
1963
1963
|
),
|
|
@@ -2021,13 +2021,13 @@ function N(e) {
|
|
|
2021
2021
|
return o.string().transform((t) => t === "" ? void 0 : t).optional().describe(e);
|
|
2022
2022
|
}
|
|
2023
2023
|
const qn = { status: "fulfilled", value: void 0 };
|
|
2024
|
-
async function
|
|
2024
|
+
async function ve(e, t) {
|
|
2025
2025
|
let s, r;
|
|
2026
2026
|
try {
|
|
2027
2027
|
const i = await $(() => e.sync({ commands: t }));
|
|
2028
2028
|
s = i.syncStatus ?? {}, r = i.tempIdMapping ?? {};
|
|
2029
2029
|
} catch (i) {
|
|
2030
|
-
if (!(i instanceof
|
|
2030
|
+
if (!(i instanceof Po))
|
|
2031
2031
|
return {
|
|
2032
2032
|
outcomes: t.map(() => ({ status: "rejected", reason: i })),
|
|
2033
2033
|
tempIdMapping: {}
|
|
@@ -2151,13 +2151,13 @@ const Jn = o.object({
|
|
|
2151
2151
|
...h.isFavorite !== void 0 ? { isFavorite: h.isFavorite } : {}
|
|
2152
2152
|
},
|
|
2153
2153
|
r[f]
|
|
2154
|
-
)), { outcomes: i, tempIdMapping: a } = await
|
|
2154
|
+
)), { outcomes: i, tempIdMapping: a } = await ve(t, n), c = [], d = [];
|
|
2155
2155
|
e.forEach((h, f) => {
|
|
2156
2156
|
const b = i[f], m = r[f], g = m !== void 0 ? a[m] : void 0;
|
|
2157
2157
|
if (b?.status !== "fulfilled" || !g) {
|
|
2158
2158
|
d.push({
|
|
2159
2159
|
item: h.name,
|
|
2160
|
-
error: b?.status === "rejected" ?
|
|
2160
|
+
error: b?.status === "rejected" ? D(b.reason) : "Todoist did not return an ID for the created filter"
|
|
2161
2161
|
});
|
|
2162
2162
|
return;
|
|
2163
2163
|
}
|
|
@@ -2178,7 +2178,7 @@ const Jn = o.object({
|
|
|
2178
2178
|
`), p = l > 0 ? `Added ${l} filter${l === 1 ? "" : "s"}:
|
|
2179
2179
|
${u}` : "Added 0 filters";
|
|
2180
2180
|
return {
|
|
2181
|
-
textContent:
|
|
2181
|
+
textContent: P(p, d),
|
|
2182
2182
|
structuredContent: {
|
|
2183
2183
|
filters: c,
|
|
2184
2184
|
totalCount: c.length,
|
|
@@ -2216,7 +2216,7 @@ ${u}` : "Added 0 filters";
|
|
|
2216
2216
|
return s.forEach((a, c) => {
|
|
2217
2217
|
a.status === "fulfilled" ? r.push(a.value) : n.push({
|
|
2218
2218
|
item: e[c]?.name ?? `Label ${c + 1}`,
|
|
2219
|
-
error:
|
|
2219
|
+
error: D(a.reason)
|
|
2220
2220
|
});
|
|
2221
2221
|
}), U(T.ADD_LABELS, e.length, n, { redactItems: !0 }), {
|
|
2222
2222
|
textContent: ri({ labels: r, failures: n }),
|
|
@@ -2238,7 +2238,7 @@ function ri({
|
|
|
2238
2238
|
const s = e.length, r = e.map((i) => `• ${i.name} (id=${i.id})`).join(`
|
|
2239
2239
|
`), n = s > 0 ? `Added ${s} label${s === 1 ? "" : "s"}:
|
|
2240
2240
|
${r}` : "Added 0 labels";
|
|
2241
|
-
return
|
|
2241
|
+
return P(n, t);
|
|
2242
2242
|
}
|
|
2243
2243
|
async function St(e, t) {
|
|
2244
2244
|
try {
|
|
@@ -2370,7 +2370,7 @@ const Ys = new ai(), ci = o.object({
|
|
|
2370
2370
|
i.forEach((u, p) => {
|
|
2371
2371
|
u.status === "fulfilled" ? a.push(u.value) : c.push({
|
|
2372
2372
|
item: e[p]?.name ?? `Project ${p + 1}`,
|
|
2373
|
-
error:
|
|
2373
|
+
error: D(u.reason)
|
|
2374
2374
|
});
|
|
2375
2375
|
});
|
|
2376
2376
|
const d = a.map(ce);
|
|
@@ -2420,7 +2420,7 @@ function mi({
|
|
|
2420
2420
|
const s = e.length, r = e.map((i) => `• ${i.name} (id=${i.id})`).join(`
|
|
2421
2421
|
`), n = s > 0 ? `Added ${s} project${s === 1 ? "" : "s"}:
|
|
2422
2422
|
${r}` : "Added 0 projects";
|
|
2423
|
-
return
|
|
2423
|
+
return P(n, t);
|
|
2424
2424
|
}
|
|
2425
2425
|
async function Vs(e, t) {
|
|
2426
2426
|
const s = /* @__PURE__ */ new Map();
|
|
@@ -2452,12 +2452,12 @@ function Js(e, t) {
|
|
|
2452
2452
|
];
|
|
2453
2453
|
});
|
|
2454
2454
|
}
|
|
2455
|
-
const xe = 25,
|
|
2455
|
+
const xe = 25, Re = o.enum(Lo), Xs = o.object({
|
|
2456
2456
|
date: o.string().optional().describe("Due date in YYYY-MM-DD format."),
|
|
2457
2457
|
string: o.string().optional().describe('Natural language due string, e.g. "tomorrow at 3pm".'),
|
|
2458
2458
|
timezone: o.string().optional().describe('Timezone for the reminder, e.g. "America/New_York".'),
|
|
2459
2459
|
lang: o.string().optional().describe('Language for parsing the due string, e.g. "en".')
|
|
2460
|
-
}), Zs = o.enum(fs),
|
|
2460
|
+
}), Zs = o.enum(fs), Pe = o.boolean().optional().describe("Whether this is an urgent reminder. Applies to relative and absolute reminders."), Qs = `Who to remind: user ID, email, name, or "me". Must collaborate on the task's project.`, jt = N(
|
|
2461
2461
|
`${Qs} Defaults to the creator.`
|
|
2462
2462
|
), $t = N(
|
|
2463
2463
|
`${Qs} Omit to keep the current one.`
|
|
@@ -2467,19 +2467,19 @@ const xe = 25, Pe = o.enum(Lo), Xs = o.object({
|
|
|
2467
2467
|
minuteOffset: o.number().int().min(0).describe(
|
|
2468
2468
|
"Minutes before the task due time to trigger the reminder. E.g., 30 for 30 minutes before, 60 for 1 hour before, 1440 for 1 day before."
|
|
2469
2469
|
),
|
|
2470
|
-
service:
|
|
2470
|
+
service: Re.optional().describe(
|
|
2471
2471
|
'Delivery method: "email" or "push" notification. Defaults to push.'
|
|
2472
2472
|
),
|
|
2473
|
-
isUrgent:
|
|
2473
|
+
isUrgent: Pe,
|
|
2474
2474
|
notifyUser: jt
|
|
2475
2475
|
}), bi = o.object({
|
|
2476
2476
|
type: o.literal("absolute"),
|
|
2477
2477
|
taskId: o.string().min(1).describe("The ID of the task to set a reminder for."),
|
|
2478
2478
|
due: Xs.describe("The specific date/time for the reminder."),
|
|
2479
|
-
service:
|
|
2479
|
+
service: Re.optional().describe(
|
|
2480
2480
|
'Delivery method: "email" or "push" notification. Defaults to push.'
|
|
2481
2481
|
),
|
|
2482
|
-
isUrgent:
|
|
2482
|
+
isUrgent: Pe,
|
|
2483
2483
|
notifyUser: jt
|
|
2484
2484
|
}), gi = o.object({
|
|
2485
2485
|
type: o.literal("location"),
|
|
@@ -2569,16 +2569,16 @@ const xe = 25, Pe = o.enum(Lo), Xs = o.object({
|
|
|
2569
2569
|
), i = [], a = [], c = [];
|
|
2570
2570
|
return n.forEach((l, u) => {
|
|
2571
2571
|
if (l.status === "fulfilled") {
|
|
2572
|
-
i.push(
|
|
2572
|
+
i.push(je(l.value));
|
|
2573
2573
|
const p = r[u];
|
|
2574
2574
|
a.push(p?.status === "fulfilled" ? p.value : void 0);
|
|
2575
2575
|
} else
|
|
2576
2576
|
c.push({
|
|
2577
2577
|
item: `Reminder ${u + 1} on task ${s[u]?.taskId}`,
|
|
2578
|
-
error:
|
|
2578
|
+
error: D(l.reason)
|
|
2579
2579
|
});
|
|
2580
2580
|
}), U(T.ADD_REMINDERS, s.length, c), {
|
|
2581
|
-
textContent:
|
|
2581
|
+
textContent: P(
|
|
2582
2582
|
[
|
|
2583
2583
|
vi(i),
|
|
2584
2584
|
...Js(i, a)
|
|
@@ -2645,7 +2645,7 @@ const Ii = o.object({
|
|
|
2645
2645
|
return r.forEach((c, d) => {
|
|
2646
2646
|
c.status === "fulfilled" ? n.push(c.value) : i.push({
|
|
2647
2647
|
item: e[d]?.name ?? `Section ${d + 1}`,
|
|
2648
|
-
error:
|
|
2648
|
+
error: D(c.reason)
|
|
2649
2649
|
});
|
|
2650
2650
|
}), U(T.ADD_SECTIONS, e.length, i, { redactItems: !0 }), {
|
|
2651
2651
|
textContent: $i({ sections: n, failures: i }),
|
|
@@ -2667,7 +2667,7 @@ function $i({
|
|
|
2667
2667
|
const s = e.length, r = e.map((i) => `• ${i.name} (id=${i.id}, projectId=${i.projectId})`).join(`
|
|
2668
2668
|
`), n = s > 0 ? `Added ${s} section${s === 1 ? "" : "s"}:
|
|
2669
2669
|
${r}` : "Added 0 sections";
|
|
2670
|
-
return
|
|
2670
|
+
return P(n, t);
|
|
2671
2671
|
}
|
|
2672
2672
|
const me = {
|
|
2673
2673
|
USER_NOT_FOUND: "USER_NOT_FOUND",
|
|
@@ -2887,7 +2887,7 @@ class Ai {
|
|
|
2887
2887
|
};
|
|
2888
2888
|
}
|
|
2889
2889
|
}
|
|
2890
|
-
const At = new Ai(), Kt = vs.TASKS_PER_OPERATION,
|
|
2890
|
+
const At = new Ai(), Kt = vs.TASKS_PER_OPERATION, Ei = o.object({
|
|
2891
2891
|
content: o.string().min(1).describe(
|
|
2892
2892
|
'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.'
|
|
2893
2893
|
),
|
|
@@ -2916,8 +2916,8 @@ const At = new Ai(), Kt = vs.TASKS_PER_OPERATION, Di = o.object({
|
|
|
2916
2916
|
"Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
|
|
2917
2917
|
)
|
|
2918
2918
|
}), qt = {
|
|
2919
|
-
tasks: o.array(
|
|
2920
|
-
},
|
|
2919
|
+
tasks: o.array(Ei).min(1).max(Kt).describe(`The array of tasks to add (max ${Kt}).`)
|
|
2920
|
+
}, Di = {
|
|
2921
2921
|
tasks: o.array(V).describe("The created tasks."),
|
|
2922
2922
|
totalCount: o.number().describe("The total number of tasks created."),
|
|
2923
2923
|
failures: o.array(_).describe("Tasks that could not be created, with the reason for each."),
|
|
@@ -2928,7 +2928,7 @@ const At = new Ai(), Kt = vs.TASKS_PER_OPERATION, Di = o.object({
|
|
|
2928
2928
|
name: T.ADD_TASKS,
|
|
2929
2929
|
description: "Add one or more tasks to a project, section, or parent. Supports assignment to project collaborators.",
|
|
2930
2930
|
parameters: qt,
|
|
2931
|
-
outputSchema:
|
|
2931
|
+
outputSchema: Di,
|
|
2932
2932
|
// Open world: assigning a task notifies the new assignee.
|
|
2933
2933
|
annotations: {
|
|
2934
2934
|
readOnlyHint: !1,
|
|
@@ -2964,7 +2964,7 @@ const At = new Ai(), Kt = vs.TASKS_PER_OPERATION, Di = o.object({
|
|
|
2964
2964
|
// Keep API error signals (status/code/tag) — `error.message`
|
|
2965
2965
|
// alone collapses e.g. a full-project rejection into a bare
|
|
2966
2966
|
// "HTTP 403: Forbidden"
|
|
2967
|
-
error:
|
|
2967
|
+
error: D(h.reason)
|
|
2968
2968
|
});
|
|
2969
2969
|
const l = c.map(H);
|
|
2970
2970
|
return U(T.ADD_TASKS, s.length, d, { redactItems: !0 }), {
|
|
@@ -3016,7 +3016,7 @@ async function Ui(e, t, s) {
|
|
|
3016
3016
|
labels: u,
|
|
3017
3017
|
deadlineDate: p
|
|
3018
3018
|
};
|
|
3019
|
-
if (l && (b.priority =
|
|
3019
|
+
if (l && (b.priority = Ps(l)), d && !f && !i && !a)
|
|
3020
3020
|
throw new Error(
|
|
3021
3021
|
`Task "${e.content}": Cannot assign tasks without specifying project context. Please specify a projectId, sectionId, or parentId.`
|
|
3022
3022
|
);
|
|
@@ -3091,11 +3091,11 @@ function _i({
|
|
|
3091
3091
|
showDetails: !0
|
|
3092
3092
|
});
|
|
3093
3093
|
}
|
|
3094
|
-
const
|
|
3094
|
+
const Ri = {
|
|
3095
3095
|
projectId: o.string().min(1).describe(
|
|
3096
3096
|
"The ID of the project to analyze. This triggers a new health analysis which may take some time to complete."
|
|
3097
3097
|
)
|
|
3098
|
-
},
|
|
3098
|
+
}, Pi = {
|
|
3099
3099
|
projectId: o.string().describe("The project ID."),
|
|
3100
3100
|
health: o.object({
|
|
3101
3101
|
status: o.enum(ct).describe("The health status after triggering analysis."),
|
|
@@ -3106,8 +3106,8 @@ const Pi = {
|
|
|
3106
3106
|
}, Ni = {
|
|
3107
3107
|
name: T.ANALYZE_PROJECT_HEALTH,
|
|
3108
3108
|
description: "Trigger a new health analysis for a project. Use this when the health data is stale or you want a fresh assessment. The analysis may take time to complete — use get-project-health afterward to see updated results.",
|
|
3109
|
-
parameters:
|
|
3110
|
-
outputSchema:
|
|
3109
|
+
parameters: Ri,
|
|
3110
|
+
outputSchema: Pi,
|
|
3111
3111
|
annotations: {
|
|
3112
3112
|
readOnlyHint: !1,
|
|
3113
3113
|
destructiveHint: !1,
|
|
@@ -3152,7 +3152,7 @@ ${n}`,
|
|
|
3152
3152
|
} catch (a) {
|
|
3153
3153
|
r.push({
|
|
3154
3154
|
item: i,
|
|
3155
|
-
error:
|
|
3155
|
+
error: D(a)
|
|
3156
3156
|
});
|
|
3157
3157
|
}
|
|
3158
3158
|
return U(T.COMPLETE_TASKS, e.ids.length, r), {
|
|
@@ -3330,7 +3330,7 @@ const Vi = V.pick({
|
|
|
3330
3330
|
"Direct children only: subtasks for a task, sub-projects for a project. Completed subtasks and archived sub-projects are excluded."
|
|
3331
3331
|
),
|
|
3332
3332
|
hasMoreChildren: o.boolean().optional().describe(
|
|
3333
|
-
`Present when the object has more than ${
|
|
3333
|
+
`Present when the object has more than ${E.CHILDREN_MAX} direct children and the list was truncated. Page through the rest with find-tasks by parentId for subtasks, or find-projects for sub-projects.`
|
|
3334
3334
|
),
|
|
3335
3335
|
childrenError: o.string().optional().describe(
|
|
3336
3336
|
'Present when the children lookup failed or returned incomplete information. When no children are listed alongside it, childCount is unknown - do not read its absence as "no children".'
|
|
@@ -3339,7 +3339,7 @@ const Vi = V.pick({
|
|
|
3339
3339
|
async function Zi(e, t) {
|
|
3340
3340
|
const { results: s, nextCursor: r } = await e.getTasks({
|
|
3341
3341
|
parentId: t,
|
|
3342
|
-
limit:
|
|
3342
|
+
limit: E.CHILDREN_MAX
|
|
3343
3343
|
}), n = await Promise.allSettled(
|
|
3344
3344
|
s.map(({ id: a }) => e.getTasks({ parentId: a, limit: 1 }))
|
|
3345
3345
|
), i = n.filter((a) => a.status === "rejected").length;
|
|
@@ -3368,7 +3368,7 @@ async function Qi(e, t) {
|
|
|
3368
3368
|
const c = r.get(a.parentId) ?? [];
|
|
3369
3369
|
c.push(a), r.set(a.parentId, c);
|
|
3370
3370
|
}
|
|
3371
|
-
const n = [...r.get(t.id) ?? []].sort((a, c) => a.childOrder - c.childOrder), i = n.slice(0,
|
|
3371
|
+
const n = [...r.get(t.id) ?? []].sort((a, c) => a.childOrder - c.childOrder), i = n.slice(0, E.CHILDREN_MAX);
|
|
3372
3372
|
return {
|
|
3373
3373
|
childCount: i.length,
|
|
3374
3374
|
children: i.map((a) => ({
|
|
@@ -3401,7 +3401,7 @@ const so = ["task", "project", "comment", "section"], ea = {
|
|
|
3401
3401
|
}, ta = {
|
|
3402
3402
|
type: o.enum(so).describe("The type of object fetched."),
|
|
3403
3403
|
id: o.string().describe("The ID of the fetched object."),
|
|
3404
|
-
object: o.union([V, de,
|
|
3404
|
+
object: o.union([V, de, Ae, Z]).describe("The fetched object data."),
|
|
3405
3405
|
...Xi
|
|
3406
3406
|
}, sa = {
|
|
3407
3407
|
name: T.FETCH_OBJECT,
|
|
@@ -3441,7 +3441,7 @@ const so = ["task", "project", "comment", "section"], ea = {
|
|
|
3441
3441
|
};
|
|
3442
3442
|
}
|
|
3443
3443
|
case "comment": {
|
|
3444
|
-
const i = await t.getComment(r), a =
|
|
3444
|
+
const i = await t.getComment(r), a = $e(i), c = a.content.length > 50 ? `${a.content.substring(0, 50)}...` : a.content;
|
|
3445
3445
|
return {
|
|
3446
3446
|
textContent: `Found comment • id=${a.id} • content="${c}" • posted=${a.postedAt}`,
|
|
3447
3447
|
structuredContent: {
|
|
@@ -3568,7 +3568,7 @@ const aa = {
|
|
|
3568
3568
|
dateTo: Vt(
|
|
3569
3569
|
'Exclusive end of the activity range, as an ISO 8601 date or date-time. For all events on 2026-08-02, use "2026-08-03T00:00:00-04:00". Natural-language dates such as "tomorrow" are not supported.'
|
|
3570
3570
|
),
|
|
3571
|
-
limit: o.number().int().min(1).max(
|
|
3571
|
+
limit: o.number().int().min(1).max(E.ACTIVITY_MAX).default(E.ACTIVITY_DEFAULT).describe("Maximum number of activity events to return."),
|
|
3572
3572
|
cursor: o.string().optional().describe("Pagination cursor for retrieving the next page of results.")
|
|
3573
3573
|
}, ca = {
|
|
3574
3574
|
events: o.array(On).describe("The activity events."),
|
|
@@ -3698,9 +3698,9 @@ const ma = {
|
|
|
3698
3698
|
),
|
|
3699
3699
|
commentId: o.string().optional().describe("Get a specific comment by ID."),
|
|
3700
3700
|
cursor: o.string().optional().describe("Pagination cursor for retrieving more results."),
|
|
3701
|
-
limit: o.number().int().min(1).max(
|
|
3701
|
+
limit: o.number().int().min(1).max(E.COMMENTS_MAX).optional().describe("Maximum number of comments to return")
|
|
3702
3702
|
}, fa = {
|
|
3703
|
-
comments: o.array(
|
|
3703
|
+
comments: o.array(Ae).describe("The found comments."),
|
|
3704
3704
|
searchType: o.string().describe(
|
|
3705
3705
|
'The type of search performed: "single" (comment ID), "task" (task ID), or "project" (project ID).'
|
|
3706
3706
|
),
|
|
@@ -3733,19 +3733,19 @@ const ma = {
|
|
|
3733
3733
|
const u = await t.getComments({
|
|
3734
3734
|
taskId: e.taskId,
|
|
3735
3735
|
cursor: s ?? null,
|
|
3736
|
-
limit: e.limit ||
|
|
3736
|
+
limit: e.limit || E.COMMENTS_DEFAULT
|
|
3737
3737
|
});
|
|
3738
3738
|
c = u.results, i = u.nextCursor !== null, a = u.nextCursor;
|
|
3739
3739
|
} else if (n) {
|
|
3740
3740
|
const u = await t.getComments({
|
|
3741
3741
|
projectId: n,
|
|
3742
3742
|
cursor: s ?? null,
|
|
3743
|
-
limit: e.limit ||
|
|
3743
|
+
limit: e.limit || E.COMMENTS_DEFAULT
|
|
3744
3744
|
});
|
|
3745
3745
|
c = u.results, i = u.nextCursor !== null, a = u.nextCursor;
|
|
3746
3746
|
} else
|
|
3747
3747
|
throw new Error("Invalid state: no search parameter provided");
|
|
3748
|
-
const d = c.map(
|
|
3748
|
+
const d = c.map($e);
|
|
3749
3749
|
return {
|
|
3750
3750
|
textContent: ga({
|
|
3751
3751
|
comments: d,
|
|
@@ -3813,13 +3813,13 @@ function Jt(e, t) {
|
|
|
3813
3813
|
const d = new Date(Date.UTC(i, a - 1, c));
|
|
3814
3814
|
return d.setUTCDate(d.getUTCDate() + t), oo(d);
|
|
3815
3815
|
}
|
|
3816
|
-
const Ta = ["and", "or"],
|
|
3816
|
+
const Ta = ["and", "or"], Et = {
|
|
3817
3817
|
labels: o.string().array().optional().describe("The labels to filter the tasks by"),
|
|
3818
3818
|
labelsOperator: o.enum(Ta).optional().describe(
|
|
3819
3819
|
'The operator to use when filtering by labels. This will dictate whether a task has all labels, or some of them. Default is "or".'
|
|
3820
3820
|
)
|
|
3821
3821
|
};
|
|
3822
|
-
function
|
|
3822
|
+
function Dt(e = [], t = "or") {
|
|
3823
3823
|
if (e.length === 0) return "";
|
|
3824
3824
|
const s = t === "and" ? " & " : " | ";
|
|
3825
3825
|
return `(${e.map((i) => i.startsWith("@") ? i : `@${i}`).join(` ${s} `)})`;
|
|
@@ -3856,11 +3856,11 @@ const va = {
|
|
|
3856
3856
|
responsibleUser: o.string().optional().describe(
|
|
3857
3857
|
"Filter completed tasks assigned to this user. User ID, name, or email. For personal queries (summaries, plans, reports), set to current user from user-info to exclude collaborators. Defaults to all collaborators."
|
|
3858
3858
|
),
|
|
3859
|
-
limit: o.number().int().min(1).max(
|
|
3859
|
+
limit: o.number().int().min(1).max(E.COMPLETED_TASKS_MAX).default(E.COMPLETED_TASKS_DEFAULT).describe("The maximum number of tasks to return."),
|
|
3860
3860
|
cursor: o.string().optional().describe(
|
|
3861
3861
|
"The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters)."
|
|
3862
3862
|
),
|
|
3863
|
-
...
|
|
3863
|
+
...Et
|
|
3864
3864
|
}, Ia = {
|
|
3865
3865
|
tasks: o.array(V).describe("The found completed tasks."),
|
|
3866
3866
|
nextCursor: o.string().optional(),
|
|
@@ -3890,7 +3890,7 @@ const va = {
|
|
|
3890
3890
|
"Cursor pagination requires explicit since and until. Reuse structuredContent.appliedFilters.since and structuredContent.appliedFilters.until from the previous page."
|
|
3891
3891
|
);
|
|
3892
3892
|
const h = await gt(t, c), f = h?.email;
|
|
3893
|
-
let m =
|
|
3893
|
+
let m = Dt(r, n);
|
|
3894
3894
|
h && f && (m = ye(m, `assigned to: ${f}`));
|
|
3895
3895
|
const g = await t.getUser(), w = g.tzInfo?.gmtString || "+00:00", I = await ae({
|
|
3896
3896
|
projectId: d,
|
|
@@ -3967,7 +3967,7 @@ const ja = {
|
|
|
3967
3967
|
searchText: o.string().optional().describe(
|
|
3968
3968
|
'Search for a label by name (partial and case insensitive match). Supports wildcards (e.g. "work*" for prefix match). Use "\\*" for a literal asterisk. If omitted, all labels are returned.'
|
|
3969
3969
|
),
|
|
3970
|
-
limit: o.number().int().min(1).max(
|
|
3970
|
+
limit: o.number().int().min(1).max(E.LABELS_MAX).default(E.LABELS_DEFAULT).describe("The maximum number of labels to return."),
|
|
3971
3971
|
cursor: o.string().optional().describe(
|
|
3972
3972
|
"The cursor to get the next page of labels (cursor is obtained from the previous call to this tool, with the same parameters). Ignored when searchText is provided."
|
|
3973
3973
|
)
|
|
@@ -3995,7 +3995,7 @@ const ja = {
|
|
|
3995
3995
|
kn(t)
|
|
3996
3996
|
]), { results: n, nextCursor: i } = s, a = e.searchText ? { searchText: e.searchText } : { limit: e.limit, cursor: e.cursor };
|
|
3997
3997
|
return {
|
|
3998
|
-
textContent:
|
|
3998
|
+
textContent: Ea({ labels: n, args: e, nextCursor: i, sharedLabels: r }),
|
|
3999
3999
|
structuredContent: {
|
|
4000
4000
|
labels: n.map((c) => ke.parse(c)),
|
|
4001
4001
|
nextCursor: i ?? void 0,
|
|
@@ -4007,7 +4007,7 @@ const ja = {
|
|
|
4007
4007
|
};
|
|
4008
4008
|
}
|
|
4009
4009
|
};
|
|
4010
|
-
function
|
|
4010
|
+
function Ea({
|
|
4011
4011
|
labels: e,
|
|
4012
4012
|
args: t,
|
|
4013
4013
|
nextCursor: s,
|
|
@@ -4015,7 +4015,7 @@ function Da({
|
|
|
4015
4015
|
}) {
|
|
4016
4016
|
const n = t.searchText ? `All labels matching "${t.searchText}"` : "Labels", i = [];
|
|
4017
4017
|
t.searchText && i.push(`searchText: "${t.searchText}"`);
|
|
4018
|
-
const a = 10, d = e.slice(0, a).map(
|
|
4018
|
+
const a = 10, d = e.slice(0, a).map(Pn).join(`
|
|
4019
4019
|
`), l = e.length - a, u = l > 0 ? `${d}
|
|
4020
4020
|
…and ${l} more` : d, p = [];
|
|
4021
4021
|
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"));
|
|
@@ -4032,7 +4032,7 @@ No shared labels.`;
|
|
|
4032
4032
|
zeroReasonHints: p
|
|
4033
4033
|
}) + h;
|
|
4034
4034
|
}
|
|
4035
|
-
const { FIND_PROJECTS: no, ADD_TASKS: io, UPDATE_TASKS: ao } = T,
|
|
4035
|
+
const { FIND_PROJECTS: no, ADD_TASKS: io, UPDATE_TASKS: ao } = T, Da = {
|
|
4036
4036
|
projectId: o.string().min(1).optional().describe(
|
|
4037
4037
|
'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.'
|
|
4038
4038
|
),
|
|
@@ -4052,7 +4052,7 @@ const { FIND_PROJECTS: no, ADD_TASKS: io, UPDATE_TASKS: ao } = T, Ea = {
|
|
|
4052
4052
|
}, Oa = {
|
|
4053
4053
|
name: T.FIND_PROJECT_COLLABORATORS,
|
|
4054
4054
|
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.`,
|
|
4055
|
-
parameters:
|
|
4055
|
+
parameters: Da,
|
|
4056
4056
|
outputSchema: xa,
|
|
4057
4057
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4058
4058
|
async execute(e, t) {
|
|
@@ -4212,15 +4212,15 @@ function lo({
|
|
|
4212
4212
|
nextSteps: u
|
|
4213
4213
|
});
|
|
4214
4214
|
}
|
|
4215
|
-
const { ADD_PROJECTS: Xt } = T,
|
|
4215
|
+
const { ADD_PROJECTS: Xt } = T, Ra = {
|
|
4216
4216
|
active: "projects",
|
|
4217
4217
|
archived: "archived projects",
|
|
4218
4218
|
all: "projects (active and archived)"
|
|
4219
|
-
},
|
|
4219
|
+
}, Pa = {
|
|
4220
4220
|
searchText: o.string().optional().describe(
|
|
4221
4221
|
'Search for a project by name (partial and case insensitive match). Supports wildcards (e.g. "work*" for prefix match). Use "\\*" for a literal asterisk. If omitted, all projects are returned.'
|
|
4222
4222
|
),
|
|
4223
|
-
limit: o.number().int().min(1).max(
|
|
4223
|
+
limit: o.number().int().min(1).max(E.PROJECTS_MAX).default(E.PROJECTS_DEFAULT).describe("The maximum number of projects to return."),
|
|
4224
4224
|
cursor: o.string().optional().describe(
|
|
4225
4225
|
"The cursor to get the next page of projects (cursor is obtained from the previous call to this tool, with the same parameters)."
|
|
4226
4226
|
),
|
|
@@ -4236,7 +4236,7 @@ const { ADD_PROJECTS: Xt } = T, Pa = {
|
|
|
4236
4236
|
}, La = {
|
|
4237
4237
|
name: T.FIND_PROJECTS,
|
|
4238
4238
|
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.",
|
|
4239
|
-
parameters:
|
|
4239
|
+
parameters: Pa,
|
|
4240
4240
|
outputSchema: Na,
|
|
4241
4241
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4242
4242
|
async execute(e, t) {
|
|
@@ -4273,7 +4273,7 @@ function Ma({
|
|
|
4273
4273
|
args: t,
|
|
4274
4274
|
nextCursor: s
|
|
4275
4275
|
}) {
|
|
4276
|
-
const r =
|
|
4276
|
+
const r = Ra[t.archivedStatus ?? "active"], n = t.searchText ? `All ${r} matching "${t.searchText}"` : `${r.charAt(0).toUpperCase()}${r.slice(1)}`, i = [];
|
|
4277
4277
|
t.searchText && i.push(`searchText: "${t.searchText}"`), t.archivedStatus && t.archivedStatus !== "active" && i.push(`archivedStatus: "${t.archivedStatus}"`);
|
|
4278
4278
|
const a = 10, d = e.slice(0, a).map(Nn).join(`
|
|
4279
4279
|
`), l = e.length - a, u = l > 0 ? `${d}
|
|
@@ -4314,7 +4314,7 @@ const Fa = {
|
|
|
4314
4314
|
"Only one of taskId, reminderId, or locationReminderId can be provided at a time."
|
|
4315
4315
|
);
|
|
4316
4316
|
if (r) {
|
|
4317
|
-
const a = await t.getReminder(r), c =
|
|
4317
|
+
const a = await t.getReminder(r), c = je(a);
|
|
4318
4318
|
return {
|
|
4319
4319
|
textContent: `Found ${a.type} reminder (id=${r})`,
|
|
4320
4320
|
structuredContent: {
|
|
@@ -4326,7 +4326,7 @@ const Fa = {
|
|
|
4326
4326
|
};
|
|
4327
4327
|
}
|
|
4328
4328
|
if (n) {
|
|
4329
|
-
const a = await t.getLocationReminder(n), c =
|
|
4329
|
+
const a = await t.getLocationReminder(n), c = je(a);
|
|
4330
4330
|
return {
|
|
4331
4331
|
textContent: `Found location reminder (id=${n})`,
|
|
4332
4332
|
structuredContent: {
|
|
@@ -4347,7 +4347,7 @@ const Fa = {
|
|
|
4347
4347
|
apiMethod: (p) => t.getLocationReminders(p),
|
|
4348
4348
|
args: { taskId: s }
|
|
4349
4349
|
})
|
|
4350
|
-
]), l = [...a, ...c].map(
|
|
4350
|
+
]), l = [...a, ...c].map(je);
|
|
4351
4351
|
return {
|
|
4352
4352
|
textContent: Ba(l, s),
|
|
4353
4353
|
structuredContent: {
|
|
@@ -4445,7 +4445,7 @@ const Va = {
|
|
|
4445
4445
|
daysCount: o.number().int().min(1).max(30).default(1).describe(
|
|
4446
4446
|
"The number of days to get the tasks for, starting from the start date. Default is 1 which means only tasks for the start date."
|
|
4447
4447
|
),
|
|
4448
|
-
limit: o.number().int().min(1).max(
|
|
4448
|
+
limit: o.number().int().min(1).max(E.TASKS_MAX).default(E.TASKS_DEFAULT).describe("The maximum number of tasks to return. Default is 10."),
|
|
4449
4449
|
cursor: o.string().optional().describe(
|
|
4450
4450
|
"The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters)."
|
|
4451
4451
|
),
|
|
@@ -4455,7 +4455,7 @@ const Va = {
|
|
|
4455
4455
|
responsibleUserFiltering: o.enum(Hs).optional().describe(
|
|
4456
4456
|
"Filter when responsibleUser is omitted. 'assigned'=assigned to others; 'unassignedOrMe'=unassigned+mine; 'all'=everyone. Default: 'unassignedOrMe'."
|
|
4457
4457
|
),
|
|
4458
|
-
...
|
|
4458
|
+
...Et
|
|
4459
4459
|
}, Ja = {
|
|
4460
4460
|
tasks: o.array(V).describe("The found tasks."),
|
|
4461
4461
|
nextCursor: o.string().optional(),
|
|
@@ -4488,7 +4488,7 @@ const Va = {
|
|
|
4488
4488
|
const b = e.startDate, m = Ye(uo(b), e.daysCount), g = xt(m, { representation: "date" });
|
|
4489
4489
|
d = `(due after: ${b} | due: ${b}) & due before: ${g}`;
|
|
4490
4490
|
}
|
|
4491
|
-
const l =
|
|
4491
|
+
const l = Dt(e.labels, e.labelsOperator);
|
|
4492
4492
|
l.length > 0 && (d = ye(d, `(${l})`));
|
|
4493
4493
|
const u = rt({
|
|
4494
4494
|
resolvedAssigneeId: n,
|
|
@@ -4649,7 +4649,7 @@ const tc = new ec(), { FIND_COMPLETED_TASKS: Zt, ADD_TASKS: Qt } = T, sc = {
|
|
|
4649
4649
|
responsibleUserFiltering: o.enum(Hs).optional().describe(
|
|
4650
4650
|
'How to filter by responsible user when responsibleUser is not provided. "assigned" = only tasks assigned to others; "unassignedOrMe" = only unassigned tasks or tasks assigned to me; "all" = all tasks regardless of assignment. Default value will be `unassignedOrMe`.'
|
|
4651
4651
|
),
|
|
4652
|
-
limit: o.number().int().min(1).max(
|
|
4652
|
+
limit: o.number().int().min(1).max(E.TASKS_MAX).default(E.TASKS_DEFAULT).describe("The maximum number of tasks to return."),
|
|
4653
4653
|
cursor: o.string().optional().describe(
|
|
4654
4654
|
"The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters)."
|
|
4655
4655
|
),
|
|
@@ -4659,7 +4659,7 @@ const tc = new ec(), { FIND_COMPLETED_TASKS: Zt, ADD_TASKS: Qt } = T, sc = {
|
|
|
4659
4659
|
filterIdOrName: o.string().optional().describe(
|
|
4660
4660
|
"The ID or name of a saved Todoist filter. The filter's query will be fetched and used to find tasks. Cannot be used with the `filter` parameter, projectId, sectionId, or parentId."
|
|
4661
4661
|
),
|
|
4662
|
-
...
|
|
4662
|
+
...Et
|
|
4663
4663
|
}, oc = {
|
|
4664
4664
|
tasks: o.array(V).describe("The found tasks."),
|
|
4665
4665
|
nextCursor: o.string().optional(),
|
|
@@ -4708,7 +4708,7 @@ const tc = new ec(), { FIND_COMPLETED_TASKS: Zt, ADD_TASKS: Qt } = T, sc = {
|
|
|
4708
4708
|
cursor: b ?? null
|
|
4709
4709
|
};
|
|
4710
4710
|
r && (O.projectId = await ae({ projectId: r, user: m })), n && (O.sectionId = n), i && (O.parentId = i);
|
|
4711
|
-
const { results:
|
|
4711
|
+
const { results: Ee, nextCursor: te } = await t.getTasks(O), se = Ee.map(H);
|
|
4712
4712
|
let W = s ? se.filter(
|
|
4713
4713
|
(le) => le.content.toLowerCase().includes(s.toLowerCase()) || le.description?.toLowerCase().includes(s.toLowerCase())
|
|
4714
4714
|
) : se;
|
|
@@ -4745,12 +4745,12 @@ const tc = new ec(), { FIND_COMPLETED_TASKS: Zt, ADD_TASKS: Qt } = T, sc = {
|
|
|
4745
4745
|
assigneeEmail: C,
|
|
4746
4746
|
currentUserId: m.id,
|
|
4747
4747
|
responsibleUserFiltering: c
|
|
4748
|
-
}), { results:
|
|
4748
|
+
}), { results: Ee, nextCursor: te } = await t.getTasksByFilter({
|
|
4749
4749
|
query: O,
|
|
4750
4750
|
lang: "en",
|
|
4751
4751
|
limit: d,
|
|
4752
4752
|
cursor: b ?? null
|
|
4753
|
-
}), se =
|
|
4753
|
+
}), se = Ee.map(H);
|
|
4754
4754
|
return {
|
|
4755
4755
|
textContent: He({
|
|
4756
4756
|
tasks: se,
|
|
@@ -4771,7 +4771,7 @@ const tc = new ec(), { FIND_COMPLETED_TASKS: Zt, ADD_TASKS: Qt } = T, sc = {
|
|
|
4771
4771
|
}
|
|
4772
4772
|
let j = w ? `(${w})` : "";
|
|
4773
4773
|
s && (j = ye(j, `search: ${ws(s)}`));
|
|
4774
|
-
const J =
|
|
4774
|
+
const J = Dt(u, p);
|
|
4775
4775
|
if (j = ye(j, J), !(f && !a && !c)) {
|
|
4776
4776
|
const O = rt({
|
|
4777
4777
|
resolvedAssigneeId: k,
|
|
@@ -5006,7 +5006,7 @@ async function lc(e, t) {
|
|
|
5006
5006
|
do {
|
|
5007
5007
|
const { results: n, nextCursor: i } = await e.getTasks({
|
|
5008
5008
|
projectId: t,
|
|
5009
|
-
limit:
|
|
5009
|
+
limit: E.TASKS_BATCH_SIZE,
|
|
5010
5010
|
cursor: r ?? void 0
|
|
5011
5011
|
});
|
|
5012
5012
|
s = s.concat(n.map(H)), r = i ?? void 0;
|
|
@@ -5429,7 +5429,7 @@ const Ac = {
|
|
|
5429
5429
|
}
|
|
5430
5430
|
};
|
|
5431
5431
|
}
|
|
5432
|
-
},
|
|
5432
|
+
}, Ec = o.object({
|
|
5433
5433
|
message: o.string(),
|
|
5434
5434
|
emoji: o.string().optional(),
|
|
5435
5435
|
activeUntil: o.string().optional().describe("ISO 8601 end. Omitted when it has no end."),
|
|
@@ -5437,9 +5437,9 @@ const Ac = {
|
|
|
5437
5437
|
pauseActivity: o.boolean().describe("Karma and streaks paused.")
|
|
5438
5438
|
}), fo = {
|
|
5439
5439
|
hasStatus: o.boolean(),
|
|
5440
|
-
status:
|
|
5440
|
+
status: Ec.optional().describe("Omitted when there is no active status.")
|
|
5441
5441
|
};
|
|
5442
|
-
function
|
|
5442
|
+
function Dc(e) {
|
|
5443
5443
|
if (!e.user)
|
|
5444
5444
|
throw new Error("Todoist did not return the user, so the status is unknown.");
|
|
5445
5445
|
return e.user.status ?? null;
|
|
@@ -5448,7 +5448,7 @@ async function bo(e) {
|
|
|
5448
5448
|
const t = await $(
|
|
5449
5449
|
() => e.sync({ resourceTypes: ["user"], syncToken: "*" })
|
|
5450
5450
|
);
|
|
5451
|
-
return
|
|
5451
|
+
return Dc(t);
|
|
5452
5452
|
}
|
|
5453
5453
|
function xc(e) {
|
|
5454
5454
|
const t = e.activeUntil ? new Date(e.activeUntil).toISOString() : void 0;
|
|
@@ -5492,7 +5492,7 @@ const Oc = {}, Uc = {
|
|
|
5492
5492
|
"The workspace ID or name. Supports exact ID, exact name match (case-insensitive), or unique partial name match."
|
|
5493
5493
|
),
|
|
5494
5494
|
projectIds: o.array(o.string().min(1)).min(1).optional().describe("Optional list of project IDs to scope insights to specific projects.")
|
|
5495
|
-
},
|
|
5495
|
+
}, Rc = o.object({
|
|
5496
5496
|
projectId: o.string().describe("The project ID."),
|
|
5497
5497
|
health: o.object({
|
|
5498
5498
|
status: o.enum(ct).describe("The health status of the project."),
|
|
@@ -5504,15 +5504,15 @@ const Oc = {}, Uc = {
|
|
|
5504
5504
|
activeCount: o.number().describe("Number of active tasks."),
|
|
5505
5505
|
progressPercent: o.number().describe("Completion percentage (0-100).")
|
|
5506
5506
|
}).optional().describe("Progress data for this project. Omitted when the project has none.")
|
|
5507
|
-
}),
|
|
5507
|
+
}), Pc = {
|
|
5508
5508
|
workspaceId: o.string().describe("The resolved workspace ID."),
|
|
5509
5509
|
workspaceName: o.string().describe("The resolved workspace name."),
|
|
5510
|
-
projectInsights: o.array(
|
|
5510
|
+
projectInsights: o.array(Rc).describe("Health and progress insights for each project in the workspace.")
|
|
5511
5511
|
}, Nc = {
|
|
5512
5512
|
name: T.GET_WORKSPACE_INSIGHTS,
|
|
5513
5513
|
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.",
|
|
5514
5514
|
parameters: _c,
|
|
5515
|
-
outputSchema:
|
|
5515
|
+
outputSchema: Pc,
|
|
5516
5516
|
annotations: {
|
|
5517
5517
|
readOnlyHint: !0,
|
|
5518
5518
|
destructiveHint: !1,
|
|
@@ -5588,7 +5588,7 @@ const Fc = {
|
|
|
5588
5588
|
}, Hc = {
|
|
5589
5589
|
sections: o.array(Z).describe("Sections created by the import."),
|
|
5590
5590
|
tasks: o.array(V).describe("Tasks created by the import."),
|
|
5591
|
-
comments: o.array(
|
|
5591
|
+
comments: o.array(Ae).describe("Comments created by the import."),
|
|
5592
5592
|
totalCount: o.number().describe("The total number of objects created by the import.")
|
|
5593
5593
|
}, Wc = {
|
|
5594
5594
|
name: T.IMPORT_PROJECT_TEMPLATE,
|
|
@@ -5610,7 +5610,7 @@ const Fc = {
|
|
|
5610
5610
|
// The SDK treats strings as filesystem paths, not file content.
|
|
5611
5611
|
file: new Blob([s ?? ""], { type: "text/csv" }),
|
|
5612
5612
|
fileName: "template.csv"
|
|
5613
|
-
}), a = i.sections.map(Q), c = i.tasks.map(H), d = i.comments.map(
|
|
5613
|
+
}), a = i.sections.map(Q), c = i.tasks.map(H), d = i.comments.map($e), l = i.projects.length + a.length + c.length + d.length;
|
|
5614
5614
|
return {
|
|
5615
5615
|
textContent: Bc({
|
|
5616
5616
|
projectId: e,
|
|
@@ -6156,7 +6156,7 @@ const To = ["project", "section"], ud = o.object({
|
|
|
6156
6156
|
i.movedIds.size > 0 && d.push(`moved ${i.movedIds.size}`), (i.reorderedIds.size > 0 || d.length === 0) && d.push(`reordered ${i.reorderedIds.size}`);
|
|
6157
6157
|
const l = c.length > 0 ? `${d.join(" and ")} ${a}: ${c.map((u) => `id=${u}`).join(", ")}` : `${d.join(" and ")} ${a}`;
|
|
6158
6158
|
return {
|
|
6159
|
-
textContent:
|
|
6159
|
+
textContent: P(l, i.failures),
|
|
6160
6160
|
structuredContent: {
|
|
6161
6161
|
type: s,
|
|
6162
6162
|
movedCount: i.movedIds.size,
|
|
@@ -6178,7 +6178,7 @@ async function fd(e, t) {
|
|
|
6178
6178
|
}
|
|
6179
6179
|
const c = a.filter((b) => b.parentId !== void 0), d = /* @__PURE__ */ new Set();
|
|
6180
6180
|
if (c.length > 0) {
|
|
6181
|
-
const { outcomes: b } = await
|
|
6181
|
+
const { outcomes: b } = await ve(
|
|
6182
6182
|
e,
|
|
6183
6183
|
c.map(
|
|
6184
6184
|
(m) => ne("project_move", {
|
|
@@ -6189,7 +6189,7 @@ async function fd(e, t) {
|
|
|
6189
6189
|
);
|
|
6190
6190
|
b.forEach((m, g) => {
|
|
6191
6191
|
const w = c[g]?.id;
|
|
6192
|
-
w !== void 0 && (m.status === "fulfilled" ? s.add(w) : (d.add(w), n.push({ item: w, error:
|
|
6192
|
+
w !== void 0 && (m.status === "fulfilled" ? s.add(w) : (d.add(w), n.push({ item: w, error: D(m.reason) })));
|
|
6193
6193
|
});
|
|
6194
6194
|
}
|
|
6195
6195
|
const l = a.filter(
|
|
@@ -6201,7 +6201,7 @@ async function fd(e, t) {
|
|
|
6201
6201
|
try {
|
|
6202
6202
|
i = await ns(e);
|
|
6203
6203
|
} catch (b) {
|
|
6204
|
-
const m =
|
|
6204
|
+
const m = D(b);
|
|
6205
6205
|
for (const g of l)
|
|
6206
6206
|
n.push({
|
|
6207
6207
|
item: g.id,
|
|
@@ -6284,13 +6284,13 @@ function wo(e, t) {
|
|
|
6284
6284
|
async function ko(e, t, s, r, n) {
|
|
6285
6285
|
const i = /* @__PURE__ */ new Set();
|
|
6286
6286
|
if (t.length > 0) {
|
|
6287
|
-
const { outcomes: a } = await
|
|
6287
|
+
const { outcomes: a } = await ve(
|
|
6288
6288
|
e,
|
|
6289
6289
|
t.map((c) => c.command)
|
|
6290
6290
|
);
|
|
6291
6291
|
a.forEach((c, d) => {
|
|
6292
6292
|
const l = t[d]?.id;
|
|
6293
|
-
l === void 0 || c.status === "fulfilled" || (i.add(l), n.push({ item: l, error:
|
|
6293
|
+
l === void 0 || c.status === "fulfilled" || (i.add(l), n.push({ item: l, error: D(c.reason) }));
|
|
6294
6294
|
});
|
|
6295
6295
|
}
|
|
6296
6296
|
for (const { id: a } of s)
|
|
@@ -6342,68 +6342,107 @@ const kd = o.object({
|
|
|
6342
6342
|
}, Id = {
|
|
6343
6343
|
tasks: o.array(V).describe("The rescheduled tasks."),
|
|
6344
6344
|
totalCount: o.number().describe("The total number of tasks rescheduled."),
|
|
6345
|
-
rescheduledTaskIds: o.array(o.string()).describe("The IDs of the rescheduled tasks.")
|
|
6345
|
+
rescheduledTaskIds: o.array(o.string()).describe("The IDs of the rescheduled tasks."),
|
|
6346
|
+
failures: o.array(_).describe("Tasks that could not be rescheduled, with reasons.")
|
|
6346
6347
|
}, Sd = {
|
|
6347
6348
|
name: T.RESCHEDULE_TASKS,
|
|
6348
|
-
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 (and duration, if given), keeping recurrence patterns intact. Use this when moving recurring tasks to a different date or time without altering their repeat pattern.",
|
|
6349
|
+
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 (and duration, if given), keeping recurrence patterns intact. Use this when moving recurring tasks to a different date or time without altering their repeat pattern. Without a due date, the deadline moves.",
|
|
6349
6350
|
parameters: vd,
|
|
6350
6351
|
outputSchema: Id,
|
|
6351
6352
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
6352
6353
|
async execute(e, t) {
|
|
6353
6354
|
const { tasks: s } = e, r = s.map(
|
|
6354
|
-
(
|
|
6355
|
-
), i =
|
|
6356
|
-
s.map(
|
|
6357
|
-
|
|
6358
|
-
|
|
6359
|
-
|
|
6360
|
-
|
|
6361
|
-
if (
|
|
6362
|
-
|
|
6363
|
-
|
|
6364
|
-
|
|
6365
|
-
const h = Cd(
|
|
6366
|
-
|
|
6367
|
-
id:
|
|
6368
|
-
|
|
6369
|
-
|
|
6370
|
-
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
lang: u.due.lang ?? void 0
|
|
6374
|
-
},
|
|
6375
|
-
...r[p] && { duration: r[p] }
|
|
6355
|
+
(h) => h.duration ? mt(`Task ${h.id}`, h.duration) : void 0
|
|
6356
|
+
), n = [], i = await Promise.allSettled(
|
|
6357
|
+
s.map((h) => $(() => t.getTask(h.id)))
|
|
6358
|
+
), a = [];
|
|
6359
|
+
i.forEach((h, f) => {
|
|
6360
|
+
const b = s[f];
|
|
6361
|
+
if (!b) return;
|
|
6362
|
+
if (h.status === "rejected") {
|
|
6363
|
+
n.push({ item: b.id, error: D(h.reason) });
|
|
6364
|
+
return;
|
|
6365
|
+
}
|
|
6366
|
+
const m = h.value, g = Cd(b.date, m);
|
|
6367
|
+
g && a.push({
|
|
6368
|
+
id: b.id,
|
|
6369
|
+
command: ne("item_update", {
|
|
6370
|
+
id: b.id,
|
|
6371
|
+
...g,
|
|
6372
|
+
...r[f] && { duration: r[f] }
|
|
6373
|
+
})
|
|
6376
6374
|
});
|
|
6377
6375
|
});
|
|
6378
|
-
|
|
6379
|
-
|
|
6380
|
-
|
|
6381
|
-
|
|
6382
|
-
|
|
6376
|
+
const c = [];
|
|
6377
|
+
if (a.length > 0) {
|
|
6378
|
+
const { outcomes: h } = await ve(
|
|
6379
|
+
t,
|
|
6380
|
+
a.map(({ command: f }) => f)
|
|
6381
|
+
);
|
|
6382
|
+
h.forEach((f, b) => {
|
|
6383
|
+
const m = a[b]?.id ?? `Task ${b + 1}`;
|
|
6384
|
+
f.status === "fulfilled" ? c.push(m) : n.push({ item: m, error: D(f.reason) });
|
|
6385
|
+
});
|
|
6386
|
+
}
|
|
6387
|
+
U(T.RESCHEDULE_TASKS, s.length, n);
|
|
6388
|
+
const d = [], l = [];
|
|
6389
|
+
let u;
|
|
6390
|
+
if (c.length > 0) {
|
|
6391
|
+
const h = await Promise.allSettled(
|
|
6392
|
+
c.map((f) => $(() => t.getTask(f)))
|
|
6393
|
+
);
|
|
6394
|
+
for (const [f, b] of h.entries()) {
|
|
6395
|
+
if (b.status === "fulfilled") {
|
|
6396
|
+
d.push(H(b.value));
|
|
6397
|
+
continue;
|
|
6398
|
+
}
|
|
6399
|
+
l.push(c[f] ?? `Task ${f + 1}`), u ??= D(b.reason);
|
|
6400
|
+
}
|
|
6401
|
+
u && console.error(`${T.RESCHEDULE_TASKS}: read-back failed`, {
|
|
6402
|
+
updated: c.length,
|
|
6403
|
+
unread: l.length,
|
|
6404
|
+
error: u
|
|
6405
|
+
});
|
|
6383
6406
|
}
|
|
6384
|
-
const
|
|
6407
|
+
const p = u ? `Rescheduled ${c.length} task${c.length === 1 ? "" : "s"}: ${c.join(", ")}
|
|
6408
|
+
Could not read back ${l.join(", ")}: ${u}` : kt("Rescheduled", d, {
|
|
6409
|
+
showDetails: d.length <= 5
|
|
6410
|
+
});
|
|
6385
6411
|
return {
|
|
6386
|
-
textContent:
|
|
6387
|
-
showDetails: c.length <= 5
|
|
6388
|
-
}),
|
|
6412
|
+
textContent: P(p, n),
|
|
6389
6413
|
structuredContent: {
|
|
6390
|
-
tasks:
|
|
6414
|
+
tasks: d,
|
|
6391
6415
|
totalCount: c.length,
|
|
6392
|
-
rescheduledTaskIds:
|
|
6416
|
+
rescheduledTaskIds: c,
|
|
6417
|
+
failures: n
|
|
6393
6418
|
}
|
|
6394
6419
|
};
|
|
6395
6420
|
}
|
|
6396
6421
|
};
|
|
6397
6422
|
function Cd(e, t) {
|
|
6423
|
+
if (t.due)
|
|
6424
|
+
return {
|
|
6425
|
+
due: {
|
|
6426
|
+
date: jd(e, t.due),
|
|
6427
|
+
string: t.due.string,
|
|
6428
|
+
isRecurring: t.due.isRecurring,
|
|
6429
|
+
timezone: t.due.timezone ?? void 0,
|
|
6430
|
+
lang: t.due.lang ?? void 0
|
|
6431
|
+
}
|
|
6432
|
+
};
|
|
6433
|
+
if (t.deadline)
|
|
6434
|
+
return { deadline: { date: e.slice(0, 10) } };
|
|
6435
|
+
}
|
|
6436
|
+
function jd(e, t) {
|
|
6398
6437
|
if (/^\d{4}-\d{2}-\d{2}$/.test(e) && t.datetime) {
|
|
6399
6438
|
const r = t.datetime.substring(10);
|
|
6400
6439
|
return e + r;
|
|
6401
6440
|
}
|
|
6402
6441
|
return e;
|
|
6403
6442
|
}
|
|
6404
|
-
const
|
|
6443
|
+
const $d = {
|
|
6405
6444
|
query: o.string().min(1).describe("The search query string to find tasks and projects.")
|
|
6406
|
-
},
|
|
6445
|
+
}, Ad = {
|
|
6407
6446
|
results: o.array(
|
|
6408
6447
|
o.object({
|
|
6409
6448
|
id: o.string().describe("The ID of the result."),
|
|
@@ -6412,18 +6451,18 @@ const jd = {
|
|
|
6412
6451
|
})
|
|
6413
6452
|
).describe("The search results."),
|
|
6414
6453
|
totalCount: o.number().describe("Total number of results found.")
|
|
6415
|
-
},
|
|
6454
|
+
}, Ed = {
|
|
6416
6455
|
name: T.SEARCH,
|
|
6417
6456
|
description: "Search across tasks and projects in Todoist. Returns a list of relevant results with IDs, titles, and URLs.",
|
|
6418
|
-
parameters:
|
|
6419
|
-
outputSchema:
|
|
6457
|
+
parameters: $d,
|
|
6458
|
+
outputSchema: Ad,
|
|
6420
6459
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
6421
6460
|
async execute(e, t) {
|
|
6422
6461
|
const { query: s } = e, [r, n] = await Promise.all([
|
|
6423
6462
|
Tt({
|
|
6424
6463
|
client: t,
|
|
6425
6464
|
query: `search: ${ws(s)}`,
|
|
6426
|
-
limit:
|
|
6465
|
+
limit: E.TASKS_MAX,
|
|
6427
6466
|
cursor: void 0
|
|
6428
6467
|
}),
|
|
6429
6468
|
Ws(t, s)
|
|
@@ -6445,7 +6484,7 @@ const jd = {
|
|
|
6445
6484
|
structuredContent: { results: i, totalCount: i.length }
|
|
6446
6485
|
};
|
|
6447
6486
|
}
|
|
6448
|
-
}, Dd = 80,
|
|
6487
|
+
}, Dd = 80, xd = {
|
|
6449
6488
|
message: o.string().trim().min(1).max(Dd).optional().describe("Required unless clear is true."),
|
|
6450
6489
|
emoji: o.string().trim().min(1).optional().describe("A Unicode emoji, such as 🏝️."),
|
|
6451
6490
|
activeUntil: o.string().trim().optional().describe(
|
|
@@ -6454,20 +6493,20 @@ const jd = {
|
|
|
6454
6493
|
pauseNotifications: o.boolean().optional().describe("Hold back Comms notifications while active. They are not sent later."),
|
|
6455
6494
|
pauseActivity: o.boolean().optional().describe("Pause Karma and streaks while active."),
|
|
6456
6495
|
clear: o.boolean().optional().describe("Remove the status. Use alone.")
|
|
6457
|
-
},
|
|
6496
|
+
}, Od = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(Z|([+-])(\d{2}):(\d{2}))$/i, Ud = -720, _d = 840;
|
|
6458
6497
|
function Be(e) {
|
|
6459
6498
|
return new Error(
|
|
6460
6499
|
`activeUntil must be an ISO 8601 timestamp with Z or an offset, such as "2026-11-10T00:00:00+00:00". Got "${e}".`
|
|
6461
6500
|
);
|
|
6462
6501
|
}
|
|
6463
|
-
function
|
|
6464
|
-
const s =
|
|
6502
|
+
function Rd(e, t) {
|
|
6503
|
+
const s = Od.exec(e);
|
|
6465
6504
|
if (!s)
|
|
6466
6505
|
throw Be(e);
|
|
6467
6506
|
const [, r, n, i, a, c, d = "0", l = ""] = s, [u, p, h, f, b, m] = [r, n, i, a, c, d].map(Number), g = /* @__PURE__ */ new Date(0);
|
|
6468
6507
|
g.setUTCFullYear(u, p - 1, h), g.setUTCHours(f, b, m);
|
|
6469
6508
|
const w = g.getUTCFullYear() === u && g.getUTCMonth() === p - 1 && g.getUTCDate() === h && g.getUTCHours() === f && g.getUTCMinutes() === b && g.getUTCSeconds() === m, I = l.toUpperCase() === "Z" ? 0 : ro(l);
|
|
6470
|
-
if (!w || I <
|
|
6509
|
+
if (!w || I < Ud || I > _d)
|
|
6471
6510
|
throw Be(e);
|
|
6472
6511
|
const k = new Date(e);
|
|
6473
6512
|
if (Number.isNaN(k.getTime()))
|
|
@@ -6489,7 +6528,7 @@ function Pd(e, t) {
|
|
|
6489
6528
|
return {
|
|
6490
6529
|
message: r,
|
|
6491
6530
|
emoji: n ?? null,
|
|
6492
|
-
activeUntil: i !== void 0 ?
|
|
6531
|
+
activeUntil: i !== void 0 ? Rd(i, t) : null,
|
|
6493
6532
|
effects: a || c ? {
|
|
6494
6533
|
pauseNotifications: a ? is : null,
|
|
6495
6534
|
pauseActivity: c ? is : null
|
|
@@ -6499,14 +6538,14 @@ function Pd(e, t) {
|
|
|
6499
6538
|
function as(e) {
|
|
6500
6539
|
return e ? e.replace(/\uFE0F/g, "") : null;
|
|
6501
6540
|
}
|
|
6502
|
-
function
|
|
6541
|
+
function Nd(e, t) {
|
|
6503
6542
|
const s = e.activeUntil ? new Date(e.activeUntil).getTime() : null, r = t.activeUntil ? new Date(t.activeUntil).getTime() : null;
|
|
6504
6543
|
return e.message === t.message && as(e.emoji) === as(t.emoji) && s === r && !!e.effects?.pauseNotifications == !!t.effects?.pauseNotifications && !!e.effects?.pauseActivity == !!t.effects?.pauseActivity;
|
|
6505
6544
|
}
|
|
6506
|
-
const
|
|
6545
|
+
const Ld = {
|
|
6507
6546
|
name: T.SET_USER_STATUS,
|
|
6508
6547
|
description: "Set or clear the user's status, shown next to their name in Todoist and Comms. Replaces the whole status: an omitted emoji, end or effect is removed, not kept. Use clear to remove the status.",
|
|
6509
|
-
parameters:
|
|
6548
|
+
parameters: xd,
|
|
6510
6549
|
outputSchema: fo,
|
|
6511
6550
|
annotations: {
|
|
6512
6551
|
readOnlyHint: !1,
|
|
@@ -6517,7 +6556,7 @@ const Nd = {
|
|
|
6517
6556
|
async execute(e, t) {
|
|
6518
6557
|
const s = Pd(e, /* @__PURE__ */ new Date()), {
|
|
6519
6558
|
outcomes: [r]
|
|
6520
|
-
} = await
|
|
6559
|
+
} = await ve(t, [ne("user_update", { status: s })]);
|
|
6521
6560
|
if (r?.status !== "fulfilled")
|
|
6522
6561
|
throw r?.reason ?? new Error("Todoist did not report whether the status was applied.");
|
|
6523
6562
|
const n = await bo(t).catch(() => {
|
|
@@ -6536,25 +6575,25 @@ const Nd = {
|
|
|
6536
6575
|
throw new Error(
|
|
6537
6576
|
"Todoist accepted the status but reports no active status, so it may have expired already."
|
|
6538
6577
|
);
|
|
6539
|
-
if (!
|
|
6578
|
+
if (!Nd(n, s))
|
|
6540
6579
|
throw new Error(
|
|
6541
6580
|
`Todoist accepted the status but reports a different one. Another app may have changed it at the same moment; use ${T.GET_USER_STATUS} to see it.`
|
|
6542
6581
|
);
|
|
6543
6582
|
return it(n, "Status set");
|
|
6544
6583
|
}
|
|
6545
|
-
}, Ld = {
|
|
6546
|
-
ids: o.array(o.string().min(1)).min(1).describe("The IDs of the tasks to uncomplete.")
|
|
6547
6584
|
}, Md = {
|
|
6585
|
+
ids: o.array(o.string().min(1)).min(1).describe("The IDs of the tasks to uncomplete.")
|
|
6586
|
+
}, Fd = {
|
|
6548
6587
|
uncompleted: o.array(o.string()).describe("The IDs of successfully uncompleted tasks."),
|
|
6549
6588
|
failures: o.array(_).describe("Failed task uncompletion with error details."),
|
|
6550
6589
|
totalRequested: o.number().describe("The total number of tasks requested to uncomplete."),
|
|
6551
6590
|
successCount: o.number().describe("The number of successfully uncompleted tasks."),
|
|
6552
6591
|
failureCount: o.number().describe("The number of failed task uncompletions.")
|
|
6553
|
-
},
|
|
6592
|
+
}, Hd = {
|
|
6554
6593
|
name: T.UNCOMPLETE_TASKS,
|
|
6555
6594
|
description: "Uncomplete (reopen) one or more completed tasks by their IDs.",
|
|
6556
|
-
parameters:
|
|
6557
|
-
outputSchema:
|
|
6595
|
+
parameters: Md,
|
|
6596
|
+
outputSchema: Fd,
|
|
6558
6597
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
6559
6598
|
async execute(e, t) {
|
|
6560
6599
|
const s = [], r = [];
|
|
@@ -6564,11 +6603,11 @@ const Nd = {
|
|
|
6564
6603
|
} catch (a) {
|
|
6565
6604
|
r.push({
|
|
6566
6605
|
item: i,
|
|
6567
|
-
error:
|
|
6606
|
+
error: D(a)
|
|
6568
6607
|
});
|
|
6569
6608
|
}
|
|
6570
6609
|
return U(T.UNCOMPLETE_TASKS, e.ids.length, r), {
|
|
6571
|
-
textContent:
|
|
6610
|
+
textContent: Wd({
|
|
6572
6611
|
uncompleted: s,
|
|
6573
6612
|
failures: r,
|
|
6574
6613
|
args: e
|
|
@@ -6583,7 +6622,7 @@ const Nd = {
|
|
|
6583
6622
|
};
|
|
6584
6623
|
}
|
|
6585
6624
|
};
|
|
6586
|
-
function
|
|
6625
|
+
function Wd({
|
|
6587
6626
|
uncompleted: e,
|
|
6588
6627
|
failures: t,
|
|
6589
6628
|
args: s
|
|
@@ -6597,13 +6636,13 @@ function Hd({
|
|
|
6597
6636
|
failures: t
|
|
6598
6637
|
});
|
|
6599
6638
|
}
|
|
6600
|
-
const
|
|
6639
|
+
const Bd = o.object({
|
|
6601
6640
|
id: o.string().min(1).describe("The ID of the comment to update."),
|
|
6602
6641
|
content: o.string().min(1).describe("The new content for the comment.")
|
|
6603
|
-
}),
|
|
6604
|
-
comments: o.array(
|
|
6605
|
-
},
|
|
6606
|
-
comments: o.array(
|
|
6642
|
+
}), Kd = {
|
|
6643
|
+
comments: o.array(Bd).min(1).describe("The comments to update.")
|
|
6644
|
+
}, qd = {
|
|
6645
|
+
comments: o.array(Ae).describe("The updated comments."),
|
|
6607
6646
|
totalCount: o.number().describe("The total number of comments updated."),
|
|
6608
6647
|
updatedCommentIds: o.array(o.string()).describe("The IDs of the updated comments."),
|
|
6609
6648
|
failures: o.array(_).describe("Comments that could not be updated, with the reason for each."),
|
|
@@ -6611,11 +6650,11 @@ const Wd = o.object({
|
|
|
6611
6650
|
updateCount: o.number().describe("The number of comments updated."),
|
|
6612
6651
|
failureCount: o.number()
|
|
6613
6652
|
}).describe("Summary of operations performed.")
|
|
6614
|
-
},
|
|
6653
|
+
}, Gd = {
|
|
6615
6654
|
name: T.UPDATE_COMMENTS,
|
|
6616
6655
|
description: "Update multiple existing comments with new content.",
|
|
6617
|
-
parameters:
|
|
6618
|
-
outputSchema:
|
|
6656
|
+
parameters: Kd,
|
|
6657
|
+
outputSchema: qd,
|
|
6619
6658
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
6620
6659
|
async execute(e, t) {
|
|
6621
6660
|
const { comments: s } = e, r = await Promise.allSettled(
|
|
@@ -6626,13 +6665,13 @@ const Wd = o.object({
|
|
|
6626
6665
|
)
|
|
6627
6666
|
), n = [], i = [];
|
|
6628
6667
|
return r.forEach((c, d) => {
|
|
6629
|
-
c.status === "fulfilled" ? n.push(
|
|
6668
|
+
c.status === "fulfilled" ? n.push($e(c.value)) : i.push({
|
|
6630
6669
|
item: s[d]?.id ?? `Comment ${d + 1}`,
|
|
6631
|
-
error:
|
|
6670
|
+
error: D(c.reason)
|
|
6632
6671
|
});
|
|
6633
6672
|
}), U(T.UPDATE_COMMENTS, s.length, i), {
|
|
6634
|
-
textContent:
|
|
6635
|
-
|
|
6673
|
+
textContent: P(
|
|
6674
|
+
zd({ comments: n }),
|
|
6636
6675
|
i
|
|
6637
6676
|
),
|
|
6638
6677
|
structuredContent: {
|
|
@@ -6648,7 +6687,7 @@ const Wd = o.object({
|
|
|
6648
6687
|
};
|
|
6649
6688
|
}
|
|
6650
6689
|
};
|
|
6651
|
-
function
|
|
6690
|
+
function zd({ comments: e }) {
|
|
6652
6691
|
const t = e.filter((i) => i.taskId).length, s = e.filter((i) => i.projectId).length, r = [];
|
|
6653
6692
|
if (t > 0) {
|
|
6654
6693
|
const i = t > 1 ? "comments" : "comment";
|
|
@@ -6660,7 +6699,7 @@ function Gd({ comments: e }) {
|
|
|
6660
6699
|
}
|
|
6661
6700
|
return r.length > 0 ? `Updated ${r.join(" and ")}` : "No comments updated";
|
|
6662
6701
|
}
|
|
6663
|
-
const
|
|
6702
|
+
const Yd = o.object({
|
|
6664
6703
|
id: o.string().min(1).describe("The ID of the filter to update."),
|
|
6665
6704
|
name: o.string().min(1).optional().describe("The new name of the filter."),
|
|
6666
6705
|
query: o.string().min(1).optional().describe(
|
|
@@ -6675,9 +6714,9 @@ const zd = o.object({
|
|
|
6675
6714
|
).optional(),
|
|
6676
6715
|
color: Te,
|
|
6677
6716
|
isFavorite: o.boolean().optional().describe("Whether to mark the filter as a favorite.")
|
|
6678
|
-
}),
|
|
6679
|
-
filters: o.array(
|
|
6680
|
-
},
|
|
6717
|
+
}), Vd = {
|
|
6718
|
+
filters: o.array(Yd).min(1).describe("The filters to update.")
|
|
6719
|
+
}, Jd = {
|
|
6681
6720
|
filters: o.array(It).describe(
|
|
6682
6721
|
"The updated filters, as read back after the update. Empty if they could not be read back; updatedFilterIds still lists what was updated."
|
|
6683
6722
|
),
|
|
@@ -6689,15 +6728,15 @@ const zd = o.object({
|
|
|
6689
6728
|
skippedCount: o.number().describe("The number of filters skipped (no changes)."),
|
|
6690
6729
|
failureCount: o.number()
|
|
6691
6730
|
}).describe("Summary of operations performed.")
|
|
6692
|
-
},
|
|
6731
|
+
}, Xd = {
|
|
6693
6732
|
name: T.UPDATE_FILTERS,
|
|
6694
6733
|
description: "Update one or more existing personal filters with new values.",
|
|
6695
|
-
parameters:
|
|
6696
|
-
outputSchema:
|
|
6734
|
+
parameters: Vd,
|
|
6735
|
+
outputSchema: Jd,
|
|
6697
6736
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
6698
6737
|
async execute(e, t) {
|
|
6699
6738
|
const { filters: s } = e, r = [], i = s.map((f) => {
|
|
6700
|
-
const b =
|
|
6739
|
+
const b = el(f);
|
|
6701
6740
|
return b !== null ? { kind: "skipped", reason: b } : (r.push(f), { kind: "updated", filter: f });
|
|
6702
6741
|
}).filter((f) => f.kind === "skipped").length;
|
|
6703
6742
|
if (r.length === 0)
|
|
@@ -6720,10 +6759,10 @@ const zd = o.object({
|
|
|
6720
6759
|
...g !== void 0 ? { description: g === "remove" ? null : g } : {},
|
|
6721
6760
|
...m !== void 0 ? { color: m } : {}
|
|
6722
6761
|
});
|
|
6723
|
-
}), { outcomes: c } = await
|
|
6762
|
+
}), { outcomes: c } = await ve(t, a), d = [], l = [];
|
|
6724
6763
|
c.forEach((f, b) => {
|
|
6725
6764
|
const m = r[b]?.id ?? `Filter ${b + 1}`;
|
|
6726
|
-
f.status === "fulfilled" ? d.push(m) : l.push({ item: m, error:
|
|
6765
|
+
f.status === "fulfilled" ? d.push(m) : l.push({ item: m, error: D(f.reason) });
|
|
6727
6766
|
}), U(T.UPDATE_FILTERS, s.length, l);
|
|
6728
6767
|
let u = [], p;
|
|
6729
6768
|
if (d.length > 0) {
|
|
@@ -6733,16 +6772,16 @@ const zd = o.object({
|
|
|
6733
6772
|
() => t.sync({ resourceTypes: ["filters"], syncToken: "*" })
|
|
6734
6773
|
)).filters ?? [];
|
|
6735
6774
|
} catch (b) {
|
|
6736
|
-
p =
|
|
6775
|
+
p = D(b), console.error(`${T.UPDATE_FILTERS}: read-back failed`, {
|
|
6737
6776
|
updated: d.length,
|
|
6738
6777
|
error: p
|
|
6739
6778
|
});
|
|
6740
6779
|
}
|
|
6741
|
-
f && (u =
|
|
6780
|
+
f && (u = Zd(f, new Set(d)));
|
|
6742
6781
|
}
|
|
6743
6782
|
return {
|
|
6744
|
-
textContent:
|
|
6745
|
-
|
|
6783
|
+
textContent: P(
|
|
6784
|
+
Qd({
|
|
6746
6785
|
filters: u,
|
|
6747
6786
|
updatedIds: d,
|
|
6748
6787
|
skippedCount: i,
|
|
@@ -6764,7 +6803,7 @@ const zd = o.object({
|
|
|
6764
6803
|
};
|
|
6765
6804
|
}
|
|
6766
6805
|
};
|
|
6767
|
-
function
|
|
6806
|
+
function Zd(e, t) {
|
|
6768
6807
|
return e.filter((s) => !s.isDeleted && t.has(s.id)).map((s) => ({
|
|
6769
6808
|
id: s.id,
|
|
6770
6809
|
name: s.name,
|
|
@@ -6775,7 +6814,7 @@ function Xd(e, t) {
|
|
|
6775
6814
|
itemOrder: s.itemOrder
|
|
6776
6815
|
}));
|
|
6777
6816
|
}
|
|
6778
|
-
function
|
|
6817
|
+
function Qd({
|
|
6779
6818
|
filters: e,
|
|
6780
6819
|
updatedIds: t,
|
|
6781
6820
|
skippedCount: s,
|
|
@@ -6794,35 +6833,35 @@ ${a}`;
|
|
|
6794
6833
|
}
|
|
6795
6834
|
return i;
|
|
6796
6835
|
}
|
|
6797
|
-
function
|
|
6836
|
+
function el({ id: e, ...t }) {
|
|
6798
6837
|
return Object.values(t).every((r) => r === void 0) ? "no-fields" : null;
|
|
6799
6838
|
}
|
|
6800
|
-
const
|
|
6839
|
+
const tl = o.object({
|
|
6801
6840
|
labelType: o.literal("personal").describe("Update a personal label, identified by its ID."),
|
|
6802
6841
|
id: o.string().min(1).describe("The ID of the personal label to update."),
|
|
6803
6842
|
name: o.string().min(1).max(128).optional().describe("The new name of the label."),
|
|
6804
6843
|
color: Te,
|
|
6805
6844
|
order: o.number().int().optional().describe("The new position of the label in the label list."),
|
|
6806
6845
|
isFavorite: o.boolean().optional().describe("Whether to mark the label as a favorite.")
|
|
6807
|
-
}),
|
|
6846
|
+
}), sl = o.object({
|
|
6808
6847
|
labelType: o.literal("shared").describe(
|
|
6809
6848
|
"Rename a shared label across all tasks. Shared labels are identified by name; only renaming is supported (no color, order, or favorite)."
|
|
6810
6849
|
),
|
|
6811
6850
|
name: o.string().min(1).describe("The current name of the shared label."),
|
|
6812
6851
|
newName: o.string().min(1).describe("The new name for the shared label.")
|
|
6813
|
-
}),
|
|
6814
|
-
|
|
6815
|
-
|
|
6816
|
-
]),
|
|
6817
|
-
labels: o.array(
|
|
6852
|
+
}), ol = o.discriminatedUnion("labelType", [
|
|
6853
|
+
tl,
|
|
6854
|
+
sl
|
|
6855
|
+
]), rl = {
|
|
6856
|
+
labels: o.array(ol).min(1).describe(
|
|
6818
6857
|
'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.'
|
|
6819
6858
|
)
|
|
6820
|
-
},
|
|
6859
|
+
}, nl = o.object({
|
|
6821
6860
|
name: o.string().describe("The previous name of the shared label."),
|
|
6822
6861
|
newName: o.string().describe("The new name of the shared label.")
|
|
6823
|
-
}),
|
|
6862
|
+
}), il = {
|
|
6824
6863
|
updatedLabels: o.array(ke).describe("The updated personal labels."),
|
|
6825
|
-
renamedSharedLabels: o.array(
|
|
6864
|
+
renamedSharedLabels: o.array(nl).describe("The shared labels that were renamed."),
|
|
6826
6865
|
totalCount: o.number().describe("The total number of successful operations (personal + shared)."),
|
|
6827
6866
|
failures: o.array(_).describe(
|
|
6828
6867
|
"Labels that could not be updated, identified by ID (personal) or name (shared), with the reason for each."
|
|
@@ -6833,17 +6872,17 @@ const el = o.object({
|
|
|
6833
6872
|
skippedCount: o.number().describe("Number of operations skipped (no changes or shared label not found)."),
|
|
6834
6873
|
failureCount: o.number()
|
|
6835
6874
|
}).describe("Summary of operations performed.")
|
|
6836
|
-
},
|
|
6875
|
+
}, al = {
|
|
6837
6876
|
name: T.UPDATE_LABELS,
|
|
6838
6877
|
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.",
|
|
6839
|
-
parameters:
|
|
6840
|
-
outputSchema:
|
|
6878
|
+
parameters: rl,
|
|
6879
|
+
outputSchema: il,
|
|
6841
6880
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
6842
6881
|
async execute(e, t) {
|
|
6843
6882
|
const { labels: s } = e, r = await Promise.allSettled(
|
|
6844
6883
|
s.map(async (h) => {
|
|
6845
6884
|
if (h.labelType === "personal") {
|
|
6846
|
-
const b =
|
|
6885
|
+
const b = dl(h);
|
|
6847
6886
|
if (b !== null) return { kind: "skipped", reason: b };
|
|
6848
6887
|
const { id: m, labelType: g, ...w } = h;
|
|
6849
6888
|
return { kind: "updated", label: await $(() => t.updateLabel(m, w)) };
|
|
@@ -6861,7 +6900,7 @@ const el = o.object({
|
|
|
6861
6900
|
const b = s[f];
|
|
6862
6901
|
i.push({
|
|
6863
6902
|
item: b ? b.labelType === "personal" ? b.id : b.name : `Label ${f + 1}`,
|
|
6864
|
-
error:
|
|
6903
|
+
error: D(h.reason)
|
|
6865
6904
|
});
|
|
6866
6905
|
}), U(T.UPDATE_LABELS, s.length, i, { redactItems: !0 });
|
|
6867
6906
|
const a = n.filter((h) => h.kind === "updated").map((h) => ke.parse(h.label)), c = n.filter(
|
|
@@ -6872,8 +6911,8 @@ const el = o.object({
|
|
|
6872
6911
|
(h) => h.kind === "skipped" && h.reason === "not-found"
|
|
6873
6912
|
).length;
|
|
6874
6913
|
return {
|
|
6875
|
-
textContent:
|
|
6876
|
-
|
|
6914
|
+
textContent: P(
|
|
6915
|
+
cl({
|
|
6877
6916
|
updatedLabels: a,
|
|
6878
6917
|
renamedSharedLabels: c,
|
|
6879
6918
|
skippedNoFields: l,
|
|
@@ -6896,7 +6935,7 @@ const el = o.object({
|
|
|
6896
6935
|
};
|
|
6897
6936
|
}
|
|
6898
6937
|
};
|
|
6899
|
-
function
|
|
6938
|
+
function cl({
|
|
6900
6939
|
updatedLabels: e,
|
|
6901
6940
|
renamedSharedLabels: t,
|
|
6902
6941
|
skippedNoFields: s,
|
|
@@ -6918,14 +6957,14 @@ function al({
|
|
|
6918
6957
|
return c.join(`
|
|
6919
6958
|
`);
|
|
6920
6959
|
}
|
|
6921
|
-
function
|
|
6960
|
+
function dl({
|
|
6922
6961
|
id: e,
|
|
6923
6962
|
labelType: t,
|
|
6924
6963
|
...s
|
|
6925
6964
|
}) {
|
|
6926
6965
|
return Object.values(s).every((n) => n === void 0) ? "no-fields" : null;
|
|
6927
6966
|
}
|
|
6928
|
-
const
|
|
6967
|
+
const ll = o.object({
|
|
6929
6968
|
id: o.string().min(1).describe("The ID of the project to update."),
|
|
6930
6969
|
name: o.string().min(1).optional().describe("The new name of the project."),
|
|
6931
6970
|
isFavorite: o.boolean().optional().describe("Whether the project is a favorite."),
|
|
@@ -6940,9 +6979,9 @@ const dl = o.object({
|
|
|
6940
6979
|
)
|
|
6941
6980
|
).optional(),
|
|
6942
6981
|
color: Te
|
|
6943
|
-
}),
|
|
6944
|
-
projects: o.array(
|
|
6945
|
-
},
|
|
6982
|
+
}), ul = {
|
|
6983
|
+
projects: o.array(ll).min(1).describe("The projects to update.")
|
|
6984
|
+
}, pl = {
|
|
6946
6985
|
projects: o.array(de).describe("The updated projects."),
|
|
6947
6986
|
totalCount: o.number().describe("The total number of projects updated."),
|
|
6948
6987
|
updatedProjectIds: o.array(o.string()).describe("The IDs of the updated projects."),
|
|
@@ -6952,16 +6991,16 @@ const dl = o.object({
|
|
|
6952
6991
|
skippedCount: o.number().describe("The number of projects skipped (no changes)."),
|
|
6953
6992
|
failureCount: o.number()
|
|
6954
6993
|
}).describe("Summary of operations performed.")
|
|
6955
|
-
},
|
|
6994
|
+
}, hl = {
|
|
6956
6995
|
name: T.UPDATE_PROJECTS,
|
|
6957
6996
|
description: "Update multiple existing projects with new values.",
|
|
6958
|
-
parameters:
|
|
6959
|
-
outputSchema:
|
|
6997
|
+
parameters: ul,
|
|
6998
|
+
outputSchema: pl,
|
|
6960
6999
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
6961
7000
|
async execute(e, t) {
|
|
6962
7001
|
const { projects: s } = e, r = await Promise.allSettled(
|
|
6963
7002
|
s.map(async (l) => {
|
|
6964
|
-
const u =
|
|
7003
|
+
const u = fl(l);
|
|
6965
7004
|
if (u !== null) return { kind: "skipped", reason: u };
|
|
6966
7005
|
const { id: p, ...h } = l;
|
|
6967
7006
|
return { kind: "updated", project: await $(() => t.updateProject(p, h)) };
|
|
@@ -6972,14 +7011,14 @@ const dl = o.object({
|
|
|
6972
7011
|
if (u.status === "rejected") {
|
|
6973
7012
|
i.push({
|
|
6974
7013
|
item: s[l]?.id ?? `Project ${l + 1}`,
|
|
6975
|
-
error:
|
|
7014
|
+
error: D(u.reason)
|
|
6976
7015
|
});
|
|
6977
7016
|
continue;
|
|
6978
7017
|
}
|
|
6979
7018
|
u.value.kind === "updated" ? n.push(ce(u.value.project)) : u.value.reason === "no-fields" ? a++ : c++;
|
|
6980
7019
|
}
|
|
6981
7020
|
return U(T.UPDATE_PROJECTS, s.length, i), {
|
|
6982
|
-
textContent:
|
|
7021
|
+
textContent: ml({
|
|
6983
7022
|
projects: n,
|
|
6984
7023
|
skippedNoFields: a,
|
|
6985
7024
|
skippedNoValidValues: c,
|
|
@@ -6999,7 +7038,7 @@ const dl = o.object({
|
|
|
6999
7038
|
};
|
|
7000
7039
|
}
|
|
7001
7040
|
};
|
|
7002
|
-
function
|
|
7041
|
+
function ml({
|
|
7003
7042
|
projects: e,
|
|
7004
7043
|
skippedNoFields: t,
|
|
7005
7044
|
skippedNoValidValues: s,
|
|
@@ -7010,27 +7049,27 @@ function hl({
|
|
|
7010
7049
|
let a = `Updated ${n} project${n === 1 ? "" : "s"}`;
|
|
7011
7050
|
const c = [];
|
|
7012
7051
|
return t > 0 && c.push(`${t} skipped - no changes`), s > 0 && c.push(`${s} skipped - no valid field values`), c.length > 0 && (a += ` (${c.join(", ")})`), n > 0 && (a += `:
|
|
7013
|
-
${i}`),
|
|
7052
|
+
${i}`), P(a, r);
|
|
7014
7053
|
}
|
|
7015
|
-
function
|
|
7054
|
+
function fl({ id: e, ...t }) {
|
|
7016
7055
|
const s = Object.values(t);
|
|
7017
7056
|
return s.length === 0 ? "no-fields" : s.every((r) => r === void 0) ? "no-valid-values" : null;
|
|
7018
7057
|
}
|
|
7019
|
-
const
|
|
7058
|
+
const bl = o.object({
|
|
7020
7059
|
type: o.literal("relative"),
|
|
7021
7060
|
id: o.string().min(1).describe("The ID of the relative reminder to update."),
|
|
7022
7061
|
minuteOffset: o.number().int().min(0).optional().describe("New minute offset before task due time."),
|
|
7023
|
-
service:
|
|
7024
|
-
isUrgent:
|
|
7062
|
+
service: Re.optional().describe('New delivery method: "email" or "push".'),
|
|
7063
|
+
isUrgent: Pe,
|
|
7025
7064
|
notifyUser: $t
|
|
7026
|
-
}),
|
|
7065
|
+
}), gl = o.object({
|
|
7027
7066
|
type: o.literal("absolute"),
|
|
7028
7067
|
id: o.string().min(1).describe("The ID of the absolute reminder to update."),
|
|
7029
7068
|
due: Xs.optional().describe("New due date/time for the reminder."),
|
|
7030
|
-
service:
|
|
7031
|
-
isUrgent:
|
|
7069
|
+
service: Re.optional().describe('New delivery method: "email" or "push".'),
|
|
7070
|
+
isUrgent: Pe,
|
|
7032
7071
|
notifyUser: $t
|
|
7033
|
-
}),
|
|
7072
|
+
}), yl = o.object({
|
|
7034
7073
|
type: o.literal("location"),
|
|
7035
7074
|
id: o.string().min(1).describe("The ID of the location reminder to update."),
|
|
7036
7075
|
name: o.string().optional().describe("New location name."),
|
|
@@ -7041,15 +7080,15 @@ const fl = o.object({
|
|
|
7041
7080
|
),
|
|
7042
7081
|
radius: o.number().int().optional().describe("New radius in meters."),
|
|
7043
7082
|
notifyUser: $t
|
|
7044
|
-
}),
|
|
7045
|
-
fl,
|
|
7083
|
+
}), Tl = o.discriminatedUnion("type", [
|
|
7046
7084
|
bl,
|
|
7047
|
-
gl
|
|
7048
|
-
|
|
7049
|
-
|
|
7085
|
+
gl,
|
|
7086
|
+
yl
|
|
7087
|
+
]), wl = {
|
|
7088
|
+
reminders: o.array(Tl).min(1).max(xe).describe(
|
|
7050
7089
|
`Array of reminders to update (max ${xe}). Each must include the reminder type and ID. Only include fields that need to change.`
|
|
7051
7090
|
)
|
|
7052
|
-
},
|
|
7091
|
+
}, kl = {
|
|
7053
7092
|
reminders: o.array(wt).describe("The updated reminders."),
|
|
7054
7093
|
totalCount: o.number().describe("Total reminders updated."),
|
|
7055
7094
|
updatedReminderIds: o.array(o.string()).describe("IDs of updated reminders."),
|
|
@@ -7058,11 +7097,11 @@ const fl = o.object({
|
|
|
7058
7097
|
updateCount: o.number(),
|
|
7059
7098
|
failureCount: o.number()
|
|
7060
7099
|
})
|
|
7061
|
-
},
|
|
7100
|
+
}, vl = {
|
|
7062
7101
|
name: T.UPDATE_REMINDERS,
|
|
7063
7102
|
description: 'Update existing reminders. Each reminder must specify its type ("relative", "absolute", or "location") and ID. Only include fields that need to change.',
|
|
7064
|
-
parameters:
|
|
7065
|
-
outputSchema:
|
|
7103
|
+
parameters: wl,
|
|
7104
|
+
outputSchema: kl,
|
|
7066
7105
|
annotations: {
|
|
7067
7106
|
readOnlyHint: !1,
|
|
7068
7107
|
destructiveHint: !0,
|
|
@@ -7111,18 +7150,18 @@ const fl = o.object({
|
|
|
7111
7150
|
), i = [], a = [], c = [];
|
|
7112
7151
|
n.forEach((u, p) => {
|
|
7113
7152
|
if (u.status === "fulfilled") {
|
|
7114
|
-
i.push(
|
|
7153
|
+
i.push(je(u.value));
|
|
7115
7154
|
const h = r[p];
|
|
7116
7155
|
a.push(h?.status === "fulfilled" ? h.value : void 0);
|
|
7117
7156
|
} else
|
|
7118
7157
|
c.push({
|
|
7119
7158
|
item: s[p]?.id ?? `Reminder ${p + 1}`,
|
|
7120
|
-
error:
|
|
7159
|
+
error: D(u.reason)
|
|
7121
7160
|
});
|
|
7122
7161
|
}), U(T.UPDATE_REMINDERS, s.length, c);
|
|
7123
7162
|
const d = i.length === 1 ? "reminder" : "reminders";
|
|
7124
7163
|
return {
|
|
7125
|
-
textContent:
|
|
7164
|
+
textContent: P(
|
|
7126
7165
|
[
|
|
7127
7166
|
`Updated ${i.length} ${d}`,
|
|
7128
7167
|
...Js(i, a)
|
|
@@ -7142,7 +7181,7 @@ const fl = o.object({
|
|
|
7142
7181
|
}
|
|
7143
7182
|
};
|
|
7144
7183
|
}
|
|
7145
|
-
},
|
|
7184
|
+
}, Il = o.object({
|
|
7146
7185
|
id: o.string().min(1).describe("The ID of the section to update."),
|
|
7147
7186
|
name: o.string().min(1).optional().describe("The new name of the section."),
|
|
7148
7187
|
description: o.preprocess(
|
|
@@ -7157,9 +7196,9 @@ const fl = o.object({
|
|
|
7157
7196
|
).optional()
|
|
7158
7197
|
}).refine((e) => e.name !== void 0 || e.description !== void 0, {
|
|
7159
7198
|
message: 'Provide at least one of "name" or "description" to update.'
|
|
7160
|
-
}),
|
|
7161
|
-
sections: o.array(
|
|
7162
|
-
},
|
|
7199
|
+
}), Sl = {
|
|
7200
|
+
sections: o.array(Il).min(1).describe("The sections to update.")
|
|
7201
|
+
}, Cl = {
|
|
7163
7202
|
sections: o.array(Z).describe("The updated sections."),
|
|
7164
7203
|
totalCount: o.number().describe("The total number of sections updated."),
|
|
7165
7204
|
updatedSectionIds: o.array(o.string()).describe("The IDs of the updated sections."),
|
|
@@ -7168,11 +7207,11 @@ const fl = o.object({
|
|
|
7168
7207
|
updateCount: o.number(),
|
|
7169
7208
|
failureCount: o.number()
|
|
7170
7209
|
})
|
|
7171
|
-
},
|
|
7210
|
+
}, jl = {
|
|
7172
7211
|
name: T.UPDATE_SECTIONS,
|
|
7173
7212
|
description: "Update multiple existing sections with new values.",
|
|
7174
|
-
parameters:
|
|
7175
|
-
outputSchema:
|
|
7213
|
+
parameters: Sl,
|
|
7214
|
+
outputSchema: Cl,
|
|
7176
7215
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
7177
7216
|
async execute({ sections: e }, t) {
|
|
7178
7217
|
const s = await Promise.allSettled(
|
|
@@ -7187,10 +7226,10 @@ const fl = o.object({
|
|
|
7187
7226
|
return s.forEach((a, c) => {
|
|
7188
7227
|
a.status === "fulfilled" ? r.push(a.value) : n.push({
|
|
7189
7228
|
item: e[c]?.id ?? `Section ${c + 1}`,
|
|
7190
|
-
error:
|
|
7229
|
+
error: D(a.reason)
|
|
7191
7230
|
});
|
|
7192
7231
|
}), U(T.UPDATE_SECTIONS, e.length, n), {
|
|
7193
|
-
textContent:
|
|
7232
|
+
textContent: $l({
|
|
7194
7233
|
sections: r,
|
|
7195
7234
|
failures: n
|
|
7196
7235
|
}),
|
|
@@ -7207,29 +7246,29 @@ const fl = o.object({
|
|
|
7207
7246
|
};
|
|
7208
7247
|
}
|
|
7209
7248
|
};
|
|
7210
|
-
function
|
|
7249
|
+
function $l({
|
|
7211
7250
|
sections: e,
|
|
7212
7251
|
failures: t
|
|
7213
7252
|
}) {
|
|
7214
7253
|
const s = e.length, r = e.map((i) => `• ${i.name} (id=${i.id}, projectId=${i.projectId})`).join(`
|
|
7215
7254
|
`), n = s > 0 ? `Updated ${s} section${s === 1 ? "" : "s"}:
|
|
7216
7255
|
${r}` : "Updated 0 sections";
|
|
7217
|
-
return
|
|
7256
|
+
return P(n, t);
|
|
7218
7257
|
}
|
|
7219
7258
|
function vo(e, t) {
|
|
7220
7259
|
return t.projectId !== void 0 ? e.projectId === t.projectId && !e.sectionId && !e.parentId : t.sectionId !== void 0 ? e.sectionId === t.sectionId && !e.parentId : e.parentId === t.parentId;
|
|
7221
7260
|
}
|
|
7222
|
-
function
|
|
7261
|
+
function Al(e, t) {
|
|
7223
7262
|
return t.projectId !== void 0 ? e.projectId === t.projectId : t.sectionId !== void 0 ? e.sectionId === t.sectionId : e.parentId === t.parentId;
|
|
7224
7263
|
}
|
|
7225
|
-
function
|
|
7264
|
+
function El(e) {
|
|
7226
7265
|
return e.projectId !== void 0 ? `project:${e.projectId}` : e.sectionId !== void 0 ? `section:${e.sectionId}` : `parent:${e.parentId}`;
|
|
7227
7266
|
}
|
|
7228
7267
|
function Dl(e) {
|
|
7229
7268
|
const t = [];
|
|
7230
7269
|
return e.projectId && t.push({ projectId: e.projectId }), e.sectionId && t.push({ sectionId: e.sectionId }), e.parentId && t.push({ parentId: e.parentId }), t;
|
|
7231
7270
|
}
|
|
7232
|
-
function
|
|
7271
|
+
function xl({
|
|
7233
7272
|
taskId: e,
|
|
7234
7273
|
request: t,
|
|
7235
7274
|
current: s
|
|
@@ -7239,7 +7278,7 @@ function El({
|
|
|
7239
7278
|
return { redundantMoveSkipped: !1 };
|
|
7240
7279
|
let n = r, i = !1;
|
|
7241
7280
|
if (s) {
|
|
7242
|
-
const a = r.length === 1 ? (c) => vo(s, c) : (c) =>
|
|
7281
|
+
const a = r.length === 1 ? (c) => vo(s, c) : (c) => Al(s, c);
|
|
7243
7282
|
n = r.filter((c) => !a(c)), i = n.length < r.length;
|
|
7244
7283
|
}
|
|
7245
7284
|
if (n.length === 0)
|
|
@@ -7250,7 +7289,7 @@ function El({
|
|
|
7250
7289
|
);
|
|
7251
7290
|
return { move: n[0], redundantMoveSkipped: i };
|
|
7252
7291
|
}
|
|
7253
|
-
const
|
|
7292
|
+
const Ol = o.object({
|
|
7254
7293
|
id: o.string().min(1).describe("The ID of the task to update."),
|
|
7255
7294
|
content: o.string().optional().describe(
|
|
7256
7295
|
'The new task name/title. Should be concise and actionable (e.g., "Review PR #123", "Call dentist"). For longer content, use the description field instead. Supports Markdown.'
|
|
@@ -7296,8 +7335,8 @@ const xl = o.object({
|
|
|
7296
7335
|
isUncompletable: o.boolean().optional().describe(
|
|
7297
7336
|
"Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
|
|
7298
7337
|
)
|
|
7299
|
-
}),
|
|
7300
|
-
tasks: o.array(
|
|
7338
|
+
}), Ul = (e) => !!(e.projectId || e.sectionId || e.parentId), Io = (e) => Object.keys(e).length > 0, _l = ["remove", "no date"], Rl = ["remove", "no date", "no deadline"], cs = "no date", at = vs.TASKS_PER_OPERATION, ds = {
|
|
7339
|
+
tasks: o.array(Ol).min(1).max(at).describe(`The tasks to update (max ${at}).`)
|
|
7301
7340
|
}, Pl = {
|
|
7302
7341
|
tasks: o.array(V).describe("The updated tasks."),
|
|
7303
7342
|
totalCount: o.number().describe("The total number of tasks updated."),
|
|
@@ -7311,7 +7350,7 @@ const xl = o.object({
|
|
|
7311
7350
|
"Moves not performed because the task was already in the requested destination. A non-zero count means container fields were sent that did not need to be."
|
|
7312
7351
|
)
|
|
7313
7352
|
}).describe("Summary of operations performed.")
|
|
7314
|
-
},
|
|
7353
|
+
}, Nl = {
|
|
7315
7354
|
name: T.UPDATE_TASKS,
|
|
7316
7355
|
description: "Update existing tasks including content, dates, priorities, and assignments. Send only the fields that change.",
|
|
7317
7356
|
parameters: ds,
|
|
@@ -7327,12 +7366,12 @@ const xl = o.object({
|
|
|
7327
7366
|
const { tasks: s } = o.object(ds).parse(e), r = s.map(() => ({ kind: "skipped" })), n = (y, v) => {
|
|
7328
7367
|
r[y] = { kind: "failed", error: v };
|
|
7329
7368
|
}, i = (y, v) => {
|
|
7330
|
-
n(y,
|
|
7331
|
-
}, a = s.map((y, v) => ({ task: y, index: v })).filter(({ task: y }) =>
|
|
7369
|
+
n(y, D(v));
|
|
7370
|
+
}, a = s.map((y, v) => ({ task: y, index: v })).filter(({ task: y }) => zl(y)), c = await Ml(
|
|
7332
7371
|
a.map(({ task: y }) => y),
|
|
7333
7372
|
t
|
|
7334
7373
|
), d = await Promise.allSettled(
|
|
7335
|
-
a.map(({ task: y, index: v }) =>
|
|
7374
|
+
a.map(({ task: y, index: v }) => Kl({ task: y, index: v, client: t, inbox: c }))
|
|
7336
7375
|
), l = [];
|
|
7337
7376
|
for (const [y, v] of d.entries()) {
|
|
7338
7377
|
const A = a[y]?.index ?? y;
|
|
@@ -7342,14 +7381,14 @@ const xl = o.object({
|
|
|
7342
7381
|
client: t,
|
|
7343
7382
|
ids: [
|
|
7344
7383
|
...new Set(
|
|
7345
|
-
l.filter((y) =>
|
|
7384
|
+
l.filter((y) => Ul(y.moveRequest) || y.checkRecurrence).map((y) => y.id)
|
|
7346
7385
|
)
|
|
7347
7386
|
]
|
|
7348
7387
|
});
|
|
7349
7388
|
for (const y of l) {
|
|
7350
7389
|
if (!y.checkRecurrence)
|
|
7351
7390
|
continue;
|
|
7352
|
-
const v =
|
|
7391
|
+
const v = Fl({
|
|
7353
7392
|
id: y.id,
|
|
7354
7393
|
current: u.get(y.id),
|
|
7355
7394
|
readFailed: p
|
|
@@ -7360,7 +7399,7 @@ const xl = o.object({
|
|
|
7360
7399
|
for (const y of l)
|
|
7361
7400
|
if (!y.failed)
|
|
7362
7401
|
try {
|
|
7363
|
-
const v =
|
|
7402
|
+
const v = xl({
|
|
7364
7403
|
taskId: y.id,
|
|
7365
7404
|
request: y.moveRequest,
|
|
7366
7405
|
current: u.get(y.id)
|
|
@@ -7372,7 +7411,7 @@ const xl = o.object({
|
|
|
7372
7411
|
const f = /* @__PURE__ */ new Map(), b = [], m = (y) => {
|
|
7373
7412
|
const v = y.filter((A) => !A.failed);
|
|
7374
7413
|
v.length !== 0 && b.push(
|
|
7375
|
-
|
|
7414
|
+
Bl({
|
|
7376
7415
|
client: t,
|
|
7377
7416
|
items: v,
|
|
7378
7417
|
onUpdated: (A, x) => {
|
|
@@ -7384,7 +7423,7 @@ const xl = o.object({
|
|
|
7384
7423
|
r[A.index] = {
|
|
7385
7424
|
kind: "partial",
|
|
7386
7425
|
task: O.task,
|
|
7387
|
-
error: `Move applied; field update failed: ${
|
|
7426
|
+
error: `Move applied; field update failed: ${D(x)}`
|
|
7388
7427
|
};
|
|
7389
7428
|
return;
|
|
7390
7429
|
}
|
|
@@ -7393,7 +7432,7 @@ const xl = o.object({
|
|
|
7393
7432
|
})
|
|
7394
7433
|
);
|
|
7395
7434
|
}, g = new Set(h.map(({ item: y }) => y.index));
|
|
7396
|
-
m(l.filter((y) => !g.has(y.index))), await
|
|
7435
|
+
m(l.filter((y) => !g.has(y.index))), await Hl({
|
|
7397
7436
|
client: t,
|
|
7398
7437
|
moving: h,
|
|
7399
7438
|
results: f,
|
|
@@ -7416,9 +7455,9 @@ const xl = o.object({
|
|
|
7416
7455
|
const v = f.get(y.index);
|
|
7417
7456
|
v && "task" in v && (r[y.index] = { kind: "updated", task: v.task });
|
|
7418
7457
|
}
|
|
7419
|
-
const { updatedTasks: w, failures: I, skippedCount: k } =
|
|
7458
|
+
const { updatedTasks: w, failures: I, skippedCount: k } = Ll({ tasks: s, outcomes: r }), C = l.filter((y) => y.redundantMoveSkipped).length, j = w.map(H);
|
|
7420
7459
|
return U(T.UPDATE_TASKS, s.length, I), {
|
|
7421
|
-
textContent:
|
|
7460
|
+
textContent: Gl({
|
|
7422
7461
|
tasks: j,
|
|
7423
7462
|
failures: I,
|
|
7424
7463
|
skippedCount: k,
|
|
@@ -7439,7 +7478,7 @@ const xl = o.object({
|
|
|
7439
7478
|
};
|
|
7440
7479
|
}
|
|
7441
7480
|
};
|
|
7442
|
-
function
|
|
7481
|
+
function Ll({ tasks: e, outcomes: t }) {
|
|
7443
7482
|
const s = [], r = [];
|
|
7444
7483
|
let n = 0;
|
|
7445
7484
|
for (const [i, a] of t.entries()) {
|
|
@@ -7456,7 +7495,7 @@ function Nl({ tasks: e, outcomes: t }) {
|
|
|
7456
7495
|
}
|
|
7457
7496
|
return { updatedTasks: s, failures: r, skippedCount: n };
|
|
7458
7497
|
}
|
|
7459
|
-
async function
|
|
7498
|
+
async function Ml(e, t) {
|
|
7460
7499
|
if (!e.some((s) => Y(s.projectId)))
|
|
7461
7500
|
return {};
|
|
7462
7501
|
try {
|
|
@@ -7481,7 +7520,7 @@ async function So({
|
|
|
7481
7520
|
}
|
|
7482
7521
|
return { states: s, readFailed: !1 };
|
|
7483
7522
|
}
|
|
7484
|
-
function
|
|
7523
|
+
function Fl({
|
|
7485
7524
|
id: e,
|
|
7486
7525
|
current: t,
|
|
7487
7526
|
readFailed: s
|
|
@@ -7491,7 +7530,7 @@ function Ml({
|
|
|
7491
7530
|
if (t?.due?.isRecurring)
|
|
7492
7531
|
return `Task ${e} recurs ("${t.due.string}"). dueString would replace that rule and make it a one-time task, so nothing was changed. To move it to another date or time, use ${T.RESCHEDULE_TASKS} (it also accepts duration). To change or drop the recurrence on purpose, resend with replaceRecurrence: true.`;
|
|
7493
7532
|
}
|
|
7494
|
-
async function
|
|
7533
|
+
async function Hl({
|
|
7495
7534
|
client: e,
|
|
7496
7535
|
moving: t,
|
|
7497
7536
|
results: s,
|
|
@@ -7501,7 +7540,7 @@ async function Fl({
|
|
|
7501
7540
|
return;
|
|
7502
7541
|
const n = /* @__PURE__ */ new Map();
|
|
7503
7542
|
for (const c of t) {
|
|
7504
|
-
const d =
|
|
7543
|
+
const d = El(c.move), l = n.get(d);
|
|
7505
7544
|
l ? l.push(c) : n.set(d, [c]);
|
|
7506
7545
|
}
|
|
7507
7546
|
const i = Ir(e), a = [];
|
|
@@ -7525,26 +7564,26 @@ async function Fl({
|
|
|
7525
7564
|
r(b), f.length > 0 && a.push({ group: f, destination: l });
|
|
7526
7565
|
} catch (p) {
|
|
7527
7566
|
if (u) {
|
|
7528
|
-
s.set(u.item.index, { error:
|
|
7567
|
+
s.set(u.item.index, { error: D(p) }), r(c);
|
|
7529
7568
|
continue;
|
|
7530
7569
|
}
|
|
7531
7570
|
a.push({ group: c, destination: l, error: p });
|
|
7532
7571
|
}
|
|
7533
7572
|
}
|
|
7534
7573
|
if (a.length > 0) {
|
|
7535
|
-
await
|
|
7574
|
+
await Wl({ client: e, unresolved: a, results: s });
|
|
7536
7575
|
for (const { group: c } of a)
|
|
7537
7576
|
r(c);
|
|
7538
7577
|
}
|
|
7539
7578
|
}
|
|
7540
|
-
async function
|
|
7579
|
+
async function Wl({
|
|
7541
7580
|
client: e,
|
|
7542
7581
|
unresolved: t,
|
|
7543
7582
|
results: s
|
|
7544
7583
|
}) {
|
|
7545
7584
|
const r = [...new Set(t.flatMap(({ group: i }) => i.map(({ item: a }) => a.id)))], { states: n } = await So({ client: e, ids: r });
|
|
7546
7585
|
for (const { group: i, destination: a, error: c } of t) {
|
|
7547
|
-
const d = c === void 0 ? "Task not returned by the move" :
|
|
7586
|
+
const d = c === void 0 ? "Task not returned by the move" : D(c);
|
|
7548
7587
|
for (const { item: l } of i) {
|
|
7549
7588
|
const u = n.get(l.id);
|
|
7550
7589
|
if (u && vo(u, a)) {
|
|
@@ -7555,7 +7594,7 @@ async function Hl({
|
|
|
7555
7594
|
}
|
|
7556
7595
|
}
|
|
7557
7596
|
}
|
|
7558
|
-
async function
|
|
7597
|
+
async function Bl({
|
|
7559
7598
|
client: e,
|
|
7560
7599
|
items: t,
|
|
7561
7600
|
onUpdated: s,
|
|
@@ -7575,7 +7614,7 @@ async function Wl({
|
|
|
7575
7614
|
})
|
|
7576
7615
|
);
|
|
7577
7616
|
}
|
|
7578
|
-
async function
|
|
7617
|
+
async function Kl({
|
|
7579
7618
|
task: e,
|
|
7580
7619
|
index: t,
|
|
7581
7620
|
client: s,
|
|
@@ -7602,21 +7641,21 @@ async function Bl({
|
|
|
7602
7641
|
...m,
|
|
7603
7642
|
...h !== void 0 && { labels: h }
|
|
7604
7643
|
};
|
|
7605
|
-
p && (w.priority =
|
|
7644
|
+
p && (w.priority = Ps(p));
|
|
7606
7645
|
const I = ls(
|
|
7607
7646
|
d,
|
|
7608
|
-
|
|
7647
|
+
_l,
|
|
7609
7648
|
cs
|
|
7610
7649
|
);
|
|
7611
7650
|
I !== void 0 && (w = { ...w, dueString: I });
|
|
7612
|
-
const k = ls(f,
|
|
7651
|
+
const k = ls(f, Rl, null);
|
|
7613
7652
|
if (k !== void 0 && (w = { ...w, deadlineDate: k }), l) {
|
|
7614
7653
|
const { amount: C, unit: j } = mt(`Task ${n}`, l);
|
|
7615
7654
|
w = { ...w, duration: C, durationUnit: j };
|
|
7616
7655
|
}
|
|
7617
7656
|
return u !== void 0 && (w = {
|
|
7618
7657
|
...w,
|
|
7619
|
-
assigneeId: await
|
|
7658
|
+
assigneeId: await ql(s, n, u)
|
|
7620
7659
|
}), {
|
|
7621
7660
|
index: t,
|
|
7622
7661
|
id: n,
|
|
@@ -7631,7 +7670,7 @@ async function Bl({
|
|
|
7631
7670
|
failed: !1
|
|
7632
7671
|
};
|
|
7633
7672
|
}
|
|
7634
|
-
async function
|
|
7673
|
+
async function ql(e, t, s) {
|
|
7635
7674
|
if (s === null || s === "unassign")
|
|
7636
7675
|
return null;
|
|
7637
7676
|
const r = await At.validateTaskUpdateAssignment(
|
|
@@ -7645,7 +7684,7 @@ async function Kl(e, t, s) {
|
|
|
7645
7684
|
}
|
|
7646
7685
|
return r.resolvedUser?.userId;
|
|
7647
7686
|
}
|
|
7648
|
-
function
|
|
7687
|
+
function Gl({
|
|
7649
7688
|
tasks: e,
|
|
7650
7689
|
failures: t,
|
|
7651
7690
|
skippedCount: s,
|
|
@@ -7659,14 +7698,14 @@ function ql({
|
|
|
7659
7698
|
});
|
|
7660
7699
|
if (t.length === 0)
|
|
7661
7700
|
return a;
|
|
7662
|
-
const c = t.slice(0,
|
|
7701
|
+
const c = t.slice(0, Ce.MAX_FAILURES_SHOWN), d = t.length - c.length, l = c.map((p) => ` ${p.item}: ${p.error}`).join(`
|
|
7663
7702
|
`), u = d > 0 ? `
|
|
7664
7703
|
+${d} more` : "";
|
|
7665
7704
|
return `${a}
|
|
7666
7705
|
Failed (${t.length}) - address or drop these items:
|
|
7667
7706
|
${l}${u}`;
|
|
7668
7707
|
}
|
|
7669
|
-
function
|
|
7708
|
+
function zl({
|
|
7670
7709
|
id: e,
|
|
7671
7710
|
replaceRecurrence: t,
|
|
7672
7711
|
...s
|
|
@@ -7681,7 +7720,7 @@ function ls(e, t, s) {
|
|
|
7681
7720
|
const r = e.trim().toLowerCase();
|
|
7682
7721
|
return t.includes(r) ? s : e;
|
|
7683
7722
|
}
|
|
7684
|
-
const
|
|
7723
|
+
const Yl = {}, Vl = {
|
|
7685
7724
|
type: o.literal("user_info").describe("The type of the response."),
|
|
7686
7725
|
userId: o.string().describe("The user ID."),
|
|
7687
7726
|
fullName: o.string().describe("The full name of the user."),
|
|
@@ -7698,25 +7737,25 @@ const zl = {}, Yl = {
|
|
|
7698
7737
|
email: o.string().describe("The email address of the user."),
|
|
7699
7738
|
plan: o.enum(["Todoist Free", "Todoist Pro", "Todoist Business"]).describe("The user plan.")
|
|
7700
7739
|
};
|
|
7701
|
-
function
|
|
7740
|
+
function Jl(e) {
|
|
7702
7741
|
return e.businessAccountId ? "Todoist Business" : e.isPremium ? "Todoist Pro" : "Todoist Free";
|
|
7703
7742
|
}
|
|
7704
|
-
function
|
|
7743
|
+
function Xl(e, t) {
|
|
7705
7744
|
const r = ((e.getDay() || 7) - t + 7) % 7, n = new Date(e);
|
|
7706
7745
|
return n.setDate(e.getDate() - r), n;
|
|
7707
7746
|
}
|
|
7708
|
-
function
|
|
7747
|
+
function Zl(e) {
|
|
7709
7748
|
const t = new Date(e);
|
|
7710
7749
|
return t.setDate(e.getDate() + 6), t;
|
|
7711
7750
|
}
|
|
7712
|
-
function
|
|
7751
|
+
function Ql(e) {
|
|
7713
7752
|
const t = new Date(e.getFullYear(), 0, 1), s = (e.getTime() - t.getTime()) / 864e5;
|
|
7714
7753
|
return Math.ceil((s + t.getDay() + 1) / 7);
|
|
7715
7754
|
}
|
|
7716
|
-
function
|
|
7755
|
+
function eu(e) {
|
|
7717
7756
|
return ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"][e === 7 ? 0 : e] ?? "Unknown";
|
|
7718
7757
|
}
|
|
7719
|
-
function
|
|
7758
|
+
function tu(e) {
|
|
7720
7759
|
try {
|
|
7721
7760
|
return new Intl.DateTimeFormat("en-US", { timeZone: e }), !0;
|
|
7722
7761
|
} catch {
|
|
@@ -7724,9 +7763,9 @@ function eu(e) {
|
|
|
7724
7763
|
}
|
|
7725
7764
|
}
|
|
7726
7765
|
function Co(e) {
|
|
7727
|
-
return
|
|
7766
|
+
return tu(e) ? e : "UTC";
|
|
7728
7767
|
}
|
|
7729
|
-
function
|
|
7768
|
+
function su(e, t) {
|
|
7730
7769
|
const s = Co(t);
|
|
7731
7770
|
return e.toLocaleString("en-US", {
|
|
7732
7771
|
timeZone: s,
|
|
@@ -7739,8 +7778,8 @@ function tu(e, t) {
|
|
|
7739
7778
|
hour12: !1
|
|
7740
7779
|
});
|
|
7741
7780
|
}
|
|
7742
|
-
async function
|
|
7743
|
-
const t = await e.getUser(), s = t.tzInfo?.timezone ?? "UTC", r = Co(s), n = /* @__PURE__ */ new Date(), i =
|
|
7781
|
+
async function ou(e) {
|
|
7782
|
+
const t = await e.getUser(), s = t.tzInfo?.timezone ?? "UTC", r = Co(s), n = /* @__PURE__ */ new Date(), i = su(n, r), a = t.startDay ?? 1, c = eu(a), d = Jl(t), l = new Date(n.toLocaleString("en-US", { timeZone: r })), u = Xl(l, a), p = Zl(u), h = Ql(l), b = [
|
|
7744
7783
|
"# User Information",
|
|
7745
7784
|
"",
|
|
7746
7785
|
`**User ID:** ${t.id}`,
|
|
@@ -7782,26 +7821,26 @@ async function su(e) {
|
|
|
7782
7821
|
};
|
|
7783
7822
|
return { textContent: b, structuredContent: m };
|
|
7784
7823
|
}
|
|
7785
|
-
const
|
|
7824
|
+
const ru = {
|
|
7786
7825
|
name: T.USER_INFO,
|
|
7787
7826
|
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).",
|
|
7788
|
-
parameters:
|
|
7789
|
-
outputSchema:
|
|
7827
|
+
parameters: Yl,
|
|
7828
|
+
outputSchema: Vl,
|
|
7790
7829
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
7791
7830
|
async execute(e, t) {
|
|
7792
|
-
const s = await
|
|
7831
|
+
const s = await ou(t);
|
|
7793
7832
|
return {
|
|
7794
7833
|
textContent: s.textContent,
|
|
7795
7834
|
structuredContent: s.structuredContent
|
|
7796
7835
|
};
|
|
7797
7836
|
}
|
|
7798
|
-
}, us = 10 * 1024 * 1024,
|
|
7837
|
+
}, us = 10 * 1024 * 1024, nu = /* @__PURE__ */ new Set([
|
|
7799
7838
|
"image/png",
|
|
7800
7839
|
"image/jpeg",
|
|
7801
7840
|
"image/gif",
|
|
7802
7841
|
"image/webp",
|
|
7803
7842
|
"image/svg+xml"
|
|
7804
|
-
]),
|
|
7843
|
+
]), iu = /* @__PURE__ */ new Set([
|
|
7805
7844
|
"text/plain",
|
|
7806
7845
|
"text/csv",
|
|
7807
7846
|
"text/html",
|
|
@@ -7809,7 +7848,7 @@ const ou = {
|
|
|
7809
7848
|
"application/json",
|
|
7810
7849
|
"application/xml",
|
|
7811
7850
|
"text/xml"
|
|
7812
|
-
]),
|
|
7851
|
+
]), au = {
|
|
7813
7852
|
".png": "image/png",
|
|
7814
7853
|
".jpg": "image/jpeg",
|
|
7815
7854
|
".jpeg": "image/jpeg",
|
|
@@ -7824,23 +7863,23 @@ const ou = {
|
|
|
7824
7863
|
".xml": "application/xml",
|
|
7825
7864
|
".pdf": "application/pdf"
|
|
7826
7865
|
};
|
|
7827
|
-
function au(e) {
|
|
7828
|
-
return ru.has(e) ? "image" : nu.has(e) || e.startsWith("text/") ? "text" : "binary";
|
|
7829
|
-
}
|
|
7830
7866
|
function cu(e) {
|
|
7831
|
-
return (e
|
|
7867
|
+
return nu.has(e) ? "image" : iu.has(e) || e.startsWith("text/") ? "text" : "binary";
|
|
7832
7868
|
}
|
|
7833
7869
|
function du(e) {
|
|
7870
|
+
return (e.split(";")[0] ?? e).trim().toLowerCase();
|
|
7871
|
+
}
|
|
7872
|
+
function lu(e) {
|
|
7834
7873
|
try {
|
|
7835
7874
|
const t = new URL(e).pathname, s = t.lastIndexOf(".");
|
|
7836
7875
|
if (s === -1) return;
|
|
7837
7876
|
const r = t.slice(s).toLowerCase();
|
|
7838
|
-
return
|
|
7877
|
+
return au[r];
|
|
7839
7878
|
} catch {
|
|
7840
7879
|
return;
|
|
7841
7880
|
}
|
|
7842
7881
|
}
|
|
7843
|
-
function
|
|
7882
|
+
function uu(e) {
|
|
7844
7883
|
try {
|
|
7845
7884
|
const t = new URL(e).pathname, s = t.lastIndexOf("/");
|
|
7846
7885
|
return s === -1 ? void 0 : t.slice(s + 1) || void 0;
|
|
@@ -7848,21 +7887,21 @@ function lu(e) {
|
|
|
7848
7887
|
return;
|
|
7849
7888
|
}
|
|
7850
7889
|
}
|
|
7851
|
-
const
|
|
7890
|
+
const pu = {
|
|
7852
7891
|
fileUrl: o.url().describe(
|
|
7853
7892
|
"The URL of the attachment file to view. Get this from the fileUrl field in a comment's fileAttachment."
|
|
7854
7893
|
)
|
|
7855
|
-
},
|
|
7894
|
+
}, hu = {
|
|
7856
7895
|
name: T.VIEW_ATTACHMENT,
|
|
7857
7896
|
description: "View a file attachment from a Todoist comment. Pass the fileUrl from a comment's fileAttachment field. Supports images (returned inline), text files (returned as text), and binary files like PDFs (returned as embedded resources).",
|
|
7858
|
-
parameters:
|
|
7897
|
+
parameters: pu,
|
|
7859
7898
|
annotations: {
|
|
7860
7899
|
readOnlyHint: !0,
|
|
7861
7900
|
destructiveHint: !1,
|
|
7862
7901
|
idempotentHint: !0
|
|
7863
7902
|
},
|
|
7864
7903
|
async execute({ fileUrl: e }, t) {
|
|
7865
|
-
const s = await t.viewAttachment(e), r = s.headers["content-length"], n = r ? Number.parseInt(r, 10) : void 0, i =
|
|
7904
|
+
const s = await t.viewAttachment(e), r = s.headers["content-length"], n = r ? Number.parseInt(r, 10) : void 0, i = uu(e), a = s.headers["content-type"], c = a ? du(a) : void 0, d = c && c !== "application/octet-stream" ? c : lu(e) ?? c ?? "application/octet-stream";
|
|
7866
7905
|
if (n && n > us)
|
|
7867
7906
|
return {
|
|
7868
7907
|
textContent: `Attachment "${i ?? e}" is too large to display inline (${(n / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
|
|
@@ -7872,7 +7911,7 @@ const uu = {
|
|
|
7872
7911
|
return {
|
|
7873
7912
|
textContent: `Attachment "${i ?? e}" is too large to display inline (${(u / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
|
|
7874
7913
|
};
|
|
7875
|
-
const p =
|
|
7914
|
+
const p = cu(d), h = [];
|
|
7876
7915
|
return p === "image" ? h.push({
|
|
7877
7916
|
type: "image",
|
|
7878
7917
|
data: l.toString("base64"),
|
|
@@ -7892,51 +7931,51 @@ const uu = {
|
|
|
7892
7931
|
contentItems: h
|
|
7893
7932
|
};
|
|
7894
7933
|
}
|
|
7895
|
-
},
|
|
7934
|
+
}, mu = {
|
|
7896
7935
|
...Xa,
|
|
7897
7936
|
_meta: {
|
|
7898
7937
|
ui: {
|
|
7899
7938
|
resourceUri: Je
|
|
7900
7939
|
}
|
|
7901
7940
|
}
|
|
7902
|
-
},
|
|
7941
|
+
}, fu = {
|
|
7903
7942
|
// Task management tools
|
|
7904
7943
|
addTasks: xi,
|
|
7905
7944
|
completeTasks: Fi,
|
|
7906
|
-
uncompleteTasks:
|
|
7907
|
-
updateTasks:
|
|
7945
|
+
uncompleteTasks: Hd,
|
|
7946
|
+
updateTasks: Nl,
|
|
7908
7947
|
rescheduleTasks: Sd,
|
|
7909
7948
|
findTasks: rc,
|
|
7910
|
-
findTasksByDate:
|
|
7949
|
+
findTasksByDate: mu,
|
|
7911
7950
|
findCompletedTasks: Sa,
|
|
7912
7951
|
// Project management tools
|
|
7913
7952
|
addProjects: ui,
|
|
7914
|
-
updateProjects:
|
|
7953
|
+
updateProjects: hl,
|
|
7915
7954
|
findProjects: La,
|
|
7916
7955
|
projectManagement: sd,
|
|
7917
7956
|
projectMove: nd,
|
|
7918
7957
|
// Section management tools
|
|
7919
7958
|
addSections: ji,
|
|
7920
|
-
updateSections:
|
|
7959
|
+
updateSections: jl,
|
|
7921
7960
|
findSections: za,
|
|
7922
7961
|
// Comment management tools
|
|
7923
7962
|
addComments: Hn,
|
|
7924
7963
|
findComments: ba,
|
|
7925
|
-
updateComments:
|
|
7964
|
+
updateComments: Gd,
|
|
7926
7965
|
// Reminder management tools
|
|
7927
7966
|
addReminders: ki,
|
|
7928
7967
|
findReminders: Wa,
|
|
7929
|
-
updateReminders:
|
|
7968
|
+
updateReminders: vl,
|
|
7930
7969
|
// Attachment tools
|
|
7931
|
-
viewAttachment:
|
|
7970
|
+
viewAttachment: hu,
|
|
7932
7971
|
// Label management tools
|
|
7933
7972
|
addLabels: oi,
|
|
7934
|
-
updateLabels:
|
|
7973
|
+
updateLabels: al,
|
|
7935
7974
|
findLabels: Aa,
|
|
7936
7975
|
// Filter management tools
|
|
7937
7976
|
findFilters: Yn,
|
|
7938
7977
|
addFilters: Qn,
|
|
7939
|
-
updateFilters:
|
|
7978
|
+
updateFilters: Xd,
|
|
7940
7979
|
// Activity and audit tools
|
|
7941
7980
|
findActivity: da,
|
|
7942
7981
|
getProductivityStats: gc,
|
|
@@ -7950,9 +7989,9 @@ const uu = {
|
|
|
7950
7989
|
deleteObject: Ki,
|
|
7951
7990
|
fetchObject: sa,
|
|
7952
7991
|
reorderObjects: md,
|
|
7953
|
-
userInfo:
|
|
7992
|
+
userInfo: ru,
|
|
7954
7993
|
getUserStatus: Uc,
|
|
7955
|
-
setUserStatus:
|
|
7994
|
+
setUserStatus: Ld,
|
|
7956
7995
|
// Assignment and collaboration tools
|
|
7957
7996
|
findProjectCollaborators: Oa,
|
|
7958
7997
|
manageAssignments: Qc,
|
|
@@ -7962,9 +8001,9 @@ const uu = {
|
|
|
7962
8001
|
// Workspace tools
|
|
7963
8002
|
listWorkspaces: Yc,
|
|
7964
8003
|
// OpenAI MCP tools
|
|
7965
|
-
search:
|
|
8004
|
+
search: Ed,
|
|
7966
8005
|
fetch: na
|
|
7967
|
-
},
|
|
8006
|
+
}, bu = Object.values(fu), gu = `
|
|
7968
8007
|
## Todoist Task and Project Management Tools
|
|
7969
8008
|
|
|
7970
8009
|
You have access to comprehensive Todoist management tools for personal productivity and team collaboration. Use these tools to help users manage tasks, projects, sections, comments, and assignments effectively.
|
|
@@ -8021,8 +8060,8 @@ What each tool does and how to fill its parameters is in the tool's own descript
|
|
|
8021
8060
|
Use the **productivity-analysis** prompt for a combined productivity review — it pulls together user-info, get-productivity-stats and find-completed-tasks.
|
|
8022
8061
|
|
|
8023
8062
|
Always provide clear, actionable task titles and descriptions. Use the overview tools to give users context about their workload and project status.
|
|
8024
|
-
`,
|
|
8025
|
-
function
|
|
8063
|
+
`, Se = { ttlMs: dt, cacheScope: "private" };
|
|
8064
|
+
function _u({
|
|
8026
8065
|
token: e,
|
|
8027
8066
|
baseUrl: t,
|
|
8028
8067
|
features: s = []
|
|
@@ -8034,63 +8073,63 @@ function Uu({
|
|
|
8034
8073
|
tools: { listChanged: !0 },
|
|
8035
8074
|
prompts: { listChanged: !0 }
|
|
8036
8075
|
},
|
|
8037
|
-
instructions:
|
|
8076
|
+
instructions: gu,
|
|
8038
8077
|
cacheHints: {
|
|
8039
|
-
"server/discover":
|
|
8040
|
-
"tools/list":
|
|
8041
|
-
"prompts/list":
|
|
8042
|
-
"resources/list":
|
|
8043
|
-
"resources/templates/list":
|
|
8078
|
+
"server/discover": Se,
|
|
8079
|
+
"tools/list": Se,
|
|
8080
|
+
"prompts/list": Se,
|
|
8081
|
+
"resources/list": Se,
|
|
8082
|
+
"resources/templates/list": Se
|
|
8044
8083
|
}
|
|
8045
8084
|
}
|
|
8046
8085
|
), n = Nr(e, { baseUrl: t });
|
|
8047
|
-
return Qo(r), Qr({ tools:
|
|
8048
|
-
|
|
8086
|
+
return Qo(r), Qr({ tools: bu, server: r, client: n, features: s }), r.registerPrompt(
|
|
8087
|
+
Ie.name,
|
|
8049
8088
|
{
|
|
8050
|
-
title:
|
|
8051
|
-
description:
|
|
8052
|
-
argsSchema:
|
|
8089
|
+
title: Ie.title,
|
|
8090
|
+
description: Ie.description,
|
|
8091
|
+
argsSchema: Ie.argsSchema
|
|
8053
8092
|
},
|
|
8054
|
-
|
|
8093
|
+
Ie.callback
|
|
8055
8094
|
), r;
|
|
8056
8095
|
}
|
|
8057
8096
|
export {
|
|
8058
|
-
|
|
8097
|
+
Ou as $,
|
|
8059
8098
|
mc as A,
|
|
8060
8099
|
gc as B,
|
|
8061
8100
|
vc as C,
|
|
8062
8101
|
Ac as D,
|
|
8063
8102
|
Uc as E,
|
|
8064
|
-
|
|
8103
|
+
Uu as F,
|
|
8065
8104
|
Nc as G,
|
|
8066
8105
|
Wc as H,
|
|
8067
8106
|
Yc as I,
|
|
8068
8107
|
Qc as J,
|
|
8069
8108
|
sd as K,
|
|
8070
8109
|
nd as L,
|
|
8071
|
-
|
|
8110
|
+
bu as M,
|
|
8072
8111
|
md as N,
|
|
8073
8112
|
Sd as O,
|
|
8074
|
-
|
|
8075
|
-
|
|
8076
|
-
|
|
8077
|
-
|
|
8078
|
-
|
|
8079
|
-
|
|
8080
|
-
|
|
8081
|
-
|
|
8082
|
-
|
|
8083
|
-
|
|
8084
|
-
|
|
8085
|
-
|
|
8113
|
+
Ed as P,
|
|
8114
|
+
Ld as Q,
|
|
8115
|
+
Hd as R,
|
|
8116
|
+
Gd as S,
|
|
8117
|
+
Xd as T,
|
|
8118
|
+
al as U,
|
|
8119
|
+
hl as V,
|
|
8120
|
+
vl as W,
|
|
8121
|
+
jl as X,
|
|
8122
|
+
Nl as Y,
|
|
8123
|
+
ru as Z,
|
|
8124
|
+
hu as _,
|
|
8086
8125
|
Hn as a,
|
|
8087
|
-
|
|
8126
|
+
Dr as a0,
|
|
8088
8127
|
Qn as b,
|
|
8089
8128
|
oi as c,
|
|
8090
8129
|
ui as d,
|
|
8091
8130
|
ki as e,
|
|
8092
8131
|
ji as f,
|
|
8093
|
-
|
|
8132
|
+
_u as g,
|
|
8094
8133
|
xi as h,
|
|
8095
8134
|
Ni as i,
|
|
8096
8135
|
Fi as j,
|
|
@@ -8103,7 +8142,7 @@ export {
|
|
|
8103
8142
|
Sa as q,
|
|
8104
8143
|
Yn as r,
|
|
8105
8144
|
Aa as s,
|
|
8106
|
-
|
|
8145
|
+
fu as t,
|
|
8107
8146
|
Oa as u,
|
|
8108
8147
|
La as v,
|
|
8109
8148
|
Wa as w,
|