dsh-todo-float-ball 0.14.6 → 0.14.10

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
@@ -1,255 +1,263 @@
1
- # dsh-todo-float-ball
2
-
3
- **Your AI agent runs long tasks — but its plan keeps scrolling out of sight. Turn it into a progress ball that never leaves the screen.**
4
- **让 AI 的任务清单常驻屏幕 —— DeepSeek Harness(DSH)进度悬浮球插件。**
5
-
6
- [![npm](https://img.shields.io/badge/npm-dsh--todo--float--ball-cb3837?logo=npm)](https://www.npmjs.com/package/dsh-todo-float-ball)
7
- [![license](https://img.shields.io/badge/license-MIT-blue)](LICENSE)
8
- [![DSH](https://img.shields.io/badge/DSH-%E2%89%A5%202.0.14-4f46e5)](https://github.com/loyalchiiina/dsh-todo-float-ball)
9
-
10
- English | [简体中文](README.zh.md)
11
-
12
- ---
13
-
14
- ## What it does · 一句话说明
15
-
16
- When you give an AI agent a multi-step job in DSH, it records the plan with the built-in `todo_write` tool. The official UI renders that plan as a thin strip above the input box — **but the strip is easy to miss, scrolls away with the conversation, and folds itself while the agent is still working.** You end up hunting through the transcript to answer "how far along is it?"
17
-
18
- **dsh-todo-float-ball** moves that checklist onto a persistent floating ball:
19
-
20
- | The problem | What this plugin does |
21
- |---|---|
22
- | The plan strip scrolls away; progress is invisible | A ball **pinned to a window corner** (bottom-right by default; draggable, position remembered across restarts) |
23
- | You must expand a panel to see "how many are done" | The ball face shows **`done/total`** directly, with a progress ring |
24
- | You can't tell which item the agent is on right now | **The active task's name** appears on the ball; capsule mode shows only that line |
25
- | Several sessions running — you keep switching to check each | **Pin multiple sessions and the panel shows their progress side by side**, so parallel work is visible at a glance |
26
- | Hard to tell finished from unfinished | **Status colour at a glance**: pulsing orange = working, green = all done, blue = pending only, gray = no list |
27
- | Want to look back at previously planned tasks | **History archive**: when a new plan replaces the old one, the old tasks fold into a "history" section instead of vanishing |
28
- | The ball blocks your view | Hide it, collapse it to a capsule, or drag it — with per-session memory |
29
-
30
- **It is a pure, read-only companion**: the plugin never modifies the official panel, the conversation, or any other plugin.
31
-
32
- ## Why it matters · 为什么值得装
33
-
34
- - **Built for long unattended runs** — DSH agents continue across many turns; you may not look at the screen for ten minutes. The orange glow and `3/8` tell you at a glance that work is still moving, and how far.
35
- - **Parallel sessions stop being guesswork** — pinning side-by-side columns puts two conversations' progress in one panel; no more clicking back and forth.
36
- - **Visually consistent with its siblings** — shares one **128-skin** catalogue with the `dsh-skill-browser` and `dsh-font-enhancer` balls (plus the 6 classic skins kept as a separate "legacy" group), so all three switch together and match.
37
- - **One codebase, two targets** — identical behaviour on Desktop (Electron) and the web UI.
38
- - **Zero intrusion, zero config** — install and it works; no config files, no changes to the official UI. `Shadow DOM + all:initial` keeps styles isolated, so it cannot clash with your theme or skin plugins.
39
- - **Reliable data** — three-tier sync: the runtime's `sessions` service (authoritative projection) drives the ball; a debounced `MutationObserver` on the official todo panel and a passive transport tap are fallbacks that only speak when the service has produced nothing for that session. **Even when the official strip is collapsed — or unrendered — the ball still has the full list.**
40
-
41
- ## Screenshots
42
-
43
- ### Pinned sessions — side-by-side task progress
44
-
45
- Pin two conversations and the panel shows both progress columns at once, so you can watch parallel work without switching sessions.
46
-
47
- ![Pinned sessions: dual conversation task progress](docs/images/preview-pinned-sessions.jpg)
48
-
49
- ![Pinned sessions: another pair of conversations](docs/images/preview-pinned-sessions-2.jpg)
50
-
51
- ### Capsule mode
52
-
53
- Right-click the ball to collapse it into a slim capsule that shows the running task and the `done/total` count — ideal when screen space is tight.
54
-
55
- ![Capsule mode](docs/images/preview-capsule.jpg)
56
-
57
- ### Skins
58
-
59
- 128 built-in skins (plus a separate "legacy" group holding the 6 pre-catalog skins), shared with the sibling skill-browser / font-enhancer balls so all three stay visually consistent. Groups: 招牌特效 28 / 浓郁深底 38 / 尘埃灰调 20 / 柔光深底 15 / 中性点缀 10 / 浅色纸面 17.
60
-
61
- ![Skin catalog](docs/images/preview-skins.png)
62
-
63
- ## Basic usage · 基本用法
64
-
65
- - **The ball** sits in a window corner at all times (default: bottom-right).
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.
71
-
72
- It is a pure, read-only companion: the plugin never modifies the official panel, the conversation, or any other plugin.
73
-
74
- ## 功能总览 · At a glance(中英对照 / Bilingual)
75
-
76
- ### Floating ball · 悬浮球
77
-
78
- | 中文 | English |
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) |
84
-
85
- ### Panel & data · 面板与数据
86
-
87
- | 中文 | English |
88
- |---|---|
89
- | 点球折叠/展开面板,靠屏幕边缘自动翻侧 | Click to fold/expand; the panel flips sides near the screen edge |
90
- | 三路数据同步:**主** = 运行时 `sessions` 服务的权威投影帧;**兜底 1** = MutationObserver 抓官方 todo 面板;**兜底 2** = 被动拦截传输帧。兜底仅在权威通道对该会话尚无数据时才发言,官方面板折叠时也有完整清单 | Three-tier sync: **primary** = the runtime `sessions` service (authoritative projection); **fallback 1** = DOM observer on the official panel; **fallback 2** = passive transport tap. Fallbacks only speak while the authoritative channel has produced nothing for that session — full list even when the strip is collapsed |
91
- | Shadow DOM + `all:initial` 样式隔离,不进不出,主题/皮肤插件互不干扰 | Shadow DOM with `all:initial` — no style leaks in or out, immune to theme/skin plugins |
92
- | 桌面端(Electron)与网页端同一份代码双端可用 | One codebase for Desktop (Electron) and the web UI |
93
-
94
- ### History & pinned sessions · 历史与固定会话
95
-
96
- | 中文 | English |
97
- |---|---|
98
- | 快照合并不再冲掉旧任务——旧任务进入历史归档区 | Snapshots merge instead of replacing — older todos become a history archive |
99
- | **球上的数字只反映当前这一轮**(与官方进度条同口径),历史不会把分母撑大 | **The number on the ball covers the current round only** (same basis as the official strip); history never inflates the denominator |
100
- | **展开清单分两段**:上面是可折叠的历史(已完成历史 / 被抛弃的历史任务),中间一道分界线 `── 当前进度 · 5/10 完成 ──`,下面才是当前轮的任务 | **The expanded list has two sections**: collapsible history on top, a divider `── Current · 5/10 done ──` in the middle, the current round's todos below |
101
- | 行级 ✕ 隐藏、两个独立折叠行、🧹 批量清理、♻️ 一键恢复、📋 整行复制 | Per-row ✕ hide, two independent fold rows, 🧹 batch cleanup, ♻️ one-click restore, 📋 full-text copy |
102
- | 📌 固定会话与当前对话共用同一历史渲染器,状态按会话独立 | 📌 Pinned sessions render through the same history renderer, with per-session state |
103
- | ⇄ 布局切换:上下堆叠 ⇄ 左右并排(左当前列表、右固定会话,带列标题) | ⇄ layout switch: stacked ⇄ side-by-side (current + pinned columns with captions) |
104
-
105
- ### Discipline injection · 纪律注入
106
-
107
- | 中文 | English |
108
- |---|---|
109
- | 宿主端向每次会话系统提示注入 todo 纪律段(order=190,6 条规则,实测 498 字符)——装上插件即生效,无需加载技能 | Host injects a stable todo-discipline section (order=190, 6 rules, 498 chars measured) into every session — works the moment the plugin is installed |
110
- | 硬门:每轮首个工具调用若不是 todo_write 会被拒绝并提示补写(可用 `enforceFirstTodoWrite: false` 关闭) | Hard gate: the first tool call of each turn must be `todo_write` or it is denied (disable with `enforceFirstTodoWrite: false`) |
111
- | 只有显式布尔 `false` 才关闭;`"false"`/`0`/缺 config 均保持开启 | Only an explicit boolean `false` disables it; `"false"`/`0`/missing config keep it ON |
112
-
113
- ### Skins & privacy · 皮肤与隐私
114
-
115
- | 中文 | English |
116
- |---|---|
117
- | 三球共享 128 款皮肤目录(含 6 款经典旧皮肤),任一处切换全同步 | Shares the 128-skin catalogue across the three balls (6 classic skins kept), synced everywhere |
118
- | 零遥测、零数据上传,仅一条本机回环健康路由 | Zero telemetry, zero data upload — just a loopback-only health route |
119
-
120
- ## Features
121
-
122
- | Feature | Detail |
123
- |---|---|
124
- | 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) |
125
- | Live progress | `done/total` on the ball face plus the first active task's content (truncated), updated in real time |
126
- | 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 |
127
- | Status colors | Per-item icons and colors: ✓ completed (green, strikethrough), ▶ in progress (orange), ○ pending (dashed gray); ball itself: orange pulse / green / blue / idle gray |
128
- | Data sync (3 tiers) | **Primary**: `ctx.sessions.list.subscribe` — the runtime's authoritative `todos` projection, plus a 2 s pull as a safety net. **Fallback 1**: a debounced `MutationObserver` over `[data-testid="todo-panel"]`. **Fallback 2**: a passive tap on `window.fetch` and `WebSocket.onmessage` that only reacts to projection-shaped frames. Fallbacks are gated by `hasPrimaryData()` and stay silent once the service has spoken for a session |
129
- | 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 |
130
- | 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 |
131
- | Privacy-friendly | Zero telemetry, zero data upload. The only host-side surface is a loopback-only health route (`/dsh-todo-float-ball/health`) |
132
- | **Discipline injection (v0.9.0)** | The host injects a 6-rule todo discipline (498 chars measured, `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` |
133
- | **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 |
134
- | **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 |
135
-
136
- ## Pinned sessions & panel layout (v0.11.0)
137
-
138
- - **One renderer, two lists** — the current conversation and every pinned (📌)
139
- conversation are rendered by the same `historySectionHtml()` function: latest
140
- snapshot flat, then `▾ Completed history (N)` and
141
- `▸ Abandoned history tasks (M)`, each fold with its own 🧹, plus
142
- `🧹 Clear all history` and `♻️ Restore all hidden history`. Pinned panels got
143
- the last two rows for the first time in this release.
144
- - **Per-session state** — fold open/closed and hidden rows are keyed by session
145
- id, so expanding or cleaning one conversation never moves another one; every
146
- control carries the id of the list it was rendered for (`data-ownsid`).
147
- - **Stable snapshot boundary** — the snapshot/history split is taken on the raw
148
- list and the hidden-row filter is applied afterwards, so hiding a snapshot row
149
- can no longer drag an archived row into the live area or shift a fold count.
150
- - **⇄ layout switch** — stacked (current list above, pinned below) or
151
- side-by-side (left current, right pinned). The preference is stored in
152
- `localStorage["dsh-todo-float-ball-layout"]` and restored on load.
153
- - **Column captions** — in side-by-side mode the left column is captioned with
154
- the current conversation title and the right one with `📌 固定会话`; in stacked
155
- mode the captions stay hidden and nothing about the old layout changes.
156
-
157
-
158
- ## History & panel management (v0.10.0)
159
-
160
- A plan is rewritten many times during a long task. From v0.10.0 the panel keeps
161
- the **latest snapshot** as the live list and archives everything older instead
162
- of discarding it:
163
-
164
- - **Merge, not replace** — a fresh snapshot updates the leading `snapLen` rows
165
- of the session bucket; previous items that are not part of the new snapshot
166
- are appended after it, so old tasks never disappear.
167
- - **Statistics mean "the current plan"** — the ball face (`done/total`), the
168
- progress ring, the header summary and the "N items left" notice count only
169
- the latest snapshot (`snapshotList()`); history is a pure archive.
170
- - **Per-row hide (✕)** — hover a history row and click ✕ to hide it. Hidden
171
- rows live in `localStorage` (`dsh-todo-float-ball-hidden-v1`, per session);
172
- the data layer is untouched. Pinned (📌) sessions hide rows independently —
173
- a hidden row in session A can never hide a row in session B (`data-ownsid`).
174
- - **Two fold rows** — `▾ Completed history (N)` and `▸ Abandoned history
175
- tasks (M)` are independent collapsible rows (collapsed by default); the
176
- latest snapshot always renders fully expanded.
177
- - **Batch cleanup (🧹)** — each fold row has a 🧹 button to clear that fold,
178
- plus a `🧹 Clear all history (X)` row that hides both folds at once.
179
- - **One-click restore (♻️)** — `♻️ Restore all hidden history (X)` appears
180
- only while something is hidden and unhides everything in the session.
181
- - **Row copy (📋)** — copies the *full* task text (not the 80-char display
182
- truncation), with a real ✓/⚠ feedback.
183
-
184
- ## Discipline injection (v0.9.0)
185
-
186
- 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.
187
-
188
- - **ON by default** (no `config` row means ON).
189
- - 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**.
190
- - Only an explicit boolean `false` disables it; `"false"` / `0` / typos / a missing `config` all keep it ON (guards against accidental shutdown).
191
- - 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.
192
-
193
- ## Install
194
-
195
- The plugin is a standard DSH npm package (`dsh.bundle` self-declared). Two ways:
196
-
197
- ### From npm (when published)
198
-
199
- ```bash
200
- npm install dsh-todo-float-ball
201
- ```
202
-
203
- Then add `"dsh-todo-float-ball"` to both `dependencies` and `dsh.profile.bundles` in your profile's `package.json` (e.g. `%USERPROFILE%\.dsh\profiles\desktop\package.json`), and restart DSH.
204
-
205
- ### Manual
206
-
207
- Copy this package folder into your profile's `node_modules` (a real copy — do **not** use `link:` / `file:` dependencies, they can trigger DSH's install-recovery loop), then register it the same way and restart.
208
-
209
- After the restart you should see the ball in the bottom-right corner. Verify the host half with:
210
-
211
- ```
212
- http://127.0.0.1:<your DSH port>/dsh-todo-float-ball/health
213
- → {"ok":true,"plugin":"dsh-todo-float-ball","version":"<the installed package.json version>"}
214
- ```
215
-
216
- **Use your actual port.** DSH Desktop defaults to `port: 0` (a fresh random port on every restart), so there is no fixed number to hardcode. Read it from the address bar of the DSH window, or pin it by setting `port` in `%USERPROFILE%\.dsh\desktop-preferences.json`. A fixed `43120` only applies if you set it yourself. The route is also loopback-only and refuses any non-renderer request with `403 Browser access is disabled`, so `curl` will not work unless you enable `browserAccess`.
217
-
218
- ## How it works
219
-
220
- The official todo data is a **session projection**:
221
-
222
- 1. `@deepseek-ai/dsh-tool-todo` registers the `todo_write` tool and a `todos` projection unit on `sessionProjections`; every call appends a `todo/write` snapshot to the session log.
223
- 2. `@deepseek-ai/dsh-client-connection` broadcasts the current value as a control frame: `{type:"projection", sessionId, key:"todos", value:[{content,status}...]}`.
224
- 3. `@deepseek-ai/dsh-client-ui-conversation` renders it as the plan strip above the input box (`[data-testid="todo-panel"]`).
225
-
226
- This plugin reads from all three surfaces without touching any of them, in strict priority order:
227
-
228
- - **Primary — `sessions` service**: the client half declares `inject: ["sessions"]` and subscribes to the runtime's global session registry (`ctx.sessions.list.subscribe`, with a 2 s pull as a safety net in case a callback stops firing after a shell rebuild). This channel is authoritative: it is the whole list, it carries history, and it wins every disagreement.
229
- - **Fallback 1 — DOM panel**: a debounced (200 ms) `MutationObserver` watches `[data-testid="todo-panel"]`, reads `li[data-status]` items when the strip is expanded, and parses the localized count label (e.g. "1 完成 · 2 进行中") when it is collapsed. It returns immediately whenever `hasPrimaryData()` says the service has already spoken for that session — otherwise the two channels would alternate on every observer tick and the ball would flicker.
230
- - **Fallback 2 — transport tap**: a one-time, defensive wrapper around `window.fetch` (cloning responses, text/json only) and `WebSocket.prototype.onmessage` (text frames) feeds every payload through a strict extractor that only reacts to objects shaped like projection frames, `todo/write` events, or `{todos:[...]}` snapshots. Malformed payloads are ignored; nothing is ever written back.
231
-
232
- All channels funnel into one normalizer: items are filtered to the three known statuses, blank contents are dropped, and unchanged lists are no-ops (cheap signature comparison). The **snapshot boundary** is taken from the authoritative frame length — `todo_write` replaces the whole list, so that frame *is* the live plan and everything merged in behind it is archive. That single rule is what keeps `done/total` matching the official panel; the pre-0.14.6 code used a monotonic high-water mark that could never shrink and drifted further off with every round.
233
-
234
- ## FAQ
235
-
236
- **The ball doesn't show up.**
237
- Check the health URL above; if it responds, the host half is fine — the client bundle may have been blocked (look for `loaded without registering` in DSH logs; the bundle id must equal the package name). If it doesn't respond, the plugin isn't in your profile's bundles list.
238
-
239
- **Can I move the ball?**
240
- Yes — drag it anywhere. The position persists per browser/renderer profile. If a saved position somehow lands off-screen, the plugin clamps it back into the viewport on startup.
241
-
242
- **Does it work while the official strip is collapsed?**
243
- 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.
244
-
245
- **Does it slow the UI down?**
246
- No. The observer is debounced (200 ms), the transport tap only string-scans for `"todos"` before parsing, and the ball-respawn watchdog gives up after 300 × 2 s = 10 minutes (the visibility/sync poll is deliberately kept alive, because it is also how a skin switched from a sibling plugin reaches this ball).
247
-
248
- ## Compatibility
249
-
250
- - DSH Desktop 2.x (desktop profile) and DSH web (web profile)
251
- - No `peerDependencies` — the plugin is self-contained and talks to DSH only through public DOM/HTTP surfaces
252
-
253
- ## License
254
-
255
- MIT
1
+ # dsh-todo-float-ball
2
+
3
+ > **功能描述**:强制每个 turn 先写 todo 清单并整表覆盖式重写,已完成项保留不删。悬浮球可看完整历史,含被插话打断后丢失的安排,干了什么、什么没干一目了然。适配 DSH 内核 0.2.2-rc.1。
4
+ >
5
+ > **English**: Forces a todo list at the start of every turn and rewrites it in full each time, so finished items stay listed instead of being replaced. The floating ball shows the complete history, including plans that were lost when you cut in mid-turn, so what got done and what got dropped is always clear. Adapts DSH kernel 0.2.2-rc.1.
6
+
7
+
8
+ **AI 在跑长任务,计划清单却总在眼前消失?把它变成一颗常驻桌面的进度球。**
9
+
10
+ 把 DeepSeek Harness(DSH)的任务清单搬到桌面右下角的一颗悬浮球上:`已完成/总数` 常驻可见、当前进行中的任务名直接写在球面上,还能拖、能缩成胶囊、能换 130 款皮肤。
11
+
12
+ [![npm](https://img.shields.io/badge/npm-dsh--todo--float--ball-cb3837?logo=npm)](https://www.npmjs.com/package/dsh-todo-float-ball)
13
+ [![license](https://img.shields.io/badge/license-MIT-blue)](LICENSE)
14
+ [![DSH](https://img.shields.io/badge/DSH-%E2%89%A5%200.1.7--rc.1-4f46e5)](https://github.com/loyalchiiina/dsh-todo-float-ball)
15
+
16
+ [English](README-en.md) | 简体中文
17
+
18
+ ---
19
+
20
+ ## 效果图
21
+
22
+ ### 皮肤菜单 + 悬浮球
23
+
24
+ 130 款皮肤分 8 组,菜单首行是「三球皮肤同步」开关,第二行是「0 · 随系统 · 深/浅自动」。
25
+
26
+ ![皮肤菜单与悬浮球](docs/images/skin-and-ball.png)
27
+
28
+ ### 胶囊态 + 面板展开
29
+
30
+ 右键球体收起为横向胶囊(进度条 + 当前任务名);单击展开完整任务面板,进行中的那一项带旋转描边环。
31
+
32
+ ![胶囊态与面板展开](docs/images/capsule-and-panel.png)
33
+
34
+ ### 设置页「悬浮球导航」
35
+
36
+ 设置页里的共用分区:三球显隐、皮肤下拉、◎ 回到右下角、作者插件清单。
37
+
38
+ ![设置页悬浮球导航](docs/images/settings-ballnav.png)
39
+
40
+ ---
41
+
42
+ ## 一句话说明
43
+
44
+ DSH 里让 AI 干活时,它会用内置的 `todo_write` 记一份任务清单。官方界面把这份清单渲染成输入框上方的一小条——**但那一小条很容易被忽略、会随对话滚走、助手还在干活时它就已经折叠了**。你被迫反复翻对话找"现在到底做到哪一步了"。
45
+
46
+ **dsh-todo-float-ball 把这份清单搬到一颗常驻悬浮球上:**
47
+
48
+ | 你遇到的 | 这个插件怎么解决 |
49
+ |---|---|
50
+ | 计划条随对话滚走,找不到进度 | 球**常驻桌面右下角**(可拖拽,位置跨重启记忆,拖出屏幕自动拉回) |
51
+ | 想知道"几项做完了",得展开细看 | 球面**直接显示 `已完成/总数`**,外圈进度环同步可视化 |
52
+ | 不知道助手当前在忙哪一项 | 球面显示**当前进行中任务的名称**;胶囊态只显示这一行 |
53
+ | 屏幕空间紧张,球占地方 | 右键切成**横向胶囊**:一条进度条 + 任务名 |
54
+ | 同时跑多个会话,来回切换看进度 | **固定多个会话,面板并排显示多栏进度**,一屏看住所有并行任务 |
55
+ | 任务做完没做完,颜色分不清 | **状态色一眼可读**:橙脉动=进行中 / 绿=全部完成 / 蓝=只有待办 / 灰=暂无清单 |
56
+ | 想回看之前排过的任务 | **历史归档**:新计划覆盖旧计划时,旧任务自动折叠进"已完成历史 / 被抛弃历史",不会凭空消失 |
57
+ | 皮肤看腻了 / 和别的插件风格不搭 | **130 款皮肤**(官方主题 / 招牌特效 / 克制精选 + 5 组配色),三球可同步可独立 |
58
+ | 浅色皮肤上白字看不清 | **强制字色**:自动 / 黑 / 白一键切,官方皮肤下自动锁定 |
59
+
60
+ **它只是一个只读的观察者**:插件从不修改官方面板、不改对话内容、不干扰其他插件。
61
+
62
+ ## 为什么值得装
63
+
64
+ - **专治"长任务失联"** —— DSH 的 AI 会自动续跑很多轮,你可能十几分钟不看屏幕。球上的橙灯和 `3/8` 让你一眼就知道**还在跑、跑到哪了**。
65
+ - **多会话并行不再瞎猜** —— 固定标签把两栏进度并排摆在同一个面板里,不用左点右点来回切。
66
+ - **三球视觉统一** —— 与姊妹插件 `dsh-skill-browser`、`dsh-font-enhancer` 共用同一套 **130 款皮肤**目录,三个球可以一起换肤、风格一致,也可以让某个球独立。
67
+ - **双端同一份代码** —— 桌面端(Electron)和网页端行为一致。
68
+ - **零侵入零配置** —— 装上即用,不写配置文件也不改官方 UI;`Shadow DOM + all:initial` 做样式隔离,与你其他主题/皮肤插件互不干扰。
69
+ - **数据来源可靠** —— 三路同步:**主** = 运行时 `sessions` 服务的权威投影帧;**兜底 1** = 官方 todo 面板的 DOM 观察;**兜底 2** = 传输帧被动拦截。兜底只在权威通道对该会话尚无数据时才发言。**官方那一条折叠了、甚至没渲染,球上依然是完整清单**。
70
+
71
+ ---
72
+
73
+ ## 功能详解
74
+
75
+ ### 悬浮球与胶囊态
76
+
77
+ - **圆形悬浮球**常驻窗口右下角(默认 `right:18px; bottom:18px`),随时可见。
78
+ - 球面实时显示 **`已完成/总数`**,下方一行是**当前进行中任务的名称**(超长自动截断)。
79
+ - **外圈进度环**用同一比例可视化进度(`conic-gradient` + 百分比遮罩),与球面数字同源。
80
+ - **状态色**:橙色脉动 = 正在干活 / 绿色 = 全部完成 / 蓝色 = 只有待办 / 灰色 = 暂无清单。
81
+ - **可拖动**:按住拖到任意位置,坐标按 profile 存 `localStorage`,重启后恢复;**保存的坐标跑到屏幕外时会自动拉回视口内**(防"球丢了")。
82
+ - **胶囊态**:右键球体在【圆形球】与【横向胶囊】之间切换。胶囊是一条横向进度条 + 任务名 + `已完成/总数`,屏幕空间紧张时用。
83
+ - **点击**展开完整任务面板;**再点一下**(或按 `Esc`)收起。
84
+
85
+ ### 任务面板
86
+
87
+ - **任务清单**:每项带状态图标与配色——✓ 已完成(绿色 + 删除线)、▶ 进行中(橙色)、○ 待办(灰色虚线圈)。
88
+ - **进行中旋转描边环**:正在执行的那一项外圈有一道绕行描边(`@property --tfb-spin` + `tfbBorderSpin`),一眼看出"就是这条在跑"。
89
+ - **已完成历史折叠**:`▾ 已完成 · N`,默认收起,点标题展开。
90
+ - **被抛弃历史折叠**:`▸ 已抛弃 · N`,被新计划替换掉的未完成任务收在这里。
91
+ - **分界线**:历史区与当前轮清单之间有一道 `── 当前进度 · 5/10 完成 ──` 分界线(两侧渐隐细线 + 圆角胶囊标签,两套皮肤各自配色,`pointer-events:none` 不挡点击),把"历史贡献"和"官方最新清单"在视觉上一刀切开。
92
+ - **行级 ✕ 隐藏**、**🧹 一键隐藏本区**、**↩︎ 恢复已隐藏的 N 条**、**📋 整行复制**(复制完整文本,非显示截断)。
93
+ - **📌 固定会话**:把别的会话也钉到面板里,与当前对话走**同一个渲染器**,折叠开合与隐藏记录**按会话隔离**。
94
+ - **⇄ 布局切换**:上下堆叠 ⇄ 左右并排,偏好写 `localStorage`,下次打开自动恢复;左右并排时带列标题。
95
+
96
+ ### 皮肤:130 款,8 组
97
+
98
+ 皮肤菜单(标题栏 🎨 按钮)分组与数量(实测目录,显示序号 1..130 连续):
99
+
100
+ | 分组 | 数量 | 说明 |
101
+ |---|---|---|
102
+ | 官方主题 | 2 | **1 · 官方深色** / **2 · 官方浅色**,与 DSH 界面同色系 |
103
+ | 招牌特效 | 20 | 曜石极光、赛博机能、全息幻彩……自带外圈光带与旋转描边、呼吸动画 |
104
+ | 克制精选 | 8 | 墨玉、石墨极简、暮蓝……静态、安静、不抢眼 |
105
+ | 浓郁深底 | 38 | 高饱和深色底 |
106
+ | 尘埃灰调 | 20 | 低饱和灰调 |
107
+ | 柔光深底 | 15 | 柔和暗色 |
108
+ | 中性点缀 | 10 | 中性色 + 一点强调色 |
109
+ | 浅色纸面 | 17 | 浅色底,适合白天 |
110
+
111
+ - **0 · 随系统 · 深/浅自动**:菜单第二行。跟随 `prefers-color-scheme`,系统切深浅色时球和面板实时跟着切(解析到「官方深色」或「官方浅色」)。
112
+ - **三球皮肤同步**:菜单第一行的勾选行。**勾选 = 跟随全局皮肤**(三球同款,改一个三个一起变);**不勾 = 本球独立皮肤**,只影响 Todo 球,全局换肤不动它。
113
+ - **招牌特效类皮肤自带外圈光带**(底部 `radial-gradient` 光带 + 旋转描边),随皮肤自动出现或消失,**没有单独的开关**——换皮肤就是开关。
114
+
115
+ ### 强制字色
116
+
117
+ 标题栏的 ◐ 按钮循环切换 **自动 → 黑 → 白**,作用于**面板内外所有文字**(球面标签、任务行、折叠行、提示语),解决浅色皮肤白字看不清 / 深色皮肤黑字看不清。
118
+
119
+ - **自动**:跟随皮肤自带的文字色。
120
+ - **官方皮肤下自动锁定**:选到 **1 · 官方深色**、**2 · 官方浅色**,或选「0 · 随系统」解析到官方皮肤时,字色由皮肤强制决定(深色皮肤 → 白字、浅色皮肤 → 黑字),按钮呈锁定态、点击不再切换——官方皮肤本身就带正确的对比度,不需要也不允许手动覆盖。
121
+
122
+ ### 拖到屏幕顶部也不丢
123
+
124
+ DSH 桌面端窗口顶部约 40px 是窗口拖拽带(Electron 的 `app-region: drag`)。球和面板都写了:
125
+
126
+ ```css
127
+ .tfb-ball, .tfb-panel, .tfb-theme-menu {
128
+ -webkit-app-region: no-drag;
129
+ app-region: no-drag;
130
+ }
131
+ ```
132
+
133
+ 所以**把球拖到屏幕最顶端也不会点不动、拖不动**——否则落在拖拽带上的球会被窗口拖拽逻辑吃掉所有鼠标事件,看着在、实际已经"死"了。
134
+
135
+ ### 设置页「悬浮球导航」
136
+
137
+ DSH 设置页里有一个 **「悬浮球导航」** 分区(`settings.section`,`order: 22`)。**这个分区由姊妹插件 `dsh-skill-browser` 注册**,本插件只读它写入的共享键,属于三球共用的一块面板:
138
+
139
+ - **三球显隐**:技能浏览器 / 字体插件 / **Todo 进度** 三个勾选框(没装的插件显示「(未安装)」且置灰)。
140
+ - **皮肤下拉**:`0 · 跟随系统 · 深/浅自动` + 8 个分组的全部皮肤,等价于三球同步时的全局皮肤。
141
+ - **◎ 回到右下角**:一键把球归位。
142
+ - **作者插件**:12 个插件清单(名字 + 一句话描述 + ⭐ 链接)。
143
+
144
+ > 装了这一组插件里任意一个,这个分区就会出现;只装 Todo 球而没有 `dsh-skill-browser` 时,用球自己的标题栏按钮(◎ 归位、🎨 皮肤)做同样的事。
145
+
146
+ ### 标题栏按钮(全部黑白线性图标)
147
+
148
+ 面板标题栏那排按钮都是 `stroke: currentColor` 的线性 SVG,跟着字色走,不用 emoji:
149
+
150
+ | 图标 | 动作 |
151
+ |---|---|
152
+ | ⇄ | 切换面板布局:上下堆叠 / 左右并排 |
153
+ | 📌(线性) | 固定 / 取消固定当前会话 |
154
+ | ◎ | 归位到右下角 |
155
+ | 🎨(线性调色板) | 打开皮肤菜单 |
156
+ | ◐ / ● / ○ | 强制字色:自动 / 黑 / 白(官方皮肤下锁定) |
157
+ | ✕ | 折叠面板 |
158
+ | ☆ | 去 GitHub 点 Star |
159
+
160
+ ## 快速上手
161
+
162
+ 1. **装上就有效果**:装好后右下角出现一颗球。没有任务时它是灰色的,显示 `✓`。
163
+ 2. **让 AI 干活**:随便让它做个多步骤任务,它会调用 `todo_write`,球面立刻变成 `0/3`、`1/3`……并显示当前那一项的名字。
164
+ 3. **点球看全清单**:单击球体展开面板,进行中的那项带旋转描边环;再点收起。
165
+ 4. **右键变胶囊**:觉得球挡视线就右键切成横向胶囊,只留一条进度条 + 任务名。
166
+ 5. **换个皮肤**:点 🎨 打开皮肤菜单。想跟另外两个球一致就勾上「三球皮肤同步」;想单独一个球漂亮就取消勾选再选。懒得选就点 `0 · 随系统 · 深/浅自动`。
167
+ 6. **字看不清就调**:点 ◐ 在 自动 → 黑 → 白 之间切。(官方皮肤下这个按钮会锁定,是正常行为。)
168
+ 7. **拖到哪都行**:按住球拖到顺手的位置,位置会记住;拖到屏幕顶端也不会失效。想归位就点 ◎。
169
+
170
+ ## 基本用法
171
+
172
+ - **悬浮球**始终固定在窗口角落(默认右下角)。
173
+ - **球面**实时显示 `已完成/总数`,下方显示当前进行中的任务名;外圈进度环同步可视化同一比例。
174
+ - **单击**展开完整任务面板;**再点一下**(或按 `Esc`)收起。
175
+ - **右键**切换到胶囊模式。
176
+ - **拖拽**到任意位置,按 profile 记忆坐标;拖出屏幕会自动拉回。
177
+ - **颜色**一眼看状态:橙色脉动 = 正在干活,绿色 = 全部完成,蓝色 = 只有待办,灰色 = 暂无清单。
178
+
179
+ ## 安装
180
+
181
+ ### 从 DSH 插件市场安装(推荐)
182
+
183
+ 在 DSH 的插件市场里搜索 **`dsh-todo-float-ball`** 或 **`Todo 进度球`**,点安装后重启 DSH。
184
+
185
+ ### 从 npm 安装
186
+
187
+ ```bash
188
+ npm install dsh-todo-float-ball
189
+ ```
190
+
191
+ 然后在你所用 profile 的 `package.json`(如 `%USERPROFILE%\.dsh\profiles\desktop\package.json`)里,把 `"dsh-todo-float-ball"` 同时加进 `dependencies` 和 `dsh.profile.bundles`,重启 DSH 生效。
192
+
193
+ ### 手动安装
194
+
195
+ 把本包目录整体复制进 profile 的 `node_modules`(必须是真实目录复制——**不要**用 `link:` / `file:` 依赖,会触发 DSH 安装恢复死循环),按上面同样方式注册后重启。
196
+
197
+ 重启后右下角应出现悬浮球。可用下面的地址验证宿主端已挂载:
198
+
199
+ ```
200
+ http://127.0.0.1:<你当前的 DSH 端口>/dsh-todo-float-ball/health
201
+ → {"ok":true,"plugin":"dsh-todo-float-ball","version":"<已安装 package.json 里的版本号>"}
202
+ ```
203
+
204
+ **端口要填你自己的。** DSH 桌面端默认 `port: 0`(每次重启换一个随机端口),没有固定值可抄。可从 DSH 窗口地址栏读取,或在 `%USERPROFILE%\.dsh\desktop-preferences.json` 里把 `port` 固定下来。该路由还只接受本机渲染进程的请求,其他请求一律回 `403 Browser access is disabled`,所以除非你打开 `browserAccess`,`curl` 是拿不到的。
205
+
206
+ ## 适配版本
207
+
208
+ - DSH 内核(`@deepseek-ai/dsh`):**0.2.1-rc.3**(`package.json` 的 `engines.dsh` 已声明 `>=0.1.7-rc.1`)
209
+ - DSH 桌面端:**2.0.20-next**(DSH NEXT)
210
+ - Node.js:`^22.19.0 || >=24.0.0`
211
+ - 已在上述版本实测通过;低版本 `0.1.7-rc.1` 及以上兼容。
212
+
213
+ ## 实现原理
214
+
215
+ 官方的 todo 数据是一条**会话投影(session projection)**:
216
+
217
+ 1. `@deepseek-ai/dsh-tool-todo` 注册 `todo_write` 工具,并在 `sessionProjections` 上登记 `todos` 投影单元;每次调用向会话日志追加一条 `todo/write` 快照;
218
+ 2. `@deepseek-ai/dsh-client-connection` 把当前值以控制帧广播:`{type:"projection", sessionId, key:"todos", value:[{content,status}...]}`;
219
+ 3. `@deepseek-ai/dsh-client-ui-conversation` 把它渲染成输入框上方的任务条(`[data-testid="todo-panel"]`)。
220
+
221
+ 本插件在两端各挂一个只读探针,不碰任何一端:
222
+
223
+ - **主路**:订阅运行时 `sessions` 服务的权威投影帧(另有 2 秒轮询兜底,防 shell 重建后回调失联)。
224
+ - **兜底一(DOM)**:一个带 200ms 防抖的 `MutationObserver` 盯着 `[data-testid="todo-panel"]`——面板展开时读 `li[data-status]` 全量清单;折叠时解析本地化的计数文案(如"1 完成 · 2 进行中",含中文数字解析)。
225
+ - **兜底二(传输层)**:一次性、防御式的 `window.fetch` 包装(clone 响应、只处理文本/JSON)与 `WebSocket.prototype.onmessage` 包装(文本帧),把每个载荷送进严格的提取器——只对形如投影帧、`todo/write` 事件、`{todos:[...]}` 快照的对象起反应,其余一律忽略,绝不回写。
226
+
227
+ 所有通道汇入同一个归一化器:过滤出三种合法状态、丢弃空内容、列表无变化时零开销跳过(签名比对)。兜底由 `hasPrimaryData()` 把关,权威通道有数据即静默。
228
+
229
+ **历史归档的口径**:权威通道的一帧就是当前计划的全部(`todo_write` 是整表替换),所以 `snapLen = norm.length`,其后的合并项即历史。球面计数、进度环、头部汇总只统计**最新快照**,历史是纯档案、不进任何计数。
230
+
231
+ ## 常见问题
232
+
233
+ **悬浮球不出现?**
234
+ 先开上面的 health 地址:能返回说明宿主端正常,是客户端 bundle 没加载(查 DSH 日志有无 `loaded without registering`,bundle id 必须与包名一致);不能返回说明插件没进 profile 的 bundles 列表。
235
+
236
+ **球拖到屏幕顶端就点不动了?**
237
+ 不会。球和面板都写了 `app-region: no-drag`,落在窗口拖拽带上依然可点可拖。若真遇到,请报 issue 并附 DSH 版本。
238
+
239
+ **选了官方皮肤,字色按钮点不动?**
240
+ 正常。官方皮肤(官方深色 / 官方浅色 / 随系统解析到官方皮肤)下字色由皮肤强制决定并锁定按钮,保证对比度。
241
+
242
+ **「三球皮肤同步」勾和不勾有什么区别?**
243
+ 勾选 = 跟随全局皮肤(改一个三个球一起变);不勾 = 这个球用自己的皮肤,全局换肤不影响它。
244
+
245
+ **官方面板折叠时也能同步吗?**
246
+ 能。这正是兜底存在的意义:官方面板折叠时只渲染计数文案,而投影帧始终携带完整清单。
247
+
248
+ **会拖慢界面吗?**
249
+ 不会。观察器 200ms 防抖;传输层窃听先做 `"todos"` 字符串预筛再解析;兜底看门狗跑约 10 分钟后自动停止。
250
+
251
+ ## 兼容性
252
+
253
+ - DSH 桌面端 2.x(desktop profile)与 DSH web(web profile)
254
+ - Node.js `^22.19.0 || >=24.0.0`
255
+ - 插件自包含,只通过公开 DOM/HTTP 面与 DSH 交互;皮肤目录与 `dsh-skill-browser`、`dsh-font-enhancer` 共用(可选,不装也能单独用)
256
+
257
+ ## 隐私
258
+
259
+ 零遥测、零数据上传。宿主端只注册一个仅限本机回环访问的健康检查路由(`/dsh-todo-float-ball/health`)。
260
+
261
+ ## License
262
+
263
+ MIT
Binary file
Binary file