/** * The Gmail layer: authenticated clients, MIME parsing and MIME building. * * Everything that touches `gmail_v1` lives here so the rest of the codebase * works with the clean types from `./types.js`. */ import { type gmail_v1 } from '@googleapis/gmail'; import type { AccountId, DraftResult, EmailMessage, EmailSummary, LabelInfo, OutgoingMessage, SendResult, ThreadResult, TrashResult } from './types.js'; import { GmailMcpError } from './types.js'; /** Resolves an account reference (email or alias) and returns a ready client. */ export declare function gmailFor(reference: AccountId): Promise<{ email: AccountId; api: gmail_v1.Gmail; }>; /** * Gmail-flavoured wrapper over the shared mapper. * * Kept as its own name because every call site inside `gmail/` reads better for * it, and because the service label is what tells a user which of the three APIs * refused them. */ export declare function mapGmailError(error: unknown, account?: AccountId): GmailMcpError; export declare function parseMessage(account: AccountId, message: gmail_v1.Schema$Message): EmailMessage; export declare function summarizeMessage(account: AccountId, message: gmail_v1.Schema$Message): EmailSummary; export declare function buildRawMessage(from: AccountId, message: OutgoingMessage): string; export declare function fetchMessage(reference: AccountId, messageId: string): Promise; export declare function fetchThread(reference: AccountId, threadId: string): Promise; export declare function listLabels(reference: AccountId): Promise<{ account: AccountId; labels: LabelInfo[]; }>; export declare function labelMessage(reference: AccountId, messageId: string, addLabels: string[], removeLabels: string[]): Promise; export declare function createDraft(reference: AccountId, message: OutgoingMessage): Promise; export declare function sendMessage(reference: AccountId, message: OutgoingMessage): Promise; /** * Replies to a message, keeping the thread intact. * * Threading needs three things and all three are easy to forget: the same * `threadId`, an `In-Reply-To` pointing at the original `Message-ID`, and a * `References` chain. Omit them and the reply shows up as a new conversation. */ export declare function replyToMessage(reference: AccountId, messageId: string, body: string, options?: { replyAll?: boolean; isHtml?: boolean; }): Promise; /** Live probe used by `list_accounts` to report more than "a file exists". */ export declare function probeAccount(reference: AccountId): Promise<{ emailAddress: string; messagesTotal: number; }>; /** Moves a message to the bin. Recoverable with `untrashMessage` for 30 days. */ export declare function trashMessage(reference: AccountId, messageId: string): Promise; /** Takes a message back out of the bin, restoring its previous labels. */ export declare function untrashMessage(reference: AccountId, messageId: string): Promise; //# sourceMappingURL=client.d.ts.map