@doist/todoist-mcp 13.11.1 → 14.0.0
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 +3 -3
- package/dist/main.js +4 -4
- package/dist/{mcp-server-BhPX7dvL.js → mcp-server-DY_eceeG.js} +242 -239
- package/dist/mcp-server.d.ts +3 -4
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/middleware/require-valid-todoist-token.d.ts +2 -1
- package/dist/middleware/require-valid-todoist-token.d.ts.map +1 -1
- package/dist/require-valid-todoist-token-B0G0XLuO.js +79 -0
- package/dist/usage-tracking.d.ts +5 -0
- package/dist/usage-tracking.d.ts.map +1 -1
- package/dist/utils/validate-todoist-token.d.ts +12 -4
- package/dist/utils/validate-todoist-token.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/require-valid-todoist-token-BOCa8T4B.js +0 -72
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { ResourceTemplate as
|
|
1
|
+
import { ResourceTemplate as jo, McpServer as $o } from "@modelcontextprotocol/server";
|
|
2
2
|
import { createHash as ps, randomUUID as Ke } from "node:crypto";
|
|
3
|
-
import { readFileSync as
|
|
3
|
+
import { readFileSync as Ao } from "node:fs";
|
|
4
4
|
import { dirname as hs, join as qe } from "node:path";
|
|
5
|
-
import { fileURLToPath as
|
|
5
|
+
import { fileURLToPath as Do } from "node:url";
|
|
6
6
|
import { RESOURCE_MIME_TYPE as Ge } from "@modelcontextprotocol/ext-apps/server";
|
|
7
|
-
import { createToolRegistrar as
|
|
8
|
-
import ue, { ZodError as
|
|
9
|
-
import { AsyncLocalStorage as
|
|
10
|
-
import { createRequire as
|
|
11
|
-
import { TodoistApi as
|
|
7
|
+
import { createToolRegistrar as Eo } from "@doist/mcp-core";
|
|
8
|
+
import ue, { ZodError as xo, z as o } from "zod";
|
|
9
|
+
import { AsyncLocalStorage as Oo } from "node:async_hooks";
|
|
10
|
+
import { createRequire as Uo } from "node:module";
|
|
11
|
+
import { TodoistApi as _o, formatUserShortName as ms, isWorkspaceProject as F, isPersonalProject as z, colors as ze, LOCATION_TRIGGERS as fs, REMINDER_TYPES as Po, TodoistSyncError as Ro, TodoistRequestError as No, createCommand as ne, PROJECT_VIEW_STYLES as bs, REMINDER_DELIVERY_SERVICES as Lo, HEALTH_STATUSES as ct, getTaskUrl as gs, getProjectUrl as ys, ACTIVITY_EVENT_TYPES as Mo, ACTIVITY_OBJECT_TYPES as Ts, escapeFilterToken as ws, parseTodoistUrl as Fo, WORKSPACE_ROLES as Ho, WORKSPACE_PLANS as Wo } from "@doist/todoist-sdk";
|
|
12
12
|
import { addDays as Ye, formatISO as xt } from "date-fns";
|
|
13
13
|
import { generateNKeysBetween as ks } from "fractional-indexing";
|
|
14
|
-
const dt = 3600 * 1e3,
|
|
14
|
+
const dt = 3600 * 1e3, Bo = 365 * 24 * dt, D = {
|
|
15
15
|
/** Default limit for task listings */
|
|
16
16
|
TASKS_DEFAULT: 10,
|
|
17
17
|
/** Maximum limit for task search and list operations */
|
|
@@ -47,7 +47,7 @@ const dt = 3600 * 1e3, Wo = 365 * 24 * dt, D = {
|
|
|
47
47
|
}, Se = {
|
|
48
48
|
/** Maximum number of failures to show in detailed error messages */
|
|
49
49
|
MAX_FAILURES_SHOWN: 3
|
|
50
|
-
},
|
|
50
|
+
}, Ko = {
|
|
51
51
|
/** Maximum number of failed items named in one log line */
|
|
52
52
|
MAX_FAILURES_LOGGED: 5
|
|
53
53
|
}, vs = {
|
|
@@ -76,26 +76,26 @@ const dt = 3600 * 1e3, Wo = 365 * 24 * dt, D = {
|
|
|
76
76
|
* queue (serialised moves to 100 distinct destinations is roughly 15s).
|
|
77
77
|
*/
|
|
78
78
|
QUEUE_WAIT_MS: 3e4
|
|
79
|
-
}, Ot = hs(
|
|
79
|
+
}, Ot = hs(Do(import.meta.url)), qo = [
|
|
80
80
|
qe(Ot, "task-list", "index.html"),
|
|
81
81
|
qe(Ot, "mcp-apps", "index.html")
|
|
82
|
-
],
|
|
82
|
+
], Go = `<!doctype html>
|
|
83
83
|
<html>
|
|
84
84
|
<body>
|
|
85
85
|
<p>Task list app is missing. Run "npm run build" to generate it.</p>
|
|
86
86
|
</body>
|
|
87
87
|
</html>`;
|
|
88
|
-
function
|
|
88
|
+
function zo() {
|
|
89
89
|
const e = [];
|
|
90
|
-
for (const t of
|
|
90
|
+
for (const t of qo)
|
|
91
91
|
try {
|
|
92
|
-
return
|
|
92
|
+
return Ao(t, "utf-8");
|
|
93
93
|
} catch (s) {
|
|
94
94
|
e.push(s);
|
|
95
95
|
}
|
|
96
|
-
return console.error("Failed to load task list app HTML from any known path:", e),
|
|
96
|
+
return console.error("Failed to load task list app HTML from any known path:", e), Go;
|
|
97
97
|
}
|
|
98
|
-
const Is =
|
|
98
|
+
const Is = zo(), Yo = ps("sha256").update(Is).digest("hex").slice(0, 12), Je = `ui://todoist/task-list@${Yo}`, Vo = "ui://todoist/task-list@{hash}", Xe = "Interactive task list widget", Jo = "https://ai.todoist.net", Ze = {
|
|
99
99
|
ui: {
|
|
100
100
|
prefersBorder: !0,
|
|
101
101
|
csp: {
|
|
@@ -110,8 +110,8 @@ const Is = Go(), zo = ps("sha256").update(Is).digest("hex").slice(0, 12), Je = `
|
|
|
110
110
|
connect_domains: [],
|
|
111
111
|
resource_domains: []
|
|
112
112
|
},
|
|
113
|
-
"openai/widgetDomain":
|
|
114
|
-
},
|
|
113
|
+
"openai/widgetDomain": Jo
|
|
114
|
+
}, Xo = { ttlMs: Bo, cacheScope: "public" }, Zo = { ttlMs: dt, cacheScope: "private" };
|
|
115
115
|
function Ut(e) {
|
|
116
116
|
return {
|
|
117
117
|
contents: [
|
|
@@ -124,7 +124,7 @@ function Ut(e) {
|
|
|
124
124
|
]
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function Qo(e) {
|
|
128
128
|
e.registerResource(
|
|
129
129
|
"todoist-task-list",
|
|
130
130
|
Je,
|
|
@@ -132,17 +132,17 @@ function Zo(e) {
|
|
|
132
132
|
description: Xe,
|
|
133
133
|
mimeType: Ge,
|
|
134
134
|
_meta: Ze,
|
|
135
|
-
cacheHint:
|
|
135
|
+
cacheHint: Xo
|
|
136
136
|
},
|
|
137
137
|
async () => Ut(Je)
|
|
138
138
|
), e.registerResource(
|
|
139
139
|
"todoist-task-list-hash-fallback",
|
|
140
|
-
new
|
|
140
|
+
new jo(Vo, { list: void 0 }),
|
|
141
141
|
{
|
|
142
142
|
description: `${Xe} compatibility fallback`,
|
|
143
143
|
mimeType: Ge,
|
|
144
144
|
_meta: Ze,
|
|
145
|
-
cacheHint:
|
|
145
|
+
cacheHint: Zo
|
|
146
146
|
},
|
|
147
147
|
async (t) => Ut(t.toString())
|
|
148
148
|
);
|
|
@@ -174,14 +174,14 @@ function pe(e) {
|
|
|
174
174
|
const t = M(e);
|
|
175
175
|
return t !== void 0 ? t : S(e);
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function er(e) {
|
|
178
178
|
return e.replace(/\b(Bearer)\s+[A-Za-z0-9._~+/=-]+/gi, "$1 [REDACTED]").replace(
|
|
179
179
|
/\b(token|api[_-]?key|authorization)\s*[:=]\s*["']?[A-Za-z0-9._~+/=-]{6,}["']?/gi,
|
|
180
180
|
"$1: [REDACTED]"
|
|
181
181
|
).replace(/([?&](?:token|api[_-]?key|authorization)=)[^&\s]+/gi, "$1[REDACTED]").replace(/\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\b/g, "[REDACTED]");
|
|
182
182
|
}
|
|
183
183
|
function B(e, t = 220) {
|
|
184
|
-
const s =
|
|
184
|
+
const s = er(e).replace(/\s+/g, " ").trim();
|
|
185
185
|
return s.length <= t ? s : `${s.slice(0, t - 3)}...`;
|
|
186
186
|
}
|
|
187
187
|
function et(e) {
|
|
@@ -222,7 +222,7 @@ function oe(e) {
|
|
|
222
222
|
}
|
|
223
223
|
return r.length > 0 ? B(r.join("; ")) : void 0;
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function tr(e) {
|
|
226
226
|
if (!e)
|
|
227
227
|
return [];
|
|
228
228
|
const t = /* @__PURE__ */ new Set(), s = (a) => {
|
|
@@ -285,7 +285,7 @@ function er(e) {
|
|
|
285
285
|
}
|
|
286
286
|
return Array.from(t).slice(0, 3);
|
|
287
287
|
}
|
|
288
|
-
const
|
|
288
|
+
const sr = [
|
|
289
289
|
"error",
|
|
290
290
|
"error_code",
|
|
291
291
|
"error_tag",
|
|
@@ -296,14 +296,14 @@ const tr = [
|
|
|
296
296
|
"httpCode",
|
|
297
297
|
"errorExtra"
|
|
298
298
|
];
|
|
299
|
-
function
|
|
300
|
-
return e ?
|
|
299
|
+
function or(e) {
|
|
300
|
+
return e ? sr.some((t) => e[t] !== void 0) : !1;
|
|
301
301
|
}
|
|
302
302
|
const tt = {
|
|
303
303
|
MAX_ITEMS_LIMIT_REACHED: "This project has reached the maximum number of active tasks per project (subtasks count toward it; completed tasks do not). The cap is the same on every Todoist plan — upgrading will not raise it — and it is not an authentication or permission problem. Complete, delete, or move existing tasks out of the project, or add the task to a different project, then retry.",
|
|
304
304
|
USER_CANNOT_VIEW_TEMPLATE: "This template exists but belongs to another account. Personal templates are private to whoever saved them, and a link to one cannot be used by anyone else. Use a public gallery template instead, or ask the owner to export it with export-project-template and share the CSV."
|
|
305
305
|
};
|
|
306
|
-
function
|
|
306
|
+
function rr(...e) {
|
|
307
307
|
for (const t of e) {
|
|
308
308
|
if (!t)
|
|
309
309
|
continue;
|
|
@@ -314,16 +314,16 @@ function or(...e) {
|
|
|
314
314
|
return tt[r];
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
|
-
function
|
|
317
|
+
function nr(e) {
|
|
318
318
|
if (e.tag) {
|
|
319
319
|
const t = tt[e.tag.toUpperCase()];
|
|
320
320
|
if (t)
|
|
321
321
|
return t;
|
|
322
322
|
}
|
|
323
|
-
return
|
|
323
|
+
return rr(...e.rawText ?? [], e.message, e.details);
|
|
324
324
|
}
|
|
325
|
-
function
|
|
326
|
-
const t =
|
|
325
|
+
function ir(e) {
|
|
326
|
+
const t = nr(e);
|
|
327
327
|
if (t)
|
|
328
328
|
return t;
|
|
329
329
|
const { statusCode: s } = e, r = e.fieldHints.length > 0;
|
|
@@ -377,8 +377,8 @@ function lt(e) {
|
|
|
377
377
|
oe(n?.errorDetails),
|
|
378
378
|
oe(n?.errors),
|
|
379
379
|
oe(t?.details)
|
|
380
|
-
), p =
|
|
381
|
-
return i !== void 0 ||
|
|
380
|
+
), p = tr(n);
|
|
381
|
+
return i !== void 0 || or(n) || c !== void 0 || a !== void 0 || (l ? et(l) : !1) ? {
|
|
382
382
|
statusCode: i,
|
|
383
383
|
code: a,
|
|
384
384
|
tag: c ? B(c, 80) : void 0,
|
|
@@ -392,11 +392,11 @@ function Ss(e) {
|
|
|
392
392
|
const t = [];
|
|
393
393
|
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;
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function ar(e) {
|
|
396
396
|
const t = Ss(e), s = [
|
|
397
397
|
t.length > 0 ? `Todoist API request failed (${t.join(", ")}).` : "Todoist API request failed."
|
|
398
398
|
];
|
|
399
|
-
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: ${
|
|
399
|
+
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: ${ir(e)}`), s.join(`
|
|
400
400
|
`);
|
|
401
401
|
}
|
|
402
402
|
function Cs(e) {
|
|
@@ -416,7 +416,7 @@ function E(e) {
|
|
|
416
416
|
const s = Ss(t), r = t.message && !(s.length > 0 && et(t.message)) ? t.message : "Todoist API request failed";
|
|
417
417
|
return s.length > 0 ? `${r} (${s.join(", ")})` : r;
|
|
418
418
|
}
|
|
419
|
-
function
|
|
419
|
+
function cr(e, {
|
|
420
420
|
taskContent: t,
|
|
421
421
|
dueString: s,
|
|
422
422
|
deadlineDate: r
|
|
@@ -429,14 +429,14 @@ function ar(e, {
|
|
|
429
429
|
const d = s.trim().replace(/^recurring(?:\s+|$)/i, "").trim();
|
|
430
430
|
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.`;
|
|
431
431
|
}
|
|
432
|
-
function
|
|
433
|
-
if (e instanceof
|
|
432
|
+
function dr(e) {
|
|
433
|
+
if (e instanceof xo || e instanceof ut)
|
|
434
434
|
return e.message;
|
|
435
435
|
const t = lt(e);
|
|
436
|
-
return t ?
|
|
436
|
+
return t ? ar(t) : Cs(e);
|
|
437
437
|
}
|
|
438
|
-
const
|
|
439
|
-
version:
|
|
438
|
+
const lr = "14.0.0", ur = {
|
|
439
|
+
version: lr
|
|
440
440
|
};
|
|
441
441
|
function _t(e, { queueTimeoutMs: t = Ve.QUEUE_WAIT_MS } = {}) {
|
|
442
442
|
if (!Number.isInteger(e) || e < 1)
|
|
@@ -486,36 +486,36 @@ function pt() {
|
|
|
486
486
|
writes: _t(Ve.WRITES)
|
|
487
487
|
};
|
|
488
488
|
}
|
|
489
|
-
const
|
|
490
|
-
let
|
|
489
|
+
const pr = 1e4, hr = 5 * 6e4, G = /* @__PURE__ */ new Map();
|
|
490
|
+
let mr = pr;
|
|
491
491
|
const js = /* @__PURE__ */ new WeakMap(), re = /* @__PURE__ */ new Map();
|
|
492
492
|
let Pt, Rt;
|
|
493
|
-
function
|
|
493
|
+
function fr() {
|
|
494
494
|
return Pt ??= pt(), Pt;
|
|
495
495
|
}
|
|
496
496
|
function Nt() {
|
|
497
497
|
return Rt ??= pt(), Rt;
|
|
498
498
|
}
|
|
499
|
-
function
|
|
499
|
+
function br(e) {
|
|
500
500
|
return ps("sha256").update(e).digest("hex");
|
|
501
501
|
}
|
|
502
|
-
function
|
|
502
|
+
function gr({ moves: e, writes: t }) {
|
|
503
503
|
return e.isIdle() && t.isIdle();
|
|
504
504
|
}
|
|
505
505
|
function $s(e) {
|
|
506
|
-
return e.leases === 0 &&
|
|
506
|
+
return e.leases === 0 && gr(e.limiters);
|
|
507
507
|
}
|
|
508
|
-
function
|
|
508
|
+
function yr(e, t, s) {
|
|
509
509
|
G.delete(e), t.lastUsedAt = s, G.set(e, t);
|
|
510
510
|
}
|
|
511
|
-
function
|
|
511
|
+
function Tr(e) {
|
|
512
512
|
for (const [t, s] of G) {
|
|
513
|
-
if (e - s.lastUsedAt <
|
|
513
|
+
if (e - s.lastUsedAt < hr)
|
|
514
514
|
break;
|
|
515
515
|
$s(s) && G.delete(t);
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
|
-
function
|
|
518
|
+
function wr() {
|
|
519
519
|
for (const [e, t] of G)
|
|
520
520
|
if ($s(t))
|
|
521
521
|
return G.delete(e), !0;
|
|
@@ -526,13 +526,13 @@ function As(e, t) {
|
|
|
526
526
|
return;
|
|
527
527
|
const s = G.get(e);
|
|
528
528
|
if (s)
|
|
529
|
-
return
|
|
530
|
-
if (
|
|
529
|
+
return yr(e, s, t), s;
|
|
530
|
+
if (Tr(t), G.size >= mr && !wr())
|
|
531
531
|
return;
|
|
532
532
|
const r = { limiters: pt(), lastUsedAt: t, leases: 0 };
|
|
533
533
|
return G.set(e, r), r;
|
|
534
534
|
}
|
|
535
|
-
function
|
|
535
|
+
function kr(e) {
|
|
536
536
|
const t = re.get(e);
|
|
537
537
|
if (t !== void 0)
|
|
538
538
|
return re.set(e, t + 1), {
|
|
@@ -558,51 +558,51 @@ function Lt(e) {
|
|
|
558
558
|
}
|
|
559
559
|
re.set(e, t - 1);
|
|
560
560
|
}
|
|
561
|
-
function
|
|
562
|
-
const s =
|
|
561
|
+
function vr(e, t) {
|
|
562
|
+
const s = br(t);
|
|
563
563
|
js.set(e, s);
|
|
564
564
|
}
|
|
565
565
|
function Ds(e, t) {
|
|
566
566
|
const s = js.get(e);
|
|
567
567
|
return s ? (As(s, Date.now()), async (r) => {
|
|
568
|
-
const n =
|
|
568
|
+
const n = kr(s);
|
|
569
569
|
try {
|
|
570
570
|
return await n.limiters[t](r);
|
|
571
571
|
} finally {
|
|
572
572
|
n.release();
|
|
573
573
|
}
|
|
574
|
-
}) :
|
|
574
|
+
}) : fr()[t];
|
|
575
575
|
}
|
|
576
|
-
function
|
|
576
|
+
function Ir(e) {
|
|
577
577
|
return Ds(e, "moves");
|
|
578
578
|
}
|
|
579
|
-
function
|
|
579
|
+
function Sr(e) {
|
|
580
580
|
return Ds(e, "writes");
|
|
581
581
|
}
|
|
582
|
-
const
|
|
582
|
+
const Cr = "todoist-mcp", ht = ur.version, Es = new Oo(), Mt = Uo(import.meta.url);
|
|
583
583
|
let Ee;
|
|
584
|
-
const
|
|
584
|
+
const jr = async () => {
|
|
585
585
|
const e = Mt.resolve("@doist/todoist-sdk"), t = qe(hs(e), "transport", "http-dispatcher.js");
|
|
586
586
|
return Mt(t);
|
|
587
587
|
};
|
|
588
|
-
let
|
|
589
|
-
function
|
|
590
|
-
return `${
|
|
588
|
+
let $r = jr;
|
|
589
|
+
function Ar() {
|
|
590
|
+
return `${Cr}/${ht}`;
|
|
591
591
|
}
|
|
592
592
|
function xs(e) {
|
|
593
593
|
return e.trim().toLowerCase();
|
|
594
594
|
}
|
|
595
|
-
function
|
|
595
|
+
function Dr(e, t) {
|
|
596
596
|
return Es.run(xs(e), t);
|
|
597
597
|
}
|
|
598
|
-
function
|
|
598
|
+
function Er({
|
|
599
599
|
label: e,
|
|
600
600
|
platform: t = "mcp",
|
|
601
601
|
sessionId: s = Ke()
|
|
602
602
|
} = {}) {
|
|
603
603
|
const r = e ? xs(e) : Es.getStore();
|
|
604
604
|
return {
|
|
605
|
-
"User-Agent":
|
|
605
|
+
"User-Agent": Ar(),
|
|
606
606
|
"doist-platform": t,
|
|
607
607
|
"doist-version": ht,
|
|
608
608
|
"request-id": Ke(),
|
|
@@ -610,16 +610,16 @@ function Dr({
|
|
|
610
610
|
"mcp-tool": r ?? "unknown"
|
|
611
611
|
};
|
|
612
612
|
}
|
|
613
|
-
function
|
|
613
|
+
function xr(e, t) {
|
|
614
614
|
const s = new Headers(e);
|
|
615
|
-
for (const [r, n] of Object.entries(
|
|
615
|
+
for (const [r, n] of Object.entries(Er(t)))
|
|
616
616
|
s.set(r, n);
|
|
617
617
|
return Object.fromEntries(s.entries());
|
|
618
618
|
}
|
|
619
619
|
function Ft() {
|
|
620
620
|
return new DOMException("The operation was aborted due to timeout", "TimeoutError");
|
|
621
621
|
}
|
|
622
|
-
function
|
|
622
|
+
function Or(e, t) {
|
|
623
623
|
if (!e && t === void 0)
|
|
624
624
|
return {
|
|
625
625
|
signal: void 0,
|
|
@@ -657,21 +657,25 @@ function xr(e, t) {
|
|
|
657
657
|
}
|
|
658
658
|
};
|
|
659
659
|
}
|
|
660
|
-
async function
|
|
661
|
-
if (
|
|
662
|
-
return Ee || (Ee =
|
|
660
|
+
async function Ur() {
|
|
661
|
+
if (_r())
|
|
662
|
+
return Ee || (Ee = $r().then((e) => e.getDefaultTransport()).catch((e) => {
|
|
663
663
|
throw Ee = void 0, e;
|
|
664
664
|
})), Ee;
|
|
665
665
|
}
|
|
666
|
-
function
|
|
666
|
+
function _r() {
|
|
667
667
|
return typeof process < "u" && !!process.versions?.node;
|
|
668
668
|
}
|
|
669
|
-
async function
|
|
669
|
+
async function Os(e, t) {
|
|
670
670
|
if ("dispatcher" in t)
|
|
671
671
|
return e;
|
|
672
|
-
const s = await
|
|
672
|
+
const s = await Ur();
|
|
673
673
|
return s ? (t.dispatcher = s.dispatcher, s.fetch ?? e) : e;
|
|
674
674
|
}
|
|
675
|
+
async function xu(e, t) {
|
|
676
|
+
const s = { ...t };
|
|
677
|
+
return (await Os(globalThis.fetch, s))(e, s);
|
|
678
|
+
}
|
|
675
679
|
function Pr(e) {
|
|
676
680
|
return {
|
|
677
681
|
ok: e.ok,
|
|
@@ -686,13 +690,13 @@ function Pr(e) {
|
|
|
686
690
|
function Rr(e = globalThis.fetch, t = {}) {
|
|
687
691
|
const s = e === globalThis.fetch, { enabled: r = !0, platform: n = "mcp", sessionId: i = Ke() } = t;
|
|
688
692
|
return async (a, c = {}) => {
|
|
689
|
-
const { timeout: d, headers: l, signal: u, ...p } = c, { signal: h, cleanup: f } =
|
|
693
|
+
const { timeout: d, headers: l, signal: u, ...p } = c, { signal: h, cleanup: f } = Or(u, d);
|
|
690
694
|
try {
|
|
691
695
|
const b = {
|
|
692
696
|
...p,
|
|
693
697
|
signal: h,
|
|
694
|
-
...r ? { headers:
|
|
695
|
-
}, g = await (s ? await
|
|
698
|
+
...r ? { headers: xr(l, { platform: n, sessionId: i }) } : l !== void 0 ? { headers: l } : {}
|
|
699
|
+
}, g = await (s ? await Os(e, b) : e)(a, b);
|
|
696
700
|
return Pr(g);
|
|
697
701
|
} finally {
|
|
698
702
|
f();
|
|
@@ -703,14 +707,14 @@ function Nr(e, {
|
|
|
703
707
|
baseUrl: t,
|
|
704
708
|
tracking: s
|
|
705
709
|
} = {}) {
|
|
706
|
-
const r = new
|
|
710
|
+
const r = new _o(e, {
|
|
707
711
|
customFetch: Rr(globalThis.fetch, s),
|
|
708
712
|
...t ? { baseUrl: t } : {}
|
|
709
713
|
});
|
|
710
|
-
return
|
|
714
|
+
return vr(r, e), r;
|
|
711
715
|
}
|
|
712
716
|
const Lr = 2, Mr = 500, Fr = 2e3, Hr = 50, Wr = /* @__PURE__ */ new Set([502, 503, 504]), Br = /* @__PURE__ */ new Set([503]);
|
|
713
|
-
function
|
|
717
|
+
function Us(e) {
|
|
714
718
|
if (e == null || typeof e != "object")
|
|
715
719
|
return;
|
|
716
720
|
const t = e;
|
|
@@ -727,7 +731,7 @@ function Os(e) {
|
|
|
727
731
|
}
|
|
728
732
|
}
|
|
729
733
|
function Kr(e, t = Wr) {
|
|
730
|
-
const s =
|
|
734
|
+
const s = Us(e);
|
|
731
735
|
return s !== void 0 && t.has(s);
|
|
732
736
|
}
|
|
733
737
|
function qr({
|
|
@@ -826,7 +830,7 @@ const T = {
|
|
|
826
830
|
// OpenAI MCP tools
|
|
827
831
|
SEARCH: "search",
|
|
828
832
|
FETCH: "fetch"
|
|
829
|
-
},
|
|
833
|
+
}, Ou = {
|
|
830
834
|
/**
|
|
831
835
|
* Strips email addresses from tool outputs that expose user data.
|
|
832
836
|
* Affects: find-project-collaborators, find-completed-tasks
|
|
@@ -870,13 +874,13 @@ function Qr({
|
|
|
870
874
|
client: s,
|
|
871
875
|
features: r = []
|
|
872
876
|
}) {
|
|
873
|
-
const n = r.some((a) => a.name === "strip_emails"), i =
|
|
877
|
+
const n = r.some((a) => a.name === "strip_emails"), i = Eo({
|
|
874
878
|
titlePrefix: "Todoist",
|
|
875
879
|
createContext: () => s,
|
|
876
|
-
formatError:
|
|
880
|
+
formatError: dr,
|
|
877
881
|
structuredContentAsText: !zr,
|
|
878
882
|
wrapExecute: async (a, c) => {
|
|
879
|
-
const d = await
|
|
883
|
+
const d = await Dr(a.name, () => $(c));
|
|
880
884
|
return !n || !Zr(a.name) ? d : {
|
|
881
885
|
...d,
|
|
882
886
|
textContent: d.textContent && Xr(d.textContent),
|
|
@@ -1028,7 +1032,7 @@ const ve = {
|
|
|
1028
1032
|
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.",
|
|
1029
1033
|
argsSchema: en,
|
|
1030
1034
|
callback: rn
|
|
1031
|
-
},
|
|
1035
|
+
}, _s = '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.', Ps = 'Use format like "2h", "30m", "2h30m", "1.5h", or "3d"';
|
|
1032
1036
|
class P extends Error {
|
|
1033
1037
|
constructor(t, s) {
|
|
1034
1038
|
super(`Invalid duration format "${t}": ${s}`), this.name = "DurationParseError";
|
|
@@ -1046,7 +1050,7 @@ function nn(e) {
|
|
|
1046
1050
|
if (an(t))
|
|
1047
1051
|
throw new P(
|
|
1048
1052
|
e,
|
|
1049
|
-
`${
|
|
1053
|
+
`${Ps} (days cannot be combined with hours or minutes)`
|
|
1050
1054
|
);
|
|
1051
1055
|
return { amount: dn(e, t), unit: "minute" };
|
|
1052
1056
|
}
|
|
@@ -1069,7 +1073,7 @@ function cn(e, t) {
|
|
|
1069
1073
|
function dn(e, t) {
|
|
1070
1074
|
const s = t.match(/^(?:(\d+(?:\.\d+)?)h)?(?:(\d+(?:\.\d+)?)m)?$/);
|
|
1071
1075
|
if (!s || !s[1] && !s[2])
|
|
1072
|
-
throw new P(e,
|
|
1076
|
+
throw new P(e, Ps);
|
|
1073
1077
|
let r = 0;
|
|
1074
1078
|
const [, n, i] = s;
|
|
1075
1079
|
if (n) {
|
|
@@ -1112,14 +1116,14 @@ function ln(e, t = "minute") {
|
|
|
1112
1116
|
return s === 0 ? `${r}m` : r === 0 ? `${s}h` : `${s}h${r}m`;
|
|
1113
1117
|
}
|
|
1114
1118
|
const un = ["p1", "p2", "p3", "p4"], ft = '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.', bt = o.enum(un).describe(ft);
|
|
1115
|
-
function
|
|
1119
|
+
function Rs(e) {
|
|
1116
1120
|
return { p1: 4, p2: 3, p3: 2, p4: 1 }[e];
|
|
1117
1121
|
}
|
|
1118
1122
|
function pn(e) {
|
|
1119
1123
|
return { 4: "p1", 3: "p2", 2: "p3", 1: "p4" }[e];
|
|
1120
1124
|
}
|
|
1121
|
-
const
|
|
1122
|
-
class
|
|
1125
|
+
const Ns = 300 * 1e3, hn = 1e4, mn = 1e3;
|
|
1126
|
+
class Ls {
|
|
1123
1127
|
constructor(t, s) {
|
|
1124
1128
|
this.maxEntries = t, this.ttl = s, this.entries = /* @__PURE__ */ new Map();
|
|
1125
1129
|
}
|
|
@@ -1152,13 +1156,13 @@ class Ns {
|
|
|
1152
1156
|
t - r.timestamp >= this.ttl && this.entries.delete(s);
|
|
1153
1157
|
}
|
|
1154
1158
|
}
|
|
1155
|
-
const Me = new
|
|
1159
|
+
const Me = new Ls(
|
|
1156
1160
|
hn,
|
|
1157
|
-
|
|
1158
|
-
), he = new
|
|
1161
|
+
Ns
|
|
1162
|
+
), he = new Ls(
|
|
1159
1163
|
mn,
|
|
1160
|
-
|
|
1161
|
-
),
|
|
1164
|
+
Ns
|
|
1165
|
+
), Ms = "me";
|
|
1162
1166
|
class fn {
|
|
1163
1167
|
/**
|
|
1164
1168
|
* Resolve a user name or ID to a user ID by looking up collaborators across all shared projects.
|
|
@@ -1168,7 +1172,7 @@ class fn {
|
|
|
1168
1172
|
if (!s || s.trim().length === 0)
|
|
1169
1173
|
return null;
|
|
1170
1174
|
const r = s.trim();
|
|
1171
|
-
if (r.toLowerCase() ===
|
|
1175
|
+
if (r.toLowerCase() === Ms)
|
|
1172
1176
|
try {
|
|
1173
1177
|
const d = await t.getUser();
|
|
1174
1178
|
return {
|
|
@@ -1328,7 +1332,7 @@ function ge(e, t, s) {
|
|
|
1328
1332
|
async function bn(e, t) {
|
|
1329
1333
|
return L.resolveUser(e, t);
|
|
1330
1334
|
}
|
|
1331
|
-
async function
|
|
1335
|
+
async function Fs(e, t) {
|
|
1332
1336
|
const s = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), n = [], i = [];
|
|
1333
1337
|
for (const a of t) {
|
|
1334
1338
|
const c = a.trim().toLowerCase();
|
|
@@ -1349,7 +1353,7 @@ async function Ms(e, t) {
|
|
|
1349
1353
|
}
|
|
1350
1354
|
return n;
|
|
1351
1355
|
}
|
|
1352
|
-
const
|
|
1356
|
+
const Hs = ["assigned", "unassignedOrMe", "all"];
|
|
1353
1357
|
async function gt(e, t) {
|
|
1354
1358
|
if (!t)
|
|
1355
1359
|
return;
|
|
@@ -1409,14 +1413,14 @@ async function K(e) {
|
|
|
1409
1413
|
function yt(e) {
|
|
1410
1414
|
return /(?<!\\)(?:\\\\)*\*/.test(e) ? e : `*${e.replaceAll(/\\(?!\*)/g, "\\\\")}*`;
|
|
1411
1415
|
}
|
|
1412
|
-
async function
|
|
1416
|
+
async function Ws(e, t) {
|
|
1413
1417
|
return K({
|
|
1414
1418
|
apiMethod: e.searchProjects.bind(e),
|
|
1415
1419
|
args: { query: yt(t) },
|
|
1416
1420
|
limit: D.PROJECTS_MAX
|
|
1417
1421
|
});
|
|
1418
1422
|
}
|
|
1419
|
-
async function
|
|
1423
|
+
async function Bs(e) {
|
|
1420
1424
|
return K({
|
|
1421
1425
|
apiMethod: (t) => $(() => e.getProjects(t)),
|
|
1422
1426
|
args: {},
|
|
@@ -1612,7 +1616,7 @@ function Ce(e) {
|
|
|
1612
1616
|
};
|
|
1613
1617
|
}
|
|
1614
1618
|
}
|
|
1615
|
-
function
|
|
1619
|
+
function Ks(e) {
|
|
1616
1620
|
const t = e.filter(
|
|
1617
1621
|
(r) => r.type === "relative" || r.type === "absolute"
|
|
1618
1622
|
).length, s = e.filter((r) => r.type === "location").length;
|
|
@@ -1622,7 +1626,7 @@ const Wt = "[redacted]", Cn = /"[^"]*"/g;
|
|
|
1622
1626
|
function U(e, t, s, r = {}) {
|
|
1623
1627
|
if (s.length === 0)
|
|
1624
1628
|
return;
|
|
1625
|
-
const n = s.slice(0,
|
|
1629
|
+
const n = s.slice(0, Ko.MAX_FAILURES_LOGGED);
|
|
1626
1630
|
console.error(`${e}: items failed`, {
|
|
1627
1631
|
failed: s.length,
|
|
1628
1632
|
of: t,
|
|
@@ -1633,9 +1637,9 @@ function U(e, t, s, r = {}) {
|
|
|
1633
1637
|
}))
|
|
1634
1638
|
});
|
|
1635
1639
|
}
|
|
1636
|
-
const
|
|
1640
|
+
const qs = "none";
|
|
1637
1641
|
function jn(e) {
|
|
1638
|
-
return e.length === 1 && e[0]?.trim().toLowerCase() ===
|
|
1642
|
+
return e.length === 1 && e[0]?.trim().toLowerCase() === qs;
|
|
1639
1643
|
}
|
|
1640
1644
|
async function $n(e, t, s, r = (n) => e.getTask(n)) {
|
|
1641
1645
|
const n = await An(e, t);
|
|
@@ -1770,7 +1774,7 @@ const xn = o.object({
|
|
|
1770
1774
|
}), wt = o.object({
|
|
1771
1775
|
id: o.string(),
|
|
1772
1776
|
taskId: o.string(),
|
|
1773
|
-
type: o.enum(
|
|
1777
|
+
type: o.enum(Po),
|
|
1774
1778
|
notifyUid: o.string().optional().describe("User ID the reminder notifies."),
|
|
1775
1779
|
minuteOffset: o.number().optional().describe("Minutes before due. Relative reminders only."),
|
|
1776
1780
|
due: _n.optional().describe("Absolute, and sometimes relative, reminders."),
|
|
@@ -1863,10 +1867,10 @@ function ee({
|
|
|
1863
1867
|
}) {
|
|
1864
1868
|
const d = [], l = `${e}: ${t}${typeof s == "number" ? ` (limit ${s})` : ""}${r ? ", more available" : ""}.`;
|
|
1865
1869
|
return d.push(l), n?.length && d.push(`Filter: ${n.join("; ")}.`), i?.length && d.push(`Preview:
|
|
1866
|
-
${i}`), !t && a?.length && d.push(`No results. ${a.join("; ")}.`), (c?.length || r) && d.push(
|
|
1870
|
+
${i}`), !t && a?.length && d.push(`No results. ${a.join("; ")}.`), (c?.length || r) && d.push(Gs(c || [], r)), d.join(`
|
|
1867
1871
|
`);
|
|
1868
1872
|
}
|
|
1869
|
-
function
|
|
1873
|
+
function Gs(e, t) {
|
|
1870
1874
|
const s = [...e];
|
|
1871
1875
|
return t && s.push(`Pass cursor '${t}' to fetch more results.`), `${s.length === 1 ? "Possible suggested next step:" : "Possible suggested next steps:"}
|
|
1872
1876
|
${s.map((n) => `- ${n}`).join(`
|
|
@@ -1879,7 +1883,7 @@ const Ln = o.object({
|
|
|
1879
1883
|
),
|
|
1880
1884
|
content: o.string().min(1).describe("The content of the comment."),
|
|
1881
1885
|
notifyUsers: o.array(o.string().min(1)).min(1).max(D.NOTIFY_USERS_MAX).optional().describe(
|
|
1882
|
-
`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 ["${
|
|
1886
|
+
`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 ["${qs}"] to notify nobody.`
|
|
1883
1887
|
)
|
|
1884
1888
|
}), Mn = {
|
|
1885
1889
|
comments: o.array(Ln).min(1).describe("The array of comments to add.")
|
|
@@ -1916,7 +1920,7 @@ const Ln = o.object({
|
|
|
1916
1920
|
const c = /* @__PURE__ */ new Map();
|
|
1917
1921
|
async function d({ notifyUsers: m }, g) {
|
|
1918
1922
|
if (m)
|
|
1919
|
-
return jn(m) ? [] : (await $(() =>
|
|
1923
|
+
return jn(m) ? [] : (await $(() => Fs(t, m))).map((j) => j.userId);
|
|
1920
1924
|
const { id: w } = await n(), I = g.taskId ? `task:${g.taskId}` : `project:${g.projectId}`;
|
|
1921
1925
|
let k = c.get(I);
|
|
1922
1926
|
return k || (k = $n(t, g, w, a), c.set(I, k)), await k;
|
|
@@ -2023,7 +2027,7 @@ async function Ae(e, t) {
|
|
|
2023
2027
|
const i = await $(() => e.sync({ commands: t }));
|
|
2024
2028
|
s = i.syncStatus ?? {}, r = i.tempIdMapping ?? {};
|
|
2025
2029
|
} catch (i) {
|
|
2026
|
-
if (!(i instanceof
|
|
2030
|
+
if (!(i instanceof Ro))
|
|
2027
2031
|
return {
|
|
2028
2032
|
outcomes: t.map(() => ({ status: "rejected", reason: i })),
|
|
2029
2033
|
tempIdMapping: {}
|
|
@@ -2037,11 +2041,11 @@ async function Ae(e, t) {
|
|
|
2037
2041
|
reason: new Error("Todoist did not report whether this change was applied")
|
|
2038
2042
|
} : {
|
|
2039
2043
|
status: "rejected",
|
|
2040
|
-
reason: new
|
|
2044
|
+
reason: new No(a.error, a.httpCode, a)
|
|
2041
2045
|
};
|
|
2042
2046
|
}), tempIdMapping: r };
|
|
2043
2047
|
}
|
|
2044
|
-
function
|
|
2048
|
+
function zs(e) {
|
|
2045
2049
|
return e.description || void 0;
|
|
2046
2050
|
}
|
|
2047
2051
|
const Gn = {
|
|
@@ -2078,7 +2082,7 @@ const Gn = {
|
|
|
2078
2082
|
id: a.id,
|
|
2079
2083
|
name: a.name,
|
|
2080
2084
|
query: a.query,
|
|
2081
|
-
description:
|
|
2085
|
+
description: zs(a),
|
|
2082
2086
|
color: we.parse(a.color),
|
|
2083
2087
|
isFavorite: a.isFavorite,
|
|
2084
2088
|
itemOrder: a.itemOrder
|
|
@@ -2320,7 +2324,7 @@ ${u}` + (d.length > 5 ? `
|
|
|
2320
2324
|
this.stateByClient = /* @__PURE__ */ new WeakMap();
|
|
2321
2325
|
}
|
|
2322
2326
|
}
|
|
2323
|
-
const
|
|
2327
|
+
const Ys = new ai(), ci = o.object({
|
|
2324
2328
|
name: o.string().min(1).describe("The name of the project."),
|
|
2325
2329
|
parentId: o.string().optional().describe("The ID of the parent project. If provided, creates this as a sub-project."),
|
|
2326
2330
|
isFavorite: o.boolean().optional().describe("Whether the project is a favorite. Defaults to false."),
|
|
@@ -2353,7 +2357,7 @@ const zs = new ai(), ci = o.object({
|
|
|
2353
2357
|
return Promise.resolve(void 0);
|
|
2354
2358
|
let p = s.get(u);
|
|
2355
2359
|
return p || (p = $(
|
|
2356
|
-
() =>
|
|
2360
|
+
() => Ys.resolveWorkspace(t, u)
|
|
2357
2361
|
).then(({ workspaceId: h }) => h), s.set(u, p)), p;
|
|
2358
2362
|
}, i = await Promise.allSettled(
|
|
2359
2363
|
e.map(async ({ workspace: u, ...p }) => {
|
|
@@ -2406,7 +2410,7 @@ function pi(e) {
|
|
|
2406
2410
|
};
|
|
2407
2411
|
}
|
|
2408
2412
|
function hi(e) {
|
|
2409
|
-
const t =
|
|
2413
|
+
const t = Us(e);
|
|
2410
2414
|
return t === void 0 || t >= 500 && t !== 503;
|
|
2411
2415
|
}
|
|
2412
2416
|
function mi({
|
|
@@ -2418,7 +2422,7 @@ function mi({
|
|
|
2418
2422
|
${r}` : "Added 0 projects";
|
|
2419
2423
|
return R(n, t);
|
|
2420
2424
|
}
|
|
2421
|
-
async function
|
|
2425
|
+
async function Vs(e, t) {
|
|
2422
2426
|
const s = /* @__PURE__ */ new Map();
|
|
2423
2427
|
for (const i of t) {
|
|
2424
2428
|
const a = i?.trim();
|
|
@@ -2427,7 +2431,7 @@ async function Ys(e, t) {
|
|
|
2427
2431
|
const r = /* @__PURE__ */ new Map();
|
|
2428
2432
|
for (const [i, a] of s)
|
|
2429
2433
|
try {
|
|
2430
|
-
const [c] = await $(() =>
|
|
2434
|
+
const [c] = await $(() => Fs(e, [a]));
|
|
2431
2435
|
r.set(i, { status: "fulfilled", value: c?.userId });
|
|
2432
2436
|
} catch (c) {
|
|
2433
2437
|
r.set(i, { status: "rejected", reason: c });
|
|
@@ -2440,7 +2444,7 @@ async function Ys(e, t) {
|
|
|
2440
2444
|
function Fe(e) {
|
|
2441
2445
|
return e.trim().toLowerCase();
|
|
2442
2446
|
}
|
|
2443
|
-
function
|
|
2447
|
+
function Js(e, t) {
|
|
2444
2448
|
return e.flatMap((s, r) => {
|
|
2445
2449
|
const n = t[r];
|
|
2446
2450
|
return !n || s.notifyUid === n ? [] : [
|
|
@@ -2448,15 +2452,15 @@ function Vs(e, t) {
|
|
|
2448
2452
|
];
|
|
2449
2453
|
});
|
|
2450
2454
|
}
|
|
2451
|
-
const xe = 25, Pe = o.enum(
|
|
2455
|
+
const xe = 25, Pe = o.enum(Lo), Xs = o.object({
|
|
2452
2456
|
date: o.string().optional().describe("Due date in YYYY-MM-DD format."),
|
|
2453
2457
|
string: o.string().optional().describe('Natural language due string, e.g. "tomorrow at 3pm".'),
|
|
2454
2458
|
timezone: o.string().optional().describe('Timezone for the reminder, e.g. "America/New_York".'),
|
|
2455
2459
|
lang: o.string().optional().describe('Language for parsing the due string, e.g. "en".')
|
|
2456
|
-
}),
|
|
2457
|
-
`${
|
|
2460
|
+
}), Zs = o.enum(fs), Re = o.boolean().optional().describe("Whether this is an urgent reminder. Applies to relative and absolute reminders."), Qs = `Who to remind: user ID, email, name, or "me". Must collaborate on the task's project.`, jt = N(
|
|
2461
|
+
`${Qs} Defaults to the creator.`
|
|
2458
2462
|
), $t = N(
|
|
2459
|
-
`${
|
|
2463
|
+
`${Qs} Omit to keep the current one.`
|
|
2460
2464
|
), fi = o.object({
|
|
2461
2465
|
type: o.literal("relative"),
|
|
2462
2466
|
taskId: o.string().min(1).describe("The ID of the task to set a reminder for."),
|
|
@@ -2471,7 +2475,7 @@ const xe = 25, Pe = o.enum(No), Js = o.object({
|
|
|
2471
2475
|
}), bi = o.object({
|
|
2472
2476
|
type: o.literal("absolute"),
|
|
2473
2477
|
taskId: o.string().min(1).describe("The ID of the task to set a reminder for."),
|
|
2474
|
-
due:
|
|
2478
|
+
due: Xs.describe("The specific date/time for the reminder."),
|
|
2475
2479
|
service: Pe.optional().describe(
|
|
2476
2480
|
'Delivery method: "email" or "push" notification. Defaults to push.'
|
|
2477
2481
|
),
|
|
@@ -2483,7 +2487,7 @@ const xe = 25, Pe = o.enum(No), Js = o.object({
|
|
|
2483
2487
|
name: o.string().min(1).describe('Name of the location, e.g. "Office", "Home".'),
|
|
2484
2488
|
locLat: o.string().describe('Latitude of the location as a string, e.g. "37.7749".'),
|
|
2485
2489
|
locLong: o.string().describe('Longitude of the location as a string, e.g. "-122.4194".'),
|
|
2486
|
-
locTrigger:
|
|
2490
|
+
locTrigger: Zs.describe(
|
|
2487
2491
|
'When to trigger: "on_enter" (arriving) or "on_leave" (departing).'
|
|
2488
2492
|
),
|
|
2489
2493
|
radius: o.number().int().optional().describe("Radius in meters for the geofence. Defaults to server default."),
|
|
@@ -2516,7 +2520,7 @@ const xe = 25, Pe = o.enum(No), Js = o.object({
|
|
|
2516
2520
|
openWorldHint: !0
|
|
2517
2521
|
},
|
|
2518
2522
|
async execute(e, t) {
|
|
2519
|
-
const { reminders: s } = e, r = await
|
|
2523
|
+
const { reminders: s } = e, r = await Vs(
|
|
2520
2524
|
t,
|
|
2521
2525
|
s.map((l) => l.notifyUser)
|
|
2522
2526
|
), n = await Promise.allSettled(
|
|
@@ -2577,7 +2581,7 @@ const xe = 25, Pe = o.enum(No), Js = o.object({
|
|
|
2577
2581
|
textContent: R(
|
|
2578
2582
|
[
|
|
2579
2583
|
vi(i),
|
|
2580
|
-
...
|
|
2584
|
+
...Js(i, a)
|
|
2581
2585
|
].join(`
|
|
2582
2586
|
`),
|
|
2583
2587
|
c
|
|
@@ -2595,7 +2599,7 @@ const xe = 25, Pe = o.enum(No), Js = o.object({
|
|
|
2595
2599
|
}
|
|
2596
2600
|
};
|
|
2597
2601
|
function vi(e) {
|
|
2598
|
-
const { timeBasedCount: t, locationCount: s } =
|
|
2602
|
+
const { timeBasedCount: t, locationCount: s } = Ks(e), r = [];
|
|
2599
2603
|
if (t > 0) {
|
|
2600
2604
|
const n = t > 1 ? "reminders" : "reminder";
|
|
2601
2605
|
r.push(`${t} time-based ${n}`);
|
|
@@ -2897,7 +2901,7 @@ const At = new Ai(), Kt = vs.TASKS_PER_OPERATION, Di = o.object({
|
|
|
2897
2901
|
deadlineDate: N(
|
|
2898
2902
|
'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.'
|
|
2899
2903
|
),
|
|
2900
|
-
duration: N(
|
|
2904
|
+
duration: N(_s),
|
|
2901
2905
|
labels: o.array(o.string()).optional().describe("The labels to attach to the task."),
|
|
2902
2906
|
projectId: N(
|
|
2903
2907
|
'The project ID to add this task to. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
@@ -3012,7 +3016,7 @@ async function Ui(e, t, s) {
|
|
|
3012
3016
|
labels: u,
|
|
3013
3017
|
deadlineDate: p
|
|
3014
3018
|
};
|
|
3015
|
-
if (l && (b.priority =
|
|
3019
|
+
if (l && (b.priority = Rs(l)), d && !f && !i && !a)
|
|
3016
3020
|
throw new Error(
|
|
3017
3021
|
`Task "${e.content}": Cannot assign tasks without specifying project context. Please specify a projectId, sectionId, or parentId.`
|
|
3018
3022
|
);
|
|
@@ -3054,7 +3058,7 @@ async function Ui(e, t, s) {
|
|
|
3054
3058
|
try {
|
|
3055
3059
|
return await X(() => t.addTask(b));
|
|
3056
3060
|
} catch (m) {
|
|
3057
|
-
const g =
|
|
3061
|
+
const g = cr(m, {
|
|
3058
3062
|
taskContent: e.content,
|
|
3059
3063
|
dueString: e.dueString,
|
|
3060
3064
|
deadlineDate: e.deadlineDate
|
|
@@ -3180,7 +3184,7 @@ function Hi({
|
|
|
3180
3184
|
failures: t
|
|
3181
3185
|
});
|
|
3182
3186
|
}
|
|
3183
|
-
const
|
|
3187
|
+
const eo = [
|
|
3184
3188
|
"project",
|
|
3185
3189
|
"section",
|
|
3186
3190
|
"task",
|
|
@@ -3190,11 +3194,11 @@ const Qs = [
|
|
|
3190
3194
|
"reminder",
|
|
3191
3195
|
"location_reminder"
|
|
3192
3196
|
], Wi = {
|
|
3193
|
-
type: o.enum(
|
|
3197
|
+
type: o.enum(eo).describe("The type of entity to delete."),
|
|
3194
3198
|
id: o.string().min(1).describe("The ID of the entity to delete.")
|
|
3195
3199
|
}, Bi = {
|
|
3196
3200
|
deletedEntity: o.object({
|
|
3197
|
-
type: o.enum(
|
|
3201
|
+
type: o.enum(eo).describe("The type of deleted entity."),
|
|
3198
3202
|
id: o.string().describe("The ID of the deleted entity.")
|
|
3199
3203
|
}).describe("Information about the deleted entity."),
|
|
3200
3204
|
success: o.boolean().describe("Whether the deletion was successful.")
|
|
@@ -3245,16 +3249,16 @@ const Qs = [
|
|
|
3245
3249
|
}
|
|
3246
3250
|
};
|
|
3247
3251
|
}
|
|
3248
|
-
}, Gt = 5,
|
|
3252
|
+
}, Gt = 5, to = ["file", "url"], qi = {
|
|
3249
3253
|
projectId: o.string().min(1).describe("The ID of the project to export as a template."),
|
|
3250
|
-
format: o.enum(
|
|
3254
|
+
format: o.enum(to).default("file").describe(
|
|
3251
3255
|
'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.'
|
|
3252
3256
|
),
|
|
3253
3257
|
useRelativeDates: o.boolean().optional().describe(
|
|
3254
3258
|
'Export due dates relative to the import date (e.g. "day 3") instead of absolute dates. Defaults to false.'
|
|
3255
3259
|
)
|
|
3256
3260
|
}, Gi = {
|
|
3257
|
-
format: o.enum(
|
|
3261
|
+
format: o.enum(to).describe("The format the template was exported in."),
|
|
3258
3262
|
content: o.string().optional().describe('The template as CSV content. Only present when format is "file".'),
|
|
3259
3263
|
lineCount: o.number().optional().describe('Number of rows in the exported CSV. Only present when format is "file".'),
|
|
3260
3264
|
fileName: o.string().optional().describe('The generated template file name. Only present when format is "url".'),
|
|
@@ -3358,7 +3362,7 @@ async function Zi(e, t) {
|
|
|
3358
3362
|
async function Qi(e, t) {
|
|
3359
3363
|
if (!z(t))
|
|
3360
3364
|
return { childCount: 0, children: [] };
|
|
3361
|
-
const s = await
|
|
3365
|
+
const s = await Bs(e), r = /* @__PURE__ */ new Map();
|
|
3362
3366
|
for (const a of s) {
|
|
3363
3367
|
if (!z(a) || !a.parentId) continue;
|
|
3364
3368
|
const c = r.get(a.parentId) ?? [];
|
|
@@ -3388,14 +3392,14 @@ function Yt(e, t) {
|
|
|
3388
3392
|
const s = t.hasMoreChildren ? "+" : "", r = t.childrenError ? " (partial)" : "";
|
|
3389
3393
|
return ` • ${e}=${t.childCount}${s}${r}`;
|
|
3390
3394
|
}
|
|
3391
|
-
const
|
|
3392
|
-
type: o.enum(
|
|
3395
|
+
const so = ["task", "project", "comment", "section"], ea = {
|
|
3396
|
+
type: o.enum(so).describe("The type of object to fetch."),
|
|
3393
3397
|
id: o.string().min(1).describe("The unique ID of the object to fetch."),
|
|
3394
3398
|
includeChildren: o.boolean().optional().describe(
|
|
3395
3399
|
"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."
|
|
3396
3400
|
)
|
|
3397
3401
|
}, ta = {
|
|
3398
|
-
type: o.enum(
|
|
3402
|
+
type: o.enum(so).describe("The type of object fetched."),
|
|
3399
3403
|
id: o.string().describe("The ID of the fetched object."),
|
|
3400
3404
|
object: o.union([V, de, $e, Z]).describe("The fetched object data."),
|
|
3401
3405
|
...Xi
|
|
@@ -3552,7 +3556,7 @@ function Vt(e) {
|
|
|
3552
3556
|
const aa = {
|
|
3553
3557
|
objectType: o.enum(Ts).optional().describe("Type of object to filter by."),
|
|
3554
3558
|
objectId: o.string().optional().describe("Filter by specific object ID (task, project, or comment). Requires objectType."),
|
|
3555
|
-
eventType: o.enum(
|
|
3559
|
+
eventType: o.enum(Mo).optional().describe("Type of event to filter by."),
|
|
3556
3560
|
projectId: o.string().optional().describe("Filter events by parent project ID."),
|
|
3557
3561
|
taskId: o.string().optional().describe("Filter events by parent task ID (for subtask events)."),
|
|
3558
3562
|
initiatorId: o.string().optional().describe(
|
|
@@ -3781,17 +3785,17 @@ function ga({
|
|
|
3781
3785
|
i = `Found ${e.length} ${d} for ${t} ${s}${c}`, r && (i += " • More available");
|
|
3782
3786
|
}
|
|
3783
3787
|
if (n) {
|
|
3784
|
-
const a =
|
|
3788
|
+
const a = Gs([], n);
|
|
3785
3789
|
return `${i}
|
|
3786
3790
|
${a}`;
|
|
3787
3791
|
}
|
|
3788
3792
|
return i;
|
|
3789
3793
|
}
|
|
3790
|
-
function
|
|
3794
|
+
function oo(e) {
|
|
3791
3795
|
const t = e.getUTCFullYear(), s = String(e.getUTCMonth() + 1).padStart(2, "0"), r = String(e.getUTCDate()).padStart(2, "0");
|
|
3792
3796
|
return `${t}-${s}-${r}`;
|
|
3793
3797
|
}
|
|
3794
|
-
function
|
|
3798
|
+
function ro(e) {
|
|
3795
3799
|
const t = /^([+-])(\d{2}):(\d{2})$/.exec(e);
|
|
3796
3800
|
if (!t)
|
|
3797
3801
|
return 0;
|
|
@@ -3800,14 +3804,14 @@ function oo(e) {
|
|
|
3800
3804
|
}
|
|
3801
3805
|
function ya(e, t) {
|
|
3802
3806
|
const s = new Date(e.getTime() + t * 60 * 1e3);
|
|
3803
|
-
return
|
|
3807
|
+
return oo(s);
|
|
3804
3808
|
}
|
|
3805
3809
|
function Jt(e, t) {
|
|
3806
3810
|
const [s, r, n] = e.split("-"), i = Number(s), a = Number(r), c = Number(n);
|
|
3807
3811
|
if (!Number.isFinite(i) || !Number.isFinite(a) || !Number.isFinite(c))
|
|
3808
3812
|
throw new Error(`Invalid date format: ${e}. Expected YYYY-MM-DD.`);
|
|
3809
3813
|
const d = new Date(Date.UTC(i, a - 1, c));
|
|
3810
|
-
return d.setUTCDate(d.getUTCDate() + t),
|
|
3814
|
+
return d.setUTCDate(d.getUTCDate() + t), oo(d);
|
|
3811
3815
|
}
|
|
3812
3816
|
const Ta = ["and", "or"], Dt = {
|
|
3813
3817
|
labels: o.string().array().optional().describe("The labels to filter the tasks by"),
|
|
@@ -3827,7 +3831,7 @@ function ka({
|
|
|
3827
3831
|
userGmtOffset: s,
|
|
3828
3832
|
now: r = /* @__PURE__ */ new Date()
|
|
3829
3833
|
}) {
|
|
3830
|
-
const n =
|
|
3834
|
+
const n = ro(s), i = ya(r, n), a = wa - 1, c = t ?? (e ? Jt(e, a) : i);
|
|
3831
3835
|
return {
|
|
3832
3836
|
since: e ?? Jt(c, -a),
|
|
3833
3837
|
until: c
|
|
@@ -4028,7 +4032,7 @@ No shared labels.`;
|
|
|
4028
4032
|
zeroReasonHints: p
|
|
4029
4033
|
}) + h;
|
|
4030
4034
|
}
|
|
4031
|
-
const { FIND_PROJECTS:
|
|
4035
|
+
const { FIND_PROJECTS: no, ADD_TASKS: io, UPDATE_TASKS: ao } = T, Ea = {
|
|
4032
4036
|
projectId: o.string().min(1).optional().describe(
|
|
4033
4037
|
'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.'
|
|
4034
4038
|
),
|
|
@@ -4065,7 +4069,7 @@ const { FIND_PROJECTS: ro, ADD_TASKS: no, UPDATE_TASKS: io } = T, Ea = {
|
|
|
4065
4069
|
|
|
4066
4070
|
**Next steps:**
|
|
4067
4071
|
• Share the project to enable collaboration
|
|
4068
|
-
• Use ${
|
|
4072
|
+
• Use ${io} and ${ao} for assignment features once shared`,
|
|
4069
4073
|
structuredContent: {
|
|
4070
4074
|
collaborators: [],
|
|
4071
4075
|
projectInfo: {
|
|
@@ -4102,9 +4106,9 @@ const { FIND_PROJECTS: ro, ADD_TASKS: no, UPDATE_TASKS: io } = T, Ea = {
|
|
|
4102
4106
|
appliedFilters: e
|
|
4103
4107
|
}
|
|
4104
4108
|
};
|
|
4105
|
-
const c =
|
|
4109
|
+
const c = co(a, r);
|
|
4106
4110
|
return {
|
|
4107
|
-
textContent:
|
|
4111
|
+
textContent: lo({
|
|
4108
4112
|
collaborators: c,
|
|
4109
4113
|
projectName: n,
|
|
4110
4114
|
searchTerm: r,
|
|
@@ -4135,7 +4139,7 @@ async function Ua({
|
|
|
4135
4139
|
textContent: `No users found. You may have no shared projects, or collaborator data is not accessible.
|
|
4136
4140
|
|
|
4137
4141
|
**Next steps:**
|
|
4138
|
-
• Use ${
|
|
4142
|
+
• Use ${no} to find shared projects
|
|
4139
4143
|
• Share a project to add collaborators
|
|
4140
4144
|
• Ensure you have permission to view collaborators`,
|
|
4141
4145
|
structuredContent: {
|
|
@@ -4146,9 +4150,9 @@ async function Ua({
|
|
|
4146
4150
|
appliedFilters: s
|
|
4147
4151
|
}
|
|
4148
4152
|
};
|
|
4149
|
-
const i =
|
|
4153
|
+
const i = co(n, e);
|
|
4150
4154
|
return {
|
|
4151
|
-
textContent:
|
|
4155
|
+
textContent: lo({
|
|
4152
4156
|
collaborators: i,
|
|
4153
4157
|
projectName: void 0,
|
|
4154
4158
|
searchTerm: e,
|
|
@@ -4174,7 +4178,7 @@ async function _a(e, t) {
|
|
|
4174
4178
|
return t;
|
|
4175
4179
|
}
|
|
4176
4180
|
}
|
|
4177
|
-
function
|
|
4181
|
+
function co(e, t) {
|
|
4178
4182
|
if (!t)
|
|
4179
4183
|
return e;
|
|
4180
4184
|
const s = t.toLowerCase().trim();
|
|
@@ -4182,7 +4186,7 @@ function ao(e, t) {
|
|
|
4182
4186
|
(r) => r.name.toLowerCase().includes(s) || r.email.toLowerCase().includes(s)
|
|
4183
4187
|
);
|
|
4184
4188
|
}
|
|
4185
|
-
function
|
|
4189
|
+
function lo({
|
|
4186
4190
|
collaborators: e,
|
|
4187
4191
|
projectName: t,
|
|
4188
4192
|
searchTerm: s,
|
|
@@ -4198,7 +4202,7 @@ function co({
|
|
|
4198
4202
|
const l = [];
|
|
4199
4203
|
e.length === 0 && s && (l.push(`No users match "${s}"`), l.push("Try a broader search term or check spelling"), r > 0 && l.push(`${r} users available without filter`));
|
|
4200
4204
|
const u = [];
|
|
4201
|
-
return e.length > 0 ? (u.push(`Use ${
|
|
4205
|
+
return e.length > 0 ? (u.push(`Use ${io} with responsibleUser to assign new tasks`), u.push(`Use ${ao} with responsibleUser to reassign existing tasks`), u.push("Use user names, emails, or IDs for assignments")) : (u.push(`Use ${no} to find other projects`), s && r > 0 && u.push("Try searching without filters to see all users")), ee({
|
|
4202
4206
|
subject: a,
|
|
4203
4207
|
count: e.length,
|
|
4204
4208
|
filterHints: c,
|
|
@@ -4240,7 +4244,7 @@ const { ADD_PROJECTS: Xt } = T, Pa = {
|
|
|
4240
4244
|
let n, i = null;
|
|
4241
4245
|
if (s || r === "all") {
|
|
4242
4246
|
const c = Promise.resolve([]), [d, l] = await Promise.all([
|
|
4243
|
-
r === "archived" ? c : s ?
|
|
4247
|
+
r === "archived" ? c : s ? Ws(t, s) : Bs(t),
|
|
4244
4248
|
r === "active" ? c : yn(t)
|
|
4245
4249
|
]), u = s ? Tn(s) : null, p = u ? l.filter((h) => u.test(h.name)) : l;
|
|
4246
4250
|
n = [...d, ...p];
|
|
@@ -4360,7 +4364,7 @@ const Fa = {
|
|
|
4360
4364
|
function Ba(e, t) {
|
|
4361
4365
|
if (e.length === 0)
|
|
4362
4366
|
return `No reminders found for task ${t}`;
|
|
4363
|
-
const { timeBasedCount: s, locationCount: r } =
|
|
4367
|
+
const { timeBasedCount: s, locationCount: r } = Ks(e), n = [];
|
|
4364
4368
|
if (s > 0) {
|
|
4365
4369
|
const i = s > 1 ? "time-based reminders" : "time-based reminder";
|
|
4366
4370
|
n.push(`${s} ${i}`);
|
|
@@ -4428,7 +4432,7 @@ function Ya({
|
|
|
4428
4432
|
zeroReasonHints: r
|
|
4429
4433
|
});
|
|
4430
4434
|
}
|
|
4431
|
-
function
|
|
4435
|
+
function uo(e) {
|
|
4432
4436
|
return /* @__PURE__ */ new Date(`${e}T00:00:00`);
|
|
4433
4437
|
}
|
|
4434
4438
|
const Va = {
|
|
@@ -4448,7 +4452,7 @@ const Va = {
|
|
|
4448
4452
|
responsibleUser: o.string().optional().describe(
|
|
4449
4453
|
"Filter tasks assigned to this user. User ID, name, or email. The current user also includes unassigned tasks."
|
|
4450
4454
|
),
|
|
4451
|
-
responsibleUserFiltering: o.enum(
|
|
4455
|
+
responsibleUserFiltering: o.enum(Hs).optional().describe(
|
|
4452
4456
|
"Filter when responsibleUser is omitted. 'assigned'=assigned to others; 'unassignedOrMe'=unassigned+mine; 'all'=everyone. Default: 'unassignedOrMe'."
|
|
4453
4457
|
),
|
|
4454
4458
|
...Dt
|
|
@@ -4470,7 +4474,7 @@ const Va = {
|
|
|
4470
4474
|
throw new Error(
|
|
4471
4475
|
"Either startDate must be provided or overdueOption must be set to overdue-only"
|
|
4472
4476
|
);
|
|
4473
|
-
const r = await gt(t, e.responsibleUser), n = r?.userId, i = r?.email, c = e.responsibleUser?.trim().toLowerCase() ===
|
|
4477
|
+
const r = await gt(t, e.responsibleUser), n = r?.userId, i = r?.email, c = e.responsibleUser?.trim().toLowerCase() === Ms ? n : n ? (await t.getUser()).id : void 0;
|
|
4474
4478
|
let d = "";
|
|
4475
4479
|
if (e.overdueOption === "overdue-only")
|
|
4476
4480
|
d = "overdue";
|
|
@@ -4481,7 +4485,7 @@ const Va = {
|
|
|
4481
4485
|
} else
|
|
4482
4486
|
d = e.overdueOption === "exclude-overdue" ? "today" : "(today | overdue)";
|
|
4483
4487
|
else if (e.startDate) {
|
|
4484
|
-
const b = e.startDate, m = Ye(
|
|
4488
|
+
const b = e.startDate, m = Ye(uo(b), e.daysCount), g = xt(m, { representation: "date" });
|
|
4485
4489
|
d = `(due after: ${b} | due: ${b}) & due before: ${g}`;
|
|
4486
4490
|
}
|
|
4487
4491
|
const l = Et(e.labels, e.labelsOperator);
|
|
@@ -4533,7 +4537,7 @@ function Za({
|
|
|
4533
4537
|
`today${d}${t.daysCount > 1 ? ` + ${t.daysCount - 1} more days` : ""}`
|
|
4534
4538
|
);
|
|
4535
4539
|
} else if (t.startDate) {
|
|
4536
|
-
const d = t.daysCount > 1 ? ` to ${be(Ye(
|
|
4540
|
+
const d = t.daysCount > 1 ? ` to ${be(Ye(uo(t.startDate), t.daysCount))}` : "";
|
|
4537
4541
|
i.push(`${t.startDate}${d}`);
|
|
4538
4542
|
}
|
|
4539
4543
|
if (t.labels && t.labels.length > 0) {
|
|
@@ -4642,7 +4646,7 @@ const tc = new ec(), { FIND_COMPLETED_TASKS: Zt, ADD_TASKS: Qt } = T, sc = {
|
|
|
4642
4646
|
responsibleUser: o.string().optional().describe(
|
|
4643
4647
|
"Find tasks assigned to this user. Can be a user ID, name, or email address. The current user also includes unassigned tasks."
|
|
4644
4648
|
),
|
|
4645
|
-
responsibleUserFiltering: o.enum(
|
|
4649
|
+
responsibleUserFiltering: o.enum(Hs).optional().describe(
|
|
4646
4650
|
'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`.'
|
|
4647
4651
|
),
|
|
4648
4652
|
limit: o.number().int().min(1).max(D.TASKS_MAX).default(D.TASKS_DEFAULT).describe("The maximum number of tasks to return."),
|
|
@@ -4871,7 +4875,7 @@ const ic = {
|
|
|
4871
4875
|
projectId: o.string().min(1).optional().describe(
|
|
4872
4876
|
`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.`
|
|
4873
4877
|
)
|
|
4874
|
-
},
|
|
4878
|
+
}, po = o.lazy(
|
|
4875
4879
|
() => o.object({
|
|
4876
4880
|
id: o.string().describe("The project ID."),
|
|
4877
4881
|
name: o.string().describe("The project name."),
|
|
@@ -4879,7 +4883,7 @@ const ic = {
|
|
|
4879
4883
|
folderId: o.string().optional().describe("The folder ID this project belongs to (workspace projects only)."),
|
|
4880
4884
|
childOrder: o.number().describe("The ordering index among siblings."),
|
|
4881
4885
|
sections: o.array(Z),
|
|
4882
|
-
children: o.array(
|
|
4886
|
+
children: o.array(po).describe("Nested child projects.")
|
|
4883
4887
|
})
|
|
4884
4888
|
), ac = {
|
|
4885
4889
|
type: o.enum(["account_overview", "project_overview"]).describe("The type of overview returned."),
|
|
@@ -4900,7 +4904,7 @@ const ic = {
|
|
|
4900
4904
|
name: o.string().describe("The inbox project name."),
|
|
4901
4905
|
sections: o.array(Z).describe("Sections in the inbox project.")
|
|
4902
4906
|
}).optional().describe("Inbox information (account overview only)."),
|
|
4903
|
-
projects: o.array(o.lazy(() =>
|
|
4907
|
+
projects: o.array(o.lazy(() => po)).optional().describe(
|
|
4904
4908
|
"List of projects with hierarchy, folders, and ordering (account overview only)."
|
|
4905
4909
|
),
|
|
4906
4910
|
project: o.object({
|
|
@@ -4949,14 +4953,14 @@ async function dc(e, t) {
|
|
|
4949
4953
|
})
|
|
4950
4954
|
), s;
|
|
4951
4955
|
}
|
|
4952
|
-
function
|
|
4956
|
+
function ho(e, t, s = "") {
|
|
4953
4957
|
const r = [];
|
|
4954
4958
|
r.push(`${s}- Project: ${e.name} (id=${e.id})`);
|
|
4955
4959
|
const n = t[e.id] || [];
|
|
4956
4960
|
for (const i of n)
|
|
4957
4961
|
r.push(`${s} - Section: ${i.name} (id=${i.id})`);
|
|
4958
4962
|
for (const i of e.children)
|
|
4959
|
-
r.push(...
|
|
4963
|
+
r.push(...ho(i, t, `${s} `));
|
|
4960
4964
|
return r;
|
|
4961
4965
|
}
|
|
4962
4966
|
function es(e) {
|
|
@@ -4984,7 +4988,7 @@ function nt(e, t, s = "") {
|
|
|
4984
4988
|
}
|
|
4985
4989
|
return r;
|
|
4986
4990
|
}
|
|
4987
|
-
function
|
|
4991
|
+
function mo(e, t) {
|
|
4988
4992
|
return {
|
|
4989
4993
|
id: e.id,
|
|
4990
4994
|
name: e.name,
|
|
@@ -4993,7 +4997,7 @@ function ho(e, t) {
|
|
|
4993
4997
|
childOrder: e.childOrder,
|
|
4994
4998
|
sections: (t[e.id] || []).map(Q),
|
|
4995
4999
|
children: e.children.map(
|
|
4996
|
-
(s) =>
|
|
5000
|
+
(s) => mo(s, t)
|
|
4997
5001
|
)
|
|
4998
5002
|
};
|
|
4999
5003
|
}
|
|
@@ -5022,7 +5026,7 @@ async function pc(e) {
|
|
|
5022
5026
|
}
|
|
5023
5027
|
if (n.length)
|
|
5024
5028
|
for (const p of n)
|
|
5025
|
-
c.push(...
|
|
5029
|
+
c.push(...ho(p, a));
|
|
5026
5030
|
else
|
|
5027
5031
|
c.push("_No projects found._");
|
|
5028
5032
|
c.push(""), c.push(
|
|
@@ -5043,7 +5047,7 @@ async function pc(e) {
|
|
|
5043
5047
|
sections: (a[s.id] || []).map(Q)
|
|
5044
5048
|
} : void 0,
|
|
5045
5049
|
projects: n.map(
|
|
5046
|
-
(p) =>
|
|
5050
|
+
(p) => mo(p, a)
|
|
5047
5051
|
),
|
|
5048
5052
|
totalProjects: t.length,
|
|
5049
5053
|
totalSections: i.reduce(
|
|
@@ -5431,7 +5435,7 @@ const Ac = {
|
|
|
5431
5435
|
activeUntil: o.string().optional().describe("ISO 8601 end. Omitted when it has no end."),
|
|
5432
5436
|
pauseNotifications: o.boolean().describe("Comms notifications held back."),
|
|
5433
5437
|
pauseActivity: o.boolean().describe("Karma and streaks paused.")
|
|
5434
|
-
}),
|
|
5438
|
+
}), fo = {
|
|
5435
5439
|
hasStatus: o.boolean(),
|
|
5436
5440
|
status: Dc.optional().describe("Omitted when there is no active status.")
|
|
5437
5441
|
};
|
|
@@ -5440,7 +5444,7 @@ function Ec(e) {
|
|
|
5440
5444
|
throw new Error("Todoist did not return the user, so the status is unknown.");
|
|
5441
5445
|
return e.user.status ?? null;
|
|
5442
5446
|
}
|
|
5443
|
-
async function
|
|
5447
|
+
async function bo(e) {
|
|
5444
5448
|
const t = await $(
|
|
5445
5449
|
() => e.sync({ resourceTypes: ["user"], syncToken: "*" })
|
|
5446
5450
|
);
|
|
@@ -5478,10 +5482,10 @@ const Oc = {}, Uc = {
|
|
|
5478
5482
|
name: T.GET_USER_STATUS,
|
|
5479
5483
|
description: "Get the user's status, the message and emoji shown next to their name in Todoist and Comms, with when it ends and whether it pauses Comms notifications or Karma and streaks. Returns no status when none is set or it has expired.",
|
|
5480
5484
|
parameters: Oc,
|
|
5481
|
-
outputSchema:
|
|
5485
|
+
outputSchema: fo,
|
|
5482
5486
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
5483
5487
|
async execute(e, t) {
|
|
5484
|
-
return it(await
|
|
5488
|
+
return it(await bo(t), "Status");
|
|
5485
5489
|
}
|
|
5486
5490
|
}, _c = {
|
|
5487
5491
|
workspaceIdOrName: o.string().min(1).describe(
|
|
@@ -5515,7 +5519,7 @@ const Oc = {}, Uc = {
|
|
|
5515
5519
|
idempotentHint: !0
|
|
5516
5520
|
},
|
|
5517
5521
|
async execute(e, t) {
|
|
5518
|
-
const { workspaceIdOrName: s, projectIds: r } = e, n = await
|
|
5522
|
+
const { workspaceIdOrName: s, projectIds: r } = e, n = await Ys.resolveWorkspace(t, s), a = (await t.getWorkspaceInsights(n.workspaceId, { projectIds: r })).projectInsights.map((d) => ({
|
|
5519
5523
|
projectId: d.projectId,
|
|
5520
5524
|
health: d.health ? {
|
|
5521
5525
|
status: d.health.status,
|
|
@@ -5563,7 +5567,7 @@ function Lc(e) {
|
|
|
5563
5567
|
`"${s.hostname}" is not a Todoist domain. Pass a todoist.com template URL or the template ID itself.`
|
|
5564
5568
|
);
|
|
5565
5569
|
s.hostname = "todoist.com";
|
|
5566
|
-
const r =
|
|
5570
|
+
const r = Fo(s.toString());
|
|
5567
5571
|
if (r?.type !== "template")
|
|
5568
5572
|
throw new Error(`"${t}" is not a Todoist template URL.`);
|
|
5569
5573
|
return r.id;
|
|
@@ -5635,8 +5639,8 @@ function Bc({
|
|
|
5635
5639
|
const Kc = {}, qc = {
|
|
5636
5640
|
id: o.string().describe("The unique identifier for the workspace."),
|
|
5637
5641
|
name: o.string().describe("The name of the workspace."),
|
|
5638
|
-
plan: o.enum(
|
|
5639
|
-
role: o.enum(
|
|
5642
|
+
plan: o.enum(Wo).describe("The workspace plan type."),
|
|
5643
|
+
role: o.enum(Ho).optional().describe("The user's role in the workspace, if available."),
|
|
5640
5644
|
isLinkSharingEnabled: o.boolean().describe("Whether link sharing is enabled for the workspace."),
|
|
5641
5645
|
isGuestAllowed: o.boolean().describe("Whether guests are allowed in the workspace."),
|
|
5642
5646
|
createdAt: o.string().optional().describe("The ISO 8601 timestamp when the workspace was created."),
|
|
@@ -5690,9 +5694,9 @@ const Yc = {
|
|
|
5690
5694
|
structuredContent: s.structuredContent
|
|
5691
5695
|
};
|
|
5692
5696
|
}
|
|
5693
|
-
}, { FIND_TASKS: Vc, FIND_PROJECT_COLLABORATORS: ss, UPDATE_TASKS: Jc } = T,
|
|
5697
|
+
}, { FIND_TASKS: Vc, FIND_PROJECT_COLLABORATORS: ss, UPDATE_TASKS: Jc } = T, go = 50, Xc = {
|
|
5694
5698
|
operation: o.enum(["assign", "unassign", "reassign"]).describe("The assignment operation to perform."),
|
|
5695
|
-
taskIds: o.array(o.string()).min(1).max(
|
|
5699
|
+
taskIds: o.array(o.string()).min(1).max(go).describe("The IDs of the tasks to operate on (max 50)."),
|
|
5696
5700
|
responsibleUser: o.string().optional().describe(
|
|
5697
5701
|
'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.'
|
|
5698
5702
|
),
|
|
@@ -5718,7 +5722,7 @@ const Yc = {
|
|
|
5718
5722
|
}).optional().describe("Summary of the operation.")
|
|
5719
5723
|
}, Qc = {
|
|
5720
5724
|
name: T.MANAGE_ASSIGNMENTS,
|
|
5721
|
-
description: `Assign, unassign or reassign up to ${
|
|
5725
|
+
description: `Assign, unassign or reassign up to ${go} 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.`,
|
|
5722
5726
|
parameters: Xc,
|
|
5723
5727
|
outputSchema: Zc,
|
|
5724
5728
|
// Open world: assigning a task notifies the new assignee.
|
|
@@ -6036,7 +6040,7 @@ const ed = {
|
|
|
6036
6040
|
};
|
|
6037
6041
|
}
|
|
6038
6042
|
};
|
|
6039
|
-
function
|
|
6043
|
+
function yo(e, t) {
|
|
6040
6044
|
const s = new Map(e.map((h) => [h.id, h])), r = new Set(t.map((h) => h.id));
|
|
6041
6045
|
for (const h of r)
|
|
6042
6046
|
if (!s.has(h))
|
|
@@ -6104,7 +6108,7 @@ function dd(e, t) {
|
|
|
6104
6108
|
function ld(e, t) {
|
|
6105
6109
|
return e.legacyOrder - t.legacyOrder;
|
|
6106
6110
|
}
|
|
6107
|
-
const
|
|
6111
|
+
const To = ["project", "section"], ud = o.object({
|
|
6108
6112
|
id: o.string().min(1).describe("The ID of the entity."),
|
|
6109
6113
|
order: o.number().int().min(0).optional().describe(
|
|
6110
6114
|
"0-based position among its siblings after the reorder: 0 is first, past the end is last. Unlisted siblings keep their relative order."
|
|
@@ -6113,14 +6117,14 @@ const yo = ["project", "section"], ud = o.object({
|
|
|
6113
6117
|
'Move a personal project under this parent project ID, or "root" for the top level. Personal projects only.'
|
|
6114
6118
|
)
|
|
6115
6119
|
}), pd = {
|
|
6116
|
-
type: o.enum(
|
|
6120
|
+
type: o.enum(To).describe(
|
|
6117
6121
|
'"project": personal projects among the siblings under their parent, or workspace projects within their folder. "section": sections within their project.'
|
|
6118
6122
|
),
|
|
6119
6123
|
items: o.array(ud).min(1).describe(
|
|
6120
6124
|
"Each item needs order and/or parentId. Moves happen first, so order is a position under the new parent."
|
|
6121
6125
|
)
|
|
6122
6126
|
}, hd = {
|
|
6123
|
-
type: o.enum(
|
|
6127
|
+
type: o.enum(To).describe("The type of entity that was reordered/moved."),
|
|
6124
6128
|
movedCount: o.number().describe("The number of entities moved to a new parent."),
|
|
6125
6129
|
reorderedCount: o.number().describe("The number of entities reordered."),
|
|
6126
6130
|
affectedIds: o.array(o.string()).describe("The IDs of the entities moved or reordered."),
|
|
@@ -6205,7 +6209,7 @@ async function fd(e, t) {
|
|
|
6205
6209
|
});
|
|
6206
6210
|
return { movedIds: s, reorderedIds: r, failures: n };
|
|
6207
6211
|
}
|
|
6208
|
-
const u =
|
|
6212
|
+
const u = wo([...i.values()].filter(yd), rs), p = /* @__PURE__ */ new Map(), h = [];
|
|
6209
6213
|
for (const b of l) {
|
|
6210
6214
|
const m = i.get(b.id);
|
|
6211
6215
|
if (!m) {
|
|
@@ -6218,7 +6222,7 @@ async function fd(e, t) {
|
|
|
6218
6222
|
}
|
|
6219
6223
|
const f = [];
|
|
6220
6224
|
for (const [b, m] of p) {
|
|
6221
|
-
const g = u.get(b) ?? [], w =
|
|
6225
|
+
const g = u.get(b) ?? [], w = yo(g.map(Td), m);
|
|
6222
6226
|
for (const [I, k] of w) {
|
|
6223
6227
|
const C = i.get(I);
|
|
6224
6228
|
f.push({
|
|
@@ -6230,10 +6234,10 @@ async function fd(e, t) {
|
|
|
6230
6234
|
});
|
|
6231
6235
|
}
|
|
6232
6236
|
}
|
|
6233
|
-
return await
|
|
6237
|
+
return await ko(e, f, h, r, n), { movedIds: s, reorderedIds: r, failures: n };
|
|
6234
6238
|
}
|
|
6235
6239
|
async function bd(e, t) {
|
|
6236
|
-
const s = /* @__PURE__ */ new Set(), r = [], n = await wd(e), i =
|
|
6240
|
+
const s = /* @__PURE__ */ new Set(), r = [], n = await wd(e), i = wo(
|
|
6237
6241
|
[...n.values()].filter((u) => !u.isDeleted && !u.isArchived),
|
|
6238
6242
|
(u) => u.projectId
|
|
6239
6243
|
), a = t.filter((u) => u.order !== void 0), c = /* @__PURE__ */ new Map(), d = [];
|
|
@@ -6256,7 +6260,7 @@ async function bd(e, t) {
|
|
|
6256
6260
|
}
|
|
6257
6261
|
const l = [];
|
|
6258
6262
|
for (const [u, p] of c) {
|
|
6259
|
-
const h = i.get(u) ?? [], f =
|
|
6263
|
+
const h = i.get(u) ?? [], f = yo(
|
|
6260
6264
|
h.map((b) => ({
|
|
6261
6265
|
id: b.id,
|
|
6262
6266
|
key: b.orderKey ?? null,
|
|
@@ -6267,9 +6271,9 @@ async function bd(e, t) {
|
|
|
6267
6271
|
for (const [b, m] of f)
|
|
6268
6272
|
l.push({ id: b, command: ne("section_update", { id: b, orderKey: m }) });
|
|
6269
6273
|
}
|
|
6270
|
-
return await
|
|
6274
|
+
return await ko(e, l, d, s, r), { movedIds: /* @__PURE__ */ new Set(), reorderedIds: s, failures: r };
|
|
6271
6275
|
}
|
|
6272
|
-
function
|
|
6276
|
+
function wo(e, t) {
|
|
6273
6277
|
const s = /* @__PURE__ */ new Map();
|
|
6274
6278
|
for (const r of e) {
|
|
6275
6279
|
const n = t(r), i = s.get(n) ?? [];
|
|
@@ -6277,7 +6281,7 @@ function To(e, t) {
|
|
|
6277
6281
|
}
|
|
6278
6282
|
return s;
|
|
6279
6283
|
}
|
|
6280
|
-
async function
|
|
6284
|
+
async function ko(e, t, s, r, n) {
|
|
6281
6285
|
const i = /* @__PURE__ */ new Set();
|
|
6282
6286
|
if (t.length > 0) {
|
|
6283
6287
|
const { outcomes: a } = await Ae(
|
|
@@ -6422,7 +6426,7 @@ const jd = {
|
|
|
6422
6426
|
limit: D.TASKS_MAX,
|
|
6423
6427
|
cursor: void 0
|
|
6424
6428
|
}),
|
|
6425
|
-
|
|
6429
|
+
Ws(t, s)
|
|
6426
6430
|
]), i = [];
|
|
6427
6431
|
for (const a of r.tasks)
|
|
6428
6432
|
i.push({
|
|
@@ -6462,7 +6466,7 @@ function _d(e, t) {
|
|
|
6462
6466
|
throw Be(e);
|
|
6463
6467
|
const [, r, n, i, a, c, d = "0", l = ""] = s, [u, p, h, f, b, m] = [r, n, i, a, c, d].map(Number), g = /* @__PURE__ */ new Date(0);
|
|
6464
6468
|
g.setUTCFullYear(u, p - 1, h), g.setUTCHours(f, b, m);
|
|
6465
|
-
const w = g.getUTCFullYear() === u && g.getUTCMonth() === p - 1 && g.getUTCDate() === h && g.getUTCHours() === f && g.getUTCMinutes() === b && g.getUTCSeconds() === m, I = l.toUpperCase() === "Z" ? 0 :
|
|
6469
|
+
const w = g.getUTCFullYear() === u && g.getUTCMonth() === p - 1 && g.getUTCDate() === h && g.getUTCHours() === f && g.getUTCMinutes() === b && g.getUTCSeconds() === m, I = l.toUpperCase() === "Z" ? 0 : ro(l);
|
|
6466
6470
|
if (!w || I < Od || I > Ud)
|
|
6467
6471
|
throw Be(e);
|
|
6468
6472
|
const k = new Date(e);
|
|
@@ -6503,7 +6507,7 @@ const Nd = {
|
|
|
6503
6507
|
name: T.SET_USER_STATUS,
|
|
6504
6508
|
description: "Set or clear the user's status, shown next to their name in Todoist and Comms. Replaces the whole status: an omitted emoji, end or effect is removed, not kept. Use clear to remove the status.",
|
|
6505
6509
|
parameters: Ed,
|
|
6506
|
-
outputSchema:
|
|
6510
|
+
outputSchema: fo,
|
|
6507
6511
|
annotations: {
|
|
6508
6512
|
readOnlyHint: !1,
|
|
6509
6513
|
destructiveHint: !0,
|
|
@@ -6516,7 +6520,7 @@ const Nd = {
|
|
|
6516
6520
|
} = await Ae(t, [ne("user_update", { status: s })]);
|
|
6517
6521
|
if (r?.status !== "fulfilled")
|
|
6518
6522
|
throw r?.reason ?? new Error("Todoist did not report whether the status was applied.");
|
|
6519
|
-
const n = await
|
|
6523
|
+
const n = await bo(t).catch(() => {
|
|
6520
6524
|
throw new Error(
|
|
6521
6525
|
`The status was written, but reading it back failed, so it is unconfirmed. Use ${T.GET_USER_STATUS} to check it.`
|
|
6522
6526
|
);
|
|
@@ -6765,7 +6769,7 @@ function Xd(e, t) {
|
|
|
6765
6769
|
id: s.id,
|
|
6766
6770
|
name: s.name,
|
|
6767
6771
|
query: s.query,
|
|
6768
|
-
description:
|
|
6772
|
+
description: zs(s),
|
|
6769
6773
|
color: we.parse(s.color),
|
|
6770
6774
|
isFavorite: s.isFavorite,
|
|
6771
6775
|
itemOrder: s.itemOrder
|
|
@@ -7022,7 +7026,7 @@ const fl = o.object({
|
|
|
7022
7026
|
}), bl = o.object({
|
|
7023
7027
|
type: o.literal("absolute"),
|
|
7024
7028
|
id: o.string().min(1).describe("The ID of the absolute reminder to update."),
|
|
7025
|
-
due:
|
|
7029
|
+
due: Xs.optional().describe("New due date/time for the reminder."),
|
|
7026
7030
|
service: Pe.optional().describe('New delivery method: "email" or "push".'),
|
|
7027
7031
|
isUrgent: Re,
|
|
7028
7032
|
notifyUser: $t
|
|
@@ -7032,7 +7036,7 @@ const fl = o.object({
|
|
|
7032
7036
|
name: o.string().optional().describe("New location name."),
|
|
7033
7037
|
locLat: o.string().optional().describe("New latitude."),
|
|
7034
7038
|
locLong: o.string().optional().describe("New longitude."),
|
|
7035
|
-
locTrigger:
|
|
7039
|
+
locTrigger: Zs.optional().describe(
|
|
7036
7040
|
'New trigger condition: "on_enter" or "on_leave".'
|
|
7037
7041
|
),
|
|
7038
7042
|
radius: o.number().int().optional().describe("New radius in meters."),
|
|
@@ -7066,7 +7070,7 @@ const fl = o.object({
|
|
|
7066
7070
|
openWorldHint: !0
|
|
7067
7071
|
},
|
|
7068
7072
|
async execute(e, t) {
|
|
7069
|
-
const { reminders: s } = e, r = await
|
|
7073
|
+
const { reminders: s } = e, r = await Vs(
|
|
7070
7074
|
t,
|
|
7071
7075
|
s.map((u) => u.notifyUser)
|
|
7072
7076
|
), n = await Promise.allSettled(
|
|
@@ -7121,7 +7125,7 @@ const fl = o.object({
|
|
|
7121
7125
|
textContent: R(
|
|
7122
7126
|
[
|
|
7123
7127
|
`Updated ${i.length} ${d}`,
|
|
7124
|
-
...
|
|
7128
|
+
...Js(i, a)
|
|
7125
7129
|
].join(`
|
|
7126
7130
|
`),
|
|
7127
7131
|
c
|
|
@@ -7212,7 +7216,7 @@ function jl({
|
|
|
7212
7216
|
${r}` : "Updated 0 sections";
|
|
7213
7217
|
return R(n, t);
|
|
7214
7218
|
}
|
|
7215
|
-
function
|
|
7219
|
+
function vo(e, t) {
|
|
7216
7220
|
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;
|
|
7217
7221
|
}
|
|
7218
7222
|
function $l(e, t) {
|
|
@@ -7235,7 +7239,7 @@ function El({
|
|
|
7235
7239
|
return { redundantMoveSkipped: !1 };
|
|
7236
7240
|
let n = r, i = !1;
|
|
7237
7241
|
if (s) {
|
|
7238
|
-
const a = r.length === 1 ? (c) =>
|
|
7242
|
+
const a = r.length === 1 ? (c) => vo(s, c) : (c) => $l(s, c);
|
|
7239
7243
|
n = r.filter((c) => !a(c)), i = n.length < r.length;
|
|
7240
7244
|
}
|
|
7241
7245
|
if (n.length === 0)
|
|
@@ -7280,7 +7284,7 @@ const xl = o.object({
|
|
|
7280
7284
|
'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.'
|
|
7281
7285
|
)
|
|
7282
7286
|
).optional(),
|
|
7283
|
-
duration: o.string().optional().describe(
|
|
7287
|
+
duration: o.string().optional().describe(_s),
|
|
7284
7288
|
responsibleUser: o.preprocess(
|
|
7285
7289
|
// Keep accepting legacy null while exposing a Gemini-compatible string schema.
|
|
7286
7290
|
(e) => e === null ? "unassign" : e,
|
|
@@ -7292,7 +7296,7 @@ const xl = o.object({
|
|
|
7292
7296
|
isUncompletable: o.boolean().optional().describe(
|
|
7293
7297
|
"Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
|
|
7294
7298
|
)
|
|
7295
|
-
}), Ol = (e) => !!(e.projectId || e.sectionId || e.parentId),
|
|
7299
|
+
}), Ol = (e) => !!(e.projectId || e.sectionId || e.parentId), Io = (e) => Object.keys(e).length > 0, Ul = ["remove", "no date"], _l = ["remove", "no date", "no deadline"], cs = "no date", at = vs.TASKS_PER_OPERATION, ds = {
|
|
7296
7300
|
tasks: o.array(xl).min(1).max(at).describe(`The tasks to update (max ${at}).`)
|
|
7297
7301
|
}, Pl = {
|
|
7298
7302
|
tasks: o.array(V).describe("The updated tasks."),
|
|
@@ -7334,7 +7338,7 @@ const xl = o.object({
|
|
|
7334
7338
|
const A = a[y]?.index ?? y;
|
|
7335
7339
|
v.status === "fulfilled" ? l.push(v.value) : i(A, v.reason);
|
|
7336
7340
|
}
|
|
7337
|
-
const { states: u, readFailed: p } = await
|
|
7341
|
+
const { states: u, readFailed: p } = await So({
|
|
7338
7342
|
client: t,
|
|
7339
7343
|
ids: [
|
|
7340
7344
|
...new Set(
|
|
@@ -7407,7 +7411,7 @@ const xl = o.object({
|
|
|
7407
7411
|
}
|
|
7408
7412
|
}), await Promise.all(b);
|
|
7409
7413
|
for (const y of l) {
|
|
7410
|
-
if (y.failed ||
|
|
7414
|
+
if (y.failed || Io(y.updateArgs))
|
|
7411
7415
|
continue;
|
|
7412
7416
|
const v = f.get(y.index);
|
|
7413
7417
|
v && "task" in v && (r[y.index] = { kind: "updated", task: v.task });
|
|
@@ -7461,7 +7465,7 @@ async function Ll(e, t) {
|
|
|
7461
7465
|
return { error: s };
|
|
7462
7466
|
}
|
|
7463
7467
|
}
|
|
7464
|
-
async function
|
|
7468
|
+
async function So({
|
|
7465
7469
|
client: e,
|
|
7466
7470
|
ids: t
|
|
7467
7471
|
}) {
|
|
@@ -7500,7 +7504,7 @@ async function Fl({
|
|
|
7500
7504
|
const d = Al(c.move), l = n.get(d);
|
|
7501
7505
|
l ? l.push(c) : n.set(d, [c]);
|
|
7502
7506
|
}
|
|
7503
|
-
const i =
|
|
7507
|
+
const i = Ir(e), a = [];
|
|
7504
7508
|
for (const c of n.values()) {
|
|
7505
7509
|
const d = [...new Set(c.map(({ item: p }) => p.id))], l = c[0]?.move, u = c.length === 1 ? c[0] : void 0;
|
|
7506
7510
|
try {
|
|
@@ -7538,12 +7542,12 @@ async function Hl({
|
|
|
7538
7542
|
unresolved: t,
|
|
7539
7543
|
results: s
|
|
7540
7544
|
}) {
|
|
7541
|
-
const r = [...new Set(t.flatMap(({ group: i }) => i.map(({ item: a }) => a.id)))], { states: n } = await
|
|
7545
|
+
const r = [...new Set(t.flatMap(({ group: i }) => i.map(({ item: a }) => a.id)))], { states: n } = await So({ client: e, ids: r });
|
|
7542
7546
|
for (const { group: i, destination: a, error: c } of t) {
|
|
7543
7547
|
const d = c === void 0 ? "Task not returned by the move" : E(c);
|
|
7544
7548
|
for (const { item: l } of i) {
|
|
7545
7549
|
const u = n.get(l.id);
|
|
7546
|
-
if (u &&
|
|
7550
|
+
if (u && vo(u, a)) {
|
|
7547
7551
|
s.set(l.index, { task: u });
|
|
7548
7552
|
continue;
|
|
7549
7553
|
}
|
|
@@ -7557,9 +7561,9 @@ async function Wl({
|
|
|
7557
7561
|
onUpdated: s,
|
|
7558
7562
|
onFailed: r
|
|
7559
7563
|
}) {
|
|
7560
|
-
const n =
|
|
7564
|
+
const n = Sr(e);
|
|
7561
7565
|
await Promise.all(
|
|
7562
|
-
t.filter((i) =>
|
|
7566
|
+
t.filter((i) => Io(i.updateArgs)).map(async (i) => {
|
|
7563
7567
|
try {
|
|
7564
7568
|
const a = await n(
|
|
7565
7569
|
() => $(() => e.updateTask(i.id, i.updateArgs))
|
|
@@ -7598,7 +7602,7 @@ async function Bl({
|
|
|
7598
7602
|
...m,
|
|
7599
7603
|
...h !== void 0 && { labels: h }
|
|
7600
7604
|
};
|
|
7601
|
-
p && (w.priority =
|
|
7605
|
+
p && (w.priority = Rs(p));
|
|
7602
7606
|
const I = ls(
|
|
7603
7607
|
d,
|
|
7604
7608
|
Ul,
|
|
@@ -7719,11 +7723,11 @@ function eu(e) {
|
|
|
7719
7723
|
return !1;
|
|
7720
7724
|
}
|
|
7721
7725
|
}
|
|
7722
|
-
function
|
|
7726
|
+
function Co(e) {
|
|
7723
7727
|
return eu(e) ? e : "UTC";
|
|
7724
7728
|
}
|
|
7725
7729
|
function tu(e, t) {
|
|
7726
|
-
const s =
|
|
7730
|
+
const s = Co(t);
|
|
7727
7731
|
return e.toLocaleString("en-US", {
|
|
7728
7732
|
timeZone: s,
|
|
7729
7733
|
year: "numeric",
|
|
@@ -7736,7 +7740,7 @@ function tu(e, t) {
|
|
|
7736
7740
|
});
|
|
7737
7741
|
}
|
|
7738
7742
|
async function su(e) {
|
|
7739
|
-
const t = await e.getUser(), s = t.tzInfo?.timezone ?? "UTC", r =
|
|
7743
|
+
const t = await e.getUser(), s = t.tzInfo?.timezone ?? "UTC", r = Co(s), n = /* @__PURE__ */ new Date(), i = tu(n, r), a = t.startDay ?? 1, c = Ql(a), d = Vl(t), l = new Date(n.toLocaleString("en-US", { timeZone: r })), u = Jl(l, a), p = Xl(u), h = Zl(l), b = [
|
|
7740
7744
|
"# User Information",
|
|
7741
7745
|
"",
|
|
7742
7746
|
`**User ID:** ${t.id}`,
|
|
@@ -8018,12 +8022,12 @@ Use the **productivity-analysis** prompt for a combined productivity review —
|
|
|
8018
8022
|
|
|
8019
8023
|
Always provide clear, actionable task titles and descriptions. Use the overview tools to give users context about their workload and project status.
|
|
8020
8024
|
`, Ie = { ttlMs: dt, cacheScope: "private" };
|
|
8021
|
-
function
|
|
8022
|
-
|
|
8025
|
+
function Uu({
|
|
8026
|
+
token: e,
|
|
8023
8027
|
baseUrl: t,
|
|
8024
8028
|
features: s = []
|
|
8025
8029
|
}) {
|
|
8026
|
-
const r = new
|
|
8030
|
+
const r = new $o(
|
|
8027
8031
|
{ name: "todoist-mcp-server", version: ht },
|
|
8028
8032
|
{
|
|
8029
8033
|
capabilities: {
|
|
@@ -8040,7 +8044,7 @@ function Ou({
|
|
|
8040
8044
|
}
|
|
8041
8045
|
}
|
|
8042
8046
|
), n = Nr(e, { baseUrl: t });
|
|
8043
|
-
return
|
|
8047
|
+
return Qo(r), Qr({ tools: fu, server: r, client: n, features: s }), r.registerPrompt(
|
|
8044
8048
|
ve.name,
|
|
8045
8049
|
{
|
|
8046
8050
|
title: ve.title,
|
|
@@ -8051,13 +8055,13 @@ function Ou({
|
|
|
8051
8055
|
), r;
|
|
8052
8056
|
}
|
|
8053
8057
|
export {
|
|
8054
|
-
|
|
8058
|
+
xu as $,
|
|
8055
8059
|
mc as A,
|
|
8056
8060
|
gc as B,
|
|
8057
8061
|
vc as C,
|
|
8058
8062
|
Ac as D,
|
|
8059
8063
|
Uc as E,
|
|
8060
|
-
|
|
8064
|
+
Ou as F,
|
|
8061
8065
|
Nc as G,
|
|
8062
8066
|
Wc as H,
|
|
8063
8067
|
Yc as I,
|
|
@@ -8080,14 +8084,13 @@ export {
|
|
|
8080
8084
|
ou as Z,
|
|
8081
8085
|
pu as _,
|
|
8082
8086
|
Hn as a,
|
|
8083
|
-
|
|
8084
|
-
Os as a1,
|
|
8087
|
+
Er as a0,
|
|
8085
8088
|
Qn as b,
|
|
8086
8089
|
oi as c,
|
|
8087
8090
|
ui as d,
|
|
8088
8091
|
ki as e,
|
|
8089
8092
|
ji as f,
|
|
8090
|
-
|
|
8093
|
+
Uu as g,
|
|
8091
8094
|
xi as h,
|
|
8092
8095
|
Ni as i,
|
|
8093
8096
|
Fi as j,
|