@todoist/mcp 15.2.0 → 15.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/main-http.js +2 -2
- package/dist/main.js +1 -1
- package/dist/{mcp-server-BeFnFNew.js → mcp-server-CLrhTqvZ.js} +113 -122
- package/dist/{require-valid-todoist-token-BVhaOBRu.js → require-valid-todoist-token-BznH7HWr.js} +1 -1
- package/dist/tool-registry.d.ts +1 -1
- package/dist/tools/find-tasks-by-date.d.ts +1 -1
- package/dist/tools/find-tasks-by-date.d.ts.map +1 -1
- package/dist/tools/find-tasks.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as s } from "./mcp-server-
|
|
2
|
-
import { F as r, a as d, b as i, c as n, d as c, e as l, f as m, h as p, i as f, j as T, k as j, l as u, m as g, n as k, o as v, p as P, q as S, r as h, s as b, u as y, v as A, w as C, x as R, y as x, z as F, g as M, A as O, B as E, C as L, D as U, E as w, G as H, H as I, I as W, J as q, K as z, L as B, M as D, N, O as V, P as _, Q as G, R as J, S as K, T as Q, U as X, V as Y, W as Z, X as $, Y as ss, Z as as, _ as es } from "./mcp-server-
|
|
3
|
-
import { r as os, v as rs } from "./require-valid-todoist-token-
|
|
1
|
+
import { t as s } from "./mcp-server-CLrhTqvZ.js";
|
|
2
|
+
import { F as r, a as d, b as i, c as n, d as c, e as l, f as m, h as p, i as f, j as T, k as j, l as u, m as g, n as k, o as v, p as P, q as S, r as h, s as b, u as y, v as A, w as C, x as R, y as x, z as F, g as M, A as O, B as E, C as L, D as U, E as w, G as H, H as I, I as W, J as q, K as z, L as B, M as D, N, O as V, P as _, Q as G, R as J, S as K, T as Q, U as X, V as Y, W as Z, X as $, Y as ss, Z as as, _ as es } from "./mcp-server-CLrhTqvZ.js";
|
|
3
|
+
import { r as os, v as rs } from "./require-valid-todoist-token-BznH7HWr.js";
|
|
4
4
|
const e = s;
|
|
5
5
|
export {
|
|
6
6
|
r as FEATURE_NAMES,
|
package/dist/main-http.js
CHANGED
|
@@ -4,8 +4,8 @@ import S from "dotenv";
|
|
|
4
4
|
import { toNodeHandler as w } from "@modelcontextprotocol/node";
|
|
5
5
|
import { createMcpHandler as v } from "@modelcontextprotocol/server";
|
|
6
6
|
import h from "express";
|
|
7
|
-
import { g as I } from "./mcp-server-
|
|
8
|
-
import { r as g } from "./require-valid-todoist-token-
|
|
7
|
+
import { g as I } from "./mcp-server-CLrhTqvZ.js";
|
|
8
|
+
import { r as g } from "./require-valid-todoist-token-BznH7HWr.js";
|
|
9
9
|
function p(e) {
|
|
10
10
|
return e.startsWith("[") && e.endsWith("]") ? e.slice(1, -1) : e;
|
|
11
11
|
}
|
package/dist/main.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { serveStdio as t } from "@modelcontextprotocol/server/stdio";
|
|
3
3
|
import n from "dotenv";
|
|
4
|
-
import { g as s } from "./mcp-server-
|
|
4
|
+
import { g as s } from "./mcp-server-CLrhTqvZ.js";
|
|
5
5
|
function i() {
|
|
6
6
|
const o = process.env.TODOIST_BASE_URL, r = process.env.TODOIST_API_KEY;
|
|
7
7
|
if (!r)
|
|
@@ -440,7 +440,7 @@ function yr(e) {
|
|
|
440
440
|
const t = mt(e);
|
|
441
441
|
return t ? br(t) : Os(e);
|
|
442
442
|
}
|
|
443
|
-
const Tr = "15.2.
|
|
443
|
+
const Tr = "15.2.1", wr = {
|
|
444
444
|
version: Tr
|
|
445
445
|
};
|
|
446
446
|
function Ht(e, { queueTimeoutMs: t = Ze.QUEUE_WAIT_MS } = {}) {
|
|
@@ -1979,9 +1979,9 @@ const zn = o.object({
|
|
|
1979
1979
|
async function d({ notifyUsers: f }, g) {
|
|
1980
1980
|
if (f)
|
|
1981
1981
|
return Rn(f) ? [] : (await C(() => Gs(t, f))).map(($) => $.userId);
|
|
1982
|
-
const { id: w } = await n(),
|
|
1983
|
-
let k = c.get(
|
|
1984
|
-
return k || (k = Nn(t, g, w, a), c.set(
|
|
1982
|
+
const { id: w } = await n(), I = g.taskId ? `task:${g.taskId}` : `project:${g.projectId}`;
|
|
1983
|
+
let k = c.get(I);
|
|
1984
|
+
return k || (k = Nn(t, g, w, a), c.set(I, k)), await k;
|
|
1985
1985
|
}
|
|
1986
1986
|
const l = await Promise.allSettled(
|
|
1987
1987
|
s.map(async (f) => {
|
|
@@ -1992,14 +1992,14 @@ const zn = o.object({
|
|
|
1992
1992
|
l.map((f, g) => {
|
|
1993
1993
|
if (f.status === "rejected")
|
|
1994
1994
|
return Promise.reject(f.reason);
|
|
1995
|
-
const { target: w, uidsToNotify:
|
|
1995
|
+
const { target: w, uidsToNotify: I } = f.value;
|
|
1996
1996
|
return X(
|
|
1997
1997
|
() => t.addComment({
|
|
1998
1998
|
content: s[g]?.content,
|
|
1999
1999
|
...w,
|
|
2000
2000
|
// Nobody to notify means no recipient field at all,
|
|
2001
2001
|
// rather than an empty one.
|
|
2002
|
-
...
|
|
2002
|
+
...I.length > 0 && { uidsToNotify: I }
|
|
2003
2003
|
})
|
|
2004
2004
|
);
|
|
2005
2005
|
})
|
|
@@ -3097,10 +3097,10 @@ async function Bi(e, t, {
|
|
|
3097
3097
|
throw new Error(`Task "${e.content}": Parent task "${c}" not found`);
|
|
3098
3098
|
}
|
|
3099
3099
|
else if (!g && a && (g = s.get(a), !g)) {
|
|
3100
|
-
const
|
|
3101
|
-
if (!
|
|
3100
|
+
const I = await C(() => t.getSection(a));
|
|
3101
|
+
if (!I)
|
|
3102
3102
|
throw new Error(`Task "${e.content}": Section "${a}" not found`);
|
|
3103
|
-
g =
|
|
3103
|
+
g = I.projectId, s.set(a, I.projectId);
|
|
3104
3104
|
}
|
|
3105
3105
|
if (!g)
|
|
3106
3106
|
throw new Error(
|
|
@@ -3112,9 +3112,9 @@ async function Bi(e, t, {
|
|
|
3112
3112
|
l
|
|
3113
3113
|
);
|
|
3114
3114
|
if (!w.isValid) {
|
|
3115
|
-
const
|
|
3115
|
+
const I = w.error?.message || "Assignment validation failed", k = w.error?.suggestions?.join(". ") || "";
|
|
3116
3116
|
throw new Error(
|
|
3117
|
-
`Task "${e.content}": ${
|
|
3117
|
+
`Task "${e.content}": ${I}${k ? `. ${k}` : ""}`
|
|
3118
3118
|
);
|
|
3119
3119
|
}
|
|
3120
3120
|
f.assigneeId = w.resolvedUser?.userId;
|
|
@@ -3671,7 +3671,7 @@ const ga = {
|
|
|
3671
3671
|
const { results: m, nextCursor: b } = await t.getActivityLogs(p), f = m.map(Un), g = await M.getUserShortNames(
|
|
3672
3672
|
t,
|
|
3673
3673
|
f.flatMap(
|
|
3674
|
-
(
|
|
3674
|
+
(I) => I.initiatorId && I.parentProjectId ? [I.parentProjectId] : []
|
|
3675
3675
|
)
|
|
3676
3676
|
);
|
|
3677
3677
|
return {
|
|
@@ -3956,28 +3956,28 @@ const Oa = {
|
|
|
3956
3956
|
const p = await vt(t, c), m = p?.email;
|
|
3957
3957
|
let f = Rt(r, n);
|
|
3958
3958
|
p && m && (f = we(f, `assigned to: ${m}`));
|
|
3959
|
-
const g = await t.getUser(), w = g.tzInfo?.gmtString || "+00:00",
|
|
3959
|
+
const g = await t.getUser(), w = g.tzInfo?.gmtString || "+00:00", I = await de({
|
|
3960
3960
|
projectId: d,
|
|
3961
3961
|
user: g
|
|
3962
3962
|
}), k = xa({
|
|
3963
3963
|
since: i,
|
|
3964
3964
|
until: a,
|
|
3965
3965
|
userGmtOffset: w
|
|
3966
|
-
}), j = `${k.since}T00:00:00${w}`, $ = `${k.until}T23:59:59${w}`, J = new Date(j).toISOString(), T = new Date($).toISOString(),
|
|
3966
|
+
}), j = `${k.since}T00:00:00${w}`, $ = `${k.until}T23:59:59${w}`, J = new Date(j).toISOString(), T = new Date($).toISOString(), v = {
|
|
3967
3967
|
...e,
|
|
3968
3968
|
since: k.since,
|
|
3969
3969
|
until: k.until
|
|
3970
3970
|
}, { items: A, nextCursor: x } = s === "completion" ? await t.getCompletedTasksByCompletionDate({
|
|
3971
3971
|
...u,
|
|
3972
3972
|
...h ? { cursor: h } : {},
|
|
3973
|
-
projectId:
|
|
3973
|
+
projectId: I,
|
|
3974
3974
|
since: J,
|
|
3975
3975
|
until: T,
|
|
3976
3976
|
...f ? { filterQuery: f, filterLang: "en" } : {}
|
|
3977
3977
|
}) : await t.getCompletedTasksByDueDate({
|
|
3978
3978
|
...u,
|
|
3979
3979
|
...h ? { cursor: h } : {},
|
|
3980
|
-
projectId:
|
|
3980
|
+
projectId: I,
|
|
3981
3981
|
since: J,
|
|
3982
3982
|
until: T,
|
|
3983
3983
|
...f ? { filterQuery: f, filterLang: "en" } : {}
|
|
@@ -3985,7 +3985,7 @@ const Oa = {
|
|
|
3985
3985
|
return {
|
|
3986
3986
|
textContent: _a({
|
|
3987
3987
|
tasks: O,
|
|
3988
|
-
args:
|
|
3988
|
+
args: v,
|
|
3989
3989
|
userGmtOffset: w,
|
|
3990
3990
|
nextCursor: x,
|
|
3991
3991
|
assigneeEmail: m,
|
|
@@ -3996,7 +3996,7 @@ const Oa = {
|
|
|
3996
3996
|
nextCursor: x ?? void 0,
|
|
3997
3997
|
totalCount: O.length,
|
|
3998
3998
|
hasMore: !!x,
|
|
3999
|
-
appliedFilters:
|
|
3999
|
+
appliedFilters: v
|
|
4000
4000
|
}
|
|
4001
4001
|
};
|
|
4002
4002
|
}
|
|
@@ -4566,7 +4566,7 @@ function wo(e) {
|
|
|
4566
4566
|
}
|
|
4567
4567
|
const dc = {
|
|
4568
4568
|
startDate: o.string().regex(/^(\d{4}-\d{2}-\d{2}|today)$/).optional().describe(
|
|
4569
|
-
"The start date to get the tasks for. Format: YYYY-MM-DD, or 'today', which by default also includes overdue tasks."
|
|
4569
|
+
"The start date to get the tasks for. Format: YYYY-MM-DD, or 'today', which by default also includes overdue tasks. Defaults to 'today' when omitted, except with overdueOption='overdue-only'."
|
|
4570
4570
|
),
|
|
4571
4571
|
overdueOption: o.enum(["overdue-only", "include-overdue", "exclude-overdue"]).optional().describe(
|
|
4572
4572
|
"How to handle overdue tasks. 'overdue-only' to get only overdue tasks, 'include-overdue' to include overdue tasks along with tasks for the specified date(s), and 'exclude-overdue' to exclude overdue tasks. Default is 'include-overdue'."
|
|
@@ -4598,54 +4598,49 @@ const dc = {
|
|
|
4598
4598
|
outputSchema: lc,
|
|
4599
4599
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
4600
4600
|
async execute(e, t) {
|
|
4601
|
-
const s = _e(
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
d = "overdue";
|
|
4610
|
-
else if (e.startDate === "today")
|
|
4611
|
-
if (e.daysCount > 1) {
|
|
4612
|
-
const b = /* @__PURE__ */ new Date(), f = ye(b), g = Xe(b, e.daysCount), w = Mt(g, { representation: "date" }), v = `(due after: ${f} | due: ${f}) & due before: ${w}`;
|
|
4613
|
-
d = e.overdueOption === "exclude-overdue" ? v : `(${v} | overdue)`;
|
|
4601
|
+
const s = e.startDate !== void 0 || e.overdueOption === "overdue-only" ? e : { ...e, startDate: "today" }, r = _e(s.cursor), n = await vt(t, s.responsibleUser), i = n?.userId, a = n?.email, d = s.responsibleUser?.trim().toLowerCase() === qs ? i : i ? (await t.getUser()).id : void 0;
|
|
4602
|
+
let l = "";
|
|
4603
|
+
if (s.overdueOption === "overdue-only")
|
|
4604
|
+
l = "overdue";
|
|
4605
|
+
else if (s.startDate === "today")
|
|
4606
|
+
if (s.daysCount > 1) {
|
|
4607
|
+
const f = /* @__PURE__ */ new Date(), g = ye(f), w = Xe(f, s.daysCount), I = Mt(w, { representation: "date" }), k = `(due after: ${g} | due: ${g}) & due before: ${I}`;
|
|
4608
|
+
l = s.overdueOption === "exclude-overdue" ? k : `(${k} | overdue)`;
|
|
4614
4609
|
} else
|
|
4615
|
-
|
|
4616
|
-
else if (
|
|
4617
|
-
const
|
|
4618
|
-
|
|
4610
|
+
l = s.overdueOption === "exclude-overdue" ? "today" : "(today | overdue)";
|
|
4611
|
+
else if (s.startDate) {
|
|
4612
|
+
const f = s.startDate, g = Xe(wo(f), s.daysCount), w = Mt(g, { representation: "date" });
|
|
4613
|
+
l = `(due after: ${f} | due: ${f}) & due before: ${w}`;
|
|
4619
4614
|
}
|
|
4620
|
-
const
|
|
4621
|
-
|
|
4622
|
-
const
|
|
4623
|
-
resolvedAssigneeId:
|
|
4624
|
-
assigneeEmail:
|
|
4625
|
-
currentUserId:
|
|
4626
|
-
responsibleUserFiltering:
|
|
4615
|
+
const u = Rt(s.labels, s.labelsOperator);
|
|
4616
|
+
u.length > 0 && (l = we(l, `(${u})`));
|
|
4617
|
+
const h = at({
|
|
4618
|
+
resolvedAssigneeId: i,
|
|
4619
|
+
assigneeEmail: a,
|
|
4620
|
+
currentUserId: d,
|
|
4621
|
+
responsibleUserFiltering: s.responsibleUserFiltering
|
|
4627
4622
|
});
|
|
4628
|
-
|
|
4629
|
-
const { tasks:
|
|
4623
|
+
l = we(l, h);
|
|
4624
|
+
const { tasks: p, nextCursor: m } = await jt({
|
|
4630
4625
|
client: t,
|
|
4631
|
-
query:
|
|
4632
|
-
cursor:
|
|
4633
|
-
limit:
|
|
4626
|
+
query: l,
|
|
4627
|
+
cursor: r,
|
|
4628
|
+
limit: s.limit
|
|
4634
4629
|
});
|
|
4635
4630
|
return {
|
|
4636
4631
|
textContent: pc({
|
|
4637
|
-
tasks:
|
|
4638
|
-
args:
|
|
4639
|
-
nextCursor:
|
|
4640
|
-
assigneeEmail:
|
|
4641
|
-
assigneeNames: await Te(t,
|
|
4632
|
+
tasks: p,
|
|
4633
|
+
args: s,
|
|
4634
|
+
nextCursor: m,
|
|
4635
|
+
assigneeEmail: a,
|
|
4636
|
+
assigneeNames: await Te(t, p, d)
|
|
4642
4637
|
}),
|
|
4643
4638
|
structuredContent: {
|
|
4644
|
-
tasks:
|
|
4645
|
-
nextCursor:
|
|
4646
|
-
totalCount:
|
|
4647
|
-
hasMore: !!
|
|
4648
|
-
appliedFilters:
|
|
4639
|
+
tasks: p,
|
|
4640
|
+
nextCursor: m ?? void 0,
|
|
4641
|
+
totalCount: p.length,
|
|
4642
|
+
hasMore: !!m,
|
|
4643
|
+
appliedFilters: s
|
|
4649
4644
|
}
|
|
4650
4645
|
};
|
|
4651
4646
|
}
|
|
@@ -4797,7 +4792,7 @@ const fc = new mc(), { FIND_COMPLETED_TASKS: ns, ADD_TASKS: is } = y, bc = {
|
|
|
4797
4792
|
appliedFilters: o.record(o.string(), o.unknown())
|
|
4798
4793
|
}, yc = {
|
|
4799
4794
|
name: y.FIND_TASKS,
|
|
4800
|
-
description:
|
|
4795
|
+
description: 'Find active tasks by text, project/section/parent, responsible user, labels, raw filter, or saved filter (filterIdOrName). Without filters, list a page. Default scope: unassigned + mine; responsibleUserFiltering="all" includes others.',
|
|
4801
4796
|
parameters: bc,
|
|
4802
4797
|
outputSchema: gc,
|
|
4803
4798
|
annotations: { readOnlyHint: !0, destructiveHint: !1, idempotentHint: !0 },
|
|
@@ -4816,10 +4811,6 @@ const fc = new mc(), { FIND_COMPLETED_TASKS: ns, ADD_TASKS: is } = y, bc = {
|
|
|
4816
4811
|
filter: p,
|
|
4817
4812
|
filterIdOrName: m
|
|
4818
4813
|
} = e, b = _e(l), f = await t.getUser(), g = u && u.length > 0;
|
|
4819
|
-
if (!s && !r && !n && !i && !a && !g && !p && !m)
|
|
4820
|
-
throw new Error(
|
|
4821
|
-
"At least one filter must be provided: searchText, projectId, sectionId, parentId, responsibleUser, labels, filter, or filterIdOrName"
|
|
4822
|
-
);
|
|
4823
4814
|
if (p && m)
|
|
4824
4815
|
throw new Error(
|
|
4825
4816
|
"The `filter` and `filterIdOrName` parameters cannot be used together. Provide only one."
|
|
@@ -4830,7 +4821,7 @@ const fc = new mc(), { FIND_COMPLETED_TASKS: ns, ADD_TASKS: is } = y, bc = {
|
|
|
4830
4821
|
);
|
|
4831
4822
|
let w = p;
|
|
4832
4823
|
m && (w = (await fc.resolveFilter(t, m)).filterQuery);
|
|
4833
|
-
const
|
|
4824
|
+
const I = await vt(t, a), k = I?.userId, j = I?.email;
|
|
4834
4825
|
if (r || n || i) {
|
|
4835
4826
|
const O = {
|
|
4836
4827
|
limit: d,
|
|
@@ -4910,25 +4901,25 @@ const fc = new mc(), { FIND_COMPLETED_TASKS: ns, ADD_TASKS: is } = y, bc = {
|
|
|
4910
4901
|
});
|
|
4911
4902
|
$ = we($, O);
|
|
4912
4903
|
}
|
|
4913
|
-
const { tasks:
|
|
4904
|
+
const { tasks: v, nextCursor: A } = await jt({
|
|
4914
4905
|
client: t,
|
|
4915
|
-
query:
|
|
4906
|
+
query: $ || "all",
|
|
4916
4907
|
cursor: b,
|
|
4917
4908
|
limit: e.limit
|
|
4918
4909
|
});
|
|
4919
4910
|
return {
|
|
4920
4911
|
textContent: Ke({
|
|
4921
|
-
tasks:
|
|
4912
|
+
tasks: v,
|
|
4922
4913
|
args: e,
|
|
4923
4914
|
nextCursor: A,
|
|
4924
4915
|
isContainerSearch: !1,
|
|
4925
4916
|
assigneeEmail: j,
|
|
4926
|
-
assigneeNames: await Te(t,
|
|
4917
|
+
assigneeNames: await Te(t, v, f.id)
|
|
4927
4918
|
}),
|
|
4928
4919
|
structuredContent: {
|
|
4929
|
-
tasks:
|
|
4920
|
+
tasks: v,
|
|
4930
4921
|
nextCursor: A ?? void 0,
|
|
4931
|
-
totalCount:
|
|
4922
|
+
totalCount: v.length,
|
|
4932
4923
|
hasMore: !!A,
|
|
4933
4924
|
appliedFilters: e
|
|
4934
4925
|
}
|
|
@@ -5934,17 +5925,17 @@ const cd = {
|
|
|
5934
5925
|
originalAssigneeId: T.responsibleUid ?? void 0,
|
|
5935
5926
|
newAssigneeId: void 0
|
|
5936
5927
|
};
|
|
5937
|
-
} catch (
|
|
5928
|
+
} catch (v) {
|
|
5938
5929
|
return {
|
|
5939
5930
|
taskId: T.id,
|
|
5940
5931
|
success: !1,
|
|
5941
|
-
error:
|
|
5932
|
+
error: v instanceof Error ? v.message : "Update failed",
|
|
5942
5933
|
originalAssigneeId: T.responsibleUid ?? void 0
|
|
5943
5934
|
};
|
|
5944
5935
|
}
|
|
5945
5936
|
}), j = await Promise.all(k), $ = [...j, ...l];
|
|
5946
5937
|
if ($.length > 0 && $.every((T) => !T.success)) {
|
|
5947
|
-
const T = $.map((
|
|
5938
|
+
const T = $.map((v) => `"${v.taskId}": ${v.error}`).join("; ");
|
|
5948
5939
|
throw new Error(`All ${$.length} unassign operation(s) failed: ${T}`);
|
|
5949
5940
|
}
|
|
5950
5941
|
return {
|
|
@@ -5980,9 +5971,9 @@ const cd = {
|
|
|
5980
5971
|
(T) => T.assignment != null && T.validation != null
|
|
5981
5972
|
);
|
|
5982
5973
|
if (!j)
|
|
5983
|
-
return $.map(({ assignment: T, validation:
|
|
5974
|
+
return $.map(({ assignment: T, validation: v }) => {
|
|
5984
5975
|
const A = d.find((x) => x.id === T.taskId);
|
|
5985
|
-
if (!T.taskId || !
|
|
5976
|
+
if (!T.taskId || !v.resolvedUser?.userId)
|
|
5986
5977
|
throw new Error(
|
|
5987
5978
|
"Invalid assignment or validation data - this should not happen"
|
|
5988
5979
|
);
|
|
@@ -5990,13 +5981,13 @@ const cd = {
|
|
|
5990
5981
|
taskId: T.taskId,
|
|
5991
5982
|
success: !0,
|
|
5992
5983
|
originalAssigneeId: A?.responsibleUid ?? void 0,
|
|
5993
|
-
newAssigneeId:
|
|
5984
|
+
newAssigneeId: v.resolvedUser.userId
|
|
5994
5985
|
};
|
|
5995
5986
|
});
|
|
5996
5987
|
const J = $.map(
|
|
5997
|
-
async ({ assignment: T, validation:
|
|
5988
|
+
async ({ assignment: T, validation: v }) => {
|
|
5998
5989
|
const A = d.find((x) => x.id === T.taskId);
|
|
5999
|
-
if (!T.taskId || !
|
|
5990
|
+
if (!T.taskId || !v.resolvedUser?.userId)
|
|
6000
5991
|
return {
|
|
6001
5992
|
taskId: T.taskId || "unknown-task",
|
|
6002
5993
|
success: !1,
|
|
@@ -6005,12 +5996,12 @@ const cd = {
|
|
|
6005
5996
|
};
|
|
6006
5997
|
try {
|
|
6007
5998
|
return await t.updateTask(T.taskId, {
|
|
6008
|
-
assigneeId:
|
|
5999
|
+
assigneeId: v.resolvedUser.userId
|
|
6009
6000
|
}), {
|
|
6010
6001
|
taskId: T.taskId,
|
|
6011
6002
|
success: !0,
|
|
6012
6003
|
originalAssigneeId: A?.responsibleUid ?? void 0,
|
|
6013
|
-
newAssigneeId:
|
|
6004
|
+
newAssigneeId: v.resolvedUser.userId
|
|
6014
6005
|
};
|
|
6015
6006
|
} catch (x) {
|
|
6016
6007
|
return {
|
|
@@ -6369,13 +6360,13 @@ async function Od(e, t) {
|
|
|
6369
6360
|
const m = [];
|
|
6370
6361
|
for (const [b, f] of h) {
|
|
6371
6362
|
const g = u.get(b) ?? [], w = $o(g.map(Rd), f);
|
|
6372
|
-
for (const [
|
|
6373
|
-
const j = i.get(
|
|
6363
|
+
for (const [I, k] of w) {
|
|
6364
|
+
const j = i.get(I);
|
|
6374
6365
|
m.push({
|
|
6375
|
-
id:
|
|
6366
|
+
id: I,
|
|
6376
6367
|
command: ae(
|
|
6377
6368
|
"project_update",
|
|
6378
|
-
j && F(j) ? { id:
|
|
6369
|
+
j && F(j) ? { id: I, defaultOrderKey: k } : { id: I, orderKey: k }
|
|
6379
6370
|
)
|
|
6380
6371
|
});
|
|
6381
6372
|
}
|
|
@@ -6651,8 +6642,8 @@ function Zd(e, t) {
|
|
|
6651
6642
|
throw Ge(e);
|
|
6652
6643
|
const [, r, n, i, a, c, d = "0", l = ""] = s, [u, h, p, m, b, f] = [r, n, i, a, c, d].map(Number), g = /* @__PURE__ */ new Date(0);
|
|
6653
6644
|
g.setUTCFullYear(u, h - 1, p), g.setUTCHours(m, b, f);
|
|
6654
|
-
const w = g.getUTCFullYear() === u && g.getUTCMonth() === h - 1 && g.getUTCDate() === p && g.getUTCHours() === m && g.getUTCMinutes() === b && g.getUTCSeconds() === f,
|
|
6655
|
-
if (!w ||
|
|
6645
|
+
const w = g.getUTCFullYear() === u && g.getUTCMonth() === h - 1 && g.getUTCDate() === p && g.getUTCHours() === m && g.getUTCMinutes() === b && g.getUTCSeconds() === f, I = l.toUpperCase() === "Z" ? 0 : po(l);
|
|
6646
|
+
if (!w || I < Jd || I > Xd)
|
|
6656
6647
|
throw Ge(e);
|
|
6657
6648
|
const k = new Date(e);
|
|
6658
6649
|
if (Number.isNaN(k.getTime()))
|
|
@@ -7266,29 +7257,29 @@ const Ul = o.object({
|
|
|
7266
7257
|
const m = p?.value, b = m !== void 0 ? { notifyUid: m } : {};
|
|
7267
7258
|
switch (u.type) {
|
|
7268
7259
|
case "relative": {
|
|
7269
|
-
const { id: f, type: g, notifyUser: w, ...
|
|
7260
|
+
const { id: f, type: g, notifyUser: w, ...I } = u;
|
|
7270
7261
|
return await C(
|
|
7271
7262
|
() => t.updateReminder(f, {
|
|
7272
7263
|
reminderType: "relative",
|
|
7273
|
-
...
|
|
7264
|
+
...I,
|
|
7274
7265
|
...b
|
|
7275
7266
|
})
|
|
7276
7267
|
);
|
|
7277
7268
|
}
|
|
7278
7269
|
case "absolute": {
|
|
7279
|
-
const { id: f, type: g, notifyUser: w, ...
|
|
7270
|
+
const { id: f, type: g, notifyUser: w, ...I } = u;
|
|
7280
7271
|
return await C(
|
|
7281
7272
|
() => t.updateReminder(f, {
|
|
7282
7273
|
reminderType: "absolute",
|
|
7283
|
-
...
|
|
7274
|
+
...I,
|
|
7284
7275
|
...b
|
|
7285
7276
|
})
|
|
7286
7277
|
);
|
|
7287
7278
|
}
|
|
7288
7279
|
case "location": {
|
|
7289
|
-
const { id: f, type: g, notifyUser: w, ...
|
|
7280
|
+
const { id: f, type: g, notifyUser: w, ...I } = u;
|
|
7290
7281
|
return await C(
|
|
7291
|
-
() => t.updateLocationReminder(f, { ...
|
|
7282
|
+
() => t.updateLocationReminder(f, { ...I, ...b })
|
|
7292
7283
|
);
|
|
7293
7284
|
}
|
|
7294
7285
|
}
|
|
@@ -7509,19 +7500,19 @@ const Vl = o.object({
|
|
|
7509
7500
|
openWorldHint: !0
|
|
7510
7501
|
},
|
|
7511
7502
|
async execute(e, t) {
|
|
7512
|
-
const { tasks: s } = o.object(bs).parse(e), r = s.map(() => ({ kind: "skipped" })), n = (T,
|
|
7513
|
-
r[T] = { kind: "failed", error:
|
|
7514
|
-
}, i = (T,
|
|
7515
|
-
n(T, D(
|
|
7516
|
-
}, a = s.map((T,
|
|
7503
|
+
const { tasks: s } = o.object(bs).parse(e), r = s.map(() => ({ kind: "skipped" })), n = (T, v) => {
|
|
7504
|
+
r[T] = { kind: "failed", error: v };
|
|
7505
|
+
}, i = (T, v) => {
|
|
7506
|
+
n(T, D(v));
|
|
7507
|
+
}, a = s.map((T, v) => ({ task: T, index: v })).filter(({ task: T }) => lu(T)), c = await su(
|
|
7517
7508
|
a.map(({ task: T }) => T),
|
|
7518
7509
|
t
|
|
7519
7510
|
), d = await Promise.allSettled(
|
|
7520
|
-
a.map(({ task: T, index:
|
|
7511
|
+
a.map(({ task: T, index: v }) => au({ task: T, index: v, client: t, inbox: c }))
|
|
7521
7512
|
), l = [];
|
|
7522
|
-
for (const [T,
|
|
7513
|
+
for (const [T, v] of d.entries()) {
|
|
7523
7514
|
const A = a[T]?.index ?? T;
|
|
7524
|
-
|
|
7515
|
+
v.status === "fulfilled" ? l.push(v.value) : i(A, v.reason);
|
|
7525
7516
|
}
|
|
7526
7517
|
const { states: u, readFailed: h } = await Uo({
|
|
7527
7518
|
client: t,
|
|
@@ -7534,32 +7525,32 @@ const Vl = o.object({
|
|
|
7534
7525
|
for (const T of l) {
|
|
7535
7526
|
if (!T.checkRecurrence)
|
|
7536
7527
|
continue;
|
|
7537
|
-
const
|
|
7528
|
+
const v = ou({
|
|
7538
7529
|
id: T.id,
|
|
7539
7530
|
current: u.get(T.id),
|
|
7540
7531
|
readFailed: h
|
|
7541
7532
|
});
|
|
7542
|
-
|
|
7533
|
+
v && (n(T.index, v), T.failed = !0);
|
|
7543
7534
|
}
|
|
7544
7535
|
const p = [];
|
|
7545
7536
|
for (const T of l)
|
|
7546
7537
|
if (!T.failed)
|
|
7547
7538
|
try {
|
|
7548
|
-
const
|
|
7539
|
+
const v = zl({
|
|
7549
7540
|
taskId: T.id,
|
|
7550
7541
|
request: T.moveRequest,
|
|
7551
7542
|
current: u.get(T.id)
|
|
7552
7543
|
});
|
|
7553
|
-
T.redundantMoveSkipped =
|
|
7554
|
-
} catch (
|
|
7555
|
-
i(T.index,
|
|
7544
|
+
T.redundantMoveSkipped = v.redundantMoveSkipped, v.move && p.push({ item: T, move: v.move });
|
|
7545
|
+
} catch (v) {
|
|
7546
|
+
i(T.index, v), T.failed = !0;
|
|
7556
7547
|
}
|
|
7557
7548
|
const m = /* @__PURE__ */ new Map(), b = [], f = (T) => {
|
|
7558
|
-
const
|
|
7559
|
-
|
|
7549
|
+
const v = T.filter((A) => !A.failed);
|
|
7550
|
+
v.length !== 0 && b.push(
|
|
7560
7551
|
iu({
|
|
7561
7552
|
client: t,
|
|
7562
|
-
items:
|
|
7553
|
+
items: v,
|
|
7563
7554
|
onUpdated: (A, x) => {
|
|
7564
7555
|
r[A.index] = { kind: "updated", task: x };
|
|
7565
7556
|
},
|
|
@@ -7583,29 +7574,29 @@ const Vl = o.object({
|
|
|
7583
7574
|
moving: p,
|
|
7584
7575
|
results: m,
|
|
7585
7576
|
onResolved: (T) => {
|
|
7586
|
-
const
|
|
7577
|
+
const v = [];
|
|
7587
7578
|
for (const { item: A } of T) {
|
|
7588
7579
|
const x = m.get(A.index);
|
|
7589
7580
|
if (x && "error" in x) {
|
|
7590
7581
|
n(A.index, x.error), A.failed = !0;
|
|
7591
7582
|
continue;
|
|
7592
7583
|
}
|
|
7593
|
-
|
|
7584
|
+
v.push(A);
|
|
7594
7585
|
}
|
|
7595
|
-
f(
|
|
7586
|
+
f(v);
|
|
7596
7587
|
}
|
|
7597
7588
|
}), await Promise.all(b);
|
|
7598
7589
|
for (const T of l) {
|
|
7599
7590
|
if (T.failed || Oo(T.updateArgs))
|
|
7600
7591
|
continue;
|
|
7601
|
-
const
|
|
7602
|
-
|
|
7592
|
+
const v = m.get(T.index);
|
|
7593
|
+
v && "task" in v && (r[T.index] = { kind: "updated", task: v.task });
|
|
7603
7594
|
}
|
|
7604
|
-
const { updatedTasks: w, failures:
|
|
7605
|
-
return U(y.UPDATE_TASKS, s.length,
|
|
7595
|
+
const { updatedTasks: w, failures: I, skippedCount: k } = tu({ tasks: s, outcomes: r }), j = l.filter((T) => T.redundantMoveSkipped).length, $ = w.map(W);
|
|
7596
|
+
return U(y.UPDATE_TASKS, s.length, I), {
|
|
7606
7597
|
textContent: du({
|
|
7607
7598
|
tasks: $,
|
|
7608
|
-
failures:
|
|
7599
|
+
failures: I,
|
|
7609
7600
|
skippedCount: k,
|
|
7610
7601
|
redundantMovesSkipped: j
|
|
7611
7602
|
}),
|
|
@@ -7613,11 +7604,11 @@ const Vl = o.object({
|
|
|
7613
7604
|
tasks: $,
|
|
7614
7605
|
totalCount: $.length,
|
|
7615
7606
|
updatedTaskIds: w.map((T) => T.id),
|
|
7616
|
-
failures:
|
|
7607
|
+
failures: I,
|
|
7617
7608
|
appliedOperations: {
|
|
7618
7609
|
updateCount: $.length,
|
|
7619
7610
|
skippedCount: k,
|
|
7620
|
-
failureCount:
|
|
7611
|
+
failureCount: I.length,
|
|
7621
7612
|
redundantMovesSkipped: j
|
|
7622
7613
|
}
|
|
7623
7614
|
}
|
|
@@ -7788,12 +7779,12 @@ async function au({
|
|
|
7788
7779
|
...p !== void 0 && { labels: p }
|
|
7789
7780
|
};
|
|
7790
7781
|
h && (w.priority = Ws(h));
|
|
7791
|
-
const
|
|
7782
|
+
const I = gs(
|
|
7792
7783
|
d,
|
|
7793
7784
|
Xl,
|
|
7794
7785
|
fs
|
|
7795
7786
|
);
|
|
7796
|
-
|
|
7787
|
+
I !== void 0 && (w = { ...w, dueString: I });
|
|
7797
7788
|
const k = gs(m, Zl, null);
|
|
7798
7789
|
if (k !== void 0 && (w = { ...w, deadlineDate: k }), l) {
|
|
7799
7790
|
const { amount: j, unit: $ } = Tt(`Task ${n}`, l);
|
|
@@ -7812,7 +7803,7 @@ async function au({
|
|
|
7812
7803
|
parentId: c
|
|
7813
7804
|
},
|
|
7814
7805
|
redundantMoveSkipped: !1,
|
|
7815
|
-
checkRecurrence:
|
|
7806
|
+
checkRecurrence: I !== void 0 && I !== fs && b !== !0,
|
|
7816
7807
|
failed: !1
|
|
7817
7808
|
};
|
|
7818
7809
|
}
|
package/dist/{require-valid-todoist-token-BVhaOBRu.js → require-valid-todoist-token-BznH7HWr.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { validateBearerToken as _, createTokenVerdictCache as p, buildBearerChallenge as u } from "@todoist/mcp-core/host";
|
|
2
|
-
import { $ as v, a0 as A } from "./mcp-server-
|
|
2
|
+
import { $ as v, a0 as A } from "./mcp-server-CLrhTqvZ.js";
|
|
3
3
|
const k = "https://api.todoist.com", U = (e, t) => _({
|
|
4
4
|
// Resolved the way the SDK resolves its own requests against a custom base URL. An empty
|
|
5
5
|
// base (`TODOIST_BASE_URL=`) means the default, as it does for the SDK client.
|
package/dist/tool-registry.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-tasks-by-date.d.ts","sourceRoot":"","sources":["../../src/tools/find-tasks-by-date.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAuBvB,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;CAiDtB,CAAA;AAUD,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"find-tasks-by-date.d.ts","sourceRoot":"","sources":["../../src/tools/find-tasks-by-date.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAuBvB,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;CAiDtB,CAAA;AAUD,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkG0C,CAAA;AA2F/D,OAAO,EAAE,eAAe,EAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-tasks.d.ts","sourceRoot":"","sources":["../../src/tools/find-tasks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAsFvB,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"find-tasks.d.ts","sourceRoot":"","sources":["../../src/tools/find-tasks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAsFvB,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoNgD,CAAA;AA6K/D,OAAO,EAAE,SAAS,EAAE,CAAA"}
|