@doist/todoist-ai 8.7.2 → 8.8.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.js +2 -2
- package/dist/main-http.js +1 -1
- package/dist/main.js +1 -1
- package/dist/{mcp-server-Eb2ZRWDB.js → mcp-server-C8iKL_qZ.js} +763 -753
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/tool-helpers.d.ts +2 -0
- package/dist/tool-helpers.d.ts.map +1 -1
- package/dist/tools/add-reminders.d.ts +7 -0
- package/dist/tools/add-reminders.d.ts.map +1 -1
- package/dist/tools/find-reminders.d.ts +3 -0
- package/dist/tools/find-reminders.d.ts.map +1 -1
- package/dist/tools/update-reminders.d.ts +7 -0
- package/dist/tools/update-reminders.d.ts.map +1 -1
- package/dist/utils/output-schemas.d.ts +1 -0
- package/dist/utils/output-schemas.d.ts.map +1 -1
- package/dist/utils/reminder-schemas.d.ts +4 -0
- package/dist/utils/reminder-schemas.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { colors as
|
|
2
|
-
import { McpServer as
|
|
3
|
-
import { createHash as
|
|
4
|
-
import { readFileSync as
|
|
5
|
-
import { dirname as
|
|
6
|
-
import { fileURLToPath as
|
|
7
|
-
import { registerAppResource as
|
|
8
|
-
import J, { ZodError as
|
|
9
|
-
import { addDays as
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
],
|
|
1
|
+
import { colors as $e, LOCATION_TRIGGERS as dt, REMINDER_TYPES as Ut, createCommand as z, REMINDER_DELIVERY_SERVICES as Rt, HEALTH_STATUSES as Re, getTaskUrl as lt, getProjectUrl as ut, WORKSPACE_ROLES as _t, WORKSPACE_PLANS as Nt, TodoistApi as Lt } from "@doist/todoist-api-typescript";
|
|
2
|
+
import { McpServer as Mt } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
+
import { createHash as Ft } from "node:crypto";
|
|
4
|
+
import { readFileSync as Ht } from "node:fs";
|
|
5
|
+
import { dirname as Wt, join as Ve } from "node:path";
|
|
6
|
+
import { fileURLToPath as Bt } from "node:url";
|
|
7
|
+
import { registerAppResource as zt, RESOURCE_MIME_TYPE as Yt, registerAppTool as Gt } from "@modelcontextprotocol/ext-apps/server";
|
|
8
|
+
import J, { ZodError as qt, z as s } from "zod";
|
|
9
|
+
import { addDays as De, formatISO as Je } from "date-fns";
|
|
10
|
+
const Xe = Wt(Bt(import.meta.url)), Kt = [
|
|
11
|
+
Ve(Xe, "task-list", "index.html"),
|
|
12
|
+
Ve(Xe, "mcp-apps", "index.html")
|
|
13
|
+
], Vt = `<!doctype html>
|
|
14
14
|
<html>
|
|
15
15
|
<body>
|
|
16
16
|
<p>Task list app is missing. Run "npm run build" to generate it.</p>
|
|
17
17
|
</body>
|
|
18
18
|
</html>`;
|
|
19
|
-
function
|
|
19
|
+
function Jt() {
|
|
20
20
|
const e = [];
|
|
21
|
-
for (const t of
|
|
21
|
+
for (const t of Kt)
|
|
22
22
|
try {
|
|
23
|
-
return
|
|
23
|
+
return Ht(t, "utf-8");
|
|
24
24
|
} catch (r) {
|
|
25
25
|
e.push(r);
|
|
26
26
|
}
|
|
27
|
-
return console.error("Failed to load task list app HTML from any known path:", e),
|
|
27
|
+
return console.error("Failed to load task list app HTML from any known path:", e), Vt;
|
|
28
28
|
}
|
|
29
|
-
const
|
|
30
|
-
function
|
|
31
|
-
|
|
29
|
+
const pt = Jt(), Xt = Ft("sha256").update(pt).digest("hex").slice(0, 12), xe = `ui://todoist/task-list@${Xt}`;
|
|
30
|
+
function Zt(e) {
|
|
31
|
+
zt(
|
|
32
32
|
e,
|
|
33
33
|
"todoist-task-list",
|
|
34
|
-
|
|
34
|
+
xe,
|
|
35
35
|
{
|
|
36
36
|
description: "Interactive task list widget"
|
|
37
37
|
},
|
|
38
38
|
async () => ({
|
|
39
39
|
contents: [
|
|
40
40
|
{
|
|
41
|
-
uri:
|
|
42
|
-
mimeType:
|
|
43
|
-
text:
|
|
41
|
+
uri: xe,
|
|
42
|
+
mimeType: Yt,
|
|
43
|
+
text: pt
|
|
44
44
|
}
|
|
45
45
|
]
|
|
46
46
|
})
|
|
@@ -49,10 +49,10 @@ function Xt(e) {
|
|
|
49
49
|
function Y(e) {
|
|
50
50
|
return typeof e == "object" && e !== null;
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function Ae(...e) {
|
|
53
53
|
return e.find(Y);
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function _(...e) {
|
|
56
56
|
return e.find((t) => t !== void 0);
|
|
57
57
|
}
|
|
58
58
|
function E(e) {
|
|
@@ -73,21 +73,21 @@ function X(e) {
|
|
|
73
73
|
const t = E(e);
|
|
74
74
|
return t !== void 0 ? t : y(e);
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function Qt(e) {
|
|
77
77
|
return e.replace(/\b(Bearer)\s+[A-Za-z0-9._~+/=-]+/gi, "$1 [REDACTED]").replace(
|
|
78
78
|
/\b(token|api[_-]?key|authorization)\s*[:=]\s*["']?[A-Za-z0-9._~+/=-]{6,}["']?/gi,
|
|
79
79
|
"$1: [REDACTED]"
|
|
80
80
|
).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]");
|
|
81
81
|
}
|
|
82
82
|
function P(e, t = 220) {
|
|
83
|
-
const r =
|
|
83
|
+
const r = Qt(e).replace(/\s+/g, " ").trim();
|
|
84
84
|
return r.length <= t ? r : `${r.slice(0, t - 3)}...`;
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function Ze(e) {
|
|
87
87
|
const t = e.trim();
|
|
88
88
|
return /\bHTTP\s*\d{3}\b/i.test(t) || /\bstatus code \d{3}\b/i.test(t) || /^bad request$/i.test(t) || /^unauthorized$/i.test(t) || /^forbidden$/i.test(t) || /^not found$/i.test(t);
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function Ie(e) {
|
|
91
91
|
if (!e)
|
|
92
92
|
return;
|
|
93
93
|
const t = e.match(/\b(?:HTTP|status code)\s*[:#-]?\s*(\d{3})\b/i);
|
|
@@ -104,7 +104,7 @@ function W(e) {
|
|
|
104
104
|
}
|
|
105
105
|
if (!Y(e))
|
|
106
106
|
return;
|
|
107
|
-
const r =
|
|
107
|
+
const r = _(
|
|
108
108
|
y(e.detail),
|
|
109
109
|
y(e.details),
|
|
110
110
|
y(e.message),
|
|
@@ -121,26 +121,26 @@ function W(e) {
|
|
|
121
121
|
}
|
|
122
122
|
return o.length > 0 ? P(o.join("; ")) : void 0;
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function es(e) {
|
|
125
125
|
if (!e)
|
|
126
126
|
return [];
|
|
127
127
|
const t = /* @__PURE__ */ new Set(), r = (i) => {
|
|
128
128
|
i && t.add(P(i, 120));
|
|
129
|
-
}, o =
|
|
129
|
+
}, o = _(
|
|
130
130
|
y(e.field),
|
|
131
131
|
y(e.parameter),
|
|
132
132
|
y(e.param),
|
|
133
133
|
y(e.path)
|
|
134
134
|
);
|
|
135
135
|
r(o);
|
|
136
|
-
const n =
|
|
136
|
+
const n = Ae(
|
|
137
137
|
e.details,
|
|
138
138
|
e.errorDetails,
|
|
139
139
|
e.errorExtra,
|
|
140
140
|
e.error_extra
|
|
141
141
|
);
|
|
142
142
|
if (n) {
|
|
143
|
-
const i =
|
|
143
|
+
const i = _(
|
|
144
144
|
y(n.field),
|
|
145
145
|
y(n.parameter),
|
|
146
146
|
y(n.param),
|
|
@@ -156,13 +156,13 @@ function Qt(e) {
|
|
|
156
156
|
r(y(i));
|
|
157
157
|
continue;
|
|
158
158
|
}
|
|
159
|
-
const c =
|
|
159
|
+
const c = _(
|
|
160
160
|
y(i.field),
|
|
161
161
|
y(i.parameter),
|
|
162
162
|
y(i.param),
|
|
163
163
|
y(i.path),
|
|
164
164
|
y(i.name)
|
|
165
|
-
), d =
|
|
165
|
+
), d = _(
|
|
166
166
|
y(i.message),
|
|
167
167
|
y(i.error),
|
|
168
168
|
y(i.detail),
|
|
@@ -184,7 +184,7 @@ function Qt(e) {
|
|
|
184
184
|
}
|
|
185
185
|
return Array.from(t).slice(0, 3);
|
|
186
186
|
}
|
|
187
|
-
const
|
|
187
|
+
const ts = [
|
|
188
188
|
"error",
|
|
189
189
|
"error_code",
|
|
190
190
|
"error_tag",
|
|
@@ -195,20 +195,20 @@ const es = [
|
|
|
195
195
|
"httpCode",
|
|
196
196
|
"errorExtra"
|
|
197
197
|
];
|
|
198
|
-
function
|
|
199
|
-
return e ?
|
|
198
|
+
function ss(e) {
|
|
199
|
+
return e ? ts.some((t) => e[t] !== void 0) : !1;
|
|
200
200
|
}
|
|
201
|
-
function
|
|
201
|
+
function rs(e, t) {
|
|
202
202
|
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.";
|
|
203
203
|
}
|
|
204
|
-
function
|
|
205
|
-
const t = Y(e) ? e : void 0, r = e instanceof Error && Y(e.cause) ? e.cause : void 0, o =
|
|
204
|
+
function os(e) {
|
|
205
|
+
const t = Y(e) ? e : void 0, r = e instanceof Error && Y(e.cause) ? e.cause : void 0, o = Ae(t?.response, r?.response), n = Ae(
|
|
206
206
|
t?.responseData,
|
|
207
207
|
o?.data,
|
|
208
208
|
t?.data,
|
|
209
209
|
r?.responseData,
|
|
210
210
|
r?.data
|
|
211
|
-
), a =
|
|
211
|
+
), a = _(
|
|
212
212
|
E(t?.httpStatusCode),
|
|
213
213
|
E(t?.statusCode),
|
|
214
214
|
E(t?.status),
|
|
@@ -218,17 +218,17 @@ function rs(e) {
|
|
|
218
218
|
E(n?.status),
|
|
219
219
|
E(n?.httpCode),
|
|
220
220
|
E(n?.http_code),
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
), i =
|
|
221
|
+
Ie(y(t?.message)),
|
|
222
|
+
Ie(y(r?.message)),
|
|
223
|
+
Ie(typeof e == "string" ? e : void 0)
|
|
224
|
+
), i = _(
|
|
225
225
|
X(n?.errorCode),
|
|
226
226
|
X(n?.error_code),
|
|
227
227
|
X(n?.code),
|
|
228
228
|
X(t?.errorCode),
|
|
229
229
|
X(t?.error_code),
|
|
230
230
|
X(t?.code)
|
|
231
|
-
), c =
|
|
231
|
+
), c = _(
|
|
232
232
|
y(n?.errorTag),
|
|
233
233
|
y(n?.error_tag),
|
|
234
234
|
y(n?.tag),
|
|
@@ -242,15 +242,15 @@ function rs(e) {
|
|
|
242
242
|
y(t?.message),
|
|
243
243
|
y(r?.message),
|
|
244
244
|
e instanceof Error ? e.message : y(e)
|
|
245
|
-
].filter((h) => !!h), l = d.find((h) => !
|
|
245
|
+
].filter((h) => !!h), l = d.find((h) => !Ze(h)) || d[0], u = _(
|
|
246
246
|
W(n?.errorExtra),
|
|
247
247
|
W(n?.error_extra),
|
|
248
248
|
W(n?.details),
|
|
249
249
|
W(n?.errorDetails),
|
|
250
250
|
W(n?.errors),
|
|
251
251
|
W(t?.details)
|
|
252
|
-
), p =
|
|
253
|
-
return a !== void 0 ||
|
|
252
|
+
), p = es(n);
|
|
253
|
+
return a !== void 0 || ss(n) || c !== void 0 || i !== void 0 || (l ? Ze(l) : !1) ? {
|
|
254
254
|
statusCode: a,
|
|
255
255
|
code: i,
|
|
256
256
|
tag: c ? P(c, 80) : void 0,
|
|
@@ -259,34 +259,34 @@ function rs(e) {
|
|
|
259
259
|
fieldHints: p
|
|
260
260
|
} : null;
|
|
261
261
|
}
|
|
262
|
-
function
|
|
262
|
+
function ns(e) {
|
|
263
263
|
const t = [];
|
|
264
264
|
e.statusCode !== void 0 && t.push(`HTTP ${e.statusCode}`), e.code !== void 0 && t.push(`code ${e.code}`), e.tag && t.push(`tag ${e.tag}`);
|
|
265
265
|
const r = [
|
|
266
266
|
t.length > 0 ? `Todoist API request failed (${t.join(", ")}).` : "Todoist API request failed."
|
|
267
267
|
];
|
|
268
|
-
return e.message && r.push(`Message: ${e.message}`), e.details && e.details !== e.message && r.push(`Details: ${e.details}`), e.fieldHints.length > 0 && r.push(`Field hints: ${e.fieldHints.join("; ")}`), r.push(`Try next: ${
|
|
268
|
+
return e.message && r.push(`Message: ${e.message}`), e.details && e.details !== e.message && r.push(`Details: ${e.details}`), e.fieldHints.length > 0 && r.push(`Field hints: ${e.fieldHints.join("; ")}`), r.push(`Try next: ${rs(e.statusCode, e.fieldHints.length > 0)}`), r.join(`
|
|
269
269
|
`);
|
|
270
270
|
}
|
|
271
|
-
function
|
|
271
|
+
function as(e) {
|
|
272
272
|
return e instanceof Error ? P(e.message) : typeof e == "string" ? P(e) : "An unknown error occurred";
|
|
273
273
|
}
|
|
274
|
-
function
|
|
275
|
-
if (e instanceof
|
|
274
|
+
function is(e) {
|
|
275
|
+
if (e instanceof qt)
|
|
276
276
|
return e.message;
|
|
277
|
-
const t =
|
|
278
|
-
return t ?
|
|
277
|
+
const t = os(e);
|
|
278
|
+
return t ? ns(t) : as(e);
|
|
279
279
|
}
|
|
280
|
-
function
|
|
280
|
+
function Ee(e) {
|
|
281
281
|
if (e == null)
|
|
282
282
|
return e;
|
|
283
283
|
if (Array.isArray(e))
|
|
284
|
-
return e.map((t) =>
|
|
284
|
+
return e.map((t) => Ee(t));
|
|
285
285
|
if (typeof e == "object") {
|
|
286
286
|
const t = {};
|
|
287
287
|
for (const [r, o] of Object.entries(e))
|
|
288
288
|
if (o !== null) {
|
|
289
|
-
const n =
|
|
289
|
+
const n = Ee(o);
|
|
290
290
|
if (n !== null && typeof n == "object" && !Array.isArray(n) && Object.keys(n).length === 0)
|
|
291
291
|
continue;
|
|
292
292
|
t[r] = n;
|
|
@@ -354,20 +354,20 @@ const f = {
|
|
|
354
354
|
// OpenAI MCP tools
|
|
355
355
|
SEARCH: "search",
|
|
356
356
|
FETCH: "fetch"
|
|
357
|
-
},
|
|
357
|
+
}, Ii = {
|
|
358
358
|
/**
|
|
359
359
|
* Strips email addresses from tool outputs that expose user data.
|
|
360
360
|
* Affects: find-project-collaborators, find-completed-tasks
|
|
361
361
|
*/
|
|
362
362
|
STRIP_EMAILS: "strip_emails"
|
|
363
|
-
},
|
|
364
|
-
function
|
|
363
|
+
}, cs = process.env.USE_STRUCTURED_CONTENT === "true" || process.env.NODE_ENV === "test";
|
|
364
|
+
function ds({
|
|
365
365
|
textContent: e,
|
|
366
366
|
structuredContent: t,
|
|
367
367
|
contentItems: r
|
|
368
368
|
}) {
|
|
369
|
-
const o =
|
|
370
|
-
if (e && a.push({ type: "text", text: e }), r && a.push(...r), a.length > 0 && (n.content = a), t && (n.structuredContent = o), !
|
|
369
|
+
const o = Ee(t), n = {}, a = [];
|
|
370
|
+
if (e && a.push({ type: "text", text: e }), r && a.push(...r), a.length > 0 && (n.content = a), t && (n.structuredContent = o), !cs && t) {
|
|
371
371
|
const i = JSON.stringify(o);
|
|
372
372
|
n.content || (n.content = []), n.content.push({
|
|
373
373
|
type: "text",
|
|
@@ -377,42 +377,42 @@ function cs({
|
|
|
377
377
|
}
|
|
378
378
|
return n;
|
|
379
379
|
}
|
|
380
|
-
function
|
|
380
|
+
function ls(e) {
|
|
381
381
|
return {
|
|
382
382
|
content: [{ type: "text", text: e }],
|
|
383
383
|
isError: !0
|
|
384
384
|
};
|
|
385
385
|
}
|
|
386
|
-
function
|
|
386
|
+
function us(e) {
|
|
387
387
|
return { ...{
|
|
388
|
-
title: `Todoist: ${
|
|
388
|
+
title: `Todoist: ${ps(e.name)}`,
|
|
389
389
|
openWorldHint: !1
|
|
390
390
|
}, ...e.annotations };
|
|
391
391
|
}
|
|
392
|
-
function
|
|
392
|
+
function ps(e) {
|
|
393
393
|
return e.split("-").filter(Boolean).map((t) => `${t.charAt(0).toUpperCase()}${t.slice(1)}`).join(" ");
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function ms(e) {
|
|
396
396
|
return e ? typeof e["ui/resourceUri"] == "string" ? !0 : typeof e.ui == "object" && e.ui !== null : !1;
|
|
397
397
|
}
|
|
398
|
-
const
|
|
398
|
+
const hs = [
|
|
399
399
|
f.FIND_PROJECT_COLLABORATORS,
|
|
400
400
|
f.FIND_COMPLETED_TASKS
|
|
401
401
|
];
|
|
402
|
-
function
|
|
402
|
+
function Oe(e) {
|
|
403
403
|
if (e == null)
|
|
404
404
|
return e;
|
|
405
405
|
if (Array.isArray(e))
|
|
406
|
-
return e.map((t) =>
|
|
406
|
+
return e.map((t) => Oe(t));
|
|
407
407
|
if (typeof e == "object") {
|
|
408
408
|
const t = {};
|
|
409
409
|
for (const [r, o] of Object.entries(e))
|
|
410
|
-
r !== "email" && (t[r] =
|
|
410
|
+
r !== "email" && (t[r] = Oe(o));
|
|
411
411
|
return t;
|
|
412
412
|
}
|
|
413
413
|
return e;
|
|
414
414
|
}
|
|
415
|
-
function
|
|
415
|
+
function fs(e) {
|
|
416
416
|
const t = /\s*\([^)]*@[^)]+\)/g, r = /\S+@\S+\.\S+/g;
|
|
417
417
|
return e.replace(t, "").replace(r, "[email hidden]");
|
|
418
418
|
}
|
|
@@ -422,25 +422,25 @@ function k({
|
|
|
422
422
|
client: r,
|
|
423
423
|
features: o = []
|
|
424
424
|
}) {
|
|
425
|
-
const n = o.some((c) => c.name === "strip_emails") &&
|
|
425
|
+
const n = o.some((c) => c.name === "strip_emails") && hs.includes(e.name), a = async (c, d) => {
|
|
426
426
|
try {
|
|
427
427
|
let { textContent: l, structuredContent: u, contentItems: p } = await e.execute(
|
|
428
428
|
c,
|
|
429
429
|
r
|
|
430
430
|
);
|
|
431
|
-
return n && (l && (l =
|
|
431
|
+
return n && (l && (l = fs(l)), u && (u = Oe(u))), ds({ textContent: l, structuredContent: u, contentItems: p });
|
|
432
432
|
} catch (l) {
|
|
433
|
-
return console.error(`Error executing tool ${e.name}:`, { args: c, error: l }),
|
|
433
|
+
return console.error(`Error executing tool ${e.name}:`, { args: c, error: l }), ls(is(l));
|
|
434
434
|
}
|
|
435
435
|
}, i = {
|
|
436
436
|
description: e.description,
|
|
437
437
|
inputSchema: e.parameters,
|
|
438
438
|
outputSchema: e.outputSchema,
|
|
439
|
-
annotations:
|
|
439
|
+
annotations: us(e),
|
|
440
440
|
...e._meta ? { _meta: e._meta } : {}
|
|
441
441
|
};
|
|
442
|
-
if (
|
|
443
|
-
|
|
442
|
+
if (ms(e._meta)) {
|
|
443
|
+
Gt(
|
|
444
444
|
t,
|
|
445
445
|
e.name,
|
|
446
446
|
{
|
|
@@ -453,7 +453,7 @@ function k({
|
|
|
453
453
|
}
|
|
454
454
|
t.registerTool(e.name, i, a);
|
|
455
455
|
}
|
|
456
|
-
const
|
|
456
|
+
const bs = {
|
|
457
457
|
period: s.enum(["today", "7d", "14d", "30d", "this-week", "this-month"]).default("7d").describe(
|
|
458
458
|
'Time period for the analysis. "today" analyzes the current day, "7d"/"14d"/"30d" analyze the last N days, "this-week" and "this-month" analyze the current week or month.'
|
|
459
459
|
),
|
|
@@ -462,7 +462,7 @@ const fs = {
|
|
|
462
462
|
),
|
|
463
463
|
projectId: s.string().optional().describe("Optional project ID to scope the analysis to a specific project.")
|
|
464
464
|
};
|
|
465
|
-
function
|
|
465
|
+
function gs(e, t = /* @__PURE__ */ new Date()) {
|
|
466
466
|
const r = (n) => n.toISOString().slice(0, 10), o = r(t);
|
|
467
467
|
switch (e) {
|
|
468
468
|
case "today":
|
|
@@ -509,7 +509,7 @@ function bs(e, t = /* @__PURE__ */ new Date()) {
|
|
|
509
509
|
}
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
|
-
function
|
|
512
|
+
function ys(e) {
|
|
513
513
|
const t = {
|
|
514
514
|
goals: `### Goal Tracking
|
|
515
515
|
- Compare tasks completed today vs the daily goal
|
|
@@ -540,8 +540,8 @@ function gs(e) {
|
|
|
540
540
|
|
|
541
541
|
`) : t[e] ?? "";
|
|
542
542
|
}
|
|
543
|
-
function
|
|
544
|
-
const { since: t, until: r, periodDescription: o } =
|
|
543
|
+
function ks(e) {
|
|
544
|
+
const { since: t, until: r, periodDescription: o } = gs(e.period), n = e.projectId ? `
|
|
545
545
|
Scope this analysis to project ID: ${e.projectId}. Pass this projectId when calling find-completed-tasks and get-overview.` : "";
|
|
546
546
|
return `Analyze my Todoist productivity for ${o} (${t} to ${r}).${n}
|
|
547
547
|
|
|
@@ -562,7 +562,7 @@ ${e.focus === "overall" || e.focus === "projects" ? `4. **get-overview** — Get
|
|
|
562
562
|
|
|
563
563
|
Using the collected data, produce an analysis covering the following sections:
|
|
564
564
|
|
|
565
|
-
${
|
|
565
|
+
${ys(e.focus)}
|
|
566
566
|
|
|
567
567
|
### Step 3: Format
|
|
568
568
|
|
|
@@ -572,14 +572,14 @@ Present the analysis as a clear, well-structured markdown report with:
|
|
|
572
572
|
- Specific numbers and comparisons (not vague statements)
|
|
573
573
|
- Actionable takeaways highlighted clearly`;
|
|
574
574
|
}
|
|
575
|
-
function
|
|
575
|
+
function Ts(e) {
|
|
576
576
|
return {
|
|
577
577
|
messages: [
|
|
578
578
|
{
|
|
579
579
|
role: "user",
|
|
580
580
|
content: {
|
|
581
581
|
type: "text",
|
|
582
|
-
text:
|
|
582
|
+
text: ks(e)
|
|
583
583
|
}
|
|
584
584
|
}
|
|
585
585
|
]
|
|
@@ -589,8 +589,8 @@ const ie = {
|
|
|
589
589
|
name: "productivity-analysis",
|
|
590
590
|
title: "Productivity Analysis",
|
|
591
591
|
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.",
|
|
592
|
-
argsSchema:
|
|
593
|
-
callback:
|
|
592
|
+
argsSchema: bs,
|
|
593
|
+
callback: Ts
|
|
594
594
|
}, C = {
|
|
595
595
|
/** Default limit for task listings */
|
|
596
596
|
TASKS_DEFAULT: 10,
|
|
@@ -620,7 +620,7 @@ const ie = {
|
|
|
620
620
|
LABELS_DEFAULT: 50,
|
|
621
621
|
/** Maximum limit for label listings */
|
|
622
622
|
LABELS_MAX: 200
|
|
623
|
-
},
|
|
623
|
+
}, ve = {
|
|
624
624
|
/** Maximum number of failures to show in detailed error messages */
|
|
625
625
|
MAX_FAILURES_SHOWN: 3
|
|
626
626
|
};
|
|
@@ -629,7 +629,7 @@ class O extends Error {
|
|
|
629
629
|
super(`Invalid duration format "${t}": ${r}`), this.name = "DurationParseError";
|
|
630
630
|
}
|
|
631
631
|
}
|
|
632
|
-
function
|
|
632
|
+
function mt(e) {
|
|
633
633
|
if (!e || typeof e != "string")
|
|
634
634
|
throw new O(e, "Duration must be a non-empty string");
|
|
635
635
|
const t = e.trim().toLowerCase().replace(/\s+/g, "");
|
|
@@ -663,20 +663,20 @@ function pt(e) {
|
|
|
663
663
|
throw new O(e, "Duration cannot exceed 24 hours (1440 minutes)");
|
|
664
664
|
return { minutes: o };
|
|
665
665
|
}
|
|
666
|
-
function
|
|
666
|
+
function ws(e) {
|
|
667
667
|
if (e <= 0) return "0m";
|
|
668
668
|
const t = Math.floor(e / 60), r = e % 60;
|
|
669
669
|
return t === 0 ? `${r}m` : r === 0 ? `${t}h` : `${t}h${r}m`;
|
|
670
670
|
}
|
|
671
|
-
const
|
|
672
|
-
function
|
|
671
|
+
const Is = ["p1", "p2", "p3", "p4"], _e = '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.', Ne = s.enum(Is).describe(_e);
|
|
672
|
+
function ht(e) {
|
|
673
673
|
return { p1: 4, p2: 3, p3: 2, p4: 1 }[e];
|
|
674
674
|
}
|
|
675
|
-
function
|
|
675
|
+
function vs(e) {
|
|
676
676
|
return { 4: "p1", 3: "p2", 2: "p3", 1: "p4" }[e];
|
|
677
677
|
}
|
|
678
|
-
const A = /* @__PURE__ */ new Map(), Z = /* @__PURE__ */ new Map(),
|
|
679
|
-
class
|
|
678
|
+
const A = /* @__PURE__ */ new Map(), Z = /* @__PURE__ */ new Map(), je = 300 * 1e3, js = "me";
|
|
679
|
+
class Ss {
|
|
680
680
|
/**
|
|
681
681
|
* Resolve a user name or ID to a user ID by looking up collaborators across all shared projects.
|
|
682
682
|
* Supports exact name matches, partial matches, email matches, and the "me" keyword.
|
|
@@ -685,9 +685,9 @@ class js {
|
|
|
685
685
|
if (!r || r.trim().length === 0)
|
|
686
686
|
return null;
|
|
687
687
|
const o = r.trim(), n = A.get(o);
|
|
688
|
-
if (n && Date.now() - n.timestamp <
|
|
688
|
+
if (n && Date.now() - n.timestamp < je)
|
|
689
689
|
return n.result;
|
|
690
|
-
if (o.toLowerCase() ===
|
|
690
|
+
if (o.toLowerCase() === js)
|
|
691
691
|
try {
|
|
692
692
|
const a = await t.getUser();
|
|
693
693
|
return {
|
|
@@ -761,7 +761,7 @@ class js {
|
|
|
761
761
|
*/
|
|
762
762
|
async getProjectCollaborators(t, r) {
|
|
763
763
|
const o = `project_${r}`, n = Z.get(o);
|
|
764
|
-
if (n && Date.now() - n.timestamp <
|
|
764
|
+
if (n && Date.now() - n.timestamp < je)
|
|
765
765
|
return n.result;
|
|
766
766
|
try {
|
|
767
767
|
const a = await t.getProjectCollaborators(r), c = (Array.isArray(a) ? a : a.results || []).filter((d) => d?.id && d.name && d.email);
|
|
@@ -778,7 +778,7 @@ class js {
|
|
|
778
778
|
*/
|
|
779
779
|
async getAllCollaborators(t) {
|
|
780
780
|
const r = "all_collaborators", o = Z.get(r);
|
|
781
|
-
if (o && Date.now() - o.timestamp <
|
|
781
|
+
if (o && Date.now() - o.timestamp < je)
|
|
782
782
|
return o.result;
|
|
783
783
|
try {
|
|
784
784
|
const { results: n } = await t.getProjects({}), a = n.filter((u) => u.isShared);
|
|
@@ -808,15 +808,15 @@ class js {
|
|
|
808
808
|
A.clear(), Z.clear();
|
|
809
809
|
}
|
|
810
810
|
}
|
|
811
|
-
const B = new
|
|
812
|
-
async function
|
|
811
|
+
const B = new Ss();
|
|
812
|
+
async function Cs(e, t) {
|
|
813
813
|
return B.resolveUser(e, t);
|
|
814
814
|
}
|
|
815
|
-
const
|
|
816
|
-
async function
|
|
815
|
+
const ft = ["assigned", "unassignedOrMe", "all"];
|
|
816
|
+
async function Le(e, t) {
|
|
817
817
|
if (!t)
|
|
818
818
|
return;
|
|
819
|
-
const r = await
|
|
819
|
+
const r = await Cs(e, t);
|
|
820
820
|
if (!r)
|
|
821
821
|
throw new Error(
|
|
822
822
|
`Could not find user: "${t}". Make sure the user is a collaborator on a shared project.`
|
|
@@ -826,14 +826,14 @@ async function Ne(e, t) {
|
|
|
826
826
|
function se(e, t) {
|
|
827
827
|
return t.length === 0 ? e : e.length === 0 ? t : `${e} & ${t}`;
|
|
828
828
|
}
|
|
829
|
-
function
|
|
829
|
+
function bt({
|
|
830
830
|
resolvedAssigneeId: e,
|
|
831
831
|
assigneeEmail: t,
|
|
832
832
|
responsibleUserFiltering: r = "unassignedOrMe"
|
|
833
833
|
}) {
|
|
834
834
|
return e && t ? `assigned to: ${t}` : r === "unassignedOrMe" ? "!assigned to: others" : r === "assigned" ? "assigned to: others" : "";
|
|
835
835
|
}
|
|
836
|
-
function
|
|
836
|
+
function $s({
|
|
837
837
|
tasks: e,
|
|
838
838
|
resolvedAssigneeId: t,
|
|
839
839
|
currentUserId: r,
|
|
@@ -844,7 +844,7 @@ function Cs({
|
|
|
844
844
|
function re(e) {
|
|
845
845
|
return "inboxProject" in e;
|
|
846
846
|
}
|
|
847
|
-
function
|
|
847
|
+
function Pe(e) {
|
|
848
848
|
return "workspaceId" in e;
|
|
849
849
|
}
|
|
850
850
|
function de(e) {
|
|
@@ -872,39 +872,39 @@ async function oe(e) {
|
|
|
872
872
|
} while (a !== null);
|
|
873
873
|
return n;
|
|
874
874
|
}
|
|
875
|
-
function
|
|
875
|
+
function Me(e) {
|
|
876
876
|
return /(?<!\\)(?:\\\\)*\*/.test(e) ? e : `*${e.replaceAll(/\\(?!\*)/g, "\\\\")}*`;
|
|
877
877
|
}
|
|
878
|
-
async function
|
|
878
|
+
async function gt(e, t) {
|
|
879
879
|
return oe({
|
|
880
880
|
apiMethod: e.searchProjects.bind(e),
|
|
881
|
-
args: { query:
|
|
881
|
+
args: { query: Me(t) },
|
|
882
882
|
limit: C.PROJECTS_MAX
|
|
883
883
|
});
|
|
884
884
|
}
|
|
885
|
-
async function
|
|
885
|
+
async function Ds(e, t) {
|
|
886
886
|
return oe({
|
|
887
887
|
apiMethod: e.searchLabels.bind(e),
|
|
888
|
-
args: { query:
|
|
888
|
+
args: { query: Me(t) },
|
|
889
889
|
limit: C.LABELS_MAX
|
|
890
890
|
});
|
|
891
891
|
}
|
|
892
|
-
async function
|
|
892
|
+
async function xs(e) {
|
|
893
893
|
return oe({
|
|
894
894
|
apiMethod: e.getSharedLabels.bind(e),
|
|
895
895
|
args: {},
|
|
896
896
|
limit: C.LABELS_MAX
|
|
897
897
|
});
|
|
898
898
|
}
|
|
899
|
-
async function
|
|
900
|
-
const o =
|
|
899
|
+
async function As(e, t, r) {
|
|
900
|
+
const o = Me(t);
|
|
901
901
|
return oe({
|
|
902
902
|
apiMethod: e.searchSections.bind(e),
|
|
903
903
|
args: r ? { query: o, projectId: r } : { query: o },
|
|
904
904
|
limit: C.SECTIONS_MAX
|
|
905
905
|
});
|
|
906
906
|
}
|
|
907
|
-
function
|
|
907
|
+
function Es(e, t, r, o) {
|
|
908
908
|
const n = [t, r, o].filter(Boolean);
|
|
909
909
|
if (n.length > 1)
|
|
910
910
|
throw new Error(
|
|
@@ -919,7 +919,7 @@ function As(e, t, r, o) {
|
|
|
919
919
|
if (o) return { parentId: o };
|
|
920
920
|
throw new Error("Unexpected error: No valid move parameter found");
|
|
921
921
|
}
|
|
922
|
-
function
|
|
922
|
+
function U(e) {
|
|
923
923
|
return {
|
|
924
924
|
id: e.id,
|
|
925
925
|
content: e.content,
|
|
@@ -927,12 +927,12 @@ function R(e) {
|
|
|
927
927
|
dueDate: e.due?.date,
|
|
928
928
|
recurring: e.due?.isRecurring && e.due.string ? e.due.string : !1,
|
|
929
929
|
deadlineDate: e.deadline?.date,
|
|
930
|
-
priority:
|
|
930
|
+
priority: vs(e.priority) ?? "p4",
|
|
931
931
|
projectId: e.projectId,
|
|
932
932
|
sectionId: e.sectionId ?? void 0,
|
|
933
933
|
parentId: e.parentId ?? void 0,
|
|
934
934
|
labels: e.labels,
|
|
935
|
-
duration: e.duration ?
|
|
935
|
+
duration: e.duration ? ws(e.duration.amount) : void 0,
|
|
936
936
|
responsibleUid: e.responsibleUid ?? void 0,
|
|
937
937
|
assignedByUid: e.assignedByUid ?? void 0,
|
|
938
938
|
checked: e.checked,
|
|
@@ -949,8 +949,8 @@ function q(e) {
|
|
|
949
949
|
parentId: re(e) ? e.parentId ?? void 0 : void 0,
|
|
950
950
|
inboxProject: re(e) ? e.inboxProject ?? !1 : !1,
|
|
951
951
|
viewStyle: e.viewStyle,
|
|
952
|
-
workspaceId:
|
|
953
|
-
folderId:
|
|
952
|
+
workspaceId: Pe(e) ? e.workspaceId : void 0,
|
|
953
|
+
folderId: Pe(e) ? e.folderId ?? void 0 : void 0,
|
|
954
954
|
childOrder: e.childOrder
|
|
955
955
|
};
|
|
956
956
|
}
|
|
@@ -978,7 +978,7 @@ function pe(e) {
|
|
|
978
978
|
} : void 0
|
|
979
979
|
};
|
|
980
980
|
}
|
|
981
|
-
function
|
|
981
|
+
function Os(e) {
|
|
982
982
|
return {
|
|
983
983
|
id: e.id ?? void 0,
|
|
984
984
|
objectType: e.objectType,
|
|
@@ -991,7 +991,7 @@ function Es(e) {
|
|
|
991
991
|
extraData: e.extraData ?? void 0
|
|
992
992
|
};
|
|
993
993
|
}
|
|
994
|
-
const
|
|
994
|
+
const Ps = J.object({
|
|
995
995
|
httpStatusCode: J.number(),
|
|
996
996
|
responseData: J.object({
|
|
997
997
|
error: J.string(),
|
|
@@ -999,7 +999,7 @@ const Os = J.object({
|
|
|
999
999
|
errorTag: J.string()
|
|
1000
1000
|
})
|
|
1001
1001
|
});
|
|
1002
|
-
async function
|
|
1002
|
+
async function Fe({
|
|
1003
1003
|
client: e,
|
|
1004
1004
|
query: t,
|
|
1005
1005
|
limit: r,
|
|
@@ -1007,9 +1007,9 @@ async function Me({
|
|
|
1007
1007
|
}) {
|
|
1008
1008
|
try {
|
|
1009
1009
|
const { results: n, nextCursor: a } = await e.getTasksByFilter({ query: t, cursor: o, limit: r });
|
|
1010
|
-
return { tasks: n.map(
|
|
1010
|
+
return { tasks: n.map(U), nextCursor: a };
|
|
1011
1011
|
} catch (n) {
|
|
1012
|
-
const a =
|
|
1012
|
+
const a = Ps.safeParse(n);
|
|
1013
1013
|
if (!a.success)
|
|
1014
1014
|
throw n;
|
|
1015
1015
|
const { responseData: i } = a.data;
|
|
@@ -1018,7 +1018,7 @@ async function Me({
|
|
|
1018
1018
|
);
|
|
1019
1019
|
}
|
|
1020
1020
|
}
|
|
1021
|
-
function
|
|
1021
|
+
function Qe(e) {
|
|
1022
1022
|
return {
|
|
1023
1023
|
isRecurring: e.isRecurring,
|
|
1024
1024
|
string: e.string,
|
|
@@ -1038,12 +1038,14 @@ function ce(e) {
|
|
|
1038
1038
|
return {
|
|
1039
1039
|
...t,
|
|
1040
1040
|
minuteOffset: e.minuteOffset,
|
|
1041
|
-
due: e.due ?
|
|
1041
|
+
due: e.due ? Qe(e.due) : void 0,
|
|
1042
|
+
isUrgent: e.isUrgent
|
|
1042
1043
|
};
|
|
1043
1044
|
case "absolute":
|
|
1044
1045
|
return {
|
|
1045
1046
|
...t,
|
|
1046
|
-
due:
|
|
1047
|
+
due: Qe(e.due),
|
|
1048
|
+
isUrgent: e.isUrgent
|
|
1047
1049
|
};
|
|
1048
1050
|
case "location":
|
|
1049
1051
|
return {
|
|
@@ -1056,19 +1058,19 @@ function ce(e) {
|
|
|
1056
1058
|
};
|
|
1057
1059
|
}
|
|
1058
1060
|
}
|
|
1059
|
-
function
|
|
1061
|
+
function yt(e) {
|
|
1060
1062
|
const t = e.filter(
|
|
1061
1063
|
(o) => o.type === "relative" || o.type === "absolute"
|
|
1062
1064
|
).length, r = e.filter((o) => o.type === "location").length;
|
|
1063
1065
|
return { timeBasedCount: t, locationCount: r };
|
|
1064
1066
|
}
|
|
1065
|
-
const me =
|
|
1066
|
-
function
|
|
1067
|
+
const me = $e.map((e) => e.key);
|
|
1068
|
+
function Us(e) {
|
|
1067
1069
|
if (typeof e != "string") return;
|
|
1068
1070
|
const t = e.toLowerCase();
|
|
1069
|
-
return (
|
|
1071
|
+
return ($e.find((o) => o.key === t) ?? $e.find((o) => o.displayName.toLowerCase() === t))?.key;
|
|
1070
1072
|
}
|
|
1071
|
-
const Rs = `Color for the entity. Accepts a color key (e.g. "berry_red") or display name (e.g. "Berry Red"). Valid colors: ${me.join(", ")}. Unrecognized colors are omitted and charcoal will be used as the default.`, le = s.preprocess(
|
|
1073
|
+
const Rs = `Color for the entity. Accepts a color key (e.g. "berry_red") or display name (e.g. "Berry Red"). Valid colors: ${me.join(", ")}. Unrecognized colors are omitted and charcoal will be used as the default.`, le = s.preprocess(Us, s.enum(me).optional()).describe(Rs);
|
|
1072
1074
|
s.enum(me).describe("The color key of the entity.");
|
|
1073
1075
|
const ne = s.enum(me).optional().catch(void 0).describe("The color key of the entity."), K = s.object({
|
|
1074
1076
|
id: s.string().describe("The unique ID of the task."),
|
|
@@ -1077,7 +1079,7 @@ const ne = s.enum(me).optional().catch(void 0).describe("The color key of the en
|
|
|
1077
1079
|
dueDate: s.string().optional().describe("The due date of the task (ISO 8601 format)."),
|
|
1078
1080
|
recurring: s.union([s.boolean(), s.string()]).describe("Whether the task is recurring, or the recurrence string."),
|
|
1079
1081
|
deadlineDate: s.string().optional().describe("The deadline date of the task (ISO 8601 format)."),
|
|
1080
|
-
priority:
|
|
1082
|
+
priority: Ne.describe(
|
|
1081
1083
|
"The priority level: p1 (highest), p2 (high), p3 (medium), p4 (lowest)."
|
|
1082
1084
|
),
|
|
1083
1085
|
projectId: s.string().describe("The ID of the project this task belongs to."),
|
|
@@ -1128,7 +1130,7 @@ const ne = s.enum(me).optional().catch(void 0).describe("The color key of the en
|
|
|
1128
1130
|
postedAt: s.string().describe("When the comment was posted (ISO 8601 format)."),
|
|
1129
1131
|
postedUid: s.string().optional().describe("The UID of the user who posted this comment."),
|
|
1130
1132
|
fileAttachment: _s.optional().describe("File attachment information, if any.")
|
|
1131
|
-
}),
|
|
1133
|
+
}), Ns = s.object({
|
|
1132
1134
|
id: s.string().optional().describe("The unique ID of the activity event."),
|
|
1133
1135
|
objectType: s.string().describe("The type of object this event relates to (task, project, etc)."),
|
|
1134
1136
|
objectId: s.string().describe("The ID of the object this event relates to."),
|
|
@@ -1138,7 +1140,7 @@ const ne = s.enum(me).optional().catch(void 0).describe("The color key of the en
|
|
|
1138
1140
|
parentItemId: s.string().optional().describe("The ID of the parent item."),
|
|
1139
1141
|
initiatorId: s.string().optional().describe("The ID of the user who initiated this event."),
|
|
1140
1142
|
extraData: s.record(s.string(), s.unknown()).optional().describe("Additional event data.")
|
|
1141
|
-
}),
|
|
1143
|
+
}), Ls = s.object({
|
|
1142
1144
|
id: s.string().describe("The unique ID of the user."),
|
|
1143
1145
|
name: s.string().describe("The full name of the user."),
|
|
1144
1146
|
email: s.string().describe("The email address of the user.")
|
|
@@ -1148,46 +1150,47 @@ const ne = s.enum(me).optional().catch(void 0).describe("The color key of the en
|
|
|
1148
1150
|
color: ne,
|
|
1149
1151
|
order: s.number().optional().catch(void 0).describe("The display order of the label."),
|
|
1150
1152
|
isFavorite: s.boolean().describe("Whether the label is marked as favorite.")
|
|
1151
|
-
}),
|
|
1153
|
+
}), Ms = s.object({
|
|
1152
1154
|
isRecurring: s.boolean().describe("Whether this is a recurring reminder."),
|
|
1153
1155
|
string: s.string().describe("Human-readable due string."),
|
|
1154
1156
|
date: s.string().describe("Due date in ISO format."),
|
|
1155
1157
|
datetime: s.string().optional().describe("Due datetime in ISO format."),
|
|
1156
1158
|
timezone: s.string().optional().describe("Timezone of the reminder.")
|
|
1157
|
-
}),
|
|
1159
|
+
}), He = s.object({
|
|
1158
1160
|
id: s.string().describe("The unique ID of the reminder."),
|
|
1159
1161
|
taskId: s.string().describe("The task ID this reminder belongs to."),
|
|
1160
|
-
type: s.enum(
|
|
1162
|
+
type: s.enum(Ut).describe("The type of reminder: relative, absolute, or location."),
|
|
1161
1163
|
minuteOffset: s.number().optional().describe("Minutes before due time to trigger (relative reminders only)."),
|
|
1162
|
-
due:
|
|
1164
|
+
due: Ms.optional().describe(
|
|
1163
1165
|
"Due date info (absolute and sometimes relative reminders)."
|
|
1164
1166
|
),
|
|
1165
1167
|
name: s.string().optional().describe("Location name (location reminders only)."),
|
|
1166
1168
|
locLat: s.string().optional().describe("Latitude (location reminders only)."),
|
|
1167
1169
|
locLong: s.string().optional().describe("Longitude (location reminders only)."),
|
|
1168
|
-
locTrigger: s.enum(
|
|
1169
|
-
radius: s.number().optional().describe("Geofence radius in meters (location reminders only).")
|
|
1170
|
-
|
|
1170
|
+
locTrigger: s.enum(dt).optional().describe("Trigger type: on_enter or on_leave (location reminders only)."),
|
|
1171
|
+
radius: s.number().optional().describe("Geofence radius in meters (location reminders only)."),
|
|
1172
|
+
isUrgent: s.boolean().optional().describe("Whether this is an urgent reminder (relative and absolute reminders only).")
|
|
1173
|
+
}), We = s.object({
|
|
1171
1174
|
item: s.string().describe("The item that failed (usually an ID or identifier)."),
|
|
1172
1175
|
error: s.string().describe("The error message."),
|
|
1173
1176
|
code: s.string().optional().describe("The error code, if available.")
|
|
1174
|
-
}),
|
|
1177
|
+
}), Fs = s.object({
|
|
1175
1178
|
taskId: s.string().optional().describe("The ID of the task to comment on."),
|
|
1176
1179
|
projectId: s.string().optional().describe(
|
|
1177
1180
|
'The ID of the project to comment on. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
1178
1181
|
),
|
|
1179
1182
|
content: s.string().min(1).describe("The content of the comment.")
|
|
1180
|
-
}),
|
|
1181
|
-
comments: s.array(
|
|
1182
|
-
},
|
|
1183
|
+
}), Hs = {
|
|
1184
|
+
comments: s.array(Fs).min(1).describe("The array of comments to add.")
|
|
1185
|
+
}, Ws = {
|
|
1183
1186
|
comments: s.array(fe).describe("The created comments."),
|
|
1184
1187
|
totalCount: s.number().describe("The total number of comments created."),
|
|
1185
1188
|
addedCommentIds: s.array(s.string()).describe("The IDs of the added comments.")
|
|
1186
|
-
},
|
|
1189
|
+
}, Bs = {
|
|
1187
1190
|
name: f.ADD_COMMENTS,
|
|
1188
1191
|
description: "Add multiple comments to tasks or projects. Each comment must specify either taskId or projectId.",
|
|
1189
|
-
parameters:
|
|
1190
|
-
outputSchema:
|
|
1192
|
+
parameters: Hs,
|
|
1193
|
+
outputSchema: Ws,
|
|
1191
1194
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1192
1195
|
async execute(e, t) {
|
|
1193
1196
|
const { comments: r } = e;
|
|
@@ -1213,7 +1216,7 @@ const ne = s.enum(me).optional().catch(void 0).describe("The color key of the en
|
|
|
1213
1216
|
});
|
|
1214
1217
|
}), c = (await Promise.all(a)).map(pe);
|
|
1215
1218
|
return {
|
|
1216
|
-
textContent:
|
|
1219
|
+
textContent: zs({ comments: c }),
|
|
1217
1220
|
structuredContent: {
|
|
1218
1221
|
comments: c,
|
|
1219
1222
|
totalCount: c.length,
|
|
@@ -1222,7 +1225,7 @@ const ne = s.enum(me).optional().catch(void 0).describe("The color key of the en
|
|
|
1222
1225
|
};
|
|
1223
1226
|
}
|
|
1224
1227
|
};
|
|
1225
|
-
function
|
|
1228
|
+
function zs({ comments: e }) {
|
|
1226
1229
|
const t = e.filter((a) => a.taskId).length, r = e.filter((a) => a.projectId).length, o = [];
|
|
1227
1230
|
if (t > 0) {
|
|
1228
1231
|
const a = t > 1 ? "comments" : "comment";
|
|
@@ -1234,25 +1237,25 @@ function Bs({ comments: e }) {
|
|
|
1234
1237
|
}
|
|
1235
1238
|
return o.length > 0 ? `Added ${o.join(" and ")}` : "No comments added";
|
|
1236
1239
|
}
|
|
1237
|
-
const
|
|
1240
|
+
const Ys = {
|
|
1238
1241
|
search: s.string().optional().describe(
|
|
1239
1242
|
"Search for a filter by name (partial and case insensitive match). If omitted, all filters are returned."
|
|
1240
1243
|
)
|
|
1241
|
-
},
|
|
1244
|
+
}, Be = s.object({
|
|
1242
1245
|
id: s.string().describe("The unique ID of the filter."),
|
|
1243
1246
|
name: s.string().describe("The name of the filter."),
|
|
1244
1247
|
query: s.string().describe('The filter query string (e.g. "today & p1", "#Work & overdue").'),
|
|
1245
1248
|
color: ne,
|
|
1246
1249
|
isFavorite: s.boolean().describe("Whether the filter is marked as favorite."),
|
|
1247
1250
|
itemOrder: s.number().describe("The display order of the filter.")
|
|
1248
|
-
}),
|
|
1249
|
-
filters: s.array(
|
|
1251
|
+
}), Gs = {
|
|
1252
|
+
filters: s.array(Be).describe("The found filters."),
|
|
1250
1253
|
totalCount: s.number().describe("The total number of filters returned.")
|
|
1251
|
-
},
|
|
1254
|
+
}, qs = {
|
|
1252
1255
|
name: f.FIND_FILTERS,
|
|
1253
1256
|
description: 'List all personal filters or search for filters by name. Filters are saved custom views that use query syntax to organize tasks (e.g. "today & p1", "#Work & overdue").',
|
|
1254
|
-
parameters:
|
|
1255
|
-
outputSchema:
|
|
1257
|
+
parameters: Ys,
|
|
1258
|
+
outputSchema: Gs,
|
|
1256
1259
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
1257
1260
|
async execute(e, t) {
|
|
1258
1261
|
let o = ((await t.sync({ resourceTypes: ["filters"], syncToken: "*" })).filters ?? []).filter((i) => !i.isDeleted);
|
|
@@ -1270,7 +1273,7 @@ const zs = {
|
|
|
1270
1273
|
itemOrder: i.itemOrder
|
|
1271
1274
|
}));
|
|
1272
1275
|
return {
|
|
1273
|
-
textContent:
|
|
1276
|
+
textContent: Ks({ filters: n, search: e.search }),
|
|
1274
1277
|
structuredContent: {
|
|
1275
1278
|
filters: n,
|
|
1276
1279
|
totalCount: n.length
|
|
@@ -1278,7 +1281,7 @@ const zs = {
|
|
|
1278
1281
|
};
|
|
1279
1282
|
}
|
|
1280
1283
|
};
|
|
1281
|
-
function
|
|
1284
|
+
function Ks({
|
|
1282
1285
|
filters: e,
|
|
1283
1286
|
search: t
|
|
1284
1287
|
}) {
|
|
@@ -1299,23 +1302,23 @@ ${n.map((a) => `- ${a}`).join(`
|
|
|
1299
1302
|
return o.join(`
|
|
1300
1303
|
`);
|
|
1301
1304
|
}
|
|
1302
|
-
const
|
|
1305
|
+
const Vs = s.object({
|
|
1303
1306
|
name: s.string().min(1).describe("The name of the filter."),
|
|
1304
1307
|
query: s.string().min(1).describe(
|
|
1305
1308
|
'The filter query string. Examples: "today & p1", "#Work & overdue", "@email & today", "(p1 | p2) & !assigned". Operators: | (OR), & (AND), ! (NOT), () grouping, , (multiple queries).'
|
|
1306
1309
|
),
|
|
1307
1310
|
color: le,
|
|
1308
1311
|
isFavorite: s.boolean().optional().describe("Whether to mark the filter as a favorite. Defaults to false.")
|
|
1309
|
-
}),
|
|
1310
|
-
filters: s.array(
|
|
1311
|
-
}, Js = {
|
|
1312
|
-
filters: s.array(We).describe("The created filters."),
|
|
1313
|
-
totalCount: s.number().describe("The total number of filters created.")
|
|
1312
|
+
}), Js = {
|
|
1313
|
+
filters: s.array(Vs).min(1).describe("The array of filters to add.")
|
|
1314
1314
|
}, Xs = {
|
|
1315
|
+
filters: s.array(Be).describe("The created filters."),
|
|
1316
|
+
totalCount: s.number().describe("The total number of filters created.")
|
|
1317
|
+
}, Zs = {
|
|
1315
1318
|
name: f.ADD_FILTERS,
|
|
1316
1319
|
description: "Add one or more new personal filters. Filters are saved custom views using query syntax to organize tasks.",
|
|
1317
|
-
parameters:
|
|
1318
|
-
outputSchema:
|
|
1320
|
+
parameters: Js,
|
|
1321
|
+
outputSchema: Xs,
|
|
1319
1322
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1320
1323
|
async execute({ filters: e }, t) {
|
|
1321
1324
|
const r = Date.now(), o = e.map((p, m) => `tempFilterAdd${m}${r}`), n = e.map((p, m) => z(
|
|
@@ -1350,26 +1353,26 @@ ${l}`,
|
|
|
1350
1353
|
}
|
|
1351
1354
|
};
|
|
1352
1355
|
}
|
|
1353
|
-
},
|
|
1356
|
+
}, Qs = s.object({
|
|
1354
1357
|
name: s.string().min(1).max(128).describe("The name of the label."),
|
|
1355
1358
|
color: le,
|
|
1356
1359
|
order: s.number().int().optional().describe("The position of the label in the label list."),
|
|
1357
1360
|
isFavorite: s.boolean().optional().describe("Whether the label is a favorite. Defaults to false.")
|
|
1358
|
-
}),
|
|
1359
|
-
labels: s.array(
|
|
1360
|
-
},
|
|
1361
|
+
}), er = {
|
|
1362
|
+
labels: s.array(Qs).min(1).describe("The array of labels to add.")
|
|
1363
|
+
}, tr = {
|
|
1361
1364
|
labels: s.array(be).describe("The created labels."),
|
|
1362
1365
|
totalCount: s.number().describe("The total number of labels created.")
|
|
1363
|
-
},
|
|
1366
|
+
}, sr = {
|
|
1364
1367
|
name: f.ADD_LABELS,
|
|
1365
1368
|
description: "Add one or more new personal labels.",
|
|
1366
|
-
parameters:
|
|
1367
|
-
outputSchema:
|
|
1369
|
+
parameters: er,
|
|
1370
|
+
outputSchema: tr,
|
|
1368
1371
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1369
1372
|
async execute({ labels: e }, t) {
|
|
1370
1373
|
const r = await Promise.all(e.map((n) => t.addLabel(n)));
|
|
1371
1374
|
return {
|
|
1372
|
-
textContent:
|
|
1375
|
+
textContent: rr({ labels: r }),
|
|
1373
1376
|
structuredContent: {
|
|
1374
1377
|
labels: r.map((n) => be.parse(n)),
|
|
1375
1378
|
totalCount: r.length
|
|
@@ -1377,22 +1380,22 @@ ${l}`,
|
|
|
1377
1380
|
};
|
|
1378
1381
|
}
|
|
1379
1382
|
};
|
|
1380
|
-
function
|
|
1383
|
+
function rr({ labels: e }) {
|
|
1381
1384
|
const t = e.length, r = e.map((o) => `• ${o.name} (id=${o.id})`).join(`
|
|
1382
1385
|
`);
|
|
1383
1386
|
return `Added ${t} label${t === 1 ? "" : "s"}:
|
|
1384
1387
|
${r}`;
|
|
1385
1388
|
}
|
|
1386
|
-
const
|
|
1387
|
-
function
|
|
1389
|
+
const or = 300 * 1e3;
|
|
1390
|
+
function nr(e) {
|
|
1388
1391
|
return /^\d+$/.test(e);
|
|
1389
1392
|
}
|
|
1390
|
-
class
|
|
1393
|
+
class ar {
|
|
1391
1394
|
constructor() {
|
|
1392
1395
|
this.cache = null;
|
|
1393
1396
|
}
|
|
1394
1397
|
async getWorkspaces(t) {
|
|
1395
|
-
if (this.cache && Date.now() - this.cache.timestamp <
|
|
1398
|
+
if (this.cache && Date.now() - this.cache.timestamp < or)
|
|
1396
1399
|
return this.cache.workspaces;
|
|
1397
1400
|
const r = await t.getWorkspaces();
|
|
1398
1401
|
return this.cache = { workspaces: r, timestamp: Date.now() }, r;
|
|
@@ -1415,7 +1418,7 @@ class nr {
|
|
|
1415
1418
|
const n = await this.getWorkspaces(t), a = n.find((u) => u.id === o);
|
|
1416
1419
|
if (a)
|
|
1417
1420
|
return { workspaceId: a.id, workspaceName: a.name };
|
|
1418
|
-
if (
|
|
1421
|
+
if (nr(o))
|
|
1419
1422
|
return { workspaceId: o, workspaceName: o };
|
|
1420
1423
|
const i = o.toLowerCase(), c = n.find((u) => u.name.toLowerCase() === i);
|
|
1421
1424
|
if (c)
|
|
@@ -1443,7 +1446,7 @@ ${u}` + (d.length > 5 ? `
|
|
|
1443
1446
|
this.cache = null;
|
|
1444
1447
|
}
|
|
1445
1448
|
}
|
|
1446
|
-
const
|
|
1449
|
+
const kt = new ar(), ir = s.object({
|
|
1447
1450
|
name: s.string().min(1).describe("The name of the project."),
|
|
1448
1451
|
parentId: s.string().optional().describe("The ID of the parent project. If provided, creates this as a sub-project."),
|
|
1449
1452
|
isFavorite: s.boolean().optional().describe("Whether the project is a favorite. Defaults to false."),
|
|
@@ -1452,23 +1455,23 @@ const yt = new nr(), ar = s.object({
|
|
|
1452
1455
|
workspace: s.string().trim().min(1).optional().describe(
|
|
1453
1456
|
"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."
|
|
1454
1457
|
)
|
|
1455
|
-
}),
|
|
1456
|
-
projects: s.array(
|
|
1457
|
-
},
|
|
1458
|
+
}), cr = {
|
|
1459
|
+
projects: s.array(ir).min(1).describe("The array of projects to add.")
|
|
1460
|
+
}, dr = {
|
|
1458
1461
|
projects: s.array(ae).describe("The created projects."),
|
|
1459
1462
|
totalCount: s.number().describe("The total number of projects created.")
|
|
1460
|
-
},
|
|
1463
|
+
}, lr = {
|
|
1461
1464
|
name: f.ADD_PROJECTS,
|
|
1462
1465
|
description: "Add one or more new projects.",
|
|
1463
|
-
parameters:
|
|
1464
|
-
outputSchema:
|
|
1466
|
+
parameters: cr,
|
|
1467
|
+
outputSchema: dr,
|
|
1465
1468
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1466
1469
|
async execute({ projects: e }, t) {
|
|
1467
1470
|
const r = [
|
|
1468
1471
|
...new Set(e.map((c) => c.workspace).filter(Boolean))
|
|
1469
1472
|
], o = /* @__PURE__ */ new Map();
|
|
1470
1473
|
for (const c of r) {
|
|
1471
|
-
const d = await
|
|
1474
|
+
const d = await kt.resolveWorkspace(t, c);
|
|
1472
1475
|
o.set(c, d.workspaceId);
|
|
1473
1476
|
}
|
|
1474
1477
|
const n = await Promise.all(
|
|
@@ -1476,7 +1479,7 @@ const yt = new nr(), ar = s.object({
|
|
|
1476
1479
|
const l = c ? o.get(c) : void 0;
|
|
1477
1480
|
return t.addProject({ ...d, ...l ? { workspaceId: l } : {} });
|
|
1478
1481
|
})
|
|
1479
|
-
), a =
|
|
1482
|
+
), a = ur({ projects: n }), i = n.map(q);
|
|
1480
1483
|
return {
|
|
1481
1484
|
textContent: a,
|
|
1482
1485
|
structuredContent: {
|
|
@@ -1486,18 +1489,18 @@ const yt = new nr(), ar = s.object({
|
|
|
1486
1489
|
};
|
|
1487
1490
|
}
|
|
1488
1491
|
};
|
|
1489
|
-
function
|
|
1492
|
+
function ur({ projects: e }) {
|
|
1490
1493
|
const t = e.length, r = e.map((n) => `• ${n.name} (id=${n.id})`).join(`
|
|
1491
1494
|
`);
|
|
1492
1495
|
return `Added ${t} project${t === 1 ? "" : "s"}:
|
|
1493
1496
|
${r}`;
|
|
1494
1497
|
}
|
|
1495
|
-
const ue = 25, ge = s.enum(Rt),
|
|
1498
|
+
const ue = 25, ge = s.enum(Rt), Tt = s.object({
|
|
1496
1499
|
date: s.string().optional().describe("Due date in YYYY-MM-DD format."),
|
|
1497
1500
|
string: s.string().optional().describe('Natural language due string, e.g. "tomorrow at 3pm".'),
|
|
1498
1501
|
timezone: s.string().optional().describe('Timezone for the reminder, e.g. "America/New_York".'),
|
|
1499
1502
|
lang: s.string().optional().describe('Language for parsing the due string, e.g. "en".')
|
|
1500
|
-
}),
|
|
1503
|
+
}), wt = s.enum(dt), ye = s.boolean().optional().describe("Whether this is an urgent reminder. Applies to relative and absolute reminders."), pr = s.object({
|
|
1501
1504
|
type: s.literal("relative"),
|
|
1502
1505
|
taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
|
|
1503
1506
|
minuteOffset: s.number().int().min(0).describe(
|
|
@@ -1505,41 +1508,43 @@ const ue = 25, ge = s.enum(Rt), kt = s.object({
|
|
|
1505
1508
|
),
|
|
1506
1509
|
service: ge.optional().describe(
|
|
1507
1510
|
'Delivery method: "email" or "push" notification. Defaults to push.'
|
|
1508
|
-
)
|
|
1509
|
-
|
|
1511
|
+
),
|
|
1512
|
+
isUrgent: ye
|
|
1513
|
+
}), mr = s.object({
|
|
1510
1514
|
type: s.literal("absolute"),
|
|
1511
1515
|
taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
|
|
1512
|
-
due:
|
|
1516
|
+
due: Tt.describe("The specific date/time for the reminder."),
|
|
1513
1517
|
service: ge.optional().describe(
|
|
1514
1518
|
'Delivery method: "email" or "push" notification. Defaults to push.'
|
|
1515
|
-
)
|
|
1516
|
-
|
|
1519
|
+
),
|
|
1520
|
+
isUrgent: ye
|
|
1521
|
+
}), hr = s.object({
|
|
1517
1522
|
type: s.literal("location"),
|
|
1518
1523
|
taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
|
|
1519
1524
|
name: s.string().min(1).describe('Name of the location, e.g. "Office", "Home".'),
|
|
1520
1525
|
locLat: s.string().describe('Latitude of the location as a string, e.g. "37.7749".'),
|
|
1521
1526
|
locLong: s.string().describe('Longitude of the location as a string, e.g. "-122.4194".'),
|
|
1522
|
-
locTrigger:
|
|
1527
|
+
locTrigger: wt.describe(
|
|
1523
1528
|
'When to trigger: "on_enter" (arriving) or "on_leave" (departing).'
|
|
1524
1529
|
),
|
|
1525
1530
|
radius: s.number().int().optional().describe("Radius in meters for the geofence. Defaults to server default.")
|
|
1526
|
-
}),
|
|
1527
|
-
ur,
|
|
1531
|
+
}), fr = s.discriminatedUnion("type", [
|
|
1528
1532
|
pr,
|
|
1529
|
-
mr
|
|
1530
|
-
|
|
1531
|
-
|
|
1533
|
+
mr,
|
|
1534
|
+
hr
|
|
1535
|
+
]), br = {
|
|
1536
|
+
reminders: s.array(fr).min(1).max(ue).describe(
|
|
1532
1537
|
`Array of reminders to create (max ${ue}). Each reminder must specify a type: "relative" (minutes before due), "absolute" (specific date/time), or "location" (geofence trigger).`
|
|
1533
1538
|
)
|
|
1534
|
-
},
|
|
1535
|
-
reminders: s.array(
|
|
1539
|
+
}, gr = {
|
|
1540
|
+
reminders: s.array(He).describe("The created reminders."),
|
|
1536
1541
|
totalCount: s.number().describe("Total number of reminders created."),
|
|
1537
1542
|
addedReminderIds: s.array(s.string()).describe("IDs of the created reminders.")
|
|
1538
|
-
},
|
|
1543
|
+
}, yr = {
|
|
1539
1544
|
name: f.ADD_REMINDERS,
|
|
1540
1545
|
description: 'Add reminders to tasks. Supports three types: "relative" (minutes before due), "absolute" (specific date/time), or "location" (geofence-triggered). Each reminder must specify a taskId.',
|
|
1541
|
-
parameters:
|
|
1542
|
-
outputSchema:
|
|
1546
|
+
parameters: br,
|
|
1547
|
+
outputSchema: gr,
|
|
1543
1548
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1544
1549
|
async execute(e, t) {
|
|
1545
1550
|
const { reminders: r } = e, o = r.map(async (c) => {
|
|
@@ -1549,14 +1554,16 @@ const ue = 25, ge = s.enum(Rt), kt = s.object({
|
|
|
1549
1554
|
taskId: c.taskId,
|
|
1550
1555
|
reminderType: "relative",
|
|
1551
1556
|
minuteOffset: c.minuteOffset,
|
|
1552
|
-
service: c.service
|
|
1557
|
+
service: c.service,
|
|
1558
|
+
isUrgent: c.isUrgent
|
|
1553
1559
|
});
|
|
1554
1560
|
case "absolute":
|
|
1555
1561
|
return await t.addReminder({
|
|
1556
1562
|
taskId: c.taskId,
|
|
1557
1563
|
reminderType: "absolute",
|
|
1558
1564
|
due: c.due,
|
|
1559
|
-
service: c.service
|
|
1565
|
+
service: c.service,
|
|
1566
|
+
isUrgent: c.isUrgent
|
|
1560
1567
|
});
|
|
1561
1568
|
case "location":
|
|
1562
1569
|
return await t.addLocationReminder({
|
|
@@ -1570,7 +1577,7 @@ const ue = 25, ge = s.enum(Rt), kt = s.object({
|
|
|
1570
1577
|
}
|
|
1571
1578
|
}), a = (await Promise.all(o)).map(ce);
|
|
1572
1579
|
return {
|
|
1573
|
-
textContent:
|
|
1580
|
+
textContent: kr(a),
|
|
1574
1581
|
structuredContent: {
|
|
1575
1582
|
reminders: a,
|
|
1576
1583
|
totalCount: a.length,
|
|
@@ -1579,8 +1586,8 @@ const ue = 25, ge = s.enum(Rt), kt = s.object({
|
|
|
1579
1586
|
};
|
|
1580
1587
|
}
|
|
1581
1588
|
};
|
|
1582
|
-
function
|
|
1583
|
-
const { timeBasedCount: t, locationCount: r } =
|
|
1589
|
+
function kr(e) {
|
|
1590
|
+
const { timeBasedCount: t, locationCount: r } = yt(e), o = [];
|
|
1584
1591
|
if (t > 0) {
|
|
1585
1592
|
const n = t > 1 ? "reminders" : "reminder";
|
|
1586
1593
|
o.push(`${t} time-based ${n}`);
|
|
@@ -1591,21 +1598,21 @@ function yr(e) {
|
|
|
1591
1598
|
}
|
|
1592
1599
|
return o.length > 0 ? `Added ${o.join(" and ")}` : "No reminders added";
|
|
1593
1600
|
}
|
|
1594
|
-
const
|
|
1601
|
+
const Tr = s.object({
|
|
1595
1602
|
name: s.string().min(1).describe("The name of the section."),
|
|
1596
1603
|
projectId: s.string().min(1).describe(
|
|
1597
1604
|
'The ID of the project to add the section to. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
1598
1605
|
)
|
|
1599
|
-
}),
|
|
1600
|
-
sections: s.array(
|
|
1601
|
-
},
|
|
1606
|
+
}), wr = {
|
|
1607
|
+
sections: s.array(Tr).min(1).describe("The array of sections to add.")
|
|
1608
|
+
}, Ir = {
|
|
1602
1609
|
sections: s.array(he).describe("The created sections."),
|
|
1603
1610
|
totalCount: s.number().describe("The total number of sections created.")
|
|
1604
|
-
},
|
|
1611
|
+
}, vr = {
|
|
1605
1612
|
name: f.ADD_SECTIONS,
|
|
1606
1613
|
description: "Add one or more new sections to projects.",
|
|
1607
|
-
parameters:
|
|
1608
|
-
outputSchema:
|
|
1614
|
+
parameters: wr,
|
|
1615
|
+
outputSchema: Ir,
|
|
1609
1616
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1610
1617
|
async execute({ sections: e }, t) {
|
|
1611
1618
|
const o = e.some((c) => de(c.projectId)) ? await t.getUser() : void 0, n = await Promise.all(
|
|
@@ -1621,7 +1628,7 @@ const kr = s.object({
|
|
|
1621
1628
|
n.map((c) => t.addSection(c))
|
|
1622
1629
|
);
|
|
1623
1630
|
return {
|
|
1624
|
-
textContent:
|
|
1631
|
+
textContent: jr({ sections: a }),
|
|
1625
1632
|
structuredContent: {
|
|
1626
1633
|
sections: a,
|
|
1627
1634
|
totalCount: a.length
|
|
@@ -1629,7 +1636,7 @@ const kr = s.object({
|
|
|
1629
1636
|
};
|
|
1630
1637
|
}
|
|
1631
1638
|
};
|
|
1632
|
-
function
|
|
1639
|
+
function jr({ sections: e }) {
|
|
1633
1640
|
const t = e.length, r = e.map((n) => `• ${n.name} (id=${n.id}, projectId=${n.projectId})`).join(`
|
|
1634
1641
|
`);
|
|
1635
1642
|
return `Added ${t} section${t === 1 ? "" : "s"}:
|
|
@@ -1644,7 +1651,7 @@ const Q = {
|
|
|
1644
1651
|
PROJECT_NOT_FOUND: "PROJECT_NOT_FOUND",
|
|
1645
1652
|
TASK_NOT_FOUND: "TASK_NOT_FOUND"
|
|
1646
1653
|
};
|
|
1647
|
-
class
|
|
1654
|
+
class Sr {
|
|
1648
1655
|
/**
|
|
1649
1656
|
* Validate a single assignment operation
|
|
1650
1657
|
*/
|
|
@@ -1853,17 +1860,17 @@ class jr {
|
|
|
1853
1860
|
};
|
|
1854
1861
|
}
|
|
1855
1862
|
}
|
|
1856
|
-
const
|
|
1863
|
+
const ze = new Sr();
|
|
1857
1864
|
function te(e = /* @__PURE__ */ new Date()) {
|
|
1858
1865
|
const t = e.getFullYear(), r = String(e.getMonth() + 1).padStart(2, "0"), o = String(e.getDate()).padStart(2, "0");
|
|
1859
1866
|
return `${t}-${r}-${o}`;
|
|
1860
1867
|
}
|
|
1861
|
-
function
|
|
1868
|
+
function Ye(e, t, r = {}) {
|
|
1862
1869
|
const { context: o, showDetails: n = !1 } = r, a = t.length, i = [], d = `${e} ${a} ${a === 1 ? "task" : "tasks"}${o ? ` ${o}` : ""}.`;
|
|
1863
1870
|
i.push(d);
|
|
1864
1871
|
const l = 5;
|
|
1865
1872
|
if (n || a <= l) {
|
|
1866
|
-
const u =
|
|
1873
|
+
const u = ke(t, l);
|
|
1867
1874
|
if (u.length > 0) {
|
|
1868
1875
|
const p = a > l ? `, +${a - l} more` : "";
|
|
1869
1876
|
i.push(`Tasks:
|
|
@@ -1873,35 +1880,35 @@ ${u}${p}.`);
|
|
|
1873
1880
|
return i.join(`
|
|
1874
1881
|
`);
|
|
1875
1882
|
}
|
|
1876
|
-
function
|
|
1883
|
+
function Ge(e) {
|
|
1877
1884
|
const { action: t, success: r, total: o, successItems: n, successLabel: a = "Completed", failures: i } = e, c = [], d = `${t}: ${r}/${o} successful.`;
|
|
1878
1885
|
if (c.push(d), n?.length && n.length <= 5 && c.push(`${a}:
|
|
1879
1886
|
${n.map((l) => ` ${l}`).join(`
|
|
1880
1887
|
`)}.`), i?.length) {
|
|
1881
1888
|
const l = i.length, u = `Failed (${l}):
|
|
1882
|
-
${i.slice(0,
|
|
1889
|
+
${i.slice(0, ve.MAX_FAILURES_SHOWN).map((p) => ` ${p.item} (Error: ${p.error}${p.code ? ` [${p.code}]` : ""})`).join(
|
|
1883
1890
|
`
|
|
1884
1891
|
`
|
|
1885
|
-
)}${l >
|
|
1892
|
+
)}${l > ve.MAX_FAILURES_SHOWN ? `, +${l - ve.MAX_FAILURES_SHOWN} more` : ""}.`;
|
|
1886
1893
|
c.push(u);
|
|
1887
1894
|
}
|
|
1888
1895
|
return c.join(`
|
|
1889
1896
|
`);
|
|
1890
1897
|
}
|
|
1891
|
-
function
|
|
1898
|
+
function Cr(e) {
|
|
1892
1899
|
const t = e.content || e.title || "Untitled", r = e.dueDate ? ` • due ${e.dueDate}` : "", o = e.priority ? ` • ${e.priority.toUpperCase()}` : "", n = e.projectName ? ` • ${e.projectName}` : "", a = e.id ? ` • id=${e.id}` : "";
|
|
1893
1900
|
return ` ${t}${r}${o}${n}${a}`;
|
|
1894
1901
|
}
|
|
1895
|
-
function
|
|
1902
|
+
function $r(e) {
|
|
1896
1903
|
const t = ` (${e.color})`, r = e.isFavorite ? " • ⭐" : "", o = ` • id=${e.id}`;
|
|
1897
1904
|
return ` ${e.name}${t}${r}${o}`;
|
|
1898
1905
|
}
|
|
1899
|
-
function
|
|
1906
|
+
function Dr(e) {
|
|
1900
1907
|
const t = e.inboxProject ? " • Inbox" : "", r = e.isFavorite ? " • ⭐" : "", o = e.isShared ? " • Shared" : "", n = e.viewStyle && e.viewStyle !== "list" ? ` • ${e.viewStyle}` : "", a = ` • id=${e.id}`;
|
|
1901
1908
|
return ` ${e.name}${t}${r}${o}${n}${a}`;
|
|
1902
1909
|
}
|
|
1903
|
-
function
|
|
1904
|
-
const o = e.slice(0, t).map(
|
|
1910
|
+
function ke(e, t = 5) {
|
|
1911
|
+
const o = e.slice(0, t).map(Cr).join(`
|
|
1905
1912
|
`);
|
|
1906
1913
|
if (e.length > t) {
|
|
1907
1914
|
const n = e.length - t;
|
|
@@ -1922,23 +1929,23 @@ function F({
|
|
|
1922
1929
|
}) {
|
|
1923
1930
|
const d = [], l = `${e}: ${t}${typeof r == "number" ? ` (limit ${r})` : ""}${o ? ", more available" : ""}.`;
|
|
1924
1931
|
return d.push(l), n?.length && d.push(`Filter: ${n.join("; ")}.`), a?.length && d.push(`Preview:
|
|
1925
|
-
${a}`), !t && i?.length && d.push(`No results. ${i.join("; ")}.`), (c?.length || o) && d.push(
|
|
1932
|
+
${a}`), !t && i?.length && d.push(`No results. ${i.join("; ")}.`), (c?.length || o) && d.push(It(c || [], o)), d.join(`
|
|
1926
1933
|
`);
|
|
1927
1934
|
}
|
|
1928
|
-
function
|
|
1935
|
+
function It(e, t) {
|
|
1929
1936
|
const r = [...e];
|
|
1930
1937
|
return t && r.push(`Pass cursor '${t}' to fetch more results.`), `${r.length === 1 ? "Possible suggested next step:" : "Possible suggested next steps:"}
|
|
1931
1938
|
${r.map((n) => `- ${n}`).join(`
|
|
1932
1939
|
`)}`;
|
|
1933
1940
|
}
|
|
1934
|
-
const
|
|
1941
|
+
const et = 25, xr = s.object({
|
|
1935
1942
|
content: s.string().min(1).describe(
|
|
1936
1943
|
'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.'
|
|
1937
1944
|
),
|
|
1938
1945
|
description: s.string().optional().describe(
|
|
1939
1946
|
"Additional details, notes, or context for the task. Use this for longer content rather than putting it in the task name. Supports Markdown."
|
|
1940
1947
|
),
|
|
1941
|
-
priority:
|
|
1948
|
+
priority: Ne.optional().describe(_e),
|
|
1942
1949
|
dueString: s.string().optional().describe("The due date for the task, in natural language."),
|
|
1943
1950
|
deadlineDate: s.string().optional().describe(
|
|
1944
1951
|
'The deadline date for the task in ISO 8601 format (YYYY-MM-DD, e.g., "2025-12-31"). Deadlines are immovable constraints shown with a different indicator than due dates.'
|
|
@@ -1959,25 +1966,25 @@ const Qe = 25, Dr = s.object({
|
|
|
1959
1966
|
isUncompletable: s.boolean().optional().describe(
|
|
1960
1967
|
"Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
|
|
1961
1968
|
)
|
|
1962
|
-
}),
|
|
1963
|
-
tasks: s.array(
|
|
1964
|
-
},
|
|
1969
|
+
}), Ar = {
|
|
1970
|
+
tasks: s.array(xr).min(1).max(et).describe(`The array of tasks to add (max ${et}).`)
|
|
1971
|
+
}, Er = {
|
|
1965
1972
|
tasks: s.array(K).describe("The created tasks."),
|
|
1966
1973
|
totalCount: s.number().describe("The total number of tasks created."),
|
|
1967
|
-
failures: s.array(
|
|
1974
|
+
failures: s.array(We).describe("Failed task creations with error details."),
|
|
1968
1975
|
totalRequested: s.number().describe("The total number of tasks requested."),
|
|
1969
1976
|
successCount: s.number().describe("The number of successfully created tasks."),
|
|
1970
1977
|
failureCount: s.number().describe("The number of failed task creations.")
|
|
1971
|
-
},
|
|
1978
|
+
}, Or = {
|
|
1972
1979
|
name: f.ADD_TASKS,
|
|
1973
1980
|
description: "Add one or more tasks to a project, section, or parent. Supports assignment to project collaborators.",
|
|
1974
|
-
parameters:
|
|
1975
|
-
outputSchema:
|
|
1981
|
+
parameters: Ar,
|
|
1982
|
+
outputSchema: Er,
|
|
1976
1983
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1977
1984
|
async execute({ tasks: e }, t) {
|
|
1978
1985
|
const r = /* @__PURE__ */ new Map();
|
|
1979
1986
|
e.forEach((l, u) => {
|
|
1980
|
-
const p =
|
|
1987
|
+
const p = Pr(l), m = r.get(p);
|
|
1981
1988
|
m ? m.push({ task: l, index: u }) : r.set(p, [{ task: l, index: u }]);
|
|
1982
1989
|
});
|
|
1983
1990
|
const n = (await Promise.all(
|
|
@@ -1985,7 +1992,7 @@ const Qe = 25, Dr = s.object({
|
|
|
1985
1992
|
const u = [];
|
|
1986
1993
|
for (const { task: p, index: m } of l)
|
|
1987
1994
|
try {
|
|
1988
|
-
const h = await
|
|
1995
|
+
const h = await Ur(p, t);
|
|
1989
1996
|
u.push({ index: m, result: { status: "fulfilled", value: h } });
|
|
1990
1997
|
} catch (h) {
|
|
1991
1998
|
u.push({
|
|
@@ -2005,7 +2012,7 @@ const Qe = 25, Dr = s.object({
|
|
|
2005
2012
|
const l = i.map((u) => `"${u.item}": ${u.error}`).join("; ");
|
|
2006
2013
|
throw new Error(`All ${i.length} task(s) failed to create: ${l}`);
|
|
2007
2014
|
}
|
|
2008
|
-
const c = a.map(
|
|
2015
|
+
const c = a.map(U);
|
|
2009
2016
|
return {
|
|
2010
2017
|
textContent: Rr({
|
|
2011
2018
|
tasks: c,
|
|
@@ -2023,10 +2030,10 @@ const Qe = 25, Dr = s.object({
|
|
|
2023
2030
|
};
|
|
2024
2031
|
}
|
|
2025
2032
|
};
|
|
2026
|
-
function
|
|
2033
|
+
function Pr(e) {
|
|
2027
2034
|
return `${e.projectId ?? ""}|${e.sectionId ?? ""}|${e.parentId ?? ""}`;
|
|
2028
2035
|
}
|
|
2029
|
-
async function
|
|
2036
|
+
async function Ur(e, t) {
|
|
2030
2037
|
const {
|
|
2031
2038
|
duration: r,
|
|
2032
2039
|
projectId: o,
|
|
@@ -2055,13 +2062,13 @@ async function Pr(e, t) {
|
|
|
2055
2062
|
labels: l,
|
|
2056
2063
|
deadlineDate: u
|
|
2057
2064
|
};
|
|
2058
|
-
if (d && (h.priority =
|
|
2065
|
+
if (d && (h.priority = ht(d)), c && !m && !n && !a)
|
|
2059
2066
|
throw new Error(
|
|
2060
2067
|
`Task "${e.content}": Cannot assign tasks without specifying project context. Please specify a projectId, sectionId, or parentId.`
|
|
2061
2068
|
);
|
|
2062
2069
|
if (r)
|
|
2063
2070
|
try {
|
|
2064
|
-
const { minutes: g } =
|
|
2071
|
+
const { minutes: g } = mt(r);
|
|
2065
2072
|
h = {
|
|
2066
2073
|
...h,
|
|
2067
2074
|
duration: g,
|
|
@@ -2086,7 +2093,7 @@ async function Pr(e, t) {
|
|
|
2086
2093
|
throw new Error(
|
|
2087
2094
|
`Task "${e.content}": Cannot determine target project for assignment validation`
|
|
2088
2095
|
);
|
|
2089
|
-
const I = await
|
|
2096
|
+
const I = await ze.validateTaskCreationAssignment(
|
|
2090
2097
|
t,
|
|
2091
2098
|
g,
|
|
2092
2099
|
c
|
|
@@ -2114,14 +2121,14 @@ function Rr({
|
|
|
2114
2121
|
const a = Array.from(o)[0];
|
|
2115
2122
|
n = a === "inbox" ? "" : `to ${a}`;
|
|
2116
2123
|
} else o.size > 1 && (n = "to multiple contexts");
|
|
2117
|
-
return t.length > 0 ?
|
|
2124
|
+
return t.length > 0 ? Ge({
|
|
2118
2125
|
action: `Added tasks${n ? ` ${n}` : ""}`,
|
|
2119
2126
|
success: e.length,
|
|
2120
2127
|
total: r.tasks.length,
|
|
2121
2128
|
successItems: e.map((a) => a.content ?? "Untitled"),
|
|
2122
2129
|
successLabel: "Created",
|
|
2123
2130
|
failures: t
|
|
2124
|
-
}) :
|
|
2131
|
+
}) : Ye("Added", e, {
|
|
2125
2132
|
context: n,
|
|
2126
2133
|
showDetails: !0
|
|
2127
2134
|
});
|
|
@@ -2130,7 +2137,7 @@ const _r = {
|
|
|
2130
2137
|
projectId: s.string().min(1).describe(
|
|
2131
2138
|
"The ID of the project to analyze. This triggers a new health analysis which may take some time to complete."
|
|
2132
2139
|
)
|
|
2133
|
-
},
|
|
2140
|
+
}, Nr = {
|
|
2134
2141
|
projectId: s.string().describe("The project ID."),
|
|
2135
2142
|
health: s.object({
|
|
2136
2143
|
status: s.enum(Re).describe("The health status after triggering analysis."),
|
|
@@ -2138,11 +2145,11 @@ const _r = {
|
|
|
2138
2145
|
updateInProgress: s.boolean().describe("Whether an analysis update is currently in progress.")
|
|
2139
2146
|
}).describe("The health response returned after triggering analysis."),
|
|
2140
2147
|
message: s.string().describe("A human-readable message about the analysis status.")
|
|
2141
|
-
},
|
|
2148
|
+
}, Lr = {
|
|
2142
2149
|
name: f.ANALYZE_PROJECT_HEALTH,
|
|
2143
2150
|
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.",
|
|
2144
2151
|
parameters: _r,
|
|
2145
|
-
outputSchema:
|
|
2152
|
+
outputSchema: Nr,
|
|
2146
2153
|
annotations: {
|
|
2147
2154
|
readOnlyHint: !1,
|
|
2148
2155
|
destructiveHint: !1,
|
|
@@ -2165,19 +2172,19 @@ ${n}`,
|
|
|
2165
2172
|
}
|
|
2166
2173
|
};
|
|
2167
2174
|
}
|
|
2168
|
-
}, Lr = {
|
|
2169
|
-
ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to complete.")
|
|
2170
2175
|
}, Mr = {
|
|
2176
|
+
ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to complete.")
|
|
2177
|
+
}, Fr = {
|
|
2171
2178
|
completed: s.array(s.string()).describe("The IDs of successfully completed tasks."),
|
|
2172
|
-
failures: s.array(
|
|
2179
|
+
failures: s.array(We).describe("Failed task completions with error details."),
|
|
2173
2180
|
totalRequested: s.number().describe("The total number of tasks requested to complete."),
|
|
2174
2181
|
successCount: s.number().describe("The number of successfully completed tasks."),
|
|
2175
2182
|
failureCount: s.number().describe("The number of failed task completions.")
|
|
2176
|
-
},
|
|
2183
|
+
}, Hr = {
|
|
2177
2184
|
name: f.COMPLETE_TASKS,
|
|
2178
2185
|
description: "Complete one or more tasks by their IDs.",
|
|
2179
|
-
parameters:
|
|
2180
|
-
outputSchema:
|
|
2186
|
+
parameters: Mr,
|
|
2187
|
+
outputSchema: Fr,
|
|
2181
2188
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
2182
2189
|
async execute(e, t) {
|
|
2183
2190
|
const r = [], o = [];
|
|
@@ -2192,7 +2199,7 @@ ${n}`,
|
|
|
2192
2199
|
});
|
|
2193
2200
|
}
|
|
2194
2201
|
return {
|
|
2195
|
-
textContent:
|
|
2202
|
+
textContent: Wr({
|
|
2196
2203
|
completed: r,
|
|
2197
2204
|
failures: o,
|
|
2198
2205
|
args: e
|
|
@@ -2207,12 +2214,12 @@ ${n}`,
|
|
|
2207
2214
|
};
|
|
2208
2215
|
}
|
|
2209
2216
|
};
|
|
2210
|
-
function
|
|
2217
|
+
function Wr({
|
|
2211
2218
|
completed: e,
|
|
2212
2219
|
failures: t,
|
|
2213
2220
|
args: r
|
|
2214
2221
|
}) {
|
|
2215
|
-
return
|
|
2222
|
+
return Ge({
|
|
2216
2223
|
action: "Completed tasks",
|
|
2217
2224
|
success: e.length,
|
|
2218
2225
|
total: r.ids.length,
|
|
@@ -2220,7 +2227,7 @@ function Hr({
|
|
|
2220
2227
|
failures: t
|
|
2221
2228
|
});
|
|
2222
2229
|
}
|
|
2223
|
-
const
|
|
2230
|
+
const vt = [
|
|
2224
2231
|
"project",
|
|
2225
2232
|
"section",
|
|
2226
2233
|
"task",
|
|
@@ -2229,20 +2236,20 @@ const It = [
|
|
|
2229
2236
|
"filter",
|
|
2230
2237
|
"reminder",
|
|
2231
2238
|
"location_reminder"
|
|
2232
|
-
],
|
|
2233
|
-
type: s.enum(
|
|
2239
|
+
], Br = {
|
|
2240
|
+
type: s.enum(vt).describe("The type of entity to delete."),
|
|
2234
2241
|
id: s.string().min(1).describe("The ID of the entity to delete.")
|
|
2235
|
-
},
|
|
2242
|
+
}, zr = {
|
|
2236
2243
|
deletedEntity: s.object({
|
|
2237
|
-
type: s.enum(
|
|
2244
|
+
type: s.enum(vt).describe("The type of deleted entity."),
|
|
2238
2245
|
id: s.string().describe("The ID of the deleted entity.")
|
|
2239
2246
|
}).describe("Information about the deleted entity."),
|
|
2240
2247
|
success: s.boolean().describe("Whether the deletion was successful.")
|
|
2241
|
-
},
|
|
2248
|
+
}, Yr = {
|
|
2242
2249
|
name: f.DELETE_OBJECT,
|
|
2243
2250
|
description: "Delete a project, section, task, comment, label, filter, reminder, or location_reminder by its ID.",
|
|
2244
|
-
parameters:
|
|
2245
|
-
outputSchema:
|
|
2251
|
+
parameters: Br,
|
|
2252
|
+
outputSchema: zr,
|
|
2246
2253
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !0 },
|
|
2247
2254
|
async execute(e, t) {
|
|
2248
2255
|
switch (e.type) {
|
|
@@ -2281,21 +2288,21 @@ const It = [
|
|
|
2281
2288
|
}
|
|
2282
2289
|
};
|
|
2283
2290
|
}
|
|
2284
|
-
},
|
|
2291
|
+
}, Gr = {
|
|
2285
2292
|
id: s.string().min(1).describe(
|
|
2286
2293
|
'A unique identifier for the document in the format "task:{id}" or "project:{id}".'
|
|
2287
2294
|
)
|
|
2288
|
-
},
|
|
2295
|
+
}, qr = {
|
|
2289
2296
|
id: s.string().describe("The ID of the fetched document."),
|
|
2290
2297
|
title: s.string().describe("The title of the document."),
|
|
2291
2298
|
text: s.string().describe("The text content of the document."),
|
|
2292
2299
|
url: s.string().describe("The URL of the document."),
|
|
2293
2300
|
metadata: s.record(s.string(), s.unknown()).optional().describe("Additional metadata about the document.")
|
|
2294
|
-
},
|
|
2301
|
+
}, Kr = {
|
|
2295
2302
|
name: f.FETCH,
|
|
2296
2303
|
description: 'Fetch the full contents of a task or project by its ID. The ID should be in the format "task:{id}" or "project:{id}".',
|
|
2297
|
-
parameters:
|
|
2298
|
-
outputSchema:
|
|
2304
|
+
parameters: Gr,
|
|
2305
|
+
outputSchema: qr,
|
|
2299
2306
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
2300
2307
|
async execute(e, t) {
|
|
2301
2308
|
const { id: r } = e, [o, n] = r.split(":", 2);
|
|
@@ -2305,7 +2312,7 @@ const It = [
|
|
|
2305
2312
|
);
|
|
2306
2313
|
let a;
|
|
2307
2314
|
if (o === "task") {
|
|
2308
|
-
const i = await t.getTask(n), c =
|
|
2315
|
+
const i = await t.getTask(n), c = U(i), d = [c.content];
|
|
2309
2316
|
c.description && d.push(`
|
|
2310
2317
|
|
|
2311
2318
|
Description: ${c.description}`), c.dueDate && d.push(`
|
|
@@ -2314,7 +2321,7 @@ Labels: ${c.labels.join(", ")}`), a = {
|
|
|
2314
2321
|
id: `task:${c.id}`,
|
|
2315
2322
|
title: c.content,
|
|
2316
2323
|
text: d.join(""),
|
|
2317
|
-
url:
|
|
2324
|
+
url: lt(c.id),
|
|
2318
2325
|
metadata: {
|
|
2319
2326
|
priority: c.priority,
|
|
2320
2327
|
projectId: c.projectId,
|
|
@@ -2337,7 +2344,7 @@ Favorite: Yes`), a = {
|
|
|
2337
2344
|
id: `project:${c.id}`,
|
|
2338
2345
|
title: c.name,
|
|
2339
2346
|
text: d.join(""),
|
|
2340
|
-
url:
|
|
2347
|
+
url: ut(c.id),
|
|
2341
2348
|
metadata: {
|
|
2342
2349
|
color: c.color,
|
|
2343
2350
|
isFavorite: c.isFavorite,
|
|
@@ -2353,25 +2360,25 @@ Favorite: Yes`), a = {
|
|
|
2353
2360
|
structuredContent: a
|
|
2354
2361
|
};
|
|
2355
2362
|
}
|
|
2356
|
-
},
|
|
2357
|
-
type: s.enum(
|
|
2363
|
+
}, jt = ["task", "project", "comment", "section"], Vr = {
|
|
2364
|
+
type: s.enum(jt).describe("The type of object to fetch."),
|
|
2358
2365
|
id: s.string().min(1).describe("The unique ID of the object to fetch.")
|
|
2359
|
-
},
|
|
2360
|
-
type: s.enum(
|
|
2366
|
+
}, Jr = {
|
|
2367
|
+
type: s.enum(jt).describe("The type of object fetched."),
|
|
2361
2368
|
id: s.string().describe("The ID of the fetched object."),
|
|
2362
2369
|
object: s.union([K, ae, fe, he]).describe("The fetched object data.")
|
|
2363
|
-
},
|
|
2370
|
+
}, Xr = {
|
|
2364
2371
|
name: f.FETCH_OBJECT,
|
|
2365
2372
|
description: "Fetch a single task, project, comment, or section by its ID. Use this when you have a specific object ID and want to retrieve its full details.",
|
|
2366
|
-
parameters:
|
|
2367
|
-
outputSchema:
|
|
2373
|
+
parameters: Vr,
|
|
2374
|
+
outputSchema: Jr,
|
|
2368
2375
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
2369
2376
|
async execute(e, t) {
|
|
2370
2377
|
const { type: r, id: o } = e;
|
|
2371
2378
|
try {
|
|
2372
2379
|
switch (r) {
|
|
2373
2380
|
case "task": {
|
|
2374
|
-
const n = await t.getTask(o), a =
|
|
2381
|
+
const n = await t.getTask(o), a = U(n);
|
|
2375
2382
|
return {
|
|
2376
2383
|
textContent: `Found task: ${a.content} • id=${a.id} • priority=${a.priority} • project=${a.projectId}`,
|
|
2377
2384
|
structuredContent: {
|
|
@@ -2427,7 +2434,7 @@ Favorite: Yes`), a = {
|
|
|
2427
2434
|
);
|
|
2428
2435
|
}
|
|
2429
2436
|
}
|
|
2430
|
-
},
|
|
2437
|
+
}, Zr = {
|
|
2431
2438
|
objectType: s.enum(["task", "project", "comment"]).optional().describe("Type of object to filter by."),
|
|
2432
2439
|
objectId: s.string().optional().describe("Filter by specific object ID (task, project, or comment)."),
|
|
2433
2440
|
eventType: s.enum([
|
|
@@ -2446,17 +2453,17 @@ Favorite: Yes`), a = {
|
|
|
2446
2453
|
initiatorId: s.string().optional().describe("Filter by the user ID who initiated the event."),
|
|
2447
2454
|
limit: s.number().int().min(1).max(C.ACTIVITY_MAX).default(C.ACTIVITY_DEFAULT).describe("Maximum number of activity events to return."),
|
|
2448
2455
|
cursor: s.string().optional().describe("Pagination cursor for retrieving the next page of results.")
|
|
2449
|
-
},
|
|
2450
|
-
events: s.array(
|
|
2456
|
+
}, Qr = {
|
|
2457
|
+
events: s.array(Ns).describe("The activity events."),
|
|
2451
2458
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
2452
2459
|
totalCount: s.number().describe("The total number of events in this page."),
|
|
2453
2460
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
2454
2461
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
2455
|
-
},
|
|
2462
|
+
}, eo = {
|
|
2456
2463
|
name: f.FIND_ACTIVITY,
|
|
2457
2464
|
description: "Retrieve recent activity logs to monitor and audit changes in Todoist. Shows events from all users by default (use initiatorId to filter by specific user). Track task completions, updates, deletions, project changes, and more with flexible filtering. Note: Date-based filtering is not supported by the Todoist API.",
|
|
2458
|
-
parameters:
|
|
2459
|
-
outputSchema:
|
|
2465
|
+
parameters: Zr,
|
|
2466
|
+
outputSchema: Qr,
|
|
2460
2467
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
2461
2468
|
async execute(e, t) {
|
|
2462
2469
|
const { objectType: r, objectId: o, eventType: n, projectId: a, taskId: i, initiatorId: c, limit: d, cursor: l } = e, u = {
|
|
@@ -2464,9 +2471,9 @@ Favorite: Yes`), a = {
|
|
|
2464
2471
|
cursor: l ?? null
|
|
2465
2472
|
};
|
|
2466
2473
|
r && n ? u.objectEventTypes = `${r}:${n}` : r ? u.objectEventTypes = `${r}:` : n && (u.objectEventTypes = `:${n}`), o && o !== "remove" && (u.objectId = o), a && (u.parentProjectId = a), i && (u.parentItemId = i), c && (u.initiatorId = c);
|
|
2467
|
-
const { results: p, nextCursor: m } = await t.getActivityLogs(u), h = p.map(
|
|
2474
|
+
const { results: p, nextCursor: m } = await t.getActivityLogs(u), h = p.map(Os);
|
|
2468
2475
|
return {
|
|
2469
|
-
textContent:
|
|
2476
|
+
textContent: to({ events: h, args: e, nextCursor: m }),
|
|
2470
2477
|
structuredContent: {
|
|
2471
2478
|
events: h,
|
|
2472
2479
|
nextCursor: m ?? void 0,
|
|
@@ -2477,7 +2484,7 @@ Favorite: Yes`), a = {
|
|
|
2477
2484
|
};
|
|
2478
2485
|
}
|
|
2479
2486
|
};
|
|
2480
|
-
function
|
|
2487
|
+
function to({
|
|
2481
2488
|
events: e,
|
|
2482
2489
|
args: t,
|
|
2483
2490
|
nextCursor: r
|
|
@@ -2498,12 +2505,12 @@ function eo({
|
|
|
2498
2505
|
limit: t.limit,
|
|
2499
2506
|
nextCursor: r ?? void 0,
|
|
2500
2507
|
filterHints: a,
|
|
2501
|
-
previewLines:
|
|
2508
|
+
previewLines: so(e, Math.min(e.length, t.limit)),
|
|
2502
2509
|
zeroReasonHints: i
|
|
2503
2510
|
});
|
|
2504
2511
|
}
|
|
2505
|
-
function
|
|
2506
|
-
const o = e.slice(0, t).map(
|
|
2512
|
+
function so(e, t = 10) {
|
|
2513
|
+
const o = e.slice(0, t).map(ro).join(`
|
|
2507
2514
|
`);
|
|
2508
2515
|
if (e.length > t) {
|
|
2509
2516
|
const n = e.length - t;
|
|
@@ -2512,8 +2519,8 @@ function to(e, t = 10) {
|
|
|
2512
2519
|
}
|
|
2513
2520
|
return o;
|
|
2514
2521
|
}
|
|
2515
|
-
function
|
|
2516
|
-
const t =
|
|
2522
|
+
function ro(e) {
|
|
2523
|
+
const t = oo(e.eventDate), r = `${e.eventType} ${e.objectType}`;
|
|
2517
2524
|
let o = "";
|
|
2518
2525
|
if (e.extraData) {
|
|
2519
2526
|
const c = e.extraData.content || e.extraData.name || e.extraData.last_content;
|
|
@@ -2522,7 +2529,7 @@ function so(e) {
|
|
|
2522
2529
|
const n = e.objectId ? ` • id=${e.objectId}` : "", a = e.initiatorId ? ` • by=${e.initiatorId}` : " • system", i = e.parentProjectId ? ` • project=${e.parentProjectId}` : "";
|
|
2523
2530
|
return ` [${t}] ${r}${o}${n}${a}${i}`;
|
|
2524
2531
|
}
|
|
2525
|
-
function
|
|
2532
|
+
function oo(e) {
|
|
2526
2533
|
try {
|
|
2527
2534
|
const t = new Date(e), r = t.toLocaleDateString("en-US", { month: "short", timeZone: "UTC" }), o = t.toLocaleDateString("en-US", { day: "numeric", timeZone: "UTC" }), n = t.toLocaleTimeString("en-US", {
|
|
2528
2535
|
hour: "2-digit",
|
|
@@ -2535,7 +2542,7 @@ function ro(e) {
|
|
|
2535
2542
|
return e;
|
|
2536
2543
|
}
|
|
2537
2544
|
}
|
|
2538
|
-
const
|
|
2545
|
+
const no = {
|
|
2539
2546
|
taskId: s.string().optional().describe("Find comments for a specific task."),
|
|
2540
2547
|
projectId: s.string().optional().describe(
|
|
2541
2548
|
'Find comments for a specific project. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
@@ -2543,7 +2550,7 @@ const oo = {
|
|
|
2543
2550
|
commentId: s.string().optional().describe("Get a specific comment by ID."),
|
|
2544
2551
|
cursor: s.string().optional().describe("Pagination cursor for retrieving more results."),
|
|
2545
2552
|
limit: s.number().int().min(1).max(C.COMMENTS_MAX).optional().describe("Maximum number of comments to return")
|
|
2546
|
-
},
|
|
2553
|
+
}, ao = {
|
|
2547
2554
|
comments: s.array(fe).describe("The found comments."),
|
|
2548
2555
|
searchType: s.string().describe(
|
|
2549
2556
|
'The type of search performed: "single" (comment ID), "task" (task ID), or "project" (project ID).'
|
|
@@ -2552,11 +2559,11 @@ const oo = {
|
|
|
2552
2559
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
2553
2560
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
2554
2561
|
totalCount: s.number().describe("The total number of comments in this page.")
|
|
2555
|
-
},
|
|
2562
|
+
}, io = {
|
|
2556
2563
|
name: f.FIND_COMMENTS,
|
|
2557
2564
|
description: "Find comments by task, project, or get a specific comment by ID. Exactly one of taskId, projectId, or commentId must be provided.",
|
|
2558
|
-
parameters:
|
|
2559
|
-
outputSchema:
|
|
2565
|
+
parameters: no,
|
|
2566
|
+
outputSchema: ao,
|
|
2560
2567
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
2561
2568
|
async execute(e, t) {
|
|
2562
2569
|
const r = [e.taskId, e.projectId, e.commentId].filter(Boolean);
|
|
@@ -2591,7 +2598,7 @@ const oo = {
|
|
|
2591
2598
|
throw new Error("Invalid state: no search parameter provided");
|
|
2592
2599
|
const c = i.map(pe);
|
|
2593
2600
|
return {
|
|
2594
|
-
textContent:
|
|
2601
|
+
textContent: co({
|
|
2595
2602
|
comments: c,
|
|
2596
2603
|
searchType: e.commentId ? "single" : e.taskId ? "task" : "project",
|
|
2597
2604
|
searchId: e.commentId || e.taskId || e.projectId || "",
|
|
@@ -2609,7 +2616,7 @@ const oo = {
|
|
|
2609
2616
|
};
|
|
2610
2617
|
}
|
|
2611
2618
|
};
|
|
2612
|
-
function
|
|
2619
|
+
function co({
|
|
2613
2620
|
comments: e,
|
|
2614
2621
|
searchType: t,
|
|
2615
2622
|
searchId: r,
|
|
@@ -2629,59 +2636,59 @@ function io({
|
|
|
2629
2636
|
a = `Found ${e.length} ${d} for ${t} ${r}${c}`, o && (a += " • More available");
|
|
2630
2637
|
}
|
|
2631
2638
|
if (n) {
|
|
2632
|
-
const i =
|
|
2639
|
+
const i = It([], n);
|
|
2633
2640
|
return `${a}
|
|
2634
2641
|
${i}`;
|
|
2635
2642
|
}
|
|
2636
2643
|
return a;
|
|
2637
2644
|
}
|
|
2638
|
-
function
|
|
2645
|
+
function St(e) {
|
|
2639
2646
|
const t = e.getUTCFullYear(), r = String(e.getUTCMonth() + 1).padStart(2, "0"), o = String(e.getUTCDate()).padStart(2, "0");
|
|
2640
2647
|
return `${t}-${r}-${o}`;
|
|
2641
2648
|
}
|
|
2642
|
-
function
|
|
2649
|
+
function lo(e) {
|
|
2643
2650
|
const t = /^([+-])(\d{2}):(\d{2})$/.exec(e);
|
|
2644
2651
|
if (!t)
|
|
2645
2652
|
return 0;
|
|
2646
2653
|
const [, r, o, n] = t, a = Number(o) * 60 + Number(n);
|
|
2647
2654
|
return r === "-" ? -a : a;
|
|
2648
2655
|
}
|
|
2649
|
-
function
|
|
2656
|
+
function uo(e, t) {
|
|
2650
2657
|
const r = new Date(e.getTime() + t * 60 * 1e3);
|
|
2651
|
-
return
|
|
2658
|
+
return St(r);
|
|
2652
2659
|
}
|
|
2653
|
-
function
|
|
2660
|
+
function tt(e, t) {
|
|
2654
2661
|
const [r, o, n] = e.split("-"), a = Number(r), i = Number(o), c = Number(n);
|
|
2655
2662
|
if (!Number.isFinite(a) || !Number.isFinite(i) || !Number.isFinite(c))
|
|
2656
2663
|
throw new Error(`Invalid date format: ${e}. Expected YYYY-MM-DD.`);
|
|
2657
2664
|
const d = new Date(Date.UTC(a, i - 1, c));
|
|
2658
|
-
return d.setUTCDate(d.getUTCDate() + t),
|
|
2665
|
+
return d.setUTCDate(d.getUTCDate() + t), St(d);
|
|
2659
2666
|
}
|
|
2660
|
-
const
|
|
2667
|
+
const po = ["and", "or"], qe = {
|
|
2661
2668
|
labels: s.string().array().optional().describe("The labels to filter the tasks by"),
|
|
2662
|
-
labelsOperator: s.enum(
|
|
2669
|
+
labelsOperator: s.enum(po).optional().describe(
|
|
2663
2670
|
'The operator to use when filtering by labels. This will dictate whether a task has all labels, or some of them. Default is "or".'
|
|
2664
2671
|
)
|
|
2665
2672
|
};
|
|
2666
|
-
function
|
|
2673
|
+
function Ke(e = [], t = "or") {
|
|
2667
2674
|
if (e.length === 0) return "";
|
|
2668
2675
|
const r = t === "and" ? " & " : " | ";
|
|
2669
2676
|
return `(${e.map((a) => a.startsWith("@") ? a : `@${a}`).join(` ${r} `)})`;
|
|
2670
2677
|
}
|
|
2671
|
-
const
|
|
2672
|
-
function
|
|
2678
|
+
const mo = 7;
|
|
2679
|
+
function ho({
|
|
2673
2680
|
since: e,
|
|
2674
2681
|
until: t,
|
|
2675
2682
|
userGmtOffset: r,
|
|
2676
2683
|
now: o = /* @__PURE__ */ new Date()
|
|
2677
2684
|
}) {
|
|
2678
|
-
const n =
|
|
2685
|
+
const n = lo(r), a = uo(o, n), i = mo - 1, c = t ?? (e ? tt(e, i) : a);
|
|
2679
2686
|
return {
|
|
2680
|
-
since: e ??
|
|
2687
|
+
since: e ?? tt(c, -i),
|
|
2681
2688
|
until: c
|
|
2682
2689
|
};
|
|
2683
2690
|
}
|
|
2684
|
-
const
|
|
2691
|
+
const fo = {
|
|
2685
2692
|
getBy: s.enum(["completion", "due"]).default("completion").describe(
|
|
2686
2693
|
'The method to use to get the tasks: "completion" to get tasks by completion date (ie, when the task was actually completed), "due" to get tasks by due date (ie, when the task was due to be completed by).'
|
|
2687
2694
|
),
|
|
@@ -2704,18 +2711,18 @@ const ho = {
|
|
|
2704
2711
|
cursor: s.string().optional().describe(
|
|
2705
2712
|
"The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters)."
|
|
2706
2713
|
),
|
|
2707
|
-
...
|
|
2708
|
-
},
|
|
2714
|
+
...qe
|
|
2715
|
+
}, bo = {
|
|
2709
2716
|
tasks: s.array(K).describe("The found completed tasks."),
|
|
2710
2717
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
2711
2718
|
totalCount: s.number().describe("The total number of tasks in this page."),
|
|
2712
2719
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
2713
2720
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
2714
|
-
},
|
|
2721
|
+
}, go = {
|
|
2715
2722
|
name: f.FIND_COMPLETED_TASKS,
|
|
2716
2723
|
description: "Get completed tasks. since/until are optional and default to a 7-day window when omitted. Includes all collaborators by default. Person-specific queries (summaries, plans, reports) require responsibleUser.",
|
|
2717
|
-
parameters:
|
|
2718
|
-
outputSchema:
|
|
2724
|
+
parameters: fo,
|
|
2725
|
+
outputSchema: bo,
|
|
2719
2726
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
2720
2727
|
async execute(e, t) {
|
|
2721
2728
|
const { getBy: r, labels: o, labelsOperator: n, since: a, until: i, responsibleUser: c, projectId: d, ...l } = e;
|
|
@@ -2723,17 +2730,17 @@ const ho = {
|
|
|
2723
2730
|
throw new Error(
|
|
2724
2731
|
"Cursor pagination requires explicit since and until. Reuse structuredContent.appliedFilters.since and structuredContent.appliedFilters.until from the previous page."
|
|
2725
2732
|
);
|
|
2726
|
-
const u = await
|
|
2727
|
-
let h =
|
|
2733
|
+
const u = await Le(t, c), p = u?.email;
|
|
2734
|
+
let h = Ke(o, n);
|
|
2728
2735
|
u && p && (h = se(h, `assigned to: ${p}`));
|
|
2729
2736
|
const g = await t.getUser(), I = g.tzInfo?.gmtString || "+00:00", D = await G({
|
|
2730
2737
|
projectId: d,
|
|
2731
2738
|
user: g
|
|
2732
|
-
}), $ =
|
|
2739
|
+
}), $ = ho({
|
|
2733
2740
|
since: a,
|
|
2734
2741
|
until: i,
|
|
2735
2742
|
userGmtOffset: I
|
|
2736
|
-
}), N = `${$.since}T00:00:00${I}`, T = `${$.until}T23:59:59${I}`, b = new Date(N).toISOString(), S = new Date(T).toISOString(),
|
|
2743
|
+
}), N = `${$.since}T00:00:00${I}`, T = `${$.until}T23:59:59${I}`, b = new Date(N).toISOString(), S = new Date(T).toISOString(), R = {
|
|
2737
2744
|
...e,
|
|
2738
2745
|
since: $.since,
|
|
2739
2746
|
until: $.until
|
|
@@ -2749,11 +2756,11 @@ const ho = {
|
|
|
2749
2756
|
since: b,
|
|
2750
2757
|
until: S,
|
|
2751
2758
|
...h ? { filterQuery: h, filterLang: "en" } : {}
|
|
2752
|
-
}), v = w.map(
|
|
2759
|
+
}), v = w.map(U);
|
|
2753
2760
|
return {
|
|
2754
|
-
textContent:
|
|
2761
|
+
textContent: yo({
|
|
2755
2762
|
tasks: v,
|
|
2756
|
-
args:
|
|
2763
|
+
args: R,
|
|
2757
2764
|
nextCursor: j,
|
|
2758
2765
|
assigneeEmail: p
|
|
2759
2766
|
}),
|
|
@@ -2762,12 +2769,12 @@ const ho = {
|
|
|
2762
2769
|
nextCursor: j ?? void 0,
|
|
2763
2770
|
totalCount: v.length,
|
|
2764
2771
|
hasMore: !!j,
|
|
2765
|
-
appliedFilters:
|
|
2772
|
+
appliedFilters: R
|
|
2766
2773
|
}
|
|
2767
2774
|
};
|
|
2768
2775
|
}
|
|
2769
2776
|
};
|
|
2770
|
-
function
|
|
2777
|
+
function yo({
|
|
2771
2778
|
tasks: e,
|
|
2772
2779
|
args: t,
|
|
2773
2780
|
nextCursor: r,
|
|
@@ -2789,11 +2796,11 @@ function go({
|
|
|
2789
2796
|
limit: t.limit,
|
|
2790
2797
|
nextCursor: r ?? void 0,
|
|
2791
2798
|
filterHints: i,
|
|
2792
|
-
previewLines:
|
|
2799
|
+
previewLines: ke(e, Math.min(e.length, t.limit)),
|
|
2793
2800
|
zeroReasonHints: c
|
|
2794
2801
|
});
|
|
2795
2802
|
}
|
|
2796
|
-
const
|
|
2803
|
+
const ko = {
|
|
2797
2804
|
searchText: s.string().optional().describe(
|
|
2798
2805
|
'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.'
|
|
2799
2806
|
),
|
|
@@ -2801,7 +2808,7 @@ const yo = {
|
|
|
2801
2808
|
cursor: s.string().optional().describe(
|
|
2802
2809
|
"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."
|
|
2803
2810
|
)
|
|
2804
|
-
},
|
|
2811
|
+
}, To = {
|
|
2805
2812
|
labels: s.array(be).describe("The found personal labels."),
|
|
2806
2813
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
2807
2814
|
totalCount: s.number().describe("The total number of labels in this page."),
|
|
@@ -2810,22 +2817,22 @@ const yo = {
|
|
|
2810
2817
|
"Names of all shared labels visible to you. These have no IDs or metadata — use their names directly when filtering tasks."
|
|
2811
2818
|
),
|
|
2812
2819
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
2813
|
-
},
|
|
2820
|
+
}, wo = {
|
|
2814
2821
|
name: f.FIND_LABELS,
|
|
2815
2822
|
description: "List personal labels and shared labels. Personal labels have full metadata (id, name, color, order, isFavorite) and support pagination and name search (partial, case insensitive). Shared labels are labels used on tasks shared with you — they are returned as names only (no IDs or metadata). When searching, all matching personal labels are fetched across all pages and returned as a single result set (limit and cursor are ignored). When not searching, personal labels are returned with pagination.",
|
|
2816
|
-
parameters:
|
|
2817
|
-
outputSchema:
|
|
2823
|
+
parameters: ko,
|
|
2824
|
+
outputSchema: To,
|
|
2818
2825
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
2819
2826
|
async execute(e, t) {
|
|
2820
2827
|
const [r, o] = await Promise.all([
|
|
2821
|
-
e.searchText ?
|
|
2828
|
+
e.searchText ? Ds(t, e.searchText).then((c) => ({
|
|
2822
2829
|
results: c,
|
|
2823
2830
|
nextCursor: null
|
|
2824
2831
|
})) : t.getLabels({ limit: e.limit, cursor: e.cursor ?? null }),
|
|
2825
|
-
|
|
2832
|
+
xs(t)
|
|
2826
2833
|
]), { results: n, nextCursor: a } = r, i = e.searchText ? { searchText: e.searchText } : { limit: e.limit, cursor: e.cursor };
|
|
2827
2834
|
return {
|
|
2828
|
-
textContent:
|
|
2835
|
+
textContent: Io({ labels: n, args: e, nextCursor: a, sharedLabels: o }),
|
|
2829
2836
|
structuredContent: {
|
|
2830
2837
|
labels: n.map((c) => be.parse(c)),
|
|
2831
2838
|
nextCursor: a ?? void 0,
|
|
@@ -2837,7 +2844,7 @@ const yo = {
|
|
|
2837
2844
|
};
|
|
2838
2845
|
}
|
|
2839
2846
|
};
|
|
2840
|
-
function
|
|
2847
|
+
function Io({
|
|
2841
2848
|
labels: e,
|
|
2842
2849
|
args: t,
|
|
2843
2850
|
nextCursor: r,
|
|
@@ -2845,7 +2852,7 @@ function wo({
|
|
|
2845
2852
|
}) {
|
|
2846
2853
|
const n = t.searchText ? `All labels matching "${t.searchText}"` : "Labels", a = [];
|
|
2847
2854
|
t.searchText && a.push(`searchText: "${t.searchText}"`);
|
|
2848
|
-
const i = 10, d = e.slice(0, i).map(
|
|
2855
|
+
const i = 10, d = e.slice(0, i).map($r).join(`
|
|
2849
2856
|
`), l = e.length - i, u = l > 0 ? `${d}
|
|
2850
2857
|
…and ${l} more` : d, p = [];
|
|
2851
2858
|
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"));
|
|
@@ -2862,13 +2869,13 @@ No shared labels.`;
|
|
|
2862
2869
|
zeroReasonHints: p
|
|
2863
2870
|
}) + m;
|
|
2864
2871
|
}
|
|
2865
|
-
const { FIND_PROJECTS:
|
|
2872
|
+
const { FIND_PROJECTS: vo, ADD_TASKS: Ct, UPDATE_TASKS: $t } = f, jo = {
|
|
2866
2873
|
projectId: s.string().min(1).describe("The ID of the project to search for collaborators in."),
|
|
2867
2874
|
searchTerm: s.string().optional().describe(
|
|
2868
2875
|
"Search for a collaborator by name or email (partial and case insensitive match). If omitted, all collaborators in the project are returned."
|
|
2869
2876
|
)
|
|
2870
|
-
},
|
|
2871
|
-
collaborators: s.array(
|
|
2877
|
+
}, So = {
|
|
2878
|
+
collaborators: s.array(Ls).describe("The found collaborators."),
|
|
2872
2879
|
projectInfo: s.object({
|
|
2873
2880
|
id: s.string().describe("The project ID."),
|
|
2874
2881
|
name: s.string().describe("The project name."),
|
|
@@ -2877,11 +2884,11 @@ const { FIND_PROJECTS: Io, ADD_TASKS: St, UPDATE_TASKS: Ct } = f, vo = {
|
|
|
2877
2884
|
totalCount: s.number().describe("The total number of collaborators found."),
|
|
2878
2885
|
totalAvailable: s.number().optional().describe("The total number of available collaborators in the project."),
|
|
2879
2886
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
2880
|
-
},
|
|
2887
|
+
}, Co = {
|
|
2881
2888
|
name: f.FIND_PROJECT_COLLABORATORS,
|
|
2882
2889
|
description: "Search for collaborators by name or other criteria in a project.",
|
|
2883
|
-
parameters:
|
|
2884
|
-
outputSchema:
|
|
2890
|
+
parameters: jo,
|
|
2891
|
+
outputSchema: So,
|
|
2885
2892
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
2886
2893
|
async execute(e, t) {
|
|
2887
2894
|
const { projectId: r, searchTerm: o } = e;
|
|
@@ -2895,7 +2902,7 @@ const { FIND_PROJECTS: Io, ADD_TASKS: St, UPDATE_TASKS: Ct } = f, vo = {
|
|
|
2895
2902
|
|
|
2896
2903
|
**Next steps:**
|
|
2897
2904
|
• Share the project to enable collaboration
|
|
2898
|
-
• Use ${
|
|
2905
|
+
• Use ${Ct} and ${$t} for assignment features once shared`,
|
|
2899
2906
|
structuredContent: {
|
|
2900
2907
|
collaborators: [],
|
|
2901
2908
|
projectInfo: {
|
|
@@ -2940,7 +2947,7 @@ const { FIND_PROJECTS: Io, ADD_TASKS: St, UPDATE_TASKS: Ct } = f, vo = {
|
|
|
2940
2947
|
);
|
|
2941
2948
|
}
|
|
2942
2949
|
return {
|
|
2943
|
-
textContent:
|
|
2950
|
+
textContent: $o({
|
|
2944
2951
|
collaborators: c,
|
|
2945
2952
|
projectName: n,
|
|
2946
2953
|
searchTerm: o,
|
|
@@ -2960,7 +2967,7 @@ const { FIND_PROJECTS: Io, ADD_TASKS: St, UPDATE_TASKS: Ct } = f, vo = {
|
|
|
2960
2967
|
};
|
|
2961
2968
|
}
|
|
2962
2969
|
};
|
|
2963
|
-
function
|
|
2970
|
+
function $o({
|
|
2964
2971
|
collaborators: e,
|
|
2965
2972
|
projectName: t,
|
|
2966
2973
|
searchTerm: r,
|
|
@@ -2976,7 +2983,7 @@ function Co({
|
|
|
2976
2983
|
const c = [];
|
|
2977
2984
|
e.length === 0 && (r ? (c.push(`No collaborators match "${r}"`), c.push("Try a broader search term or check spelling"), o > 0 && c.push(`${o} collaborators available without filter`)) : (c.push("Project has no collaborators"), c.push("Share the project to add collaborators")));
|
|
2978
2985
|
const d = [];
|
|
2979
|
-
return e.length > 0 ? (d.push(`Use ${
|
|
2986
|
+
return e.length > 0 ? (d.push(`Use ${Ct} with responsibleUser to assign new tasks`), d.push(`Use ${$t} with responsibleUser to reassign existing tasks`), d.push("Use collaborator names, emails, or IDs for assignments")) : (d.push(`Use ${vo} to find other projects`), r && o > 0 && d.push("Try searching without filters to see all collaborators")), F({
|
|
2980
2987
|
subject: n,
|
|
2981
2988
|
count: e.length,
|
|
2982
2989
|
filterHints: a,
|
|
@@ -2986,7 +2993,7 @@ function Co({
|
|
|
2986
2993
|
nextSteps: d
|
|
2987
2994
|
});
|
|
2988
2995
|
}
|
|
2989
|
-
const { ADD_PROJECTS:
|
|
2996
|
+
const { ADD_PROJECTS: Do } = f, xo = {
|
|
2990
2997
|
searchText: s.string().optional().describe(
|
|
2991
2998
|
'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.'
|
|
2992
2999
|
),
|
|
@@ -2994,22 +3001,22 @@ const { ADD_PROJECTS: $o } = f, Do = {
|
|
|
2994
3001
|
cursor: s.string().optional().describe(
|
|
2995
3002
|
"The cursor to get the next page of projects (cursor is obtained from the previous call to this tool, with the same parameters)."
|
|
2996
3003
|
)
|
|
2997
|
-
},
|
|
3004
|
+
}, Ao = {
|
|
2998
3005
|
projects: s.array(ae).describe("The found projects."),
|
|
2999
3006
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
3000
3007
|
totalCount: s.number().describe("The total number of projects in this page."),
|
|
3001
3008
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
3002
3009
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
3003
|
-
},
|
|
3010
|
+
}, Eo = {
|
|
3004
3011
|
name: f.FIND_PROJECTS,
|
|
3005
3012
|
description: "List all projects or search for projects by name. When searching, all matching projects are returned (pagination is ignored). When not searching, projects are returned with pagination.",
|
|
3006
|
-
parameters:
|
|
3007
|
-
outputSchema:
|
|
3013
|
+
parameters: xo,
|
|
3014
|
+
outputSchema: Ao,
|
|
3008
3015
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3009
3016
|
async execute(e, t) {
|
|
3010
3017
|
let r, o = null;
|
|
3011
3018
|
if (e.searchText)
|
|
3012
|
-
r = await
|
|
3019
|
+
r = await gt(t, e.searchText), o = null;
|
|
3013
3020
|
else {
|
|
3014
3021
|
const a = await t.getProjects({
|
|
3015
3022
|
limit: e.limit,
|
|
@@ -3019,7 +3026,7 @@ const { ADD_PROJECTS: $o } = f, Do = {
|
|
|
3019
3026
|
}
|
|
3020
3027
|
const n = r.map(q);
|
|
3021
3028
|
return {
|
|
3022
|
-
textContent:
|
|
3029
|
+
textContent: Oo({ projects: n, args: e, nextCursor: o }),
|
|
3023
3030
|
structuredContent: {
|
|
3024
3031
|
projects: n,
|
|
3025
3032
|
nextCursor: o ?? void 0,
|
|
@@ -3030,17 +3037,17 @@ const { ADD_PROJECTS: $o } = f, Do = {
|
|
|
3030
3037
|
};
|
|
3031
3038
|
}
|
|
3032
3039
|
};
|
|
3033
|
-
function
|
|
3040
|
+
function Oo({
|
|
3034
3041
|
projects: e,
|
|
3035
3042
|
args: t,
|
|
3036
3043
|
nextCursor: r
|
|
3037
3044
|
}) {
|
|
3038
3045
|
const o = t.searchText ? `All projects matching "${t.searchText}"` : "Projects", n = [];
|
|
3039
3046
|
t.searchText && n.push(`searchText: "${t.searchText}"`);
|
|
3040
|
-
const a = 10, c = e.slice(0, a).map(
|
|
3047
|
+
const a = 10, c = e.slice(0, a).map(Dr).join(`
|
|
3041
3048
|
`), d = e.length - a, l = d > 0 ? `${c}
|
|
3042
3049
|
…and ${d} more` : c, u = [];
|
|
3043
|
-
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 ${
|
|
3050
|
+
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 ${Do} to create a project`))), F({
|
|
3044
3051
|
subject: o,
|
|
3045
3052
|
count: e.length,
|
|
3046
3053
|
limit: t.searchText ? void 0 : t.limit,
|
|
@@ -3050,22 +3057,22 @@ function Eo({
|
|
|
3050
3057
|
zeroReasonHints: u
|
|
3051
3058
|
});
|
|
3052
3059
|
}
|
|
3053
|
-
const
|
|
3060
|
+
const Po = {
|
|
3054
3061
|
taskId: s.string().optional().describe(
|
|
3055
3062
|
"Find all reminders for a specific task. Returns both time-based and location reminders."
|
|
3056
3063
|
),
|
|
3057
3064
|
reminderId: s.string().optional().describe("Get a specific time-based reminder (relative or absolute) by its ID."),
|
|
3058
3065
|
locationReminderId: s.string().optional().describe("Get a specific location reminder by its ID.")
|
|
3059
|
-
},
|
|
3060
|
-
reminders: s.array(
|
|
3066
|
+
}, Uo = {
|
|
3067
|
+
reminders: s.array(He).describe("The found reminders (time-based and location)."),
|
|
3061
3068
|
searchType: s.string().describe('The search type used: "task", "reminder", or "location_reminder".'),
|
|
3062
3069
|
searchId: s.string().describe("The ID used for the search."),
|
|
3063
3070
|
totalCount: s.number().describe("Total reminders in this response.")
|
|
3064
3071
|
}, Ro = {
|
|
3065
3072
|
name: f.FIND_REMINDERS,
|
|
3066
3073
|
description: "Find reminders by task ID (returns all reminder types), or get a specific reminder by its ID. Use reminderId for time-based reminders and locationReminderId for location reminders.",
|
|
3067
|
-
parameters:
|
|
3068
|
-
outputSchema:
|
|
3074
|
+
parameters: Po,
|
|
3075
|
+
outputSchema: Uo,
|
|
3069
3076
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3070
3077
|
async execute(e, t) {
|
|
3071
3078
|
const { taskId: r, reminderId: o, locationReminderId: n } = e, a = [r, o, n].filter(Boolean);
|
|
@@ -3126,7 +3133,7 @@ const Oo = {
|
|
|
3126
3133
|
function _o(e, t) {
|
|
3127
3134
|
if (e.length === 0)
|
|
3128
3135
|
return `No reminders found for task ${t}`;
|
|
3129
|
-
const { timeBasedCount: r, locationCount: o } =
|
|
3136
|
+
const { timeBasedCount: r, locationCount: o } = yt(e), n = [];
|
|
3130
3137
|
if (r > 0) {
|
|
3131
3138
|
const a = r > 1 ? "time-based reminders" : "time-based reminder";
|
|
3132
3139
|
n.push(`${r} ${a}`);
|
|
@@ -3137,22 +3144,22 @@ function _o(e, t) {
|
|
|
3137
3144
|
}
|
|
3138
3145
|
return `Found ${n.join(" and ")} for task ${t}`;
|
|
3139
3146
|
}
|
|
3140
|
-
const { ADD_SECTIONS:
|
|
3147
|
+
const { ADD_SECTIONS: No } = f, Lo = {
|
|
3141
3148
|
projectId: s.string().min(1).describe(
|
|
3142
3149
|
'The ID of the project to search sections in. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
3143
3150
|
),
|
|
3144
3151
|
searchText: s.string().optional().describe(
|
|
3145
3152
|
'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.'
|
|
3146
3153
|
)
|
|
3147
|
-
},
|
|
3154
|
+
}, Mo = {
|
|
3148
3155
|
sections: s.array(he).describe("The found sections."),
|
|
3149
3156
|
totalCount: s.number().describe("The total number of sections found."),
|
|
3150
3157
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
3151
|
-
},
|
|
3158
|
+
}, Fo = {
|
|
3152
3159
|
name: f.FIND_SECTIONS,
|
|
3153
3160
|
description: "Search for sections by name or other criteria in a project. When searching, uses server-side search to avoid fetching all sections.",
|
|
3154
|
-
parameters:
|
|
3155
|
-
outputSchema:
|
|
3161
|
+
parameters: Lo,
|
|
3162
|
+
outputSchema: Mo,
|
|
3156
3163
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3157
3164
|
async execute(e, t) {
|
|
3158
3165
|
const r = await G({
|
|
@@ -3160,12 +3167,12 @@ const { ADD_SECTIONS: Uo } = f, No = {
|
|
|
3160
3167
|
client: t
|
|
3161
3168
|
});
|
|
3162
3169
|
let o;
|
|
3163
|
-
e.searchText ? o = await
|
|
3170
|
+
e.searchText ? o = await As(t, e.searchText, r) : o = (await t.getSections({
|
|
3164
3171
|
projectId: r
|
|
3165
3172
|
})).results;
|
|
3166
3173
|
const n = o.map(({ id: i, name: c }) => ({ id: i, name: c }));
|
|
3167
3174
|
return {
|
|
3168
|
-
textContent:
|
|
3175
|
+
textContent: Ho({
|
|
3169
3176
|
sections: n,
|
|
3170
3177
|
projectId: e.projectId,
|
|
3171
3178
|
searchText: e.searchText
|
|
@@ -3178,13 +3185,13 @@ const { ADD_SECTIONS: Uo } = f, No = {
|
|
|
3178
3185
|
};
|
|
3179
3186
|
}
|
|
3180
3187
|
};
|
|
3181
|
-
function
|
|
3188
|
+
function Ho({
|
|
3182
3189
|
sections: e,
|
|
3183
3190
|
projectId: t,
|
|
3184
3191
|
searchText: r
|
|
3185
3192
|
}) {
|
|
3186
3193
|
const o = [];
|
|
3187
|
-
r ? (o.push("Try broader search terms"), o.push("Check spelling"), o.push("Remove searchText to see all sections")) : (o.push("Project has no sections yet"), o.push(`Use ${
|
|
3194
|
+
r ? (o.push("Try broader search terms"), o.push("Check spelling"), o.push("Remove searchText to see all sections")) : (o.push("Project has no sections yet"), o.push(`Use ${No} to create sections`));
|
|
3188
3195
|
const n = r ? `Sections in project ${t} matching "${r}"` : `Sections in project ${t}`, a = e.length > 0 ? e.map((i) => ` ${i.name} • id=${i.id}`).join(`
|
|
3189
3196
|
`) : void 0;
|
|
3190
3197
|
return F({
|
|
@@ -3194,13 +3201,13 @@ function Fo({
|
|
|
3194
3201
|
zeroReasonHints: o
|
|
3195
3202
|
});
|
|
3196
3203
|
}
|
|
3197
|
-
const
|
|
3198
|
-
class
|
|
3204
|
+
const Wo = 300 * 1e3;
|
|
3205
|
+
class Bo {
|
|
3199
3206
|
constructor() {
|
|
3200
3207
|
this.cache = null;
|
|
3201
3208
|
}
|
|
3202
3209
|
async getFilters(t) {
|
|
3203
|
-
if (this.cache && Date.now() - this.cache.timestamp <
|
|
3210
|
+
if (this.cache && Date.now() - this.cache.timestamp < Wo)
|
|
3204
3211
|
return this.cache.filters;
|
|
3205
3212
|
const o = ((await t.sync({
|
|
3206
3213
|
resourceTypes: ["filters"],
|
|
@@ -3257,7 +3264,7 @@ ${u}` + (d.length > 5 ? `
|
|
|
3257
3264
|
this.cache = null;
|
|
3258
3265
|
}
|
|
3259
3266
|
}
|
|
3260
|
-
const
|
|
3267
|
+
const zo = new Bo(), { FIND_COMPLETED_TASKS: st, ADD_TASKS: rt } = f, Yo = {
|
|
3261
3268
|
searchText: s.string().optional().describe("The text to search for in tasks."),
|
|
3262
3269
|
projectId: s.string().optional().describe(
|
|
3263
3270
|
'Find tasks in this project. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
@@ -3265,7 +3272,7 @@ const Bo = new Wo(), { FIND_COMPLETED_TASKS: tt, ADD_TASKS: st } = f, zo = {
|
|
|
3265
3272
|
sectionId: s.string().optional().describe("Find tasks in this section."),
|
|
3266
3273
|
parentId: s.string().optional().describe("Find subtasks of this parent task."),
|
|
3267
3274
|
responsibleUser: s.string().optional().describe("Find tasks assigned to this user. Can be a user ID, name, or email address."),
|
|
3268
|
-
responsibleUserFiltering: s.enum(
|
|
3275
|
+
responsibleUserFiltering: s.enum(ft).optional().describe(
|
|
3269
3276
|
'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`.'
|
|
3270
3277
|
),
|
|
3271
3278
|
limit: s.number().int().min(1).max(C.TASKS_MAX).default(C.TASKS_DEFAULT).describe("The maximum number of tasks to return."),
|
|
@@ -3278,18 +3285,18 @@ const Bo = new Wo(), { FIND_COMPLETED_TASKS: tt, ADD_TASKS: st } = f, zo = {
|
|
|
3278
3285
|
filterIdOrName: s.string().optional().describe(
|
|
3279
3286
|
"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."
|
|
3280
3287
|
),
|
|
3281
|
-
...
|
|
3282
|
-
},
|
|
3288
|
+
...qe
|
|
3289
|
+
}, Go = {
|
|
3283
3290
|
tasks: s.array(K).describe("The found tasks."),
|
|
3284
3291
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
3285
3292
|
totalCount: s.number().describe("The total number of tasks in this page."),
|
|
3286
3293
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
3287
3294
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
3288
|
-
},
|
|
3295
|
+
}, qo = {
|
|
3289
3296
|
name: f.FIND_TASKS,
|
|
3290
3297
|
description: "Find tasks by text search, project/section/parent container, responsible user, labels, a raw Todoist filter string, or a saved filter by ID or name (filterIdOrName). At least one filter must be provided.",
|
|
3291
|
-
parameters:
|
|
3292
|
-
outputSchema:
|
|
3298
|
+
parameters: Yo,
|
|
3299
|
+
outputSchema: Go,
|
|
3293
3300
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3294
3301
|
async execute(e, t) {
|
|
3295
3302
|
const {
|
|
@@ -3319,29 +3326,29 @@ const Bo = new Wo(), { FIND_COMPLETED_TASKS: tt, ADD_TASKS: st } = f, zo = {
|
|
|
3319
3326
|
'The `filter`/`filterIdOrName` parameter cannot be combined with projectId, sectionId, or parentId. Use filter syntax instead (e.g. "##ProjectName").'
|
|
3320
3327
|
);
|
|
3321
3328
|
let D = m;
|
|
3322
|
-
h && (D = (await
|
|
3323
|
-
const $ = await
|
|
3329
|
+
h && (D = (await zo.resolveFilter(t, h)).filterQuery);
|
|
3330
|
+
const $ = await Le(t, i), N = $?.userId, T = $?.email;
|
|
3324
3331
|
if (o || n || a) {
|
|
3325
3332
|
const x = {
|
|
3326
3333
|
limit: d,
|
|
3327
3334
|
cursor: l ?? null
|
|
3328
3335
|
};
|
|
3329
3336
|
o && (x.projectId = await G({ projectId: o, user: g })), n && (x.sectionId = n), a && (x.parentId = a);
|
|
3330
|
-
const { results: L, nextCursor: H } = await t.getTasks(x),
|
|
3331
|
-
let M = r ?
|
|
3337
|
+
const { results: L, nextCursor: H } = await t.getTasks(x), Te = L.map(U);
|
|
3338
|
+
let M = r ? Te.filter(
|
|
3332
3339
|
(V) => V.content.toLowerCase().includes(r.toLowerCase()) || V.description?.toLowerCase().includes(r.toLowerCase())
|
|
3333
|
-
) :
|
|
3334
|
-
return M =
|
|
3340
|
+
) : Te;
|
|
3341
|
+
return M = $s({
|
|
3335
3342
|
tasks: M,
|
|
3336
3343
|
resolvedAssigneeId: N,
|
|
3337
3344
|
currentUserId: g.id,
|
|
3338
3345
|
responsibleUserFiltering: c
|
|
3339
3346
|
}), u && u.length > 0 && (M = p === "and" ? M.filter(
|
|
3340
|
-
(V) => u.every((
|
|
3347
|
+
(V) => u.every((we) => V.labels.includes(we))
|
|
3341
3348
|
) : M.filter(
|
|
3342
|
-
(V) => u.some((
|
|
3349
|
+
(V) => u.some((we) => V.labels.includes(we))
|
|
3343
3350
|
)), {
|
|
3344
|
-
textContent:
|
|
3351
|
+
textContent: Se({
|
|
3345
3352
|
tasks: M,
|
|
3346
3353
|
args: e,
|
|
3347
3354
|
nextCursor: H,
|
|
@@ -3363,9 +3370,9 @@ const Bo = new Wo(), { FIND_COMPLETED_TASKS: tt, ADD_TASKS: st } = f, zo = {
|
|
|
3363
3370
|
lang: "en",
|
|
3364
3371
|
limit: d,
|
|
3365
3372
|
cursor: l ?? null
|
|
3366
|
-
}), H = x.map(
|
|
3373
|
+
}), H = x.map(U);
|
|
3367
3374
|
return {
|
|
3368
|
-
textContent:
|
|
3375
|
+
textContent: Se({
|
|
3369
3376
|
tasks: H,
|
|
3370
3377
|
args: e,
|
|
3371
3378
|
nextCursor: L,
|
|
@@ -3383,23 +3390,23 @@ const Bo = new Wo(), { FIND_COMPLETED_TASKS: tt, ADD_TASKS: st } = f, zo = {
|
|
|
3383
3390
|
}
|
|
3384
3391
|
let b = D ? `(${D})` : "";
|
|
3385
3392
|
r && (b = se(b, `search: ${r}`));
|
|
3386
|
-
const S =
|
|
3393
|
+
const S = Ke(u, p);
|
|
3387
3394
|
if (b = se(b, S), !(h && !i && !c)) {
|
|
3388
|
-
const x =
|
|
3395
|
+
const x = bt({
|
|
3389
3396
|
resolvedAssigneeId: N,
|
|
3390
3397
|
assigneeEmail: T,
|
|
3391
3398
|
responsibleUserFiltering: c
|
|
3392
3399
|
});
|
|
3393
3400
|
b = se(b, x);
|
|
3394
3401
|
}
|
|
3395
|
-
const { tasks: w, nextCursor: j } = await
|
|
3402
|
+
const { tasks: w, nextCursor: j } = await Fe({
|
|
3396
3403
|
client: t,
|
|
3397
3404
|
query: b,
|
|
3398
3405
|
cursor: e.cursor,
|
|
3399
3406
|
limit: e.limit
|
|
3400
3407
|
});
|
|
3401
3408
|
return {
|
|
3402
|
-
textContent:
|
|
3409
|
+
textContent: Se({
|
|
3403
3410
|
tasks: w,
|
|
3404
3411
|
args: e,
|
|
3405
3412
|
nextCursor: j,
|
|
@@ -3416,12 +3423,12 @@ const Bo = new Wo(), { FIND_COMPLETED_TASKS: tt, ADD_TASKS: st } = f, zo = {
|
|
|
3416
3423
|
};
|
|
3417
3424
|
}
|
|
3418
3425
|
};
|
|
3419
|
-
function
|
|
3426
|
+
function Ko(e) {
|
|
3420
3427
|
if (e.projectId) {
|
|
3421
3428
|
const t = [
|
|
3422
3429
|
e.searchText ? "No tasks in project match search" : "Project has no tasks yet"
|
|
3423
3430
|
];
|
|
3424
|
-
return e.searchText || t.push(`Use ${
|
|
3431
|
+
return e.searchText || t.push(`Use ${rt} to create tasks`), t;
|
|
3425
3432
|
}
|
|
3426
3433
|
if (e.sectionId) {
|
|
3427
3434
|
const t = [e.searchText ? "No tasks in section match search" : "Section is empty"];
|
|
@@ -3429,11 +3436,11 @@ function qo(e) {
|
|
|
3429
3436
|
}
|
|
3430
3437
|
if (e.parentId) {
|
|
3431
3438
|
const t = [e.searchText ? "No subtasks match search" : "No subtasks created yet"];
|
|
3432
|
-
return e.searchText || t.push(`Use ${
|
|
3439
|
+
return e.searchText || t.push(`Use ${rt} with parentId to add subtasks`), t;
|
|
3433
3440
|
}
|
|
3434
3441
|
return [];
|
|
3435
3442
|
}
|
|
3436
|
-
function
|
|
3443
|
+
function Se({
|
|
3437
3444
|
tasks: e,
|
|
3438
3445
|
args: t,
|
|
3439
3446
|
nextCursor: r,
|
|
@@ -3451,7 +3458,7 @@ function je({
|
|
|
3451
3458
|
const d = t.labels.map((l) => `@${l}`).join(t.labelsOperator === "and" ? " & " : " | ");
|
|
3452
3459
|
i.push(`labels: ${d}`);
|
|
3453
3460
|
}
|
|
3454
|
-
e.length === 0 && c.push(...
|
|
3461
|
+
e.length === 0 && c.push(...Ko(t));
|
|
3455
3462
|
} else {
|
|
3456
3463
|
const d = n || t.responsibleUser, l = [];
|
|
3457
3464
|
if (t.filter && l.push(`filter: ${t.filter}`), t.searchText && l.push(`"${t.searchText}"`), t.responsibleUser && l.push(`assigned to ${d}`), t.labels && t.labels.length > 0) {
|
|
@@ -3465,9 +3472,9 @@ function je({
|
|
|
3465
3472
|
if (e.length === 0) {
|
|
3466
3473
|
if (t.responsibleUser) {
|
|
3467
3474
|
const u = n || t.responsibleUser;
|
|
3468
|
-
c.push(`No tasks assigned to ${u}`), c.push("Check if the user name is correct"), c.push(`Check completed tasks with ${
|
|
3475
|
+
c.push(`No tasks assigned to ${u}`), c.push("Check if the user name is correct"), c.push(`Check completed tasks with ${st}`);
|
|
3469
3476
|
}
|
|
3470
|
-
t.searchText && (c.push("Try broader search terms"), c.push("Verify spelling and try partial words"), t.responsibleUser || c.push(`Check completed tasks with ${
|
|
3477
|
+
t.searchText && (c.push("Try broader search terms"), c.push("Verify spelling and try partial words"), t.responsibleUser || c.push(`Check completed tasks with ${st}`));
|
|
3471
3478
|
}
|
|
3472
3479
|
}
|
|
3473
3480
|
return F({
|
|
@@ -3476,14 +3483,14 @@ function je({
|
|
|
3476
3483
|
limit: t.limit,
|
|
3477
3484
|
nextCursor: r ?? void 0,
|
|
3478
3485
|
filterHints: i,
|
|
3479
|
-
previewLines:
|
|
3486
|
+
previewLines: ke(e, Math.min(e.length, t.limit)),
|
|
3480
3487
|
zeroReasonHints: c
|
|
3481
3488
|
});
|
|
3482
3489
|
}
|
|
3483
|
-
function
|
|
3490
|
+
function Dt(e) {
|
|
3484
3491
|
return /* @__PURE__ */ new Date(`${e}T00:00:00`);
|
|
3485
3492
|
}
|
|
3486
|
-
const
|
|
3493
|
+
const Vo = {
|
|
3487
3494
|
startDate: s.string().regex(/^(\d{4}-\d{2}-\d{2}|today)$/).optional().describe("The start date to get the tasks for. Format: YYYY-MM-DD or 'today'."),
|
|
3488
3495
|
overdueOption: s.enum(["overdue-only", "include-overdue", "exclude-overdue"]).optional().describe(
|
|
3489
3496
|
"How to handle overdue tasks. 'overdue-only' to get only overdue tasks, 'include-overdue' to include overdue tasks along with tasks for the specified date(s), and 'exclude-overdue' to exclude overdue tasks. Default is 'include-overdue'."
|
|
@@ -3498,57 +3505,57 @@ const Ko = {
|
|
|
3498
3505
|
responsibleUser: s.string().optional().describe(
|
|
3499
3506
|
"Filter tasks assigned to this user. User ID, name, or email. For personal queries (summaries, plans, reports), set to current user from user-info to exclude collaborators."
|
|
3500
3507
|
),
|
|
3501
|
-
responsibleUserFiltering: s.enum(
|
|
3508
|
+
responsibleUserFiltering: s.enum(ft).optional().describe(
|
|
3502
3509
|
"Filter when responsibleUser is omitted. 'assigned'=assigned to others; 'unassignedOrMe'=unassigned+mine; 'all'=everyone. Default: 'unassignedOrMe'."
|
|
3503
3510
|
),
|
|
3504
|
-
...
|
|
3505
|
-
},
|
|
3511
|
+
...qe
|
|
3512
|
+
}, Jo = {
|
|
3506
3513
|
tasks: s.array(K).describe("The found tasks."),
|
|
3507
3514
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
3508
3515
|
totalCount: s.number().describe("The total number of tasks in this page."),
|
|
3509
3516
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
3510
3517
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
3511
|
-
},
|
|
3518
|
+
}, Xo = {
|
|
3512
3519
|
name: f.FIND_TASKS_BY_DATE,
|
|
3513
3520
|
description: "Get tasks by date range. startDate='today' includes overdue items. Default responsibleUserFiltering='unassignedOrMe' excludes others' tasks. Person-specific queries (summaries, plans, reports) require responsibleUser.",
|
|
3514
|
-
parameters:
|
|
3515
|
-
outputSchema:
|
|
3521
|
+
parameters: Vo,
|
|
3522
|
+
outputSchema: Jo,
|
|
3516
3523
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3517
3524
|
async execute(e, t) {
|
|
3518
3525
|
if (!e.startDate && e.overdueOption !== "overdue-only")
|
|
3519
3526
|
throw new Error(
|
|
3520
3527
|
"Either startDate must be provided or overdueOption must be set to overdue-only"
|
|
3521
3528
|
);
|
|
3522
|
-
const r = await
|
|
3529
|
+
const r = await Le(t, e.responsibleUser), o = r?.userId, n = r?.email;
|
|
3523
3530
|
let a = "";
|
|
3524
3531
|
if (e.overdueOption === "overdue-only")
|
|
3525
3532
|
a = "overdue";
|
|
3526
3533
|
else if (e.startDate === "today")
|
|
3527
3534
|
if (e.daysCount > 1) {
|
|
3528
|
-
const p = /* @__PURE__ */ new Date(), m = te(p), h =
|
|
3535
|
+
const p = /* @__PURE__ */ new Date(), m = te(p), h = De(p, e.daysCount), g = Je(h, { representation: "date" }), I = `(due after: ${m} | due: ${m}) & due before: ${g}`;
|
|
3529
3536
|
a = e.overdueOption === "exclude-overdue" ? I : `(${I} | overdue)`;
|
|
3530
3537
|
} else
|
|
3531
3538
|
a = e.overdueOption === "exclude-overdue" ? "today" : "(today | overdue)";
|
|
3532
3539
|
else if (e.startDate) {
|
|
3533
|
-
const p = e.startDate, m =
|
|
3540
|
+
const p = e.startDate, m = De(Dt(p), e.daysCount), h = Je(m, { representation: "date" });
|
|
3534
3541
|
a = `(due after: ${p} | due: ${p}) & due before: ${h}`;
|
|
3535
3542
|
}
|
|
3536
|
-
const i =
|
|
3543
|
+
const i = Ke(e.labels, e.labelsOperator);
|
|
3537
3544
|
i.length > 0 && (a = se(a, `(${i})`));
|
|
3538
|
-
const c =
|
|
3545
|
+
const c = bt({
|
|
3539
3546
|
resolvedAssigneeId: o,
|
|
3540
3547
|
assigneeEmail: n,
|
|
3541
3548
|
responsibleUserFiltering: e.responsibleUserFiltering
|
|
3542
3549
|
});
|
|
3543
3550
|
a = se(a, c);
|
|
3544
|
-
const { tasks: d, nextCursor: l } = await
|
|
3551
|
+
const { tasks: d, nextCursor: l } = await Fe({
|
|
3545
3552
|
client: t,
|
|
3546
3553
|
query: a,
|
|
3547
3554
|
cursor: e.cursor,
|
|
3548
3555
|
limit: e.limit
|
|
3549
3556
|
});
|
|
3550
3557
|
return {
|
|
3551
|
-
textContent:
|
|
3558
|
+
textContent: Zo({ tasks: d, args: e, nextCursor: l, assigneeEmail: n }),
|
|
3552
3559
|
structuredContent: {
|
|
3553
3560
|
tasks: d,
|
|
3554
3561
|
nextCursor: l ?? void 0,
|
|
@@ -3559,7 +3566,7 @@ const Ko = {
|
|
|
3559
3566
|
};
|
|
3560
3567
|
}
|
|
3561
3568
|
};
|
|
3562
|
-
function
|
|
3569
|
+
function Zo({
|
|
3563
3570
|
tasks: e,
|
|
3564
3571
|
args: t,
|
|
3565
3572
|
nextCursor: r,
|
|
@@ -3574,7 +3581,7 @@ function Xo({
|
|
|
3574
3581
|
`today${c}${t.daysCount > 1 ? ` + ${t.daysCount - 1} more days` : ""}`
|
|
3575
3582
|
);
|
|
3576
3583
|
} else if (t.startDate) {
|
|
3577
|
-
const c = t.daysCount > 1 ? ` to ${te(
|
|
3584
|
+
const c = t.daysCount > 1 ? ` to ${te(De(Dt(t.startDate), t.daysCount))}` : "";
|
|
3578
3585
|
n.push(`${t.startDate}${c}`);
|
|
3579
3586
|
}
|
|
3580
3587
|
if (t.labels && t.labels.length > 0) {
|
|
@@ -3605,15 +3612,15 @@ function Xo({
|
|
|
3605
3612
|
limit: t.limit,
|
|
3606
3613
|
nextCursor: r ?? void 0,
|
|
3607
3614
|
filterHints: n,
|
|
3608
|
-
previewLines:
|
|
3615
|
+
previewLines: ke(e, Math.min(e.length, t.limit)),
|
|
3609
3616
|
zeroReasonHints: i
|
|
3610
3617
|
});
|
|
3611
3618
|
}
|
|
3612
|
-
const
|
|
3619
|
+
const Qo = {
|
|
3613
3620
|
projectId: s.string().min(1).optional().describe(
|
|
3614
3621
|
"Optional project ID. If provided, shows detailed overview of that project. If omitted, shows overview of all projects."
|
|
3615
3622
|
)
|
|
3616
|
-
},
|
|
3623
|
+
}, xt = s.lazy(
|
|
3617
3624
|
() => s.object({
|
|
3618
3625
|
id: s.string().describe("The project ID."),
|
|
3619
3626
|
name: s.string().describe("The project name."),
|
|
@@ -3626,9 +3633,9 @@ const Zo = {
|
|
|
3626
3633
|
name: s.string()
|
|
3627
3634
|
})
|
|
3628
3635
|
),
|
|
3629
|
-
children: s.array(
|
|
3636
|
+
children: s.array(xt).describe("Nested child projects.")
|
|
3630
3637
|
})
|
|
3631
|
-
),
|
|
3638
|
+
), en = {
|
|
3632
3639
|
type: s.enum(["account_overview", "project_overview"]).describe("The type of overview returned."),
|
|
3633
3640
|
totalProjects: s.number().optional().describe("Total number of projects (account overview only)."),
|
|
3634
3641
|
totalTasks: s.number().optional().describe("Total number of tasks."),
|
|
@@ -3652,7 +3659,7 @@ const Zo = {
|
|
|
3652
3659
|
})
|
|
3653
3660
|
).describe("Sections in the inbox project.")
|
|
3654
3661
|
}).nullable().optional().describe("Inbox information (account overview only)."),
|
|
3655
|
-
projects: s.array(s.lazy(() =>
|
|
3662
|
+
projects: s.array(s.lazy(() => xt)).optional().describe(
|
|
3656
3663
|
"List of projects with hierarchy, folders, and ordering (account overview only)."
|
|
3657
3664
|
),
|
|
3658
3665
|
project: s.object({
|
|
@@ -3672,7 +3679,7 @@ const Zo = {
|
|
|
3672
3679
|
tasksWithoutSection: s.number()
|
|
3673
3680
|
}).optional().describe("Statistics object (project overview only).")
|
|
3674
3681
|
};
|
|
3675
|
-
function
|
|
3682
|
+
function tn(e) {
|
|
3676
3683
|
const t = {};
|
|
3677
3684
|
for (const n of e)
|
|
3678
3685
|
t[n.id] = {
|
|
@@ -3697,7 +3704,7 @@ function en(e) {
|
|
|
3697
3704
|
}
|
|
3698
3705
|
return o(r), r;
|
|
3699
3706
|
}
|
|
3700
|
-
async function
|
|
3707
|
+
async function sn(e, t) {
|
|
3701
3708
|
const r = {};
|
|
3702
3709
|
return await Promise.all(
|
|
3703
3710
|
t.map(async (o) => {
|
|
@@ -3706,17 +3713,17 @@ async function tn(e, t) {
|
|
|
3706
3713
|
})
|
|
3707
3714
|
), r;
|
|
3708
3715
|
}
|
|
3709
|
-
function
|
|
3716
|
+
function At(e, t, r = "") {
|
|
3710
3717
|
const o = [];
|
|
3711
3718
|
o.push(`${r}- Project: ${e.name} (id=${e.id})`);
|
|
3712
3719
|
const n = t[e.id] || [];
|
|
3713
3720
|
for (const a of n)
|
|
3714
3721
|
o.push(`${r} - Section: ${a.name} (id=${a.id})`);
|
|
3715
3722
|
for (const a of e.children)
|
|
3716
|
-
o.push(...
|
|
3723
|
+
o.push(...At(a, t, `${r} `));
|
|
3717
3724
|
return o;
|
|
3718
3725
|
}
|
|
3719
|
-
function
|
|
3726
|
+
function ot(e) {
|
|
3720
3727
|
const t = {};
|
|
3721
3728
|
for (const o of e)
|
|
3722
3729
|
t[o.id] = { ...o, children: [] };
|
|
@@ -3733,26 +3740,26 @@ function rt(e) {
|
|
|
3733
3740
|
}
|
|
3734
3741
|
return r;
|
|
3735
3742
|
}
|
|
3736
|
-
function
|
|
3743
|
+
function Ue(e, t = "") {
|
|
3737
3744
|
const r = [];
|
|
3738
3745
|
for (const o of e) {
|
|
3739
3746
|
const n = `id=${o.id}`, a = o.dueDate ? `; due=${o.dueDate}` : "", i = `; content=${o.content}`;
|
|
3740
|
-
r.push(`${t}- ${n}${a}${i}`), o.children.length > 0 && r.push(...
|
|
3747
|
+
r.push(`${t}- ${n}${a}${i}`), o.children.length > 0 && r.push(...Ue(o.children, `${t} `));
|
|
3741
3748
|
}
|
|
3742
3749
|
return r;
|
|
3743
3750
|
}
|
|
3744
|
-
function
|
|
3751
|
+
function Et(e, t) {
|
|
3745
3752
|
return {
|
|
3746
3753
|
id: e.id,
|
|
3747
3754
|
name: e.name,
|
|
3748
3755
|
parentId: re(e) ? e.parentId ?? void 0 : void 0,
|
|
3749
|
-
folderId:
|
|
3756
|
+
folderId: Pe(e) ? e.folderId ?? void 0 : void 0,
|
|
3750
3757
|
childOrder: e.childOrder,
|
|
3751
3758
|
sections: t[e.id] || [],
|
|
3752
|
-
children: e.children.map((r) =>
|
|
3759
|
+
children: e.children.map((r) => Et(r, t))
|
|
3753
3760
|
};
|
|
3754
3761
|
}
|
|
3755
|
-
async function
|
|
3762
|
+
async function rn(e, t) {
|
|
3756
3763
|
let r = [], o;
|
|
3757
3764
|
do {
|
|
3758
3765
|
const { results: n, nextCursor: a } = await e.getTasks({
|
|
@@ -3760,16 +3767,16 @@ async function sn(e, t) {
|
|
|
3760
3767
|
limit: C.TASKS_BATCH_SIZE,
|
|
3761
3768
|
cursor: o ?? void 0
|
|
3762
3769
|
});
|
|
3763
|
-
r = r.concat(n.map(
|
|
3770
|
+
r = r.concat(n.map(U)), o = a ?? void 0;
|
|
3764
3771
|
} while (o);
|
|
3765
3772
|
return r;
|
|
3766
3773
|
}
|
|
3767
|
-
async function
|
|
3774
|
+
async function on(e, t) {
|
|
3768
3775
|
const { results: r } = await e.getSections({ projectId: t });
|
|
3769
3776
|
return r;
|
|
3770
3777
|
}
|
|
3771
|
-
async function
|
|
3772
|
-
const { results: t } = await e.getProjects({}), r = t.find((p) => re(p) && p.inboxProject === !0), o = t.filter((p) => !re(p) || p.inboxProject !== !0), n =
|
|
3778
|
+
async function nn(e) {
|
|
3779
|
+
const { results: t } = await e.getProjects({}), r = t.find((p) => re(p) && p.inboxProject === !0), o = t.filter((p) => !re(p) || p.inboxProject !== !0), n = tn(o), a = t.map((p) => p.id), i = await sn(e, a), c = ["# Personal Projects", ""];
|
|
3773
3780
|
if (r) {
|
|
3774
3781
|
c.push(`- Inbox Project: ${r.name} (id=${r.id})`);
|
|
3775
3782
|
for (const p of i[r.id] || [])
|
|
@@ -3777,7 +3784,7 @@ async function on(e) {
|
|
|
3777
3784
|
}
|
|
3778
3785
|
if (n.length)
|
|
3779
3786
|
for (const p of n)
|
|
3780
|
-
c.push(...
|
|
3787
|
+
c.push(...At(p, i));
|
|
3781
3788
|
else
|
|
3782
3789
|
c.push("_No projects found._");
|
|
3783
3790
|
c.push("");
|
|
@@ -3795,7 +3802,7 @@ async function on(e) {
|
|
|
3795
3802
|
sections: i[r.id] || []
|
|
3796
3803
|
} : null,
|
|
3797
3804
|
projects: n.map(
|
|
3798
|
-
(p) =>
|
|
3805
|
+
(p) => Et(p, i)
|
|
3799
3806
|
),
|
|
3800
3807
|
totalProjects: t.length,
|
|
3801
3808
|
totalSections: a.reduce(
|
|
@@ -3806,11 +3813,11 @@ async function on(e) {
|
|
|
3806
3813
|
};
|
|
3807
3814
|
return { textContent: l, structuredContent: u };
|
|
3808
3815
|
}
|
|
3809
|
-
async function
|
|
3816
|
+
async function an(e, t) {
|
|
3810
3817
|
const [r, o, n] = await Promise.all([
|
|
3811
3818
|
e.getProject(t),
|
|
3812
|
-
|
|
3813
|
-
|
|
3819
|
+
on(e, t),
|
|
3820
|
+
rn(e, t)
|
|
3814
3821
|
]), a = {};
|
|
3815
3822
|
for (const u of o)
|
|
3816
3823
|
a[u.id] = [];
|
|
@@ -3820,16 +3827,16 @@ async function nn(e, t) {
|
|
|
3820
3827
|
const c = [`# ${r.name}`];
|
|
3821
3828
|
if (i.length > 0) {
|
|
3822
3829
|
c.push("");
|
|
3823
|
-
const u =
|
|
3824
|
-
c.push(...
|
|
3830
|
+
const u = ot(i);
|
|
3831
|
+
c.push(...Ue(u));
|
|
3825
3832
|
}
|
|
3826
3833
|
for (const u of o) {
|
|
3827
3834
|
c.push(""), c.push(`## ${u.name}`);
|
|
3828
3835
|
const p = a[u.id];
|
|
3829
3836
|
if (!p?.length)
|
|
3830
3837
|
continue;
|
|
3831
|
-
const m =
|
|
3832
|
-
c.push(...
|
|
3838
|
+
const m = ot(p);
|
|
3839
|
+
c.push(...Ue(m));
|
|
3833
3840
|
}
|
|
3834
3841
|
const d = c.join(`
|
|
3835
3842
|
`), l = {
|
|
@@ -3852,33 +3859,33 @@ async function nn(e, t) {
|
|
|
3852
3859
|
};
|
|
3853
3860
|
return { textContent: d, structuredContent: l };
|
|
3854
3861
|
}
|
|
3855
|
-
const
|
|
3862
|
+
const cn = {
|
|
3856
3863
|
name: f.GET_OVERVIEW,
|
|
3857
3864
|
description: "Get a Markdown overview. If no projectId is provided, shows all projects with hierarchy and sections (useful for navigation). If projectId is provided, shows detailed overview of that specific project including all tasks grouped by sections.",
|
|
3858
|
-
parameters:
|
|
3859
|
-
outputSchema:
|
|
3865
|
+
parameters: Qo,
|
|
3866
|
+
outputSchema: en,
|
|
3860
3867
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3861
3868
|
async execute(e, t) {
|
|
3862
|
-
const r = e.projectId ? await
|
|
3869
|
+
const r = e.projectId ? await an(t, e.projectId) : await nn(t);
|
|
3863
3870
|
return {
|
|
3864
3871
|
textContent: r.textContent,
|
|
3865
3872
|
structuredContent: r.structuredContent
|
|
3866
3873
|
};
|
|
3867
3874
|
}
|
|
3868
|
-
},
|
|
3875
|
+
}, dn = {}, ee = s.object({
|
|
3869
3876
|
count: s.number().describe("Number of consecutive periods in this streak."),
|
|
3870
3877
|
start: s.string().describe("Start date of the streak."),
|
|
3871
3878
|
end: s.string().describe("End date of the streak.")
|
|
3872
|
-
}),
|
|
3879
|
+
}), nt = s.object({
|
|
3873
3880
|
id: s.string().describe("Project ID."),
|
|
3874
3881
|
completed: s.number().describe("Number of tasks completed in this project.")
|
|
3875
|
-
}),
|
|
3882
|
+
}), ln = {
|
|
3876
3883
|
completedCount: s.number().describe("Total number of completed tasks (all-time)."),
|
|
3877
3884
|
daysItems: s.array(
|
|
3878
3885
|
s.object({
|
|
3879
3886
|
date: s.string().describe("Date string (YYYY-MM-DD)."),
|
|
3880
3887
|
totalCompleted: s.number().describe("Total tasks completed on this day."),
|
|
3881
|
-
items: s.array(
|
|
3888
|
+
items: s.array(nt).describe("Per-project completion breakdown for this day.")
|
|
3882
3889
|
})
|
|
3883
3890
|
).describe("Daily completion breakdown (most recent days)."),
|
|
3884
3891
|
weekItems: s.array(
|
|
@@ -3886,7 +3893,7 @@ const an = {
|
|
|
3886
3893
|
from: s.string().describe("Start date of the week."),
|
|
3887
3894
|
to: s.string().describe("End date of the week."),
|
|
3888
3895
|
totalCompleted: s.number().describe("Total tasks completed in this week."),
|
|
3889
|
-
items: s.array(
|
|
3896
|
+
items: s.array(nt).describe("Per-project completion breakdown for this week.")
|
|
3890
3897
|
})
|
|
3891
3898
|
).describe("Weekly completion breakdown (most recent weeks)."),
|
|
3892
3899
|
goals: s.object({
|
|
@@ -3921,11 +3928,11 @@ const an = {
|
|
|
3921
3928
|
})
|
|
3922
3929
|
).describe("Recent karma change events with reasons."),
|
|
3923
3930
|
projectColors: s.record(s.string(), s.string()).describe("Map of project ID to color key.")
|
|
3924
|
-
},
|
|
3931
|
+
}, un = {
|
|
3925
3932
|
name: f.GET_PRODUCTIVITY_STATS,
|
|
3926
3933
|
description: "Get comprehensive productivity statistics including daily/weekly completion breakdowns, goal streaks (current, last, max), karma score and trends, and historical karma data. Useful for productivity analysis and tracking goal progress.",
|
|
3927
|
-
parameters:
|
|
3928
|
-
outputSchema:
|
|
3934
|
+
parameters: dn,
|
|
3935
|
+
outputSchema: ln,
|
|
3929
3936
|
annotations: {
|
|
3930
3937
|
readOnlyHint: !0,
|
|
3931
3938
|
destructiveHint: !1,
|
|
@@ -3934,7 +3941,7 @@ const an = {
|
|
|
3934
3941
|
async execute(e, t) {
|
|
3935
3942
|
const r = await t.getProductivityStats();
|
|
3936
3943
|
return {
|
|
3937
|
-
textContent:
|
|
3944
|
+
textContent: pn(r),
|
|
3938
3945
|
structuredContent: {
|
|
3939
3946
|
completedCount: r.completedCount,
|
|
3940
3947
|
daysItems: r.daysItems,
|
|
@@ -3961,7 +3968,7 @@ const an = {
|
|
|
3961
3968
|
};
|
|
3962
3969
|
}
|
|
3963
3970
|
};
|
|
3964
|
-
function
|
|
3971
|
+
function pn(e) {
|
|
3965
3972
|
const t = [
|
|
3966
3973
|
"# Productivity Statistics",
|
|
3967
3974
|
"",
|
|
@@ -3991,11 +3998,11 @@ function un(e) {
|
|
|
3991
3998
|
return t.join(`
|
|
3992
3999
|
`);
|
|
3993
4000
|
}
|
|
3994
|
-
const
|
|
4001
|
+
const mn = {
|
|
3995
4002
|
projectId: s.string().min(1).describe("The ID of the project to get activity stats for."),
|
|
3996
4003
|
weeks: s.number().int().min(1).max(12).optional().describe("Number of weeks of activity data to retrieve (1-12, default 2)."),
|
|
3997
4004
|
includeWeeklyCounts: s.boolean().optional().describe("Include weekly rollup counts alongside daily counts.")
|
|
3998
|
-
},
|
|
4005
|
+
}, hn = {
|
|
3999
4006
|
projectId: s.string().describe("The project ID."),
|
|
4000
4007
|
dayItems: s.array(
|
|
4001
4008
|
s.object({
|
|
@@ -4011,7 +4018,7 @@ const pn = {
|
|
|
4011
4018
|
})
|
|
4012
4019
|
).nullable().describe("Weekly completion rollups. Only included when includeWeeklyCounts is true.")
|
|
4013
4020
|
};
|
|
4014
|
-
function
|
|
4021
|
+
function fn(e, t) {
|
|
4015
4022
|
const r = [`# Activity Stats: Project ${e}`, ""];
|
|
4016
4023
|
if (t.dayItems.length > 0) {
|
|
4017
4024
|
r.push("## Daily Activity");
|
|
@@ -4027,11 +4034,11 @@ function hn(e, t) {
|
|
|
4027
4034
|
return r.join(`
|
|
4028
4035
|
`);
|
|
4029
4036
|
}
|
|
4030
|
-
const
|
|
4037
|
+
const bn = {
|
|
4031
4038
|
name: f.GET_PROJECT_ACTIVITY_STATS,
|
|
4032
4039
|
description: "Get daily and optional weekly task completion counts for a project over a configurable time window (1-12 weeks). Useful for identifying completion trends and patterns.",
|
|
4033
|
-
parameters:
|
|
4034
|
-
outputSchema:
|
|
4040
|
+
parameters: mn,
|
|
4041
|
+
outputSchema: hn,
|
|
4035
4042
|
annotations: {
|
|
4036
4043
|
readOnlyHint: !0,
|
|
4037
4044
|
destructiveHint: !1,
|
|
@@ -4043,7 +4050,7 @@ const fn = {
|
|
|
4043
4050
|
includeWeeklyCounts: n
|
|
4044
4051
|
});
|
|
4045
4052
|
return {
|
|
4046
|
-
textContent:
|
|
4053
|
+
textContent: fn(r, a),
|
|
4047
4054
|
structuredContent: {
|
|
4048
4055
|
projectId: r,
|
|
4049
4056
|
dayItems: a.dayItems,
|
|
@@ -4051,15 +4058,15 @@ const fn = {
|
|
|
4051
4058
|
}
|
|
4052
4059
|
};
|
|
4053
4060
|
}
|
|
4054
|
-
},
|
|
4061
|
+
}, gn = {
|
|
4055
4062
|
projectId: s.string().min(1).describe("The ID of the project to check health for."),
|
|
4056
4063
|
includeContext: s.boolean().default(!1).describe(
|
|
4057
4064
|
"Include detailed health context with project metrics and task-level data. May produce large output for projects with many tasks."
|
|
4058
4065
|
)
|
|
4059
|
-
},
|
|
4066
|
+
}, yn = s.object({
|
|
4060
4067
|
taskId: s.string().describe("The ID of the task this recommendation is for."),
|
|
4061
4068
|
recommendation: s.string().describe("The recommendation for this task.")
|
|
4062
|
-
}),
|
|
4069
|
+
}), kn = s.object({
|
|
4063
4070
|
id: s.string().describe("The task ID."),
|
|
4064
4071
|
content: s.string().describe("The task content/title."),
|
|
4065
4072
|
priority: s.string().describe("The task priority (1-4)."),
|
|
@@ -4067,7 +4074,7 @@ const fn = {
|
|
|
4067
4074
|
deadline: s.string().nullable().optional().describe("The deadline date string, if set."),
|
|
4068
4075
|
isCompleted: s.boolean().describe("Whether the task is completed."),
|
|
4069
4076
|
labels: s.array(s.string()).describe("Labels applied to this task.")
|
|
4070
|
-
}),
|
|
4077
|
+
}), Tn = {
|
|
4071
4078
|
projectId: s.string().describe("The project ID."),
|
|
4072
4079
|
projectName: s.string().describe("The project name."),
|
|
4073
4080
|
progress: s.object({
|
|
@@ -4079,7 +4086,7 @@ const fn = {
|
|
|
4079
4086
|
status: s.enum(Re).describe("The overall health status of the project."),
|
|
4080
4087
|
description: s.string().nullable().optional().describe("Detailed description of the health assessment."),
|
|
4081
4088
|
descriptionSummary: s.string().nullable().optional().describe("Brief summary of the health assessment."),
|
|
4082
|
-
taskRecommendations: s.array(
|
|
4089
|
+
taskRecommendations: s.array(yn).nullable().optional().describe("Specific recommendations for individual tasks."),
|
|
4083
4090
|
isStale: s.boolean().describe("Whether the health data is stale and may need refreshing."),
|
|
4084
4091
|
updateInProgress: s.boolean().describe("Whether a health analysis update is currently in progress."),
|
|
4085
4092
|
updatedAt: s.string().nullable().optional().describe("When the health assessment was last updated.")
|
|
@@ -4094,12 +4101,12 @@ const fn = {
|
|
|
4094
4101
|
tasksCompletedThisWeek: s.number().describe("Tasks completed in the current week."),
|
|
4095
4102
|
averageCompletionTime: s.number().nullable().describe("Average task completion time in days, if available.")
|
|
4096
4103
|
}).describe("Aggregated project metrics."),
|
|
4097
|
-
tasks: s.array(
|
|
4104
|
+
tasks: s.array(kn).describe("Tasks in the project.")
|
|
4098
4105
|
}).optional().describe(
|
|
4099
4106
|
"Detailed project context with metrics and task data. Only included when includeContext is true."
|
|
4100
4107
|
)
|
|
4101
4108
|
};
|
|
4102
|
-
async function
|
|
4109
|
+
async function wn(e, t, r) {
|
|
4103
4110
|
if (r) {
|
|
4104
4111
|
const [a, i, c] = await Promise.all([
|
|
4105
4112
|
e.getProjectProgress(t),
|
|
@@ -4114,7 +4121,7 @@ async function Tn(e, t, r) {
|
|
|
4114
4121
|
]);
|
|
4115
4122
|
return { progress: o, health: n };
|
|
4116
4123
|
}
|
|
4117
|
-
function
|
|
4124
|
+
function In(e, { progress: t, health: r, context: o }) {
|
|
4118
4125
|
const n = [`# Project Health: ${e}`, ""];
|
|
4119
4126
|
if (n.push(`**Status:** ${r.status}`), r.isStale && n.push("**Note:** Health data is stale and may not reflect recent changes."), r.updateInProgress && n.push("**Note:** A health analysis update is currently in progress."), r.updatedAt && n.push(`**Last Updated:** ${r.updatedAt}`), n.push(""), n.push("## Progress"), n.push(
|
|
4120
4127
|
`**Completed:** ${t.completedCount} | **Active:** ${t.activeCount} | **Progress:** ${t.progressPercent}%`
|
|
@@ -4137,18 +4144,18 @@ function wn(e, { progress: t, health: r, context: o }) {
|
|
|
4137
4144
|
return n.join(`
|
|
4138
4145
|
`);
|
|
4139
4146
|
}
|
|
4140
|
-
const
|
|
4147
|
+
const vn = {
|
|
4141
4148
|
name: f.GET_PROJECT_HEALTH,
|
|
4142
4149
|
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.",
|
|
4143
|
-
parameters:
|
|
4144
|
-
outputSchema:
|
|
4150
|
+
parameters: gn,
|
|
4151
|
+
outputSchema: Tn,
|
|
4145
4152
|
annotations: {
|
|
4146
4153
|
readOnlyHint: !0,
|
|
4147
4154
|
destructiveHint: !1,
|
|
4148
4155
|
idempotentHint: !0
|
|
4149
4156
|
},
|
|
4150
4157
|
async execute(e, t) {
|
|
4151
|
-
const { projectId: r, includeContext: o } = e, n = await
|
|
4158
|
+
const { projectId: r, includeContext: o } = e, n = await wn(t, r, o), a = n.context?.projectName ?? `Project ${r}`, i = In(a, n), c = n.context ? {
|
|
4152
4159
|
projectDescription: n.context.projectDescription,
|
|
4153
4160
|
projectMetrics: n.context.projectMetrics,
|
|
4154
4161
|
tasks: n.context.tasks.map((d) => ({
|
|
@@ -4184,12 +4191,12 @@ const In = {
|
|
|
4184
4191
|
}
|
|
4185
4192
|
};
|
|
4186
4193
|
}
|
|
4187
|
-
},
|
|
4194
|
+
}, jn = {
|
|
4188
4195
|
workspaceIdOrName: s.string().min(1).describe(
|
|
4189
4196
|
"The workspace ID or name. Supports exact ID, exact name match (case-insensitive), or unique partial name match."
|
|
4190
4197
|
),
|
|
4191
4198
|
projectIds: s.array(s.string().min(1)).min(1).optional().describe("Optional list of project IDs to scope insights to specific projects.")
|
|
4192
|
-
},
|
|
4199
|
+
}, Sn = s.object({
|
|
4193
4200
|
projectId: s.string().describe("The project ID."),
|
|
4194
4201
|
health: s.object({
|
|
4195
4202
|
status: s.enum(Re).describe("The health status of the project."),
|
|
@@ -4201,23 +4208,23 @@ const In = {
|
|
|
4201
4208
|
activeCount: s.number().describe("Number of active tasks."),
|
|
4202
4209
|
progressPercent: s.number().describe("Completion percentage (0-100).")
|
|
4203
4210
|
}).nullable().describe("Progress data for this project, if available.")
|
|
4204
|
-
}),
|
|
4211
|
+
}), Cn = {
|
|
4205
4212
|
workspaceId: s.string().describe("The resolved workspace ID."),
|
|
4206
4213
|
workspaceName: s.string().describe("The resolved workspace name."),
|
|
4207
4214
|
folderId: s.string().nullable().describe("The folder ID, if applicable."),
|
|
4208
|
-
projectInsights: s.array(
|
|
4209
|
-
},
|
|
4215
|
+
projectInsights: s.array(Sn).describe("Health and progress insights for each project in the workspace.")
|
|
4216
|
+
}, $n = {
|
|
4210
4217
|
name: f.GET_WORKSPACE_INSIGHTS,
|
|
4211
4218
|
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.",
|
|
4212
|
-
parameters:
|
|
4213
|
-
outputSchema:
|
|
4219
|
+
parameters: jn,
|
|
4220
|
+
outputSchema: Cn,
|
|
4214
4221
|
annotations: {
|
|
4215
4222
|
readOnlyHint: !0,
|
|
4216
4223
|
destructiveHint: !1,
|
|
4217
4224
|
idempotentHint: !0
|
|
4218
4225
|
},
|
|
4219
4226
|
async execute(e, t) {
|
|
4220
|
-
const { workspaceIdOrName: r, projectIds: o } = e, n = await
|
|
4227
|
+
const { workspaceIdOrName: r, projectIds: o } = e, n = await kt.resolveWorkspace(t, r), a = await t.getWorkspaceInsights(n.workspaceId, { projectIds: o }), i = a.projectInsights.map((d) => ({
|
|
4221
4228
|
projectId: d.projectId,
|
|
4222
4229
|
health: d.health ? {
|
|
4223
4230
|
status: d.health.status,
|
|
@@ -4250,21 +4257,21 @@ const In = {
|
|
|
4250
4257
|
}
|
|
4251
4258
|
};
|
|
4252
4259
|
}
|
|
4253
|
-
},
|
|
4260
|
+
}, Dn = {}, xn = {
|
|
4254
4261
|
id: s.string().describe("The unique identifier for the workspace."),
|
|
4255
4262
|
name: s.string().describe("The name of the workspace."),
|
|
4256
|
-
plan: s.enum(
|
|
4263
|
+
plan: s.enum(Nt).describe("The workspace plan type."),
|
|
4257
4264
|
role: s.enum(_t).optional().describe("The user's role in the workspace, if available."),
|
|
4258
4265
|
isLinkSharingEnabled: s.boolean().describe("Whether link sharing is enabled for the workspace."),
|
|
4259
4266
|
isGuestAllowed: s.boolean().describe("Whether guests are allowed in the workspace."),
|
|
4260
4267
|
createdAt: s.string().optional().describe("The ISO 8601 timestamp when the workspace was created."),
|
|
4261
4268
|
creatorId: s.string().describe("The ID of the user who created the workspace.")
|
|
4262
|
-
},
|
|
4269
|
+
}, An = {
|
|
4263
4270
|
type: s.literal("workspaces").describe("The type of the response."),
|
|
4264
|
-
workspaces: s.array(s.object(
|
|
4271
|
+
workspaces: s.array(s.object(xn)).describe("List of workspaces."),
|
|
4265
4272
|
count: s.number().describe("The total number of workspaces.")
|
|
4266
4273
|
};
|
|
4267
|
-
async function
|
|
4274
|
+
async function En(e) {
|
|
4268
4275
|
const r = (await e.getWorkspaces()).map((i) => ({
|
|
4269
4276
|
id: i.id,
|
|
4270
4277
|
name: i.name,
|
|
@@ -4295,20 +4302,20 @@ async function An(e) {
|
|
|
4295
4302
|
};
|
|
4296
4303
|
return { textContent: n, structuredContent: a };
|
|
4297
4304
|
}
|
|
4298
|
-
const
|
|
4305
|
+
const On = {
|
|
4299
4306
|
name: f.LIST_WORKSPACES,
|
|
4300
4307
|
description: "Get all workspaces for the authenticated user. Returns workspace details including ID, name, plan type (STARTER/BUSINESS), user role (ADMIN/MEMBER/GUEST), link sharing settings, guest permissions, creation date, and creator ID.",
|
|
4301
|
-
parameters:
|
|
4302
|
-
outputSchema:
|
|
4308
|
+
parameters: Dn,
|
|
4309
|
+
outputSchema: An,
|
|
4303
4310
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4304
4311
|
async execute(e, t) {
|
|
4305
|
-
const r = await
|
|
4312
|
+
const r = await En(t);
|
|
4306
4313
|
return {
|
|
4307
4314
|
textContent: r.textContent,
|
|
4308
4315
|
structuredContent: r.structuredContent
|
|
4309
4316
|
};
|
|
4310
4317
|
}
|
|
4311
|
-
}, { FIND_TASKS:
|
|
4318
|
+
}, { FIND_TASKS: Pn, FIND_PROJECT_COLLABORATORS: at, UPDATE_TASKS: Un } = f, Rn = 50, _n = {
|
|
4312
4319
|
operation: s.enum(["assign", "unassign", "reassign"]).describe("The assignment operation to perform."),
|
|
4313
4320
|
taskIds: s.array(s.string()).min(1).max(Rn).describe("The IDs of the tasks to operate on (max 50)."),
|
|
4314
4321
|
responsibleUser: s.string().optional().describe(
|
|
@@ -4318,7 +4325,7 @@ const En = {
|
|
|
4318
4325
|
"For reassign operations: the current assignee to reassign from. Can be user ID, name, or email. Optional - if not provided, reassigns from any current assignee."
|
|
4319
4326
|
),
|
|
4320
4327
|
dryRun: s.boolean().optional().default(!1).describe("If true, validates operations without executing them.")
|
|
4321
|
-
},
|
|
4328
|
+
}, Nn = {
|
|
4322
4329
|
results: s.array(
|
|
4323
4330
|
s.object({
|
|
4324
4331
|
taskId: s.string().describe("The ID of the task."),
|
|
@@ -4334,11 +4341,11 @@ const En = {
|
|
|
4334
4341
|
failed: s.number().describe("Number of failed operations."),
|
|
4335
4342
|
dryRun: s.boolean().describe("Whether this was a dry run.")
|
|
4336
4343
|
}).optional().describe("Summary of the operation.")
|
|
4337
|
-
},
|
|
4344
|
+
}, Ln = {
|
|
4338
4345
|
name: f.MANAGE_ASSIGNMENTS,
|
|
4339
4346
|
description: "Bulk assignment operations for multiple tasks. Supports assign, unassign, and reassign operations with atomic rollback on failures.",
|
|
4340
4347
|
parameters: _n,
|
|
4341
|
-
outputSchema:
|
|
4348
|
+
outputSchema: Nn,
|
|
4342
4349
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
4343
4350
|
async execute(e, t) {
|
|
4344
4351
|
const { operation: r, taskIds: o, responsibleUser: n, fromAssigneeUser: a, dryRun: i } = e;
|
|
@@ -4388,7 +4395,7 @@ const En = {
|
|
|
4388
4395
|
newAssigneeId: void 0
|
|
4389
4396
|
}));
|
|
4390
4397
|
return {
|
|
4391
|
-
textContent:
|
|
4398
|
+
textContent: Ce({
|
|
4392
4399
|
operation: r,
|
|
4393
4400
|
results: w,
|
|
4394
4401
|
dryRun: !0
|
|
@@ -4425,7 +4432,7 @@ const En = {
|
|
|
4425
4432
|
throw new Error(`All ${S.length} unassign operation(s) failed: ${w}`);
|
|
4426
4433
|
}
|
|
4427
4434
|
return {
|
|
4428
|
-
textContent:
|
|
4435
|
+
textContent: Ce({
|
|
4429
4436
|
operation: r,
|
|
4430
4437
|
results: S,
|
|
4431
4438
|
dryRun: !1
|
|
@@ -4440,7 +4447,7 @@ const En = {
|
|
|
4440
4447
|
}
|
|
4441
4448
|
};
|
|
4442
4449
|
}
|
|
4443
|
-
const m = await
|
|
4450
|
+
const m = await ze.validateBulkAssignment(
|
|
4444
4451
|
t,
|
|
4445
4452
|
p
|
|
4446
4453
|
), h = [], g = [];
|
|
@@ -4470,7 +4477,7 @@ const En = {
|
|
|
4470
4477
|
newAssigneeId: j.resolvedUser.userId
|
|
4471
4478
|
};
|
|
4472
4479
|
});
|
|
4473
|
-
const
|
|
4480
|
+
const R = S.map(
|
|
4474
4481
|
async ({ assignment: w, validation: j }) => {
|
|
4475
4482
|
const v = d.find((x) => x.id === w.taskId);
|
|
4476
4483
|
if (!w.taskId || !j.resolvedUser?.userId)
|
|
@@ -4499,7 +4506,7 @@ const En = {
|
|
|
4499
4506
|
}
|
|
4500
4507
|
}
|
|
4501
4508
|
);
|
|
4502
|
-
return Promise.all(
|
|
4509
|
+
return Promise.all(R);
|
|
4503
4510
|
}
|
|
4504
4511
|
const D = await I(h, !i), $ = [...D, ...g, ...l];
|
|
4505
4512
|
if ($.length > 0 && $.every((T) => !T.success)) {
|
|
@@ -4507,7 +4514,7 @@ const En = {
|
|
|
4507
4514
|
throw new Error(`All ${$.length} ${r} operation(s) failed: ${T}`);
|
|
4508
4515
|
}
|
|
4509
4516
|
return {
|
|
4510
|
-
textContent:
|
|
4517
|
+
textContent: Ce({
|
|
4511
4518
|
operation: r,
|
|
4512
4519
|
results: $,
|
|
4513
4520
|
dryRun: i
|
|
@@ -4523,7 +4530,7 @@ const En = {
|
|
|
4523
4530
|
};
|
|
4524
4531
|
}
|
|
4525
4532
|
};
|
|
4526
|
-
function
|
|
4533
|
+
function Ce({
|
|
4527
4534
|
operation: e,
|
|
4528
4535
|
results: t,
|
|
4529
4536
|
dryRun: r
|
|
@@ -4561,30 +4568,30 @@ function Se({
|
|
|
4561
4568
|
`;
|
|
4562
4569
|
}
|
|
4563
4570
|
return !r && o.length > 0 ? (c += `**Next steps:**
|
|
4564
|
-
`, c += `• Use ${
|
|
4565
|
-
`, c += `• Use ${
|
|
4566
|
-
`, n.length > 0 && (c += `• Check failed tasks and use ${
|
|
4571
|
+
`, c += `• Use ${Pn} with responsibleUser to see ${e === "unassign" ? "unassigned" : "newly assigned"} tasks
|
|
4572
|
+
`, c += `• Use ${Un} for individual assignment changes
|
|
4573
|
+
`, n.length > 0 && (c += `• Check failed tasks and use ${at} to verify collaborator access
|
|
4567
4574
|
`)) : r ? (c += `**To execute:**
|
|
4568
4575
|
`, c += `• Remove dryRun parameter and run again to execute changes
|
|
4569
4576
|
`, o.length > 0 && (c += `• ${o.length} task${o.length === 1 ? "" : "s"} ready for ${e} operation
|
|
4570
4577
|
`), n.length > 0 && (c += `• Fix ${n.length} validation error${n.length === 1 ? "" : "s"} before executing
|
|
4571
4578
|
`)) : o.length === 0 && (c += `**Suggestions:**
|
|
4572
|
-
`, c += `• Use ${
|
|
4579
|
+
`, c += `• Use ${at} to find valid assignees
|
|
4573
4580
|
`, c += `• Check task IDs and assignee permissions
|
|
4574
4581
|
`, c += `• Use dryRun=true to validate before executing
|
|
4575
4582
|
`), c;
|
|
4576
4583
|
}
|
|
4577
|
-
const
|
|
4584
|
+
const Mn = {
|
|
4578
4585
|
action: s.enum(["archive", "unarchive"]).describe("The action to perform on the project."),
|
|
4579
4586
|
projectId: s.string().min(1).describe("The ID of the project.")
|
|
4580
|
-
},
|
|
4587
|
+
}, Fn = {
|
|
4581
4588
|
project: ae.describe("The updated project."),
|
|
4582
4589
|
success: s.boolean().describe("Whether the action was successful.")
|
|
4583
|
-
},
|
|
4590
|
+
}, Hn = {
|
|
4584
4591
|
name: f.PROJECT_MANAGEMENT,
|
|
4585
4592
|
description: "Archive or unarchive a project by its ID.",
|
|
4586
|
-
parameters:
|
|
4587
|
-
outputSchema:
|
|
4593
|
+
parameters: Mn,
|
|
4594
|
+
outputSchema: Fn,
|
|
4588
4595
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
|
|
4589
4596
|
async execute(e, t) {
|
|
4590
4597
|
const r = e.action === "archive" ? await t.archiveProject(e.projectId) : await t.unarchiveProject(e.projectId), o = q(r);
|
|
@@ -4596,7 +4603,7 @@ const Ln = {
|
|
|
4596
4603
|
}
|
|
4597
4604
|
};
|
|
4598
4605
|
}
|
|
4599
|
-
},
|
|
4606
|
+
}, Wn = {
|
|
4600
4607
|
action: s.enum(["move-to-workspace", "move-to-personal"]).describe("The action to perform on the project."),
|
|
4601
4608
|
projectId: s.string().min(1).describe("The ID of the project to move."),
|
|
4602
4609
|
workspaceId: s.string().min(1).optional().describe("The target workspace ID. Required when action is move-to-workspace."),
|
|
@@ -4604,14 +4611,14 @@ const Ln = {
|
|
|
4604
4611
|
visibility: s.enum(["restricted", "team", "public"]).optional().describe(
|
|
4605
4612
|
"Optional access visibility for the project in the workspace (restricted, team, or public)."
|
|
4606
4613
|
)
|
|
4607
|
-
},
|
|
4614
|
+
}, Bn = {
|
|
4608
4615
|
project: ae.describe("The moved project."),
|
|
4609
4616
|
success: s.boolean().describe("Whether the move was successful.")
|
|
4610
|
-
},
|
|
4617
|
+
}, zn = {
|
|
4611
4618
|
name: f.PROJECT_MOVE,
|
|
4612
4619
|
description: "Move a project between personal and workspace contexts.",
|
|
4613
|
-
parameters:
|
|
4614
|
-
outputSchema:
|
|
4620
|
+
parameters: Wn,
|
|
4621
|
+
outputSchema: Bn,
|
|
4615
4622
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
|
|
4616
4623
|
async execute(e, t) {
|
|
4617
4624
|
let r;
|
|
@@ -4634,8 +4641,8 @@ const Ln = {
|
|
|
4634
4641
|
}
|
|
4635
4642
|
};
|
|
4636
4643
|
}
|
|
4637
|
-
},
|
|
4638
|
-
type: s.enum(
|
|
4644
|
+
}, Ot = ["project", "section"], Yn = {
|
|
4645
|
+
type: s.enum(Ot).describe(
|
|
4639
4646
|
'The type of entity to reorder. "project" reorders sibling projects within the same parent (and can move projects to a new parent). "section" reorders sections within the same project.'
|
|
4640
4647
|
),
|
|
4641
4648
|
items: s.array(
|
|
@@ -4651,17 +4658,17 @@ const Ln = {
|
|
|
4651
4658
|
).min(1).describe(
|
|
4652
4659
|
"The items to reorder or move. Each item must have at least order or parentId. Items with parentId will be moved first, then items with order will be reordered. All items being reordered should be siblings for predictable results."
|
|
4653
4660
|
)
|
|
4654
|
-
},
|
|
4655
|
-
type: s.enum(
|
|
4661
|
+
}, Gn = {
|
|
4662
|
+
type: s.enum(Ot).describe("The type of entity that was reordered/moved."),
|
|
4656
4663
|
movedCount: s.number().describe("The number of entities moved to a new parent."),
|
|
4657
4664
|
reorderedCount: s.number().describe("The number of entities reordered."),
|
|
4658
4665
|
affectedIds: s.array(s.string()).describe("The IDs of all affected entities."),
|
|
4659
4666
|
success: s.boolean().describe("Whether the operation was successful.")
|
|
4660
|
-
},
|
|
4667
|
+
}, qn = {
|
|
4661
4668
|
name: f.REORDER_OBJECTS,
|
|
4662
4669
|
description: 'Reorder sibling projects or sections, and optionally move projects to a new parent. For projects: set order to reorder siblings, and/or set parentId to move under a new parent (use "root" for top level). For sections: set order to reorder within a project.',
|
|
4663
|
-
parameters:
|
|
4664
|
-
outputSchema:
|
|
4670
|
+
parameters: Yn,
|
|
4671
|
+
outputSchema: Gn,
|
|
4665
4672
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
|
|
4666
4673
|
async execute(e, t) {
|
|
4667
4674
|
const { type: r, items: o } = e, n = /* @__PURE__ */ new Set();
|
|
@@ -4723,22 +4730,22 @@ const Ln = {
|
|
|
4723
4730
|
}
|
|
4724
4731
|
};
|
|
4725
4732
|
}
|
|
4726
|
-
},
|
|
4733
|
+
}, Kn = s.object({
|
|
4727
4734
|
id: s.string().min(1).describe("The ID of the task to reschedule."),
|
|
4728
4735
|
date: s.string().min(1).describe(
|
|
4729
4736
|
"The new date for the task. Use YYYY-MM-DD for date-only, or YYYY-MM-DDTHH:MM:SS for datetime. If date-only is provided and the task already has a specific time, the existing time is preserved."
|
|
4730
4737
|
)
|
|
4731
|
-
}),
|
|
4732
|
-
tasks: s.array(
|
|
4733
|
-
},
|
|
4738
|
+
}), Vn = {
|
|
4739
|
+
tasks: s.array(Kn).min(1).describe("The tasks to reschedule with their new dates.")
|
|
4740
|
+
}, Jn = {
|
|
4734
4741
|
tasks: s.array(K).describe("The rescheduled tasks."),
|
|
4735
4742
|
totalCount: s.number().describe("The total number of tasks rescheduled."),
|
|
4736
4743
|
rescheduledTaskIds: s.array(s.string()).describe("The IDs of the rescheduled tasks.")
|
|
4737
|
-
},
|
|
4744
|
+
}, Xn = {
|
|
4738
4745
|
name: f.RESCHEDULE_TASKS,
|
|
4739
4746
|
description: "Reschedule tasks to new dates while preserving recurring schedules. Unlike update-tasks (which replaces the entire due string and can wipe recurrence), this tool changes only the date, keeping recurrence patterns intact. Use this when moving recurring tasks to a different date without altering their repeat pattern.",
|
|
4740
|
-
parameters:
|
|
4741
|
-
outputSchema:
|
|
4747
|
+
parameters: Vn,
|
|
4748
|
+
outputSchema: Jn,
|
|
4742
4749
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
4743
4750
|
async execute(e, t) {
|
|
4744
4751
|
const { tasks: r } = e, n = (await Promise.all(
|
|
@@ -4751,7 +4758,7 @@ const Ln = {
|
|
|
4751
4758
|
throw new Error(
|
|
4752
4759
|
`Task "${l.content}" (${l.id}) has no due date. Rescheduling requires an existing due date.`
|
|
4753
4760
|
);
|
|
4754
|
-
const u =
|
|
4761
|
+
const u = Zn(d.date, l.due);
|
|
4755
4762
|
return z("item_update", {
|
|
4756
4763
|
id: d.id,
|
|
4757
4764
|
due: {
|
|
@@ -4769,9 +4776,9 @@ const Ln = {
|
|
|
4769
4776
|
const l = d instanceof Error ? d.message : String(d);
|
|
4770
4777
|
throw new Error(`Reschedule failed: ${l}`);
|
|
4771
4778
|
}
|
|
4772
|
-
const a = await Promise.all(r.map((d) => t.getTask(d.id))), i = a.map(
|
|
4779
|
+
const a = await Promise.all(r.map((d) => t.getTask(d.id))), i = a.map(U);
|
|
4773
4780
|
return {
|
|
4774
|
-
textContent:
|
|
4781
|
+
textContent: Ye("Rescheduled", i, {
|
|
4775
4782
|
showDetails: i.length <= 5
|
|
4776
4783
|
}),
|
|
4777
4784
|
structuredContent: {
|
|
@@ -4782,16 +4789,16 @@ const Ln = {
|
|
|
4782
4789
|
};
|
|
4783
4790
|
}
|
|
4784
4791
|
};
|
|
4785
|
-
function
|
|
4792
|
+
function Zn(e, t) {
|
|
4786
4793
|
if (/^\d{4}-\d{2}-\d{2}$/.test(e) && t.datetime) {
|
|
4787
4794
|
const o = t.datetime.substring(10);
|
|
4788
4795
|
return e + o;
|
|
4789
4796
|
}
|
|
4790
4797
|
return e;
|
|
4791
4798
|
}
|
|
4792
|
-
const
|
|
4799
|
+
const Qn = {
|
|
4793
4800
|
query: s.string().min(1).describe("The search query string to find tasks and projects.")
|
|
4794
|
-
},
|
|
4801
|
+
}, ea = {
|
|
4795
4802
|
results: s.array(
|
|
4796
4803
|
s.object({
|
|
4797
4804
|
id: s.string().describe("The ID of the result."),
|
|
@@ -4800,52 +4807,52 @@ const Zn = {
|
|
|
4800
4807
|
})
|
|
4801
4808
|
).describe("The search results."),
|
|
4802
4809
|
totalCount: s.number().describe("Total number of results found.")
|
|
4803
|
-
},
|
|
4810
|
+
}, ta = {
|
|
4804
4811
|
name: f.SEARCH,
|
|
4805
4812
|
description: "Search across tasks and projects in Todoist. Returns a list of relevant results with IDs, titles, and URLs.",
|
|
4806
|
-
parameters:
|
|
4807
|
-
outputSchema:
|
|
4813
|
+
parameters: Qn,
|
|
4814
|
+
outputSchema: ea,
|
|
4808
4815
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4809
4816
|
async execute(e, t) {
|
|
4810
4817
|
const { query: r } = e, [o, n] = await Promise.all([
|
|
4811
|
-
|
|
4818
|
+
Fe({
|
|
4812
4819
|
client: t,
|
|
4813
4820
|
query: `search: ${r}`,
|
|
4814
4821
|
limit: C.TASKS_MAX,
|
|
4815
4822
|
cursor: void 0
|
|
4816
4823
|
}),
|
|
4817
|
-
|
|
4824
|
+
gt(t, r)
|
|
4818
4825
|
]), a = [];
|
|
4819
4826
|
for (const i of o.tasks)
|
|
4820
4827
|
a.push({
|
|
4821
4828
|
id: `task:${i.id}`,
|
|
4822
4829
|
title: i.content,
|
|
4823
|
-
url:
|
|
4830
|
+
url: lt(i.id)
|
|
4824
4831
|
});
|
|
4825
4832
|
for (const i of n)
|
|
4826
4833
|
a.push({
|
|
4827
4834
|
id: `project:${i.id}`,
|
|
4828
4835
|
title: i.name,
|
|
4829
|
-
url:
|
|
4836
|
+
url: ut(i.id)
|
|
4830
4837
|
});
|
|
4831
4838
|
return {
|
|
4832
4839
|
textContent: JSON.stringify({ results: a }),
|
|
4833
4840
|
structuredContent: { results: a, totalCount: a.length }
|
|
4834
4841
|
};
|
|
4835
4842
|
}
|
|
4836
|
-
}, ta = {
|
|
4837
|
-
ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to uncomplete.")
|
|
4838
4843
|
}, sa = {
|
|
4844
|
+
ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to uncomplete.")
|
|
4845
|
+
}, ra = {
|
|
4839
4846
|
uncompleted: s.array(s.string()).describe("The IDs of successfully uncompleted tasks."),
|
|
4840
|
-
failures: s.array(
|
|
4847
|
+
failures: s.array(We).describe("Failed task uncompletion with error details."),
|
|
4841
4848
|
totalRequested: s.number().describe("The total number of tasks requested to uncomplete."),
|
|
4842
4849
|
successCount: s.number().describe("The number of successfully uncompleted tasks."),
|
|
4843
4850
|
failureCount: s.number().describe("The number of failed task uncompletions.")
|
|
4844
|
-
},
|
|
4851
|
+
}, oa = {
|
|
4845
4852
|
name: f.UNCOMPLETE_TASKS,
|
|
4846
4853
|
description: "Uncomplete (reopen) one or more completed tasks by their IDs.",
|
|
4847
|
-
parameters:
|
|
4848
|
-
outputSchema:
|
|
4854
|
+
parameters: sa,
|
|
4855
|
+
outputSchema: ra,
|
|
4849
4856
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
4850
4857
|
async execute(e, t) {
|
|
4851
4858
|
const r = [], o = [];
|
|
@@ -4860,7 +4867,7 @@ const Zn = {
|
|
|
4860
4867
|
});
|
|
4861
4868
|
}
|
|
4862
4869
|
return {
|
|
4863
|
-
textContent:
|
|
4870
|
+
textContent: na({
|
|
4864
4871
|
uncompleted: r,
|
|
4865
4872
|
failures: o,
|
|
4866
4873
|
args: e
|
|
@@ -4875,12 +4882,12 @@ const Zn = {
|
|
|
4875
4882
|
};
|
|
4876
4883
|
}
|
|
4877
4884
|
};
|
|
4878
|
-
function
|
|
4885
|
+
function na({
|
|
4879
4886
|
uncompleted: e,
|
|
4880
4887
|
failures: t,
|
|
4881
4888
|
args: r
|
|
4882
4889
|
}) {
|
|
4883
|
-
return
|
|
4890
|
+
return Ge({
|
|
4884
4891
|
action: "Uncompleted tasks",
|
|
4885
4892
|
success: e.length,
|
|
4886
4893
|
total: r.ids.length,
|
|
@@ -4889,28 +4896,28 @@ function oa({
|
|
|
4889
4896
|
failures: t
|
|
4890
4897
|
});
|
|
4891
4898
|
}
|
|
4892
|
-
const
|
|
4899
|
+
const aa = s.object({
|
|
4893
4900
|
id: s.string().min(1).describe("The ID of the comment to update."),
|
|
4894
4901
|
content: s.string().min(1).describe("The new content for the comment.")
|
|
4895
|
-
}),
|
|
4896
|
-
comments: s.array(
|
|
4897
|
-
},
|
|
4902
|
+
}), ia = {
|
|
4903
|
+
comments: s.array(aa).min(1).describe("The comments to update.")
|
|
4904
|
+
}, ca = {
|
|
4898
4905
|
comments: s.array(fe).describe("The updated comments."),
|
|
4899
4906
|
totalCount: s.number().describe("The total number of comments updated."),
|
|
4900
4907
|
updatedCommentIds: s.array(s.string()).describe("The IDs of the updated comments."),
|
|
4901
4908
|
appliedOperations: s.object({
|
|
4902
4909
|
updateCount: s.number().describe("The number of comments updated.")
|
|
4903
4910
|
}).describe("Summary of operations performed.")
|
|
4904
|
-
},
|
|
4911
|
+
}, da = {
|
|
4905
4912
|
name: f.UPDATE_COMMENTS,
|
|
4906
4913
|
description: "Update multiple existing comments with new content.",
|
|
4907
|
-
parameters:
|
|
4908
|
-
outputSchema:
|
|
4914
|
+
parameters: ia,
|
|
4915
|
+
outputSchema: ca,
|
|
4909
4916
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
4910
4917
|
async execute(e, t) {
|
|
4911
4918
|
const { comments: r } = e, o = r.map(async (c) => await t.updateComment(c.id, { content: c.content })), a = (await Promise.all(o)).map(pe);
|
|
4912
4919
|
return {
|
|
4913
|
-
textContent:
|
|
4920
|
+
textContent: la({
|
|
4914
4921
|
comments: a
|
|
4915
4922
|
}),
|
|
4916
4923
|
structuredContent: {
|
|
@@ -4924,7 +4931,7 @@ const na = s.object({
|
|
|
4924
4931
|
};
|
|
4925
4932
|
}
|
|
4926
4933
|
};
|
|
4927
|
-
function
|
|
4934
|
+
function la({ comments: e }) {
|
|
4928
4935
|
const t = e.filter((a) => a.taskId).length, r = e.filter((a) => a.projectId).length, o = [];
|
|
4929
4936
|
if (t > 0) {
|
|
4930
4937
|
const a = t > 1 ? "comments" : "comment";
|
|
@@ -4936,7 +4943,7 @@ function da({ comments: e }) {
|
|
|
4936
4943
|
}
|
|
4937
4944
|
return o.length > 0 ? `Updated ${o.join(" and ")}` : "No comments updated";
|
|
4938
4945
|
}
|
|
4939
|
-
const
|
|
4946
|
+
const ua = s.object({
|
|
4940
4947
|
id: s.string().min(1).describe("The ID of the filter to update."),
|
|
4941
4948
|
name: s.string().min(1).optional().describe("The new name of the filter."),
|
|
4942
4949
|
query: s.string().min(1).optional().describe(
|
|
@@ -4944,25 +4951,25 @@ const la = s.object({
|
|
|
4944
4951
|
),
|
|
4945
4952
|
color: le,
|
|
4946
4953
|
isFavorite: s.boolean().optional().describe("Whether to mark the filter as a favorite.")
|
|
4947
|
-
}),
|
|
4948
|
-
filters: s.array(
|
|
4949
|
-
},
|
|
4950
|
-
filters: s.array(
|
|
4954
|
+
}), pa = {
|
|
4955
|
+
filters: s.array(ua).min(1).describe("The filters to update.")
|
|
4956
|
+
}, ma = {
|
|
4957
|
+
filters: s.array(Be).describe("The updated filters."),
|
|
4951
4958
|
totalCount: s.number().describe("The total number of filters updated."),
|
|
4952
4959
|
updatedFilterIds: s.array(s.string()).describe("The IDs of the updated filters."),
|
|
4953
4960
|
appliedOperations: s.object({
|
|
4954
4961
|
updateCount: s.number().describe("The number of filters actually updated."),
|
|
4955
4962
|
skippedCount: s.number().describe("The number of filters skipped (no changes).")
|
|
4956
4963
|
}).describe("Summary of operations performed.")
|
|
4957
|
-
},
|
|
4964
|
+
}, ha = {
|
|
4958
4965
|
name: f.UPDATE_FILTERS,
|
|
4959
4966
|
description: "Update one or more existing personal filters with new values.",
|
|
4960
|
-
parameters:
|
|
4961
|
-
outputSchema:
|
|
4967
|
+
parameters: pa,
|
|
4968
|
+
outputSchema: ma,
|
|
4962
4969
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
4963
4970
|
async execute(e, t) {
|
|
4964
4971
|
const { filters: r } = e, o = [], a = r.map((m) => {
|
|
4965
|
-
const h =
|
|
4972
|
+
const h = ba(m);
|
|
4966
4973
|
return h !== null ? { kind: "skipped", reason: h } : (o.push(m), { kind: "updated", filter: m });
|
|
4967
4974
|
}).filter((m) => m.kind === "skipped").length;
|
|
4968
4975
|
if (o.length === 0)
|
|
@@ -4993,7 +5000,7 @@ const la = s.object({
|
|
|
4993
5000
|
itemOrder: m.itemOrder
|
|
4994
5001
|
}));
|
|
4995
5002
|
return {
|
|
4996
|
-
textContent:
|
|
5003
|
+
textContent: fa({ filters: u, skippedCount: a }),
|
|
4997
5004
|
structuredContent: {
|
|
4998
5005
|
filters: u,
|
|
4999
5006
|
totalCount: u.length,
|
|
@@ -5006,7 +5013,7 @@ const la = s.object({
|
|
|
5006
5013
|
};
|
|
5007
5014
|
}
|
|
5008
5015
|
};
|
|
5009
|
-
function
|
|
5016
|
+
function fa({
|
|
5010
5017
|
filters: e,
|
|
5011
5018
|
skippedCount: t
|
|
5012
5019
|
}) {
|
|
@@ -5020,19 +5027,19 @@ ${n}`;
|
|
|
5020
5027
|
}
|
|
5021
5028
|
return o;
|
|
5022
5029
|
}
|
|
5023
|
-
function
|
|
5030
|
+
function ba({ id: e, ...t }) {
|
|
5024
5031
|
const r = Object.values(t);
|
|
5025
5032
|
return r.length === 0 || r.every((o) => o === void 0) ? "no-fields" : null;
|
|
5026
5033
|
}
|
|
5027
|
-
const
|
|
5034
|
+
const ga = s.object({
|
|
5028
5035
|
id: s.string().min(1).describe("The ID of the project to update."),
|
|
5029
5036
|
name: s.string().min(1).optional().describe("The new name of the project."),
|
|
5030
5037
|
isFavorite: s.boolean().optional().describe("Whether the project is a favorite."),
|
|
5031
5038
|
viewStyle: s.enum(["list", "board", "calendar"]).optional().describe("The project view style."),
|
|
5032
5039
|
color: le
|
|
5033
|
-
}),
|
|
5034
|
-
projects: s.array(
|
|
5035
|
-
},
|
|
5040
|
+
}), ya = {
|
|
5041
|
+
projects: s.array(ga).min(1).describe("The projects to update.")
|
|
5042
|
+
}, ka = {
|
|
5036
5043
|
projects: s.array(ae).describe("The updated projects."),
|
|
5037
5044
|
totalCount: s.number().describe("The total number of projects updated."),
|
|
5038
5045
|
updatedProjectIds: s.array(s.string()).describe("The IDs of the updated projects."),
|
|
@@ -5040,16 +5047,16 @@ const ba = s.object({
|
|
|
5040
5047
|
updateCount: s.number().describe("The number of projects actually updated."),
|
|
5041
5048
|
skippedCount: s.number().describe("The number of projects skipped (no changes).")
|
|
5042
5049
|
}).describe("Summary of operations performed.")
|
|
5043
|
-
},
|
|
5050
|
+
}, Ta = {
|
|
5044
5051
|
name: f.UPDATE_PROJECTS,
|
|
5045
5052
|
description: "Update multiple existing projects with new values.",
|
|
5046
|
-
parameters:
|
|
5047
|
-
outputSchema:
|
|
5053
|
+
parameters: ya,
|
|
5054
|
+
outputSchema: ka,
|
|
5048
5055
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5049
5056
|
async execute(e, t) {
|
|
5050
5057
|
const { projects: r } = e, o = await Promise.all(
|
|
5051
5058
|
r.map(async (d) => {
|
|
5052
|
-
const l =
|
|
5059
|
+
const l = Ia(d);
|
|
5053
5060
|
if (l !== null) return { kind: "skipped", reason: l };
|
|
5054
5061
|
const { id: u, ...p } = d;
|
|
5055
5062
|
return { kind: "updated", project: await t.updateProject(u, p) };
|
|
@@ -5062,7 +5069,7 @@ const ba = s.object({
|
|
|
5062
5069
|
(d) => d.kind === "skipped" && d.reason === "no-valid-values"
|
|
5063
5070
|
).length;
|
|
5064
5071
|
return {
|
|
5065
|
-
textContent:
|
|
5072
|
+
textContent: wa({
|
|
5066
5073
|
projects: n,
|
|
5067
5074
|
skippedNoFields: a,
|
|
5068
5075
|
skippedNoValidValues: i
|
|
@@ -5079,7 +5086,7 @@ const ba = s.object({
|
|
|
5079
5086
|
};
|
|
5080
5087
|
}
|
|
5081
5088
|
};
|
|
5082
|
-
function
|
|
5089
|
+
function wa({
|
|
5083
5090
|
projects: e,
|
|
5084
5091
|
skippedNoFields: t,
|
|
5085
5092
|
skippedNoValidValues: r
|
|
@@ -5091,47 +5098,49 @@ function Ta({
|
|
|
5091
5098
|
return t > 0 && i.push(`${t} skipped - no changes`), r > 0 && i.push(`${r} skipped - no valid field values`), i.length > 0 && (a += ` (${i.join(", ")})`), o > 0 && (a += `:
|
|
5092
5099
|
${n}`), a;
|
|
5093
5100
|
}
|
|
5094
|
-
function
|
|
5101
|
+
function Ia({ id: e, ...t }) {
|
|
5095
5102
|
const r = Object.values(t);
|
|
5096
5103
|
return r.length === 0 ? "no-fields" : r.every((o) => o === void 0) ? "no-valid-values" : null;
|
|
5097
5104
|
}
|
|
5098
|
-
const
|
|
5105
|
+
const va = s.object({
|
|
5099
5106
|
type: s.literal("relative"),
|
|
5100
5107
|
id: s.string().min(1).describe("The ID of the relative reminder to update."),
|
|
5101
5108
|
minuteOffset: s.number().int().min(0).optional().describe("New minute offset before task due time."),
|
|
5102
|
-
service: ge.optional().describe('New delivery method: "email" or "push".')
|
|
5103
|
-
|
|
5109
|
+
service: ge.optional().describe('New delivery method: "email" or "push".'),
|
|
5110
|
+
isUrgent: ye
|
|
5111
|
+
}), ja = s.object({
|
|
5104
5112
|
type: s.literal("absolute"),
|
|
5105
5113
|
id: s.string().min(1).describe("The ID of the absolute reminder to update."),
|
|
5106
|
-
due:
|
|
5107
|
-
service: ge.optional().describe('New delivery method: "email" or "push".')
|
|
5108
|
-
|
|
5114
|
+
due: Tt.optional().describe("New due date/time for the reminder."),
|
|
5115
|
+
service: ge.optional().describe('New delivery method: "email" or "push".'),
|
|
5116
|
+
isUrgent: ye
|
|
5117
|
+
}), Sa = s.object({
|
|
5109
5118
|
type: s.literal("location"),
|
|
5110
5119
|
id: s.string().min(1).describe("The ID of the location reminder to update."),
|
|
5111
5120
|
name: s.string().optional().describe("New location name."),
|
|
5112
5121
|
locLat: s.string().optional().describe("New latitude."),
|
|
5113
5122
|
locLong: s.string().optional().describe("New longitude."),
|
|
5114
|
-
locTrigger:
|
|
5123
|
+
locTrigger: wt.optional().describe(
|
|
5115
5124
|
'New trigger condition: "on_enter" or "on_leave".'
|
|
5116
5125
|
),
|
|
5117
5126
|
radius: s.number().int().optional().describe("New radius in meters.")
|
|
5118
|
-
}),
|
|
5119
|
-
Ia,
|
|
5127
|
+
}), Ca = s.discriminatedUnion("type", [
|
|
5120
5128
|
va,
|
|
5121
|
-
ja
|
|
5122
|
-
|
|
5123
|
-
|
|
5129
|
+
ja,
|
|
5130
|
+
Sa
|
|
5131
|
+
]), $a = {
|
|
5132
|
+
reminders: s.array(Ca).min(1).max(ue).describe(
|
|
5124
5133
|
`Array of reminders to update (max ${ue}). Each must include the reminder type and ID. Only include fields that need to change.`
|
|
5125
5134
|
)
|
|
5126
|
-
},
|
|
5127
|
-
reminders: s.array(
|
|
5135
|
+
}, Da = {
|
|
5136
|
+
reminders: s.array(He).describe("The updated reminders."),
|
|
5128
5137
|
totalCount: s.number().describe("Total reminders updated."),
|
|
5129
5138
|
updatedReminderIds: s.array(s.string()).describe("IDs of updated reminders.")
|
|
5130
|
-
},
|
|
5139
|
+
}, xa = {
|
|
5131
5140
|
name: f.UPDATE_REMINDERS,
|
|
5132
5141
|
description: 'Update existing reminders. Each reminder must specify its type ("relative", "absolute", or "location") and ID. Only include fields that need to change.',
|
|
5133
|
-
parameters:
|
|
5134
|
-
outputSchema:
|
|
5142
|
+
parameters: $a,
|
|
5143
|
+
outputSchema: Da,
|
|
5135
5144
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !0 },
|
|
5136
5145
|
async execute(e, t) {
|
|
5137
5146
|
const { reminders: r } = e, o = r.map(async (d) => {
|
|
@@ -5165,27 +5174,27 @@ const Ia = s.object({
|
|
|
5165
5174
|
}
|
|
5166
5175
|
};
|
|
5167
5176
|
}
|
|
5168
|
-
},
|
|
5177
|
+
}, Aa = s.object({
|
|
5169
5178
|
id: s.string().min(1).describe("The ID of the section to update."),
|
|
5170
5179
|
name: s.string().min(1).describe("The new name of the section.")
|
|
5171
|
-
}),
|
|
5172
|
-
sections: s.array(
|
|
5173
|
-
},
|
|
5180
|
+
}), Ea = {
|
|
5181
|
+
sections: s.array(Aa).min(1).describe("The sections to update.")
|
|
5182
|
+
}, Oa = {
|
|
5174
5183
|
sections: s.array(he).describe("The updated sections."),
|
|
5175
5184
|
totalCount: s.number().describe("The total number of sections updated."),
|
|
5176
5185
|
updatedSectionIds: s.array(s.string()).describe("The IDs of the updated sections.")
|
|
5177
|
-
},
|
|
5186
|
+
}, Pa = {
|
|
5178
5187
|
name: f.UPDATE_SECTIONS,
|
|
5179
5188
|
description: "Update multiple existing sections with new values.",
|
|
5180
|
-
parameters:
|
|
5181
|
-
outputSchema:
|
|
5189
|
+
parameters: Ea,
|
|
5190
|
+
outputSchema: Oa,
|
|
5182
5191
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5183
5192
|
async execute({ sections: e }, t) {
|
|
5184
5193
|
const r = await Promise.all(
|
|
5185
5194
|
e.map((n) => t.updateSection(n.id, { name: n.name }))
|
|
5186
5195
|
);
|
|
5187
5196
|
return {
|
|
5188
|
-
textContent:
|
|
5197
|
+
textContent: Ua({
|
|
5189
5198
|
sections: r
|
|
5190
5199
|
}),
|
|
5191
5200
|
structuredContent: {
|
|
@@ -5196,7 +5205,7 @@ const Ia = s.object({
|
|
|
5196
5205
|
};
|
|
5197
5206
|
}
|
|
5198
5207
|
};
|
|
5199
|
-
function
|
|
5208
|
+
function Ua({ sections: e }) {
|
|
5200
5209
|
const t = e.length, r = e.map((n) => `• ${n.name} (id=${n.id}, projectId=${n.projectId})`).join(`
|
|
5201
5210
|
`);
|
|
5202
5211
|
return `Updated ${t} section${t === 1 ? "" : "s"}:
|
|
@@ -5216,7 +5225,7 @@ const Ra = s.object({
|
|
|
5216
5225
|
sectionId: s.string().optional().describe("The new section ID for the task."),
|
|
5217
5226
|
parentId: s.string().optional().describe("The new parent task ID (for subtasks)."),
|
|
5218
5227
|
order: s.number().optional().describe("The new order of the task within its parent/section."),
|
|
5219
|
-
priority:
|
|
5228
|
+
priority: Ne.optional().describe(_e),
|
|
5220
5229
|
dueString: s.preprocess(
|
|
5221
5230
|
// Keep accepting legacy null while exposing a Gemini-compatible string schema.
|
|
5222
5231
|
(e) => e === null ? "remove" : e,
|
|
@@ -5241,9 +5250,9 @@ const Ra = s.object({
|
|
|
5241
5250
|
isUncompletable: s.boolean().optional().describe(
|
|
5242
5251
|
"Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
|
|
5243
5252
|
)
|
|
5244
|
-
}), _a = ["remove", "no date"],
|
|
5253
|
+
}), _a = ["remove", "no date"], Na = ["remove", "no date", "no deadline"], La = "no date", Ma = {
|
|
5245
5254
|
tasks: s.array(Ra).min(1).describe("The tasks to update.")
|
|
5246
|
-
},
|
|
5255
|
+
}, Fa = {
|
|
5247
5256
|
tasks: s.array(K).describe("The updated tasks."),
|
|
5248
5257
|
totalCount: s.number().describe("The total number of tasks updated."),
|
|
5249
5258
|
updatedTaskIds: s.array(s.string()).describe("The IDs of the updated tasks."),
|
|
@@ -5251,15 +5260,15 @@ const Ra = s.object({
|
|
|
5251
5260
|
updateCount: s.number().describe("The number of tasks actually updated."),
|
|
5252
5261
|
skippedCount: s.number().describe("The number of tasks skipped (no changes).")
|
|
5253
5262
|
}).describe("Summary of operations performed.")
|
|
5254
|
-
},
|
|
5263
|
+
}, Ha = {
|
|
5255
5264
|
name: f.UPDATE_TASKS,
|
|
5256
5265
|
description: "Update existing tasks including content, dates, priorities, and assignments.",
|
|
5257
|
-
parameters:
|
|
5258
|
-
outputSchema:
|
|
5266
|
+
parameters: Ma,
|
|
5267
|
+
outputSchema: Fa,
|
|
5259
5268
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5260
5269
|
async execute(e, t) {
|
|
5261
5270
|
const { tasks: r } = e, o = r.map(async (c) => {
|
|
5262
|
-
if (!
|
|
5271
|
+
if (!Ba(c))
|
|
5263
5272
|
return;
|
|
5264
5273
|
const {
|
|
5265
5274
|
id: d,
|
|
@@ -5281,21 +5290,21 @@ const Ra = s.object({
|
|
|
5281
5290
|
...N,
|
|
5282
5291
|
...D !== void 0 && { labels: D }
|
|
5283
5292
|
};
|
|
5284
|
-
I && (b.priority =
|
|
5285
|
-
const S =
|
|
5293
|
+
I && (b.priority = ht(I));
|
|
5294
|
+
const S = it(
|
|
5286
5295
|
m,
|
|
5287
5296
|
_a,
|
|
5288
|
-
|
|
5297
|
+
La
|
|
5289
5298
|
);
|
|
5290
5299
|
S !== void 0 && (b = { ...b, dueString: S });
|
|
5291
|
-
const
|
|
5300
|
+
const R = it(
|
|
5292
5301
|
$,
|
|
5293
|
-
|
|
5302
|
+
Na,
|
|
5294
5303
|
null
|
|
5295
5304
|
);
|
|
5296
|
-
if (
|
|
5305
|
+
if (R !== void 0 && (b = { ...b, deadlineDate: R }), h)
|
|
5297
5306
|
try {
|
|
5298
|
-
const { minutes: v } =
|
|
5307
|
+
const { minutes: v } = mt(h);
|
|
5299
5308
|
b = {
|
|
5300
5309
|
...b,
|
|
5301
5310
|
duration: v,
|
|
@@ -5308,7 +5317,7 @@ const Ra = s.object({
|
|
|
5308
5317
|
if (g === null || g === "unassign")
|
|
5309
5318
|
b = { ...b, assigneeId: null };
|
|
5310
5319
|
else {
|
|
5311
|
-
const v = await
|
|
5320
|
+
const v = await ze.validateTaskUpdateAssignment(
|
|
5312
5321
|
t,
|
|
5313
5322
|
d,
|
|
5314
5323
|
g
|
|
@@ -5323,13 +5332,13 @@ const Ra = s.object({
|
|
|
5323
5332
|
}
|
|
5324
5333
|
if (!T && !u && !p)
|
|
5325
5334
|
return await t.updateTask(d, b);
|
|
5326
|
-
const w =
|
|
5335
|
+
const w = Es(d, T, u, p), j = await t.moveTask(d, w);
|
|
5327
5336
|
return Object.keys(b).length > 0 ? await t.updateTask(d, b) : j;
|
|
5328
5337
|
}), n = (await Promise.all(o)).filter(
|
|
5329
5338
|
(c) => c !== void 0
|
|
5330
|
-
), a = n.map(
|
|
5339
|
+
), a = n.map(U);
|
|
5331
5340
|
return {
|
|
5332
|
-
textContent:
|
|
5341
|
+
textContent: Wa({
|
|
5333
5342
|
tasks: a,
|
|
5334
5343
|
args: e
|
|
5335
5344
|
}),
|
|
@@ -5345,21 +5354,21 @@ const Ra = s.object({
|
|
|
5345
5354
|
};
|
|
5346
5355
|
}
|
|
5347
5356
|
};
|
|
5348
|
-
function
|
|
5357
|
+
function Wa({
|
|
5349
5358
|
tasks: e,
|
|
5350
5359
|
args: t
|
|
5351
5360
|
}) {
|
|
5352
5361
|
const r = t.tasks.length, o = e.length, n = r - o;
|
|
5353
5362
|
let a = "";
|
|
5354
|
-
return n > 0 && (a = ` (${n} skipped - no changes)`),
|
|
5363
|
+
return n > 0 && (a = ` (${n} skipped - no changes)`), Ye("Updated", e, {
|
|
5355
5364
|
context: a,
|
|
5356
5365
|
showDetails: e.length <= 5
|
|
5357
5366
|
});
|
|
5358
5367
|
}
|
|
5359
|
-
function
|
|
5368
|
+
function Ba({ id: e, ...t }) {
|
|
5360
5369
|
return Object.keys(t).length > 0;
|
|
5361
5370
|
}
|
|
5362
|
-
function
|
|
5371
|
+
function it(e, t, r) {
|
|
5363
5372
|
if (e === void 0)
|
|
5364
5373
|
return e;
|
|
5365
5374
|
if (e === null)
|
|
@@ -5367,7 +5376,7 @@ function at(e, t, r) {
|
|
|
5367
5376
|
const o = e.trim().toLowerCase();
|
|
5368
5377
|
return t.includes(o) ? r : e;
|
|
5369
5378
|
}
|
|
5370
|
-
const
|
|
5379
|
+
const za = {}, Ya = {
|
|
5371
5380
|
type: s.literal("user_info").describe("The type of the response."),
|
|
5372
5381
|
userId: s.string().describe("The user ID."),
|
|
5373
5382
|
fullName: s.string().describe("The full name of the user."),
|
|
@@ -5384,36 +5393,36 @@ const Ba = {}, za = {
|
|
|
5384
5393
|
email: s.string().describe("The email address of the user."),
|
|
5385
5394
|
plan: s.enum(["Todoist Free", "Todoist Pro", "Todoist Business"]).describe("The user plan.")
|
|
5386
5395
|
};
|
|
5387
|
-
function
|
|
5396
|
+
function Ga(e) {
|
|
5388
5397
|
return e.businessAccountId ? "Todoist Business" : e.isPremium ? "Todoist Pro" : "Todoist Free";
|
|
5389
5398
|
}
|
|
5390
|
-
function
|
|
5399
|
+
function qa(e, t) {
|
|
5391
5400
|
const o = ((e.getDay() || 7) - t + 7) % 7, n = new Date(e);
|
|
5392
5401
|
return n.setDate(e.getDate() - o), n;
|
|
5393
5402
|
}
|
|
5394
|
-
function
|
|
5403
|
+
function Ka(e) {
|
|
5395
5404
|
const t = new Date(e);
|
|
5396
5405
|
return t.setDate(e.getDate() + 6), t;
|
|
5397
5406
|
}
|
|
5398
|
-
function
|
|
5407
|
+
function Va(e) {
|
|
5399
5408
|
const t = new Date(e.getFullYear(), 0, 1), r = (e.getTime() - t.getTime()) / 864e5;
|
|
5400
5409
|
return Math.ceil((r + t.getDay() + 1) / 7);
|
|
5401
5410
|
}
|
|
5402
|
-
function
|
|
5411
|
+
function Ja(e) {
|
|
5403
5412
|
return ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"][e === 7 ? 0 : e] ?? "Unknown";
|
|
5404
5413
|
}
|
|
5405
|
-
function
|
|
5414
|
+
function Xa(e) {
|
|
5406
5415
|
try {
|
|
5407
5416
|
return new Intl.DateTimeFormat("en-US", { timeZone: e }), !0;
|
|
5408
5417
|
} catch {
|
|
5409
5418
|
return !1;
|
|
5410
5419
|
}
|
|
5411
5420
|
}
|
|
5412
|
-
function
|
|
5413
|
-
return
|
|
5421
|
+
function Pt(e) {
|
|
5422
|
+
return Xa(e) ? e : "UTC";
|
|
5414
5423
|
}
|
|
5415
|
-
function
|
|
5416
|
-
const r =
|
|
5424
|
+
function Za(e, t) {
|
|
5425
|
+
const r = Pt(t);
|
|
5417
5426
|
return e.toLocaleString("en-US", {
|
|
5418
5427
|
timeZone: r,
|
|
5419
5428
|
year: "numeric",
|
|
@@ -5425,8 +5434,8 @@ function Xa(e, t) {
|
|
|
5425
5434
|
hour12: !1
|
|
5426
5435
|
});
|
|
5427
5436
|
}
|
|
5428
|
-
async function
|
|
5429
|
-
const t = await e.getUser(), r = t.tzInfo?.timezone ?? "UTC", o =
|
|
5437
|
+
async function Qa(e) {
|
|
5438
|
+
const t = await e.getUser(), r = t.tzInfo?.timezone ?? "UTC", o = Pt(r), n = /* @__PURE__ */ new Date(), a = Za(n, o), i = t.startDay ?? 1, c = Ja(i), d = Ga(t), l = new Date(n.toLocaleString("en-US", { timeZone: o })), u = qa(l, i), p = Ka(u), m = Va(l), g = [
|
|
5430
5439
|
"# User Information",
|
|
5431
5440
|
"",
|
|
5432
5441
|
`**User ID:** ${t.id}`,
|
|
@@ -5468,26 +5477,26 @@ async function Za(e) {
|
|
|
5468
5477
|
};
|
|
5469
5478
|
return { textContent: g, structuredContent: I };
|
|
5470
5479
|
}
|
|
5471
|
-
const
|
|
5480
|
+
const ei = {
|
|
5472
5481
|
name: f.USER_INFO,
|
|
5473
5482
|
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).",
|
|
5474
|
-
parameters:
|
|
5475
|
-
outputSchema:
|
|
5483
|
+
parameters: za,
|
|
5484
|
+
outputSchema: Ya,
|
|
5476
5485
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
5477
5486
|
async execute(e, t) {
|
|
5478
|
-
const r = await
|
|
5487
|
+
const r = await Qa(t);
|
|
5479
5488
|
return {
|
|
5480
5489
|
textContent: r.textContent,
|
|
5481
5490
|
structuredContent: r.structuredContent
|
|
5482
5491
|
};
|
|
5483
5492
|
}
|
|
5484
|
-
},
|
|
5493
|
+
}, ct = 10 * 1024 * 1024, ti = /* @__PURE__ */ new Set([
|
|
5485
5494
|
"image/png",
|
|
5486
5495
|
"image/jpeg",
|
|
5487
5496
|
"image/gif",
|
|
5488
5497
|
"image/webp",
|
|
5489
5498
|
"image/svg+xml"
|
|
5490
|
-
]),
|
|
5499
|
+
]), si = /* @__PURE__ */ new Set([
|
|
5491
5500
|
"text/plain",
|
|
5492
5501
|
"text/csv",
|
|
5493
5502
|
"text/html",
|
|
@@ -5495,7 +5504,7 @@ const Qa = {
|
|
|
5495
5504
|
"application/json",
|
|
5496
5505
|
"application/xml",
|
|
5497
5506
|
"text/xml"
|
|
5498
|
-
]),
|
|
5507
|
+
]), ri = {
|
|
5499
5508
|
".png": "image/png",
|
|
5500
5509
|
".jpg": "image/jpeg",
|
|
5501
5510
|
".jpeg": "image/jpeg",
|
|
@@ -5510,23 +5519,23 @@ const Qa = {
|
|
|
5510
5519
|
".xml": "application/xml",
|
|
5511
5520
|
".pdf": "application/pdf"
|
|
5512
5521
|
};
|
|
5513
|
-
function ri(e) {
|
|
5514
|
-
return ei.has(e) ? "image" : ti.has(e) || e.startsWith("text/") ? "text" : "binary";
|
|
5515
|
-
}
|
|
5516
5522
|
function oi(e) {
|
|
5517
|
-
return (e
|
|
5523
|
+
return ti.has(e) ? "image" : si.has(e) || e.startsWith("text/") ? "text" : "binary";
|
|
5518
5524
|
}
|
|
5519
5525
|
function ni(e) {
|
|
5526
|
+
return (e.split(";")[0] ?? e).trim().toLowerCase();
|
|
5527
|
+
}
|
|
5528
|
+
function ai(e) {
|
|
5520
5529
|
try {
|
|
5521
5530
|
const t = new URL(e).pathname, r = t.lastIndexOf(".");
|
|
5522
5531
|
if (r === -1) return;
|
|
5523
5532
|
const o = t.slice(r).toLowerCase();
|
|
5524
|
-
return
|
|
5533
|
+
return ri[o];
|
|
5525
5534
|
} catch {
|
|
5526
5535
|
return;
|
|
5527
5536
|
}
|
|
5528
5537
|
}
|
|
5529
|
-
function
|
|
5538
|
+
function ii(e) {
|
|
5530
5539
|
try {
|
|
5531
5540
|
const t = new URL(e).pathname, r = t.lastIndexOf("/");
|
|
5532
5541
|
return r === -1 ? void 0 : t.slice(r + 1) || void 0;
|
|
@@ -5534,28 +5543,28 @@ function ai(e) {
|
|
|
5534
5543
|
return;
|
|
5535
5544
|
}
|
|
5536
5545
|
}
|
|
5537
|
-
const
|
|
5546
|
+
const ci = {
|
|
5538
5547
|
fileUrl: s.string().url().describe(
|
|
5539
5548
|
"The URL of the attachment file to view. Get this from the fileUrl field in a comment's fileAttachment."
|
|
5540
5549
|
)
|
|
5541
|
-
},
|
|
5550
|
+
}, di = {
|
|
5542
5551
|
fileName: s.string().optional().describe("The name of the file."),
|
|
5543
5552
|
fileType: s.string().optional().describe("The MIME type of the file."),
|
|
5544
5553
|
fileSize: s.number().optional().describe("The size of the file in bytes."),
|
|
5545
5554
|
contentDelivery: s.enum(["image", "text", "embedded_resource", "metadata_only"]).describe("How the content was delivered.")
|
|
5546
|
-
},
|
|
5555
|
+
}, li = {
|
|
5547
5556
|
name: f.VIEW_ATTACHMENT,
|
|
5548
5557
|
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).",
|
|
5549
|
-
parameters:
|
|
5550
|
-
outputSchema:
|
|
5558
|
+
parameters: ci,
|
|
5559
|
+
outputSchema: di,
|
|
5551
5560
|
annotations: {
|
|
5552
5561
|
readOnlyHint: !0,
|
|
5553
5562
|
destructiveHint: !1,
|
|
5554
5563
|
idempotentHint: !0
|
|
5555
5564
|
},
|
|
5556
5565
|
async execute({ fileUrl: e }, t) {
|
|
5557
|
-
const r = await t.viewAttachment(e), o = r.headers["content-length"], n = o ? Number.parseInt(o, 10) : void 0, a =
|
|
5558
|
-
if (n && n >
|
|
5566
|
+
const r = await t.viewAttachment(e), o = r.headers["content-length"], n = o ? Number.parseInt(o, 10) : void 0, a = ii(e), i = r.headers["content-type"], c = i ? ni(i) : void 0, d = c && c !== "application/octet-stream" ? c : ai(e) ?? c ?? "application/octet-stream";
|
|
5567
|
+
if (n && n > ct)
|
|
5559
5568
|
return {
|
|
5560
5569
|
textContent: `Attachment "${a ?? e}" is too large to display inline (${(n / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`,
|
|
5561
5570
|
structuredContent: {
|
|
@@ -5566,7 +5575,7 @@ const ii = {
|
|
|
5566
5575
|
}
|
|
5567
5576
|
};
|
|
5568
5577
|
const l = Buffer.from(await r.arrayBuffer()), u = l.byteLength;
|
|
5569
|
-
if (u >
|
|
5578
|
+
if (u > ct)
|
|
5570
5579
|
return {
|
|
5571
5580
|
textContent: `Attachment "${a ?? e}" is too large to display inline (${(u / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`,
|
|
5572
5581
|
structuredContent: {
|
|
@@ -5576,7 +5585,7 @@ const ii = {
|
|
|
5576
5585
|
contentDelivery: "metadata_only"
|
|
5577
5586
|
}
|
|
5578
5587
|
};
|
|
5579
|
-
const p =
|
|
5588
|
+
const p = oi(d), m = [];
|
|
5580
5589
|
let h;
|
|
5581
5590
|
return p === "image" ? (m.push({
|
|
5582
5591
|
type: "image",
|
|
@@ -5603,7 +5612,7 @@ const ii = {
|
|
|
5603
5612
|
contentItems: m
|
|
5604
5613
|
};
|
|
5605
5614
|
}
|
|
5606
|
-
},
|
|
5615
|
+
}, ui = `
|
|
5607
5616
|
## Todoist Task and Project Management Tools
|
|
5608
5617
|
|
|
5609
5618
|
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.
|
|
@@ -5639,6 +5648,7 @@ You have access to comprehensive Todoist management tools for personal productiv
|
|
|
5639
5648
|
- **add-reminders**: Create reminders for tasks. Three types: "relative" (minutes before due), "absolute" (specific date/time), or "location" (geofence-triggered). Each reminder must specify a taskId.
|
|
5640
5649
|
- **find-reminders**: Find reminders by task ID (returns both time-based and location reminders), or get a specific reminder by ID (use reminderId for time-based, locationReminderId for location-based).
|
|
5641
5650
|
- **update-reminders**: Update existing reminders. Must specify the reminder type ("relative", "absolute", or "location") and ID.
|
|
5651
|
+
- Relative and absolute reminders support an **isUrgent** flag to mark a reminder as urgent.
|
|
5642
5652
|
- Reminders can be deleted using **delete-object** with type "reminder" (time-based) or "location_reminder" (location-based).
|
|
5643
5653
|
|
|
5644
5654
|
**Collaboration & Comments:**
|
|
@@ -5699,31 +5709,31 @@ You have access to comprehensive Todoist management tools for personal productiv
|
|
|
5699
5709
|
|
|
5700
5710
|
Always provide clear, actionable task titles and descriptions. Use the overview tools to give users context about their workload and project status.
|
|
5701
5711
|
`;
|
|
5702
|
-
function
|
|
5712
|
+
function vi({
|
|
5703
5713
|
todoistApiKey: e,
|
|
5704
5714
|
baseUrl: t,
|
|
5705
5715
|
features: r = []
|
|
5706
5716
|
}) {
|
|
5707
|
-
const o = new
|
|
5717
|
+
const o = new Mt(
|
|
5708
5718
|
{ name: "todoist-mcp-server", version: "0.1.0" },
|
|
5709
5719
|
{
|
|
5710
5720
|
capabilities: {
|
|
5711
5721
|
tools: { listChanged: !0 },
|
|
5712
5722
|
prompts: { listChanged: !0 }
|
|
5713
5723
|
},
|
|
5714
|
-
instructions:
|
|
5724
|
+
instructions: ui
|
|
5715
5725
|
}
|
|
5716
|
-
), n = new
|
|
5717
|
-
...
|
|
5726
|
+
), n = new Lt(e, { baseUrl: t }), a = {
|
|
5727
|
+
...Xo,
|
|
5718
5728
|
_meta: {
|
|
5719
5729
|
ui: {
|
|
5720
|
-
resourceUri:
|
|
5730
|
+
resourceUri: xe
|
|
5721
5731
|
}
|
|
5722
5732
|
}
|
|
5723
5733
|
};
|
|
5724
|
-
|
|
5734
|
+
Zt(o);
|
|
5725
5735
|
const i = { server: o, client: n, features: r };
|
|
5726
|
-
return k({ tool:
|
|
5736
|
+
return k({ tool: Or, ...i }), k({ tool: Hr, ...i }), k({ tool: oa, ...i }), k({ tool: Ha, ...i }), k({ tool: Xn, ...i }), k({ tool: qo, ...i }), k({ tool: a, ...i }), k({ tool: go, ...i }), k({ tool: lr, ...i }), k({ tool: Ta, ...i }), k({ tool: Eo, ...i }), k({ tool: Hn, ...i }), k({ tool: zn, ...i }), k({ tool: vr, ...i }), k({ tool: Pa, ...i }), k({ tool: Fo, ...i }), k({ tool: Bs, ...i }), k({ tool: io, ...i }), k({ tool: da, ...i }), k({ tool: yr, ...i }), k({ tool: Ro, ...i }), k({ tool: xa, ...i }), k({ tool: li, ...i }), k({ tool: sr, ...i }), k({ tool: wo, ...i }), k({ tool: qs, ...i }), k({ tool: Zs, ...i }), k({ tool: ha, ...i }), k({ tool: eo, ...i }), k({ tool: un, ...i }), k({ tool: vn, ...i }), k({ tool: bn, ...i }), k({ tool: Lr, ...i }), k({ tool: $n, ...i }), k({ tool: cn, ...i }), k({ tool: Yr, ...i }), k({ tool: Xr, ...i }), k({ tool: qn, ...i }), k({ tool: ei, ...i }), k({ tool: Co, ...i }), k({ tool: Ln, ...i }), k({ tool: On, ...i }), k({ tool: ta, ...i }), k({ tool: Kr, ...i }), o.registerPrompt(
|
|
5727
5737
|
ie.name,
|
|
5728
5738
|
{
|
|
5729
5739
|
title: ie.title,
|
|
@@ -5734,44 +5744,44 @@ function Ii({
|
|
|
5734
5744
|
), o;
|
|
5735
5745
|
}
|
|
5736
5746
|
export {
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
|
-
|
|
5742
|
-
|
|
5743
|
-
|
|
5744
|
-
|
|
5745
|
-
|
|
5746
|
-
|
|
5747
|
-
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
|
|
5751
|
-
|
|
5752
|
-
|
|
5753
|
-
|
|
5754
|
-
|
|
5755
|
-
|
|
5756
|
-
|
|
5757
|
-
|
|
5758
|
-
|
|
5759
|
-
|
|
5760
|
-
|
|
5761
|
-
|
|
5762
|
-
|
|
5763
|
-
|
|
5764
|
-
|
|
5765
|
-
|
|
5766
|
-
|
|
5767
|
-
|
|
5768
|
-
|
|
5769
|
-
|
|
5770
|
-
|
|
5771
|
-
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
|
|
5776
|
-
|
|
5747
|
+
Pa as A,
|
|
5748
|
+
vr as B,
|
|
5749
|
+
Eo as C,
|
|
5750
|
+
Ta as D,
|
|
5751
|
+
lr as E,
|
|
5752
|
+
Xn as F,
|
|
5753
|
+
go as G,
|
|
5754
|
+
Xo as H,
|
|
5755
|
+
qo as I,
|
|
5756
|
+
Ha as J,
|
|
5757
|
+
oa as K,
|
|
5758
|
+
Hr as L,
|
|
5759
|
+
Or as M,
|
|
5760
|
+
Ii as N,
|
|
5761
|
+
Co as a,
|
|
5762
|
+
cn as b,
|
|
5763
|
+
$n as c,
|
|
5764
|
+
Yr as d,
|
|
5765
|
+
Lr as e,
|
|
5766
|
+
Kr as f,
|
|
5767
|
+
vi as g,
|
|
5768
|
+
bn as h,
|
|
5769
|
+
vn as i,
|
|
5770
|
+
un as j,
|
|
5771
|
+
eo as k,
|
|
5772
|
+
On as l,
|
|
5773
|
+
Ln as m,
|
|
5774
|
+
ha as n,
|
|
5775
|
+
Zs as o,
|
|
5776
|
+
qs as p,
|
|
5777
|
+
wo as q,
|
|
5778
|
+
qn as r,
|
|
5779
|
+
ta as s,
|
|
5780
|
+
sr as t,
|
|
5781
|
+
ei as u,
|
|
5782
|
+
li as v,
|
|
5783
|
+
io as w,
|
|
5784
|
+
da as x,
|
|
5785
|
+
Bs as y,
|
|
5786
|
+
Fo as z
|
|
5777
5787
|
};
|