feat: IMAP mail sync with thread-to-contact matching (PRD §6.1)
Real IMAP connection via imapflow library: - Connects to IMAP server (IMAPFlow, TLS on port 993) - Fetches recent messages (configurable limit, default 20) - Extracts: from, fromEmail, subject, date, snippet (200 chars) - Thread-to-contact matching (PRD §6.1): 1. Match sender email against persons table 2. If no person match, extract domain and match against company.website 3. Returns matchedCompany + matchedPerson for each email - Audit-logged (action: crm.mailsync:imap) - Zod validated (host, port, user, password, folder, limit) - 502 on IMAP connection failure with detail - 400 on validation failure Tested: invalid creds → 502 'IMAP connection failed', missing host → 400
This commit is contained in:
1 parent
7acc0c5451
commit
e45b68bb8b
1089 files changed
+260614
No files matched your search
@@ -0,0 +1,70 @@
|
||||
---
|
||||
name: Parchment
|
||||
colors:
|
||||
primary: "#1B365D"
|
||||
secondary: "#2D5A8A"
|
||||
success: "#16A34A"
|
||||
warning: "#D97706"
|
||||
danger: "#DC2626"
|
||||
surface: "#f5f4ed"
|
||||
text: "#141413"
|
||||
neutral: "#faf9f5"
|
||||
typography:
|
||||
h1:
|
||||
fontFamily: "LXGW WenKai Screen"
|
||||
fontSize: 2.25rem
|
||||
body-md:
|
||||
fontFamily: "LXGW WenKai Screen"
|
||||
fontSize: 1rem
|
||||
label-caps:
|
||||
fontFamily: "JetBrains Mono"
|
||||
fontSize: 0.75rem
|
||||
sourceScale: "12/14/16/18/22/26/36"
|
||||
weights: "400, 500"
|
||||
rounded:
|
||||
sm: 2px
|
||||
md: 4px
|
||||
spacing:
|
||||
sm: 6px
|
||||
md: 12px
|
||||
sourceScale: "6/12/16/24/32/48"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Warm, editorial, print-leaning document system. A calm parchment background, a single ink-blue accent, and a serif-led hierarchy give long-form and formal documents a published, authored feel — résumés, reports, white papers, letters, and editorial reading pages. Built for reading and print (A4 / PDF), not for dense product UI.
|
||||
|
||||
## Style Foundations
|
||||
|
||||
- **Visual style:** editorial, formal, print-leaning, warm, content-first
|
||||
- **Typography scale:** 12/14/16/18/22/26/36
|
||||
- **Typography fonts:** primary=LXGW WenKai Screen (霞鹜文楷, Chinese), display=Charter (English serif), mono=JetBrains Mono
|
||||
- **Typography weights:** 400, 500 (no synthetic bold; weight 500 carries headings)
|
||||
- **Color palette:** parchment surface, near-black/olive/stone ink tiers, single ink-blue accent
|
||||
- **Spacing scale:** 6/12/16/24/32/48
|
||||
- **Surface:** warm parchment `#f5f4ed` / ivory `#faf9f5`, never pure white
|
||||
- **Page model:** A4, ~14mm/16mm margins, real pagination, `print-color-adjust: exact`
|
||||
- **Body rhythm:** line-height ~1.55, controlled measure (never full-page-width lines)
|
||||
|
||||
## Colors
|
||||
|
||||
- **Primary (#1B365D):** Ink-blue accent — section rules, headers, emphasis. The only accent; never add a second.
|
||||
- **Secondary (#2D5A8A):** Lighter ink-blue for links or subtle secondary emphasis.
|
||||
- **Success (#16A34A):** Status only, used sparingly (e.g. changelog "added").
|
||||
- **Warning (#D97706):** Status only, used sparingly.
|
||||
- **Danger (#DC2626):** Status only, used sparingly.
|
||||
- **Surface (#f5f4ed):** Warm parchment page background — the signature of this system.
|
||||
- **Text (#141413):** Near-black body ink; secondary tier olive `#504e49`, meta tier stone `#6b6a64`.
|
||||
- **Neutral (#faf9f5):** Ivory, for raised blocks / cards on the parchment ground.
|
||||
|
||||
## Fonts
|
||||
|
||||
Chinese serif loads online (no bundled font files):
|
||||
|
||||
```
|
||||
@import url("https://cdn.jsdelivr.net/npm/cn-fontsource-lxgw-wen-kai-screen-r/font.css");
|
||||
```
|
||||
|
||||
Stack: `"LXGW WenKai Screen", "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", Charter, Georgia, serif`. English uses Charter first. One serif per page (`--sans: var(--serif)`); reserve JetBrains Mono for code/figures/numbers only.
|
||||
|
||||
When exporting to PDF, the online Chinese font may fall back to a system CJK serif; install LXGW WenKai locally if exact rendering is required, otherwise the fallback is acceptable.
|
||||
@@ -0,0 +1,66 @@
|
||||
---
|
||||
name: parchment
|
||||
description: Warm editorial, print-leaning document design system — parchment background, single ink-blue accent, serif-led hierarchy (LXGW WenKai for Chinese, Charter for English). For résumés, reports, white papers, letters, and editorial reading pages that should feel authored and published. Not a product-UI / component system.
|
||||
license: MIT
|
||||
metadata:
|
||||
author: adapted from Kami (tw93), OFL/MIT sources
|
||||
---
|
||||
|
||||
# Parchment Design System Skill (Document / Editorial)
|
||||
|
||||
## Mission
|
||||
You are a design-system guideline author for **Parchment**, a warm editorial system for formal and long-form documents. Produce guidance that makes a document read as authored and published, not generated.
|
||||
|
||||
## Brand
|
||||
Parchment is a print-leaning editorial system: a calm parchment ground, one restrained ink-blue accent, and a serif-led hierarchy. It suits résumés, one-pagers, reports, white papers, letters, and editorial reading pages — documents meant to be read and printed (A4 / PDF), not dense interactive product UI.
|
||||
|
||||
## Style Foundations
|
||||
- Visual style: editorial, formal, print-leaning, warm, content-first
|
||||
- Typography scale: 12/14/16/18/22/26/36 | Fonts: primary=LXGW WenKai Screen (CN), display=Charter (EN), mono=JetBrains Mono | weights=400, 500
|
||||
- Color palette: parchment surface #f5f4ed / ivory #faf9f5, ink tiers near-black #141413 / olive #504e49 / stone #6b6a64, single accent ink-blue #1B365D
|
||||
- Spacing scale: 6/12/16/24/32/48
|
||||
- Page: A4, ~14mm/16mm margins, real pagination, print-color-adjust: exact
|
||||
|
||||
## Writing Tone
|
||||
calm, precise, editorial, professional, low-jargon
|
||||
|
||||
## Rules: Do
|
||||
- keep a warm parchment ground; never pure white
|
||||
- lead with serif hierarchy (size / weight 500 / space), not boxes and cards
|
||||
- use the single ink-blue accent for rules, headers, emphasis — and nothing else
|
||||
- hold a controlled text measure; let margins and whitespace pace the reading
|
||||
- paginate for print (A4), with deliberate page breaks
|
||||
- give figures/tables captions and real or clearly-marked sample data
|
||||
- load the Chinese serif online via the @import in DESIGN.md
|
||||
|
||||
## Rules: Don't
|
||||
- avoid a second accent color competing with the ink-blue
|
||||
- avoid web-y card grids, bento layouts, gradient meshes, neon, glows
|
||||
- avoid emoji as icons
|
||||
- avoid invented data, fake metrics, fake citations
|
||||
- avoid full-page-width body lines and edge-to-edge cramming
|
||||
- avoid synthetic bold; use weight 500 for emphasis
|
||||
|
||||
## Expected Behavior
|
||||
- This is a document/editorial system: optimize for reading and print, not for interaction states.
|
||||
- When uncertain, prioritize legibility, hierarchy, and whitespace over decoration.
|
||||
- Keep one serif per page; one accent; warm ground.
|
||||
- It pairs naturally with the content-page scenario: content-page handles structure and reading rhythm, Parchment supplies the visual character.
|
||||
|
||||
## Best For
|
||||
- résumés, one-pagers, formal letters
|
||||
- reports, white papers, long-form documents, equity/research reports
|
||||
- editorial reading pages, public-account long reads that want a printed, literary feel
|
||||
|
||||
## Not For
|
||||
- product UI, dashboards, admin panels, data-dense interfaces (use a UI-oriented style)
|
||||
- marketing landing pages, loud commercial launches
|
||||
- anything where interaction/animation is the point
|
||||
|
||||
## Quality Gates
|
||||
- parchment ground present; no pure-white page
|
||||
- exactly one accent (ink-blue); no competing color
|
||||
- serif hierarchy reads without relying on boxes
|
||||
- text measure controlled; whitespace deliberate
|
||||
- Chinese serif actually loaded (@import), with system-serif fallback
|
||||
- data is real or clearly marked sample
|
||||
Reference in new issue
Block a user