imap-wizard 0.0.0-stage โ 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/COPYING +674 -0
- package/LICENSE +155 -0
- package/README.md +498 -2
- package/dist/app.d.ts +61 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/app.js +201 -0
- package/dist/app.js.map +1 -0
- package/dist/cache/body-cache.d.ts +29 -0
- package/dist/cache/body-cache.d.ts.map +1 -0
- package/dist/cache/body-cache.js +95 -0
- package/dist/cache/body-cache.js.map +1 -0
- package/dist/cache/schema.d.ts +40 -0
- package/dist/cache/schema.d.ts.map +1 -0
- package/dist/cache/schema.js +160 -0
- package/dist/cache/schema.js.map +1 -0
- package/dist/cache/store.d.ts +233 -0
- package/dist/cache/store.d.ts.map +1 -0
- package/dist/cache/store.js +556 -0
- package/dist/cache/store.js.map +1 -0
- package/dist/cache/sync-engine.d.ts +140 -0
- package/dist/cache/sync-engine.d.ts.map +1 -0
- package/dist/cache/sync-engine.js +477 -0
- package/dist/cache/sync-engine.js.map +1 -0
- package/dist/cli/account-commands.d.ts +51 -0
- package/dist/cli/account-commands.d.ts.map +1 -0
- package/dist/cli/account-commands.js +767 -0
- package/dist/cli/account-commands.js.map +1 -0
- package/dist/cli/config-commands.d.ts +9 -0
- package/dist/cli/config-commands.d.ts.map +1 -0
- package/dist/cli/config-commands.js +293 -0
- package/dist/cli/config-commands.js.map +1 -0
- package/dist/cli/email-commands.d.ts +18 -0
- package/dist/cli/email-commands.d.ts.map +1 -0
- package/dist/cli/email-commands.js +447 -0
- package/dist/cli/email-commands.js.map +1 -0
- package/dist/cli/guard.d.ts +11 -0
- package/dist/cli/guard.d.ts.map +1 -0
- package/dist/cli/guard.js +18 -0
- package/dist/cli/guard.js.map +1 -0
- package/dist/cli/http.d.ts +15 -0
- package/dist/cli/http.d.ts.map +1 -0
- package/dist/cli/http.js +263 -0
- package/dist/cli/http.js.map +1 -0
- package/dist/cli/install-commands.d.ts +18 -0
- package/dist/cli/install-commands.d.ts.map +1 -0
- package/dist/cli/install-commands.js +323 -0
- package/dist/cli/install-commands.js.map +1 -0
- package/dist/cli/keychain-commands.d.ts +9 -0
- package/dist/cli/keychain-commands.d.ts.map +1 -0
- package/dist/cli/keychain-commands.js +243 -0
- package/dist/cli/keychain-commands.js.map +1 -0
- package/dist/cli/notify.d.ts +8 -0
- package/dist/cli/notify.d.ts.map +1 -0
- package/dist/cli/notify.js +143 -0
- package/dist/cli/notify.js.map +1 -0
- package/dist/cli/providers.d.ts +13 -0
- package/dist/cli/providers.d.ts.map +1 -0
- package/dist/cli/providers.js +180 -0
- package/dist/cli/providers.js.map +1 -0
- package/dist/cli/scheduler.d.ts +8 -0
- package/dist/cli/scheduler.d.ts.map +1 -0
- package/dist/cli/scheduler.js +268 -0
- package/dist/cli/scheduler.js.map +1 -0
- package/dist/cli/setup.d.ts +12 -0
- package/dist/cli/setup.d.ts.map +1 -0
- package/dist/cli/setup.js +15 -0
- package/dist/cli/setup.js.map +1 -0
- package/dist/cli/test.d.ts +7 -0
- package/dist/cli/test.d.ts.map +1 -0
- package/dist/cli/test.js +67 -0
- package/dist/cli/test.js.map +1 -0
- package/dist/config/loader.d.ts +45 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +487 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/password-command.d.ts +14 -0
- package/dist/config/password-command.d.ts.map +1 -0
- package/dist/config/password-command.js +74 -0
- package/dist/config/password-command.js.map +1 -0
- package/dist/config/schema.d.ts +416 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +260 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/config/send-limit.d.ts +18 -0
- package/dist/config/send-limit.d.ts.map +1 -0
- package/dist/config/send-limit.js +64 -0
- package/dist/config/send-limit.js.map +1 -0
- package/dist/config/validate.d.ts +30 -0
- package/dist/config/validate.d.ts.map +1 -0
- package/dist/config/validate.js +120 -0
- package/dist/config/validate.js.map +1 -0
- package/dist/config/xdg.d.ts +44 -0
- package/dist/config/xdg.d.ts.map +1 -0
- package/dist/config/xdg.js +49 -0
- package/dist/config/xdg.js.map +1 -0
- package/dist/connections/manager.d.ts +53 -0
- package/dist/connections/manager.d.ts.map +1 -0
- package/dist/connections/manager.js +376 -0
- package/dist/connections/manager.js.map +1 -0
- package/dist/connections/types.d.ts +15 -0
- package/dist/connections/types.d.ts.map +1 -0
- package/dist/connections/types.js +2 -0
- package/dist/connections/types.js.map +1 -0
- package/dist/logging.d.ts +22 -0
- package/dist/logging.d.ts.map +1 -0
- package/dist/logging.js +33 -0
- package/dist/logging.js.map +1 -0
- package/dist/main.d.ts +15 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +276 -0
- package/dist/main.js.map +1 -0
- package/dist/prompts/actions.prompt.d.ts +9 -0
- package/dist/prompts/actions.prompt.d.ts.map +1 -0
- package/dist/prompts/actions.prompt.js +70 -0
- package/dist/prompts/actions.prompt.js.map +1 -0
- package/dist/prompts/calendar.prompt.d.ts +9 -0
- package/dist/prompts/calendar.prompt.d.ts.map +1 -0
- package/dist/prompts/calendar.prompt.js +59 -0
- package/dist/prompts/calendar.prompt.js.map +1 -0
- package/dist/prompts/cleanup.prompt.d.ts +9 -0
- package/dist/prompts/cleanup.prompt.d.ts.map +1 -0
- package/dist/prompts/cleanup.prompt.js +82 -0
- package/dist/prompts/cleanup.prompt.js.map +1 -0
- package/dist/prompts/compose.prompt.d.ts +8 -0
- package/dist/prompts/compose.prompt.d.ts.map +1 -0
- package/dist/prompts/compose.prompt.js +124 -0
- package/dist/prompts/compose.prompt.js.map +1 -0
- package/dist/prompts/register.d.ts +8 -0
- package/dist/prompts/register.d.ts.map +1 -0
- package/dist/prompts/register.js +20 -0
- package/dist/prompts/register.js.map +1 -0
- package/dist/prompts/thread.prompt.d.ts +9 -0
- package/dist/prompts/thread.prompt.d.ts.map +1 -0
- package/dist/prompts/thread.prompt.js +62 -0
- package/dist/prompts/thread.prompt.js.map +1 -0
- package/dist/prompts/triage.prompt.d.ts +9 -0
- package/dist/prompts/triage.prompt.d.ts.map +1 -0
- package/dist/prompts/triage.prompt.js +71 -0
- package/dist/prompts/triage.prompt.js.map +1 -0
- package/dist/resources/accounts.resource.d.ts +9 -0
- package/dist/resources/accounts.resource.d.ts.map +1 -0
- package/dist/resources/accounts.resource.js +26 -0
- package/dist/resources/accounts.resource.js.map +1 -0
- package/dist/resources/mailboxes.resource.d.ts +10 -0
- package/dist/resources/mailboxes.resource.d.ts.map +1 -0
- package/dist/resources/mailboxes.resource.js +33 -0
- package/dist/resources/mailboxes.resource.js.map +1 -0
- package/dist/resources/register.d.ts +12 -0
- package/dist/resources/register.d.ts.map +1 -0
- package/dist/resources/register.js +20 -0
- package/dist/resources/register.js.map +1 -0
- package/dist/resources/scheduled.resource.d.ts +9 -0
- package/dist/resources/scheduled.resource.d.ts.map +1 -0
- package/dist/resources/scheduled.resource.js +31 -0
- package/dist/resources/scheduled.resource.js.map +1 -0
- package/dist/resources/stats.resource.d.ts +10 -0
- package/dist/resources/stats.resource.d.ts.map +1 -0
- package/dist/resources/stats.resource.js +50 -0
- package/dist/resources/stats.resource.js.map +1 -0
- package/dist/resources/templates.resource.d.ts +9 -0
- package/dist/resources/templates.resource.d.ts.map +1 -0
- package/dist/resources/templates.resource.js +34 -0
- package/dist/resources/templates.resource.js.map +1 -0
- package/dist/resources/unread.resource.d.ts +11 -0
- package/dist/resources/unread.resource.d.ts.map +1 -0
- package/dist/resources/unread.resource.js +53 -0
- package/dist/resources/unread.resource.js.map +1 -0
- package/dist/safety/audit.d.ts +17 -0
- package/dist/safety/audit.d.ts.map +1 -0
- package/dist/safety/audit.js +50 -0
- package/dist/safety/audit.js.map +1 -0
- package/dist/safety/rate-limiter.d.ts +22 -0
- package/dist/safety/rate-limiter.d.ts.map +1 -0
- package/dist/safety/rate-limiter.js +52 -0
- package/dist/safety/rate-limiter.js.map +1 -0
- package/dist/safety/validation.d.ts +46 -0
- package/dist/safety/validation.d.ts.map +1 -0
- package/dist/safety/validation.js +114 -0
- package/dist/safety/validation.js.map +1 -0
- package/dist/safety/webhook-guard.d.ts +33 -0
- package/dist/safety/webhook-guard.d.ts.map +1 -0
- package/dist/safety/webhook-guard.js +154 -0
- package/dist/safety/webhook-guard.js.map +1 -0
- package/dist/security/keychain.d.ts +31 -0
- package/dist/security/keychain.d.ts.map +1 -0
- package/dist/security/keychain.js +217 -0
- package/dist/security/keychain.js.map +1 -0
- package/dist/server.d.ts +13 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +35 -0
- package/dist/server.js.map +1 -0
- package/dist/services/calendar.service.d.ts +22 -0
- package/dist/services/calendar.service.d.ts.map +1 -0
- package/dist/services/calendar.service.js +115 -0
- package/dist/services/calendar.service.js.map +1 -0
- package/dist/services/clipboard.service.d.ts +16 -0
- package/dist/services/clipboard.service.d.ts.map +1 -0
- package/dist/services/clipboard.service.js +92 -0
- package/dist/services/clipboard.service.js.map +1 -0
- package/dist/services/event-bus.d.ts +62 -0
- package/dist/services/event-bus.d.ts.map +1 -0
- package/dist/services/event-bus.js +16 -0
- package/dist/services/event-bus.js.map +1 -0
- package/dist/services/hooks.service.d.ts +88 -0
- package/dist/services/hooks.service.d.ts.map +1 -0
- package/dist/services/hooks.service.js +539 -0
- package/dist/services/hooks.service.js.map +1 -0
- package/dist/services/imap.service.d.ts +301 -0
- package/dist/services/imap.service.d.ts.map +1 -0
- package/dist/services/imap.service.js +2135 -0
- package/dist/services/imap.service.js.map +1 -0
- package/dist/services/label-strategy.d.ts +20 -0
- package/dist/services/label-strategy.d.ts.map +1 -0
- package/dist/services/label-strategy.js +247 -0
- package/dist/services/label-strategy.js.map +1 -0
- package/dist/services/local-calendar.service.d.ts +127 -0
- package/dist/services/local-calendar.service.d.ts.map +1 -0
- package/dist/services/local-calendar.service.js +537 -0
- package/dist/services/local-calendar.service.js.map +1 -0
- package/dist/services/notifier.service.d.ts +91 -0
- package/dist/services/notifier.service.d.ts.map +1 -0
- package/dist/services/notifier.service.js +381 -0
- package/dist/services/notifier.service.js.map +1 -0
- package/dist/services/oauth.service.d.ts +47 -0
- package/dist/services/oauth.service.d.ts.map +1 -0
- package/dist/services/oauth.service.js +140 -0
- package/dist/services/oauth.service.js.map +1 -0
- package/dist/services/presets.d.ts +36 -0
- package/dist/services/presets.d.ts.map +1 -0
- package/dist/services/presets.js +175 -0
- package/dist/services/presets.js.map +1 -0
- package/dist/services/reminders.service.d.ts +63 -0
- package/dist/services/reminders.service.d.ts.map +1 -0
- package/dist/services/reminders.service.js +305 -0
- package/dist/services/reminders.service.js.map +1 -0
- package/dist/services/scheduler.service.d.ts +42 -0
- package/dist/services/scheduler.service.d.ts.map +1 -0
- package/dist/services/scheduler.service.js +294 -0
- package/dist/services/scheduler.service.js.map +1 -0
- package/dist/services/smtp.service.d.ts +97 -0
- package/dist/services/smtp.service.d.ts.map +1 -0
- package/dist/services/smtp.service.js +339 -0
- package/dist/services/smtp.service.js.map +1 -0
- package/dist/services/template.service.d.ts +33 -0
- package/dist/services/template.service.d.ts.map +1 -0
- package/dist/services/template.service.js +123 -0
- package/dist/services/template.service.js.map +1 -0
- package/dist/services/verification.service.d.ts +26 -0
- package/dist/services/verification.service.d.ts.map +1 -0
- package/dist/services/verification.service.js +94 -0
- package/dist/services/verification.service.js.map +1 -0
- package/dist/services/watcher.service.d.ts +36 -0
- package/dist/services/watcher.service.d.ts.map +1 -0
- package/dist/services/watcher.service.js +238 -0
- package/dist/services/watcher.service.js.map +1 -0
- package/dist/tools/accounts.tool.d.ts +7 -0
- package/dist/tools/accounts.tool.d.ts.map +1 -0
- package/dist/tools/accounts.tool.js +33 -0
- package/dist/tools/accounts.tool.js.map +1 -0
- package/dist/tools/analytics.tool.d.ts +9 -0
- package/dist/tools/analytics.tool.d.ts.map +1 -0
- package/dist/tools/analytics.tool.js +32 -0
- package/dist/tools/analytics.tool.js.map +1 -0
- package/dist/tools/attachments.tool.d.ts +7 -0
- package/dist/tools/attachments.tool.d.ts.map +1 -0
- package/dist/tools/attachments.tool.js +93 -0
- package/dist/tools/attachments.tool.js.map +1 -0
- package/dist/tools/bulk.tool.d.ts +7 -0
- package/dist/tools/bulk.tool.d.ts.map +1 -0
- package/dist/tools/bulk.tool.js +80 -0
- package/dist/tools/bulk.tool.js.map +1 -0
- package/dist/tools/calendar.tool.d.ts +19 -0
- package/dist/tools/calendar.tool.d.ts.map +1 -0
- package/dist/tools/calendar.tool.js +576 -0
- package/dist/tools/calendar.tool.js.map +1 -0
- package/dist/tools/contacts.tool.d.ts +7 -0
- package/dist/tools/contacts.tool.d.ts.map +1 -0
- package/dist/tools/contacts.tool.js +49 -0
- package/dist/tools/contacts.tool.js.map +1 -0
- package/dist/tools/drafts.tool.d.ts +8 -0
- package/dist/tools/drafts.tool.d.ts.map +1 -0
- package/dist/tools/drafts.tool.js +110 -0
- package/dist/tools/drafts.tool.js.map +1 -0
- package/dist/tools/emails.tool.d.ts +17 -0
- package/dist/tools/emails.tool.d.ts.map +1 -0
- package/dist/tools/emails.tool.js +508 -0
- package/dist/tools/emails.tool.js.map +1 -0
- package/dist/tools/folders.tool.d.ts +7 -0
- package/dist/tools/folders.tool.d.ts.map +1 -0
- package/dist/tools/folders.tool.js +129 -0
- package/dist/tools/folders.tool.js.map +1 -0
- package/dist/tools/health.tool.d.ts +10 -0
- package/dist/tools/health.tool.d.ts.map +1 -0
- package/dist/tools/health.tool.js +106 -0
- package/dist/tools/health.tool.js.map +1 -0
- package/dist/tools/label.tool.d.ts +11 -0
- package/dist/tools/label.tool.d.ts.map +1 -0
- package/dist/tools/label.tool.js +190 -0
- package/dist/tools/label.tool.js.map +1 -0
- package/dist/tools/locate.tool.d.ts +11 -0
- package/dist/tools/locate.tool.d.ts.map +1 -0
- package/dist/tools/locate.tool.js +65 -0
- package/dist/tools/locate.tool.js.map +1 -0
- package/dist/tools/mailboxes.tool.d.ts +7 -0
- package/dist/tools/mailboxes.tool.d.ts.map +1 -0
- package/dist/tools/mailboxes.tool.js +49 -0
- package/dist/tools/mailboxes.tool.js.map +1 -0
- package/dist/tools/manage.tool.d.ts +7 -0
- package/dist/tools/manage.tool.d.ts.map +1 -0
- package/dist/tools/manage.tool.js +140 -0
- package/dist/tools/manage.tool.js.map +1 -0
- package/dist/tools/register.d.ts +20 -0
- package/dist/tools/register.d.ts.map +1 -0
- package/dist/tools/register.js +60 -0
- package/dist/tools/register.js.map +1 -0
- package/dist/tools/scheduler.tool.d.ts +9 -0
- package/dist/tools/scheduler.tool.d.ts.map +1 -0
- package/dist/tools/scheduler.tool.js +130 -0
- package/dist/tools/scheduler.tool.js.map +1 -0
- package/dist/tools/schemas.d.ts +146 -0
- package/dist/tools/schemas.d.ts.map +1 -0
- package/dist/tools/schemas.js +89 -0
- package/dist/tools/schemas.js.map +1 -0
- package/dist/tools/security.tool.d.ts +11 -0
- package/dist/tools/security.tool.d.ts.map +1 -0
- package/dist/tools/security.tool.js +49 -0
- package/dist/tools/security.tool.js.map +1 -0
- package/dist/tools/send.tool.d.ts +7 -0
- package/dist/tools/send.tool.d.ts.map +1 -0
- package/dist/tools/send.tool.js +196 -0
- package/dist/tools/send.tool.js.map +1 -0
- package/dist/tools/templates.tool.d.ts +12 -0
- package/dist/tools/templates.tool.d.ts.map +1 -0
- package/dist/tools/templates.tool.js +149 -0
- package/dist/tools/templates.tool.js.map +1 -0
- package/dist/tools/thread.tool.d.ts +10 -0
- package/dist/tools/thread.tool.d.ts.map +1 -0
- package/dist/tools/thread.tool.js +140 -0
- package/dist/tools/thread.tool.js.map +1 -0
- package/dist/tools/verification.tool.d.ts +5 -0
- package/dist/tools/verification.tool.d.ts.map +1 -0
- package/dist/tools/verification.tool.js +125 -0
- package/dist/tools/verification.tool.js.map +1 -0
- package/dist/tools/watcher.tool.d.ts +19 -0
- package/dist/tools/watcher.tool.d.ts.map +1 -0
- package/dist/tools/watcher.tool.js +319 -0
- package/dist/tools/watcher.tool.js.map +1 -0
- package/dist/types/index.d.ts +329 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +5 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/auth-results.d.ts +24 -0
- package/dist/utils/auth-results.d.ts.map +1 -0
- package/dist/utils/auth-results.js +71 -0
- package/dist/utils/auth-results.js.map +1 -0
- package/dist/utils/bulk-headers.d.ts +34 -0
- package/dist/utils/bulk-headers.d.ts.map +1 -0
- package/dist/utils/bulk-headers.js +112 -0
- package/dist/utils/bulk-headers.js.map +1 -0
- package/dist/utils/calendar-notes.d.ts +31 -0
- package/dist/utils/calendar-notes.d.ts.map +1 -0
- package/dist/utils/calendar-notes.js +83 -0
- package/dist/utils/calendar-notes.js.map +1 -0
- package/dist/utils/calendar-state.d.ts +27 -0
- package/dist/utils/calendar-state.d.ts.map +1 -0
- package/dist/utils/calendar-state.js +85 -0
- package/dist/utils/calendar-state.js.map +1 -0
- package/dist/utils/conference-details.d.ts +12 -0
- package/dist/utils/conference-details.d.ts.map +1 -0
- package/dist/utils/conference-details.js +71 -0
- package/dist/utils/conference-details.js.map +1 -0
- package/dist/utils/html.d.ts +24 -0
- package/dist/utils/html.d.ts.map +1 -0
- package/dist/utils/html.js +162 -0
- package/dist/utils/html.js.map +1 -0
- package/dist/utils/imap-client.d.ts +22 -0
- package/dist/utils/imap-client.d.ts.map +1 -0
- package/dist/utils/imap-client.js +26 -0
- package/dist/utils/imap-client.js.map +1 -0
- package/dist/utils/imap-error.d.ts +28 -0
- package/dist/utils/imap-error.d.ts.map +1 -0
- package/dist/utils/imap-error.js +82 -0
- package/dist/utils/imap-error.js.map +1 -0
- package/dist/utils/meeting-url.d.ts +10 -0
- package/dist/utils/meeting-url.d.ts.map +1 -0
- package/dist/utils/meeting-url.js +30 -0
- package/dist/utils/meeting-url.js.map +1 -0
- package/dist/utils/offline-notice.d.ts +10 -0
- package/dist/utils/offline-notice.d.ts.map +1 -0
- package/dist/utils/offline-notice.js +10 -0
- package/dist/utils/offline-notice.js.map +1 -0
- package/dist/utils/reply-chain.d.ts +6 -0
- package/dist/utils/reply-chain.d.ts.map +1 -0
- package/dist/utils/reply-chain.js +15 -0
- package/dist/utils/reply-chain.js.map +1 -0
- package/dist/utils/verification-code.d.ts +29 -0
- package/dist/utils/verification-code.d.ts.map +1 -0
- package/dist/utils/verification-code.js +305 -0
- package/dist/utils/verification-code.js.map +1 -0
- package/dist/utils/verification-link.d.ts +26 -0
- package/dist/utils/verification-link.d.ts.map +1 -0
- package/dist/utils/verification-link.js +197 -0
- package/dist/utils/verification-link.js.map +1 -0
- package/package.json +106 -4
package/dist/main.js
ADDED
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* IMAP Wizard โ Main entry point.
|
|
4
|
+
*
|
|
5
|
+
* Subcommands:
|
|
6
|
+
* stdio Run as MCP server over stdio (default)
|
|
7
|
+
* http Run as MCP server over Streamable HTTP (networked)
|
|
8
|
+
* account Account management (list, add, edit, delete)
|
|
9
|
+
* test Test IMAP/SMTP connections
|
|
10
|
+
* config Config management (show, edit, validate, path, init)
|
|
11
|
+
* scheduler Email scheduling management
|
|
12
|
+
* list/read/search/... Read and compose email from the terminal
|
|
13
|
+
*/
|
|
14
|
+
import { StdioServerTransport, serveStdio } from '@modelcontextprotocol/server/stdio';
|
|
15
|
+
import { buildServer, buildServices, startBackgroundServices } from './app.js';
|
|
16
|
+
import { PKG_VERSION } from './server.js';
|
|
17
|
+
/**
|
|
18
|
+
* How long a graceful shutdown may take before the process is forced down.
|
|
19
|
+
* Bounds the two goodbye round trips (SMTP QUIT, IMAP LOGOUT) over a slow WAN;
|
|
20
|
+
* past that, dropping the sockets beats leaking the process we are shutting down.
|
|
21
|
+
*/
|
|
22
|
+
const SHUTDOWN_GRACE_MS = 5_000;
|
|
23
|
+
const HELP = `
|
|
24
|
+
imap-wizard โ IMAP Wizard (email MCP server: IMAP + SMTP)
|
|
25
|
+
|
|
26
|
+
Usage:
|
|
27
|
+
imap-wizard [command]
|
|
28
|
+
|
|
29
|
+
Commands:
|
|
30
|
+
stdio Run as MCP server over stdio (default)
|
|
31
|
+
http Run as MCP server over Streamable HTTP (networked)
|
|
32
|
+
account Account management (list, add, edit, delete)
|
|
33
|
+
setup Alias for 'account add'
|
|
34
|
+
test Test connections for all or a specific account
|
|
35
|
+
install Register/unregister with MCP clients (Claude, Cursor, โฆ)
|
|
36
|
+
config Config management (show, edit, validate, path, init)
|
|
37
|
+
keychain Password management (migrate, status, remove)
|
|
38
|
+
scheduler Email scheduling management (check, list, install, uninstall, status)
|
|
39
|
+
list List recent emails
|
|
40
|
+
read Read an email by ID
|
|
41
|
+
search Search emails
|
|
42
|
+
mailboxes List mailboxes/folders
|
|
43
|
+
flag Flag or unflag an email
|
|
44
|
+
delete Delete an email (asks first unless --yes)
|
|
45
|
+
attach Download an email attachment
|
|
46
|
+
reply Reply to an email
|
|
47
|
+
send Send an email
|
|
48
|
+
notify Test and diagnose desktop notifications
|
|
49
|
+
help Show this help message
|
|
50
|
+
|
|
51
|
+
Examples:
|
|
52
|
+
imap-wizard # Start MCP server (stdio)
|
|
53
|
+
imap-wizard http --port 8080 # Start Streamable HTTP server on :8080/mcp
|
|
54
|
+
imap-wizard http --host 0.0.0.0 --port 8080 # Bind all interfaces (requires a token)
|
|
55
|
+
imap-wizard account list # List configured accounts
|
|
56
|
+
imap-wizard account add # Add a new email account
|
|
57
|
+
imap-wizard account edit personal # Edit an account
|
|
58
|
+
imap-wizard account delete work # Delete an account
|
|
59
|
+
imap-wizard setup # Alias for account add
|
|
60
|
+
imap-wizard test # Test all accounts
|
|
61
|
+
imap-wizard test personal # Test specific account
|
|
62
|
+
imap-wizard install # Register with detected MCP clients
|
|
63
|
+
imap-wizard install status # Show client registration status
|
|
64
|
+
imap-wizard install remove # Unregister from MCP clients
|
|
65
|
+
imap-wizard config show # Show config (passwords masked)
|
|
66
|
+
imap-wizard config edit # Edit global settings
|
|
67
|
+
imap-wizard config validate # Syntax, schema, typo'd keys, consistency
|
|
68
|
+
imap-wizard config path # Print config file path
|
|
69
|
+
imap-wizard config init # Create template config
|
|
70
|
+
imap-wizard keychain status # Show Keychain vs plain text passwords
|
|
71
|
+
imap-wizard keychain migrate # Move passwords to macOS Keychain
|
|
72
|
+
imap-wizard keychain remove [name] # Remove a password from Keychain
|
|
73
|
+
imap-wizard scheduler check # Send overdue scheduled emails
|
|
74
|
+
imap-wizard scheduler install # Install OS periodic check
|
|
75
|
+
imap-wizard list --unread # List unread messages
|
|
76
|
+
imap-wizard read 1234 # Read a message
|
|
77
|
+
imap-wizard send --to a@b.com --subject Hello --body "Hi"
|
|
78
|
+
imap-wizard send --help # Show options for an email command
|
|
79
|
+
imap-wizard notify test # Send a test notification
|
|
80
|
+
imap-wizard notify status # Check notification platform support
|
|
81
|
+
`.trim();
|
|
82
|
+
async function runServer() {
|
|
83
|
+
const services = await buildServices();
|
|
84
|
+
let background;
|
|
85
|
+
let started = false;
|
|
86
|
+
// Idle exit โ settings.idle_exit seconds without an inbound MCP message and
|
|
87
|
+
// the process takes itself down, so a host that keeps a session open forever
|
|
88
|
+
// (resumed chats, forgotten terminals) does not pin a child for days. EOF
|
|
89
|
+
// above stays the primary lifecycle signal; this is the backstop for hosts
|
|
90
|
+
// that never close the pipe. 0 disables, and 0 is the default.
|
|
91
|
+
const idleExitSec = services.config.settings.idleExit;
|
|
92
|
+
let lastActivity = Date.now();
|
|
93
|
+
// Tap the transport's message handler through an accessor rather than a
|
|
94
|
+
// one-time wrap: serveStdio assigns `transport.onmessage` itself, and an
|
|
95
|
+
// accessor keeps the tap installed even if the handler is reassigned later
|
|
96
|
+
// (era pinning routes through the queue, but a future SDK could rewire it).
|
|
97
|
+
// The getter rebuilds the wrapper per call so `lastActivity` is stamped at
|
|
98
|
+
// delivery time, not at assignment time.
|
|
99
|
+
const transport = new StdioServerTransport();
|
|
100
|
+
let deliver;
|
|
101
|
+
Object.defineProperty(transport, 'onmessage', {
|
|
102
|
+
configurable: true,
|
|
103
|
+
get() {
|
|
104
|
+
if (!deliver)
|
|
105
|
+
return undefined;
|
|
106
|
+
return (message) => {
|
|
107
|
+
lastActivity = Date.now();
|
|
108
|
+
deliver?.(message);
|
|
109
|
+
};
|
|
110
|
+
},
|
|
111
|
+
set(next) {
|
|
112
|
+
deliver = next;
|
|
113
|
+
},
|
|
114
|
+
});
|
|
115
|
+
// serveStdio owns the transport: it selects the protocol era from the
|
|
116
|
+
// opening exchange, pins one instance from the factory for the connection,
|
|
117
|
+
// and serves both 2025- and 2026-era clients (legacy shim, default). For
|
|
118
|
+
// stdio there is exactly one connection, so we start the process-level
|
|
119
|
+
// background services the first time the factory builds a server โ parity
|
|
120
|
+
// with the old post-`initialized` hook, minus the stateful handshake dance
|
|
121
|
+
// the 2026-07-28 spec removed.
|
|
122
|
+
const handle = serveStdio(() => {
|
|
123
|
+
const server = buildServer(services);
|
|
124
|
+
if (!started) {
|
|
125
|
+
started = true;
|
|
126
|
+
background = startBackgroundServices(services, server.server);
|
|
127
|
+
}
|
|
128
|
+
return server;
|
|
129
|
+
}, { transport });
|
|
130
|
+
// Graceful shutdown.
|
|
131
|
+
//
|
|
132
|
+
// The spec puts shutdown on the client: over stdio it SHOULD initiate it by
|
|
133
|
+
// "first, closing the input stream to the child process (the server)", then
|
|
134
|
+
// "waiting for the server to exit" before escalating to SIGTERM and SIGKILL
|
|
135
|
+
// (MCP basic/lifecycle, Shutdown). So EOF is the primary signal, not a
|
|
136
|
+
// fallback โ and the only one that survives a SIGKILLed client, since the
|
|
137
|
+
// kernel closes the pipe either way, and the only one Windows has, lacking
|
|
138
|
+
// POSIX signals. serveStdio closes its transport at EOF, but closing the
|
|
139
|
+
// transport does not drain the event loop: the services above hold ref'd
|
|
140
|
+
// handles (scheduler tick, hooks rate-limit timer, IMAP IDLE sockets), so
|
|
141
|
+
// nothing observes EOF unless we listen for it here. Skipping that leaks an
|
|
142
|
+
// immortal process on every client death that misses SIGTERM: closed
|
|
143
|
+
// terminal, SIGKILL, crash, MCP reconnect.
|
|
144
|
+
let shuttingDown = false;
|
|
145
|
+
const shutdown = async (reason) => {
|
|
146
|
+
// EOF, 'close' and a signal routinely arrive together.
|
|
147
|
+
if (shuttingDown)
|
|
148
|
+
return;
|
|
149
|
+
shuttingDown = true;
|
|
150
|
+
// A hung QUIT/LOGOUT must not resurrect the orphan this exists to prevent.
|
|
151
|
+
// The valve is unref'd or it becomes the handle it was meant to release.
|
|
152
|
+
setTimeout(() => {
|
|
153
|
+
process.stderr.write(`[imap-wizard] shutdown (${reason}) timed out โ forcing exit\n`);
|
|
154
|
+
// `process.exitCode` is the house style, but it only takes effect once the
|
|
155
|
+
// loop drains, and a hung shutdown is exactly the case where it will not.
|
|
156
|
+
// Throwing would surface as an uncaught exception from a timer rather than
|
|
157
|
+
// a stop. Forcing the exit is what this valve is for.
|
|
158
|
+
// eslint-disable-next-line n/no-process-exit
|
|
159
|
+
process.exit(1);
|
|
160
|
+
}, SHUTDOWN_GRACE_MS).unref();
|
|
161
|
+
if (background)
|
|
162
|
+
await background.stop();
|
|
163
|
+
await services.connections.closeAll();
|
|
164
|
+
await handle.close();
|
|
165
|
+
};
|
|
166
|
+
const requestShutdown = (reason) => {
|
|
167
|
+
void shutdown(reason);
|
|
168
|
+
};
|
|
169
|
+
// Listening for 'data' here would switch stdin to flowing mode and eat protocol
|
|
170
|
+
// bytes from under the SDK; 'end'/'close' leave the stream's mode untouched.
|
|
171
|
+
process.stdin.once('end', () => requestShutdown('stdin EOF'));
|
|
172
|
+
process.stdin.once('close', () => requestShutdown('stdin closed'));
|
|
173
|
+
process.on('SIGINT', () => requestShutdown('SIGINT'));
|
|
174
|
+
process.on('SIGTERM', () => requestShutdown('SIGTERM'));
|
|
175
|
+
process.on('SIGHUP', () => requestShutdown('SIGHUP'));
|
|
176
|
+
if (idleExitSec > 0) {
|
|
177
|
+
const idleMs = idleExitSec * 1_000;
|
|
178
|
+
// Check often enough that short values fire close to their deadline (the
|
|
179
|
+
// lifecycle test runs at 2s) and rarely enough that a configured idle
|
|
180
|
+
// window costs a handful of ticks: at most one tick of overshoot.
|
|
181
|
+
const timer = setInterval(() => {
|
|
182
|
+
if (Date.now() - lastActivity < idleMs)
|
|
183
|
+
return;
|
|
184
|
+
clearInterval(timer);
|
|
185
|
+
process.stderr.write(`[imap-wizard] no MCP requests for ${idleExitSec}s โ exiting (settings.idle_exit = 0 keeps the server running)\n`);
|
|
186
|
+
requestShutdown(`idle ${idleExitSec}s`);
|
|
187
|
+
}, Math.max(1_000, Math.min(idleMs, 30_000)));
|
|
188
|
+
// Unref'd: the idle valve must never be the handle that keeps the process
|
|
189
|
+
// alive โ the same rule the shutdown grace valve follows above.
|
|
190
|
+
timer.unref();
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
async function main() {
|
|
194
|
+
const command = process.argv[2] ?? 'stdio';
|
|
195
|
+
switch (command) {
|
|
196
|
+
case 'list':
|
|
197
|
+
case 'read':
|
|
198
|
+
case 'search':
|
|
199
|
+
case 'mailboxes':
|
|
200
|
+
case 'flag':
|
|
201
|
+
case 'delete':
|
|
202
|
+
case 'attach':
|
|
203
|
+
case 'reply':
|
|
204
|
+
case 'send': {
|
|
205
|
+
const { default: runEmailCommand } = await import('./cli/email-commands.js');
|
|
206
|
+
await runEmailCommand(command, process.argv.slice(3));
|
|
207
|
+
break;
|
|
208
|
+
}
|
|
209
|
+
case 'stdio':
|
|
210
|
+
await runServer();
|
|
211
|
+
break;
|
|
212
|
+
case 'http': {
|
|
213
|
+
const { default: runHttp } = await import('./cli/http.js');
|
|
214
|
+
await runHttp(process.argv.slice(3));
|
|
215
|
+
break;
|
|
216
|
+
}
|
|
217
|
+
case 'setup': {
|
|
218
|
+
const { default: runSetup } = await import('./cli/setup.js');
|
|
219
|
+
await runSetup();
|
|
220
|
+
break;
|
|
221
|
+
}
|
|
222
|
+
case 'account': {
|
|
223
|
+
const { default: runAccountCommand } = await import('./cli/account-commands.js');
|
|
224
|
+
await runAccountCommand(process.argv[3], process.argv[4]);
|
|
225
|
+
break;
|
|
226
|
+
}
|
|
227
|
+
case 'test': {
|
|
228
|
+
const { default: runTest } = await import('./cli/test.js');
|
|
229
|
+
await runTest(process.argv[3]);
|
|
230
|
+
break;
|
|
231
|
+
}
|
|
232
|
+
case 'config': {
|
|
233
|
+
const { default: runConfigCommand } = await import('./cli/config-commands.js');
|
|
234
|
+
await runConfigCommand(process.argv[3]);
|
|
235
|
+
break;
|
|
236
|
+
}
|
|
237
|
+
case 'install': {
|
|
238
|
+
const { default: runInstallCommand } = await import('./cli/install-commands.js');
|
|
239
|
+
await runInstallCommand(process.argv[3]);
|
|
240
|
+
break;
|
|
241
|
+
}
|
|
242
|
+
case 'keychain': {
|
|
243
|
+
const { default: runKeychainCommand } = await import('./cli/keychain-commands.js');
|
|
244
|
+
await runKeychainCommand(process.argv[3], process.argv[4]);
|
|
245
|
+
break;
|
|
246
|
+
}
|
|
247
|
+
case 'scheduler': {
|
|
248
|
+
const { default: runSchedulerCommand } = await import('./cli/scheduler.js');
|
|
249
|
+
await runSchedulerCommand(process.argv[3]);
|
|
250
|
+
break;
|
|
251
|
+
}
|
|
252
|
+
case 'notify': {
|
|
253
|
+
const { default: runNotifyCommand } = await import('./cli/notify.js');
|
|
254
|
+
await runNotifyCommand(process.argv[3]);
|
|
255
|
+
break;
|
|
256
|
+
}
|
|
257
|
+
case '--version':
|
|
258
|
+
case '-v':
|
|
259
|
+
console.log(PKG_VERSION);
|
|
260
|
+
break;
|
|
261
|
+
case 'help':
|
|
262
|
+
case '--help':
|
|
263
|
+
case '-h':
|
|
264
|
+
console.log(HELP);
|
|
265
|
+
break;
|
|
266
|
+
default:
|
|
267
|
+
console.error(`Unknown command: ${command}\n`);
|
|
268
|
+
console.log(HELP);
|
|
269
|
+
throw new Error(`Unknown command: ${command}`);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
main().catch((err) => {
|
|
273
|
+
console.error('Fatal error:', err instanceof Error ? err.message : String(err));
|
|
274
|
+
process.exitCode = 1;
|
|
275
|
+
});
|
|
276
|
+
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAGtF,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C;;;;GAIG;AACH,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAEhC,MAAM,IAAI,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DZ,CAAC,IAAI,EAAE,CAAC;AAET,KAAK,UAAU,SAAS;IACtB,MAAM,QAAQ,GAAG,MAAM,aAAa,EAAE,CAAC;IAEvC,IAAI,UAAwC,CAAC;IAC7C,IAAI,OAAO,GAAG,KAAK,CAAC;IAEpB,4EAA4E;IAC5E,6EAA6E;IAC7E,0EAA0E;IAC1E,2EAA2E;IAC3E,+DAA+D;IAC/D,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC;IACtD,IAAI,YAAY,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAE9B,wEAAwE;IACxE,yEAAyE;IACzE,2EAA2E;IAC3E,4EAA4E;IAC5E,2EAA2E;IAC3E,yCAAyC;IACzC,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAE7C,IAAI,OAAuC,CAAC;IAC5C,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,WAAW,EAAE;QAC5C,YAAY,EAAE,IAAI;QAClB,GAAG;YACD,IAAI,CAAC,OAAO;gBAAE,OAAO,SAAS,CAAC;YAC/B,OAA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
/**
|
|
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/server';
|
|
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,8BAA8B,CAAC;AAG9D,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAkErE"}
|
|
@@ -0,0 +1,70 @@
|
|
|
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.registerPrompt('extract_action_items', {
|
|
10
|
+
title: 'Extract action items',
|
|
11
|
+
description: 'Scan recent emails and extract action items, deadlines, and commitments. Produces a structured task list with source references.',
|
|
12
|
+
argsSchema: z.object({
|
|
13
|
+
account: z.string().describe('Account name'),
|
|
14
|
+
mailbox: z.string().default('INBOX').describe('Mailbox to scan (default: INBOX)'),
|
|
15
|
+
limit: z.string().default('20').describe('Number of recent emails to scan (default: 20)'),
|
|
16
|
+
}),
|
|
17
|
+
}, async ({ account, mailbox, limit }) => {
|
|
18
|
+
const limitNum = Math.min(Math.max(parseInt(limit, 10) || 20, 1), 50);
|
|
19
|
+
return {
|
|
20
|
+
messages: [
|
|
21
|
+
{
|
|
22
|
+
role: 'user',
|
|
23
|
+
content: {
|
|
24
|
+
type: 'text',
|
|
25
|
+
text: `Extract action items from recent emails in the "${mailbox}" mailbox of the "${account}" account.
|
|
26
|
+
|
|
27
|
+
Follow these steps:
|
|
28
|
+
1. Call list_emails with account="${account}", mailbox="${mailbox}", pageSize=${limitNum} to get recent emails.
|
|
29
|
+
2. For each email that looks like it might contain action items (based on subject and sender),
|
|
30
|
+
call get_email to read the full content. Emails marked ๐ฐ newsletter or ๐ค automated rarely
|
|
31
|
+
carry action items โ skip them unless the subject clearly suggests otherwise.
|
|
32
|
+
3. Extract ALL actionable items from the emails.
|
|
33
|
+
|
|
34
|
+
Look for:
|
|
35
|
+
- **Direct requests:** "Please...", "Can you...", "Could you...", "I need..."
|
|
36
|
+
- **Deadlines:** Dates, "by end of week", "ASAP", "before the meeting"
|
|
37
|
+
- **Commitments you made:** "I will...", "I'll send...", "Let me..."
|
|
38
|
+
- **Questions awaiting your response:** Questions directed at you
|
|
39
|
+
- **Meeting follow-ups:** Action items from meetings mentioned in emails
|
|
40
|
+
- **Approvals needed:** Requests for sign-off or review
|
|
41
|
+
|
|
42
|
+
Output a structured report in this format:
|
|
43
|
+
|
|
44
|
+
## โ
Action Items โ ${account}
|
|
45
|
+
**Scanned:** [Count] emails from ${mailbox}
|
|
46
|
+
|
|
47
|
+
### ๐ด Urgent / Has Deadline
|
|
48
|
+
- [ ] [Action description] โ from [Sender] ([Date])
|
|
49
|
+
๐ง Re: [Subject] | โฐ Deadline: [deadline if mentioned]
|
|
50
|
+
|
|
51
|
+
### ๐ก Needs Response
|
|
52
|
+
- [ ] [Reply to / Answer question about...] โ from [Sender] ([Date])
|
|
53
|
+
๐ง Re: [Subject]
|
|
54
|
+
|
|
55
|
+
### ๐ต Tasks / Commitments
|
|
56
|
+
- [ ] [Task description] โ from [Sender] ([Date])
|
|
57
|
+
๐ง Re: [Subject]
|
|
58
|
+
|
|
59
|
+
### ๐ Summary
|
|
60
|
+
- **Total action items:** [count]
|
|
61
|
+
- **With deadlines:** [count]
|
|
62
|
+
- **Awaiting your response:** [count]
|
|
63
|
+
- **Commitments you made:** [count]`,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
//# 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,cAAc,CACnB,sBAAsB,EACtB;QACE,KAAK,EAAE,sBAAsB;QAC7B,WAAW,EACT,kIAAkI;QACpI,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC;YACnB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC;YAC5C,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,kCAAkC,CAAC;YACjF,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,+CAA+C,CAAC;SAC1F,CAAC;KACH,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;;;;;;;;;;;;;;;;sBAgBlE,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/server';
|
|
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,8BAA8B,CAAC;AAG9D,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAuDtE"}
|
|
@@ -0,0 +1,59 @@
|
|
|
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.registerPrompt('summarize_meetings', {
|
|
10
|
+
title: 'Summarize meetings',
|
|
11
|
+
description: 'Scan recent emails for calendar invites and produce a meeting overview grouped by timeframe.',
|
|
12
|
+
argsSchema: z.object({
|
|
13
|
+
account: z.string().describe('Account name to scan'),
|
|
14
|
+
days: z.string().default('7').describe('Number of days to look back (default: 7)'),
|
|
15
|
+
}),
|
|
16
|
+
}, async ({ account, days }) => {
|
|
17
|
+
const daysNum = Math.min(Math.max(parseInt(days, 10) || 7, 1), 30);
|
|
18
|
+
return {
|
|
19
|
+
messages: [
|
|
20
|
+
{
|
|
21
|
+
role: 'user',
|
|
22
|
+
content: {
|
|
23
|
+
type: 'text',
|
|
24
|
+
text: `Scan the "${account}" account for calendar invitations from the last ${daysNum} days.
|
|
25
|
+
|
|
26
|
+
Follow these steps:
|
|
27
|
+
1. Call search_emails with account="${account}", mailbox="INBOX", since="${new Date(Date.now() - daysNum * 86400000).toISOString().split('T')[0]}" to find recent emails.
|
|
28
|
+
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.
|
|
29
|
+
3. Collect all calendar events found.
|
|
30
|
+
|
|
31
|
+
Then produce a meeting brief in this format:
|
|
32
|
+
|
|
33
|
+
## ๐
Meeting Brief โ ${account}
|
|
34
|
+
**Period:** Last ${daysNum} days | **Events found:** [count]
|
|
35
|
+
|
|
36
|
+
### ๐ Today
|
|
37
|
+
- **[Time]** [Summary] โ [Location] | ๐ค [Organizer] | [Attendee count] attendees
|
|
38
|
+
Status: [CONFIRMED/TENTATIVE/CANCELLED]
|
|
39
|
+
|
|
40
|
+
### ๐ This Week
|
|
41
|
+
- (same format)
|
|
42
|
+
|
|
43
|
+
### ๐ Next Week
|
|
44
|
+
- (same format)
|
|
45
|
+
|
|
46
|
+
### โ ๏ธ Conflicts
|
|
47
|
+
- [List any overlapping events]
|
|
48
|
+
|
|
49
|
+
### โ Cancelled
|
|
50
|
+
- [List any cancelled events]
|
|
51
|
+
|
|
52
|
+
If no calendar events are found, say "No meeting invitations found in the last ${daysNum} days."`,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=calendar.prompt.js.map
|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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/server';
|
|
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,8BAA8B,CAAC;AAG9D,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAiFrE"}
|
|
@@ -0,0 +1,82 @@
|
|
|
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.registerPrompt('cleanup_inbox', {
|
|
10
|
+
title: 'Cleanup inbox',
|
|
11
|
+
description: 'AI-guided inbox cleanup โ categorizes emails and suggests or executes organization actions.',
|
|
12
|
+
argsSchema: z.object({
|
|
13
|
+
account: z.string().describe('Account name to clean up'),
|
|
14
|
+
older_than_days: z
|
|
15
|
+
.string()
|
|
16
|
+
.default('30')
|
|
17
|
+
.describe('Only consider emails older than N days (default: 30)'),
|
|
18
|
+
dry_run: z
|
|
19
|
+
.string()
|
|
20
|
+
.default('true')
|
|
21
|
+
.describe("'true' = suggest only, 'false' = execute actions (default: true)"),
|
|
22
|
+
}),
|
|
23
|
+
}, async ({ account, older_than_days: olderThan, dry_run: dryRun }) => {
|
|
24
|
+
const days = Math.max(parseInt(olderThan, 10) || 30, 1);
|
|
25
|
+
const execute = dryRun === 'false';
|
|
26
|
+
const beforeDate = new Date(Date.now() - days * 86400000).toISOString().split('T')[0];
|
|
27
|
+
return {
|
|
28
|
+
messages: [
|
|
29
|
+
{
|
|
30
|
+
role: 'user',
|
|
31
|
+
content: {
|
|
32
|
+
type: 'text',
|
|
33
|
+
text: `Help me clean up the "${account}" inbox. Analyze emails older than ${days} days.
|
|
34
|
+
|
|
35
|
+
Follow these steps:
|
|
36
|
+
1. Call list_emails with account="${account}", mailbox="INBOX", pageSize=50, before="${beforeDate}" to scan old emails.
|
|
37
|
+
2. For emails needing more context, use get_email to read the body.
|
|
38
|
+
3. Categorize each email into one of these groups:
|
|
39
|
+
|
|
40
|
+
๐๏ธ **Delete candidates** โ Old read promotional emails, automated notifications, expired offers
|
|
41
|
+
๐ **Archive candidates** โ Old read conversational emails with no pending action
|
|
42
|
+
๐ฉ **Needs attention** โ Unread or flagged emails that may still need a response
|
|
43
|
+
โ
**Keep** โ Recent or important emails that belong in inbox
|
|
44
|
+
|
|
45
|
+
4. Look for newsletter patterns (List-Unsubscribe headers, recurring senders with promotional content).
|
|
46
|
+
|
|
47
|
+
Present your findings as:
|
|
48
|
+
|
|
49
|
+
## ๐งน Inbox Cleanup โ ${account}
|
|
50
|
+
**Scanned:** [count] emails older than ${days} days
|
|
51
|
+
|
|
52
|
+
### ๐๏ธ Delete ([count])
|
|
53
|
+
- [Subject] from [Sender] โ [Reason]
|
|
54
|
+
|
|
55
|
+
### ๐ Archive ([count])
|
|
56
|
+
- [Subject] from [Sender] โ [Reason]
|
|
57
|
+
|
|
58
|
+
### ๐ฉ Needs Attention ([count])
|
|
59
|
+
- [Subject] from [Sender] โ [Why this needs action]
|
|
60
|
+
|
|
61
|
+
### โ
Keep ([count])
|
|
62
|
+
- [Subject] from [Sender] โ [Why to keep]
|
|
63
|
+
|
|
64
|
+
### ๐ฐ Newsletter Sources
|
|
65
|
+
- [Sender] โ [Frequency estimate] โ Consider unsubscribing?
|
|
66
|
+
|
|
67
|
+
### Summary
|
|
68
|
+
- Total scanned: X
|
|
69
|
+
- Suggested deletions: X
|
|
70
|
+
- Suggested archives: X
|
|
71
|
+
- Estimated space savings: X
|
|
72
|
+
|
|
73
|
+
${execute
|
|
74
|
+
? `**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.`
|
|
75
|
+
: `**Mode: DRY RUN** โ Present the cleanup plan only. Ask if I want to proceed with any of the suggested actions.`}`,
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
};
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
//# 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,cAAc,CACnB,eAAe,EACf;QACE,KAAK,EAAE,eAAe;QACtB,WAAW,EACT,6FAA6F;QAC/F,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC;YACnB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;YACxD,eAAe,EAAE,CAAC;iBACf,MAAM,EAAE;iBACR,OAAO,CAAC,IAAI,CAAC;iBACb,QAAQ,CAAC,sDAAsD,CAAC;YACnE,OAAO,EAAE,CAAC;iBACP,MAAM,EAAE;iBACR,OAAO,CAAC,MAAM,CAAC;iBACf,QAAQ,CAAC,kEAAkE,CAAC;SAChF,CAAC;KACH,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/server';
|
|
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,8BAA8B,CAAC;AAG9D,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAmItE"}
|