apple-mail-mcp 2.8.2 → 2.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/README.md +5 -5
  2. package/build/cli.js +12083 -138
  3. package/build/index.js +82684 -1687
  4. package/package.json +3 -4
  5. package/build/cli.d.ts +0 -24
  6. package/build/cli.d.ts.map +0 -1
  7. package/build/index.d.ts +0 -23
  8. package/build/index.d.ts.map +0 -1
  9. package/build/services/appleMailManager.d.ts +0 -680
  10. package/build/services/appleMailManager.d.ts.map +0 -1
  11. package/build/services/appleMailManager.js +0 -3143
  12. package/build/services/fileConfig.d.ts +0 -7
  13. package/build/services/fileConfig.d.ts.map +0 -1
  14. package/build/services/fileConfig.js +0 -52
  15. package/build/services/imapClient.d.ts +0 -312
  16. package/build/services/imapClient.d.ts.map +0 -1
  17. package/build/services/imapClient.js +0 -1023
  18. package/build/services/imapIdle.d.ts +0 -58
  19. package/build/services/imapIdle.d.ts.map +0 -1
  20. package/build/services/imapIdle.js +0 -151
  21. package/build/services/imapMultiAccount.d.ts +0 -124
  22. package/build/services/imapMultiAccount.d.ts.map +0 -1
  23. package/build/services/imapMultiAccount.js +0 -253
  24. package/build/services/messageRouter.d.ts +0 -24
  25. package/build/services/messageRouter.d.ts.map +0 -1
  26. package/build/services/messageRouter.js +0 -31
  27. package/build/services/replyForward.d.ts +0 -87
  28. package/build/services/replyForward.d.ts.map +0 -1
  29. package/build/services/replyForward.js +0 -150
  30. package/build/services/smtpMailer.d.ts +0 -160
  31. package/build/services/smtpMailer.d.ts.map +0 -1
  32. package/build/services/smtpMailer.js +0 -268
  33. package/build/services/templateStore.d.ts +0 -18
  34. package/build/services/templateStore.d.ts.map +0 -1
  35. package/build/services/templateStore.js +0 -91
  36. package/build/tools/doctor.d.ts +0 -23
  37. package/build/tools/doctor.d.ts.map +0 -1
  38. package/build/tools/doctor.js +0 -74
  39. package/build/tools/resourcesAndPrompts.d.ts +0 -14
  40. package/build/tools/resourcesAndPrompts.d.ts.map +0 -1
  41. package/build/tools/resourcesAndPrompts.js +0 -109
  42. package/build/tools/respond.d.ts +0 -48
  43. package/build/tools/respond.d.ts.map +0 -1
  44. package/build/tools/respond.js +0 -95
  45. package/build/tools/thread.d.ts +0 -19
  46. package/build/tools/thread.d.ts.map +0 -1
  47. package/build/tools/thread.js +0 -32
  48. package/build/types.d.ts +0 -434
  49. package/build/types.d.ts.map +0 -1
  50. package/build/types.js +0 -13
  51. package/build/utils/applescript.d.ts +0 -45
  52. package/build/utils/applescript.d.ts.map +0 -1
  53. package/build/utils/applescript.js +0 -446
  54. package/build/utils/attachmentMaterialize.d.ts +0 -9
  55. package/build/utils/attachmentMaterialize.d.ts.map +0 -1
  56. package/build/utils/attachmentMaterialize.js +0 -38
  57. package/build/utils/mimeParse.d.ts +0 -62
  58. package/build/utils/mimeParse.d.ts.map +0 -1
  59. package/build/utils/mimeParse.js +0 -317
  60. package/build/utils/orphan.d.ts +0 -25
  61. package/build/utils/orphan.d.ts.map +0 -1
  62. package/build/utils/orphan.js +0 -26
  63. package/build/utils/serialize.d.ts +0 -30
  64. package/build/utils/serialize.d.ts.map +0 -1
  65. package/build/utils/serialize.js +0 -41
