@todoist/mcp 0.0.1 → 15.0.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.
Files changed (197) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +217 -29
  3. package/dist/filter-helpers.d.ts +53 -0
  4. package/dist/filter-helpers.d.ts.map +1 -0
  5. package/dist/http-app.d.ts +28 -0
  6. package/dist/http-app.d.ts.map +1 -0
  7. package/dist/index.d.ts +4347 -0
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +61 -0
  10. package/dist/main-http.d.ts +3 -0
  11. package/dist/main-http.d.ts.map +1 -0
  12. package/dist/main-http.js +133 -0
  13. package/dist/main.d.ts +3 -0
  14. package/dist/main.d.ts.map +1 -0
  15. package/dist/main.js +16 -0
  16. package/dist/mcp-apps/index.html +116 -0
  17. package/dist/mcp-helpers.d.ts +62 -0
  18. package/dist/mcp-helpers.d.ts.map +1 -0
  19. package/dist/mcp-server-y4HhlBJW.js +8152 -0
  20. package/dist/mcp-server.d.ts +16 -0
  21. package/dist/mcp-server.d.ts.map +1 -0
  22. package/dist/middleware/require-trusted-host.d.ts +44 -0
  23. package/dist/middleware/require-trusted-host.d.ts.map +1 -0
  24. package/dist/middleware/require-valid-todoist-token.d.ts +39 -0
  25. package/dist/middleware/require-valid-todoist-token.d.ts.map +1 -0
  26. package/dist/prompts/productivity-analysis.d.ts +58 -0
  27. package/dist/prompts/productivity-analysis.d.ts.map +1 -0
  28. package/dist/require-valid-todoist-token-I1jh7sbd.js +63 -0
  29. package/dist/todoist-tool.d.ts +15 -0
  30. package/dist/todoist-tool.d.ts.map +1 -0
  31. package/dist/tool-execution-error.d.ts +27 -0
  32. package/dist/tool-execution-error.d.ts.map +1 -0
  33. package/dist/tool-helpers.d.ts +318 -0
  34. package/dist/tool-helpers.d.ts.map +1 -0
  35. package/dist/tool-registry.d.ts +4307 -0
  36. package/dist/tool-registry.d.ts.map +1 -0
  37. package/dist/tools/add-comments.d.ts +104 -0
  38. package/dist/tools/add-comments.d.ts.map +1 -0
  39. package/dist/tools/add-filters.d.ts +113 -0
  40. package/dist/tools/add-filters.d.ts.map +1 -0
  41. package/dist/tools/add-labels.d.ts +107 -0
  42. package/dist/tools/add-labels.d.ts.map +1 -0
  43. package/dist/tools/add-projects.d.ts +134 -0
  44. package/dist/tools/add-projects.d.ts.map +1 -0
  45. package/dist/tools/add-reminders.d.ts +174 -0
  46. package/dist/tools/add-reminders.d.ts.map +1 -0
  47. package/dist/tools/add-sections.d.ts +61 -0
  48. package/dist/tools/add-sections.d.ts.map +1 -0
  49. package/dist/tools/add-tasks.d.ts +123 -0
  50. package/dist/tools/add-tasks.d.ts.map +1 -0
  51. package/dist/tools/analyze-project-health.d.ts +45 -0
  52. package/dist/tools/analyze-project-health.d.ts.map +1 -0
  53. package/dist/tools/complete-tasks.d.ts +42 -0
  54. package/dist/tools/complete-tasks.d.ts.map +1 -0
  55. package/dist/tools/delete-object.d.ts +54 -0
  56. package/dist/tools/delete-object.d.ts.map +1 -0
  57. package/dist/tools/export-project-template.d.ts +54 -0
  58. package/dist/tools/export-project-template.d.ts.map +1 -0
  59. package/dist/tools/fetch-object.d.ts +243 -0
  60. package/dist/tools/fetch-object.d.ts.map +1 -0
  61. package/dist/tools/fetch.d.ts +41 -0
  62. package/dist/tools/fetch.d.ts.map +1 -0
  63. package/dist/tools/find-activity.d.ts +98 -0
  64. package/dist/tools/find-activity.d.ts.map +1 -0
  65. package/dist/tools/find-comments.d.ts +91 -0
  66. package/dist/tools/find-comments.d.ts.map +1 -0
  67. package/dist/tools/find-completed-tasks.d.ts +119 -0
  68. package/dist/tools/find-completed-tasks.d.ts.map +1 -0
  69. package/dist/tools/find-filters.d.ts +95 -0
  70. package/dist/tools/find-filters.d.ts.map +1 -0
  71. package/dist/tools/find-labels.d.ts +81 -0
  72. package/dist/tools/find-labels.d.ts.map +1 -0
  73. package/dist/tools/find-project-collaborators.d.ts +94 -0
  74. package/dist/tools/find-project-collaborators.d.ts.map +1 -0
  75. package/dist/tools/find-projects.d.ts +98 -0
  76. package/dist/tools/find-projects.d.ts.map +1 -0
  77. package/dist/tools/find-reminders.d.ts +99 -0
  78. package/dist/tools/find-reminders.d.ts.map +1 -0
  79. package/dist/tools/find-sections.d.ts +45 -0
  80. package/dist/tools/find-sections.d.ts.map +1 -0
  81. package/dist/tools/find-tasks-by-date.d.ts +137 -0
  82. package/dist/tools/find-tasks-by-date.d.ts.map +1 -0
  83. package/dist/tools/find-tasks.d.ts +120 -0
  84. package/dist/tools/find-tasks.d.ts.map +1 -0
  85. package/dist/tools/get-overview.d.ts +121 -0
  86. package/dist/tools/get-overview.d.ts.map +1 -0
  87. package/dist/tools/get-productivity-stats.d.ts +160 -0
  88. package/dist/tools/get-productivity-stats.d.ts.map +1 -0
  89. package/dist/tools/get-project-activity-stats.d.ts +48 -0
  90. package/dist/tools/get-project-activity-stats.d.ts.map +1 -0
  91. package/dist/tools/get-project-health.d.ts +104 -0
  92. package/dist/tools/get-project-health.d.ts.map +1 -0
  93. package/dist/tools/get-user-status.d.ts +35 -0
  94. package/dist/tools/get-user-status.d.ts.map +1 -0
  95. package/dist/tools/get-workspace-insights.d.ts +63 -0
  96. package/dist/tools/get-workspace-insights.d.ts.map +1 -0
  97. package/dist/tools/import-project-template.d.ts +148 -0
  98. package/dist/tools/import-project-template.d.ts.map +1 -0
  99. package/dist/tools/list-workspaces.d.ts +54 -0
  100. package/dist/tools/list-workspaces.d.ts.map +1 -0
  101. package/dist/tools/manage-assignments.d.ts +73 -0
  102. package/dist/tools/manage-assignments.d.ts.map +1 -0
  103. package/dist/tools/project-management.d.ts +82 -0
  104. package/dist/tools/project-management.d.ts.map +1 -0
  105. package/dist/tools/project-move.d.ts +92 -0
  106. package/dist/tools/project-move.d.ts.map +1 -0
  107. package/dist/tools/reorder-objects.d.ts +61 -0
  108. package/dist/tools/reorder-objects.d.ts.map +1 -0
  109. package/dist/tools/reschedule-tasks.d.ts +95 -0
  110. package/dist/tools/reschedule-tasks.d.ts.map +1 -0
  111. package/dist/tools/search.d.ts +43 -0
  112. package/dist/tools/search.d.ts.map +1 -0
  113. package/dist/tools/set-user-status.d.ts +51 -0
  114. package/dist/tools/set-user-status.d.ts.map +1 -0
  115. package/dist/tools/uncomplete-tasks.d.ts +42 -0
  116. package/dist/tools/uncomplete-tasks.d.ts.map +1 -0
  117. package/dist/tools/update-comments.d.ts +100 -0
  118. package/dist/tools/update-comments.d.ts.map +1 -0
  119. package/dist/tools/update-filters.d.ts +121 -0
  120. package/dist/tools/update-filters.d.ts.map +1 -0
  121. package/dist/tools/update-labels.d.ts +133 -0
  122. package/dist/tools/update-labels.d.ts.map +1 -0
  123. package/dist/tools/update-projects.d.ts +138 -0
  124. package/dist/tools/update-projects.d.ts.map +1 -0
  125. package/dist/tools/update-reminders.d.ts +176 -0
  126. package/dist/tools/update-reminders.d.ts.map +1 -0
  127. package/dist/tools/update-sections.d.ts +65 -0
  128. package/dist/tools/update-sections.d.ts.map +1 -0
  129. package/dist/tools/update-tasks.d.ts +135 -0
  130. package/dist/tools/update-tasks.d.ts.map +1 -0
  131. package/dist/tools/user-info.d.ts +57 -0
  132. package/dist/tools/user-info.d.ts.map +1 -0
  133. package/dist/tools/view-attachment.d.ts +25 -0
  134. package/dist/tools/view-attachment.d.ts.map +1 -0
  135. package/dist/usage-tracking.d.ts +36 -0
  136. package/dist/usage-tracking.d.ts.map +1 -0
  137. package/dist/utils/assignment-validator.d.ts +69 -0
  138. package/dist/utils/assignment-validator.d.ts.map +1 -0
  139. package/dist/utils/batch-failures.d.ts +25 -0
  140. package/dist/utils/batch-failures.d.ts.map +1 -0
  141. package/dist/utils/children.d.ts +68 -0
  142. package/dist/utils/children.d.ts.map +1 -0
  143. package/dist/utils/colors.d.ts +68 -0
  144. package/dist/utils/colors.d.ts.map +1 -0
  145. package/dist/utils/comment-recipients.d.ts +35 -0
  146. package/dist/utils/comment-recipients.d.ts.map +1 -0
  147. package/dist/utils/concurrency.d.ts +35 -0
  148. package/dist/utils/concurrency.d.ts.map +1 -0
  149. package/dist/utils/constants.d.ts +93 -0
  150. package/dist/utils/constants.d.ts.map +1 -0
  151. package/dist/utils/date.d.ts +18 -0
  152. package/dist/utils/date.d.ts.map +1 -0
  153. package/dist/utils/duration-parser.d.ts +39 -0
  154. package/dist/utils/duration-parser.d.ts.map +1 -0
  155. package/dist/utils/filter-description.d.ts +16 -0
  156. package/dist/utils/filter-description.d.ts.map +1 -0
  157. package/dist/utils/filter-resolver.d.ts +27 -0
  158. package/dist/utils/filter-resolver.d.ts.map +1 -0
  159. package/dist/utils/host.d.ts +6 -0
  160. package/dist/utils/host.d.ts.map +1 -0
  161. package/dist/utils/labels.d.ts +13 -0
  162. package/dist/utils/labels.d.ts.map +1 -0
  163. package/dist/utils/move-planner.d.ts +63 -0
  164. package/dist/utils/move-planner.d.ts.map +1 -0
  165. package/dist/utils/order-keys.d.ts +36 -0
  166. package/dist/utils/order-keys.d.ts.map +1 -0
  167. package/dist/utils/output-schemas.d.ts +209 -0
  168. package/dist/utils/output-schemas.d.ts.map +1 -0
  169. package/dist/utils/personal-project-limit.d.ts +31 -0
  170. package/dist/utils/personal-project-limit.d.ts.map +1 -0
  171. package/dist/utils/priorities.d.ts +14 -0
  172. package/dist/utils/priorities.d.ts.map +1 -0
  173. package/dist/utils/reminder-recipients.d.ts +21 -0
  174. package/dist/utils/reminder-recipients.d.ts.map +1 -0
  175. package/dist/utils/reminder-schemas.d.ts +41 -0
  176. package/dist/utils/reminder-schemas.d.ts.map +1 -0
  177. package/dist/utils/response-builders.d.ts +103 -0
  178. package/dist/utils/response-builders.d.ts.map +1 -0
  179. package/dist/utils/retry.d.ts +39 -0
  180. package/dist/utils/retry.d.ts.map +1 -0
  181. package/dist/utils/schema-helpers.d.ts +10 -0
  182. package/dist/utils/schema-helpers.d.ts.map +1 -0
  183. package/dist/utils/sync-commands.d.ts +21 -0
  184. package/dist/utils/sync-commands.d.ts.map +1 -0
  185. package/dist/utils/test-helpers.d.ts +118 -0
  186. package/dist/utils/test-helpers.d.ts.map +1 -0
  187. package/dist/utils/tool-names.d.ts +60 -0
  188. package/dist/utils/tool-names.d.ts.map +1 -0
  189. package/dist/utils/user-resolver.d.ts +92 -0
  190. package/dist/utils/user-resolver.d.ts.map +1 -0
  191. package/dist/utils/user-status.d.ts +32 -0
  192. package/dist/utils/user-status.d.ts.map +1 -0
  193. package/dist/utils/validate-todoist-token.d.ts +17 -0
  194. package/dist/utils/validate-todoist-token.d.ts.map +1 -0
  195. package/dist/utils/workspace-resolver.d.ts +31 -0
  196. package/dist/utils/workspace-resolver.d.ts.map +1 -0
  197. package/package.json +115 -8
