@zaclinley/dsh-mailharbor 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 70cb32a: Add AI assistance, drafts and a unified inbox.
8
+
9
+ - AI summary in Chinese with four sections (结论 / 需要你做什么 / 关键信息 / 建议回复要点).
10
+ - AI reply with an optional instruction and 中/EN output; preview before inserting, sending still needs confirmation.
11
+ - One-click translation of the compose body, with an inline confirm step instead of a native dialog.
12
+ - Writing style learned from up to 100 sent messages, stored per account, injected into AI replies and editable in settings.
13
+ - Drafts folder: save, list, reopen for editing, delete.
14
+ - Unified inbox across accounts with a per-message account badge.
15
+ - Server-mode paging through IMAP sequence ranges; the unread badge now sums every account.
16
+ - Demo data seeder (`npm run seed:demo`) plus public README screenshots; no real mail is used.
17
+
18
+ ## 0.2.1
19
+
20
+ ### Patch Changes
21
+
22
+ - 7f5a956: Adapt the sidebar unread badge to the shell: a compact accent pill at the icon
23
+ corner instead of a white blob that covered the envelope (the old badge used
24
+ `--dsw-alias-brand-primary`, which is near-white in the dark theme).
25
+
3
26
  ## 0.2.0
4
27
 
5
28
  ### Minor Changes
package/README.md CHANGED
@@ -15,22 +15,37 @@ and read state.
15
15
  - Package: `@zaclinley/dsh-mailharbor`
16
16
  - Requirements: **DSH `>=0.2.2-0 <0.3.0`**, Node **>=24.9** (the runtime bundled with DSH is fine)
17
17
  - License: MIT
