deepseek-harness-background 0.4.0 → 0.4.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 CHANGED
@@ -37,7 +37,7 @@ The look (fixed wallpaper layer + theme-aware scrim + translucent glass panels d
37
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).
38
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
39
  - **Third-party glass registry** — any plugin can register its own panels into the same frosted-glass system through the published bridge (`window.__DSH_BACKGROUND_GLASS__` global + the `dsh-background-glass:ready` event): *token* mode adds the missing sheen + blur chain when the panel already fills with an overridden `--dsw-*` token, *fill* mode takes the fill over as well; every rule sits under the `data-dsh-bg-glass` gate so it toggles with the glass automatically. Consumers take zero dependencies and degrade gracefully when this plugin is absent; the whole bridge tears down with it. See [docs/GLASS_API.md](docs/GLASS_API.md).
40
- - **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.
40
+ - **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 with a **smooth glide** (ease-in-out, distance-paced; the bottom-follow state is detached from the official 25px follow zone one frame before the slide, so streaming growth / turn-end re-renders cannot yank it back to the floor; wheel, touch or keyboard scrolling takes over instantly mid-glide, and `prefers-reduced-motion` places directly). **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 (the target parser accepts `seq 42` / `#42` / english-chinese verb forms plus structured fields, and recognizes third-party `data-dsh-rewind-hidden` node markers). 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.
41
41
  - **Persisted in the official settings document** (`$DSH_HOME/settings.yaml`), waits out restarts.
42
42
  - **Clean teardown** — disabling, clearing or uninstalling restores the original background exactly; the plugin only ever removes what it wrote.
43
43
 
@@ -98,7 +98,7 @@ dsh --profile web
98
98
  - 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.
99
99
  - 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.
100
100
  - 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.
101
- - The **third-party glass registry** (`src/client/glass-registry.ts`) publishes its bridge on client apply — before any repaint can race it: `register({ plugin, selectors, mode })` is idempotent per (plugin, mode, selector) triple and synthesizes explicit `body[data-dsh-bg-glass]`-gated recipe rules into a dedicated `<style data-plugin-css>` tag; selectors are structurally validated first (no `{ } ; @ < >`, no backslashes, 500-char cap) with per-selector warn-and-drop that never blocks valid siblings; disposing the client fiber retracts the whole bridge (stylesheet, entries, window key). Contract docs in `docs/GLASS_API.md` / `GLASS_API.zh.md`; behavior locked by `tests/glass-registry.spec.ts`.
101
+ - The **third-party glass registry** (`src/client/glass-registry.ts`) publishes its bridge on client apply — before any repaint can race it: `register({ plugin, selectors, mode })` is idempotent per (plugin, mode, selector) triple and synthesizes explicit `body[data-dsh-bg-glass]`-gated recipe rules into a dedicated `<style data-plugin-css>` tag; selectors are structurally validated first (no `{ } ; @ < > ,`, no backslashes, 500-char cap) with per-selector warn-and-drop that never blocks valid siblings; disposing the client fiber retracts the whole bridge (stylesheet, entries, window key). Contract docs in `docs/GLASS_API.md` / `GLASS_API.zh.md`; behavior locked by `tests/glass-registry.spec.ts`.
102
102
  - 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.
103
103
 
104
104
  ## Development
package/README.zh.md CHANGED
@@ -37,7 +37,7 @@
37
37
  - **主题自适应遮罩** —— 浅色主题用白色纱帘(把图片提亮保持深色文字对比度),深色主题自动换成黑色纱帘(压暗图片保持浅色文字对比度)。
