@doist/todoist-mcp 12.2.2 → 12.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -3
- package/dist/main-http.js +2 -2
- package/dist/main.js +1 -1
- package/dist/{mcp-server-DC5QFthT.js → mcp-server-S9IIW20j.js} +592 -591
- package/dist/{require-valid-todoist-token-B3TJXi5X.js → require-valid-todoist-token-b21ze0l_.js} +1 -1
- package/dist/utils/retry.d.ts +23 -1
- package/dist/utils/retry.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -126,7 +126,7 @@ function xe(e) {
|
|
|
126
126
|
if (t?.[1])
|
|
127
127
|
return O(t[1]);
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function z(e) {
|
|
130
130
|
const t = T(e);
|
|
131
131
|
if (t)
|
|
132
132
|
return R(t);
|
|
@@ -296,17 +296,17 @@ function _t(e) {
|
|
|
296
296
|
), l = [
|
|
297
297
|
T(n?.error),
|
|
298
298
|
T(n?.message),
|
|
299
|
-
|
|
299
|
+
z(n?.message),
|
|
300
300
|
T(t?.message),
|
|
301
301
|
T(r?.message),
|
|
302
302
|
e instanceof Error ? e.message : T(e)
|
|
303
303
|
].filter((m) => !!m), d = l.find((m) => !We(m)) || l[0], u = N(
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
304
|
+
z(n?.errorExtra),
|
|
305
|
+
z(n?.error_extra),
|
|
306
|
+
z(n?.details),
|
|
307
|
+
z(n?.errorDetails),
|
|
308
|
+
z(n?.errors),
|
|
309
|
+
z(t?.details)
|
|
310
310
|
), p = _s(n);
|
|
311
311
|
return a !== void 0 || Ns(n) || c !== void 0 || i !== void 0 || (d ? We(d) : !1) ? {
|
|
312
312
|
statusCode: a,
|
|
@@ -345,17 +345,17 @@ function Ws(e) {
|
|
|
345
345
|
const t = _t(e);
|
|
346
346
|
return t ? Hs(t) : Nt(e);
|
|
347
347
|
}
|
|
348
|
-
const Bs = "12.2.
|
|
348
|
+
const Bs = "12.2.3", Ys = {
|
|
349
349
|
version: Bs
|
|
350
|
-
},
|
|
350
|
+
}, qs = "todoist-mcp", Ke = Ys.version, Lt = new Ts(), ut = ws(import.meta.url);
|
|
351
351
|
let ke;
|
|
352
|
-
const
|
|
352
|
+
const zs = async () => {
|
|
353
353
|
const e = ut.resolve("@doist/todoist-sdk"), t = _e(At(e), "transport", "http-dispatcher.js");
|
|
354
354
|
return ut(t);
|
|
355
355
|
};
|
|
356
|
-
let Gs =
|
|
356
|
+
let Gs = zs;
|
|
357
357
|
function Ks() {
|
|
358
|
-
return `${
|
|
358
|
+
return `${qs}/${Ke}`;
|
|
359
359
|
}
|
|
360
360
|
function Mt(e) {
|
|
361
361
|
return e.trim().toLowerCase();
|
|
@@ -476,8 +476,8 @@ function or(e, {
|
|
|
476
476
|
...t ? { baseUrl: t } : {}
|
|
477
477
|
});
|
|
478
478
|
}
|
|
479
|
-
const nr = 2, ar = 500, ir = 2e3, cr = /* @__PURE__ */ new Set([502, 503, 504]);
|
|
480
|
-
function
|
|
479
|
+
const nr = 2, ar = 500, ir = 2e3, cr = 50, dr = /* @__PURE__ */ new Set([502, 503, 504]);
|
|
480
|
+
function lr(e) {
|
|
481
481
|
if (e == null || typeof e != "object")
|
|
482
482
|
return;
|
|
483
483
|
const t = e;
|
|
@@ -493,47 +493,48 @@ function dr(e) {
|
|
|
493
493
|
return Number(r[1]);
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
|
-
function
|
|
497
|
-
const t =
|
|
498
|
-
return t !== void 0 &&
|
|
496
|
+
function ur(e) {
|
|
497
|
+
const t = lr(e);
|
|
498
|
+
return t !== void 0 && dr.has(t);
|
|
499
499
|
}
|
|
500
|
-
function
|
|
500
|
+
function pr({
|
|
501
501
|
attempt: e,
|
|
502
502
|
baseDelayMs: t,
|
|
503
|
-
maxDelayMs: r
|
|
503
|
+
maxDelayMs: r,
|
|
504
|
+
random: o = Math.random
|
|
504
505
|
}) {
|
|
505
|
-
const
|
|
506
|
-
return Math.min(
|
|
506
|
+
const n = Math.min(t * 2 ** e, r), a = Math.round(o() * n);
|
|
507
|
+
return Math.min(n, Math.max(cr, a));
|
|
507
508
|
}
|
|
508
|
-
function
|
|
509
|
+
function hr(e) {
|
|
509
510
|
return new Promise((t) => setTimeout(t, e));
|
|
510
511
|
}
|
|
511
512
|
async function _(e, t = {}) {
|
|
512
|
-
const r = t.maxRetries ?? nr, o = t.baseDelayMs ?? ar, n = t.maxDelayMs ?? ir;
|
|
513
|
-
let
|
|
514
|
-
for (let
|
|
513
|
+
const r = t.maxRetries ?? nr, o = t.baseDelayMs ?? ar, n = t.maxDelayMs ?? ir, a = t.random;
|
|
514
|
+
let i;
|
|
515
|
+
for (let c = 0; c <= r; c++)
|
|
515
516
|
try {
|
|
516
517
|
return await e();
|
|
517
|
-
} catch (
|
|
518
|
-
if (
|
|
519
|
-
const
|
|
520
|
-
await
|
|
518
|
+
} catch (l) {
|
|
519
|
+
if (i = l, c < r && ur(l)) {
|
|
520
|
+
const d = pr({ attempt: c, baseDelayMs: o, maxDelayMs: n, random: a });
|
|
521
|
+
await hr(d);
|
|
521
522
|
continue;
|
|
522
523
|
}
|
|
523
|
-
throw
|
|
524
|
+
throw l;
|
|
524
525
|
}
|
|
525
|
-
throw
|
|
526
|
+
throw i;
|
|
526
527
|
}
|
|
527
|
-
function
|
|
528
|
+
function Ye(e) {
|
|
528
529
|
if (e == null)
|
|
529
530
|
return e;
|
|
530
531
|
if (Array.isArray(e))
|
|
531
|
-
return e.map((t) =>
|
|
532
|
+
return e.map((t) => Ye(t));
|
|
532
533
|
if (typeof e == "object") {
|
|
533
534
|
const t = {};
|
|
534
535
|
for (const [r, o] of Object.entries(e))
|
|
535
536
|
if (o !== null) {
|
|
536
|
-
const n =
|
|
537
|
+
const n = Ye(o);
|
|
537
538
|
if (n !== null && typeof n == "object" && !Array.isArray(n) && Object.keys(n).length === 0)
|
|
538
539
|
continue;
|
|
539
540
|
t[r] = n;
|
|
@@ -608,54 +609,54 @@ const b = {
|
|
|
608
609
|
* Affects: find-project-collaborators, find-completed-tasks
|
|
609
610
|
*/
|
|
610
611
|
STRIP_EMAILS: "strip_emails"
|
|
611
|
-
},
|
|
612
|
-
function
|
|
612
|
+
}, mr = process.env.USE_STRUCTURED_CONTENT === "true" || process.env.NODE_ENV === "test";
|
|
613
|
+
function fr({
|
|
613
614
|
textContent: e,
|
|
614
615
|
structuredContent: t,
|
|
615
616
|
contentItems: r
|
|
616
617
|
}) {
|
|
617
|
-
const o =
|
|
618
|
-
return r && a.push(...r), !
|
|
618
|
+
const o = Ye(t), n = {}, a = [];
|
|
619
|
+
return r && a.push(...r), !mr && t && a.push({
|
|
619
620
|
type: "text",
|
|
620
621
|
text: JSON.stringify(o)
|
|
621
622
|
}), e && a.push({ type: "text", text: e }), a.length > 0 && (n.content = a), t && (n.structuredContent = o), n;
|
|
622
623
|
}
|
|
623
|
-
function
|
|
624
|
+
function br(e) {
|
|
624
625
|
return {
|
|
625
626
|
content: [{ type: "text", text: e }],
|
|
626
627
|
isError: !0
|
|
627
628
|
};
|
|
628
629
|
}
|
|
629
|
-
function
|
|
630
|
+
function gr(e) {
|
|
630
631
|
return { ...{
|
|
631
|
-
title: `Todoist: ${
|
|
632
|
+
title: `Todoist: ${yr(e.name)}`,
|
|
632
633
|
openWorldHint: !1
|
|
633
634
|
}, ...e.annotations };
|
|
634
635
|
}
|
|
635
|
-
function
|
|
636
|
+
function yr(e) {
|
|
636
637
|
return e.split("-").filter(Boolean).map((t) => `${t.charAt(0).toUpperCase()}${t.slice(1)}`).join(" ");
|
|
637
638
|
}
|
|
638
|
-
function
|
|
639
|
+
function kr(e) {
|
|
639
640
|
return e ? typeof e["ui/resourceUri"] == "string" ? !0 : typeof e.ui == "object" && e.ui !== null : !1;
|
|
640
641
|
}
|
|
641
|
-
const
|
|
642
|
+
const Tr = [
|
|
642
643
|
b.FIND_PROJECT_COLLABORATORS,
|
|
643
644
|
b.FIND_COMPLETED_TASKS
|
|
644
645
|
];
|
|
645
|
-
function
|
|
646
|
+
function qe(e) {
|
|
646
647
|
if (e == null)
|
|
647
648
|
return e;
|
|
648
649
|
if (Array.isArray(e))
|
|
649
|
-
return e.map((t) =>
|
|
650
|
+
return e.map((t) => qe(t));
|
|
650
651
|
if (typeof e == "object") {
|
|
651
652
|
const t = {};
|
|
652
653
|
for (const [r, o] of Object.entries(e))
|
|
653
|
-
r !== "email" && (t[r] =
|
|
654
|
+
r !== "email" && (t[r] = qe(o));
|
|
654
655
|
return t;
|
|
655
656
|
}
|
|
656
657
|
return e;
|
|
657
658
|
}
|
|
658
|
-
function
|
|
659
|
+
function wr(e) {
|
|
659
660
|
const t = /\s*\([^)]*@[^)]+\)/g, r = /\S+@\S+\.\S+/g;
|
|
660
661
|
return e.replace(t, "").replace(r, "[email hidden]");
|
|
661
662
|
}
|
|
@@ -665,7 +666,7 @@ function k({
|
|
|
665
666
|
client: r,
|
|
666
667
|
features: o = []
|
|
667
668
|
}) {
|
|
668
|
-
const n = o.some((c) => c.name === "strip_emails") &&
|
|
669
|
+
const n = o.some((c) => c.name === "strip_emails") && Tr.includes(e.name), a = async (c, l) => {
|
|
669
670
|
try {
|
|
670
671
|
let { textContent: d, structuredContent: u, contentItems: p } = await Vs(
|
|
671
672
|
e.name,
|
|
@@ -673,18 +674,18 @@ function k({
|
|
|
673
674
|
() => e.execute(c, r)
|
|
674
675
|
)
|
|
675
676
|
);
|
|
676
|
-
return n && (d && (d =
|
|
677
|
+
return n && (d && (d = wr(d)), u && (u = qe(u))), fr({ textContent: d, structuredContent: u, contentItems: p });
|
|
677
678
|
} catch (d) {
|
|
678
|
-
return console.error(`Error executing tool ${e.name}:`, { args: c, error: d }),
|
|
679
|
+
return console.error(`Error executing tool ${e.name}:`, { args: c, error: d }), br(Ws(d));
|
|
679
680
|
}
|
|
680
681
|
}, i = {
|
|
681
682
|
description: e.description,
|
|
682
683
|
inputSchema: e.parameters,
|
|
683
684
|
...e.outputSchema ? { outputSchema: e.outputSchema } : {},
|
|
684
|
-
annotations:
|
|
685
|
+
annotations: gr(e),
|
|
685
686
|
...e._meta ? { _meta: e._meta } : {}
|
|
686
687
|
};
|
|
687
|
-
if (
|
|
688
|
+
if (kr(e._meta)) {
|
|
688
689
|
ys(
|
|
689
690
|
t,
|
|
690
691
|
e.name,
|
|
@@ -698,7 +699,7 @@ function k({
|
|
|
698
699
|
}
|
|
699
700
|
t.registerTool(e.name, i, a);
|
|
700
701
|
}
|
|
701
|
-
const
|
|
702
|
+
const vr = {
|
|
702
703
|
period: s.enum(["today", "7d", "14d", "30d", "this-week", "this-month"]).default("7d").describe(
|
|
703
704
|
'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.'
|
|
704
705
|
),
|
|
@@ -707,7 +708,7 @@ const wr = {
|
|
|
707
708
|
),
|
|
708
709
|
projectId: s.string().optional().describe("Optional project ID to scope the analysis to a specific project.")
|
|
709
710
|
};
|
|
710
|
-
function
|
|
711
|
+
function Ir(e, t = /* @__PURE__ */ new Date()) {
|
|
711
712
|
const r = (n) => n.toISOString().slice(0, 10), o = r(t);
|
|
712
713
|
switch (e) {
|
|
713
714
|
case "today":
|
|
@@ -754,7 +755,7 @@ function vr(e, t = /* @__PURE__ */ new Date()) {
|
|
|
754
755
|
}
|
|
755
756
|
}
|
|
756
757
|
}
|
|
757
|
-
function
|
|
758
|
+
function jr(e) {
|
|
758
759
|
const t = {
|
|
759
760
|
goals: `### Goal Tracking
|
|
760
761
|
- Compare tasks completed today vs the daily goal
|
|
@@ -785,8 +786,8 @@ function Ir(e) {
|
|
|
785
786
|
|
|
786
787
|
`) : t[e] ?? "";
|
|
787
788
|
}
|
|
788
|
-
function
|
|
789
|
-
const { since: t, until: r, periodDescription: o } =
|
|
789
|
+
function Sr(e) {
|
|
790
|
+
const { since: t, until: r, periodDescription: o } = Ir(e.period), n = e.projectId ? `
|
|
790
791
|
Scope this analysis to project ID: ${e.projectId}. Pass this projectId when calling find-completed-tasks and get-overview.` : "";
|
|
791
792
|
return `Analyze my Todoist productivity for ${o} (${t} to ${r}).${n}
|
|
792
793
|
|
|
@@ -807,7 +808,7 @@ ${e.focus === "overall" || e.focus === "projects" ? `4. **get-overview** — Get
|
|
|
807
808
|
|
|
808
809
|
Using the collected data, produce an analysis covering the following sections:
|
|
809
810
|
|
|
810
|
-
${
|
|
811
|
+
${jr(e.focus)}
|
|
811
812
|
|
|
812
813
|
### Step 3: Format
|
|
813
814
|
|
|
@@ -817,14 +818,14 @@ Present the analysis as a clear, well-structured markdown report with:
|
|
|
817
818
|
- Specific numbers and comparisons (not vague statements)
|
|
818
819
|
- Actionable takeaways highlighted clearly`;
|
|
819
820
|
}
|
|
820
|
-
function
|
|
821
|
+
function Cr(e) {
|
|
821
822
|
return {
|
|
822
823
|
messages: [
|
|
823
824
|
{
|
|
824
825
|
role: "user",
|
|
825
826
|
content: {
|
|
826
827
|
type: "text",
|
|
827
|
-
text:
|
|
828
|
+
text: Sr(e)
|
|
828
829
|
}
|
|
829
830
|
}
|
|
830
831
|
]
|
|
@@ -834,8 +835,8 @@ const be = {
|
|
|
834
835
|
name: "productivity-analysis",
|
|
835
836
|
title: "Productivity Analysis",
|
|
836
837
|
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.",
|
|
837
|
-
argsSchema:
|
|
838
|
-
callback:
|
|
838
|
+
argsSchema: vr,
|
|
839
|
+
callback: Cr
|
|
839
840
|
}, I = {
|
|
840
841
|
/** Default limit for task listings */
|
|
841
842
|
TASKS_DEFAULT: 10,
|
|
@@ -913,20 +914,20 @@ function Ht(e) {
|
|
|
913
914
|
throw new P(e, "Duration cannot exceed 24 hours (1440 minutes)");
|
|
914
915
|
return { minutes: o };
|
|
915
916
|
}
|
|
916
|
-
function
|
|
917
|
+
function $r(e) {
|
|
917
918
|
if (e <= 0) return "0m";
|
|
918
919
|
const t = Math.floor(e / 60), r = e % 60;
|
|
919
920
|
return t === 0 ? `${r}m` : r === 0 ? `${t}h` : `${t}h${r}m`;
|
|
920
921
|
}
|
|
921
|
-
const
|
|
922
|
+
const Dr = ["p1", "p2", "p3", "p4"], Ve = 'Task priority as a string: "p1" (highest), "p2" (high), "p3" (medium), or "p4" (lowest/default). Integers like 1, 2, 3, or 4 are not accepted.', Je = s.enum(Dr).describe(Ve);
|
|
922
923
|
function Wt(e) {
|
|
923
924
|
return { p1: 4, p2: 3, p3: 2, p4: 1 }[e];
|
|
924
925
|
}
|
|
925
|
-
function
|
|
926
|
+
function Ar(e) {
|
|
926
927
|
return { 4: "p1", 3: "p2", 2: "p3", 1: "p4" }[e];
|
|
927
928
|
}
|
|
928
|
-
const E = /* @__PURE__ */ new Map(), oe = /* @__PURE__ */ new Map(), Ee = 300 * 1e3,
|
|
929
|
-
class
|
|
929
|
+
const E = /* @__PURE__ */ new Map(), oe = /* @__PURE__ */ new Map(), Ee = 300 * 1e3, xr = "me";
|
|
930
|
+
class Er {
|
|
930
931
|
/**
|
|
931
932
|
* Resolve a user name or ID to a user ID by looking up collaborators across all shared projects.
|
|
932
933
|
* Supports exact name matches, partial matches, email matches, and the "me" keyword.
|
|
@@ -937,7 +938,7 @@ class xr {
|
|
|
937
938
|
const o = r.trim(), n = E.get(o);
|
|
938
939
|
if (n && Date.now() - n.timestamp < Ee)
|
|
939
940
|
return n.result;
|
|
940
|
-
if (o.toLowerCase() ===
|
|
941
|
+
if (o.toLowerCase() === xr)
|
|
941
942
|
try {
|
|
942
943
|
const a = await t.getUser();
|
|
943
944
|
return {
|
|
@@ -1061,15 +1062,15 @@ class xr {
|
|
|
1061
1062
|
E.clear(), oe.clear();
|
|
1062
1063
|
}
|
|
1063
1064
|
}
|
|
1064
|
-
const H = new
|
|
1065
|
-
async function
|
|
1065
|
+
const H = new Er();
|
|
1066
|
+
async function Or(e, t) {
|
|
1066
1067
|
return H.resolveUser(e, t);
|
|
1067
1068
|
}
|
|
1068
1069
|
const Bt = ["assigned", "unassignedOrMe", "all"];
|
|
1069
1070
|
async function Xe(e, t) {
|
|
1070
1071
|
if (!t)
|
|
1071
1072
|
return;
|
|
1072
|
-
const r = await
|
|
1073
|
+
const r = await Or(e, t);
|
|
1073
1074
|
if (!r)
|
|
1074
1075
|
throw new Error(
|
|
1075
1076
|
`Could not find user: "${t}". Make sure the user is a collaborator on a shared project.`
|
|
@@ -1079,14 +1080,14 @@ async function Xe(e, t) {
|
|
|
1079
1080
|
function ce(e, t) {
|
|
1080
1081
|
return t.length === 0 ? e : e.length === 0 ? t : `${e} & ${t}`;
|
|
1081
1082
|
}
|
|
1082
|
-
function
|
|
1083
|
+
function Yt({
|
|
1083
1084
|
resolvedAssigneeId: e,
|
|
1084
1085
|
assigneeEmail: t,
|
|
1085
1086
|
responsibleUserFiltering: r = "unassignedOrMe"
|
|
1086
1087
|
}) {
|
|
1087
1088
|
return e && t ? `assigned to: ${t}` : r === "unassignedOrMe" ? "!assigned to: others" : r === "assigned" ? "assigned to: others" : "";
|
|
1088
1089
|
}
|
|
1089
|
-
function
|
|
1090
|
+
function Pr({
|
|
1090
1091
|
tasks: e,
|
|
1091
1092
|
resolvedAssigneeId: t,
|
|
1092
1093
|
currentUserId: r,
|
|
@@ -1122,28 +1123,28 @@ async function L(e) {
|
|
|
1122
1123
|
function Ze(e) {
|
|
1123
1124
|
return /(?<!\\)(?:\\\\)*\*/.test(e) ? e : `*${e.replaceAll(/\\(?!\*)/g, "\\\\")}*`;
|
|
1124
1125
|
}
|
|
1125
|
-
async function
|
|
1126
|
+
async function qt(e, t) {
|
|
1126
1127
|
return L({
|
|
1127
1128
|
apiMethod: e.searchProjects.bind(e),
|
|
1128
1129
|
args: { query: Ze(t) },
|
|
1129
1130
|
limit: I.PROJECTS_MAX
|
|
1130
1131
|
});
|
|
1131
1132
|
}
|
|
1132
|
-
async function
|
|
1133
|
+
async function zt(e) {
|
|
1133
1134
|
return L({
|
|
1134
1135
|
apiMethod: e.getProjects.bind(e),
|
|
1135
1136
|
args: {},
|
|
1136
1137
|
limit: I.PROJECTS_MAX
|
|
1137
1138
|
});
|
|
1138
1139
|
}
|
|
1139
|
-
async function
|
|
1140
|
+
async function Rr(e) {
|
|
1140
1141
|
return L({
|
|
1141
1142
|
apiMethod: e.getArchivedProjects.bind(e),
|
|
1142
1143
|
args: {},
|
|
1143
1144
|
limit: I.PROJECTS_MAX
|
|
1144
1145
|
});
|
|
1145
1146
|
}
|
|
1146
|
-
function
|
|
1147
|
+
function _r(e) {
|
|
1147
1148
|
const t = (a) => a.replaceAll(/[.*+?^${}()|[\]\\]/g, "\\$&"), r = /(?<!\\)(?:\\\\)*\*/.test(e), o = [...e];
|
|
1148
1149
|
let n = "";
|
|
1149
1150
|
for (let a = 0; a < o.length; a++) {
|
|
@@ -1152,21 +1153,21 @@ function Rr(e) {
|
|
|
1152
1153
|
}
|
|
1153
1154
|
return new RegExp(r ? `^${n}$` : n, "iu");
|
|
1154
1155
|
}
|
|
1155
|
-
async function
|
|
1156
|
+
async function Ur(e, t) {
|
|
1156
1157
|
return L({
|
|
1157
1158
|
apiMethod: e.searchLabels.bind(e),
|
|
1158
1159
|
args: { query: Ze(t) },
|
|
1159
1160
|
limit: I.LABELS_MAX
|
|
1160
1161
|
});
|
|
1161
1162
|
}
|
|
1162
|
-
async function
|
|
1163
|
+
async function Nr(e) {
|
|
1163
1164
|
return L({
|
|
1164
1165
|
apiMethod: e.getSharedLabels.bind(e),
|
|
1165
1166
|
args: {},
|
|
1166
1167
|
limit: I.LABELS_MAX
|
|
1167
1168
|
});
|
|
1168
1169
|
}
|
|
1169
|
-
async function
|
|
1170
|
+
async function Lr(e, t, r) {
|
|
1170
1171
|
const o = Ze(t);
|
|
1171
1172
|
return L({
|
|
1172
1173
|
apiMethod: e.searchSections.bind(e),
|
|
@@ -1174,7 +1175,7 @@ async function Nr(e, t, r) {
|
|
|
1174
1175
|
limit: I.SECTIONS_MAX
|
|
1175
1176
|
});
|
|
1176
1177
|
}
|
|
1177
|
-
function
|
|
1178
|
+
function Mr(e, t, r, o) {
|
|
1178
1179
|
const n = [t, r, o].filter(Boolean);
|
|
1179
1180
|
if (n.length > 1)
|
|
1180
1181
|
throw new Error(
|
|
@@ -1197,12 +1198,12 @@ function U(e) {
|
|
|
1197
1198
|
dueDate: e.due?.date,
|
|
1198
1199
|
recurring: e.due?.isRecurring && e.due.string ? e.due.string : !1,
|
|
1199
1200
|
deadlineDate: e.deadline?.date,
|
|
1200
|
-
priority:
|
|
1201
|
+
priority: Ar(e.priority) ?? "p4",
|
|
1201
1202
|
projectId: e.projectId,
|
|
1202
1203
|
sectionId: e.sectionId ?? void 0,
|
|
1203
1204
|
parentId: e.parentId ?? void 0,
|
|
1204
1205
|
labels: e.labels,
|
|
1205
|
-
duration: e.duration ?
|
|
1206
|
+
duration: e.duration ? $r(e.duration.amount) : void 0,
|
|
1206
1207
|
responsibleUid: e.responsibleUid ?? void 0,
|
|
1207
1208
|
assignedByUid: e.assignedByUid ?? void 0,
|
|
1208
1209
|
checked: e.checked,
|
|
@@ -1251,7 +1252,7 @@ function ve(e) {
|
|
|
1251
1252
|
} : void 0
|
|
1252
1253
|
};
|
|
1253
1254
|
}
|
|
1254
|
-
function
|
|
1255
|
+
function Fr(e) {
|
|
1255
1256
|
return {
|
|
1256
1257
|
id: e.id ?? void 0,
|
|
1257
1258
|
objectType: e.objectType,
|
|
@@ -1264,7 +1265,7 @@ function Mr(e) {
|
|
|
1264
1265
|
extraData: e.extraData ?? void 0
|
|
1265
1266
|
};
|
|
1266
1267
|
}
|
|
1267
|
-
const
|
|
1268
|
+
const Hr = se.object({
|
|
1268
1269
|
httpStatusCode: se.number(),
|
|
1269
1270
|
responseData: se.object({
|
|
1270
1271
|
error: se.string(),
|
|
@@ -1282,7 +1283,7 @@ async function Qe({
|
|
|
1282
1283
|
const { results: n, nextCursor: a } = await e.getTasksByFilter({ query: t, cursor: o, limit: r });
|
|
1283
1284
|
return { tasks: n.map(U), nextCursor: a };
|
|
1284
1285
|
} catch (n) {
|
|
1285
|
-
const a =
|
|
1286
|
+
const a = Hr.safeParse(n);
|
|
1286
1287
|
if (!a.success)
|
|
1287
1288
|
throw n;
|
|
1288
1289
|
const { responseData: i } = a.data;
|
|
@@ -1338,12 +1339,12 @@ function Gt(e) {
|
|
|
1338
1339
|
return { timeBasedCount: t, locationCount: r };
|
|
1339
1340
|
}
|
|
1340
1341
|
const Ie = Ue.map((e) => e.key);
|
|
1341
|
-
function
|
|
1342
|
+
function Wr(e) {
|
|
1342
1343
|
if (typeof e != "string") return;
|
|
1343
1344
|
const t = e.toLowerCase();
|
|
1344
1345
|
return (Ue.find((o) => o.key === t) ?? Ue.find((o) => o.displayName.toLowerCase() === t))?.key;
|
|
1345
1346
|
}
|
|
1346
|
-
const
|
|
1347
|
+
const Br = `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.`, pe = s.preprocess(Wr, s.enum(Ie).optional()).describe(Br);
|
|
1347
1348
|
s.enum(Ie).describe("The color key of the entity.");
|
|
1348
1349
|
const he = s.enum(Ie).optional().catch(void 0).describe("The color key of the entity."), B = s.object({
|
|
1349
1350
|
id: s.string().describe("The unique ID of the task."),
|
|
@@ -1391,7 +1392,7 @@ const he = s.enum(Ie).optional().catch(void 0).describe("The color key of the en
|
|
|
1391
1392
|
function Z({ id: e, name: t, sectionOrder: r, description: o }) {
|
|
1392
1393
|
return { id: e, name: t, sectionOrder: r, description: o ?? void 0 };
|
|
1393
1394
|
}
|
|
1394
|
-
const
|
|
1395
|
+
const Yr = s.object({
|
|
1395
1396
|
resourceType: s.string().describe("The type of resource (file, url, image, etc)."),
|
|
1396
1397
|
fileName: s.string().optional().describe("The name of the file."),
|
|
1397
1398
|
fileSize: s.number().optional().describe("The size of the file in bytes."),
|
|
@@ -1411,7 +1412,7 @@ const Br = s.object({
|
|
|
1411
1412
|
content: s.string().describe("The content of the comment."),
|
|
1412
1413
|
postedAt: s.string().describe("When the comment was posted (ISO 8601 format)."),
|
|
1413
1414
|
postedUid: s.string().optional().describe("The UID of the user who posted this comment."),
|
|
1414
|
-
fileAttachment:
|
|
1415
|
+
fileAttachment: Yr.optional().describe("File attachment information, if any.")
|
|
1415
1416
|
}), qr = s.object({
|
|
1416
1417
|
id: s.string().optional().describe("The unique ID of the activity event."),
|
|
1417
1418
|
objectType: s.string().describe("The type of object this event relates to (task, project, etc)."),
|
|
@@ -1432,7 +1433,7 @@ const Br = s.object({
|
|
|
1432
1433
|
color: he,
|
|
1433
1434
|
order: s.number().optional().catch(void 0).describe("The display order of the label."),
|
|
1434
1435
|
isFavorite: s.boolean().describe("Whether the label is marked as favorite.")
|
|
1435
|
-
}),
|
|
1436
|
+
}), Gr = s.object({
|
|
1436
1437
|
isRecurring: s.boolean().describe("Whether this is a recurring reminder."),
|
|
1437
1438
|
string: s.string().describe("Human-readable due string."),
|
|
1438
1439
|
date: s.string().describe("Due date in ISO format."),
|
|
@@ -1443,7 +1444,7 @@ const Br = s.object({
|
|
|
1443
1444
|
taskId: s.string().describe("The task ID this reminder belongs to."),
|
|
1444
1445
|
type: s.enum(Is).describe("The type of reminder: relative, absolute, or location."),
|
|
1445
1446
|
minuteOffset: s.number().optional().describe("Minutes before due time to trigger (relative reminders only)."),
|
|
1446
|
-
due:
|
|
1447
|
+
due: Gr.optional().describe(
|
|
1447
1448
|
"Due date info (absolute and sometimes relative reminders)."
|
|
1448
1449
|
),
|
|
1449
1450
|
name: s.string().optional().describe("Location name (location reminders only)."),
|
|
@@ -1456,23 +1457,23 @@ const Br = s.object({
|
|
|
1456
1457
|
item: s.string().describe("The item that failed (usually an ID or identifier)."),
|
|
1457
1458
|
error: s.string().describe("The error message."),
|
|
1458
1459
|
code: s.string().optional().describe("The error code, if available.")
|
|
1459
|
-
}),
|
|
1460
|
+
}), Kr = s.object({
|
|
1460
1461
|
taskId: s.string().optional().describe("The ID of the task to comment on."),
|
|
1461
1462
|
projectId: s.string().optional().describe(
|
|
1462
1463
|
'The ID of the project to comment on. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
1463
1464
|
),
|
|
1464
1465
|
content: s.string().min(1).describe("The content of the comment.")
|
|
1465
|
-
}),
|
|
1466
|
-
comments: s.array(
|
|
1467
|
-
},
|
|
1466
|
+
}), Vr = {
|
|
1467
|
+
comments: s.array(Kr).min(1).describe("The array of comments to add.")
|
|
1468
|
+
}, Jr = {
|
|
1468
1469
|
comments: s.array(je).describe("The created comments."),
|
|
1469
1470
|
totalCount: s.number().describe("The total number of comments created."),
|
|
1470
1471
|
addedCommentIds: s.array(s.string()).describe("The IDs of the added comments.")
|
|
1471
|
-
},
|
|
1472
|
+
}, Xr = {
|
|
1472
1473
|
name: b.ADD_COMMENTS,
|
|
1473
1474
|
description: "Add multiple comments to tasks or projects. Each comment must specify either taskId or projectId.",
|
|
1474
|
-
parameters:
|
|
1475
|
-
outputSchema:
|
|
1475
|
+
parameters: Vr,
|
|
1476
|
+
outputSchema: Jr,
|
|
1476
1477
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1477
1478
|
async execute(e, t) {
|
|
1478
1479
|
const { comments: r } = e;
|
|
@@ -1498,7 +1499,7 @@ const Br = s.object({
|
|
|
1498
1499
|
});
|
|
1499
1500
|
}), c = (await Promise.all(a)).map(ve);
|
|
1500
1501
|
return {
|
|
1501
|
-
textContent:
|
|
1502
|
+
textContent: Zr({ comments: c }),
|
|
1502
1503
|
structuredContent: {
|
|
1503
1504
|
comments: c,
|
|
1504
1505
|
totalCount: c.length,
|
|
@@ -1507,7 +1508,7 @@ const Br = s.object({
|
|
|
1507
1508
|
};
|
|
1508
1509
|
}
|
|
1509
1510
|
};
|
|
1510
|
-
function
|
|
1511
|
+
function Zr({ comments: e }) {
|
|
1511
1512
|
const t = e.filter((a) => a.taskId).length, r = e.filter((a) => a.projectId).length, o = [];
|
|
1512
1513
|
if (t > 0) {
|
|
1513
1514
|
const a = t > 1 ? "comments" : "comment";
|
|
@@ -1519,7 +1520,7 @@ function Xr({ comments: e }) {
|
|
|
1519
1520
|
}
|
|
1520
1521
|
return o.length > 0 ? `Added ${o.join(" and ")}` : "No comments added";
|
|
1521
1522
|
}
|
|
1522
|
-
const
|
|
1523
|
+
const Qr = {
|
|
1523
1524
|
search: s.string().optional().describe(
|
|
1524
1525
|
"Search for a filter by name (partial and case insensitive match). If omitted, all filters are returned."
|
|
1525
1526
|
)
|
|
@@ -1530,14 +1531,14 @@ const Zr = {
|
|
|
1530
1531
|
color: he,
|
|
1531
1532
|
isFavorite: s.boolean().describe("Whether the filter is marked as favorite."),
|
|
1532
1533
|
itemOrder: s.number().describe("The display order of the filter.")
|
|
1533
|
-
}),
|
|
1534
|
+
}), eo = {
|
|
1534
1535
|
filters: s.array(tt).describe("The found filters."),
|
|
1535
1536
|
totalCount: s.number().describe("The total number of filters returned.")
|
|
1536
|
-
},
|
|
1537
|
+
}, to = {
|
|
1537
1538
|
name: b.FIND_FILTERS,
|
|
1538
1539
|
description: 'List all personal filters or search for filters by name. Filters are saved custom views that use query syntax to organize tasks (e.g. "today & p1", "#Work & overdue").',
|
|
1539
|
-
parameters:
|
|
1540
|
-
outputSchema:
|
|
1540
|
+
parameters: Qr,
|
|
1541
|
+
outputSchema: eo,
|
|
1541
1542
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
1542
1543
|
async execute(e, t) {
|
|
1543
1544
|
let o = ((await t.sync({ resourceTypes: ["filters"], syncToken: "*" })).filters ?? []).filter((i) => !i.isDeleted);
|
|
@@ -1555,7 +1556,7 @@ const Zr = {
|
|
|
1555
1556
|
itemOrder: i.itemOrder
|
|
1556
1557
|
}));
|
|
1557
1558
|
return {
|
|
1558
|
-
textContent:
|
|
1559
|
+
textContent: so({ filters: n, search: e.search }),
|
|
1559
1560
|
structuredContent: {
|
|
1560
1561
|
filters: n,
|
|
1561
1562
|
totalCount: n.length
|
|
@@ -1563,7 +1564,7 @@ const Zr = {
|
|
|
1563
1564
|
};
|
|
1564
1565
|
}
|
|
1565
1566
|
};
|
|
1566
|
-
function
|
|
1567
|
+
function so({
|
|
1567
1568
|
filters: e,
|
|
1568
1569
|
search: t
|
|
1569
1570
|
}) {
|
|
@@ -1584,23 +1585,23 @@ ${n.map((a) => `- ${a}`).join(`
|
|
|
1584
1585
|
return o.join(`
|
|
1585
1586
|
`);
|
|
1586
1587
|
}
|
|
1587
|
-
const
|
|
1588
|
+
const ro = s.object({
|
|
1588
1589
|
name: s.string().min(1).describe("The name of the filter."),
|
|
1589
1590
|
query: s.string().min(1).describe(
|
|
1590
1591
|
'The filter query string. Examples: "today & p1", "#Work & overdue", "@email & today", "(p1 | p2) & !assigned". Operators: | (OR), & (AND), ! (NOT), () grouping, , (multiple queries).'
|
|
1591
1592
|
),
|
|
1592
1593
|
color: pe,
|
|
1593
1594
|
isFavorite: s.boolean().optional().describe("Whether to mark the filter as a favorite. Defaults to false.")
|
|
1594
|
-
}),
|
|
1595
|
-
filters: s.array(
|
|
1596
|
-
},
|
|
1595
|
+
}), oo = {
|
|
1596
|
+
filters: s.array(ro).min(1).describe("The array of filters to add.")
|
|
1597
|
+
}, no = {
|
|
1597
1598
|
filters: s.array(tt).describe("The created filters."),
|
|
1598
1599
|
totalCount: s.number().describe("The total number of filters created.")
|
|
1599
|
-
},
|
|
1600
|
+
}, ao = {
|
|
1600
1601
|
name: b.ADD_FILTERS,
|
|
1601
1602
|
description: "Add one or more new personal filters. Filters are saved custom views using query syntax to organize tasks.",
|
|
1602
|
-
parameters:
|
|
1603
|
-
outputSchema:
|
|
1603
|
+
parameters: oo,
|
|
1604
|
+
outputSchema: no,
|
|
1604
1605
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1605
1606
|
async execute({ filters: e }, t) {
|
|
1606
1607
|
const r = Date.now(), o = e.map((p, h) => `tempFilterAdd${h}${r}`), n = e.map((p, h) => G(
|
|
@@ -1635,26 +1636,26 @@ ${d}`,
|
|
|
1635
1636
|
}
|
|
1636
1637
|
};
|
|
1637
1638
|
}
|
|
1638
|
-
},
|
|
1639
|
+
}, io = s.object({
|
|
1639
1640
|
name: s.string().min(1).max(128).describe("The name of the label."),
|
|
1640
1641
|
color: pe,
|
|
1641
1642
|
order: s.number().int().optional().describe("The position of the label in the label list."),
|
|
1642
1643
|
isFavorite: s.boolean().optional().describe("Whether the label is a favorite. Defaults to false.")
|
|
1643
|
-
}),
|
|
1644
|
-
labels: s.array(
|
|
1645
|
-
},
|
|
1644
|
+
}), co = {
|
|
1645
|
+
labels: s.array(io).min(1).describe("The array of labels to add.")
|
|
1646
|
+
}, lo = {
|
|
1646
1647
|
labels: s.array(me).describe("The created labels."),
|
|
1647
1648
|
totalCount: s.number().describe("The total number of labels created.")
|
|
1648
|
-
},
|
|
1649
|
+
}, uo = {
|
|
1649
1650
|
name: b.ADD_LABELS,
|
|
1650
1651
|
description: "Add one or more new personal labels.",
|
|
1651
|
-
parameters:
|
|
1652
|
-
outputSchema:
|
|
1652
|
+
parameters: co,
|
|
1653
|
+
outputSchema: lo,
|
|
1653
1654
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1654
1655
|
async execute({ labels: e }, t) {
|
|
1655
1656
|
const r = await Promise.all(e.map((n) => t.addLabel(n)));
|
|
1656
1657
|
return {
|
|
1657
|
-
textContent:
|
|
1658
|
+
textContent: po({ labels: r }),
|
|
1658
1659
|
structuredContent: {
|
|
1659
1660
|
labels: r.map((n) => me.parse(n)),
|
|
1660
1661
|
totalCount: r.length
|
|
@@ -1662,7 +1663,7 @@ ${d}`,
|
|
|
1662
1663
|
};
|
|
1663
1664
|
}
|
|
1664
1665
|
};
|
|
1665
|
-
function
|
|
1666
|
+
function po({ labels: e }) {
|
|
1666
1667
|
const t = e.length, r = e.map((o) => `• ${o.name} (id=${o.id})`).join(`
|
|
1667
1668
|
`);
|
|
1668
1669
|
return `Added ${t} label${t === 1 ? "" : "s"}:
|
|
@@ -1712,20 +1713,20 @@ function ot(e, t) {
|
|
|
1712
1713
|
Failed (${t.length}) - address or drop these items:
|
|
1713
1714
|
${n}${a}`;
|
|
1714
1715
|
}
|
|
1715
|
-
function
|
|
1716
|
+
function ho(e) {
|
|
1716
1717
|
const t = e.content || e.title || "Untitled", r = e.dueDate ? ` • due ${e.dueDate}` : "", o = e.priority ? ` • ${e.priority.toUpperCase()}` : "", n = e.projectName ? ` • ${e.projectName}` : "", a = e.id ? ` • id=${e.id}` : "";
|
|
1717
1718
|
return ` ${t}${r}${o}${n}${a}`;
|
|
1718
1719
|
}
|
|
1719
|
-
function
|
|
1720
|
+
function mo(e) {
|
|
1720
1721
|
const t = ` (${e.color})`, r = e.isFavorite ? " • ⭐" : "", o = ` • id=${e.id}`;
|
|
1721
1722
|
return ` ${e.name}${t}${r}${o}`;
|
|
1722
1723
|
}
|
|
1723
|
-
function
|
|
1724
|
+
function fo(e) {
|
|
1724
1725
|
const t = e.inboxProject ? " • Inbox" : "", r = e.isFavorite ? " • ⭐" : "", o = e.isShared ? " • Shared" : "", n = e.isArchived ? " • Archived" : "", a = e.viewStyle && e.viewStyle !== "list" ? ` • ${e.viewStyle}` : "", i = ` • id=${e.id}`;
|
|
1725
1726
|
return ` ${e.name}${t}${r}${o}${n}${a}${i}`;
|
|
1726
1727
|
}
|
|
1727
1728
|
function Se(e, t = 5) {
|
|
1728
|
-
const o = e.slice(0, t).map(
|
|
1729
|
+
const o = e.slice(0, t).map(ho).join(`
|
|
1729
1730
|
`);
|
|
1730
1731
|
if (e.length > t) {
|
|
1731
1732
|
const n = e.length - t;
|
|
@@ -1734,7 +1735,7 @@ function Se(e, t = 5) {
|
|
|
1734
1735
|
}
|
|
1735
1736
|
return o;
|
|
1736
1737
|
}
|
|
1737
|
-
function
|
|
1738
|
+
function Y({
|
|
1738
1739
|
subject: e,
|
|
1739
1740
|
count: t,
|
|
1740
1741
|
limit: r,
|
|
@@ -1755,16 +1756,16 @@ function Kt(e, t) {
|
|
|
1755
1756
|
${r.map((n) => `- ${n}`).join(`
|
|
1756
1757
|
`)}`;
|
|
1757
1758
|
}
|
|
1758
|
-
const
|
|
1759
|
-
function
|
|
1759
|
+
const bo = 300 * 1e3;
|
|
1760
|
+
function go(e) {
|
|
1760
1761
|
return /^\d+$/.test(e);
|
|
1761
1762
|
}
|
|
1762
|
-
class
|
|
1763
|
+
class yo {
|
|
1763
1764
|
constructor() {
|
|
1764
1765
|
this.cache = null, this.inFlightWorkspaces = null;
|
|
1765
1766
|
}
|
|
1766
1767
|
async getWorkspaces(t) {
|
|
1767
|
-
if (this.cache && Date.now() - this.cache.timestamp <
|
|
1768
|
+
if (this.cache && Date.now() - this.cache.timestamp < bo)
|
|
1768
1769
|
return this.cache.workspaces;
|
|
1769
1770
|
if (this.inFlightWorkspaces)
|
|
1770
1771
|
return this.inFlightWorkspaces;
|
|
@@ -1791,7 +1792,7 @@ class go {
|
|
|
1791
1792
|
const n = await this.getWorkspaces(t), a = n.find((u) => u.id === o);
|
|
1792
1793
|
if (a)
|
|
1793
1794
|
return { workspaceId: a.id, workspaceName: a.name };
|
|
1794
|
-
if (
|
|
1795
|
+
if (go(o))
|
|
1795
1796
|
return { workspaceId: o, workspaceName: o };
|
|
1796
1797
|
const i = o.toLowerCase(), c = n.find((u) => u.name.toLowerCase() === i);
|
|
1797
1798
|
if (c)
|
|
@@ -1819,7 +1820,7 @@ ${u}` + (l.length > 5 ? `
|
|
|
1819
1820
|
this.cache = null;
|
|
1820
1821
|
}
|
|
1821
1822
|
}
|
|
1822
|
-
const Vt = new
|
|
1823
|
+
const Vt = new yo(), ko = s.object({
|
|
1823
1824
|
name: s.string().min(1).describe("The name of the project."),
|
|
1824
1825
|
parentId: s.string().optional().describe("The ID of the parent project. If provided, creates this as a sub-project."),
|
|
1825
1826
|
isFavorite: s.boolean().optional().describe("Whether the project is a favorite. Defaults to false."),
|
|
@@ -1829,9 +1830,9 @@ const Vt = new go(), yo = s.object({
|
|
|
1829
1830
|
workspace: s.string().trim().min(1).optional().describe(
|
|
1830
1831
|
"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."
|
|
1831
1832
|
)
|
|
1832
|
-
}),
|
|
1833
|
-
projects: s.array(
|
|
1834
|
-
},
|
|
1833
|
+
}), To = {
|
|
1834
|
+
projects: s.array(ko).min(1).describe("The array of projects to add.")
|
|
1835
|
+
}, wo = {
|
|
1835
1836
|
projects: s.array(X).describe("The created projects."),
|
|
1836
1837
|
totalCount: s.number().describe("The total number of projects created."),
|
|
1837
1838
|
failures: s.array(Q).describe(
|
|
@@ -1840,11 +1841,11 @@ const Vt = new go(), yo = s.object({
|
|
|
1840
1841
|
totalRequested: s.number().describe("The total number of projects requested."),
|
|
1841
1842
|
successCount: s.number().describe("The number of successfully created projects."),
|
|
1842
1843
|
failureCount: s.number().describe("The number of failed project creations.")
|
|
1843
|
-
},
|
|
1844
|
+
}, vo = {
|
|
1844
1845
|
name: b.ADD_PROJECTS,
|
|
1845
1846
|
description: "Add one or more new projects.",
|
|
1846
|
-
parameters:
|
|
1847
|
-
outputSchema:
|
|
1847
|
+
parameters: To,
|
|
1848
|
+
outputSchema: wo,
|
|
1848
1849
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1849
1850
|
async execute({ projects: e }, t) {
|
|
1850
1851
|
const r = /* @__PURE__ */ new Map(), o = (d) => {
|
|
@@ -1870,7 +1871,7 @@ const Vt = new go(), yo = s.object({
|
|
|
1870
1871
|
});
|
|
1871
1872
|
const c = a.map(J);
|
|
1872
1873
|
return {
|
|
1873
|
-
textContent:
|
|
1874
|
+
textContent: Io({ projects: a, failures: i }),
|
|
1874
1875
|
structuredContent: {
|
|
1875
1876
|
projects: c,
|
|
1876
1877
|
totalCount: c.length,
|
|
@@ -1882,7 +1883,7 @@ const Vt = new go(), yo = s.object({
|
|
|
1882
1883
|
};
|
|
1883
1884
|
}
|
|
1884
1885
|
};
|
|
1885
|
-
function
|
|
1886
|
+
function Io({
|
|
1886
1887
|
projects: e,
|
|
1887
1888
|
failures: t
|
|
1888
1889
|
}) {
|
|
@@ -1896,7 +1897,7 @@ const we = 25, Ce = s.enum(js), Jt = s.object({
|
|
|
1896
1897
|
string: s.string().optional().describe('Natural language due string, e.g. "tomorrow at 3pm".'),
|
|
1897
1898
|
timezone: s.string().optional().describe('Timezone for the reminder, e.g. "America/New_York".'),
|
|
1898
1899
|
lang: s.string().optional().describe('Language for parsing the due string, e.g. "en".')
|
|
1899
|
-
}), Xt = s.enum(Et), $e = s.boolean().optional().describe("Whether this is an urgent reminder. Applies to relative and absolute reminders."),
|
|
1900
|
+
}), Xt = s.enum(Et), $e = s.boolean().optional().describe("Whether this is an urgent reminder. Applies to relative and absolute reminders."), jo = s.object({
|
|
1900
1901
|
type: s.literal("relative"),
|
|
1901
1902
|
taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
|
|
1902
1903
|
minuteOffset: s.number().int().min(0).describe(
|
|
@@ -1906,7 +1907,7 @@ const we = 25, Ce = s.enum(js), Jt = s.object({
|
|
|
1906
1907
|
'Delivery method: "email" or "push" notification. Defaults to push.'
|
|
1907
1908
|
),
|
|
1908
1909
|
isUrgent: $e
|
|
1909
|
-
}),
|
|
1910
|
+
}), So = s.object({
|
|
1910
1911
|
type: s.literal("absolute"),
|
|
1911
1912
|
taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
|
|
1912
1913
|
due: Jt.describe("The specific date/time for the reminder."),
|
|
@@ -1914,7 +1915,7 @@ const we = 25, Ce = s.enum(js), Jt = s.object({
|
|
|
1914
1915
|
'Delivery method: "email" or "push" notification. Defaults to push.'
|
|
1915
1916
|
),
|
|
1916
1917
|
isUrgent: $e
|
|
1917
|
-
}),
|
|
1918
|
+
}), Co = s.object({
|
|
1918
1919
|
type: s.literal("location"),
|
|
1919
1920
|
taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
|
|
1920
1921
|
name: s.string().min(1).describe('Name of the location, e.g. "Office", "Home".'),
|
|
@@ -1924,23 +1925,23 @@ const we = 25, Ce = s.enum(js), Jt = s.object({
|
|
|
1924
1925
|
'When to trigger: "on_enter" (arriving) or "on_leave" (departing).'
|
|
1925
1926
|
),
|
|
1926
1927
|
radius: s.number().int().optional().describe("Radius in meters for the geofence. Defaults to server default.")
|
|
1927
|
-
}),
|
|
1928
|
-
Io,
|
|
1928
|
+
}), $o = s.discriminatedUnion("type", [
|
|
1929
1929
|
jo,
|
|
1930
|
-
So
|
|
1931
|
-
|
|
1932
|
-
|
|
1930
|
+
So,
|
|
1931
|
+
Co
|
|
1932
|
+
]), Do = {
|
|
1933
|
+
reminders: s.array($o).min(1).max(we).describe(
|
|
1933
1934
|
`Array of reminders to create (max ${we}). Each reminder must specify a type: "relative" (minutes before due), "absolute" (specific date/time), or "location" (geofence trigger).`
|
|
1934
1935
|
)
|
|
1935
|
-
},
|
|
1936
|
+
}, Ao = {
|
|
1936
1937
|
reminders: s.array(et).describe("The created reminders."),
|
|
1937
1938
|
totalCount: s.number().describe("Total number of reminders created."),
|
|
1938
1939
|
addedReminderIds: s.array(s.string()).describe("IDs of the created reminders.")
|
|
1939
|
-
},
|
|
1940
|
+
}, xo = {
|
|
1940
1941
|
name: b.ADD_REMINDERS,
|
|
1941
1942
|
description: 'Add reminders to tasks. Supports three types: "relative" (minutes before due), "absolute" (specific date/time), or "location" (geofence-triggered). Each reminder must specify a taskId.',
|
|
1942
|
-
parameters:
|
|
1943
|
-
outputSchema:
|
|
1943
|
+
parameters: Do,
|
|
1944
|
+
outputSchema: Ao,
|
|
1944
1945
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1945
1946
|
async execute(e, t) {
|
|
1946
1947
|
const { reminders: r } = e, o = r.map(async (c) => {
|
|
@@ -1973,7 +1974,7 @@ const we = 25, Ce = s.enum(js), Jt = s.object({
|
|
|
1973
1974
|
}
|
|
1974
1975
|
}), a = (await Promise.all(o)).map(ye);
|
|
1975
1976
|
return {
|
|
1976
|
-
textContent:
|
|
1977
|
+
textContent: Eo(a),
|
|
1977
1978
|
structuredContent: {
|
|
1978
1979
|
reminders: a,
|
|
1979
1980
|
totalCount: a.length,
|
|
@@ -1982,7 +1983,7 @@ const we = 25, Ce = s.enum(js), Jt = s.object({
|
|
|
1982
1983
|
};
|
|
1983
1984
|
}
|
|
1984
1985
|
};
|
|
1985
|
-
function
|
|
1986
|
+
function Eo(e) {
|
|
1986
1987
|
const { timeBasedCount: t, locationCount: r } = Gt(e), o = [];
|
|
1987
1988
|
if (t > 0) {
|
|
1988
1989
|
const n = t > 1 ? "reminders" : "reminder";
|
|
@@ -1994,15 +1995,15 @@ function xo(e) {
|
|
|
1994
1995
|
}
|
|
1995
1996
|
return o.length > 0 ? `Added ${o.join(" and ")}` : "No reminders added";
|
|
1996
1997
|
}
|
|
1997
|
-
const
|
|
1998
|
+
const Oo = s.object({
|
|
1998
1999
|
name: s.string().min(1).describe("The name of the section."),
|
|
1999
2000
|
projectId: s.string().min(1).describe(
|
|
2000
2001
|
'The ID of the project to add the section to. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
2001
2002
|
),
|
|
2002
2003
|
description: s.string().optional().describe("The description of the section. Supports Markdown.")
|
|
2003
|
-
}),
|
|
2004
|
-
sections: s.array(
|
|
2005
|
-
},
|
|
2004
|
+
}), Po = {
|
|
2005
|
+
sections: s.array(Oo).min(1).describe("The array of sections to add.")
|
|
2006
|
+
}, Ro = {
|
|
2006
2007
|
sections: s.array(le).describe("The created sections."),
|
|
2007
2008
|
totalCount: s.number().describe("The total number of sections created."),
|
|
2008
2009
|
failures: s.array(Q).describe(
|
|
@@ -2011,11 +2012,11 @@ const Eo = s.object({
|
|
|
2011
2012
|
totalRequested: s.number().describe("The total number of sections requested."),
|
|
2012
2013
|
successCount: s.number().describe("The number of successfully created sections."),
|
|
2013
2014
|
failureCount: s.number().describe("The number of failed section creations.")
|
|
2014
|
-
},
|
|
2015
|
+
}, _o = {
|
|
2015
2016
|
name: b.ADD_SECTIONS,
|
|
2016
2017
|
description: "Add one or more new sections to projects.",
|
|
2017
|
-
parameters:
|
|
2018
|
-
outputSchema:
|
|
2018
|
+
parameters: Po,
|
|
2019
|
+
outputSchema: Ro,
|
|
2019
2020
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
2020
2021
|
async execute({ sections: e }, t) {
|
|
2021
2022
|
const r = e.some((c) => de(c.projectId)) ? _(() => t.getUser()) : void 0, o = await Promise.allSettled(
|
|
@@ -2034,7 +2035,7 @@ const Eo = s.object({
|
|
|
2034
2035
|
error: ue(c.reason)
|
|
2035
2036
|
});
|
|
2036
2037
|
}), {
|
|
2037
|
-
textContent:
|
|
2038
|
+
textContent: Uo({ sections: n, failures: a }),
|
|
2038
2039
|
structuredContent: {
|
|
2039
2040
|
sections: n.map(Z),
|
|
2040
2041
|
totalCount: n.length,
|
|
@@ -2046,7 +2047,7 @@ const Eo = s.object({
|
|
|
2046
2047
|
};
|
|
2047
2048
|
}
|
|
2048
2049
|
};
|
|
2049
|
-
function
|
|
2050
|
+
function Uo({
|
|
2050
2051
|
sections: e,
|
|
2051
2052
|
failures: t
|
|
2052
2053
|
}) {
|
|
@@ -2064,7 +2065,7 @@ const ne = {
|
|
|
2064
2065
|
PROJECT_NOT_FOUND: "PROJECT_NOT_FOUND",
|
|
2065
2066
|
TASK_NOT_FOUND: "TASK_NOT_FOUND"
|
|
2066
2067
|
};
|
|
2067
|
-
class
|
|
2068
|
+
class No {
|
|
2068
2069
|
/**
|
|
2069
2070
|
* Validate a single assignment operation
|
|
2070
2071
|
*/
|
|
@@ -2273,11 +2274,11 @@ class Uo {
|
|
|
2273
2274
|
};
|
|
2274
2275
|
}
|
|
2275
2276
|
}
|
|
2276
|
-
const nt = new
|
|
2277
|
+
const nt = new No();
|
|
2277
2278
|
function F(e) {
|
|
2278
2279
|
return s.string().transform((t) => t === "" ? void 0 : t).optional().describe(e);
|
|
2279
2280
|
}
|
|
2280
|
-
const mt = Ft.TASKS_PER_OPERATION,
|
|
2281
|
+
const mt = Ft.TASKS_PER_OPERATION, Lo = s.object({
|
|
2281
2282
|
content: s.string().min(1).describe(
|
|
2282
2283
|
'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.'
|
|
2283
2284
|
),
|
|
@@ -2306,24 +2307,24 @@ const mt = Ft.TASKS_PER_OPERATION, No = s.object({
|
|
|
2306
2307
|
"Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
|
|
2307
2308
|
)
|
|
2308
2309
|
}), ft = {
|
|
2309
|
-
tasks: s.array(
|
|
2310
|
-
},
|
|
2310
|
+
tasks: s.array(Lo).min(1).max(mt).describe(`The array of tasks to add (max ${mt}).`)
|
|
2311
|
+
}, Mo = {
|
|
2311
2312
|
tasks: s.array(B).describe("The created tasks."),
|
|
2312
2313
|
totalCount: s.number().describe("The total number of tasks created."),
|
|
2313
2314
|
failures: s.array(Q).describe("Failed task creations with error details."),
|
|
2314
2315
|
totalRequested: s.number().describe("The total number of tasks requested."),
|
|
2315
2316
|
successCount: s.number().describe("The number of successfully created tasks."),
|
|
2316
2317
|
failureCount: s.number().describe("The number of failed task creations.")
|
|
2317
|
-
},
|
|
2318
|
+
}, Fo = {
|
|
2318
2319
|
name: b.ADD_TASKS,
|
|
2319
2320
|
description: "Add one or more tasks to a project, section, or parent. Supports assignment to project collaborators.",
|
|
2320
2321
|
parameters: ft,
|
|
2321
|
-
outputSchema:
|
|
2322
|
+
outputSchema: Mo,
|
|
2322
2323
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
2323
2324
|
async execute(e, t) {
|
|
2324
2325
|
const { tasks: r } = s.object(ft).parse(e), o = /* @__PURE__ */ new Map();
|
|
2325
2326
|
r.forEach((p, h) => {
|
|
2326
|
-
const m =
|
|
2327
|
+
const m = Ho(p), f = o.get(m);
|
|
2327
2328
|
f ? f.push({ task: p, index: h }) : o.set(m, [{ task: p, index: h }]);
|
|
2328
2329
|
});
|
|
2329
2330
|
const n = /* @__PURE__ */ new Map(), i = (await Promise.all(
|
|
@@ -2331,7 +2332,7 @@ const mt = Ft.TASKS_PER_OPERATION, No = s.object({
|
|
|
2331
2332
|
const h = [];
|
|
2332
2333
|
for (const { task: m, index: f } of p)
|
|
2333
2334
|
try {
|
|
2334
|
-
const g = await
|
|
2335
|
+
const g = await Wo(m, t, n);
|
|
2335
2336
|
h.push({ index: f, result: { status: "fulfilled", value: g } });
|
|
2336
2337
|
} catch (g) {
|
|
2337
2338
|
h.push({
|
|
@@ -2356,7 +2357,7 @@ const mt = Ft.TASKS_PER_OPERATION, No = s.object({
|
|
|
2356
2357
|
}
|
|
2357
2358
|
const d = c.map(U);
|
|
2358
2359
|
return {
|
|
2359
|
-
textContent:
|
|
2360
|
+
textContent: Bo({
|
|
2360
2361
|
tasks: d,
|
|
2361
2362
|
failures: l,
|
|
2362
2363
|
args: { tasks: r }
|
|
@@ -2372,10 +2373,10 @@ const mt = Ft.TASKS_PER_OPERATION, No = s.object({
|
|
|
2372
2373
|
};
|
|
2373
2374
|
}
|
|
2374
2375
|
};
|
|
2375
|
-
function
|
|
2376
|
+
function Ho(e) {
|
|
2376
2377
|
return `${e.projectId ?? ""}|${e.sectionId ?? ""}|${e.parentId ?? ""}`;
|
|
2377
2378
|
}
|
|
2378
|
-
async function
|
|
2379
|
+
async function Wo(e, t, r) {
|
|
2379
2380
|
const {
|
|
2380
2381
|
duration: o,
|
|
2381
2382
|
projectId: n,
|
|
@@ -2452,7 +2453,7 @@ async function Ho(e, t, r) {
|
|
|
2452
2453
|
}
|
|
2453
2454
|
return await t.addTask(f);
|
|
2454
2455
|
}
|
|
2455
|
-
function
|
|
2456
|
+
function Bo({
|
|
2456
2457
|
tasks: e,
|
|
2457
2458
|
failures: t,
|
|
2458
2459
|
args: r
|
|
@@ -2477,7 +2478,7 @@ function Wo({
|
|
|
2477
2478
|
showDetails: !0
|
|
2478
2479
|
});
|
|
2479
2480
|
}
|
|
2480
|
-
const
|
|
2481
|
+
const Yo = {
|
|
2481
2482
|
projectId: s.string().min(1).describe(
|
|
2482
2483
|
"The ID of the project to analyze. This triggers a new health analysis which may take some time to complete."
|
|
2483
2484
|
)
|
|
@@ -2492,7 +2493,7 @@ const Bo = {
|
|
|
2492
2493
|
}, zo = {
|
|
2493
2494
|
name: b.ANALYZE_PROJECT_HEALTH,
|
|
2494
2495
|
description: "Trigger a new health analysis for a project. Use this when the health data is stale or you want a fresh assessment. The analysis may take time to complete — use get-project-health afterward to see updated results.",
|
|
2495
|
-
parameters:
|
|
2496
|
+
parameters: Yo,
|
|
2496
2497
|
outputSchema: qo,
|
|
2497
2498
|
annotations: {
|
|
2498
2499
|
readOnlyHint: !1,
|
|
@@ -2516,19 +2517,19 @@ ${n}`,
|
|
|
2516
2517
|
}
|
|
2517
2518
|
};
|
|
2518
2519
|
}
|
|
2519
|
-
}, Yo = {
|
|
2520
|
-
ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to complete.")
|
|
2521
2520
|
}, Go = {
|
|
2521
|
+
ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to complete.")
|
|
2522
|
+
}, Ko = {
|
|
2522
2523
|
completed: s.array(s.string()).describe("The IDs of successfully completed tasks."),
|
|
2523
2524
|
failures: s.array(Q).describe("Failed task completions with error details."),
|
|
2524
2525
|
totalRequested: s.number().describe("The total number of tasks requested to complete."),
|
|
2525
2526
|
successCount: s.number().describe("The number of successfully completed tasks."),
|
|
2526
2527
|
failureCount: s.number().describe("The number of failed task completions.")
|
|
2527
|
-
},
|
|
2528
|
+
}, Vo = {
|
|
2528
2529
|
name: b.COMPLETE_TASKS,
|
|
2529
2530
|
description: "Complete one or more tasks by their IDs.",
|
|
2530
|
-
parameters:
|
|
2531
|
-
outputSchema:
|
|
2531
|
+
parameters: Go,
|
|
2532
|
+
outputSchema: Ko,
|
|
2532
2533
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
2533
2534
|
async execute(e, t) {
|
|
2534
2535
|
const r = [], o = [];
|
|
@@ -2543,7 +2544,7 @@ ${n}`,
|
|
|
2543
2544
|
});
|
|
2544
2545
|
}
|
|
2545
2546
|
return {
|
|
2546
|
-
textContent:
|
|
2547
|
+
textContent: Jo({
|
|
2547
2548
|
completed: r,
|
|
2548
2549
|
failures: o,
|
|
2549
2550
|
args: e
|
|
@@ -2558,7 +2559,7 @@ ${n}`,
|
|
|
2558
2559
|
};
|
|
2559
2560
|
}
|
|
2560
2561
|
};
|
|
2561
|
-
function
|
|
2562
|
+
function Jo({
|
|
2562
2563
|
completed: e,
|
|
2563
2564
|
failures: t,
|
|
2564
2565
|
args: r
|
|
@@ -2580,20 +2581,20 @@ const Zt = [
|
|
|
2580
2581
|
"filter",
|
|
2581
2582
|
"reminder",
|
|
2582
2583
|
"location_reminder"
|
|
2583
|
-
],
|
|
2584
|
+
], Xo = {
|
|
2584
2585
|
type: s.enum(Zt).describe("The type of entity to delete."),
|
|
2585
2586
|
id: s.string().min(1).describe("The ID of the entity to delete.")
|
|
2586
|
-
},
|
|
2587
|
+
}, Zo = {
|
|
2587
2588
|
deletedEntity: s.object({
|
|
2588
2589
|
type: s.enum(Zt).describe("The type of deleted entity."),
|
|
2589
2590
|
id: s.string().describe("The ID of the deleted entity.")
|
|
2590
2591
|
}).describe("Information about the deleted entity."),
|
|
2591
2592
|
success: s.boolean().describe("Whether the deletion was successful.")
|
|
2592
|
-
},
|
|
2593
|
+
}, Qo = {
|
|
2593
2594
|
name: b.DELETE_OBJECT,
|
|
2594
2595
|
description: "Delete a project, section, task, comment, label, filter, reminder, or location_reminder by its ID. Projects can be deleted whether active or archived (find archived ones via find-projects with archivedStatus); note a workspace project must be archived before it can be deleted, while personal projects can be deleted regardless.",
|
|
2595
|
-
parameters:
|
|
2596
|
-
outputSchema:
|
|
2596
|
+
parameters: Xo,
|
|
2597
|
+
outputSchema: Zo,
|
|
2597
2598
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !0 },
|
|
2598
2599
|
async execute(e, t) {
|
|
2599
2600
|
switch (e.type) {
|
|
@@ -2638,7 +2639,7 @@ const Zt = [
|
|
|
2638
2639
|
}
|
|
2639
2640
|
};
|
|
2640
2641
|
}
|
|
2641
|
-
},
|
|
2642
|
+
}, en = B.pick({
|
|
2642
2643
|
id: !0,
|
|
2643
2644
|
content: !0,
|
|
2644
2645
|
dueDate: !0,
|
|
@@ -2647,15 +2648,15 @@ const Zt = [
|
|
|
2647
2648
|
hasChildren: s.boolean().describe(
|
|
2648
2649
|
"Whether this subtask has subtasks of its own. Fetch it with includeChildren to expand."
|
|
2649
2650
|
)
|
|
2650
|
-
}),
|
|
2651
|
+
}), tn = X.pick({ id: !0, name: !0 }).extend({
|
|
2651
2652
|
hasChildren: s.boolean().describe(
|
|
2652
2653
|
"Whether this sub-project has sub-projects of its own. Fetch it with includeChildren to expand."
|
|
2653
2654
|
)
|
|
2654
|
-
}),
|
|
2655
|
+
}), sn = {
|
|
2655
2656
|
childCount: s.number().optional().describe(
|
|
2656
2657
|
"The number of direct children listed in children. Only present when children were requested and the type supports them. 0 means the object definitively has none."
|
|
2657
2658
|
),
|
|
2658
|
-
children: s.array(s.union([
|
|
2659
|
+
children: s.array(s.union([en, tn])).optional().describe(
|
|
2659
2660
|
"Direct children only: subtasks for a task, sub-projects for a project. Completed subtasks and archived sub-projects are excluded."
|
|
2660
2661
|
),
|
|
2661
2662
|
hasMoreChildren: s.boolean().optional().describe(
|
|
@@ -2665,7 +2666,7 @@ const Zt = [
|
|
|
2665
2666
|
'Present when the children lookup failed or returned incomplete information. When no children are listed alongside it, childCount is unknown - do not read its absence as "no children".'
|
|
2666
2667
|
)
|
|
2667
2668
|
};
|
|
2668
|
-
async function
|
|
2669
|
+
async function rn(e, t) {
|
|
2669
2670
|
const { results: r, nextCursor: o } = await e.getTasks({
|
|
2670
2671
|
parentId: t,
|
|
2671
2672
|
limit: I.CHILDREN_MAX
|
|
@@ -2688,10 +2689,10 @@ async function sn(e, t) {
|
|
|
2688
2689
|
childrenError: a ? `Could not check ${a} of ${r.length} subtasks for subtasks of their own; those are reported as hasChildren=false.` : void 0
|
|
2689
2690
|
};
|
|
2690
2691
|
}
|
|
2691
|
-
async function
|
|
2692
|
+
async function on(e, t) {
|
|
2692
2693
|
if (!W(t))
|
|
2693
2694
|
return { childCount: 0, children: [] };
|
|
2694
|
-
const r = await
|
|
2695
|
+
const r = await zt(e), o = /* @__PURE__ */ new Map();
|
|
2695
2696
|
for (const i of r) {
|
|
2696
2697
|
if (!W(i) || !i.parentId) continue;
|
|
2697
2698
|
const c = o.get(i.parentId) ?? [];
|
|
@@ -2721,22 +2722,22 @@ function gt(e, t) {
|
|
|
2721
2722
|
const r = t.hasMoreChildren ? "+" : "", o = t.childrenError ? " (partial)" : "";
|
|
2722
2723
|
return ` • ${e}=${t.childCount}${r}${o}`;
|
|
2723
2724
|
}
|
|
2724
|
-
const Qt = ["task", "project", "comment", "section"],
|
|
2725
|
+
const Qt = ["task", "project", "comment", "section"], nn = {
|
|
2725
2726
|
type: s.enum(Qt).describe("The type of object to fetch."),
|
|
2726
2727
|
id: s.string().min(1).describe("The unique ID of the object to fetch."),
|
|
2727
2728
|
includeChildren: s.boolean().optional().describe(
|
|
2728
2729
|
"Also return the direct children of the object: subtasks for a task, sub-projects for a project. Returns childCount plus a compact list, flagging each child that has children of its own. Use this to check whether a task hides subtasks instead of a speculative find-tasks lookup. Ignored for comments and sections."
|
|
2729
2730
|
)
|
|
2730
|
-
},
|
|
2731
|
+
}, an = {
|
|
2731
2732
|
type: s.enum(Qt).describe("The type of object fetched."),
|
|
2732
2733
|
id: s.string().describe("The ID of the fetched object."),
|
|
2733
2734
|
object: s.union([B, X, je, le]).describe("The fetched object data."),
|
|
2734
|
-
...
|
|
2735
|
-
},
|
|
2735
|
+
...sn
|
|
2736
|
+
}, cn = {
|
|
2736
2737
|
name: b.FETCH_OBJECT,
|
|
2737
2738
|
description: "Fetch a single task, project, comment, or section by its ID. Use this when you have a specific object ID and want to retrieve its full details. Set includeChildren to also get its direct subtasks or sub-projects.",
|
|
2738
|
-
parameters:
|
|
2739
|
-
outputSchema:
|
|
2739
|
+
parameters: nn,
|
|
2740
|
+
outputSchema: an,
|
|
2740
2741
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
2741
2742
|
async execute(e, t) {
|
|
2742
2743
|
const { type: r, id: o, includeChildren: n } = e;
|
|
@@ -2745,7 +2746,7 @@ const Qt = ["task", "project", "comment", "section"], on = {
|
|
|
2745
2746
|
case "task": {
|
|
2746
2747
|
const [a, i] = await Promise.all([
|
|
2747
2748
|
t.getTask(o),
|
|
2748
|
-
n ? bt(() =>
|
|
2749
|
+
n ? bt(() => rn(t, o)) : Promise.resolve({})
|
|
2749
2750
|
]), c = U(a);
|
|
2750
2751
|
return {
|
|
2751
2752
|
textContent: `Found task: ${c.content} • id=${c.id} • priority=${c.priority} • project=${c.projectId}${gt("subtasks", i)}`,
|
|
@@ -2758,7 +2759,7 @@ const Qt = ["task", "project", "comment", "section"], on = {
|
|
|
2758
2759
|
};
|
|
2759
2760
|
}
|
|
2760
2761
|
case "project": {
|
|
2761
|
-
const a = await t.getProject(o), i = J(a), c = n ? await bt(() =>
|
|
2762
|
+
const a = await t.getProject(o), i = J(a), c = n ? await bt(() => on(t, a)) : {};
|
|
2762
2763
|
return {
|
|
2763
2764
|
textContent: `Found project: ${i.name} • id=${i.id} • color=${i.color} • viewStyle=${i.viewStyle}${gt("subProjects", c)}`,
|
|
2764
2765
|
structuredContent: {
|
|
@@ -2801,21 +2802,21 @@ const Qt = ["task", "project", "comment", "section"], on = {
|
|
|
2801
2802
|
);
|
|
2802
2803
|
}
|
|
2803
2804
|
}
|
|
2804
|
-
},
|
|
2805
|
+
}, dn = {
|
|
2805
2806
|
id: s.string().min(1).describe(
|
|
2806
2807
|
'A unique identifier for the document in the format "task:{id}" or "project:{id}".'
|
|
2807
2808
|
)
|
|
2808
|
-
},
|
|
2809
|
+
}, ln = {
|
|
2809
2810
|
id: s.string().describe("The ID of the fetched document."),
|
|
2810
2811
|
title: s.string().describe("The title of the document."),
|
|
2811
2812
|
text: s.string().describe("The text content of the document."),
|
|
2812
2813
|
url: s.string().describe("The URL of the document."),
|
|
2813
2814
|
metadata: s.record(s.string(), s.unknown()).optional().describe("Additional metadata about the document.")
|
|
2814
|
-
},
|
|
2815
|
+
}, un = {
|
|
2815
2816
|
name: b.FETCH,
|
|
2816
2817
|
description: 'Fetch the full contents of a task or project by its ID. The ID should be in the format "task:{id}" or "project:{id}".',
|
|
2817
|
-
parameters:
|
|
2818
|
-
outputSchema:
|
|
2818
|
+
parameters: dn,
|
|
2819
|
+
outputSchema: ln,
|
|
2819
2820
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
2820
2821
|
async execute(e, t) {
|
|
2821
2822
|
const { id: r } = e, [o, n] = r.split(":", 2);
|
|
@@ -2875,7 +2876,7 @@ Favorite: Yes`), a = {
|
|
|
2875
2876
|
structuredContent: a
|
|
2876
2877
|
};
|
|
2877
2878
|
}
|
|
2878
|
-
},
|
|
2879
|
+
}, pn = {
|
|
2879
2880
|
objectType: s.enum(["task", "project", "comment"]).optional().describe("Type of object to filter by."),
|
|
2880
2881
|
objectId: s.string().optional().describe("Filter by specific object ID (task, project, or comment)."),
|
|
2881
2882
|
eventType: s.enum([
|
|
@@ -2894,17 +2895,17 @@ Favorite: Yes`), a = {
|
|
|
2894
2895
|
initiatorId: s.string().optional().describe("Filter by the user ID who initiated the event."),
|
|
2895
2896
|
limit: s.number().int().min(1).max(I.ACTIVITY_MAX).default(I.ACTIVITY_DEFAULT).describe("Maximum number of activity events to return."),
|
|
2896
2897
|
cursor: s.string().optional().describe("Pagination cursor for retrieving the next page of results.")
|
|
2897
|
-
},
|
|
2898
|
+
}, hn = {
|
|
2898
2899
|
events: s.array(qr).describe("The activity events."),
|
|
2899
2900
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
2900
2901
|
totalCount: s.number().describe("The total number of events in this page."),
|
|
2901
2902
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
2902
2903
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
2903
|
-
},
|
|
2904
|
+
}, mn = {
|
|
2904
2905
|
name: b.FIND_ACTIVITY,
|
|
2905
2906
|
description: "Retrieve recent activity logs to monitor and audit changes in Todoist. Shows events from all users by default (use initiatorId to filter by specific user). Track task completions, updates, deletions, project changes, and more with flexible filtering. Note: Date-based filtering is not supported by the Todoist API.",
|
|
2906
|
-
parameters:
|
|
2907
|
-
outputSchema:
|
|
2907
|
+
parameters: pn,
|
|
2908
|
+
outputSchema: hn,
|
|
2908
2909
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
2909
2910
|
async execute(e, t) {
|
|
2910
2911
|
const { objectType: r, objectId: o, eventType: n, projectId: a, taskId: i, initiatorId: c, limit: l, cursor: d } = e, u = {
|
|
@@ -2912,9 +2913,9 @@ Favorite: Yes`), a = {
|
|
|
2912
2913
|
cursor: d ?? null
|
|
2913
2914
|
};
|
|
2914
2915
|
r && n ? u.objectEventTypes = `${r}:${n}` : r ? u.objectEventTypes = `${r}:` : n && (u.objectEventTypes = `:${n}`), o && o !== "remove" && (u.objectId = o), a && (u.parentProjectId = a), i && (u.parentItemId = i), c && (u.initiatorId = c);
|
|
2915
|
-
const { results: p, nextCursor: h } = await t.getActivityLogs(u), m = p.map(
|
|
2916
|
+
const { results: p, nextCursor: h } = await t.getActivityLogs(u), m = p.map(Fr);
|
|
2916
2917
|
return {
|
|
2917
|
-
textContent:
|
|
2918
|
+
textContent: fn({ events: m, args: e, nextCursor: h }),
|
|
2918
2919
|
structuredContent: {
|
|
2919
2920
|
events: m,
|
|
2920
2921
|
nextCursor: h ?? void 0,
|
|
@@ -2925,7 +2926,7 @@ Favorite: Yes`), a = {
|
|
|
2925
2926
|
};
|
|
2926
2927
|
}
|
|
2927
2928
|
};
|
|
2928
|
-
function
|
|
2929
|
+
function fn({
|
|
2929
2930
|
events: e,
|
|
2930
2931
|
args: t,
|
|
2931
2932
|
nextCursor: r
|
|
@@ -2940,18 +2941,18 @@ function mn({
|
|
|
2940
2941
|
const a = [];
|
|
2941
2942
|
t.objectId && a.push(`object ID: ${t.objectId}`), t.projectId && a.push(`project: ${t.projectId}`), t.taskId && a.push(`task: ${t.taskId}`), t.initiatorId && a.push(`initiator: ${t.initiatorId}`);
|
|
2942
2943
|
const i = [];
|
|
2943
|
-
return e.length === 0 && (i.push("No activity events match the specified filters"), i.push("Note: Activity logs only show recent events"), t.eventType && i.push(`Try removing the eventType filter (${t.eventType})`), t.objectType && i.push(`Try removing the objectType filter (${t.objectType})`), (t.objectId || t.projectId || t.taskId) && i.push("Verify the object ID is correct")),
|
|
2944
|
+
return e.length === 0 && (i.push("No activity events match the specified filters"), i.push("Note: Activity logs only show recent events"), t.eventType && i.push(`Try removing the eventType filter (${t.eventType})`), t.objectType && i.push(`Try removing the objectType filter (${t.objectType})`), (t.objectId || t.projectId || t.taskId) && i.push("Verify the object ID is correct")), Y({
|
|
2944
2945
|
subject: o,
|
|
2945
2946
|
count: e.length,
|
|
2946
2947
|
limit: t.limit,
|
|
2947
2948
|
nextCursor: r ?? void 0,
|
|
2948
2949
|
filterHints: a,
|
|
2949
|
-
previewLines:
|
|
2950
|
+
previewLines: bn(e, Math.min(e.length, t.limit)),
|
|
2950
2951
|
zeroReasonHints: i
|
|
2951
2952
|
});
|
|
2952
2953
|
}
|
|
2953
|
-
function
|
|
2954
|
-
const o = e.slice(0, t).map(
|
|
2954
|
+
function bn(e, t = 10) {
|
|
2955
|
+
const o = e.slice(0, t).map(gn).join(`
|
|
2955
2956
|
`);
|
|
2956
2957
|
if (e.length > t) {
|
|
2957
2958
|
const n = e.length - t;
|
|
@@ -2960,8 +2961,8 @@ function fn(e, t = 10) {
|
|
|
2960
2961
|
}
|
|
2961
2962
|
return o;
|
|
2962
2963
|
}
|
|
2963
|
-
function
|
|
2964
|
-
const t =
|
|
2964
|
+
function gn(e) {
|
|
2965
|
+
const t = yn(e.eventDate), r = `${e.eventType} ${e.objectType}`;
|
|
2965
2966
|
let o = "";
|
|
2966
2967
|
if (e.extraData) {
|
|
2967
2968
|
const c = e.extraData.content || e.extraData.name || e.extraData.last_content;
|
|
@@ -2970,7 +2971,7 @@ function bn(e) {
|
|
|
2970
2971
|
const n = e.objectId ? ` • id=${e.objectId}` : "", a = e.initiatorId ? ` • by=${e.initiatorId}` : " • system", i = e.parentProjectId ? ` • project=${e.parentProjectId}` : "";
|
|
2971
2972
|
return ` [${t}] ${r}${o}${n}${a}${i}`;
|
|
2972
2973
|
}
|
|
2973
|
-
function
|
|
2974
|
+
function yn(e) {
|
|
2974
2975
|
try {
|
|
2975
2976
|
const t = new Date(e), r = t.toLocaleDateString("en-US", { month: "short", timeZone: "UTC" }), o = t.toLocaleDateString("en-US", { day: "numeric", timeZone: "UTC" }), n = t.toLocaleTimeString("en-US", {
|
|
2976
2977
|
hour: "2-digit",
|
|
@@ -2983,7 +2984,7 @@ function gn(e) {
|
|
|
2983
2984
|
return e;
|
|
2984
2985
|
}
|
|
2985
2986
|
}
|
|
2986
|
-
const
|
|
2987
|
+
const kn = {
|
|
2987
2988
|
taskId: s.string().optional().describe("Find comments for a specific task."),
|
|
2988
2989
|
projectId: s.string().optional().describe(
|
|
2989
2990
|
'Find comments for a specific project. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
@@ -2991,7 +2992,7 @@ const yn = {
|
|
|
2991
2992
|
commentId: s.string().optional().describe("Get a specific comment by ID."),
|
|
2992
2993
|
cursor: s.string().optional().describe("Pagination cursor for retrieving more results."),
|
|
2993
2994
|
limit: s.number().int().min(1).max(I.COMMENTS_MAX).optional().describe("Maximum number of comments to return")
|
|
2994
|
-
},
|
|
2995
|
+
}, Tn = {
|
|
2995
2996
|
comments: s.array(je).describe("The found comments."),
|
|
2996
2997
|
searchType: s.string().describe(
|
|
2997
2998
|
'The type of search performed: "single" (comment ID), "task" (task ID), or "project" (project ID).'
|
|
@@ -3000,11 +3001,11 @@ const yn = {
|
|
|
3000
3001
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
3001
3002
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
3002
3003
|
totalCount: s.number().describe("The total number of comments in this page.")
|
|
3003
|
-
},
|
|
3004
|
+
}, wn = {
|
|
3004
3005
|
name: b.FIND_COMMENTS,
|
|
3005
3006
|
description: "Find comments by task, project, or get a specific comment by ID. Exactly one of taskId, projectId, or commentId must be provided.",
|
|
3006
|
-
parameters:
|
|
3007
|
-
outputSchema:
|
|
3007
|
+
parameters: kn,
|
|
3008
|
+
outputSchema: Tn,
|
|
3008
3009
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3009
3010
|
async execute(e, t) {
|
|
3010
3011
|
const r = [e.taskId, e.projectId, e.commentId].filter(Boolean);
|
|
@@ -3039,7 +3040,7 @@ const yn = {
|
|
|
3039
3040
|
throw new Error("Invalid state: no search parameter provided");
|
|
3040
3041
|
const c = i.map(ve);
|
|
3041
3042
|
return {
|
|
3042
|
-
textContent:
|
|
3043
|
+
textContent: vn({
|
|
3043
3044
|
comments: c,
|
|
3044
3045
|
searchType: e.commentId ? "single" : e.taskId ? "task" : "project",
|
|
3045
3046
|
searchId: e.commentId || e.taskId || e.projectId || "",
|
|
@@ -3057,7 +3058,7 @@ const yn = {
|
|
|
3057
3058
|
};
|
|
3058
3059
|
}
|
|
3059
3060
|
};
|
|
3060
|
-
function
|
|
3061
|
+
function vn({
|
|
3061
3062
|
comments: e,
|
|
3062
3063
|
searchType: t,
|
|
3063
3064
|
searchId: r,
|
|
@@ -3087,14 +3088,14 @@ function es(e) {
|
|
|
3087
3088
|
const t = e.getUTCFullYear(), r = String(e.getUTCMonth() + 1).padStart(2, "0"), o = String(e.getUTCDate()).padStart(2, "0");
|
|
3088
3089
|
return `${t}-${r}-${o}`;
|
|
3089
3090
|
}
|
|
3090
|
-
function
|
|
3091
|
+
function In(e) {
|
|
3091
3092
|
const t = /^([+-])(\d{2}):(\d{2})$/.exec(e);
|
|
3092
3093
|
if (!t)
|
|
3093
3094
|
return 0;
|
|
3094
3095
|
const [, r, o, n] = t, a = Number(o) * 60 + Number(n);
|
|
3095
3096
|
return r === "-" ? -a : a;
|
|
3096
3097
|
}
|
|
3097
|
-
function
|
|
3098
|
+
function jn(e, t) {
|
|
3098
3099
|
const r = new Date(e.getTime() + t * 60 * 1e3);
|
|
3099
3100
|
return es(r);
|
|
3100
3101
|
}
|
|
@@ -3105,9 +3106,9 @@ function yt(e, t) {
|
|
|
3105
3106
|
const l = new Date(Date.UTC(a, i - 1, c));
|
|
3106
3107
|
return l.setUTCDate(l.getUTCDate() + t), es(l);
|
|
3107
3108
|
}
|
|
3108
|
-
const
|
|
3109
|
+
const Sn = ["and", "or"], at = {
|
|
3109
3110
|
labels: s.string().array().optional().describe("The labels to filter the tasks by"),
|
|
3110
|
-
labelsOperator: s.enum(
|
|
3111
|
+
labelsOperator: s.enum(Sn).optional().describe(
|
|
3111
3112
|
'The operator to use when filtering by labels. This will dictate whether a task has all labels, or some of them. Default is "or".'
|
|
3112
3113
|
)
|
|
3113
3114
|
};
|
|
@@ -3116,20 +3117,20 @@ function it(e = [], t = "or") {
|
|
|
3116
3117
|
const r = t === "and" ? " & " : " | ";
|
|
3117
3118
|
return `(${e.map((a) => a.startsWith("@") ? a : `@${a}`).join(` ${r} `)})`;
|
|
3118
3119
|
}
|
|
3119
|
-
const
|
|
3120
|
-
function
|
|
3120
|
+
const Cn = 7;
|
|
3121
|
+
function $n({
|
|
3121
3122
|
since: e,
|
|
3122
3123
|
until: t,
|
|
3123
3124
|
userGmtOffset: r,
|
|
3124
3125
|
now: o = /* @__PURE__ */ new Date()
|
|
3125
3126
|
}) {
|
|
3126
|
-
const n =
|
|
3127
|
+
const n = In(r), a = jn(o, n), i = Cn - 1, c = t ?? (e ? yt(e, i) : a);
|
|
3127
3128
|
return {
|
|
3128
3129
|
since: e ?? yt(c, -i),
|
|
3129
3130
|
until: c
|
|
3130
3131
|
};
|
|
3131
3132
|
}
|
|
3132
|
-
const
|
|
3133
|
+
const Dn = {
|
|
3133
3134
|
getBy: s.enum(["completion", "due"]).default("completion").describe(
|
|
3134
3135
|
'The method to use to get the tasks: "completion" to get tasks by completion date (ie, when the task was actually completed), "due" to get tasks by due date (ie, when the task was due to be completed by).'
|
|
3135
3136
|
),
|
|
@@ -3153,17 +3154,17 @@ const $n = {
|
|
|
3153
3154
|
"The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters)."
|
|
3154
3155
|
),
|
|
3155
3156
|
...at
|
|
3156
|
-
},
|
|
3157
|
+
}, An = {
|
|
3157
3158
|
tasks: s.array(B).describe("The found completed tasks."),
|
|
3158
3159
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
3159
3160
|
totalCount: s.number().describe("The total number of tasks in this page."),
|
|
3160
3161
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
3161
3162
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
3162
|
-
},
|
|
3163
|
+
}, xn = {
|
|
3163
3164
|
name: b.FIND_COMPLETED_TASKS,
|
|
3164
3165
|
description: "Get completed tasks. since/until are optional and default to a 7-day window when omitted. Includes all collaborators by default. Person-specific queries (summaries, plans, reports) require responsibleUser.",
|
|
3165
|
-
parameters:
|
|
3166
|
-
outputSchema:
|
|
3166
|
+
parameters: Dn,
|
|
3167
|
+
outputSchema: An,
|
|
3167
3168
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3168
3169
|
async execute(e, t) {
|
|
3169
3170
|
const { getBy: r, labels: o, labelsOperator: n, since: a, until: i, responsibleUser: c, projectId: l, ...d } = e;
|
|
@@ -3177,7 +3178,7 @@ const $n = {
|
|
|
3177
3178
|
const f = await t.getUser(), g = f.tzInfo?.gmtString || "+00:00", S = await V({
|
|
3178
3179
|
projectId: l,
|
|
3179
3180
|
user: f
|
|
3180
|
-
}), j =
|
|
3181
|
+
}), j = $n({
|
|
3181
3182
|
since: a,
|
|
3182
3183
|
until: i,
|
|
3183
3184
|
userGmtOffset: g
|
|
@@ -3199,7 +3200,7 @@ const $n = {
|
|
|
3199
3200
|
...m ? { filterQuery: m, filterLang: "en" } : {}
|
|
3200
3201
|
}), A = w.map(U);
|
|
3201
3202
|
return {
|
|
3202
|
-
textContent:
|
|
3203
|
+
textContent: En({
|
|
3203
3204
|
tasks: A,
|
|
3204
3205
|
args: ee,
|
|
3205
3206
|
nextCursor: C,
|
|
@@ -3215,7 +3216,7 @@ const $n = {
|
|
|
3215
3216
|
};
|
|
3216
3217
|
}
|
|
3217
3218
|
};
|
|
3218
|
-
function
|
|
3219
|
+
function En({
|
|
3219
3220
|
tasks: e,
|
|
3220
3221
|
args: t,
|
|
3221
3222
|
nextCursor: r,
|
|
@@ -3231,7 +3232,7 @@ function xn({
|
|
|
3231
3232
|
i.push(`assigned to: ${l}`);
|
|
3232
3233
|
}
|
|
3233
3234
|
const c = [];
|
|
3234
|
-
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')),
|
|
3235
|
+
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')), Y({
|
|
3235
3236
|
subject: a,
|
|
3236
3237
|
count: e.length,
|
|
3237
3238
|
limit: t.limit,
|
|
@@ -3241,7 +3242,7 @@ function xn({
|
|
|
3241
3242
|
zeroReasonHints: c
|
|
3242
3243
|
});
|
|
3243
3244
|
}
|
|
3244
|
-
const
|
|
3245
|
+
const On = {
|
|
3245
3246
|
searchText: s.string().optional().describe(
|
|
3246
3247
|
'Search for a label by name (partial and case insensitive match). Supports wildcards (e.g. "work*" for prefix match). Use "\\*" for a literal asterisk. If omitted, all labels are returned.'
|
|
3247
3248
|
),
|
|
@@ -3249,7 +3250,7 @@ const En = {
|
|
|
3249
3250
|
cursor: s.string().optional().describe(
|
|
3250
3251
|
"The cursor to get the next page of labels (cursor is obtained from the previous call to this tool, with the same parameters). Ignored when searchText is provided."
|
|
3251
3252
|
)
|
|
3252
|
-
},
|
|
3253
|
+
}, Pn = {
|
|
3253
3254
|
labels: s.array(me).describe("The found personal labels."),
|
|
3254
3255
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
3255
3256
|
totalCount: s.number().describe("The total number of labels in this page."),
|
|
@@ -3258,22 +3259,22 @@ const En = {
|
|
|
3258
3259
|
"Names of all shared labels visible to you. These have no IDs or metadata — use their names directly when filtering tasks."
|
|
3259
3260
|
),
|
|
3260
3261
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
3261
|
-
},
|
|
3262
|
+
}, Rn = {
|
|
3262
3263
|
name: b.FIND_LABELS,
|
|
3263
3264
|
description: "List personal labels and shared labels. Personal labels have full metadata (id, name, color, order, isFavorite) and support pagination and name search (partial, case insensitive). Shared labels are labels used on tasks shared with you — they are returned as names only (no IDs or metadata). When searching, all matching personal labels are fetched across all pages and returned as a single result set (limit and cursor are ignored). When not searching, personal labels are returned with pagination.",
|
|
3264
|
-
parameters:
|
|
3265
|
-
outputSchema:
|
|
3265
|
+
parameters: On,
|
|
3266
|
+
outputSchema: Pn,
|
|
3266
3267
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3267
3268
|
async execute(e, t) {
|
|
3268
3269
|
const [r, o] = await Promise.all([
|
|
3269
|
-
e.searchText ?
|
|
3270
|
+
e.searchText ? Ur(t, e.searchText).then((c) => ({
|
|
3270
3271
|
results: c,
|
|
3271
3272
|
nextCursor: null
|
|
3272
3273
|
})) : t.getLabels({ limit: e.limit, cursor: e.cursor ?? null }),
|
|
3273
|
-
|
|
3274
|
+
Nr(t)
|
|
3274
3275
|
]), { results: n, nextCursor: a } = r, i = e.searchText ? { searchText: e.searchText } : { limit: e.limit, cursor: e.cursor };
|
|
3275
3276
|
return {
|
|
3276
|
-
textContent:
|
|
3277
|
+
textContent: _n({ labels: n, args: e, nextCursor: a, sharedLabels: o }),
|
|
3277
3278
|
structuredContent: {
|
|
3278
3279
|
labels: n.map((c) => me.parse(c)),
|
|
3279
3280
|
nextCursor: a ?? void 0,
|
|
@@ -3285,7 +3286,7 @@ const En = {
|
|
|
3285
3286
|
};
|
|
3286
3287
|
}
|
|
3287
3288
|
};
|
|
3288
|
-
function
|
|
3289
|
+
function _n({
|
|
3289
3290
|
labels: e,
|
|
3290
3291
|
args: t,
|
|
3291
3292
|
nextCursor: r,
|
|
@@ -3293,14 +3294,14 @@ function Rn({
|
|
|
3293
3294
|
}) {
|
|
3294
3295
|
const n = t.searchText ? `All labels matching "${t.searchText}"` : "Labels", a = [];
|
|
3295
3296
|
t.searchText && a.push(`searchText: "${t.searchText}"`);
|
|
3296
|
-
const i = 10, l = e.slice(0, i).map(
|
|
3297
|
+
const i = 10, l = e.slice(0, i).map(mo).join(`
|
|
3297
3298
|
`), d = e.length - i, u = d > 0 ? `${l}
|
|
3298
3299
|
…and ${d} more` : l, p = [];
|
|
3299
3300
|
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"));
|
|
3300
3301
|
const h = o.length > 0 ? `
|
|
3301
3302
|
Shared labels (${o.length}): ${o.join(", ")}` : `
|
|
3302
3303
|
No shared labels.`;
|
|
3303
|
-
return
|
|
3304
|
+
return Y({
|
|
3304
3305
|
subject: n,
|
|
3305
3306
|
count: e.length,
|
|
3306
3307
|
limit: t.searchText ? void 0 : t.limit,
|
|
@@ -3310,14 +3311,14 @@ No shared labels.`;
|
|
|
3310
3311
|
zeroReasonHints: p
|
|
3311
3312
|
}) + h;
|
|
3312
3313
|
}
|
|
3313
|
-
const { FIND_PROJECTS: ts, ADD_TASKS: ss, UPDATE_TASKS: rs } = b,
|
|
3314
|
+
const { FIND_PROJECTS: ts, ADD_TASKS: ss, UPDATE_TASKS: rs } = b, Un = {
|
|
3314
3315
|
projectId: s.string().min(1).optional().describe(
|
|
3315
3316
|
'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.'
|
|
3316
3317
|
),
|
|
3317
3318
|
searchTerm: s.string().optional().describe(
|
|
3318
3319
|
"Search for a user by name or email (partial and case insensitive match). If omitted, all users are returned."
|
|
3319
3320
|
)
|
|
3320
|
-
},
|
|
3321
|
+
}, Nn = {
|
|
3321
3322
|
collaborators: s.array(zr).describe("The found users."),
|
|
3322
3323
|
projectInfo: s.object({
|
|
3323
3324
|
id: s.string().describe("The project ID."),
|
|
@@ -3327,16 +3328,16 @@ const { FIND_PROJECTS: ts, ADD_TASKS: ss, UPDATE_TASKS: rs } = b, _n = {
|
|
|
3327
3328
|
totalCount: s.number().describe("The total number of users found."),
|
|
3328
3329
|
totalAvailable: s.number().optional().describe("The total number of available users before the search filter was applied."),
|
|
3329
3330
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
3330
|
-
},
|
|
3331
|
+
}, Ln = {
|
|
3331
3332
|
name: b.FIND_PROJECT_COLLABORATORS,
|
|
3332
3333
|
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.`,
|
|
3333
|
-
parameters:
|
|
3334
|
-
outputSchema:
|
|
3334
|
+
parameters: Un,
|
|
3335
|
+
outputSchema: Nn,
|
|
3335
3336
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3336
3337
|
async execute(e, t) {
|
|
3337
3338
|
const { projectId: r, searchTerm: o } = e;
|
|
3338
3339
|
if (!r)
|
|
3339
|
-
return
|
|
3340
|
+
return Mn({ searchTerm: o, client: t, appliedFilters: e });
|
|
3340
3341
|
let n = r, a;
|
|
3341
3342
|
try {
|
|
3342
3343
|
if (a = await t.getProject(r), !a)
|
|
@@ -3406,12 +3407,12 @@ const { FIND_PROJECTS: ts, ADD_TASKS: ss, UPDATE_TASKS: rs } = b, _n = {
|
|
|
3406
3407
|
};
|
|
3407
3408
|
}
|
|
3408
3409
|
};
|
|
3409
|
-
async function
|
|
3410
|
+
async function Mn({
|
|
3410
3411
|
searchTerm: e,
|
|
3411
3412
|
client: t,
|
|
3412
3413
|
appliedFilters: r
|
|
3413
3414
|
}) {
|
|
3414
|
-
const o = await H.getAllCollaborators(t), n = await
|
|
3415
|
+
const o = await H.getAllCollaborators(t), n = await Fn(t, o);
|
|
3415
3416
|
if (n.length === 0)
|
|
3416
3417
|
return {
|
|
3417
3418
|
textContent: `No users found. You may have no shared projects, or collaborator data is not accessible.
|
|
@@ -3445,7 +3446,7 @@ async function Ln({
|
|
|
3445
3446
|
}
|
|
3446
3447
|
};
|
|
3447
3448
|
}
|
|
3448
|
-
async function
|
|
3449
|
+
async function Fn(e, t) {
|
|
3449
3450
|
try {
|
|
3450
3451
|
const r = await e.getUser();
|
|
3451
3452
|
return !r || t.some((o) => o.id === r.id) ? t : [
|
|
@@ -3480,7 +3481,7 @@ function ns({
|
|
|
3480
3481
|
const d = [];
|
|
3481
3482
|
e.length === 0 && r && (d.push(`No users match "${r}"`), d.push("Try a broader search term or check spelling"), o > 0 && d.push(`${o} users available without filter`));
|
|
3482
3483
|
const u = [];
|
|
3483
|
-
return e.length > 0 ? (u.push(`Use ${ss} with responsibleUser to assign new tasks`), u.push(`Use ${rs} with responsibleUser to reassign existing tasks`), u.push("Use user names, emails, or IDs for assignments")) : (u.push(`Use ${ts} to find other projects`), r && o > 0 && u.push("Try searching without filters to see all users")),
|
|
3484
|
+
return e.length > 0 ? (u.push(`Use ${ss} with responsibleUser to assign new tasks`), u.push(`Use ${rs} with responsibleUser to reassign existing tasks`), u.push("Use user names, emails, or IDs for assignments")) : (u.push(`Use ${ts} to find other projects`), r && o > 0 && u.push("Try searching without filters to see all users")), Y({
|
|
3484
3485
|
subject: i,
|
|
3485
3486
|
count: e.length,
|
|
3486
3487
|
filterHints: c,
|
|
@@ -3490,11 +3491,11 @@ function ns({
|
|
|
3490
3491
|
nextSteps: u
|
|
3491
3492
|
});
|
|
3492
3493
|
}
|
|
3493
|
-
const { ADD_PROJECTS: kt } = b,
|
|
3494
|
+
const { ADD_PROJECTS: kt } = b, Hn = {
|
|
3494
3495
|
active: "projects",
|
|
3495
3496
|
archived: "archived projects",
|
|
3496
3497
|
all: "projects (active and archived)"
|
|
3497
|
-
},
|
|
3498
|
+
}, Wn = {
|
|
3498
3499
|
searchText: s.string().optional().describe(
|
|
3499
3500
|
'Search for a project by name (partial and case insensitive match). Supports wildcards (e.g. "work*" for prefix match). Use "\\*" for a literal asterisk. If omitted, all projects are returned.'
|
|
3500
3501
|
),
|
|
@@ -3505,26 +3506,26 @@ const { ADD_PROJECTS: kt } = b, Fn = {
|
|
|
3505
3506
|
archivedStatus: s.enum(["active", "archived", "all"]).optional().describe(
|
|
3506
3507
|
"Which projects to return by archive status: 'active' (default, non-archived only), 'archived' (archived only), or 'all' (both active and archived). Each project includes an isArchived field. Archived projects can be deleted via the delete-object tool (type: 'project')."
|
|
3507
3508
|
)
|
|
3508
|
-
},
|
|
3509
|
+
}, Bn = {
|
|
3509
3510
|
projects: s.array(X).describe("The found projects."),
|
|
3510
3511
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
3511
3512
|
totalCount: s.number().describe("The total number of projects in this page."),
|
|
3512
3513
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
3513
3514
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
3514
|
-
},
|
|
3515
|
+
}, Yn = {
|
|
3515
3516
|
name: b.FIND_PROJECTS,
|
|
3516
3517
|
description: "List all projects or search for projects by name. By default only active projects are returned; use archivedStatus ('archived' or 'all') to include archived projects. When searching or when archivedStatus is 'all', all matching projects are returned (pagination is ignored). Otherwise projects are returned with pagination.",
|
|
3517
|
-
parameters:
|
|
3518
|
-
outputSchema:
|
|
3518
|
+
parameters: Wn,
|
|
3519
|
+
outputSchema: Bn,
|
|
3519
3520
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3520
3521
|
async execute(e, t) {
|
|
3521
3522
|
const { searchText: r } = e, o = e.archivedStatus ?? "active";
|
|
3522
3523
|
let n, a = null;
|
|
3523
3524
|
if (r || o === "all") {
|
|
3524
3525
|
const c = Promise.resolve([]), [l, d] = await Promise.all([
|
|
3525
|
-
o === "archived" ? c : r ?
|
|
3526
|
-
o === "active" ? c :
|
|
3527
|
-
]), u = r ?
|
|
3526
|
+
o === "archived" ? c : r ? qt(t, r) : zt(t),
|
|
3527
|
+
o === "active" ? c : Rr(t)
|
|
3528
|
+
]), u = r ? _r(r) : null, p = u ? d.filter((h) => u.test(h.name)) : d;
|
|
3528
3529
|
n = [...l, ...p];
|
|
3529
3530
|
} else {
|
|
3530
3531
|
const c = o === "archived" ? await t.getArchivedProjects({
|
|
@@ -3551,12 +3552,12 @@ function qn({
|
|
|
3551
3552
|
args: t,
|
|
3552
3553
|
nextCursor: r
|
|
3553
3554
|
}) {
|
|
3554
|
-
const o =
|
|
3555
|
+
const o = Hn[t.archivedStatus ?? "active"], n = t.searchText ? `All ${o} matching "${t.searchText}"` : `${o.charAt(0).toUpperCase()}${o.slice(1)}`, a = [];
|
|
3555
3556
|
t.searchText && a.push(`searchText: "${t.searchText}"`), t.archivedStatus && t.archivedStatus !== "active" && a.push(`archivedStatus: "${t.archivedStatus}"`);
|
|
3556
|
-
const i = 10, l = e.slice(0, i).map(
|
|
3557
|
+
const i = 10, l = e.slice(0, i).map(fo).join(`
|
|
3557
3558
|
`), d = e.length - i, u = d > 0 ? `${l}
|
|
3558
3559
|
…and ${d} more` : l, p = [];
|
|
3559
|
-
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 ${kt} to create a project`)) : (p.push("No active projects"), p.push("Use archivedStatus: 'all' to include archived projects"), p.push(`Use ${kt} to create a project`))),
|
|
3560
|
+
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 ${kt} to create a project`)) : (p.push("No active projects"), p.push("Use archivedStatus: 'all' to include archived projects"), p.push(`Use ${kt} to create a project`))), Y({
|
|
3560
3561
|
subject: n,
|
|
3561
3562
|
count: e.length,
|
|
3562
3563
|
limit: t.searchText || t.archivedStatus === "all" ? void 0 : t.limit,
|
|
@@ -3572,16 +3573,16 @@ const zn = {
|
|
|
3572
3573
|
),
|
|
3573
3574
|
reminderId: s.string().optional().describe("Get a specific time-based reminder (relative or absolute) by its ID."),
|
|
3574
3575
|
locationReminderId: s.string().optional().describe("Get a specific location reminder by its ID.")
|
|
3575
|
-
},
|
|
3576
|
+
}, Gn = {
|
|
3576
3577
|
reminders: s.array(et).describe("The found reminders (time-based and location)."),
|
|
3577
3578
|
searchType: s.string().describe('The search type used: "task", "reminder", or "location_reminder".'),
|
|
3578
3579
|
searchId: s.string().describe("The ID used for the search."),
|
|
3579
3580
|
totalCount: s.number().describe("Total reminders in this response.")
|
|
3580
|
-
},
|
|
3581
|
+
}, Kn = {
|
|
3581
3582
|
name: b.FIND_REMINDERS,
|
|
3582
3583
|
description: "Find reminders by task ID (returns all reminder types), or get a specific reminder by its ID. Use reminderId for time-based reminders and locationReminderId for location reminders.",
|
|
3583
3584
|
parameters: zn,
|
|
3584
|
-
outputSchema:
|
|
3585
|
+
outputSchema: Gn,
|
|
3585
3586
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3586
3587
|
async execute(e, t) {
|
|
3587
3588
|
const { taskId: r, reminderId: o, locationReminderId: n } = e, a = [r, o, n].filter(Boolean);
|
|
@@ -3627,7 +3628,7 @@ const zn = {
|
|
|
3627
3628
|
})
|
|
3628
3629
|
]), d = [...i, ...c].map(ye);
|
|
3629
3630
|
return {
|
|
3630
|
-
textContent:
|
|
3631
|
+
textContent: Vn(d, r),
|
|
3631
3632
|
structuredContent: {
|
|
3632
3633
|
reminders: d,
|
|
3633
3634
|
searchType: "task",
|
|
@@ -3639,7 +3640,7 @@ const zn = {
|
|
|
3639
3640
|
throw new Error("One of taskId, reminderId, or locationReminderId must be provided.");
|
|
3640
3641
|
}
|
|
3641
3642
|
};
|
|
3642
|
-
function
|
|
3643
|
+
function Vn(e, t) {
|
|
3643
3644
|
if (e.length === 0)
|
|
3644
3645
|
return `No reminders found for task ${t}`;
|
|
3645
3646
|
const { timeBasedCount: r, locationCount: o } = Gt(e), n = [];
|
|
@@ -3653,22 +3654,22 @@ function Kn(e, t) {
|
|
|
3653
3654
|
}
|
|
3654
3655
|
return `Found ${n.join(" and ")} for task ${t}`;
|
|
3655
3656
|
}
|
|
3656
|
-
const { ADD_SECTIONS:
|
|
3657
|
+
const { ADD_SECTIONS: Jn } = b, Xn = {
|
|
3657
3658
|
projectId: s.string().min(1).describe(
|
|
3658
3659
|
'The ID of the project to search sections in. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
3659
3660
|
),
|
|
3660
3661
|
searchText: s.string().optional().describe(
|
|
3661
3662
|
'Search for a section by name (partial and case insensitive match). Supports wildcards (e.g. "work*" for prefix match). Use "\\*" for a literal asterisk. If omitted, all sections in the project are returned.'
|
|
3662
3663
|
)
|
|
3663
|
-
},
|
|
3664
|
+
}, Zn = {
|
|
3664
3665
|
sections: s.array(le).describe("The found sections."),
|
|
3665
3666
|
totalCount: s.number().describe("The total number of sections found."),
|
|
3666
3667
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
3667
|
-
},
|
|
3668
|
+
}, Qn = {
|
|
3668
3669
|
name: b.FIND_SECTIONS,
|
|
3669
3670
|
description: "Search for sections by name or other criteria in a project. When searching, uses server-side search to avoid fetching all sections.",
|
|
3670
|
-
parameters:
|
|
3671
|
-
outputSchema:
|
|
3671
|
+
parameters: Xn,
|
|
3672
|
+
outputSchema: Zn,
|
|
3672
3673
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3673
3674
|
async execute(e, t) {
|
|
3674
3675
|
const r = await V({
|
|
@@ -3676,12 +3677,12 @@ const { ADD_SECTIONS: Vn } = b, Jn = {
|
|
|
3676
3677
|
client: t
|
|
3677
3678
|
});
|
|
3678
3679
|
let o;
|
|
3679
|
-
e.searchText ? o = await
|
|
3680
|
+
e.searchText ? o = await Lr(t, e.searchText, r) : o = (await t.getSections({
|
|
3680
3681
|
projectId: r
|
|
3681
3682
|
})).results;
|
|
3682
3683
|
const n = o.map(Z);
|
|
3683
3684
|
return {
|
|
3684
|
-
textContent:
|
|
3685
|
+
textContent: ea({
|
|
3685
3686
|
sections: n,
|
|
3686
3687
|
projectId: e.projectId,
|
|
3687
3688
|
searchText: e.searchText
|
|
@@ -3694,16 +3695,16 @@ const { ADD_SECTIONS: Vn } = b, Jn = {
|
|
|
3694
3695
|
};
|
|
3695
3696
|
}
|
|
3696
3697
|
};
|
|
3697
|
-
function
|
|
3698
|
+
function ea({
|
|
3698
3699
|
sections: e,
|
|
3699
3700
|
projectId: t,
|
|
3700
3701
|
searchText: r
|
|
3701
3702
|
}) {
|
|
3702
3703
|
const o = [];
|
|
3703
|
-
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 ${
|
|
3704
|
+
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 ${Jn} to create sections`));
|
|
3704
3705
|
const n = r ? `Sections in project ${t} matching "${r}"` : `Sections in project ${t}`, a = e.length > 0 ? e.map((i) => ` ${i.name} • id=${i.id}`).join(`
|
|
3705
3706
|
`) : void 0;
|
|
3706
|
-
return
|
|
3707
|
+
return Y({
|
|
3707
3708
|
subject: n,
|
|
3708
3709
|
count: e.length,
|
|
3709
3710
|
previewLines: a,
|
|
@@ -3713,7 +3714,7 @@ function Qn({
|
|
|
3713
3714
|
function as(e) {
|
|
3714
3715
|
return /* @__PURE__ */ new Date(`${e}T00:00:00`);
|
|
3715
3716
|
}
|
|
3716
|
-
const
|
|
3717
|
+
const ta = {
|
|
3717
3718
|
startDate: s.string().regex(/^(\d{4}-\d{2}-\d{2}|today)$/).optional().describe("The start date to get the tasks for. Format: YYYY-MM-DD or 'today'."),
|
|
3718
3719
|
overdueOption: s.enum(["overdue-only", "include-overdue", "exclude-overdue"]).optional().describe(
|
|
3719
3720
|
"How to handle overdue tasks. 'overdue-only' to get only overdue tasks, 'include-overdue' to include overdue tasks along with tasks for the specified date(s), and 'exclude-overdue' to exclude overdue tasks. Default is 'include-overdue'."
|
|
@@ -3732,17 +3733,17 @@ const ea = {
|
|
|
3732
3733
|
"Filter when responsibleUser is omitted. 'assigned'=assigned to others; 'unassignedOrMe'=unassigned+mine; 'all'=everyone. Default: 'unassignedOrMe'."
|
|
3733
3734
|
),
|
|
3734
3735
|
...at
|
|
3735
|
-
},
|
|
3736
|
+
}, sa = {
|
|
3736
3737
|
tasks: s.array(B).describe("The found tasks."),
|
|
3737
3738
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
3738
3739
|
totalCount: s.number().describe("The total number of tasks in this page."),
|
|
3739
3740
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
3740
3741
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
3741
|
-
},
|
|
3742
|
+
}, ra = {
|
|
3742
3743
|
name: b.FIND_TASKS_BY_DATE,
|
|
3743
3744
|
description: "Get tasks by date range. startDate='today' includes overdue items. Default responsibleUserFiltering='unassignedOrMe' excludes others' tasks. Person-specific queries (summaries, plans, reports) require responsibleUser.",
|
|
3744
|
-
parameters:
|
|
3745
|
-
outputSchema:
|
|
3745
|
+
parameters: ta,
|
|
3746
|
+
outputSchema: sa,
|
|
3746
3747
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3747
3748
|
async execute(e, t) {
|
|
3748
3749
|
if (!e.startDate && e.overdueOption !== "overdue-only")
|
|
@@ -3765,7 +3766,7 @@ const ea = {
|
|
|
3765
3766
|
}
|
|
3766
3767
|
const i = it(e.labels, e.labelsOperator);
|
|
3767
3768
|
i.length > 0 && (a = ce(a, `(${i})`));
|
|
3768
|
-
const c =
|
|
3769
|
+
const c = Yt({
|
|
3769
3770
|
resolvedAssigneeId: o,
|
|
3770
3771
|
assigneeEmail: n,
|
|
3771
3772
|
responsibleUserFiltering: e.responsibleUserFiltering
|
|
@@ -3778,7 +3779,7 @@ const ea = {
|
|
|
3778
3779
|
limit: e.limit
|
|
3779
3780
|
});
|
|
3780
3781
|
return {
|
|
3781
|
-
textContent:
|
|
3782
|
+
textContent: oa({ tasks: l, args: e, nextCursor: d, assigneeEmail: n }),
|
|
3782
3783
|
structuredContent: {
|
|
3783
3784
|
tasks: l,
|
|
3784
3785
|
nextCursor: d ?? void 0,
|
|
@@ -3789,7 +3790,7 @@ const ea = {
|
|
|
3789
3790
|
};
|
|
3790
3791
|
}
|
|
3791
3792
|
};
|
|
3792
|
-
function
|
|
3793
|
+
function oa({
|
|
3793
3794
|
tasks: e,
|
|
3794
3795
|
args: t,
|
|
3795
3796
|
nextCursor: r,
|
|
@@ -3829,7 +3830,7 @@ function ra({
|
|
|
3829
3830
|
i.push(`Great job! No tasks for today${c}`);
|
|
3830
3831
|
} else
|
|
3831
3832
|
i.push("Expand date range with larger 'daysCount'"), i.push("Check today's tasks with startDate='today'");
|
|
3832
|
-
return
|
|
3833
|
+
return Y({
|
|
3833
3834
|
subject: a,
|
|
3834
3835
|
count: e.length,
|
|
3835
3836
|
limit: t.limit,
|
|
@@ -3839,13 +3840,13 @@ function ra({
|
|
|
3839
3840
|
zeroReasonHints: i
|
|
3840
3841
|
});
|
|
3841
3842
|
}
|
|
3842
|
-
const
|
|
3843
|
-
class
|
|
3843
|
+
const na = 300 * 1e3;
|
|
3844
|
+
class aa {
|
|
3844
3845
|
constructor() {
|
|
3845
3846
|
this.cache = null;
|
|
3846
3847
|
}
|
|
3847
3848
|
async getFilters(t) {
|
|
3848
|
-
if (this.cache && Date.now() - this.cache.timestamp <
|
|
3849
|
+
if (this.cache && Date.now() - this.cache.timestamp < na)
|
|
3849
3850
|
return this.cache.filters;
|
|
3850
3851
|
const o = ((await t.sync({
|
|
3851
3852
|
resourceTypes: ["filters"],
|
|
@@ -3902,7 +3903,7 @@ ${u}` + (l.length > 5 ? `
|
|
|
3902
3903
|
this.cache = null;
|
|
3903
3904
|
}
|
|
3904
3905
|
}
|
|
3905
|
-
const
|
|
3906
|
+
const ia = new aa(), { FIND_COMPLETED_TASKS: Tt, ADD_TASKS: wt } = b, ca = {
|
|
3906
3907
|
searchText: s.string().optional().describe("The text to search for in tasks."),
|
|
3907
3908
|
projectId: s.string().optional().describe(
|
|
3908
3909
|
'Find tasks in this project. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
@@ -3924,17 +3925,17 @@ const aa = new na(), { FIND_COMPLETED_TASKS: Tt, ADD_TASKS: wt } = b, ia = {
|
|
|
3924
3925
|
"The ID or name of a saved Todoist filter. The filter's query will be fetched and used to find tasks. Cannot be used with the `filter` parameter, projectId, sectionId, or parentId."
|
|
3925
3926
|
),
|
|
3926
3927
|
...at
|
|
3927
|
-
},
|
|
3928
|
+
}, da = {
|
|
3928
3929
|
tasks: s.array(B).describe("The found tasks."),
|
|
3929
3930
|
nextCursor: s.string().optional().describe("Cursor for the next page of results."),
|
|
3930
3931
|
totalCount: s.number().describe("The total number of tasks in this page."),
|
|
3931
3932
|
hasMore: s.boolean().describe("Whether there are more results available."),
|
|
3932
3933
|
appliedFilters: s.record(s.string(), s.unknown()).describe("The filters that were applied to the search.")
|
|
3933
|
-
},
|
|
3934
|
+
}, la = {
|
|
3934
3935
|
name: b.FIND_TASKS,
|
|
3935
3936
|
description: "Find tasks by text search, project/section/parent container, responsible user, labels, a raw Todoist filter string, or a saved filter by ID or name (filterIdOrName). At least one filter must be provided.",
|
|
3936
|
-
parameters:
|
|
3937
|
-
outputSchema:
|
|
3937
|
+
parameters: ca,
|
|
3938
|
+
outputSchema: da,
|
|
3938
3939
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3939
3940
|
async execute(e, t) {
|
|
3940
3941
|
const {
|
|
@@ -3964,7 +3965,7 @@ const aa = new na(), { FIND_COMPLETED_TASKS: Tt, ADD_TASKS: wt } = b, ia = {
|
|
|
3964
3965
|
'The `filter`/`filterIdOrName` parameter cannot be combined with projectId, sectionId, or parentId. Use filter syntax instead (e.g. "##ProjectName").'
|
|
3965
3966
|
);
|
|
3966
3967
|
let S = h;
|
|
3967
|
-
m && (S = (await
|
|
3968
|
+
m && (S = (await ia.resolveFilter(t, m)).filterQuery);
|
|
3968
3969
|
const j = await Xe(t, i), x = j?.userId, y = j?.email;
|
|
3969
3970
|
if (o || n || a) {
|
|
3970
3971
|
const D = {
|
|
@@ -3972,11 +3973,11 @@ const aa = new na(), { FIND_COMPLETED_TASKS: Tt, ADD_TASKS: wt } = b, ia = {
|
|
|
3972
3973
|
cursor: d ?? null
|
|
3973
3974
|
};
|
|
3974
3975
|
o && (D.projectId = await V({ projectId: o, user: f })), n && (D.sectionId = n), a && (D.parentId = a);
|
|
3975
|
-
const { results: fe, nextCursor:
|
|
3976
|
+
const { results: fe, nextCursor: q } = await t.getTasks(D), De = fe.map(U);
|
|
3976
3977
|
let M = r ? De.filter(
|
|
3977
3978
|
(te) => te.content.toLowerCase().includes(r.toLowerCase()) || te.description?.toLowerCase().includes(r.toLowerCase())
|
|
3978
3979
|
) : De;
|
|
3979
|
-
return M =
|
|
3980
|
+
return M = Pr({
|
|
3980
3981
|
tasks: M,
|
|
3981
3982
|
resolvedAssigneeId: x,
|
|
3982
3983
|
currentUserId: f.id,
|
|
@@ -3989,15 +3990,15 @@ const aa = new na(), { FIND_COMPLETED_TASKS: Tt, ADD_TASKS: wt } = b, ia = {
|
|
|
3989
3990
|
textContent: Oe({
|
|
3990
3991
|
tasks: M,
|
|
3991
3992
|
args: e,
|
|
3992
|
-
nextCursor:
|
|
3993
|
+
nextCursor: q,
|
|
3993
3994
|
isContainerSearch: !0,
|
|
3994
3995
|
assigneeEmail: y
|
|
3995
3996
|
}),
|
|
3996
3997
|
structuredContent: {
|
|
3997
3998
|
tasks: M,
|
|
3998
|
-
nextCursor:
|
|
3999
|
+
nextCursor: q ?? void 0,
|
|
3999
4000
|
totalCount: M.length,
|
|
4000
|
-
hasMore: !!
|
|
4001
|
+
hasMore: !!q,
|
|
4001
4002
|
appliedFilters: e
|
|
4002
4003
|
}
|
|
4003
4004
|
};
|
|
@@ -4008,19 +4009,19 @@ const aa = new na(), { FIND_COMPLETED_TASKS: Tt, ADD_TASKS: wt } = b, ia = {
|
|
|
4008
4009
|
lang: "en",
|
|
4009
4010
|
limit: l,
|
|
4010
4011
|
cursor: d ?? null
|
|
4011
|
-
}),
|
|
4012
|
+
}), q = D.map(U);
|
|
4012
4013
|
return {
|
|
4013
4014
|
textContent: Oe({
|
|
4014
|
-
tasks:
|
|
4015
|
+
tasks: q,
|
|
4015
4016
|
args: e,
|
|
4016
4017
|
nextCursor: fe,
|
|
4017
4018
|
isContainerSearch: !1,
|
|
4018
4019
|
assigneeEmail: y
|
|
4019
4020
|
}),
|
|
4020
4021
|
structuredContent: {
|
|
4021
|
-
tasks:
|
|
4022
|
+
tasks: q,
|
|
4022
4023
|
nextCursor: fe ?? void 0,
|
|
4023
|
-
totalCount:
|
|
4024
|
+
totalCount: q.length,
|
|
4024
4025
|
hasMore: !!fe,
|
|
4025
4026
|
appliedFilters: e
|
|
4026
4027
|
}
|
|
@@ -4030,7 +4031,7 @@ const aa = new na(), { FIND_COMPLETED_TASKS: Tt, ADD_TASKS: wt } = b, ia = {
|
|
|
4030
4031
|
r && (v = ce(v, `search: ${r}`));
|
|
4031
4032
|
const $ = it(u, p);
|
|
4032
4033
|
if (v = ce(v, $), !(m && !i && !c)) {
|
|
4033
|
-
const D =
|
|
4034
|
+
const D = Yt({
|
|
4034
4035
|
resolvedAssigneeId: x,
|
|
4035
4036
|
assigneeEmail: y,
|
|
4036
4037
|
responsibleUserFiltering: c
|
|
@@ -4061,7 +4062,7 @@ const aa = new na(), { FIND_COMPLETED_TASKS: Tt, ADD_TASKS: wt } = b, ia = {
|
|
|
4061
4062
|
};
|
|
4062
4063
|
}
|
|
4063
4064
|
};
|
|
4064
|
-
function
|
|
4065
|
+
function ua(e) {
|
|
4065
4066
|
if (e.projectId) {
|
|
4066
4067
|
const t = [
|
|
4067
4068
|
e.searchText ? "No tasks in project match search" : "Project has no tasks yet"
|
|
@@ -4096,7 +4097,7 @@ function Oe({
|
|
|
4096
4097
|
const l = t.labels.map((d) => `@${d}`).join(t.labelsOperator === "and" ? " & " : " | ");
|
|
4097
4098
|
i.push(`labels: ${l}`);
|
|
4098
4099
|
}
|
|
4099
|
-
e.length === 0 && c.push(...
|
|
4100
|
+
e.length === 0 && c.push(...ua(t));
|
|
4100
4101
|
} else {
|
|
4101
4102
|
const l = n || t.responsibleUser, d = [];
|
|
4102
4103
|
if (t.filter && d.push(`filter: ${t.filter}`), t.searchText && d.push(`"${t.searchText}"`), t.responsibleUser && d.push(`assigned to ${l}`), t.labels && t.labels.length > 0) {
|
|
@@ -4115,7 +4116,7 @@ function Oe({
|
|
|
4115
4116
|
t.searchText && (c.push("Try broader search terms"), c.push("Verify spelling and try partial words"), t.responsibleUser || c.push(`Check completed tasks with ${Tt}`));
|
|
4116
4117
|
}
|
|
4117
4118
|
}
|
|
4118
|
-
return
|
|
4119
|
+
return Y({
|
|
4119
4120
|
subject: a,
|
|
4120
4121
|
count: e.length,
|
|
4121
4122
|
limit: t.limit,
|
|
@@ -4125,7 +4126,7 @@ function Oe({
|
|
|
4125
4126
|
zeroReasonHints: c
|
|
4126
4127
|
});
|
|
4127
4128
|
}
|
|
4128
|
-
const
|
|
4129
|
+
const pa = {
|
|
4129
4130
|
projectId: s.string().min(1).optional().describe(
|
|
4130
4131
|
"Optional project ID. If provided, shows detailed overview of that project. If omitted, shows overview of all projects."
|
|
4131
4132
|
)
|
|
@@ -4144,7 +4145,7 @@ const ua = {
|
|
|
4144
4145
|
),
|
|
4145
4146
|
children: s.array(is).describe("Nested child projects.")
|
|
4146
4147
|
})
|
|
4147
|
-
),
|
|
4148
|
+
), ha = {
|
|
4148
4149
|
type: s.enum(["account_overview", "project_overview"]).describe("The type of overview returned."),
|
|
4149
4150
|
totalProjects: s.number().optional().describe("Total number of projects (account overview only)."),
|
|
4150
4151
|
totalTasks: s.number().optional().describe("Total number of tasks."),
|
|
@@ -4178,7 +4179,7 @@ const ua = {
|
|
|
4178
4179
|
tasksWithoutSection: s.number()
|
|
4179
4180
|
}).optional().describe("Statistics object (project overview only).")
|
|
4180
4181
|
};
|
|
4181
|
-
function
|
|
4182
|
+
function ma(e) {
|
|
4182
4183
|
const t = {};
|
|
4183
4184
|
for (const n of e)
|
|
4184
4185
|
t[n.id] = {
|
|
@@ -4203,7 +4204,7 @@ function ha(e) {
|
|
|
4203
4204
|
}
|
|
4204
4205
|
return o(r), r;
|
|
4205
4206
|
}
|
|
4206
|
-
async function
|
|
4207
|
+
async function fa(e, t) {
|
|
4207
4208
|
const r = {};
|
|
4208
4209
|
return await Promise.all(
|
|
4209
4210
|
t.map(async (o) => {
|
|
@@ -4239,11 +4240,11 @@ function vt(e) {
|
|
|
4239
4240
|
}
|
|
4240
4241
|
return r;
|
|
4241
4242
|
}
|
|
4242
|
-
function
|
|
4243
|
+
function ze(e, t = "") {
|
|
4243
4244
|
const r = [];
|
|
4244
4245
|
for (const o of e) {
|
|
4245
4246
|
const n = `id=${o.id}`, a = o.dueDate ? `; due=${o.dueDate}` : "", i = `; content=${o.content}`;
|
|
4246
|
-
r.push(`${t}- ${n}${a}${i}`), o.children.length > 0 && r.push(...
|
|
4247
|
+
r.push(`${t}- ${n}${a}${i}`), o.children.length > 0 && r.push(...ze(o.children, `${t} `));
|
|
4247
4248
|
}
|
|
4248
4249
|
return r;
|
|
4249
4250
|
}
|
|
@@ -4260,7 +4261,7 @@ function ds(e, t) {
|
|
|
4260
4261
|
)
|
|
4261
4262
|
};
|
|
4262
4263
|
}
|
|
4263
|
-
async function
|
|
4264
|
+
async function ba(e, t) {
|
|
4264
4265
|
let r = [], o;
|
|
4265
4266
|
do {
|
|
4266
4267
|
const { results: n, nextCursor: a } = await e.getTasks({
|
|
@@ -4272,12 +4273,12 @@ async function fa(e, t) {
|
|
|
4272
4273
|
} while (o);
|
|
4273
4274
|
return r;
|
|
4274
4275
|
}
|
|
4275
|
-
async function
|
|
4276
|
+
async function ga(e, t) {
|
|
4276
4277
|
const { results: r } = await e.getSections({ projectId: t });
|
|
4277
4278
|
return r;
|
|
4278
4279
|
}
|
|
4279
|
-
async function
|
|
4280
|
-
const { results: t } = await e.getProjects({}), r = t.find((p) => W(p) && p.inboxProject === !0), o = t.filter((p) => !W(p) || p.inboxProject !== !0), n =
|
|
4280
|
+
async function ya(e) {
|
|
4281
|
+
const { results: t } = await e.getProjects({}), r = t.find((p) => W(p) && p.inboxProject === !0), o = t.filter((p) => !W(p) || p.inboxProject !== !0), n = ma(o), a = t.map((p) => p.id), i = await fa(e, a), c = ["# Personal Projects", ""];
|
|
4281
4282
|
if (r) {
|
|
4282
4283
|
c.push(`- Inbox Project: ${r.name} (id=${r.id})`);
|
|
4283
4284
|
for (const p of i[r.id] || [])
|
|
@@ -4314,11 +4315,11 @@ async function ga(e) {
|
|
|
4314
4315
|
};
|
|
4315
4316
|
return { textContent: d, structuredContent: u };
|
|
4316
4317
|
}
|
|
4317
|
-
async function
|
|
4318
|
+
async function ka(e, t) {
|
|
4318
4319
|
const [r, o, n] = await Promise.all([
|
|
4319
4320
|
e.getProject(t),
|
|
4320
|
-
|
|
4321
|
-
|
|
4321
|
+
ga(e, t),
|
|
4322
|
+
ba(e, t)
|
|
4322
4323
|
]), a = {};
|
|
4323
4324
|
for (const u of o)
|
|
4324
4325
|
a[u.id] = [];
|
|
@@ -4329,7 +4330,7 @@ async function ya(e, t) {
|
|
|
4329
4330
|
if (i.length > 0) {
|
|
4330
4331
|
c.push("");
|
|
4331
4332
|
const u = vt(i);
|
|
4332
|
-
c.push(...
|
|
4333
|
+
c.push(...ze(u));
|
|
4333
4334
|
}
|
|
4334
4335
|
for (const u of o) {
|
|
4335
4336
|
c.push(""), c.push(`## ${u.name}`);
|
|
@@ -4337,7 +4338,7 @@ async function ya(e, t) {
|
|
|
4337
4338
|
if (!p?.length)
|
|
4338
4339
|
continue;
|
|
4339
4340
|
const h = vt(p);
|
|
4340
|
-
c.push(...
|
|
4341
|
+
c.push(...ze(h));
|
|
4341
4342
|
}
|
|
4342
4343
|
const l = c.join(`
|
|
4343
4344
|
`), d = {
|
|
@@ -4360,27 +4361,27 @@ async function ya(e, t) {
|
|
|
4360
4361
|
};
|
|
4361
4362
|
return { textContent: l, structuredContent: d };
|
|
4362
4363
|
}
|
|
4363
|
-
const
|
|
4364
|
+
const Ta = {
|
|
4364
4365
|
name: b.GET_OVERVIEW,
|
|
4365
4366
|
description: "Get a Markdown overview. If no projectId is provided, shows all projects with hierarchy and sections (useful for navigation). If projectId is provided, shows detailed overview of that specific project including all tasks grouped by sections.",
|
|
4366
|
-
parameters:
|
|
4367
|
-
outputSchema:
|
|
4367
|
+
parameters: pa,
|
|
4368
|
+
outputSchema: ha,
|
|
4368
4369
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4369
4370
|
async execute(e, t) {
|
|
4370
|
-
const r = e.projectId ? await
|
|
4371
|
+
const r = e.projectId ? await ka(t, e.projectId) : await ya(t);
|
|
4371
4372
|
return {
|
|
4372
4373
|
textContent: r.textContent,
|
|
4373
4374
|
structuredContent: r.structuredContent
|
|
4374
4375
|
};
|
|
4375
4376
|
}
|
|
4376
|
-
},
|
|
4377
|
+
}, wa = {}, ae = s.object({
|
|
4377
4378
|
count: s.number().describe("Number of consecutive periods in this streak."),
|
|
4378
4379
|
start: s.string().describe("Start date of the streak."),
|
|
4379
4380
|
end: s.string().describe("End date of the streak.")
|
|
4380
4381
|
}), It = s.object({
|
|
4381
4382
|
id: s.string().describe("Project ID."),
|
|
4382
4383
|
completed: s.number().describe("Number of tasks completed in this project.")
|
|
4383
|
-
}),
|
|
4384
|
+
}), va = {
|
|
4384
4385
|
completedCount: s.number().describe("Total number of completed tasks (all-time)."),
|
|
4385
4386
|
daysItems: s.array(
|
|
4386
4387
|
s.object({
|
|
@@ -4429,11 +4430,11 @@ const ka = {
|
|
|
4429
4430
|
})
|
|
4430
4431
|
).describe("Recent karma change events with reasons."),
|
|
4431
4432
|
projectColors: s.record(s.string(), s.string()).describe("Map of project ID to color key.")
|
|
4432
|
-
},
|
|
4433
|
+
}, Ia = {
|
|
4433
4434
|
name: b.GET_PRODUCTIVITY_STATS,
|
|
4434
4435
|
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.",
|
|
4435
|
-
parameters:
|
|
4436
|
-
outputSchema:
|
|
4436
|
+
parameters: wa,
|
|
4437
|
+
outputSchema: va,
|
|
4437
4438
|
annotations: {
|
|
4438
4439
|
readOnlyHint: !0,
|
|
4439
4440
|
destructiveHint: !1,
|
|
@@ -4442,7 +4443,7 @@ const ka = {
|
|
|
4442
4443
|
async execute(e, t) {
|
|
4443
4444
|
const r = await t.getProductivityStats();
|
|
4444
4445
|
return {
|
|
4445
|
-
textContent:
|
|
4446
|
+
textContent: ja(r),
|
|
4446
4447
|
structuredContent: {
|
|
4447
4448
|
completedCount: r.completedCount,
|
|
4448
4449
|
daysItems: r.daysItems,
|
|
@@ -4469,7 +4470,7 @@ const ka = {
|
|
|
4469
4470
|
};
|
|
4470
4471
|
}
|
|
4471
4472
|
};
|
|
4472
|
-
function
|
|
4473
|
+
function ja(e) {
|
|
4473
4474
|
const t = [
|
|
4474
4475
|
"# Productivity Statistics",
|
|
4475
4476
|
"",
|
|
@@ -4499,11 +4500,11 @@ function Ia(e) {
|
|
|
4499
4500
|
return t.join(`
|
|
4500
4501
|
`);
|
|
4501
4502
|
}
|
|
4502
|
-
const
|
|
4503
|
+
const Sa = {
|
|
4503
4504
|
projectId: s.string().min(1).describe("The ID of the project to get activity stats for."),
|
|
4504
4505
|
weeks: s.number().int().min(1).max(12).optional().describe("Number of weeks of activity data to retrieve (1-12, default 2)."),
|
|
4505
4506
|
includeWeeklyCounts: s.boolean().optional().describe("Include weekly rollup counts alongside daily counts.")
|
|
4506
|
-
},
|
|
4507
|
+
}, Ca = {
|
|
4507
4508
|
projectId: s.string().describe("The project ID."),
|
|
4508
4509
|
dayItems: s.array(
|
|
4509
4510
|
s.object({
|
|
@@ -4519,7 +4520,7 @@ const ja = {
|
|
|
4519
4520
|
})
|
|
4520
4521
|
).nullable().describe("Weekly completion rollups. Only included when includeWeeklyCounts is true.")
|
|
4521
4522
|
};
|
|
4522
|
-
function
|
|
4523
|
+
function $a(e, t) {
|
|
4523
4524
|
const r = [`# Activity Stats: Project ${e}`, ""];
|
|
4524
4525
|
if (t.dayItems.length > 0) {
|
|
4525
4526
|
r.push("## Daily Activity");
|
|
@@ -4535,11 +4536,11 @@ function Ca(e, t) {
|
|
|
4535
4536
|
return r.join(`
|
|
4536
4537
|
`);
|
|
4537
4538
|
}
|
|
4538
|
-
const
|
|
4539
|
+
const Da = {
|
|
4539
4540
|
name: b.GET_PROJECT_ACTIVITY_STATS,
|
|
4540
4541
|
description: "Get daily and optional weekly task completion counts for a project over a configurable time window (1-12 weeks). Useful for identifying completion trends and patterns.",
|
|
4541
|
-
parameters:
|
|
4542
|
-
outputSchema:
|
|
4542
|
+
parameters: Sa,
|
|
4543
|
+
outputSchema: Ca,
|
|
4543
4544
|
annotations: {
|
|
4544
4545
|
readOnlyHint: !0,
|
|
4545
4546
|
destructiveHint: !1,
|
|
@@ -4551,7 +4552,7 @@ const $a = {
|
|
|
4551
4552
|
includeWeeklyCounts: n
|
|
4552
4553
|
});
|
|
4553
4554
|
return {
|
|
4554
|
-
textContent:
|
|
4555
|
+
textContent: $a(r, a),
|
|
4555
4556
|
structuredContent: {
|
|
4556
4557
|
projectId: r,
|
|
4557
4558
|
dayItems: a.dayItems,
|
|
@@ -4559,15 +4560,15 @@ const $a = {
|
|
|
4559
4560
|
}
|
|
4560
4561
|
};
|
|
4561
4562
|
}
|
|
4562
|
-
},
|
|
4563
|
+
}, Aa = {
|
|
4563
4564
|
projectId: s.string().min(1).describe("The ID of the project to check health for."),
|
|
4564
4565
|
includeContext: s.boolean().default(!1).describe(
|
|
4565
4566
|
"Include detailed health context with project metrics and task-level data. May produce large output for projects with many tasks."
|
|
4566
4567
|
)
|
|
4567
|
-
},
|
|
4568
|
+
}, xa = s.object({
|
|
4568
4569
|
taskId: s.string().describe("The ID of the task this recommendation is for."),
|
|
4569
4570
|
recommendation: s.string().describe("The recommendation for this task.")
|
|
4570
|
-
}),
|
|
4571
|
+
}), Ea = s.object({
|
|
4571
4572
|
id: s.string().describe("The task ID."),
|
|
4572
4573
|
content: s.string().describe("The task content/title."),
|
|
4573
4574
|
priority: s.string().describe("The task priority (1-4)."),
|
|
@@ -4575,7 +4576,7 @@ const $a = {
|
|
|
4575
4576
|
deadline: s.string().nullable().optional().describe("The deadline date string, if set."),
|
|
4576
4577
|
isCompleted: s.boolean().describe("Whether the task is completed."),
|
|
4577
4578
|
labels: s.array(s.string()).describe("Labels applied to this task.")
|
|
4578
|
-
}),
|
|
4579
|
+
}), Oa = {
|
|
4579
4580
|
projectId: s.string().describe("The project ID."),
|
|
4580
4581
|
projectName: s.string().describe("The project name."),
|
|
4581
4582
|
progress: s.object({
|
|
@@ -4587,7 +4588,7 @@ const $a = {
|
|
|
4587
4588
|
status: s.enum(Ge).describe("The overall health status of the project."),
|
|
4588
4589
|
description: s.string().nullable().optional().describe("Detailed description of the health assessment."),
|
|
4589
4590
|
descriptionSummary: s.string().nullable().optional().describe("Brief summary of the health assessment."),
|
|
4590
|
-
taskRecommendations: s.array(
|
|
4591
|
+
taskRecommendations: s.array(xa).nullable().optional().describe("Specific recommendations for individual tasks."),
|
|
4591
4592
|
isStale: s.boolean().describe("Whether the health data is stale and may need refreshing."),
|
|
4592
4593
|
updateInProgress: s.boolean().describe("Whether a health analysis update is currently in progress."),
|
|
4593
4594
|
updatedAt: s.string().nullable().optional().describe("When the health assessment was last updated.")
|
|
@@ -4602,12 +4603,12 @@ const $a = {
|
|
|
4602
4603
|
tasksCompletedThisWeek: s.number().describe("Tasks completed in the current week."),
|
|
4603
4604
|
averageCompletionTime: s.number().nullable().describe("Average task completion time in days, if available.")
|
|
4604
4605
|
}).describe("Aggregated project metrics."),
|
|
4605
|
-
tasks: s.array(
|
|
4606
|
+
tasks: s.array(Ea).describe("Tasks in the project.")
|
|
4606
4607
|
}).optional().describe(
|
|
4607
4608
|
"Detailed project context with metrics and task data. Only included when includeContext is true."
|
|
4608
4609
|
)
|
|
4609
4610
|
};
|
|
4610
|
-
async function
|
|
4611
|
+
async function Pa(e, t, r) {
|
|
4611
4612
|
if (r) {
|
|
4612
4613
|
const [a, i, c] = await Promise.all([
|
|
4613
4614
|
e.getProjectProgress(t),
|
|
@@ -4622,7 +4623,7 @@ async function Oa(e, t, r) {
|
|
|
4622
4623
|
]);
|
|
4623
4624
|
return { progress: o, health: n };
|
|
4624
4625
|
}
|
|
4625
|
-
function
|
|
4626
|
+
function Ra(e, { progress: t, health: r, context: o }) {
|
|
4626
4627
|
const n = [`# Project Health: ${e}`, ""];
|
|
4627
4628
|
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(
|
|
4628
4629
|
`**Completed:** ${t.completedCount} | **Active:** ${t.activeCount} | **Progress:** ${t.progressPercent}%`
|
|
@@ -4645,18 +4646,18 @@ function Pa(e, { progress: t, health: r, context: o }) {
|
|
|
4645
4646
|
return n.join(`
|
|
4646
4647
|
`);
|
|
4647
4648
|
}
|
|
4648
|
-
const
|
|
4649
|
+
const _a = {
|
|
4649
4650
|
name: b.GET_PROJECT_HEALTH,
|
|
4650
4651
|
description: "Get a comprehensive health assessment for a project including completion progress, health status (EXCELLENT, ON_TRACK, AT_RISK, CRITICAL), and optional detailed context with project metrics and task-level recommendations. Use includeContext=true for full detail including task data.",
|
|
4651
|
-
parameters:
|
|
4652
|
-
outputSchema:
|
|
4652
|
+
parameters: Aa,
|
|
4653
|
+
outputSchema: Oa,
|
|
4653
4654
|
annotations: {
|
|
4654
4655
|
readOnlyHint: !0,
|
|
4655
4656
|
destructiveHint: !1,
|
|
4656
4657
|
idempotentHint: !0
|
|
4657
4658
|
},
|
|
4658
4659
|
async execute(e, t) {
|
|
4659
|
-
const { projectId: r, includeContext: o } = e, n = await
|
|
4660
|
+
const { projectId: r, includeContext: o } = e, n = await Pa(t, r, o), a = n.context?.projectName ?? `Project ${r}`, i = Ra(a, n), c = n.context ? {
|
|
4660
4661
|
projectDescription: n.context.projectDescription,
|
|
4661
4662
|
projectMetrics: n.context.projectMetrics,
|
|
4662
4663
|
tasks: n.context.tasks.map((l) => ({
|
|
@@ -4692,12 +4693,12 @@ const Ra = {
|
|
|
4692
4693
|
}
|
|
4693
4694
|
};
|
|
4694
4695
|
}
|
|
4695
|
-
},
|
|
4696
|
+
}, Ua = {
|
|
4696
4697
|
workspaceIdOrName: s.string().min(1).describe(
|
|
4697
4698
|
"The workspace ID or name. Supports exact ID, exact name match (case-insensitive), or unique partial name match."
|
|
4698
4699
|
),
|
|
4699
4700
|
projectIds: s.array(s.string().min(1)).min(1).optional().describe("Optional list of project IDs to scope insights to specific projects.")
|
|
4700
|
-
},
|
|
4701
|
+
}, Na = s.object({
|
|
4701
4702
|
projectId: s.string().describe("The project ID."),
|
|
4702
4703
|
health: s.object({
|
|
4703
4704
|
status: s.enum(Ge).describe("The health status of the project."),
|
|
@@ -4709,16 +4710,16 @@ const Ra = {
|
|
|
4709
4710
|
activeCount: s.number().describe("Number of active tasks."),
|
|
4710
4711
|
progressPercent: s.number().describe("Completion percentage (0-100).")
|
|
4711
4712
|
}).nullable().describe("Progress data for this project, if available.")
|
|
4712
|
-
}),
|
|
4713
|
+
}), La = {
|
|
4713
4714
|
workspaceId: s.string().describe("The resolved workspace ID."),
|
|
4714
4715
|
workspaceName: s.string().describe("The resolved workspace name."),
|
|
4715
4716
|
folderId: s.string().nullable().describe("The folder ID, if applicable."),
|
|
4716
|
-
projectInsights: s.array(
|
|
4717
|
-
},
|
|
4717
|
+
projectInsights: s.array(Na).describe("Health and progress insights for each project in the workspace.")
|
|
4718
|
+
}, Ma = {
|
|
4718
4719
|
name: b.GET_WORKSPACE_INSIGHTS,
|
|
4719
4720
|
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.",
|
|
4720
|
-
parameters:
|
|
4721
|
-
outputSchema:
|
|
4721
|
+
parameters: Ua,
|
|
4722
|
+
outputSchema: La,
|
|
4722
4723
|
annotations: {
|
|
4723
4724
|
readOnlyHint: !0,
|
|
4724
4725
|
destructiveHint: !1,
|
|
@@ -4758,7 +4759,7 @@ const Ra = {
|
|
|
4758
4759
|
}
|
|
4759
4760
|
};
|
|
4760
4761
|
}
|
|
4761
|
-
},
|
|
4762
|
+
}, Fa = {}, Ha = {
|
|
4762
4763
|
id: s.string().describe("The unique identifier for the workspace."),
|
|
4763
4764
|
name: s.string().describe("The name of the workspace."),
|
|
4764
4765
|
plan: s.enum(Cs).describe("The workspace plan type."),
|
|
@@ -4767,12 +4768,12 @@ const Ra = {
|
|
|
4767
4768
|
isGuestAllowed: s.boolean().describe("Whether guests are allowed in the workspace."),
|
|
4768
4769
|
createdAt: s.string().optional().describe("The ISO 8601 timestamp when the workspace was created."),
|
|
4769
4770
|
creatorId: s.string().describe("The ID of the user who created the workspace.")
|
|
4770
|
-
},
|
|
4771
|
+
}, Wa = {
|
|
4771
4772
|
type: s.literal("workspaces").describe("The type of the response."),
|
|
4772
|
-
workspaces: s.array(s.object(
|
|
4773
|
+
workspaces: s.array(s.object(Ha)).describe("List of workspaces."),
|
|
4773
4774
|
count: s.number().describe("The total number of workspaces.")
|
|
4774
4775
|
};
|
|
4775
|
-
async function
|
|
4776
|
+
async function Ba(e) {
|
|
4776
4777
|
const r = (await e.getWorkspaces()).map((i) => ({
|
|
4777
4778
|
id: i.id,
|
|
4778
4779
|
name: i.name,
|
|
@@ -4803,22 +4804,22 @@ async function Wa(e) {
|
|
|
4803
4804
|
};
|
|
4804
4805
|
return { textContent: n, structuredContent: a };
|
|
4805
4806
|
}
|
|
4806
|
-
const
|
|
4807
|
+
const Ya = {
|
|
4807
4808
|
name: b.LIST_WORKSPACES,
|
|
4808
4809
|
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.",
|
|
4809
|
-
parameters:
|
|
4810
|
-
outputSchema:
|
|
4810
|
+
parameters: Fa,
|
|
4811
|
+
outputSchema: Wa,
|
|
4811
4812
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4812
4813
|
async execute(e, t) {
|
|
4813
|
-
const r = await
|
|
4814
|
+
const r = await Ba(t);
|
|
4814
4815
|
return {
|
|
4815
4816
|
textContent: r.textContent,
|
|
4816
4817
|
structuredContent: r.structuredContent
|
|
4817
4818
|
};
|
|
4818
4819
|
}
|
|
4819
|
-
}, { FIND_TASKS: qa, FIND_PROJECT_COLLABORATORS: jt, UPDATE_TASKS: za } = b,
|
|
4820
|
+
}, { FIND_TASKS: qa, FIND_PROJECT_COLLABORATORS: jt, UPDATE_TASKS: za } = b, Ga = 50, Ka = {
|
|
4820
4821
|
operation: s.enum(["assign", "unassign", "reassign"]).describe("The assignment operation to perform."),
|
|
4821
|
-
taskIds: s.array(s.string()).min(1).max(
|
|
4822
|
+
taskIds: s.array(s.string()).min(1).max(Ga).describe("The IDs of the tasks to operate on (max 50)."),
|
|
4822
4823
|
responsibleUser: s.string().optional().describe(
|
|
4823
4824
|
'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.'
|
|
4824
4825
|
),
|
|
@@ -4826,7 +4827,7 @@ const Ba = {
|
|
|
4826
4827
|
"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."
|
|
4827
4828
|
),
|
|
4828
4829
|
dryRun: s.boolean().optional().default(!1).describe("If true, validates operations without executing them.")
|
|
4829
|
-
},
|
|
4830
|
+
}, Va = {
|
|
4830
4831
|
results: s.array(
|
|
4831
4832
|
s.object({
|
|
4832
4833
|
taskId: s.string().describe("The ID of the task."),
|
|
@@ -4842,11 +4843,11 @@ const Ba = {
|
|
|
4842
4843
|
failed: s.number().describe("Number of failed operations."),
|
|
4843
4844
|
dryRun: s.boolean().describe("Whether this was a dry run.")
|
|
4844
4845
|
}).optional().describe("Summary of the operation.")
|
|
4845
|
-
},
|
|
4846
|
+
}, Ja = {
|
|
4846
4847
|
name: b.MANAGE_ASSIGNMENTS,
|
|
4847
4848
|
description: "Bulk assignment operations for multiple tasks. Supports assign, unassign, and reassign operations with atomic rollback on failures.",
|
|
4848
|
-
parameters:
|
|
4849
|
-
outputSchema:
|
|
4849
|
+
parameters: Ka,
|
|
4850
|
+
outputSchema: Va,
|
|
4850
4851
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
4851
4852
|
async execute(e, t) {
|
|
4852
4853
|
const { operation: r, taskIds: o, responsibleUser: n, fromAssigneeUser: a, dryRun: i } = e;
|
|
@@ -5082,17 +5083,17 @@ function Pe({
|
|
|
5082
5083
|
`, c += `• Use dryRun=true to validate before executing
|
|
5083
5084
|
`), c;
|
|
5084
5085
|
}
|
|
5085
|
-
const
|
|
5086
|
+
const Xa = {
|
|
5086
5087
|
action: s.enum(["archive", "unarchive"]).describe("The action to perform on the project."),
|
|
5087
5088
|
projectId: s.string().min(1).describe("The ID of the project.")
|
|
5088
|
-
},
|
|
5089
|
+
}, Za = {
|
|
5089
5090
|
project: X.describe("The updated project."),
|
|
5090
5091
|
success: s.boolean().describe("Whether the action was successful.")
|
|
5091
|
-
},
|
|
5092
|
+
}, Qa = {
|
|
5092
5093
|
name: b.PROJECT_MANAGEMENT,
|
|
5093
5094
|
description: "Archive or unarchive a project by its ID.",
|
|
5094
|
-
parameters:
|
|
5095
|
-
outputSchema:
|
|
5095
|
+
parameters: Xa,
|
|
5096
|
+
outputSchema: Za,
|
|
5096
5097
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
|
|
5097
5098
|
async execute(e, t) {
|
|
5098
5099
|
const r = e.action === "archive" ? await t.archiveProject(e.projectId) : await t.unarchiveProject(e.projectId), o = J(r);
|
|
@@ -5104,7 +5105,7 @@ const Ja = {
|
|
|
5104
5105
|
}
|
|
5105
5106
|
};
|
|
5106
5107
|
}
|
|
5107
|
-
},
|
|
5108
|
+
}, ei = {
|
|
5108
5109
|
action: s.enum(["move-to-workspace", "move-to-personal"]).describe("The action to perform on the project."),
|
|
5109
5110
|
projectId: s.string().min(1).describe("The ID of the project to move."),
|
|
5110
5111
|
workspaceId: s.string().min(1).optional().describe("The target workspace ID. Required when action is move-to-workspace."),
|
|
@@ -5112,14 +5113,14 @@ const Ja = {
|
|
|
5112
5113
|
visibility: s.enum(["restricted", "team", "public"]).optional().describe(
|
|
5113
5114
|
"Optional access visibility for the project in the workspace (restricted, team, or public)."
|
|
5114
5115
|
)
|
|
5115
|
-
},
|
|
5116
|
+
}, ti = {
|
|
5116
5117
|
project: X.describe("The moved project."),
|
|
5117
5118
|
success: s.boolean().describe("Whether the move was successful.")
|
|
5118
|
-
},
|
|
5119
|
+
}, si = {
|
|
5119
5120
|
name: b.PROJECT_MOVE,
|
|
5120
5121
|
description: "Move a project between personal and workspace contexts.",
|
|
5121
|
-
parameters:
|
|
5122
|
-
outputSchema:
|
|
5122
|
+
parameters: ei,
|
|
5123
|
+
outputSchema: ti,
|
|
5123
5124
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
|
|
5124
5125
|
async execute(e, t) {
|
|
5125
5126
|
let r;
|
|
@@ -5142,7 +5143,7 @@ const Ja = {
|
|
|
5142
5143
|
}
|
|
5143
5144
|
};
|
|
5144
5145
|
}
|
|
5145
|
-
}, ls = ["project", "section"],
|
|
5146
|
+
}, ls = ["project", "section"], ri = {
|
|
5146
5147
|
type: s.enum(ls).describe(
|
|
5147
5148
|
'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.'
|
|
5148
5149
|
),
|
|
@@ -5159,17 +5160,17 @@ const Ja = {
|
|
|
5159
5160
|
).min(1).describe(
|
|
5160
5161
|
"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."
|
|
5161
5162
|
)
|
|
5162
|
-
},
|
|
5163
|
+
}, oi = {
|
|
5163
5164
|
type: s.enum(ls).describe("The type of entity that was reordered/moved."),
|
|
5164
5165
|
movedCount: s.number().describe("The number of entities moved to a new parent."),
|
|
5165
5166
|
reorderedCount: s.number().describe("The number of entities reordered."),
|
|
5166
5167
|
affectedIds: s.array(s.string()).describe("The IDs of all affected entities."),
|
|
5167
5168
|
success: s.boolean().describe("Whether the operation was successful.")
|
|
5168
|
-
},
|
|
5169
|
+
}, ni = {
|
|
5169
5170
|
name: b.REORDER_OBJECTS,
|
|
5170
5171
|
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.',
|
|
5171
|
-
parameters:
|
|
5172
|
-
outputSchema:
|
|
5172
|
+
parameters: ri,
|
|
5173
|
+
outputSchema: oi,
|
|
5173
5174
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !0 },
|
|
5174
5175
|
async execute(e, t) {
|
|
5175
5176
|
const { type: r, items: o } = e, n = /* @__PURE__ */ new Set();
|
|
@@ -5231,22 +5232,22 @@ const Ja = {
|
|
|
5231
5232
|
}
|
|
5232
5233
|
};
|
|
5233
5234
|
}
|
|
5234
|
-
},
|
|
5235
|
+
}, ai = s.object({
|
|
5235
5236
|
id: s.string().min(1).describe("The ID of the task to reschedule."),
|
|
5236
5237
|
date: s.string().min(1).describe(
|
|
5237
5238
|
"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."
|
|
5238
5239
|
)
|
|
5239
|
-
}),
|
|
5240
|
-
tasks: s.array(
|
|
5241
|
-
},
|
|
5240
|
+
}), ii = {
|
|
5241
|
+
tasks: s.array(ai).min(1).describe("The tasks to reschedule with their new dates.")
|
|
5242
|
+
}, ci = {
|
|
5242
5243
|
tasks: s.array(B).describe("The rescheduled tasks."),
|
|
5243
5244
|
totalCount: s.number().describe("The total number of tasks rescheduled."),
|
|
5244
5245
|
rescheduledTaskIds: s.array(s.string()).describe("The IDs of the rescheduled tasks.")
|
|
5245
|
-
},
|
|
5246
|
+
}, di = {
|
|
5246
5247
|
name: b.RESCHEDULE_TASKS,
|
|
5247
5248
|
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.",
|
|
5248
|
-
parameters:
|
|
5249
|
-
outputSchema:
|
|
5249
|
+
parameters: ii,
|
|
5250
|
+
outputSchema: ci,
|
|
5250
5251
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5251
5252
|
async execute(e, t) {
|
|
5252
5253
|
const { tasks: r } = e, n = (await Promise.all(
|
|
@@ -5259,7 +5260,7 @@ const Ja = {
|
|
|
5259
5260
|
throw new Error(
|
|
5260
5261
|
`Task "${d.content}" (${d.id}) has no due date. Rescheduling requires an existing due date.`
|
|
5261
5262
|
);
|
|
5262
|
-
const u =
|
|
5263
|
+
const u = li(l.date, d.due);
|
|
5263
5264
|
return G("item_update", {
|
|
5264
5265
|
id: l.id,
|
|
5265
5266
|
due: {
|
|
@@ -5290,16 +5291,16 @@ const Ja = {
|
|
|
5290
5291
|
};
|
|
5291
5292
|
}
|
|
5292
5293
|
};
|
|
5293
|
-
function
|
|
5294
|
+
function li(e, t) {
|
|
5294
5295
|
if (/^\d{4}-\d{2}-\d{2}$/.test(e) && t.datetime) {
|
|
5295
5296
|
const o = t.datetime.substring(10);
|
|
5296
5297
|
return e + o;
|
|
5297
5298
|
}
|
|
5298
5299
|
return e;
|
|
5299
5300
|
}
|
|
5300
|
-
const
|
|
5301
|
+
const ui = {
|
|
5301
5302
|
query: s.string().min(1).describe("The search query string to find tasks and projects.")
|
|
5302
|
-
},
|
|
5303
|
+
}, pi = {
|
|
5303
5304
|
results: s.array(
|
|
5304
5305
|
s.object({
|
|
5305
5306
|
id: s.string().describe("The ID of the result."),
|
|
@@ -5308,11 +5309,11 @@ const li = {
|
|
|
5308
5309
|
})
|
|
5309
5310
|
).describe("The search results."),
|
|
5310
5311
|
totalCount: s.number().describe("Total number of results found.")
|
|
5311
|
-
},
|
|
5312
|
+
}, hi = {
|
|
5312
5313
|
name: b.SEARCH,
|
|
5313
5314
|
description: "Search across tasks and projects in Todoist. Returns a list of relevant results with IDs, titles, and URLs.",
|
|
5314
|
-
parameters:
|
|
5315
|
-
outputSchema:
|
|
5315
|
+
parameters: ui,
|
|
5316
|
+
outputSchema: pi,
|
|
5316
5317
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
5317
5318
|
async execute(e, t) {
|
|
5318
5319
|
const { query: r } = e, [o, n] = await Promise.all([
|
|
@@ -5322,7 +5323,7 @@ const li = {
|
|
|
5322
5323
|
limit: I.TASKS_MAX,
|
|
5323
5324
|
cursor: void 0
|
|
5324
5325
|
}),
|
|
5325
|
-
|
|
5326
|
+
qt(t, r)
|
|
5326
5327
|
]), a = [];
|
|
5327
5328
|
for (const i of o.tasks)
|
|
5328
5329
|
a.push({
|
|
@@ -5341,19 +5342,19 @@ const li = {
|
|
|
5341
5342
|
structuredContent: { results: a, totalCount: a.length }
|
|
5342
5343
|
};
|
|
5343
5344
|
}
|
|
5344
|
-
}, hi = {
|
|
5345
|
-
ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to uncomplete.")
|
|
5346
5345
|
}, mi = {
|
|
5346
|
+
ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to uncomplete.")
|
|
5347
|
+
}, fi = {
|
|
5347
5348
|
uncompleted: s.array(s.string()).describe("The IDs of successfully uncompleted tasks."),
|
|
5348
5349
|
failures: s.array(Q).describe("Failed task uncompletion with error details."),
|
|
5349
5350
|
totalRequested: s.number().describe("The total number of tasks requested to uncomplete."),
|
|
5350
5351
|
successCount: s.number().describe("The number of successfully uncompleted tasks."),
|
|
5351
5352
|
failureCount: s.number().describe("The number of failed task uncompletions.")
|
|
5352
|
-
},
|
|
5353
|
+
}, bi = {
|
|
5353
5354
|
name: b.UNCOMPLETE_TASKS,
|
|
5354
5355
|
description: "Uncomplete (reopen) one or more completed tasks by their IDs.",
|
|
5355
|
-
parameters:
|
|
5356
|
-
outputSchema:
|
|
5356
|
+
parameters: mi,
|
|
5357
|
+
outputSchema: fi,
|
|
5357
5358
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
5358
5359
|
async execute(e, t) {
|
|
5359
5360
|
const r = [], o = [];
|
|
@@ -5368,7 +5369,7 @@ const li = {
|
|
|
5368
5369
|
});
|
|
5369
5370
|
}
|
|
5370
5371
|
return {
|
|
5371
|
-
textContent:
|
|
5372
|
+
textContent: gi({
|
|
5372
5373
|
uncompleted: r,
|
|
5373
5374
|
failures: o,
|
|
5374
5375
|
args: e
|
|
@@ -5383,7 +5384,7 @@ const li = {
|
|
|
5383
5384
|
};
|
|
5384
5385
|
}
|
|
5385
5386
|
};
|
|
5386
|
-
function
|
|
5387
|
+
function gi({
|
|
5387
5388
|
uncompleted: e,
|
|
5388
5389
|
failures: t,
|
|
5389
5390
|
args: r
|
|
@@ -5397,28 +5398,28 @@ function bi({
|
|
|
5397
5398
|
failures: t
|
|
5398
5399
|
});
|
|
5399
5400
|
}
|
|
5400
|
-
const
|
|
5401
|
+
const yi = s.object({
|
|
5401
5402
|
id: s.string().min(1).describe("The ID of the comment to update."),
|
|
5402
5403
|
content: s.string().min(1).describe("The new content for the comment.")
|
|
5403
|
-
}),
|
|
5404
|
-
comments: s.array(
|
|
5405
|
-
},
|
|
5404
|
+
}), ki = {
|
|
5405
|
+
comments: s.array(yi).min(1).describe("The comments to update.")
|
|
5406
|
+
}, Ti = {
|
|
5406
5407
|
comments: s.array(je).describe("The updated comments."),
|
|
5407
5408
|
totalCount: s.number().describe("The total number of comments updated."),
|
|
5408
5409
|
updatedCommentIds: s.array(s.string()).describe("The IDs of the updated comments."),
|
|
5409
5410
|
appliedOperations: s.object({
|
|
5410
5411
|
updateCount: s.number().describe("The number of comments updated.")
|
|
5411
5412
|
}).describe("Summary of operations performed.")
|
|
5412
|
-
},
|
|
5413
|
+
}, wi = {
|
|
5413
5414
|
name: b.UPDATE_COMMENTS,
|
|
5414
5415
|
description: "Update multiple existing comments with new content.",
|
|
5415
|
-
parameters:
|
|
5416
|
-
outputSchema:
|
|
5416
|
+
parameters: ki,
|
|
5417
|
+
outputSchema: Ti,
|
|
5417
5418
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5418
5419
|
async execute(e, t) {
|
|
5419
5420
|
const { comments: r } = e, o = r.map(async (c) => await t.updateComment(c.id, { content: c.content })), a = (await Promise.all(o)).map(ve);
|
|
5420
5421
|
return {
|
|
5421
|
-
textContent:
|
|
5422
|
+
textContent: vi({
|
|
5422
5423
|
comments: a
|
|
5423
5424
|
}),
|
|
5424
5425
|
structuredContent: {
|
|
@@ -5432,7 +5433,7 @@ const gi = s.object({
|
|
|
5432
5433
|
};
|
|
5433
5434
|
}
|
|
5434
5435
|
};
|
|
5435
|
-
function
|
|
5436
|
+
function vi({ comments: e }) {
|
|
5436
5437
|
const t = e.filter((a) => a.taskId).length, r = e.filter((a) => a.projectId).length, o = [];
|
|
5437
5438
|
if (t > 0) {
|
|
5438
5439
|
const a = t > 1 ? "comments" : "comment";
|
|
@@ -5444,7 +5445,7 @@ function wi({ comments: e }) {
|
|
|
5444
5445
|
}
|
|
5445
5446
|
return o.length > 0 ? `Updated ${o.join(" and ")}` : "No comments updated";
|
|
5446
5447
|
}
|
|
5447
|
-
const
|
|
5448
|
+
const Ii = s.object({
|
|
5448
5449
|
id: s.string().min(1).describe("The ID of the filter to update."),
|
|
5449
5450
|
name: s.string().min(1).optional().describe("The new name of the filter."),
|
|
5450
5451
|
query: s.string().min(1).optional().describe(
|
|
@@ -5452,9 +5453,9 @@ const vi = s.object({
|
|
|
5452
5453
|
),
|
|
5453
5454
|
color: pe,
|
|
5454
5455
|
isFavorite: s.boolean().optional().describe("Whether to mark the filter as a favorite.")
|
|
5455
|
-
}),
|
|
5456
|
-
filters: s.array(
|
|
5457
|
-
},
|
|
5456
|
+
}), ji = {
|
|
5457
|
+
filters: s.array(Ii).min(1).describe("The filters to update.")
|
|
5458
|
+
}, Si = {
|
|
5458
5459
|
filters: s.array(tt).describe("The updated filters."),
|
|
5459
5460
|
totalCount: s.number().describe("The total number of filters updated."),
|
|
5460
5461
|
updatedFilterIds: s.array(s.string()).describe("The IDs of the updated filters."),
|
|
@@ -5462,15 +5463,15 @@ const vi = s.object({
|
|
|
5462
5463
|
updateCount: s.number().describe("The number of filters actually updated."),
|
|
5463
5464
|
skippedCount: s.number().describe("The number of filters skipped (no changes).")
|
|
5464
5465
|
}).describe("Summary of operations performed.")
|
|
5465
|
-
},
|
|
5466
|
+
}, Ci = {
|
|
5466
5467
|
name: b.UPDATE_FILTERS,
|
|
5467
5468
|
description: "Update one or more existing personal filters with new values.",
|
|
5468
|
-
parameters:
|
|
5469
|
-
outputSchema:
|
|
5469
|
+
parameters: ji,
|
|
5470
|
+
outputSchema: Si,
|
|
5470
5471
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5471
5472
|
async execute(e, t) {
|
|
5472
5473
|
const { filters: r } = e, o = [], a = r.map((h) => {
|
|
5473
|
-
const m =
|
|
5474
|
+
const m = Di(h);
|
|
5474
5475
|
return m !== null ? { kind: "skipped", reason: m } : (o.push(h), { kind: "updated", filter: h });
|
|
5475
5476
|
}).filter((h) => h.kind === "skipped").length;
|
|
5476
5477
|
if (o.length === 0)
|
|
@@ -5501,7 +5502,7 @@ const vi = s.object({
|
|
|
5501
5502
|
itemOrder: h.itemOrder
|
|
5502
5503
|
}));
|
|
5503
5504
|
return {
|
|
5504
|
-
textContent:
|
|
5505
|
+
textContent: $i({ filters: u, skippedCount: a }),
|
|
5505
5506
|
structuredContent: {
|
|
5506
5507
|
filters: u,
|
|
5507
5508
|
totalCount: u.length,
|
|
@@ -5514,7 +5515,7 @@ const vi = s.object({
|
|
|
5514
5515
|
};
|
|
5515
5516
|
}
|
|
5516
5517
|
};
|
|
5517
|
-
function
|
|
5518
|
+
function $i({
|
|
5518
5519
|
filters: e,
|
|
5519
5520
|
skippedCount: t
|
|
5520
5521
|
}) {
|
|
@@ -5528,52 +5529,52 @@ ${n}`;
|
|
|
5528
5529
|
}
|
|
5529
5530
|
return o;
|
|
5530
5531
|
}
|
|
5531
|
-
function
|
|
5532
|
+
function Di({ id: e, ...t }) {
|
|
5532
5533
|
return Object.values(t).every((o) => o === void 0) ? "no-fields" : null;
|
|
5533
5534
|
}
|
|
5534
|
-
const
|
|
5535
|
+
const Ai = s.object({
|
|
5535
5536
|
labelType: s.literal("personal").describe("Update a personal label, identified by its ID."),
|
|
5536
5537
|
id: s.string().min(1).describe("The ID of the personal label to update."),
|
|
5537
5538
|
name: s.string().min(1).max(128).optional().describe("The new name of the label."),
|
|
5538
5539
|
color: pe,
|
|
5539
5540
|
order: s.number().int().optional().describe("The new position of the label in the label list."),
|
|
5540
5541
|
isFavorite: s.boolean().optional().describe("Whether to mark the label as a favorite.")
|
|
5541
|
-
}),
|
|
5542
|
+
}), xi = s.object({
|
|
5542
5543
|
labelType: s.literal("shared").describe(
|
|
5543
5544
|
"Rename a shared label across all tasks. Shared labels are identified by name; only renaming is supported (no color, order, or favorite)."
|
|
5544
5545
|
),
|
|
5545
5546
|
name: s.string().min(1).describe("The current name of the shared label."),
|
|
5546
5547
|
newName: s.string().min(1).describe("The new name for the shared label.")
|
|
5547
|
-
}),
|
|
5548
|
-
|
|
5549
|
-
|
|
5550
|
-
]),
|
|
5551
|
-
labels: s.array(
|
|
5548
|
+
}), Ei = s.discriminatedUnion("labelType", [
|
|
5549
|
+
Ai,
|
|
5550
|
+
xi
|
|
5551
|
+
]), Oi = {
|
|
5552
|
+
labels: s.array(Ei).min(1).describe(
|
|
5552
5553
|
'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.'
|
|
5553
5554
|
)
|
|
5554
|
-
},
|
|
5555
|
+
}, Pi = s.object({
|
|
5555
5556
|
name: s.string().describe("The previous name of the shared label."),
|
|
5556
5557
|
newName: s.string().describe("The new name of the shared label.")
|
|
5557
|
-
}),
|
|
5558
|
+
}), Ri = {
|
|
5558
5559
|
updatedLabels: s.array(me).describe("The updated personal labels."),
|
|
5559
|
-
renamedSharedLabels: s.array(
|
|
5560
|
+
renamedSharedLabels: s.array(Pi).describe("The shared labels that were renamed."),
|
|
5560
5561
|
totalCount: s.number().describe("The total number of successful operations (personal + shared)."),
|
|
5561
5562
|
appliedOperations: s.object({
|
|
5562
5563
|
updateCount: s.number().describe("Number of personal labels updated."),
|
|
5563
5564
|
renameCount: s.number().describe("Number of shared labels renamed."),
|
|
5564
5565
|
skippedCount: s.number().describe("Number of operations skipped (no changes or shared label not found).")
|
|
5565
5566
|
}).describe("Summary of operations performed.")
|
|
5566
|
-
},
|
|
5567
|
+
}, _i = {
|
|
5567
5568
|
name: b.UPDATE_LABELS,
|
|
5568
5569
|
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.",
|
|
5569
|
-
parameters:
|
|
5570
|
-
outputSchema:
|
|
5570
|
+
parameters: Oi,
|
|
5571
|
+
outputSchema: Ri,
|
|
5571
5572
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5572
5573
|
async execute(e, t) {
|
|
5573
5574
|
const { labels: r } = e, o = await Promise.all(
|
|
5574
5575
|
r.map(async (u) => {
|
|
5575
5576
|
if (u.labelType === "personal") {
|
|
5576
|
-
const h =
|
|
5577
|
+
const h = Ni(u);
|
|
5577
5578
|
if (h !== null) return { kind: "skipped", reason: h };
|
|
5578
5579
|
const { id: m, labelType: f, ...g } = u;
|
|
5579
5580
|
return { kind: "updated", label: await t.updateLabel(m, g) };
|
|
@@ -5591,7 +5592,7 @@ const Di = s.object({
|
|
|
5591
5592
|
(u) => u.kind === "skipped" && u.reason === "not-found"
|
|
5592
5593
|
).length;
|
|
5593
5594
|
return {
|
|
5594
|
-
textContent:
|
|
5595
|
+
textContent: Ui({
|
|
5595
5596
|
updatedLabels: n,
|
|
5596
5597
|
renamedSharedLabels: a,
|
|
5597
5598
|
skippedNoFields: c,
|
|
@@ -5610,7 +5611,7 @@ const Di = s.object({
|
|
|
5610
5611
|
};
|
|
5611
5612
|
}
|
|
5612
5613
|
};
|
|
5613
|
-
function
|
|
5614
|
+
function Ui({
|
|
5614
5615
|
updatedLabels: e,
|
|
5615
5616
|
renamedSharedLabels: t,
|
|
5616
5617
|
skippedNoFields: r,
|
|
@@ -5632,14 +5633,14 @@ function _i({
|
|
|
5632
5633
|
return c.join(`
|
|
5633
5634
|
`);
|
|
5634
5635
|
}
|
|
5635
|
-
function
|
|
5636
|
+
function Ni({
|
|
5636
5637
|
id: e,
|
|
5637
5638
|
labelType: t,
|
|
5638
5639
|
...r
|
|
5639
5640
|
}) {
|
|
5640
5641
|
return Object.values(r).every((n) => n === void 0) ? "no-fields" : null;
|
|
5641
5642
|
}
|
|
5642
|
-
const
|
|
5643
|
+
const Li = s.object({
|
|
5643
5644
|
id: s.string().min(1).describe("The ID of the project to update."),
|
|
5644
5645
|
name: s.string().min(1).optional().describe("The new name of the project."),
|
|
5645
5646
|
isFavorite: s.boolean().optional().describe("Whether the project is a favorite."),
|
|
@@ -5654,9 +5655,9 @@ const Ni = s.object({
|
|
|
5654
5655
|
)
|
|
5655
5656
|
).optional(),
|
|
5656
5657
|
color: pe
|
|
5657
|
-
}),
|
|
5658
|
-
projects: s.array(
|
|
5659
|
-
},
|
|
5658
|
+
}), Mi = {
|
|
5659
|
+
projects: s.array(Li).min(1).describe("The projects to update.")
|
|
5660
|
+
}, Fi = {
|
|
5660
5661
|
projects: s.array(X).describe("The updated projects."),
|
|
5661
5662
|
totalCount: s.number().describe("The total number of projects updated."),
|
|
5662
5663
|
updatedProjectIds: s.array(s.string()).describe("The IDs of the updated projects."),
|
|
@@ -5668,16 +5669,16 @@ const Ni = s.object({
|
|
|
5668
5669
|
skippedCount: s.number().describe("The number of projects skipped (no changes)."),
|
|
5669
5670
|
failureCount: s.number().describe("The number of projects that failed to update.")
|
|
5670
5671
|
}).describe("Summary of operations performed.")
|
|
5671
|
-
},
|
|
5672
|
+
}, Hi = {
|
|
5672
5673
|
name: b.UPDATE_PROJECTS,
|
|
5673
5674
|
description: "Update multiple existing projects with new values.",
|
|
5674
|
-
parameters:
|
|
5675
|
-
outputSchema:
|
|
5675
|
+
parameters: Mi,
|
|
5676
|
+
outputSchema: Fi,
|
|
5676
5677
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5677
5678
|
async execute(e, t) {
|
|
5678
5679
|
const { projects: r } = e, o = await Promise.allSettled(
|
|
5679
5680
|
r.map(async (d) => {
|
|
5680
|
-
const u =
|
|
5681
|
+
const u = Bi(d);
|
|
5681
5682
|
if (u !== null) return { kind: "skipped", reason: u };
|
|
5682
5683
|
const { id: p, ...h } = d;
|
|
5683
5684
|
return { kind: "updated", project: await _(() => t.updateProject(p, h)) };
|
|
@@ -5695,7 +5696,7 @@ const Ni = s.object({
|
|
|
5695
5696
|
u.value.kind === "updated" ? n.push(J(u.value.project)) : u.value.reason === "no-fields" ? i++ : c++;
|
|
5696
5697
|
}
|
|
5697
5698
|
return {
|
|
5698
|
-
textContent:
|
|
5699
|
+
textContent: Wi({
|
|
5699
5700
|
projects: n,
|
|
5700
5701
|
skippedNoFields: i,
|
|
5701
5702
|
skippedNoValidValues: c,
|
|
@@ -5715,7 +5716,7 @@ const Ni = s.object({
|
|
|
5715
5716
|
};
|
|
5716
5717
|
}
|
|
5717
5718
|
};
|
|
5718
|
-
function
|
|
5719
|
+
function Wi({
|
|
5719
5720
|
projects: e,
|
|
5720
5721
|
skippedNoFields: t,
|
|
5721
5722
|
skippedNoValidValues: r,
|
|
@@ -5728,11 +5729,11 @@ function Hi({
|
|
|
5728
5729
|
return t > 0 && c.push(`${t} skipped - no changes`), r > 0 && c.push(`${r} skipped - no valid field values`), c.length > 0 && (i += ` (${c.join(", ")})`), n > 0 && (i += `:
|
|
5729
5730
|
${a}`), ot(i, o);
|
|
5730
5731
|
}
|
|
5731
|
-
function
|
|
5732
|
+
function Bi({ id: e, ...t }) {
|
|
5732
5733
|
const r = Object.values(t);
|
|
5733
5734
|
return r.length === 0 ? "no-fields" : r.every((o) => o === void 0) ? "no-valid-values" : null;
|
|
5734
5735
|
}
|
|
5735
|
-
const
|
|
5736
|
+
const Yi = s.object({
|
|
5736
5737
|
type: s.literal("relative"),
|
|
5737
5738
|
id: s.string().min(1).describe("The ID of the relative reminder to update."),
|
|
5738
5739
|
minuteOffset: s.number().int().min(0).optional().describe("New minute offset before task due time."),
|
|
@@ -5754,23 +5755,23 @@ const Bi = s.object({
|
|
|
5754
5755
|
'New trigger condition: "on_enter" or "on_leave".'
|
|
5755
5756
|
),
|
|
5756
5757
|
radius: s.number().int().optional().describe("New radius in meters.")
|
|
5757
|
-
}),
|
|
5758
|
-
|
|
5758
|
+
}), Gi = s.discriminatedUnion("type", [
|
|
5759
|
+
Yi,
|
|
5759
5760
|
qi,
|
|
5760
5761
|
zi
|
|
5761
|
-
]),
|
|
5762
|
-
reminders: s.array(
|
|
5762
|
+
]), Ki = {
|
|
5763
|
+
reminders: s.array(Gi).min(1).max(we).describe(
|
|
5763
5764
|
`Array of reminders to update (max ${we}). Each must include the reminder type and ID. Only include fields that need to change.`
|
|
5764
5765
|
)
|
|
5765
|
-
},
|
|
5766
|
+
}, Vi = {
|
|
5766
5767
|
reminders: s.array(et).describe("The updated reminders."),
|
|
5767
5768
|
totalCount: s.number().describe("Total reminders updated."),
|
|
5768
5769
|
updatedReminderIds: s.array(s.string()).describe("IDs of updated reminders.")
|
|
5769
|
-
},
|
|
5770
|
+
}, Ji = {
|
|
5770
5771
|
name: b.UPDATE_REMINDERS,
|
|
5771
5772
|
description: 'Update existing reminders. Each reminder must specify its type ("relative", "absolute", or "location") and ID. Only include fields that need to change.',
|
|
5772
|
-
parameters:
|
|
5773
|
-
outputSchema:
|
|
5773
|
+
parameters: Ki,
|
|
5774
|
+
outputSchema: Vi,
|
|
5774
5775
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !0 },
|
|
5775
5776
|
async execute(e, t) {
|
|
5776
5777
|
const { reminders: r } = e, o = r.map(async (l) => {
|
|
@@ -5804,7 +5805,7 @@ const Bi = s.object({
|
|
|
5804
5805
|
}
|
|
5805
5806
|
};
|
|
5806
5807
|
}
|
|
5807
|
-
},
|
|
5808
|
+
}, Xi = s.object({
|
|
5808
5809
|
id: s.string().min(1).describe("The ID of the section to update."),
|
|
5809
5810
|
name: s.string().min(1).optional().describe("The new name of the section."),
|
|
5810
5811
|
description: s.preprocess(
|
|
@@ -5819,17 +5820,17 @@ const Bi = s.object({
|
|
|
5819
5820
|
).optional()
|
|
5820
5821
|
}).refine((e) => e.name !== void 0 || e.description !== void 0, {
|
|
5821
5822
|
message: 'Provide at least one of "name" or "description" to update.'
|
|
5822
|
-
}),
|
|
5823
|
-
sections: s.array(
|
|
5824
|
-
},
|
|
5823
|
+
}), Zi = {
|
|
5824
|
+
sections: s.array(Xi).min(1).describe("The sections to update.")
|
|
5825
|
+
}, Qi = {
|
|
5825
5826
|
sections: s.array(le).describe("The updated sections."),
|
|
5826
5827
|
totalCount: s.number().describe("The total number of sections updated."),
|
|
5827
5828
|
updatedSectionIds: s.array(s.string()).describe("The IDs of the updated sections.")
|
|
5828
|
-
},
|
|
5829
|
+
}, ec = {
|
|
5829
5830
|
name: b.UPDATE_SECTIONS,
|
|
5830
5831
|
description: "Update multiple existing sections with new values.",
|
|
5831
|
-
parameters:
|
|
5832
|
-
outputSchema:
|
|
5832
|
+
parameters: Zi,
|
|
5833
|
+
outputSchema: Qi,
|
|
5833
5834
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5834
5835
|
async execute({ sections: e }, t) {
|
|
5835
5836
|
const r = await Promise.all(
|
|
@@ -5842,7 +5843,7 @@ const Bi = s.object({
|
|
|
5842
5843
|
})
|
|
5843
5844
|
);
|
|
5844
5845
|
return {
|
|
5845
|
-
textContent:
|
|
5846
|
+
textContent: tc({
|
|
5846
5847
|
sections: r
|
|
5847
5848
|
}),
|
|
5848
5849
|
structuredContent: {
|
|
@@ -5853,13 +5854,13 @@ const Bi = s.object({
|
|
|
5853
5854
|
};
|
|
5854
5855
|
}
|
|
5855
5856
|
};
|
|
5856
|
-
function
|
|
5857
|
+
function tc({ sections: e }) {
|
|
5857
5858
|
const t = e.length, r = e.map((n) => `• ${n.name} (id=${n.id}, projectId=${n.projectId})`).join(`
|
|
5858
5859
|
`);
|
|
5859
5860
|
return `Updated ${t} section${t === 1 ? "" : "s"}:
|
|
5860
5861
|
${r}`;
|
|
5861
5862
|
}
|
|
5862
|
-
const
|
|
5863
|
+
const sc = s.object({
|
|
5863
5864
|
id: s.string().min(1).describe("The ID of the task to update."),
|
|
5864
5865
|
content: s.string().optional().describe(
|
|
5865
5866
|
'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.'
|
|
@@ -5902,9 +5903,9 @@ const tc = s.object({
|
|
|
5902
5903
|
isUncompletable: s.boolean().optional().describe(
|
|
5903
5904
|
"Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
|
|
5904
5905
|
)
|
|
5905
|
-
}),
|
|
5906
|
-
tasks: s.array(
|
|
5907
|
-
},
|
|
5906
|
+
}), rc = ["remove", "no date"], oc = ["remove", "no date", "no deadline"], nc = "no date", St = Ft.TASKS_PER_OPERATION, Ct = {
|
|
5907
|
+
tasks: s.array(sc).min(1).max(St).describe(`The tasks to update (max ${St}).`)
|
|
5908
|
+
}, ac = {
|
|
5908
5909
|
tasks: s.array(B).describe("The updated tasks."),
|
|
5909
5910
|
totalCount: s.number().describe("The total number of tasks updated."),
|
|
5910
5911
|
updatedTaskIds: s.array(s.string()).describe("The IDs of the updated tasks."),
|
|
@@ -5916,15 +5917,15 @@ const tc = s.object({
|
|
|
5916
5917
|
skippedCount: s.number().describe("The number of tasks skipped (no changes)."),
|
|
5917
5918
|
failureCount: s.number().describe("The number of tasks that failed to update.")
|
|
5918
5919
|
}).describe("Summary of operations performed.")
|
|
5919
|
-
},
|
|
5920
|
+
}, ic = {
|
|
5920
5921
|
name: b.UPDATE_TASKS,
|
|
5921
5922
|
description: "Update existing tasks including content, dates, priorities, and assignments.",
|
|
5922
5923
|
parameters: Ct,
|
|
5923
|
-
outputSchema:
|
|
5924
|
+
outputSchema: ac,
|
|
5924
5925
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5925
5926
|
async execute(e, t) {
|
|
5926
5927
|
const { tasks: r } = s.object(Ct).parse(e), o = await Promise.allSettled(
|
|
5927
|
-
r.map((d) =>
|
|
5928
|
+
r.map((d) => cc(d, t))
|
|
5928
5929
|
), n = [], a = [];
|
|
5929
5930
|
let i = 0;
|
|
5930
5931
|
for (const [d, u] of o.entries()) {
|
|
@@ -5947,7 +5948,7 @@ const tc = s.object({
|
|
|
5947
5948
|
}
|
|
5948
5949
|
const c = n.map(U);
|
|
5949
5950
|
return {
|
|
5950
|
-
textContent:
|
|
5951
|
+
textContent: lc({
|
|
5951
5952
|
tasks: c,
|
|
5952
5953
|
failures: a,
|
|
5953
5954
|
skippedCount: i
|
|
@@ -5966,8 +5967,8 @@ const tc = s.object({
|
|
|
5966
5967
|
};
|
|
5967
5968
|
}
|
|
5968
5969
|
};
|
|
5969
|
-
async function
|
|
5970
|
-
if (!
|
|
5970
|
+
async function cc(e, t) {
|
|
5971
|
+
if (!uc(e))
|
|
5971
5972
|
return { kind: "skipped" };
|
|
5972
5973
|
const {
|
|
5973
5974
|
id: r,
|
|
@@ -5991,11 +5992,11 @@ async function ic(e, t) {
|
|
|
5991
5992
|
d && (f.priority = Wt(d));
|
|
5992
5993
|
const g = $t(
|
|
5993
5994
|
i,
|
|
5994
|
-
|
|
5995
|
-
|
|
5995
|
+
rc,
|
|
5996
|
+
nc
|
|
5996
5997
|
);
|
|
5997
5998
|
g !== void 0 && (f = { ...f, dueString: g });
|
|
5998
|
-
const S = $t(p,
|
|
5999
|
+
const S = $t(p, oc, null);
|
|
5999
6000
|
if (S !== void 0 && (f = { ...f, deadlineDate: S }), c)
|
|
6000
6001
|
try {
|
|
6001
6002
|
const { minutes: y } = Ht(c);
|
|
@@ -6009,13 +6010,13 @@ async function ic(e, t) {
|
|
|
6009
6010
|
}
|
|
6010
6011
|
if (l !== void 0 && (f = {
|
|
6011
6012
|
...f,
|
|
6012
|
-
assigneeId: await
|
|
6013
|
+
assigneeId: await dc(t, r, l)
|
|
6013
6014
|
}), !m && !n && !a)
|
|
6014
6015
|
return {
|
|
6015
6016
|
kind: "updated",
|
|
6016
6017
|
task: await _(() => t.updateTask(r, f))
|
|
6017
6018
|
};
|
|
6018
|
-
const j =
|
|
6019
|
+
const j = Mr(r, m, n, a), x = await _(() => t.moveTask(r, j));
|
|
6019
6020
|
if (Object.keys(f).length > 0)
|
|
6020
6021
|
try {
|
|
6021
6022
|
return {
|
|
@@ -6031,7 +6032,7 @@ async function ic(e, t) {
|
|
|
6031
6032
|
}
|
|
6032
6033
|
return { kind: "updated", task: x };
|
|
6033
6034
|
}
|
|
6034
|
-
async function
|
|
6035
|
+
async function dc(e, t, r) {
|
|
6035
6036
|
if (r === null || r === "unassign")
|
|
6036
6037
|
return null;
|
|
6037
6038
|
const o = await nt.validateTaskUpdateAssignment(
|
|
@@ -6045,7 +6046,7 @@ async function cc(e, t, r) {
|
|
|
6045
6046
|
}
|
|
6046
6047
|
return o.resolvedUser?.userId;
|
|
6047
6048
|
}
|
|
6048
|
-
function
|
|
6049
|
+
function lc({
|
|
6049
6050
|
tasks: e,
|
|
6050
6051
|
failures: t,
|
|
6051
6052
|
skippedCount: r
|
|
@@ -6065,7 +6066,7 @@ function dc({
|
|
|
6065
6066
|
Failed (${t.length}) - address or drop these items:
|
|
6066
6067
|
${l}${d}`;
|
|
6067
6068
|
}
|
|
6068
|
-
function
|
|
6069
|
+
function uc({ id: e, ...t }) {
|
|
6069
6070
|
return Object.keys(t).length > 0;
|
|
6070
6071
|
}
|
|
6071
6072
|
function $t(e, t, r) {
|
|
@@ -6076,7 +6077,7 @@ function $t(e, t, r) {
|
|
|
6076
6077
|
const o = e.trim().toLowerCase();
|
|
6077
6078
|
return t.includes(o) ? r : e;
|
|
6078
6079
|
}
|
|
6079
|
-
const
|
|
6080
|
+
const pc = {}, hc = {
|
|
6080
6081
|
type: s.literal("user_info").describe("The type of the response."),
|
|
6081
6082
|
userId: s.string().describe("The user ID."),
|
|
6082
6083
|
fullName: s.string().describe("The full name of the user."),
|
|
@@ -6093,25 +6094,25 @@ const uc = {}, pc = {
|
|
|
6093
6094
|
email: s.string().describe("The email address of the user."),
|
|
6094
6095
|
plan: s.enum(["Todoist Free", "Todoist Pro", "Todoist Business"]).describe("The user plan.")
|
|
6095
6096
|
};
|
|
6096
|
-
function
|
|
6097
|
+
function mc(e) {
|
|
6097
6098
|
return e.businessAccountId ? "Todoist Business" : e.isPremium ? "Todoist Pro" : "Todoist Free";
|
|
6098
6099
|
}
|
|
6099
|
-
function
|
|
6100
|
+
function fc(e, t) {
|
|
6100
6101
|
const o = ((e.getDay() || 7) - t + 7) % 7, n = new Date(e);
|
|
6101
6102
|
return n.setDate(e.getDate() - o), n;
|
|
6102
6103
|
}
|
|
6103
|
-
function
|
|
6104
|
+
function bc(e) {
|
|
6104
6105
|
const t = new Date(e);
|
|
6105
6106
|
return t.setDate(e.getDate() + 6), t;
|
|
6106
6107
|
}
|
|
6107
|
-
function
|
|
6108
|
+
function gc(e) {
|
|
6108
6109
|
const t = new Date(e.getFullYear(), 0, 1), r = (e.getTime() - t.getTime()) / 864e5;
|
|
6109
6110
|
return Math.ceil((r + t.getDay() + 1) / 7);
|
|
6110
6111
|
}
|
|
6111
|
-
function
|
|
6112
|
+
function yc(e) {
|
|
6112
6113
|
return ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"][e === 7 ? 0 : e] ?? "Unknown";
|
|
6113
6114
|
}
|
|
6114
|
-
function
|
|
6115
|
+
function kc(e) {
|
|
6115
6116
|
try {
|
|
6116
6117
|
return new Intl.DateTimeFormat("en-US", { timeZone: e }), !0;
|
|
6117
6118
|
} catch {
|
|
@@ -6119,9 +6120,9 @@ function yc(e) {
|
|
|
6119
6120
|
}
|
|
6120
6121
|
}
|
|
6121
6122
|
function us(e) {
|
|
6122
|
-
return
|
|
6123
|
+
return kc(e) ? e : "UTC";
|
|
6123
6124
|
}
|
|
6124
|
-
function
|
|
6125
|
+
function Tc(e, t) {
|
|
6125
6126
|
const r = us(t);
|
|
6126
6127
|
return e.toLocaleString("en-US", {
|
|
6127
6128
|
timeZone: r,
|
|
@@ -6134,8 +6135,8 @@ function kc(e, t) {
|
|
|
6134
6135
|
hour12: !1
|
|
6135
6136
|
});
|
|
6136
6137
|
}
|
|
6137
|
-
async function
|
|
6138
|
-
const t = await e.getUser(), r = t.tzInfo?.timezone ?? "UTC", o = us(r), n = /* @__PURE__ */ new Date(), a =
|
|
6138
|
+
async function wc(e) {
|
|
6139
|
+
const t = await e.getUser(), r = t.tzInfo?.timezone ?? "UTC", o = us(r), n = /* @__PURE__ */ new Date(), a = Tc(n, o), i = t.startDay ?? 1, c = yc(i), l = mc(t), d = new Date(n.toLocaleString("en-US", { timeZone: o })), u = fc(d, i), p = bc(u), h = gc(d), f = [
|
|
6139
6140
|
"# User Information",
|
|
6140
6141
|
"",
|
|
6141
6142
|
`**User ID:** ${t.id}`,
|
|
@@ -6177,26 +6178,26 @@ async function Tc(e) {
|
|
|
6177
6178
|
};
|
|
6178
6179
|
return { textContent: f, structuredContent: g };
|
|
6179
6180
|
}
|
|
6180
|
-
const
|
|
6181
|
+
const vc = {
|
|
6181
6182
|
name: b.USER_INFO,
|
|
6182
6183
|
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).",
|
|
6183
|
-
parameters:
|
|
6184
|
-
outputSchema:
|
|
6184
|
+
parameters: pc,
|
|
6185
|
+
outputSchema: hc,
|
|
6185
6186
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
6186
6187
|
async execute(e, t) {
|
|
6187
|
-
const r = await
|
|
6188
|
+
const r = await wc(t);
|
|
6188
6189
|
return {
|
|
6189
6190
|
textContent: r.textContent,
|
|
6190
6191
|
structuredContent: r.structuredContent
|
|
6191
6192
|
};
|
|
6192
6193
|
}
|
|
6193
|
-
}, Dt = 10 * 1024 * 1024,
|
|
6194
|
+
}, Dt = 10 * 1024 * 1024, Ic = /* @__PURE__ */ new Set([
|
|
6194
6195
|
"image/png",
|
|
6195
6196
|
"image/jpeg",
|
|
6196
6197
|
"image/gif",
|
|
6197
6198
|
"image/webp",
|
|
6198
6199
|
"image/svg+xml"
|
|
6199
|
-
]),
|
|
6200
|
+
]), jc = /* @__PURE__ */ new Set([
|
|
6200
6201
|
"text/plain",
|
|
6201
6202
|
"text/csv",
|
|
6202
6203
|
"text/html",
|
|
@@ -6204,7 +6205,7 @@ const wc = {
|
|
|
6204
6205
|
"application/json",
|
|
6205
6206
|
"application/xml",
|
|
6206
6207
|
"text/xml"
|
|
6207
|
-
]),
|
|
6208
|
+
]), Sc = {
|
|
6208
6209
|
".png": "image/png",
|
|
6209
6210
|
".jpg": "image/jpeg",
|
|
6210
6211
|
".jpeg": "image/jpeg",
|
|
@@ -6219,23 +6220,23 @@ const wc = {
|
|
|
6219
6220
|
".xml": "application/xml",
|
|
6220
6221
|
".pdf": "application/pdf"
|
|
6221
6222
|
};
|
|
6222
|
-
function Sc(e) {
|
|
6223
|
-
return vc.has(e) ? "image" : Ic.has(e) || e.startsWith("text/") ? "text" : "binary";
|
|
6224
|
-
}
|
|
6225
6223
|
function Cc(e) {
|
|
6226
|
-
return (e
|
|
6224
|
+
return Ic.has(e) ? "image" : jc.has(e) || e.startsWith("text/") ? "text" : "binary";
|
|
6227
6225
|
}
|
|
6228
6226
|
function $c(e) {
|
|
6227
|
+
return (e.split(";")[0] ?? e).trim().toLowerCase();
|
|
6228
|
+
}
|
|
6229
|
+
function Dc(e) {
|
|
6229
6230
|
try {
|
|
6230
6231
|
const t = new URL(e).pathname, r = t.lastIndexOf(".");
|
|
6231
6232
|
if (r === -1) return;
|
|
6232
6233
|
const o = t.slice(r).toLowerCase();
|
|
6233
|
-
return
|
|
6234
|
+
return Sc[o];
|
|
6234
6235
|
} catch {
|
|
6235
6236
|
return;
|
|
6236
6237
|
}
|
|
6237
6238
|
}
|
|
6238
|
-
function
|
|
6239
|
+
function Ac(e) {
|
|
6239
6240
|
try {
|
|
6240
6241
|
const t = new URL(e).pathname, r = t.lastIndexOf("/");
|
|
6241
6242
|
return r === -1 ? void 0 : t.slice(r + 1) || void 0;
|
|
@@ -6243,21 +6244,21 @@ function Dc(e) {
|
|
|
6243
6244
|
return;
|
|
6244
6245
|
}
|
|
6245
6246
|
}
|
|
6246
|
-
const
|
|
6247
|
+
const xc = {
|
|
6247
6248
|
fileUrl: s.url().describe(
|
|
6248
6249
|
"The URL of the attachment file to view. Get this from the fileUrl field in a comment's fileAttachment."
|
|
6249
6250
|
)
|
|
6250
|
-
},
|
|
6251
|
+
}, Ec = {
|
|
6251
6252
|
name: b.VIEW_ATTACHMENT,
|
|
6252
6253
|
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).",
|
|
6253
|
-
parameters:
|
|
6254
|
+
parameters: xc,
|
|
6254
6255
|
annotations: {
|
|
6255
6256
|
readOnlyHint: !0,
|
|
6256
6257
|
destructiveHint: !1,
|
|
6257
6258
|
idempotentHint: !0
|
|
6258
6259
|
},
|
|
6259
6260
|
async execute({ fileUrl: e }, t) {
|
|
6260
|
-
const r = await t.viewAttachment(e), o = r.headers["content-length"], n = o ? Number.parseInt(o, 10) : void 0, a =
|
|
6261
|
+
const r = await t.viewAttachment(e), o = r.headers["content-length"], n = o ? Number.parseInt(o, 10) : void 0, a = Ac(e), i = r.headers["content-type"], c = i ? $c(i) : void 0, l = c && c !== "application/octet-stream" ? c : Dc(e) ?? c ?? "application/octet-stream";
|
|
6261
6262
|
if (n && n > Dt)
|
|
6262
6263
|
return {
|
|
6263
6264
|
textContent: `Attachment "${a ?? e}" is too large to display inline (${(n / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${l}`
|
|
@@ -6267,7 +6268,7 @@ const Ac = {
|
|
|
6267
6268
|
return {
|
|
6268
6269
|
textContent: `Attachment "${a ?? e}" is too large to display inline (${(u / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${l}`
|
|
6269
6270
|
};
|
|
6270
|
-
const p =
|
|
6271
|
+
const p = Cc(l), h = [];
|
|
6271
6272
|
return p === "image" ? h.push({
|
|
6272
6273
|
type: "image",
|
|
6273
6274
|
data: d.toString("base64"),
|
|
@@ -6287,7 +6288,7 @@ const Ac = {
|
|
|
6287
6288
|
contentItems: h
|
|
6288
6289
|
};
|
|
6289
6290
|
}
|
|
6290
|
-
},
|
|
6291
|
+
}, Oc = `
|
|
6291
6292
|
## Todoist Task and Project Management Tools
|
|
6292
6293
|
|
|
6293
6294
|
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.
|
|
@@ -6398,10 +6399,10 @@ function zc({
|
|
|
6398
6399
|
tools: { listChanged: !0 },
|
|
6399
6400
|
prompts: { listChanged: !0 }
|
|
6400
6401
|
},
|
|
6401
|
-
instructions:
|
|
6402
|
+
instructions: Oc
|
|
6402
6403
|
}
|
|
6403
6404
|
), n = or(e, { baseUrl: t }), a = {
|
|
6404
|
-
...
|
|
6405
|
+
...ra,
|
|
6405
6406
|
_meta: {
|
|
6406
6407
|
ui: {
|
|
6407
6408
|
resourceUri: Le
|
|
@@ -6410,7 +6411,7 @@ function zc({
|
|
|
6410
6411
|
};
|
|
6411
6412
|
Ps(o);
|
|
6412
6413
|
const i = { server: o, client: n, features: r };
|
|
6413
|
-
return k({ tool:
|
|
6414
|
+
return k({ tool: Fo, ...i }), k({ tool: Vo, ...i }), k({ tool: bi, ...i }), k({ tool: ic, ...i }), k({ tool: di, ...i }), k({ tool: la, ...i }), k({ tool: a, ...i }), k({ tool: xn, ...i }), k({ tool: vo, ...i }), k({ tool: Hi, ...i }), k({ tool: Yn, ...i }), k({ tool: Qa, ...i }), k({ tool: si, ...i }), k({ tool: _o, ...i }), k({ tool: ec, ...i }), k({ tool: Qn, ...i }), k({ tool: Xr, ...i }), k({ tool: wn, ...i }), k({ tool: wi, ...i }), k({ tool: xo, ...i }), k({ tool: Kn, ...i }), k({ tool: Ji, ...i }), k({ tool: Ec, ...i }), k({ tool: uo, ...i }), k({ tool: _i, ...i }), k({ tool: Rn, ...i }), k({ tool: to, ...i }), k({ tool: ao, ...i }), k({ tool: Ci, ...i }), k({ tool: mn, ...i }), k({ tool: Ia, ...i }), k({ tool: _a, ...i }), k({ tool: Da, ...i }), k({ tool: zo, ...i }), k({ tool: Ma, ...i }), k({ tool: Ta, ...i }), k({ tool: Qo, ...i }), k({ tool: cn, ...i }), k({ tool: ni, ...i }), k({ tool: vc, ...i }), k({ tool: Ln, ...i }), k({ tool: Ja, ...i }), k({ tool: Ya, ...i }), k({ tool: hi, ...i }), k({ tool: un, ...i }), o.registerPrompt(
|
|
6414
6415
|
be.name,
|
|
6415
6416
|
{
|
|
6416
6417
|
title: be.title,
|
|
@@ -6421,48 +6422,48 @@ function zc({
|
|
|
6421
6422
|
), o;
|
|
6422
6423
|
}
|
|
6423
6424
|
export {
|
|
6424
|
-
|
|
6425
|
-
|
|
6426
|
-
|
|
6427
|
-
|
|
6428
|
-
|
|
6429
|
-
|
|
6430
|
-
|
|
6431
|
-
|
|
6432
|
-
|
|
6433
|
-
|
|
6434
|
-
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
|
|
6425
|
+
Qn as A,
|
|
6426
|
+
ec as B,
|
|
6427
|
+
_o as C,
|
|
6428
|
+
Yn as D,
|
|
6429
|
+
Hi as E,
|
|
6430
|
+
vo as F,
|
|
6431
|
+
di as G,
|
|
6432
|
+
xn as H,
|
|
6433
|
+
ra as I,
|
|
6434
|
+
la as J,
|
|
6435
|
+
ic as K,
|
|
6436
|
+
bi as L,
|
|
6437
|
+
Vo as M,
|
|
6438
|
+
Fo as N,
|
|
6438
6439
|
qc as O,
|
|
6439
6440
|
or as P,
|
|
6440
6441
|
Vs as Q,
|
|
6441
|
-
|
|
6442
|
-
|
|
6443
|
-
|
|
6444
|
-
|
|
6445
|
-
|
|
6442
|
+
lr as R,
|
|
6443
|
+
Ln as a,
|
|
6444
|
+
Ta as b,
|
|
6445
|
+
Ma as c,
|
|
6446
|
+
Qo as d,
|
|
6446
6447
|
zo as e,
|
|
6447
|
-
|
|
6448
|
+
un as f,
|
|
6448
6449
|
zc as g,
|
|
6449
|
-
|
|
6450
|
-
|
|
6451
|
-
|
|
6452
|
-
|
|
6453
|
-
|
|
6454
|
-
|
|
6455
|
-
|
|
6456
|
-
|
|
6457
|
-
|
|
6458
|
-
|
|
6459
|
-
|
|
6460
|
-
|
|
6461
|
-
|
|
6462
|
-
|
|
6463
|
-
|
|
6464
|
-
|
|
6465
|
-
|
|
6466
|
-
|
|
6467
|
-
|
|
6450
|
+
Da as h,
|
|
6451
|
+
_a as i,
|
|
6452
|
+
Ia as j,
|
|
6453
|
+
mn as k,
|
|
6454
|
+
Ya as l,
|
|
6455
|
+
Ja as m,
|
|
6456
|
+
Ci as n,
|
|
6457
|
+
ao as o,
|
|
6458
|
+
to as p,
|
|
6459
|
+
Rn as q,
|
|
6460
|
+
ni as r,
|
|
6461
|
+
hi as s,
|
|
6462
|
+
_i as t,
|
|
6463
|
+
vc as u,
|
|
6464
|
+
uo as v,
|
|
6465
|
+
Ec as w,
|
|
6466
|
+
wn as x,
|
|
6467
|
+
wi as y,
|
|
6468
|
+
Xr as z
|
|
6468
6469
|
};
|