dsh-todo-float-ball 0.14.5 → 0.14.7
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/CHANGELOG.md +140 -0
- package/README-en.md +260 -0
- package/README-es.md +15 -15
- package/README-hi.md +15 -15
- package/README-pt.md +15 -15
- package/README.md +186 -178
- package/docs/DATA-CHANNELS.md +32 -4
- package/docs/images/capsule-and-panel.png +0 -0
- package/docs/images/settings-ballnav.png +0 -0
- package/docs/images/skin-and-ball.png +0 -0
- package/lib/client.js +531 -167
- package/package.json +7 -5
- package/README-zh.md +0 -101
- package/README.zh.md +0 -227
- package/docs/images/preview-capsule.jpg +0 -0
- package/docs/images/preview-pinned-sessions-2.jpg +0 -0
- package/docs/images/preview-pinned-sessions.jpg +0 -0
- package/docs/images/preview-skins.png +0 -0
package/README.md
CHANGED
|
@@ -1,249 +1,257 @@
|
|
|
1
1
|
# dsh-todo-float-ball
|
|
2
2
|
|
|
3
|
-
**
|
|
4
|
-
|
|
3
|
+
**AI 在跑长任务,计划清单却总在眼前消失?把它变成一颗常驻桌面的进度球。**
|
|
4
|
+
|
|
5
|
+
把 DeepSeek Harness(DSH)的任务清单搬到桌面右下角的一颗悬浮球上:`已完成/总数` 常驻可见、当前进行中的任务名直接写在球面上,还能拖、能缩成胶囊、能换 130 款皮肤。
|
|
5
6
|
|
|
6
7
|
[](https://www.npmjs.com/package/dsh-todo-float-ball)
|
|
7
8
|
[](LICENSE)
|
|
8
|
-
[](https://github.com/loyalchiiina/dsh-todo-float-ball)
|
|
9
10
|
|
|
10
|
-
English
|
|
11
|
+
[English](README-en.md) | 简体中文
|
|
11
12
|
|
|
12
13
|
---
|
|
13
14
|
|
|
14
|
-
##
|
|
15
|
+
## 效果图
|
|
16
|
+
|
|
17
|
+
### 皮肤菜单 + 悬浮球
|
|
18
|
+
|
|
19
|
+
130 款皮肤分 8 组,菜单首行是「三球皮肤同步」开关,第二行是「0 · 随系统 · 深/浅自动」。
|
|
20
|
+
|
|
21
|
+

|
|
22
|
+
|
|
23
|
+
### 胶囊态 + 面板展开
|
|
24
|
+
|
|
25
|
+
右键球体收起为横向胶囊(进度条 + 当前任务名);单击展开完整任务面板,进行中的那一项带旋转描边环。
|
|
26
|
+
|
|
27
|
+

|
|
28
|
+
|
|
29
|
+
### 设置页「悬浮球导航」
|
|
15
30
|
|
|
16
|
-
|
|
31
|
+
设置页里的共用分区:三球显隐、皮肤下拉、◎ 回到右下角、作者插件清单。
|
|
17
32
|
|
|
18
|
-
|
|
33
|
+

|
|
19
34
|
|
|
20
|
-
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## 一句话说明
|
|
38
|
+
|
|
39
|
+
DSH 里让 AI 干活时,它会用内置的 `todo_write` 记一份任务清单。官方界面把这份清单渲染成输入框上方的一小条——**但那一小条很容易被忽略、会随对话滚走、助手还在干活时它就已经折叠了**。你被迫反复翻对话找"现在到底做到哪一步了"。
|
|
40
|
+
|
|
41
|
+
**dsh-todo-float-ball 把这份清单搬到一颗常驻悬浮球上:**
|
|
42
|
+
|
|
43
|
+
| 你遇到的 | 这个插件怎么解决 |
|
|
21
44
|
|---|---|
|
|
22
|
-
|
|
|
23
|
-
|
|
|
24
|
-
|
|
|
25
|
-
|
|
|
26
|
-
|
|
|
27
|
-
|
|
|
28
|
-
|
|
|
45
|
+
| 计划条随对话滚走,找不到进度 | 球**常驻桌面右下角**(可拖拽,位置跨重启记忆,拖出屏幕自动拉回) |
|
|
46
|
+
| 想知道"几项做完了",得展开细看 | 球面**直接显示 `已完成/总数`**,外圈进度环同步可视化 |
|
|
47
|
+
| 不知道助手当前在忙哪一项 | 球面显示**当前进行中任务的名称**;胶囊态只显示这一行 |
|
|
48
|
+
| 屏幕空间紧张,球占地方 | 右键切成**横向胶囊**:一条进度条 + 任务名 |
|
|
49
|
+
| 同时跑多个会话,来回切换看进度 | **固定多个会话,面板并排显示多栏进度**,一屏看住所有并行任务 |
|
|
50
|
+
| 任务做完没做完,颜色分不清 | **状态色一眼可读**:橙脉动=进行中 / 绿=全部完成 / 蓝=只有待办 / 灰=暂无清单 |
|
|
51
|
+
| 想回看之前排过的任务 | **历史归档**:新计划覆盖旧计划时,旧任务自动折叠进"已完成历史 / 被抛弃历史",不会凭空消失 |
|
|
52
|
+
| 皮肤看腻了 / 和别的插件风格不搭 | **130 款皮肤**(官方主题 / 招牌特效 / 克制精选 + 5 组配色),三球可同步可独立 |
|
|
53
|
+
| 浅色皮肤上白字看不清 | **强制字色**:自动 / 黑 / 白一键切,官方皮肤下自动锁定 |
|
|
54
|
+
|
|
55
|
+
**它只是一个只读的观察者**:插件从不修改官方面板、不改对话内容、不干扰其他插件。
|
|
56
|
+
|
|
57
|
+
## 为什么值得装
|
|
58
|
+
|
|
59
|
+
- **专治"长任务失联"** —— DSH 的 AI 会自动续跑很多轮,你可能十几分钟不看屏幕。球上的橙灯和 `3/8` 让你一眼就知道**还在跑、跑到哪了**。
|
|
60
|
+
- **多会话并行不再瞎猜** —— 固定标签把两栏进度并排摆在同一个面板里,不用左点右点来回切。
|
|
61
|
+
- **三球视觉统一** —— 与姊妹插件 `dsh-skill-browser`、`dsh-font-enhancer` 共用同一套 **130 款皮肤**目录,三个球可以一起换肤、风格一致,也可以让某个球独立。
|
|
62
|
+
- **双端同一份代码** —— 桌面端(Electron)和网页端行为一致。
|
|
63
|
+
- **零侵入零配置** —— 装上即用,不写配置文件也不改官方 UI;`Shadow DOM + all:initial` 做样式隔离,与你其他主题/皮肤插件互不干扰。
|
|
64
|
+
- **数据来源可靠** —— 三路同步:**主** = 运行时 `sessions` 服务的权威投影帧;**兜底 1** = 官方 todo 面板的 DOM 观察;**兜底 2** = 传输帧被动拦截。兜底只在权威通道对该会话尚无数据时才发言。**官方那一条折叠了、甚至没渲染,球上依然是完整清单**。
|
|
65
|
+
|
|
66
|
+
---
|
|
29
67
|
|
|
30
|
-
|
|
68
|
+
## 功能详解
|
|
31
69
|
|
|
32
|
-
|
|
70
|
+
### 悬浮球与胶囊态
|
|
33
71
|
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
72
|
+
- **圆形悬浮球**常驻窗口右下角(默认 `right:18px; bottom:18px`),随时可见。
|
|
73
|
+
- 球面实时显示 **`已完成/总数`**,下方一行是**当前进行中任务的名称**(超长自动截断)。
|
|
74
|
+
- **外圈进度环**用同一比例可视化进度(`conic-gradient` + 百分比遮罩),与球面数字同源。
|
|
75
|
+
- **状态色**:橙色脉动 = 正在干活 / 绿色 = 全部完成 / 蓝色 = 只有待办 / 灰色 = 暂无清单。
|
|
76
|
+
- **可拖动**:按住拖到任意位置,坐标按 profile 存 `localStorage`,重启后恢复;**保存的坐标跑到屏幕外时会自动拉回视口内**(防"球丢了")。
|
|
77
|
+
- **胶囊态**:右键球体在【圆形球】与【横向胶囊】之间切换。胶囊是一条横向进度条 + 任务名 + `已完成/总数`,屏幕空间紧张时用。
|
|
78
|
+
- **点击**展开完整任务面板;**再点一下**(或按 `Esc`)收起。
|
|
40
79
|
|
|
41
|
-
|
|
80
|
+
### 任务面板
|
|
42
81
|
|
|
43
|
-
|
|
82
|
+
- **任务清单**:每项带状态图标与配色——✓ 已完成(绿色 + 删除线)、▶ 进行中(橙色)、○ 待办(灰色虚线圈)。
|
|
83
|
+
- **进行中旋转描边环**:正在执行的那一项外圈有一道绕行描边(`@property --tfb-spin` + `tfbBorderSpin`),一眼看出"就是这条在跑"。
|
|
84
|
+
- **已完成历史折叠**:`▾ 已完成 · N`,默认收起,点标题展开。
|
|
85
|
+
- **被抛弃历史折叠**:`▸ 已抛弃 · N`,被新计划替换掉的未完成任务收在这里。
|
|
86
|
+
- **分界线**:历史区与当前轮清单之间有一道 `── 当前进度 · 5/10 完成 ──` 分界线(两侧渐隐细线 + 圆角胶囊标签,两套皮肤各自配色,`pointer-events:none` 不挡点击),把"历史贡献"和"官方最新清单"在视觉上一刀切开。
|
|
87
|
+
- **行级 ✕ 隐藏**、**🧹 一键隐藏本区**、**↩︎ 恢复已隐藏的 N 条**、**📋 整行复制**(复制完整文本,非显示截断)。
|
|
88
|
+
- **📌 固定会话**:把别的会话也钉到面板里,与当前对话走**同一个渲染器**,折叠开合与隐藏记录**按会话隔离**。
|
|
89
|
+
- **⇄ 布局切换**:上下堆叠 ⇄ 左右并排,偏好写 `localStorage`,下次打开自动恢复;左右并排时带列标题。
|
|
44
90
|
|
|
45
|
-
|
|
91
|
+
### 皮肤:130 款,8 组
|
|
46
92
|
|
|
47
|
-
|
|
93
|
+
皮肤菜单(标题栏 🎨 按钮)分组与数量(实测目录,显示序号 1..130 连续):
|
|
48
94
|
|
|
49
|
-
|
|
95
|
+
| 分组 | 数量 | 说明 |
|
|
96
|
+
|---|---|---|
|
|
97
|
+
| 官方主题 | 2 | **1 · 官方深色** / **2 · 官方浅色**,与 DSH 界面同色系 |
|
|
98
|
+
| 招牌特效 | 20 | 曜石极光、赛博机能、全息幻彩……自带外圈光带与旋转描边、呼吸动画 |
|
|
99
|
+
| 克制精选 | 8 | 墨玉、石墨极简、暮蓝……静态、安静、不抢眼 |
|
|
100
|
+
| 浓郁深底 | 38 | 高饱和深色底 |
|
|
101
|
+
| 尘埃灰调 | 20 | 低饱和灰调 |
|
|
102
|
+
| 柔光深底 | 15 | 柔和暗色 |
|
|
103
|
+
| 中性点缀 | 10 | 中性色 + 一点强调色 |
|
|
104
|
+
| 浅色纸面 | 17 | 浅色底,适合白天 |
|
|
50
105
|
|
|
51
|
-
|
|
106
|
+
- **0 · 随系统 · 深/浅自动**:菜单第二行。跟随 `prefers-color-scheme`,系统切深浅色时球和面板实时跟着切(解析到「官方深色」或「官方浅色」)。
|
|
107
|
+
- **三球皮肤同步**:菜单第一行的勾选行。**勾选 = 跟随全局皮肤**(三球同款,改一个三个一起变);**不勾 = 本球独立皮肤**,只影响 Todo 球,全局换肤不动它。
|
|
108
|
+
- **招牌特效类皮肤自带外圈光带**(底部 `radial-gradient` 光带 + 旋转描边),随皮肤自动出现或消失,**没有单独的开关**——换皮肤就是开关。
|
|
52
109
|
|
|
53
|
-
|
|
110
|
+
### 强制字色
|
|
54
111
|
|
|
55
|
-
|
|
112
|
+
标题栏的 ◐ 按钮循环切换 **自动 → 黑 → 白**,作用于**面板内外所有文字**(球面标签、任务行、折叠行、提示语),解决浅色皮肤白字看不清 / 深色皮肤黑字看不清。
|
|
56
113
|
|
|
57
|
-
|
|
114
|
+
- **自动**:跟随皮肤自带的文字色。
|
|
115
|
+
- **官方皮肤下自动锁定**:选到 **1 · 官方深色**、**2 · 官方浅色**,或选「0 · 随系统」解析到官方皮肤时,字色由皮肤强制决定(深色皮肤 → 白字、浅色皮肤 → 黑字),按钮呈锁定态、点击不再切换——官方皮肤本身就带正确的对比度,不需要也不允许手动覆盖。
|
|
58
116
|
|
|
59
|
-
|
|
117
|
+
### 拖到屏幕顶部也不丢
|
|
60
118
|
|
|
61
|
-
|
|
119
|
+
DSH 桌面端窗口顶部约 40px 是窗口拖拽带(Electron 的 `app-region: drag`)。球和面板都写了:
|
|
62
120
|
|
|
63
|
-
|
|
121
|
+
```css
|
|
122
|
+
.tfb-ball, .tfb-panel, .tfb-theme-menu {
|
|
123
|
+
-webkit-app-region: no-drag;
|
|
124
|
+
app-region: no-drag;
|
|
125
|
+
}
|
|
126
|
+
```
|
|
64
127
|
|
|
65
|
-
|
|
66
|
-
- **Its face** shows live progress: `done/total`, with the active task's name underneath. A ring around it mirrors the same percentage.
|
|
67
|
-
- **Click** the ball to expand the full task panel; **click again** (or press `Esc`) to fold it back.
|
|
68
|
-
- **Right-click** to switch to capsule mode, which shows only the running task and the count.
|
|
69
|
-
- **Drag** it anywhere; the position is remembered per profile. Drag it off-screen and it snaps back.
|
|
70
|
-
- **Colour** tells you the state at a glance: pulsing orange = work in progress, green = all done, blue = pending only, gray = no list yet.
|
|
128
|
+
所以**把球拖到屏幕最顶端也不会点不动、拖不动**——否则落在拖拽带上的球会被窗口拖拽逻辑吃掉所有鼠标事件,看着在、实际已经"死"了。
|
|
71
129
|
|
|
72
|
-
|
|
130
|
+
### 设置页「悬浮球导航」
|
|
73
131
|
|
|
74
|
-
|
|
132
|
+
DSH 设置页里有一个 **「悬浮球导航」** 分区(`settings.section`,`order: 22`)。**这个分区由姊妹插件 `dsh-skill-browser` 注册**,本插件只读它写入的共享键,属于三球共用的一块面板:
|
|
75
133
|
|
|
76
|
-
|
|
134
|
+
- **三球显隐**:技能浏览器 / 字体插件 / **Todo 进度** 三个勾选框(没装的插件显示「(未安装)」且置灰)。
|
|
135
|
+
- **皮肤下拉**:`0 · 跟随系统 · 深/浅自动` + 8 个分组的全部皮肤,等价于三球同步时的全局皮肤。
|
|
136
|
+
- **◎ 回到右下角**:一键把球归位。
|
|
137
|
+
- **作者插件**:12 个插件清单(名字 + 一句话描述 + ⭐ 链接)。
|
|
77
138
|
|
|
78
|
-
|
|
79
|
-
|---|---|
|
|
80
|
-
| 常驻可拖拽悬浮球(默认右下角),位置存 `localStorage` 并跨重启恢复,越界旧位置自动拉回 | Persistent draggable ball (default bottom-right); position saved to `localStorage` and restored across restarts, off-screen positions clamped back |
|
|
81
|
-
| 球面实时显示 `done/total` + 当前进行中任务名(截断),随 todo_write 实时刷新 | Live `done/total` plus the active task's name on the ball face, updated in real time |
|
|
82
|
-
| 状态颜色一眼可读:橙脉动=进行中 / 绿=全部完成 / 蓝=只有待办 / 灰=暂无清单 | Status colours at a glance: orange pulse = working, green = all done, blue = pending only, gray = no list |
|
|
83
|
-
| 每项任务带图标与配色:✓ 完成(绿+删除线)、▶ 进行中(橙)、○ 待办(灰虚线) | Per-item icons & colours: ✓ done (green, strikethrough), ▶ in progress (orange), ○ pending (dashed gray) |
|
|
139
|
+
> 装了这一组插件里任意一个,这个分区就会出现;只装 Todo 球而没有 `dsh-skill-browser` 时,用球自己的标题栏按钮(◎ 归位、🎨 皮肤)做同样的事。
|
|
84
140
|
|
|
85
|
-
###
|
|
141
|
+
### 标题栏按钮(全部黑白线性图标)
|
|
86
142
|
|
|
87
|
-
|
|
143
|
+
面板标题栏那排按钮都是 `stroke: currentColor` 的线性 SVG,跟着字色走,不用 emoji:
|
|
144
|
+
|
|
145
|
+
| 图标 | 动作 |
|
|
88
146
|
|---|---|
|
|
89
|
-
|
|
|
90
|
-
|
|
|
91
|
-
|
|
|
92
|
-
|
|
|
147
|
+
| ⇄ | 切换面板布局:上下堆叠 / 左右并排 |
|
|
148
|
+
| 📌(线性) | 固定 / 取消固定当前会话 |
|
|
149
|
+
| ◎ | 归位到右下角 |
|
|
150
|
+
| 🎨(线性调色板) | 打开皮肤菜单 |
|
|
151
|
+
| ◐ / ● / ○ | 强制字色:自动 / 黑 / 白(官方皮肤下锁定) |
|
|
152
|
+
| ✕ | 折叠面板 |
|
|
153
|
+
| ☆ | 去 GitHub 点 Star |
|
|
93
154
|
|
|
94
|
-
|
|
155
|
+
## 快速上手
|
|
95
156
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
157
|
+
1. **装上就有效果**:装好后右下角出现一颗球。没有任务时它是灰色的,显示 `✓`。
|
|
158
|
+
2. **让 AI 干活**:随便让它做个多步骤任务,它会调用 `todo_write`,球面立刻变成 `0/3`、`1/3`……并显示当前那一项的名字。
|
|
159
|
+
3. **点球看全清单**:单击球体展开面板,进行中的那项带旋转描边环;再点收起。
|
|
160
|
+
4. **右键变胶囊**:觉得球挡视线就右键切成横向胶囊,只留一条进度条 + 任务名。
|
|
161
|
+
5. **换个皮肤**:点 🎨 打开皮肤菜单。想跟另外两个球一致就勾上「三球皮肤同步」;想单独一个球漂亮就取消勾选再选。懒得选就点 `0 · 随系统 · 深/浅自动`。
|
|
162
|
+
6. **字看不清就调**:点 ◐ 在 自动 → 黑 → 白 之间切。(官方皮肤下这个按钮会锁定,是正常行为。)
|
|
163
|
+
7. **拖到哪都行**:按住球拖到顺手的位置,位置会记住;拖到屏幕顶端也不会失效。想归位就点 ◎。
|
|
102
164
|
|
|
103
|
-
|
|
165
|
+
## 基本用法
|
|
104
166
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
167
|
+
- **悬浮球**始终固定在窗口角落(默认右下角)。
|
|
168
|
+
- **球面**实时显示 `已完成/总数`,下方显示当前进行中的任务名;外圈进度环同步可视化同一比例。
|
|
169
|
+
- **单击**展开完整任务面板;**再点一下**(或按 `Esc`)收起。
|
|
170
|
+
- **右键**切换到胶囊模式。
|
|
171
|
+
- **拖拽**到任意位置,按 profile 记忆坐标;拖出屏幕会自动拉回。
|
|
172
|
+
- **颜色**一眼看状态:橙色脉动 = 正在干活,绿色 = 全部完成,蓝色 = 只有待办,灰色 = 暂无清单。
|
|
110
173
|
|
|
111
|
-
|
|
174
|
+
## 安装
|
|
112
175
|
|
|
113
|
-
|
|
114
|
-
|---|---|
|
|
115
|
-
| 三球共享 128 款皮肤目录(含 6 款经典旧皮肤),任一处切换全同步 | Shares the 128-skin catalogue across the three balls (6 classic skins kept), synced everywhere |
|
|
116
|
-
| 零遥测、零数据上传,仅一条本机回环健康路由 | Zero telemetry, zero data upload — just a loopback-only health route |
|
|
176
|
+
### 从 DSH 插件市场安装(推荐)
|
|
117
177
|
|
|
118
|
-
|
|
178
|
+
在 DSH 的插件市场里搜索 **`dsh-todo-float-ball`** 或 **`Todo 进度球`**,点安装后重启 DSH。
|
|
119
179
|
|
|
120
|
-
|
|
121
|
-
|---|---|
|
|
122
|
-
| Persistent floating ball | Always visible in the viewport, draggable anywhere, position saved to `localStorage` and restored across restarts (off-screen stale positions are clamped back) |
|
|
123
|
-
| Live progress | `done/total` on the ball face plus the first active task's content (truncated), updated in real time |
|
|
124
|
-
| Fold / expand | Click the ball to toggle the task panel; the panel opens next to the ball and flips sides when near the screen edge |
|
|
125
|
-
| Status colors | Per-item icons and colors: ✓ completed (green, strikethrough), ▶ in progress (orange), ○ pending (dashed gray); ball itself: orange pulse / green / blue / idle gray |
|
|
126
|
-
| Dual-channel data sync | Channel A: `MutationObserver` over the official todo panel DOM. Channel B: passively inspects session projection frames (`{type:"projection", key:"todos", ...}`) via wrapped `fetch` and `WebSocket.onmessage`, so the full list is available even when the official strip is collapsed |
|
|
127
|
-
| Shadow DOM isolation | All UI lives inside an open Shadow DOM with `all:initial` — no style leaks in or out, immune to theme/skin plugins |
|
|
128
|
-
| Dual-end support | Works in DSH Desktop (Electron window) and the web UI (browser) with the same code, because both render the same page; the UI mounts on `<html>` to dodge `transform`-related `position:fixed` breakage |
|
|
129
|
-
| Privacy-friendly | Zero telemetry, zero data upload. The only host-side surface is a loopback-only health route (`/dsh-todo-float-ball/health`) |
|
|
130
|
-
| **Discipline injection (v0.9.0)** | The host injects 5 hardest todo rules (~340 chars, `order=190`) into the system prompt of **every session** — **works as soon as the plugin is installed, no skill needs to be loaded**; turn it off with `injectDiscipline: false` |
|
|
131
|
-
| **History archive & panel tools (v0.10.0)** | Merged snapshots no longer wipe older todos — they become a foldable history archive; per-row ✕ hide, two independent fold rows, 🧹 batch cleanup, ♻️ one-click restore, 📋 full-text copy; all counters reflect only the latest snapshot |
|
|
132
|
-
| **Pinned-panel parity & layout switch (v0.11.0)** | 📌 pinned sessions render through the *same* history renderer as the current view (folds, 🧹, ♻️, per-session state and per-session action scoping); the panel header gained a ⇄ button to flip between a stacked layout and a side-by-side layout (left = current list, right = pinned sessions) with per-column captions |
|
|
133
|
-
|
|
134
|
-
## Pinned sessions & panel layout (v0.11.0)
|
|
135
|
-
|
|
136
|
-
- **One renderer, two lists** — the current conversation and every pinned (📌)
|
|
137
|
-
conversation are rendered by the same `historySectionHtml()` function: latest
|
|
138
|
-
snapshot flat, then `▾ Completed history (N)` and
|
|
139
|
-
`▸ Abandoned history tasks (M)`, each fold with its own 🧹, plus
|
|
140
|
-
`🧹 Clear all history` and `♻️ Restore all hidden history`. Pinned panels got
|
|
141
|
-
the last two rows for the first time in this release.
|
|
142
|
-
- **Per-session state** — fold open/closed and hidden rows are keyed by session
|
|
143
|
-
id, so expanding or cleaning one conversation never moves another one; every
|
|
144
|
-
control carries the id of the list it was rendered for (`data-ownsid`).
|
|
145
|
-
- **Stable snapshot boundary** — the snapshot/history split is taken on the raw
|
|
146
|
-
list and the hidden-row filter is applied afterwards, so hiding a snapshot row
|
|
147
|
-
can no longer drag an archived row into the live area or shift a fold count.
|
|
148
|
-
- **⇄ layout switch** — stacked (current list above, pinned below) or
|
|
149
|
-
side-by-side (left current, right pinned). The preference is stored in
|
|
150
|
-
`localStorage["dsh-todo-float-ball-layout"]` and restored on load.
|
|
151
|
-
- **Column captions** — in side-by-side mode the left column is captioned with
|
|
152
|
-
the current conversation title and the right one with `📌 固定会话`; in stacked
|
|
153
|
-
mode the captions stay hidden and nothing about the old layout changes.
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
## History & panel management (v0.10.0)
|
|
157
|
-
|
|
158
|
-
A plan is rewritten many times during a long task. From v0.10.0 the panel keeps
|
|
159
|
-
the **latest snapshot** as the live list and archives everything older instead
|
|
160
|
-
of discarding it:
|
|
161
|
-
|
|
162
|
-
- **Merge, not replace** — a fresh snapshot updates the leading `snapLen` rows
|
|
163
|
-
of the session bucket; previous items that are not part of the new snapshot
|
|
164
|
-
are appended after it, so old tasks never disappear.
|
|
165
|
-
- **Statistics mean "the current plan"** — the ball face (`done/total`), the
|
|
166
|
-
progress ring, the header summary and the "N items left" notice count only
|
|
167
|
-
the latest snapshot (`snapshotList()`); history is a pure archive.
|
|
168
|
-
- **Per-row hide (✕)** — hover a history row and click ✕ to hide it. Hidden
|
|
169
|
-
rows live in `localStorage` (`dsh-todo-float-ball-hidden-v1`, per session);
|
|
170
|
-
the data layer is untouched. Pinned (📌) sessions hide rows independently —
|
|
171
|
-
a hidden row in session A can never hide a row in session B (`data-ownsid`).
|
|
172
|
-
- **Two fold rows** — `▾ Completed history (N)` and `▸ Abandoned history
|
|
173
|
-
tasks (M)` are independent collapsible rows (collapsed by default); the
|
|
174
|
-
latest snapshot always renders fully expanded.
|
|
175
|
-
- **Batch cleanup (🧹)** — each fold row has a 🧹 button to clear that fold,
|
|
176
|
-
plus a `🧹 Clear all history (X)` row that hides both folds at once.
|
|
177
|
-
- **One-click restore (♻️)** — `♻️ Restore all hidden history (X)` appears
|
|
178
|
-
only while something is hidden and unhides everything in the session.
|
|
179
|
-
- **Row copy (📋)** — copies the *full* task text (not the 80-char display
|
|
180
|
-
truncation), with a real ✓/⚠ feedback.
|
|
181
|
-
|
|
182
|
-
## Discipline injection (v0.9.0)
|
|
183
|
-
|
|
184
|
-
DSH skills are **loaded on demand**: a session that never loads the `todo-show-discipline` skill carries no todo rules at all. Since v0.9.0 the host half injects a stable "todo discipline" section into every session's system prompt, so **installing the plugin is enough** — independent of which skill got loaded, which preset is active, and whether you run Desktop or the web UI.
|
|
185
|
-
|
|
186
|
-
- **ON by default** (no `config` row means ON).
|
|
187
|
-
- To turn it off: add `config: { injectDiscipline: false }` to this plugin's row in `cordis.patch.yml` (or your profile's patch layer), then **restart DSH**.
|
|
188
|
-
- Only an explicit boolean `false` disables it; `"false"` / `0` / typos / a missing `config` all keep it ON (guards against accidental shutdown).
|
|
189
|
-
- The injected text is deliberately short (a system-prompt section costs tokens in every session); the full rules stay in the `todo-show-discipline` skill, which is disabled for model invocation by default once this plugin is installed, and can be re-enabled if you uninstall the plugin.
|
|
190
|
-
|
|
191
|
-
## Install
|
|
192
|
-
|
|
193
|
-
The plugin is a standard DSH npm package (`dsh.bundle` self-declared). Two ways:
|
|
194
|
-
|
|
195
|
-
### From npm (when published)
|
|
180
|
+
### 从 npm 安装
|
|
196
181
|
|
|
197
182
|
```bash
|
|
198
183
|
npm install dsh-todo-float-ball
|
|
199
184
|
```
|
|
200
185
|
|
|
201
|
-
|
|
186
|
+
然后在你所用 profile 的 `package.json`(如 `%USERPROFILE%\.dsh\profiles\desktop\package.json`)里,把 `"dsh-todo-float-ball"` 同时加进 `dependencies` 和 `dsh.profile.bundles`,重启 DSH 生效。
|
|
202
187
|
|
|
203
|
-
###
|
|
188
|
+
### 手动安装
|
|
204
189
|
|
|
205
|
-
|
|
190
|
+
把本包目录整体复制进 profile 的 `node_modules`(必须是真实目录复制——**不要**用 `link:` / `file:` 依赖,会触发 DSH 安装恢复死循环),按上面同样方式注册后重启。
|
|
206
191
|
|
|
207
|
-
|
|
192
|
+
重启后右下角应出现悬浮球。可用下面的地址验证宿主端已挂载:
|
|
208
193
|
|
|
209
194
|
```
|
|
210
|
-
http://127.0.0.1
|
|
211
|
-
→ {"ok":true,"plugin":"dsh-todo-float-ball","version":"
|
|
195
|
+
http://127.0.0.1:<你当前的 DSH 端口>/dsh-todo-float-ball/health
|
|
196
|
+
→ {"ok":true,"plugin":"dsh-todo-float-ball","version":"<已安装 package.json 里的版本号>"}
|
|
212
197
|
```
|
|
213
198
|
|
|
214
|
-
|
|
199
|
+
**端口要填你自己的。** DSH 桌面端默认 `port: 0`(每次重启换一个随机端口),没有固定值可抄。可从 DSH 窗口地址栏读取,或在 `%USERPROFILE%\.dsh\desktop-preferences.json` 里把 `port` 固定下来。该路由还只接受本机渲染进程的请求,其他请求一律回 `403 Browser access is disabled`,所以除非你打开 `browserAccess`,`curl` 是拿不到的。
|
|
200
|
+
|
|
201
|
+
## 适配版本
|
|
202
|
+
|
|
203
|
+
- DSH 内核(`@deepseek-ai/dsh`):**0.2.1-rc.3**(`package.json` 的 `engines.dsh` 已声明 `>=0.1.7-rc.1`)
|
|
204
|
+
- DSH 桌面端:**2.0.20-next**(DSH NEXT)
|
|
205
|
+
- Node.js:`^22.19.0 || >=24.0.0`
|
|
206
|
+
- 已在上述版本实测通过;低版本 `0.1.7-rc.1` 及以上兼容。
|
|
207
|
+
|
|
208
|
+
## 实现原理
|
|
209
|
+
|
|
210
|
+
官方的 todo 数据是一条**会话投影(session projection)**:
|
|
211
|
+
|
|
212
|
+
1. `@deepseek-ai/dsh-tool-todo` 注册 `todo_write` 工具,并在 `sessionProjections` 上登记 `todos` 投影单元;每次调用向会话日志追加一条 `todo/write` 快照;
|
|
213
|
+
2. `@deepseek-ai/dsh-client-connection` 把当前值以控制帧广播:`{type:"projection", sessionId, key:"todos", value:[{content,status}...]}`;
|
|
214
|
+
3. `@deepseek-ai/dsh-client-ui-conversation` 把它渲染成输入框上方的任务条(`[data-testid="todo-panel"]`)。
|
|
215
|
+
|
|
216
|
+
本插件在两端各挂一个只读探针,不碰任何一端:
|
|
217
|
+
|
|
218
|
+
- **主路**:订阅运行时 `sessions` 服务的权威投影帧(另有 2 秒轮询兜底,防 shell 重建后回调失联)。
|
|
219
|
+
- **兜底一(DOM)**:一个带 200ms 防抖的 `MutationObserver` 盯着 `[data-testid="todo-panel"]`——面板展开时读 `li[data-status]` 全量清单;折叠时解析本地化的计数文案(如"1 完成 · 2 进行中",含中文数字解析)。
|
|
220
|
+
- **兜底二(传输层)**:一次性、防御式的 `window.fetch` 包装(clone 响应、只处理文本/JSON)与 `WebSocket.prototype.onmessage` 包装(文本帧),把每个载荷送进严格的提取器——只对形如投影帧、`todo/write` 事件、`{todos:[...]}` 快照的对象起反应,其余一律忽略,绝不回写。
|
|
221
|
+
|
|
222
|
+
所有通道汇入同一个归一化器:过滤出三种合法状态、丢弃空内容、列表无变化时零开销跳过(签名比对)。兜底由 `hasPrimaryData()` 把关,权威通道有数据即静默。
|
|
215
223
|
|
|
216
|
-
|
|
224
|
+
**历史归档的口径**:权威通道的一帧就是当前计划的全部(`todo_write` 是整表替换),所以 `snapLen = norm.length`,其后的合并项即历史。球面计数、进度环、头部汇总只统计**最新快照**,历史是纯档案、不进任何计数。
|
|
217
225
|
|
|
218
|
-
|
|
219
|
-
2. `@deepseek-ai/dsh-client-connection` broadcasts the current value as a control frame: `{type:"projection", sessionId, key:"todos", value:[{content,status}...]}`.
|
|
220
|
-
3. `@deepseek-ai/dsh-client-ui-conversation` renders it as the plan strip above the input box (`[data-testid="todo-panel"]`).
|
|
226
|
+
## 常见问题
|
|
221
227
|
|
|
222
|
-
|
|
228
|
+
**悬浮球不出现?**
|
|
229
|
+
先开上面的 health 地址:能返回说明宿主端正常,是客户端 bundle 没加载(查 DSH 日志有无 `loaded without registering`,bundle id 必须与包名一致);不能返回说明插件没进 profile 的 bundles 列表。
|
|
223
230
|
|
|
224
|
-
|
|
225
|
-
|
|
231
|
+
**球拖到屏幕顶端就点不动了?**
|
|
232
|
+
不会。球和面板都写了 `app-region: no-drag`,落在窗口拖拽带上依然可点可拖。若真遇到,请报 issue 并附 DSH 版本。
|
|
226
233
|
|
|
227
|
-
|
|
234
|
+
**选了官方皮肤,字色按钮点不动?**
|
|
235
|
+
正常。官方皮肤(官方深色 / 官方浅色 / 随系统解析到官方皮肤)下字色由皮肤强制决定并锁定按钮,保证对比度。
|
|
228
236
|
|
|
229
|
-
|
|
237
|
+
**「三球皮肤同步」勾和不勾有什么区别?**
|
|
238
|
+
勾选 = 跟随全局皮肤(改一个三个球一起变);不勾 = 这个球用自己的皮肤,全局换肤不影响它。
|
|
230
239
|
|
|
231
|
-
|
|
232
|
-
|
|
240
|
+
**官方面板折叠时也能同步吗?**
|
|
241
|
+
能。这正是兜底存在的意义:官方面板折叠时只渲染计数文案,而投影帧始终携带完整清单。
|
|
233
242
|
|
|
234
|
-
|
|
235
|
-
|
|
243
|
+
**会拖慢界面吗?**
|
|
244
|
+
不会。观察器 200ms 防抖;传输层窃听先做 `"todos"` 字符串预筛再解析;兜底看门狗跑约 10 分钟后自动停止。
|
|
236
245
|
|
|
237
|
-
|
|
238
|
-
Yes. That is exactly why channel B exists: the official strip renders only a counts label when collapsed, while projection frames always carry the full list.
|
|
246
|
+
## 兼容性
|
|
239
247
|
|
|
240
|
-
|
|
241
|
-
|
|
248
|
+
- DSH 桌面端 2.x(desktop profile)与 DSH web(web profile)
|
|
249
|
+
- Node.js `^22.19.0 || >=24.0.0`
|
|
250
|
+
- 插件自包含,只通过公开 DOM/HTTP 面与 DSH 交互;皮肤目录与 `dsh-skill-browser`、`dsh-font-enhancer` 共用(可选,不装也能单独用)
|
|
242
251
|
|
|
243
|
-
##
|
|
252
|
+
## 隐私
|
|
244
253
|
|
|
245
|
-
-
|
|
246
|
-
- No `peerDependencies` — the plugin is self-contained and talks to DSH only through public DOM/HTTP surfaces
|
|
254
|
+
零遥测、零数据上传。宿主端只注册一个仅限本机回环访问的健康检查路由(`/dsh-todo-float-ball/health`)。
|
|
247
255
|
|
|
248
256
|
## License
|
|
249
257
|
|
package/docs/DATA-CHANNELS.md
CHANGED
|
@@ -12,7 +12,30 @@ so future maintainers can re-validate them against newer DSH versions.
|
|
|
12
12
|
| View | `@deepseek-ai/dsh-client-ui-conversation` | Renders the `todos` projection as the plan strip above the composer (`section[data-testid="todo-panel"]`), collapsible; expanded it renders `ul > li[data-status]` with a content span; collapsed it renders only a localized counts label |
|
|
13
13
|
| Tool row | `@deepseek-ai/dsh-client-ui-tool` | Renders the one-line `todo_write` conversation row (summary derived from call args) |
|
|
14
14
|
|
|
15
|
-
## Channel A —
|
|
15
|
+
## Channel A — `sessions` service (authoritative)
|
|
16
|
+
|
|
17
|
+
The client half declares `inject: ["sessions"]` and subscribes to the runtime's
|
|
18
|
+
global session registry (`ctx.sessions.list.subscribe`, plus a 2 s pull as a
|
|
19
|
+
safety net in case a callback stops firing after a shell rebuild).
|
|
20
|
+
|
|
21
|
+
- This is the **primary** channel and it wins every disagreement.
|
|
22
|
+
- `todo_write` is a **whole-list replacement**, so one frame from this channel is
|
|
23
|
+
the complete live plan. The snapshot boundary (`snapLen`) is therefore taken
|
|
24
|
+
from the frame length itself; everything merged in behind it is history and
|
|
25
|
+
must never be counted as live progress. (v0.14.6 removed the older monotonic
|
|
26
|
+
high-water mark, which never shrank and made the ball report `9/18` while the
|
|
27
|
+
official panel held 6 items.)
|
|
28
|
+
- Frames are normalized (statuses filtered to `pending | in_progress |
|
|
29
|
+
completed`, blank contents dropped) and a signature (`status|content` joined)
|
|
30
|
+
makes identical lists no-ops.
|
|
31
|
+
|
|
32
|
+
## Channel B — DOM panel (fallback only)
|
|
33
|
+
|
|
34
|
+
**Strictly a fallback**: it only feeds the ball while the authoritative channel
|
|
35
|
+
has produced nothing for this session (`hasPrimaryData(sid, rec)` returns early
|
|
36
|
+
otherwise). Without that guard the two channels alternate on every observer tick
|
|
37
|
+
and the ball flickers between the service's full list and whatever React has
|
|
38
|
+
painted mid-render.
|
|
16
39
|
|
|
17
40
|
- Selector: `[data-testid="todo-panel"]`
|
|
18
41
|
- Expanded: `panel.querySelectorAll("ul li[data-status]")` →
|
|
@@ -22,8 +45,10 @@ so future maintainers can re-validate them against newer DSH versions.
|
|
|
22
45
|
segments; both Arabic numerals and simple Chinese numerals (一/两/三…十) are
|
|
23
46
|
supported. Count-only data is used solely as a last resort when no
|
|
24
47
|
projection frame has been seen yet, because it cannot recover item contents.
|
|
48
|
+
- The panel can never raise the snapshot boundary, and never sets one at all
|
|
49
|
+
when the service already gave us one.
|
|
25
50
|
|
|
26
|
-
## Channel
|
|
51
|
+
## Channel C — transport tap (last resort)
|
|
27
52
|
|
|
28
53
|
- `window.fetch` is wrapped once (`window.__dshtfbFetchPatched` guard):
|
|
29
54
|
responses are cloned; binary-ish content types (javascript/font/image) are
|
|
@@ -42,13 +67,16 @@ so future maintainers can re-validate them against newer DSH versions.
|
|
|
42
67
|
|
|
43
68
|
## Normalization
|
|
44
69
|
|
|
45
|
-
|
|
70
|
+
All channels funnel into `setSessionTodos`:
|
|
46
71
|
|
|
47
72
|
- items are filtered to `pending | in_progress | completed`;
|
|
48
73
|
- blank/whitespace contents are dropped;
|
|
49
74
|
- a signature (`status|content` joined) detects no-op updates;
|
|
50
75
|
- rendering is fully re-computed from the normalized list (no incremental DOM
|
|
51
|
-
state)
|
|
76
|
+
state);
|
|
77
|
+
- the snapshot boundary is `norm.length` for authoritative frames only — see
|
|
78
|
+
Channel A. Statistics (`done/total` on the face, the ring, the header summary)
|
|
79
|
+
count only `todos.slice(0, snapLen)`; the rest is archive.
|
|
52
80
|
|
|
53
81
|
## Stability notes
|
|
54
82
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|