@agenticmail/core 0.7.2 → 0.7.3

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/README.md CHANGED
@@ -1,4 +1,8 @@
1
- # @agenticmail/core
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/agenticmail/agenticmail/main/docs/images/logo-200.png" alt="AgenticMail logo (pink bow)" width="180" />
3
+ </p>
4
+
5
+ <h1 align="center">@agenticmail/core</h1>
2
6
 
3
7
  Core SDK for [AgenticMail](https://github.com/agenticmail/agenticmail) — the first platform to give AI agents real email addresses and phone numbers.
4
8
 
@@ -6,6 +10,13 @@ This is the foundation layer that everything else builds on. If the API server,
6
10
 
7
11
  Every other AgenticMail package depends on this one.
8
12
 
13
+ ## ✨ What's new in 0.7.2
14
+
15
+ - **`list_inbox` / `inbox_digest` consistency fix** — `MailReceiver.listEnvelopes` no longer trusts the stale cached `mailbox.exists` count and early-returns empty when an internal mail just landed. `getMailboxInfo` now issues an IMAP `NOOP` to refresh state before reading `client.mailbox`. `SEARCH` is the authoritative source; `list_inbox` and `inbox_digest` now agree.
16
+ - **Custom outgoing headers** — the `headers` field on `SendMailOptions` is fully plumbed through to nodemailer, so callers (the API, the MCP server) can set `X-AgenticMail-Wake` and other custom headers for downstream consumers to read.
17
+
18
+ The wake / thread-close / web UI features live in the API and dispatcher layers above this package; `core` provides the primitives they all share.
19
+
9
20
  ---
10
21
 
11
22
  ## Table of Contents
package/dist/index.cjs CHANGED
@@ -1011,6 +1011,24 @@ var MailReceiver = class {
1011
1011
  lock.release();
1012
1012
  }
1013
1013
  }
1014
+ /**
1015
+ * Flag / unflag a message. IMAP uses `\Flagged` for what Gmail
1016
+ * calls "starred" — same on-disk bit, different vocabulary. We
1017
+ * expose it as `setStarred(uid, true|false)` so the web UI can
1018
+ * call a single endpoint with a boolean.
1019
+ */
1020
+ async setStarred(uid, starred, mailbox = "INBOX") {
1021
+ const lock = await this.client.getMailboxLock(mailbox);
1022
+ try {
1023
+ if (starred) {
1024
+ await this.client.messageFlagsAdd(String(uid), ["\\Flagged"], { uid: true });
1025
+ } else {
1026
+ await this.client.messageFlagsRemove(String(uid), ["\\Flagged"], { uid: true });
1027
+ }
1028
+ } finally {
1029
+ lock.release();
1030
+ }
1031
+ }
1014
1032
  /** Move a message to another folder */
1015
1033
  async moveMessage(uid, fromMailbox, toMailbox) {
1016
1034
  const lock = await this.client.getMailboxLock(fromMailbox);
package/dist/index.d.cts CHANGED
@@ -473,6 +473,13 @@ declare class MailReceiver {
473
473
  deleteMessage(uid: number, mailbox?: string): Promise<void>;
474
474
  /** Mark a message as unseen (unread) */
475
475
  markUnseen(uid: number, mailbox?: string): Promise<void>;
476
+ /**
477
+ * Flag / unflag a message. IMAP uses `\Flagged` for what Gmail
478
+ * calls "starred" — same on-disk bit, different vocabulary. We
479
+ * expose it as `setStarred(uid, true|false)` so the web UI can
480
+ * call a single endpoint with a boolean.
481
+ */
482
+ setStarred(uid: number, starred: boolean, mailbox?: string): Promise<void>;
476
483
  /** Move a message to another folder */
477
484
  moveMessage(uid: number, fromMailbox: string, toMailbox: string): Promise<void>;
478
485
  /** List all IMAP folders/mailboxes */
package/dist/index.d.ts CHANGED
@@ -473,6 +473,13 @@ declare class MailReceiver {
473
473
  deleteMessage(uid: number, mailbox?: string): Promise<void>;
474
474
  /** Mark a message as unseen (unread) */
475
475
  markUnseen(uid: number, mailbox?: string): Promise<void>;
476
+ /**
477
+ * Flag / unflag a message. IMAP uses `\Flagged` for what Gmail
478
+ * calls "starred" — same on-disk bit, different vocabulary. We
479
+ * expose it as `setStarred(uid, true|false)` so the web UI can
480
+ * call a single endpoint with a boolean.
481
+ */
482
+ setStarred(uid: number, starred: boolean, mailbox?: string): Promise<void>;
476
483
  /** Move a message to another folder */
477
484
  moveMessage(uid: number, fromMailbox: string, toMailbox: string): Promise<void>;
478
485
  /** List all IMAP folders/mailboxes */
package/dist/index.js CHANGED
@@ -257,6 +257,24 @@ var MailReceiver = class {
257
257
  lock.release();
258
258
  }
259
259
  }
260
+ /**
261
+ * Flag / unflag a message. IMAP uses `\Flagged` for what Gmail
262
+ * calls "starred" — same on-disk bit, different vocabulary. We
263
+ * expose it as `setStarred(uid, true|false)` so the web UI can
264
+ * call a single endpoint with a boolean.
265
+ */
266
+ async setStarred(uid, starred, mailbox = "INBOX") {
267
+ const lock = await this.client.getMailboxLock(mailbox);
268
+ try {
269
+ if (starred) {
270
+ await this.client.messageFlagsAdd(String(uid), ["\\Flagged"], { uid: true });
271
+ } else {
272
+ await this.client.messageFlagsRemove(String(uid), ["\\Flagged"], { uid: true });
273
+ }
274
+ } finally {
275
+ lock.release();
276
+ }
277
+ }
260
278
  /** Move a message to another folder */
261
279
  async moveMessage(uid, fromMailbox, toMailbox) {
262
280
  const lock = await this.client.getMailboxLock(fromMailbox);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agenticmail/core",
3
- "version": "0.7.2",
3
+ "version": "0.7.3",
4
4
  "description": "Core SDK for AgenticMail — email, SMS, and phone number access for AI agents",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",