@mgcrea/mcp-apple-mail 1.4.0 → 1.6.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-CGg9tIuQ.js";
2
+ import { a as loadConfig, b as MAIL_SURFACE, j as BUILD_INFO, r as createServer } from "./server-C1JZDY5c.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.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-CGg9tIuQ.js";
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-C1JZDY5c.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: "1779320",
16
- gitCommitDate: "2026-08-30T12:29:09+02:00"
15
+ gitCommit: "90f269d",
16
+ gitCommitDate: "2026-09-01T00:21:33+02:00"
17
17
  };
18
18
  //#endregion
19
19
  //#region src/client/errors.ts
@@ -1335,7 +1335,15 @@ function maxQuoteLevel(el, depth) {
1335
1335
  * composer to its minimum and push it off-screen first (macOS clamps it back to
1336
1336
  * leave a 40px sliver — that residue is not removable from outside Mail's
1337
1337
  * process, as the window server ignores alpha changes from a foreign
1338
- * connection), then hand the user's app back before sending.
1338
+ * connection), then put the window back exactly where it was found before the
1339
+ * user's app is handed back.
1340
+ *
1341
+ * Restoring is NOT cosmetic. Mail persists the compose window's frame, so a
1342
+ * composer left at [1, 1] off-screen is inherited by the next one the user
1343
+ * opens by hand -- and on a send that only saves a draft, the window this
1344
+ * shrank is the very window the caller is told is "open in Mail for review".
1345
+ * So a window whose geometry cannot be read back is not moved at all: the flash
1346
+ * of a composer coming forward is worth less than a window stuck at [1, 1].
1339
1347
  *
1340
1348
  * Failure is reported, never fatal: a quoted send still beats a lost one.
1341
1349
  */
@@ -1353,9 +1361,24 @@ function stripCitation(windowName) {
1353
1361
  // An empty subject names the window something else; the composer is frontmost regardless.
1354
1362
  if (!win) win = wins[0];
1355
1363
 
1356
- // Out of sight before Mail comes forward, so the user sees as little as possible.
1357
- try { win.size = [1, 1]; } catch (e) {}
1358
- try { win.position = [-100000, -100000]; } catch (e) {}
1364
+ // Read the real geometry BEFORE moving: once the window is off-screen the
1365
+ // window server answers with what it clamped to, not what the user chose.
1366
+ var was = null;
1367
+ try { was = { size: win.size(), position: win.position() }; } catch (e) { was = null; }
1368
+ var unhide = function () {
1369
+ if (!was) return;
1370
+ // Position first, so the window grows back from the right top-left corner.
1371
+ try { win.position = was.position; } catch (e) {}
1372
+ try { win.size = was.size; } catch (e) {}
1373
+ };
1374
+
1375
+ // Out of sight before Mail comes forward, so the user sees as little as
1376
+ // possible -- and only when the geometry came back, because hiding a window
1377
+ // we have no way to put back is how it stays hidden.
1378
+ if (was) {
1379
+ try { win.size = [1, 1]; } catch (e) {}
1380
+ try { win.position = [-100000, -100000]; } catch (e) {}
1381
+ }
1359
1382
 
1360
1383
  var previous = prop(function () {
1361
1384
  return SE.applicationProcesses.whose({ frontmost: true })[0].name();
@@ -1388,6 +1411,10 @@ function stripCitation(windowName) {
1388
1411
  stripped = false;
1389
1412
  }
1390
1413
 
1414
+ // Before the caller sends, saves, or leaves this window on screen, and on the
1415
+ // failure path too: a strip that threw must not cost the user their composer.
1416
+ unhide();
1417
+
1391
1418
  if (previous && previous !== "Mail") {
1392
1419
  try { SE.processes.byName(previous).frontmost = true; } catch (e) {}
1393
1420
  }
@@ -4218,4 +4245,4 @@ const createServer = (opts) => {
4218
4245
  //#endregion
4219
4246
  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 };
4220
4247
 
4221
- //# sourceMappingURL=server-CGg9tIuQ.js.map
4248
+ //# sourceMappingURL=server-C1JZDY5c.js.map