deepseek-harness-background 0.2.0 → 0.3.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/README.md +11 -3
- package/README.zh.md +11 -3
- package/lib/client.js +1264 -101
- package/lib/client.js.map +1 -1
- package/lib/index.js +78 -31
- package/package.json +86 -88
package/README.md
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
# DeepSeek Harness Background
|
|
2
2
|
|
|
3
|
+
[](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin)
|
|
3
4
|
[](https://github.com/HaoyueQin/deepseek-harness-background/stargazers)
|
|
4
5
|
[](https://github.com/HaoyueQin/deepseek-harness-background/releases)
|
|
6
|
+
[](https://www.npmjs.com/package/deepseek-harness-background)
|
|
7
|
+
[](https://www.npmjs.com/package/deepseek-harness-background)
|
|
5
8
|
[](https://github.com/HaoyueQin/deepseek-harness-background/actions)
|
|
6
9
|
[](https://github.com/HaoyueQin/deepseek-harness-background/issues)
|
|
7
10
|
[](https://github.com/HaoyueQin/deepseek-harness-background/commits)
|
|
@@ -32,7 +35,8 @@ The look (fixed wallpaper layer + theme-aware scrim + translucent glass panels d
|
|
|
32
35
|
- **Five controls** — wallpaper opacity, readability scrim, panel opacity, frosted-glass blur, and wallpaper blur.
|
|
33
36
|
- **Fit modes** — `cover` (fill, crop) or `contain` (whole image).
|
|
34
37
|
- **Theme-aware scrim** — the light theme uses a white veil (lifts the art so dark text keeps contrast); the dark theme automatically switches to a black veil (dims the art so light text keeps contrast).
|
|
35
|
-
- **Frosted glass** — while a background is active, the
|
|
38
|
+
- **Frosted glass (whitelisted)** — while a background is active, only the surfaces that float as small cards over the wallpaper turn into translucent glass (specular sheen + `backdrop-filter`): the composer card and message bubbles, code blocks / terminal / diff / tool-IO cards / skill & MCP call cards and inline code, the agent task strip, the chrome buttons (new session, composer plus, scroll-to-bottom), the subagent lineage popover, and the home hero "preview" badge. Reading surfaces — dialogs, the settings UI, menus, tooltips, toasts, hover fills and every accent (the send button stays blue) — keep their **official opaque paints** so nothing legible turns washy. The blur radius is driven by the glass-blur slider; `panelOpacity` at 100% restores the official paints on the whitelisted list too.
|
|
39
|
+
- **Conversation timeline** — a DeepSeek-web-style scroll-navigation rail at the right edge of long conversations: one tick per user message on a frosted capsule; hovering expands it into a frosted panel listing every question (active one highlighted in brand blue); clicking jumps the chat to that message. **Key-point bookmarks** — star a question in the expanded panel (persisted per session): marked questions show a golden tick in the collapsed capsule and a "★ marked only" filter narrows the list. Jumps freeze the reading-position tracker until scrolling settles (no mid-jump jitter), and messages withdrawn by a rewind are dropped from the rail automatically. Collapsed and expanded share **one identical height** (no jump) and clipped edges get the official **32px fade veils**. While the background glass is on, the rail joins the **same unified glass recipe** as the composer card and bubbles (fill follows panel opacity, blur follows the glass-blur slider); without glass it keeps the official DeepSeek frosted paints. Toggle it off with the timeline switch in the row. If the third-party dsh-chat-timeline plugin is also installed, this rail steps aside instead of doubling it.
|
|
36
40
|
- **Persisted in the official settings document** (`$DSH_HOME/settings.yaml`), waits out restarts.
|
|
37
41
|
- **Clean teardown** — disabling, clearing or uninstalling restores the original background exactly; the plugin only ever removes what it wrote.
|
|
38
42
|
|
|
@@ -83,6 +87,7 @@ dsh --profile web
|
|
|
83
87
|
| 毛玻璃模糊 / Glass blur | `0..40px` `backdrop-filter` blur on the translucent surfaces (1px steps). |
|
|
84
88
|
| 壁纸模糊 / Wallpaper blur | `0..60px` blur of the wallpaper image itself (2px steps). |
|
|
85
89
|
| 填充方式 / Fit | `cover` or `contain`. |
|
|
90
|
+
| 会话时间线 / Timeline | on/off switch for the conversation timeline rail (default on). |
|
|
86
91
|
|
|
87
92
|
5. **清除背景** removes the background and restores the stock look.
|
|
88
93
|
|
|
@@ -90,8 +95,9 @@ dsh --profile web
|
|
|
90
95
|
|
|
91
96
|
- The **settings row** lives in the official General settings section (`settings.general.item` slot), next to the Appearance row. Its chrome uses only `--dsw-alias-*` design tokens (buttons / pills / segmented control / slider track match the official shell); sliders are native `input[type=range]` with 5% / 1–2px steps and release-commit.
|
|
92
97
|
- The plugin's own host routes (`/api/bg-wallpaper/*`: `settings`, `upload`, `image/<id>`) read/write the section and serve uploads with same-origin + size caps + MIME/signature checks + a path-escape fence. A custom route family is used because the api-proxy settings allowlist does not expose third-party namespaces over the settings RPC.
|
|
93
|
-
- The background is drawn as a fixed `z-index:-2` wallpaper layer plus a `z-index:-1` scrim on `body`, toggled by the `data-dsh-bg` attribute; the scrim switches white/black by `data-ds-dark-theme` in the injected stylesheet
|
|
94
|
-
-
|
|
98
|
+
- The background is drawn as a fixed `z-index:-2` wallpaper layer plus a `z-index:-1` scrim on `body`, toggled by the `data-dsh-bg` attribute; the scrim switches white/black by `data-ds-dark-theme` in the injected stylesheet. Frosted glass is whitelist-scoped: only the whitelisted surfaces get `--dsw-*` surface-token overrides, while the buttons / popovers / badge are painted by explicit `data-dsh-bg-glass`-gated rules — every other official token and reading surface stays untouched.
|
|
99
|
+
- The **timeline rail** is registered into the `conversation.input.dock` slot (per-session lifecycle) and portals to `body`. Its data comes from the runtime sessions service (loaded chat nodes, then a bounded loadOlder loop); bookmarks persist in localStorage per session. The official DeepSeek frosted paints are the no-glass fallback — under `data-dsh-bg-glass` the rail joins the plugin's unified recipe (composer fill token + the glass-blur slider chain), exactly like the chrome buttons, code cards and the composer itself.
|
|
100
|
+
- Uploads live under `$DSH_HOME/deepseek-harness-background/` (content-addressed ids). Switching to a new image or clearing the background deletes the superseded upload file, so the directory does not accumulate dead images in normal use. (An upload that is never saved into the section — e.g. the tab closes right after an upload — can leave one orphaned file behind.) Disable / uninstall leaves nothing behind.
|
|
95
101
|
|
|
96
102
|
## Development
|
|
97
103
|
|
|
@@ -117,6 +123,8 @@ deepseek-harness-background/ # the plugin repo (package name stays the
|
|
|
117
123
|
│ ├── index.ts # painter lifecycle + settings row registration
|
|
118
124
|
│ ├── backdrop.ts # fixed wallpaper layer + scrim + glass surface + preview vars
|
|
119
125
|
│ ├── background-css.ts # injected stylesheet (layers, glass, light/dark scrim, variables)
|
|
126
|
+
│ ├── timeline.tsx # conversation timeline rail (ScrollNav port on the glass system)
|
|
127
|
+
│ ├── timeline-css.ts # timeline stylesheet (dsbt- prefixed, official metrics)
|
|
120
128
|
│ ├── SettingsRow.tsx # the General-settings row (preview surface + stepped sliders)
|
|
121
129
|
│ ├── SettingsRow.module.css # row styles (official tokens)
|
|
122
130
|
│ ├── settings-client.ts# fetch transport (read/write/upload)
|
package/README.zh.md
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
# DeepSeek Harness Background
|
|
2
2
|
|
|
3
|
+
[](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin)
|
|
3
4
|
[](https://github.com/HaoyueQin/deepseek-harness-background/stargazers)
|
|
4
5
|
[](https://github.com/HaoyueQin/deepseek-harness-background/releases)
|
|
6
|
+
[](https://www.npmjs.com/package/deepseek-harness-background)
|
|
7
|
+
[](https://www.npmjs.com/package/deepseek-harness-background)
|
|
5
8
|
[](https://github.com/HaoyueQin/deepseek-harness-background/actions)
|
|
6
9
|
[](https://github.com/HaoyueQin/deepseek-harness-background/issues)
|
|
7
10
|
[](https://github.com/HaoyueQin/deepseek-harness-background/commits)
|
|
@@ -32,7 +35,8 @@
|
|
|
32
35
|
- **五个调节项** —— 壁纸不透明度、可读性遮罩、面板不透明度、毛玻璃模糊、壁纸模糊。
|
|
33
36
|
- **填充方式** —— `cover`(铺满、裁剪)或 `contain`(完整、留白)。
|
|
34
37
|
- **主题自适应遮罩** —— 浅色主题用白色纱帘(把图片提亮保持深色文字对比度),深色主题自动换成黑色纱帘(压暗图片保持浅色文字对比度)。
|
|
35
|
-
-
|
|
38
|
+
- **毛玻璃(白名单制)** —— 启用背景后,只有以小卡片/小按钮形态悬浮在壁纸上的表面才会变成半透明玻璃(顶部白色高光渐变 + `backdrop-filter`):输入框卡片与消息气泡、代码块 / 终端 / diff / 工具 IO 卡 / 技能与 MCP 调用卡与行内代码、agent 任务条、三个铬件按钮(新会话、输入框加号、回到底部)、标题栏展开的子代理列表面板,以及首页右上角的「预览版」徽标。阅读型表面——对话框、设置界面、菜单、Tooltip、Toast、悬停填充与所有强调色(发送键保持品牌蓝)——一律保留**官方不透明样式**,保证可读性。模糊半径由「毛玻璃模糊」滑块驱动;「面板不透明度」调至 100% 时白名单表面也恢复官方原样。
|
|
39
|
+
- **会话时间线** —— 长会话右缘的 DeepSeek 官网风格滚动导航轨:毛玻璃胶囊上每条用户消息一枚指示刻度;悬停展开为列出全部提问的毛玻璃面板(当前阅读位置品牌蓝高亮);点击跳转到对应消息。**重点书签**——展开面板内点击 ★ 标记重点提问(按会话持久化):已标记项在折叠胶囊上显示金色加宽刻度,「★ 只看标记」一键筛选;跳转期间冻结高亮跟踪(消除中途乱跳),被回退撤回的消息自动从轨道剔除。折叠态与展开态**共用同一高度**(零跳变),裁切边缘带官方同款 **32px 淡化渐变**。开启背景毛玻璃后,导航轨与输入框、消息气泡共用**同一套玻璃配方**(透明度随「面板不透明度」、模糊随「毛玻璃模糊」滑块调节,不比其他表面更重);未开启背景时保持 DeepSeek 官网同款毛玻璃配色。可在设置行内用「会话时间线」开关关闭;若同时安装了第三方 dsh-chat-timeline 插件,本轨道会自动让位避免重叠。
|
|
36
40
|
- **持久化到官方设置文档** —— 存于 `$DSH_HOME/settings.yaml`,跨重启保留。
|
|
37
41
|
- **干净卸载** —— 关闭、清除或卸载后完整恢复原背景;插件只移除自己写过的内容。
|
|
38
42
|
|
|
@@ -83,15 +87,17 @@ dsh --profile web
|
|
|
83
87
|
| 毛玻璃模糊 | `0..40px` 半透明表面上的 `backdrop-filter` 模糊(1px 步进)。 |
|
|
84
88
|
| 壁纸模糊 | `0..60px` 壁纸图片本身的模糊(2px 步进)。 |
|
|
85
89
|
| 填充方式 | `cover`(铺满)或 `contain`(完整)。 |
|
|
90
|
+
| 会话时间线 | 会话右侧时间线导航轨的开关(默认开启)。 |
|
|
86
91
|
|
|
87
92
|
5. 点 **清除背景** 移除背景,恢复默认外观。
|
|
88
93
|
|
|
89
94
|
## 原理
|
|
90
95
|
|
|
91
96
|
- **设置行**位于官方「通用」设置分区的 `settings.general.item` 槽中,紧挨「外观」行。控件样式全部使用 `--dsw-alias-*` 设计 token(按钮 / 胶囊 / 分段控件 / 滑块轨道与官方 chrome 一致),滑块为原生 `input[type=range]` 的 5% / 1–2px 步进 + 松手提交。
|
|
97
|
+
- **会话时间线**注册进 `conversation.input.dock` 槽位(绑定每会话生命周期),portal 渲染到 `body`。数据来自运行时 sessions 服务(已加载聊天节点 + 有界 loadOlder 补全);书签存于 localStorage(按会话隔离)。官网同款毛玻璃配色仅作为未开背景时的兜底:开启玻璃后(`data-dsh-bg-glass`)轨道并入插件统一配方——与输入框一致的 token 填充 + 由「毛玻璃模糊」滑块驱动的同一滤镜链。
|
|
92
98
|
- 插件自有的 host 路由(`/api/bg-wallpaper/*`:`settings`、`upload`、`image/<id>`)负责读写设置与提供上传图片,带同源校验、大小上限、MIME/签名校验与路径穿越防护。使用自定义路由族,是因为 api-proxy 的 settings 白名单不向第三方命名空间开放 settings RPC。
|
|
93
|
-
- 背景以 `body` 上一张固定的 `z-index:-2` 壁纸层 + `z-index:-1` 遮罩绘制,由 `data-dsh-bg` 属性开关;遮罩在注入样式表里按 `data-ds-dark-theme`
|
|
94
|
-
- 上传文件存放在 `$DSH_HOME/deepseek-harness-background/`(内容寻址 id
|
|
99
|
+
- 背景以 `body` 上一张固定的 `z-index:-2` 壁纸层 + `z-index:-1` 遮罩绘制,由 `data-dsh-bg` 属性开关;遮罩在注入样式表里按 `data-ds-dark-theme` 切换白/黑纱帘。毛玻璃为白名单制:仅对输入/气泡/代码/任务条等白名单表面覆盖 `--dsw-*` surface token,其余表面(按钮、弹出面板、徽标)通过 `data-dsh-bg-glass` 门控的显式规则着色,全部官方 token 与阅读型界面保持原样。
|
|
100
|
+
- 上传文件存放在 `$DSH_HOME/deepseek-harness-background/`(内容寻址 id)。切换新图片或清除背景时,被替换的旧上传文件会被自动回收,正常使用下目录不会堆积死图片。(例外:上传后从未保存进设置——例如上传后立刻关闭标签页——会留下一个孤儿文件。)关闭 / 卸载后不留残留。
|
|
95
101
|
|
|
96
102
|
## 开发
|
|
97
103
|
|
|
@@ -117,6 +123,8 @@ deepseek-harness-background/ # 插件仓库(包名保留 npm 风格 i
|
|
|
117
123
|
│ ├── index.ts # painter 生命周期 + 设置行注册
|
|
118
124
|
│ ├── backdrop.ts # 固定壁纸层 + 遮罩 + 玻璃表面 + 预览变量
|
|
119
125
|
│ ├── background-css.ts # 注入的样式表(层、玻璃、明暗遮罩、变量)
|
|
126
|
+
│ ├── timeline.tsx # 会话时间线导航轨(官方 ScrollNav 结构 × 本插件玻璃体系)
|
|
127
|
+
│ ├── timeline-css.ts # 时间线样式(dsbt- 前缀,官方度量)
|
|
120
128
|
│ ├── SettingsRow.tsx # 通用设置中的设置行(预览卡 + 阻尼滑块)
|
|
121
129
|
│ ├── SettingsRow.module.css # 设置行样式(官方 token)
|
|
122
130
|
│ ├── settings-client.ts# fetch 传输层(读/写/上传)
|