@bobfrankston/mailx-settings 0.1.15 → 0.1.17

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/docs/accounts.md CHANGED
@@ -47,7 +47,7 @@
47
47
  - **imap / smtp** — explicit server config. Omit for known providers (Gmail / Outlook / Yahoo / iCloud / Google Workspace are detected from the email domain via MX records).
48
48
  - **auth** — `"password"` for traditional IMAP/SMTP, `"oauth2"` for Gmail/Google Workspace/Outlook.
49
49
  - **enabled** — set `false` to keep the account record but skip sync at startup.
50
- - **identityDomains** — addresses you receive at on alternative domains. When you Reply, rmfmail picks the matching identity address as From instead of the account's primary.
50
+ - **identityDomains** — domains you treat as "yours" for Reply-From detection. When you Reply, rmfmail looks at the original message's To/Cc; if any address is on one of these domains (exact match OR any subdomain), Reply uses that address as the From. Default if omitted is just the domain of `email` above. Matching is case-insensitive. Subdomain folding is automatic — listing both `frankston.com` and `bobf.frankston.com` is the same as listing just `frankston.com` (the longer entry is dropped at load time). Different domains (`bobfrankston.com` vs `frankston.com` — distinct DNS, no subsumption) stay separate. Example: `"identityDomains": ["bob.ma", "bobfrankston.com", "frankston.com"]`.
51
51
  - **sig** — per-account signature for *new* messages (skipped on reply / forward / draft-resume). `text` is the plain-text body, HTML-escaped at insertion with `\n` → `<br>`. The optional `html` flag is reserved for "trust as raw HTML"; leave it `false` (or omit) for now. Specify either `sig` or `signature`, not both — `sig` wins if both are present and the message is new. May also be specified at the **file level** (alongside `name`) to apply across every account that doesn't define its own; per-account always wins over file-level.
52
52
  - **signature** — legacy alternative: an HTML string applied to *new + reply + forward* (positioned before the quote on replies, at the end for new messages). Useful when you want the signature on every outgoing message regardless of context. Also supported at the **file level** as a global fallback.
53
53
  - **keys.anthropic / keys.openai** — API keys for the AI features (translate / proofread / summarize / autocomplete). Lives at the file's top level alongside `accounts:` so you set it once across all your devices. Generated at console.anthropic.com or platform.openai.com. Provider selection is in `preferences.jsonc`; the key here is read based on which provider is active. Empty string means "not configured" — the AI feature silently no-ops. Local Ollama provider needs no key.
package/index.d.ts CHANGED
@@ -153,6 +153,13 @@ export declare function saveAutocomplete(settings: AutocompleteSettings): void;
153
153
  export declare function loadAllowlist(): typeof DEFAULT_ALLOWLIST;
154
154
  /** Save allow-list — merges with existing cloud copy (multi-client safe) */
155
155
  export declare function saveAllowlist(list: typeof DEFAULT_ALLOWLIST): Promise<void>;
156
+ /** Load user-added dictionary words. Mirrored to GDrive so "Add to dictionary"
157
+ * on one machine appears on every machine. Same multi-client merge pattern
158
+ * as allowlist. Returns a string array; duplicates removed by saveUserDict. */
159
+ export declare function loadUserDict(): string[];
160
+ /** Save user dictionary — merges with cloud copy so concurrent edits on
161
+ * different machines union rather than overwrite. */
162
+ export declare function saveUserDict(words: string[]): Promise<void>;
156
163
  /** Load settings — unified view combining all files (backward compatible) */
157
164
  export declare function loadSettings(): MailxSettings;
158
165
  export declare function saveSettings(settings: MailxSettings): Promise<void>;
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAyG5G,QAAA,MAAM,SAAS,QAA4E,CAAC;AAiE5F,qFAAqF;AACrF,KAAK,kBAAkB,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAAE,OAAO,CAAC,EAAE;IAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,KAAK,IAAI,CAAC;AAE/G,wBAAgB,YAAY,CAAC,EAAE,EAAE,kBAAkB,GAAG,MAAM,IAAI,CAM/D;AAOD,wBAAgB,iBAAiB,IAAI,MAAM,GAAG,IAAI,CAA2B;AAU7E,iBAAS,YAAY,IAAI,MAAM,CAgB9B;AAOD,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FAEgF;AAChF,wBAAgB,YAAY,IAAI,MAAM,EAAE,CAGvC;AAED;sDACsD;AACtD,wBAAsB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAajE;AAcD,6EAA6E;AAC7E,wBAAgB,YAAY,IAAI,aAAa,CA0B5C;AAyBD,wBAAsB,YAAY,CAAC,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAkBzE;AAED,oCAAoC;AACpC,wBAAgB,YAAY,IAAI,MAAM,CAGrC;AAED,qDAAqD;AACrD,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED,wCAAwC;AACxC,OAAO,EAAE,YAAY,EAAE,CAAC;AAKxB,kDAAkD;AAClD,wBAAgB,eAAe,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAkB5E;AAED;;;mFAGmF;AACnF,wBAAsB,eAAe,CAAC,QAAQ,GAAE,QAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAclF;AAED,QAAA,MAAM,gBAAgB,EAAE,aAMvB,CAAC;AAEF,8FAA8F;AAC9F,wBAAgB,cAAc,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAQzD;AAED,uEAAuE;AACvE,wBAAgB,WAAW,IAAI,OAAO,CAGrC;AAED,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,SAAS,EAAE,CAAC;AAErG;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAoDlE"}
package/index.js CHANGED
@@ -1047,6 +1047,30 @@ export async function saveAllowlist(list) {
1047
1047
  catch { /* cloud read failed — save local version */ }
1048
1048
  saveFile("allowlist.jsonc", merged);
1049
1049
  }
