deepseek-harness-background 0.2.1 → 0.3.2
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 +9 -2
- package/README.zh.md +9 -2
- package/lib/client.js +1423 -77
- package/lib/client.js.map +1 -1
- package/lib/index.js +119 -6
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
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)
|
|
5
6
|
[](https://www.npmjs.com/package/deepseek-harness-background)
|
|
@@ -34,7 +35,8 @@ The look (fixed wallpaper layer + theme-aware scrim + translucent glass panels d
|
|
|
34
35
|
- **Five controls** — wallpaper opacity, readability scrim, panel opacity, frosted-glass blur, and wallpaper blur.
|
|
35
36
|
- **Fit modes** — `cover` (fill, crop) or `contain` (whole image).
|
|
36
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).
|
|
37
|
-
- **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 strips and their takeover panels (approval / question / plan review), the chrome buttons (new session, composer plus, scroll-to-bottom), the load-earlier history button, the subagent lineage popover, the sidebar build badge, and the home hero "preview" badge — every glassed surface carries the full recipe (fill + sheen + blur), never translucency without frost. 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); idle ticks are **bottom-pinned** — the newest question's tick hugs the capsule's bottom edge like the official nav, fed by the full-session history regardless of how much of the conversation the chat view has paged in — and the expanded panel's 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.
|
|
38
40
|
- **Persisted in the official settings document** (`$DSH_HOME/settings.yaml`), waits out restarts.
|
|
39
41
|
- **Clean teardown** — disabling, clearing or uninstalling restores the original background exactly; the plugin only ever removes what it wrote.
|
|
40
42
|
|
|
@@ -85,6 +87,7 @@ dsh --profile web
|
|
|
85
87
|
| 毛玻璃模糊 / Glass blur | `0..40px` `backdrop-filter` blur on the translucent surfaces (1px steps). |
|
|
86
88
|
| 壁纸模糊 / Wallpaper blur | `0..60px` blur of the wallpaper image itself (2px steps). |
|
|
87
89
|
| 填充方式 / Fit | `cover` or `contain`. |
|
|
90
|
+
| 会话时间线 / Timeline | on/off switch for the conversation timeline rail (default on). |
|
|
88
91
|
|
|
89
92
|
5. **清除背景** removes the background and restores the stock look.
|
|
90
93
|
|
|
@@ -92,7 +95,8 @@ dsh --profile web
|
|
|
92
95
|
|
|
93
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.
|
|
94
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.
|
|
95
|
-
- 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
|
|
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 everything else is painted by explicit `data-dsh-bg-glass`-gated rules carrying the FULL recipe (fill + sheen + blur chain): the three chrome buttons, the load-earlier history button, the composer dock family (agent task strips TodoPanel / GoalBar / QueueDock and their takeover panels — approval, question, plan review — whose tokens turn translucent and need the blur added), the subagent lineage popover, the home hero preview badge and the sidebar build badge — every other official token and reading surface (menus, dialogs, tooltips, toasts) stays untouched.
|
|
99
|
+
- The **timeline rail** is registered into the `conversation.input.dock` slot (per-session lifecycle) and portals to `body`. Its data comes, fastest first, from a host-side session projection (`bgTimeline`, registered in `src/projection.ts`) that enumerates every user message of the whole session — including turns the conversation has not paged in yet — with the loaded chat-node window as fallback. The conversation's own lazy loading is never driven by the rail (jumping to an old message pages history on demand, exactly like clicking "load earlier"); bookmarks persist in localStorage per session. Idle (collapsed), the tick stack is pinned to the capsule's bottom edge — the newest question's tick always hugs the bottom, older ones clip at the top — matching the official ScrollNav; hovering expands and follows the reading position instead. 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.
|
|
96
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.
|
|
97
101
|
|
|
98
102
|
## Development
|
|
@@ -114,11 +118,14 @@ deepseek-harness-background/ # the plugin repo (package name stays the
|
|
|
114
118
|
│ ├── routes.ts # /api/bg-wallpaper/{settings,upload,image/<id>}
|
|
115
119
|
│ ├── schema.ts # host-side schemastery schema
|
|
116
120
|
│ ├── settings.ts # constants/types shared with the client
|
|
121
|
+
│ ├── projection.ts # bgTimeline session projection (full user-message index for the rail)
|
|
117
122
|
│ ├── harness-home.ts # $DSH_HOME / ~/.dsh resolution
|
|
118
123
|
│ └── client/
|
|
119
124
|
│ ├── index.ts # painter lifecycle + settings row registration
|
|
120
125
|
│ ├── backdrop.ts # fixed wallpaper layer + scrim + glass surface + preview vars
|
|
121
126
|
│ ├── background-css.ts # injected stylesheet (layers, glass, light/dark scrim, variables)
|
|
127
|
+
│ ├── timeline.tsx # conversation timeline rail (ScrollNav port on the glass system)
|
|
128
|
+
│ ├── timeline-css.ts # timeline stylesheet (dsbt- prefixed, official metrics)
|
|
122
129
|
│ ├── SettingsRow.tsx # the General-settings row (preview surface + stepped sliders)
|
|
123
130
|
│ ├── SettingsRow.module.css # row styles (official tokens)
|
|
124
131
|
│ ├── settings-client.ts# fetch transport (read/write/upload)
|
package/README.zh.md
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
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)
|
|
5
6
|
[](https://www.npmjs.com/package/deepseek-harness-background)
|
|
@@ -34,7 +35,8 @@
|
|
|
34
35
|
- **五个调节项** —— 壁纸不透明度、可读性遮罩、面板不透明度、毛玻璃模糊、壁纸模糊。
|
|
35
36
|
- **填充方式** —— `cover`(铺满、裁剪)或 `contain`(完整、留白)。
|
|
36
37
|
- **主题自适应遮罩** —— 浅色主题用白色纱帘(把图片提亮保持深色文字对比度),深色主题自动换成黑色纱帘(压暗图片保持浅色文字对比度)。
|
|
37
|
-
-
|
|
38
|
+
- **毛玻璃(白名单制)** —— 启用背景后,只有以小卡片/小按钮形态悬浮在壁纸上的表面才会变成半透明玻璃(顶部白色高光渐变 + `backdrop-filter`):输入框卡片与消息气泡、代码块 / 终端 / diff / 工具 IO 卡 / 技能与 MCP 调用卡与行内代码、agent 任务条及其接管面板(审批 / 提问 / 计划评审)、三个铬件按钮(新会话、输入框加号、回到底部)、「加载更早」历史按钮、标题栏展开的子代理列表面板、侧栏构建徽标,以及首页右上角的「预览版」徽标——每块玻璃面都带完整配方(填充 + 高光 + 模糊),绝无"只透明不磨砂"的残缺面。阅读型表面——对话框、设置界面、菜单、Tooltip、Toast、悬停填充与所有强调色(发送键保持品牌蓝)——一律保留**官方不透明样式**,保证可读性。模糊半径由「毛玻璃模糊」滑块驱动;「面板不透明度」调至 100% 时白名单表面也恢复官方原样。
|
|
39
|
+
- **会话时间线** —— 长会话右缘的 DeepSeek 官网风格滚动导航轨:毛玻璃胶囊上每条用户消息一枚指示刻度;悬停展开为列出全部提问的毛玻璃面板(当前阅读位置品牌蓝高亮);点击跳转到对应消息。**重点书签**——展开面板内点击 ★ 标记重点提问(按会话持久化):已标记项在折叠胶囊上显示金色加宽刻度,「★ 只看标记」一键筛选;跳转期间冻结高亮跟踪(消除中途乱跳),被回退撤回的消息自动从轨道剔除。折叠态与展开态**共用同一高度**(零跳变);折叠刻度**贴底锚定**——最新提问的横杠始终贴住胶囊底缘(与官网一致),且由全量会话历史驱动、不受对话区分页加载进度影响;展开面板的裁切边缘带官方同款 **32px 淡化渐变**。开启背景毛玻璃后,导航轨与输入框、消息气泡共用**同一套玻璃配方**(透明度随「面板不透明度」、模糊随「毛玻璃模糊」滑块调节,不比其他表面更重);未开启背景时保持 DeepSeek 官网同款毛玻璃配色。可在设置行内用「会话时间线」开关关闭;若同时安装了第三方 dsh-chat-timeline 插件,本轨道会自动让位避免重叠。
|
|
38
40
|
- **持久化到官方设置文档** —— 存于 `$DSH_HOME/settings.yaml`,跨重启保留。
|
|
39
41
|
- **干净卸载** —— 关闭、清除或卸载后完整恢复原背景;插件只移除自己写过的内容。
|
|
40
42
|
|
|
@@ -85,14 +87,16 @@ dsh --profile web
|
|
|
85
87
|
| 毛玻璃模糊 | `0..40px` 半透明表面上的 `backdrop-filter` 模糊(1px 步进)。 |
|
|
86
88
|
| 壁纸模糊 | `0..60px` 壁纸图片本身的模糊(2px 步进)。 |
|
|
87
89
|
| 填充方式 | `cover`(铺满)或 `contain`(完整)。 |
|
|
90
|
+
| 会话时间线 | 会话右侧时间线导航轨的开关(默认开启)。 |
|
|
88
91
|
|
|
89
92
|
5. 点 **清除背景** 移除背景,恢复默认外观。
|
|
90
93
|
|
|
91
94
|
## 原理
|
|
92
95
|
|
|
93
96
|
- **设置行**位于官方「通用」设置分区的 `settings.general.item` 槽中,紧挨「外观」行。控件样式全部使用 `--dsw-alias-*` 设计 token(按钮 / 胶囊 / 分段控件 / 滑块轨道与官方 chrome 一致),滑块为原生 `input[type=range]` 的 5% / 1–2px 步进 + 松手提交。
|
|
97
|
+
- **会话时间线**注册进 `conversation.input.dock` 槽位(绑定每会话生命周期),portal 渲染到 `body`。数据按速度优先:host 侧会话投影 `bgTimeline`(见 `src/projection.ts`,完整枚举整个会话的全部用户消息——包括对话区尚未分页加载的早期内容),已加载聊天节点窗口作为兜底;轨道从不驱动对话区的懒加载策略(点击旧消息跳转时才按需补页,与点「加载更早」一致)。折叠态刻度列贴底锚定——最新一条提问的横杠始终贴住胶囊底缘、更早的向顶部裁掉,与官网 ScrollNav 一致;悬停展开则改为跟随阅读位置。书签存于 localStorage(按会话隔离)。官网同款毛玻璃配色仅作为未开背景时的兜底:开启玻璃后(`data-dsh-bg-glass`)轨道并入插件统一配方——与输入框一致的 token 填充 + 由「毛玻璃模糊」滑块驱动的同一滤镜链。
|
|
94
98
|
- 插件自有的 host 路由(`/api/bg-wallpaper/*`:`settings`、`upload`、`image/<id>`)负责读写设置与提供上传图片,带同源校验、大小上限、MIME/签名校验与路径穿越防护。使用自定义路由族,是因为 api-proxy 的 settings 白名单不向第三方命名空间开放 settings RPC。
|
|
95
|
-
- 背景以 `body` 上一张固定的 `z-index:-2` 壁纸层 + `z-index:-1` 遮罩绘制,由 `data-dsh-bg` 属性开关;遮罩在注入样式表里按 `data-ds-dark-theme`
|
|
99
|
+
- 背景以 `body` 上一张固定的 `z-index:-2` 壁纸层 + `z-index:-1` 遮罩绘制,由 `data-dsh-bg` 属性开关;遮罩在注入样式表里按 `data-ds-dark-theme` 切换白/黑纱帘。毛玻璃为白名单制:仅对输入/气泡/代码/任务条等白名单表面覆盖 `--dsw-*` surface token,其余表面通过 `data-dsh-bg-glass` 门控的显式规则补齐整套配方(填充 + 高光 + 模糊滤镜链):三个 chrome 按钮、「加载更早」历史按钮、composer 坞列家族——agent 任务条(TodoPanel / GoalBar / QueueDock)与接管面板(审批 / 提问 / 计划评审,token 变半透明后由这里补上模糊)、子代理列表弹出层、首页「预览版」徽标、侧栏构建徽章——全部官方 token 与阅读型界面(菜单/对话框/tooltip/toast)保持原样。
|
|
96
100
|
- 上传文件存放在 `$DSH_HOME/deepseek-harness-background/`(内容寻址 id)。切换新图片或清除背景时,被替换的旧上传文件会被自动回收,正常使用下目录不会堆积死图片。(例外:上传后从未保存进设置——例如上传后立刻关闭标签页——会留下一个孤儿文件。)关闭 / 卸载后不留残留。
|
|
97
101
|
|
|
98
102
|
## 开发
|
|
@@ -114,11 +118,14 @@ deepseek-harness-background/ # 插件仓库(包名保留 npm 风格 i
|
|
|
114
118
|
│ ├── routes.ts # /api/bg-wallpaper/{settings,upload,image/<id>}
|
|
115
119
|
│ ├── schema.ts # host 侧 schemastery schema
|
|
116
120
|
│ ├── settings.ts # 两端共享的常量/类型
|
|
121
|
+
│ ├── projection.ts # bgTimeline 会话投影(时间线的全量用户消息索引)
|
|
117
122
|
│ ├── harness-home.ts # $DSH_HOME / ~/.dsh 解析
|
|
118
123
|
│ └── client/
|
|
119
124
|
│ ├── index.ts # painter 生命周期 + 设置行注册
|
|
120
125
|
│ ├── backdrop.ts # 固定壁纸层 + 遮罩 + 玻璃表面 + 预览变量
|
|
121
126
|
│ ├── background-css.ts # 注入的样式表(层、玻璃、明暗遮罩、变量)
|
|
127
|
+
│ ├── timeline.tsx # 会话时间线导航轨(官方 ScrollNav 结构 × 本插件玻璃体系)
|
|
128
|
+
│ ├── timeline-css.ts # 时间线样式(dsbt- 前缀,官方度量)
|
|
122
129
|
│ ├── SettingsRow.tsx # 通用设置中的设置行(预览卡 + 阻尼滑块)
|
|
123
130
|
│ ├── SettingsRow.module.css # 设置行样式(官方 token)
|
|
124
131
|
│ ├── settings-client.ts# fetch 传输层(读/写/上传)
|