@doist/todoist-mcp 13.2.2 → 13.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-apps/index.html +2 -2
- package/dist/{mcp-server-kvXDYyFL.js → mcp-server-B74_sI2e.js} +190 -190
- package/dist/{require-valid-todoist-token-lYrGqi07.js → require-valid-todoist-token-7FOpFoUE.js} +1 -1
- package/dist/usage-tracking.d.ts +5 -1
- package/dist/usage-tracking.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { ResourceTemplate as Bs, McpServer as zs } from "@modelcontextprotocol/server";
|
|
2
|
-
import { createHash as
|
|
2
|
+
import { createHash as Gt, randomUUID as Ne } from "node:crypto";
|
|
3
3
|
import { readFileSync as Ks } from "node:fs";
|
|
4
4
|
import { dirname as Vt, join as Me } from "node:path";
|
|
5
|
-
import { fileURLToPath as
|
|
5
|
+
import { fileURLToPath as qs } from "node:url";
|
|
6
6
|
import { RESOURCE_MIME_TYPE as Fe } from "@modelcontextprotocol/ext-apps/server";
|
|
7
|
-
import ae, { ZodError as
|
|
8
|
-
import { AsyncLocalStorage as
|
|
7
|
+
import ae, { ZodError as Ys, z as s } from "zod";
|
|
8
|
+
import { AsyncLocalStorage as Gs } from "node:async_hooks";
|
|
9
9
|
import { createRequire as Vs } from "node:module";
|
|
10
|
-
import { TodoistApi as Js, isWorkspaceProject as Ce, isPersonalProject as
|
|
10
|
+
import { TodoistApi as Js, isWorkspaceProject as Ce, isPersonalProject as q, colors as He, LOCATION_TRIGGERS as Jt, REMINDER_TYPES as Xs, createCommand as Q, REMINDER_DELIVERY_SERVICES as Qs, HEALTH_STATUSES as tt, getTaskUrl as Xt, getProjectUrl as Qt, parseTodoistUrl as Zs, WORKSPACE_ROLES as er, WORKSPACE_PLANS as tr } from "@doist/todoist-sdk";
|
|
11
11
|
import { addDays as We, formatISO as yt } from "date-fns";
|
|
12
|
-
const Tt = Vt(
|
|
12
|
+
const Tt = Vt(qs(import.meta.url)), sr = [
|
|
13
13
|
Me(Tt, "task-list", "index.html"),
|
|
14
14
|
Me(Tt, "mcp-apps", "index.html")
|
|
15
15
|
], rr = `<!doctype html>
|
|
@@ -28,7 +28,7 @@ function or() {
|
|
|
28
28
|
}
|
|
29
29
|
return console.error("Failed to load task list app HTML from any known path:", e), rr;
|
|
30
30
|
}
|
|
31
|
-
const Zt = or(), nr =
|
|
31
|
+
const Zt = or(), nr = Gt("sha256").update(Zt).digest("hex").slice(0, 12), Be = `ui://todoist/task-list@${nr}`, ir = "ui://todoist/task-list@{hash}", ze = "Interactive task list widget", ar = "https://ai.todoist.net", Ke = {
|
|
32
32
|
ui: {
|
|
33
33
|
prefersBorder: !0,
|
|
34
34
|
csp: {
|
|
@@ -81,7 +81,7 @@ function cr(e) {
|
|
|
81
81
|
function ee(e) {
|
|
82
82
|
return typeof e == "object" && e !== null;
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function qe(...e) {
|
|
85
85
|
return e.find(ee);
|
|
86
86
|
}
|
|
87
87
|
function F(...e) {
|
|
@@ -115,7 +115,7 @@ function L(e, t = 220) {
|
|
|
115
115
|
const r = dr(e).replace(/\s+/g, " ").trim();
|
|
116
116
|
return r.length <= t ? r : `${r.slice(0, t - 3)}...`;
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function Ye(e) {
|
|
119
119
|
const t = e.trim();
|
|
120
120
|
return /\bHTTP\s*\d{3}\b/i.test(t) || /\bstatus code \d{3}\b/i.test(t) || /^bad request$/i.test(t) || /^unauthorized$/i.test(t) || /^forbidden$/i.test(t) || /^not found$/i.test(t);
|
|
121
121
|
}
|
|
@@ -165,7 +165,7 @@ function lr(e) {
|
|
|
165
165
|
v(e.path)
|
|
166
166
|
);
|
|
167
167
|
r(o);
|
|
168
|
-
const n =
|
|
168
|
+
const n = qe(
|
|
169
169
|
e.details,
|
|
170
170
|
e.errorDetails,
|
|
171
171
|
e.errorExtra,
|
|
@@ -230,7 +230,7 @@ const ur = [
|
|
|
230
230
|
function pr(e) {
|
|
231
231
|
return e ? ur.some((t) => e[t] !== void 0) : !1;
|
|
232
232
|
}
|
|
233
|
-
const
|
|
233
|
+
const Ge = {
|
|
234
234
|
MAX_ITEMS_LIMIT_REACHED: "This project has reached the maximum number of active tasks per project (subtasks count toward it; completed tasks do not). The cap is the same on every Todoist plan — upgrading will not raise it — and it is not an authentication or permission problem. Complete, delete, or move existing tasks out of the project, or add the task to a different project, then retry.",
|
|
235
235
|
USER_CANNOT_VIEW_TEMPLATE: "This template exists but belongs to another account. Personal templates are private to whoever saved them, and a link to one cannot be used by anyone else. Use a public gallery template instead, or ask the owner to export it with export-project-template and share the CSV."
|
|
236
236
|
};
|
|
@@ -238,16 +238,16 @@ function hr(...e) {
|
|
|
238
238
|
for (const t of e) {
|
|
239
239
|
if (!t)
|
|
240
240
|
continue;
|
|
241
|
-
const r = t.toUpperCase(), o = Object.keys(
|
|
241
|
+
const r = t.toUpperCase(), o = Object.keys(Ge).find(
|
|
242
242
|
(n) => r.includes(n)
|
|
243
243
|
);
|
|
244
244
|
if (o)
|
|
245
|
-
return
|
|
245
|
+
return Ge[o];
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
248
|
function mr(e) {
|
|
249
249
|
if (e.tag) {
|
|
250
|
-
const t =
|
|
250
|
+
const t = Ge[e.tag.toUpperCase()];
|
|
251
251
|
if (t)
|
|
252
252
|
return t;
|
|
253
253
|
}
|
|
@@ -261,7 +261,7 @@ function fr(e) {
|
|
|
261
261
|
return r === 401 ? "Authentication failed. Verify your API token, then retry." : r === 403 ? "Access denied. Retrying the same request will not help. If it's a scope/access problem (for example, insufficient token scope), use a token or account with the required access. Otherwise, change the request or target instead." : r === 404 ? "Confirm the referenced IDs exist and are accessible, then retry." : r === 429 ? "Rate limit reached. Wait briefly and retry." : r !== void 0 && r >= 500 ? "Todoist API may be temporarily unavailable. Retry shortly." : o ? "Fix the field hints above and retry." : r === 400 || r === 422 ? "Check parameter values and formats, then retry." : "Check the request parameters and retry.";
|
|
262
262
|
}
|
|
263
263
|
function st(e) {
|
|
264
|
-
const t = ee(e) ? e : void 0, r = e instanceof Error && ee(e.cause) ? e.cause : void 0, o =
|
|
264
|
+
const t = ee(e) ? e : void 0, r = e instanceof Error && ee(e.cause) ? e.cause : void 0, o = qe(t?.response, r?.response), n = qe(
|
|
265
265
|
t?.responseData,
|
|
266
266
|
o?.data,
|
|
267
267
|
t?.data,
|
|
@@ -301,7 +301,7 @@ function st(e) {
|
|
|
301
301
|
v(t?.message),
|
|
302
302
|
v(r?.message),
|
|
303
303
|
e instanceof Error ? e.message : v(e)
|
|
304
|
-
].filter((m) => !!m), u = d.find((m) => !
|
|
304
|
+
].filter((m) => !!m), u = d.find((m) => !Ye(m)) || d[0], l = F(
|
|
305
305
|
X(n?.errorExtra),
|
|
306
306
|
X(n?.error_extra),
|
|
307
307
|
X(n?.details),
|
|
@@ -309,7 +309,7 @@ function st(e) {
|
|
|
309
309
|
X(n?.errors),
|
|
310
310
|
X(t?.details)
|
|
311
311
|
), p = lr(n);
|
|
312
|
-
return i !== void 0 || pr(n) || c !== void 0 || a !== void 0 || (u ?
|
|
312
|
+
return i !== void 0 || pr(n) || c !== void 0 || a !== void 0 || (u ? Ye(u) : !1) ? {
|
|
313
313
|
statusCode: i,
|
|
314
314
|
code: a,
|
|
315
315
|
tag: c ? L(c, 80) : void 0,
|
|
@@ -349,7 +349,7 @@ function N(e) {
|
|
|
349
349
|
const t = st(e);
|
|
350
350
|
if (!t)
|
|
351
351
|
return ts(e);
|
|
352
|
-
const r = es(t), o = t.message && !(r.length > 0 &&
|
|
352
|
+
const r = es(t), o = t.message && !(r.length > 0 && Ye(t.message)) ? t.message : "Todoist API request failed";
|
|
353
353
|
return r.length > 0 ? `${o} (${r.join(", ")})` : o;
|
|
354
354
|
}
|
|
355
355
|
function gr(e, {
|
|
@@ -366,12 +366,12 @@ function gr(e, {
|
|
|
366
366
|
return d !== r.trim() && d ? `Task "${t}" wasn't created because \`dueString\` could not be parsed. Use Todoist recurrence syntax, for example \`${d}\`; don't prefix it with \`recurring\`. Change only \`dueString\` and retry.` : d !== r.trim() ? `Task "${t}" wasn't created because \`dueString\` could not be parsed. Use a complete Todoist recurrence expression; \`recurring\` alone is not valid. Change only \`dueString\` and retry.` : `Task "${t}" wasn't created because \`dueString\` could not be parsed. Change only \`dueString\` and retry.`;
|
|
367
367
|
}
|
|
368
368
|
function yr(e) {
|
|
369
|
-
if (e instanceof
|
|
369
|
+
if (e instanceof Ys || e instanceof $e || e instanceof ss)
|
|
370
370
|
return e.message;
|
|
371
371
|
const t = st(e);
|
|
372
372
|
return t ? br(t) : ts(e);
|
|
373
373
|
}
|
|
374
|
-
const Tr = "13.2.
|
|
374
|
+
const Tr = "13.2.3", kr = {
|
|
375
375
|
version: Tr
|
|
376
376
|
}, j = {
|
|
377
377
|
/** Default limit for task listings */
|
|
@@ -498,7 +498,7 @@ function St() {
|
|
|
498
498
|
return It ??= rt(), It;
|
|
499
499
|
}
|
|
500
500
|
function jr(e) {
|
|
501
|
-
return
|
|
501
|
+
return Gt("sha256").update(e).digest("hex");
|
|
502
502
|
}
|
|
503
503
|
function $r({ moves: e, writes: t }) {
|
|
504
504
|
return e.isIdle() && t.isIdle();
|
|
@@ -506,10 +506,10 @@ function $r({ moves: e, writes: t }) {
|
|
|
506
506
|
function ns(e) {
|
|
507
507
|
return e.leases === 0 && $r(e.limiters);
|
|
508
508
|
}
|
|
509
|
-
function
|
|
509
|
+
function Ar(e, t, r) {
|
|
510
510
|
W.delete(e), t.lastUsedAt = r, W.set(e, t);
|
|
511
511
|
}
|
|
512
|
-
function
|
|
512
|
+
function Dr(e) {
|
|
513
513
|
for (const [t, r] of W) {
|
|
514
514
|
if (e - r.lastUsedAt < Ir)
|
|
515
515
|
break;
|
|
@@ -527,8 +527,8 @@ function is(e, t) {
|
|
|
527
527
|
return;
|
|
528
528
|
const r = W.get(e);
|
|
529
529
|
if (r)
|
|
530
|
-
return
|
|
531
|
-
if (
|
|
530
|
+
return Ar(e, r, t), r;
|
|
531
|
+
if (Dr(t), W.size >= Sr && !xr())
|
|
532
532
|
return;
|
|
533
533
|
const o = { limiters: rt(), lastUsedAt: t, leases: 0 };
|
|
534
534
|
return W.set(e, o), o;
|
|
@@ -580,7 +580,7 @@ function Pr(e) {
|
|
|
580
580
|
function _r(e) {
|
|
581
581
|
return as(e, "writes");
|
|
582
582
|
}
|
|
583
|
-
const Ur = "todoist-mcp", ot = kr.version, cs = new
|
|
583
|
+
const Ur = "todoist-mcp", ot = kr.version, cs = new Gs(), jt = Vs(import.meta.url);
|
|
584
584
|
let Se;
|
|
585
585
|
const Rr = async () => {
|
|
586
586
|
const e = jt.resolve("@doist/todoist-sdk"), t = Me(Vt(e), "transport", "http-dispatcher.js");
|
|
@@ -660,18 +660,20 @@ function Wr(e, t) {
|
|
|
660
660
|
}
|
|
661
661
|
async function Br() {
|
|
662
662
|
if (zr())
|
|
663
|
-
return Se || (Se = Lr().then((e) => e.
|
|
663
|
+
return Se || (Se = Lr().then((e) => e.getDefaultTransport()).catch((e) => {
|
|
664
664
|
throw Se = void 0, e;
|
|
665
665
|
})), Se;
|
|
666
666
|
}
|
|
667
667
|
function zr() {
|
|
668
668
|
return typeof process < "u" && !!process.versions?.node;
|
|
669
669
|
}
|
|
670
|
-
async function Kr(e) {
|
|
671
|
-
|
|
672
|
-
|
|
670
|
+
async function Kr(e, t) {
|
|
671
|
+
if ("dispatcher" in t)
|
|
672
|
+
return e;
|
|
673
|
+
const r = await Br();
|
|
674
|
+
return r ? (t.dispatcher = r.dispatcher, r.fetch ?? e) : e;
|
|
673
675
|
}
|
|
674
|
-
function
|
|
676
|
+
function qr(e) {
|
|
675
677
|
return {
|
|
676
678
|
ok: e.ok,
|
|
677
679
|
status: e.status,
|
|
@@ -682,7 +684,7 @@ function Yr(e) {
|
|
|
682
684
|
arrayBuffer: () => e.arrayBuffer()
|
|
683
685
|
};
|
|
684
686
|
}
|
|
685
|
-
function
|
|
687
|
+
function Yr(e = globalThis.fetch, t = {}) {
|
|
686
688
|
const r = e === globalThis.fetch, { enabled: o = !0, platform: n = "mcp", sessionId: i = Ne() } = t;
|
|
687
689
|
return async (a, c = {}) => {
|
|
688
690
|
const { timeout: d, headers: u, signal: l, ...p } = c, { signal: h, cleanup: m } = Wr(l, d);
|
|
@@ -691,21 +693,19 @@ function Gr(e = globalThis.fetch, t = {}) {
|
|
|
691
693
|
...p,
|
|
692
694
|
signal: h,
|
|
693
695
|
...o ? { headers: Hr(u, { platform: n, sessionId: i }) } : u !== void 0 ? { headers: u } : {}
|
|
694
|
-
};
|
|
695
|
-
|
|
696
|
-
const f = await e(a, y);
|
|
697
|
-
return Yr(f);
|
|
696
|
+
}, w = await (r ? await Kr(e, y) : e)(a, y);
|
|
697
|
+
return qr(w);
|
|
698
698
|
} finally {
|
|
699
699
|
m();
|
|
700
700
|
}
|
|
701
701
|
};
|
|
702
702
|
}
|
|
703
|
-
function
|
|
703
|
+
function Gr(e, {
|
|
704
704
|
baseUrl: t,
|
|
705
705
|
tracking: r
|
|
706
706
|
} = {}) {
|
|
707
707
|
const o = new Js(e, {
|
|
708
|
-
customFetch:
|
|
708
|
+
customFetch: Yr(globalThis.fetch, r),
|
|
709
709
|
...t ? { baseUrl: t } : {}
|
|
710
710
|
});
|
|
711
711
|
return Or(o, e), o;
|
|
@@ -846,8 +846,8 @@ const g = {
|
|
|
846
846
|
* Affects: find-project-collaborators, find-completed-tasks
|
|
847
847
|
*/
|
|
848
848
|
STRIP_EMAILS: "strip_emails"
|
|
849
|
-
}, oo = process.env.USE_STRUCTURED_CONTENT === "true" || process.env.NODE_ENV === "test",
|
|
850
|
-
function
|
|
849
|
+
}, oo = process.env.USE_STRUCTURED_CONTENT === "true" || process.env.NODE_ENV === "test", At = /* @__PURE__ */ new WeakMap();
|
|
850
|
+
function Dt(e, t) {
|
|
851
851
|
const r = s.toJSONSchema(e, { target: "draft-2020-12", io: t }), o = e["~standard"];
|
|
852
852
|
return {
|
|
853
853
|
"~standard": {
|
|
@@ -860,14 +860,14 @@ function At(e, t) {
|
|
|
860
860
|
};
|
|
861
861
|
}
|
|
862
862
|
function no(e) {
|
|
863
|
-
const t =
|
|
863
|
+
const t = At.get(e);
|
|
864
864
|
if (t)
|
|
865
865
|
return t;
|
|
866
866
|
const r = {
|
|
867
|
-
input:
|
|
868
|
-
...e.outputSchema ? { output:
|
|
867
|
+
input: Dt(s.object(e.parameters), "input"),
|
|
868
|
+
...e.outputSchema ? { output: Dt(s.object(e.outputSchema), "output") } : {}
|
|
869
869
|
};
|
|
870
|
-
return
|
|
870
|
+
return At.set(e, r), r;
|
|
871
871
|
}
|
|
872
872
|
function io({
|
|
873
873
|
textContent: e,
|
|
@@ -1187,7 +1187,7 @@ const Ue = new hs(
|
|
|
1187
1187
|
$o,
|
|
1188
1188
|
ps
|
|
1189
1189
|
), ms = "me";
|
|
1190
|
-
class
|
|
1190
|
+
class Ao {
|
|
1191
1191
|
/**
|
|
1192
1192
|
* Resolve a user name or ID to a user ID by looking up collaborators across all shared projects.
|
|
1193
1193
|
* Supports exact name matches, partial matches, email matches, and the "me" keyword.
|
|
@@ -1322,8 +1322,8 @@ class Do {
|
|
|
1322
1322
|
Ue.clear(), de.clear();
|
|
1323
1323
|
}
|
|
1324
1324
|
}
|
|
1325
|
-
const H = new
|
|
1326
|
-
async function
|
|
1325
|
+
const H = new Ao();
|
|
1326
|
+
async function Do(e, t) {
|
|
1327
1327
|
return H.resolveUser(e, t);
|
|
1328
1328
|
}
|
|
1329
1329
|
async function xo(e, t) {
|
|
@@ -1351,7 +1351,7 @@ const fs = ["assigned", "unassignedOrMe", "all"];
|
|
|
1351
1351
|
async function at(e, t) {
|
|
1352
1352
|
if (!t)
|
|
1353
1353
|
return;
|
|
1354
|
-
const r = await
|
|
1354
|
+
const r = await Do(e, t);
|
|
1355
1355
|
if (!r)
|
|
1356
1356
|
throw new Error(
|
|
1357
1357
|
`Could not find user: "${t}". Make sure the user is a collaborator on a shared project.`
|
|
@@ -1488,8 +1488,8 @@ function te(e) {
|
|
|
1488
1488
|
color: e.color,
|
|
1489
1489
|
isFavorite: e.isFavorite,
|
|
1490
1490
|
isShared: e.isShared,
|
|
1491
|
-
parentId:
|
|
1492
|
-
inboxProject:
|
|
1491
|
+
parentId: q(e) ? e.parentId ?? void 0 : void 0,
|
|
1492
|
+
inboxProject: q(e) ? e.inboxProject ?? !1 : !1,
|
|
1493
1493
|
viewStyle: e.viewStyle,
|
|
1494
1494
|
workspaceId: Ce(e) ? e.workspaceId : void 0,
|
|
1495
1495
|
folderId: Ce(e) ? e.folderId ?? void 0 : void 0,
|
|
@@ -1543,7 +1543,7 @@ const No = ae.object({
|
|
|
1543
1543
|
errorTag: ae.string()
|
|
1544
1544
|
})
|
|
1545
1545
|
});
|
|
1546
|
-
function
|
|
1546
|
+
function Ae(e) {
|
|
1547
1547
|
const t = e?.trim();
|
|
1548
1548
|
return t && t !== "0" ? e : void 0;
|
|
1549
1549
|
}
|
|
@@ -1647,15 +1647,15 @@ function Et(e, t) {
|
|
|
1647
1647
|
o && o !== t && r.add(o);
|
|
1648
1648
|
return [...r];
|
|
1649
1649
|
}
|
|
1650
|
-
const
|
|
1650
|
+
const De = He.map((e) => e.key);
|
|
1651
1651
|
function Wo(e) {
|
|
1652
1652
|
if (typeof e != "string") return;
|
|
1653
1653
|
const t = e.toLowerCase();
|
|
1654
1654
|
return (He.find((o) => o.key === t) ?? He.find((o) => o.displayName.toLowerCase() === t))?.key;
|
|
1655
1655
|
}
|
|
1656
|
-
const Bo = `Color for the entity. Accepts a color key (e.g. "berry_red") or display name (e.g. "Berry Red"). Valid colors: ${
|
|
1657
|
-
s.enum(
|
|
1658
|
-
const be = s.enum(
|
|
1656
|
+
const Bo = `Color for the entity. Accepts a color key (e.g. "berry_red") or display name (e.g. "Berry Red"). Valid colors: ${De.join(", ")}. Unrecognized colors are omitted and charcoal will be used as the default.`, fe = s.preprocess(Wo, s.enum(De).optional()).describe(Bo);
|
|
1657
|
+
s.enum(De);
|
|
1658
|
+
const be = s.enum(De).optional().catch(void 0), K = s.object({
|
|
1659
1659
|
id: s.string(),
|
|
1660
1660
|
content: s.string().describe("Task title."),
|
|
1661
1661
|
description: s.string(),
|
|
@@ -1688,13 +1688,13 @@ const be = s.enum(Ae).optional().catch(void 0), K = s.object({
|
|
|
1688
1688
|
folderId: s.string().optional().describe("Workspace projects only."),
|
|
1689
1689
|
childOrder: s.number().describe("Ordering index among siblings."),
|
|
1690
1690
|
isArchived: s.boolean()
|
|
1691
|
-
}),
|
|
1691
|
+
}), Y = s.object({
|
|
1692
1692
|
id: s.string(),
|
|
1693
1693
|
name: s.string(),
|
|
1694
1694
|
sectionOrder: s.number().describe("Ordering index within the project."),
|
|
1695
1695
|
description: s.string().optional().describe("Supports Markdown.")
|
|
1696
1696
|
});
|
|
1697
|
-
function
|
|
1697
|
+
function G({ id: e, name: t, sectionOrder: r, description: o }) {
|
|
1698
1698
|
return { id: e, name: t, sectionOrder: r, description: o ?? void 0 };
|
|
1699
1699
|
}
|
|
1700
1700
|
const zo = s.object({
|
|
@@ -1729,7 +1729,7 @@ const zo = s.object({
|
|
|
1729
1729
|
parentItemId: s.string().optional(),
|
|
1730
1730
|
initiatorId: s.string().optional().describe("User who initiated the event."),
|
|
1731
1731
|
extraData: s.record(s.string(), s.unknown()).optional()
|
|
1732
|
-
}),
|
|
1732
|
+
}), qo = s.object({
|
|
1733
1733
|
id: s.string(),
|
|
1734
1734
|
name: s.string(),
|
|
1735
1735
|
email: s.string()
|
|
@@ -1739,7 +1739,7 @@ const zo = s.object({
|
|
|
1739
1739
|
color: be,
|
|
1740
1740
|
order: s.number().optional().catch(void 0).describe("Display order."),
|
|
1741
1741
|
isFavorite: s.boolean()
|
|
1742
|
-
}),
|
|
1742
|
+
}), Yo = s.object({
|
|
1743
1743
|
isRecurring: s.boolean(),
|
|
1744
1744
|
string: s.string().describe("Human-readable due string."),
|
|
1745
1745
|
date: s.string().describe("ISO 8601."),
|
|
@@ -1750,7 +1750,7 @@ const zo = s.object({
|
|
|
1750
1750
|
taskId: s.string(),
|
|
1751
1751
|
type: s.enum(Xs),
|
|
1752
1752
|
minuteOffset: s.number().optional().describe("Minutes before due. Relative reminders only."),
|
|
1753
|
-
due:
|
|
1753
|
+
due: Yo.optional().describe("Absolute, and sometimes relative, reminders."),
|
|
1754
1754
|
name: s.string().optional().describe("Location name. Location reminders only."),
|
|
1755
1755
|
locLat: s.string().optional().describe("Location reminders only."),
|
|
1756
1756
|
locLong: s.string().optional().describe("Location reminders only."),
|
|
@@ -1761,7 +1761,7 @@ const zo = s.object({
|
|
|
1761
1761
|
item: s.string().describe("Usually the ID of the item that failed."),
|
|
1762
1762
|
error: s.string(),
|
|
1763
1763
|
code: s.string().optional()
|
|
1764
|
-
}),
|
|
1764
|
+
}), Go = s.object({
|
|
1765
1765
|
taskId: s.string().optional().describe("The ID of the task to comment on."),
|
|
1766
1766
|
projectId: s.string().optional().describe(
|
|
1767
1767
|
'The ID of the project to comment on. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
@@ -1771,7 +1771,7 @@ const zo = s.object({
|
|
|
1771
1771
|
`Who to notify about this comment — a user ID, email, full name, or "me" for each person. Set this whenever the comment mentions someone; the text of an @mention notifies nobody on its own. Omit to notify whoever the Todoist apps would (the task's assignee, assigner and creator on a first comment, or the previous comment's participants on a reply). Pass ["${Ts}"] to notify nobody.`
|
|
1772
1772
|
)
|
|
1773
1773
|
}), Vo = {
|
|
1774
|
-
comments: s.array(
|
|
1774
|
+
comments: s.array(Go).min(1).describe("The array of comments to add.")
|
|
1775
1775
|
}, Jo = {
|
|
1776
1776
|
comments: s.array(ve).describe("The created comments."),
|
|
1777
1777
|
totalCount: s.number().describe("The total number of comments created."),
|
|
@@ -2286,7 +2286,7 @@ const je = 25, Ee = s.enum(Qs), Is = s.object({
|
|
|
2286
2286
|
'Delivery method: "email" or "push" notification. Defaults to push.'
|
|
2287
2287
|
),
|
|
2288
2288
|
isUrgent: Oe
|
|
2289
|
-
}),
|
|
2289
|
+
}), An = s.object({
|
|
2290
2290
|
type: s.literal("location"),
|
|
2291
2291
|
taskId: s.string().min(1).describe("The ID of the task to set a reminder for."),
|
|
2292
2292
|
name: s.string().min(1).describe('Name of the location, e.g. "Office", "Home".'),
|
|
@@ -2296,12 +2296,12 @@ const je = 25, Ee = s.enum(Qs), Is = s.object({
|
|
|
2296
2296
|
'When to trigger: "on_enter" (arriving) or "on_leave" (departing).'
|
|
2297
2297
|
),
|
|
2298
2298
|
radius: s.number().int().optional().describe("Radius in meters for the geofence. Defaults to server default.")
|
|
2299
|
-
}),
|
|
2299
|
+
}), Dn = s.discriminatedUnion("type", [
|
|
2300
2300
|
jn,
|
|
2301
2301
|
$n,
|
|
2302
|
-
|
|
2302
|
+
An
|
|
2303
2303
|
]), xn = {
|
|
2304
|
-
reminders: s.array(
|
|
2304
|
+
reminders: s.array(Dn).min(1).max(je).describe(
|
|
2305
2305
|
`Array of reminders to create (max ${je}). Each reminder must specify a type: "relative" (minutes before due), "absolute" (specific date/time), or "location" (geofence trigger).`
|
|
2306
2306
|
)
|
|
2307
2307
|
}, En = {
|
|
@@ -2375,7 +2375,7 @@ const _n = s.object({
|
|
|
2375
2375
|
}), Un = {
|
|
2376
2376
|
sections: s.array(_n).min(1).describe("The array of sections to add.")
|
|
2377
2377
|
}, Rn = {
|
|
2378
|
-
sections: s.array(
|
|
2378
|
+
sections: s.array(Y).describe("The created sections."),
|
|
2379
2379
|
totalCount: s.number().describe("The total number of sections created."),
|
|
2380
2380
|
failures: s.array(re).describe(
|
|
2381
2381
|
"Sections that could not be created, with the reason for each. A failure here does not affect the other sections in the batch — do not retry the whole batch; address or drop the failed items."
|
|
@@ -2408,7 +2408,7 @@ const _n = s.object({
|
|
|
2408
2408
|
}), oe(g.ADD_SECTIONS, e.length, i, { redactItems: !0 }), {
|
|
2409
2409
|
textContent: Nn({ sections: n, failures: i }),
|
|
2410
2410
|
structuredContent: {
|
|
2411
|
-
sections: n.map(
|
|
2411
|
+
sections: n.map(G),
|
|
2412
2412
|
totalCount: n.length,
|
|
2413
2413
|
failures: i,
|
|
2414
2414
|
totalRequested: e.length,
|
|
@@ -2814,9 +2814,9 @@ async function zn(e, t, r) {
|
|
|
2814
2814
|
d
|
|
2815
2815
|
);
|
|
2816
2816
|
if (!w.isValid) {
|
|
2817
|
-
const C = w.error?.message || "Assignment validation failed",
|
|
2817
|
+
const C = w.error?.message || "Assignment validation failed", D = w.error?.suggestions?.join(". ") || "";
|
|
2818
2818
|
throw new Error(
|
|
2819
|
-
`Task "${e.content}": ${C}${
|
|
2819
|
+
`Task "${e.content}": ${C}${D ? `. ${D}` : ""}`
|
|
2820
2820
|
);
|
|
2821
2821
|
}
|
|
2822
2822
|
y.assigneeId = w.resolvedUser?.userId;
|
|
@@ -2857,11 +2857,11 @@ function Kn({
|
|
|
2857
2857
|
showDetails: !0
|
|
2858
2858
|
});
|
|
2859
2859
|
}
|
|
2860
|
-
const
|
|
2860
|
+
const qn = {
|
|
2861
2861
|
projectId: s.string().min(1).describe(
|
|
2862
2862
|
"The ID of the project to analyze. This triggers a new health analysis which may take some time to complete."
|
|
2863
2863
|
)
|
|
2864
|
-
},
|
|
2864
|
+
}, Yn = {
|
|
2865
2865
|
projectId: s.string().describe("The project ID."),
|
|
2866
2866
|
health: s.object({
|
|
2867
2867
|
status: s.enum(tt).describe("The health status after triggering analysis."),
|
|
@@ -2869,11 +2869,11 @@ const Yn = {
|
|
|
2869
2869
|
updateInProgress: s.boolean().describe("Whether an analysis update is currently in progress.")
|
|
2870
2870
|
}).describe("The health response returned after triggering analysis."),
|
|
2871
2871
|
message: s.string().describe("A human-readable message about the analysis status.")
|
|
2872
|
-
},
|
|
2872
|
+
}, Gn = {
|
|
2873
2873
|
name: g.ANALYZE_PROJECT_HEALTH,
|
|
2874
2874
|
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.",
|
|
2875
|
-
parameters:
|
|
2876
|
-
outputSchema:
|
|
2875
|
+
parameters: qn,
|
|
2876
|
+
outputSchema: Yn,
|
|
2877
2877
|
annotations: {
|
|
2878
2878
|
readOnlyHint: !1,
|
|
2879
2879
|
destructiveHint: !1,
|
|
@@ -3122,11 +3122,11 @@ async function di(e, t) {
|
|
|
3122
3122
|
};
|
|
3123
3123
|
}
|
|
3124
3124
|
async function li(e, t) {
|
|
3125
|
-
if (!
|
|
3125
|
+
if (!q(t))
|
|
3126
3126
|
return { childCount: 0, children: [] };
|
|
3127
3127
|
const r = await gs(e), o = /* @__PURE__ */ new Map();
|
|
3128
3128
|
for (const a of r) {
|
|
3129
|
-
if (!
|
|
3129
|
+
if (!q(a) || !a.parentId) continue;
|
|
3130
3130
|
const c = o.get(a.parentId) ?? [];
|
|
3131
3131
|
c.push(a), o.set(a.parentId, c);
|
|
3132
3132
|
}
|
|
@@ -3163,7 +3163,7 @@ const $s = ["task", "project", "comment", "section"], ui = {
|
|
|
3163
3163
|
}, pi = {
|
|
3164
3164
|
type: s.enum($s).describe("The type of object fetched."),
|
|
3165
3165
|
id: s.string().describe("The ID of the fetched object."),
|
|
3166
|
-
object: s.union([K, se, ve,
|
|
3166
|
+
object: s.union([K, se, ve, Y]).describe("The fetched object data."),
|
|
3167
3167
|
...ci
|
|
3168
3168
|
}, hi = {
|
|
3169
3169
|
name: g.FETCH_OBJECT,
|
|
@@ -3217,7 +3217,7 @@ const $s = ["task", "project", "comment", "section"], ui = {
|
|
|
3217
3217
|
const i = await t.getSection(o);
|
|
3218
3218
|
if (!i)
|
|
3219
3219
|
throw new Error(`Section ${o} not found.`);
|
|
3220
|
-
const a =
|
|
3220
|
+
const a = G(i);
|
|
3221
3221
|
return {
|
|
3222
3222
|
textContent: `Found section: ${a.name} • id=${a.id}`,
|
|
3223
3223
|
structuredContent: {
|
|
@@ -3463,7 +3463,7 @@ const Ci = {
|
|
|
3463
3463
|
outputSchema: ji,
|
|
3464
3464
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3465
3465
|
async execute(e, t) {
|
|
3466
|
-
const r =
|
|
3466
|
+
const r = Ae(e.cursor), o = [e.taskId, e.projectId, e.commentId].filter(Boolean);
|
|
3467
3467
|
if (o.length === 0)
|
|
3468
3468
|
throw new Error("Must provide exactly one of: taskId, projectId, or commentId.");
|
|
3469
3469
|
if (o.length > 1)
|
|
@@ -3495,7 +3495,7 @@ const Ci = {
|
|
|
3495
3495
|
throw new Error("Invalid state: no search parameter provided");
|
|
3496
3496
|
const d = c.map(we);
|
|
3497
3497
|
return {
|
|
3498
|
-
textContent:
|
|
3498
|
+
textContent: Ai({
|
|
3499
3499
|
comments: d,
|
|
3500
3500
|
searchType: e.commentId ? "single" : e.taskId ? "task" : "project",
|
|
3501
3501
|
searchId: e.commentId || e.taskId || e.projectId || "",
|
|
@@ -3513,7 +3513,7 @@ const Ci = {
|
|
|
3513
3513
|
};
|
|
3514
3514
|
}
|
|
3515
3515
|
};
|
|
3516
|
-
function
|
|
3516
|
+
function Ai({
|
|
3517
3517
|
comments: e,
|
|
3518
3518
|
searchType: t,
|
|
3519
3519
|
searchId: r,
|
|
@@ -3539,11 +3539,11 @@ ${a}`;
|
|
|
3539
3539
|
}
|
|
3540
3540
|
return i;
|
|
3541
3541
|
}
|
|
3542
|
-
function
|
|
3542
|
+
function As(e) {
|
|
3543
3543
|
const t = e.getUTCFullYear(), r = String(e.getUTCMonth() + 1).padStart(2, "0"), o = String(e.getUTCDate()).padStart(2, "0");
|
|
3544
3544
|
return `${t}-${r}-${o}`;
|
|
3545
3545
|
}
|
|
3546
|
-
function
|
|
3546
|
+
function Di(e) {
|
|
3547
3547
|
const t = /^([+-])(\d{2}):(\d{2})$/.exec(e);
|
|
3548
3548
|
if (!t)
|
|
3549
3549
|
return 0;
|
|
@@ -3552,14 +3552,14 @@ function Ai(e) {
|
|
|
3552
3552
|
}
|
|
3553
3553
|
function xi(e, t) {
|
|
3554
3554
|
const r = new Date(e.getTime() + t * 60 * 1e3);
|
|
3555
|
-
return
|
|
3555
|
+
return As(r);
|
|
3556
3556
|
}
|
|
3557
3557
|
function Nt(e, t) {
|
|
3558
3558
|
const [r, o, n] = e.split("-"), i = Number(r), a = Number(o), c = Number(n);
|
|
3559
3559
|
if (!Number.isFinite(i) || !Number.isFinite(a) || !Number.isFinite(c))
|
|
3560
3560
|
throw new Error(`Invalid date format: ${e}. Expected YYYY-MM-DD.`);
|
|
3561
3561
|
const d = new Date(Date.UTC(i, a - 1, c));
|
|
3562
|
-
return d.setUTCDate(d.getUTCDate() + t),
|
|
3562
|
+
return d.setUTCDate(d.getUTCDate() + t), As(d);
|
|
3563
3563
|
}
|
|
3564
3564
|
const Ei = ["and", "or"], bt = {
|
|
3565
3565
|
labels: s.string().array().optional().describe("The labels to filter the tasks by"),
|
|
@@ -3579,7 +3579,7 @@ function Pi({
|
|
|
3579
3579
|
userGmtOffset: r,
|
|
3580
3580
|
now: o = /* @__PURE__ */ new Date()
|
|
3581
3581
|
}) {
|
|
3582
|
-
const n =
|
|
3582
|
+
const n = Di(r), i = xi(o, n), a = Oi - 1, c = t ?? (e ? Nt(e, a) : i);
|
|
3583
3583
|
return {
|
|
3584
3584
|
since: e ?? Nt(c, -a),
|
|
3585
3585
|
until: c
|
|
@@ -3632,7 +3632,7 @@ const _i = {
|
|
|
3632
3632
|
projectId: d,
|
|
3633
3633
|
cursor: u,
|
|
3634
3634
|
...l
|
|
3635
|
-
} = e, p =
|
|
3635
|
+
} = e, p = Ae(u);
|
|
3636
3636
|
if (p && (!i || !a))
|
|
3637
3637
|
throw new Error(
|
|
3638
3638
|
"Cursor pagination requires explicit since and until. Reuse structuredContent.appliedFilters.since and structuredContent.appliedFilters.until from the previous page."
|
|
@@ -3640,7 +3640,7 @@ const _i = {
|
|
|
3640
3640
|
const h = await at(t, c), m = h?.email;
|
|
3641
3641
|
let f = gt(o, n);
|
|
3642
3642
|
h && m && (f = he(f, `assigned to: ${m}`));
|
|
3643
|
-
const w = await t.getUser(), C = w.tzInfo?.gmtString || "+00:00",
|
|
3643
|
+
const w = await t.getUser(), C = w.tzInfo?.gmtString || "+00:00", D = await me({
|
|
3644
3644
|
projectId: d,
|
|
3645
3645
|
user: w
|
|
3646
3646
|
}), T = Pi({
|
|
@@ -3651,21 +3651,21 @@ const _i = {
|
|
|
3651
3651
|
...e,
|
|
3652
3652
|
since: T.since,
|
|
3653
3653
|
until: T.until
|
|
3654
|
-
}, { items:
|
|
3654
|
+
}, { items: A, nextCursor: x } = r === "completion" ? await t.getCompletedTasksByCompletionDate({
|
|
3655
3655
|
...l,
|
|
3656
3656
|
...p ? { cursor: p } : {},
|
|
3657
|
-
projectId:
|
|
3657
|
+
projectId: D,
|
|
3658
3658
|
since: k,
|
|
3659
3659
|
until: b,
|
|
3660
3660
|
...f ? { filterQuery: f, filterLang: "en" } : {}
|
|
3661
3661
|
}) : await t.getCompletedTasksByDueDate({
|
|
3662
3662
|
...l,
|
|
3663
3663
|
...p ? { cursor: p } : {},
|
|
3664
|
-
projectId:
|
|
3664
|
+
projectId: D,
|
|
3665
3665
|
since: k,
|
|
3666
3666
|
until: b,
|
|
3667
3667
|
...f ? { filterQuery: f, filterLang: "en" } : {}
|
|
3668
|
-
}), E =
|
|
3668
|
+
}), E = A.map(_);
|
|
3669
3669
|
return {
|
|
3670
3670
|
textContent: Li({
|
|
3671
3671
|
tasks: E,
|
|
@@ -3778,7 +3778,7 @@ No shared labels.`;
|
|
|
3778
3778
|
zeroReasonHints: p
|
|
3779
3779
|
}) + h;
|
|
3780
3780
|
}
|
|
3781
|
-
const { FIND_PROJECTS:
|
|
3781
|
+
const { FIND_PROJECTS: Ds, ADD_TASKS: xs, UPDATE_TASKS: Es } = g, Wi = {
|
|
3782
3782
|
projectId: s.string().min(1).optional().describe(
|
|
3783
3783
|
'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.'
|
|
3784
3784
|
),
|
|
@@ -3786,7 +3786,7 @@ const { FIND_PROJECTS: As, ADD_TASKS: xs, UPDATE_TASKS: Es } = g, Wi = {
|
|
|
3786
3786
|
"Search for a user by name or email (partial and case insensitive match). If omitted, all users are returned."
|
|
3787
3787
|
)
|
|
3788
3788
|
}, Bi = {
|
|
3789
|
-
collaborators: s.array(
|
|
3789
|
+
collaborators: s.array(qo).describe("The found users."),
|
|
3790
3790
|
projectInfo: s.object({
|
|
3791
3791
|
id: s.string().describe("The project ID."),
|
|
3792
3792
|
name: s.string().describe("The project name."),
|
|
@@ -3879,13 +3879,13 @@ async function Ki({
|
|
|
3879
3879
|
client: t,
|
|
3880
3880
|
appliedFilters: r
|
|
3881
3881
|
}) {
|
|
3882
|
-
const o = await H.getAllCollaborators(t), n = await
|
|
3882
|
+
const o = await H.getAllCollaborators(t), n = await qi(t, o);
|
|
3883
3883
|
if (n.length === 0)
|
|
3884
3884
|
return {
|
|
3885
3885
|
textContent: `No users found. You may have no shared projects, or collaborator data is not accessible.
|
|
3886
3886
|
|
|
3887
3887
|
**Next steps:**
|
|
3888
|
-
• Use ${
|
|
3888
|
+
• Use ${Ds} to find shared projects
|
|
3889
3889
|
• Share a project to add collaborators
|
|
3890
3890
|
• Ensure you have permission to view collaborators`,
|
|
3891
3891
|
structuredContent: {
|
|
@@ -3913,7 +3913,7 @@ async function Ki({
|
|
|
3913
3913
|
}
|
|
3914
3914
|
};
|
|
3915
3915
|
}
|
|
3916
|
-
async function
|
|
3916
|
+
async function qi(e, t) {
|
|
3917
3917
|
try {
|
|
3918
3918
|
const r = await e.getUser();
|
|
3919
3919
|
return !r || t.some((o) => o.id === r.id) ? t : [
|
|
@@ -3948,7 +3948,7 @@ function Ps({
|
|
|
3948
3948
|
const u = [];
|
|
3949
3949
|
e.length === 0 && r && (u.push(`No users match "${r}"`), u.push("Try a broader search term or check spelling"), o > 0 && u.push(`${o} users available without filter`));
|
|
3950
3950
|
const l = [];
|
|
3951
|
-
return e.length > 0 ? (l.push(`Use ${xs} with responsibleUser to assign new tasks`), l.push(`Use ${Es} with responsibleUser to reassign existing tasks`), l.push("Use user names, emails, or IDs for assignments")) : (l.push(`Use ${
|
|
3951
|
+
return e.length > 0 ? (l.push(`Use ${xs} with responsibleUser to assign new tasks`), l.push(`Use ${Es} with responsibleUser to reassign existing tasks`), l.push("Use user names, emails, or IDs for assignments")) : (l.push(`Use ${Ds} to find other projects`), r && o > 0 && l.push("Try searching without filters to see all users")), V({
|
|
3952
3952
|
subject: a,
|
|
3953
3953
|
count: e.length,
|
|
3954
3954
|
filterHints: c,
|
|
@@ -3958,11 +3958,11 @@ function Ps({
|
|
|
3958
3958
|
nextSteps: l
|
|
3959
3959
|
});
|
|
3960
3960
|
}
|
|
3961
|
-
const { ADD_PROJECTS: Mt } = g,
|
|
3961
|
+
const { ADD_PROJECTS: Mt } = g, Yi = {
|
|
3962
3962
|
active: "projects",
|
|
3963
3963
|
archived: "archived projects",
|
|
3964
3964
|
all: "projects (active and archived)"
|
|
3965
|
-
},
|
|
3965
|
+
}, Gi = {
|
|
3966
3966
|
searchText: s.string().optional().describe(
|
|
3967
3967
|
'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.'
|
|
3968
3968
|
),
|
|
@@ -3982,7 +3982,7 @@ const { ADD_PROJECTS: Mt } = g, Gi = {
|
|
|
3982
3982
|
}, Ji = {
|
|
3983
3983
|
name: g.FIND_PROJECTS,
|
|
3984
3984
|
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.",
|
|
3985
|
-
parameters:
|
|
3985
|
+
parameters: Gi,
|
|
3986
3986
|
outputSchema: Vi,
|
|
3987
3987
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3988
3988
|
async execute(e, t) {
|
|
@@ -4019,7 +4019,7 @@ function Xi({
|
|
|
4019
4019
|
args: t,
|
|
4020
4020
|
nextCursor: r
|
|
4021
4021
|
}) {
|
|
4022
|
-
const o =
|
|
4022
|
+
const o = Yi[t.archivedStatus ?? "active"], n = t.searchText ? `All ${o} matching "${t.searchText}"` : `${o.charAt(0).toUpperCase()}${o.slice(1)}`, i = [];
|
|
4023
4023
|
t.searchText && i.push(`searchText: "${t.searchText}"`), t.archivedStatus && t.archivedStatus !== "active" && i.push(`archivedStatus: "${t.archivedStatus}"`);
|
|
4024
4024
|
const a = 10, d = e.slice(0, a).map(gn).join(`
|
|
4025
4025
|
`), u = e.length - a, l = u > 0 ? `${d}
|
|
@@ -4129,7 +4129,7 @@ const { ADD_SECTIONS: sa } = g, ra = {
|
|
|
4129
4129
|
'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.'
|
|
4130
4130
|
)
|
|
4131
4131
|
}, oa = {
|
|
4132
|
-
sections: s.array(
|
|
4132
|
+
sections: s.array(Y).describe("The found sections."),
|
|
4133
4133
|
totalCount: s.number().describe("The total number of sections found."),
|
|
4134
4134
|
appliedFilters: s.record(s.string(), s.unknown())
|
|
4135
4135
|
}, na = {
|
|
@@ -4147,7 +4147,7 @@ const { ADD_SECTIONS: sa } = g, ra = {
|
|
|
4147
4147
|
e.searchText ? o = await Ro(t, e.searchText, r) : o = (await t.getSections({
|
|
4148
4148
|
projectId: r
|
|
4149
4149
|
})).results;
|
|
4150
|
-
const n = o.map(
|
|
4150
|
+
const n = o.map(G);
|
|
4151
4151
|
return {
|
|
4152
4152
|
textContent: ia({
|
|
4153
4153
|
sections: n,
|
|
@@ -4215,7 +4215,7 @@ const aa = {
|
|
|
4215
4215
|
outputSchema: ca,
|
|
4216
4216
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4217
4217
|
async execute(e, t) {
|
|
4218
|
-
const r =
|
|
4218
|
+
const r = Ae(e.cursor);
|
|
4219
4219
|
if (!e.startDate && e.overdueOption !== "overdue-only")
|
|
4220
4220
|
throw new Error(
|
|
4221
4221
|
"Either startDate must be provided or overdueOption must be set to overdue-only"
|
|
@@ -4226,8 +4226,8 @@ const aa = {
|
|
|
4226
4226
|
d = "overdue";
|
|
4227
4227
|
else if (e.startDate === "today")
|
|
4228
4228
|
if (e.daysCount > 1) {
|
|
4229
|
-
const y = /* @__PURE__ */ new Date(), f = pe(y), w = We(y, e.daysCount), C = yt(w, { representation: "date" }),
|
|
4230
|
-
d = e.overdueOption === "exclude-overdue" ?
|
|
4229
|
+
const y = /* @__PURE__ */ new Date(), f = pe(y), w = We(y, e.daysCount), C = yt(w, { representation: "date" }), D = `(due after: ${f} | due: ${f}) & due before: ${C}`;
|
|
4230
|
+
d = e.overdueOption === "exclude-overdue" ? D : `(${D} | overdue)`;
|
|
4231
4231
|
} else
|
|
4232
4232
|
d = e.overdueOption === "exclude-overdue" ? "today" : "(today | overdue)";
|
|
4233
4233
|
else if (e.startDate) {
|
|
@@ -4424,7 +4424,7 @@ const ha = new pa(), { FIND_COMPLETED_TASKS: Ft, ADD_TASKS: Ht } = g, ma = {
|
|
|
4424
4424
|
labelsOperator: p,
|
|
4425
4425
|
filter: h,
|
|
4426
4426
|
filterIdOrName: m
|
|
4427
|
-
} = e, y =
|
|
4427
|
+
} = e, y = Ae(u), f = await t.getUser(), w = l && l.length > 0;
|
|
4428
4428
|
if (!r && !o && !n && !i && !a && !w && !h && !m)
|
|
4429
4429
|
throw new Error(
|
|
4430
4430
|
"At least one filter must be provided: searchText, projectId, sectionId, parentId, responsibleUser, labels, filter, or filterIdOrName"
|
|
@@ -4439,7 +4439,7 @@ const ha = new pa(), { FIND_COMPLETED_TASKS: Ft, ADD_TASKS: Ht } = g, ma = {
|
|
|
4439
4439
|
);
|
|
4440
4440
|
let C = h;
|
|
4441
4441
|
m && (C = (await ha.resolveFilter(t, m)).filterQuery);
|
|
4442
|
-
const
|
|
4442
|
+
const D = await at(t, a), T = D?.userId, I = D?.email;
|
|
4443
4443
|
if (o || n || i) {
|
|
4444
4444
|
const E = {
|
|
4445
4445
|
limit: d,
|
|
@@ -4517,7 +4517,7 @@ const ha = new pa(), { FIND_COMPLETED_TASKS: Ft, ADD_TASKS: Ht } = g, ma = {
|
|
|
4517
4517
|
});
|
|
4518
4518
|
$ = he($, E);
|
|
4519
4519
|
}
|
|
4520
|
-
const { tasks: S, nextCursor:
|
|
4520
|
+
const { tasks: S, nextCursor: A } = await dt({
|
|
4521
4521
|
client: t,
|
|
4522
4522
|
query: $,
|
|
4523
4523
|
cursor: y,
|
|
@@ -4527,15 +4527,15 @@ const ha = new pa(), { FIND_COMPLETED_TASKS: Ft, ADD_TASKS: Ht } = g, ma = {
|
|
|
4527
4527
|
textContent: Re({
|
|
4528
4528
|
tasks: S,
|
|
4529
4529
|
args: e,
|
|
4530
|
-
nextCursor:
|
|
4530
|
+
nextCursor: A,
|
|
4531
4531
|
isContainerSearch: !1,
|
|
4532
4532
|
assigneeEmail: I
|
|
4533
4533
|
}),
|
|
4534
4534
|
structuredContent: {
|
|
4535
4535
|
tasks: S,
|
|
4536
|
-
nextCursor:
|
|
4536
|
+
nextCursor: A ?? void 0,
|
|
4537
4537
|
totalCount: S.length,
|
|
4538
|
-
hasMore: !!
|
|
4538
|
+
hasMore: !!A,
|
|
4539
4539
|
appliedFilters: e
|
|
4540
4540
|
}
|
|
4541
4541
|
};
|
|
@@ -4616,7 +4616,7 @@ const ya = {
|
|
|
4616
4616
|
parentId: s.string().optional().describe("The parent project ID (for sub-projects, personal projects only)."),
|
|
4617
4617
|
folderId: s.string().optional().describe("The folder ID this project belongs to (workspace projects only)."),
|
|
4618
4618
|
childOrder: s.number().describe("The ordering index among siblings."),
|
|
4619
|
-
sections: s.array(
|
|
4619
|
+
sections: s.array(Y),
|
|
4620
4620
|
children: s.array(Us).describe("Nested child projects.")
|
|
4621
4621
|
})
|
|
4622
4622
|
), Ta = {
|
|
@@ -4636,7 +4636,7 @@ const ya = {
|
|
|
4636
4636
|
inbox: s.object({
|
|
4637
4637
|
id: s.string().describe("The inbox project ID."),
|
|
4638
4638
|
name: s.string().describe("The inbox project name."),
|
|
4639
|
-
sections: s.array(
|
|
4639
|
+
sections: s.array(Y).describe("Sections in the inbox project.")
|
|
4640
4640
|
}).optional().describe("Inbox information (account overview only)."),
|
|
4641
4641
|
projects: s.array(s.lazy(() => Us)).optional().describe(
|
|
4642
4642
|
"List of projects with hierarchy, folders, and ordering (account overview only)."
|
|
@@ -4645,7 +4645,7 @@ const ya = {
|
|
|
4645
4645
|
id: s.string().describe("The project ID."),
|
|
4646
4646
|
name: s.string().describe("The project name.")
|
|
4647
4647
|
}).optional().describe("Project details (project overview only)."),
|
|
4648
|
-
sections: s.array(
|
|
4648
|
+
sections: s.array(Y).optional().describe("List of sections (project overview only)."),
|
|
4649
4649
|
tasks: s.array(s.any()).optional().describe("List of tasks (project overview only)."),
|
|
4650
4650
|
stats: s.object({
|
|
4651
4651
|
totalTasks: s.number(),
|
|
@@ -4665,7 +4665,7 @@ function ka(e) {
|
|
|
4665
4665
|
for (const n of e) {
|
|
4666
4666
|
const i = t[n.id];
|
|
4667
4667
|
if (i)
|
|
4668
|
-
if (
|
|
4668
|
+
if (q(n) && n.parentId) {
|
|
4669
4669
|
const a = t[n.parentId];
|
|
4670
4670
|
a ? a.children.push(i) : r.push(i);
|
|
4671
4671
|
} else
|
|
@@ -4726,10 +4726,10 @@ function Ls(e, t) {
|
|
|
4726
4726
|
return {
|
|
4727
4727
|
id: e.id,
|
|
4728
4728
|
name: e.name,
|
|
4729
|
-
parentId:
|
|
4729
|
+
parentId: q(e) ? e.parentId ?? void 0 : void 0,
|
|
4730
4730
|
folderId: Ce(e) ? e.folderId ?? void 0 : void 0,
|
|
4731
4731
|
childOrder: e.childOrder,
|
|
4732
|
-
sections: (t[e.id] || []).map(
|
|
4732
|
+
sections: (t[e.id] || []).map(G),
|
|
4733
4733
|
children: e.children.map(
|
|
4734
4734
|
(r) => Ls(r, t)
|
|
4735
4735
|
)
|
|
@@ -4752,7 +4752,7 @@ async function Ia(e, t) {
|
|
|
4752
4752
|
return r;
|
|
4753
4753
|
}
|
|
4754
4754
|
async function Sa(e) {
|
|
4755
|
-
const { results: t } = await e.getProjects({}), r = t.find((p) =>
|
|
4755
|
+
const { results: t } = await e.getProjects({}), r = t.find((p) => q(p) && p.inboxProject === !0), o = t.filter((p) => !q(p) || p.inboxProject !== !0), n = ka(o), i = t.map((p) => p.id), a = await wa(e, i), c = ["# Personal Projects", ""];
|
|
4756
4756
|
if (r) {
|
|
4757
4757
|
c.push(`- Inbox Project: ${r.name} (id=${r.id})`);
|
|
4758
4758
|
for (const p of a[r.id] || [])
|
|
@@ -4775,7 +4775,7 @@ async function Sa(e) {
|
|
|
4775
4775
|
inbox: r ? {
|
|
4776
4776
|
id: r.id,
|
|
4777
4777
|
name: r.name,
|
|
4778
|
-
sections: (a[r.id] || []).map(
|
|
4778
|
+
sections: (a[r.id] || []).map(G)
|
|
4779
4779
|
} : void 0,
|
|
4780
4780
|
projects: n.map(
|
|
4781
4781
|
(p) => Ls(p, a)
|
|
@@ -4821,7 +4821,7 @@ async function Ca(e, t) {
|
|
|
4821
4821
|
id: r.id,
|
|
4822
4822
|
name: r.name
|
|
4823
4823
|
},
|
|
4824
|
-
sections: o.map(
|
|
4824
|
+
sections: o.map(G),
|
|
4825
4825
|
tasks: n.map((l) => ({
|
|
4826
4826
|
...l,
|
|
4827
4827
|
children: []
|
|
@@ -4855,7 +4855,7 @@ const ja = {
|
|
|
4855
4855
|
}), Bt = s.object({
|
|
4856
4856
|
id: s.string().describe("Project ID."),
|
|
4857
4857
|
completed: s.number().describe("Number of tasks completed in this project.")
|
|
4858
|
-
}),
|
|
4858
|
+
}), Aa = {
|
|
4859
4859
|
completedCount: s.number().describe("Total number of completed tasks (all-time)."),
|
|
4860
4860
|
daysItems: s.array(
|
|
4861
4861
|
s.object({
|
|
@@ -4904,11 +4904,11 @@ const ja = {
|
|
|
4904
4904
|
})
|
|
4905
4905
|
).describe("Recent karma change events with reasons."),
|
|
4906
4906
|
projectColors: s.record(s.string(), s.string()).describe("Map of project ID to color key.")
|
|
4907
|
-
},
|
|
4907
|
+
}, Da = {
|
|
4908
4908
|
name: g.GET_PRODUCTIVITY_STATS,
|
|
4909
4909
|
description: 'Get comprehensive productivity statistics including daily/weekly completion breakdowns, goal streaks (current, last, max), karma score and trends, and historical karma data. Useful for productivity analysis and tracking goal progress. Reports counts, streaks and karma only, never the tasks themselves — for "what did I complete", use find-activity.',
|
|
4910
4910
|
parameters: $a,
|
|
4911
|
-
outputSchema:
|
|
4911
|
+
outputSchema: Aa,
|
|
4912
4912
|
annotations: {
|
|
4913
4913
|
readOnlyHint: !0,
|
|
4914
4914
|
destructiveHint: !1,
|
|
@@ -5235,7 +5235,7 @@ function Ka(e) {
|
|
|
5235
5235
|
} catch {
|
|
5236
5236
|
throw new Error(`Could not read a template ID from "${t}".`);
|
|
5237
5237
|
}
|
|
5238
|
-
if (!
|
|
5238
|
+
if (!qa(r.hostname))
|
|
5239
5239
|
throw new Error(
|
|
5240
5240
|
`"${r.hostname}" is not a Todoist domain. Pass a todoist.com template URL or the template ID itself.`
|
|
5241
5241
|
);
|
|
@@ -5245,11 +5245,11 @@ function Ka(e) {
|
|
|
5245
5245
|
throw new Error(`"${t}" is not a Todoist template URL.`);
|
|
5246
5246
|
return o.id;
|
|
5247
5247
|
}
|
|
5248
|
-
function
|
|
5248
|
+
function qa(e) {
|
|
5249
5249
|
const t = e.toLowerCase();
|
|
5250
5250
|
return t === "todoist.com" || t.endsWith(".todoist.com");
|
|
5251
5251
|
}
|
|
5252
|
-
const
|
|
5252
|
+
const Ya = {
|
|
5253
5253
|
projectId: s.string().min(1).describe("The ID of the existing project to import the template into."),
|
|
5254
5254
|
templateId: s.string().optional().describe(
|
|
5255
5255
|
'The template to import — either a gallery slug ("product-launch"), a personal template ID ("UT_28Ex..."), or a full Todoist template URL, which is reduced to the ID automatically. Gallery templates work for anyone; personal templates only for the account that owns them. There is no way to list templates through this server, so only use the ID or URL the user supplied. Provide either this or `csvFileContent`, not both.'
|
|
@@ -5258,16 +5258,16 @@ const Ga = {
|
|
|
5258
5258
|
"Raw CSV template content, as produced by export-project-template. Provide either this or `templateId`, not both."
|
|
5259
5259
|
),
|
|
5260
5260
|
locale: s.string().optional().describe('Locale for the imported content when using `templateId`. Defaults to "en".')
|
|
5261
|
-
},
|
|
5262
|
-
sections: s.array(
|
|
5261
|
+
}, Ga = {
|
|
5262
|
+
sections: s.array(Y).describe("Sections created by the import."),
|
|
5263
5263
|
tasks: s.array(K).describe("Tasks created by the import."),
|
|
5264
5264
|
comments: s.array(ve).describe("Comments created by the import."),
|
|
5265
5265
|
totalCount: s.number().describe("The total number of objects created by the import.")
|
|
5266
5266
|
}, Va = {
|
|
5267
5267
|
name: g.IMPORT_PROJECT_TEMPLATE,
|
|
5268
5268
|
description: "Import a template into an existing project, adding its tasks, sections and comments to whatever is already there. Source it by template ID/URL or by passing CSV content from export-project-template. To start a new project from a template, create the project with add-projects first, then import into it. This writes immediately and cannot be undone, so only run it against a project the user named.",
|
|
5269
|
-
parameters:
|
|
5270
|
-
outputSchema:
|
|
5269
|
+
parameters: Ya,
|
|
5270
|
+
outputSchema: Ga,
|
|
5271
5271
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
5272
5272
|
async execute({ projectId: e, templateId: t, csvFileContent: r, locale: o }, n) {
|
|
5273
5273
|
if (!!t == !!r)
|
|
@@ -5282,7 +5282,7 @@ const Ga = {
|
|
|
5282
5282
|
projectId: e,
|
|
5283
5283
|
file: r ?? "",
|
|
5284
5284
|
fileName: "template.csv"
|
|
5285
|
-
}), a = i.sections.map(
|
|
5285
|
+
}), a = i.sections.map(G), c = i.tasks.map(_), d = i.comments.map(we), u = i.projects.length + a.length + c.length + d.length;
|
|
5286
5286
|
return {
|
|
5287
5287
|
textContent: Ja({
|
|
5288
5288
|
projectId: e,
|
|
@@ -5439,10 +5439,10 @@ const tc = {
|
|
|
5439
5439
|
});
|
|
5440
5440
|
if (r === "unassign") {
|
|
5441
5441
|
if (a) {
|
|
5442
|
-
const b = d.map((
|
|
5443
|
-
taskId:
|
|
5442
|
+
const b = d.map((A) => ({
|
|
5443
|
+
taskId: A.id,
|
|
5444
5444
|
success: !0,
|
|
5445
|
-
originalAssigneeId:
|
|
5445
|
+
originalAssigneeId: A.responsibleUid ?? void 0,
|
|
5446
5446
|
newAssigneeId: void 0
|
|
5447
5447
|
}));
|
|
5448
5448
|
return {
|
|
@@ -5516,7 +5516,7 @@ const tc = {
|
|
|
5516
5516
|
);
|
|
5517
5517
|
if (!I)
|
|
5518
5518
|
return $.map(({ assignment: b, validation: S }) => {
|
|
5519
|
-
const
|
|
5519
|
+
const A = d.find((x) => x.id === b.taskId);
|
|
5520
5520
|
if (!b.taskId || !S.resolvedUser?.userId)
|
|
5521
5521
|
throw new Error(
|
|
5522
5522
|
"Invalid assignment or validation data - this should not happen"
|
|
@@ -5524,19 +5524,19 @@ const tc = {
|
|
|
5524
5524
|
return {
|
|
5525
5525
|
taskId: b.taskId,
|
|
5526
5526
|
success: !0,
|
|
5527
|
-
originalAssigneeId:
|
|
5527
|
+
originalAssigneeId: A?.responsibleUid ?? void 0,
|
|
5528
5528
|
newAssigneeId: S.resolvedUser.userId
|
|
5529
5529
|
};
|
|
5530
5530
|
});
|
|
5531
5531
|
const k = $.map(
|
|
5532
5532
|
async ({ assignment: b, validation: S }) => {
|
|
5533
|
-
const
|
|
5533
|
+
const A = d.find((x) => x.id === b.taskId);
|
|
5534
5534
|
if (!b.taskId || !S.resolvedUser?.userId)
|
|
5535
5535
|
return {
|
|
5536
5536
|
taskId: b.taskId || "unknown-task",
|
|
5537
5537
|
success: !1,
|
|
5538
5538
|
error: "Invalid assignment data - missing task ID or resolved user",
|
|
5539
|
-
originalAssigneeId:
|
|
5539
|
+
originalAssigneeId: A?.responsibleUid ?? void 0
|
|
5540
5540
|
};
|
|
5541
5541
|
try {
|
|
5542
5542
|
return await t.updateTask(b.taskId, {
|
|
@@ -5544,7 +5544,7 @@ const tc = {
|
|
|
5544
5544
|
}), {
|
|
5545
5545
|
taskId: b.taskId,
|
|
5546
5546
|
success: !0,
|
|
5547
|
-
originalAssigneeId:
|
|
5547
|
+
originalAssigneeId: A?.responsibleUid ?? void 0,
|
|
5548
5548
|
newAssigneeId: S.resolvedUser.userId
|
|
5549
5549
|
};
|
|
5550
5550
|
} catch (x) {
|
|
@@ -5552,7 +5552,7 @@ const tc = {
|
|
|
5552
5552
|
taskId: b.taskId,
|
|
5553
5553
|
success: !1,
|
|
5554
5554
|
error: x instanceof Error ? x.message : "Update failed",
|
|
5555
|
-
originalAssigneeId:
|
|
5555
|
+
originalAssigneeId: A?.responsibleUid ?? void 0
|
|
5556
5556
|
};
|
|
5557
5557
|
}
|
|
5558
5558
|
}
|
|
@@ -5917,7 +5917,7 @@ const vc = {
|
|
|
5917
5917
|
});
|
|
5918
5918
|
}
|
|
5919
5919
|
return oe(g.UNCOMPLETE_TASKS, e.ids.length, o), {
|
|
5920
|
-
textContent:
|
|
5920
|
+
textContent: Ac({
|
|
5921
5921
|
uncompleted: r,
|
|
5922
5922
|
failures: o,
|
|
5923
5923
|
args: e
|
|
@@ -5932,7 +5932,7 @@ const vc = {
|
|
|
5932
5932
|
};
|
|
5933
5933
|
}
|
|
5934
5934
|
};
|
|
5935
|
-
function
|
|
5935
|
+
function Ac({
|
|
5936
5936
|
uncompleted: e,
|
|
5937
5937
|
failures: t,
|
|
5938
5938
|
args: r
|
|
@@ -5946,11 +5946,11 @@ function Dc({
|
|
|
5946
5946
|
failures: t
|
|
5947
5947
|
});
|
|
5948
5948
|
}
|
|
5949
|
-
const
|
|
5949
|
+
const Dc = s.object({
|
|
5950
5950
|
id: s.string().min(1).describe("The ID of the comment to update."),
|
|
5951
5951
|
content: s.string().min(1).describe("The new content for the comment.")
|
|
5952
5952
|
}), xc = {
|
|
5953
|
-
comments: s.array(
|
|
5953
|
+
comments: s.array(Dc).min(1).describe("The comments to update.")
|
|
5954
5954
|
}, Ec = {
|
|
5955
5955
|
comments: s.array(ve).describe("The updated comments."),
|
|
5956
5956
|
totalCount: s.number().describe("The total number of comments updated."),
|
|
@@ -6122,7 +6122,7 @@ const Fc = s.object({
|
|
|
6122
6122
|
renameCount: s.number().describe("Number of shared labels renamed."),
|
|
6123
6123
|
skippedCount: s.number().describe("Number of operations skipped (no changes or shared label not found).")
|
|
6124
6124
|
}).describe("Summary of operations performed.")
|
|
6125
|
-
},
|
|
6125
|
+
}, qc = {
|
|
6126
6126
|
name: g.UPDATE_LABELS,
|
|
6127
6127
|
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.",
|
|
6128
6128
|
parameters: Bc,
|
|
@@ -6132,7 +6132,7 @@ const Fc = s.object({
|
|
|
6132
6132
|
const { labels: r } = e, o = await Promise.all(
|
|
6133
6133
|
r.map(async (l) => {
|
|
6134
6134
|
if (l.labelType === "personal") {
|
|
6135
|
-
const h =
|
|
6135
|
+
const h = Gc(l);
|
|
6136
6136
|
if (h !== null) return { kind: "skipped", reason: h };
|
|
6137
6137
|
const { id: m, labelType: y, ...f } = l;
|
|
6138
6138
|
return { kind: "updated", label: await t.updateLabel(m, f) };
|
|
@@ -6150,7 +6150,7 @@ const Fc = s.object({
|
|
|
6150
6150
|
(l) => l.kind === "skipped" && l.reason === "not-found"
|
|
6151
6151
|
).length;
|
|
6152
6152
|
return {
|
|
6153
|
-
textContent:
|
|
6153
|
+
textContent: Yc({
|
|
6154
6154
|
updatedLabels: n,
|
|
6155
6155
|
renamedSharedLabels: i,
|
|
6156
6156
|
skippedNoFields: c,
|
|
@@ -6169,7 +6169,7 @@ const Fc = s.object({
|
|
|
6169
6169
|
};
|
|
6170
6170
|
}
|
|
6171
6171
|
};
|
|
6172
|
-
function
|
|
6172
|
+
function Yc({
|
|
6173
6173
|
updatedLabels: e,
|
|
6174
6174
|
renamedSharedLabels: t,
|
|
6175
6175
|
skippedNoFields: r,
|
|
@@ -6191,7 +6191,7 @@ function Gc({
|
|
|
6191
6191
|
return c.join(`
|
|
6192
6192
|
`);
|
|
6193
6193
|
}
|
|
6194
|
-
function
|
|
6194
|
+
function Gc({
|
|
6195
6195
|
id: e,
|
|
6196
6196
|
labelType: t,
|
|
6197
6197
|
...r
|
|
@@ -6381,7 +6381,7 @@ const td = s.object({
|
|
|
6381
6381
|
}), dd = {
|
|
6382
6382
|
sections: s.array(cd).min(1).describe("The sections to update.")
|
|
6383
6383
|
}, ld = {
|
|
6384
|
-
sections: s.array(
|
|
6384
|
+
sections: s.array(Y).describe("The updated sections."),
|
|
6385
6385
|
totalCount: s.number().describe("The total number of sections updated."),
|
|
6386
6386
|
updatedSectionIds: s.array(s.string()).describe("The IDs of the updated sections.")
|
|
6387
6387
|
}, ud = {
|
|
@@ -6405,7 +6405,7 @@ const td = s.object({
|
|
|
6405
6405
|
sections: r
|
|
6406
6406
|
}),
|
|
6407
6407
|
structuredContent: {
|
|
6408
|
-
sections: r.map(
|
|
6408
|
+
sections: r.map(G),
|
|
6409
6409
|
totalCount: r.length,
|
|
6410
6410
|
updatedSectionIds: r.map((n) => n.id)
|
|
6411
6411
|
}
|
|
@@ -6529,7 +6529,7 @@ const gd = s.object({
|
|
|
6529
6529
|
a.map(({ task: k }) => k),
|
|
6530
6530
|
t
|
|
6531
6531
|
), d = await Promise.allSettled(
|
|
6532
|
-
a.map(({ task: k, index: b }) =>
|
|
6532
|
+
a.map(({ task: k, index: b }) => Dd({ task: k, index: b, client: t, inbox: c }))
|
|
6533
6533
|
), u = [];
|
|
6534
6534
|
for (const [k, b] of d.entries()) {
|
|
6535
6535
|
const S = a[k]?.index ?? k;
|
|
@@ -6557,23 +6557,23 @@ const gd = s.object({
|
|
|
6557
6557
|
const h = /* @__PURE__ */ new Map(), m = [], y = (k) => {
|
|
6558
6558
|
const b = k.filter((S) => !S.failed);
|
|
6559
6559
|
b.length !== 0 && m.push(
|
|
6560
|
-
|
|
6560
|
+
Ad({
|
|
6561
6561
|
client: t,
|
|
6562
6562
|
items: b,
|
|
6563
|
-
onUpdated: (S,
|
|
6564
|
-
o[S.index] = { kind: "updated", task:
|
|
6563
|
+
onUpdated: (S, A) => {
|
|
6564
|
+
o[S.index] = { kind: "updated", task: A };
|
|
6565
6565
|
},
|
|
6566
|
-
onFailed: (S,
|
|
6566
|
+
onFailed: (S, A) => {
|
|
6567
6567
|
const x = h.get(S.index);
|
|
6568
6568
|
if (x && "task" in x) {
|
|
6569
6569
|
o[S.index] = {
|
|
6570
6570
|
kind: "partial",
|
|
6571
6571
|
task: x.task,
|
|
6572
|
-
error: `Move applied; field update failed: ${N(
|
|
6572
|
+
error: `Move applied; field update failed: ${N(A)}`
|
|
6573
6573
|
};
|
|
6574
6574
|
return;
|
|
6575
6575
|
}
|
|
6576
|
-
i(S.index,
|
|
6576
|
+
i(S.index, A);
|
|
6577
6577
|
}
|
|
6578
6578
|
})
|
|
6579
6579
|
);
|
|
@@ -6585,9 +6585,9 @@ const gd = s.object({
|
|
|
6585
6585
|
onResolved: (k) => {
|
|
6586
6586
|
const b = [];
|
|
6587
6587
|
for (const { item: S } of k) {
|
|
6588
|
-
const
|
|
6589
|
-
if (
|
|
6590
|
-
n(S.index,
|
|
6588
|
+
const A = h.get(S.index);
|
|
6589
|
+
if (A && "error" in A) {
|
|
6590
|
+
n(S.index, A.error), S.failed = !0;
|
|
6591
6591
|
continue;
|
|
6592
6592
|
}
|
|
6593
6593
|
b.push(S);
|
|
@@ -6601,12 +6601,12 @@ const gd = s.object({
|
|
|
6601
6601
|
const b = h.get(k.index);
|
|
6602
6602
|
b && "task" in b && (o[k.index] = { kind: "updated", task: b.task });
|
|
6603
6603
|
}
|
|
6604
|
-
const { updatedTasks: w, failures: C, skippedCount:
|
|
6604
|
+
const { updatedTasks: w, failures: C, skippedCount: D } = Sd({ tasks: r, outcomes: o }), T = u.filter((k) => k.redundantMoveSkipped).length, I = w.map(_);
|
|
6605
6605
|
return oe(g.UPDATE_TASKS, r.length, C), {
|
|
6606
6606
|
textContent: Ed({
|
|
6607
6607
|
tasks: I,
|
|
6608
6608
|
failures: C,
|
|
6609
|
-
skippedCount:
|
|
6609
|
+
skippedCount: D,
|
|
6610
6610
|
redundantMovesSkipped: T
|
|
6611
6611
|
}),
|
|
6612
6612
|
structuredContent: {
|
|
@@ -6616,7 +6616,7 @@ const gd = s.object({
|
|
|
6616
6616
|
failures: C,
|
|
6617
6617
|
appliedOperations: {
|
|
6618
6618
|
updateCount: I.length,
|
|
6619
|
-
skippedCount:
|
|
6619
|
+
skippedCount: D,
|
|
6620
6620
|
failureCount: C.length,
|
|
6621
6621
|
redundantMovesSkipped: T
|
|
6622
6622
|
}
|
|
@@ -6732,7 +6732,7 @@ async function $d({
|
|
|
6732
6732
|
}
|
|
6733
6733
|
}
|
|
6734
6734
|
}
|
|
6735
|
-
async function
|
|
6735
|
+
async function Ad({
|
|
6736
6736
|
client: e,
|
|
6737
6737
|
items: t,
|
|
6738
6738
|
onUpdated: r,
|
|
@@ -6752,7 +6752,7 @@ async function Dd({
|
|
|
6752
6752
|
})
|
|
6753
6753
|
);
|
|
6754
6754
|
}
|
|
6755
|
-
async function
|
|
6755
|
+
async function Dd({
|
|
6756
6756
|
task: e,
|
|
6757
6757
|
index: t,
|
|
6758
6758
|
client: r,
|
|
@@ -6779,14 +6779,14 @@ async function Ad({
|
|
|
6779
6779
|
...h !== void 0 && { labels: h }
|
|
6780
6780
|
};
|
|
6781
6781
|
p && (w.priority = us(p));
|
|
6782
|
-
const C =
|
|
6782
|
+
const C = qt(
|
|
6783
6783
|
d,
|
|
6784
6784
|
Td,
|
|
6785
6785
|
wd
|
|
6786
6786
|
);
|
|
6787
6787
|
C !== void 0 && (w = { ...w, dueString: C });
|
|
6788
|
-
const
|
|
6789
|
-
if (
|
|
6788
|
+
const D = qt(m, kd, null);
|
|
6789
|
+
if (D !== void 0 && (w = { ...w, deadlineDate: D }), u)
|
|
6790
6790
|
try {
|
|
6791
6791
|
const { minutes: T } = ls(u);
|
|
6792
6792
|
w = {
|
|
@@ -6851,7 +6851,7 @@ ${u}${l}`;
|
|
|
6851
6851
|
function Od({ id: e, ...t }) {
|
|
6852
6852
|
return Object.keys(t).length > 0;
|
|
6853
6853
|
}
|
|
6854
|
-
function
|
|
6854
|
+
function qt(e, t, r) {
|
|
6855
6855
|
if (e === void 0)
|
|
6856
6856
|
return e;
|
|
6857
6857
|
if (e === null)
|
|
@@ -6973,7 +6973,7 @@ const Bd = {
|
|
|
6973
6973
|
structuredContent: r.structuredContent
|
|
6974
6974
|
};
|
|
6975
6975
|
}
|
|
6976
|
-
},
|
|
6976
|
+
}, Yt = 10 * 1024 * 1024, zd = /* @__PURE__ */ new Set([
|
|
6977
6977
|
"image/png",
|
|
6978
6978
|
"image/jpeg",
|
|
6979
6979
|
"image/gif",
|
|
@@ -6987,7 +6987,7 @@ const Bd = {
|
|
|
6987
6987
|
"application/json",
|
|
6988
6988
|
"application/xml",
|
|
6989
6989
|
"text/xml"
|
|
6990
|
-
]),
|
|
6990
|
+
]), qd = {
|
|
6991
6991
|
".png": "image/png",
|
|
6992
6992
|
".jpg": "image/jpeg",
|
|
6993
6993
|
".jpeg": "image/jpeg",
|
|
@@ -7002,10 +7002,10 @@ const Bd = {
|
|
|
7002
7002
|
".xml": "application/xml",
|
|
7003
7003
|
".pdf": "application/pdf"
|
|
7004
7004
|
};
|
|
7005
|
-
function
|
|
7005
|
+
function Yd(e) {
|
|
7006
7006
|
return zd.has(e) ? "image" : Kd.has(e) || e.startsWith("text/") ? "text" : "binary";
|
|
7007
7007
|
}
|
|
7008
|
-
function
|
|
7008
|
+
function Gd(e) {
|
|
7009
7009
|
return (e.split(";")[0] ?? e).trim().toLowerCase();
|
|
7010
7010
|
}
|
|
7011
7011
|
function Vd(e) {
|
|
@@ -7013,7 +7013,7 @@ function Vd(e) {
|
|
|
7013
7013
|
const t = new URL(e).pathname, r = t.lastIndexOf(".");
|
|
7014
7014
|
if (r === -1) return;
|
|
7015
7015
|
const o = t.slice(r).toLowerCase();
|
|
7016
|
-
return
|
|
7016
|
+
return qd[o];
|
|
7017
7017
|
} catch {
|
|
7018
7018
|
return;
|
|
7019
7019
|
}
|
|
@@ -7040,17 +7040,17 @@ const Xd = {
|
|
|
7040
7040
|
idempotentHint: !0
|
|
7041
7041
|
},
|
|
7042
7042
|
async execute({ fileUrl: e }, t) {
|
|
7043
|
-
const r = await t.viewAttachment(e), o = r.headers["content-length"], n = o ? Number.parseInt(o, 10) : void 0, i = Jd(e), a = r.headers["content-type"], c = a ?
|
|
7044
|
-
if (n && n >
|
|
7043
|
+
const r = await t.viewAttachment(e), o = r.headers["content-length"], n = o ? Number.parseInt(o, 10) : void 0, i = Jd(e), a = r.headers["content-type"], c = a ? Gd(a) : void 0, d = c && c !== "application/octet-stream" ? c : Vd(e) ?? c ?? "application/octet-stream";
|
|
7044
|
+
if (n && n > Yt)
|
|
7045
7045
|
return {
|
|
7046
7046
|
textContent: `Attachment "${i ?? e}" is too large to display inline (${(n / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
|
|
7047
7047
|
};
|
|
7048
7048
|
const u = Buffer.from(await r.arrayBuffer()), l = u.byteLength;
|
|
7049
|
-
if (l >
|
|
7049
|
+
if (l > Yt)
|
|
7050
7050
|
return {
|
|
7051
7051
|
textContent: `Attachment "${i ?? e}" is too large to display inline (${(l / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
|
|
7052
7052
|
};
|
|
7053
|
-
const p =
|
|
7053
|
+
const p = Yd(d), h = [];
|
|
7054
7054
|
return p === "image" ? h.push({
|
|
7055
7055
|
type: "image",
|
|
7056
7056
|
data: u.toString("base64"),
|
|
@@ -7109,7 +7109,7 @@ const Xd = {
|
|
|
7109
7109
|
viewAttachment: Qd,
|
|
7110
7110
|
// Label management tools
|
|
7111
7111
|
addLabels: pn,
|
|
7112
|
-
updateLabels:
|
|
7112
|
+
updateLabels: qc,
|
|
7113
7113
|
findLabels: Fi,
|
|
7114
7114
|
// Filter management tools
|
|
7115
7115
|
findFilters: sn,
|
|
@@ -7117,11 +7117,11 @@ const Xd = {
|
|
|
7117
7117
|
updateFilters: Lc,
|
|
7118
7118
|
// Activity and audit tools
|
|
7119
7119
|
findActivity: ki,
|
|
7120
|
-
getProductivityStats:
|
|
7120
|
+
getProductivityStats: Da,
|
|
7121
7121
|
// Health and insights tools
|
|
7122
7122
|
getProjectHealth: Fa,
|
|
7123
7123
|
getProjectActivityStats: _a,
|
|
7124
|
-
analyzeProjectHealth:
|
|
7124
|
+
analyzeProjectHealth: Gn,
|
|
7125
7125
|
getWorkspaceInsights: za,
|
|
7126
7126
|
// General tools
|
|
7127
7127
|
getOverview: ja,
|
|
@@ -7211,7 +7211,7 @@ function bl({
|
|
|
7211
7211
|
},
|
|
7212
7212
|
instructions: sl
|
|
7213
7213
|
}
|
|
7214
|
-
), n =
|
|
7214
|
+
), n = Gr(e, { baseUrl: t });
|
|
7215
7215
|
cr(o);
|
|
7216
7216
|
const i = { server: o, client: n, features: r };
|
|
7217
7217
|
for (const a of tl)
|
|
@@ -7229,7 +7229,7 @@ function bl({
|
|
|
7229
7229
|
export {
|
|
7230
7230
|
eo as $,
|
|
7231
7231
|
ja as A,
|
|
7232
|
-
|
|
7232
|
+
Da as B,
|
|
7233
7233
|
_a as C,
|
|
7234
7234
|
Fa as D,
|
|
7235
7235
|
za as E,
|
|
@@ -7246,14 +7246,14 @@ export {
|
|
|
7246
7246
|
$c as P,
|
|
7247
7247
|
Oc as Q,
|
|
7248
7248
|
Lc as R,
|
|
7249
|
-
|
|
7249
|
+
qc as S,
|
|
7250
7250
|
Qc as T,
|
|
7251
7251
|
ad as U,
|
|
7252
7252
|
ud as V,
|
|
7253
7253
|
Id as W,
|
|
7254
7254
|
Bd as X,
|
|
7255
7255
|
Qd as Y,
|
|
7256
|
-
|
|
7256
|
+
Gr as Z,
|
|
7257
7257
|
Mr as _,
|
|
7258
7258
|
Xo as a,
|
|
7259
7259
|
cn as b,
|
|
@@ -7263,7 +7263,7 @@ export {
|
|
|
7263
7263
|
Ln as f,
|
|
7264
7264
|
bl as g,
|
|
7265
7265
|
Wn as h,
|
|
7266
|
-
|
|
7266
|
+
Gn as i,
|
|
7267
7267
|
Xn as j,
|
|
7268
7268
|
ti as k,
|
|
7269
7269
|
oi as l,
|