/** * Wire-format contract for the email add-on: the email a model drafts and the * result of dispatching it. Pure (zod + inferred types, no Node-only imports) * so the server-side sender, the Mastra tool, and the React approval UI all * validate / type against one definition. * * Array fields intentionally avoid `.min()` / `.nonempty()`: those emit * `minItems` in the JSON schema, which some Model Serving endpoints reject * ("array types do not support minItems") when the schema is forwarded as a * tool definition. * * @module */ import { z } from "zod"; /** Schema for a single file attached to an outbound email. */ export declare const emailAttachmentSchema: z.ZodObject<{ filename: z.ZodString; content: z.ZodOptional; encoding: z.ZodOptional; contentType: z.ZodOptional; }, z.core.$strict>; /** A single file attached to an {@link EmailMessage}. */ export type EmailAttachment = z.infer; /** Schema for the email a model asks to send (the tool input). */ export declare const emailMessageSchema: z.ZodObject<{ to: z.ZodArray; subject: z.ZodString; body: z.ZodString; cc: z.ZodOptional>; bcc: z.ZodOptional>; attachments: z.ZodOptional; encoding: z.ZodOptional; contentType: z.ZodOptional; }, z.core.$strict>>>; }, z.core.$strip>; /** A validated outbound email message. */ export type EmailMessage = z.infer; /** Schema for the dispatch result returned to the model after a send. */ export declare const emailResultSchema: z.ZodObject<{ sent: z.ZodBoolean; recipient: z.ZodString; from: z.ZodString; messageId: z.ZodOptional; }, z.core.$strip>; /** The outcome of dispatching an {@link EmailMessage}. */ export type EmailResult = z.infer; /** * Schema for the sender options a UI can offer for the `From` address - the * payload of the plugin's `GET /senders` route. When the plugin configures a * sender allow-list, `senders` holds the concrete addresses the current user * may send as (domain wildcards expanded against the user's local part) and * `restricted` is true; a picker should require a choice from the list. When * unrestricted, `senders` holds at most the single default address (if one can * be resolved) and `restricted` is false, so a UI may allow free entry. */ export declare const emailSendersSchema: z.ZodObject<{ senders: z.ZodArray; defaultSender: z.ZodOptional; restricted: z.ZodBoolean; }, z.core.$strip>; /** Sender options for a `From` picker (see {@link emailSendersSchema}). */ export type EmailSenders = z.infer;