@mgcrea/mcp-apple-mail 0.0.0-bootstrap → 1.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/dist/cli.js +1 -1
- package/dist/index.d.ts +62 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/{server-OoiI7t3N.js → server-Cs0iy6g6.js} +957 -100
- package/dist/server-Cs0iy6g6.js.map +1 -0
- package/package.json +2 -2
- package/dist/server-OoiI7t3N.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as loadConfig, b as MAIL_SURFACE, j as BUILD_INFO, r as createServer } from "./server-
|
|
2
|
+
import { a as loadConfig, b as MAIL_SURFACE, j as BUILD_INFO, r as createServer } from "./server-Cs0iy6g6.js";
|
|
3
3
|
import { runStdioServer } from "@mgcrea/mcp-apple-core";
|
|
4
4
|
//#region src/cli.ts
|
|
5
5
|
const LOG_PREFIX = "apple-mail-mcp";
|
package/dist/index.d.ts
CHANGED
|
@@ -73,6 +73,7 @@ declare const locateEnvelopeIndex: (opts?: LocateOptions) => LocateResult;
|
|
|
73
73
|
*/
|
|
74
74
|
declare const ConfigSchema: z.ZodObject<{
|
|
75
75
|
allowWrites: z.ZodDefault<z.ZodBoolean>;
|
|
76
|
+
exposePrompts: z.ZodDefault<z.ZodBoolean>;
|
|
76
77
|
debug: z.ZodDefault<z.ZodBoolean>;
|
|
77
78
|
osascriptPath: z.ZodDefault<z.ZodString>;
|
|
78
79
|
osascriptTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
@@ -356,6 +357,31 @@ declare class AppleMailClient {
|
|
|
356
357
|
* answer does not change while the process lives.
|
|
357
358
|
*/
|
|
358
359
|
locate(force?: boolean): Promise<LocateResult>;
|
|
360
|
+
/**
|
|
361
|
+
* Whether the composer can be reached, and which grant is missing if not.
|
|
362
|
+
*
|
|
363
|
+
* Reported by diagnostics rather than only discovered on a failed reply.
|
|
364
|
+
* Automation-to-Mail and Full Disk Access being granted says nothing about
|
|
365
|
+
* either of these, and every read tool works without them — so the only
|
|
366
|
+
* signal used to be a `COMPOSER_NOT_FOUND` on a window that was
|
|
367
|
+
* demonstrably on screen, with no way to tell which permission was at fault.
|
|
368
|
+
*
|
|
369
|
+
* Never throws. A probe that cannot answer must not be the reason
|
|
370
|
+
* diagnostics fails, and "unknown" is an honest third state.
|
|
371
|
+
*/
|
|
372
|
+
composerAccess(): Promise<{
|
|
373
|
+
accessibility: "granted" | "denied" | "unknown";
|
|
374
|
+
systemEvents: "granted" | "denied" | "notDetermined" | "error" | "unknown";
|
|
375
|
+
/**
|
|
376
|
+
* Whether Mail's UI could actually be read, which is the only one of these
|
|
377
|
+
* three that is evidence rather than a claim. The flag above answers for an
|
|
378
|
+
* identity and has been caught disagreeing with what the same process can
|
|
379
|
+
* do; `inconclusive` is Mail with no windows open, where nothing can be
|
|
380
|
+
* concluded either way.
|
|
381
|
+
*/
|
|
382
|
+
uiRead: "granted" | "denied" | "inconclusive" | "unknown";
|
|
383
|
+
windows: (string | null)[] | null;
|
|
384
|
+
}>;
|
|
359
385
|
lanes(): Promise<LaneStatus>;
|
|
360
386
|
listMailboxes(opts: {
|
|
361
387
|
accountUuids?: string[];
|
|
@@ -512,6 +538,42 @@ declare class AppleMailClient {
|
|
|
512
538
|
movedToTrash: boolean | null;
|
|
513
539
|
results: unknown[];
|
|
514
540
|
}>;
|
|
541
|
+
/**
|
|
542
|
+
* Create a mailbox.
|
|
543
|
+
*
|
|
544
|
+
* ## Why the cache is dropped afterwards
|
|
545
|
+
*
|
|
546
|
+
* `MailboxMap` caches each account together with its mailbox NAMES, and
|
|
547
|
+
* `resolveMailboxName` answers out of that cache. A mailbox created here and
|
|
548
|
+
* used as a move destination in the next call would resolve against a list
|
|
549
|
+
* taken before it existed, so the move would fail with "no destination
|
|
550
|
+
* mailbox" naming a mailbox this server had just made. Invalidating is not an
|
|
551
|
+
* optimisation detail; it is what makes create-then-move work.
|
|
552
|
+
*/
|
|
553
|
+
createMailbox(name: string, account?: string): Promise<{
|
|
554
|
+
created: boolean;
|
|
555
|
+
name: string;
|
|
556
|
+
account: string | null;
|
|
557
|
+
accountUuid: string | null;
|
|
558
|
+
note?: string;
|
|
559
|
+
}>;
|
|
560
|
+
/**
|
|
561
|
+
* Replace a saved draft's body by recreating it.
|
|
562
|
+
*
|
|
563
|
+
* The refusals live in the script, next to the properties they are read from,
|
|
564
|
+
* and come back as ordinary results carrying `replaced: false` rather than as
|
|
565
|
+
* thrown errors — a caller that cannot rewrite this draft still wants to know
|
|
566
|
+
* WHY, and what to do instead, and both travel better as data than as a
|
|
567
|
+
* message string.
|
|
568
|
+
*
|
|
569
|
+
* What is enforced here instead is the shape of the request, before Mail is
|
|
570
|
+
* touched at all: an empty body would silently blank a draft the user wrote,
|
|
571
|
+
* which is the one outcome nothing downstream could distinguish from success.
|
|
572
|
+
*/
|
|
573
|
+
updateDraft(ref: string, opts: {
|
|
574
|
+
body: string;
|
|
575
|
+
subject?: string | undefined;
|
|
576
|
+
}): Promise<Record<string, unknown>>;
|
|
515
577
|
checkForNewMail(account?: string): Promise<unknown>;
|
|
516
578
|
sendMessage(opts: {
|
|
517
579
|
account?: string;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/build-info.ts","../src/client/errors.ts","../src/client/locate.ts","../src/config.ts","../src/client/mime.ts","../src/client/emlx.ts","../src/client/schema.ts","../src/client/envelope.ts","../src/client/mailbox-map.ts","../src/client/mail.ts","../src/client/ref.ts","../src/server.ts","../src/tools/index.ts"],"mappings":";;;;;cAkBa,YAAY;;;;cCWZ,6BAA6B;WACtB;EAElB,YAAY;;;;;;;;;;;;;;;;;;;;KCTF;;EAEV;;EAEA;EACA;;EAEA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;;KAKU;;EAEV;;EAEA;;EAEA;;EAEA;;cAiBW,sBAAmB,OAAU,kBAAqB;;;;;;;;;;;;;;;cC3CzD,cAAY,EAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/build-info.ts","../src/client/errors.ts","../src/client/locate.ts","../src/config.ts","../src/client/mime.ts","../src/client/emlx.ts","../src/client/schema.ts","../src/client/envelope.ts","../src/client/mailbox-map.ts","../src/client/mail.ts","../src/client/ref.ts","../src/server.ts","../src/tools/index.ts"],"mappings":";;;;;cAkBa,YAAY;;;;cCWZ,6BAA6B;WACtB;EAElB,YAAY;;;;;;;;;;;;;;;;;;;;KCTF;;EAEV;;EAEA;EACA;;EAEA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;;KAKU;;EAEV;;EAEA;;EAEA;;EAEA;;cAiBW,sBAAmB,OAAU,kBAAqB;;;;;;;;;;;;;;;cC3CzD,cAAY,EAAA;;;;;;;;;;;;;;;;;;;;;;GA8CP,EAAA,KAAA;KAEC,SAAS,EAAE,aAAa;;;;;cAMvB,aAAU,MAAS,OAAO,eAA2B;;;KCvDtD;EACV;EACA;EACA;;;;;;;;;EASA;;EAEA;;;;;;;;;;;;;;;;;;;;;KCEU;EACV,SAAS;EACT;EACA;;EAEA,cAAc;IAAe;;EAC7B;EACA;EACA;EACA;;;;KC1BU;EACV;EACA,QAAQ;EACR;IACE;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;;EAGF;EACA;EACA;;;;KChBU;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;KAGU;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;KAOU;EACV,IAAI;;EAEJ;EACA,MAAM;;cA+BK;;WAEF,MAAM;WACN;EAET,YAAY,QAAQ;EAMpB;;EASA;IAAe;IAAe;IAAa;IAAsB;;EA2CjE,OAAO,SAAS,gBAAgB;EAoFhC,MAAM,SAAS,KAAK;IAAuC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c;IAClB;IACA;MACE;IAAU;IAAe;;;;;;;;;;EAyCvB,eACJ,aACA;IAAQ;MACP;IACD,SAAS;IACT,QAAQ;IACR;;IAEA;;EA2BI,iBACJ,aACA;IAAQ;IAAgB;MACvB;IACD;IACA;IACA;IACA;IACA;;;;;;;;;;;;;;;EA2HI,oBAAoB;IAEtB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;;;;;;;;EA0HE,eACJ,aACA,kBACA;IAAQ;MACP;IAAU;IAAc;IAAe;;;EAmCpC,SACJ,gBACA;IAAS;IAAgB;IAAmB;IAAoB;MAC/D;IAAU;IAAiB;IAAgB;;EA6BxC,aACJ,gBACA;IAAQ;IAA4B;MACnC;IAAU;IAAe;IAAgB;IAAqB;;EAqD3D,eAAe,iBAAiB;IACpC;IACA;IACA;IACA;;;;;;;;;;;;;;EAuCI,cACJ,cACA,mBACC;IACD;IACA;IACA;IACA;IACA;;;;;;;;;;;;;;;EAkDI,YACJ,aACA;IAAQ;IAAc;MACrB,QAAQ;EAoBL,gBAAgB,mBAAmB;EAKnC,YAAY;IAChB;IACA;IACA;IACA;IACA;IACA;IACA;MACE;EAaE,eACJ,aACA;IACE;IACA;IACA;IACA;IACA;MAED;;;;;;;;;;;;;;;;;;;;;cC/mCQ;KAED;EACV;EACA;EACA;;cAKW,YAAS,KAAS;cAGlB,YAAS,gBAAkB;;cA2B3B,qBAAkB,MAAU,iBAAe,YAAY;;;cChDvD;cACA;KAED;EACV,QAAQ;EACR,SAAS;;EAET,YAAY;;KAGF;EACV,QAAQ;EACR,QAAQ;;;;;;;cAQG,eAAY,MAAU,wBAAsB;;;KCtB7C;;;;;EAKV;;;;;;;;;;;;cAaW,gBAAa,QAChB,WAAS,QACT,iBAAe,KAClB"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as WritesDisabledError, C as MessageNotFoundError, D as ProtocolError, E as PreconditionError, O as SchemaDriftError, S as MailNotRunningError, T as PlatformError, _ as locateEnvelopeIndex, a as loadConfig, c as decodeRef, d as assertStaticScript, f as createOsascriptRunner, g as inspectFile, h as MailboxMap, i as registerTools, j as BUILD_INFO, k as TccDeniedError, l as encodeRef, m as withBusyRetry, n as SERVER_VERSION, o as AppleMailClient, p as mapOsaError, r as createServer, s as REF_VERSION, t as SERVER_NAME, u as groupRefsByMailbox, v as AppleMailError, w as OsascriptTimeoutError, x as MailBusyError, y as IndexUnavailableError } from "./server-
|
|
1
|
+
import { A as WritesDisabledError, C as MessageNotFoundError, D as ProtocolError, E as PreconditionError, O as SchemaDriftError, S as MailNotRunningError, T as PlatformError, _ as locateEnvelopeIndex, a as loadConfig, c as decodeRef, d as assertStaticScript, f as createOsascriptRunner, g as inspectFile, h as MailboxMap, i as registerTools, j as BUILD_INFO, k as TccDeniedError, l as encodeRef, m as withBusyRetry, n as SERVER_VERSION, o as AppleMailClient, p as mapOsaError, r as createServer, s as REF_VERSION, t as SERVER_NAME, u as groupRefsByMailbox, v as AppleMailError, w as OsascriptTimeoutError, x as MailBusyError, y as IndexUnavailableError } from "./server-Cs0iy6g6.js";
|
|
2
2
|
export { AppleMailClient, AppleMailError, BUILD_INFO, IndexUnavailableError, MailBusyError, MailNotRunningError, MailboxMap, MessageNotFoundError, OsascriptTimeoutError, PlatformError, PreconditionError, ProtocolError, REF_VERSION, SERVER_NAME, SERVER_VERSION, SchemaDriftError, TccDeniedError, WritesDisabledError, assertStaticScript, createOsascriptRunner, createServer, decodeRef, encodeRef, groupRefsByMailbox, inspectFile, loadConfig, locateEnvelopeIndex, mapOsaError, registerTools, withBusyRetry };
|