@doist/todoist-mcp 12.2.3 → 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-S9IIW20j.js → mcp-server-BOvuwJio.js} +1337 -1242
- package/dist/{require-valid-todoist-token-b21ze0l_.js → require-valid-todoist-token-CLh0YpWi.js} +1 -1
- package/dist/tools/update-tasks.d.ts.map +1 -1
- package/dist/usage-tracking.d.ts.map +1 -1
- package/dist/utils/concurrency.d.ts +32 -0
- package/dist/utils/concurrency.d.ts.map +1 -0
- package/dist/utils/constants.d.ts +23 -0
- package/dist/utils/constants.d.ts.map +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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-tasks.d.ts","sourceRoot":"","sources":["../../src/tools/update-tasks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,UAAU,EAAkB,MAAM,oBAAoB,CAAA;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"update-tasks.d.ts","sourceRoot":"","sources":["../../src/tools/update-tasks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,UAAU,EAAkB,MAAM,oBAAoB,CAAA;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAqIvB,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAsBqB,MAAM;uBAAS,MAAM;uBAAS,MAAM;;;;;;;;;CAsDX,CAAA;AAsN/D,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage-tracking.d.ts","sourceRoot":"","sources":["../src/usage-tracking.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,WAAW,EAA4B,UAAU,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"usage-tracking.d.ts","sourceRoot":"","sources":["../src/usage-tracking.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,WAAW,EAA4B,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAK3F,QAAA,MAAM,mBAAmB,QAAsB,CAAA;AAI/C,KAAK,mBAAmB,GAAG;IACvB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,KAAK,gBAAgB,GAAG;IACpB,oBAAoB,EAAE,MAAM,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAAA;CAC3D,CAAA;AAcD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,wBAAgB,2BAA2B,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAE5E;AAED,wBAAgB,yBAAyB,CAAC,EACtC,KAAK,EACL,QAAgB,EAChB,SAAwB,GAC3B,GAAE;IACC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;CAChB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAW9B;AAkGD,wBAAsB,8BAA8B,IAAI,OAAO,CAAC,IAAI,CAAC,CAYpE;AAED,wBAAgB,iCAAiC,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAE/F;AAED,wBAAgB,mCAAmC,IAAI,IAAI,CAE1D;AAsBD,wBAAgB,kBAAkB,CAC9B,SAAS,GAAE,OAAO,KAAwB,EAC1C,QAAQ,GAAE,mBAAwB,GACnC,WAAW,CA+Bb;AAED,wBAAgB,mBAAmB,CAC/B,MAAM,EAAE,MAAM,EACd,EACI,OAAO,EACP,QAAQ,GACX,GAAE;IACC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,mBAAmB,CAAA;CAC5B,GACP,UAAU,CAUZ;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wraps a task so it only runs once a slot is free.
|
|
3
|
+
*/
|
|
4
|
+
type Limiter = <T>(fn: () => Promise<T>) => Promise<T>;
|
|
5
|
+
/**
|
|
6
|
+
* A FIFO semaphore. Tasks beyond `maxConcurrent` queue and start as slots free up.
|
|
7
|
+
*
|
|
8
|
+
* Deliberately applied at the tool layer rather than inside the SDK's
|
|
9
|
+
* `customFetch`: the SDK installs its request-timeout `AbortSignal` *before*
|
|
10
|
+
* calling `customFetch`, so gating there would charge queue time against the
|
|
11
|
+
* request timeout and fail long-queued requests that never actually ran.
|
|
12
|
+
*
|
|
13
|
+
* That same property is why queued tasks need their own deadline. A task's request
|
|
14
|
+
* timeout only starts once it reaches the front of the queue, so without one a task
|
|
15
|
+
* can wait indefinitely — long past the point its caller gave up — and then still
|
|
16
|
+
* issue its request. `queueTimeoutMs` bounds the wait instead, failing the task with
|
|
17
|
+
* a reason that says the request was never sent.
|
|
18
|
+
*/
|
|
19
|
+
declare function createLimiter(maxConcurrent: number, { queueTimeoutMs }?: {
|
|
20
|
+
queueTimeoutMs?: number;
|
|
21
|
+
}): Limiter;
|
|
22
|
+
/**
|
|
23
|
+
* Associates a client with its account's limiters, sharing one pair across every
|
|
24
|
+
* client built for the same account.
|
|
25
|
+
*/
|
|
26
|
+
declare function registerClientLimiters(client: object, apiKey: string): void;
|
|
27
|
+
declare function getMoveLimiter(client: object): Limiter;
|
|
28
|
+
declare function getWriteLimiter(client: object): Limiter;
|
|
29
|
+
/** Test-only: drops all registered limiters so cases start from a clean slate. */
|
|
30
|
+
declare function resetLimitersForTesting(): void;
|
|
31
|
+
export { createLimiter, getMoveLimiter, getWriteLimiter, type Limiter, registerClientLimiters, resetLimitersForTesting, };
|
|
32
|
+
//# sourceMappingURL=concurrency.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"concurrency.d.ts","sourceRoot":"","sources":["../../src/utils/concurrency.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,KAAK,OAAO,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAA;AAetD;;;;;;;;;;;;;GAaG;AACH,iBAAS,aAAa,CAClB,aAAa,EAAE,MAAM,EACrB,EAAE,cAAgD,EAAE,GAAE;IAAE,cAAc,CAAC,EAAE,MAAM,CAAA;CAAO,GACvF,OAAO,CA8DT;AAsCD;;;GAGG;AACH,iBAAS,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAQpE;AAMD,iBAAS,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE/C;AAED,iBAAS,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEhD;AAED,kFAAkF;AAClF,iBAAS,uBAAuB,IAAI,IAAI,CAGvC;AAED,OAAO,EACH,aAAa,EACb,cAAc,EACd,eAAe,EACf,KAAK,OAAO,EACZ,sBAAsB,EACtB,uBAAuB,GAC1B,CAAA"}
|
|
@@ -50,6 +50,29 @@ export declare const BatchLimits: {
|
|
|
50
50
|
/** Maximum tasks accepted by one task create or update operation */
|
|
51
51
|
readonly TASKS_PER_OPERATION: 25;
|
|
52
52
|
};
|
|
53
|
+
export declare const ConcurrencyLimits: {
|
|
54
|
+
/**
|
|
55
|
+
* In-flight task-move requests per account.
|
|
56
|
+
*
|
|
57
|
+
* Kept at 1 because the API locks the whole task tree for a move, and a tree
|
|
58
|
+
* spans a task's source as well as its destination — two moves of sibling
|
|
59
|
+
* subtasks contend even when they target different projects, and the loser
|
|
60
|
+
* fails. Batching same-destination moves into a single request means
|
|
61
|
+
* serialising costs little in practice.
|
|
62
|
+
*/
|
|
63
|
+
readonly TASK_MOVES: 1;
|
|
64
|
+
/** In-flight non-move write requests per account. */
|
|
65
|
+
readonly WRITES: 4;
|
|
66
|
+
/**
|
|
67
|
+
* How long a request may wait for a slot before it is abandoned unsent.
|
|
68
|
+
*
|
|
69
|
+
* Matches the SDK's own 30s request timeout, which only starts once a request
|
|
70
|
+
* actually goes out: a task that has already waited that long would be
|
|
71
|
+
* answering a caller who has given up. Comfortably above the worst realistic
|
|
72
|
+
* queue (serialised moves to 100 distinct destinations is roughly 15s).
|
|
73
|
+
*/
|
|
74
|
+
readonly QUEUE_WAIT_MS: 30000;
|
|
75
|
+
};
|
|
53
76
|
export declare const ResponseConfig: {
|
|
54
77
|
/** Maximum characters per line in text responses */
|
|
55
78
|
readonly MAX_LINE_LENGTH: 100;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,eAAO,MAAM,SAAS;IAClB,sCAAsC;;IAEtC,wDAAwD;;IAExD,wCAAwC;;IAExC,wCAAwC;;IAExC,yCAAyC;;IAEzC,yCAAyC;;IAEzC,yCAAyC;;IAEzC,qDAAqD;;IAErD,iGAAiG;;IAEjG,yCAAyC;;IAEzC,2DAA2D;;IAE3D,8CAA8C;;IAE9C,gEAAgE;;IAEhE,uCAAuC;;IAEvC,uCAAuC;;IAEvC,0CAA0C;;IAE1C,mDAAmD;;CAE7C,CAAA;AAGV,eAAO,MAAM,aAAa;IACtB,oEAAoE;;IAEpE,gDAAgD;;CAE1C,CAAA;AAGV,eAAO,MAAM,WAAW;IACpB,oEAAoE;;CAE9D,CAAA;AAGV,eAAO,MAAM,cAAc;IACvB,oDAAoD;;IAEpD,mCAAmC;;CAE7B,CAAA"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,eAAO,MAAM,SAAS;IAClB,sCAAsC;;IAEtC,wDAAwD;;IAExD,wCAAwC;;IAExC,wCAAwC;;IAExC,yCAAyC;;IAEzC,yCAAyC;;IAEzC,yCAAyC;;IAEzC,qDAAqD;;IAErD,iGAAiG;;IAEjG,yCAAyC;;IAEzC,2DAA2D;;IAE3D,8CAA8C;;IAE9C,gEAAgE;;IAEhE,uCAAuC;;IAEvC,uCAAuC;;IAEvC,0CAA0C;;IAE1C,mDAAmD;;CAE7C,CAAA;AAGV,eAAO,MAAM,aAAa;IACtB,oEAAoE;;IAEpE,gDAAgD;;CAE1C,CAAA;AAGV,eAAO,MAAM,WAAW;IACpB,oEAAoE;;CAE9D,CAAA;AAGV,eAAO,MAAM,iBAAiB;IAC1B;;;;;;;;OAQG;;IAEH,qDAAqD;;IAErD;;;;;;;OAOG;;CAEG,CAAA;AAGV,eAAO,MAAM,cAAc;IACvB,oDAAoD;;IAEpD,mCAAmC;;CAE7B,CAAA"}
|
|
@@ -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"}
|