@diskd-ai/email-mcp 0.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.
Files changed (295) hide show
  1. package/LICENSE +155 -0
  2. package/README.md +820 -0
  3. package/dist/cli/account-commands.d.ts +10 -0
  4. package/dist/cli/account-commands.d.ts.map +1 -0
  5. package/dist/cli/account-commands.js +703 -0
  6. package/dist/cli/account-commands.js.map +1 -0
  7. package/dist/cli/config-commands.d.ts +9 -0
  8. package/dist/cli/config-commands.d.ts.map +1 -0
  9. package/dist/cli/config-commands.js +156 -0
  10. package/dist/cli/config-commands.js.map +1 -0
  11. package/dist/cli/guard.d.ts +11 -0
  12. package/dist/cli/guard.d.ts.map +1 -0
  13. package/dist/cli/guard.js +18 -0
  14. package/dist/cli/guard.js.map +1 -0
  15. package/dist/cli/install-commands.d.ts +12 -0
  16. package/dist/cli/install-commands.d.ts.map +1 -0
  17. package/dist/cli/install-commands.js +320 -0
  18. package/dist/cli/install-commands.js.map +1 -0
  19. package/dist/cli/notify.d.ts +8 -0
  20. package/dist/cli/notify.d.ts.map +1 -0
  21. package/dist/cli/notify.js +143 -0
  22. package/dist/cli/notify.js.map +1 -0
  23. package/dist/cli/providers.d.ts +13 -0
  24. package/dist/cli/providers.d.ts.map +1 -0
  25. package/dist/cli/providers.js +180 -0
  26. package/dist/cli/providers.js.map +1 -0
  27. package/dist/cli/scheduler.d.ts +8 -0
  28. package/dist/cli/scheduler.d.ts.map +1 -0
  29. package/dist/cli/scheduler.js +268 -0
  30. package/dist/cli/scheduler.js.map +1 -0
  31. package/dist/cli/setup.d.ts +12 -0
  32. package/dist/cli/setup.d.ts.map +1 -0
  33. package/dist/cli/setup.js +15 -0
  34. package/dist/cli/setup.js.map +1 -0
  35. package/dist/cli/test.d.ts +7 -0
  36. package/dist/cli/test.d.ts.map +1 -0
  37. package/dist/cli/test.js +67 -0
  38. package/dist/cli/test.js.map +1 -0
  39. package/dist/config/loader.d.ts +34 -0
  40. package/dist/config/loader.d.ts.map +1 -0
  41. package/dist/config/loader.js +339 -0
  42. package/dist/config/loader.js.map +1 -0
  43. package/dist/config/schema.d.ts +351 -0
  44. package/dist/config/schema.d.ts.map +1 -0
  45. package/dist/config/schema.js +165 -0
  46. package/dist/config/schema.js.map +1 -0
  47. package/dist/config/xdg.d.ts +27 -0
  48. package/dist/config/xdg.d.ts.map +1 -0
  49. package/dist/config/xdg.js +30 -0
  50. package/dist/config/xdg.js.map +1 -0
  51. package/dist/connections/manager.d.ts +42 -0
  52. package/dist/connections/manager.d.ts.map +1 -0
  53. package/dist/connections/manager.js +266 -0
  54. package/dist/connections/manager.js.map +1 -0
  55. package/dist/connections/types.d.ts +13 -0
  56. package/dist/connections/types.d.ts.map +1 -0
  57. package/dist/connections/types.js +2 -0
  58. package/dist/connections/types.js.map +1 -0
  59. package/dist/logging.d.ts +46 -0
  60. package/dist/logging.d.ts.map +1 -0
  61. package/dist/logging.js +63 -0
  62. package/dist/logging.js.map +1 -0
  63. package/dist/main.d.ts +13 -0
  64. package/dist/main.d.ts.map +1 -0
  65. package/dist/main.js +206 -0
  66. package/dist/main.js.map +1 -0
  67. package/dist/prompts/actions.prompt.d.ts +9 -0
  68. package/dist/prompts/actions.prompt.d.ts.map +1 -0
  69. package/dist/prompts/actions.prompt.js +64 -0
  70. package/dist/prompts/actions.prompt.js.map +1 -0
  71. package/dist/prompts/calendar.prompt.d.ts +9 -0
  72. package/dist/prompts/calendar.prompt.d.ts.map +1 -0
  73. package/dist/prompts/calendar.prompt.js +55 -0
  74. package/dist/prompts/calendar.prompt.js.map +1 -0
  75. package/dist/prompts/cleanup.prompt.d.ts +9 -0
  76. package/dist/prompts/cleanup.prompt.d.ts.map +1 -0
  77. package/dist/prompts/cleanup.prompt.js +78 -0
  78. package/dist/prompts/cleanup.prompt.js.map +1 -0
  79. package/dist/prompts/compose.prompt.d.ts +8 -0
  80. package/dist/prompts/compose.prompt.d.ts.map +1 -0
  81. package/dist/prompts/compose.prompt.js +116 -0
  82. package/dist/prompts/compose.prompt.js.map +1 -0
  83. package/dist/prompts/register.d.ts +8 -0
  84. package/dist/prompts/register.d.ts.map +1 -0
  85. package/dist/prompts/register.js +20 -0
  86. package/dist/prompts/register.js.map +1 -0
  87. package/dist/prompts/thread.prompt.d.ts +9 -0
  88. package/dist/prompts/thread.prompt.d.ts.map +1 -0
  89. package/dist/prompts/thread.prompt.js +58 -0
  90. package/dist/prompts/thread.prompt.js.map +1 -0
  91. package/dist/prompts/triage.prompt.d.ts +9 -0
  92. package/dist/prompts/triage.prompt.d.ts.map +1 -0
  93. package/dist/prompts/triage.prompt.js +64 -0
  94. package/dist/prompts/triage.prompt.js.map +1 -0
  95. package/dist/resources/accounts.resource.d.ts +9 -0
  96. package/dist/resources/accounts.resource.d.ts.map +1 -0
  97. package/dist/resources/accounts.resource.js +26 -0
  98. package/dist/resources/accounts.resource.js.map +1 -0
  99. package/dist/resources/mailboxes.resource.d.ts +10 -0
  100. package/dist/resources/mailboxes.resource.d.ts.map +1 -0
  101. package/dist/resources/mailboxes.resource.js +33 -0
  102. package/dist/resources/mailboxes.resource.js.map +1 -0
  103. package/dist/resources/register.d.ts +12 -0
  104. package/dist/resources/register.d.ts.map +1 -0
  105. package/dist/resources/register.js +20 -0
  106. package/dist/resources/register.js.map +1 -0
  107. package/dist/resources/scheduled.resource.d.ts +9 -0
  108. package/dist/resources/scheduled.resource.d.ts.map +1 -0
  109. package/dist/resources/scheduled.resource.js +31 -0
  110. package/dist/resources/scheduled.resource.js.map +1 -0
  111. package/dist/resources/stats.resource.d.ts +10 -0
  112. package/dist/resources/stats.resource.d.ts.map +1 -0
  113. package/dist/resources/stats.resource.js +45 -0
  114. package/dist/resources/stats.resource.js.map +1 -0
  115. package/dist/resources/templates.resource.d.ts +9 -0
  116. package/dist/resources/templates.resource.d.ts.map +1 -0
  117. package/dist/resources/templates.resource.js +34 -0
  118. package/dist/resources/templates.resource.js.map +1 -0
  119. package/dist/resources/unread.resource.d.ts +11 -0
  120. package/dist/resources/unread.resource.d.ts.map +1 -0
  121. package/dist/resources/unread.resource.js +46 -0
  122. package/dist/resources/unread.resource.js.map +1 -0
  123. package/dist/safety/audit.d.ts +17 -0
  124. package/dist/safety/audit.d.ts.map +1 -0
  125. package/dist/safety/audit.js +50 -0
  126. package/dist/safety/audit.js.map +1 -0
  127. package/dist/safety/rate-limiter.d.ts +22 -0
  128. package/dist/safety/rate-limiter.d.ts.map +1 -0
  129. package/dist/safety/rate-limiter.js +52 -0
  130. package/dist/safety/rate-limiter.js.map +1 -0
  131. package/dist/safety/validation.d.ts +44 -0
  132. package/dist/safety/validation.d.ts.map +1 -0
  133. package/dist/safety/validation.js +113 -0
  134. package/dist/safety/validation.js.map +1 -0
  135. package/dist/server.d.ts +10 -0
  136. package/dist/server.d.ts.map +1 -0
  137. package/dist/server.js +25 -0
  138. package/dist/server.js.map +1 -0
  139. package/dist/services/calendar.service.d.ts +22 -0
  140. package/dist/services/calendar.service.d.ts.map +1 -0
  141. package/dist/services/calendar.service.js +115 -0
  142. package/dist/services/calendar.service.js.map +1 -0
  143. package/dist/services/event-bus.d.ts +28 -0
  144. package/dist/services/event-bus.d.ts.map +1 -0
  145. package/dist/services/event-bus.js +16 -0
  146. package/dist/services/event-bus.js.map +1 -0
  147. package/dist/services/hooks.service.d.ts +77 -0
  148. package/dist/services/hooks.service.d.ts.map +1 -0
  149. package/dist/services/hooks.service.js +498 -0
  150. package/dist/services/hooks.service.js.map +1 -0
  151. package/dist/services/imap.service.d.ts +133 -0
  152. package/dist/services/imap.service.d.ts.map +1 -0
  153. package/dist/services/imap.service.js +1393 -0
  154. package/dist/services/imap.service.js.map +1 -0
  155. package/dist/services/label-strategy.d.ts +20 -0
  156. package/dist/services/label-strategy.d.ts.map +1 -0
  157. package/dist/services/label-strategy.js +237 -0
  158. package/dist/services/label-strategy.js.map +1 -0
  159. package/dist/services/local-calendar.service.d.ts +126 -0
  160. package/dist/services/local-calendar.service.d.ts.map +1 -0
  161. package/dist/services/local-calendar.service.js +428 -0
  162. package/dist/services/local-calendar.service.js.map +1 -0
  163. package/dist/services/notifier.service.d.ts +69 -0
  164. package/dist/services/notifier.service.d.ts.map +1 -0
  165. package/dist/services/notifier.service.js +319 -0
  166. package/dist/services/notifier.service.js.map +1 -0
  167. package/dist/services/oauth.service.d.ts +47 -0
  168. package/dist/services/oauth.service.d.ts.map +1 -0
  169. package/dist/services/oauth.service.js +140 -0
  170. package/dist/services/oauth.service.js.map +1 -0
  171. package/dist/services/presets.d.ts +36 -0
  172. package/dist/services/presets.d.ts.map +1 -0
  173. package/dist/services/presets.js +173 -0
  174. package/dist/services/presets.js.map +1 -0
  175. package/dist/services/reminders.service.d.ts +63 -0
  176. package/dist/services/reminders.service.d.ts.map +1 -0
  177. package/dist/services/reminders.service.js +281 -0
  178. package/dist/services/reminders.service.js.map +1 -0
  179. package/dist/services/scheduler.service.d.ts +42 -0
  180. package/dist/services/scheduler.service.d.ts.map +1 -0
  181. package/dist/services/scheduler.service.js +260 -0
  182. package/dist/services/scheduler.service.js.map +1 -0
  183. package/dist/services/smtp.service.d.ts +40 -0
  184. package/dist/services/smtp.service.d.ts.map +1 -0
  185. package/dist/services/smtp.service.js +151 -0
  186. package/dist/services/smtp.service.js.map +1 -0
  187. package/dist/services/template.service.d.ts +33 -0
  188. package/dist/services/template.service.d.ts.map +1 -0
  189. package/dist/services/template.service.js +123 -0
  190. package/dist/services/template.service.js.map +1 -0
  191. package/dist/services/watcher.service.d.ts +36 -0
  192. package/dist/services/watcher.service.d.ts.map +1 -0
  193. package/dist/services/watcher.service.js +241 -0
  194. package/dist/services/watcher.service.js.map +1 -0
  195. package/dist/tools/accounts.tool.d.ts +7 -0
  196. package/dist/tools/accounts.tool.d.ts.map +1 -0
  197. package/dist/tools/accounts.tool.js +29 -0
  198. package/dist/tools/accounts.tool.js.map +1 -0
  199. package/dist/tools/analytics.tool.d.ts +9 -0
  200. package/dist/tools/analytics.tool.d.ts.map +1 -0
  201. package/dist/tools/analytics.tool.js +27 -0
  202. package/dist/tools/analytics.tool.js.map +1 -0
  203. package/dist/tools/attachments.tool.d.ts +7 -0
  204. package/dist/tools/attachments.tool.d.ts.map +1 -0
  205. package/dist/tools/attachments.tool.js +45 -0
  206. package/dist/tools/attachments.tool.js.map +1 -0
  207. package/dist/tools/bulk.tool.d.ts +7 -0
  208. package/dist/tools/bulk.tool.d.ts.map +1 -0
  209. package/dist/tools/bulk.tool.js +75 -0
  210. package/dist/tools/bulk.tool.js.map +1 -0
  211. package/dist/tools/calendar.tool.d.ts +19 -0
  212. package/dist/tools/calendar.tool.d.ts.map +1 -0
  213. package/dist/tools/calendar.tool.js +538 -0
  214. package/dist/tools/calendar.tool.js.map +1 -0
  215. package/dist/tools/contacts.tool.d.ts +7 -0
  216. package/dist/tools/contacts.tool.d.ts.map +1 -0
  217. package/dist/tools/contacts.tool.js +44 -0
  218. package/dist/tools/contacts.tool.js.map +1 -0
  219. package/dist/tools/drafts.tool.d.ts +8 -0
  220. package/dist/tools/drafts.tool.d.ts.map +1 -0
  221. package/dist/tools/drafts.tool.js +92 -0
  222. package/dist/tools/drafts.tool.js.map +1 -0
  223. package/dist/tools/emails.tool.d.ts +7 -0
  224. package/dist/tools/emails.tool.d.ts.map +1 -0
  225. package/dist/tools/emails.tool.js +400 -0
  226. package/dist/tools/emails.tool.js.map +1 -0
  227. package/dist/tools/folders.tool.d.ts +7 -0
  228. package/dist/tools/folders.tool.d.ts.map +1 -0
  229. package/dist/tools/folders.tool.js +111 -0
  230. package/dist/tools/folders.tool.js.map +1 -0
  231. package/dist/tools/health.tool.d.ts +10 -0
  232. package/dist/tools/health.tool.d.ts.map +1 -0
  233. package/dist/tools/health.tool.js +78 -0
  234. package/dist/tools/health.tool.js.map +1 -0
  235. package/dist/tools/label.tool.d.ts +11 -0
  236. package/dist/tools/label.tool.d.ts.map +1 -0
  237. package/dist/tools/label.tool.js +165 -0
  238. package/dist/tools/label.tool.js.map +1 -0
  239. package/dist/tools/locate.tool.d.ts +11 -0
  240. package/dist/tools/locate.tool.d.ts.map +1 -0
  241. package/dist/tools/locate.tool.js +59 -0
  242. package/dist/tools/locate.tool.js.map +1 -0
  243. package/dist/tools/mailboxes.tool.d.ts +7 -0
  244. package/dist/tools/mailboxes.tool.d.ts.map +1 -0
  245. package/dist/tools/mailboxes.tool.js +38 -0
  246. package/dist/tools/mailboxes.tool.js.map +1 -0
  247. package/dist/tools/manage.tool.d.ts +7 -0
  248. package/dist/tools/manage.tool.d.ts.map +1 -0
  249. package/dist/tools/manage.tool.js +125 -0
  250. package/dist/tools/manage.tool.js.map +1 -0
  251. package/dist/tools/register.d.ts +20 -0
  252. package/dist/tools/register.d.ts.map +1 -0
  253. package/dist/tools/register.js +53 -0
  254. package/dist/tools/register.js.map +1 -0
  255. package/dist/tools/scheduler.tool.d.ts +9 -0
  256. package/dist/tools/scheduler.tool.d.ts.map +1 -0
  257. package/dist/tools/scheduler.tool.js +104 -0
  258. package/dist/tools/scheduler.tool.js.map +1 -0
  259. package/dist/tools/send.tool.d.ts +7 -0
  260. package/dist/tools/send.tool.d.ts.map +1 -0
  261. package/dist/tools/send.tool.js +123 -0
  262. package/dist/tools/send.tool.js.map +1 -0
  263. package/dist/tools/templates.tool.d.ts +12 -0
  264. package/dist/tools/templates.tool.d.ts.map +1 -0
  265. package/dist/tools/templates.tool.js +140 -0
  266. package/dist/tools/templates.tool.js.map +1 -0
  267. package/dist/tools/thread.tool.d.ts +10 -0
  268. package/dist/tools/thread.tool.d.ts.map +1 -0
  269. package/dist/tools/thread.tool.js +146 -0
  270. package/dist/tools/thread.tool.js.map +1 -0
  271. package/dist/tools/watcher.tool.d.ts +9 -0
  272. package/dist/tools/watcher.tool.d.ts.map +1 -0
  273. package/dist/tools/watcher.tool.js +282 -0
  274. package/dist/tools/watcher.tool.js.map +1 -0
  275. package/dist/types/index.d.ts +271 -0
  276. package/dist/types/index.d.ts.map +1 -0
  277. package/dist/types/index.js +5 -0
  278. package/dist/types/index.js.map +1 -0
  279. package/dist/utils/calendar-notes.d.ts +31 -0
  280. package/dist/utils/calendar-notes.d.ts.map +1 -0
  281. package/dist/utils/calendar-notes.js +99 -0
  282. package/dist/utils/calendar-notes.js.map +1 -0
  283. package/dist/utils/calendar-state.d.ts +27 -0
  284. package/dist/utils/calendar-state.d.ts.map +1 -0
  285. package/dist/utils/calendar-state.js +85 -0
  286. package/dist/utils/calendar-state.js.map +1 -0
  287. package/dist/utils/conference-details.d.ts +12 -0
  288. package/dist/utils/conference-details.d.ts.map +1 -0
  289. package/dist/utils/conference-details.js +71 -0
  290. package/dist/utils/conference-details.js.map +1 -0
  291. package/dist/utils/meeting-url.d.ts +10 -0
  292. package/dist/utils/meeting-url.d.ts.map +1 -0
  293. package/dist/utils/meeting-url.js +30 -0
  294. package/dist/utils/meeting-url.js.map +1 -0
  295. package/package.json +108 -0
