@mvrx/mail
v0.1.0
Published
AECS TypeScript SDK core: normalize raw MIME email into AI-ready NormalizedEmail objects.
Maintainers
Readme
@mvrx/mail
AECS TypeScript SDK core for turning raw RFC 5322/MIME email into NormalizedEmail
objects that are useful to AI agents and modern applications.
Current core
parse(source, options?)for raw strings, streams, bytes, and Cloudflareemail()messages- AECS-1 deterministic
threadIdresolution - UTC timestamp normalization
rawFull,raw,html,text,clean, andforAIcontent levels- HTML-to-text cleanup, conservative quote/signature stripping, and bounded
forAI - Lazy attachment metadata/content
EmailThread.from()for deterministic thread ordering and thread-level AI context- Prompt wrappers via
wrappers.xml(),wrappers.markdown(), andwrappers.block()
Example
import { parse, wrappers } from "@mvrx/mail";
export default {
async email(message: ForwardableEmailMessage) {
const email = await parse(message, {
wrapper: wrappers.xml("email"),
});
await fetch("https://agent.example.com/inbox", {
method: "POST",
body: JSON.stringify({
messageId: email.messageId,
threadId: email.threadId,
from: email.metadata.from,
subject: email.metadata.subject,
input: email.content.forAI,
}),
});
},
};Status
The core parser is implemented. Storage, sending, rules, EAS, MCP, and the hosted-service dashboard are later modules and must build on this public SDK surface rather than bypass it.
The normative structure is AECS-1 v1.0.0.
The broader SDK roadmap is ../../specs/AECS-SDK-1-specification.md.
License
AGPL-3.0-only. Commercial licensing is available from MVRX for closed-source embedding.
