src / config.ts
src / config.ts
import { createConfigSchematics } from "@lmstudio/sdk";
export const pluginConfigSchematics = createConfigSchematics()
// Account 1
.field(
"account1Label",
"string",
{
displayName: "Account 1 — Label",
subtitle: "Friendly name shown in tool responses (for example: Personal or Gmail).",
},
"Personal",
)
.field(
"account1ImapHost",
"string",
{
displayName: "Account 1 — IMAP Host",
subtitle: "For example: imap.gmail.com or imap.mail.yahoo.com.",
},
"",
)
.field(
"account1ImapPort",
"numeric",
{
int: true,
min: 1,
max: 65535,
displayName: "Account 1 — IMAP Port",
subtitle: "993 = TLS (recommended); 143 = STARTTLS where supported.",
},
993,
)
.field(
"account1User",
"string",
{
displayName: "Account 1 — Email Address",
subtitle: "Full address used as the IMAP/SMTP username.",
},
"",
)
.field(
"account1Password",
"string",
{
displayName: "Account 1 — Password / App Password",
subtitle: "Prefer a provider-issued app password. The value is obscured in LM Studio.",
isProtected: true,
},
"",
)
.field(
"account1SmtpHost",
"string",
{
displayName: "Account 1 — SMTP Host",
subtitle: "For example: smtp.gmail.com. Leave blank if this account is read-only.",
},
"",
)
.field(
"account1SmtpPort",
"numeric",
{
int: true,
min: 1,
max: 65535,
displayName: "Account 1 — SMTP Port",
subtitle: "587 = STARTTLS (recommended); 465 = implicit TLS.",
},
587,
)
// Account 2
.field(
"account2Label",
"string",
{
displayName: "Account 2 — Label",
subtitle: "Friendly name. Leave the account credentials blank to disable this slot.",
},
"",
)
.field("account2ImapHost", "string", { displayName: "Account 2 — IMAP Host" }, "")
.field(
"account2ImapPort",
"numeric",
{ int: true, min: 1, max: 65535, displayName: "Account 2 — IMAP Port" },
993,
)
.field("account2User", "string", { displayName: "Account 2 — Email Address" }, "")
.field(
"account2Password",
"string",
{ displayName: "Account 2 — Password / App Password", isProtected: true },
"",
)
.field(
"account2SmtpHost",
"string",
{
displayName: "Account 2 — SMTP Host",
subtitle: "Leave blank if this account is read-only.",
},
"",
)
.field(
"account2SmtpPort",
"numeric",
{ int: true, min: 1, max: 65535, displayName: "Account 2 — SMTP Port" },
587,
)
// Account 3
.field(
"account3Label",
"string",
{
displayName: "Account 3 — Label",
subtitle: "Friendly name. Leave the account credentials blank to disable this slot.",
},
"",
)
.field("account3ImapHost", "string", { displayName: "Account 3 — IMAP Host" }, "")
.field(
"account3ImapPort",
"numeric",
{ int: true, min: 1, max: 65535, displayName: "Account 3 — IMAP Port" },
993,
)
.field("account3User", "string", { displayName: "Account 3 — Email Address" }, "")
.field(
"account3Password",
"string",
{ displayName: "Account 3 — Password / App Password", isProtected: true },
"",
)
.field(
"account3SmtpHost",
"string",
{
displayName: "Account 3 — SMTP Host",
subtitle: "Leave blank if this account is read-only.",
},
"",
)
.field(
"account3SmtpPort",
"numeric",
{ int: true, min: 1, max: 65535, displayName: "Account 3 — SMTP Port" },
587,
)
// Shared behavior and hard capability gates
.field(
"defaultFolder",
"string",
{
displayName: "Default Folder",
subtitle: "Mailbox used when a tool call leaves folder blank (normally INBOX).",
},
"INBOX",
)
.field(
"maxResults",
"numeric",
{
int: true,
min: 1,
max: 200,
displayName: "Max Results",
subtitle: "Default result count for list and search calls.",
slider: { min: 5, max: 100, step: 5 },
},
20,
)
.field(
"maxEmailBodyChars",
"numeric",
{
int: true,
min: 1000,
max: 500000,
displayName: "Maximum Email Body Characters",
subtitle: "Longer message bodies are truncated before being returned to the model.",
},
50000,
)
.field(
"enableSending",
"boolean",
{
displayName: "Expose email_send",
subtitle: "Off by default. Enabling exposes an irreversible SMTP send tool to the model.",
},
false,
)
.field(
"enableTrash",
"boolean",
{
displayName: "Expose email_delete",
subtitle: "Off by default. Enabling lets the model move selected messages to Trash.",
},
false,
)
.build();
import { createConfigSchematics } from "@lmstudio/sdk";
export const pluginConfigSchematics = createConfigSchematics()
// Account 1
.field(
"account1Label",
"string",
{
displayName: "Account 1 — Label",
subtitle: "Friendly name shown in tool responses (for example: Personal or Gmail).",
},
"Personal",
)
.field(
"account1ImapHost",
"string",
{
displayName: "Account 1 — IMAP Host",
subtitle: "For example: imap.gmail.com or imap.mail.yahoo.com.",
},
"",
)
.field(
"account1ImapPort",
"numeric",
{
int: true,
min: 1,
max: 65535,
displayName: "Account 1 — IMAP Port",
subtitle: "993 = TLS (recommended); 143 = STARTTLS where supported.",
},
993,
)
.field(
"account1User",
"string",
{
displayName: "Account 1 — Email Address",
subtitle: "Full address used as the IMAP/SMTP username.",
},
"",
)
.field(
"account1Password",
"string",
{
displayName: "Account 1 — Password / App Password",
subtitle: "Prefer a provider-issued app password. The value is obscured in LM Studio.",
isProtected: true,
},
"",
)
.field(
"account1SmtpHost",
"string",
{
displayName: "Account 1 — SMTP Host",
subtitle: "For example: smtp.gmail.com. Leave blank if this account is read-only.",
},
"",
)
.field(
"account1SmtpPort",
"numeric",
{
int: true,
min: 1,
max: 65535,
displayName: "Account 1 — SMTP Port",
subtitle: "587 = STARTTLS (recommended); 465 = implicit TLS.",
},
587,
)
// Account 2
.field(
"account2Label",
"string",
{
displayName: "Account 2 — Label",
subtitle: "Friendly name. Leave the account credentials blank to disable this slot.",
},
"",
)
.field("account2ImapHost", "string", { displayName: "Account 2 — IMAP Host" }, "")
.field(
"account2ImapPort",
"numeric",
{ int: true, min: 1, max: 65535, displayName: "Account 2 — IMAP Port" },
993,
)
.field("account2User", "string", { displayName: "Account 2 — Email Address" }, "")
.field(
"account2Password",
"string",
{ displayName: "Account 2 — Password / App Password", isProtected: true },
"",
)
.field(
"account2SmtpHost",
"string",
{
displayName: "Account 2 — SMTP Host",
subtitle: "Leave blank if this account is read-only.",
},
"",
)
.field(
"account2SmtpPort",
"numeric",
{ int: true, min: 1, max: 65535, displayName: "Account 2 — SMTP Port" },
587,
)
// Account 3
.field(
"account3Label",
"string",
{
displayName: "Account 3 — Label",
subtitle: "Friendly name. Leave the account credentials blank to disable this slot.",
},
"",
)
.field("account3ImapHost", "string", { displayName: "Account 3 — IMAP Host" }, "")
.field(
"account3ImapPort",
"numeric",
{ int: true, min: 1, max: 65535, displayName: "Account 3 — IMAP Port" },
993,
)
.field("account3User", "string", { displayName: "Account 3 — Email Address" }, "")
.field(
"account3Password",
"string",
{ displayName: "Account 3 — Password / App Password", isProtected: true },
"",
)
.field(
"account3SmtpHost",
"string",
{
displayName: "Account 3 — SMTP Host",
subtitle: "Leave blank if this account is read-only.",
},
"",
)
.field(
"account3SmtpPort",
"numeric",
{ int: true, min: 1, max: 65535, displayName: "Account 3 — SMTP Port" },
587,
)
// Shared behavior and hard capability gates
.field(
"defaultFolder",
"string",
{
displayName: "Default Folder",
subtitle: "Mailbox used when a tool call leaves folder blank (normally INBOX).",
},
"INBOX",
)
.field(
"maxResults",
"numeric",
{
int: true,
min: 1,
max: 200,
displayName: "Max Results",
subtitle: "Default result count for list and search calls.",
slider: { min: 5, max: 100, step: 5 },
},
20,
)
.field(
"maxEmailBodyChars",
"numeric",
{
int: true,
min: 1000,
max: 500000,
displayName: "Maximum Email Body Characters",
subtitle: "Longer message bodies are truncated before being returned to the model.",
},
50000,
)
.field(
"enableSending",
"boolean",
{
displayName: "Expose email_send",
subtitle: "Off by default. Enabling exposes an irreversible SMTP send tool to the model.",
},
false,
)
.field(
"enableTrash",
"boolean",
{
displayName: "Expose email_delete",
subtitle: "Off by default. Enabling lets the model move selected messages to Trash.",
},
false,
)
.build();