dsh-ui-tweaks 0.9.0 → 0.10.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/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
@@ -37,6 +37,11 @@ A [DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harness/) (DSH)
37
37
  - **MCP manager (toggleable, off by default)** — an **MCP** page in the Settings dialog listing every configured MCP server (`@deepseek-ai/dsh-mcp-client` loader entries) with its live status, command/url, env vars and registered tools, plus full management: **Add / Edit** (a structured form — instance id, name, stdio or HTTP type, timeout ms, command, args, env — OR raw YAML, both validated), **Enable / Disable / Delete**, and **Restart** (runtime-only). Changes persist to the profile's `cordis.patch.yml` and DSH's built-in patch watcher hot-reloads just that server.
38
38
  - **`/init` slash command (toggleable, off by default)** — type `/init` in the composer (the slash menu shows "Analyze this project and generate an AGENTS.md"), pick a prompt language from the popup (**Chinese / English**), and a complete AGENTS.md bootstrap prompt is submitted into the current session: the agent explores the project on its own (README, manifests, build scripts, key directories), then writes or improves a root `AGENTS.md` addressed to future AI coding agents (overview, common commands, conventions, directory guide, gotchas; existing files are improved in place). Pure client-side contribution; enable it in the UI Tweaks settings section.
39
39
  - **Whale indicator (toggleable, off by default)** — the brand whale perched on the composer card's **top-right corner** over drifting blue waves (the Claude Desktop crab spot). It stays in its original colour the whole time: idle it floats still (hover or click it to make it swim — an easter egg); while the model works it swims (bob + sway) until the turn finishes. Working state = the session's `running` flag plus the input machine's claimed/submitting phases, so the swim starts the moment you press Enter. Pure CSS animation on DSH theme tokens; honors `prefers-reduced-motion`.