@@ -1,7 +0,0 @@
1
- export declare function fileConfigPath(env?: NodeJS.ProcessEnv): string;
2
- /**
3
- * Merge a JSON config file's string values into `env` for keys not already set.
4
- * Returns the list of keys actually applied. Tolerates a missing/corrupt file.
5
- */
6
- export declare function loadFileConfig(env?: NodeJS.ProcessEnv, path?: string): string[];
7
- //# sourceMappingURL=fileConfig.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fileConfig.d.ts","sourceRoot":"","sources":["../../src/services/fileConfig.ts"],"names":[],"mappings":"AAqBA,wBAAgB,cAAc,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAI3E;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,GAAG,GAAE,MAAM,CAAC,UAAwB,EACpC,IAAI,GAAE,MAA4B,GACjC,MAAM,EAAE,CAiBV"}
@@ -1,52 +0,0 @@
1
- /**
2
- * File-based configuration loader (2.1.1).
3
- *
4
- * Some host apps (e.g. Claude Desktop) spawn the MCP server with a scrubbed
5
- * environment and ignore/strip the `env` block in their server config, so
6
- * there's no way to pass `APPLE_MAIL_MCP_*` settings in. This loads them from a
7
- * JSON file the host doesn't manage, merging into `process.env` WITHOUT
8
- * overriding anything already set (so an explicit env still wins).
9
- *
10
- * The file holds only non-secret config — account/host/Keychain-service names
11
- * and flags. Passwords are NEVER stored here; they stay in the macOS Keychain.
12
- *
13
- * Path: `APPLE_MAIL_MCP_CONFIG_FILE`, else
14
- * `~/Library/Application Support/apple-mail-mcp/config.json`.
15
- *
16
- * @module services/fileConfig
17
- */
18
- import { existsSync, readFileSync } from "fs";
19
- import { join } from "path";
20
- import { homedir } from "os";
21
- export function fileConfigPath(env = process.env) {
22
- const override = env.APPLE_MAIL_MCP_CONFIG_FILE;
23
- if (override && override.trim())
24
- return override.trim();
25
- return join(homedir(), "Library", "Application Support", "apple-mail-mcp", "config.json");
26
- }
27
- /**
28
- * Merge a JSON config file's string values into `env` for keys not already set.
29
- * Returns the list of keys actually applied. Tolerates a missing/corrupt file.
30
- */
31
- export function loadFileConfig(env = process.env, path = fileConfigPath(env)) {
32
- const applied = [];
33
- try {
34
- if (!existsSync(path))
35
- return applied;
36
- const parsed = JSON.parse(readFileSync(path, "utf8"));
37
- if (!parsed || typeof parsed !== "object")
38
- return applied;
39
- for (const [k, v] of Object.entries(parsed)) {
40
- if (typeof v !== "string")
41
- continue;
42
- if (env[k] === undefined || env[k] === "") {
43
- env[k] = v;
44
- applied.push(k);
45
- }
46
- }
47
- }
48
- catch (e) {
49
- console.error(`Failed to load apple-mail-mcp config file ${path}: ${String(e)}`);
50
- }
51
- return applied;
52
- }
@@ -1,312 +0,0 @@
1
- export declare const IMAP_ENV: {
2
- readonly user: "APPLE_MAIL_MCP_IMAP_USER";
3
- readonly account: "APPLE_MAIL_MCP_IMAP_ACCOUNT";
4
- readonly host: "APPLE_MAIL_MCP_IMAP_HOST";
5
- readonly port: "APPLE_MAIL_MCP_IMAP_PORT";
6
- readonly password: "APPLE_MAIL_MCP_IMAP_PASSWORD";
7
- readonly keychainService: "APPLE_MAIL_MCP_IMAP_KEYCHAIN_SERVICE";
8
- readonly keychainAccount: "APPLE_MAIL_MCP_IMAP_KEYCHAIN_ACCOUNT";
9
- readonly accounts: "APPLE_MAIL_MCP_IMAP_ACCOUNTS";
10
- };
11
- export interface ImapConfig {
12
- host: string;
13
- port: number;
14
- secure: boolean;
15
- user: string;
16
- pass: string;
17
- accountLabel: string;
18
- }
19
- export interface ImapSearchArgs {
20
- query?: string;
21
- account?: string;
22
- from?: string;
23
- subject?: string;
24
- mailbox?: string;
25
- limit?: number;
26
- dateFrom?: string;
27
- dateTo?: string;
28
- isRead?: boolean;
29
- isFlagged?: boolean;
30
- unreadOnly?: boolean;
31
- offset?: number;
32
- }
33
- interface ImapAddress {
34
- name?: string;
35
- address?: string;
36
- }
37
- interface ImapEnvelope {
38
- subject?: string;
39
- date?: Date | string;
40
- from?: ImapAddress[];
41
- messageId?: string;
42
- inReplyTo?: string;
43
- }
44
- export interface ImapBodyStructure {
45
- part?: string;
46
- type?: string;
47
- disposition?: string;
48
- dispositionParameters?: Record<string, string>;
49
- parameters?: Record<string, string>;
50
- size?: number;
51
- encoding?: string;
52
- childNodes?: ImapBodyStructure[];
53
- }
54
- interface ImapMessage {
55
- uid: number;
56
- envelope?: ImapEnvelope;
57
- flags?: Set<string>;
58
- source?: Buffer | string;
59
- bodyStructure?: ImapBodyStructure;
60
- headers?: Buffer | string;
61
- }
62
- interface ImapDownload {
63
- meta?: {
64
- filename?: string;
65
- contentType?: string;
66
- };
67
- content: AsyncIterable<Uint8Array>;
68
- }
69
- interface MailboxLock {
70
- release: () => void;
71
- }
72
- interface ImapMailboxListing {
73
- path: string;
74
- name: string;
75
- }
76
- type FlagOpts = {
77
- uid: boolean;
78
- };
79
- export interface ImapClientLike {
80
- connect(): Promise<void>;
81
- getMailboxLock(path: string): Promise<MailboxLock>;
82
- search(query: Record<string, unknown>, opts: {
83
- uid: true;
84
- }): Promise<number[] | false>;
85
- fetch(range: string, query: Record<string, unknown>, opts: {
86
- uid: true;
87
- }): AsyncIterable<ImapMessage>;
88
- fetchOne(range: string, query: Record<string, unknown>, opts: {
89
- uid: true;
90
- }): Promise<ImapMessage | false>;
91
- list(): Promise<ImapMailboxListing[]>;
92
- status(path: string, query: {
93
- messages?: boolean;
94
- unseen?: boolean;
95
- recent?: boolean;
96
- }): Promise<{
97
- path: string;
98
- messages?: number;
99
- unseen?: number;
100
- recent?: number;
101
- }>;
102
- download(range: string, part: string, opts: {
103
- uid: true;
104
- }): Promise<ImapDownload>;
105
- mailboxCreate(path: string): Promise<{
106
- path: string;
107
- created: boolean;
108
- }>;
109
- mailboxRename(path: string, newPath: string): Promise<{
110
- path: string;
111
- newPath: string;
112
- }>;
113
- mailboxDelete(path: string): Promise<{
114
- path: string;
115
- }>;
116
- messageFlagsAdd(range: number[], flags: string[], opts: FlagOpts): Promise<boolean>;
117
- messageFlagsRemove(range: number[], flags: string[], opts: FlagOpts): Promise<boolean>;
118
- messageMove(range: number[], destination: string, opts: FlagOpts): Promise<unknown>;
119
- messageDelete(range: number[], opts: FlagOpts): Promise<boolean>;
120
- noop(): Promise<void>;
121
- logout(): Promise<void>;
122
- }
123
- export declare function encodeImapId(account: string, path: string, uid: number): string;
124
- export declare function decodeImapId(id: string): {
125
- account: string;
126
- path: string;
127
- uid: number;
128
- } | null;
129
- export type ImapConnect = (cfg: ImapConfig) => Promise<ImapClientLike>;
130
- /**
131
- * Dependencies threaded through every IMAP op. `account` selects which
132
- * configured IMAP account to use (C2 multi-account); `config`/`connect` are
133
- * test seams. When `account` is omitted the default/first account is used.
134
- */
135
- export interface ImapDeps {
136
- connect?: ImapConnect;
137
- config?: ImapConfig;
138
- account?: string;
139
- }
140
- /** True when `account` matches any configured IMAP account (label or user). */
141
- export declare function isImapAccount(account: string | undefined, env?: NodeJS.ProcessEnv): boolean;
142
- /**
143
- * Read-side routing gate (v2.6.0 — prefer-IMAP reads). Returns true when a read
144
- * tool should go to IMAP rather than AppleScript:
145
- * - IMAP is configured at all, AND
146
- * - either the caller named no account (→ merge across all accounts), or the
147
- * named account is itself a configured IMAP account.
148
- * An explicitly-named NON-IMAP account returns false → AppleScript. When IMAP is
149
- * not configured at all this is always false, so behavior is unchanged.
150
- *
151
- * NOTE: the 3 mailbox-WRITE ops (create/delete/rename-mailbox) deliberately keep
152
- * using `isImapAccount` — they only route to IMAP for an explicitly-named IMAP
153
- * account, never on an omitted account.
154
- */
155
- export declare function shouldUseImap(account: string | undefined, env?: NodeJS.ProcessEnv): boolean;
156
- /** Account labels of every configured IMAP account (C2), for diagnostics. */
157
- export declare function listImapAccountLabels(env?: NodeJS.ProcessEnv): string[];
158
- /**
159
- * Resolve full configs (passwords included) for every configured IMAP account
160
- * (C2/B5). Accounts whose password can't be resolved are skipped (logged), so a
161
- * single misconfigured account doesn't take down the rest (e.g. IDLE watchers).
162
- */
163
- export declare function resolveImapConfigs(env?: NodeJS.ProcessEnv): ImapConfig[];
164
- /**
165
- * Resolve the full IMAP config (password included) for `account`. With no
166
- * `account`, returns the default/first configured account. Throws if IMAP is
167
- * unconfigured or no account matches.
168
- */
169
- export declare function resolveImapConfig(env?: NodeJS.ProcessEnv, account?: string): ImapConfig;
170
- /** Map common (Gmail) mailbox names to their IMAP paths. */
171
- export declare function resolveMailboxPath(mailbox: string | undefined, mode: "search" | "list"): string;
172
- /**
173
- * Result of an IMAP search/list: the human text identical to before, plus the
174
- * structured payload (messages + count) so callers can pass it straight to
175
- * `successResponse(text, structured)` and emit `structuredContent` on the IMAP
176
- * path the same way the AppleScript path does.
177
- */
178
- export interface ImapListResult {
179
- text: string;
180
- messages: Record<string, unknown>[];
181
- count: number;
182
- partial: boolean;
183
- }
184
- export declare function imapSearchMessages(args: ImapSearchArgs, deps?: ImapDeps): Promise<ImapListResult>;
185
- export declare function imapListMessages(args: ImapSearchArgs, deps?: ImapDeps): Promise<ImapListResult>;
186
- /** Unread count via IMAP STATUS (UNSEEN). No mailbox → sum across all mailboxes. */
187
- export declare function imapUnreadCount(mailbox: string | undefined, deps?: ImapDeps): Promise<number>;
188
- export interface ImapMailboxInfo {
189
- path: string;
190
- name: string;
191
- messages: number;
192
- unseen: number;
193
- }
194
- /** List mailboxes with per-mailbox message/unseen counts via LIST + STATUS (I6). */
195
- export declare function imapListMailboxes(deps?: ImapDeps): Promise<ImapMailboxInfo[]>;
196
- export interface ImapStats {
197
- totalMessages: number;
198
- totalUnread: number;
199
- perMailbox: {
200
- mailbox: string;
201
- messages: number;
202
- unseen: number;
203
- }[];
204
- recent: {
205
- last24h: number;
206
- last7d: number;
207
- last30d: number;
208
- };
209
- }
210
- /** Aggregate stats via STATUS (counts) + INBOX SEARCH SINCE (recent) (I3). */
211
- export declare function imapMailStats(deps?: ImapDeps): Promise<ImapStats>;
212
- export interface ImapOpResult {
213
- success: boolean;
214
- error?: string;
215
- info?: string;
216
- }
217
- /**
218
- * Close and log out every pooled IMAP connection. Exported so the server can
219
- * call it on shutdown (SIGINT/SIGTERM/stdin-EOF) — otherwise a killed or
220
- * orphaned instance leaves its pooled sockets occupying slots against the
221
- * server's per-account connection limit until they're reaped by a TCP timeout.
222
- */
223
- export declare function dropAllPools(): Promise<void>;
224
- /**
225
- * Health probe for the setup doctor (C3): reports whether IMAP is configured and,
226
- * if so, whether a connection + NOOP succeeds (auth/network/Keychain all good).
227
- */
228
- export declare function imapHealthCheck(deps?: ImapDeps): Promise<{
229
- configured: boolean;
230
- ok: boolean;
231
- account?: string;
232
- host?: string;
233
- error?: string;
234
- }>;
235
- /** Test seam: override the pool's connect factory; pass null to restore. */
236
- export declare function __setPoolConnect(fn: ImapConnect | null): void;
237
- /** Test seam: close and clear all pooled connections. */
238
- export declare function __resetPool(): Promise<void>;
239
- export declare function imapCreateMailbox(name: string, deps?: ImapDeps): Promise<ImapOpResult>;
240
- export declare function imapDeleteMailbox(name: string, deps?: ImapDeps): Promise<ImapOpResult>;
241
- export declare function imapRenameMailbox(oldName: string, newName: string, deps?: ImapDeps): Promise<ImapOpResult>;
242
- /** Read a message by composite IMAP id; returns "Subject: …\n\n<body>". */
243
- export declare function imapGetMessage(id: string, preferHtml: boolean, deps?: ImapDeps): Promise<ImapOpResult>;
244
- /** Normalize an RFC822 Message-ID for backend-independent matching: trim and
245
- * drop any surrounding angle brackets (IMAP envelopes carry `<id>`, Mail.app's
246
- * AppleScript `message id` property returns it bracketless). */
247
- export declare function normalizeMessageId(mid: string): string;
248
- /**
249
- * Fetch the RFC822 Message-ID for an `imap:` id. This is the join key that lets
250
- * the AppleScript backend locate the *same* message and return its numeric
251
- * Mail.app id — needed because flag **colors** only apply on the AppleScript
252
- * numeric-id path (IMAP `\Flagged` is colorless). Returns the normalized
253
- * Message-ID (no angle brackets), or null if `id` isn't an imap: token, the
254
- * message/envelope can't be fetched, or it carries no Message-ID.
255
- */
256
- export declare function imapFetchMessageId(id: string, deps?: ImapDeps): Promise<string | null>;
257
- export declare const imapMarkRead: (id: string, deps?: {}) => Promise<ImapOpResult>;
258
- export declare const imapMarkUnread: (id: string, deps?: {}) => Promise<ImapOpResult>;
259
- export declare const imapFlagMessage: (id: string, deps?: {}) => Promise<ImapOpResult>;
260
- export declare const imapUnflagMessage: (id: string, deps?: {}) => Promise<ImapOpResult>;
261
- export declare function imapMoveMessageById(id: string, destMailbox: string, deps?: ImapDeps): Promise<ImapOpResult>;
262
- export declare function imapDeleteMessageById(id: string, deps?: ImapDeps): Promise<ImapOpResult>;
263
- export interface ImapAttachmentInfo {
264
- id: string;
265
- name: string;
266
- mimeType: string;
267
- size: number;
268
- }
269
- /** List a message's attachments via IMAP BODYSTRUCTURE (no full download). */
270
- export declare function imapListAttachments(id: string, deps?: ImapDeps): Promise<{
271
- success: boolean;
272
- attachments?: ImapAttachmentInfo[];
273
- error?: string;
274
- }>;
275
- /** Fetch one attachment's bytes (base64) via IMAP, matched by filename. */
276
- export declare function imapFetchAttachment(id: string, attachmentName: string, deps?: ImapDeps): Promise<{
277
- success: boolean;
278
- base64?: string;
279
- bytes?: number;
280
- mimeType?: string;
281
- error?: string;
282
- }>;
283
- export interface ImapBatchResult {
284
- success: number;
285
- failed: number;
286
- errors: string[];
287
- }
288
- export declare const imapBatchMarkRead: (ids: string[], deps?: ImapDeps) => Promise<ImapBatchResult>;
289
- export declare const imapBatchMarkUnread: (ids: string[], deps?: ImapDeps) => Promise<ImapBatchResult>;
290
- export declare const imapBatchFlag: (ids: string[], deps?: ImapDeps) => Promise<ImapBatchResult>;
291
- export declare const imapBatchUnflag: (ids: string[], deps?: ImapDeps) => Promise<ImapBatchResult>;
292
- export declare const imapBatchDelete: (ids: string[], deps?: ImapDeps) => Promise<ImapBatchResult>;
293
- export declare function imapBatchMove(ids: string[], destMailbox: string, deps?: ImapDeps): Promise<ImapBatchResult>;
294
- export interface ImapThreadMessage {
295
- id: string;
296
- subject: string;
297
- sender: string;
298
- date: string;
299
- isRead: boolean;
300
- }
301
- export interface ImapThreadResult {
302
- count: number;
303
- text: string;
304
- structured: {
305
- subject: string;
306
- messages: ImapThreadMessage[];
307
- count: number;
308
- };
309
- }
310
- export declare function imapThread(id: string, deps?: ImapDeps, limit?: number): Promise<ImapThreadResult | null>;
311
- export {};
312
- //# sourceMappingURL=imapClient.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"imapClient.d.ts","sourceRoot":"","sources":["../../src/services/imapClient.ts"],"names":[],"mappings":"AA4BA,eAAO,MAAM,QAAQ;;;;;;;;;CAWX,CAAC;AAEX,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,YA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