1050
+ /** Load user-added dictionary words. Mirrored to GDrive so "Add to dictionary"
1051
+ * on one machine appears on every machine. Same multi-client merge pattern
1052
+ * as allowlist. Returns a string array; duplicates removed by saveUserDict. */
1053
+ export function loadUserDict() {
1054
+ const raw = loadFile("userdict.jsonc", { words: [] });
1055
+ return Array.isArray(raw?.words) ? raw.words : [];
1056
+ }
1057
+ /** Save user dictionary — merges with cloud copy so concurrent edits on
1058
+ * different machines union rather than overwrite. */
1059
+ export async function saveUserDict(words) {
1060
+ let merged = [...new Set(words)];
1061
+ try {
1062
+ const cloudContent = await cloudRead("userdict.jsonc");
1063
+ if (cloudContent) {
1064
+ const cloud = parseJsonc(cloudContent);
1065
+ if (cloud && Array.isArray(cloud.words)) {
1066
+ merged = [...new Set([...merged, ...cloud.words])];
1067
+ }
1068
+ }
1069
+ }
1070
+ catch { /* cloud unreachable — save local version */ }
1071
+ merged.sort();
1072
+ saveFile("userdict.jsonc", { words: merged });
1073
+ }
1050
1074
  // ── Legacy compatibility ──
1051
1075
  function loadLegacySettings() {
1052
1076
  const config = readLocalConfig();
@@ -1249,11 +1273,21 @@ export async function deployDocs(appVersion) {
1249
1273
  console.log(" [docs] no docs/ dir found in package — skipping deploy");
1250
1274
  return;
1251
1275
  }
1276
+ // Whitelist: only deploy docs that document a `.jsonc` config file or a
1277
+ // user-facing feature. Internal release-notes / publishing playbooks
1278
+ // (`prod.md`, `prod-android.md`, `npmglobalize-disttag.md`, `rmf-tiny.md`,
1279
+ // `push-relay.md`, etc.) live in the same docs/ folder for developer
1280
+ // reference but have no business on the user's GDrive.
1281
+ const USER_DOC_WHITELIST = new Set([
1282
+ "accounts.md", "allowlist.md", "clients.md", "config.md",
1283
+ "contacts.md", "contact-rules.md", "preferences.md",
1284
+ "editor.md", "search.md",
1285
+ ]);
1252
1286
  try {
1253
1287
  const deployedVersion = (await provider.read(".docs-version") || "").trim();
1254
1288
  if (deployedVersion === appVersion)
1255
1289
  return; // already up to date
1256
- const mdFiles = fs.readdirSync(docsDir).filter(f => f.endsWith(".md"));
1290
+ const mdFiles = fs.readdirSync(docsDir).filter(f => f.endsWith(".md") && USER_DOC_WHITELIST.has(f));
1257
1291
  // Parallel cloud writes — each provider.write is independent.
1258
1292
  // The previous serial loop took ~5-10 s for the 9 .md files
1259
1293
  // because every write was one round-trip to GDrive. The doc-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/mailx-settings",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "license": "ISC",
19
19
  "dependencies": {
20
- "@bobfrankston/mailx-types": "^0.1.11",
20
+ "@bobfrankston/mailx-types": "^0.1.13",
21
21
  "jsonc-parser": "^3.3.1"
22
22
  },
23
23
  "repository": {
@@ -33,7 +33,7 @@
33
33
  },
34
34
  ".transformedSnapshot": {
35
35
  "dependencies": {
36
- "@bobfrankston/mailx-types": "^0.1.11",
36
+ "@bobfrankston/mailx-types": "^0.1.13",
37
37
  "jsonc-parser": "^3.3.1"
38
38
  }
39
39
  }