18
- - Status: **v0.1.0 — core mail workspace**. OAuth2, AI actions and CalDAV are on the roadmap (see [Roadmap](#roadmap)).
18
+ - Status: **v0.3.0 — core mail workspace plus AI assistance** (Chinese summaries, AI replies, translate, writing style). OAuth2 and CalDAV are next (see [Roadmap](#roadmap)).
19
19
 
20
20
  ## Features
21
21
 
22
- | Area | What you get |
23
- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
24
- | Accounts | Any IMAP/SMTP mailbox; password or app password; per-account data directory; switch accounts from the top bar |
25
- | Local backup | Incremental IMAP → SQLite backup with UIDVALIDITY handling, batched transactions, content-addressed attachments and a trigram full-text index |
26
- | Browse | Folders, paging, search across subject/sender/recipients/body/attachment names |
27
- | Live server | Read the newest messages straight from IMAP, with a **backed up / not backed up** marker per row |
28
- | Reader | Sandboxed HTML rendering with a strict CSP, remote images off by default, plain-text fallback, attachment download |
29
- | Compose | Rich-text body, attachments (8 MB), reply / reply-all / forward with `In-Reply-To` and `References`, save-as-draft, explicit send confirmation |
30
- | Credentials | macOS Keychain, libsecret on Linux, Windows Credential Locker; passwords never enter `config.json` |
31
- | Agent tools | `mail_status`, `mail_list`, `mail_read`, `mail_search`, `mail_drafts`, `mail_draft`, `mail_backup` |
32
- | Settings | A **MailHarbor** section in DSH Settings: accounts, servers, connection checks, signature, read behaviour, list size, AI provider/model |
33
- | Updates | A real build pipeline, GitHub Actions CI, Changesets versioning, and npm provenance |
22
+ | Area | What you get |
23
+ | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
24
+ | Accounts | Any IMAP/SMTP mailbox; password or app password; per-account data directory; switch accounts from the top bar |
25
+ | Unified inbox | A combined list and search across every account, with a per-message account badge |
26
+ | Local backup | Incremental IMAP → SQLite backup with UIDVALIDITY handling, batched transactions, content-addressed attachments and a trigram full-text index |
27
+ | Browse | Folders, paging, search across subject/sender/recipients/body/attachment names |
28
+ | Live server | Newest messages straight from IMAP with paging, plus a **backed up / not backed up** marker per row |
29
+ | Reader | Sandboxed HTML rendering with a strict CSP, remote images off by default, plain-text fallback, attachment download |
30
+ | Compose | Rich-text body, attachments (8 MB), reply / reply-all / forward with `In-Reply-To` and `References`, drafts, explicit send confirmation |
31
+ | Drafts | Save, list in the **Drafts** folder, reopen to continue editing, delete |
32
+ | AI | Chinese summary (结论 / 需要你做什么 / 关键信息 / 建议回复要点), AI reply with optional instructions and 中/EN, one-click translation of a draft, writing style learned from sent mail |
33
+ | Credentials | macOS Keychain, libsecret on Linux, Windows Credential Locker; passwords never enter `config.json` |
34
+ | Agent tools | `mail_status`, `mail_list`, `mail_read`, `mail_search`, `mail_drafts`, `mail_draft`, `mail_backup` |
35
+ | Settings | DSH Settings → MailHarbor: accounts, servers, checks, signature, read behaviour, list size, AI model and writing style |
36
+ | Updates | A real build pipeline, GitHub Actions CI, Changesets versioning, and npm provenance |
37
+
38
+ ## Screenshots
39
+
40
+ | Unified inbox | Reader |
41
+ | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
42
+ | ![Unified inbox](https://raw.githubusercontent.com/Zac-Linley/dsh-plugin-mailharbor/main/docs/screenshots/panel.png) | ![Reader](https://raw.githubusercontent.com/Zac-Linley/dsh-plugin-mailharbor/main/docs/screenshots/reader.png) |
43
+
44
+ | AI summary (Chinese) | Writing style learned from sent mail |
45
+ | ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
46
+ | ![AI summary](https://raw.githubusercontent.com/Zac-Linley/dsh-plugin-mailharbor/main/docs/screenshots/ai-summary.png) | ![AI settings](https://raw.githubusercontent.com/Zac-Linley/dsh-plugin-mailharbor/main/docs/screenshots/settings-ai.png) |
47
+
48
+ > Screenshots use fabricated demo data (`node scripts/seed-demo.mjs`), not a real mailbox.
34
49
 
35
50
  ## Install
36
51
 
@@ -104,6 +119,8 @@ until OAuth support ships. Restart DSH afterwards so the Host reopens the databa
104
119
  remote images are blocked until you ask for them.
105
120
  - The HTTP API listens on DSH's own loopback server and rejects cross-site writes (`403`).
106
121
  - `mail_*` tools never send mail: there is no `mail_send` tool. Sending is a user action in the panel.
122
+ - AI calls go through DSH's own `ctx.llm`; nothing is sent when AI is off. The writing style stores only the
123
+ distilled profile, not the sent mail it was learned from.
107
124
 
108
125
  ## Agent tools
109
126
 
@@ -156,14 +173,14 @@ must be able to publish `@zaclinley/*`. See [CONTRIBUTING.md](CONTRIBUTING.md).
156
173
 
157
174
  ## Roadmap
158
175
 
159
- | Version | Scope |
160
- | --------- | ---------------------------------------------------------------------------- |
161
- | **0.1.x** | Core mail workspace, backup, tools, settings, publishing pipeline |
162
- | 0.2 | UI overhaul, migration from `dsh-plugin-mail`, installer polish |
163
- | 0.3 | OAuth2 + XOAUTH2 (Gmail loopback/PKCE, Microsoft device code), token refresh |
164
- | 0.4 | AI summaries, compose assist, natural-language search, writing style profile |
165
- | 0.5 | CalDAV tasks, Markdown/PDF reports |
166
- | Later | Export/import, onboarding, richer attachments |
176
+ | Version | Scope |
177
+ | --------- | ------------------------------------------------------------------------------- |
178
+ | **0.1.x** | Core mail workspace, backup, tools, settings, publishing pipeline |
179
+ | 0.2 | UI overhaul, migration from `dsh-plugin-mail`, installer polish |
180
+ | 0.3 | Drafts, unified inbox, server paging, AI summary/reply/translate, writing style |
181
+ | 0.4 | OAuth2 + XOAUTH2 (Gmail loopback/PKCE, Microsoft device code), token refresh |
182
+ | 0.5 | CalDAV tasks, Markdown/PDF reports |
183
+ | Later | Export/import, onboarding, richer attachments |
167
184
 
168
185
  ## Star history
169
186
 
package/README.zh.md CHANGED
@@ -14,22 +14,37 @@ MailHarbor 在 DSH 左侧栏加一个「邮件」入口,主面板里是完整
14
14
  - 包名:`@zaclinley/dsh-mailharbor`
15
15
  - 要求:**DSH `>=0.2.2-0 <0.3.0`**,Node **>=24.9**(DSH 自带运行时即可)
16
16
  - 许可证:MIT
17
- - 状态:**v0.1.0 — 核心邮件工作区**。OAuth2、AI 动作和 CalDAV 在路线图中(见[路线图](#路线图))。
17
+ - 状态:**v0.3.0 — 核心邮件工作区 + AI 辅助**(中文摘要、AI 回复、翻译、写作风格)。OAuth2 与 CalDAV 是下一步(见[路线图](#路线图))。
18
18
 
19
19
  ## 功能
20
20
 
21
- | 区域 | 能做什么 |
22
- | ---------- | ----------------------------------------------------------------------------------------------------- |
23
- | 账号 | 任意 IMAP/SMTP 邮箱;密码或应用专用密码;每账号独立数据目录;顶栏切换账号 |
24
- | 本地备份 | 增量 IMAP → SQLite:UIDVALIDITY 处理、分批事务、内容寻址附件、trigram 全文索引 |
25
- | 浏览 | 文件夹、分页、按主题/发件人/收件人/正文/附件名搜索 |
26
- | 服务器实时 | 直接从 IMAP 读取最新邮件,每行标注「已备份 / 未备份」 |
27
- | 阅读 | sandbox iframe + 严格 CSP 渲染 HTML,远程图片默认拦截,纯文本回退,附件下载 |
28
- | 写邮件 | 富文本正文、附件(8 MB)、回复/全部回复/转发(`In-Reply-To` 与 `References`)、存草稿、二次确认后发送 |
29
- | 凭据 | macOS 钥匙串、Linux libsecret、Windows Credential Locker;密码不写入 `config.json` |
30
- | Agent 工具 | `mail_status`、`mail_list`、`mail_read`、`mail_search`、`mail_drafts`、`mail_draft`、`mail_backup` |
31
- | 设置页 | DSH 设置里的「MailHarbor」:账号与服务器、连接检查、签名、已读行为、列表数量、AI 模型 |
32
- | 工程化 | 真实构建链、GitHub Actions CI、Changesets 版本管理、npm provenance |
21
+ | 区域 | 能做什么 |
22
+ | ---------- | ----------------------------------------------------------------------------------------------------------------------------------- |
23
+ | 账号 | 任意 IMAP/SMTP 邮箱;密码或应用专用密码;每账号独立数据目录;顶栏切换 |
24
+ | 统一收件箱 | 所有账号合并列表与搜索,每封标注所属账号 |
25
+ | 本地备份 | 增量 IMAP → SQLite:UIDVALIDITY 处理、分批事务、内容寻址附件、trigram 全文索引 |
26
+ | 浏览 | 文件夹、分页、按主题/发件人/收件人/正文/附件名搜索 |
27
+ | 服务器实时 | 直接从 IMAP 读取最新邮件,支持加载更多,每行标注「已备份 / 未备份」 |
28
+ | 阅读 | sandbox iframe + 严格 CSP 渲染 HTML,远程图片默认拦截,纯文本回退,附件下载 |
29
+ | 写邮件 | 富文本正文、附件(8 MB)、回复/全部回复/转发(`In-Reply-To` 与 `References`)、草稿、二次确认后发送 |
30
+ | 草稿 | 存草稿后在「草稿」文件夹里列出,点开继续编辑、可删除 |
31
+ | AI | 中文摘要(结论 / 需要你做什么 / 关键信息 / 建议回复要点)、AI 回复(可写要点、选中/英)、正文一键中英互译、从已发送邮件学习写作风格 |
32
+ | 凭据 | macOS 钥匙串、Linux libsecret、Windows Credential Locker;密码不写入 `config.json` |
33
+ | Agent 工具 | `mail_status`、`mail_list`、`mail_read`、`mail_search`、`mail_drafts`、`mail_draft`、`mail_backup` |
34
+ | 设置页 | DSH 设置 → MailHarbor:账号与服务器、连接检查、签名、已读行为、列表数量、AI 模型与写作风格 |
35
+ | 工程化 | 真实构建链、GitHub Actions CI、Changesets 版本管理、npm provenance |
36
+
37
+ ## 界面
38
+
39
+ | 统一收件箱 | 阅读页 |
40
+ | ----------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
41
+ | ![统一收件箱](https://raw.githubusercontent.com/Zac-Linley/dsh-plugin-mailharbor/main/docs/screenshots/panel.png) | ![阅读页](https://raw.githubusercontent.com/Zac-Linley/dsh-plugin-mailharbor/main/docs/screenshots/reader.png) |
42
+
43
+ | AI 摘要(中文) | 从已发送邮件学习的写作风格 |
44
+ | ------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
45
+ | ![AI 摘要](https://raw.githubusercontent.com/Zac-Linley/dsh-plugin-mailharbor/main/docs/screenshots/ai-summary.png) | ![AI 设置](https://raw.githubusercontent.com/Zac-Linley/dsh-plugin-mailharbor/main/docs/screenshots/settings-ai.png) |
46
+
47
+ > 截图使用 `node scripts/seed-demo.mjs` 生成的虚构演示数据,不含真实邮件。
33
48
 
34
49
  ## 安装
35
50
 
@@ -98,6 +113,7 @@ node node_modules/@zaclinley/dsh-mailharbor/scripts/migrate-legacy.mjs --copy
98
113
  - HTML 邮件在 `sandbox` iframe 中渲染,CSP 为 `default-src 'none'`;脚本、表单不执行,远程图片默认不加载。
99
114
  - HTTP 接口只监听 DSH 自己的回环端口,跨站写请求返回 `403`。
100
115
  - `mail_*` 工具不能发信:没有 `mail_send`,发送必须由用户在面板里确认。
116
+ - AI 通过 DSH 自己的 `ctx.llm` 调用,关闭后不会发送任何内容;写作风格只保存提炼后的档案,不保存邮件原文。
101
117
 
102
118
  ## Agent 工具
103
119
 
@@ -154,8 +170,8 @@ CI 会在 `main` 上通过 `.github/workflows/release.yml` 发布;仓库需要
154
170
  | --------- | --------------------------------------------------------------------- |
155
171
  | **0.1.x** | 核心邮件工作区、备份、工具、设置、发布流水线 |
156
172
  | 0.2 | 界面重做、从 `dsh-plugin-mail` 迁移数据、安装体验 |
157
- | 0.3 | OAuth2 + XOAUTH2(Gmail loopback/PKCE、Microsoft 设备码)、token 刷新 |
158
- | 0.4 | AI 摘要、起草辅助、自然语言搜索、写作风格档案 |
173
+ | 0.3 | 草稿、统一收件箱、服务器分页、AI 摘要/回复/翻译、写作风格 |
174
+ | 0.4 | OAuth2 + XOAUTH2(Gmail loopback/PKCE、Microsoft 设备码)、token 刷新 |
159
175
  | 0.5 | CalDAV 任务、Markdown/PDF 报告 |
160
176
  | 以后 | 导出/导入、引导流程、更完整的附件支持 |
161
177