dsh-chat-history-sync 0.9.2 → 0.11.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 +34 -116
- package/LICENSE +1 -1
- package/README.en.md +38 -0
- package/README.md +51 -23
- package/SECURITY.md +30 -0
- package/client/client.js +200 -101
- package/docs/RELEASE.md +18 -0
- package/lib/browser/login-save.mjs +102 -0
- package/lib/engine/catalog.cjs +10 -17
- package/lib/engine/export.cjs +8 -3
- package/lib/engine/install.cjs +1326 -0
- package/lib/engine/sync-all.cjs +68 -9
- package/lib/index.js +350 -96
- package/package.json +12 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,121 +1,39 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.11.0
|
|
4
|
+
|
|
5
|
+
- 300 轮审查后的最终公开版
|
|
6
|
+
- 安装器失败退出码、进程等待、回执、pending watchdog
|
|
7
|
+
- 设置写回重试;runNow/installNow 复位
|
|
8
|
+
- 账号删除/登录并发保护
|
|
9
|
+
- 移除账号只停止同步,不删除归档
|
|
10
|
+
- 通用分类只影响报告,不移动月份工作区
|
|
11
|
+
- 空工作区/损坏 dataset 容错
|
|
12
|
+
- 手机号/邮箱不采集;临时登录结果不含页面正文/控制台
|
|
13
|
+
- SECURITY / RELEASE 发布文档
|
|
14
|
+
|
|
15
|
+
## 0.10.14
|
|
16
|
+
|
|
17
|
+
- 首次安装、登录、同步、安装链路加固
|
|
18
|
+
- 内置登录脚本与安装器,兼容 npm 提升依赖
|
|
19
|
+
- 安装结果回执:成功/失败都可在状态卡看到
|
|
20
|
+
- 同步失败不再覆盖已有会话,dataset 原子写入并保留备份
|
|
21
|
+
- 登录失效、API 业务错误码不再被误报为“同步完成”
|
|
22
|
+
- 账号删除持久化;手机号不再采集或写入日志
|
|
23
|
+
- 临时登录目录、运行配置、登录结果启动清理
|
|
24
|
+
- 设置项文案与位置重排,减少歧义和重复
|
|
25
|
+
- 分类规则改为通用分类,避免个人化分类进入公开包
|
|
26
|
+
|
|
27
|
+
## 0.10.8
|
|
28
|
+
|
|
29
|
+
- 状态卡动态显示同步/安装/登录状态
|
|
30
|
+
- 侧边栏新增「同步聊天历史」快捷入口
|
|
31
|
+
- 报告和同名会话入口合并,减少重复
|
|
32
|
+
- 隐私清理:移除手机号、邮箱、旧备份明文 token
|
|
33
|
+
|
|
3
34
|
## 0.9.0
|
|
4
35
|
|
|
5
36
|
- 公开名改为 `dsh-chat-history-sync`,界面改为「聊天历史同步」
|
|
6
|
-
- 覆盖 DeepSeek
|
|
7
|
-
- profile dependency/bundles/patch/
|
|
8
|
-
-
|
|
9
|
-
|
|
10
|
-
## 0.8.76
|
|
11
|
-
|
|
12
|
-
- 新增「导出诊断(不含 token)」,输出脱敏账号/日志/计数 JSON
|
|
13
|
-
- 同名不同内容复查入口显示在设置页与报告正文
|
|
14
|
-
- `package.json` 明确 `os: ["win32"]`,避免非 Windows 误装
|
|
15
|
-
|
|
16
|
-
## 0.8.75
|
|
17
|
-
|
|
18
|
-
- 同名不同内容不再互相覆盖:会话位置文件名带月份和会话 ID 短码
|
|
19
|
-
- 新增 `同名不同内容.md` 与设置页复查计数
|
|
20
|
-
- 新增 catalog 回归测试(同名分组/唯一链接)
|
|
21
|
-
|
|
22
|
-
## 0.8.74
|
|
23
|
-
|
|
24
|
-
- 同步批次间加 350ms / 账号间 600ms 限速,降低网页端风控概率
|
|
25
|
-
- 清理 2026-11 月份会话中的 4 条 runtime 用户消息,避免界面显示成代码段
|
|
26
|
-
- 报告/会话健康检查保持 144/144 首 surface
|
|
27
|
-
|
|
28
|
-
## 0.8.73
|
|
29
|
-
|
|
30
|
-
- 账号行补「显示名」可见标签
|
|
31
|
-
- 删除账号改为行内二次确认,移除浏览器 `window.confirm`
|
|
32
|
-
- 待安装时状态行简化为「同步完成 · 待确认安装」,避免与卡片重复
|
|
33
|
-
- 报告预览按分类标题/条目/摘要分层显示,去掉原始 Markdown 符号
|
|
34
|
-
- 窄屏换行、focus-visible、空状态三步引导
|
|
35
|
-
|
|
36
|
-
## 0.8.72
|
|
37
|
-
|
|
38
|
-
- 设置页报告预览去掉 Markdown 标记,改为易读的分组文本
|
|
39
|
-
- 窄屏(≤560px)账号行自动换行,输入框全宽
|
|
40
|
-
- 同步状态加 `role=status/aria-live`,失败状态显示红色
|
|
41
|
-
- 保留「取消」按钮和原生设置风格
|
|
42
|
-
|
|
43
|
-
## 0.8.71
|
|
44
|
-
|
|
45
|
-
- 插件详情页补齐 locale `meta.detail` + `docs/preview.svg` 单图,供 DSH 市场展示
|
|
46
|
-
|
|
47
|
-
## 0.8.70
|
|
48
|
-
|
|
49
|
-
- 同步请求网络失败自动重试 3 次(指数退避)
|
|
50
|
-
- 同步中可点「取消」,结束引擎进程树;不会写半份数据集
|
|
51
|
-
- 新增 `npm run check:sessions`:首 surface / seq / 引用范围健康检查
|
|
52
|
-
|
|
53
|
-
## 0.8.65–0.8.69
|
|
54
|
-
|
|
55
|
-
- 所有导入会话补 `system/message` 首 surface(144/144),修正 title/sourceEventSeqs/delivery 引用;DSH `sessionPersistence` 实际加载验证通过
|
|
56
|
-
- 报告按分类小标题分组(23 类),每条链接下 50–100 字多轮摘要(首问 + 追问 + 助手首句)
|
|
57
|
-
- 设置页去掉账号行重复的“待安装”,只保留顶部确认卡
|
|
58
|
-
- 打包补 LICENSE、locale/en+zh、icon、docs、files;`npm test` 包级回归 + GitHub Actions
|
|
59
|
-
- 历史 config 备份里的明文 token 全部 DPAPI 加密
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
## 0.8.48
|
|
63
|
-
|
|
64
|
-
- 账号简称/显示名输入改为失焦或回车提交,支持键盘焦点
|
|
65
|
-
- 附件策略/可编辑输入增加 aria-label
|
|
66
|
-
- 删除账号二次确认;首次使用空状态说明
|
|
67
|
-
|
|
68
|
-
## 0.8.47
|
|
69
|
-
|
|
70
|
-
- 附件预估:设置页显示「预计 N 个附件 · X MB」
|
|
71
|
-
- 每日汇总开关;通知分级(普通 Toast 自动消失,失败/待确认才 reminder)
|
|
72
|
-
|
|
73
|
-
## 0.8.46
|
|
74
|
-
|
|
75
|
-
- 每日汇总:autoSync 有变化时写 `digest.json`,9:00 后只发一条摘要
|
|
76
|
-
- 通知紧急度参数(普通/reminder)
|
|
77
|
-
|
|
78
|
-
## 0.8.45
|
|
79
|
-
|
|
80
|
-
- 删除账号二次确认、登录取消、首启空状态
|
|
81
|
-
|
|
82
|
-
## 0.8.44
|
|
83
|
-
|
|
84
|
-
- token 使用 Windows DPAPI 加密为 `tokenEnc`,config 不再保存明文
|
|
85
|
-
- run-config 用完即删;登录去重只存 SHA-256;登录结果读取后删除
|
|
86
|
-
|
|
87
|
-
## 0.8.43
|
|
88
|
-
|
|
89
|
-
- 登录等待时可取消(结束临时 Edge 与保存进程)
|
|
90
|
-
- 清理诊断探针
|
|
91
|
-
|
|
92
|
-
## 0.8.42
|
|
93
|
-
|
|
94
|
-
- 状态卡显示上次同步/结果;账号行显示健康状态
|
|
95
|
-
- 报告默认折叠预览
|
|
96
|
-
|
|
97
|
-
## 0.8.41
|
|
98
|
-
|
|
99
|
-
- 通知分级:成功静默、失败/待确认才弹、autoSync 静默
|
|
100
|
-
- 通知开关
|
|
101
|
-
|
|
102
|
-
## 0.8.40
|
|
103
|
-
|
|
104
|
-
- 8b0f 校验探针(已移除)
|
|
105
|
-
|
|
106
|
-
## 0.8.39
|
|
107
|
-
|
|
108
|
-
- 简称/显示名输入改为失焦提交,修复无法输入
|
|
109
|
-
|
|
110
|
-
## 0.8.38
|
|
111
|
-
|
|
112
|
-
- 重建 projcache,修复侧栏未命名
|
|
113
|
-
- 昵称每 5 秒合并进 config
|
|
114
|
-
|
|
115
|
-
## 0.8.37
|
|
116
|
-
|
|
117
|
-
- 回滚 system-head 批量补丁;8b0f 单会话修复
|
|
118
|
-
|
|
119
|
-
## 0.8.36
|
|
120
|
-
|
|
121
|
-
- 续聊日志问题定位(system/message 首 surface)
|
|
37
|
+
- 覆盖 DeepSeek 网页端 + 手机 App 聊天历史
|
|
38
|
+
- profile dependency / bundles / patch / 设置 section id 全部迁移
|
|
39
|
+
- 数据目录迁移到 `.dsh-chat-history-sync`,兼容旧目录复制
|
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2026 dsh-
|
|
3
|
+
Copyright (c) 2026 dsh-chat-history-sync contributors
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.en.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Chat History Sync
|
|
2
|
+
|
|
3
|
+
Free. Pull a DeepSeek account's chat history from the web and mobile app into DeepSeek Harness as native sessions, organized by month and ready to continue.
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
DeepSeek keeps chats in the web app and mobile app, but DSH cannot see them or continue them. This plugin imports the same account's chats into DSH, stores them by month, and lets you open and continue each one.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- Same account, both clients: web and mobile-app history come from the same DeepSeek account; multiple accounts supported
|
|
12
|
+
- Months only: DSH workspaces are monthly, not split by category
|
|
13
|
+
- Report and catalog: every sync writes a report; a category catalog adds a 50–100 character summary per chat
|
|
14
|
+
- Append-only: same-title chats with different content are kept; backups before install; DSH-created sessions are never touched
|
|
15
|
+
- Local tokens: encrypted with Windows DPAPI, never shown in the UI, never uploaded
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
Requirements: Windows 10/11, DSH 0.2.2-rc.3+.
|
|
20
|
+
|
|
21
|
+
```powershell
|
|
22
|
+
dsh plugin add dsh-chat-history-sync
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Then open **Settings → Chat History Sync → Log in → Sync now**.
|
|
26
|
+
|
|
27
|
+
## Data
|
|
28
|
+
|
|
29
|
+
- Chat data stays in the local DSH workspace
|
|
30
|
+
- Sync only talks to `chat.deepseek.com`
|
|
31
|
+
- Tokens stay on this machine, encrypted with DPAPI
|
|
32
|
+
- Phone/email are not collected; accounts are matched by userId/token only
|
|
33
|
+
- Security: [SECURITY.md](SECURITY.md)
|
|
34
|
+
- No telemetry, no model calls; summaries are generated locally and free
|
|
35
|
+
|
|
36
|
+
## Scope
|
|
37
|
+
|
|
38
|
+
Windows only. Not an official DeepSeek plugin.
|
package/README.md
CHANGED
|
@@ -1,28 +1,66 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 聊天历史同步
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**免费。把 DeepSeek 账号的网页端和手机 App 聊天记录同步进 DSH,整理成按月份归档、可以继续对话的原生会话。**
|
|
4
|
+
|
|
5
|
+
## 它解决什么问题
|
|
6
|
+
|
|
7
|
+
DeepSeek 的聊天记录散在网页和手机 App 里,DSH 里看不到,也不能接着聊。这个插件把同一个账号的聊天记录拉进 DSH,按月份放好,打开就能继续。
|
|
8
|
+
|
|
9
|
+
## 主要功能
|
|
10
|
+
|
|
11
|
+
- **一个账号,两端记录**:网页端和手机 App 的聊天都从同一个 DeepSeek 账号读取;支持多个账号
|
|
12
|
+
- **只留月份**:DSH 工作区只建月份,不再按分类拆工作区
|
|
13
|
+
- **报告和目录**:每次同步生成报告;按主题生成分类目录,每条带 50–100 字摘要
|
|
14
|
+
- **只增不减**:同名但内容不同的会话保留;安装前备份;不改 DSH 自建会话
|
|
15
|
+
- **免费,不调用模型**:摘要由本地规则生成,零模型费用、零隐私外发;同步本身也不调用模型
|
|
16
|
+
- **本机 token**:token 用 Windows DPAPI 加密,界面不显示,不上传
|
|
17
|
+
|
|
18
|
+
## 安装
|
|
19
|
+
|
|
20
|
+
要求:Windows 10/11,DSH 0.2.2-rc.3+。
|
|
21
|
+
|
|
22
|
+
```powershell
|
|
23
|
+
dsh plugin add dsh-chat-history-sync
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
安装后打开:
|
|
27
|
+
|
|
28
|
+
**设置 → 聊天历史同步 → 登录新账号 → 立即同步**
|
|
29
|
+
|
|
30
|
+
## 数据说明
|
|
31
|
+
|
|
32
|
+
- 聊天记录只存在本机 DSH 工作区
|
|
33
|
+
- 同步时只访问 `chat.deepseek.com`,不发送到其它服务
|
|
34
|
+
- token 只存本机,DPAPI 加密
|
|
35
|
+
- 不采集手机号/邮箱;账号只用 userId / token 去重
|
|
36
|
+
- 安全说明:[SECURITY.md](SECURITY.md)
|
|
37
|
+
- 无遥测、无统计上报
|
|
38
|
+
|
|
39
|
+
## 范围
|
|
40
|
+
|
|
41
|
+
**仅 Windows。** 不是 DeepSeek 官方插件,和 DeepSeek 官方无隶属关系。
|
|
4
42
|
|
|
5
43
|
## 功能
|
|
6
44
|
|
|
7
45
|
- **一键同步**:设置页「聊天历史同步」点「立即同步」。进度是**不确定式动画**(不显示假百分比),真实进度以文字显示(引擎逐条回报 `x/y`)。
|
|
8
46
|
- **只增不减**:增量合并;数据集里消失的会话默认**保留并报告**,不删除;不触碰 DSH 自建会话。**同名 ≠ 重复**:同名但内容不完全一致的会话一律保留,只有逐字完全一致才按重复处理。
|
|
9
|
-
- **可续聊**:同步进来的会话带 `agent-preset/selected`、`model/selection
|
|
10
|
-
- **多账号**:设置页每个账号显示「头像 +
|
|
47
|
+
- **可续聊**:同步进来的会话带 `agent-preset/selected`、`model/selection`,打开后可继续对话(已实测)。
|
|
48
|
+
- **多账号**:设置页每个账号显示「头像 + 平台昵称」,可编辑「简称」「启用」,可移除;**token 不在界面显示**。简称默认取名称,改名后同步即自动重命名现有会话标题(不需要安装器)。移除账号只停止后续同步,不删除已归档聊天记录。
|
|
11
49
|
- **登录新账号**:点「+ 登录新账号」→ 全新的临时 Edge 配置直接打开登录页(不显示旧账号、无黑框)→ 登录并校验 userId 成功后自动保存 token 到插件数据目录 `.dsh-chat-history-sync/config.json`,未登录/取消不会新增账号;已有账号再次登录会更新资料而不是新增。
|
|
12
50
|
- **附件三档**:全部下载 / 只存图片预览 / 都不下载;设置页显示「预计 N 个附件 · X MB」。
|
|
13
51
|
- **token 加密**:token 用 Windows DPAPI 加密为 `tokenEnc`,`config.json` 不保存明文;`run-config` 用完即删。
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
52
|
+
- **每日汇总**:自动同步有变化时,9:00 后只发一条普通通知;可在设置页关闭。
|
|
53
|
+
- **每小时自动同步**:定时检查网页端增量;**只在有新增/更新时**生成分类目录、导出、报告与系统通知,无变化时静默。
|
|
54
|
+
- **分类目录**:按主题自动分类,作为**报告/目录**交付,不再创建分类工作区;每类超过 9 条自动拆「(续)」。
|
|
17
55
|
- **同步报告**:报告追加到同一个「聊天历史同步报告」会话(不新建),正文含分类统计 + 完整目录(账号简称 · 月份 · 标题 + 会话位置链接);设置页可展开最近报告。
|
|
18
|
-
-
|
|
56
|
+
- **新会话安装(确认制)**:同步结果有新增/更新时,设置页先出现「检测到新会话 → 现在加入并重启 / 稍后再说」;点「现在加入并重启」才调度安装(约 20 秒后重启 DSH,安装前做进程检查)。没有新增或点「稍后再说」不会重启;状态卡会保留「有会话待安装 / 安装」入口。
|
|
19
57
|
|
|
20
58
|
## 工作区布局(2026-11-18 迁移后)
|
|
21
59
|
|
|
22
|
-
- DSH
|
|
23
|
-
-
|
|
60
|
+
- DSH 里只保留**月份工作区**,分类不再建工作区。
|
|
61
|
+
- 旧版建的分类工作区会先合并/备份,再退役;`workspace.json` 写前备份。
|
|
24
62
|
- `history/ws/<分类>/` 里的参考来源与 PDF 原件**保留**(月份会话里的链接指向它们)。
|
|
25
|
-
-
|
|
63
|
+
- 再次安装由内置安装器完成(按月增量、通常数秒)。同步检测到新会话时先出确认卡,点「现在加入并重启」才重启。
|
|
26
64
|
|
|
27
65
|
## 费用
|
|
28
66
|
|
|
@@ -32,19 +70,9 @@
|
|
|
32
70
|
|
|
33
71
|
- 设置 → 聊天历史同步 → 同步账号:编辑名称 / 简称 / 启停 / 删除。
|
|
34
72
|
- token 只存在 `.dsh-chat-history-sync/config.json`;新增账号用「登录新账号」流程自动写入。
|
|
35
|
-
- `dataset` / `root` 由登录流程自动生成(`history/_raw/conversations.<prefix>.json`、`history/ws-<prefix
|
|
73
|
+
- `dataset` / `root` 由登录流程自动生成(`history/_raw/conversations.<prefix>.json`、`history/ws-<prefix>`);正常使用不需要手动配置。
|
|
36
74
|
- 简称映射写在 `history/_raw/account-prefixes.json`,安装器按它生成 `[简称]` 标题;数据集文件名保持稳定,改简称不会产生重复数据集。
|
|
37
|
-
- 安装器会**动态发现** `history/_raw/conversations.*.json`(任意账号 +
|
|
38
|
-
|
|
39
|
-
## 安装
|
|
40
|
-
|
|
41
|
-
发布到 npm 后:
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
dsh plugin add dsh-chat-history-sync
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
本机开发仍可用本地 `file:` 依赖(profile 的 `package.json` 指向 `tools/plugin-memory-sync`)。
|
|
75
|
+
- 安装器会**动态发现** `history/_raw/conversations.*.json`(任意账号 + 登录新账号),把新账号会话按月合并进月份工作区;沙箱已验证新增账号场景。
|
|
48
76
|
|
|
49
77
|
## 平台
|
|
50
78
|
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Security
|
|
2
|
+
|
|
3
|
+
## Data collected
|
|
4
|
+
|
|
5
|
+
- DeepSeek chat history, account display name/avatar, and a DPAPI-encrypted token
|
|
6
|
+
- No phone number, email address, analytics, or telemetry
|
|
7
|
+
- Accounts are matched by `userId` / token only
|
|
8
|
+
|
|
9
|
+
## Local storage
|
|
10
|
+
|
|
11
|
+
- Runtime data stays in the DSH profile's `.dsh-chat-history-sync` directory
|
|
12
|
+
- Tokens are stored as Windows DPAPI `tokenEnc`; plaintext `token`, `phone`, and `email` are removed on load/save
|
|
13
|
+
- `run-config.json` and `login-result.json` are deleted at startup; stale temporary Edge profiles are removed after 30 minutes
|
|
14
|
+
- Diagnostic export contains counts and status only, not logs, account names, tokens, or phone numbers
|
|
15
|
+
|
|
16
|
+
## Removing an account
|
|
17
|
+
|
|
18
|
+
- Removing an account stops future sync and removes the account entry/token from the plugin config
|
|
19
|
+
- Archived conversations and attachments are kept; delete them manually if required
|
|
20
|
+
- This is intentional: the plugin is append-only and does not silently destroy history
|
|
21
|
+
|
|
22
|
+
## Network
|
|
23
|
+
|
|
24
|
+
- Sync and login only contact `chat.deepseek.com` and DeepSeek file hosts
|
|
25
|
+
- No model calls
|
|
26
|
+
- No telemetry endpoint
|
|
27
|
+
|
|
28
|
+
## Reporting
|
|
29
|
+
|
|
30
|
+
Open an issue at the public repository. Do not include tokens, phone numbers, account names, or chat contents in a public report.
|