proton-mail-bridge-client 2.1.10 → 2.1.12
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.d.ts.map +1 -1
- package/dist/index.js +14 -6
- package/dist/index.js.map +1 -1
- package/dist/utils/helpers.d.ts +1 -0
- package/dist/utils/helpers.d.ts.map +1 -1
- package/dist/utils/helpers.js +66 -2
- package/dist/utils/helpers.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AASA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAYnE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAA2H,iBAAiB,EAA+B,MAAM,mCAAmC,CAAC;AAC5N,OAAO,EAAmC,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,OAAO,KAAK,EAMV,mBAAmB,EACnB,cAAc,EACd,WAAW,EAIX,WAAW,EAIX,gBAAgB,EAChB,cAAc,EAGf,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AASA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAYnE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAA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CAC1B,MAAM,EAAE,gBAAgB,EACxB,OAAO,GAAE;IACP,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAk0IP;AAED,wBAAsB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAmE1C"}
|
package/dist/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import { isMainModule } from "./is-main.js";
|
|
|
13
13
|
import { AnalyticsService } from "./services/analytics-service.js";
|
|
14
14
|
import { BULK_ITEM_TIMEOUT_MS, describeImapError, isLikelyAuthenticationError, isLikelyConnectionError, isLikelyTlsMismatchError, UID_VALIDITY_MISMATCH_ERROR } from "./services/simple-imap-service.js";
|
|
15
15
|
import { applySignature, plainTextToHtml } from "./services/smtp-service.js";
|
|
16
|
-
import { ensureValidEmails, foldQuotedHistory, isTextLikeMimeType, isValidEmail, lowerCaseAddress, normalizeBoolean, normalizeLimit, normalizeJsonValue, parseEmailId, parseEmails, projectFields, renderMarkdown, slugifyAccountAddress, splitAccountPrefix, stringifyForJson, withAccountPrefix, } from "./utils/helpers.js";
|
|
16
|
+
import { ensureValidEmails, foldQuotedHistory, isTextLikeMimeType, isValidEmail, lowerCaseAddress, normalizeBoolean, normalizeLimit, normalizeJsonValue, parseEmailId, parseEmails, projectFields, trimAttachmentsForListing, renderMarkdown, slugifyAccountAddress, splitAccountPrefix, stringifyForJson, withAccountPrefix, } from "./utils/helpers.js";
|
|
17
17
|
import { AccountManager } from "./services/account-manager.js";
|
|
18
18
|
import { logger } from "./utils/logger.js";
|
|
19
19
|
import { ensureDestructiveConfirmed, ensureEmailActionAllowed, ensureMailboxWriteAllowed, ensureOutboundRecipientsAllowed, ensureRemoteDraftSyncAllowed, ensureSendAllowed, resolveRemoteDraftSync, sanitizeRuntimeConfig, } from "./utils/runtime-policy.js";
|
|
@@ -518,7 +518,7 @@ const TOOLS = [
|
|
|
518
518
|
},
|
|
519
519
|
{
|
|
520
520
|
name: "get_emails",
|
|
521
|
-
description: "Fetch emails from a mailbox folder via live IMAP, defaults to newest first; set sortByUid to asc for oldest first. Use to browse or paginate recent messages in a specific folder. Prefer search_emails to filter by sender, subject, or date. Prefer search_indexed_emails for fast repeated queries when the local SQLite index is populated and Bridge availability is uncertain.",
|
|
521
|
+
description: "Fetch emails from a mailbox folder via live IMAP, defaults to newest first; set sortByUid to asc for oldest first. Use to browse or paginate recent messages in a specific folder. Prefer search_emails to filter by sender, subject, or date. Prefer search_indexed_emails for fast repeated queries when the local SQLite index is populated and Bridge availability is uncertain. Each email's attachments are metadata only (id/filename/contentType/size/disposition) — use list_attachments or get_email_by_id for full attachment detail.",
|
|
522
522
|
annotations: { readOnlyHint: true },
|
|
523
523
|
inputSchema: {
|
|
524
524
|
type: "object",
|
|
@@ -567,7 +567,7 @@ const TOOLS = [
|
|
|
567
567
|
},
|
|
568
568
|
{
|
|
569
569
|
name: "search_emails",
|
|
570
|
-
description: "Search emails via live IMAP filters with optional local post-processing for attachments and labels. Use when you need real-time results or must find messages received after the last sync. Prefer search_indexed_emails when the local index is current — it is significantly faster and works even when Bridge IMAP is unavailable.",
|
|
570
|
+
description: "Search emails via live IMAP filters with optional local post-processing for attachments and labels. Use when you need real-time results or must find messages received after the last sync. Prefer search_indexed_emails when the local index is current — it is significantly faster and works even when Bridge IMAP is unavailable. Each email's attachments are metadata only (id/filename/contentType/size/disposition) — use list_attachments or get_email_by_id for full attachment detail.",
|
|
571
571
|
annotations: { readOnlyHint: true },
|
|
572
572
|
inputSchema: {
|
|
573
573
|
type: "object",
|
|
@@ -1318,7 +1318,7 @@ const TOOLS = [
|
|
|
1318
1318
|
},
|
|
1319
1319
|
{
|
|
1320
1320
|
name: "search_indexed_emails",
|
|
1321
|
-
description: "Search the local SQLite mailbox index without making any IMAP connection. Supports free-text and field shortcuts inline: from:alice@example.com, to:bob, subject:invoice, label:Archive, domain:acme.com. Use for fast, offline-capable searches when the index is populated. Prefer search_emails when you need live IMAP results or when the index is stale or empty. Prefer this over search_emails when the index is current. Use search_emails if messages were received after the last sync.",
|
|
1321
|
+
description: "Search the local SQLite mailbox index without making any IMAP connection. Supports free-text and field shortcuts inline: from:alice@example.com, to:bob, subject:invoice, label:Archive, domain:acme.com. Use for fast, offline-capable searches when the index is populated. Prefer search_emails when you need live IMAP results or when the index is stale or empty. Prefer this over search_emails when the index is current. Use search_emails if messages were received after the last sync. Each email's attachments are metadata only (id/filename/contentType/size/disposition) — use list_attachments or get_email_by_id for full attachment detail.",
|
|
1322
1322
|
annotations: { readOnlyHint: true },
|
|
1323
1323
|
inputSchema: {
|
|
1324
1324
|
type: "object",
|
|
@@ -4333,7 +4333,10 @@ export function createServer(config, options = {}) {
|
|
|
4333
4333
|
// Scope limitation (follow-up round): stays scoped to the primary account's
|
|
4334
4334
|
// remote Drafts mailbox only — see list_drafts' identical note.
|
|
4335
4335
|
const result = await imapService.listRemoteDrafts(normalizeLimit(args.limit, 50), normalizeLimit(args.offset, 0, 0, 10_000));
|
|
4336
|
-
|
|
4336
|
+
// projectFields (called with no fields arg) still trims each email's
|
|
4337
|
+
// attachments to the essentials — same fix as every other list-style
|
|
4338
|
+
// tool, this one just didn't route through projectFields at all before.
|
|
4339
|
+
return createTextResult({ ...result, emails: projectFields(result.emails) }, false, result.emails.map(emailSource));
|
|
4337
4340
|
}
|
|
4338
4341
|
case "get_draft": {
|
|
4339
4342
|
const { bundle: getDraftBundle, rest: getDraftIdRest } = resolveAccountForDraftId(requireString(args, "draftId"));
|
|
@@ -6607,7 +6610,7 @@ export function createServer(config, options = {}) {
|
|
|
6607
6610
|
messageIds: rawThread.messageIds.map((id) => withAccountPrefix(threadAccountSlug, id)),
|
|
6608
6611
|
}
|
|
6609
6612
|
: rawThread;
|
|
6610
|
-
const
|
|
6613
|
+
const filteredThread = threadFolders && threadFolders.length > 0
|
|
6611
6614
|
? {
|
|
6612
6615
|
...thread,
|
|
6613
6616
|
messages: thread.messages.filter((message) => threadFolders.includes(message.folder)),
|
|
@@ -6615,6 +6618,11 @@ export function createServer(config, options = {}) {
|
|
|
6615
6618
|
unreadCount: thread.messages.filter((message) => threadFolders.includes(message.folder) && !message.isRead).length,
|
|
6616
6619
|
}
|
|
6617
6620
|
: thread;
|
|
6621
|
+
// Same per-call attachment trimming as every search/list tool — see
|
|
6622
|
+
// projectFields' comment. get_thread_by_id's messages carry full
|
|
6623
|
+
// MailboxMessage/EmailSummary objects (unlike get_threads' lean
|
|
6624
|
+
// ThreadSummary list, which has no per-message attachments at all).
|
|
6625
|
+
const result = { ...filteredThread, messages: filteredThread.messages.map(trimAttachmentsForListing) };
|
|
6618
6626
|
return createTextResult(result, false, [threadSource(result), ...result.messages.map((message) => emailSource({
|
|
6619
6627
|
id: message.primaryEmailId,
|
|
6620
6628
|
subject: message.subject,
|