@tianyulinfeng1/dsh-plugin-deepseek-chat 1.1.2 → 1.1.6

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
@@ -2,6 +2,150 @@
2
2
 
3
3
  All notable changes to this project are documented here.
4
4
 
5
+ ## 1.1.6 — 2026-11-11
6
+
7
+ ### OIDC 可信发布(Trusted Publishing)链路测试
8
+
9
+ - **`.github/workflows/publish.yml` 改为 OIDC 模式**:新增
10
+ `permissions.id-token: write`(OIDC 必需)、`node-version: 22`(≥ 22.14.0)、
11
+ `npm install -g npm@latest`(npm CLI ≥ 11.5.1)、
12
+ `npm publish --provenance --access public`;删除 `NODE_AUTH_TOKEN` 环境变量、
13
+ `environment: npm-更新` 声明与 `NPM_TOKEN` 校验步骤;保留
14
+ `registry-url: https://registry.npmjs.org`、`runs-on: ubuntu-latest`、
15
+ `repository.url` 与 GitHub 仓库精确匹配。
16
+ - **Environment 留空**:GitHub 仓库未创建任何 Environment(`environments` 接口
17
+ `total_count: 0`),与 npm 端 Trusted Publisher 的 Environment name 可选留空
18
+ 一致,因此 workflow 不声明 `environment:`。
19
+ - **纯发布链路测试**:功能与 1.1.5 完全相同,仅把版本号升到 `1.1.6` 并推送
20
+ GitHub `main`(不打 tag,避免重复触发 CI),用一次真实的 Actions 运行验证
21
+ npm 端 Trusted Publisher 是否已正确配置并允许 `npm publish`。
22
+ - **Verification**:`node --check lib/client.js` 通过;`npm test` 全部通过
23
+ (元信息版本一致性等断言随 `package.json` 同步到 `1.1.6`)。
24
+
25
+ ## 1.1.5 — 2026-11-11
26
+
27
+ ### 设置页新增「关于本插件」与「检查更新」
28
+
29
+ - **基础信息区块**:设置页展示插件版本号(`1.1.5`)、作者(`sweet560`)、
30
+ 功能简介、开源许可证(`MIT`),以及两个 `https` 外链(npm 插件页面 /
31
+ GitHub 仓库,`target="_blank"` 由桌面壳用系统浏览器打开)。这些值以
32
+ 模块级常量保存(client bundle 不能 import package.json),并由离线自检
33
+ 逐字段断言与 `package.json` 一致——沿用 factory id === 包名的回归思路。
34
+ - **「检查更新」按钮**:点击后从公开 JSON 接口读取最新发布版本号,
35
+ **npm 优先、GitHub 兜底**:
36
+ - npm:`https://registry.npmjs.org/-/package/@tianyulinfeng1%2fdsh-plugin-deepseek-chat/dist-tags`(取 `latest`);
37
+ - GitHub:`https://raw.githubusercontent.com/sweet560/dsh-plugin-deepseek-chat/main/package.json`(取 `version`,避开 `api.github.com` 的限流)。
38
+ 两处都带宽松 CORS、主窗口未设置 `connect-src` CSP 限制,因此直接用
39
+ renderer 的 `fetch()` 即可,**不新增 Host 同源回环路由**、`lib/index.js`
40
+ 空宿主半侧保持不变。每个请求带 8 秒 `AbortController` 超时。
41
+ - **版本比较用数字逐段比较**(`compareVersion()`),不用字符串相等:
42
+ 本地未发版的 `1.1.5` 会领先已发布的 `latest`(实测 `1.1.2`),此时显示
43
+ 「已是最新版本」而非误报有更新;仅当远端版本更高才显示「发现新版本」。
44
+ - **文字状态 + 跳转链接**:状态行显示「点击按钮… / 正在检查更新… /
45
+ 已是最新版本 / 发现新版本 x.y.z / 检查更新失败:原因」,并在检查结束后
46
+ 附带 npm / GitHub 跳转链接。检查中按钮禁用且忽略重复点击;网络不可用、
47
+ 两个来源都失败、没有可用 fetch 时都给出失败兜底,异常不外泄。
48
+ - **Verification**:`node --check lib/client.js` 通过;`npm test` 全部通过
49
+ (新增基础信息常量一致性、语义版本比较、载荷解析、npm/GitHub 兜底、
50
+ 检查更新各状态分支、设置页渲染与点击联动等断言);`git diff --check` 通过。
51
+ - **Packaging**:`package.json` / `lib/client.js` / `README.md` /
52
+ `README.en.md` / `locale/*.json` / `CHANGELOG.md` 同步升到 `1.1.5`。
53
+
54
+ ## 1.1.4 — 2026-11-11
55
+
56
+ ### 新增设置页 + 顶栏标签页可配置 + 网页铺满会话区
57
+
58
+ - **新增设置页**:通过官方 `settings.section` 槽注册「DeepSeek 聊天」设置页
59
+ (`id: deepseek-chat-settings`、`order: 48`),沿用 `dsh-wechat-reminder` 等
60
+ 插件相同的 localStorage 配置范式。设置项:
61
+ - **显示顶部标签栏**(`showTab`,默认 `true`):关闭后移除
62
+ `conversation.view` 注册,只保留左侧栏图标 + 全屏主面板入口;
63
+ - **顶部标签栏名称**(`tabLabel`,默认 `DeepSeek 聊天`):可自定义,
64
+ 留空自动回退默认,最长 40 字符。名称输入框默认为**空白**,仅以灰色
65
+ 占位提示显示默认名;点击输入框即可直接输入新名字,无需先删默认文字
66
+ (组件内 `draft` state:默认名不写入 `value`,纯空白输入立即清空
67
+ draft 以恢复灰提示)。
68
+ - **配置持久化**:`window.localStorage` 独立键
69
+ `dsh-plugin-deepseek-chat:config`(与会话记忆 `…:last-url` 分离);
70
+ `readConfig()` 按类型校验字段,损坏的 JSON / 错误类型一律回退默认;
71
+ `writeConfig()` 合并 patch 后通知订阅者;`subscribeConfig()` 返回的
72
+ disposer 在 `ctx.effect` 清理时调用。
73
+ - **标签行即时刷新**:`conversation.view` 的标签行只在槽注册表增删 /
74
+ locale 变化时重算(`dsh-client-ui-conversation` 的 `viewTabs()` +
75
+ `slots.subscribe("conversation.view", refreshViews)`),label thunk 本身
76
+ 不订阅配置。因此 `syncView()` 在开关或名称变化时先 dispose 旧的注册、
77
+ 再重新 `ctx.slots.inject("conversation.view", …)`,让顶栏立刻显示新名字
78
+ 或隐藏标签。`main` / `sidebar.panellist` / `settings.section` 三处注册
79
+ 保持静态、各自独立 try/catch。
80
+ - **图3 修复:网页铺满会话区、盖住输入框**:选中「网页聊天」标签时,
81
+ DSH 自身的对话消息与底部 composer 输入框(`.an3WzG_composerSeat`,
82
+ `z-index: 9`)仍露在网页下方。原因是 `viewArea`(含本插件 webview)与
83
+ `composerSeat` 是 `scrollBody` 内上下并列的兄弟,且 active 阶段
84
+ `viewArea` 为 `flex: 1 0 auto; min-height: auto`,`height: 100%` 没有
85
+ 确定父高而塌陷。顶栏入口现在用独立的 `ViewTabShell` 包装:不透明的
86
+ 绝对定位浮层(`position: absolute; inset: 0; z-index: 50;
87
+ overflow: hidden`),以 `position: relative` 的 `.an3WzG_body` 为
88
+ containing block 覆盖整个会话 body,盖住 composer;wrapper 有确定高度,
89
+ 内部 `styles.root` 的 `height: 100%` 得以解析,网页聊天铺满。
90
+ header(含标签行)在 root 内是 body 之上的兄弟,不被浮层覆盖,用户仍可
91
+ 点「对话」切回;左侧栏 / 全屏主面板入口仍用普通 `ChatPanelShell`。
92
+ - **图2 红框:按用户确认「先不处理」**——「DSH认证失败修复」是
93
+ chat.deepseek.com 网页内部自带的会话标题胶囊,插件不注入 CSS/JS 去改
94
+ 第三方网页,本次不做改动。
95
+ - 工厂 id 仍为 `@tianyulinfeng1/dsh-plugin-deepseek-chat`(与
96
+ `package.json` 的 `name` 一致,v1.1.2 的 web boot 崩溃防护不复发);
97
+ `inject` 仍为 `["slots"]`。
98
+
99
+ ### Verification
100
+
101
+ - `node --check lib/client.js` 通过。
102
+ - 离线自检 `node test/check-client.mjs` 全部通过(`RESULT: PASS`):
103
+ 四处槽位注册、设置默认值 / 类型校验 / 持久化 / 订阅通知、开关与自定义
104
+ 标签名触发 `conversation.view` dispose+reinject、顶栏浮层
105
+ (`inset: 0` / `z-index: 50` / 不透明背景)、工厂 id 与包名一致、
106
+ Web 表层 inert、两入口共用固定分区、纯网页聊天无账号条、URL 白名单、
107
+ 会话记忆、租约释放、弹窗白名单、崩溃隔离、反复开关、切走标签页释放租约。
108
+
109
+ ### Packaging
110
+
111
+ - 版本 `1.1.4`,npm 包名保持 `@tianyulinfeng1/dsh-plugin-deepseek-chat` 不变;
112
+ GitHub / Gitee 安装路由不变。
113
+
114
+ ## 1.1.3 — 2026-11-11
115
+
116
+ ### 移除账号状态显示 + 新增会话顶栏标签页
117
+
118
+ - **移除账号状态显示**:彻底删除面板顶部的账号状态条、DSH 账号探测
119
+ (`ctx.remote.account`)、5 秒轮询、账号同步 store 与相关文案 / 样式 /
120
+ 状态订阅。面板现在是「纯网页聊天」,挂载即申请租约、立即启动,不再等待
121
+ 任何异步账号流程。`exports.__test__` 中账号相关 API 全部移除。
122
+ - **新增会话顶栏标签页**:通过官方 `conversation.view` 槽注册一个
123
+ 「网页聊天」标签(`id: deepseek-chat-view`、`order: 100`、
124
+ `label: () => COPY.tab`),出现在「对话 / 轨迹 / 上下文 / 压缩 / 编队 / 统计」
125
+ 这一行。它与左侧栏入口、全屏主面板**共用同一个 ChatPanelShell 组件**和
126
+ 同一个固定分区 `panel:deepseek-chat`,因此登录态与会话记忆在两个入口间通用。
127
+ - **保留左侧栏入口**:用户确认「两入口并存」——左侧栏图标 + 全屏主面板照旧,
128
+ 顶栏另加标签页。
129
+ - **注册健壮性**:原来 main 与 sidebar.panellist 两处 `ctx.slots.inject` 被
130
+ 同一个 try/catch 包住,任一失败会连带另一个也不注册;现在三处注册
131
+ (main / sidebar.panellist / conversation.view)改为各自独立 try/catch。
132
+ - 工厂 id 仍为 `@tianyulinfeng1/dsh-plugin-deepseek-chat`(与 `package.json`
133
+ 的 `name` 一致,v1.1.2 的 web boot 崩溃防护不复发);`inject` 仍为
134
+ `["slots"]`。
135
+
136
+ ### Verification
137
+
138
+ - `node --check lib/client.js` 通过。
139
+ - 离线自检 `node test/check-client.mjs` 全部通过(`RESULT: PASS`):三处槽位
140
+ 注册、工厂 id 与包名一致、Web 表层 inert、两入口共用组件与分区、纯网页聊天
141
+ 无账号条、URL 白名单、会话记忆、租约释放、弹窗白名单、崩溃隔离、反复开关、
142
+ 顶栏标签页切走释放租约。
143
+
144
+ ### Packaging
145
+
146
+ - 版本 `1.1.3`,npm 包名保持 `@tianyulinfeng1/dsh-plugin-deepseek-chat` 不变;
147
+ GitHub / Gitee 安装路由不变。
148
+
5
149
  ## 1.1.2 — 2026-11-09
