@mgcrea/mcp-apple-mail 1.26.0 → 1.27.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-ShJwrSVi.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.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/ax.ts","../src/client/compose.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;;;;KC+B7D;EAAc;EAAa;;KAyDpB;EAAgB;EAAgB;EAAc;;;;;;;;;;;;;;;;;;;;;;;KAuB9C;;EAEV;;EAEA;;EAEA;;;;;;;;KASU;EACV;;E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qB;IAAqB;IAAc;IAAiB;;
|
|
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/ax.ts","../src/client/compose.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;;;;KC+B7D;EAAc;EAAa;;KAyDpB;EAAgB;EAAgB;EAAc;;;;;;;;;;;;;;;;;;;;;;;KAuB9C;;EAEV;;EAEA;;EAEA;;;;;;;;KASU;EACV;;EAEA;;EAEA;EACA;EACA;;EAEA;;;;;EAKA;;EAEA;;EAEA;EACA;;KAGU;EACV;;EAEA;EACA;;cAGW;;UAGJ;;SAKA,KAAK,MAAK,OAAO,aAA2B;EAKnD;;EAKA,SAAS;;;;;;;;;;;;;;;;;;EAyBH,SAAS,QAAQ;;;;;;;;;SAqBhB,aAAa;;;;;;;;;;;;;;;;;EA0Bd,aAAa,iBAAiB,oBAAoB,QAAQ;;;;;;;;;;;;;;EA8B1D,cAAc,kBAAkB,QAAQ;;EAyBxC,YAAY;;;;;;;;;;;;;EAgBZ,SAAS,eAAe;;;;;;;;;;;;;;;;;;;;;;;EAsCxB,SAAS,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwCxB,MAAM,KAA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ritesDisabledError, 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-ShJwrSVi.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 };
|
|
@@ -14,8 +14,8 @@ const pkg = readPackageIdentity(new URL("../package.json", import.meta.url), {
|
|
|
14
14
|
const BUILD_INFO = {
|
|
15
15
|
name: pkg.name,
|
|
16
16
|
version: pkg.version,
|
|
17
|
-
gitCommit: "
|
|
18
|
-
gitCommitDate: "2026-10-
|
|
17
|
+
gitCommit: "d63d759",
|
|
18
|
+
gitCommitDate: "2026-10-13T10:37:30+02:00"
|
|
19
19
|
};
|
|
20
20
|
//#endregion
|
|
21
21
|
//#region src/client/errors.ts
|
|
@@ -2961,6 +2961,19 @@ const UPDATE_DRAFT = script(`
|
|
|
2961
2961
|
});
|
|
2962
2962
|
}
|
|
2963
2963
|
|
|
2964
|
+
// Every row already carrying the subject, so none of them can be mistaken for
|
|
2965
|
+
// the replacement below: Mail keeps autosaved copies under one subject, and
|
|
2966
|
+
// taking one of those for confirmation deletes the original with nothing
|
|
2967
|
+
// saved in its place. Read before the composer exists, so an early autosave
|
|
2968
|
+
// of the replacement itself is not counted among them.
|
|
2969
|
+
var before = {};
|
|
2970
|
+
before[p.id] = true;
|
|
2971
|
+
var existing = prop(function () { return drafts.messages.whose({ subject: subject })(); }, []);
|
|
2972
|
+
for (var b = 0; b < existing.length; b++) {
|
|
2973
|
+
var bid = prop(function () { return existing[b].id(); }, null);
|
|
2974
|
+
if (bid !== null) before[bid] = true;
|
|
2975
|
+
}
|
|
2976
|
+
|
|
2964
2977
|
var replacement = M.OutgoingMessage({ subject: subject, content: p.body || "", visible: true });
|
|
2965
2978
|
M.outgoingMessages.push(replacement);
|
|
2966
2979
|
if (sender) { try { replacement.sender = sender; } catch (e) {} }
|
|
@@ -2992,7 +3005,7 @@ const UPDATE_DRAFT = script(`
|
|
|
2992
3005
|
var matches = prop(function () { return drafts.messages.whose({ subject: subject })(); }, []);
|
|
2993
3006
|
for (var k = 0; k < matches.length; k++) {
|
|
2994
3007
|
var mid = prop(function () { return matches[k].id(); }, null);
|
|
2995
|
-
if (mid === null || mid
|
|
3008
|
+
if (mid === null || before[mid]) continue;
|
|
2996
3009
|
if (newId === null || mid > newId) newId = mid;
|
|
2997
3010
|
}
|
|
2998
3011
|
}
|
|
@@ -3037,7 +3050,7 @@ const UPDATE_DRAFT = script(`
|
|
|
3037
3050
|
var finals = prop(function () { return drafts.messages.whose({ subject: subject })(); }, []);
|
|
3038
3051
|
for (var f = 0; f < finals.length; f++) {
|
|
3039
3052
|
var fid = prop(function () { return finals[f].id(); }, null);
|
|
3040
|
-
if (fid !== null && fid
|
|
3053
|
+
if (fid !== null && !before[fid] && (settledId === newId || fid > settledId)) settledId = fid;
|
|
3041
3054
|
}
|
|
3042
3055
|
|
|
3043
3056
|
return ok({
|
|
@@ -4593,6 +4606,7 @@ var AppleMailClient = class {
|
|
|
4593
4606
|
async listMailboxes(opts) {
|
|
4594
4607
|
const accounts = await this.accounts();
|
|
4595
4608
|
const allowed = opts.accountUuids?.length ? accounts.filter((a) => opts.accountUuids?.includes(a.id)).map((a) => a.id) : accounts.map((a) => a.id);
|
|
4609
|
+
if (!allowed.length) return [];
|
|
4596
4610
|
return withBusyRetry(() => this.runner.run(LIST_MAILBOXES, {
|
|
4597
4611
|
accountUuids: allowed,
|
|
4598
4612
|
withCounts: opts.withCounts
|
|
@@ -6431,4 +6445,4 @@ const createServer = (opts) => {
|
|
|
6431
6445
|
//#endregion
|
|
6432
6446
|
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 };
|
|
6433
6447
|
|
|
6434
|
-
//# sourceMappingURL=server-
|
|
6448
|
+
//# sourceMappingURL=server-ShJwrSVi.js.map
|