feat(commandboard-api): AgentMail (agentbbs mailbox) routes#86
Conversation
Mount @logicsrc/plugin-agentmail in the CommandBoard API so members can list/read/search/send mail over the existing agentbbs Mailu server. - src/agentmail.ts: inject imapflow + nodemailer + mailparser drivers into the plugin's Mailu transport (kept out of the plugin by design); env-driven builder (AGENTMAIL_BACKEND=mailu → bbs Mailu, else in-memory singleton for dev/test). Handles STARTTLS cert-vs-loopback via AGENTMAIL_SMTP_TLS_SERVERNAME. - index.ts: register agentMailPlugin + 7 routes under /api/plugins/agentmail/* (mailboxes, list, read, search, send, PATCH flags, delete). Acting member from x-agentmail-member header (else AGENTMAIL_MEMBER), paid-gated; MailAccessError->402, DraftError->422. - 6 route tests (in-memory backend) + contract test plugin-id list updated. commandboard-api 20/20, builds clean. Note: run `npm install` to refresh the lockfile for the 3 new deps. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
vu1nz Security Review0 finding(s) in PR #? No security issues found. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
PR #86 added imapflow, nodemailer, mailparser (+types) to commandboard-api but did not refresh package-lock.json, so Railway's `npm ci` failed with EUSAGE (lockfile out of sync). Regenerate the lockfile; no package.json change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Mounts the existing
@logicsrc/plugin-agentmailpackage in the CommandBoard API so members can list / read / search / send mail over the existing agentbbs Mailu server — no new mail infra, no DNS.What's added
apps/commandboard-api/src/agentmail.ts— supplies the IMAP/SMTP drivers the plugin leaves injectable (it ships no network libs by design): imapflow + mailparser (list/read/search/flag/delete) and nodemailer (send), mapped to the plugin's domain types. Env-driven builder:AGENTMAIL_BACKEND=mailu→ real bbs Mailu, otherwise an in-memory singleton so the API boots/tests without a live server. Handles the STARTTLS cert-vs-loopback gotcha viaAGENTMAIL_SMTP_TLS_SERVERNAME.index.ts— registersagentMailPluginand its 7 declared routes under/api/plugins/agentmail/:GET /mailboxes·GET /mailboxes/:mailbox/messages·GET …/:uid·GET /search?q=·POST /messages·PATCH …/:uid(flags) ·DELETE …/:uidx-agentmail-memberheader (elseAGENTMAIL_MEMBER, defaultchovy), paid-gated.MailAccessError→402,DraftError→422.Config for real bbs mail
AGENTMAIL_BACKEND=mailu,AGENTMAIL_USER/AGENTMAIL_PASS(mailbox creds),AGENTMAIL_IMAP_HOST/AGENTMAIL_SMTP_HOST=mail.profullstack.com,AGENTMAIL_SMTP_TLS_SERVERNAME=mail.profullstack.com. Plus-addressing (chovy+<tag>@…) needsRECIPIENT_DELIMITER=+on the bbs Mailu.Notes
npm installto pick up the 3 new deps.🤖 Generated with Claude Code