Files
nanobot/nanobot/channels/email/webui/index.ts
T
chengyongru 328e933d36 refactor: isolate runtime contracts and enforce import boundaries (#6166)
* test: enforce Python import ownership boundaries

* test: protect client import boundaries and rehome shared UI contracts

* refactor: remove gateway and client dependency inversions

* fix: detect dynamic imports in conditional expressions

* refactor(tools): keep configuration contracts with their owners

* docs: keep design guidance focused on ownership and checks

* fix: preserve default threaded turn delivery
2026-10-13 13:56:28 +08:00

69 lines
2.3 KiB
TypeScript

import { Mail } from "lucide-react";
import type { ChannelUiContribution } from "@/channel-plugins/types";
import {
type ChannelProviderPresetDefinition,
chatAppGuideUrl,
} from "@/channel-plugins/catalog";
const EMAIL_PROVIDER_PRESETS: ChannelProviderPresetDefinition[] = [
{
id: "gmail",
values: {
"channels.email.imapHost": "imap.gmail.com",
"channels.email.imapPort": "993",
"channels.email.smtpHost": "smtp.gmail.com",
"channels.email.smtpPort": "587",
},
},
{
id: "outlook",
values: {
"channels.email.imapHost": "outlook.office365.com",
"channels.email.imapPort": "993",
"channels.email.smtpHost": "smtp.office365.com",
"channels.email.smtpPort": "587",
},
},
{
id: "icloud",
values: {
"channels.email.imapHost": "imap.mail.me.com",
"channels.email.imapPort": "993",
"channels.email.smtpHost": "smtp.mail.me.com",
"channels.email.smtpPort": "587",
},
},
];
export default {
presentation: {
icon: Mail,
displayName: "Email",
initials: "EM",
color: "#64748B",
setup: {
mode: "credentials",
docsUrl: chatAppGuideUrl("email"),
presets: EMAIL_PROVIDER_PRESETS,
fields: [
{ key: "channels.email.consentGranted", section: "account" },
{ key: "channels.email.imapHost", section: "receiving" },
{ key: "channels.email.imapUsername", section: "receiving" },
{ key: "channels.email.imapPassword", section: "receiving" },
{ key: "channels.email.imapPort", section: "receiving" },
{ key: "channels.email.smtpHost", section: "sending" },
{ key: "channels.email.smtpUsername", section: "sending" },
{ key: "channels.email.smtpPassword", section: "sending" },
{ key: "channels.email.smtpPort", section: "sending" },
{ key: "channels.email.fromAddress", section: "sending" },
{ key: "channels.email.pollIntervalSeconds", section: "behavior" },
{ key: "channels.email.allowFrom", section: "access" },
{ key: "channels.email.verifyDkim", section: "security" },
{ key: "channels.email.verifySpf", section: "security" },
{ key: "channels.email.trustedAuthservIds", section: "security" },
],
},
},
} satisfies ChannelUiContribution;