@doist/todoist-ai 8.8.3 → 8.8.5
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
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { f as s, s as a, l as e, m as t, a as d, u as o, r, d as i, b as c, c as n, e as l, h as m, i as f, j as p, k, n as g, o as j, p as u, q as T, t as h, v, w as P, x as A, y as S, z as b, A as y, B as C, C as F, D as E, E as w, F as x, G as H, H as I, I as L, J as M, K as O, L as z, M as B } from "./mcp-server-
|
|
2
|
-
import { N as G, g as J } from "./mcp-server-
|
|
1
|
+
import { f as s, s as a, l as e, m as t, a as d, u as o, r, d as i, b as c, c as n, e as l, h as m, i as f, j as p, k, n as g, o as j, p as u, q as T, t as h, v, w as P, x as A, y as S, z as b, A as y, B as C, C as F, D as E, E as w, F as x, G as H, H as I, I as L, J as M, K as O, L as z, M as B } from "./mcp-server-BDDdFG1A.js";
|
|
2
|
+
import { N as G, g as J } from "./mcp-server-BDDdFG1A.js";
|
|
3
3
|
const N = {
|
|
4
4
|
// Task management tools
|
|
5
5
|
addTasks: B,
|
package/dist/main-http.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { StreamableHTTPServerTransport as i } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
3
3
|
import l from "dotenv";
|
|
4
4
|
import a from "express";
|
|
5
|
-
import { g as p } from "./mcp-server-
|
|
5
|
+
import { g as p } from "./mcp-server-BDDdFG1A.js";
|
|
6
6
|
l.config({ quiet: !0 });
|
|
7
7
|
const s = Number.parseInt(process.env.PORT || "3000", 10);
|
|
8
8
|
function d() {
|
package/dist/main.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { StdioServerTransport as s } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
3
|
import c from "dotenv";
|
|
4
|
-
import { g as i } from "./mcp-server-
|
|
4
|
+
import { g as i } from "./mcp-server-BDDdFG1A.js";
|
|
5
5
|
function p() {
|
|
6
6
|
const e = process.env.TODOIST_BASE_URL, r = process.env.TODOIST_API_KEY;
|
|
7
7
|
if (!r)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-helpers.d.ts","sourceRoot":"","sources":["../src/mcp-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAEpD,OAAO,KAAK,EAAE,SAAS,EAAgB,MAAM,yCAAyC,CAAA;AAEtF,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAC5B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAMpD;;;;;;;GAOG;AACH,QAAA,MAAM,aAAa;IACf;;;OAGG;;CAEG,CAAA;AAEV;;;GAGG;AACH,KAAK,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAA;AAErE;;GAEG;AACH,KAAK,OAAO,GAAG;IACX;;OAEG;IACH,IAAI,EAAE,WAAW,CAAA;CACpB,CAAA;AAED;;GAEG;AACH,KAAK,QAAQ,GAAG,OAAO,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"mcp-helpers.d.ts","sourceRoot":"","sources":["../src/mcp-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAEpD,OAAO,KAAK,EAAE,SAAS,EAAgB,MAAM,yCAAyC,CAAA;AAEtF,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAC5B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAMpD;;;;;;;GAOG;AACH,QAAA,MAAM,aAAa;IACf;;;OAGG;;CAEG,CAAA;AAEV;;;GAGG;AACH,KAAK,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAA;AAErE;;GAEG;AACH,KAAK,OAAO,GAAG;IACX;;OAEG;IACH,IAAI,EAAE,WAAW,CAAA;CACpB,CAAA;AAED;;GAEG;AACH,KAAK,QAAQ,GAAG,OAAO,EAAE,CAAA;AAiIzB;;;GAGG;AACH,iBAAS,qBAAqB,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAsB3C;AAED;;;GAGG;AACH,iBAAS,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQjD;AAED;;GAEG;AACH,iBAAS,YAAY,CAAC,MAAM,SAAS,CAAC,CAAC,WAAW,EAAE,MAAM,SAAS,CAAC,CAAC,WAAW,GAAG,CAAC,CAAC,WAAW,EAAE,EAC9F,IAAI,EACJ,MAAM,EACN,MAAM,EACN,QAAa,GAChB,EAAE;IACC,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACjC,MAAM,EAAE,SAAS,CAAA;IACjB,MAAM,EAAE,UAAU,CAAA;IAClB,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACtB,QAmDA;AAED,OAAO,EACH,aAAa,EACb,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,YAAY,EACZ,qBAAqB,EACrB,mBAAmB,GACtB,CAAA"}
|
|
@@ -1,65 +1,64 @@
|
|
|
1
|
-
import { colors as $e, LOCATION_TRIGGERS as
|
|
2
|
-
import { McpServer as
|
|
3
|
-
import { createHash as
|
|
4
|
-
import { readFileSync as
|
|
5
|
-
import { dirname as
|
|
6
|
-
import { fileURLToPath as
|
|
7
|
-
import { registerAppResource as
|
|
8
|
-
import J, { ZodError as
|
|
1
|
+
import { colors as $e, LOCATION_TRIGGERS as lt, REMINDER_TYPES as _t, createCommand as z, REMINDER_DELIVERY_SERVICES as Nt, HEALTH_STATUSES as Ue, getTaskUrl as ut, getProjectUrl as pt, WORKSPACE_ROLES as Lt, WORKSPACE_PLANS as Mt, TodoistApi as Ft } from "@doist/todoist-sdk";
|
|
2
|
+
import { McpServer as Ht } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
+
import { createHash as Wt } from "node:crypto";
|
|
4
|
+
import { readFileSync as Bt } from "node:fs";
|
|
5
|
+
import { dirname as zt, join as Ve } from "node:path";
|
|
6
|
+
import { fileURLToPath as Yt } from "node:url";
|
|
7
|
+
import { registerAppResource as Gt, RESOURCE_MIME_TYPE as qt, registerAppTool as Kt } from "@modelcontextprotocol/ext-apps/server";
|
|
8
|
+
import J, { ZodError as Vt, z as s } from "zod";
|
|
9
9
|
import { addDays as De, formatISO as Je } from "date-fns";
|
|
10
|
-
const Xe = Yt(
|
|
10
|
+
const Xe = zt(Yt(import.meta.url)), Jt = [
|
|
11
11
|
Ve(Xe, "task-list", "index.html"),
|
|
12
12
|
Ve(Xe, "mcp-apps", "index.html")
|
|
13
|
-
],
|
|
13
|
+
], Xt = `<!doctype html>
|
|
14
14
|
<html>
|
|
15
15
|
<body>
|
|
16
16
|
<p>Task list app is missing. Run "npm run build" to generate it.</p>
|
|
17
17
|
</body>
|
|
18
18
|
</html>`;
|
|
19
|
-
function
|
|
19
|
+
function Zt() {
|
|
20
20
|
const e = [];
|
|
21
|
-
for (const t of
|
|
21
|
+
for (const t of Jt)
|
|
22
22
|
try {
|
|
23
|
-
return
|
|
23
|
+
return Bt(t, "utf-8");
|
|
24
24
|
} catch (r) {
|
|
25
25
|
e.push(r);
|
|
26
26
|
}
|
|
27
|
-
return console.error("Failed to load task list app HTML from any known path:", e),
|
|
27
|
+
return console.error("Failed to load task list app HTML from any known path:", e), Xt;
|
|
28
28
|
}
|
|
29
|
-
const
|
|
29
|
+
const mt = Zt(), Qt = Wt("sha256").update(mt).digest("hex").slice(0, 12), xe = `ui://todoist/task-list@${Qt}`, ht = "Interactive task list widget", es = "https://ai.todoist.net", Ze = {
|
|
30
30
|
ui: {
|
|
31
31
|
prefersBorder: !0,
|
|
32
32
|
csp: {
|
|
33
33
|
// The widget is bundled into one HTML file and does not fetch or load external assets.
|
|
34
34
|
connectDomains: [],
|
|
35
35
|
resourceDomains: []
|
|
36
|
-
}
|
|
37
|
-
domain: Ze
|
|
36
|
+
}
|
|
38
37
|
},
|
|
39
|
-
"openai/widgetDescription":
|
|
38
|
+
"openai/widgetDescription": ht,
|
|
40
39
|
"openai/widgetPrefersBorder": !0,
|
|
41
40
|
"openai/widgetCSP": {
|
|
42
41
|
connect_domains: [],
|
|
43
42
|
resource_domains: []
|
|
44
43
|
},
|
|
45
|
-
"openai/widgetDomain":
|
|
44
|
+
"openai/widgetDomain": es
|
|
46
45
|
};
|
|
47
46
|
function ts(e) {
|
|
48
|
-
|
|
47
|
+
Gt(
|
|
49
48
|
e,
|
|
50
49
|
"todoist-task-list",
|
|
51
50
|
xe,
|
|
52
51
|
{
|
|
53
|
-
description:
|
|
54
|
-
_meta:
|
|
52
|
+
description: ht,
|
|
53
|
+
_meta: Ze
|
|
55
54
|
},
|
|
56
55
|
async () => ({
|
|
57
56
|
contents: [
|
|
58
57
|
{
|
|
59
58
|
uri: xe,
|
|
60
|
-
mimeType:
|
|
61
|
-
text:
|
|
62
|
-
_meta:
|
|
59
|
+
mimeType: qt,
|
|
60
|
+
text: mt,
|
|
61
|
+
_meta: Ze
|
|
63
62
|
}
|
|
64
63
|
]
|
|
65
64
|
})
|
|
@@ -102,7 +101,7 @@ function P(e, t = 220) {
|
|
|
102
101
|
const r = ss(e).replace(/\s+/g, " ").trim();
|
|
103
102
|
return r.length <= t ? r : `${r.slice(0, t - 3)}...`;
|
|
104
103
|
}
|
|
105
|
-
function
|
|
104
|
+
function Qe(e) {
|
|
106
105
|
const t = e.trim();
|
|
107
106
|
return /\bHTTP\s*\d{3}\b/i.test(t) || /\bstatus code \d{3}\b/i.test(t) || /^bad request$/i.test(t) || /^unauthorized$/i.test(t) || /^forbidden$/i.test(t) || /^not found$/i.test(t);
|
|
108
107
|
}
|
|
@@ -261,7 +260,7 @@ function is(e) {
|
|
|
261
260
|
y(t?.message),
|
|
262
261
|
y(r?.message),
|
|
263
262
|
e instanceof Error ? e.message : y(e)
|
|
264
|
-
].filter((h) => !!h), l = d.find((h) => !
|
|
263
|
+
].filter((h) => !!h), l = d.find((h) => !Qe(h)) || d[0], u = _(
|
|
265
264
|
W(n?.errorExtra),
|
|
266
265
|
W(n?.error_extra),
|
|
267
266
|
W(n?.details),
|
|
@@ -269,7 +268,7 @@ function is(e) {
|
|
|
269
268
|
W(n?.errors),
|
|
270
269
|
W(t?.details)
|
|
271
270
|
), p = rs(n);
|
|
272
|
-
return a !== void 0 || ns(n) || c !== void 0 || i !== void 0 || (l ?
|
|
271
|
+
return a !== void 0 || ns(n) || c !== void 0 || i !== void 0 || (l ? Qe(l) : !1) ? {
|
|
273
272
|
statusCode: a,
|
|
274
273
|
code: i,
|
|
275
274
|
tag: c ? P(c, 80) : void 0,
|
|
@@ -291,7 +290,7 @@ function ds(e) {
|
|
|
291
290
|
return e instanceof Error ? P(e.message) : typeof e == "string" ? P(e) : "An unknown error occurred";
|
|
292
291
|
}
|
|
293
292
|
function ls(e) {
|
|
294
|
-
if (e instanceof
|
|
293
|
+
if (e instanceof Vt)
|
|
295
294
|
return e.message;
|
|
296
295
|
const t = is(e);
|
|
297
296
|
return t ? cs(t) : ds(e);
|
|
@@ -438,7 +437,6 @@ function ws({
|
|
|
438
437
|
const i = JSON.stringify(o);
|
|
439
438
|
n.content || (n.content = []), n.content.push({
|
|
440
439
|
type: "text",
|
|
441
|
-
mimeType: "application/json",
|
|
442
440
|
text: i
|
|
443
441
|
});
|
|
444
442
|
}
|
|
@@ -506,7 +504,7 @@ function k({
|
|
|
506
504
|
...e._meta ? { _meta: e._meta } : {}
|
|
507
505
|
};
|
|
508
506
|
if (Ss(e._meta)) {
|
|
509
|
-
|
|
507
|
+
Kt(
|
|
510
508
|
t,
|
|
511
509
|
e.name,
|
|
512
510
|
{
|
|
@@ -695,7 +693,7 @@ class O extends Error {
|
|
|
695
693
|
super(`Invalid duration format "${t}": ${r}`), this.name = "DurationParseError";
|
|
696
694
|
}
|
|
697
695
|
}
|
|
698
|
-
function
|
|
696
|
+
function ft(e) {
|
|
699
697
|
if (!e || typeof e != "string")
|
|
700
698
|
throw new O(e, "Duration must be a non-empty string");
|
|
701
699
|
const t = e.trim().toLowerCase().replace(/\s+/g, "");
|
|
@@ -735,7 +733,7 @@ function Ps(e) {
|
|
|
735
733
|
return t === 0 ? `${r}m` : r === 0 ? `${t}h` : `${t}h${r}m`;
|
|
736
734
|
}
|
|
737
735
|
const Rs = ["p1", "p2", "p3", "p4"], _e = 'Task priority as a string: "p1" (highest), "p2" (high), "p3" (medium), or "p4" (lowest/default). Integers like 1, 2, 3, or 4 are not accepted.', Ne = s.enum(Rs).describe(_e);
|
|
738
|
-
function
|
|
736
|
+
function bt(e) {
|
|
739
737
|
return { p1: 4, p2: 3, p3: 2, p4: 1 }[e];
|
|
740
738
|
}
|
|
741
739
|
function Us(e) {
|
|
@@ -878,7 +876,7 @@ const B = new Ns();
|
|
|
878
876
|
async function Ls(e, t) {
|
|
879
877
|
return B.resolveUser(e, t);
|
|
880
878
|
}
|
|
881
|
-
const
|
|
879
|
+
const gt = ["assigned", "unassignedOrMe", "all"];
|
|
882
880
|
async function Le(e, t) {
|
|
883
881
|
if (!t)
|
|
884
882
|
return;
|
|
@@ -892,7 +890,7 @@ async function Le(e, t) {
|
|
|
892
890
|
function se(e, t) {
|
|
893
891
|
return t.length === 0 ? e : e.length === 0 ? t : `${e} & ${t}`;
|
|
894
892
|
}
|
|
895
|
-
function
|
|
893
|
+
function yt({
|
|
896
894
|
resolvedAssigneeId: e,
|
|
897
895
|
assigneeEmail: t,
|
|
898
896
|
responsibleUserFiltering: r = "unassignedOrMe"
|
|
@@ -941,7 +939,7 @@ async function oe(e) {
|
|
|
941
939
|
function Me(e) {
|
|
942
940
|
return /(?<!\\)(?:\\\\)*\*/.test(e) ? e : `*${e.replaceAll(/\\(?!\*)/g, "\\\\")}*`;
|
|
943
941
|
}
|
|
944
|
-
async function
|
|
942
|
+
async function kt(e, t) {
|
|
945
943
|
return oe({
|
|
946
944
|
apiMethod: e.searchProjects.bind(e),
|
|
947
945
|
args: { query: Me(t) },
|
|
@@ -1084,7 +1082,7 @@ async function Fe({
|
|
|
1084
1082
|
);
|
|
1085
1083
|
}
|
|
1086
1084
|
}
|
|
1087
|
-
function
|
|
1085
|
+
function et(e) {
|
|
1088
1086
|
return {
|
|
1089
1087
|
isRecurring: e.isRecurring,
|
|
1090
1088
|
string: e.string,
|
|
@@ -1104,13 +1102,13 @@ function ce(e) {
|
|
|
1104
1102
|
return {
|
|
1105
1103
|
...t,
|
|
1106
1104
|
minuteOffset: e.minuteOffset,
|
|
1107
|
-
due: e.due ?
|
|
1105
|
+
due: e.due ? et(e.due) : void 0,
|
|
1108
1106
|
isUrgent: e.isUrgent
|
|
1109
1107
|
};
|
|
1110
1108
|
case "absolute":
|
|
1111
1109
|
return {
|
|
1112
1110
|
...t,
|
|
1113
|
-
due:
|
|
1111
|
+
due: et(e.due),
|
|
1114
1112
|
isUrgent: e.isUrgent
|
|
1115
1113
|
};
|
|
1116
1114
|
case "location":
|
|
@@ -1124,7 +1122,7 @@ function ce(e) {
|
|
|
1124
1122
|
};
|
|
1125
1123
|
}
|
|
1126
1124
|
}
|
|
1127
|
-
function
|
|
1125
|
+
function Tt(e) {
|
|
1128
1126
|
const t = e.filter(
|
|
1129
1127
|
(o) => o.type === "relative" || o.type === "absolute"
|
|
1130
1128
|
).length, r = e.filter((o) => o.type === "location").length;
|
|
@@ -1225,7 +1223,7 @@ const ne = s.enum(me).optional().catch(void 0).describe("The color key of the en
|
|
|
1225
1223
|
}), He = s.object({
|
|
1226
1224
|
id: s.string().describe("The unique ID of the reminder."),
|
|
1227
1225
|
taskId: s.string().describe("The task ID this reminder belongs to."),
|
|
1228
|
-
type: s.enum(
|
|
1226
|
+
type: s.enum(_t).describe("The type of reminder: relative, absolute, or location."),
|
|
1229
1227
|
minuteOffset: s.number().optional().describe("Minutes before due time to trigger (relative reminders only)."),
|
|
1230
1228
|
due: Xs.optional().describe(
|
|
1231
1229
|
"Due date info (absolute and sometimes relative reminders)."
|
|
@@ -1233,7 +1231,7 @@ const ne = s.enum(me).optional().catch(void 0).describe("The color key of the en
|
|
|
1233
1231
|
name: s.string().optional().describe("Location name (location reminders only)."),
|
|
1234
1232
|
locLat: s.string().optional().describe("Latitude (location reminders only)."),
|
|
1235
1233
|
locLong: s.string().optional().describe("Longitude (location reminders only)."),
|
|
1236
|
-
locTrigger: s.enum(
|
|
1234
|
+
locTrigger: s.enum(lt).optional().describe("Trigger type: on_enter or on_leave (location reminders only)."),
|
|
1237
1235
|
radius: s.number().optional().describe("Geofence radius in meters (location reminders only)."),
|
|
1238
1236
|
isUrgent: s.boolean().optional().describe("Whether this is an urgent reminder (relative and absolute reminders only).")
|
|
1239
1237
|
}), We = s.object({
|
|
@@ -1512,7 +1510,7 @@ ${u}` + (d.length > 5 ? `
|
|
|
1512
1510
|
this.cache = null;
|
|
1513
1511
|
}
|
|
1514
1512
|
}
|
|
1515
|
-
const
|
|
1513
|
+
const wt = new yr(), kr = s.object({
|
|
1516
1514
|
name: s.string().min(1).describe("The name of the project."),
|
|
1517
1515
|
parentId: s.string().optional().describe("The ID of the parent project. If provided, creates this as a sub-project."),
|
|
1518
1516
|
isFavorite: s.boolean().optional().describe("Whether the project is a favorite. Defaults to false."),
|
|
@@ -1537,7 +1535,7 @@ const It = new yr(), kr = s.object({
|
|
|
1537
1535
|
...new Set(e.map((c) => c.workspace).filter(Boolean))
|
|
1538
1536
|
], o = /* @__PURE__ */ new Map();
|
|
1539
1537
|
for (const c of r) {
|
|
1540
|
-
const d = await
|
|
1538
|
+
const d = await wt.resolveWorkspace(t, c);
|
|
1541
1539
|
o.set(c, d.workspaceId);
|
|
1542
1540
|
}
|
|
1543
1541
|
const n = await Promise.all(
|
|
@@ -1561,12 +1559,12 @@ function vr({ projects: e }) {
|
|
|
1561
1559
|
return `Added ${t} project${t === 1 ? "" : "s"}:
|
|
1562
1560
|
${r}`;
|
|
1563
1561
|
}
|
|
1564
|
-
const ue = 25, ge = s.enum(
|
|
1562
|
+
const ue = 25, ge = s.enum(Nt), It = s.object({
|
|
1565
1563
|
date: s.string().optional().describe("Due date in YYYY-MM-DD format."),
|
|
1566
1564
|
string: s.string().optional().describe('Natural language due string, e.g. "tomorrow at 3pm".'),
|
|
1567
1565
|
timezone: s.string().optional().describe('Timezone for the reminder, e.g. "America/New_York".'),
|
|
1568
1566
|
lang: s.string().optional().describe('Language for parsing the due string, e.g. "en".')
|
|
1569
|
-
}),
|
|
1567
|
+
}), vt = s.enum(lt), ye = s.boolean().optional().describe("Whether this is an urgent reminder. Applies to relative and absolute reminders."), jr = s.object({
|
|
1570
1568
|
type: s.literal("relative"),
|
|
1571
1569
|
taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
|
|
1572
1570
|
minuteOffset: s.number().int().min(0).describe(
|
|
@@ -1579,7 +1577,7 @@ const ue = 25, ge = s.enum(Lt), vt = s.object({
|
|
|
1579
1577
|
}), Sr = s.object({
|
|
1580
1578
|
type: s.literal("absolute"),
|
|
1581
1579
|
taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
|
|
1582
|
-
due:
|
|
1580
|
+
due: It.describe("The specific date/time for the reminder."),
|
|
1583
1581
|
service: ge.optional().describe(
|
|
1584
1582
|
'Delivery method: "email" or "push" notification. Defaults to push.'
|
|
1585
1583
|
),
|
|
@@ -1590,7 +1588,7 @@ const ue = 25, ge = s.enum(Lt), vt = s.object({
|
|
|
1590
1588
|
name: s.string().min(1).describe('Name of the location, e.g. "Office", "Home".'),
|
|
1591
1589
|
locLat: s.string().describe('Latitude of the location as a string, e.g. "37.7749".'),
|
|
1592
1590
|
locLong: s.string().describe('Longitude of the location as a string, e.g. "-122.4194".'),
|
|
1593
|
-
locTrigger:
|
|
1591
|
+
locTrigger: vt.describe(
|
|
1594
1592
|
'When to trigger: "on_enter" (arriving) or "on_leave" (departing).'
|
|
1595
1593
|
),
|
|
1596
1594
|
radius: s.number().int().optional().describe("Radius in meters for the geofence. Defaults to server default.")
|
|
@@ -1653,7 +1651,7 @@ const ue = 25, ge = s.enum(Lt), vt = s.object({
|
|
|
1653
1651
|
}
|
|
1654
1652
|
};
|
|
1655
1653
|
function Er(e) {
|
|
1656
|
-
const { timeBasedCount: t, locationCount: r } =
|
|
1654
|
+
const { timeBasedCount: t, locationCount: r } = Tt(e), o = [];
|
|
1657
1655
|
if (t > 0) {
|
|
1658
1656
|
const n = t > 1 ? "reminders" : "reminder";
|
|
1659
1657
|
o.push(`${t} time-based ${n}`);
|
|
@@ -1995,16 +1993,16 @@ function F({
|
|
|
1995
1993
|
}) {
|
|
1996
1994
|
const d = [], l = `${e}: ${t}${typeof r == "number" ? ` (limit ${r})` : ""}${o ? ", more available" : ""}.`;
|
|
1997
1995
|
return d.push(l), n?.length && d.push(`Filter: ${n.join("; ")}.`), a?.length && d.push(`Preview:
|
|
1998
|
-
${a}`), !t && i?.length && d.push(`No results. ${i.join("; ")}.`), (c?.length || o) && d.push(
|
|
1996
|
+
${a}`), !t && i?.length && d.push(`No results. ${i.join("; ")}.`), (c?.length || o) && d.push(jt(c || [], o)), d.join(`
|
|
1999
1997
|
`);
|
|
2000
1998
|
}
|
|
2001
|
-
function
|
|
1999
|
+
function jt(e, t) {
|
|
2002
2000
|
const r = [...e];
|
|
2003
2001
|
return t && r.push(`Pass cursor '${t}' to fetch more results.`), `${r.length === 1 ? "Possible suggested next step:" : "Possible suggested next steps:"}
|
|
2004
2002
|
${r.map((n) => `- ${n}`).join(`
|
|
2005
2003
|
`)}`;
|
|
2006
2004
|
}
|
|
2007
|
-
const
|
|
2005
|
+
const tt = 25, Hr = s.object({
|
|
2008
2006
|
content: s.string().min(1).describe(
|
|
2009
2007
|
'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.'
|
|
2010
2008
|
),
|
|
@@ -2033,7 +2031,7 @@ const st = 25, Hr = s.object({
|
|
|
2033
2031
|
"Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
|
|
2034
2032
|
)
|
|
2035
2033
|
}), Wr = {
|
|
2036
|
-
tasks: s.array(Hr).min(1).max(
|
|
2034
|
+
tasks: s.array(Hr).min(1).max(tt).describe(`The array of tasks to add (max ${tt}).`)
|
|
2037
2035
|
}, Br = {
|
|
2038
2036
|
tasks: s.array(K).describe("The created tasks."),
|
|
2039
2037
|
totalCount: s.number().describe("The total number of tasks created."),
|
|
@@ -2128,13 +2126,13 @@ async function Gr(e, t) {
|
|
|
2128
2126
|
labels: l,
|
|
2129
2127
|
deadlineDate: u
|
|
2130
2128
|
};
|
|
2131
|
-
if (d && (h.priority =
|
|
2129
|
+
if (d && (h.priority = bt(d)), c && !m && !n && !a)
|
|
2132
2130
|
throw new Error(
|
|
2133
2131
|
`Task "${e.content}": Cannot assign tasks without specifying project context. Please specify a projectId, sectionId, or parentId.`
|
|
2134
2132
|
);
|
|
2135
2133
|
if (r)
|
|
2136
2134
|
try {
|
|
2137
|
-
const { minutes: g } =
|
|
2135
|
+
const { minutes: g } = ft(r);
|
|
2138
2136
|
h = {
|
|
2139
2137
|
...h,
|
|
2140
2138
|
duration: g,
|
|
@@ -2293,7 +2291,7 @@ function eo({
|
|
|
2293
2291
|
failures: t
|
|
2294
2292
|
});
|
|
2295
2293
|
}
|
|
2296
|
-
const
|
|
2294
|
+
const St = [
|
|
2297
2295
|
"project",
|
|
2298
2296
|
"section",
|
|
2299
2297
|
"task",
|
|
@@ -2303,11 +2301,11 @@ const Ct = [
|
|
|
2303
2301
|
"reminder",
|
|
2304
2302
|
"location_reminder"
|
|
2305
2303
|
], to = {
|
|
2306
|
-
type: s.enum(
|
|
2304
|
+
type: s.enum(St).describe("The type of entity to delete."),
|
|
2307
2305
|
id: s.string().min(1).describe("The ID of the entity to delete.")
|
|
2308
2306
|
}, so = {
|
|
2309
2307
|
deletedEntity: s.object({
|
|
2310
|
-
type: s.enum(
|
|
2308
|
+
type: s.enum(St).describe("The type of deleted entity."),
|
|
2311
2309
|
id: s.string().describe("The ID of the deleted entity.")
|
|
2312
2310
|
}).describe("Information about the deleted entity."),
|
|
2313
2311
|
success: s.boolean().describe("Whether the deletion was successful.")
|
|
@@ -2387,7 +2385,7 @@ Labels: ${c.labels.join(", ")}`), a = {
|
|
|
2387
2385
|
id: `task:${c.id}`,
|
|
2388
2386
|
title: c.content,
|
|
2389
2387
|
text: d.join(""),
|
|
2390
|
-
url:
|
|
2388
|
+
url: ut(c.id),
|
|
2391
2389
|
metadata: {
|
|
2392
2390
|
priority: c.priority,
|
|
2393
2391
|
projectId: c.projectId,
|
|
@@ -2410,7 +2408,7 @@ Favorite: Yes`), a = {
|
|
|
2410
2408
|
id: `project:${c.id}`,
|
|
2411
2409
|
title: c.name,
|
|
2412
2410
|
text: d.join(""),
|
|
2413
|
-
url:
|
|
2411
|
+
url: pt(c.id),
|
|
2414
2412
|
metadata: {
|
|
2415
2413
|
color: c.color,
|
|
2416
2414
|
isFavorite: c.isFavorite,
|
|
@@ -2426,11 +2424,11 @@ Favorite: Yes`), a = {
|
|
|
2426
2424
|
structuredContent: a
|
|
2427
2425
|
};
|
|
2428
2426
|
}
|
|
2429
|
-
},
|
|
2430
|
-
type: s.enum(
|
|
2427
|
+
}, Ct = ["task", "project", "comment", "section"], io = {
|
|
2428
|
+
type: s.enum(Ct).describe("The type of object to fetch."),
|
|
2431
2429
|
id: s.string().min(1).describe("The unique ID of the object to fetch.")
|
|
2432
2430
|
}, co = {
|
|
2433
|
-
type: s.enum(
|
|
2431
|
+
type: s.enum(Ct).describe("The type of object fetched."),
|
|
2434
2432
|
id: s.string().describe("The ID of the fetched object."),
|
|
2435
2433
|
object: s.union([K, ae, fe, he]).describe("The fetched object data.")
|
|
2436
2434
|
}, lo = {
|
|
@@ -2702,13 +2700,13 @@ function wo({
|
|
|
2702
2700
|
a = `Found ${e.length} ${d} for ${t} ${r}${c}`, o && (a += " • More available");
|
|
2703
2701
|
}
|
|
2704
2702
|
if (n) {
|
|
2705
|
-
const i =
|
|
2703
|
+
const i = jt([], n);
|
|
2706
2704
|
return `${a}
|
|
2707
2705
|
${i}`;
|
|
2708
2706
|
}
|
|
2709
2707
|
return a;
|
|
2710
2708
|
}
|
|
2711
|
-
function
|
|
2709
|
+
function $t(e) {
|
|
2712
2710
|
const t = e.getUTCFullYear(), r = String(e.getUTCMonth() + 1).padStart(2, "0"), o = String(e.getUTCDate()).padStart(2, "0");
|
|
2713
2711
|
return `${t}-${r}-${o}`;
|
|
2714
2712
|
}
|
|
@@ -2721,14 +2719,14 @@ function Io(e) {
|
|
|
2721
2719
|
}
|
|
2722
2720
|
function vo(e, t) {
|
|
2723
2721
|
const r = new Date(e.getTime() + t * 60 * 1e3);
|
|
2724
|
-
return
|
|
2722
|
+
return $t(r);
|
|
2725
2723
|
}
|
|
2726
|
-
function
|
|
2724
|
+
function st(e, t) {
|
|
2727
2725
|
const [r, o, n] = e.split("-"), a = Number(r), i = Number(o), c = Number(n);
|
|
2728
2726
|
if (!Number.isFinite(a) || !Number.isFinite(i) || !Number.isFinite(c))
|
|
2729
2727
|
throw new Error(`Invalid date format: ${e}. Expected YYYY-MM-DD.`);
|
|
2730
2728
|
const d = new Date(Date.UTC(a, i - 1, c));
|
|
2731
|
-
return d.setUTCDate(d.getUTCDate() + t),
|
|
2729
|
+
return d.setUTCDate(d.getUTCDate() + t), $t(d);
|
|
2732
2730
|
}
|
|
2733
2731
|
const jo = ["and", "or"], qe = {
|
|
2734
2732
|
labels: s.string().array().optional().describe("The labels to filter the tasks by"),
|
|
@@ -2748,9 +2746,9 @@ function Co({
|
|
|
2748
2746
|
userGmtOffset: r,
|
|
2749
2747
|
now: o = /* @__PURE__ */ new Date()
|
|
2750
2748
|
}) {
|
|
2751
|
-
const n = Io(r), a = vo(o, n), i = So - 1, c = t ?? (e ?
|
|
2749
|
+
const n = Io(r), a = vo(o, n), i = So - 1, c = t ?? (e ? st(e, i) : a);
|
|
2752
2750
|
return {
|
|
2753
|
-
since: e ??
|
|
2751
|
+
since: e ?? st(c, -i),
|
|
2754
2752
|
until: c
|
|
2755
2753
|
};
|
|
2756
2754
|
}
|
|
@@ -2935,7 +2933,7 @@ No shared labels.`;
|
|
|
2935
2933
|
zeroReasonHints: p
|
|
2936
2934
|
}) + m;
|
|
2937
2935
|
}
|
|
2938
|
-
const { FIND_PROJECTS: Uo, ADD_TASKS:
|
|
2936
|
+
const { FIND_PROJECTS: Uo, ADD_TASKS: Dt, UPDATE_TASKS: xt } = f, _o = {
|
|
2939
2937
|
projectId: s.string().min(1).describe("The ID of the project to search for collaborators in."),
|
|
2940
2938
|
searchTerm: s.string().optional().describe(
|
|
2941
2939
|
"Search for a collaborator by name or email (partial and case insensitive match). If omitted, all collaborators in the project are returned."
|
|
@@ -2968,7 +2966,7 @@ const { FIND_PROJECTS: Uo, ADD_TASKS: xt, UPDATE_TASKS: At } = f, _o = {
|
|
|
2968
2966
|
|
|
2969
2967
|
**Next steps:**
|
|
2970
2968
|
• Share the project to enable collaboration
|
|
2971
|
-
• Use ${
|
|
2969
|
+
• Use ${Dt} and ${xt} for assignment features once shared`,
|
|
2972
2970
|
structuredContent: {
|
|
2973
2971
|
collaborators: [],
|
|
2974
2972
|
projectInfo: {
|
|
@@ -3049,7 +3047,7 @@ function Mo({
|
|
|
3049
3047
|
const c = [];
|
|
3050
3048
|
e.length === 0 && (r ? (c.push(`No collaborators match "${r}"`), c.push("Try a broader search term or check spelling"), o > 0 && c.push(`${o} collaborators available without filter`)) : (c.push("Project has no collaborators"), c.push("Share the project to add collaborators")));
|
|
3051
3049
|
const d = [];
|
|
3052
|
-
return e.length > 0 ? (d.push(`Use ${
|
|
3050
|
+
return e.length > 0 ? (d.push(`Use ${Dt} with responsibleUser to assign new tasks`), d.push(`Use ${xt} with responsibleUser to reassign existing tasks`), d.push("Use collaborator names, emails, or IDs for assignments")) : (d.push(`Use ${Uo} to find other projects`), r && o > 0 && d.push("Try searching without filters to see all collaborators")), F({
|
|
3053
3051
|
subject: n,
|
|
3054
3052
|
count: e.length,
|
|
3055
3053
|
filterHints: a,
|
|
@@ -3082,7 +3080,7 @@ const { ADD_PROJECTS: Fo } = f, Ho = {
|
|
|
3082
3080
|
async execute(e, t) {
|
|
3083
3081
|
let r, o = null;
|
|
3084
3082
|
if (e.searchText)
|
|
3085
|
-
r = await
|
|
3083
|
+
r = await kt(t, e.searchText), o = null;
|
|
3086
3084
|
else {
|
|
3087
3085
|
const a = await t.getProjects({
|
|
3088
3086
|
limit: e.limit,
|
|
@@ -3199,7 +3197,7 @@ const Yo = {
|
|
|
3199
3197
|
function Ko(e, t) {
|
|
3200
3198
|
if (e.length === 0)
|
|
3201
3199
|
return `No reminders found for task ${t}`;
|
|
3202
|
-
const { timeBasedCount: r, locationCount: o } =
|
|
3200
|
+
const { timeBasedCount: r, locationCount: o } = Tt(e), n = [];
|
|
3203
3201
|
if (r > 0) {
|
|
3204
3202
|
const a = r > 1 ? "time-based reminders" : "time-based reminder";
|
|
3205
3203
|
n.push(`${r} ${a}`);
|
|
@@ -3330,7 +3328,7 @@ ${u}` + (d.length > 5 ? `
|
|
|
3330
3328
|
this.cache = null;
|
|
3331
3329
|
}
|
|
3332
3330
|
}
|
|
3333
|
-
const sn = new tn(), { FIND_COMPLETED_TASKS:
|
|
3331
|
+
const sn = new tn(), { FIND_COMPLETED_TASKS: rt, ADD_TASKS: ot } = f, rn = {
|
|
3334
3332
|
searchText: s.string().optional().describe("The text to search for in tasks."),
|
|
3335
3333
|
projectId: s.string().optional().describe(
|
|
3336
3334
|
'Find tasks in this project. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
@@ -3338,7 +3336,7 @@ const sn = new tn(), { FIND_COMPLETED_TASKS: ot, ADD_TASKS: nt } = f, rn = {
|
|
|
3338
3336
|
sectionId: s.string().optional().describe("Find tasks in this section."),
|
|
3339
3337
|
parentId: s.string().optional().describe("Find subtasks of this parent task."),
|
|
3340
3338
|
responsibleUser: s.string().optional().describe("Find tasks assigned to this user. Can be a user ID, name, or email address."),
|
|
3341
|
-
responsibleUserFiltering: s.enum(
|
|
3339
|
+
responsibleUserFiltering: s.enum(gt).optional().describe(
|
|
3342
3340
|
'How to filter by responsible user when responsibleUser is not provided. "assigned" = only tasks assigned to others; "unassignedOrMe" = only unassigned tasks or tasks assigned to me; "all" = all tasks regardless of assignment. Default value will be `unassignedOrMe`.'
|
|
3343
3341
|
),
|
|
3344
3342
|
limit: s.number().int().min(1).max(C.TASKS_MAX).default(C.TASKS_DEFAULT).describe("The maximum number of tasks to return."),
|
|
@@ -3458,7 +3456,7 @@ const sn = new tn(), { FIND_COMPLETED_TASKS: ot, ADD_TASKS: nt } = f, rn = {
|
|
|
3458
3456
|
r && (b = se(b, `search: ${r}`));
|
|
3459
3457
|
const S = Ke(u, p);
|
|
3460
3458
|
if (b = se(b, S), !(h && !i && !c)) {
|
|
3461
|
-
const x =
|
|
3459
|
+
const x = yt({
|
|
3462
3460
|
resolvedAssigneeId: N,
|
|
3463
3461
|
assigneeEmail: T,
|
|
3464
3462
|
responsibleUserFiltering: c
|
|
@@ -3494,7 +3492,7 @@ function an(e) {
|
|
|
3494
3492
|
const t = [
|
|
3495
3493
|
e.searchText ? "No tasks in project match search" : "Project has no tasks yet"
|
|
3496
3494
|
];
|
|
3497
|
-
return e.searchText || t.push(`Use ${
|
|
3495
|
+
return e.searchText || t.push(`Use ${ot} to create tasks`), t;
|
|
3498
3496
|
}
|
|
3499
3497
|
if (e.sectionId) {
|
|
3500
3498
|
const t = [e.searchText ? "No tasks in section match search" : "Section is empty"];
|
|
@@ -3502,7 +3500,7 @@ function an(e) {
|
|
|
3502
3500
|
}
|
|
3503
3501
|
if (e.parentId) {
|
|
3504
3502
|
const t = [e.searchText ? "No subtasks match search" : "No subtasks created yet"];
|
|
3505
|
-
return e.searchText || t.push(`Use ${
|
|
3503
|
+
return e.searchText || t.push(`Use ${ot} with parentId to add subtasks`), t;
|
|
3506
3504
|
}
|
|
3507
3505
|
return [];
|
|
3508
3506
|
}
|
|
@@ -3538,9 +3536,9 @@ function Se({
|
|
|
3538
3536
|
if (e.length === 0) {
|
|
3539
3537
|
if (t.responsibleUser) {
|
|
3540
3538
|
const u = n || t.responsibleUser;
|
|
3541
|
-
c.push(`No tasks assigned to ${u}`), c.push("Check if the user name is correct"), c.push(`Check completed tasks with ${
|
|
3539
|
+
c.push(`No tasks assigned to ${u}`), c.push("Check if the user name is correct"), c.push(`Check completed tasks with ${rt}`);
|
|
3542
3540
|
}
|
|
3543
|
-
t.searchText && (c.push("Try broader search terms"), c.push("Verify spelling and try partial words"), t.responsibleUser || c.push(`Check completed tasks with ${
|
|
3541
|
+
t.searchText && (c.push("Try broader search terms"), c.push("Verify spelling and try partial words"), t.responsibleUser || c.push(`Check completed tasks with ${rt}`));
|
|
3544
3542
|
}
|
|
3545
3543
|
}
|
|
3546
3544
|
return F({
|
|
@@ -3553,7 +3551,7 @@ function Se({
|
|
|
3553
3551
|
zeroReasonHints: c
|
|
3554
3552
|
});
|
|
3555
3553
|
}
|
|
3556
|
-
function
|
|
3554
|
+
function At(e) {
|
|
3557
3555
|
return /* @__PURE__ */ new Date(`${e}T00:00:00`);
|
|
3558
3556
|
}
|
|
3559
3557
|
const cn = {
|
|
@@ -3571,7 +3569,7 @@ const cn = {
|
|
|
3571
3569
|
responsibleUser: s.string().optional().describe(
|
|
3572
3570
|
"Filter tasks assigned to this user. User ID, name, or email. For personal queries (summaries, plans, reports), set to current user from user-info to exclude collaborators."
|
|
3573
3571
|
),
|
|
3574
|
-
responsibleUserFiltering: s.enum(
|
|
3572
|
+
responsibleUserFiltering: s.enum(gt).optional().describe(
|
|
3575
3573
|
"Filter when responsibleUser is omitted. 'assigned'=assigned to others; 'unassignedOrMe'=unassigned+mine; 'all'=everyone. Default: 'unassignedOrMe'."
|
|
3576
3574
|
),
|
|
3577
3575
|
...qe
|
|
@@ -3603,12 +3601,12 @@ const cn = {
|
|
|
3603
3601
|
} else
|
|
3604
3602
|
a = e.overdueOption === "exclude-overdue" ? "today" : "(today | overdue)";
|
|
3605
3603
|
else if (e.startDate) {
|
|
3606
|
-
const p = e.startDate, m = De(
|
|
3604
|
+
const p = e.startDate, m = De(At(p), e.daysCount), h = Je(m, { representation: "date" });
|
|
3607
3605
|
a = `(due after: ${p} | due: ${p}) & due before: ${h}`;
|
|
3608
3606
|
}
|
|
3609
3607
|
const i = Ke(e.labels, e.labelsOperator);
|
|
3610
3608
|
i.length > 0 && (a = se(a, `(${i})`));
|
|
3611
|
-
const c =
|
|
3609
|
+
const c = yt({
|
|
3612
3610
|
resolvedAssigneeId: o,
|
|
3613
3611
|
assigneeEmail: n,
|
|
3614
3612
|
responsibleUserFiltering: e.responsibleUserFiltering
|
|
@@ -3647,7 +3645,7 @@ function un({
|
|
|
3647
3645
|
`today${c}${t.daysCount > 1 ? ` + ${t.daysCount - 1} more days` : ""}`
|
|
3648
3646
|
);
|
|
3649
3647
|
} else if (t.startDate) {
|
|
3650
|
-
const c = t.daysCount > 1 ? ` to ${te(De(
|
|
3648
|
+
const c = t.daysCount > 1 ? ` to ${te(De(At(t.startDate), t.daysCount))}` : "";
|
|
3651
3649
|
n.push(`${t.startDate}${c}`);
|
|
3652
3650
|
}
|
|
3653
3651
|
if (t.labels && t.labels.length > 0) {
|
|
@@ -3686,7 +3684,7 @@ const pn = {
|
|
|
3686
3684
|
projectId: s.string().min(1).optional().describe(
|
|
3687
3685
|
"Optional project ID. If provided, shows detailed overview of that project. If omitted, shows overview of all projects."
|
|
3688
3686
|
)
|
|
3689
|
-
},
|
|
3687
|
+
}, Et = s.lazy(
|
|
3690
3688
|
() => s.object({
|
|
3691
3689
|
id: s.string().describe("The project ID."),
|
|
3692
3690
|
name: s.string().describe("The project name."),
|
|
@@ -3699,7 +3697,7 @@ const pn = {
|
|
|
3699
3697
|
name: s.string()
|
|
3700
3698
|
})
|
|
3701
3699
|
),
|
|
3702
|
-
children: s.array(
|
|
3700
|
+
children: s.array(Et).describe("Nested child projects.")
|
|
3703
3701
|
})
|
|
3704
3702
|
), mn = {
|
|
3705
3703
|
type: s.enum(["account_overview", "project_overview"]).describe("The type of overview returned."),
|
|
@@ -3725,7 +3723,7 @@ const pn = {
|
|
|
3725
3723
|
})
|
|
3726
3724
|
).describe("Sections in the inbox project.")
|
|
3727
3725
|
}).nullable().optional().describe("Inbox information (account overview only)."),
|
|
3728
|
-
projects: s.array(s.lazy(() =>
|
|
3726
|
+
projects: s.array(s.lazy(() => Et)).optional().describe(
|
|
3729
3727
|
"List of projects with hierarchy, folders, and ordering (account overview only)."
|
|
3730
3728
|
),
|
|
3731
3729
|
project: s.object({
|
|
@@ -3779,17 +3777,17 @@ async function fn(e, t) {
|
|
|
3779
3777
|
})
|
|
3780
3778
|
), r;
|
|
3781
3779
|
}
|
|
3782
|
-
function
|
|
3780
|
+
function Ot(e, t, r = "") {
|
|
3783
3781
|
const o = [];
|
|
3784
3782
|
o.push(`${r}- Project: ${e.name} (id=${e.id})`);
|
|
3785
3783
|
const n = t[e.id] || [];
|
|
3786
3784
|
for (const a of n)
|
|
3787
3785
|
o.push(`${r} - Section: ${a.name} (id=${a.id})`);
|
|
3788
3786
|
for (const a of e.children)
|
|
3789
|
-
o.push(...
|
|
3787
|
+
o.push(...Ot(a, t, `${r} `));
|
|
3790
3788
|
return o;
|
|
3791
3789
|
}
|
|
3792
|
-
function
|
|
3790
|
+
function nt(e) {
|
|
3793
3791
|
const t = {};
|
|
3794
3792
|
for (const o of e)
|
|
3795
3793
|
t[o.id] = { ...o, children: [] };
|
|
@@ -3814,7 +3812,7 @@ function Re(e, t = "") {
|
|
|
3814
3812
|
}
|
|
3815
3813
|
return r;
|
|
3816
3814
|
}
|
|
3817
|
-
function
|
|
3815
|
+
function Pt(e, t) {
|
|
3818
3816
|
return {
|
|
3819
3817
|
id: e.id,
|
|
3820
3818
|
name: e.name,
|
|
@@ -3822,7 +3820,7 @@ function Rt(e, t) {
|
|
|
3822
3820
|
folderId: Pe(e) ? e.folderId ?? void 0 : void 0,
|
|
3823
3821
|
childOrder: e.childOrder,
|
|
3824
3822
|
sections: t[e.id] || [],
|
|
3825
|
-
children: e.children.map((r) =>
|
|
3823
|
+
children: e.children.map((r) => Pt(r, t))
|
|
3826
3824
|
};
|
|
3827
3825
|
}
|
|
3828
3826
|
async function bn(e, t) {
|
|
@@ -3850,7 +3848,7 @@ async function yn(e) {
|
|
|
3850
3848
|
}
|
|
3851
3849
|
if (n.length)
|
|
3852
3850
|
for (const p of n)
|
|
3853
|
-
c.push(...
|
|
3851
|
+
c.push(...Ot(p, i));
|
|
3854
3852
|
else
|
|
3855
3853
|
c.push("_No projects found._");
|
|
3856
3854
|
c.push("");
|
|
@@ -3868,7 +3866,7 @@ async function yn(e) {
|
|
|
3868
3866
|
sections: i[r.id] || []
|
|
3869
3867
|
} : null,
|
|
3870
3868
|
projects: n.map(
|
|
3871
|
-
(p) =>
|
|
3869
|
+
(p) => Pt(p, i)
|
|
3872
3870
|
),
|
|
3873
3871
|
totalProjects: t.length,
|
|
3874
3872
|
totalSections: a.reduce(
|
|
@@ -3893,7 +3891,7 @@ async function kn(e, t) {
|
|
|
3893
3891
|
const c = [`# ${r.name}`];
|
|
3894
3892
|
if (i.length > 0) {
|
|
3895
3893
|
c.push("");
|
|
3896
|
-
const u =
|
|
3894
|
+
const u = nt(i);
|
|
3897
3895
|
c.push(...Re(u));
|
|
3898
3896
|
}
|
|
3899
3897
|
for (const u of o) {
|
|
@@ -3901,7 +3899,7 @@ async function kn(e, t) {
|
|
|
3901
3899
|
const p = a[u.id];
|
|
3902
3900
|
if (!p?.length)
|
|
3903
3901
|
continue;
|
|
3904
|
-
const m =
|
|
3902
|
+
const m = nt(p);
|
|
3905
3903
|
c.push(...Re(m));
|
|
3906
3904
|
}
|
|
3907
3905
|
const d = c.join(`
|
|
@@ -3942,7 +3940,7 @@ const Tn = {
|
|
|
3942
3940
|
count: s.number().describe("Number of consecutive periods in this streak."),
|
|
3943
3941
|
start: s.string().describe("Start date of the streak."),
|
|
3944
3942
|
end: s.string().describe("End date of the streak.")
|
|
3945
|
-
}),
|
|
3943
|
+
}), at = s.object({
|
|
3946
3944
|
id: s.string().describe("Project ID."),
|
|
3947
3945
|
completed: s.number().describe("Number of tasks completed in this project.")
|
|
3948
3946
|
}), In = {
|
|
@@ -3951,7 +3949,7 @@ const Tn = {
|
|
|
3951
3949
|
s.object({
|
|
3952
3950
|
date: s.string().describe("Date string (YYYY-MM-DD)."),
|
|
3953
3951
|
totalCompleted: s.number().describe("Total tasks completed on this day."),
|
|
3954
|
-
items: s.array(
|
|
3952
|
+
items: s.array(at).describe("Per-project completion breakdown for this day.")
|
|
3955
3953
|
})
|
|
3956
3954
|
).describe("Daily completion breakdown (most recent days)."),
|
|
3957
3955
|
weekItems: s.array(
|
|
@@ -3959,7 +3957,7 @@ const Tn = {
|
|
|
3959
3957
|
from: s.string().describe("Start date of the week."),
|
|
3960
3958
|
to: s.string().describe("End date of the week."),
|
|
3961
3959
|
totalCompleted: s.number().describe("Total tasks completed in this week."),
|
|
3962
|
-
items: s.array(
|
|
3960
|
+
items: s.array(at).describe("Per-project completion breakdown for this week.")
|
|
3963
3961
|
})
|
|
3964
3962
|
).describe("Weekly completion breakdown (most recent weeks)."),
|
|
3965
3963
|
goals: s.object({
|
|
@@ -4290,7 +4288,7 @@ const Un = {
|
|
|
4290
4288
|
idempotentHint: !0
|
|
4291
4289
|
},
|
|
4292
4290
|
async execute(e, t) {
|
|
4293
|
-
const { workspaceIdOrName: r, projectIds: o } = e, n = await
|
|
4291
|
+
const { workspaceIdOrName: r, projectIds: o } = e, n = await wt.resolveWorkspace(t, r), a = await t.getWorkspaceInsights(n.workspaceId, { projectIds: o }), i = a.projectInsights.map((d) => ({
|
|
4294
4292
|
projectId: d.projectId,
|
|
4295
4293
|
health: d.health ? {
|
|
4296
4294
|
status: d.health.status,
|
|
@@ -4326,8 +4324,8 @@ const Un = {
|
|
|
4326
4324
|
}, Fn = {}, Hn = {
|
|
4327
4325
|
id: s.string().describe("The unique identifier for the workspace."),
|
|
4328
4326
|
name: s.string().describe("The name of the workspace."),
|
|
4329
|
-
plan: s.enum(
|
|
4330
|
-
role: s.enum(
|
|
4327
|
+
plan: s.enum(Mt).describe("The workspace plan type."),
|
|
4328
|
+
role: s.enum(Lt).optional().describe("The user's role in the workspace, if available."),
|
|
4331
4329
|
isLinkSharingEnabled: s.boolean().describe("Whether link sharing is enabled for the workspace."),
|
|
4332
4330
|
isGuestAllowed: s.boolean().describe("Whether guests are allowed in the workspace."),
|
|
4333
4331
|
createdAt: s.string().optional().describe("The ISO 8601 timestamp when the workspace was created."),
|
|
@@ -4381,7 +4379,7 @@ const zn = {
|
|
|
4381
4379
|
structuredContent: r.structuredContent
|
|
4382
4380
|
};
|
|
4383
4381
|
}
|
|
4384
|
-
}, { FIND_TASKS: Yn, FIND_PROJECT_COLLABORATORS:
|
|
4382
|
+
}, { FIND_TASKS: Yn, FIND_PROJECT_COLLABORATORS: it, UPDATE_TASKS: Gn } = f, qn = 50, Kn = {
|
|
4385
4383
|
operation: s.enum(["assign", "unassign", "reassign"]).describe("The assignment operation to perform."),
|
|
4386
4384
|
taskIds: s.array(s.string()).min(1).max(qn).describe("The IDs of the tasks to operate on (max 50)."),
|
|
4387
4385
|
responsibleUser: s.string().optional().describe(
|
|
@@ -4636,13 +4634,13 @@ function Ce({
|
|
|
4636
4634
|
return !r && o.length > 0 ? (c += `**Next steps:**
|
|
4637
4635
|
`, c += `• Use ${Yn} with responsibleUser to see ${e === "unassign" ? "unassigned" : "newly assigned"} tasks
|
|
4638
4636
|
`, c += `• Use ${Gn} for individual assignment changes
|
|
4639
|
-
`, n.length > 0 && (c += `• Check failed tasks and use ${
|
|
4637
|
+
`, n.length > 0 && (c += `• Check failed tasks and use ${it} to verify collaborator access
|
|
4640
4638
|
`)) : r ? (c += `**To execute:**
|
|
4641
4639
|
`, c += `• Remove dryRun parameter and run again to execute changes
|
|
4642
4640
|
`, o.length > 0 && (c += `• ${o.length} task${o.length === 1 ? "" : "s"} ready for ${e} operation
|
|
4643
4641
|
`), n.length > 0 && (c += `• Fix ${n.length} validation error${n.length === 1 ? "" : "s"} before executing
|
|
4644
4642
|
`)) : o.length === 0 && (c += `**Suggestions:**
|
|
4645
|
-
`, c += `• Use ${
|
|
4643
|
+
`, c += `• Use ${it} to find valid assignees
|
|
4646
4644
|
`, c += `• Check task IDs and assignee permissions
|
|
4647
4645
|
`, c += `• Use dryRun=true to validate before executing
|
|
4648
4646
|
`), c;
|
|
@@ -4707,8 +4705,8 @@ const Xn = {
|
|
|
4707
4705
|
}
|
|
4708
4706
|
};
|
|
4709
4707
|
}
|
|
4710
|
-
},
|
|
4711
|
-
type: s.enum(
|
|
4708
|
+
}, Rt = ["project", "section"], ra = {
|
|
4709
|
+
type: s.enum(Rt).describe(
|
|
4712
4710
|
'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.'
|
|
4713
4711
|
),
|
|
4714
4712
|
items: s.array(
|
|
@@ -4725,7 +4723,7 @@ const Xn = {
|
|
|
4725
4723
|
"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."
|
|
4726
4724
|
)
|
|
4727
4725
|
}, oa = {
|
|
4728
|
-
type: s.enum(
|
|
4726
|
+
type: s.enum(Rt).describe("The type of entity that was reordered/moved."),
|
|
4729
4727
|
movedCount: s.number().describe("The number of entities moved to a new parent."),
|
|
4730
4728
|
reorderedCount: s.number().describe("The number of entities reordered."),
|
|
4731
4729
|
affectedIds: s.array(s.string()).describe("The IDs of all affected entities."),
|
|
@@ -4887,19 +4885,19 @@ const ua = {
|
|
|
4887
4885
|
limit: C.TASKS_MAX,
|
|
4888
4886
|
cursor: void 0
|
|
4889
4887
|
}),
|
|
4890
|
-
|
|
4888
|
+
kt(t, r)
|
|
4891
4889
|
]), a = [];
|
|
4892
4890
|
for (const i of o.tasks)
|
|
4893
4891
|
a.push({
|
|
4894
4892
|
id: `task:${i.id}`,
|
|
4895
4893
|
title: i.content,
|
|
4896
|
-
url:
|
|
4894
|
+
url: ut(i.id)
|
|
4897
4895
|
});
|
|
4898
4896
|
for (const i of n)
|
|
4899
4897
|
a.push({
|
|
4900
4898
|
id: `project:${i.id}`,
|
|
4901
4899
|
title: i.name,
|
|
4902
|
-
url:
|
|
4900
|
+
url: pt(i.id)
|
|
4903
4901
|
});
|
|
4904
4902
|
return {
|
|
4905
4903
|
textContent: JSON.stringify({ results: a }),
|
|
@@ -5177,7 +5175,7 @@ const Ua = s.object({
|
|
|
5177
5175
|
}), _a = s.object({
|
|
5178
5176
|
type: s.literal("absolute"),
|
|
5179
5177
|
id: s.string().min(1).describe("The ID of the absolute reminder to update."),
|
|
5180
|
-
due:
|
|
5178
|
+
due: It.optional().describe("New due date/time for the reminder."),
|
|
5181
5179
|
service: ge.optional().describe('New delivery method: "email" or "push".'),
|
|
5182
5180
|
isUrgent: ye
|
|
5183
5181
|
}), Na = s.object({
|
|
@@ -5186,7 +5184,7 @@ const Ua = s.object({
|
|
|
5186
5184
|
name: s.string().optional().describe("New location name."),
|
|
5187
5185
|
locLat: s.string().optional().describe("New latitude."),
|
|
5188
5186
|
locLong: s.string().optional().describe("New longitude."),
|
|
5189
|
-
locTrigger:
|
|
5187
|
+
locTrigger: vt.optional().describe(
|
|
5190
5188
|
'New trigger condition: "on_enter" or "on_leave".'
|
|
5191
5189
|
),
|
|
5192
5190
|
radius: s.number().int().optional().describe("New radius in meters.")
|
|
@@ -5356,21 +5354,21 @@ const qa = s.object({
|
|
|
5356
5354
|
...N,
|
|
5357
5355
|
...D !== void 0 && { labels: D }
|
|
5358
5356
|
};
|
|
5359
|
-
I && (b.priority =
|
|
5360
|
-
const S =
|
|
5357
|
+
I && (b.priority = bt(I));
|
|
5358
|
+
const S = ct(
|
|
5361
5359
|
m,
|
|
5362
5360
|
Ka,
|
|
5363
5361
|
Ja
|
|
5364
5362
|
);
|
|
5365
5363
|
S !== void 0 && (b = { ...b, dueString: S });
|
|
5366
|
-
const U =
|
|
5364
|
+
const U = ct(
|
|
5367
5365
|
$,
|
|
5368
5366
|
Va,
|
|
5369
5367
|
null
|
|
5370
5368
|
);
|
|
5371
5369
|
if (U !== void 0 && (b = { ...b, deadlineDate: U }), h)
|
|
5372
5370
|
try {
|
|
5373
|
-
const { minutes: v } =
|
|
5371
|
+
const { minutes: v } = ft(h);
|
|
5374
5372
|
b = {
|
|
5375
5373
|
...b,
|
|
5376
5374
|
duration: v,
|
|
@@ -5434,7 +5432,7 @@ function ei({
|
|
|
5434
5432
|
function ti({ id: e, ...t }) {
|
|
5435
5433
|
return Object.keys(t).length > 0;
|
|
5436
5434
|
}
|
|
5437
|
-
function
|
|
5435
|
+
function ct(e, t, r) {
|
|
5438
5436
|
if (e === void 0)
|
|
5439
5437
|
return e;
|
|
5440
5438
|
if (e === null)
|
|
@@ -5484,11 +5482,11 @@ function di(e) {
|
|
|
5484
5482
|
return !1;
|
|
5485
5483
|
}
|
|
5486
5484
|
}
|
|
5487
|
-
function
|
|
5485
|
+
function Ut(e) {
|
|
5488
5486
|
return di(e) ? e : "UTC";
|
|
5489
5487
|
}
|
|
5490
5488
|
function li(e, t) {
|
|
5491
|
-
const r =
|
|
5489
|
+
const r = Ut(t);
|
|
5492
5490
|
return e.toLocaleString("en-US", {
|
|
5493
5491
|
timeZone: r,
|
|
5494
5492
|
year: "numeric",
|
|
@@ -5501,7 +5499,7 @@ function li(e, t) {
|
|
|
5501
5499
|
});
|
|
5502
5500
|
}
|
|
5503
5501
|
async function ui(e) {
|
|
5504
|
-
const t = await e.getUser(), r = t.tzInfo?.timezone ?? "UTC", o =
|
|
5502
|
+
const t = await e.getUser(), r = t.tzInfo?.timezone ?? "UTC", o = Ut(r), n = /* @__PURE__ */ new Date(), a = li(n, o), i = t.startDay ?? 1, c = ci(i), d = oi(t), l = new Date(n.toLocaleString("en-US", { timeZone: o })), u = ni(l, i), p = ai(u), m = ii(l), g = [
|
|
5505
5503
|
"# User Information",
|
|
5506
5504
|
"",
|
|
5507
5505
|
`**User ID:** ${t.id}`,
|
|
@@ -5556,7 +5554,7 @@ const pi = {
|
|
|
5556
5554
|
structuredContent: r.structuredContent
|
|
5557
5555
|
};
|
|
5558
5556
|
}
|
|
5559
|
-
},
|
|
5557
|
+
}, dt = 10 * 1024 * 1024, mi = /* @__PURE__ */ new Set([
|
|
5560
5558
|
"image/png",
|
|
5561
5559
|
"image/jpeg",
|
|
5562
5560
|
"image/gif",
|
|
@@ -5630,7 +5628,7 @@ const Ti = {
|
|
|
5630
5628
|
},
|
|
5631
5629
|
async execute({ fileUrl: e }, t) {
|
|
5632
5630
|
const r = await t.viewAttachment(e), o = r.headers["content-length"], n = o ? Number.parseInt(o, 10) : void 0, a = ki(e), i = r.headers["content-type"], c = i ? gi(i) : void 0, d = c && c !== "application/octet-stream" ? c : yi(e) ?? c ?? "application/octet-stream";
|
|
5633
|
-
if (n && n >
|
|
5631
|
+
if (n && n > dt)
|
|
5634
5632
|
return {
|
|
5635
5633
|
textContent: `Attachment "${a ?? e}" is too large to display inline (${(n / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`,
|
|
5636
5634
|
structuredContent: {
|
|
@@ -5641,7 +5639,7 @@ const Ti = {
|
|
|
5641
5639
|
}
|
|
5642
5640
|
};
|
|
5643
5641
|
const l = Buffer.from(await r.arrayBuffer()), u = l.byteLength;
|
|
5644
|
-
if (u >
|
|
5642
|
+
if (u > dt)
|
|
5645
5643
|
return {
|
|
5646
5644
|
textContent: `Attachment "${a ?? e}" is too large to display inline (${(u / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`,
|
|
5647
5645
|
structuredContent: {
|
|
@@ -5780,7 +5778,7 @@ function Ui({
|
|
|
5780
5778
|
baseUrl: t,
|
|
5781
5779
|
features: r = []
|
|
5782
5780
|
}) {
|
|
5783
|
-
const o = new
|
|
5781
|
+
const o = new Ht(
|
|
5784
5782
|
{ name: "todoist-mcp-server", version: "0.1.0" },
|
|
5785
5783
|
{
|
|
5786
5784
|
capabilities: {
|
|
@@ -5789,7 +5787,7 @@ function Ui({
|
|
|
5789
5787
|
},
|
|
5790
5788
|
instructions: vi
|
|
5791
5789
|
}
|
|
5792
|
-
), n = new
|
|
5790
|
+
), n = new Ft(e, { baseUrl: t }), a = {
|
|
5793
5791
|
...ln,
|
|
5794
5792
|
_meta: {
|
|
5795
5793
|
ui: {
|