dsh-ui-tweaks 0.17.2 → 0.18.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/README.en.md +19 -13
- package/README.md +15 -12
- package/lib/client.js +17 -17
- package/lib/client.js.map +2 -2
- package/lib/config.js +33 -24
- package/lib/config.js.map +1 -1
- package/lib/index.js +43 -22
- package/lib/index.js.map +1 -1
- package/lib/types/client/index.d.ts +2 -2
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/config.d.ts +59 -10
- package/lib/types/config.d.ts.map +1 -1
- package/lib/types/index.d.ts +18 -5
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/turn-outcome.d.ts +1 -1
- package/lib/types/turn-outcome.d.ts.map +1 -1
- package/package.json +45 -45
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.7-rc.1**.
|
|
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
|
|
|
@@ -17,7 +17,7 @@ A [DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harness/) (DSH)
|
|
|
17
17
|
|
|
18
18
|
## Features
|
|
19
19
|
|
|
20
|
-
- **Code font size (px)** — absolute 8–32px, default
|
|
20
|
+
- **Code font size (px)** — absolute 8–32px, default 11 (DSH's stock code-block size at a 14px body); applies to code blocks, with inline code following proportionally. The legacy percentage (`codeFontScale`) stays compatible and is overridden once a px value is set. Message text keeps DSH's stock sizing.
|
|
21
21
|
- **Theme (single choice in Layout, stock look by default)** — choose `Default`, **Minimal** or **Neon poster**. **Minimal** keeps DSH's stock look untouched and changes exactly one thing: markdown inline code is tinted with the Anthropic red (`#c15f3c` in light, `#d97757` in dark — the same accent the poster skin uses) in the conversation. **Neon poster** is a two-scheme poster skin — paper-white with ink-black hairlines in light mode, near-black with light hairlines in dark mode, both with lime highlights and an Anthropic-red action accent (buttons, links and selections follow the theme tokens automatically; code blocks and the composer card get hard offset shadows), and the composer's reasoning-effort label is tinted by intensity (green / amber / blue / violet, with a same-hue wash sweeping option rows on hover), applied live. Future skins will be added as further options the same way.
|
|
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.
|
|
@@ -39,17 +39,20 @@ A [DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harness/) (DSH)
|
|
|
39
39
|
- "Only when hidden" defaults on (no nagging while you watch the page); the first snapshot only arms the baseline (a page reload never fires a burst); events fire on transitions with a 2s per-session+kind cooldown (reconnect flicker absorbed); subagent child rows are skipped (the parent carries the turn). A **Test** button in Settings previews permission and channels in one click.
|
|
40
40
|
- **Precise cache hit (toggleable, off by default)** — DSH's stats line shows the cache-hit share as a bare integer ("Cache hit 96%"). When enabled, the figure is rewritten to two decimals ("Cache hit 96.35%") and computed from the raw token buckets — cache reads ÷ billed input (uncached input + cache reads + cache writes) — the same source as the stock number, just unrounded; a full hit shows 100.00%, and with no billed input the group is absent anyway. The toggle lives in the Layout settings group; turning it off restores the stock figure.
|
|
41
41
|
|
|
42
|
-
All changes apply **live** — no reload needed. The same values can be hand-edited in the settings
|
|
42
|
+
All changes apply **live** — no reload needed. The same values can be hand-edited in the profile's `cordis.patch.yml` (the document the Settings page writes; `settings.yaml` was retired in DSH 0.1.7):
|
|
43
43
|
|
|
44
44
|
```yaml
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
# $DSH_HOME/profiles/<profile>/cordis.patch.yml
|
|
46
|
+
- id: ui-tweaks
|
|
47
|
+
name: dsh-ui-tweaks
|
|
48
|
+
config:
|
|
49
|
+
timelineStyle: web # defaults to native (DSH's built-in turn rail); web is the classic web timeline
|
|
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
|
+
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
|
|
53
|
+
initCommandEnabled: true # defaults to false (off); set true to register the /init slash command
|
|
54
|
+
preciseCacheHitEnabled: true # defaults to false (off); set true to enable the two-decimal cache-hit figure
|
|
55
|
+
notificationsEnabled: true # defaults to false (off); set true to enable task alerts (event filters & channels are per-item toggles in Settings)
|
|
53
56
|
```
|
|
54
57
|
|
|
55
58
|
Settings entry: **Settings → UI Tweaks**.
|
|
@@ -104,8 +107,11 @@ npx -y @deepseek-ai/dsh plugin --profile web add . # bundle install from
|
|
|
104
107
|
|
|
105
108
|
## How it works
|
|
106
109
|
|
|
107
|
-
- **Server** (`src/index.ts`)
|
|
108
|
-
|
|
110
|
+
- **Server** (`src/index.ts`) exports the `Config` settings schema — since DSH
|
|
111
|
+
0.1.7 the Settings form is derived from a plugin's exported `Config`
|
|
112
|
+
(the old `settings.register()` is gone) and `configure({ auto: false })`
|
|
113
|
+
suppresses the auto-generated page in favor of the client's own sections —
|
|
114
|
+
and mounts a same-origin route (`/_dsh/ui-tweaks/settings`) — the Web settings
|
|
109
115
|
RPC only exposes a fixed allowlist of namespaces since rc.6, so a custom route
|
|
110
116
|
is how a plugin owns a configuration page.
|
|
111
117
|
- **Browser** (`src/client/index.tsx`) reads/writes that route, renders the
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# dsh-ui-tweaks
|
|
2
2
|
|
|
3
|
-
> **依赖版本**:当前依赖 **DSH v0.1.
|
|
3
|
+
> **依赖版本**:当前依赖 **DSH v0.1.7-rc.1**。
|
|
4
4
|
|
|
5
5
|
[DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harness/)(DSH)Web UI 插件:在设置面板中实时调整对话界面——代码字号、**主题皮肤**(简约 / 荧光海报)、**时间线切换**(原生回合导航轨 / 经典网页时间线)、**GitBar**(会话头部的分支胶囊 + 右侧边栏里的代码差异标签页),可开关的**归档管理**(设置中的「归档」页面:查看、恢复或彻底删除已归档会话),可开关的**任务提醒**(会话完成或需要交互时,通过标签页标题闪烁 / 系统通知 / 提示音把你唤回来),以及**缓存命中率两位小数**(把输入框下方统计条的缓存命中百分比改写为精确值)。
|
|
6
6
|
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
## 功能
|
|
19
19
|
|
|
20
|
-
- **代码字号(px)**:绝对值 8–32,默认
|
|
20
|
+
- **代码字号(px)**:绝对值 8–32,默认 11(正文 14 时的 DSH 原生代码块字号);作用于代码块,行内代码按比例跟随——旧版的百分比配置(`codeFontScale`)仍然兼容,一旦设置新的 px 值即以其为准。消息正文保持 DSH 原生字号。
|
|
21
21
|
- **主题(布局区单选,默认即原生外观)**:可选 `默认`、**简约** 或 **荧光海报**。**简约**完全保留 DSH 原生外观,只改一处——对话里的 Markdown 行内代码染成 Anthropic 红 `#c15f3c`(深色模式下 `#d97757`,与荧光海报同款强调色;代码块、表格、按钮等一律不动)。**荧光海报**是海报风双方案皮肤:浅色模式纸白底 + 黑粗线条,深色模式近黑底 + 浅色粗线条,都配荧光黄高亮 + Anthropic 红点缀(按钮、链接、选中态跟随主题变量自动变色,代码块与输入框卡片带硬阴影贴纸效果),输入框模型旁的**推理等级**按强度着色(绿 / 琥珀 / 蓝 / 紫,悬停选项行时同色底从左扫过)。切换即时生效,后续皮肤会以同样方式追加为新选项。
|
|
22
22
|
- **时间线(功能区内单选)**:一个开关两档,选一个:
|
|
23
23
|
- **原生(默认)**:DSH 自带的回合导航轨(消息右侧的小圆点条),即官方默认行为。
|
|
@@ -42,17 +42,20 @@
|
|
|
42
42
|
- 「仅页面不可见时」默认开启(正盯着页面时不打扰);首帧快照只武装不触发(刷新页面不刷屏);只在跳变沿触发 + 同会话同类事件 2 秒冷却(防重连抖动);子代理子会话不计(父会话承载整轮)。设置里有「测试」按钮,一键预览权限申请与通道效果。
|
|
43
43
|
- **缓存命中率两位小数(可开关,默认关闭)**:DSH 原生统计条里的缓存命中只显示整数百分比(如「缓存命中 96%」)。开启后改写为两位小数(如「缓存命中 96.35%」),且**直接用原始 token 数计算**——缓存读取 ÷ 计费输入(未缓存输入 + 缓存读取 + 缓存写入),与原生数字同源、但不再取整;完全命中显示 100.00%,无计费输入时该组本就不显示。开关位于设置的「布局」区,关闭即恢复原样。
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
所有修改**即时生效**,无需刷新。同一份配置也可以直接手改——DSH 0.1.7 起 `settings.yaml` 已退役,配置写在 profile 的 `cordis.patch.yml`(设置页保存时写入的就是这份文件):
|
|
46
46
|
|
|
47
47
|
```yaml
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
# $DSH_HOME/profiles/<profile>/cordis.patch.yml
|
|
49
|
+
- id: ui-tweaks
|
|
50
|
+
name: dsh-ui-tweaks
|
|
51
|
+
config:
|
|
52
|
+
timelineStyle: web # 默认 native(DSH 自带回合导航轨),web 为经典网页时间线
|
|
53
|
+
themeStyle: minimal # 默认 default(DSH 原生外观),minimal 只把行内代码染成 Anthropic 红(浅色 #c15f3c / 深色 #d97757),neon-lime 为荧光海报皮肤
|
|
54
|
+
gitBarEnabled: true # 默认 false(关闭),设为 true 开启 GitBar
|
|
55
|
+
archiveManagerEnabled: true # 默认 false(关闭),设为 true 开启「归档」页面
|
|
56
|
+
initCommandEnabled: true # 默认 false(关闭),设为 true 开启 /init 斜杠命令
|
|
57
|
+
preciseCacheHitEnabled: true # 默认 false(关闭),设为 true 开启缓存命中率两位小数
|
|
58
|
+
notificationsEnabled: true # 默认 false(关闭),设为 true 开启任务提醒(事件过滤与三个通道在设置里逐项开关)
|
|
56
59
|
```
|
|
57
60
|
|
|
58
61
|
设置入口:**设置 → 界面调整**。
|
|
@@ -104,7 +107,7 @@ npx -y @deepseek-ai/dsh plugin --profile web add . # 从本目录作为 b
|
|
|
104
107
|
|
|
105
108
|
## 工作原理
|
|
106
109
|
|
|
107
|
-
- **服务端**(`src/index.ts
|
|
110
|
+
- **服务端**(`src/index.ts`):导出 `Config` 设置 schema——0.1.7 起设置表单由宿主从插件导出的 `Config` 自动派生(旧的 `settings.register()` 已移除),插件再以 `configure({ auto: false })` 抑制自动生成页、由客户端各分区接管展示;并挂载同源路由 `/_dsh/ui-tweaks/settings`——自 rc.6 起,Web 设置 RPC 只暴露固定白名单命名空间,因此自定义路由是插件拥有配置页的方式。
|
|
108
111
|
- **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。
|
|
109
112
|
- **浏览器端**(`src/client/index.tsx`):读写该路由、渲染设置页,并通过运行时 `<style>` 元素实时应用样式,覆盖稳定的 DSH 锚点(`body` 上的 markdown 代码字体 token 与主题变量、`[data-slot="conversation.chat.node"]` 内的代码块 / 表头)。
|
|
110
113
|
- **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` 字段可选,兼容宿主里尚未重载的旧服务端)。
|