@agenticmail/core 0.9.3 → 0.9.4

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/index.cjs CHANGED
@@ -964,7 +964,13 @@ var MailReceiver = class {
964
964
  async fetchMessage(uid, mailbox = "INBOX") {
965
965
  const lock = await this.client.getMailboxLock(mailbox);
966
966
  try {
967
- const { content } = await this.client.download(String(uid), void 0, { uid: true });
967
+ const result = await this.client.download(String(uid), void 0, { uid: true });
968
+ const content = result?.content;
969
+ if (!content) {
970
+ const err = new Error(`Message UID ${uid} not found in mailbox "${mailbox}"`);
971
+ err.code = "MESSAGE_NOT_FOUND";
972
+ throw err;
973
+ }
968
974
  const chunks = [];
969
975
  for await (const chunk of content) {
970
976
  chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
package/dist/index.js CHANGED
@@ -205,7 +205,13 @@ var MailReceiver = class {
205
205
  async fetchMessage(uid, mailbox = "INBOX") {
206
206
  const lock = await this.client.getMailboxLock(mailbox);
207
207
  try {
208
- const { content } = await this.client.download(String(uid), void 0, { uid: true });
208
+ const result = await this.client.download(String(uid), void 0, { uid: true });
209
+ const content = result?.content;
210
+ if (!content) {
211
+ const err = new Error(`Message UID ${uid} not found in mailbox "${mailbox}"`);
212
+ err.code = "MESSAGE_NOT_FOUND";
213
+ throw err;
214
+ }
209
215
  const chunks = [];
210
216
  for await (const chunk of content) {
211
217
  chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agenticmail/core",
3
- "version": "0.9.3",
3
+ "version": "0.9.4",
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",