/**
 * Known email provider defaults.
 * Maps domain → IMAP/SMTP host + port + security.
 * Used by email-setup to auto-infer connection settings.
 */
const providers = {
    "gmail.com": {
        imapHost: "imap.gmail.com",
        imapPort: 993,
        imapSecurity: "tls",
        smtpHost: "smtp.gmail.com",
        smtpPort: 587,
        smtpSecurity: "starttls",
        notes: "Requires an app-specific password (Google Account → Security → 2-Step Verification → App passwords). IMAP must be enabled in Gmail settings.",
    },
    "googlemail.com": {
        imapHost: "imap.gmail.com",
        imapPort: 993,
        imapSecurity: "tls",
        smtpHost: "smtp.gmail.com",
        smtpPort: 587,
        smtpSecurity: "starttls",
        notes: "Same as gmail.com — requires app-specific password.",
    },
    "outlook.com": {
        imapHost: "outlook.office365.com",
        imapPort: 993,
        imapSecurity: "tls",
        smtpHost: "smtp.office365.com",
        smtpPort: 587,
        smtpSecurity: "starttls",
        notes: "Requires an app password if 2FA is enabled (Microsoft Account → Security → App passwords).",
    },
    "hotmail.com": {
        imapHost: "outlook.office365.com",
        imapPort: 993,
        imapSecurity: "tls",
        smtpHost: "smtp.office365.com",
        smtpPort: 587,
        smtpSecurity: "starttls",
        notes: "Same as outlook.com — requires app password with 2FA.",
    },
    "live.com": {
        imapHost: "outlook.office365.com",
        imapPort: 993,
        imapSecurity: "tls",
        smtpHost: "smtp.office365.com",
        smtpPort: 587,
        smtpSecurity: "starttls",
        notes: "Same as outlook.com — requires app password with 2FA.",
    },
    "icloud.com": {
        imapHost: "imap.mail.me.com",
        imapPort: 993,
        imapSecurity: "tls",
        smtpHost: "smtp.mail.me.com",
        smtpPort: 587,
        smtpSecurity: "starttls",
        notes: "Requires an app-specific password (Apple ID → Sign-In and Security → App-Specific Passwords).",
    },
    "me.com": {
        imapHost: "imap.mail.me.com",
        imapPort: 993,
        imapSecurity: "tls",
        smtpHost: "smtp.mail.me.com",
        smtpPort: 587,
        smtpSecurity: "starttls",
        notes: "Same as icloud.com.",
    },
    "yahoo.com": {
        imapHost: "imap.mail.yahoo.com",
        imapPort: 993,
        imapSecurity: "tls",
        smtpHost: "smtp.mail.yahoo.com",
        smtpPort: 587,
        smtpSecurity: "starttls",
        notes: "Requires an app password (Yahoo Account → Account Security → Generate app password).",
    },
    "protonmail.com": {
        imapHost: "127.0.0.1",
        imapPort: 1143,
        imapSecurity: "starttls",
        smtpHost: "127.0.0.1",
        smtpPort: 1025,
        smtpSecurity: "starttls",
        notes: "Requires Proton Mail Bridge running locally. Bridge provides IMAP/SMTP on localhost.",
    },
    "proton.me": {
        imapHost: "127.0.0.1",
        imapPort: 1143,
        imapSecurity: "starttls",
        smtpHost: "127.0.0.1",
        smtpPort: 1025,
        smtpSecurity: "starttls",
        notes: "Same as protonmail.com — requires Proton Mail Bridge.",
    },
};
/**
 * Look up provider defaults from an email address domain.
 * Returns null for unknown domains — the agent must ask the user for hosts.
 */
export function inferProvider(email) {
    const domain = email.split("@")[1]?.toLowerCase();
    if (!domain)
        return null;
    return providers[domain] ?? null;
}
/**
 * Get provider-specific setup notes for an email domain.
 * Returns null for unknown domains.
 */
export function getProviderNotes(email) {
    const defaults = inferProvider(email);
    return defaults?.notes ?? null;
}
//# sourceMappingURL=providers.js.map