dsh-ui-tweaks 0.16.3 → 0.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.en.md +6 -7
- package/README.md +8 -9
- package/cordis.patch.yml +12 -12
- package/lib/client.js +958 -5702
- package/lib/client.js.map +6 -1
- package/lib/git-web.js +1 -152
- package/lib/git-web.js.map +1 -1
- package/lib/git.js +0 -220
- package/lib/git.js.map +1 -1
- package/lib/types/client/appicons.d.ts +16 -16
- package/lib/types/client/gitbar.d.ts +2 -10
- package/lib/types/client/gitbar.d.ts.map +1 -1
- package/lib/types/client/icons.d.ts +3 -5
- package/lib/types/client/icons.d.ts.map +1 -1
- package/lib/types/client/index.d.ts +1 -7
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/notifier.d.ts +22 -14
- package/lib/types/client/notifier.d.ts.map +1 -1
- package/lib/types/client/whale.d.ts +54 -54
- package/lib/types/git-web.d.ts +1 -13
- package/lib/types/git-web.d.ts.map +1 -1
- package/lib/types/git.d.ts +0 -93
- package/lib/types/git.d.ts.map +1 -1
- package/lib/types/web.d.ts +18 -1
- package/lib/types/web.d.ts.map +1 -1
- package/lib/web.js +19 -2
- package/lib/web.js.map +1 -1
- package/package.json +42 -45
- package/assets/terminal.png +0 -0
- package/vendor/addon-fit.js +0 -2
- package/vendor/xterm.css +0 -218
- package/vendor/xterm.js +0 -2
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# dsh-ui-tweaks
|
|
2
2
|
|
|
3
|
-
> **Dependency**: currently targets **DSH v0.1.
|
|
3
|
+
> **Dependency**: currently targets **DSH v0.1.6-alpha.2**.
|
|
4
4
|
|
|
5
5
|
A [DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harness/) (DSH) web plugin that live-tunes the conversation UI from the Settings panel.
|
|
6
6
|
|
|
@@ -10,10 +10,10 @@ A [DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harness/) (DSH)
|
|
|
10
10
|
|---|---|
|
|
11
11
|
|  |  |
|
|
12
12
|
| **Settings panel**: code font size / neon-poster theme / two-decimal cache hit / web search / timeline / GitBar toggles, with dedicated **Archive**, **MCP** and **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
|
-
|  |  |  |
|
|
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 |
|
|
15
|
+
|  | |
|
|
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
|
|
|
18
18
|
## Features
|
|
19
19
|
|
|
@@ -22,9 +22,8 @@ A [DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harness/) (DSH)
|
|
|
22
22
|
- **Timeline (single choice in Features)** — one switch, two options:
|
|
23
23
|
- **Native (default)** — DSH's built-in turn rail (the row of small dots beside the messages), the stock behavior.
|
|
24
24
|
- **Web (classic)** — the v0.11 classic right-side navigation rail, restored: vertically centered on the message area's right edge, a thin line strip when collapsed, a 240px panel on hover (message previews + current-position highlight), a per-item detail bubble with timestamp, and **click to jump** (deep history pages in automatically before landing, with a landing self-check); wheel over the rail scrubs clipped items into reach. Data comes from the server-side `dshChatTimeline` session projection (every user message, independent of the browser's loaded window); sessions with fewer than two user messages hide it. On the web option the native turn rail is hidden with one theme-independent CSS rule (matching its `--turn-natural-height` inline variable), so the two never appear together.
|
|
25
|
-
- **GitBar (toggleable, off by default)** — the standard
|
|
25
|
+
- **GitBar (toggleable, off by default)** — the standard pair for git-repo sessions: a **branch chip** in the session header, plus a **code diff** tab in the native right sidebar (next to Files, opened from the sidebar guide; uncommitted changes put a dot on the code diff tab):
|
|
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
|
-
- **Terminal** — a real PTY terminal in the sidebar (xterm.js over a WebSocket to a persistent shell in the session cwd) with theme-following colors. Leaving the tab only drops the frontend connection; the host shell stays alive and replays its transcript, so you come back to the same session.
|
|
28
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.
|
|
29
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).
|
|
30
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.
|
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# dsh-ui-tweaks
|
|
2
2
|
|
|
3
|
-
> **依赖版本**:当前依赖 **DSH v0.1.
|
|
3
|
+
> **依赖版本**:当前依赖 **DSH v0.1.6-alpha.2**。
|
|
4
4
|
|
|
5
|
-
[DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harness/)(DSH)Web UI 插件:在设置面板中实时调整对话界面——代码字号、**主题皮肤**(荧光海报风)、**时间线切换**(原生回合导航轨 / 经典网页时间线)、**GitBar**(会话头部的分支胶囊 +
|
|
5
|
+
[DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harness/)(DSH)Web UI 插件:在设置面板中实时调整对话界面——代码字号、**主题皮肤**(荧光海报风)、**时间线切换**(原生回合导航轨 / 经典网页时间线)、**GitBar**(会话头部的分支胶囊 + 右侧边栏里的代码差异标签页),可开关的**归档管理**(设置中的「归档」页面:查看、恢复或彻底删除已归档会话),可开关的**任务提醒**(会话完成或需要交互时,通过标签页标题闪烁 / 系统通知 / 提示音把你唤回来),以及**缓存命中率两位小数**(把输入框下方统计条的缓存命中百分比改写为精确值)。
|
|
6
6
|
|
|
7
7
|
## 预览
|
|
8
8
|
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
|---|---|
|
|
11
11
|
|  |  |
|
|
12
12
|
| **设置面板**:代码字号 / 荧光海报主题 / 缓存两位小数 / 网络搜索 / 时间线 / Git 状态栏等功能开关,左侧另有「归档」「MCP 管理」「搜索」页面 | **分支面板**:点击会话头部的分支胶囊向下弹出——本地 / 远程分支列表,点击即切换;头部右侧是拉取按钮(只快进),底部可新建分支,菜单里可打开**提交图谱**(彩色 SVG 分叉图)与 **Tag** 管理 |
|
|
13
|
-
|  |  |  |
|
|
14
|
+
| **代码差异**:右侧边栏里的代码差异标签页——文件列表(逐文件勾选,可部分提交)+ 逐文件 diff(默认只显示有差异的 hunk,右上可切“完整文件”),底部提交区可写提交说明、打 Tag,提交 / 提交并推送 | **归档管理**:设置中的「归档」页面,列出所有已归档会话(标题 / 工作区 / 相对时间),支持恢复与彻底删除,顶部可全部恢复 / 全部删除 |
|
|
15
|
+
|  | |
|
|
16
|
+
| **MCP 管理**:设置中的「MCP 管理」页面,列出所有配置的 MCP 服务器及其运行状态与工具数,支持添加 / 编辑 / 启用停用 / 删除 / 重启 | |
|
|
17
17
|
|
|
18
18
|
## 功能
|
|
19
19
|
|
|
@@ -22,9 +22,8 @@
|
|
|
22
22
|
- **时间线(功能区内单选)**:一个开关两档,选一个:
|
|
23
23
|
- **原生(默认)**:DSH 自带的回合导航轨(消息右侧的小圆点条),即官方默认行为。
|
|
24
24
|
- **网页(经典)**:找回 v0.11 的经典右侧导航轨——消息区右缘垂直居中,收起时是一列细线,悬停展开为 240px 面板(消息预览 + 高亮当前位),悬停单项弹出带时间戳的详情气泡,**点击跳转**到对应消息(深历史会自动连续翻页加载后落点,带落点自校验);滚轮可在轨上直接翻阅被裁剪的条目。数据来自服务端 `dshChatTimeline` 会话投影(全量用户消息,与浏览器已加载窗口无关),少于两条用户消息的会话自动隐藏;切换到网页档时,原生回合导航轨由插件用一条主题无关的 CSS 规则(命中其 `--turn-natural-height` 内联变量)隐藏,两个不会同时出现。
|
|
25
|
-
- **GitBar(默认关闭,可在设置中开启)**:git
|
|
25
|
+
- **GitBar(默认关闭,可在设置中开启)**:git 仓库会话的标配两件套——会话头部的**分支胶囊**,加上右侧边栏(文件旁)的**代码差异**标签页(在边栏指南里点开,有未提交改动时分支胶囊和代码差异页签上都带小黄点):
|
|
26
26
|
- **分支胶囊**:位于会话标题旁;显示当前分支名(有未提交改动时在标题提示)。点击**向下**弹出分支面板——本地 / 远程分支列表(点击即 `git switch`),底部可**新建分支**(`git switch -c` 并自动切换)。**头部当前分支右侧是拉取按钮**(`git pull --ff-only`:只快进,分叉时中止并显示 git 报错而不悄悄合并;无 upstream 的分支不显示该按钮),拉的就是头部显示的那个分支。菜单里的**图谱**打开**提交图谱**对话框:最近 150 条提交(`git log --date-order --all`)按拓扑自动分 lane,渲染成彩色 SVG 分叉图——圆点是提交、曲线是 fork/merge,各分支线独立着色,合并弧线汇入目标分支并采用其颜色;行悬停高亮,右上角可刷新。
|
|
27
|
-
- **终端**:边栏里的真 PTY 终端(xterm.js + WebSocket 直连会话工作目录的常驻 shell):完整终端交互、颜色跟随主题。切走标签页只断开前端连接,shell 在服务端保活并重播 transcript,回来还是同一个会话。
|
|
28
27
|
- **代码差异**:文件列表 + 逐文件 diff(默认**只显示有差异的 hunk**,右上可切“完整文件”视图)。三段(文件列表 / diff 内容 / 提交区)之间的分隔线**可上下拖动调整高度**(双击复位;提交说明框随提交区高度拉伸,可写多行,Shift+Enter 换行)。**提交区保留在视图底部**(提交 / 提交并推送,提交说明必须自行填写)。非 git 仓库时该页显示提示而不隐藏。
|
|
29
28
|
- 在外部应用中打开项目走 DSH 自带的「在本地打开」按钮,本插件不再重复提供;所有 git 操作走服务端 `execFile('git', …)`(无 shell、带超时)。
|
|
30
29
|
- **归档管理(可开关,默认关闭)**:设置面板中的「归档」页面,列出所有已归档会话(标题 / 所在工作区 / 相对时间),支持**恢复**与**彻底删除**:
|
|
@@ -99,7 +98,7 @@ npx -y @deepseek-ai/dsh plugin --profile web add . # 从本目录作为 b
|
|
|
99
98
|
- **服务端**(`src/index.ts`):注册 `ui-tweaks` 设置命名空间,并挂载同源路由 `/_dsh/ui-tweaks/settings`——自 rc.6 起,Web 设置 RPC 只暴露固定白名单命名空间,因此自定义路由是插件拥有配置页的方式。
|
|
100
99
|
- **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。
|
|
101
100
|
- **浏览器端**(`src/client/index.tsx`):读写该路由、渲染设置页,并通过运行时 `<style>` 元素实时应用样式,覆盖稳定的 DSH 锚点(`body` 上的 markdown 代码字体 token 与主题变量、`[data-slot="conversation.chat.node"]` 内的代码块 / 表头)。
|
|
102
|
-
- **GitBar**(`src/client/gitbar.tsx`):分支胶囊挂在 `conversation.session.header.actions
|
|
101
|
+
- **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` 字段可选,兼容宿主里尚未重载的旧服务端)。
|
|
103
102
|
- **归档管理**(服务端 `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` 实时消失)。
|
|
104
103
|
- **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` + 白名单校验。
|
|
105
104
|
- **任务提醒**(`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` 每拍重读实时生效,改动无需重装监视器。
|
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'
|