@@ -0,0 +1,9 @@
1
+ /**
2
+ * MCP Prompt: extract_action_items
3
+ *
4
+ * Instructs the LLM to scan recent emails and extract actionable items
5
+ * including tasks, deadlines, commitments, and pending questions.
6
+ */
7
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
8
+ export default function registerActionsPrompt(server: McpServer): void;
9
+ //# sourceMappingURL=actions.prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions.prompt.d.ts","sourceRoot":"","sources":["../../src/prompts/actions.prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA4DrE"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * MCP Prompt: extract_action_items
3
+ *
4
+ * Instructs the LLM to scan recent emails and extract actionable items
5
+ * including tasks, deadlines, commitments, and pending questions.
6
+ */
7
+ import { z } from 'zod';
8
+ export default function registerActionsPrompt(server) {
9
+ server.prompt('extract_action_items', 'Scan recent emails and extract action items, deadlines, and commitments. Produces a structured task list with source references.', {
10
+ account: z.string().describe('Account name'),
11
+ mailbox: z.string().default('INBOX').describe('Mailbox to scan (default: INBOX)'),
12
+ limit: z.string().default('20').describe('Number of recent emails to scan (default: 20)'),
13
+ }, async ({ account, mailbox, limit }) => {
14
+ const limitNum = Math.min(Math.max(parseInt(limit, 10) || 20, 1), 50);
15
+ return {
16
+ messages: [
17
+ {
18
+ role: 'user',
19
+ content: {
20
+ type: 'text',
21
+ text: `Extract action items from recent emails in the "${mailbox}" mailbox of the "${account}" account.
22
+
23
+ Follow these steps:
24
+ 1. Call list_emails with account="${account}", mailbox="${mailbox}", pageSize=${limitNum} to get recent emails.
25
+ 2. For each email that looks like it might contain action items (based on subject/preview), call get_email to read the full content.
26
+ 3. Extract ALL actionable items from the emails.
27
+
28
+ Look for:
29
+ - **Direct requests:** "Please...", "Can you...", "Could you...", "I need..."
30
+ - **Deadlines:** Dates, "by end of week", "ASAP", "before the meeting"
31
+ - **Commitments you made:** "I will...", "I'll send...", "Let me..."
32
+ - **Questions awaiting your response:** Questions directed at you
33
+ - **Meeting follow-ups:** Action items from meetings mentioned in emails
34
+ - **Approvals needed:** Requests for sign-off or review
35
+
36
+ Output a structured report in this format:
37
+
38
+ ## ✅ Action Items — ${account}
39
+ **Scanned:** [Count] emails from ${mailbox}
40
+
41
+ ### 🔴 Urgent / Has Deadline
42
+ - [ ] [Action description] — from [Sender] ([Date])
43
+ 📧 Re: [Subject] | ⏰ Deadline: [deadline if mentioned]
44
+
45
+ ### 🟡 Needs Response
46
+ - [ ] [Reply to / Answer question about...] — from [Sender] ([Date])
47
+ 📧 Re: [Subject]
48
+
49
+ ### 🔵 Tasks / Commitments
50
+ - [ ] [Task description] — from [Sender] ([Date])
51
+ 📧 Re: [Subject]
52
+
53
+ ### 📊 Summary
54
+ - **Total action items:** [count]
55
+ - **With deadlines:** [count]
56
+ - **Awaiting your response:** [count]
57
+ - **Commitments you made:** [count]`,
58
+ },
59
+ },
60
+ ],
61
+ };
62
+ });
63
+ }
64
+ //# sourceMappingURL=actions.prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions.prompt.js","sourceRoot":"","sources":["../../src/prompts/actions.prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,MAAiB;IAC7D,MAAM,CAAC,MAAM,CACX,sBAAsB,EACtB,kIAAkI,EAClI;QACE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC;QAC5C,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,kCAAkC,CAAC;QACjF,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,+CAA+C,CAAC;KAC1F,EACD,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE;QACpC,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACtE,OAAO;YACL,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,MAAe;oBACrB,OAAO,EAAE;wBACP,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,mDAAmD,OAAO,qBAAqB,OAAO;;;oCAGtE,OAAO,eAAe,OAAO,eAAe,QAAQ;;;;;;;;;;;;;;sBAclE,OAAO;mCACM,OAAO;;;;;;;;;;;;;;;;;;oCAkBN;qBACvB;iBACF;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * MCP Prompt: summarize_meetings
3
+ *
4
+ * Instructs the LLM to scan recent emails for calendar invites
5
+ * and produce a structured meeting overview.
6
+ */
7
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
8
+ export default function registerCalendarPrompt(server: McpServer): void;
9
+ //# sourceMappingURL=calendar.prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar.prompt.d.ts","sourceRoot":"","sources":["../../src/prompts/calendar.prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAmDtE"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * MCP Prompt: summarize_meetings
3
+ *
4
+ * Instructs the LLM to scan recent emails for calendar invites
5
+ * and produce a structured meeting overview.
6
+ */
7
+ import { z } from 'zod';
8
+ export default function registerCalendarPrompt(server) {
9
+ server.prompt('summarize_meetings', 'Scan recent emails for calendar invites and produce a meeting overview grouped by timeframe.', {
10
+ account: z.string().describe('Account name to scan'),
11
+ days: z.string().default('7').describe('Number of days to look back (default: 7)'),
12
+ }, async ({ account, days }) => {
13
+ const daysNum = Math.min(Math.max(parseInt(days, 10) || 7, 1), 30);
14
+ return {
15
+ messages: [
16
+ {
17
+ role: 'user',
18
+ content: {
19
+ type: 'text',
20
+ text: `Scan the "${account}" account for calendar invitations from the last ${daysNum} days.
21
+
22
+ Follow these steps:
23
+ 1. Call search_emails with account="${account}", mailbox="INBOX", since="${new Date(Date.now() - daysNum * 86400000).toISOString().split('T')[0]}" to find recent emails.
24
+ 2. For each email that might contain a calendar invite (look for subjects with "Meeting", "Invitation", "Calendar", or from calendar systems), call extract_calendar to check for ICS content.
25
+ 3. Collect all calendar events found.
26
+
27
+ Then produce a meeting brief in this format:
28
+
29
+ ## 📅 Meeting Brief — ${account}
30
+ **Period:** Last ${daysNum} days | **Events found:** [count]
31
+
32
+ ### 📌 Today
33
+ - **[Time]** [Summary] — [Location] | 👤 [Organizer] | [Attendee count] attendees
34
+ Status: [CONFIRMED/TENTATIVE/CANCELLED]
35
+
36
+ ### 📆 This Week
37
+ - (same format)
38
+
39
+ ### 📆 Next Week
40
+ - (same format)
41
+
42
+ ### ⚠️ Conflicts
43
+ - [List any overlapping events]
44
+
45
+ ### ❌ Cancelled
46
+ - [List any cancelled events]
47
+
48
+ If no calendar events are found, say "No meeting invitations found in the last ${daysNum} days."`,
49
+ },
50
+ },
51
+ ],
52
+ };
53
+ });
54
+ }
55
+ //# sourceMappingURL=calendar.prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar.prompt.js","sourceRoot":"","sources":["../../src/prompts/calendar.prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,MAAiB;IAC9D,MAAM,CAAC,MAAM,CACX,oBAAoB,EACpB,8FAA8F,EAC9F;QACE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC;QACpD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,0CAA0C,CAAC;KACnF,EACD,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE;QAC1B,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACnE,OAAO;YACL,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,MAAe;oBACrB,OAAO,EAAE;wBACP,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,aAAa,OAAO,oDAAoD,OAAO;;;sCAG7D,OAAO,8BAA8B,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,GAAG,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;;;;;;wBAMxH,OAAO;mBACZ,OAAO;;;;;;;;;;;;;;;;;;iFAkBuD,OAAO,SAAS;qBACpF;iBACF;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * MCP Prompt: cleanup_inbox
3
+ *
4
+ * Instructs the LLM to analyze and clean up the inbox with
5
+ * categorization and optional execution.
6
+ */
7
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
8
+ export default function registerCleanupPrompt(server: McpServer): void;
9
+ //# sourceMappingURL=cleanup.prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cleanup.prompt.d.ts","sourceRoot":"","sources":["../../src/prompts/cleanup.prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA6ErE"}
@@ -0,0 +1,78 @@
1
+ /**
2
+ * MCP Prompt: cleanup_inbox
3
+ *
4
+ * Instructs the LLM to analyze and clean up the inbox with
5
+ * categorization and optional execution.
6
+ */
7
+ import { z } from 'zod';
8
+ export default function registerCleanupPrompt(server) {
9
+ server.prompt('cleanup_inbox', 'AI-guided inbox cleanup — categorizes emails and suggests or executes organization actions.', {
10
+ account: z.string().describe('Account name to clean up'),
11
+ older_than_days: z
12
+ .string()
13
+ .default('30')
14
+ .describe('Only consider emails older than N days (default: 30)'),
15
+ dry_run: z
16
+ .string()
17
+ .default('true')
18
+ .describe("'true' = suggest only, 'false' = execute actions (default: true)"),
19
+ }, async ({ account, older_than_days: olderThan, dry_run: dryRun }) => {
20
+ const days = Math.max(parseInt(olderThan, 10) || 30, 1);
21
+ const execute = dryRun === 'false';
22
+ const beforeDate = new Date(Date.now() - days * 86400000).toISOString().split('T')[0];
23
+ return {
24
+ messages: [
25
+ {
26
+ role: 'user',
27
+ content: {
28
+ type: 'text',
29
+ text: `Help me clean up the "${account}" inbox. Analyze emails older than ${days} days.
30
+
31
+ Follow these steps:
32
+ 1. Call list_emails with account="${account}", mailbox="INBOX", pageSize=50, before="${beforeDate}" to scan old emails.
33
+ 2. For emails needing more context, use get_email to read the body.
34
+ 3. Categorize each email into one of these groups:
35
+
36
+ 🗑️ **Delete candidates** — Old read promotional emails, automated notifications, expired offers
37
+ 📁 **Archive candidates** — Old read conversational emails with no pending action
38
+ 🚩 **Needs attention** — Unread or flagged emails that may still need a response
39
+ ✅ **Keep** — Recent or important emails that belong in inbox
40
+
41
+ 4. Look for newsletter patterns (List-Unsubscribe headers, recurring senders with promotional content).
42
+
43
+ Present your findings as:
44
+
45
+ ## 🧹 Inbox Cleanup — ${account}
46
+ **Scanned:** [count] emails older than ${days} days
47
+
48
+ ### 🗑️ Delete ([count])
49
+ - [Subject] from [Sender] — [Reason]
50
+
51
+ ### 📁 Archive ([count])
52
+ - [Subject] from [Sender] — [Reason]
53
+
54
+ ### 🚩 Needs Attention ([count])
55
+ - [Subject] from [Sender] — [Why this needs action]
56
+
57
+ ### ✅ Keep ([count])
58
+ - [Subject] from [Sender] — [Why to keep]
59
+
60
+ ### 📰 Newsletter Sources
61
+ - [Sender] — [Frequency estimate] — Consider unsubscribing?
62
+
63
+ ### Summary
64
+ - Total scanned: X
65
+ - Suggested deletions: X
66
+ - Suggested archives: X
67
+ - Estimated space savings: X
68
+
69
+ ${execute
70
+ ? `**Mode: EXECUTE** — After presenting the plan, proceed to execute the cleanup using bulk_action to move/delete emails as categorized. Report results for each action.`
71
+ : `**Mode: DRY RUN** — Present the cleanup plan only. Ask if I want to proceed with any of the suggested actions.`}`,
72
+ },
73
+ },
74
+ ],
75
+ };
76
+ });
77
+ }
78
+ //# sourceMappingURL=cleanup.prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cleanup.prompt.js","sourceRoot":"","sources":["../../src/prompts/cleanup.prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,MAAiB;IAC7D,MAAM,CAAC,MAAM,CACX,eAAe,EACf,6FAA6F,EAC7F;QACE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;QACxD,eAAe,EAAE,CAAC;aACf,MAAM,EAAE;aACR,OAAO,CAAC,IAAI,CAAC;aACb,QAAQ,CAAC,sDAAsD,CAAC;QACnE,OAAO,EAAE,CAAC;aACP,MAAM,EAAE;aACR,OAAO,CAAC,MAAM,CAAC;aACf,QAAQ,CAAC,kEAAkE,CAAC;KAChF,EACD,KAAK,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE;QACjE,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,SAAS,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;QACxD,MAAM,OAAO,GAAG,MAAM,KAAK,OAAO,CAAC;QACnC,MAAM,UAAU,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,GAAG,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAEtF,OAAO;YACL,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,MAAe;oBACrB,OAAO,EAAE;wBACP,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,yBAAyB,OAAO,sCAAsC,IAAI;;;oCAG1D,OAAO,4CAA4C,UAAU;;;;;;;;;;;;;wBAazE,OAAO;yCACU,IAAI;;;;;;;;;;;;;;;;;;;;;;;EAwB3C,OAAO;4BACL,CAAC,CAAC,uKAAuK;4BACzK,CAAC,CAAC,gHACN,EAAE;qBACW;iBACF;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * MCP Prompts: compose_reply, draft_from_context
3
+ *
4
+ * AI-assisted email composition with tone control and context awareness.
5
+ */
6
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
7
+ export default function registerComposePrompts(server: McpServer): void;
8
+ //# sourceMappingURL=compose.prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compose.prompt.d.ts","sourceRoot":"","sources":["../../src/prompts/compose.prompt.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA2HtE"}
@@ -0,0 +1,116 @@
1
+ /**
2
+ * MCP Prompts: compose_reply, draft_from_context
3
+ *
4
+ * AI-assisted email composition with tone control and context awareness.
5
+ */
6
+ import { z } from 'zod';
7
+ export default function registerComposePrompts(server) {
8
+ // ---------------------------------------------------------------------------
9
+ // compose_reply
10
+ // ---------------------------------------------------------------------------
11
+ server.prompt('compose_reply', 'Draft a professional reply to an email with tone control. Fetches the original email and optionally the full thread for context.', {
12
+ account: z.string().describe('Account name'),
13
+ email_id: z.string().describe('Email ID to reply to (from list_emails)'),
14
+ mailbox: z.string().default('INBOX').describe('Mailbox path (default: INBOX)'),
15
+ intent: z
16
+ .string()
17
+ .describe('What you want to communicate, e.g., "accept the meeting", "decline politely", "request more details"'),
18
+ tone: z
19
+ .enum(['formal', 'friendly', 'brief'])
20
+ .default('friendly')
21
+ .describe('Tone of the reply'),
22
+ }, async ({ account, email_id: emailId, mailbox, intent, tone }) => ({
23
+ messages: [
24
+ {
25
+ role: 'user',
26
+ content: {
27
+ type: 'text',
28
+ text: `Draft a reply to email ID ${emailId} in the "${account}" account.
29
+
30
+ Follow these steps:
31
+ 1. Call get_email with account="${account}", emailId="${emailId}", mailbox="${mailbox}" to read the original email.
32
+ 2. If the email has an inReplyTo or references, optionally call get_thread to understand the full conversation context.
33
+ 3. Draft a reply with:
34
+ - **Intent:** ${intent}
35
+ - **Tone:** ${tone}
36
+ ${tone === 'formal' ? ' Use professional language, proper salutations, and sign-off.' : ''}
37
+ ${tone === 'friendly' ? ' Use warm but professional language, conversational style.' : ''}
38
+ ${tone === 'brief' ? ' Keep it concise — 2-3 sentences maximum. No unnecessary pleasantries.' : ''}
39
+
40
+ Output the draft in this format:
41
+
42
+ ## ✉️ Draft Reply
43
+
44
+ **To:** [Original sender]
45
+ **Subject:** Re: [Original subject]
46
+
47
+ ---
48
+
49
+ [Draft reply body]
50
+
51
+ ---
52
+
53
+ **Actions:**
54
+ - To send this reply, call reply_email with the appropriate parameters.
55
+ - To save as draft first, call save_draft.
56
+ - If you'd like me to adjust the tone or content, let me know.`,
57
+ },
58
+ },
59
+ ],
60
+ }));
61
+ // ---------------------------------------------------------------------------
62
+ // draft_from_context
63
+ // ---------------------------------------------------------------------------
64
+ server.prompt('draft_from_context', 'Compose a new email about a topic, searching past emails for relevant context to reference naturally.', {
65
+ account: z.string().describe('Account name'),
66
+ topic: z
67
+ .string()
68
+ .describe('Topic or purpose of the email, e.g., "project status update", "schedule a meeting"'),
69
+ to: z.string().describe('Recipient email address(es), comma-separated'),
70
+ tone: z
71
+ .enum(['formal', 'friendly', 'brief'])
72
+ .default('friendly')
73
+ .describe('Tone of the email'),
74
+ }, async ({ account, topic, to, tone }) => ({
75
+ messages: [
76
+ {
77
+ role: 'user',
78
+ content: {
79
+ type: 'text',
80
+ text: `Compose a new email about "${topic}" to ${to} from the "${account}" account.
81
+
82
+ Follow these steps:
83
+ 1. Call search_emails with account="${account}", query="${topic}" to find relevant past emails.
84
+ 2. If relevant emails are found, call get_email on the most relevant 1-2 to understand the context.
85
+ 3. Draft a new email that:
86
+ - Addresses the topic: ${topic}
87
+ - References past conversations naturally (if found), e.g., "Following up on our discussion about..."
88
+ - Uses a ${tone} tone
89
+ - Is well-structured with clear purpose and any necessary call-to-action
90
+
91
+ Output the draft in this format:
92
+
93
+ ## ✉️ New Email Draft
94
+
95
+ **To:** ${to}
96
+ **Subject:** [Suggested subject line]
97
+
98
+ ---
99
+
100
+ [Draft email body]
101
+
102
+ ---
103
+
104
+ **Context Used:**
105
+ - [Brief note about which past emails were referenced, if any]
106
+
107
+ **Actions:**
108
+ - To send: call send_email with the draft content.
109
+ - To save as draft: call save_draft.
110
+ - To adjust: let me know what to change.`,
111
+ },
112
+ },
113
+ ],
114
+ }));
115
+ }
116
+ //# sourceMappingURL=compose.prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compose.prompt.js","sourceRoot":"","sources":["../../src/prompts/compose.prompt.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,MAAiB;IAC9D,8EAA8E;IAC9E,gBAAgB;IAChB,8EAA8E;IAC9E,MAAM,CAAC,MAAM,CACX,eAAe,EACf,kIAAkI,EAClI;QACE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC;QAC5C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yCAAyC,CAAC;QACxE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,+BAA+B,CAAC;QAC9E,MAAM,EAAE,CAAC;aACN,MAAM,EAAE;aACR,QAAQ,CACP,sGAAsG,CACvG;QACH,IAAI,EAAE,CAAC;aACJ,IAAI,CAAC,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;aACrC,OAAO,CAAC,UAAU,CAAC;aACnB,QAAQ,CAAC,mBAAmB,CAAC;KACjC,EACD,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;QAChE,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAe;gBACrB,OAAO,EAAE;oBACP,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,6BAA6B,OAAO,YAAY,OAAO;;;kCAGvC,OAAO,eAAe,OAAO,eAAe,OAAO;;;mBAGlE,MAAM;iBACR,IAAI;KAChB,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,iEAAiE,CAAC,CAAC,CAAC,EAAE;KAC1F,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,8DAA8D,CAAC,CAAC,CAAC,EAAE;KACzF,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,0EAA0E,CAAC,CAAC,CAAC,EAAE;;;;;;;;;;;;;;;;;;+DAkBxC;iBACpD;aACF;SACF;KACF,CAAC,CACH,CAAC;IAEF,8EAA8E;IAC9E,qBAAqB;IACrB,8EAA8E;IAC9E,MAAM,CAAC,MAAM,CACX,oBAAoB,EACpB,uGAAuG,EACvG;QACE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC;QAC5C,KAAK,EAAE,CAAC;aACL,MAAM,EAAE;aACR,QAAQ,CACP,oFAAoF,CACrF;QACH,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8CAA8C,CAAC;QACvE,IAAI,EAAE,CAAC;aACJ,IAAI,CAAC,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;aACrC,OAAO,CAAC,UAAU,CAAC;aACnB,QAAQ,CAAC,mBAAmB,CAAC;KACjC,EACD,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;QACvC,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAe;gBACrB,OAAO,EAAE;oBACP,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,8BAA8B,KAAK,QAAQ,EAAE,cAAc,OAAO;;;sCAG9C,OAAO,aAAa,KAAK;;;4BAGnC,KAAK;;cAEnB,IAAI;;;;;;;UAOR,EAAE;;;;;;;;;;;;;;;yCAe6B;iBAC9B;aACF;SACF;KACF,CAAC,CACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Prompt registration — single wiring point.
3
+ *
4
+ * Registers all MCP prompts with the server instance.
5
+ */
6
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
7
+ export default function registerAllPrompts(server: McpServer): void;
8
+ //# sourceMappingURL=register.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../src/prompts/register.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAQzE,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAOlE"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Prompt registration — single wiring point.
3
+ *
4
+ * Registers all MCP prompts with the server instance.
5
+ */
6
+ import registerActionsPrompt from './actions.prompt.js';
7
+ import registerCalendarPrompt from './calendar.prompt.js';
8
+ import registerCleanupPrompt from './cleanup.prompt.js';
9
+ import registerComposePrompts from './compose.prompt.js';
10
+ import registerThreadPrompt from './thread.prompt.js';
11
+ import registerTriagePrompt from './triage.prompt.js';
12
+ export default function registerAllPrompts(server) {
13
+ registerTriagePrompt(server);
14
+ registerThreadPrompt(server);
15
+ registerComposePrompts(server);
16
+ registerActionsPrompt(server);
17
+ registerCalendarPrompt(server);
18
+ registerCleanupPrompt(server);
19
+ }
20
+ //# sourceMappingURL=register.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.js","sourceRoot":"","sources":["../../src/prompts/register.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,qBAAqB,MAAM,qBAAqB,CAAC;AACxD,OAAO,sBAAsB,MAAM,sBAAsB,CAAC;AAC1D,OAAO,qBAAqB,MAAM,qBAAqB,CAAC;AACxD,OAAO,sBAAsB,MAAM,qBAAqB,CAAC;AACzD,OAAO,oBAAoB,MAAM,oBAAoB,CAAC;AACtD,OAAO,oBAAoB,MAAM,oBAAoB,CAAC;AAEtD,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,MAAiB;IAC1D,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAC7B,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAC7B,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAC/B,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAC9B,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAC/B,qBAAqB,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * MCP Prompt: summarize_thread
3
+ *
4
+ * Instructs the LLM to fetch and summarize an email conversation thread
5
+ * with structured output including participants, decisions, and action items.
6
+ */
7
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
8
+ export default function registerThreadPrompt(server: McpServer): void;
9
+ //# sourceMappingURL=thread.prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"thread.prompt.d.ts","sourceRoot":"","sources":["../../src/prompts/thread.prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAsDpE"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * MCP Prompt: summarize_thread
3
+ *
4
+ * Instructs the LLM to fetch and summarize an email conversation thread
5
+ * with structured output including participants, decisions, and action items.
6
+ */
7
+ import { z } from 'zod';
8
+ export default function registerThreadPrompt(server) {
9
+ server.prompt('summarize_thread', 'Summarize an email conversation thread. Produces a structured report with participants, timeline, decisions, and action items.', {
10
+ account: z.string().describe('Account name'),
11
+ message_id: z.string().describe('Message-ID of any email in the thread (from get_email)'),
12
+ mailbox: z.string().default('INBOX').describe('Mailbox to search (default: INBOX)'),
13
+ }, async ({ account, message_id: messageId, mailbox }) => ({
14
+ messages: [
15
+ {
16
+ role: 'user',
17
+ content: {
18
+ type: 'text',
19
+ text: `Summarize the email thread containing Message-ID: ${messageId}
20
+
21
+ Follow these steps:
22
+ 1. Call get_thread with account="${account}", message_id="${messageId}", mailbox="${mailbox}" to fetch the full conversation.
23
+ 2. Read through all messages in chronological order.
24
+ 3. Identify key information across the thread.
25
+
26
+ Output a structured summary in this format:
27
+
28
+ ## 🧵 Thread Summary
29
+
30
+ **Subject:** [Thread subject]
31
+ **Date Range:** [First message date] → [Last message date]
32
+ **Messages:** [Count]
33
+
34
+ ### 👥 Participants
35
+ - [Name/Email] — [Role in the conversation, e.g., "initiated request", "provided update"]
36
+
37
+ ### 📋 Timeline
38
+ 1. **[Date]** — [Sender]: [One-line summary of this message's contribution]
39
+ 2. **[Date]** — [Sender]: [One-line summary]
40
+ ...
41
+
42
+ ### 🎯 Key Decisions
43
+ - [Decision made and by whom]
44
+
45
+ ### ❓ Open Questions
46
+ - [Unresolved questions from the thread]
47
+
48
+ ### ✅ Action Items
49
+ - [ ] [Action] — assigned to [Person], deadline: [if mentioned]
50
+
51
+ ### 📝 Summary
52
+ [2-3 sentence narrative summary of the entire conversation]`,
53
+ },
54
+ },
55
+ ],
56
+ }));
57
+ }
58
+ //# sourceMappingURL=thread.prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"thread.prompt.js","sourceRoot":"","sources":["../../src/prompts/thread.prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,MAAiB;IAC5D,MAAM,CAAC,MAAM,CACX,kBAAkB,EAClB,gIAAgI,EAChI;QACE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC;QAC5C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wDAAwD,CAAC;QACzF,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,oCAAoC,CAAC;KACpF,EACD,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;QACtD,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAe;gBACrB,OAAO,EAAE;oBACP,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,qDAAqD,SAAS;;;mCAG7C,OAAO,kBAAkB,SAAS,eAAe,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4DA8B/B;iBACjD;aACF;SACF;KACF,CAAC,CACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * MCP Prompt: triage_inbox
3
+ *
4
+ * Instructs the LLM to analyze unread emails and categorize them by
5
+ * urgency and action needed.
6
+ */
7
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
8
+ export default function registerTriagePrompt(server: McpServer): void;
9
+ //# sourceMappingURL=triage.prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"triage.prompt.d.ts","sourceRoot":"","sources":["../../src/prompts/triage.prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA4DpE"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * MCP Prompt: triage_inbox
3
+ *
4
+ * Instructs the LLM to analyze unread emails and categorize them by
5
+ * urgency and action needed.
6
+ */
7
+ import { z } from 'zod';
8
+ export default function registerTriagePrompt(server) {
9
+ server.prompt('triage_inbox', 'Analyze unread emails and categorize by urgency. Produces a structured triage report with recommended actions.', {
10
+ account: z.string().describe('Account name to triage'),
11
+ mailbox: z.string().default('INBOX').describe('Mailbox to triage (default: INBOX)'),
12
+ limit: z
13
+ .string()
14
+ .default('20')
15
+ .describe('Maximum number of unread emails to analyze (default: 20)'),
16
+ }, async ({ account, mailbox, limit }) => {
17
+ const limitNum = Math.min(Math.max(parseInt(limit, 10) || 20, 1), 50);
18
+ return {
19
+ messages: [
20
+ {
21
+ role: 'user',
22
+ content: {
23
+ type: 'text',
24
+ text: `Triage the unread emails in the "${mailbox}" mailbox of the "${account}" account.
25
+
26
+ Follow these steps:
27
+ 1. Call list_emails with account="${account}", mailbox="${mailbox}", seen=false, pageSize=${limitNum} to get unread emails.
28
+ 2. For each email, read the subject, sender, and preview to classify it into ONE of these categories:
29
+ 🔴 **Urgent** — Requires immediate attention (time-sensitive, from important contacts, contains deadlines)
30
+ 🟡 **Needs Response** — Requires a reply but not time-critical
31
+ 🔵 **FYI** — Informational, no action needed (newsletters, notifications, CC'd emails)
32
+ ⚪ **Promotional** — Marketing, spam, or low-priority automated emails
33
+ 3. For emails that need more context, use get_email to read the full body.
34
+
35
+ Output a triage report in this format:
36
+
37
+ ## 📬 Inbox Triage — ${account}
38
+ **${mailbox}** | Analyzed: [count] unread emails
39
+
40
+ ### 🔴 Urgent ([count])
41
+ - **[Subject]** from [Sender] — [Brief reason why urgent] → [Recommended action]
42
+
43
+ ### 🟡 Needs Response ([count])
44
+ - **[Subject]** from [Sender] — [Brief summary] → [Suggested response approach]
45
+
46
+ ### 🔵 FYI ([count])
47
+ - **[Subject]** from [Sender] — [One-line summary]
48
+
49
+ ### ⚪ Promotional ([count])
50
+ - **[Subject]** from [Sender]
51
+
52
+ ### Recommended Actions
53
+ 1. [Most important action first]
54
+ 2. [Second priority]
55
+ ...
56
+
57
+ Suggest which emails to mark as read, flag for follow-up, or archive.`,
58
+ },
59
+ },
60
+ ],
61
+ };
62
+ });
63
+ }
64
+ //# sourceMappingURL=triage.prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"triage.prompt.js","sourceRoot":"","sources":["../../src/prompts/triage.prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,MAAiB;IAC5D,MAAM,CAAC,MAAM,CACX,cAAc,EACd,gHAAgH,EAChH;QACE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wBAAwB,CAAC;QACtD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,oCAAoC,CAAC;QACnF,KAAK,EAAE,CAAC;aACL,MAAM,EAAE;aACR,OAAO,CAAC,IAAI,CAAC;aACb,QAAQ,CAAC,0DAA0D,CAAC;KACxE,EACD,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE;QACpC,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACtE,OAAO;YACL,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,MAAe;oBACrB,OAAO,EAAE;wBACP,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,oCAAoC,OAAO,qBAAqB,OAAO;;;oCAGvD,OAAO,eAAe,OAAO,2BAA2B,QAAQ;;;;;;;;;;uBAU7E,OAAO;IAC1B,OAAO;;;;;;;;;;;;;;;;;;;sEAmB2D;qBACzD;iBACF;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * MCP Resource: email://accounts
3
+ *
4
+ * Static resource listing all configured email accounts.
5
+ */
6
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
7
+ import type ConnectionManager from '../connections/manager.js';
8
+ export default function registerAccountsResource(server: McpServer, connections: ConnectionManager): void;
9
+ //# sourceMappingURL=accounts.resource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accounts.resource.d.ts","sourceRoot":"","sources":["../../src/resources/accounts.resource.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,OAAO,KAAK,iBAAiB,MAAM,2BAA2B,CAAC;AAE/D,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAC9C,MAAM,EAAE,SAAS,EACjB,WAAW,EAAE,iBAAiB,GAC7B,IAAI,CAyBN"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * MCP Resource: email://accounts
3
+ *
4
+ * Static resource listing all configured email accounts.
5
+ */
6
+ export default function registerAccountsResource(server, connections) {
7
+ const names = connections.getAccountNames();
8
+ const accounts = names.map((name) => {
9
+ const cfg = connections.getAccount(name);
10
+ return {
11
+ name: cfg.name,
12
+ email: cfg.email,
13
+ fullName: cfg.fullName ?? undefined,
14
+ };
15
+ });
16
+ server.resource('accounts', 'email://accounts', { description: 'List of all configured email accounts' }, async () => ({
17
+ contents: [
18
+ {
19
+ uri: 'email://accounts',
20
+ mimeType: 'application/json',
21
+ text: JSON.stringify(accounts, null, 2),
22
+ },
23
+ ],
24
+ }));
25
+ }
26
+ //# sourceMappingURL=accounts.resource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accounts.resource.js","sourceRoot":"","sources":["../../src/resources/accounts.resource.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAC9C,MAAiB,EACjB,WAA8B;IAE9B,MAAM,KAAK,GAAG,WAAW,CAAC,eAAe,EAAE,CAAC;IAC5C,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QAClC,MAAM,GAAG,GAAG,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACzC,OAAO;YACL,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,KAAK,EAAE,GAAG,CAAC,KAAK;YAChB,QAAQ,EAAE,GAAG,CAAC,QAAQ,IAAI,SAAS;SACpC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,QAAQ,CACb,UAAU,EACV,kBAAkB,EAClB,EAAE,WAAW,EAAE,uCAAuC,EAAE,EACxD,KAAK,IAAI,EAAE,CAAC,CAAC;QACX,QAAQ,EAAE;YACR;gBACE,GAAG,EAAE,kBAAkB;gBACvB,QAAQ,EAAE,kBAAkB;gBAC5B,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;aACxC;SACF;KACF,CAAC,CACH,CAAC;AACJ,CAAC"}