6
150
 
7
151
  ### ⚠️ 重点修复:web boot 崩溃(duplicate factory registration)
package/README.en.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  English | [中文](README.md)
4
4
 
5
- > **Current version: v1.1.2** | Targets DSH **0.2.2-rc.1**
5
+ > **Current version: v1.1.6** | Targets DSH **0.2.2-rc.1**
6
6
 
7
- Adds a **DeepSeek Chat** entry to the **DeepSeek Harness (DSH) desktop** sidebar. Clicking it opens `chat.deepseek.com` full-width in the main area, remembers the last conversation, and shows the current DSH account state.
7
+ Adds **DeepSeek Chat** to the **DeepSeek Harness (DSH) desktop**: a sidebar icon entry and a conversation-header tab (default name **DeepSeek Chat**, configurable). Clicking either opens `chat.deepseek.com` filling the conversation area and remembers the last conversation. A **settings page** (with plugin metadata and a "Check for updates" button) lets you show/hide the header tab and rename it. The panel is **pure web chat** — no account status strip.
8
8
 
9
9
  > Repository: [GitHub](https://github.com/sweet560/dsh-plugin-deepseek-chat) | [Gitee mirror](https://gitee.com/wtt520wyl/dsh-plugin-deepseek-chat)
10
10
 
@@ -12,17 +12,33 @@ Adds a **DeepSeek Chat** entry to the **DeepSeek Harness (DSH) desktop** sidebar
12
12
 
13
13
  ## Features
14
14
 
15
- - Sidebar icon entry, placed between **Plugins** and **Scheduled tasks**.
15
+ - **Two entries coexist**:
16
+ - A sidebar icon, placed between **Plugins** and **Scheduled tasks**, opening the full main area;
17
+ - A tab in the conversation-header tab row ("Dialogue / Trajectory / Context / Compression / Team / Stats"), registered through the official `conversation.view` slot (`id: deepseek-chat-view`, `order: 100`), **default label "DeepSeek Chat"**.
18
+ - **Settings page (v1.1.4)**: registered through the official `settings.section` slot (a "DeepSeek Chat" page in the Settings dialog). Two settings:
19
+ - **Show header tab** (default on): turning it off removes the header tab, leaving only the sidebar entry;
20
+ - **Header tab name** (default `DeepSeek Chat`): the field is **empty by default** and shows the default name only as a grey placeholder; click into it and type a new name directly (no need to delete the default text first). Empty falls back to the default, capped at 40 characters.
21
+ - Settings are persisted in `localStorage` under `dsh-plugin-deepseek-chat:config` and take effect immediately (the tab row re-registers).
22
+ - **About this plugin (v1.1.5)**: the Settings page shows the plugin version, author (`sweet560`), a short description, the open-source license (`MIT`), and two `https` links to the npm package page and the GitHub repository (opened by the desktop shell in the system browser).
23
+ - **Check for updates (v1.1.5)**: the Settings page adds a "Check for updates" button that reads the latest published version from two public JSON endpoints — **npm first, GitHub as a fallback** (npm `dist-tags.latest`, `raw.githubusercontent.com` `package.json`). Versions are compared segment-by-segment numerically: up to date / new version available / check failed all produce a text status with npm/GitHub jump links. Repeated clicks are ignored while checking; network failures and both-source failures are handled gracefully. No Host route is added.
24
+ - **Fills the conversation area (v1.1.4)**: while the header tab is selected, the web chat now fills the whole conversation area and covers DSH's own message list and bottom composer. Switching back to "Dialogue" restores them. The header entry uses an opaque absolutely-positioned overlay (`inset: 0`, `z-index: 50`) over the conversation body; the tab row in the header stays above it and remains clickable.
25
+ - Both entries **share the same chat component** (the header entry wraps it in the full-area overlay) and the same constant partition `panel:deepseek-chat`, so login state and conversation memory are common to both; switching away from the tab releases the lease and re-entering re-acquires the same partition.
16
26
  - Full-width embedded `https://chat.deepseek.com/` (Electron `<webview>` through the desktop guest-lease bridge `window.dshDesktop.browser`).
17
27
  - **Last-conversation memory**: switching panels/sessions or restarting the app reopens the conversation you left, not a new chat.
18
28
  - Auth pages never overwrite that memory; a dead conversation falls back to the site root.
19
29
  - **Stable login session (fixed in v1.1.1)**: the guest partition is the constant `panel:deepseek-chat`; switching panels/sessions back no longer rebuilds the partition or asks for a fresh QR scan.
20
- - **DSH account status**: a strip shows "Synced with the DSH account · name" / "No account" / "Account state unavailable" via the official `ctx.remote.account` Remote. **Display only — it never participates in the guest lifecycle.**
21
30
  - **Crash containment**: if the embedded page's process dies, is destroyed, or never starts, the panel shows a Retry card — the app window no longer goes blank (fixed in v0.4.0).
31
+ - **Pure web chat (v1.1.3)**: the account status strip, account probe, 5-second polling and account-sync store are entirely removed. The panel acquires its lease and starts on mount, with no asynchronous account flow.
22
32
  - Inert on the plain Web surface (`dsh web`): the site sends `frame-ancestors 'none'`, so an iframe cannot carry it, and the guest bridge only exists in the desktop shell.
23
33
 
24
34
  > **v1.1.2 web boot crash fix**: v1.1.1 renamed the npm package to the scoped `@tianyulinfeng1/dsh-plugin-deepseek-chat`, but the client-bundle factory id in `lib/client.js` stayed the old short name `dsh-plugin-deepseek-chat`. That mismatch made the DSH Host re-execute the same bundle and throw `duplicate factory registration`, ending in `web boot: 1 entry did not activate` and a failed page boot. v1.1.2 aligns the factory id with the full package name and adds a regression assertion that the factory id must equal `package.json`'s `name`. See [docs/RELEASE_NOTES_v1.1.2.md](docs/RELEASE_NOTES_v1.1.2.md).
25
35
 
36
+ > **v1.1.3**: removes the account status display and adds the conversation-header "Web Chat" tab, as requested. The old main / sidebar.panellist injections, previously wrapped in one try/catch, are now three independent try/catch blocks so a single failure no longer suppresses the other entries.
37
+
38
+ > **v1.1.4**: adds a settings page (show/hide the header tab + a custom tab name, default "DeepSeek Chat"); fixes the header tab not filling the conversation area (DSH's composer was still visible below the web chat). The red-boxed title chip in the user's second screenshot is a chat.deepseek.com page element; per the user's confirmation it is left untouched — the plugin does not modify the third-party page.
39
+
40
+ > **v1.1.5 (this release)**: adds an About block to Settings (version / author / description / license / npm & GitHub links) and a "Check for updates" button (npm first, GitHub fallback, numeric semver comparison, text status + jump links, timeout and failure fallback). The empty Host half is untouched.
41
+
26
42
  ## Requirements
27
43
 
28
44
  | Item | Requirement |
@@ -83,14 +99,13 @@ dsh plugin --profile desktop add file:"<absolute path to this repository>"
83
99
 
84
100
  - The renderer bridge `globalThis.dshDesktop` exposes only `browser.acquire/release/onOpenRequested` etc. — **no** `getAuthToken`, cookie write, or "open Platform to fetch token" API. `getAuthToken()` exists only in the desktop shell's embedded Platform view (`usage` / `top_up`) preload, main-frame + origin restricted.
85
101
  - The `browserAcquire` IPC only allocates a partition/lease by workspace string; `configureSession()` sets permissions and download interception, **it injects no credentials**. The guest is forced to `sandbox / contextIsolation / webSecurity`.
86
- - So the DSH account state can only be **displayed**; it cannot become a web-session login. One manual QR sign-in is still required.
102
+ - So the DSH account and the web session are unrelated; one manual QR sign-in is still required. **Since v1.1.3 even the account-status display is gone** — the panel is pure web chat.
87
103
 
88
- **What went wrong in v1.1.0 (fixed in v1.1.1)**: the guest partition had been keyed to the asynchronous account probe. DSH's `getState()` can transiently fail during a reconnect or session switch; changing the partition hands the panel a brand-new cookie jar → a fresh QR scan every time you switched back. Now:
104
+ **What went wrong in v1.1.0 (fixed in v1.1.1, account logic removed entirely in v1.1.3)**: the guest partition had been keyed to the asynchronous account probe. DSH's `getState()` can transiently fail during a reconnect or session switch; changing the partition hands the panel a brand-new cookie jar → a fresh QR scan every time you switched back. Now:
89
105
 
90
106
  - `acquire()`'s workspace is the constant `panel:deepseek-chat`, and the conversation key is the constant `dsh-plugin-deepseek-chat:last-url`;
91
- - account state changes only update the strip — no epoch, no guest rebuild, no partition change;
92
- - a transient `unknown` is ignored; only a confirmed `signed-out` updates the display;
93
- - the guest starts on mount immediately, without waiting for the async Remote (a failed probe never blocks chat);
107
+ - no account probe, polling, state subscription or strip participates in the guest lifecycle at all;
108
+ - the guest starts on mount immediately, without waiting for any async Remote;
94
109
  - popup navigation is allowlisted to `chat.deepseek.com` and `platform.deepseek.com` (HTTPS, default port).
95
110
 
96
111
  > To also avoid re-scanning **after restarting DSH**, run [scripts/patch-dsh-persistent-partition.cjs](scripts/patch-dsh-persistent-partition.cjs) per [docs/login-persistence.md](docs/login-persistence.md) to change DSH's random in-memory partition into a deterministic `persist:` one (an `app.asar` edit — modifying the installed app, at your own risk). **It also syncs the per-file SHA256 ASAR integrity required by 0.2.2-rc.1** — a byte-only replacement (the deprecated `.mjs` script) would crash DSH on restart. It requires fully exiting DSH first. That patch preserves web cookies across restarts; it does not make the web chat reuse the DSH token.
@@ -101,6 +116,9 @@ dsh plugin --profile desktop add file:"<absolute path to this repository>"
101
116
  - Within one app run, switching panels or sessions keeps you signed in (fixed partition since v1.1.1).
102
117
  - **Sign in again after restarting DSH**: DSH currently gives embedded browsers a random in-memory partition (`dsh-sidebar-browser-<uuid>`, no `persist:` prefix), so cookies are dropped when the process exits. This plugin does not modify DSH's installation files; to sign in once and stay signed in, apply the equal-length byte patch described in **[docs/login-persistence.md](docs/login-persistence.md)**.
103
118
  - The conversation URL is stored under the fixed key `dsh-plugin-deepseek-chat:last-url`, so the last conversation is restored after a restart (while signed in and while it still exists).
119
+ - The header tab (default **"DeepSeek Chat"**) and the sidebar icon are the same web chat; switching to another tab unmounts this plugin's guest and releases the lease, and switching back reloads it (same partition, login state and conversation memory preserved).
120
+ - **Settings page**: open the DSH **Settings** dialog → "DeepSeek Chat" in the left navigation. Toggle **Show header tab** and edit **Header tab name**. The name field is empty by default, showing "DeepSeek Chat" only as a grey placeholder; click into it and type directly without deleting any default text. Turning the tab off removes the header entry but keeps the sidebar icon; leaving the name empty restores the default "DeepSeek Chat". Settings apply immediately and are stored locally.
121
+ - While the header tab is selected the web chat fills the conversation area and covers DSH's own messages/composer; clicking back to "Dialogue" restores them without losing conversation content.
104
122
 
105
123
  ## Persistent login (optional)
106
124
 
@@ -117,8 +135,7 @@ Note: this modifies the installed application and is outside DSH's support; a DS
117
135
  - chat.deepseek.com detects the Electron embedding and occasionally shows a "usage environment is abnormal" notice. That is site-side behaviour, unrelated to this plugin.
118
136
  - Desktop only; `dsh web` in a browser shows no entry.
119
137
  - If the site changes its conversation URL scheme (currently `/a/chat/s/<id>`), the memory falls back to the site root.
120
- - The DSH account status is display-only; it cannot turn the DSH OAuth token into a chat.deepseek.com web session, so the web chat still needs one manual sign-in on first use.
121
- - `getProfile()` is used only for the display name. If it is temporarily unavailable the strip may lag briefly, but it **never** affects the guest or the login state.
138
+ - A pure plugin cannot reuse the DSH token, so the web chat still needs one manual sign-in on first use (see above). **Since v1.1.3 the panel shows no account status at all.**
122
139
  - Restarting DSH still requires a fresh web sign-in unless the persistent-partition patch in [docs/login-persistence.md](docs/login-persistence.md) is applied.
123
140
 
124
141
  ## Crash containment (v0.4.0)
@@ -133,6 +150,10 @@ The current implementation guards every guest call behind an `isConnected` check
133
150
 
134
151
  | Version | Changes |
135
152
  |---|---|
153
+ | **1.1.6** | **OIDC trusted-publishing pipeline test**: `.github/workflows/publish.yml` now enables `permissions.id-token: write`, Node 22, `npm@latest`, `npm publish --provenance`, and removes `NODE_AUTH_TOKEN` and the `environment` declaration. Version bumped to `1.1.6` and pushed to GitHub to test whether GitHub Actions can publish via npm Trusted Publisher. No functional change from 1.1.5. |
154
+ | **1.1.5** | **Adds About info + Check for updates to Settings**: plugin version / author / description / license / npm & GitHub links, plus a "Check for updates" button (npm `dist-tags` first, GitHub `raw` fallback, numeric segment-by-segment version comparison, text status + jump links, 8-second timeout and failure fallbacks). Metadata constants are asserted equal to `package.json`; offline self-check passes fully (`RESULT: PASS`). |
155
+ | **1.1.4** | **Adds a settings page + makes the header tab configurable + fills the conversation area**: a `settings.section` page (show/hide header tab, custom tab name default "DeepSeek Chat", localStorage persistence, immediate re-registration for the tab row); the header entry uses an opaque absolute overlay to fill the conversation body and cover the composer. The red-boxed in-page title chip is left untouched per user confirmation. Four slot registrations, offline self-check passes fully (`RESULT: PASS`). |
156
+ | **1.1.3** | **Removes the account status display + adds a conversation-header tab**: deletes the account status strip, probe, 5-second polling and account-sync store; adds a `conversation.view` "Web Chat" header tab sharing the component and fixed partition with the sidebar/full-area entries; three slot registrations now use independent try/catch blocks. Offline self-check passes fully (`RESULT: PASS`). |
136
157
  | **1.1.2** | **Fixes the v1.1.1 web boot crash (highlight)**: the client-bundle factory id did not match the npm package name, so DSH re-executed the same bundle, threw `duplicate factory registration`, and failed with `1 entry did not activate` — the whole page would not boot. The factory id in `lib/client.js` is now aligned to `@tianyulinfeng1/dsh-plugin-deepseek-chat`, with a new regression assertion that it must equal `package.json`'s `name`; 35/35 offline checks pass and all 30 client bundles scan with 0 mismatches. See [docs/RELEASE_NOTES_v1.1.2.md](docs/RELEASE_NOTES_v1.1.2.md). |
137
158
  | **1.1.1** | **Fixes the "scan the QR code again on every panel switch" regression**: the guest partition and conversation key are constants; account state is display-only and never touches the guest lifecycle; a transient `unknown` is ignored; the guest no longer waits for the async probe; self-check now asserts a fixed partition and no rebuild on state churn (35 cases). Documents why a pure plugin cannot reuse the DSH token. |
138
159
  | 1.1.0 | DSH `0.2.2-rc.1`: DSH account status strip; correct generated Remote envelope parsing; stricter conversation and popup URL validation; dead guest removal on failure. **This release keyed the partition to account state and broke login persistence (fixed in 1.1.1).** |
@@ -146,11 +167,11 @@ cd dsh-plugin-deepseek-chat
146
167
  node test/check-client.mjs
147
168
  ```
148
169
 
149
- `test/check-client.mjs` loads `lib/client.js` in a `node:vm` sandbox with fake React/DOM/bridge objects and checks registration, Remote envelope parsing, a fixed partition/key, no rebuild on account-state churn, partition reuse across panel switches, conversation memory, lease release, popup allowlisting and crash containment.
170
+ `test/check-client.mjs` loads `lib/client.js` in a `node:vm` sandbox with fake React/DOM/bridge objects and checks four slot registrations (sidebar / full-area panel / header tab / settings page), the config layer (defaults, type validation, persistence, subscription, dynamic re-injection), the header overlay's fill styling, factory id equals package name, Web-surface inertness, shared fixed partition across both entries, pure web chat with no account strip, URL allowlisting, conversation memory, lease release, popup allowlisting and crash containment; a mock fetch verifies metadata constants against `package.json`, semver comparison, update-payload parsing, npm/GitHub fallback, all update-state branches, and the Settings-page click flow.
150
171
 
151
172
  ```
152
173
  lib/index.js host half (empty; it only gives the client bundle a Loader entry)
153
- lib/client.js browser half: entry, panel, account status strip, webview lifecycle, crash containment
174
+ lib/client.js browser half: entries, web-chat panel, full-area header overlay, settings page + config layer, about info / check-for-updates, webview lifecycle, crash containment
154
175
  cordis.patch.yml bundle patch that inserts this plugin's Loader row
155
176
  locale/{zh,en}.json Plugins-page title/description
156
177
  icon.svg Plugins-page icon
package/README.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  [English](README.en.md) | 中文
4
4
 
5
- > **当前版本:v1.1.2** |适配 DSH **0.2.2-rc.1**
5
+ > **当前版本:v1.1.6** |适配 DSH **0.2.2-rc.1**
6
6
 
7
- 在 **DeepSeek Harness(DSH)桌面版**的左侧栏加入 **DeepSeek 聊天** 入口,点开后 `chat.deepseek.com` 直接占满主内容区,记住上次所在的会话,并显示当前 DSH 账号状态。
7
+ 在 **DeepSeek Harness(DSH)桌面版**加入 **DeepSeek 聊天**:左侧栏图标入口、会话顶栏标签页(默认名「DeepSeek 聊天」,可在设置页开关 / 自定义),点开后 `chat.deepseek.com` 铺满会话区,记住上次所在的会话;提供**设置页面**(含插件基础信息与「检查更新」按钮),面板为**纯网页聊天**,不显示账号状态。
8
8
 
9
9
  > 仓库:[GitHub](https://github.com/sweet560/dsh-plugin-deepseek-chat) | [Gitee 镜像](https://gitee.com/wtt520wyl/dsh-plugin-deepseek-chat)
10
10
 
@@ -12,17 +12,33 @@
12
12
 
13
13
  ## 功能
14
14
 
15
- - 左侧栏图标入口,排在「插件」和「自动化任务」之间。
16
- - 主内容区全宽内嵌 `https://chat.deepseek.com/`(Electron `<webview>`,走桌面壳的 guest 租约桥 `window.dshDesktop.browser`)。
15
+ - **两个入口并存**:
16
+ - 左侧栏图标入口,排在「插件」和「自动化任务」之间,点开后占满主内容区;
17
+ - 会话顶栏标签行(「对话 / 轨迹 / 上下文 / 压缩 / 编队 / 统计」那一行)新增标签,通过官方 `conversation.view` 槽注册(`id: deepseek-chat-view`、`order: 100`),**默认显示名「DeepSeek 聊天」**。
18
+ - **设置页面(v1.1.4)**:通过官方 `settings.section` 槽注册「DeepSeek 聊天」设置页(左侧「设置」弹窗导航里)。两项设置:
19
+ - **显示顶部标签栏**(默认开启):关闭后移除顶栏标签,只保留左侧栏入口;
20
+ - **顶部标签栏名称**(默认 `DeepSeek 聊天`):输入框默认**空白**,以灰色占位提示显示默认名;点进去不用删、直接输入新名字即可,留空自动恢复默认,最长 40 字。
21
+ - 配置存 `localStorage` 的 `dsh-plugin-deepseek-chat:config`,改完即时生效(标签行会重新注册)。
22
+ - **关于本插件(v1.1.5)**:设置页展示插件版本号、作者(`sweet560`)、功能简介、开源许可证(`MIT`),以及 npm 插件页面 / GitHub 仓库两个 `https` 外链(点开由桌面壳用系统浏览器打开)。
23
+ - **检查更新(v1.1.5)**:设置页新增「检查更新」按钮,从 **npm 优先、GitHub 兜底** 两个公开 JSON 接口读取最新发布版本号(npm `dist-tags.latest`、`raw.githubusercontent.com` 上的 `package.json`),按数字逐段比较版本:已是最新 / 发现新版本 / 检查失败都给出文字状态,并附 npm / GitHub 跳转链接。检查中禁用重复点击,网络不可用或两源都失败都有兜底,不新增 Host 路由。
24
+ - **图3 修复:网页铺满会话区(v1.1.4)**:选中顶栏标签时,网页现在撑满整个会话区、盖住 DSH 自己的对话消息与底部输入框;切回「对话」标签即恢复。顶栏入口用不透明绝对定位浮层(`inset: 0`、`z-index: 50`)覆盖会话 body,header 里的标签行仍在上方、随时可点回。
25
+ - 两个入口**共用同一个网页聊天组件**(顶栏多一层铺满浮层包装)和同一个固定分区 `panel:deepseek-chat`,登录态与会话记忆通用;切走标签页会释放租约、再进入重新申请同一分区。
26
+ - 会话区全宽内嵌 `https://chat.deepseek.com/`(Electron `<webview>`,走桌面壳的 guest 租约桥 `window.dshDesktop.browser`)。
17
27
  - **记住上次会话**:切到别的面板、切换会话、重启 App 后再进来,直接回到上次那条对话,而不是新对话。
18
28
  - 登录/鉴权页不会覆盖记忆;记住的会话失效或打不开时自动回退到首页。
19
29
  - **稳定的登录会话(v1.1.1 修复)**:guest 分区固定为 `panel:deepseek-chat`,切换面板/会话回来不会重建分区、不会重新要求扫码。
20
- - **DSH 账号状态展示**:面板顶部条显示「已与 DSH 登录账号同步 · 昵称」/「未登录」/「账号状态不可用」,通过官方 `ctx.remote.account` 读取;**仅作展示,绝不参与 guest 生命周期**。
21
30
  - **崩溃隔离**:内嵌页进程退出、被销毁或启动超时,只在面板里显示「重试」,不会再出现整个 App 变空白窗口的问题(v0.4.0 修复,见下文)。
31
+ - **纯网页聊天(v1.1.3)**:已彻底移除账号状态条、账号探测、5 秒轮询与账号同步 store;面板挂载即申请租约、立即启动,不再等待任何异步账号流程。
22
32
  - 纯 Web 表层(`dsh web` 在浏览器里打开)自动不注册——该站点 `frame-ancestors 'none'`,iframe 嵌不了,guest 租约桥也只有桌面壳提供。
23
33
 
24
34
  > **v1.1.2 修复(web boot 启动失败)**:v1.1.1 把 npm 包名改为带 scope 的 `@tianyulinfeng1/dsh-plugin-deepseek-chat` 后,`lib/client.js` 里 client bundle 的工厂 id 仍是旧短名 `dsh-plugin-deepseek-chat`,两者不一致使 DSH Host 重复执行同一 bundle、抛出 `duplicate factory registration`,最终 `web boot: 1 entry did not activate`、整个页面启动失败。v1.1.2 已把工厂 id 对齐为完整包名,并在离线自检中新增「工厂 id 必须等于 `package.json` 的 `name`」回归断言。详见 [docs/RELEASE_NOTES_v1.1.2.md](docs/RELEASE_NOTES_v1.1.2.md)。
25
35
 
36
+ > **v1.1.3**:按用户要求移除账号状态显示、新增会话顶栏「网页聊天」标签页;旧的 main / sidebar.panellist 两处 inject 从「同一个 try/catch」改为三处各自独立 try/catch,避免单点失败连带其它入口不注册。
37
+
38
+ > **v1.1.4**:新增设置页(开关顶部标签栏 + 自定义标签名,默认「DeepSeek 聊天」);修复选中顶栏标签时网页没有铺满会话区、DSH 输入框仍露在下方的问题;图2 红框(网页内自带会话标题胶囊)经用户确认「先不处理」,插件不改动第三方网页。
39
+
40
+ > **v1.1.5(本版)**:设置页新增「关于本插件」基础信息(版本号 / 作者 / 功能简介 / 许可证 / npm·GitHub 链接)与「检查更新」按钮(npm 优先、GitHub 兜底、语义版本比较、文字状态 + 跳转链接、失败兜底);不改动 Host 半侧。
41
+
26
42
  ## 环境要求
27
43
 
28
44
  | 项 | 要求 |
@@ -83,14 +99,13 @@ dsh plugin --profile desktop add file:"<本仓库绝对路径>"
83
99
 
84
100
  - 渲染层桥 `globalThis.dshDesktop` 只有 `browser.acquire/release/onOpenRequested` 等,**没有** `getAuthToken`、写 cookie、打开 Platform 取 token 的 API;`getAuthToken()` 只存在于桌面壳内嵌 Platform 页(`usage` / `top_up`)的专用 preload,且受主帧 + origin 限制。
85
101
  - `browserAcquire` IPC 只按 workspace 字符串分配分区/租约,`configureSession()` 只设权限与下载拦截,**不注入任何凭据**;guest 被强制 `sandbox/contextIsolation/webSecurity`。
86
- - 因此:DSH 账号状态只能**显示**在面板上,无法换成网页版登录态;首次仍需在网页里扫码一次。
102
+ - 因此:DSH 账号与网页版登录态互不相干,首次仍需在网页里扫码一次。**v1.1.3 起连「账号状态」的展示也一并删除**,面板是纯网页聊天。
87
103
 
88
- **v1.1.0 的教训(v1.1.1 已修复)**:曾把 guest 分区绑到异步账号探测结果上。DSH 的 `getState()` 在重连/切会话时会瞬时失败,分区一变就等于换了个全新 cookie 罐 → 每次切回面板都要求重新扫码。现在:
104
+ **v1.1.0 的教训(v1.1.1 已修复,v1.1.3 已彻底移除账号逻辑)**:曾把 guest 分区绑到异步账号探测结果上。DSH 的 `getState()` 在重连/切会话时会瞬时失败,分区一变就等于换了个全新 cookie 罐 → 每次切回面板都要求重新扫码。现在:
89
105
 
90
106
  - `acquire()` 的 workspace 恒为 `panel:deepseek-chat`,会话记忆 key 恒为 `dsh-plugin-deepseek-chat:last-url`;
91
- - 账号状态变化只更新显示条,不 bump epoch、不重建 guest、不换分区;
92
- - 瞬时 `unknown` 被忽略,只有明确的 `signed-out` 才更新显示;
93
- - guest 在挂载时立即启动,不再等待异步 Remote 探测(探测失败也不阻塞聊天);
107
+ - 不再有任何账号探测、轮询、状态订阅或显示条参与 guest 生命周期;
108
+ - guest 在挂载时立即启动,不等任何异步 Remote 流程;
94
109
  - 弹窗导航只放行 `chat.deepseek.com` 与 `platform.deepseek.com`(HTTPS、默认端口)。
95
110
 
96
111
  > 想做到「重启 DSH 后也不用重新扫码」,需要按 [docs/login-persistence.md](docs/login-persistence.md) 把 DSH 的随机内存分区改成**确定性的 `persist:` 分区**(运行 [scripts/patch-dsh-persistent-partition.cjs](scripts/patch-dsh-persistent-partition.cjs),属修改已安装应用,风险自负)。**该脚本会同步 `0.2.2-rc.1` 的 ASAR 逐文件 SHA256 integrity**,纯字节替换会让 DSH 重启崩溃,切勿使用废弃的 `.mjs` 版本。补丁要求完全退出 DSH 后才能写入 `app.asar`,且只解决「重启后保留网页 cookie」,不能让网页复用 DSH token。
@@ -101,6 +116,10 @@ dsh plugin --profile desktop add file:"<本仓库绝对路径>"
101
116
  - 本次 App 运行期间,切换面板/会话**不需要**重新登录(v1.1.1 起分区固定)。
102
117
  - **重启 DSH 后仍需要重新登录一次**:DSH 目前给内嵌浏览器的是随机内存分区(`dsh-sidebar-browser-<uuid>`,没有 `persist:` 前缀),进程退出即清空 cookie。本插件不修改 DSH 的安装文件;想做到「登录一次、长期免登录」,可按 **[docs/login-persistence.md](docs/login-persistence.md)** 做一次等长字节替换(含脚本、验证与回滚)。
103
118
  - 会话链接记在 App 的 localStorage(固定 key `dsh-plugin-deepseek-chat:last-url`),重启后仍会打开上次的会话(前提是已登录且该会话仍存在)。
119
+ - 会话顶栏标签(默认 **「DeepSeek 聊天」**)与左侧栏图标是同一份网页聊天;切到别的标签时本插件的 guest 会被卸载并释放租约,切回来重新加载(分区不变,登录态与会话记忆保留)。
120
+ - **设置页面**:打开 DSH「设置」弹窗 → 左侧导航「DeepSeek 聊天」,可勾选 / 取消「显示顶部标签栏」、修改「顶部标签栏名称」。名称输入框默认是空白的,只用灰色文字提示「DeepSeek 聊天」;点进输入框即可直接输入新名字,无需先删除默认文字。关闭标签栏后顶栏入口消失,但左侧栏图标仍可用;名字留空自动恢复默认「DeepSeek 聊天」。设置即时生效并保存在本机。
121
+ - **关于与检查更新**:同页下方展示版本号、作者、功能简介、许可证与 npm / GitHub 链接;点「检查更新」会从 npm(失败则 GitHub)读取最新发布版本号。本地未发版的新版本会领先远端,显示「已是最新版本」;远端更高则显示「发现新版本 x.y.z」,结果下方附有跳转链接;网络不可用会显示失败原因。
122
+ - 选中顶栏标签时网页铺满整个会话区,DSH 自己的对话消息与输入框被盖住;点回「对话」标签即恢复,不会丢失会话内容。
104
123
 
105
124
  ## 登录态持久化(可选,免登录)
106
125
 
@@ -117,8 +136,7 @@ DSH 目前给内嵌浏览器分配的是**内存分区**(`dsh-sidebar-browser-
117
136
  - chat.deepseek.com 会检测 Electron 内嵌环境,偶尔弹出「使用环境异常…建议使用官方产品」的提示;这是站点侧行为,与本插件无关。
118
137
  - 仅桌面版有效;`dsh web` 在浏览器里打开时不显示入口。
119
138
  - 站点若调整会话 URL 规则(当前识别 `/a/chat/s/<id>` 形式),「记住会话」可能失效并回退到首页。
120
- - DSH 账号状态只作展示,不能把 DSH 的 OAuth token 兑换成 chat.deepseek.com 的网页会话;首次仍需在该网页登录一次(见上文)。
121
- - `getProfile()` 只用于显示昵称;该接口暂不可用时显示状态可能短暂滞后,但**绝不影响** guest 与登录态。
139
+ - 纯插件无法免扫码复用 DSH token;首次仍需在该网页登录一次(见上文)。**v1.1.3 起面板不再显示任何账号状态。**
122
140
  - 重启 DSH 后仍需重新登录网页版 chat,除非按 [docs/login-persistence.md](docs/login-persistence.md) 打持久分区补丁。
123
141
 
124
142
  ## 崩溃隔离(v0.4.0)
@@ -140,6 +158,10 @@ DSH 目前给内嵌浏览器分配的是**内存分区**(`dsh-sidebar-browser-
140
158
 
141
159
  | 版本 | 内容 |
142
160
  |---|---|
161
+ | **1.1.6** | **OIDC 可信发布链路测试**:`.github/workflows/publish.yml` 启用 `permissions.id-token: write`、Node 22、`npm@latest`、`npm publish --provenance`,移除 `NODE_AUTH_TOKEN` 与 `environment` 声明;版本号升到 `1.1.6` 推送 GitHub,实测 GitHub Actions 能否经 npm Trusted Publisher 自动发布。功能与 1.1.5 相同,仅发布链路变更。 |
162
+ | **1.1.5** | **设置页新增关于信息 + 检查更新**:新增插件版本号 / 作者 / 功能简介 / 许可证 / npm·GitHub 链接,以及「检查更新」按钮(npm `dist-tags` 优先、GitHub `raw` 兜底、数字逐段版本比较、文字状态 + 跳转链接、8 秒超时与失败兜底);元信息常量与 `package.json` 一致性断言、离线自检全部通过(`RESULT: PASS`)。 |
163
+ | **1.1.4** | **新增设置页 + 顶栏标签可配置 + 网页铺满会话区**:新增 `settings.section` 设置页(开关顶部标签栏、自定义标签名默认「DeepSeek 聊天」,localStorage 持久化、即时重注入刷新标签行);顶栏标签用不透明绝对定位浮层铺满会话 body、盖住 composer 输入框;图2 网页内标题胶囊按用户确认不处理。四处槽位注册、离线自检全部通过(`RESULT: PASS`)。 |
164
+ | **1.1.3** | **移除账号状态显示 + 新增会话顶栏标签页**:彻底删除账号状态条、账号探测、5 秒轮询、账号同步 store;新增 `conversation.view` 顶栏「网页聊天」标签(与左侧栏/全屏面板共用组件与固定分区);三处槽位注册改为各自独立 try/catch。离线自检全部通过(`RESULT: PASS`)。 |
143
165
  | **1.1.2** | **修复 v1.1.1 的 web boot 启动失败(重点)**:工厂 id 与 npm 包名不一致 → DSH 重复执行同一 bundle → `duplicate factory registration` → `1 entry did not activate`、整个页面打不开。已把 `lib/client.js` 工厂 id 对齐为 `@tianyulinfeng1/dsh-plugin-deepseek-chat`,并新增「工厂 id 必须等于 `package.json` 的 `name`」回归断言;离线自检 35 项全过、30 个 client bundle 扫描 0 不匹配。详见 [docs/RELEASE_NOTES_v1.1.2.md](docs/RELEASE_NOTES_v1.1.2.md)。 |
144
166
  | **1.1.1** | **修复每次切回面板/重启都要重新扫码的回归**:guest 分区与会话 key 固定为常量,账号状态仅作展示、不参与 guest 生命周期;瞬时 `unknown` 被忽略;guest 不再等待异步账号探测;自检改为验证固定分区与状态抖动不重建(35 项)。明确记录「纯插件无法免扫码复用 DSH token」的源码结论。 |
145
167
  | 1.1.0 | 支持 DSH `0.2.2-rc.1`:新增 DSH 账号状态条;修正生成式 Remote 信封解析;收紧会话 URL 与弹窗 URL 校验;失败时移除失效 guest。**此版把分区绑到账号状态,导致登录态抖动(已由 1.1.1 修复)**。 |
@@ -153,13 +175,13 @@ cd dsh-plugin-deepseek-chat
153
175
  node test/check-client.mjs
154
176
  ```
155
177
 
156
- `test/check-client.mjs` 是离线自检:在 `node:vm` 里加载 `lib/client.js`,用假的 React/DOM/租约桥验证注册、Remote 信封解析、固定分区与会话 key、状态抖动不重建 guest、切换面板复用分区、会话记忆、租约释放、弹窗白名单和崩溃隔离。
178
+ `test/check-client.mjs` 是离线自检:在 `node:vm` 里加载 `lib/client.js`,用假的 React/DOM/租约桥验证四处槽位注册(左侧栏 / 全屏主面板 / 顶栏标签页 / 设置页)、配置层(默认值、类型校验、持久化、订阅通知、动态重注入)、顶栏浮层的铺满样式、工厂 id 与包名一致、Web 表层 inert、两入口共用固定分区、纯网页聊天无账号条、URL 白名单、会话记忆、租约释放、弹窗白名单和崩溃隔离;并用 mock fetch 验证基础信息常量与 `package.json` 一致、语义版本比较、更新载荷解析、npm/GitHub 兜底、检查更新各状态分支与设置页点击联动。
157
179
 
158
180
  目录:
159
181
 
160
182
  ```
161
183
  lib/index.js 宿主半侧(空实现,只为让 client bundle 有 Loader 入口)
162
- lib/client.js 浏览器半侧:入口、面板、账号状态展示、webview 生命周期、崩溃隔离
184
+ lib/client.js 浏览器半侧:入口、网页聊天面板、顶栏铺满浮层、设置页与配置层、关于信息/检查更新、webview 生命周期、崩溃隔离
163
185
  cordis.patch.yml bundle 补丁:插入本插件的 Loader 行
164
186
  locale/zh.json 插件页显示名称/描述(中文)
165
187
  locale/en.json 插件页显示名称/描述(英文)
@@ -0,0 +1,114 @@
1
+ # dsh-plugin-deepseek-chat v1.1.5 发布说明
2
+
3
+ **DeepSeek Harness(DSH)桌面版「DeepSeek 聊天」插件 —— 功能迭代版:移除账号状态、会话顶栏标签页、设置页、网页铺满会话区、插件基础信息与「检查更新」按钮。**
4
+
5
+ 本次是把 v1.1.2 之后在本地迭代、此前未单独发版的 **v1.1.3 / v1.1.4 / v1.1.5** 三个版本一次性发布为 `1.1.5`。它**不是崩溃修复版**:v1.1.2 已修复的 web boot 启动失败(`duplicate factory registration`)在本版中保持修复状态,工厂 id 与包名一致性的回归断言依然保留;本版聚焦的是界面与功能迭代。
6
+
7
+ ## Requires(环境要求)
8
+
9
+ | 项 | 要求 |
10
+ |---|---|
11
+ | DSH Desktop | `>= 0.2.2-rc.1`(含 `0.2.2-rc.1`) |
12
+ | Node.js | `>= 20` |
13
+ | 平台 | Windows / macOS / Linux 桌面壳 |
14
+
15
+ ## 版本更迭(1.1.2 → 1.1.5)
16
+
17
+ npm registry 上此前最后发布的是 `1.1.2`;`1.1.3`、`1.1.4`、`1.1.5` 均只存在于本地,未推送到 npm。本版把三者的改动合并发布:
18
+
19
+ ### v1.1.3 —— 移除账号状态显示,新增会话顶栏标签页
20
+
21
+ - **彻底移除账号状态条**:删掉面板顶部「账号状态不可用,会话按本地模式保存」状态条,以及背后的账号同步 store、5 秒轮询、账号探测、`ctx.on("connection/reset")` 订阅。面板挂载即申请 guest 租约、立即启动,不再等待任何异步账号流程。纯网页聊天,主内容区只留 `<webview>`。
22
+ - **新增会话顶栏标签页**:通过官方 `conversation.view` 槽(`id: deepseek-chat-view`、`order: 100`)在「对话 / 轨迹 / 上下文 / 压缩 / 编队 / 统计」那一行加入标签,与左侧栏图标入口并存、共用同一个网页聊天组件与同一个固定分区 `panel:deepseek-chat`。
23
+ - **注册健壮性**:旧的 main / sidebar.panellist 两处 `ctx.slots.inject` 从「同一个 try/catch」改为各处独立 try/catch,避免单点失败连带其它入口不注册。
24
+
25
+ ### v1.1.4 —— 设置页、标签页可配置、网页铺满会话区、灰色占位提示
26
+
27
+ - **新增设置页**:通过官方 `settings.section` 槽注册「DeepSeek 聊天」设置页(左侧「设置」弹窗导航里,`id: deepseek-chat-settings`、`order: 48`),沿用 localStorage 配置范式(键 `dsh-plugin-deepseek-chat:config`)。
28
+ - **显示顶部标签栏**(`showTab`,默认 `true`):关闭后移除 `conversation.view` 注册,只保留左侧栏图标 + 全屏主面板入口。
29
+ - **顶部标签栏名称**(`tabLabel`,默认 `DeepSeek 聊天`):可自定义,留空自动回退默认,最长 40 字。
30
+ - 标签行只在注册项增删时重算,因此改开关 / 改名会 `dispose` 后重新 `inject("conversation.view", ...)`,即时生效。
31
+ - **网页铺满会话区(图3 修复)**:选中顶栏标签时,网页现在撑满整个会话区、盖住 DSH 自己的对话消息与底部输入框;切回「对话」标签即恢复。根因是 `viewArea` 与 `composerSeat` 是上下并列兄弟、active 阶段 `viewArea` 为 `flex:1 0 auto` 导致 `height:100%` 无确定父高;顶栏入口改用不透明绝对定位浮层(`inset:0`、`z-index:50`)覆盖会话 body,header 里的标签行仍在上方、随时可点回。
32
+ - **灰色占位提示(打磨)**:名称输入框默认为空白,仅以灰色 placeholder 显示默认名;点击输入框即可直接输入新名字,无需先删默认文字;清空后恢复灰提示。组件内用本地 `draft` state 实现,配置层零改动,默认标签名仍是「DeepSeek 聊天」。
33
+ - 图2 红框(网页内自带的「DSH认证失败修复」会话标题胶囊)经用户确认「先不处理」——那是 chat.deepseek.com 网页内部元素,插件不注入样式隐藏、不改第三方网页。
34
+
35
+ ### v1.1.5 —— 关于本插件 + 检查更新
36
+
37
+ - **基础信息区块**:设置页展示插件版本号(`1.1.5`)、作者(`sweet560`)、功能简介、开源许可证(`MIT`),以及 npm 插件页面 / GitHub 仓库两个 `https` 外链(`target="_blank"`,由桌面壳用系统浏览器打开)。这些值以模块级常量保存(client bundle 不能 import package.json),并由离线自检逐字段断言与 `package.json` 一致。
38
+ - **「检查更新」按钮**:点击后从公开 JSON 接口读取最新发布版本号,**npm 优先、GitHub 兜底**:
39
+ - npm:`https://registry.npmjs.org/-/package/@tianyulinfeng1%2fdsh-plugin-deepseek-chat/dist-tags`(取 `latest`);
40
+ - GitHub:`https://raw.githubusercontent.com/sweet560/dsh-plugin-deepseek-chat/main/package.json`(取 `version`,避开 `api.github.com` 的限流)。
41
+ 两处都带宽松 CORS、主窗口未设置 `connect-src` CSP 限制,因此直接用 renderer 的 `fetch()` 即可,**不新增 Host 同源回环路由**、`lib/index.js` 空宿主半侧保持不变。每个请求带 8 秒 `AbortController` 超时。
42
+ - **版本比较用数字逐段比较**(`compareVersion()`),不用字符串相等:本地尚未发版的 `1.1.5` 会领先已发布的 `latest`(发布前实测为 `1.1.2`),此时显示「已是最新版本」而非误报有更新;仅当远端版本更高才显示「发现新版本」。
43
+ - **文字状态 + 跳转链接**:状态行显示「点击按钮… / 正在检查更新… / 已是最新版本 / 发现新版本 x.y.z / 检查更新失败:原因」,并在检查结束后附带 npm / GitHub 跳转链接。检查中按钮禁用且忽略重复点击;网络不可用、两个来源都失败、没有可用 fetch 时都给出失败兜底,异常不外泄。
44
+
45
+ ## 关于 v1.1.2 的 web boot 崩溃(历史,保持已修复)
46
+
47
+ v1.1.2 的发布说明 `docs/RELEASE_NOTES_v1.1.2.md` 已完整记录崩溃日志 `crash-2026-11-09T08-27-01-314Z-web-boot.log` 的逐条根因:`package.json` 的 `name` 是带 scope 的 `@tianyulinfeng1/dsh-plugin-deepseek-chat`,而当时 `lib/client.js` 里 `window.__ModuleLoader__.load({ id })` 的工厂 id 仍是旧短名 `dsh-plugin-deepseek-chat`;DSH Host 以包名作图行 id,检查 `factories.has(<行 id>)` 为 false 便重复执行同一 bundle,第二遍注册短名工厂时抛出 `client-modules: duplicate factory registration for "dsh-plugin-deepseek-chat"`,最终 `web boot: 1 entry did not activate`、整个页面打不开。v1.1.2 把工厂 id 对齐为完整包名并新增回归断言。
48
+
49
+ **本版 `1.1.5` 的工厂 id 仍为 `@tianyulinfeng1/dsh-plugin-deepseek-chat`、与 `package.json` 的 `name` 完全一致**,`test/check-client.mjs` 中「工厂 id 必须等于包名」的断言继续通过,该回归不会被重新引入。本版没有改动这一修复,也没有出现新的崩溃日志。
50
+
51
+ ## What changed(逐文件改动,相对 npm 上的 1.1.2)
52
+
53
+ | 文件 | 改动 |
54
+ |---|---|
55
+ | `lib/client.js` | 移除账号状态条与账号同步 store;新增 `conversation.view` 顶栏标签注册;新增 `settings.section` 设置页与 localStorage 配置层(`showTab` / `tabLabel`);顶栏入口改用绝对定位浮层铺满会话区;新增「关于本插件」基础信息、`checkForUpdates` / `fetchLatestVersion` / `compareVersion` / `versionFromPayload` 等;名称输入框改灰色 placeholder + 本地 `draft` state。工厂 id 保持不变。 |
56
+ | `test/check-client.mjs` | 全文重写为中文输出:删账号用例,新增四处槽位注册、配置层、设置页联动、顶栏浮层、基础信息常量一致性、语义版本比较、载荷解析、npm/GitHub 兜底、检查更新各分支与设置页点击联动等断言;mock fetch 覆盖全部网络分支。 |
57
+ | `package.json` | `version` `1.1.2` → `1.1.5`;description 同步;`files` 新增本发布说明。 |
58
+ | `locale/zh.json` / `locale/en.json` | description 同步(设置页 / 顶栏标签 / 基础信息 / 检查更新 / 无账号状态)。 |
59
+ | `CHANGELOG.md` | 新增 `1.1.5`、`1.1.4`、`1.1.3` 章节。 |
60
+ | `README.md` / `README.en.md` | 当前版本 v1.1.5;功能 / 使用 / 版本历史 / 开发 / 目录树同步三轮改动。 |
61
+ | `docs/login-persistence.md` | 注明 v1.1.3 起彻底移除账号状态条 / 探测 / 轮询 / 同步 store。 |
62
+ | `docs/RELEASE_NOTES_v1.1.5.md` | 本文件,完整发布说明。 |
63
+ | `lib/index.js` / `.github/workflows/*` / `cordis.patch.yml` | 未改动:空宿主半侧、CI、bundle patch 保持原样。 |
64
+
65
+ ## Verification(验证结果)
66
+
67
+ - `node --check lib/client.js` → 通过(`NODE_CHECK_OK`)。
68
+ - `npm test` → 全部通过(`RESULT: PASS`),含工厂 id === 包名、四处槽位注册、配置层与设置页联动、顶栏浮层样式、基础信息常量与 package.json 一致、语义版本比较、更新载荷解析、npm/GitHub 兜底、检查更新各状态分支、以及全部 guest 租约生命周期回归用例。
69
+ - `git diff --check` → 通过。
70
+ - `npm pack --dry-run` / `npm pack` → 打包清单包含 `lib/`、`locale/`、发布说明、README、CHANGELOG、LICENSE、icon、patch 等;`package.json` 的 `version` 为 `1.1.5`。
71
+
72
+ ## Upgrade(如何升级)
73
+
74
+ > 建议先退出 DSH 桌面版再升级,升级完成后重新启动。已从 v1.1.2(或更早版本)安装的,直接覆盖安装即可;也可先 `remove` 再 `add`。
75
+
76
+ ### 方式一:npm(推荐)
77
+
78
+ ```powershell
79
+ dsh plugin --profile desktop remove @tianyulinfeng1/dsh-plugin-deepseek-chat
80
+ dsh plugin --profile desktop add @tianyulinfeng1/dsh-plugin-deepseek-chat
81
+ ```
82
+
83
+ 插件页「安装第三方插件」里也可以直接填包名 `@tianyulinfeng1/dsh-plugin-deepseek-chat`(会拉取最新版本 `1.1.5`)。
84
+
85
+ ### 方式二:GitHub
86
+
87
+ ```powershell
88
+ dsh plugin --profile desktop add github:sweet560/dsh-plugin-deepseek-chat
89
+ ```
90
+
91
+ ### 方式三:Gitee 镜像
92
+
93
+ ```powershell
94
+ dsh plugin --profile desktop add https://gitee.com/wtt520wyl/dsh-plugin-deepseek-chat
95
+ ```
96
+
97
+ ### 方式四:本地 tgz / 目录
98
+
99
+ ```powershell
100
+ dsh plugin --profile desktop add file:"<dsh-plugin-deepseek-chat-1.1.5.tgz 的绝对路径>"
101
+ ```
102
+
103
+ 装完打开 **插件 → 已安装插件**,确认「DeepSeek 聊天」处于启用状态,并确认版本显示为 `1.1.5`;在左侧「设置」弹窗里可找到「DeepSeek 聊天」设置页。
104
+
105
+ ## Assets(发布产物)
106
+
107
+ - `dsh-plugin-deepseek-chat-1.1.5.tgz` —— 完整可安装的 npm / bundle 包(沿用 v1.1.1 起的 Release 附件命名;`npm pack` 对 scoped 包的原生输出名为 `tianyulinfeng1-dsh-plugin-deepseek-chat-1.1.5.tgz`)。
108
+ - `Source code (zip / tar.gz)` —— 由 GitHub / Gitee 自动生成的源码归档。
109
+
110
+ ## Honest limitation(诚实限制)
111
+
112
+ 沿用既有源码结论:**纯插件无法让 `chat.deepseek.com` 复用 DSH 已登录的账号、做不到免扫码**。DSH 桌面版用的是 platform.deepseek.com 的 `x-dsh-auth-token`,网页版用的是站点自带的 Token;渲染层桥 `globalThis.dshDesktop` 没有读 token / 写 cookie / 打开 Platform 取 token 的 API,归档里也没有 SSO 或 cookie 注入入口。因此首次仍需在网页里扫码登录一次。可选的「持久分区补丁」(见 [login-persistence.md](login-persistence.md))只能让这次登录的 cookie 在重启 DSH 后保留,并不能把 DSH token 兑换成网页登录态。
113
+
114
+ 此外:纯 Web 表层(`dsh web` 在浏览器里打开)自动不注册——该站点 `frame-ancestors 'none'`,iframe 嵌不了,guest 租约桥也只有桌面壳提供。
@@ -178,7 +178,7 @@ DSH 自身的登录是 platform.deepseek.com 的 OAuth 授权(Host `deepseekAc
178
178
 
179
179
  **渲染层也拿不到 DSH token**:`globalThis.dshDesktop` 只暴露 `browser.acquire/release/onOpenRequested` 等,没有 `getAuthToken`、写 cookie、打开 Platform 取 token 的 API;`getAuthToken()` 只存在于桌面壳内嵌 Platform 页(`usage`/`top_up`)的专用 preload 且受主帧 + origin 限制。`browserAcquire` IPC 只按 workspace 分配分区/租约,`configureSession()` 不注入凭据。所以**纯插件无法免扫码**。
180
180
 
181
- **v1.1.1 起,本插件的账号状态条仅作展示**:读取 `ctx.remote.account.getState()` / `getProfile()` 显示昵称与登录状态,但**绝不参与 guest 分区或生命周期**。v1.1.0 曾把分区绑到账号状态,导致 `getState()` 瞬时失败就换分区、每次切回面板都要重新扫码——这是已修复的回归,不是「账号同步」的应有行为。
181
+ **v1.1.3 起,本插件已彻底移除账号状态条、账号探测、轮询与同步 store**:面板为纯网页聊天,挂载即启动,不再有任何异步账号流程参与 guest 分区或生命周期。v1.1.0 曾把分区绑到账号状态,导致 `getState()` 瞬时失败就换分区、每次切回面板都要重新扫码——这是已修复的回归;v1.1.1 起账号状态条仅作展示,v1.1.3 起连展示也一并删除。
182
182
 
183
183
  本文的持久分区补丁负责「网页 cookie 不因**重启**丢失」;v1.1.1 的固定分区负责「网页 cookie 不因**切换面板**丢失」。两者都保留首次扫码后的网页会话,都不能把 DSH token 变成网页登录态。
184
184