@doist/todoist-mcp 10.2.0 → 10.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +14 -2
- 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-C1DBNHXt.js → mcp-server-DdZVyZTr.js} +214 -197
- package/dist/{require-valid-todoist-token-CNRFw6f1.js → require-valid-todoist-token-Bx_T4J5L.js} +1 -1
- package/dist/tools/add-sections.d.ts +4 -0
- package/dist/tools/add-sections.d.ts.map +1 -1
- package/dist/tools/fetch-object.d.ts +2 -0
- package/dist/tools/fetch-object.d.ts.map +1 -1
- package/dist/tools/find-sections.d.ts +2 -0
- package/dist/tools/find-sections.d.ts.map +1 -1
- package/dist/tools/get-overview.d.ts +2 -0
- package/dist/tools/get-overview.d.ts.map +1 -1
- package/dist/tools/update-sections.d.ts +6 -2
- package/dist/tools/update-sections.d.ts.map +1 -1
- package/dist/utils/output-schemas.d.ts +6 -3
- package/dist/utils/output-schemas.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -4,10 +4,10 @@ import { readFileSync as ls } from "node:fs";
|
|
|
4
4
|
import { dirname as xt, join as Ne } from "node:path";
|
|
5
5
|
import { fileURLToPath as us } from "node:url";
|
|
6
6
|
import { registerAppResource as ps, RESOURCE_MIME_TYPE as At, registerAppTool as ms } from "@modelcontextprotocol/ext-apps/server";
|
|
7
|
-
import
|
|
7
|
+
import Q, { ZodError as hs, z as s } from "zod";
|
|
8
8
|
import { AsyncLocalStorage as fs } from "node:async_hooks";
|
|
9
9
|
import { createRequire as bs } from "node:module";
|
|
10
|
-
import { TodoistApi as gs, isWorkspaceProject as ke, isPersonalProject as
|
|
10
|
+
import { TodoistApi as gs, isWorkspaceProject as ke, isPersonalProject as ie, colors as Me, LOCATION_TRIGGERS as Et, REMINDER_TYPES as ys, createCommand as Y, REMINDER_DELIVERY_SERVICES as ks, HEALTH_STATUSES as Ve, getTaskUrl as Ot, getProjectUrl as Ut, GOAL_OWNER_TYPES as Ts, WORKSPACE_ROLES as ws, WORKSPACE_PLANS as Is } from "@doist/todoist-sdk";
|
|
11
11
|
import { addDays as Fe, formatISO as ct } from "date-fns";
|
|
12
12
|
const dt = xt(us(import.meta.url)), vs = [
|
|
13
13
|
Ne(dt, "task-list", "index.html"),
|
|
@@ -28,7 +28,7 @@ function js() {
|
|
|
28
28
|
}
|
|
29
29
|
return console.error("Failed to load task list app HTML from any known path:", e), Ss;
|
|
30
30
|
}
|
|
31
|
-
const
|
|
31
|
+
const Pt = js(), Cs = ds("sha256").update(Pt).digest("hex").slice(0, 12), He = `ui://todoist/task-list@${Cs}`, $s = "ui://todoist/task-list@{hash}", We = "Interactive task list widget", Ds = "https://ai.todoist.net", Ge = {
|
|
32
32
|
ui: {
|
|
33
33
|
prefersBorder: !0,
|
|
34
34
|
csp: {
|
|
@@ -51,7 +51,7 @@ function lt(e) {
|
|
|
51
51
|
{
|
|
52
52
|
uri: e,
|
|
53
53
|
mimeType: At,
|
|
54
|
-
text:
|
|
54
|
+
text: Pt,
|
|
55
55
|
_meta: Ge
|
|
56
56
|
}
|
|
57
57
|
]
|
|
@@ -101,7 +101,7 @@ function T(e) {
|
|
|
101
101
|
if (typeof e == "number" || typeof e == "boolean")
|
|
102
102
|
return String(e);
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function ee(e) {
|
|
105
105
|
const t = O(e);
|
|
106
106
|
return t !== void 0 ? t : T(e);
|
|
107
107
|
}
|
|
@@ -111,7 +111,7 @@ function As(e) {
|
|
|
111
111
|
"$1: [REDACTED]"
|
|
112
112
|
).replace(/([?&](?:token|api[_-]?key|authorization)=)[^&\s]+/gi, "$1[REDACTED]").replace(/\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\b/g, "[REDACTED]");
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function P(e, t = 220) {
|
|
115
115
|
const o = As(e).replace(/\s+/g, " ").trim();
|
|
116
116
|
return o.length <= t ? o : `${o.slice(0, t - 3)}...`;
|
|
117
117
|
}
|
|
@@ -129,10 +129,10 @@ function Ee(e) {
|
|
|
129
129
|
function B(e) {
|
|
130
130
|
const t = T(e);
|
|
131
131
|
if (t)
|
|
132
|
-
return
|
|
132
|
+
return P(t);
|
|
133
133
|
if (Array.isArray(e)) {
|
|
134
134
|
const n = e.map((a) => q(a) ? T(a.message) || T(a.error) : T(a)).filter((a) => !!a);
|
|
135
|
-
return n.length > 0 ?
|
|
135
|
+
return n.length > 0 ? P(n.slice(0, 2).join("; ")) : void 0;
|
|
136
136
|
}
|
|
137
137
|
if (!q(e))
|
|
138
138
|
return;
|
|
@@ -144,20 +144,20 @@ function B(e) {
|
|
|
144
144
|
T(e.description)
|
|
145
145
|
);
|
|
146
146
|
if (o)
|
|
147
|
-
return
|
|
147
|
+
return P(o);
|
|
148
148
|
const r = [];
|
|
149
149
|
for (const [n, a] of Object.entries(e)) {
|
|
150
150
|
const i = T(a);
|
|
151
151
|
if (i && (r.push(`${n}: ${i}`), r.length >= 2))
|
|
152
152
|
break;
|
|
153
153
|
}
|
|
154
|
-
return r.length > 0 ?
|
|
154
|
+
return r.length > 0 ? P(r.join("; ")) : void 0;
|
|
155
155
|
}
|
|
156
156
|
function Es(e) {
|
|
157
157
|
if (!e)
|
|
158
158
|
return [];
|
|
159
159
|
const t = /* @__PURE__ */ new Set(), o = (i) => {
|
|
160
|
-
i && t.add(
|
|
160
|
+
i && t.add(P(i, 120));
|
|
161
161
|
}, r = L(
|
|
162
162
|
T(e.field),
|
|
163
163
|
T(e.parameter),
|
|
@@ -230,10 +230,10 @@ const Os = [
|
|
|
230
230
|
function Us(e) {
|
|
231
231
|
return e ? Os.some((t) => e[t] !== void 0) : !1;
|
|
232
232
|
}
|
|
233
|
-
function
|
|
233
|
+
function Ps(e, t) {
|
|
234
234
|
return e === 401 || e === 403 ? "Verify your API token and access permissions, then retry." : e === 404 ? "Confirm the referenced IDs exist and are accessible, then retry." : e === 429 ? "Rate limit reached. Wait briefly and retry." : e !== void 0 && e >= 500 ? "Todoist API may be temporarily unavailable. Retry shortly." : t ? "Fix the field hints above and retry." : e === 400 || e === 422 ? "Check parameter values and formats, then retry." : "Check the request parameters and retry.";
|
|
235
235
|
}
|
|
236
|
-
function
|
|
236
|
+
function _s(e) {
|
|
237
237
|
const t = q(e) ? e : void 0, o = e instanceof Error && q(e.cause) ? e.cause : void 0, r = Be(t?.response, o?.response), n = Be(
|
|
238
238
|
t?.responseData,
|
|
239
239
|
r?.data,
|
|
@@ -254,12 +254,12 @@ function Ps(e) {
|
|
|
254
254
|
Ee(T(o?.message)),
|
|
255
255
|
Ee(typeof e == "string" ? e : void 0)
|
|
256
256
|
), i = L(
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
257
|
+
ee(n?.errorCode),
|
|
258
|
+
ee(n?.error_code),
|
|
259
|
+
ee(n?.code),
|
|
260
|
+
ee(t?.errorCode),
|
|
261
|
+
ee(t?.error_code),
|
|
262
|
+
ee(t?.code)
|
|
263
263
|
), c = L(
|
|
264
264
|
T(n?.errorTag),
|
|
265
265
|
T(n?.error_tag),
|
|
@@ -285,9 +285,9 @@ function Ps(e) {
|
|
|
285
285
|
return a !== void 0 || Us(n) || c !== void 0 || i !== void 0 || (l ? ut(l) : !1) ? {
|
|
286
286
|
statusCode: a,
|
|
287
287
|
code: i,
|
|
288
|
-
tag: c ?
|
|
289
|
-
message: l ?
|
|
290
|
-
details: u ?
|
|
288
|
+
tag: c ? P(c, 80) : void 0,
|
|
289
|
+
message: l ? P(l) : void 0,
|
|
290
|
+
details: u ? P(u) : void 0,
|
|
291
291
|
fieldHints: p
|
|
292
292
|
} : null;
|
|
293
293
|
}
|
|
@@ -297,21 +297,21 @@ function Rs(e) {
|
|
|
297
297
|
const o = [
|
|
298
298
|
t.length > 0 ? `Todoist API request failed (${t.join(", ")}).` : "Todoist API request failed."
|
|
299
299
|
];
|
|
300
|
-
return e.message && o.push(`Message: ${e.message}`), e.details && e.details !== e.message && o.push(`Details: ${e.details}`), e.fieldHints.length > 0 && o.push(`Field hints: ${e.fieldHints.join("; ")}`), o.push(`Try next: ${
|
|
300
|
+
return e.message && o.push(`Message: ${e.message}`), e.details && e.details !== e.message && o.push(`Details: ${e.details}`), e.fieldHints.length > 0 && o.push(`Field hints: ${e.fieldHints.join("; ")}`), o.push(`Try next: ${Ps(e.statusCode, e.fieldHints.length > 0)}`), o.join(`
|
|
301
301
|
`);
|
|
302
302
|
}
|
|
303
303
|
function Ls(e) {
|
|
304
|
-
return e instanceof Error ?
|
|
304
|
+
return e instanceof Error ? P(e.message) : typeof e == "string" ? P(e) : "An unknown error occurred";
|
|
305
305
|
}
|
|
306
306
|
function Ns(e) {
|
|
307
307
|
if (e instanceof hs)
|
|
308
308
|
return e.message;
|
|
309
|
-
const t =
|
|
309
|
+
const t = _s(e);
|
|
310
310
|
return t ? Rs(t) : Ls(e);
|
|
311
311
|
}
|
|
312
|
-
const Ms = "10.
|
|
312
|
+
const Ms = "10.3.0", Fs = {
|
|
313
313
|
version: Ms
|
|
314
|
-
}, Hs = "todoist-mcp", Je = Fs.version,
|
|
314
|
+
}, Hs = "todoist-mcp", Je = Fs.version, _t = new fs(), pt = bs(import.meta.url);
|
|
315
315
|
let ye;
|
|
316
316
|
const Ws = async () => {
|
|
317
317
|
const e = pt.resolve("@doist/todoist-sdk"), t = Ne(xt(e), "transport", "http-dispatcher.js");
|
|
@@ -325,14 +325,14 @@ function Rt(e) {
|
|
|
325
325
|
return e.trim().toLowerCase();
|
|
326
326
|
}
|
|
327
327
|
function Ys(e, t) {
|
|
328
|
-
return
|
|
328
|
+
return _t.run(Rt(e), t);
|
|
329
329
|
}
|
|
330
330
|
function qs({
|
|
331
331
|
label: e,
|
|
332
332
|
platform: t = "mcp",
|
|
333
333
|
sessionId: o = Le()
|
|
334
334
|
} = {}) {
|
|
335
|
-
const r = e ? Rt(e) :
|
|
335
|
+
const r = e ? Rt(e) : _t.getStore();
|
|
336
336
|
return {
|
|
337
337
|
"User-Agent": Bs(),
|
|
338
338
|
"doist-platform": t,
|
|
@@ -800,7 +800,7 @@ function vo(e) {
|
|
|
800
800
|
]
|
|
801
801
|
};
|
|
802
802
|
}
|
|
803
|
-
const
|
|
803
|
+
const me = {
|
|
804
804
|
name: "productivity-analysis",
|
|
805
805
|
title: "Productivity Analysis",
|
|
806
806
|
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.",
|
|
@@ -894,7 +894,7 @@ function Nt(e) {
|
|
|
894
894
|
function Co(e) {
|
|
895
895
|
return { 4: "p1", 3: "p2", 2: "p3", 1: "p4" }[e];
|
|
896
896
|
}
|
|
897
|
-
const E = /* @__PURE__ */ new Map(),
|
|
897
|
+
const E = /* @__PURE__ */ new Map(), te = /* @__PURE__ */ new Map(), Ue = 300 * 1e3, $o = "me";
|
|
898
898
|
class Do {
|
|
899
899
|
/**
|
|
900
900
|
* Resolve a user name or ID to a user ID by looking up collaborators across all shared projects.
|
|
@@ -979,12 +979,12 @@ class Do {
|
|
|
979
979
|
* Get collaborators for a specific project
|
|
980
980
|
*/
|
|
981
981
|
async getProjectCollaborators(t, o) {
|
|
982
|
-
const r = `project_${o}`, n =
|
|
982
|
+
const r = `project_${o}`, n = te.get(r);
|
|
983
983
|
if (n && Date.now() - n.timestamp < Ue)
|
|
984
984
|
return n.result;
|
|
985
985
|
try {
|
|
986
986
|
const a = await t.getProjectCollaborators(o), c = (Array.isArray(a) ? a : a.results || []).filter((d) => d?.id && d.name && d.email);
|
|
987
|
-
return
|
|
987
|
+
return te.set(r, {
|
|
988
988
|
result: c,
|
|
989
989
|
timestamp: Date.now()
|
|
990
990
|
}), c;
|
|
@@ -996,7 +996,7 @@ class Do {
|
|
|
996
996
|
* Get all collaborators from all shared projects, deduplicated by user ID.
|
|
997
997
|
*/
|
|
998
998
|
async getAllCollaborators(t) {
|
|
999
|
-
const o = "all_collaborators", r =
|
|
999
|
+
const o = "all_collaborators", r = te.get(o);
|
|
1000
1000
|
if (r && Date.now() - r.timestamp < Ue)
|
|
1001
1001
|
return r.result;
|
|
1002
1002
|
try {
|
|
@@ -1006,7 +1006,7 @@ class Do {
|
|
|
1006
1006
|
})).filter((u) => u.isShared);
|
|
1007
1007
|
if (a.length === 0) {
|
|
1008
1008
|
const u = [];
|
|
1009
|
-
return
|
|
1009
|
+
return te.set(o, { result: u, timestamp: Date.now() }), u;
|
|
1010
1010
|
}
|
|
1011
1011
|
const i = [], c = /* @__PURE__ */ new Set(), d = a.map(
|
|
1012
1012
|
(u) => this.getProjectCollaborators(t, u.id)
|
|
@@ -1015,7 +1015,7 @@ class Do {
|
|
|
1015
1015
|
if (u.status === "fulfilled")
|
|
1016
1016
|
for (const p of u.value)
|
|
1017
1017
|
p && !c.has(p.id) && (i.push(p), c.add(p.id));
|
|
1018
|
-
return
|
|
1018
|
+
return te.set(o, {
|
|
1019
1019
|
result: i,
|
|
1020
1020
|
timestamp: Date.now()
|
|
1021
1021
|
}), i;
|
|
@@ -1027,7 +1027,7 @@ class Do {
|
|
|
1027
1027
|
* Clear all caches - useful for testing
|
|
1028
1028
|
*/
|
|
1029
1029
|
clearCache() {
|
|
1030
|
-
E.clear(),
|
|
1030
|
+
E.clear(), te.clear();
|
|
1031
1031
|
}
|
|
1032
1032
|
}
|
|
1033
1033
|
const W = new Do();
|
|
@@ -1045,7 +1045,7 @@ async function Qe(e, t) {
|
|
|
1045
1045
|
);
|
|
1046
1046
|
return { userId: o.userId, email: o.email };
|
|
1047
1047
|
}
|
|
1048
|
-
function
|
|
1048
|
+
function ae(e, t) {
|
|
1049
1049
|
return t.length === 0 ? e : e.length === 0 ? t : `${e} & ${t}`;
|
|
1050
1050
|
}
|
|
1051
1051
|
function Ft({
|
|
@@ -1063,12 +1063,12 @@ function Ao({
|
|
|
1063
1063
|
}) {
|
|
1064
1064
|
return t ? e.filter((n) => n.responsibleUid === t) : r === "unassignedOrMe" ? e.filter((n) => !n.responsibleUid || n.responsibleUid === o) : r === "assigned" ? e.filter((n) => n.responsibleUid && n.responsibleUid !== o) : e;
|
|
1065
1065
|
}
|
|
1066
|
-
function
|
|
1066
|
+
function fe(e) {
|
|
1067
1067
|
return e?.toLowerCase() === "inbox";
|
|
1068
1068
|
}
|
|
1069
1069
|
async function K(e) {
|
|
1070
1070
|
const { projectId: t, user: o, client: r } = e;
|
|
1071
|
-
if (!
|
|
1071
|
+
if (!fe(t))
|
|
1072
1072
|
return t;
|
|
1073
1073
|
const n = o || (r ? await r.getUser() : null);
|
|
1074
1074
|
if (!n)
|
|
@@ -1120,7 +1120,7 @@ async function Uo(e, t, o) {
|
|
|
1120
1120
|
limit: $.SECTIONS_MAX
|
|
1121
1121
|
});
|
|
1122
1122
|
}
|
|
1123
|
-
function
|
|
1123
|
+
function Po(e, t, o, r) {
|
|
1124
1124
|
const n = [t, o, r].filter(Boolean);
|
|
1125
1125
|
if (n.length > 1)
|
|
1126
1126
|
throw new Error(
|
|
@@ -1135,7 +1135,7 @@ function _o(e, t, o, r) {
|
|
|
1135
1135
|
if (r) return { parentId: r };
|
|
1136
1136
|
throw new Error("Unexpected error: No valid move parameter found");
|
|
1137
1137
|
}
|
|
1138
|
-
function
|
|
1138
|
+
function _(e) {
|
|
1139
1139
|
return {
|
|
1140
1140
|
id: e.id,
|
|
1141
1141
|
content: e.content,
|
|
@@ -1163,8 +1163,8 @@ function V(e) {
|
|
|
1163
1163
|
color: e.color,
|
|
1164
1164
|
isFavorite: e.isFavorite,
|
|
1165
1165
|
isShared: e.isShared,
|
|
1166
|
-
parentId:
|
|
1167
|
-
inboxProject:
|
|
1166
|
+
parentId: ie(e) ? e.parentId ?? void 0 : void 0,
|
|
1167
|
+
inboxProject: ie(e) ? e.inboxProject ?? !1 : !1,
|
|
1168
1168
|
viewStyle: e.viewStyle,
|
|
1169
1169
|
workspaceId: ke(e) ? e.workspaceId : void 0,
|
|
1170
1170
|
folderId: ke(e) ? e.folderId ?? void 0 : void 0,
|
|
@@ -1208,7 +1208,7 @@ function Ie(e) {
|
|
|
1208
1208
|
progress: e.progress
|
|
1209
1209
|
};
|
|
1210
1210
|
}
|
|
1211
|
-
function
|
|
1211
|
+
function _o(e) {
|
|
1212
1212
|
return {
|
|
1213
1213
|
id: e.id ?? void 0,
|
|
1214
1214
|
objectType: e.objectType,
|
|
@@ -1221,12 +1221,12 @@ function Po(e) {
|
|
|
1221
1221
|
extraData: e.extraData ?? void 0
|
|
1222
1222
|
};
|
|
1223
1223
|
}
|
|
1224
|
-
const Ro =
|
|
1225
|
-
httpStatusCode:
|
|
1226
|
-
responseData:
|
|
1227
|
-
error:
|
|
1228
|
-
errorCode:
|
|
1229
|
-
errorTag:
|
|
1224
|
+
const Ro = Q.object({
|
|
1225
|
+
httpStatusCode: Q.number(),
|
|
1226
|
+
responseData: Q.object({
|
|
1227
|
+
error: Q.string(),
|
|
1228
|
+
errorCode: Q.number(),
|
|
1229
|
+
errorTag: Q.string()
|
|
1230
1230
|
})
|
|
1231
1231
|
});
|
|
1232
1232
|
async function tt({
|
|
@@ -1237,7 +1237,7 @@ async function tt({
|
|
|
1237
1237
|
}) {
|
|
1238
1238
|
try {
|
|
1239
1239
|
const { results: n, nextCursor: a } = await e.getTasksByFilter({ query: t, cursor: r, limit: o });
|
|
1240
|
-
return { tasks: n.map(
|
|
1240
|
+
return { tasks: n.map(_), nextCursor: a };
|
|
1241
1241
|
} catch (n) {
|
|
1242
1242
|
const a = Ro.safeParse(n);
|
|
1243
1243
|
if (!a.success)
|
|
@@ -1257,7 +1257,7 @@ function ht(e) {
|
|
|
1257
1257
|
timezone: e.timezone ?? void 0
|
|
1258
1258
|
};
|
|
1259
1259
|
}
|
|
1260
|
-
function
|
|
1260
|
+
function he(e) {
|
|
1261
1261
|
const t = {
|
|
1262
1262
|
id: e.id,
|
|
1263
1263
|
taskId: e.itemId,
|
|
@@ -1300,9 +1300,9 @@ function Lo(e) {
|
|
|
1300
1300
|
const t = e.toLowerCase();
|
|
1301
1301
|
return (Me.find((r) => r.key === t) ?? Me.find((r) => r.displayName.toLowerCase() === t))?.key;
|
|
1302
1302
|
}
|
|
1303
|
-
const No = `Color for the entity. Accepts a color key (e.g. "berry_red") or display name (e.g. "Berry Red"). Valid colors: ${ve.join(", ")}. Unrecognized colors are omitted and charcoal will be used as the default.`,
|
|
1303
|
+
const No = `Color for the entity. Accepts a color key (e.g. "berry_red") or display name (e.g. "Berry Red"). Valid colors: ${ve.join(", ")}. Unrecognized colors are omitted and charcoal will be used as the default.`, de = s.preprocess(Lo, s.enum(ve).optional()).describe(No);
|
|
1304
1304
|
s.enum(ve).describe("The color key of the entity.");
|
|
1305
|
-
const
|
|
1305
|
+
const le = s.enum(ve).optional().catch(void 0).describe("The color key of the entity."), J = s.object({
|
|
1306
1306
|
id: s.string().describe("The unique ID of the task."),
|
|
1307
1307
|
content: s.string().describe("The task title/content."),
|
|
1308
1308
|
description: s.string().describe("The task description."),
|
|
@@ -1322,11 +1322,11 @@ const de = s.enum(ve).optional().catch(void 0).describe("The color key of the en
|
|
|
1322
1322
|
assignedByUid: s.string().optional().describe("The UID of the user who assigned this task."),
|
|
1323
1323
|
checked: s.boolean().describe("Whether the task is checked/completed."),
|
|
1324
1324
|
completedAt: s.string().optional().describe("When the task was completed (ISO 8601 format).")
|
|
1325
|
-
}),
|
|
1325
|
+
}), ue = s.object({
|
|
1326
1326
|
id: s.string().describe("The unique ID of the project."),
|
|
1327
1327
|
name: s.string().describe("The name of the project."),
|
|
1328
1328
|
description: s.string().describe("The description of the project (empty string if none)."),
|
|
1329
|
-
color:
|
|
1329
|
+
color: le,
|
|
1330
1330
|
isFavorite: s.boolean().describe("Whether the project is marked as favorite."),
|
|
1331
1331
|
isShared: s.boolean().describe("Whether the project is shared."),
|
|
1332
1332
|
parentId: s.string().optional().describe("The ID of the parent project (for sub-projects)."),
|
|
@@ -1337,12 +1337,13 @@ const de = s.enum(ve).optional().catch(void 0).describe("The color key of the en
|
|
|
1337
1337
|
),
|
|
1338
1338
|
folderId: s.string().optional().describe("The ID of the folder this project belongs to (workspace projects only)."),
|
|
1339
1339
|
childOrder: s.number().describe("The ordering index of the project among its siblings.")
|
|
1340
|
-
}),
|
|
1340
|
+
}), ce = s.object({
|
|
1341
1341
|
id: s.string().describe("The unique ID of the section."),
|
|
1342
|
-
name: s.string().describe("The name of the section.")
|
|
1342
|
+
name: s.string().describe("The name of the section."),
|
|
1343
|
+
description: s.string().optional().describe("The description of the section. Supports Markdown.")
|
|
1343
1344
|
});
|
|
1344
|
-
function
|
|
1345
|
-
return { id: e, name: t };
|
|
1345
|
+
function X({ id: e, name: t, description: o }) {
|
|
1346
|
+
return { id: e, name: t, description: o ?? void 0 };
|
|
1346
1347
|
}
|
|
1347
1348
|
const Mo = s.object({
|
|
1348
1349
|
resourceType: s.string().describe("The type of resource (file, url, image, etc)."),
|
|
@@ -1379,10 +1380,10 @@ const Mo = s.object({
|
|
|
1379
1380
|
id: s.string().describe("The unique ID of the user."),
|
|
1380
1381
|
name: s.string().describe("The full name of the user."),
|
|
1381
1382
|
email: s.string().describe("The email address of the user.")
|
|
1382
|
-
}),
|
|
1383
|
+
}), pe = s.object({
|
|
1383
1384
|
id: s.string().describe("The unique ID of the label."),
|
|
1384
1385
|
name: s.string().describe("The name of the label."),
|
|
1385
|
-
color:
|
|
1386
|
+
color: le,
|
|
1386
1387
|
order: s.number().optional().catch(void 0).describe("The display order of the label."),
|
|
1387
1388
|
isFavorite: s.boolean().describe("Whether the label is marked as favorite.")
|
|
1388
1389
|
}), Wo = s.object({
|
|
@@ -1453,7 +1454,7 @@ const Mo = s.object({
|
|
|
1453
1454
|
`Comment ${l + 1}: Cannot provide both taskId and projectId. Choose one.`
|
|
1454
1455
|
);
|
|
1455
1456
|
}
|
|
1456
|
-
const n = o.some((l) =>
|
|
1457
|
+
const n = o.some((l) => fe(l.projectId)) ? await t.getUser() : void 0, a = o.map(async ({ content: l, taskId: u, projectId: p }) => {
|
|
1457
1458
|
const m = await K({
|
|
1458
1459
|
projectId: p,
|
|
1459
1460
|
user: n,
|
|
@@ -1494,7 +1495,7 @@ const Ko = {
|
|
|
1494
1495
|
id: s.string().describe("The unique ID of the filter."),
|
|
1495
1496
|
name: s.string().describe("The name of the filter."),
|
|
1496
1497
|
query: s.string().describe('The filter query string (e.g. "today & p1", "#Work & overdue").'),
|
|
1497
|
-
color:
|
|
1498
|
+
color: le,
|
|
1498
1499
|
isFavorite: s.boolean().describe("Whether the filter is marked as favorite."),
|
|
1499
1500
|
itemOrder: s.number().describe("The display order of the filter.")
|
|
1500
1501
|
}), Vo = {
|
|
@@ -1517,7 +1518,7 @@ const Ko = {
|
|
|
1517
1518
|
id: i.id,
|
|
1518
1519
|
name: i.name,
|
|
1519
1520
|
query: i.query,
|
|
1520
|
-
color:
|
|
1521
|
+
color: le.parse(i.color),
|
|
1521
1522
|
isFavorite: i.isFavorite,
|
|
1522
1523
|
itemOrder: i.itemOrder
|
|
1523
1524
|
}));
|
|
@@ -1556,7 +1557,7 @@ const Zo = s.object({
|
|
|
1556
1557
|
query: s.string().min(1).describe(
|
|
1557
1558
|
'The filter query string. Examples: "today & p1", "#Work & overdue", "@email & today", "(p1 | p2) & !assigned". Operators: | (OR), & (AND), ! (NOT), () grouping, , (multiple queries).'
|
|
1558
1559
|
),
|
|
1559
|
-
color:
|
|
1560
|
+
color: de,
|
|
1560
1561
|
isFavorite: s.boolean().optional().describe("Whether to mark the filter as a favorite. Defaults to false.")
|
|
1561
1562
|
}), Qo = {
|
|
1562
1563
|
filters: s.array(Zo).min(1).describe("The array of filters to add.")
|
|
@@ -1582,7 +1583,7 @@ const Zo = s.object({
|
|
|
1582
1583
|
)), i = (await t.sync({ commands: n })).tempIdMapping ?? {}, c = e.map((p, m) => {
|
|
1583
1584
|
const h = r[m], k = h !== void 0 ? i[h] : void 0;
|
|
1584
1585
|
if (!k) return null;
|
|
1585
|
-
const b = p.color !== void 0 ?
|
|
1586
|
+
const b = p.color !== void 0 ? le.parse(p.color) : void 0;
|
|
1586
1587
|
return {
|
|
1587
1588
|
id: k,
|
|
1588
1589
|
name: p.name,
|
|
@@ -1635,13 +1636,13 @@ ${a}`,
|
|
|
1635
1636
|
}
|
|
1636
1637
|
}, ar = s.object({
|
|
1637
1638
|
name: s.string().min(1).max(128).describe("The name of the label."),
|
|
1638
|
-
color:
|
|
1639
|
+
color: de,
|
|
1639
1640
|
order: s.number().int().optional().describe("The position of the label in the label list."),
|
|
1640
1641
|
isFavorite: s.boolean().optional().describe("Whether the label is a favorite. Defaults to false.")
|
|
1641
1642
|
}), ir = {
|
|
1642
1643
|
labels: s.array(ar).min(1).describe("The array of labels to add.")
|
|
1643
1644
|
}, cr = {
|
|
1644
|
-
labels: s.array(
|
|
1645
|
+
labels: s.array(pe).describe("The created labels."),
|
|
1645
1646
|
totalCount: s.number().describe("The total number of labels created.")
|
|
1646
1647
|
}, dr = {
|
|
1647
1648
|
name: f.ADD_LABELS,
|
|
@@ -1654,7 +1655,7 @@ ${a}`,
|
|
|
1654
1655
|
return {
|
|
1655
1656
|
textContent: lr({ labels: o }),
|
|
1656
1657
|
structuredContent: {
|
|
1657
|
-
labels: o.map((n) =>
|
|
1658
|
+
labels: o.map((n) => pe.parse(n)),
|
|
1658
1659
|
totalCount: o.length
|
|
1659
1660
|
}
|
|
1660
1661
|
};
|
|
@@ -1732,14 +1733,14 @@ const Gt = new mr(), hr = s.object({
|
|
|
1732
1733
|
isFavorite: s.boolean().optional().describe("Whether the project is a favorite. Defaults to false."),
|
|
1733
1734
|
viewStyle: s.enum(["list", "board", "calendar"]).optional().describe('The project view style. Defaults to "list".'),
|
|
1734
1735
|
description: s.string().optional().describe("The description of the project. Supports Markdown."),
|
|
1735
|
-
color:
|
|
1736
|
+
color: de,
|
|
1736
1737
|
workspace: s.string().trim().min(1).optional().describe(
|
|
1737
1738
|
"The workspace to create the project in. Accepts a workspace name or workspace ID. If not provided, creates a personal project. Use list-workspaces to see available workspaces."
|
|
1738
1739
|
)
|
|
1739
1740
|
}), fr = {
|
|
1740
1741
|
projects: s.array(hr).min(1).describe("The array of projects to add.")
|
|
1741
1742
|
}, br = {
|
|
1742
|
-
projects: s.array(
|
|
1743
|
+
projects: s.array(ue).describe("The created projects."),
|
|
1743
1744
|
totalCount: s.number().describe("The total number of projects created.")
|
|
1744
1745
|
}, gr = {
|
|
1745
1746
|
name: f.ADD_PROJECTS,
|
|
@@ -1856,7 +1857,7 @@ const Te = 25, Ce = s.enum(ks), Bt = s.object({
|
|
|
1856
1857
|
radius: c.radius
|
|
1857
1858
|
});
|
|
1858
1859
|
}
|
|
1859
|
-
}), a = (await Promise.all(r)).map(
|
|
1860
|
+
}), a = (await Promise.all(r)).map(he);
|
|
1860
1861
|
return {
|
|
1861
1862
|
textContent: Cr(a),
|
|
1862
1863
|
structuredContent: {
|
|
@@ -1883,11 +1884,12 @@ const $r = s.object({
|
|
|
1883
1884
|
name: s.string().min(1).describe("The name of the section."),
|
|
1884
1885
|
projectId: s.string().min(1).describe(
|
|
1885
1886
|
'The ID of the project to add the section to. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
1886
|
-
)
|
|
1887
|
+
),
|
|
1888
|
+
description: s.string().optional().describe("The description of the section. Supports Markdown.")
|
|
1887
1889
|
}), Dr = {
|
|
1888
1890
|
sections: s.array($r).min(1).describe("The array of sections to add.")
|
|
1889
1891
|
}, xr = {
|
|
1890
|
-
sections: s.array(
|
|
1892
|
+
sections: s.array(ce).describe("The created sections."),
|
|
1891
1893
|
totalCount: s.number().describe("The total number of sections created.")
|
|
1892
1894
|
}, Ar = {
|
|
1893
1895
|
name: f.ADD_SECTIONS,
|
|
@@ -1896,7 +1898,7 @@ const $r = s.object({
|
|
|
1896
1898
|
outputSchema: xr,
|
|
1897
1899
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1898
1900
|
async execute({ sections: e }, t) {
|
|
1899
|
-
const r = e.some((c) =>
|
|
1901
|
+
const r = e.some((c) => fe(c.projectId)) ? await t.getUser() : void 0, n = await Promise.all(
|
|
1900
1902
|
e.map(async (c) => ({
|
|
1901
1903
|
...c,
|
|
1902
1904
|
projectId: await K({
|
|
@@ -1911,7 +1913,7 @@ const $r = s.object({
|
|
|
1911
1913
|
return {
|
|
1912
1914
|
textContent: Er({ sections: a }),
|
|
1913
1915
|
structuredContent: {
|
|
1914
|
-
sections: a.map(
|
|
1916
|
+
sections: a.map(X),
|
|
1915
1917
|
totalCount: a.length
|
|
1916
1918
|
}
|
|
1917
1919
|
};
|
|
@@ -1923,7 +1925,7 @@ function Er({ sections: e }) {
|
|
|
1923
1925
|
return `Added ${t} section${t === 1 ? "" : "s"}:
|
|
1924
1926
|
${o}`;
|
|
1925
1927
|
}
|
|
1926
|
-
const
|
|
1928
|
+
const se = {
|
|
1927
1929
|
USER_NOT_FOUND: "USER_NOT_FOUND",
|
|
1928
1930
|
USER_NOT_COLLABORATOR: "USER_NOT_COLLABORATOR",
|
|
1929
1931
|
PROJECT_NOT_SHARED: "PROJECT_NOT_SHARED",
|
|
@@ -1944,7 +1946,7 @@ class Or {
|
|
|
1944
1946
|
taskId: r,
|
|
1945
1947
|
projectId: n,
|
|
1946
1948
|
error: {
|
|
1947
|
-
type:
|
|
1949
|
+
type: se.USER_NOT_FOUND,
|
|
1948
1950
|
message: `User "${a}" not found`,
|
|
1949
1951
|
suggestions: [
|
|
1950
1952
|
"Check the spelling of the user name or email",
|
|
@@ -1962,7 +1964,7 @@ class Or {
|
|
|
1962
1964
|
projectId: n,
|
|
1963
1965
|
resolvedUser: i,
|
|
1964
1966
|
error: {
|
|
1965
|
-
type:
|
|
1967
|
+
type: se.PROJECT_NOT_SHARED,
|
|
1966
1968
|
message: `Project "${c.name}" is not shared. Task assignments require a shared project with collaborators. Share the project with at least one other person to enable assignments.`,
|
|
1967
1969
|
suggestions: [
|
|
1968
1970
|
"Share the project with at least one collaborator to enable assignments",
|
|
@@ -1981,7 +1983,7 @@ class Or {
|
|
|
1981
1983
|
projectId: n,
|
|
1982
1984
|
resolvedUser: i,
|
|
1983
1985
|
error: {
|
|
1984
|
-
type:
|
|
1986
|
+
type: se.USER_NOT_COLLABORATOR,
|
|
1985
1987
|
message: `User "${i.displayName}" is not a collaborator on project "${c.name}"`,
|
|
1986
1988
|
suggestions: [
|
|
1987
1989
|
"Invite the user to collaborate on this project first",
|
|
@@ -2000,7 +2002,7 @@ class Or {
|
|
|
2000
2002
|
projectId: n,
|
|
2001
2003
|
resolvedUser: i,
|
|
2002
2004
|
error: {
|
|
2003
|
-
type:
|
|
2005
|
+
type: se.TASK_NOT_FOUND,
|
|
2004
2006
|
message: `Task "${r}" not found or not accessible`,
|
|
2005
2007
|
suggestions: [
|
|
2006
2008
|
"Verify the task ID is correct",
|
|
@@ -2023,7 +2025,7 @@ class Or {
|
|
|
2023
2025
|
projectId: n,
|
|
2024
2026
|
resolvedUser: i,
|
|
2025
2027
|
error: {
|
|
2026
|
-
type:
|
|
2028
|
+
type: se.PERMISSION_DENIED,
|
|
2027
2029
|
message: "Permission denied or API error occurred",
|
|
2028
2030
|
suggestions: [
|
|
2029
2031
|
"Check your API permissions",
|
|
@@ -2073,7 +2075,7 @@ class Or {
|
|
|
2073
2075
|
isValid: !1,
|
|
2074
2076
|
taskId: o,
|
|
2075
2077
|
error: {
|
|
2076
|
-
type:
|
|
2078
|
+
type: se.TASK_NOT_FOUND,
|
|
2077
2079
|
message: `Task "${o}" not found or not accessible`,
|
|
2078
2080
|
suggestions: [
|
|
2079
2081
|
"Verify the task ID is correct",
|
|
@@ -2142,7 +2144,7 @@ class Or {
|
|
|
2142
2144
|
}
|
|
2143
2145
|
}
|
|
2144
2146
|
const rt = new Or();
|
|
2145
|
-
function
|
|
2147
|
+
function re(e = /* @__PURE__ */ new Date()) {
|
|
2146
2148
|
const t = e.getFullYear(), o = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0");
|
|
2147
2149
|
return `${t}-${o}-${r}`;
|
|
2148
2150
|
}
|
|
@@ -2180,11 +2182,11 @@ function Ur(e) {
|
|
|
2180
2182
|
const t = e.content || e.title || "Untitled", o = e.dueDate ? ` • due ${e.dueDate}` : "", r = e.priority ? ` • ${e.priority.toUpperCase()}` : "", n = e.projectName ? ` • ${e.projectName}` : "", a = e.id ? ` • id=${e.id}` : "";
|
|
2181
2183
|
return ` ${t}${o}${r}${n}${a}`;
|
|
2182
2184
|
}
|
|
2183
|
-
function
|
|
2185
|
+
function Pr(e) {
|
|
2184
2186
|
const t = ` (${e.color})`, o = e.isFavorite ? " • ⭐" : "", r = ` • id=${e.id}`;
|
|
2185
2187
|
return ` ${e.name}${t}${o}${r}`;
|
|
2186
2188
|
}
|
|
2187
|
-
function
|
|
2189
|
+
function _r(e) {
|
|
2188
2190
|
const t = e.inboxProject ? " • Inbox" : "", o = e.isFavorite ? " • ⭐" : "", r = e.isShared ? " • Shared" : "", n = e.viewStyle && e.viewStyle !== "list" ? ` • ${e.viewStyle}` : "", a = ` • id=${e.id}`;
|
|
2189
2191
|
return ` ${e.name}${t}${o}${r}${n}${a}`;
|
|
2190
2192
|
}
|
|
@@ -2296,7 +2298,7 @@ const bt = 25, Rr = s.object({
|
|
|
2296
2298
|
const p = d.map((m) => `"${m.item}": ${m.error}`).join("; ");
|
|
2297
2299
|
throw new Error(`All ${d.length} task(s) failed to create: ${p}`);
|
|
2298
2300
|
}
|
|
2299
|
-
const l = c.map(
|
|
2301
|
+
const l = c.map(_);
|
|
2300
2302
|
return {
|
|
2301
2303
|
textContent: Hr({
|
|
2302
2304
|
tasks: l,
|
|
@@ -2329,7 +2331,7 @@ async function Fr(e, t, o) {
|
|
|
2329
2331
|
labels: u,
|
|
2330
2332
|
deadlineDate: p,
|
|
2331
2333
|
...m
|
|
2332
|
-
} = e, h =
|
|
2334
|
+
} = e, h = fe(n) ? void 0 : n;
|
|
2333
2335
|
if (h) {
|
|
2334
2336
|
const b = await t.getProject(h);
|
|
2335
2337
|
if (b.isArchived)
|
|
@@ -2401,7 +2403,7 @@ function Hr({
|
|
|
2401
2403
|
}) {
|
|
2402
2404
|
const r = /* @__PURE__ */ new Set();
|
|
2403
2405
|
for (const a of o.tasks)
|
|
2404
|
-
a.projectId && !
|
|
2406
|
+
a.projectId && !fe(a.projectId) ? r.add("projects") : a.sectionId ? r.add("sections") : a.parentId ? r.add("subtasks") : r.add("inbox");
|
|
2405
2407
|
let n = "";
|
|
2406
2408
|
if (r.size === 1) {
|
|
2407
2409
|
const a = Array.from(r)[0];
|
|
@@ -2638,7 +2640,7 @@ const zt = [
|
|
|
2638
2640
|
}, sn = {
|
|
2639
2641
|
type: s.enum(Kt).describe("The type of object fetched."),
|
|
2640
2642
|
id: s.string().describe("The ID of the fetched object."),
|
|
2641
|
-
object: s.union([J,
|
|
2643
|
+
object: s.union([J, ue, Se, ce, je]).describe("The fetched object data.")
|
|
2642
2644
|
}, on = {
|
|
2643
2645
|
name: f.FETCH_OBJECT,
|
|
2644
2646
|
description: "Fetch a single task, project, comment, section, or goal by its ID. Use this when you have a specific object ID and want to retrieve its full details.",
|
|
@@ -2650,7 +2652,7 @@ const zt = [
|
|
|
2650
2652
|
try {
|
|
2651
2653
|
switch (o) {
|
|
2652
2654
|
case "task": {
|
|
2653
|
-
const n = await t.getTask(r), a =
|
|
2655
|
+
const n = await t.getTask(r), a = _(n);
|
|
2654
2656
|
return {
|
|
2655
2657
|
textContent: `Found task: ${a.content} • id=${a.id} • priority=${a.priority} • project=${a.projectId}`,
|
|
2656
2658
|
structuredContent: {
|
|
@@ -2686,10 +2688,7 @@ const zt = [
|
|
|
2686
2688
|
const n = await t.getSection(r);
|
|
2687
2689
|
if (!n)
|
|
2688
2690
|
throw new Error(`Section ${r} not found.`);
|
|
2689
|
-
const a =
|
|
2690
|
-
id: n.id,
|
|
2691
|
-
name: n.name
|
|
2692
|
-
};
|
|
2691
|
+
const a = X(n);
|
|
2693
2692
|
return {
|
|
2694
2693
|
textContent: `Found section: ${a.name} • id=${a.id}`,
|
|
2695
2694
|
structuredContent: {
|
|
@@ -2741,7 +2740,7 @@ const zt = [
|
|
|
2741
2740
|
);
|
|
2742
2741
|
let a;
|
|
2743
2742
|
if (r === "task") {
|
|
2744
|
-
const i = await t.getTask(n), c =
|
|
2743
|
+
const i = await t.getTask(n), c = _(i), d = [c.content];
|
|
2745
2744
|
c.description && d.push(`
|
|
2746
2745
|
|
|
2747
2746
|
Description: ${c.description}`), c.dueDate && d.push(`
|
|
@@ -2828,7 +2827,7 @@ Favorite: Yes`), a = {
|
|
|
2828
2827
|
cursor: l ?? null
|
|
2829
2828
|
};
|
|
2830
2829
|
o && n ? u.objectEventTypes = `${o}:${n}` : o ? u.objectEventTypes = `${o}:` : n && (u.objectEventTypes = `:${n}`), r && r !== "remove" && (u.objectId = r), a && (u.parentProjectId = a), i && (u.parentItemId = i), c && (u.initiatorId = c);
|
|
2831
|
-
const { results: p, nextCursor: m } = await t.getActivityLogs(u), h = p.map(
|
|
2830
|
+
const { results: p, nextCursor: m } = await t.getActivityLogs(u), h = p.map(_o);
|
|
2832
2831
|
return {
|
|
2833
2832
|
textContent: un({ events: h, args: e, nextCursor: m }),
|
|
2834
2833
|
structuredContent: {
|
|
@@ -3089,7 +3088,7 @@ const Sn = {
|
|
|
3089
3088
|
);
|
|
3090
3089
|
const u = await Qe(t, c), p = u?.email;
|
|
3091
3090
|
let h = it(r, n);
|
|
3092
|
-
u && p && (h =
|
|
3091
|
+
u && p && (h = ae(h, `assigned to: ${p}`));
|
|
3093
3092
|
const k = await t.getUser(), b = k.tzInfo?.gmtString || "+00:00", j = await K({
|
|
3094
3093
|
projectId: d,
|
|
3095
3094
|
user: k
|
|
@@ -3113,7 +3112,7 @@ const Sn = {
|
|
|
3113
3112
|
since: y,
|
|
3114
3113
|
until: D,
|
|
3115
3114
|
...h ? { filterQuery: h, filterLang: "en" } : {}
|
|
3116
|
-
}), S = I.map(
|
|
3115
|
+
}), S = I.map(_);
|
|
3117
3116
|
return {
|
|
3118
3117
|
textContent: $n({
|
|
3119
3118
|
tasks: S,
|
|
@@ -3223,7 +3222,7 @@ const Dn = {
|
|
|
3223
3222
|
"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."
|
|
3224
3223
|
)
|
|
3225
3224
|
}, On = {
|
|
3226
|
-
labels: s.array(
|
|
3225
|
+
labels: s.array(pe).describe("The found personal labels."),
|
|
3227
3226
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
3228
3227
|
totalCount: s.number().describe("The total number of labels in this page."),
|
|
3229
3228
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
@@ -3246,9 +3245,9 @@ const Dn = {
|
|
|
3246
3245
|
Oo(t)
|
|
3247
3246
|
]), { results: n, nextCursor: a } = o, i = e.searchText ? { searchText: e.searchText } : { limit: e.limit, cursor: e.cursor };
|
|
3248
3247
|
return {
|
|
3249
|
-
textContent:
|
|
3248
|
+
textContent: Pn({ labels: n, args: e, nextCursor: a, sharedLabels: r }),
|
|
3250
3249
|
structuredContent: {
|
|
3251
|
-
labels: n.map((c) =>
|
|
3250
|
+
labels: n.map((c) => pe.parse(c)),
|
|
3252
3251
|
nextCursor: a ?? void 0,
|
|
3253
3252
|
totalCount: n.length,
|
|
3254
3253
|
hasMore: !!a,
|
|
@@ -3258,7 +3257,7 @@ const Dn = {
|
|
|
3258
3257
|
};
|
|
3259
3258
|
}
|
|
3260
3259
|
};
|
|
3261
|
-
function
|
|
3260
|
+
function Pn({
|
|
3262
3261
|
labels: e,
|
|
3263
3262
|
args: t,
|
|
3264
3263
|
nextCursor: o,
|
|
@@ -3266,7 +3265,7 @@ function _n({
|
|
|
3266
3265
|
}) {
|
|
3267
3266
|
const n = t.searchText ? `All labels matching "${t.searchText}"` : "Labels", a = [];
|
|
3268
3267
|
t.searchText && a.push(`searchText: "${t.searchText}"`);
|
|
3269
|
-
const i = 10, d = e.slice(0, i).map(
|
|
3268
|
+
const i = 10, d = e.slice(0, i).map(Pr).join(`
|
|
3270
3269
|
`), l = e.length - i, u = l > 0 ? `${d}
|
|
3271
3270
|
…and ${l} more` : d, p = [];
|
|
3272
3271
|
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"));
|
|
@@ -3283,7 +3282,7 @@ No shared labels.`;
|
|
|
3283
3282
|
zeroReasonHints: p
|
|
3284
3283
|
}) + m;
|
|
3285
3284
|
}
|
|
3286
|
-
const { FIND_PROJECTS: Jt, ADD_TASKS: Xt, UPDATE_TASKS: Zt } = f,
|
|
3285
|
+
const { FIND_PROJECTS: Jt, ADD_TASKS: Xt, UPDATE_TASKS: Zt } = f, _n = {
|
|
3287
3286
|
projectId: s.string().min(1).optional().describe(
|
|
3288
3287
|
'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.'
|
|
3289
3288
|
),
|
|
@@ -3303,7 +3302,7 @@ const { FIND_PROJECTS: Jt, ADD_TASKS: Xt, UPDATE_TASKS: Zt } = f, Pn = {
|
|
|
3303
3302
|
}, Ln = {
|
|
3304
3303
|
name: f.FIND_PROJECT_COLLABORATORS,
|
|
3305
3304
|
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.`,
|
|
3306
|
-
parameters:
|
|
3305
|
+
parameters: _n,
|
|
3307
3306
|
outputSchema: Rn,
|
|
3308
3307
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3309
3308
|
async execute(e, t) {
|
|
@@ -3472,7 +3471,7 @@ const { ADD_PROJECTS: Fn } = f, Hn = {
|
|
|
3472
3471
|
"The cursor to get the next page of projects (cursor is obtained from the previous call to this tool, with the same parameters)."
|
|
3473
3472
|
)
|
|
3474
3473
|
}, Wn = {
|
|
3475
|
-
projects: s.array(
|
|
3474
|
+
projects: s.array(ue).describe("The found projects."),
|
|
3476
3475
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
3477
3476
|
totalCount: s.number().describe("The total number of projects in this page."),
|
|
3478
3477
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
@@ -3514,7 +3513,7 @@ function Bn({
|
|
|
3514
3513
|
}) {
|
|
3515
3514
|
const r = t.searchText ? `All projects matching "${t.searchText}"` : "Projects", n = [];
|
|
3516
3515
|
t.searchText && n.push(`searchText: "${t.searchText}"`);
|
|
3517
|
-
const a = 10, c = e.slice(0, a).map(
|
|
3516
|
+
const a = 10, c = e.slice(0, a).map(_r).join(`
|
|
3518
3517
|
`), d = e.length - a, l = d > 0 ? `${c}
|
|
3519
3518
|
…and ${d} more` : c, u = [];
|
|
3520
3519
|
return e.length === 0 && (t.searchText ? (u.push("Try broader search terms"), u.push("Check spelling"), u.push("Remove searchText to see all projects")) : (u.push("No projects created yet"), u.push(`Use ${Fn} to create a project`))), N({
|
|
@@ -3553,7 +3552,7 @@ const Yn = {
|
|
|
3553
3552
|
"Only one of taskId, reminderId, or locationReminderId can be provided at a time."
|
|
3554
3553
|
);
|
|
3555
3554
|
if (r) {
|
|
3556
|
-
const i = await t.getReminder(r), c =
|
|
3555
|
+
const i = await t.getReminder(r), c = he(i);
|
|
3557
3556
|
return {
|
|
3558
3557
|
textContent: `Found ${i.type} reminder (id=${r})`,
|
|
3559
3558
|
structuredContent: {
|
|
@@ -3565,7 +3564,7 @@ const Yn = {
|
|
|
3565
3564
|
};
|
|
3566
3565
|
}
|
|
3567
3566
|
if (n) {
|
|
3568
|
-
const i = await t.getLocationReminder(n), c =
|
|
3567
|
+
const i = await t.getLocationReminder(n), c = he(i);
|
|
3569
3568
|
return {
|
|
3570
3569
|
textContent: `Found location reminder (id=${n})`,
|
|
3571
3570
|
structuredContent: {
|
|
@@ -3586,7 +3585,7 @@ const Yn = {
|
|
|
3586
3585
|
apiMethod: (p) => t.getLocationReminders(p),
|
|
3587
3586
|
args: { taskId: o }
|
|
3588
3587
|
})
|
|
3589
|
-
]), l = [...i, ...c].map(
|
|
3588
|
+
]), l = [...i, ...c].map(he);
|
|
3590
3589
|
return {
|
|
3591
3590
|
textContent: Kn(l, o),
|
|
3592
3591
|
structuredContent: {
|
|
@@ -3622,7 +3621,7 @@ const { ADD_SECTIONS: Vn } = f, Jn = {
|
|
|
3622
3621
|
'Search for a section by name (partial and case insensitive match). Supports wildcards (e.g. "work*" for prefix match). Use "\\*" for a literal asterisk. If omitted, all sections in the project are returned.'
|
|
3623
3622
|
)
|
|
3624
3623
|
}, Xn = {
|
|
3625
|
-
sections: s.array(
|
|
3624
|
+
sections: s.array(ce).describe("The found sections."),
|
|
3626
3625
|
totalCount: s.number().describe("The total number of sections found."),
|
|
3627
3626
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
3628
3627
|
}, Zn = {
|
|
@@ -3640,7 +3639,7 @@ const { ADD_SECTIONS: Vn } = f, Jn = {
|
|
|
3640
3639
|
e.searchText ? r = await Uo(t, e.searchText, o) : r = (await t.getSections({
|
|
3641
3640
|
projectId: o
|
|
3642
3641
|
})).results;
|
|
3643
|
-
const n = r.map(
|
|
3642
|
+
const n = r.map(X);
|
|
3644
3643
|
return {
|
|
3645
3644
|
textContent: Qn({
|
|
3646
3645
|
sections: n,
|
|
@@ -3716,7 +3715,7 @@ const ea = {
|
|
|
3716
3715
|
a = "overdue";
|
|
3717
3716
|
else if (e.startDate === "today")
|
|
3718
3717
|
if (e.daysCount > 1) {
|
|
3719
|
-
const p = /* @__PURE__ */ new Date(), m =
|
|
3718
|
+
const p = /* @__PURE__ */ new Date(), m = re(p), h = Fe(p, e.daysCount), k = ct(h, { representation: "date" }), b = `(due after: ${m} | due: ${m}) & due before: ${k}`;
|
|
3720
3719
|
a = e.overdueOption === "exclude-overdue" ? b : `(${b} | overdue)`;
|
|
3721
3720
|
} else
|
|
3722
3721
|
a = e.overdueOption === "exclude-overdue" ? "today" : "(today | overdue)";
|
|
@@ -3725,13 +3724,13 @@ const ea = {
|
|
|
3725
3724
|
a = `(due after: ${p} | due: ${p}) & due before: ${h}`;
|
|
3726
3725
|
}
|
|
3727
3726
|
const i = it(e.labels, e.labelsOperator);
|
|
3728
|
-
i.length > 0 && (a =
|
|
3727
|
+
i.length > 0 && (a = ae(a, `(${i})`));
|
|
3729
3728
|
const c = Ft({
|
|
3730
3729
|
resolvedAssigneeId: r,
|
|
3731
3730
|
assigneeEmail: n,
|
|
3732
3731
|
responsibleUserFiltering: e.responsibleUserFiltering
|
|
3733
3732
|
});
|
|
3734
|
-
a =
|
|
3733
|
+
a = ae(a, c);
|
|
3735
3734
|
const { tasks: d, nextCursor: l } = await tt({
|
|
3736
3735
|
client: t,
|
|
3737
3736
|
query: a,
|
|
@@ -3765,7 +3764,7 @@ function oa({
|
|
|
3765
3764
|
`today${c}${t.daysCount > 1 ? ` + ${t.daysCount - 1} more days` : ""}`
|
|
3766
3765
|
);
|
|
3767
3766
|
} else if (t.startDate) {
|
|
3768
|
-
const c = t.daysCount > 1 ? ` to ${
|
|
3767
|
+
const c = t.daysCount > 1 ? ` to ${re(Fe(ts(t.startDate), t.daysCount))}` : "";
|
|
3769
3768
|
n.push(`${t.startDate}${c}`);
|
|
3770
3769
|
}
|
|
3771
3770
|
if (t.labels && t.labels.length > 0) {
|
|
@@ -3933,9 +3932,9 @@ const aa = new na(), { FIND_COMPLETED_TASKS: Tt, ADD_TASKS: wt } = f, ia = {
|
|
|
3933
3932
|
cursor: l ?? null
|
|
3934
3933
|
};
|
|
3935
3934
|
r && (x.projectId = await K({ projectId: r, user: k })), n && (x.sectionId = n), a && (x.parentId = a);
|
|
3936
|
-
const { results: M, nextCursor: G } = await t.getTasks(x), xe = M.map(
|
|
3935
|
+
const { results: M, nextCursor: G } = await t.getTasks(x), xe = M.map(_);
|
|
3937
3936
|
let F = o ? xe.filter(
|
|
3938
|
-
(
|
|
3937
|
+
(Z) => Z.content.toLowerCase().includes(o.toLowerCase()) || Z.description?.toLowerCase().includes(o.toLowerCase())
|
|
3939
3938
|
) : xe;
|
|
3940
3939
|
return F = Ao({
|
|
3941
3940
|
tasks: F,
|
|
@@ -3943,11 +3942,11 @@ const aa = new na(), { FIND_COMPLETED_TASKS: Tt, ADD_TASKS: wt } = f, ia = {
|
|
|
3943
3942
|
currentUserId: k.id,
|
|
3944
3943
|
responsibleUserFiltering: c
|
|
3945
3944
|
}), u && u.length > 0 && (F = p === "and" ? F.filter(
|
|
3946
|
-
(
|
|
3945
|
+
(Z) => u.every((Ae) => Z.labels.includes(Ae))
|
|
3947
3946
|
) : F.filter(
|
|
3948
|
-
(
|
|
3947
|
+
(Z) => u.some((Ae) => Z.labels.includes(Ae))
|
|
3949
3948
|
)), {
|
|
3950
|
-
textContent:
|
|
3949
|
+
textContent: Pe({
|
|
3951
3950
|
tasks: F,
|
|
3952
3951
|
args: e,
|
|
3953
3952
|
nextCursor: G,
|
|
@@ -3969,9 +3968,9 @@ const aa = new na(), { FIND_COMPLETED_TASKS: Tt, ADD_TASKS: wt } = f, ia = {
|
|
|
3969
3968
|
lang: "en",
|
|
3970
3969
|
limit: d,
|
|
3971
3970
|
cursor: l ?? null
|
|
3972
|
-
}), G = x.map(
|
|
3971
|
+
}), G = x.map(_);
|
|
3973
3972
|
return {
|
|
3974
|
-
textContent:
|
|
3973
|
+
textContent: Pe({
|
|
3975
3974
|
tasks: G,
|
|
3976
3975
|
args: e,
|
|
3977
3976
|
nextCursor: M,
|
|
@@ -3988,15 +3987,15 @@ const aa = new na(), { FIND_COMPLETED_TASKS: Tt, ADD_TASKS: wt } = f, ia = {
|
|
|
3988
3987
|
};
|
|
3989
3988
|
}
|
|
3990
3989
|
let y = j ? `(${j})` : "";
|
|
3991
|
-
o && (y =
|
|
3990
|
+
o && (y = ae(y, `search: ${o}`));
|
|
3992
3991
|
const D = it(u, p);
|
|
3993
|
-
if (y =
|
|
3992
|
+
if (y = ae(y, D), !(h && !i && !c)) {
|
|
3994
3993
|
const x = Ft({
|
|
3995
3994
|
resolvedAssigneeId: A,
|
|
3996
3995
|
assigneeEmail: w,
|
|
3997
3996
|
responsibleUserFiltering: c
|
|
3998
3997
|
});
|
|
3999
|
-
y =
|
|
3998
|
+
y = ae(y, x);
|
|
4000
3999
|
}
|
|
4001
4000
|
const { tasks: I, nextCursor: C } = await tt({
|
|
4002
4001
|
client: t,
|
|
@@ -4005,7 +4004,7 @@ const aa = new na(), { FIND_COMPLETED_TASKS: Tt, ADD_TASKS: wt } = f, ia = {
|
|
|
4005
4004
|
limit: e.limit
|
|
4006
4005
|
});
|
|
4007
4006
|
return {
|
|
4008
|
-
textContent:
|
|
4007
|
+
textContent: Pe({
|
|
4009
4008
|
tasks: I,
|
|
4010
4009
|
args: e,
|
|
4011
4010
|
nextCursor: C,
|
|
@@ -4039,7 +4038,7 @@ function la(e) {
|
|
|
4039
4038
|
}
|
|
4040
4039
|
return [];
|
|
4041
4040
|
}
|
|
4042
|
-
function
|
|
4041
|
+
function Pe({
|
|
4043
4042
|
tasks: e,
|
|
4044
4043
|
args: t,
|
|
4045
4044
|
nextCursor: o,
|
|
@@ -4122,7 +4121,7 @@ const ua = {
|
|
|
4122
4121
|
inbox: s.object({
|
|
4123
4122
|
id: s.string().describe("The inbox project ID."),
|
|
4124
4123
|
name: s.string().describe("The inbox project name."),
|
|
4125
|
-
sections: s.array(
|
|
4124
|
+
sections: s.array(ce).describe("Sections in the inbox project.")
|
|
4126
4125
|
}).nullable().optional().describe("Inbox information (account overview only)."),
|
|
4127
4126
|
projects: s.array(s.lazy(() => ss)).optional().describe(
|
|
4128
4127
|
"List of projects with hierarchy, folders, and ordering (account overview only)."
|
|
@@ -4131,7 +4130,7 @@ const ua = {
|
|
|
4131
4130
|
id: s.string().describe("The project ID."),
|
|
4132
4131
|
name: s.string().describe("The project name.")
|
|
4133
4132
|
}).optional().describe("Project details (project overview only)."),
|
|
4134
|
-
sections: s.array(
|
|
4133
|
+
sections: s.array(ce).optional().describe("List of sections (project overview only)."),
|
|
4135
4134
|
tasks: s.array(s.any()).optional().describe("List of tasks (project overview only)."),
|
|
4136
4135
|
stats: s.object({
|
|
4137
4136
|
totalTasks: s.number(),
|
|
@@ -4151,7 +4150,7 @@ function ma(e) {
|
|
|
4151
4150
|
for (const n of e) {
|
|
4152
4151
|
const a = t[n.id];
|
|
4153
4152
|
if (a)
|
|
4154
|
-
if (
|
|
4153
|
+
if (ie(n) && n.parentId) {
|
|
4155
4154
|
const i = t[n.parentId];
|
|
4156
4155
|
i ? i.children.push(a) : o.push(a);
|
|
4157
4156
|
} else
|
|
@@ -4212,10 +4211,10 @@ function rs(e, t) {
|
|
|
4212
4211
|
return {
|
|
4213
4212
|
id: e.id,
|
|
4214
4213
|
name: e.name,
|
|
4215
|
-
parentId:
|
|
4214
|
+
parentId: ie(e) ? e.parentId ?? void 0 : void 0,
|
|
4216
4215
|
folderId: ke(e) ? e.folderId ?? void 0 : void 0,
|
|
4217
4216
|
childOrder: e.childOrder,
|
|
4218
|
-
sections: (t[e.id] || []).map(
|
|
4217
|
+
sections: (t[e.id] || []).map(X),
|
|
4219
4218
|
children: e.children.map(
|
|
4220
4219
|
(o) => rs(o, t)
|
|
4221
4220
|
)
|
|
@@ -4229,7 +4228,7 @@ async function fa(e, t) {
|
|
|
4229
4228
|
limit: $.TASKS_BATCH_SIZE,
|
|
4230
4229
|
cursor: r ?? void 0
|
|
4231
4230
|
});
|
|
4232
|
-
o = o.concat(n.map(
|
|
4231
|
+
o = o.concat(n.map(_)), r = a ?? void 0;
|
|
4233
4232
|
} while (r);
|
|
4234
4233
|
return o;
|
|
4235
4234
|
}
|
|
@@ -4238,7 +4237,7 @@ async function ba(e, t) {
|
|
|
4238
4237
|
return o;
|
|
4239
4238
|
}
|
|
4240
4239
|
async function ga(e) {
|
|
4241
|
-
const { results: t } = await e.getProjects({}), o = t.find((p) =>
|
|
4240
|
+
const { results: t } = await e.getProjects({}), o = t.find((p) => ie(p) && p.inboxProject === !0), r = t.filter((p) => !ie(p) || p.inboxProject !== !0), n = ma(r), a = t.map((p) => p.id), i = await ha(e, a), c = ["# Personal Projects", ""];
|
|
4242
4241
|
if (o) {
|
|
4243
4242
|
c.push(`- Inbox Project: ${o.name} (id=${o.id})`);
|
|
4244
4243
|
for (const p of i[o.id] || [])
|
|
@@ -4261,7 +4260,7 @@ async function ga(e) {
|
|
|
4261
4260
|
inbox: o ? {
|
|
4262
4261
|
id: o.id,
|
|
4263
4262
|
name: o.name,
|
|
4264
|
-
sections: (i[o.id] || []).map(
|
|
4263
|
+
sections: (i[o.id] || []).map(X)
|
|
4265
4264
|
} : null,
|
|
4266
4265
|
projects: n.map(
|
|
4267
4266
|
(p) => rs(p, i)
|
|
@@ -4307,7 +4306,7 @@ async function ya(e, t) {
|
|
|
4307
4306
|
id: o.id,
|
|
4308
4307
|
name: o.name
|
|
4309
4308
|
},
|
|
4310
|
-
sections: r.map(
|
|
4309
|
+
sections: r.map(X),
|
|
4311
4310
|
tasks: n.map((u) => ({
|
|
4312
4311
|
...u,
|
|
4313
4312
|
children: []
|
|
@@ -4334,7 +4333,7 @@ const ka = {
|
|
|
4334
4333
|
structuredContent: o.structuredContent
|
|
4335
4334
|
};
|
|
4336
4335
|
}
|
|
4337
|
-
}, Ta = {},
|
|
4336
|
+
}, Ta = {}, oe = s.object({
|
|
4338
4337
|
count: s.number().describe("Number of consecutive periods in this streak."),
|
|
4339
4338
|
start: s.string().describe("Start date of the streak."),
|
|
4340
4339
|
end: s.string().describe("End date of the streak.")
|
|
@@ -4361,12 +4360,12 @@ const ka = {
|
|
|
4361
4360
|
goals: s.object({
|
|
4362
4361
|
dailyGoal: s.number().describe("Daily task completion goal."),
|
|
4363
4362
|
weeklyGoal: s.number().describe("Weekly task completion goal."),
|
|
4364
|
-
currentDailyStreak:
|
|
4365
|
-
currentWeeklyStreak:
|
|
4366
|
-
lastDailyStreak:
|
|
4367
|
-
lastWeeklyStreak:
|
|
4368
|
-
maxDailyStreak:
|
|
4369
|
-
maxWeeklyStreak:
|
|
4363
|
+
currentDailyStreak: oe.describe("Current daily goal streak."),
|
|
4364
|
+
currentWeeklyStreak: oe.describe("Current weekly goal streak."),
|
|
4365
|
+
lastDailyStreak: oe.describe("Previous daily goal streak."),
|
|
4366
|
+
lastWeeklyStreak: oe.describe("Previous weekly goal streak."),
|
|
4367
|
+
maxDailyStreak: oe.describe("Best daily goal streak ever."),
|
|
4368
|
+
maxWeeklyStreak: oe.describe("Best weekly goal streak ever."),
|
|
4370
4369
|
vacationMode: s.boolean().describe("Whether vacation mode is enabled."),
|
|
4371
4370
|
karmaDisabled: s.boolean().describe("Whether karma tracking is disabled.")
|
|
4372
4371
|
}).describe("Goal and streak information."),
|
|
@@ -4606,7 +4605,7 @@ function Ua(e, { progress: t, health: o, context: r }) {
|
|
|
4606
4605
|
return n.join(`
|
|
4607
4606
|
`);
|
|
4608
4607
|
}
|
|
4609
|
-
const
|
|
4608
|
+
const Pa = {
|
|
4610
4609
|
name: f.GET_PROJECT_HEALTH,
|
|
4611
4610
|
description: "Get a comprehensive health assessment for a project including completion progress, health status (EXCELLENT, ON_TRACK, AT_RISK, CRITICAL), and optional detailed context with project metrics and task-level recommendations. Use includeContext=true for full detail including task data.",
|
|
4612
4611
|
parameters: Da,
|
|
@@ -4653,7 +4652,7 @@ const _a = {
|
|
|
4653
4652
|
}
|
|
4654
4653
|
};
|
|
4655
4654
|
}
|
|
4656
|
-
},
|
|
4655
|
+
}, _a = {
|
|
4657
4656
|
workspaceIdOrName: s.string().min(1).describe(
|
|
4658
4657
|
"The workspace ID or name. Supports exact ID, exact name match (case-insensitive), or unique partial name match."
|
|
4659
4658
|
),
|
|
@@ -4678,7 +4677,7 @@ const _a = {
|
|
|
4678
4677
|
}, Na = {
|
|
4679
4678
|
name: f.GET_WORKSPACE_INSIGHTS,
|
|
4680
4679
|
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.",
|
|
4681
|
-
parameters:
|
|
4680
|
+
parameters: _a,
|
|
4682
4681
|
outputSchema: La,
|
|
4683
4682
|
annotations: {
|
|
4684
4683
|
readOnlyHint: !0,
|
|
@@ -4904,7 +4903,7 @@ const qa = {
|
|
|
4904
4903
|
newAssigneeId: void 0
|
|
4905
4904
|
}));
|
|
4906
4905
|
return {
|
|
4907
|
-
textContent:
|
|
4906
|
+
textContent: _e({
|
|
4908
4907
|
operation: o,
|
|
4909
4908
|
results: I,
|
|
4910
4909
|
dryRun: !0
|
|
@@ -4941,7 +4940,7 @@ const qa = {
|
|
|
4941
4940
|
throw new Error(`All ${D.length} unassign operation(s) failed: ${I}`);
|
|
4942
4941
|
}
|
|
4943
4942
|
return {
|
|
4944
|
-
textContent:
|
|
4943
|
+
textContent: _e({
|
|
4945
4944
|
operation: o,
|
|
4946
4945
|
results: D,
|
|
4947
4946
|
dryRun: !1
|
|
@@ -5023,7 +5022,7 @@ const qa = {
|
|
|
5023
5022
|
throw new Error(`All ${v.length} ${o} operation(s) failed: ${w}`);
|
|
5024
5023
|
}
|
|
5025
5024
|
return {
|
|
5026
|
-
textContent:
|
|
5025
|
+
textContent: _e({
|
|
5027
5026
|
operation: o,
|
|
5028
5027
|
results: v,
|
|
5029
5028
|
dryRun: i
|
|
@@ -5039,7 +5038,7 @@ const qa = {
|
|
|
5039
5038
|
};
|
|
5040
5039
|
}
|
|
5041
5040
|
};
|
|
5042
|
-
function
|
|
5041
|
+
function _e({
|
|
5043
5042
|
operation: e,
|
|
5044
5043
|
results: t,
|
|
5045
5044
|
dryRun: o
|
|
@@ -5094,7 +5093,7 @@ const Qa = {
|
|
|
5094
5093
|
action: s.enum(["archive", "unarchive"]).describe("The action to perform on the project."),
|
|
5095
5094
|
projectId: s.string().min(1).describe("The ID of the project.")
|
|
5096
5095
|
}, ei = {
|
|
5097
|
-
project:
|
|
5096
|
+
project: ue.describe("The updated project."),
|
|
5098
5097
|
success: s.boolean().describe("Whether the action was successful.")
|
|
5099
5098
|
}, ti = {
|
|
5100
5099
|
name: f.PROJECT_MANAGEMENT,
|
|
@@ -5121,7 +5120,7 @@ const Qa = {
|
|
|
5121
5120
|
"Optional access visibility for the project in the workspace (restricted, team, or public)."
|
|
5122
5121
|
)
|
|
5123
5122
|
}, oi = {
|
|
5124
|
-
project:
|
|
5123
|
+
project: ue.describe("The moved project."),
|
|
5125
5124
|
success: s.boolean().describe("Whether the move was successful.")
|
|
5126
5125
|
}, ri = {
|
|
5127
5126
|
name: f.PROJECT_MOVE,
|
|
@@ -5285,7 +5284,7 @@ const Qa = {
|
|
|
5285
5284
|
const l = d instanceof Error ? d.message : String(d);
|
|
5286
5285
|
throw new Error(`Reschedule failed: ${l}`);
|
|
5287
5286
|
}
|
|
5288
|
-
const a = await Promise.all(o.map((d) => t.getTask(d.id))), i = a.map(
|
|
5287
|
+
const a = await Promise.all(o.map((d) => t.getTask(d.id))), i = a.map(_);
|
|
5289
5288
|
return {
|
|
5290
5289
|
textContent: nt("Rescheduled", i, {
|
|
5291
5290
|
showDetails: i.length <= 5
|
|
@@ -5458,7 +5457,7 @@ const ji = s.object({
|
|
|
5458
5457
|
query: s.string().min(1).optional().describe(
|
|
5459
5458
|
'The new filter query string. Examples: "today & p1", "#Work & overdue", "@email & today".'
|
|
5460
5459
|
),
|
|
5461
|
-
color:
|
|
5460
|
+
color: de,
|
|
5462
5461
|
isFavorite: s.boolean().optional().describe("Whether to mark the filter as a favorite.")
|
|
5463
5462
|
}), Ci = {
|
|
5464
5463
|
filters: s.array(ji).min(1).describe("The filters to update.")
|
|
@@ -5504,7 +5503,7 @@ const ji = s.object({
|
|
|
5504
5503
|
id: m.id,
|
|
5505
5504
|
name: m.name,
|
|
5506
5505
|
query: m.query,
|
|
5507
|
-
color:
|
|
5506
|
+
color: le.parse(m.color),
|
|
5508
5507
|
isFavorite: m.isFavorite,
|
|
5509
5508
|
itemOrder: m.itemOrder
|
|
5510
5509
|
}));
|
|
@@ -5539,16 +5538,16 @@ ${n}`;
|
|
|
5539
5538
|
function Ai({ id: e, ...t }) {
|
|
5540
5539
|
return Object.values(t).every((r) => r === void 0) ? "no-fields" : null;
|
|
5541
5540
|
}
|
|
5542
|
-
const
|
|
5541
|
+
const ne = "remove", Ke = "unassign", Ct = 25, Ei = s.object({
|
|
5543
5542
|
id: s.string().min(1).describe("The ID of the goal to update."),
|
|
5544
5543
|
name: s.string().min(1).optional().describe("New goal name."),
|
|
5545
5544
|
description: s.preprocess(
|
|
5546
|
-
(e) => e === null ?
|
|
5547
|
-
s.string().describe(`New description. Use "${
|
|
5545
|
+
(e) => e === null ? ne : e,
|
|
5546
|
+
s.string().describe(`New description. Use "${ne}" to clear.`)
|
|
5548
5547
|
).optional(),
|
|
5549
5548
|
deadline: s.preprocess(
|
|
5550
|
-
(e) => e === null ?
|
|
5551
|
-
s.string().describe(`New deadline (YYYY-MM-DD). Use "${
|
|
5549
|
+
(e) => e === null ? ne : e,
|
|
5550
|
+
s.string().describe(`New deadline (YYYY-MM-DD). Use "${ne}" to clear.`)
|
|
5552
5551
|
).optional(),
|
|
5553
5552
|
responsibleUid: s.preprocess(
|
|
5554
5553
|
(e) => e === null ? Ke : e,
|
|
@@ -5556,19 +5555,19 @@ const re = "remove", Ke = "unassign", Ct = 25, Ei = s.object({
|
|
|
5556
5555
|
).optional()
|
|
5557
5556
|
}), Oi = ["no-fields", "no-valid-values"], Ui = {
|
|
5558
5557
|
goals: s.array(Ei).min(1).max(Ct).describe(`The array of goals to update (max ${Ct}).`)
|
|
5559
|
-
},
|
|
5558
|
+
}, Pi = s.object({
|
|
5560
5559
|
id: s.string().describe("The ID of the goal that was skipped."),
|
|
5561
5560
|
reason: s.enum(Oi).describe(
|
|
5562
5561
|
'"no-fields" = only the id was supplied; "no-valid-values" = all updatable fields were undefined.'
|
|
5563
5562
|
)
|
|
5564
|
-
}),
|
|
5563
|
+
}), _i = {
|
|
5565
5564
|
goals: s.array(je).describe("The updated goals."),
|
|
5566
5565
|
totalCount: s.number().describe("The total number of goals updated."),
|
|
5567
5566
|
updatedGoalIds: s.array(s.string()).describe("The IDs of the updated goals."),
|
|
5568
5567
|
appliedOperations: s.object({
|
|
5569
5568
|
updateCount: s.number().describe("The number of goals actually updated."),
|
|
5570
5569
|
skippedCount: s.number().describe("The number of goals skipped (no changes)."),
|
|
5571
|
-
skipped: s.array(
|
|
5570
|
+
skipped: s.array(Pi).describe("Per-goal skip details (id + reason).")
|
|
5572
5571
|
}).describe("Summary of operations performed.")
|
|
5573
5572
|
};
|
|
5574
5573
|
function Re(e, t) {
|
|
@@ -5582,7 +5581,7 @@ const Li = {
|
|
|
5582
5581
|
name: f.UPDATE_GOALS,
|
|
5583
5582
|
description: "Update one or more goals by their IDs.",
|
|
5584
5583
|
parameters: Ui,
|
|
5585
|
-
outputSchema:
|
|
5584
|
+
outputSchema: _i,
|
|
5586
5585
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
|
|
5587
5586
|
async execute({ goals: e }, t) {
|
|
5588
5587
|
const o = await Promise.all(
|
|
@@ -5592,8 +5591,8 @@ const Li = {
|
|
|
5592
5591
|
return { kind: "skipped", id: l.id, reason: u };
|
|
5593
5592
|
const { id: p, description: m, deadline: h, responsibleUid: k, ...b } = l, j = await t.updateGoal(p, {
|
|
5594
5593
|
...b,
|
|
5595
|
-
description: Re(m,
|
|
5596
|
-
deadline: Re(h,
|
|
5594
|
+
description: Re(m, ne),
|
|
5595
|
+
deadline: Re(h, ne),
|
|
5597
5596
|
responsibleUid: Re(k, Ke)
|
|
5598
5597
|
});
|
|
5599
5598
|
return { kind: "updated", goal: Ie(j) };
|
|
@@ -5635,7 +5634,7 @@ const Mi = s.object({
|
|
|
5635
5634
|
labelType: s.literal("personal").describe("Update a personal label, identified by its ID."),
|
|
5636
5635
|
id: s.string().min(1).describe("The ID of the personal label to update."),
|
|
5637
5636
|
name: s.string().min(1).max(128).optional().describe("The new name of the label."),
|
|
5638
|
-
color:
|
|
5637
|
+
color: de,
|
|
5639
5638
|
order: s.number().int().optional().describe("The new position of the label in the label list."),
|
|
5640
5639
|
isFavorite: s.boolean().optional().describe("Whether to mark the label as a favorite.")
|
|
5641
5640
|
}), Fi = s.object({
|
|
@@ -5655,7 +5654,7 @@ const Mi = s.object({
|
|
|
5655
5654
|
name: s.string().describe("The previous name of the shared label."),
|
|
5656
5655
|
newName: s.string().describe("The new name of the shared label.")
|
|
5657
5656
|
}), Bi = {
|
|
5658
|
-
updatedLabels: s.array(
|
|
5657
|
+
updatedLabels: s.array(pe).describe("The updated personal labels."),
|
|
5659
5658
|
renamedSharedLabels: s.array(Gi).describe("The shared labels that were renamed."),
|
|
5660
5659
|
totalCount: s.number().describe("The total number of successful operations (personal + shared)."),
|
|
5661
5660
|
appliedOperations: s.object({
|
|
@@ -5683,7 +5682,7 @@ const Mi = s.object({
|
|
|
5683
5682
|
newName: u.newName
|
|
5684
5683
|
}) ? { kind: "renamed", name: u.name, newName: u.newName } : { kind: "skipped", reason: "not-found" };
|
|
5685
5684
|
})
|
|
5686
|
-
), n = r.filter((u) => u.kind === "updated").map((u) =>
|
|
5685
|
+
), n = r.filter((u) => u.kind === "updated").map((u) => pe.parse(u.label)), a = r.filter(
|
|
5687
5686
|
(u) => u.kind === "renamed"
|
|
5688
5687
|
).map(({ name: u, newName: p }) => ({ name: u, newName: p })), i = r.filter((u) => u.kind === "skipped").length, c = r.filter(
|
|
5689
5688
|
(u) => u.kind === "skipped" && u.reason === "no-fields"
|
|
@@ -5753,11 +5752,11 @@ const Ki = s.object({
|
|
|
5753
5752
|
"The description of the project (Markdown). Pass null (or an empty string) to clear it."
|
|
5754
5753
|
)
|
|
5755
5754
|
).optional(),
|
|
5756
|
-
color:
|
|
5755
|
+
color: de
|
|
5757
5756
|
}), Vi = {
|
|
5758
5757
|
projects: s.array(Ki).min(1).describe("The projects to update.")
|
|
5759
5758
|
}, Ji = {
|
|
5760
|
-
projects: s.array(
|
|
5759
|
+
projects: s.array(ue).describe("The updated projects."),
|
|
5761
5760
|
totalCount: s.number().describe("The total number of projects updated."),
|
|
5762
5761
|
updatedProjectIds: s.array(s.string()).describe("The IDs of the updated projects."),
|
|
5763
5762
|
appliedOperations: s.object({
|
|
@@ -5881,7 +5880,7 @@ const ec = s.object({
|
|
|
5881
5880
|
return await t.updateLocationReminder(l, p);
|
|
5882
5881
|
}
|
|
5883
5882
|
}
|
|
5884
|
-
}), a = (await Promise.all(r)).map(
|
|
5883
|
+
}), a = (await Promise.all(r)).map(he), i = a.length === 1 ? "reminder" : "reminders";
|
|
5885
5884
|
return {
|
|
5886
5885
|
textContent: `Updated ${a.length} ${i}`,
|
|
5887
5886
|
structuredContent: {
|
|
@@ -5893,11 +5892,23 @@ const ec = s.object({
|
|
|
5893
5892
|
}
|
|
5894
5893
|
}, ic = s.object({
|
|
5895
5894
|
id: s.string().min(1).describe("The ID of the section to update."),
|
|
5896
|
-
name: s.string().min(1).describe("The new name of the section.")
|
|
5895
|
+
name: s.string().min(1).optional().describe("The new name of the section."),
|
|
5896
|
+
description: s.preprocess(
|
|
5897
|
+
// `null` is the advertised clear value; the param schema stays a
|
|
5898
|
+
// plain string (Gemini forbids nullable schemas, not preprocessing),
|
|
5899
|
+
// so `null` is normalised to "" and then mapped to the section
|
|
5900
|
+
// wire clear (`null`) at execute.
|
|
5901
|
+
(e) => e === null ? "" : e,
|
|
5902
|
+
s.string().describe(
|
|
5903
|
+
"The description of the section (Markdown). Pass null (or an empty string) to clear it."
|
|
5904
|
+
)
|
|
5905
|
+
).optional()
|
|
5906
|
+
}).refine((e) => e.name !== void 0 || e.description !== void 0, {
|
|
5907
|
+
message: 'Provide at least one of "name" or "description" to update.'
|
|
5897
5908
|
}), cc = {
|
|
5898
5909
|
sections: s.array(ic).min(1).describe("The sections to update.")
|
|
5899
5910
|
}, dc = {
|
|
5900
|
-
sections: s.array(
|
|
5911
|
+
sections: s.array(ce).describe("The updated sections."),
|
|
5901
5912
|
totalCount: s.number().describe("The total number of sections updated."),
|
|
5902
5913
|
updatedSectionIds: s.array(s.string()).describe("The IDs of the updated sections.")
|
|
5903
5914
|
}, lc = {
|
|
@@ -5908,14 +5919,20 @@ const ec = s.object({
|
|
|
5908
5919
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5909
5920
|
async execute({ sections: e }, t) {
|
|
5910
5921
|
const o = await Promise.all(
|
|
5911
|
-
e.map((
|
|
5922
|
+
e.map(({ id: n, name: a, description: i }) => {
|
|
5923
|
+
const c = {
|
|
5924
|
+
...a !== void 0 ? { name: a } : {},
|
|
5925
|
+
...i !== void 0 ? { description: i === "" ? null : i } : {}
|
|
5926
|
+
};
|
|
5927
|
+
return t.updateSection(n, c);
|
|
5928
|
+
})
|
|
5912
5929
|
);
|
|
5913
5930
|
return {
|
|
5914
5931
|
textContent: uc({
|
|
5915
5932
|
sections: o
|
|
5916
5933
|
}),
|
|
5917
5934
|
structuredContent: {
|
|
5918
|
-
sections: o.map(
|
|
5935
|
+
sections: o.map(X),
|
|
5919
5936
|
totalCount: o.length,
|
|
5920
5937
|
updatedSectionIds: o.map((n) => n.id)
|
|
5921
5938
|
}
|
|
@@ -6049,11 +6066,11 @@ const pc = s.object({
|
|
|
6049
6066
|
}
|
|
6050
6067
|
if (!w && !u && !p)
|
|
6051
6068
|
return await t.updateTask(d, y);
|
|
6052
|
-
const I =
|
|
6069
|
+
const I = Po(d, w, u, p), C = await t.moveTask(d, I);
|
|
6053
6070
|
return Object.keys(y).length > 0 ? await t.updateTask(d, y) : C;
|
|
6054
6071
|
}), n = (await Promise.all(r)).filter(
|
|
6055
6072
|
(c) => c !== void 0
|
|
6056
|
-
), a = n.map(
|
|
6073
|
+
), a = n.map(_);
|
|
6057
6074
|
return {
|
|
6058
6075
|
textContent: kc({
|
|
6059
6076
|
tasks: a,
|
|
@@ -6164,8 +6181,8 @@ async function Ac(e) {
|
|
|
6164
6181
|
"## Week Settings",
|
|
6165
6182
|
`**Week Start Day:** ${c} (${i})`,
|
|
6166
6183
|
`**Current Week:** Week ${m}`,
|
|
6167
|
-
`**Week Start Date:** ${
|
|
6168
|
-
`**Week End Date:** ${
|
|
6184
|
+
`**Week Start Date:** ${re(u)}`,
|
|
6185
|
+
`**Week End Date:** ${re(p)}`,
|
|
6169
6186
|
"",
|
|
6170
6187
|
"## Daily Progress",
|
|
6171
6188
|
`**Completed Today:** ${t.completedToday}`,
|
|
@@ -6183,8 +6200,8 @@ async function Ac(e) {
|
|
|
6183
6200
|
currentLocalTime: a,
|
|
6184
6201
|
startDay: i,
|
|
6185
6202
|
startDayName: c,
|
|
6186
|
-
weekStartDate:
|
|
6187
|
-
weekEndDate:
|
|
6203
|
+
weekStartDate: re(u),
|
|
6204
|
+
weekEndDate: re(p),
|
|
6188
6205
|
currentWeekNumber: m,
|
|
6189
6206
|
completedToday: t.completedToday,
|
|
6190
6207
|
dailyGoal: t.dailyGoal,
|
|
@@ -6221,7 +6238,7 @@ const Ec = {
|
|
|
6221
6238
|
"application/json",
|
|
6222
6239
|
"application/xml",
|
|
6223
6240
|
"text/xml"
|
|
6224
|
-
]),
|
|
6241
|
+
]), Pc = {
|
|
6225
6242
|
".png": "image/png",
|
|
6226
6243
|
".jpg": "image/jpeg",
|
|
6227
6244
|
".jpeg": "image/jpeg",
|
|
@@ -6236,7 +6253,7 @@ const Ec = {
|
|
|
6236
6253
|
".xml": "application/xml",
|
|
6237
6254
|
".pdf": "application/pdf"
|
|
6238
6255
|
};
|
|
6239
|
-
function
|
|
6256
|
+
function _c(e) {
|
|
6240
6257
|
return Oc.has(e) ? "image" : Uc.has(e) || e.startsWith("text/") ? "text" : "binary";
|
|
6241
6258
|
}
|
|
6242
6259
|
function Rc(e) {
|
|
@@ -6247,7 +6264,7 @@ function Lc(e) {
|
|
|
6247
6264
|
const t = new URL(e).pathname, o = t.lastIndexOf(".");
|
|
6248
6265
|
if (o === -1) return;
|
|
6249
6266
|
const r = t.slice(o).toLowerCase();
|
|
6250
|
-
return
|
|
6267
|
+
return Pc[r];
|
|
6251
6268
|
} catch {
|
|
6252
6269
|
return;
|
|
6253
6270
|
}
|
|
@@ -6284,7 +6301,7 @@ const Mc = {
|
|
|
6284
6301
|
return {
|
|
6285
6302
|
textContent: `Attachment "${a ?? e}" is too large to display inline (${(u / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
|
|
6286
6303
|
};
|
|
6287
|
-
const p =
|
|
6304
|
+
const p = _c(d), m = [];
|
|
6288
6305
|
return p === "image" ? m.push({
|
|
6289
6306
|
type: "image",
|
|
6290
6307
|
data: l.toString("base64"),
|
|
@@ -6429,14 +6446,14 @@ function td({
|
|
|
6429
6446
|
};
|
|
6430
6447
|
xs(r);
|
|
6431
6448
|
const i = { server: r, client: n, features: o };
|
|
6432
|
-
return g({ tool: Nr, ...i }), g({ tool: Jr, ...i }), g({ tool: yi, ...i }), g({ tool: yc, ...i }), g({ tool: ui, ...i }), g({ tool: da, ...i }), g({ tool: a, ...i }), g({ tool: Cn, ...i }), g({ tool: gr, ...i }), g({ tool: Xi, ...i }), g({ tool: Gn, ...i }), g({ tool: ti, ...i }), g({ tool: ri, ...i }), g({ tool: Ar, ...i }), g({ tool: lc, ...i }), g({ tool: Zn, ...i }), g({ tool: An, ...i }), g({ tool: nr, ...i }), g({ tool: Li, ...i }), g({ tool: zr, ...i }), g({ tool: Ha, ...i }), g({ tool: qo, ...i }), g({ tool: gn, ...i }), g({ tool: vi, ...i }), g({ tool: jr, ...i }), g({ tool: zn, ...i }), g({ tool: ac, ...i }), g({ tool: Fc, ...i }), g({ tool: dr, ...i }), g({ tool: Yi, ...i }), g({ tool: Un, ...i }), g({ tool: Jo, ...i }), g({ tool: tr, ...i }), g({ tool: Di, ...i }), g({ tool: ln, ...i }), g({ tool: Ia, ...i }), g({ tool:
|
|
6433
|
-
|
|
6449
|
+
return g({ tool: Nr, ...i }), g({ tool: Jr, ...i }), g({ tool: yi, ...i }), g({ tool: yc, ...i }), g({ tool: ui, ...i }), g({ tool: da, ...i }), g({ tool: a, ...i }), g({ tool: Cn, ...i }), g({ tool: gr, ...i }), g({ tool: Xi, ...i }), g({ tool: Gn, ...i }), g({ tool: ti, ...i }), g({ tool: ri, ...i }), g({ tool: Ar, ...i }), g({ tool: lc, ...i }), g({ tool: Zn, ...i }), g({ tool: An, ...i }), g({ tool: nr, ...i }), g({ tool: Li, ...i }), g({ tool: zr, ...i }), g({ tool: Ha, ...i }), g({ tool: qo, ...i }), g({ tool: gn, ...i }), g({ tool: vi, ...i }), g({ tool: jr, ...i }), g({ tool: zn, ...i }), g({ tool: ac, ...i }), g({ tool: Fc, ...i }), g({ tool: dr, ...i }), g({ tool: Yi, ...i }), g({ tool: Un, ...i }), g({ tool: Jo, ...i }), g({ tool: tr, ...i }), g({ tool: Di, ...i }), g({ tool: ln, ...i }), g({ tool: Ia, ...i }), g({ tool: Pa, ...i }), g({ tool: $a, ...i }), g({ tool: Br, ...i }), g({ tool: Na, ...i }), g({ tool: ka, ...i }), g({ tool: en, ...i }), g({ tool: on, ...i }), g({ tool: ii, ...i }), g({ tool: Ec, ...i }), g({ tool: Ln, ...i }), g({ tool: Za, ...i }), g({ tool: qa, ...i }), g({ tool: fi, ...i }), g({ tool: an, ...i }), r.registerPrompt(
|
|
6450
|
+
me.name,
|
|
6434
6451
|
{
|
|
6435
|
-
title:
|
|
6436
|
-
description:
|
|
6437
|
-
argsSchema:
|
|
6452
|
+
title: me.title,
|
|
6453
|
+
description: me.description,
|
|
6454
|
+
argsSchema: me.argsSchema
|
|
6438
6455
|
},
|
|
6439
|
-
|
|
6456
|
+
me.callback
|
|
6440
6457
|
), r;
|
|
6441
6458
|
}
|
|
6442
6459
|
export {
|
|
@@ -6471,7 +6488,7 @@ export {
|
|
|
6471
6488
|
an as f,
|
|
6472
6489
|
td as g,
|
|
6473
6490
|
$a as h,
|
|
6474
|
-
|
|
6491
|
+
Pa as i,
|
|
6475
6492
|
Ia as j,
|
|
6476
6493
|
ln as k,
|
|
6477
6494
|
qa as l,
|