mirror of
https://github.com/profullstack/logicsrc.git
synced 2026-08-14 14:57:28 +00:00
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:
parent
bf046ae280
commit
e304eac761
14 changed files with 908 additions and 1 deletions
40
plugins/agentmail/src/index.ts
Normal file
40
plugins/agentmail/src/index.ts
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import type { PluginDefinition } from "@logicsrc/plugin-core";
|
||||
import { agentMailManifest } from "./manifest.js";
|
||||
|
||||
export const agentMailPlugin: PluginDefinition = {
|
||||
manifest: agentMailManifest,
|
||||
configDefaults: {
|
||||
enabled: false,
|
||||
members_only: true,
|
||||
paid_only: true,
|
||||
domain: "${AGENTMAIL_DOMAIN}",
|
||||
imap_host: "${AGENTMAIL_IMAP_HOST}",
|
||||
imap_port: "${AGENTMAIL_IMAP_PORT}",
|
||||
smtp_host: "${AGENTMAIL_SMTP_HOST}",
|
||||
smtp_port: "${AGENTMAIL_SMTP_PORT}",
|
||||
backend_provider: "mailu"
|
||||
},
|
||||
routes: [
|
||||
{ method: "GET", path: "/api/plugins/agentmail/mailboxes", capability: "mailbox.list" },
|
||||
{ method: "GET", path: "/api/plugins/agentmail/mailboxes/:mailbox/messages", capability: "message.list" },
|
||||
{ method: "GET", path: "/api/plugins/agentmail/mailboxes/:mailbox/messages/:uid", capability: "message.read" },
|
||||
{ method: "GET", path: "/api/plugins/agentmail/search", capability: "message.search" },
|
||||
{ method: "POST", path: "/api/plugins/agentmail/messages", capability: "message.send" },
|
||||
{ method: "PATCH", path: "/api/plugins/agentmail/mailboxes/:mailbox/messages/:uid", capability: "message.flag" },
|
||||
{ method: "DELETE", path: "/api/plugins/agentmail/mailboxes/:mailbox/messages/:uid", capability: "message.delete" }
|
||||
],
|
||||
permissions: ["mail:read", "mail:search", "mail:compose", "mail:send", "mail:flag", "mail:delete"],
|
||||
tuiPanels: [{ id: "agentmail-inbox", title: "Mail" }]
|
||||
};
|
||||
|
||||
export { agentMailManifest };
|
||||
|
||||
// Domain, access, ports, service, and transports.
|
||||
export * from "./domain.js";
|
||||
export * from "./access.js";
|
||||
export * from "./ports.js";
|
||||
export * from "./service.js";
|
||||
export { InMemoryMailTransport } from "./transports/memory.js";
|
||||
export type { SeedMessage } from "./transports/memory.js";
|
||||
export { createMailuTransport, resolveMailuConfig } from "./transports/mailu.js";
|
||||
export type { MailuConfig, ImapDriver, SmtpDriver, CreateMailuTransportOptions } from "./transports/mailu.js";
|
||||
Loading…
Add table
Add a link
Reference in a new issue