Accept .msg (Outlook) uploads alongside .eml
From the PR description
Outlook saves emails as proprietary binary OLE compound documents (.msg), not RFC 822. Extends the .eml work to also handle .msg by adding a parser that maps @kenjiuno/msgreader output onto the same ParsedEml shape - so the FE EmlView, the read_document tool, and the extractStructureTree branch all transparently support both formats.
Backend:
- backend/src/lib/extract/msg.ts - @kenjiuno/msgreader adapter that returns ParsedEml. Handles senderName+senderEmail combination, to/cc splitting by recipType, ISO date parsing, attachment listing (filenames only, no recursion).
- 6 vitest cases mocking msgreader's getFileData output to cover the adapter's edge cases (missing headers, name==email, unparseable date, dropped nameless attachments).
- upload.ts: msg added to SUPPORTED_DOC_TYPES; contentTypeForSuffix returns application/vnd.ms-outlook for msg.
- chatTools.read_document: msg branch using emlToLLMText for the shared rendering.
- documents.ts /display endpoint serves msg as application/vnd.mike.eml+json so the FE handles it identically to eml - no new viewer component needed.
- documents.ts + projects.ts extractStructureTree: msg shares the eml branch (subject becomes the single outline node).
Frontend:
- AddDocumentsModal, AddProjectDocsModal: accept= widened to .msg.
- ProjectPage SUPPORTED_UPLOAD_EXTS: msg added so drag-drop uploads succeed.
Tests: 117/117 backend tests pass (111 prior + 6 new). Backend tsc clean. Frontend tsc clean.
Our analysis
Accept Outlook .msg uploads alongside .eml — read the full analysis →
Think the analysis missed something the PR description covers?
Capture this PR into my fork
Download a Markdown prompt that tells Claude how to port every
commit in this PR into your working tree. Run it via
claude -p < capture-pull-11.md from
inside the repo you want the changes in.