@bobfrankston/mailx-types 0.1.8 → 0.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/index.d.ts +27 -3
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -269,16 +269,40 @@ export interface AutocompleteResponse {
|
|
|
269
269
|
}
|
|
270
270
|
export interface AiTransformRequest {
|
|
271
271
|
/** translate = render in `targetLang`; proofread = corrected version
|
|
272
|
-
* with grammar/spelling fixes; summarize = short paragraph summary
|
|
273
|
-
|
|
272
|
+
* with grammar/spelling fixes; summarize = short paragraph summary;
|
|
273
|
+
* extractEvent = parse natural-language event description into a
|
|
274
|
+
* structured calendar event (title/start/end/location/notes). */
|
|
275
|
+
action: "translate" | "proofread" | "summarize" | "extractEvent";
|
|
274
276
|
text: string;
|
|
275
277
|
/** ISO-639-1 (or BCP-47) language code for translate. Defaults to "en". */
|
|
276
278
|
targetLang?: string;
|
|
279
|
+
/** Caller's "now" hint, ISO 8601 (e.g. 2026-05-05T18:30:00). Used by
|
|
280
|
+
* extractEvent to resolve relative dates ("tomorrow at 3pm"). The
|
|
281
|
+
* service can't trust its own clock — the user might be on a phone
|
|
282
|
+
* in a different timezone — so the caller supplies it. */
|
|
283
|
+
nowISO?: string;
|
|
284
|
+
}
|
|
285
|
+
/** Structured calendar event fields parsed from a natural-language
|
|
286
|
+
* description by aiTransform({ action: "extractEvent" }). All times are
|
|
287
|
+
* ISO 8601 in the caller's local timezone (no `Z` suffix); the client
|
|
288
|
+
* shapes them into Google Calendar's `dates=` URL parameter. */
|
|
289
|
+
export interface ExtractedEvent {
|
|
290
|
+
title: string;
|
|
291
|
+
startISO?: string;
|
|
292
|
+
endISO?: string;
|
|
293
|
+
allDay?: boolean;
|
|
294
|
+
location?: string;
|
|
295
|
+
notes?: string;
|
|
277
296
|
}
|
|
278
297
|
export interface AiTransformResponse {
|
|
279
298
|
/** Transformed text. Empty when AI is disabled / provider error / feature
|
|
280
|
-
* not enabled — caller should treat empty as "no result".
|
|
299
|
+
* not enabled — caller should treat empty as "no result". For
|
|
300
|
+
* extractEvent this holds the JSON-stringified ExtractedEvent so the
|
|
301
|
+
* response shape stays single-field across all actions. */
|
|
281
302
|
text: string;
|
|
303
|
+
/** Parsed ExtractedEvent, populated only for extractEvent. Lets the
|
|
304
|
+
* client skip the JSON.parse step (the service already validated). */
|
|
305
|
+
event?: ExtractedEvent;
|
|
282
306
|
/** Optional reason for empty result, surfaced to UI status bar. */
|
|
283
307
|
reason?: string;
|
|
284
308
|
}
|