/** * Connection manager for lazy-persistent IMAP and SMTP connections. * * - Creates connections on first use per account * - Reuses open connections across tool calls * - Auto-reconnects on failure * - Graceful shutdown closes all connections */ import type { ImapFlow } from 'imapflow'; import type { Transporter } from 'nodemailer'; import type OAuthService from '../services/oauth.service.js'; import type { AccountConfig } from '../types/index.js'; import type { IConnectionManager } from './types.js'; export default class ConnectionManager implements IConnectionManager { private imapClients; private smtpTransports; private accounts; private oauthService?; constructor(accounts: AccountConfig[], oauthService?: OAuthService); getAccount(name: string): AccountConfig; getAccountNames(): string[]; getImapClient(accountName: string): Promise; private static buildSmtpTransportOptions; getSmtpTransport(accountName: string, options?: { verify?: boolean; }): Promise; verifySmtpTransport(accountName: string): Promise; static testImap(account: AccountConfig, oauthService?: OAuthService): Promise<{ success: boolean; error?: string; /** What to do about a rejected credential, for the caller to render. */ hint?: string; details?: { messages: number; folders: number; }; }>; static testSmtp(account: AccountConfig, oauthService?: OAuthService): Promise<{ success: boolean; error?: string; hint?: string; }>; closeAll(): Promise; } //# sourceMappingURL=manager.d.ts.map