@@ -0,0 +1,16 @@
1
+ import { McpServer } from '@modelcontextprotocol/server';
2
+ import { McpServerOptions } from '@todoist/mcp-core/host';
3
+ import { FEATURE_NAMES, Feature, FeatureName, Features } from './mcp-helpers.js';
4
+ export declare const instructions = "\n## Todoist Task and Project Management Tools\n\nYou have access to comprehensive Todoist management tools for personal productivity and team collaboration. Use these tools to help users manage tasks, projects, sections, comments, and assignments effectively.\n\n### Core Capabilities:\n- Create, update, complete, and search tasks with rich metadata (priorities, due dates, durations, assignments)\n- Manage projects and sections with flexible organization\n- Handle comments and collaboration features\n- Bulk assignment operations for team workflows\n- Get overviews and insights about workload and progress\n\n### Choosing between tools\n\nWhat each tool does and how to fill its parameters is in the tool's own description and input schema. This section covers only what those cannot: which tool to reach for, and how tools relate to each other.\n\n**Dates**\n\n- To move a task to a different date or time use **reschedule-tasks**, never **update-tasks**. It also sets duration, for time-blocking. update-tasks replaces the whole due string, so it refuses a dueString on a recurring task unless replaceRecurrence is true.\n- Never send a task's existing projectId, sectionId or parentId back to **update-tasks** \u2014 those fields are treated as a move.\n- All dates respect the user's timezone.\n- Todoist apps only display task durations under 24 hours. A longer one (\"36h\") or a day-based one (\"3d\") is stored and reported faithfully, but the apps show the task as having no duration \u2014 only set one when the user explicitly asks for it.\n\n**Finding things**\n\n- For \"what did I complete?\", call **user-info** for the asker's user ID, then **find-activity** with objectType=\"task\", eventType=\"completed\", initiatorId, and dateFrom/dateTo. Without initiatorId the answer covers every collaborator. find-activity reports completion events, including each occurrence of a recurring task; **find-completed-tasks** lists completed tasks, which is not the same question.\n- To resolve a person's name or email to a user ID, or to answer \"who is X?\", use **find-project-collaborators** with just a searchTerm. It covers every shared project you can access plus yourself, so an empty result means they collaborate on none of them \u2014 not that they do not exist.\n- Before assigning work to someone, call **find-project-collaborators** again with the target projectId. Resolving an ID only proves they collaborate on *some* project you can see; assignment fails unless they collaborate on that one.\n- To find out whether a task hides subtasks, use **fetch-object** with includeChildren rather than a speculative **find-tasks** call.\n- Filter tasks by label **name**. Label IDs are only for **delete-object** and **update-labels**. Shared labels can be renamed but not recoloured, reordered or favourited.\n\n**Comments**\n\n- Comments notify only the people **add-comments** is handed. When a comment mentions someone, name them in `notifyUsers` \u2014 writing \"@Ana\" in the text notifies nobody. Omit `notifyUsers` to notify whoever the Todoist apps would, or pass `[\"none\"]` to stay silent.\n- Notification cannot be sent when editing a comment, only when adding one.\n\n**Deleting and archiving**\n\n- **delete-object** removes every object type; there is no per-type delete tool. Reminders use type \"reminder\", location reminders \"location_reminder\".\n- A workspace project must be archived with **project-management** before it can be deleted. A personal project can be deleted directly.\n\n**Templates**\n\n- Templates cannot be listed through this server, so only use an ID or URL the user gave you. To start a new project from one, call **add-projects** first and import into it. Imports write immediately and cannot be undone.\n\n**Project health**\n\n- Health data may be stale \u2014 check the isStale flag, and call **analyze-project-health** to refresh it before reading again.\n\n**Batches**\n\n- Prefer a batch tool over one call per item.\n- Where a batch tool returns per-item `failures` alongside successes, one failure does not undo the rest: never retry the whole batch, re-send only the items whose failure reason is fixable. **reschedule-tasks** is the exception \u2014 it has no per-item failures and throws if any task fails, so retry it as a whole.\n\nUse the **productivity-analysis** prompt for a combined productivity review \u2014 it pulls together user-info, get-productivity-stats and find-completed-tasks.\n\nAlways provide clear, actionable task titles and descriptions. Use the overview tools to give users context about their workload and project status.\n";
5
+ /**
6
+ * Create the MCP server.
7
+ * @param token - The user's Todoist API token.
8
+ * @param baseUrl - The base URL for the todoist API.
9
+ * @param features - Features to enable for the server.
10
+ * @returns the MCP server.
11
+ */
12
+ declare function getMcpServer({ token, baseUrl, features, }: McpServerOptions & {
13
+ features?: Features;
14
+ }): McpServer;
15
+ export { FEATURE_NAMES, type Feature, type FeatureName, type Features, getMcpServer };
16
+ //# sourceMappingURL=mcp-server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../src/mcp-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAE9D,OAAO,EACH,aAAa,EACb,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,QAAQ,EAEhB,MAAM,kBAAkB,CAAA;AAMzB,eAAO,MAAM,YAAY,qhJAyDxB,CAAA;AAgBD;;;;;;GAMG;AAEH,iBAAS,YAAY,CAAC,EAClB,KAAK,EACL,OAAO,EACP,QAAa,GAChB,EAAE,gBAAgB,GAAG;IAClB,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACtB,aA+CA;AAED,OAAO,EAAE,aAAa,EAAE,KAAK,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,QAAQ,EAAE,YAAY,EAAE,CAAA"}
@@ -0,0 +1,44 @@
1
+ import { RequestHandler } from 'express';
2
+ type RequireTrustedHostOptions = {
3
+ /**
4
+ * Port-agnostic hostnames permitted in the `Host` and `Origin` headers.
5
+ * IPv6 entries must be bracketed, e.g. `[::1]`. Invalid entries cause
6
+ * {@link requireTrustedHost} to throw at construction time (fail fast).
7
+ */
8
+ allowedHosts: string[];
9
+ };
10
+ /**
11
+ * Loopback hostnames always trusted by {@link requireTrustedHost}. Stored
12
+ * bracketed for IPv6 because `new URL('http://[::1]').hostname` returns `[::1]`.
13
+ */
14
+ declare const DEFAULT_ALLOWED_HOSTS: string[];
15
+ /**
16
+ * Build the list of hostnames trusted in the Host and Origin headers. Always
17
+ * includes the loopback defaults, plus any names from `allowedHostsEnv`
18
+ * (comma-separated), plus the configured `host` (so an explicit bind — loopback
19
+ * alias like 127.0.1.1, a LAN IP, etc. — is always trusted). Bind wildcards
20
+ * (0.0.0.0/::) are never added because they are never valid Host header values —
21
+ * operators exposing on a wildcard must enumerate client hostnames via
22
+ * ALLOWED_HOSTS.
23
+ */
24
+ declare function buildAllowedHosts(host: string, allowedHostsEnv?: string): string[];
25
+ /**
26
+ * Express middleware that rejects requests whose `Host` or `Origin` header is
27
+ * not in the trusted allowlist. This is DNS-rebinding protection: a malicious
28
+ * website that rebinds its domain to a victim's loopback address keeps its own
29
+ * `Host`/`Origin`, so string-matching against the allowlist (we never DNS
30
+ * resolve) blocks the request before it can reach the MCP transport.
31
+ *
32
+ * - Missing `Host` → 403.
33
+ * - `Host` hostname not in the allowlist → 403.
34
+ * - `Origin` absent → allowed (non-browser clients such as `mcp-remote`/`curl`
35
+ * send none; the browser attack path always sends one).
36
+ * - `Origin` present but untrusted or unparseable → 403.
37
+ *
38
+ * Throws at construction time if `allowedHosts` contains an entry that isn't a
39
+ * valid authority, so misconfiguration fails fast instead of becoming opaque
40
+ * 403s at request time.
41
+ */
42
+ declare function requireTrustedHost(options: RequireTrustedHostOptions): RequestHandler;
43
+ export { DEFAULT_ALLOWED_HOSTS, buildAllowedHosts, requireTrustedHost, type RequireTrustedHostOptions, };
44
+ //# sourceMappingURL=require-trusted-host.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"require-trusted-host.d.ts","sourceRoot":"","sources":["../../src/middleware/require-trusted-host.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAyB,cAAc,EAAY,MAAM,SAAS,CAAA;AAG9E,KAAK,yBAAyB,GAAG;IAC7B;;;;OAIG;IACH,YAAY,EAAE,MAAM,EAAE,CAAA;CACzB,CAAA;AAED;;;GAGG;AACH,QAAA,MAAM,qBAAqB,UAAsC,CAAA;AA4CjE;;;;;;;;GAQG;AACH,iBAAS,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAkB3E;AAUD;;;;;;;;;;;;;;;;GAgBG;AACH,iBAAS,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,cAAc,CAyC9E;AAED,OAAO,EACH,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,KAAK,yBAAyB,GACjC,CAAA"}
@@ -0,0 +1,39 @@
1
+ import { Request, RequestHandler } from 'express';
2
+ type StaticTokenSource = {
3
+ type: 'static';
4
+ apiKey: string;
5
+ baseUrl?: string;
6
+ };
7
+ type DynamicTokenSource = {
8
+ type: 'dynamic';
9
+ getApiKey: (req: Request) => string | undefined;
10
+ baseUrl?: string;
11
+ };
12
+ type TokenSource = StaticTokenSource | DynamicTokenSource;
13
+ type RequireValidTodoistTokenOptions = TokenSource & {
14
+ /**
15
+ * Cache TTL in milliseconds. Defaults to 300_000 (5 minutes) for static,
16
+ * 120_000 (2 minutes) for dynamic.
17
+ */
18
+ cacheTtlMs?: number;
19
+ /**
20
+ * URL for the Protected Resource Metadata document (RFC 9728).
21
+ * Included in the WWW-Authenticate header when returning 401.
22
+ * If omitted, the header is sent without resource_metadata.
23
+ */
24
+ resourceMetadataUrl?: string;
25
+ };
26
+ /**
27
+ * Express middleware that validates the Todoist API token before MCP processing.
28
+ *
29
+ * Returns HTTP 401 with a spec-compliant WWW-Authenticate header if the token
30
+ * is invalid, allowing MCP clients to trigger OAuth token refresh, and 403 with
31
+ * an `insufficient_scope` challenge if it lacks a scope the tools need.
32
+ */
33
+ declare function requireValidTodoistToken(options: RequireValidTodoistTokenOptions): RequestHandler;
34
+ /**
35
+ * Clear the token validation cache. Useful for testing.
36
+ */
37
+ declare function clearTokenValidationCache(): void;
38
+ export { clearTokenValidationCache, requireValidTodoistToken, type RequireValidTodoistTokenOptions };
39
+ //# sourceMappingURL=require-valid-todoist-token.d.ts.map
@@ -0,0 +1 @@
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,58 @@
1
+ import { GetPromptResult } from '@modelcontextprotocol/server';
2
+ import { z } from 'zod';
3
+ declare const argsSchema: z.ZodObject<{
4
+ period: z.ZodDefault<z.ZodEnum<{
5
+ today: "today";
6
+ "7d": "7d";
7
+ "14d": "14d";
8
+ "30d": "30d";
9
+ "this-week": "this-week";
10
+ "this-month": "this-month";
11
+ }>>;
12
+ focus: z.ZodDefault<z.ZodEnum<{
13
+ overall: "overall";
14
+ goals: "goals";
15
+ projects: "projects";
16
+ trends: "trends";
17
+ recommendations: "recommendations";
18
+ }>>;
19
+ projectId: z.ZodOptional<z.ZodString>;
20
+ }, z.core.$strip>;
21
+ type PromptArgs = z.infer<typeof argsSchema>;
22
+ /**
23
+ * Compute the date range (since/until as YYYY-MM-DD) for a given period.
24
+ * Uses UTC since the prompt instructs the LLM to call user-info for timezone.
25
+ */
26
+ declare function computeDateRange(period: PromptArgs['period'], now?: Date): {
27
+ since: string;
28
+ until: string;
29
+ periodDescription: string;
30
+ };
31
+ declare function buildPromptText(args: PromptArgs): string;
32
+ declare function callback(args: PromptArgs): GetPromptResult;
33
+ declare const productivityAnalysis: {
34
+ name: string;
35
+ title: string;
36
+ description: string;
37
+ argsSchema: z.ZodObject<{
38
+ period: z.ZodDefault<z.ZodEnum<{
39
+ today: "today";
40
+ "7d": "7d";
41
+ "14d": "14d";
42
+ "30d": "30d";
43
+ "this-week": "this-week";
44
+ "this-month": "this-month";
45
+ }>>;
46
+ focus: z.ZodDefault<z.ZodEnum<{
47
+ overall: "overall";
48
+ goals: "goals";
49
+ projects: "projects";
50
+ trends: "trends";
51
+ recommendations: "recommendations";
52
+ }>>;
53
+ projectId: z.ZodOptional<z.ZodString>;
54
+ }, z.core.$strip>;
55
+ callback: typeof callback;
56
+ };
57
+ export { buildPromptText, computeDateRange, productivityAnalysis };
58
+ //# sourceMappingURL=productivity-analysis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"productivity-analysis.d.ts","sourceRoot":"","sources":["../../src/prompts/productivity-analysis.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AACnE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;iBAiBd,CAAA;AAEF,KAAK,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAA;AAE5C;;;GAGG;AACH,iBAAS,gBAAgB,CACrB,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,EAC5B,GAAG,GAAE,IAAiB,GACvB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,CA0D7D;AAwCD,iBAAS,eAAe,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAkCjD;AAED,iBAAS,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,eAAe,CAYnD;AAED,QAAA,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;CAOzB,CAAA;AAED,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,CAAA"}
@@ -0,0 +1,63 @@
1
+ import { validateBearerToken as _, createTokenVerdictCache as p, buildBearerChallenge as u } from "@todoist/mcp-core/host";
2
+ import { $ as v, a0 as A } from "./mcp-server-y4HhlBJW.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
+ };
@@ -0,0 +1,15 @@
1
+ import { TodoistApi } from '@doist/todoist-sdk';
2
+ import { AnyMcpTool, ExecuteResult, McpTool, RequiredToolAnnotations } from '@todoist/mcp-core';
3
+ import { z } from 'zod';
4
+ /**
5
+ * A Todoist tool that can be used in an MCP server or other conversational AI interfaces: an
6
+ * `McpTool` whose `execute` receives the Todoist API client.
7
+ */
8
+ type TodoistTool<Params extends z.ZodRawShape, Output extends z.ZodRawShape = Record<string, never>> = McpTool<Params, Output, TodoistApi>;
9
+ /**
10
+ * A Todoist tool of any parameter and output shape, for collections that hold tools of mixed
11
+ * shapes. Individual tools keep their precise types through their own `satisfies TodoistTool<...>`.
12
+ */
13
+ type AnyTodoistTool = AnyMcpTool<TodoistApi>;
14
+ export type { AnyTodoistTool, ExecuteResult, RequiredToolAnnotations, TodoistTool };
15
+ //# sourceMappingURL=todoist-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"todoist-tool.d.ts","sourceRoot":"","sources":["../src/todoist-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AACpG,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAE5B;;;GAGG;AACH,KAAK,WAAW,CACZ,MAAM,SAAS,CAAC,CAAC,WAAW,EAC5B,MAAM,SAAS,CAAC,CAAC,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IACpD,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,CAAA;AAEvC;;;GAGG;AACH,KAAK,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC,CAAA;AAE5C,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,uBAAuB,EAAE,WAAW,EAAE,CAAA"}
@@ -0,0 +1,27 @@
1
+ export declare class DueStringParseError extends Error {
2
+ constructor(message: string);
3
+ }
4
+ /**
5
+ * Compact single-line variant of {@link formatToolExecutionError} for batch
6
+ * tools that report per-item failures. Unlike `error.message` (which for SDK
7
+ * errors is just "HTTP 403: Forbidden"), this preserves the API error signals
8
+ * (status, code, tag) so failures like MAX_ITEMS_LIMIT_REACHED stay
9
+ * recognizable after aggregation.
10
+ */
11
+ export declare function formatBatchItemError(error: unknown): string;
12
+ /**
13
+ * Return task-specific recovery guidance only when Todoist rejected a supplied
14
+ * natural-language due string. The REST API currently returns the generic
15
+ * text "Invalid date format" without a stable field/tag, so callers must pass
16
+ * the known field context before we use that fallback.
17
+ */
18
+ export declare function formatDueStringParseError(error: unknown, { taskContent, dueString, deadlineDate, }: {
19
+ taskContent: string;
20
+ dueString: string | undefined;
21
+ deadlineDate?: string;
22
+ }): string | undefined;
23
+ /**
24
+ * Format tool execution errors in a consistent, actionable format.
25
+ */
26
+ export declare function formatToolExecutionError(error: unknown): string;
27
+ //# sourceMappingURL=tool-execution-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-execution-error.d.ts","sourceRoot":"","sources":["../src/tool-execution-error.ts"],"names":[],"mappings":"AA+fA,qBAAa,mBAAoB,SAAQ,KAAK;gBAC9B,OAAO,EAAE,MAAM;CAI9B;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAkB3D;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACrC,KAAK,EAAE,OAAO,EACd,EACI,WAAW,EACX,SAAS,EACT,YAAY,GACf,EAAE;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,GACjF,MAAM,GAAG,SAAS,CA+BpB;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAe/D"}
@@ -0,0 +1,318 @@
1
+ import { isPersonalProject, isWorkspaceProject, ActivityEvent, ColorKey, Comment, CurrentUser, Label, MoveTaskArgs, PersonalProject, Reminder, Section, Task, TodoistApi, WorkspaceProject } from '@doist/todoist-sdk';
2
+ export { appendToQuery, buildResponsibleUserQueryFilter, filterTasksByResponsibleUser, RESPONSIBLE_USER_FILTERING, type ResponsibleUserFiltering, resolveResponsibleUser, } from './filter-helpers.js';
3
+ export type Project = PersonalProject | WorkspaceProject;
4
+ export { isPersonalProject, isWorkspaceProject };
5
+ /**
6
+ * Checks if a project ID represents the inbox (case-insensitive).
7
+ *
8
+ * @param projectId - The project ID to check
9
+ * @returns true if the project ID is inbox-like
10
+ */
11
+ export declare function isInboxProjectId(projectId: string | undefined): boolean;
12
+ /**
13
+ * Resolves "inbox" project ID to actual inbox project ID (case-insensitive).
14
+ * Only makes API calls when necessary (when projectId is inbox-like and user not provided).
15
+ *
16
+ * @param args - Configuration object
17
+ * @param args.projectId - The project ID to resolve (may be "inbox", "Inbox", etc.)
18
+ * @param args.user - The current user object (if already fetched)
19
+ * @param args.client - The API client (if user needs to be fetched)
20
+ * @returns Promise resolving to the resolved project ID
21
+ */
22
+ export declare function resolveInboxProjectId(args: {
23
+ projectId: string | undefined;
24
+ user?: CurrentUser;
25
+ client?: TodoistApi;
26
+ }): Promise<string | undefined>;
27
+ /**
28
+ * Generic pagination utility for Todoist API methods
29
+ *
30
+ * Recursively fetches all pages of data from paginated Todoist API endpoints.
31
+ *
32
+ * @template TArgs - The type of arguments accepted by the API method
33
+ * @template TResponse - The type of response returned by the API method
34
+ * @template TResult - The type of individual result items in the response
35
+ *
36
+ * @param options - Configuration options
37
+ * @param options.apiMethod - The Todoist API method to call (e.g., todoistApi.getLabels)
38
+ * @param options.args - Initial arguments to pass to the API method (excluding cursor and limit)
39
+ * @param options.limit - Number of items to fetch per page (default: 100)
40
+ * @returns Promise resolving to an array of all result items across all pages
41
+ *
42
+ * @example
43
+ * const allLabels = await fetchAllPages({
44
+ * apiMethod: (args) => todoistApi.getLabels(args),
45
+ * args: {},
46
+ * limit: 100
47
+ * })
48
+ */
49
+ export declare function fetchAllPages<TArgs extends {
50
+ cursor?: string | null;
51
+ limit?: number;
52
+ }, TResponse extends {
53
+ results: TResult[];
54
+ nextCursor: string | null;
55
+ }, TResult>(options: {
56
+ apiMethod: (args: TArgs) => Promise<TResponse>;
57
+ args?: Omit<TArgs, 'cursor' | 'limit'>;
58
+ limit?: number;
59
+ }): Promise<TResult[]>;
60
+ /**
61
+ * Wraps a search query with wildcards for substring matching.
62
+ * If the query already contains unescaped wildcards, it is returned as-is
63
+ * to preserve intentional wildcard patterns (e.g. prefix matching with "work*").
64
+ */
65
+ export declare function toWildcardQuery(query: string): string;
66
+ /**
67
+ * Searches projects by name and fetches all matching pages.
68
+ *
69
+ * @param client - The Todoist API client
70
+ * @param query - The search query string
71
+ * @returns Promise resolving to array of matching projects
72
+ */
73
+ export declare function searchAllProjects(client: TodoistApi, query: string): Promise<Project[]>;
74
+ /**
75
+ * Fetches all active (non-archived) projects across every page.
76
+ *
77
+ * Each page is retried on its own, so a transient failure part-way through does
78
+ * not refetch the pages already read.
79
+ *
80
+ * @param client - The Todoist API client
81
+ * @returns Promise resolving to array of active projects
82
+ */
83
+ export declare function fetchAllActiveProjects(client: TodoistApi): Promise<Project[]>;
84
+ /**
85
+ * Fetches all archived projects across every page.
86
+ *
87
+ * The API has no server-side search for archived projects, so callers that need
88
+ * to filter by name should fetch all and filter client-side with
89
+ * {@link matchesWildcardQuery}.
90
+ *
91
+ * @param client - The Todoist API client
92
+ * @returns Promise resolving to array of archived projects
93
+ */
94
+ export declare function fetchAllArchivedProjects(client: TodoistApi): Promise<Project[]>;
95
+ /**
96
+ * Compiles a search query into a case-insensitive RegExp using the same wildcard
97
+ * semantics as server-side search (see {@link toWildcardQuery}): `*` matches any
98
+ * sequence, `\*` is a literal asterisk, and every other character (backslashes
99
+ * included) is matched literally. A query without an unescaped `*` matches as a
100
+ * substring; otherwise the whole name must match.
101
+ *
102
+ * Compile once and reuse the result when filtering many names (e.g. archived
103
+ * projects), rather than calling {@link matchesWildcardQuery} per item.
104
+ */
105
+ export declare function compileWildcardQuery(query: string): RegExp;
106
+ /**
107
+ * Tests whether a name matches a search query using the same wildcard semantics
108
+ * as server-side search. Used for client-side filtering where the API exposes no
109
+ * search endpoint (e.g. archived projects). For bulk filtering, prefer
110
+ * {@link compileWildcardQuery} so the pattern is compiled only once.
111
+ */
112
+ export declare function matchesWildcardQuery(name: string, query: string): boolean;
113
+ /**
114
+ * Searches labels by name and fetches all matching pages.
115
+ *
116
+ * @param client - The Todoist API client
117
+ * @param query - The search query string
118
+ * @returns Promise resolving to array of matching labels
119
+ */
120
+ export declare function searchAllLabels(client: TodoistApi, query: string): Promise<Label[]>;
121
+ export declare function fetchAllSharedLabels(client: TodoistApi): Promise<string[]>;
122
+ /**
123
+ * Searches sections by name (optionally scoped to a project) and fetches all matching pages.
124
+ *
125
+ * @param client - The Todoist API client
126
+ * @param query - The search query string
127
+ * @param projectId - Optional project ID to scope the search
128
+ * @returns Promise resolving to array of matching sections
129
+ */
130
+ export declare function searchAllSections(client: TodoistApi, query: string, projectId?: string): Promise<Section[]>;
131
+ /**
132
+ * Creates a MoveTaskArgs object from move parameters, validating that exactly one is provided.
133
+ * @param taskId - The task ID (used for error messages)
134
+ * @param projectId - Optional project ID to move to
135
+ * @param sectionId - Optional section ID to move to
136
+ * @param parentId - Optional parent ID to move to
137
+ * @returns MoveTaskArgs object with exactly one destination
138
+ * @throws Error if multiple move parameters are provided or none are provided
139
+ */
140
+ export declare function createMoveTaskArgs(taskId: string, projectId?: string, sectionId?: string, parentId?: string): MoveTaskArgs;
141
+ /**
142
+ * Map a single Todoist task to a more structured format, for LLM consumption.
143
+ * @param task - The task to map.
144
+ * @returns The mapped task.
145
+ */
146
+ declare function mapTask(task: Task): {
147
+ id: string;
148
+ content: string;
149
+ description: string;
150
+ dueDate: string | undefined;
151
+ recurring: string | boolean;
152
+ deadlineDate: string | undefined;
153
+ priority: "p1" | "p2" | "p3" | "p4";
154
+ projectId: string;
155
+ sectionId: string | undefined;
156
+ parentId: string | undefined;
157
+ labels: string[];
158
+ duration: string | undefined;
159
+ responsibleUid: string | undefined;
160
+ assignedByUid: string | undefined;
161
+ isDeleted: true | undefined;
162
+ checked: boolean;
163
+ completedAt: string | undefined;
164
+ addedAt: string | undefined;
165
+ };
166
+ type MappedTask = ReturnType<typeof mapTask>;
167
+ /**
168
+ * Map a single Todoist project to a more structured format, for LLM consumption.
169
+ * @param project - The project to map.
170
+ * @returns The mapped project.
171
+ */
172
+ declare function mapProject(project: Project): {
173
+ id: string;
174
+ name: string;
175
+ description: string;
176
+ color: ColorKey;
177
+ isFavorite: boolean;
178
+ isShared: boolean;
179
+ parentId: string | undefined;
180
+ inboxProject: boolean;
181
+ viewStyle: string;
182
+ workspaceId: string | undefined;
183
+ folderId: string | undefined;
184
+ childOrder: number;
185
+ isArchived: boolean;
186
+ };
187
+ /**
188
+ * Map a single Todoist comment to a more structured format, for LLM consumption.
189
+ * @param comment - The comment to map.
190
+ * @returns The mapped comment.
191
+ */
192
+ declare function mapComment(comment: Comment): {
193
+ id: string;
194
+ taskId: string | undefined;
195
+ projectId: string | undefined;
196
+ content: string;
197
+ postedAt: string;
198
+ postedUid: string;
199
+ notifiedUserIds: string[] | undefined;
200
+ fileAttachment: {
201
+ resourceType: string;
202
+ fileName: string | undefined;
203
+ fileSize: number | undefined;
204
+ fileType: string | undefined;
205
+ fileUrl: string | undefined;
206
+ fileDuration: number | undefined;
207
+ uploadState: "pending" | "completed" | undefined;
208
+ url: string | undefined;
209
+ title: string | undefined;
210
+ image: string | undefined;
211
+ imageWidth: number | undefined;
212
+ imageHeight: number | undefined;
213
+ } | undefined;
214
+ };
215
+ /**
216
+ * Map a single Todoist activity event to a more structured format, for LLM consumption.
217
+ * @param event - The activity event to map.
218
+ * @returns The mapped activity event.
219
+ */
220
+ declare function mapActivityEvent(event: ActivityEvent): {
221
+ id: string | undefined;
222
+ objectType: string;
223
+ objectId: string;
224
+ eventType: string;
225
+ eventDate: string;
226
+ parentProjectId: string | undefined;
227
+ parentItemId: string | undefined;
228
+ initiatorId: string | undefined;
229
+ extraData: Record<string, any> | undefined;
230
+ };
231
+ /**
232
+ * Normalize first-page cursor values commonly emitted by schema-driven clients.
233
+ */
234
+ export declare function normalizePaginationCursor(cursor: string | undefined): string | undefined;
235
+ declare function getTasksByFilter({ client, query, limit, cursor, }: {
236
+ client: TodoistApi;
237
+ query: string;
238
+ limit: number | undefined;
239
+ cursor: string | undefined;
240
+ }): Promise<{
241
+ tasks: {
242
+ id: string;
243
+ content: string;
244
+ description: string;
245
+ dueDate: string | undefined;
246
+ recurring: string | boolean;
247
+ deadlineDate: string | undefined;
248
+ priority: "p1" | "p2" | "p3" | "p4";
249
+ projectId: string;
250
+ sectionId: string | undefined;
251
+ parentId: string | undefined;
252
+ labels: string[];
253
+ duration: string | undefined;
254
+ responsibleUid: string | undefined;
255
+ assignedByUid: string | undefined;
256
+ isDeleted: true | undefined;
257
+ checked: boolean;
258
+ completedAt: string | undefined;
259
+ addedAt: string | undefined;
260
+ }[];
261
+ nextCursor: string | null;
262
+ }>;
263
+ /**
264
+ * Map a single Todoist reminder to a more structured format, for LLM consumption.
265
+ * Normalizes SDK's `itemId` to `taskId` for consistency with other tools.
266
+ * @param reminder - The reminder to map (any of the 3 types).
267
+ * @returns The mapped reminder.
268
+ */
269
+ declare function mapReminder(reminder: Reminder): {
270
+ minuteOffset: number;
271
+ due: {
272
+ isRecurring: boolean;
273
+ string: string;
274
+ date: string;
275
+ datetime: string | undefined;
276
+ timezone: string | undefined;
277
+ } | undefined;
278
+ isUrgent: boolean | undefined;
279
+ id: string;
280
+ taskId: string;
281
+ type: "location" | "absolute" | "relative";
282
+ notifyUid: string;
283
+ } | {
284
+ due: {
285
+ isRecurring: boolean;
286
+ string: string;
287
+ date: string;
288
+ datetime: string | undefined;
289
+ timezone: string | undefined;
290
+ };
291
+ isUrgent: boolean | undefined;
292
+ id: string;
293
+ taskId: string;
294
+ type: "location" | "absolute" | "relative";
295
+ notifyUid: string;
296
+ } | {
297
+ name: string;
298
+ locLat: string;
299
+ locLong: string;
300
+ locTrigger: "on_enter" | "on_leave";
301
+ radius: number;
302
+ id: string;
303
+ taskId: string;
304
+ type: "location" | "absolute" | "relative";
305
+ notifyUid: string;
306
+ };
307
+ /**
308
+ * Count reminders by category: time-based (relative/absolute) and location.
309
+ */
310
+ declare function countRemindersByType(reminders: {
311
+ type: string;
312
+ }[]): {
313
+ timeBasedCount: number;
314
+ locationCount: number;
315
+ };
316
+ export type { MappedTask };
317
+ export { countRemindersByType, getTasksByFilter, mapActivityEvent, mapComment, mapProject, mapReminder, mapTask, };
318
+ //# sourceMappingURL=tool-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-helpers.d.ts","sourceRoot":"","sources":["../src/tool-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,iBAAiB,EAC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