Add AgentMail plugin: paid-member mailbox client for humans + agents

@logicsrc/plugin-agentmail provides read/search/compose/send/flag/delete
over an injected MailTransport, gated to Founding Lifetime (paid) members.
Returns plain JSON-serializable domain objects so the same API serves a
human TUI, the CLI, MCP, and bots.

- domain.ts: transport-agnostic types + pure helpers (parse/format address,
  normalizeDraft, isValidEmail, snippet)
- ports.ts: MailTransport seam
- service.ts: AgentMailService (inbox/list/read/search/send/reply/flag/delete)
- access.ts: paid-member gate (assertPaid) + capability constants
- transports/memory.ts: complete in-memory backend (tests/dev/reference)
- transports/mailu.ts: self-hosted Mailu seam (mail.profullstack.com IMAP +
  smtp.profullstack.com submission) with injected IMAP/SMTP drivers
- index.ts: PluginDefinition (manifest, routes, capabilities, tuiPanels)
- registered in the root build; 20 vitest tests pass

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Anthony Ettinger 2026-06-14 15:37:17 +00:00
parent bf046ae280
commit e304eac761
14 changed files with 908 additions and 1 deletions

View file

@ -0,0 +1,28 @@
import type { PluginManifest } from "@logicsrc/plugin-core";
export const agentMailManifest: PluginManifest = {
id: "agentmail",
name: "AgentMail",
version: "0.1.0",
type: ["communication", "email", "mailbox"],
default: false,
capabilities: [
"mailbox.list",
"message.list",
"message.read",
"message.search",
"message.compose",
"message.send",
"message.flag",
"message.delete",
"access.gate"
],
commands: ["mail", "inbox", "compose"],
env: [
"AGENTMAIL_DOMAIN",
"AGENTMAIL_IMAP_HOST",
"AGENTMAIL_IMAP_PORT",
"AGENTMAIL_SMTP_HOST",
"AGENTMAIL_SMTP_PORT"
]
};