dsh-ui-tweaks 0.19.1 → 0.20.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/LICENSE +21 -21
- package/README.en.md +55 -9
- package/README.md +24 -9
- package/cordis.patch.yml +12 -12
- package/lib/client.js +142 -93
- package/lib/client.js.map +2 -2
- package/lib/mcp.js +8 -3
- package/lib/mcp.js.map +1 -1
- package/lib/types/client/appicons.d.ts +17 -0
- package/lib/types/client/appicons.d.ts.map +1 -0
- package/lib/types/client/archive.d.ts +13 -0
- package/lib/types/client/archive.d.ts.map +1 -1
- package/lib/types/client/effort.d.ts +10 -7
- package/lib/types/client/effort.d.ts.map +1 -1
- package/lib/types/client/gitbar.d.ts +1 -1
- package/lib/types/client/gitbar.d.ts.map +1 -1
- package/lib/types/client/icons.d.ts +5 -1
- package/lib/types/client/icons.d.ts.map +1 -1
- package/lib/types/client/index.d.ts +10 -3
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/mcp.d.ts +14 -8
- package/lib/types/client/mcp.d.ts.map +1 -1
- package/lib/types/client/nav-icons.d.ts +47 -0
- package/lib/types/client/nav-icons.d.ts.map +1 -0
- package/lib/types/client/notifier.d.ts +3 -1
- package/lib/types/client/notifier.d.ts.map +1 -1
- package/lib/types/client/search.d.ts +1 -1
- package/lib/types/client/search.d.ts.map +1 -1
- package/lib/types/client/select-menu.d.ts +49 -0
- package/lib/types/client/select-menu.d.ts.map +1 -0
- package/lib/types/client/session-menu.d.ts +55 -0
- package/lib/types/client/session-menu.d.ts.map +1 -0
- package/lib/types/client/shell.d.ts +30 -0
- package/lib/types/client/shell.d.ts.map +1 -0
- package/lib/types/client/whale.d.ts +55 -0
- package/lib/types/client/whale.d.ts.map +1 -0
- package/lib/types/mcp.d.ts +4 -4
- package/lib/types/mcp.d.ts.map +1 -1
- package/package.json +142 -140
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 dsh-ui-tweaks contributors
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 dsh-ui-tweaks contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.en.md
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
> **Dependency**: currently targets **DSH v0.2.0-rc.2**.
|
|
4
4
|
|
|
5
|
-
A [DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harness/) (DSH)
|
|
5
|
+
A [DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harness/) (DSH) plugin that live-tunes the conversation UI from the Settings panel.
|
|
6
6
|
|
|
7
7
|
## Preview
|
|
8
8
|
|
|
9
9
|
| | |
|
|
10
10
|
|---|---|
|
|
11
11
|
|  |  |
|
|
12
|
-
| **Settings panel**: code font size / theme skins (minimal · neon poster) / two-decimal cache hit / web search / timeline / GitBar toggles, with dedicated **Archive**, **MCP** and **
|
|
12
|
+
| **Settings panel**: code font size / theme skins (minimal · neon poster) / two-decimal cache hit / web search / timeline / GitBar toggles, with dedicated **Archive manager**, **MCP manager** and **Web search** pages in the left nav | **Branch panel**: pops down from the branch chip in the session header — local / remote branch lists, click to switch; pull button (fast-forward only) in the header, new-branch field at the bottom, plus a **commit graph** dialog (colored SVG fork/merge lanes) and **Tag** management |
|
|
13
13
|
|  |  |
|
|
14
|
-
| **Code diff**: the code-diff tab in the right sidebar — file list (per-file checkboxes for partial commits) + per-file diff (changed hunks only by default, "Full file" toggle at the top right), with a commit area at the bottom for the message, an optional Tag, and Commit / Commit & push | **Archive manager**: an Archive page in the Settings dialog listing archived sessions (title / workspace / relative time) with per-row Restore / Delete and batch Restore all / Delete all |
|
|
14
|
+
| **Code diff**: the code-diff tab in the right sidebar — file list (per-file checkboxes for partial commits) + per-file diff (changed hunks only by default, "Full file" toggle at the top right), with a commit area at the bottom for the message, an optional Tag, and Commit / Commit & push | **Archive manager**: an Archive manager page in the Settings dialog listing archived sessions (title / workspace / relative time) with per-row Restore / Delete and batch Restore all / Delete all |
|
|
15
15
|
|  | |
|
|
16
16
|
| **MCP manager**: an MCP page in the Settings dialog listing configured MCP servers with live status and tool counts, plus full management (Add / Edit / Enable / Disable / Delete / Restart) | |
|
|
17
17
|
|
|
@@ -26,11 +26,11 @@ A [DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harness/) (DSH)
|
|
|
26
26
|
- **Branch chip** — beside the session title; shows the current branch and opens a downward branch panel (local / remote lists, `git switch` on click, new-branch field). A **pull** button sits beside the current branch in the panel header (`git pull --ff-only` — fast-forward only: a diverged branch aborts with git's own error instead of silently merging; hidden when the branch has no upstream), so what gets pulled is always the branch in the header. The panel's **Graph** entry opens the **commit graph** dialog: the latest 150 commits (`git log --date-order --all`) are laid out into lanes and rendered as a colored SVG fork/merge graph — dots are commits, curves are forks/merges, each branch line keeps its own color and merge arcs adopt the color of the lane they join; rows highlight on hover, refresh in the header.
|
|
27
27
|
- **Code diff** — changed-file list + per-file diff (changed hunks only by default, "Full file" toggle at the top right). The file-list / diff / commit sections split with draggable horizontal dividers (double-click resets; the message box stretches, Shift+Enter for new lines). The **commit band stays at the foot** (Commit / Commit & push, message required). Without a git repo the page shows a note instead of hiding.
|
|
28
28
|
- Opening the project in external apps is DSH's own open-in-app header button, so this plugin no longer ships one; every git op runs server-side through `execFile('git', …)` (no shell, timeouts).
|
|
29
|
-
- **Archive manager (toggleable, off by default)** — an **Archive** page in the Settings dialog listing archived sessions (title / workspace / relative time) with per-row **Restore** and **Delete** actions plus batch **Restore all** / **Delete all** buttons.
|
|
29
|
+
- **Archive manager (toggleable, off by default)** — an **Archive manager** page in the Settings dialog listing archived sessions (title / workspace / relative time) with per-row **Restore** and **Delete** actions plus batch **Restore all** / **Delete all** buttons.
|
|
30
30
|
- **Restore** removes a session from the archive set (its log and workspace slot are kept, so the conversation returns to the normal sidebar list).
|
|
31
|
-
- **Delete** PERMANENTLY deletes the session — the server removes its JSONL log from disk, detaches it from workspace accounting and the archive set, and clears its projection cache (irreversible). Only genuinely **running** sessions are refused; opened-but-idle sessions are also removed from the in-memory store, so the row disappears live.
|
|
31
|
+
- **Delete** PERMANENTLY deletes the session — the server removes its JSONL log from disk, detaches it from workspace accounting and the archive set, and clears its projection cache (irreversible). Only genuinely **running** sessions are refused; opened-but-idle sessions are also removed from the in-memory store, so the row disappears live. The same action is available as **Delete session** in a sidebar row's "..." menu (click twice to confirm; the armed state reverts after 3s, and a running session gets the reason printed right in the menu).
|
|
32
32
|
- The list refreshes live via the `host/archived-sessions-changed` event and a session-list re-pull, with no page reload.
|
|
33
|
-
- **MCP manager (toggleable, off by default)** — an **MCP** page in the Settings dialog listing every configured MCP server (`@deepseek-ai/dsh-mcp-client` loader entries) with its live status, command/url, env vars and registered tools, plus full management: **Add / Edit** (a structured form — instance id, name, stdio or HTTP type, timeout ms, command, args, env — OR raw YAML, both validated), **Enable / Disable / Delete**, and **Restart** (runtime-only). Changes persist to the profile's `cordis.patch.yml` and DSH's built-in patch watcher hot-reloads just that server.
|
|
33
|
+
- **MCP manager (toggleable, off by default)** — an **MCP manager** page in the Settings dialog listing every configured MCP server (`@deepseek-ai/dsh-mcp-client` loader entries) with its live status, command/url, env vars and registered tools, plus full management: **Add / Edit** (a structured form — instance id, name, stdio or HTTP type, timeout ms, command, args, env — OR raw YAML, both validated), **Enable / Disable / Delete**, and **Restart** (runtime-only). Changes persist to the profile's `cordis.patch.yml` and DSH's built-in patch watcher hot-reloads just that server.
|
|
34
34
|
- **`/init` slash command (toggleable, off by default)** — type `/init` in the composer (the slash menu shows "Analyze this project and generate an AGENTS.md"), pick a prompt language from the popup (**Chinese / English**), and a complete AGENTS.md bootstrap prompt is submitted into the current session: the agent explores the project on its own (README, manifests, build scripts, key directories), then writes or improves a root `AGENTS.md` addressed to future AI coding agents (overview, common commands, conventions, directory guide, gotchas; existing files are improved in place). Pure client-side contribution; enable it in the UI Tweaks settings section.
|
|
35
35
|
- **Task alerts (toggleable, off by default)** — call you back while the tab sits in the background. Watches **all sessions** (background included) for two event kinds: **finish** (the `running` flag drops, or the host's green `completed` reminder rises; a host projection of the logged `turn/end` reason tells **completed / interrupted / failed** apart, and failure alerts carry a truncated error summary) and **interaction** (the session starts waiting for your approval / plan review / answer — the same `pendingInteraction` source as the sidebar amber dot). Three independent channels:
|
|
36
36
|
- **Tab title flash** — blinks an unread counter `(2) 🔔 …` into the tab title until you come back, then restores it;
|
|
@@ -49,7 +49,7 @@ All changes apply **live** — no reload needed. The same values can be hand-edi
|
|
|
49
49
|
timelineStyle: web # defaults to native (DSH's built-in turn rail); web is the classic web timeline
|
|
50
50
|
themeStyle: minimal # defaults to default (DSH's stock look); minimal tints markdown inline code Anthropic red (#c15f3c light / #d97757 dark), neon-lime is the neon-poster skin
|
|
51
51
|
gitBarEnabled: true # defaults to false (off); set true to enable GitBar
|
|
52
|
-
archiveManagerEnabled: true # defaults to false (off); set true to show the Archive page
|
|
52
|
+
archiveManagerEnabled: true # defaults to false (off); set true to show the Archive manager page
|
|
53
53
|
initCommandEnabled: true # defaults to false (off); set true to register the /init slash command
|
|
54
54
|
preciseCacheHitEnabled: true # defaults to false (off); set true to enable the two-decimal cache-hit figure
|
|
55
55
|
notificationsEnabled: true # defaults to false (off); set true to enable task alerts (event filters & channels are per-item toggles in Settings)
|
|
@@ -80,10 +80,33 @@ The package spec after `add` is forwarded to pnpm verbatim, so versions can be
|
|
|
80
80
|
pinned — `@version` for the npm package, `#tag` for the GitHub source:
|
|
81
81
|
|
|
82
82
|
```bash
|
|
83
|
-
npx -y @deepseek-ai/dsh plugin --profile desktop add dsh-ui-tweaks@0.19.
|
|
84
|
-
npx -y @deepseek-ai/dsh plugin --profile desktop add github:wlj521/dsh-ui-tweaks#v0.19.
|
|
83
|
+
npx -y @deepseek-ai/dsh plugin --profile desktop add dsh-ui-tweaks@0.19.2 # pin the npm version
|
|
84
|
+
npx -y @deepseek-ai/dsh plugin --profile desktop add github:wlj521/dsh-ui-tweaks#v0.19.2 # pin a git tag
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
+
### Path three: a local directory (picked in the desktop app, no CLI)
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
git clone https://github.com/wlj521/dsh-ui-tweaks.git
|
|
91
|
+
cd dsh-ui-tweaks
|
|
92
|
+
pnpm install # `prepare` builds lib/ for you
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Then open **Plugins → Add plugin** in the desktop app and enter the directory's
|
|
96
|
+
**absolute path** (for example `D:\dsh-project\dsh-ui-tweaks`).
|
|
97
|
+
|
|
98
|
+
> **Run `pnpm install` first — it is required**: a local-directory install becomes a
|
|
99
|
+
> `link:` symlink, and pnpm neither runs `prepare` for it nor installs its own
|
|
100
|
+
> dependencies. The directory must therefore already hold the built `lib/` (what
|
|
101
|
+
> `main` points at) and `node_modules/` (the runtime dependency, `yaml`). Without
|
|
102
|
+
> them the install reports success and nothing errors, yet DSH logs
|
|
103
|
+
> `ui-tweaks (dsh-ui-tweaks): failed to import` at startup and the plugin never
|
|
104
|
+
> loads.
|
|
105
|
+
>
|
|
106
|
+
> The path must be **absolute** — a relative one is rejected (the Host's working
|
|
107
|
+
> directory means nothing to the person typing into a browser). CLI equivalent:
|
|
108
|
+
> `npx -y @deepseek-ai/dsh plugin --profile desktop add <absolute path>`.
|
|
109
|
+
|
|
87
110
|
Restart the DSH desktop app once after installing (bundle
|
|
88
111
|
plugins are scanned at process start).
|
|
89
112
|
|
|
@@ -135,6 +158,29 @@ npx -y @deepseek-ai/dsh plugin --profile desktop add . # bundle install from
|
|
|
135
158
|
off or switching sessions restores the original texts. Registration follows
|
|
136
159
|
the /init command's on-demand choreography: mounted only while
|
|
137
160
|
`preciseCacheHitEnabled` is on.
|
|
161
|
+
- **Delete session row** (`src/client/session-menu.tsx`) registers one entry in
|
|
162
|
+
the host's `sidebar.workspaces.session.menu.item` list — the "..." menu of a
|
|
163
|
+
sidebar session row, whose shipped pin / rename / fork / archive rows are
|
|
164
|
+
ordinary entries of the same list — at `order: 500`, so it lands right after
|
|
165
|
+
them. DSH has no session-delete API at any layer, so the row calls this
|
|
166
|
+
plugin's own same-origin archive route; two clicks delete (the armed state
|
|
167
|
+
reverts after 3s), a running session is refused by the server and the menu
|
|
168
|
+
stays open with the reason printed under the row. It rides the same
|
|
169
|
+
`archiveManagerEnabled` toggle as the Archive page, and the row re-implements
|
|
170
|
+
ui-primitives' `MenuItemButton` markup and styling because that package is
|
|
171
|
+
outside this plugin's `dsh.client.inject` whitelist.
|
|
172
|
+
- **Settings nav glyphs** (`src/client/nav-icons.ts`): the host paints one
|
|
173
|
+
hardcoded glyph per settings-section **id** and the `settings.section`
|
|
174
|
+
registration carries only `id / order / label` — no icon seat — so this
|
|
175
|
+
plugin's four pages would all show the generic gear. A MutationObserver walks
|
|
176
|
+
the settings dialog's nav rows, claims the ones whose label is this plugin's
|
|
177
|
+
own (localized) copy, tags them with `data-dut-nav-icon`, and an injected
|
|
178
|
+
stylesheet hides the stock gear and masks in the matching glyph (UI Tweaks =
|
|
179
|
+
sliders, Archive manager = archive box, MCP manager = plug, Web search =
|
|
180
|
+
globe; the sliders / archive / globe paths are `ui-primitives`' own
|
|
181
|
+
artwork). Label matching keeps it self-healing: locale switches and host
|
|
182
|
+
re-renders re-claim the rows, rows this plugin no longer renders lose the tag,
|
|
183
|
+
and every row it does not own is left exactly as shipped.
|
|
138
184
|
|
|
139
185
|
## License
|
|
140
186
|
|
package/README.md
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
> **依赖版本**:当前依赖 **DSH v0.2.0-rc.2**。
|
|
4
4
|
|
|
5
|
-
[DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harness/)(DSH
|
|
5
|
+
[DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harness/)(DSH)插件:在设置面板中实时调整对话界面——代码字号、**主题皮肤**(简约 / 荧光海报)、**时间线切换**(原生回合导航轨 / 经典网页时间线)、**GitBar**(会话头部的分支胶囊 + 右侧边栏里的代码差异标签页),可开关的**归档管理**(设置中的「归档管理」页面:查看、恢复或彻底删除已归档会话),可开关的**任务提醒**(会话完成或需要交互时,通过标签页标题闪烁 / 系统通知 / 提示音把你唤回来),以及**缓存命中率两位小数**(把输入框下方统计条的缓存命中百分比改写为精确值)。
|
|
6
6
|
|
|
7
7
|
## 预览
|
|
8
8
|
|
|
9
9
|
| | |
|
|
10
10
|
|---|---|
|
|
11
11
|
|  |  |
|
|
12
|
-
| **设置面板**:代码字号 / 主题皮肤(简约 · 荧光海报)/ 缓存两位小数 / 网络搜索 / 时间线 / Git
|
|
12
|
+
| **设置面板**:代码字号 / 主题皮肤(简约 · 荧光海报)/ 缓存两位小数 / 网络搜索 / 时间线 / Git 状态栏等功能开关,左侧另有「归档管理」「MCP 管理」「网络搜索」页面 | **分支面板**:点击会话头部的分支胶囊向下弹出——本地 / 远程分支列表,点击即切换;头部右侧是拉取按钮(只快进),底部可新建分支,菜单里可打开**提交图谱**(彩色 SVG 分叉图)与 **Tag** 管理 |
|
|
13
13
|
|  |  |
|
|
14
|
-
| **代码差异**:右侧边栏里的代码差异标签页——文件列表(逐文件勾选,可部分提交)+ 逐文件 diff(默认只显示有差异的 hunk,右上可切“完整文件”),底部提交区可写提交说明、打 Tag,提交 / 提交并推送 |
|
|
14
|
+
| **代码差异**:右侧边栏里的代码差异标签页——文件列表(逐文件勾选,可部分提交)+ 逐文件 diff(默认只显示有差异的 hunk,右上可切“完整文件”),底部提交区可写提交说明、打 Tag,提交 / 提交并推送 | **归档管理**:设置中的「归档管理」页面,列出所有已归档会话(标题 / 工作区 / 相对时间),支持恢复与彻底删除,顶部可全部恢复 / 全部删除 |
|
|
15
15
|
|  | |
|
|
16
16
|
| **MCP 管理**:设置中的「MCP 管理」页面,列出所有配置的 MCP 服务器及其运行状态与工具数,支持添加 / 编辑 / 启用停用 / 删除 / 重启 | |
|
|
17
17
|
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
- **分支胶囊**:位于会话标题旁;显示当前分支名(有未提交改动时在标题提示)。点击**向下**弹出分支面板——本地 / 远程分支列表(点击即 `git switch`),底部可**新建分支**(`git switch -c` 并自动切换)。**头部当前分支右侧是拉取按钮**(`git pull --ff-only`:只快进,分叉时中止并显示 git 报错而不悄悄合并;无 upstream 的分支不显示该按钮),拉的就是头部显示的那个分支。菜单里的**图谱**打开**提交图谱**对话框:最近 150 条提交(`git log --date-order --all`)按拓扑自动分 lane,渲染成彩色 SVG 分叉图——圆点是提交、曲线是 fork/merge,各分支线独立着色,合并弧线汇入目标分支并采用其颜色;行悬停高亮,右上角可刷新。
|
|
27
27
|
- **代码差异**:文件列表 + 逐文件 diff(默认**只显示有差异的 hunk**,右上可切“完整文件”视图)。三段(文件列表 / diff 内容 / 提交区)之间的分隔线**可上下拖动调整高度**(双击复位;提交说明框随提交区高度拉伸,可写多行,Shift+Enter 换行)。**提交区保留在视图底部**(提交 / 提交并推送,提交说明必须自行填写)。非 git 仓库时该页显示提示而不隐藏。
|
|
28
28
|
- 在外部应用中打开项目走 DSH 自带的「在本地打开」按钮,本插件不再重复提供;所有 git 操作走服务端 `execFile('git', …)`(无 shell、带超时)。
|
|
29
|
-
-
|
|
29
|
+
- **归档管理(可开关,默认关闭)**:设置面板中的「归档管理」页面,列出所有已归档会话(标题 / 所在工作区 / 相对时间),支持**恢复**与**彻底删除**:
|
|
30
30
|
- **恢复**:把会话移出归档——日志与工作区槽位原样保留,会话回到侧边栏列表。
|
|
31
|
-
- **删除**:**彻底删除**该会话——服务端将其 JSONL
|
|
31
|
+
- **删除**:**彻底删除**该会话——服务端将其 JSONL 日志从磁盘移除、从工作区记账与归档集合中清除、并清理投影缓存,会话永久消失(不可恢复)。只有**正在运行**(有任务在跑)的会话会被拒绝;已打开但空闲的会话也会从内存中移除,删除后实时从列表消失。侧边栏会话行「…」菜单里也有同一操作的**删除会话**入口(点两次确认,第一次点后 3 秒内不再点则自动撤销;运行中的会话会在菜单里就地提示原因)。
|
|
32
32
|
- 顶部另有**全部恢复 / 全部删除**批量操作(删除类操作需二次确认)。列表随 `host/archived-sessions-changed` 事件与客户端会话列表刷新实时更新,无需刷新页面。
|
|
33
33
|
- **MCP 管理(可开关,默认关闭)**:设置面板中的「MCP 管理」页面,展示 profile 里配置的所有 MCP 服务器(`@deepseek-ai/dsh-mcp-client` 实例)及其状态(运行中 / 错误 / 加载中 / 未运行 / 已停用)、命令、环境变量、已注册工具,并支持完整管理:
|
|
34
34
|
- **添加 / 编辑**:编辑器支持**表单**(实例 ID / 名称 / 类型 stdio 或 HTTP / 超时时间 ms / 命令 / 参数 / 环境变量 / URL / 请求头)或直接**粘贴 YAML** 两种方式,保存前会做格式校验(名称与 ID 字符集、超时正整数、URL 协议、命令非空、未知 YAML 字段等)。
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
timelineStyle: web # 默认 native(DSH 自带回合导航轨),web 为经典网页时间线
|
|
53
53
|
themeStyle: minimal # 默认 default(DSH 原生外观),minimal 只把行内代码染成 Anthropic 红(浅色 #c15f3c / 深色 #d97757),neon-lime 为荧光海报皮肤
|
|
54
54
|
gitBarEnabled: true # 默认 false(关闭),设为 true 开启 GitBar
|
|
55
|
-
archiveManagerEnabled: true # 默认 false(关闭),设为 true
|
|
55
|
+
archiveManagerEnabled: true # 默认 false(关闭),设为 true 开启「归档管理」页面
|
|
56
56
|
initCommandEnabled: true # 默认 false(关闭),设为 true 开启 /init 斜杠命令
|
|
57
57
|
preciseCacheHitEnabled: true # 默认 false(关闭),设为 true 开启缓存命中率两位小数
|
|
58
58
|
notificationsEnabled: true # 默认 false(关闭),设为 true 开启任务提醒(事件过滤与三个通道在设置里逐项开关)
|
|
@@ -82,10 +82,24 @@ npx -y @deepseek-ai/dsh plugin --profile desktop add github:wlj521/dsh-ui-tweaks
|
|
|
82
82
|
`add` 后面的包说明会**原样转发给 pnpm**,因此可以指定版本——npm 包用 `@版本号`,GitHub 源码用 `#tag`:
|
|
83
83
|
|
|
84
84
|
```bash
|
|
85
|
-
npx -y @deepseek-ai/dsh plugin --profile desktop add dsh-ui-tweaks@0.19.
|
|
86
|
-
npx -y @deepseek-ai/dsh plugin --profile desktop add github:wlj521/dsh-ui-tweaks#v0.19.
|
|
85
|
+
npx -y @deepseek-ai/dsh plugin --profile desktop add dsh-ui-tweaks@0.19.2 # 锁定 npm 版本
|
|
86
|
+
npx -y @deepseek-ai/dsh plugin --profile desktop add github:wlj521/dsh-ui-tweaks#v0.19.2 # 锁定 git tag
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
+
### 方式三:本地目录(在桌面端点选,无需命令行)
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
git clone https://github.com/wlj521/dsh-ui-tweaks.git
|
|
93
|
+
cd dsh-ui-tweaks
|
|
94
|
+
pnpm install # prepare 会自动构建出 lib/
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
然后在桌面端打开 **插件 → 添加插件**,填入该目录的**绝对路径**(例如 `D:\dsh-project\dsh-ui-tweaks`)。
|
|
98
|
+
|
|
99
|
+
> **先跑 `pnpm install` 是必需的**:本地目录安装走 `link:` 软链,pnpm **不会**为它执行 `prepare`,也不会安装它自己的依赖。所以目录里必须已经存在构建产物 `lib/`(`main` 指向的文件)和 `node_modules/`(运行时依赖 `yaml`)。缺了的话安装会「成功」、命令也不报错,但启动时 DSH 会报 `ui-tweaks (dsh-ui-tweaks): failed to import`,插件不生效。
|
|
100
|
+
>
|
|
101
|
+
> 路径必须是**绝对路径**——相对路径会被拒绝(宿主的当前工作目录对浏览器里输入的人没有意义)。命令行等价做法:`npx -y @deepseek-ai/dsh plugin --profile desktop add <绝对路径>`。
|
|
102
|
+
|
|
89
103
|
安装完成后**重启一次 DSH 桌面端**(bundle 插件在进程启动时扫描)。
|
|
90
104
|
|
|
91
105
|
> 若 pnpm 报符号链接/hoist 相关错误,可在 profile 的 `pnpm-workspace.yaml` 中设置 `nodeLinker: hoisted`。
|
|
@@ -111,7 +125,8 @@ npx -y @deepseek-ai/dsh plugin --profile desktop add . # 从本目录作为 b
|
|
|
111
125
|
- **Git 后端**(`src/git.ts` + `src/git-web.ts`):通过 `ctx.get('sessions')`(可选服务)解析会话 header 的 `cwd` 作为“当前项目”,用 `child_process.execFile('git', …)`(无 shell、cwd 固定、超时 + 中止传播)执行只读/写操作;同源路由 `/_dsh/ui-tweaks/git/*` 提供 status / branches / diff(hunk 或完整文件,含绝对行号)/ graph(结构化提交行,含父哈希,供前端排布分支 lane)/ commit / push / pull(仅快进)/ checkout / create / branch-delete / remote-delete。
|
|
112
126
|
- **浏览器端**(`src/client/index.tsx`):读写该路由、渲染设置页,并通过运行时 `<style>` 元素实时应用样式,覆盖稳定的 DSH 锚点(`body` 上的 markdown 代码字体 token 与主题变量、`[data-slot="conversation.chat.node"]` 内的代码块 / 表头)。
|
|
113
127
|
- **GitBar**(`src/client/gitbar.tsx`):分支胶囊挂在 `conversation.session.header.actions`(会话标题旁),代码差异则注册为右侧边栏原生标签页(page 类型:`ctx.sidebarRightTabs` 注册类型与指南入口,`sidebar.right.pane.tab` 按类型 id 注册内容,代码差异另注册标题席位在页签上补未提交改动的小黄点,随 `gitBarEnabled` 开关按需挂载)。视图是全高 flex 列:文件列表 / diff / 提交区三段高度分配采用「只给被拖的那一段显式高度、diff 段 `flex:1` 吃掉余量」的方式,配合 45% 上限,拖动永远不会撑破视图。提交保留在代码差异页底部的提交区。在外部应用中打开项目是 DSH 自带的 open-in-app 按钮,本插件的 `/open` 路由与 `openFolder` 后端已随之移除。提交图谱对话框的 lane 布局与 SVG 渲染拆在 `src/client/graphlayout.ts`(纯函数模块:父哈希 → 每行 lane / 边段,经典 first-parent 路由——第一父提交沿用原 lane 让线性历史始终一条线,合并与 fork 画贝塞尔弧线;`parents` 字段可选,兼容宿主里尚未重载的旧服务端)。
|
|
114
|
-
- **归档管理**(服务端 `src/archive.ts` + 浏览器端 `src/client/archive.tsx`):作为 `settings.section`
|
|
128
|
+
- **归档管理**(服务端 `src/archive.ts` + 浏览器端 `src/client/archive.tsx`):作为 `settings.section` 插槽(设置面板中的「归档管理」页面)。列表数据直接来自框架标准 hook `useSessions` + `useWorkspaces`(`archivedSessionIds`),无需额外查询;操作走同源路由 `/_dsh/ui-tweaks/archive`。**恢复**把会话 id 从工作区存储域的 `archivedSessionIds` 全局单例中移除(DSH 只暴露单向 `archiveSession`,无公开的取消归档 API,故直接写活体存储域句柄并同步工作区注册表的内存缓存)。**彻底删除**依次:拒绝正在运行的会话(agent `status === 'running'` 才拒绝,空闲会话先 `cancel` + `whenIdle`)→ 用持久化后端自身的 `findLog` 定位并 `rm` 会话日志目录 → 调用公开的 `WorkspaceEntity.detachSession` 摘除工作区记账 → 从归档集合移除并同步注册表内存缓存与 header 索引 → 清理 `session_projcache` → 从内存 SessionStore 摘除该会话(触发 `host/session-removed` 实时消失)。侧边栏会话行「…」菜单里的**删除会话**(`src/client/session-menu.tsx`)注册进宿主的 `sidebar.workspaces.session.menu.item` 列表槽位(order 500,正好排在 pin / rename / fork / archive 之后;宿主没有会话删除 API,所以它复用同一条同源路由),点击两次删除、第一次点击后 3 秒未再点击自动撤销,运行中的会话被服务端拒绝时菜单保持打开并就地显示原因;它与「归档管理」页面共用 `archiveManagerEnabled` 开关,同开同关。
|
|
129
|
+
- **设置导航图标**(`src/client/nav-icons.ts`):宿主的设置导航是**按 section id 硬编码图标**的(账号 / 模型 / 内置插件 / Agent 预设 / 归档各有专属 artwork,其余一律回退齿轮),而 `settings.section` 的注册项只有 `id / order / label`、没有图标位,所以本插件的四个页面原本都显示同一个齿轮。该模块用 MutationObserver 扫描设置对话框里的导航行,按**行的标签文字**(即本插件自己注册的 i18n 文案)认领自己的行,给命中的行打上 `data-dut-nav-icon`,再由注入的 CSS 隐藏宿主齿轮、用 mask 画出对应图标(界面调整=滑杆、归档管理=归档箱、MCP 管理=插头、网络搜索=地球;滑杆 / 归档箱 / 地球的路径直接取自 `ui-primitives` 自己的 artwork)。按标签匹配让补丁自愈:语言切换或宿主重绘后会重新认领,宿主不渲染这些行时标记自动摘掉,任何不属于本插件的行原样不动。
|
|
115
130
|
- **MCP 管理**(服务端 `src/mcp.ts` + 浏览器端 `src/client/mcp.tsx`):同源路由 `/_dsh/ui-tweaks/mcp`。**列表**枚举 `ctx.loader.entries()` 中 `@deepseek-ai/dsh-mcp-client` 实例(id / config / fiber 状态:active=2、failed=3 等)并按 `mcp__<serverName>__` 前缀从工具注册表统计工具。**重启**调用 `entry.fiber.restart()`(仅运行时)。**添加 / 编辑 / 删除 / 启用停用**通过 `yaml`(eemeli)的 Document API 直接编辑 profile 的 `cordis.patch.yml`(保留注释与未知补丁结构,原子写 tmp+rename),随后由 DSH 内置的 `watchUserPatches` 热重载监视器重新应用补丁——`cordis-plugin-include` 对根组做**增量** `root.update`,因此只有被改动的 MCP 实例会重启,其它不受影响;环境变量值返回给同源浏览器(本机配置编辑需要),YAML 模式在服务端用 `yaml.parse` + 白名单校验。
|
|
116
131
|
- **任务提醒**(`src/client/notifier.ts`):纯逻辑模块(无 React),在 `ctx.effect` 中直订 `ctx.sessions.list` 快照流,对全部非空、非子代理会话做前后对比:`running` true→false 且无挂起交互 → 完成事件;`pendingInteraction`('approval' / 'plan-review' / 'question',即侧边栏黄点分类)出现 → 交互事件;后台会话的宿主 `completed` 绿点升沿同样计为完成。结束原因来自服务端 [`dshTurnOutcome` 投影](D:/dsh-project/dsh-ui-tweaks/src/turn-outcome.ts)(last-wins fold 会话日志的 `turn/end.reason`)并随列表行 `projectionValues` 下发——completed/max-tokens 按「任务完成」、aborted/interrupted 按「任务已中断」、error 按「请求失败」(附截断错误消息)播报;投影缺失或未随本次跳变更新时退回普通完成播报。三通道各自静默降级——标题闪烁用 `setInterval` 交替写 `document.title`,`focus`/`visibilitychange` 时恢复;系统通知带 `tag` 去重、`onclick` 里 `window.focus()` + `sessionsService.open(id)` 直达会话、`silent` 跟随提示音开关避免双重响铃;提示音由 WebAudio 振荡器现场合成双音包络。防打扰:首帧只武装基线、只在跳变沿触发、同会话同类 2s 冷却;「仅页面不可见时」等开关经 `readState` 每拍重读实时生效,改动无需重装监视器。
|
|
117
132
|
- **缓存命中率两位小数**(`src/client/cachehit.tsx`):挂在 `conversation.composer.dock`(输入框卡片下方承载原生统计条的横条)的**空渲染座位**——组件本身不画任何东西,只通过框架第五标准 hook `useProjection('tokenUsage')` 读取会话的 token 用量投影(未缓存输入 / 缓存读取 / 缓存写入 / 输出四个不相交桶),按 `缓存读取 ÷ (未缓存输入 + 缓存读取 + 缓存写入)` 算出精确占比后 `.toFixed(2)`,再把统计条里匹配「缓存命中 N%」/ "Cache hit N%" 的文本原地改写为两位小数——新版 DSH 的用量 pill 把该数字渲染为分隔符后的裸文本节点(附带按钮 `aria-label` 与点开的用量对话框里的同值行,一并改写;按回合的用量对话框用自己的分母,不碰)——布局、截断省略与 tooltip 行为全部保留 DSH 原样。一个 MutationObserver 监听文档子树,React 重绘统计行或打开对话框时自动重打(写入幂等,改写一次后即收敛);开关关闭或会话切换时恢复原始文本并断开监听。注册编排与 /init 命令一致:`preciseCacheHitEnabled` 打开才挂载,关闭即卸载。
|
package/cordis.patch.yml
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
# dsh-ui-tweaks bundle patch
|
|
2
|
-
#
|
|
3
|
-
# Declared by `dsh.bundle.patch` in package.json: when the plugin is installed
|
|
4
|
-
# through the official CLI —
|
|
5
|
-
#
|
|
6
|
-
# dsh plugin --profile <name> add dsh-ui-tweaks
|
|
7
|
-
#
|
|
8
|
-
# — the command appends `dsh-ui-tweaks` to the profile's bundle stack and this
|
|
9
|
-
# patch mounts the server-side plugin row.
|
|
10
|
-
- insert:
|
|
11
|
-
- id: ui-tweaks
|
|
12
|
-
name: 'dsh-ui-tweaks'
|
|
1
|
+
# dsh-ui-tweaks bundle patch
|
|
2
|
+
#
|
|
3
|
+
# Declared by `dsh.bundle.patch` in package.json: when the plugin is installed
|
|
4
|
+
# through the official CLI —
|
|
5
|
+
#
|
|
6
|
+
# dsh plugin --profile <name> add dsh-ui-tweaks
|
|
7
|
+
#
|
|
8
|
+
# — the command appends `dsh-ui-tweaks` to the profile's bundle stack and this
|
|
9
|
+
# patch mounts the server-side plugin row.
|
|
10
|
+
- insert:
|
|
11
|
+
- id: ui-tweaks
|
|
12
|
+
name: 'dsh-ui-tweaks'
|