@doist/todoist-mcp 12.2.4 → 12.3.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-CJwB10bN.js → mcp-server-BOvuwJio.js} +1 -1
- package/dist/{require-valid-todoist-token-1PqO_8hQ.js → require-valid-todoist-token-CLh0YpWi.js} +1 -1
- package/dist/utils/move-planner.d.ts +63 -0
- package/dist/utils/move-planner.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { f as s, s as a, l as e, m as t, a as o, u as d, r, d as i, b as n, c, e as l, h as m, i as p, j as f, k, n as T, o as u, p as g, q as j, t as v, v as h, w as P, x as b, y as A, z as S, A as y, B as C, C as F, D as x, E, F as L, G as O, H as w, I as H, J as I, K as M, L as q, M as z, N as B } from "./mcp-server-
|
|
2
|
-
import { O as J, g as K } from "./mcp-server-
|
|
3
|
-
import { r as U, v as V } from "./require-valid-todoist-token-
|
|
1
|
+
import { f as s, s as a, l as e, m as t, a as o, u as d, r, d as i, b as n, c, e as l, h as m, i as p, j as f, k, n as T, o as u, p as g, q as j, t as v, v as h, w as P, x as b, y as A, z as S, A as y, B as C, C as F, D as x, E, F as L, G as O, H as w, I as H, J as I, K as M, L as q, M as z, N as B } from "./mcp-server-BOvuwJio.js";
|
|
2
|
+
import { O as J, g as K } from "./mcp-server-BOvuwJio.js";
|
|
3
|
+
import { r as U, v as V } from "./require-valid-todoist-token-CLh0YpWi.js";
|
|
4
4
|
const N = {
|
|
5
5
|
// Task management tools
|
|
6
6
|
addTasks: B,
|
package/dist/main-http.js
CHANGED
|
@@ -3,8 +3,8 @@ import { isIP as p } from "node:net";
|
|
|
3
3
|
import O from "dotenv";
|
|
4
4
|
import { StreamableHTTPServerTransport as S } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
5
5
|
import m from "express";
|
|
6
|
-
import { g as v } from "./mcp-server-
|
|
7
|
-
import { r as w } from "./require-valid-todoist-token-
|
|
6
|
+
import { g as v } from "./mcp-server-BOvuwJio.js";
|
|
7
|
+
import { r as w } from "./require-valid-todoist-token-CLh0YpWi.js";
|
|
8
8
|
function f(t) {
|
|
9
9
|
return t.startsWith("[") && t.endsWith("]") ? t.slice(1, -1) : t;
|
|
10
10
|
}
|
package/dist/main.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { StdioServerTransport as s } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
3
|
import c from "dotenv";
|
|
4
|
-
import { g as i } from "./mcp-server-
|
|
4
|
+
import { g as i } from "./mcp-server-BOvuwJio.js";
|
|
5
5
|
function p() {
|
|
6
6
|
const e = process.env.TODOIST_BASE_URL, r = process.env.TODOIST_API_KEY;
|
|
7
7
|
if (!r)
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { MoveTaskArgs, Task } from '@doist/todoist-sdk';
|
|
2
|
+
/** The container fields a caller can send to relocate a task. */
|
|
3
|
+
type MoveRequest = {
|
|
4
|
+
projectId?: string | undefined;
|
|
5
|
+
sectionId?: string | undefined;
|
|
6
|
+
parentId?: string | undefined;
|
|
7
|
+
};
|
|
8
|
+
type MovePlan = {
|
|
9
|
+
/** The move to perform, or undefined when the task is already where it was asked to go. */
|
|
10
|
+
move?: MoveTaskArgs;
|
|
11
|
+
/** True when a requested destination was dropped as already-satisfied. */
|
|
12
|
+
redundantMoveSkipped: boolean;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Whether moving `current` to `destination` would leave the task exactly where it
|
|
16
|
+
* already is, making the request a pointless write.
|
|
17
|
+
*
|
|
18
|
+
* Matching the destination field alone is not enough. Moving a task to a project
|
|
19
|
+
* also lifts it out of its section and out from under its parent, and moving it
|
|
20
|
+
* to a section lifts it out from under its parent — so a task that matches on
|
|
21
|
+
* `projectId` but sits in a section is *not* already in the requested end state.
|
|
22
|
+
*
|
|
23
|
+
* The extra conditions therefore make this predicate conservative on purpose: it
|
|
24
|
+
* only reports "redundant" when the task already looks the way the move would
|
|
25
|
+
* leave it under those detaching semantics. If the API turned out not to detach,
|
|
26
|
+
* the cost is a move we could have skipped, never a move we wrongly skipped.
|
|
27
|
+
*/
|
|
28
|
+
declare function isMoveRedundant(current: Task, destination: MoveTaskArgs): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Identifies a move destination, so tasks heading to the same place can be
|
|
31
|
+
* collapsed into one request.
|
|
32
|
+
*/
|
|
33
|
+
declare function destinationKey(move: MoveTaskArgs): string;
|
|
34
|
+
/**
|
|
35
|
+
* Works out what move, if any, a requested update actually needs.
|
|
36
|
+
*
|
|
37
|
+
* Callers commonly echo a task's whole current shape back when they only meant to
|
|
38
|
+
* edit a field, which would otherwise be read as a relocation. Dropping the
|
|
39
|
+
* containers the task already satisfies means those calls perform no move at all —
|
|
40
|
+
* and a request that names several containers, all but one of them unchanged,
|
|
41
|
+
* resolves to the single real move instead of being rejected as ambiguous.
|
|
42
|
+
*
|
|
43
|
+
* A single container is judged on the whole position it describes, so asking for a
|
|
44
|
+
* task's current project still moves it when that would lift it out of a section.
|
|
45
|
+
* Several containers are judged field by field, so a task described as already
|
|
46
|
+
* being in its project *and* its section is left alone rather than pulled out of
|
|
47
|
+
* that section.
|
|
48
|
+
*
|
|
49
|
+
* @param taskId - Used only to describe the task in error messages.
|
|
50
|
+
* @param request - The container fields as supplied by the caller.
|
|
51
|
+
* @param current - The task's current state, or undefined when it could not be
|
|
52
|
+
* read. Unknown state means every requested move is performed, matching the
|
|
53
|
+
* behaviour of not checking at all.
|
|
54
|
+
* @throws If more than one genuine destination remains, since the API accepts
|
|
55
|
+
* exactly one.
|
|
56
|
+
*/
|
|
57
|
+
declare function planMove({ taskId, request, current, }: {
|
|
58
|
+
taskId: string;
|
|
59
|
+
request: MoveRequest;
|
|
60
|
+
current: Task | undefined;
|
|
61
|
+
}): MovePlan;
|
|
62
|
+
export { destinationKey, isMoveRedundant, type MovePlan, type MoveRequest, planMove };
|
|
63
|
+
//# sourceMappingURL=move-planner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"move-planner.d.ts","sourceRoot":"","sources":["../../src/utils/move-planner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAE5D,iEAAiE;AACjE,KAAK,WAAW,GAAG;IACf,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC9B,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC9B,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAChC,CAAA;AAED,KAAK,QAAQ,GAAG;IACZ,2FAA2F;IAC3F,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,0EAA0E;IAC1E,oBAAoB,EAAE,OAAO,CAAA;CAChC,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,iBAAS,eAAe,CAAC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,YAAY,GAAG,OAAO,CAY1E;AAsBD;;;GAGG;AACH,iBAAS,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAQlD;AAgBD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,iBAAS,QAAQ,CAAC,EACd,MAAM,EACN,OAAO,EACP,OAAO,GACV,EAAE;IACC,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,WAAW,CAAA;IACpB,OAAO,EAAE,IAAI,GAAG,SAAS,CAAA;CAC5B,GAAG,QAAQ,CA4BX;AAED,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,KAAK,QAAQ,EAAE,KAAK,WAAW,EAAE,QAAQ,EAAE,CAAA"}
|