@doist/todoist-mcp 12.5.1 → 12.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -3
- package/dist/main-http.js +2 -2
- package/dist/main.js +1 -1
- package/dist/{mcp-server-D55mj0Ly.js → mcp-server-Cgo8Mi4X.js} +456 -462
- package/dist/{require-valid-todoist-token-Cp1WZyMV.js → require-valid-todoist-token-Cqt_drLE.js} +1 -1
- package/dist/tools/find-activity.d.ts.map +1 -1
- package/dist/tools/find-completed-tasks.d.ts.map +1 -1
- package/dist/tools/find-labels.d.ts.map +1 -1
- package/dist/tools/find-project-collaborators.d.ts.map +1 -1
- package/dist/tools/find-projects.d.ts.map +1 -1
- package/dist/tools/find-sections.d.ts.map +1 -1
- package/dist/tools/find-tasks-by-date.d.ts.map +1 -1
- package/dist/tools/find-tasks.d.ts.map +1 -1
- package/dist/utils/colors.d.ts.map +1 -1
- package/dist/utils/output-schemas.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ import { registerAppResource as Os, RESOURCE_MIME_TYPE as Lt, registerAppTool as
|
|
|
7
7
|
import se, { ZodError as Rs, z as s } from "zod";
|
|
8
8
|
import { AsyncLocalStorage as _s } from "node:async_hooks";
|
|
9
9
|
import { createRequire as Us } from "node:module";
|
|
10
|
-
import { TodoistApi as Ls, isWorkspaceProject as
|
|
10
|
+
import { TodoistApi as Ls, isWorkspaceProject as Te, isPersonalProject as B, colors as _e, LOCATION_TRIGGERS as Mt, REMINDER_TYPES as Ms, createCommand as V, REMINDER_DELIVERY_SERVICES as Ns, HEALTH_STATUSES as Ke, getTaskUrl as Nt, getProjectUrl as Ft, WORKSPACE_ROLES as Fs, WORKSPACE_PLANS as Hs } from "@doist/todoist-sdk";
|
|
11
11
|
import { addDays as Ue, formatISO as lt } from "date-fns";
|
|
12
12
|
const ut = Ut(Es(import.meta.url)), Ws = [
|
|
13
13
|
Re(ut, "task-list", "index.html"),
|
|
@@ -18,7 +18,7 @@ const ut = Ut(Es(import.meta.url)), Ws = [
|
|
|
18
18
|
<p>Task list app is missing. Run "npm run build" to generate it.</p>
|
|
19
19
|
</body>
|
|
20
20
|
</html>`;
|
|
21
|
-
function
|
|
21
|
+
function Ys() {
|
|
22
22
|
const e = [];
|
|
23
23
|
for (const t of Ws)
|
|
24
24
|
try {
|
|
@@ -28,7 +28,7 @@ function qs() {
|
|
|
28
28
|
}
|
|
29
29
|
return console.error("Failed to load task list app HTML from any known path:", e), Bs;
|
|
30
30
|
}
|
|
31
|
-
const Ht =
|
|
31
|
+
const Ht = Ys(), zs = _t("sha256").update(Ht).digest("hex").slice(0, 12), Le = `ui://todoist/task-list@${zs}`, qs = "ui://todoist/task-list@{hash}", Me = "Interactive task list widget", Gs = "https://ai.todoist.net", Ne = {
|
|
32
32
|
ui: {
|
|
33
33
|
prefersBorder: !0,
|
|
34
34
|
csp: {
|
|
@@ -69,7 +69,7 @@ function Ks(e) {
|
|
|
69
69
|
async () => pt(Le)
|
|
70
70
|
), e.registerResource(
|
|
71
71
|
"todoist-task-list-hash-fallback",
|
|
72
|
-
new Ds(
|
|
72
|
+
new Ds(qs, { list: void 0 }),
|
|
73
73
|
{
|
|
74
74
|
description: `${Me} compatibility fallback`,
|
|
75
75
|
mimeType: Lt,
|
|
@@ -301,7 +301,7 @@ function Ve(e) {
|
|
|
301
301
|
w(t?.message),
|
|
302
302
|
w(r?.message),
|
|
303
303
|
e instanceof Error ? e.message : w(e)
|
|
304
|
-
].filter((
|
|
304
|
+
].filter((h) => !!h), l = d.find((h) => !He(h)) || d[0], u = L(
|
|
305
305
|
K(n?.errorExtra),
|
|
306
306
|
K(n?.error_extra),
|
|
307
307
|
K(n?.details),
|
|
@@ -338,12 +338,12 @@ class ve extends Error {
|
|
|
338
338
|
super(t), this.name = "DueStringParseError";
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
|
-
class
|
|
341
|
+
class Yt extends Error {
|
|
342
342
|
constructor(t) {
|
|
343
343
|
super(t), this.name = "BatchDueStringParseError";
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
|
-
function
|
|
346
|
+
function Y(e) {
|
|
347
347
|
if (e instanceof ve)
|
|
348
348
|
return e.message;
|
|
349
349
|
const t = Ve(e);
|
|
@@ -366,12 +366,12 @@ function rr(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 or(e) {
|
|
369
|
-
if (e instanceof Rs || e instanceof ve || e instanceof
|
|
369
|
+
if (e instanceof Rs || e instanceof ve || e instanceof Yt)
|
|
370
370
|
return e.message;
|
|
371
371
|
const t = Ve(e);
|
|
372
372
|
return t ? sr(t) : Bt(e);
|
|
373
373
|
}
|
|
374
|
-
const nr = "12.5.
|
|
374
|
+
const nr = "12.5.2", ar = {
|
|
375
375
|
version: nr
|
|
376
376
|
}, C = {
|
|
377
377
|
/** Default limit for task listings */
|
|
@@ -434,7 +434,7 @@ const nr = "12.5.1", ar = {
|
|
|
434
434
|
*/
|
|
435
435
|
QUEUE_WAIT_MS: 3e4
|
|
436
436
|
};
|
|
437
|
-
function
|
|
437
|
+
function mt(e, { queueTimeoutMs: t = Be.QUEUE_WAIT_MS } = {}) {
|
|
438
438
|
if (!Number.isInteger(e) || e < 1)
|
|
439
439
|
throw new Error(
|
|
440
440
|
`maxConcurrent must be a positive integer, received ${String(e)}`
|
|
@@ -475,24 +475,24 @@ function ht(e, { queueTimeoutMs: t = Be.QUEUE_WAIT_MS } = {}) {
|
|
|
475
475
|
}
|
|
476
476
|
};
|
|
477
477
|
}
|
|
478
|
-
function
|
|
478
|
+
function qt() {
|
|
479
479
|
return {
|
|
480
|
-
moves:
|
|
481
|
-
writes:
|
|
480
|
+
moves: mt(Be.TASK_MOVES),
|
|
481
|
+
writes: mt(Be.WRITES)
|
|
482
482
|
};
|
|
483
483
|
}
|
|
484
|
-
const
|
|
484
|
+
const ht = /* @__PURE__ */ new Map(), Gt = /* @__PURE__ */ new WeakMap();
|
|
485
485
|
let ft;
|
|
486
486
|
function ir() {
|
|
487
|
-
return ft ??=
|
|
487
|
+
return ft ??= qt(), ft;
|
|
488
488
|
}
|
|
489
489
|
function cr(e) {
|
|
490
490
|
return _t("sha256").update(e).digest("hex");
|
|
491
491
|
}
|
|
492
492
|
function dr(e, t) {
|
|
493
493
|
const r = cr(t);
|
|
494
|
-
let o =
|
|
495
|
-
o || (o =
|
|
494
|
+
let o = ht.get(r);
|
|
495
|
+
o || (o = qt(), ht.set(r, o)), Gt.set(e, o);
|
|
496
496
|
}
|
|
497
497
|
function Kt(e) {
|
|
498
498
|
return Gt.get(e) ?? ir();
|
|
@@ -504,12 +504,12 @@ function ur(e) {
|
|
|
504
504
|
return Kt(e).writes;
|
|
505
505
|
}
|
|
506
506
|
const pr = "todoist-mcp", Je = ar.version, Vt = new _s(), bt = Us(import.meta.url);
|
|
507
|
-
let
|
|
508
|
-
const
|
|
507
|
+
let ke;
|
|
508
|
+
const mr = async () => {
|
|
509
509
|
const e = bt.resolve("@doist/todoist-sdk"), t = Re(Ut(e), "transport", "http-dispatcher.js");
|
|
510
510
|
return bt(t);
|
|
511
511
|
};
|
|
512
|
-
let
|
|
512
|
+
let hr = mr;
|
|
513
513
|
function fr() {
|
|
514
514
|
return `${pr}/${Je}`;
|
|
515
515
|
}
|
|
@@ -543,7 +543,7 @@ function yr(e, t) {
|
|
|
543
543
|
function gt() {
|
|
544
544
|
return new DOMException("The operation was aborted due to timeout", "TimeoutError");
|
|
545
545
|
}
|
|
546
|
-
function
|
|
546
|
+
function kr(e, t) {
|
|
547
547
|
if (!e && t === void 0)
|
|
548
548
|
return {
|
|
549
549
|
signal: void 0,
|
|
@@ -581,17 +581,17 @@ function Tr(e, t) {
|
|
|
581
581
|
}
|
|
582
582
|
};
|
|
583
583
|
}
|
|
584
|
-
async function
|
|
584
|
+
async function Tr() {
|
|
585
585
|
if (wr())
|
|
586
|
-
return
|
|
587
|
-
throw
|
|
588
|
-
})),
|
|
586
|
+
return ke || (ke = hr().then((e) => e.getDefaultDispatcher()).catch((e) => {
|
|
587
|
+
throw ke = void 0, e;
|
|
588
|
+
})), ke;
|
|
589
589
|
}
|
|
590
590
|
function wr() {
|
|
591
591
|
return typeof process < "u" && !!process.versions?.node;
|
|
592
592
|
}
|
|
593
593
|
async function vr(e) {
|
|
594
|
-
const t = await
|
|
594
|
+
const t = await Tr();
|
|
595
595
|
t !== void 0 && (e.dispatcher = t);
|
|
596
596
|
}
|
|
597
597
|
function Ir(e) {
|
|
@@ -608,18 +608,18 @@ function Ir(e) {
|
|
|
608
608
|
function jr(e = globalThis.fetch, t = {}) {
|
|
609
609
|
const r = e === globalThis.fetch, { enabled: o = !0, platform: n = "mcp", sessionId: a = Pe() } = t;
|
|
610
610
|
return async (i, c = {}) => {
|
|
611
|
-
const { timeout: d, headers: l, signal: u, ...p } = c, { signal:
|
|
611
|
+
const { timeout: d, headers: l, signal: u, ...p } = c, { signal: m, cleanup: h } = kr(u, d);
|
|
612
612
|
try {
|
|
613
613
|
const y = {
|
|
614
614
|
...p,
|
|
615
|
-
signal:
|
|
615
|
+
signal: m,
|
|
616
616
|
...o ? { headers: yr(l, { platform: n, sessionId: a }) } : l !== void 0 ? { headers: l } : {}
|
|
617
617
|
};
|
|
618
618
|
r && await vr(y);
|
|
619
619
|
const f = await e(i, y);
|
|
620
620
|
return Ir(f);
|
|
621
621
|
} finally {
|
|
622
|
-
|
|
622
|
+
h();
|
|
623
623
|
}
|
|
624
624
|
};
|
|
625
625
|
}
|
|
@@ -682,16 +682,16 @@ async function O(e, t = {}) {
|
|
|
682
682
|
}
|
|
683
683
|
throw i;
|
|
684
684
|
}
|
|
685
|
-
function
|
|
685
|
+
function Ye(e) {
|
|
686
686
|
if (e == null)
|
|
687
687
|
return e;
|
|
688
688
|
if (Array.isArray(e))
|
|
689
|
-
return e.map((t) =>
|
|
689
|
+
return e.map((t) => Ye(t));
|
|
690
690
|
if (typeof e == "object") {
|
|
691
691
|
const t = {};
|
|
692
692
|
for (const [r, o] of Object.entries(e))
|
|
693
693
|
if (o !== null) {
|
|
694
|
-
const n =
|
|
694
|
+
const n = Ye(o);
|
|
695
695
|
if (n !== null && typeof n == "object" && !Array.isArray(n) && Object.keys(n).length === 0)
|
|
696
696
|
continue;
|
|
697
697
|
t[r] = n;
|
|
@@ -775,7 +775,7 @@ function Ur({
|
|
|
775
775
|
structuredContent: t,
|
|
776
776
|
contentItems: r
|
|
777
777
|
}) {
|
|
778
|
-
const o =
|
|
778
|
+
const o = Ye(t), n = {}, a = [];
|
|
779
779
|
return r && a.push(...r), !_r && t && a.push({
|
|
780
780
|
type: "text",
|
|
781
781
|
text: JSON.stringify(o)
|
|
@@ -824,7 +824,7 @@ function ze(e) {
|
|
|
824
824
|
}
|
|
825
825
|
return e;
|
|
826
826
|
}
|
|
827
|
-
function
|
|
827
|
+
function Yr(e) {
|
|
828
828
|
const t = /\s*\([^)]*@[^)]+\)/g, r = /\S+@\S+\.\S+/g;
|
|
829
829
|
return e.replace(t, "").replace(r, "[email hidden]");
|
|
830
830
|
}
|
|
@@ -836,11 +836,11 @@ function zr({
|
|
|
836
836
|
}) {
|
|
837
837
|
const n = o.some((d) => d.name === "strip_emails") && Br.includes(e.name), a = e.execute, i = async (d, l) => {
|
|
838
838
|
try {
|
|
839
|
-
let { textContent: u, structuredContent: p, contentItems:
|
|
839
|
+
let { textContent: u, structuredContent: p, contentItems: m } = await br(
|
|
840
840
|
e.name,
|
|
841
841
|
() => O(() => a(d, r))
|
|
842
842
|
);
|
|
843
|
-
return n && (u && (u =
|
|
843
|
+
return n && (u && (u = Yr(u)), p && (p = ze(p))), Ur({ textContent: u, structuredContent: p, contentItems: m });
|
|
844
844
|
} catch (u) {
|
|
845
845
|
return console.error(`Error executing tool ${e.name}:`, { args: Nr(d), error: u }), Lr(or(u));
|
|
846
846
|
}
|
|
@@ -865,7 +865,7 @@ function zr({
|
|
|
865
865
|
}
|
|
866
866
|
t.registerTool(e.name, c, i);
|
|
867
867
|
}
|
|
868
|
-
const
|
|
868
|
+
const qr = {
|
|
869
869
|
period: s.enum(["today", "7d", "14d", "30d", "this-week", "this-month"]).default("7d").describe(
|
|
870
870
|
'Time period for the analysis. "today" analyzes the current day, "7d"/"14d"/"30d" analyze the last N days, "this-week" and "this-month" analyze the current week or month.'
|
|
871
871
|
),
|
|
@@ -997,11 +997,11 @@ function Jr(e) {
|
|
|
997
997
|
]
|
|
998
998
|
};
|
|
999
999
|
}
|
|
1000
|
-
const
|
|
1000
|
+
const he = {
|
|
1001
1001
|
name: "productivity-analysis",
|
|
1002
1002
|
title: "Productivity Analysis",
|
|
1003
1003
|
description: "Analyze your Todoist productivity with insights on completion trends, goal streaks, project distribution, and actionable recommendations. Gathers data from multiple tools and synthesizes a comprehensive report.",
|
|
1004
|
-
argsSchema:
|
|
1004
|
+
argsSchema: qr,
|
|
1005
1005
|
callback: Jr
|
|
1006
1006
|
};
|
|
1007
1007
|
class R extends Error {
|
|
@@ -1126,12 +1126,12 @@ class ro {
|
|
|
1126
1126
|
try {
|
|
1127
1127
|
const p = await t.getUser();
|
|
1128
1128
|
if (p) {
|
|
1129
|
-
const
|
|
1129
|
+
const m = {
|
|
1130
1130
|
id: p.id,
|
|
1131
1131
|
name: p.fullName,
|
|
1132
1132
|
email: p.email
|
|
1133
1133
|
};
|
|
1134
|
-
d.some((
|
|
1134
|
+
d.some((h) => h.id === p.id) || (d = [m, ...d]);
|
|
1135
1135
|
}
|
|
1136
1136
|
} catch {
|
|
1137
1137
|
}
|
|
@@ -1197,18 +1197,18 @@ class ro {
|
|
|
1197
1197
|
const c = (await N({
|
|
1198
1198
|
apiMethod: t.getProjects.bind(t),
|
|
1199
1199
|
args: {}
|
|
1200
|
-
})).filter((
|
|
1200
|
+
})).filter((m) => m.isShared);
|
|
1201
1201
|
if (c.length === 0) {
|
|
1202
|
-
const
|
|
1203
|
-
return n && oe.set(n,
|
|
1202
|
+
const m = [];
|
|
1203
|
+
return n && oe.set(n, m), m;
|
|
1204
1204
|
}
|
|
1205
1205
|
const d = [], l = /* @__PURE__ */ new Set(), u = c.map(
|
|
1206
|
-
(
|
|
1206
|
+
(m) => this.getProjectCollaborators(t, m.id, o)
|
|
1207
1207
|
), p = await Promise.allSettled(u);
|
|
1208
|
-
for (const
|
|
1209
|
-
if (
|
|
1210
|
-
for (const
|
|
1211
|
-
|
|
1208
|
+
for (const m of p)
|
|
1209
|
+
if (m.status === "fulfilled")
|
|
1210
|
+
for (const h of m.value)
|
|
1211
|
+
h && !l.has(h.id) && (d.push(h), l.add(h.id));
|
|
1212
1212
|
return n && oe.set(n, d), d;
|
|
1213
1213
|
} catch {
|
|
1214
1214
|
return [];
|
|
@@ -1376,8 +1376,8 @@ function Z(e) {
|
|
|
1376
1376
|
parentId: B(e) ? e.parentId ?? void 0 : void 0,
|
|
1377
1377
|
inboxProject: B(e) ? e.inboxProject ?? !1 : !1,
|
|
1378
1378
|
viewStyle: e.viewStyle,
|
|
1379
|
-
workspaceId:
|
|
1380
|
-
folderId:
|
|
1379
|
+
workspaceId: Te(e) ? e.workspaceId : void 0,
|
|
1380
|
+
folderId: Te(e) ? e.folderId ?? void 0 : void 0,
|
|
1381
1381
|
childOrder: e.childOrder,
|
|
1382
1382
|
isArchived: e.isArchived
|
|
1383
1383
|
};
|
|
@@ -1419,7 +1419,7 @@ function po(e) {
|
|
|
1419
1419
|
extraData: e.extraData ?? void 0
|
|
1420
1420
|
};
|
|
1421
1421
|
}
|
|
1422
|
-
const
|
|
1422
|
+
const mo = se.object({
|
|
1423
1423
|
httpStatusCode: se.number(),
|
|
1424
1424
|
responseData: se.object({
|
|
1425
1425
|
error: se.string(),
|
|
@@ -1437,7 +1437,7 @@ async function tt({
|
|
|
1437
1437
|
const { results: n, nextCursor: a } = await e.getTasksByFilter({ query: t, cursor: o, limit: r });
|
|
1438
1438
|
return { tasks: n.map(P), nextCursor: a };
|
|
1439
1439
|
} catch (n) {
|
|
1440
|
-
const a =
|
|
1440
|
+
const a = mo.safeParse(n);
|
|
1441
1441
|
if (!a.success)
|
|
1442
1442
|
throw n;
|
|
1443
1443
|
const { responseData: i } = a.data;
|
|
@@ -1493,132 +1493,126 @@ function ns(e) {
|
|
|
1493
1493
|
return { timeBasedCount: t, locationCount: r };
|
|
1494
1494
|
}
|
|
1495
1495
|
const Ie = _e.map((e) => e.key);
|
|
1496
|
-
function
|
|
1496
|
+
function ho(e) {
|
|
1497
1497
|
if (typeof e != "string") return;
|
|
1498
1498
|
const t = e.toLowerCase();
|
|
1499
1499
|
return (_e.find((o) => o.key === t) ?? _e.find((o) => o.displayName.toLowerCase() === t))?.key;
|
|
1500
1500
|
}
|
|
1501
|
-
const fo = `Color for the entity. Accepts a color key (e.g. "berry_red") or display name (e.g. "Berry Red"). Valid colors: ${Ie.join(", ")}. Unrecognized colors are omitted and charcoal will be used as the default.`, le = s.preprocess(
|
|
1502
|
-
s.enum(Ie)
|
|
1503
|
-
const ue = s.enum(Ie).optional().catch(void 0)
|
|
1504
|
-
id: s.string()
|
|
1505
|
-
content: s.string().describe("
|
|
1506
|
-
description: s.string()
|
|
1507
|
-
dueDate: s.string().optional().describe("
|
|
1508
|
-
recurring: s.union([s.boolean(), s.string()]).describe("
|
|
1509
|
-
deadlineDate: s.string().optional().describe("
|
|
1510
|
-
priority: Ze.describe(
|
|
1511
|
-
|
|
1512
|
-
),
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
completedAt: s.string().optional().describe("When the task was completed (ISO 8601 format)."),
|
|
1523
|
-
addedAt: s.string().optional().describe("When the task was created (ISO 8601 format).")
|
|
1501
|
+
const fo = `Color for the entity. Accepts a color key (e.g. "berry_red") or display name (e.g. "Berry Red"). Valid colors: ${Ie.join(", ")}. Unrecognized colors are omitted and charcoal will be used as the default.`, le = s.preprocess(ho, s.enum(Ie).optional()).describe(fo);
|
|
1502
|
+
s.enum(Ie);
|
|
1503
|
+
const ue = s.enum(Ie).optional().catch(void 0), F = s.object({
|
|
1504
|
+
id: s.string(),
|
|
1505
|
+
content: s.string().describe("Task title."),
|
|
1506
|
+
description: s.string(),
|
|
1507
|
+
dueDate: s.string().optional().describe("ISO 8601."),
|
|
1508
|
+
recurring: s.union([s.boolean(), s.string()]).describe("False when not recurring, otherwise the recurrence string."),
|
|
1509
|
+
deadlineDate: s.string().optional().describe("ISO 8601."),
|
|
1510
|
+
priority: Ze.describe("p1 is highest, p4 lowest."),
|
|
1511
|
+
projectId: s.string(),
|
|
1512
|
+
sectionId: s.string().optional(),
|
|
1513
|
+
parentId: s.string().optional(),
|
|
1514
|
+
labels: s.array(s.string()).optional(),
|
|
1515
|
+
duration: s.string().optional().describe('e.g. "2h30m".'),
|
|
1516
|
+
responsibleUid: s.string().optional(),
|
|
1517
|
+
isUncompletable: s.boolean().optional().describe("An organizational header, not a real task."),
|
|
1518
|
+
assignedByUid: s.string().optional(),
|
|
1519
|
+
checked: s.boolean().describe("Whether the task is completed."),
|
|
1520
|
+
completedAt: s.string().optional().describe("ISO 8601."),
|
|
1521
|
+
addedAt: s.string().optional().describe("ISO 8601.")
|
|
1524
1522
|
}), Q = s.object({
|
|
1525
|
-
id: s.string()
|
|
1526
|
-
name: s.string()
|
|
1527
|
-
description: s.string().describe("
|
|
1523
|
+
id: s.string(),
|
|
1524
|
+
name: s.string(),
|
|
1525
|
+
description: s.string().describe("Empty string when none."),
|
|
1528
1526
|
color: ue,
|
|
1529
|
-
isFavorite: s.boolean()
|
|
1530
|
-
isShared: s.boolean()
|
|
1531
|
-
parentId: s.string().optional()
|
|
1532
|
-
inboxProject: s.boolean()
|
|
1533
|
-
viewStyle: s.string().describe("
|
|
1534
|
-
workspaceId: s.string().optional().describe(
|
|
1535
|
-
|
|
1536
|
-
),
|
|
1537
|
-
|
|
1538
|
-
childOrder: s.number().describe("The ordering index of the project among its siblings."),
|
|
1539
|
-
isArchived: s.boolean().describe("Whether the project is archived.")
|
|
1527
|
+
isFavorite: s.boolean(),
|
|
1528
|
+
isShared: s.boolean(),
|
|
1529
|
+
parentId: s.string().optional(),
|
|
1530
|
+
inboxProject: s.boolean(),
|
|
1531
|
+
viewStyle: s.string().describe("list, board or calendar."),
|
|
1532
|
+
workspaceId: s.string().optional().describe("Undefined for personal projects."),
|
|
1533
|
+
folderId: s.string().optional().describe("Workspace projects only."),
|
|
1534
|
+
childOrder: s.number().describe("Ordering index among siblings."),
|
|
1535
|
+
isArchived: s.boolean()
|
|
1540
1536
|
}), X = s.object({
|
|
1541
|
-
id: s.string()
|
|
1542
|
-
name: s.string()
|
|
1543
|
-
sectionOrder: s.number().describe("
|
|
1544
|
-
description: s.string().optional().describe("
|
|
1537
|
+
id: s.string(),
|
|
1538
|
+
name: s.string(),
|
|
1539
|
+
sectionOrder: s.number().describe("Ordering index within the project."),
|
|
1540
|
+
description: s.string().optional().describe("Supports Markdown.")
|
|
1545
1541
|
});
|
|
1546
1542
|
function z({ id: e, name: t, sectionOrder: r, description: o }) {
|
|
1547
1543
|
return { id: e, name: t, sectionOrder: r, description: o ?? void 0 };
|
|
1548
1544
|
}
|
|
1549
1545
|
const bo = s.object({
|
|
1550
|
-
resourceType: s.string().describe("
|
|
1551
|
-
fileName: s.string().optional()
|
|
1552
|
-
fileSize: s.number().optional().describe("
|
|
1553
|
-
fileType: s.string().optional().describe("
|
|
1554
|
-
fileUrl: s.string().optional()
|
|
1555
|
-
fileDuration: s.number().optional().describe("
|
|
1556
|
-
uploadState: s.enum(["pending", "completed"]).optional()
|
|
1557
|
-
url: s.string().optional().describe("
|
|
1558
|
-
title: s.string().optional().describe("
|
|
1559
|
-
image: s.string().optional().describe("
|
|
1560
|
-
imageWidth: s.number().optional().describe("
|
|
1561
|
-
imageHeight: s.number().optional().describe("
|
|
1546
|
+
resourceType: s.string().describe("file, url, image, etc."),
|
|
1547
|
+
fileName: s.string().optional(),
|
|
1548
|
+
fileSize: s.number().optional().describe("Bytes."),
|
|
1549
|
+
fileType: s.string().optional().describe("MIME type."),
|
|
1550
|
+
fileUrl: s.string().optional(),
|
|
1551
|
+
fileDuration: s.number().optional().describe("Milliseconds, for audio/video."),
|
|
1552
|
+
uploadState: s.enum(["pending", "completed"]).optional(),
|
|
1553
|
+
url: s.string().optional().describe("For link/url resource types."),
|
|
1554
|
+
title: s.string().optional().describe("For link/url resource types."),
|
|
1555
|
+
image: s.string().optional().describe("For image resource types."),
|
|
1556
|
+
imageWidth: s.number().optional().describe("Pixels."),
|
|
1557
|
+
imageHeight: s.number().optional().describe("Pixels.")
|
|
1562
1558
|
}), ye = s.object({
|
|
1563
|
-
id: s.string()
|
|
1564
|
-
taskId: s.string().optional()
|
|
1565
|
-
projectId: s.string().optional()
|
|
1566
|
-
content: s.string()
|
|
1567
|
-
postedAt: s.string().describe("
|
|
1568
|
-
postedUid: s.string().optional()
|
|
1569
|
-
fileAttachment: bo.optional()
|
|
1559
|
+
id: s.string(),
|
|
1560
|
+
taskId: s.string().optional(),
|
|
1561
|
+
projectId: s.string().optional(),
|
|
1562
|
+
content: s.string(),
|
|
1563
|
+
postedAt: s.string().describe("ISO 8601."),
|
|
1564
|
+
postedUid: s.string().optional(),
|
|
1565
|
+
fileAttachment: bo.optional()
|
|
1570
1566
|
}), go = s.object({
|
|
1571
|
-
id: s.string().optional()
|
|
1572
|
-
objectType: s.string().describe("
|
|
1573
|
-
objectId: s.string()
|
|
1574
|
-
eventType: s.string().describe("
|
|
1575
|
-
eventDate: s.string().describe("
|
|
1576
|
-
parentProjectId: s.string().optional()
|
|
1577
|
-
parentItemId: s.string().optional()
|
|
1578
|
-
initiatorId: s.string().optional().describe("
|
|
1579
|
-
extraData: s.record(s.string(), s.unknown()).optional()
|
|
1567
|
+
id: s.string().optional(),
|
|
1568
|
+
objectType: s.string().describe("task, project, etc."),
|
|
1569
|
+
objectId: s.string(),
|
|
1570
|
+
eventType: s.string().describe("added, updated, deleted, completed, etc."),
|
|
1571
|
+
eventDate: s.string().describe("ISO 8601."),
|
|
1572
|
+
parentProjectId: s.string().optional(),
|
|
1573
|
+
parentItemId: s.string().optional(),
|
|
1574
|
+
initiatorId: s.string().optional().describe("User who initiated the event."),
|
|
1575
|
+
extraData: s.record(s.string(), s.unknown()).optional()
|
|
1580
1576
|
}), yo = s.object({
|
|
1581
|
-
id: s.string()
|
|
1582
|
-
name: s.string()
|
|
1583
|
-
email: s.string()
|
|
1577
|
+
id: s.string(),
|
|
1578
|
+
name: s.string(),
|
|
1579
|
+
email: s.string()
|
|
1584
1580
|
}), pe = s.object({
|
|
1585
|
-
id: s.string()
|
|
1586
|
-
name: s.string()
|
|
1581
|
+
id: s.string(),
|
|
1582
|
+
name: s.string(),
|
|
1587
1583
|
color: ue,
|
|
1588
|
-
order: s.number().optional().catch(void 0).describe("
|
|
1589
|
-
isFavorite: s.boolean()
|
|
1590
|
-
}),
|
|
1591
|
-
isRecurring: s.boolean()
|
|
1584
|
+
order: s.number().optional().catch(void 0).describe("Display order."),
|
|
1585
|
+
isFavorite: s.boolean()
|
|
1586
|
+
}), ko = s.object({
|
|
1587
|
+
isRecurring: s.boolean(),
|
|
1592
1588
|
string: s.string().describe("Human-readable due string."),
|
|
1593
|
-
date: s.string().describe("
|
|
1594
|
-
datetime: s.string().optional().describe("
|
|
1595
|
-
timezone: s.string().optional()
|
|
1589
|
+
date: s.string().describe("ISO 8601."),
|
|
1590
|
+
datetime: s.string().optional().describe("ISO 8601."),
|
|
1591
|
+
timezone: s.string().optional()
|
|
1596
1592
|
}), st = s.object({
|
|
1597
|
-
id: s.string()
|
|
1598
|
-
taskId: s.string()
|
|
1599
|
-
type: s.enum(Ms)
|
|
1600
|
-
minuteOffset: s.number().optional().describe("Minutes before due
|
|
1601
|
-
due:
|
|
1602
|
-
|
|
1603
|
-
),
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
radius: s.number().optional().describe("Geofence radius in meters (location reminders only)."),
|
|
1609
|
-
isUrgent: s.boolean().optional().describe("Whether this is an urgent reminder (relative and absolute reminders only).")
|
|
1593
|
+
id: s.string(),
|
|
1594
|
+
taskId: s.string(),
|
|
1595
|
+
type: s.enum(Ms),
|
|
1596
|
+
minuteOffset: s.number().optional().describe("Minutes before due. Relative reminders only."),
|
|
1597
|
+
due: ko.optional().describe("Absolute, and sometimes relative, reminders."),
|
|
1598
|
+
name: s.string().optional().describe("Location name. Location reminders only."),
|
|
1599
|
+
locLat: s.string().optional().describe("Location reminders only."),
|
|
1600
|
+
locLong: s.string().optional().describe("Location reminders only."),
|
|
1601
|
+
locTrigger: s.enum(Mt).optional().describe("Location reminders only."),
|
|
1602
|
+
radius: s.number().optional().describe("Geofence radius in metres. Location reminders only."),
|
|
1603
|
+
isUrgent: s.boolean().optional().describe("Relative and absolute reminders only.")
|
|
1610
1604
|
}), ee = s.object({
|
|
1611
|
-
item: s.string().describe("
|
|
1612
|
-
error: s.string()
|
|
1613
|
-
code: s.string().optional()
|
|
1614
|
-
}),
|
|
1605
|
+
item: s.string().describe("Usually the ID of the item that failed."),
|
|
1606
|
+
error: s.string(),
|
|
1607
|
+
code: s.string().optional()
|
|
1608
|
+
}), To = s.object({
|
|
1615
1609
|
taskId: s.string().optional().describe("The ID of the task to comment on."),
|
|
1616
1610
|
projectId: s.string().optional().describe(
|
|
1617
1611
|
'The ID of the project to comment on. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
1618
1612
|
),
|
|
1619
1613
|
content: s.string().min(1).describe("The content of the comment.")
|
|
1620
1614
|
}), wo = {
|
|
1621
|
-
comments: s.array(
|
|
1615
|
+
comments: s.array(To).min(1).describe("The array of comments to add.")
|
|
1622
1616
|
}, vo = {
|
|
1623
1617
|
comments: s.array(ye).describe("The created comments."),
|
|
1624
1618
|
totalCount: s.number().describe("The total number of comments created."),
|
|
@@ -1642,14 +1636,14 @@ const bo = s.object({
|
|
|
1642
1636
|
);
|
|
1643
1637
|
}
|
|
1644
1638
|
const n = r.some((l) => M(l.projectId)) ? await t.getUser() : void 0, a = r.map(async ({ content: l, taskId: u, projectId: p }) => {
|
|
1645
|
-
const
|
|
1639
|
+
const m = await de({
|
|
1646
1640
|
projectId: p,
|
|
1647
1641
|
user: n,
|
|
1648
1642
|
client: n ? void 0 : t
|
|
1649
1643
|
});
|
|
1650
1644
|
return await t.addComment({
|
|
1651
1645
|
content: l,
|
|
1652
|
-
...u ? { taskId: u } : { projectId:
|
|
1646
|
+
...u ? { taskId: u } : { projectId: m }
|
|
1653
1647
|
});
|
|
1654
1648
|
}), c = (await Promise.all(a)).map(ge);
|
|
1655
1649
|
return {
|
|
@@ -1758,7 +1752,7 @@ const xo = s.object({
|
|
|
1758
1752
|
outputSchema: Eo,
|
|
1759
1753
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
1760
1754
|
async execute({ filters: e }, t) {
|
|
1761
|
-
const r = Date.now(), o = e.map((p,
|
|
1755
|
+
const r = Date.now(), o = e.map((p, m) => `tempFilterAdd${m}${r}`), n = e.map((p, m) => V(
|
|
1762
1756
|
"filter_add",
|
|
1763
1757
|
{
|
|
1764
1758
|
name: p.name,
|
|
@@ -1766,9 +1760,9 @@ const xo = s.object({
|
|
|
1766
1760
|
...p.color !== void 0 ? { color: p.color } : {},
|
|
1767
1761
|
...p.isFavorite !== void 0 ? { isFavorite: p.isFavorite } : {}
|
|
1768
1762
|
},
|
|
1769
|
-
o[
|
|
1770
|
-
)), i = (await t.sync({ commands: n })).tempIdMapping ?? {}, c = e.map((p,
|
|
1771
|
-
const
|
|
1763
|
+
o[m]
|
|
1764
|
+
)), i = (await t.sync({ commands: n })).tempIdMapping ?? {}, c = e.map((p, m) => {
|
|
1765
|
+
const h = o[m], y = h !== void 0 ? i[h] : void 0;
|
|
1772
1766
|
if (!y) return null;
|
|
1773
1767
|
const f = p.color !== void 0 ? ue.parse(p.color) : void 0;
|
|
1774
1768
|
return {
|
|
@@ -1889,7 +1883,7 @@ function je(e, t = 5) {
|
|
|
1889
1883
|
}
|
|
1890
1884
|
return o;
|
|
1891
1885
|
}
|
|
1892
|
-
function
|
|
1886
|
+
function q({
|
|
1893
1887
|
subject: e,
|
|
1894
1888
|
count: t,
|
|
1895
1889
|
limit: r,
|
|
@@ -1974,7 +1968,7 @@ ${u}` + (d.length > 5 ? `
|
|
|
1974
1968
|
this.cache = null;
|
|
1975
1969
|
}
|
|
1976
1970
|
}
|
|
1977
|
-
const is = new Bo(),
|
|
1971
|
+
const is = new Bo(), Yo = s.object({
|
|
1978
1972
|
name: s.string().min(1).describe("The name of the project."),
|
|
1979
1973
|
parentId: s.string().optional().describe("The ID of the parent project. If provided, creates this as a sub-project."),
|
|
1980
1974
|
isFavorite: s.boolean().optional().describe("Whether the project is a favorite. Defaults to false."),
|
|
@@ -1985,8 +1979,8 @@ const is = new Bo(), qo = s.object({
|
|
|
1985
1979
|
"The workspace to create the project in. Accepts a workspace name or workspace ID. If not provided, creates a personal project. Use list-workspaces to see available workspaces."
|
|
1986
1980
|
)
|
|
1987
1981
|
}), zo = {
|
|
1988
|
-
projects: s.array(
|
|
1989
|
-
},
|
|
1982
|
+
projects: s.array(Yo).min(1).describe("The array of projects to add.")
|
|
1983
|
+
}, qo = {
|
|
1990
1984
|
projects: s.array(Q).describe("The created projects."),
|
|
1991
1985
|
totalCount: s.number().describe("The total number of projects created."),
|
|
1992
1986
|
failures: s.array(ee).describe(
|
|
@@ -1999,7 +1993,7 @@ const is = new Bo(), qo = s.object({
|
|
|
1999
1993
|
name: g.ADD_PROJECTS,
|
|
2000
1994
|
description: "Add one or more new projects.",
|
|
2001
1995
|
parameters: zo,
|
|
2002
|
-
outputSchema:
|
|
1996
|
+
outputSchema: qo,
|
|
2003
1997
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
2004
1998
|
async execute({ projects: e }, t) {
|
|
2005
1999
|
const r = /* @__PURE__ */ new Map(), o = (l) => {
|
|
@@ -2020,7 +2014,7 @@ const is = new Bo(), qo = s.object({
|
|
|
2020
2014
|
n.forEach((l, u) => {
|
|
2021
2015
|
l.status === "fulfilled" ? a.push(l.value) : i.push({
|
|
2022
2016
|
item: e[u]?.name ?? `Project ${u + 1}`,
|
|
2023
|
-
error:
|
|
2017
|
+
error: Y(l.reason)
|
|
2024
2018
|
});
|
|
2025
2019
|
});
|
|
2026
2020
|
const c = a.map(Z);
|
|
@@ -2186,7 +2180,7 @@ const rn = s.object({
|
|
|
2186
2180
|
return o.forEach((c, d) => {
|
|
2187
2181
|
c.status === "fulfilled" ? n.push(c.value) : a.push({
|
|
2188
2182
|
item: e[d]?.name ?? `Section ${d + 1}`,
|
|
2189
|
-
error:
|
|
2183
|
+
error: Y(c.reason)
|
|
2190
2184
|
});
|
|
2191
2185
|
}), {
|
|
2192
2186
|
textContent: cn({ sections: n, failures: a }),
|
|
@@ -2400,15 +2394,15 @@ class dn {
|
|
|
2400
2394
|
const u = await W.resolveUser(t, o);
|
|
2401
2395
|
if (!u)
|
|
2402
2396
|
return a.push("User not found - check spelling or invite to a shared project"), { canAssign: !1, projectInfo: l, recommendations: a };
|
|
2403
|
-
const p = d.some((y) => y.id === u.userId),
|
|
2397
|
+
const p = d.some((y) => y.id === u.userId), m = {
|
|
2404
2398
|
resolvedName: u.displayName,
|
|
2405
2399
|
isCollaborator: p
|
|
2406
2400
|
};
|
|
2407
2401
|
if (!p)
|
|
2408
2402
|
return a.push(
|
|
2409
2403
|
`Invite ${u.displayName} to collaborate on project "${c.name}"`
|
|
2410
|
-
), { canAssign: !1, projectInfo: l, userInfo:
|
|
2411
|
-
let
|
|
2404
|
+
), { canAssign: !1, projectInfo: l, userInfo: m, recommendations: a };
|
|
2405
|
+
let h;
|
|
2412
2406
|
if (n && n.length > 0) {
|
|
2413
2407
|
let y = 0, f = 0;
|
|
2414
2408
|
for (const v of n)
|
|
@@ -2417,13 +2411,13 @@ class dn {
|
|
|
2417
2411
|
} catch {
|
|
2418
2412
|
f++;
|
|
2419
2413
|
}
|
|
2420
|
-
|
|
2414
|
+
h = { accessibleTasks: y, inaccessibleTasks: f }, f > 0 && a.push(`${f} task(s) are not accessible`);
|
|
2421
2415
|
}
|
|
2422
2416
|
return i = !0, a.push(`Ready to assign tasks to ${u.displayName}`), {
|
|
2423
2417
|
canAssign: i,
|
|
2424
2418
|
projectInfo: l,
|
|
2425
|
-
userInfo:
|
|
2426
|
-
taskInfo:
|
|
2419
|
+
userInfo: m,
|
|
2420
|
+
taskInfo: h,
|
|
2427
2421
|
recommendations: a
|
|
2428
2422
|
};
|
|
2429
2423
|
}
|
|
@@ -2432,7 +2426,7 @@ const it = new dn();
|
|
|
2432
2426
|
function U(e) {
|
|
2433
2427
|
return s.string().transform((t) => t === "" ? void 0 : t).optional().describe(e);
|
|
2434
2428
|
}
|
|
2435
|
-
const
|
|
2429
|
+
const kt = zt.TASKS_PER_OPERATION, ln = s.object({
|
|
2436
2430
|
content: s.string().min(1).describe(
|
|
2437
2431
|
'The task name/title. Should be concise and actionable (e.g., "Review PR #123", "Call dentist"). For longer content, use the description field instead. Supports Markdown.'
|
|
2438
2432
|
),
|
|
@@ -2462,8 +2456,8 @@ const Tt = zt.TASKS_PER_OPERATION, ln = s.object({
|
|
|
2462
2456
|
isUncompletable: s.boolean().optional().describe(
|
|
2463
2457
|
"Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
|
|
2464
2458
|
)
|
|
2465
|
-
}),
|
|
2466
|
-
tasks: s.array(ln).min(1).max(
|
|
2459
|
+
}), Tt = {
|
|
2460
|
+
tasks: s.array(ln).min(1).max(kt).describe(`The array of tasks to add (max ${kt}).`)
|
|
2467
2461
|
}, un = {
|
|
2468
2462
|
tasks: s.array(F).describe("The created tasks."),
|
|
2469
2463
|
totalCount: s.number().describe("The total number of tasks created."),
|
|
@@ -2474,43 +2468,43 @@ const Tt = zt.TASKS_PER_OPERATION, ln = s.object({
|
|
|
2474
2468
|
}, pn = {
|
|
2475
2469
|
name: g.ADD_TASKS,
|
|
2476
2470
|
description: "Add one or more tasks to a project, section, or parent. Supports assignment to project collaborators.",
|
|
2477
|
-
parameters:
|
|
2471
|
+
parameters: Tt,
|
|
2478
2472
|
outputSchema: un,
|
|
2479
2473
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
2480
2474
|
async execute(e, t) {
|
|
2481
|
-
const { tasks: r } = s.object(
|
|
2482
|
-
r.forEach((
|
|
2483
|
-
const y =
|
|
2484
|
-
f ? f.push({ task:
|
|
2475
|
+
const { tasks: r } = s.object(Tt).parse(e), o = /* @__PURE__ */ new Map();
|
|
2476
|
+
r.forEach((m, h) => {
|
|
2477
|
+
const y = mn(m), f = o.get(y);
|
|
2478
|
+
f ? f.push({ task: m, index: h }) : o.set(y, [{ task: m, index: h }]);
|
|
2485
2479
|
});
|
|
2486
2480
|
const n = /* @__PURE__ */ new Map(), i = (await Promise.all(
|
|
2487
|
-
[...o.values()].map(async (
|
|
2488
|
-
const
|
|
2489
|
-
for (const { task: y, index: f } of
|
|
2481
|
+
[...o.values()].map(async (m) => {
|
|
2482
|
+
const h = [];
|
|
2483
|
+
for (const { task: y, index: f } of m)
|
|
2490
2484
|
try {
|
|
2491
|
-
const v = await
|
|
2492
|
-
|
|
2485
|
+
const v = await hn(y, t, n);
|
|
2486
|
+
h.push({ index: f, result: { status: "fulfilled", value: v } });
|
|
2493
2487
|
} catch (v) {
|
|
2494
|
-
|
|
2488
|
+
h.push({
|
|
2495
2489
|
index: f,
|
|
2496
2490
|
result: { status: "rejected", reason: v }
|
|
2497
2491
|
});
|
|
2498
2492
|
}
|
|
2499
|
-
return
|
|
2493
|
+
return h;
|
|
2500
2494
|
})
|
|
2501
|
-
)).flat().sort((
|
|
2495
|
+
)).flat().sort((m, h) => m.index - h.index), c = [], d = [];
|
|
2502
2496
|
let l = !1;
|
|
2503
|
-
for (const { index:
|
|
2504
|
-
|
|
2505
|
-
item: r[
|
|
2497
|
+
for (const { index: m, result: h } of i)
|
|
2498
|
+
h.status === "fulfilled" ? c.push(h.value) : (l ||= h.reason instanceof ve, d.push({
|
|
2499
|
+
item: r[m]?.content ?? `Task ${m + 1}`,
|
|
2506
2500
|
// Keep API error signals (status/code/tag) — `error.message`
|
|
2507
2501
|
// alone collapses e.g. a full-project rejection into a bare
|
|
2508
2502
|
// "HTTP 403: Forbidden"
|
|
2509
|
-
error:
|
|
2503
|
+
error: Y(h.reason)
|
|
2510
2504
|
}));
|
|
2511
2505
|
if (c.length === 0 && d.length > 0) {
|
|
2512
|
-
const
|
|
2513
|
-
throw l ? new
|
|
2506
|
+
const m = d.map((y) => `"${y.item}": ${y.error}`).join("; "), h = `All ${d.length} task(s) failed to create: ${m}`;
|
|
2507
|
+
throw l ? new Yt(h) : new Error(h);
|
|
2514
2508
|
}
|
|
2515
2509
|
const u = c.map(P);
|
|
2516
2510
|
return {
|
|
@@ -2530,10 +2524,10 @@ const Tt = zt.TASKS_PER_OPERATION, ln = s.object({
|
|
|
2530
2524
|
};
|
|
2531
2525
|
}
|
|
2532
2526
|
};
|
|
2533
|
-
function
|
|
2527
|
+
function mn(e) {
|
|
2534
2528
|
return `${e.projectId ?? ""}|${e.sectionId ?? ""}|${e.parentId ?? ""}`;
|
|
2535
2529
|
}
|
|
2536
|
-
async function
|
|
2530
|
+
async function hn(e, t, r) {
|
|
2537
2531
|
const {
|
|
2538
2532
|
duration: o,
|
|
2539
2533
|
projectId: n,
|
|
@@ -2544,25 +2538,25 @@ async function mn(e, t, r) {
|
|
|
2544
2538
|
priority: l,
|
|
2545
2539
|
labels: u,
|
|
2546
2540
|
deadlineDate: p,
|
|
2547
|
-
...
|
|
2548
|
-
} = e,
|
|
2549
|
-
if (
|
|
2550
|
-
const f = await t.getProject(
|
|
2541
|
+
...m
|
|
2542
|
+
} = e, h = M(n) ? void 0 : n;
|
|
2543
|
+
if (h) {
|
|
2544
|
+
const f = await t.getProject(h);
|
|
2551
2545
|
if (f.isArchived)
|
|
2552
2546
|
throw new Error(
|
|
2553
2547
|
`Task "${e.content}": Cannot create task in archived project "${f.name}"`
|
|
2554
2548
|
);
|
|
2555
2549
|
}
|
|
2556
2550
|
let y = {
|
|
2557
|
-
...
|
|
2558
|
-
projectId:
|
|
2551
|
+
...m,
|
|
2552
|
+
projectId: h,
|
|
2559
2553
|
sectionId: a,
|
|
2560
2554
|
parentId: i,
|
|
2561
2555
|
order: c,
|
|
2562
2556
|
labels: u,
|
|
2563
2557
|
deadlineDate: p
|
|
2564
2558
|
};
|
|
2565
|
-
if (l && (y.priority = Zt(l)), d && !
|
|
2559
|
+
if (l && (y.priority = Zt(l)), d && !h && !a && !i)
|
|
2566
2560
|
throw new Error(
|
|
2567
2561
|
`Task "${e.content}": Cannot assign tasks without specifying project context. Please specify a projectId, sectionId, or parentId.`
|
|
2568
2562
|
);
|
|
@@ -2578,7 +2572,7 @@ async function mn(e, t, r) {
|
|
|
2578
2572
|
throw f instanceof R ? new Error(`Task "${e.content}": ${f.message}`) : f;
|
|
2579
2573
|
}
|
|
2580
2574
|
if (d) {
|
|
2581
|
-
let f =
|
|
2575
|
+
let f = h;
|
|
2582
2576
|
if (!f && i)
|
|
2583
2577
|
try {
|
|
2584
2578
|
f = (await t.getTask(i)).projectId;
|
|
@@ -2683,9 +2677,9 @@ ${n}`,
|
|
|
2683
2677
|
}
|
|
2684
2678
|
};
|
|
2685
2679
|
}
|
|
2686
|
-
}, Tn = {
|
|
2687
|
-
ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to complete.")
|
|
2688
2680
|
}, kn = {
|
|
2681
|
+
ids: s.array(s.string().min(1)).min(1).describe("The IDs of the tasks to complete.")
|
|
2682
|
+
}, Tn = {
|
|
2689
2683
|
completed: s.array(s.string()).describe("The IDs of successfully completed tasks."),
|
|
2690
2684
|
failures: s.array(ee).describe("Failed task completions with error details."),
|
|
2691
2685
|
totalRequested: s.number().describe("The total number of tasks requested to complete."),
|
|
@@ -2694,8 +2688,8 @@ ${n}`,
|
|
|
2694
2688
|
}, wn = {
|
|
2695
2689
|
name: g.COMPLETE_TASKS,
|
|
2696
2690
|
description: "Complete one or more tasks by their IDs.",
|
|
2697
|
-
parameters:
|
|
2698
|
-
outputSchema:
|
|
2691
|
+
parameters: kn,
|
|
2692
|
+
outputSchema: Tn,
|
|
2699
2693
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
2700
2694
|
async execute(e, t) {
|
|
2701
2695
|
const r = [], o = [];
|
|
@@ -2766,7 +2760,7 @@ const ls = [
|
|
|
2766
2760
|
switch (e.type) {
|
|
2767
2761
|
case "project": {
|
|
2768
2762
|
const r = await t.getProject(e.id);
|
|
2769
|
-
if (
|
|
2763
|
+
if (Te(r) && !r.isArchived)
|
|
2770
2764
|
throw new Error(
|
|
2771
2765
|
`Workspace project "${r.name}" must be archived before it can be deleted. Archive the project first, then delete it.`
|
|
2772
2766
|
);
|
|
@@ -3127,11 +3121,11 @@ const Wn = {
|
|
|
3127
3121
|
cursor: s.string().optional().describe("Pagination cursor for retrieving the next page of results.")
|
|
3128
3122
|
}, Bn = {
|
|
3129
3123
|
events: s.array(go).describe("The activity events."),
|
|
3130
|
-
nextCursor: s.string().optional()
|
|
3124
|
+
nextCursor: s.string().optional(),
|
|
3131
3125
|
totalCount: s.number().describe("The total number of events in this page."),
|
|
3132
|
-
hasMore: s.boolean()
|
|
3133
|
-
appliedFilters: s.record(s.string(), s.unknown())
|
|
3134
|
-
},
|
|
3126
|
+
hasMore: s.boolean(),
|
|
3127
|
+
appliedFilters: s.record(s.string(), s.unknown())
|
|
3128
|
+
}, Yn = {
|
|
3135
3129
|
name: g.FIND_ACTIVITY,
|
|
3136
3130
|
description: 'Retrieve activity logs to monitor and audit changes in Todoist. Shows events from all users by default (use initiatorId to filter by specific user). To answer what someone completed in a period, including recurring task occurrences, use objectType "task", eventType "completed", and dateFrom/dateTo. Track task completions, updates, deletions, project changes, and more with flexible filtering. Activity history availability and retention depend on the user plan.',
|
|
3137
3131
|
parameters: Wn,
|
|
@@ -3149,12 +3143,12 @@ const Wn = {
|
|
|
3149
3143
|
dateTo: l,
|
|
3150
3144
|
limit: u,
|
|
3151
3145
|
cursor: p
|
|
3152
|
-
} = e,
|
|
3146
|
+
} = e, m = {
|
|
3153
3147
|
limit: u,
|
|
3154
3148
|
cursor: p ?? null
|
|
3155
3149
|
};
|
|
3156
|
-
r && n ?
|
|
3157
|
-
const { results:
|
|
3150
|
+
r && n ? m.objectEventTypes = `${r}:${n}` : r ? m.objectEventTypes = `${r}:` : n && (m.objectEventTypes = `:${n}`), o && o !== "remove" && (m.objectId = o), a && (m.parentProjectId = a), i && (m.parentItemId = i), c && (m.initiatorId = c), d && (m.dateFrom = d), l && (m.dateTo = l);
|
|
3151
|
+
const { results: h, nextCursor: y } = await t.getActivityLogs(m), f = h.map(po);
|
|
3158
3152
|
return {
|
|
3159
3153
|
textContent: zn({ events: f, args: e, nextCursor: y }),
|
|
3160
3154
|
structuredContent: {
|
|
@@ -3182,17 +3176,17 @@ function zn({
|
|
|
3182
3176
|
const a = [];
|
|
3183
3177
|
t.objectId && a.push(`object ID: ${t.objectId}`), t.projectId && a.push(`project: ${t.projectId}`), t.taskId && a.push(`task: ${t.taskId}`), t.initiatorId && a.push(`initiator: ${t.initiatorId}`), t.dateFrom && a.push(`from: ${t.dateFrom}`), t.dateTo && a.push(`until (exclusive): ${t.dateTo}`);
|
|
3184
3178
|
const i = [];
|
|
3185
|
-
return e.length === 0 && (i.push("No activity events match the specified filters"), i.push("Note: Activity logs only show recent events"), t.eventType && i.push(`Try removing the eventType filter (${t.eventType})`), t.objectType && i.push(`Try removing the objectType filter (${t.objectType})`), (t.objectId || t.projectId || t.taskId) && i.push("Verify the object ID is correct")),
|
|
3179
|
+
return e.length === 0 && (i.push("No activity events match the specified filters"), i.push("Note: Activity logs only show recent events"), t.eventType && i.push(`Try removing the eventType filter (${t.eventType})`), t.objectType && i.push(`Try removing the objectType filter (${t.objectType})`), (t.objectId || t.projectId || t.taskId) && i.push("Verify the object ID is correct")), q({
|
|
3186
3180
|
subject: o,
|
|
3187
3181
|
count: e.length,
|
|
3188
3182
|
limit: t.limit,
|
|
3189
3183
|
nextCursor: r ?? void 0,
|
|
3190
3184
|
filterHints: a,
|
|
3191
|
-
previewLines:
|
|
3185
|
+
previewLines: qn(e, Math.min(e.length, t.limit)),
|
|
3192
3186
|
zeroReasonHints: i
|
|
3193
3187
|
});
|
|
3194
3188
|
}
|
|
3195
|
-
function
|
|
3189
|
+
function qn(e, t = 10) {
|
|
3196
3190
|
const o = e.slice(0, t).map(Gn).join(`
|
|
3197
3191
|
`);
|
|
3198
3192
|
if (e.length > t) {
|
|
@@ -3239,8 +3233,8 @@ const Vn = {
|
|
|
3239
3233
|
'The type of search performed: "single" (comment ID), "task" (task ID), or "project" (project ID).'
|
|
3240
3234
|
),
|
|
3241
3235
|
searchId: s.string().describe("The ID that was searched for (comment, task, or project ID)."),
|
|
3242
|
-
hasMore: s.boolean()
|
|
3243
|
-
nextCursor: s.string().optional()
|
|
3236
|
+
hasMore: s.boolean(),
|
|
3237
|
+
nextCursor: s.string().optional(),
|
|
3244
3238
|
totalCount: s.number().describe("The total number of comments in this page.")
|
|
3245
3239
|
}, Xn = {
|
|
3246
3240
|
name: g.FIND_COMMENTS,
|
|
@@ -3325,7 +3319,7 @@ ${i}`;
|
|
|
3325
3319
|
}
|
|
3326
3320
|
return a;
|
|
3327
3321
|
}
|
|
3328
|
-
function
|
|
3322
|
+
function ms(e) {
|
|
3329
3323
|
const t = e.getUTCFullYear(), r = String(e.getUTCMonth() + 1).padStart(2, "0"), o = String(e.getUTCDate()).padStart(2, "0");
|
|
3330
3324
|
return `${t}-${r}-${o}`;
|
|
3331
3325
|
}
|
|
@@ -3338,14 +3332,14 @@ function Qn(e) {
|
|
|
3338
3332
|
}
|
|
3339
3333
|
function ea(e, t) {
|
|
3340
3334
|
const r = new Date(e.getTime() + t * 60 * 1e3);
|
|
3341
|
-
return
|
|
3335
|
+
return ms(r);
|
|
3342
3336
|
}
|
|
3343
3337
|
function St(e, t) {
|
|
3344
3338
|
const [r, o, n] = e.split("-"), a = Number(r), i = Number(o), c = Number(n);
|
|
3345
3339
|
if (!Number.isFinite(a) || !Number.isFinite(i) || !Number.isFinite(c))
|
|
3346
3340
|
throw new Error(`Invalid date format: ${e}. Expected YYYY-MM-DD.`);
|
|
3347
3341
|
const d = new Date(Date.UTC(a, i - 1, c));
|
|
3348
|
-
return d.setUTCDate(d.getUTCDate() + t),
|
|
3342
|
+
return d.setUTCDate(d.getUTCDate() + t), ms(d);
|
|
3349
3343
|
}
|
|
3350
3344
|
const ta = ["and", "or"], ct = {
|
|
3351
3345
|
labels: s.string().array().optional().describe("The labels to filter the tasks by"),
|
|
@@ -3397,10 +3391,10 @@ const oa = {
|
|
|
3397
3391
|
...ct
|
|
3398
3392
|
}, na = {
|
|
3399
3393
|
tasks: s.array(F).describe("The found completed tasks."),
|
|
3400
|
-
nextCursor: s.string().optional()
|
|
3394
|
+
nextCursor: s.string().optional(),
|
|
3401
3395
|
totalCount: s.number().describe("The total number of tasks in this page."),
|
|
3402
|
-
hasMore: s.boolean()
|
|
3403
|
-
appliedFilters: s.record(s.string(), s.unknown())
|
|
3396
|
+
hasMore: s.boolean(),
|
|
3397
|
+
appliedFilters: s.record(s.string(), s.unknown())
|
|
3404
3398
|
}, aa = {
|
|
3405
3399
|
name: g.FIND_COMPLETED_TASKS,
|
|
3406
3400
|
description: "Get completed tasks. since/until are optional and default to a 7-day window when omitted. Includes all collaborators by default. Person-specific queries (summaries, plans, reports) require responsibleUser.",
|
|
@@ -3414,8 +3408,8 @@ const oa = {
|
|
|
3414
3408
|
"Cursor pagination requires explicit since and until. Reuse structuredContent.appliedFilters.since and structuredContent.appliedFilters.until from the previous page."
|
|
3415
3409
|
);
|
|
3416
3410
|
const u = await Qe(t, c), p = u?.email;
|
|
3417
|
-
let
|
|
3418
|
-
u && p && (
|
|
3411
|
+
let h = dt(o, n);
|
|
3412
|
+
u && p && (h = ce(h, `assigned to: ${p}`));
|
|
3419
3413
|
const y = await t.getUser(), f = y.tzInfo?.gmtString || "+00:00", v = await de({
|
|
3420
3414
|
projectId: d,
|
|
3421
3415
|
user: y
|
|
@@ -3423,7 +3417,7 @@ const oa = {
|
|
|
3423
3417
|
since: a,
|
|
3424
3418
|
until: i,
|
|
3425
3419
|
userGmtOffset: f
|
|
3426
|
-
}), A = `${S.since}T00:00:00${f}`,
|
|
3420
|
+
}), A = `${S.since}T00:00:00${f}`, T = `${S.until}T23:59:59${f}`, I = new Date(A).toISOString(), x = new Date(T).toISOString(), k = {
|
|
3427
3421
|
...e,
|
|
3428
3422
|
since: S.since,
|
|
3429
3423
|
until: S.until
|
|
@@ -3432,18 +3426,18 @@ const oa = {
|
|
|
3432
3426
|
projectId: v,
|
|
3433
3427
|
since: I,
|
|
3434
3428
|
until: x,
|
|
3435
|
-
...
|
|
3429
|
+
...h ? { filterQuery: h, filterLang: "en" } : {}
|
|
3436
3430
|
}) : await t.getCompletedTasksByDueDate({
|
|
3437
3431
|
...l,
|
|
3438
3432
|
projectId: v,
|
|
3439
3433
|
since: I,
|
|
3440
3434
|
until: x,
|
|
3441
|
-
...
|
|
3435
|
+
...h ? { filterQuery: h, filterLang: "en" } : {}
|
|
3442
3436
|
}), $ = b.map(P);
|
|
3443
3437
|
return {
|
|
3444
3438
|
textContent: ia({
|
|
3445
3439
|
tasks: $,
|
|
3446
|
-
args:
|
|
3440
|
+
args: k,
|
|
3447
3441
|
nextCursor: j,
|
|
3448
3442
|
assigneeEmail: p
|
|
3449
3443
|
}),
|
|
@@ -3452,7 +3446,7 @@ const oa = {
|
|
|
3452
3446
|
nextCursor: j ?? void 0,
|
|
3453
3447
|
totalCount: $.length,
|
|
3454
3448
|
hasMore: !!j,
|
|
3455
|
-
appliedFilters:
|
|
3449
|
+
appliedFilters: k
|
|
3456
3450
|
}
|
|
3457
3451
|
};
|
|
3458
3452
|
}
|
|
@@ -3473,7 +3467,7 @@ function ia({
|
|
|
3473
3467
|
i.push(`assigned to: ${d}`);
|
|
3474
3468
|
}
|
|
3475
3469
|
const c = [];
|
|
3476
|
-
return e.length === 0 && (c.push("No tasks completed in this date range"), c.push("Try expanding the date range"), (t.projectId || t.sectionId || t.parentId) && c.push("Try removing project/section/parent filters"), t.getBy === "due" && c.push('Try switching to "completion" date instead')),
|
|
3470
|
+
return e.length === 0 && (c.push("No tasks completed in this date range"), c.push("Try expanding the date range"), (t.projectId || t.sectionId || t.parentId) && c.push("Try removing project/section/parent filters"), t.getBy === "due" && c.push('Try switching to "completion" date instead')), q({
|
|
3477
3471
|
subject: a,
|
|
3478
3472
|
count: e.length,
|
|
3479
3473
|
limit: t.limit,
|
|
@@ -3493,13 +3487,13 @@ const ca = {
|
|
|
3493
3487
|
)
|
|
3494
3488
|
}, da = {
|
|
3495
3489
|
labels: s.array(pe).describe("The found personal labels."),
|
|
3496
|
-
nextCursor: s.string().optional()
|
|
3490
|
+
nextCursor: s.string().optional(),
|
|
3497
3491
|
totalCount: s.number().describe("The total number of labels in this page."),
|
|
3498
|
-
hasMore: s.boolean()
|
|
3492
|
+
hasMore: s.boolean(),
|
|
3499
3493
|
sharedLabels: s.array(s.string()).describe(
|
|
3500
3494
|
"Names of all shared labels visible to you. These have no IDs or metadata — use their names directly when filtering tasks."
|
|
3501
3495
|
),
|
|
3502
|
-
appliedFilters: s.record(s.string(), s.unknown())
|
|
3496
|
+
appliedFilters: s.record(s.string(), s.unknown())
|
|
3503
3497
|
}, la = {
|
|
3504
3498
|
name: g.FIND_LABELS,
|
|
3505
3499
|
description: "List personal labels and shared labels. Personal labels have full metadata (id, name, color, order, isFavorite) and support pagination and name search (partial, case insensitive). Shared labels are labels used on tasks shared with you — they are returned as names only (no IDs or metadata). When searching, all matching personal labels are fetched across all pages and returned as a single result set (limit and cursor are ignored). When not searching, personal labels are returned with pagination.",
|
|
@@ -3539,10 +3533,10 @@ function ua({
|
|
|
3539
3533
|
`), l = e.length - i, u = l > 0 ? `${d}
|
|
3540
3534
|
…and ${l} more` : d, p = [];
|
|
3541
3535
|
e.length === 0 && (t.searchText ? (p.push("Try broader search terms"), p.push("Check spelling"), p.push("Remove searchText to see all labels")) : p.push("No personal labels created yet"));
|
|
3542
|
-
const
|
|
3536
|
+
const m = o.length > 0 ? `
|
|
3543
3537
|
Shared labels (${o.length}): ${o.join(", ")}` : `
|
|
3544
3538
|
No shared labels.`;
|
|
3545
|
-
return
|
|
3539
|
+
return q({
|
|
3546
3540
|
subject: n,
|
|
3547
3541
|
count: e.length,
|
|
3548
3542
|
limit: t.searchText ? void 0 : t.limit,
|
|
@@ -3550,16 +3544,16 @@ No shared labels.`;
|
|
|
3550
3544
|
filterHints: a,
|
|
3551
3545
|
previewLines: u,
|
|
3552
3546
|
zeroReasonHints: p
|
|
3553
|
-
}) +
|
|
3547
|
+
}) + m;
|
|
3554
3548
|
}
|
|
3555
|
-
const { FIND_PROJECTS:
|
|
3549
|
+
const { FIND_PROJECTS: hs, ADD_TASKS: fs, UPDATE_TASKS: bs } = g, pa = {
|
|
3556
3550
|
projectId: s.string().min(1).optional().describe(
|
|
3557
3551
|
'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.'
|
|
3558
3552
|
),
|
|
3559
3553
|
searchTerm: s.string().optional().describe(
|
|
3560
3554
|
"Search for a user by name or email (partial and case insensitive match). If omitted, all users are returned."
|
|
3561
3555
|
)
|
|
3562
|
-
},
|
|
3556
|
+
}, ma = {
|
|
3563
3557
|
collaborators: s.array(yo).describe("The found users."),
|
|
3564
3558
|
projectInfo: s.object({
|
|
3565
3559
|
id: s.string().describe("The project ID."),
|
|
@@ -3568,12 +3562,12 @@ const { FIND_PROJECTS: ms, ADD_TASKS: fs, UPDATE_TASKS: bs } = g, pa = {
|
|
|
3568
3562
|
}).optional().describe("Information about the project (only present when projectId was provided)."),
|
|
3569
3563
|
totalCount: s.number().describe("The total number of users found."),
|
|
3570
3564
|
totalAvailable: s.number().optional().describe("The total number of available users before the search filter was applied."),
|
|
3571
|
-
appliedFilters: s.record(s.string(), s.unknown())
|
|
3572
|
-
},
|
|
3565
|
+
appliedFilters: s.record(s.string(), s.unknown())
|
|
3566
|
+
}, ha = {
|
|
3573
3567
|
name: g.FIND_PROJECT_COLLABORATORS,
|
|
3574
3568
|
description: `Find Todoist users (collaborators, teammates) by name or email to look up their user ID. Use this whenever the user asks to find, look up, or identify a person — e.g. "find Carrie's user ID", "who is Ernesto", "look up a user". When projectId is omitted, searches across the collaborators of every shared project the authenticated user has access to, plus the authenticated user themselves — an empty result means the person is not a collaborator on any project you share with them, not necessarily that they do not exist in Todoist. When projectId is provided, searches only that project. Partial, case-insensitive match on name and email.`,
|
|
3575
3569
|
parameters: pa,
|
|
3576
|
-
outputSchema:
|
|
3570
|
+
outputSchema: ma,
|
|
3577
3571
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3578
3572
|
async execute(e, t) {
|
|
3579
3573
|
const { projectId: r, searchTerm: o } = e;
|
|
@@ -3659,7 +3653,7 @@ async function fa({
|
|
|
3659
3653
|
textContent: `No users found. You may have no shared projects, or collaborator data is not accessible.
|
|
3660
3654
|
|
|
3661
3655
|
**Next steps:**
|
|
3662
|
-
• Use ${
|
|
3656
|
+
• Use ${hs} to find shared projects
|
|
3663
3657
|
• Share a project to add collaborators
|
|
3664
3658
|
• Ensure you have permission to view collaborators`,
|
|
3665
3659
|
structuredContent: {
|
|
@@ -3716,13 +3710,13 @@ function ys({
|
|
|
3716
3710
|
r && c.push(`matching "${r}"`), c.push(`in ${n}`);
|
|
3717
3711
|
let d = [];
|
|
3718
3712
|
e.length > 0 && (d = e.slice(0, 10).map((p) => {
|
|
3719
|
-
const
|
|
3720
|
-
return `• ${
|
|
3713
|
+
const m = p.name || "Unknown Name", h = p.email || "No email";
|
|
3714
|
+
return `• ${m} (${h}) - ID: ${p.id}`;
|
|
3721
3715
|
}), e.length > 10 && d.push(`... and ${e.length - 10} more`));
|
|
3722
3716
|
const l = [];
|
|
3723
3717
|
e.length === 0 && r && (l.push(`No users match "${r}"`), l.push("Try a broader search term or check spelling"), o > 0 && l.push(`${o} users available without filter`));
|
|
3724
3718
|
const u = [];
|
|
3725
|
-
return e.length > 0 ? (u.push(`Use ${fs} with responsibleUser to assign new tasks`), u.push(`Use ${bs} with responsibleUser to reassign existing tasks`), u.push("Use user names, emails, or IDs for assignments")) : (u.push(`Use ${
|
|
3719
|
+
return e.length > 0 ? (u.push(`Use ${fs} with responsibleUser to assign new tasks`), u.push(`Use ${bs} with responsibleUser to reassign existing tasks`), u.push("Use user names, emails, or IDs for assignments")) : (u.push(`Use ${hs} to find other projects`), r && o > 0 && u.push("Try searching without filters to see all users")), q({
|
|
3726
3720
|
subject: i,
|
|
3727
3721
|
count: e.length,
|
|
3728
3722
|
filterHints: c,
|
|
@@ -3747,17 +3741,17 @@ const { ADD_PROJECTS: Ct } = g, ga = {
|
|
|
3747
3741
|
archivedStatus: s.enum(["active", "archived", "all"]).optional().describe(
|
|
3748
3742
|
"Which projects to return by archive status: 'active' (default, non-archived only), 'archived' (archived only), or 'all' (both active and archived). Each project includes an isArchived field. Archived projects can be deleted via the delete-object tool (type: 'project')."
|
|
3749
3743
|
)
|
|
3750
|
-
},
|
|
3744
|
+
}, ka = {
|
|
3751
3745
|
projects: s.array(Q).describe("The found projects."),
|
|
3752
|
-
nextCursor: s.string().optional()
|
|
3746
|
+
nextCursor: s.string().optional(),
|
|
3753
3747
|
totalCount: s.number().describe("The total number of projects in this page."),
|
|
3754
|
-
hasMore: s.boolean()
|
|
3755
|
-
appliedFilters: s.record(s.string(), s.unknown())
|
|
3756
|
-
},
|
|
3748
|
+
hasMore: s.boolean(),
|
|
3749
|
+
appliedFilters: s.record(s.string(), s.unknown())
|
|
3750
|
+
}, Ta = {
|
|
3757
3751
|
name: g.FIND_PROJECTS,
|
|
3758
3752
|
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.",
|
|
3759
3753
|
parameters: ya,
|
|
3760
|
-
outputSchema:
|
|
3754
|
+
outputSchema: ka,
|
|
3761
3755
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
3762
3756
|
async execute(e, t) {
|
|
3763
3757
|
const { searchText: r } = e, o = e.archivedStatus ?? "active";
|
|
@@ -3766,7 +3760,7 @@ const { ADD_PROJECTS: Ct } = g, ga = {
|
|
|
3766
3760
|
const c = Promise.resolve([]), [d, l] = await Promise.all([
|
|
3767
3761
|
o === "archived" ? c : r ? rs(t, r) : os(t),
|
|
3768
3762
|
o === "active" ? c : ao(t)
|
|
3769
|
-
]), u = r ? io(r) : null, p = u ? l.filter((
|
|
3763
|
+
]), u = r ? io(r) : null, p = u ? l.filter((m) => u.test(m.name)) : l;
|
|
3770
3764
|
n = [...d, ...p];
|
|
3771
3765
|
} else {
|
|
3772
3766
|
const c = o === "archived" ? await t.getArchivedProjects({
|
|
@@ -3798,7 +3792,7 @@ function wa({
|
|
|
3798
3792
|
const i = 10, d = e.slice(0, i).map(Fo).join(`
|
|
3799
3793
|
`), l = e.length - i, u = l > 0 ? `${d}
|
|
3800
3794
|
…and ${l} more` : d, p = [];
|
|
3801
|
-
return e.length === 0 && (t.searchText ? (p.push("Try broader search terms"), p.push("Check spelling"), p.push("Remove searchText to see all projects")) : t.archivedStatus === "archived" ? (p.push("No archived projects"), p.push("Use archivedStatus: 'all' to also see active projects")) : t.archivedStatus === "all" ? (p.push("No projects created yet"), p.push(`Use ${Ct} to create a project`)) : (p.push("No active projects"), p.push("Use archivedStatus: 'all' to include archived projects"), p.push(`Use ${Ct} to create a project`))),
|
|
3795
|
+
return e.length === 0 && (t.searchText ? (p.push("Try broader search terms"), p.push("Check spelling"), p.push("Remove searchText to see all projects")) : t.archivedStatus === "archived" ? (p.push("No archived projects"), p.push("Use archivedStatus: 'all' to also see active projects")) : t.archivedStatus === "all" ? (p.push("No projects created yet"), p.push(`Use ${Ct} to create a project`)) : (p.push("No active projects"), p.push("Use archivedStatus: 'all' to include archived projects"), p.push(`Use ${Ct} to create a project`))), q({
|
|
3802
3796
|
subject: n,
|
|
3803
3797
|
count: e.length,
|
|
3804
3798
|
limit: t.searchText || t.archivedStatus === "all" ? void 0 : t.limit,
|
|
@@ -3905,7 +3899,7 @@ const { ADD_SECTIONS: Ca } = g, $a = {
|
|
|
3905
3899
|
}, Da = {
|
|
3906
3900
|
sections: s.array(X).describe("The found sections."),
|
|
3907
3901
|
totalCount: s.number().describe("The total number of sections found."),
|
|
3908
|
-
appliedFilters: s.record(s.string(), s.unknown())
|
|
3902
|
+
appliedFilters: s.record(s.string(), s.unknown())
|
|
3909
3903
|
}, xa = {
|
|
3910
3904
|
name: g.FIND_SECTIONS,
|
|
3911
3905
|
description: "Search for sections by name or other criteria in a project. When searching, uses server-side search to avoid fetching all sections.",
|
|
@@ -3945,14 +3939,14 @@ function Aa({
|
|
|
3945
3939
|
r ? (o.push("Try broader search terms"), o.push("Check spelling"), o.push("Remove searchText to see all sections")) : (o.push("Project has no sections yet"), o.push(`Use ${Ca} to create sections`));
|
|
3946
3940
|
const n = r ? `Sections in project ${t} matching "${r}"` : `Sections in project ${t}`, a = e.length > 0 ? e.map((i) => ` ${i.name} • id=${i.id}`).join(`
|
|
3947
3941
|
`) : void 0;
|
|
3948
|
-
return
|
|
3942
|
+
return q({
|
|
3949
3943
|
subject: n,
|
|
3950
3944
|
count: e.length,
|
|
3951
3945
|
previewLines: a,
|
|
3952
3946
|
zeroReasonHints: o
|
|
3953
3947
|
});
|
|
3954
3948
|
}
|
|
3955
|
-
function
|
|
3949
|
+
function ks(e) {
|
|
3956
3950
|
return /* @__PURE__ */ new Date(`${e}T00:00:00`);
|
|
3957
3951
|
}
|
|
3958
3952
|
const Ea = {
|
|
@@ -3976,10 +3970,10 @@ const Ea = {
|
|
|
3976
3970
|
...ct
|
|
3977
3971
|
}, Oa = {
|
|
3978
3972
|
tasks: s.array(F).describe("The found tasks."),
|
|
3979
|
-
nextCursor: s.string().optional()
|
|
3973
|
+
nextCursor: s.string().optional(),
|
|
3980
3974
|
totalCount: s.number().describe("The total number of tasks in this page."),
|
|
3981
|
-
hasMore: s.boolean()
|
|
3982
|
-
appliedFilters: s.record(s.string(), s.unknown())
|
|
3975
|
+
hasMore: s.boolean(),
|
|
3976
|
+
appliedFilters: s.record(s.string(), s.unknown())
|
|
3983
3977
|
}, Pa = {
|
|
3984
3978
|
name: g.FIND_TASKS_BY_DATE,
|
|
3985
3979
|
description: "Get tasks by date range. startDate='today' includes overdue items. Default responsibleUserFiltering='unassignedOrMe' excludes others' tasks. Person-specific queries (summaries, plans, reports) require responsibleUser.",
|
|
@@ -3997,13 +3991,13 @@ const Ea = {
|
|
|
3997
3991
|
a = "overdue";
|
|
3998
3992
|
else if (e.startDate === "today")
|
|
3999
3993
|
if (e.daysCount > 1) {
|
|
4000
|
-
const p = /* @__PURE__ */ new Date(),
|
|
3994
|
+
const p = /* @__PURE__ */ new Date(), m = ie(p), h = Ue(p, e.daysCount), y = lt(h, { representation: "date" }), f = `(due after: ${m} | due: ${m}) & due before: ${y}`;
|
|
4001
3995
|
a = e.overdueOption === "exclude-overdue" ? f : `(${f} | overdue)`;
|
|
4002
3996
|
} else
|
|
4003
3997
|
a = e.overdueOption === "exclude-overdue" ? "today" : "(today | overdue)";
|
|
4004
3998
|
else if (e.startDate) {
|
|
4005
|
-
const p = e.startDate,
|
|
4006
|
-
a = `(due after: ${p} | due: ${p}) & due before: ${
|
|
3999
|
+
const p = e.startDate, m = Ue(ks(p), e.daysCount), h = lt(m, { representation: "date" });
|
|
4000
|
+
a = `(due after: ${p} | due: ${p}) & due before: ${h}`;
|
|
4007
4001
|
}
|
|
4008
4002
|
const i = dt(e.labels, e.labelsOperator);
|
|
4009
4003
|
i.length > 0 && (a = ce(a, `(${i})`));
|
|
@@ -4046,7 +4040,7 @@ function Ra({
|
|
|
4046
4040
|
`today${c}${t.daysCount > 1 ? ` + ${t.daysCount - 1} more days` : ""}`
|
|
4047
4041
|
);
|
|
4048
4042
|
} else if (t.startDate) {
|
|
4049
|
-
const c = t.daysCount > 1 ? ` to ${ie(Ue(
|
|
4043
|
+
const c = t.daysCount > 1 ? ` to ${ie(Ue(ks(t.startDate), t.daysCount))}` : "";
|
|
4050
4044
|
n.push(`${t.startDate}${c}`);
|
|
4051
4045
|
}
|
|
4052
4046
|
if (t.labels && t.labels.length > 0) {
|
|
@@ -4071,7 +4065,7 @@ function Ra({
|
|
|
4071
4065
|
i.push(`Great job! No tasks for today${c}`);
|
|
4072
4066
|
} else
|
|
4073
4067
|
i.push("Expand date range with larger 'daysCount'"), i.push("Check today's tasks with startDate='today'");
|
|
4074
|
-
return
|
|
4068
|
+
return q({
|
|
4075
4069
|
subject: a,
|
|
4076
4070
|
count: e.length,
|
|
4077
4071
|
limit: t.limit,
|
|
@@ -4168,10 +4162,10 @@ const La = new Ua(), { FIND_COMPLETED_TASKS: $t, ADD_TASKS: Dt } = g, Ma = {
|
|
|
4168
4162
|
...ct
|
|
4169
4163
|
}, Na = {
|
|
4170
4164
|
tasks: s.array(F).describe("The found tasks."),
|
|
4171
|
-
nextCursor: s.string().optional()
|
|
4165
|
+
nextCursor: s.string().optional(),
|
|
4172
4166
|
totalCount: s.number().describe("The total number of tasks in this page."),
|
|
4173
|
-
hasMore: s.boolean()
|
|
4174
|
-
appliedFilters: s.record(s.string(), s.unknown())
|
|
4167
|
+
hasMore: s.boolean(),
|
|
4168
|
+
appliedFilters: s.record(s.string(), s.unknown())
|
|
4175
4169
|
}, Fa = {
|
|
4176
4170
|
name: g.FIND_TASKS,
|
|
4177
4171
|
description: "Find tasks by text search, project/section/parent container, responsible user, labels, a raw Todoist filter string, or a saved filter by ID or name (filterIdOrName). At least one filter must be provided.",
|
|
@@ -4190,31 +4184,31 @@ const La = new Ua(), { FIND_COMPLETED_TASKS: $t, ADD_TASKS: Dt } = g, Ma = {
|
|
|
4190
4184
|
cursor: l,
|
|
4191
4185
|
labels: u,
|
|
4192
4186
|
labelsOperator: p,
|
|
4193
|
-
filter:
|
|
4194
|
-
filterIdOrName:
|
|
4187
|
+
filter: m,
|
|
4188
|
+
filterIdOrName: h
|
|
4195
4189
|
} = e, y = await t.getUser(), f = u && u.length > 0;
|
|
4196
|
-
if (!r && !o && !n && !a && !i && !f && !
|
|
4190
|
+
if (!r && !o && !n && !a && !i && !f && !m && !h)
|
|
4197
4191
|
throw new Error(
|
|
4198
4192
|
"At least one filter must be provided: searchText, projectId, sectionId, parentId, responsibleUser, labels, filter, or filterIdOrName"
|
|
4199
4193
|
);
|
|
4200
|
-
if (
|
|
4194
|
+
if (m && h)
|
|
4201
4195
|
throw new Error(
|
|
4202
4196
|
"The `filter` and `filterIdOrName` parameters cannot be used together. Provide only one."
|
|
4203
4197
|
);
|
|
4204
|
-
if ((
|
|
4198
|
+
if ((m || h) && (o || n || a))
|
|
4205
4199
|
throw new Error(
|
|
4206
4200
|
'The `filter`/`filterIdOrName` parameter cannot be combined with projectId, sectionId, or parentId. Use filter syntax instead (e.g. "##ProjectName").'
|
|
4207
4201
|
);
|
|
4208
|
-
let v =
|
|
4209
|
-
|
|
4210
|
-
const S = await Qe(t, i), A = S?.userId,
|
|
4202
|
+
let v = m;
|
|
4203
|
+
h && (v = (await La.resolveFilter(t, h)).filterQuery);
|
|
4204
|
+
const S = await Qe(t, i), A = S?.userId, T = S?.email;
|
|
4211
4205
|
if (o || n || a) {
|
|
4212
4206
|
const D = {
|
|
4213
4207
|
limit: d,
|
|
4214
4208
|
cursor: l ?? null
|
|
4215
4209
|
};
|
|
4216
4210
|
o && (D.projectId = await de({ projectId: o, user: y })), n && (D.sectionId = n), a && (D.parentId = a);
|
|
4217
|
-
const { results:
|
|
4211
|
+
const { results: me, nextCursor: G } = await t.getTasks(D), $e = me.map(P);
|
|
4218
4212
|
let H = r ? $e.filter(
|
|
4219
4213
|
(te) => te.content.toLowerCase().includes(r.toLowerCase()) || te.description?.toLowerCase().includes(r.toLowerCase())
|
|
4220
4214
|
) : $e;
|
|
@@ -4233,7 +4227,7 @@ const La = new Ua(), { FIND_COMPLETED_TASKS: $t, ADD_TASKS: Dt } = g, Ma = {
|
|
|
4233
4227
|
args: e,
|
|
4234
4228
|
nextCursor: G,
|
|
4235
4229
|
isContainerSearch: !0,
|
|
4236
|
-
assigneeEmail:
|
|
4230
|
+
assigneeEmail: T
|
|
4237
4231
|
}),
|
|
4238
4232
|
structuredContent: {
|
|
4239
4233
|
tasks: H,
|
|
@@ -4245,8 +4239,8 @@ const La = new Ua(), { FIND_COMPLETED_TASKS: $t, ADD_TASKS: Dt } = g, Ma = {
|
|
|
4245
4239
|
};
|
|
4246
4240
|
}
|
|
4247
4241
|
if (A && !r && !f && !v) {
|
|
4248
|
-
const { results: D, nextCursor:
|
|
4249
|
-
query: `assigned to: ${
|
|
4242
|
+
const { results: D, nextCursor: me } = await t.getTasksByFilter({
|
|
4243
|
+
query: `assigned to: ${T}`,
|
|
4250
4244
|
lang: "en",
|
|
4251
4245
|
limit: d,
|
|
4252
4246
|
cursor: l ?? null
|
|
@@ -4255,15 +4249,15 @@ const La = new Ua(), { FIND_COMPLETED_TASKS: $t, ADD_TASKS: Dt } = g, Ma = {
|
|
|
4255
4249
|
textContent: Ee({
|
|
4256
4250
|
tasks: G,
|
|
4257
4251
|
args: e,
|
|
4258
|
-
nextCursor:
|
|
4252
|
+
nextCursor: me,
|
|
4259
4253
|
isContainerSearch: !1,
|
|
4260
|
-
assigneeEmail:
|
|
4254
|
+
assigneeEmail: T
|
|
4261
4255
|
}),
|
|
4262
4256
|
structuredContent: {
|
|
4263
4257
|
tasks: G,
|
|
4264
|
-
nextCursor:
|
|
4258
|
+
nextCursor: me ?? void 0,
|
|
4265
4259
|
totalCount: G.length,
|
|
4266
|
-
hasMore: !!
|
|
4260
|
+
hasMore: !!me,
|
|
4267
4261
|
appliedFilters: e
|
|
4268
4262
|
}
|
|
4269
4263
|
};
|
|
@@ -4271,10 +4265,10 @@ const La = new Ua(), { FIND_COMPLETED_TASKS: $t, ADD_TASKS: Dt } = g, Ma = {
|
|
|
4271
4265
|
let I = v ? `(${v})` : "";
|
|
4272
4266
|
r && (I = ce(I, `search: ${r}`));
|
|
4273
4267
|
const x = dt(u, p);
|
|
4274
|
-
if (I = ce(I, x), !(
|
|
4268
|
+
if (I = ce(I, x), !(h && !i && !c)) {
|
|
4275
4269
|
const D = ss({
|
|
4276
4270
|
resolvedAssigneeId: A,
|
|
4277
|
-
assigneeEmail:
|
|
4271
|
+
assigneeEmail: T,
|
|
4278
4272
|
responsibleUserFiltering: c
|
|
4279
4273
|
});
|
|
4280
4274
|
I = ce(I, D);
|
|
@@ -4291,7 +4285,7 @@ const La = new Ua(), { FIND_COMPLETED_TASKS: $t, ADD_TASKS: Dt } = g, Ma = {
|
|
|
4291
4285
|
args: e,
|
|
4292
4286
|
nextCursor: j,
|
|
4293
4287
|
isContainerSearch: !1,
|
|
4294
|
-
assigneeEmail:
|
|
4288
|
+
assigneeEmail: T
|
|
4295
4289
|
}),
|
|
4296
4290
|
structuredContent: {
|
|
4297
4291
|
tasks: b,
|
|
@@ -4357,7 +4351,7 @@ function Ee({
|
|
|
4357
4351
|
t.searchText && (c.push("Try broader search terms"), c.push("Verify spelling and try partial words"), t.responsibleUser || c.push(`Check completed tasks with ${$t}`));
|
|
4358
4352
|
}
|
|
4359
4353
|
}
|
|
4360
|
-
return
|
|
4354
|
+
return q({
|
|
4361
4355
|
subject: a,
|
|
4362
4356
|
count: e.length,
|
|
4363
4357
|
limit: t.limit,
|
|
@@ -4371,7 +4365,7 @@ const Wa = {
|
|
|
4371
4365
|
projectId: s.string().min(1).optional().describe(
|
|
4372
4366
|
"Optional project ID. If provided, shows detailed overview of that project. If omitted, shows overview of all projects."
|
|
4373
4367
|
)
|
|
4374
|
-
},
|
|
4368
|
+
}, Ts = s.lazy(
|
|
4375
4369
|
() => s.object({
|
|
4376
4370
|
id: s.string().describe("The project ID."),
|
|
4377
4371
|
name: s.string().describe("The project name."),
|
|
@@ -4384,7 +4378,7 @@ const Wa = {
|
|
|
4384
4378
|
name: s.string()
|
|
4385
4379
|
})
|
|
4386
4380
|
),
|
|
4387
|
-
children: s.array(
|
|
4381
|
+
children: s.array(Ts).describe("Nested child projects.")
|
|
4388
4382
|
})
|
|
4389
4383
|
), Ba = {
|
|
4390
4384
|
type: s.enum(["account_overview", "project_overview"]).describe("The type of overview returned."),
|
|
@@ -4405,7 +4399,7 @@ const Wa = {
|
|
|
4405
4399
|
name: s.string().describe("The inbox project name."),
|
|
4406
4400
|
sections: s.array(X).describe("Sections in the inbox project.")
|
|
4407
4401
|
}).nullable().optional().describe("Inbox information (account overview only)."),
|
|
4408
|
-
projects: s.array(s.lazy(() =>
|
|
4402
|
+
projects: s.array(s.lazy(() => Ts)).optional().describe(
|
|
4409
4403
|
"List of projects with hierarchy, folders, and ordering (account overview only)."
|
|
4410
4404
|
),
|
|
4411
4405
|
project: s.object({
|
|
@@ -4420,7 +4414,7 @@ const Wa = {
|
|
|
4420
4414
|
tasksWithoutSection: s.number()
|
|
4421
4415
|
}).optional().describe("Statistics object (project overview only).")
|
|
4422
4416
|
};
|
|
4423
|
-
function
|
|
4417
|
+
function Ya(e) {
|
|
4424
4418
|
const t = {};
|
|
4425
4419
|
for (const n of e)
|
|
4426
4420
|
t[n.id] = {
|
|
@@ -4481,11 +4475,11 @@ function xt(e) {
|
|
|
4481
4475
|
}
|
|
4482
4476
|
return r;
|
|
4483
4477
|
}
|
|
4484
|
-
function
|
|
4478
|
+
function qe(e, t = "") {
|
|
4485
4479
|
const r = [];
|
|
4486
4480
|
for (const o of e) {
|
|
4487
4481
|
const n = `id=${o.id}`, a = o.dueDate ? `; due=${o.dueDate}` : "", i = `; content=${o.content}`;
|
|
4488
|
-
r.push(`${t}- ${n}${a}${i}`), o.children.length > 0 && r.push(...
|
|
4482
|
+
r.push(`${t}- ${n}${a}${i}`), o.children.length > 0 && r.push(...qe(o.children, `${t} `));
|
|
4489
4483
|
}
|
|
4490
4484
|
return r;
|
|
4491
4485
|
}
|
|
@@ -4494,7 +4488,7 @@ function vs(e, t) {
|
|
|
4494
4488
|
id: e.id,
|
|
4495
4489
|
name: e.name,
|
|
4496
4490
|
parentId: B(e) ? e.parentId ?? void 0 : void 0,
|
|
4497
|
-
folderId:
|
|
4491
|
+
folderId: Te(e) ? e.folderId ?? void 0 : void 0,
|
|
4498
4492
|
childOrder: e.childOrder,
|
|
4499
4493
|
sections: (t[e.id] || []).map(z),
|
|
4500
4494
|
children: e.children.map(
|
|
@@ -4502,7 +4496,7 @@ function vs(e, t) {
|
|
|
4502
4496
|
)
|
|
4503
4497
|
};
|
|
4504
4498
|
}
|
|
4505
|
-
async function
|
|
4499
|
+
async function qa(e, t) {
|
|
4506
4500
|
let r = [], o;
|
|
4507
4501
|
do {
|
|
4508
4502
|
const { results: n, nextCursor: a } = await e.getTasks({
|
|
@@ -4519,7 +4513,7 @@ async function Ga(e, t) {
|
|
|
4519
4513
|
return r;
|
|
4520
4514
|
}
|
|
4521
4515
|
async function Ka(e) {
|
|
4522
|
-
const { results: t } = await e.getProjects({}), r = t.find((p) => B(p) && p.inboxProject === !0), o = t.filter((p) => !B(p) || p.inboxProject !== !0), n =
|
|
4516
|
+
const { results: t } = await e.getProjects({}), r = t.find((p) => B(p) && p.inboxProject === !0), o = t.filter((p) => !B(p) || p.inboxProject !== !0), n = Ya(o), a = t.map((p) => p.id), i = await za(e, a), c = ["# Personal Projects", ""];
|
|
4523
4517
|
if (r) {
|
|
4524
4518
|
c.push(`- Inbox Project: ${r.name} (id=${r.id})`);
|
|
4525
4519
|
for (const p of i[r.id] || [])
|
|
@@ -4549,7 +4543,7 @@ async function Ka(e) {
|
|
|
4549
4543
|
),
|
|
4550
4544
|
totalProjects: t.length,
|
|
4551
4545
|
totalSections: a.reduce(
|
|
4552
|
-
(p,
|
|
4546
|
+
(p, m) => p + (i[m]?.length || 0),
|
|
4553
4547
|
0
|
|
4554
4548
|
),
|
|
4555
4549
|
hasNestedProjects: d
|
|
@@ -4560,7 +4554,7 @@ async function Va(e, t) {
|
|
|
4560
4554
|
const [r, o, n] = await Promise.all([
|
|
4561
4555
|
e.getProject(t),
|
|
4562
4556
|
Ga(e, t),
|
|
4563
|
-
|
|
4557
|
+
qa(e, t)
|
|
4564
4558
|
]), a = {};
|
|
4565
4559
|
for (const u of o)
|
|
4566
4560
|
a[u.id] = [];
|
|
@@ -4571,15 +4565,15 @@ async function Va(e, t) {
|
|
|
4571
4565
|
if (i.length > 0) {
|
|
4572
4566
|
c.push("");
|
|
4573
4567
|
const u = xt(i);
|
|
4574
|
-
c.push(...
|
|
4568
|
+
c.push(...qe(u));
|
|
4575
4569
|
}
|
|
4576
4570
|
for (const u of o) {
|
|
4577
4571
|
c.push(""), c.push(`## ${u.name}`);
|
|
4578
4572
|
const p = a[u.id];
|
|
4579
4573
|
if (!p?.length)
|
|
4580
4574
|
continue;
|
|
4581
|
-
const
|
|
4582
|
-
c.push(...
|
|
4575
|
+
const m = xt(p);
|
|
4576
|
+
c.push(...qe(m));
|
|
4583
4577
|
}
|
|
4584
4578
|
const d = c.join(`
|
|
4585
4579
|
`), l = {
|
|
@@ -4939,7 +4933,7 @@ const ui = {
|
|
|
4939
4933
|
"The workspace ID or name. Supports exact ID, exact name match (case-insensitive), or unique partial name match."
|
|
4940
4934
|
),
|
|
4941
4935
|
projectIds: s.array(s.string().min(1)).min(1).optional().describe("Optional list of project IDs to scope insights to specific projects.")
|
|
4942
|
-
},
|
|
4936
|
+
}, mi = s.object({
|
|
4943
4937
|
projectId: s.string().describe("The project ID."),
|
|
4944
4938
|
health: s.object({
|
|
4945
4939
|
status: s.enum(Ke).describe("The health status of the project."),
|
|
@@ -4951,16 +4945,16 @@ const ui = {
|
|
|
4951
4945
|
activeCount: s.number().describe("Number of active tasks."),
|
|
4952
4946
|
progressPercent: s.number().describe("Completion percentage (0-100).")
|
|
4953
4947
|
}).nullable().describe("Progress data for this project, if available.")
|
|
4954
|
-
}),
|
|
4948
|
+
}), hi = {
|
|
4955
4949
|
workspaceId: s.string().describe("The resolved workspace ID."),
|
|
4956
4950
|
workspaceName: s.string().describe("The resolved workspace name."),
|
|
4957
4951
|
folderId: s.string().nullable().describe("The folder ID, if applicable."),
|
|
4958
|
-
projectInsights: s.array(
|
|
4952
|
+
projectInsights: s.array(mi).describe("Health and progress insights for each project in the workspace.")
|
|
4959
4953
|
}, fi = {
|
|
4960
4954
|
name: g.GET_WORKSPACE_INSIGHTS,
|
|
4961
4955
|
description: "Get aggregated health and progress insights across all projects in a workspace. Accepts workspace name or ID, with optional project ID filtering. Useful for a cross-project health overview.",
|
|
4962
4956
|
parameters: pi,
|
|
4963
|
-
outputSchema:
|
|
4957
|
+
outputSchema: hi,
|
|
4964
4958
|
annotations: {
|
|
4965
4959
|
readOnlyHint: !0,
|
|
4966
4960
|
destructiveHint: !1,
|
|
@@ -5036,16 +5030,16 @@ const yi = {
|
|
|
5036
5030
|
"Raw CSV template content, as produced by export-project-template. Provide either this or `templateId`, not both."
|
|
5037
5031
|
),
|
|
5038
5032
|
locale: s.string().optional().describe('Locale for the imported content when using `templateId`. Defaults to "en".')
|
|
5039
|
-
},
|
|
5033
|
+
}, ki = {
|
|
5040
5034
|
sections: s.array(X).describe("Sections created by the import."),
|
|
5041
5035
|
tasks: s.array(F).describe("Tasks created by the import."),
|
|
5042
5036
|
comments: s.array(ye).describe("Comments created by the import."),
|
|
5043
5037
|
totalCount: s.number().describe("The total number of objects created by the import.")
|
|
5044
|
-
},
|
|
5038
|
+
}, Ti = {
|
|
5045
5039
|
name: g.IMPORT_PROJECT_TEMPLATE,
|
|
5046
5040
|
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.",
|
|
5047
5041
|
parameters: yi,
|
|
5048
|
-
outputSchema:
|
|
5042
|
+
outputSchema: ki,
|
|
5049
5043
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
5050
5044
|
async execute({ projectId: e, templateId: t, csvFileContent: r, locale: o }, n) {
|
|
5051
5045
|
if (!!t == !!r)
|
|
@@ -5181,37 +5175,37 @@ const Ci = {
|
|
|
5181
5175
|
if ((r === "assign" || r === "reassign") && !n)
|
|
5182
5176
|
throw new Error(`${r} operation requires responsibleUser parameter`);
|
|
5183
5177
|
const c = await Promise.allSettled(
|
|
5184
|
-
o.map(async (
|
|
5178
|
+
o.map(async (T) => {
|
|
5185
5179
|
try {
|
|
5186
|
-
return await t.getTask(
|
|
5180
|
+
return await t.getTask(T);
|
|
5187
5181
|
} catch {
|
|
5188
|
-
throw new Error(`Task ${
|
|
5182
|
+
throw new Error(`Task ${T} not found or not accessible`);
|
|
5189
5183
|
}
|
|
5190
5184
|
})
|
|
5191
5185
|
), d = [], l = [];
|
|
5192
|
-
for (let
|
|
5193
|
-
const I = c[
|
|
5186
|
+
for (let T = 0; T < c.length; T++) {
|
|
5187
|
+
const I = c[T];
|
|
5194
5188
|
I && I.status === "fulfilled" ? d.push(I.value) : I && I.status === "rejected" ? l.push({
|
|
5195
|
-
taskId: o[
|
|
5189
|
+
taskId: o[T] || "invalid-task-id",
|
|
5196
5190
|
success: !1,
|
|
5197
5191
|
error: I.reason?.message || "Task not accessible"
|
|
5198
5192
|
}) : l.push({
|
|
5199
|
-
taskId: o[
|
|
5193
|
+
taskId: o[T] || "invalid-task-id",
|
|
5200
5194
|
success: !1,
|
|
5201
5195
|
error: "Task not accessible"
|
|
5202
5196
|
});
|
|
5203
5197
|
}
|
|
5204
5198
|
if (d.length === 0) {
|
|
5205
|
-
const
|
|
5206
|
-
throw new Error(`All ${l.length} task(s) failed: ${
|
|
5199
|
+
const T = l.map((I) => `"${I.taskId}": ${I.error}`).join("; ");
|
|
5200
|
+
throw new Error(`All ${l.length} task(s) failed: ${T}`);
|
|
5207
5201
|
}
|
|
5208
5202
|
let u;
|
|
5209
5203
|
r === "reassign" && a && (u = (await W.resolveUser(t, a))?.userId || a);
|
|
5210
5204
|
const p = [];
|
|
5211
|
-
for (const
|
|
5212
|
-
r === "reassign" && u &&
|
|
5213
|
-
taskId:
|
|
5214
|
-
projectId:
|
|
5205
|
+
for (const T of d)
|
|
5206
|
+
r === "reassign" && u && T.responsibleUid !== u || p.push({
|
|
5207
|
+
taskId: T.id,
|
|
5208
|
+
projectId: T.projectId,
|
|
5215
5209
|
responsibleUid: n || ""
|
|
5216
5210
|
// Will be validated appropriately
|
|
5217
5211
|
});
|
|
@@ -5239,7 +5233,7 @@ const Ci = {
|
|
|
5239
5233
|
}
|
|
5240
5234
|
};
|
|
5241
5235
|
}
|
|
5242
|
-
const
|
|
5236
|
+
const T = d.map(async (b) => {
|
|
5243
5237
|
try {
|
|
5244
5238
|
return await t.updateTask(b.id, { assigneeId: null }), {
|
|
5245
5239
|
taskId: b.id,
|
|
@@ -5255,7 +5249,7 @@ const Ci = {
|
|
|
5255
5249
|
originalAssigneeId: b.responsibleUid ?? void 0
|
|
5256
5250
|
};
|
|
5257
5251
|
}
|
|
5258
|
-
}), I = await Promise.all(
|
|
5252
|
+
}), I = await Promise.all(T), x = [...I, ...l];
|
|
5259
5253
|
if (x.length > 0 && x.every((b) => !b.success)) {
|
|
5260
5254
|
const b = x.map((j) => `"${j.taskId}": ${j.error}`).join("; ");
|
|
5261
5255
|
throw new Error(`All ${x.length} unassign operation(s) failed: ${b}`);
|
|
@@ -5276,20 +5270,20 @@ const Ci = {
|
|
|
5276
5270
|
}
|
|
5277
5271
|
};
|
|
5278
5272
|
}
|
|
5279
|
-
const
|
|
5273
|
+
const m = await it.validateBulkAssignment(
|
|
5280
5274
|
t,
|
|
5281
5275
|
p
|
|
5282
|
-
),
|
|
5283
|
-
for (let
|
|
5284
|
-
const I = p[
|
|
5285
|
-
I && x?.isValid ?
|
|
5276
|
+
), h = [], y = [];
|
|
5277
|
+
for (let T = 0; T < p.length; T++) {
|
|
5278
|
+
const I = p[T], x = m[T];
|
|
5279
|
+
I && x?.isValid ? h.push({ assignment: I, validation: x }) : I?.taskId && y.push({
|
|
5286
5280
|
taskId: I.taskId,
|
|
5287
5281
|
success: !1,
|
|
5288
5282
|
error: x?.error?.message || "Validation failed"
|
|
5289
5283
|
});
|
|
5290
5284
|
}
|
|
5291
|
-
async function f(
|
|
5292
|
-
const x =
|
|
5285
|
+
async function f(T, I) {
|
|
5286
|
+
const x = T.filter(
|
|
5293
5287
|
(b) => b.assignment != null && b.validation != null
|
|
5294
5288
|
);
|
|
5295
5289
|
if (!I)
|
|
@@ -5306,7 +5300,7 @@ const Ci = {
|
|
|
5306
5300
|
newAssigneeId: j.resolvedUser.userId
|
|
5307
5301
|
};
|
|
5308
5302
|
});
|
|
5309
|
-
const
|
|
5303
|
+
const k = x.map(
|
|
5310
5304
|
async ({ assignment: b, validation: j }) => {
|
|
5311
5305
|
const $ = d.find((D) => D.id === b.taskId);
|
|
5312
5306
|
if (!b.taskId || !j.resolvedUser?.userId)
|
|
@@ -5335,12 +5329,12 @@ const Ci = {
|
|
|
5335
5329
|
}
|
|
5336
5330
|
}
|
|
5337
5331
|
);
|
|
5338
|
-
return Promise.all(
|
|
5332
|
+
return Promise.all(k);
|
|
5339
5333
|
}
|
|
5340
|
-
const v = await f(
|
|
5341
|
-
if (S.length > 0 && S.every((
|
|
5342
|
-
const
|
|
5343
|
-
throw new Error(`All ${S.length} ${r} operation(s) failed: ${
|
|
5334
|
+
const v = await f(h, !i), S = [...v, ...y, ...l];
|
|
5335
|
+
if (S.length > 0 && S.every((T) => !T.success)) {
|
|
5336
|
+
const T = S.map((I) => `"${I.taskId}": ${I.error}`).join("; ");
|
|
5337
|
+
throw new Error(`All ${S.length} ${r} operation(s) failed: ${T}`);
|
|
5344
5338
|
}
|
|
5345
5339
|
return {
|
|
5346
5340
|
textContent: Oe({
|
|
@@ -5352,8 +5346,8 @@ const Ci = {
|
|
|
5352
5346
|
operation: r,
|
|
5353
5347
|
results: S,
|
|
5354
5348
|
totalRequested: o.length,
|
|
5355
|
-
successful: v.filter((
|
|
5356
|
-
failed: S.filter((
|
|
5349
|
+
successful: v.filter((T) => T.success).length,
|
|
5350
|
+
failed: S.filter((T) => !T.success).length,
|
|
5357
5351
|
dryRun: i
|
|
5358
5352
|
}
|
|
5359
5353
|
};
|
|
@@ -5515,11 +5509,11 @@ const Pi = {
|
|
|
5515
5509
|
}
|
|
5516
5510
|
const a = [], i = o.filter((p) => p.parentId !== void 0);
|
|
5517
5511
|
for (const p of i) {
|
|
5518
|
-
const
|
|
5512
|
+
const m = p.parentId;
|
|
5519
5513
|
a.push(
|
|
5520
5514
|
V("project_move", {
|
|
5521
5515
|
id: p.id,
|
|
5522
|
-
parentId:
|
|
5516
|
+
parentId: m === "root" ? null : m
|
|
5523
5517
|
})
|
|
5524
5518
|
);
|
|
5525
5519
|
}
|
|
@@ -5544,8 +5538,8 @@ const Pi = {
|
|
|
5544
5538
|
try {
|
|
5545
5539
|
await t.sync({ commands: a });
|
|
5546
5540
|
} catch (p) {
|
|
5547
|
-
const
|
|
5548
|
-
throw new Error(`Reorder failed: ${
|
|
5541
|
+
const m = p instanceof Error ? p.message : String(p);
|
|
5542
|
+
throw new Error(`Reorder failed: ${m}`);
|
|
5549
5543
|
}
|
|
5550
5544
|
const d = r === "project" ? "projects" : "sections", l = o.map((p) => p.id), u = [];
|
|
5551
5545
|
return i.length > 0 && u.push(`moved ${i.length}`), c.length > 0 && u.push(`reordered ${c.length}`), {
|
|
@@ -5566,7 +5560,7 @@ const Pi = {
|
|
|
5566
5560
|
)
|
|
5567
5561
|
}), Bi = {
|
|
5568
5562
|
tasks: s.array(Wi).min(1).describe("The tasks to reschedule with their new dates.")
|
|
5569
|
-
},
|
|
5563
|
+
}, Yi = {
|
|
5570
5564
|
tasks: s.array(F).describe("The rescheduled tasks."),
|
|
5571
5565
|
totalCount: s.number().describe("The total number of tasks rescheduled."),
|
|
5572
5566
|
rescheduledTaskIds: s.array(s.string()).describe("The IDs of the rescheduled tasks.")
|
|
@@ -5574,7 +5568,7 @@ const Pi = {
|
|
|
5574
5568
|
name: g.RESCHEDULE_TASKS,
|
|
5575
5569
|
description: "Reschedule tasks to new dates while preserving recurring schedules. Unlike update-tasks (which replaces the entire due string and can wipe recurrence), this tool changes only the date, keeping recurrence patterns intact. Use this when moving recurring tasks to a different date without altering their repeat pattern.",
|
|
5576
5570
|
parameters: Bi,
|
|
5577
|
-
outputSchema:
|
|
5571
|
+
outputSchema: Yi,
|
|
5578
5572
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5579
5573
|
async execute(e, t) {
|
|
5580
5574
|
const { tasks: r } = e, n = (await Promise.all(
|
|
@@ -5587,7 +5581,7 @@ const Pi = {
|
|
|
5587
5581
|
throw new Error(
|
|
5588
5582
|
`Task "${l.content}" (${l.id}) has no due date. Rescheduling requires an existing due date.`
|
|
5589
5583
|
);
|
|
5590
|
-
const u =
|
|
5584
|
+
const u = qi(d.date, l.due);
|
|
5591
5585
|
return V("item_update", {
|
|
5592
5586
|
id: d.id,
|
|
5593
5587
|
due: {
|
|
@@ -5618,7 +5612,7 @@ const Pi = {
|
|
|
5618
5612
|
};
|
|
5619
5613
|
}
|
|
5620
5614
|
};
|
|
5621
|
-
function
|
|
5615
|
+
function qi(e, t) {
|
|
5622
5616
|
if (/^\d{4}-\d{2}-\d{2}$/.test(e) && t.datetime) {
|
|
5623
5617
|
const o = t.datetime.substring(10);
|
|
5624
5618
|
return e + o;
|
|
@@ -5797,10 +5791,10 @@ const nc = s.object({
|
|
|
5797
5791
|
outputSchema: ic,
|
|
5798
5792
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5799
5793
|
async execute(e, t) {
|
|
5800
|
-
const { filters: r } = e, o = [], a = r.map((
|
|
5801
|
-
const
|
|
5802
|
-
return
|
|
5803
|
-
}).filter((
|
|
5794
|
+
const { filters: r } = e, o = [], a = r.map((m) => {
|
|
5795
|
+
const h = lc(m);
|
|
5796
|
+
return h !== null ? { kind: "skipped", reason: h } : (o.push(m), { kind: "updated", filter: m });
|
|
5797
|
+
}).filter((m) => m.kind === "skipped").length;
|
|
5804
5798
|
if (o.length === 0)
|
|
5805
5799
|
return {
|
|
5806
5800
|
textContent: `Updated 0 filters (${a} skipped - no changes)`,
|
|
@@ -5811,29 +5805,29 @@ const nc = s.object({
|
|
|
5811
5805
|
appliedOperations: { updateCount: 0, skippedCount: a }
|
|
5812
5806
|
}
|
|
5813
5807
|
};
|
|
5814
|
-
const i = o.map((
|
|
5815
|
-
const { id:
|
|
5808
|
+
const i = o.map((m) => {
|
|
5809
|
+
const { id: h, color: y, ...f } = m;
|
|
5816
5810
|
return V("filter_update", {
|
|
5817
|
-
id:
|
|
5811
|
+
id: h,
|
|
5818
5812
|
...f,
|
|
5819
5813
|
...y !== void 0 ? { color: y } : {}
|
|
5820
5814
|
});
|
|
5821
5815
|
});
|
|
5822
5816
|
await t.sync({ commands: i });
|
|
5823
|
-
const d = ((await t.sync({ resourceTypes: ["filters"], syncToken: "*" })).filters ?? []).filter((
|
|
5824
|
-
id:
|
|
5825
|
-
name:
|
|
5826
|
-
query:
|
|
5827
|
-
color: ue.parse(
|
|
5828
|
-
isFavorite:
|
|
5829
|
-
itemOrder:
|
|
5817
|
+
const d = ((await t.sync({ resourceTypes: ["filters"], syncToken: "*" })).filters ?? []).filter((m) => !m.isDeleted), l = new Set(o.map((m) => m.id)), u = d.filter((m) => l.has(m.id)).map((m) => ({
|
|
5818
|
+
id: m.id,
|
|
5819
|
+
name: m.name,
|
|
5820
|
+
query: m.query,
|
|
5821
|
+
color: ue.parse(m.color),
|
|
5822
|
+
isFavorite: m.isFavorite,
|
|
5823
|
+
itemOrder: m.itemOrder
|
|
5830
5824
|
}));
|
|
5831
5825
|
return {
|
|
5832
5826
|
textContent: dc({ filters: u, skippedCount: a }),
|
|
5833
5827
|
structuredContent: {
|
|
5834
5828
|
filters: u,
|
|
5835
5829
|
totalCount: u.length,
|
|
5836
|
-
updatedFilterIds: u.map((
|
|
5830
|
+
updatedFilterIds: u.map((m) => m.id),
|
|
5837
5831
|
appliedOperations: {
|
|
5838
5832
|
updateCount: u.length,
|
|
5839
5833
|
skippedCount: a
|
|
@@ -5872,11 +5866,11 @@ const uc = s.object({
|
|
|
5872
5866
|
),
|
|
5873
5867
|
name: s.string().min(1).describe("The current name of the shared label."),
|
|
5874
5868
|
newName: s.string().min(1).describe("The new name for the shared label.")
|
|
5875
|
-
}),
|
|
5869
|
+
}), mc = s.discriminatedUnion("labelType", [
|
|
5876
5870
|
uc,
|
|
5877
5871
|
pc
|
|
5878
|
-
]),
|
|
5879
|
-
labels: s.array(
|
|
5872
|
+
]), hc = {
|
|
5873
|
+
labels: s.array(mc).min(1).describe(
|
|
5880
5874
|
'The labels to update. Use labelType="personal" with an ID to update a personal label, or labelType="shared" with name+newName to rename a shared label.'
|
|
5881
5875
|
)
|
|
5882
5876
|
}, fc = s.object({
|
|
@@ -5894,17 +5888,17 @@ const uc = s.object({
|
|
|
5894
5888
|
}, gc = {
|
|
5895
5889
|
name: g.UPDATE_LABELS,
|
|
5896
5890
|
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.",
|
|
5897
|
-
parameters:
|
|
5891
|
+
parameters: hc,
|
|
5898
5892
|
outputSchema: bc,
|
|
5899
5893
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
5900
5894
|
async execute(e, t) {
|
|
5901
5895
|
const { labels: r } = e, o = await Promise.all(
|
|
5902
5896
|
r.map(async (u) => {
|
|
5903
5897
|
if (u.labelType === "personal") {
|
|
5904
|
-
const
|
|
5905
|
-
if (
|
|
5906
|
-
const { id:
|
|
5907
|
-
return { kind: "updated", label: await t.updateLabel(
|
|
5898
|
+
const m = kc(u);
|
|
5899
|
+
if (m !== null) return { kind: "skipped", reason: m };
|
|
5900
|
+
const { id: h, labelType: y, ...f } = u;
|
|
5901
|
+
return { kind: "updated", label: await t.updateLabel(h, f) };
|
|
5908
5902
|
}
|
|
5909
5903
|
return await t.renameSharedLabel({
|
|
5910
5904
|
name: u.name,
|
|
@@ -5960,14 +5954,14 @@ function yc({
|
|
|
5960
5954
|
return c.join(`
|
|
5961
5955
|
`);
|
|
5962
5956
|
}
|
|
5963
|
-
function
|
|
5957
|
+
function kc({
|
|
5964
5958
|
id: e,
|
|
5965
5959
|
labelType: t,
|
|
5966
5960
|
...r
|
|
5967
5961
|
}) {
|
|
5968
5962
|
return Object.values(r).every((n) => n === void 0) ? "no-fields" : null;
|
|
5969
5963
|
}
|
|
5970
|
-
const
|
|
5964
|
+
const Tc = s.object({
|
|
5971
5965
|
id: s.string().min(1).describe("The ID of the project to update."),
|
|
5972
5966
|
name: s.string().min(1).optional().describe("The new name of the project."),
|
|
5973
5967
|
isFavorite: s.boolean().optional().describe("Whether the project is a favorite."),
|
|
@@ -5983,7 +5977,7 @@ const kc = s.object({
|
|
|
5983
5977
|
).optional(),
|
|
5984
5978
|
color: le
|
|
5985
5979
|
}), wc = {
|
|
5986
|
-
projects: s.array(
|
|
5980
|
+
projects: s.array(Tc).min(1).describe("The projects to update.")
|
|
5987
5981
|
}, vc = {
|
|
5988
5982
|
projects: s.array(Q).describe("The updated projects."),
|
|
5989
5983
|
totalCount: s.number().describe("The total number of projects updated."),
|
|
@@ -6007,8 +6001,8 @@ const kc = s.object({
|
|
|
6007
6001
|
r.map(async (l) => {
|
|
6008
6002
|
const u = Sc(l);
|
|
6009
6003
|
if (u !== null) return { kind: "skipped", reason: u };
|
|
6010
|
-
const { id: p, ...
|
|
6011
|
-
return { kind: "updated", project: await O(() => t.updateProject(p,
|
|
6004
|
+
const { id: p, ...m } = l;
|
|
6005
|
+
return { kind: "updated", project: await O(() => t.updateProject(p, m)) };
|
|
6012
6006
|
})
|
|
6013
6007
|
), n = [], a = [];
|
|
6014
6008
|
let i = 0, c = 0;
|
|
@@ -6016,7 +6010,7 @@ const kc = s.object({
|
|
|
6016
6010
|
if (u.status === "rejected") {
|
|
6017
6011
|
a.push({
|
|
6018
6012
|
item: r[l]?.id ?? `Project ${l + 1}`,
|
|
6019
|
-
error:
|
|
6013
|
+
error: Y(u.reason)
|
|
6020
6014
|
});
|
|
6021
6015
|
continue;
|
|
6022
6016
|
}
|
|
@@ -6266,7 +6260,7 @@ const Wc = s.object({
|
|
|
6266
6260
|
isUncompletable: s.boolean().optional().describe(
|
|
6267
6261
|
"Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
|
|
6268
6262
|
)
|
|
6269
|
-
}), Bc = (e) => !!(e.projectId || e.sectionId || e.parentId), Ss = (e) => Object.keys(e).length > 0,
|
|
6263
|
+
}), Bc = (e) => !!(e.projectId || e.sectionId || e.parentId), Ss = (e) => Object.keys(e).length > 0, Yc = ["remove", "no date"], zc = ["remove", "no date", "no deadline"], qc = "no date", Ge = zt.TASKS_PER_OPERATION, Ot = {
|
|
6270
6264
|
tasks: s.array(Wc).min(1).max(Ge).describe(`The tasks to update (max ${Ge}).`)
|
|
6271
6265
|
}, Gc = {
|
|
6272
6266
|
tasks: s.array(F).describe("The updated tasks."),
|
|
@@ -6290,42 +6284,42 @@ const Wc = s.object({
|
|
|
6290
6284
|
outputSchema: Gc,
|
|
6291
6285
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
6292
6286
|
async execute(e, t) {
|
|
6293
|
-
const { tasks: r } = s.object(Ot).parse(e), o = r.map(() => ({ kind: "skipped" })), n = (
|
|
6294
|
-
o[
|
|
6295
|
-
}, a = (
|
|
6296
|
-
n(
|
|
6297
|
-
}, i = r.map((
|
|
6298
|
-
i.map(({ task:
|
|
6287
|
+
const { tasks: r } = s.object(Ot).parse(e), o = r.map(() => ({ kind: "skipped" })), n = (k, b) => {
|
|
6288
|
+
o[k] = { kind: "failed", error: b };
|
|
6289
|
+
}, a = (k, b) => {
|
|
6290
|
+
n(k, Y(b));
|
|
6291
|
+
}, i = r.map((k, b) => ({ task: k, index: b })).filter(({ task: k }) => rd(k)), c = await Jc(
|
|
6292
|
+
i.map(({ task: k }) => k),
|
|
6299
6293
|
t
|
|
6300
6294
|
), d = await Promise.allSettled(
|
|
6301
|
-
i.map(({ task:
|
|
6295
|
+
i.map(({ task: k, index: b }) => ed({ task: k, index: b, client: t, inbox: c }))
|
|
6302
6296
|
), l = [];
|
|
6303
|
-
for (const [
|
|
6304
|
-
const j = i[
|
|
6297
|
+
for (const [k, b] of d.entries()) {
|
|
6298
|
+
const j = i[k]?.index ?? k;
|
|
6305
6299
|
b.status === "fulfilled" ? l.push(b.value) : a(j, b.reason);
|
|
6306
6300
|
}
|
|
6307
6301
|
const u = await Cs({
|
|
6308
6302
|
client: t,
|
|
6309
6303
|
ids: [
|
|
6310
6304
|
...new Set(
|
|
6311
|
-
l.filter((
|
|
6305
|
+
l.filter((k) => Bc(k.moveRequest)).map((k) => k.id)
|
|
6312
6306
|
)
|
|
6313
6307
|
]
|
|
6314
6308
|
}), p = [];
|
|
6315
|
-
for (const
|
|
6309
|
+
for (const k of l)
|
|
6316
6310
|
try {
|
|
6317
6311
|
const b = Hc({
|
|
6318
|
-
taskId:
|
|
6319
|
-
request:
|
|
6320
|
-
current: u.get(
|
|
6312
|
+
taskId: k.id,
|
|
6313
|
+
request: k.moveRequest,
|
|
6314
|
+
current: u.get(k.id)
|
|
6321
6315
|
});
|
|
6322
|
-
|
|
6316
|
+
k.redundantMoveSkipped = b.redundantMoveSkipped, b.move && p.push({ item: k, move: b.move });
|
|
6323
6317
|
} catch (b) {
|
|
6324
|
-
a(
|
|
6318
|
+
a(k.index, b), k.failed = !0;
|
|
6325
6319
|
}
|
|
6326
|
-
const
|
|
6327
|
-
const b =
|
|
6328
|
-
b.length !== 0 &&
|
|
6320
|
+
const m = /* @__PURE__ */ new Map(), h = [], y = (k) => {
|
|
6321
|
+
const b = k.filter((j) => !j.failed);
|
|
6322
|
+
b.length !== 0 && h.push(
|
|
6329
6323
|
Qc({
|
|
6330
6324
|
client: t,
|
|
6331
6325
|
items: b,
|
|
@@ -6333,12 +6327,12 @@ const Wc = s.object({
|
|
|
6333
6327
|
o[j.index] = { kind: "updated", task: $ };
|
|
6334
6328
|
},
|
|
6335
6329
|
onFailed: (j, $) => {
|
|
6336
|
-
const D =
|
|
6330
|
+
const D = m.get(j.index);
|
|
6337
6331
|
if (D && "task" in D) {
|
|
6338
6332
|
o[j.index] = {
|
|
6339
6333
|
kind: "partial",
|
|
6340
6334
|
task: D.task,
|
|
6341
|
-
error: `Move applied; field update failed: ${
|
|
6335
|
+
error: `Move applied; field update failed: ${Y($)}`
|
|
6342
6336
|
};
|
|
6343
6337
|
return;
|
|
6344
6338
|
}
|
|
@@ -6346,15 +6340,15 @@ const Wc = s.object({
|
|
|
6346
6340
|
}
|
|
6347
6341
|
})
|
|
6348
6342
|
);
|
|
6349
|
-
}, f = new Set(p.map(({ item:
|
|
6350
|
-
y(l.filter((
|
|
6343
|
+
}, f = new Set(p.map(({ item: k }) => k.index));
|
|
6344
|
+
y(l.filter((k) => !f.has(k.index))), await Xc({
|
|
6351
6345
|
client: t,
|
|
6352
6346
|
moving: p,
|
|
6353
|
-
results:
|
|
6354
|
-
onResolved: (
|
|
6347
|
+
results: m,
|
|
6348
|
+
onResolved: (k) => {
|
|
6355
6349
|
const b = [];
|
|
6356
|
-
for (const { item: j } of
|
|
6357
|
-
const $ =
|
|
6350
|
+
for (const { item: j } of k) {
|
|
6351
|
+
const $ = m.get(j.index);
|
|
6358
6352
|
if ($ && "error" in $) {
|
|
6359
6353
|
n(j.index, $.error), j.failed = !0;
|
|
6360
6354
|
continue;
|
|
@@ -6363,31 +6357,31 @@ const Wc = s.object({
|
|
|
6363
6357
|
}
|
|
6364
6358
|
y(b);
|
|
6365
6359
|
}
|
|
6366
|
-
}), await Promise.all(
|
|
6367
|
-
for (const
|
|
6368
|
-
if (
|
|
6360
|
+
}), await Promise.all(h);
|
|
6361
|
+
for (const k of l) {
|
|
6362
|
+
if (k.failed || Ss(k.updateArgs))
|
|
6369
6363
|
continue;
|
|
6370
|
-
const b =
|
|
6371
|
-
b && "task" in b && (o[
|
|
6364
|
+
const b = m.get(k.index);
|
|
6365
|
+
b && "task" in b && (o[k.index] = { kind: "updated", task: b.task });
|
|
6372
6366
|
}
|
|
6373
|
-
const { updatedTasks: v, failures: S, skippedCount: A } = Vc({ tasks: r, outcomes: o }),
|
|
6367
|
+
const { updatedTasks: v, failures: S, skippedCount: A } = Vc({ tasks: r, outcomes: o }), T = l.filter((k) => k.redundantMoveSkipped).length, I = v.map(P);
|
|
6374
6368
|
return {
|
|
6375
6369
|
textContent: sd({
|
|
6376
6370
|
tasks: I,
|
|
6377
6371
|
failures: S,
|
|
6378
6372
|
skippedCount: A,
|
|
6379
|
-
redundantMovesSkipped:
|
|
6373
|
+
redundantMovesSkipped: T
|
|
6380
6374
|
}),
|
|
6381
6375
|
structuredContent: {
|
|
6382
6376
|
tasks: I,
|
|
6383
6377
|
totalCount: I.length,
|
|
6384
|
-
updatedTaskIds: v.map((
|
|
6378
|
+
updatedTaskIds: v.map((k) => k.id),
|
|
6385
6379
|
failures: S,
|
|
6386
6380
|
appliedOperations: {
|
|
6387
6381
|
updateCount: I.length,
|
|
6388
6382
|
skippedCount: A,
|
|
6389
6383
|
failureCount: S.length,
|
|
6390
|
-
redundantMovesSkipped:
|
|
6384
|
+
redundantMovesSkipped: T
|
|
6391
6385
|
}
|
|
6392
6386
|
}
|
|
6393
6387
|
};
|
|
@@ -6463,15 +6457,15 @@ async function Xc({
|
|
|
6463
6457
|
}
|
|
6464
6458
|
const p = await a(
|
|
6465
6459
|
() => O(() => e.moveTasks(d, l))
|
|
6466
|
-
),
|
|
6460
|
+
), m = new Map(p.map((f) => [f.id, f])), h = [], y = [];
|
|
6467
6461
|
for (const f of c) {
|
|
6468
|
-
const v =
|
|
6469
|
-
v ? (r.set(f.item.index, { task: v }), y.push(f)) :
|
|
6462
|
+
const v = m.get(f.item.id);
|
|
6463
|
+
v ? (r.set(f.item.index, { task: v }), y.push(f)) : h.push(f);
|
|
6470
6464
|
}
|
|
6471
|
-
o(y),
|
|
6465
|
+
o(y), h.length > 0 && i.push({ group: h, destination: l });
|
|
6472
6466
|
} catch (p) {
|
|
6473
6467
|
if (u) {
|
|
6474
|
-
r.set(u.item.index, { error:
|
|
6468
|
+
r.set(u.item.index, { error: Y(p) }), o(c);
|
|
6475
6469
|
continue;
|
|
6476
6470
|
}
|
|
6477
6471
|
i.push({ group: c, destination: l, error: p });
|
|
@@ -6490,7 +6484,7 @@ async function Zc({
|
|
|
6490
6484
|
}) {
|
|
6491
6485
|
const o = [...new Set(t.flatMap(({ group: a }) => a.map(({ item: i }) => i.id)))], n = await Cs({ client: e, ids: o });
|
|
6492
6486
|
for (const { group: a, destination: i, error: c } of t) {
|
|
6493
|
-
const d = c === void 0 ? "Task not returned by the move" :
|
|
6487
|
+
const d = c === void 0 ? "Task not returned by the move" : Y(c);
|
|
6494
6488
|
for (const { item: l } of a) {
|
|
6495
6489
|
const u = n.get(l.id);
|
|
6496
6490
|
if (u && js(u, i)) {
|
|
@@ -6536,8 +6530,8 @@ async function ed({
|
|
|
6536
6530
|
duration: l,
|
|
6537
6531
|
responsibleUser: u,
|
|
6538
6532
|
priority: p,
|
|
6539
|
-
labels:
|
|
6540
|
-
deadlineDate:
|
|
6533
|
+
labels: m,
|
|
6534
|
+
deadlineDate: h,
|
|
6541
6535
|
...y
|
|
6542
6536
|
} = e;
|
|
6543
6537
|
if (M(a) && o.error !== void 0)
|
|
@@ -6545,26 +6539,26 @@ async function ed({
|
|
|
6545
6539
|
const f = M(a) ? o.projectId : a;
|
|
6546
6540
|
let v = {
|
|
6547
6541
|
...y,
|
|
6548
|
-
...
|
|
6542
|
+
...m !== void 0 && { labels: m }
|
|
6549
6543
|
};
|
|
6550
6544
|
p && (v.priority = Zt(p));
|
|
6551
6545
|
const S = Pt(
|
|
6552
6546
|
d,
|
|
6553
|
-
|
|
6554
|
-
|
|
6547
|
+
Yc,
|
|
6548
|
+
qc
|
|
6555
6549
|
);
|
|
6556
6550
|
S !== void 0 && (v = { ...v, dueString: S });
|
|
6557
|
-
const A = Pt(
|
|
6551
|
+
const A = Pt(h, zc, null);
|
|
6558
6552
|
if (A !== void 0 && (v = { ...v, deadlineDate: A }), l)
|
|
6559
6553
|
try {
|
|
6560
|
-
const { minutes:
|
|
6554
|
+
const { minutes: T } = Xt(l);
|
|
6561
6555
|
v = {
|
|
6562
6556
|
...v,
|
|
6563
|
-
duration:
|
|
6557
|
+
duration: T,
|
|
6564
6558
|
durationUnit: "minute"
|
|
6565
6559
|
};
|
|
6566
|
-
} catch (
|
|
6567
|
-
throw
|
|
6560
|
+
} catch (T) {
|
|
6561
|
+
throw T instanceof R ? new Error(`Task ${n}: ${T.message}`) : T;
|
|
6568
6562
|
}
|
|
6569
6563
|
return u !== void 0 && (v = {
|
|
6570
6564
|
...v,
|
|
@@ -6686,8 +6680,8 @@ function pd(e, t) {
|
|
|
6686
6680
|
hour12: !1
|
|
6687
6681
|
});
|
|
6688
6682
|
}
|
|
6689
|
-
async function
|
|
6690
|
-
const t = await e.getUser(), r = t.tzInfo?.timezone ?? "UTC", o = $s(r), n = /* @__PURE__ */ new Date(), a = pd(n, o), i = t.startDay ?? 1, c = ld(i), d = ad(t), l = new Date(n.toLocaleString("en-US", { timeZone: o })), u = id(l, i), p = cd(u),
|
|
6683
|
+
async function md(e) {
|
|
6684
|
+
const t = await e.getUser(), r = t.tzInfo?.timezone ?? "UTC", o = $s(r), n = /* @__PURE__ */ new Date(), a = pd(n, o), i = t.startDay ?? 1, c = ld(i), d = ad(t), l = new Date(n.toLocaleString("en-US", { timeZone: o })), u = id(l, i), p = cd(u), m = dd(l), y = [
|
|
6691
6685
|
"# User Information",
|
|
6692
6686
|
"",
|
|
6693
6687
|
`**User ID:** ${t.id}`,
|
|
@@ -6698,7 +6692,7 @@ async function hd(e) {
|
|
|
6698
6692
|
"",
|
|
6699
6693
|
"## Week Settings",
|
|
6700
6694
|
`**Week Start Day:** ${c} (${i})`,
|
|
6701
|
-
`**Current Week:** Week ${
|
|
6695
|
+
`**Current Week:** Week ${m}`,
|
|
6702
6696
|
`**Week Start Date:** ${ie(u)}`,
|
|
6703
6697
|
`**Week End Date:** ${ie(p)}`,
|
|
6704
6698
|
"",
|
|
@@ -6720,7 +6714,7 @@ async function hd(e) {
|
|
|
6720
6714
|
startDayName: c,
|
|
6721
6715
|
weekStartDate: ie(u),
|
|
6722
6716
|
weekEndDate: ie(p),
|
|
6723
|
-
currentWeekNumber:
|
|
6717
|
+
currentWeekNumber: m,
|
|
6724
6718
|
completedToday: t.completedToday,
|
|
6725
6719
|
dailyGoal: t.dailyGoal,
|
|
6726
6720
|
weeklyGoal: t.weeklyGoal,
|
|
@@ -6729,14 +6723,14 @@ async function hd(e) {
|
|
|
6729
6723
|
};
|
|
6730
6724
|
return { textContent: y, structuredContent: f };
|
|
6731
6725
|
}
|
|
6732
|
-
const
|
|
6726
|
+
const hd = {
|
|
6733
6727
|
name: g.USER_INFO,
|
|
6734
6728
|
description: "Get comprehensive user information including user ID, full name, email, timezone with current local time, week start day preferences, current week dates, daily/weekly goal progress, and user plan (Free/Pro/Business).",
|
|
6735
6729
|
parameters: od,
|
|
6736
6730
|
outputSchema: nd,
|
|
6737
6731
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
6738
6732
|
async execute(e, t) {
|
|
6739
|
-
const r = await
|
|
6733
|
+
const r = await md(t);
|
|
6740
6734
|
return {
|
|
6741
6735
|
textContent: r.textContent,
|
|
6742
6736
|
structuredContent: r.structuredContent
|
|
@@ -6774,10 +6768,10 @@ const md = {
|
|
|
6774
6768
|
function yd(e) {
|
|
6775
6769
|
return fd.has(e) ? "image" : bd.has(e) || e.startsWith("text/") ? "text" : "binary";
|
|
6776
6770
|
}
|
|
6777
|
-
function
|
|
6771
|
+
function kd(e) {
|
|
6778
6772
|
return (e.split(";")[0] ?? e).trim().toLowerCase();
|
|
6779
6773
|
}
|
|
6780
|
-
function
|
|
6774
|
+
function Td(e) {
|
|
6781
6775
|
try {
|
|
6782
6776
|
const t = new URL(e).pathname, r = t.lastIndexOf(".");
|
|
6783
6777
|
if (r === -1) return;
|
|
@@ -6809,7 +6803,7 @@ const vd = {
|
|
|
6809
6803
|
idempotentHint: !0
|
|
6810
6804
|
},
|
|
6811
6805
|
async execute({ fileUrl: e }, t) {
|
|
6812
|
-
const r = await t.viewAttachment(e), o = r.headers["content-length"], n = o ? Number.parseInt(o, 10) : void 0, a = wd(e), i = r.headers["content-type"], c = i ?
|
|
6806
|
+
const r = await t.viewAttachment(e), o = r.headers["content-length"], n = o ? Number.parseInt(o, 10) : void 0, a = wd(e), i = r.headers["content-type"], c = i ? kd(i) : void 0, d = c && c !== "application/octet-stream" ? c : Td(e) ?? c ?? "application/octet-stream";
|
|
6813
6807
|
if (n && n > Rt)
|
|
6814
6808
|
return {
|
|
6815
6809
|
textContent: `Attachment "${a ?? e}" is too large to display inline (${(n / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
|
|
@@ -6819,15 +6813,15 @@ const vd = {
|
|
|
6819
6813
|
return {
|
|
6820
6814
|
textContent: `Attachment "${a ?? e}" is too large to display inline (${(u / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
|
|
6821
6815
|
};
|
|
6822
|
-
const p = yd(d),
|
|
6823
|
-
return p === "image" ?
|
|
6816
|
+
const p = yd(d), m = [];
|
|
6817
|
+
return p === "image" ? m.push({
|
|
6824
6818
|
type: "image",
|
|
6825
6819
|
data: l.toString("base64"),
|
|
6826
6820
|
mimeType: d
|
|
6827
|
-
}) : p === "text" ?
|
|
6821
|
+
}) : p === "text" ? m.push({
|
|
6828
6822
|
type: "text",
|
|
6829
6823
|
text: l.toString("utf-8")
|
|
6830
|
-
}) :
|
|
6824
|
+
}) : m.push({
|
|
6831
6825
|
type: "resource",
|
|
6832
6826
|
resource: {
|
|
6833
6827
|
uri: e,
|
|
@@ -6836,7 +6830,7 @@ const vd = {
|
|
|
6836
6830
|
}
|
|
6837
6831
|
}), {
|
|
6838
6832
|
textContent: `Attachment: ${a ?? "unknown"} (${d}, ${(u / 1024).toFixed(1)}KB)`,
|
|
6839
|
-
contentItems:
|
|
6833
|
+
contentItems: m
|
|
6840
6834
|
};
|
|
6841
6835
|
}
|
|
6842
6836
|
}, jd = {
|
|
@@ -6859,7 +6853,7 @@ const vd = {
|
|
|
6859
6853
|
// Project management tools
|
|
6860
6854
|
addProjects: Go,
|
|
6861
6855
|
updateProjects: Ic,
|
|
6862
|
-
findProjects:
|
|
6856
|
+
findProjects: Ta,
|
|
6863
6857
|
projectManagement: _i,
|
|
6864
6858
|
projectMove: Mi,
|
|
6865
6859
|
// Section management tools
|
|
@@ -6885,7 +6879,7 @@ const vd = {
|
|
|
6885
6879
|
addFilters: Oo,
|
|
6886
6880
|
updateFilters: cc,
|
|
6887
6881
|
// Activity and audit tools
|
|
6888
|
-
findActivity:
|
|
6882
|
+
findActivity: Yn,
|
|
6889
6883
|
getProductivityStats: Qa,
|
|
6890
6884
|
// Health and insights tools
|
|
6891
6885
|
getProjectHealth: ui,
|
|
@@ -6897,13 +6891,13 @@ const vd = {
|
|
|
6897
6891
|
deleteObject: Sn,
|
|
6898
6892
|
fetchObject: Ln,
|
|
6899
6893
|
reorderObjects: Hi,
|
|
6900
|
-
userInfo:
|
|
6894
|
+
userInfo: hd,
|
|
6901
6895
|
// Assignment and collaboration tools
|
|
6902
|
-
findProjectCollaborators:
|
|
6896
|
+
findProjectCollaborators: ha,
|
|
6903
6897
|
manageAssignments: Oi,
|
|
6904
6898
|
// Template tools
|
|
6905
6899
|
exportProjectTemplate: Dn,
|
|
6906
|
-
importProjectTemplate:
|
|
6900
|
+
importProjectTemplate: Ti,
|
|
6907
6901
|
// Workspace tools
|
|
6908
6902
|
listWorkspaces: Ci,
|
|
6909
6903
|
// OpenAI MCP tools
|
|
@@ -7033,13 +7027,13 @@ function Hd({
|
|
|
7033
7027
|
for (const i of Cd)
|
|
7034
7028
|
zr({ tool: i, ...a });
|
|
7035
7029
|
return o.registerPrompt(
|
|
7036
|
-
|
|
7030
|
+
he.name,
|
|
7037
7031
|
{
|
|
7038
|
-
title:
|
|
7039
|
-
description:
|
|
7040
|
-
argsSchema:
|
|
7032
|
+
title: he.title,
|
|
7033
|
+
description: he.description,
|
|
7034
|
+
argsSchema: he.argsSchema
|
|
7041
7035
|
},
|
|
7042
|
-
|
|
7036
|
+
he.callback
|
|
7043
7037
|
), o;
|
|
7044
7038
|
}
|
|
7045
7039
|
export {
|
|
@@ -7050,7 +7044,7 @@ export {
|
|
|
7050
7044
|
ui as D,
|
|
7051
7045
|
fi as E,
|
|
7052
7046
|
Fd as F,
|
|
7053
|
-
|
|
7047
|
+
Ti as G,
|
|
7054
7048
|
Ci as H,
|
|
7055
7049
|
Oi as I,
|
|
7056
7050
|
_i as J,
|
|
@@ -7067,7 +7061,7 @@ export {
|
|
|
7067
7061
|
Oc as U,
|
|
7068
7062
|
Uc as V,
|
|
7069
7063
|
Kc as W,
|
|
7070
|
-
|
|
7064
|
+
hd as X,
|
|
7071
7065
|
Id as Y,
|
|
7072
7066
|
Sr as Z,
|
|
7073
7067
|
br as _,
|
|
@@ -7085,14 +7079,14 @@ export {
|
|
|
7085
7079
|
Dn as l,
|
|
7086
7080
|
Fn as m,
|
|
7087
7081
|
Ln as n,
|
|
7088
|
-
|
|
7082
|
+
Yn as o,
|
|
7089
7083
|
Xn as p,
|
|
7090
7084
|
aa as q,
|
|
7091
7085
|
$o as r,
|
|
7092
7086
|
la as s,
|
|
7093
7087
|
Sd as t,
|
|
7094
|
-
|
|
7095
|
-
|
|
7088
|
+
ha as u,
|
|
7089
|
+
Ta as v,
|
|
7096
7090
|
ja as w,
|
|
7097
7091
|
xa as x,
|
|
7098
7092
|
Fa as y,
|