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
Executable
+57
@@ -0,0 +1,57 @@
|
||||
name: quiz_html
|
||||
version: 0.1.0
|
||||
description: 把题目 JSON 注入模板生成单文件 HTML 练习网页
|
||||
|
||||
entrypoints:
|
||||
build: scripts/build_quiz_html.py
|
||||
|
||||
features:
|
||||
- html_quiz_generation
|
||||
- multi_question_type
|
||||
- category_filter
|
||||
- state_filter
|
||||
- exam_mode
|
||||
- keyboard_shortcuts
|
||||
- dark_mode
|
||||
- localstorage_persistence
|
||||
- mobile_responsive
|
||||
|
||||
depends_on:
|
||||
- quiz-mastery # 上游:题目数据来源
|
||||
|
||||
triggers:
|
||||
# 直接关键词
|
||||
- "生成网页"
|
||||
- "做成网页"
|
||||
- "做个HTML"
|
||||
- "网页版"
|
||||
- "在浏览器练"
|
||||
- "导出HTML"
|
||||
- "在网页做练习"
|
||||
|
||||
# quiz-mastery 完成后的链式触发
|
||||
- quiz_generated # 出题完成事件
|
||||
- quiz_imported # 题目导入完成事件
|
||||
|
||||
io:
|
||||
input:
|
||||
type: file
|
||||
format: json
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
required: [type, prompt, answer]
|
||||
properties:
|
||||
type: {enum: [single_choice, true_false, fill_blank, short_answer]}
|
||||
prompt: {type: string}
|
||||
options: {type: array, items: {type: string}}
|
||||
answer: {type: string}
|
||||
explanation: {type: string}
|
||||
knowledge_point: {type: string}
|
||||
category: {type: string}
|
||||
level: {type: integer, minimum: 1, maximum: 3}
|
||||
memory_tip: {type: string}
|
||||
output:
|
||||
type: file
|
||||
format: html
|
||||
self_contained: true # 单文件,无外部依赖
|
||||
Reference in new issue
Block a user