@doist/todoist-mcp 10.4.1 → 10.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +16 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/main-http.js +2 -2
- package/dist/main.js +1 -1
- package/dist/{mcp-server-Dz-ZHVdc.js → mcp-server-D4lt4A-e.js} +884 -843
- package/dist/{require-valid-todoist-token-BCxPgUS_.js → require-valid-todoist-token-Czo9Y3Dn.js} +1 -1
- package/dist/tool-execution-error.d.ts +8 -2
- package/dist/tool-execution-error.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 +4 -4
- package/dist/tools/add-tasks.d.ts +2 -0
- package/dist/tools/add-tasks.d.ts.map +1 -1
- package/dist/tools/delete-object.d.ts +4 -4
- package/dist/tools/fetch-object.d.ts +2 -0
- package/dist/tools/fetch-object.d.ts.map +1 -1
- package/dist/tools/find-completed-tasks.d.ts +2 -0
- package/dist/tools/find-completed-tasks.d.ts.map +1 -1
- package/dist/tools/find-tasks-by-date.d.ts +2 -0
- package/dist/tools/find-tasks-by-date.d.ts.map +1 -1
- package/dist/tools/find-tasks.d.ts +2 -0
- package/dist/tools/find-tasks.d.ts.map +1 -1
- package/dist/tools/reschedule-tasks.d.ts +2 -0
- package/dist/tools/reschedule-tasks.d.ts.map +1 -1
- package/dist/tools/update-reminders.d.ts +4 -4
- package/dist/tools/update-tasks.d.ts +2 -0
- package/dist/tools/update-tasks.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 +1 -1
- package/dist/utils/test-helpers.d.ts.map +1 -1
- package/package.json +8 -8
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { ResourceTemplate as
|
|
2
|
-
import { createHash as
|
|
3
|
-
import { readFileSync as
|
|
4
|
-
import { dirname as
|
|
5
|
-
import { fileURLToPath as
|
|
6
|
-
import { registerAppResource as
|
|
7
|
-
import Q, { ZodError as
|
|
8
|
-
import { AsyncLocalStorage as
|
|
9
|
-
import { createRequire as
|
|
10
|
-
import { TodoistApi as
|
|
11
|
-
import { addDays as Fe, formatISO as
|
|
12
|
-
const
|
|
13
|
-
Le(
|
|
14
|
-
Le(
|
|
15
|
-
],
|
|
1
|
+
import { ResourceTemplate as ps, McpServer as ms } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { createHash as hs, randomUUID as Ne } from "node:crypto";
|
|
3
|
+
import { readFileSync as fs } from "node:fs";
|
|
4
|
+
import { dirname as Et, join as Le } from "node:path";
|
|
5
|
+
import { fileURLToPath as bs } from "node:url";
|
|
6
|
+
import { registerAppResource as gs, RESOURCE_MIME_TYPE as Ot, registerAppTool as ys } from "@modelcontextprotocol/ext-apps/server";
|
|
7
|
+
import Q, { ZodError as ks, z as s } from "zod";
|
|
8
|
+
import { AsyncLocalStorage as Ts } from "node:async_hooks";
|
|
9
|
+
import { createRequire as ws } from "node:module";
|
|
10
|
+
import { TodoistApi as vs, isWorkspaceProject as ke, isPersonalProject as ie, colors as Me, LOCATION_TRIGGERS as Ut, REMINDER_TYPES as Is, createCommand as q, REMINDER_DELIVERY_SERVICES as js, HEALTH_STATUSES as Xe, getTaskUrl as Pt, getProjectUrl as _t, GOAL_OWNER_TYPES as Ss, WORKSPACE_ROLES as Cs, WORKSPACE_PLANS as $s } from "@doist/todoist-sdk";
|
|
11
|
+
import { addDays as Fe, formatISO as lt } from "date-fns";
|
|
12
|
+
const ut = Et(bs(import.meta.url)), Ds = [
|
|
13
|
+
Le(ut, "task-list", "index.html"),
|
|
14
|
+
Le(ut, "mcp-apps", "index.html")
|
|
15
|
+
], As = `<!doctype html>
|
|
16
16
|
<html>
|
|
17
17
|
<body>
|
|
18
18
|
<p>Task list app is missing. Run "npm run build" to generate it.</p>
|
|
19
19
|
</body>
|
|
20
20
|
</html>`;
|
|
21
|
-
function
|
|
21
|
+
function xs() {
|
|
22
22
|
const e = [];
|
|
23
|
-
for (const t of
|
|
23
|
+
for (const t of Ds)
|
|
24
24
|
try {
|
|
25
|
-
return
|
|
25
|
+
return fs(t, "utf-8");
|
|
26
26
|
} catch (o) {
|
|
27
27
|
e.push(o);
|
|
28
28
|
}
|
|
29
|
-
return console.error("Failed to load task list app HTML from any known path:", e),
|
|
29
|
+
return console.error("Failed to load task list app HTML from any known path:", e), As;
|
|
30
30
|
}
|
|
31
|
-
const
|
|
31
|
+
const Rt = xs(), Es = hs("sha256").update(Rt).digest("hex").slice(0, 12), He = `ui://todoist/task-list@${Es}`, Os = "ui://todoist/task-list@{hash}", We = "Interactive task list widget", Us = "https://ai.todoist.net", Ge = {
|
|
32
32
|
ui: {
|
|
33
33
|
prefersBorder: !0,
|
|
34
34
|
csp: {
|
|
@@ -43,22 +43,22 @@ const _t = Cs(), $s = ls("sha256").update(_t).digest("hex").slice(0, 12), He = `
|
|
|
43
43
|
connect_domains: [],
|
|
44
44
|
resource_domains: []
|
|
45
45
|
},
|
|
46
|
-
"openai/widgetDomain":
|
|
46
|
+
"openai/widgetDomain": Us
|
|
47
47
|
};
|
|
48
|
-
function
|
|
48
|
+
function pt(e) {
|
|
49
49
|
return {
|
|
50
50
|
contents: [
|
|
51
51
|
{
|
|
52
52
|
uri: e,
|
|
53
|
-
mimeType:
|
|
54
|
-
text:
|
|
53
|
+
mimeType: Ot,
|
|
54
|
+
text: Rt,
|
|
55
55
|
_meta: Ge
|
|
56
56
|
}
|
|
57
57
|
]
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
|
|
60
|
+
function Ps(e) {
|
|
61
|
+
gs(
|
|
62
62
|
e,
|
|
63
63
|
"todoist-task-list",
|
|
64
64
|
He,
|
|
@@ -66,16 +66,16 @@ function xs(e) {
|
|
|
66
66
|
description: We,
|
|
67
67
|
_meta: Ge
|
|
68
68
|
},
|
|
69
|
-
async () =>
|
|
69
|
+
async () => pt(He)
|
|
70
70
|
), e.registerResource(
|
|
71
71
|
"todoist-task-list-hash-fallback",
|
|
72
|
-
new
|
|
72
|
+
new ps(Os, { list: void 0 }),
|
|
73
73
|
{
|
|
74
74
|
description: `${We} compatibility fallback`,
|
|
75
|
-
mimeType:
|
|
75
|
+
mimeType: Ot,
|
|
76
76
|
_meta: Ge
|
|
77
77
|
},
|
|
78
|
-
async (t) =>
|
|
78
|
+
async (t) => pt(t.toString())
|
|
79
79
|
);
|
|
80
80
|
}
|
|
81
81
|
function z(e) {
|
|
@@ -105,17 +105,17 @@ function ee(e) {
|
|
|
105
105
|
const t = O(e);
|
|
106
106
|
return t !== void 0 ? t : T(e);
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function _s(e) {
|
|
109
109
|
return e.replace(/\b(Bearer)\s+[A-Za-z0-9._~+/=-]+/gi, "$1 [REDACTED]").replace(
|
|
110
110
|
/\b(token|api[_-]?key|authorization)\s*[:=]\s*["']?[A-Za-z0-9._~+/=-]{6,}["']?/gi,
|
|
111
111
|
"$1: [REDACTED]"
|
|
112
112
|
).replace(/([?&](?:token|api[_-]?key|authorization)=)[^&\s]+/gi, "$1[REDACTED]").replace(/\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\b/g, "[REDACTED]");
|
|
113
113
|
}
|
|
114
114
|
function P(e, t = 220) {
|
|
115
|
-
const o =
|
|
115
|
+
const o = _s(e).replace(/\s+/g, " ").trim();
|
|
116
116
|
return o.length <= t ? o : `${o.slice(0, t - 3)}...`;
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function Ye(e) {
|
|
119
119
|
const t = e.trim();
|
|
120
120
|
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);
|
|
121
121
|
}
|
|
@@ -153,7 +153,7 @@ function Y(e) {
|
|
|
153
153
|
}
|
|
154
154
|
return r.length > 0 ? P(r.join("; ")) : void 0;
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function Rs(e) {
|
|
157
157
|
if (!e)
|
|
158
158
|
return [];
|
|
159
159
|
const t = /* @__PURE__ */ new Set(), o = (i) => {
|
|
@@ -216,7 +216,7 @@ function Os(e) {
|
|
|
216
216
|
}
|
|
217
217
|
return Array.from(t).slice(0, 3);
|
|
218
218
|
}
|
|
219
|
-
const
|
|
219
|
+
const Ns = [
|
|
220
220
|
"error",
|
|
221
221
|
"error_code",
|
|
222
222
|
"error_tag",
|
|
@@ -227,13 +227,39 @@ const Us = [
|
|
|
227
227
|
"httpCode",
|
|
228
228
|
"errorExtra"
|
|
229
229
|
];
|
|
230
|
-
function
|
|
231
|
-
return e ?
|
|
230
|
+
function Ls(e) {
|
|
231
|
+
return e ? Ns.some((t) => e[t] !== void 0) : !1;
|
|
232
232
|
}
|
|
233
|
-
|
|
234
|
-
|
|
233
|
+
const qe = {
|
|
234
|
+
MAX_ITEMS_LIMIT_REACHED: "This project has reached the maximum number of active tasks per project (subtasks count toward it; completed tasks do not). The cap is the same on every Todoist plan — upgrading will not raise it — and it is not an authentication or permission problem. Complete, delete, or move existing tasks out of the project, or add the task to a different project, then retry."
|
|
235
|
+
};
|
|
236
|
+
function Ms(...e) {
|
|
237
|
+
for (const t of e) {
|
|
238
|
+
if (!t)
|
|
239
|
+
continue;
|
|
240
|
+
const o = t.toUpperCase(), r = Object.keys(qe).find(
|
|
241
|
+
(n) => o.includes(n)
|
|
242
|
+
);
|
|
243
|
+
if (r)
|
|
244
|
+
return qe[r];
|
|
245
|
+
}
|
|
235
246
|
}
|
|
236
|
-
function
|
|
247
|
+
function Fs(e) {
|
|
248
|
+
if (e.tag) {
|
|
249
|
+
const t = qe[e.tag.toUpperCase()];
|
|
250
|
+
if (t)
|
|
251
|
+
return t;
|
|
252
|
+
}
|
|
253
|
+
return Ms(...e.rawText ?? [], e.message, e.details);
|
|
254
|
+
}
|
|
255
|
+
function Hs(e) {
|
|
256
|
+
const t = Fs(e);
|
|
257
|
+
if (t)
|
|
258
|
+
return t;
|
|
259
|
+
const { statusCode: o } = e, r = e.fieldHints.length > 0;
|
|
260
|
+
return o === 401 || o === 403 ? "Verify your API token and access permissions, then retry." : o === 404 ? "Confirm the referenced IDs exist and are accessible, then retry." : o === 429 ? "Rate limit reached. Wait briefly and retry." : o !== void 0 && o >= 500 ? "Todoist API may be temporarily unavailable. Retry shortly." : r ? "Fix the field hints above and retry." : o === 400 || o === 422 ? "Check parameter values and formats, then retry." : "Check the request parameters and retry.";
|
|
261
|
+
}
|
|
262
|
+
function Nt(e) {
|
|
237
263
|
const t = z(e) ? e : void 0, o = e instanceof Error && z(e.cause) ? e.cause : void 0, r = Be(t?.response, o?.response), n = Be(
|
|
238
264
|
t?.responseData,
|
|
239
265
|
r?.data,
|
|
@@ -274,84 +300,94 @@ function Rs(e) {
|
|
|
274
300
|
T(t?.message),
|
|
275
301
|
T(o?.message),
|
|
276
302
|
e instanceof Error ? e.message : T(e)
|
|
277
|
-
].filter((h) => !!h), l = d.find((h) => !
|
|
303
|
+
].filter((h) => !!h), l = d.find((h) => !Ye(h)) || d[0], p = N(
|
|
278
304
|
Y(n?.errorExtra),
|
|
279
305
|
Y(n?.error_extra),
|
|
280
306
|
Y(n?.details),
|
|
281
307
|
Y(n?.errorDetails),
|
|
282
308
|
Y(n?.errors),
|
|
283
309
|
Y(t?.details)
|
|
284
|
-
), u =
|
|
285
|
-
return a !== void 0 ||
|
|
310
|
+
), u = Rs(n);
|
|
311
|
+
return a !== void 0 || Ls(n) || c !== void 0 || i !== void 0 || (l ? Ye(l) : !1) ? {
|
|
286
312
|
statusCode: a,
|
|
287
313
|
code: i,
|
|
288
314
|
tag: c ? P(c, 80) : void 0,
|
|
289
315
|
message: l ? P(l) : void 0,
|
|
290
316
|
details: p ? P(p) : void 0,
|
|
317
|
+
rawText: d,
|
|
291
318
|
fieldHints: u
|
|
292
319
|
} : null;
|
|
293
320
|
}
|
|
294
|
-
function
|
|
321
|
+
function Lt(e) {
|
|
295
322
|
const t = [];
|
|
296
|
-
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}`);
|
|
297
|
-
|
|
323
|
+
return e.statusCode !== void 0 && t.push(`HTTP ${e.statusCode}`), e.code !== void 0 && t.push(`code ${e.code}`), e.tag && t.push(`tag ${e.tag}`), t;
|
|
324
|
+
}
|
|
325
|
+
function Ws(e) {
|
|
326
|
+
const t = Lt(e), o = [
|
|
298
327
|
t.length > 0 ? `Todoist API request failed (${t.join(", ")}).` : "Todoist API request failed."
|
|
299
328
|
];
|
|
300
|
-
return e.message && o.push(`Message: ${e.message}`), e.details && e.details !== e.message && o.push(`Details: ${e.details}`), e.fieldHints.length > 0 && o.push(`Field hints: ${e.fieldHints.join("; ")}`), o.push(`Try next: ${
|
|
329
|
+
return e.message && o.push(`Message: ${e.message}`), e.details && e.details !== e.message && o.push(`Details: ${e.details}`), e.fieldHints.length > 0 && o.push(`Field hints: ${e.fieldHints.join("; ")}`), o.push(`Try next: ${Hs(e)}`), o.join(`
|
|
301
330
|
`);
|
|
302
331
|
}
|
|
303
|
-
function
|
|
332
|
+
function Mt(e) {
|
|
304
333
|
return e instanceof Error ? P(e.message) : typeof e == "string" ? P(e) : "An unknown error occurred";
|
|
305
334
|
}
|
|
306
|
-
function
|
|
307
|
-
|
|
335
|
+
function Gs(e) {
|
|
336
|
+
const t = Nt(e);
|
|
337
|
+
if (!t)
|
|
338
|
+
return Mt(e);
|
|
339
|
+
const o = Lt(t), r = t.message && !(o.length > 0 && Ye(t.message)) ? t.message : "Todoist API request failed";
|
|
340
|
+
return o.length > 0 ? `${r} (${o.join(", ")})` : r;
|
|
341
|
+
}
|
|
342
|
+
function Bs(e) {
|
|
343
|
+
if (e instanceof ks)
|
|
308
344
|
return e.message;
|
|
309
|
-
const t =
|
|
310
|
-
return t ?
|
|
345
|
+
const t = Nt(e);
|
|
346
|
+
return t ? Ws(t) : Mt(e);
|
|
311
347
|
}
|
|
312
|
-
const
|
|
313
|
-
version:
|
|
314
|
-
},
|
|
348
|
+
const Ys = "10.5.0", qs = {
|
|
349
|
+
version: Ys
|
|
350
|
+
}, zs = "todoist-mcp", Ze = qs.version, Ft = new Ts(), mt = ws(import.meta.url);
|
|
315
351
|
let ye;
|
|
316
|
-
const
|
|
317
|
-
const e =
|
|
318
|
-
return
|
|
352
|
+
const Ks = async () => {
|
|
353
|
+
const e = mt.resolve("@doist/todoist-sdk"), t = Le(Et(e), "transport", "http-dispatcher.js");
|
|
354
|
+
return mt(t);
|
|
319
355
|
};
|
|
320
|
-
let
|
|
321
|
-
function
|
|
322
|
-
return `${
|
|
356
|
+
let Vs = Ks;
|
|
357
|
+
function Js() {
|
|
358
|
+
return `${zs}/${Ze}`;
|
|
323
359
|
}
|
|
324
|
-
function
|
|
360
|
+
function Ht(e) {
|
|
325
361
|
return e.trim().toLowerCase();
|
|
326
362
|
}
|
|
327
|
-
function
|
|
328
|
-
return
|
|
363
|
+
function Xs(e, t) {
|
|
364
|
+
return Ft.run(Ht(e), t);
|
|
329
365
|
}
|
|
330
|
-
function
|
|
366
|
+
function Zs({
|
|
331
367
|
label: e,
|
|
332
368
|
platform: t = "mcp",
|
|
333
369
|
sessionId: o = Ne()
|
|
334
370
|
} = {}) {
|
|
335
|
-
const r = e ?
|
|
371
|
+
const r = e ? Ht(e) : Ft.getStore();
|
|
336
372
|
return {
|
|
337
|
-
"User-Agent":
|
|
373
|
+
"User-Agent": Js(),
|
|
338
374
|
"doist-platform": t,
|
|
339
|
-
"doist-version":
|
|
375
|
+
"doist-version": Ze,
|
|
340
376
|
"request-id": Ne(),
|
|
341
377
|
"session-id": o,
|
|
342
378
|
"mcp-tool": r ?? "unknown"
|
|
343
379
|
};
|
|
344
380
|
}
|
|
345
|
-
function
|
|
381
|
+
function Qs(e, t) {
|
|
346
382
|
const o = new Headers(e);
|
|
347
|
-
for (const [r, n] of Object.entries(
|
|
383
|
+
for (const [r, n] of Object.entries(Zs(t)))
|
|
348
384
|
o.set(r, n);
|
|
349
385
|
return Object.fromEntries(o.entries());
|
|
350
386
|
}
|
|
351
|
-
function
|
|
387
|
+
function ht() {
|
|
352
388
|
return new DOMException("The operation was aborted due to timeout", "TimeoutError");
|
|
353
389
|
}
|
|
354
|
-
function
|
|
390
|
+
function eo(e, t) {
|
|
355
391
|
if (!e && t === void 0)
|
|
356
392
|
return {
|
|
357
393
|
signal: void 0,
|
|
@@ -359,7 +395,7 @@ function Vs(e, t) {
|
|
|
359
395
|
}
|
|
360
396
|
};
|
|
361
397
|
if (!e && t !== void 0) {
|
|
362
|
-
const i = new AbortController(), c = setTimeout(() => i.abort(
|
|
398
|
+
const i = new AbortController(), c = setTimeout(() => i.abort(ht()), t);
|
|
363
399
|
return {
|
|
364
400
|
signal: i.signal,
|
|
365
401
|
cleanup: () => clearTimeout(c)
|
|
@@ -380,7 +416,7 @@ function Vs(e, t) {
|
|
|
380
416
|
const i = () => n(e.reason);
|
|
381
417
|
e.addEventListener("abort", i, { once: !0 }), r.push(() => e.removeEventListener("abort", i));
|
|
382
418
|
}
|
|
383
|
-
const a = setTimeout(() => n(
|
|
419
|
+
const a = setTimeout(() => n(ht()), t);
|
|
384
420
|
return r.push(() => clearTimeout(a)), {
|
|
385
421
|
signal: o.signal,
|
|
386
422
|
cleanup: () => {
|
|
@@ -389,20 +425,20 @@ function Vs(e, t) {
|
|
|
389
425
|
}
|
|
390
426
|
};
|
|
391
427
|
}
|
|
392
|
-
async function
|
|
393
|
-
if (
|
|
394
|
-
return ye || (ye =
|
|
428
|
+
async function to() {
|
|
429
|
+
if (so())
|
|
430
|
+
return ye || (ye = Vs().then((e) => e.getDefaultDispatcher()).catch((e) => {
|
|
395
431
|
throw ye = void 0, e;
|
|
396
432
|
})), ye;
|
|
397
433
|
}
|
|
398
|
-
function
|
|
434
|
+
function so() {
|
|
399
435
|
return typeof process < "u" && !!process.versions?.node;
|
|
400
436
|
}
|
|
401
|
-
async function
|
|
402
|
-
const t = await
|
|
437
|
+
async function oo(e) {
|
|
438
|
+
const t = await to();
|
|
403
439
|
t !== void 0 && (e.dispatcher = t);
|
|
404
440
|
}
|
|
405
|
-
function
|
|
441
|
+
function ro(e) {
|
|
406
442
|
return {
|
|
407
443
|
ok: e.ok,
|
|
408
444
|
status: e.status,
|
|
@@ -413,35 +449,35 @@ function Qs(e) {
|
|
|
413
449
|
arrayBuffer: () => e.arrayBuffer()
|
|
414
450
|
};
|
|
415
451
|
}
|
|
416
|
-
function
|
|
452
|
+
function no(e = globalThis.fetch, t = {}) {
|
|
417
453
|
const o = e === globalThis.fetch, { enabled: r = !0, platform: n = "mcp", sessionId: a = Ne() } = t;
|
|
418
454
|
return async (i, c = {}) => {
|
|
419
|
-
const { timeout: d, headers: l, signal: p, ...u } = c, { signal: m, cleanup: h } =
|
|
455
|
+
const { timeout: d, headers: l, signal: p, ...u } = c, { signal: m, cleanup: h } = eo(p, d);
|
|
420
456
|
try {
|
|
421
457
|
const k = {
|
|
422
458
|
...u,
|
|
423
459
|
signal: m,
|
|
424
|
-
...r ? { headers:
|
|
460
|
+
...r ? { headers: Qs(l, { platform: n, sessionId: a }) } : l !== void 0 ? { headers: l } : {}
|
|
425
461
|
};
|
|
426
|
-
o && await
|
|
462
|
+
o && await oo(k);
|
|
427
463
|
const b = await e(i, k);
|
|
428
|
-
return
|
|
464
|
+
return ro(b);
|
|
429
465
|
} finally {
|
|
430
466
|
h();
|
|
431
467
|
}
|
|
432
468
|
};
|
|
433
469
|
}
|
|
434
|
-
function
|
|
470
|
+
function ao(e, {
|
|
435
471
|
baseUrl: t,
|
|
436
472
|
tracking: o
|
|
437
473
|
} = {}) {
|
|
438
|
-
return new
|
|
439
|
-
customFetch:
|
|
474
|
+
return new vs(e, {
|
|
475
|
+
customFetch: no(globalThis.fetch, o),
|
|
440
476
|
...t ? { baseUrl: t } : {}
|
|
441
477
|
});
|
|
442
478
|
}
|
|
443
|
-
const
|
|
444
|
-
function
|
|
479
|
+
const io = 2, co = 500, lo = 2e3, uo = /* @__PURE__ */ new Set([502, 503, 504]);
|
|
480
|
+
function po(e) {
|
|
445
481
|
if (e == null || typeof e != "object")
|
|
446
482
|
return;
|
|
447
483
|
const t = e;
|
|
@@ -457,11 +493,11 @@ function ao(e) {
|
|
|
457
493
|
return Number(o[1]);
|
|
458
494
|
}
|
|
459
495
|
}
|
|
460
|
-
function
|
|
461
|
-
const t =
|
|
462
|
-
return t !== void 0 &&
|
|
496
|
+
function mo(e) {
|
|
497
|
+
const t = po(e);
|
|
498
|
+
return t !== void 0 && uo.has(t);
|
|
463
499
|
}
|
|
464
|
-
function
|
|
500
|
+
function ho({
|
|
465
501
|
attempt: e,
|
|
466
502
|
baseDelayMs: t,
|
|
467
503
|
maxDelayMs: o
|
|
@@ -469,35 +505,35 @@ function co({
|
|
|
469
505
|
const r = t * 2 ** e;
|
|
470
506
|
return Math.min(r, o);
|
|
471
507
|
}
|
|
472
|
-
function
|
|
508
|
+
function fo(e) {
|
|
473
509
|
return new Promise((t) => setTimeout(t, e));
|
|
474
510
|
}
|
|
475
|
-
async function
|
|
476
|
-
const o = t.maxRetries ??
|
|
511
|
+
async function bo(e, t = {}) {
|
|
512
|
+
const o = t.maxRetries ?? io, r = t.baseDelayMs ?? co, n = t.maxDelayMs ?? lo;
|
|
477
513
|
let a;
|
|
478
514
|
for (let i = 0; i <= o; i++)
|
|
479
515
|
try {
|
|
480
516
|
return await e();
|
|
481
517
|
} catch (c) {
|
|
482
|
-
if (a = c, i < o &&
|
|
483
|
-
const d =
|
|
484
|
-
await
|
|
518
|
+
if (a = c, i < o && mo(c)) {
|
|
519
|
+
const d = ho({ attempt: i, baseDelayMs: r, maxDelayMs: n });
|
|
520
|
+
await fo(d);
|
|
485
521
|
continue;
|
|
486
522
|
}
|
|
487
523
|
throw c;
|
|
488
524
|
}
|
|
489
525
|
throw a;
|
|
490
526
|
}
|
|
491
|
-
function
|
|
527
|
+
function ze(e) {
|
|
492
528
|
if (e == null)
|
|
493
529
|
return e;
|
|
494
530
|
if (Array.isArray(e))
|
|
495
|
-
return e.map((t) =>
|
|
531
|
+
return e.map((t) => ze(t));
|
|
496
532
|
if (typeof e == "object") {
|
|
497
533
|
const t = {};
|
|
498
534
|
for (const [o, r] of Object.entries(e))
|
|
499
535
|
if (r !== null) {
|
|
500
|
-
const n =
|
|
536
|
+
const n = ze(r);
|
|
501
537
|
if (n !== null && typeof n == "object" && !Array.isArray(n) && Object.keys(n).length === 0)
|
|
502
538
|
continue;
|
|
503
539
|
t[o] = n;
|
|
@@ -572,60 +608,60 @@ const f = {
|
|
|
572
608
|
// OpenAI MCP tools
|
|
573
609
|
SEARCH: "search",
|
|
574
610
|
FETCH: "fetch"
|
|
575
|
-
},
|
|
611
|
+
}, dd = {
|
|
576
612
|
/**
|
|
577
613
|
* Strips email addresses from tool outputs that expose user data.
|
|
578
614
|
* Affects: find-project-collaborators, find-completed-tasks
|
|
579
615
|
*/
|
|
580
616
|
STRIP_EMAILS: "strip_emails"
|
|
581
|
-
},
|
|
582
|
-
function
|
|
617
|
+
}, go = process.env.USE_STRUCTURED_CONTENT === "true" || process.env.NODE_ENV === "test";
|
|
618
|
+
function yo({
|
|
583
619
|
textContent: e,
|
|
584
620
|
structuredContent: t,
|
|
585
621
|
contentItems: o
|
|
586
622
|
}) {
|
|
587
|
-
const r =
|
|
588
|
-
return o && a.push(...o), !
|
|
623
|
+
const r = ze(t), n = {}, a = [];
|
|
624
|
+
return o && a.push(...o), !go && t && a.push({
|
|
589
625
|
type: "text",
|
|
590
626
|
text: JSON.stringify(r)
|
|
591
627
|
}), e && a.push({ type: "text", text: e }), a.length > 0 && (n.content = a), t && (n.structuredContent = r), n;
|
|
592
628
|
}
|
|
593
|
-
function
|
|
629
|
+
function ko(e) {
|
|
594
630
|
return {
|
|
595
631
|
content: [{ type: "text", text: e }],
|
|
596
632
|
isError: !0
|
|
597
633
|
};
|
|
598
634
|
}
|
|
599
|
-
function
|
|
635
|
+
function To(e) {
|
|
600
636
|
return { ...{
|
|
601
|
-
title: `Todoist: ${
|
|
637
|
+
title: `Todoist: ${wo(e.name)}`,
|
|
602
638
|
openWorldHint: !1
|
|
603
639
|
}, ...e.annotations };
|
|
604
640
|
}
|
|
605
|
-
function
|
|
641
|
+
function wo(e) {
|
|
606
642
|
return e.split("-").filter(Boolean).map((t) => `${t.charAt(0).toUpperCase()}${t.slice(1)}`).join(" ");
|
|
607
643
|
}
|
|
608
|
-
function
|
|
644
|
+
function vo(e) {
|
|
609
645
|
return e ? typeof e["ui/resourceUri"] == "string" ? !0 : typeof e.ui == "object" && e.ui !== null : !1;
|
|
610
646
|
}
|
|
611
|
-
const
|
|
647
|
+
const Io = [
|
|
612
648
|
f.FIND_PROJECT_COLLABORATORS,
|
|
613
649
|
f.FIND_COMPLETED_TASKS
|
|
614
650
|
];
|
|
615
|
-
function
|
|
651
|
+
function Ke(e) {
|
|
616
652
|
if (e == null)
|
|
617
653
|
return e;
|
|
618
654
|
if (Array.isArray(e))
|
|
619
|
-
return e.map((t) =>
|
|
655
|
+
return e.map((t) => Ke(t));
|
|
620
656
|
if (typeof e == "object") {
|
|
621
657
|
const t = {};
|
|
622
658
|
for (const [o, r] of Object.entries(e))
|
|
623
|
-
o !== "email" && (t[o] =
|
|
659
|
+
o !== "email" && (t[o] = Ke(r));
|
|
624
660
|
return t;
|
|
625
661
|
}
|
|
626
662
|
return e;
|
|
627
663
|
}
|
|
628
|
-
function
|
|
664
|
+
function jo(e) {
|
|
629
665
|
const t = /\s*\([^)]*@[^)]+\)/g, o = /\S+@\S+\.\S+/g;
|
|
630
666
|
return e.replace(t, "").replace(o, "[email hidden]");
|
|
631
667
|
}
|
|
@@ -635,27 +671,27 @@ function g({
|
|
|
635
671
|
client: o,
|
|
636
672
|
features: r = []
|
|
637
673
|
}) {
|
|
638
|
-
const n = r.some((c) => c.name === "strip_emails") &&
|
|
674
|
+
const n = r.some((c) => c.name === "strip_emails") && Io.includes(e.name), a = async (c, d) => {
|
|
639
675
|
try {
|
|
640
|
-
let { textContent: l, structuredContent: p, contentItems: u } = await
|
|
676
|
+
let { textContent: l, structuredContent: p, contentItems: u } = await Xs(
|
|
641
677
|
e.name,
|
|
642
|
-
() =>
|
|
678
|
+
() => bo(
|
|
643
679
|
() => e.execute(c, o)
|
|
644
680
|
)
|
|
645
681
|
);
|
|
646
|
-
return n && (l && (l =
|
|
682
|
+
return n && (l && (l = jo(l)), p && (p = Ke(p))), yo({ textContent: l, structuredContent: p, contentItems: u });
|
|
647
683
|
} catch (l) {
|
|
648
|
-
return console.error(`Error executing tool ${e.name}:`, { args: c, error: l }),
|
|
684
|
+
return console.error(`Error executing tool ${e.name}:`, { args: c, error: l }), ko(Bs(l));
|
|
649
685
|
}
|
|
650
686
|
}, i = {
|
|
651
687
|
description: e.description,
|
|
652
688
|
inputSchema: e.parameters,
|
|
653
689
|
...e.outputSchema ? { outputSchema: e.outputSchema } : {},
|
|
654
|
-
annotations:
|
|
690
|
+
annotations: To(e),
|
|
655
691
|
...e._meta ? { _meta: e._meta } : {}
|
|
656
692
|
};
|
|
657
|
-
if (
|
|
658
|
-
|
|
693
|
+
if (vo(e._meta)) {
|
|
694
|
+
ys(
|
|
659
695
|
t,
|
|
660
696
|
e.name,
|
|
661
697
|
{
|
|
@@ -668,7 +704,7 @@ function g({
|
|
|
668
704
|
}
|
|
669
705
|
t.registerTool(e.name, i, a);
|
|
670
706
|
}
|
|
671
|
-
const
|
|
707
|
+
const So = {
|
|
672
708
|
period: s.enum(["today", "7d", "14d", "30d", "this-week", "this-month"]).default("7d").describe(
|
|
673
709
|
'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.'
|
|
674
710
|
),
|
|
@@ -677,7 +713,7 @@ const To = {
|
|
|
677
713
|
),
|
|
678
714
|
projectId: s.string().optional().describe("Optional project ID to scope the analysis to a specific project.")
|
|
679
715
|
};
|
|
680
|
-
function
|
|
716
|
+
function Co(e, t = /* @__PURE__ */ new Date()) {
|
|
681
717
|
const o = (n) => n.toISOString().slice(0, 10), r = o(t);
|
|
682
718
|
switch (e) {
|
|
683
719
|
case "today":
|
|
@@ -724,7 +760,7 @@ function wo(e, t = /* @__PURE__ */ new Date()) {
|
|
|
724
760
|
}
|
|
725
761
|
}
|
|
726
762
|
}
|
|
727
|
-
function
|
|
763
|
+
function $o(e) {
|
|
728
764
|
const t = {
|
|
729
765
|
goals: `### Goal Tracking
|
|
730
766
|
- Compare tasks completed today vs the daily goal
|
|
@@ -755,8 +791,8 @@ function vo(e) {
|
|
|
755
791
|
|
|
756
792
|
`) : t[e] ?? "";
|
|
757
793
|
}
|
|
758
|
-
function
|
|
759
|
-
const { since: t, until: o, periodDescription: r } =
|
|
794
|
+
function Do(e) {
|
|
795
|
+
const { since: t, until: o, periodDescription: r } = Co(e.period), n = e.projectId ? `
|
|
760
796
|
Scope this analysis to project ID: ${e.projectId}. Pass this projectId when calling find-completed-tasks and get-overview.` : "";
|
|
761
797
|
return `Analyze my Todoist productivity for ${r} (${t} to ${o}).${n}
|
|
762
798
|
|
|
@@ -777,7 +813,7 @@ ${e.focus === "overall" || e.focus === "projects" ? `4. **get-overview** — Get
|
|
|
777
813
|
|
|
778
814
|
Using the collected data, produce an analysis covering the following sections:
|
|
779
815
|
|
|
780
|
-
${
|
|
816
|
+
${$o(e.focus)}
|
|
781
817
|
|
|
782
818
|
### Step 3: Format
|
|
783
819
|
|
|
@@ -787,14 +823,14 @@ Present the analysis as a clear, well-structured markdown report with:
|
|
|
787
823
|
- Specific numbers and comparisons (not vague statements)
|
|
788
824
|
- Actionable takeaways highlighted clearly`;
|
|
789
825
|
}
|
|
790
|
-
function
|
|
826
|
+
function Ao(e) {
|
|
791
827
|
return {
|
|
792
828
|
messages: [
|
|
793
829
|
{
|
|
794
830
|
role: "user",
|
|
795
831
|
content: {
|
|
796
832
|
type: "text",
|
|
797
|
-
text:
|
|
833
|
+
text: Do(e)
|
|
798
834
|
}
|
|
799
835
|
}
|
|
800
836
|
]
|
|
@@ -804,8 +840,8 @@ const me = {
|
|
|
804
840
|
name: "productivity-analysis",
|
|
805
841
|
title: "Productivity Analysis",
|
|
806
842
|
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.",
|
|
807
|
-
argsSchema:
|
|
808
|
-
callback:
|
|
843
|
+
argsSchema: So,
|
|
844
|
+
callback: Ao
|
|
809
845
|
}, j = {
|
|
810
846
|
/** Default limit for task listings */
|
|
811
847
|
TASKS_DEFAULT: 10,
|
|
@@ -848,7 +884,7 @@ class U extends Error {
|
|
|
848
884
|
super(`Invalid duration format "${t}": ${o}`), this.name = "DurationParseError";
|
|
849
885
|
}
|
|
850
886
|
}
|
|
851
|
-
function
|
|
887
|
+
function Wt(e) {
|
|
852
888
|
if (!e || typeof e != "string")
|
|
853
889
|
throw new U(e, "Duration must be a non-empty string");
|
|
854
890
|
const t = e.trim().toLowerCase().replace(/\s+/g, "");
|
|
@@ -882,20 +918,20 @@ function Lt(e) {
|
|
|
882
918
|
throw new U(e, "Duration cannot exceed 24 hours (1440 minutes)");
|
|
883
919
|
return { minutes: r };
|
|
884
920
|
}
|
|
885
|
-
function
|
|
921
|
+
function xo(e) {
|
|
886
922
|
if (e <= 0) return "0m";
|
|
887
923
|
const t = Math.floor(e / 60), o = e % 60;
|
|
888
924
|
return t === 0 ? `${o}m` : o === 0 ? `${t}h` : `${t}h${o}m`;
|
|
889
925
|
}
|
|
890
|
-
const
|
|
891
|
-
function
|
|
926
|
+
const Eo = ["p1", "p2", "p3", "p4"], Qe = 'Task priority as a string: "p1" (highest), "p2" (high), "p3" (medium), or "p4" (lowest/default). Integers like 1, 2, 3, or 4 are not accepted.', et = s.enum(Eo).describe(Qe);
|
|
927
|
+
function Gt(e) {
|
|
892
928
|
return { p1: 4, p2: 3, p3: 2, p4: 1 }[e];
|
|
893
929
|
}
|
|
894
|
-
function
|
|
930
|
+
function Oo(e) {
|
|
895
931
|
return { 4: "p1", 3: "p2", 2: "p3", 1: "p4" }[e];
|
|
896
932
|
}
|
|
897
|
-
const E = /* @__PURE__ */ new Map(), te = /* @__PURE__ */ new Map(), Ue = 300 * 1e3,
|
|
898
|
-
class
|
|
933
|
+
const E = /* @__PURE__ */ new Map(), te = /* @__PURE__ */ new Map(), Ue = 300 * 1e3, Uo = "me";
|
|
934
|
+
class Po {
|
|
899
935
|
/**
|
|
900
936
|
* Resolve a user name or ID to a user ID by looking up collaborators across all shared projects.
|
|
901
937
|
* Supports exact name matches, partial matches, email matches, and the "me" keyword.
|
|
@@ -906,7 +942,7 @@ class Ao {
|
|
|
906
942
|
const r = o.trim(), n = E.get(r);
|
|
907
943
|
if (n && Date.now() - n.timestamp < Ue)
|
|
908
944
|
return n.result;
|
|
909
|
-
if (r.toLowerCase() ===
|
|
945
|
+
if (r.toLowerCase() === Uo)
|
|
910
946
|
try {
|
|
911
947
|
const a = await t.getUser();
|
|
912
948
|
return {
|
|
@@ -1030,15 +1066,15 @@ class Ao {
|
|
|
1030
1066
|
E.clear(), te.clear();
|
|
1031
1067
|
}
|
|
1032
1068
|
}
|
|
1033
|
-
const G = new
|
|
1034
|
-
async function
|
|
1069
|
+
const G = new Po();
|
|
1070
|
+
async function _o(e, t) {
|
|
1035
1071
|
return G.resolveUser(e, t);
|
|
1036
1072
|
}
|
|
1037
|
-
const
|
|
1038
|
-
async function
|
|
1073
|
+
const Bt = ["assigned", "unassignedOrMe", "all"];
|
|
1074
|
+
async function tt(e, t) {
|
|
1039
1075
|
if (!t)
|
|
1040
1076
|
return;
|
|
1041
|
-
const o = await
|
|
1077
|
+
const o = await _o(e, t);
|
|
1042
1078
|
if (!o)
|
|
1043
1079
|
throw new Error(
|
|
1044
1080
|
`Could not find user: "${t}". Make sure the user is a collaborator on a shared project.`
|
|
@@ -1048,14 +1084,14 @@ async function Qe(e, t) {
|
|
|
1048
1084
|
function ae(e, t) {
|
|
1049
1085
|
return t.length === 0 ? e : e.length === 0 ? t : `${e} & ${t}`;
|
|
1050
1086
|
}
|
|
1051
|
-
function
|
|
1087
|
+
function Yt({
|
|
1052
1088
|
resolvedAssigneeId: e,
|
|
1053
1089
|
assigneeEmail: t,
|
|
1054
1090
|
responsibleUserFiltering: o = "unassignedOrMe"
|
|
1055
1091
|
}) {
|
|
1056
1092
|
return e && t ? `assigned to: ${t}` : o === "unassignedOrMe" ? "!assigned to: others" : o === "assigned" ? "assigned to: others" : "";
|
|
1057
1093
|
}
|
|
1058
|
-
function
|
|
1094
|
+
function Ro({
|
|
1059
1095
|
tasks: e,
|
|
1060
1096
|
resolvedAssigneeId: t,
|
|
1061
1097
|
currentUserId: o,
|
|
@@ -1088,31 +1124,31 @@ async function L(e) {
|
|
|
1088
1124
|
} while (a !== null);
|
|
1089
1125
|
return n;
|
|
1090
1126
|
}
|
|
1091
|
-
function
|
|
1127
|
+
function st(e) {
|
|
1092
1128
|
return /(?<!\\)(?:\\\\)*\*/.test(e) ? e : `*${e.replaceAll(/\\(?!\*)/g, "\\\\")}*`;
|
|
1093
1129
|
}
|
|
1094
|
-
async function
|
|
1130
|
+
async function qt(e, t) {
|
|
1095
1131
|
return L({
|
|
1096
1132
|
apiMethod: e.searchProjects.bind(e),
|
|
1097
|
-
args: { query:
|
|
1133
|
+
args: { query: st(t) },
|
|
1098
1134
|
limit: j.PROJECTS_MAX
|
|
1099
1135
|
});
|
|
1100
1136
|
}
|
|
1101
|
-
async function
|
|
1137
|
+
async function No(e) {
|
|
1102
1138
|
return L({
|
|
1103
1139
|
apiMethod: e.getProjects.bind(e),
|
|
1104
1140
|
args: {},
|
|
1105
1141
|
limit: j.PROJECTS_MAX
|
|
1106
1142
|
});
|
|
1107
1143
|
}
|
|
1108
|
-
async function
|
|
1144
|
+
async function Lo(e) {
|
|
1109
1145
|
return L({
|
|
1110
1146
|
apiMethod: e.getArchivedProjects.bind(e),
|
|
1111
1147
|
args: {},
|
|
1112
1148
|
limit: j.PROJECTS_MAX
|
|
1113
1149
|
});
|
|
1114
1150
|
}
|
|
1115
|
-
function
|
|
1151
|
+
function Mo(e) {
|
|
1116
1152
|
const t = (a) => a.replaceAll(/[.*+?^${}()|[\]\\]/g, "\\$&"), o = /(?<!\\)(?:\\\\)*\*/.test(e), r = [...e];
|
|
1117
1153
|
let n = "";
|
|
1118
1154
|
for (let a = 0; a < r.length; a++) {
|
|
@@ -1121,29 +1157,29 @@ function Po(e) {
|
|
|
1121
1157
|
}
|
|
1122
1158
|
return new RegExp(o ? `^${n}$` : n, "iu");
|
|
1123
1159
|
}
|
|
1124
|
-
async function
|
|
1160
|
+
async function Fo(e, t) {
|
|
1125
1161
|
return L({
|
|
1126
1162
|
apiMethod: e.searchLabels.bind(e),
|
|
1127
|
-
args: { query:
|
|
1163
|
+
args: { query: st(t) },
|
|
1128
1164
|
limit: j.LABELS_MAX
|
|
1129
1165
|
});
|
|
1130
1166
|
}
|
|
1131
|
-
async function
|
|
1167
|
+
async function Ho(e) {
|
|
1132
1168
|
return L({
|
|
1133
1169
|
apiMethod: e.getSharedLabels.bind(e),
|
|
1134
1170
|
args: {},
|
|
1135
1171
|
limit: j.LABELS_MAX
|
|
1136
1172
|
});
|
|
1137
1173
|
}
|
|
1138
|
-
async function
|
|
1139
|
-
const r =
|
|
1174
|
+
async function Wo(e, t, o) {
|
|
1175
|
+
const r = st(t);
|
|
1140
1176
|
return L({
|
|
1141
1177
|
apiMethod: e.searchSections.bind(e),
|
|
1142
1178
|
args: o ? { query: r, projectId: o } : { query: r },
|
|
1143
1179
|
limit: j.SECTIONS_MAX
|
|
1144
1180
|
});
|
|
1145
1181
|
}
|
|
1146
|
-
function
|
|
1182
|
+
function Go(e, t, o, r) {
|
|
1147
1183
|
const n = [t, o, r].filter(Boolean);
|
|
1148
1184
|
if (n.length > 1)
|
|
1149
1185
|
throw new Error(
|
|
@@ -1166,16 +1202,17 @@ function _(e) {
|
|
|
1166
1202
|
dueDate: e.due?.date,
|
|
1167
1203
|
recurring: e.due?.isRecurring && e.due.string ? e.due.string : !1,
|
|
1168
1204
|
deadlineDate: e.deadline?.date,
|
|
1169
|
-
priority:
|
|
1205
|
+
priority: Oo(e.priority) ?? "p4",
|
|
1170
1206
|
projectId: e.projectId,
|
|
1171
1207
|
sectionId: e.sectionId ?? void 0,
|
|
1172
1208
|
parentId: e.parentId ?? void 0,
|
|
1173
1209
|
labels: e.labels,
|
|
1174
|
-
duration: e.duration ?
|
|
1210
|
+
duration: e.duration ? xo(e.duration.amount) : void 0,
|
|
1175
1211
|
responsibleUid: e.responsibleUid ?? void 0,
|
|
1176
1212
|
assignedByUid: e.assignedByUid ?? void 0,
|
|
1177
1213
|
checked: e.checked,
|
|
1178
|
-
completedAt: e.completedAt?.toISOString() ?? void 0
|
|
1214
|
+
completedAt: e.completedAt?.toISOString() ?? void 0,
|
|
1215
|
+
addedAt: e.addedAt?.toISOString() ?? void 0
|
|
1179
1216
|
};
|
|
1180
1217
|
}
|
|
1181
1218
|
function V(e) {
|
|
@@ -1232,7 +1269,7 @@ function ve(e) {
|
|
|
1232
1269
|
progress: e.progress
|
|
1233
1270
|
};
|
|
1234
1271
|
}
|
|
1235
|
-
function
|
|
1272
|
+
function Bo(e) {
|
|
1236
1273
|
return {
|
|
1237
1274
|
id: e.id ?? void 0,
|
|
1238
1275
|
objectType: e.objectType,
|
|
@@ -1245,7 +1282,7 @@ function Mo(e) {
|
|
|
1245
1282
|
extraData: e.extraData ?? void 0
|
|
1246
1283
|
};
|
|
1247
1284
|
}
|
|
1248
|
-
const
|
|
1285
|
+
const Yo = Q.object({
|
|
1249
1286
|
httpStatusCode: Q.number(),
|
|
1250
1287
|
responseData: Q.object({
|
|
1251
1288
|
error: Q.string(),
|
|
@@ -1253,7 +1290,7 @@ const Fo = Q.object({
|
|
|
1253
1290
|
errorTag: Q.string()
|
|
1254
1291
|
})
|
|
1255
1292
|
});
|
|
1256
|
-
async function
|
|
1293
|
+
async function ot({
|
|
1257
1294
|
client: e,
|
|
1258
1295
|
query: t,
|
|
1259
1296
|
limit: o,
|
|
@@ -1263,7 +1300,7 @@ async function tt({
|
|
|
1263
1300
|
const { results: n, nextCursor: a } = await e.getTasksByFilter({ query: t, cursor: r, limit: o });
|
|
1264
1301
|
return { tasks: n.map(_), nextCursor: a };
|
|
1265
1302
|
} catch (n) {
|
|
1266
|
-
const a =
|
|
1303
|
+
const a = Yo.safeParse(n);
|
|
1267
1304
|
if (!a.success)
|
|
1268
1305
|
throw n;
|
|
1269
1306
|
const { responseData: i } = a.data;
|
|
@@ -1272,7 +1309,7 @@ async function tt({
|
|
|
1272
1309
|
);
|
|
1273
1310
|
}
|
|
1274
1311
|
}
|
|
1275
|
-
function
|
|
1312
|
+
function ft(e) {
|
|
1276
1313
|
return {
|
|
1277
1314
|
isRecurring: e.isRecurring,
|
|
1278
1315
|
string: e.string,
|
|
@@ -1292,13 +1329,13 @@ function he(e) {
|
|
|
1292
1329
|
return {
|
|
1293
1330
|
...t,
|
|
1294
1331
|
minuteOffset: e.minuteOffset,
|
|
1295
|
-
due: e.due ?
|
|
1332
|
+
due: e.due ? ft(e.due) : void 0,
|
|
1296
1333
|
isUrgent: e.isUrgent
|
|
1297
1334
|
};
|
|
1298
1335
|
case "absolute":
|
|
1299
1336
|
return {
|
|
1300
1337
|
...t,
|
|
1301
|
-
due:
|
|
1338
|
+
due: ft(e.due),
|
|
1302
1339
|
isUrgent: e.isUrgent
|
|
1303
1340
|
};
|
|
1304
1341
|
case "location":
|
|
@@ -1312,19 +1349,19 @@ function he(e) {
|
|
|
1312
1349
|
};
|
|
1313
1350
|
}
|
|
1314
1351
|
}
|
|
1315
|
-
function
|
|
1352
|
+
function zt(e) {
|
|
1316
1353
|
const t = e.filter(
|
|
1317
1354
|
(r) => r.type === "relative" || r.type === "absolute"
|
|
1318
1355
|
).length, o = e.filter((r) => r.type === "location").length;
|
|
1319
1356
|
return { timeBasedCount: t, locationCount: o };
|
|
1320
1357
|
}
|
|
1321
1358
|
const Ie = Me.map((e) => e.key);
|
|
1322
|
-
function
|
|
1359
|
+
function qo(e) {
|
|
1323
1360
|
if (typeof e != "string") return;
|
|
1324
1361
|
const t = e.toLowerCase();
|
|
1325
1362
|
return (Me.find((r) => r.key === t) ?? Me.find((r) => r.displayName.toLowerCase() === t))?.key;
|
|
1326
1363
|
}
|
|
1327
|
-
const
|
|
1364
|
+
const zo = `Color for the entity. Accepts a color key (e.g. "berry_red") or display name (e.g. "Berry Red"). Valid colors: ${Ie.join(", ")}. Unrecognized colors are omitted and charcoal will be used as the default.`, de = s.preprocess(qo, s.enum(Ie).optional()).describe(zo);
|
|
1328
1365
|
s.enum(Ie).describe("The color key of the entity.");
|
|
1329
1366
|
const le = s.enum(Ie).optional().catch(void 0).describe("The color key of the entity."), J = s.object({
|
|
1330
1367
|
id: s.string().describe("The unique ID of the task."),
|
|
@@ -1333,7 +1370,7 @@ const le = s.enum(Ie).optional().catch(void 0).describe("The color key of the en
|
|
|
1333
1370
|
dueDate: s.string().optional().describe("The due date of the task (ISO 8601 format)."),
|
|
1334
1371
|
recurring: s.union([s.boolean(), s.string()]).describe("Whether the task is recurring, or the recurrence string."),
|
|
1335
1372
|
deadlineDate: s.string().optional().describe("The deadline date of the task (ISO 8601 format)."),
|
|
1336
|
-
priority:
|
|
1373
|
+
priority: et.describe(
|
|
1337
1374
|
"The priority level: p1 (highest), p2 (high), p3 (medium), p4 (lowest)."
|
|
1338
1375
|
),
|
|
1339
1376
|
projectId: s.string().describe("The ID of the project this task belongs to."),
|
|
@@ -1345,7 +1382,8 @@ const le = s.enum(Ie).optional().catch(void 0).describe("The color key of the en
|
|
|
1345
1382
|
isUncompletable: s.boolean().optional().describe("Whether the task is uncompletable (organizational header)."),
|
|
1346
1383
|
assignedByUid: s.string().optional().describe("The UID of the user who assigned this task."),
|
|
1347
1384
|
checked: s.boolean().describe("Whether the task is checked/completed."),
|
|
1348
|
-
completedAt: s.string().optional().describe("When the task was completed (ISO 8601 format).")
|
|
1385
|
+
completedAt: s.string().optional().describe("When the task was completed (ISO 8601 format)."),
|
|
1386
|
+
addedAt: s.string().optional().describe("When the task was created (ISO 8601 format).")
|
|
1349
1387
|
}), ue = s.object({
|
|
1350
1388
|
id: s.string().describe("The unique ID of the project."),
|
|
1351
1389
|
name: s.string().describe("The name of the project."),
|
|
@@ -1370,7 +1408,7 @@ const le = s.enum(Ie).optional().catch(void 0).describe("The color key of the en
|
|
|
1370
1408
|
function X({ id: e, name: t, description: o }) {
|
|
1371
1409
|
return { id: e, name: t, description: o ?? void 0 };
|
|
1372
1410
|
}
|
|
1373
|
-
const
|
|
1411
|
+
const Ko = s.object({
|
|
1374
1412
|
resourceType: s.string().describe("The type of resource (file, url, image, etc)."),
|
|
1375
1413
|
fileName: s.string().optional().describe("The name of the file."),
|
|
1376
1414
|
fileSize: s.number().optional().describe("The size of the file in bytes."),
|
|
@@ -1390,8 +1428,8 @@ const Go = s.object({
|
|
|
1390
1428
|
content: s.string().describe("The content of the comment."),
|
|
1391
1429
|
postedAt: s.string().describe("When the comment was posted (ISO 8601 format)."),
|
|
1392
1430
|
postedUid: s.string().optional().describe("The UID of the user who posted this comment."),
|
|
1393
|
-
fileAttachment:
|
|
1394
|
-
}),
|
|
1431
|
+
fileAttachment: Ko.optional().describe("File attachment information, if any.")
|
|
1432
|
+
}), Vo = s.object({
|
|
1395
1433
|
id: s.string().optional().describe("The unique ID of the activity event."),
|
|
1396
1434
|
objectType: s.string().describe("The type of object this event relates to (task, project, etc)."),
|
|
1397
1435
|
objectId: s.string().describe("The ID of the object this event relates to."),
|
|
@@ -1401,7 +1439,7 @@ const Go = s.object({
|
|
|
1401
1439
|
parentItemId: s.string().optional().describe("The ID of the parent item."),
|
|
1402
1440
|
initiatorId: s.string().optional().describe("The ID of the user who initiated this event."),
|
|
1403
1441
|
extraData: s.record(s.string(), s.unknown()).optional().describe("Additional event data.")
|
|
1404
|
-
}),
|
|
1442
|
+
}), Jo = s.object({
|
|
1405
1443
|
id: s.string().describe("The unique ID of the user."),
|
|
1406
1444
|
name: s.string().describe("The full name of the user."),
|
|
1407
1445
|
email: s.string().describe("The email address of the user.")
|
|
@@ -1411,24 +1449,24 @@ const Go = s.object({
|
|
|
1411
1449
|
color: le,
|
|
1412
1450
|
order: s.number().optional().catch(void 0).describe("The display order of the label."),
|
|
1413
1451
|
isFavorite: s.boolean().describe("Whether the label is marked as favorite.")
|
|
1414
|
-
}),
|
|
1452
|
+
}), Xo = s.object({
|
|
1415
1453
|
isRecurring: s.boolean().describe("Whether this is a recurring reminder."),
|
|
1416
1454
|
string: s.string().describe("Human-readable due string."),
|
|
1417
1455
|
date: s.string().describe("Due date in ISO format."),
|
|
1418
1456
|
datetime: s.string().optional().describe("Due datetime in ISO format."),
|
|
1419
1457
|
timezone: s.string().optional().describe("Timezone of the reminder.")
|
|
1420
|
-
}),
|
|
1458
|
+
}), rt = s.object({
|
|
1421
1459
|
id: s.string().describe("The unique ID of the reminder."),
|
|
1422
1460
|
taskId: s.string().describe("The task ID this reminder belongs to."),
|
|
1423
|
-
type: s.enum(
|
|
1461
|
+
type: s.enum(Is).describe("The type of reminder: relative, absolute, or location."),
|
|
1424
1462
|
minuteOffset: s.number().optional().describe("Minutes before due time to trigger (relative reminders only)."),
|
|
1425
|
-
due:
|
|
1463
|
+
due: Xo.optional().describe(
|
|
1426
1464
|
"Due date info (absolute and sometimes relative reminders)."
|
|
1427
1465
|
),
|
|
1428
1466
|
name: s.string().optional().describe("Location name (location reminders only)."),
|
|
1429
1467
|
locLat: s.string().optional().describe("Latitude (location reminders only)."),
|
|
1430
1468
|
locLong: s.string().optional().describe("Longitude (location reminders only)."),
|
|
1431
|
-
locTrigger: s.enum(
|
|
1469
|
+
locTrigger: s.enum(Ut).optional().describe("Trigger type: on_enter or on_leave (location reminders only)."),
|
|
1432
1470
|
radius: s.number().optional().describe("Geofence radius in meters (location reminders only)."),
|
|
1433
1471
|
isUrgent: s.boolean().optional().describe("Whether this is an urgent reminder (relative and absolute reminders only).")
|
|
1434
1472
|
}), Se = s.object({
|
|
@@ -1449,23 +1487,23 @@ const Go = s.object({
|
|
|
1449
1487
|
item: s.string().describe("The item that failed (usually an ID or identifier)."),
|
|
1450
1488
|
error: s.string().describe("The error message."),
|
|
1451
1489
|
code: s.string().optional().describe("The error code, if available.")
|
|
1452
|
-
}),
|
|
1490
|
+
}), Zo = s.object({
|
|
1453
1491
|
taskId: s.string().optional().describe("The ID of the task to comment on."),
|
|
1454
1492
|
projectId: s.string().optional().describe(
|
|
1455
1493
|
'The ID of the project to comment on. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
1456
1494
|
),
|
|
1457
1495
|
content: s.string().min(1).describe("The content of the comment.")
|
|
1458
|
-
}),
|
|
1459
|
-
comments: s.array(
|
|
1460
|
-
},
|
|
1496
|
+
}), Qo = {
|
|
1497
|
+
comments: s.array(Zo).min(1).describe("The array of comments to add.")
|
|
1498
|
+
}, er = {
|
|
1461
1499
|
comments: s.array(je).describe("The created comments."),
|
|
1462
1500
|
totalCount: s.number().describe("The total number of comments created."),
|
|
1463
1501
|
addedCommentIds: s.array(s.string()).describe("The IDs of the added comments.")
|
|
1464
|
-
},
|
|
1502
|
+
}, tr = {
|
|
1465
1503
|
name: f.ADD_COMMENTS,
|
|
1466
1504
|
description: "Add multiple comments to tasks or projects. Each comment must specify either taskId or projectId.",
|
|
1467
|
-
parameters:
|
|
1468
|
-
outputSchema:
|
|
1505
|
+
parameters: Qo,
|
|
1506
|
+
outputSchema: er,
|
|
1469
1507
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1470
1508
|
async execute(e, t) {
|
|
1471
1509
|
const { comments: o } = e;
|
|
@@ -1491,7 +1529,7 @@ const Go = s.object({
|
|
|
1491
1529
|
});
|
|
1492
1530
|
}), c = (await Promise.all(a)).map(we);
|
|
1493
1531
|
return {
|
|
1494
|
-
textContent:
|
|
1532
|
+
textContent: sr({ comments: c }),
|
|
1495
1533
|
structuredContent: {
|
|
1496
1534
|
comments: c,
|
|
1497
1535
|
totalCount: c.length,
|
|
@@ -1500,7 +1538,7 @@ const Go = s.object({
|
|
|
1500
1538
|
};
|
|
1501
1539
|
}
|
|
1502
1540
|
};
|
|
1503
|
-
function
|
|
1541
|
+
function sr({ comments: e }) {
|
|
1504
1542
|
const t = e.filter((a) => a.taskId).length, o = e.filter((a) => a.projectId).length, r = [];
|
|
1505
1543
|
if (t > 0) {
|
|
1506
1544
|
const a = t > 1 ? "comments" : "comment";
|
|
@@ -1512,25 +1550,25 @@ function Xo({ comments: e }) {
|
|
|
1512
1550
|
}
|
|
1513
1551
|
return r.length > 0 ? `Added ${r.join(" and ")}` : "No comments added";
|
|
1514
1552
|
}
|
|
1515
|
-
const
|
|
1553
|
+
const or = {
|
|
1516
1554
|
search: s.string().optional().describe(
|
|
1517
1555
|
"Search for a filter by name (partial and case insensitive match). If omitted, all filters are returned."
|
|
1518
1556
|
)
|
|
1519
|
-
},
|
|
1557
|
+
}, nt = s.object({
|
|
1520
1558
|
id: s.string().describe("The unique ID of the filter."),
|
|
1521
1559
|
name: s.string().describe("The name of the filter."),
|
|
1522
1560
|
query: s.string().describe('The filter query string (e.g. "today & p1", "#Work & overdue").'),
|
|
1523
1561
|
color: le,
|
|
1524
1562
|
isFavorite: s.boolean().describe("Whether the filter is marked as favorite."),
|
|
1525
1563
|
itemOrder: s.number().describe("The display order of the filter.")
|
|
1526
|
-
}),
|
|
1527
|
-
filters: s.array(
|
|
1564
|
+
}), rr = {
|
|
1565
|
+
filters: s.array(nt).describe("The found filters."),
|
|
1528
1566
|
totalCount: s.number().describe("The total number of filters returned.")
|
|
1529
|
-
},
|
|
1567
|
+
}, nr = {
|
|
1530
1568
|
name: f.FIND_FILTERS,
|
|
1531
1569
|
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").',
|
|
1532
|
-
parameters:
|
|
1533
|
-
outputSchema:
|
|
1570
|
+
parameters: or,
|
|
1571
|
+
outputSchema: rr,
|
|
1534
1572
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
1535
1573
|
async execute(e, t) {
|
|
1536
1574
|
let r = ((await t.sync({ resourceTypes: ["filters"], syncToken: "*" })).filters ?? []).filter((i) => !i.isDeleted);
|
|
@@ -1548,7 +1586,7 @@ const Zo = {
|
|
|
1548
1586
|
itemOrder: i.itemOrder
|
|
1549
1587
|
}));
|
|
1550
1588
|
return {
|
|
1551
|
-
textContent:
|
|
1589
|
+
textContent: ar({ filters: n, search: e.search }),
|
|
1552
1590
|
structuredContent: {
|
|
1553
1591
|
filters: n,
|
|
1554
1592
|
totalCount: n.length
|
|
@@ -1556,7 +1594,7 @@ const Zo = {
|
|
|
1556
1594
|
};
|
|
1557
1595
|
}
|
|
1558
1596
|
};
|
|
1559
|
-
function
|
|
1597
|
+
function ar({
|
|
1560
1598
|
filters: e,
|
|
1561
1599
|
search: t
|
|
1562
1600
|
}) {
|
|
@@ -1577,23 +1615,23 @@ ${n.map((a) => `- ${a}`).join(`
|
|
|
1577
1615
|
return r.join(`
|
|
1578
1616
|
`);
|
|
1579
1617
|
}
|
|
1580
|
-
const
|
|
1618
|
+
const ir = s.object({
|
|
1581
1619
|
name: s.string().min(1).describe("The name of the filter."),
|
|
1582
1620
|
query: s.string().min(1).describe(
|
|
1583
1621
|
'The filter query string. Examples: "today & p1", "#Work & overdue", "@email & today", "(p1 | p2) & !assigned". Operators: | (OR), & (AND), ! (NOT), () grouping, , (multiple queries).'
|
|
1584
1622
|
),
|
|
1585
1623
|
color: de,
|
|
1586
1624
|
isFavorite: s.boolean().optional().describe("Whether to mark the filter as a favorite. Defaults to false.")
|
|
1587
|
-
}),
|
|
1588
|
-
filters: s.array(
|
|
1589
|
-
},
|
|
1590
|
-
filters: s.array(
|
|
1625
|
+
}), cr = {
|
|
1626
|
+
filters: s.array(ir).min(1).describe("The array of filters to add.")
|
|
1627
|
+
}, dr = {
|
|
1628
|
+
filters: s.array(nt).describe("The created filters."),
|
|
1591
1629
|
totalCount: s.number().describe("The total number of filters created.")
|
|
1592
|
-
},
|
|
1630
|
+
}, lr = {
|
|
1593
1631
|
name: f.ADD_FILTERS,
|
|
1594
1632
|
description: "Add one or more new personal filters. Filters are saved custom views using query syntax to organize tasks.",
|
|
1595
|
-
parameters:
|
|
1596
|
-
outputSchema:
|
|
1633
|
+
parameters: cr,
|
|
1634
|
+
outputSchema: dr,
|
|
1597
1635
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1598
1636
|
async execute({ filters: e }, t) {
|
|
1599
1637
|
const o = Date.now(), r = e.map((u, m) => `tempFilterAdd${m}${o}`), n = e.map((u, m) => q(
|
|
@@ -1628,7 +1666,7 @@ ${l}`,
|
|
|
1628
1666
|
}
|
|
1629
1667
|
};
|
|
1630
1668
|
}
|
|
1631
|
-
},
|
|
1669
|
+
}, bt = 25, ur = s.object({
|
|
1632
1670
|
name: s.string().min(1).describe("The name of the goal."),
|
|
1633
1671
|
workspaceId: s.string().optional().describe(
|
|
1634
1672
|
"Workspace ID. If provided, creates a workspace goal. If omitted, creates a personal goal."
|
|
@@ -1636,16 +1674,16 @@ ${l}`,
|
|
|
1636
1674
|
description: s.string().optional().describe("The description of the goal."),
|
|
1637
1675
|
deadline: s.string().optional().describe("The target date (YYYY-MM-DD)."),
|
|
1638
1676
|
responsibleUid: s.string().optional().describe("The user ID responsible for this goal.")
|
|
1639
|
-
}),
|
|
1640
|
-
goals: s.array(
|
|
1641
|
-
},
|
|
1677
|
+
}), pr = {
|
|
1678
|
+
goals: s.array(ur).min(1).max(bt).describe(`The array of goals to create (max ${bt}).`)
|
|
1679
|
+
}, mr = {
|
|
1642
1680
|
goals: s.array(Se).describe("The created goals."),
|
|
1643
1681
|
totalCount: s.number().describe("The total number of goals created.")
|
|
1644
|
-
},
|
|
1682
|
+
}, hr = {
|
|
1645
1683
|
name: f.ADD_GOALS,
|
|
1646
1684
|
description: "Create one or more goals. Omit workspaceId for personal goals.",
|
|
1647
|
-
parameters:
|
|
1648
|
-
outputSchema:
|
|
1685
|
+
parameters: pr,
|
|
1686
|
+
outputSchema: mr,
|
|
1649
1687
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1650
1688
|
async execute({ goals: e }, t) {
|
|
1651
1689
|
const r = (await Promise.all(e.map((c) => t.addGoal(c)))).map(ve), n = r.length, a = r.map((c) => `• ${c.name} (id=${c.id}, owner=${c.ownerType})`).join(`
|
|
@@ -1659,26 +1697,26 @@ ${a}`,
|
|
|
1659
1697
|
}
|
|
1660
1698
|
};
|
|
1661
1699
|
}
|
|
1662
|
-
},
|
|
1700
|
+
}, fr = s.object({
|
|
1663
1701
|
name: s.string().min(1).max(128).describe("The name of the label."),
|
|
1664
1702
|
color: de,
|
|
1665
1703
|
order: s.number().int().optional().describe("The position of the label in the label list."),
|
|
1666
1704
|
isFavorite: s.boolean().optional().describe("Whether the label is a favorite. Defaults to false.")
|
|
1667
|
-
}),
|
|
1668
|
-
labels: s.array(
|
|
1669
|
-
},
|
|
1705
|
+
}), br = {
|
|
1706
|
+
labels: s.array(fr).min(1).describe("The array of labels to add.")
|
|
1707
|
+
}, gr = {
|
|
1670
1708
|
labels: s.array(pe).describe("The created labels."),
|
|
1671
1709
|
totalCount: s.number().describe("The total number of labels created.")
|
|
1672
|
-
},
|
|
1710
|
+
}, yr = {
|
|
1673
1711
|
name: f.ADD_LABELS,
|
|
1674
1712
|
description: "Add one or more new personal labels.",
|
|
1675
|
-
parameters:
|
|
1676
|
-
outputSchema:
|
|
1713
|
+
parameters: br,
|
|
1714
|
+
outputSchema: gr,
|
|
1677
1715
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1678
1716
|
async execute({ labels: e }, t) {
|
|
1679
1717
|
const o = await Promise.all(e.map((n) => t.addLabel(n)));
|
|
1680
1718
|
return {
|
|
1681
|
-
textContent:
|
|
1719
|
+
textContent: kr({ labels: o }),
|
|
1682
1720
|
structuredContent: {
|
|
1683
1721
|
labels: o.map((n) => pe.parse(n)),
|
|
1684
1722
|
totalCount: o.length
|
|
@@ -1686,22 +1724,22 @@ ${a}`,
|
|
|
1686
1724
|
};
|
|
1687
1725
|
}
|
|
1688
1726
|
};
|
|
1689
|
-
function
|
|
1727
|
+
function kr({ labels: e }) {
|
|
1690
1728
|
const t = e.length, o = e.map((r) => `• ${r.name} (id=${r.id})`).join(`
|
|
1691
1729
|
`);
|
|
1692
1730
|
return `Added ${t} label${t === 1 ? "" : "s"}:
|
|
1693
1731
|
${o}`;
|
|
1694
1732
|
}
|
|
1695
|
-
const
|
|
1696
|
-
function
|
|
1733
|
+
const Tr = 300 * 1e3;
|
|
1734
|
+
function wr(e) {
|
|
1697
1735
|
return /^\d+$/.test(e);
|
|
1698
1736
|
}
|
|
1699
|
-
class
|
|
1737
|
+
class vr {
|
|
1700
1738
|
constructor() {
|
|
1701
1739
|
this.cache = null;
|
|
1702
1740
|
}
|
|
1703
1741
|
async getWorkspaces(t) {
|
|
1704
|
-
if (this.cache && Date.now() - this.cache.timestamp <
|
|
1742
|
+
if (this.cache && Date.now() - this.cache.timestamp < Tr)
|
|
1705
1743
|
return this.cache.workspaces;
|
|
1706
1744
|
const o = await t.getWorkspaces();
|
|
1707
1745
|
return this.cache = { workspaces: o, timestamp: Date.now() }, o;
|
|
@@ -1724,7 +1762,7 @@ class gr {
|
|
|
1724
1762
|
const n = await this.getWorkspaces(t), a = n.find((p) => p.id === r);
|
|
1725
1763
|
if (a)
|
|
1726
1764
|
return { workspaceId: a.id, workspaceName: a.name };
|
|
1727
|
-
if (
|
|
1765
|
+
if (wr(r))
|
|
1728
1766
|
return { workspaceId: r, workspaceName: r };
|
|
1729
1767
|
const i = r.toLowerCase(), c = n.find((p) => p.name.toLowerCase() === i);
|
|
1730
1768
|
if (c)
|
|
@@ -1752,7 +1790,7 @@ ${p}` + (d.length > 5 ? `
|
|
|
1752
1790
|
this.cache = null;
|
|
1753
1791
|
}
|
|
1754
1792
|
}
|
|
1755
|
-
const
|
|
1793
|
+
const Kt = new vr(), Ir = s.object({
|
|
1756
1794
|
name: s.string().min(1).describe("The name of the project."),
|
|
1757
1795
|
parentId: s.string().optional().describe("The ID of the parent project. If provided, creates this as a sub-project."),
|
|
1758
1796
|
isFavorite: s.boolean().optional().describe("Whether the project is a favorite. Defaults to false."),
|
|
@@ -1762,23 +1800,23 @@ const Bt = new gr(), yr = s.object({
|
|
|
1762
1800
|
workspace: s.string().trim().min(1).optional().describe(
|
|
1763
1801
|
"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."
|
|
1764
1802
|
)
|
|
1765
|
-
}),
|
|
1766
|
-
projects: s.array(
|
|
1767
|
-
},
|
|
1803
|
+
}), jr = {
|
|
1804
|
+
projects: s.array(Ir).min(1).describe("The array of projects to add.")
|
|
1805
|
+
}, Sr = {
|
|
1768
1806
|
projects: s.array(ue).describe("The created projects."),
|
|
1769
1807
|
totalCount: s.number().describe("The total number of projects created.")
|
|
1770
|
-
},
|
|
1808
|
+
}, Cr = {
|
|
1771
1809
|
name: f.ADD_PROJECTS,
|
|
1772
1810
|
description: "Add one or more new projects.",
|
|
1773
|
-
parameters:
|
|
1774
|
-
outputSchema:
|
|
1811
|
+
parameters: jr,
|
|
1812
|
+
outputSchema: Sr,
|
|
1775
1813
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1776
1814
|
async execute({ projects: e }, t) {
|
|
1777
1815
|
const o = [
|
|
1778
1816
|
...new Set(e.map((c) => c.workspace).filter(Boolean))
|
|
1779
1817
|
], r = /* @__PURE__ */ new Map();
|
|
1780
1818
|
for (const c of o) {
|
|
1781
|
-
const d = await
|
|
1819
|
+
const d = await Kt.resolveWorkspace(t, c);
|
|
1782
1820
|
r.set(c, d.workspaceId);
|
|
1783
1821
|
}
|
|
1784
1822
|
const n = await Promise.all(
|
|
@@ -1786,7 +1824,7 @@ const Bt = new gr(), yr = s.object({
|
|
|
1786
1824
|
const l = c ? r.get(c) : void 0;
|
|
1787
1825
|
return t.addProject({ ...d, ...l ? { workspaceId: l } : {} });
|
|
1788
1826
|
})
|
|
1789
|
-
), a =
|
|
1827
|
+
), a = $r({ projects: n }), i = n.map(V);
|
|
1790
1828
|
return {
|
|
1791
1829
|
textContent: a,
|
|
1792
1830
|
structuredContent: {
|
|
@@ -1796,18 +1834,18 @@ const Bt = new gr(), yr = s.object({
|
|
|
1796
1834
|
};
|
|
1797
1835
|
}
|
|
1798
1836
|
};
|
|
1799
|
-
function
|
|
1837
|
+
function $r({ projects: e }) {
|
|
1800
1838
|
const t = e.length, o = e.map((n) => `• ${n.name} (id=${n.id})`).join(`
|
|
1801
1839
|
`);
|
|
1802
1840
|
return `Added ${t} project${t === 1 ? "" : "s"}:
|
|
1803
1841
|
${o}`;
|
|
1804
1842
|
}
|
|
1805
|
-
const Te = 25, Ce = s.enum(
|
|
1843
|
+
const Te = 25, Ce = s.enum(js), Vt = s.object({
|
|
1806
1844
|
date: s.string().optional().describe("Due date in YYYY-MM-DD format."),
|
|
1807
1845
|
string: s.string().optional().describe('Natural language due string, e.g. "tomorrow at 3pm".'),
|
|
1808
1846
|
timezone: s.string().optional().describe('Timezone for the reminder, e.g. "America/New_York".'),
|
|
1809
1847
|
lang: s.string().optional().describe('Language for parsing the due string, e.g. "en".')
|
|
1810
|
-
}),
|
|
1848
|
+
}), Jt = s.enum(Ut), $e = s.boolean().optional().describe("Whether this is an urgent reminder. Applies to relative and absolute reminders."), Dr = s.object({
|
|
1811
1849
|
type: s.literal("relative"),
|
|
1812
1850
|
taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
|
|
1813
1851
|
minuteOffset: s.number().int().min(0).describe(
|
|
@@ -1817,41 +1855,41 @@ const Te = 25, Ce = s.enum(Ts), Yt = s.object({
|
|
|
1817
1855
|
'Delivery method: "email" or "push" notification. Defaults to push.'
|
|
1818
1856
|
),
|
|
1819
1857
|
isUrgent: $e
|
|
1820
|
-
}),
|
|
1858
|
+
}), Ar = s.object({
|
|
1821
1859
|
type: s.literal("absolute"),
|
|
1822
1860
|
taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
|
|
1823
|
-
due:
|
|
1861
|
+
due: Vt.describe("The specific date/time for the reminder."),
|
|
1824
1862
|
service: Ce.optional().describe(
|
|
1825
1863
|
'Delivery method: "email" or "push" notification. Defaults to push.'
|
|
1826
1864
|
),
|
|
1827
1865
|
isUrgent: $e
|
|
1828
|
-
}),
|
|
1866
|
+
}), xr = s.object({
|
|
1829
1867
|
type: s.literal("location"),
|
|
1830
1868
|
taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
|
|
1831
1869
|
name: s.string().min(1).describe('Name of the location, e.g. "Office", "Home".'),
|
|
1832
1870
|
locLat: s.string().describe('Latitude of the location as a string, e.g. "37.7749".'),
|
|
1833
1871
|
locLong: s.string().describe('Longitude of the location as a string, e.g. "-122.4194".'),
|
|
1834
|
-
locTrigger:
|
|
1872
|
+
locTrigger: Jt.describe(
|
|
1835
1873
|
'When to trigger: "on_enter" (arriving) or "on_leave" (departing).'
|
|
1836
1874
|
),
|
|
1837
1875
|
radius: s.number().int().optional().describe("Radius in meters for the geofence. Defaults to server default.")
|
|
1838
|
-
}),
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
]),
|
|
1843
|
-
reminders: s.array(
|
|
1876
|
+
}), Er = s.discriminatedUnion("type", [
|
|
1877
|
+
Dr,
|
|
1878
|
+
Ar,
|
|
1879
|
+
xr
|
|
1880
|
+
]), Or = {
|
|
1881
|
+
reminders: s.array(Er).min(1).max(Te).describe(
|
|
1844
1882
|
`Array of reminders to create (max ${Te}). Each reminder must specify a type: "relative" (minutes before due), "absolute" (specific date/time), or "location" (geofence trigger).`
|
|
1845
1883
|
)
|
|
1846
|
-
},
|
|
1847
|
-
reminders: s.array(
|
|
1884
|
+
}, Ur = {
|
|
1885
|
+
reminders: s.array(rt).describe("The created reminders."),
|
|
1848
1886
|
totalCount: s.number().describe("Total number of reminders created."),
|
|
1849
1887
|
addedReminderIds: s.array(s.string()).describe("IDs of the created reminders.")
|
|
1850
|
-
},
|
|
1888
|
+
}, Pr = {
|
|
1851
1889
|
name: f.ADD_REMINDERS,
|
|
1852
1890
|
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.',
|
|
1853
|
-
parameters:
|
|
1854
|
-
outputSchema:
|
|
1891
|
+
parameters: Or,
|
|
1892
|
+
outputSchema: Ur,
|
|
1855
1893
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1856
1894
|
async execute(e, t) {
|
|
1857
1895
|
const { reminders: o } = e, r = o.map(async (c) => {
|
|
@@ -1884,7 +1922,7 @@ const Te = 25, Ce = s.enum(Ts), Yt = s.object({
|
|
|
1884
1922
|
}
|
|
1885
1923
|
}), a = (await Promise.all(r)).map(he);
|
|
1886
1924
|
return {
|
|
1887
|
-
textContent:
|
|
1925
|
+
textContent: _r(a),
|
|
1888
1926
|
structuredContent: {
|
|
1889
1927
|
reminders: a,
|
|
1890
1928
|
totalCount: a.length,
|
|
@@ -1893,8 +1931,8 @@ const Te = 25, Ce = s.enum(Ts), Yt = s.object({
|
|
|
1893
1931
|
};
|
|
1894
1932
|
}
|
|
1895
1933
|
};
|
|
1896
|
-
function
|
|
1897
|
-
const { timeBasedCount: t, locationCount: o } =
|
|
1934
|
+
function _r(e) {
|
|
1935
|
+
const { timeBasedCount: t, locationCount: o } = zt(e), r = [];
|
|
1898
1936
|
if (t > 0) {
|
|
1899
1937
|
const n = t > 1 ? "reminders" : "reminder";
|
|
1900
1938
|
r.push(`${t} time-based ${n}`);
|
|
@@ -1905,22 +1943,22 @@ function xr(e) {
|
|
|
1905
1943
|
}
|
|
1906
1944
|
return r.length > 0 ? `Added ${r.join(" and ")}` : "No reminders added";
|
|
1907
1945
|
}
|
|
1908
|
-
const
|
|
1946
|
+
const Rr = s.object({
|
|
1909
1947
|
name: s.string().min(1).describe("The name of the section."),
|
|
1910
1948
|
projectId: s.string().min(1).describe(
|
|
1911
1949
|
'The ID of the project to add the section to. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
1912
1950
|
),
|
|
1913
1951
|
description: s.string().optional().describe("The description of the section. Supports Markdown.")
|
|
1914
|
-
}),
|
|
1915
|
-
sections: s.array(
|
|
1916
|
-
},
|
|
1952
|
+
}), Nr = {
|
|
1953
|
+
sections: s.array(Rr).min(1).describe("The array of sections to add.")
|
|
1954
|
+
}, Lr = {
|
|
1917
1955
|
sections: s.array(ce).describe("The created sections."),
|
|
1918
1956
|
totalCount: s.number().describe("The total number of sections created.")
|
|
1919
|
-
},
|
|
1957
|
+
}, Mr = {
|
|
1920
1958
|
name: f.ADD_SECTIONS,
|
|
1921
1959
|
description: "Add one or more new sections to projects.",
|
|
1922
|
-
parameters:
|
|
1923
|
-
outputSchema:
|
|
1960
|
+
parameters: Nr,
|
|
1961
|
+
outputSchema: Lr,
|
|
1924
1962
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1925
1963
|
async execute({ sections: e }, t) {
|
|
1926
1964
|
const r = e.some((c) => fe(c.projectId)) ? await t.getUser() : void 0, n = await Promise.all(
|
|
@@ -1936,7 +1974,7 @@ const Er = s.object({
|
|
|
1936
1974
|
n.map((c) => t.addSection(c))
|
|
1937
1975
|
);
|
|
1938
1976
|
return {
|
|
1939
|
-
textContent:
|
|
1977
|
+
textContent: Fr({ sections: a }),
|
|
1940
1978
|
structuredContent: {
|
|
1941
1979
|
sections: a.map(X),
|
|
1942
1980
|
totalCount: a.length
|
|
@@ -1944,7 +1982,7 @@ const Er = s.object({
|
|
|
1944
1982
|
};
|
|
1945
1983
|
}
|
|
1946
1984
|
};
|
|
1947
|
-
function
|
|
1985
|
+
function Fr({ sections: e }) {
|
|
1948
1986
|
const t = e.length, o = e.map((n) => `• ${n.name} (id=${n.id}, projectId=${n.projectId})`).join(`
|
|
1949
1987
|
`);
|
|
1950
1988
|
return `Added ${t} section${t === 1 ? "" : "s"}:
|
|
@@ -1959,7 +1997,7 @@ const se = {
|
|
|
1959
1997
|
PROJECT_NOT_FOUND: "PROJECT_NOT_FOUND",
|
|
1960
1998
|
TASK_NOT_FOUND: "TASK_NOT_FOUND"
|
|
1961
1999
|
};
|
|
1962
|
-
class
|
|
2000
|
+
class Hr {
|
|
1963
2001
|
/**
|
|
1964
2002
|
* Validate a single assignment operation
|
|
1965
2003
|
*/
|
|
@@ -2168,12 +2206,12 @@ class Rr {
|
|
|
2168
2206
|
};
|
|
2169
2207
|
}
|
|
2170
2208
|
}
|
|
2171
|
-
const
|
|
2209
|
+
const at = new Hr();
|
|
2172
2210
|
function re(e = /* @__PURE__ */ new Date()) {
|
|
2173
2211
|
const t = e.getFullYear(), o = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0");
|
|
2174
2212
|
return `${t}-${o}-${r}`;
|
|
2175
2213
|
}
|
|
2176
|
-
function
|
|
2214
|
+
function it(e, t, o = {}) {
|
|
2177
2215
|
const { context: r, showDetails: n = !1 } = o, a = t.length, i = [], d = `${e} ${a} ${a === 1 ? "task" : "tasks"}${r ? ` ${r}` : ""}.`;
|
|
2178
2216
|
i.push(d);
|
|
2179
2217
|
const l = 5;
|
|
@@ -2203,20 +2241,20 @@ ${i.slice(0, Oe.MAX_FAILURES_SHOWN).map((u) => ` ${u.item} (Error: ${u.error}
|
|
|
2203
2241
|
return c.join(`
|
|
2204
2242
|
`);
|
|
2205
2243
|
}
|
|
2206
|
-
function
|
|
2244
|
+
function Wr(e) {
|
|
2207
2245
|
const t = e.content || e.title || "Untitled", o = e.dueDate ? ` • due ${e.dueDate}` : "", r = e.priority ? ` • ${e.priority.toUpperCase()}` : "", n = e.projectName ? ` • ${e.projectName}` : "", a = e.id ? ` • id=${e.id}` : "";
|
|
2208
2246
|
return ` ${t}${o}${r}${n}${a}`;
|
|
2209
2247
|
}
|
|
2210
|
-
function
|
|
2248
|
+
function Gr(e) {
|
|
2211
2249
|
const t = ` (${e.color})`, o = e.isFavorite ? " • ⭐" : "", r = ` • id=${e.id}`;
|
|
2212
2250
|
return ` ${e.name}${t}${o}${r}`;
|
|
2213
2251
|
}
|
|
2214
|
-
function
|
|
2252
|
+
function Br(e) {
|
|
2215
2253
|
const t = e.inboxProject ? " • Inbox" : "", o = e.isFavorite ? " • ⭐" : "", r = e.isShared ? " • Shared" : "", n = e.isArchived ? " • Archived" : "", a = e.viewStyle && e.viewStyle !== "list" ? ` • ${e.viewStyle}` : "", i = ` • id=${e.id}`;
|
|
2216
2254
|
return ` ${e.name}${t}${o}${r}${n}${a}${i}`;
|
|
2217
2255
|
}
|
|
2218
2256
|
function De(e, t = 5) {
|
|
2219
|
-
const r = e.slice(0, t).map(
|
|
2257
|
+
const r = e.slice(0, t).map(Wr).join(`
|
|
2220
2258
|
`);
|
|
2221
2259
|
if (e.length > t) {
|
|
2222
2260
|
const n = e.length - t;
|
|
@@ -2237,10 +2275,10 @@ function M({
|
|
|
2237
2275
|
}) {
|
|
2238
2276
|
const d = [], l = `${e}: ${t}${typeof o == "number" ? ` (limit ${o})` : ""}${r ? ", more available" : ""}.`;
|
|
2239
2277
|
return d.push(l), n?.length && d.push(`Filter: ${n.join("; ")}.`), a?.length && d.push(`Preview:
|
|
2240
|
-
${a}`), !t && i?.length && d.push(`No results. ${i.join("; ")}.`), (c?.length || r) && d.push(
|
|
2278
|
+
${a}`), !t && i?.length && d.push(`No results. ${i.join("; ")}.`), (c?.length || r) && d.push(Xt(c || [], r)), d.join(`
|
|
2241
2279
|
`);
|
|
2242
2280
|
}
|
|
2243
|
-
function
|
|
2281
|
+
function Xt(e, t) {
|
|
2244
2282
|
const o = [...e];
|
|
2245
2283
|
return t && o.push(`Pass cursor '${t}' to fetch more results.`), `${o.length === 1 ? "Possible suggested next step:" : "Possible suggested next steps:"}
|
|
2246
2284
|
${o.map((n) => `- ${n}`).join(`
|
|
@@ -2249,14 +2287,14 @@ ${o.map((n) => `- ${n}`).join(`
|
|
|
2249
2287
|
function W(e) {
|
|
2250
2288
|
return s.string().transform((t) => t === "" ? void 0 : t).optional().describe(e);
|
|
2251
2289
|
}
|
|
2252
|
-
const
|
|
2290
|
+
const gt = 25, Yr = s.object({
|
|
2253
2291
|
content: s.string().min(1).describe(
|
|
2254
2292
|
'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.'
|
|
2255
2293
|
),
|
|
2256
2294
|
description: W(
|
|
2257
2295
|
"Additional details, notes, or context for the task. Use this for longer content rather than putting it in the task name. Supports Markdown."
|
|
2258
2296
|
),
|
|
2259
|
-
priority:
|
|
2297
|
+
priority: et.optional().describe(Qe),
|
|
2260
2298
|
dueString: W("The due date for the task, in natural language."),
|
|
2261
2299
|
deadlineDate: W(
|
|
2262
2300
|
'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.'
|
|
@@ -2277,25 +2315,25 @@ const bt = 25, Fr = s.object({
|
|
|
2277
2315
|
isUncompletable: s.boolean().optional().describe(
|
|
2278
2316
|
"Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
|
|
2279
2317
|
)
|
|
2280
|
-
}),
|
|
2281
|
-
tasks: s.array(
|
|
2282
|
-
},
|
|
2318
|
+
}), yt = {
|
|
2319
|
+
tasks: s.array(Yr).min(1).max(gt).describe(`The array of tasks to add (max ${gt}).`)
|
|
2320
|
+
}, qr = {
|
|
2283
2321
|
tasks: s.array(J).describe("The created tasks."),
|
|
2284
2322
|
totalCount: s.number().describe("The total number of tasks created."),
|
|
2285
2323
|
failures: s.array(be).describe("Failed task creations with error details."),
|
|
2286
2324
|
totalRequested: s.number().describe("The total number of tasks requested."),
|
|
2287
2325
|
successCount: s.number().describe("The number of successfully created tasks."),
|
|
2288
2326
|
failureCount: s.number().describe("The number of failed task creations.")
|
|
2289
|
-
},
|
|
2327
|
+
}, zr = {
|
|
2290
2328
|
name: f.ADD_TASKS,
|
|
2291
2329
|
description: "Add one or more tasks to a project, section, or parent. Supports assignment to project collaborators.",
|
|
2292
|
-
parameters:
|
|
2293
|
-
outputSchema:
|
|
2330
|
+
parameters: yt,
|
|
2331
|
+
outputSchema: qr,
|
|
2294
2332
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
2295
2333
|
async execute(e, t) {
|
|
2296
|
-
const { tasks: o } = s.object(
|
|
2334
|
+
const { tasks: o } = s.object(yt).parse(e), r = /* @__PURE__ */ new Map();
|
|
2297
2335
|
o.forEach((u, m) => {
|
|
2298
|
-
const h =
|
|
2336
|
+
const h = Kr(u), k = r.get(h);
|
|
2299
2337
|
k ? k.push({ task: u, index: m }) : r.set(h, [{ task: u, index: m }]);
|
|
2300
2338
|
});
|
|
2301
2339
|
const n = /* @__PURE__ */ new Map(), i = (await Promise.all(
|
|
@@ -2303,7 +2341,7 @@ const bt = 25, Fr = s.object({
|
|
|
2303
2341
|
const m = [];
|
|
2304
2342
|
for (const { task: h, index: k } of u)
|
|
2305
2343
|
try {
|
|
2306
|
-
const b = await
|
|
2344
|
+
const b = await Vr(h, t, n);
|
|
2307
2345
|
m.push({ index: k, result: { status: "fulfilled", value: b } });
|
|
2308
2346
|
} catch (b) {
|
|
2309
2347
|
m.push({
|
|
@@ -2317,7 +2355,10 @@ const bt = 25, Fr = s.object({
|
|
|
2317
2355
|
for (const { index: u, result: m } of i)
|
|
2318
2356
|
m.status === "fulfilled" ? c.push(m.value) : d.push({
|
|
2319
2357
|
item: o[u]?.content ?? `Task ${u + 1}`,
|
|
2320
|
-
|
|
2358
|
+
// Keep API error signals (status/code/tag) — `error.message`
|
|
2359
|
+
// alone collapses e.g. a full-project rejection into a bare
|
|
2360
|
+
// "HTTP 403: Forbidden"
|
|
2361
|
+
error: Gs(m.reason)
|
|
2321
2362
|
});
|
|
2322
2363
|
if (c.length === 0 && d.length > 0) {
|
|
2323
2364
|
const u = d.map((m) => `"${m.item}": ${m.error}`).join("; ");
|
|
@@ -2325,7 +2366,7 @@ const bt = 25, Fr = s.object({
|
|
|
2325
2366
|
}
|
|
2326
2367
|
const l = c.map(_);
|
|
2327
2368
|
return {
|
|
2328
|
-
textContent:
|
|
2369
|
+
textContent: Jr({
|
|
2329
2370
|
tasks: l,
|
|
2330
2371
|
failures: d,
|
|
2331
2372
|
args: { tasks: o }
|
|
@@ -2341,10 +2382,10 @@ const bt = 25, Fr = s.object({
|
|
|
2341
2382
|
};
|
|
2342
2383
|
}
|
|
2343
2384
|
};
|
|
2344
|
-
function
|
|
2385
|
+
function Kr(e) {
|
|
2345
2386
|
return `${e.projectId ?? ""}|${e.sectionId ?? ""}|${e.parentId ?? ""}`;
|
|
2346
2387
|
}
|
|
2347
|
-
async function
|
|
2388
|
+
async function Vr(e, t, o) {
|
|
2348
2389
|
const {
|
|
2349
2390
|
duration: r,
|
|
2350
2391
|
projectId: n,
|
|
@@ -2373,13 +2414,13 @@ async function Br(e, t, o) {
|
|
|
2373
2414
|
labels: p,
|
|
2374
2415
|
deadlineDate: u
|
|
2375
2416
|
};
|
|
2376
|
-
if (l && (k.priority =
|
|
2417
|
+
if (l && (k.priority = Gt(l)), d && !h && !a && !i)
|
|
2377
2418
|
throw new Error(
|
|
2378
2419
|
`Task "${e.content}": Cannot assign tasks without specifying project context. Please specify a projectId, sectionId, or parentId.`
|
|
2379
2420
|
);
|
|
2380
2421
|
if (r)
|
|
2381
2422
|
try {
|
|
2382
|
-
const { minutes: b } =
|
|
2423
|
+
const { minutes: b } = Wt(r);
|
|
2383
2424
|
k = {
|
|
2384
2425
|
...k,
|
|
2385
2426
|
duration: b,
|
|
@@ -2406,7 +2447,7 @@ async function Br(e, t, o) {
|
|
|
2406
2447
|
throw new Error(
|
|
2407
2448
|
`Task "${e.content}": Cannot determine target project for assignment validation`
|
|
2408
2449
|
);
|
|
2409
|
-
const C = await
|
|
2450
|
+
const C = await at.validateTaskCreationAssignment(
|
|
2410
2451
|
t,
|
|
2411
2452
|
b,
|
|
2412
2453
|
d
|
|
@@ -2421,7 +2462,7 @@ async function Br(e, t, o) {
|
|
|
2421
2462
|
}
|
|
2422
2463
|
return await t.addTask(k);
|
|
2423
2464
|
}
|
|
2424
|
-
function
|
|
2465
|
+
function Jr({
|
|
2425
2466
|
tasks: e,
|
|
2426
2467
|
failures: t,
|
|
2427
2468
|
args: o
|
|
@@ -2441,28 +2482,28 @@ function Yr({
|
|
|
2441
2482
|
successItems: e.map((a) => a.content ?? "Untitled"),
|
|
2442
2483
|
successLabel: "Created",
|
|
2443
2484
|
failures: t
|
|
2444
|
-
}) :
|
|
2485
|
+
}) : it("Added", e, {
|
|
2445
2486
|
context: n,
|
|
2446
2487
|
showDetails: !0
|
|
2447
2488
|
});
|
|
2448
2489
|
}
|
|
2449
|
-
const
|
|
2490
|
+
const Xr = {
|
|
2450
2491
|
projectId: s.string().min(1).describe(
|
|
2451
2492
|
"The ID of the project to analyze. This triggers a new health analysis which may take some time to complete."
|
|
2452
2493
|
)
|
|
2453
|
-
},
|
|
2494
|
+
}, Zr = {
|
|
2454
2495
|
projectId: s.string().describe("The project ID."),
|
|
2455
2496
|
health: s.object({
|
|
2456
|
-
status: s.enum(
|
|
2497
|
+
status: s.enum(Xe).describe("The health status after triggering analysis."),
|
|
2457
2498
|
isStale: s.boolean().describe("Whether the health data is still stale after the request."),
|
|
2458
2499
|
updateInProgress: s.boolean().describe("Whether an analysis update is currently in progress.")
|
|
2459
2500
|
}).describe("The health response returned after triggering analysis."),
|
|
2460
2501
|
message: s.string().describe("A human-readable message about the analysis status.")
|
|
2461
|
-
},
|
|
2502
|
+
}, Qr = {
|
|
2462
2503
|
name: f.ANALYZE_PROJECT_HEALTH,
|
|
2463
2504
|
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.",
|
|
2464
|
-
parameters:
|
|
2465
|
-
outputSchema:
|
|
2505
|
+
parameters: Xr,
|
|
2506
|
+
outputSchema: Zr,
|
|
2466
2507
|
annotations: {
|
|
2467
2508
|
readOnlyHint: !1,
|
|
2468
2509
|
destructiveHint: !1,
|
|
@@ -2485,22 +2526,22 @@ ${n}`,
|
|
|
2485
2526
|
}
|
|
2486
2527
|
};
|
|
2487
2528
|
}
|
|
2488
|
-
},
|
|
2489
|
-
ids: s.array(s.string().min(1)).min(1).max(
|
|
2490
|
-
`The IDs of the goals to complete or uncomplete (max ${
|
|
2529
|
+
}, kt = 25, en = {
|
|
2530
|
+
ids: s.array(s.string().min(1)).min(1).max(kt).describe(
|
|
2531
|
+
`The IDs of the goals to complete or uncomplete (max ${kt}).`
|
|
2491
2532
|
),
|
|
2492
2533
|
action: s.enum(["complete", "uncomplete"]).describe("Whether to complete or uncomplete the goals.")
|
|
2493
|
-
},
|
|
2534
|
+
}, tn = {
|
|
2494
2535
|
processed: s.array(s.string()).describe("The IDs of successfully processed goals."),
|
|
2495
2536
|
failures: s.array(be).describe("Failed operations with error details."),
|
|
2496
2537
|
totalRequested: s.number().describe("The total number of goals requested."),
|
|
2497
2538
|
successCount: s.number().describe("The number of successfully processed goals."),
|
|
2498
2539
|
failureCount: s.number().describe("The number of failed operations.")
|
|
2499
|
-
},
|
|
2540
|
+
}, sn = {
|
|
2500
2541
|
name: f.COMPLETE_GOALS,
|
|
2501
2542
|
description: "Complete or uncomplete one or more goals by their IDs.",
|
|
2502
|
-
parameters:
|
|
2503
|
-
outputSchema:
|
|
2543
|
+
parameters: en,
|
|
2544
|
+
outputSchema: tn,
|
|
2504
2545
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
2505
2546
|
async execute(e, t) {
|
|
2506
2547
|
const o = await Promise.allSettled(
|
|
@@ -2533,19 +2574,19 @@ ${n}`,
|
|
|
2533
2574
|
}
|
|
2534
2575
|
};
|
|
2535
2576
|
}
|
|
2536
|
-
},
|
|
2577
|
+
}, on = {
|
|
2537
2578
|
ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to complete.")
|
|
2538
|
-
},
|
|
2579
|
+
}, rn = {
|
|
2539
2580
|
completed: s.array(s.string()).describe("The IDs of successfully completed tasks."),
|
|
2540
2581
|
failures: s.array(be).describe("Failed task completions with error details."),
|
|
2541
2582
|
totalRequested: s.number().describe("The total number of tasks requested to complete."),
|
|
2542
2583
|
successCount: s.number().describe("The number of successfully completed tasks."),
|
|
2543
2584
|
failureCount: s.number().describe("The number of failed task completions.")
|
|
2544
|
-
},
|
|
2585
|
+
}, nn = {
|
|
2545
2586
|
name: f.COMPLETE_TASKS,
|
|
2546
2587
|
description: "Complete one or more tasks by their IDs.",
|
|
2547
|
-
parameters:
|
|
2548
|
-
outputSchema:
|
|
2588
|
+
parameters: on,
|
|
2589
|
+
outputSchema: rn,
|
|
2549
2590
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
2550
2591
|
async execute(e, t) {
|
|
2551
2592
|
const o = [], r = [];
|
|
@@ -2560,7 +2601,7 @@ ${n}`,
|
|
|
2560
2601
|
});
|
|
2561
2602
|
}
|
|
2562
2603
|
return {
|
|
2563
|
-
textContent:
|
|
2604
|
+
textContent: an({
|
|
2564
2605
|
completed: o,
|
|
2565
2606
|
failures: r,
|
|
2566
2607
|
args: e
|
|
@@ -2575,7 +2616,7 @@ ${n}`,
|
|
|
2575
2616
|
};
|
|
2576
2617
|
}
|
|
2577
2618
|
};
|
|
2578
|
-
function
|
|
2619
|
+
function an({
|
|
2579
2620
|
completed: e,
|
|
2580
2621
|
failures: t,
|
|
2581
2622
|
args: o
|
|
@@ -2588,7 +2629,7 @@ function tn({
|
|
|
2588
2629
|
failures: t
|
|
2589
2630
|
});
|
|
2590
2631
|
}
|
|
2591
|
-
const
|
|
2632
|
+
const Zt = [
|
|
2592
2633
|
"project",
|
|
2593
2634
|
"section",
|
|
2594
2635
|
"task",
|
|
@@ -2598,20 +2639,20 @@ const Kt = [
|
|
|
2598
2639
|
"goal",
|
|
2599
2640
|
"reminder",
|
|
2600
2641
|
"location_reminder"
|
|
2601
|
-
],
|
|
2602
|
-
type: s.enum(
|
|
2642
|
+
], cn = {
|
|
2643
|
+
type: s.enum(Zt).describe("The type of entity to delete."),
|
|
2603
2644
|
id: s.string().min(1).describe("The ID of the entity to delete.")
|
|
2604
|
-
},
|
|
2645
|
+
}, dn = {
|
|
2605
2646
|
deletedEntity: s.object({
|
|
2606
|
-
type: s.enum(
|
|
2647
|
+
type: s.enum(Zt).describe("The type of deleted entity."),
|
|
2607
2648
|
id: s.string().describe("The ID of the deleted entity.")
|
|
2608
2649
|
}).describe("Information about the deleted entity."),
|
|
2609
2650
|
success: s.boolean().describe("Whether the deletion was successful.")
|
|
2610
|
-
},
|
|
2651
|
+
}, ln = {
|
|
2611
2652
|
name: f.DELETE_OBJECT,
|
|
2612
2653
|
description: "Delete a project, section, task, comment, label, filter, goal, reminder, or location_reminder by its ID. Projects can be deleted whether active or archived (find archived ones via find-projects with archivedStatus); note a workspace project must be archived before it can be deleted, while personal projects can be deleted regardless.",
|
|
2613
|
-
parameters:
|
|
2614
|
-
outputSchema:
|
|
2654
|
+
parameters: cn,
|
|
2655
|
+
outputSchema: dn,
|
|
2615
2656
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !0 },
|
|
2616
2657
|
async execute(e, t) {
|
|
2617
2658
|
switch (e.type) {
|
|
@@ -2659,18 +2700,18 @@ const Kt = [
|
|
|
2659
2700
|
}
|
|
2660
2701
|
};
|
|
2661
2702
|
}
|
|
2662
|
-
},
|
|
2663
|
-
type: s.enum(
|
|
2703
|
+
}, Qt = ["task", "project", "comment", "section", "goal"], un = {
|
|
2704
|
+
type: s.enum(Qt).describe("The type of object to fetch."),
|
|
2664
2705
|
id: s.string().min(1).describe("The unique ID of the object to fetch.")
|
|
2665
|
-
},
|
|
2666
|
-
type: s.enum(
|
|
2706
|
+
}, pn = {
|
|
2707
|
+
type: s.enum(Qt).describe("The type of object fetched."),
|
|
2667
2708
|
id: s.string().describe("The ID of the fetched object."),
|
|
2668
2709
|
object: s.union([J, ue, je, ce, Se]).describe("The fetched object data.")
|
|
2669
|
-
},
|
|
2710
|
+
}, mn = {
|
|
2670
2711
|
name: f.FETCH_OBJECT,
|
|
2671
2712
|
description: "Fetch a single task, project, comment, section, or goal by its ID. Use this when you have a specific object ID and want to retrieve its full details.",
|
|
2672
|
-
parameters:
|
|
2673
|
-
outputSchema:
|
|
2713
|
+
parameters: un,
|
|
2714
|
+
outputSchema: pn,
|
|
2674
2715
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
2675
2716
|
async execute(e, t) {
|
|
2676
2717
|
const { type: o, id: r } = e;
|
|
@@ -2741,21 +2782,21 @@ const Kt = [
|
|
|
2741
2782
|
);
|
|
2742
2783
|
}
|
|
2743
2784
|
}
|
|
2744
|
-
},
|
|
2785
|
+
}, hn = {
|
|
2745
2786
|
id: s.string().min(1).describe(
|
|
2746
2787
|
'A unique identifier for the document in the format "task:{id}" or "project:{id}".'
|
|
2747
2788
|
)
|
|
2748
|
-
},
|
|
2789
|
+
}, fn = {
|
|
2749
2790
|
id: s.string().describe("The ID of the fetched document."),
|
|
2750
2791
|
title: s.string().describe("The title of the document."),
|
|
2751
2792
|
text: s.string().describe("The text content of the document."),
|
|
2752
2793
|
url: s.string().describe("The URL of the document."),
|
|
2753
2794
|
metadata: s.record(s.string(), s.unknown()).optional().describe("Additional metadata about the document.")
|
|
2754
|
-
},
|
|
2795
|
+
}, bn = {
|
|
2755
2796
|
name: f.FETCH,
|
|
2756
2797
|
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}".',
|
|
2757
|
-
parameters:
|
|
2758
|
-
outputSchema:
|
|
2798
|
+
parameters: hn,
|
|
2799
|
+
outputSchema: fn,
|
|
2759
2800
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
2760
2801
|
async execute(e, t) {
|
|
2761
2802
|
const { id: o } = e, [r, n] = o.split(":", 2);
|
|
@@ -2774,7 +2815,7 @@ Labels: ${c.labels.join(", ")}`), a = {
|
|
|
2774
2815
|
id: `task:${c.id}`,
|
|
2775
2816
|
title: c.content,
|
|
2776
2817
|
text: d.join(""),
|
|
2777
|
-
url:
|
|
2818
|
+
url: Pt(c.id),
|
|
2778
2819
|
metadata: {
|
|
2779
2820
|
priority: c.priority,
|
|
2780
2821
|
projectId: c.projectId,
|
|
@@ -2799,7 +2840,7 @@ Favorite: Yes`), a = {
|
|
|
2799
2840
|
id: `project:${c.id}`,
|
|
2800
2841
|
title: c.name,
|
|
2801
2842
|
text: d.join(""),
|
|
2802
|
-
url:
|
|
2843
|
+
url: _t(c.id),
|
|
2803
2844
|
metadata: {
|
|
2804
2845
|
color: c.color,
|
|
2805
2846
|
isFavorite: c.isFavorite,
|
|
@@ -2815,7 +2856,7 @@ Favorite: Yes`), a = {
|
|
|
2815
2856
|
structuredContent: a
|
|
2816
2857
|
};
|
|
2817
2858
|
}
|
|
2818
|
-
},
|
|
2859
|
+
}, gn = {
|
|
2819
2860
|
objectType: s.enum(["task", "project", "comment"]).optional().describe("Type of object to filter by."),
|
|
2820
2861
|
objectId: s.string().optional().describe("Filter by specific object ID (task, project, or comment)."),
|
|
2821
2862
|
eventType: s.enum([
|
|
@@ -2834,17 +2875,17 @@ Favorite: Yes`), a = {
|
|
|
2834
2875
|
initiatorId: s.string().optional().describe("Filter by the user ID who initiated the event."),
|
|
2835
2876
|
limit: s.number().int().min(1).max(j.ACTIVITY_MAX).default(j.ACTIVITY_DEFAULT).describe("Maximum number of activity events to return."),
|
|
2836
2877
|
cursor: s.string().optional().describe("Pagination cursor for retrieving the next page of results.")
|
|
2837
|
-
},
|
|
2838
|
-
events: s.array(
|
|
2878
|
+
}, yn = {
|
|
2879
|
+
events: s.array(Vo).describe("The activity events."),
|
|
2839
2880
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
2840
2881
|
totalCount: s.number().describe("The total number of events in this page."),
|
|
2841
2882
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
2842
2883
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
2843
|
-
},
|
|
2884
|
+
}, kn = {
|
|
2844
2885
|
name: f.FIND_ACTIVITY,
|
|
2845
2886
|
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.",
|
|
2846
|
-
parameters:
|
|
2847
|
-
outputSchema:
|
|
2887
|
+
parameters: gn,
|
|
2888
|
+
outputSchema: yn,
|
|
2848
2889
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
2849
2890
|
async execute(e, t) {
|
|
2850
2891
|
const { objectType: o, objectId: r, eventType: n, projectId: a, taskId: i, initiatorId: c, limit: d, cursor: l } = e, p = {
|
|
@@ -2852,9 +2893,9 @@ Favorite: Yes`), a = {
|
|
|
2852
2893
|
cursor: l ?? null
|
|
2853
2894
|
};
|
|
2854
2895
|
o && n ? p.objectEventTypes = `${o}:${n}` : o ? p.objectEventTypes = `${o}:` : n && (p.objectEventTypes = `:${n}`), r && r !== "remove" && (p.objectId = r), a && (p.parentProjectId = a), i && (p.parentItemId = i), c && (p.initiatorId = c);
|
|
2855
|
-
const { results: u, nextCursor: m } = await t.getActivityLogs(p), h = u.map(
|
|
2896
|
+
const { results: u, nextCursor: m } = await t.getActivityLogs(p), h = u.map(Bo);
|
|
2856
2897
|
return {
|
|
2857
|
-
textContent:
|
|
2898
|
+
textContent: Tn({ events: h, args: e, nextCursor: m }),
|
|
2858
2899
|
structuredContent: {
|
|
2859
2900
|
events: h,
|
|
2860
2901
|
nextCursor: m ?? void 0,
|
|
@@ -2865,7 +2906,7 @@ Favorite: Yes`), a = {
|
|
|
2865
2906
|
};
|
|
2866
2907
|
}
|
|
2867
2908
|
};
|
|
2868
|
-
function
|
|
2909
|
+
function Tn({
|
|
2869
2910
|
events: e,
|
|
2870
2911
|
args: t,
|
|
2871
2912
|
nextCursor: o
|
|
@@ -2886,12 +2927,12 @@ function fn({
|
|
|
2886
2927
|
limit: t.limit,
|
|
2887
2928
|
nextCursor: o ?? void 0,
|
|
2888
2929
|
filterHints: a,
|
|
2889
|
-
previewLines:
|
|
2930
|
+
previewLines: wn(e, Math.min(e.length, t.limit)),
|
|
2890
2931
|
zeroReasonHints: i
|
|
2891
2932
|
});
|
|
2892
2933
|
}
|
|
2893
|
-
function
|
|
2894
|
-
const r = e.slice(0, t).map(
|
|
2934
|
+
function wn(e, t = 10) {
|
|
2935
|
+
const r = e.slice(0, t).map(vn).join(`
|
|
2895
2936
|
`);
|
|
2896
2937
|
if (e.length > t) {
|
|
2897
2938
|
const n = e.length - t;
|
|
@@ -2900,8 +2941,8 @@ function bn(e, t = 10) {
|
|
|
2900
2941
|
}
|
|
2901
2942
|
return r;
|
|
2902
2943
|
}
|
|
2903
|
-
function
|
|
2904
|
-
const t =
|
|
2944
|
+
function vn(e) {
|
|
2945
|
+
const t = In(e.eventDate), o = `${e.eventType} ${e.objectType}`;
|
|
2905
2946
|
let r = "";
|
|
2906
2947
|
if (e.extraData) {
|
|
2907
2948
|
const c = e.extraData.content || e.extraData.name || e.extraData.last_content;
|
|
@@ -2910,7 +2951,7 @@ function gn(e) {
|
|
|
2910
2951
|
const n = e.objectId ? ` • id=${e.objectId}` : "", a = e.initiatorId ? ` • by=${e.initiatorId}` : " • system", i = e.parentProjectId ? ` • project=${e.parentProjectId}` : "";
|
|
2911
2952
|
return ` [${t}] ${o}${r}${n}${a}${i}`;
|
|
2912
2953
|
}
|
|
2913
|
-
function
|
|
2954
|
+
function In(e) {
|
|
2914
2955
|
try {
|
|
2915
2956
|
const t = new Date(e), o = t.toLocaleDateString("en-US", { month: "short", timeZone: "UTC" }), r = t.toLocaleDateString("en-US", { day: "numeric", timeZone: "UTC" }), n = t.toLocaleTimeString("en-US", {
|
|
2916
2957
|
hour: "2-digit",
|
|
@@ -2923,7 +2964,7 @@ function yn(e) {
|
|
|
2923
2964
|
return e;
|
|
2924
2965
|
}
|
|
2925
2966
|
}
|
|
2926
|
-
const
|
|
2967
|
+
const jn = {
|
|
2927
2968
|
taskId: s.string().optional().describe("Find comments for a specific task."),
|
|
2928
2969
|
projectId: s.string().optional().describe(
|
|
2929
2970
|
'Find comments for a specific project. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
@@ -2931,7 +2972,7 @@ const kn = {
|
|
|
2931
2972
|
commentId: s.string().optional().describe("Get a specific comment by ID."),
|
|
2932
2973
|
cursor: s.string().optional().describe("Pagination cursor for retrieving more results."),
|
|
2933
2974
|
limit: s.number().int().min(1).max(j.COMMENTS_MAX).optional().describe("Maximum number of comments to return")
|
|
2934
|
-
},
|
|
2975
|
+
}, Sn = {
|
|
2935
2976
|
comments: s.array(je).describe("The found comments."),
|
|
2936
2977
|
searchType: s.string().describe(
|
|
2937
2978
|
'The type of search performed: "single" (comment ID), "task" (task ID), or "project" (project ID).'
|
|
@@ -2940,11 +2981,11 @@ const kn = {
|
|
|
2940
2981
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
2941
2982
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
2942
2983
|
totalCount: s.number().describe("The total number of comments in this page.")
|
|
2943
|
-
},
|
|
2984
|
+
}, Cn = {
|
|
2944
2985
|
name: f.FIND_COMMENTS,
|
|
2945
2986
|
description: "Find comments by task, project, or get a specific comment by ID. Exactly one of taskId, projectId, or commentId must be provided.",
|
|
2946
|
-
parameters:
|
|
2947
|
-
outputSchema:
|
|
2987
|
+
parameters: jn,
|
|
2988
|
+
outputSchema: Sn,
|
|
2948
2989
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
2949
2990
|
async execute(e, t) {
|
|
2950
2991
|
const o = [e.taskId, e.projectId, e.commentId].filter(Boolean);
|
|
@@ -2979,7 +3020,7 @@ const kn = {
|
|
|
2979
3020
|
throw new Error("Invalid state: no search parameter provided");
|
|
2980
3021
|
const c = i.map(we);
|
|
2981
3022
|
return {
|
|
2982
|
-
textContent:
|
|
3023
|
+
textContent: $n({
|
|
2983
3024
|
comments: c,
|
|
2984
3025
|
searchType: e.commentId ? "single" : e.taskId ? "task" : "project",
|
|
2985
3026
|
searchId: e.commentId || e.taskId || e.projectId || "",
|
|
@@ -2997,7 +3038,7 @@ const kn = {
|
|
|
2997
3038
|
};
|
|
2998
3039
|
}
|
|
2999
3040
|
};
|
|
3000
|
-
function
|
|
3041
|
+
function $n({
|
|
3001
3042
|
comments: e,
|
|
3002
3043
|
searchType: t,
|
|
3003
3044
|
searchId: o,
|
|
@@ -3017,59 +3058,59 @@ function vn({
|
|
|
3017
3058
|
a = `Found ${e.length} ${d} for ${t} ${o}${c}`, r && (a += " • More available");
|
|
3018
3059
|
}
|
|
3019
3060
|
if (n) {
|
|
3020
|
-
const i =
|
|
3061
|
+
const i = Xt([], n);
|
|
3021
3062
|
return `${a}
|
|
3022
3063
|
${i}`;
|
|
3023
3064
|
}
|
|
3024
3065
|
return a;
|
|
3025
3066
|
}
|
|
3026
|
-
function
|
|
3067
|
+
function es(e) {
|
|
3027
3068
|
const t = e.getUTCFullYear(), o = String(e.getUTCMonth() + 1).padStart(2, "0"), r = String(e.getUTCDate()).padStart(2, "0");
|
|
3028
3069
|
return `${t}-${o}-${r}`;
|
|
3029
3070
|
}
|
|
3030
|
-
function
|
|
3071
|
+
function Dn(e) {
|
|
3031
3072
|
const t = /^([+-])(\d{2}):(\d{2})$/.exec(e);
|
|
3032
3073
|
if (!t)
|
|
3033
3074
|
return 0;
|
|
3034
3075
|
const [, o, r, n] = t, a = Number(r) * 60 + Number(n);
|
|
3035
3076
|
return o === "-" ? -a : a;
|
|
3036
3077
|
}
|
|
3037
|
-
function
|
|
3078
|
+
function An(e, t) {
|
|
3038
3079
|
const o = new Date(e.getTime() + t * 60 * 1e3);
|
|
3039
|
-
return
|
|
3080
|
+
return es(o);
|
|
3040
3081
|
}
|
|
3041
|
-
function
|
|
3082
|
+
function Tt(e, t) {
|
|
3042
3083
|
const [o, r, n] = e.split("-"), a = Number(o), i = Number(r), c = Number(n);
|
|
3043
3084
|
if (!Number.isFinite(a) || !Number.isFinite(i) || !Number.isFinite(c))
|
|
3044
3085
|
throw new Error(`Invalid date format: ${e}. Expected YYYY-MM-DD.`);
|
|
3045
3086
|
const d = new Date(Date.UTC(a, i - 1, c));
|
|
3046
|
-
return d.setUTCDate(d.getUTCDate() + t),
|
|
3087
|
+
return d.setUTCDate(d.getUTCDate() + t), es(d);
|
|
3047
3088
|
}
|
|
3048
|
-
const
|
|
3089
|
+
const xn = ["and", "or"], ct = {
|
|
3049
3090
|
labels: s.string().array().optional().describe("The labels to filter the tasks by"),
|
|
3050
|
-
labelsOperator: s.enum(
|
|
3091
|
+
labelsOperator: s.enum(xn).optional().describe(
|
|
3051
3092
|
'The operator to use when filtering by labels. This will dictate whether a task has all labels, or some of them. Default is "or".'
|
|
3052
3093
|
)
|
|
3053
3094
|
};
|
|
3054
|
-
function
|
|
3095
|
+
function dt(e = [], t = "or") {
|
|
3055
3096
|
if (e.length === 0) return "";
|
|
3056
3097
|
const o = t === "and" ? " & " : " | ";
|
|
3057
3098
|
return `(${e.map((a) => a.startsWith("@") ? a : `@${a}`).join(` ${o} `)})`;
|
|
3058
3099
|
}
|
|
3059
|
-
const
|
|
3060
|
-
function
|
|
3100
|
+
const En = 7;
|
|
3101
|
+
function On({
|
|
3061
3102
|
since: e,
|
|
3062
3103
|
until: t,
|
|
3063
3104
|
userGmtOffset: o,
|
|
3064
3105
|
now: r = /* @__PURE__ */ new Date()
|
|
3065
3106
|
}) {
|
|
3066
|
-
const n =
|
|
3107
|
+
const n = Dn(o), a = An(r, n), i = En - 1, c = t ?? (e ? Tt(e, i) : a);
|
|
3067
3108
|
return {
|
|
3068
|
-
since: e ??
|
|
3109
|
+
since: e ?? Tt(c, -i),
|
|
3069
3110
|
until: c
|
|
3070
3111
|
};
|
|
3071
3112
|
}
|
|
3072
|
-
const
|
|
3113
|
+
const Un = {
|
|
3073
3114
|
getBy: s.enum(["completion", "due"]).default("completion").describe(
|
|
3074
3115
|
'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).'
|
|
3075
3116
|
),
|
|
@@ -3092,18 +3133,18 @@ const Dn = {
|
|
|
3092
3133
|
cursor: s.string().optional().describe(
|
|
3093
3134
|
"The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters)."
|
|
3094
3135
|
),
|
|
3095
|
-
...
|
|
3096
|
-
},
|
|
3136
|
+
...ct
|
|
3137
|
+
}, Pn = {
|
|
3097
3138
|
tasks: s.array(J).describe("The found completed tasks."),
|
|
3098
3139
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
3099
3140
|
totalCount: s.number().describe("The total number of tasks in this page."),
|
|
3100
3141
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
3101
3142
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
3102
|
-
},
|
|
3143
|
+
}, _n = {
|
|
3103
3144
|
name: f.FIND_COMPLETED_TASKS,
|
|
3104
3145
|
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.",
|
|
3105
|
-
parameters:
|
|
3106
|
-
outputSchema:
|
|
3146
|
+
parameters: Un,
|
|
3147
|
+
outputSchema: Pn,
|
|
3107
3148
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3108
3149
|
async execute(e, t) {
|
|
3109
3150
|
const { getBy: o, labels: r, labelsOperator: n, since: a, until: i, responsibleUser: c, projectId: d, ...l } = e;
|
|
@@ -3111,13 +3152,13 @@ const Dn = {
|
|
|
3111
3152
|
throw new Error(
|
|
3112
3153
|
"Cursor pagination requires explicit since and until. Reuse structuredContent.appliedFilters.since and structuredContent.appliedFilters.until from the previous page."
|
|
3113
3154
|
);
|
|
3114
|
-
const p = await
|
|
3115
|
-
let h =
|
|
3155
|
+
const p = await tt(t, c), u = p?.email;
|
|
3156
|
+
let h = dt(r, n);
|
|
3116
3157
|
p && u && (h = ae(h, `assigned to: ${u}`));
|
|
3117
3158
|
const k = await t.getUser(), b = k.tzInfo?.gmtString || "+00:00", C = await K({
|
|
3118
3159
|
projectId: d,
|
|
3119
3160
|
user: k
|
|
3120
|
-
}), I =
|
|
3161
|
+
}), I = On({
|
|
3121
3162
|
since: a,
|
|
3122
3163
|
until: i,
|
|
3123
3164
|
userGmtOffset: b
|
|
@@ -3139,7 +3180,7 @@ const Dn = {
|
|
|
3139
3180
|
...h ? { filterQuery: h, filterLang: "en" } : {}
|
|
3140
3181
|
}), S = v.map(_);
|
|
3141
3182
|
return {
|
|
3142
|
-
textContent:
|
|
3183
|
+
textContent: Rn({
|
|
3143
3184
|
tasks: S,
|
|
3144
3185
|
args: R,
|
|
3145
3186
|
nextCursor: $,
|
|
@@ -3155,7 +3196,7 @@ const Dn = {
|
|
|
3155
3196
|
};
|
|
3156
3197
|
}
|
|
3157
3198
|
};
|
|
3158
|
-
function
|
|
3199
|
+
function Rn({
|
|
3159
3200
|
tasks: e,
|
|
3160
3201
|
args: t,
|
|
3161
3202
|
nextCursor: o,
|
|
@@ -3181,26 +3222,26 @@ function En({
|
|
|
3181
3222
|
zeroReasonHints: c
|
|
3182
3223
|
});
|
|
3183
3224
|
}
|
|
3184
|
-
const
|
|
3225
|
+
const Nn = {
|
|
3185
3226
|
searchText: s.string().optional().describe(
|
|
3186
3227
|
'Search for a goal by name (partial and case insensitive match). Supports wildcards (e.g. "ship*"). If omitted, all goals are returned.'
|
|
3187
3228
|
),
|
|
3188
|
-
ownerType: s.enum(
|
|
3229
|
+
ownerType: s.enum(Ss).optional().describe("Filter by ownership type. Omit for all accessible goals."),
|
|
3189
3230
|
limit: s.number().int().min(1).max(j.GOALS_MAX).default(j.GOALS_DEFAULT).describe("The maximum number of goals to return per page."),
|
|
3190
3231
|
cursor: s.string().optional().describe(
|
|
3191
3232
|
"The cursor to get the next page of goals (cursor is obtained from the previous call to this tool, with the same parameters)."
|
|
3192
3233
|
)
|
|
3193
|
-
},
|
|
3234
|
+
}, Ln = {
|
|
3194
3235
|
goals: s.array(Se).describe("The found goals."),
|
|
3195
3236
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
3196
3237
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
3197
3238
|
totalCount: s.number().describe("The total number of goals returned in this page."),
|
|
3198
3239
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
3199
|
-
},
|
|
3240
|
+
}, Mn = {
|
|
3200
3241
|
name: f.FIND_GOALS,
|
|
3201
3242
|
description: "Search for goals by name or list all accessible goals. Results are paginated — use the returned `nextCursor` to fetch subsequent pages.",
|
|
3202
|
-
parameters:
|
|
3203
|
-
outputSchema:
|
|
3243
|
+
parameters: Nn,
|
|
3244
|
+
outputSchema: Ln,
|
|
3204
3245
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3205
3246
|
async execute(e, t) {
|
|
3206
3247
|
const o = e.searchText ? await t.searchGoals({
|
|
@@ -3238,7 +3279,7 @@ const On = {
|
|
|
3238
3279
|
}
|
|
3239
3280
|
};
|
|
3240
3281
|
}
|
|
3241
|
-
},
|
|
3282
|
+
}, Fn = {
|
|
3242
3283
|
searchText: s.string().optional().describe(
|
|
3243
3284
|
'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.'
|
|
3244
3285
|
),
|
|
@@ -3246,7 +3287,7 @@ const On = {
|
|
|
3246
3287
|
cursor: s.string().optional().describe(
|
|
3247
3288
|
"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."
|
|
3248
3289
|
)
|
|
3249
|
-
},
|
|
3290
|
+
}, Hn = {
|
|
3250
3291
|
labels: s.array(pe).describe("The found personal labels."),
|
|
3251
3292
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
3252
3293
|
totalCount: s.number().describe("The total number of labels in this page."),
|
|
@@ -3255,22 +3296,22 @@ const On = {
|
|
|
3255
3296
|
"Names of all shared labels visible to you. These have no IDs or metadata — use their names directly when filtering tasks."
|
|
3256
3297
|
),
|
|
3257
3298
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
3258
|
-
},
|
|
3299
|
+
}, Wn = {
|
|
3259
3300
|
name: f.FIND_LABELS,
|
|
3260
3301
|
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.",
|
|
3261
|
-
parameters:
|
|
3262
|
-
outputSchema:
|
|
3302
|
+
parameters: Fn,
|
|
3303
|
+
outputSchema: Hn,
|
|
3263
3304
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3264
3305
|
async execute(e, t) {
|
|
3265
3306
|
const [o, r] = await Promise.all([
|
|
3266
|
-
e.searchText ?
|
|
3307
|
+
e.searchText ? Fo(t, e.searchText).then((c) => ({
|
|
3267
3308
|
results: c,
|
|
3268
3309
|
nextCursor: null
|
|
3269
3310
|
})) : t.getLabels({ limit: e.limit, cursor: e.cursor ?? null }),
|
|
3270
|
-
|
|
3311
|
+
Ho(t)
|
|
3271
3312
|
]), { results: n, nextCursor: a } = o, i = e.searchText ? { searchText: e.searchText } : { limit: e.limit, cursor: e.cursor };
|
|
3272
3313
|
return {
|
|
3273
|
-
textContent:
|
|
3314
|
+
textContent: Gn({ labels: n, args: e, nextCursor: a, sharedLabels: r }),
|
|
3274
3315
|
structuredContent: {
|
|
3275
3316
|
labels: n.map((c) => pe.parse(c)),
|
|
3276
3317
|
nextCursor: a ?? void 0,
|
|
@@ -3282,7 +3323,7 @@ const On = {
|
|
|
3282
3323
|
};
|
|
3283
3324
|
}
|
|
3284
3325
|
};
|
|
3285
|
-
function
|
|
3326
|
+
function Gn({
|
|
3286
3327
|
labels: e,
|
|
3287
3328
|
args: t,
|
|
3288
3329
|
nextCursor: o,
|
|
@@ -3290,7 +3331,7 @@ function Ln({
|
|
|
3290
3331
|
}) {
|
|
3291
3332
|
const n = t.searchText ? `All labels matching "${t.searchText}"` : "Labels", a = [];
|
|
3292
3333
|
t.searchText && a.push(`searchText: "${t.searchText}"`);
|
|
3293
|
-
const i = 10, d = e.slice(0, i).map(
|
|
3334
|
+
const i = 10, d = e.slice(0, i).map(Gr).join(`
|
|
3294
3335
|
`), l = e.length - i, p = l > 0 ? `${d}
|
|
3295
3336
|
…and ${l} more` : d, u = [];
|
|
3296
3337
|
e.length === 0 && (t.searchText ? (u.push("Try broader search terms"), u.push("Check spelling"), u.push("Remove searchText to see all labels")) : u.push("No personal labels created yet"));
|
|
@@ -3307,15 +3348,15 @@ No shared labels.`;
|
|
|
3307
3348
|
zeroReasonHints: u
|
|
3308
3349
|
}) + m;
|
|
3309
3350
|
}
|
|
3310
|
-
const { FIND_PROJECTS:
|
|
3351
|
+
const { FIND_PROJECTS: ts, ADD_TASKS: ss, UPDATE_TASKS: os } = f, Bn = {
|
|
3311
3352
|
projectId: s.string().min(1).optional().describe(
|
|
3312
3353
|
'Optional. If provided, searches only collaborators of this project. If omitted, searches across the collaborators of all shared projects the authenticated user can access (plus the authenticated user themselves) — use this for general "find a user" / "who is X" lookups.'
|
|
3313
3354
|
),
|
|
3314
3355
|
searchTerm: s.string().optional().describe(
|
|
3315
3356
|
"Search for a user by name or email (partial and case insensitive match). If omitted, all users are returned."
|
|
3316
3357
|
)
|
|
3317
|
-
},
|
|
3318
|
-
collaborators: s.array(
|
|
3358
|
+
}, Yn = {
|
|
3359
|
+
collaborators: s.array(Jo).describe("The found users."),
|
|
3319
3360
|
projectInfo: s.object({
|
|
3320
3361
|
id: s.string().describe("The project ID."),
|
|
3321
3362
|
name: s.string().describe("The project name."),
|
|
@@ -3324,16 +3365,16 @@ const { FIND_PROJECTS: Xt, ADD_TASKS: Zt, UPDATE_TASKS: Qt } = f, Mn = {
|
|
|
3324
3365
|
totalCount: s.number().describe("The total number of users found."),
|
|
3325
3366
|
totalAvailable: s.number().optional().describe("The total number of available users before the search filter was applied."),
|
|
3326
3367
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
3327
|
-
},
|
|
3368
|
+
}, qn = {
|
|
3328
3369
|
name: f.FIND_PROJECT_COLLABORATORS,
|
|
3329
3370
|
description: `Find Todoist users (collaborators, teammates) by name or email to look up their user ID. Use this whenever the user asks to find, look up, or identify a person — e.g. "find Carrie's user ID", "who is Ernesto", "look up a user". When projectId is omitted, searches across the collaborators of every shared project the authenticated user has access to, plus the authenticated user themselves — an empty result means the person is not a collaborator on any project you share with them, not necessarily that they do not exist in Todoist. When projectId is provided, searches only that project. Partial, case-insensitive match on name and email.`,
|
|
3330
|
-
parameters:
|
|
3331
|
-
outputSchema:
|
|
3371
|
+
parameters: Bn,
|
|
3372
|
+
outputSchema: Yn,
|
|
3332
3373
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3333
3374
|
async execute(e, t) {
|
|
3334
3375
|
const { projectId: o, searchTerm: r } = e;
|
|
3335
3376
|
if (!o)
|
|
3336
|
-
return
|
|
3377
|
+
return zn({ searchTerm: r, client: t, appliedFilters: e });
|
|
3337
3378
|
let n = o, a;
|
|
3338
3379
|
try {
|
|
3339
3380
|
if (a = await t.getProject(o), !a)
|
|
@@ -3344,7 +3385,7 @@ const { FIND_PROJECTS: Xt, ADD_TASKS: Zt, UPDATE_TASKS: Qt } = f, Mn = {
|
|
|
3344
3385
|
|
|
3345
3386
|
**Next steps:**
|
|
3346
3387
|
• Share the project to enable collaboration
|
|
3347
|
-
• Use ${
|
|
3388
|
+
• Use ${ss} and ${os} for assignment features once shared`,
|
|
3348
3389
|
structuredContent: {
|
|
3349
3390
|
collaborators: [],
|
|
3350
3391
|
projectInfo: {
|
|
@@ -3381,9 +3422,9 @@ const { FIND_PROJECTS: Xt, ADD_TASKS: Zt, UPDATE_TASKS: Qt } = f, Mn = {
|
|
|
3381
3422
|
appliedFilters: e
|
|
3382
3423
|
}
|
|
3383
3424
|
};
|
|
3384
|
-
const c =
|
|
3425
|
+
const c = rs(i, r);
|
|
3385
3426
|
return {
|
|
3386
|
-
textContent:
|
|
3427
|
+
textContent: ns({
|
|
3387
3428
|
collaborators: c,
|
|
3388
3429
|
projectName: n,
|
|
3389
3430
|
searchTerm: r,
|
|
@@ -3403,18 +3444,18 @@ const { FIND_PROJECTS: Xt, ADD_TASKS: Zt, UPDATE_TASKS: Qt } = f, Mn = {
|
|
|
3403
3444
|
};
|
|
3404
3445
|
}
|
|
3405
3446
|
};
|
|
3406
|
-
async function
|
|
3447
|
+
async function zn({
|
|
3407
3448
|
searchTerm: e,
|
|
3408
3449
|
client: t,
|
|
3409
3450
|
appliedFilters: o
|
|
3410
3451
|
}) {
|
|
3411
|
-
const r = await G.getAllCollaborators(t), n = await
|
|
3452
|
+
const r = await G.getAllCollaborators(t), n = await Kn(t, r);
|
|
3412
3453
|
if (n.length === 0)
|
|
3413
3454
|
return {
|
|
3414
3455
|
textContent: `No users found. You may have no shared projects, or collaborator data is not accessible.
|
|
3415
3456
|
|
|
3416
3457
|
**Next steps:**
|
|
3417
|
-
• Use ${
|
|
3458
|
+
• Use ${ts} to find shared projects
|
|
3418
3459
|
• Share a project to add collaborators
|
|
3419
3460
|
• Ensure you have permission to view collaborators`,
|
|
3420
3461
|
structuredContent: {
|
|
@@ -3425,9 +3466,9 @@ async function Wn({
|
|
|
3425
3466
|
appliedFilters: o
|
|
3426
3467
|
}
|
|
3427
3468
|
};
|
|
3428
|
-
const a =
|
|
3469
|
+
const a = rs(n, e);
|
|
3429
3470
|
return {
|
|
3430
|
-
textContent:
|
|
3471
|
+
textContent: ns({
|
|
3431
3472
|
collaborators: a,
|
|
3432
3473
|
projectName: void 0,
|
|
3433
3474
|
searchTerm: e,
|
|
@@ -3442,7 +3483,7 @@ async function Wn({
|
|
|
3442
3483
|
}
|
|
3443
3484
|
};
|
|
3444
3485
|
}
|
|
3445
|
-
async function
|
|
3486
|
+
async function Kn(e, t) {
|
|
3446
3487
|
try {
|
|
3447
3488
|
const o = await e.getUser();
|
|
3448
3489
|
return !o || t.some((r) => r.id === o.id) ? t : [
|
|
@@ -3453,7 +3494,7 @@ async function Gn(e, t) {
|
|
|
3453
3494
|
return t;
|
|
3454
3495
|
}
|
|
3455
3496
|
}
|
|
3456
|
-
function
|
|
3497
|
+
function rs(e, t) {
|
|
3457
3498
|
if (!t)
|
|
3458
3499
|
return e;
|
|
3459
3500
|
const o = t.toLowerCase().trim();
|
|
@@ -3461,7 +3502,7 @@ function es(e, t) {
|
|
|
3461
3502
|
(r) => r.name.toLowerCase().includes(o) || r.email.toLowerCase().includes(o)
|
|
3462
3503
|
);
|
|
3463
3504
|
}
|
|
3464
|
-
function
|
|
3505
|
+
function ns({
|
|
3465
3506
|
collaborators: e,
|
|
3466
3507
|
projectName: t,
|
|
3467
3508
|
searchTerm: o,
|
|
@@ -3477,7 +3518,7 @@ function ts({
|
|
|
3477
3518
|
const l = [];
|
|
3478
3519
|
e.length === 0 && o && (l.push(`No users match "${o}"`), l.push("Try a broader search term or check spelling"), r > 0 && l.push(`${r} users available without filter`));
|
|
3479
3520
|
const p = [];
|
|
3480
|
-
return e.length > 0 ? (p.push(`Use ${
|
|
3521
|
+
return e.length > 0 ? (p.push(`Use ${ss} with responsibleUser to assign new tasks`), p.push(`Use ${os} with responsibleUser to reassign existing tasks`), p.push("Use user names, emails, or IDs for assignments")) : (p.push(`Use ${ts} to find other projects`), o && r > 0 && p.push("Try searching without filters to see all users")), M({
|
|
3481
3522
|
subject: i,
|
|
3482
3523
|
count: e.length,
|
|
3483
3524
|
filterHints: c,
|
|
@@ -3487,11 +3528,11 @@ function ts({
|
|
|
3487
3528
|
nextSteps: p
|
|
3488
3529
|
});
|
|
3489
3530
|
}
|
|
3490
|
-
const { ADD_PROJECTS:
|
|
3531
|
+
const { ADD_PROJECTS: wt } = f, Vn = {
|
|
3491
3532
|
active: "projects",
|
|
3492
3533
|
archived: "archived projects",
|
|
3493
3534
|
all: "projects (active and archived)"
|
|
3494
|
-
},
|
|
3535
|
+
}, Jn = {
|
|
3495
3536
|
searchText: s.string().optional().describe(
|
|
3496
3537
|
'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.'
|
|
3497
3538
|
),
|
|
@@ -3502,26 +3543,26 @@ const { ADD_PROJECTS: Tt } = f, Bn = {
|
|
|
3502
3543
|
archivedStatus: s.enum(["active", "archived", "all"]).optional().describe(
|
|
3503
3544
|
"Which projects to return by archive status: 'active' (default, non-archived only), 'archived' (archived only), or 'all' (both active and archived). Each project includes an isArchived field. Archived projects can be deleted via the delete-object tool (type: 'project')."
|
|
3504
3545
|
)
|
|
3505
|
-
},
|
|
3546
|
+
}, Xn = {
|
|
3506
3547
|
projects: s.array(ue).describe("The found projects."),
|
|
3507
3548
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
3508
3549
|
totalCount: s.number().describe("The total number of projects in this page."),
|
|
3509
3550
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
3510
3551
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
3511
|
-
},
|
|
3552
|
+
}, Zn = {
|
|
3512
3553
|
name: f.FIND_PROJECTS,
|
|
3513
3554
|
description: "List all projects or search for projects by name. By default only active projects are returned; use archivedStatus ('archived' or 'all') to include archived projects. When searching or when archivedStatus is 'all', all matching projects are returned (pagination is ignored). Otherwise projects are returned with pagination.",
|
|
3514
|
-
parameters:
|
|
3515
|
-
outputSchema:
|
|
3555
|
+
parameters: Jn,
|
|
3556
|
+
outputSchema: Xn,
|
|
3516
3557
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3517
3558
|
async execute(e, t) {
|
|
3518
3559
|
const { searchText: o } = e, r = e.archivedStatus ?? "active";
|
|
3519
3560
|
let n, a = null;
|
|
3520
3561
|
if (o || r === "all") {
|
|
3521
3562
|
const c = Promise.resolve([]), [d, l] = await Promise.all([
|
|
3522
|
-
r === "archived" ? c : o ?
|
|
3523
|
-
r === "active" ? c :
|
|
3524
|
-
]), p = o ?
|
|
3563
|
+
r === "archived" ? c : o ? qt(t, o) : No(t),
|
|
3564
|
+
r === "active" ? c : Lo(t)
|
|
3565
|
+
]), p = o ? Mo(o) : null, u = p ? l.filter((m) => p.test(m.name)) : l;
|
|
3525
3566
|
n = [...d, ...u];
|
|
3526
3567
|
} else {
|
|
3527
3568
|
const c = r === "archived" ? await t.getArchivedProjects({
|
|
@@ -3532,7 +3573,7 @@ const { ADD_PROJECTS: Tt } = f, Bn = {
|
|
|
3532
3573
|
}
|
|
3533
3574
|
const i = n.map(V);
|
|
3534
3575
|
return {
|
|
3535
|
-
textContent:
|
|
3576
|
+
textContent: Qn({ projects: i, args: e, nextCursor: a }),
|
|
3536
3577
|
structuredContent: {
|
|
3537
3578
|
projects: i,
|
|
3538
3579
|
nextCursor: a ?? void 0,
|
|
@@ -3543,17 +3584,17 @@ const { ADD_PROJECTS: Tt } = f, Bn = {
|
|
|
3543
3584
|
};
|
|
3544
3585
|
}
|
|
3545
3586
|
};
|
|
3546
|
-
function
|
|
3587
|
+
function Qn({
|
|
3547
3588
|
projects: e,
|
|
3548
3589
|
args: t,
|
|
3549
3590
|
nextCursor: o
|
|
3550
3591
|
}) {
|
|
3551
|
-
const r =
|
|
3592
|
+
const r = Vn[t.archivedStatus ?? "active"], n = t.searchText ? `All ${r} matching "${t.searchText}"` : `${r.charAt(0).toUpperCase()}${r.slice(1)}`, a = [];
|
|
3552
3593
|
t.searchText && a.push(`searchText: "${t.searchText}"`), t.archivedStatus && t.archivedStatus !== "active" && a.push(`archivedStatus: "${t.archivedStatus}"`);
|
|
3553
|
-
const i = 10, d = e.slice(0, i).map(
|
|
3594
|
+
const i = 10, d = e.slice(0, i).map(Br).join(`
|
|
3554
3595
|
`), l = e.length - i, p = l > 0 ? `${d}
|
|
3555
3596
|
…and ${l} more` : d, u = [];
|
|
3556
|
-
return e.length === 0 && (t.searchText ? (u.push("Try broader search terms"), u.push("Check spelling"), u.push("Remove searchText to see all projects")) : t.archivedStatus === "archived" ? (u.push("No archived projects"), u.push("Use archivedStatus: 'all' to also see active projects")) : t.archivedStatus === "all" ? (u.push("No projects created yet"), u.push(`Use ${
|
|
3597
|
+
return e.length === 0 && (t.searchText ? (u.push("Try broader search terms"), u.push("Check spelling"), u.push("Remove searchText to see all projects")) : t.archivedStatus === "archived" ? (u.push("No archived projects"), u.push("Use archivedStatus: 'all' to also see active projects")) : t.archivedStatus === "all" ? (u.push("No projects created yet"), u.push(`Use ${wt} to create a project`)) : (u.push("No active projects"), u.push("Use archivedStatus: 'all' to include archived projects"), u.push(`Use ${wt} to create a project`))), M({
|
|
3557
3598
|
subject: n,
|
|
3558
3599
|
count: e.length,
|
|
3559
3600
|
limit: t.searchText || t.archivedStatus === "all" ? void 0 : t.limit,
|
|
@@ -3563,22 +3604,22 @@ function Kn({
|
|
|
3563
3604
|
zeroReasonHints: u
|
|
3564
3605
|
});
|
|
3565
3606
|
}
|
|
3566
|
-
const
|
|
3607
|
+
const ea = {
|
|
3567
3608
|
taskId: s.string().optional().describe(
|
|
3568
3609
|
"Find all reminders for a specific task. Returns both time-based and location reminders."
|
|
3569
3610
|
),
|
|
3570
3611
|
reminderId: s.string().optional().describe("Get a specific time-based reminder (relative or absolute) by its ID."),
|
|
3571
3612
|
locationReminderId: s.string().optional().describe("Get a specific location reminder by its ID.")
|
|
3572
|
-
},
|
|
3573
|
-
reminders: s.array(
|
|
3613
|
+
}, ta = {
|
|
3614
|
+
reminders: s.array(rt).describe("The found reminders (time-based and location)."),
|
|
3574
3615
|
searchType: s.string().describe('The search type used: "task", "reminder", or "location_reminder".'),
|
|
3575
3616
|
searchId: s.string().describe("The ID used for the search."),
|
|
3576
3617
|
totalCount: s.number().describe("Total reminders in this response.")
|
|
3577
|
-
},
|
|
3618
|
+
}, sa = {
|
|
3578
3619
|
name: f.FIND_REMINDERS,
|
|
3579
3620
|
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.",
|
|
3580
|
-
parameters:
|
|
3581
|
-
outputSchema:
|
|
3621
|
+
parameters: ea,
|
|
3622
|
+
outputSchema: ta,
|
|
3582
3623
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3583
3624
|
async execute(e, t) {
|
|
3584
3625
|
const { taskId: o, reminderId: r, locationReminderId: n } = e, a = [o, r, n].filter(Boolean);
|
|
@@ -3624,7 +3665,7 @@ const Vn = {
|
|
|
3624
3665
|
})
|
|
3625
3666
|
]), l = [...i, ...c].map(he);
|
|
3626
3667
|
return {
|
|
3627
|
-
textContent:
|
|
3668
|
+
textContent: oa(l, o),
|
|
3628
3669
|
structuredContent: {
|
|
3629
3670
|
reminders: l,
|
|
3630
3671
|
searchType: "task",
|
|
@@ -3636,10 +3677,10 @@ const Vn = {
|
|
|
3636
3677
|
throw new Error("One of taskId, reminderId, or locationReminderId must be provided.");
|
|
3637
3678
|
}
|
|
3638
3679
|
};
|
|
3639
|
-
function
|
|
3680
|
+
function oa(e, t) {
|
|
3640
3681
|
if (e.length === 0)
|
|
3641
3682
|
return `No reminders found for task ${t}`;
|
|
3642
|
-
const { timeBasedCount: o, locationCount: r } =
|
|
3683
|
+
const { timeBasedCount: o, locationCount: r } = zt(e), n = [];
|
|
3643
3684
|
if (o > 0) {
|
|
3644
3685
|
const a = o > 1 ? "time-based reminders" : "time-based reminder";
|
|
3645
3686
|
n.push(`${o} ${a}`);
|
|
@@ -3650,22 +3691,22 @@ function Zn(e, t) {
|
|
|
3650
3691
|
}
|
|
3651
3692
|
return `Found ${n.join(" and ")} for task ${t}`;
|
|
3652
3693
|
}
|
|
3653
|
-
const { ADD_SECTIONS:
|
|
3694
|
+
const { ADD_SECTIONS: ra } = f, na = {
|
|
3654
3695
|
projectId: s.string().min(1).describe(
|
|
3655
3696
|
'The ID of the project to search sections in. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
3656
3697
|
),
|
|
3657
3698
|
searchText: s.string().optional().describe(
|
|
3658
3699
|
'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.'
|
|
3659
3700
|
)
|
|
3660
|
-
},
|
|
3701
|
+
}, aa = {
|
|
3661
3702
|
sections: s.array(ce).describe("The found sections."),
|
|
3662
3703
|
totalCount: s.number().describe("The total number of sections found."),
|
|
3663
3704
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
3664
|
-
},
|
|
3705
|
+
}, ia = {
|
|
3665
3706
|
name: f.FIND_SECTIONS,
|
|
3666
3707
|
description: "Search for sections by name or other criteria in a project. When searching, uses server-side search to avoid fetching all sections.",
|
|
3667
|
-
parameters:
|
|
3668
|
-
outputSchema:
|
|
3708
|
+
parameters: na,
|
|
3709
|
+
outputSchema: aa,
|
|
3669
3710
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3670
3711
|
async execute(e, t) {
|
|
3671
3712
|
const o = await K({
|
|
@@ -3673,12 +3714,12 @@ const { ADD_SECTIONS: Qn } = f, ea = {
|
|
|
3673
3714
|
client: t
|
|
3674
3715
|
});
|
|
3675
3716
|
let r;
|
|
3676
|
-
e.searchText ? r = await
|
|
3717
|
+
e.searchText ? r = await Wo(t, e.searchText, o) : r = (await t.getSections({
|
|
3677
3718
|
projectId: o
|
|
3678
3719
|
})).results;
|
|
3679
3720
|
const n = r.map(X);
|
|
3680
3721
|
return {
|
|
3681
|
-
textContent:
|
|
3722
|
+
textContent: ca({
|
|
3682
3723
|
sections: n,
|
|
3683
3724
|
projectId: e.projectId,
|
|
3684
3725
|
searchText: e.searchText
|
|
@@ -3691,13 +3732,13 @@ const { ADD_SECTIONS: Qn } = f, ea = {
|
|
|
3691
3732
|
};
|
|
3692
3733
|
}
|
|
3693
3734
|
};
|
|
3694
|
-
function
|
|
3735
|
+
function ca({
|
|
3695
3736
|
sections: e,
|
|
3696
3737
|
projectId: t,
|
|
3697
3738
|
searchText: o
|
|
3698
3739
|
}) {
|
|
3699
3740
|
const r = [];
|
|
3700
|
-
o ? (r.push("Try broader search terms"), r.push("Check spelling"), r.push("Remove searchText to see all sections")) : (r.push("Project has no sections yet"), r.push(`Use ${
|
|
3741
|
+
o ? (r.push("Try broader search terms"), r.push("Check spelling"), r.push("Remove searchText to see all sections")) : (r.push("Project has no sections yet"), r.push(`Use ${ra} to create sections`));
|
|
3701
3742
|
const n = o ? `Sections in project ${t} matching "${o}"` : `Sections in project ${t}`, a = e.length > 0 ? e.map((i) => ` ${i.name} • id=${i.id}`).join(`
|
|
3702
3743
|
`) : void 0;
|
|
3703
3744
|
return M({
|
|
@@ -3707,10 +3748,10 @@ function oa({
|
|
|
3707
3748
|
zeroReasonHints: r
|
|
3708
3749
|
});
|
|
3709
3750
|
}
|
|
3710
|
-
function
|
|
3751
|
+
function as(e) {
|
|
3711
3752
|
return /* @__PURE__ */ new Date(`${e}T00:00:00`);
|
|
3712
3753
|
}
|
|
3713
|
-
const
|
|
3754
|
+
const da = {
|
|
3714
3755
|
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'."),
|
|
3715
3756
|
overdueOption: s.enum(["overdue-only", "include-overdue", "exclude-overdue"]).optional().describe(
|
|
3716
3757
|
"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'."
|
|
@@ -3725,57 +3766,57 @@ const ra = {
|
|
|
3725
3766
|
responsibleUser: s.string().optional().describe(
|
|
3726
3767
|
"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."
|
|
3727
3768
|
),
|
|
3728
|
-
responsibleUserFiltering: s.enum(
|
|
3769
|
+
responsibleUserFiltering: s.enum(Bt).optional().describe(
|
|
3729
3770
|
"Filter when responsibleUser is omitted. 'assigned'=assigned to others; 'unassignedOrMe'=unassigned+mine; 'all'=everyone. Default: 'unassignedOrMe'."
|
|
3730
3771
|
),
|
|
3731
|
-
...
|
|
3732
|
-
},
|
|
3772
|
+
...ct
|
|
3773
|
+
}, la = {
|
|
3733
3774
|
tasks: s.array(J).describe("The found tasks."),
|
|
3734
3775
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
3735
3776
|
totalCount: s.number().describe("The total number of tasks in this page."),
|
|
3736
3777
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
3737
3778
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
3738
|
-
},
|
|
3779
|
+
}, ua = {
|
|
3739
3780
|
name: f.FIND_TASKS_BY_DATE,
|
|
3740
3781
|
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.",
|
|
3741
|
-
parameters:
|
|
3742
|
-
outputSchema:
|
|
3782
|
+
parameters: da,
|
|
3783
|
+
outputSchema: la,
|
|
3743
3784
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3744
3785
|
async execute(e, t) {
|
|
3745
3786
|
if (!e.startDate && e.overdueOption !== "overdue-only")
|
|
3746
3787
|
throw new Error(
|
|
3747
3788
|
"Either startDate must be provided or overdueOption must be set to overdue-only"
|
|
3748
3789
|
);
|
|
3749
|
-
const o = await
|
|
3790
|
+
const o = await tt(t, e.responsibleUser), r = o?.userId, n = o?.email;
|
|
3750
3791
|
let a = "";
|
|
3751
3792
|
if (e.overdueOption === "overdue-only")
|
|
3752
3793
|
a = "overdue";
|
|
3753
3794
|
else if (e.startDate === "today")
|
|
3754
3795
|
if (e.daysCount > 1) {
|
|
3755
|
-
const u = /* @__PURE__ */ new Date(), m = re(u), h = Fe(u, e.daysCount), k =
|
|
3796
|
+
const u = /* @__PURE__ */ new Date(), m = re(u), h = Fe(u, e.daysCount), k = lt(h, { representation: "date" }), b = `(due after: ${m} | due: ${m}) & due before: ${k}`;
|
|
3756
3797
|
a = e.overdueOption === "exclude-overdue" ? b : `(${b} | overdue)`;
|
|
3757
3798
|
} else
|
|
3758
3799
|
a = e.overdueOption === "exclude-overdue" ? "today" : "(today | overdue)";
|
|
3759
3800
|
else if (e.startDate) {
|
|
3760
|
-
const u = e.startDate, m = Fe(
|
|
3801
|
+
const u = e.startDate, m = Fe(as(u), e.daysCount), h = lt(m, { representation: "date" });
|
|
3761
3802
|
a = `(due after: ${u} | due: ${u}) & due before: ${h}`;
|
|
3762
3803
|
}
|
|
3763
|
-
const i =
|
|
3804
|
+
const i = dt(e.labels, e.labelsOperator);
|
|
3764
3805
|
i.length > 0 && (a = ae(a, `(${i})`));
|
|
3765
|
-
const c =
|
|
3806
|
+
const c = Yt({
|
|
3766
3807
|
resolvedAssigneeId: r,
|
|
3767
3808
|
assigneeEmail: n,
|
|
3768
3809
|
responsibleUserFiltering: e.responsibleUserFiltering
|
|
3769
3810
|
});
|
|
3770
3811
|
a = ae(a, c);
|
|
3771
|
-
const { tasks: d, nextCursor: l } = await
|
|
3812
|
+
const { tasks: d, nextCursor: l } = await ot({
|
|
3772
3813
|
client: t,
|
|
3773
3814
|
query: a,
|
|
3774
3815
|
cursor: e.cursor,
|
|
3775
3816
|
limit: e.limit
|
|
3776
3817
|
});
|
|
3777
3818
|
return {
|
|
3778
|
-
textContent:
|
|
3819
|
+
textContent: pa({ tasks: d, args: e, nextCursor: l, assigneeEmail: n }),
|
|
3779
3820
|
structuredContent: {
|
|
3780
3821
|
tasks: d,
|
|
3781
3822
|
nextCursor: l ?? void 0,
|
|
@@ -3786,7 +3827,7 @@ const ra = {
|
|
|
3786
3827
|
};
|
|
3787
3828
|
}
|
|
3788
3829
|
};
|
|
3789
|
-
function
|
|
3830
|
+
function pa({
|
|
3790
3831
|
tasks: e,
|
|
3791
3832
|
args: t,
|
|
3792
3833
|
nextCursor: o,
|
|
@@ -3801,7 +3842,7 @@ function ia({
|
|
|
3801
3842
|
`today${c}${t.daysCount > 1 ? ` + ${t.daysCount - 1} more days` : ""}`
|
|
3802
3843
|
);
|
|
3803
3844
|
} else if (t.startDate) {
|
|
3804
|
-
const c = t.daysCount > 1 ? ` to ${re(Fe(
|
|
3845
|
+
const c = t.daysCount > 1 ? ` to ${re(Fe(as(t.startDate), t.daysCount))}` : "";
|
|
3805
3846
|
n.push(`${t.startDate}${c}`);
|
|
3806
3847
|
}
|
|
3807
3848
|
if (t.labels && t.labels.length > 0) {
|
|
@@ -3836,13 +3877,13 @@ function ia({
|
|
|
3836
3877
|
zeroReasonHints: i
|
|
3837
3878
|
});
|
|
3838
3879
|
}
|
|
3839
|
-
const
|
|
3840
|
-
class
|
|
3880
|
+
const ma = 300 * 1e3;
|
|
3881
|
+
class ha {
|
|
3841
3882
|
constructor() {
|
|
3842
3883
|
this.cache = null;
|
|
3843
3884
|
}
|
|
3844
3885
|
async getFilters(t) {
|
|
3845
|
-
if (this.cache && Date.now() - this.cache.timestamp <
|
|
3886
|
+
if (this.cache && Date.now() - this.cache.timestamp < ma)
|
|
3846
3887
|
return this.cache.filters;
|
|
3847
3888
|
const r = ((await t.sync({
|
|
3848
3889
|
resourceTypes: ["filters"],
|
|
@@ -3899,7 +3940,7 @@ ${p}` + (d.length > 5 ? `
|
|
|
3899
3940
|
this.cache = null;
|
|
3900
3941
|
}
|
|
3901
3942
|
}
|
|
3902
|
-
const
|
|
3943
|
+
const fa = new ha(), { FIND_COMPLETED_TASKS: vt, ADD_TASKS: It } = f, ba = {
|
|
3903
3944
|
searchText: s.string().optional().describe("The text to search for in tasks."),
|
|
3904
3945
|
projectId: s.string().optional().describe(
|
|
3905
3946
|
'Find tasks in this project. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
@@ -3907,7 +3948,7 @@ const la = new da(), { FIND_COMPLETED_TASKS: wt, ADD_TASKS: vt } = f, ua = {
|
|
|
3907
3948
|
sectionId: s.string().optional().describe("Find tasks in this section."),
|
|
3908
3949
|
parentId: s.string().optional().describe("Find subtasks of this parent task."),
|
|
3909
3950
|
responsibleUser: s.string().optional().describe("Find tasks assigned to this user. Can be a user ID, name, or email address."),
|
|
3910
|
-
responsibleUserFiltering: s.enum(
|
|
3951
|
+
responsibleUserFiltering: s.enum(Bt).optional().describe(
|
|
3911
3952
|
'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`.'
|
|
3912
3953
|
),
|
|
3913
3954
|
limit: s.number().int().min(1).max(j.TASKS_MAX).default(j.TASKS_DEFAULT).describe("The maximum number of tasks to return."),
|
|
@@ -3920,18 +3961,18 @@ const la = new da(), { FIND_COMPLETED_TASKS: wt, ADD_TASKS: vt } = f, ua = {
|
|
|
3920
3961
|
filterIdOrName: s.string().optional().describe(
|
|
3921
3962
|
"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."
|
|
3922
3963
|
),
|
|
3923
|
-
...
|
|
3924
|
-
},
|
|
3964
|
+
...ct
|
|
3965
|
+
}, ga = {
|
|
3925
3966
|
tasks: s.array(J).describe("The found tasks."),
|
|
3926
3967
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
3927
3968
|
totalCount: s.number().describe("The total number of tasks in this page."),
|
|
3928
3969
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
3929
3970
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
3930
|
-
},
|
|
3971
|
+
}, ya = {
|
|
3931
3972
|
name: f.FIND_TASKS,
|
|
3932
3973
|
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.",
|
|
3933
|
-
parameters:
|
|
3934
|
-
outputSchema:
|
|
3974
|
+
parameters: ba,
|
|
3975
|
+
outputSchema: ga,
|
|
3935
3976
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3936
3977
|
async execute(e, t) {
|
|
3937
3978
|
const {
|
|
@@ -3961,8 +4002,8 @@ const la = new da(), { FIND_COMPLETED_TASKS: wt, ADD_TASKS: vt } = f, ua = {
|
|
|
3961
4002
|
'The `filter`/`filterIdOrName` parameter cannot be combined with projectId, sectionId, or parentId. Use filter syntax instead (e.g. "##ProjectName").'
|
|
3962
4003
|
);
|
|
3963
4004
|
let C = m;
|
|
3964
|
-
h && (C = (await
|
|
3965
|
-
const I = await
|
|
4005
|
+
h && (C = (await fa.resolveFilter(t, h)).filterQuery);
|
|
4006
|
+
const I = await tt(t, i), x = I?.userId, w = I?.email;
|
|
3966
4007
|
if (r || n || a) {
|
|
3967
4008
|
const A = {
|
|
3968
4009
|
limit: d,
|
|
@@ -3973,7 +4014,7 @@ const la = new da(), { FIND_COMPLETED_TASKS: wt, ADD_TASKS: vt } = f, ua = {
|
|
|
3973
4014
|
let H = o ? Ae.filter(
|
|
3974
4015
|
(Z) => Z.content.toLowerCase().includes(o.toLowerCase()) || Z.description?.toLowerCase().includes(o.toLowerCase())
|
|
3975
4016
|
) : Ae;
|
|
3976
|
-
return H =
|
|
4017
|
+
return H = Ro({
|
|
3977
4018
|
tasks: H,
|
|
3978
4019
|
resolvedAssigneeId: x,
|
|
3979
4020
|
currentUserId: k.id,
|
|
@@ -4025,16 +4066,16 @@ const la = new da(), { FIND_COMPLETED_TASKS: wt, ADD_TASKS: vt } = f, ua = {
|
|
|
4025
4066
|
}
|
|
4026
4067
|
let y = C ? `(${C})` : "";
|
|
4027
4068
|
o && (y = ae(y, `search: ${o}`));
|
|
4028
|
-
const D =
|
|
4069
|
+
const D = dt(p, u);
|
|
4029
4070
|
if (y = ae(y, D), !(h && !i && !c)) {
|
|
4030
|
-
const A =
|
|
4071
|
+
const A = Yt({
|
|
4031
4072
|
resolvedAssigneeId: x,
|
|
4032
4073
|
assigneeEmail: w,
|
|
4033
4074
|
responsibleUserFiltering: c
|
|
4034
4075
|
});
|
|
4035
4076
|
y = ae(y, A);
|
|
4036
4077
|
}
|
|
4037
|
-
const { tasks: v, nextCursor: $ } = await
|
|
4078
|
+
const { tasks: v, nextCursor: $ } = await ot({
|
|
4038
4079
|
client: t,
|
|
4039
4080
|
query: y,
|
|
4040
4081
|
cursor: e.cursor,
|
|
@@ -4058,12 +4099,12 @@ const la = new da(), { FIND_COMPLETED_TASKS: wt, ADD_TASKS: vt } = f, ua = {
|
|
|
4058
4099
|
};
|
|
4059
4100
|
}
|
|
4060
4101
|
};
|
|
4061
|
-
function
|
|
4102
|
+
function ka(e) {
|
|
4062
4103
|
if (e.projectId) {
|
|
4063
4104
|
const t = [
|
|
4064
4105
|
e.searchText ? "No tasks in project match search" : "Project has no tasks yet"
|
|
4065
4106
|
];
|
|
4066
|
-
return e.searchText || t.push(`Use ${
|
|
4107
|
+
return e.searchText || t.push(`Use ${It} to create tasks`), t;
|
|
4067
4108
|
}
|
|
4068
4109
|
if (e.sectionId) {
|
|
4069
4110
|
const t = [e.searchText ? "No tasks in section match search" : "Section is empty"];
|
|
@@ -4071,7 +4112,7 @@ function ha(e) {
|
|
|
4071
4112
|
}
|
|
4072
4113
|
if (e.parentId) {
|
|
4073
4114
|
const t = [e.searchText ? "No subtasks match search" : "No subtasks created yet"];
|
|
4074
|
-
return e.searchText || t.push(`Use ${
|
|
4115
|
+
return e.searchText || t.push(`Use ${It} with parentId to add subtasks`), t;
|
|
4075
4116
|
}
|
|
4076
4117
|
return [];
|
|
4077
4118
|
}
|
|
@@ -4093,7 +4134,7 @@ function Pe({
|
|
|
4093
4134
|
const d = t.labels.map((l) => `@${l}`).join(t.labelsOperator === "and" ? " & " : " | ");
|
|
4094
4135
|
i.push(`labels: ${d}`);
|
|
4095
4136
|
}
|
|
4096
|
-
e.length === 0 && c.push(...
|
|
4137
|
+
e.length === 0 && c.push(...ka(t));
|
|
4097
4138
|
} else {
|
|
4098
4139
|
const d = n || t.responsibleUser, l = [];
|
|
4099
4140
|
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) {
|
|
@@ -4107,9 +4148,9 @@ function Pe({
|
|
|
4107
4148
|
if (e.length === 0) {
|
|
4108
4149
|
if (t.responsibleUser) {
|
|
4109
4150
|
const p = n || t.responsibleUser;
|
|
4110
|
-
c.push(`No tasks assigned to ${p}`), c.push("Check if the user name is correct"), c.push(`Check completed tasks with ${
|
|
4151
|
+
c.push(`No tasks assigned to ${p}`), c.push("Check if the user name is correct"), c.push(`Check completed tasks with ${vt}`);
|
|
4111
4152
|
}
|
|
4112
|
-
t.searchText && (c.push("Try broader search terms"), c.push("Verify spelling and try partial words"), t.responsibleUser || c.push(`Check completed tasks with ${
|
|
4153
|
+
t.searchText && (c.push("Try broader search terms"), c.push("Verify spelling and try partial words"), t.responsibleUser || c.push(`Check completed tasks with ${vt}`));
|
|
4113
4154
|
}
|
|
4114
4155
|
}
|
|
4115
4156
|
return M({
|
|
@@ -4122,11 +4163,11 @@ function Pe({
|
|
|
4122
4163
|
zeroReasonHints: c
|
|
4123
4164
|
});
|
|
4124
4165
|
}
|
|
4125
|
-
const
|
|
4166
|
+
const Ta = {
|
|
4126
4167
|
projectId: s.string().min(1).optional().describe(
|
|
4127
4168
|
"Optional project ID. If provided, shows detailed overview of that project. If omitted, shows overview of all projects."
|
|
4128
4169
|
)
|
|
4129
|
-
},
|
|
4170
|
+
}, is = s.lazy(
|
|
4130
4171
|
() => s.object({
|
|
4131
4172
|
id: s.string().describe("The project ID."),
|
|
4132
4173
|
name: s.string().describe("The project name."),
|
|
@@ -4139,9 +4180,9 @@ const fa = {
|
|
|
4139
4180
|
name: s.string()
|
|
4140
4181
|
})
|
|
4141
4182
|
),
|
|
4142
|
-
children: s.array(
|
|
4183
|
+
children: s.array(is).describe("Nested child projects.")
|
|
4143
4184
|
})
|
|
4144
|
-
),
|
|
4185
|
+
), wa = {
|
|
4145
4186
|
type: s.enum(["account_overview", "project_overview"]).describe("The type of overview returned."),
|
|
4146
4187
|
totalProjects: s.number().optional().describe("Total number of projects (account overview only)."),
|
|
4147
4188
|
totalTasks: s.number().optional().describe("Total number of tasks."),
|
|
@@ -4160,7 +4201,7 @@ const fa = {
|
|
|
4160
4201
|
name: s.string().describe("The inbox project name."),
|
|
4161
4202
|
sections: s.array(ce).describe("Sections in the inbox project.")
|
|
4162
4203
|
}).nullable().optional().describe("Inbox information (account overview only)."),
|
|
4163
|
-
projects: s.array(s.lazy(() =>
|
|
4204
|
+
projects: s.array(s.lazy(() => is)).optional().describe(
|
|
4164
4205
|
"List of projects with hierarchy, folders, and ordering (account overview only)."
|
|
4165
4206
|
),
|
|
4166
4207
|
project: s.object({
|
|
@@ -4175,7 +4216,7 @@ const fa = {
|
|
|
4175
4216
|
tasksWithoutSection: s.number()
|
|
4176
4217
|
}).optional().describe("Statistics object (project overview only).")
|
|
4177
4218
|
};
|
|
4178
|
-
function
|
|
4219
|
+
function va(e) {
|
|
4179
4220
|
const t = {};
|
|
4180
4221
|
for (const n of e)
|
|
4181
4222
|
t[n.id] = {
|
|
@@ -4200,7 +4241,7 @@ function ga(e) {
|
|
|
4200
4241
|
}
|
|
4201
4242
|
return r(o), o;
|
|
4202
4243
|
}
|
|
4203
|
-
async function
|
|
4244
|
+
async function Ia(e, t) {
|
|
4204
4245
|
const o = {};
|
|
4205
4246
|
return await Promise.all(
|
|
4206
4247
|
t.map(async (r) => {
|
|
@@ -4209,17 +4250,17 @@ async function ya(e, t) {
|
|
|
4209
4250
|
})
|
|
4210
4251
|
), o;
|
|
4211
4252
|
}
|
|
4212
|
-
function
|
|
4253
|
+
function cs(e, t, o = "") {
|
|
4213
4254
|
const r = [];
|
|
4214
4255
|
r.push(`${o}- Project: ${e.name} (id=${e.id})`);
|
|
4215
4256
|
const n = t[e.id] || [];
|
|
4216
4257
|
for (const a of n)
|
|
4217
4258
|
r.push(`${o} - Section: ${a.name} (id=${a.id})`);
|
|
4218
4259
|
for (const a of e.children)
|
|
4219
|
-
r.push(...
|
|
4260
|
+
r.push(...cs(a, t, `${o} `));
|
|
4220
4261
|
return r;
|
|
4221
4262
|
}
|
|
4222
|
-
function
|
|
4263
|
+
function jt(e) {
|
|
4223
4264
|
const t = {};
|
|
4224
4265
|
for (const r of e)
|
|
4225
4266
|
t[r.id] = { ...r, children: [] };
|
|
@@ -4236,15 +4277,15 @@ function It(e) {
|
|
|
4236
4277
|
}
|
|
4237
4278
|
return o;
|
|
4238
4279
|
}
|
|
4239
|
-
function
|
|
4280
|
+
function Ve(e, t = "") {
|
|
4240
4281
|
const o = [];
|
|
4241
4282
|
for (const r of e) {
|
|
4242
4283
|
const n = `id=${r.id}`, a = r.dueDate ? `; due=${r.dueDate}` : "", i = `; content=${r.content}`;
|
|
4243
|
-
o.push(`${t}- ${n}${a}${i}`), r.children.length > 0 && o.push(...
|
|
4284
|
+
o.push(`${t}- ${n}${a}${i}`), r.children.length > 0 && o.push(...Ve(r.children, `${t} `));
|
|
4244
4285
|
}
|
|
4245
4286
|
return o;
|
|
4246
4287
|
}
|
|
4247
|
-
function
|
|
4288
|
+
function ds(e, t) {
|
|
4248
4289
|
return {
|
|
4249
4290
|
id: e.id,
|
|
4250
4291
|
name: e.name,
|
|
@@ -4253,11 +4294,11 @@ function ns(e, t) {
|
|
|
4253
4294
|
childOrder: e.childOrder,
|
|
4254
4295
|
sections: (t[e.id] || []).map(X),
|
|
4255
4296
|
children: e.children.map(
|
|
4256
|
-
(o) =>
|
|
4297
|
+
(o) => ds(o, t)
|
|
4257
4298
|
)
|
|
4258
4299
|
};
|
|
4259
4300
|
}
|
|
4260
|
-
async function
|
|
4301
|
+
async function ja(e, t) {
|
|
4261
4302
|
let o = [], r;
|
|
4262
4303
|
do {
|
|
4263
4304
|
const { results: n, nextCursor: a } = await e.getTasks({
|
|
@@ -4269,12 +4310,12 @@ async function ka(e, t) {
|
|
|
4269
4310
|
} while (r);
|
|
4270
4311
|
return o;
|
|
4271
4312
|
}
|
|
4272
|
-
async function
|
|
4313
|
+
async function Sa(e, t) {
|
|
4273
4314
|
const { results: o } = await e.getSections({ projectId: t });
|
|
4274
4315
|
return o;
|
|
4275
4316
|
}
|
|
4276
|
-
async function
|
|
4277
|
-
const { results: t } = await e.getProjects({}), o = t.find((u) => ie(u) && u.inboxProject === !0), r = t.filter((u) => !ie(u) || u.inboxProject !== !0), n =
|
|
4317
|
+
async function Ca(e) {
|
|
4318
|
+
const { results: t } = await e.getProjects({}), o = t.find((u) => ie(u) && u.inboxProject === !0), r = t.filter((u) => !ie(u) || u.inboxProject !== !0), n = va(r), a = t.map((u) => u.id), i = await Ia(e, a), c = ["# Personal Projects", ""];
|
|
4278
4319
|
if (o) {
|
|
4279
4320
|
c.push(`- Inbox Project: ${o.name} (id=${o.id})`);
|
|
4280
4321
|
for (const u of i[o.id] || [])
|
|
@@ -4282,7 +4323,7 @@ async function wa(e) {
|
|
|
4282
4323
|
}
|
|
4283
4324
|
if (n.length)
|
|
4284
4325
|
for (const u of n)
|
|
4285
|
-
c.push(...
|
|
4326
|
+
c.push(...cs(u, i));
|
|
4286
4327
|
else
|
|
4287
4328
|
c.push("_No projects found._");
|
|
4288
4329
|
c.push("");
|
|
@@ -4300,7 +4341,7 @@ async function wa(e) {
|
|
|
4300
4341
|
sections: (i[o.id] || []).map(X)
|
|
4301
4342
|
} : null,
|
|
4302
4343
|
projects: n.map(
|
|
4303
|
-
(u) =>
|
|
4344
|
+
(u) => ds(u, i)
|
|
4304
4345
|
),
|
|
4305
4346
|
totalProjects: t.length,
|
|
4306
4347
|
totalSections: a.reduce(
|
|
@@ -4311,11 +4352,11 @@ async function wa(e) {
|
|
|
4311
4352
|
};
|
|
4312
4353
|
return { textContent: l, structuredContent: p };
|
|
4313
4354
|
}
|
|
4314
|
-
async function
|
|
4355
|
+
async function $a(e, t) {
|
|
4315
4356
|
const [o, r, n] = await Promise.all([
|
|
4316
4357
|
e.getProject(t),
|
|
4317
|
-
|
|
4318
|
-
|
|
4358
|
+
Sa(e, t),
|
|
4359
|
+
ja(e, t)
|
|
4319
4360
|
]), a = {};
|
|
4320
4361
|
for (const p of r)
|
|
4321
4362
|
a[p.id] = [];
|
|
@@ -4325,16 +4366,16 @@ async function va(e, t) {
|
|
|
4325
4366
|
const c = [`# ${o.name}`];
|
|
4326
4367
|
if (i.length > 0) {
|
|
4327
4368
|
c.push("");
|
|
4328
|
-
const p =
|
|
4329
|
-
c.push(...
|
|
4369
|
+
const p = jt(i);
|
|
4370
|
+
c.push(...Ve(p));
|
|
4330
4371
|
}
|
|
4331
4372
|
for (const p of r) {
|
|
4332
4373
|
c.push(""), c.push(`## ${p.name}`);
|
|
4333
4374
|
const u = a[p.id];
|
|
4334
4375
|
if (!u?.length)
|
|
4335
4376
|
continue;
|
|
4336
|
-
const m =
|
|
4337
|
-
c.push(...
|
|
4377
|
+
const m = jt(u);
|
|
4378
|
+
c.push(...Ve(m));
|
|
4338
4379
|
}
|
|
4339
4380
|
const d = c.join(`
|
|
4340
4381
|
`), l = {
|
|
@@ -4357,33 +4398,33 @@ async function va(e, t) {
|
|
|
4357
4398
|
};
|
|
4358
4399
|
return { textContent: d, structuredContent: l };
|
|
4359
4400
|
}
|
|
4360
|
-
const
|
|
4401
|
+
const Da = {
|
|
4361
4402
|
name: f.GET_OVERVIEW,
|
|
4362
4403
|
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.",
|
|
4363
|
-
parameters:
|
|
4364
|
-
outputSchema:
|
|
4404
|
+
parameters: Ta,
|
|
4405
|
+
outputSchema: wa,
|
|
4365
4406
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4366
4407
|
async execute(e, t) {
|
|
4367
|
-
const o = e.projectId ? await
|
|
4408
|
+
const o = e.projectId ? await $a(t, e.projectId) : await Ca(t);
|
|
4368
4409
|
return {
|
|
4369
4410
|
textContent: o.textContent,
|
|
4370
4411
|
structuredContent: o.structuredContent
|
|
4371
4412
|
};
|
|
4372
4413
|
}
|
|
4373
|
-
},
|
|
4414
|
+
}, Aa = {}, oe = s.object({
|
|
4374
4415
|
count: s.number().describe("Number of consecutive periods in this streak."),
|
|
4375
4416
|
start: s.string().describe("Start date of the streak."),
|
|
4376
4417
|
end: s.string().describe("End date of the streak.")
|
|
4377
|
-
}),
|
|
4418
|
+
}), St = s.object({
|
|
4378
4419
|
id: s.string().describe("Project ID."),
|
|
4379
4420
|
completed: s.number().describe("Number of tasks completed in this project.")
|
|
4380
|
-
}),
|
|
4421
|
+
}), xa = {
|
|
4381
4422
|
completedCount: s.number().describe("Total number of completed tasks (all-time)."),
|
|
4382
4423
|
daysItems: s.array(
|
|
4383
4424
|
s.object({
|
|
4384
4425
|
date: s.string().describe("Date string (YYYY-MM-DD)."),
|
|
4385
4426
|
totalCompleted: s.number().describe("Total tasks completed on this day."),
|
|
4386
|
-
items: s.array(
|
|
4427
|
+
items: s.array(St).describe("Per-project completion breakdown for this day.")
|
|
4387
4428
|
})
|
|
4388
4429
|
).describe("Daily completion breakdown (most recent days)."),
|
|
4389
4430
|
weekItems: s.array(
|
|
@@ -4391,7 +4432,7 @@ const Ia = {
|
|
|
4391
4432
|
from: s.string().describe("Start date of the week."),
|
|
4392
4433
|
to: s.string().describe("End date of the week."),
|
|
4393
4434
|
totalCompleted: s.number().describe("Total tasks completed in this week."),
|
|
4394
|
-
items: s.array(
|
|
4435
|
+
items: s.array(St).describe("Per-project completion breakdown for this week.")
|
|
4395
4436
|
})
|
|
4396
4437
|
).describe("Weekly completion breakdown (most recent weeks)."),
|
|
4397
4438
|
goals: s.object({
|
|
@@ -4426,11 +4467,11 @@ const Ia = {
|
|
|
4426
4467
|
})
|
|
4427
4468
|
).describe("Recent karma change events with reasons."),
|
|
4428
4469
|
projectColors: s.record(s.string(), s.string()).describe("Map of project ID to color key.")
|
|
4429
|
-
},
|
|
4470
|
+
}, Ea = {
|
|
4430
4471
|
name: f.GET_PRODUCTIVITY_STATS,
|
|
4431
4472
|
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.",
|
|
4432
|
-
parameters:
|
|
4433
|
-
outputSchema:
|
|
4473
|
+
parameters: Aa,
|
|
4474
|
+
outputSchema: xa,
|
|
4434
4475
|
annotations: {
|
|
4435
4476
|
readOnlyHint: !0,
|
|
4436
4477
|
destructiveHint: !1,
|
|
@@ -4439,7 +4480,7 @@ const Ia = {
|
|
|
4439
4480
|
async execute(e, t) {
|
|
4440
4481
|
const o = await t.getProductivityStats();
|
|
4441
4482
|
return {
|
|
4442
|
-
textContent:
|
|
4483
|
+
textContent: Oa(o),
|
|
4443
4484
|
structuredContent: {
|
|
4444
4485
|
completedCount: o.completedCount,
|
|
4445
4486
|
daysItems: o.daysItems,
|
|
@@ -4466,7 +4507,7 @@ const Ia = {
|
|
|
4466
4507
|
};
|
|
4467
4508
|
}
|
|
4468
4509
|
};
|
|
4469
|
-
function
|
|
4510
|
+
function Oa(e) {
|
|
4470
4511
|
const t = [
|
|
4471
4512
|
"# Productivity Statistics",
|
|
4472
4513
|
"",
|
|
@@ -4496,11 +4537,11 @@ function $a(e) {
|
|
|
4496
4537
|
return t.join(`
|
|
4497
4538
|
`);
|
|
4498
4539
|
}
|
|
4499
|
-
const
|
|
4540
|
+
const Ua = {
|
|
4500
4541
|
projectId: s.string().min(1).describe("The ID of the project to get activity stats for."),
|
|
4501
4542
|
weeks: s.number().int().min(1).max(12).optional().describe("Number of weeks of activity data to retrieve (1-12, default 2)."),
|
|
4502
4543
|
includeWeeklyCounts: s.boolean().optional().describe("Include weekly rollup counts alongside daily counts.")
|
|
4503
|
-
},
|
|
4544
|
+
}, Pa = {
|
|
4504
4545
|
projectId: s.string().describe("The project ID."),
|
|
4505
4546
|
dayItems: s.array(
|
|
4506
4547
|
s.object({
|
|
@@ -4516,7 +4557,7 @@ const Da = {
|
|
|
4516
4557
|
})
|
|
4517
4558
|
).nullable().describe("Weekly completion rollups. Only included when includeWeeklyCounts is true.")
|
|
4518
4559
|
};
|
|
4519
|
-
function
|
|
4560
|
+
function _a(e, t) {
|
|
4520
4561
|
const o = [`# Activity Stats: Project ${e}`, ""];
|
|
4521
4562
|
if (t.dayItems.length > 0) {
|
|
4522
4563
|
o.push("## Daily Activity");
|
|
@@ -4532,11 +4573,11 @@ function xa(e, t) {
|
|
|
4532
4573
|
return o.join(`
|
|
4533
4574
|
`);
|
|
4534
4575
|
}
|
|
4535
|
-
const
|
|
4576
|
+
const Ra = {
|
|
4536
4577
|
name: f.GET_PROJECT_ACTIVITY_STATS,
|
|
4537
4578
|
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.",
|
|
4538
|
-
parameters:
|
|
4539
|
-
outputSchema:
|
|
4579
|
+
parameters: Ua,
|
|
4580
|
+
outputSchema: Pa,
|
|
4540
4581
|
annotations: {
|
|
4541
4582
|
readOnlyHint: !0,
|
|
4542
4583
|
destructiveHint: !1,
|
|
@@ -4548,7 +4589,7 @@ const Ea = {
|
|
|
4548
4589
|
includeWeeklyCounts: n
|
|
4549
4590
|
});
|
|
4550
4591
|
return {
|
|
4551
|
-
textContent:
|
|
4592
|
+
textContent: _a(o, a),
|
|
4552
4593
|
structuredContent: {
|
|
4553
4594
|
projectId: o,
|
|
4554
4595
|
dayItems: a.dayItems,
|
|
@@ -4556,15 +4597,15 @@ const Ea = {
|
|
|
4556
4597
|
}
|
|
4557
4598
|
};
|
|
4558
4599
|
}
|
|
4559
|
-
},
|
|
4600
|
+
}, Na = {
|
|
4560
4601
|
projectId: s.string().min(1).describe("The ID of the project to check health for."),
|
|
4561
4602
|
includeContext: s.boolean().default(!1).describe(
|
|
4562
4603
|
"Include detailed health context with project metrics and task-level data. May produce large output for projects with many tasks."
|
|
4563
4604
|
)
|
|
4564
|
-
},
|
|
4605
|
+
}, La = s.object({
|
|
4565
4606
|
taskId: s.string().describe("The ID of the task this recommendation is for."),
|
|
4566
4607
|
recommendation: s.string().describe("The recommendation for this task.")
|
|
4567
|
-
}),
|
|
4608
|
+
}), Ma = s.object({
|
|
4568
4609
|
id: s.string().describe("The task ID."),
|
|
4569
4610
|
content: s.string().describe("The task content/title."),
|
|
4570
4611
|
priority: s.string().describe("The task priority (1-4)."),
|
|
@@ -4572,7 +4613,7 @@ const Ea = {
|
|
|
4572
4613
|
deadline: s.string().nullable().optional().describe("The deadline date string, if set."),
|
|
4573
4614
|
isCompleted: s.boolean().describe("Whether the task is completed."),
|
|
4574
4615
|
labels: s.array(s.string()).describe("Labels applied to this task.")
|
|
4575
|
-
}),
|
|
4616
|
+
}), Fa = {
|
|
4576
4617
|
projectId: s.string().describe("The project ID."),
|
|
4577
4618
|
projectName: s.string().describe("The project name."),
|
|
4578
4619
|
progress: s.object({
|
|
@@ -4581,10 +4622,10 @@ const Ea = {
|
|
|
4581
4622
|
progressPercent: s.number().describe("Completion percentage (0-100).")
|
|
4582
4623
|
}).describe("Project completion progress."),
|
|
4583
4624
|
health: s.object({
|
|
4584
|
-
status: s.enum(
|
|
4625
|
+
status: s.enum(Xe).describe("The overall health status of the project."),
|
|
4585
4626
|
description: s.string().nullable().optional().describe("Detailed description of the health assessment."),
|
|
4586
4627
|
descriptionSummary: s.string().nullable().optional().describe("Brief summary of the health assessment."),
|
|
4587
|
-
taskRecommendations: s.array(
|
|
4628
|
+
taskRecommendations: s.array(La).nullable().optional().describe("Specific recommendations for individual tasks."),
|
|
4588
4629
|
isStale: s.boolean().describe("Whether the health data is stale and may need refreshing."),
|
|
4589
4630
|
updateInProgress: s.boolean().describe("Whether a health analysis update is currently in progress."),
|
|
4590
4631
|
updatedAt: s.string().nullable().optional().describe("When the health assessment was last updated.")
|
|
@@ -4599,12 +4640,12 @@ const Ea = {
|
|
|
4599
4640
|
tasksCompletedThisWeek: s.number().describe("Tasks completed in the current week."),
|
|
4600
4641
|
averageCompletionTime: s.number().nullable().describe("Average task completion time in days, if available.")
|
|
4601
4642
|
}).describe("Aggregated project metrics."),
|
|
4602
|
-
tasks: s.array(
|
|
4643
|
+
tasks: s.array(Ma).describe("Tasks in the project.")
|
|
4603
4644
|
}).optional().describe(
|
|
4604
4645
|
"Detailed project context with metrics and task data. Only included when includeContext is true."
|
|
4605
4646
|
)
|
|
4606
4647
|
};
|
|
4607
|
-
async function
|
|
4648
|
+
async function Ha(e, t, o) {
|
|
4608
4649
|
if (o) {
|
|
4609
4650
|
const [a, i, c] = await Promise.all([
|
|
4610
4651
|
e.getProjectProgress(t),
|
|
@@ -4619,7 +4660,7 @@ async function Ra(e, t, o) {
|
|
|
4619
4660
|
]);
|
|
4620
4661
|
return { progress: r, health: n };
|
|
4621
4662
|
}
|
|
4622
|
-
function
|
|
4663
|
+
function Wa(e, { progress: t, health: o, context: r }) {
|
|
4623
4664
|
const n = [`# Project Health: ${e}`, ""];
|
|
4624
4665
|
if (n.push(`**Status:** ${o.status}`), o.isStale && n.push("**Note:** Health data is stale and may not reflect recent changes."), o.updateInProgress && n.push("**Note:** A health analysis update is currently in progress."), o.updatedAt && n.push(`**Last Updated:** ${o.updatedAt.toISOString()}`), n.push(""), n.push("## Progress"), n.push(
|
|
4625
4666
|
`**Completed:** ${t.completedCount} | **Active:** ${t.activeCount} | **Progress:** ${t.progressPercent}%`
|
|
@@ -4642,18 +4683,18 @@ function Na(e, { progress: t, health: o, context: r }) {
|
|
|
4642
4683
|
return n.join(`
|
|
4643
4684
|
`);
|
|
4644
4685
|
}
|
|
4645
|
-
const
|
|
4686
|
+
const Ga = {
|
|
4646
4687
|
name: f.GET_PROJECT_HEALTH,
|
|
4647
4688
|
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.",
|
|
4648
|
-
parameters:
|
|
4649
|
-
outputSchema:
|
|
4689
|
+
parameters: Na,
|
|
4690
|
+
outputSchema: Fa,
|
|
4650
4691
|
annotations: {
|
|
4651
4692
|
readOnlyHint: !0,
|
|
4652
4693
|
destructiveHint: !1,
|
|
4653
4694
|
idempotentHint: !0
|
|
4654
4695
|
},
|
|
4655
4696
|
async execute(e, t) {
|
|
4656
|
-
const { projectId: o, includeContext: r } = e, n = await
|
|
4697
|
+
const { projectId: o, includeContext: r } = e, n = await Ha(t, o, r), a = n.context?.projectName ?? `Project ${o}`, i = Wa(a, n), c = n.context ? {
|
|
4657
4698
|
projectDescription: n.context.projectDescription,
|
|
4658
4699
|
projectMetrics: n.context.projectMetrics,
|
|
4659
4700
|
tasks: n.context.tasks.map((d) => ({
|
|
@@ -4689,15 +4730,15 @@ const La = {
|
|
|
4689
4730
|
}
|
|
4690
4731
|
};
|
|
4691
4732
|
}
|
|
4692
|
-
},
|
|
4733
|
+
}, Ba = {
|
|
4693
4734
|
workspaceIdOrName: s.string().min(1).describe(
|
|
4694
4735
|
"The workspace ID or name. Supports exact ID, exact name match (case-insensitive), or unique partial name match."
|
|
4695
4736
|
),
|
|
4696
4737
|
projectIds: s.array(s.string().min(1)).min(1).optional().describe("Optional list of project IDs to scope insights to specific projects.")
|
|
4697
|
-
},
|
|
4738
|
+
}, Ya = s.object({
|
|
4698
4739
|
projectId: s.string().describe("The project ID."),
|
|
4699
4740
|
health: s.object({
|
|
4700
|
-
status: s.enum(
|
|
4741
|
+
status: s.enum(Xe).describe("The health status of the project."),
|
|
4701
4742
|
isStale: s.boolean().describe("Whether the health data is stale."),
|
|
4702
4743
|
updateInProgress: s.boolean().describe("Whether a health analysis update is in progress.")
|
|
4703
4744
|
}).nullable().describe("Health data for this project, if available."),
|
|
@@ -4706,23 +4747,23 @@ const La = {
|
|
|
4706
4747
|
activeCount: s.number().describe("Number of active tasks."),
|
|
4707
4748
|
progressPercent: s.number().describe("Completion percentage (0-100).")
|
|
4708
4749
|
}).nullable().describe("Progress data for this project, if available.")
|
|
4709
|
-
}),
|
|
4750
|
+
}), qa = {
|
|
4710
4751
|
workspaceId: s.string().describe("The resolved workspace ID."),
|
|
4711
4752
|
workspaceName: s.string().describe("The resolved workspace name."),
|
|
4712
4753
|
folderId: s.string().nullable().describe("The folder ID, if applicable."),
|
|
4713
|
-
projectInsights: s.array(
|
|
4714
|
-
},
|
|
4754
|
+
projectInsights: s.array(Ya).describe("Health and progress insights for each project in the workspace.")
|
|
4755
|
+
}, za = {
|
|
4715
4756
|
name: f.GET_WORKSPACE_INSIGHTS,
|
|
4716
4757
|
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.",
|
|
4717
|
-
parameters:
|
|
4718
|
-
outputSchema:
|
|
4758
|
+
parameters: Ba,
|
|
4759
|
+
outputSchema: qa,
|
|
4719
4760
|
annotations: {
|
|
4720
4761
|
readOnlyHint: !0,
|
|
4721
4762
|
destructiveHint: !1,
|
|
4722
4763
|
idempotentHint: !0
|
|
4723
4764
|
},
|
|
4724
4765
|
async execute(e, t) {
|
|
4725
|
-
const { workspaceIdOrName: o, projectIds: r } = e, n = await
|
|
4766
|
+
const { workspaceIdOrName: o, projectIds: r } = e, n = await Kt.resolveWorkspace(t, o), a = await t.getWorkspaceInsights(n.workspaceId, { projectIds: r }), i = a.projectInsights.map((d) => ({
|
|
4726
4767
|
projectId: d.projectId,
|
|
4727
4768
|
health: d.health ? {
|
|
4728
4769
|
status: d.health.status,
|
|
@@ -4755,21 +4796,21 @@ const La = {
|
|
|
4755
4796
|
}
|
|
4756
4797
|
};
|
|
4757
4798
|
}
|
|
4758
|
-
},
|
|
4799
|
+
}, Ct = 50, Ka = {
|
|
4759
4800
|
goalId: s.string().min(1).describe("The ID of the goal."),
|
|
4760
|
-
taskIds: s.array(s.string().min(1)).min(1).max(
|
|
4801
|
+
taskIds: s.array(s.string().min(1)).min(1).max(Ct).describe(`The IDs of the tasks to link or unlink (max ${Ct}).`),
|
|
4761
4802
|
action: s.enum(["link", "unlink"]).describe("Whether to link or unlink the tasks.")
|
|
4762
|
-
},
|
|
4803
|
+
}, Va = {
|
|
4763
4804
|
processed: s.array(s.string()).describe("The IDs of successfully processed tasks."),
|
|
4764
4805
|
failures: s.array(be).describe("Failed operations with error details."),
|
|
4765
4806
|
totalRequested: s.number().describe("The total number of tasks requested."),
|
|
4766
4807
|
successCount: s.number().describe("The number of successfully processed tasks."),
|
|
4767
4808
|
failureCount: s.number().describe("The number of failed operations.")
|
|
4768
|
-
},
|
|
4809
|
+
}, Ja = {
|
|
4769
4810
|
name: f.LINK_GOAL_TASKS,
|
|
4770
4811
|
description: "Link or unlink tasks to/from a goal.",
|
|
4771
|
-
parameters:
|
|
4772
|
-
outputSchema:
|
|
4812
|
+
parameters: Ka,
|
|
4813
|
+
outputSchema: Va,
|
|
4773
4814
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
|
|
4774
4815
|
async execute(e, t) {
|
|
4775
4816
|
const o = await Promise.allSettled(
|
|
@@ -4802,21 +4843,21 @@ const La = {
|
|
|
4802
4843
|
}
|
|
4803
4844
|
};
|
|
4804
4845
|
}
|
|
4805
|
-
},
|
|
4846
|
+
}, Xa = {}, Za = {
|
|
4806
4847
|
id: s.string().describe("The unique identifier for the workspace."),
|
|
4807
4848
|
name: s.string().describe("The name of the workspace."),
|
|
4808
|
-
plan: s.enum(
|
|
4809
|
-
role: s.enum(
|
|
4849
|
+
plan: s.enum($s).describe("The workspace plan type."),
|
|
4850
|
+
role: s.enum(Cs).optional().describe("The user's role in the workspace, if available."),
|
|
4810
4851
|
isLinkSharingEnabled: s.boolean().describe("Whether link sharing is enabled for the workspace."),
|
|
4811
4852
|
isGuestAllowed: s.boolean().describe("Whether guests are allowed in the workspace."),
|
|
4812
4853
|
createdAt: s.string().optional().describe("The ISO 8601 timestamp when the workspace was created."),
|
|
4813
4854
|
creatorId: s.string().describe("The ID of the user who created the workspace.")
|
|
4814
|
-
},
|
|
4855
|
+
}, Qa = {
|
|
4815
4856
|
type: s.literal("workspaces").describe("The type of the response."),
|
|
4816
|
-
workspaces: s.array(s.object(
|
|
4857
|
+
workspaces: s.array(s.object(Za)).describe("List of workspaces."),
|
|
4817
4858
|
count: s.number().describe("The total number of workspaces.")
|
|
4818
4859
|
};
|
|
4819
|
-
async function
|
|
4860
|
+
async function ei(e) {
|
|
4820
4861
|
const o = (await e.getWorkspaces()).map((i) => ({
|
|
4821
4862
|
id: i.id,
|
|
4822
4863
|
name: i.name,
|
|
@@ -4847,22 +4888,22 @@ async function Va(e) {
|
|
|
4847
4888
|
};
|
|
4848
4889
|
return { textContent: n, structuredContent: a };
|
|
4849
4890
|
}
|
|
4850
|
-
const
|
|
4891
|
+
const ti = {
|
|
4851
4892
|
name: f.LIST_WORKSPACES,
|
|
4852
4893
|
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.",
|
|
4853
|
-
parameters:
|
|
4854
|
-
outputSchema:
|
|
4894
|
+
parameters: Xa,
|
|
4895
|
+
outputSchema: Qa,
|
|
4855
4896
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4856
4897
|
async execute(e, t) {
|
|
4857
|
-
const o = await
|
|
4898
|
+
const o = await ei(t);
|
|
4858
4899
|
return {
|
|
4859
4900
|
textContent: o.textContent,
|
|
4860
4901
|
structuredContent: o.structuredContent
|
|
4861
4902
|
};
|
|
4862
4903
|
}
|
|
4863
|
-
}, { FIND_TASKS:
|
|
4904
|
+
}, { FIND_TASKS: si, FIND_PROJECT_COLLABORATORS: $t, UPDATE_TASKS: oi } = f, ri = 50, ni = {
|
|
4864
4905
|
operation: s.enum(["assign", "unassign", "reassign"]).describe("The assignment operation to perform."),
|
|
4865
|
-
taskIds: s.array(s.string()).min(1).max(
|
|
4906
|
+
taskIds: s.array(s.string()).min(1).max(ri).describe("The IDs of the tasks to operate on (max 50)."),
|
|
4866
4907
|
responsibleUser: s.string().optional().describe(
|
|
4867
4908
|
'The user to assign tasks to. Can be "me" (assigns to current user), a user ID, name, or email. Required for assign and reassign operations.'
|
|
4868
4909
|
),
|
|
@@ -4870,7 +4911,7 @@ const Ja = {
|
|
|
4870
4911
|
"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."
|
|
4871
4912
|
),
|
|
4872
4913
|
dryRun: s.boolean().optional().default(!1).describe("If true, validates operations without executing them.")
|
|
4873
|
-
},
|
|
4914
|
+
}, ai = {
|
|
4874
4915
|
results: s.array(
|
|
4875
4916
|
s.object({
|
|
4876
4917
|
taskId: s.string().describe("The ID of the task."),
|
|
@@ -4886,11 +4927,11 @@ const Ja = {
|
|
|
4886
4927
|
failed: s.number().describe("Number of failed operations."),
|
|
4887
4928
|
dryRun: s.boolean().describe("Whether this was a dry run.")
|
|
4888
4929
|
}).optional().describe("Summary of the operation.")
|
|
4889
|
-
},
|
|
4930
|
+
}, ii = {
|
|
4890
4931
|
name: f.MANAGE_ASSIGNMENTS,
|
|
4891
4932
|
description: "Bulk assignment operations for multiple tasks. Supports assign, unassign, and reassign operations with atomic rollback on failures.",
|
|
4892
|
-
parameters:
|
|
4893
|
-
outputSchema:
|
|
4933
|
+
parameters: ni,
|
|
4934
|
+
outputSchema: ai,
|
|
4894
4935
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
4895
4936
|
async execute(e, t) {
|
|
4896
4937
|
const { operation: o, taskIds: r, responsibleUser: n, fromAssigneeUser: a, dryRun: i } = e;
|
|
@@ -4992,7 +5033,7 @@ const Ja = {
|
|
|
4992
5033
|
}
|
|
4993
5034
|
};
|
|
4994
5035
|
}
|
|
4995
|
-
const m = await
|
|
5036
|
+
const m = await at.validateBulkAssignment(
|
|
4996
5037
|
t,
|
|
4997
5038
|
u
|
|
4998
5039
|
), h = [], k = [];
|
|
@@ -5113,30 +5154,30 @@ function _e({
|
|
|
5113
5154
|
`;
|
|
5114
5155
|
}
|
|
5115
5156
|
return !o && r.length > 0 ? (c += `**Next steps:**
|
|
5116
|
-
`, c += `• Use ${
|
|
5117
|
-
`, c += `• Use ${
|
|
5118
|
-
`, n.length > 0 && (c += `• Check failed tasks and use ${
|
|
5157
|
+
`, c += `• Use ${si} with responsibleUser to see ${e === "unassign" ? "unassigned" : "newly assigned"} tasks
|
|
5158
|
+
`, c += `• Use ${oi} for individual assignment changes
|
|
5159
|
+
`, n.length > 0 && (c += `• Check failed tasks and use ${$t} to verify collaborator access
|
|
5119
5160
|
`)) : o ? (c += `**To execute:**
|
|
5120
5161
|
`, c += `• Remove dryRun parameter and run again to execute changes
|
|
5121
5162
|
`, r.length > 0 && (c += `• ${r.length} task${r.length === 1 ? "" : "s"} ready for ${e} operation
|
|
5122
5163
|
`), n.length > 0 && (c += `• Fix ${n.length} validation error${n.length === 1 ? "" : "s"} before executing
|
|
5123
5164
|
`)) : r.length === 0 && (c += `**Suggestions:**
|
|
5124
|
-
`, c += `• Use ${
|
|
5165
|
+
`, c += `• Use ${$t} to find valid assignees
|
|
5125
5166
|
`, c += `• Check task IDs and assignee permissions
|
|
5126
5167
|
`, c += `• Use dryRun=true to validate before executing
|
|
5127
5168
|
`), c;
|
|
5128
5169
|
}
|
|
5129
|
-
const
|
|
5170
|
+
const ci = {
|
|
5130
5171
|
action: s.enum(["archive", "unarchive"]).describe("The action to perform on the project."),
|
|
5131
5172
|
projectId: s.string().min(1).describe("The ID of the project.")
|
|
5132
|
-
},
|
|
5173
|
+
}, di = {
|
|
5133
5174
|
project: ue.describe("The updated project."),
|
|
5134
5175
|
success: s.boolean().describe("Whether the action was successful.")
|
|
5135
|
-
},
|
|
5176
|
+
}, li = {
|
|
5136
5177
|
name: f.PROJECT_MANAGEMENT,
|
|
5137
5178
|
description: "Archive or unarchive a project by its ID.",
|
|
5138
|
-
parameters:
|
|
5139
|
-
outputSchema:
|
|
5179
|
+
parameters: ci,
|
|
5180
|
+
outputSchema: di,
|
|
5140
5181
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
|
|
5141
5182
|
async execute(e, t) {
|
|
5142
5183
|
const o = e.action === "archive" ? await t.archiveProject(e.projectId) : await t.unarchiveProject(e.projectId), r = V(o);
|
|
@@ -5148,7 +5189,7 @@ const oi = {
|
|
|
5148
5189
|
}
|
|
5149
5190
|
};
|
|
5150
5191
|
}
|
|
5151
|
-
},
|
|
5192
|
+
}, ui = {
|
|
5152
5193
|
action: s.enum(["move-to-workspace", "move-to-personal"]).describe("The action to perform on the project."),
|
|
5153
5194
|
projectId: s.string().min(1).describe("The ID of the project to move."),
|
|
5154
5195
|
workspaceId: s.string().min(1).optional().describe("The target workspace ID. Required when action is move-to-workspace."),
|
|
@@ -5156,14 +5197,14 @@ const oi = {
|
|
|
5156
5197
|
visibility: s.enum(["restricted", "team", "public"]).optional().describe(
|
|
5157
5198
|
"Optional access visibility for the project in the workspace (restricted, team, or public)."
|
|
5158
5199
|
)
|
|
5159
|
-
},
|
|
5200
|
+
}, pi = {
|
|
5160
5201
|
project: ue.describe("The moved project."),
|
|
5161
5202
|
success: s.boolean().describe("Whether the move was successful.")
|
|
5162
|
-
},
|
|
5203
|
+
}, mi = {
|
|
5163
5204
|
name: f.PROJECT_MOVE,
|
|
5164
5205
|
description: "Move a project between personal and workspace contexts.",
|
|
5165
|
-
parameters:
|
|
5166
|
-
outputSchema:
|
|
5206
|
+
parameters: ui,
|
|
5207
|
+
outputSchema: pi,
|
|
5167
5208
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
|
|
5168
5209
|
async execute(e, t) {
|
|
5169
5210
|
let o;
|
|
@@ -5186,8 +5227,8 @@ const oi = {
|
|
|
5186
5227
|
}
|
|
5187
5228
|
};
|
|
5188
5229
|
}
|
|
5189
|
-
},
|
|
5190
|
-
type: s.enum(
|
|
5230
|
+
}, ls = ["project", "section"], hi = {
|
|
5231
|
+
type: s.enum(ls).describe(
|
|
5191
5232
|
'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.'
|
|
5192
5233
|
),
|
|
5193
5234
|
items: s.array(
|
|
@@ -5203,17 +5244,17 @@ const oi = {
|
|
|
5203
5244
|
).min(1).describe(
|
|
5204
5245
|
"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."
|
|
5205
5246
|
)
|
|
5206
|
-
},
|
|
5207
|
-
type: s.enum(
|
|
5247
|
+
}, fi = {
|
|
5248
|
+
type: s.enum(ls).describe("The type of entity that was reordered/moved."),
|
|
5208
5249
|
movedCount: s.number().describe("The number of entities moved to a new parent."),
|
|
5209
5250
|
reorderedCount: s.number().describe("The number of entities reordered."),
|
|
5210
5251
|
affectedIds: s.array(s.string()).describe("The IDs of all affected entities."),
|
|
5211
5252
|
success: s.boolean().describe("Whether the operation was successful.")
|
|
5212
|
-
},
|
|
5253
|
+
}, bi = {
|
|
5213
5254
|
name: f.REORDER_OBJECTS,
|
|
5214
5255
|
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.',
|
|
5215
|
-
parameters:
|
|
5216
|
-
outputSchema:
|
|
5256
|
+
parameters: hi,
|
|
5257
|
+
outputSchema: fi,
|
|
5217
5258
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
|
|
5218
5259
|
async execute(e, t) {
|
|
5219
5260
|
const { type: o, items: r } = e, n = /* @__PURE__ */ new Set();
|
|
@@ -5275,22 +5316,22 @@ const oi = {
|
|
|
5275
5316
|
}
|
|
5276
5317
|
};
|
|
5277
5318
|
}
|
|
5278
|
-
},
|
|
5319
|
+
}, gi = s.object({
|
|
5279
5320
|
id: s.string().min(1).describe("The ID of the task to reschedule."),
|
|
5280
5321
|
date: s.string().min(1).describe(
|
|
5281
5322
|
"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."
|
|
5282
5323
|
)
|
|
5283
|
-
}),
|
|
5284
|
-
tasks: s.array(
|
|
5285
|
-
},
|
|
5324
|
+
}), yi = {
|
|
5325
|
+
tasks: s.array(gi).min(1).describe("The tasks to reschedule with their new dates.")
|
|
5326
|
+
}, ki = {
|
|
5286
5327
|
tasks: s.array(J).describe("The rescheduled tasks."),
|
|
5287
5328
|
totalCount: s.number().describe("The total number of tasks rescheduled."),
|
|
5288
5329
|
rescheduledTaskIds: s.array(s.string()).describe("The IDs of the rescheduled tasks.")
|
|
5289
|
-
},
|
|
5330
|
+
}, Ti = {
|
|
5290
5331
|
name: f.RESCHEDULE_TASKS,
|
|
5291
5332
|
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.",
|
|
5292
|
-
parameters:
|
|
5293
|
-
outputSchema:
|
|
5333
|
+
parameters: yi,
|
|
5334
|
+
outputSchema: ki,
|
|
5294
5335
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5295
5336
|
async execute(e, t) {
|
|
5296
5337
|
const { tasks: o } = e, n = (await Promise.all(
|
|
@@ -5303,7 +5344,7 @@ const oi = {
|
|
|
5303
5344
|
throw new Error(
|
|
5304
5345
|
`Task "${l.content}" (${l.id}) has no due date. Rescheduling requires an existing due date.`
|
|
5305
5346
|
);
|
|
5306
|
-
const p =
|
|
5347
|
+
const p = wi(d.date, l.due);
|
|
5307
5348
|
return q("item_update", {
|
|
5308
5349
|
id: d.id,
|
|
5309
5350
|
due: {
|
|
@@ -5323,7 +5364,7 @@ const oi = {
|
|
|
5323
5364
|
}
|
|
5324
5365
|
const a = await Promise.all(o.map((d) => t.getTask(d.id))), i = a.map(_);
|
|
5325
5366
|
return {
|
|
5326
|
-
textContent:
|
|
5367
|
+
textContent: it("Rescheduled", i, {
|
|
5327
5368
|
showDetails: i.length <= 5
|
|
5328
5369
|
}),
|
|
5329
5370
|
structuredContent: {
|
|
@@ -5334,16 +5375,16 @@ const oi = {
|
|
|
5334
5375
|
};
|
|
5335
5376
|
}
|
|
5336
5377
|
};
|
|
5337
|
-
function
|
|
5378
|
+
function wi(e, t) {
|
|
5338
5379
|
if (/^\d{4}-\d{2}-\d{2}$/.test(e) && t.datetime) {
|
|
5339
5380
|
const r = t.datetime.substring(10);
|
|
5340
5381
|
return e + r;
|
|
5341
5382
|
}
|
|
5342
5383
|
return e;
|
|
5343
5384
|
}
|
|
5344
|
-
const
|
|
5385
|
+
const vi = {
|
|
5345
5386
|
query: s.string().min(1).describe("The search query string to find tasks and projects.")
|
|
5346
|
-
},
|
|
5387
|
+
}, Ii = {
|
|
5347
5388
|
results: s.array(
|
|
5348
5389
|
s.object({
|
|
5349
5390
|
id: s.string().describe("The ID of the result."),
|
|
@@ -5352,52 +5393,52 @@ const gi = {
|
|
|
5352
5393
|
})
|
|
5353
5394
|
).describe("The search results."),
|
|
5354
5395
|
totalCount: s.number().describe("Total number of results found.")
|
|
5355
|
-
},
|
|
5396
|
+
}, ji = {
|
|
5356
5397
|
name: f.SEARCH,
|
|
5357
5398
|
description: "Search across tasks and projects in Todoist. Returns a list of relevant results with IDs, titles, and URLs.",
|
|
5358
|
-
parameters:
|
|
5359
|
-
outputSchema:
|
|
5399
|
+
parameters: vi,
|
|
5400
|
+
outputSchema: Ii,
|
|
5360
5401
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
5361
5402
|
async execute(e, t) {
|
|
5362
5403
|
const { query: o } = e, [r, n] = await Promise.all([
|
|
5363
|
-
|
|
5404
|
+
ot({
|
|
5364
5405
|
client: t,
|
|
5365
5406
|
query: `search: ${o}`,
|
|
5366
5407
|
limit: j.TASKS_MAX,
|
|
5367
5408
|
cursor: void 0
|
|
5368
5409
|
}),
|
|
5369
|
-
|
|
5410
|
+
qt(t, o)
|
|
5370
5411
|
]), a = [];
|
|
5371
5412
|
for (const i of r.tasks)
|
|
5372
5413
|
a.push({
|
|
5373
5414
|
id: `task:${i.id}`,
|
|
5374
5415
|
title: i.content,
|
|
5375
|
-
url:
|
|
5416
|
+
url: Pt(i.id)
|
|
5376
5417
|
});
|
|
5377
5418
|
for (const i of n)
|
|
5378
5419
|
a.push({
|
|
5379
5420
|
id: `project:${i.id}`,
|
|
5380
5421
|
title: i.name,
|
|
5381
|
-
url:
|
|
5422
|
+
url: _t(i.id)
|
|
5382
5423
|
});
|
|
5383
5424
|
return {
|
|
5384
5425
|
textContent: JSON.stringify({ results: a }),
|
|
5385
5426
|
structuredContent: { results: a, totalCount: a.length }
|
|
5386
5427
|
};
|
|
5387
5428
|
}
|
|
5388
|
-
},
|
|
5429
|
+
}, Si = {
|
|
5389
5430
|
ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to uncomplete.")
|
|
5390
|
-
},
|
|
5431
|
+
}, Ci = {
|
|
5391
5432
|
uncompleted: s.array(s.string()).describe("The IDs of successfully uncompleted tasks."),
|
|
5392
5433
|
failures: s.array(be).describe("Failed task uncompletion with error details."),
|
|
5393
5434
|
totalRequested: s.number().describe("The total number of tasks requested to uncomplete."),
|
|
5394
5435
|
successCount: s.number().describe("The number of successfully uncompleted tasks."),
|
|
5395
5436
|
failureCount: s.number().describe("The number of failed task uncompletions.")
|
|
5396
|
-
},
|
|
5437
|
+
}, $i = {
|
|
5397
5438
|
name: f.UNCOMPLETE_TASKS,
|
|
5398
5439
|
description: "Uncomplete (reopen) one or more completed tasks by their IDs.",
|
|
5399
|
-
parameters:
|
|
5400
|
-
outputSchema:
|
|
5440
|
+
parameters: Si,
|
|
5441
|
+
outputSchema: Ci,
|
|
5401
5442
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
5402
5443
|
async execute(e, t) {
|
|
5403
5444
|
const o = [], r = [];
|
|
@@ -5412,7 +5453,7 @@ const gi = {
|
|
|
5412
5453
|
});
|
|
5413
5454
|
}
|
|
5414
5455
|
return {
|
|
5415
|
-
textContent:
|
|
5456
|
+
textContent: Di({
|
|
5416
5457
|
uncompleted: o,
|
|
5417
5458
|
failures: r,
|
|
5418
5459
|
args: e
|
|
@@ -5427,7 +5468,7 @@ const gi = {
|
|
|
5427
5468
|
};
|
|
5428
5469
|
}
|
|
5429
5470
|
};
|
|
5430
|
-
function
|
|
5471
|
+
function Di({
|
|
5431
5472
|
uncompleted: e,
|
|
5432
5473
|
failures: t,
|
|
5433
5474
|
args: o
|
|
@@ -5441,28 +5482,28 @@ function Ii({
|
|
|
5441
5482
|
failures: t
|
|
5442
5483
|
});
|
|
5443
5484
|
}
|
|
5444
|
-
const
|
|
5485
|
+
const Ai = s.object({
|
|
5445
5486
|
id: s.string().min(1).describe("The ID of the comment to update."),
|
|
5446
5487
|
content: s.string().min(1).describe("The new content for the comment.")
|
|
5447
|
-
}),
|
|
5448
|
-
comments: s.array(
|
|
5449
|
-
},
|
|
5488
|
+
}), xi = {
|
|
5489
|
+
comments: s.array(Ai).min(1).describe("The comments to update.")
|
|
5490
|
+
}, Ei = {
|
|
5450
5491
|
comments: s.array(je).describe("The updated comments."),
|
|
5451
5492
|
totalCount: s.number().describe("The total number of comments updated."),
|
|
5452
5493
|
updatedCommentIds: s.array(s.string()).describe("The IDs of the updated comments."),
|
|
5453
5494
|
appliedOperations: s.object({
|
|
5454
5495
|
updateCount: s.number().describe("The number of comments updated.")
|
|
5455
5496
|
}).describe("Summary of operations performed.")
|
|
5456
|
-
},
|
|
5497
|
+
}, Oi = {
|
|
5457
5498
|
name: f.UPDATE_COMMENTS,
|
|
5458
5499
|
description: "Update multiple existing comments with new content.",
|
|
5459
|
-
parameters:
|
|
5460
|
-
outputSchema:
|
|
5500
|
+
parameters: xi,
|
|
5501
|
+
outputSchema: Ei,
|
|
5461
5502
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5462
5503
|
async execute(e, t) {
|
|
5463
5504
|
const { comments: o } = e, r = o.map(async (c) => await t.updateComment(c.id, { content: c.content })), a = (await Promise.all(r)).map(we);
|
|
5464
5505
|
return {
|
|
5465
|
-
textContent:
|
|
5506
|
+
textContent: Ui({
|
|
5466
5507
|
comments: a
|
|
5467
5508
|
}),
|
|
5468
5509
|
structuredContent: {
|
|
@@ -5476,7 +5517,7 @@ const ji = s.object({
|
|
|
5476
5517
|
};
|
|
5477
5518
|
}
|
|
5478
5519
|
};
|
|
5479
|
-
function
|
|
5520
|
+
function Ui({ comments: e }) {
|
|
5480
5521
|
const t = e.filter((a) => a.taskId).length, o = e.filter((a) => a.projectId).length, r = [];
|
|
5481
5522
|
if (t > 0) {
|
|
5482
5523
|
const a = t > 1 ? "comments" : "comment";
|
|
@@ -5488,7 +5529,7 @@ function Di({ comments: e }) {
|
|
|
5488
5529
|
}
|
|
5489
5530
|
return r.length > 0 ? `Updated ${r.join(" and ")}` : "No comments updated";
|
|
5490
5531
|
}
|
|
5491
|
-
const
|
|
5532
|
+
const Pi = s.object({
|
|
5492
5533
|
id: s.string().min(1).describe("The ID of the filter to update."),
|
|
5493
5534
|
name: s.string().min(1).optional().describe("The new name of the filter."),
|
|
5494
5535
|
query: s.string().min(1).optional().describe(
|
|
@@ -5496,25 +5537,25 @@ const Ai = s.object({
|
|
|
5496
5537
|
),
|
|
5497
5538
|
color: de,
|
|
5498
5539
|
isFavorite: s.boolean().optional().describe("Whether to mark the filter as a favorite.")
|
|
5499
|
-
}),
|
|
5500
|
-
filters: s.array(
|
|
5501
|
-
},
|
|
5502
|
-
filters: s.array(
|
|
5540
|
+
}), _i = {
|
|
5541
|
+
filters: s.array(Pi).min(1).describe("The filters to update.")
|
|
5542
|
+
}, Ri = {
|
|
5543
|
+
filters: s.array(nt).describe("The updated filters."),
|
|
5503
5544
|
totalCount: s.number().describe("The total number of filters updated."),
|
|
5504
5545
|
updatedFilterIds: s.array(s.string()).describe("The IDs of the updated filters."),
|
|
5505
5546
|
appliedOperations: s.object({
|
|
5506
5547
|
updateCount: s.number().describe("The number of filters actually updated."),
|
|
5507
5548
|
skippedCount: s.number().describe("The number of filters skipped (no changes).")
|
|
5508
5549
|
}).describe("Summary of operations performed.")
|
|
5509
|
-
},
|
|
5550
|
+
}, Ni = {
|
|
5510
5551
|
name: f.UPDATE_FILTERS,
|
|
5511
5552
|
description: "Update one or more existing personal filters with new values.",
|
|
5512
|
-
parameters:
|
|
5513
|
-
outputSchema:
|
|
5553
|
+
parameters: _i,
|
|
5554
|
+
outputSchema: Ri,
|
|
5514
5555
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5515
5556
|
async execute(e, t) {
|
|
5516
5557
|
const { filters: o } = e, r = [], a = o.map((m) => {
|
|
5517
|
-
const h =
|
|
5558
|
+
const h = Mi(m);
|
|
5518
5559
|
return h !== null ? { kind: "skipped", reason: h } : (r.push(m), { kind: "updated", filter: m });
|
|
5519
5560
|
}).filter((m) => m.kind === "skipped").length;
|
|
5520
5561
|
if (r.length === 0)
|
|
@@ -5545,7 +5586,7 @@ const Ai = s.object({
|
|
|
5545
5586
|
itemOrder: m.itemOrder
|
|
5546
5587
|
}));
|
|
5547
5588
|
return {
|
|
5548
|
-
textContent:
|
|
5589
|
+
textContent: Li({ filters: p, skippedCount: a }),
|
|
5549
5590
|
structuredContent: {
|
|
5550
5591
|
filters: p,
|
|
5551
5592
|
totalCount: p.length,
|
|
@@ -5558,7 +5599,7 @@ const Ai = s.object({
|
|
|
5558
5599
|
};
|
|
5559
5600
|
}
|
|
5560
5601
|
};
|
|
5561
|
-
function
|
|
5602
|
+
function Li({
|
|
5562
5603
|
filters: e,
|
|
5563
5604
|
skippedCount: t
|
|
5564
5605
|
}) {
|
|
@@ -5572,10 +5613,10 @@ ${n}`;
|
|
|
5572
5613
|
}
|
|
5573
5614
|
return r;
|
|
5574
5615
|
}
|
|
5575
|
-
function
|
|
5616
|
+
function Mi({ id: e, ...t }) {
|
|
5576
5617
|
return Object.values(t).every((r) => r === void 0) ? "no-fields" : null;
|
|
5577
5618
|
}
|
|
5578
|
-
const ne = "remove",
|
|
5619
|
+
const ne = "remove", Je = "unassign", Dt = 25, Fi = s.object({
|
|
5579
5620
|
id: s.string().min(1).describe("The ID of the goal to update."),
|
|
5580
5621
|
name: s.string().min(1).optional().describe("New goal name."),
|
|
5581
5622
|
description: s.preprocess(
|
|
@@ -5587,50 +5628,50 @@ const ne = "remove", Ke = "unassign", $t = 25, _i = s.object({
|
|
|
5587
5628
|
s.string().describe(`New deadline (YYYY-MM-DD). Use "${ne}" to clear.`)
|
|
5588
5629
|
).optional(),
|
|
5589
5630
|
responsibleUid: s.preprocess(
|
|
5590
|
-
(e) => e === null ?
|
|
5591
|
-
s.string().describe(`New responsible user ID. Use "${
|
|
5631
|
+
(e) => e === null ? Je : e,
|
|
5632
|
+
s.string().describe(`New responsible user ID. Use "${Je}" to clear.`)
|
|
5592
5633
|
).optional()
|
|
5593
|
-
}),
|
|
5594
|
-
goals: s.array(
|
|
5595
|
-
},
|
|
5634
|
+
}), Hi = ["no-fields", "no-valid-values"], Wi = {
|
|
5635
|
+
goals: s.array(Fi).min(1).max(Dt).describe(`The array of goals to update (max ${Dt}).`)
|
|
5636
|
+
}, Gi = s.object({
|
|
5596
5637
|
id: s.string().describe("The ID of the goal that was skipped."),
|
|
5597
|
-
reason: s.enum(
|
|
5638
|
+
reason: s.enum(Hi).describe(
|
|
5598
5639
|
'"no-fields" = only the id was supplied; "no-valid-values" = all updatable fields were undefined.'
|
|
5599
5640
|
)
|
|
5600
|
-
}),
|
|
5641
|
+
}), Bi = {
|
|
5601
5642
|
goals: s.array(Se).describe("The updated goals."),
|
|
5602
5643
|
totalCount: s.number().describe("The total number of goals updated."),
|
|
5603
5644
|
updatedGoalIds: s.array(s.string()).describe("The IDs of the updated goals."),
|
|
5604
5645
|
appliedOperations: s.object({
|
|
5605
5646
|
updateCount: s.number().describe("The number of goals actually updated."),
|
|
5606
5647
|
skippedCount: s.number().describe("The number of goals skipped (no changes)."),
|
|
5607
|
-
skipped: s.array(
|
|
5648
|
+
skipped: s.array(Gi).describe("Per-goal skip details (id + reason).")
|
|
5608
5649
|
}).describe("Summary of operations performed.")
|
|
5609
5650
|
};
|
|
5610
5651
|
function Re(e, t) {
|
|
5611
5652
|
return e === t ? null : e;
|
|
5612
5653
|
}
|
|
5613
|
-
function
|
|
5654
|
+
function Yi({ id: e, ...t }) {
|
|
5614
5655
|
const o = Object.values(t);
|
|
5615
5656
|
return o.length === 0 ? "no-fields" : o.every((r) => r === void 0) ? "no-valid-values" : null;
|
|
5616
5657
|
}
|
|
5617
|
-
const
|
|
5658
|
+
const qi = {
|
|
5618
5659
|
name: f.UPDATE_GOALS,
|
|
5619
5660
|
description: "Update one or more goals by their IDs.",
|
|
5620
|
-
parameters:
|
|
5621
|
-
outputSchema:
|
|
5661
|
+
parameters: Wi,
|
|
5662
|
+
outputSchema: Bi,
|
|
5622
5663
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
|
|
5623
5664
|
async execute({ goals: e }, t) {
|
|
5624
5665
|
const o = await Promise.all(
|
|
5625
5666
|
e.map(async (l) => {
|
|
5626
|
-
const p =
|
|
5667
|
+
const p = Yi(l);
|
|
5627
5668
|
if (p !== null)
|
|
5628
5669
|
return { kind: "skipped", id: l.id, reason: p };
|
|
5629
5670
|
const { id: u, description: m, deadline: h, responsibleUid: k, ...b } = l, C = await t.updateGoal(u, {
|
|
5630
5671
|
...b,
|
|
5631
5672
|
description: Re(m, ne),
|
|
5632
5673
|
deadline: Re(h, ne),
|
|
5633
|
-
responsibleUid: Re(k,
|
|
5674
|
+
responsibleUid: Re(k, Je)
|
|
5634
5675
|
});
|
|
5635
5676
|
return { kind: "updated", goal: ve(C) };
|
|
5636
5677
|
})
|
|
@@ -5639,7 +5680,7 @@ const Hi = {
|
|
|
5639
5680
|
).map((l) => l.goal), n = o.filter(
|
|
5640
5681
|
(l) => l.kind === "skipped"
|
|
5641
5682
|
).map(({ id: l, reason: p }) => ({ id: l, reason: p })), a = r.length, i = r.map((l) => `• ${l.name} (id=${l.id})`).join(`
|
|
5642
|
-
`), c =
|
|
5683
|
+
`), c = zi(n);
|
|
5643
5684
|
return {
|
|
5644
5685
|
textContent: a > 0 ? `Updated ${a} goal${a === 1 ? "" : "s"}${c}:
|
|
5645
5686
|
${i}` : `Updated 0 goals${c}`,
|
|
@@ -5656,7 +5697,7 @@ ${i}` : `Updated 0 goals${c}`,
|
|
|
5656
5697
|
};
|
|
5657
5698
|
}
|
|
5658
5699
|
};
|
|
5659
|
-
function
|
|
5700
|
+
function zi(e) {
|
|
5660
5701
|
if (e.length === 0) return "";
|
|
5661
5702
|
const t = /* @__PURE__ */ new Map();
|
|
5662
5703
|
for (const { id: r, reason: n } of e) {
|
|
@@ -5667,49 +5708,49 @@ function Wi(e) {
|
|
|
5667
5708
|
([r, n]) => `${n.length} skipped — ${r} (${n.join(", ")})`
|
|
5668
5709
|
).join("; ")})`;
|
|
5669
5710
|
}
|
|
5670
|
-
const
|
|
5711
|
+
const Ki = s.object({
|
|
5671
5712
|
labelType: s.literal("personal").describe("Update a personal label, identified by its ID."),
|
|
5672
5713
|
id: s.string().min(1).describe("The ID of the personal label to update."),
|
|
5673
5714
|
name: s.string().min(1).max(128).optional().describe("The new name of the label."),
|
|
5674
5715
|
color: de,
|
|
5675
5716
|
order: s.number().int().optional().describe("The new position of the label in the label list."),
|
|
5676
5717
|
isFavorite: s.boolean().optional().describe("Whether to mark the label as a favorite.")
|
|
5677
|
-
}),
|
|
5718
|
+
}), Vi = s.object({
|
|
5678
5719
|
labelType: s.literal("shared").describe(
|
|
5679
5720
|
"Rename a shared label across all tasks. Shared labels are identified by name; only renaming is supported (no color, order, or favorite)."
|
|
5680
5721
|
),
|
|
5681
5722
|
name: s.string().min(1).describe("The current name of the shared label."),
|
|
5682
5723
|
newName: s.string().min(1).describe("The new name for the shared label.")
|
|
5683
|
-
}),
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
]),
|
|
5687
|
-
labels: s.array(
|
|
5724
|
+
}), Ji = s.discriminatedUnion("labelType", [
|
|
5725
|
+
Ki,
|
|
5726
|
+
Vi
|
|
5727
|
+
]), Xi = {
|
|
5728
|
+
labels: s.array(Ji).min(1).describe(
|
|
5688
5729
|
'The labels to update. Use labelType="personal" with an ID to update a personal label, or labelType="shared" with name+newName to rename a shared label.'
|
|
5689
5730
|
)
|
|
5690
|
-
},
|
|
5731
|
+
}, Zi = s.object({
|
|
5691
5732
|
name: s.string().describe("The previous name of the shared label."),
|
|
5692
5733
|
newName: s.string().describe("The new name of the shared label.")
|
|
5693
|
-
}),
|
|
5734
|
+
}), Qi = {
|
|
5694
5735
|
updatedLabels: s.array(pe).describe("The updated personal labels."),
|
|
5695
|
-
renamedSharedLabels: s.array(
|
|
5736
|
+
renamedSharedLabels: s.array(Zi).describe("The shared labels that were renamed."),
|
|
5696
5737
|
totalCount: s.number().describe("The total number of successful operations (personal + shared)."),
|
|
5697
5738
|
appliedOperations: s.object({
|
|
5698
5739
|
updateCount: s.number().describe("Number of personal labels updated."),
|
|
5699
5740
|
renameCount: s.number().describe("Number of shared labels renamed."),
|
|
5700
5741
|
skippedCount: s.number().describe("Number of operations skipped (no changes or shared label not found).")
|
|
5701
5742
|
}).describe("Summary of operations performed.")
|
|
5702
|
-
},
|
|
5743
|
+
}, ec = {
|
|
5703
5744
|
name: f.UPDATE_LABELS,
|
|
5704
5745
|
description: "Update one or more existing labels. Personal labels (identified by ID) can have their name, color, order, and favorite flag updated. Shared labels (identified by name) can only be renamed.",
|
|
5705
|
-
parameters:
|
|
5706
|
-
outputSchema:
|
|
5746
|
+
parameters: Xi,
|
|
5747
|
+
outputSchema: Qi,
|
|
5707
5748
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5708
5749
|
async execute(e, t) {
|
|
5709
5750
|
const { labels: o } = e, r = await Promise.all(
|
|
5710
5751
|
o.map(async (p) => {
|
|
5711
5752
|
if (p.labelType === "personal") {
|
|
5712
|
-
const m =
|
|
5753
|
+
const m = sc(p);
|
|
5713
5754
|
if (m !== null) return { kind: "skipped", reason: m };
|
|
5714
5755
|
const { id: h, labelType: k, ...b } = p;
|
|
5715
5756
|
return { kind: "updated", label: await t.updateLabel(h, b) };
|
|
@@ -5727,7 +5768,7 @@ const Gi = s.object({
|
|
|
5727
5768
|
(p) => p.kind === "skipped" && p.reason === "not-found"
|
|
5728
5769
|
).length;
|
|
5729
5770
|
return {
|
|
5730
|
-
textContent:
|
|
5771
|
+
textContent: tc({
|
|
5731
5772
|
updatedLabels: n,
|
|
5732
5773
|
renamedSharedLabels: a,
|
|
5733
5774
|
skippedNoFields: c,
|
|
@@ -5746,7 +5787,7 @@ const Gi = s.object({
|
|
|
5746
5787
|
};
|
|
5747
5788
|
}
|
|
5748
5789
|
};
|
|
5749
|
-
function
|
|
5790
|
+
function tc({
|
|
5750
5791
|
updatedLabels: e,
|
|
5751
5792
|
renamedSharedLabels: t,
|
|
5752
5793
|
skippedNoFields: o,
|
|
@@ -5768,14 +5809,14 @@ function Ji({
|
|
|
5768
5809
|
return c.join(`
|
|
5769
5810
|
`);
|
|
5770
5811
|
}
|
|
5771
|
-
function
|
|
5812
|
+
function sc({
|
|
5772
5813
|
id: e,
|
|
5773
5814
|
labelType: t,
|
|
5774
5815
|
...o
|
|
5775
5816
|
}) {
|
|
5776
5817
|
return Object.values(o).every((n) => n === void 0) ? "no-fields" : null;
|
|
5777
5818
|
}
|
|
5778
|
-
const
|
|
5819
|
+
const oc = s.object({
|
|
5779
5820
|
id: s.string().min(1).describe("The ID of the project to update."),
|
|
5780
5821
|
name: s.string().min(1).optional().describe("The new name of the project."),
|
|
5781
5822
|
isFavorite: s.boolean().optional().describe("Whether the project is a favorite."),
|
|
@@ -5790,9 +5831,9 @@ const Zi = s.object({
|
|
|
5790
5831
|
)
|
|
5791
5832
|
).optional(),
|
|
5792
5833
|
color: de
|
|
5793
|
-
}),
|
|
5794
|
-
projects: s.array(
|
|
5795
|
-
},
|
|
5834
|
+
}), rc = {
|
|
5835
|
+
projects: s.array(oc).min(1).describe("The projects to update.")
|
|
5836
|
+
}, nc = {
|
|
5796
5837
|
projects: s.array(ue).describe("The updated projects."),
|
|
5797
5838
|
totalCount: s.number().describe("The total number of projects updated."),
|
|
5798
5839
|
updatedProjectIds: s.array(s.string()).describe("The IDs of the updated projects."),
|
|
@@ -5800,16 +5841,16 @@ const Zi = s.object({
|
|
|
5800
5841
|
updateCount: s.number().describe("The number of projects actually updated."),
|
|
5801
5842
|
skippedCount: s.number().describe("The number of projects skipped (no changes).")
|
|
5802
5843
|
}).describe("Summary of operations performed.")
|
|
5803
|
-
},
|
|
5844
|
+
}, ac = {
|
|
5804
5845
|
name: f.UPDATE_PROJECTS,
|
|
5805
5846
|
description: "Update multiple existing projects with new values.",
|
|
5806
|
-
parameters:
|
|
5807
|
-
outputSchema:
|
|
5847
|
+
parameters: rc,
|
|
5848
|
+
outputSchema: nc,
|
|
5808
5849
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5809
5850
|
async execute(e, t) {
|
|
5810
5851
|
const { projects: o } = e, r = await Promise.all(
|
|
5811
5852
|
o.map(async (d) => {
|
|
5812
|
-
const l =
|
|
5853
|
+
const l = cc(d);
|
|
5813
5854
|
if (l !== null) return { kind: "skipped", reason: l };
|
|
5814
5855
|
const { id: p, ...u } = d;
|
|
5815
5856
|
return { kind: "updated", project: await t.updateProject(p, u) };
|
|
@@ -5822,7 +5863,7 @@ const Zi = s.object({
|
|
|
5822
5863
|
(d) => d.kind === "skipped" && d.reason === "no-valid-values"
|
|
5823
5864
|
).length;
|
|
5824
5865
|
return {
|
|
5825
|
-
textContent:
|
|
5866
|
+
textContent: ic({
|
|
5826
5867
|
projects: n,
|
|
5827
5868
|
skippedNoFields: a,
|
|
5828
5869
|
skippedNoValidValues: i
|
|
@@ -5839,7 +5880,7 @@ const Zi = s.object({
|
|
|
5839
5880
|
};
|
|
5840
5881
|
}
|
|
5841
5882
|
};
|
|
5842
|
-
function
|
|
5883
|
+
function ic({
|
|
5843
5884
|
projects: e,
|
|
5844
5885
|
skippedNoFields: t,
|
|
5845
5886
|
skippedNoValidValues: o
|
|
@@ -5851,49 +5892,49 @@ function sc({
|
|
|
5851
5892
|
return t > 0 && i.push(`${t} skipped - no changes`), o > 0 && i.push(`${o} skipped - no valid field values`), i.length > 0 && (a += ` (${i.join(", ")})`), r > 0 && (a += `:
|
|
5852
5893
|
${n}`), a;
|
|
5853
5894
|
}
|
|
5854
|
-
function
|
|
5895
|
+
function cc({ id: e, ...t }) {
|
|
5855
5896
|
const o = Object.values(t);
|
|
5856
5897
|
return o.length === 0 ? "no-fields" : o.every((r) => r === void 0) ? "no-valid-values" : null;
|
|
5857
5898
|
}
|
|
5858
|
-
const
|
|
5899
|
+
const dc = s.object({
|
|
5859
5900
|
type: s.literal("relative"),
|
|
5860
5901
|
id: s.string().min(1).describe("The ID of the relative reminder to update."),
|
|
5861
5902
|
minuteOffset: s.number().int().min(0).optional().describe("New minute offset before task due time."),
|
|
5862
5903
|
service: Ce.optional().describe('New delivery method: "email" or "push".'),
|
|
5863
5904
|
isUrgent: $e
|
|
5864
|
-
}),
|
|
5905
|
+
}), lc = s.object({
|
|
5865
5906
|
type: s.literal("absolute"),
|
|
5866
5907
|
id: s.string().min(1).describe("The ID of the absolute reminder to update."),
|
|
5867
|
-
due:
|
|
5908
|
+
due: Vt.optional().describe("New due date/time for the reminder."),
|
|
5868
5909
|
service: Ce.optional().describe('New delivery method: "email" or "push".'),
|
|
5869
5910
|
isUrgent: $e
|
|
5870
|
-
}),
|
|
5911
|
+
}), uc = s.object({
|
|
5871
5912
|
type: s.literal("location"),
|
|
5872
5913
|
id: s.string().min(1).describe("The ID of the location reminder to update."),
|
|
5873
5914
|
name: s.string().optional().describe("New location name."),
|
|
5874
5915
|
locLat: s.string().optional().describe("New latitude."),
|
|
5875
5916
|
locLong: s.string().optional().describe("New longitude."),
|
|
5876
|
-
locTrigger:
|
|
5917
|
+
locTrigger: Jt.optional().describe(
|
|
5877
5918
|
'New trigger condition: "on_enter" or "on_leave".'
|
|
5878
5919
|
),
|
|
5879
5920
|
radius: s.number().int().optional().describe("New radius in meters.")
|
|
5880
|
-
}),
|
|
5881
|
-
|
|
5882
|
-
|
|
5883
|
-
|
|
5884
|
-
]),
|
|
5885
|
-
reminders: s.array(
|
|
5921
|
+
}), pc = s.discriminatedUnion("type", [
|
|
5922
|
+
dc,
|
|
5923
|
+
lc,
|
|
5924
|
+
uc
|
|
5925
|
+
]), mc = {
|
|
5926
|
+
reminders: s.array(pc).min(1).max(Te).describe(
|
|
5886
5927
|
`Array of reminders to update (max ${Te}). Each must include the reminder type and ID. Only include fields that need to change.`
|
|
5887
5928
|
)
|
|
5888
|
-
},
|
|
5889
|
-
reminders: s.array(
|
|
5929
|
+
}, hc = {
|
|
5930
|
+
reminders: s.array(rt).describe("The updated reminders."),
|
|
5890
5931
|
totalCount: s.number().describe("Total reminders updated."),
|
|
5891
5932
|
updatedReminderIds: s.array(s.string()).describe("IDs of updated reminders.")
|
|
5892
|
-
},
|
|
5933
|
+
}, fc = {
|
|
5893
5934
|
name: f.UPDATE_REMINDERS,
|
|
5894
5935
|
description: 'Update existing reminders. Each reminder must specify its type ("relative", "absolute", or "location") and ID. Only include fields that need to change.',
|
|
5895
|
-
parameters:
|
|
5896
|
-
outputSchema:
|
|
5936
|
+
parameters: mc,
|
|
5937
|
+
outputSchema: hc,
|
|
5897
5938
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !0 },
|
|
5898
5939
|
async execute(e, t) {
|
|
5899
5940
|
const { reminders: o } = e, r = o.map(async (d) => {
|
|
@@ -5927,7 +5968,7 @@ const rc = s.object({
|
|
|
5927
5968
|
}
|
|
5928
5969
|
};
|
|
5929
5970
|
}
|
|
5930
|
-
},
|
|
5971
|
+
}, bc = s.object({
|
|
5931
5972
|
id: s.string().min(1).describe("The ID of the section to update."),
|
|
5932
5973
|
name: s.string().min(1).optional().describe("The new name of the section."),
|
|
5933
5974
|
description: s.preprocess(
|
|
@@ -5942,17 +5983,17 @@ const rc = s.object({
|
|
|
5942
5983
|
).optional()
|
|
5943
5984
|
}).refine((e) => e.name !== void 0 || e.description !== void 0, {
|
|
5944
5985
|
message: 'Provide at least one of "name" or "description" to update.'
|
|
5945
|
-
}),
|
|
5946
|
-
sections: s.array(
|
|
5947
|
-
},
|
|
5986
|
+
}), gc = {
|
|
5987
|
+
sections: s.array(bc).min(1).describe("The sections to update.")
|
|
5988
|
+
}, yc = {
|
|
5948
5989
|
sections: s.array(ce).describe("The updated sections."),
|
|
5949
5990
|
totalCount: s.number().describe("The total number of sections updated."),
|
|
5950
5991
|
updatedSectionIds: s.array(s.string()).describe("The IDs of the updated sections.")
|
|
5951
|
-
},
|
|
5992
|
+
}, kc = {
|
|
5952
5993
|
name: f.UPDATE_SECTIONS,
|
|
5953
5994
|
description: "Update multiple existing sections with new values.",
|
|
5954
|
-
parameters:
|
|
5955
|
-
outputSchema:
|
|
5995
|
+
parameters: gc,
|
|
5996
|
+
outputSchema: yc,
|
|
5956
5997
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5957
5998
|
async execute({ sections: e }, t) {
|
|
5958
5999
|
const o = await Promise.all(
|
|
@@ -5965,7 +6006,7 @@ const rc = s.object({
|
|
|
5965
6006
|
})
|
|
5966
6007
|
);
|
|
5967
6008
|
return {
|
|
5968
|
-
textContent:
|
|
6009
|
+
textContent: Tc({
|
|
5969
6010
|
sections: o
|
|
5970
6011
|
}),
|
|
5971
6012
|
structuredContent: {
|
|
@@ -5976,13 +6017,13 @@ const rc = s.object({
|
|
|
5976
6017
|
};
|
|
5977
6018
|
}
|
|
5978
6019
|
};
|
|
5979
|
-
function
|
|
6020
|
+
function Tc({ sections: e }) {
|
|
5980
6021
|
const t = e.length, o = e.map((n) => `• ${n.name} (id=${n.id}, projectId=${n.projectId})`).join(`
|
|
5981
6022
|
`);
|
|
5982
6023
|
return `Updated ${t} section${t === 1 ? "" : "s"}:
|
|
5983
6024
|
${o}`;
|
|
5984
6025
|
}
|
|
5985
|
-
const
|
|
6026
|
+
const wc = s.object({
|
|
5986
6027
|
id: s.string().min(1).describe("The ID of the task to update."),
|
|
5987
6028
|
content: s.string().optional().describe(
|
|
5988
6029
|
'The new task name/title. Should be concise and actionable (e.g., "Review PR #123", "Call dentist"). For longer content, use the description field instead. Supports Markdown.'
|
|
@@ -5996,7 +6037,7 @@ const bc = s.object({
|
|
|
5996
6037
|
sectionId: s.string().optional().describe("The new section ID for the task."),
|
|
5997
6038
|
parentId: s.string().optional().describe("The new parent task ID (for subtasks)."),
|
|
5998
6039
|
order: s.number().optional().describe("The new order of the task within its parent/section."),
|
|
5999
|
-
priority:
|
|
6040
|
+
priority: et.optional().describe(Qe),
|
|
6000
6041
|
dueString: s.preprocess(
|
|
6001
6042
|
// Keep accepting legacy null while exposing a Gemini-compatible string schema.
|
|
6002
6043
|
(e) => e === null ? "remove" : e,
|
|
@@ -6021,9 +6062,9 @@ const bc = s.object({
|
|
|
6021
6062
|
isUncompletable: s.boolean().optional().describe(
|
|
6022
6063
|
"Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
|
|
6023
6064
|
)
|
|
6024
|
-
}),
|
|
6025
|
-
tasks: s.array(
|
|
6026
|
-
},
|
|
6065
|
+
}), vc = ["remove", "no date"], Ic = ["remove", "no date", "no deadline"], jc = "no date", Sc = {
|
|
6066
|
+
tasks: s.array(wc).min(1).describe("The tasks to update.")
|
|
6067
|
+
}, Cc = {
|
|
6027
6068
|
tasks: s.array(J).describe("The updated tasks."),
|
|
6028
6069
|
totalCount: s.number().describe("The total number of tasks updated."),
|
|
6029
6070
|
updatedTaskIds: s.array(s.string()).describe("The IDs of the updated tasks."),
|
|
@@ -6031,15 +6072,15 @@ const bc = s.object({
|
|
|
6031
6072
|
updateCount: s.number().describe("The number of tasks actually updated."),
|
|
6032
6073
|
skippedCount: s.number().describe("The number of tasks skipped (no changes).")
|
|
6033
6074
|
}).describe("Summary of operations performed.")
|
|
6034
|
-
},
|
|
6075
|
+
}, $c = {
|
|
6035
6076
|
name: f.UPDATE_TASKS,
|
|
6036
6077
|
description: "Update existing tasks including content, dates, priorities, and assignments.",
|
|
6037
|
-
parameters:
|
|
6038
|
-
outputSchema:
|
|
6078
|
+
parameters: Sc,
|
|
6079
|
+
outputSchema: Cc,
|
|
6039
6080
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
6040
6081
|
async execute(e, t) {
|
|
6041
6082
|
const { tasks: o } = e, r = o.map(async (c) => {
|
|
6042
|
-
if (!
|
|
6083
|
+
if (!Ac(c))
|
|
6043
6084
|
return;
|
|
6044
6085
|
const {
|
|
6045
6086
|
id: d,
|
|
@@ -6061,21 +6102,21 @@ const bc = s.object({
|
|
|
6061
6102
|
...x,
|
|
6062
6103
|
...C !== void 0 && { labels: C }
|
|
6063
6104
|
};
|
|
6064
|
-
b && (y.priority =
|
|
6065
|
-
const D =
|
|
6105
|
+
b && (y.priority = Gt(b));
|
|
6106
|
+
const D = At(
|
|
6066
6107
|
m,
|
|
6067
|
-
|
|
6068
|
-
|
|
6108
|
+
vc,
|
|
6109
|
+
jc
|
|
6069
6110
|
);
|
|
6070
6111
|
D !== void 0 && (y = { ...y, dueString: D });
|
|
6071
|
-
const R =
|
|
6112
|
+
const R = At(
|
|
6072
6113
|
I,
|
|
6073
|
-
|
|
6114
|
+
Ic,
|
|
6074
6115
|
null
|
|
6075
6116
|
);
|
|
6076
6117
|
if (R !== void 0 && (y = { ...y, deadlineDate: R }), h)
|
|
6077
6118
|
try {
|
|
6078
|
-
const { minutes: S } =
|
|
6119
|
+
const { minutes: S } = Wt(h);
|
|
6079
6120
|
y = {
|
|
6080
6121
|
...y,
|
|
6081
6122
|
duration: S,
|
|
@@ -6088,7 +6129,7 @@ const bc = s.object({
|
|
|
6088
6129
|
if (k === null || k === "unassign")
|
|
6089
6130
|
y = { ...y, assigneeId: null };
|
|
6090
6131
|
else {
|
|
6091
|
-
const S = await
|
|
6132
|
+
const S = await at.validateTaskUpdateAssignment(
|
|
6092
6133
|
t,
|
|
6093
6134
|
d,
|
|
6094
6135
|
k
|
|
@@ -6103,13 +6144,13 @@ const bc = s.object({
|
|
|
6103
6144
|
}
|
|
6104
6145
|
if (!w && !p && !u)
|
|
6105
6146
|
return await t.updateTask(d, y);
|
|
6106
|
-
const v =
|
|
6147
|
+
const v = Go(d, w, p, u), $ = await t.moveTask(d, v);
|
|
6107
6148
|
return Object.keys(y).length > 0 ? await t.updateTask(d, y) : $;
|
|
6108
6149
|
}), n = (await Promise.all(r)).filter(
|
|
6109
6150
|
(c) => c !== void 0
|
|
6110
6151
|
), a = n.map(_);
|
|
6111
6152
|
return {
|
|
6112
|
-
textContent:
|
|
6153
|
+
textContent: Dc({
|
|
6113
6154
|
tasks: a,
|
|
6114
6155
|
args: e
|
|
6115
6156
|
}),
|
|
@@ -6125,21 +6166,21 @@ const bc = s.object({
|
|
|
6125
6166
|
};
|
|
6126
6167
|
}
|
|
6127
6168
|
};
|
|
6128
|
-
function
|
|
6169
|
+
function Dc({
|
|
6129
6170
|
tasks: e,
|
|
6130
6171
|
args: t
|
|
6131
6172
|
}) {
|
|
6132
6173
|
const o = t.tasks.length, r = e.length, n = o - r;
|
|
6133
6174
|
let a = "";
|
|
6134
|
-
return n > 0 && (a = ` (${n} skipped - no changes)`),
|
|
6175
|
+
return n > 0 && (a = ` (${n} skipped - no changes)`), it("Updated", e, {
|
|
6135
6176
|
context: a,
|
|
6136
6177
|
showDetails: e.length <= 5
|
|
6137
6178
|
});
|
|
6138
6179
|
}
|
|
6139
|
-
function
|
|
6180
|
+
function Ac({ id: e, ...t }) {
|
|
6140
6181
|
return Object.keys(t).length > 0;
|
|
6141
6182
|
}
|
|
6142
|
-
function
|
|
6183
|
+
function At(e, t, o) {
|
|
6143
6184
|
if (e === void 0)
|
|
6144
6185
|
return e;
|
|
6145
6186
|
if (e === null)
|
|
@@ -6147,7 +6188,7 @@ function Dt(e, t, o) {
|
|
|
6147
6188
|
const r = e.trim().toLowerCase();
|
|
6148
6189
|
return t.includes(r) ? o : e;
|
|
6149
6190
|
}
|
|
6150
|
-
const
|
|
6191
|
+
const xc = {}, Ec = {
|
|
6151
6192
|
type: s.literal("user_info").describe("The type of the response."),
|
|
6152
6193
|
userId: s.string().describe("The user ID."),
|
|
6153
6194
|
fullName: s.string().describe("The full name of the user."),
|
|
@@ -6164,36 +6205,36 @@ const Sc = {}, Cc = {
|
|
|
6164
6205
|
email: s.string().describe("The email address of the user."),
|
|
6165
6206
|
plan: s.enum(["Todoist Free", "Todoist Pro", "Todoist Business"]).describe("The user plan.")
|
|
6166
6207
|
};
|
|
6167
|
-
function
|
|
6208
|
+
function Oc(e) {
|
|
6168
6209
|
return e.businessAccountId ? "Todoist Business" : e.isPremium ? "Todoist Pro" : "Todoist Free";
|
|
6169
6210
|
}
|
|
6170
|
-
function
|
|
6211
|
+
function Uc(e, t) {
|
|
6171
6212
|
const r = ((e.getDay() || 7) - t + 7) % 7, n = new Date(e);
|
|
6172
6213
|
return n.setDate(e.getDate() - r), n;
|
|
6173
6214
|
}
|
|
6174
|
-
function
|
|
6215
|
+
function Pc(e) {
|
|
6175
6216
|
const t = new Date(e);
|
|
6176
6217
|
return t.setDate(e.getDate() + 6), t;
|
|
6177
6218
|
}
|
|
6178
|
-
function
|
|
6219
|
+
function _c(e) {
|
|
6179
6220
|
const t = new Date(e.getFullYear(), 0, 1), o = (e.getTime() - t.getTime()) / 864e5;
|
|
6180
6221
|
return Math.ceil((o + t.getDay() + 1) / 7);
|
|
6181
6222
|
}
|
|
6182
|
-
function
|
|
6223
|
+
function Rc(e) {
|
|
6183
6224
|
return ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"][e === 7 ? 0 : e] ?? "Unknown";
|
|
6184
6225
|
}
|
|
6185
|
-
function
|
|
6226
|
+
function Nc(e) {
|
|
6186
6227
|
try {
|
|
6187
6228
|
return new Intl.DateTimeFormat("en-US", { timeZone: e }), !0;
|
|
6188
6229
|
} catch {
|
|
6189
6230
|
return !1;
|
|
6190
6231
|
}
|
|
6191
6232
|
}
|
|
6192
|
-
function
|
|
6193
|
-
return
|
|
6233
|
+
function us(e) {
|
|
6234
|
+
return Nc(e) ? e : "UTC";
|
|
6194
6235
|
}
|
|
6195
|
-
function
|
|
6196
|
-
const o =
|
|
6236
|
+
function Lc(e, t) {
|
|
6237
|
+
const o = us(t);
|
|
6197
6238
|
return e.toLocaleString("en-US", {
|
|
6198
6239
|
timeZone: o,
|
|
6199
6240
|
year: "numeric",
|
|
@@ -6205,8 +6246,8 @@ function Uc(e, t) {
|
|
|
6205
6246
|
hour12: !1
|
|
6206
6247
|
});
|
|
6207
6248
|
}
|
|
6208
|
-
async function
|
|
6209
|
-
const t = await e.getUser(), o = t.tzInfo?.timezone ?? "UTC", r =
|
|
6249
|
+
async function Mc(e) {
|
|
6250
|
+
const t = await e.getUser(), o = t.tzInfo?.timezone ?? "UTC", r = us(o), n = /* @__PURE__ */ new Date(), a = Lc(n, r), i = t.startDay ?? 1, c = Rc(i), d = Oc(t), l = new Date(n.toLocaleString("en-US", { timeZone: r })), p = Uc(l, i), u = Pc(p), m = _c(l), k = [
|
|
6210
6251
|
"# User Information",
|
|
6211
6252
|
"",
|
|
6212
6253
|
`**User ID:** ${t.id}`,
|
|
@@ -6248,26 +6289,26 @@ async function Pc(e) {
|
|
|
6248
6289
|
};
|
|
6249
6290
|
return { textContent: k, structuredContent: b };
|
|
6250
6291
|
}
|
|
6251
|
-
const
|
|
6292
|
+
const Fc = {
|
|
6252
6293
|
name: f.USER_INFO,
|
|
6253
6294
|
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).",
|
|
6254
|
-
parameters:
|
|
6255
|
-
outputSchema:
|
|
6295
|
+
parameters: xc,
|
|
6296
|
+
outputSchema: Ec,
|
|
6256
6297
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
6257
6298
|
async execute(e, t) {
|
|
6258
|
-
const o = await
|
|
6299
|
+
const o = await Mc(t);
|
|
6259
6300
|
return {
|
|
6260
6301
|
textContent: o.textContent,
|
|
6261
6302
|
structuredContent: o.structuredContent
|
|
6262
6303
|
};
|
|
6263
6304
|
}
|
|
6264
|
-
},
|
|
6305
|
+
}, xt = 10 * 1024 * 1024, Hc = /* @__PURE__ */ new Set([
|
|
6265
6306
|
"image/png",
|
|
6266
6307
|
"image/jpeg",
|
|
6267
6308
|
"image/gif",
|
|
6268
6309
|
"image/webp",
|
|
6269
6310
|
"image/svg+xml"
|
|
6270
|
-
]),
|
|
6311
|
+
]), Wc = /* @__PURE__ */ new Set([
|
|
6271
6312
|
"text/plain",
|
|
6272
6313
|
"text/csv",
|
|
6273
6314
|
"text/html",
|
|
@@ -6275,7 +6316,7 @@ const _c = {
|
|
|
6275
6316
|
"application/json",
|
|
6276
6317
|
"application/xml",
|
|
6277
6318
|
"text/xml"
|
|
6278
|
-
]),
|
|
6319
|
+
]), Gc = {
|
|
6279
6320
|
".png": "image/png",
|
|
6280
6321
|
".jpg": "image/jpeg",
|
|
6281
6322
|
".jpeg": "image/jpeg",
|
|
@@ -6290,23 +6331,23 @@ const _c = {
|
|
|
6290
6331
|
".xml": "application/xml",
|
|
6291
6332
|
".pdf": "application/pdf"
|
|
6292
6333
|
};
|
|
6293
|
-
function
|
|
6294
|
-
return
|
|
6334
|
+
function Bc(e) {
|
|
6335
|
+
return Hc.has(e) ? "image" : Wc.has(e) || e.startsWith("text/") ? "text" : "binary";
|
|
6295
6336
|
}
|
|
6296
|
-
function
|
|
6337
|
+
function Yc(e) {
|
|
6297
6338
|
return (e.split(";")[0] ?? e).trim().toLowerCase();
|
|
6298
6339
|
}
|
|
6299
|
-
function
|
|
6340
|
+
function qc(e) {
|
|
6300
6341
|
try {
|
|
6301
6342
|
const t = new URL(e).pathname, o = t.lastIndexOf(".");
|
|
6302
6343
|
if (o === -1) return;
|
|
6303
6344
|
const r = t.slice(o).toLowerCase();
|
|
6304
|
-
return
|
|
6345
|
+
return Gc[r];
|
|
6305
6346
|
} catch {
|
|
6306
6347
|
return;
|
|
6307
6348
|
}
|
|
6308
6349
|
}
|
|
6309
|
-
function
|
|
6350
|
+
function zc(e) {
|
|
6310
6351
|
try {
|
|
6311
6352
|
const t = new URL(e).pathname, o = t.lastIndexOf("/");
|
|
6312
6353
|
return o === -1 ? void 0 : t.slice(o + 1) || void 0;
|
|
@@ -6314,31 +6355,31 @@ function Wc(e) {
|
|
|
6314
6355
|
return;
|
|
6315
6356
|
}
|
|
6316
6357
|
}
|
|
6317
|
-
const
|
|
6358
|
+
const Kc = {
|
|
6318
6359
|
fileUrl: s.url().describe(
|
|
6319
6360
|
"The URL of the attachment file to view. Get this from the fileUrl field in a comment's fileAttachment."
|
|
6320
6361
|
)
|
|
6321
|
-
},
|
|
6362
|
+
}, Vc = {
|
|
6322
6363
|
name: f.VIEW_ATTACHMENT,
|
|
6323
6364
|
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).",
|
|
6324
|
-
parameters:
|
|
6365
|
+
parameters: Kc,
|
|
6325
6366
|
annotations: {
|
|
6326
6367
|
readOnlyHint: !0,
|
|
6327
6368
|
destructiveHint: !1,
|
|
6328
6369
|
idempotentHint: !0
|
|
6329
6370
|
},
|
|
6330
6371
|
async execute({ fileUrl: e }, t) {
|
|
6331
|
-
const o = await t.viewAttachment(e), r = o.headers["content-length"], n = r ? Number.parseInt(r, 10) : void 0, a =
|
|
6332
|
-
if (n && n >
|
|
6372
|
+
const o = await t.viewAttachment(e), r = o.headers["content-length"], n = r ? Number.parseInt(r, 10) : void 0, a = zc(e), i = o.headers["content-type"], c = i ? Yc(i) : void 0, d = c && c !== "application/octet-stream" ? c : qc(e) ?? c ?? "application/octet-stream";
|
|
6373
|
+
if (n && n > xt)
|
|
6333
6374
|
return {
|
|
6334
6375
|
textContent: `Attachment "${a ?? e}" is too large to display inline (${(n / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
|
|
6335
6376
|
};
|
|
6336
6377
|
const l = Buffer.from(await o.arrayBuffer()), p = l.byteLength;
|
|
6337
|
-
if (p >
|
|
6378
|
+
if (p > xt)
|
|
6338
6379
|
return {
|
|
6339
6380
|
textContent: `Attachment "${a ?? e}" is too large to display inline (${(p / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
|
|
6340
6381
|
};
|
|
6341
|
-
const u =
|
|
6382
|
+
const u = Bc(d), m = [];
|
|
6342
6383
|
return u === "image" ? m.push({
|
|
6343
6384
|
type: "image",
|
|
6344
6385
|
data: l.toString("base64"),
|
|
@@ -6358,7 +6399,7 @@ const Gc = {
|
|
|
6358
6399
|
contentItems: m
|
|
6359
6400
|
};
|
|
6360
6401
|
}
|
|
6361
|
-
},
|
|
6402
|
+
}, Jc = `
|
|
6362
6403
|
## Todoist Task and Project Management Tools
|
|
6363
6404
|
|
|
6364
6405
|
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.
|
|
@@ -6460,31 +6501,31 @@ You have access to comprehensive Todoist management tools for personal productiv
|
|
|
6460
6501
|
|
|
6461
6502
|
Always provide clear, actionable task titles and descriptions. Use the overview tools to give users context about their workload and project status.
|
|
6462
6503
|
`;
|
|
6463
|
-
function
|
|
6504
|
+
function ld({
|
|
6464
6505
|
todoistApiKey: e,
|
|
6465
6506
|
baseUrl: t,
|
|
6466
6507
|
features: o = []
|
|
6467
6508
|
}) {
|
|
6468
|
-
const r = new
|
|
6469
|
-
{ name: "todoist-mcp-server", version:
|
|
6509
|
+
const r = new ms(
|
|
6510
|
+
{ name: "todoist-mcp-server", version: Ze },
|
|
6470
6511
|
{
|
|
6471
6512
|
capabilities: {
|
|
6472
6513
|
tools: { listChanged: !0 },
|
|
6473
6514
|
prompts: { listChanged: !0 }
|
|
6474
6515
|
},
|
|
6475
|
-
instructions:
|
|
6516
|
+
instructions: Jc
|
|
6476
6517
|
}
|
|
6477
|
-
), n =
|
|
6478
|
-
...
|
|
6518
|
+
), n = ao(e, { baseUrl: t }), a = {
|
|
6519
|
+
...ua,
|
|
6479
6520
|
_meta: {
|
|
6480
6521
|
ui: {
|
|
6481
6522
|
resourceUri: He
|
|
6482
6523
|
}
|
|
6483
6524
|
}
|
|
6484
6525
|
};
|
|
6485
|
-
|
|
6526
|
+
Ps(r);
|
|
6486
6527
|
const i = { server: r, client: n, features: o };
|
|
6487
|
-
return g({ tool:
|
|
6528
|
+
return g({ tool: zr, ...i }), g({ tool: nn, ...i }), g({ tool: $i, ...i }), g({ tool: $c, ...i }), g({ tool: Ti, ...i }), g({ tool: ya, ...i }), g({ tool: a, ...i }), g({ tool: _n, ...i }), g({ tool: Cr, ...i }), g({ tool: ac, ...i }), g({ tool: Zn, ...i }), g({ tool: li, ...i }), g({ tool: mi, ...i }), g({ tool: Mr, ...i }), g({ tool: kc, ...i }), g({ tool: ia, ...i }), g({ tool: Mn, ...i }), g({ tool: hr, ...i }), g({ tool: qi, ...i }), g({ tool: sn, ...i }), g({ tool: Ja, ...i }), g({ tool: tr, ...i }), g({ tool: Cn, ...i }), g({ tool: Oi, ...i }), g({ tool: Pr, ...i }), g({ tool: sa, ...i }), g({ tool: fc, ...i }), g({ tool: Vc, ...i }), g({ tool: yr, ...i }), g({ tool: ec, ...i }), g({ tool: Wn, ...i }), g({ tool: nr, ...i }), g({ tool: lr, ...i }), g({ tool: Ni, ...i }), g({ tool: kn, ...i }), g({ tool: Ea, ...i }), g({ tool: Ga, ...i }), g({ tool: Ra, ...i }), g({ tool: Qr, ...i }), g({ tool: za, ...i }), g({ tool: Da, ...i }), g({ tool: ln, ...i }), g({ tool: mn, ...i }), g({ tool: bi, ...i }), g({ tool: Fc, ...i }), g({ tool: qn, ...i }), g({ tool: ii, ...i }), g({ tool: ti, ...i }), g({ tool: ji, ...i }), g({ tool: bn, ...i }), r.registerPrompt(
|
|
6488
6529
|
me.name,
|
|
6489
6530
|
{
|
|
6490
6531
|
title: me.title,
|
|
@@ -6495,53 +6536,53 @@ function nd({
|
|
|
6495
6536
|
), r;
|
|
6496
6537
|
}
|
|
6497
6538
|
export {
|
|
6498
|
-
|
|
6499
|
-
|
|
6500
|
-
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
|
|
6506
|
-
|
|
6507
|
-
|
|
6508
|
-
|
|
6509
|
-
|
|
6510
|
-
|
|
6511
|
-
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
|
|
6515
|
-
|
|
6516
|
-
|
|
6517
|
-
|
|
6518
|
-
|
|
6519
|
-
|
|
6520
|
-
|
|
6521
|
-
|
|
6522
|
-
|
|
6523
|
-
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
6539
|
+
Ja as A,
|
|
6540
|
+
sn as B,
|
|
6541
|
+
qi as C,
|
|
6542
|
+
hr as D,
|
|
6543
|
+
Mn as E,
|
|
6544
|
+
ia as F,
|
|
6545
|
+
kc as G,
|
|
6546
|
+
Mr as H,
|
|
6547
|
+
Zn as I,
|
|
6548
|
+
ac as J,
|
|
6549
|
+
Cr as K,
|
|
6550
|
+
Ti as L,
|
|
6551
|
+
_n as M,
|
|
6552
|
+
ua as N,
|
|
6553
|
+
ya as O,
|
|
6554
|
+
$c as P,
|
|
6555
|
+
$i as Q,
|
|
6556
|
+
nn as R,
|
|
6557
|
+
zr as S,
|
|
6558
|
+
dd as T,
|
|
6559
|
+
ao as U,
|
|
6560
|
+
Xs as V,
|
|
6561
|
+
po as W,
|
|
6562
|
+
qn as a,
|
|
6563
|
+
Da as b,
|
|
6564
|
+
za as c,
|
|
6565
|
+
ln as d,
|
|
6566
|
+
Qr as e,
|
|
6567
|
+
bn as f,
|
|
6568
|
+
ld as g,
|
|
6569
|
+
Ra as h,
|
|
6570
|
+
Ga as i,
|
|
6571
|
+
Ea as j,
|
|
6572
|
+
kn as k,
|
|
6573
|
+
ti as l,
|
|
6574
|
+
ii as m,
|
|
6575
|
+
Ni as n,
|
|
6576
|
+
lr as o,
|
|
6577
|
+
nr as p,
|
|
6578
|
+
Wn as q,
|
|
6579
|
+
bi as r,
|
|
6580
|
+
ji as s,
|
|
6581
|
+
ec as t,
|
|
6582
|
+
Fc as u,
|
|
6583
|
+
yr as v,
|
|
6584
|
+
Vc as w,
|
|
6585
|
+
Cn as x,
|
|
6586
|
+
Oi as y,
|
|
6587
|
+
tr as z
|
|
6547
6588
|
};
|