@zaclinley/dsh-mailharbor 0.15.0 → 0.16.1

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,36 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.16.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 18d718b: Attachment previews and drag/drop uploads.
8
+
9
+ - Clicking an image, PDF, plain text or JSON attachment opens an in-app preview
10
+ with a download action instead of navigating away.
11
+ - Attachments are served inline only for safe preview types, with a sandbox CSP
12
+ and `nosniff`; everything else keeps `Content-Disposition: attachment`.
13
+ - The composer accepts dropped files and pasted screenshots.
14
+ - Mail rows use `content-visibility` so very long folders skip off-screen layout.
15
+
16
+ ## 0.16.0
17
+
18
+ ### Minor Changes
19
+
20
+ - 15e68be: Remove OAuth2 and rebuild the shell for narrow windows.
21
+
22
+ - OAuth2 is gone: no auth mode, token storage, device/loopback flows or settings
23
+ section. Accounts use passwords or app passwords again.
24
+ - Responsive shell: the account/folder column becomes a drawer below 1220px,
25
+ the list and reader become one pane below 900px with a back button, the AI
26
+ assistant overlays with a scrim below 1540px, and the reader's secondary
27
+ actions collapse behind 更多 on phones.
28
+ - Fluid list width, wrapping topbar at 760px, full-width search, single-column
29
+ settings grids, and a fixed sync popover on phones.
30
+ - Keyboard: `/` focuses search and Escape closes the popover, AI rail, drawer
31
+ or reader in that order; empty searches offer a clear action.
32
+ - Thin scrollbars and larger touch targets on small screens.
33
+
3
34
  ## 0.15.0
4
35
 
5
36
  ### Minor Changes
