@doist/todoist-mcp 13.7.0 → 13.7.1
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-Dk9xDrGC.js → mcp-server-BicI89wv.js} +166 -161
- package/dist/{require-valid-todoist-token-BxGWepnK.js → require-valid-todoist-token-qKxFPNp7.js} +1 -1
- package/dist/tools/find-activity.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as s } from "./mcp-server-
|
|
2
|
-
import { F as r, a as d, b as i, c as n, d as c, e as l, f as m, h as p, i as f, j as T, k as j, l as g, m as k, n as u, o as v, p as P, q as h, r as b, s as S, u as y, v as A, w as C, x as R, y as x, z as F, g as M, A as O, B as E, C as L, D as w, E as H, G as I, H as W, I as q, J as z, K as B, L as D, M as N, N as U, O as V, P as G, Q as J, R as K, S as Q, T as X, U as Y, V as _, W as Z, X as $, Y as ss } from "./mcp-server-
|
|
3
|
-
import { r as es, v as ts } from "./require-valid-todoist-token-
|
|
1
|
+
import { t as s } from "./mcp-server-BicI89wv.js";
|
|
2
|
+
import { F as r, a as d, b as i, c as n, d as c, e as l, f as m, h as p, i as f, j as T, k as j, l as g, m as k, n as u, o as v, p as P, q as h, r as b, s as S, u as y, v as A, w as C, x as R, y as x, z as F, g as M, A as O, B as E, C as L, D as w, E as H, G as I, H as W, I as q, J as z, K as B, L as D, M as N, N as U, O as V, P as G, Q as J, R as K, S as Q, T as X, U as Y, V as _, W as Z, X as $, Y as ss } from "./mcp-server-BicI89wv.js";
|
|
3
|
+
import { r as es, v as ts } from "./require-valid-todoist-token-qKxFPNp7.js";
|
|
4
4
|
const e = s;
|
|
5
5
|
export {
|
|
6
6
|
r as FEATURE_NAMES,
|
package/dist/main-http.js
CHANGED
|
@@ -4,8 +4,8 @@ import S from "dotenv";
|
|
|
4
4
|
import { toNodeHandler as w } from "@modelcontextprotocol/node";
|
|
5
5
|
import { createMcpHandler as v } from "@modelcontextprotocol/server";
|
|
6
6
|
import h from "express";
|
|
7
|
-
import { g as I } from "./mcp-server-
|
|
8
|
-
import { r as g } from "./require-valid-todoist-token-
|
|
7
|
+
import { g as I } from "./mcp-server-BicI89wv.js";
|
|
8
|
+
import { r as g } from "./require-valid-todoist-token-qKxFPNp7.js";
|
|
9
9
|
function p(e) {
|
|
10
10
|
return e.startsWith("[") && e.endsWith("]") ? e.slice(1, -1) : e;
|
|
11
11
|
}
|
package/dist/main.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { serveStdio as t } from "@modelcontextprotocol/server/stdio";
|
|
3
3
|
import s from "dotenv";
|
|
4
|
-
import { g as n } from "./mcp-server-
|
|
4
|
+
import { g as n } from "./mcp-server-BicI89wv.js";
|
|
5
5
|
function i() {
|
|
6
6
|
const o = process.env.TODOIST_BASE_URL, r = process.env.TODOIST_API_KEY;
|
|
7
7
|
if (!r)
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ResourceTemplate as
|
|
1
|
+
import { ResourceTemplate as ro, McpServer as no } from "@modelcontextprotocol/server";
|
|
2
2
|
import { createHash as es, randomUUID as Fe } from "node:crypto";
|
|
3
|
-
import { readFileSync as
|
|
3
|
+
import { readFileSync as io } from "node:fs";
|
|
4
4
|
import { dirname as ts, join as He } from "node:path";
|
|
5
|
-
import { fileURLToPath as
|
|
5
|
+
import { fileURLToPath as ao } from "node:url";
|
|
6
6
|
import { RESOURCE_MIME_TYPE as We } from "@modelcontextprotocol/ext-apps/server";
|
|
7
|
-
import ae, { ZodError as
|
|
8
|
-
import { AsyncLocalStorage as
|
|
9
|
-
import { createRequire as
|
|
10
|
-
import { TodoistApi as
|
|
7
|
+
import ae, { ZodError as co, z as o } from "zod";
|
|
8
|
+
import { AsyncLocalStorage as lo } from "node:async_hooks";
|
|
9
|
+
import { createRequire as uo } from "node:module";
|
|
10
|
+
import { TodoistApi as po, isWorkspaceProject as je, isPersonalProject as Y, colors as Be, LOCATION_TRIGGERS as ss, REMINDER_TYPES as ho, createCommand as he, REMINDER_DELIVERY_SERVICES as mo, HEALTH_STATUSES as rt, getTaskUrl as os, getProjectUrl as rs, ACTIVITY_EVENT_TYPES as fo, ACTIVITY_OBJECT_TYPES as ns, escapeFilterToken as is, parseTodoistUrl as bo, WORKSPACE_ROLES as go, WORKSPACE_PLANS as yo } from "@doist/todoist-sdk";
|
|
11
11
|
import { addDays as ze, formatISO as St } from "date-fns";
|
|
12
12
|
const nt = 3600 * 1e3, To = 365 * 24 * nt, j = {
|
|
13
13
|
/** Default limit for task listings */
|
|
@@ -48,7 +48,7 @@ const nt = 3600 * 1e3, To = 365 * 24 * nt, j = {
|
|
|
48
48
|
}, ko = {
|
|
49
49
|
/** Maximum number of failed items named in one log line */
|
|
50
50
|
MAX_FAILURES_LOGGED: 5
|
|
51
|
-
},
|
|
51
|
+
}, as = {
|
|
52
52
|
/** Maximum tasks accepted by one task create or update operation */
|
|
53
53
|
TASKS_PER_OPERATION: 25
|
|
54
54
|
}, Ke = {
|
|
@@ -74,7 +74,7 @@ const nt = 3600 * 1e3, To = 365 * 24 * nt, j = {
|
|
|
74
74
|
* queue (serialised moves to 100 distinct destinations is roughly 15s).
|
|
75
75
|
*/
|
|
76
76
|
QUEUE_WAIT_MS: 3e4
|
|
77
|
-
}, Ct = ts(
|
|
77
|
+
}, Ct = ts(ao(import.meta.url)), wo = [
|
|
78
78
|
He(Ct, "task-list", "index.html"),
|
|
79
79
|
He(Ct, "mcp-apps", "index.html")
|
|
80
80
|
], Io = `<!doctype html>
|
|
@@ -87,13 +87,13 @@ function vo() {
|
|
|
87
87
|
const e = [];
|
|
88
88
|
for (const t of wo)
|
|
89
89
|
try {
|
|
90
|
-
return
|
|
90
|
+
return io(t, "utf-8");
|
|
91
91
|
} catch (s) {
|
|
92
92
|
e.push(s);
|
|
93
93
|
}
|
|
94
94
|
return console.error("Failed to load task list app HTML from any known path:", e), Io;
|
|
95
95
|
}
|
|
96
|
-
const
|
|
96
|
+
const cs = vo(), So = es("sha256").update(cs).digest("hex").slice(0, 12), Ye = `ui://todoist/task-list@${So}`, Co = "ui://todoist/task-list@{hash}", qe = "Interactive task list widget", jo = "https://ai.todoist.net", Ge = {
|
|
97
97
|
ui: {
|
|
98
98
|
prefersBorder: !0,
|
|
99
99
|
csp: {
|
|
@@ -116,7 +116,7 @@ function jt(e) {
|
|
|
116
116
|
{
|
|
117
117
|
uri: e,
|
|
118
118
|
mimeType: We,
|
|
119
|
-
text:
|
|
119
|
+
text: cs,
|
|
120
120
|
_meta: Ge
|
|
121
121
|
}
|
|
122
122
|
]
|
|
@@ -135,7 +135,7 @@ function Ao(e) {
|
|
|
135
135
|
async () => jt(Ye)
|
|
136
136
|
), e.registerResource(
|
|
137
137
|
"todoist-task-list-hash-fallback",
|
|
138
|
-
new
|
|
138
|
+
new ro(Co, { list: void 0 }),
|
|
139
139
|
{
|
|
140
140
|
description: `${qe} compatibility fallback`,
|
|
141
141
|
mimeType: We,
|
|
@@ -386,18 +386,18 @@ function it(e) {
|
|
|
386
386
|
fieldHints: p
|
|
387
387
|
} : null;
|
|
388
388
|
}
|
|
389
|
-
function
|
|
389
|
+
function ds(e) {
|
|
390
390
|
const t = [];
|
|
391
391
|
return e.statusCode !== void 0 && t.push(`HTTP ${e.statusCode}`), e.code !== void 0 && t.push(`code ${e.code}`), e.tag && t.push(`tag ${e.tag}`), t;
|
|
392
392
|
}
|
|
393
393
|
function Lo(e) {
|
|
394
|
-
const t =
|
|
394
|
+
const t = ds(e), s = [
|
|
395
395
|
t.length > 0 ? `Todoist API request failed (${t.join(", ")}).` : "Todoist API request failed."
|
|
396
396
|
];
|
|
397
397
|
return e.message && s.push(`Message: ${e.message}`), e.details && e.details !== e.message && s.push(`Details: ${e.details}`), e.fieldHints.length > 0 && s.push(`Field hints: ${e.fieldHints.join("; ")}`), s.push(`Try next: ${Ro(e)}`), s.join(`
|
|
398
398
|
`);
|
|
399
399
|
}
|
|
400
|
-
function
|
|
400
|
+
function ls(e) {
|
|
401
401
|
return e instanceof Error ? L(e.message) : typeof e == "string" ? L(e) : "An unknown error occurred";
|
|
402
402
|
}
|
|
403
403
|
class De extends Error {
|
|
@@ -405,7 +405,7 @@ class De extends Error {
|
|
|
405
405
|
super(t), this.name = "DueStringParseError";
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
|
-
class
|
|
408
|
+
class us extends Error {
|
|
409
409
|
constructor(t) {
|
|
410
410
|
super(t), this.name = "BatchDueStringParseError";
|
|
411
411
|
}
|
|
@@ -415,8 +415,8 @@ function N(e) {
|
|
|
415
415
|
return e.message;
|
|
416
416
|
const t = it(e);
|
|
417
417
|
if (!t)
|
|
418
|
-
return
|
|
419
|
-
const s =
|
|
418
|
+
return ls(e);
|
|
419
|
+
const s = ds(t), r = t.message && !(s.length > 0 && Je(t.message)) ? t.message : "Todoist API request failed";
|
|
420
420
|
return s.length > 0 ? `${r} (${s.join(", ")})` : r;
|
|
421
421
|
}
|
|
422
422
|
function No(e, {
|
|
@@ -433,12 +433,12 @@ function No(e, {
|
|
|
433
433
|
return d !== s.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 !== s.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.`;
|
|
434
434
|
}
|
|
435
435
|
function Mo(e) {
|
|
436
|
-
if (e instanceof
|
|
436
|
+
if (e instanceof co || e instanceof De || e instanceof us)
|
|
437
437
|
return e.message;
|
|
438
438
|
const t = it(e);
|
|
439
|
-
return t ? Lo(t) :
|
|
439
|
+
return t ? Lo(t) : ls(e);
|
|
440
440
|
}
|
|
441
|
-
const Fo = "13.7.
|
|
441
|
+
const Fo = "13.7.1", Ho = {
|
|
442
442
|
version: Fo
|
|
443
443
|
};
|
|
444
444
|
function $t(e, { queueTimeoutMs: t = Ke.QUEUE_WAIT_MS } = {}) {
|
|
@@ -491,7 +491,7 @@ function at() {
|
|
|
491
491
|
}
|
|
492
492
|
const Wo = 1e4, Bo = 5 * 6e4, W = /* @__PURE__ */ new Map();
|
|
493
493
|
let zo = Wo;
|
|
494
|
-
const
|
|
494
|
+
const ps = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new Map();
|
|
495
495
|
let Dt, At;
|
|
496
496
|
function Ko() {
|
|
497
497
|
return Dt ??= at(), Dt;
|
|
@@ -505,7 +505,7 @@ function Yo(e) {
|
|
|
505
505
|
function qo({ moves: e, writes: t }) {
|
|
506
506
|
return e.isIdle() && t.isIdle();
|
|
507
507
|
}
|
|
508
|
-
function
|
|
508
|
+
function hs(e) {
|
|
509
509
|
return e.leases === 0 && qo(e.limiters);
|
|
510
510
|
}
|
|
511
511
|
function Go(e, t, s) {
|
|
@@ -515,16 +515,16 @@ function Vo(e) {
|
|
|
515
515
|
for (const [t, s] of W) {
|
|
516
516
|
if (e - s.lastUsedAt < Bo)
|
|
517
517
|
break;
|
|
518
|
-
|
|
518
|
+
hs(s) && W.delete(t);
|
|
519
519
|
}
|
|
520
520
|
}
|
|
521
521
|
function Jo() {
|
|
522
522
|
for (const [e, t] of W)
|
|
523
|
-
if (
|
|
523
|
+
if (hs(t))
|
|
524
524
|
return W.delete(e), !0;
|
|
525
525
|
return !1;
|
|
526
526
|
}
|
|
527
|
-
function
|
|
527
|
+
function ms(e, t) {
|
|
528
528
|
if (Q.has(e))
|
|
529
529
|
return;
|
|
530
530
|
const s = W.get(e);
|
|
@@ -542,7 +542,7 @@ function Xo(e) {
|
|
|
542
542
|
limiters: xt(),
|
|
543
543
|
release: () => Et(e)
|
|
544
544
|
};
|
|
545
|
-
const s =
|
|
545
|
+
const s = ms(e, Date.now());
|
|
546
546
|
return s ? (s.leases++, {
|
|
547
547
|
limiters: s.limiters,
|
|
548
548
|
release: () => {
|
|
@@ -563,11 +563,11 @@ function Et(e) {
|
|
|
563
563
|
}
|
|
564
564
|
function Qo(e, t) {
|
|
565
565
|
const s = Yo(t);
|
|
566
|
-
|
|
566
|
+
ps.set(e, s);
|
|
567
567
|
}
|
|
568
|
-
function
|
|
569
|
-
const s =
|
|
570
|
-
return s ? (
|
|
568
|
+
function fs(e, t) {
|
|
569
|
+
const s = ps.get(e);
|
|
570
|
+
return s ? (ms(s, Date.now()), async (r) => {
|
|
571
571
|
const n = Xo(s);
|
|
572
572
|
try {
|
|
573
573
|
return await n.limiters[t](r);
|
|
@@ -577,12 +577,12 @@ function ms(e, t) {
|
|
|
577
577
|
}) : Ko()[t];
|
|
578
578
|
}
|
|
579
579
|
function Zo(e) {
|
|
580
|
-
return
|
|
580
|
+
return fs(e, "moves");
|
|
581
581
|
}
|
|
582
582
|
function er(e) {
|
|
583
|
-
return
|
|
583
|
+
return fs(e, "writes");
|
|
584
584
|
}
|
|
585
|
-
const tr = "todoist-mcp", ct = Ho.version,
|
|
585
|
+
const tr = "todoist-mcp", ct = Ho.version, bs = new lo(), Ot = uo(import.meta.url);
|
|
586
586
|
let Ce;
|
|
587
587
|
const sr = async () => {
|
|
588
588
|
const e = Ot.resolve("@doist/todoist-sdk"), t = He(ts(e), "transport", "http-dispatcher.js");
|
|
@@ -592,18 +592,18 @@ let or = sr;
|
|
|
592
592
|
function rr() {
|
|
593
593
|
return `${tr}/${ct}`;
|
|
594
594
|
}
|
|
595
|
-
function
|
|
595
|
+
function gs(e) {
|
|
596
596
|
return e.trim().toLowerCase();
|
|
597
597
|
}
|
|
598
598
|
function nr(e, t) {
|
|
599
|
-
return
|
|
599
|
+
return bs.run(gs(e), t);
|
|
600
600
|
}
|
|
601
601
|
function ir({
|
|
602
602
|
label: e,
|
|
603
603
|
platform: t = "mcp",
|
|
604
604
|
sessionId: s = Fe()
|
|
605
605
|
} = {}) {
|
|
606
|
-
const r = e ?
|
|
606
|
+
const r = e ? gs(e) : bs.getStore();
|
|
607
607
|
return {
|
|
608
608
|
"User-Agent": rr(),
|
|
609
609
|
"doist-platform": t,
|
|
@@ -706,7 +706,7 @@ function mr(e, {
|
|
|
706
706
|
baseUrl: t,
|
|
707
707
|
tracking: s
|
|
708
708
|
} = {}) {
|
|
709
|
-
const r = new
|
|
709
|
+
const r = new po(e, {
|
|
710
710
|
customFetch: hr(globalThis.fetch, s),
|
|
711
711
|
...t ? { baseUrl: t } : {}
|
|
712
712
|
});
|
|
@@ -1096,13 +1096,13 @@ const ye = {
|
|
|
1096
1096
|
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.",
|
|
1097
1097
|
argsSchema: Lr,
|
|
1098
1098
|
callback: Hr
|
|
1099
|
-
},
|
|
1099
|
+
}, ys = 'The duration of the task. Use format: "2h" (hours), "90m" (minutes), "2h30m" (combined), "1.5h" (decimal hours), or "3d" (whole days; days cannot be combined with hours or minutes). Todoist apps only display durations under 24 hours: a longer or day-based duration is stored and reported by this server, but the apps show the task as having no duration.', Ts = 'Use format like "2h", "30m", "2h30m", "1.5h", or "3d"';
|
|
1100
1100
|
class x extends Error {
|
|
1101
1101
|
constructor(t, s) {
|
|
1102
1102
|
super(`Invalid duration format "${t}": ${s}`), this.name = "DurationParseError";
|
|
1103
1103
|
}
|
|
1104
1104
|
}
|
|
1105
|
-
function
|
|
1105
|
+
function ks(e) {
|
|
1106
1106
|
if (!e || typeof e != "string")
|
|
1107
1107
|
throw new x(e, "Duration must be a non-empty string");
|
|
1108
1108
|
const t = e.trim().toLowerCase().replace(/\s+/g, "");
|
|
@@ -1114,7 +1114,7 @@ function Ts(e) {
|
|
|
1114
1114
|
if (Wr(t))
|
|
1115
1115
|
throw new x(
|
|
1116
1116
|
e,
|
|
1117
|
-
`${
|
|
1117
|
+
`${Ts} (days cannot be combined with hours or minutes)`
|
|
1118
1118
|
);
|
|
1119
1119
|
return { amount: zr(e, t), unit: "minute" };
|
|
1120
1120
|
}
|
|
@@ -1137,7 +1137,7 @@ function Br(e, t) {
|
|
|
1137
1137
|
function zr(e, t) {
|
|
1138
1138
|
const s = t.match(/^(?:(\d+(?:\.\d+)?)h)?(?:(\d+(?:\.\d+)?)m)?$/);
|
|
1139
1139
|
if (!s || !s[1] && !s[2])
|
|
1140
|
-
throw new x(e,
|
|
1140
|
+
throw new x(e, Ts);
|
|
1141
1141
|
let r = 0;
|
|
1142
1142
|
const [, n, i] = s;
|
|
1143
1143
|
if (n) {
|
|
@@ -1173,14 +1173,14 @@ function Kr(e, t = "minute") {
|
|
|
1173
1173
|
return s === 0 ? `${r}m` : r === 0 ? `${s}h` : `${s}h${r}m`;
|
|
1174
1174
|
}
|
|
1175
1175
|
const Yr = ["p1", "p2", "p3", "p4"], dt = 'Task priority as a string: "p1" (highest), "p2" (high), "p3" (medium), or "p4" (lowest/default). Integers like 1, 2, 3, or 4 are not accepted.', lt = o.enum(Yr).describe(dt);
|
|
1176
|
-
function
|
|
1176
|
+
function ws(e) {
|
|
1177
1177
|
return { p1: 4, p2: 3, p3: 2, p4: 1 }[e];
|
|
1178
1178
|
}
|
|
1179
1179
|
function qr(e) {
|
|
1180
1180
|
return { 4: "p1", 3: "p2", 2: "p3", 1: "p4" }[e];
|
|
1181
1181
|
}
|
|
1182
|
-
const
|
|
1183
|
-
class
|
|
1182
|
+
const Is = 300 * 1e3, Gr = 1e4, Vr = 1e3;
|
|
1183
|
+
class vs {
|
|
1184
1184
|
constructor(t, s) {
|
|
1185
1185
|
this.maxEntries = t, this.ttl = s, this.entries = /* @__PURE__ */ new Map();
|
|
1186
1186
|
}
|
|
@@ -1213,13 +1213,13 @@ class Is {
|
|
|
1213
1213
|
t - r.timestamp >= this.ttl && this.entries.delete(s);
|
|
1214
1214
|
}
|
|
1215
1215
|
}
|
|
1216
|
-
const Re = new
|
|
1216
|
+
const Re = new vs(
|
|
1217
1217
|
Gr,
|
|
1218
|
-
|
|
1219
|
-
), de = new
|
|
1218
|
+
Is
|
|
1219
|
+
), de = new vs(
|
|
1220
1220
|
Vr,
|
|
1221
|
-
|
|
1222
|
-
),
|
|
1221
|
+
Is
|
|
1222
|
+
), Ss = "me";
|
|
1223
1223
|
class Jr {
|
|
1224
1224
|
/**
|
|
1225
1225
|
* Resolve a user name or ID to a user ID by looking up collaborators across all shared projects.
|
|
@@ -1229,7 +1229,7 @@ class Jr {
|
|
|
1229
1229
|
if (!s || s.trim().length === 0)
|
|
1230
1230
|
return null;
|
|
1231
1231
|
const r = s.trim();
|
|
1232
|
-
if (r.toLowerCase() ===
|
|
1232
|
+
if (r.toLowerCase() === Ss)
|
|
1233
1233
|
try {
|
|
1234
1234
|
const d = await t.getUser();
|
|
1235
1235
|
return {
|
|
@@ -1359,7 +1359,7 @@ const H = new Jr();
|
|
|
1359
1359
|
async function Xr(e, t) {
|
|
1360
1360
|
return H.resolveUser(e, t);
|
|
1361
1361
|
}
|
|
1362
|
-
async function
|
|
1362
|
+
async function Cs(e, t) {
|
|
1363
1363
|
const s = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), n = [], i = [];
|
|
1364
1364
|
for (const a of t) {
|
|
1365
1365
|
const c = a.trim().toLowerCase();
|
|
@@ -1380,7 +1380,7 @@ async function Ss(e, t) {
|
|
|
1380
1380
|
}
|
|
1381
1381
|
return n;
|
|
1382
1382
|
}
|
|
1383
|
-
const
|
|
1383
|
+
const js = ["assigned", "unassignedOrMe", "all"];
|
|
1384
1384
|
async function ut(e, t) {
|
|
1385
1385
|
if (!t)
|
|
1386
1386
|
return;
|
|
@@ -1440,14 +1440,14 @@ async function z(e) {
|
|
|
1440
1440
|
function pt(e) {
|
|
1441
1441
|
return /(?<!\\)(?:\\\\)*\*/.test(e) ? e : `*${e.replaceAll(/\\(?!\*)/g, "\\\\")}*`;
|
|
1442
1442
|
}
|
|
1443
|
-
async function
|
|
1443
|
+
async function $s(e, t) {
|
|
1444
1444
|
return z({
|
|
1445
1445
|
apiMethod: e.searchProjects.bind(e),
|
|
1446
1446
|
args: { query: pt(t) },
|
|
1447
1447
|
limit: j.PROJECTS_MAX
|
|
1448
1448
|
});
|
|
1449
1449
|
}
|
|
1450
|
-
async function
|
|
1450
|
+
async function Ds(e) {
|
|
1451
1451
|
return z({
|
|
1452
1452
|
apiMethod: e.getProjects.bind(e),
|
|
1453
1453
|
args: {},
|
|
@@ -1643,15 +1643,15 @@ function we(e) {
|
|
|
1643
1643
|
};
|
|
1644
1644
|
}
|
|
1645
1645
|
}
|
|
1646
|
-
function
|
|
1646
|
+
function As(e) {
|
|
1647
1647
|
const t = e.filter(
|
|
1648
1648
|
(r) => r.type === "relative" || r.type === "absolute"
|
|
1649
1649
|
).length, s = e.filter((r) => r.type === "location").length;
|
|
1650
1650
|
return { timeBasedCount: t, locationCount: s };
|
|
1651
1651
|
}
|
|
1652
|
-
const
|
|
1652
|
+
const xs = "none";
|
|
1653
1653
|
function an(e) {
|
|
1654
|
-
return e.length === 1 && e[0]?.trim().toLowerCase() ===
|
|
1654
|
+
return e.length === 1 && e[0]?.trim().toLowerCase() === xs;
|
|
1655
1655
|
}
|
|
1656
1656
|
async function cn(e, t, s) {
|
|
1657
1657
|
const r = await dn(e, t);
|
|
@@ -1786,7 +1786,7 @@ const pn = o.object({
|
|
|
1786
1786
|
}), mt = o.object({
|
|
1787
1787
|
id: o.string(),
|
|
1788
1788
|
taskId: o.string(),
|
|
1789
|
-
type: o.enum(
|
|
1789
|
+
type: o.enum(ho),
|
|
1790
1790
|
notifyUid: o.string().optional().describe("User ID the reminder notifies."),
|
|
1791
1791
|
minuteOffset: o.number().optional().describe("Minutes before due. Relative reminders only."),
|
|
1792
1792
|
due: fn.optional().describe("Absolute, and sometimes relative, reminders."),
|
|
@@ -1807,7 +1807,7 @@ const pn = o.object({
|
|
|
1807
1807
|
),
|
|
1808
1808
|
content: o.string().min(1).describe("The content of the comment."),
|
|
1809
1809
|
notifyUsers: o.array(o.string().min(1)).min(1).max(j.NOTIFY_USERS_MAX).optional().describe(
|
|
1810
|
-
`Who to notify about this comment — a user ID, email, full name, or "me" for each person. Set this whenever the comment mentions someone; the text of an @mention notifies nobody on its own. Omit to notify whoever the Todoist apps would (the task's assignee, assigner and creator on a first comment, or the previous comment's participants on a reply). Pass ["${
|
|
1810
|
+
`Who to notify about this comment — a user ID, email, full name, or "me" for each person. Set this whenever the comment mentions someone; the text of an @mention notifies nobody on its own. Omit to notify whoever the Todoist apps would (the task's assignee, assigner and creator on a first comment, or the previous comment's participants on a reply). Pass ["${xs}"] to notify nobody.`
|
|
1811
1811
|
)
|
|
1812
1812
|
}), gn = {
|
|
1813
1813
|
comments: o.array(bn).min(1).describe("The array of comments to add.")
|
|
@@ -1885,7 +1885,7 @@ async function kn({
|
|
|
1885
1885
|
return await Promise.all(
|
|
1886
1886
|
e.map(async ({ notifyUsers: i }, a) => {
|
|
1887
1887
|
if (i)
|
|
1888
|
-
return an(i) ? [] : (await
|
|
1888
|
+
return an(i) ? [] : (await Cs(s, i)).map((p) => p.userId);
|
|
1889
1889
|
const c = t[a];
|
|
1890
1890
|
if (!c || !r) return [];
|
|
1891
1891
|
const d = c.taskId ? `task:${c.taskId}` : `project:${c.projectId}`, u = n.get(d) ?? cn(s, c, r.id);
|
|
@@ -1912,7 +1912,7 @@ function wn({ comments: e }) {
|
|
|
1912
1912
|
function _(e) {
|
|
1913
1913
|
return o.string().transform((t) => t === "" ? void 0 : t).optional().describe(e);
|
|
1914
1914
|
}
|
|
1915
|
-
function
|
|
1915
|
+
function Es(e) {
|
|
1916
1916
|
return e.description || void 0;
|
|
1917
1917
|
}
|
|
1918
1918
|
const In = {
|
|
@@ -1949,7 +1949,7 @@ const In = {
|
|
|
1949
1949
|
id: a.id,
|
|
1950
1950
|
name: a.name,
|
|
1951
1951
|
query: a.query,
|
|
1952
|
-
description:
|
|
1952
|
+
description: Es(a),
|
|
1953
1953
|
color: be.parse(a.color),
|
|
1954
1954
|
isFavorite: a.isFavorite,
|
|
1955
1955
|
itemOrder: a.itemOrder
|
|
@@ -2163,10 +2163,10 @@ function V({
|
|
|
2163
2163
|
}) {
|
|
2164
2164
|
const d = [], u = `${e}: ${t}${typeof s == "number" ? ` (limit ${s})` : ""}${r ? ", more available" : ""}.`;
|
|
2165
2165
|
return d.push(u), n?.length && d.push(`Filter: ${n.join("; ")}.`), i?.length && d.push(`Preview:
|
|
2166
|
-
${i}`), !t && a?.length && d.push(`No results. ${a.join("; ")}.`), (c?.length || r) && d.push(
|
|
2166
|
+
${i}`), !t && a?.length && d.push(`No results. ${a.join("; ")}.`), (c?.length || r) && d.push(Os(c || [], r)), d.join(`
|
|
2167
2167
|
`);
|
|
2168
2168
|
}
|
|
2169
|
-
function
|
|
2169
|
+
function Os(e, t) {
|
|
2170
2170
|
const s = [...e];
|
|
2171
2171
|
return t && s.push(`Pass cursor '${t}' to fetch more results.`), `${s.length === 1 ? "Possible suggested next step:" : "Possible suggested next steps:"}
|
|
2172
2172
|
${s.map((n) => `- ${n}`).join(`
|
|
@@ -2237,7 +2237,7 @@ ${l}` + (d.length > 5 ? `
|
|
|
2237
2237
|
this.stateByClient = /* @__PURE__ */ new WeakMap();
|
|
2238
2238
|
}
|
|
2239
2239
|
}
|
|
2240
|
-
const
|
|
2240
|
+
const _s = new Hn(), Wn = o.object({
|
|
2241
2241
|
name: o.string().min(1).describe("The name of the project."),
|
|
2242
2242
|
parentId: o.string().optional().describe("The ID of the parent project. If provided, creates this as a sub-project."),
|
|
2243
2243
|
isFavorite: o.boolean().optional().describe("Whether the project is a favorite. Defaults to false."),
|
|
@@ -2270,7 +2270,7 @@ const Os = new Hn(), Wn = o.object({
|
|
|
2270
2270
|
return Promise.resolve(void 0);
|
|
2271
2271
|
let l = s.get(u);
|
|
2272
2272
|
return l || (l = P(
|
|
2273
|
-
() =>
|
|
2273
|
+
() => _s.resolveWorkspace(t, u)
|
|
2274
2274
|
).then(({ workspaceId: p }) => p), s.set(u, l)), l;
|
|
2275
2275
|
}, n = await Promise.allSettled(
|
|
2276
2276
|
e.map(async ({ workspace: u, ...l }) => {
|
|
@@ -2309,7 +2309,7 @@ function Yn({
|
|
|
2309
2309
|
${r}` : "Added 0 projects";
|
|
2310
2310
|
return yt(n, t);
|
|
2311
2311
|
}
|
|
2312
|
-
async function
|
|
2312
|
+
async function Us(e, t) {
|
|
2313
2313
|
const s = /* @__PURE__ */ new Map();
|
|
2314
2314
|
for (const n of t) {
|
|
2315
2315
|
const i = n?.trim();
|
|
@@ -2317,7 +2317,7 @@ async function _s(e, t) {
|
|
|
2317
2317
|
}
|
|
2318
2318
|
const r = /* @__PURE__ */ new Map();
|
|
2319
2319
|
for (const [n, i] of s) {
|
|
2320
|
-
const [a] = await
|
|
2320
|
+
const [a] = await Cs(e, [i]);
|
|
2321
2321
|
a && r.set(n, a.userId);
|
|
2322
2322
|
}
|
|
2323
2323
|
return t.map((n) => n?.trim() ? r.get(Le(n)) : void 0);
|
|
@@ -2325,7 +2325,7 @@ async function _s(e, t) {
|
|
|
2325
2325
|
function Le(e) {
|
|
2326
2326
|
return e.trim().toLowerCase();
|
|
2327
2327
|
}
|
|
2328
|
-
function
|
|
2328
|
+
function Ps(e, t) {
|
|
2329
2329
|
return e.flatMap((s, r) => {
|
|
2330
2330
|
const n = t[r];
|
|
2331
2331
|
return !n || s.notifyUid === n ? [] : [
|
|
@@ -2333,15 +2333,15 @@ function Us(e, t) {
|
|
|
2333
2333
|
];
|
|
2334
2334
|
});
|
|
2335
2335
|
}
|
|
2336
|
-
const $e = 25, Oe = o.enum(
|
|
2336
|
+
const $e = 25, Oe = o.enum(mo), Rs = o.object({
|
|
2337
2337
|
date: o.string().optional().describe("Due date in YYYY-MM-DD format."),
|
|
2338
2338
|
string: o.string().optional().describe('Natural language due string, e.g. "tomorrow at 3pm".'),
|
|
2339
2339
|
timezone: o.string().optional().describe('Timezone for the reminder, e.g. "America/New_York".'),
|
|
2340
2340
|
lang: o.string().optional().describe('Language for parsing the due string, e.g. "en".')
|
|
2341
|
-
}),
|
|
2342
|
-
`${
|
|
2341
|
+
}), Ls = o.enum(ss), _e = o.boolean().optional().describe("Whether this is an urgent reminder. Applies to relative and absolute reminders."), Ns = `Who to remind: user ID, email, name, or "me". Must collaborate on the task's project.`, Tt = _(
|
|
2342
|
+
`${Ns} Defaults to the creator.`
|
|
2343
2343
|
), kt = _(
|
|
2344
|
-
`${
|
|
2344
|
+
`${Ns} Omit to keep the current one.`
|
|
2345
2345
|
), qn = o.object({
|
|
2346
2346
|
type: o.literal("relative"),
|
|
2347
2347
|
taskId: o.string().min(1).describe("The ID of the task to set a reminder for."),
|
|
@@ -2356,7 +2356,7 @@ const $e = 25, Oe = o.enum(ho), Ps = o.object({
|
|
|
2356
2356
|
}), Gn = o.object({
|
|
2357
2357
|
type: o.literal("absolute"),
|
|
2358
2358
|
taskId: o.string().min(1).describe("The ID of the task to set a reminder for."),
|
|
2359
|
-
due:
|
|
2359
|
+
due: Rs.describe("The specific date/time for the reminder."),
|
|
2360
2360
|
service: Oe.optional().describe(
|
|
2361
2361
|
'Delivery method: "email" or "push" notification. Defaults to push.'
|
|
2362
2362
|
),
|
|
@@ -2368,7 +2368,7 @@ const $e = 25, Oe = o.enum(ho), Ps = o.object({
|
|
|
2368
2368
|
name: o.string().min(1).describe('Name of the location, e.g. "Office", "Home".'),
|
|
2369
2369
|
locLat: o.string().describe('Latitude of the location as a string, e.g. "37.7749".'),
|
|
2370
2370
|
locLong: o.string().describe('Longitude of the location as a string, e.g. "-122.4194".'),
|
|
2371
|
-
locTrigger:
|
|
2371
|
+
locTrigger: Ls.describe(
|
|
2372
2372
|
'When to trigger: "on_enter" (arriving) or "on_leave" (departing).'
|
|
2373
2373
|
),
|
|
2374
2374
|
radius: o.number().int().optional().describe("Radius in meters for the geofence. Defaults to server default."),
|
|
@@ -2397,7 +2397,7 @@ const $e = 25, Oe = o.enum(ho), Ps = o.object({
|
|
|
2397
2397
|
openWorldHint: !0
|
|
2398
2398
|
},
|
|
2399
2399
|
async execute(e, t) {
|
|
2400
|
-
const { reminders: s } = e, r = await
|
|
2400
|
+
const { reminders: s } = e, r = await Us(
|
|
2401
2401
|
t,
|
|
2402
2402
|
s.map((d) => d.notifyUser)
|
|
2403
2403
|
), n = s.map(async (d, u) => {
|
|
@@ -2436,7 +2436,7 @@ const $e = 25, Oe = o.enum(ho), Ps = o.object({
|
|
|
2436
2436
|
return {
|
|
2437
2437
|
textContent: [
|
|
2438
2438
|
ei(a),
|
|
2439
|
-
...
|
|
2439
|
+
...Ps(a, r)
|
|
2440
2440
|
].join(`
|
|
2441
2441
|
`),
|
|
2442
2442
|
structuredContent: {
|
|
@@ -2448,7 +2448,7 @@ const $e = 25, Oe = o.enum(ho), Ps = o.object({
|
|
|
2448
2448
|
}
|
|
2449
2449
|
};
|
|
2450
2450
|
function ei(e) {
|
|
2451
|
-
const { timeBasedCount: t, locationCount: s } =
|
|
2451
|
+
const { timeBasedCount: t, locationCount: s } = As(e), r = [];
|
|
2452
2452
|
if (t > 0) {
|
|
2453
2453
|
const n = t > 1 ? "reminders" : "reminder";
|
|
2454
2454
|
r.push(`${t} time-based ${n}`);
|
|
@@ -2738,7 +2738,7 @@ class ii {
|
|
|
2738
2738
|
};
|
|
2739
2739
|
}
|
|
2740
2740
|
}
|
|
2741
|
-
const wt = new ii(), Nt =
|
|
2741
|
+
const wt = new ii(), Nt = as.TASKS_PER_OPERATION, ai = o.object({
|
|
2742
2742
|
content: o.string().min(1).describe(
|
|
2743
2743
|
'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.'
|
|
2744
2744
|
),
|
|
@@ -2752,7 +2752,7 @@ const wt = new ii(), Nt = is.TASKS_PER_OPERATION, ai = o.object({
|
|
|
2752
2752
|
deadlineDate: _(
|
|
2753
2753
|
'The deadline date for the task in ISO 8601 format (YYYY-MM-DD, e.g., "2025-12-31"). Deadlines are immovable constraints shown with a different indicator than due dates.'
|
|
2754
2754
|
),
|
|
2755
|
-
duration: _(
|
|
2755
|
+
duration: _(ys),
|
|
2756
2756
|
labels: o.array(o.string()).optional().describe("The labels to attach to the task."),
|
|
2757
2757
|
projectId: _(
|
|
2758
2758
|
'The project ID to add this task to. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
@@ -2820,7 +2820,7 @@ const wt = new ii(), Nt = is.TASKS_PER_OPERATION, ai = o.object({
|
|
|
2820
2820
|
}));
|
|
2821
2821
|
if (c.length === 0 && d.length > 0) {
|
|
2822
2822
|
const h = d.map((y) => `"${y.item}": ${y.error}`).join("; "), m = `All ${d.length} task(s) failed to create: ${h}`;
|
|
2823
|
-
throw u ? new
|
|
2823
|
+
throw u ? new us(m) : new Error(m);
|
|
2824
2824
|
}
|
|
2825
2825
|
const l = c.map(R);
|
|
2826
2826
|
return re(g.ADD_TASKS, s.length, d, { redactItems: !0 }), {
|
|
@@ -2872,13 +2872,13 @@ async function ui(e, t, s) {
|
|
|
2872
2872
|
labels: l,
|
|
2873
2873
|
deadlineDate: p
|
|
2874
2874
|
};
|
|
2875
|
-
if (u && (y.priority =
|
|
2875
|
+
if (u && (y.priority = ws(u)), d && !m && !i && !a)
|
|
2876
2876
|
throw new Error(
|
|
2877
2877
|
`Task "${e.content}": Cannot assign tasks without specifying project context. Please specify a projectId, sectionId, or parentId.`
|
|
2878
2878
|
);
|
|
2879
2879
|
if (r)
|
|
2880
2880
|
try {
|
|
2881
|
-
const { amount: f, unit: T } =
|
|
2881
|
+
const { amount: f, unit: T } = ks(r);
|
|
2882
2882
|
y = {
|
|
2883
2883
|
...y,
|
|
2884
2884
|
duration: f,
|
|
@@ -3047,7 +3047,7 @@ function Ti({
|
|
|
3047
3047
|
failures: t
|
|
3048
3048
|
});
|
|
3049
3049
|
}
|
|
3050
|
-
const
|
|
3050
|
+
const Ms = [
|
|
3051
3051
|
"project",
|
|
3052
3052
|
"section",
|
|
3053
3053
|
"task",
|
|
@@ -3057,11 +3057,11 @@ const Ns = [
|
|
|
3057
3057
|
"reminder",
|
|
3058
3058
|
"location_reminder"
|
|
3059
3059
|
], ki = {
|
|
3060
|
-
type: o.enum(
|
|
3060
|
+
type: o.enum(Ms).describe("The type of entity to delete."),
|
|
3061
3061
|
id: o.string().min(1).describe("The ID of the entity to delete.")
|
|
3062
3062
|
}, wi = {
|
|
3063
3063
|
deletedEntity: o.object({
|
|
3064
|
-
type: o.enum(
|
|
3064
|
+
type: o.enum(Ms).describe("The type of deleted entity."),
|
|
3065
3065
|
id: o.string().describe("The ID of the deleted entity.")
|
|
3066
3066
|
}).describe("Information about the deleted entity."),
|
|
3067
3067
|
success: o.boolean().describe("Whether the deletion was successful.")
|
|
@@ -3112,16 +3112,16 @@ const Ns = [
|
|
|
3112
3112
|
}
|
|
3113
3113
|
};
|
|
3114
3114
|
}
|
|
3115
|
-
}, Ft = 5,
|
|
3115
|
+
}, Ft = 5, Fs = ["file", "url"], vi = {
|
|
3116
3116
|
projectId: o.string().min(1).describe("The ID of the project to export as a template."),
|
|
3117
|
-
format: o.enum(
|
|
3117
|
+
format: o.enum(Fs).default("file").describe(
|
|
3118
3118
|
'How to return the template. "file" returns the CSV content, which can be passed straight back to import-project-template. "url" returns a shareable download link instead, and is the better choice for large projects because it does not return the whole file.'
|
|
3119
3119
|
),
|
|
3120
3120
|
useRelativeDates: o.boolean().optional().describe(
|
|
3121
3121
|
'Export due dates relative to the import date (e.g. "day 3") instead of absolute dates. Defaults to false.'
|
|
3122
3122
|
)
|
|
3123
3123
|
}, Si = {
|
|
3124
|
-
format: o.enum(
|
|
3124
|
+
format: o.enum(Fs).describe("The format the template was exported in."),
|
|
3125
3125
|
content: o.string().optional().describe('The template as CSV content. Only present when format is "file".'),
|
|
3126
3126
|
lineCount: o.number().optional().describe('Number of rows in the exported CSV. Only present when format is "file".'),
|
|
3127
3127
|
fileName: o.string().optional().describe('The generated template file name. Only present when format is "url".'),
|
|
@@ -3225,7 +3225,7 @@ async function xi(e, t) {
|
|
|
3225
3225
|
async function Ei(e, t) {
|
|
3226
3226
|
if (!Y(t))
|
|
3227
3227
|
return { childCount: 0, children: [] };
|
|
3228
|
-
const s = await
|
|
3228
|
+
const s = await Ds(e), r = /* @__PURE__ */ new Map();
|
|
3229
3229
|
for (const a of s) {
|
|
3230
3230
|
if (!Y(a) || !a.parentId) continue;
|
|
3231
3231
|
const c = r.get(a.parentId) ?? [];
|
|
@@ -3255,14 +3255,14 @@ function Wt(e, t) {
|
|
|
3255
3255
|
const s = t.hasMoreChildren ? "+" : "", r = t.childrenError ? " (partial)" : "";
|
|
3256
3256
|
return ` • ${e}=${t.childCount}${s}${r}`;
|
|
3257
3257
|
}
|
|
3258
|
-
const
|
|
3259
|
-
type: o.enum(
|
|
3258
|
+
const Hs = ["task", "project", "comment", "section"], Oi = {
|
|
3259
|
+
type: o.enum(Hs).describe("The type of object to fetch."),
|
|
3260
3260
|
id: o.string().min(1).describe("The unique ID of the object to fetch."),
|
|
3261
3261
|
includeChildren: o.boolean().optional().describe(
|
|
3262
3262
|
"Also return the direct children of the object: subtasks for a task, sub-projects for a project. Returns childCount plus a compact list, flagging each child that has children of its own. Use this to check whether a task hides subtasks instead of a speculative find-tasks lookup. Ignored for comments and sections."
|
|
3263
3263
|
)
|
|
3264
3264
|
}, _i = {
|
|
3265
|
-
type: o.enum(
|
|
3265
|
+
type: o.enum(Hs).describe("The type of object fetched."),
|
|
3266
3266
|
id: o.string().describe("The ID of the fetched object."),
|
|
3267
3267
|
object: o.union([K, se, ve, q]).describe("The fetched object data."),
|
|
3268
3268
|
...Ai
|
|
@@ -3417,9 +3417,9 @@ function Bt(e) {
|
|
|
3417
3417
|
return _(e).pipe(Ni.optional());
|
|
3418
3418
|
}
|
|
3419
3419
|
const Mi = {
|
|
3420
|
-
objectType: o.enum(
|
|
3421
|
-
objectId: o.string().optional().describe("Filter by specific object ID (task, project, or comment)."),
|
|
3422
|
-
eventType: o.enum(
|
|
3420
|
+
objectType: o.enum(ns).optional().describe("Type of object to filter by."),
|
|
3421
|
+
objectId: o.string().optional().describe("Filter by specific object ID (task, project, or comment). Requires objectType."),
|
|
3422
|
+
eventType: o.enum(fo).optional().describe("Type of event to filter by."),
|
|
3423
3423
|
projectId: o.string().optional().describe("Filter events by parent project ID."),
|
|
3424
3424
|
taskId: o.string().optional().describe("Filter events by parent task ID (for subtask events)."),
|
|
3425
3425
|
initiatorId: o.string().optional().describe(
|
|
@@ -3457,7 +3457,12 @@ const Mi = {
|
|
|
3457
3457
|
dateTo: u,
|
|
3458
3458
|
limit: l,
|
|
3459
3459
|
cursor: p
|
|
3460
|
-
} = e
|
|
3460
|
+
} = e;
|
|
3461
|
+
if (r && r !== "remove" && !s)
|
|
3462
|
+
throw new Error(
|
|
3463
|
+
`objectId requires objectType, one of: ${ns.join(", ")}.`
|
|
3464
|
+
);
|
|
3465
|
+
const h = {
|
|
3461
3466
|
limit: l,
|
|
3462
3467
|
cursor: p ?? null
|
|
3463
3468
|
};
|
|
@@ -3627,13 +3632,13 @@ function Vi({
|
|
|
3627
3632
|
i = `Found ${e.length} ${d} for ${t} ${s}${c}`, r && (i += " • More available");
|
|
3628
3633
|
}
|
|
3629
3634
|
if (n) {
|
|
3630
|
-
const a =
|
|
3635
|
+
const a = Os([], n);
|
|
3631
3636
|
return `${i}
|
|
3632
3637
|
${a}`;
|
|
3633
3638
|
}
|
|
3634
3639
|
return i;
|
|
3635
3640
|
}
|
|
3636
|
-
function
|
|
3641
|
+
function Ws(e) {
|
|
3637
3642
|
const t = e.getUTCFullYear(), s = String(e.getUTCMonth() + 1).padStart(2, "0"), r = String(e.getUTCDate()).padStart(2, "0");
|
|
3638
3643
|
return `${t}-${s}-${r}`;
|
|
3639
3644
|
}
|
|
@@ -3646,14 +3651,14 @@ function Ji(e) {
|
|
|
3646
3651
|
}
|
|
3647
3652
|
function Xi(e, t) {
|
|
3648
3653
|
const s = new Date(e.getTime() + t * 60 * 1e3);
|
|
3649
|
-
return
|
|
3654
|
+
return Ws(s);
|
|
3650
3655
|
}
|
|
3651
3656
|
function zt(e, t) {
|
|
3652
3657
|
const [s, r, n] = e.split("-"), i = Number(s), a = Number(r), c = Number(n);
|
|
3653
3658
|
if (!Number.isFinite(i) || !Number.isFinite(a) || !Number.isFinite(c))
|
|
3654
3659
|
throw new Error(`Invalid date format: ${e}. Expected YYYY-MM-DD.`);
|
|
3655
3660
|
const d = new Date(Date.UTC(i, a - 1, c));
|
|
3656
|
-
return d.setUTCDate(d.getUTCDate() + t),
|
|
3661
|
+
return d.setUTCDate(d.getUTCDate() + t), Ws(d);
|
|
3657
3662
|
}
|
|
3658
3663
|
const Qi = ["and", "or"], It = {
|
|
3659
3664
|
labels: o.string().array().optional().describe("The labels to filter the tasks by"),
|
|
@@ -3872,7 +3877,7 @@ No shared labels.`;
|
|
|
3872
3877
|
zeroReasonHints: p
|
|
3873
3878
|
}) + h;
|
|
3874
3879
|
}
|
|
3875
|
-
const { FIND_PROJECTS:
|
|
3880
|
+
const { FIND_PROJECTS: Bs, ADD_TASKS: zs, UPDATE_TASKS: Ks } = g, da = {
|
|
3876
3881
|
projectId: o.string().min(1).optional().describe(
|
|
3877
3882
|
'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.'
|
|
3878
3883
|
),
|
|
@@ -3909,7 +3914,7 @@ const { FIND_PROJECTS: Ws, ADD_TASKS: Bs, UPDATE_TASKS: zs } = g, da = {
|
|
|
3909
3914
|
|
|
3910
3915
|
**Next steps:**
|
|
3911
3916
|
• Share the project to enable collaboration
|
|
3912
|
-
• Use ${
|
|
3917
|
+
• Use ${zs} and ${Ks} for assignment features once shared`,
|
|
3913
3918
|
structuredContent: {
|
|
3914
3919
|
collaborators: [],
|
|
3915
3920
|
projectInfo: {
|
|
@@ -3946,9 +3951,9 @@ const { FIND_PROJECTS: Ws, ADD_TASKS: Bs, UPDATE_TASKS: zs } = g, da = {
|
|
|
3946
3951
|
appliedFilters: e
|
|
3947
3952
|
}
|
|
3948
3953
|
};
|
|
3949
|
-
const c =
|
|
3954
|
+
const c = Ys(a, r);
|
|
3950
3955
|
return {
|
|
3951
|
-
textContent:
|
|
3956
|
+
textContent: qs({
|
|
3952
3957
|
collaborators: c,
|
|
3953
3958
|
projectName: n,
|
|
3954
3959
|
searchTerm: r,
|
|
@@ -3979,7 +3984,7 @@ async function pa({
|
|
|
3979
3984
|
textContent: `No users found. You may have no shared projects, or collaborator data is not accessible.
|
|
3980
3985
|
|
|
3981
3986
|
**Next steps:**
|
|
3982
|
-
• Use ${
|
|
3987
|
+
• Use ${Bs} to find shared projects
|
|
3983
3988
|
• Share a project to add collaborators
|
|
3984
3989
|
• Ensure you have permission to view collaborators`,
|
|
3985
3990
|
structuredContent: {
|
|
@@ -3990,9 +3995,9 @@ async function pa({
|
|
|
3990
3995
|
appliedFilters: s
|
|
3991
3996
|
}
|
|
3992
3997
|
};
|
|
3993
|
-
const i =
|
|
3998
|
+
const i = Ys(n, e);
|
|
3994
3999
|
return {
|
|
3995
|
-
textContent:
|
|
4000
|
+
textContent: qs({
|
|
3996
4001
|
collaborators: i,
|
|
3997
4002
|
projectName: void 0,
|
|
3998
4003
|
searchTerm: e,
|
|
@@ -4018,7 +4023,7 @@ async function ha(e, t) {
|
|
|
4018
4023
|
return t;
|
|
4019
4024
|
}
|
|
4020
4025
|
}
|
|
4021
|
-
function
|
|
4026
|
+
function Ys(e, t) {
|
|
4022
4027
|
if (!t)
|
|
4023
4028
|
return e;
|
|
4024
4029
|
const s = t.toLowerCase().trim();
|
|
@@ -4026,7 +4031,7 @@ function Ks(e, t) {
|
|
|
4026
4031
|
(r) => r.name.toLowerCase().includes(s) || r.email.toLowerCase().includes(s)
|
|
4027
4032
|
);
|
|
4028
4033
|
}
|
|
4029
|
-
function
|
|
4034
|
+
function qs({
|
|
4030
4035
|
collaborators: e,
|
|
4031
4036
|
projectName: t,
|
|
4032
4037
|
searchTerm: s,
|
|
@@ -4042,7 +4047,7 @@ function Ys({
|
|
|
4042
4047
|
const u = [];
|
|
4043
4048
|
e.length === 0 && s && (u.push(`No users match "${s}"`), u.push("Try a broader search term or check spelling"), r > 0 && u.push(`${r} users available without filter`));
|
|
4044
4049
|
const l = [];
|
|
4045
|
-
return e.length > 0 ? (l.push(`Use ${
|
|
4050
|
+
return e.length > 0 ? (l.push(`Use ${zs} with responsibleUser to assign new tasks`), l.push(`Use ${Ks} with responsibleUser to reassign existing tasks`), l.push("Use user names, emails, or IDs for assignments")) : (l.push(`Use ${Bs} to find other projects`), s && r > 0 && l.push("Try searching without filters to see all users")), V({
|
|
4046
4051
|
subject: a,
|
|
4047
4052
|
count: e.length,
|
|
4048
4053
|
filterHints: c,
|
|
@@ -4084,7 +4089,7 @@ const { ADD_PROJECTS: Kt } = g, ma = {
|
|
|
4084
4089
|
let n, i = null;
|
|
4085
4090
|
if (s || r === "all") {
|
|
4086
4091
|
const c = Promise.resolve([]), [d, u] = await Promise.all([
|
|
4087
|
-
r === "archived" ? c : s ?
|
|
4092
|
+
r === "archived" ? c : s ? $s(t, s) : Ds(t),
|
|
4088
4093
|
r === "active" ? c : Zr(t)
|
|
4089
4094
|
]), l = s ? en(s) : null, p = l ? u.filter((h) => l.test(h.name)) : u;
|
|
4090
4095
|
n = [...d, ...p];
|
|
@@ -4204,7 +4209,7 @@ const Ta = {
|
|
|
4204
4209
|
function Ia(e, t) {
|
|
4205
4210
|
if (e.length === 0)
|
|
4206
4211
|
return `No reminders found for task ${t}`;
|
|
4207
|
-
const { timeBasedCount: s, locationCount: r } =
|
|
4212
|
+
const { timeBasedCount: s, locationCount: r } = As(e), n = [];
|
|
4208
4213
|
if (s > 0) {
|
|
4209
4214
|
const i = s > 1 ? "time-based reminders" : "time-based reminder";
|
|
4210
4215
|
n.push(`${s} ${i}`);
|
|
@@ -4272,7 +4277,7 @@ function $a({
|
|
|
4272
4277
|
zeroReasonHints: r
|
|
4273
4278
|
});
|
|
4274
4279
|
}
|
|
4275
|
-
function
|
|
4280
|
+
function Gs(e) {
|
|
4276
4281
|
return /* @__PURE__ */ new Date(`${e}T00:00:00`);
|
|
4277
4282
|
}
|
|
4278
4283
|
const Da = {
|
|
@@ -4292,7 +4297,7 @@ const Da = {
|
|
|
4292
4297
|
responsibleUser: o.string().optional().describe(
|
|
4293
4298
|
"Filter tasks assigned to this user. User ID, name, or email. The current user also includes unassigned tasks."
|
|
4294
4299
|
),
|
|
4295
|
-
responsibleUserFiltering: o.enum(
|
|
4300
|
+
responsibleUserFiltering: o.enum(js).optional().describe(
|
|
4296
4301
|
"Filter when responsibleUser is omitted. 'assigned'=assigned to others; 'unassignedOrMe'=unassigned+mine; 'all'=everyone. Default: 'unassignedOrMe'."
|
|
4297
4302
|
),
|
|
4298
4303
|
...It
|
|
@@ -4314,7 +4319,7 @@ const Da = {
|
|
|
4314
4319
|
throw new Error(
|
|
4315
4320
|
"Either startDate must be provided or overdueOption must be set to overdue-only"
|
|
4316
4321
|
);
|
|
4317
|
-
const r = await ut(t, e.responsibleUser), n = r?.userId, i = r?.email, c = e.responsibleUser?.trim().toLowerCase() ===
|
|
4322
|
+
const r = await ut(t, e.responsibleUser), n = r?.userId, i = r?.email, c = e.responsibleUser?.trim().toLowerCase() === Ss ? n : n ? (await t.getUser()).id : void 0;
|
|
4318
4323
|
let d = "";
|
|
4319
4324
|
if (e.overdueOption === "overdue-only")
|
|
4320
4325
|
d = "overdue";
|
|
@@ -4325,7 +4330,7 @@ const Da = {
|
|
|
4325
4330
|
} else
|
|
4326
4331
|
d = e.overdueOption === "exclude-overdue" ? "today" : "(today | overdue)";
|
|
4327
4332
|
else if (e.startDate) {
|
|
4328
|
-
const y = e.startDate, f = ze(
|
|
4333
|
+
const y = e.startDate, f = ze(Gs(y), e.daysCount), T = St(f, { representation: "date" });
|
|
4329
4334
|
d = `(due after: ${y} | due: ${y}) & due before: ${T}`;
|
|
4330
4335
|
}
|
|
4331
4336
|
const u = vt(e.labels, e.labelsOperator);
|
|
@@ -4370,7 +4375,7 @@ function Ea({
|
|
|
4370
4375
|
`today${c}${t.daysCount > 1 ? ` + ${t.daysCount - 1} more days` : ""}`
|
|
4371
4376
|
);
|
|
4372
4377
|
} else if (t.startDate) {
|
|
4373
|
-
const c = t.daysCount > 1 ? ` to ${pe(ze(
|
|
4378
|
+
const c = t.daysCount > 1 ? ` to ${pe(ze(Gs(t.startDate), t.daysCount))}` : "";
|
|
4374
4379
|
n.push(`${t.startDate}${c}`);
|
|
4375
4380
|
}
|
|
4376
4381
|
if (t.labels && t.labels.length > 0) {
|
|
@@ -4479,7 +4484,7 @@ const Ua = new _a(), { FIND_COMPLETED_TASKS: Yt, ADD_TASKS: qt } = g, Pa = {
|
|
|
4479
4484
|
responsibleUser: o.string().optional().describe(
|
|
4480
4485
|
"Find tasks assigned to this user. Can be a user ID, name, or email address. The current user also includes unassigned tasks."
|
|
4481
4486
|
),
|
|
4482
|
-
responsibleUserFiltering: o.enum(
|
|
4487
|
+
responsibleUserFiltering: o.enum(js).optional().describe(
|
|
4483
4488
|
'How to filter by responsible user when responsibleUser is not provided. "assigned" = only tasks assigned to others; "unassignedOrMe" = only unassigned tasks or tasks assigned to me; "all" = all tasks regardless of assignment. Default value will be `unassignedOrMe`.'
|
|
4484
4489
|
),
|
|
4485
4490
|
limit: o.number().int().min(1).max(j.TASKS_MAX).default(j.TASKS_DEFAULT).describe("The maximum number of tasks to return."),
|
|
@@ -4601,7 +4606,7 @@ const Ua = new _a(), { FIND_COMPLETED_TASKS: Yt, ADD_TASKS: qt } = g, Pa = {
|
|
|
4601
4606
|
};
|
|
4602
4607
|
}
|
|
4603
4608
|
let $ = C ? `(${C})` : "";
|
|
4604
|
-
s && ($ = me($, `search: ${
|
|
4609
|
+
s && ($ = me($, `search: ${is(s)}`));
|
|
4605
4610
|
const w = vt(l, p);
|
|
4606
4611
|
if ($ = me($, w), !(m && !a && !c)) {
|
|
4607
4612
|
const O = tt({
|
|
@@ -4704,7 +4709,7 @@ const Ma = {
|
|
|
4704
4709
|
projectId: o.string().min(1).optional().describe(
|
|
4705
4710
|
`Optional project ID. Use "inbox" for the Inbox. If provided, returns that project's tasks grouped by section. If omitted, returns the project and section structure for the whole account with no tasks.`
|
|
4706
4711
|
)
|
|
4707
|
-
},
|
|
4712
|
+
}, Vs = o.lazy(
|
|
4708
4713
|
() => o.object({
|
|
4709
4714
|
id: o.string().describe("The project ID."),
|
|
4710
4715
|
name: o.string().describe("The project name."),
|
|
@@ -4712,7 +4717,7 @@ const Ma = {
|
|
|
4712
4717
|
folderId: o.string().optional().describe("The folder ID this project belongs to (workspace projects only)."),
|
|
4713
4718
|
childOrder: o.number().describe("The ordering index among siblings."),
|
|
4714
4719
|
sections: o.array(q),
|
|
4715
|
-
children: o.array(
|
|
4720
|
+
children: o.array(Vs).describe("Nested child projects.")
|
|
4716
4721
|
})
|
|
4717
4722
|
), Fa = {
|
|
4718
4723
|
type: o.enum(["account_overview", "project_overview"]).describe("The type of overview returned."),
|
|
@@ -4733,7 +4738,7 @@ const Ma = {
|
|
|
4733
4738
|
name: o.string().describe("The inbox project name."),
|
|
4734
4739
|
sections: o.array(q).describe("Sections in the inbox project.")
|
|
4735
4740
|
}).optional().describe("Inbox information (account overview only)."),
|
|
4736
|
-
projects: o.array(o.lazy(() =>
|
|
4741
|
+
projects: o.array(o.lazy(() => Vs)).optional().describe(
|
|
4737
4742
|
"List of projects with hierarchy, folders, and ordering (account overview only)."
|
|
4738
4743
|
),
|
|
4739
4744
|
project: o.object({
|
|
@@ -4782,14 +4787,14 @@ async function Wa(e, t) {
|
|
|
4782
4787
|
})
|
|
4783
4788
|
), s;
|
|
4784
4789
|
}
|
|
4785
|
-
function
|
|
4790
|
+
function Js(e, t, s = "") {
|
|
4786
4791
|
const r = [];
|
|
4787
4792
|
r.push(`${s}- Project: ${e.name} (id=${e.id})`);
|
|
4788
4793
|
const n = t[e.id] || [];
|
|
4789
4794
|
for (const i of n)
|
|
4790
4795
|
r.push(`${s} - Section: ${i.name} (id=${i.id})`);
|
|
4791
4796
|
for (const i of e.children)
|
|
4792
|
-
r.push(...
|
|
4797
|
+
r.push(...Js(i, t, `${s} `));
|
|
4793
4798
|
return r;
|
|
4794
4799
|
}
|
|
4795
4800
|
function Gt(e) {
|
|
@@ -4817,7 +4822,7 @@ function st(e, t = "") {
|
|
|
4817
4822
|
}
|
|
4818
4823
|
return s;
|
|
4819
4824
|
}
|
|
4820
|
-
function
|
|
4825
|
+
function Xs(e, t) {
|
|
4821
4826
|
return {
|
|
4822
4827
|
id: e.id,
|
|
4823
4828
|
name: e.name,
|
|
@@ -4826,7 +4831,7 @@ function Js(e, t) {
|
|
|
4826
4831
|
childOrder: e.childOrder,
|
|
4827
4832
|
sections: (t[e.id] || []).map(G),
|
|
4828
4833
|
children: e.children.map(
|
|
4829
|
-
(s) =>
|
|
4834
|
+
(s) => Xs(s, t)
|
|
4830
4835
|
)
|
|
4831
4836
|
};
|
|
4832
4837
|
}
|
|
@@ -4855,7 +4860,7 @@ async function Ka(e) {
|
|
|
4855
4860
|
}
|
|
4856
4861
|
if (n.length)
|
|
4857
4862
|
for (const p of n)
|
|
4858
|
-
c.push(...
|
|
4863
|
+
c.push(...Js(p, a));
|
|
4859
4864
|
else
|
|
4860
4865
|
c.push("_No projects found._");
|
|
4861
4866
|
c.push(""), c.push(
|
|
@@ -4876,7 +4881,7 @@ async function Ka(e) {
|
|
|
4876
4881
|
sections: (a[s.id] || []).map(G)
|
|
4877
4882
|
} : void 0,
|
|
4878
4883
|
projects: n.map(
|
|
4879
|
-
(p) =>
|
|
4884
|
+
(p) => Xs(p, a)
|
|
4880
4885
|
),
|
|
4881
4886
|
totalProjects: t.length,
|
|
4882
4887
|
totalSections: i.reduce(
|
|
@@ -5290,7 +5295,7 @@ const ac = {
|
|
|
5290
5295
|
idempotentHint: !0
|
|
5291
5296
|
},
|
|
5292
5297
|
async execute(e, t) {
|
|
5293
|
-
const { workspaceIdOrName: s, projectIds: r } = e, n = await
|
|
5298
|
+
const { workspaceIdOrName: s, projectIds: r } = e, n = await _s.resolveWorkspace(t, s), a = (await t.getWorkspaceInsights(n.workspaceId, { projectIds: r })).projectInsights.map((d) => ({
|
|
5294
5299
|
projectId: d.projectId,
|
|
5295
5300
|
health: d.health ? {
|
|
5296
5301
|
status: d.health.status,
|
|
@@ -5465,9 +5470,9 @@ const Ic = {
|
|
|
5465
5470
|
structuredContent: s.structuredContent
|
|
5466
5471
|
};
|
|
5467
5472
|
}
|
|
5468
|
-
}, { FIND_TASKS: vc, FIND_PROJECT_COLLABORATORS: Jt, UPDATE_TASKS: Sc } = g,
|
|
5473
|
+
}, { FIND_TASKS: vc, FIND_PROJECT_COLLABORATORS: Jt, UPDATE_TASKS: Sc } = g, Qs = 50, Cc = {
|
|
5469
5474
|
operation: o.enum(["assign", "unassign", "reassign"]).describe("The assignment operation to perform."),
|
|
5470
|
-
taskIds: o.array(o.string()).min(1).max(
|
|
5475
|
+
taskIds: o.array(o.string()).min(1).max(Qs).describe("The IDs of the tasks to operate on (max 50)."),
|
|
5471
5476
|
responsibleUser: o.string().optional().describe(
|
|
5472
5477
|
'The user to assign tasks to. Can be "me" (assigns to current user), a user ID, name, or email. Required for assign and reassign operations.'
|
|
5473
5478
|
),
|
|
@@ -5493,7 +5498,7 @@ const Ic = {
|
|
|
5493
5498
|
}).optional().describe("Summary of the operation.")
|
|
5494
5499
|
}, $c = {
|
|
5495
5500
|
name: g.MANAGE_ASSIGNMENTS,
|
|
5496
|
-
description: `Assign, unassign or reassign up to ${
|
|
5501
|
+
description: `Assign, unassign or reassign up to ${Qs} tasks at once. Assigning notifies the new assignee. Each task is updated independently, so one failure does not undo the others; failures are reported per task. Use dryRun to check the changes first.`,
|
|
5497
5502
|
parameters: Cc,
|
|
5498
5503
|
outputSchema: jc,
|
|
5499
5504
|
// Open world: assigning a task notifies the new assignee.
|
|
@@ -5798,8 +5803,8 @@ const Dc = {
|
|
|
5798
5803
|
}
|
|
5799
5804
|
};
|
|
5800
5805
|
}
|
|
5801
|
-
},
|
|
5802
|
-
type: o.enum(
|
|
5806
|
+
}, Zs = ["project", "section"], Uc = {
|
|
5807
|
+
type: o.enum(Zs).describe(
|
|
5803
5808
|
'The type of entity to reorder. "project" reorders sibling projects within the same parent (and can move projects to a new parent). "section" reorders sections within the same project.'
|
|
5804
5809
|
),
|
|
5805
5810
|
items: o.array(
|
|
@@ -5816,7 +5821,7 @@ const Dc = {
|
|
|
5816
5821
|
"The items to reorder or move. Each item must have at least order or parentId. Items with parentId will be moved first, then items with order will be reordered. All items being reordered should be siblings for predictable results."
|
|
5817
5822
|
)
|
|
5818
5823
|
}, Pc = {
|
|
5819
|
-
type: o.enum(
|
|
5824
|
+
type: o.enum(Zs).describe("The type of entity that was reordered/moved."),
|
|
5820
5825
|
movedCount: o.number().describe("The number of entities moved to a new parent."),
|
|
5821
5826
|
reorderedCount: o.number().describe("The number of entities reordered."),
|
|
5822
5827
|
affectedIds: o.array(o.string()).describe("The IDs of all affected entities."),
|
|
@@ -5974,11 +5979,11 @@ const Wc = {
|
|
|
5974
5979
|
const { query: s } = e, [r, n] = await Promise.all([
|
|
5975
5980
|
ht({
|
|
5976
5981
|
client: t,
|
|
5977
|
-
query: `search: ${
|
|
5982
|
+
query: `search: ${is(s)}`,
|
|
5978
5983
|
limit: j.TASKS_MAX,
|
|
5979
5984
|
cursor: void 0
|
|
5980
5985
|
}),
|
|
5981
|
-
|
|
5986
|
+
$s(t, s)
|
|
5982
5987
|
]), i = [];
|
|
5983
5988
|
for (const a of r.tasks)
|
|
5984
5989
|
i.push({
|
|
@@ -6160,7 +6165,7 @@ const ed = o.object({
|
|
|
6160
6165
|
id: h.id,
|
|
6161
6166
|
name: h.name,
|
|
6162
6167
|
query: h.query,
|
|
6163
|
-
description:
|
|
6168
|
+
description: Es(h),
|
|
6164
6169
|
color: be.parse(h.color),
|
|
6165
6170
|
isFavorite: h.isFavorite,
|
|
6166
6171
|
itemOrder: h.itemOrder
|
|
@@ -6407,7 +6412,7 @@ const wd = o.object({
|
|
|
6407
6412
|
}), Id = o.object({
|
|
6408
6413
|
type: o.literal("absolute"),
|
|
6409
6414
|
id: o.string().min(1).describe("The ID of the absolute reminder to update."),
|
|
6410
|
-
due:
|
|
6415
|
+
due: Rs.optional().describe("New due date/time for the reminder."),
|
|
6411
6416
|
service: Oe.optional().describe('New delivery method: "email" or "push".'),
|
|
6412
6417
|
isUrgent: _e,
|
|
6413
6418
|
notifyUser: kt
|
|
@@ -6417,7 +6422,7 @@ const wd = o.object({
|
|
|
6417
6422
|
name: o.string().optional().describe("New location name."),
|
|
6418
6423
|
locLat: o.string().optional().describe("New latitude."),
|
|
6419
6424
|
locLong: o.string().optional().describe("New longitude."),
|
|
6420
|
-
locTrigger:
|
|
6425
|
+
locTrigger: Ls.optional().describe(
|
|
6421
6426
|
'New trigger condition: "on_enter" or "on_leave".'
|
|
6422
6427
|
),
|
|
6423
6428
|
radius: o.number().int().optional().describe("New radius in meters."),
|
|
@@ -6446,7 +6451,7 @@ const wd = o.object({
|
|
|
6446
6451
|
openWorldHint: !0
|
|
6447
6452
|
},
|
|
6448
6453
|
async execute(e, t) {
|
|
6449
|
-
const { reminders: s } = e, r = await
|
|
6454
|
+
const { reminders: s } = e, r = await Us(
|
|
6450
6455
|
t,
|
|
6451
6456
|
s.map((u) => u.notifyUser)
|
|
6452
6457
|
), n = s.map(async (u, l) => {
|
|
@@ -6477,7 +6482,7 @@ const wd = o.object({
|
|
|
6477
6482
|
return {
|
|
6478
6483
|
textContent: [
|
|
6479
6484
|
`Updated ${a.length} ${c}`,
|
|
6480
|
-
...
|
|
6485
|
+
...Ps(a, r)
|
|
6481
6486
|
].join(`
|
|
6482
6487
|
`),
|
|
6483
6488
|
structuredContent: {
|
|
@@ -6542,7 +6547,7 @@ function Od({ sections: e }) {
|
|
|
6542
6547
|
return `Updated ${t} section${t === 1 ? "" : "s"}:
|
|
6543
6548
|
${s}`;
|
|
6544
6549
|
}
|
|
6545
|
-
function
|
|
6550
|
+
function eo(e, t) {
|
|
6546
6551
|
return t.projectId !== void 0 ? e.projectId === t.projectId && !e.sectionId && !e.parentId : t.sectionId !== void 0 ? e.sectionId === t.sectionId && !e.parentId : e.parentId === t.parentId;
|
|
6547
6552
|
}
|
|
6548
6553
|
function _d(e, t) {
|
|
@@ -6565,7 +6570,7 @@ function Rd({
|
|
|
6565
6570
|
return { redundantMoveSkipped: !1 };
|
|
6566
6571
|
let n = r, i = !1;
|
|
6567
6572
|
if (s) {
|
|
6568
|
-
const a = r.length === 1 ? (c) =>
|
|
6573
|
+
const a = r.length === 1 ? (c) => eo(s, c) : (c) => _d(s, c);
|
|
6569
6574
|
n = r.filter((c) => !a(c)), i = n.length < r.length;
|
|
6570
6575
|
}
|
|
6571
6576
|
if (n.length === 0)
|
|
@@ -6607,7 +6612,7 @@ const Ld = o.object({
|
|
|
6607
6612
|
'The new deadline date for the task in ISO 8601 format (YYYY-MM-DD, e.g., "2025-12-31"). Deadlines are immovable constraints shown with a different indicator than due dates. Use "remove" to clear the deadline.'
|
|
6608
6613
|
)
|
|
6609
6614
|
).optional(),
|
|
6610
|
-
duration: o.string().optional().describe(
|
|
6615
|
+
duration: o.string().optional().describe(ys),
|
|
6611
6616
|
responsibleUser: o.preprocess(
|
|
6612
6617
|
// Keep accepting legacy null while exposing a Gemini-compatible string schema.
|
|
6613
6618
|
(e) => e === null ? "unassign" : e,
|
|
@@ -6619,7 +6624,7 @@ const Ld = o.object({
|
|
|
6619
6624
|
isUncompletable: o.boolean().optional().describe(
|
|
6620
6625
|
"Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
|
|
6621
6626
|
)
|
|
6622
|
-
}), Nd = (e) => !!(e.projectId || e.sectionId || e.parentId),
|
|
6627
|
+
}), Nd = (e) => !!(e.projectId || e.sectionId || e.parentId), to = (e) => Object.keys(e).length > 0, Md = ["remove", "no date"], Fd = ["remove", "no date", "no deadline"], Hd = "no date", ot = as.TASKS_PER_OPERATION, Xt = {
|
|
6623
6628
|
tasks: o.array(Ld).min(1).max(ot).describe(`The tasks to update (max ${ot}).`)
|
|
6624
6629
|
}, Wd = {
|
|
6625
6630
|
tasks: o.array(K).describe("The updated tasks."),
|
|
@@ -6663,7 +6668,7 @@ const Ld = o.object({
|
|
|
6663
6668
|
const S = a[w]?.index ?? w;
|
|
6664
6669
|
b.status === "fulfilled" ? u.push(b.value) : i(S, b.reason);
|
|
6665
6670
|
}
|
|
6666
|
-
const l = await
|
|
6671
|
+
const l = await so({
|
|
6667
6672
|
client: t,
|
|
6668
6673
|
ids: [
|
|
6669
6674
|
...new Set(
|
|
@@ -6724,7 +6729,7 @@ const Ld = o.object({
|
|
|
6724
6729
|
}
|
|
6725
6730
|
}), await Promise.all(m);
|
|
6726
6731
|
for (const w of u) {
|
|
6727
|
-
if (w.failed ||
|
|
6732
|
+
if (w.failed || to(w.updateArgs))
|
|
6728
6733
|
continue;
|
|
6729
6734
|
const b = h.get(w.index);
|
|
6730
6735
|
b && "task" in b && (r[w.index] = { kind: "updated", task: b.task });
|
|
@@ -6778,7 +6783,7 @@ async function Kd(e, t) {
|
|
|
6778
6783
|
return { error: s };
|
|
6779
6784
|
}
|
|
6780
6785
|
}
|
|
6781
|
-
async function
|
|
6786
|
+
async function so({
|
|
6782
6787
|
client: e,
|
|
6783
6788
|
ids: t
|
|
6784
6789
|
}) {
|
|
@@ -6847,12 +6852,12 @@ async function qd({
|
|
|
6847
6852
|
unresolved: t,
|
|
6848
6853
|
results: s
|
|
6849
6854
|
}) {
|
|
6850
|
-
const r = [...new Set(t.flatMap(({ group: i }) => i.map(({ item: a }) => a.id)))], n = await
|
|
6855
|
+
const r = [...new Set(t.flatMap(({ group: i }) => i.map(({ item: a }) => a.id)))], n = await so({ client: e, ids: r });
|
|
6851
6856
|
for (const { group: i, destination: a, error: c } of t) {
|
|
6852
6857
|
const d = c === void 0 ? "Task not returned by the move" : N(c);
|
|
6853
6858
|
for (const { item: u } of i) {
|
|
6854
6859
|
const l = n.get(u.id);
|
|
6855
|
-
if (l &&
|
|
6860
|
+
if (l && eo(l, a)) {
|
|
6856
6861
|
s.set(u.index, { task: l });
|
|
6857
6862
|
continue;
|
|
6858
6863
|
}
|
|
@@ -6868,7 +6873,7 @@ async function Gd({
|
|
|
6868
6873
|
}) {
|
|
6869
6874
|
const n = er(e);
|
|
6870
6875
|
await Promise.all(
|
|
6871
|
-
t.filter((i) =>
|
|
6876
|
+
t.filter((i) => to(i.updateArgs)).map(async (i) => {
|
|
6872
6877
|
try {
|
|
6873
6878
|
const a = await n(
|
|
6874
6879
|
() => P(() => e.updateTask(i.id, i.updateArgs))
|
|
@@ -6906,7 +6911,7 @@ async function Vd({
|
|
|
6906
6911
|
...y,
|
|
6907
6912
|
...h !== void 0 && { labels: h }
|
|
6908
6913
|
};
|
|
6909
|
-
p && (T.priority =
|
|
6914
|
+
p && (T.priority = ws(p));
|
|
6910
6915
|
const C = Qt(
|
|
6911
6916
|
d,
|
|
6912
6917
|
Md,
|
|
@@ -6916,7 +6921,7 @@ async function Vd({
|
|
|
6916
6921
|
const A = Qt(m, Fd, null);
|
|
6917
6922
|
if (A !== void 0 && (T = { ...T, deadlineDate: A }), u)
|
|
6918
6923
|
try {
|
|
6919
|
-
const { amount: k, unit: v } =
|
|
6924
|
+
const { amount: k, unit: v } = ks(u);
|
|
6920
6925
|
T = {
|
|
6921
6926
|
...T,
|
|
6922
6927
|
duration: k,
|
|
@@ -7029,11 +7034,11 @@ function il(e) {
|
|
|
7029
7034
|
return !1;
|
|
7030
7035
|
}
|
|
7031
7036
|
}
|
|
7032
|
-
function
|
|
7037
|
+
function oo(e) {
|
|
7033
7038
|
return il(e) ? e : "UTC";
|
|
7034
7039
|
}
|
|
7035
7040
|
function al(e, t) {
|
|
7036
|
-
const s =
|
|
7041
|
+
const s = oo(t);
|
|
7037
7042
|
return e.toLocaleString("en-US", {
|
|
7038
7043
|
timeZone: s,
|
|
7039
7044
|
year: "numeric",
|
|
@@ -7046,7 +7051,7 @@ function al(e, t) {
|
|
|
7046
7051
|
});
|
|
7047
7052
|
}
|
|
7048
7053
|
async function cl(e) {
|
|
7049
|
-
const t = await e.getUser(), s = t.tzInfo?.timezone ?? "UTC", r =
|
|
7054
|
+
const t = await e.getUser(), s = t.tzInfo?.timezone ?? "UTC", r = oo(s), n = /* @__PURE__ */ new Date(), i = al(n, r), a = t.startDay ?? 1, c = nl(a), d = tl(t), u = new Date(n.toLocaleString("en-US", { timeZone: r })), l = sl(u, a), p = ol(l), h = rl(u), y = [
|
|
7050
7055
|
"# User Information",
|
|
7051
7056
|
"",
|
|
7052
7057
|
`**User ID:** ${t.id}`,
|
|
@@ -7331,7 +7336,7 @@ function Rl({
|
|
|
7331
7336
|
baseUrl: t,
|
|
7332
7337
|
features: s = []
|
|
7333
7338
|
}) {
|
|
7334
|
-
const r = new
|
|
7339
|
+
const r = new no(
|
|
7335
7340
|
{ name: "todoist-mcp-server", version: ct },
|
|
7336
7341
|
{
|
|
7337
7342
|
capabilities: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-activity.d.ts","sourceRoot":"","sources":["../../src/tools/find-activity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAkEvB,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"find-activity.d.ts","sourceRoot":"","sources":["../../src/tools/find-activity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAkEvB,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6D6C,CAAA;AA6I/D,OAAO,EAAE,YAAY,EAAE,CAAA"}
|