dsh-todo-board 0.4.1 → 0.6.1

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 CHANGED
@@ -1,5 +1,48 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.1
4
+
5
+ - 修复:**面板上看不到待办状态**。0.6.0 加了状态推导,但只在「需要你注意」时才画标签 —— `未派发` 和 `已完成` 被有意留空(当时的理由是空勾选框和划线标题已经说明了)。实际效果是**大多数行根本没有任何状态显示**,这恰恰是状态标签要回答的问题。
6
+ - 现在**每一行都带且只带一个状态标签**:`未派发` / `已派发` / `进行中` / `已完成` / `目标会话丢失`。
7
+ - 强调程度仍然分级,所以一屏普通待办不会吵:只有 `进行中`(蓝)和悬住(红)显眼,`未派发` 稍暗,`已完成` 用绿字但不加边框。
8
+ - `已完成` 的划线仍只跟**验收**走(那是你自己勾的),所以 AI 勾完但你没验收的行会显示「已完成」但依然清晰可读。
9
+ - 排查结论记录:host 侧一切正常(重启后 `/dsh-todo-board/api` 正确返回 `state`/`lostAt`/`lostKind`/`targetAlive`),面板页脚也确认浏览器跑的是 v0.6.0 —— 所以这不是投递问题,是 0.6.0 的显示策略问题。
10
+ - `tools/check-row-guard.mjs` 增加两个变异体专门守这条:让 `pending` 或 `done` 行重新「静默」,测试必须失败(实测都能抓到)。
11
+
12
+ ## 0.6.0
13
+
14
+ - **待办状态**:host 侧从实时会话列表推导每条待办的状态,面板只在需要你注意时显示标签:
15
+ - `未派发`(无标签,▶ 可点)/ `已派发`(绿)/ `进行中`(蓝,目标会话此刻正在跑)/ `已完成`(划线)/ `目标会话丢失`(红)。
16
+ - 状态是**推导**出来的,不落盘:`进行中` 取决于 agent 的实时 status,任何文件都存不住;落盘的状态字段还会和时间戳本身漂移。
17
+ - 「悬住」的原因分门别类(`lostKind`):`目标会话丢失` / `图片被拒` / `建会话失败` / `预设解析失败` / `服务不可用`。图片被拒时不会谎称「目标会话丢失」——会话好着呢,只是模型看不了图。
18
+ - `todo_board list` 的输出同样带上「状态=」一列,`state` 也进了输出 schema。
19
+ - 修复:**目标会话丢失的待办会静默卡死**。旧代码在派发失败(找不到可接续的活动会话)时依然盖上 `dispatchedAt`,而这个戳正是调度器和回合结束钩子用来跳过一条待办的依据 —— 于是一条定时待办在源会话关闭后,会在到点时失败、被标记「已派发」、然后**永远不再重试**,界面上也不报错。现在失败**不盖**这个戳,改记 `lostAt`,并按退避自动重试(1 分钟起,逐次翻倍,上限半小时);改模式 / 换目录 / 解绑会话都会立刻清掉标记重新排队。卡住的待办也不会挡住队列后面的条目。
20
+ - 修复:**派发失败会把 host 卡死**(写测试时发现,与本 issue 无关的既存 bug)。`armTimer()` 在有待办到期时会调 `fireDue()`,而 `fireDue` 又从派发的 `.finally()` 里重新 `armTimer()`。如果一条到期的待办派发失败且**什么都没记**(既没 `dispatchedAt` 也没 `lostAt`),它就永远「到期」,重试链会**纯靠微任务自我循环**:事件循环一次都跑不到,计时器永远不触发,整个 host 冻结。已复现:200 次重试、全程不让出事件循环。现在**所有**失败路径(找不到会话、新建会话失败、preset 解析失败、图片被拒)统一走 `markLost()`,退避让重试收敛。`tools/retry-loop.mjs` 是回归守卫 —— 它会在循环复发时同步中止并报错(实测:把退避去掉后它确实失败,恢复后通过),已并入 `npm test`。
21
+ - **▶ 只在「未派发」时可点**:已派发、进行中、目标会话丢失的待办一律禁用,鼠标悬停会说明原因。重复派发只会产生重复工作,而无处可去的待办应该先改模式或换目录,而不是被塞给「当前恰好开着的」那个会话。
22
+ - 修复:新增框的「目录」一行不再让暗色的 placeholder 冒充已填好的值。旧文案 `目录:<cwd>` 看起来像「已经填好了」,实际输入框是空的(很多人第一眼都读成了默认值)。现在有可见的「目录」标签,placeholder 直接写清留空的行为(`留空 = <cwd>`),tooltip 说明这个值真正决定什么:分组、筛选、以及回合结束后谁来接续。
23
+ - `lostReason` / `lostAttempts` 随面板记录下发,面板的红标签 tooltip 会点名是哪个会话不见了、已自动重试几次。
24
+ - 修复(issue #1 第 2 条):**窗口变窄会把面板裁到屏幕外**。位置按绝对像素存在 `localStorage`,而夹紧只在拖动/缩放时执行,窗口 resize 时没有任何代码重算 —— 视口缩到存储的 `left` 以下,面板就被裁掉,且点不到(能点的东西本身在屏幕外)。现在两处都补上:
25
+ - 窗口 resize(含 `visualViewport`,覆盖浏览器缩放)时重新夹紧;
26
+ - 加载时夹紧一次,所以光刷新页面就能救回被旧会话或大显示器存歪的布局,不必手清 `localStorage`。
27
+ - 用户的**选择**与**当前渲染**分开保存:夹紧只影响显示、不落盘,所以窗口再拉宽时面板回到你放它的地方(与刷新后的结果一致),也不会因为一次缩窗就永久黏在角落。双击标题栏还原依旧有效。
28
+ - `tools/check-clamp-guard.mjs` 用变异测试确认这条守卫真的会失败:分别去掉 resize 监听与加载时夹紧,测试都必须挂(实测两者都能抓到,恢复后通过)。
29
+ - 面板:**同一个事实不再在一行里说两遍**。
30
+ - 目录只保留标题下小字里的完整路径(`目录 D:\...`),行下方的目录标签去掉了 —— 它只是把小字里的目录名又说了一遍。
31
+ - 定时反过来:只保留行下方的定时标签,小字里的「定时 / 不定时」去掉了。原标签尾部那个 `✕` 独立成一个同级小按钮(按钮不能嵌套控件)。
32
+ - 面板:**已在列表里的待办现在也能改定时**。
33
+ - 没定时的行显示 `🕓 不定时`,点一下就地展开时间选择器;已定时的行点时间标签也是同一个选择器,会带着当前时间打开,可直接改。
34
+ - `Enter` 或 ✓ 保存,`Esc` 取消;保存走和新增框完全相同的 `patch` 通路,清空即取消定时。
35
+ - `tools/check-row-guard.mjs`:对上面两条做变异测试(恢复目录标签 / 把小字里的定时加回去 / 去掉「不定时」入口 / 让保存不发请求),4 个变异体全部被抓到,且 `client.js` 逐字节还原。`npm run guard` 一次跑完两个守卫。
36
+
37
+ ## 0.5.0
38
+
39
+ - **面板可以折叠**,不用的时候只占一行:
40
+ - 标题栏的 `–` 把整板收成**一行**(不再是浮动胶囊):`TODO · 未完成数 · 下一条待办` + 待验收计数;点这一行任意位置展开,键盘 `Enter` / 空格也行。这一行按内容收窄,不撑满面板宽度。
41
+ - 面板内部三个区块各自可折叠:**新增待办**(输入框 / 图片 / 模式 / 定时 / 目录)、**待办列表**(标题带条数)、**面板**(页脚计数器 / 清理已验收 / Cordis 入口)。区块标题本身就是开关,箭头 `▾ / ▸` 表示状态。
42
+ - 折叠状态存进 `localStorage`(`dsh.todoBoard.sections.v1`),刷新后保持。
43
+ - 修复:标题栏里的按钮点不动。拖动用的 `setPointerCapture` 会把随后的 click 重定向到指针捕获元素,按钮永远收不到点击;现在标题栏上的 `pointerdown` 落在按钮上时不启动拖动。(收成一行后如果没有这个修复,会卡在收不起也展不开的状态。)
44
+ - `tools/client-smoke.mjs`:浏览器半边的自检(自带极简 React hook 运行时 + DOM stub,无需浏览器),覆盖区块折叠、一行视图的内容、以及标题栏按钮不被拖动吞掉。`npm test` 现在跑 host + client 两个 smoke。
45
+
3
46
  ## 0.4.1
4
47
 
5
48
  - 市场素材:`assets/screenshot-1.png`(整体界面)与 `assets/screenshot-2.png`(面板特写)由 `tools/capture-screenshots.mjs` 从真实运行中的 UI 渲染生成,配 `screenshots.json` 声明;README 顶部展示面板截图。
package/README.md CHANGED
@@ -55,6 +55,10 @@ dsh plugin --profile web remove dsh-todo-board
55
55
  | 自动续跑 | AI 回合结束时,把同目录下一条待办注入**当前会话**继续跑 | At turn end, inject the next task in the same directory into the **current session** |
56
56
  | 自动新会话 | AI 回合结束时,新建一个同目录会话并执行该待办 | At turn end, create a **new session** in the same directory and run the task there |
57
57
 
58
+ 新增框里的「目录」一行决定这条待办**归属哪个目录**:它决定分组标题、决定「当前目录」筛选里能否看到它,也决定回合结束后由哪个会话来接续它。**留空 = 跟随当前会话的工作目录**(该框的提示文字会写明这一点)。
59
+
60
+ The composer's 目录 field decides **which directory a task belongs to**: it drives the group heading, whether the 当前目录 filter shows it, and which session picks it up at turn end. **Empty means "follow the current session's working directory"** — which is what the field's placeholder now says, instead of showing a dim path that looks like an already-filled value.
61
+
58
62
  派发顺序 = 面板里**从上到下**的顺序。拖动行首 `⠿` 调整,顺序持久化。
59
63
 
60
64
  Dispatch order is the panel's **top-to-bottom** order. Drag the `⠿` handle to change it; the order is persisted.
@@ -65,6 +69,48 @@ A `自动新会话` task opens its session once and **binds** it to the row: lat
65
69
 
66
70
  新会话会被登记进待办目录所属的**工作区**,侧栏里和手动开的会话一样归组(不是「未分组」)。
67
71
 
72
+ ## 任务状态 / Task states
73
+
74
+ 每条待办的状态由 host 从**实时会话列表**推导(不落盘,避免与实际时间戳不一致)。**每一行都带且只带一个状态标签**,因为需要靠推断才知道的状态等于看不见:
75
+
76
+ | 状态 | 面板标签 | 含义 |
77
+ | --- | --- | --- |
78
+ | 未派发 | `未派发`(稍暗) | 还没交给任何会话;▶ 可点 |
79
+ | 已派发 | `已派发`(绿) | 已交给会话,目标会话还活着 |
80
+ | 进行中 | `进行中`(蓝) | 目标会话此刻正在跑 |
81
+ | 已完成 | `已完成`(绿字) | AI 打了左勾,或你打了右勾 |
82
+ | 目标会话丢失 | `目标会话丢失`(红) | 派发时找不到目标会话,悬住了 |
83
+
84
+ 强调程度分级,所以一屏普通待办不会吵:只有 `进行中` 和悬住的行显眼。`已完成` 的**划线**只跟验收走(那是你自己勾的),所以 AI 勾完但你没验收的行会显示「已完成」而依然清晰可读。
85
+
86
+ 「悬住」的原因不止一种,面板会按实际原因显示:`目标会话丢失`(会话不在了)、`图片被拒`(模型不接受图片——会话是好的,别冤枉它)、`建会话失败`、`预设解析失败`、`服务不可用`。悬住的行 tooltip 里会写清原因和出路。
87
+
88
+ **▶ 只能在「未派发」时点击。** 已经派发过的待办重复派发只会产生重复工作,而无处可去的待办应该先改模式或换目录,而不是被塞给"当前恰好开着的"那个会话。
89
+
90
+ Every task's state is derived host-side from the **live session list** (never persisted, so it cannot drift from the timestamps it describes). **Every row carries exactly one state chip**, because a state you have to infer is a state you cannot see:
91
+
92
+ | State | Chip | Meaning |
93
+ | --- | --- | --- |
94
+ | 未派发 pending | `未派发` (dimmed) | Never handed to a session; ▶ is live |
95
+ | 已派发 dispatched | `已派发` (green) | Handed over, target session still alive |
96
+ | 进行中 running | `进行中` (blue) | The target session is working on it right now |
97
+ | 已完成 done | `已完成` (green text) | The agent ticked it, or you verified it |
98
+ | 目标会话丢失 lost | `目标会话丢失` (red) | Dispatch found no session to land in |
99
+
100
+ Emphasis is graded, so a board of ordinary rows stays quiet: only 进行中 and a stuck row shout. The **strikethrough** stays tied to verification (your own tick), so an AI-finished row reads `已完成` while remaining legible.
101
+
102
+ A parked row is labelled by its **actual** cause — `目标会话丢失` (the session is gone), `图片被拒` (the model refuses images; the session is fine, so don't blame it), `建会话失败`, `预设解析失败`, `服务不可用`. The row's tooltip names both the cause and the way out.
103
+
104
+ **▶ only works while a task is 未派发.** Re-dispatching a task that was already handed over just duplicates work, and a task with nowhere to go should be re-targeted rather than pushed into whatever session happens to be open.
105
+
106
+ **目标会话丢失时不会静默卡死。** 派发失败**不会**盖上「已派发」的戳(那会让调度器和回合结束钩子同时跳过它,从此再也不会重试)。取而代之的是记录 `lostAt`,并按退避自动重试:首次 1 分钟后,逐次翻倍,最多半小时一次。改执行模式、换目录、解绑会话都会立刻清掉这个标记让它重新排队。卡住的待办也不会挡住队列后面的条目。
107
+
108
+ **任何派发失败都不会让 host 卡死。** 所有失败路径(找不到会话、新建会话失败、preset 解析失败、图片被拒)都记下 `lostAt` 并进入退避。这不只是为了显示好看:一条永远「到期」却又从不留下任何状态戳的待办,会让调度器的重试链纯靠微任务自我循环——事件循环一次都跑不到,整个 host 冻结。`tools/retry-loop.mjs` 是这条性质的回归守卫,已并入 `npm test`。
109
+
110
+ **A stranded task no longer dies silently.** A failed dispatch no longer stamps `dispatchedAt` — that stamp means "already sent", and both the scheduler and the turn-end hook skip on it, so stamping it retired the task forever while it never actually ran. It records `lostAt` instead and retries with backoff: one minute, then doubling, capped at half an hour. Changing the mode, the directory, or the session binding clears the marker and re-queues it immediately. A stranded row never blocks the rows behind it.
111
+
112
+ **And no dispatch failure can freeze the host.** Every failure path (no session, session creation failed, preset resolution failed, images refused) records `lostAt` and backs off. That is not just cosmetic: a row that stays permanently "due" while recording no state stamp at all makes the scheduler's retry chain re-enter through microtasks alone — the event loop never runs and the whole host freezes. `tools/retry-loop.mjs` guards that property and runs as part of `npm test`.
113
+
68
114
  ## 图片附件 / Attached images
69
115
 
70
116
  待办可以带图片(最多 4 张,PNG / JPG / WebP / GIF)。图片存进 DSH 的**附件库**,派发时作为**真正的图片**和提示词一起发给模型——不是把文件名写进文字里。
@@ -88,13 +134,17 @@ A task may carry images (up to 4; PNG / JPG / WebP / GIF). They are stored in DS
88
134
  Any task may carry a **local time** (`YYYY-MM-DDTHH:mm`, minute precision). Before that minute the task is not dispatched; when it arrives, DSH runs it in its own mode, exactly as if you had pressed ▶ at that moment.
89
135
 
90
136
  - 新增框里的「定时」一行用浏览器的时间选择器挑时间;留空 = 立即可执行。
91
- - 行上的定时标签显示时间,**已到点**会变黄;点它即取消定时。
137
+ - **列表里的待办也能改定时**:没定时的行显示 `🕓 不定时`,点一下就地展开时间选择器;已定时的行点时间标签打开同一个选择器(带着当前时间),改完 `Enter`/`✓` 保存、`Esc` 取消。标签旁的 `✕` 单独取消定时。
138
+ - 行上的定时标签显示时间,**已到点**会变黄。
139
+ - 每行只把同一件事说一遍:**目录**在标题下的小字里给完整路径(行下方的目录标签已去掉),**定时**在下方标签里(小字里的「定时 / 不定时」已去掉)。
92
140
  - `提醒` 模式到点只弹一条桌面通知(需要浏览器通知权限),不会自动给模型发消息;`自动续跑` / `自动新会话` 到点才真正派发。
93
141
  - 定时只判一次:派发过(或被提醒过)就不再重复触发。错过的时间(DSH 当时没运行)会在下次启动后立刻补上。
94
142
  - 时间用**主机本地时区**解释;面板存的就是你选的那一刻。
95
143
 
96
144
  - The composer's 定时 row uses the browser's own picker; empty means "runnable now".
97
- - The row chip shows the time and turns yellow once due; click it to clear the schedule.
145
+ - **A task already on the list can be rescheduled**: an unscheduled row shows `🕓 不定时` — click it to open a picker in place; a scheduled row opens the same picker seeded with its current time. `Enter`/`✓` saves, `Esc` cancels, and the `✕` beside the chip clears the time.
146
+ - The row chip shows the time and turns yellow once due.
147
+ - Each fact is stated once per row: the **directory** appears as a full path in the small print under the title (its chip is gone), the **schedule** lives in the chip below (its small-print duplicate is gone).
98
148
  - `提醒` mode only raises a desktop notification at that minute (browser permission required); `自动续跑` / `自动新会话` dispatch for real.
99
149
  - A time fires once: a dispatched or reminded row never fires again. A time missed while DSH was not running fires on the next start.
100
150
  - Times are interpreted in the **host machine's local zone** — the board stores the instant you picked.
@@ -112,12 +162,18 @@ Only the right-hand box closes a task. The prompt section explicitly forbids the
112
162
 
113
163
  ## 面板操作 / Panel
114
164
 
115
- - **拖动 / 缩放**:拖标题栏移动,右下角 `◢` 缩放;位置与尺寸存进 `localStorage`,刷新保留;双击标题栏或拖柄还原。
165
+ - **折叠为一行**:标题栏右侧的 `–` 把整板收成一行 —— `TODO · 未完成数 · 下一条待办 · 待验 N`,点这一行任意位置展开。平时挂着不占地方,扫一眼就知道还剩什么。
166
+ - **区块折叠**:面板内部三个区块(新增待办 / 待办列表 / 面板)各自可折叠,点区块标题切换,`▾` 展开、`▸` 已折叠。只留列表时最省空间;折叠状态记在 `localStorage`,刷新后保持。
167
+ - **拖动 / 缩放**:拖标题栏移动,右下角 `◢` 缩放;位置与尺寸存进 `localStorage`,刷新保留;双击标题栏或拖柄还原。**窗口变窄时面板会自动收回视野内**(含浏览器缩放),所以它不会被裁到屏幕外;窗口再拉宽时回到你放它的地方。就算位置是被更大的显示器存歪的,刷新一次即可恢复,不必手清 `localStorage`。
116
168
  - **筛选**:当前目录 / 当前会话 / 全部,每段带未完成计数。
117
- - **行内编辑**:双击标题改名;点模式标签在 提醒 → 续跑 → 新会话 之间循环切换。
169
+ - **行内编辑**:双击标题改名;点模式标签在 提醒 → 续跑 → 新会话 之间循环切换;点定时标签改时间(未定时的行显示 `🕓 不定时`,点它即可加上)。
118
170
  - **多行输入**:新增框自动增高(3 行起步,最高 180px),`Enter` 添加、`Shift+Enter` 换行。
119
171
  - **Cordis 入口**:侧边栏底部的 `Cordis Plugin` 按钮折起,入口移到本面板底部;点它打开原面板,面板出现在**本面板正下方**(右对齐、互不覆盖),拖动或缩放本面板时它会跟着走。找不到入口时按钮会变灰并给出提示。
120
172
 
173
+ - **Park as one line**: the `–` in the title bar collapses the whole board to a single line — `TODO · open count · next task · 待验 N`. Click anywhere on that line (or press `Enter`/`Space`) to unfold; the line hugs its content instead of spanning the panel. It stays out of the way until you need it.
174
+ - **Section folding**: the composer, the list, and the footer each fold away from their own header (`▾` open, `▸` folded); with only the list left the panel is at its smallest. The folded set is kept in `localStorage` across reloads.
175
+ - **Drag / resize**: drag the title bar to move, the `◢` corner to resize. Position and size persist in `localStorage`; double-click the title bar (or the grip) to reset. **A narrower window pulls the panel back into view automatically** (browser zoom included), so it can never be cropped off-screen, and widening returns it to where you put it. A layout stranded by a bigger monitor is recovered by a plain reload — no `localStorage` surgery.
176
+
121
177
  ## 模型工具 / The `todo_board` tool
122
178
 
123
179
  | action | 作用 |
@@ -151,6 +207,7 @@ cordis.patch.yml 向 profile 树 insert 一行 todo-board
151
207
  lib/index.js Host:板文件、todo_board 工具、回合结束钩子、提示词段落、/dsh-todo-board/api
152
208
  client/client.js Browser:shell.overlay 浮窗,走 fetch 访问上面的路由
153
209
  tools/smoke.mjs Host 半边自检(stub ctx + 临时 DSH_HOME)
210
+ tools/client-smoke.mjs Browser 半边自检(极简 React hook 运行时 + DOM stub,折叠行为)
154
211
  ```
155
212
 
156
213
  Host 半刻意不 import 任何 `@deepseek-ai/*`:profile 安装的插件从自身目录解析模块,harness 包在那里不可达,一切通过 `ctx`。
@@ -159,7 +216,7 @@ Host 半刻意不 import 任何 `@deepseek-ai/*`:profile 安装的插件从自
159
216
 
160
217
  ```sh
161
218
  npm run check # node --check 两个入口
162
- npm test # host 半边 smoke 自检
219
+ npm test # host + client 两半 smoke 自检
163
220
  ```
164
221
 
165
222
  改完客户端只需刷新页面;改 Host 半边需要重启 Profile。