mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-06-18 20:15:20 +02:00
email view
This commit is contained in:
parent
e4244a8ce5
commit
296f7c75b7
7 changed files with 1065 additions and 47 deletions
|
|
@ -102,6 +102,26 @@ export const EmailBlockSchema = z.object({
|
|||
|
||||
export type EmailBlock = z.infer<typeof EmailBlockSchema>;
|
||||
|
||||
export const GmailThreadMessageSchema = z.object({
|
||||
id: z.string().optional(),
|
||||
from: z.string().optional(),
|
||||
to: z.string().optional(),
|
||||
cc: z.string().optional(),
|
||||
date: z.string().optional(),
|
||||
subject: z.string().optional(),
|
||||
body: z.string().optional(),
|
||||
});
|
||||
|
||||
export type GmailThreadMessage = z.infer<typeof GmailThreadMessageSchema>;
|
||||
|
||||
export const GmailThreadSchema = EmailBlockSchema.extend({
|
||||
threadId: z.string(),
|
||||
threadUrl: z.string().url(),
|
||||
messages: z.array(GmailThreadMessageSchema),
|
||||
});
|
||||
|
||||
export type GmailThread = z.infer<typeof GmailThreadSchema>;
|
||||
|
||||
export const EmailsBlockSchema = z.object({
|
||||
title: z.string().optional(),
|
||||
emails: z.array(EmailBlockSchema),
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import { UserMessageContent } from './message.js';
|
|||
import { RowboatApiConfig } from './rowboat-account.js';
|
||||
import { ZListToolkitsResponse } from './composio.js';
|
||||
import { BrowserStateSchema } from './browser-control.js';
|
||||
import { EmailBlockSchema } from './blocks.js';
|
||||
import { GmailThreadSchema } from './blocks.js';
|
||||
|
||||
// ============================================================================
|
||||
// Runtime Validation Schemas (Single Source of Truth)
|
||||
|
|
@ -128,7 +128,7 @@ const ipcSchemas = {
|
|||
threadId: z.string().min(1),
|
||||
}),
|
||||
res: z.object({
|
||||
thread: EmailBlockSchema.nullable(),
|
||||
thread: GmailThreadSchema.nullable(),
|
||||
error: z.string().optional(),
|
||||
}),
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue