apple-mail-mcp 2.8.13 → 2.8.15
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/build/index.js +19 -35
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -3110,9 +3110,9 @@ var require_data = __commonJS({
|
|
|
3110
3110
|
}
|
|
3111
3111
|
});
|
|
3112
3112
|
|
|
3113
|
-
// node_modules/.pnpm/fast-uri@3.1.
|
|
3113
|
+
// node_modules/.pnpm/fast-uri@3.1.4/node_modules/fast-uri/lib/utils.js
|
|
3114
3114
|
var require_utils = __commonJS({
|
|
3115
|
-
"node_modules/.pnpm/fast-uri@3.1.
|
|
3115
|
+
"node_modules/.pnpm/fast-uri@3.1.4/node_modules/fast-uri/lib/utils.js"(exports, module) {
|
|
3116
3116
|
"use strict";
|
|
3117
3117
|
var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
|
|
3118
3118
|
var isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
|
|
@@ -3423,9 +3423,9 @@ var require_utils = __commonJS({
|
|
|
3423
3423
|
}
|
|
3424
3424
|
});
|
|
3425
3425
|
|
|
3426
|
-
// node_modules/.pnpm/fast-uri@3.1.
|
|
3426
|
+
// node_modules/.pnpm/fast-uri@3.1.4/node_modules/fast-uri/lib/schemes.js
|
|
3427
3427
|
var require_schemes = __commonJS({
|
|
3428
|
-
"node_modules/.pnpm/fast-uri@3.1.
|
|
3428
|
+
"node_modules/.pnpm/fast-uri@3.1.4/node_modules/fast-uri/lib/schemes.js"(exports, module) {
|
|
3429
3429
|
"use strict";
|
|
3430
3430
|
var { isUUID } = require_utils();
|
|
3431
3431
|
var URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;
|
|
@@ -3633,9 +3633,9 @@ var require_schemes = __commonJS({
|
|
|
3633
3633
|
}
|
|
3634
3634
|
});
|
|
3635
3635
|
|
|
3636
|
-
// node_modules/.pnpm/fast-uri@3.1.
|
|
3636
|
+
// node_modules/.pnpm/fast-uri@3.1.4/node_modules/fast-uri/index.js
|
|
3637
3637
|
var require_fast_uri = __commonJS({
|
|
3638
|
-
"node_modules/.pnpm/fast-uri@3.1.
|
|
3638
|
+
"node_modules/.pnpm/fast-uri@3.1.4/node_modules/fast-uri/index.js"(exports, module) {
|
|
3639
3639
|
"use strict";
|
|
3640
3640
|
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, escapePreservingEscapes, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
|
|
3641
3641
|
var { SCHEMES, getSchemeHandler } = require_schemes();
|
|
@@ -3776,6 +3776,7 @@ var require_fast_uri = __commonJS({
|
|
|
3776
3776
|
return uriTokens.join("");
|
|
3777
3777
|
}
|
|
3778
3778
|
var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
|
|
3779
|
+
var AUTHORITY_PREFIX = /^(?:[^#/:?]+:)?\/\/([^/?#]*)/;
|
|
3779
3780
|
function getParseError(parsed, matches) {
|
|
3780
3781
|
if (matches[2] !== void 0 && parsed.path && parsed.path[0] !== "/") {
|
|
3781
3782
|
return 'URI path must start with "/" when authority is present.';
|
|
@@ -3805,6 +3806,11 @@ var require_fast_uri = __commonJS({
|
|
|
3805
3806
|
uri = "//" + uri;
|
|
3806
3807
|
}
|
|
3807
3808
|
}
|
|
3809
|
+
const authorityMatch = uri.match(AUTHORITY_PREFIX);
|
|
3810
|
+
if (authorityMatch !== null && authorityMatch[1].indexOf("\\") !== -1) {
|
|
3811
|
+
parsed.error = "URI authority must not contain a literal backslash.";
|
|
3812
|
+
malformedAuthorityOrPort = true;
|
|
3813
|
+
}
|
|
3808
3814
|
const matches = uri.match(URI_PARSE);
|
|
3809
3815
|
if (matches) {
|
|
3810
3816
|
parsed.scheme = matches[1];
|
|
@@ -78528,20 +78534,9 @@ var AppleMailManager = class {
|
|
|
78528
78534
|
*/
|
|
78529
78535
|
getUnreadCount(mailbox, account) {
|
|
78530
78536
|
const targetAccount = this.resolveAccount(account);
|
|
78531
|
-
|
|
78532
|
-
|
|
78533
|
-
|
|
78534
|
-
const safeMailbox = escapeForAppleScript(targetMailbox);
|
|
78535
|
-
command = `return unread count of mailbox "${safeMailbox}"`;
|
|
78536
|
-
} else {
|
|
78537
|
-
command = `
|
|
78538
|
-
set total to 0
|
|
78539
|
-
repeat with mb in mailboxes
|
|
78540
|
-
set total to total + (unread count of mb)
|
|
78541
|
-
end repeat
|
|
78542
|
-
return total
|
|
78543
|
-
`;
|
|
78544
|
-
}
|
|
78537
|
+
const targetMailbox = this.resolveMailbox(mailbox || "INBOX", targetAccount);
|
|
78538
|
+
const safeMailbox = escapeForAppleScript(targetMailbox);
|
|
78539
|
+
const command = `return unread count of mailbox "${safeMailbox}"`;
|
|
78545
78540
|
const script = buildAccountScopedScript(targetAccount, command);
|
|
78546
78541
|
const result = executeAppleScript(script, { timeoutMs: 6e4 });
|
|
78547
78542
|
if (!result.success) {
|
|
@@ -79809,19 +79804,8 @@ function imapUnreadCount(mailbox, deps = {}) {
|
|
|
79809
79804
|
return useClient(
|
|
79810
79805
|
deps,
|
|
79811
79806
|
async (client) => {
|
|
79812
|
-
|
|
79813
|
-
|
|
79814
|
-
return s.unseen ?? 0;
|
|
79815
|
-
}
|
|
79816
|
-
let total = 0;
|
|
79817
|
-
for (const b of await client.list()) {
|
|
79818
|
-
try {
|
|
79819
|
-
const s = await client.status(b.path, { unseen: true });
|
|
79820
|
-
total += s.unseen ?? 0;
|
|
79821
|
-
} catch {
|
|
79822
|
-
}
|
|
79823
|
-
}
|
|
79824
|
-
return total;
|
|
79807
|
+
const s = await client.status(resolveMailboxPath(mailbox, "list"), { unseen: true });
|
|
79808
|
+
return s.unseen ?? 0;
|
|
79825
79809
|
},
|
|
79826
79810
|
true
|
|
79827
79811
|
);
|
|
@@ -82262,9 +82246,9 @@ ${mailboxList}`, structured);
|
|
|
82262
82246
|
server.registerTool(
|
|
82263
82247
|
"get-unread-count",
|
|
82264
82248
|
{
|
|
82265
|
-
description: "Use when: you only need the number of unread messages
|
|
82249
|
+
description: "Use when: you only need the number of unread messages \u2014 INBOX by default, or scoped to one mailbox and/or account \u2014 without listing the messages themselves.\nReturns: the unread count for the requested scope (INBOX when no mailbox is given).\nDo not use when: you need the actual unread messages and their ids (use list-messages with unreadOnly, or search-messages with isRead=false) or broader totals across every mailbox (use get-mail-stats).",
|
|
82266
82250
|
inputSchema: {
|
|
82267
|
-
mailbox: external_exports.string().optional().describe("Mailbox to check (default:
|
|
82251
|
+
mailbox: external_exports.string().optional().describe("Mailbox to check (default: INBOX)"),
|
|
82268
82252
|
account: external_exports.string().optional().describe("Account to check")
|
|
82269
82253
|
},
|
|
82270
82254
|
outputSchema: {
|
package/package.json
CHANGED