@doist/todoist-mcp 12.2.2 → 12.2.4

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.
@@ -1,4 +1,4 @@
1
- import { P as A, Q as v, R as T } from "./mcp-server-DC5QFthT.js";
1
+ import { P as A, Q as v, R as T } from "./mcp-server-CJwB10bN.js";
2
2
  const y = /* @__PURE__ */ new Set([401, 403]);
3
3
  function C(e) {
4
4
  const t = T(e);
@@ -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;AAoIvB,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAsBqB,MAAM;uBAAS,MAAM;uBAAS,MAAM;;;;;;;;;CAsDX,CAAA;AA8M/D,OAAO,EAAE,WAAW,EAAE,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
- {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,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"}
@@ -1,10 +1,32 @@
1
+ /**
2
+ * Floor for a jittered delay so a low random draw can't turn a retry into an
3
+ * immediate re-request. Clamped by the computed ceiling, so an explicit
4
+ * zero-delay config (used by tests) still waits nothing.
5
+ */
6
+ declare const MIN_RETRY_DELAY_MS = 50;
1
7
  type RetryConfig = {
2
8
  maxRetries?: number;
3
9
  baseDelayMs?: number;
4
10
  maxDelayMs?: number;
11
+ /** Injectable randomness for deterministic tests. Defaults to `Math.random`. */
12
+ random?: () => number;
5
13
  };
6
14
  declare function extractHttpStatusCode(error: unknown): number | undefined;
7
15
  declare function isTransientError(error: unknown): boolean;
16
+ /**
17
+ * Exponential backoff with full jitter: the delay is a random point in
18
+ * `[0, cap]` rather than the cap itself.
19
+ *
20
+ * Without jitter, a batch of requests that all fail together retry in lockstep
21
+ * and hit the server as another simultaneous burst — the same contention that
22
+ * caused the first failure. Spreading the retries is what breaks that cycle.
23
+ */
24
+ declare function getRetryDelay({ attempt, baseDelayMs, maxDelayMs, random, }: {
25
+ attempt: number;
26
+ baseDelayMs: number;
27
+ maxDelayMs: number;
28
+ random?: () => number;
29
+ }): number;
8
30
  declare function executeWithRetry<T>(fn: () => Promise<T>, config?: RetryConfig): Promise<T>;
9
- export { executeWithRetry, extractHttpStatusCode, isTransientError, type RetryConfig };
31
+ export { executeWithRetry, extractHttpStatusCode, getRetryDelay, isTransientError, MIN_RETRY_DELAY_MS, type RetryConfig, };
10
32
  //# sourceMappingURL=retry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../src/utils/retry.ts"],"names":[],"mappings":"AAMA,KAAK,WAAW,GAAG;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,iBAAS,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CA2BjE;AAED,iBAAS,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAGjD;AAmBD,iBAAe,gBAAgB,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,GAAE,WAAgB,GAAG,OAAO,CAAC,CAAC,CAAC,CAwB7F;AAED,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,KAAK,WAAW,EAAE,CAAA"}
1
+ {"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../src/utils/retry.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,QAAA,MAAM,kBAAkB,KAAK,CAAA;AAI7B,KAAK,WAAW,GAAG;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,gFAAgF;IAChF,MAAM,CAAC,EAAE,MAAM,MAAM,CAAA;CACxB,CAAA;AAED,iBAAS,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CA2BjE;AAED,iBAAS,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAGjD;AAED;;;;;;;GAOG;AACH,iBAAS,aAAa,CAAC,EACnB,OAAO,EACP,WAAW,EACX,UAAU,EACV,MAAoB,GACvB,EAAE;IACC,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,MAAM,CAAA;CACxB,GAAG,MAAM,CAIT;AAMD,iBAAe,gBAAgB,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,GAAE,WAAgB,GAAG,OAAO,CAAC,CAAC,CAAC,CAyB7F;AAED,OAAO,EACH,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,WAAW,GACnB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doist/todoist-mcp",
3
- "version": "12.2.2",
3
+ "version": "12.2.4",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",