@doist/todoist-mcp 12.2.2 → 12.2.3

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-S9IIW20j.js";
2
2
  const y = /* @__PURE__ */ new Set([401, 403]);
3
3
  function C(e) {
4
4
  const t = T(e);
@@ -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.3",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",