@bobfrankston/mailx-types 0.1.6 → 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 +36 -3
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -249,6 +249,15 @@ export interface AutocompleteSettings {
|
|
|
249
249
|
translateEnabled?: boolean;
|
|
250
250
|
proofreadEnabled?: boolean;
|
|
251
251
|
}
|
|
252
|
+
/** AI provider API keys. Lives at the top of `accounts.jsonc` alongside
|
|
253
|
+
* `accounts:` so all secrets are co-located in one cloud-synced file. The
|
|
254
|
+
* keys field replaces `preferences.jsonc.autocomplete.cloudApiKey` (which
|
|
255
|
+
* was tied to the *active* provider) so a user can set both Anthropic and
|
|
256
|
+
* OpenAI keys once and switch providers without re-entering anything. */
|
|
257
|
+
export interface AiKeys {
|
|
258
|
+
anthropic?: string;
|
|
259
|
+
openai?: string;
|
|
260
|
+
}
|
|
252
261
|
export interface AutocompleteRequest {
|
|
253
262
|
subject: string;
|
|
254
263
|
to: string;
|
|
@@ -260,16 +269,40 @@ export interface AutocompleteResponse {
|
|
|
260
269
|
}
|
|
261
270
|
export interface AiTransformRequest {
|
|
262
271
|
/** translate = render in `targetLang`; proofread = corrected version
|
|
263
|
-
* with grammar/spelling fixes; summarize = short paragraph summary
|
|
264
|
-
|
|
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";
|
|
265
276
|
text: string;
|
|
266
277
|
/** ISO-639-1 (or BCP-47) language code for translate. Defaults to "en". */
|
|
267
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;
|
|
268
296
|
}
|
|
269
297
|
export interface AiTransformResponse {
|
|
270
298
|
/** Transformed text. Empty when AI is disabled / provider error / feature
|
|
271
|
-
* 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. */
|
|
272
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;
|
|
273
306
|
/** Optional reason for empty result, surfaced to UI status bar. */
|
|
274
307
|
reason?: string;
|
|
275
308
|
}
|