@bobfrankston/mailx-types 0.1.100 → 0.1.104
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/index.d.ts +7 -0
- package/index.js +14 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -349,6 +349,13 @@ export interface ExtractedEvent {
|
|
|
349
349
|
timeZone?: string;
|
|
350
350
|
location?: string;
|
|
351
351
|
notes?: string;
|
|
352
|
+
/** True when the text records someone's birthday as a yearly date to
|
|
353
|
+
* remember ("Ann's birthday is March 5"), not a party at a time. The
|
|
354
|
+
* service creates it as a Google birthday event: all-day, repeats yearly. */
|
|
355
|
+
birthday?: boolean;
|
|
356
|
+
/** True when the text says the time is not blocked (free / tentative /
|
|
357
|
+
* optional / FYI). Sent to Google as transparency "transparent". */
|
|
358
|
+
free?: boolean;
|
|
352
359
|
}
|
|
353
360
|
export interface AiTransformResponse {
|
|
354
361
|
/** Transformed text. Empty when AI is disabled / provider error / feature
|
package/index.js
CHANGED
|
@@ -308,6 +308,20 @@ export function htmlToPlainText(html) {
|
|
|
308
308
|
const t = text.replace(/<[^>]+>/g, "").trim();
|
|
309
309
|
return t && t !== href ? `${t} (${href})` : href;
|
|
310
310
|
});
|
|
311
|
+
// 2026-09-16 — Claude Code (Fable 5.1), at Bob's direction. Images were
|
|
312
|
+
// stripped with the other tags, so the text/plain alternative of a mail
|
|
313
|
+
// whose point was a picture said nothing about it. A remote image keeps
|
|
314
|
+
// its URL (the plain-text reader can follow it); an inline data:/cid:
|
|
315
|
+
// image has no address a text reader can use, so it becomes a placeholder
|
|
316
|
+
// with the alt text. Same "text (url)" shape as anchors above.
|
|
317
|
+
s = s.replace(/<img\b[^>]*>/gi, (tag) => {
|
|
318
|
+
const src = (tag.match(/\bsrc\s*=\s*(['"])([^'"]*)\1/i) || [])[2]?.trim() || "";
|
|
319
|
+
const alt = (tag.match(/\balt\s*=\s*(['"])([^'"]*)\1/i) || [])[2]?.trim() || "";
|
|
320
|
+
const remote = /^https?:\/\//i.test(src);
|
|
321
|
+
if (remote)
|
|
322
|
+
return alt ? `[image: ${alt}] (${src})` : `(${src})`;
|
|
323
|
+
return alt ? `[image: ${alt}]` : "[image]";
|
|
324
|
+
});
|
|
311
325
|
// Strip remaining tags.
|
|
312
326
|
s = s.replace(/<[^>]+>/g, "");
|
|
313
327
|
// Decode a pragmatic set of HTML entities — the rare ones survive as-is.
|