38
38
  - **毛玻璃(白名单制)** —— 启用背景后,只有以小卡片/小按钮形态悬浮在壁纸上的表面才会变成半透明玻璃(顶部白色高光渐变 + `backdrop-filter`):输入框卡片与消息气泡、代码块 / 终端 / diff / 工具 IO 卡 / 技能与 MCP 调用卡与行内代码、agent 任务条及其接管面板(审批 / 提问 / 计划评审)、三个铬件按钮(新会话、输入框加号、回到底部)、「加载更早」历史按钮、标题栏展开的子代理列表面板、侧栏构建徽标,以及首页右上角的「预览版」徽标——每块玻璃面都带完整配方(填充 + 高光 + 模糊),绝无"只透明不磨砂"的残缺面。阅读型表面——对话框、设置界面、菜单、Tooltip、Toast、悬停填充与所有强调色(发送键保持品牌蓝)——一律保留**官方不透明样式**,保证可读性。模糊半径由「毛玻璃模糊」滑块驱动;「面板不透明度」调至 100% 时白名单表面也恢复官方原样。
39
39
  - **第三方毛玻璃接口** —— 内置毛玻璃注册表(`window.__DSH_BACKGROUND_GLASS__` 全局 + `dsh-background-glass:ready` 事件):任何插件都可把自家面板的选择器注册进来,套上与内置表面完全一致的配方——`token` 模式为已使用被覆盖 `--dsw-*` 填充的面板补齐高光+模糊链,`fill` 模式连填充一并接管;规则统一挂在 `data-dsh-bg-glass` 门控下随玻璃自动开关。消费方零依赖、未安装本插件时优雅降级,本插件卸载时整桥拆除。详见 [docs/GLASS_API.zh.md](docs/GLASS_API.zh.md)。
40
- - **会话时间线** —— 长会话右缘的 DeepSeek 官网风格滚动导航轨:毛玻璃胶囊上每条用户消息一枚指示刻度;悬停展开为列出全部提问的毛玻璃面板(当前阅读位置品牌蓝高亮);点击跳转到对应消息。**重点书签**——展开面板内点击 ★ 标记重点提问(按会话持久化):已标记项在折叠胶囊上显示金色加宽刻度,「★ 只看标记」一键筛选;跳转期间冻结高亮跟踪(消除中途乱跳),被回退撤回的消息自动从轨道剔除。折叠态与展开态**共用同一高度**(零跳变);折叠刻度**贴底锚定**——最新提问的横杠始终贴住胶囊底缘(与官网一致),且由全量会话历史驱动、不受对话区分页加载进度影响;展开面板的裁切边缘带官方同款 **32px 淡化渐变**。开启背景毛玻璃后,导航轨与输入框、消息气泡共用**同一套玻璃配方**(透明度随「面板不透明度」、模糊随「毛玻璃模糊」滑块调节,不比其他表面更重);未开启背景时保持 DeepSeek 官网同款毛玻璃配色。可在设置行内用「会话时间线」开关关闭;若同时安装了第三方 dsh-chat-timeline 插件,本轨道会自动让位避免重叠。
40
+ - **会话时间线** —— 长会话右缘的 DeepSeek 官网风格滚动导航轨:毛玻璃胶囊上每条用户消息一枚指示刻度;悬停展开为列出全部提问的毛玻璃面板(当前阅读位置品牌蓝高亮);点击跳转到对应消息(**平滑滑动**:ease-in-out 按距离调速;跳转前先把底部跟随状态移出官方 25px 跟随区,流式增长 / 回合结束不会把动画拽回底部;动画期间滚轮、触控或键盘滚动即时接管,`prefers-reduced-motion` 下直接定位)。**重点书签**——展开面板内点击 ★ 标记重点提问(按会话持久化):已标记项在折叠胶囊上显示金色加宽刻度,「★ 只看标记」一键筛选;跳转期间冻结高亮跟踪(消除中途乱跳),被回退撤回的消息自动从轨道剔除(目标解析兼容 `seq 42` / `#42` / 中英文动词文案与结构化字段,并识别他人的 `data-dsh-rewind-hidden` 节点标记)。折叠态与展开态**共用同一高度**(零跳变);折叠刻度**贴底锚定**——最新提问的横杠始终贴住胶囊底缘(与官网一致),且由全量会话历史驱动、不受对话区分页加载进度影响;展开面板的裁切边缘带官方同款 **32px 淡化渐变**。开启背景毛玻璃后,导航轨与输入框、消息气泡共用**同一套玻璃配方**(透明度随「面板不透明度」、模糊随「毛玻璃模糊」滑块调节,不比其他表面更重);未开启背景时保持 DeepSeek 官网同款毛玻璃配色。可在设置行内用「会话时间线」开关关闭;若同时安装了第三方 dsh-chat-timeline 插件,本轨道会自动让位避免重叠。
41
41
  - **持久化到官方设置文档** —— 存于 `$DSH_HOME/settings.yaml`,跨重启保留。