package/README.md CHANGED
@@ -15,25 +15,27 @@ 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.15.0 — mail workspace with a collapsible account/folder sidebar, AI search, conversation grouping, projects and a Kanban task board**. Server mail is the default view. OAuth2 is next (see [Roadmap](#roadmap)).
18
+ - Status: **v0.16.0 — local-first mail workspace with background IMAP sync, AI search, projects and a Kanban task board**.
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; accounts and folders in the left column |
25
- | Local backup | Incremental IMAP → SQLite backup with UIDVALIDITY handling, batched transactions, content-addressed attachments and a trigram full-text index |
26
- | Browse | Accounts and folders in a collapsible left column, paging, conversation grouping by subject, and AI search that understands a sentence like "王敏上个月发的报价" |
27
- | Live server | **Default view.** Newest messages straight from IMAP with paging; the folder list is cached and the IMAP session stays warm, so reopening is instant |
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`, drafts, explicit send confirmation |
30
- | Drafts | Save, list in the **Drafts** folder, reopen to continue editing, delete |
31
- | AI | Persistent per-mail workspace: Chinese summary, reply (中/EN), translation, free-form Q&A, writing style; Markdown answers; cards convert into a reply, draft or body text; composer draft/polish/shorten with a version stack; AI search parses a sentence into sender/keywords/dates |
32
- | Projects | Turn a mail and its whole AI conversation into a project folder (`BRIEF.md`, `CONVERSATION.md`), registered in DSH Workspaces with a starting session; append later AI records, add more mails from the list, and pick the folder in Finder |
33
- | Tasks | Kanban board (待处理 / 进行中 / 已完成 / 终止) with drag & drop, due/priority/owner/project, project filter, source-mail links, and AI extraction from the current mail |
34
- | Credentials | macOS Keychain, libsecret on Linux, Windows Credential Locker; passwords never enter `config.json` |
35
- | Agent tools | `mail_status`, `mail_list`, `mail_read`, `mail_search`, `mail_drafts`, `mail_draft`, `mail_backup` |
36
- | Settings | DSH Settings → MailHarbor: accounts, servers, checks, signature, read behaviour, list size, AI model and writing style, default project root |
22
+ | Area | What you get |
23
+ | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
24
+ | Accounts | Any IMAP/SMTP mailbox with a password or app password; per-account data directory; accounts and folders in the left column |
25
+ | Local-first | Opens from the local SQLite backup instantly, then syncs new mail in the background; progress popover with start/stop |
26
+ | Browse | Collapsible account/folder column, paging, subject conversations loaded across the whole backup, AI search over the local index |
27
+ | Actions | Star, archive, delete-to-trash, move to any folder; bulk read/unread/star/archive/delete |
28
+ | Reader | Sandboxed HTML with a strict CSP, inline cid images as data URLs, remote images blocked, plain-text fallback, attachment download |
29
+ | Compose | Rich text, attachments, reply/reply-all/forward with `In-Reply-To` and `References`, contact autocomplete, per-account signatures, drag/drop or paste attachments, explicit send confirmation |
30
+ | Drafts | Local drafts mirrored to IMAP Drafts on save/close, cleaned up on discard and send |
31
+ | AI | Per-mail workspace: summary (brief/standard/detailed), reply, translation, Q&A, writing style; inline expansion; AI search; compose draft/polish/shorten |
32
+ | Projects | Project folder (`BRIEF.md`, `CONVERSATION.md`) registered in DSH Workspaces; append AI records, add mails, open in Finder; delete folder/workspace when asked |
33
+ | Tasks | Kanban board (待处理 / 进行中 / 已完成 / 终止) with due/priority/owner/project, source-mail links and AI extraction |
34
+ | Credentials | macOS Keychain, libsecret, Windows Credential Locker; secrets never enter `config.json` |
35
+ | Migration | Export/import a JSON profile: accounts without secrets, signature and reading settings |
36
+ | Agent tools | `mail_status`, `mail_list`, `mail_read`, `mail_search`, `mail_drafts`, `mail_draft`, `mail_backup` |
37
+ | Settings | DSH Settings → MailHarbor: accounts, servers, checks, signature, reading, list size, AI model and writing style, project root |
38
+ | Layout | Responsive shell: the folder column becomes a drawer, list/reader switch to one pane, AI rail becomes an overlay, reader actions collapse behind 更多 |
37
39
 
38
40
  ## Screenshots
39
41
 
@@ -75,15 +77,13 @@ dsh plugin --profile desktop add link:$PWD
75
77
  1. Open the **MailHarbor** panel from the sidebar.
76
78
  2. Add an account: address + password (or app password). **Advanced** lets you set IMAP/SMTP hosts,
77
79
  ports and TLS. The account is verified against IMAP before it is saved.
78
- 3. Browse **Local backup** right away; press **Backup** to pull mail from the server.
79
- 4. Switch to **Server live** for the newest messages. Press **Write** to compose.
80
+ 3. The list opens from the local backup immediately; the sync indicator pulls new mail in the background (and every poll interval).
81
+ 4. Press **Write** to compose. New mail appears after the next background sync.
80
82
 
81
83
  ### Gmail, Outlook, and other providers
82
84
 
83
- - Gmail: enable IMAP in Gmail settings and use an **app password** (2-Step Verification required).
84
- OAuth2 sign-in arrives in v0.2.
85
- - Microsoft 365: basic auth is disabled; use an app password only if your tenant still allows IMAP
86
- AUTH, otherwise wait for the OAuth2 release.
85
+ - Gmail: enable IMAP and use an **app password** (2-Step Verification required).
86
+ - Microsoft 365: app passwords only work while the tenant still allows IMAP AUTH.
87
87
  - Yahoo: app password. Self-hosted: any IMAP/SMTP endpoints with STARTTLS or implicit TLS.
88
88
 
89
89
  ## Migrating from `dsh-plugin-mail`
@@ -103,8 +103,8 @@ node node_modules/@zaclinley/dsh-mailharbor/scripts/migrate-legacy.mjs --copy
103
103
  ```
104
104
 
105
105
  It matches accounts by email, repoints `dataDir`, converts read-state keys and drafts to the new
106
- shapes, and copies the macOS Keychain password to the new service name. OAuth2 accounts are skipped
107
- until OAuth support ships. Restart DSH afterwards so the Host reopens the database.
106
+ shapes, and copies the macOS Keychain password to the new service name.
107
+ Restart DSH afterwards so the Host reopens the database.
108
108
 
109
109
  ## Data and privacy
110
110
 
@@ -176,17 +176,18 @@ must be able to publish `@zaclinley/*`. See [CONTRIBUTING.md](CONTRIBUTING.md).
176
176
 
177
177
  ## Roadmap
178
178
 
179
- | Version | Scope |
180
- | --------- | ------------------------------------------------------------------------------- |
181
- | **0.1.x** | Core mail workspace, backup, tools, settings, publishing pipeline |
182
- | 0.2 | UI overhaul, migration from `dsh-plugin-mail`, installer polish |
183
- | 0.3 | Drafts, unified inbox, server paging, AI summary/reply/translate, writing style |
184
- | 0.4 | Persistent AI workspace, composer version stack |
185
- | 0.5 | Projects from mail, task panel |
186
- | 0.6 | Mailbox sidebar, Kanban tasks, faster server browsing |
187
- | 0.7 | AI search, conversation grouping, folder picker, four-column task board |
188
- | 0.8 | OAuth2 + XOAUTH2 (Gmail loopback/PKCE, Microsoft device code), token refresh |
189
- | Later | Reports, export/import, onboarding, richer attachments |
179
+ | Version | Scope |
180
+ | --------- | ----------------------------------------------------------------------------------- |
181
+ | **0.1.x** | Core mail workspace, backup, tools, settings, publishing pipeline |
182
+ | 0.2 | UI overhaul, migration from `dsh-plugin-mail`, installer polish |
183
+ | 0.3 | Drafts, unified inbox, server paging, AI summary/reply/translate, writing style |
184
+ | 0.4 | Persistent AI workspace, composer version stack |
185
+ | 0.5 | Projects from mail, task panel |
186
+ | 0.6 | Mailbox sidebar, Kanban tasks, faster server browsing |
187
+ | 0.7 | AI search, conversation grouping, folder picker, four-column task board |
188
+ | 0.8–0.16 | Local-first sync, mail actions, drafts mirror, responsive layout, account migration |
189
+ | Later | OAuth2 is not planned for now (app passwords cover IMAP/SMTP) |
190
+ | Later | Reports, export/import, onboarding, richer attachments |
190
191
 
191
192
  ## Star history
192
193
 
package/README.zh.md CHANGED
@@ -14,26 +14,27 @@ 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.15.0 — 可折叠账号/文件夹侧栏 + AI 搜索 + 会话分组 + 项目 + 看板任务**。默认显示服务器实时。OAuth2 是下一步(见[路线图](#路线图))。
17
+ - 状态:**v0.16.0 — 本地优先 + 后台同步 + AI 搜索 + 项目 + 看板任务 + 响应式布局**。
18
18
 
19
19
  ## 功能
20
20
 
21
- | 区域 | 能做什么 |
22
- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
23
- | OAuth2 | Google loopback + PKCE、Microsoft 设备代码流程;令牌存系统钥匙串并后台刷新(需自备 Client ID) |
24
- | 账号 | 任意 IMAP/SMTP 邮箱;密码或应用专用密码;每账号独立数据目录;账号与文件夹在左侧一栏里 |
25
- | 本地备份 | 增量 IMAP → SQLite:UIDVALIDITY 处理、分批事务、内容寻址附件、trigram 全文索引 |
26
- | 浏览 | 可折叠的账号/文件夹左栏、分页、按主题分组会话,以及能理解一句话的 AI 搜索(例如「王敏上个月发的报价」) |
27
- | 服务器实时 | **默认视图**。直接从 IMAP 读最新邮件;文件夹列表有缓存、连接保持热态,重复打开几乎即时 |
28
- | 阅读 | sandbox iframe + 严格 CSP 渲染 HTML,远程图片默认拦截,纯文本回退,附件下载 |
29
- | 写邮件 | 富文本正文、附件(8 MB)、回复/全部回复/转发(`In-Reply-To` 与 `References`)、草稿、二次确认后发送 |
30
- | 草稿 | 存草稿后在「草稿」文件夹里列出,点开继续编辑、可删除 |
31
- | AI | 右侧常驻工作台:中文摘要、AI 回复(中/英)、翻译、自由问答、写作风格;回答按 Markdown 渲染;卡片可转为回复、草稿或正文;写信页支持起草/润色/缩短与版本栈;搜索框支持 AI 理解发件人/关键词/日期 |
32
- | 项目 | 把一封邮件连同整个 AI 对话变成项目文件夹(`BRIEF.md`、`CONVERSATION.md`),自动注册到 DSH Workspaces 并开一个会话;之后可追加 AI 记录、从列表加更多邮件 |
33
- | 任务 | 看板(待处理 / 进行中 / 已完成),支持拖拽改状态,含截止、优先级、负责人、项目、来源邮件;可从当前邮件用 AI 提取任务 |
34
- | 凭据 | macOS 钥匙串、Linux libsecret、Windows Credential Locker;密码不写入 `config.json` |
35
- | Agent 工具 | `mail_status`、`mail_list`、`mail_read`、`mail_search`、`mail_drafts`、`mail_draft`、`mail_backup` |
36
- | 设置页 | DSH 设置 → MailHarbor:账号与服务器、连接检查、签名、已读行为、列表数量、AI 模型与写作风格、默认项目目录 |
21
+ | 区域 | 能做什么 |
22
+ | ---------- | ------------------------------------------------------------------------------------------------------------------------------------ |
23
+ | 账号 | 任意 IMAP/SMTP 邮箱,密码或应用专用密码;每账号独立数据目录;账号与文件夹在左侧栏 |
24
+ | 本地优先 | 打开即从本地 SQLite 备份显示,随后后台增量同步;同步按钮带进度与启停 |
25
+ | 浏览 | 可折叠账号/文件夹栏、分页、按主题从整个备份组会话、AI 搜索 |
26
+ | 操作 | 标星、归档、删除到垃圾箱、移动到任意文件夹;多选批量已读/未读/标星/归档/删除 |
27
+ | 阅读 | sandbox + 严格 CSP;内嵌 cid 图片转 data URL;远程图片拦截;附件多时折叠 |
28
+ | 写邮件 | 富文本、附件、回复/全部回复/转发(In-Reply-To/References)、联系人补全、按账号签名、二次确认 |
29
+ | 草稿 | 本地草稿在手动保存/关闭时镜像到 IMAP Drafts 并替换旧副本,丢弃/发送时清理 |
30
+ | AI | 单封邮件工作台:摘要(简洁/标准/详细)、回复、翻译、问答、写作风格;内联展开;AI 搜索;写信润色 |
31
+ | 项目 | 生成项目文件夹(BRIEF.md、CONVERSATION.md)并注册到 DSH Workspaces;追加 AI 记录、加入邮件、Finder 打开;删除时可连同文件夹/工作空间 |
32
+ | 任务 | 四列看板(待处理/进行中/已完成/终止),截止/优先级/负责人/项目、来源邮件、AI 提取 |
33
+ | 凭据 | macOS 钥匙串、libsecret、Windows Credential Locker;密钥不写入 config.json |
34
+ | 迁移 | 导出/导入 JSON:账号(不含密钥)、签名与阅读设置 |
35
+ | Agent 工具 | `mail_status`、`mail_list`、`mail_read`、`mail_search`、`mail_drafts`、`mail_draft`、`mail_backup` |
36
+ | 设置 | DSH 设置 → MailHarbor:账号、服务器、连接检查、签名、阅读、列表数量、AI 模型与写作风格、项目根目录 |
37
+ | 布局 | 响应式:文件夹栏变抽屉,列表/阅读单栏切换,AI 助手变浮层,阅读操作收进「更多」 |
37
38
 
38
39
  ## 界面
39
40
 
@@ -75,13 +76,13 @@ dsh plugin --profile desktop add link:$PWD
75
76
  1. 从左侧栏打开 **MailHarbor**。
76
77
  2. 添加账号:邮箱地址 + 密码(或应用专用密码)。「高级设置」里可改 IMAP/SMTP 主机、端口和 TLS;
77
78
  保存前会真实连接一次 IMAP 校验。
78
- 3. 先浏览 **本地备份**;点顶部「备份」把服务器邮件同步下来。
79
- 4. 切到 **服务器实时** 看最新邮件,点「写邮件」开始写信。
79
+ 3. 打开即显示本地备份,顶部同步按钮在后台拉取新邮件。
80
+ 4. 点「写邮件」开始写信;新邮件会在下次同步后出现。
80
81
 
81
82
  ### Gmail、Outlook 与其他服务商
82
83
 
83
- - Gmail:在 Gmail 设置里启用 IMAP,使用**应用专用密码**(需先开启两步验证)。OAuth2 登录在 v0.2 提供。
84
- - Microsoft 365:基本认证已停用;只有租户仍允许 IMAP AUTH 时才能用应用专用密码,否则等 OAuth2 版本。
84
+ - Gmail:启用 IMAP,并使用**应用专用密码**(需先开启两步验证)。
85
+ - Microsoft 365:应用专用密码只在租户仍允许 IMAP AUTH 时可用。
85
86
  - Yahoo:应用专用密码。自建邮箱:任何支持 STARTTLS 或隐式 TLS 的 IMAP/SMTP 都可以。
86
87
 
87
88
  ## 从 `dsh-plugin-mail` 迁移
@@ -100,7 +101,7 @@ node node_modules/@zaclinley/dsh-mailharbor/scripts/migrate-legacy.mjs --copy
100
101
  ```
101
102
 
102
103
  脚本按邮箱匹配账号,改写 `dataDir`,把已读状态和草稿转换成新结构,并把 macOS 钥匙串密码复制到
103
- 新的 service 名下。OAuth2 账号会跳过(等 OAuth 支持发布)。迁移完重启 DSH,Host 才会重新打开数据库。
104
+ 新的 service 名下。迁移完重启 DSH,Host 才会重新打开数据库。
104
105
 
105
106
  ## 数据与隐私
106
107
 
@@ -170,17 +171,18 @@ CI 会在 `main` 上通过 `.github/workflows/release.yml` 发布;仓库需要
170
171
 
171
172
  ## 路线图
172
173
 
173
- | 版本 | 范围 |
174
- | --------- | --------------------------------------------------------------------- |
175
- | **0.1.x** | 核心邮件工作区、备份、工具、设置、发布流水线 |
176
- | 0.2 | 界面重做、从 `dsh-plugin-mail` 迁移数据、安装体验 |
177
- | 0.3 | 草稿、统一收件箱、服务器分页、AI 摘要/回复/翻译、写作风格 |
178
- | 0.4 | 常驻 AI 工作台、写信版本栈 |
179
- | 0.5 | 从邮件建项目、任务面板 |
180
- | 0.6 | 账号/文件夹侧栏、看板任务、服务器浏览提速 |
181
- | 0.7 | AI 搜索、会话分组、目录选择器、四列任务看板 |
182
- | 0.8 | OAuth2 + XOAUTH2(Gmail loopback/PKCE、Microsoft 设备码)、token 刷新 |
183
- | 以后 | 报告、导出/导入、引导流程、更完整的附件支持 |
174
+ | 版本 | 范围 |
175
+ | --------- | --------------------------------------------------------- |
176
+ | **0.1.x** | 核心邮件工作区、备份、工具、设置、发布流水线 |
177
+ | 0.2 | 界面重做、从 `dsh-plugin-mail` 迁移数据、安装体验 |
178
+ | 0.3 | 草稿、统一收件箱、服务器分页、AI 摘要/回复/翻译、写作风格 |
179
+ | 0.4 | 常驻 AI 工作台、写信版本栈 |
180
+ | 0.5 | 从邮件建项目、任务面板 |
181
+ | 0.6 | 账号/文件夹侧栏、看板任务、服务器浏览提速 |
182
+ | 0.7 | AI 搜索、会话分组、目录选择器、四列任务看板 |
183
+ | 0.8–0.16 | 本地优先、邮件操作、草稿镜像、响应式布局、配置迁移 |
184
+ | Later | 暂不做 OAuth2(应用专用密码已覆盖 IMAP/SMTP) |
185
+ | 以后 | 报告、导出/导入、引导流程、更完整的附件支持 |
184
186
 
185
187
  ## 许可证
186
188