apple-mail-mcp 2.8.2 → 2.8.4
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/README.md +24 -5
- package/build/cli.js +12083 -138
- package/build/index.js +82686 -1687
- package/package.json +3 -4
- package/build/cli.d.ts +0 -24
- package/build/cli.d.ts.map +0 -1
- package/build/index.d.ts +0 -23
- package/build/index.d.ts.map +0 -1
- package/build/services/appleMailManager.d.ts +0 -680
- package/build/services/appleMailManager.d.ts.map +0 -1
- package/build/services/appleMailManager.js +0 -3143
- package/build/services/fileConfig.d.ts +0 -7
- package/build/services/fileConfig.d.ts.map +0 -1
- package/build/services/fileConfig.js +0 -52
- package/build/services/imapClient.d.ts +0 -312
- package/build/services/imapClient.d.ts.map +0 -1
- package/build/services/imapClient.js +0 -1023
- package/build/services/imapIdle.d.ts +0 -58
- package/build/services/imapIdle.d.ts.map +0 -1
- package/build/services/imapIdle.js +0 -151
- package/build/services/imapMultiAccount.d.ts +0 -124
- package/build/services/imapMultiAccount.d.ts.map +0 -1
- package/build/services/imapMultiAccount.js +0 -253
- package/build/services/messageRouter.d.ts +0 -24
- package/build/services/messageRouter.d.ts.map +0 -1
- package/build/services/messageRouter.js +0 -31
- package/build/services/replyForward.d.ts +0 -87
- package/build/services/replyForward.d.ts.map +0 -1
- package/build/services/replyForward.js +0 -150
- package/build/services/smtpMailer.d.ts +0 -160
- package/build/services/smtpMailer.d.ts.map +0 -1
- package/build/services/smtpMailer.js +0 -268
- package/build/services/templateStore.d.ts +0 -18
- package/build/services/templateStore.d.ts.map +0 -1
- package/build/services/templateStore.js +0 -91
- package/build/tools/doctor.d.ts +0 -23
- package/build/tools/doctor.d.ts.map +0 -1
- package/build/tools/doctor.js +0 -74
- package/build/tools/resourcesAndPrompts.d.ts +0 -14
- package/build/tools/resourcesAndPrompts.d.ts.map +0 -1
- package/build/tools/resourcesAndPrompts.js +0 -109
- package/build/tools/respond.d.ts +0 -48
- package/build/tools/respond.d.ts.map +0 -1
- package/build/tools/respond.js +0 -95
- package/build/tools/thread.d.ts +0 -19
- package/build/tools/thread.d.ts.map +0 -1
- package/build/tools/thread.js +0 -32
- package/build/types.d.ts +0 -434
- package/build/types.d.ts.map +0 -1
- package/build/types.js +0 -13
- package/build/utils/applescript.d.ts +0 -45
- package/build/utils/applescript.d.ts.map +0 -1
- package/build/utils/applescript.js +0 -446
- package/build/utils/attachmentMaterialize.d.ts +0 -9
- package/build/utils/attachmentMaterialize.d.ts.map +0 -1
- package/build/utils/attachmentMaterialize.js +0 -38
- package/build/utils/mimeParse.d.ts +0 -62
- package/build/utils/mimeParse.d.ts.map +0 -1
- package/build/utils/mimeParse.js +0 -317
- package/build/utils/orphan.d.ts +0 -25
- package/build/utils/orphan.d.ts.map +0 -1
- package/build/utils/orphan.js +0 -26
- package/build/utils/serialize.d.ts +0 -30
- package/build/utils/serialize.d.ts.map +0 -1
- package/build/utils/serialize.js +0 -41
package/build/types.d.ts
DELETED
|
@@ -1,434 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type Definitions for Apple Mail MCP Server
|
|
3
|
-
*
|
|
4
|
-
* This module contains all TypeScript interfaces and types used throughout
|
|
5
|
-
* the Apple Mail MCP server. These types model:
|
|
6
|
-
*
|
|
7
|
-
* - Apple Mail data structures (messages, mailboxes, accounts)
|
|
8
|
-
* - AppleScript execution results
|
|
9
|
-
* - MCP tool parameters
|
|
10
|
-
*
|
|
11
|
-
* @module types
|
|
12
|
-
*/
|
|
13
|
-
/**
|
|
14
|
-
* Represents an email message in Apple Mail.
|
|
15
|
-
*/
|
|
16
|
-
export interface Message {
|
|
17
|
-
/** Unique identifier for the message */
|
|
18
|
-
id: string;
|
|
19
|
-
/** Subject line of the email */
|
|
20
|
-
subject: string;
|
|
21
|
-
/** Sender email address */
|
|
22
|
-
sender: string;
|
|
23
|
-
/** Sender display name (if available) */
|
|
24
|
-
senderName?: string;
|
|
25
|
-
/** Recipients (To field) */
|
|
26
|
-
recipients: string[];
|
|
27
|
-
/** CC recipients */
|
|
28
|
-
ccRecipients?: string[];
|
|
29
|
-
/** BCC recipients (only available for sent mail) */
|
|
30
|
-
bccRecipients?: string[];
|
|
31
|
-
/** Date the message was received */
|
|
32
|
-
dateReceived: Date;
|
|
33
|
-
/** Date the message was sent */
|
|
34
|
-
dateSent?: Date;
|
|
35
|
-
/** Whether the message has been read */
|
|
36
|
-
isRead: boolean;
|
|
37
|
-
/** Whether the message is flagged */
|
|
38
|
-
isFlagged: boolean;
|
|
39
|
-
/** Whether the message is marked as junk */
|
|
40
|
-
isJunk: boolean;
|
|
41
|
-
/** Whether the message has been deleted */
|
|
42
|
-
isDeleted: boolean;
|
|
43
|
-
/** Name of the mailbox containing the message */
|
|
44
|
-
mailbox: string;
|
|
45
|
-
/** Name of the account containing the message */
|
|
46
|
-
account: string;
|
|
47
|
-
/** Whether the message has attachments */
|
|
48
|
-
hasAttachments: boolean;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Per-account / per-mailbox diagnostics for a search, so callers can tell a
|
|
52
|
-
* genuine "no matches" apart from "we couldn't finish searching."
|
|
53
|
-
*
|
|
54
|
-
* Apple Mail's AppleScript bridge is pathologically slow on large IMAP/Gmail
|
|
55
|
-
* mailboxes (tens of thousands of messages): a single `whose` predicate — or
|
|
56
|
-
* even reading the newest 20 messages by index — can blow past the Apple Event
|
|
57
|
-
* timeout. Before this was tracked, those timeouts were swallowed and the
|
|
58
|
-
* search returned a clean (but wrong) empty result. See issue #24.
|
|
59
|
-
*/
|
|
60
|
-
export interface SearchDiagnostics {
|
|
61
|
-
/** True if any account/mailbox could not be fully searched (timeout or skip). */
|
|
62
|
-
partial: boolean;
|
|
63
|
-
/** Accounts that timed out entirely (whole-account AppleScript was killed). */
|
|
64
|
-
timedOutAccounts: string[];
|
|
65
|
-
/**
|
|
66
|
-
* Mailboxes skipped because their message count exceeded the scan threshold,
|
|
67
|
-
* formatted as "Account / Mailbox (count)".
|
|
68
|
-
*/
|
|
69
|
-
skippedLargeMailboxes: string[];
|
|
70
|
-
/**
|
|
71
|
-
* Mailboxes that were reached but timed out or errored mid-scan, formatted as
|
|
72
|
-
* "Account / Mailbox".
|
|
73
|
-
*/
|
|
74
|
-
notSearchedMailboxes: string[];
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* A search result paired with diagnostics about coverage.
|
|
78
|
-
*/
|
|
79
|
-
export interface SearchResult {
|
|
80
|
-
messages: Message[];
|
|
81
|
-
diagnostics: SearchDiagnostics;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Represents the content of an email message.
|
|
85
|
-
*/
|
|
86
|
-
export interface MessageContent {
|
|
87
|
-
/** Message identifier */
|
|
88
|
-
id: string;
|
|
89
|
-
/** Subject line */
|
|
90
|
-
subject: string;
|
|
91
|
-
/** Plain text content */
|
|
92
|
-
plainText: string;
|
|
93
|
-
/** HTML content (if available) */
|
|
94
|
-
htmlContent?: string;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Represents a mailbox (folder) in Apple Mail.
|
|
98
|
-
*/
|
|
99
|
-
export interface Mailbox {
|
|
100
|
-
/** Display name of the mailbox */
|
|
101
|
-
name: string;
|
|
102
|
-
/** Account containing the mailbox */
|
|
103
|
-
account: string;
|
|
104
|
-
/** Number of unread messages */
|
|
105
|
-
unreadCount: number;
|
|
106
|
-
/** Total number of messages */
|
|
107
|
-
messageCount: number;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Represents an email account in Apple Mail.
|
|
111
|
-
*/
|
|
112
|
-
export interface Account {
|
|
113
|
-
/** Display name of the account */
|
|
114
|
-
name: string;
|
|
115
|
-
/** Primary email address for the account */
|
|
116
|
-
email: string;
|
|
117
|
-
/** Account type (e.g., "iCloud", "Gmail", "Exchange") */
|
|
118
|
-
accountType?: string;
|
|
119
|
-
/** Whether the account is enabled */
|
|
120
|
-
enabled: boolean;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Represents an email attachment.
|
|
124
|
-
*/
|
|
125
|
-
export interface Attachment {
|
|
126
|
-
/** Attachment identifier */
|
|
127
|
-
id: string;
|
|
128
|
-
/** Filename of the attachment */
|
|
129
|
-
name: string;
|
|
130
|
-
/** MIME type of the attachment */
|
|
131
|
-
mimeType: string;
|
|
132
|
-
/** Size in bytes */
|
|
133
|
-
size: number;
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Options for AppleScript execution.
|
|
137
|
-
*/
|
|
138
|
-
export interface AppleScriptOptions {
|
|
139
|
-
/** Maximum execution time in milliseconds */
|
|
140
|
-
timeoutMs?: number;
|
|
141
|
-
/** Maximum number of retry attempts */
|
|
142
|
-
maxRetries?: number;
|
|
143
|
-
/** Initial delay between retries in milliseconds */
|
|
144
|
-
retryDelayMs?: number;
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Result from executing an AppleScript command.
|
|
148
|
-
*/
|
|
149
|
-
export interface AppleScriptResult {
|
|
150
|
-
/** Whether the script executed successfully */
|
|
151
|
-
success: boolean;
|
|
152
|
-
/** Output from the script (stdout) */
|
|
153
|
-
output: string;
|
|
154
|
-
/** Error message if execution failed */
|
|
155
|
-
error?: string;
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Parameters for searching messages.
|
|
159
|
-
*/
|
|
160
|
-
export interface SearchMessagesParams {
|
|
161
|
-
/** Text to search for (searches subject, sender, content) */
|
|
162
|
-
query?: string;
|
|
163
|
-
/** Filter by sender email address */
|
|
164
|
-
from?: string;
|
|
165
|
-
/** Filter by recipient email address */
|
|
166
|
-
to?: string;
|
|
167
|
-
/** Filter by subject line */
|
|
168
|
-
subject?: string;
|
|
169
|
-
/** Mailbox to search in */
|
|
170
|
-
mailbox?: string;
|
|
171
|
-
/** Account to search in */
|
|
172
|
-
account?: string;
|
|
173
|
-
/** Filter by read status */
|
|
174
|
-
isRead?: boolean;
|
|
175
|
-
/** Filter by flagged status */
|
|
176
|
-
isFlagged?: boolean;
|
|
177
|
-
/** Start date for search range */
|
|
178
|
-
dateFrom?: Date;
|
|
179
|
-
/** End date for search range */
|
|
180
|
-
dateTo?: Date;
|
|
181
|
-
/** Maximum number of results to return */
|
|
182
|
-
limit?: number;
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* Parameters for sending an email.
|
|
186
|
-
*/
|
|
187
|
-
export interface SendEmailParams {
|
|
188
|
-
/** Recipient email addresses (To field) */
|
|
189
|
-
to: string[];
|
|
190
|
-
/** CC recipients */
|
|
191
|
-
cc?: string[];
|
|
192
|
-
/** BCC recipients */
|
|
193
|
-
bcc?: string[];
|
|
194
|
-
/** Email subject line */
|
|
195
|
-
subject: string;
|
|
196
|
-
/** Email body content */
|
|
197
|
-
body: string;
|
|
198
|
-
/** Whether the body is HTML formatted */
|
|
199
|
-
isHtml?: boolean;
|
|
200
|
-
/** Account to send from */
|
|
201
|
-
account?: string;
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
* Parameters for getting a message by ID.
|
|
205
|
-
*/
|
|
206
|
-
export interface GetMessageParams {
|
|
207
|
-
/** Message identifier */
|
|
208
|
-
id: string;
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
* Parameters for listing messages.
|
|
212
|
-
*/
|
|
213
|
-
export interface ListMessagesParams {
|
|
214
|
-
/** Mailbox to list messages from */
|
|
215
|
-
mailbox?: string;
|
|
216
|
-
/** Account to list messages from */
|
|
217
|
-
account?: string;
|
|
218
|
-
/** Maximum number of messages to return */
|
|
219
|
-
limit?: number;
|
|
220
|
-
/** Filter to unread messages only */
|
|
221
|
-
unreadOnly?: boolean;
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* Parameters for mailbox operations.
|
|
225
|
-
*/
|
|
226
|
-
export interface MailboxParams {
|
|
227
|
-
/** Mailbox name */
|
|
228
|
-
name: string;
|
|
229
|
-
/** Account containing the mailbox */
|
|
230
|
-
account?: string;
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Parameters for moving a message.
|
|
234
|
-
*/
|
|
235
|
-
export interface MoveMessageParams {
|
|
236
|
-
/** Message identifier */
|
|
237
|
-
id: string;
|
|
238
|
-
/** Destination mailbox name */
|
|
239
|
-
mailbox: string;
|
|
240
|
-
/** Account containing the destination mailbox */
|
|
241
|
-
account?: string;
|
|
242
|
-
}
|
|
243
|
-
/**
|
|
244
|
-
* A single recipient in a serial email (mail merge) operation.
|
|
245
|
-
*/
|
|
246
|
-
export interface SerialEmailRecipient {
|
|
247
|
-
/** Recipient email address */
|
|
248
|
-
email: string;
|
|
249
|
-
/** Variable values for placeholder replacement (e.g., { Name: "Alice", Company: "Acme" }) */
|
|
250
|
-
variables: Record<string, string>;
|
|
251
|
-
}
|
|
252
|
-
/**
|
|
253
|
-
* Result of sending a serial email to a single recipient.
|
|
254
|
-
*/
|
|
255
|
-
export interface SerialEmailResult {
|
|
256
|
-
/** Recipient email address */
|
|
257
|
-
email: string;
|
|
258
|
-
/** Whether the email was sent successfully */
|
|
259
|
-
success: boolean;
|
|
260
|
-
/** Error message if sending failed */
|
|
261
|
-
error?: string;
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* Individual check result in a health check.
|
|
265
|
-
*/
|
|
266
|
-
export interface HealthCheckItem {
|
|
267
|
-
/** Name of the check */
|
|
268
|
-
name: string;
|
|
269
|
-
/** Whether the check passed */
|
|
270
|
-
passed: boolean;
|
|
271
|
-
/** Details about the check result */
|
|
272
|
-
message: string;
|
|
273
|
-
}
|
|
274
|
-
/**
|
|
275
|
-
* Result of a health check operation.
|
|
276
|
-
*/
|
|
277
|
-
export interface HealthCheckResult {
|
|
278
|
-
/** Whether all checks passed */
|
|
279
|
-
healthy: boolean;
|
|
280
|
-
/** Individual check results */
|
|
281
|
-
checks: HealthCheckItem[];
|
|
282
|
-
}
|
|
283
|
-
/**
|
|
284
|
-
* Statistics for a mailbox.
|
|
285
|
-
*/
|
|
286
|
-
export interface MailboxStats {
|
|
287
|
-
/** Mailbox name */
|
|
288
|
-
name: string;
|
|
289
|
-
/** Total message count */
|
|
290
|
-
messageCount: number;
|
|
291
|
-
/** Unread message count */
|
|
292
|
-
unreadCount: number;
|
|
293
|
-
}
|
|
294
|
-
/**
|
|
295
|
-
* Statistics for an account.
|
|
296
|
-
*/
|
|
297
|
-
export interface AccountStats {
|
|
298
|
-
/** Account name */
|
|
299
|
-
name: string;
|
|
300
|
-
/** Total messages in account */
|
|
301
|
-
totalMessages: number;
|
|
302
|
-
/** Total unread messages */
|
|
303
|
-
unreadMessages: number;
|
|
304
|
-
/** Number of mailboxes */
|
|
305
|
-
mailboxCount: number;
|
|
306
|
-
/** Per-mailbox statistics */
|
|
307
|
-
mailboxes: MailboxStats[];
|
|
308
|
-
}
|
|
309
|
-
/**
|
|
310
|
-
* Recently received message counts.
|
|
311
|
-
*/
|
|
312
|
-
export interface RecentlyReceivedStats {
|
|
313
|
-
/** Messages received in last 24 hours */
|
|
314
|
-
last24h: number;
|
|
315
|
-
/** Messages received in last 7 days */
|
|
316
|
-
last7d: number;
|
|
317
|
-
/** Messages received in last 30 days */
|
|
318
|
-
last30d: number;
|
|
319
|
-
}
|
|
320
|
-
/**
|
|
321
|
-
* Overall mail statistics.
|
|
322
|
-
*/
|
|
323
|
-
export interface MailStats {
|
|
324
|
-
/** Total messages across all accounts */
|
|
325
|
-
totalMessages: number;
|
|
326
|
-
/** Total unread messages */
|
|
327
|
-
totalUnread: number;
|
|
328
|
-
/** Per-account statistics */
|
|
329
|
-
accounts: AccountStats[];
|
|
330
|
-
/** Recently received message counts */
|
|
331
|
-
recentlyReceived?: RecentlyReceivedStats;
|
|
332
|
-
}
|
|
333
|
-
/**
|
|
334
|
-
* Result of a batch operation on a single item.
|
|
335
|
-
*/
|
|
336
|
-
export interface BatchOperationResult {
|
|
337
|
-
/** Item identifier */
|
|
338
|
-
id: string;
|
|
339
|
-
/** Whether the operation succeeded */
|
|
340
|
-
success: boolean;
|
|
341
|
-
/** Error message if operation failed */
|
|
342
|
-
error?: string;
|
|
343
|
-
}
|
|
344
|
-
/**
|
|
345
|
-
* Represents a mail rule in Apple Mail.
|
|
346
|
-
*/
|
|
347
|
-
export interface MailRule {
|
|
348
|
-
/** Rule name */
|
|
349
|
-
name: string;
|
|
350
|
-
/** Whether the rule is enabled */
|
|
351
|
-
enabled: boolean;
|
|
352
|
-
}
|
|
353
|
-
/**
|
|
354
|
-
* An attachment to send (B4): either an absolute path to an existing file, or
|
|
355
|
-
* raw bytes provided inline as base64 with a filename — so a client can attach
|
|
356
|
-
* content it generated without first writing it to disk.
|
|
357
|
-
*/
|
|
358
|
-
export type AttachmentInput = string | {
|
|
359
|
-
filename: string;
|
|
360
|
-
contentBase64: string;
|
|
361
|
-
};
|
|
362
|
-
/** Header/field a rule condition tests (B2). */
|
|
363
|
-
export type RuleConditionField = "from" | "to" | "cc" | "subject" | "content";
|
|
364
|
-
/** How a rule condition compares the field to its value (B2). */
|
|
365
|
-
export type RuleConditionOperator = "contains" | "notContains" | "equals" | "beginsWith" | "endsWith";
|
|
366
|
-
export interface RuleCondition {
|
|
367
|
-
field: RuleConditionField;
|
|
368
|
-
operator: RuleConditionOperator;
|
|
369
|
-
value: string;
|
|
370
|
-
}
|
|
371
|
-
export interface RuleActions {
|
|
372
|
-
markRead?: boolean;
|
|
373
|
-
markFlagged?: boolean;
|
|
374
|
-
/** Move matched messages to trash. */
|
|
375
|
-
delete?: boolean;
|
|
376
|
-
/** Move matched messages to this mailbox (by name). */
|
|
377
|
-
moveTo?: string;
|
|
378
|
-
/** Account that owns `moveTo` (disambiguates same-named mailboxes). */
|
|
379
|
-
moveToAccount?: string;
|
|
380
|
-
}
|
|
381
|
-
/** Specification for creating a mail rule (B2). */
|
|
382
|
-
export interface RuleSpec {
|
|
383
|
-
name: string;
|
|
384
|
-
conditions: RuleCondition[];
|
|
385
|
-
actions?: RuleActions;
|
|
386
|
-
/** true (default) = all conditions must match; false = any. */
|
|
387
|
-
matchAll?: boolean;
|
|
388
|
-
/** Whether the rule is enabled on creation (default true). */
|
|
389
|
-
enabled?: boolean;
|
|
390
|
-
}
|
|
391
|
-
/**
|
|
392
|
-
* Represents a contact from Contacts.app.
|
|
393
|
-
*/
|
|
394
|
-
export interface Contact {
|
|
395
|
-
/** Full name */
|
|
396
|
-
name: string;
|
|
397
|
-
/** Email addresses */
|
|
398
|
-
emails: string[];
|
|
399
|
-
/** Phone numbers */
|
|
400
|
-
phones: string[];
|
|
401
|
-
}
|
|
402
|
-
/**
|
|
403
|
-
* Represents a stored email template.
|
|
404
|
-
*/
|
|
405
|
-
export interface EmailTemplate {
|
|
406
|
-
/** Template identifier */
|
|
407
|
-
id: string;
|
|
408
|
-
/** Template name */
|
|
409
|
-
name: string;
|
|
410
|
-
/** Default subject line */
|
|
411
|
-
subject: string;
|
|
412
|
-
/** Template body */
|
|
413
|
-
body: string;
|
|
414
|
-
/** Default recipients */
|
|
415
|
-
to?: string[];
|
|
416
|
-
/** Default CC recipients */
|
|
417
|
-
cc?: string[];
|
|
418
|
-
}
|
|
419
|
-
/**
|
|
420
|
-
* Status of Mail.app sync activity.
|
|
421
|
-
*/
|
|
422
|
-
export interface SyncStatus {
|
|
423
|
-
/** Whether sync activity was detected */
|
|
424
|
-
syncDetected: boolean;
|
|
425
|
-
/** Number of items pending upload */
|
|
426
|
-
pendingUpload: number;
|
|
427
|
-
/** Whether there was recent database activity */
|
|
428
|
-
recentActivity: boolean;
|
|
429
|
-
/** Seconds since last database change */
|
|
430
|
-
secondsSinceLastChange: number;
|
|
431
|
-
/** Error message if status check failed */
|
|
432
|
-
error?: string;
|
|
433
|
-
}
|
|
434
|
-
//# sourceMappingURL=types.d.ts.map
|
package/build/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH;;GAEG;AACH,MAAM,WAAW,OAA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,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;IAEd,4BAA4B;IAC5B,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;CACf;AAMD;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,yCAAyC;IACzC,YAAY,EAAE,OAAO,CAAC;IAEtB,qCAAqC;IACrC,aAAa,EAAE,MAAM,CAAC;IAEtB,iDAAiD;IACjD,cAAc,EAAE,OAAO,CAAC;IAExB,yCAAyC;IACzC,sBAAsB,EAAE,MAAM,CAAC;IAE/B,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
package/build/types.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type Definitions for Apple Mail MCP Server
|
|
3
|
-
*
|
|
4
|
-
* This module contains all TypeScript interfaces and types used throughout
|
|
5
|
-
* the Apple Mail MCP server. These types model:
|
|
6
|
-
*
|
|
7
|
-
* - Apple Mail data structures (messages, mailboxes, accounts)
|
|
8
|
-
* - AppleScript execution results
|
|
9
|
-
* - MCP tool parameters
|
|
10
|
-
*
|
|
11
|
-
* @module types
|
|
12
|
-
*/
|
|
13
|
-
export {};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AppleScript Execution Utilities
|
|
3
|
-
*
|
|
4
|
-
* This module provides a safe interface for executing AppleScript commands
|
|
5
|
-
* on macOS. It handles script execution, error capture, and result parsing.
|
|
6
|
-
*
|
|
7
|
-
* @module utils/applescript
|
|
8
|
-
*/
|
|
9
|
-
import type { AppleScriptResult, AppleScriptOptions } from "../types.js";
|
|
10
|
-
/**
|
|
11
|
-
* Executes an AppleScript command and returns a structured result.
|
|
12
|
-
*
|
|
13
|
-
* This function serves as the bridge between TypeScript and macOS AppleScript.
|
|
14
|
-
* It handles the complexity of shell escaping, execution, and error handling
|
|
15
|
-
* so that calling code can work with clean TypeScript interfaces.
|
|
16
|
-
*
|
|
17
|
-
* The script is executed synchronously via the `osascript` command-line tool.
|
|
18
|
-
* Multi-line scripts are supported and preserved (important for AppleScript
|
|
19
|
-
* tell blocks and repeat loops).
|
|
20
|
-
*
|
|
21
|
-
* @param script - The AppleScript code to execute
|
|
22
|
-
* @param options - Optional execution settings (timeout, etc.)
|
|
23
|
-
* @returns A result object with success status and output or error message
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* ```typescript
|
|
27
|
-
* // Basic usage with default timeout (30 seconds)
|
|
28
|
-
* const result = executeAppleScript(`
|
|
29
|
-
* tell application "Notes"
|
|
30
|
-
* get name of every note
|
|
31
|
-
* end tell
|
|
32
|
-
* `);
|
|
33
|
-
*
|
|
34
|
-
* // With custom timeout for complex operations
|
|
35
|
-
* const result = executeAppleScript(complexScript, { timeoutMs: 60000 });
|
|
36
|
-
*
|
|
37
|
-
* if (result.success) {
|
|
38
|
-
* console.log("Notes:", result.output);
|
|
39
|
-
* } else {
|
|
40
|
-
* console.error("Failed:", result.error);
|
|
41
|
-
* }
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
44
|
-
export declare function executeAppleScript(script: string, options?: AppleScriptOptions): AppleScriptResult;
|
|
45
|
-
//# sourceMappingURL=applescript.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"applescript.d.ts","sourceRoot":"","sources":["../../src/utils/applescript.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AA8SxE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,kBAAuB,GAC/B,iBAAiB,CAwInB"}
|