@doist/todoist-mcp 14.0.0 → 14.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +22 -11
- package/dist/index.d.ts.map +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-DY_eceeG.js → mcp-server-67PYKKIe.js} +469 -430
- package/dist/middleware/require-valid-todoist-token.d.ts.map +1 -1
- package/dist/require-valid-todoist-token-D8WnAMKI.js +63 -0
- package/dist/tool-registry.d.ts +22 -11
- package/dist/tool-registry.d.ts.map +1 -1
- package/dist/tools/reschedule-tasks.d.ts +22 -11
- package/dist/tools/reschedule-tasks.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/require-valid-todoist-token-B0G0XLuO.js +0 -79
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"require-valid-todoist-token.d.ts","sourceRoot":"","sources":["../../src/middleware/require-valid-todoist-token.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"require-valid-todoist-token.d.ts","sourceRoot":"","sources":["../../src/middleware/require-valid-todoist-token.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAgB,OAAO,EAAE,cAAc,EAAY,MAAM,SAAS,CAAA;AAI9E,KAAK,iBAAiB,GAAG;IACrB,IAAI,EAAE,QAAQ,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,KAAK,kBAAkB,GAAG;IACtB,IAAI,EAAE,SAAS,CAAA;IACf,SAAS,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,MAAM,GAAG,SAAS,CAAA;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,KAAK,WAAW,GAAG,iBAAiB,GAAG,kBAAkB,CAAA;AAEzD,KAAK,+BAA+B,GAAG,WAAW,GAAG;IACjD;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC/B,CAAA;AAgED;;;;;;GAMG;AACH,iBAAS,wBAAwB,CAAC,OAAO,EAAE,+BAA+B,GAAG,cAAc,CAgC1F;AAED;;GAEG;AACH,iBAAS,yBAAyB,IAAI,IAAI,CAEzC;AAED,OAAO,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,KAAK,+BAA+B,EAAE,CAAA"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { validateBearerToken as _, createTokenVerdictCache as p, buildBearerChallenge as u } from "@doist/mcp-core/host";
|
|
2
|
+
import { $ as v, a0 as A } from "./mcp-server-67PYKKIe.js";
|
|
3
|
+
const k = "https://api.todoist.com", U = (e, t) => _({
|
|
4
|
+
// Resolved the way the SDK resolves its own requests against a custom base URL. An empty
|
|
5
|
+
// base (`TODOIST_BASE_URL=`) means the default, as it does for the SDK client.
|
|
6
|
+
url: new URL("/api/v1/user", t || k),
|
|
7
|
+
token: e,
|
|
8
|
+
headers: A({ label: "auth:validate-token" }),
|
|
9
|
+
fetch: v
|
|
10
|
+
}), b = 3e5, g = 12e4, y = 1e4, d = /* @__PURE__ */ new Map();
|
|
11
|
+
function E(e) {
|
|
12
|
+
let t = d.get(e);
|
|
13
|
+
return t || (t = p({
|
|
14
|
+
ttlMs: e,
|
|
15
|
+
maxEntries: y,
|
|
16
|
+
now: () => Date.now()
|
|
17
|
+
}), d.set(e, t)), t;
|
|
18
|
+
}
|
|
19
|
+
function T(e, t) {
|
|
20
|
+
e.status(401).set("WWW-Authenticate", u({ resourceMetadataUrl: t })).json({
|
|
21
|
+
error: "invalid_token",
|
|
22
|
+
error_description: "Todoist API token is invalid or expired"
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function L(e, t) {
|
|
26
|
+
e.status(403).set(
|
|
27
|
+
"WWW-Authenticate",
|
|
28
|
+
u({ error: "insufficient_scope", resourceMetadataUrl: t })
|
|
29
|
+
).json({
|
|
30
|
+
error: "insufficient_scope",
|
|
31
|
+
error_description: "Todoist API token does not have the required scopes"
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function l(e, t, a, r) {
|
|
35
|
+
e === "valid" ? a() : e === "forbidden" ? L(t, r) : T(t, r);
|
|
36
|
+
}
|
|
37
|
+
function C(e) {
|
|
38
|
+
const t = e.type === "static" ? b : g, a = E(e.cacheTtlMs ?? t), { resourceMetadataUrl: r } = e;
|
|
39
|
+
return async (f, n, o) => {
|
|
40
|
+
const i = e.type === "static" ? e.apiKey : e.getApiKey(f);
|
|
41
|
+
if (!i) {
|
|
42
|
+
T(n, r);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const c = a.get(i, e.baseUrl);
|
|
46
|
+
if (c !== void 0) {
|
|
47
|
+
l(c, n, o, r);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
let s;
|
|
51
|
+
try {
|
|
52
|
+
s = await U(i, e.baseUrl);
|
|
53
|
+
} catch (h) {
|
|
54
|
+
console.warn("[Token validation] Validation failed, proceeding:", h), o();
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
a.set(i, e.baseUrl, s), l(s, n, o, r);
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export {
|
|
61
|
+
C as r,
|
|
62
|
+
U as v
|
|
63
|
+
};
|
package/dist/tool-registry.d.ts
CHANGED
|
@@ -377,6 +377,11 @@ declare const toolRegistry: {
|
|
|
377
377
|
}, import('zod/v4/core').$strip>>;
|
|
378
378
|
totalCount: import('zod').ZodNumber;
|
|
379
379
|
rescheduledTaskIds: import('zod').ZodArray<import('zod').ZodString>;
|
|
380
|
+
failures: import('zod').ZodArray<import('zod').ZodObject<{
|
|
381
|
+
item: import('zod').ZodString;
|
|
382
|
+
error: import('zod').ZodString;
|
|
383
|
+
code: import('zod').ZodOptional<import('zod').ZodString>;
|
|
384
|
+
}, import('zod/v4/core').$strip>>;
|
|
380
385
|
};
|
|
381
386
|
annotations: {
|
|
382
387
|
readOnlyHint: false;
|
|
@@ -396,24 +401,30 @@ declare const toolRegistry: {
|
|
|
396
401
|
id: string;
|
|
397
402
|
content: string;
|
|
398
403
|
description: string;
|
|
399
|
-
dueDate: string | undefined;
|
|
400
404
|
recurring: string | boolean;
|
|
401
|
-
deadlineDate: string | undefined;
|
|
402
405
|
priority: "p1" | "p2" | "p3" | "p4";
|
|
403
406
|
projectId: string;
|
|
404
|
-
sectionId: string | undefined;
|
|
405
|
-
parentId: string | undefined;
|
|
406
|
-
labels: string[];
|
|
407
|
-
duration: string | undefined;
|
|
408
|
-
responsibleUid: string | undefined;
|
|
409
|
-
assignedByUid: string | undefined;
|
|
410
|
-
isDeleted: true | undefined;
|
|
411
407
|
checked: boolean;
|
|
412
|
-
|
|
413
|
-
|
|
408
|
+
dueDate?: string | undefined;
|
|
409
|
+
deadlineDate?: string | undefined;
|
|
410
|
+
sectionId?: string | undefined;
|
|
411
|
+
parentId?: string | undefined;
|
|
412
|
+
labels?: string[] | undefined;
|
|
413
|
+
duration?: string | undefined;
|
|
414
|
+
responsibleUid?: string | undefined;
|
|
415
|
+
isUncompletable?: boolean | undefined;
|
|
416
|
+
assignedByUid?: string | undefined;
|
|
417
|
+
isDeleted?: boolean | undefined;
|
|
418
|
+
completedAt?: string | undefined;
|
|
419
|
+
addedAt?: string | undefined;
|
|
414
420
|
}[];
|
|
415
421
|
totalCount: number;
|
|
416
422
|
rescheduledTaskIds: string[];
|
|
423
|
+
failures: {
|
|
424
|
+
item: string;
|
|
425
|
+
error: string;
|
|
426
|
+
code?: string | undefined;
|
|
427
|
+
}[];
|
|
417
428
|
};
|
|
418
429
|
}>;
|
|
419
430
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-registry.d.ts","sourceRoot":"","sources":["../src/tool-registry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+EjB,CAAA;AAED;;;;;GAKG;AACH,QAAA,MAAM,eAAe,EAAE,SAAS,cAAc,EAAgC,CAAA;AAE9E,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -39,6 +39,11 @@ declare const rescheduleTasks: {
|
|
|
39
39
|
}, z.core.$strip>>;
|
|
40
40
|
totalCount: z.ZodNumber;
|
|
41
41
|
rescheduledTaskIds: z.ZodArray<z.ZodString>;
|
|
42
|
+
failures: z.ZodArray<z.ZodObject<{
|
|
43
|
+
item: z.ZodString;
|
|
44
|
+
error: z.ZodString;
|
|
45
|
+
code: z.ZodOptional<z.ZodString>;
|
|
46
|
+
}, z.core.$strip>>;
|
|
42
47
|
};
|
|
43
48
|
annotations: {
|
|
44
49
|
readOnlyHint: false;
|
|
@@ -58,24 +63,30 @@ declare const rescheduleTasks: {
|
|
|
58
63
|
id: string;
|
|
59
64
|
content: string;
|
|
60
65
|
description: string;
|
|
61
|
-
dueDate: string | undefined;
|
|
62
66
|
recurring: string | boolean;
|
|
63
|
-
deadlineDate: string | undefined;
|
|
64
67
|
priority: "p1" | "p2" | "p3" | "p4";
|
|
65
68
|
projectId: string;
|
|
66
|
-
sectionId: string | undefined;
|
|
67
|
-
parentId: string | undefined;
|
|
68
|
-
labels: string[];
|
|
69
|
-
duration: string | undefined;
|
|
70
|
-
responsibleUid: string | undefined;
|
|
71
|
-
assignedByUid: string | undefined;
|
|
72
|
-
isDeleted: true | undefined;
|
|
73
69
|
checked: boolean;
|
|
74
|
-
|
|
75
|
-
|
|
70
|
+
dueDate?: string | undefined;
|
|
71
|
+
deadlineDate?: string | undefined;
|
|
72
|
+
sectionId?: string | undefined;
|
|
73
|
+
parentId?: string | undefined;
|
|
74
|
+
labels?: string[] | undefined;
|
|
75
|
+
duration?: string | undefined;
|
|
76
|
+
responsibleUid?: string | undefined;
|
|
77
|
+
isUncompletable?: boolean | undefined;
|
|
78
|
+
assignedByUid?: string | undefined;
|
|
79
|
+
isDeleted?: boolean | undefined;
|
|
80
|
+
completedAt?: string | undefined;
|
|
81
|
+
addedAt?: string | undefined;
|
|
76
82
|
}[];
|
|
77
83
|
totalCount: number;
|
|
78
84
|
rescheduledTaskIds: string[];
|
|
85
|
+
failures: {
|
|
86
|
+
item: string;
|
|
87
|
+
error: string;
|
|
88
|
+
code?: string | undefined;
|
|
89
|
+
}[];
|
|
79
90
|
};
|
|
80
91
|
}>;
|
|
81
92
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reschedule-tasks.d.ts","sourceRoot":"","sources":["../../src/tools/reschedule-tasks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"reschedule-tasks.d.ts","sourceRoot":"","sources":["../../src/tools/reschedule-tasks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,IAAI,EAAkB,MAAM,oBAAoB,CAAA;AAE3E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAyCvB,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+G0C,CAAA;AA4B/D,iBAAS,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,MAAM,CAU7F;AAED,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doist/todoist-mcp",
|
|
3
|
-
"version": "14.0.
|
|
3
|
+
"version": "14.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"prepare": "lefthook install --reset-hooks-path"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@doist/mcp-core": "0.
|
|
70
|
+
"@doist/mcp-core": "0.4.0",
|
|
71
71
|
"@doist/todoist-sdk": "16.0.0",
|
|
72
72
|
"@modelcontextprotocol/ext-apps": "2.0.4",
|
|
73
73
|
"date-fns": "4.1.0",
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { validateBearerToken as _ } from "@doist/mcp-core/host";
|
|
2
|
-
import { $ as k, a0 as v } from "./mcp-server-DY_eceeG.js";
|
|
3
|
-
const w = "https://api.todoist.com", y = (e, t) => _({
|
|
4
|
-
// Resolved the way the SDK resolves its own requests against a custom base URL. An empty
|
|
5
|
-
// base (`TODOIST_BASE_URL=`) means the default, as it does for the SDK client.
|
|
6
|
-
url: new URL("/api/v1/user", t || w),
|
|
7
|
-
token: e,
|
|
8
|
-
headers: v({ label: "auth:validate-token" }),
|
|
9
|
-
fetch: k
|
|
10
|
-
}), g = 3e5, m = 12e4, f = 1e4, r = /* @__PURE__ */ new Map();
|
|
11
|
-
function E(e, t) {
|
|
12
|
-
return t ? `${e}::${t}` : e;
|
|
13
|
-
}
|
|
14
|
-
function C() {
|
|
15
|
-
const e = Date.now();
|
|
16
|
-
for (const [t, n] of r)
|
|
17
|
-
e >= n.expiresAt && r.delete(t);
|
|
18
|
-
}
|
|
19
|
-
function D(e) {
|
|
20
|
-
const t = r.get(e);
|
|
21
|
-
if (t && Date.now() < t.expiresAt)
|
|
22
|
-
return t.result;
|
|
23
|
-
t && r.delete(e);
|
|
24
|
-
}
|
|
25
|
-
function L(e, t, n) {
|
|
26
|
-
r.size >= f && C(), r.size >= f && r.clear(), r.set(e, { result: t, expiresAt: Date.now() + n });
|
|
27
|
-
}
|
|
28
|
-
function T(e, t) {
|
|
29
|
-
const n = [
|
|
30
|
-
...t ? [`error="${t}"`] : [],
|
|
31
|
-
...e ? [`resource_metadata="${e}"`] : []
|
|
32
|
-
];
|
|
33
|
-
return n.length > 0 ? `Bearer ${n.join(", ")}` : "Bearer";
|
|
34
|
-
}
|
|
35
|
-
function h(e, t) {
|
|
36
|
-
e.status(401).set("WWW-Authenticate", T(t)).json({
|
|
37
|
-
error: "invalid_token",
|
|
38
|
-
error_description: "Todoist API token is invalid or expired"
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
function U(e, t) {
|
|
42
|
-
e.status(403).set(
|
|
43
|
-
"WWW-Authenticate",
|
|
44
|
-
T(t, "insufficient_scope")
|
|
45
|
-
).json({
|
|
46
|
-
error: "insufficient_scope",
|
|
47
|
-
error_description: "Todoist API token does not have the required scopes"
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
function l(e, t, n, i) {
|
|
51
|
-
e === "valid" ? n() : e === "forbidden" ? U(t, i) : h(t, i);
|
|
52
|
-
}
|
|
53
|
-
function M(e) {
|
|
54
|
-
const t = e.type === "static" ? g : m, n = e.cacheTtlMs ?? t, { resourceMetadataUrl: i } = e;
|
|
55
|
-
return async (p, o, s) => {
|
|
56
|
-
const a = e.type === "static" ? e.apiKey : e.getApiKey(p);
|
|
57
|
-
if (!a) {
|
|
58
|
-
h(o, i);
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
const d = E(a, e.baseUrl), u = D(d);
|
|
62
|
-
if (u !== void 0) {
|
|
63
|
-
l(u, o, s, i);
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
let c;
|
|
67
|
-
try {
|
|
68
|
-
c = await y(a, e.baseUrl);
|
|
69
|
-
} catch (A) {
|
|
70
|
-
console.warn("[Token validation] Transient error, proceeding:", A), s();
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
L(d, c, n), l(c, o, s, i);
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
export {
|
|
77
|
-
M as r,
|
|
78
|
-
y as v
|
|
79
|
-
};
|