@doist/todoist-mcp 12.5.5 → 12.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +0 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/main-http.js +2 -2
- package/dist/main.js +1 -1
- package/dist/{mcp-server-Cm72B6O_.js → mcp-server-HzS0zbN7.js} +471 -479
- package/dist/mcp-server.d.ts +1 -1
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/{require-valid-todoist-token-DFE6h87D.js → require-valid-todoist-token-B8Dy2Kgy.js} +1 -1
- package/dist/tool-registry.d.ts +0 -8
- package/dist/tool-registry.d.ts.map +1 -1
- package/dist/tools/find-activity.d.ts.map +1 -1
- package/dist/tools/get-project-health.d.ts +0 -8
- package/dist/tools/get-project-health.d.ts.map +1 -1
- package/package.json +2 -2
- package/scripts/eval-instructions.ts +150 -42
|
@@ -28,7 +28,7 @@ function zs() {
|
|
|
28
28
|
}
|
|
29
29
|
return console.error("Failed to load task list app HTML from any known path:", e), Bs;
|
|
30
30
|
}
|
|
31
|
-
const Ht = zs(),
|
|
31
|
+
const Ht = zs(), qs = Rt("sha256").update(Ht).digest("hex").slice(0, 12), Le = `ui://todoist/task-list@${qs}`, Ks = "ui://todoist/task-list@{hash}", Ne = "Interactive task list widget", Ys = "https://ai.todoist.net", Me = {
|
|
32
32
|
ui: {
|
|
33
33
|
prefersBorder: !0,
|
|
34
34
|
csp: {
|
|
@@ -69,7 +69,7 @@ function Gs(e) {
|
|
|
69
69
|
async () => pt(Le)
|
|
70
70
|
), e.registerResource(
|
|
71
71
|
"todoist-task-list-hash-fallback",
|
|
72
|
-
new Ds(
|
|
72
|
+
new Ds(Ks, { list: void 0 }),
|
|
73
73
|
{
|
|
74
74
|
description: `${Ne} compatibility fallback`,
|
|
75
75
|
mimeType: Lt,
|
|
@@ -301,7 +301,7 @@ function Ve(e) {
|
|
|
301
301
|
w(t?.message),
|
|
302
302
|
w(r?.message),
|
|
303
303
|
e instanceof Error ? e.message : w(e)
|
|
304
|
-
].filter((
|
|
304
|
+
].filter((m) => !!m), l = d.find((m) => !He(m)) || d[0], u = L(
|
|
305
305
|
G(n?.errorExtra),
|
|
306
306
|
G(n?.error_extra),
|
|
307
307
|
G(n?.details),
|
|
@@ -371,7 +371,7 @@ function or(e) {
|
|
|
371
371
|
const t = Ve(e);
|
|
372
372
|
return t ? sr(t) : Bt(e);
|
|
373
373
|
}
|
|
374
|
-
const nr = "12.5.
|
|
374
|
+
const nr = "12.5.7", ir = {
|
|
375
375
|
version: nr
|
|
376
376
|
}, C = {
|
|
377
377
|
/** Default limit for task listings */
|
|
@@ -407,7 +407,7 @@ const nr = "12.5.5", ir = {
|
|
|
407
407
|
}, fe = {
|
|
408
408
|
/** Maximum number of failures to show in detailed error messages */
|
|
409
409
|
MAX_FAILURES_SHOWN: 3
|
|
410
|
-
},
|
|
410
|
+
}, qt = {
|
|
411
411
|
/** Maximum tasks accepted by one task create or update operation */
|
|
412
412
|
TASKS_PER_OPERATION: 25
|
|
413
413
|
}, Be = {
|
|
@@ -434,7 +434,7 @@ const nr = "12.5.5", ir = {
|
|
|
434
434
|
*/
|
|
435
435
|
QUEUE_WAIT_MS: 3e4
|
|
436
436
|
};
|
|
437
|
-
function
|
|
437
|
+
function ht(e, { queueTimeoutMs: t = Be.QUEUE_WAIT_MS } = {}) {
|
|
438
438
|
if (!Number.isInteger(e) || e < 1)
|
|
439
439
|
throw new Error(
|
|
440
440
|
`maxConcurrent must be a positive integer, received ${String(e)}`
|
|
@@ -475,24 +475,24 @@ function mt(e, { queueTimeoutMs: t = Be.QUEUE_WAIT_MS } = {}) {
|
|
|
475
475
|
}
|
|
476
476
|
};
|
|
477
477
|
}
|
|
478
|
-
function
|
|
478
|
+
function Kt() {
|
|
479
479
|
return {
|
|
480
|
-
moves:
|
|
481
|
-
writes:
|
|
480
|
+
moves: ht(Be.TASK_MOVES),
|
|
481
|
+
writes: ht(Be.WRITES)
|
|
482
482
|
};
|
|
483
483
|
}
|
|
484
|
-
const
|
|
484
|
+
const mt = /* @__PURE__ */ new Map(), Yt = /* @__PURE__ */ new WeakMap();
|
|
485
485
|
let ft;
|
|
486
486
|
function ar() {
|
|
487
|
-
return ft ??=
|
|
487
|
+
return ft ??= Kt(), ft;
|
|
488
488
|
}
|
|
489
489
|
function cr(e) {
|
|
490
490
|
return Rt("sha256").update(e).digest("hex");
|
|
491
491
|
}
|
|
492
492
|
function dr(e, t) {
|
|
493
493
|
const r = cr(t);
|
|
494
|
-
let o =
|
|
495
|
-
o || (o =
|
|
494
|
+
let o = mt.get(r);
|
|
495
|
+
o || (o = Kt(), mt.set(r, o)), Yt.set(e, o);
|
|
496
496
|
}
|
|
497
497
|
function Gt(e) {
|
|
498
498
|
return Yt.get(e) ?? ar();
|
|
@@ -505,11 +505,11 @@ function ur(e) {
|
|
|
505
505
|
}
|
|
506
506
|
const pr = "todoist-mcp", Je = ir.version, Vt = new Rs(), bt = Us(import.meta.url);
|
|
507
507
|
let Te;
|
|
508
|
-
const
|
|
508
|
+
const hr = async () => {
|
|
509
509
|
const e = bt.resolve("@doist/todoist-sdk"), t = _e(Ut(e), "transport", "http-dispatcher.js");
|
|
510
510
|
return bt(t);
|
|
511
511
|
};
|
|
512
|
-
let
|
|
512
|
+
let mr = hr;
|
|
513
513
|
function fr() {
|
|
514
514
|
return `${pr}/${Je}`;
|
|
515
515
|
}
|
|
@@ -583,7 +583,7 @@ function Tr(e, t) {
|
|
|
583
583
|
}
|
|
584
584
|
async function kr() {
|
|
585
585
|
if (wr())
|
|
586
|
-
return Te || (Te =
|
|
586
|
+
return Te || (Te = mr().then((e) => e.getDefaultDispatcher()).catch((e) => {
|
|
587
587
|
throw Te = void 0, e;
|
|
588
588
|
})), Te;
|
|
589
589
|
}
|
|
@@ -608,18 +608,18 @@ function Ir(e) {
|
|
|
608
608
|
function Sr(e = globalThis.fetch, t = {}) {
|
|
609
609
|
const r = e === globalThis.fetch, { enabled: o = !0, platform: n = "mcp", sessionId: i = Pe() } = t;
|
|
610
610
|
return async (a, c = {}) => {
|
|
611
|
-
const { timeout: d, headers: l, signal: u, ...p } = c, { signal:
|
|
611
|
+
const { timeout: d, headers: l, signal: u, ...p } = c, { signal: h, cleanup: m } = Tr(u, d);
|
|
612
612
|
try {
|
|
613
613
|
const y = {
|
|
614
614
|
...p,
|
|
615
|
-
signal:
|
|
615
|
+
signal: h,
|
|
616
616
|
...o ? { headers: yr(l, { platform: n, sessionId: i }) } : l !== void 0 ? { headers: l } : {}
|
|
617
617
|
};
|
|
618
618
|
r && await vr(y);
|
|
619
619
|
const f = await e(a, y);
|
|
620
620
|
return Ir(f);
|
|
621
621
|
} finally {
|
|
622
|
-
|
|
622
|
+
m();
|
|
623
623
|
}
|
|
624
624
|
};
|
|
625
625
|
}
|
|
@@ -763,7 +763,7 @@ const g = {
|
|
|
763
763
|
// OpenAI MCP tools
|
|
764
764
|
SEARCH: "search",
|
|
765
765
|
FETCH: "fetch"
|
|
766
|
-
},
|
|
766
|
+
}, Md = {
|
|
767
767
|
/**
|
|
768
768
|
* Strips email addresses from tool outputs that expose user data.
|
|
769
769
|
* Affects: find-project-collaborators, find-completed-tasks
|
|
@@ -811,15 +811,15 @@ const Br = [
|
|
|
811
811
|
g.FIND_PROJECT_COLLABORATORS,
|
|
812
812
|
g.FIND_COMPLETED_TASKS
|
|
813
813
|
];
|
|
814
|
-
function
|
|
814
|
+
function qe(e) {
|
|
815
815
|
if (e == null)
|
|
816
816
|
return e;
|
|
817
817
|
if (Array.isArray(e))
|
|
818
|
-
return e.map((t) =>
|
|
818
|
+
return e.map((t) => qe(t));
|
|
819
819
|
if (typeof e == "object") {
|
|
820
820
|
const t = {};
|
|
821
821
|
for (const [r, o] of Object.entries(e))
|
|
822
|
-
r !== "email" && (t[r] =
|
|
822
|
+
r !== "email" && (t[r] = qe(o));
|
|
823
823
|
return t;
|
|
824
824
|
}
|
|
825
825
|
return e;
|
|
@@ -828,7 +828,7 @@ function zr(e) {
|
|
|
828
828
|
const t = /\s*\([^)]*@[^)]+\)/g, r = /\S+@\S+\.\S+/g;
|
|
829
829
|
return e.replace(t, "").replace(r, "[email hidden]");
|
|
830
830
|
}
|
|
831
|
-
function
|
|
831
|
+
function qr({
|
|
832
832
|
tool: e,
|
|
833
833
|
server: t,
|
|
834
834
|
client: r,
|
|
@@ -836,11 +836,11 @@ function Kr({
|
|
|
836
836
|
}) {
|
|
837
837
|
const n = o.some((d) => d.name === "strip_emails") && Br.includes(e.name), i = e.execute, a = async (d, l) => {
|
|
838
838
|
try {
|
|
839
|
-
let { textContent: u, structuredContent: p, contentItems:
|
|
839
|
+
let { textContent: u, structuredContent: p, contentItems: h } = await br(
|
|
840
840
|
e.name,
|
|
841
841
|
() => O(() => i(d, r))
|
|
842
842
|
);
|
|
843
|
-
return n && (u && (u = zr(u)), p && (p =
|
|
843
|
+
return n && (u && (u = zr(u)), p && (p = qe(p))), Ur({ textContent: u, structuredContent: p, contentItems: h });
|
|
844
844
|
} catch (u) {
|
|
845
845
|
return console.error(`Error executing tool ${e.name}:`, { args: Mr(d), error: u }), Lr(or(u));
|
|
846
846
|
}
|
|
@@ -865,7 +865,7 @@ function Kr({
|
|
|
865
865
|
}
|
|
866
866
|
t.registerTool(e.name, c, a);
|
|
867
867
|
}
|
|
868
|
-
const
|
|
868
|
+
const Kr = {
|
|
869
869
|
period: s.enum(["today", "7d", "14d", "30d", "this-week", "this-month"]).default("7d").describe(
|
|
870
870
|
'Time period for the analysis. "today" analyzes the current day, "7d"/"14d"/"30d" analyze the last N days, "this-week" and "this-month" analyze the current week or month.'
|
|
871
871
|
),
|
|
@@ -997,11 +997,11 @@ function Jr(e) {
|
|
|
997
997
|
]
|
|
998
998
|
};
|
|
999
999
|
}
|
|
1000
|
-
const
|
|
1000
|
+
const me = {
|
|
1001
1001
|
name: "productivity-analysis",
|
|
1002
1002
|
title: "Productivity Analysis",
|
|
1003
1003
|
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.",
|
|
1004
|
-
argsSchema:
|
|
1004
|
+
argsSchema: Kr,
|
|
1005
1005
|
callback: Jr
|
|
1006
1006
|
};
|
|
1007
1007
|
class _ extends Error {
|
|
@@ -1126,12 +1126,12 @@ class ro {
|
|
|
1126
1126
|
try {
|
|
1127
1127
|
const p = await t.getUser();
|
|
1128
1128
|
if (p) {
|
|
1129
|
-
const
|
|
1129
|
+
const h = {
|
|
1130
1130
|
id: p.id,
|
|
1131
1131
|
name: p.fullName,
|
|
1132
1132
|
email: p.email
|
|
1133
1133
|
};
|
|
1134
|
-
d.some((
|
|
1134
|
+
d.some((m) => m.id === p.id) || (d = [h, ...d]);
|
|
1135
1135
|
}
|
|
1136
1136
|
} catch {
|
|
1137
1137
|
}
|
|
@@ -1197,18 +1197,18 @@ class ro {
|
|
|
1197
1197
|
const c = (await M({
|
|
1198
1198
|
apiMethod: t.getProjects.bind(t),
|
|
1199
1199
|
args: {}
|
|
1200
|
-
})).filter((
|
|
1200
|
+
})).filter((h) => h.isShared);
|
|
1201
1201
|
if (c.length === 0) {
|
|
1202
|
-
const
|
|
1203
|
-
return n && oe.set(n,
|
|
1202
|
+
const h = [];
|
|
1203
|
+
return n && oe.set(n, h), h;
|
|
1204
1204
|
}
|
|
1205
1205
|
const d = [], l = /* @__PURE__ */ new Set(), u = c.map(
|
|
1206
|
-
(
|
|
1206
|
+
(h) => this.getProjectCollaborators(t, h.id, o)
|
|
1207
1207
|
), p = await Promise.allSettled(u);
|
|
1208
|
-
for (const
|
|
1209
|
-
if (
|
|
1210
|
-
for (const
|
|
1211
|
-
|
|
1208
|
+
for (const h of p)
|
|
1209
|
+
if (h.status === "fulfilled")
|
|
1210
|
+
for (const m of h.value)
|
|
1211
|
+
m && !l.has(m.id) && (d.push(m), l.add(m.id));
|
|
1212
1212
|
return n && oe.set(n, d), d;
|
|
1213
1213
|
} catch {
|
|
1214
1214
|
return [];
|
|
@@ -1419,7 +1419,7 @@ function po(e) {
|
|
|
1419
1419
|
extraData: e.extraData ?? void 0
|
|
1420
1420
|
};
|
|
1421
1421
|
}
|
|
1422
|
-
const
|
|
1422
|
+
const ho = se.object({
|
|
1423
1423
|
httpStatusCode: se.number(),
|
|
1424
1424
|
responseData: se.object({
|
|
1425
1425
|
error: se.string(),
|
|
@@ -1437,7 +1437,7 @@ async function tt({
|
|
|
1437
1437
|
const { results: n, nextCursor: i } = await e.getTasksByFilter({ query: t, cursor: o, limit: r });
|
|
1438
1438
|
return { tasks: n.map(P), nextCursor: i };
|
|
1439
1439
|
} catch (n) {
|
|
1440
|
-
const i =
|
|
1440
|
+
const i = ho.safeParse(n);
|
|
1441
1441
|
if (!i.success)
|
|
1442
1442
|
throw n;
|
|
1443
1443
|
const { responseData: a } = i.data;
|
|
@@ -1493,12 +1493,12 @@ function ns(e) {
|
|
|
1493
1493
|
return { timeBasedCount: t, locationCount: r };
|
|
1494
1494
|
}
|
|
1495
1495
|
const Ie = Re.map((e) => e.key);
|
|
1496
|
-
function
|
|
1496
|
+
function mo(e) {
|
|
1497
1497
|
if (typeof e != "string") return;
|
|
1498
1498
|
const t = e.toLowerCase();
|
|
1499
1499
|
return (Re.find((o) => o.key === t) ?? Re.find((o) => o.displayName.toLowerCase() === t))?.key;
|
|
1500
1500
|
}
|
|
1501
|
-
const fo = `Color for the entity. Accepts a color key (e.g. "berry_red") or display name (e.g. "Berry Red"). Valid colors: ${Ie.join(", ")}. Unrecognized colors are omitted and charcoal will be used as the default.`, le = s.preprocess(
|
|
1501
|
+
const fo = `Color for the entity. Accepts a color key (e.g. "berry_red") or display name (e.g. "Berry Red"). Valid colors: ${Ie.join(", ")}. Unrecognized colors are omitted and charcoal will be used as the default.`, le = s.preprocess(mo, s.enum(Ie).optional()).describe(fo);
|
|
1502
1502
|
s.enum(Ie);
|
|
1503
1503
|
const ue = s.enum(Ie).optional().catch(void 0), F = s.object({
|
|
1504
1504
|
id: s.string(),
|
|
@@ -1539,7 +1539,7 @@ const ue = s.enum(Ie).optional().catch(void 0), F = s.object({
|
|
|
1539
1539
|
sectionOrder: s.number().describe("Ordering index within the project."),
|
|
1540
1540
|
description: s.string().optional().describe("Supports Markdown.")
|
|
1541
1541
|
});
|
|
1542
|
-
function
|
|
1542
|
+
function q({ id: e, name: t, sectionOrder: r, description: o }) {
|
|
1543
1543
|
return { id: e, name: t, sectionOrder: r, description: o ?? void 0 };
|
|
1544
1544
|
}
|
|
1545
1545
|
const bo = s.object({
|
|
@@ -1636,14 +1636,14 @@ const bo = s.object({
|
|
|
1636
1636
|
);
|
|
1637
1637
|
}
|
|
1638
1638
|
const n = r.some((l) => N(l.projectId)) ? await t.getUser() : void 0, i = r.map(async ({ content: l, taskId: u, projectId: p }) => {
|
|
1639
|
-
const
|
|
1639
|
+
const h = await de({
|
|
1640
1640
|
projectId: p,
|
|
1641
1641
|
user: n,
|
|
1642
1642
|
client: n ? void 0 : t
|
|
1643
1643
|
});
|
|
1644
1644
|
return await t.addComment({
|
|
1645
1645
|
content: l,
|
|
1646
|
-
...u ? { taskId: u } : { projectId:
|
|
1646
|
+
...u ? { taskId: u } : { projectId: h }
|
|
1647
1647
|
});
|
|
1648
1648
|
}), c = (await Promise.all(i)).map(ge);
|
|
1649
1649
|
return {
|
|
@@ -1752,7 +1752,7 @@ const xo = s.object({
|
|
|
1752
1752
|
outputSchema: Eo,
|
|
1753
1753
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1754
1754
|
async execute({ filters: e }, t) {
|
|
1755
|
-
const r = Date.now(), o = e.map((p,
|
|
1755
|
+
const r = Date.now(), o = e.map((p, h) => `tempFilterAdd${h}${r}`), n = e.map((p, h) => V(
|
|
1756
1756
|
"filter_add",
|
|
1757
1757
|
{
|
|
1758
1758
|
name: p.name,
|
|
@@ -1760,9 +1760,9 @@ const xo = s.object({
|
|
|
1760
1760
|
...p.color !== void 0 ? { color: p.color } : {},
|
|
1761
1761
|
...p.isFavorite !== void 0 ? { isFavorite: p.isFavorite } : {}
|
|
1762
1762
|
},
|
|
1763
|
-
o[
|
|
1764
|
-
)), a = (await t.sync({ commands: n })).tempIdMapping ?? {}, c = e.map((p,
|
|
1765
|
-
const
|
|
1763
|
+
o[h]
|
|
1764
|
+
)), a = (await t.sync({ commands: n })).tempIdMapping ?? {}, c = e.map((p, h) => {
|
|
1765
|
+
const m = o[h], y = m !== void 0 ? a[m] : void 0;
|
|
1766
1766
|
if (!y) return null;
|
|
1767
1767
|
const f = p.color !== void 0 ? ue.parse(p.color) : void 0;
|
|
1768
1768
|
return {
|
|
@@ -1883,7 +1883,7 @@ function Se(e, t = 5) {
|
|
|
1883
1883
|
}
|
|
1884
1884
|
return o;
|
|
1885
1885
|
}
|
|
1886
|
-
function
|
|
1886
|
+
function K({
|
|
1887
1887
|
subject: e,
|
|
1888
1888
|
count: t,
|
|
1889
1889
|
limit: r,
|
|
@@ -1978,9 +1978,9 @@ const as = new Bo(), zo = s.object({
|
|
|
1978
1978
|
workspace: s.string().trim().min(1).optional().describe(
|
|
1979
1979
|
"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."
|
|
1980
1980
|
)
|
|
1981
|
-
}),
|
|
1981
|
+
}), qo = {
|
|
1982
1982
|
projects: s.array(zo).min(1).describe("The array of projects to add.")
|
|
1983
|
-
},
|
|
1983
|
+
}, Ko = {
|
|
1984
1984
|
projects: s.array(Q).describe("The created projects."),
|
|
1985
1985
|
totalCount: s.number().describe("The total number of projects created."),
|
|
1986
1986
|
failures: s.array(ee).describe(
|
|
@@ -1992,8 +1992,8 @@ const as = new Bo(), zo = s.object({
|
|
|
1992
1992
|
}, Yo = {
|
|
1993
1993
|
name: g.ADD_PROJECTS,
|
|
1994
1994
|
description: "Add one or more new projects.",
|
|
1995
|
-
parameters:
|
|
1996
|
-
outputSchema:
|
|
1995
|
+
parameters: qo,
|
|
1996
|
+
outputSchema: Ko,
|
|
1997
1997
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1998
1998
|
async execute({ projects: e }, t) {
|
|
1999
1999
|
const r = /* @__PURE__ */ new Map(), o = (l) => {
|
|
@@ -2185,7 +2185,7 @@ const rn = s.object({
|
|
|
2185
2185
|
}), {
|
|
2186
2186
|
textContent: cn({ sections: n, failures: i }),
|
|
2187
2187
|
structuredContent: {
|
|
2188
|
-
sections: n.map(
|
|
2188
|
+
sections: n.map(q),
|
|
2189
2189
|
totalCount: n.length,
|
|
2190
2190
|
failures: i,
|
|
2191
2191
|
totalRequested: e.length,
|
|
@@ -2394,15 +2394,15 @@ class dn {
|
|
|
2394
2394
|
const u = await W.resolveUser(t, o);
|
|
2395
2395
|
if (!u)
|
|
2396
2396
|
return i.push("User not found - check spelling or invite to a shared project"), { canAssign: !1, projectInfo: l, recommendations: i };
|
|
2397
|
-
const p = d.some((y) => y.id === u.userId),
|
|
2397
|
+
const p = d.some((y) => y.id === u.userId), h = {
|
|
2398
2398
|
resolvedName: u.displayName,
|
|
2399
2399
|
isCollaborator: p
|
|
2400
2400
|
};
|
|
2401
2401
|
if (!p)
|
|
2402
2402
|
return i.push(
|
|
2403
2403
|
`Invite ${u.displayName} to collaborate on project "${c.name}"`
|
|
2404
|
-
), { canAssign: !1, projectInfo: l, userInfo:
|
|
2405
|
-
let
|
|
2404
|
+
), { canAssign: !1, projectInfo: l, userInfo: h, recommendations: i };
|
|
2405
|
+
let m;
|
|
2406
2406
|
if (n && n.length > 0) {
|
|
2407
2407
|
let y = 0, f = 0;
|
|
2408
2408
|
for (const v of n)
|
|
@@ -2411,13 +2411,13 @@ class dn {
|
|
|
2411
2411
|
} catch {
|
|
2412
2412
|
f++;
|
|
2413
2413
|
}
|
|
2414
|
-
|
|
2414
|
+
m = { accessibleTasks: y, inaccessibleTasks: f }, f > 0 && i.push(`${f} task(s) are not accessible`);
|
|
2415
2415
|
}
|
|
2416
2416
|
return a = !0, i.push(`Ready to assign tasks to ${u.displayName}`), {
|
|
2417
2417
|
canAssign: a,
|
|
2418
2418
|
projectInfo: l,
|
|
2419
|
-
userInfo:
|
|
2420
|
-
taskInfo:
|
|
2419
|
+
userInfo: h,
|
|
2420
|
+
taskInfo: m,
|
|
2421
2421
|
recommendations: i
|
|
2422
2422
|
};
|
|
2423
2423
|
}
|
|
@@ -2426,7 +2426,7 @@ const at = new dn();
|
|
|
2426
2426
|
function U(e) {
|
|
2427
2427
|
return s.string().transform((t) => t === "" ? void 0 : t).optional().describe(e);
|
|
2428
2428
|
}
|
|
2429
|
-
const Tt =
|
|
2429
|
+
const Tt = qt.TASKS_PER_OPERATION, ln = s.object({
|
|
2430
2430
|
content: s.string().min(1).describe(
|
|
2431
2431
|
'The task name/title. Should be concise and actionable (e.g., "Review PR #123", "Call dentist"). For longer content, use the description field instead. Supports Markdown.'
|
|
2432
2432
|
),
|
|
@@ -2473,38 +2473,38 @@ const Tt = Kt.TASKS_PER_OPERATION, ln = s.object({
|
|
|
2473
2473
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
2474
2474
|
async execute(e, t) {
|
|
2475
2475
|
const { tasks: r } = s.object(kt).parse(e), o = /* @__PURE__ */ new Map();
|
|
2476
|
-
r.forEach((
|
|
2477
|
-
const y =
|
|
2478
|
-
f ? f.push({ task:
|
|
2476
|
+
r.forEach((h, m) => {
|
|
2477
|
+
const y = hn(h), f = o.get(y);
|
|
2478
|
+
f ? f.push({ task: h, index: m }) : o.set(y, [{ task: h, index: m }]);
|
|
2479
2479
|
});
|
|
2480
2480
|
const n = /* @__PURE__ */ new Map(), a = (await Promise.all(
|
|
2481
|
-
[...o.values()].map(async (
|
|
2482
|
-
const
|
|
2483
|
-
for (const { task: y, index: f } of
|
|
2481
|
+
[...o.values()].map(async (h) => {
|
|
2482
|
+
const m = [];
|
|
2483
|
+
for (const { task: y, index: f } of h)
|
|
2484
2484
|
try {
|
|
2485
|
-
const v = await
|
|
2486
|
-
|
|
2485
|
+
const v = await mn(y, t, n);
|
|
2486
|
+
m.push({ index: f, result: { status: "fulfilled", value: v } });
|
|
2487
2487
|
} catch (v) {
|
|
2488
|
-
|
|
2488
|
+
m.push({
|
|
2489
2489
|
index: f,
|
|
2490
2490
|
result: { status: "rejected", reason: v }
|
|
2491
2491
|
});
|
|
2492
2492
|
}
|
|
2493
|
-
return
|
|
2493
|
+
return m;
|
|
2494
2494
|
})
|
|
2495
|
-
)).flat().sort((
|
|
2495
|
+
)).flat().sort((h, m) => h.index - m.index), c = [], d = [];
|
|
2496
2496
|
let l = !1;
|
|
2497
|
-
for (const { index:
|
|
2498
|
-
|
|
2499
|
-
item: r[
|
|
2497
|
+
for (const { index: h, result: m } of a)
|
|
2498
|
+
m.status === "fulfilled" ? c.push(m.value) : (l ||= m.reason instanceof ve, d.push({
|
|
2499
|
+
item: r[h]?.content ?? `Task ${h + 1}`,
|
|
2500
2500
|
// Keep API error signals (status/code/tag) — `error.message`
|
|
2501
2501
|
// alone collapses e.g. a full-project rejection into a bare
|
|
2502
2502
|
// "HTTP 403: Forbidden"
|
|
2503
|
-
error: z(
|
|
2503
|
+
error: z(m.reason)
|
|
2504
2504
|
}));
|
|
2505
2505
|
if (c.length === 0 && d.length > 0) {
|
|
2506
|
-
const
|
|
2507
|
-
throw l ? new zt(
|
|
2506
|
+
const h = d.map((y) => `"${y.item}": ${y.error}`).join("; "), m = `All ${d.length} task(s) failed to create: ${h}`;
|
|
2507
|
+
throw l ? new zt(m) : new Error(m);
|
|
2508
2508
|
}
|
|
2509
2509
|
const u = c.map(P);
|
|
2510
2510
|
return {
|
|
@@ -2524,10 +2524,10 @@ const Tt = Kt.TASKS_PER_OPERATION, ln = s.object({
|
|
|
2524
2524
|
};
|
|
2525
2525
|
}
|
|
2526
2526
|
};
|
|
2527
|
-
function
|
|
2527
|
+
function hn(e) {
|
|
2528
2528
|
return `${e.projectId ?? ""}|${e.sectionId ?? ""}|${e.parentId ?? ""}`;
|
|
2529
2529
|
}
|
|
2530
|
-
async function
|
|
2530
|
+
async function mn(e, t, r) {
|
|
2531
2531
|
const {
|
|
2532
2532
|
duration: o,
|
|
2533
2533
|
projectId: n,
|
|
@@ -2538,25 +2538,25 @@ async function hn(e, t, r) {
|
|
|
2538
2538
|
priority: l,
|
|
2539
2539
|
labels: u,
|
|
2540
2540
|
deadlineDate: p,
|
|
2541
|
-
...
|
|
2542
|
-
} = e,
|
|
2543
|
-
if (
|
|
2544
|
-
const f = await t.getProject(
|
|
2541
|
+
...h
|
|
2542
|
+
} = e, m = N(n) ? void 0 : n;
|
|
2543
|
+
if (m) {
|
|
2544
|
+
const f = await t.getProject(m);
|
|
2545
2545
|
if (f.isArchived)
|
|
2546
2546
|
throw new Error(
|
|
2547
2547
|
`Task "${e.content}": Cannot create task in archived project "${f.name}"`
|
|
2548
2548
|
);
|
|
2549
2549
|
}
|
|
2550
2550
|
let y = {
|
|
2551
|
-
...
|
|
2552
|
-
projectId:
|
|
2551
|
+
...h,
|
|
2552
|
+
projectId: m,
|
|
2553
2553
|
sectionId: i,
|
|
2554
2554
|
parentId: a,
|
|
2555
2555
|
order: c,
|
|
2556
2556
|
labels: u,
|
|
2557
2557
|
deadlineDate: p
|
|
2558
2558
|
};
|
|
2559
|
-
if (l && (y.priority = Zt(l)), d && !
|
|
2559
|
+
if (l && (y.priority = Zt(l)), d && !m && !i && !a)
|
|
2560
2560
|
throw new Error(
|
|
2561
2561
|
`Task "${e.content}": Cannot assign tasks without specifying project context. Please specify a projectId, sectionId, or parentId.`
|
|
2562
2562
|
);
|
|
@@ -2572,7 +2572,7 @@ async function hn(e, t, r) {
|
|
|
2572
2572
|
throw f instanceof _ ? new Error(`Task "${e.content}": ${f.message}`) : f;
|
|
2573
2573
|
}
|
|
2574
2574
|
if (d) {
|
|
2575
|
-
let f =
|
|
2575
|
+
let f = m;
|
|
2576
2576
|
if (!f && a)
|
|
2577
2577
|
try {
|
|
2578
2578
|
f = (await t.getTask(a)).projectId;
|
|
@@ -2999,7 +2999,7 @@ const ps = ["task", "project", "comment", "section"], Rn = {
|
|
|
2999
2999
|
const i = await t.getSection(o);
|
|
3000
3000
|
if (!i)
|
|
3001
3001
|
throw new Error(`Section ${o} not found.`);
|
|
3002
|
-
const a =
|
|
3002
|
+
const a = q(i);
|
|
3003
3003
|
return {
|
|
3004
3004
|
textContent: `Found section: ${a.name} • id=${a.id}`,
|
|
3005
3005
|
structuredContent: {
|
|
@@ -3110,7 +3110,9 @@ const Wn = {
|
|
|
3110
3110
|
]).optional().describe("Type of event to filter by."),
|
|
3111
3111
|
projectId: s.string().optional().describe("Filter events by parent project ID."),
|
|
3112
3112
|
taskId: s.string().optional().describe("Filter events by parent task ID (for subtask events)."),
|
|
3113
|
-
initiatorId: s.string().optional().describe(
|
|
3113
|
+
initiatorId: s.string().optional().describe(
|
|
3114
|
+
'Filter by the user ID who initiated the event. A first-person question ("what did I complete") needs this: without it the results cover every collaborator. Get the ID from user-info when you do not already have it.'
|
|
3115
|
+
),
|
|
3114
3116
|
dateFrom: St(
|
|
3115
3117
|
`Inclusive start of the activity range, as an ISO 8601 date or date-time. For all events on one local calendar day, use that day's start, for example "2026-08-02T00:00:00-04:00". Natural-language dates such as "tomorrow" are not supported.`
|
|
3116
3118
|
),
|
|
@@ -3127,7 +3129,7 @@ const Wn = {
|
|
|
3127
3129
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
3128
3130
|
}, zn = {
|
|
3129
3131
|
name: g.FIND_ACTIVITY,
|
|
3130
|
-
description:
|
|
3132
|
+
description: `Retrieve activity logs to monitor and audit changes in Todoist. Shows events from all users by default (use initiatorId to filter by specific user). To answer what someone completed in a period, including recurring task occurrences, use objectType "task", eventType "completed", and dateFrom/dateTo. For a first-person question ("what did I get done"), also set initiatorId to the current user from user-info, or the answer includes collaborators' completions. Track task completions, updates, deletions, project changes, and more with flexible filtering. Activity history availability and retention depend on the user plan.`,
|
|
3131
3133
|
parameters: Wn,
|
|
3132
3134
|
outputSchema: Bn,
|
|
3133
3135
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
@@ -3143,14 +3145,14 @@ const Wn = {
|
|
|
3143
3145
|
dateTo: l,
|
|
3144
3146
|
limit: u,
|
|
3145
3147
|
cursor: p
|
|
3146
|
-
} = e,
|
|
3148
|
+
} = e, h = {
|
|
3147
3149
|
limit: u,
|
|
3148
3150
|
cursor: p ?? null
|
|
3149
3151
|
};
|
|
3150
|
-
r && n ?
|
|
3151
|
-
const { results:
|
|
3152
|
+
r && n ? h.objectEventTypes = `${r}:${n}` : r ? h.objectEventTypes = `${r}:` : n && (h.objectEventTypes = `:${n}`), o && o !== "remove" && (h.objectId = o), i && (h.parentProjectId = i), a && (h.parentItemId = a), c && (h.initiatorId = c), d && (h.dateFrom = d), l && (h.dateTo = l);
|
|
3153
|
+
const { results: m, nextCursor: y } = await t.getActivityLogs(h), f = m.map(po);
|
|
3152
3154
|
return {
|
|
3153
|
-
textContent:
|
|
3155
|
+
textContent: qn({ events: f, args: e, nextCursor: y }),
|
|
3154
3156
|
structuredContent: {
|
|
3155
3157
|
events: f,
|
|
3156
3158
|
nextCursor: y ?? void 0,
|
|
@@ -3161,7 +3163,7 @@ const Wn = {
|
|
|
3161
3163
|
};
|
|
3162
3164
|
}
|
|
3163
3165
|
};
|
|
3164
|
-
function
|
|
3166
|
+
function qn({
|
|
3165
3167
|
events: e,
|
|
3166
3168
|
args: t,
|
|
3167
3169
|
nextCursor: r
|
|
@@ -3176,17 +3178,17 @@ function Kn({
|
|
|
3176
3178
|
const i = [];
|
|
3177
3179
|
t.objectId && i.push(`object ID: ${t.objectId}`), t.projectId && i.push(`project: ${t.projectId}`), t.taskId && i.push(`task: ${t.taskId}`), t.initiatorId && i.push(`initiator: ${t.initiatorId}`), t.dateFrom && i.push(`from: ${t.dateFrom}`), t.dateTo && i.push(`until (exclusive): ${t.dateTo}`);
|
|
3178
3180
|
const a = [];
|
|
3179
|
-
return e.length === 0 && (a.push("No activity events match the specified filters"), a.push("Note: Activity logs only show recent events"), t.eventType && a.push(`Try removing the eventType filter (${t.eventType})`), t.objectType && a.push(`Try removing the objectType filter (${t.objectType})`), (t.objectId || t.projectId || t.taskId) && a.push("Verify the object ID is correct")),
|
|
3181
|
+
return e.length === 0 && (a.push("No activity events match the specified filters"), a.push("Note: Activity logs only show recent events"), t.eventType && a.push(`Try removing the eventType filter (${t.eventType})`), t.objectType && a.push(`Try removing the objectType filter (${t.objectType})`), (t.objectId || t.projectId || t.taskId) && a.push("Verify the object ID is correct")), K({
|
|
3180
3182
|
subject: o,
|
|
3181
3183
|
count: e.length,
|
|
3182
3184
|
limit: t.limit,
|
|
3183
3185
|
nextCursor: r ?? void 0,
|
|
3184
3186
|
filterHints: i,
|
|
3185
|
-
previewLines:
|
|
3187
|
+
previewLines: Kn(e, Math.min(e.length, t.limit)),
|
|
3186
3188
|
zeroReasonHints: a
|
|
3187
3189
|
});
|
|
3188
3190
|
}
|
|
3189
|
-
function
|
|
3191
|
+
function Kn(e, t = 10) {
|
|
3190
3192
|
const o = e.slice(0, t).map(Yn).join(`
|
|
3191
3193
|
`);
|
|
3192
3194
|
if (e.length > t) {
|
|
@@ -3319,7 +3321,7 @@ ${a}`;
|
|
|
3319
3321
|
}
|
|
3320
3322
|
return i;
|
|
3321
3323
|
}
|
|
3322
|
-
function
|
|
3324
|
+
function hs(e) {
|
|
3323
3325
|
const t = e.getUTCFullYear(), r = String(e.getUTCMonth() + 1).padStart(2, "0"), o = String(e.getUTCDate()).padStart(2, "0");
|
|
3324
3326
|
return `${t}-${r}-${o}`;
|
|
3325
3327
|
}
|
|
@@ -3332,14 +3334,14 @@ function Qn(e) {
|
|
|
3332
3334
|
}
|
|
3333
3335
|
function ei(e, t) {
|
|
3334
3336
|
const r = new Date(e.getTime() + t * 60 * 1e3);
|
|
3335
|
-
return
|
|
3337
|
+
return hs(r);
|
|
3336
3338
|
}
|
|
3337
3339
|
function jt(e, t) {
|
|
3338
3340
|
const [r, o, n] = e.split("-"), i = Number(r), a = Number(o), c = Number(n);
|
|
3339
3341
|
if (!Number.isFinite(i) || !Number.isFinite(a) || !Number.isFinite(c))
|
|
3340
3342
|
throw new Error(`Invalid date format: ${e}. Expected YYYY-MM-DD.`);
|
|
3341
3343
|
const d = new Date(Date.UTC(i, a - 1, c));
|
|
3342
|
-
return d.setUTCDate(d.getUTCDate() + t),
|
|
3344
|
+
return d.setUTCDate(d.getUTCDate() + t), hs(d);
|
|
3343
3345
|
}
|
|
3344
3346
|
const ti = ["and", "or"], ct = {
|
|
3345
3347
|
labels: s.string().array().optional().describe("The labels to filter the tasks by"),
|
|
@@ -3397,7 +3399,7 @@ const oi = {
|
|
|
3397
3399
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
3398
3400
|
}, ii = {
|
|
3399
3401
|
name: g.FIND_COMPLETED_TASKS,
|
|
3400
|
-
description:
|
|
3402
|
+
description: 'Get completed tasks in a date range. For "what did I complete/get done" questions, use find-activity instead — it reports completion events, including every occurrence of a recurring task, which this tool does not. since/until are optional and default to a 7-day window when omitted. Includes all collaborators by default. Person-specific queries (summaries, plans, reports) require responsibleUser.',
|
|
3401
3403
|
parameters: oi,
|
|
3402
3404
|
outputSchema: ni,
|
|
3403
3405
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
@@ -3408,8 +3410,8 @@ const oi = {
|
|
|
3408
3410
|
"Cursor pagination requires explicit since and until. Reuse structuredContent.appliedFilters.since and structuredContent.appliedFilters.until from the previous page."
|
|
3409
3411
|
);
|
|
3410
3412
|
const u = await Qe(t, c), p = u?.email;
|
|
3411
|
-
let
|
|
3412
|
-
u && p && (
|
|
3413
|
+
let m = dt(o, n);
|
|
3414
|
+
u && p && (m = ce(m, `assigned to: ${p}`));
|
|
3413
3415
|
const y = await t.getUser(), f = y.tzInfo?.gmtString || "+00:00", v = await de({
|
|
3414
3416
|
projectId: d,
|
|
3415
3417
|
user: y
|
|
@@ -3426,13 +3428,13 @@ const oi = {
|
|
|
3426
3428
|
projectId: v,
|
|
3427
3429
|
since: I,
|
|
3428
3430
|
until: x,
|
|
3429
|
-
...
|
|
3431
|
+
...m ? { filterQuery: m, filterLang: "en" } : {}
|
|
3430
3432
|
}) : await t.getCompletedTasksByDueDate({
|
|
3431
3433
|
...l,
|
|
3432
3434
|
projectId: v,
|
|
3433
3435
|
since: I,
|
|
3434
3436
|
until: x,
|
|
3435
|
-
...
|
|
3437
|
+
...m ? { filterQuery: m, filterLang: "en" } : {}
|
|
3436
3438
|
}), $ = b.map(P);
|
|
3437
3439
|
return {
|
|
3438
3440
|
textContent: ai({
|
|
@@ -3467,7 +3469,7 @@ function ai({
|
|
|
3467
3469
|
a.push(`assigned to: ${d}`);
|
|
3468
3470
|
}
|
|
3469
3471
|
const c = [];
|
|
3470
|
-
return e.length === 0 && (c.push("No tasks completed in this date range"), c.push("Try expanding the date range"), (t.projectId || t.sectionId || t.parentId) && c.push("Try removing project/section/parent filters"), t.getBy === "due" && c.push('Try switching to "completion" date instead')),
|
|
3472
|
+
return e.length === 0 && (c.push("No tasks completed in this date range"), c.push("Try expanding the date range"), (t.projectId || t.sectionId || t.parentId) && c.push("Try removing project/section/parent filters"), t.getBy === "due" && c.push('Try switching to "completion" date instead')), K({
|
|
3471
3473
|
subject: i,
|
|
3472
3474
|
count: e.length,
|
|
3473
3475
|
limit: t.limit,
|
|
@@ -3533,10 +3535,10 @@ function ui({
|
|
|
3533
3535
|
`), l = e.length - a, u = l > 0 ? `${d}
|
|
3534
3536
|
…and ${l} more` : d, p = [];
|
|
3535
3537
|
e.length === 0 && (t.searchText ? (p.push("Try broader search terms"), p.push("Check spelling"), p.push("Remove searchText to see all labels")) : p.push("No personal labels created yet"));
|
|
3536
|
-
const
|
|
3538
|
+
const h = o.length > 0 ? `
|
|
3537
3539
|
Shared labels (${o.length}): ${o.join(", ")}` : `
|
|
3538
3540
|
No shared labels.`;
|
|
3539
|
-
return
|
|
3541
|
+
return K({
|
|
3540
3542
|
subject: n,
|
|
3541
3543
|
count: e.length,
|
|
3542
3544
|
limit: t.searchText ? void 0 : t.limit,
|
|
@@ -3544,16 +3546,16 @@ No shared labels.`;
|
|
|
3544
3546
|
filterHints: i,
|
|
3545
3547
|
previewLines: u,
|
|
3546
3548
|
zeroReasonHints: p
|
|
3547
|
-
}) +
|
|
3549
|
+
}) + h;
|
|
3548
3550
|
}
|
|
3549
|
-
const { FIND_PROJECTS:
|
|
3551
|
+
const { FIND_PROJECTS: ms, ADD_TASKS: fs, UPDATE_TASKS: bs } = g, pi = {
|
|
3550
3552
|
projectId: s.string().min(1).optional().describe(
|
|
3551
3553
|
'Optional. If provided, searches only collaborators of this project. If omitted, searches across the collaborators of all shared projects the authenticated user can access (plus the authenticated user themselves) — use this for general "find a user" / "who is X" lookups.'
|
|
3552
3554
|
),
|
|
3553
3555
|
searchTerm: s.string().optional().describe(
|
|
3554
3556
|
"Search for a user by name or email (partial and case insensitive match). If omitted, all users are returned."
|
|
3555
3557
|
)
|
|
3556
|
-
},
|
|
3558
|
+
}, hi = {
|
|
3557
3559
|
collaborators: s.array(yo).describe("The found users."),
|
|
3558
3560
|
projectInfo: s.object({
|
|
3559
3561
|
id: s.string().describe("The project ID."),
|
|
@@ -3563,11 +3565,11 @@ const { FIND_PROJECTS: hs, ADD_TASKS: fs, UPDATE_TASKS: bs } = g, pi = {
|
|
|
3563
3565
|
totalCount: s.number().describe("The total number of users found."),
|
|
3564
3566
|
totalAvailable: s.number().optional().describe("The total number of available users before the search filter was applied."),
|
|
3565
3567
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
3566
|
-
},
|
|
3568
|
+
}, mi = {
|
|
3567
3569
|
name: g.FIND_PROJECT_COLLABORATORS,
|
|
3568
3570
|
description: `Find Todoist users (collaborators, teammates) by name or email to look up their user ID. Use this whenever the user asks to find, look up, or identify a person — e.g. "find Carrie's user ID", "who is Ernesto", "look up a user". When projectId is omitted, searches across the collaborators of every shared project the authenticated user has access to, plus the authenticated user themselves — an empty result means the person is not a collaborator on any project you share with them, not necessarily that they do not exist in Todoist. When projectId is provided, searches only that project. Partial, case-insensitive match on name and email.`,
|
|
3569
3571
|
parameters: pi,
|
|
3570
|
-
outputSchema:
|
|
3572
|
+
outputSchema: hi,
|
|
3571
3573
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3572
3574
|
async execute(e, t) {
|
|
3573
3575
|
const { projectId: r, searchTerm: o } = e;
|
|
@@ -3653,7 +3655,7 @@ async function fi({
|
|
|
3653
3655
|
textContent: `No users found. You may have no shared projects, or collaborator data is not accessible.
|
|
3654
3656
|
|
|
3655
3657
|
**Next steps:**
|
|
3656
|
-
• Use ${
|
|
3658
|
+
• Use ${ms} to find shared projects
|
|
3657
3659
|
• Share a project to add collaborators
|
|
3658
3660
|
• Ensure you have permission to view collaborators`,
|
|
3659
3661
|
structuredContent: {
|
|
@@ -3710,13 +3712,13 @@ function ys({
|
|
|
3710
3712
|
r && c.push(`matching "${r}"`), c.push(`in ${n}`);
|
|
3711
3713
|
let d = [];
|
|
3712
3714
|
e.length > 0 && (d = e.slice(0, 10).map((p) => {
|
|
3713
|
-
const
|
|
3714
|
-
return `• ${
|
|
3715
|
+
const h = p.name || "Unknown Name", m = p.email || "No email";
|
|
3716
|
+
return `• ${h} (${m}) - ID: ${p.id}`;
|
|
3715
3717
|
}), e.length > 10 && d.push(`... and ${e.length - 10} more`));
|
|
3716
3718
|
const l = [];
|
|
3717
3719
|
e.length === 0 && r && (l.push(`No users match "${r}"`), l.push("Try a broader search term or check spelling"), o > 0 && l.push(`${o} users available without filter`));
|
|
3718
3720
|
const u = [];
|
|
3719
|
-
return e.length > 0 ? (u.push(`Use ${fs} with responsibleUser to assign new tasks`), u.push(`Use ${bs} with responsibleUser to reassign existing tasks`), u.push("Use user names, emails, or IDs for assignments")) : (u.push(`Use ${
|
|
3721
|
+
return e.length > 0 ? (u.push(`Use ${fs} with responsibleUser to assign new tasks`), u.push(`Use ${bs} with responsibleUser to reassign existing tasks`), u.push("Use user names, emails, or IDs for assignments")) : (u.push(`Use ${ms} to find other projects`), r && o > 0 && u.push("Try searching without filters to see all users")), K({
|
|
3720
3722
|
subject: a,
|
|
3721
3723
|
count: e.length,
|
|
3722
3724
|
filterHints: c,
|
|
@@ -3760,7 +3762,7 @@ const { ADD_PROJECTS: Ct } = g, gi = {
|
|
|
3760
3762
|
const c = Promise.resolve([]), [d, l] = await Promise.all([
|
|
3761
3763
|
o === "archived" ? c : r ? rs(t, r) : os(t),
|
|
3762
3764
|
o === "active" ? c : io(t)
|
|
3763
|
-
]), u = r ? ao(r) : null, p = u ? l.filter((
|
|
3765
|
+
]), u = r ? ao(r) : null, p = u ? l.filter((h) => u.test(h.name)) : l;
|
|
3764
3766
|
n = [...d, ...p];
|
|
3765
3767
|
} else {
|
|
3766
3768
|
const c = o === "archived" ? await t.getArchivedProjects({
|
|
@@ -3792,7 +3794,7 @@ function wi({
|
|
|
3792
3794
|
const a = 10, d = e.slice(0, a).map(Fo).join(`
|
|
3793
3795
|
`), l = e.length - a, u = l > 0 ? `${d}
|
|
3794
3796
|
…and ${l} more` : d, p = [];
|
|
3795
|
-
return e.length === 0 && (t.searchText ? (p.push("Try broader search terms"), p.push("Check spelling"), p.push("Remove searchText to see all projects")) : t.archivedStatus === "archived" ? (p.push("No archived projects"), p.push("Use archivedStatus: 'all' to also see active projects")) : t.archivedStatus === "all" ? (p.push("No projects created yet"), p.push(`Use ${Ct} to create a project`)) : (p.push("No active projects"), p.push("Use archivedStatus: 'all' to include archived projects"), p.push(`Use ${Ct} to create a project`))),
|
|
3797
|
+
return e.length === 0 && (t.searchText ? (p.push("Try broader search terms"), p.push("Check spelling"), p.push("Remove searchText to see all projects")) : t.archivedStatus === "archived" ? (p.push("No archived projects"), p.push("Use archivedStatus: 'all' to also see active projects")) : t.archivedStatus === "all" ? (p.push("No projects created yet"), p.push(`Use ${Ct} to create a project`)) : (p.push("No active projects"), p.push("Use archivedStatus: 'all' to include archived projects"), p.push(`Use ${Ct} to create a project`))), K({
|
|
3796
3798
|
subject: n,
|
|
3797
3799
|
count: e.length,
|
|
3798
3800
|
limit: t.searchText || t.archivedStatus === "all" ? void 0 : t.limit,
|
|
@@ -3915,7 +3917,7 @@ const { ADD_SECTIONS: Ci } = g, $i = {
|
|
|
3915
3917
|
e.searchText ? o = await uo(t, e.searchText, r) : o = (await t.getSections({
|
|
3916
3918
|
projectId: r
|
|
3917
3919
|
})).results;
|
|
3918
|
-
const n = o.map(
|
|
3920
|
+
const n = o.map(q);
|
|
3919
3921
|
return {
|
|
3920
3922
|
textContent: Ai({
|
|
3921
3923
|
sections: n,
|
|
@@ -3939,7 +3941,7 @@ function Ai({
|
|
|
3939
3941
|
r ? (o.push("Try broader search terms"), o.push("Check spelling"), o.push("Remove searchText to see all sections")) : (o.push("Project has no sections yet"), o.push(`Use ${Ci} to create sections`));
|
|
3940
3942
|
const n = r ? `Sections in project ${t} matching "${r}"` : `Sections in project ${t}`, i = e.length > 0 ? e.map((a) => ` ${a.name} • id=${a.id}`).join(`
|
|
3941
3943
|
`) : void 0;
|
|
3942
|
-
return
|
|
3944
|
+
return K({
|
|
3943
3945
|
subject: n,
|
|
3944
3946
|
count: e.length,
|
|
3945
3947
|
previewLines: i,
|
|
@@ -3993,13 +3995,13 @@ const Ei = {
|
|
|
3993
3995
|
i = "overdue";
|
|
3994
3996
|
else if (e.startDate === "today")
|
|
3995
3997
|
if (e.daysCount > 1) {
|
|
3996
|
-
const p = /* @__PURE__ */ new Date(),
|
|
3998
|
+
const p = /* @__PURE__ */ new Date(), h = ae(p), m = Ue(p, e.daysCount), y = lt(m, { representation: "date" }), f = `(due after: ${h} | due: ${h}) & due before: ${y}`;
|
|
3997
3999
|
i = e.overdueOption === "exclude-overdue" ? f : `(${f} | overdue)`;
|
|
3998
4000
|
} else
|
|
3999
4001
|
i = e.overdueOption === "exclude-overdue" ? "today" : "(today | overdue)";
|
|
4000
4002
|
else if (e.startDate) {
|
|
4001
|
-
const p = e.startDate,
|
|
4002
|
-
i = `(due after: ${p} | due: ${p}) & due before: ${
|
|
4003
|
+
const p = e.startDate, h = Ue(Ts(p), e.daysCount), m = lt(h, { representation: "date" });
|
|
4004
|
+
i = `(due after: ${p} | due: ${p}) & due before: ${m}`;
|
|
4003
4005
|
}
|
|
4004
4006
|
const a = dt(e.labels, e.labelsOperator);
|
|
4005
4007
|
a.length > 0 && (i = ce(i, `(${a})`));
|
|
@@ -4067,7 +4069,7 @@ function _i({
|
|
|
4067
4069
|
a.push(`Great job! No tasks for today${c}`);
|
|
4068
4070
|
} else
|
|
4069
4071
|
a.push("Expand date range with larger 'daysCount'"), a.push("Check today's tasks with startDate='today'");
|
|
4070
|
-
return
|
|
4072
|
+
return K({
|
|
4071
4073
|
subject: i,
|
|
4072
4074
|
count: e.length,
|
|
4073
4075
|
limit: t.limit,
|
|
@@ -4186,23 +4188,23 @@ const Li = new Ui(), { FIND_COMPLETED_TASKS: $t, ADD_TASKS: Dt } = g, Ni = {
|
|
|
4186
4188
|
cursor: l,
|
|
4187
4189
|
labels: u,
|
|
4188
4190
|
labelsOperator: p,
|
|
4189
|
-
filter:
|
|
4190
|
-
filterIdOrName:
|
|
4191
|
+
filter: h,
|
|
4192
|
+
filterIdOrName: m
|
|
4191
4193
|
} = e, y = await t.getUser(), f = u && u.length > 0;
|
|
4192
|
-
if (!r && !o && !n && !i && !a && !f && !
|
|
4194
|
+
if (!r && !o && !n && !i && !a && !f && !h && !m)
|
|
4193
4195
|
throw new Error(
|
|
4194
4196
|
"At least one filter must be provided: searchText, projectId, sectionId, parentId, responsibleUser, labels, filter, or filterIdOrName"
|
|
4195
4197
|
);
|
|
4196
|
-
if (
|
|
4198
|
+
if (h && m)
|
|
4197
4199
|
throw new Error(
|
|
4198
4200
|
"The `filter` and `filterIdOrName` parameters cannot be used together. Provide only one."
|
|
4199
4201
|
);
|
|
4200
|
-
if ((
|
|
4202
|
+
if ((h || m) && (o || n || i))
|
|
4201
4203
|
throw new Error(
|
|
4202
4204
|
'The `filter`/`filterIdOrName` parameter cannot be combined with projectId, sectionId, or parentId. Use filter syntax instead (e.g. "##ProjectName").'
|
|
4203
4205
|
);
|
|
4204
|
-
let v =
|
|
4205
|
-
|
|
4206
|
+
let v = h;
|
|
4207
|
+
m && (v = (await Li.resolveFilter(t, m)).filterQuery);
|
|
4206
4208
|
const j = await Qe(t, a), A = j?.userId, k = j?.email;
|
|
4207
4209
|
if (o || n || i) {
|
|
4208
4210
|
const D = {
|
|
@@ -4210,7 +4212,7 @@ const Li = new Ui(), { FIND_COMPLETED_TASKS: $t, ADD_TASKS: Dt } = g, Ni = {
|
|
|
4210
4212
|
cursor: l ?? null
|
|
4211
4213
|
};
|
|
4212
4214
|
o && (D.projectId = await de({ projectId: o, user: y })), n && (D.sectionId = n), i && (D.parentId = i);
|
|
4213
|
-
const { results:
|
|
4215
|
+
const { results: he, nextCursor: Y } = await t.getTasks(D), $e = he.map(P);
|
|
4214
4216
|
let H = r ? $e.filter(
|
|
4215
4217
|
(te) => te.content.toLowerCase().includes(r.toLowerCase()) || te.description?.toLowerCase().includes(r.toLowerCase())
|
|
4216
4218
|
) : $e;
|
|
@@ -4241,7 +4243,7 @@ const Li = new Ui(), { FIND_COMPLETED_TASKS: $t, ADD_TASKS: Dt } = g, Ni = {
|
|
|
4241
4243
|
};
|
|
4242
4244
|
}
|
|
4243
4245
|
if (A && !r && !f && !v) {
|
|
4244
|
-
const { results: D, nextCursor:
|
|
4246
|
+
const { results: D, nextCursor: he } = await t.getTasksByFilter({
|
|
4245
4247
|
query: `assigned to: ${k}`,
|
|
4246
4248
|
lang: "en",
|
|
4247
4249
|
limit: d,
|
|
@@ -4251,15 +4253,15 @@ const Li = new Ui(), { FIND_COMPLETED_TASKS: $t, ADD_TASKS: Dt } = g, Ni = {
|
|
|
4251
4253
|
textContent: Ee({
|
|
4252
4254
|
tasks: Y,
|
|
4253
4255
|
args: e,
|
|
4254
|
-
nextCursor:
|
|
4256
|
+
nextCursor: he,
|
|
4255
4257
|
isContainerSearch: !1,
|
|
4256
4258
|
assigneeEmail: k
|
|
4257
4259
|
}),
|
|
4258
4260
|
structuredContent: {
|
|
4259
4261
|
tasks: Y,
|
|
4260
|
-
nextCursor:
|
|
4262
|
+
nextCursor: he ?? void 0,
|
|
4261
4263
|
totalCount: Y.length,
|
|
4262
|
-
hasMore: !!
|
|
4264
|
+
hasMore: !!he,
|
|
4263
4265
|
appliedFilters: e
|
|
4264
4266
|
}
|
|
4265
4267
|
};
|
|
@@ -4267,7 +4269,7 @@ const Li = new Ui(), { FIND_COMPLETED_TASKS: $t, ADD_TASKS: Dt } = g, Ni = {
|
|
|
4267
4269
|
let I = v ? `(${v})` : "";
|
|
4268
4270
|
r && (I = ce(I, `search: ${r}`));
|
|
4269
4271
|
const x = dt(u, p);
|
|
4270
|
-
if (I = ce(I, x), !(
|
|
4272
|
+
if (I = ce(I, x), !(m && !a && !c)) {
|
|
4271
4273
|
const D = ss({
|
|
4272
4274
|
resolvedAssigneeId: A,
|
|
4273
4275
|
assigneeEmail: k,
|
|
@@ -4353,7 +4355,7 @@ function Ee({
|
|
|
4353
4355
|
t.searchText && (c.push("Try broader search terms"), c.push("Verify spelling and try partial words"), t.responsibleUser || c.push(`Check completed tasks with ${$t}`));
|
|
4354
4356
|
}
|
|
4355
4357
|
}
|
|
4356
|
-
return
|
|
4358
|
+
return K({
|
|
4357
4359
|
subject: i,
|
|
4358
4360
|
count: e.length,
|
|
4359
4361
|
limit: t.limit,
|
|
@@ -4441,7 +4443,7 @@ function zi(e) {
|
|
|
4441
4443
|
}
|
|
4442
4444
|
return o(r), r;
|
|
4443
4445
|
}
|
|
4444
|
-
async function
|
|
4446
|
+
async function qi(e, t) {
|
|
4445
4447
|
const r = {};
|
|
4446
4448
|
return await Promise.all(
|
|
4447
4449
|
t.map(async (o) => {
|
|
@@ -4477,11 +4479,11 @@ function xt(e) {
|
|
|
4477
4479
|
}
|
|
4478
4480
|
return r;
|
|
4479
4481
|
}
|
|
4480
|
-
function
|
|
4482
|
+
function Ke(e, t = "") {
|
|
4481
4483
|
const r = [];
|
|
4482
4484
|
for (const o of e) {
|
|
4483
4485
|
const n = `id=${o.id}`, i = o.dueDate ? `; due=${o.dueDate}` : "", a = `; content=${o.content}`;
|
|
4484
|
-
r.push(`${t}- ${n}${i}${a}`), o.children.length > 0 && r.push(...
|
|
4486
|
+
r.push(`${t}- ${n}${i}${a}`), o.children.length > 0 && r.push(...Ke(o.children, `${t} `));
|
|
4485
4487
|
}
|
|
4486
4488
|
return r;
|
|
4487
4489
|
}
|
|
@@ -4492,13 +4494,13 @@ function vs(e, t) {
|
|
|
4492
4494
|
parentId: B(e) ? e.parentId ?? void 0 : void 0,
|
|
4493
4495
|
folderId: ke(e) ? e.folderId ?? void 0 : void 0,
|
|
4494
4496
|
childOrder: e.childOrder,
|
|
4495
|
-
sections: (t[e.id] || []).map(
|
|
4497
|
+
sections: (t[e.id] || []).map(q),
|
|
4496
4498
|
children: e.children.map(
|
|
4497
4499
|
(r) => vs(r, t)
|
|
4498
4500
|
)
|
|
4499
4501
|
};
|
|
4500
4502
|
}
|
|
4501
|
-
async function
|
|
4503
|
+
async function Ki(e, t) {
|
|
4502
4504
|
let r = [], o;
|
|
4503
4505
|
do {
|
|
4504
4506
|
const { results: n, nextCursor: i } = await e.getTasks({
|
|
@@ -4515,7 +4517,7 @@ async function Yi(e, t) {
|
|
|
4515
4517
|
return r;
|
|
4516
4518
|
}
|
|
4517
4519
|
async function Gi(e) {
|
|
4518
|
-
const { results: t } = await e.getProjects({}), r = t.find((p) => B(p) && p.inboxProject === !0), o = t.filter((p) => !B(p) || p.inboxProject !== !0), n = zi(o), i = t.map((p) => p.id), a = await
|
|
4520
|
+
const { results: t } = await e.getProjects({}), r = t.find((p) => B(p) && p.inboxProject === !0), o = t.filter((p) => !B(p) || p.inboxProject !== !0), n = zi(o), i = t.map((p) => p.id), a = await qi(e, i), c = ["# Personal Projects", ""];
|
|
4519
4521
|
if (r) {
|
|
4520
4522
|
c.push(`- Inbox Project: ${r.name} (id=${r.id})`);
|
|
4521
4523
|
for (const p of a[r.id] || [])
|
|
@@ -4538,14 +4540,14 @@ async function Gi(e) {
|
|
|
4538
4540
|
inbox: r ? {
|
|
4539
4541
|
id: r.id,
|
|
4540
4542
|
name: r.name,
|
|
4541
|
-
sections: (a[r.id] || []).map(
|
|
4543
|
+
sections: (a[r.id] || []).map(q)
|
|
4542
4544
|
} : void 0,
|
|
4543
4545
|
projects: n.map(
|
|
4544
4546
|
(p) => vs(p, a)
|
|
4545
4547
|
),
|
|
4546
4548
|
totalProjects: t.length,
|
|
4547
4549
|
totalSections: i.reduce(
|
|
4548
|
-
(p,
|
|
4550
|
+
(p, h) => p + (a[h]?.length || 0),
|
|
4549
4551
|
0
|
|
4550
4552
|
),
|
|
4551
4553
|
hasNestedProjects: d
|
|
@@ -4556,7 +4558,7 @@ async function Vi(e, t) {
|
|
|
4556
4558
|
const [r, o, n] = await Promise.all([
|
|
4557
4559
|
e.getProject(t),
|
|
4558
4560
|
Yi(e, t),
|
|
4559
|
-
|
|
4561
|
+
Ki(e, t)
|
|
4560
4562
|
]), i = {};
|
|
4561
4563
|
for (const u of o)
|
|
4562
4564
|
i[u.id] = [];
|
|
@@ -4567,15 +4569,15 @@ async function Vi(e, t) {
|
|
|
4567
4569
|
if (a.length > 0) {
|
|
4568
4570
|
c.push("");
|
|
4569
4571
|
const u = xt(a);
|
|
4570
|
-
c.push(...
|
|
4572
|
+
c.push(...Ke(u));
|
|
4571
4573
|
}
|
|
4572
4574
|
for (const u of o) {
|
|
4573
4575
|
c.push(""), c.push(`## ${u.name}`);
|
|
4574
4576
|
const p = i[u.id];
|
|
4575
4577
|
if (!p?.length)
|
|
4576
4578
|
continue;
|
|
4577
|
-
const
|
|
4578
|
-
c.push(...
|
|
4579
|
+
const h = xt(p);
|
|
4580
|
+
c.push(...Ke(h));
|
|
4579
4581
|
}
|
|
4580
4582
|
const d = c.join(`
|
|
4581
4583
|
`), l = {
|
|
@@ -4584,7 +4586,7 @@ async function Vi(e, t) {
|
|
|
4584
4586
|
id: r.id,
|
|
4585
4587
|
name: r.name
|
|
4586
4588
|
},
|
|
4587
|
-
sections: o.map(
|
|
4589
|
+
sections: o.map(q),
|
|
4588
4590
|
tasks: n.map((u) => ({
|
|
4589
4591
|
...u,
|
|
4590
4592
|
children: []
|
|
@@ -4669,7 +4671,7 @@ const Ji = {
|
|
|
4669
4671
|
projectColors: s.record(s.string(), s.string()).describe("Map of project ID to color key.")
|
|
4670
4672
|
}, Qi = {
|
|
4671
4673
|
name: g.GET_PRODUCTIVITY_STATS,
|
|
4672
|
-
description:
|
|
4674
|
+
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.',
|
|
4673
4675
|
parameters: Xi,
|
|
4674
4676
|
outputSchema: Zi,
|
|
4675
4677
|
annotations: {
|
|
@@ -4803,9 +4805,6 @@ const oa = {
|
|
|
4803
4805
|
"Include detailed health context with project metrics and task-level data. May produce large output for projects with many tasks."
|
|
4804
4806
|
)
|
|
4805
4807
|
}, ia = s.object({
|
|
4806
|
-
taskId: s.string().describe("The ID of the task this recommendation is for."),
|
|
4807
|
-
recommendation: s.string().describe("The recommendation for this task.")
|
|
4808
|
-
}), aa = s.object({
|
|
4809
4808
|
id: s.string().describe("The task ID."),
|
|
4810
4809
|
content: s.string().describe("The task content/title."),
|
|
4811
4810
|
priority: s.string().describe("The task priority (1-4)."),
|
|
@@ -4813,7 +4812,7 @@ const oa = {
|
|
|
4813
4812
|
deadline: s.string().optional().describe("The deadline date string, if set."),
|
|
4814
4813
|
isCompleted: s.boolean().describe("Whether the task is completed."),
|
|
4815
4814
|
labels: s.array(s.string()).describe("Labels applied to this task.")
|
|
4816
|
-
}),
|
|
4815
|
+
}), aa = {
|
|
4817
4816
|
projectId: s.string().describe("The project ID."),
|
|
4818
4817
|
projectName: s.string().describe("The project name."),
|
|
4819
4818
|
progress: s.object({
|
|
@@ -4825,7 +4824,6 @@ const oa = {
|
|
|
4825
4824
|
status: s.enum(Ge).describe("The overall health status of the project."),
|
|
4826
4825
|
description: s.string().optional().describe("Detailed description of the health assessment."),
|
|
4827
4826
|
descriptionSummary: s.string().optional().describe("Brief summary of the health assessment."),
|
|
4828
|
-
taskRecommendations: s.array(ia).optional().describe("Specific recommendations for individual tasks."),
|
|
4829
4827
|
isStale: s.boolean().describe("Whether the health data is stale and may need refreshing."),
|
|
4830
4828
|
updateInProgress: s.boolean().describe("Whether a health analysis update is currently in progress."),
|
|
4831
4829
|
updatedAt: s.string().optional().describe("When the health assessment was last updated.")
|
|
@@ -4840,12 +4838,12 @@ const oa = {
|
|
|
4840
4838
|
tasksCompletedThisWeek: s.number().describe("Tasks completed in the current week."),
|
|
4841
4839
|
averageCompletionTime: s.number().optional().describe("Average task completion time in days, if available.")
|
|
4842
4840
|
}).describe("Aggregated project metrics."),
|
|
4843
|
-
tasks: s.array(
|
|
4841
|
+
tasks: s.array(ia).describe("Tasks in the project.")
|
|
4844
4842
|
}).optional().describe(
|
|
4845
4843
|
"Detailed project context with metrics and task data. Only included when includeContext is true."
|
|
4846
4844
|
)
|
|
4847
4845
|
};
|
|
4848
|
-
async function
|
|
4846
|
+
async function ca(e, t, r) {
|
|
4849
4847
|
if (r) {
|
|
4850
4848
|
const [i, a, c] = await Promise.all([
|
|
4851
4849
|
e.getProjectProgress(t),
|
|
@@ -4860,16 +4858,11 @@ async function da(e, t, r) {
|
|
|
4860
4858
|
]);
|
|
4861
4859
|
return { progress: o, health: n };
|
|
4862
4860
|
}
|
|
4863
|
-
function
|
|
4861
|
+
function da(e, { progress: t, health: r, context: o }) {
|
|
4864
4862
|
const n = [`# Project Health: ${e}`, ""];
|
|
4865
4863
|
if (n.push(`**Status:** ${r.status}`), r.isStale && n.push("**Note:** Health data is stale and may not reflect recent changes."), r.updateInProgress && n.push("**Note:** A health analysis update is currently in progress."), r.updatedAt && n.push(`**Last Updated:** ${r.updatedAt.toISOString()}`), n.push(""), n.push("## Progress"), n.push(
|
|
4866
4864
|
`**Completed:** ${t.completedCount} | **Active:** ${t.activeCount} | **Progress:** ${t.progressPercent}%`
|
|
4867
|
-
), r.description && (n.push(""), n.push("## Health Description"), n.push(r.description)),
|
|
4868
|
-
n.push(""), n.push("## Task Recommendations");
|
|
4869
|
-
for (const i of r.taskRecommendations)
|
|
4870
|
-
n.push(`- **Task ${i.taskId}**: ${i.recommendation}`);
|
|
4871
|
-
}
|
|
4872
|
-
if (o) {
|
|
4865
|
+
), r.description && (n.push(""), n.push("## Health Description"), n.push(r.description)), o) {
|
|
4873
4866
|
n.push(""), n.push("## Project Metrics");
|
|
4874
4867
|
const i = o.projectMetrics;
|
|
4875
4868
|
if (n.push(`- **Total Tasks:** ${i.totalTasks}`), n.push(`- **Completed:** ${i.completedTasks}`), n.push(`- **Overdue:** ${i.overdueTasks}`), n.push(`- **Created This Week:** ${i.tasksCreatedThisWeek}`), n.push(`- **Completed This Week:** ${i.tasksCompletedThisWeek}`), i.averageCompletionTime !== null && n.push(`- **Avg Completion Time:** ${i.averageCompletionTime} days`), o.tasks.length > 0) {
|
|
@@ -4883,18 +4876,18 @@ function la(e, { progress: t, health: r, context: o }) {
|
|
|
4883
4876
|
return n.join(`
|
|
4884
4877
|
`);
|
|
4885
4878
|
}
|
|
4886
|
-
const
|
|
4879
|
+
const la = {
|
|
4887
4880
|
name: g.GET_PROJECT_HEALTH,
|
|
4888
|
-
description: "Get a comprehensive health assessment for a project including completion progress, health status (EXCELLENT, ON_TRACK, AT_RISK, CRITICAL), and optional detailed context with project metrics and task-level
|
|
4881
|
+
description: "Get a comprehensive health assessment for a project including completion progress, health status (EXCELLENT, ON_TRACK, AT_RISK, CRITICAL), and optional detailed context with project metrics and task-level data. Use includeContext=true for that full detail.",
|
|
4889
4882
|
parameters: na,
|
|
4890
|
-
outputSchema:
|
|
4883
|
+
outputSchema: aa,
|
|
4891
4884
|
annotations: {
|
|
4892
4885
|
readOnlyHint: !0,
|
|
4893
4886
|
destructiveHint: !1,
|
|
4894
4887
|
idempotentHint: !0
|
|
4895
4888
|
},
|
|
4896
4889
|
async execute(e, t) {
|
|
4897
|
-
const { projectId: r, includeContext: o } = e, n = await
|
|
4890
|
+
const { projectId: r, includeContext: o } = e, n = await ca(t, r, o), i = n.context?.projectName ?? `Project ${r}`, a = da(i, n), c = n.context ? {
|
|
4898
4891
|
projectDescription: n.context.projectDescription ?? void 0,
|
|
4899
4892
|
projectMetrics: {
|
|
4900
4893
|
...n.context.projectMetrics,
|
|
@@ -4924,7 +4917,6 @@ const ua = {
|
|
|
4924
4917
|
status: n.health.status,
|
|
4925
4918
|
description: n.health.description ?? void 0,
|
|
4926
4919
|
descriptionSummary: n.health.descriptionSummary ?? void 0,
|
|
4927
|
-
taskRecommendations: n.health.taskRecommendations ?? void 0,
|
|
4928
4920
|
isStale: n.health.isStale,
|
|
4929
4921
|
updateInProgress: n.health.updateInProgress,
|
|
4930
4922
|
updatedAt: n.health.updatedAt?.toISOString()
|
|
@@ -4933,12 +4925,12 @@ const ua = {
|
|
|
4933
4925
|
}
|
|
4934
4926
|
};
|
|
4935
4927
|
}
|
|
4936
|
-
},
|
|
4928
|
+
}, ua = {
|
|
4937
4929
|
workspaceIdOrName: s.string().min(1).describe(
|
|
4938
4930
|
"The workspace ID or name. Supports exact ID, exact name match (case-insensitive), or unique partial name match."
|
|
4939
4931
|
),
|
|
4940
4932
|
projectIds: s.array(s.string().min(1)).min(1).optional().describe("Optional list of project IDs to scope insights to specific projects.")
|
|
4941
|
-
},
|
|
4933
|
+
}, pa = s.object({
|
|
4942
4934
|
projectId: s.string().describe("The project ID."),
|
|
4943
4935
|
health: s.object({
|
|
4944
4936
|
status: s.enum(Ge).describe("The health status of the project."),
|
|
@@ -4953,11 +4945,11 @@ const ua = {
|
|
|
4953
4945
|
}), ha = {
|
|
4954
4946
|
workspaceId: s.string().describe("The resolved workspace ID."),
|
|
4955
4947
|
workspaceName: s.string().describe("The resolved workspace name."),
|
|
4956
|
-
projectInsights: s.array(
|
|
4957
|
-
},
|
|
4948
|
+
projectInsights: s.array(pa).describe("Health and progress insights for each project in the workspace.")
|
|
4949
|
+
}, ma = {
|
|
4958
4950
|
name: g.GET_WORKSPACE_INSIGHTS,
|
|
4959
4951
|
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.",
|
|
4960
|
-
parameters:
|
|
4952
|
+
parameters: ua,
|
|
4961
4953
|
outputSchema: ha,
|
|
4962
4954
|
annotations: {
|
|
4963
4955
|
readOnlyHint: !0,
|
|
@@ -4998,7 +4990,7 @@ const ua = {
|
|
|
4998
4990
|
};
|
|
4999
4991
|
}
|
|
5000
4992
|
};
|
|
5001
|
-
function
|
|
4993
|
+
function fa(e) {
|
|
5002
4994
|
const t = e.trim();
|
|
5003
4995
|
if (!/^https?:\/\//i.test(t))
|
|
5004
4996
|
return t;
|
|
@@ -5008,7 +5000,7 @@ function ba(e) {
|
|
|
5008
5000
|
} catch {
|
|
5009
5001
|
throw new Error(`Could not read a template ID from "${t}".`);
|
|
5010
5002
|
}
|
|
5011
|
-
if (!
|
|
5003
|
+
if (!ba(r.hostname))
|
|
5012
5004
|
throw new Error(
|
|
5013
5005
|
`"${r.hostname}" is not a Todoist domain. Pass a todoist.com template URL or the template ID itself.`
|
|
5014
5006
|
);
|
|
@@ -5020,11 +5012,11 @@ function ba(e) {
|
|
|
5020
5012
|
throw new Error(`Could not read a template ID from "${t}".`);
|
|
5021
5013
|
return i;
|
|
5022
5014
|
}
|
|
5023
|
-
function
|
|
5015
|
+
function ba(e) {
|
|
5024
5016
|
const t = e.toLowerCase();
|
|
5025
5017
|
return t === "todoist.com" || t.endsWith(".todoist.com");
|
|
5026
5018
|
}
|
|
5027
|
-
const
|
|
5019
|
+
const ga = {
|
|
5028
5020
|
projectId: s.string().min(1).describe("The ID of the existing project to import the template into."),
|
|
5029
5021
|
templateId: s.string().optional().describe(
|
|
5030
5022
|
'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.'
|
|
@@ -5033,16 +5025,16 @@ const ya = {
|
|
|
5033
5025
|
"Raw CSV template content, as produced by export-project-template. Provide either this or `templateId`, not both."
|
|
5034
5026
|
),
|
|
5035
5027
|
locale: s.string().optional().describe('Locale for the imported content when using `templateId`. Defaults to "en".')
|
|
5036
|
-
},
|
|
5028
|
+
}, ya = {
|
|
5037
5029
|
sections: s.array(X).describe("Sections created by the import."),
|
|
5038
5030
|
tasks: s.array(F).describe("Tasks created by the import."),
|
|
5039
5031
|
comments: s.array(ye).describe("Comments created by the import."),
|
|
5040
5032
|
totalCount: s.number().describe("The total number of objects created by the import.")
|
|
5041
|
-
},
|
|
5033
|
+
}, Ta = {
|
|
5042
5034
|
name: g.IMPORT_PROJECT_TEMPLATE,
|
|
5043
5035
|
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.",
|
|
5044
|
-
parameters:
|
|
5045
|
-
outputSchema:
|
|
5036
|
+
parameters: ga,
|
|
5037
|
+
outputSchema: ya,
|
|
5046
5038
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
5047
5039
|
async execute({ projectId: e, templateId: t, csvFileContent: r, locale: o }, n) {
|
|
5048
5040
|
if (!!t == !!r)
|
|
@@ -5051,15 +5043,15 @@ const ya = {
|
|
|
5051
5043
|
);
|
|
5052
5044
|
const i = t ? await n.importTemplateFromId({
|
|
5053
5045
|
projectId: e,
|
|
5054
|
-
templateId:
|
|
5046
|
+
templateId: fa(t),
|
|
5055
5047
|
locale: o
|
|
5056
5048
|
}) : await n.importTemplateIntoProject({
|
|
5057
5049
|
projectId: e,
|
|
5058
5050
|
file: r ?? "",
|
|
5059
5051
|
fileName: "template.csv"
|
|
5060
|
-
}), a = i.sections.map(
|
|
5052
|
+
}), a = i.sections.map(q), c = i.tasks.map(P), d = i.comments.map(ge), l = i.projects.length + a.length + c.length + d.length;
|
|
5061
5053
|
return {
|
|
5062
|
-
textContent:
|
|
5054
|
+
textContent: ka({
|
|
5063
5055
|
projectId: e,
|
|
5064
5056
|
counts: {
|
|
5065
5057
|
projects: i.projects.length,
|
|
@@ -5073,7 +5065,7 @@ const ya = {
|
|
|
5073
5065
|
};
|
|
5074
5066
|
}
|
|
5075
5067
|
};
|
|
5076
|
-
function
|
|
5068
|
+
function ka({
|
|
5077
5069
|
projectId: e,
|
|
5078
5070
|
counts: t,
|
|
5079
5071
|
totalCount: r
|
|
@@ -5083,7 +5075,7 @@ function wa({
|
|
|
5083
5075
|
const o = Object.entries(t).filter(([, n]) => n > 0).map(([n, i]) => `${i} ${i === 1 ? n.replace(/s$/, "") : n}`);
|
|
5084
5076
|
return `Imported template into project (id=${e}): ${o.join(", ")}.`;
|
|
5085
5077
|
}
|
|
5086
|
-
const
|
|
5078
|
+
const wa = {}, va = {
|
|
5087
5079
|
id: s.string().describe("The unique identifier for the workspace."),
|
|
5088
5080
|
name: s.string().describe("The name of the workspace."),
|
|
5089
5081
|
plan: s.enum(Hs).describe("The workspace plan type."),
|
|
@@ -5092,12 +5084,12 @@ const va = {}, Ia = {
|
|
|
5092
5084
|
isGuestAllowed: s.boolean().describe("Whether guests are allowed in the workspace."),
|
|
5093
5085
|
createdAt: s.string().optional().describe("The ISO 8601 timestamp when the workspace was created."),
|
|
5094
5086
|
creatorId: s.string().describe("The ID of the user who created the workspace.")
|
|
5095
|
-
},
|
|
5087
|
+
}, Ia = {
|
|
5096
5088
|
type: s.literal("workspaces").describe("The type of the response."),
|
|
5097
|
-
workspaces: s.array(s.object(
|
|
5089
|
+
workspaces: s.array(s.object(va)).describe("List of workspaces."),
|
|
5098
5090
|
count: s.number().describe("The total number of workspaces.")
|
|
5099
5091
|
};
|
|
5100
|
-
async function
|
|
5092
|
+
async function Sa(e) {
|
|
5101
5093
|
const r = (await e.getWorkspaces()).map((a) => ({
|
|
5102
5094
|
id: a.id,
|
|
5103
5095
|
name: a.name,
|
|
@@ -5128,22 +5120,22 @@ async function ja(e) {
|
|
|
5128
5120
|
};
|
|
5129
5121
|
return { textContent: n, structuredContent: i };
|
|
5130
5122
|
}
|
|
5131
|
-
const
|
|
5123
|
+
const ja = {
|
|
5132
5124
|
name: g.LIST_WORKSPACES,
|
|
5133
5125
|
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.",
|
|
5134
|
-
parameters:
|
|
5135
|
-
outputSchema:
|
|
5126
|
+
parameters: wa,
|
|
5127
|
+
outputSchema: Ia,
|
|
5136
5128
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
5137
5129
|
async execute(e, t) {
|
|
5138
|
-
const r = await
|
|
5130
|
+
const r = await Sa(t);
|
|
5139
5131
|
return {
|
|
5140
5132
|
textContent: r.textContent,
|
|
5141
5133
|
structuredContent: r.structuredContent
|
|
5142
5134
|
};
|
|
5143
5135
|
}
|
|
5144
|
-
}, { FIND_TASKS:
|
|
5136
|
+
}, { FIND_TASKS: Ca, FIND_PROJECT_COLLABORATORS: Et, UPDATE_TASKS: $a } = g, Da = 50, xa = {
|
|
5145
5137
|
operation: s.enum(["assign", "unassign", "reassign"]).describe("The assignment operation to perform."),
|
|
5146
|
-
taskIds: s.array(s.string()).min(1).max(
|
|
5138
|
+
taskIds: s.array(s.string()).min(1).max(Da).describe("The IDs of the tasks to operate on (max 50)."),
|
|
5147
5139
|
responsibleUser: s.string().optional().describe(
|
|
5148
5140
|
'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.'
|
|
5149
5141
|
),
|
|
@@ -5151,7 +5143,7 @@ const Ca = {
|
|
|
5151
5143
|
"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."
|
|
5152
5144
|
),
|
|
5153
5145
|
dryRun: s.boolean().optional().default(!1).describe("If true, validates operations without executing them.")
|
|
5154
|
-
},
|
|
5146
|
+
}, Aa = {
|
|
5155
5147
|
results: s.array(
|
|
5156
5148
|
s.object({
|
|
5157
5149
|
taskId: s.string().describe("The ID of the task."),
|
|
@@ -5167,11 +5159,11 @@ const Ca = {
|
|
|
5167
5159
|
failed: s.number().describe("Number of failed operations."),
|
|
5168
5160
|
dryRun: s.boolean().describe("Whether this was a dry run.")
|
|
5169
5161
|
}).optional().describe("Summary of the operation.")
|
|
5170
|
-
},
|
|
5162
|
+
}, Ea = {
|
|
5171
5163
|
name: g.MANAGE_ASSIGNMENTS,
|
|
5172
5164
|
description: "Bulk assignment operations for multiple tasks. Supports assign, unassign, and reassign operations with atomic rollback on failures.",
|
|
5173
|
-
parameters:
|
|
5174
|
-
outputSchema:
|
|
5165
|
+
parameters: xa,
|
|
5166
|
+
outputSchema: Aa,
|
|
5175
5167
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5176
5168
|
async execute(e, t) {
|
|
5177
5169
|
const { operation: r, taskIds: o, responsibleUser: n, fromAssigneeUser: i, dryRun: a } = e;
|
|
@@ -5273,13 +5265,13 @@ const Ca = {
|
|
|
5273
5265
|
}
|
|
5274
5266
|
};
|
|
5275
5267
|
}
|
|
5276
|
-
const
|
|
5268
|
+
const h = await at.validateBulkAssignment(
|
|
5277
5269
|
t,
|
|
5278
5270
|
p
|
|
5279
|
-
),
|
|
5271
|
+
), m = [], y = [];
|
|
5280
5272
|
for (let k = 0; k < p.length; k++) {
|
|
5281
|
-
const I = p[k], x =
|
|
5282
|
-
I && x?.isValid ?
|
|
5273
|
+
const I = p[k], x = h[k];
|
|
5274
|
+
I && x?.isValid ? m.push({ assignment: I, validation: x }) : I?.taskId && y.push({
|
|
5283
5275
|
taskId: I.taskId,
|
|
5284
5276
|
success: !1,
|
|
5285
5277
|
error: x?.error?.message || "Validation failed"
|
|
@@ -5334,7 +5326,7 @@ const Ca = {
|
|
|
5334
5326
|
);
|
|
5335
5327
|
return Promise.all(T);
|
|
5336
5328
|
}
|
|
5337
|
-
const v = await f(
|
|
5329
|
+
const v = await f(m, !a), j = [...v, ...y, ...l];
|
|
5338
5330
|
if (j.length > 0 && j.every((k) => !k.success)) {
|
|
5339
5331
|
const k = j.map((I) => `"${I.taskId}": ${I.error}`).join("; ");
|
|
5340
5332
|
throw new Error(`All ${j.length} ${r} operation(s) failed: ${k}`);
|
|
@@ -5394,8 +5386,8 @@ function Oe({
|
|
|
5394
5386
|
`;
|
|
5395
5387
|
}
|
|
5396
5388
|
return !r && o.length > 0 ? (c += `**Next steps:**
|
|
5397
|
-
`, c += `• Use ${
|
|
5398
|
-
`, c += `• Use ${
|
|
5389
|
+
`, c += `• Use ${Ca} with responsibleUser to see ${e === "unassign" ? "unassigned" : "newly assigned"} tasks
|
|
5390
|
+
`, c += `• Use ${$a} for individual assignment changes
|
|
5399
5391
|
`, n.length > 0 && (c += `• Check failed tasks and use ${Et} to verify collaborator access
|
|
5400
5392
|
`)) : r ? (c += `**To execute:**
|
|
5401
5393
|
`, c += `• Remove dryRun parameter and run again to execute changes
|
|
@@ -5407,17 +5399,17 @@ function Oe({
|
|
|
5407
5399
|
`, c += `• Use dryRun=true to validate before executing
|
|
5408
5400
|
`), c;
|
|
5409
5401
|
}
|
|
5410
|
-
const
|
|
5402
|
+
const Oa = {
|
|
5411
5403
|
action: s.enum(["archive", "unarchive"]).describe("The action to perform on the project."),
|
|
5412
5404
|
projectId: s.string().min(1).describe("The ID of the project.")
|
|
5413
|
-
},
|
|
5405
|
+
}, Pa = {
|
|
5414
5406
|
project: Q.describe("The updated project."),
|
|
5415
5407
|
success: s.boolean().describe("Whether the action was successful.")
|
|
5416
|
-
},
|
|
5408
|
+
}, _a = {
|
|
5417
5409
|
name: g.PROJECT_MANAGEMENT,
|
|
5418
5410
|
description: "Archive or unarchive a project by its ID.",
|
|
5419
|
-
parameters:
|
|
5420
|
-
outputSchema:
|
|
5411
|
+
parameters: Oa,
|
|
5412
|
+
outputSchema: Pa,
|
|
5421
5413
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
|
|
5422
5414
|
async execute(e, t) {
|
|
5423
5415
|
const r = e.action === "archive" ? await t.archiveProject(e.projectId) : await t.unarchiveProject(e.projectId), o = Z(r);
|
|
@@ -5429,7 +5421,7 @@ const Pa = {
|
|
|
5429
5421
|
}
|
|
5430
5422
|
};
|
|
5431
5423
|
}
|
|
5432
|
-
},
|
|
5424
|
+
}, Ra = {
|
|
5433
5425
|
action: s.enum(["move-to-workspace", "move-to-personal"]).describe("The action to perform on the project."),
|
|
5434
5426
|
projectId: s.string().min(1).describe("The ID of the project to move."),
|
|
5435
5427
|
workspaceId: s.string().min(1).optional().describe("The target workspace ID. Required when action is move-to-workspace."),
|
|
@@ -5437,14 +5429,14 @@ const Pa = {
|
|
|
5437
5429
|
visibility: s.enum(["restricted", "team", "public"]).optional().describe(
|
|
5438
5430
|
"Optional access visibility for the project in the workspace (restricted, team, or public)."
|
|
5439
5431
|
)
|
|
5440
|
-
},
|
|
5432
|
+
}, Ua = {
|
|
5441
5433
|
project: Q.describe("The moved project."),
|
|
5442
5434
|
success: s.boolean().describe("Whether the move was successful.")
|
|
5443
|
-
},
|
|
5435
|
+
}, La = {
|
|
5444
5436
|
name: g.PROJECT_MOVE,
|
|
5445
5437
|
description: "Move a project between personal and workspace contexts.",
|
|
5446
|
-
parameters:
|
|
5447
|
-
outputSchema:
|
|
5438
|
+
parameters: Ra,
|
|
5439
|
+
outputSchema: Ua,
|
|
5448
5440
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
|
|
5449
5441
|
async execute(e, t) {
|
|
5450
5442
|
let r;
|
|
@@ -5467,7 +5459,7 @@ const Pa = {
|
|
|
5467
5459
|
}
|
|
5468
5460
|
};
|
|
5469
5461
|
}
|
|
5470
|
-
}, Is = ["project", "section"],
|
|
5462
|
+
}, Is = ["project", "section"], Na = {
|
|
5471
5463
|
type: s.enum(Is).describe(
|
|
5472
5464
|
'The type of entity to reorder. "project" reorders sibling projects within the same parent (and can move projects to a new parent). "section" reorders sections within the same project.'
|
|
5473
5465
|
),
|
|
@@ -5484,17 +5476,17 @@ const Pa = {
|
|
|
5484
5476
|
).min(1).describe(
|
|
5485
5477
|
"The items to reorder or move. Each item must have at least order or parentId. Items with parentId will be moved first, then items with order will be reordered. All items being reordered should be siblings for predictable results."
|
|
5486
5478
|
)
|
|
5487
|
-
},
|
|
5479
|
+
}, Ma = {
|
|
5488
5480
|
type: s.enum(Is).describe("The type of entity that was reordered/moved."),
|
|
5489
5481
|
movedCount: s.number().describe("The number of entities moved to a new parent."),
|
|
5490
5482
|
reorderedCount: s.number().describe("The number of entities reordered."),
|
|
5491
5483
|
affectedIds: s.array(s.string()).describe("The IDs of all affected entities."),
|
|
5492
5484
|
success: s.boolean().describe("Whether the operation was successful.")
|
|
5493
|
-
},
|
|
5485
|
+
}, Fa = {
|
|
5494
5486
|
name: g.REORDER_OBJECTS,
|
|
5495
5487
|
description: 'Reorder sibling projects or sections, and optionally move projects to a new parent. For projects: set order to reorder siblings, and/or set parentId to move under a new parent (use "root" for top level). For sections: set order to reorder within a project.',
|
|
5496
|
-
parameters:
|
|
5497
|
-
outputSchema:
|
|
5488
|
+
parameters: Na,
|
|
5489
|
+
outputSchema: Ma,
|
|
5498
5490
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
|
|
5499
5491
|
async execute(e, t) {
|
|
5500
5492
|
const { type: r, items: o } = e, n = /* @__PURE__ */ new Set();
|
|
@@ -5512,11 +5504,11 @@ const Pa = {
|
|
|
5512
5504
|
}
|
|
5513
5505
|
const i = [], a = o.filter((p) => p.parentId !== void 0);
|
|
5514
5506
|
for (const p of a) {
|
|
5515
|
-
const
|
|
5507
|
+
const h = p.parentId;
|
|
5516
5508
|
i.push(
|
|
5517
5509
|
V("project_move", {
|
|
5518
5510
|
id: p.id,
|
|
5519
|
-
parentId:
|
|
5511
|
+
parentId: h === "root" ? null : h
|
|
5520
5512
|
})
|
|
5521
5513
|
);
|
|
5522
5514
|
}
|
|
@@ -5541,8 +5533,8 @@ const Pa = {
|
|
|
5541
5533
|
try {
|
|
5542
5534
|
await t.sync({ commands: i });
|
|
5543
5535
|
} catch (p) {
|
|
5544
|
-
const
|
|
5545
|
-
throw new Error(`Reorder failed: ${
|
|
5536
|
+
const h = p instanceof Error ? p.message : String(p);
|
|
5537
|
+
throw new Error(`Reorder failed: ${h}`);
|
|
5546
5538
|
}
|
|
5547
5539
|
const d = r === "project" ? "projects" : "sections", l = o.map((p) => p.id), u = [];
|
|
5548
5540
|
return a.length > 0 && u.push(`moved ${a.length}`), c.length > 0 && u.push(`reordered ${c.length}`), {
|
|
@@ -5556,22 +5548,22 @@ const Pa = {
|
|
|
5556
5548
|
}
|
|
5557
5549
|
};
|
|
5558
5550
|
}
|
|
5559
|
-
},
|
|
5551
|
+
}, Ha = s.object({
|
|
5560
5552
|
id: s.string().min(1).describe("The ID of the task to reschedule."),
|
|
5561
5553
|
date: s.string().min(1).describe(
|
|
5562
5554
|
"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."
|
|
5563
5555
|
)
|
|
5564
|
-
}),
|
|
5565
|
-
tasks: s.array(
|
|
5566
|
-
},
|
|
5556
|
+
}), Wa = {
|
|
5557
|
+
tasks: s.array(Ha).min(1).describe("The tasks to reschedule with their new dates.")
|
|
5558
|
+
}, Ba = {
|
|
5567
5559
|
tasks: s.array(F).describe("The rescheduled tasks."),
|
|
5568
5560
|
totalCount: s.number().describe("The total number of tasks rescheduled."),
|
|
5569
5561
|
rescheduledTaskIds: s.array(s.string()).describe("The IDs of the rescheduled tasks.")
|
|
5570
|
-
},
|
|
5562
|
+
}, za = {
|
|
5571
5563
|
name: g.RESCHEDULE_TASKS,
|
|
5572
5564
|
description: "Reschedule tasks to new dates while preserving recurring schedules. Unlike update-tasks (which replaces the entire due string and can wipe recurrence), this tool changes only the date, keeping recurrence patterns intact. Use this when moving recurring tasks to a different date without altering their repeat pattern.",
|
|
5573
|
-
parameters:
|
|
5574
|
-
outputSchema:
|
|
5565
|
+
parameters: Wa,
|
|
5566
|
+
outputSchema: Ba,
|
|
5575
5567
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5576
5568
|
async execute(e, t) {
|
|
5577
5569
|
const { tasks: r } = e, n = (await Promise.all(
|
|
@@ -5622,9 +5614,9 @@ function qa(e, t) {
|
|
|
5622
5614
|
}
|
|
5623
5615
|
return e;
|
|
5624
5616
|
}
|
|
5625
|
-
const
|
|
5617
|
+
const Ka = {
|
|
5626
5618
|
query: s.string().min(1).describe("The search query string to find tasks and projects.")
|
|
5627
|
-
},
|
|
5619
|
+
}, Ya = {
|
|
5628
5620
|
results: s.array(
|
|
5629
5621
|
s.object({
|
|
5630
5622
|
id: s.string().describe("The ID of the result."),
|
|
@@ -5633,11 +5625,11 @@ const Ya = {
|
|
|
5633
5625
|
})
|
|
5634
5626
|
).describe("The search results."),
|
|
5635
5627
|
totalCount: s.number().describe("Total number of results found.")
|
|
5636
|
-
},
|
|
5628
|
+
}, Ga = {
|
|
5637
5629
|
name: g.SEARCH,
|
|
5638
5630
|
description: "Search across tasks and projects in Todoist. Returns a list of relevant results with IDs, titles, and URLs.",
|
|
5639
|
-
parameters:
|
|
5640
|
-
outputSchema:
|
|
5631
|
+
parameters: Ka,
|
|
5632
|
+
outputSchema: Ya,
|
|
5641
5633
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
5642
5634
|
async execute(e, t) {
|
|
5643
5635
|
const { query: r } = e, [o, n] = await Promise.all([
|
|
@@ -5666,19 +5658,19 @@ const Ya = {
|
|
|
5666
5658
|
structuredContent: { results: i, totalCount: i.length }
|
|
5667
5659
|
};
|
|
5668
5660
|
}
|
|
5669
|
-
},
|
|
5661
|
+
}, Va = {
|
|
5670
5662
|
ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to uncomplete.")
|
|
5671
|
-
},
|
|
5663
|
+
}, Ja = {
|
|
5672
5664
|
uncompleted: s.array(s.string()).describe("The IDs of successfully uncompleted tasks."),
|
|
5673
5665
|
failures: s.array(ee).describe("Failed task uncompletion with error details."),
|
|
5674
5666
|
totalRequested: s.number().describe("The total number of tasks requested to uncomplete."),
|
|
5675
5667
|
successCount: s.number().describe("The number of successfully uncompleted tasks."),
|
|
5676
5668
|
failureCount: s.number().describe("The number of failed task uncompletions.")
|
|
5677
|
-
},
|
|
5669
|
+
}, Xa = {
|
|
5678
5670
|
name: g.UNCOMPLETE_TASKS,
|
|
5679
5671
|
description: "Uncomplete (reopen) one or more completed tasks by their IDs.",
|
|
5680
|
-
parameters:
|
|
5681
|
-
outputSchema:
|
|
5672
|
+
parameters: Va,
|
|
5673
|
+
outputSchema: Ja,
|
|
5682
5674
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
5683
5675
|
async execute(e, t) {
|
|
5684
5676
|
const r = [], o = [];
|
|
@@ -5693,7 +5685,7 @@ const Ya = {
|
|
|
5693
5685
|
});
|
|
5694
5686
|
}
|
|
5695
5687
|
return {
|
|
5696
|
-
textContent:
|
|
5688
|
+
textContent: Za({
|
|
5697
5689
|
uncompleted: r,
|
|
5698
5690
|
failures: o,
|
|
5699
5691
|
args: e
|
|
@@ -5708,7 +5700,7 @@ const Ya = {
|
|
|
5708
5700
|
};
|
|
5709
5701
|
}
|
|
5710
5702
|
};
|
|
5711
|
-
function
|
|
5703
|
+
function Za({
|
|
5712
5704
|
uncompleted: e,
|
|
5713
5705
|
failures: t,
|
|
5714
5706
|
args: r
|
|
@@ -5722,28 +5714,28 @@ function Qa({
|
|
|
5722
5714
|
failures: t
|
|
5723
5715
|
});
|
|
5724
5716
|
}
|
|
5725
|
-
const
|
|
5717
|
+
const Qa = s.object({
|
|
5726
5718
|
id: s.string().min(1).describe("The ID of the comment to update."),
|
|
5727
5719
|
content: s.string().min(1).describe("The new content for the comment.")
|
|
5728
|
-
}),
|
|
5729
|
-
comments: s.array(
|
|
5730
|
-
},
|
|
5720
|
+
}), ec = {
|
|
5721
|
+
comments: s.array(Qa).min(1).describe("The comments to update.")
|
|
5722
|
+
}, tc = {
|
|
5731
5723
|
comments: s.array(ye).describe("The updated comments."),
|
|
5732
5724
|
totalCount: s.number().describe("The total number of comments updated."),
|
|
5733
5725
|
updatedCommentIds: s.array(s.string()).describe("The IDs of the updated comments."),
|
|
5734
5726
|
appliedOperations: s.object({
|
|
5735
5727
|
updateCount: s.number().describe("The number of comments updated.")
|
|
5736
5728
|
}).describe("Summary of operations performed.")
|
|
5737
|
-
},
|
|
5729
|
+
}, sc = {
|
|
5738
5730
|
name: g.UPDATE_COMMENTS,
|
|
5739
5731
|
description: "Update multiple existing comments with new content.",
|
|
5740
|
-
parameters:
|
|
5741
|
-
outputSchema:
|
|
5732
|
+
parameters: ec,
|
|
5733
|
+
outputSchema: tc,
|
|
5742
5734
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5743
5735
|
async execute(e, t) {
|
|
5744
5736
|
const { comments: r } = e, o = r.map(async (c) => await t.updateComment(c.id, { content: c.content })), i = (await Promise.all(o)).map(ge);
|
|
5745
5737
|
return {
|
|
5746
|
-
textContent:
|
|
5738
|
+
textContent: rc({
|
|
5747
5739
|
comments: i
|
|
5748
5740
|
}),
|
|
5749
5741
|
structuredContent: {
|
|
@@ -5757,7 +5749,7 @@ const ec = s.object({
|
|
|
5757
5749
|
};
|
|
5758
5750
|
}
|
|
5759
5751
|
};
|
|
5760
|
-
function
|
|
5752
|
+
function rc({ comments: e }) {
|
|
5761
5753
|
const t = e.filter((i) => i.taskId).length, r = e.filter((i) => i.projectId).length, o = [];
|
|
5762
5754
|
if (t > 0) {
|
|
5763
5755
|
const i = t > 1 ? "comments" : "comment";
|
|
@@ -5769,7 +5761,7 @@ function oc({ comments: e }) {
|
|
|
5769
5761
|
}
|
|
5770
5762
|
return o.length > 0 ? `Updated ${o.join(" and ")}` : "No comments updated";
|
|
5771
5763
|
}
|
|
5772
|
-
const
|
|
5764
|
+
const oc = s.object({
|
|
5773
5765
|
id: s.string().min(1).describe("The ID of the filter to update."),
|
|
5774
5766
|
name: s.string().min(1).optional().describe("The new name of the filter."),
|
|
5775
5767
|
query: s.string().min(1).optional().describe(
|
|
@@ -5777,9 +5769,9 @@ const nc = s.object({
|
|
|
5777
5769
|
),
|
|
5778
5770
|
color: le,
|
|
5779
5771
|
isFavorite: s.boolean().optional().describe("Whether to mark the filter as a favorite.")
|
|
5780
|
-
}),
|
|
5781
|
-
filters: s.array(
|
|
5782
|
-
},
|
|
5772
|
+
}), nc = {
|
|
5773
|
+
filters: s.array(oc).min(1).describe("The filters to update.")
|
|
5774
|
+
}, ic = {
|
|
5783
5775
|
filters: s.array(rt).describe("The updated filters."),
|
|
5784
5776
|
totalCount: s.number().describe("The total number of filters updated."),
|
|
5785
5777
|
updatedFilterIds: s.array(s.string()).describe("The IDs of the updated filters."),
|
|
@@ -5787,17 +5779,17 @@ const nc = s.object({
|
|
|
5787
5779
|
updateCount: s.number().describe("The number of filters actually updated."),
|
|
5788
5780
|
skippedCount: s.number().describe("The number of filters skipped (no changes).")
|
|
5789
5781
|
}).describe("Summary of operations performed.")
|
|
5790
|
-
},
|
|
5782
|
+
}, ac = {
|
|
5791
5783
|
name: g.UPDATE_FILTERS,
|
|
5792
5784
|
description: "Update one or more existing personal filters with new values.",
|
|
5793
|
-
parameters:
|
|
5794
|
-
outputSchema:
|
|
5785
|
+
parameters: nc,
|
|
5786
|
+
outputSchema: ic,
|
|
5795
5787
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5796
5788
|
async execute(e, t) {
|
|
5797
|
-
const { filters: r } = e, o = [], i = r.map((
|
|
5798
|
-
const
|
|
5799
|
-
return
|
|
5800
|
-
}).filter((
|
|
5789
|
+
const { filters: r } = e, o = [], i = r.map((h) => {
|
|
5790
|
+
const m = dc(h);
|
|
5791
|
+
return m !== null ? { kind: "skipped", reason: m } : (o.push(h), { kind: "updated", filter: h });
|
|
5792
|
+
}).filter((h) => h.kind === "skipped").length;
|
|
5801
5793
|
if (o.length === 0)
|
|
5802
5794
|
return {
|
|
5803
5795
|
textContent: `Updated 0 filters (${i} skipped - no changes)`,
|
|
@@ -5808,29 +5800,29 @@ const nc = s.object({
|
|
|
5808
5800
|
appliedOperations: { updateCount: 0, skippedCount: i }
|
|
5809
5801
|
}
|
|
5810
5802
|
};
|
|
5811
|
-
const a = o.map((
|
|
5812
|
-
const { id:
|
|
5803
|
+
const a = o.map((h) => {
|
|
5804
|
+
const { id: m, color: y, ...f } = h;
|
|
5813
5805
|
return V("filter_update", {
|
|
5814
|
-
id:
|
|
5806
|
+
id: m,
|
|
5815
5807
|
...f,
|
|
5816
5808
|
...y !== void 0 ? { color: y } : {}
|
|
5817
5809
|
});
|
|
5818
5810
|
});
|
|
5819
5811
|
await t.sync({ commands: a });
|
|
5820
|
-
const d = ((await t.sync({ resourceTypes: ["filters"], syncToken: "*" })).filters ?? []).filter((
|
|
5821
|
-
id:
|
|
5822
|
-
name:
|
|
5823
|
-
query:
|
|
5824
|
-
color: ue.parse(
|
|
5825
|
-
isFavorite:
|
|
5826
|
-
itemOrder:
|
|
5812
|
+
const d = ((await t.sync({ resourceTypes: ["filters"], syncToken: "*" })).filters ?? []).filter((h) => !h.isDeleted), l = new Set(o.map((h) => h.id)), u = d.filter((h) => l.has(h.id)).map((h) => ({
|
|
5813
|
+
id: h.id,
|
|
5814
|
+
name: h.name,
|
|
5815
|
+
query: h.query,
|
|
5816
|
+
color: ue.parse(h.color),
|
|
5817
|
+
isFavorite: h.isFavorite,
|
|
5818
|
+
itemOrder: h.itemOrder
|
|
5827
5819
|
}));
|
|
5828
5820
|
return {
|
|
5829
|
-
textContent:
|
|
5821
|
+
textContent: cc({ filters: u, skippedCount: i }),
|
|
5830
5822
|
structuredContent: {
|
|
5831
5823
|
filters: u,
|
|
5832
5824
|
totalCount: u.length,
|
|
5833
|
-
updatedFilterIds: u.map((
|
|
5825
|
+
updatedFilterIds: u.map((h) => h.id),
|
|
5834
5826
|
appliedOperations: {
|
|
5835
5827
|
updateCount: u.length,
|
|
5836
5828
|
skippedCount: i
|
|
@@ -5839,7 +5831,7 @@ const nc = s.object({
|
|
|
5839
5831
|
};
|
|
5840
5832
|
}
|
|
5841
5833
|
};
|
|
5842
|
-
function
|
|
5834
|
+
function cc({
|
|
5843
5835
|
filters: e,
|
|
5844
5836
|
skippedCount: t
|
|
5845
5837
|
}) {
|
|
@@ -5853,55 +5845,55 @@ ${n}`;
|
|
|
5853
5845
|
}
|
|
5854
5846
|
return o;
|
|
5855
5847
|
}
|
|
5856
|
-
function
|
|
5848
|
+
function dc({ id: e, ...t }) {
|
|
5857
5849
|
return Object.values(t).every((o) => o === void 0) ? "no-fields" : null;
|
|
5858
5850
|
}
|
|
5859
|
-
const
|
|
5851
|
+
const lc = s.object({
|
|
5860
5852
|
labelType: s.literal("personal").describe("Update a personal label, identified by its ID."),
|
|
5861
5853
|
id: s.string().min(1).describe("The ID of the personal label to update."),
|
|
5862
5854
|
name: s.string().min(1).max(128).optional().describe("The new name of the label."),
|
|
5863
5855
|
color: le,
|
|
5864
5856
|
order: s.number().int().optional().describe("The new position of the label in the label list."),
|
|
5865
5857
|
isFavorite: s.boolean().optional().describe("Whether to mark the label as a favorite.")
|
|
5866
|
-
}),
|
|
5858
|
+
}), uc = s.object({
|
|
5867
5859
|
labelType: s.literal("shared").describe(
|
|
5868
5860
|
"Rename a shared label across all tasks. Shared labels are identified by name; only renaming is supported (no color, order, or favorite)."
|
|
5869
5861
|
),
|
|
5870
5862
|
name: s.string().min(1).describe("The current name of the shared label."),
|
|
5871
5863
|
newName: s.string().min(1).describe("The new name for the shared label.")
|
|
5872
|
-
}),
|
|
5873
|
-
|
|
5874
|
-
|
|
5864
|
+
}), pc = s.discriminatedUnion("labelType", [
|
|
5865
|
+
lc,
|
|
5866
|
+
uc
|
|
5875
5867
|
]), hc = {
|
|
5876
|
-
labels: s.array(
|
|
5868
|
+
labels: s.array(pc).min(1).describe(
|
|
5877
5869
|
'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.'
|
|
5878
5870
|
)
|
|
5879
|
-
},
|
|
5871
|
+
}, mc = s.object({
|
|
5880
5872
|
name: s.string().describe("The previous name of the shared label."),
|
|
5881
5873
|
newName: s.string().describe("The new name of the shared label.")
|
|
5882
|
-
}),
|
|
5874
|
+
}), fc = {
|
|
5883
5875
|
updatedLabels: s.array(pe).describe("The updated personal labels."),
|
|
5884
|
-
renamedSharedLabels: s.array(
|
|
5876
|
+
renamedSharedLabels: s.array(mc).describe("The shared labels that were renamed."),
|
|
5885
5877
|
totalCount: s.number().describe("The total number of successful operations (personal + shared)."),
|
|
5886
5878
|
appliedOperations: s.object({
|
|
5887
5879
|
updateCount: s.number().describe("Number of personal labels updated."),
|
|
5888
5880
|
renameCount: s.number().describe("Number of shared labels renamed."),
|
|
5889
5881
|
skippedCount: s.number().describe("Number of operations skipped (no changes or shared label not found).")
|
|
5890
5882
|
}).describe("Summary of operations performed.")
|
|
5891
|
-
},
|
|
5883
|
+
}, bc = {
|
|
5892
5884
|
name: g.UPDATE_LABELS,
|
|
5893
5885
|
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.",
|
|
5894
5886
|
parameters: hc,
|
|
5895
|
-
outputSchema:
|
|
5887
|
+
outputSchema: fc,
|
|
5896
5888
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5897
5889
|
async execute(e, t) {
|
|
5898
5890
|
const { labels: r } = e, o = await Promise.all(
|
|
5899
5891
|
r.map(async (u) => {
|
|
5900
5892
|
if (u.labelType === "personal") {
|
|
5901
|
-
const
|
|
5902
|
-
if (
|
|
5903
|
-
const { id:
|
|
5904
|
-
return { kind: "updated", label: await t.updateLabel(
|
|
5893
|
+
const h = yc(u);
|
|
5894
|
+
if (h !== null) return { kind: "skipped", reason: h };
|
|
5895
|
+
const { id: m, labelType: y, ...f } = u;
|
|
5896
|
+
return { kind: "updated", label: await t.updateLabel(m, f) };
|
|
5905
5897
|
}
|
|
5906
5898
|
return await t.renameSharedLabel({
|
|
5907
5899
|
name: u.name,
|
|
@@ -5916,7 +5908,7 @@ const uc = s.object({
|
|
|
5916
5908
|
(u) => u.kind === "skipped" && u.reason === "not-found"
|
|
5917
5909
|
).length;
|
|
5918
5910
|
return {
|
|
5919
|
-
textContent:
|
|
5911
|
+
textContent: gc({
|
|
5920
5912
|
updatedLabels: n,
|
|
5921
5913
|
renamedSharedLabels: i,
|
|
5922
5914
|
skippedNoFields: c,
|
|
@@ -5935,7 +5927,7 @@ const uc = s.object({
|
|
|
5935
5927
|
};
|
|
5936
5928
|
}
|
|
5937
5929
|
};
|
|
5938
|
-
function
|
|
5930
|
+
function gc({
|
|
5939
5931
|
updatedLabels: e,
|
|
5940
5932
|
renamedSharedLabels: t,
|
|
5941
5933
|
skippedNoFields: r,
|
|
@@ -5957,14 +5949,14 @@ function yc({
|
|
|
5957
5949
|
return c.join(`
|
|
5958
5950
|
`);
|
|
5959
5951
|
}
|
|
5960
|
-
function
|
|
5952
|
+
function yc({
|
|
5961
5953
|
id: e,
|
|
5962
5954
|
labelType: t,
|
|
5963
5955
|
...r
|
|
5964
5956
|
}) {
|
|
5965
5957
|
return Object.values(r).every((n) => n === void 0) ? "no-fields" : null;
|
|
5966
5958
|
}
|
|
5967
|
-
const
|
|
5959
|
+
const Tc = s.object({
|
|
5968
5960
|
id: s.string().min(1).describe("The ID of the project to update."),
|
|
5969
5961
|
name: s.string().min(1).optional().describe("The new name of the project."),
|
|
5970
5962
|
isFavorite: s.boolean().optional().describe("Whether the project is a favorite."),
|
|
@@ -5979,9 +5971,9 @@ const kc = s.object({
|
|
|
5979
5971
|
)
|
|
5980
5972
|
).optional(),
|
|
5981
5973
|
color: le
|
|
5982
|
-
}),
|
|
5983
|
-
projects: s.array(
|
|
5984
|
-
},
|
|
5974
|
+
}), kc = {
|
|
5975
|
+
projects: s.array(Tc).min(1).describe("The projects to update.")
|
|
5976
|
+
}, wc = {
|
|
5985
5977
|
projects: s.array(Q).describe("The updated projects."),
|
|
5986
5978
|
totalCount: s.number().describe("The total number of projects updated."),
|
|
5987
5979
|
updatedProjectIds: s.array(s.string()).describe("The IDs of the updated projects."),
|
|
@@ -5993,19 +5985,19 @@ const kc = s.object({
|
|
|
5993
5985
|
skippedCount: s.number().describe("The number of projects skipped (no changes)."),
|
|
5994
5986
|
failureCount: s.number().describe("The number of projects that failed to update.")
|
|
5995
5987
|
}).describe("Summary of operations performed.")
|
|
5996
|
-
},
|
|
5988
|
+
}, vc = {
|
|
5997
5989
|
name: g.UPDATE_PROJECTS,
|
|
5998
5990
|
description: "Update multiple existing projects with new values.",
|
|
5999
|
-
parameters:
|
|
6000
|
-
outputSchema:
|
|
5991
|
+
parameters: kc,
|
|
5992
|
+
outputSchema: wc,
|
|
6001
5993
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
6002
5994
|
async execute(e, t) {
|
|
6003
5995
|
const { projects: r } = e, o = await Promise.allSettled(
|
|
6004
5996
|
r.map(async (l) => {
|
|
6005
|
-
const u =
|
|
5997
|
+
const u = Sc(l);
|
|
6006
5998
|
if (u !== null) return { kind: "skipped", reason: u };
|
|
6007
|
-
const { id: p, ...
|
|
6008
|
-
return { kind: "updated", project: await O(() => t.updateProject(p,
|
|
5999
|
+
const { id: p, ...h } = l;
|
|
6000
|
+
return { kind: "updated", project: await O(() => t.updateProject(p, h)) };
|
|
6009
6001
|
})
|
|
6010
6002
|
), n = [], i = [];
|
|
6011
6003
|
let a = 0, c = 0;
|
|
@@ -6020,7 +6012,7 @@ const kc = s.object({
|
|
|
6020
6012
|
u.value.kind === "updated" ? n.push(Z(u.value.project)) : u.value.reason === "no-fields" ? a++ : c++;
|
|
6021
6013
|
}
|
|
6022
6014
|
return {
|
|
6023
|
-
textContent:
|
|
6015
|
+
textContent: Ic({
|
|
6024
6016
|
projects: n,
|
|
6025
6017
|
skippedNoFields: a,
|
|
6026
6018
|
skippedNoValidValues: c,
|
|
@@ -6040,7 +6032,7 @@ const kc = s.object({
|
|
|
6040
6032
|
};
|
|
6041
6033
|
}
|
|
6042
6034
|
};
|
|
6043
|
-
function
|
|
6035
|
+
function Ic({
|
|
6044
6036
|
projects: e,
|
|
6045
6037
|
skippedNoFields: t,
|
|
6046
6038
|
skippedNoValidValues: r,
|
|
@@ -6053,23 +6045,23 @@ function Sc({
|
|
|
6053
6045
|
return t > 0 && c.push(`${t} skipped - no changes`), r > 0 && c.push(`${r} skipped - no valid field values`), c.length > 0 && (a += ` (${c.join(", ")})`), n > 0 && (a += `:
|
|
6054
6046
|
${i}`), it(a, o);
|
|
6055
6047
|
}
|
|
6056
|
-
function
|
|
6048
|
+
function Sc({ id: e, ...t }) {
|
|
6057
6049
|
const r = Object.values(t);
|
|
6058
6050
|
return r.length === 0 ? "no-fields" : r.every((o) => o === void 0) ? "no-valid-values" : null;
|
|
6059
6051
|
}
|
|
6060
|
-
const
|
|
6052
|
+
const jc = s.object({
|
|
6061
6053
|
type: s.literal("relative"),
|
|
6062
6054
|
id: s.string().min(1).describe("The ID of the relative reminder to update."),
|
|
6063
6055
|
minuteOffset: s.number().int().min(0).optional().describe("New minute offset before task due time."),
|
|
6064
6056
|
service: je.optional().describe('New delivery method: "email" or "push".'),
|
|
6065
6057
|
isUrgent: Ce
|
|
6066
|
-
}),
|
|
6058
|
+
}), Cc = s.object({
|
|
6067
6059
|
type: s.literal("absolute"),
|
|
6068
6060
|
id: s.string().min(1).describe("The ID of the absolute reminder to update."),
|
|
6069
6061
|
due: cs.optional().describe("New due date/time for the reminder."),
|
|
6070
6062
|
service: je.optional().describe('New delivery method: "email" or "push".'),
|
|
6071
6063
|
isUrgent: Ce
|
|
6072
|
-
}),
|
|
6064
|
+
}), $c = s.object({
|
|
6073
6065
|
type: s.literal("location"),
|
|
6074
6066
|
id: s.string().min(1).describe("The ID of the location reminder to update."),
|
|
6075
6067
|
name: s.string().optional().describe("New location name."),
|
|
@@ -6079,23 +6071,23 @@ const Cc = s.object({
|
|
|
6079
6071
|
'New trigger condition: "on_enter" or "on_leave".'
|
|
6080
6072
|
),
|
|
6081
6073
|
radius: s.number().int().optional().describe("New radius in meters.")
|
|
6082
|
-
}),
|
|
6074
|
+
}), Dc = s.discriminatedUnion("type", [
|
|
6075
|
+
jc,
|
|
6083
6076
|
Cc,
|
|
6084
|
-
$c
|
|
6085
|
-
|
|
6086
|
-
|
|
6087
|
-
reminders: s.array(xc).min(1).max(we).describe(
|
|
6077
|
+
$c
|
|
6078
|
+
]), xc = {
|
|
6079
|
+
reminders: s.array(Dc).min(1).max(we).describe(
|
|
6088
6080
|
`Array of reminders to update (max ${we}). Each must include the reminder type and ID. Only include fields that need to change.`
|
|
6089
6081
|
)
|
|
6090
|
-
},
|
|
6082
|
+
}, Ac = {
|
|
6091
6083
|
reminders: s.array(st).describe("The updated reminders."),
|
|
6092
6084
|
totalCount: s.number().describe("Total reminders updated."),
|
|
6093
6085
|
updatedReminderIds: s.array(s.string()).describe("IDs of updated reminders.")
|
|
6094
|
-
},
|
|
6086
|
+
}, Ec = {
|
|
6095
6087
|
name: g.UPDATE_REMINDERS,
|
|
6096
6088
|
description: 'Update existing reminders. Each reminder must specify its type ("relative", "absolute", or "location") and ID. Only include fields that need to change.',
|
|
6097
|
-
parameters:
|
|
6098
|
-
outputSchema:
|
|
6089
|
+
parameters: xc,
|
|
6090
|
+
outputSchema: Ac,
|
|
6099
6091
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !0 },
|
|
6100
6092
|
async execute(e, t) {
|
|
6101
6093
|
const { reminders: r } = e, o = r.map(async (d) => {
|
|
@@ -6129,7 +6121,7 @@ const Cc = s.object({
|
|
|
6129
6121
|
}
|
|
6130
6122
|
};
|
|
6131
6123
|
}
|
|
6132
|
-
},
|
|
6124
|
+
}, Oc = s.object({
|
|
6133
6125
|
id: s.string().min(1).describe("The ID of the section to update."),
|
|
6134
6126
|
name: s.string().min(1).optional().describe("The new name of the section."),
|
|
6135
6127
|
description: s.preprocess(
|
|
@@ -6144,17 +6136,17 @@ const Cc = s.object({
|
|
|
6144
6136
|
).optional()
|
|
6145
6137
|
}).refine((e) => e.name !== void 0 || e.description !== void 0, {
|
|
6146
6138
|
message: 'Provide at least one of "name" or "description" to update.'
|
|
6147
|
-
}),
|
|
6148
|
-
sections: s.array(
|
|
6149
|
-
},
|
|
6139
|
+
}), Pc = {
|
|
6140
|
+
sections: s.array(Oc).min(1).describe("The sections to update.")
|
|
6141
|
+
}, _c = {
|
|
6150
6142
|
sections: s.array(X).describe("The updated sections."),
|
|
6151
6143
|
totalCount: s.number().describe("The total number of sections updated."),
|
|
6152
6144
|
updatedSectionIds: s.array(s.string()).describe("The IDs of the updated sections.")
|
|
6153
|
-
},
|
|
6145
|
+
}, Rc = {
|
|
6154
6146
|
name: g.UPDATE_SECTIONS,
|
|
6155
6147
|
description: "Update multiple existing sections with new values.",
|
|
6156
|
-
parameters:
|
|
6157
|
-
outputSchema:
|
|
6148
|
+
parameters: Pc,
|
|
6149
|
+
outputSchema: _c,
|
|
6158
6150
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
6159
6151
|
async execute({ sections: e }, t) {
|
|
6160
6152
|
const r = await Promise.all(
|
|
@@ -6167,18 +6159,18 @@ const Cc = s.object({
|
|
|
6167
6159
|
})
|
|
6168
6160
|
);
|
|
6169
6161
|
return {
|
|
6170
|
-
textContent:
|
|
6162
|
+
textContent: Uc({
|
|
6171
6163
|
sections: r
|
|
6172
6164
|
}),
|
|
6173
6165
|
structuredContent: {
|
|
6174
|
-
sections: r.map(
|
|
6166
|
+
sections: r.map(q),
|
|
6175
6167
|
totalCount: r.length,
|
|
6176
6168
|
updatedSectionIds: r.map((n) => n.id)
|
|
6177
6169
|
}
|
|
6178
6170
|
};
|
|
6179
6171
|
}
|
|
6180
6172
|
};
|
|
6181
|
-
function
|
|
6173
|
+
function Uc({ sections: e }) {
|
|
6182
6174
|
const t = e.length, r = e.map((n) => `• ${n.name} (id=${n.id}, projectId=${n.projectId})`).join(`
|
|
6183
6175
|
`);
|
|
6184
6176
|
return `Updated ${t} section${t === 1 ? "" : "s"}:
|
|
@@ -6187,27 +6179,27 @@ ${r}`;
|
|
|
6187
6179
|
function Ss(e, t) {
|
|
6188
6180
|
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;
|
|
6189
6181
|
}
|
|
6190
|
-
function
|
|
6182
|
+
function Lc(e, t) {
|
|
6191
6183
|
return t.projectId !== void 0 ? e.projectId === t.projectId : t.sectionId !== void 0 ? e.sectionId === t.sectionId : e.parentId === t.parentId;
|
|
6192
6184
|
}
|
|
6193
|
-
function
|
|
6185
|
+
function Nc(e) {
|
|
6194
6186
|
return e.projectId !== void 0 ? `project:${e.projectId}` : e.sectionId !== void 0 ? `section:${e.sectionId}` : `parent:${e.parentId}`;
|
|
6195
6187
|
}
|
|
6196
|
-
function
|
|
6188
|
+
function Mc(e) {
|
|
6197
6189
|
const t = [];
|
|
6198
6190
|
return e.projectId && t.push({ projectId: e.projectId }), e.sectionId && t.push({ sectionId: e.sectionId }), e.parentId && t.push({ parentId: e.parentId }), t;
|
|
6199
6191
|
}
|
|
6200
|
-
function
|
|
6192
|
+
function Fc({
|
|
6201
6193
|
taskId: e,
|
|
6202
6194
|
request: t,
|
|
6203
6195
|
current: r
|
|
6204
6196
|
}) {
|
|
6205
|
-
const o =
|
|
6197
|
+
const o = Mc(t);
|
|
6206
6198
|
if (o.length === 0)
|
|
6207
6199
|
return { redundantMoveSkipped: !1 };
|
|
6208
6200
|
let n = o, i = !1;
|
|
6209
6201
|
if (r) {
|
|
6210
|
-
const a = o.length === 1 ? (c) => Ss(r, c) : (c) =>
|
|
6202
|
+
const a = o.length === 1 ? (c) => Ss(r, c) : (c) => Lc(r, c);
|
|
6211
6203
|
n = o.filter((c) => !a(c)), i = n.length < o.length;
|
|
6212
6204
|
}
|
|
6213
6205
|
if (n.length === 0)
|
|
@@ -6218,7 +6210,7 @@ function Hc({
|
|
|
6218
6210
|
);
|
|
6219
6211
|
return { move: n[0], redundantMoveSkipped: i };
|
|
6220
6212
|
}
|
|
6221
|
-
const
|
|
6213
|
+
const Hc = s.object({
|
|
6222
6214
|
id: s.string().min(1).describe("The ID of the task to update."),
|
|
6223
6215
|
content: s.string().optional().describe(
|
|
6224
6216
|
'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.'
|
|
@@ -6263,9 +6255,9 @@ const Wc = s.object({
|
|
|
6263
6255
|
isUncompletable: s.boolean().optional().describe(
|
|
6264
6256
|
"Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
|
|
6265
6257
|
)
|
|
6266
|
-
}),
|
|
6267
|
-
tasks: s.array(
|
|
6268
|
-
},
|
|
6258
|
+
}), Wc = (e) => !!(e.projectId || e.sectionId || e.parentId), js = (e) => Object.keys(e).length > 0, Bc = ["remove", "no date"], zc = ["remove", "no date", "no deadline"], qc = "no date", Ye = qt.TASKS_PER_OPERATION, Ot = {
|
|
6259
|
+
tasks: s.array(Hc).min(1).max(Ye).describe(`The tasks to update (max ${Ye}).`)
|
|
6260
|
+
}, Kc = {
|
|
6269
6261
|
tasks: s.array(F).describe("The updated tasks."),
|
|
6270
6262
|
totalCount: s.number().describe("The total number of tasks updated."),
|
|
6271
6263
|
updatedTaskIds: s.array(s.string()).describe("The IDs of the updated tasks."),
|
|
@@ -6280,22 +6272,22 @@ const Wc = s.object({
|
|
|
6280
6272
|
"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."
|
|
6281
6273
|
)
|
|
6282
6274
|
}).describe("Summary of operations performed.")
|
|
6283
|
-
},
|
|
6275
|
+
}, Yc = {
|
|
6284
6276
|
name: g.UPDATE_TASKS,
|
|
6285
6277
|
description: "Update existing tasks including content, dates, priorities, and assignments. Send only the fields that change.",
|
|
6286
6278
|
parameters: Ot,
|
|
6287
|
-
outputSchema:
|
|
6279
|
+
outputSchema: Kc,
|
|
6288
6280
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
6289
6281
|
async execute(e, t) {
|
|
6290
6282
|
const { tasks: r } = s.object(Ot).parse(e), o = r.map(() => ({ kind: "skipped" })), n = (T, b) => {
|
|
6291
6283
|
o[T] = { kind: "failed", error: b };
|
|
6292
6284
|
}, i = (T, b) => {
|
|
6293
6285
|
n(T, z(b));
|
|
6294
|
-
}, a = r.map((T, b) => ({ task: T, index: b })).filter(({ task: T }) =>
|
|
6286
|
+
}, a = r.map((T, b) => ({ task: T, index: b })).filter(({ task: T }) => sd(T)), c = await Vc(
|
|
6295
6287
|
a.map(({ task: T }) => T),
|
|
6296
6288
|
t
|
|
6297
6289
|
), d = await Promise.allSettled(
|
|
6298
|
-
a.map(({ task: T, index: b }) =>
|
|
6290
|
+
a.map(({ task: T, index: b }) => Qc({ task: T, index: b, client: t, inbox: c }))
|
|
6299
6291
|
), l = [];
|
|
6300
6292
|
for (const [T, b] of d.entries()) {
|
|
6301
6293
|
const S = a[T]?.index ?? T;
|
|
@@ -6305,13 +6297,13 @@ const Wc = s.object({
|
|
|
6305
6297
|
client: t,
|
|
6306
6298
|
ids: [
|
|
6307
6299
|
...new Set(
|
|
6308
|
-
l.filter((T) =>
|
|
6300
|
+
l.filter((T) => Wc(T.moveRequest)).map((T) => T.id)
|
|
6309
6301
|
)
|
|
6310
6302
|
]
|
|
6311
6303
|
}), p = [];
|
|
6312
6304
|
for (const T of l)
|
|
6313
6305
|
try {
|
|
6314
|
-
const b =
|
|
6306
|
+
const b = Fc({
|
|
6315
6307
|
taskId: T.id,
|
|
6316
6308
|
request: T.moveRequest,
|
|
6317
6309
|
current: u.get(T.id)
|
|
@@ -6320,17 +6312,17 @@ const Wc = s.object({
|
|
|
6320
6312
|
} catch (b) {
|
|
6321
6313
|
i(T.index, b), T.failed = !0;
|
|
6322
6314
|
}
|
|
6323
|
-
const
|
|
6315
|
+
const h = /* @__PURE__ */ new Map(), m = [], y = (T) => {
|
|
6324
6316
|
const b = T.filter((S) => !S.failed);
|
|
6325
|
-
b.length !== 0 &&
|
|
6326
|
-
|
|
6317
|
+
b.length !== 0 && m.push(
|
|
6318
|
+
Zc({
|
|
6327
6319
|
client: t,
|
|
6328
6320
|
items: b,
|
|
6329
6321
|
onUpdated: (S, $) => {
|
|
6330
6322
|
o[S.index] = { kind: "updated", task: $ };
|
|
6331
6323
|
},
|
|
6332
6324
|
onFailed: (S, $) => {
|
|
6333
|
-
const D =
|
|
6325
|
+
const D = h.get(S.index);
|
|
6334
6326
|
if (D && "task" in D) {
|
|
6335
6327
|
o[S.index] = {
|
|
6336
6328
|
kind: "partial",
|
|
@@ -6344,14 +6336,14 @@ const Wc = s.object({
|
|
|
6344
6336
|
})
|
|
6345
6337
|
);
|
|
6346
6338
|
}, f = new Set(p.map(({ item: T }) => T.index));
|
|
6347
|
-
y(l.filter((T) => !f.has(T.index))), await
|
|
6339
|
+
y(l.filter((T) => !f.has(T.index))), await Jc({
|
|
6348
6340
|
client: t,
|
|
6349
6341
|
moving: p,
|
|
6350
|
-
results:
|
|
6342
|
+
results: h,
|
|
6351
6343
|
onResolved: (T) => {
|
|
6352
6344
|
const b = [];
|
|
6353
6345
|
for (const { item: S } of T) {
|
|
6354
|
-
const $ =
|
|
6346
|
+
const $ = h.get(S.index);
|
|
6355
6347
|
if ($ && "error" in $) {
|
|
6356
6348
|
n(S.index, $.error), S.failed = !0;
|
|
6357
6349
|
continue;
|
|
@@ -6360,16 +6352,16 @@ const Wc = s.object({
|
|
|
6360
6352
|
}
|
|
6361
6353
|
y(b);
|
|
6362
6354
|
}
|
|
6363
|
-
}), await Promise.all(
|
|
6355
|
+
}), await Promise.all(m);
|
|
6364
6356
|
for (const T of l) {
|
|
6365
6357
|
if (T.failed || js(T.updateArgs))
|
|
6366
6358
|
continue;
|
|
6367
|
-
const b =
|
|
6359
|
+
const b = h.get(T.index);
|
|
6368
6360
|
b && "task" in b && (o[T.index] = { kind: "updated", task: b.task });
|
|
6369
6361
|
}
|
|
6370
|
-
const { updatedTasks: v, failures: j, skippedCount: A } =
|
|
6362
|
+
const { updatedTasks: v, failures: j, skippedCount: A } = Gc({ tasks: r, outcomes: o }), k = l.filter((T) => T.redundantMoveSkipped).length, I = v.map(P);
|
|
6371
6363
|
return {
|
|
6372
|
-
textContent:
|
|
6364
|
+
textContent: td({
|
|
6373
6365
|
tasks: I,
|
|
6374
6366
|
failures: j,
|
|
6375
6367
|
skippedCount: A,
|
|
@@ -6390,7 +6382,7 @@ const Wc = s.object({
|
|
|
6390
6382
|
};
|
|
6391
6383
|
}
|
|
6392
6384
|
};
|
|
6393
|
-
function
|
|
6385
|
+
function Gc({ tasks: e, outcomes: t }) {
|
|
6394
6386
|
const r = [], o = [];
|
|
6395
6387
|
let n = 0;
|
|
6396
6388
|
for (const [i, a] of t.entries()) {
|
|
@@ -6407,7 +6399,7 @@ function Vc({ tasks: e, outcomes: t }) {
|
|
|
6407
6399
|
}
|
|
6408
6400
|
return { updatedTasks: r, failures: o, skippedCount: n };
|
|
6409
6401
|
}
|
|
6410
|
-
async function
|
|
6402
|
+
async function Vc(e, t) {
|
|
6411
6403
|
if (!e.some((r) => N(r.projectId)))
|
|
6412
6404
|
return {};
|
|
6413
6405
|
try {
|
|
@@ -6434,7 +6426,7 @@ async function Cs({
|
|
|
6434
6426
|
}
|
|
6435
6427
|
return r;
|
|
6436
6428
|
}
|
|
6437
|
-
async function
|
|
6429
|
+
async function Jc({
|
|
6438
6430
|
client: e,
|
|
6439
6431
|
moving: t,
|
|
6440
6432
|
results: r,
|
|
@@ -6444,7 +6436,7 @@ async function Xc({
|
|
|
6444
6436
|
return;
|
|
6445
6437
|
const n = /* @__PURE__ */ new Map();
|
|
6446
6438
|
for (const c of t) {
|
|
6447
|
-
const d =
|
|
6439
|
+
const d = Nc(c.move), l = n.get(d);
|
|
6448
6440
|
l ? l.push(c) : n.set(d, [c]);
|
|
6449
6441
|
}
|
|
6450
6442
|
const i = lr(e), a = [];
|
|
@@ -6460,12 +6452,12 @@ async function Xc({
|
|
|
6460
6452
|
}
|
|
6461
6453
|
const p = await i(
|
|
6462
6454
|
() => O(() => e.moveTasks(d, l))
|
|
6463
|
-
),
|
|
6455
|
+
), h = new Map(p.map((f) => [f.id, f])), m = [], y = [];
|
|
6464
6456
|
for (const f of c) {
|
|
6465
|
-
const v =
|
|
6466
|
-
v ? (r.set(f.item.index, { task: v }), y.push(f)) :
|
|
6457
|
+
const v = h.get(f.item.id);
|
|
6458
|
+
v ? (r.set(f.item.index, { task: v }), y.push(f)) : m.push(f);
|
|
6467
6459
|
}
|
|
6468
|
-
o(y),
|
|
6460
|
+
o(y), m.length > 0 && a.push({ group: m, destination: l });
|
|
6469
6461
|
} catch (p) {
|
|
6470
6462
|
if (u) {
|
|
6471
6463
|
r.set(u.item.index, { error: z(p) }), o(c);
|
|
@@ -6475,12 +6467,12 @@ async function Xc({
|
|
|
6475
6467
|
}
|
|
6476
6468
|
}
|
|
6477
6469
|
if (a.length > 0) {
|
|
6478
|
-
await
|
|
6470
|
+
await Xc({ client: e, unresolved: a, results: r });
|
|
6479
6471
|
for (const { group: c } of a)
|
|
6480
6472
|
o(c);
|
|
6481
6473
|
}
|
|
6482
6474
|
}
|
|
6483
|
-
async function
|
|
6475
|
+
async function Xc({
|
|
6484
6476
|
client: e,
|
|
6485
6477
|
unresolved: t,
|
|
6486
6478
|
results: r
|
|
@@ -6498,7 +6490,7 @@ async function Zc({
|
|
|
6498
6490
|
}
|
|
6499
6491
|
}
|
|
6500
6492
|
}
|
|
6501
|
-
async function
|
|
6493
|
+
async function Zc({
|
|
6502
6494
|
client: e,
|
|
6503
6495
|
items: t,
|
|
6504
6496
|
onUpdated: r,
|
|
@@ -6518,7 +6510,7 @@ async function Qc({
|
|
|
6518
6510
|
})
|
|
6519
6511
|
);
|
|
6520
6512
|
}
|
|
6521
|
-
async function
|
|
6513
|
+
async function Qc({
|
|
6522
6514
|
task: e,
|
|
6523
6515
|
index: t,
|
|
6524
6516
|
client: r,
|
|
@@ -6533,8 +6525,8 @@ async function ed({
|
|
|
6533
6525
|
duration: l,
|
|
6534
6526
|
responsibleUser: u,
|
|
6535
6527
|
priority: p,
|
|
6536
|
-
labels:
|
|
6537
|
-
deadlineDate:
|
|
6528
|
+
labels: h,
|
|
6529
|
+
deadlineDate: m,
|
|
6538
6530
|
...y
|
|
6539
6531
|
} = e;
|
|
6540
6532
|
if (N(i) && o.error !== void 0)
|
|
@@ -6542,16 +6534,16 @@ async function ed({
|
|
|
6542
6534
|
const f = N(i) ? o.projectId : i;
|
|
6543
6535
|
let v = {
|
|
6544
6536
|
...y,
|
|
6545
|
-
...
|
|
6537
|
+
...h !== void 0 && { labels: h }
|
|
6546
6538
|
};
|
|
6547
6539
|
p && (v.priority = Zt(p));
|
|
6548
6540
|
const j = Pt(
|
|
6549
6541
|
d,
|
|
6550
|
-
|
|
6542
|
+
Bc,
|
|
6551
6543
|
qc
|
|
6552
6544
|
);
|
|
6553
6545
|
j !== void 0 && (v = { ...v, dueString: j });
|
|
6554
|
-
const A = Pt(
|
|
6546
|
+
const A = Pt(m, zc, null);
|
|
6555
6547
|
if (A !== void 0 && (v = { ...v, deadlineDate: A }), l)
|
|
6556
6548
|
try {
|
|
6557
6549
|
const { minutes: k } = Xt(l);
|
|
@@ -6565,7 +6557,7 @@ async function ed({
|
|
|
6565
6557
|
}
|
|
6566
6558
|
return u !== void 0 && (v = {
|
|
6567
6559
|
...v,
|
|
6568
|
-
assigneeId: await
|
|
6560
|
+
assigneeId: await ed(r, n, u)
|
|
6569
6561
|
}), {
|
|
6570
6562
|
index: t,
|
|
6571
6563
|
id: n,
|
|
@@ -6579,7 +6571,7 @@ async function ed({
|
|
|
6579
6571
|
failed: !1
|
|
6580
6572
|
};
|
|
6581
6573
|
}
|
|
6582
|
-
async function
|
|
6574
|
+
async function ed(e, t, r) {
|
|
6583
6575
|
if (r === null || r === "unassign")
|
|
6584
6576
|
return null;
|
|
6585
6577
|
const o = await at.validateTaskUpdateAssignment(
|
|
@@ -6593,7 +6585,7 @@ async function td(e, t, r) {
|
|
|
6593
6585
|
}
|
|
6594
6586
|
return o.resolvedUser?.userId;
|
|
6595
6587
|
}
|
|
6596
|
-
function
|
|
6588
|
+
function td({
|
|
6597
6589
|
tasks: e,
|
|
6598
6590
|
failures: t,
|
|
6599
6591
|
skippedCount: r,
|
|
@@ -6614,7 +6606,7 @@ function sd({
|
|
|
6614
6606
|
Failed (${t.length}) - address or drop these items:
|
|
6615
6607
|
${l}${u}`;
|
|
6616
6608
|
}
|
|
6617
|
-
function
|
|
6609
|
+
function sd({ id: e, ...t }) {
|
|
6618
6610
|
return Object.keys(t).length > 0;
|
|
6619
6611
|
}
|
|
6620
6612
|
function Pt(e, t, r) {
|
|
@@ -6625,7 +6617,7 @@ function Pt(e, t, r) {
|
|
|
6625
6617
|
const o = e.trim().toLowerCase();
|
|
6626
6618
|
return t.includes(o) ? r : e;
|
|
6627
6619
|
}
|
|
6628
|
-
const
|
|
6620
|
+
const rd = {}, od = {
|
|
6629
6621
|
type: s.literal("user_info").describe("The type of the response."),
|
|
6630
6622
|
userId: s.string().describe("The user ID."),
|
|
6631
6623
|
fullName: s.string().describe("The full name of the user."),
|
|
@@ -6642,25 +6634,25 @@ const od = {}, nd = {
|
|
|
6642
6634
|
email: s.string().describe("The email address of the user."),
|
|
6643
6635
|
plan: s.enum(["Todoist Free", "Todoist Pro", "Todoist Business"]).describe("The user plan.")
|
|
6644
6636
|
};
|
|
6645
|
-
function
|
|
6637
|
+
function nd(e) {
|
|
6646
6638
|
return e.businessAccountId ? "Todoist Business" : e.isPremium ? "Todoist Pro" : "Todoist Free";
|
|
6647
6639
|
}
|
|
6648
|
-
function
|
|
6640
|
+
function id(e, t) {
|
|
6649
6641
|
const o = ((e.getDay() || 7) - t + 7) % 7, n = new Date(e);
|
|
6650
6642
|
return n.setDate(e.getDate() - o), n;
|
|
6651
6643
|
}
|
|
6652
|
-
function
|
|
6644
|
+
function ad(e) {
|
|
6653
6645
|
const t = new Date(e);
|
|
6654
6646
|
return t.setDate(e.getDate() + 6), t;
|
|
6655
6647
|
}
|
|
6656
|
-
function
|
|
6648
|
+
function cd(e) {
|
|
6657
6649
|
const t = new Date(e.getFullYear(), 0, 1), r = (e.getTime() - t.getTime()) / 864e5;
|
|
6658
6650
|
return Math.ceil((r + t.getDay() + 1) / 7);
|
|
6659
6651
|
}
|
|
6660
|
-
function
|
|
6652
|
+
function dd(e) {
|
|
6661
6653
|
return ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"][e === 7 ? 0 : e] ?? "Unknown";
|
|
6662
6654
|
}
|
|
6663
|
-
function
|
|
6655
|
+
function ld(e) {
|
|
6664
6656
|
try {
|
|
6665
6657
|
return new Intl.DateTimeFormat("en-US", { timeZone: e }), !0;
|
|
6666
6658
|
} catch {
|
|
@@ -6668,9 +6660,9 @@ function ud(e) {
|
|
|
6668
6660
|
}
|
|
6669
6661
|
}
|
|
6670
6662
|
function $s(e) {
|
|
6671
|
-
return
|
|
6663
|
+
return ld(e) ? e : "UTC";
|
|
6672
6664
|
}
|
|
6673
|
-
function
|
|
6665
|
+
function ud(e, t) {
|
|
6674
6666
|
const r = $s(t);
|
|
6675
6667
|
return e.toLocaleString("en-US", {
|
|
6676
6668
|
timeZone: r,
|
|
@@ -6683,8 +6675,8 @@ function pd(e, t) {
|
|
|
6683
6675
|
hour12: !1
|
|
6684
6676
|
});
|
|
6685
6677
|
}
|
|
6686
|
-
async function
|
|
6687
|
-
const t = await e.getUser(), r = t.tzInfo?.timezone ?? "UTC", o = $s(r), n = /* @__PURE__ */ new Date(), i =
|
|
6678
|
+
async function pd(e) {
|
|
6679
|
+
const t = await e.getUser(), r = t.tzInfo?.timezone ?? "UTC", o = $s(r), n = /* @__PURE__ */ new Date(), i = ud(n, o), a = t.startDay ?? 1, c = dd(a), d = nd(t), l = new Date(n.toLocaleString("en-US", { timeZone: o })), u = id(l, a), p = ad(u), h = cd(l), y = [
|
|
6688
6680
|
"# User Information",
|
|
6689
6681
|
"",
|
|
6690
6682
|
`**User ID:** ${t.id}`,
|
|
@@ -6695,7 +6687,7 @@ async function md(e) {
|
|
|
6695
6687
|
"",
|
|
6696
6688
|
"## Week Settings",
|
|
6697
6689
|
`**Week Start Day:** ${c} (${a})`,
|
|
6698
|
-
`**Current Week:** Week ${
|
|
6690
|
+
`**Current Week:** Week ${h}`,
|
|
6699
6691
|
`**Week Start Date:** ${ae(u)}`,
|
|
6700
6692
|
`**Week End Date:** ${ae(p)}`,
|
|
6701
6693
|
"",
|
|
@@ -6717,7 +6709,7 @@ async function md(e) {
|
|
|
6717
6709
|
startDayName: c,
|
|
6718
6710
|
weekStartDate: ae(u),
|
|
6719
6711
|
weekEndDate: ae(p),
|
|
6720
|
-
currentWeekNumber:
|
|
6712
|
+
currentWeekNumber: h,
|
|
6721
6713
|
completedToday: t.completedToday,
|
|
6722
6714
|
dailyGoal: t.dailyGoal,
|
|
6723
6715
|
weeklyGoal: t.weeklyGoal,
|
|
@@ -6729,23 +6721,23 @@ async function md(e) {
|
|
|
6729
6721
|
const hd = {
|
|
6730
6722
|
name: g.USER_INFO,
|
|
6731
6723
|
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).",
|
|
6732
|
-
parameters:
|
|
6733
|
-
outputSchema:
|
|
6724
|
+
parameters: rd,
|
|
6725
|
+
outputSchema: od,
|
|
6734
6726
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
6735
6727
|
async execute(e, t) {
|
|
6736
|
-
const r = await
|
|
6728
|
+
const r = await pd(t);
|
|
6737
6729
|
return {
|
|
6738
6730
|
textContent: r.textContent,
|
|
6739
6731
|
structuredContent: r.structuredContent
|
|
6740
6732
|
};
|
|
6741
6733
|
}
|
|
6742
|
-
}, _t = 10 * 1024 * 1024,
|
|
6734
|
+
}, _t = 10 * 1024 * 1024, md = /* @__PURE__ */ new Set([
|
|
6743
6735
|
"image/png",
|
|
6744
6736
|
"image/jpeg",
|
|
6745
6737
|
"image/gif",
|
|
6746
6738
|
"image/webp",
|
|
6747
6739
|
"image/svg+xml"
|
|
6748
|
-
]),
|
|
6740
|
+
]), fd = /* @__PURE__ */ new Set([
|
|
6749
6741
|
"text/plain",
|
|
6750
6742
|
"text/csv",
|
|
6751
6743
|
"text/html",
|
|
@@ -6753,7 +6745,7 @@ const hd = {
|
|
|
6753
6745
|
"application/json",
|
|
6754
6746
|
"application/xml",
|
|
6755
6747
|
"text/xml"
|
|
6756
|
-
]),
|
|
6748
|
+
]), bd = {
|
|
6757
6749
|
".png": "image/png",
|
|
6758
6750
|
".jpg": "image/jpeg",
|
|
6759
6751
|
".jpeg": "image/jpeg",
|
|
@@ -6768,23 +6760,23 @@ const hd = {
|
|
|
6768
6760
|
".xml": "application/xml",
|
|
6769
6761
|
".pdf": "application/pdf"
|
|
6770
6762
|
};
|
|
6771
|
-
function
|
|
6772
|
-
return
|
|
6763
|
+
function gd(e) {
|
|
6764
|
+
return md.has(e) ? "image" : fd.has(e) || e.startsWith("text/") ? "text" : "binary";
|
|
6773
6765
|
}
|
|
6774
|
-
function
|
|
6766
|
+
function yd(e) {
|
|
6775
6767
|
return (e.split(";")[0] ?? e).trim().toLowerCase();
|
|
6776
6768
|
}
|
|
6777
|
-
function
|
|
6769
|
+
function Td(e) {
|
|
6778
6770
|
try {
|
|
6779
6771
|
const t = new URL(e).pathname, r = t.lastIndexOf(".");
|
|
6780
6772
|
if (r === -1) return;
|
|
6781
6773
|
const o = t.slice(r).toLowerCase();
|
|
6782
|
-
return
|
|
6774
|
+
return bd[o];
|
|
6783
6775
|
} catch {
|
|
6784
6776
|
return;
|
|
6785
6777
|
}
|
|
6786
6778
|
}
|
|
6787
|
-
function
|
|
6779
|
+
function kd(e) {
|
|
6788
6780
|
try {
|
|
6789
6781
|
const t = new URL(e).pathname, r = t.lastIndexOf("/");
|
|
6790
6782
|
return r === -1 ? void 0 : t.slice(r + 1) || void 0;
|
|
@@ -6792,21 +6784,21 @@ function wd(e) {
|
|
|
6792
6784
|
return;
|
|
6793
6785
|
}
|
|
6794
6786
|
}
|
|
6795
|
-
const
|
|
6787
|
+
const wd = {
|
|
6796
6788
|
fileUrl: s.url().describe(
|
|
6797
6789
|
"The URL of the attachment file to view. Get this from the fileUrl field in a comment's fileAttachment."
|
|
6798
6790
|
)
|
|
6799
|
-
},
|
|
6791
|
+
}, vd = {
|
|
6800
6792
|
name: g.VIEW_ATTACHMENT,
|
|
6801
6793
|
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).",
|
|
6802
|
-
parameters:
|
|
6794
|
+
parameters: wd,
|
|
6803
6795
|
annotations: {
|
|
6804
6796
|
readOnlyHint: !0,
|
|
6805
6797
|
destructiveHint: !1,
|
|
6806
6798
|
idempotentHint: !0
|
|
6807
6799
|
},
|
|
6808
6800
|
async execute({ fileUrl: e }, t) {
|
|
6809
|
-
const r = await t.viewAttachment(e), o = r.headers["content-length"], n = o ? Number.parseInt(o, 10) : void 0, i =
|
|
6801
|
+
const r = await t.viewAttachment(e), o = r.headers["content-length"], n = o ? Number.parseInt(o, 10) : void 0, i = kd(e), a = r.headers["content-type"], c = a ? yd(a) : void 0, d = c && c !== "application/octet-stream" ? c : Td(e) ?? c ?? "application/octet-stream";
|
|
6810
6802
|
if (n && n > _t)
|
|
6811
6803
|
return {
|
|
6812
6804
|
textContent: `Attachment "${i ?? e}" is too large to display inline (${(n / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
|
|
@@ -6816,15 +6808,15 @@ const vd = {
|
|
|
6816
6808
|
return {
|
|
6817
6809
|
textContent: `Attachment "${i ?? e}" is too large to display inline (${(u / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
|
|
6818
6810
|
};
|
|
6819
|
-
const p =
|
|
6820
|
-
return p === "image" ?
|
|
6811
|
+
const p = gd(d), h = [];
|
|
6812
|
+
return p === "image" ? h.push({
|
|
6821
6813
|
type: "image",
|
|
6822
6814
|
data: l.toString("base64"),
|
|
6823
6815
|
mimeType: d
|
|
6824
|
-
}) : p === "text" ?
|
|
6816
|
+
}) : p === "text" ? h.push({
|
|
6825
6817
|
type: "text",
|
|
6826
6818
|
text: l.toString("utf-8")
|
|
6827
|
-
}) :
|
|
6819
|
+
}) : h.push({
|
|
6828
6820
|
type: "resource",
|
|
6829
6821
|
resource: {
|
|
6830
6822
|
uri: e,
|
|
@@ -6833,80 +6825,80 @@ const vd = {
|
|
|
6833
6825
|
}
|
|
6834
6826
|
}), {
|
|
6835
6827
|
textContent: `Attachment: ${i ?? "unknown"} (${d}, ${(u / 1024).toFixed(1)}KB)`,
|
|
6836
|
-
contentItems:
|
|
6828
|
+
contentItems: h
|
|
6837
6829
|
};
|
|
6838
6830
|
}
|
|
6839
|
-
},
|
|
6831
|
+
}, Id = {
|
|
6840
6832
|
...Pi,
|
|
6841
6833
|
_meta: {
|
|
6842
6834
|
ui: {
|
|
6843
6835
|
resourceUri: Le
|
|
6844
6836
|
}
|
|
6845
6837
|
}
|
|
6846
|
-
},
|
|
6838
|
+
}, Sd = {
|
|
6847
6839
|
// Task management tools
|
|
6848
6840
|
addTasks: pn,
|
|
6849
6841
|
completeTasks: wn,
|
|
6850
|
-
uncompleteTasks:
|
|
6851
|
-
updateTasks:
|
|
6852
|
-
rescheduleTasks:
|
|
6842
|
+
uncompleteTasks: Xa,
|
|
6843
|
+
updateTasks: Yc,
|
|
6844
|
+
rescheduleTasks: za,
|
|
6853
6845
|
findTasks: Fi,
|
|
6854
|
-
findTasksByDate:
|
|
6846
|
+
findTasksByDate: Id,
|
|
6855
6847
|
findCompletedTasks: ii,
|
|
6856
6848
|
// Project management tools
|
|
6857
6849
|
addProjects: Yo,
|
|
6858
|
-
updateProjects:
|
|
6850
|
+
updateProjects: vc,
|
|
6859
6851
|
findProjects: ki,
|
|
6860
|
-
projectManagement:
|
|
6861
|
-
projectMove:
|
|
6852
|
+
projectManagement: _a,
|
|
6853
|
+
projectMove: La,
|
|
6862
6854
|
// Section management tools
|
|
6863
6855
|
addSections: an,
|
|
6864
|
-
updateSections:
|
|
6856
|
+
updateSections: Rc,
|
|
6865
6857
|
findSections: xi,
|
|
6866
6858
|
// Comment management tools
|
|
6867
6859
|
addComments: Io,
|
|
6868
6860
|
findComments: Xn,
|
|
6869
|
-
updateComments:
|
|
6861
|
+
updateComments: sc,
|
|
6870
6862
|
// Reminder management tools
|
|
6871
6863
|
addReminders: tn,
|
|
6872
6864
|
findReminders: Si,
|
|
6873
|
-
updateReminders:
|
|
6865
|
+
updateReminders: Ec,
|
|
6874
6866
|
// Attachment tools
|
|
6875
|
-
viewAttachment:
|
|
6867
|
+
viewAttachment: vd,
|
|
6876
6868
|
// Label management tools
|
|
6877
6869
|
addLabels: Uo,
|
|
6878
|
-
updateLabels:
|
|
6870
|
+
updateLabels: bc,
|
|
6879
6871
|
findLabels: li,
|
|
6880
6872
|
// Filter management tools
|
|
6881
6873
|
findFilters: $o,
|
|
6882
6874
|
addFilters: Oo,
|
|
6883
|
-
updateFilters:
|
|
6875
|
+
updateFilters: ac,
|
|
6884
6876
|
// Activity and audit tools
|
|
6885
6877
|
findActivity: zn,
|
|
6886
6878
|
getProductivityStats: Qi,
|
|
6887
6879
|
// Health and insights tools
|
|
6888
|
-
getProjectHealth:
|
|
6880
|
+
getProjectHealth: la,
|
|
6889
6881
|
getProjectActivityStats: oa,
|
|
6890
6882
|
analyzeProjectHealth: yn,
|
|
6891
|
-
getWorkspaceInsights:
|
|
6883
|
+
getWorkspaceInsights: ma,
|
|
6892
6884
|
// General tools
|
|
6893
6885
|
getOverview: Ji,
|
|
6894
6886
|
deleteObject: jn,
|
|
6895
6887
|
fetchObject: Ln,
|
|
6896
|
-
reorderObjects:
|
|
6888
|
+
reorderObjects: Fa,
|
|
6897
6889
|
userInfo: hd,
|
|
6898
6890
|
// Assignment and collaboration tools
|
|
6899
|
-
findProjectCollaborators:
|
|
6900
|
-
manageAssignments:
|
|
6891
|
+
findProjectCollaborators: mi,
|
|
6892
|
+
manageAssignments: Ea,
|
|
6901
6893
|
// Template tools
|
|
6902
6894
|
exportProjectTemplate: Dn,
|
|
6903
|
-
importProjectTemplate:
|
|
6895
|
+
importProjectTemplate: Ta,
|
|
6904
6896
|
// Workspace tools
|
|
6905
|
-
listWorkspaces:
|
|
6897
|
+
listWorkspaces: ja,
|
|
6906
6898
|
// OpenAI MCP tools
|
|
6907
|
-
search:
|
|
6899
|
+
search: Ga,
|
|
6908
6900
|
fetch: Fn
|
|
6909
|
-
},
|
|
6901
|
+
}, jd = Object.values(Sd), Cd = `
|
|
6910
6902
|
## Todoist Task and Project Management Tools
|
|
6911
6903
|
|
|
6912
6904
|
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.
|
|
@@ -6930,7 +6922,7 @@ What each tool does and how to fill its parameters is in the tool's own descript
|
|
|
6930
6922
|
|
|
6931
6923
|
**Finding things**
|
|
6932
6924
|
|
|
6933
|
-
- For "what did I complete?",
|
|
6925
|
+
- For "what did I complete?", call **user-info** for the asker's user ID, then **find-activity** with objectType="task", eventType="completed", initiatorId, and dateFrom/dateTo. Without initiatorId the answer covers every collaborator. find-activity reports completion events, including each occurrence of a recurring task; **find-completed-tasks** lists completed tasks, which is not the same question.
|
|
6934
6926
|
- To resolve a person's name or email to a user ID, or to answer "who is X?", use **find-project-collaborators** with just a searchTerm. It covers every shared project you can access plus yourself, so an empty result means they collaborate on none of them — not that they do not exist.
|
|
6935
6927
|
- Before assigning work to someone, call **find-project-collaborators** again with the target projectId. Resolving an ID only proves they collaborate on *some* project you can see; assignment fails unless they collaborate on that one.
|
|
6936
6928
|
- To find out whether a task hides subtasks, use **fetch-object** with includeChildren rather than a speculative **find-tasks** call.
|
|
@@ -6958,7 +6950,7 @@ Use the **productivity-analysis** prompt for a combined productivity review —
|
|
|
6958
6950
|
|
|
6959
6951
|
Always provide clear, actionable task titles and descriptions. Use the overview tools to give users context about their workload and project status.
|
|
6960
6952
|
`;
|
|
6961
|
-
function
|
|
6953
|
+
function Fd({
|
|
6962
6954
|
todoistApiKey: e,
|
|
6963
6955
|
baseUrl: t,
|
|
6964
6956
|
features: r = []
|
|
@@ -6970,21 +6962,21 @@ function Hd({
|
|
|
6970
6962
|
tools: { listChanged: !0 },
|
|
6971
6963
|
prompts: { listChanged: !0 }
|
|
6972
6964
|
},
|
|
6973
|
-
instructions:
|
|
6965
|
+
instructions: Cd
|
|
6974
6966
|
}
|
|
6975
6967
|
), n = jr(e, { baseUrl: t });
|
|
6976
6968
|
Gs(o);
|
|
6977
6969
|
const i = { server: o, client: n, features: r };
|
|
6978
|
-
for (const a of
|
|
6979
|
-
|
|
6970
|
+
for (const a of jd)
|
|
6971
|
+
qr({ tool: a, ...i });
|
|
6980
6972
|
return o.registerPrompt(
|
|
6981
|
-
|
|
6973
|
+
me.name,
|
|
6982
6974
|
{
|
|
6983
|
-
title:
|
|
6984
|
-
description:
|
|
6985
|
-
argsSchema:
|
|
6975
|
+
title: me.title,
|
|
6976
|
+
description: me.description,
|
|
6977
|
+
argsSchema: me.argsSchema
|
|
6986
6978
|
},
|
|
6987
|
-
|
|
6979
|
+
me.callback
|
|
6988
6980
|
), o;
|
|
6989
6981
|
}
|
|
6990
6982
|
export {
|
|
@@ -6992,28 +6984,28 @@ export {
|
|
|
6992
6984
|
Ji as A,
|
|
6993
6985
|
Qi as B,
|
|
6994
6986
|
oa as C,
|
|
6995
|
-
|
|
6996
|
-
|
|
6997
|
-
|
|
6998
|
-
|
|
6999
|
-
|
|
7000
|
-
|
|
7001
|
-
|
|
7002
|
-
|
|
7003
|
-
|
|
7004
|
-
|
|
7005
|
-
|
|
7006
|
-
|
|
7007
|
-
|
|
7008
|
-
|
|
7009
|
-
|
|
7010
|
-
|
|
7011
|
-
|
|
7012
|
-
|
|
7013
|
-
|
|
7014
|
-
|
|
6987
|
+
la as D,
|
|
6988
|
+
ma as E,
|
|
6989
|
+
Md as F,
|
|
6990
|
+
Ta as G,
|
|
6991
|
+
ja as H,
|
|
6992
|
+
Ea as I,
|
|
6993
|
+
_a as J,
|
|
6994
|
+
La as K,
|
|
6995
|
+
jd as L,
|
|
6996
|
+
Fa as M,
|
|
6997
|
+
za as N,
|
|
6998
|
+
Ga as O,
|
|
6999
|
+
Xa as P,
|
|
7000
|
+
sc as Q,
|
|
7001
|
+
ac as R,
|
|
7002
|
+
bc as S,
|
|
7003
|
+
vc as T,
|
|
7004
|
+
Ec as U,
|
|
7005
|
+
Rc as V,
|
|
7006
|
+
Yc as W,
|
|
7015
7007
|
hd as X,
|
|
7016
|
-
|
|
7008
|
+
vd as Y,
|
|
7017
7009
|
jr as Z,
|
|
7018
7010
|
br as _,
|
|
7019
7011
|
Io as a,
|
|
@@ -7022,7 +7014,7 @@ export {
|
|
|
7022
7014
|
Yo as d,
|
|
7023
7015
|
tn as e,
|
|
7024
7016
|
an as f,
|
|
7025
|
-
|
|
7017
|
+
Fd as g,
|
|
7026
7018
|
pn as h,
|
|
7027
7019
|
yn as i,
|
|
7028
7020
|
wn as j,
|
|
@@ -7035,8 +7027,8 @@ export {
|
|
|
7035
7027
|
ii as q,
|
|
7036
7028
|
$o as r,
|
|
7037
7029
|
li as s,
|
|
7038
|
-
|
|
7039
|
-
|
|
7030
|
+
Sd as t,
|
|
7031
|
+
mi as u,
|
|
7040
7032
|
ki as v,
|
|
7041
7033
|
Si as w,
|
|
7042
7034
|
xi as x,
|