40
+ - **Task alerts (toggleable, off by default)** — call you back while the tab sits in the background. Watches **all sessions** (background included) for two event kinds: **finish** (the `running` flag drops, or the host's green `completed` reminder rises) and **interaction** (the session starts waiting for your approval / plan review / answer — the same `pendingInteraction` source as the sidebar amber dot). Three independent channels:
41
+ - **Tab title flash** — blinks an unread counter `(2) 🔔 …` into the tab title until you come back, then restores it;
42
+ - **System notifications** (Web Notifications API) — desktop-level; **click one to jump straight to that session**; permission is requested from the settings toggle's click gesture; the OS bark and the chime are mutually exclusive so they never double-ring;
43
+ - **Chime** — a two-note WebAudio motif synthesized in-process (rising = done, falling = needs you); no audio assets.
44
+ - "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
45
 
41
46
  All changes apply **live** — no reload needed. The same values can be hand-edited in the settings document:
42
47
 
@@ -50,6 +55,7 @@ ui-tweaks:
50
55
  archiveManagerEnabled: true # defaults to false (off); set true to show the Archive page
51
56
  initCommandEnabled: true # defaults to false (off); set true to register the /init slash command
52
57
  whaleIndicatorEnabled: true # defaults to false (off); set true to enable the whale indicator
58
+ notificationsEnabled: true # defaults to false (off); set true to enable task alerts (event filters & channels are per-item toggles in Settings)
53
59
  ```
54
60
 
55
61
  Settings entry: **Settings → UI Tweaks**.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # dsh-ui-tweaks
2
2
 
3
- [DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harness/)(DSH)Web UI 插件:在设置面板中实时调整对话界面——字体大小、表格样式、对话框宽度、可开关的对话时间线、**GitBar**(输入框工具行内的 git 状态胶囊:分支在权限旁、差异在模型前),以及可开关的**归档管理**(设置中的「归档」页面:查看、恢复或彻底删除已归档会话)。
3
+ [DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harness/)(DSH)Web UI 插件:在设置面板中实时调整对话界面——字体大小、表格样式、对话框宽度、可开关的对话时间线、**GitBar**(输入框工具行内的 git 状态胶囊:分支在权限旁、差异在模型前),可开关的**归档管理**(设置中的「归档」页面:查看、恢复或彻底删除已归档会话),以及可开关的**任务提醒**(会话完成或需要交互时,通过标签页标题闪烁 / 系统通知 / 提示音把你唤回来)。
4
4
 
5
5
  ## 预览
6
6
 
@@ -22,8 +22,8 @@
22
22
  ## 功能
23
23
 
24
24
  - **消息字体大小(px)**:直接输入数字(10–32),作用于消息正文、标题、表格与代码。**代码字号**可单独设置(8–32px 绝对值,默认 13;行内代码按比例跟随)——旧版的百分比配置(`codeFontScale`)仍然兼容,一旦设置新的 px 值即以其为准。
25
- - **表格样式**:可选 `默认` 或 **Claude Desktop** 风格(浅灰圆角单元格卡片、单元格间有间隙、无边框、单元格与行内代码同底色、表头不加粗)。
26
- - **对话框宽度(px)**:直接输入数字(600–1600);消息列、输入框、输入框下方的统计栏(轮数/步数/耗时/tok/s)**三者同步变宽**。
25
+ - **表格样式**:可选 `默认` 或 **Claude Desktop** 风格(浅灰圆角单元格卡片、单元格间有间隙、无边框、单元格与行内代码同底色、表头不加粗)。Claude 风格下表格默认撑满列宽;放不下的宽表保持自然宽度、在表格内横向滚动(悬停出现滚动条),不会被挤压换行或裁掉后面的列。
26
+ - **对话框宽度(px)**:直接输入数字(600–1600);消息列、输入框、输入框下方的统计栏(轮数/步数/耗时/tok/s)**三者同步变宽**,宽表格的两侧「出血」量也随列宽同步计算——表格最多贴到消息区边缘(悬停出滚动条),不会伸出屏幕。
27
27
  - **对话时间线(可开关,默认关闭)**:在消息区右侧显示细竖导航轨——每条用户消息一根指示线,悬停展开面板预览消息、随滚动高亮当前位置、点击平滑跳转到对应消息(自动加载更早历史)。**浅色/深色模式都正常显示**,且**始终贴在消息区右侧**:即使安装了右侧边栏(如 dsh-better-sidebar)并展开,时间线也会自动避让、不会与侧边栏重叠。会话中用户消息少于 2 条时自动隐藏。
28
28
  - **GitBar(默认关闭,可在设置中开启)**:当会话的工作目录是一个 git 仓库时,在**输入框工具行内**显示两颗与输入框原生控件(权限 / 模型选择)同款样式的紧凑胶囊——不再占用输入框上方单独一行,输入区因此更矮:
29
29
  - **分支胶囊**:位于权限(访问模式)控件之后;显示当前分支名(有未提交改动时在标题提示)。点击**向上**弹出分支面板——本地 / 远程分支列表(点击即 `git switch`),底部可**新建分支**(`git switch -c` 并自动切换)。
@@ -40,6 +40,11 @@
40
40
  - 新增后请确认服务器能成功连接(状态为「运行中」并注册了工具);启动失败的实例会显示「错误」并可重启重试。
41
41
  - **`/init` 斜杠命令(可开关,默认关闭)**:在输入框键入 `/init`(斜杠菜单中可见「分析当前项目并生成 AGENTS.md」),回车或点击后弹出语言选择——**中文提示词 / 英文提示词**,选中即向当前会话提交一段完整的 AGENTS.md 引导提示词:代理会自行探索项目(README、清单文件、构建脚本、关键目录),然后在仓库根目录**生成或改进**一份面向未来 AI 编码代理的 `AGENTS.md`(项目简介、常用命令、代码风格约定、目录导览、注意事项;已存在时原地改进不丢内容)。纯客户端实现;在「界面调整」中开启后生效。
42
42
  - **鲸鱼指示器(可开关,默认关闭)**:输入框卡片**右上角**停一只品牌小鲸鱼(侧边栏同款 FishLogo,Claude Desktop 小螃蟹的同款位置),身下有**蓝色海浪**缓缓漂移。鲸鱼**常驻原色**(主题主标签色,浅色模式即黑色):**空闲时静静浮在海浪上,悬停或点击它也会游起来(彩蛋)**;**模型工作时开始游泳动画**(原地上下浮动 + 左右轻摆),直到干完活。模型工作状态取自当前会话的 `running` 标志,并叠加输入机的 claimed/submitting 阶段,覆盖「按下回车到代理真正开跑」的间隙。鲸鱼几何为内置的 FishLogo 路径(与 DSH 主程序逐字节一致),挂载时仍会尝试从侧边栏实时徽标抓取最新版以跟随官方换标;动画纯 CSS、颜色走 DSH 主题变量(深浅色模式均正常),`prefers-reduced-motion` 时降级为静止。
43
+ - **任务提醒(可开关,默认关闭)**:挂着任务切去干别的时,让浏览器把你喊回来。监听**所有会话**(含后台),两类事件:**完成提醒**(`running` 落下,或宿主 `completed` 绿点升沿)与**交互提醒**(会话开始等待你的审批 / 计划确认 / 模型提问——与侧边栏黄点同一数据源 `pendingInteraction`)。三个独立通道:
44
+ - **标题闪烁**:`(2) 🔔 原标题` 交替闪烁未读计数,回到页面自动恢复原标题并清零;
45
+ - **系统通知**(Web Notifications API):桌面级通知,**点击直达对应会话**;权限申请挂在设置开关的点击手势上;系统响铃与自有提示音互斥,绝不双重响;
46
+ - **提示音**:WebAudio 现场合成的双音动机——上行=完成、下行=需要你处理,无音频资源文件。
47
+ - 「仅页面不可见时」默认开启(正盯着页面时不打扰);首帧快照只武装不触发(刷新页面不刷屏);只在跳变沿触发 + 同会话同类事件 2 秒冷却(防重连抖动);子代理子会话不计(父会话承载整轮)。设置里有「测试」按钮,一键预览权限申请与通道效果。
43
48
 
44
49
  所有修改**即时生效**,无需刷新。同一份配置也可以直接在设置文档里手改:
45
50
 
@@ -53,6 +58,7 @@ ui-tweaks:
53
58
  archiveManagerEnabled: true # 默认 false(关闭),设为 true 开启「归档」页面
54
59
  initCommandEnabled: true # 默认 false(关闭),设为 true 开启 /init 斜杠命令
55
60
  whaleIndicatorEnabled: true # 默认 false(关闭),设为 true 开启鲸鱼指示器
61
+ notificationsEnabled: true # 默认 false(关闭),设为 true 开启任务提醒(事件过滤与三个通道在设置里逐项开关)
56
62
  # suggestModel: 'provider:model' # 可选:指定生成提交说明的模型
57
63
  ```
58
64
 
@@ -104,6 +110,7 @@ npx -y @deepseek-ai/dsh plugin --profile web add . # 从本目录作为 b
104
110
  - **归档管理**(服务端 `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` 实时消失)。
105
111
  - **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` + 白名单校验。
106
112
  - **鲸鱼指示器**(`src/client/whale.tsx`):挂在 `conversation.input.dock`(输入框卡片上方的整行插槽)。dock 行本身比卡片宽(卡片被 InputBar root 以 `--dsh-composer-card-max-width` 封顶居中、两侧留 `--dsh-composer-side-clearance`),因此鲸鱼行**复刻卡片的几何**——同 max-width、同样居中、同样侧留白——再右对齐 + 6px `translateY`,鲸鱼恰好「骑」在卡片右上角(Claude Desktop 小螃蟹位置),自定义对话框宽度时也自动跟随。开关走与 /init 相同的「按需注册」编排——`whaleIndicatorEnabled` 打开时才注册插槽与样式,关闭即卸载。工作状态 = 会话列表 feed 中当前会话的 `running`(`useSyncExternalStore` 直订)∪ 输入机 `phase` 的 claimed/submitting;鲸鱼 SVG 路径内置为常量,挂载时以 `[class*="brandMark"]` 从侧边栏实时徽标尝试刷新(class 前缀是构建哈希,按后缀匹配以抗版本变化),取不到则回退内置几何。
113
+ - **任务提醒**(`src/client/notifier.ts`):纯逻辑模块(无 React),在 `ctx.effect` 中直订 `ctx.sessions.list` 快照流(鲸鱼同款数据源),对全部非空、非子代理会话做前后对比:`running` true→false 且无挂起交互 → 完成事件;`pendingInteraction`('approval' / 'plan-review' / 'question',即侧边栏黄点分类)出现 → 交互事件;后台会话的宿主 `completed` 绿点升沿同样计为完成。三通道各自静默降级——标题闪烁用 `setInterval` 交替写 `document.title`,`focus`/`visibilitychange` 时恢复;系统通知带 `tag` 去重、`onclick` 里 `window.focus()` + `sessionsService.open(id)` 直达会话、`silent` 跟随提示音开关避免双重响铃;提示音由 WebAudio 振荡器现场合成双音包络。防打扰:首帧只武装基线、只在跳变沿触发、同会话同类 2s 冷却;「仅页面不可见时」等开关经 `readState` 每拍重读实时生效,改动无需重装监视器。
107
114
 
108
115
  ## 协议
109
116
 
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'