apple-mail-mcp 2.17.4 → 2.17.5

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.
Files changed (2) hide show
  1. package/build/index.js +269 -176
  2. package/package.json +1 -1
package/build/index.js CHANGED
@@ -23342,9 +23342,9 @@ var require_pino = __commonJS({
23342
23342
  }
23343
23343
  });
23344
23344
 
23345
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/logger.js
23345
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/logger.js
23346
23346
  var require_logger = __commonJS({
23347
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/logger.js"(exports, module) {
23347
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/logger.js"(exports, module) {
23348
23348
  "use strict";
23349
23349
  var logger = require_pino()();
23350
23350
  logger.level = "trace";
@@ -48700,9 +48700,9 @@ var require_mailsplit = __commonJS({
48700
48700
  }
48701
48701
  });
48702
48702
 
48703
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/limited-passthrough.js
48703
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/limited-passthrough.js
48704
48704
  var require_limited_passthrough = __commonJS({
48705
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/limited-passthrough.js"(exports, module) {
48705
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/limited-passthrough.js"(exports, module) {
48706
48706
  "use strict";
48707
48707
  var { Transform } = __require("stream");
48708
48708
  var normalizeByteLimit = (value) => {
@@ -48741,9 +48741,9 @@ var require_limited_passthrough = __commonJS({
48741
48741
  }
48742
48742
  });
48743
48743
 
48744
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/handler/limits.js
48744
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/handler/limits.js
48745
48745
  var require_limits = __commonJS({
48746
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/handler/limits.js"(exports, module) {
48746
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/handler/limits.js"(exports, module) {
48747
48747
  "use strict";
48748
48748
  var MAX_LITERAL_SIZE = 1024 * 1024 * 1024;
48749
48749
  var MAX_LINE_SIZE = MAX_LITERAL_SIZE;
@@ -48760,9 +48760,9 @@ var require_limits = __commonJS({
48760
48760
  }
48761
48761
  });
48762
48762
 
48763
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/handler/imap-stream.js
48763
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/handler/imap-stream.js
48764
48764
  var require_imap_stream = __commonJS({
48765
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/handler/imap-stream.js"(exports, module) {
48765
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/handler/imap-stream.js"(exports, module) {
48766
48766
  "use strict";
48767
48767
  var Transform = __require("stream").Transform;
48768
48768
  var logger = require_logger();
@@ -49163,9 +49163,9 @@ var require_imap_stream = __commonJS({
49163
49163
  }
49164
49164
  });
49165
49165
 
49166
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/handler/imap-formal-syntax.js
49166
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/handler/imap-formal-syntax.js
49167
49167
  var require_imap_formal_syntax = __commonJS({
49168
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/handler/imap-formal-syntax.js"(exports, module) {
49168
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/handler/imap-formal-syntax.js"(exports, module) {
49169
49169
  "use strict";
49170
49170
  function expandRange(start, end) {
49171
49171
  let chars = [];
@@ -49309,9 +49309,9 @@ var require_imap_formal_syntax = __commonJS({
49309
49309
  }
49310
49310
  });
49311
49311
 
49312
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/handler/token-parser.js
49312
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/handler/token-parser.js
49313
49313
  var require_token_parser = __commonJS({
49314
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/handler/token-parser.js"(exports, module) {
49314
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/handler/token-parser.js"(exports, module) {
49315
49315
  "use strict";
49316
49316
  var imapFormalSyntax = require_imap_formal_syntax();
49317
49317
  var { MAX_LITERAL_SIZE, normalizeLimit, createLiteralTooLargeError } = require_limits();
@@ -49878,9 +49878,9 @@ var require_token_parser = __commonJS({
49878
49878
  }
49879
49879
  });
49880
49880
 
49881
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/handler/parser-instance.js
49881
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/handler/parser-instance.js
49882
49882
  var require_parser_instance = __commonJS({
49883
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/handler/parser-instance.js"(exports, module) {
49883
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/handler/parser-instance.js"(exports, module) {
49884
49884
  "use strict";
49885
49885
  var imapFormalSyntax = require_imap_formal_syntax();
49886
49886
  var { TokenParser } = require_token_parser();
@@ -50074,9 +50074,9 @@ var require_parser_instance = __commonJS({
50074
50074
  }
50075
50075
  });
50076
50076
 
50077
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/handler/imap-parser.js
50077
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/handler/imap-parser.js
50078
50078
  var require_imap_parser = __commonJS({
50079
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/handler/imap-parser.js"(exports, module) {
50079
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/handler/imap-parser.js"(exports, module) {
50080
50080
  "use strict";
50081
50081
  var imapFormalSyntax = require_imap_formal_syntax();
50082
50082
  var { ParserInstance } = require_parser_instance();
@@ -50134,9 +50134,9 @@ var require_imap_parser = __commonJS({
50134
50134
  }
50135
50135
  });
50136
50136
 
50137
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/handler/imap-compiler.js
50137
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/handler/imap-compiler.js
50138
50138
  var require_imap_compiler = __commonJS({
50139
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/handler/imap-compiler.js"(exports, module) {
50139
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/handler/imap-compiler.js"(exports, module) {
50140
50140
  "use strict";
50141
50141
  var imapFormalSyntax = require_imap_formal_syntax();
50142
50142
  var SEQ_RANGE = /^(\d+|\*)(:(\d+|\*))?$/;
@@ -50324,9 +50324,9 @@ var require_imap_compiler = __commonJS({
50324
50324
  }
50325
50325
  });
50326
50326
 
50327
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/handler/imap-handler.js
50327
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/handler/imap-handler.js
50328
50328
  var require_imap_handler = __commonJS({
50329
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/handler/imap-handler.js"(exports, module) {
50329
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/handler/imap-handler.js"(exports, module) {
50330
50330
  "use strict";
50331
50331
  var parser = require_imap_parser();
50332
50332
  var compiler = require_imap_compiler();
@@ -50337,12 +50337,12 @@ var require_imap_handler = __commonJS({
50337
50337
  }
50338
50338
  });
50339
50339
 
50340
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/package.json
50340
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/package.json
50341
50341
  var require_package4 = __commonJS({
50342
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/package.json"(exports, module) {
50342
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/package.json"(exports, module) {
50343
50343
  module.exports = {
50344
50344
  name: "imapflow",
50345
- version: "1.7.1",
50345
+ version: "1.7.6",
50346
50346
  description: "IMAP Client for Node",
50347
50347
  main: "lib/imap-flow.js",
50348
50348
  types: "lib/imap-flow.d.ts",
@@ -50374,7 +50374,7 @@ var require_package4 = __commonJS({
50374
50374
  "@eslint/js": "10.0.1",
50375
50375
  "@types/node": "26.2.0",
50376
50376
  c8: "12.0.0",
50377
- eslint: "10.8.1",
50377
+ eslint: "10.9.0",
50378
50378
  "eslint-config-nodemailer": "1.2.0",
50379
50379
  "eslint-config-prettier": "10.1.8",
50380
50380
  grunt: "1.6.3",
@@ -54688,9 +54688,9 @@ var require_build = __commonJS({
54688
54688
  }
54689
54689
  });
54690
54690
 
54691
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/connection-deadline.js
54691
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/connection-deadline.js
54692
54692
  var require_connection_deadline = __commonJS({
54693
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/connection-deadline.js"(exports, module) {
54693
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/connection-deadline.js"(exports, module) {
54694
54694
  "use strict";
54695
54695
  var CONNECT_TIMEOUT = 90 * 1e3;
54696
54696
  var ConnectionDeadline = class {
@@ -54771,9 +54771,9 @@ var require_connection_deadline = __commonJS({
54771
54771
  }
54772
54772
  });
54773
54773
 
54774
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/proxy-connection.js
54774
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/proxy-connection.js
54775
54775
  var require_proxy_connection = __commonJS({
54776
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/proxy-connection.js"(exports, module) {
54776
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/proxy-connection.js"(exports, module) {
54777
54777
  "use strict";
54778
54778
  var { SocksClient } = require_build();
54779
54779
  var dns = __require("dns").promises;
@@ -55056,9 +55056,9 @@ var require_proxy_connection = __commonJS({
55056
55056
  }
55057
55057
  });
55058
55058
 
55059
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/charsets.js
55059
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/charsets.js
55060
55060
  var require_charsets2 = __commonJS({
55061
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/charsets.js"(exports, module) {
55061
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/charsets.js"(exports, module) {
55062
55062
  "use strict";
55063
55063
  var CHARACTER_SETS = [
55064
55064
  "US-ASCII",
@@ -55335,9 +55335,9 @@ var require_charsets2 = __commonJS({
55335
55335
  }
55336
55336
  });
55337
55337
 
55338
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/jp-decoder.js
55338
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/jp-decoder.js
55339
55339
  var require_jp_decoder = __commonJS({
55340
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/jp-decoder.js"(exports, module) {
55340
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/jp-decoder.js"(exports, module) {
55341
55341
  "use strict";
55342
55342
  var { Transform } = __require("stream");
55343
55343
  var encodingJapanese = require_src();
@@ -55401,9 +55401,9 @@ var require_jp_decoder = __commonJS({
55401
55401
  }
55402
55402
  });
55403
55403
 
55404
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/tools.js
55404
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/tools.js
55405
55405
  var require_tools2 = __commonJS({
55406
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/tools.js"(exports, module) {
55406
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/tools.js"(exports, module) {
55407
55407
  "use strict";
55408
55408
  var libmime = require_libmime();
55409
55409
  var { resolveCharset } = require_charsets2();
@@ -55436,7 +55436,103 @@ var require_tools2 = __commonJS({
55436
55436
  var AuthenticationFailure = class extends Error {
55437
55437
  authenticationFailed = true;
55438
55438
  };
55439
+ var noop = () => {
55440
+ };
55441
+ var CONNECTION_ERROR_SITE_KEYS = ["rejectedFrom", "command", "path"];
55439
55442
  var tools = {
55443
+ noop,
55444
+ /**
55445
+ * Builds an error describing a connection that is gone, stamped so it can be traced back to
55446
+ * where it came from: the connection id always travels on it, and each site names itself
55447
+ * through `meta` (`rejectedFrom`, plus the command or mailbox path it belongs to).
55448
+ *
55449
+ * A stack trace only records where an error was built, and close() hands a rejection to every
55450
+ * pending request and every queued lock in the same tick, so without these an error that
55451
+ * reaches a global unhandledRejection handler arrives with nothing that identifies the
55452
+ * connection it came from, let alone which of the rejected promises carried it.
55453
+ *
55454
+ * Takes the connection id rather than the connection, so the stamping stays in one place
55455
+ * without every caller having to be a full ImapFlow instance.
55456
+ *
55457
+ * @param {String} cid - Connection id
55458
+ * @param {String} code - Error code, e.g. 'NoConnection'
55459
+ * @param {String} message - Error message
55460
+ * @param {Object} [meta] - Fields to stamp on the error
55461
+ * @returns {Error} The stamped error
55462
+ */
55463
+ buildConnectionError(cid, code, message, meta) {
55464
+ const error2 = new Error(message);
55465
+ error2.code = code;
55466
+ error2.cid = cid;
55467
+ if (meta) {
55468
+ Object.assign(error2, meta);
55469
+ }
55470
+ return error2;
55471
+ },
55472
+ /**
55473
+ * Re-stamps an existing connection error for a different rejection site.
55474
+ *
55475
+ * The same failure can be handed to more than one promise - close() rejects the in-flight
55476
+ * command, and runIdle() then rejects everything queued behind it - and each of those is a
55477
+ * separate promise with a separate consumer. Sharing one error object reports whichever of
55478
+ * them escapes under the first site's marker, which is the attribution these markers exist to
55479
+ * give.
55480
+ *
55481
+ * Everything describing *what went wrong* is carried over, because a re-stamped error reaches
55482
+ * user code through run() and callers branch on `responseStatus`, `serverResponseCode` and
55483
+ * friends. Everything describing *where it was rejected* is dropped, because the new site owns
55484
+ * those and a leftover `command` from the previous site is exactly as misleading as a leftover
55485
+ * `rejectedFrom`. The original travels on as `cause`.
55486
+ *
55487
+ * @param {Error} err - The error being re-stamped
55488
+ * @param {Object} meta - Fields for the new site, e.g. { rejectedFrom: 'preCheckWaiter' }
55489
+ * @returns {Error} A separate error describing the same failure at the new site
55490
+ */
55491
+ restampConnectionError(err, meta) {
55492
+ let error2 = tools.buildConnectionError(err.cid, err.code, err.message, err);
55493
+ for (let key of CONNECTION_ERROR_SITE_KEYS) {
55494
+ delete error2[key];
55495
+ }
55496
+ if (meta) {
55497
+ Object.assign(error2, meta);
55498
+ }
55499
+ error2.cause = err;
55500
+ return error2;
55501
+ },
55502
+ /**
55503
+ * Creates a promise whose rejection is observed as soon as it exists.
55504
+ *
55505
+ * close() rejects every promise it owns - the in-flight and queued commands, the pending
55506
+ * connect(), the queued mailbox locks, the waiters for an IDLE break - synchronously, from a
55507
+ * socket event. A consumer that only reaches its `await` a microtask later has not attached a
55508
+ * handler yet at the moment Node decides whether the rejection was observed, and the whole
55509
+ * worker dies on the resulting unhandledRejection. The pre-attached observer settles that
55510
+ * question; the rejection still propagates normally to whoever awaits the returned promise.
55511
+ *
55512
+ * Creation and guarding are one call because splitting them is what actually goes wrong: the
55513
+ * guard was hand-attached at three of the four sites and the fourth (the IDLE-break waiter)
55514
+ * went unguarded, on exactly the path a server BYE takes.
55515
+ *
55516
+ * @param {Function} executor - Promise executor, (resolve, reject) => {}
55517
+ * @returns {Promise} The promise, with its rejection already observed
55518
+ */
55519
+ guardedPromise(executor) {
55520
+ let promise = new Promise(executor);
55521
+ promise.catch(noop);
55522
+ return promise;
55523
+ },
55524
+ /**
55525
+ * The already-rejected form of guardedPromise(), for a call that has to hand back a rejected
55526
+ * promise rather than throw.
55527
+ *
55528
+ * @param {Error} error - Rejection reason
55529
+ * @returns {Promise} Rejected promise, with its rejection already observed
55530
+ */
55531
+ guardedReject(error2) {
55532
+ let promise = Promise.reject(error2);
55533
+ promise.catch(noop);
55534
+ return promise;
55535
+ },
55440
55536
  /**
55441
55537
  * Detaches a background timer from the event loop, so it cannot keep the process alive on its
55442
55538
  * own. Applied to every background timer (auto-IDLE, IDLE restart, fallback polling, throttle
@@ -55965,6 +56061,16 @@ var require_tools2 = __commonJS({
55965
56061
  }
55966
56062
  return name;
55967
56063
  },
56064
+ /**
56065
+ * Decodes an ENVELOPE text field for display: encoded words first, then the
56066
+ * surrounding quotes some servers leave in place.
56067
+ *
56068
+ * @param {String} value - Raw field value from an ENVELOPE response
56069
+ * @returns {String} Decoded, unquoted text
56070
+ */
56071
+ decodeText(value) {
56072
+ return tools.processName(libmime.decodeWords(value));
56073
+ },
55968
56074
  /**
55969
56075
  * Parses a raw IMAP ENVELOPE response into a structured envelope object.
55970
56076
  *
@@ -55989,14 +56095,13 @@ var require_tools2 = __commonJS({
55989
56095
  if (!addr) {
55990
56096
  return false;
55991
56097
  }
55992
- let address = (getStrValue(addr[2]) || "") + "@" + (getStrValue(addr[3]) || "");
55993
- if (address === "@") {
55994
- address = "";
56098
+ let name = tools.decodeText(getStrValue(addr[0]));
56099
+ let mailbox = getStrValue(addr[2]) || "";
56100
+ let host = getStrValue(addr[3]) || "";
56101
+ if (!host) {
56102
+ return { name: name || mailbox && tools.decodeText(mailbox), address: "" };
55995
56103
  }
55996
- return {
55997
- name: tools.processName(libmime.decodeWords(getStrValue(addr[0]))),
55998
- address
55999
- };
56104
+ return { name, address: `${mailbox}@${host}` };
56000
56105
  }).filter((addr) => addr && (addr.name || addr.address));
56001
56106
  }, envelope = {};
56002
56107
  if (entry[0] && entry[0].value) {
@@ -56503,9 +56608,9 @@ var require_tools2 = __commonJS({
56503
56608
  }
56504
56609
  });
56505
56610
 
56506
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/id.js
56611
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/id.js
56507
56612
  var require_id2 = __commonJS({
56508
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/id.js"(exports, module) {
56613
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/id.js"(exports, module) {
56509
56614
  "use strict";
56510
56615
  var { formatDateTime } = require_tools2();
56511
56616
  module.exports = async (connection, clientInfo) => {
@@ -56555,9 +56660,9 @@ var require_id2 = __commonJS({
56555
56660
  }
56556
56661
  });
56557
56662
 
56558
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/capability.js
56663
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/capability.js
56559
56664
  var require_capability = __commonJS({
56560
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/capability.js"(exports, module) {
56665
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/capability.js"(exports, module) {
56561
56666
  "use strict";
56562
56667
  module.exports = async (connection) => {
56563
56668
  if (connection.capabilities.size && !connection.expectCapabilityUpdate) {
@@ -56576,9 +56681,9 @@ var require_capability = __commonJS({
56576
56681
  }
56577
56682
  });
56578
56683
 
56579
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/namespace.js
56684
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/namespace.js
56580
56685
  var require_namespace = __commonJS({
56581
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/namespace.js"(exports, module) {
56686
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/namespace.js"(exports, module) {
56582
56687
  "use strict";
56583
56688
  var { hasCapability, getStringList } = require_tools2();
56584
56689
  module.exports = async (connection) => {
@@ -56684,9 +56789,9 @@ var require_namespace = __commonJS({
56684
56789
  }
56685
56790
  });
56686
56791
 
56687
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/login.js
56792
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/login.js
56688
56793
  var require_login = __commonJS({
56689
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/login.js"(exports, module) {
56794
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/login.js"(exports, module) {
56690
56795
  "use strict";
56691
56796
  var { getStatusCode, getErrorText } = require_tools2();
56692
56797
  module.exports = async (connection, username, password) => {
@@ -56715,9 +56820,9 @@ var require_login = __commonJS({
56715
56820
  }
56716
56821
  });
56717
56822
 
56718
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/logout.js
56823
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/logout.js
56719
56824
  var require_logout = __commonJS({
56720
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/logout.js"(exports, module) {
56825
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/logout.js"(exports, module) {
56721
56826
  "use strict";
56722
56827
  module.exports = async (connection) => {
56723
56828
  if (connection.state === connection.states.LOGOUT) {
@@ -56749,9 +56854,9 @@ var require_logout = __commonJS({
56749
56854
  }
56750
56855
  });
56751
56856
 
56752
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/starttls.js
56857
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/starttls.js
56753
56858
  var require_starttls = __commonJS({
56754
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/starttls.js"(exports, module) {
56859
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/starttls.js"(exports, module) {
56755
56860
  "use strict";
56756
56861
  module.exports = async (connection) => {
56757
56862
  if (!connection.capabilities.has("STARTTLS") || connection.secureConnection) {
@@ -56771,9 +56876,9 @@ var require_starttls = __commonJS({
56771
56876
  }
56772
56877
  });
56773
56878
 
56774
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/status-fields.js
56879
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/status-fields.js
56775
56880
  var require_status_fields = __commonJS({
56776
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/status-fields.js"(exports, module) {
56881
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/status-fields.js"(exports, module) {
56777
56882
  "use strict";
56778
56883
  var { parseBigIntValue, parseUintValue, MAX_UINT32_DIGITS } = require_tools2();
56779
56884
  var uint32 = (value) => parseUintValue(value, MAX_UINT32_DIGITS);
@@ -56816,9 +56921,9 @@ var require_status_fields = __commonJS({
56816
56921
  }
56817
56922
  });
56818
56923
 
56819
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/special-use.js
56924
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/special-use.js
56820
56925
  var require_special_use = __commonJS({
56821
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/special-use.js"(exports, module) {
56926
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/special-use.js"(exports, module) {
56822
56927
  "use strict";
56823
56928
  var GENERIC_TOKENS = new Set(
56824
56929
  [
@@ -57695,9 +57800,9 @@ var require_special_use = __commonJS({
57695
57800
  }
57696
57801
  });
57697
57802
 
57698
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/list.js
57803
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/list.js
57699
57804
  var require_list = __commonJS({
57700
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/list.js"(exports, module) {
57805
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/list.js"(exports, module) {
57701
57806
  "use strict";
57702
57807
  var {
57703
57808
  decodePath,
@@ -58042,9 +58147,9 @@ var require_list = __commonJS({
58042
58147
  }
58043
58148
  });
58044
58149
 
58045
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/enable.js
58150
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/enable.js
58046
58151
  var require_enable = __commonJS({
58047
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/enable.js"(exports, module) {
58152
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/enable.js"(exports, module) {
58048
58153
  "use strict";
58049
58154
  var { hasCapability } = require_tools2();
58050
58155
  module.exports = async (connection, extensionList) => {
@@ -58091,9 +58196,9 @@ var require_enable = __commonJS({
58091
58196
  }
58092
58197
  });
58093
58198
 
58094
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/select.js
58199
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/select.js
58095
58200
  var require_select = __commonJS({
58096
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/select.js"(exports, module) {
58201
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/select.js"(exports, module) {
58097
58202
  "use strict";
58098
58203
  var { encodePath, normalizePath, enhanceCommandError, parseBigIntValue, parseUintValue, getStringList, MAX_UINT32_DIGITS } = require_tools2();
58099
58204
  var VALUED_RESPONSE_CODES = Object.assign(/* @__PURE__ */ Object.create(null), {
@@ -58276,9 +58381,9 @@ var require_select = __commonJS({
58276
58381
  }
58277
58382
  });
58278
58383
 
58279
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/fetch.js
58384
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/fetch.js
58280
58385
  var require_fetch2 = __commonJS({
58281
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/fetch.js"(exports, module) {
58386
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/fetch.js"(exports, module) {
58282
58387
  "use strict";
58283
58388
  var { formatMessageResponse, isRev2Active } = require_tools2();
58284
58389
  module.exports = async (connection, range, query, options) => {
@@ -58450,7 +58555,7 @@ var require_fetch2 = __commonJS({
58450
58555
  });
58451
58556
  let aborted2 = await connection.throttleWait(delay);
58452
58557
  if (aborted2) {
58453
- throw connection.createNoConnectionError(connection.byeReason);
58558
+ throw connection.createNoConnectionError(connection.byeReason, { rejectedFrom: "throttleAbort", command: "FETCH" });
58454
58559
  }
58455
58560
  retryCount++;
58456
58561
  continue;
@@ -58463,9 +58568,9 @@ var require_fetch2 = __commonJS({
58463
58568
  }
58464
58569
  });
58465
58570
 
58466
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/create.js
58571
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/create.js
58467
58572
  var require_create = __commonJS({
58468
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/create.js"(exports, module) {
58573
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/create.js"(exports, module) {
58469
58574
  "use strict";
58470
58575
  var { encodePath, normalizePath, getStatusCode, enhanceCommandError } = require_tools2();
58471
58576
  module.exports = async (connection, path) => {
@@ -58522,9 +58627,9 @@ var require_create = __commonJS({
58522
58627
  }
58523
58628
  });
58524
58629
 
58525
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/delete.js
58630
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/delete.js
58526
58631
  var require_delete = __commonJS({
58527
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/delete.js"(exports, module) {
58632
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/delete.js"(exports, module) {
58528
58633
  "use strict";
58529
58634
  var { encodePath, normalizePath, enhanceCommandError } = require_tools2();
58530
58635
  module.exports = async (connection, path) => {
@@ -58552,9 +58657,9 @@ var require_delete = __commonJS({
58552
58657
  }
58553
58658
  });
58554
58659
 
58555
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/rename.js
58660
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/rename.js
58556
58661
  var require_rename = __commonJS({
58557
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/rename.js"(exports, module) {
58662
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/rename.js"(exports, module) {
58558
58663
  "use strict";
58559
58664
  var { encodePath, normalizePath, enhanceCommandError } = require_tools2();
58560
58665
  module.exports = async (connection, path, newPath) => {
@@ -58587,9 +58692,9 @@ var require_rename = __commonJS({
58587
58692
  }
58588
58693
  });
58589
58694
 
58590
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/close.js
58695
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/close.js
58591
58696
  var require_close = __commonJS({
58592
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/close.js"(exports, module) {
58697
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/close.js"(exports, module) {
58593
58698
  "use strict";
58594
58699
  module.exports = async (connection) => {
58595
58700
  if (connection.state !== connection.states.SELECTED) {
@@ -58615,9 +58720,9 @@ var require_close = __commonJS({
58615
58720
  }
58616
58721
  });
58617
58722
 
58618
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/subscribe.js
58723
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/subscribe.js
58619
58724
  var require_subscribe = __commonJS({
58620
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/subscribe.js"(exports, module) {
58725
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/subscribe.js"(exports, module) {
58621
58726
  "use strict";
58622
58727
  var { encodePath, normalizePath, enhanceCommandError } = require_tools2();
58623
58728
  module.exports = async (connection, path) => {
@@ -58639,9 +58744,9 @@ var require_subscribe = __commonJS({
58639
58744
  }
58640
58745
  });
58641
58746
 
58642
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/unsubscribe.js
58747
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/unsubscribe.js
58643
58748
  var require_unsubscribe = __commonJS({
58644
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/unsubscribe.js"(exports, module) {
58749
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/unsubscribe.js"(exports, module) {
58645
58750
  "use strict";
58646
58751
  var { encodePath, normalizePath, enhanceCommandError } = require_tools2();
58647
58752
  module.exports = async (connection, path) => {
@@ -58663,9 +58768,9 @@ var require_unsubscribe = __commonJS({
58663
58768
  }
58664
58769
  });
58665
58770
 
58666
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/store.js
58771
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/store.js
58667
58772
  var require_store = __commonJS({
58668
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/store.js"(exports, module) {
58773
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/store.js"(exports, module) {
58669
58774
  "use strict";
58670
58775
  var { formatFlag, canUseFlag, enhanceCommandError } = require_tools2();
58671
58776
  module.exports = async (connection, range, flags, options) => {
@@ -58727,11 +58832,11 @@ var require_store = __commonJS({
58727
58832
  }
58728
58833
  });
58729
58834
 
58730
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/search-compiler.js
58835
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/search-compiler.js
58731
58836
  var require_search_compiler = __commonJS({
58732
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/search-compiler.js"(exports, module) {
58837
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/search-compiler.js"(exports, module) {
58733
58838
  "use strict";
58734
- var { formatDate, formatFlag, canUseFlag, isDate, isRev2Active } = require_tools2();
58839
+ var { formatDate, formatFlag, canUseFlag, toValidDate, isRev2Active } = require_tools2();
58735
58840
  var setBoolOpt = (attributes, term, value) => {
58736
58841
  if (!value) {
58737
58842
  if (/^un/i.test(term)) {
@@ -58755,7 +58860,11 @@ var require_search_compiler = __commonJS({
58755
58860
  }
58756
58861
  };
58757
58862
  var processDateField = (attributes, term, value) => {
58758
- if (["BEFORE", "SENTBEFORE"].includes(term.toUpperCase()) && isDate(value) && value.toISOString().substring(11) !== "00:00:00.000Z") {
58863
+ value = toValidDate(value);
58864
+ if (!value) {
58865
+ return;
58866
+ }
58867
+ if (["BEFORE", "SENTBEFORE"].includes(term.toUpperCase()) && value.toISOString().substring(11) !== "00:00:00.000Z") {
58759
58868
  value = new Date(value.getTime() + 24 * 3600 * 1e3);
58760
58869
  }
58761
58870
  let date3 = formatDate(value);
@@ -58927,14 +59036,18 @@ var require_search_compiler = __commonJS({
58927
59036
  case "BEFORE":
58928
59037
  case "SINCE":
58929
59038
  {
58930
- if (connection.capabilities.has("WITHIN") && isDate(params[term])) {
59039
+ let value = toValidDate(params[term]);
59040
+ if (!value) {
59041
+ break;
59042
+ }
59043
+ if (connection.capabilities.has("WITHIN")) {
58931
59044
  const now = Date.now();
58932
- const withinSeconds = Math.round(Math.max(0, now - params[term].getTime()) / 1e3);
59045
+ const withinSeconds = Math.round(Math.max(0, now - value.getTime()) / 1e3);
58933
59046
  const withinKeyword = term.toUpperCase() === "BEFORE" ? "OLDER" : "YOUNGER";
58934
59047
  setOpt(attributes, withinKeyword, withinSeconds.toString());
58935
59048
  break;
58936
59049
  }
58937
- processDateField(attributes, term, params[term]);
59050
+ processDateField(attributes, term, value);
58938
59051
  }
58939
59052
  break;
58940
59053
  // Standard date searches
@@ -59053,9 +59166,9 @@ var require_search_compiler = __commonJS({
59053
59166
  }
59054
59167
  });
59055
59168
 
59056
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/search.js
59169
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/search.js
59057
59170
  var require_search = __commonJS({
59058
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/search.js"(exports, module) {
59171
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/search.js"(exports, module) {
59059
59172
  "use strict";
59060
59173
  var {
59061
59174
  enhanceCommandError,
@@ -59280,9 +59393,9 @@ var require_search = __commonJS({
59280
59393
  }
59281
59394
  });
59282
59395
 
59283
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/noop.js
59396
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/noop.js
59284
59397
  var require_noop = __commonJS({
59285
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/noop.js"(exports, module) {
59398
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/noop.js"(exports, module) {
59286
59399
  "use strict";
59287
59400
  module.exports = async (connection) => {
59288
59401
  try {
@@ -59297,9 +59410,9 @@ var require_noop = __commonJS({
59297
59410
  }
59298
59411
  });
59299
59412
 
59300
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/expunge.js
59413
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/expunge.js
59301
59414
  var require_expunge = __commonJS({
59302
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/expunge.js"(exports, module) {
59415
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/expunge.js"(exports, module) {
59303
59416
  "use strict";
59304
59417
  var { enhanceCommandError, hasCapability, parseBigIntValue } = require_tools2();
59305
59418
  module.exports = async (connection, range, options) => {
@@ -59333,9 +59446,9 @@ var require_expunge = __commonJS({
59333
59446
  }
59334
59447
  });
59335
59448
 
59336
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/append.js
59449
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/append.js
59337
59450
  var require_append = __commonJS({
59338
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/append.js"(exports, module) {
59451
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/append.js"(exports, module) {
59339
59452
  "use strict";
59340
59453
  var {
59341
59454
  formatFlag,
@@ -59450,9 +59563,9 @@ var require_append = __commonJS({
59450
59563
  }
59451
59564
  });
59452
59565
 
59453
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/status.js
59566
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/status.js
59454
59567
  var require_status = __commonJS({
59455
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/status.js"(exports, module) {
59568
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/status.js"(exports, module) {
59456
59569
  "use strict";
59457
59570
  var { encodePath, normalizePath, buildStatusQueryAttributes, isRev2Active } = require_tools2();
59458
59571
  var { parseStatusList } = require_status_fields();
@@ -59528,9 +59641,9 @@ var require_status = __commonJS({
59528
59641
  }
59529
59642
  });
59530
59643
 
59531
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/copyuid-parser.js
59644
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/copyuid-parser.js
59532
59645
  var require_copyuid_parser = __commonJS({
59533
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/copyuid-parser.js"(exports, module) {
59646
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/copyuid-parser.js"(exports, module) {
59534
59647
  "use strict";
59535
59648
  var { expandRange, parseBigIntValue } = require_tools2();
59536
59649
  function parseCopyUid(response, map) {
@@ -59553,9 +59666,9 @@ var require_copyuid_parser = __commonJS({
59553
59666
  }
59554
59667
  });
59555
59668
 
59556
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/copy.js
59669
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/copy.js
59557
59670
  var require_copy = __commonJS({
59558
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/copy.js"(exports, module) {
59671
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/copy.js"(exports, module) {
59559
59672
  "use strict";
59560
59673
  var { normalizePath, encodePath, enhanceCommandError } = require_tools2();
59561
59674
  var { parseCopyUid } = require_copyuid_parser();
@@ -59585,9 +59698,9 @@ var require_copy = __commonJS({
59585
59698
  }
59586
59699
  });
59587
59700
 
59588
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/move.js
59701
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/move.js
59589
59702
  var require_move = __commonJS({
59590
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/move.js"(exports, module) {
59703
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/move.js"(exports, module) {
59591
59704
  "use strict";
59592
59705
  var { normalizePath, encodePath, enhanceCommandError, hasCapability } = require_tools2();
59593
59706
  var { parseCopyUid } = require_copyuid_parser();
@@ -59628,9 +59741,9 @@ var require_move = __commonJS({
59628
59741
  }
59629
59742
  });
59630
59743
 
59631
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/compress.js
59744
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/compress.js
59632
59745
  var require_compress = __commonJS({
59633
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/compress.js"(exports, module) {
59746
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/compress.js"(exports, module) {
59634
59747
  "use strict";
59635
59748
  module.exports = async (connection) => {
59636
59749
  if (!connection.capabilities.has("COMPRESS=DEFLATE") || connection._inflate) {
@@ -59657,9 +59770,9 @@ var require_compress = __commonJS({
59657
59770
  }
59658
59771
  });
59659
59772
 
59660
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/quota.js
59773
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/quota.js
59661
59774
  var require_quota = __commonJS({
59662
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/quota.js"(exports, module) {
59775
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/quota.js"(exports, module) {
59663
59776
  "use strict";
59664
59777
  var { encodePath, normalizePath, enhanceCommandError, parseUintValue, isUnsafeKey } = require_tools2();
59665
59778
  module.exports = async (connection, path) => {
@@ -59748,11 +59861,11 @@ var require_quota = __commonJS({
59748
59861
  }
59749
59862
  });
59750
59863
 
59751
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/idle.js
59864
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/idle.js
59752
59865
  var require_idle = __commonJS({
59753
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/idle.js"(exports, module) {
59866
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/idle.js"(exports, module) {
59754
59867
  "use strict";
59755
- var { hasCapability, logConnectionError, unrefTimer } = require_tools2();
59868
+ var { guardedPromise, hasCapability, logConnectionError, restampConnectionError, unrefTimer } = require_tools2();
59756
59869
  var NOOP_INTERVAL = 2 * 60 * 1e3;
59757
59870
  function claimIdling(connection) {
59758
59871
  let token = {};
@@ -59798,7 +59911,7 @@ var require_idle = __commonJS({
59798
59911
  }
59799
59912
  };
59800
59913
  let connectionPreCheck = () => {
59801
- let handler = new Promise((resolve3, reject) => {
59914
+ let handler = guardedPromise((resolve3, reject) => {
59802
59915
  preCheckWaitQueue.push({ resolve: resolve3, reject });
59803
59916
  });
59804
59917
  connection.log.trace({
@@ -59843,9 +59956,12 @@ var require_idle = __commonJS({
59843
59956
  return;
59844
59957
  } catch (err) {
59845
59958
  logConnectionError(connection, "IDLE session failed", err);
59846
- while (preCheckWaitQueue.length) {
59847
- let { reject } = preCheckWaitQueue.shift();
59848
- reject(err);
59959
+ if (preCheckWaitQueue.length) {
59960
+ let waiterError = restampConnectionError(err, { rejectedFrom: "preCheckWaiter" });
59961
+ while (preCheckWaitQueue.length) {
59962
+ let { reject } = preCheckWaitQueue.shift();
59963
+ reject(waiterError);
59964
+ }
59849
59965
  }
59850
59966
  return false;
59851
59967
  } finally {
@@ -59991,9 +60107,9 @@ var require_idle = __commonJS({
59991
60107
  }
59992
60108
  });
59993
60109
 
59994
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/authenticate.js
60110
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/authenticate.js
59995
60111
  var require_authenticate = __commonJS({
59996
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/commands/authenticate.js"(exports, module) {
60112
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/commands/authenticate.js"(exports, module) {
59997
60113
  "use strict";
59998
60114
  var { getStatusCode, getErrorText } = require_tools2();
59999
60115
  async function handleAuthError(err, errorResponse2) {
@@ -60137,9 +60253,9 @@ var require_authenticate = __commonJS({
60137
60253
  }
60138
60254
  });
60139
60255
 
60140
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/imap-commands.js
60256
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/imap-commands.js
60141
60257
  var require_imap_commands = __commonJS({
60142
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/imap-commands.js"(exports, module) {
60258
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/imap-commands.js"(exports, module) {
60143
60259
  "use strict";
60144
60260
  module.exports = /* @__PURE__ */ new Map([
60145
60261
  ["ID", require_id2()],
@@ -60174,9 +60290,9 @@ var require_imap_commands = __commonJS({
60174
60290
  }
60175
60291
  });
60176
60292
 
60177
- // node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/imap-flow.js
60293
+ // node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/imap-flow.js
60178
60294
  var require_imap_flow = __commonJS({
60179
- "node_modules/.pnpm/imapflow@1.7.1/node_modules/imapflow/lib/imap-flow.js"(exports, module) {
60295
+ "node_modules/.pnpm/imapflow@1.7.6/node_modules/imapflow/lib/imap-flow.js"(exports, module) {
60180
60296
  "use strict";
60181
60297
  var tls = __require("tls");
60182
60298
  var net = __require("net");
@@ -60213,11 +60329,12 @@ var require_imap_flow = __commonJS({
60213
60329
  parseUintValue,
60214
60330
  isUnsafeKey,
60215
60331
  getStringList,
60332
+ buildConnectionError,
60333
+ guardedPromise,
60334
+ guardedReject,
60216
60335
  MAX_UINT32_DIGITS
60217
60336
  } = require_tools2();
60218
60337
  var imapCommands = require_imap_commands();
60219
- var noop = () => {
60220
- };
60221
60338
  var GREETING_TIMEOUT = 16 * 1e3;
60222
60339
  var UPGRADE_TIMEOUT = 10 * 1e3;
60223
60340
  var SOCKET_TIMEOUT = 5 * 60 * 1e3;
@@ -60568,14 +60685,10 @@ var require_imap_flow = __commonJS({
60568
60685
  }
60569
60686
  write(chunk) {
60570
60687
  if (!this.socket || this.socket.destroyed) {
60571
- const error2 = new Error("Socket is already closed");
60572
- error2.code = "NoConnection";
60573
- throw error2;
60688
+ throw this.createConnectionError("NoConnection", "Socket is already closed", { rejectedFrom: "writeNoSocket" });
60574
60689
  }
60575
60690
  if (this.state === this.states.LOGOUT) {
60576
- const error2 = new Error("Can not send data after logged out");
60577
- error2.code = "StateLogout";
60578
- throw error2;
60691
+ throw this.createConnectionError("StateLogout", "Can not send data after logged out", { rejectedFrom: "writeAfterLogout" });
60579
60692
  }
60580
60693
  if (this.writeSocket.destroyed) {
60581
60694
  this.log.error({ msg: "Write socket destroyed", cid: this.id });
@@ -60641,9 +60754,7 @@ var require_imap_flow = __commonJS({
60641
60754
  let request = this.requestTagMap.get(data.tag);
60642
60755
  if (request) {
60643
60756
  this.requestTagMap.delete(request.tag);
60644
- const error2 = new Error("Connection not available");
60645
- error2.code = "NoConnection";
60646
- request.reject(error2);
60757
+ request.reject(this.createNoConnectionError(false, { rejectedFrom: "sendAfterLogout", command: request.command }));
60647
60758
  }
60648
60759
  }
60649
60760
  return;
@@ -60691,28 +60802,18 @@ var require_imap_flow = __commonJS({
60691
60802
  }
60692
60803
  exec(command, attributes, options) {
60693
60804
  if (this.state === this.states.LOGOUT || this.isClosed) {
60694
- const error2 = new Error("Connection not available");
60695
- error2.code = "NoConnection";
60696
- let p = Promise.reject(error2);
60697
- p.catch(noop);
60698
- return p;
60805
+ return guardedReject(this.createNoConnectionError(false, { rejectedFrom: "execClosed", command }));
60699
60806
  }
60700
60807
  if (!this.socket || this.socket.destroyed) {
60701
- let error2 = new Error("Connection closed");
60702
- error2.code = "EConnectionClosed";
60703
- let p = Promise.reject(error2);
60704
- p.catch(noop);
60705
- return p;
60808
+ return guardedReject(this.createConnectionError("EConnectionClosed", "Connection closed", { rejectedFrom: "execNoSocket", command }));
60706
60809
  }
60707
60810
  let tag = (++this.tagCounter).toString(16).toUpperCase();
60708
60811
  options = options || {};
60709
- let promise = new Promise((resolve3, reject) => {
60812
+ return guardedPromise((resolve3, reject) => {
60710
60813
  this.requestTagMap.set(tag, { command, attributes, options, resolve: resolve3, reject });
60711
60814
  this.requestQueue.push({ tag, command, attributes, options });
60712
60815
  this.trySend().catch((err) => logConnectionError(this, "Failed to dispatch command", err));
60713
60816
  });
60714
- promise.catch(noop);
60715
- return promise;
60716
60817
  }
60717
60818
  // Resolves an untagged server response to the keyword it is dispatched on. IMAP untagged
60718
60819
  // responses come in two forms:
@@ -61046,7 +61147,7 @@ var require_imap_flow = __commonJS({
61046
61147
  this.log.warn({ msg: "Throttling detected", cid: this.id, throttleDelay, delayResponse, err });
61047
61148
  let aborted2 = await this.throttleWait(delayResponse);
61048
61149
  if (aborted2) {
61049
- request.reject(this.createNoConnectionError(this.byeReason));
61150
+ request.reject(this.createNoConnectionError(this.byeReason, { rejectedFrom: "throttleAbort", command: request.command }));
61050
61151
  break;
61051
61152
  }
61052
61153
  }
@@ -61381,9 +61482,7 @@ var require_imap_flow = __commonJS({
61381
61482
  this.socket = tls.connect(opts, () => {
61382
61483
  try {
61383
61484
  if (this.isClosed) {
61384
- let err = new Error("Connection closed during TLS upgrade");
61385
- err.code = "NoConnection";
61386
- return settle2(err);
61485
+ return settle2(this.createNoConnectionError(false, { rejectedFrom: "tlsUpgrade" }));
61387
61486
  }
61388
61487
  this.secureConnection = true;
61389
61488
  this.streamer.secureConnection = true;
@@ -61782,7 +61881,7 @@ var require_imap_flow = __commonJS({
61782
61881
  throw error2;
61783
61882
  }
61784
61883
  }
61785
- let connectPromise = new Promise((resolve3, reject) => {
61884
+ let connectPromise = guardedPromise((resolve3, reject) => {
61786
61885
  this.connectTimeout = setTimeout(() => {
61787
61886
  let err = deadline.error();
61788
61887
  this.log.error({ err, cid: this.id });
@@ -61859,7 +61958,6 @@ var require_imap_flow = __commonJS({
61859
61958
  };
61860
61959
  this.socket.on("error", this._connectErrorHandler);
61861
61960
  });
61862
- connectPromise.catch(noop);
61863
61961
  await connectPromise;
61864
61962
  }
61865
61963
  /**
@@ -61883,11 +61981,14 @@ var require_imap_flow = __commonJS({
61883
61981
  closeAfter() {
61884
61982
  setImmediate(() => this.close());
61885
61983
  }
61886
- // Builds the standard "connection not available" error, optionally annotated with the
61887
- // server's BYE reason. Single source of truth so every NoConnection rejection is consistent.
61888
- createNoConnectionError(byeReason) {
61889
- const error2 = new Error("Connection not available");
61890
- error2.code = "NoConnection";
61984
+ // Connection-scoped wrapper around the shared stamping helper; see buildConnectionError().
61985
+ createConnectionError(code, message, meta) {
61986
+ return buildConnectionError(this.id, code, message, meta);
61987
+ }
61988
+ // The standard "connection not available" error, optionally annotated with the server's BYE
61989
+ // reason. Single source of truth so every NoConnection rejection is consistent.
61990
+ createNoConnectionError(byeReason, meta) {
61991
+ const error2 = this.createConnectionError("NoConnection", "Connection not available", meta);
61891
61992
  if (byeReason) {
61892
61993
  error2.reason = byeReason;
61893
61994
  }
@@ -61919,9 +62020,7 @@ var require_imap_flow = __commonJS({
61919
62020
  if (typeof this._upgradeReject === "function") {
61920
62021
  let reject = this._upgradeReject;
61921
62022
  this._upgradeReject = null;
61922
- let err = new Error("Connection closed during TLS upgrade");
61923
- err.code = "NoConnection";
61924
- reject(err);
62023
+ reject(this.createNoConnectionError(false, { rejectedFrom: "upgrade" }));
61925
62024
  }
61926
62025
  if (typeof this.initialReject === "function" && !this.options.verifyOnly) {
61927
62026
  clearTimeout(this.greetingTimeout);
@@ -61968,10 +62067,9 @@ var require_imap_flow = __commonJS({
61968
62067
  }
61969
62068
  }
61970
62069
  }
61971
- const createNoConnectionError = (byeReason2) => this.createNoConnectionError(byeReason2);
61972
62070
  let byeReason = this.byeReason;
61973
62071
  for (let request of pendingRequests) {
61974
- request.reject(createNoConnectionError(byeReason));
62072
+ request.reject(this.createNoConnectionError(byeReason, { rejectedFrom: "pendingRequest", command: request.command }));
61975
62073
  }
61976
62074
  if (this.currentLock && this.currentLock.heldWarnTimer) {
61977
62075
  clearTimeout(this.currentLock.heldWarnTimer);
@@ -61986,7 +62084,7 @@ var require_imap_flow = __commonJS({
61986
62084
  lock.acquireTimer = null;
61987
62085
  }
61988
62086
  if (typeof lock.reject === "function") {
61989
- lock.reject(createNoConnectionError(byeReason));
62087
+ lock.reject(this.createNoConnectionError(byeReason, { rejectedFrom: "mailboxLock", path: lock.path }));
61990
62088
  }
61991
62089
  }
61992
62090
  }
@@ -62082,7 +62180,7 @@ var require_imap_flow = __commonJS({
62082
62180
  /**
62083
62181
  * Returns current quota
62084
62182
  *
62085
- * @param {String} [path] Optional mailbox path if you want to check quota for specific folder
62183
+ * @param {string|array} [path] Optional mailbox path if you want to check quota for specific folder. If value is an array then it is joined using current delimiter symbols. Namespace prefix is added automatically if required.
62086
62184
  * @returns {Promise<QuotaResponse|Boolean>} Quota information or `false` if QUOTA extension is not supported or requested path does not exist
62087
62185
  *
62088
62186
  * @example
@@ -62317,7 +62415,7 @@ var require_imap_flow = __commonJS({
62317
62415
  /**
62318
62416
  * Requests the status of the indicated mailbox. Only requested status values will be returned.
62319
62417
  *
62320
- * @param {String} path mailbox path to check for (unicode string)
62418
+ * @param {string|array} path mailbox path to check for (unicode string). If value is an array then it is joined using current delimiter symbols. Namespace prefix is added automatically if required.
62321
62419
  * @param {Object} query defines requested status items
62322
62420
  * @param {Boolean} query.messages if `true` request count of messages
62323
62421
  * @param {Boolean} query.recent if `true` request count of messages with \\Recent tag
@@ -62580,7 +62678,7 @@ var require_imap_flow = __commonJS({
62580
62678
  /**
62581
62679
  * Appends a new message to a mailbox
62582
62680
  *
62583
- * @param {String} path Mailbox path to upload the message to (unicode string)
62681
+ * @param {string|array} path Mailbox path to upload the message to (unicode string). If value is an array then it is joined using current delimiter symbols. Namespace prefix is added automatically if required.
62584
62682
  * @param {string|Buffer} content RFC822 formatted email message
62585
62683
  * @param {string[]} [flags] an array of flags to be set for the uploaded message
62586
62684
  * @param {Date|string} [idate=now] internal date to be set for the message
@@ -62604,7 +62702,7 @@ var require_imap_flow = __commonJS({
62604
62702
  * Copies messages from current mailbox to destination mailbox
62605
62703
  *
62606
62704
  * @param {SequenceString | Number[] | SearchObject} range Range of messages to copy
62607
- * @param {String} destination Mailbox path to copy the messages to
62705
+ * @param {string|array} destination Mailbox path to copy the messages to. If value is an array then it is joined using current delimiter symbols. Namespace prefix is added automatically if required.
62608
62706
  * @param {Object} [options]
62609
62707
  * @param {Boolean} [options.uid] If `true` then uses UID {@link SequenceString} instead of sequence numbers
62610
62708
  * @returns {Promise<CopyResponseObject>} info about copies messages
@@ -62627,7 +62725,7 @@ var require_imap_flow = __commonJS({
62627
62725
  * Moves messages from current mailbox to destination mailbox
62628
62726
  *
62629
62727
  * @param {SequenceString | Number[] | SearchObject} range Range of messages to move
62630
- * @param {String} destination Mailbox path to move the messages to
62728
+ * @param {string|array} destination Mailbox path to move the messages to. If value is an array then it is joined using current delimiter symbols. Namespace prefix is added automatically if required.
62631
62729
  * @param {Object} [options]
62632
62730
  * @param {Boolean} [options.uid] If `true` then uses UID {@link SequenceString} instead of sequence numbers
62633
62731
  * @returns {Promise<CopyResponseObject>} info about moved messages
@@ -62865,9 +62963,7 @@ var require_imap_flow = __commonJS({
62865
62963
  while (res = await getNext()) {
62866
62964
  lastRes = res;
62867
62965
  if (this.isClosed || !this.socket || this.socket.destroyed) {
62868
- let error2 = new Error("Connection closed");
62869
- error2.code = "EConnectionClosed";
62870
- throw error2;
62966
+ throw this.createConnectionError("EConnectionClosed", "Connection closed", { rejectedFrom: "fetchStream", command: "FETCH" });
62871
62967
  }
62872
62968
  yield res.response;
62873
62969
  res.next();
@@ -63380,7 +63476,7 @@ var require_imap_flow = __commonJS({
63380
63476
  return false;
63381
63477
  }
63382
63478
  if (!this.socket || this.socket.destroyed) {
63383
- throw this.createNoConnectionError();
63479
+ throw this.createNoConnectionError(false, { rejectedFrom: "noSocket", command });
63384
63480
  }
63385
63481
  clearTimeout(this.idleStartTimer);
63386
63482
  try {
@@ -63413,7 +63509,7 @@ var require_imap_flow = __commonJS({
63413
63509
  return false;
63414
63510
  }
63415
63511
  if (!this.socket || this.socket.destroyed) {
63416
- throw this.createNoConnectionError();
63512
+ throw this.createNoConnectionError(false, { rejectedFrom: "noSocket", command });
63417
63513
  }
63418
63514
  let handler = this.commands.get(command);
63419
63515
  return await handler(this, ...args);
@@ -63503,9 +63599,7 @@ var require_imap_flow = __commonJS({
63503
63599
  };
63504
63600
  if (!this.usable || !this.socket || this.socket.destroyed) {
63505
63601
  this.log.trace({ msg: "Failed to acquire mailbox lock", path, lockId, idling: this.idling });
63506
- let error2 = new Error("Connection not available");
63507
- error2.code = "NoConnection";
63508
- reject(error2);
63602
+ reject(this.createNoConnectionError(false, { rejectedFrom: "mailboxLock", path }));
63509
63603
  continue;
63510
63604
  }
63511
63605
  const grantLock = () => {
@@ -63602,7 +63696,7 @@ var require_imap_flow = __commonJS({
63602
63696
  ...this.currentLock.options?.description && { description: this.currentLock.options?.description }
63603
63697
  } : null
63604
63698
  });
63605
- let lockPromise = new Promise((resolve3, reject) => {
63699
+ let lockPromise = guardedPromise((resolve3, reject) => {
63606
63700
  let lockEntry = { resolve: resolve3, reject, path, options, lockId };
63607
63701
  this.locks.push(lockEntry);
63608
63702
  if (Number(options.acquireTimeout) > 0) {
@@ -63620,7 +63714,6 @@ var require_imap_flow = __commonJS({
63620
63714
  }
63621
63715
  this.processLocks().catch((err) => reject(err));
63622
63716
  });
63623
- lockPromise.catch(noop);
63624
63717
  return lockPromise;
63625
63718
  }
63626
63719
  getLogger() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apple-mail-mcp",
3
- "version": "2.17.4",
3
+ "version": "2.17.5",
4
4
  "description": "MCP server for Apple Mail - read, search, send, and manage emails via Claude and other AI assistants",
5
5
  "type": "module",
6
6
  "main": "build/index.js",