@todoist/mcp 17.3.12 → 17.3.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -3
- package/dist/main-http.js +2 -2
- package/dist/main.js +1 -1
- package/dist/{mcp-server-CKDyBnNG.js → mcp-server-Bx9lGYGM.js} +613 -613
- package/dist/{require-valid-todoist-token-CgCTORYp.js → require-valid-todoist-token-C4aB4VfC.js} +1 -1
- package/dist/tools/find-tasks-by-date.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { ResourceTemplate as
|
|
2
|
-
import { createHash as
|
|
3
|
-
import { readFileSync as
|
|
4
|
-
import { join as lt, dirname as
|
|
5
|
-
import { fileURLToPath as
|
|
1
|
+
import { ResourceTemplate as br, McpServer as gr } from "@modelcontextprotocol/server";
|
|
2
|
+
import { createHash as Yo, randomUUID as je } from "node:crypto";
|
|
3
|
+
import { readFileSync as yr } from "node:fs";
|
|
4
|
+
import { join as lt, dirname as Vo } from "node:path";
|
|
5
|
+
import { fileURLToPath as wr } from "node:url";
|
|
6
6
|
import { RESOURCE_MIME_TYPE as ut } from "@modelcontextprotocol/ext-apps/server";
|
|
7
|
-
import { createToolRegistrar as
|
|
8
|
-
import we, { ZodError as
|
|
9
|
-
import { AsyncLocalStorage as
|
|
10
|
-
import { createRequire as
|
|
11
|
-
import { TodoistApi as
|
|
12
|
-
import { addDays as
|
|
7
|
+
import { createToolRegistrar as Tr } from "@todoist/mcp-core";
|
|
8
|
+
import we, { ZodError as kr, z as s } from "zod";
|
|
9
|
+
import { AsyncLocalStorage as Ir } from "node:async_hooks";
|
|
10
|
+
import { createRequire as vr } from "node:module";
|
|
11
|
+
import { TodoistApi as Sr, formatUserShortName as Jo, isWorkspaceProject as W, isPersonalProject as ee, colors as pt, LOCATION_TRIGGERS as Xo, REMINDER_TYPES as Cr, TodoistSyncError as jr, TodoistRequestError as $r, createCommand as Y, PROJECT_ICONS as Zo, PROJECT_VIEW_STYLES as Qo, REMINDER_DELIVERY_SERVICES as Er, HEALTH_STATUSES as Dt, getTaskUrl as es, getProjectUrl as ts, ACTIVITY_EVENT_TYPES as Ar, ACTIVITY_OBJECT_TYPES as os, escapeFilterToken as xt, parseTodoistUrl as Dr, WORKSPACE_ROLES as xr, WORKSPACE_PLANS as Or } from "@todoist/sdk";
|
|
12
|
+
import { addDays as _r, formatISO as Ur } from "date-fns";
|
|
13
13
|
import { generateNKeysBetween as ss } from "fractional-indexing";
|
|
14
14
|
function he(e) {
|
|
15
15
|
return typeof e == "object" && e !== null;
|
|
@@ -316,12 +316,12 @@ function Kr(e, {
|
|
|
316
316
|
return d !== o.trim() && d ? `Task "${t}" wasn't created because \`dueString\` could not be parsed. Use Todoist recurrence syntax, for example \`${d}\`; don't prefix it with \`recurring\`. Change only \`dueString\` and retry.` : d !== o.trim() ? `Task "${t}" wasn't created because \`dueString\` could not be parsed. Use a complete Todoist recurrence expression; \`recurring\` alone is not valid. Change only \`dueString\` and retry.` : `Task "${t}" wasn't created because \`dueString\` could not be parsed. ${rs} Change only \`dueString\` and retry.`;
|
|
317
317
|
}
|
|
318
318
|
function zr(e) {
|
|
319
|
-
if (e instanceof
|
|
319
|
+
if (e instanceof kr || e instanceof _t || e instanceof ue || e instanceof ne)
|
|
320
320
|
return e.message;
|
|
321
321
|
const t = Ot(e);
|
|
322
322
|
return t ? Br(t) : is(e);
|
|
323
323
|
}
|
|
324
|
-
const Gr = "17.3.
|
|
324
|
+
const Gr = "17.3.13", qr = {
|
|
325
325
|
version: Gr
|
|
326
326
|
}, Ut = 3600 * 1e3, Yr = 365 * 24 * Ut, $ = {
|
|
327
327
|
/** Default limit for task listings */
|
|
@@ -471,7 +471,7 @@ function lo() {
|
|
|
471
471
|
return co ??= Pt(), co;
|
|
472
472
|
}
|
|
473
473
|
function en(e) {
|
|
474
|
-
return
|
|
474
|
+
return Yo("sha256").update(e).digest("hex");
|
|
475
475
|
}
|
|
476
476
|
function tn({ moves: e, writes: t }) {
|
|
477
477
|
return e.isIdle() && t.isIdle();
|
|
@@ -553,10 +553,10 @@ function cn(e) {
|
|
|
553
553
|
function Rt(e) {
|
|
554
554
|
return ps(e, "writes");
|
|
555
555
|
}
|
|
556
|
-
const dn = "todoist-mcp", Nt = qr.version, hs = new
|
|
557
|
-
let
|
|
556
|
+
const dn = "todoist-mcp", Nt = qr.version, hs = new Ir(), po = vr(import.meta.url);
|
|
557
|
+
let He;
|
|
558
558
|
const ln = async () => {
|
|
559
|
-
const e = po.resolve("@todoist/sdk"), t = lt(
|
|
559
|
+
const e = po.resolve("@todoist/sdk"), t = lt(Vo(e), "transport", "http-dispatcher.js");
|
|
560
560
|
return po(t);
|
|
561
561
|
};
|
|
562
562
|
let un = ln;
|
|
@@ -633,9 +633,9 @@ function bn(e, t) {
|
|
|
633
633
|
}
|
|
634
634
|
async function gn() {
|
|
635
635
|
if (yn())
|
|
636
|
-
return
|
|
637
|
-
throw
|
|
638
|
-
})),
|
|
636
|
+
return He || (He = un().then((e) => e.getDefaultTransport()).catch((e) => {
|
|
637
|
+
throw He = void 0, e;
|
|
638
|
+
})), He;
|
|
639
639
|
}
|
|
640
640
|
function yn() {
|
|
641
641
|
return typeof process < "u" && !!process.versions?.node;
|
|
@@ -646,7 +646,7 @@ async function fs(e, t) {
|
|
|
646
646
|
const o = await gn();
|
|
647
647
|
return o ? (t.dispatcher = o.dispatcher, o.fetch ?? e) : e;
|
|
648
648
|
}
|
|
649
|
-
async function
|
|
649
|
+
async function Dh(e, t) {
|
|
650
650
|
const o = { ...t };
|
|
651
651
|
return (await fs(globalThis.fetch, o))(e, o);
|
|
652
652
|
}
|
|
@@ -681,7 +681,7 @@ function kn(e, {
|
|
|
681
681
|
baseUrl: t,
|
|
682
682
|
tracking: o
|
|
683
683
|
} = {}) {
|
|
684
|
-
const r = new
|
|
684
|
+
const r = new Sr(e, {
|
|
685
685
|
customFetch: Tn(globalThis.fetch, o),
|
|
686
686
|
...t ? { baseUrl: t } : {}
|
|
687
687
|
});
|
|
@@ -839,7 +839,7 @@ const y = {
|
|
|
839
839
|
// OpenAI MCP tools
|
|
840
840
|
SEARCH: "search",
|
|
841
841
|
FETCH: "fetch"
|
|
842
|
-
},
|
|
842
|
+
}, xh = {
|
|
843
843
|
/**
|
|
844
844
|
* Strips email addresses from tool outputs that expose user data.
|
|
845
845
|
* Affects: find-project-collaborators, find-completed-tasks
|
|
@@ -889,7 +889,7 @@ function Ln({
|
|
|
889
889
|
client: o,
|
|
890
890
|
features: r = []
|
|
891
891
|
}) {
|
|
892
|
-
const n = r.some((i) => i.name === "strip_emails"), a =
|
|
892
|
+
const n = r.some((i) => i.name === "strip_emails"), a = Tr({
|
|
893
893
|
titlePrefix: "Todoist",
|
|
894
894
|
createContext: () => o,
|
|
895
895
|
formatError: zr,
|
|
@@ -912,7 +912,7 @@ function Ln({
|
|
|
912
912
|
for (const i of e)
|
|
913
913
|
a(t, i);
|
|
914
914
|
}
|
|
915
|
-
const mo =
|
|
915
|
+
const mo = Vo(wr(import.meta.url)), Mn = [
|
|
916
916
|
lt(mo, "task-list", "index.html"),
|
|
917
917
|
lt(mo, "mcp-apps", "index.html")
|
|
918
918
|
], Fn = `<!doctype html>
|
|
@@ -925,13 +925,13 @@ function Hn() {
|
|
|
925
925
|
const e = [];
|
|
926
926
|
for (const t of Mn)
|
|
927
927
|
try {
|
|
928
|
-
return
|
|
928
|
+
return yr(t, "utf-8");
|
|
929
929
|
} catch (o) {
|
|
930
930
|
e.push(o);
|
|
931
931
|
}
|
|
932
932
|
return console.error("Failed to load task list app HTML from any known path:", e), Fn;
|
|
933
933
|
}
|
|
934
|
-
const ys = Hn(), Wn =
|
|
934
|
+
const ys = Hn(), Wn = Yo("sha256").update(ys).digest("hex").slice(0, 12), yt = `ui://todoist/task-list@${Wn}`, Bn = "ui://todoist/task-list@{hash}", wt = "Interactive task list widget", Kn = "https://ai.todoist.net", Tt = {
|
|
935
935
|
ui: {
|
|
936
936
|
prefersBorder: !0,
|
|
937
937
|
csp: {
|
|
@@ -973,7 +973,7 @@ function qn(e) {
|
|
|
973
973
|
async () => fo(yt)
|
|
974
974
|
), e.registerResource(
|
|
975
975
|
"todoist-task-list-hash-fallback",
|
|
976
|
-
new
|
|
976
|
+
new br(Bn, { list: void 0 }),
|
|
977
977
|
{
|
|
978
978
|
description: `${wt} compatibility fallback`,
|
|
979
979
|
mimeType: ut,
|
|
@@ -1115,7 +1115,7 @@ function Zn(e) {
|
|
|
1115
1115
|
]
|
|
1116
1116
|
};
|
|
1117
1117
|
}
|
|
1118
|
-
const
|
|
1118
|
+
const xe = {
|
|
1119
1119
|
name: "productivity-analysis",
|
|
1120
1120
|
title: "Productivity Analysis",
|
|
1121
1121
|
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.",
|
|
@@ -1258,14 +1258,14 @@ const st = new vs(
|
|
|
1258
1258
|
), ke = new vs(
|
|
1259
1259
|
ia,
|
|
1260
1260
|
Is
|
|
1261
|
-
),
|
|
1261
|
+
), _e = /* @__PURE__ */ new Map();
|
|
1262
1262
|
function go(e, t) {
|
|
1263
|
-
const o =
|
|
1263
|
+
const o = _e.get(e);
|
|
1264
1264
|
if (o) return o;
|
|
1265
1265
|
const r = t().finally(() => {
|
|
1266
|
-
|
|
1266
|
+
_e.get(e) === r && _e.delete(e);
|
|
1267
1267
|
});
|
|
1268
|
-
return
|
|
1268
|
+
return _e.set(e, r), r;
|
|
1269
1269
|
}
|
|
1270
1270
|
function Ss(e) {
|
|
1271
1271
|
return /^[0-9]+$/.test(e) || /^[a-f0-9-]{8,}$/i.test(e) && e.includes("-") || /^[a-z0-9_]{6,}$/i.test(e) && !/^[a-z]+[\s-]/.test(e) && /[0-9_]/.test(e);
|
|
@@ -1281,14 +1281,14 @@ function la(e, t) {
|
|
|
1281
1281
|
const o = t.toLowerCase(), r = e.filter((a) => a.name.toLowerCase().includes(o)), n = r.length > 0 ? r : e.filter((a) => a.email.toLowerCase().includes(o));
|
|
1282
1282
|
return [...new Map(n.map((a) => [a.id, a])).values()];
|
|
1283
1283
|
}
|
|
1284
|
-
function
|
|
1284
|
+
function We(e) {
|
|
1285
1285
|
return {
|
|
1286
1286
|
userId: e.id,
|
|
1287
1287
|
displayName: e.name,
|
|
1288
1288
|
email: e.email
|
|
1289
1289
|
};
|
|
1290
1290
|
}
|
|
1291
|
-
const
|
|
1291
|
+
const Be = /* @__PURE__ */ new WeakMap(), It = "me";
|
|
1292
1292
|
class ua {
|
|
1293
1293
|
/**
|
|
1294
1294
|
* Resolve a user name or ID to a user ID by looking up collaborators across all shared projects.
|
|
@@ -1338,15 +1338,15 @@ class ua {
|
|
|
1338
1338
|
return u(a);
|
|
1339
1339
|
const p = yo(l, r);
|
|
1340
1340
|
if (p || n)
|
|
1341
|
-
return u(p ?
|
|
1341
|
+
return u(p ? We(p) : a);
|
|
1342
1342
|
const f = la(l, r);
|
|
1343
1343
|
if (f.length > 1)
|
|
1344
1344
|
return u({
|
|
1345
|
-
named: f.slice(0, ca).map(
|
|
1345
|
+
named: f.slice(0, ca).map(We),
|
|
1346
1346
|
total: f.length
|
|
1347
1347
|
});
|
|
1348
1348
|
const [h] = f;
|
|
1349
|
-
return u(h ?
|
|
1349
|
+
return u(h ? We(h) : null);
|
|
1350
1350
|
} catch {
|
|
1351
1351
|
return u(a);
|
|
1352
1352
|
}
|
|
@@ -1365,7 +1365,7 @@ class ua {
|
|
|
1365
1365
|
if (!n || n.toLowerCase() === It)
|
|
1366
1366
|
return null;
|
|
1367
1367
|
const a = await this.getProjectCollaborators(t, o), i = yo(a, n);
|
|
1368
|
-
return i ?
|
|
1368
|
+
return i ? We(i) : null;
|
|
1369
1369
|
}
|
|
1370
1370
|
/**
|
|
1371
1371
|
* Validate that a user is a collaborator on a specific project
|
|
@@ -1447,7 +1447,7 @@ class ua {
|
|
|
1447
1447
|
)
|
|
1448
1448
|
);
|
|
1449
1449
|
for (const d of c.flat())
|
|
1450
|
-
n.has(d.id) || n.set(d.id,
|
|
1450
|
+
n.has(d.id) || n.set(d.id, Jo(d.name));
|
|
1451
1451
|
return n;
|
|
1452
1452
|
}
|
|
1453
1453
|
/**
|
|
@@ -1457,15 +1457,15 @@ class ua {
|
|
|
1457
1457
|
* failed lookup is not kept, so the next call tries again.
|
|
1458
1458
|
*/
|
|
1459
1459
|
async getCacheScope(t) {
|
|
1460
|
-
const o =
|
|
1460
|
+
const o = Be.get(t);
|
|
1461
1461
|
if (o) return o;
|
|
1462
1462
|
const r = t.getUser().then(
|
|
1463
1463
|
(a) => a?.id ?? null,
|
|
1464
1464
|
() => null
|
|
1465
1465
|
);
|
|
1466
|
-
|
|
1466
|
+
Be.set(t, r);
|
|
1467
1467
|
const n = await r;
|
|
1468
|
-
return n === null &&
|
|
1468
|
+
return n === null && Be.get(t) === r && Be.delete(t), n;
|
|
1469
1469
|
}
|
|
1470
1470
|
getCacheKey(t, o) {
|
|
1471
1471
|
return t ? `${t}:${o}` : null;
|
|
@@ -1474,7 +1474,7 @@ class ua {
|
|
|
1474
1474
|
* Clear all caches - useful for testing
|
|
1475
1475
|
*/
|
|
1476
1476
|
clearCache() {
|
|
1477
|
-
st.clear(), ke.clear(),
|
|
1477
|
+
st.clear(), ke.clear(), _e.clear();
|
|
1478
1478
|
}
|
|
1479
1479
|
}
|
|
1480
1480
|
const M = new ua();
|
|
@@ -1724,7 +1724,7 @@ function fe(e) {
|
|
|
1724
1724
|
isArchived: e.isArchived
|
|
1725
1725
|
};
|
|
1726
1726
|
}
|
|
1727
|
-
function
|
|
1727
|
+
function Ne(e) {
|
|
1728
1728
|
return {
|
|
1729
1729
|
id: e.id,
|
|
1730
1730
|
taskId: e.taskId ?? void 0,
|
|
@@ -1881,9 +1881,9 @@ function Ca(e) {
|
|
|
1881
1881
|
const t = e.toLowerCase();
|
|
1882
1882
|
return (pt.find((r) => r.key === t) ?? pt.find((r) => r.displayName.toLowerCase() === t))?.key;
|
|
1883
1883
|
}
|
|
1884
|
-
const ja = `Color for the entity. Accepts a color key (e.g. "berry_red") or display name (e.g. "Berry Red"). Valid colors: ${Je.join(", ")}. Unrecognized colors are omitted and charcoal will be used as the default.`,
|
|
1884
|
+
const ja = `Color for the entity. Accepts a color key (e.g. "berry_red") or display name (e.g. "Berry Red"). Valid colors: ${Je.join(", ")}. Unrecognized colors are omitted and charcoal will be used as the default.`, Ee = s.preprocess(Ca, s.enum(Je).optional()).describe(ja);
|
|
1885
1885
|
s.enum(Je);
|
|
1886
|
-
const
|
|
1886
|
+
const Ae = s.enum(Je).optional().catch(void 0), oe = s.object({
|
|
1887
1887
|
id: s.string(),
|
|
1888
1888
|
content: s.string().describe("Task title."),
|
|
1889
1889
|
description: s.string(),
|
|
@@ -1907,7 +1907,7 @@ const Ee = s.enum(Je).optional().catch(void 0), oe = s.object({
|
|
|
1907
1907
|
id: s.string(),
|
|
1908
1908
|
name: s.string(),
|
|
1909
1909
|
description: s.string().describe("Empty string when none."),
|
|
1910
|
-
color:
|
|
1910
|
+
color: Ae,
|
|
1911
1911
|
icon: s.string().optional(),
|
|
1912
1912
|
isFavorite: s.boolean(),
|
|
1913
1913
|
isShared: s.boolean(),
|
|
@@ -1948,7 +1948,7 @@ const $a = s.object({
|
|
|
1948
1948
|
image: s.string().optional().describe("For image resource types."),
|
|
1949
1949
|
imageWidth: s.number().optional().describe("Pixels."),
|
|
1950
1950
|
imageHeight: s.number().optional().describe("Pixels.")
|
|
1951
|
-
}),
|
|
1951
|
+
}), Le = s.object({
|
|
1952
1952
|
id: s.string(),
|
|
1953
1953
|
taskId: s.string().optional(),
|
|
1954
1954
|
projectId: s.string().optional(),
|
|
@@ -1971,10 +1971,10 @@ const $a = s.object({
|
|
|
1971
1971
|
id: s.string(),
|
|
1972
1972
|
name: s.string(),
|
|
1973
1973
|
email: s.string()
|
|
1974
|
-
}),
|
|
1974
|
+
}), De = s.object({
|
|
1975
1975
|
id: s.string(),
|
|
1976
1976
|
name: s.string(),
|
|
1977
|
-
color:
|
|
1977
|
+
color: Ae,
|
|
1978
1978
|
order: s.number().optional().catch(void 0).describe("Display order."),
|
|
1979
1979
|
isFavorite: s.boolean()
|
|
1980
1980
|
}), Da = s.object({
|
|
@@ -1986,14 +1986,14 @@ const $a = s.object({
|
|
|
1986
1986
|
}), qt = s.object({
|
|
1987
1987
|
id: s.string(),
|
|
1988
1988
|
taskId: s.string(),
|
|
1989
|
-
type: s.enum(
|
|
1989
|
+
type: s.enum(Cr),
|
|
1990
1990
|
notifyUid: s.string().optional().describe("User ID the reminder notifies."),
|
|
1991
1991
|
minuteOffset: s.number().optional().describe("Minutes before due. Relative reminders only."),
|
|
1992
1992
|
due: Da.optional().describe("Absolute, and sometimes relative, reminders."),
|
|
1993
1993
|
name: s.string().optional().describe("Location name. Location reminders only."),
|
|
1994
1994
|
locLat: s.string().optional().describe("Location reminders only."),
|
|
1995
1995
|
locLong: s.string().optional().describe("Location reminders only."),
|
|
1996
|
-
locTrigger: s.enum(
|
|
1996
|
+
locTrigger: s.enum(Xo).optional().describe("Location reminders only."),
|
|
1997
1997
|
radius: s.number().optional().describe("Geofence radius in metres. Location reminders only."),
|
|
1998
1998
|
isUrgent: s.boolean().optional().describe("Relative and absolute reminders only.")
|
|
1999
1999
|
}), _ = s.object({
|
|
@@ -2001,7 +2001,7 @@ const $a = s.object({
|
|
|
2001
2001
|
error: s.string(),
|
|
2002
2002
|
code: s.string().optional()
|
|
2003
2003
|
});
|
|
2004
|
-
function
|
|
2004
|
+
function Ke(e = /* @__PURE__ */ new Date()) {
|
|
2005
2005
|
const t = e.getFullYear(), o = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0");
|
|
2006
2006
|
return `${t}-${o}-${r}`;
|
|
2007
2007
|
}
|
|
@@ -2101,7 +2101,7 @@ const Ua = s.object({
|
|
|
2101
2101
|
}), Pa = {
|
|
2102
2102
|
comments: s.array(Ua).min(1).max(D.ITEMS_PER_OPERATION).describe("The array of comments to add.")
|
|
2103
2103
|
}, Ra = {
|
|
2104
|
-
comments: s.array(
|
|
2104
|
+
comments: s.array(Le).describe("The created comments."),
|
|
2105
2105
|
totalCount: s.number().describe("The total number of comments created."),
|
|
2106
2106
|
addedCommentIds: s.array(s.string()).describe("The IDs of the added comments."),
|
|
2107
2107
|
failures: s.array(_).describe(
|
|
@@ -2162,7 +2162,7 @@ const Ua = s.object({
|
|
|
2162
2162
|
o,
|
|
2163
2163
|
l,
|
|
2164
2164
|
(g) => g.content
|
|
2165
|
-
), h = p.map(({ value: g }) =>
|
|
2165
|
+
), h = p.map(({ value: g }) => Ne(g));
|
|
2166
2166
|
O(y.ADD_COMMENTS, o.length, f, { redactItems: !0 });
|
|
2167
2167
|
const m = await Ma(t, h, {
|
|
2168
2168
|
getTask: i,
|
|
@@ -2239,7 +2239,7 @@ async function V(e, t, { limit: o = (r) => r() } = {}) {
|
|
|
2239
2239
|
const i = await j(() => o(() => e.sync({ commands: t })));
|
|
2240
2240
|
r = i.syncStatus ?? {}, n = i.tempIdMapping ?? {};
|
|
2241
2241
|
} catch (i) {
|
|
2242
|
-
if (!(i instanceof
|
|
2242
|
+
if (!(i instanceof jr))
|
|
2243
2243
|
return {
|
|
2244
2244
|
outcomes: t.map(() => ({ status: "rejected", reason: i })),
|
|
2245
2245
|
tempIdMapping: {},
|
|
@@ -2254,7 +2254,7 @@ async function V(e, t, { limit: o = (r) => r() } = {}) {
|
|
|
2254
2254
|
reason: new Error("Todoist did not report whether this change was applied")
|
|
2255
2255
|
} : {
|
|
2256
2256
|
status: "rejected",
|
|
2257
|
-
reason: new
|
|
2257
|
+
reason: new $r(c.error, c.httpCode, c)
|
|
2258
2258
|
};
|
|
2259
2259
|
}), tempIdMapping: n, requestFailed: !1 };
|
|
2260
2260
|
}
|
|
@@ -2272,7 +2272,7 @@ const Wa = {
|
|
|
2272
2272
|
description: s.string().optional().describe(
|
|
2273
2273
|
"A markdown description explaining what the filter is for. Omitted when the filter has none."
|
|
2274
2274
|
),
|
|
2275
|
-
color:
|
|
2275
|
+
color: Ae,
|
|
2276
2276
|
isFavorite: s.boolean().describe("Whether the filter is marked as favorite."),
|
|
2277
2277
|
itemOrder: s.number().describe("The display order of the filter.")
|
|
2278
2278
|
}), Ba = {
|
|
@@ -2296,7 +2296,7 @@ const Wa = {
|
|
|
2296
2296
|
name: i.name,
|
|
2297
2297
|
query: i.query,
|
|
2298
2298
|
description: Us(i),
|
|
2299
|
-
color:
|
|
2299
|
+
color: Ae.parse(i.color),
|
|
2300
2300
|
isFavorite: i.isFavorite,
|
|
2301
2301
|
itemOrder: i.itemOrder
|
|
2302
2302
|
}));
|
|
@@ -2336,7 +2336,7 @@ const Ga = s.object({
|
|
|
2336
2336
|
'The filter query string. Examples: "today & p1", "#Work & overdue", "@email & today", "(p1 | p2) & !assigned". Operators: | (OR), & (AND), ! (NOT), () grouping, , (multiple queries).'
|
|
2337
2337
|
),
|
|
2338
2338
|
description: H("A markdown description explaining what the filter is for."),
|
|
2339
|
-
color:
|
|
2339
|
+
color: Ee,
|
|
2340
2340
|
isFavorite: s.boolean().optional().describe("Whether to mark the filter as a favorite. Defaults to false.")
|
|
2341
2341
|
}), qa = {
|
|
2342
2342
|
filters: s.array(Ga).min(1).max(D.ITEMS_PER_OPERATION).describe("The array of filters to add.")
|
|
@@ -2382,7 +2382,7 @@ const Ga = s.object({
|
|
|
2382
2382
|
// with `removeNullFields`, so a null would be stripped and then fail
|
|
2383
2383
|
// validation against the declared output schema.
|
|
2384
2384
|
...m.description ? { description: m.description } : {},
|
|
2385
|
-
color: m.color !== void 0 ?
|
|
2385
|
+
color: m.color !== void 0 ? Ae.parse(m.color) : void 0,
|
|
2386
2386
|
isFavorite: m.isFavorite ?? !1,
|
|
2387
2387
|
itemOrder: 0
|
|
2388
2388
|
})
|
|
@@ -2527,13 +2527,13 @@ ${r.join(`
|
|
|
2527
2527
|
}
|
|
2528
2528
|
const ii = s.object({
|
|
2529
2529
|
name: s.string().min(1).max(128).describe("The name of the label."),
|
|
2530
|
-
color:
|
|
2530
|
+
color: Ee,
|
|
2531
2531
|
order: s.number().int().optional().describe("The position of the label in the label list."),
|
|
2532
2532
|
isFavorite: s.boolean().optional().describe("Whether the label is a favorite. Defaults to false.")
|
|
2533
2533
|
}), ci = {
|
|
2534
2534
|
labels: s.array(ii).min(1).max(D.ITEMS_PER_OPERATION).describe("The array of labels to add.")
|
|
2535
2535
|
}, di = {
|
|
2536
|
-
labels: s.array(
|
|
2536
|
+
labels: s.array(De).describe("The created labels."),
|
|
2537
2537
|
totalCount: s.number().describe("The total number of labels created."),
|
|
2538
2538
|
failures: s.array(_).describe("Labels that could not be created, with the reason for each."),
|
|
2539
2539
|
totalRequested: s.number(),
|
|
@@ -2552,7 +2552,7 @@ const ii = s.object({
|
|
|
2552
2552
|
return O(y.ADD_LABELS, e.length, n, { redactItems: !0 }), {
|
|
2553
2553
|
textContent: ui({ labels: a, failures: n }),
|
|
2554
2554
|
structuredContent: {
|
|
2555
|
-
labels: a.map((c) =>
|
|
2555
|
+
labels: a.map((c) => De.parse(c)),
|
|
2556
2556
|
totalCount: a.length,
|
|
2557
2557
|
failures: n,
|
|
2558
2558
|
totalRequested: e.length,
|
|
@@ -2594,10 +2594,10 @@ const { FIND_FOLDERS: pi } = y, hi = s.object({
|
|
|
2594
2594
|
name: s.string().min(1).describe("The name of the project."),
|
|
2595
2595
|
parentId: s.string().optional().describe("The ID of the parent project. If provided, creates this as a sub-project."),
|
|
2596
2596
|
isFavorite: s.boolean().optional().describe("Whether the project is a favorite. Defaults to false."),
|
|
2597
|
-
viewStyle: s.enum(
|
|
2597
|
+
viewStyle: s.enum(Qo).optional().describe('The project view style. Defaults to "list".'),
|
|
2598
2598
|
description: s.string().optional().describe("The description of the project. Supports Markdown."),
|
|
2599
|
-
color:
|
|
2600
|
-
icon: s.enum(
|
|
2599
|
+
color: Ee,
|
|
2600
|
+
icon: s.enum(Zo).optional().describe("The project icon. Omit for the default # icon."),
|
|
2601
2601
|
workspace: s.string().trim().min(1).optional().describe(
|
|
2602
2602
|
"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."
|
|
2603
2603
|
),
|
|
@@ -2798,12 +2798,12 @@ function Rs(e, t) {
|
|
|
2798
2798
|
];
|
|
2799
2799
|
});
|
|
2800
2800
|
}
|
|
2801
|
-
const ze = 25, Ze = s.enum(
|
|
2801
|
+
const ze = 25, Ze = s.enum(Er), Ns = s.object({
|
|
2802
2802
|
date: s.string().optional().describe("Due date in YYYY-MM-DD format."),
|
|
2803
2803
|
string: s.string().optional().describe('Natural language due string, e.g. "tomorrow at 3pm".'),
|
|
2804
2804
|
timezone: s.string().optional().describe('Timezone for the reminder, e.g. "America/New_York".'),
|
|
2805
2805
|
lang: s.string().optional().describe('Language for parsing the due string, e.g. "en".')
|
|
2806
|
-
}), Ls = s.enum(
|
|
2806
|
+
}), Ls = s.enum(Xo), Qe = s.boolean().optional().describe("Whether this is an urgent reminder. Applies to relative and absolute reminders."), Ms = `Who to remind: user ID, email, name, or "me". Must collaborate on the task's project.`, Qt = H(
|
|
2807
2807
|
`${Ms} Defaults to the creator.`
|
|
2808
2808
|
), eo = H(
|
|
2809
2809
|
`${Ms} Omit to keep the current one.`
|
|
@@ -3895,7 +3895,7 @@ const Ws = ["task", "project", "comment", "section"], mc = {
|
|
|
3895
3895
|
}, fc = {
|
|
3896
3896
|
type: s.enum(Ws).describe("The type of object fetched."),
|
|
3897
3897
|
id: s.string().describe("The ID of the fetched object."),
|
|
3898
|
-
object: s.union([oe, be,
|
|
3898
|
+
object: s.union([oe, be, Le, ae]).describe("The fetched object data."),
|
|
3899
3899
|
...uc
|
|
3900
3900
|
}, bc = {
|
|
3901
3901
|
name: y.FETCH_OBJECT,
|
|
@@ -3935,7 +3935,7 @@ const Ws = ["task", "project", "comment", "section"], mc = {
|
|
|
3935
3935
|
};
|
|
3936
3936
|
}
|
|
3937
3937
|
case "comment": {
|
|
3938
|
-
const a = await t.getComment(r), i =
|
|
3938
|
+
const a = await t.getComment(r), i = Ne(a), c = i.content.length > 50 ? `${i.content.substring(0, 50)}...` : i.content;
|
|
3939
3939
|
return {
|
|
3940
3940
|
textContent: `Found comment • id=${i.id} • content="${c}" • posted=${i.postedAt}`,
|
|
3941
3941
|
structuredContent: {
|
|
@@ -4002,7 +4002,7 @@ Labels: ${c.labels.join(", ")}`), a = {
|
|
|
4002
4002
|
id: `task:${c.id}`,
|
|
4003
4003
|
title: c.content,
|
|
4004
4004
|
text: d.join(""),
|
|
4005
|
-
url:
|
|
4005
|
+
url: es(c.id),
|
|
4006
4006
|
metadata: {
|
|
4007
4007
|
priority: c.priority,
|
|
4008
4008
|
projectId: c.projectId,
|
|
@@ -4027,7 +4027,7 @@ Favorite: Yes`), a = {
|
|
|
4027
4027
|
id: `project:${c.id}`,
|
|
4028
4028
|
title: c.name,
|
|
4029
4029
|
text: d.join(""),
|
|
4030
|
-
url:
|
|
4030
|
+
url: ts(c.id),
|
|
4031
4031
|
metadata: {
|
|
4032
4032
|
color: c.color,
|
|
4033
4033
|
isFavorite: c.isFavorite,
|
|
@@ -4048,9 +4048,9 @@ function Eo(e) {
|
|
|
4048
4048
|
return H(e).pipe(Tc.optional());
|
|
4049
4049
|
}
|
|
4050
4050
|
const kc = {
|
|
4051
|
-
objectType: s.enum(
|
|
4051
|
+
objectType: s.enum(os).optional().describe("Type of object to filter by."),
|
|
4052
4052
|
objectId: s.string().optional().describe("Filter by specific object ID (task, project, or comment). Requires objectType."),
|
|
4053
|
-
eventType: s.enum(
|
|
4053
|
+
eventType: s.enum(Ar).optional().describe("Type of event to filter by."),
|
|
4054
4054
|
projectId: s.string().optional().describe("Filter events by parent project ID."),
|
|
4055
4055
|
taskId: s.string().optional().describe("Filter events by parent task ID (for subtask events)."),
|
|
4056
4056
|
initiatorId: s.string().optional().describe(
|
|
@@ -4091,7 +4091,7 @@ const kc = {
|
|
|
4091
4091
|
} = e;
|
|
4092
4092
|
if (r && r !== "remove" && !o)
|
|
4093
4093
|
throw new Error(
|
|
4094
|
-
`objectId requires objectType, one of: ${
|
|
4094
|
+
`objectId requires objectType, one of: ${os.join(", ")}.`
|
|
4095
4095
|
);
|
|
4096
4096
|
const f = {
|
|
4097
4097
|
limit: l,
|
|
@@ -4225,7 +4225,7 @@ const Oc = {
|
|
|
4225
4225
|
cursor: s.string().optional().describe("Pagination cursor for retrieving more results."),
|
|
4226
4226
|
limit: s.number().int().min(1).max($.COMMENTS_MAX).optional().describe("Maximum number of comments to return")
|
|
4227
4227
|
}, _c = {
|
|
4228
|
-
comments: s.array(
|
|
4228
|
+
comments: s.array(Le).describe("The found comments."),
|
|
4229
4229
|
searchType: s.string().describe(
|
|
4230
4230
|
'The type of search performed: "single" (comment ID), "task" (task ID), or "project" (project ID).'
|
|
4231
4231
|
),
|
|
@@ -4270,7 +4270,7 @@ const Oc = {
|
|
|
4270
4270
|
c = l.results, a = l.nextCursor !== null, i = l.nextCursor;
|
|
4271
4271
|
} else
|
|
4272
4272
|
throw new Error("Invalid state: no search parameter provided");
|
|
4273
|
-
const d = c.map(
|
|
4273
|
+
const d = c.map(Ne);
|
|
4274
4274
|
return {
|
|
4275
4275
|
textContent: Pc({
|
|
4276
4276
|
comments: d,
|
|
@@ -4331,7 +4331,7 @@ function Ks(e, t) {
|
|
|
4331
4331
|
const o = new Date(e.getTime() + t * 60 * 1e3);
|
|
4332
4332
|
return Bs(o);
|
|
4333
4333
|
}
|
|
4334
|
-
function
|
|
4334
|
+
function $e(e, t) {
|
|
4335
4335
|
const [o, r, n] = e.split("-"), a = Number(o), i = Number(r), c = Number(n);
|
|
4336
4336
|
if (!Number.isFinite(a) || !Number.isFinite(i) || !Number.isFinite(c))
|
|
4337
4337
|
throw new Error(`Invalid date format: ${e}. Expected YYYY-MM-DD.`);
|
|
@@ -4401,9 +4401,9 @@ function Wc({
|
|
|
4401
4401
|
userGmtOffset: o,
|
|
4402
4402
|
now: r = /* @__PURE__ */ new Date()
|
|
4403
4403
|
}) {
|
|
4404
|
-
const n = et(o), a = Ks(r, n), i = Hc - 1, c = t ?? (e ?
|
|
4404
|
+
const n = et(o), a = Ks(r, n), i = Hc - 1, c = t ?? (e ? $e(e, i) : a);
|
|
4405
4405
|
return {
|
|
4406
|
-
since: e ??
|
|
4406
|
+
since: e ?? $e(c, -i),
|
|
4407
4407
|
until: c
|
|
4408
4408
|
};
|
|
4409
4409
|
}
|
|
@@ -4470,7 +4470,7 @@ const Bc = {
|
|
|
4470
4470
|
until: i,
|
|
4471
4471
|
userGmtOffset: w
|
|
4472
4472
|
}), S = g.tzInfo?.timezone, E = (no) => new Date(zs({ date: no, timeZone: S, fallbackOffset: w })), N = E(k.since).toISOString(), T = new Date(
|
|
4473
|
-
E(
|
|
4473
|
+
E($e(k.until, 1)).getTime() - 1e3
|
|
4474
4474
|
).toISOString(), v = {
|
|
4475
4475
|
...e,
|
|
4476
4476
|
since: k.since,
|
|
@@ -4548,7 +4548,7 @@ function qc(e, t, o) {
|
|
|
4548
4548
|
const r = "Completions of recurring tasks that are still active are not in this list.";
|
|
4549
4549
|
if (e.getBy === "due")
|
|
4550
4550
|
return `${r} ${Ao} with objectType "task" and eventType "completed" reports them, but only by completion time: it cannot match a due-date range.`;
|
|
4551
|
-
const n = (c) => zs({ date: c, timeZone: o, fallbackOffset: t }), a = n(e.since), i = n(
|
|
4551
|
+
const n = (c) => zs({ date: c, timeZone: o, fallbackOffset: t }), a = n(e.since), i = n($e(e.until, 1));
|
|
4552
4552
|
return `${r} To include them, call ${Ao} with objectType "task", eventType "completed", dateFrom "${a}" and dateTo "${i}".`;
|
|
4553
4553
|
}
|
|
4554
4554
|
const { ADD_FOLDERS: Yc, FIND_PROJECTS: Vc, LIST_WORKSPACES: Jc } = y, Xc = {
|
|
@@ -4608,7 +4608,7 @@ const od = {
|
|
|
4608
4608
|
"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."
|
|
4609
4609
|
)
|
|
4610
4610
|
}, sd = {
|
|
4611
|
-
labels: s.array(
|
|
4611
|
+
labels: s.array(De).describe("The found personal labels."),
|
|
4612
4612
|
nextCursor: s.string().optional(),
|
|
4613
4613
|
totalCount: s.number().describe("The total number of labels in this page."),
|
|
4614
4614
|
hasMore: s.boolean(),
|
|
@@ -4633,7 +4633,7 @@ const od = {
|
|
|
4633
4633
|
return {
|
|
4634
4634
|
textContent: nd({ labels: n, args: e, nextCursor: a, sharedLabels: r }),
|
|
4635
4635
|
structuredContent: {
|
|
4636
|
-
labels: n.map((c) =>
|
|
4636
|
+
labels: n.map((c) => De.parse(c)),
|
|
4637
4637
|
nextCursor: a ?? void 0,
|
|
4638
4638
|
totalCount: n.length,
|
|
4639
4639
|
hasMore: !!a,
|
|
@@ -4832,7 +4832,7 @@ function Js({
|
|
|
4832
4832
|
o && c.push(`matching "${o}"`), c.push(`in ${n}`);
|
|
4833
4833
|
let d = [];
|
|
4834
4834
|
e.length > 0 && (d = e.slice(0, 10).map((p) => {
|
|
4835
|
-
const f =
|
|
4835
|
+
const f = Jo(p.name) || "Unknown Name", h = p.email || "No email";
|
|
4836
4836
|
return `• ${f} (${h}) - ID: ${p.id}`;
|
|
4837
4837
|
}), e.length > 10 && d.push(`... and ${e.length - 10} more`));
|
|
4838
4838
|
const u = [];
|
|
@@ -5130,11 +5130,11 @@ function $d({
|
|
|
5130
5130
|
zeroReasonHints: r
|
|
5131
5131
|
});
|
|
5132
5132
|
}
|
|
5133
|
-
function
|
|
5133
|
+
function Ed(e) {
|
|
5134
5134
|
return /* @__PURE__ */ new Date(`${e}T00:00:00`);
|
|
5135
5135
|
}
|
|
5136
5136
|
const at = "+00:00";
|
|
5137
|
-
async function
|
|
5137
|
+
async function Ad(e, t) {
|
|
5138
5138
|
if (t)
|
|
5139
5139
|
return t.tzInfo?.gmtString || at;
|
|
5140
5140
|
try {
|
|
@@ -5146,7 +5146,7 @@ async function Ed(e, t) {
|
|
|
5146
5146
|
), at;
|
|
5147
5147
|
}
|
|
5148
5148
|
}
|
|
5149
|
-
const
|
|
5149
|
+
const Dd = {
|
|
5150
5150
|
startDate: s.string().regex(/^(\d{4}-\d{2}-\d{2}|today)$/).optional().describe(
|
|
5151
5151
|
"The start date to get the tasks for. Format: YYYY-MM-DD, or 'today', which by default also includes overdue tasks. Defaults to 'today' when omitted, except with overdueOption='overdue-only'."
|
|
5152
5152
|
),
|
|
@@ -5167,17 +5167,17 @@ const Ad = {
|
|
|
5167
5167
|
"Filter when responsibleUser is omitted. 'assigned'=assigned to others; 'unassignedOrMe'=unassigned+mine; 'all'=everyone. Default: 'unassignedOrMe'."
|
|
5168
5168
|
),
|
|
5169
5169
|
...oo
|
|
5170
|
-
},
|
|
5170
|
+
}, xd = {
|
|
5171
5171
|
tasks: s.array(oe).describe("The found tasks."),
|
|
5172
5172
|
nextCursor: s.string().optional(),
|
|
5173
5173
|
totalCount: s.number().describe("The total number of tasks in this page."),
|
|
5174
5174
|
hasMore: s.boolean(),
|
|
5175
5175
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
5176
|
-
},
|
|
5176
|
+
}, Od = {
|
|
5177
5177
|
name: y.FIND_TASKS_BY_DATE,
|
|
5178
5178
|
description: "Get tasks by date range. startDate='today' includes overdue items. Default responsibleUserFiltering='unassignedOrMe' excludes others' tasks.",
|
|
5179
|
-
parameters:
|
|
5180
|
-
outputSchema:
|
|
5179
|
+
parameters: Dd,
|
|
5180
|
+
outputSchema: xd,
|
|
5181
5181
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
5182
5182
|
async execute(e, t) {
|
|
5183
5183
|
const o = e.startDate !== void 0 || e.overdueOption === "overdue-only" ? e : { ...e, startDate: "today" }, r = Ve(o.cursor), n = await Ht(t, o.responsibleUser), a = n?.userId, i = n?.email, c = o.responsibleUser?.trim().toLowerCase() === It, d = a && !c ? await t.getUser() : void 0, u = c ? a : d?.id;
|
|
@@ -5186,12 +5186,12 @@ const Ad = {
|
|
|
5186
5186
|
l = "overdue";
|
|
5187
5187
|
else if (o.startDate === "today")
|
|
5188
5188
|
if (o.daysCount > 1) {
|
|
5189
|
-
const g = await
|
|
5189
|
+
const g = await Ad(t, d), w = Ks(/* @__PURE__ */ new Date(), et(g)), I = $e(w, o.daysCount), k = `(due after: ${w} | due: ${w}) & due before: ${I}`;
|
|
5190
5190
|
l = o.overdueOption === "exclude-overdue" ? k : `(${k} | overdue)`;
|
|
5191
5191
|
} else
|
|
5192
5192
|
l = o.overdueOption === "exclude-overdue" ? "today" : "(today | overdue)";
|
|
5193
5193
|
else if (o.startDate) {
|
|
5194
|
-
const g = o.startDate, w =
|
|
5194
|
+
const g = o.startDate, w = _r(Ed(g), o.daysCount), I = Ur(w, { representation: "date" });
|
|
5195
5195
|
l = `(due after: ${g} | due: ${g}) & due before: ${I}`;
|
|
5196
5196
|
}
|
|
5197
5197
|
const p = so(o.labels, o.labelsOperator);
|
|
@@ -5210,7 +5210,7 @@ const Ad = {
|
|
|
5210
5210
|
limit: o.limit
|
|
5211
5211
|
});
|
|
5212
5212
|
return {
|
|
5213
|
-
textContent:
|
|
5213
|
+
textContent: _d({
|
|
5214
5214
|
tasks: h,
|
|
5215
5215
|
args: o,
|
|
5216
5216
|
nextCursor: m,
|
|
@@ -5227,7 +5227,7 @@ const Ad = {
|
|
|
5227
5227
|
};
|
|
5228
5228
|
}
|
|
5229
5229
|
};
|
|
5230
|
-
function
|
|
5230
|
+
function _d({
|
|
5231
5231
|
tasks: e,
|
|
5232
5232
|
args: t,
|
|
5233
5233
|
nextCursor: o,
|
|
@@ -5242,10 +5242,7 @@ function Od({
|
|
|
5242
5242
|
a.push(
|
|
5243
5243
|
`today${d}${t.daysCount > 1 ? ` + ${t.daysCount - 1} more days` : ""}`
|
|
5244
5244
|
);
|
|
5245
|
-
} else
|
|
5246
|
-
const d = t.daysCount > 1 ? ` to ${_e(os(er(t.startDate), t.daysCount))}` : "";
|
|
5247
|
-
a.push(`${t.startDate}${d}`);
|
|
5248
|
-
}
|
|
5245
|
+
} else t.startDate && a.push(xo(t.startDate, t.daysCount));
|
|
5249
5246
|
if (t.labels && t.labels.length > 0) {
|
|
5250
5247
|
const d = ve(t.labels, t.labelsOperator);
|
|
5251
5248
|
a.push(`labels: ${d}`);
|
|
@@ -5255,7 +5252,7 @@ function Od({
|
|
|
5255
5252
|
a.push(`assigned to: ${d}`);
|
|
5256
5253
|
}
|
|
5257
5254
|
let i = "";
|
|
5258
|
-
if (t.overdueOption === "overdue-only" ? i = "Overdue tasks" : t.startDate === "today" ? i = t.overdueOption === "exclude-overdue" ? "Today's tasks" : "Today's tasks + overdue" : t.startDate ? i = `Tasks for ${t.startDate}` : i = "Tasks", t.responsibleUser) {
|
|
5255
|
+
if (t.overdueOption === "overdue-only" ? i = "Overdue tasks" : t.startDate === "today" ? i = t.overdueOption === "exclude-overdue" ? "Today's tasks" : "Today's tasks + overdue" : t.startDate ? i = `Tasks for ${xo(t.startDate, t.daysCount)}` : i = "Tasks", t.responsibleUser) {
|
|
5259
5256
|
const d = r || t.responsibleUser;
|
|
5260
5257
|
i += ` assigned to ${d}`;
|
|
5261
5258
|
}
|
|
@@ -5278,14 +5275,17 @@ function Od({
|
|
|
5278
5275
|
zeroReasonHints: c
|
|
5279
5276
|
});
|
|
5280
5277
|
}
|
|
5281
|
-
|
|
5282
|
-
|
|
5278
|
+
function xo(e, t) {
|
|
5279
|
+
return t > 1 ? `${e} to ${$e(e, t - 1)}` : e;
|
|
5280
|
+
}
|
|
5281
|
+
const Ud = 300 * 1e3;
|
|
5282
|
+
class Pd {
|
|
5283
5283
|
constructor() {
|
|
5284
5284
|
this.cacheByClient = /* @__PURE__ */ new WeakMap();
|
|
5285
5285
|
}
|
|
5286
5286
|
async getFilters(t) {
|
|
5287
5287
|
const o = this.cacheByClient, r = o.get(t);
|
|
5288
|
-
if (r && Date.now() - r.timestamp <
|
|
5288
|
+
if (r && Date.now() - r.timestamp < Ud)
|
|
5289
5289
|
return r.filters;
|
|
5290
5290
|
const a = ((await t.sync({
|
|
5291
5291
|
resourceTypes: ["filters"],
|
|
@@ -5342,19 +5342,19 @@ ${l}` + (d.length > 5 ? `
|
|
|
5342
5342
|
this.cacheByClient = /* @__PURE__ */ new WeakMap();
|
|
5343
5343
|
}
|
|
5344
5344
|
}
|
|
5345
|
-
const
|
|
5345
|
+
const Rd = new Pd(), Oo = 5, Ct = "resume:", jt = "Invalid cursor. Pass the nextCursor from the previous call unchanged, with the same parameters.", Nd = s.object({
|
|
5346
5346
|
next: s.string(),
|
|
5347
5347
|
state: s.unknown().optional()
|
|
5348
5348
|
});
|
|
5349
|
-
function
|
|
5349
|
+
function Ld(e) {
|
|
5350
5350
|
return `${Ct}${Buffer.from(JSON.stringify(e)).toString("base64url")}`;
|
|
5351
5351
|
}
|
|
5352
|
-
function
|
|
5352
|
+
function Md(e) {
|
|
5353
5353
|
if (e) {
|
|
5354
5354
|
if (!e.startsWith(Ct)) throw new Error(jt);
|
|
5355
5355
|
try {
|
|
5356
5356
|
const t = e.slice(Ct.length);
|
|
5357
|
-
return
|
|
5357
|
+
return Nd.parse(
|
|
5358
5358
|
JSON.parse(Buffer.from(t, "base64url").toString())
|
|
5359
5359
|
);
|
|
5360
5360
|
} catch {
|
|
@@ -5362,7 +5362,7 @@ function Ld(e) {
|
|
|
5362
5362
|
}
|
|
5363
5363
|
}
|
|
5364
5364
|
}
|
|
5365
|
-
async function
|
|
5365
|
+
async function Fd({
|
|
5366
5366
|
fetchPage: e,
|
|
5367
5367
|
matches: t,
|
|
5368
5368
|
limit: o,
|
|
@@ -5372,7 +5372,7 @@ async function Md({
|
|
|
5372
5372
|
}) {
|
|
5373
5373
|
const i = [];
|
|
5374
5374
|
let c = n?.next, d = null;
|
|
5375
|
-
for (let u = 0; u <
|
|
5375
|
+
for (let u = 0; u < Oo; u++) {
|
|
5376
5376
|
const { results: l, nextCursor: p } = await e({ cursor: d, limit: r });
|
|
5377
5377
|
for (const f of l) {
|
|
5378
5378
|
if (c !== void 0) {
|
|
@@ -5381,7 +5381,7 @@ async function Md({
|
|
|
5381
5381
|
}
|
|
5382
5382
|
if (t(f)) {
|
|
5383
5383
|
if (i.length === o)
|
|
5384
|
-
return { items: i, nextCursor:
|
|
5384
|
+
return { items: i, nextCursor: Ld({ next: f.id, state: a }) };
|
|
5385
5385
|
i.push(f);
|
|
5386
5386
|
}
|
|
5387
5387
|
}
|
|
@@ -5395,10 +5395,10 @@ async function Md({
|
|
|
5395
5395
|
d = p;
|
|
5396
5396
|
}
|
|
5397
5397
|
throw new Error(
|
|
5398
|
-
`Stopped after reading ${
|
|
5398
|
+
`Stopped after reading ${Oo * r} items without reaching the end of the list.`
|
|
5399
5399
|
);
|
|
5400
5400
|
}
|
|
5401
|
-
const { FIND_COMPLETED_TASKS:
|
|
5401
|
+
const { FIND_COMPLETED_TASKS: _o, ADD_TASKS: Uo } = y, Hd = {
|
|
5402
5402
|
searchText: s.string().optional().describe("The text to search for in tasks."),
|
|
5403
5403
|
projectId: s.string().optional().describe(
|
|
5404
5404
|
'Find tasks in this project. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
@@ -5422,17 +5422,17 @@ const { FIND_COMPLETED_TASKS: Oo, ADD_TASKS: _o } = y, Fd = {
|
|
|
5422
5422
|
"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."
|
|
5423
5423
|
),
|
|
5424
5424
|
...oo
|
|
5425
|
-
},
|
|
5425
|
+
}, Wd = {
|
|
5426
5426
|
tasks: s.array(oe).describe("The found tasks."),
|
|
5427
5427
|
nextCursor: s.string().optional(),
|
|
5428
5428
|
totalCount: s.number().describe("The total number of tasks in this page."),
|
|
5429
5429
|
hasMore: s.boolean(),
|
|
5430
5430
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
5431
|
-
},
|
|
5431
|
+
}, Bd = {
|
|
5432
5432
|
name: y.FIND_TASKS,
|
|
5433
5433
|
description: 'Find active tasks by text, project/section/parent, responsible user, labels, raw filter, or saved filter (filterIdOrName). Without filters, list a page. Default scope: unassigned + mine; responsibleUserFiltering="all" includes others.',
|
|
5434
|
-
parameters:
|
|
5435
|
-
outputSchema:
|
|
5434
|
+
parameters: Hd,
|
|
5435
|
+
outputSchema: Wd,
|
|
5436
5436
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
5437
5437
|
async execute(e, t) {
|
|
5438
5438
|
const {
|
|
@@ -5458,22 +5458,22 @@ const { FIND_COMPLETED_TASKS: Oo, ADD_TASKS: _o } = y, Fd = {
|
|
|
5458
5458
|
throw new Error(
|
|
5459
5459
|
'The `filter`/`filterIdOrName` parameter cannot be combined with projectId, sectionId, or parentId. Use filter syntax instead (e.g. "##ProjectName").'
|
|
5460
5460
|
);
|
|
5461
|
-
const g = b ?
|
|
5461
|
+
const g = b ? Md(m) : void 0, w = b ? g ? Promise.resolve(zd(g.state)) : Gd(t, l, p) : Promise.resolve(void 0), I = await t.getUser(), k = l && l.length > 0;
|
|
5462
5462
|
let S = f;
|
|
5463
|
-
h && (S = (await
|
|
5463
|
+
h && (S = (await Rd.resolveFilter(t, h)).filterQuery);
|
|
5464
5464
|
const E = await Ht(t, i), N = E?.userId, T = E?.email;
|
|
5465
5465
|
if (b) {
|
|
5466
5466
|
const G = {};
|
|
5467
5467
|
r && (G.projectId = await me({ projectId: r, user: I })), n && (G.sectionId = n), a && (G.parentId = a);
|
|
5468
5468
|
const ge = await w;
|
|
5469
5469
|
ge && (G.label = ge);
|
|
5470
|
-
const de = o?.toLowerCase(), { items: J, nextCursor:
|
|
5470
|
+
const de = o?.toLowerCase(), { items: J, nextCursor: Fe } = await Fd({
|
|
5471
5471
|
fetchPage: async (ye) => {
|
|
5472
|
-
const { results:
|
|
5472
|
+
const { results: mr, nextCursor: fr } = await t.getTasks({
|
|
5473
5473
|
...G,
|
|
5474
5474
|
...ye
|
|
5475
5475
|
});
|
|
5476
|
-
return { results:
|
|
5476
|
+
return { results: mr.map(z), nextCursor: fr };
|
|
5477
5477
|
},
|
|
5478
5478
|
matches: (ye) => (!de || ye.content.toLowerCase().includes(de) || !!ye.description?.toLowerCase().includes(de)) && ha({
|
|
5479
5479
|
tasks: [ye],
|
|
@@ -5490,16 +5490,16 @@ const { FIND_COMPLETED_TASKS: Oo, ADD_TASKS: _o } = y, Fd = {
|
|
|
5490
5490
|
textContent: it({
|
|
5491
5491
|
tasks: J,
|
|
5492
5492
|
args: e,
|
|
5493
|
-
nextCursor:
|
|
5493
|
+
nextCursor: Fe,
|
|
5494
5494
|
isContainerSearch: !0,
|
|
5495
5495
|
assigneeEmail: T,
|
|
5496
5496
|
assigneeNames: await Se(t, J, I.id)
|
|
5497
5497
|
}),
|
|
5498
5498
|
structuredContent: {
|
|
5499
5499
|
tasks: J,
|
|
5500
|
-
nextCursor:
|
|
5500
|
+
nextCursor: Fe ?? void 0,
|
|
5501
5501
|
totalCount: J.length,
|
|
5502
|
-
hasMore: !!
|
|
5502
|
+
hasMore: !!Fe,
|
|
5503
5503
|
appliedFilters: e
|
|
5504
5504
|
}
|
|
5505
5505
|
};
|
|
@@ -5546,7 +5546,7 @@ const { FIND_COMPLETED_TASKS: Oo, ADD_TASKS: _o } = y, Fd = {
|
|
|
5546
5546
|
});
|
|
5547
5547
|
v = Ce(v, G);
|
|
5548
5548
|
}
|
|
5549
|
-
const { tasks: L, nextCursor:
|
|
5549
|
+
const { tasks: L, nextCursor: Me } = await Kt({
|
|
5550
5550
|
client: t,
|
|
5551
5551
|
query: v || "all",
|
|
5552
5552
|
cursor: m,
|
|
@@ -5556,28 +5556,28 @@ const { FIND_COMPLETED_TASKS: Oo, ADD_TASKS: _o } = y, Fd = {
|
|
|
5556
5556
|
textContent: it({
|
|
5557
5557
|
tasks: L,
|
|
5558
5558
|
args: e,
|
|
5559
|
-
nextCursor:
|
|
5559
|
+
nextCursor: Me,
|
|
5560
5560
|
isContainerSearch: !1,
|
|
5561
5561
|
assigneeEmail: T,
|
|
5562
5562
|
assigneeNames: await Se(t, L, I.id)
|
|
5563
5563
|
}),
|
|
5564
5564
|
structuredContent: {
|
|
5565
5565
|
tasks: L,
|
|
5566
|
-
nextCursor:
|
|
5566
|
+
nextCursor: Me ?? void 0,
|
|
5567
5567
|
totalCount: L.length,
|
|
5568
|
-
hasMore: !!
|
|
5568
|
+
hasMore: !!Me,
|
|
5569
5569
|
appliedFilters: e
|
|
5570
5570
|
}
|
|
5571
5571
|
};
|
|
5572
5572
|
}
|
|
5573
|
-
},
|
|
5574
|
-
function
|
|
5573
|
+
}, Kd = s.object({ apiLabel: s.string().optional() });
|
|
5574
|
+
function zd(e) {
|
|
5575
5575
|
if (e === void 0) return;
|
|
5576
|
-
const t =
|
|
5576
|
+
const t = Kd.safeParse(e);
|
|
5577
5577
|
if (!t.success) throw new Error(jt);
|
|
5578
5578
|
return t.data.apiLabel;
|
|
5579
5579
|
}
|
|
5580
|
-
async function
|
|
5580
|
+
async function Gd(e, t, o) {
|
|
5581
5581
|
if (!(!t?.length || t.length > 1 && o !== "and"))
|
|
5582
5582
|
try {
|
|
5583
5583
|
const [r, n] = await Promise.all([
|
|
@@ -5597,12 +5597,12 @@ async function zd(e, t, o) {
|
|
|
5597
5597
|
return;
|
|
5598
5598
|
}
|
|
5599
5599
|
}
|
|
5600
|
-
function
|
|
5600
|
+
function qd(e) {
|
|
5601
5601
|
if (e.projectId) {
|
|
5602
5602
|
const t = [
|
|
5603
5603
|
e.searchText ? "No tasks in project match search" : "Project has no tasks yet"
|
|
5604
5604
|
];
|
|
5605
|
-
return e.searchText || t.push(`Use ${
|
|
5605
|
+
return e.searchText || t.push(`Use ${Uo} to create tasks`), t;
|
|
5606
5606
|
}
|
|
5607
5607
|
if (e.sectionId) {
|
|
5608
5608
|
const t = [e.searchText ? "No tasks in section match search" : "Section is empty"];
|
|
@@ -5610,7 +5610,7 @@ function Gd(e) {
|
|
|
5610
5610
|
}
|
|
5611
5611
|
if (e.parentId) {
|
|
5612
5612
|
const t = [e.searchText ? "No subtasks match search" : "No subtasks created yet"];
|
|
5613
|
-
return e.searchText || t.push(`Use ${
|
|
5613
|
+
return e.searchText || t.push(`Use ${Uo} with parentId to add subtasks`), t;
|
|
5614
5614
|
}
|
|
5615
5615
|
return [];
|
|
5616
5616
|
}
|
|
@@ -5633,7 +5633,7 @@ function it({
|
|
|
5633
5633
|
const u = ve(t.labels, t.labelsOperator);
|
|
5634
5634
|
c.push(`labels: ${u}`);
|
|
5635
5635
|
}
|
|
5636
|
-
e.length === 0 && d.push(...
|
|
5636
|
+
e.length === 0 && d.push(...qd(t));
|
|
5637
5637
|
} else {
|
|
5638
5638
|
const u = n || t.responsibleUser, l = [];
|
|
5639
5639
|
if (t.filter && l.push(`filter: ${t.filter}`), t.searchText && l.push(`"${t.searchText}"`), t.responsibleUser && l.push(`assigned to ${u}`), t.labels && t.labels.length > 0) {
|
|
@@ -5647,9 +5647,9 @@ function it({
|
|
|
5647
5647
|
if (e.length === 0) {
|
|
5648
5648
|
if (t.responsibleUser) {
|
|
5649
5649
|
const p = n || t.responsibleUser;
|
|
5650
|
-
d.push(`No tasks assigned to ${p}`), d.push("Check if the user name is correct"), d.push(`Check completed tasks with ${
|
|
5650
|
+
d.push(`No tasks assigned to ${p}`), d.push("Check if the user name is correct"), d.push(`Check completed tasks with ${_o}`);
|
|
5651
5651
|
}
|
|
5652
|
-
t.searchText && (d.push("Try broader search terms"), d.push("Verify spelling and try partial words"), t.responsibleUser || d.push(`Check completed tasks with ${
|
|
5652
|
+
t.searchText && (d.push("Try broader search terms"), d.push("Verify spelling and try partial words"), t.responsibleUser || d.push(`Check completed tasks with ${_o}`));
|
|
5653
5653
|
}
|
|
5654
5654
|
}
|
|
5655
5655
|
return se({
|
|
@@ -5662,11 +5662,11 @@ function it({
|
|
|
5662
5662
|
zeroReasonHints: d
|
|
5663
5663
|
});
|
|
5664
5664
|
}
|
|
5665
|
-
const
|
|
5665
|
+
const Yd = {
|
|
5666
5666
|
projectId: s.string().min(1).optional().describe(
|
|
5667
5667
|
`Optional project ID. Use "inbox" for the Inbox. If provided, returns that project's tasks grouped by section. If omitted, returns the project and section structure for the whole account with no tasks.`
|
|
5668
5668
|
)
|
|
5669
|
-
},
|
|
5669
|
+
}, er = s.lazy(
|
|
5670
5670
|
() => s.object({
|
|
5671
5671
|
id: s.string().describe("The project ID."),
|
|
5672
5672
|
name: s.string().describe("The project name."),
|
|
@@ -5674,9 +5674,9 @@ const qd = {
|
|
|
5674
5674
|
folderId: s.string().optional().describe("The folder ID this project belongs to (workspace projects only)."),
|
|
5675
5675
|
childOrder: s.number().describe("The ordering index among siblings."),
|
|
5676
5676
|
sections: s.array(ae),
|
|
5677
|
-
children: s.array(
|
|
5677
|
+
children: s.array(er).describe("Nested child projects.")
|
|
5678
5678
|
})
|
|
5679
|
-
),
|
|
5679
|
+
), Vd = {
|
|
5680
5680
|
type: s.enum(["account_overview", "project_overview"]).describe("The type of overview returned."),
|
|
5681
5681
|
totalProjects: s.number().optional().describe("Total number of projects (account overview only)."),
|
|
5682
5682
|
totalTasks: s.number().optional().describe("Total number of tasks."),
|
|
@@ -5695,7 +5695,7 @@ const qd = {
|
|
|
5695
5695
|
name: s.string().describe("The inbox project name."),
|
|
5696
5696
|
sections: s.array(ae).describe("Sections in the inbox project.")
|
|
5697
5697
|
}).optional().describe("Inbox information (account overview only)."),
|
|
5698
|
-
projects: s.array(s.lazy(() =>
|
|
5698
|
+
projects: s.array(s.lazy(() => er)).optional().describe(
|
|
5699
5699
|
"List of projects with hierarchy, folders, and ordering (account overview only)."
|
|
5700
5700
|
),
|
|
5701
5701
|
project: s.object({
|
|
@@ -5710,7 +5710,7 @@ const qd = {
|
|
|
5710
5710
|
tasksWithoutSection: s.number()
|
|
5711
5711
|
}).optional().describe("Statistics object (project overview only).")
|
|
5712
5712
|
};
|
|
5713
|
-
function
|
|
5713
|
+
function Jd(e) {
|
|
5714
5714
|
const t = {};
|
|
5715
5715
|
for (const n of e)
|
|
5716
5716
|
t[n.id] = {
|
|
@@ -5735,7 +5735,7 @@ function Vd(e) {
|
|
|
5735
5735
|
}
|
|
5736
5736
|
return r(o), o;
|
|
5737
5737
|
}
|
|
5738
|
-
async function
|
|
5738
|
+
async function Xd(e, t) {
|
|
5739
5739
|
const o = {};
|
|
5740
5740
|
return await Promise.all(
|
|
5741
5741
|
t.map(async (r) => {
|
|
@@ -5744,17 +5744,17 @@ async function Jd(e, t) {
|
|
|
5744
5744
|
})
|
|
5745
5745
|
), o;
|
|
5746
5746
|
}
|
|
5747
|
-
function
|
|
5747
|
+
function tr(e, t, o = "") {
|
|
5748
5748
|
const r = [];
|
|
5749
5749
|
r.push(`${o}- Project: ${e.name} (id=${e.id})`);
|
|
5750
5750
|
const n = t[e.id] || [];
|
|
5751
5751
|
for (const a of n)
|
|
5752
5752
|
r.push(`${o} - Section: ${a.name} (id=${a.id})`);
|
|
5753
5753
|
for (const a of e.children)
|
|
5754
|
-
r.push(...
|
|
5754
|
+
r.push(...tr(a, t, `${o} `));
|
|
5755
5755
|
return r;
|
|
5756
5756
|
}
|
|
5757
|
-
function
|
|
5757
|
+
function Po(e) {
|
|
5758
5758
|
const t = {};
|
|
5759
5759
|
for (const r of e)
|
|
5760
5760
|
t[r.id] = { ...r, children: [] };
|
|
@@ -5779,7 +5779,7 @@ function $t(e, t, o = "") {
|
|
|
5779
5779
|
}
|
|
5780
5780
|
return r;
|
|
5781
5781
|
}
|
|
5782
|
-
function
|
|
5782
|
+
function or(e, t) {
|
|
5783
5783
|
return {
|
|
5784
5784
|
id: e.id,
|
|
5785
5785
|
name: e.name,
|
|
@@ -5788,11 +5788,11 @@ function sr(e, t) {
|
|
|
5788
5788
|
childOrder: e.childOrder,
|
|
5789
5789
|
sections: (t[e.id] || []).map(ce),
|
|
5790
5790
|
children: e.children.map(
|
|
5791
|
-
(o) =>
|
|
5791
|
+
(o) => or(o, t)
|
|
5792
5792
|
)
|
|
5793
5793
|
};
|
|
5794
5794
|
}
|
|
5795
|
-
async function
|
|
5795
|
+
async function Zd(e, t) {
|
|
5796
5796
|
let o = [], r;
|
|
5797
5797
|
do {
|
|
5798
5798
|
const { results: n, nextCursor: a } = await e.getTasks({
|
|
@@ -5804,12 +5804,12 @@ async function Xd(e, t) {
|
|
|
5804
5804
|
} while (r);
|
|
5805
5805
|
return o;
|
|
5806
5806
|
}
|
|
5807
|
-
async function
|
|
5807
|
+
async function Qd(e, t) {
|
|
5808
5808
|
const { results: o } = await e.getSections({ projectId: t });
|
|
5809
5809
|
return o;
|
|
5810
5810
|
}
|
|
5811
|
-
async function
|
|
5812
|
-
const { results: t } = await e.getProjects({}), o = t.find((p) => ee(p) && p.inboxProject === !0), r = t.filter((p) => !ee(p) || p.inboxProject !== !0), n =
|
|
5811
|
+
async function el(e) {
|
|
5812
|
+
const { results: t } = await e.getProjects({}), o = t.find((p) => ee(p) && p.inboxProject === !0), r = t.filter((p) => !ee(p) || p.inboxProject !== !0), n = Jd(r), a = t.map((p) => p.id), i = await Xd(e, a), c = ["# Personal Projects", ""];
|
|
5813
5813
|
if (o) {
|
|
5814
5814
|
c.push(`- Inbox Project: ${o.name} (id=${o.id})`);
|
|
5815
5815
|
for (const p of i[o.id] || [])
|
|
@@ -5817,7 +5817,7 @@ async function Qd(e) {
|
|
|
5817
5817
|
}
|
|
5818
5818
|
if (n.length)
|
|
5819
5819
|
for (const p of n)
|
|
5820
|
-
c.push(...
|
|
5820
|
+
c.push(...tr(p, i));
|
|
5821
5821
|
else
|
|
5822
5822
|
c.push("_No projects found._");
|
|
5823
5823
|
c.push(""), c.push(
|
|
@@ -5838,7 +5838,7 @@ async function Qd(e) {
|
|
|
5838
5838
|
sections: (i[o.id] || []).map(ce)
|
|
5839
5839
|
} : void 0,
|
|
5840
5840
|
projects: n.map(
|
|
5841
|
-
(p) =>
|
|
5841
|
+
(p) => or(p, i)
|
|
5842
5842
|
),
|
|
5843
5843
|
totalProjects: t.length,
|
|
5844
5844
|
totalSections: a.reduce(
|
|
@@ -5849,13 +5849,13 @@ async function Qd(e) {
|
|
|
5849
5849
|
};
|
|
5850
5850
|
return { textContent: u, structuredContent: l };
|
|
5851
5851
|
}
|
|
5852
|
-
async function
|
|
5852
|
+
async function tl(e, t) {
|
|
5853
5853
|
const o = ie(e, t), r = (h) => h.catch(async (m) => {
|
|
5854
5854
|
throw await o, m;
|
|
5855
5855
|
}), [n, a, i] = await Promise.all([
|
|
5856
5856
|
o,
|
|
5857
|
-
r(
|
|
5858
|
-
r(
|
|
5857
|
+
r(Qd(e, t)),
|
|
5858
|
+
r(Zd(e, t))
|
|
5859
5859
|
]), c = await Se(e, i), d = {};
|
|
5860
5860
|
for (const h of a)
|
|
5861
5861
|
d[h.id] = [];
|
|
@@ -5865,7 +5865,7 @@ async function el(e, t) {
|
|
|
5865
5865
|
const l = [`# ${n.name}`];
|
|
5866
5866
|
if (u.length > 0) {
|
|
5867
5867
|
l.push("");
|
|
5868
|
-
const h =
|
|
5868
|
+
const h = Po(u);
|
|
5869
5869
|
l.push(...$t(h, c));
|
|
5870
5870
|
}
|
|
5871
5871
|
for (const h of a) {
|
|
@@ -5873,7 +5873,7 @@ async function el(e, t) {
|
|
|
5873
5873
|
const m = d[h.id];
|
|
5874
5874
|
if (!m?.length)
|
|
5875
5875
|
continue;
|
|
5876
|
-
const b =
|
|
5876
|
+
const b = Po(m);
|
|
5877
5877
|
l.push(...$t(b, c));
|
|
5878
5878
|
}
|
|
5879
5879
|
const p = l.join(`
|
|
@@ -5897,33 +5897,33 @@ async function el(e, t) {
|
|
|
5897
5897
|
};
|
|
5898
5898
|
return { textContent: p, structuredContent: f };
|
|
5899
5899
|
}
|
|
5900
|
-
const
|
|
5900
|
+
const ol = {
|
|
5901
5901
|
name: y.GET_OVERVIEW,
|
|
5902
5902
|
description: `Get a Markdown overview. Called without a projectId, returns the account's project and section structure only — no tasks — for navigation. Pass a projectId (or "inbox" for the Inbox) to get that project's tasks grouped by section.`,
|
|
5903
|
-
parameters:
|
|
5904
|
-
outputSchema:
|
|
5903
|
+
parameters: Yd,
|
|
5904
|
+
outputSchema: Vd,
|
|
5905
5905
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
5906
5906
|
async execute(e, t) {
|
|
5907
|
-
const o = await me({ projectId: e.projectId, client: t }), r = o ? await
|
|
5907
|
+
const o = await me({ projectId: e.projectId, client: t }), r = o ? await tl(t, o) : await el(t);
|
|
5908
5908
|
return {
|
|
5909
5909
|
textContent: r.textContent,
|
|
5910
5910
|
structuredContent: r.structuredContent
|
|
5911
5911
|
};
|
|
5912
5912
|
}
|
|
5913
|
-
},
|
|
5913
|
+
}, sl = {}, Ie = s.object({
|
|
5914
5914
|
count: s.number().describe("Number of consecutive periods in this streak."),
|
|
5915
5915
|
start: s.string().describe("Start date of the streak."),
|
|
5916
5916
|
end: s.string().describe("End date of the streak.")
|
|
5917
|
-
}),
|
|
5917
|
+
}), Ro = s.object({
|
|
5918
5918
|
id: s.string().describe("Project ID."),
|
|
5919
5919
|
completed: s.number().describe("Number of tasks completed in this project.")
|
|
5920
|
-
}),
|
|
5920
|
+
}), rl = {
|
|
5921
5921
|
completedCount: s.number().describe("Total number of completed tasks (all-time)."),
|
|
5922
5922
|
daysItems: s.array(
|
|
5923
5923
|
s.object({
|
|
5924
5924
|
date: s.string().describe("Date string (YYYY-MM-DD)."),
|
|
5925
5925
|
totalCompleted: s.number().describe("Total tasks completed on this day."),
|
|
5926
|
-
items: s.array(
|
|
5926
|
+
items: s.array(Ro).describe("Per-project completion breakdown for this day.")
|
|
5927
5927
|
})
|
|
5928
5928
|
).describe("Daily completion breakdown (most recent days)."),
|
|
5929
5929
|
weekItems: s.array(
|
|
@@ -5931,7 +5931,7 @@ const tl = {
|
|
|
5931
5931
|
from: s.string().describe("Start date of the week."),
|
|
5932
5932
|
to: s.string().describe("End date of the week."),
|
|
5933
5933
|
totalCompleted: s.number().describe("Total tasks completed in this week."),
|
|
5934
|
-
items: s.array(
|
|
5934
|
+
items: s.array(Ro).describe("Per-project completion breakdown for this week.")
|
|
5935
5935
|
})
|
|
5936
5936
|
).describe("Weekly completion breakdown (most recent weeks)."),
|
|
5937
5937
|
goals: s.object({
|
|
@@ -5966,11 +5966,11 @@ const tl = {
|
|
|
5966
5966
|
})
|
|
5967
5967
|
).describe("Recent karma change events with reasons."),
|
|
5968
5968
|
projectColors: s.record(s.string(), s.string()).describe("Map of project ID to color key.")
|
|
5969
|
-
},
|
|
5969
|
+
}, nl = {
|
|
5970
5970
|
name: y.GET_PRODUCTIVITY_STATS,
|
|
5971
5971
|
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. Reports counts, streaks and karma only, never the tasks themselves — for "what did I complete", use find-activity.',
|
|
5972
|
-
parameters:
|
|
5973
|
-
outputSchema:
|
|
5972
|
+
parameters: sl,
|
|
5973
|
+
outputSchema: rl,
|
|
5974
5974
|
annotations: {
|
|
5975
5975
|
readOnlyHint: !0,
|
|
5976
5976
|
destructiveHint: !1,
|
|
@@ -5979,7 +5979,7 @@ const tl = {
|
|
|
5979
5979
|
async execute(e, t) {
|
|
5980
5980
|
const o = await t.getProductivityStats();
|
|
5981
5981
|
return {
|
|
5982
|
-
textContent:
|
|
5982
|
+
textContent: al(o),
|
|
5983
5983
|
structuredContent: {
|
|
5984
5984
|
completedCount: o.completedCount,
|
|
5985
5985
|
daysItems: o.daysItems,
|
|
@@ -6006,7 +6006,7 @@ const tl = {
|
|
|
6006
6006
|
};
|
|
6007
6007
|
}
|
|
6008
6008
|
};
|
|
6009
|
-
function
|
|
6009
|
+
function al(e) {
|
|
6010
6010
|
const t = [
|
|
6011
6011
|
"# Productivity Statistics",
|
|
6012
6012
|
"",
|
|
@@ -6036,11 +6036,11 @@ function nl(e) {
|
|
|
6036
6036
|
return t.join(`
|
|
6037
6037
|
`);
|
|
6038
6038
|
}
|
|
6039
|
-
const
|
|
6039
|
+
const il = {
|
|
6040
6040
|
projectId: s.string().min(1).describe("The ID of the project to get activity stats for."),
|
|
6041
6041
|
weeks: s.number().int().min(1).max(12).optional().describe("Number of weeks of activity data to retrieve (1-12, default 2)."),
|
|
6042
6042
|
includeWeeklyCounts: s.boolean().optional().describe("Include weekly rollup counts alongside daily counts.")
|
|
6043
|
-
},
|
|
6043
|
+
}, cl = {
|
|
6044
6044
|
projectId: s.string().describe("The project ID."),
|
|
6045
6045
|
dayItems: s.array(
|
|
6046
6046
|
s.object({
|
|
@@ -6056,7 +6056,7 @@ const al = {
|
|
|
6056
6056
|
})
|
|
6057
6057
|
).optional().describe("Weekly completion rollups. Only included when includeWeeklyCounts is true.")
|
|
6058
6058
|
};
|
|
6059
|
-
function
|
|
6059
|
+
function dl(e, t) {
|
|
6060
6060
|
const o = [`# Activity Stats: Project ${e}`, ""];
|
|
6061
6061
|
if (t.dayItems.length > 0) {
|
|
6062
6062
|
o.push("## Daily Activity");
|
|
@@ -6072,11 +6072,11 @@ function cl(e, t) {
|
|
|
6072
6072
|
return o.join(`
|
|
6073
6073
|
`);
|
|
6074
6074
|
}
|
|
6075
|
-
const
|
|
6075
|
+
const ll = {
|
|
6076
6076
|
name: y.GET_PROJECT_ACTIVITY_STATS,
|
|
6077
6077
|
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.",
|
|
6078
|
-
parameters:
|
|
6079
|
-
outputSchema:
|
|
6078
|
+
parameters: il,
|
|
6079
|
+
outputSchema: cl,
|
|
6080
6080
|
annotations: {
|
|
6081
6081
|
readOnlyHint: !0,
|
|
6082
6082
|
destructiveHint: !1,
|
|
@@ -6088,7 +6088,7 @@ const dl = {
|
|
|
6088
6088
|
includeWeeklyCounts: n
|
|
6089
6089
|
});
|
|
6090
6090
|
return {
|
|
6091
|
-
textContent:
|
|
6091
|
+
textContent: dl(o, a),
|
|
6092
6092
|
structuredContent: {
|
|
6093
6093
|
projectId: o,
|
|
6094
6094
|
dayItems: a.dayItems,
|
|
@@ -6096,9 +6096,9 @@ const dl = {
|
|
|
6096
6096
|
}
|
|
6097
6097
|
};
|
|
6098
6098
|
}
|
|
6099
|
-
}, ll = {
|
|
6100
|
-
projectId: s.string().min(1).describe("The ID of the project to check health for.")
|
|
6101
6099
|
}, ul = {
|
|
6100
|
+
projectId: s.string().min(1).describe("The ID of the project to check health for.")
|
|
6101
|
+
}, pl = {
|
|
6102
6102
|
projectId: s.string().describe("The project ID."),
|
|
6103
6103
|
projectName: s.string().describe("The project name."),
|
|
6104
6104
|
progress: s.object({
|
|
@@ -6115,18 +6115,18 @@ const dl = {
|
|
|
6115
6115
|
updatedAt: s.string().optional().describe("When the health assessment was last updated.")
|
|
6116
6116
|
}).describe("Project health assessment.")
|
|
6117
6117
|
};
|
|
6118
|
-
function
|
|
6118
|
+
function hl(e, t, o) {
|
|
6119
6119
|
const r = [`# Project Health: ${e}`, ""];
|
|
6120
6120
|
return r.push(`**Status:** ${o.status}`), o.isStale && r.push("**Note:** Health data is stale and may not reflect recent changes."), o.updateInProgress && r.push("**Note:** A health analysis update is currently in progress."), o.updatedAt && r.push(`**Last Updated:** ${o.updatedAt.toISOString()}`), r.push(""), r.push("## Progress"), r.push(
|
|
6121
6121
|
`**Completed:** ${t.completedCount} | **Active:** ${t.activeCount} | **Progress:** ${t.progressPercent}%`
|
|
6122
6122
|
), o.description && (r.push(""), r.push("## Health Description"), r.push(o.description)), r.join(`
|
|
6123
6123
|
`);
|
|
6124
6124
|
}
|
|
6125
|
-
const
|
|
6125
|
+
const ml = {
|
|
6126
6126
|
name: y.GET_PROJECT_HEALTH,
|
|
6127
6127
|
description: "Get a comprehensive health assessment for a project including completion progress, health status (EXCELLENT, ON_TRACK, AT_RISK, CRITICAL), and a written assessment. Use find-tasks and find-completed-tasks for task-level detail.",
|
|
6128
|
-
parameters:
|
|
6129
|
-
outputSchema:
|
|
6128
|
+
parameters: ul,
|
|
6129
|
+
outputSchema: pl,
|
|
6130
6130
|
annotations: {
|
|
6131
6131
|
readOnlyHint: !0,
|
|
6132
6132
|
destructiveHint: !1,
|
|
@@ -6138,7 +6138,7 @@ const hl = {
|
|
|
6138
6138
|
t.getProjectHealth(o)
|
|
6139
6139
|
]), a = `Project ${o}`;
|
|
6140
6140
|
return {
|
|
6141
|
-
textContent:
|
|
6141
|
+
textContent: hl(a, r, n),
|
|
6142
6142
|
structuredContent: {
|
|
6143
6143
|
projectId: o,
|
|
6144
6144
|
projectName: a,
|
|
@@ -6158,28 +6158,28 @@ const hl = {
|
|
|
6158
6158
|
}
|
|
6159
6159
|
};
|
|
6160
6160
|
}
|
|
6161
|
-
},
|
|
6161
|
+
}, fl = s.object({
|
|
6162
6162
|
message: s.string().optional(),
|
|
6163
6163
|
emoji: s.string().optional(),
|
|
6164
6164
|
activeUntil: s.string().optional().describe("ISO 8601 end. Omitted when it has no end."),
|
|
6165
6165
|
pauseNotifications: s.boolean().describe("Comms notifications held back."),
|
|
6166
6166
|
pauseActivity: s.boolean().describe("Karma and streaks paused.")
|
|
6167
|
-
}),
|
|
6167
|
+
}), sr = {
|
|
6168
6168
|
hasStatus: s.boolean(),
|
|
6169
|
-
status:
|
|
6169
|
+
status: fl.optional().describe("Omitted when there is no active status.")
|
|
6170
6170
|
};
|
|
6171
|
-
function
|
|
6171
|
+
function bl(e) {
|
|
6172
6172
|
if (!e.user)
|
|
6173
6173
|
throw new Error("Todoist did not return the user, so the status is unknown.");
|
|
6174
6174
|
return e.user.status ?? null;
|
|
6175
6175
|
}
|
|
6176
|
-
async function
|
|
6176
|
+
async function rr(e) {
|
|
6177
6177
|
const t = await j(
|
|
6178
6178
|
() => e.sync({ resourceTypes: ["user"], syncToken: "*" })
|
|
6179
6179
|
);
|
|
6180
|
-
return
|
|
6180
|
+
return bl(t);
|
|
6181
6181
|
}
|
|
6182
|
-
function
|
|
6182
|
+
function gl(e) {
|
|
6183
6183
|
const t = e.activeUntil ? new Date(e.activeUntil).toISOString() : void 0;
|
|
6184
6184
|
return {
|
|
6185
6185
|
...e.message ? { message: e.message } : {},
|
|
@@ -6195,7 +6195,7 @@ function Et(e, t) {
|
|
|
6195
6195
|
textContent: `${t}: none`,
|
|
6196
6196
|
structuredContent: { hasStatus: !1 }
|
|
6197
6197
|
};
|
|
6198
|
-
const o =
|
|
6198
|
+
const o = gl(e), r = [`${t}: ${[o.emoji, o.message].filter(Boolean).join(" ")}`];
|
|
6199
6199
|
r.push(o.activeUntil ? `Until: ${o.activeUntil}` : "Until: no end");
|
|
6200
6200
|
const n = [
|
|
6201
6201
|
o.pauseNotifications ? "Comms notifications paused" : void 0,
|
|
@@ -6207,21 +6207,21 @@ function Et(e, t) {
|
|
|
6207
6207
|
structuredContent: { hasStatus: !0, status: o }
|
|
6208
6208
|
};
|
|
6209
6209
|
}
|
|
6210
|
-
const
|
|
6210
|
+
const yl = {}, wl = {
|
|
6211
6211
|
name: y.GET_USER_STATUS,
|
|
6212
6212
|
description: "Get the user's status, the message and emoji shown next to their name in Todoist and Comms, with when it ends and whether it pauses Comms notifications or Karma and streaks. Returns no status when none is set or it has expired.",
|
|
6213
|
-
parameters:
|
|
6214
|
-
outputSchema:
|
|
6213
|
+
parameters: yl,
|
|
6214
|
+
outputSchema: sr,
|
|
6215
6215
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
6216
6216
|
async execute(e, t) {
|
|
6217
|
-
return Et(await
|
|
6217
|
+
return Et(await rr(t), "Status");
|
|
6218
6218
|
}
|
|
6219
|
-
},
|
|
6219
|
+
}, Tl = {
|
|
6220
6220
|
workspaceIdOrName: s.string().min(1).describe(
|
|
6221
6221
|
"The workspace ID or name. Supports exact ID, exact name match (case-insensitive), or unique partial name match."
|
|
6222
6222
|
),
|
|
6223
6223
|
projectIds: s.array(s.string().min(1)).min(1).max($.FILTER_VALUES_MAX).optional().describe("Optional list of project IDs to scope insights to specific projects.")
|
|
6224
|
-
},
|
|
6224
|
+
}, kl = s.object({
|
|
6225
6225
|
projectId: s.string().describe("The project ID."),
|
|
6226
6226
|
health: s.object({
|
|
6227
6227
|
status: s.enum(Dt).describe("The health status of the project."),
|
|
@@ -6233,15 +6233,15 @@ const gl = {}, yl = {
|
|
|
6233
6233
|
activeCount: s.number().describe("Number of active tasks."),
|
|
6234
6234
|
progressPercent: s.number().describe("Completion percentage (0-100).")
|
|
6235
6235
|
}).optional().describe("Progress data for this project. Omitted when the project has none.")
|
|
6236
|
-
}),
|
|
6236
|
+
}), Il = {
|
|
6237
6237
|
workspaceId: s.string().describe("The resolved workspace ID."),
|
|
6238
6238
|
workspaceName: s.string().describe("The resolved workspace name."),
|
|
6239
|
-
projectInsights: s.array(
|
|
6240
|
-
},
|
|
6239
|
+
projectInsights: s.array(kl).describe("Health and progress insights for each project in the workspace.")
|
|
6240
|
+
}, vl = {
|
|
6241
6241
|
name: y.GET_WORKSPACE_INSIGHTS,
|
|
6242
6242
|
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.",
|
|
6243
|
-
parameters:
|
|
6244
|
-
outputSchema:
|
|
6243
|
+
parameters: Tl,
|
|
6244
|
+
outputSchema: Il,
|
|
6245
6245
|
annotations: {
|
|
6246
6246
|
readOnlyHint: !0,
|
|
6247
6247
|
destructiveHint: !1,
|
|
@@ -6281,7 +6281,7 @@ const gl = {}, yl = {
|
|
|
6281
6281
|
};
|
|
6282
6282
|
}
|
|
6283
6283
|
};
|
|
6284
|
-
function
|
|
6284
|
+
function Sl(e) {
|
|
6285
6285
|
const t = e.trim();
|
|
6286
6286
|
if (!/^https?:\/\//i.test(t))
|
|
6287
6287
|
return t;
|
|
@@ -6291,28 +6291,28 @@ function vl(e) {
|
|
|
6291
6291
|
} catch {
|
|
6292
6292
|
throw new Error(`Could not read a template ID from "${t}".`);
|
|
6293
6293
|
}
|
|
6294
|
-
if (!
|
|
6294
|
+
if (!Cl(o.hostname))
|
|
6295
6295
|
throw new Error(
|
|
6296
6296
|
`"${o.hostname}" is not a Todoist domain. Pass a todoist.com template URL or the template ID itself.`
|
|
6297
6297
|
);
|
|
6298
6298
|
o.hostname = "todoist.com";
|
|
6299
|
-
const r =
|
|
6299
|
+
const r = Dr(o.toString());
|
|
6300
6300
|
if (r?.type !== "template")
|
|
6301
6301
|
throw new Error(`"${t}" is not a Todoist template URL.`);
|
|
6302
6302
|
return r.id;
|
|
6303
6303
|
}
|
|
6304
|
-
function
|
|
6304
|
+
function Cl(e) {
|
|
6305
6305
|
const t = e.toLowerCase();
|
|
6306
6306
|
return t === "todoist.com" || t.endsWith(".todoist.com");
|
|
6307
6307
|
}
|
|
6308
|
-
function
|
|
6308
|
+
function No(e) {
|
|
6309
6309
|
return e.replace(/[a-z]/gi, (t) => `[${t.toUpperCase()}${t.toLowerCase()}]`).replace(/\./g, "\\.");
|
|
6310
6310
|
}
|
|
6311
|
-
const
|
|
6312
|
-
String.raw`^\s*(?:[A-Za-z0-9_\-]+|${
|
|
6313
|
-
),
|
|
6311
|
+
const jl = new RegExp(
|
|
6312
|
+
String.raw`^\s*(?:[A-Za-z0-9_\-]+|${No("https")}:\/\/(?:[A-Za-z0-9\-]+\.)*${No("todoist.com")}(?:\/\S*)?)\s*$`
|
|
6313
|
+
), $l = {
|
|
6314
6314
|
projectId: s.string().min(1).describe("The ID of the existing project to import the template into."),
|
|
6315
|
-
templateId: s.string().regex(
|
|
6315
|
+
templateId: s.string().regex(jl, {
|
|
6316
6316
|
error: 'Pass a template slug ("product-launch"), a template ID ("UT_..."), or an https URL on todoist.com or one of its subdomains.'
|
|
6317
6317
|
}).optional().describe(
|
|
6318
6318
|
'The template to import — either a gallery slug ("product-launch"), a personal template ID ("UT_28Ex..."), or a full Todoist template URL, which is reduced to the ID automatically. Gallery templates work for anyone; personal templates only for the account that owns them. There is no way to list templates through this server, so only use the ID or URL the user supplied. Provide either this or `csvFileContent`, not both.'
|
|
@@ -6321,16 +6321,16 @@ const Cl = new RegExp(
|
|
|
6321
6321
|
"Raw CSV template content, as produced by export-project-template. Provide either this or `templateId`, not both."
|
|
6322
6322
|
),
|
|
6323
6323
|
locale: s.string().optional().describe('Locale for the imported content when using `templateId`. Defaults to "en".')
|
|
6324
|
-
},
|
|
6324
|
+
}, El = {
|
|
6325
6325
|
sections: s.array(ae).describe("Sections created by the import."),
|
|
6326
6326
|
tasks: s.array(oe).describe("Tasks created by the import."),
|
|
6327
|
-
comments: s.array(
|
|
6327
|
+
comments: s.array(Le).describe("Comments created by the import."),
|
|
6328
6328
|
totalCount: s.number().describe("The total number of objects created by the import.")
|
|
6329
|
-
},
|
|
6329
|
+
}, Al = {
|
|
6330
6330
|
name: y.IMPORT_PROJECT_TEMPLATE,
|
|
6331
6331
|
description: "Import a template into an existing project, adding its tasks, sections and comments to whatever is already there. Source it by template ID/URL or by passing CSV content from export-project-template. To start a new project from a template, create the project with add-projects first, then import into it. This writes immediately and cannot be undone, so only run it against a project the user named.",
|
|
6332
|
-
parameters:
|
|
6333
|
-
outputSchema:
|
|
6332
|
+
parameters: $l,
|
|
6333
|
+
outputSchema: El,
|
|
6334
6334
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
6335
6335
|
async execute({ projectId: e, templateId: t, csvFileContent: o, locale: r }, n) {
|
|
6336
6336
|
if (!!t == !!o)
|
|
@@ -6339,16 +6339,16 @@ const Cl = new RegExp(
|
|
|
6339
6339
|
);
|
|
6340
6340
|
const a = t ? await n.importTemplateFromId({
|
|
6341
6341
|
projectId: e,
|
|
6342
|
-
templateId:
|
|
6342
|
+
templateId: Sl(t),
|
|
6343
6343
|
locale: r
|
|
6344
6344
|
}) : await n.importCsvIntoProject({
|
|
6345
6345
|
projectId: e,
|
|
6346
6346
|
// The SDK treats strings as filesystem paths, not file content.
|
|
6347
6347
|
file: new Blob([o ?? ""], { type: "text/csv" }),
|
|
6348
6348
|
fileName: "template.csv"
|
|
6349
|
-
}), i = a.sections.map(ce), c = a.tasks.map(z), d = a.comments.map(
|
|
6349
|
+
}), i = a.sections.map(ce), c = a.tasks.map(z), d = a.comments.map(Ne), u = a.projects.length + i.length + c.length + d.length;
|
|
6350
6350
|
return {
|
|
6351
|
-
textContent:
|
|
6351
|
+
textContent: Dl({
|
|
6352
6352
|
projectId: e,
|
|
6353
6353
|
counts: {
|
|
6354
6354
|
projects: a.projects.length,
|
|
@@ -6362,7 +6362,7 @@ const Cl = new RegExp(
|
|
|
6362
6362
|
};
|
|
6363
6363
|
}
|
|
6364
6364
|
};
|
|
6365
|
-
function
|
|
6365
|
+
function Dl({
|
|
6366
6366
|
projectId: e,
|
|
6367
6367
|
counts: t,
|
|
6368
6368
|
totalCount: o
|
|
@@ -6372,21 +6372,21 @@ function Al({
|
|
|
6372
6372
|
const r = Object.entries(t).filter(([, n]) => n > 0).map(([n, a]) => `${a} ${a === 1 ? n.replace(/s$/, "") : n}`);
|
|
6373
6373
|
return `Imported template into project (id=${e}): ${r.join(", ")}.`;
|
|
6374
6374
|
}
|
|
6375
|
-
const
|
|
6375
|
+
const xl = {}, Ol = {
|
|
6376
6376
|
id: s.string().describe("The unique identifier for the workspace."),
|
|
6377
6377
|
name: s.string().describe("The name of the workspace."),
|
|
6378
|
-
plan: s.enum(
|
|
6379
|
-
role: s.enum(
|
|
6378
|
+
plan: s.enum(Or).describe("The workspace plan type."),
|
|
6379
|
+
role: s.enum(xr).optional().describe("The user's role in the workspace, if available."),
|
|
6380
6380
|
isLinkSharingEnabled: s.boolean().describe("Whether link sharing is enabled for the workspace."),
|
|
6381
6381
|
isGuestAllowed: s.boolean().describe("Whether guests are allowed in the workspace."),
|
|
6382
6382
|
createdAt: s.string().optional().describe("The ISO 8601 timestamp when the workspace was created."),
|
|
6383
6383
|
creatorId: s.string().describe("The ID of the user who created the workspace.")
|
|
6384
|
-
},
|
|
6384
|
+
}, _l = {
|
|
6385
6385
|
type: s.literal("workspaces").describe("The type of the response."),
|
|
6386
|
-
workspaces: s.array(s.object(
|
|
6386
|
+
workspaces: s.array(s.object(Ol)).describe("List of workspaces."),
|
|
6387
6387
|
count: s.number().describe("The total number of workspaces.")
|
|
6388
6388
|
};
|
|
6389
|
-
async function
|
|
6389
|
+
async function Ul(e) {
|
|
6390
6390
|
const o = (await e.getWorkspaces()).map((i) => ({
|
|
6391
6391
|
id: i.id,
|
|
6392
6392
|
name: i.name,
|
|
@@ -6417,22 +6417,22 @@ async function _l(e) {
|
|
|
6417
6417
|
};
|
|
6418
6418
|
return { textContent: n, structuredContent: a };
|
|
6419
6419
|
}
|
|
6420
|
-
const
|
|
6420
|
+
const Pl = {
|
|
6421
6421
|
name: y.LIST_WORKSPACES,
|
|
6422
6422
|
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.",
|
|
6423
|
-
parameters:
|
|
6424
|
-
outputSchema:
|
|
6423
|
+
parameters: xl,
|
|
6424
|
+
outputSchema: _l,
|
|
6425
6425
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
6426
6426
|
async execute(e, t) {
|
|
6427
|
-
const o = await
|
|
6427
|
+
const o = await Ul(t);
|
|
6428
6428
|
return {
|
|
6429
6429
|
textContent: o.textContent,
|
|
6430
6430
|
structuredContent: o.structuredContent
|
|
6431
6431
|
};
|
|
6432
6432
|
}
|
|
6433
|
-
}, { FIND_TASKS:
|
|
6433
|
+
}, { FIND_TASKS: Rl, FIND_PROJECT_COLLABORATORS: Lo, UPDATE_TASKS: Nl } = y, nr = D.BULK_ACTIONS_PER_OPERATION, Ll = {
|
|
6434
6434
|
operation: s.enum(["assign", "unassign", "reassign"]).describe("The assignment operation to perform."),
|
|
6435
|
-
taskIds: s.array(s.string()).min(1).max(
|
|
6435
|
+
taskIds: s.array(s.string()).min(1).max(nr).describe("The IDs of the tasks to operate on (max 50)."),
|
|
6436
6436
|
responsibleUser: s.string().optional().describe(
|
|
6437
6437
|
'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.'
|
|
6438
6438
|
),
|
|
@@ -6440,7 +6440,7 @@ const Ul = {
|
|
|
6440
6440
|
"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."
|
|
6441
6441
|
),
|
|
6442
6442
|
dryRun: s.boolean().optional().default(!1).describe("If true, validates operations without executing them.")
|
|
6443
|
-
},
|
|
6443
|
+
}, Ml = {
|
|
6444
6444
|
results: s.array(
|
|
6445
6445
|
s.object({
|
|
6446
6446
|
taskId: s.string().describe("The ID of the task."),
|
|
@@ -6456,11 +6456,11 @@ const Ul = {
|
|
|
6456
6456
|
failed: s.number().describe("Number of failed operations."),
|
|
6457
6457
|
dryRun: s.boolean().describe("Whether this was a dry run.")
|
|
6458
6458
|
}).optional().describe("Summary of the operation.")
|
|
6459
|
-
},
|
|
6459
|
+
}, Fl = {
|
|
6460
6460
|
name: y.MANAGE_ASSIGNMENTS,
|
|
6461
|
-
description: `Assign, unassign or reassign up to ${
|
|
6462
|
-
parameters:
|
|
6463
|
-
outputSchema:
|
|
6461
|
+
description: `Assign, unassign or reassign up to ${nr} tasks at once. Assigning notifies the new assignee. Each task is updated independently, so one failure does not undo the others; failures are reported per task. Use dryRun to check the changes first.`,
|
|
6462
|
+
parameters: Ll,
|
|
6463
|
+
outputSchema: Ml,
|
|
6464
6464
|
// Open world: assigning a task notifies the new assignee.
|
|
6465
6465
|
annotations: {
|
|
6466
6466
|
readOnlyHint: !1,
|
|
@@ -6689,39 +6689,39 @@ function ct({
|
|
|
6689
6689
|
`;
|
|
6690
6690
|
}
|
|
6691
6691
|
return !o && r.length > 0 ? (c += `**Next steps:**
|
|
6692
|
-
`, c += `• Use ${
|
|
6693
|
-
`, c += `• Use ${
|
|
6694
|
-
`, n.length > 0 && (c += `• Check failed tasks and use ${
|
|
6692
|
+
`, c += `• Use ${Rl} with responsibleUser to see ${e === "unassign" ? "unassigned" : "newly assigned"} tasks
|
|
6693
|
+
`, c += `• Use ${Nl} for individual assignment changes
|
|
6694
|
+
`, n.length > 0 && (c += `• Check failed tasks and use ${Lo} to verify collaborator access
|
|
6695
6695
|
`)) : o ? (c += `**To execute:**
|
|
6696
6696
|
`, c += `• Remove dryRun parameter and run again to execute changes
|
|
6697
6697
|
`, r.length > 0 && (c += `• ${r.length} task${r.length === 1 ? "" : "s"} ready for ${e} operation
|
|
6698
6698
|
`), n.length > 0 && (c += `• Fix ${n.length} validation error${n.length === 1 ? "" : "s"} before executing
|
|
6699
6699
|
`)) : r.length === 0 && (c += `**Suggestions:**
|
|
6700
|
-
`, c += `• Use ${
|
|
6700
|
+
`, c += `• Use ${Lo} to find valid assignees
|
|
6701
6701
|
`, c += `• Check task IDs and assignee permissions
|
|
6702
6702
|
`, c += `• Use dryRun=true to validate before executing
|
|
6703
6703
|
`), c;
|
|
6704
6704
|
}
|
|
6705
|
-
const { FIND_PROJECTS:
|
|
6705
|
+
const { FIND_PROJECTS: Hl } = y, Wl = {
|
|
6706
6706
|
action: s.enum(["archive", "unarchive", "join"]).describe("The action to perform on the project."),
|
|
6707
6707
|
projectId: s.string().min(1).describe("The ID of the project.")
|
|
6708
|
-
},
|
|
6708
|
+
}, Bl = {
|
|
6709
6709
|
project: be.describe("The updated project."),
|
|
6710
6710
|
success: s.boolean().describe("Whether the action was successful.")
|
|
6711
|
-
},
|
|
6711
|
+
}, Kl = {
|
|
6712
6712
|
archive: "Archived",
|
|
6713
6713
|
unarchive: "Unarchived",
|
|
6714
6714
|
join: "Joined"
|
|
6715
|
-
},
|
|
6715
|
+
}, zl = {
|
|
6716
6716
|
name: y.PROJECT_MANAGEMENT,
|
|
6717
|
-
description: `Archive or unarchive a project by its ID, or join a workspace project the user hasn't joined (see ${
|
|
6718
|
-
parameters:
|
|
6719
|
-
outputSchema:
|
|
6717
|
+
description: `Archive or unarchive a project by its ID, or join a workspace project the user hasn't joined (see ${Hl} includeUnjoined) when they ask to.`,
|
|
6718
|
+
parameters: Wl,
|
|
6719
|
+
outputSchema: Bl,
|
|
6720
6720
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
|
|
6721
6721
|
async execute(e, t) {
|
|
6722
|
-
const o = await
|
|
6722
|
+
const o = await Gl(e, t), r = fe(o);
|
|
6723
6723
|
return {
|
|
6724
|
-
textContent: `${
|
|
6724
|
+
textContent: `${Kl[e.action]} project: ${r.name} (id=${r.id})`,
|
|
6725
6725
|
structuredContent: {
|
|
6726
6726
|
project: r,
|
|
6727
6727
|
success: !0
|
|
@@ -6729,7 +6729,7 @@ const { FIND_PROJECTS: Fl } = y, Hl = {
|
|
|
6729
6729
|
};
|
|
6730
6730
|
}
|
|
6731
6731
|
};
|
|
6732
|
-
async function
|
|
6732
|
+
async function Gl({ action: e, projectId: t }, o) {
|
|
6733
6733
|
switch (e) {
|
|
6734
6734
|
case "archive":
|
|
6735
6735
|
return o.archiveProject(t);
|
|
@@ -6746,7 +6746,7 @@ async function zl({ action: e, projectId: t }, o) {
|
|
|
6746
6746
|
}
|
|
6747
6747
|
}
|
|
6748
6748
|
}
|
|
6749
|
-
const
|
|
6749
|
+
const ql = {
|
|
6750
6750
|
action: s.enum(["move-to-workspace", "move-to-personal"]).describe("The action to perform on the project."),
|
|
6751
6751
|
projectId: s.string().min(1).describe("The ID of the project to move."),
|
|
6752
6752
|
workspaceId: s.string().min(1).optional().describe("The target workspace ID. Required when action is move-to-workspace."),
|
|
@@ -6754,14 +6754,14 @@ const Gl = {
|
|
|
6754
6754
|
visibility: s.enum(["restricted", "team", "public"]).optional().describe(
|
|
6755
6755
|
"Optional access visibility for the project in the workspace (restricted, team, or public)."
|
|
6756
6756
|
)
|
|
6757
|
-
},
|
|
6757
|
+
}, Yl = {
|
|
6758
6758
|
project: be.describe("The moved project."),
|
|
6759
6759
|
success: s.boolean().describe("Whether the move was successful.")
|
|
6760
|
-
},
|
|
6760
|
+
}, Vl = {
|
|
6761
6761
|
name: y.PROJECT_MOVE,
|
|
6762
6762
|
description: "Move a project between personal and workspace contexts.",
|
|
6763
|
-
parameters:
|
|
6764
|
-
outputSchema:
|
|
6763
|
+
parameters: ql,
|
|
6764
|
+
outputSchema: Yl,
|
|
6765
6765
|
// Destructive: move-to-personal removes every collaborator from the project.
|
|
6766
6766
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !0 },
|
|
6767
6767
|
async execute(e, t) {
|
|
@@ -6791,12 +6791,12 @@ const Gl = {
|
|
|
6791
6791
|
};
|
|
6792
6792
|
}
|
|
6793
6793
|
};
|
|
6794
|
-
function
|
|
6794
|
+
function ar(e, t) {
|
|
6795
6795
|
const o = new Map(e.map((f) => [f.id, f])), r = new Set(t.map((f) => f.id));
|
|
6796
6796
|
for (const f of r)
|
|
6797
6797
|
if (!o.has(f))
|
|
6798
6798
|
throw new Error(`Sibling id=${f} is not in the list being reordered`);
|
|
6799
|
-
const n = e.every((f) => f.key !== null), i = [...e].sort(n ?
|
|
6799
|
+
const n = e.every((f) => f.key !== null), i = [...e].sort(n ? Ql : eu).filter((f) => !r.has(f.id)), c = [...t].sort((f, h) => f.position - h.position);
|
|
6800
6800
|
let d;
|
|
6801
6801
|
for (const { id: f, position: h } of c) {
|
|
6802
6802
|
const m = o.get(f);
|
|
@@ -6804,8 +6804,8 @@ function ir(e, t) {
|
|
|
6804
6804
|
const b = d?.position === h ? d.index + 1 : h, g = Math.min(b, i.length);
|
|
6805
6805
|
i.splice(g, 0, m), d = { position: h, index: g };
|
|
6806
6806
|
}
|
|
6807
|
-
if (!n || !
|
|
6808
|
-
return
|
|
6807
|
+
if (!n || !Xl(i, r))
|
|
6808
|
+
return Zl(i);
|
|
6809
6809
|
const u = /* @__PURE__ */ new Map();
|
|
6810
6810
|
let l = [], p = null;
|
|
6811
6811
|
for (const f of i) {
|
|
@@ -6813,12 +6813,12 @@ function ir(e, t) {
|
|
|
6813
6813
|
l.push(f);
|
|
6814
6814
|
continue;
|
|
6815
6815
|
}
|
|
6816
|
-
|
|
6816
|
+
Mo(l, p, f.key, u), l = [], p = f.key;
|
|
6817
6817
|
}
|
|
6818
|
-
return
|
|
6818
|
+
return Mo(l, p, null, u), u;
|
|
6819
6819
|
}
|
|
6820
|
-
function
|
|
6821
|
-
if (e.length === 0 ||
|
|
6820
|
+
function Mo(e, t, o, r) {
|
|
6821
|
+
if (e.length === 0 || Jl(e, t, o))
|
|
6822
6822
|
return;
|
|
6823
6823
|
const n = ss(t, o, e.length);
|
|
6824
6824
|
e.forEach((a, i) => {
|
|
@@ -6826,7 +6826,7 @@ function Lo(e, t, o, r) {
|
|
|
6826
6826
|
c !== void 0 && c !== a.key && r.set(a.id, c);
|
|
6827
6827
|
});
|
|
6828
6828
|
}
|
|
6829
|
-
function
|
|
6829
|
+
function Jl(e, t, o) {
|
|
6830
6830
|
let r = t;
|
|
6831
6831
|
for (const { key: n } of e) {
|
|
6832
6832
|
if (n === null || r !== null && n <= r)
|
|
@@ -6835,7 +6835,7 @@ function Vl(e, t, o) {
|
|
|
6835
6835
|
}
|
|
6836
6836
|
return o === null || r !== null && r < o;
|
|
6837
6837
|
}
|
|
6838
|
-
function
|
|
6838
|
+
function Xl(e, t) {
|
|
6839
6839
|
let o = null;
|
|
6840
6840
|
for (const { id: r, key: n } of e)
|
|
6841
6841
|
if (!t.has(r)) {
|
|
@@ -6845,21 +6845,21 @@ function Jl(e, t) {
|
|
|
6845
6845
|
}
|
|
6846
6846
|
return !0;
|
|
6847
6847
|
}
|
|
6848
|
-
function
|
|
6848
|
+
function Zl(e) {
|
|
6849
6849
|
const t = ss(null, null, e.length), o = /* @__PURE__ */ new Map();
|
|
6850
6850
|
return e.forEach((r, n) => {
|
|
6851
6851
|
const a = t[n];
|
|
6852
6852
|
a !== void 0 && a !== r.key && o.set(r.id, a);
|
|
6853
6853
|
}), o;
|
|
6854
6854
|
}
|
|
6855
|
-
function
|
|
6855
|
+
function Ql(e, t) {
|
|
6856
6856
|
const o = e.key ?? "", r = t.key ?? "";
|
|
6857
6857
|
return o < r ? -1 : o > r ? 1 : 0;
|
|
6858
6858
|
}
|
|
6859
|
-
function
|
|
6859
|
+
function eu(e, t) {
|
|
6860
6860
|
return e.legacyOrder - t.legacyOrder;
|
|
6861
6861
|
}
|
|
6862
|
-
const
|
|
6862
|
+
const ir = ["project", "section"], tu = s.object({
|
|
6863
6863
|
id: s.string().min(1).describe("The ID of the entity."),
|
|
6864
6864
|
order: s.number().int().min(0).optional().describe(
|
|
6865
6865
|
"0-based position among its siblings after the reorder: 0 is first, past the end is last. Unlisted siblings keep their relative order."
|
|
@@ -6867,25 +6867,25 @@ const cr = ["project", "section"], eu = s.object({
|
|
|
6867
6867
|
parentId: s.string().min(1).optional().describe(
|
|
6868
6868
|
'Move a personal project under this parent project ID, or "root" for the top level. Personal projects only.'
|
|
6869
6869
|
)
|
|
6870
|
-
}),
|
|
6871
|
-
type: s.enum(
|
|
6870
|
+
}), ou = {
|
|
6871
|
+
type: s.enum(ir).describe(
|
|
6872
6872
|
'"project": personal projects among the siblings under their parent, or workspace projects within their folder. "section": sections within their project.'
|
|
6873
6873
|
),
|
|
6874
|
-
items: s.array(
|
|
6874
|
+
items: s.array(tu).min(1).max(D.BULK_ACTIONS_PER_OPERATION).describe(
|
|
6875
6875
|
"Each item needs order and/or parentId. Moves happen first, so order is a position under the new parent."
|
|
6876
6876
|
)
|
|
6877
|
-
},
|
|
6878
|
-
type: s.enum(
|
|
6877
|
+
}, su = {
|
|
6878
|
+
type: s.enum(ir).describe("The type of entity that was reordered/moved."),
|
|
6879
6879
|
movedCount: s.number().describe("The number of entities moved to a new parent."),
|
|
6880
6880
|
reorderedCount: s.number().describe("The number of entities reordered."),
|
|
6881
6881
|
affectedIds: s.array(s.string()).describe("The IDs of the entities moved or reordered."),
|
|
6882
6882
|
failures: s.array(_).describe("Entities that could not be moved or reordered, with the reason for each."),
|
|
6883
6883
|
success: s.boolean().describe("Whether every entity was moved and reordered as asked.")
|
|
6884
|
-
},
|
|
6884
|
+
}, ru = {
|
|
6885
6885
|
name: y.REORDER_OBJECTS,
|
|
6886
6886
|
description: 'Reorder projects or sections, and optionally move personal projects to a new parent. Personal projects: order places a project among its siblings; parentId moves it ("root" for top level). Workspace projects: order places a project within its folder, in the shared default ordering every member sees; needs permission to reorder the workspace. Sections: order places a section within its project.',
|
|
6887
|
-
parameters:
|
|
6888
|
-
outputSchema:
|
|
6887
|
+
parameters: ou,
|
|
6888
|
+
outputSchema: su,
|
|
6889
6889
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
|
|
6890
6890
|
async execute(e, t) {
|
|
6891
6891
|
const { type: o, items: r } = e, n = /* @__PURE__ */ new Set();
|
|
@@ -6901,7 +6901,7 @@ const cr = ["project", "section"], eu = s.object({
|
|
|
6901
6901
|
`parentId is only supported when type is "project", but type is "${o}".`
|
|
6902
6902
|
);
|
|
6903
6903
|
}
|
|
6904
|
-
const a = o === "project" ? await
|
|
6904
|
+
const a = o === "project" ? await nu(t, r) : await au(t, r);
|
|
6905
6905
|
O(y.REORDER_OBJECTS, r.length, a.failures);
|
|
6906
6906
|
const i = o === "project" ? "projects" : "sections", c = r.map((l) => l.id).filter((l) => a.movedIds.has(l) || a.reorderedIds.has(l)), d = [];
|
|
6907
6907
|
a.movedIds.size > 0 && d.push(`moved ${a.movedIds.size}`), (a.reorderedIds.size > 0 || d.length === 0) && d.push(`reordered ${a.reorderedIds.size}`);
|
|
@@ -6919,12 +6919,12 @@ const cr = ["project", "section"], eu = s.object({
|
|
|
6919
6919
|
};
|
|
6920
6920
|
}
|
|
6921
6921
|
};
|
|
6922
|
-
async function
|
|
6922
|
+
async function nu(e, t) {
|
|
6923
6923
|
const o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), n = [];
|
|
6924
|
-
let a = await
|
|
6924
|
+
let a = await Ho(e);
|
|
6925
6925
|
const i = [];
|
|
6926
6926
|
for (const m of t) {
|
|
6927
|
-
const b = a.get(m.id), g = b ?
|
|
6927
|
+
const b = a.get(m.id), g = b ? iu(b, m) : "Project not found, or you do not have access to it.";
|
|
6928
6928
|
g ? n.push({ item: m.id, error: g }) : i.push(m);
|
|
6929
6929
|
}
|
|
6930
6930
|
const c = i.filter((m) => m.parentId !== void 0), d = /* @__PURE__ */ new Set();
|
|
@@ -6950,7 +6950,7 @@ async function ru(e, t) {
|
|
|
6950
6950
|
return { movedIds: o, reorderedIds: r, failures: n };
|
|
6951
6951
|
if (o.size > 0)
|
|
6952
6952
|
try {
|
|
6953
|
-
a = await
|
|
6953
|
+
a = await Ho(e);
|
|
6954
6954
|
} catch (m) {
|
|
6955
6955
|
const b = K(m);
|
|
6956
6956
|
for (const g of u)
|
|
@@ -6960,7 +6960,7 @@ async function ru(e, t) {
|
|
|
6960
6960
|
});
|
|
6961
6961
|
return { movedIds: o, reorderedIds: r, failures: n };
|
|
6962
6962
|
}
|
|
6963
|
-
const l =
|
|
6963
|
+
const l = cr([...a.values()].filter(cu), Fo), p = /* @__PURE__ */ new Map(), f = [];
|
|
6964
6964
|
for (const m of u) {
|
|
6965
6965
|
const b = a.get(m.id);
|
|
6966
6966
|
if (!b) {
|
|
@@ -6968,12 +6968,12 @@ async function ru(e, t) {
|
|
|
6968
6968
|
continue;
|
|
6969
6969
|
}
|
|
6970
6970
|
f.push(m);
|
|
6971
|
-
const g =
|
|
6971
|
+
const g = Fo(b), w = p.get(g) ?? [];
|
|
6972
6972
|
w.push({ id: m.id, position: m.order }), p.set(g, w);
|
|
6973
6973
|
}
|
|
6974
6974
|
const h = [];
|
|
6975
6975
|
for (const [m, b] of p) {
|
|
6976
|
-
const g = l.get(m) ?? [], w =
|
|
6976
|
+
const g = l.get(m) ?? [], w = ar(g.map(du), b);
|
|
6977
6977
|
for (const [I, k] of w) {
|
|
6978
6978
|
const S = a.get(I);
|
|
6979
6979
|
h.push({
|
|
@@ -6985,10 +6985,10 @@ async function ru(e, t) {
|
|
|
6985
6985
|
});
|
|
6986
6986
|
}
|
|
6987
6987
|
}
|
|
6988
|
-
return await
|
|
6988
|
+
return await dr(e, h, f, r, n), { movedIds: o, reorderedIds: r, failures: n };
|
|
6989
6989
|
}
|
|
6990
|
-
async function
|
|
6991
|
-
const o = /* @__PURE__ */ new Set(), r = [], n = await
|
|
6990
|
+
async function au(e, t) {
|
|
6991
|
+
const o = /* @__PURE__ */ new Set(), r = [], n = await lu(e), a = cr(
|
|
6992
6992
|
[...n.values()].filter((l) => !l.isDeleted && !l.isArchived),
|
|
6993
6993
|
(l) => l.projectId
|
|
6994
6994
|
), i = t.filter((l) => l.order !== void 0), c = /* @__PURE__ */ new Map(), d = [];
|
|
@@ -7011,7 +7011,7 @@ async function nu(e, t) {
|
|
|
7011
7011
|
}
|
|
7012
7012
|
const u = [];
|
|
7013
7013
|
for (const [l, p] of c) {
|
|
7014
|
-
const f = a.get(l) ?? [], h =
|
|
7014
|
+
const f = a.get(l) ?? [], h = ar(
|
|
7015
7015
|
f.map((m) => ({
|
|
7016
7016
|
id: m.id,
|
|
7017
7017
|
key: m.orderKey ?? null,
|
|
@@ -7022,9 +7022,9 @@ async function nu(e, t) {
|
|
|
7022
7022
|
for (const [m, b] of h)
|
|
7023
7023
|
u.push({ id: m, command: Y("section_update", { id: m, orderKey: b }) });
|
|
7024
7024
|
}
|
|
7025
|
-
return await
|
|
7025
|
+
return await dr(e, u, d, o, r), { movedIds: /* @__PURE__ */ new Set(), reorderedIds: o, failures: r };
|
|
7026
7026
|
}
|
|
7027
|
-
function
|
|
7027
|
+
function cr(e, t) {
|
|
7028
7028
|
const o = /* @__PURE__ */ new Map();
|
|
7029
7029
|
for (const r of e) {
|
|
7030
7030
|
const n = t(r), a = o.get(n) ?? [];
|
|
@@ -7032,7 +7032,7 @@ function dr(e, t) {
|
|
|
7032
7032
|
}
|
|
7033
7033
|
return o;
|
|
7034
7034
|
}
|
|
7035
|
-
async function
|
|
7035
|
+
async function dr(e, t, o, r, n) {
|
|
7036
7036
|
const a = /* @__PURE__ */ new Set();
|
|
7037
7037
|
if (t.length > 0) {
|
|
7038
7038
|
const { outcomes: i } = await V(
|
|
@@ -7047,7 +7047,7 @@ async function lr(e, t, o, r, n) {
|
|
|
7047
7047
|
for (const { id: i } of o)
|
|
7048
7048
|
a.has(i) || r.add(i);
|
|
7049
7049
|
}
|
|
7050
|
-
function
|
|
7050
|
+
function iu(e, t) {
|
|
7051
7051
|
if (e.isDeleted)
|
|
7052
7052
|
return "Project not found, or you do not have access to it.";
|
|
7053
7053
|
if (e.isArchived)
|
|
@@ -7057,49 +7057,49 @@ function au(e, t) {
|
|
|
7057
7057
|
if (W(e) && t.parentId !== void 0)
|
|
7058
7058
|
return "parentId is only supported for personal projects. Workspace projects are ordered within their folder; omit parentId to reorder it there.";
|
|
7059
7059
|
}
|
|
7060
|
-
function
|
|
7060
|
+
function cu(e) {
|
|
7061
7061
|
return e.isDeleted || e.isArchived ? !1 : W(e) || !e.inboxProject;
|
|
7062
7062
|
}
|
|
7063
|
-
function
|
|
7063
|
+
function Fo(e) {
|
|
7064
7064
|
return W(e) ? `workspace:${e.workspaceId}:${e.folderId ?? "root"}` : `personal:${e.parentId ?? "root"}`;
|
|
7065
7065
|
}
|
|
7066
|
-
function
|
|
7066
|
+
function du(e) {
|
|
7067
7067
|
return W(e) ? {
|
|
7068
7068
|
id: e.id,
|
|
7069
7069
|
key: e.defaultOrderKey ?? null,
|
|
7070
7070
|
legacyOrder: e.defaultOrder
|
|
7071
7071
|
} : { id: e.id, key: e.orderKey ?? null, legacyOrder: e.childOrder };
|
|
7072
7072
|
}
|
|
7073
|
-
async function
|
|
7073
|
+
async function Ho(e) {
|
|
7074
7074
|
const t = await j(
|
|
7075
7075
|
() => e.sync({ resourceTypes: ["projects"], syncToken: "*" })
|
|
7076
7076
|
);
|
|
7077
7077
|
return new Map((t.projects ?? []).map((o) => [o.id, o]));
|
|
7078
7078
|
}
|
|
7079
|
-
async function
|
|
7079
|
+
async function lu(e) {
|
|
7080
7080
|
const t = await j(
|
|
7081
7081
|
() => e.sync({ resourceTypes: ["sections"], syncToken: "*" })
|
|
7082
7082
|
);
|
|
7083
7083
|
return new Map((t.sections ?? []).map((o) => [o.id, o]));
|
|
7084
7084
|
}
|
|
7085
|
-
const
|
|
7085
|
+
const uu = s.object({
|
|
7086
7086
|
id: s.string().min(1).describe("The ID of the task to reschedule."),
|
|
7087
7087
|
date: s.string().min(1).describe(
|
|
7088
7088
|
"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."
|
|
7089
7089
|
),
|
|
7090
7090
|
duration: s.string().optional().describe('Optional new duration, e.g. for time-blocking: "15m", "1h", "2h30m".')
|
|
7091
|
-
}),
|
|
7092
|
-
tasks: s.array(
|
|
7093
|
-
},
|
|
7091
|
+
}), pu = {
|
|
7092
|
+
tasks: s.array(uu).min(1).max(D.BULK_ACTIONS_PER_OPERATION).describe("The tasks to reschedule with their new dates.")
|
|
7093
|
+
}, hu = {
|
|
7094
7094
|
tasks: s.array(oe).describe("The rescheduled tasks."),
|
|
7095
7095
|
totalCount: s.number().describe("The total number of tasks rescheduled."),
|
|
7096
7096
|
rescheduledTaskIds: s.array(s.string()).describe("The IDs of the rescheduled tasks."),
|
|
7097
7097
|
failures: s.array(_).describe("Tasks that could not be rescheduled, with reasons.")
|
|
7098
|
-
},
|
|
7098
|
+
}, mu = {
|
|
7099
7099
|
name: y.RESCHEDULE_TASKS,
|
|
7100
7100
|
description: "Reschedule tasks to new dates while preserving recurring schedules. Unlike update-tasks (which replaces the entire due string and can wipe recurrence), this tool changes only the date (and duration, if given), keeping recurrence patterns intact. Use this when moving recurring tasks to a different date or time without altering their repeat pattern. Without a due date, the deadline moves.",
|
|
7101
|
-
parameters:
|
|
7102
|
-
outputSchema:
|
|
7101
|
+
parameters: pu,
|
|
7102
|
+
outputSchema: hu,
|
|
7103
7103
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
7104
7104
|
async execute(e, t) {
|
|
7105
7105
|
const { tasks: o } = e, r = o.map(
|
|
@@ -7110,7 +7110,7 @@ const lu = s.object({
|
|
|
7110
7110
|
n.push(...i.failures);
|
|
7111
7111
|
const c = [];
|
|
7112
7112
|
for (const { item: h, index: m, value: b } of i.succeeded) {
|
|
7113
|
-
const g =
|
|
7113
|
+
const g = fu(h.date, b);
|
|
7114
7114
|
g && c.push({
|
|
7115
7115
|
id: h.id,
|
|
7116
7116
|
command: Y("item_update", {
|
|
@@ -7163,11 +7163,11 @@ Could not read back ${l.join(", ")}: ${p}` : Yt("Rescheduled", u, {
|
|
|
7163
7163
|
};
|
|
7164
7164
|
}
|
|
7165
7165
|
};
|
|
7166
|
-
function
|
|
7166
|
+
function fu(e, t) {
|
|
7167
7167
|
if (t.due)
|
|
7168
7168
|
return {
|
|
7169
7169
|
due: {
|
|
7170
|
-
date:
|
|
7170
|
+
date: bu(e, t.due),
|
|
7171
7171
|
string: t.due.string,
|
|
7172
7172
|
isRecurring: t.due.isRecurring,
|
|
7173
7173
|
timezone: t.due.timezone ?? void 0,
|
|
@@ -7177,16 +7177,16 @@ function mu(e, t) {
|
|
|
7177
7177
|
if (t.deadline)
|
|
7178
7178
|
return { deadline: { date: e.slice(0, 10) } };
|
|
7179
7179
|
}
|
|
7180
|
-
function
|
|
7180
|
+
function bu(e, t) {
|
|
7181
7181
|
if (/^\d{4}-\d{2}-\d{2}$/.test(e) && t.datetime) {
|
|
7182
7182
|
const r = t.datetime.substring(10);
|
|
7183
7183
|
return e + r;
|
|
7184
7184
|
}
|
|
7185
7185
|
return e;
|
|
7186
7186
|
}
|
|
7187
|
-
const
|
|
7187
|
+
const gu = {
|
|
7188
7188
|
query: s.string().min(1).describe("The search query string to find tasks and projects.")
|
|
7189
|
-
},
|
|
7189
|
+
}, yu = {
|
|
7190
7190
|
results: s.array(
|
|
7191
7191
|
s.object({
|
|
7192
7192
|
id: s.string().describe("The ID of the result."),
|
|
@@ -7195,11 +7195,11 @@ const bu = {
|
|
|
7195
7195
|
})
|
|
7196
7196
|
).describe("The search results."),
|
|
7197
7197
|
totalCount: s.number().describe("Total number of results found.")
|
|
7198
|
-
},
|
|
7198
|
+
}, wu = {
|
|
7199
7199
|
name: y.SEARCH,
|
|
7200
7200
|
description: "Search across tasks and projects in Todoist. Returns a list of relevant results with IDs, titles, and URLs.",
|
|
7201
|
-
parameters:
|
|
7202
|
-
outputSchema:
|
|
7201
|
+
parameters: gu,
|
|
7202
|
+
outputSchema: yu,
|
|
7203
7203
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
7204
7204
|
async execute(e, t) {
|
|
7205
7205
|
const { query: o } = e, [r, n] = await Promise.all([
|
|
@@ -7215,21 +7215,21 @@ const bu = {
|
|
|
7215
7215
|
a.push({
|
|
7216
7216
|
id: `task:${i.id}`,
|
|
7217
7217
|
title: i.content,
|
|
7218
|
-
url:
|
|
7218
|
+
url: es(i.id)
|
|
7219
7219
|
});
|
|
7220
7220
|
for (const i of n)
|
|
7221
7221
|
a.push({
|
|
7222
7222
|
id: `project:${i.id}`,
|
|
7223
7223
|
title: i.name,
|
|
7224
|
-
url:
|
|
7224
|
+
url: ts(i.id)
|
|
7225
7225
|
});
|
|
7226
7226
|
return {
|
|
7227
7227
|
textContent: JSON.stringify({ results: a }),
|
|
7228
7228
|
structuredContent: { results: a, totalCount: a.length }
|
|
7229
7229
|
};
|
|
7230
7230
|
}
|
|
7231
|
-
},
|
|
7232
|
-
message: s.string().trim().min(1).max(
|
|
7231
|
+
}, Tu = 80, ku = {
|
|
7232
|
+
message: s.string().trim().min(1).max(Tu).optional().describe("Omit for an emoji-only status."),
|
|
7233
7233
|
emoji: s.string().trim().min(1).optional().describe("A Unicode emoji, such as 🏝️."),
|
|
7234
7234
|
activeUntil: s.string().trim().optional().describe(
|
|
7235
7235
|
"When it ends: a future ISO 8601 timestamp with Z or an offset, e.g. 2026-11-10T00:00:00+00:00. Omit for no end."
|
|
@@ -7237,20 +7237,20 @@ const bu = {
|
|
|
7237
7237
|
pauseNotifications: s.boolean().optional().describe("Hold back Comms notifications while active. They are not sent later."),
|
|
7238
7238
|
pauseActivity: s.boolean().optional().describe("Pause Karma and streaks while active."),
|
|
7239
7239
|
clear: s.boolean().optional().describe("Remove the status. Use alone.")
|
|
7240
|
-
},
|
|
7240
|
+
}, Iu = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(Z|([+-])(\d{2}):(\d{2}))$/i, vu = -720, Su = 840;
|
|
7241
7241
|
function dt(e) {
|
|
7242
7242
|
return new Error(
|
|
7243
7243
|
`activeUntil must be an ISO 8601 timestamp with Z or an offset, such as "2026-11-10T00:00:00+00:00". Got "${e}".`
|
|
7244
7244
|
);
|
|
7245
7245
|
}
|
|
7246
|
-
function
|
|
7247
|
-
const o =
|
|
7246
|
+
function Cu(e, t) {
|
|
7247
|
+
const o = Iu.exec(e);
|
|
7248
7248
|
if (!o)
|
|
7249
7249
|
throw dt(e);
|
|
7250
7250
|
const [, r, n, a, i, c, d = "0", u = ""] = o, [l, p, f, h, m, b] = [r, n, a, i, c, d].map(Number), g = /* @__PURE__ */ new Date(0);
|
|
7251
7251
|
g.setUTCFullYear(l, p - 1, f), g.setUTCHours(h, m, b);
|
|
7252
7252
|
const w = g.getUTCFullYear() === l && g.getUTCMonth() === p - 1 && g.getUTCDate() === f && g.getUTCHours() === h && g.getUTCMinutes() === m && g.getUTCSeconds() === b, I = u.toUpperCase() === "Z" ? 0 : et(u);
|
|
7253
|
-
if (!w || I <
|
|
7253
|
+
if (!w || I < vu || I > Su)
|
|
7254
7254
|
throw dt(e);
|
|
7255
7255
|
const k = new Date(e);
|
|
7256
7256
|
if (Number.isNaN(k.getTime()))
|
|
@@ -7259,8 +7259,8 @@ function Su(e, t) {
|
|
|
7259
7259
|
throw new Error(`activeUntil must be in the future. Got "${e}".`);
|
|
7260
7260
|
return k.toISOString();
|
|
7261
7261
|
}
|
|
7262
|
-
const
|
|
7263
|
-
function
|
|
7262
|
+
const Wo = { scope: { mode: "all" } };
|
|
7263
|
+
function ju(e, t) {
|
|
7264
7264
|
const { clear: o, message: r, emoji: n, activeUntil: a, pauseNotifications: i, pauseActivity: c } = e;
|
|
7265
7265
|
if (o) {
|
|
7266
7266
|
if (r !== void 0 || n !== void 0 || a !== void 0 || i === !0 || c === !0)
|
|
@@ -7274,28 +7274,28 @@ function Cu(e, t) {
|
|
|
7274
7274
|
return {
|
|
7275
7275
|
message: r ?? null,
|
|
7276
7276
|
emoji: n ?? null,
|
|
7277
|
-
activeUntil: a !== void 0 ?
|
|
7277
|
+
activeUntil: a !== void 0 ? Cu(a, t) : null,
|
|
7278
7278
|
effects: i || c ? {
|
|
7279
|
-
pauseNotifications: i ?
|
|
7280
|
-
pauseActivity: c ?
|
|
7279
|
+
pauseNotifications: i ? Wo : null,
|
|
7280
|
+
pauseActivity: c ? Wo : null
|
|
7281
7281
|
} : null
|
|
7282
7282
|
};
|
|
7283
7283
|
}
|
|
7284
|
-
function
|
|
7284
|
+
function Bo(e) {
|
|
7285
7285
|
return e ? e.replace(/\uFE0F/g, "") : null;
|
|
7286
7286
|
}
|
|
7287
|
-
function
|
|
7287
|
+
function $u(e, t) {
|
|
7288
7288
|
const o = e.activeUntil ? new Date(e.activeUntil).getTime() : null, r = t.activeUntil ? new Date(t.activeUntil).getTime() : null;
|
|
7289
7289
|
return (
|
|
7290
7290
|
// An emoji-only status may be held with its message null or left out.
|
|
7291
|
-
(e.message ?? null) === (t.message ?? null) &&
|
|
7291
|
+
(e.message ?? null) === (t.message ?? null) && Bo(e.emoji) === Bo(t.emoji) && o === r && !!e.effects?.pauseNotifications == !!t.effects?.pauseNotifications && !!e.effects?.pauseActivity == !!t.effects?.pauseActivity
|
|
7292
7292
|
);
|
|
7293
7293
|
}
|
|
7294
|
-
const
|
|
7294
|
+
const Eu = {
|
|
7295
7295
|
name: y.SET_USER_STATUS,
|
|
7296
7296
|
description: "Set or clear the user's status, shown next to their name in Todoist and Comms. It needs a message, an emoji or both. Replaces the whole status: any field omitted is removed, not kept. Use clear to remove the status.",
|
|
7297
|
-
parameters:
|
|
7298
|
-
outputSchema:
|
|
7297
|
+
parameters: ku,
|
|
7298
|
+
outputSchema: sr,
|
|
7299
7299
|
annotations: {
|
|
7300
7300
|
readOnlyHint: !1,
|
|
7301
7301
|
destructiveHint: !0,
|
|
@@ -7303,12 +7303,12 @@ const $u = {
|
|
|
7303
7303
|
openWorldHint: !0
|
|
7304
7304
|
},
|
|
7305
7305
|
async execute(e, t) {
|
|
7306
|
-
const o =
|
|
7306
|
+
const o = ju(e, /* @__PURE__ */ new Date()), {
|
|
7307
7307
|
outcomes: [r]
|
|
7308
7308
|
} = await V(t, [Y("user_update", { status: o })]);
|
|
7309
7309
|
if (r?.status !== "fulfilled")
|
|
7310
7310
|
throw r?.reason ?? new Error("Todoist did not report whether the status was applied.");
|
|
7311
|
-
const n = await
|
|
7311
|
+
const n = await rr(t).catch(() => {
|
|
7312
7312
|
throw new Error(
|
|
7313
7313
|
`The status was written, but reading it back failed, so it is unconfirmed. Use ${y.GET_USER_STATUS} to check it.`
|
|
7314
7314
|
);
|
|
@@ -7324,30 +7324,30 @@ const $u = {
|
|
|
7324
7324
|
throw new Error(
|
|
7325
7325
|
"Todoist accepted the status but reports no active status, so it may have expired already."
|
|
7326
7326
|
);
|
|
7327
|
-
if (
|
|
7327
|
+
if (!$u(n, o))
|
|
7328
7328
|
throw new Error(
|
|
7329
7329
|
`Todoist accepted the status but reports a different one. Another app may have changed it at the same moment; use ${y.GET_USER_STATUS} to see it.`
|
|
7330
7330
|
);
|
|
7331
7331
|
return Et(n, "Status set");
|
|
7332
7332
|
}
|
|
7333
|
-
}, Eu = {
|
|
7334
|
-
ids: s.array(s.string().min(1)).min(1).max(D.BULK_ACTIONS_PER_OPERATION).describe("The IDs of the tasks to uncomplete.")
|
|
7335
7333
|
}, Au = {
|
|
7334
|
+
ids: s.array(s.string().min(1)).min(1).max(D.BULK_ACTIONS_PER_OPERATION).describe("The IDs of the tasks to uncomplete.")
|
|
7335
|
+
}, Du = {
|
|
7336
7336
|
uncompleted: s.array(s.string()).describe("The IDs of successfully uncompleted tasks."),
|
|
7337
7337
|
failures: s.array(_).describe("Failed task uncompletion with error details."),
|
|
7338
7338
|
totalRequested: s.number().describe("The total number of tasks requested to uncomplete."),
|
|
7339
7339
|
successCount: s.number().describe("The number of successfully uncompleted tasks."),
|
|
7340
7340
|
failureCount: s.number().describe("The number of failed task uncompletions.")
|
|
7341
|
-
},
|
|
7341
|
+
}, xu = {
|
|
7342
7342
|
name: y.UNCOMPLETE_TASKS,
|
|
7343
7343
|
description: "Uncomplete (reopen) one or more completed tasks by their IDs.",
|
|
7344
|
-
parameters:
|
|
7345
|
-
outputSchema:
|
|
7344
|
+
parameters: Au,
|
|
7345
|
+
outputSchema: Du,
|
|
7346
7346
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
7347
7347
|
async execute(e, t) {
|
|
7348
|
-
const o = await
|
|
7348
|
+
const o = await Ou(t, e.ids), { succeeded: r, failures: n } = U(e.ids, o, (c) => c), a = r.map(({ item: c }) => c);
|
|
7349
7349
|
return O(y.UNCOMPLETE_TASKS, e.ids.length, n), {
|
|
7350
|
-
textContent:
|
|
7350
|
+
textContent: _u({
|
|
7351
7351
|
uncompleted: a,
|
|
7352
7352
|
failures: n,
|
|
7353
7353
|
args: e
|
|
@@ -7362,7 +7362,7 @@ const $u = {
|
|
|
7362
7362
|
};
|
|
7363
7363
|
}
|
|
7364
7364
|
};
|
|
7365
|
-
async function
|
|
7365
|
+
async function Ou(e, t) {
|
|
7366
7366
|
const o = [...new Set(t)], { outcomes: r } = await V(
|
|
7367
7367
|
e,
|
|
7368
7368
|
o.map((a) => Y("item_uncomplete", { id: a })),
|
|
@@ -7375,7 +7375,7 @@ async function xu(e, t) {
|
|
|
7375
7375
|
}
|
|
7376
7376
|
);
|
|
7377
7377
|
}
|
|
7378
|
-
function
|
|
7378
|
+
function _u({
|
|
7379
7379
|
uncompleted: e,
|
|
7380
7380
|
failures: t,
|
|
7381
7381
|
args: o
|
|
@@ -7389,13 +7389,13 @@ function Ou({
|
|
|
7389
7389
|
failures: t
|
|
7390
7390
|
});
|
|
7391
7391
|
}
|
|
7392
|
-
const
|
|
7392
|
+
const Uu = s.object({
|
|
7393
7393
|
id: s.string().min(1).describe("The ID of the comment to update."),
|
|
7394
7394
|
content: s.string().min(1).describe("The new content for the comment.")
|
|
7395
|
-
}),
|
|
7396
|
-
comments: s.array(
|
|
7397
|
-
},
|
|
7398
|
-
comments: s.array(
|
|
7395
|
+
}), Pu = {
|
|
7396
|
+
comments: s.array(Uu).min(1).max(D.ITEMS_PER_OPERATION).describe("The comments to update.")
|
|
7397
|
+
}, Ru = {
|
|
7398
|
+
comments: s.array(Le).describe("The updated comments."),
|
|
7399
7399
|
totalCount: s.number().describe("The total number of comments updated."),
|
|
7400
7400
|
updatedCommentIds: s.array(s.string()).describe("The IDs of the updated comments."),
|
|
7401
7401
|
failures: s.array(_).describe("Comments that could not be updated, with the reason for each."),
|
|
@@ -7403,11 +7403,11 @@ const _u = s.object({
|
|
|
7403
7403
|
updateCount: s.number().describe("The number of comments updated."),
|
|
7404
7404
|
failureCount: s.number()
|
|
7405
7405
|
}).describe("Summary of operations performed.")
|
|
7406
|
-
},
|
|
7406
|
+
}, Nu = {
|
|
7407
7407
|
name: y.UPDATE_COMMENTS,
|
|
7408
7408
|
description: "Update multiple existing comments with new content.",
|
|
7409
|
-
parameters:
|
|
7410
|
-
outputSchema:
|
|
7409
|
+
parameters: Pu,
|
|
7410
|
+
outputSchema: Ru,
|
|
7411
7411
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
7412
7412
|
async execute(e, t) {
|
|
7413
7413
|
const { comments: o } = e, r = await Promise.allSettled(
|
|
@@ -7416,10 +7416,10 @@ const _u = s.object({
|
|
|
7416
7416
|
() => t.updateComment(d.id, { content: d.content })
|
|
7417
7417
|
)
|
|
7418
7418
|
)
|
|
7419
|
-
), { succeeded: n, failures: a } = U(o, r, (d) => d.id), i = n.map(({ value: d }) =>
|
|
7419
|
+
), { succeeded: n, failures: a } = U(o, r, (d) => d.id), i = n.map(({ value: d }) => Ne(d));
|
|
7420
7420
|
return O(y.UPDATE_COMMENTS, o.length, a), {
|
|
7421
7421
|
textContent: P(
|
|
7422
|
-
|
|
7422
|
+
Lu({ comments: i }),
|
|
7423
7423
|
a
|
|
7424
7424
|
),
|
|
7425
7425
|
structuredContent: {
|
|
@@ -7435,7 +7435,7 @@ const _u = s.object({
|
|
|
7435
7435
|
};
|
|
7436
7436
|
}
|
|
7437
7437
|
};
|
|
7438
|
-
function
|
|
7438
|
+
function Lu({ comments: e }) {
|
|
7439
7439
|
const t = e.filter((a) => a.taskId).length, o = e.filter((a) => a.projectId).length, r = [];
|
|
7440
7440
|
if (t > 0) {
|
|
7441
7441
|
const a = t > 1 ? "comments" : "comment";
|
|
@@ -7447,7 +7447,7 @@ function Nu({ comments: e }) {
|
|
|
7447
7447
|
}
|
|
7448
7448
|
return r.length > 0 ? `Updated ${r.join(" and ")}` : "No comments updated";
|
|
7449
7449
|
}
|
|
7450
|
-
const
|
|
7450
|
+
const Mu = s.object({
|
|
7451
7451
|
id: s.string().min(1).describe("The ID of the filter to update."),
|
|
7452
7452
|
name: s.string().min(1).optional().describe("The new name of the filter."),
|
|
7453
7453
|
query: s.string().min(1).optional().describe(
|
|
@@ -7460,11 +7460,11 @@ const Lu = s.object({
|
|
|
7460
7460
|
'A markdown description explaining what the filter is for. Use "remove" to clear the description; omit the field to leave it unchanged.'
|
|
7461
7461
|
)
|
|
7462
7462
|
).optional(),
|
|
7463
|
-
color:
|
|
7463
|
+
color: Ee,
|
|
7464
7464
|
isFavorite: s.boolean().optional().describe("Whether to mark the filter as a favorite.")
|
|
7465
|
-
}),
|
|
7466
|
-
filters: s.array(
|
|
7467
|
-
},
|
|
7465
|
+
}), Fu = {
|
|
7466
|
+
filters: s.array(Mu).min(1).max(D.ITEMS_PER_OPERATION).describe("The filters to update.")
|
|
7467
|
+
}, Hu = {
|
|
7468
7468
|
filters: s.array(Jt).describe(
|
|
7469
7469
|
"The updated filters, as read back after the update. Empty if they could not be read back; updatedFilterIds still lists what was updated."
|
|
7470
7470
|
),
|
|
@@ -7476,15 +7476,15 @@ const Lu = s.object({
|
|
|
7476
7476
|
skippedCount: s.number().describe("The number of filters skipped (no changes)."),
|
|
7477
7477
|
failureCount: s.number()
|
|
7478
7478
|
}).describe("Summary of operations performed.")
|
|
7479
|
-
},
|
|
7479
|
+
}, Wu = {
|
|
7480
7480
|
name: y.UPDATE_FILTERS,
|
|
7481
7481
|
description: "Update one or more existing personal filters with new values.",
|
|
7482
|
-
parameters:
|
|
7483
|
-
outputSchema:
|
|
7482
|
+
parameters: Fu,
|
|
7483
|
+
outputSchema: Hu,
|
|
7484
7484
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
7485
7485
|
async execute(e, t) {
|
|
7486
7486
|
const { filters: o } = e, r = [], a = o.map((m) => {
|
|
7487
|
-
const b =
|
|
7487
|
+
const b = zu(m);
|
|
7488
7488
|
return b !== null ? { kind: "skipped", reason: b } : (r.push(m), { kind: "updated", filter: m });
|
|
7489
7489
|
}).filter((m) => m.kind === "skipped").length;
|
|
7490
7490
|
if (r.length === 0)
|
|
@@ -7522,11 +7522,11 @@ const Lu = s.object({
|
|
|
7522
7522
|
error: f
|
|
7523
7523
|
});
|
|
7524
7524
|
}
|
|
7525
|
-
m && (p =
|
|
7525
|
+
m && (p = Bu(m, new Set(l)));
|
|
7526
7526
|
}
|
|
7527
7527
|
return {
|
|
7528
7528
|
textContent: P(
|
|
7529
|
-
|
|
7529
|
+
Ku({
|
|
7530
7530
|
filters: p,
|
|
7531
7531
|
updatedIds: l,
|
|
7532
7532
|
skippedCount: a,
|
|
@@ -7548,18 +7548,18 @@ const Lu = s.object({
|
|
|
7548
7548
|
};
|
|
7549
7549
|
}
|
|
7550
7550
|
};
|
|
7551
|
-
function
|
|
7551
|
+
function Bu(e, t) {
|
|
7552
7552
|
return e.filter((o) => !o.isDeleted && t.has(o.id)).map((o) => ({
|
|
7553
7553
|
id: o.id,
|
|
7554
7554
|
name: o.name,
|
|
7555
7555
|
query: o.query,
|
|
7556
7556
|
description: Us(o),
|
|
7557
|
-
color:
|
|
7557
|
+
color: Ae.parse(o.color),
|
|
7558
7558
|
isFavorite: o.isFavorite,
|
|
7559
7559
|
itemOrder: o.itemOrder
|
|
7560
7560
|
}));
|
|
7561
7561
|
}
|
|
7562
|
-
function
|
|
7562
|
+
function Ku({
|
|
7563
7563
|
filters: e,
|
|
7564
7564
|
updatedIds: t,
|
|
7565
7565
|
skippedCount: o,
|
|
@@ -7578,24 +7578,24 @@ ${i}`;
|
|
|
7578
7578
|
}
|
|
7579
7579
|
return a;
|
|
7580
7580
|
}
|
|
7581
|
-
function
|
|
7581
|
+
function zu({ id: e, ...t }) {
|
|
7582
7582
|
return Object.values(t).every((r) => r === void 0) ? "no-fields" : null;
|
|
7583
7583
|
}
|
|
7584
|
-
const
|
|
7584
|
+
const Gu = s.object({
|
|
7585
7585
|
id: s.string().min(1).describe("The ID of the folder to rename."),
|
|
7586
7586
|
name: s.string().min(1).describe("The new name of the folder.")
|
|
7587
|
-
}),
|
|
7588
|
-
folders: s.array(
|
|
7589
|
-
},
|
|
7587
|
+
}), qu = {
|
|
7588
|
+
folders: s.array(Gu).min(1).max(D.ITEMS_PER_OPERATION).describe("The folders to rename.")
|
|
7589
|
+
}, Yu = {
|
|
7590
7590
|
folders: s.array(zt).describe("The renamed folders."),
|
|
7591
7591
|
failures: s.array(_).describe("Folders that could not be renamed, with the reason for each."),
|
|
7592
7592
|
successCount: s.number(),
|
|
7593
7593
|
failureCount: s.number()
|
|
7594
|
-
},
|
|
7594
|
+
}, Vu = {
|
|
7595
7595
|
name: y.UPDATE_FOLDERS,
|
|
7596
7596
|
description: "Rename one or more workspace folders.",
|
|
7597
|
-
parameters:
|
|
7598
|
-
outputSchema:
|
|
7597
|
+
parameters: qu,
|
|
7598
|
+
outputSchema: Yu,
|
|
7599
7599
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !0 },
|
|
7600
7600
|
async execute({ folders: e }, t) {
|
|
7601
7601
|
const o = await Promise.allSettled(
|
|
@@ -7604,7 +7604,7 @@ const zu = s.object({
|
|
|
7604
7604
|
)
|
|
7605
7605
|
), { succeeded: r, failures: n } = U(e, o, (i) => i.id), a = r.map(({ value: i }) => i);
|
|
7606
7606
|
return O(y.UPDATE_FOLDERS, e.length, n), {
|
|
7607
|
-
textContent:
|
|
7607
|
+
textContent: Ju(a, n),
|
|
7608
7608
|
structuredContent: {
|
|
7609
7609
|
folders: a.map(Gt),
|
|
7610
7610
|
failures: n,
|
|
@@ -7614,38 +7614,38 @@ const zu = s.object({
|
|
|
7614
7614
|
};
|
|
7615
7615
|
}
|
|
7616
7616
|
};
|
|
7617
|
-
function
|
|
7617
|
+
function Ju(e, t) {
|
|
7618
7618
|
const o = e.length, r = e.map((a) => `• ${a.name} (id=${a.id})`), n = o > 0 ? `Renamed ${o} folder${o === 1 ? "" : "s"}:
|
|
7619
7619
|
${r.join(`
|
|
7620
7620
|
`)}` : "Renamed 0 folders";
|
|
7621
7621
|
return P(n, t);
|
|
7622
7622
|
}
|
|
7623
|
-
const
|
|
7623
|
+
const Xu = s.object({
|
|
7624
7624
|
labelType: s.literal("personal").describe("Update a personal label, identified by its ID."),
|
|
7625
7625
|
id: s.string().min(1).describe("The ID of the personal label to update."),
|
|
7626
7626
|
name: s.string().min(1).max(128).optional().describe("The new name of the label."),
|
|
7627
|
-
color:
|
|
7627
|
+
color: Ee,
|
|
7628
7628
|
order: s.number().int().optional().describe("The new position of the label in the label list."),
|
|
7629
7629
|
isFavorite: s.boolean().optional().describe("Whether to mark the label as a favorite.")
|
|
7630
|
-
}),
|
|
7630
|
+
}), Zu = s.object({
|
|
7631
7631
|
labelType: s.literal("shared").describe(
|
|
7632
7632
|
"Rename a shared label across all tasks. Shared labels are identified by name; only renaming is supported (no color, order, or favorite)."
|
|
7633
7633
|
),
|
|
7634
7634
|
name: s.string().min(1).describe("The current name of the shared label."),
|
|
7635
7635
|
newName: s.string().min(1).describe("The new name for the shared label.")
|
|
7636
|
-
}),
|
|
7637
|
-
|
|
7638
|
-
|
|
7639
|
-
]),
|
|
7640
|
-
labels: s.array(
|
|
7636
|
+
}), Qu = s.discriminatedUnion("labelType", [
|
|
7637
|
+
Xu,
|
|
7638
|
+
Zu
|
|
7639
|
+
]), ep = {
|
|
7640
|
+
labels: s.array(Qu).min(1).max(D.ITEMS_PER_OPERATION).describe(
|
|
7641
7641
|
'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.'
|
|
7642
7642
|
)
|
|
7643
|
-
},
|
|
7643
|
+
}, tp = s.object({
|
|
7644
7644
|
name: s.string().describe("The previous name of the shared label."),
|
|
7645
7645
|
newName: s.string().describe("The new name of the shared label.")
|
|
7646
|
-
}),
|
|
7647
|
-
updatedLabels: s.array(
|
|
7648
|
-
renamedSharedLabels: s.array(
|
|
7646
|
+
}), op = {
|
|
7647
|
+
updatedLabels: s.array(De).describe("The updated personal labels."),
|
|
7648
|
+
renamedSharedLabels: s.array(tp).describe("The shared labels that were renamed."),
|
|
7649
7649
|
totalCount: s.number().describe("The total number of successful operations (personal + shared)."),
|
|
7650
7650
|
failures: s.array(_).describe(
|
|
7651
7651
|
"Labels that could not be updated, identified by ID (personal) or name (shared), with the reason for each."
|
|
@@ -7656,17 +7656,17 @@ const Ju = s.object({
|
|
|
7656
7656
|
skippedCount: s.number().describe("Number of operations skipped (no changes or shared label not found)."),
|
|
7657
7657
|
failureCount: s.number()
|
|
7658
7658
|
}).describe("Summary of operations performed.")
|
|
7659
|
-
},
|
|
7659
|
+
}, sp = {
|
|
7660
7660
|
name: y.UPDATE_LABELS,
|
|
7661
7661
|
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.",
|
|
7662
|
-
parameters:
|
|
7663
|
-
outputSchema:
|
|
7662
|
+
parameters: ep,
|
|
7663
|
+
outputSchema: op,
|
|
7664
7664
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
7665
7665
|
async execute(e, t) {
|
|
7666
7666
|
const { labels: o } = e, r = await Promise.allSettled(
|
|
7667
7667
|
o.map(async (h) => {
|
|
7668
7668
|
if (h.labelType === "personal") {
|
|
7669
|
-
const b =
|
|
7669
|
+
const b = np(h);
|
|
7670
7670
|
if (b !== null) return { kind: "skipped", reason: b };
|
|
7671
7671
|
const { id: g, labelType: w, ...I } = h;
|
|
7672
7672
|
return { kind: "updated", label: await j(() => t.updateLabel(g, I)) };
|
|
@@ -7681,7 +7681,7 @@ const Ju = s.object({
|
|
|
7681
7681
|
(h) => h.labelType === "personal" ? h.id : h.name
|
|
7682
7682
|
), i = n.map(({ value: h }) => h);
|
|
7683
7683
|
O(y.UPDATE_LABELS, o.length, a, { redactItems: !0 });
|
|
7684
|
-
const c = i.filter((h) => h.kind === "updated").map((h) =>
|
|
7684
|
+
const c = i.filter((h) => h.kind === "updated").map((h) => De.parse(h.label)), d = i.filter(
|
|
7685
7685
|
(h) => h.kind === "renamed"
|
|
7686
7686
|
).map(({ name: h, newName: m }) => ({ name: h, newName: m })), u = i.filter((h) => h.kind === "skipped").length, l = i.filter(
|
|
7687
7687
|
(h) => h.kind === "skipped" && h.reason === "no-fields"
|
|
@@ -7690,7 +7690,7 @@ const Ju = s.object({
|
|
|
7690
7690
|
).length;
|
|
7691
7691
|
return {
|
|
7692
7692
|
textContent: P(
|
|
7693
|
-
|
|
7693
|
+
rp({
|
|
7694
7694
|
updatedLabels: c,
|
|
7695
7695
|
renamedSharedLabels: d,
|
|
7696
7696
|
skippedNoFields: l,
|
|
@@ -7713,7 +7713,7 @@ const Ju = s.object({
|
|
|
7713
7713
|
};
|
|
7714
7714
|
}
|
|
7715
7715
|
};
|
|
7716
|
-
function
|
|
7716
|
+
function rp({
|
|
7717
7717
|
updatedLabels: e,
|
|
7718
7718
|
renamedSharedLabels: t,
|
|
7719
7719
|
skippedNoFields: o,
|
|
@@ -7735,18 +7735,18 @@ function sp({
|
|
|
7735
7735
|
return c.join(`
|
|
7736
7736
|
`);
|
|
7737
7737
|
}
|
|
7738
|
-
function
|
|
7738
|
+
function np({
|
|
7739
7739
|
id: e,
|
|
7740
7740
|
labelType: t,
|
|
7741
7741
|
...o
|
|
7742
7742
|
}) {
|
|
7743
7743
|
return Object.values(o).every((n) => n === void 0) ? "no-fields" : null;
|
|
7744
7744
|
}
|
|
7745
|
-
const { FIND_FOLDERS:
|
|
7745
|
+
const { FIND_FOLDERS: ap } = y, ip = s.object({
|
|
7746
7746
|
id: s.string().min(1).describe("The ID of the project to update."),
|
|
7747
7747
|
name: s.string().min(1).optional().describe("The new name of the project."),
|
|
7748
7748
|
isFavorite: s.boolean().optional().describe("Whether the project is a favorite."),
|
|
7749
|
-
viewStyle: s.enum(
|
|
7749
|
+
viewStyle: s.enum(Qo).optional().describe("The project view style."),
|
|
7750
7750
|
description: s.preprocess(
|
|
7751
7751
|
// `null` is the advertised clear value; the param schema stays a
|
|
7752
7752
|
// plain string (Gemini forbids nullable schemas, not preprocessing),
|
|
@@ -7756,14 +7756,14 @@ const { FIND_FOLDERS: np } = y, ap = s.object({
|
|
|
7756
7756
|
"The description of the project (Markdown). Pass null (or an empty string) to clear it."
|
|
7757
7757
|
)
|
|
7758
7758
|
).optional(),
|
|
7759
|
-
color:
|
|
7760
|
-
icon: s.enum([...
|
|
7759
|
+
color: Ee,
|
|
7760
|
+
icon: s.enum([...Zo, "remove"]).optional().describe('The project icon, or "remove" to restore the default # icon.'),
|
|
7761
7761
|
folderId: s.string().min(1).optional().describe(
|
|
7762
|
-
`Move a workspace project into this folder (see ${
|
|
7762
|
+
`Move a workspace project into this folder (see ${ap}), or "remove" for the workspace's top level.`
|
|
7763
7763
|
)
|
|
7764
|
-
}),
|
|
7765
|
-
projects: s.array(
|
|
7766
|
-
},
|
|
7764
|
+
}), cp = {
|
|
7765
|
+
projects: s.array(ip).min(1).max(D.ITEMS_PER_OPERATION).describe("The projects to update.")
|
|
7766
|
+
}, dp = {
|
|
7767
7767
|
projects: s.array(be).describe("The updated projects."),
|
|
7768
7768
|
totalCount: s.number().describe("The total number of projects updated."),
|
|
7769
7769
|
updatedProjectIds: s.array(s.string()).describe("The IDs of the updated projects."),
|
|
@@ -7773,16 +7773,16 @@ const { FIND_FOLDERS: np } = y, ap = s.object({
|
|
|
7773
7773
|
skippedCount: s.number().describe("The number of projects skipped (no changes)."),
|
|
7774
7774
|
failureCount: s.number()
|
|
7775
7775
|
}).describe("Summary of operations performed.")
|
|
7776
|
-
},
|
|
7776
|
+
}, lp = {
|
|
7777
7777
|
name: y.UPDATE_PROJECTS,
|
|
7778
7778
|
description: "Update multiple existing projects with new values.",
|
|
7779
|
-
parameters:
|
|
7780
|
-
outputSchema:
|
|
7779
|
+
parameters: cp,
|
|
7780
|
+
outputSchema: dp,
|
|
7781
7781
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
7782
7782
|
async execute(e, t) {
|
|
7783
7783
|
const { projects: o } = e, r = await Promise.allSettled(
|
|
7784
7784
|
o.map(async (l) => {
|
|
7785
|
-
const p =
|
|
7785
|
+
const p = pp(l);
|
|
7786
7786
|
if (p !== null) return { kind: "skipped", reason: p };
|
|
7787
7787
|
const { id: f, folderId: h, icon: m, ...b } = l, g = {
|
|
7788
7788
|
...b,
|
|
@@ -7796,7 +7796,7 @@ const { FIND_FOLDERS: np } = y, ap = s.object({
|
|
|
7796
7796
|
for (const { value: l } of n)
|
|
7797
7797
|
l.kind === "updated" ? i.push(fe(l.project)) : l.reason === "no-fields" ? c++ : d++;
|
|
7798
7798
|
return O(y.UPDATE_PROJECTS, o.length, a), {
|
|
7799
|
-
textContent:
|
|
7799
|
+
textContent: up({
|
|
7800
7800
|
projects: i,
|
|
7801
7801
|
skippedNoFields: c,
|
|
7802
7802
|
skippedNoValidValues: d,
|
|
@@ -7816,7 +7816,7 @@ const { FIND_FOLDERS: np } = y, ap = s.object({
|
|
|
7816
7816
|
};
|
|
7817
7817
|
}
|
|
7818
7818
|
};
|
|
7819
|
-
function
|
|
7819
|
+
function up({
|
|
7820
7820
|
projects: e,
|
|
7821
7821
|
skippedNoFields: t,
|
|
7822
7822
|
skippedNoValidValues: o,
|
|
@@ -7829,25 +7829,25 @@ function lp({
|
|
|
7829
7829
|
return t > 0 && c.push(`${t} skipped - no changes`), o > 0 && c.push(`${o} skipped - no valid field values`), c.length > 0 && (i += ` (${c.join(", ")})`), n > 0 && (i += `:
|
|
7830
7830
|
${a}`), P(i, r);
|
|
7831
7831
|
}
|
|
7832
|
-
function
|
|
7832
|
+
function pp({ id: e, ...t }) {
|
|
7833
7833
|
const o = Object.values(t);
|
|
7834
7834
|
return o.length === 0 ? "no-fields" : o.every((r) => r === void 0) ? "no-valid-values" : null;
|
|
7835
7835
|
}
|
|
7836
|
-
const
|
|
7836
|
+
const hp = s.object({
|
|
7837
7837
|
type: s.literal("relative"),
|
|
7838
7838
|
id: s.string().min(1).describe("The ID of the relative reminder to update."),
|
|
7839
7839
|
minuteOffset: s.number().int().min(0).optional().describe("New minute offset before task due time."),
|
|
7840
7840
|
service: Ze.optional().describe('New delivery method: "email" or "push".'),
|
|
7841
7841
|
isUrgent: Qe,
|
|
7842
7842
|
notifyUser: eo
|
|
7843
|
-
}),
|
|
7843
|
+
}), mp = s.object({
|
|
7844
7844
|
type: s.literal("absolute"),
|
|
7845
7845
|
id: s.string().min(1).describe("The ID of the absolute reminder to update."),
|
|
7846
7846
|
due: Ns.optional().describe("New due date/time for the reminder."),
|
|
7847
7847
|
service: Ze.optional().describe('New delivery method: "email" or "push".'),
|
|
7848
7848
|
isUrgent: Qe,
|
|
7849
7849
|
notifyUser: eo
|
|
7850
|
-
}),
|
|
7850
|
+
}), fp = s.object({
|
|
7851
7851
|
type: s.literal("location"),
|
|
7852
7852
|
id: s.string().min(1).describe("The ID of the location reminder to update."),
|
|
7853
7853
|
name: s.string().optional().describe("New location name."),
|
|
@@ -7858,15 +7858,15 @@ const pp = s.object({
|
|
|
7858
7858
|
),
|
|
7859
7859
|
radius: s.number().int().optional().describe("New radius in meters."),
|
|
7860
7860
|
notifyUser: eo
|
|
7861
|
-
}),
|
|
7862
|
-
pp,
|
|
7861
|
+
}), bp = s.discriminatedUnion("type", [
|
|
7863
7862
|
hp,
|
|
7864
|
-
mp
|
|
7865
|
-
|
|
7866
|
-
|
|
7863
|
+
mp,
|
|
7864
|
+
fp
|
|
7865
|
+
]), gp = {
|
|
7866
|
+
reminders: s.array(bp).min(1).max(ze).describe(
|
|
7867
7867
|
`Array of reminders to update (max ${ze}). Each must include the reminder type and ID. Only include fields that need to change.`
|
|
7868
7868
|
)
|
|
7869
|
-
},
|
|
7869
|
+
}, yp = {
|
|
7870
7870
|
reminders: s.array(qt).describe("The updated reminders."),
|
|
7871
7871
|
totalCount: s.number().describe("Total reminders updated."),
|
|
7872
7872
|
updatedReminderIds: s.array(s.string()).describe("IDs of updated reminders."),
|
|
@@ -7875,11 +7875,11 @@ const pp = s.object({
|
|
|
7875
7875
|
updateCount: s.number(),
|
|
7876
7876
|
failureCount: s.number()
|
|
7877
7877
|
})
|
|
7878
|
-
},
|
|
7878
|
+
}, wp = {
|
|
7879
7879
|
name: y.UPDATE_REMINDERS,
|
|
7880
7880
|
description: 'Update existing reminders. Each reminder must specify its type ("relative", "absolute", or "location") and ID. Only include fields that need to change.',
|
|
7881
|
-
parameters:
|
|
7882
|
-
outputSchema:
|
|
7881
|
+
parameters: gp,
|
|
7882
|
+
outputSchema: yp,
|
|
7883
7883
|
annotations: {
|
|
7884
7884
|
readOnlyHint: !1,
|
|
7885
7885
|
destructiveHint: !0,
|
|
@@ -7956,7 +7956,7 @@ const pp = s.object({
|
|
|
7956
7956
|
}
|
|
7957
7957
|
};
|
|
7958
7958
|
}
|
|
7959
|
-
},
|
|
7959
|
+
}, Tp = s.object({
|
|
7960
7960
|
id: s.string().min(1).describe("The ID of the section to update."),
|
|
7961
7961
|
name: s.string().min(1).optional().describe("The new name of the section."),
|
|
7962
7962
|
description: s.preprocess(
|
|
@@ -7971,9 +7971,9 @@ const pp = s.object({
|
|
|
7971
7971
|
).optional()
|
|
7972
7972
|
}).refine((e) => e.name !== void 0 || e.description !== void 0, {
|
|
7973
7973
|
message: 'Provide at least one of "name" or "description" to update.'
|
|
7974
|
-
}),
|
|
7975
|
-
sections: s.array(
|
|
7976
|
-
},
|
|
7974
|
+
}), kp = {
|
|
7975
|
+
sections: s.array(Tp).min(1).max(D.ITEMS_PER_OPERATION).describe("The sections to update.")
|
|
7976
|
+
}, Ip = {
|
|
7977
7977
|
sections: s.array(ae).describe("The updated sections."),
|
|
7978
7978
|
totalCount: s.number().describe("The total number of sections updated."),
|
|
7979
7979
|
updatedSectionIds: s.array(s.string()).describe("The IDs of the updated sections."),
|
|
@@ -7982,11 +7982,11 @@ const pp = s.object({
|
|
|
7982
7982
|
updateCount: s.number(),
|
|
7983
7983
|
failureCount: s.number()
|
|
7984
7984
|
})
|
|
7985
|
-
},
|
|
7985
|
+
}, vp = {
|
|
7986
7986
|
name: y.UPDATE_SECTIONS,
|
|
7987
7987
|
description: "Update multiple existing sections with new values.",
|
|
7988
|
-
parameters:
|
|
7989
|
-
outputSchema:
|
|
7988
|
+
parameters: kp,
|
|
7989
|
+
outputSchema: Ip,
|
|
7990
7990
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
7991
7991
|
async execute({ sections: e }, t) {
|
|
7992
7992
|
const o = await Promise.allSettled(
|
|
@@ -7999,7 +7999,7 @@ const pp = s.object({
|
|
|
7999
7999
|
})
|
|
8000
8000
|
), { succeeded: r, failures: n } = U(e, o, (c) => c.id), a = r.map(({ value: c }) => c);
|
|
8001
8001
|
return O(y.UPDATE_SECTIONS, e.length, n), {
|
|
8002
|
-
textContent:
|
|
8002
|
+
textContent: Sp({
|
|
8003
8003
|
sections: a,
|
|
8004
8004
|
failures: n
|
|
8005
8005
|
}),
|
|
@@ -8016,7 +8016,7 @@ const pp = s.object({
|
|
|
8016
8016
|
};
|
|
8017
8017
|
}
|
|
8018
8018
|
};
|
|
8019
|
-
function
|
|
8019
|
+
function Sp({
|
|
8020
8020
|
sections: e,
|
|
8021
8021
|
failures: t
|
|
8022
8022
|
}) {
|
|
@@ -8025,30 +8025,30 @@ function vp({
|
|
|
8025
8025
|
${r}` : "Updated 0 sections";
|
|
8026
8026
|
return P(n, t);
|
|
8027
8027
|
}
|
|
8028
|
-
function
|
|
8028
|
+
function lr(e, t) {
|
|
8029
8029
|
return t.projectId !== void 0 ? e.projectId === t.projectId && !e.sectionId && !e.parentId : t.sectionId !== void 0 ? e.sectionId === t.sectionId && !e.parentId : e.parentId === t.parentId;
|
|
8030
8030
|
}
|
|
8031
|
-
function
|
|
8031
|
+
function Cp(e, t) {
|
|
8032
8032
|
return t.projectId !== void 0 ? e.projectId === t.projectId : t.sectionId !== void 0 ? e.sectionId === t.sectionId : e.parentId === t.parentId;
|
|
8033
8033
|
}
|
|
8034
|
-
function
|
|
8034
|
+
function jp(e) {
|
|
8035
8035
|
return e.projectId !== void 0 ? `project:${e.projectId}` : e.sectionId !== void 0 ? `section:${e.sectionId}` : `parent:${e.parentId}`;
|
|
8036
8036
|
}
|
|
8037
|
-
function
|
|
8037
|
+
function $p(e) {
|
|
8038
8038
|
const t = [];
|
|
8039
8039
|
return e.projectId && t.push({ projectId: e.projectId }), e.sectionId && t.push({ sectionId: e.sectionId }), e.parentId && t.push({ parentId: e.parentId }), t;
|
|
8040
8040
|
}
|
|
8041
|
-
function
|
|
8041
|
+
function Ep({
|
|
8042
8042
|
taskId: e,
|
|
8043
8043
|
request: t,
|
|
8044
8044
|
current: o
|
|
8045
8045
|
}) {
|
|
8046
|
-
const r =
|
|
8046
|
+
const r = $p(t);
|
|
8047
8047
|
if (r.length === 0)
|
|
8048
8048
|
return { redundantMoveSkipped: !1 };
|
|
8049
8049
|
let n = r, a = !1;
|
|
8050
8050
|
if (o) {
|
|
8051
|
-
const i = r.length === 1 ? (c) =>
|
|
8051
|
+
const i = r.length === 1 ? (c) => lr(o, c) : (c) => Cp(o, c);
|
|
8052
8052
|
n = r.filter((c) => !i(c)), a = n.length < r.length;
|
|
8053
8053
|
}
|
|
8054
8054
|
if (n.length === 0)
|
|
@@ -8059,7 +8059,7 @@ function $p({
|
|
|
8059
8059
|
);
|
|
8060
8060
|
return { move: n[0], redundantMoveSkipped: a };
|
|
8061
8061
|
}
|
|
8062
|
-
const
|
|
8062
|
+
const Ap = s.object({
|
|
8063
8063
|
id: s.string().min(1).describe("The ID of the task to update."),
|
|
8064
8064
|
content: s.string().optional().describe(
|
|
8065
8065
|
'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.'
|
|
@@ -8105,9 +8105,9 @@ const Ep = s.object({
|
|
|
8105
8105
|
isUncompletable: s.boolean().optional().describe(
|
|
8106
8106
|
"Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
|
|
8107
8107
|
)
|
|
8108
|
-
}),
|
|
8109
|
-
tasks: s.array(
|
|
8110
|
-
},
|
|
8108
|
+
}), Dp = (e) => !!(e.projectId || e.sectionId || e.parentId), ur = (e) => Object.keys(e).length > 0, xp = ["remove", "no date"], Op = ["remove", "no date", "no deadline"], Ko = "no date", At = D.TASKS_PER_OPERATION, zo = {
|
|
8109
|
+
tasks: s.array(Ap).min(1).max(At).describe(`The tasks to update (max ${At}).`)
|
|
8110
|
+
}, _p = {
|
|
8111
8111
|
tasks: s.array(oe).describe("The updated tasks."),
|
|
8112
8112
|
totalCount: s.number().describe("The total number of tasks updated."),
|
|
8113
8113
|
updatedTaskIds: s.array(s.string()).describe("The IDs of the updated tasks."),
|
|
@@ -8120,11 +8120,11 @@ const Ep = s.object({
|
|
|
8120
8120
|
"Moves not performed because the task was already in the requested destination. A non-zero count means container fields were sent that did not need to be."
|
|
8121
8121
|
)
|
|
8122
8122
|
}).describe("Summary of operations performed.")
|
|
8123
|
-
},
|
|
8123
|
+
}, Up = {
|
|
8124
8124
|
name: y.UPDATE_TASKS,
|
|
8125
8125
|
description: "Update existing tasks including content, dates, priorities, and assignments. Send only the fields that change.",
|
|
8126
|
-
parameters:
|
|
8127
|
-
outputSchema:
|
|
8126
|
+
parameters: zo,
|
|
8127
|
+
outputSchema: _p,
|
|
8128
8128
|
// Open world: assigning a task notifies the new assignee.
|
|
8129
8129
|
annotations: {
|
|
8130
8130
|
readOnlyHint: !1,
|
|
@@ -8133,32 +8133,32 @@ const Ep = s.object({
|
|
|
8133
8133
|
openWorldHint: !0
|
|
8134
8134
|
},
|
|
8135
8135
|
async execute(e, t) {
|
|
8136
|
-
const { tasks: o } = s.object(
|
|
8136
|
+
const { tasks: o } = s.object(zo).parse(e), r = o.map(() => ({ kind: "skipped" })), n = (T, v) => {
|
|
8137
8137
|
r[T] = { kind: "failed", error: v };
|
|
8138
8138
|
}, a = (T, v) => {
|
|
8139
8139
|
n(T, K(v));
|
|
8140
|
-
}, i = o.map((T, v) => ({ task: T, index: v })).filter(({ task: T }) =>
|
|
8140
|
+
}, i = o.map((T, v) => ({ task: T, index: v })).filter(({ task: T }) => Kp(T)), c = await Rp(
|
|
8141
8141
|
i.map(({ task: T }) => T),
|
|
8142
8142
|
t
|
|
8143
8143
|
), d = await Promise.allSettled(
|
|
8144
|
-
i.map(({ task: T, index: v }) =>
|
|
8144
|
+
i.map(({ task: T, index: v }) => Hp({ task: T, index: v, client: t, inbox: c }))
|
|
8145
8145
|
), u = [];
|
|
8146
8146
|
for (const [T, v] of d.entries()) {
|
|
8147
8147
|
const A = i[T]?.index ?? T;
|
|
8148
8148
|
v.status === "fulfilled" ? u.push(v.value) : a(A, v.reason);
|
|
8149
8149
|
}
|
|
8150
|
-
const { states: l, readFailed: p } = await
|
|
8150
|
+
const { states: l, readFailed: p } = await pr({
|
|
8151
8151
|
client: t,
|
|
8152
8152
|
ids: [
|
|
8153
8153
|
...new Set(
|
|
8154
|
-
u.filter((T) =>
|
|
8154
|
+
u.filter((T) => Dp(T.moveRequest) || T.checkRecurrence).map((T) => T.id)
|
|
8155
8155
|
)
|
|
8156
8156
|
]
|
|
8157
8157
|
});
|
|
8158
8158
|
for (const T of u) {
|
|
8159
8159
|
if (!T.checkRecurrence)
|
|
8160
8160
|
continue;
|
|
8161
|
-
const v =
|
|
8161
|
+
const v = Np({
|
|
8162
8162
|
id: T.id,
|
|
8163
8163
|
current: l.get(T.id),
|
|
8164
8164
|
readFailed: p
|
|
@@ -8169,7 +8169,7 @@ const Ep = s.object({
|
|
|
8169
8169
|
for (const T of u)
|
|
8170
8170
|
if (!T.failed)
|
|
8171
8171
|
try {
|
|
8172
|
-
const v =
|
|
8172
|
+
const v = Ep({
|
|
8173
8173
|
taskId: T.id,
|
|
8174
8174
|
request: T.moveRequest,
|
|
8175
8175
|
current: l.get(T.id)
|
|
@@ -8181,7 +8181,7 @@ const Ep = s.object({
|
|
|
8181
8181
|
const h = /* @__PURE__ */ new Map(), m = [], b = (T) => {
|
|
8182
8182
|
const v = T.filter((A) => !A.failed);
|
|
8183
8183
|
v.length !== 0 && m.push(
|
|
8184
|
-
|
|
8184
|
+
Fp({
|
|
8185
8185
|
client: t,
|
|
8186
8186
|
items: v,
|
|
8187
8187
|
onUpdated: (A, x) => {
|
|
@@ -8202,7 +8202,7 @@ const Ep = s.object({
|
|
|
8202
8202
|
})
|
|
8203
8203
|
);
|
|
8204
8204
|
}, g = new Set(f.map(({ item: T }) => T.index));
|
|
8205
|
-
b(u.filter((T) => !g.has(T.index))), await
|
|
8205
|
+
b(u.filter((T) => !g.has(T.index))), await Lp({
|
|
8206
8206
|
client: t,
|
|
8207
8207
|
moving: f,
|
|
8208
8208
|
results: h,
|
|
@@ -8220,14 +8220,14 @@ const Ep = s.object({
|
|
|
8220
8220
|
}
|
|
8221
8221
|
}), await Promise.all(m);
|
|
8222
8222
|
for (const T of u) {
|
|
8223
|
-
if (T.failed ||
|
|
8223
|
+
if (T.failed || ur(T.updateArgs))
|
|
8224
8224
|
continue;
|
|
8225
8225
|
const v = h.get(T.index);
|
|
8226
8226
|
v && "task" in v && (r[T.index] = { kind: "updated", task: v.task });
|
|
8227
8227
|
}
|
|
8228
|
-
const { updatedTasks: w, failures: I, skippedCount: k } =
|
|
8228
|
+
const { updatedTasks: w, failures: I, skippedCount: k } = Pp({ tasks: o, outcomes: r }), S = u.filter((T) => T.redundantMoveSkipped).length, E = w.map(z);
|
|
8229
8229
|
return O(y.UPDATE_TASKS, o.length, I), {
|
|
8230
|
-
textContent:
|
|
8230
|
+
textContent: Bp({
|
|
8231
8231
|
tasks: E,
|
|
8232
8232
|
failures: I,
|
|
8233
8233
|
skippedCount: k,
|
|
@@ -8248,7 +8248,7 @@ const Ep = s.object({
|
|
|
8248
8248
|
};
|
|
8249
8249
|
}
|
|
8250
8250
|
};
|
|
8251
|
-
function
|
|
8251
|
+
function Pp({ tasks: e, outcomes: t }) {
|
|
8252
8252
|
const o = [], r = [];
|
|
8253
8253
|
let n = 0;
|
|
8254
8254
|
for (const [a, i] of t.entries()) {
|
|
@@ -8265,7 +8265,7 @@ function Up({ tasks: e, outcomes: t }) {
|
|
|
8265
8265
|
}
|
|
8266
8266
|
return { updatedTasks: o, failures: r, skippedCount: n };
|
|
8267
8267
|
}
|
|
8268
|
-
async function
|
|
8268
|
+
async function Rp(e, t) {
|
|
8269
8269
|
if (!e.some((o) => te(o.projectId)))
|
|
8270
8270
|
return {};
|
|
8271
8271
|
try {
|
|
@@ -8274,7 +8274,7 @@ async function Pp(e, t) {
|
|
|
8274
8274
|
return { error: o };
|
|
8275
8275
|
}
|
|
8276
8276
|
}
|
|
8277
|
-
async function
|
|
8277
|
+
async function pr({
|
|
8278
8278
|
client: e,
|
|
8279
8279
|
ids: t
|
|
8280
8280
|
}) {
|
|
@@ -8290,7 +8290,7 @@ async function hr({
|
|
|
8290
8290
|
}
|
|
8291
8291
|
return { states: o, readFailed: !1 };
|
|
8292
8292
|
}
|
|
8293
|
-
function
|
|
8293
|
+
function Np({
|
|
8294
8294
|
id: e,
|
|
8295
8295
|
current: t,
|
|
8296
8296
|
readFailed: o
|
|
@@ -8300,7 +8300,7 @@ function Rp({
|
|
|
8300
8300
|
if (t?.due?.isRecurring)
|
|
8301
8301
|
return `Task ${e} recurs ("${t.due.string}"). dueString would replace that rule and make it a one-time task, so nothing was changed. To move it to another date or time, use ${y.RESCHEDULE_TASKS} (it also accepts duration). To change or drop the recurrence on purpose, resend with replaceRecurrence: true.`;
|
|
8302
8302
|
}
|
|
8303
|
-
async function
|
|
8303
|
+
async function Lp({
|
|
8304
8304
|
client: e,
|
|
8305
8305
|
moving: t,
|
|
8306
8306
|
results: o,
|
|
@@ -8310,7 +8310,7 @@ async function Np({
|
|
|
8310
8310
|
return;
|
|
8311
8311
|
const n = /* @__PURE__ */ new Map();
|
|
8312
8312
|
for (const c of t) {
|
|
8313
|
-
const d =
|
|
8313
|
+
const d = jp(c.move), u = n.get(d);
|
|
8314
8314
|
u ? u.push(c) : n.set(d, [c]);
|
|
8315
8315
|
}
|
|
8316
8316
|
const a = cn(e), i = [];
|
|
@@ -8341,22 +8341,22 @@ async function Np({
|
|
|
8341
8341
|
}
|
|
8342
8342
|
}
|
|
8343
8343
|
if (i.length > 0) {
|
|
8344
|
-
await
|
|
8344
|
+
await Mp({ client: e, unresolved: i, results: o });
|
|
8345
8345
|
for (const { group: c } of i)
|
|
8346
8346
|
r(c);
|
|
8347
8347
|
}
|
|
8348
8348
|
}
|
|
8349
|
-
async function
|
|
8349
|
+
async function Mp({
|
|
8350
8350
|
client: e,
|
|
8351
8351
|
unresolved: t,
|
|
8352
8352
|
results: o
|
|
8353
8353
|
}) {
|
|
8354
|
-
const r = [...new Set(t.flatMap(({ group: a }) => a.map(({ item: i }) => i.id)))], { states: n } = await
|
|
8354
|
+
const r = [...new Set(t.flatMap(({ group: a }) => a.map(({ item: i }) => i.id)))], { states: n } = await pr({ client: e, ids: r });
|
|
8355
8355
|
for (const { group: a, destination: i, error: c } of t) {
|
|
8356
8356
|
const d = c === void 0 ? "Task not returned by the move" : K(c);
|
|
8357
8357
|
for (const { item: u } of a) {
|
|
8358
8358
|
const l = n.get(u.id);
|
|
8359
|
-
if (l &&
|
|
8359
|
+
if (l && lr(l, i)) {
|
|
8360
8360
|
o.set(u.index, { task: l });
|
|
8361
8361
|
continue;
|
|
8362
8362
|
}
|
|
@@ -8364,7 +8364,7 @@ async function Lp({
|
|
|
8364
8364
|
}
|
|
8365
8365
|
}
|
|
8366
8366
|
}
|
|
8367
|
-
async function
|
|
8367
|
+
async function Fp({
|
|
8368
8368
|
client: e,
|
|
8369
8369
|
items: t,
|
|
8370
8370
|
onUpdated: o,
|
|
@@ -8372,7 +8372,7 @@ async function Mp({
|
|
|
8372
8372
|
}) {
|
|
8373
8373
|
const n = Rt(e);
|
|
8374
8374
|
await Promise.all(
|
|
8375
|
-
t.filter((a) =>
|
|
8375
|
+
t.filter((a) => ur(a.updateArgs)).map(async (a) => {
|
|
8376
8376
|
try {
|
|
8377
8377
|
const i = await n(
|
|
8378
8378
|
() => j(() => e.updateTask(a.id, a.updateArgs))
|
|
@@ -8384,7 +8384,7 @@ async function Mp({
|
|
|
8384
8384
|
})
|
|
8385
8385
|
);
|
|
8386
8386
|
}
|
|
8387
|
-
async function
|
|
8387
|
+
async function Hp({
|
|
8388
8388
|
task: e,
|
|
8389
8389
|
index: t,
|
|
8390
8390
|
client: o,
|
|
@@ -8412,20 +8412,20 @@ async function Fp({
|
|
|
8412
8412
|
...f !== void 0 && { labels: f }
|
|
8413
8413
|
};
|
|
8414
8414
|
p && (w.priority = ks(p));
|
|
8415
|
-
const I =
|
|
8415
|
+
const I = Go(
|
|
8416
8416
|
d,
|
|
8417
|
-
|
|
8418
|
-
|
|
8417
|
+
xp,
|
|
8418
|
+
Ko
|
|
8419
8419
|
);
|
|
8420
8420
|
I !== void 0 && (w = { ...w, dueString: I });
|
|
8421
|
-
const k =
|
|
8421
|
+
const k = Go(h, Op, null);
|
|
8422
8422
|
if (k !== void 0 && (w = { ...w, deadlineDate: k }), u) {
|
|
8423
8423
|
const { amount: S, unit: E } = Lt(`Task ${n}`, u);
|
|
8424
8424
|
w = { ...w, duration: S, durationUnit: E };
|
|
8425
8425
|
}
|
|
8426
8426
|
return l !== void 0 && (w = {
|
|
8427
8427
|
...w,
|
|
8428
|
-
assigneeId: await
|
|
8428
|
+
assigneeId: await Wp(o, n, l)
|
|
8429
8429
|
}), {
|
|
8430
8430
|
index: t,
|
|
8431
8431
|
id: n,
|
|
@@ -8436,11 +8436,11 @@ async function Fp({
|
|
|
8436
8436
|
parentId: c
|
|
8437
8437
|
},
|
|
8438
8438
|
redundantMoveSkipped: !1,
|
|
8439
|
-
checkRecurrence: I !== void 0 && I !==
|
|
8439
|
+
checkRecurrence: I !== void 0 && I !== Ko && m !== !0,
|
|
8440
8440
|
failed: !1
|
|
8441
8441
|
};
|
|
8442
8442
|
}
|
|
8443
|
-
async function
|
|
8443
|
+
async function Wp(e, t, o) {
|
|
8444
8444
|
if (o === null || o === "unassign")
|
|
8445
8445
|
return null;
|
|
8446
8446
|
const r = await to.validateTaskUpdateAssignment(
|
|
@@ -8454,7 +8454,7 @@ async function Hp(e, t, o) {
|
|
|
8454
8454
|
}
|
|
8455
8455
|
return r.resolvedUser?.userId;
|
|
8456
8456
|
}
|
|
8457
|
-
function
|
|
8457
|
+
function Bp({
|
|
8458
8458
|
tasks: e,
|
|
8459
8459
|
failures: t,
|
|
8460
8460
|
skippedCount: o,
|
|
@@ -8475,14 +8475,14 @@ function Wp({
|
|
|
8475
8475
|
Failed (${t.length}) - address or drop these items:
|
|
8476
8476
|
${u}${l}`;
|
|
8477
8477
|
}
|
|
8478
|
-
function
|
|
8478
|
+
function Kp({
|
|
8479
8479
|
id: e,
|
|
8480
8480
|
replaceRecurrence: t,
|
|
8481
8481
|
...o
|
|
8482
8482
|
}) {
|
|
8483
8483
|
return Object.keys(o).length > 0;
|
|
8484
8484
|
}
|
|
8485
|
-
function
|
|
8485
|
+
function Go(e, t, o) {
|
|
8486
8486
|
if (e === void 0)
|
|
8487
8487
|
return e;
|
|
8488
8488
|
if (e === null)
|
|
@@ -8490,7 +8490,7 @@ function zo(e, t, o) {
|
|
|
8490
8490
|
const r = e.trim().toLowerCase();
|
|
8491
8491
|
return t.includes(r) ? o : e;
|
|
8492
8492
|
}
|
|
8493
|
-
const
|
|
8493
|
+
const zp = {}, Gp = {
|
|
8494
8494
|
type: s.literal("user_info").describe("The type of the response."),
|
|
8495
8495
|
userId: s.string().describe("The user ID."),
|
|
8496
8496
|
fullName: s.string().describe("The full name of the user."),
|
|
@@ -8507,18 +8507,18 @@ const Kp = {}, zp = {
|
|
|
8507
8507
|
email: s.string().describe("The email address of the user."),
|
|
8508
8508
|
plan: s.enum(["Todoist Free", "Todoist Pro", "Todoist Business"]).describe("The user plan.")
|
|
8509
8509
|
};
|
|
8510
|
-
function
|
|
8510
|
+
function qp(e) {
|
|
8511
8511
|
return e.businessAccountId ? "Todoist Business" : e.isPremium ? "Todoist Pro" : "Todoist Free";
|
|
8512
8512
|
}
|
|
8513
|
-
function
|
|
8513
|
+
function Yp(e, t) {
|
|
8514
8514
|
const r = ((e.getDay() || 7) - t + 7) % 7, n = new Date(e);
|
|
8515
8515
|
return n.setDate(e.getDate() - r), n;
|
|
8516
8516
|
}
|
|
8517
|
-
function
|
|
8517
|
+
function Vp(e) {
|
|
8518
8518
|
const t = new Date(e);
|
|
8519
8519
|
return t.setDate(e.getDate() + 6), t;
|
|
8520
8520
|
}
|
|
8521
|
-
function
|
|
8521
|
+
function Jp(e) {
|
|
8522
8522
|
const t = Date.UTC(
|
|
8523
8523
|
e.getFullYear(),
|
|
8524
8524
|
e.getMonth(),
|
|
@@ -8526,21 +8526,21 @@ function Vp(e) {
|
|
|
8526
8526
|
), o = new Date(t).getUTCFullYear(), r = (t - Date.UTC(o, 0, 1)) / 864e5;
|
|
8527
8527
|
return Math.floor(r / 7) + 1;
|
|
8528
8528
|
}
|
|
8529
|
-
function
|
|
8529
|
+
function Xp(e) {
|
|
8530
8530
|
return ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"][e === 7 ? 0 : e] ?? "Unknown";
|
|
8531
8531
|
}
|
|
8532
|
-
function
|
|
8532
|
+
function Zp(e) {
|
|
8533
8533
|
try {
|
|
8534
8534
|
return new Intl.DateTimeFormat("en-US", { timeZone: e }), !0;
|
|
8535
8535
|
} catch {
|
|
8536
8536
|
return !1;
|
|
8537
8537
|
}
|
|
8538
8538
|
}
|
|
8539
|
-
function
|
|
8540
|
-
return
|
|
8539
|
+
function hr(e) {
|
|
8540
|
+
return Zp(e) ? e : "UTC";
|
|
8541
8541
|
}
|
|
8542
|
-
function
|
|
8543
|
-
const o =
|
|
8542
|
+
function Qp(e, t) {
|
|
8543
|
+
const o = hr(t);
|
|
8544
8544
|
return e.toLocaleString("en-US", {
|
|
8545
8545
|
timeZone: o,
|
|
8546
8546
|
year: "numeric",
|
|
@@ -8552,8 +8552,8 @@ function Zp(e, t) {
|
|
|
8552
8552
|
hour12: !1
|
|
8553
8553
|
});
|
|
8554
8554
|
}
|
|
8555
|
-
async function
|
|
8556
|
-
const t = await e.getUser(), o = t.tzInfo?.timezone ?? "UTC", r =
|
|
8555
|
+
async function eh(e) {
|
|
8556
|
+
const t = await e.getUser(), o = t.tzInfo?.timezone ?? "UTC", r = hr(o), n = /* @__PURE__ */ new Date(), a = Qp(n, r), i = t.startDay ?? 1, c = Xp(i), d = qp(t), u = new Date(n.toLocaleString("en-US", { timeZone: r })), l = Yp(u, i), p = Vp(l), f = Jp(l), m = [
|
|
8557
8557
|
"# User Information",
|
|
8558
8558
|
"",
|
|
8559
8559
|
`**User ID:** ${t.id}`,
|
|
@@ -8565,8 +8565,8 @@ async function Qp(e) {
|
|
|
8565
8565
|
"## Week Settings",
|
|
8566
8566
|
`**Week Start Day:** ${c} (${i})`,
|
|
8567
8567
|
`**Current Week:** Week ${f}`,
|
|
8568
|
-
`**Week Start Date:** ${
|
|
8569
|
-
`**Week End Date:** ${
|
|
8568
|
+
`**Week Start Date:** ${Ke(l)}`,
|
|
8569
|
+
`**Week End Date:** ${Ke(p)}`,
|
|
8570
8570
|
"",
|
|
8571
8571
|
"## Daily Progress",
|
|
8572
8572
|
`**Completed Today:** ${t.completedToday}`,
|
|
@@ -8584,8 +8584,8 @@ async function Qp(e) {
|
|
|
8584
8584
|
currentLocalTime: a,
|
|
8585
8585
|
startDay: i,
|
|
8586
8586
|
startDayName: c,
|
|
8587
|
-
weekStartDate:
|
|
8588
|
-
weekEndDate:
|
|
8587
|
+
weekStartDate: Ke(l),
|
|
8588
|
+
weekEndDate: Ke(p),
|
|
8589
8589
|
currentWeekNumber: f,
|
|
8590
8590
|
completedToday: t.completedToday,
|
|
8591
8591
|
dailyGoal: t.dailyGoal,
|
|
@@ -8595,26 +8595,26 @@ async function Qp(e) {
|
|
|
8595
8595
|
};
|
|
8596
8596
|
return { textContent: m, structuredContent: b };
|
|
8597
8597
|
}
|
|
8598
|
-
const
|
|
8598
|
+
const th = {
|
|
8599
8599
|
name: y.USER_INFO,
|
|
8600
8600
|
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).",
|
|
8601
|
-
parameters:
|
|
8602
|
-
outputSchema:
|
|
8601
|
+
parameters: zp,
|
|
8602
|
+
outputSchema: Gp,
|
|
8603
8603
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
8604
8604
|
async execute(e, t) {
|
|
8605
|
-
const o = await
|
|
8605
|
+
const o = await eh(t);
|
|
8606
8606
|
return {
|
|
8607
8607
|
textContent: o.textContent,
|
|
8608
8608
|
structuredContent: o.structuredContent
|
|
8609
8609
|
};
|
|
8610
8610
|
}
|
|
8611
|
-
},
|
|
8611
|
+
}, qo = 10 * 1024 * 1024, oh = /* @__PURE__ */ new Set([
|
|
8612
8612
|
"image/png",
|
|
8613
8613
|
"image/jpeg",
|
|
8614
8614
|
"image/gif",
|
|
8615
8615
|
"image/webp",
|
|
8616
8616
|
"image/svg+xml"
|
|
8617
|
-
]),
|
|
8617
|
+
]), sh = /* @__PURE__ */ new Set([
|
|
8618
8618
|
"text/plain",
|
|
8619
8619
|
"text/csv",
|
|
8620
8620
|
"text/html",
|
|
@@ -8622,7 +8622,7 @@ const eh = {
|
|
|
8622
8622
|
"application/json",
|
|
8623
8623
|
"application/xml",
|
|
8624
8624
|
"text/xml"
|
|
8625
|
-
]),
|
|
8625
|
+
]), rh = {
|
|
8626
8626
|
".png": "image/png",
|
|
8627
8627
|
".jpg": "image/jpeg",
|
|
8628
8628
|
".jpeg": "image/jpeg",
|
|
@@ -8637,23 +8637,23 @@ const eh = {
|
|
|
8637
8637
|
".xml": "application/xml",
|
|
8638
8638
|
".pdf": "application/pdf"
|
|
8639
8639
|
};
|
|
8640
|
-
function rh(e) {
|
|
8641
|
-
return th.has(e) ? "image" : oh.has(e) || e.startsWith("text/") ? "text" : "binary";
|
|
8642
|
-
}
|
|
8643
8640
|
function nh(e) {
|
|
8644
|
-
return (e
|
|
8641
|
+
return oh.has(e) ? "image" : sh.has(e) || e.startsWith("text/") ? "text" : "binary";
|
|
8645
8642
|
}
|
|
8646
8643
|
function ah(e) {
|
|
8644
|
+
return (e.split(";")[0] ?? e).trim().toLowerCase();
|
|
8645
|
+
}
|
|
8646
|
+
function ih(e) {
|
|
8647
8647
|
try {
|
|
8648
8648
|
const t = new URL(e).pathname, o = t.lastIndexOf(".");
|
|
8649
8649
|
if (o === -1) return;
|
|
8650
8650
|
const r = t.slice(o).toLowerCase();
|
|
8651
|
-
return
|
|
8651
|
+
return rh[r];
|
|
8652
8652
|
} catch {
|
|
8653
8653
|
return;
|
|
8654
8654
|
}
|
|
8655
8655
|
}
|
|
8656
|
-
function
|
|
8656
|
+
function ch(e) {
|
|
8657
8657
|
try {
|
|
8658
8658
|
const t = new URL(e).pathname, o = t.lastIndexOf("/");
|
|
8659
8659
|
return o === -1 ? void 0 : t.slice(o + 1) || void 0;
|
|
@@ -8661,33 +8661,33 @@ function ih(e) {
|
|
|
8661
8661
|
return;
|
|
8662
8662
|
}
|
|
8663
8663
|
}
|
|
8664
|
-
const
|
|
8665
|
-
fileUrl: s.url().regex(
|
|
8664
|
+
const dh = /^https:\/\/(?:files\.todoist\.com|todoist\.b-cdn\.net|d1ysz50cxb9zwl\.cloudfront\.net)\/\S*$/, lh = {
|
|
8665
|
+
fileUrl: s.url().regex(dh, {
|
|
8666
8666
|
error: "Pass the fileUrl from a comment's fileAttachment: an https URL on files.todoist.com, todoist.b-cdn.net or d1ysz50cxb9zwl.cloudfront.net."
|
|
8667
8667
|
}).describe(
|
|
8668
8668
|
"The URL of the attachment file to view. Get this from the fileUrl field in a comment's fileAttachment."
|
|
8669
8669
|
)
|
|
8670
|
-
},
|
|
8670
|
+
}, uh = {
|
|
8671
8671
|
name: y.VIEW_ATTACHMENT,
|
|
8672
8672
|
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).",
|
|
8673
|
-
parameters:
|
|
8673
|
+
parameters: lh,
|
|
8674
8674
|
annotations: {
|
|
8675
8675
|
readOnlyHint: !0,
|
|
8676
8676
|
destructiveHint: !1,
|
|
8677
8677
|
idempotentHint: !0
|
|
8678
8678
|
},
|
|
8679
8679
|
async execute({ fileUrl: e }, t) {
|
|
8680
|
-
const o = await t.viewAttachment(e), r = o.headers["content-length"], n = r ? Number.parseInt(r, 10) : void 0, a =
|
|
8681
|
-
if (n && n >
|
|
8680
|
+
const o = await t.viewAttachment(e), r = o.headers["content-length"], n = r ? Number.parseInt(r, 10) : void 0, a = ch(e), i = o.headers["content-type"], c = i ? ah(i) : void 0, d = c && c !== "application/octet-stream" ? c : ih(e) ?? c ?? "application/octet-stream";
|
|
8681
|
+
if (n && n > qo)
|
|
8682
8682
|
return {
|
|
8683
8683
|
textContent: `Attachment "${a ?? e}" is too large to display inline (${(n / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
|
|
8684
8684
|
};
|
|
8685
8685
|
const u = Buffer.from(await o.arrayBuffer()), l = u.byteLength;
|
|
8686
|
-
if (l >
|
|
8686
|
+
if (l > qo)
|
|
8687
8687
|
return {
|
|
8688
8688
|
textContent: `Attachment "${a ?? e}" is too large to display inline (${(l / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
|
|
8689
8689
|
};
|
|
8690
|
-
const p =
|
|
8690
|
+
const p = nh(d), f = [];
|
|
8691
8691
|
return p === "image" ? f.push({
|
|
8692
8692
|
type: "image",
|
|
8693
8693
|
data: u.toString("base64"),
|
|
@@ -8707,83 +8707,83 @@ const ch = /^https:\/\/(?:files\.todoist\.com|todoist\.b-cdn\.net|d1ysz50cxb9zwl
|
|
|
8707
8707
|
contentItems: f
|
|
8708
8708
|
};
|
|
8709
8709
|
}
|
|
8710
|
-
},
|
|
8711
|
-
...
|
|
8710
|
+
}, ph = {
|
|
8711
|
+
...Od,
|
|
8712
8712
|
_meta: {
|
|
8713
8713
|
ui: {
|
|
8714
8714
|
resourceUri: yt
|
|
8715
8715
|
}
|
|
8716
8716
|
}
|
|
8717
|
-
},
|
|
8717
|
+
}, hh = {
|
|
8718
8718
|
// Task management tools
|
|
8719
8719
|
addTasks: Li,
|
|
8720
8720
|
completeTasks: Xi,
|
|
8721
|
-
uncompleteTasks:
|
|
8722
|
-
updateTasks:
|
|
8723
|
-
rescheduleTasks:
|
|
8724
|
-
findTasks:
|
|
8725
|
-
findTasksByDate:
|
|
8721
|
+
uncompleteTasks: xu,
|
|
8722
|
+
updateTasks: Up,
|
|
8723
|
+
rescheduleTasks: mu,
|
|
8724
|
+
findTasks: Bd,
|
|
8725
|
+
findTasksByDate: ph,
|
|
8726
8726
|
findCompletedTasks: zc,
|
|
8727
8727
|
// Project management tools
|
|
8728
8728
|
addProjects: bi,
|
|
8729
|
-
updateProjects:
|
|
8729
|
+
updateProjects: lp,
|
|
8730
8730
|
findProjects: fd,
|
|
8731
|
-
projectManagement:
|
|
8732
|
-
projectMove:
|
|
8731
|
+
projectManagement: zl,
|
|
8732
|
+
projectMove: Vl,
|
|
8733
8733
|
// Folder management tools
|
|
8734
8734
|
addFolders: ni,
|
|
8735
|
-
updateFolders:
|
|
8735
|
+
updateFolders: Vu,
|
|
8736
8736
|
findFolders: Qc,
|
|
8737
8737
|
// Section management tools
|
|
8738
8738
|
addSections: _i,
|
|
8739
|
-
updateSections:
|
|
8739
|
+
updateSections: vp,
|
|
8740
8740
|
findSections: jd,
|
|
8741
8741
|
// Comment management tools
|
|
8742
8742
|
addComments: Na,
|
|
8743
8743
|
findComments: Uc,
|
|
8744
|
-
updateComments:
|
|
8744
|
+
updateComments: Nu,
|
|
8745
8745
|
// Reminder management tools
|
|
8746
8746
|
addReminders: Ei,
|
|
8747
8747
|
findReminders: kd,
|
|
8748
|
-
updateReminders:
|
|
8748
|
+
updateReminders: wp,
|
|
8749
8749
|
// Attachment tools
|
|
8750
|
-
viewAttachment:
|
|
8750
|
+
viewAttachment: uh,
|
|
8751
8751
|
// Label management tools
|
|
8752
8752
|
addLabels: li,
|
|
8753
|
-
updateLabels:
|
|
8753
|
+
updateLabels: sp,
|
|
8754
8754
|
findLabels: rd,
|
|
8755
8755
|
// Filter management tools
|
|
8756
8756
|
findFilters: Ka,
|
|
8757
8757
|
addFilters: Va,
|
|
8758
|
-
updateFilters:
|
|
8758
|
+
updateFilters: Wu,
|
|
8759
8759
|
// Activity and audit tools
|
|
8760
8760
|
findActivity: vc,
|
|
8761
|
-
getProductivityStats:
|
|
8761
|
+
getProductivityStats: nl,
|
|
8762
8762
|
// Health and insights tools
|
|
8763
|
-
getProjectHealth:
|
|
8764
|
-
getProjectActivityStats:
|
|
8763
|
+
getProjectHealth: ml,
|
|
8764
|
+
getProjectActivityStats: ll,
|
|
8765
8765
|
analyzeProjectHealth: Yi,
|
|
8766
|
-
getWorkspaceInsights:
|
|
8766
|
+
getWorkspaceInsights: vl,
|
|
8767
8767
|
// General tools
|
|
8768
|
-
getOverview:
|
|
8768
|
+
getOverview: ol,
|
|
8769
8769
|
deleteObject: rc,
|
|
8770
8770
|
fetchObject: bc,
|
|
8771
|
-
reorderObjects:
|
|
8772
|
-
userInfo:
|
|
8773
|
-
getUserStatus:
|
|
8774
|
-
setUserStatus:
|
|
8771
|
+
reorderObjects: ru,
|
|
8772
|
+
userInfo: th,
|
|
8773
|
+
getUserStatus: wl,
|
|
8774
|
+
setUserStatus: Eu,
|
|
8775
8775
|
// Assignment and collaboration tools
|
|
8776
8776
|
findProjectCollaborators: cd,
|
|
8777
|
-
manageAssignments:
|
|
8777
|
+
manageAssignments: Fl,
|
|
8778
8778
|
// Template tools
|
|
8779
8779
|
exportProjectTemplate: ic,
|
|
8780
|
-
importProjectTemplate:
|
|
8780
|
+
importProjectTemplate: Al,
|
|
8781
8781
|
// Workspace tools
|
|
8782
|
-
listWorkspaces:
|
|
8782
|
+
listWorkspaces: Pl,
|
|
8783
8783
|
// OpenAI MCP tools
|
|
8784
|
-
search:
|
|
8784
|
+
search: wu,
|
|
8785
8785
|
fetch: wc
|
|
8786
|
-
},
|
|
8786
|
+
}, mh = Object.values(hh), fh = `
|
|
8787
8787
|
## Todoist Task and Project Management Tools
|
|
8788
8788
|
|
|
8789
8789
|
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.
|
|
@@ -8840,72 +8840,72 @@ What each tool does and how to fill its parameters is in the tool's own descript
|
|
|
8840
8840
|
For a productivity review, call **get-productivity-stats**, then find what the user completed as described under "Finding things".
|
|
8841
8841
|
|
|
8842
8842
|
Always provide clear, actionable task titles and descriptions. Use the overview tools to give users context about their workload and project status.
|
|
8843
|
-
`,
|
|
8844
|
-
function
|
|
8843
|
+
`, Oe = { ttlMs: Ut, cacheScope: "private" };
|
|
8844
|
+
function Oh({
|
|
8845
8845
|
token: e,
|
|
8846
8846
|
baseUrl: t,
|
|
8847
8847
|
features: o = []
|
|
8848
8848
|
}) {
|
|
8849
|
-
const r = new
|
|
8849
|
+
const r = new gr(
|
|
8850
8850
|
{ name: "todoist-mcp-server", version: Nt },
|
|
8851
8851
|
{
|
|
8852
8852
|
capabilities: {
|
|
8853
8853
|
tools: { listChanged: !0 },
|
|
8854
8854
|
prompts: { listChanged: !0 }
|
|
8855
8855
|
},
|
|
8856
|
-
instructions:
|
|
8856
|
+
instructions: fh,
|
|
8857
8857
|
cacheHints: {
|
|
8858
|
-
"server/discover":
|
|
8859
|
-
"tools/list":
|
|
8860
|
-
"prompts/list":
|
|
8861
|
-
"resources/list":
|
|
8862
|
-
"resources/templates/list":
|
|
8858
|
+
"server/discover": Oe,
|
|
8859
|
+
"tools/list": Oe,
|
|
8860
|
+
"prompts/list": Oe,
|
|
8861
|
+
"resources/list": Oe,
|
|
8862
|
+
"resources/templates/list": Oe
|
|
8863
8863
|
}
|
|
8864
8864
|
}
|
|
8865
8865
|
), n = kn(e, { baseUrl: t });
|
|
8866
|
-
return qn(r), Ln({ tools:
|
|
8867
|
-
|
|
8866
|
+
return qn(r), Ln({ tools: mh, server: r, client: n, features: o }), r.registerPrompt(
|
|
8867
|
+
xe.name,
|
|
8868
8868
|
{
|
|
8869
|
-
title:
|
|
8870
|
-
description:
|
|
8871
|
-
argsSchema:
|
|
8869
|
+
title: xe.title,
|
|
8870
|
+
description: xe.description,
|
|
8871
|
+
argsSchema: xe.argsSchema
|
|
8872
8872
|
},
|
|
8873
|
-
|
|
8873
|
+
xe.callback
|
|
8874
8874
|
), r;
|
|
8875
8875
|
}
|
|
8876
8876
|
export {
|
|
8877
|
-
|
|
8878
|
-
|
|
8879
|
-
|
|
8880
|
-
|
|
8881
|
-
|
|
8882
|
-
|
|
8883
|
-
|
|
8884
|
-
|
|
8885
|
-
|
|
8886
|
-
|
|
8887
|
-
|
|
8888
|
-
|
|
8889
|
-
|
|
8890
|
-
|
|
8891
|
-
|
|
8892
|
-
|
|
8893
|
-
|
|
8894
|
-
|
|
8895
|
-
|
|
8896
|
-
|
|
8897
|
-
|
|
8898
|
-
|
|
8899
|
-
|
|
8900
|
-
|
|
8901
|
-
|
|
8902
|
-
|
|
8903
|
-
|
|
8904
|
-
|
|
8877
|
+
Up as $,
|
|
8878
|
+
Od as A,
|
|
8879
|
+
Oh as B,
|
|
8880
|
+
ol as C,
|
|
8881
|
+
nl as D,
|
|
8882
|
+
ll as E,
|
|
8883
|
+
xh as F,
|
|
8884
|
+
ml as G,
|
|
8885
|
+
wl as H,
|
|
8886
|
+
vl as I,
|
|
8887
|
+
Al as J,
|
|
8888
|
+
Pl as K,
|
|
8889
|
+
Fl as L,
|
|
8890
|
+
zl as M,
|
|
8891
|
+
Vl as N,
|
|
8892
|
+
mh as O,
|
|
8893
|
+
ru as P,
|
|
8894
|
+
mu as Q,
|
|
8895
|
+
wu as R,
|
|
8896
|
+
Eu as S,
|
|
8897
|
+
xu as T,
|
|
8898
|
+
Nu as U,
|
|
8899
|
+
Wu as V,
|
|
8900
|
+
Vu as W,
|
|
8901
|
+
sp as X,
|
|
8902
|
+
lp as Y,
|
|
8903
|
+
wp as Z,
|
|
8904
|
+
vp as _,
|
|
8905
8905
|
Na as a,
|
|
8906
|
-
|
|
8907
|
-
|
|
8908
|
-
|
|
8906
|
+
th as a0,
|
|
8907
|
+
uh as a1,
|
|
8908
|
+
Dh as a2,
|
|
8909
8909
|
mn as a3,
|
|
8910
8910
|
Va as b,
|
|
8911
8911
|
ni as c,
|
|
@@ -8925,11 +8925,11 @@ export {
|
|
|
8925
8925
|
zc as q,
|
|
8926
8926
|
Ka as r,
|
|
8927
8927
|
Qc as s,
|
|
8928
|
-
|
|
8928
|
+
hh as t,
|
|
8929
8929
|
rd as u,
|
|
8930
8930
|
cd as v,
|
|
8931
8931
|
fd as w,
|
|
8932
8932
|
kd as x,
|
|
8933
8933
|
jd as y,
|
|
8934
|
-
|
|
8934
|
+
Bd as z
|
|
8935
8935
|
};
|