hypermail-mcp 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
@@ -3,6 +3,11 @@
3
3
  A **Model Context Protocol** server that lets an agent operate any of the user's
4
4
  inboxes through a single, unified tool surface.
5
5
 
6
+ > **v0.7.3** — `edit_draft` now preserves the quoted thread history when editing
7
+ > Outlook reply/forward drafts. Previously, editing a draft body would overwrite
8
+ > the entire content — including the quoted thread. Now only the answer part
9
+ > (above the spacer delimiter) is replaced.
10
+ >
6
11
  > **v0.7.2** — `add_attachment_to_draft` now accepts `filePath` (absolute path to
7
12
  a local file) as an alternative to `contentBytes`. The file is read from disk and
8
13
  base64-encoded automatically, the MIME type is inferred from the extension, and
@@ -231,7 +236,7 @@ account store.
231
236
  | `draft_email` | `account`, `to[]`, `cc?`, `bcc?`, `subject`, `body`, `format`, `include_signature?`, `inReplyTo?`, `replyAll?`, `forwardMessageId?` | Save as draft instead of sending. `format` (`"html"` or `"markdown"`) controls body format — Markdown is converted to HTML via `marked`. Returns the draft message ID and HTML body (`draftHtml`). Disabled under `--read-only`. |
232
237
  | `edit_draft` | `account`, `id`, `to?`, `cc?`, `bcc?`, `subject?`, `body?`, `format?`, `include_signature?` | Edit an existing draft by ID. Only provided fields are updated. `format` only meaningful when `body` is provided. Returns the updated draft ID and HTML body (`draftHtml`). Disabled under `--read-only`. |
233
238
  | `send_draft` | `account`, `id` | Send an existing draft email by ID. Use with draft IDs returned by `draft_email` or `edit_draft`. Disabled under `--read-only`. |
234
- | `add_attachment_to_draft` | `account`, `id`, `name`, `contentBytes`, `contentType?` | Attach a base64-encoded file to an existing draft email by ID. Disabled under `--read-only`. |
239
+ | `add_attachment_to_draft` | `account`, `id`, `name?`, `contentBytes?`, `filePath?`, `contentType?` | Attach a file to an existing draft by ID. Provide `contentBytes` (base64) or `filePath` (absolute path — auto-encodes). Disabled under `--read-only`. |
235
240
  | `list_folders` | `account`, `parentFolderId?` | List available mail folders. Returns top-level folders by default, or children of `parentFolderId`. |
236
241
  | `create_folder` | `account`, `displayName`, `parentFolderId?` | Create a new mail folder under root (default) or the given parent. Disabled under `--read-only`. |
237
242
  | `delete_folder` | `account`, `folderId` | Delete a mail folder by ID. Disabled under `--read-only`. |
package/dist/cli.js CHANGED
@@ -3460,6 +3460,18 @@ function registerComposeTools(server, ctx) {
3460
3460
  bodyPayload = composed.body;
3461
3461
  isHtmlPayload = composed.isHtml;
3462
3462
  }
3463
+ if (bodyPayload !== void 0) {
3464
+ const spacer = '<div style="line-height:12px"><br></div>';
3465
+ try {
3466
+ const existing = await provider.readEmail(account, a.id);
3467
+ const existingHtml = existing.bodyHtml ?? "";
3468
+ const spacerIdx = existingHtml.indexOf(spacer);
3469
+ if (spacerIdx !== -1) {
3470
+ bodyPayload = bodyPayload + existingHtml.slice(spacerIdx);
3471
+ }
3472
+ } catch {
3473
+ }
3474
+ }
3463
3475
  const res = await provider.updateDraft(account, a.id, {
3464
3476
  to: a.to,
3465
3477
  cc: a.cc,
@@ -3616,7 +3628,7 @@ function registerTools(server, opts) {
3616
3628
  // package.json
3617
3629
  var package_default = {
3618
3630
  name: "hypermail-mcp",
3619
- version: "0.7.2",
3631
+ version: "0.7.3",
3620
3632
  description: "Unified email MCP server \u2014 operate any inbox (Outlook now, IMAP/Gmail later) by passing an email address.",
3621
3633
  type: "module",
3622
3634
  bin: {