proton-mail-bridge-client 2.1.8 → 2.1.10
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 +2 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +38 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -404,7 +404,7 @@ All commands support `--json` for machine-readable output, and any MCP tool is d
|
|
|
404
404
|
All flags work in both the MCP server and CLI:
|
|
405
405
|
|
|
406
406
|
```bash
|
|
407
|
-
PROTONMAIL_TOOL_TIER=core # expose
|
|
407
|
+
PROTONMAIL_TOOL_TIER=core # expose 25 core tools instead of all 96 — saves context window
|
|
408
408
|
PROTONMAIL_READ_ONLY=true # disable all write operations
|
|
409
409
|
PROTONMAIL_ALLOW_SEND=false # disable SMTP sends only (other writes still work)
|
|
410
410
|
PROTONMAIL_CONFIRM_DESTRUCTIVE=true # require confirmed:true on send, reply, forward, delete
|
|
@@ -438,7 +438,7 @@ PROTONMAIL_PASSWORD_COMMAND='pass proton/password'
|
|
|
438
438
|
PROTONMAIL_DATA_DIR="$HOME/.proton-mail-bridge-client"
|
|
439
439
|
|
|
440
440
|
# Tools
|
|
441
|
-
PROTONMAIL_TOOL_TIER='full' # 'core' exposes
|
|
441
|
+
PROTONMAIL_TOOL_TIER='full' # 'core' exposes 25 essential tools, incl. draft review/edit and list_accounts (saves context window); 'full' exposes all 96
|
|
442
442
|
|
|
443
443
|
# Safety
|
|
444
444
|
PROTONMAIL_READ_ONLY='false'
|
package/dist/index.d.ts
CHANGED
|
@@ -8,9 +8,10 @@ import { LocalIndexService } from "./services/local-index-service.js";
|
|
|
8
8
|
import { SimpleIMAPService } from "./services/simple-imap-service.js";
|
|
9
9
|
import { SMTPService } from "./services/smtp-service.js";
|
|
10
10
|
import { SnoozeService } from "./services/snooze-service.js";
|
|
11
|
-
import type { BulkOperationResult, DraftRecord, EmailDetail, ProtonMailConfig, SendEmailInput } from "./types/index.js";
|
|
11
|
+
import type { BulkOperationResult, CitationSource, DraftRecord, EmailDetail, ProtonMailConfig, SendEmailInput } from "./types/index.js";
|
|
12
12
|
import { AccountManager, type AccountBundle } from "./services/account-manager.js";
|
|
13
13
|
export declare const CORE_TOOL_NAMES: Set<string>;
|
|
14
|
+
export declare function withSources<T>(value: T, _sources: CitationSource[]): T;
|
|
14
15
|
export declare function withAudit<T>(auditService: AuditService, tool: string, input: Record<string, unknown>, operation: () => Promise<T>): Promise<T>;
|
|
15
16
|
export declare function optionalClearableString(args: Record<string, unknown>, key: string): string | undefined;
|
|
16
17
|
export declare function headerString(headers: Record<string, unknown> | undefined, name: string): string | undefined;
|
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,
|
|
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,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wBAAgB,kBAAkB,IAAI,gBAAgB,CAkGrD;AAED,wBAAgB,YAAY,CAC1B,MAAM,EAAE,gBAAgB,EACxB,OAAO,GAAE;IACP,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0zIP;AAED,wBAAsB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAmE1C"}
|
package/dist/index.js
CHANGED
|
@@ -1708,8 +1708,22 @@ export const CORE_TOOL_NAMES = new Set([
|
|
|
1708
1708
|
"search_indexed_emails",
|
|
1709
1709
|
"send_email",
|
|
1710
1710
|
"reply_to_email",
|
|
1711
|
+
// reply_all_email/forward_email were missing here despite reply_to_email
|
|
1712
|
+
// being core — an asymmetry with no real reason behind it (all three are
|
|
1713
|
+
// equally routine day-to-day sends, confirmed by this session's own
|
|
1714
|
+
// multi-account/daily-scenarios testing).
|
|
1715
|
+
"reply_all_email",
|
|
1716
|
+
"forward_email",
|
|
1711
1717
|
"create_draft",
|
|
1712
1718
|
"send_draft",
|
|
1719
|
+
// list_drafts/get_draft/update_draft — found live: these are exactly as
|
|
1720
|
+
// routine as create_draft/send_draft (already core), just for the
|
|
1721
|
+
// review-before-sending step in between. Leaving them full-tier-only meant
|
|
1722
|
+
// "core" covered composing and sending a draft but not looking at or
|
|
1723
|
+
// editing it first.
|
|
1724
|
+
"list_drafts",
|
|
1725
|
+
"get_draft",
|
|
1726
|
+
"update_draft",
|
|
1713
1727
|
"trash_email",
|
|
1714
1728
|
"archive_email",
|
|
1715
1729
|
"mark_email_read",
|
|
@@ -1722,6 +1736,10 @@ export const CORE_TOOL_NAMES = new Set([
|
|
|
1722
1736
|
"get_folders",
|
|
1723
1737
|
"sync_emails",
|
|
1724
1738
|
"get_connection_status",
|
|
1739
|
+
// list_accounts — found live: with multi-account support (v2.1.0+), core
|
|
1740
|
+
// had no way to even see which accounts were configured or check their
|
|
1741
|
+
// connection status without switching to the full tier.
|
|
1742
|
+
"list_accounts",
|
|
1725
1743
|
]);
|
|
1726
1744
|
function citationToResourceLink(source) {
|
|
1727
1745
|
return {
|
|
@@ -1740,14 +1758,26 @@ function normalizeStructuredContent(value) {
|
|
|
1740
1758
|
}
|
|
1741
1759
|
return normalized;
|
|
1742
1760
|
}
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1761
|
+
// Found live (self-review, token-efficiency pass): this used to merge the full
|
|
1762
|
+
// CitationSource[] (uri, name, title, description, mimeType, provider, AND a
|
|
1763
|
+
// locator object repeating id/folder/from/subject/date) into the returned
|
|
1764
|
+
// payload — which then got serialized into content[0].text AND, separately,
|
|
1765
|
+
// into structuredContent (createTextResult always builds both). For a
|
|
1766
|
+
// search/list-style tool, almost every field in each source is ALREADY present
|
|
1767
|
+
// on the corresponding item in the tool's own result array (e.g.
|
|
1768
|
+
// search_indexed_emails' sources[].snippet duplicates emails[].preview
|
|
1769
|
+
// character-for-character, sources[].locator.subject duplicates
|
|
1770
|
+
// emails[].subject, etc.) — confirmed live at roughly doubling a 10-result
|
|
1771
|
+
// search's response size for zero new information. The same citation data is
|
|
1772
|
+
// already emitted, far more compactly, as its own resource_link content block
|
|
1773
|
+
// per source (see citationToResourceLink below) — no code in this repo (CLI,
|
|
1774
|
+
// tests, or index.ts itself) ever reads a result's `.sources` field back, so
|
|
1775
|
+
// nothing depends on it being embedded in the payload too. Kept as a
|
|
1776
|
+
// pass-through function (not deleted) so createTextResult's call sites don't
|
|
1777
|
+
// all need touching if a real reason to re-add a *trimmed* sources field ever
|
|
1778
|
+
// comes up.
|
|
1779
|
+
export function withSources(value, _sources) {
|
|
1780
|
+
return value;
|
|
1751
1781
|
}
|
|
1752
1782
|
function createTextResult(value, isError = false, sources = []) {
|
|
1753
1783
|
const payload = withSources(value, sources);
|