@mgcrea/mcp-apple-mail 1.3.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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-CGg9tIuQ.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
|
@@ -375,9 +375,10 @@ declare class AppleMailClient {
|
|
|
375
375
|
/**
|
|
376
376
|
* Whether Mail's UI could actually be read, which is the only one of these
|
|
377
377
|
* three that is evidence rather than a claim. The flag above answers for an
|
|
378
|
-
* identity and
|
|
379
|
-
*
|
|
380
|
-
*
|
|
378
|
+
* identity, and an identity can be ambiguous: one bundle id was measured
|
|
379
|
+
* holding four Accessibility entries at once, with the app's own check and
|
|
380
|
+
* its servers' checks matching different ones. `inconclusive` is Mail with
|
|
381
|
+
* no windows open, where nothing can be concluded either way.
|
|
381
382
|
*/
|
|
382
383
|
uiRead: "granted" | "denied" | "inconclusive" | "unknown";
|
|
383
384
|
windows: (string | null)[] | null;
|
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;;;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;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;KAGU;EACV;EACA;EACA;EACA;EACA;;;;;;;;;;;KAYU;EAEN;EACA;EACA;EACA;;EAEA;EACA;EACA;;EAEA;EAAsB;EAAoB;;KAYpC;EACV,QAAQ;EACR,SAAS;EACT,YAAY;;cAGD;;WACF,QAAQ;WACR,QAAQ;WACR,WAAW;EAQpB,YAAY,MAAM;EAkBlB,SAAS,kBAAgB,QAAQ;;;;;;EAS3B,OAAO,kBAAgB,QAAQ;;;;;;;;;;;;;EA+B/B,kBAAkB;IACtB;IACA
|
|
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;E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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-CGg9tIuQ.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 };
|
|
@@ -12,8 +12,8 @@ const pkg = readPackageIdentity(new URL("../package.json", import.meta.url), {
|
|
|
12
12
|
const BUILD_INFO = {
|
|
13
13
|
name: pkg.name,
|
|
14
14
|
version: pkg.version,
|
|
15
|
-
gitCommit: "
|
|
16
|
-
gitCommitDate: "2026-08-
|
|
15
|
+
gitCommit: "1779320",
|
|
16
|
+
gitCommitDate: "2026-08-30T12:29:09+02:00"
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region src/client/errors.ts
|
|
@@ -1113,12 +1113,23 @@ function composerBodySize(body) {
|
|
|
1113
1113
|
* hand. Every retry left another one. Nothing about that failure needed the
|
|
1114
1114
|
* window to exist first -- the grants it depends on can be read in one event.
|
|
1115
1115
|
*
|
|
1116
|
-
* Ground truth here is the functional read, not AXIsProcessTrusted. The two
|
|
1117
|
-
* disagree
|
|
1118
|
-
* while an osascript grandchild of it
|
|
1119
|
-
*
|
|
1120
|
-
*
|
|
1121
|
-
*
|
|
1116
|
+
* Ground truth here is the functional read, not AXIsProcessTrusted. The two do
|
|
1117
|
+
* disagree. MEASURED, macOS 26.6: Cupertino.app's own process reported trusted
|
|
1118
|
+
* while an osascript grandchild of it reported the opposite and could not name
|
|
1119
|
+
* a single Mail window -- a green Accessibility row in System Settings beside a
|
|
1120
|
+
* reply that failed every time.
|
|
1121
|
+
*
|
|
1122
|
+
* The cause was not attribution, which was correct throughout (launchctl put
|
|
1123
|
+
* the responsible pid of the node server at the app). It was that ONE BUNDLE
|
|
1124
|
+
* IDENTIFIER CAN HOLD SEVERAL ACCESSIBILITY ENTRIES AT ONCE, one per path and
|
|
1125
|
+
* signature it has been granted at -- an installed copy, a debug build, each
|
|
1126
|
+
* earlier reinstall. tccutil reported resetting four of them for
|
|
1127
|
+
* io.mgcrea.cupertino. The app's own check matched one and the requests made on
|
|
1128
|
+
* its behalf were resolved against another.
|
|
1129
|
+
*
|
|
1130
|
+
* So the flag is a claim about an identity that may be ambiguous, and this is
|
|
1131
|
+
* the thing itself. A window list that comes back named is proof regardless of
|
|
1132
|
+
* what the flag says; the flag only breaks the tie when Mail has no windows.
|
|
1122
1133
|
*
|
|
1123
1134
|
* Returns { ok, reason, windows }. The reason separates the two grants that fail
|
|
1124
1135
|
* identically once inside a composer: "systemEvents" when System Events cannot
|
|
@@ -1630,10 +1641,13 @@ function run() {
|
|
|
1630
1641
|
|
|
1631
1642
|
// The functional read, which outranks both flags above.
|
|
1632
1643
|
//
|
|
1633
|
-
// MEASURED, macOS 26.6: Cupertino.app's own process
|
|
1634
|
-
// true while an osascript grandchild of it
|
|
1635
|
-
//
|
|
1636
|
-
//
|
|
1644
|
+
// MEASURED, macOS 26.6: Cupertino.app's own process answered
|
|
1645
|
+
// AXIsProcessTrusted true while an osascript grandchild of it answered false,
|
|
1646
|
+
// because the same bundle identifier held four separate Accessibility entries
|
|
1647
|
+
// -- one per path and signature it had been granted at -- and the two checks
|
|
1648
|
+
// matched different ones. The flag alone therefore cannot say whether a
|
|
1649
|
+
// composer is reachable: it is a claim about an identity that may be
|
|
1650
|
+
// ambiguous, and this is the thing itself. Naming a window of Mail's needs
|
|
1637
1651
|
// exactly the grants a composer needs, and opens nothing.
|
|
1638
1652
|
var uiRead = "unknown";
|
|
1639
1653
|
var windows = null;
|
|
@@ -3614,7 +3628,7 @@ const buildDiagnostics = async (client, ctx) => {
|
|
|
3614
3628
|
automationSystemEvents: composer.systemEvents,
|
|
3615
3629
|
composerUiRead: composer.uiRead,
|
|
3616
3630
|
...composer.windows ? { composerWindowsSeen: composer.windows } : {},
|
|
3617
|
-
...composer.uiRead === "granted" && composer.systemEvents === "granted" ? {} : { composerNote: "Filling a Mail composer goes through System Events, which needs BOTH of the above: Automation to System Events (a different grant from Automation to Mail) and Accessibility. Until both are granted, apple_mail_reply_to_message and apple_mail_forward_message fail with COMPOSER_NOT_FOUND while every other tool works. Grant them to the Cupertino bundle that is RUNNING — not to your terminal and not to node
|
|
3631
|
+
...composer.uiRead === "granted" && composer.systemEvents === "granted" ? {} : { composerNote: "Filling a Mail composer goes through System Events, which needs BOTH of the above: Automation to System Events (a different grant from Automation to Mail) and Accessibility. Until both are granted, apple_mail_reply_to_message and apple_mail_forward_message fail with COMPOSER_NOT_FOUND while every other tool works. Grant them to the Cupertino bundle that is RUNNING — not to your terminal and not to node: the app is the process macOS holds responsible, and the servers do inherit its identity. If Cupertino's own Settings shows a GREEN Accessibility row while `composerUiRead` above says denied, believe this line and not the row: one bundle identifier can hold several Accessibility entries at once, one per path and signature it has been granted at (an installed copy, a development build, each earlier reinstall), and the two checks can match different ones. The cure is to clear them all and grant once, from the bundle that is running: `tccutil reset Accessibility io.mgcrea.cupertino`, then Ask… in Cupertino's Settings — it reported resetting FOUR entries the first time this was hit. Accessibility is in System Settings > Privacy & Security > Accessibility; Automation is under Automation. If the app is already listed, toggle it off and on — the grant goes stale when the bundle is reinstalled. Then quit Cupertino and open it again: the servers are children of the running app, and a child started before the grant does not see it — which is what `accessibility: denied` beside a green Accessibility row in Cupertino's own Settings means." },
|
|
3618
3632
|
fullDiskAccess: located.readable ? "granted" : located.exists ? "denied" : "unknown (no index file found)",
|
|
3619
3633
|
...located.readable ? {} : { howToGrant: [
|
|
3620
3634
|
"System Settings > Privacy & Security > Full Disk Access",
|
|
@@ -4204,4 +4218,4 @@ const createServer = (opts) => {
|
|
|
4204
4218
|
//#endregion
|
|
4205
4219
|
export { WritesDisabledError as A, MessageNotFoundError as C, ProtocolError as D, PreconditionError as E, SchemaDriftError as O, MailNotRunningError as S, PlatformError as T, locateEnvelopeIndex as _, loadConfig as a, MAIL_SURFACE as b, decodeRef as c, assertStaticScript as d, createOsascriptRunner as f, inspectFile as g, MailboxMap as h, registerTools as i, BUILD_INFO as j, TccDeniedError as k, encodeRef as l, withBusyRetry as m, SERVER_VERSION as n, AppleMailClient as o, mapOsaError as p, createServer as r, REF_VERSION as s, SERVER_NAME as t, groupRefsByMailbox as u, AppleMailError as v, OsascriptTimeoutError as w, MailBusyError as x, IndexUnavailableError as y };
|
|
4206
4220
|
|
|
4207
|
-
//# sourceMappingURL=server-
|
|
4221
|
+
//# sourceMappingURL=server-CGg9tIuQ.js.map
|