@tianyulinfeng1/dsh-plugin-deepseek-chat 1.1.1 → 1.1.5

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,67 +1,261 @@
1
- # Changelog
2
-
3
- All notable changes to this project are documented here.
4
-
5
- ## 1.1.1 — 2026-11-09
6
-
7
- ### Fixed
8
-
9
- - **Switching panels/sessions no longer asks for a fresh QR scan.** v1.1.0 keyed the
10
- desktop guest partition to the asynchronous DSH account probe. DSH's
11
- `getState()` can transiently fail during a reconnect, so the partition changed
12
- and handed the panel a brand-new cookie jar. The guest workspace is now the
13
- constant `panel:deepseek-chat` and the conversation key is the constant
14
- `dsh-plugin-deepseek-chat:last-url`.
15
- - The DSH account status strip is now **display only**: it never feeds the lease
16
- identity, an epoch, or the guest lifecycle. A transient `unknown` is ignored;
17
- only a confirmed `signed-out` updates the strip.
18
- - The guest starts on mount immediately instead of waiting for the async account
19
- Remote, so a failed/late probe never blocks chat.
20
-
21
- ### Documentation
22
-
23
- - Documented, with source evidence, why a pure plugin **cannot** make
24
- `chat.deepseek.com` reuse the already-signed-in DSH account: the two use
25
- different credentials (Platform `x-dsh-auth-token` vs the site's own Token),
26
- the renderer bridge exposes no token/cookie API, and the archive has no SSO or
27
- cookie-injection entry point.
28
- - Reworked `docs/login-persistence.md` around the upstream
29
- `docs/patch-dsh-persistent-partition.cjs`: DSH `0.2.1-rc.3+` (including
30
- `0.2.2-rc.1`) ships per-file SHA256 **ASAR integrity**, so the patch must
31
- recompute and sync `lib/main.js`'s hash. A byte-only replacement would crash
32
- DSH on restart with "ASAR Integrity Violation".
33
- - Added `scripts/patch-dsh-persistent-partition.cjs` (upstream script: equal-length
34
- replacement, integrity re-sync, full-archive verification, `--dry-run`,
35
- idempotency, automatic backup). The earlier byte-only `.mjs` script is
36
- deprecated and now fails loudly.
37
-
38
- ### Verification
39
-
40
- - Offline self-check: 35 cases, all passing (fixed partition, no rebuild on
41
- account-state churn, partition reuse across panel switches, envelope parsing,
42
- crash containment, popup allowlist).
43
- - `app.asar` patch verified independently: 20519 files, 0 integrity failures;
44
- `lib/main.js` header hash matches the actual SHA256 of the patched bytes.
45
-
46
- ### Packaging
47
-
48
- - Published to npm as **`@tianyulinfeng1/dsh-plugin-deepseek-chat`** (the
49
- registry name this project owns). `package.json` and `cordis.patch.yml` now
50
- carry that scoped package name so an npm-installed copy mounts under the same
51
- `deepseek-chat` bundle id; the GitHub install routes (`github:sweet560/...`)
52
- are unchanged.
53
-
54
- ## 1.1.0 — 2026-11-09
55
-
56
- - Added support for DSH `0.2.2-rc.1` (`engines.dsh >=0.2.2-rc.1`).
57
- - Added a DSH account status strip via the official `ctx.remote.account` Remote
58
- (correct generated `{ ok, value }` envelope parsing).
59
- - Tightened conversation and popup URL validation; removed the dead guest element
60
- before showing Retry.
61
- - **Note:** keyed the guest partition to account state, which broke login
62
- persistence. Fixed in 1.1.1.
63
-
64
- ## 1.0.0
65
-
66
- First local release: sidebar entry, full-width embedded chat, last-conversation
67
- memory, and crash containment.
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here.
4
+
5
+ ## 1.1.5 — 2026-11-11
6
+
7
+ ### 设置页新增「关于本插件」与「检查更新」
8
+
9
+ - **基础信息区块**:设置页展示插件版本号(`1.1.5`)、作者(`sweet560`)、
10
+ 功能简介、开源许可证(`MIT`),以及两个 `https` 外链(npm 插件页面 /
11
+ GitHub 仓库,`target="_blank"` 由桌面壳用系统浏览器打开)。这些值以
12
+ 模块级常量保存(client bundle 不能 import package.json),并由离线自检
13
+ 逐字段断言与 `package.json` 一致——沿用 factory id === 包名的回归思路。
14
+ - **「检查更新」按钮**:点击后从公开 JSON 接口读取最新发布版本号,
15
+ **npm 优先、GitHub 兜底**:
16
+ - npm:`https://registry.npmjs.org/-/package/@tianyulinfeng1%2fdsh-plugin-deepseek-chat/dist-tags`(取 `latest`);
17
+ - GitHub:`https://raw.githubusercontent.com/sweet560/dsh-plugin-deepseek-chat/main/package.json`(取 `version`,避开 `api.github.com` 的限流)。
18
+ 两处都带宽松 CORS、主窗口未设置 `connect-src` CSP 限制,因此直接用
19
+ renderer 的 `fetch()` 即可,**不新增 Host 同源回环路由**、`lib/index.js`
20
+ 空宿主半侧保持不变。每个请求带 8 秒 `AbortController` 超时。
21
+ - **版本比较用数字逐段比较**(`compareVersion()`),不用字符串相等:
22
+ 本地未发版的 `1.1.5` 会领先已发布的 `latest`(实测 `1.1.2`),此时显示
23
+ 「已是最新版本」而非误报有更新;仅当远端版本更高才显示「发现新版本」。
24
+ - **文字状态 + 跳转链接**:状态行显示「点击按钮… / 正在检查更新… /
25
+ 已是最新版本 / 发现新版本 x.y.z / 检查更新失败:原因」,并在检查结束后
26
+ 附带 npm / GitHub 跳转链接。检查中按钮禁用且忽略重复点击;网络不可用、
27
+ 两个来源都失败、没有可用 fetch 时都给出失败兜底,异常不外泄。
28
+ - **Verification**:`node --check lib/client.js` 通过;`npm test` 全部通过
29
+ (新增基础信息常量一致性、语义版本比较、载荷解析、npm/GitHub 兜底、
30
+ 检查更新各状态分支、设置页渲染与点击联动等断言);`git diff --check` 通过。
31
+ - **Packaging**:`package.json` / `lib/client.js` / `README.md` /
32
+ `README.en.md` / `locale/*.json` / `CHANGELOG.md` 同步升到 `1.1.5`。
33
+
34
+ ## 1.1.4 — 2026-11-11
35
+
36
+ ### 新增设置页 + 顶栏标签页可配置 + 网页铺满会话区
37
+
38
+ - **新增设置页**:通过官方 `settings.section` 槽注册「DeepSeek 聊天」设置页
39
+ (`id: deepseek-chat-settings`、`order: 48`),沿用 `dsh-wechat-reminder` 等
40
+ 插件相同的 localStorage 配置范式。设置项:
41
+ - **显示顶部标签栏**(`showTab`,默认 `true`):关闭后移除
42
+ `conversation.view` 注册,只保留左侧栏图标 + 全屏主面板入口;
43
+ - **顶部标签栏名称**(`tabLabel`,默认 `DeepSeek 聊天`):可自定义,
44
+ 留空自动回退默认,最长 40 字符。名称输入框默认为**空白**,仅以灰色
45
+ 占位提示显示默认名;点击输入框即可直接输入新名字,无需先删默认文字
46
+ (组件内 `draft` state:默认名不写入 `value`,纯空白输入立即清空
47
+ draft 以恢复灰提示)。
48
+ - **配置持久化**:`window.localStorage` 独立键
49
+ `dsh-plugin-deepseek-chat:config`(与会话记忆 `…:last-url` 分离);
50
+ `readConfig()` 按类型校验字段,损坏的 JSON / 错误类型一律回退默认;
51
+ `writeConfig()` 合并 patch 后通知订阅者;`subscribeConfig()` 返回的
52
+ disposer 在 `ctx.effect` 清理时调用。
53
+ - **标签行即时刷新**:`conversation.view` 的标签行只在槽注册表增删 /
54
+ locale 变化时重算(`dsh-client-ui-conversation` 的 `viewTabs()` +
55
+ `slots.subscribe("conversation.view", refreshViews)`),label thunk 本身
56
+ 不订阅配置。因此 `syncView()` 在开关或名称变化时先 dispose 旧的注册、
57
+ 再重新 `ctx.slots.inject("conversation.view", …)`,让顶栏立刻显示新名字
58
+ 或隐藏标签。`main` / `sidebar.panellist` / `settings.section` 三处注册
59
+ 保持静态、各自独立 try/catch。
60
+ - **图3 修复:网页铺满会话区、盖住输入框**:选中「网页聊天」标签时,
61
+ DSH 自身的对话消息与底部 composer 输入框(`.an3WzG_composerSeat`,
62
+ `z-index: 9`)仍露在网页下方。原因是 `viewArea`(含本插件 webview)与
63
+ `composerSeat` 是 `scrollBody` 内上下并列的兄弟,且 active 阶段
64
+ `viewArea` 为 `flex: 1 0 auto; min-height: auto`,`height: 100%` 没有
65
+ 确定父高而塌陷。顶栏入口现在用独立的 `ViewTabShell` 包装:不透明的
66
+ 绝对定位浮层(`position: absolute; inset: 0; z-index: 50;
67
+ overflow: hidden`),以 `position: relative` 的 `.an3WzG_body` 为
68
+ containing block 覆盖整个会话 body,盖住 composer;wrapper 有确定高度,
69
+ 内部 `styles.root` 的 `height: 100%` 得以解析,网页聊天铺满。
70
+ header(含标签行)在 root 内是 body 之上的兄弟,不被浮层覆盖,用户仍可
71
+ 点「对话」切回;左侧栏 / 全屏主面板入口仍用普通 `ChatPanelShell`。
72
+ - **图2 红框:按用户确认「先不处理」**——「DSH认证失败修复」是
73
+ chat.deepseek.com 网页内部自带的会话标题胶囊,插件不注入 CSS/JS 去改
74
+ 第三方网页,本次不做改动。
75
+ - 工厂 id 仍为 `@tianyulinfeng1/dsh-plugin-deepseek-chat`(与
76
+ `package.json` 的 `name` 一致,v1.1.2 的 web boot 崩溃防护不复发);
77
+ `inject` 仍为 `["slots"]`。
78
+
79
+ ### Verification
80
+
81
+ - `node --check lib/client.js` 通过。
82
+ - 离线自检 `node test/check-client.mjs` 全部通过(`RESULT: PASS`):
83
+ 四处槽位注册、设置默认值 / 类型校验 / 持久化 / 订阅通知、开关与自定义
84
+ 标签名触发 `conversation.view` dispose+reinject、顶栏浮层
85
+ (`inset: 0` / `z-index: 50` / 不透明背景)、工厂 id 与包名一致、
86
+ Web 表层 inert、两入口共用固定分区、纯网页聊天无账号条、URL 白名单、
87
+ 会话记忆、租约释放、弹窗白名单、崩溃隔离、反复开关、切走标签页释放租约。
88
+
89
+ ### Packaging
90
+
91
+ - 版本 `1.1.4`,npm 包名保持 `@tianyulinfeng1/dsh-plugin-deepseek-chat` 不变;
92
+ GitHub / Gitee 安装路由不变。
93
+
94
+ ## 1.1.3 — 2026-11-11
95
+
96
+ ### 移除账号状态显示 + 新增会话顶栏标签页
97
+
98
+ - **移除账号状态显示**:彻底删除面板顶部的账号状态条、DSH 账号探测
99
+ (`ctx.remote.account`)、5 秒轮询、账号同步 store 与相关文案 / 样式 /
100
+ 状态订阅。面板现在是「纯网页聊天」,挂载即申请租约、立即启动,不再等待
101
+ 任何异步账号流程。`exports.__test__` 中账号相关 API 全部移除。
102
+ - **新增会话顶栏标签页**:通过官方 `conversation.view` 槽注册一个
103
+ 「网页聊天」标签(`id: deepseek-chat-view`、`order: 100`、
104
+ `label: () => COPY.tab`),出现在「对话 / 轨迹 / 上下文 / 压缩 / 编队 / 统计」
105
+ 这一行。它与左侧栏入口、全屏主面板**共用同一个 ChatPanelShell 组件**和
106
+ 同一个固定分区 `panel:deepseek-chat`,因此登录态与会话记忆在两个入口间通用。
107
+ - **保留左侧栏入口**:用户确认「两入口并存」——左侧栏图标 + 全屏主面板照旧,
108
+ 顶栏另加标签页。
109
+ - **注册健壮性**:原来 main 与 sidebar.panellist 两处 `ctx.slots.inject` 被
110
+ 同一个 try/catch 包住,任一失败会连带另一个也不注册;现在三处注册
111
+ (main / sidebar.panellist / conversation.view)改为各自独立 try/catch。
112
+ - 工厂 id 仍为 `@tianyulinfeng1/dsh-plugin-deepseek-chat`(与 `package.json`
113
+ 的 `name` 一致,v1.1.2 的 web boot 崩溃防护不复发);`inject` 仍为
114
+ `["slots"]`。
115
+
116
+ ### Verification
117
+
118
+ - `node --check lib/client.js` 通过。
119
+ - 离线自检 `node test/check-client.mjs` 全部通过(`RESULT: PASS`):三处槽位
120
+ 注册、工厂 id 与包名一致、Web 表层 inert、两入口共用组件与分区、纯网页聊天
121
+ 无账号条、URL 白名单、会话记忆、租约释放、弹窗白名单、崩溃隔离、反复开关、
122
+ 顶栏标签页切走释放租约。
123
+
124
+ ### Packaging
125
+
126
+ - 版本 `1.1.3`,npm 包名保持 `@tianyulinfeng1/dsh-plugin-deepseek-chat` 不变;
127
+ GitHub / Gitee 安装路由不变。
128
+
129
+ ## 1.1.2 — 2026-11-09
130
+
131
+ ### ⚠️ 重点修复:web boot 崩溃(duplicate factory registration)
132
+
133
+ 这是 **v1.1.1 的打包回归**:升级到 v1.1.1 后,DSH 桌面版页面在启动阶段
134
+ 直接失败、整个界面打不开。用户提供的崩溃日志文件为
135
+ `C:\Users\Administrator\AppData\Roaming\@deepseek-ai\dsh-desktop\logs\crash-2026-11-09T08-27-01-314Z-web-boot.log`。
136
+
137
+ 日志环境(原文):`time: 2026-11-09T08:27:01.314Z`、`source: web-boot`、
138
+ `app: @deepseek-ai/dsh-desktop 0.2.2-rc.1`、`win32 x64`、
139
+ `electron 44.7.0`、`node 24.21.0`、`locale zh-CN`。
140
+
141
+ 日志中的原始报错文本(原文):
142
+
143
+ > `Error: web boot: 1 entry did not activate`
144
+ >
145
+ > `@tianyulinfeng1/dsh-plugin-deepseek-chat: import failed (see console for the import error)`
146
+
147
+ 渲染进程(renderer)控制台的原始报错(原文):
148
+
149
+ > `client-modules: duplicate factory registration for "dsh-plugin-deepseek-chat" (bundle executed twice without invalidate?)`
150
+
151
+ 根因链(逐条):
152
+
153
+ 1. v1.1.1 把 npm 包名从无 scope 的 `dsh-plugin-deepseek-chat` 改成了带
154
+ scope 的 `@tianyulinfeng1/dsh-plugin-deepseek-chat`(`package.json` 的 `name`)。
155
+ 2. 但 `lib/client.js` 里 `window.__ModuleLoader__.load({ id: ... })` 注册的
156
+ 工厂 id 仍是旧的短名 `dsh-plugin-deepseek-chat`,**工厂 id 与包名不一致**。
157
+ 3. DSH 的 `dsh-client-modules` Host 半侧用 `package.json` 的 `name`(带 scope
158
+ 的完整包名)作为 client 图的行 id。
159
+ 4. `arrive()` 执行完 bundle 脚本后会检查 `factories.has(<行 id>)`;因为工厂
160
+ 实际只注册在短名下,对 `@tianyulinfeng1/dsh-plugin-deepseek-chat` 的检查
161
+ 结果为 `false`,Host 便判定该包「没有注册」。
162
+ 5. Host 因此把**同一个 bundle 脚本再执行一次**。
163
+ 6. 第二次注册时短名 id `dsh-plugin-deepseek-chat` 已存在,于是抛出
164
+ `duplicate factory registration ... (bundle executed twice without invalidate?)`。
165
+ 7. 该包被记为 `import failed`,web boot 统计到「1 个 entry 未激活」,抛出
166
+ `Error: web boot: 1 entry did not activate`,**整个页面启动失败**。
167
+ 8. 日志里 `dshmarket` 反复 install/remove 只是历史操作记录,**不是**本次崩溃
168
+ 的原因。
169
+
170
+ **修改了哪里、为什么能解决**:只改 `lib/client.js` 中
171
+ `window.__ModuleLoader__.load({ id: ... })` 的工厂 `id`,把它从短名
172
+ `dsh-plugin-deepseek-chat` 改为与 `package.json` 的 `name` 完全一致的
173
+ `@tianyulinfeng1/dsh-plugin-deepseek-chat`。对齐之后,`arrive()` 的
174
+ `factories.has(<行 id>)` 在 bundle 执行完即为 `true`,Host 认为该包已正常
175
+ 注册,不会再重复执行同一脚本,也就不会出现二次注册和
176
+ `duplicate factory registration`;entry 正常激活,web boot 完成。
177
+
178
+ **回归防护**:`test/check-client.mjs` 新增断言——「工厂 id 必须等于
179
+ `package.json` 的 `name`」。今后再改包名而忘了同步工厂 id,离线自检会立刻
180
+ 失败,不会把同样的回归带进发布包。
181
+
182
+ ### Verification
183
+
184
+ - 离线自检 35 项全部通过(`RESULT: PASS`),其中包含新增的「工厂 id 必须
185
+ 等于 `package.json` 的 `name`」回归断言。
186
+ - 扫描当前 DSH profile 全部 **30 个 web client bundle** 的 id / 包名一致性,
187
+ **0 处不匹配**。
188
+ - 完整发布说明见 `docs/RELEASE_NOTES_v1.1.2.md`。
189
+
190
+ ### Packaging
191
+
192
+ - 版本 `1.1.2`,npm 包名保持 `@tianyulinfeng1/dsh-plugin-deepseek-chat` 不变;
193
+ GitHub / Gitee 安装路由不变。
194
+ - 发布产物:`dsh-plugin-deepseek-chat-1.1.2.tgz`(`npm pack` 对 scoped 包的
195
+ 原生输出名为 `tianyulinfeng1-dsh-plugin-deepseek-chat-1.1.2.tgz`)。
196
+ - 本次只修 client bundle 的工厂 id,其余功能(固定 guest 分区、账号状态仅
197
+ 展示、崩溃隔离等)与 v1.1.1 相同。
198
+
199
+ ## 1.1.1 — 2026-11-09
200
+
201
+ ### Fixed
202
+
203
+ - **Switching panels/sessions no longer asks for a fresh QR scan.** v1.1.0 keyed the
204
+ desktop guest partition to the asynchronous DSH account probe. DSH's
205
+ `getState()` can transiently fail during a reconnect, so the partition changed
206
+ and handed the panel a brand-new cookie jar. The guest workspace is now the
207
+ constant `panel:deepseek-chat` and the conversation key is the constant
208
+ `dsh-plugin-deepseek-chat:last-url`.
209
+ - The DSH account status strip is now **display only**: it never feeds the lease
210
+ identity, an epoch, or the guest lifecycle. A transient `unknown` is ignored;
211
+ only a confirmed `signed-out` updates the strip.
212
+ - The guest starts on mount immediately instead of waiting for the async account
213
+ Remote, so a failed/late probe never blocks chat.
214
+
215
+ ### Documentation
216
+
217
+ - Documented, with source evidence, why a pure plugin **cannot** make
218
+ `chat.deepseek.com` reuse the already-signed-in DSH account: the two use
219
+ different credentials (Platform `x-dsh-auth-token` vs the site's own Token),
220
+ the renderer bridge exposes no token/cookie API, and the archive has no SSO or
221
+ cookie-injection entry point.
222
+ - Reworked `docs/login-persistence.md` around the upstream
223
+ `docs/patch-dsh-persistent-partition.cjs`: DSH `0.2.1-rc.3+` (including
224
+ `0.2.2-rc.1`) ships per-file SHA256 **ASAR integrity**, so the patch must
225
+ recompute and sync `lib/main.js`'s hash. A byte-only replacement would crash
226
+ DSH on restart with "ASAR Integrity Violation".
227
+ - Added `scripts/patch-dsh-persistent-partition.cjs` (upstream script: equal-length
228
+ replacement, integrity re-sync, full-archive verification, `--dry-run`,
229
+ idempotency, automatic backup). The earlier byte-only `.mjs` script is
230
+ deprecated and now fails loudly.
231
+
232
+ ### Verification
233
+
234
+ - Offline self-check: 35 cases, all passing (fixed partition, no rebuild on
235
+ account-state churn, partition reuse across panel switches, envelope parsing,
236
+ crash containment, popup allowlist).
237
+ - `app.asar` patch verified independently: 20519 files, 0 integrity failures;
238
+ `lib/main.js` header hash matches the actual SHA256 of the patched bytes.
239
+
240
+ ### Packaging
241
+
242
+ - Published to npm as **`@tianyulinfeng1/dsh-plugin-deepseek-chat`** (the
243
+ registry name this project owns). `package.json` and `cordis.patch.yml` now
244
+ carry that scoped package name so an npm-installed copy mounts under the same
245
+ `deepseek-chat` bundle id; the GitHub install routes (`github:sweet560/...`)
246
+ are unchanged.
247
+
248
+ ## 1.1.0 — 2026-11-09
249
+
250
+ - Added support for DSH `0.2.2-rc.1` (`engines.dsh >=0.2.2-rc.1`).
251
+ - Added a DSH account status strip via the official `ctx.remote.account` Remote
252
+ (correct generated `{ ok, value }` envelope parsing).
253
+ - Tightened conversation and popup URL validation; removed the dead guest element
254
+ before showing Retry.
255
+ - **Note:** keyed the guest partition to account state, which broke login
256
+ persistence. Fixed in 1.1.1.
257
+
258
+ ## 1.0.0
259
+
260
+ First local release: sidebar entry, full-width embedded chat, last-conversation
261
+ memory, and crash containment.