@todoist/mcp 18.0.1 → 18.1.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 +2 -2
- package/dist/main.js +1 -1
- package/dist/{mcp-server-CAqylT3d.js → mcp-server-DcLeQ1Dj.js} +706 -719
- package/dist/mcp-server.d.ts +1 -1
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/{require-valid-todoist-token-FTt0ckSw.js → require-valid-todoist-token-ClcI67MV.js} +1 -1
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { ResourceTemplate as es, McpServer as ts } from "@modelcontextprotocol/server";
|
|
2
2
|
import { createHash as jn, randomUUID as Oe } from "node:crypto";
|
|
3
3
|
import { readFileSync as os } from "node:fs";
|
|
4
|
-
import { join as
|
|
4
|
+
import { join as It, dirname as $n } from "node:path";
|
|
5
5
|
import { fileURLToPath as ns } from "node:url";
|
|
6
|
-
import { RESOURCE_MIME_TYPE as
|
|
6
|
+
import { RESOURCE_MIME_TYPE as kt } from "@modelcontextprotocol/ext-apps/server";
|
|
7
7
|
import { createToolRegistrar as rs } from "@todoist/mcp-core";
|
|
8
8
|
import Se, { ZodError as ss, z as n } from "zod";
|
|
9
9
|
import { AsyncLocalStorage as as } from "node:async_hooks";
|
|
10
10
|
import { createRequire as is } from "node:module";
|
|
11
|
-
import { TodoistApi as cs, formatUserShortName as En, isWorkspaceProject as H, isPersonalProject as oe, colors as St, LOCATION_TRIGGERS as An, REMINDER_TYPES as ds, TodoistSyncError as jo, TodoistRequestError as ls, createCommand as V, parseTodoistUrl as us, PROJECT_ICONS as Dn, PROJECT_VIEW_STYLES as Wt, REMINDER_DELIVERY_SERVICES as ps, DURATION_UNITS as
|
|
11
|
+
import { TodoistApi as cs, formatUserShortName as En, isWorkspaceProject as H, isPersonalProject as oe, colors as St, LOCATION_TRIGGERS as An, REMINDER_TYPES as ds, TodoistSyncError as jo, TodoistRequestError as ls, createCommand as V, parseTodoistUrl as us, PROJECT_ICONS as Dn, PROJECT_VIEW_STYLES as Wt, REMINDER_DELIVERY_SERVICES as ps, DURATION_UNITS as ms, HEALTH_STATUSES as Bt, getTaskUrl as xn, getProjectUrl as On, ACTIVITY_EVENT_TYPES as hs, ACTIVITY_OBJECT_TYPES as _n, escapeFilterToken as Kt, WORKSPACE_ROLES as fs, WORKSPACE_PLANS as gs } from "@todoist/sdk";
|
|
12
12
|
import { addDays as bs, formatISO as ys } from "date-fns";
|
|
13
13
|
import { generateNKeysBetween as Pn } from "fractional-indexing";
|
|
14
14
|
function J(e) {
|
|
@@ -30,7 +30,7 @@ function fe(e) {
|
|
|
30
30
|
function Ze(...e) {
|
|
31
31
|
return e.find(fe);
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function G(...e) {
|
|
34
34
|
return e.find((t) => t !== void 0);
|
|
35
35
|
}
|
|
36
36
|
function B(e) {
|
|
@@ -65,7 +65,7 @@ function Ct(e) {
|
|
|
65
65
|
const t = e.trim();
|
|
66
66
|
return /\bHTTP\s*\d{3}\b/i.test(t) || /\bstatus code \d{3}\b/i.test(t) || /^bad request$/i.test(t) || /^unauthorized$/i.test(t) || /^forbidden$/i.test(t) || /^not found$/i.test(t);
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function mt(e) {
|
|
69
69
|
if (!e)
|
|
70
70
|
return;
|
|
71
71
|
const t = e.match(/\b(?:HTTP|status code)\s*[:#-]?\s*(\d{3})\b/i);
|
|
@@ -82,7 +82,7 @@ function pe(e) {
|
|
|
82
82
|
}
|
|
83
83
|
if (!fe(e))
|
|
84
84
|
return;
|
|
85
|
-
const o =
|
|
85
|
+
const o = G(
|
|
86
86
|
j(e.detail),
|
|
87
87
|
j(e.details),
|
|
88
88
|
j(e.message),
|
|
@@ -104,7 +104,7 @@ function Ts(e) {
|
|
|
104
104
|
return [];
|
|
105
105
|
const t = /* @__PURE__ */ new Set(), o = (i) => {
|
|
106
106
|
i && t.add(Y(i, 120));
|
|
107
|
-
}, r =
|
|
107
|
+
}, r = G(
|
|
108
108
|
j(e.field),
|
|
109
109
|
j(e.parameter),
|
|
110
110
|
j(e.param),
|
|
@@ -118,7 +118,7 @@ function Ts(e) {
|
|
|
118
118
|
e.error_extra
|
|
119
119
|
);
|
|
120
120
|
if (s) {
|
|
121
|
-
const i =
|
|
121
|
+
const i = G(
|
|
122
122
|
j(s.field),
|
|
123
123
|
j(s.parameter),
|
|
124
124
|
j(s.param),
|
|
@@ -134,13 +134,13 @@ function Ts(e) {
|
|
|
134
134
|
o(j(i));
|
|
135
135
|
continue;
|
|
136
136
|
}
|
|
137
|
-
const c =
|
|
137
|
+
const c = G(
|
|
138
138
|
j(i.field),
|
|
139
139
|
j(i.parameter),
|
|
140
140
|
j(i.param),
|
|
141
141
|
j(i.path),
|
|
142
142
|
j(i.name)
|
|
143
|
-
), d =
|
|
143
|
+
), d = G(
|
|
144
144
|
j(i.message),
|
|
145
145
|
j(i.error),
|
|
146
146
|
j(i.detail),
|
|
@@ -173,7 +173,7 @@ const vs = [
|
|
|
173
173
|
"httpCode",
|
|
174
174
|
"errorExtra"
|
|
175
175
|
];
|
|
176
|
-
function
|
|
176
|
+
function Is(e) {
|
|
177
177
|
return e ? vs.some((t) => e[t] !== void 0) : !1;
|
|
178
178
|
}
|
|
179
179
|
const Un = 'A due string must name one specific date or recurrence, such as "tomorrow", "Friday at 3pm", "2026-12-01" or "every weekday"; a period such as "this week" is not a date.', nt = {
|
|
@@ -185,7 +185,7 @@ const Un = 'A due string must name one specific date or recurrence, such as "tom
|
|
|
185
185
|
INVALID_DATE: `Todoist could not parse a date in this request. ${Un} Where a field asks for YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS, send exactly that, not words such as "today". Change only the date and retry.`,
|
|
186
186
|
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.",
|
|
187
187
|
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 the project with export-project and share the CSV."
|
|
188
|
-
},
|
|
188
|
+
}, ks = {
|
|
189
189
|
PREMIUM_ONLY: "The user's Todoist plan does not include a feature this item used. It is not an authentication or permission problem, and retrying the same item will not help. On a task it is most often a deadline on a free plan: retry without `deadlineDate`. Tell the user what was left out and that it needs a plan upgrade."
|
|
190
190
|
};
|
|
191
191
|
function Ss(...e) {
|
|
@@ -221,7 +221,7 @@ function zt(e) {
|
|
|
221
221
|
t?.data,
|
|
222
222
|
o?.responseData,
|
|
223
223
|
o?.data
|
|
224
|
-
), a =
|
|
224
|
+
), a = G(
|
|
225
225
|
B(t?.httpStatusCode),
|
|
226
226
|
B(t?.statusCode),
|
|
227
227
|
B(t?.status),
|
|
@@ -234,25 +234,25 @@ function zt(e) {
|
|
|
234
234
|
);
|
|
235
235
|
return { errorRecord: t, errorCauseRecord: o, responseData: s, statusCode: a };
|
|
236
236
|
}
|
|
237
|
-
function
|
|
237
|
+
function qt(e) {
|
|
238
238
|
const {
|
|
239
239
|
errorRecord: t,
|
|
240
240
|
errorCauseRecord: o,
|
|
241
241
|
responseData: r,
|
|
242
242
|
statusCode: s
|
|
243
|
-
} = zt(e), a =
|
|
243
|
+
} = zt(e), a = G(
|
|
244
244
|
s,
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
), i =
|
|
245
|
+
mt(j(t?.message)),
|
|
246
|
+
mt(j(o?.message)),
|
|
247
|
+
mt(typeof e == "string" ? e : void 0)
|
|
248
|
+
), i = G(
|
|
249
249
|
Ce(r?.errorCode),
|
|
250
250
|
Ce(r?.error_code),
|
|
251
251
|
Ce(r?.code),
|
|
252
252
|
Ce(t?.errorCode),
|
|
253
253
|
Ce(t?.error_code),
|
|
254
254
|
Ce(t?.code)
|
|
255
|
-
), c =
|
|
255
|
+
), c = G(
|
|
256
256
|
j(r?.errorTag),
|
|
257
257
|
j(r?.error_tag),
|
|
258
258
|
j(r?.tag),
|
|
@@ -266,7 +266,7 @@ function Gt(e) {
|
|
|
266
266
|
j(t?.message),
|
|
267
267
|
j(o?.message),
|
|
268
268
|
e instanceof Error ? e.message : j(e)
|
|
269
|
-
].filter((
|
|
269
|
+
].filter((m) => !!m), u = d.find((m) => !Ct(m)) || d[0], l = G(
|
|
270
270
|
pe(r?.errorExtra),
|
|
271
271
|
pe(r?.error_extra),
|
|
272
272
|
pe(r?.details),
|
|
@@ -274,7 +274,7 @@ function Gt(e) {
|
|
|
274
274
|
pe(r?.errors),
|
|
275
275
|
pe(t?.details)
|
|
276
276
|
), p = Ts(r);
|
|
277
|
-
return a !== void 0 ||
|
|
277
|
+
return a !== void 0 || Is(r) || c !== void 0 || i !== void 0 || (u ? Ct(u) : !1) ? {
|
|
278
278
|
statusCode: a,
|
|
279
279
|
code: i,
|
|
280
280
|
tag: c ? Y(c, 80) : void 0,
|
|
@@ -298,12 +298,12 @@ function $s(e) {
|
|
|
298
298
|
function Mn(e) {
|
|
299
299
|
return e instanceof Error ? Y(e.message) : typeof e == "string" ? Y(e) : "An unknown error occurred";
|
|
300
300
|
}
|
|
301
|
-
class
|
|
301
|
+
class Gt extends Error {
|
|
302
302
|
constructor(t) {
|
|
303
303
|
super(t), this.name = "DueStringParseError";
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
|
-
class
|
|
306
|
+
class me extends Error {
|
|
307
307
|
constructor(t) {
|
|
308
308
|
super(t), this.name = "ProjectAccessError";
|
|
309
309
|
}
|
|
@@ -332,12 +332,12 @@ function Yt(e) {
|
|
|
332
332
|
const c = Yt(e.cause);
|
|
333
333
|
return { ...c, summary: `${c.summary}. ${e.hint}` };
|
|
334
334
|
}
|
|
335
|
-
if (e instanceof
|
|
335
|
+
if (e instanceof Gt || e instanceof me || e instanceof ce)
|
|
336
336
|
return { summary: e.message };
|
|
337
|
-
const t =
|
|
337
|
+
const t = qt(e);
|
|
338
338
|
if (!t)
|
|
339
339
|
return { summary: Mn(e) };
|
|
340
|
-
const o = Nn(t), r = t.message && !(o.length > 0 && Ct(t.message)) ? t.message : "Todoist API request failed", s = o.length > 0 ? `${r} (${o.join(", ")})` : r, a = Rn(t), i = a ?
|
|
340
|
+
const o = Nn(t), r = t.message && !(o.length > 0 && Ct(t.message)) ? t.message : "Todoist API request failed", s = o.length > 0 ? `${r} (${o.join(", ")})` : r, a = Rn(t), i = a ? ks[a] ?? nt[a] : void 0;
|
|
341
341
|
return a && i ? { summary: s, hint: { tag: a, text: i } } : { summary: s };
|
|
342
342
|
}
|
|
343
343
|
function Es(e, {
|
|
@@ -347,7 +347,7 @@ function Es(e, {
|
|
|
347
347
|
}) {
|
|
348
348
|
if (!o)
|
|
349
349
|
return;
|
|
350
|
-
const s =
|
|
350
|
+
const s = qt(e), a = s?.tag?.toUpperCase(), i = a === "INVALID_DUE_STRING", c = !r && (a === "INVALID_DATE" || /^invalid date format\.?$/i.test(s?.message ?? ""));
|
|
351
351
|
if (!i && !c)
|
|
352
352
|
return;
|
|
353
353
|
const d = o.trim().replace(/^recurring(?:\s+|$)/i, "").trim();
|
|
@@ -358,12 +358,12 @@ function Fn(e) {
|
|
|
358
358
|
return e.message;
|
|
359
359
|
if (e instanceof Ln)
|
|
360
360
|
return `${Fn(e.cause)} ${e.context}`;
|
|
361
|
-
if (e instanceof
|
|
361
|
+
if (e instanceof Gt || e instanceof me || e instanceof ce)
|
|
362
362
|
return e.message;
|
|
363
|
-
const t =
|
|
363
|
+
const t = qt(e);
|
|
364
364
|
return t ? $s(t) : Mn(e);
|
|
365
365
|
}
|
|
366
|
-
const As = "18.0
|
|
366
|
+
const As = "18.1.0", Ds = {
|
|
367
367
|
version: As
|
|
368
368
|
}, Vt = 3600 * 1e3, xs = 365 * 24 * Vt, E = {
|
|
369
369
|
/** Default limit for task listings */
|
|
@@ -519,7 +519,7 @@ function Jt() {
|
|
|
519
519
|
}
|
|
520
520
|
const _s = 1e4, Ps = 5 * 6e4, ee = /* @__PURE__ */ new Map();
|
|
521
521
|
let Us = _s;
|
|
522
|
-
const Hn = /* @__PURE__ */ new WeakMap(),
|
|
522
|
+
const Hn = /* @__PURE__ */ new WeakMap(), he = /* @__PURE__ */ new Map();
|
|
523
523
|
let Eo, Ao;
|
|
524
524
|
function Rs() {
|
|
525
525
|
return Eo ??= Jt(), Eo;
|
|
@@ -553,7 +553,7 @@ function Hs() {
|
|
|
553
553
|
return !1;
|
|
554
554
|
}
|
|
555
555
|
function Bn(e, t) {
|
|
556
|
-
if (
|
|
556
|
+
if (he.has(e))
|
|
557
557
|
return;
|
|
558
558
|
const o = ee.get(e);
|
|
559
559
|
if (o)
|
|
@@ -564,9 +564,9 @@ function Bn(e, t) {
|
|
|
564
564
|
return ee.set(e, r), r;
|
|
565
565
|
}
|
|
566
566
|
function Ws(e) {
|
|
567
|
-
const t =
|
|
567
|
+
const t = he.get(e);
|
|
568
568
|
if (t !== void 0)
|
|
569
|
-
return
|
|
569
|
+
return he.set(e, t + 1), {
|
|
570
570
|
limiters: Do(),
|
|
571
571
|
release: () => xo(e)
|
|
572
572
|
};
|
|
@@ -576,18 +576,18 @@ function Ws(e) {
|
|
|
576
576
|
release: () => {
|
|
577
577
|
o.leases--;
|
|
578
578
|
}
|
|
579
|
-
}) : (
|
|
579
|
+
}) : (he.set(e, 1), {
|
|
580
580
|
limiters: Do(),
|
|
581
581
|
release: () => xo(e)
|
|
582
582
|
});
|
|
583
583
|
}
|
|
584
584
|
function xo(e) {
|
|
585
|
-
const t =
|
|
585
|
+
const t = he.get(e);
|
|
586
586
|
if (t === void 0 || t <= 1) {
|
|
587
|
-
|
|
587
|
+
he.delete(e);
|
|
588
588
|
return;
|
|
589
589
|
}
|
|
590
|
-
|
|
590
|
+
he.set(e, t - 1);
|
|
591
591
|
}
|
|
592
592
|
function Bs(e, t) {
|
|
593
593
|
const o = Ns(t);
|
|
@@ -611,27 +611,27 @@ function Xt(e) {
|
|
|
611
611
|
return Kn(e, "writes");
|
|
612
612
|
}
|
|
613
613
|
const zs = "todoist-mcp", Zt = Ds.version, zn = new as(), Oo = is(import.meta.url);
|
|
614
|
-
let
|
|
615
|
-
const
|
|
616
|
-
const e = Oo.resolve("@todoist/sdk"), t =
|
|
614
|
+
let Ge;
|
|
615
|
+
const qs = async () => {
|
|
616
|
+
const e = Oo.resolve("@todoist/sdk"), t = It($n(e), "transport", "http-dispatcher.js");
|
|
617
617
|
return Oo(t);
|
|
618
618
|
};
|
|
619
|
-
let
|
|
619
|
+
let Gs = qs;
|
|
620
620
|
function Ys() {
|
|
621
621
|
return `${zs}/${Zt}`;
|
|
622
622
|
}
|
|
623
|
-
function
|
|
623
|
+
function qn(e) {
|
|
624
624
|
return e.trim().toLowerCase();
|
|
625
625
|
}
|
|
626
626
|
function Vs(e, t) {
|
|
627
|
-
return zn.run(
|
|
627
|
+
return zn.run(qn(e), t);
|
|
628
628
|
}
|
|
629
629
|
function Js({
|
|
630
630
|
label: e,
|
|
631
631
|
platform: t = "mcp",
|
|
632
632
|
sessionId: o = Oe()
|
|
633
633
|
} = {}) {
|
|
634
|
-
const r = e ?
|
|
634
|
+
const r = e ? qn(e) : zn.getStore();
|
|
635
635
|
return {
|
|
636
636
|
"User-Agent": Ys(),
|
|
637
637
|
"doist-platform": t,
|
|
@@ -690,22 +690,22 @@ function Zs(e, t) {
|
|
|
690
690
|
}
|
|
691
691
|
async function Qs() {
|
|
692
692
|
if (ea())
|
|
693
|
-
return
|
|
694
|
-
throw
|
|
695
|
-
})),
|
|
693
|
+
return Ge || (Ge = Gs().then((e) => e.getDefaultTransport()).catch((e) => {
|
|
694
|
+
throw Ge = void 0, e;
|
|
695
|
+
})), Ge;
|
|
696
696
|
}
|
|
697
697
|
function ea() {
|
|
698
698
|
return typeof process < "u" && !!process.versions?.node;
|
|
699
699
|
}
|
|
700
|
-
async function
|
|
700
|
+
async function Gn(e, t) {
|
|
701
701
|
if ("dispatcher" in t)
|
|
702
702
|
return e;
|
|
703
703
|
const o = await Qs();
|
|
704
704
|
return o ? (t.dispatcher = o.dispatcher, o.fetch ?? e) : e;
|
|
705
705
|
}
|
|
706
|
-
async function
|
|
706
|
+
async function Mh(e, t) {
|
|
707
707
|
const o = { ...t };
|
|
708
|
-
return (await
|
|
708
|
+
return (await Gn(globalThis.fetch, o))(e, o);
|
|
709
709
|
}
|
|
710
710
|
function ta(e) {
|
|
711
711
|
return {
|
|
@@ -721,16 +721,16 @@ function ta(e) {
|
|
|
721
721
|
function oa(e = globalThis.fetch, t = {}) {
|
|
722
722
|
const o = e === globalThis.fetch, { enabled: r = !0, platform: s = "mcp", sessionId: a = Oe() } = t;
|
|
723
723
|
return async (i, c = {}) => {
|
|
724
|
-
const { timeout: d, headers: u, signal: l, ...p } = c, { signal: f, cleanup:
|
|
724
|
+
const { timeout: d, headers: u, signal: l, ...p } = c, { signal: f, cleanup: m } = Zs(l, d);
|
|
725
725
|
try {
|
|
726
|
-
const
|
|
726
|
+
const h = {
|
|
727
727
|
...p,
|
|
728
728
|
signal: f,
|
|
729
729
|
...r ? { headers: Xs(u, { platform: s, sessionId: a }) } : u !== void 0 ? { headers: u } : {}
|
|
730
|
-
}, y = await (o ? await
|
|
730
|
+
}, y = await (o ? await Gn(e, h) : e)(i, h);
|
|
731
731
|
return ta(y);
|
|
732
732
|
} finally {
|
|
733
|
-
|
|
733
|
+
m();
|
|
734
734
|
}
|
|
735
735
|
};
|
|
736
736
|
}
|
|
@@ -807,7 +807,7 @@ function pa({
|
|
|
807
807
|
const s = Math.min(t * 2 ** e, o), a = Math.round(r() * s);
|
|
808
808
|
return Math.min(s, Math.max(ca, a));
|
|
809
809
|
}
|
|
810
|
-
function
|
|
810
|
+
function ma(e) {
|
|
811
811
|
return new Promise((t) => setTimeout(t, e));
|
|
812
812
|
}
|
|
813
813
|
async function C(e, t = {}) {
|
|
@@ -819,7 +819,7 @@ async function C(e, t = {}) {
|
|
|
819
819
|
} catch (d) {
|
|
820
820
|
if (i = d, c < o && ua(d, t.retryableStatusCodes)) {
|
|
821
821
|
const u = pa({ attempt: c, baseDelayMs: r, maxDelayMs: s, random: a });
|
|
822
|
-
await
|
|
822
|
+
await ma(u);
|
|
823
823
|
continue;
|
|
824
824
|
}
|
|
825
825
|
throw d;
|
|
@@ -832,7 +832,7 @@ function Qt(e) {
|
|
|
832
832
|
const t = We(e);
|
|
833
833
|
return t === void 0 || t >= 500 && t !== 503;
|
|
834
834
|
}
|
|
835
|
-
function
|
|
835
|
+
function ha(e, t) {
|
|
836
836
|
return Qt(e) ? new He(e, t) : e;
|
|
837
837
|
}
|
|
838
838
|
async function te(e, t, o = {}) {
|
|
@@ -842,7 +842,7 @@ async function te(e, t, o = {}) {
|
|
|
842
842
|
retryableStatusCodes: la
|
|
843
843
|
});
|
|
844
844
|
} catch (r) {
|
|
845
|
-
throw
|
|
845
|
+
throw ha(r, t);
|
|
846
846
|
}
|
|
847
847
|
}
|
|
848
848
|
const b = {
|
|
@@ -917,7 +917,7 @@ const b = {
|
|
|
917
917
|
// OpenAI MCP tools
|
|
918
918
|
SEARCH: "search",
|
|
919
919
|
FETCH: "fetch"
|
|
920
|
-
},
|
|
920
|
+
}, Lh = {
|
|
921
921
|
/**
|
|
922
922
|
* Strips email addresses from tool outputs that expose user data.
|
|
923
923
|
* Affects: find-project-collaborators, find-completed-tasks
|
|
@@ -990,10 +990,10 @@ function va({
|
|
|
990
990
|
for (const i of e)
|
|
991
991
|
a(t, i);
|
|
992
992
|
}
|
|
993
|
-
const Po = $n(ns(import.meta.url)),
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
],
|
|
993
|
+
const Po = $n(ns(import.meta.url)), Ia = [
|
|
994
|
+
It(Po, "task-list", "index.html"),
|
|
995
|
+
It(Po, "mcp-apps", "index.html")
|
|
996
|
+
], ka = `<!doctype html>
|
|
997
997
|
<html>
|
|
998
998
|
<body>
|
|
999
999
|
<p>Task list app is missing. Run "npm run build" to generate it.</p>
|
|
@@ -1001,13 +1001,13 @@ const Po = $n(ns(import.meta.url)), ka = [
|
|
|
1001
1001
|
</html>`;
|
|
1002
1002
|
function Sa() {
|
|
1003
1003
|
const e = [];
|
|
1004
|
-
for (const t of
|
|
1004
|
+
for (const t of Ia)
|
|
1005
1005
|
try {
|
|
1006
1006
|
return os(t, "utf-8");
|
|
1007
1007
|
} catch (o) {
|
|
1008
1008
|
e.push(o);
|
|
1009
1009
|
}
|
|
1010
|
-
return console.error("Failed to load task list app HTML from any known path:", e),
|
|
1010
|
+
return console.error("Failed to load task list app HTML from any known path:", e), ka;
|
|
1011
1011
|
}
|
|
1012
1012
|
const Jn = Sa(), Ca = jn("sha256").update(Jn).digest("hex").slice(0, 12), At = `ui://todoist/task-list@${Ca}`, ja = "ui://todoist/task-list@{hash}", Dt = "Interactive task list widget", $a = "https://ai.todoist.net", xt = {
|
|
1013
1013
|
ui: {
|
|
@@ -1031,7 +1031,7 @@ function Uo(e) {
|
|
|
1031
1031
|
contents: [
|
|
1032
1032
|
{
|
|
1033
1033
|
uri: e,
|
|
1034
|
-
mimeType:
|
|
1034
|
+
mimeType: kt,
|
|
1035
1035
|
text: Jn,
|
|
1036
1036
|
_meta: xt
|
|
1037
1037
|
}
|
|
@@ -1044,7 +1044,7 @@ function Da(e) {
|
|
|
1044
1044
|
At,
|
|
1045
1045
|
{
|
|
1046
1046
|
description: Dt,
|
|
1047
|
-
mimeType:
|
|
1047
|
+
mimeType: kt,
|
|
1048
1048
|
_meta: xt,
|
|
1049
1049
|
cacheHint: Ea
|
|
1050
1050
|
},
|
|
@@ -1054,7 +1054,7 @@ function Da(e) {
|
|
|
1054
1054
|
new es(ja, { list: void 0 }),
|
|
1055
1055
|
{
|
|
1056
1056
|
description: `${Dt} compatibility fallback`,
|
|
1057
|
-
mimeType:
|
|
1057
|
+
mimeType: kt,
|
|
1058
1058
|
_meta: xt,
|
|
1059
1059
|
cacheHint: Aa
|
|
1060
1060
|
},
|
|
@@ -1101,7 +1101,7 @@ function Zn(e, t) {
|
|
|
1101
1101
|
return;
|
|
1102
1102
|
}
|
|
1103
1103
|
}
|
|
1104
|
-
const
|
|
1104
|
+
const ht = 6e4;
|
|
1105
1105
|
function Qn({
|
|
1106
1106
|
date: e,
|
|
1107
1107
|
timeZone: t,
|
|
@@ -1109,10 +1109,10 @@ function Qn({
|
|
|
1109
1109
|
}) {
|
|
1110
1110
|
const r = (l) => `${e}T00:00:00${l}`, s = Date.parse(`${e}T00:00:00Z`);
|
|
1111
1111
|
if (!t || Number.isNaN(s)) return r(o);
|
|
1112
|
-
const a = (l) => Zn(l, t), i = a(s - 840 *
|
|
1112
|
+
const a = (l) => Zn(l, t), i = a(s - 840 * ht), c = a(s + 840 * ht);
|
|
1113
1113
|
if (i === void 0 || c === void 0) return r(o);
|
|
1114
1114
|
const d = [.../* @__PURE__ */ new Set([i, c])].filter(
|
|
1115
|
-
(l) => a(s - l *
|
|
1115
|
+
(l) => a(s - l * ht) === l
|
|
1116
1116
|
), u = d.length > 0 ? Math.max(...d) : i;
|
|
1117
1117
|
return r(xa(u));
|
|
1118
1118
|
}
|
|
@@ -1342,7 +1342,7 @@ function no(e) {
|
|
|
1342
1342
|
function nr(e) {
|
|
1343
1343
|
return { 4: "p1", 3: "p2", 2: "p3", 1: "p4" }[e];
|
|
1344
1344
|
}
|
|
1345
|
-
const rr = 300 * 1e3, za = 1e4,
|
|
1345
|
+
const rr = 300 * 1e3, za = 1e4, qa = 1e3, Ga = 5;
|
|
1346
1346
|
function Ya(e, { named: t, total: o }) {
|
|
1347
1347
|
const r = t.map((c) => `${Mo(c.displayName)} (ID ${c.userId})`).join(", "), s = o - t.length, a = s > 0 ? `${r} and ${s} more` : r, i = s > 0 ? `Retry with the ID of the one you mean, or search for them with ${b.FIND_PROJECT_COLLABORATORS}.` : "Retry with the ID of the one you mean.";
|
|
1348
1348
|
return `${Mo(e)} matches ${o} people: ${a}. ${i}`;
|
|
@@ -1387,7 +1387,7 @@ const ft = new sr(
|
|
|
1387
1387
|
za,
|
|
1388
1388
|
rr
|
|
1389
1389
|
), $e = new sr(
|
|
1390
|
-
|
|
1390
|
+
qa,
|
|
1391
1391
|
rr
|
|
1392
1392
|
), Ne = /* @__PURE__ */ new Map();
|
|
1393
1393
|
function Lo(e, t) {
|
|
@@ -1454,14 +1454,14 @@ class Ja {
|
|
|
1454
1454
|
try {
|
|
1455
1455
|
let l = await this.getAllCollaborators(t, i);
|
|
1456
1456
|
try {
|
|
1457
|
-
const
|
|
1458
|
-
if (
|
|
1457
|
+
const h = await t.getUser();
|
|
1458
|
+
if (h) {
|
|
1459
1459
|
const g = {
|
|
1460
|
-
id:
|
|
1461
|
-
name:
|
|
1462
|
-
email:
|
|
1460
|
+
id: h.id,
|
|
1461
|
+
name: h.fullName,
|
|
1462
|
+
email: h.email
|
|
1463
1463
|
};
|
|
1464
|
-
l.some((y) => y.id ===
|
|
1464
|
+
l.some((y) => y.id === h.id) || (l = [g, ...l]);
|
|
1465
1465
|
}
|
|
1466
1466
|
} catch {
|
|
1467
1467
|
}
|
|
@@ -1473,11 +1473,11 @@ class Ja {
|
|
|
1473
1473
|
const f = Va(l, r);
|
|
1474
1474
|
if (f.length > 1)
|
|
1475
1475
|
return u({
|
|
1476
|
-
named: f.slice(0,
|
|
1476
|
+
named: f.slice(0, Ga).map(Ye),
|
|
1477
1477
|
total: f.length
|
|
1478
1478
|
});
|
|
1479
|
-
const [
|
|
1480
|
-
return u(
|
|
1479
|
+
const [m] = f;
|
|
1480
|
+
return u(m ? Ye(m) : null);
|
|
1481
1481
|
} catch {
|
|
1482
1482
|
return u(a);
|
|
1483
1483
|
}
|
|
@@ -1759,13 +1759,13 @@ async function ei(e, t) {
|
|
|
1759
1759
|
try {
|
|
1760
1760
|
o = (await t()).find((r) => r.id === e);
|
|
1761
1761
|
} catch {
|
|
1762
|
-
return new
|
|
1762
|
+
return new me(
|
|
1763
1763
|
`Project ${e} was not found or the user can't access it. If it's a workspace project they haven't joined, ${b.FIND_PROJECTS} with includeUnjoined lists the ones they can join.`
|
|
1764
1764
|
);
|
|
1765
1765
|
}
|
|
1766
|
-
return o ? new
|
|
1766
|
+
return o ? new me(
|
|
1767
1767
|
`Project ${e} ("${o.name}") is a workspace project the user hasn't joined, so it can't be read yet. Ask the user whether to join it. If they agree, join it with ${b.PROJECT_MANAGEMENT} (action: "join"), then retry.`
|
|
1768
|
-
) : new
|
|
1768
|
+
) : new me(
|
|
1769
1769
|
`Project ${e} was not found. It isn't one of the user's projects or a workspace project they can join: the ID may be wrong, the project may have been archived or deleted, or it may be restricted to people who were invited.`
|
|
1770
1770
|
);
|
|
1771
1771
|
}
|
|
@@ -1965,15 +1965,15 @@ function Fe(e) {
|
|
|
1965
1965
|
};
|
|
1966
1966
|
}
|
|
1967
1967
|
}
|
|
1968
|
-
function
|
|
1968
|
+
function mr(e) {
|
|
1969
1969
|
const t = e.filter(
|
|
1970
1970
|
(r) => r.type === "relative" || r.type === "absolute"
|
|
1971
1971
|
).length, o = e.filter((r) => r.type === "location").length;
|
|
1972
1972
|
return { timeBasedCount: t, locationCount: o };
|
|
1973
1973
|
}
|
|
1974
|
-
const
|
|
1974
|
+
const hr = "none";
|
|
1975
1975
|
function ii(e) {
|
|
1976
|
-
return e.length === 1 && e[0]?.trim().toLowerCase() ===
|
|
1976
|
+
return e.length === 1 && e[0]?.trim().toLowerCase() === hr;
|
|
1977
1977
|
}
|
|
1978
1978
|
async function ci(e, t, o, r = (s) => e.getTask(s)) {
|
|
1979
1979
|
const s = await di(e, t);
|
|
@@ -2091,7 +2091,7 @@ const pi = n.object({
|
|
|
2091
2091
|
postedUid: n.string().optional(),
|
|
2092
2092
|
notifiedUserIds: n.array(n.string()).optional().describe("Users notified about this comment. Absent when nobody was notified."),
|
|
2093
2093
|
fileAttachment: pi.optional()
|
|
2094
|
-
}),
|
|
2094
|
+
}), mi = n.object({
|
|
2095
2095
|
id: n.string().optional(),
|
|
2096
2096
|
objectType: n.string().describe("task, project, etc."),
|
|
2097
2097
|
objectId: n.string(),
|
|
@@ -2101,7 +2101,7 @@ const pi = n.object({
|
|
|
2101
2101
|
parentItemId: n.string().optional(),
|
|
2102
2102
|
initiatorId: n.string().optional().describe("User who initiated the event."),
|
|
2103
2103
|
extraData: n.record(n.string(), n.unknown()).optional()
|
|
2104
|
-
}),
|
|
2104
|
+
}), hi = n.object({
|
|
2105
2105
|
id: n.string(),
|
|
2106
2106
|
name: n.string(),
|
|
2107
2107
|
email: n.string()
|
|
@@ -2158,7 +2158,7 @@ ${l}${p}.`);
|
|
|
2158
2158
|
return i.join(`
|
|
2159
2159
|
`);
|
|
2160
2160
|
}
|
|
2161
|
-
function
|
|
2161
|
+
function mo(e) {
|
|
2162
2162
|
const { action: t, success: o, total: r, successItems: s, successLabel: a = "Completed", failures: i } = e, c = [], d = `${t}: ${o}/${r} successful.`;
|
|
2163
2163
|
if (c.push(d), s?.length && s.length <= 5 && c.push(`${a}:
|
|
2164
2164
|
${s.map((u) => ` ${u}`).join(`
|
|
@@ -2218,10 +2218,10 @@ function ie({
|
|
|
2218
2218
|
}) {
|
|
2219
2219
|
const u = [], l = `${e}: ${t}${typeof o == "number" ? ` (limit ${o})` : ""}${r ? ", more available" : ""}.`;
|
|
2220
2220
|
return u.push(l), s?.length && u.push(`Filter: ${s.join("; ")}.`), a?.length && u.push(...a), i?.length && u.push(`Preview:
|
|
2221
|
-
${i}`), !t && c?.length && u.push(`No results. ${c.join("; ")}.`), (d?.length || r) && u.push(
|
|
2221
|
+
${i}`), !t && c?.length && u.push(`No results. ${c.join("; ")}.`), (d?.length || r) && u.push(ho(d || [], r)), u.join(`
|
|
2222
2222
|
`);
|
|
2223
2223
|
}
|
|
2224
|
-
function
|
|
2224
|
+
function ho(e, t) {
|
|
2225
2225
|
const o = [...e];
|
|
2226
2226
|
return t && o.push(`Pass cursor '${t}' to fetch more results.`), `${o.length === 1 ? "Possible suggested next step:" : "Possible suggested next steps:"}
|
|
2227
2227
|
${o.map((s) => `- ${s}`).join(`
|
|
@@ -2234,7 +2234,7 @@ const wi = n.object({
|
|
|
2234
2234
|
),
|
|
2235
2235
|
content: n.string().min(1).describe("The content of the comment."),
|
|
2236
2236
|
notifyUsers: n.array(n.string().min(1)).min(1).max(E.NOTIFY_USERS_MAX).optional().describe(
|
|
2237
|
-
`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 ["${
|
|
2237
|
+
`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 ["${hr}"] to notify nobody.`
|
|
2238
2238
|
)
|
|
2239
2239
|
}), Ti = {
|
|
2240
2240
|
comments: n.array(wi).min(1).max(x.ITEMS_PER_OPERATION).describe("The array of comments to add.")
|
|
@@ -2248,7 +2248,7 @@ const wi = n.object({
|
|
|
2248
2248
|
totalRequested: n.number(),
|
|
2249
2249
|
successCount: n.number(),
|
|
2250
2250
|
failureCount: n.number()
|
|
2251
|
-
},
|
|
2251
|
+
}, Ii = {
|
|
2252
2252
|
name: b.ADD_COMMENTS,
|
|
2253
2253
|
description: "Add multiple comments to tasks or projects, optionally notifying collaborators. Each comment must specify either taskId or projectId.",
|
|
2254
2254
|
parameters: Ti,
|
|
@@ -2265,30 +2265,30 @@ const wi = n.object({
|
|
|
2265
2265
|
let r;
|
|
2266
2266
|
const s = () => r ??= C(() => t.getUser()), a = /* @__PURE__ */ new Map();
|
|
2267
2267
|
function i(y) {
|
|
2268
|
-
let
|
|
2269
|
-
return
|
|
2268
|
+
let I = a.get(y);
|
|
2269
|
+
return I || (I = C(() => t.getTask(y)), a.set(y, I)), I;
|
|
2270
2270
|
}
|
|
2271
2271
|
const c = /* @__PURE__ */ new Map();
|
|
2272
|
-
async function d({ notifyUsers: y },
|
|
2272
|
+
async function d({ notifyUsers: y }, I) {
|
|
2273
2273
|
if (y)
|
|
2274
2274
|
return ii(y) ? [] : (await C(() => ir(t, y))).map((U) => U.userId);
|
|
2275
|
-
const { id: w } = await s(), v =
|
|
2276
|
-
let
|
|
2277
|
-
return
|
|
2275
|
+
const { id: w } = await s(), v = I.taskId ? `task:${I.taskId}` : `project:${I.projectId}`;
|
|
2276
|
+
let k = c.get(v);
|
|
2277
|
+
return k || (k = ci(t, I, w, i), c.set(v, k)), await k;
|
|
2278
2278
|
}
|
|
2279
2279
|
const u = await Promise.allSettled(
|
|
2280
2280
|
o.map(async (y) => {
|
|
2281
|
-
const
|
|
2282
|
-
return { target:
|
|
2281
|
+
const I = await ki(y, s), w = await d(y, I);
|
|
2282
|
+
return { target: I, uidsToNotify: w };
|
|
2283
2283
|
})
|
|
2284
2284
|
), l = await Promise.allSettled(
|
|
2285
|
-
u.map((y,
|
|
2285
|
+
u.map((y, I) => {
|
|
2286
2286
|
if (y.status === "rejected")
|
|
2287
2287
|
return Promise.reject(y.reason);
|
|
2288
2288
|
const { target: w, uidsToNotify: v } = y.value;
|
|
2289
2289
|
return te(
|
|
2290
2290
|
() => t.addComment({
|
|
2291
|
-
content: o[
|
|
2291
|
+
content: o[I]?.content,
|
|
2292
2292
|
...w,
|
|
2293
2293
|
// Nobody to notify means no recipient field at all,
|
|
2294
2294
|
// rather than an empty one.
|
|
@@ -2301,30 +2301,30 @@ const wi = n.object({
|
|
|
2301
2301
|
o,
|
|
2302
2302
|
l,
|
|
2303
2303
|
(y) => y.content
|
|
2304
|
-
),
|
|
2304
|
+
), m = p.map(({ value: y }) => Be(y));
|
|
2305
2305
|
O(b.ADD_COMMENTS, o.length, f, { redactItems: !0 });
|
|
2306
|
-
const
|
|
2306
|
+
const h = await Si(t, m, {
|
|
2307
2307
|
getTask: i,
|
|
2308
2308
|
getCurrentUser: s
|
|
2309
2309
|
});
|
|
2310
2310
|
return {
|
|
2311
2311
|
textContent: N(
|
|
2312
|
-
Ci({ comments:
|
|
2312
|
+
Ci({ comments: m, notifiedNames: h }),
|
|
2313
2313
|
f
|
|
2314
2314
|
),
|
|
2315
2315
|
structuredContent: {
|
|
2316
|
-
comments:
|
|
2317
|
-
totalCount:
|
|
2318
|
-
addedCommentIds:
|
|
2316
|
+
comments: m,
|
|
2317
|
+
totalCount: m.length,
|
|
2318
|
+
addedCommentIds: m.map((y) => y.id),
|
|
2319
2319
|
failures: f,
|
|
2320
2320
|
totalRequested: o.length,
|
|
2321
|
-
successCount:
|
|
2321
|
+
successCount: m.length,
|
|
2322
2322
|
failureCount: f.length
|
|
2323
2323
|
}
|
|
2324
2324
|
};
|
|
2325
2325
|
}
|
|
2326
2326
|
};
|
|
2327
|
-
async function
|
|
2327
|
+
async function ki(e, t) {
|
|
2328
2328
|
if (!e.taskId && !e.projectId)
|
|
2329
2329
|
throw new Error("Either taskId or projectId must be provided.");
|
|
2330
2330
|
if (e.taskId && e.projectId)
|
|
@@ -2502,47 +2502,47 @@ const xi = n.object({
|
|
|
2502
2502
|
outputSchema: _i,
|
|
2503
2503
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
2504
2504
|
async execute({ filters: e }, t) {
|
|
2505
|
-
const o = Date.now(), r = e.map((
|
|
2505
|
+
const o = Date.now(), r = e.map((h, g) => `tempFilterAdd${g}${o}`), s = e.map((h, g) => V(
|
|
2506
2506
|
"filter_add",
|
|
2507
2507
|
{
|
|
2508
|
-
name:
|
|
2509
|
-
query:
|
|
2510
|
-
...
|
|
2511
|
-
...
|
|
2512
|
-
...
|
|
2508
|
+
name: h.name,
|
|
2509
|
+
query: h.query,
|
|
2510
|
+
...h.description !== void 0 ? { description: h.description } : {},
|
|
2511
|
+
...h.color !== void 0 ? { color: h.color } : {},
|
|
2512
|
+
...h.isFavorite !== void 0 ? { isFavorite: h.isFavorite } : {}
|
|
2513
2513
|
},
|
|
2514
2514
|
r[g]
|
|
2515
2515
|
)), { outcomes: a, tempIdMapping: i } = await X(t, s, {
|
|
2516
2516
|
created: { noun: "filter", findWith: b.FIND_FILTERS }
|
|
2517
|
-
}), c = e.map((
|
|
2517
|
+
}), c = e.map((h, g) => {
|
|
2518
2518
|
const y = a[g];
|
|
2519
2519
|
if (y?.status === "rejected")
|
|
2520
2520
|
return y;
|
|
2521
|
-
const
|
|
2521
|
+
const I = r[g], w = y && I !== void 0 ? i[I] : void 0;
|
|
2522
2522
|
return w ? { status: "fulfilled", value: w } : {
|
|
2523
2523
|
status: "rejected",
|
|
2524
2524
|
reason: new Error("Todoist did not return an ID for the created filter")
|
|
2525
2525
|
};
|
|
2526
|
-
}), { succeeded: d, failures: u } = P(e, c, (
|
|
2527
|
-
({ item:
|
|
2526
|
+
}), { succeeded: d, failures: u } = P(e, c, (h) => h.name), l = d.map(
|
|
2527
|
+
({ item: h, value: g }) => ({
|
|
2528
2528
|
id: g,
|
|
2529
|
-
name:
|
|
2530
|
-
query:
|
|
2529
|
+
name: h.name,
|
|
2530
|
+
query: h.query,
|
|
2531
2531
|
// Omitted rather than null when absent: structured content is sanitised
|
|
2532
2532
|
// with `removeNullFields`, so a null would be stripped and then fail
|
|
2533
2533
|
// validation against the declared output schema.
|
|
2534
|
-
...
|
|
2535
|
-
color:
|
|
2536
|
-
isFavorite:
|
|
2534
|
+
...h.description ? { description: h.description } : {},
|
|
2535
|
+
color: h.color !== void 0 ? se.parse(h.color) : void 0,
|
|
2536
|
+
isFavorite: h.isFavorite ?? !1,
|
|
2537
2537
|
itemOrder: 0
|
|
2538
2538
|
})
|
|
2539
2539
|
);
|
|
2540
2540
|
O(b.ADD_FILTERS, e.length, u, { redactItems: !0 });
|
|
2541
|
-
const p = l.length, f = l.map((
|
|
2542
|
-
`),
|
|
2541
|
+
const p = l.length, f = l.map((h) => `• ${h.name} (id=${h.id})`).join(`
|
|
2542
|
+
`), m = p > 0 ? `Added ${p} filter${p === 1 ? "" : "s"}:
|
|
2543
2543
|
${f}` : "Added 0 filters";
|
|
2544
2544
|
return {
|
|
2545
|
-
textContent: N(
|
|
2545
|
+
textContent: N(m, u),
|
|
2546
2546
|
structuredContent: {
|
|
2547
2547
|
filters: l,
|
|
2548
2548
|
totalCount: l.length,
|
|
@@ -2678,13 +2678,13 @@ ${r.join(`
|
|
|
2678
2678
|
`)}` : "Added 0 folders";
|
|
2679
2679
|
return N(s, t);
|
|
2680
2680
|
}
|
|
2681
|
-
const
|
|
2681
|
+
const qi = n.object({
|
|
2682
2682
|
name: n.string().min(1).max(128).describe("The name of the label."),
|
|
2683
2683
|
color: Te,
|
|
2684
2684
|
order: n.number().int().optional().describe("The position of the label in the label list."),
|
|
2685
2685
|
isFavorite: n.boolean().optional().describe("Whether the label is a favorite. Defaults to false.")
|
|
2686
|
-
}),
|
|
2687
|
-
labels: n.array(
|
|
2686
|
+
}), Gi = {
|
|
2687
|
+
labels: n.array(qi).min(1).max(x.ITEMS_PER_OPERATION).describe("The array of labels to add.")
|
|
2688
2688
|
}, Yi = {
|
|
2689
2689
|
labels: n.array(Pe).describe("The created labels."),
|
|
2690
2690
|
totalCount: n.number().describe("The total number of labels created."),
|
|
@@ -2695,7 +2695,7 @@ const Gi = n.object({
|
|
|
2695
2695
|
}, Vi = {
|
|
2696
2696
|
name: b.ADD_LABELS,
|
|
2697
2697
|
description: "Add one or more new personal labels.",
|
|
2698
|
-
parameters:
|
|
2698
|
+
parameters: Gi,
|
|
2699
2699
|
outputSchema: Yi,
|
|
2700
2700
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
2701
2701
|
async execute({ labels: e }, t) {
|
|
@@ -2831,7 +2831,7 @@ const { FIND_FOLDERS: Qi, FIND_PROJECTS: ec } = b, yo = { noun: "project", findW
|
|
|
2831
2831
|
let v = o.get(w);
|
|
2832
2832
|
return v || (v = C(
|
|
2833
2833
|
() => be.resolveWorkspace(t, w)
|
|
2834
|
-
).then(({ workspaceId:
|
|
2834
|
+
).then(({ workspaceId: k }) => k), o.set(w, v)), v;
|
|
2835
2835
|
}, i = (w) => {
|
|
2836
2836
|
let v = r.get(w);
|
|
2837
2837
|
return v || (v = C(() => t.getFolder(w)), r.set(w, v)), v;
|
|
@@ -2842,16 +2842,16 @@ const { FIND_FOLDERS: Qi, FIND_PROJECTS: ec } = b, yo = { noun: "project", findW
|
|
|
2842
2842
|
d.push({ index: w, project: ac(v) });
|
|
2843
2843
|
continue;
|
|
2844
2844
|
}
|
|
2845
|
-
const { folderId:
|
|
2846
|
-
|
|
2847
|
-
} catch (
|
|
2848
|
-
c.push({ index: w, outcome: { status: "rejected", reason:
|
|
2845
|
+
const { folderId: k, ...$ } = ic(v);
|
|
2846
|
+
k ? u.push({ index: w, project: $, folderId: k }) : l.push({ index: w, project: $ });
|
|
2847
|
+
} catch (k) {
|
|
2848
|
+
c.push({ index: w, outcome: { status: "rejected", reason: k } });
|
|
2849
2849
|
}
|
|
2850
2850
|
const f = (await Promise.all([
|
|
2851
2851
|
c,
|
|
2852
2852
|
dc(t, u, { lookupFolder: i, resolveWorkspaceId: a }),
|
|
2853
2853
|
...d.map(async ({ project: w, index: v }) => {
|
|
2854
|
-
const
|
|
2854
|
+
const k = await Qe(async () => {
|
|
2855
2855
|
const { workspace: $, templateId: U, folderId: T, locale: S, name: A } = w, D = T ? (await wr(
|
|
2856
2856
|
await i(T),
|
|
2857
2857
|
$,
|
|
@@ -2865,9 +2865,9 @@ const { FIND_FOLDERS: Qi, FIND_PROJECTS: ec } = b, yo = { noun: "project", findW
|
|
|
2865
2865
|
});
|
|
2866
2866
|
return D ? await R() : await s(R);
|
|
2867
2867
|
});
|
|
2868
|
-
return [{ index: v, outcome:
|
|
2868
|
+
return [{ index: v, outcome: k }];
|
|
2869
2869
|
}),
|
|
2870
|
-
...l.map(async ({ project: { workspace: w, ...v }, index:
|
|
2870
|
+
...l.map(async ({ project: { workspace: w, ...v }, index: k }) => {
|
|
2871
2871
|
const $ = await Qe(async () => {
|
|
2872
2872
|
const U = await a(w), T = () => te(
|
|
2873
2873
|
() => t.addProject({
|
|
@@ -2878,22 +2878,22 @@ const { FIND_FOLDERS: Qi, FIND_PROJECTS: ec } = b, yo = { noun: "project", findW
|
|
|
2878
2878
|
);
|
|
2879
2879
|
return w ? await T() : await s(T);
|
|
2880
2880
|
});
|
|
2881
|
-
return [{ index:
|
|
2881
|
+
return [{ index: k, outcome: $ }];
|
|
2882
2882
|
})
|
|
2883
|
-
])).flat().sort((w, v) => w.index - v.index).map(({ outcome: w }) => w), { succeeded:
|
|
2883
|
+
])).flat().sort((w, v) => w.index - v.index).map(({ outcome: w }) => w), { succeeded: m, failures: h } = P(
|
|
2884
2884
|
e,
|
|
2885
2885
|
f,
|
|
2886
2886
|
(w, v) => w.name ?? w.templateId ?? `Project ${v + 1}`
|
|
2887
|
-
), g =
|
|
2888
|
-
return O(b.ADD_PROJECTS, e.length,
|
|
2889
|
-
textContent: pc({ projects: g, failures:
|
|
2887
|
+
), g = m.map(({ value: w }) => w), y = g.map(we);
|
|
2888
|
+
return O(b.ADD_PROJECTS, e.length, h, { redactItems: !0 }), {
|
|
2889
|
+
textContent: pc({ projects: g, failures: h }),
|
|
2890
2890
|
structuredContent: {
|
|
2891
2891
|
projects: y,
|
|
2892
2892
|
totalCount: y.length,
|
|
2893
|
-
failures:
|
|
2893
|
+
failures: h,
|
|
2894
2894
|
totalRequested: e.length,
|
|
2895
2895
|
successCount: y.length,
|
|
2896
|
-
failureCount:
|
|
2896
|
+
failureCount: h.length
|
|
2897
2897
|
}
|
|
2898
2898
|
};
|
|
2899
2899
|
}
|
|
@@ -2949,25 +2949,25 @@ async function dc(e, t, {
|
|
|
2949
2949
|
resolveWorkspaceId: r
|
|
2950
2950
|
}) {
|
|
2951
2951
|
const s = await Promise.all(
|
|
2952
|
-
t.map(async ({ index: l, project: { workspace: p, ...f }, folderId:
|
|
2952
|
+
t.map(async ({ index: l, project: { workspace: p, ...f }, folderId: m }) => ({
|
|
2953
2953
|
index: l,
|
|
2954
2954
|
project: f,
|
|
2955
2955
|
tempId: Oe(),
|
|
2956
2956
|
folder: await Qe(
|
|
2957
|
-
async () => wr(await o(
|
|
2957
|
+
async () => wr(await o(m), p, r)
|
|
2958
2958
|
)
|
|
2959
2959
|
}))
|
|
2960
2960
|
), a = [], i = [];
|
|
2961
|
-
for (const { index: l, project: p, tempId: f, folder:
|
|
2962
|
-
if (
|
|
2963
|
-
a.push({ index: l, outcome:
|
|
2961
|
+
for (const { index: l, project: p, tempId: f, folder: m } of s) {
|
|
2962
|
+
if (m.status === "rejected") {
|
|
2963
|
+
a.push({ index: l, outcome: m });
|
|
2964
2964
|
continue;
|
|
2965
2965
|
}
|
|
2966
|
-
const { workspaceId:
|
|
2966
|
+
const { workspaceId: h, id: g } = m.value;
|
|
2967
2967
|
i.push({
|
|
2968
2968
|
index: l,
|
|
2969
2969
|
tempId: f,
|
|
2970
|
-
command: V("project_add", { ...p, workspaceId:
|
|
2970
|
+
command: V("project_add", { ...p, workspaceId: h, folderId: g }, f)
|
|
2971
2971
|
});
|
|
2972
2972
|
}
|
|
2973
2973
|
if (i.length === 0)
|
|
@@ -3062,16 +3062,16 @@ function vr(e, t) {
|
|
|
3062
3062
|
];
|
|
3063
3063
|
});
|
|
3064
3064
|
}
|
|
3065
|
-
const et = 25, lt = n.enum(ps),
|
|
3065
|
+
const et = 25, lt = n.enum(ps), Ir = n.object({
|
|
3066
3066
|
date: n.string().optional().describe("Due date in YYYY-MM-DD format."),
|
|
3067
3067
|
string: n.string().optional().describe('Natural language due string, e.g. "tomorrow at 3pm".'),
|
|
3068
3068
|
timezone: n.string().optional().describe('Timezone for the reminder, e.g. "America/New_York".'),
|
|
3069
3069
|
lang: n.string().optional().describe('Language for parsing the due string, e.g. "en".')
|
|
3070
|
-
}),
|
|
3070
|
+
}), kr = n.enum(An), ut = n.boolean().optional().describe("Whether this is an urgent reminder. Applies to relative and absolute reminders."), Sr = `Who to remind: user ID, email, name, or "me". Must collaborate on the task's project.`, wo = K(
|
|
3071
3071
|
`${Sr} Defaults to the creator.`
|
|
3072
3072
|
), To = K(
|
|
3073
3073
|
`${Sr} Omit to keep the current one.`
|
|
3074
|
-
), bt = { noun: "reminder", findWith: b.FIND_REMINDERS },
|
|
3074
|
+
), bt = { noun: "reminder", findWith: b.FIND_REMINDERS }, mc = n.object({
|
|
3075
3075
|
type: n.literal("relative"),
|
|
3076
3076
|
taskId: n.string().min(1).describe("The ID of the task to set a reminder for."),
|
|
3077
3077
|
minuteOffset: n.number().int().min(0).describe(
|
|
@@ -3082,10 +3082,10 @@ const et = 25, lt = n.enum(ps), kr = n.object({
|
|
|
3082
3082
|
),
|
|
3083
3083
|
isUrgent: ut,
|
|
3084
3084
|
notifyUser: wo
|
|
3085
|
-
}),
|
|
3085
|
+
}), hc = n.object({
|
|
3086
3086
|
type: n.literal("absolute"),
|
|
3087
3087
|
taskId: n.string().min(1).describe("The ID of the task to set a reminder for."),
|
|
3088
|
-
due:
|
|
3088
|
+
due: Ir.describe("The specific date/time for the reminder."),
|
|
3089
3089
|
service: lt.optional().describe(
|
|
3090
3090
|
'Delivery method: "email" or "push" notification. Defaults to push.'
|
|
3091
3091
|
),
|
|
@@ -3097,14 +3097,14 @@ const et = 25, lt = n.enum(ps), kr = n.object({
|
|
|
3097
3097
|
name: n.string().min(1).describe('Name of the location, e.g. "Office", "Home".'),
|
|
3098
3098
|
locLat: n.string().describe('Latitude of the location as a string, e.g. "37.7749".'),
|
|
3099
3099
|
locLong: n.string().describe('Longitude of the location as a string, e.g. "-122.4194".'),
|
|
3100
|
-
locTrigger:
|
|
3100
|
+
locTrigger: kr.describe(
|
|
3101
3101
|
'When to trigger: "on_enter" (arriving) or "on_leave" (departing).'
|
|
3102
3102
|
),
|
|
3103
3103
|
radius: n.number().int().optional().describe("Radius in meters for the geofence. Defaults to server default."),
|
|
3104
3104
|
notifyUser: wo
|
|
3105
3105
|
}), gc = n.discriminatedUnion("type", [
|
|
3106
|
-
hc,
|
|
3107
3106
|
mc,
|
|
3107
|
+
hc,
|
|
3108
3108
|
fc
|
|
3109
3109
|
]), bc = {
|
|
3110
3110
|
reminders: n.array(gc).min(1).max(et).describe(
|
|
@@ -3138,7 +3138,7 @@ const et = 25, lt = n.enum(ps), kr = n.object({
|
|
|
3138
3138
|
const f = r[p];
|
|
3139
3139
|
if (f?.status === "rejected")
|
|
3140
3140
|
throw f.reason;
|
|
3141
|
-
const
|
|
3141
|
+
const m = f?.value;
|
|
3142
3142
|
switch (l.type) {
|
|
3143
3143
|
case "relative":
|
|
3144
3144
|
return await te(
|
|
@@ -3148,7 +3148,7 @@ const et = 25, lt = n.enum(ps), kr = n.object({
|
|
|
3148
3148
|
minuteOffset: l.minuteOffset,
|
|
3149
3149
|
service: l.service,
|
|
3150
3150
|
isUrgent: l.isUrgent,
|
|
3151
|
-
notifyUid:
|
|
3151
|
+
notifyUid: m
|
|
3152
3152
|
}),
|
|
3153
3153
|
bt
|
|
3154
3154
|
);
|
|
@@ -3160,7 +3160,7 @@ const et = 25, lt = n.enum(ps), kr = n.object({
|
|
|
3160
3160
|
due: l.due,
|
|
3161
3161
|
service: l.service,
|
|
3162
3162
|
isUrgent: l.isUrgent,
|
|
3163
|
-
notifyUid:
|
|
3163
|
+
notifyUid: m
|
|
3164
3164
|
}),
|
|
3165
3165
|
bt
|
|
3166
3166
|
);
|
|
@@ -3173,7 +3173,7 @@ const et = 25, lt = n.enum(ps), kr = n.object({
|
|
|
3173
3173
|
locLong: l.locLong,
|
|
3174
3174
|
locTrigger: l.locTrigger,
|
|
3175
3175
|
radius: l.radius,
|
|
3176
|
-
notifyUid:
|
|
3176
|
+
notifyUid: m
|
|
3177
3177
|
}),
|
|
3178
3178
|
bt
|
|
3179
3179
|
);
|
|
@@ -3209,7 +3209,7 @@ const et = 25, lt = n.enum(ps), kr = n.object({
|
|
|
3209
3209
|
}
|
|
3210
3210
|
};
|
|
3211
3211
|
function Tc(e) {
|
|
3212
|
-
const { timeBasedCount: t, locationCount: o } =
|
|
3212
|
+
const { timeBasedCount: t, locationCount: o } = mr(e), r = [];
|
|
3213
3213
|
if (t > 0) {
|
|
3214
3214
|
const s = t > 1 ? "reminders" : "reminder";
|
|
3215
3215
|
r.push(`${t} time-based ${s}`);
|
|
@@ -3226,9 +3226,9 @@ const vc = n.object({
|
|
|
3226
3226
|
'The ID of the project to add the section to. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
3227
3227
|
),
|
|
3228
3228
|
description: n.string().optional().describe("The description of the section. Supports Markdown.")
|
|
3229
|
-
}),
|
|
3229
|
+
}), Ic = {
|
|
3230
3230
|
sections: n.array(vc).min(1).max(x.ITEMS_PER_OPERATION).describe("The array of sections to add.")
|
|
3231
|
-
},
|
|
3231
|
+
}, kc = {
|
|
3232
3232
|
sections: n.array(de).describe("The created sections."),
|
|
3233
3233
|
totalCount: n.number().describe("The total number of sections created."),
|
|
3234
3234
|
failures: n.array(_).describe("Sections that could not be created, with the reason for each."),
|
|
@@ -3238,8 +3238,8 @@ const vc = n.object({
|
|
|
3238
3238
|
}, Sc = {
|
|
3239
3239
|
name: b.ADD_SECTIONS,
|
|
3240
3240
|
description: "Add one or more new sections to projects.",
|
|
3241
|
-
parameters:
|
|
3242
|
-
outputSchema:
|
|
3241
|
+
parameters: Ic,
|
|
3242
|
+
outputSchema: kc,
|
|
3243
3243
|
annotations: { readOnlyHint: !1, destructiveHint: !1, idempotentHint: !1 },
|
|
3244
3244
|
async execute({ sections: e }, t) {
|
|
3245
3245
|
const o = e.some((d) => ne(d.projectId)) ? C(() => t.getUser()) : void 0, r = await Promise.allSettled(
|
|
@@ -3485,7 +3485,7 @@ class jc {
|
|
|
3485
3485
|
const l = await F.resolveUser(t, r);
|
|
3486
3486
|
if (!l)
|
|
3487
3487
|
return a.push("User not found - check spelling or invite to a shared project"), { canAssign: !1, projectInfo: u, recommendations: a };
|
|
3488
|
-
const p = d.some((
|
|
3488
|
+
const p = d.some((h) => h.id === l.userId), f = {
|
|
3489
3489
|
resolvedName: l.displayName,
|
|
3490
3490
|
isCollaborator: p
|
|
3491
3491
|
};
|
|
@@ -3493,22 +3493,22 @@ class jc {
|
|
|
3493
3493
|
return a.push(
|
|
3494
3494
|
`Invite ${l.displayName} to collaborate on project "${c.name}"`
|
|
3495
3495
|
), { canAssign: !1, projectInfo: u, userInfo: f, recommendations: a };
|
|
3496
|
-
let
|
|
3496
|
+
let m;
|
|
3497
3497
|
if (s && s.length > 0) {
|
|
3498
|
-
let
|
|
3498
|
+
let h = 0, g = 0;
|
|
3499
3499
|
for (const y of s)
|
|
3500
3500
|
try {
|
|
3501
|
-
await t.getTask(y),
|
|
3501
|
+
await t.getTask(y), h++;
|
|
3502
3502
|
} catch {
|
|
3503
3503
|
g++;
|
|
3504
3504
|
}
|
|
3505
|
-
|
|
3505
|
+
m = { accessibleTasks: h, inaccessibleTasks: g }, g > 0 && a.push(`${g} task(s) are not accessible`);
|
|
3506
3506
|
}
|
|
3507
3507
|
return i = !0, a.push(`Ready to assign tasks to ${l.displayName}`), {
|
|
3508
3508
|
canAssign: i,
|
|
3509
3509
|
projectInfo: u,
|
|
3510
3510
|
userInfo: f,
|
|
3511
|
-
taskInfo:
|
|
3511
|
+
taskInfo: m,
|
|
3512
3512
|
recommendations: a
|
|
3513
3513
|
};
|
|
3514
3514
|
}
|
|
@@ -3563,15 +3563,15 @@ const vo = new jc(), Ko = x.TASK_CREATES_PER_OPERATION, $c = n.object({
|
|
|
3563
3563
|
openWorldHint: !0
|
|
3564
3564
|
},
|
|
3565
3565
|
async execute(e, t) {
|
|
3566
|
-
const { tasks: o } = n.object(zo).parse(e), r = Dc(t), s = await Promise.allSettled(o.map((
|
|
3567
|
-
const g = o[
|
|
3568
|
-
return
|
|
3566
|
+
const { tasks: o } = n.object(zo).parse(e), r = Dc(t), s = await Promise.allSettled(o.map((m) => xc(m, r))), a = s.flatMap((m, h) => {
|
|
3567
|
+
const g = o[h];
|
|
3568
|
+
return m.status === "fulfilled" && g ? [{ index: h, task: g, ...m.value }] : [];
|
|
3569
3569
|
}), i = await _c(t, a), c = s.map(
|
|
3570
|
-
(
|
|
3570
|
+
(m, h) => m.status === "rejected" ? m : i.get(h) ?? {
|
|
3571
3571
|
status: "rejected",
|
|
3572
3572
|
reason: new Error("Todoist did not report whether this task was created")
|
|
3573
3573
|
}
|
|
3574
|
-
), { succeeded: d, failures: u } = P(o, c, (
|
|
3574
|
+
), { succeeded: d, failures: u } = P(o, c, (m) => m.content), l = d.map(({ value: m }) => m), p = l.map(z);
|
|
3575
3575
|
return O(b.ADD_TASKS, o.length, u, { redactItems: !0 }), {
|
|
3576
3576
|
textContent: Rc({
|
|
3577
3577
|
tasks: p,
|
|
@@ -3626,14 +3626,14 @@ async function xc(e, t) {
|
|
|
3626
3626
|
priority: l,
|
|
3627
3627
|
labels: p,
|
|
3628
3628
|
dueString: f,
|
|
3629
|
-
deadlineDate:
|
|
3630
|
-
isUncompletable:
|
|
3629
|
+
deadlineDate: m,
|
|
3630
|
+
isUncompletable: h
|
|
3631
3631
|
} = e, g = ne(a) ? void 0 : a;
|
|
3632
3632
|
if (g) {
|
|
3633
|
-
const
|
|
3634
|
-
if (
|
|
3633
|
+
const k = await t.lookUpProject(g);
|
|
3634
|
+
if (k.isArchived)
|
|
3635
3635
|
throw new Error(
|
|
3636
|
-
`Task "${o}": Cannot create task in archived project "${
|
|
3636
|
+
`Task "${o}": Cannot create task in archived project "${k.name}"`
|
|
3637
3637
|
);
|
|
3638
3638
|
}
|
|
3639
3639
|
if (u && !g && !i && !c)
|
|
@@ -3641,13 +3641,13 @@ async function xc(e, t) {
|
|
|
3641
3641
|
`Task "${o}": Cannot assign tasks without specifying project context. Please specify a projectId, sectionId, or parentId.`
|
|
3642
3642
|
);
|
|
3643
3643
|
const y = s ? to(`Task "${o}"`, s) : void 0;
|
|
3644
|
-
let
|
|
3645
|
-
u && (
|
|
3644
|
+
let I;
|
|
3645
|
+
u && (I = await Oc(e, t, g));
|
|
3646
3646
|
const w = Oe();
|
|
3647
3647
|
return { command: V(
|
|
3648
3648
|
"item_add",
|
|
3649
3649
|
{
|
|
3650
|
-
content:
|
|
3650
|
+
content: h ? Uc(o) : o,
|
|
3651
3651
|
description: r,
|
|
3652
3652
|
projectId: g,
|
|
3653
3653
|
sectionId: i,
|
|
@@ -3656,9 +3656,9 @@ async function xc(e, t) {
|
|
|
3656
3656
|
labels: p,
|
|
3657
3657
|
priority: l ? no(l) : void 0,
|
|
3658
3658
|
due: f ? { string: f } : void 0,
|
|
3659
|
-
deadline:
|
|
3659
|
+
deadline: m ? { date: m } : void 0,
|
|
3660
3660
|
duration: y,
|
|
3661
|
-
responsibleUid:
|
|
3661
|
+
responsibleUid: I,
|
|
3662
3662
|
// The REST create adds the user's default reminder to a task with a due
|
|
3663
3663
|
// time; Sync only does when asked.
|
|
3664
3664
|
autoReminder: !0
|
|
@@ -3702,18 +3702,18 @@ async function _c(e, t) {
|
|
|
3702
3702
|
{ created: { noun: "task", findWith: b.FIND_TASKS } }
|
|
3703
3703
|
), i = /* @__PURE__ */ new Map();
|
|
3704
3704
|
if (t.forEach(({ index: u, task: l, tempId: p }, f) => {
|
|
3705
|
-
const
|
|
3706
|
-
if (
|
|
3705
|
+
const m = r[f];
|
|
3706
|
+
if (m?.status !== "fulfilled") {
|
|
3707
3707
|
o.set(u, {
|
|
3708
3708
|
status: "rejected",
|
|
3709
3709
|
// Only Todoist's answer about this task's own command can blame its
|
|
3710
3710
|
// due string; a failed request says nothing about any one task.
|
|
3711
|
-
reason: a ?
|
|
3711
|
+
reason: a ? m?.reason : Pc(m?.reason, l)
|
|
3712
3712
|
});
|
|
3713
3713
|
return;
|
|
3714
3714
|
}
|
|
3715
|
-
const
|
|
3716
|
-
if (!
|
|
3715
|
+
const h = s[p];
|
|
3716
|
+
if (!h) {
|
|
3717
3717
|
o.set(u, {
|
|
3718
3718
|
status: "rejected",
|
|
3719
3719
|
reason: new Error(
|
|
@@ -3722,7 +3722,7 @@ async function _c(e, t) {
|
|
|
3722
3722
|
});
|
|
3723
3723
|
return;
|
|
3724
3724
|
}
|
|
3725
|
-
i.set(u,
|
|
3725
|
+
i.set(u, h);
|
|
3726
3726
|
}), i.size === 0)
|
|
3727
3727
|
return o;
|
|
3728
3728
|
const c = [...i.values()], d = /* @__PURE__ */ new Map();
|
|
@@ -3760,11 +3760,11 @@ function Pc(e, t) {
|
|
|
3760
3760
|
dueString: t.dueString,
|
|
3761
3761
|
deadlineDate: t.deadlineDate
|
|
3762
3762
|
});
|
|
3763
|
-
return o ? new
|
|
3763
|
+
return o ? new Gt(o) : e;
|
|
3764
3764
|
}
|
|
3765
|
-
const
|
|
3765
|
+
const qo = "* ";
|
|
3766
3766
|
function Uc(e) {
|
|
3767
|
-
return e.startsWith(
|
|
3767
|
+
return e.startsWith(qo) ? e : `${qo}${e}`;
|
|
3768
3768
|
}
|
|
3769
3769
|
function Rc({
|
|
3770
3770
|
tasks: e,
|
|
@@ -3779,7 +3779,7 @@ function Rc({
|
|
|
3779
3779
|
const a = Array.from(r)[0];
|
|
3780
3780
|
s = a === "inbox" ? "" : `to ${a}`;
|
|
3781
3781
|
} else r.size > 1 && (s = "to multiple contexts");
|
|
3782
|
-
return t.length > 0 ?
|
|
3782
|
+
return t.length > 0 ? mo({
|
|
3783
3783
|
action: `Added tasks${s ? ` ${s}` : ""}`,
|
|
3784
3784
|
success: e.length,
|
|
3785
3785
|
total: o.tasks.length,
|
|
@@ -3791,7 +3791,7 @@ function Rc({
|
|
|
3791
3791
|
showDetails: !0
|
|
3792
3792
|
});
|
|
3793
3793
|
}
|
|
3794
|
-
const
|
|
3794
|
+
const Go = n.object({
|
|
3795
3795
|
date: n.string().optional().describe("ISO date or datetime."),
|
|
3796
3796
|
string: n.string().optional().describe('e.g. "every monday at 9am".'),
|
|
3797
3797
|
lang: n.string().optional(),
|
|
@@ -3820,9 +3820,9 @@ const qo = n.object({
|
|
|
3820
3820
|
parentId: n.string().optional(),
|
|
3821
3821
|
priority: rt.optional().describe("p1 is the highest."),
|
|
3822
3822
|
labels: n.array(n.string()).max(x.LABELS_PER_TASK).optional(),
|
|
3823
|
-
due:
|
|
3824
|
-
deadline:
|
|
3825
|
-
duration: n.object({ amount: n.number(), unit: n.enum(
|
|
3823
|
+
due: Go.optional(),
|
|
3824
|
+
deadline: Go.optional(),
|
|
3825
|
+
duration: n.object({ amount: n.number(), unit: n.enum(ms) }).optional(),
|
|
3826
3826
|
responsibleUid: n.string().optional().describe("Assignee user ID."),
|
|
3827
3827
|
assignedByUid: n.string().optional()
|
|
3828
3828
|
})
|
|
@@ -4081,23 +4081,23 @@ async function Bc(e, {
|
|
|
4081
4081
|
() => e.addTemplate({ ...w, name: s, description: a, color: i ?? "charcoal" })
|
|
4082
4082
|
);
|
|
4083
4083
|
}
|
|
4084
|
-
const
|
|
4084
|
+
const m = u !== void 0 && f.workspaceId !== u, h = d === !0 && !f.sharedWithWorkspaceMembers;
|
|
4085
4085
|
let g;
|
|
4086
|
-
if (
|
|
4086
|
+
if (m || h)
|
|
4087
4087
|
try {
|
|
4088
4088
|
f = await C(
|
|
4089
4089
|
() => e.updateTemplate(f.id, {
|
|
4090
|
-
workspaceId:
|
|
4091
|
-
sharedWithWorkspaceMembers:
|
|
4090
|
+
workspaceId: m ? u : void 0,
|
|
4091
|
+
sharedWithWorkspaceMembers: h ? !0 : void 0
|
|
4092
4092
|
})
|
|
4093
4093
|
);
|
|
4094
4094
|
} catch (w) {
|
|
4095
4095
|
g = L(w);
|
|
4096
4096
|
}
|
|
4097
|
-
const y = f.workspaceId ?? void 0,
|
|
4097
|
+
const y = f.workspaceId ?? void 0, I = t ? `project (id=${t})` : r ? "the draft" : "CSV content";
|
|
4098
4098
|
return {
|
|
4099
4099
|
textContent: Kc({
|
|
4100
|
-
source:
|
|
4100
|
+
source: I,
|
|
4101
4101
|
template: f,
|
|
4102
4102
|
workspaceId: y,
|
|
4103
4103
|
workspaceError: g
|
|
@@ -4135,7 +4135,7 @@ const zc = {
|
|
|
4135
4135
|
projectId: n.string().min(1).describe(
|
|
4136
4136
|
"The ID of the project to analyze. This triggers a new health analysis which may take some time to complete."
|
|
4137
4137
|
)
|
|
4138
|
-
},
|
|
4138
|
+
}, qc = {
|
|
4139
4139
|
projectId: n.string().describe("The project ID."),
|
|
4140
4140
|
health: n.object({
|
|
4141
4141
|
status: n.enum(Bt).describe("The health status after triggering analysis."),
|
|
@@ -4143,11 +4143,11 @@ const zc = {
|
|
|
4143
4143
|
updateInProgress: n.boolean().describe("Whether an analysis update is currently in progress.")
|
|
4144
4144
|
}).describe("The health response returned after triggering analysis."),
|
|
4145
4145
|
message: n.string().describe("A human-readable message about the analysis status.")
|
|
4146
|
-
},
|
|
4146
|
+
}, Gc = {
|
|
4147
4147
|
name: b.ANALYZE_PROJECT_HEALTH,
|
|
4148
4148
|
description: "Trigger a new health analysis for a project. Use this when the health data is stale or you want a fresh assessment. The analysis may take time to complete — use get-project-health afterward to see updated results.",
|
|
4149
4149
|
parameters: zc,
|
|
4150
|
-
outputSchema:
|
|
4150
|
+
outputSchema: qc,
|
|
4151
4151
|
annotations: {
|
|
4152
4152
|
readOnlyHint: !1,
|
|
4153
4153
|
destructiveHint: !1,
|
|
@@ -4277,7 +4277,7 @@ function ed({
|
|
|
4277
4277
|
failures: t,
|
|
4278
4278
|
args: o
|
|
4279
4279
|
}) {
|
|
4280
|
-
return
|
|
4280
|
+
return mo({
|
|
4281
4281
|
action: "Completed tasks",
|
|
4282
4282
|
success: e.length,
|
|
4283
4283
|
total: o.ids.length,
|
|
@@ -4498,7 +4498,7 @@ function nn(e, t) {
|
|
|
4498
4498
|
const o = t.hasMoreChildren ? "+" : "", r = t.childrenError ? " (partial)" : "";
|
|
4499
4499
|
return ` • ${e}=${t.childCount}${o}${r}`;
|
|
4500
4500
|
}
|
|
4501
|
-
const Ar = ["task", "project", "comment", "section", "template"],
|
|
4501
|
+
const Ar = ["task", "project", "comment", "section", "template"], md = {
|
|
4502
4502
|
type: n.enum(Ar).describe("The type of object to fetch."),
|
|
4503
4503
|
id: n.string().regex(ct).describe(
|
|
4504
4504
|
'The unique ID of the object to fetch. For a template, also a gallery slug ("product-launch") or a Todoist template URL.'
|
|
@@ -4506,7 +4506,7 @@ const Ar = ["task", "project", "comment", "section", "template"], hd = {
|
|
|
4506
4506
|
includeChildren: n.boolean().optional().describe(
|
|
4507
4507
|
"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, sections and templates."
|
|
4508
4508
|
)
|
|
4509
|
-
},
|
|
4509
|
+
}, hd = n.object({
|
|
4510
4510
|
id: n.string(),
|
|
4511
4511
|
name: n.string(),
|
|
4512
4512
|
description: n.string(),
|
|
@@ -4522,12 +4522,12 @@ const Ar = ["task", "project", "comment", "section", "template"], hd = {
|
|
|
4522
4522
|
}), fd = {
|
|
4523
4523
|
type: n.enum(Ar).describe("The type of object fetched."),
|
|
4524
4524
|
id: n.string().describe("The ID of the fetched object."),
|
|
4525
|
-
object: n.union([ae, ve, Ke, de,
|
|
4525
|
+
object: n.union([ae, ve, Ke, de, hd]).describe("The fetched object data."),
|
|
4526
4526
|
...ld
|
|
4527
4527
|
}, gd = {
|
|
4528
4528
|
name: b.FETCH_OBJECT,
|
|
4529
4529
|
description: "Fetch a single task, project, comment, section, or template by its ID. Use this when you have a specific object ID and want to retrieve its full details. Set includeChildren to also get its direct subtasks or sub-projects. A template comes with its full content (layout, sections, tasks, comments): to edit a saved template's content, change it and send all of it back to update-template as `content`.",
|
|
4530
|
-
parameters:
|
|
4530
|
+
parameters: md,
|
|
4531
4531
|
outputSchema: fd,
|
|
4532
4532
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4533
4533
|
async execute(e, t) {
|
|
@@ -4615,7 +4615,7 @@ const Ar = ["task", "project", "comment", "section", "template"], hd = {
|
|
|
4615
4615
|
}
|
|
4616
4616
|
}
|
|
4617
4617
|
} catch (a) {
|
|
4618
|
-
throw a instanceof
|
|
4618
|
+
throw a instanceof me ? a : new Error(
|
|
4619
4619
|
`Failed to fetch ${o} with id ${r}: ${a instanceof Error ? a.message : String(a)}`
|
|
4620
4620
|
);
|
|
4621
4621
|
}
|
|
@@ -4709,10 +4709,10 @@ Favorite: Yes`), a = {
|
|
|
4709
4709
|
function rn(e) {
|
|
4710
4710
|
return K(e).pipe(vd.optional());
|
|
4711
4711
|
}
|
|
4712
|
-
const
|
|
4712
|
+
const Id = {
|
|
4713
4713
|
objectType: n.enum(_n).optional().describe("Type of object to filter by."),
|
|
4714
4714
|
objectId: n.string().optional().describe("Filter by specific object ID (task, project, or comment). Requires objectType."),
|
|
4715
|
-
eventType: n.enum(
|
|
4715
|
+
eventType: n.enum(hs).optional().describe("Type of event to filter by."),
|
|
4716
4716
|
projectId: n.string().optional().describe("Filter events by parent project ID."),
|
|
4717
4717
|
taskId: n.string().optional().describe("Filter events by parent task ID (for subtask events)."),
|
|
4718
4718
|
initiatorId: n.string().optional().describe(
|
|
@@ -4726,8 +4726,8 @@ const kd = {
|
|
|
4726
4726
|
),
|
|
4727
4727
|
limit: n.number().int().min(1).max(E.ACTIVITY_MAX).default(E.ACTIVITY_DEFAULT).describe("Maximum number of activity events to return."),
|
|
4728
4728
|
cursor: n.string().optional().describe("Pagination cursor for retrieving the next page of results.")
|
|
4729
|
-
},
|
|
4730
|
-
events: n.array(
|
|
4729
|
+
}, kd = {
|
|
4730
|
+
events: n.array(mi).describe("The activity events."),
|
|
4731
4731
|
nextCursor: n.string().optional(),
|
|
4732
4732
|
totalCount: n.number().describe("The total number of events in this page."),
|
|
4733
4733
|
hasMore: n.boolean(),
|
|
@@ -4735,8 +4735,8 @@ const kd = {
|
|
|
4735
4735
|
}, Sd = {
|
|
4736
4736
|
name: b.FIND_ACTIVITY,
|
|
4737
4737
|
description: `Retrieve activity logs to monitor and audit changes in Todoist. Shows events from all users by default (use initiatorId to filter by specific user). To answer what someone completed in a period, including recurring task occurrences, use objectType "task", eventType "completed", and dateFrom/dateTo. For a first-person question ("what did I get done"), also set initiatorId to the current user from user-info, or the answer includes collaborators' completions. Track task completions, updates, deletions, project changes, and more with flexible filtering. Activity history availability and retention depend on the user plan.`,
|
|
4738
|
-
parameters:
|
|
4739
|
-
outputSchema:
|
|
4738
|
+
parameters: Id,
|
|
4739
|
+
outputSchema: kd,
|
|
4740
4740
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4741
4741
|
async execute(e, t) {
|
|
4742
4742
|
const {
|
|
@@ -4760,10 +4760,10 @@ const kd = {
|
|
|
4760
4760
|
cursor: p ?? null
|
|
4761
4761
|
};
|
|
4762
4762
|
o && s ? f.objectEventTypes = `${o}:${s}` : o ? f.objectEventTypes = `${o}:` : s && (f.objectEventTypes = `:${s}`), r && r !== "remove" && (f.objectId = r), a && (f.parentProjectId = a), i && (f.parentItemId = i), c && (f.initiatorId = c), d && (f.dateFrom = d), u && (f.dateTo = u);
|
|
4763
|
-
const { results:
|
|
4763
|
+
const { results: m, nextCursor: h } = await t.getActivityLogs(f), g = m.map(si), y = g.length > 0 ? await $d(t) : void 0, I = Ed(y), w = await F.getUserShortNames(
|
|
4764
4764
|
t,
|
|
4765
4765
|
g.flatMap(
|
|
4766
|
-
(
|
|
4766
|
+
(k) => k.initiatorId && k.parentProjectId ? [k.parentProjectId] : []
|
|
4767
4767
|
),
|
|
4768
4768
|
y?.id ?? null
|
|
4769
4769
|
);
|
|
@@ -4771,15 +4771,15 @@ const kd = {
|
|
|
4771
4771
|
textContent: Ad({
|
|
4772
4772
|
events: g,
|
|
4773
4773
|
args: e,
|
|
4774
|
-
nextCursor:
|
|
4774
|
+
nextCursor: h,
|
|
4775
4775
|
initiatorNames: w,
|
|
4776
|
-
timeZone:
|
|
4776
|
+
timeZone: I
|
|
4777
4777
|
}),
|
|
4778
4778
|
structuredContent: {
|
|
4779
4779
|
events: g,
|
|
4780
|
-
nextCursor:
|
|
4780
|
+
nextCursor: h ?? void 0,
|
|
4781
4781
|
totalCount: g.length,
|
|
4782
|
-
hasMore: !!
|
|
4782
|
+
hasMore: !!h,
|
|
4783
4783
|
appliedFilters: e
|
|
4784
4784
|
}
|
|
4785
4785
|
};
|
|
@@ -4972,13 +4972,13 @@ function Rd({
|
|
|
4972
4972
|
a = `Found ${e.length} ${d} for ${t} ${o}${c}`, r && (a += " • More available");
|
|
4973
4973
|
}
|
|
4974
4974
|
if (s) {
|
|
4975
|
-
const i =
|
|
4975
|
+
const i = ho([], s);
|
|
4976
4976
|
return `${a}
|
|
4977
4977
|
${i}`;
|
|
4978
4978
|
}
|
|
4979
4979
|
return a;
|
|
4980
4980
|
}
|
|
4981
|
-
const Nd = ["and", "or"],
|
|
4981
|
+
const Nd = ["and", "or"], Io = {
|
|
4982
4982
|
labels: n.string().array().max(E.FILTER_VALUES_MAX).optional().describe("The labels to filter the tasks by"),
|
|
4983
4983
|
labelsOperator: n.enum(Nd).optional().describe(
|
|
4984
4984
|
'The operator to use when filtering by labels. This will dictate whether a task has all labels, or some of them. Default is "or".'
|
|
@@ -4988,7 +4988,7 @@ function pt(e) {
|
|
|
4988
4988
|
const t = e.trim();
|
|
4989
4989
|
return t.startsWith("@") ? t.slice(1) : t;
|
|
4990
4990
|
}
|
|
4991
|
-
function
|
|
4991
|
+
function ko(e = [], t = "or") {
|
|
4992
4992
|
if (e.length === 0) return "";
|
|
4993
4993
|
const o = t === "and" ? " & " : " | ";
|
|
4994
4994
|
return `(${e.map((a) => `@${Kt(pt(a))}`).join(` ${o} `)})`;
|
|
@@ -5043,7 +5043,7 @@ const Wd = {
|
|
|
5043
5043
|
cursor: n.string().optional().describe(
|
|
5044
5044
|
"The cursor to get the next page of tasks (cursor is obtained from the previous call to this tool, with the same parameters)."
|
|
5045
5045
|
),
|
|
5046
|
-
...
|
|
5046
|
+
...Io
|
|
5047
5047
|
}, Bd = {
|
|
5048
5048
|
tasks: n.array(ae).describe("The found completed tasks."),
|
|
5049
5049
|
nextCursor: n.string().optional(),
|
|
@@ -5072,17 +5072,17 @@ const Wd = {
|
|
|
5072
5072
|
throw new Error(
|
|
5073
5073
|
"Cursor pagination requires explicit since and until. Reuse structuredContent.appliedFilters.since and structuredContent.appliedFilters.until from the previous page."
|
|
5074
5074
|
);
|
|
5075
|
-
const f = await ro(t, c),
|
|
5076
|
-
let g =
|
|
5077
|
-
f &&
|
|
5078
|
-
const y = await t.getUser(),
|
|
5075
|
+
const f = await ro(t, c), m = f?.email;
|
|
5076
|
+
let g = ko(r, s);
|
|
5077
|
+
f && m && (g = xe(g, `assigned to: ${m}`));
|
|
5078
|
+
const y = await t.getUser(), I = y.tzInfo?.gmtString || "+00:00", w = await ye({
|
|
5079
5079
|
projectId: d,
|
|
5080
5080
|
user: y
|
|
5081
5081
|
}), v = Hd({
|
|
5082
5082
|
since: a,
|
|
5083
5083
|
until: i,
|
|
5084
|
-
userGmtOffset:
|
|
5085
|
-
}),
|
|
5084
|
+
userGmtOffset: I
|
|
5085
|
+
}), k = y.tzInfo?.timezone, $ = (Co) => new Date(Qn({ date: Co, timeZone: k, fallbackOffset: I })), U = $(v.since).toISOString(), T = new Date(
|
|
5086
5086
|
$(ge(v.until, 1)).getTime() - 1e3
|
|
5087
5087
|
).toISOString(), S = {
|
|
5088
5088
|
...e,
|
|
@@ -5107,10 +5107,10 @@ const Wd = {
|
|
|
5107
5107
|
textContent: zd({
|
|
5108
5108
|
tasks: R,
|
|
5109
5109
|
args: S,
|
|
5110
|
-
userGmtOffset:
|
|
5111
|
-
userTimezone:
|
|
5110
|
+
userGmtOffset: I,
|
|
5111
|
+
userTimezone: k,
|
|
5112
5112
|
nextCursor: D,
|
|
5113
|
-
assigneeEmail:
|
|
5113
|
+
assigneeEmail: m,
|
|
5114
5114
|
assigneeNames: await De(t, R, y.id)
|
|
5115
5115
|
}),
|
|
5116
5116
|
structuredContent: {
|
|
@@ -5152,19 +5152,19 @@ function zd({
|
|
|
5152
5152
|
// completing it, so the completed-tasks endpoints never return it while the
|
|
5153
5153
|
// recurrence is active. Nothing in the response can show the gap, so say it
|
|
5154
5154
|
// on every result rather than only when the list is empty.
|
|
5155
|
-
notes: [
|
|
5155
|
+
notes: [qd(t, o, r)],
|
|
5156
5156
|
previewLines: it(e, Math.min(e.length, t.limit), i),
|
|
5157
5157
|
zeroReasonHints: l
|
|
5158
5158
|
});
|
|
5159
5159
|
}
|
|
5160
|
-
function
|
|
5160
|
+
function qd(e, t, o) {
|
|
5161
5161
|
const r = "Completions of recurring tasks that are still active are not in this list.";
|
|
5162
5162
|
if (e.getBy === "due")
|
|
5163
5163
|
return `${r} ${sn} with objectType "task" and eventType "completed" reports them, but only by completion time: it cannot match a due-date range.`;
|
|
5164
5164
|
const s = (c) => Qn({ date: c, timeZone: o, fallbackOffset: t }), a = s(e.since), i = s(ge(e.until, 1));
|
|
5165
5165
|
return `${r} To include them, call ${sn} with objectType "task", eventType "completed", dateFrom "${a}" and dateTo "${i}".`;
|
|
5166
5166
|
}
|
|
5167
|
-
const { ADD_FOLDERS:
|
|
5167
|
+
const { ADD_FOLDERS: Gd, FIND_PROJECTS: Yd, LIST_WORKSPACES: Vd } = b, Jd = {
|
|
5168
5168
|
workspace: n.string().trim().min(1).optional().describe(
|
|
5169
5169
|
`The workspace to list folders for, by name or ID (see ${Vd}). Omit to list the folders of every workspace.`
|
|
5170
5170
|
)
|
|
@@ -5206,7 +5206,7 @@ function el(e) {
|
|
|
5206
5206
|
`),
|
|
5207
5207
|
zeroReasonHints: [
|
|
5208
5208
|
"No folders in this workspace",
|
|
5209
|
-
`Use ${
|
|
5209
|
+
`Use ${Gd} to create one`
|
|
5210
5210
|
]
|
|
5211
5211
|
})
|
|
5212
5212
|
).join(`
|
|
@@ -5289,7 +5289,7 @@ const { FIND_PROJECTS: Dr, ADD_TASKS: xr, UPDATE_TASKS: Or } = b, sl = {
|
|
|
5289
5289
|
"Search for a user by name or email (partial and case insensitive match). If omitted, all users are returned."
|
|
5290
5290
|
)
|
|
5291
5291
|
}, al = {
|
|
5292
|
-
collaborators: n.array(
|
|
5292
|
+
collaborators: n.array(hi).describe("The found users."),
|
|
5293
5293
|
projectInfo: n.object({
|
|
5294
5294
|
id: n.string().describe("The project ID."),
|
|
5295
5295
|
name: n.string().describe("The project name."),
|
|
@@ -5331,7 +5331,7 @@ const { FIND_PROJECTS: Dr, ADD_TASKS: xr, UPDATE_TASKS: Or } = b, sl = {
|
|
|
5331
5331
|
}
|
|
5332
5332
|
};
|
|
5333
5333
|
} catch (u) {
|
|
5334
|
-
throw u instanceof
|
|
5334
|
+
throw u instanceof me ? u : new Error(
|
|
5335
5335
|
`Failed to access project "${o}": ${u instanceof Error ? u.message : "Unknown error"}`
|
|
5336
5336
|
);
|
|
5337
5337
|
}
|
|
@@ -5445,8 +5445,8 @@ function Pr({
|
|
|
5445
5445
|
o && c.push(`matching "${o}"`), c.push(`in ${s}`);
|
|
5446
5446
|
let d = [];
|
|
5447
5447
|
e.length > 0 && (d = e.slice(0, 10).map((p) => {
|
|
5448
|
-
const f = En(p.name) || "Unknown Name",
|
|
5449
|
-
return `• ${f} (${
|
|
5448
|
+
const f = En(p.name) || "Unknown Name", m = p.email || "No email";
|
|
5449
|
+
return `• ${f} (${m}) - ID: ${p.id}`;
|
|
5450
5450
|
}), e.length > 10 && d.push(`... and ${e.length - 10} more`));
|
|
5451
5451
|
const u = [];
|
|
5452
5452
|
e.length === 0 && o && (u.push(`No users match "${o}"`), u.push("Try a broader search term or check spelling"), r > 0 && u.push(`${r} users available without filter`));
|
|
@@ -5485,7 +5485,7 @@ const { ADD_PROJECTS: an, FIND_FOLDERS: Ur, PROJECT_MANAGEMENT: Rr } = b, ll = {
|
|
|
5485
5485
|
name: n.string(),
|
|
5486
5486
|
workspaceId: n.string(),
|
|
5487
5487
|
url: n.string()
|
|
5488
|
-
}),
|
|
5488
|
+
}), ml = {
|
|
5489
5489
|
projects: n.array(ve).describe("The found projects."),
|
|
5490
5490
|
nextCursor: n.string().optional(),
|
|
5491
5491
|
totalCount: n.number().describe("The total number of projects in this page."),
|
|
@@ -5493,11 +5493,11 @@ const { ADD_PROJECTS: an, FIND_FOLDERS: Ur, PROJECT_MANAGEMENT: Rr } = b, ll = {
|
|
|
5493
5493
|
appliedFilters: n.record(n.string(), n.unknown()),
|
|
5494
5494
|
unjoinedProjects: n.array(pl).optional().describe("Up to limit. With includeUnjoined, or when a search matched no joined project."),
|
|
5495
5495
|
unjoinedHasMore: n.boolean().optional().describe("More matched than limit; narrow with searchText.")
|
|
5496
|
-
},
|
|
5496
|
+
}, hl = {
|
|
5497
5497
|
name: b.FIND_PROJECTS,
|
|
5498
5498
|
description: "List or search by name the projects the user has joined. By default only active projects are returned; use archivedStatus ('archived' or 'all') to include archived projects. When searching, when archivedStatus is 'all', or when listing archived projects in a folder, all matching projects are returned (pagination is ignored). Otherwise projects are returned with pagination. Workspace projects the user hasn't joined are left out unless includeUnjoined is set, or a search matches no joined project.",
|
|
5499
5499
|
parameters: ul,
|
|
5500
|
-
outputSchema:
|
|
5500
|
+
outputSchema: ml,
|
|
5501
5501
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
5502
5502
|
async execute(e, t) {
|
|
5503
5503
|
const { searchText: o } = e, r = e.archivedStatus ?? "active";
|
|
@@ -5506,10 +5506,10 @@ const { ADD_PROJECTS: an, FIND_FOLDERS: Ur, PROJECT_MANAGEMENT: Rr } = b, ll = {
|
|
|
5506
5506
|
const d = Promise.resolve([]), [u, l] = await Promise.all([
|
|
5507
5507
|
r === "archived" ? d : o ? dr(t, o) : lr(t, e.folderId),
|
|
5508
5508
|
r === "active" ? d : ti(t)
|
|
5509
|
-
]), p = o ? ur(o) : null, f = p ? l.filter((g) => p.test(g.name)) : l, { folderId:
|
|
5510
|
-
s =
|
|
5511
|
-
(g) => H(g) && g.folderId ===
|
|
5512
|
-
) :
|
|
5509
|
+
]), p = o ? ur(o) : null, f = p ? l.filter((g) => p.test(g.name)) : l, { folderId: m } = e, h = [...u, ...f];
|
|
5510
|
+
s = m ? h.filter(
|
|
5511
|
+
(g) => H(g) && g.folderId === m
|
|
5512
|
+
) : h;
|
|
5513
5513
|
} else {
|
|
5514
5514
|
const d = r === "archived" ? await t.getArchivedProjects({
|
|
5515
5515
|
limit: e.limit,
|
|
@@ -5571,13 +5571,13 @@ function bl({
|
|
|
5571
5571
|
t.searchText && i.push(`searchText: "${t.searchText}"`), t.archivedStatus && t.archivedStatus !== "active" && i.push(`archivedStatus: "${t.archivedStatus}"`), t.folderId && i.push(`folderId: "${t.folderId}"`);
|
|
5572
5572
|
const c = 10, u = e.slice(0, c).map(yi).join(`
|
|
5573
5573
|
`), l = e.length - c, p = l > 0 ? `${u}
|
|
5574
|
-
…and ${l} more` : u, f = [],
|
|
5574
|
+
…and ${l} more` : u, f = [], m = t.folderId ? " in this folder" : "";
|
|
5575
5575
|
e.length === 0 && (t.searchText && r?.total ? f.push("None of the projects the user has joined match") : t.searchText ? (r ? f.push("No workspace project the user hasn't joined matches either") : Nr(t) && f.push(
|
|
5576
5576
|
"Set includeUnjoined to also search workspace projects the user hasn't joined"
|
|
5577
|
-
), f.push("Try broader search terms"), f.push("Check spelling"), f.push("Remove searchText to see all projects")) : t.folderId && r?.total ? f.push("None of the projects the user has joined are in this folder") : t.archivedStatus === "archived" ? (f.push(`No archived projects${
|
|
5577
|
+
), f.push("Try broader search terms"), f.push("Check spelling"), f.push("Remove searchText to see all projects")) : t.folderId && r?.total ? f.push("None of the projects the user has joined are in this folder") : t.archivedStatus === "archived" ? (f.push(`No archived projects${m}`), f.push("Use archivedStatus: 'all' to also see active projects")) : t.archivedStatus === "all" ? (f.push(
|
|
5578
5578
|
t.folderId ? "No projects in this folder" : "No projects created yet"
|
|
5579
|
-
), t.folderId || f.push(`Use ${an} to create a project`)) : (f.push(`No active projects${
|
|
5580
|
-
const
|
|
5579
|
+
), t.folderId || f.push(`Use ${an} to create a project`)) : (f.push(`No active projects${m}`), f.push("Use archivedStatus: 'all' to include archived projects"), t.folderId || f.push(`Use ${an} to create a project`)), t.folderId && !r?.total && f.push(`Use ${Ur} to check the folder ID`));
|
|
5580
|
+
const h = ie({
|
|
5581
5581
|
subject: a,
|
|
5582
5582
|
count: e.length,
|
|
5583
5583
|
limit: So(t) ? void 0 : t.limit,
|
|
@@ -5587,12 +5587,12 @@ function bl({
|
|
|
5587
5587
|
zeroReasonHints: f
|
|
5588
5588
|
});
|
|
5589
5589
|
if (!r?.total)
|
|
5590
|
-
return
|
|
5590
|
+
return h;
|
|
5591
5591
|
const g = r.listed.slice(0, c).map(
|
|
5592
|
-
(
|
|
5592
|
+
(I) => ` ${I.name} • id=${I.id} • workspaceId=${I.workspaceId}`
|
|
5593
5593
|
), y = r.total - g.length;
|
|
5594
5594
|
return y > 0 && g.push(` …and ${y} more; narrow with searchText`), [
|
|
5595
|
-
|
|
5595
|
+
h,
|
|
5596
5596
|
`Workspace projects the user hasn't joined (${r.total}):`,
|
|
5597
5597
|
...g,
|
|
5598
5598
|
`Their tasks, comments and activity can't be read until the user joins. Ask the user before joining one with ${Rr} (action: "join").`
|
|
@@ -5675,7 +5675,7 @@ const yl = {
|
|
|
5675
5675
|
function vl(e, t) {
|
|
5676
5676
|
if (e.length === 0)
|
|
5677
5677
|
return `No reminders found for task ${t}`;
|
|
5678
|
-
const { timeBasedCount: o, locationCount: r } =
|
|
5678
|
+
const { timeBasedCount: o, locationCount: r } = mr(e), s = [];
|
|
5679
5679
|
if (o > 0) {
|
|
5680
5680
|
const a = o > 1 ? "time-based reminders" : "time-based reminder";
|
|
5681
5681
|
s.push(`${o} ${a}`);
|
|
@@ -5686,7 +5686,7 @@ function vl(e, t) {
|
|
|
5686
5686
|
}
|
|
5687
5687
|
return `Found ${s.join(" and ")} for task ${t}`;
|
|
5688
5688
|
}
|
|
5689
|
-
const { ADD_SECTIONS:
|
|
5689
|
+
const { ADD_SECTIONS: Il } = b, kl = {
|
|
5690
5690
|
projectId: n.string().min(1).describe(
|
|
5691
5691
|
'The ID of the project to search sections in. Project ID should be an ID string, or the text "inbox", for inbox tasks.'
|
|
5692
5692
|
),
|
|
@@ -5700,7 +5700,7 @@ const { ADD_SECTIONS: kl } = b, Il = {
|
|
|
5700
5700
|
}, Cl = {
|
|
5701
5701
|
name: b.FIND_SECTIONS,
|
|
5702
5702
|
description: "Search for sections by name or other criteria in a project. When searching, uses server-side search to avoid fetching all sections.",
|
|
5703
|
-
parameters:
|
|
5703
|
+
parameters: kl,
|
|
5704
5704
|
outputSchema: Sl,
|
|
5705
5705
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
5706
5706
|
async execute(e, t) {
|
|
@@ -5733,7 +5733,7 @@ function jl({
|
|
|
5733
5733
|
searchText: o
|
|
5734
5734
|
}) {
|
|
5735
5735
|
const r = [];
|
|
5736
|
-
o ? (r.push("Try broader search terms"), r.push("Check spelling"), r.push("Remove searchText to see all sections")) : (r.push("Project has no sections yet"), r.push(`Use ${
|
|
5736
|
+
o ? (r.push("Try broader search terms"), r.push("Check spelling"), r.push("Remove searchText to see all sections")) : (r.push("Project has no sections yet"), r.push(`Use ${Il} to create sections`));
|
|
5737
5737
|
const s = o ? `Sections in project ${t} matching "${o}"` : `Sections in project ${t}`, a = e.length > 0 ? e.map((i) => ` ${i.name} • id=${i.id}`).join(`
|
|
5738
5738
|
`) : void 0;
|
|
5739
5739
|
return ie({
|
|
@@ -5779,7 +5779,7 @@ const Al = {
|
|
|
5779
5779
|
responsibleUserFiltering: n.enum(cr).optional().describe(
|
|
5780
5780
|
"Filter when responsibleUser is omitted. 'assigned'=assigned to others; 'unassignedOrMe'=unassigned+mine; 'all'=everyone. Default: 'unassignedOrMe'."
|
|
5781
5781
|
),
|
|
5782
|
-
...
|
|
5782
|
+
...Io
|
|
5783
5783
|
}, Dl = {
|
|
5784
5784
|
tasks: n.array(ae).describe("The found tasks."),
|
|
5785
5785
|
nextCursor: n.string().optional(),
|
|
@@ -5799,15 +5799,15 @@ const Al = {
|
|
|
5799
5799
|
l = "overdue";
|
|
5800
5800
|
else if (o.startDate === "today")
|
|
5801
5801
|
if (o.daysCount > 1) {
|
|
5802
|
-
const y = await El(t, d),
|
|
5802
|
+
const y = await El(t, d), I = eo(/* @__PURE__ */ new Date(), _e(y)), w = ge(I, o.daysCount), v = `(due after: ${I} | due: ${I}) & due before: ${w}`;
|
|
5803
5803
|
l = o.overdueOption === "exclude-overdue" ? v : `(${v} | overdue)`;
|
|
5804
5804
|
} else
|
|
5805
5805
|
l = o.overdueOption === "exclude-overdue" ? "today" : "(today | overdue)";
|
|
5806
5806
|
else if (o.startDate) {
|
|
5807
|
-
const y = o.startDate,
|
|
5807
|
+
const y = o.startDate, I = bs($l(y), o.daysCount), w = ys(I, { representation: "date" });
|
|
5808
5808
|
l = `(due after: ${y} | due: ${y}) & due before: ${w}`;
|
|
5809
5809
|
}
|
|
5810
|
-
const p =
|
|
5810
|
+
const p = ko(o.labels, o.labelsOperator);
|
|
5811
5811
|
p.length > 0 && (l = xe(l, `(${p})`));
|
|
5812
5812
|
const f = Ut({
|
|
5813
5813
|
resolvedAssigneeId: a,
|
|
@@ -5816,7 +5816,7 @@ const Al = {
|
|
|
5816
5816
|
responsibleUserFiltering: o.responsibleUserFiltering
|
|
5817
5817
|
});
|
|
5818
5818
|
l = xe(l, f);
|
|
5819
|
-
const { tasks:
|
|
5819
|
+
const { tasks: m, nextCursor: h } = await io({
|
|
5820
5820
|
client: t,
|
|
5821
5821
|
query: l,
|
|
5822
5822
|
cursor: r,
|
|
@@ -5824,17 +5824,17 @@ const Al = {
|
|
|
5824
5824
|
});
|
|
5825
5825
|
return {
|
|
5826
5826
|
textContent: Ol({
|
|
5827
|
-
tasks:
|
|
5827
|
+
tasks: m,
|
|
5828
5828
|
args: o,
|
|
5829
|
-
nextCursor:
|
|
5829
|
+
nextCursor: h,
|
|
5830
5830
|
assigneeEmail: i,
|
|
5831
|
-
assigneeNames: await De(t,
|
|
5831
|
+
assigneeNames: await De(t, m, u)
|
|
5832
5832
|
}),
|
|
5833
5833
|
structuredContent: {
|
|
5834
|
-
tasks:
|
|
5835
|
-
nextCursor:
|
|
5836
|
-
totalCount:
|
|
5837
|
-
hasMore: !!
|
|
5834
|
+
tasks: m,
|
|
5835
|
+
nextCursor: h ?? void 0,
|
|
5836
|
+
totalCount: m.length,
|
|
5837
|
+
hasMore: !!h,
|
|
5838
5838
|
appliedFilters: o
|
|
5839
5839
|
}
|
|
5840
5840
|
};
|
|
@@ -6039,7 +6039,7 @@ const { FIND_COMPLETED_TASKS: dn, ADD_TASKS: ln } = b, Fl = {
|
|
|
6039
6039
|
filterIdOrName: n.string().optional().describe(
|
|
6040
6040
|
"The ID or name of a saved Todoist filter. The filter's query will be fetched and used to find tasks. Cannot be used with the `filter` parameter, projectId, sectionId, or parentId."
|
|
6041
6041
|
),
|
|
6042
|
-
...
|
|
6042
|
+
...Io
|
|
6043
6043
|
}, Hl = {
|
|
6044
6044
|
tasks: n.array(ae).describe("The found tasks."),
|
|
6045
6045
|
nextCursor: n.string().optional(),
|
|
@@ -6065,75 +6065,75 @@ const { FIND_COMPLETED_TASKS: dn, ADD_TASKS: ln } = b, Fl = {
|
|
|
6065
6065
|
labels: l,
|
|
6066
6066
|
labelsOperator: p,
|
|
6067
6067
|
filter: f,
|
|
6068
|
-
filterIdOrName:
|
|
6069
|
-
} = e,
|
|
6070
|
-
if (f &&
|
|
6068
|
+
filterIdOrName: m
|
|
6069
|
+
} = e, h = st(u);
|
|
6070
|
+
if (f && m)
|
|
6071
6071
|
throw new Error(
|
|
6072
6072
|
"The `filter` and `filterIdOrName` parameters cannot be used together. Provide only one."
|
|
6073
6073
|
);
|
|
6074
6074
|
const g = !!(r || s || a);
|
|
6075
|
-
if ((f ||
|
|
6075
|
+
if ((f || m) && g)
|
|
6076
6076
|
throw new Error(
|
|
6077
6077
|
'The `filter`/`filterIdOrName` parameter cannot be combined with projectId, sectionId, or parentId. Use filter syntax instead (e.g. "##ProjectName").'
|
|
6078
6078
|
);
|
|
6079
|
-
const y = g ? Ml(
|
|
6080
|
-
let
|
|
6081
|
-
|
|
6079
|
+
const y = g ? Ml(h) : void 0, I = g ? y ? Promise.resolve(Kl(y.state)) : zl(t, l, p) : Promise.resolve(void 0), w = await t.getUser(), v = l && l.length > 0;
|
|
6080
|
+
let k = f;
|
|
6081
|
+
m && (k = (await Ul.resolveFilter(t, m)).filterQuery);
|
|
6082
6082
|
const $ = await ro(t, i), U = $?.userId, T = $?.email;
|
|
6083
6083
|
if (g) {
|
|
6084
|
-
const
|
|
6085
|
-
r && (
|
|
6086
|
-
const
|
|
6087
|
-
|
|
6088
|
-
const ue = o?.toLowerCase(), { items: Z, nextCursor:
|
|
6089
|
-
fetchPage: async (
|
|
6084
|
+
const q = {};
|
|
6085
|
+
r && (q.projectId = await ye({ projectId: r, user: w })), s && (q.sectionId = s), a && (q.parentId = a);
|
|
6086
|
+
const Ie = await I;
|
|
6087
|
+
Ie && (q.label = Ie);
|
|
6088
|
+
const ue = o?.toLowerCase(), { items: Z, nextCursor: qe } = await Ll({
|
|
6089
|
+
fetchPage: async (ke) => {
|
|
6090
6090
|
const { results: Zr, nextCursor: Qr } = await t.getTasks({
|
|
6091
|
-
...
|
|
6092
|
-
...
|
|
6091
|
+
...q,
|
|
6092
|
+
...ke
|
|
6093
6093
|
});
|
|
6094
6094
|
return { results: Zr.map(z), nextCursor: Qr };
|
|
6095
6095
|
},
|
|
6096
|
-
matches: (
|
|
6097
|
-
tasks: [
|
|
6096
|
+
matches: (ke) => (!ue || ke.content.toLowerCase().includes(ue) || !!ke.description?.toLowerCase().includes(ue)) && Za({
|
|
6097
|
+
tasks: [ke],
|
|
6098
6098
|
resolvedAssigneeId: U,
|
|
6099
6099
|
currentUserId: w.id,
|
|
6100
6100
|
responsibleUserFiltering: c
|
|
6101
|
-
}).length === 1 && (!l?.length || Md(
|
|
6101
|
+
}).length === 1 && (!l?.length || Md(ke.labels, l, p)),
|
|
6102
6102
|
limit: d,
|
|
6103
6103
|
maxPageSize: E.TASKS_PAGE_MAX,
|
|
6104
6104
|
from: y,
|
|
6105
|
-
state:
|
|
6105
|
+
state: Ie ? { apiLabel: Ie } : void 0
|
|
6106
6106
|
});
|
|
6107
6107
|
return {
|
|
6108
6108
|
textContent: wt({
|
|
6109
6109
|
tasks: Z,
|
|
6110
6110
|
args: e,
|
|
6111
|
-
nextCursor:
|
|
6111
|
+
nextCursor: qe,
|
|
6112
6112
|
isContainerSearch: !0,
|
|
6113
6113
|
assigneeEmail: T,
|
|
6114
6114
|
assigneeNames: await De(t, Z, w.id)
|
|
6115
6115
|
}),
|
|
6116
6116
|
structuredContent: {
|
|
6117
6117
|
tasks: Z,
|
|
6118
|
-
nextCursor:
|
|
6118
|
+
nextCursor: qe ?? void 0,
|
|
6119
6119
|
totalCount: Z.length,
|
|
6120
|
-
hasMore: !!
|
|
6120
|
+
hasMore: !!qe,
|
|
6121
6121
|
appliedFilters: e
|
|
6122
6122
|
}
|
|
6123
6123
|
};
|
|
6124
6124
|
}
|
|
6125
|
-
if (U && !o && !v && !
|
|
6126
|
-
const
|
|
6125
|
+
if (U && !o && !v && !k) {
|
|
6126
|
+
const q = Ut({
|
|
6127
6127
|
resolvedAssigneeId: U,
|
|
6128
6128
|
assigneeEmail: T,
|
|
6129
6129
|
currentUserId: w.id,
|
|
6130
6130
|
responsibleUserFiltering: c
|
|
6131
|
-
}), { results:
|
|
6132
|
-
query:
|
|
6131
|
+
}), { results: Ie, nextCursor: ue } = await t.getTasksByFilter({
|
|
6132
|
+
query: q,
|
|
6133
6133
|
lang: "en",
|
|
6134
6134
|
limit: d,
|
|
6135
|
-
cursor:
|
|
6136
|
-
}), Z =
|
|
6135
|
+
cursor: h ?? null
|
|
6136
|
+
}), Z = Ie.map(z);
|
|
6137
6137
|
return {
|
|
6138
6138
|
textContent: wt({
|
|
6139
6139
|
tasks: Z,
|
|
@@ -6152,22 +6152,22 @@ const { FIND_COMPLETED_TASKS: dn, ADD_TASKS: ln } = b, Fl = {
|
|
|
6152
6152
|
}
|
|
6153
6153
|
};
|
|
6154
6154
|
}
|
|
6155
|
-
let S =
|
|
6155
|
+
let S = k ? `(${k})` : "";
|
|
6156
6156
|
o && (S = xe(S, `search: ${Kt(o)}`));
|
|
6157
|
-
const A =
|
|
6158
|
-
if (S = xe(S, A), !(
|
|
6159
|
-
const
|
|
6157
|
+
const A = ko(l, p);
|
|
6158
|
+
if (S = xe(S, A), !(m && !i && !c)) {
|
|
6159
|
+
const q = Ut({
|
|
6160
6160
|
resolvedAssigneeId: U,
|
|
6161
6161
|
assigneeEmail: T,
|
|
6162
6162
|
currentUserId: w.id,
|
|
6163
6163
|
responsibleUserFiltering: c
|
|
6164
6164
|
});
|
|
6165
|
-
S = xe(S,
|
|
6165
|
+
S = xe(S, q);
|
|
6166
6166
|
}
|
|
6167
6167
|
const { tasks: R, nextCursor: ze } = await io({
|
|
6168
6168
|
client: t,
|
|
6169
6169
|
query: S || "all",
|
|
6170
|
-
cursor:
|
|
6170
|
+
cursor: h,
|
|
6171
6171
|
limit: e.limit
|
|
6172
6172
|
});
|
|
6173
6173
|
return {
|
|
@@ -6215,7 +6215,7 @@ async function zl(e, t, o) {
|
|
|
6215
6215
|
return;
|
|
6216
6216
|
}
|
|
6217
6217
|
}
|
|
6218
|
-
function
|
|
6218
|
+
function ql(e) {
|
|
6219
6219
|
if (e.projectId) {
|
|
6220
6220
|
const t = [
|
|
6221
6221
|
e.searchText ? "No tasks in project match search" : "Project has no tasks yet"
|
|
@@ -6251,7 +6251,7 @@ function wt({
|
|
|
6251
6251
|
const u = Ae(t.labels, t.labelsOperator);
|
|
6252
6252
|
c.push(`labels: ${u}`);
|
|
6253
6253
|
}
|
|
6254
|
-
e.length === 0 && d.push(...
|
|
6254
|
+
e.length === 0 && d.push(...ql(t));
|
|
6255
6255
|
} else {
|
|
6256
6256
|
const u = s || t.responsibleUser, l = [];
|
|
6257
6257
|
if (t.filter && l.push(`filter: ${t.filter}`), t.searchText && l.push(`"${t.searchText}"`), t.responsibleUser && l.push(`assigned to ${u}`), t.labels && t.labels.length > 0) {
|
|
@@ -6280,9 +6280,9 @@ function wt({
|
|
|
6280
6280
|
zeroReasonHints: d
|
|
6281
6281
|
});
|
|
6282
6282
|
}
|
|
6283
|
-
const
|
|
6283
|
+
const Gl = ["all", "todoist", "user", "workspace"], Yl = {
|
|
6284
6284
|
query: n.string().trim().min(1).optional().describe('Words to search template names and descriptions for, e.g. "launch".'),
|
|
6285
|
-
source: n.enum(
|
|
6285
|
+
source: n.enum(Gl).optional().describe(
|
|
6286
6286
|
`todoist for the Todoist gallery, user for the user's personal templates, workspace for templates saved to their workspaces. Defaults to "all".`
|
|
6287
6287
|
),
|
|
6288
6288
|
locale: n.string().optional().describe('Language of gallery template content, e.g. "de". Defaults to "en".'),
|
|
@@ -6340,7 +6340,7 @@ function Xl({
|
|
|
6340
6340
|
const s = e.map(
|
|
6341
6341
|
(i) => `- ${i.name} (id=${i.id}, ${Zl(i)}): ${i.shortDescription}`
|
|
6342
6342
|
), a = o ? `
|
|
6343
|
-
${
|
|
6343
|
+
${ho([], o)}` : "";
|
|
6344
6344
|
return `Found ${e.length} template${e.length === 1 ? "" : "s"}${r}:
|
|
6345
6345
|
${s.join(`
|
|
6346
6346
|
`)}${a}`;
|
|
@@ -6536,30 +6536,30 @@ async function su(e) {
|
|
|
6536
6536
|
return { textContent: u, structuredContent: l };
|
|
6537
6537
|
}
|
|
6538
6538
|
async function au(e, t) {
|
|
6539
|
-
const o = re(e, t), r = (
|
|
6540
|
-
throw await o,
|
|
6539
|
+
const o = re(e, t), r = (m) => m.catch(async (h) => {
|
|
6540
|
+
throw await o, h;
|
|
6541
6541
|
}), [s, a, i] = await Promise.all([
|
|
6542
6542
|
o,
|
|
6543
6543
|
r(ru(e, t)),
|
|
6544
6544
|
r(nu(e, t))
|
|
6545
6545
|
]), c = await De(e, i), d = {};
|
|
6546
|
-
for (const
|
|
6547
|
-
d[
|
|
6546
|
+
for (const m of a)
|
|
6547
|
+
d[m.id] = [];
|
|
6548
6548
|
const u = [];
|
|
6549
|
-
for (const
|
|
6550
|
-
(
|
|
6549
|
+
for (const m of i)
|
|
6550
|
+
(m.sectionId ? d[m.sectionId] ?? u : u).push(m);
|
|
6551
6551
|
const l = [`# ${s.name}`];
|
|
6552
6552
|
if (u.length > 0) {
|
|
6553
6553
|
l.push("");
|
|
6554
|
-
const
|
|
6555
|
-
l.push(...Lt(
|
|
6554
|
+
const m = un(u);
|
|
6555
|
+
l.push(...Lt(m, c));
|
|
6556
6556
|
}
|
|
6557
|
-
for (const
|
|
6558
|
-
l.push(""), l.push(`## ${
|
|
6559
|
-
const
|
|
6560
|
-
if (!
|
|
6557
|
+
for (const m of a) {
|
|
6558
|
+
l.push(""), l.push(`## ${m.name}`);
|
|
6559
|
+
const h = d[m.id];
|
|
6560
|
+
if (!h?.length)
|
|
6561
6561
|
continue;
|
|
6562
|
-
const g = un(
|
|
6562
|
+
const g = un(h);
|
|
6563
6563
|
l.push(...Lt(g, c));
|
|
6564
6564
|
}
|
|
6565
6565
|
const p = l.join(`
|
|
@@ -6570,8 +6570,8 @@ async function au(e, t) {
|
|
|
6570
6570
|
name: s.name
|
|
6571
6571
|
},
|
|
6572
6572
|
sections: a.map(le),
|
|
6573
|
-
tasks: i.map((
|
|
6574
|
-
...
|
|
6573
|
+
tasks: i.map((m) => ({
|
|
6574
|
+
...m,
|
|
6575
6575
|
children: []
|
|
6576
6576
|
// Tasks already include hierarchical info via parentId
|
|
6577
6577
|
})),
|
|
@@ -6726,7 +6726,7 @@ const pu = {
|
|
|
6726
6726
|
projectId: n.string().min(1).describe("The ID of the project to get activity stats for."),
|
|
6727
6727
|
weeks: n.number().int().min(1).max(12).optional().describe("Number of weeks of activity data to retrieve (1-12, default 2)."),
|
|
6728
6728
|
includeWeeklyCounts: n.boolean().optional().describe("Include weekly rollup counts alongside daily counts.")
|
|
6729
|
-
},
|
|
6729
|
+
}, mu = {
|
|
6730
6730
|
projectId: n.string().describe("The project ID."),
|
|
6731
6731
|
dayItems: n.array(
|
|
6732
6732
|
n.object({
|
|
@@ -6742,7 +6742,7 @@ const pu = {
|
|
|
6742
6742
|
})
|
|
6743
6743
|
).optional().describe("Weekly completion rollups. Only included when includeWeeklyCounts is true.")
|
|
6744
6744
|
};
|
|
6745
|
-
function
|
|
6745
|
+
function hu(e, t) {
|
|
6746
6746
|
const o = [`# Activity Stats: Project ${e}`, ""];
|
|
6747
6747
|
if (t.dayItems.length > 0) {
|
|
6748
6748
|
o.push("## Daily Activity");
|
|
@@ -6762,7 +6762,7 @@ const fu = {
|
|
|
6762
6762
|
name: b.GET_PROJECT_ACTIVITY_STATS,
|
|
6763
6763
|
description: "Get daily and optional weekly task completion counts for a project over a configurable time window (1-12 weeks). Useful for identifying completion trends and patterns.",
|
|
6764
6764
|
parameters: pu,
|
|
6765
|
-
outputSchema:
|
|
6765
|
+
outputSchema: mu,
|
|
6766
6766
|
annotations: {
|
|
6767
6767
|
readOnlyHint: !0,
|
|
6768
6768
|
destructiveHint: !1,
|
|
@@ -6774,7 +6774,7 @@ const fu = {
|
|
|
6774
6774
|
includeWeeklyCounts: s
|
|
6775
6775
|
});
|
|
6776
6776
|
return {
|
|
6777
|
-
textContent:
|
|
6777
|
+
textContent: hu(o, a),
|
|
6778
6778
|
structuredContent: {
|
|
6779
6779
|
projectId: o,
|
|
6780
6780
|
dayItems: a.dayItems,
|
|
@@ -6865,7 +6865,7 @@ async function Wr(e) {
|
|
|
6865
6865
|
);
|
|
6866
6866
|
return vu(t);
|
|
6867
6867
|
}
|
|
6868
|
-
function
|
|
6868
|
+
function Iu(e) {
|
|
6869
6869
|
const t = e.activeUntil ? new Date(e.activeUntil).toISOString() : void 0;
|
|
6870
6870
|
return {
|
|
6871
6871
|
...e.message ? { message: e.message } : {},
|
|
@@ -6881,7 +6881,7 @@ function Ft(e, t) {
|
|
|
6881
6881
|
textContent: `${t}: none`,
|
|
6882
6882
|
structuredContent: { hasStatus: !1 }
|
|
6883
6883
|
};
|
|
6884
|
-
const o =
|
|
6884
|
+
const o = Iu(e), r = [`${t}: ${[o.emoji, o.message].filter(Boolean).join(" ")}`];
|
|
6885
6885
|
r.push(o.activeUntil ? `Until: ${o.activeUntil}` : "Until: no end");
|
|
6886
6886
|
const s = [
|
|
6887
6887
|
o.pauseNotifications ? "Comms notifications paused" : void 0,
|
|
@@ -6893,10 +6893,10 @@ function Ft(e, t) {
|
|
|
6893
6893
|
structuredContent: { hasStatus: !0, status: o }
|
|
6894
6894
|
};
|
|
6895
6895
|
}
|
|
6896
|
-
const
|
|
6896
|
+
const ku = {}, Su = {
|
|
6897
6897
|
name: b.GET_USER_STATUS,
|
|
6898
6898
|
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.",
|
|
6899
|
-
parameters:
|
|
6899
|
+
parameters: ku,
|
|
6900
6900
|
outputSchema: Hr,
|
|
6901
6901
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
6902
6902
|
async execute(e, t) {
|
|
@@ -6981,7 +6981,7 @@ const Iu = {}, Su = {
|
|
|
6981
6981
|
comments: n.array(Ke).describe("Comments created by the import."),
|
|
6982
6982
|
totalCount: n.number().describe("The total number of objects created by the import.")
|
|
6983
6983
|
};
|
|
6984
|
-
function
|
|
6984
|
+
function mn({
|
|
6985
6985
|
projectId: e,
|
|
6986
6986
|
source: t,
|
|
6987
6987
|
result: o
|
|
@@ -7036,7 +7036,7 @@ const Ou = {
|
|
|
7036
7036
|
}).catch((d) => {
|
|
7037
7037
|
throw a(d);
|
|
7038
7038
|
});
|
|
7039
|
-
return
|
|
7039
|
+
return mn({ projectId: e, source: "template", result: c });
|
|
7040
7040
|
}
|
|
7041
7041
|
const i = await s.importCsvIntoProject({
|
|
7042
7042
|
projectId: e,
|
|
@@ -7046,7 +7046,7 @@ const Ou = {
|
|
|
7046
7046
|
}).catch((c) => {
|
|
7047
7047
|
throw a(c);
|
|
7048
7048
|
});
|
|
7049
|
-
return
|
|
7049
|
+
return mn({ projectId: e, source: "CSV", result: i });
|
|
7050
7050
|
}
|
|
7051
7051
|
}, _u = {}, Pu = {
|
|
7052
7052
|
id: n.string().describe("The unique identifier for the workspace."),
|
|
@@ -7106,7 +7106,7 @@ const Nu = {
|
|
|
7106
7106
|
structuredContent: o.structuredContent
|
|
7107
7107
|
};
|
|
7108
7108
|
}
|
|
7109
|
-
}, { FIND_TASKS: Mu, FIND_PROJECT_COLLABORATORS:
|
|
7109
|
+
}, { FIND_TASKS: Mu, FIND_PROJECT_COLLABORATORS: hn, UPDATE_TASKS: Lu } = b, Br = x.BULK_ACTIONS_PER_OPERATION, Fu = {
|
|
7110
7110
|
operation: n.enum(["assign", "unassign", "reassign"]).describe("The assignment operation to perform."),
|
|
7111
7111
|
taskIds: n.array(n.string()).min(1).max(Br).describe("The IDs of the tasks to operate on (max 50)."),
|
|
7112
7112
|
responsibleUser: n.string().optional().describe(
|
|
@@ -7158,11 +7158,11 @@ const Nu = {
|
|
|
7158
7158
|
})
|
|
7159
7159
|
), d = [], u = [];
|
|
7160
7160
|
for (let v = 0; v < c.length; v++) {
|
|
7161
|
-
const
|
|
7162
|
-
|
|
7161
|
+
const k = c[v];
|
|
7162
|
+
k && k.status === "fulfilled" ? d.push(k.value) : k && k.status === "rejected" ? u.push({
|
|
7163
7163
|
taskId: r[v] || "invalid-task-id",
|
|
7164
7164
|
success: !1,
|
|
7165
|
-
error:
|
|
7165
|
+
error: k.reason?.message || "Task not accessible"
|
|
7166
7166
|
}) : u.push({
|
|
7167
7167
|
taskId: r[v] || "invalid-task-id",
|
|
7168
7168
|
success: !1,
|
|
@@ -7170,7 +7170,7 @@ const Nu = {
|
|
|
7170
7170
|
});
|
|
7171
7171
|
}
|
|
7172
7172
|
if (d.length === 0) {
|
|
7173
|
-
const v = u.map((
|
|
7173
|
+
const v = u.map((k) => `"${k.taskId}": ${k.error}`).join("; ");
|
|
7174
7174
|
throw new Error(`All ${u.length} task(s) failed: ${v}`);
|
|
7175
7175
|
}
|
|
7176
7176
|
let l;
|
|
@@ -7223,7 +7223,7 @@ const Nu = {
|
|
|
7223
7223
|
originalAssigneeId: T.responsibleUid ?? void 0
|
|
7224
7224
|
};
|
|
7225
7225
|
}
|
|
7226
|
-
}),
|
|
7226
|
+
}), k = await Promise.all(v), $ = [...k, ...u];
|
|
7227
7227
|
if ($.length > 0 && $.every((T) => !T.success)) {
|
|
7228
7228
|
const T = $.map((S) => `"${S.taskId}": ${S.error}`).join("; ");
|
|
7229
7229
|
throw new Error(`All ${$.length} unassign operation(s) failed: ${T}`);
|
|
@@ -7238,7 +7238,7 @@ const Nu = {
|
|
|
7238
7238
|
operation: o,
|
|
7239
7239
|
results: $,
|
|
7240
7240
|
totalRequested: r.length,
|
|
7241
|
-
successful:
|
|
7241
|
+
successful: k.filter((T) => T.success).length,
|
|
7242
7242
|
failed: $.filter((T) => !T.success).length,
|
|
7243
7243
|
dryRun: !1
|
|
7244
7244
|
}
|
|
@@ -7247,20 +7247,20 @@ const Nu = {
|
|
|
7247
7247
|
const f = await vo.validateBulkAssignment(
|
|
7248
7248
|
t,
|
|
7249
7249
|
p
|
|
7250
|
-
),
|
|
7250
|
+
), m = [], h = [];
|
|
7251
7251
|
for (let v = 0; v < p.length; v++) {
|
|
7252
|
-
const
|
|
7253
|
-
|
|
7254
|
-
taskId:
|
|
7252
|
+
const k = p[v], $ = f[v];
|
|
7253
|
+
k && $?.isValid ? m.push({ assignment: k, validation: $ }) : k?.taskId && h.push({
|
|
7254
|
+
taskId: k.taskId,
|
|
7255
7255
|
success: !1,
|
|
7256
7256
|
error: $?.error?.message || "Validation failed"
|
|
7257
7257
|
});
|
|
7258
7258
|
}
|
|
7259
|
-
async function g(v,
|
|
7259
|
+
async function g(v, k) {
|
|
7260
7260
|
const $ = v.filter(
|
|
7261
7261
|
(T) => T.assignment != null && T.validation != null
|
|
7262
7262
|
);
|
|
7263
|
-
if (!
|
|
7263
|
+
if (!k)
|
|
7264
7264
|
return $.map(({ assignment: T, validation: S }) => {
|
|
7265
7265
|
const A = d.find((D) => D.id === T.taskId);
|
|
7266
7266
|
if (!T.taskId || !S.resolvedUser?.userId)
|
|
@@ -7305,23 +7305,23 @@ const Nu = {
|
|
|
7305
7305
|
);
|
|
7306
7306
|
return Promise.all(U);
|
|
7307
7307
|
}
|
|
7308
|
-
const y = await g(
|
|
7309
|
-
if (
|
|
7310
|
-
const v =
|
|
7311
|
-
throw new Error(`All ${
|
|
7308
|
+
const y = await g(m, !i), I = [...y, ...h, ...u];
|
|
7309
|
+
if (I.length > 0 && I.every((v) => !v.success)) {
|
|
7310
|
+
const v = I.map((k) => `"${k.taskId}": ${k.error}`).join("; ");
|
|
7311
|
+
throw new Error(`All ${I.length} ${o} operation(s) failed: ${v}`);
|
|
7312
7312
|
}
|
|
7313
7313
|
return {
|
|
7314
7314
|
textContent: Tt({
|
|
7315
7315
|
operation: o,
|
|
7316
|
-
results:
|
|
7316
|
+
results: I,
|
|
7317
7317
|
dryRun: i
|
|
7318
7318
|
}),
|
|
7319
7319
|
structuredContent: {
|
|
7320
7320
|
operation: o,
|
|
7321
|
-
results:
|
|
7321
|
+
results: I,
|
|
7322
7322
|
totalRequested: r.length,
|
|
7323
7323
|
successful: y.filter((v) => v.success).length,
|
|
7324
|
-
failed:
|
|
7324
|
+
failed: I.filter((v) => !v.success).length,
|
|
7325
7325
|
dryRun: i
|
|
7326
7326
|
}
|
|
7327
7327
|
};
|
|
@@ -7367,13 +7367,13 @@ function Tt({
|
|
|
7367
7367
|
return !o && r.length > 0 ? (c += `**Next steps:**
|
|
7368
7368
|
`, c += `• Use ${Mu} with responsibleUser to see ${e === "unassign" ? "unassigned" : "newly assigned"} tasks
|
|
7369
7369
|
`, c += `• Use ${Lu} for individual assignment changes
|
|
7370
|
-
`, s.length > 0 && (c += `• Check failed tasks and use ${
|
|
7370
|
+
`, s.length > 0 && (c += `• Check failed tasks and use ${hn} to verify collaborator access
|
|
7371
7371
|
`)) : o ? (c += `**To execute:**
|
|
7372
7372
|
`, c += `• Remove dryRun parameter and run again to execute changes
|
|
7373
7373
|
`, r.length > 0 && (c += `• ${r.length} task${r.length === 1 ? "" : "s"} ready for ${e} operation
|
|
7374
7374
|
`), s.length > 0 && (c += `• Fix ${s.length} validation error${s.length === 1 ? "" : "s"} before executing
|
|
7375
7375
|
`)) : r.length === 0 && (c += `**Suggestions:**
|
|
7376
|
-
`, c += `• Use ${
|
|
7376
|
+
`, c += `• Use ${hn} to find valid assignees
|
|
7377
7377
|
`, c += `• Check task IDs and assignee permissions
|
|
7378
7378
|
`, c += `• Use dryRun=true to validate before executing
|
|
7379
7379
|
`), c;
|
|
@@ -7384,11 +7384,11 @@ const { FIND_PROJECTS: Bu } = b, Ku = {
|
|
|
7384
7384
|
}, zu = {
|
|
7385
7385
|
project: ve.describe("The updated project."),
|
|
7386
7386
|
success: n.boolean().describe("Whether the action was successful.")
|
|
7387
|
-
},
|
|
7387
|
+
}, qu = {
|
|
7388
7388
|
archive: "Archived",
|
|
7389
7389
|
unarchive: "Unarchived",
|
|
7390
7390
|
join: "Joined"
|
|
7391
|
-
},
|
|
7391
|
+
}, Gu = {
|
|
7392
7392
|
name: b.PROJECT_MANAGEMENT,
|
|
7393
7393
|
description: `Archive or unarchive a project by its ID, or join a workspace project the user hasn't joined (see ${Bu} includeUnjoined) when they ask to.`,
|
|
7394
7394
|
parameters: Ku,
|
|
@@ -7397,7 +7397,7 @@ const { FIND_PROJECTS: Bu } = b, Ku = {
|
|
|
7397
7397
|
async execute(e, t) {
|
|
7398
7398
|
const o = await Yu(e, t), r = we(o);
|
|
7399
7399
|
return {
|
|
7400
|
-
textContent: `${
|
|
7400
|
+
textContent: `${qu[e.action]} project: ${r.name} (id=${r.id})`,
|
|
7401
7401
|
structuredContent: {
|
|
7402
7402
|
project: r,
|
|
7403
7403
|
success: !0
|
|
@@ -7472,13 +7472,13 @@ function Kr(e, t) {
|
|
|
7472
7472
|
for (const f of r)
|
|
7473
7473
|
if (!o.has(f))
|
|
7474
7474
|
throw new Error(`Sibling id=${f} is not in the list being reordered`);
|
|
7475
|
-
const s = e.every((f) => f.key !== null), i = [...e].sort(s ? tp : op).filter((f) => !r.has(f.id)), c = [...t].sort((f,
|
|
7475
|
+
const s = e.every((f) => f.key !== null), i = [...e].sort(s ? tp : op).filter((f) => !r.has(f.id)), c = [...t].sort((f, m) => f.position - m.position);
|
|
7476
7476
|
let d;
|
|
7477
|
-
for (const { id: f, position:
|
|
7478
|
-
const
|
|
7479
|
-
if (!
|
|
7480
|
-
const g = d?.position ===
|
|
7481
|
-
i.splice(y, 0,
|
|
7477
|
+
for (const { id: f, position: m } of c) {
|
|
7478
|
+
const h = o.get(f);
|
|
7479
|
+
if (!h) continue;
|
|
7480
|
+
const g = d?.position === m ? d.index + 1 : m, y = Math.min(g, i.length);
|
|
7481
|
+
i.splice(y, 0, h), d = { position: m, index: y };
|
|
7482
7482
|
}
|
|
7483
7483
|
if (!s || !Qu(i, r))
|
|
7484
7484
|
return ep(i);
|
|
@@ -7599,13 +7599,13 @@ async function ip(e, t) {
|
|
|
7599
7599
|
const o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), s = [];
|
|
7600
7600
|
let a = await bn(e);
|
|
7601
7601
|
const i = [];
|
|
7602
|
-
for (const
|
|
7603
|
-
const g = a.get(
|
|
7604
|
-
y ? s.push({ item:
|
|
7602
|
+
for (const h of t) {
|
|
7603
|
+
const g = a.get(h.id), y = g ? dp(g, h) : "Project not found, or you do not have access to it.";
|
|
7604
|
+
y ? s.push({ item: h.id, error: y }) : i.push(h);
|
|
7605
7605
|
}
|
|
7606
|
-
const c = i.filter((
|
|
7606
|
+
const c = i.filter((h) => h.parentId !== void 0), d = /* @__PURE__ */ new Set();
|
|
7607
7607
|
if (c.length > 0) {
|
|
7608
|
-
const { outcomes:
|
|
7608
|
+
const { outcomes: h } = await X(
|
|
7609
7609
|
e,
|
|
7610
7610
|
c.map(
|
|
7611
7611
|
(g) => V("project_move", {
|
|
@@ -7614,62 +7614,62 @@ async function ip(e, t) {
|
|
|
7614
7614
|
})
|
|
7615
7615
|
)
|
|
7616
7616
|
);
|
|
7617
|
-
|
|
7618
|
-
const
|
|
7619
|
-
|
|
7620
|
-
item:
|
|
7617
|
+
h.forEach((g, y) => {
|
|
7618
|
+
const I = c[y]?.id;
|
|
7619
|
+
I !== void 0 && (g.status === "fulfilled" ? o.add(I) : (d.add(I), s.push({
|
|
7620
|
+
item: I,
|
|
7621
7621
|
error: L(g.reason),
|
|
7622
7622
|
...J(g.reason)
|
|
7623
7623
|
})));
|
|
7624
7624
|
});
|
|
7625
7625
|
}
|
|
7626
7626
|
const u = i.filter(
|
|
7627
|
-
(
|
|
7627
|
+
(h) => h.order !== void 0 && !d.has(h.id)
|
|
7628
7628
|
);
|
|
7629
7629
|
if (u.length === 0)
|
|
7630
7630
|
return { movedIds: o, reorderedIds: r, failures: s };
|
|
7631
7631
|
if (o.size > 0)
|
|
7632
7632
|
try {
|
|
7633
7633
|
a = await bn(e);
|
|
7634
|
-
} catch (
|
|
7635
|
-
const g = L(
|
|
7634
|
+
} catch (h) {
|
|
7635
|
+
const g = L(h);
|
|
7636
7636
|
for (const y of u)
|
|
7637
7637
|
s.push({
|
|
7638
7638
|
item: y.id,
|
|
7639
|
-
...J(
|
|
7639
|
+
...J(h),
|
|
7640
7640
|
error: o.has(y.id) ? `Moved, but its new siblings could not be read to reorder it: ${g}` : `Its siblings could not be read to reorder it: ${g}`
|
|
7641
7641
|
});
|
|
7642
7642
|
return { movedIds: o, reorderedIds: r, failures: s };
|
|
7643
7643
|
}
|
|
7644
|
-
const l =
|
|
7645
|
-
for (const
|
|
7646
|
-
const g = a.get(
|
|
7644
|
+
const l = qr([...a.values()].filter(lp), gn), p = /* @__PURE__ */ new Map(), f = [];
|
|
7645
|
+
for (const h of u) {
|
|
7646
|
+
const g = a.get(h.id);
|
|
7647
7647
|
if (!g) {
|
|
7648
|
-
s.push({ item:
|
|
7648
|
+
s.push({ item: h.id, error: "Project not found after moving it." });
|
|
7649
7649
|
continue;
|
|
7650
7650
|
}
|
|
7651
|
-
f.push(
|
|
7652
|
-
const y = gn(g),
|
|
7653
|
-
|
|
7654
|
-
}
|
|
7655
|
-
const
|
|
7656
|
-
for (const [
|
|
7657
|
-
const y = l.get(
|
|
7658
|
-
for (const [w, v] of
|
|
7659
|
-
const
|
|
7660
|
-
|
|
7651
|
+
f.push(h);
|
|
7652
|
+
const y = gn(g), I = p.get(y) ?? [];
|
|
7653
|
+
I.push({ id: h.id, position: h.order }), p.set(y, I);
|
|
7654
|
+
}
|
|
7655
|
+
const m = [];
|
|
7656
|
+
for (const [h, g] of p) {
|
|
7657
|
+
const y = l.get(h) ?? [], I = Kr(y.map(up), g);
|
|
7658
|
+
for (const [w, v] of I) {
|
|
7659
|
+
const k = a.get(w);
|
|
7660
|
+
m.push({
|
|
7661
7661
|
id: w,
|
|
7662
7662
|
command: V(
|
|
7663
7663
|
"project_update",
|
|
7664
|
-
|
|
7664
|
+
k && H(k) ? { id: w, defaultOrderKey: v } : { id: w, orderKey: v }
|
|
7665
7665
|
)
|
|
7666
7666
|
});
|
|
7667
7667
|
}
|
|
7668
7668
|
}
|
|
7669
|
-
return await
|
|
7669
|
+
return await Gr(e, m, f, r, s), { movedIds: o, reorderedIds: r, failures: s };
|
|
7670
7670
|
}
|
|
7671
7671
|
async function cp(e, t) {
|
|
7672
|
-
const o = /* @__PURE__ */ new Set(), r = [], s = await pp(e), a =
|
|
7672
|
+
const o = /* @__PURE__ */ new Set(), r = [], s = await pp(e), a = qr(
|
|
7673
7673
|
[...s.values()].filter((l) => !l.isDeleted && !l.isArchived),
|
|
7674
7674
|
(l) => l.projectId
|
|
7675
7675
|
), i = t.filter((l) => l.order !== void 0), c = /* @__PURE__ */ new Map(), d = [];
|
|
@@ -7692,20 +7692,20 @@ async function cp(e, t) {
|
|
|
7692
7692
|
}
|
|
7693
7693
|
const u = [];
|
|
7694
7694
|
for (const [l, p] of c) {
|
|
7695
|
-
const f = a.get(l) ?? [],
|
|
7696
|
-
f.map((
|
|
7697
|
-
id:
|
|
7698
|
-
key:
|
|
7699
|
-
legacyOrder:
|
|
7695
|
+
const f = a.get(l) ?? [], m = Kr(
|
|
7696
|
+
f.map((h) => ({
|
|
7697
|
+
id: h.id,
|
|
7698
|
+
key: h.orderKey ?? null,
|
|
7699
|
+
legacyOrder: h.sectionOrder
|
|
7700
7700
|
})),
|
|
7701
7701
|
p
|
|
7702
7702
|
);
|
|
7703
|
-
for (const [
|
|
7704
|
-
u.push({ id:
|
|
7703
|
+
for (const [h, g] of m)
|
|
7704
|
+
u.push({ id: h, command: V("section_update", { id: h, orderKey: g }) });
|
|
7705
7705
|
}
|
|
7706
|
-
return await
|
|
7706
|
+
return await Gr(e, u, d, o, r), { movedIds: /* @__PURE__ */ new Set(), reorderedIds: o, failures: r };
|
|
7707
7707
|
}
|
|
7708
|
-
function
|
|
7708
|
+
function qr(e, t) {
|
|
7709
7709
|
const o = /* @__PURE__ */ new Map();
|
|
7710
7710
|
for (const r of e) {
|
|
7711
7711
|
const s = t(r), a = o.get(s) ?? [];
|
|
@@ -7713,7 +7713,7 @@ function Gr(e, t) {
|
|
|
7713
7713
|
}
|
|
7714
7714
|
return o;
|
|
7715
7715
|
}
|
|
7716
|
-
async function
|
|
7716
|
+
async function Gr(e, t, o, r, s) {
|
|
7717
7717
|
const a = /* @__PURE__ */ new Set();
|
|
7718
7718
|
if (t.length > 0) {
|
|
7719
7719
|
const { outcomes: i } = await X(
|
|
@@ -7767,14 +7767,14 @@ async function pp(e) {
|
|
|
7767
7767
|
);
|
|
7768
7768
|
return new Map((t.sections ?? []).map((o) => [o.id, o]));
|
|
7769
7769
|
}
|
|
7770
|
-
const
|
|
7770
|
+
const mp = n.object({
|
|
7771
7771
|
id: n.string().min(1).describe("The ID of the task to reschedule."),
|
|
7772
7772
|
date: n.string().min(1).describe(
|
|
7773
7773
|
"The new date for the task. Use YYYY-MM-DD for date-only, or YYYY-MM-DDTHH:MM:SS for datetime. If date-only is provided and the task already has a specific time, the existing time is preserved."
|
|
7774
7774
|
),
|
|
7775
7775
|
duration: n.string().optional().describe('Optional new duration, e.g. for time-blocking: "15m", "1h", "2h30m".')
|
|
7776
|
-
}),
|
|
7777
|
-
tasks: n.array(
|
|
7776
|
+
}), hp = {
|
|
7777
|
+
tasks: n.array(mp).min(1).max(x.BULK_ACTIONS_PER_OPERATION).describe("The tasks to reschedule with their new dates.")
|
|
7778
7778
|
}, fp = {
|
|
7779
7779
|
tasks: n.array(ae).describe("The rescheduled tasks."),
|
|
7780
7780
|
totalCount: n.number().describe("The total number of tasks rescheduled."),
|
|
@@ -7783,49 +7783,49 @@ const hp = n.object({
|
|
|
7783
7783
|
}, gp = {
|
|
7784
7784
|
name: b.RESCHEDULE_TASKS,
|
|
7785
7785
|
description: "Reschedule tasks to new dates while preserving recurring schedules. Unlike update-tasks (which replaces the entire due string and can wipe recurrence), this tool changes only the date (and duration, if given), keeping recurrence patterns intact. Use this when moving recurring tasks to a different date or time without altering their repeat pattern. Without a due date, the deadline moves.",
|
|
7786
|
-
parameters:
|
|
7786
|
+
parameters: hp,
|
|
7787
7787
|
outputSchema: fp,
|
|
7788
7788
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
7789
7789
|
async execute(e, t) {
|
|
7790
7790
|
const { tasks: o } = e, r = o.map(
|
|
7791
|
-
(
|
|
7791
|
+
(m) => m.duration ? to(`Task ${m.id}`, m.duration) : void 0
|
|
7792
7792
|
), s = [], a = await Promise.allSettled(
|
|
7793
|
-
o.map((
|
|
7794
|
-
), i = P(o, a, (
|
|
7793
|
+
o.map((m) => C(() => t.getTask(m.id)))
|
|
7794
|
+
), i = P(o, a, (m) => m.id);
|
|
7795
7795
|
s.push(...i.failures);
|
|
7796
7796
|
const c = [];
|
|
7797
|
-
for (const { item:
|
|
7798
|
-
const y = bp(
|
|
7797
|
+
for (const { item: m, index: h, value: g } of i.succeeded) {
|
|
7798
|
+
const y = bp(m.date, g);
|
|
7799
7799
|
y && c.push({
|
|
7800
|
-
id:
|
|
7800
|
+
id: m.id,
|
|
7801
7801
|
command: V("item_update", {
|
|
7802
|
-
id:
|
|
7802
|
+
id: m.id,
|
|
7803
7803
|
...y,
|
|
7804
|
-
...r[
|
|
7804
|
+
...r[h] && { duration: r[h] }
|
|
7805
7805
|
})
|
|
7806
7806
|
});
|
|
7807
7807
|
}
|
|
7808
7808
|
const d = [];
|
|
7809
7809
|
if (c.length > 0) {
|
|
7810
|
-
const { outcomes:
|
|
7810
|
+
const { outcomes: m } = await X(
|
|
7811
7811
|
t,
|
|
7812
7812
|
c.map(({ command: g }) => g)
|
|
7813
|
-
),
|
|
7814
|
-
d.push(...
|
|
7813
|
+
), h = P(c, m, ({ id: g }) => g);
|
|
7814
|
+
d.push(...h.succeeded.map(({ item: g }) => g.id)), s.push(...h.failures);
|
|
7815
7815
|
}
|
|
7816
7816
|
O(b.RESCHEDULE_TASKS, o.length, s);
|
|
7817
7817
|
const u = [], l = [];
|
|
7818
7818
|
let p;
|
|
7819
7819
|
if (d.length > 0) {
|
|
7820
|
-
const
|
|
7821
|
-
d.map((
|
|
7820
|
+
const m = await Promise.allSettled(
|
|
7821
|
+
d.map((h) => C(() => t.getTask(h)))
|
|
7822
7822
|
);
|
|
7823
|
-
for (const [
|
|
7823
|
+
for (const [h, g] of m.entries()) {
|
|
7824
7824
|
if (g.status === "fulfilled") {
|
|
7825
7825
|
u.push(z(g.value));
|
|
7826
7826
|
continue;
|
|
7827
7827
|
}
|
|
7828
|
-
l.push(d[
|
|
7828
|
+
l.push(d[h] ?? `Task ${h + 1}`), p ??= L(g.reason);
|
|
7829
7829
|
}
|
|
7830
7830
|
p && console.error(`${b.RESCHEDULE_TASKS}: read-back failed`, {
|
|
7831
7831
|
updated: d.length,
|
|
@@ -7893,7 +7893,7 @@ function yn(e, t) {
|
|
|
7893
7893
|
}
|
|
7894
7894
|
const vp = {
|
|
7895
7895
|
query: n.string().min(1).describe("The search query string to find tasks and projects.")
|
|
7896
|
-
},
|
|
7896
|
+
}, Ip = {
|
|
7897
7897
|
results: n.array(
|
|
7898
7898
|
n.object({
|
|
7899
7899
|
id: n.string().describe("The ID of the result."),
|
|
@@ -7902,11 +7902,11 @@ const vp = {
|
|
|
7902
7902
|
})
|
|
7903
7903
|
).describe("The search results."),
|
|
7904
7904
|
totalCount: n.number().describe("Total number of results found.")
|
|
7905
|
-
},
|
|
7905
|
+
}, kp = {
|
|
7906
7906
|
name: b.SEARCH,
|
|
7907
7907
|
description: "Search across tasks and projects in Todoist. Returns a list of relevant results with IDs, titles, and URLs.",
|
|
7908
7908
|
parameters: vp,
|
|
7909
|
-
outputSchema:
|
|
7909
|
+
outputSchema: Ip,
|
|
7910
7910
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
7911
7911
|
async execute(e, t) {
|
|
7912
7912
|
const { query: o } = e, [r, s] = await Promise.all([
|
|
@@ -7954,10 +7954,10 @@ function Ap(e, t) {
|
|
|
7954
7954
|
const o = jp.exec(e);
|
|
7955
7955
|
if (!o)
|
|
7956
7956
|
throw vt(e);
|
|
7957
|
-
const [, r, s, a, i, c, d = "0", u = ""] = o, [l, p, f,
|
|
7958
|
-
y.setUTCFullYear(l, p - 1, f), y.setUTCHours(
|
|
7959
|
-
const
|
|
7960
|
-
if (!
|
|
7957
|
+
const [, r, s, a, i, c, d = "0", u = ""] = o, [l, p, f, m, h, g] = [r, s, a, i, c, d].map(Number), y = /* @__PURE__ */ new Date(0);
|
|
7958
|
+
y.setUTCFullYear(l, p - 1, f), y.setUTCHours(m, h, g);
|
|
7959
|
+
const I = y.getUTCFullYear() === l && y.getUTCMonth() === p - 1 && y.getUTCDate() === f && y.getUTCHours() === m && y.getUTCMinutes() === h && y.getUTCSeconds() === g, w = u.toUpperCase() === "Z" ? 0 : _e(u);
|
|
7960
|
+
if (!I || w < $p || w > Ep)
|
|
7961
7961
|
throw vt(e);
|
|
7962
7962
|
const v = new Date(e);
|
|
7963
7963
|
if (Number.isNaN(v.getTime()))
|
|
@@ -8087,7 +8087,7 @@ function Np({
|
|
|
8087
8087
|
failures: t,
|
|
8088
8088
|
args: o
|
|
8089
8089
|
}) {
|
|
8090
|
-
return
|
|
8090
|
+
return mo({
|
|
8091
8091
|
action: "Uncompleted tasks",
|
|
8092
8092
|
success: e.length,
|
|
8093
8093
|
total: o.ids.length,
|
|
@@ -8183,17 +8183,17 @@ const Bp = n.object({
|
|
|
8183
8183
|
skippedCount: n.number().describe("The number of filters skipped (no changes)."),
|
|
8184
8184
|
failureCount: n.number()
|
|
8185
8185
|
}).describe("Summary of operations performed.")
|
|
8186
|
-
},
|
|
8186
|
+
}, qp = {
|
|
8187
8187
|
name: b.UPDATE_FILTERS,
|
|
8188
8188
|
description: "Update one or more existing personal filters with new values.",
|
|
8189
8189
|
parameters: Kp,
|
|
8190
8190
|
outputSchema: zp,
|
|
8191
8191
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
8192
8192
|
async execute(e, t) {
|
|
8193
|
-
const { filters: o } = e, r = [], a = o.map((
|
|
8194
|
-
const g = Vp(
|
|
8195
|
-
return g !== null ? { kind: "skipped", reason: g } : (r.push(
|
|
8196
|
-
}).filter((
|
|
8193
|
+
const { filters: o } = e, r = [], a = o.map((h) => {
|
|
8194
|
+
const g = Vp(h);
|
|
8195
|
+
return g !== null ? { kind: "skipped", reason: g } : (r.push(h), { kind: "updated", filter: h });
|
|
8196
|
+
}).filter((h) => h.kind === "skipped").length;
|
|
8197
8197
|
if (r.length === 0)
|
|
8198
8198
|
return {
|
|
8199
8199
|
textContent: `Updated 0 filters (${a} skipped - no changes)`,
|
|
@@ -8205,22 +8205,22 @@ const Bp = n.object({
|
|
|
8205
8205
|
appliedOperations: { updateCount: 0, skippedCount: a, failureCount: 0 }
|
|
8206
8206
|
}
|
|
8207
8207
|
};
|
|
8208
|
-
const i = r.map((
|
|
8209
|
-
const { id: g, color: y, description:
|
|
8208
|
+
const i = r.map((h) => {
|
|
8209
|
+
const { id: g, color: y, description: I, ...w } = h;
|
|
8210
8210
|
return V("filter_update", {
|
|
8211
8211
|
id: g,
|
|
8212
8212
|
...w,
|
|
8213
8213
|
// "remove" is the house sentinel for clearing a field; the API clears on null.
|
|
8214
|
-
...
|
|
8214
|
+
...I !== void 0 ? { description: I === "remove" ? null : I } : {},
|
|
8215
8215
|
...y !== void 0 ? { color: y } : {}
|
|
8216
8216
|
});
|
|
8217
|
-
}), { outcomes: c } = await X(t, i), { succeeded: d, failures: u } = P(r, c, (
|
|
8217
|
+
}), { outcomes: c } = await X(t, i), { succeeded: d, failures: u } = P(r, c, (h) => h.id), l = d.map(({ item: h }) => h.id);
|
|
8218
8218
|
O(b.UPDATE_FILTERS, o.length, u);
|
|
8219
8219
|
let p = [], f;
|
|
8220
8220
|
if (l.length > 0) {
|
|
8221
|
-
let
|
|
8221
|
+
let h;
|
|
8222
8222
|
try {
|
|
8223
|
-
|
|
8223
|
+
h = (await C(
|
|
8224
8224
|
() => t.sync({ resourceTypes: ["filters"], syncToken: "*" })
|
|
8225
8225
|
)).filters ?? [];
|
|
8226
8226
|
} catch (g) {
|
|
@@ -8229,7 +8229,7 @@ const Bp = n.object({
|
|
|
8229
8229
|
error: f
|
|
8230
8230
|
});
|
|
8231
8231
|
}
|
|
8232
|
-
|
|
8232
|
+
h && (p = Gp(h, new Set(l)));
|
|
8233
8233
|
}
|
|
8234
8234
|
return {
|
|
8235
8235
|
textContent: N(
|
|
@@ -8255,7 +8255,7 @@ const Bp = n.object({
|
|
|
8255
8255
|
};
|
|
8256
8256
|
}
|
|
8257
8257
|
};
|
|
8258
|
-
function
|
|
8258
|
+
function Gp(e, t) {
|
|
8259
8259
|
return e.filter((o) => !o.isDeleted && t.has(o.id)).map((o) => ({
|
|
8260
8260
|
id: o.id,
|
|
8261
8261
|
name: o.name,
|
|
@@ -8311,7 +8311,7 @@ const Jp = n.object({
|
|
|
8311
8311
|
)
|
|
8312
8312
|
), { succeeded: r, failures: s } = P(e, o, (i) => i.id), a = r.map(({ value: i }) => i);
|
|
8313
8313
|
return O(b.UPDATE_FOLDERS, e.length, s), {
|
|
8314
|
-
textContent:
|
|
8314
|
+
textContent: em(a, s),
|
|
8315
8315
|
structuredContent: {
|
|
8316
8316
|
folders: a.map(lo),
|
|
8317
8317
|
failures: s,
|
|
@@ -8321,38 +8321,38 @@ const Jp = n.object({
|
|
|
8321
8321
|
};
|
|
8322
8322
|
}
|
|
8323
8323
|
};
|
|
8324
|
-
function
|
|
8324
|
+
function em(e, t) {
|
|
8325
8325
|
const o = e.length, r = e.map((a) => `• ${a.name} (id=${a.id})`), s = o > 0 ? `Renamed ${o} folder${o === 1 ? "" : "s"}:
|
|
8326
8326
|
${r.join(`
|
|
8327
8327
|
`)}` : "Renamed 0 folders";
|
|
8328
8328
|
return N(s, t);
|
|
8329
8329
|
}
|
|
8330
|
-
const
|
|
8330
|
+
const tm = n.object({
|
|
8331
8331
|
labelType: n.literal("personal").describe("Update a personal label, identified by its ID."),
|
|
8332
8332
|
id: n.string().min(1).describe("The ID of the personal label to update."),
|
|
8333
8333
|
name: n.string().min(1).max(128).optional().describe("The new name of the label."),
|
|
8334
8334
|
color: Te,
|
|
8335
8335
|
order: n.number().int().optional().describe("The new position of the label in the label list."),
|
|
8336
8336
|
isFavorite: n.boolean().optional().describe("Whether to mark the label as a favorite.")
|
|
8337
|
-
}),
|
|
8337
|
+
}), om = n.object({
|
|
8338
8338
|
labelType: n.literal("shared").describe(
|
|
8339
8339
|
"Rename a shared label across all tasks. Shared labels are identified by name; only renaming is supported (no color, order, or favorite)."
|
|
8340
8340
|
),
|
|
8341
8341
|
name: n.string().min(1).describe("The current name of the shared label."),
|
|
8342
8342
|
newName: n.string().min(1).describe("The new name for the shared label.")
|
|
8343
|
-
}),
|
|
8344
|
-
|
|
8345
|
-
|
|
8346
|
-
]),
|
|
8347
|
-
labels: n.array(
|
|
8343
|
+
}), nm = n.discriminatedUnion("labelType", [
|
|
8344
|
+
tm,
|
|
8345
|
+
om
|
|
8346
|
+
]), rm = {
|
|
8347
|
+
labels: n.array(nm).min(1).max(x.ITEMS_PER_OPERATION).describe(
|
|
8348
8348
|
'The labels to update. Use labelType="personal" with an ID to update a personal label, or labelType="shared" with name+newName to rename a shared label.'
|
|
8349
8349
|
)
|
|
8350
|
-
},
|
|
8350
|
+
}, sm = n.object({
|
|
8351
8351
|
name: n.string().describe("The previous name of the shared label."),
|
|
8352
8352
|
newName: n.string().describe("The new name of the shared label.")
|
|
8353
|
-
}),
|
|
8353
|
+
}), am = {
|
|
8354
8354
|
updatedLabels: n.array(Pe).describe("The updated personal labels."),
|
|
8355
|
-
renamedSharedLabels: n.array(
|
|
8355
|
+
renamedSharedLabels: n.array(sm).describe("The shared labels that were renamed."),
|
|
8356
8356
|
totalCount: n.number().describe("The total number of successful operations (personal + shared)."),
|
|
8357
8357
|
failures: n.array(_).describe(
|
|
8358
8358
|
"Labels that could not be updated, identified by ID (personal) or name (shared), with the reason for each."
|
|
@@ -8363,41 +8363,41 @@ const th = n.object({
|
|
|
8363
8363
|
skippedCount: n.number().describe("Number of operations skipped (no changes or shared label not found)."),
|
|
8364
8364
|
failureCount: n.number()
|
|
8365
8365
|
}).describe("Summary of operations performed.")
|
|
8366
|
-
},
|
|
8366
|
+
}, im = {
|
|
8367
8367
|
name: b.UPDATE_LABELS,
|
|
8368
8368
|
description: "Update one or more existing labels. Personal labels (identified by ID) can have their name, color, order, and favorite flag updated. Shared labels (identified by name) can only be renamed.",
|
|
8369
|
-
parameters:
|
|
8370
|
-
outputSchema:
|
|
8369
|
+
parameters: rm,
|
|
8370
|
+
outputSchema: am,
|
|
8371
8371
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
8372
8372
|
async execute(e, t) {
|
|
8373
8373
|
const { labels: o } = e, r = await Promise.allSettled(
|
|
8374
|
-
o.map(async (
|
|
8375
|
-
if (
|
|
8376
|
-
const g =
|
|
8374
|
+
o.map(async (m) => {
|
|
8375
|
+
if (m.labelType === "personal") {
|
|
8376
|
+
const g = dm(m);
|
|
8377
8377
|
if (g !== null) return { kind: "skipped", reason: g };
|
|
8378
|
-
const { id: y, labelType:
|
|
8378
|
+
const { id: y, labelType: I, ...w } = m;
|
|
8379
8379
|
return { kind: "updated", label: await C(() => t.updateLabel(y, w)) };
|
|
8380
8380
|
}
|
|
8381
8381
|
return await C(
|
|
8382
|
-
() => t.renameSharedLabel({ name:
|
|
8383
|
-
) ? { kind: "renamed", name:
|
|
8382
|
+
() => t.renameSharedLabel({ name: m.name, newName: m.newName })
|
|
8383
|
+
) ? { kind: "renamed", name: m.name, newName: m.newName } : { kind: "skipped", reason: "not-found" };
|
|
8384
8384
|
})
|
|
8385
8385
|
), { succeeded: s, failures: a } = P(
|
|
8386
8386
|
o,
|
|
8387
8387
|
r,
|
|
8388
|
-
(
|
|
8389
|
-
), i = s.map(({ value:
|
|
8388
|
+
(m) => m.labelType === "personal" ? m.id : m.name
|
|
8389
|
+
), i = s.map(({ value: m }) => m);
|
|
8390
8390
|
O(b.UPDATE_LABELS, o.length, a, { redactItems: !0 });
|
|
8391
|
-
const c = i.filter((
|
|
8392
|
-
(
|
|
8393
|
-
).map(({ name:
|
|
8394
|
-
(
|
|
8391
|
+
const c = i.filter((m) => m.kind === "updated").map((m) => Pe.parse(m.label)), d = i.filter(
|
|
8392
|
+
(m) => m.kind === "renamed"
|
|
8393
|
+
).map(({ name: m, newName: h }) => ({ name: m, newName: h })), u = i.filter((m) => m.kind === "skipped").length, l = i.filter(
|
|
8394
|
+
(m) => m.kind === "skipped" && m.reason === "no-fields"
|
|
8395
8395
|
).length, p = i.filter(
|
|
8396
|
-
(
|
|
8396
|
+
(m) => m.kind === "skipped" && m.reason === "not-found"
|
|
8397
8397
|
).length;
|
|
8398
8398
|
return {
|
|
8399
8399
|
textContent: N(
|
|
8400
|
-
|
|
8400
|
+
cm({
|
|
8401
8401
|
updatedLabels: c,
|
|
8402
8402
|
renamedSharedLabels: d,
|
|
8403
8403
|
skippedNoFields: l,
|
|
@@ -8420,7 +8420,7 @@ const th = n.object({
|
|
|
8420
8420
|
};
|
|
8421
8421
|
}
|
|
8422
8422
|
};
|
|
8423
|
-
function
|
|
8423
|
+
function cm({
|
|
8424
8424
|
updatedLabels: e,
|
|
8425
8425
|
renamedSharedLabels: t,
|
|
8426
8426
|
skippedNoFields: o,
|
|
@@ -8442,14 +8442,14 @@ function ch({
|
|
|
8442
8442
|
return c.join(`
|
|
8443
8443
|
`);
|
|
8444
8444
|
}
|
|
8445
|
-
function
|
|
8445
|
+
function dm({
|
|
8446
8446
|
id: e,
|
|
8447
8447
|
labelType: t,
|
|
8448
8448
|
...o
|
|
8449
8449
|
}) {
|
|
8450
8450
|
return Object.values(o).every((s) => s === void 0) ? "no-fields" : null;
|
|
8451
8451
|
}
|
|
8452
|
-
const { FIND_FOLDERS:
|
|
8452
|
+
const { FIND_FOLDERS: lm } = b, um = n.object({
|
|
8453
8453
|
id: n.string().min(1).describe("The ID of the project to update."),
|
|
8454
8454
|
name: n.string().min(1).optional().describe("The new name of the project."),
|
|
8455
8455
|
isFavorite: n.boolean().optional().describe("Whether the project is a favorite."),
|
|
@@ -8466,11 +8466,11 @@ const { FIND_FOLDERS: lh } = b, uh = n.object({
|
|
|
8466
8466
|
color: Te,
|
|
8467
8467
|
icon: n.enum([...Dn, "remove"]).optional().describe('The project icon, or "remove" to restore the default # icon.'),
|
|
8468
8468
|
folderId: n.string().min(1).optional().describe(
|
|
8469
|
-
`Move a workspace project into this folder (see ${
|
|
8469
|
+
`Move a workspace project into this folder (see ${lm}), or "remove" for the workspace's top level.`
|
|
8470
8470
|
)
|
|
8471
|
-
}),
|
|
8472
|
-
projects: n.array(
|
|
8473
|
-
},
|
|
8471
|
+
}), pm = {
|
|
8472
|
+
projects: n.array(um).min(1).max(x.ITEMS_PER_OPERATION).describe("The projects to update.")
|
|
8473
|
+
}, mm = {
|
|
8474
8474
|
projects: n.array(ve).describe("The updated projects."),
|
|
8475
8475
|
totalCount: n.number().describe("The total number of projects updated."),
|
|
8476
8476
|
updatedProjectIds: n.array(n.string()).describe("The IDs of the updated projects."),
|
|
@@ -8480,21 +8480,21 @@ const { FIND_FOLDERS: lh } = b, uh = n.object({
|
|
|
8480
8480
|
skippedCount: n.number().describe("The number of projects skipped (no changes)."),
|
|
8481
8481
|
failureCount: n.number()
|
|
8482
8482
|
}).describe("Summary of operations performed.")
|
|
8483
|
-
},
|
|
8483
|
+
}, hm = {
|
|
8484
8484
|
name: b.UPDATE_PROJECTS,
|
|
8485
8485
|
description: "Update multiple existing projects with new values.",
|
|
8486
|
-
parameters:
|
|
8487
|
-
outputSchema:
|
|
8486
|
+
parameters: pm,
|
|
8487
|
+
outputSchema: mm,
|
|
8488
8488
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
8489
8489
|
async execute(e, t) {
|
|
8490
8490
|
const { projects: o } = e, r = await Promise.allSettled(
|
|
8491
8491
|
o.map(async (l) => {
|
|
8492
|
-
const p =
|
|
8492
|
+
const p = gm(l);
|
|
8493
8493
|
if (p !== null) return { kind: "skipped", reason: p };
|
|
8494
|
-
const { id: f, folderId:
|
|
8494
|
+
const { id: f, folderId: m, icon: h, ...g } = l, y = {
|
|
8495
8495
|
...g,
|
|
8496
|
-
...
|
|
8497
|
-
...
|
|
8496
|
+
...m !== void 0 ? { folderId: m === "remove" ? null : m } : {},
|
|
8497
|
+
...h !== void 0 ? { icon: h === "remove" ? null : h } : {}
|
|
8498
8498
|
};
|
|
8499
8499
|
return { kind: "updated", project: await C(() => t.updateProject(f, y)) };
|
|
8500
8500
|
})
|
|
@@ -8503,7 +8503,7 @@ const { FIND_FOLDERS: lh } = b, uh = n.object({
|
|
|
8503
8503
|
for (const { value: l } of s)
|
|
8504
8504
|
l.kind === "updated" ? i.push(we(l.project)) : l.reason === "no-fields" ? c++ : d++;
|
|
8505
8505
|
return O(b.UPDATE_PROJECTS, o.length, a), {
|
|
8506
|
-
textContent:
|
|
8506
|
+
textContent: fm({
|
|
8507
8507
|
projects: i,
|
|
8508
8508
|
skippedNoFields: c,
|
|
8509
8509
|
skippedNoValidValues: d,
|
|
@@ -8523,7 +8523,7 @@ const { FIND_FOLDERS: lh } = b, uh = n.object({
|
|
|
8523
8523
|
};
|
|
8524
8524
|
}
|
|
8525
8525
|
};
|
|
8526
|
-
function
|
|
8526
|
+
function fm({
|
|
8527
8527
|
projects: e,
|
|
8528
8528
|
skippedNoFields: t,
|
|
8529
8529
|
skippedNoValidValues: o,
|
|
@@ -8536,44 +8536,44 @@ function fh({
|
|
|
8536
8536
|
return t > 0 && c.push(`${t} skipped - no changes`), o > 0 && c.push(`${o} skipped - no valid field values`), c.length > 0 && (i += ` (${c.join(", ")})`), s > 0 && (i += `:
|
|
8537
8537
|
${a}`), N(i, r);
|
|
8538
8538
|
}
|
|
8539
|
-
function
|
|
8539
|
+
function gm({ id: e, ...t }) {
|
|
8540
8540
|
const o = Object.values(t);
|
|
8541
8541
|
return o.length === 0 ? "no-fields" : o.every((r) => r === void 0) ? "no-valid-values" : null;
|
|
8542
8542
|
}
|
|
8543
|
-
const
|
|
8543
|
+
const bm = n.object({
|
|
8544
8544
|
type: n.literal("relative"),
|
|
8545
8545
|
id: n.string().min(1).describe("The ID of the relative reminder to update."),
|
|
8546
8546
|
minuteOffset: n.number().int().min(0).optional().describe("New minute offset before task due time."),
|
|
8547
8547
|
service: lt.optional().describe('New delivery method: "email" or "push".'),
|
|
8548
8548
|
isUrgent: ut,
|
|
8549
8549
|
notifyUser: To
|
|
8550
|
-
}),
|
|
8550
|
+
}), ym = n.object({
|
|
8551
8551
|
type: n.literal("absolute"),
|
|
8552
8552
|
id: n.string().min(1).describe("The ID of the absolute reminder to update."),
|
|
8553
|
-
due:
|
|
8553
|
+
due: Ir.optional().describe("New due date/time for the reminder."),
|
|
8554
8554
|
service: lt.optional().describe('New delivery method: "email" or "push".'),
|
|
8555
8555
|
isUrgent: ut,
|
|
8556
8556
|
notifyUser: To
|
|
8557
|
-
}),
|
|
8557
|
+
}), wm = n.object({
|
|
8558
8558
|
type: n.literal("location"),
|
|
8559
8559
|
id: n.string().min(1).describe("The ID of the location reminder to update."),
|
|
8560
8560
|
name: n.string().optional().describe("New location name."),
|
|
8561
8561
|
locLat: n.string().optional().describe("New latitude."),
|
|
8562
8562
|
locLong: n.string().optional().describe("New longitude."),
|
|
8563
|
-
locTrigger:
|
|
8563
|
+
locTrigger: kr.optional().describe(
|
|
8564
8564
|
'New trigger condition: "on_enter" or "on_leave".'
|
|
8565
8565
|
),
|
|
8566
8566
|
radius: n.number().int().optional().describe("New radius in meters."),
|
|
8567
8567
|
notifyUser: To
|
|
8568
|
-
}),
|
|
8569
|
-
|
|
8570
|
-
|
|
8571
|
-
|
|
8572
|
-
]),
|
|
8573
|
-
reminders: n.array(
|
|
8568
|
+
}), Tm = n.discriminatedUnion("type", [
|
|
8569
|
+
bm,
|
|
8570
|
+
ym,
|
|
8571
|
+
wm
|
|
8572
|
+
]), vm = {
|
|
8573
|
+
reminders: n.array(Tm).min(1).max(et).describe(
|
|
8574
8574
|
`Array of reminders to update (max ${et}). Each must include the reminder type and ID. Only include fields that need to change.`
|
|
8575
8575
|
)
|
|
8576
|
-
},
|
|
8576
|
+
}, Im = {
|
|
8577
8577
|
reminders: n.array(uo).describe("The updated reminders."),
|
|
8578
8578
|
totalCount: n.number().describe("Total reminders updated."),
|
|
8579
8579
|
updatedReminderIds: n.array(n.string()).describe("IDs of updated reminders."),
|
|
@@ -8582,11 +8582,11 @@ const bh = n.object({
|
|
|
8582
8582
|
updateCount: n.number(),
|
|
8583
8583
|
failureCount: n.number()
|
|
8584
8584
|
})
|
|
8585
|
-
},
|
|
8585
|
+
}, km = {
|
|
8586
8586
|
name: b.UPDATE_REMINDERS,
|
|
8587
8587
|
description: 'Update existing reminders. Each reminder must specify its type ("relative", "absolute", or "location") and ID. Only include fields that need to change.',
|
|
8588
|
-
parameters:
|
|
8589
|
-
outputSchema:
|
|
8588
|
+
parameters: vm,
|
|
8589
|
+
outputSchema: Im,
|
|
8590
8590
|
annotations: {
|
|
8591
8591
|
readOnlyHint: !1,
|
|
8592
8592
|
destructiveHint: !0,
|
|
@@ -8599,13 +8599,13 @@ const bh = n.object({
|
|
|
8599
8599
|
o.map((p) => p.notifyUser)
|
|
8600
8600
|
), s = await Promise.allSettled(
|
|
8601
8601
|
o.map(async (p, f) => {
|
|
8602
|
-
const
|
|
8603
|
-
if (
|
|
8604
|
-
throw
|
|
8605
|
-
const
|
|
8602
|
+
const m = r[f];
|
|
8603
|
+
if (m?.status === "rejected")
|
|
8604
|
+
throw m.reason;
|
|
8605
|
+
const h = m?.value, g = h !== void 0 ? { notifyUid: h } : {};
|
|
8606
8606
|
switch (p.type) {
|
|
8607
8607
|
case "relative": {
|
|
8608
|
-
const { id: y, type:
|
|
8608
|
+
const { id: y, type: I, notifyUser: w, ...v } = p;
|
|
8609
8609
|
return await C(
|
|
8610
8610
|
() => t.updateReminder(y, {
|
|
8611
8611
|
reminderType: "relative",
|
|
@@ -8615,7 +8615,7 @@ const bh = n.object({
|
|
|
8615
8615
|
);
|
|
8616
8616
|
}
|
|
8617
8617
|
case "absolute": {
|
|
8618
|
-
const { id: y, type:
|
|
8618
|
+
const { id: y, type: I, notifyUser: w, ...v } = p;
|
|
8619
8619
|
return await C(
|
|
8620
8620
|
() => t.updateReminder(y, {
|
|
8621
8621
|
reminderType: "absolute",
|
|
@@ -8625,7 +8625,7 @@ const bh = n.object({
|
|
|
8625
8625
|
);
|
|
8626
8626
|
}
|
|
8627
8627
|
case "location": {
|
|
8628
|
-
const { id: y, type:
|
|
8628
|
+
const { id: y, type: I, notifyUser: w, ...v } = p;
|
|
8629
8629
|
return await C(
|
|
8630
8630
|
() => t.updateLocationReminder(y, { ...v, ...g })
|
|
8631
8631
|
);
|
|
@@ -8663,7 +8663,7 @@ const bh = n.object({
|
|
|
8663
8663
|
}
|
|
8664
8664
|
};
|
|
8665
8665
|
}
|
|
8666
|
-
},
|
|
8666
|
+
}, Sm = n.object({
|
|
8667
8667
|
id: n.string().min(1).describe("The ID of the section to update."),
|
|
8668
8668
|
name: n.string().min(1).optional().describe("The new name of the section."),
|
|
8669
8669
|
description: n.preprocess(
|
|
@@ -8678,9 +8678,9 @@ const bh = n.object({
|
|
|
8678
8678
|
).optional()
|
|
8679
8679
|
}).refine((e) => e.name !== void 0 || e.description !== void 0, {
|
|
8680
8680
|
message: 'Provide at least one of "name" or "description" to update.'
|
|
8681
|
-
}),
|
|
8682
|
-
sections: n.array(
|
|
8683
|
-
},
|
|
8681
|
+
}), Cm = {
|
|
8682
|
+
sections: n.array(Sm).min(1).max(x.ITEMS_PER_OPERATION).describe("The sections to update.")
|
|
8683
|
+
}, jm = {
|
|
8684
8684
|
sections: n.array(de).describe("The updated sections."),
|
|
8685
8685
|
totalCount: n.number().describe("The total number of sections updated."),
|
|
8686
8686
|
updatedSectionIds: n.array(n.string()).describe("The IDs of the updated sections."),
|
|
@@ -8689,11 +8689,11 @@ const bh = n.object({
|
|
|
8689
8689
|
updateCount: n.number(),
|
|
8690
8690
|
failureCount: n.number()
|
|
8691
8691
|
})
|
|
8692
|
-
}, $
|
|
8692
|
+
}, $m = {
|
|
8693
8693
|
name: b.UPDATE_SECTIONS,
|
|
8694
8694
|
description: "Update multiple existing sections with new values.",
|
|
8695
|
-
parameters:
|
|
8696
|
-
outputSchema:
|
|
8695
|
+
parameters: Cm,
|
|
8696
|
+
outputSchema: jm,
|
|
8697
8697
|
annotations: { readOnlyHint: !1, destructiveHint: !0, idempotentHint: !1 },
|
|
8698
8698
|
async execute({ sections: e }, t) {
|
|
8699
8699
|
const o = await Promise.allSettled(
|
|
@@ -8706,7 +8706,7 @@ const bh = n.object({
|
|
|
8706
8706
|
})
|
|
8707
8707
|
), { succeeded: r, failures: s } = P(e, o, (c) => c.id), a = r.map(({ value: c }) => c);
|
|
8708
8708
|
return O(b.UPDATE_SECTIONS, e.length, s), {
|
|
8709
|
-
textContent:
|
|
8709
|
+
textContent: Em({
|
|
8710
8710
|
sections: a,
|
|
8711
8711
|
failures: s
|
|
8712
8712
|
}),
|
|
@@ -8723,7 +8723,7 @@ const bh = n.object({
|
|
|
8723
8723
|
};
|
|
8724
8724
|
}
|
|
8725
8725
|
};
|
|
8726
|
-
function
|
|
8726
|
+
function Em({
|
|
8727
8727
|
sections: e,
|
|
8728
8728
|
failures: t
|
|
8729
8729
|
}) {
|
|
@@ -8735,27 +8735,27 @@ ${r}` : "Updated 0 sections";
|
|
|
8735
8735
|
function Yr(e, t) {
|
|
8736
8736
|
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;
|
|
8737
8737
|
}
|
|
8738
|
-
function
|
|
8738
|
+
function Am(e, t) {
|
|
8739
8739
|
return t.projectId !== void 0 ? e.projectId === t.projectId : t.sectionId !== void 0 ? e.sectionId === t.sectionId : e.parentId === t.parentId;
|
|
8740
8740
|
}
|
|
8741
|
-
function
|
|
8741
|
+
function Dm(e) {
|
|
8742
8742
|
return e.projectId !== void 0 ? `project:${e.projectId}` : e.sectionId !== void 0 ? `section:${e.sectionId}` : `parent:${e.parentId}`;
|
|
8743
8743
|
}
|
|
8744
|
-
function
|
|
8744
|
+
function xm(e) {
|
|
8745
8745
|
const t = [];
|
|
8746
8746
|
return e.projectId && t.push({ projectId: e.projectId }), e.sectionId && t.push({ sectionId: e.sectionId }), e.parentId && t.push({ parentId: e.parentId }), t;
|
|
8747
8747
|
}
|
|
8748
|
-
function
|
|
8748
|
+
function Om({
|
|
8749
8749
|
taskId: e,
|
|
8750
8750
|
request: t,
|
|
8751
8751
|
current: o
|
|
8752
8752
|
}) {
|
|
8753
|
-
const r =
|
|
8753
|
+
const r = xm(t);
|
|
8754
8754
|
if (r.length === 0)
|
|
8755
8755
|
return { redundantMoveSkipped: !1 };
|
|
8756
8756
|
let s = r, a = !1;
|
|
8757
8757
|
if (o) {
|
|
8758
|
-
const i = r.length === 1 ? (c) => Yr(o, c) : (c) =>
|
|
8758
|
+
const i = r.length === 1 ? (c) => Yr(o, c) : (c) => Am(o, c);
|
|
8759
8759
|
s = r.filter((c) => !i(c)), a = s.length < r.length;
|
|
8760
8760
|
}
|
|
8761
8761
|
if (s.length === 0)
|
|
@@ -8766,7 +8766,7 @@ function Oh({
|
|
|
8766
8766
|
);
|
|
8767
8767
|
return { move: s[0], redundantMoveSkipped: a };
|
|
8768
8768
|
}
|
|
8769
|
-
const
|
|
8769
|
+
const _m = n.object({
|
|
8770
8770
|
id: n.string().min(1).describe("The ID of the task to update."),
|
|
8771
8771
|
content: n.string().optional().describe(
|
|
8772
8772
|
'The new 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.'
|
|
@@ -8812,9 +8812,9 @@ const _h = n.object({
|
|
|
8812
8812
|
isUncompletable: n.boolean().optional().describe(
|
|
8813
8813
|
"Whether this task should be uncompletable (organizational header). Tasks with isUncompletable: true appear as organizational headers and cannot be completed."
|
|
8814
8814
|
)
|
|
8815
|
-
}),
|
|
8816
|
-
tasks: n.array(
|
|
8817
|
-
},
|
|
8815
|
+
}), Pm = (e) => !!(e.projectId || e.sectionId || e.parentId), Vr = (e) => Object.keys(e).length > 0, Um = ["remove", "no date"], Rm = ["remove", "no date", "no deadline"], vn = "no date", Ht = x.TASKS_PER_OPERATION, In = {
|
|
8816
|
+
tasks: n.array(_m).min(1).max(Ht).describe(`The tasks to update (max ${Ht}).`)
|
|
8817
|
+
}, Nm = {
|
|
8818
8818
|
tasks: n.array(ae).describe("The updated tasks."),
|
|
8819
8819
|
totalCount: n.number().describe("The total number of tasks updated."),
|
|
8820
8820
|
updatedTaskIds: n.array(n.string()).describe("The IDs of the updated tasks."),
|
|
@@ -8827,11 +8827,11 @@ const _h = n.object({
|
|
|
8827
8827
|
"Moves not performed because the task was already in the requested destination. A non-zero count means container fields were sent that did not need to be."
|
|
8828
8828
|
)
|
|
8829
8829
|
}).describe("Summary of operations performed.")
|
|
8830
|
-
},
|
|
8830
|
+
}, Mm = {
|
|
8831
8831
|
name: b.UPDATE_TASKS,
|
|
8832
8832
|
description: "Update existing tasks including content, dates, priorities, and assignments. Send only the fields that change.",
|
|
8833
|
-
parameters:
|
|
8834
|
-
outputSchema:
|
|
8833
|
+
parameters: In,
|
|
8834
|
+
outputSchema: Nm,
|
|
8835
8835
|
// Open world: assigning a task notifies the new assignee.
|
|
8836
8836
|
annotations: {
|
|
8837
8837
|
readOnlyHint: !1,
|
|
@@ -8840,15 +8840,15 @@ const _h = n.object({
|
|
|
8840
8840
|
openWorldHint: !0
|
|
8841
8841
|
},
|
|
8842
8842
|
async execute(e, t) {
|
|
8843
|
-
const { tasks: o } = n.object(
|
|
8843
|
+
const { tasks: o } = n.object(In).parse(e), r = o.map(() => ({ kind: "skipped" })), s = (T, S, A) => {
|
|
8844
8844
|
r[T] = { kind: "failed", error: S, rateLimit: A };
|
|
8845
8845
|
}, a = (T, S) => {
|
|
8846
8846
|
s(T, L(S), J(S));
|
|
8847
|
-
}, i = o.map((T, S) => ({ task: T, index: S })).filter(({ task: T }) =>
|
|
8847
|
+
}, i = o.map((T, S) => ({ task: T, index: S })).filter(({ task: T }) => Ym(T)), c = await Fm(
|
|
8848
8848
|
i.map(({ task: T }) => T),
|
|
8849
8849
|
t
|
|
8850
8850
|
), d = await Promise.allSettled(
|
|
8851
|
-
i.map(({ task: T, index: S }) =>
|
|
8851
|
+
i.map(({ task: T, index: S }) => zm({ task: T, index: S, client: t, inbox: c }))
|
|
8852
8852
|
), u = [];
|
|
8853
8853
|
for (const [T, S] of d.entries()) {
|
|
8854
8854
|
const A = i[T]?.index ?? T;
|
|
@@ -8858,14 +8858,14 @@ const _h = n.object({
|
|
|
8858
8858
|
client: t,
|
|
8859
8859
|
ids: [
|
|
8860
8860
|
...new Set(
|
|
8861
|
-
u.filter((T) =>
|
|
8861
|
+
u.filter((T) => Pm(T.moveRequest) || T.checkRecurrence).map((T) => T.id)
|
|
8862
8862
|
)
|
|
8863
8863
|
]
|
|
8864
8864
|
});
|
|
8865
8865
|
for (const T of u) {
|
|
8866
8866
|
if (!T.checkRecurrence)
|
|
8867
8867
|
continue;
|
|
8868
|
-
const S =
|
|
8868
|
+
const S = Hm({
|
|
8869
8869
|
id: T.id,
|
|
8870
8870
|
current: l.get(T.id),
|
|
8871
8871
|
readFailed: p
|
|
@@ -8876,7 +8876,7 @@ const _h = n.object({
|
|
|
8876
8876
|
for (const T of u)
|
|
8877
8877
|
if (!T.failed)
|
|
8878
8878
|
try {
|
|
8879
|
-
const S =
|
|
8879
|
+
const S = Om({
|
|
8880
8880
|
taskId: T.id,
|
|
8881
8881
|
request: T.moveRequest,
|
|
8882
8882
|
current: l.get(T.id)
|
|
@@ -8885,17 +8885,17 @@ const _h = n.object({
|
|
|
8885
8885
|
} catch (S) {
|
|
8886
8886
|
a(T.index, S), T.failed = !0;
|
|
8887
8887
|
}
|
|
8888
|
-
const
|
|
8888
|
+
const m = /* @__PURE__ */ new Map(), h = [], g = (T) => {
|
|
8889
8889
|
const S = T.filter((A) => !A.failed);
|
|
8890
|
-
S.length !== 0 &&
|
|
8891
|
-
|
|
8890
|
+
S.length !== 0 && h.push(
|
|
8891
|
+
Km({
|
|
8892
8892
|
client: t,
|
|
8893
8893
|
items: S,
|
|
8894
8894
|
onUpdated: (A, D) => {
|
|
8895
8895
|
r[A.index] = { kind: "updated", task: D };
|
|
8896
8896
|
},
|
|
8897
8897
|
onFailed: (A, D) => {
|
|
8898
|
-
const R =
|
|
8898
|
+
const R = m.get(A.index);
|
|
8899
8899
|
if (R && "task" in R) {
|
|
8900
8900
|
r[A.index] = {
|
|
8901
8901
|
kind: "partial",
|
|
@@ -8910,14 +8910,14 @@ const _h = n.object({
|
|
|
8910
8910
|
})
|
|
8911
8911
|
);
|
|
8912
8912
|
}, y = new Set(f.map(({ item: T }) => T.index));
|
|
8913
|
-
g(u.filter((T) => !y.has(T.index))), await
|
|
8913
|
+
g(u.filter((T) => !y.has(T.index))), await Wm({
|
|
8914
8914
|
client: t,
|
|
8915
8915
|
moving: f,
|
|
8916
|
-
results:
|
|
8916
|
+
results: m,
|
|
8917
8917
|
onResolved: (T) => {
|
|
8918
8918
|
const S = [];
|
|
8919
8919
|
for (const { item: A } of T) {
|
|
8920
|
-
const D =
|
|
8920
|
+
const D = m.get(A.index);
|
|
8921
8921
|
if (D && "error" in D) {
|
|
8922
8922
|
s(A.index, D.error, D.rateLimit), A.failed = !0;
|
|
8923
8923
|
continue;
|
|
@@ -8926,37 +8926,37 @@ const _h = n.object({
|
|
|
8926
8926
|
}
|
|
8927
8927
|
g(S);
|
|
8928
8928
|
}
|
|
8929
|
-
}), await Promise.all(
|
|
8929
|
+
}), await Promise.all(h);
|
|
8930
8930
|
for (const T of u) {
|
|
8931
8931
|
if (T.failed || Vr(T.updateArgs))
|
|
8932
8932
|
continue;
|
|
8933
|
-
const S =
|
|
8933
|
+
const S = m.get(T.index);
|
|
8934
8934
|
S && "task" in S && (r[T.index] = { kind: "updated", task: S.task });
|
|
8935
8935
|
}
|
|
8936
|
-
const { updatedTasks:
|
|
8936
|
+
const { updatedTasks: I, failures: w, skippedCount: v } = Lm({ tasks: o, outcomes: r }), k = u.filter((T) => T.redundantMoveSkipped).length, $ = I.map(z);
|
|
8937
8937
|
return O(b.UPDATE_TASKS, o.length, w), {
|
|
8938
|
-
textContent:
|
|
8938
|
+
textContent: Gm({
|
|
8939
8939
|
tasks: $,
|
|
8940
8940
|
failures: w,
|
|
8941
8941
|
skippedCount: v,
|
|
8942
|
-
redundantMovesSkipped:
|
|
8942
|
+
redundantMovesSkipped: k
|
|
8943
8943
|
}),
|
|
8944
8944
|
structuredContent: {
|
|
8945
8945
|
tasks: $,
|
|
8946
8946
|
totalCount: $.length,
|
|
8947
|
-
updatedTaskIds:
|
|
8947
|
+
updatedTaskIds: I.map((T) => T.id),
|
|
8948
8948
|
failures: w,
|
|
8949
8949
|
appliedOperations: {
|
|
8950
8950
|
updateCount: $.length,
|
|
8951
8951
|
skippedCount: v,
|
|
8952
8952
|
failureCount: w.length,
|
|
8953
|
-
redundantMovesSkipped:
|
|
8953
|
+
redundantMovesSkipped: k
|
|
8954
8954
|
}
|
|
8955
8955
|
}
|
|
8956
8956
|
};
|
|
8957
8957
|
}
|
|
8958
8958
|
};
|
|
8959
|
-
function
|
|
8959
|
+
function Lm({ tasks: e, outcomes: t }) {
|
|
8960
8960
|
const o = [], r = [];
|
|
8961
8961
|
let s = 0;
|
|
8962
8962
|
for (const [a, i] of t.entries()) {
|
|
@@ -8978,7 +8978,7 @@ function Lh({ tasks: e, outcomes: t }) {
|
|
|
8978
8978
|
}
|
|
8979
8979
|
return { updatedTasks: o, failures: r, skippedCount: s };
|
|
8980
8980
|
}
|
|
8981
|
-
async function
|
|
8981
|
+
async function Fm(e, t) {
|
|
8982
8982
|
if (!e.some((o) => ne(o.projectId)))
|
|
8983
8983
|
return {};
|
|
8984
8984
|
try {
|
|
@@ -9003,7 +9003,7 @@ async function Jr({
|
|
|
9003
9003
|
}
|
|
9004
9004
|
return { states: o, readFailed: !1 };
|
|
9005
9005
|
}
|
|
9006
|
-
function
|
|
9006
|
+
function Hm({
|
|
9007
9007
|
id: e,
|
|
9008
9008
|
current: t,
|
|
9009
9009
|
readFailed: o
|
|
@@ -9013,7 +9013,7 @@ function Hh({
|
|
|
9013
9013
|
if (t?.due?.isRecurring)
|
|
9014
9014
|
return `Task ${e} recurs ("${t.due.string}"). dueString would replace that rule and make it a one-time task, so nothing was changed. To move it to another date or time, use ${b.RESCHEDULE_TASKS} (it also accepts duration). To change or drop the recurrence on purpose, resend with replaceRecurrence: true.`;
|
|
9015
9015
|
}
|
|
9016
|
-
async function
|
|
9016
|
+
async function Wm({
|
|
9017
9017
|
client: e,
|
|
9018
9018
|
moving: t,
|
|
9019
9019
|
results: o,
|
|
@@ -9023,7 +9023,7 @@ async function Wh({
|
|
|
9023
9023
|
return;
|
|
9024
9024
|
const s = /* @__PURE__ */ new Map();
|
|
9025
9025
|
for (const c of t) {
|
|
9026
|
-
const d =
|
|
9026
|
+
const d = Dm(c.move), u = s.get(d);
|
|
9027
9027
|
u ? u.push(c) : s.set(d, [c]);
|
|
9028
9028
|
}
|
|
9029
9029
|
const a = Ks(e), i = [];
|
|
@@ -9039,12 +9039,12 @@ async function Wh({
|
|
|
9039
9039
|
}
|
|
9040
9040
|
const p = await a(
|
|
9041
9041
|
() => C(() => e.moveTasks(d, u))
|
|
9042
|
-
), f = new Map(p.map((g) => [g.id, g])),
|
|
9042
|
+
), f = new Map(p.map((g) => [g.id, g])), m = [], h = [];
|
|
9043
9043
|
for (const g of c) {
|
|
9044
9044
|
const y = f.get(g.item.id);
|
|
9045
|
-
y ? (o.set(g.item.index, { task: y }),
|
|
9045
|
+
y ? (o.set(g.item.index, { task: y }), h.push(g)) : m.push(g);
|
|
9046
9046
|
}
|
|
9047
|
-
r(
|
|
9047
|
+
r(h), m.length > 0 && i.push({ group: m, destination: u });
|
|
9048
9048
|
} catch (p) {
|
|
9049
9049
|
if (l) {
|
|
9050
9050
|
o.set(l.item.index, {
|
|
@@ -9057,12 +9057,12 @@ async function Wh({
|
|
|
9057
9057
|
}
|
|
9058
9058
|
}
|
|
9059
9059
|
if (i.length > 0) {
|
|
9060
|
-
await
|
|
9060
|
+
await Bm({ client: e, unresolved: i, results: o });
|
|
9061
9061
|
for (const { group: c } of i)
|
|
9062
9062
|
r(c);
|
|
9063
9063
|
}
|
|
9064
9064
|
}
|
|
9065
|
-
async function
|
|
9065
|
+
async function Bm({
|
|
9066
9066
|
client: e,
|
|
9067
9067
|
unresolved: t,
|
|
9068
9068
|
results: o
|
|
@@ -9070,22 +9070,22 @@ async function Bh({
|
|
|
9070
9070
|
const r = [...new Set(t.flatMap(({ group: i }) => i.map(({ item: c }) => c.id)))], { states: s, rateLimit: a } = await Jr({ client: e, ids: r });
|
|
9071
9071
|
for (const { group: i, destination: c, error: d } of t) {
|
|
9072
9072
|
const u = J(d), l = [u?.retryAfterSeconds, a?.retryAfterSeconds].filter(
|
|
9073
|
-
(
|
|
9073
|
+
(h) => h !== void 0
|
|
9074
9074
|
), p = u || a, f = p && {
|
|
9075
9075
|
...p,
|
|
9076
9076
|
...l.length ? { retryAfterSeconds: Math.max(...l) } : {}
|
|
9077
|
-
},
|
|
9078
|
-
for (const { item:
|
|
9079
|
-
const g = s.get(
|
|
9077
|
+
}, m = d === void 0 ? "Task not returned by the move" : L(d);
|
|
9078
|
+
for (const { item: h } of i) {
|
|
9079
|
+
const g = s.get(h.id);
|
|
9080
9080
|
if (g && Yr(g, c)) {
|
|
9081
|
-
o.set(
|
|
9081
|
+
o.set(h.index, { task: g });
|
|
9082
9082
|
continue;
|
|
9083
9083
|
}
|
|
9084
|
-
o.set(
|
|
9084
|
+
o.set(h.index, { error: m, rateLimit: f });
|
|
9085
9085
|
}
|
|
9086
9086
|
}
|
|
9087
9087
|
}
|
|
9088
|
-
async function
|
|
9088
|
+
async function Km({
|
|
9089
9089
|
client: e,
|
|
9090
9090
|
items: t,
|
|
9091
9091
|
onUpdated: o,
|
|
@@ -9105,7 +9105,7 @@ async function Kh({
|
|
|
9105
9105
|
})
|
|
9106
9106
|
);
|
|
9107
9107
|
}
|
|
9108
|
-
async function
|
|
9108
|
+
async function zm({
|
|
9109
9109
|
task: e,
|
|
9110
9110
|
index: t,
|
|
9111
9111
|
client: o,
|
|
@@ -9121,47 +9121,47 @@ async function zh({
|
|
|
9121
9121
|
responsibleUser: l,
|
|
9122
9122
|
priority: p,
|
|
9123
9123
|
labels: f,
|
|
9124
|
-
deadlineDate:
|
|
9125
|
-
replaceRecurrence:
|
|
9124
|
+
deadlineDate: m,
|
|
9125
|
+
replaceRecurrence: h,
|
|
9126
9126
|
...g
|
|
9127
9127
|
} = e;
|
|
9128
9128
|
if (ne(a) && r.error !== void 0)
|
|
9129
9129
|
throw r.error;
|
|
9130
9130
|
const y = ne(a) ? r.projectId : a;
|
|
9131
|
-
let
|
|
9131
|
+
let I = {
|
|
9132
9132
|
...g,
|
|
9133
9133
|
...f !== void 0 && { labels: f }
|
|
9134
9134
|
};
|
|
9135
|
-
p && (
|
|
9136
|
-
const w =
|
|
9135
|
+
p && (I.priority = no(p));
|
|
9136
|
+
const w = kn(
|
|
9137
9137
|
d,
|
|
9138
|
-
|
|
9138
|
+
Um,
|
|
9139
9139
|
vn
|
|
9140
9140
|
);
|
|
9141
|
-
w !== void 0 && (
|
|
9142
|
-
const v =
|
|
9143
|
-
if (v !== void 0 && (
|
|
9144
|
-
const { amount:
|
|
9145
|
-
|
|
9146
|
-
}
|
|
9147
|
-
return l !== void 0 && (
|
|
9148
|
-
...
|
|
9149
|
-
assigneeId: await
|
|
9141
|
+
w !== void 0 && (I = { ...I, dueString: w });
|
|
9142
|
+
const v = kn(m, Rm, null);
|
|
9143
|
+
if (v !== void 0 && (I = { ...I, deadlineDate: v }), u) {
|
|
9144
|
+
const { amount: k, unit: $ } = to(`Task ${s}`, u);
|
|
9145
|
+
I = { ...I, duration: k, durationUnit: $ };
|
|
9146
|
+
}
|
|
9147
|
+
return l !== void 0 && (I = {
|
|
9148
|
+
...I,
|
|
9149
|
+
assigneeId: await qm(o, s, l)
|
|
9150
9150
|
}), {
|
|
9151
9151
|
index: t,
|
|
9152
9152
|
id: s,
|
|
9153
|
-
updateArgs:
|
|
9153
|
+
updateArgs: I,
|
|
9154
9154
|
moveRequest: {
|
|
9155
9155
|
projectId: y,
|
|
9156
9156
|
sectionId: i,
|
|
9157
9157
|
parentId: c
|
|
9158
9158
|
},
|
|
9159
9159
|
redundantMoveSkipped: !1,
|
|
9160
|
-
checkRecurrence: w !== void 0 && w !== vn &&
|
|
9160
|
+
checkRecurrence: w !== void 0 && w !== vn && h !== !0,
|
|
9161
9161
|
failed: !1
|
|
9162
9162
|
};
|
|
9163
9163
|
}
|
|
9164
|
-
async function
|
|
9164
|
+
async function qm(e, t, o) {
|
|
9165
9165
|
if (o === null || o === "unassign")
|
|
9166
9166
|
return null;
|
|
9167
9167
|
const r = await vo.validateTaskUpdateAssignment(
|
|
@@ -9175,7 +9175,7 @@ async function Gh(e, t, o) {
|
|
|
9175
9175
|
}
|
|
9176
9176
|
return r.resolvedUser?.userId;
|
|
9177
9177
|
}
|
|
9178
|
-
function
|
|
9178
|
+
function Gm({
|
|
9179
9179
|
tasks: e,
|
|
9180
9180
|
failures: t,
|
|
9181
9181
|
skippedCount: o,
|
|
@@ -9196,14 +9196,14 @@ function qh({
|
|
|
9196
9196
|
Failed (${t.length}) - address or drop these items:
|
|
9197
9197
|
${u}${l}`;
|
|
9198
9198
|
}
|
|
9199
|
-
function
|
|
9199
|
+
function Ym({
|
|
9200
9200
|
id: e,
|
|
9201
9201
|
replaceRecurrence: t,
|
|
9202
9202
|
...o
|
|
9203
9203
|
}) {
|
|
9204
9204
|
return Object.keys(o).length > 0;
|
|
9205
9205
|
}
|
|
9206
|
-
function
|
|
9206
|
+
function kn(e, t, o) {
|
|
9207
9207
|
if (e === void 0)
|
|
9208
9208
|
return e;
|
|
9209
9209
|
if (e === null)
|
|
@@ -9211,7 +9211,7 @@ function In(e, t, o) {
|
|
|
9211
9211
|
const r = e.trim().toLowerCase();
|
|
9212
9212
|
return t.includes(r) ? o : e;
|
|
9213
9213
|
}
|
|
9214
|
-
const
|
|
9214
|
+
const Vm = {
|
|
9215
9215
|
templateId: n.string().regex(ct).describe('A saved template ID ("UT_28Ex...") or its Todoist URL.'),
|
|
9216
9216
|
name: n.string().trim().min(1).optional(),
|
|
9217
9217
|
description: n.string().trim().min(1).optional(),
|
|
@@ -9228,16 +9228,16 @@ const Vh = {
|
|
|
9228
9228
|
sharedWithWorkspaceMembers: n.boolean().optional().describe(
|
|
9229
9229
|
"Share a workspace template with its members, or stop sharing it. Only the author can change this."
|
|
9230
9230
|
)
|
|
9231
|
-
},
|
|
9231
|
+
}, Jm = {
|
|
9232
9232
|
templateId: n.string(),
|
|
9233
9233
|
name: n.string(),
|
|
9234
9234
|
workspaceId: n.string().optional().describe("Absent for personal templates."),
|
|
9235
9235
|
sharedWithWorkspaceMembers: n.boolean()
|
|
9236
|
-
},
|
|
9236
|
+
}, Xm = {
|
|
9237
9237
|
name: b.UPDATE_TEMPLATE,
|
|
9238
9238
|
description: "Update a saved Todoist template: rename it, change its description or color, edit its content (layout, sections, tasks, comments) or replace it from a project, move it into a workspace, or share it with workspace members. Omitted fields stay unchanged. Gallery templates cannot be edited.",
|
|
9239
|
-
parameters:
|
|
9240
|
-
outputSchema:
|
|
9239
|
+
parameters: Vm,
|
|
9240
|
+
outputSchema: Jm,
|
|
9241
9241
|
// Destructive: replacing the content overwrites it, and unsharing removes members' access.
|
|
9242
9242
|
// Open world: sharing shows the template to other workspace members.
|
|
9243
9243
|
annotations: {
|
|
@@ -9280,7 +9280,7 @@ const Vh = {
|
|
|
9280
9280
|
const l = a ? jr(a) : void 0, [p, f] = await Promise.all([
|
|
9281
9281
|
l ? Sn(d, u, "before") : void 0,
|
|
9282
9282
|
i ? be.resolveWorkspace(d, i).then((w) => w.workspaceId) : void 0
|
|
9283
|
-
]),
|
|
9283
|
+
]), m = await d.updateTemplate(u, {
|
|
9284
9284
|
name: t,
|
|
9285
9285
|
description: o,
|
|
9286
9286
|
color: r,
|
|
@@ -9288,24 +9288,24 @@ const Vh = {
|
|
|
9288
9288
|
content: l,
|
|
9289
9289
|
workspaceId: f,
|
|
9290
9290
|
sharedWithWorkspaceMembers: c
|
|
9291
|
-
}),
|
|
9292
|
-
let
|
|
9291
|
+
}), h = m.workspaceId ?? void 0, g = m.sharedWithWorkspaceMembers ?? !1, y = h ? ` It is in workspace (id=${h}) and ${g ? "shared with" : "not shared with"} its members.` : " It is a personal template.";
|
|
9292
|
+
let I = "";
|
|
9293
9293
|
if (l) {
|
|
9294
9294
|
const w = await Sn(d, u, "after");
|
|
9295
9295
|
if (!w)
|
|
9296
|
-
|
|
9296
|
+
I = " The content was saved, but could not be read back to compare.";
|
|
9297
9297
|
else {
|
|
9298
|
-
|
|
9298
|
+
I = p ? ` Content: ${Nc(p, w)}.` : " The previous content could not be read, so the change is not reported.";
|
|
9299
9299
|
const v = Mc(l, w);
|
|
9300
|
-
v && (
|
|
9300
|
+
v && (I += ` Not everything sent was kept: ${v}.`);
|
|
9301
9301
|
}
|
|
9302
9302
|
}
|
|
9303
9303
|
return {
|
|
9304
|
-
textContent: `Updated template "${
|
|
9304
|
+
textContent: `Updated template "${m.name}" (id=${m.id}).${y}${I}`,
|
|
9305
9305
|
structuredContent: {
|
|
9306
|
-
templateId:
|
|
9307
|
-
name:
|
|
9308
|
-
workspaceId:
|
|
9306
|
+
templateId: m.id,
|
|
9307
|
+
name: m.name,
|
|
9308
|
+
workspaceId: h,
|
|
9309
9309
|
sharedWithWorkspaceMembers: g
|
|
9310
9310
|
}
|
|
9311
9311
|
};
|
|
@@ -9321,7 +9321,7 @@ async function Sn(e, t, o) {
|
|
|
9321
9321
|
return;
|
|
9322
9322
|
}
|
|
9323
9323
|
}
|
|
9324
|
-
const
|
|
9324
|
+
const Zm = {}, Qm = {
|
|
9325
9325
|
type: n.literal("user_info").describe("The type of the response."),
|
|
9326
9326
|
userId: n.string().describe("The user ID."),
|
|
9327
9327
|
fullName: n.string().describe("The full name of the user."),
|
|
@@ -9338,18 +9338,18 @@ const Zh = {}, Qh = {
|
|
|
9338
9338
|
email: n.string().describe("The email address of the user."),
|
|
9339
9339
|
plan: n.enum(["Todoist Free", "Todoist Pro", "Todoist Business"]).describe("The user plan.")
|
|
9340
9340
|
};
|
|
9341
|
-
function
|
|
9341
|
+
function eh(e) {
|
|
9342
9342
|
return e.businessAccountId ? "Todoist Business" : e.isPremium ? "Todoist Pro" : "Todoist Free";
|
|
9343
9343
|
}
|
|
9344
|
-
function
|
|
9344
|
+
function th(e, t) {
|
|
9345
9345
|
const r = ((e.getDay() || 7) - t + 7) % 7, s = new Date(e);
|
|
9346
9346
|
return s.setDate(e.getDate() - r), s;
|
|
9347
9347
|
}
|
|
9348
|
-
function
|
|
9348
|
+
function oh(e) {
|
|
9349
9349
|
const t = new Date(e);
|
|
9350
9350
|
return t.setDate(e.getDate() + 6), t;
|
|
9351
9351
|
}
|
|
9352
|
-
function
|
|
9352
|
+
function nh(e) {
|
|
9353
9353
|
const t = Date.UTC(
|
|
9354
9354
|
e.getFullYear(),
|
|
9355
9355
|
e.getMonth(),
|
|
@@ -9357,10 +9357,10 @@ function nm(e) {
|
|
|
9357
9357
|
), o = new Date(t).getUTCFullYear(), r = (t - Date.UTC(o, 0, 1)) / 864e5;
|
|
9358
9358
|
return Math.floor(r / 7) + 1;
|
|
9359
9359
|
}
|
|
9360
|
-
function
|
|
9360
|
+
function rh(e) {
|
|
9361
9361
|
return ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"][e === 7 ? 0 : e] ?? "Unknown";
|
|
9362
9362
|
}
|
|
9363
|
-
function
|
|
9363
|
+
function sh(e) {
|
|
9364
9364
|
try {
|
|
9365
9365
|
return new Intl.DateTimeFormat("en-US", { timeZone: e }), !0;
|
|
9366
9366
|
} catch {
|
|
@@ -9368,9 +9368,9 @@ function sm(e) {
|
|
|
9368
9368
|
}
|
|
9369
9369
|
}
|
|
9370
9370
|
function Xr(e) {
|
|
9371
|
-
return
|
|
9371
|
+
return sh(e) ? e : "UTC";
|
|
9372
9372
|
}
|
|
9373
|
-
function
|
|
9373
|
+
function ah(e, t) {
|
|
9374
9374
|
const o = Xr(t);
|
|
9375
9375
|
return e.toLocaleString("en-US", {
|
|
9376
9376
|
timeZone: o,
|
|
@@ -9383,8 +9383,8 @@ function am(e, t) {
|
|
|
9383
9383
|
hour12: !1
|
|
9384
9384
|
});
|
|
9385
9385
|
}
|
|
9386
|
-
async function
|
|
9387
|
-
const t = await e.getUser(), o = t.tzInfo?.timezone ?? "UTC", r = Xr(o), s = /* @__PURE__ */ new Date(), a =
|
|
9386
|
+
async function ih(e) {
|
|
9387
|
+
const t = await e.getUser(), o = t.tzInfo?.timezone ?? "UTC", r = Xr(o), s = /* @__PURE__ */ new Date(), a = ah(s, r), i = t.startDay ?? 1, c = rh(i), d = eh(t), u = new Date(s.toLocaleString("en-US", { timeZone: r })), l = th(u, i), p = oh(l), f = nh(l), h = [
|
|
9388
9388
|
"# User Information",
|
|
9389
9389
|
"",
|
|
9390
9390
|
`**User ID:** ${t.id}`,
|
|
@@ -9424,28 +9424,28 @@ async function im(e) {
|
|
|
9424
9424
|
email: t.email,
|
|
9425
9425
|
plan: d
|
|
9426
9426
|
};
|
|
9427
|
-
return { textContent:
|
|
9427
|
+
return { textContent: h, structuredContent: g };
|
|
9428
9428
|
}
|
|
9429
|
-
const
|
|
9429
|
+
const ch = {
|
|
9430
9430
|
name: b.USER_INFO,
|
|
9431
9431
|
description: "Get comprehensive user information including user ID, full name, email, timezone with current local time, week start day preferences, current week dates, daily/weekly goal progress, and user plan (Free/Pro/Business).",
|
|
9432
|
-
parameters:
|
|
9433
|
-
outputSchema:
|
|
9432
|
+
parameters: Zm,
|
|
9433
|
+
outputSchema: Qm,
|
|
9434
9434
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
9435
9435
|
async execute(e, t) {
|
|
9436
|
-
const o = await
|
|
9436
|
+
const o = await ih(t);
|
|
9437
9437
|
return {
|
|
9438
9438
|
textContent: o.textContent,
|
|
9439
9439
|
structuredContent: o.structuredContent
|
|
9440
9440
|
};
|
|
9441
9441
|
}
|
|
9442
|
-
}, Cn = 10 * 1024 * 1024,
|
|
9442
|
+
}, Cn = 10 * 1024 * 1024, dh = /* @__PURE__ */ new Set([
|
|
9443
9443
|
"image/png",
|
|
9444
9444
|
"image/jpeg",
|
|
9445
9445
|
"image/gif",
|
|
9446
9446
|
"image/webp",
|
|
9447
9447
|
"image/svg+xml"
|
|
9448
|
-
]),
|
|
9448
|
+
]), lh = /* @__PURE__ */ new Set([
|
|
9449
9449
|
"text/plain",
|
|
9450
9450
|
"text/csv",
|
|
9451
9451
|
"text/html",
|
|
@@ -9453,7 +9453,7 @@ const cm = {
|
|
|
9453
9453
|
"application/json",
|
|
9454
9454
|
"application/xml",
|
|
9455
9455
|
"text/xml"
|
|
9456
|
-
]),
|
|
9456
|
+
]), uh = {
|
|
9457
9457
|
".png": "image/png",
|
|
9458
9458
|
".jpg": "image/jpeg",
|
|
9459
9459
|
".jpeg": "image/jpeg",
|
|
@@ -9468,23 +9468,23 @@ const cm = {
|
|
|
9468
9468
|
".xml": "application/xml",
|
|
9469
9469
|
".pdf": "application/pdf"
|
|
9470
9470
|
};
|
|
9471
|
-
function
|
|
9472
|
-
return
|
|
9471
|
+
function ph(e) {
|
|
9472
|
+
return dh.has(e) ? "image" : lh.has(e) || e.startsWith("text/") ? "text" : "binary";
|
|
9473
9473
|
}
|
|
9474
|
-
function
|
|
9474
|
+
function mh(e) {
|
|
9475
9475
|
return (e.split(";")[0] ?? e).trim().toLowerCase();
|
|
9476
9476
|
}
|
|
9477
|
-
function
|
|
9477
|
+
function hh(e) {
|
|
9478
9478
|
try {
|
|
9479
9479
|
const t = new URL(e).pathname, o = t.lastIndexOf(".");
|
|
9480
9480
|
if (o === -1) return;
|
|
9481
9481
|
const r = t.slice(o).toLowerCase();
|
|
9482
|
-
return
|
|
9482
|
+
return uh[r];
|
|
9483
9483
|
} catch {
|
|
9484
9484
|
return;
|
|
9485
9485
|
}
|
|
9486
9486
|
}
|
|
9487
|
-
function
|
|
9487
|
+
function fh(e) {
|
|
9488
9488
|
try {
|
|
9489
9489
|
const t = new URL(e).pathname, o = t.lastIndexOf("/");
|
|
9490
9490
|
return o === -1 ? void 0 : t.slice(o + 1) || void 0;
|
|
@@ -9492,23 +9492,23 @@ function fm(e) {
|
|
|
9492
9492
|
return;
|
|
9493
9493
|
}
|
|
9494
9494
|
}
|
|
9495
|
-
const
|
|
9496
|
-
fileUrl: n.url().regex(
|
|
9495
|
+
const gh = /^https:\/\/(?:files\.todoist\.com|todoist\.b-cdn\.net|d1ysz50cxb9zwl\.cloudfront\.net)\/\S*$/, bh = {
|
|
9496
|
+
fileUrl: n.url().regex(gh, {
|
|
9497
9497
|
error: "Pass the fileUrl from a comment's fileAttachment: an https URL on files.todoist.com, todoist.b-cdn.net or d1ysz50cxb9zwl.cloudfront.net."
|
|
9498
9498
|
}).describe(
|
|
9499
9499
|
"The URL of the attachment file to view. Get this from the fileUrl field in a comment's fileAttachment."
|
|
9500
9500
|
)
|
|
9501
|
-
},
|
|
9501
|
+
}, yh = {
|
|
9502
9502
|
name: b.VIEW_ATTACHMENT,
|
|
9503
9503
|
description: "View a file attachment from a Todoist comment. Pass the fileUrl from a comment's fileAttachment field. Supports images (returned inline), text files (returned as text), and binary files like PDFs (returned as embedded resources).",
|
|
9504
|
-
parameters:
|
|
9504
|
+
parameters: bh,
|
|
9505
9505
|
annotations: {
|
|
9506
9506
|
readOnlyHint: !0,
|
|
9507
9507
|
destructiveHint: !1,
|
|
9508
9508
|
idempotentHint: !0
|
|
9509
9509
|
},
|
|
9510
9510
|
async execute({ fileUrl: e }, t) {
|
|
9511
|
-
const o = await t.viewAttachment(e), r = o.headers["content-length"], s = r ? Number.parseInt(r, 10) : void 0, a =
|
|
9511
|
+
const o = await t.viewAttachment(e), r = o.headers["content-length"], s = r ? Number.parseInt(r, 10) : void 0, a = fh(e), i = o.headers["content-type"], c = i ? mh(i) : void 0, d = c && c !== "application/octet-stream" ? c : hh(e) ?? c ?? "application/octet-stream";
|
|
9512
9512
|
if (s && s > Cn)
|
|
9513
9513
|
return {
|
|
9514
9514
|
textContent: `Attachment "${a ?? e}" is too large to display inline (${(s / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
|
|
@@ -9518,7 +9518,7 @@ const gm = /^https:\/\/(?:files\.todoist\.com|todoist\.b-cdn\.net|d1ysz50cxb9zwl
|
|
|
9518
9518
|
return {
|
|
9519
9519
|
textContent: `Attachment "${a ?? e}" is too large to display inline (${(l / 1024 / 1024).toFixed(1)}MB, limit is 10MB). File type: ${d}`
|
|
9520
9520
|
};
|
|
9521
|
-
const p =
|
|
9521
|
+
const p = ph(d), f = [];
|
|
9522
9522
|
return p === "image" ? f.push({
|
|
9523
9523
|
type: "image",
|
|
9524
9524
|
data: u.toString("base64"),
|
|
@@ -9538,28 +9538,28 @@ const gm = /^https:\/\/(?:files\.todoist\.com|todoist\.b-cdn\.net|d1ysz50cxb9zwl
|
|
|
9538
9538
|
contentItems: f
|
|
9539
9539
|
};
|
|
9540
9540
|
}
|
|
9541
|
-
},
|
|
9541
|
+
}, wh = {
|
|
9542
9542
|
...xl,
|
|
9543
9543
|
_meta: {
|
|
9544
9544
|
ui: {
|
|
9545
9545
|
resourceUri: At
|
|
9546
9546
|
}
|
|
9547
9547
|
}
|
|
9548
|
-
},
|
|
9548
|
+
}, Th = {
|
|
9549
9549
|
// Task management tools
|
|
9550
9550
|
addTasks: Ac,
|
|
9551
9551
|
completeTasks: Jc,
|
|
9552
9552
|
uncompleteTasks: Up,
|
|
9553
|
-
updateTasks:
|
|
9553
|
+
updateTasks: Mm,
|
|
9554
9554
|
rescheduleTasks: gp,
|
|
9555
9555
|
findTasks: Wl,
|
|
9556
|
-
findTasksByDate:
|
|
9556
|
+
findTasksByDate: wh,
|
|
9557
9557
|
findCompletedTasks: Kd,
|
|
9558
9558
|
// Project management tools
|
|
9559
9559
|
addProjects: sc,
|
|
9560
|
-
updateProjects:
|
|
9561
|
-
findProjects:
|
|
9562
|
-
projectManagement:
|
|
9560
|
+
updateProjects: hm,
|
|
9561
|
+
findProjects: hl,
|
|
9562
|
+
projectManagement: Gu,
|
|
9563
9563
|
projectMove: Xu,
|
|
9564
9564
|
// Folder management tools
|
|
9565
9565
|
addFolders: Ki,
|
|
@@ -9567,40 +9567,40 @@ const gm = /^https:\/\/(?:files\.todoist\.com|todoist\.b-cdn\.net|d1ysz50cxb9zwl
|
|
|
9567
9567
|
findFolders: Zd,
|
|
9568
9568
|
// Section management tools
|
|
9569
9569
|
addSections: Sc,
|
|
9570
|
-
updateSections: $
|
|
9570
|
+
updateSections: $m,
|
|
9571
9571
|
findSections: Cl,
|
|
9572
9572
|
// Comment management tools
|
|
9573
|
-
addComments:
|
|
9573
|
+
addComments: Ii,
|
|
9574
9574
|
findComments: Ud,
|
|
9575
9575
|
updateComments: Hp,
|
|
9576
9576
|
// Reminder management tools
|
|
9577
9577
|
addReminders: wc,
|
|
9578
9578
|
findReminders: Tl,
|
|
9579
|
-
updateReminders:
|
|
9579
|
+
updateReminders: km,
|
|
9580
9580
|
// Attachment tools
|
|
9581
|
-
viewAttachment:
|
|
9581
|
+
viewAttachment: yh,
|
|
9582
9582
|
// Label management tools
|
|
9583
9583
|
addLabels: Vi,
|
|
9584
|
-
updateLabels:
|
|
9584
|
+
updateLabels: im,
|
|
9585
9585
|
findLabels: nl,
|
|
9586
9586
|
// Filter management tools
|
|
9587
9587
|
findFilters: Ai,
|
|
9588
9588
|
addFilters: Pi,
|
|
9589
|
-
updateFilters:
|
|
9589
|
+
updateFilters: qp,
|
|
9590
9590
|
// Activity and audit tools
|
|
9591
9591
|
findActivity: Sd,
|
|
9592
9592
|
getProductivityStats: lu,
|
|
9593
9593
|
// Health and insights tools
|
|
9594
9594
|
getProjectHealth: wu,
|
|
9595
9595
|
getProjectActivityStats: fu,
|
|
9596
|
-
analyzeProjectHealth:
|
|
9596
|
+
analyzeProjectHealth: Gc,
|
|
9597
9597
|
getWorkspaceInsights: Eu,
|
|
9598
9598
|
// General tools
|
|
9599
9599
|
getOverview: iu,
|
|
9600
9600
|
deleteObject: nd,
|
|
9601
9601
|
fetchObject: gd,
|
|
9602
9602
|
reorderObjects: ap,
|
|
9603
|
-
userInfo:
|
|
9603
|
+
userInfo: ch,
|
|
9604
9604
|
getUserStatus: Su,
|
|
9605
9605
|
setUserStatus: Op,
|
|
9606
9606
|
// Assignment and collaboration tools
|
|
@@ -9611,34 +9611,23 @@ const gm = /^https:\/\/(?:files\.todoist\.com|todoist\.b-cdn\.net|d1ysz50cxb9zwl
|
|
|
9611
9611
|
importIntoProject: Ou,
|
|
9612
9612
|
addTemplate: Hc,
|
|
9613
9613
|
findTemplates: Jl,
|
|
9614
|
-
updateTemplate:
|
|
9614
|
+
updateTemplate: Xm,
|
|
9615
9615
|
// Workspace tools
|
|
9616
9616
|
listWorkspaces: Nu,
|
|
9617
9617
|
// OpenAI MCP tools
|
|
9618
|
-
search:
|
|
9618
|
+
search: kp,
|
|
9619
9619
|
fetch: Td
|
|
9620
|
-
},
|
|
9621
|
-
## Todoist
|
|
9620
|
+
}, vh = Object.values(Th), Ih = `
|
|
9621
|
+
## Todoist
|
|
9622
9622
|
|
|
9623
|
-
|
|
9624
|
-
|
|
9625
|
-
### Core Capabilities:
|
|
9626
|
-
- Create, update, complete, and search tasks with rich metadata (priorities, due dates, durations, assignments)
|
|
9627
|
-
- Manage projects and sections with flexible organization
|
|
9628
|
-
- Handle comments and collaboration features
|
|
9629
|
-
- Bulk assignment operations for team workflows
|
|
9630
|
-
- Get overviews and insights about workload and progress
|
|
9631
|
-
|
|
9632
|
-
### Choosing between tools
|
|
9633
|
-
|
|
9634
|
-
What each tool does and how to fill its parameters is in the tool's own description and input schema. This section covers only what those cannot: which tool to reach for, and how tools relate to each other.
|
|
9623
|
+
Manage Todoist: create, update, complete and search tasks (priorities, dates, durations, assignees, labels); organise projects, sections and folders, personal or in workspaces; comments and attachments, filters, reminders, templates, collaborators, user status, activity, overviews and productivity stats.
|
|
9635
9624
|
|
|
9636
9625
|
**Dates**
|
|
9637
9626
|
|
|
9638
9627
|
- To move a task to a different date or time use **reschedule-tasks**, never **update-tasks**. It also sets duration, for time-blocking. update-tasks replaces the whole due string, so it refuses a dueString on a recurring task unless replaceRecurrence is true.
|
|
9639
9628
|
- Never send a task's existing projectId, sectionId or parentId back to **update-tasks** — those fields are treated as a move.
|
|
9640
9629
|
- All dates respect the user's timezone.
|
|
9641
|
-
- Todoist apps
|
|
9630
|
+
- Todoist apps show no duration of 24 hours or more ("36h", "3d"), though it is stored: only set one when the user explicitly asks for it.
|
|
9642
9631
|
|
|
9643
9632
|
**Finding things**
|
|
9644
9633
|
|
|
@@ -9670,25 +9659,23 @@ What each tool does and how to fill its parameters is in the tool's own descript
|
|
|
9670
9659
|
**Batches**
|
|
9671
9660
|
|
|
9672
9661
|
- Prefer a batch tool over one call per item.
|
|
9673
|
-
- Where a batch tool returns per-item \`failures\` alongside successes, one failure does not undo the rest: never retry the whole batch, re-send only the items whose failure reason is fixable.
|
|
9662
|
+
- Where a batch tool returns per-item \`failures\` alongside successes, one failure does not undo the rest: never retry the whole batch, re-send only the items whose failure reason is fixable.
|
|
9674
9663
|
|
|
9675
9664
|
For a productivity review, call **get-productivity-stats**, then find what the user completed as described under "Finding things".
|
|
9676
|
-
|
|
9677
|
-
|
|
9678
|
-
`, Re = { ttlMs: Vt, cacheScope: "private" };
|
|
9679
|
-
function Lm({
|
|
9665
|
+
`, Re = { ttlMs: Vt, cacheScope: "private" }, kh = "The official Todoist MCP server. Add, update, schedule, complete and search tasks, with priorities, due dates, deadlines, durations, labels and assignees. Organise projects, sections and folders, personal or in a workspace. Add, edit and read comments and view their attachments, and manage labels, saved filters, reminders and templates. Find collaborators, check or set your status, and review activity, project health and productivity stats.";
|
|
9666
|
+
function Fh({
|
|
9680
9667
|
token: e,
|
|
9681
9668
|
baseUrl: t,
|
|
9682
9669
|
features: o = []
|
|
9683
9670
|
}) {
|
|
9684
9671
|
const r = new ts(
|
|
9685
|
-
{ name: "todoist-mcp-server", version: Zt },
|
|
9672
|
+
{ name: "todoist-mcp-server", version: Zt, description: kh },
|
|
9686
9673
|
{
|
|
9687
9674
|
capabilities: {
|
|
9688
9675
|
tools: { listChanged: !0 },
|
|
9689
9676
|
prompts: { listChanged: !0 }
|
|
9690
9677
|
},
|
|
9691
|
-
instructions:
|
|
9678
|
+
instructions: Ih,
|
|
9692
9679
|
cacheHints: {
|
|
9693
9680
|
"server/discover": Re,
|
|
9694
9681
|
"tools/list": Re,
|
|
@@ -9698,7 +9685,7 @@ function Lm({
|
|
|
9698
9685
|
}
|
|
9699
9686
|
}
|
|
9700
9687
|
), s = na(e, { baseUrl: t });
|
|
9701
|
-
return Da(r), va({ tools:
|
|
9688
|
+
return Da(r), va({ tools: vh, server: r, client: s, features: o }), r.registerPrompt(
|
|
9702
9689
|
Ue.name,
|
|
9703
9690
|
{
|
|
9704
9691
|
title: Ue.title,
|
|
@@ -9709,13 +9696,13 @@ function Lm({
|
|
|
9709
9696
|
), r;
|
|
9710
9697
|
}
|
|
9711
9698
|
export {
|
|
9712
|
-
|
|
9699
|
+
km as $,
|
|
9713
9700
|
Wl as A,
|
|
9714
9701
|
xl as B,
|
|
9715
9702
|
Jl as C,
|
|
9716
|
-
|
|
9703
|
+
Fh as D,
|
|
9717
9704
|
iu as E,
|
|
9718
|
-
|
|
9705
|
+
Lh as F,
|
|
9719
9706
|
lu as G,
|
|
9720
9707
|
fu as H,
|
|
9721
9708
|
wu as I,
|
|
@@ -9724,26 +9711,26 @@ export {
|
|
|
9724
9711
|
Ou as L,
|
|
9725
9712
|
Nu as M,
|
|
9726
9713
|
Wu as N,
|
|
9727
|
-
|
|
9714
|
+
Gu as O,
|
|
9728
9715
|
Xu as P,
|
|
9729
|
-
|
|
9716
|
+
vh as Q,
|
|
9730
9717
|
ap as R,
|
|
9731
9718
|
gp as S,
|
|
9732
|
-
|
|
9719
|
+
kp as T,
|
|
9733
9720
|
Op as U,
|
|
9734
9721
|
Up as V,
|
|
9735
9722
|
Hp as W,
|
|
9736
|
-
|
|
9723
|
+
qp as X,
|
|
9737
9724
|
Qp as Y,
|
|
9738
|
-
|
|
9739
|
-
|
|
9740
|
-
|
|
9741
|
-
$
|
|
9742
|
-
|
|
9743
|
-
|
|
9744
|
-
|
|
9745
|
-
|
|
9746
|
-
|
|
9725
|
+
im as Z,
|
|
9726
|
+
hm as _,
|
|
9727
|
+
Ii as a,
|
|
9728
|
+
$m as a0,
|
|
9729
|
+
Mm as a1,
|
|
9730
|
+
Xm as a2,
|
|
9731
|
+
ch as a3,
|
|
9732
|
+
yh as a4,
|
|
9733
|
+
Mh as a5,
|
|
9747
9734
|
Js as a6,
|
|
9748
9735
|
Pi as b,
|
|
9749
9736
|
Ki as c,
|
|
@@ -9753,7 +9740,7 @@ export {
|
|
|
9753
9740
|
Sc as g,
|
|
9754
9741
|
Ac as h,
|
|
9755
9742
|
Hc as i,
|
|
9756
|
-
|
|
9743
|
+
Gc as j,
|
|
9757
9744
|
Jc as k,
|
|
9758
9745
|
nd as l,
|
|
9759
9746
|
ad as m,
|
|
@@ -9763,11 +9750,11 @@ export {
|
|
|
9763
9750
|
Ud as q,
|
|
9764
9751
|
Kd as r,
|
|
9765
9752
|
Ai as s,
|
|
9766
|
-
|
|
9753
|
+
Th as t,
|
|
9767
9754
|
Zd as u,
|
|
9768
9755
|
nl as v,
|
|
9769
9756
|
il as w,
|
|
9770
|
-
|
|
9757
|
+
hl as x,
|
|
9771
9758
|
Tl as y,
|
|
9772
9759
|
Cl as z
|
|
9773
9760
|
};
|