42
42
  - **干净卸载** —— 关闭、清除或卸载后完整恢复原背景;插件只移除自己写过的内容。
43
43
 
@@ -98,7 +98,7 @@ dsh --profile web
98
98
  - **会话时间线**注册进 `conversation.input.dock` 槽位(绑定每会话生命周期),portal 渲染到 `body`。数据按速度优先:host 侧会话投影 `bgTimeline`(见 `src/projection.ts`,完整枚举整个会话的全部用户消息——包括对话区尚未分页加载的早期内容),已加载聊天节点窗口作为兜底;轨道从不驱动对话区的懒加载策略(点击旧消息跳转时才按需补页,与点「加载更早」一致)。折叠态刻度列贴底锚定——最新一条提问的横杠始终贴住胶囊底缘、更早的向顶部裁掉,与官网 ScrollNav 一致;悬停展开则改为跟随阅读位置。书签存于 localStorage(按会话隔离)。官网同款毛玻璃配色仅作为未开背景时的兜底:开启玻璃后(`data-dsh-bg-glass`)轨道并入插件统一配方——与输入框一致的 token 填充 + 由「毛玻璃模糊」滑块驱动的同一滤镜链。
99
99
  - 插件自有的 host 路由(`/api/bg-wallpaper/*`:`settings`、`upload`、`image/<id>`)负责读写设置与提供上传图片,带同源校验、大小上限、MIME/签名校验与路径穿越防护。使用自定义路由族,是因为 api-proxy 的 settings 白名单不向第三方命名空间开放 settings RPC。
100
100
  - 背景以 `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)保持原样。
101
- - **第三方玻璃注册表**(`src/client/glass-registry.ts`):客户端 apply 时即在 `window.__DSH_BACKGROUND_GLASS__` 发布注册 api 并派发 `dsh-background-glass:ready`;`register({ plugin, selectors, mode })` 按 `(plugin, mode, selector)` 三元组幂等登记,把 `body[data-dsh-bg-glass]` 门控的显式配方规则合成进独立的 `<style data-plugin-css>` 标签;选择器先做结构性校验(禁 `{} ; @ < >` 与反斜杠、500 字符上限),违规条目逐条警告并丢弃、不影响兄弟条目;fiber dispose 时整桥拆除(样式表、条目、window 键全清)。契约文档见 `docs/GLASS_API.md` / `GLASS_API.zh.md`,行为由 `tests/glass-registry.spec.ts` 锁定。
101
+ - **第三方玻璃注册表**(`src/client/glass-registry.ts`):客户端 apply 时即在 `window.__DSH_BACKGROUND_GLASS__` 发布注册 api 并派发 `dsh-background-glass:ready`;`register({ plugin, selectors, mode })` 按 `(plugin, mode, selector)` 三元组幂等登记,把 `body[data-dsh-bg-glass]` 门控的显式配方规则合成进独立的 `<style data-plugin-css>` 标签;选择器先做结构性校验(禁 `{} ; @ < > ,` 与反斜杠、500 字符上限),违规条目逐条警告并丢弃、不影响兄弟条目;fiber dispose 时整桥拆除(样式表、条目、window 键全清)。契约文档见 `docs/GLASS_API.md` / `GLASS_API.zh.md`,行为由 `tests/glass-registry.spec.ts` 锁定。
102
102
  - 上传文件存放在 `$DSH_HOME/deepseek-harness-background/`(内容寻址 id)。切换新图片或清除背景时,被替换的旧上传文件会被自动回收,正常使用下目录不会堆积死图片。(例外:上传后从未保存进设置——例如上传后立刻关闭标签页——会留下一个孤儿文件。)关闭 / 卸载后不留残留。
103
103
 
104
104
  ## 开发