dsh-todo-float-ball 0.14.3 → 0.14.5
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 +57 -0
- package/README-es.md +61 -0
- package/README-hi.md +61 -0
- package/README-pt.md +61 -0
- package/README-zh.md +101 -0
- package/icon.svg +11 -0
- package/lib/index.js +28 -5
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +75 -65
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,62 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.14.5 — 2026-10-18
|
|
4
|
+
|
|
5
|
+
### 修复:首工具判定 gate 的三处缺陷(合并社区 PR #1,作者 @WanchengWildMan)
|
|
6
|
+
|
|
7
|
+
本次为**宿主侧纯 bug 修复**,客户端 `lib/client.js` 与上一版逐字节一致(悬浮球与数据同步逻辑未变)。
|
|
8
|
+
|
|
9
|
+
- **缺陷① 计数卡死导致整个 turn 死锁(最严重)**
|
|
10
|
+
旧判据 `toolCallsThisTurn === 1` 命中即 `deny`,而被基准拒绝的调用**不会**回写事件流,计数永久停在 1 → 本 turn 之后**每一个**工具调用都被拒。社区实测被拒 74 次,只能新开一轮才能恢复。
|
|
11
|
+
修复:改用 `dispatchedThisTurn > 1`(只统计**已实际发出**的调用),并在检测到 `todo_write` 后立即置 `hasTodoWriteThisTurn`,补写 todo 后立刻放行。
|
|
12
|
+
|
|
13
|
+
- **缺陷② `run_code` 包装调用无法识别**
|
|
14
|
+
旧代码只认 `exec.name === "todo_write"`。当 `todo_write` 被 `run_code` 包裹执行时,`exec.name` 是 `run_code`,判定必然失败。
|
|
15
|
+
修复:新增 `callArgs.indexOf("todo_write") !== -1` 兜底,脚本内调用 `todo_write` 也能识别。
|
|
16
|
+
|
|
17
|
+
- **缺陷③ 并行批次时序不保证**
|
|
18
|
+
旧判据依赖"本 turn 已有几个 `tool/call`"的顺序,并行批次的事件到达顺序不受保证。
|
|
19
|
+
修复:判定改为"已发出 > 1 且见过工具名 且 未见 todo_write",不再依赖到达顺序。
|
|
20
|
+
|
|
21
|
+
- **新增 fail-open 保护**:本 turn 有调用但一个 `name` 都读不到(宿主事件结构变更)时**放行**,宁可漏拦也不阻塞会话。
|
|
22
|
+
|
|
23
|
+
### 实测验证(2026-10-18)
|
|
24
|
+
|
|
25
|
+
`~/.dsh/logs/desktop-next.log` 中本次运行仅出现 **1 次** deny,补写 `todo_write` 后全部后续调用正常执行;旧版为"永久卡死"。
|
|
26
|
+
|
|
27
|
+
### Fix: three defects in the first-tool gate (merges community PR #1 by @WanchengWildMan)
|
|
28
|
+
|
|
29
|
+
Host-half bug fix only — `lib/client.js` is byte-identical to the previous version.
|
|
30
|
+
|
|
31
|
+
- **Defect 1 — counter deadlock (most severe)**: `toolCallsThisTurn === 1` denied a call that never got appended back, freezing the counter at 1 and rejecting every following call in the turn (74 rejections in the reported case). Now `dispatchedThisTurn > 1` counts only calls already dispatched, and `hasTodoWriteThisTurn` unblocks as soon as a `todo_write` appears.
|
|
32
|
+
- **Defect 2 — `run_code` wrapper not recognised**: only `exec.name === "todo_write"` was matched, so a wrapped call never qualified. Now `callArgs.indexOf("todo_write") !== -1` is checked as a fallback.
|
|
33
|
+
- **Defect 3 — parallel batch ordering**: the old rule depended on arrival order of `tool/call` events, which parallel batches do not guarantee. The new rule is order-independent.
|
|
34
|
+
- **Fail-open guard added**: when a turn has calls but no readable `name` (host event shape changed), the gate allows the call instead of blocking the session.
|
|
35
|
+
|
|
36
|
+
## 0.14.4 — 2026-10-14
|
|
37
|
+
|
|
38
|
+
### 合规性改进(无功能改动)
|
|
39
|
+
|
|
40
|
+
本次为**纯元数据与文档改动,未触碰任何运行代码**(`lib/*.js` 与上一版逐字节一致):
|
|
41
|
+
|
|
42
|
+
- **包元数据**:`engines.node` 对齐 DSH 运行时(`^22.19.0 || >=24.0.0`);补 `packageManager`;`files` 白名单补上裸目录 `lib`、`locale/*.json`、`icon.svg` 与多语言 README;`exports` 补 `./locale/*.json` 与 `./icon`。
|
|
43
|
+
- **交付元数据**(官方插件契约要求):新增 `locale/en.json` 与 `locale/zh.json`(含 `meta.title` / `meta.description`),新增 `icon.svg`(插件管理器显示用图标,不再显示裸 id)。
|
|
44
|
+
- **多语言文档**:新增 `README-zh.md` 中文说明;`README-es/pt/hi.md` 标题与主 README 对齐。
|
|
45
|
+
|
|
46
|
+
以上改动使插件通过官方 `dsh-plugin-dev check` 全部检查项(`P=12 F=0 W=0`)。
|
|
47
|
+
|
|
48
|
+
### Compliance improvements (no functional changes)
|
|
49
|
+
|
|
50
|
+
This release is **metadata and documentation only — no runtime code was touched** (`lib/*.js` is byte-identical to the previous version):
|
|
51
|
+
|
|
52
|
+
- **Package metadata**: `engines.node` aligned with the DSH runtime (`^22.19.0 || >=24.0.0`); `packageManager` added; `files` allowlist now includes the bare `lib` directory, `locale/*.json`, `icon.svg` and the multi-language READMEs; `exports` gained `./locale/*.json` and `./icon`.
|
|
53
|
+
- **Display metadata** (required by the official plugin contract): added `locale/en.json` and `locale/zh.json` with `meta.title` / `meta.description`, plus `icon.svg` so the plugin manager shows a real name and icon instead of a bare id.
|
|
54
|
+
- **Multi-language docs**: added `README-zh.md`; `README-es/pt/hi.md` headings aligned with the main README.
|
|
55
|
+
|
|
56
|
+
With these changes the packages pass every official `dsh-plugin-dev check` item (`P=12 F=0 W=0`).
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
3
60
|
## 0.14.3 - 官方 DSH 兼容声明与引擎版本口径修正
|
|
4
61
|
|
|
5
62
|
依照 DeepSeek Harness **官方规范**(`packages/boot/app-boot/README.md`)修正兼容性声明。
|
package/README-es.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Todo Float Ball
|
|
2
|
+
|
|
3
|
+
> A floating task ball that keeps the live todo list on screen and injects the checklist discipline every turn.
|
|
4
|
+
|
|
5
|
+
> Full documentation: [English README](./README.md)
|
|
6
|
+
|
|
7
|
+
## What it does · 一句话说明
|
|
8
|
+
|
|
9
|
+
> 📖 [Leer esta sección en el README principal](./README.md#what-it-does-一句话说明)
|
|
10
|
+
|
|
11
|
+
## Why it matters · 为什么值得装
|
|
12
|
+
|
|
13
|
+
> 📖 [Leer esta sección en el README principal](./README.md#why-it-matters-为什么值得装)
|
|
14
|
+
|
|
15
|
+
## Screenshots
|
|
16
|
+
|
|
17
|
+
> 📖 [Leer esta sección en el README principal](./README.md#screenshots)
|
|
18
|
+
|
|
19
|
+
## Basic usage · 基本用法
|
|
20
|
+
|
|
21
|
+
> 📖 [Leer esta sección en el README principal](./README.md#basic-usage-基本用法)
|
|
22
|
+
|
|
23
|
+
## 功能总览 · At a glance(中英对照 / Bilingual)
|
|
24
|
+
|
|
25
|
+
> 📖 [Leer esta sección en el README principal](./README.md#功能总览-at-a-glance中英对照-bilingual)
|
|
26
|
+
|
|
27
|
+
## Features
|
|
28
|
+
|
|
29
|
+
> 📖 [Leer esta sección en el README principal](./README.md#features)
|
|
30
|
+
|
|
31
|
+
## Pinned sessions & panel layout (v0.11.0)
|
|
32
|
+
|
|
33
|
+
> 📖 [Leer esta sección en el README principal](./README.md#pinned-sessions-panel-layout-v0110)
|
|
34
|
+
|
|
35
|
+
## History & panel management (v0.10.0)
|
|
36
|
+
|
|
37
|
+
> 📖 [Leer esta sección en el README principal](./README.md#history-panel-management-v0100)
|
|
38
|
+
|
|
39
|
+
## Discipline injection (v0.9.0)
|
|
40
|
+
|
|
41
|
+
> 📖 [Leer esta sección en el README principal](./README.md#discipline-injection-v090)
|
|
42
|
+
|
|
43
|
+
## Install
|
|
44
|
+
|
|
45
|
+
> 📖 [Leer esta sección en el README principal](./README.md#install)
|
|
46
|
+
|
|
47
|
+
## How it works
|
|
48
|
+
|
|
49
|
+
> 📖 [Leer esta sección en el README principal](./README.md#how-it-works)
|
|
50
|
+
|
|
51
|
+
## FAQ
|
|
52
|
+
|
|
53
|
+
> 📖 [Leer esta sección en el README principal](./README.md#faq)
|
|
54
|
+
|
|
55
|
+
## Compatibility
|
|
56
|
+
|
|
57
|
+
> 📖 [Leer esta sección en el README principal](./README.md#compatibility)
|
|
58
|
+
|
|
59
|
+
## License
|
|
60
|
+
|
|
61
|
+
> 📖 [Leer esta sección en el README principal](./README.md#license)
|
package/README-hi.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Todo Float Ball
|
|
2
|
+
|
|
3
|
+
> A floating task ball that keeps the live todo list on screen and injects the checklist discipline every turn.
|
|
4
|
+
|
|
5
|
+
> Full documentation: [English README](./README.md)
|
|
6
|
+
|
|
7
|
+
## What it does · 一句话说明
|
|
8
|
+
|
|
9
|
+
> 📖 [यह अनुभाग मुख्य README में पढ़ें](./README.md#what-it-does-一句话说明)
|
|
10
|
+
|
|
11
|
+
## Why it matters · 为什么值得装
|
|
12
|
+
|
|
13
|
+
> 📖 [यह अनुभाग मुख्य README में पढ़ें](./README.md#why-it-matters-为什么值得装)
|
|
14
|
+
|
|
15
|
+
## Screenshots
|
|
16
|
+
|
|
17
|
+
> 📖 [यह अनुभाग मुख्य README में पढ़ें](./README.md#screenshots)
|
|
18
|
+
|
|
19
|
+
## Basic usage · 基本用法
|
|
20
|
+
|
|
21
|
+
> 📖 [यह अनुभाग मुख्य README में पढ़ें](./README.md#basic-usage-基本用法)
|
|
22
|
+
|
|
23
|
+
## 功能总览 · At a glance(中英对照 / Bilingual)
|
|
24
|
+
|
|
25
|
+
> 📖 [यह अनुभाग मुख्य README में पढ़ें](./README.md#功能总览-at-a-glance中英对照-bilingual)
|
|
26
|
+
|
|
27
|
+
## Features
|
|
28
|
+
|
|
29
|
+
> 📖 [यह अनुभाग मुख्य README में पढ़ें](./README.md#features)
|
|
30
|
+
|
|
31
|
+
## Pinned sessions & panel layout (v0.11.0)
|
|
32
|
+
|
|
33
|
+
> 📖 [यह अनुभाग मुख्य README में पढ़ें](./README.md#pinned-sessions-panel-layout-v0110)
|
|
34
|
+
|
|
35
|
+
## History & panel management (v0.10.0)
|
|
36
|
+
|
|
37
|
+
> 📖 [यह अनुभाग मुख्य README में पढ़ें](./README.md#history-panel-management-v0100)
|
|
38
|
+
|
|
39
|
+
## Discipline injection (v0.9.0)
|
|
40
|
+
|
|
41
|
+
> 📖 [यह अनुभाग मुख्य README में पढ़ें](./README.md#discipline-injection-v090)
|
|
42
|
+
|
|
43
|
+
## Install
|
|
44
|
+
|
|
45
|
+
> 📖 [यह अनुभाग मुख्य README में पढ़ें](./README.md#install)
|
|
46
|
+
|
|
47
|
+
## How it works
|
|
48
|
+
|
|
49
|
+
> 📖 [यह अनुभाग मुख्य README में पढ़ें](./README.md#how-it-works)
|
|
50
|
+
|
|
51
|
+
## FAQ
|
|
52
|
+
|
|
53
|
+
> 📖 [यह अनुभाग मुख्य README में पढ़ें](./README.md#faq)
|
|
54
|
+
|
|
55
|
+
## Compatibility
|
|
56
|
+
|
|
57
|
+
> 📖 [यह अनुभाग मुख्य README में पढ़ें](./README.md#compatibility)
|
|
58
|
+
|
|
59
|
+
## License
|
|
60
|
+
|
|
61
|
+
> 📖 [यह अनुभाग मुख्य README में पढ़ें](./README.md#license)
|
package/README-pt.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Todo Float Ball
|
|
2
|
+
|
|
3
|
+
> A floating task ball that keeps the live todo list on screen and injects the checklist discipline every turn.
|
|
4
|
+
|
|
5
|
+
> Full documentation: [English README](./README.md)
|
|
6
|
+
|
|
7
|
+
## What it does · 一句话说明
|
|
8
|
+
|
|
9
|
+
> 📖 [Ler esta seção no README principal](./README.md#what-it-does-一句话说明)
|
|
10
|
+
|
|
11
|
+
## Why it matters · 为什么值得装
|
|
12
|
+
|
|
13
|
+
> 📖 [Ler esta seção no README principal](./README.md#why-it-matters-为什么值得装)
|
|
14
|
+
|
|
15
|
+
## Screenshots
|
|
16
|
+
|
|
17
|
+
> 📖 [Ler esta seção no README principal](./README.md#screenshots)
|
|
18
|
+
|
|
19
|
+
## Basic usage · 基本用法
|
|
20
|
+
|
|
21
|
+
> 📖 [Ler esta seção no README principal](./README.md#basic-usage-基本用法)
|
|
22
|
+
|
|
23
|
+
## 功能总览 · At a glance(中英对照 / Bilingual)
|
|
24
|
+
|
|
25
|
+
> 📖 [Ler esta seção no README principal](./README.md#功能总览-at-a-glance中英对照-bilingual)
|
|
26
|
+
|
|
27
|
+
## Features
|
|
28
|
+
|
|
29
|
+
> 📖 [Ler esta seção no README principal](./README.md#features)
|
|
30
|
+
|
|
31
|
+
## Pinned sessions & panel layout (v0.11.0)
|
|
32
|
+
|
|
33
|
+
> 📖 [Ler esta seção no README principal](./README.md#pinned-sessions-panel-layout-v0110)
|
|
34
|
+
|
|
35
|
+
## History & panel management (v0.10.0)
|
|
36
|
+
|
|
37
|
+
> 📖 [Ler esta seção no README principal](./README.md#history-panel-management-v0100)
|
|
38
|
+
|
|
39
|
+
## Discipline injection (v0.9.0)
|
|
40
|
+
|
|
41
|
+
> 📖 [Ler esta seção no README principal](./README.md#discipline-injection-v090)
|
|
42
|
+
|
|
43
|
+
## Install
|
|
44
|
+
|
|
45
|
+
> 📖 [Ler esta seção no README principal](./README.md#install)
|
|
46
|
+
|
|
47
|
+
## How it works
|
|
48
|
+
|
|
49
|
+
> 📖 [Ler esta seção no README principal](./README.md#how-it-works)
|
|
50
|
+
|
|
51
|
+
## FAQ
|
|
52
|
+
|
|
53
|
+
> 📖 [Ler esta seção no README principal](./README.md#faq)
|
|
54
|
+
|
|
55
|
+
## Compatibility
|
|
56
|
+
|
|
57
|
+
> 📖 [Ler esta seção no README principal](./README.md#compatibility)
|
|
58
|
+
|
|
59
|
+
## License
|
|
60
|
+
|
|
61
|
+
> 📖 [Ler esta seção no README principal](./README.md#license)
|
package/README-zh.md
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# dsh-todo-float-ball
|
|
2
|
+
|
|
3
|
+
> 悬浮任务球常驻屏幕显示实时待办,并在每一轮对话注入清单纪律。
|
|
4
|
+
|
|
5
|
+
> 完整文档以 [English README](./README.md) 为准,本页提供中文导读与关键信息速查。
|
|
6
|
+
|
|
7
|
+
## What it does · 一句话说明
|
|
8
|
+
|
|
9
|
+
本节内容详见 [English README](./README.md)。
|
|
10
|
+
|
|
11
|
+
## Why it matters · 为什么值得装
|
|
12
|
+
|
|
13
|
+
本节内容详见 [English README](./README.md)。
|
|
14
|
+
|
|
15
|
+
## Screenshots
|
|
16
|
+
|
|
17
|
+
本节内容详见 [English README](./README.md)。
|
|
18
|
+
|
|
19
|
+
## Basic usage · 基本用法
|
|
20
|
+
|
|
21
|
+
本节内容详见 [English README](./README.md)。
|
|
22
|
+
|
|
23
|
+
## 功能总览 · At a glance(中英对照 / Bilingual)
|
|
24
|
+
|
|
25
|
+
### 悬浮球 · Floating ball
|
|
26
|
+
|
|
27
|
+
| 中文 | English |
|
|
28
|
+
|---|---|
|
|
29
|
+
| 常驻可拖拽悬浮球(默认右下角),位置记忆跨重启恢复,越界自动拉回 | Persistent draggable ball, position remembered, off-screen clamped back |
|
|
30
|
+
| 球面实时 `完成数/总数` + 当前进行中任务名(截断) | Live `done/total` + active task name, updated in real time |
|
|
31
|
+
| 状态颜色:橙脉动=进行中 / 绿=完成 / 蓝=待办 / 灰=空清单 | Status colours: orange pulse / green / blue / gray |
|
|
32
|
+
| 每项带图标与配色:✓ 完成(绿+删除线)、▶ 进行中(橙)、○ 待办(灰虚线) | Per-item icons: ✓ done, ▶ in progress, ○ pending |
|
|
33
|
+
|
|
34
|
+
### 面板与数据 · Panel & data
|
|
35
|
+
|
|
36
|
+
| 中文 | English |
|
|
37
|
+
|---|---|
|
|
38
|
+
| 点球折叠/展开,靠屏幕边缘自动翻侧 | Click to fold/expand; flips sides near the edge |
|
|
39
|
+
| 双路数据同步:DOM 观察 + 会话投影帧解析——官方面板折叠时也有完整清单 | Dual-channel sync: DOM observer + projection frames — full list even when collapsed |
|
|
40
|
+
| Shadow DOM + `all:initial` 样式隔离 | Shadow DOM with `all:initial` isolation |
|
|
41
|
+
| 桌面端 + 网页端双端可用 | Works on Desktop and web |
|
|
42
|
+
|
|
43
|
+
### 历史与固定会话 · History & pinned sessions
|
|
44
|
+
|
|
45
|
+
| 中文 | English |
|
|
46
|
+
|---|---|
|
|
47
|
+
| 快照合并而非替换,旧任务进历史归档区 | Snapshots merge, older todos become a history archive |
|
|
48
|
+
| 行级 ✕ 隐藏、两个折叠行、🧹 批量清理、♻️ 一键恢复、📋 整行复制 | Per-row hide, fold rows, batch cleanup, one-click restore, full-text copy |
|
|
49
|
+
| 📌 固定会话共用同一渲染器,状态按会话独立 | Pinned sessions share the renderer, per-session state |
|
|
50
|
+
| ⇄ 上下堆叠 ⇄ 左右并排布局切换 | ⇄ stacked / side-by-side layout switch |
|
|
51
|
+
|
|
52
|
+
### 纪律注入 · Discipline injection
|
|
53
|
+
|
|
54
|
+
| 中文 | English |
|
|
55
|
+
|---|---|
|
|
56
|
+
| 向每次会话系统提示注入 todo 纪律(order=190)——装插件即生效 | Injects todo discipline into every session — works on install |
|
|
57
|
+
| 硬门:每轮首个工具调用必须是 todo_write(可用 `enforceFirstTodoWrite: false` 关闭) | Hard gate: first tool call per turn must be `todo_write` (toggle) |
|
|
58
|
+
| 只有显式布尔 `false` 才关闭 | Only explicit `false` disables it |
|
|
59
|
+
|
|
60
|
+
### 皮肤与隐私 · Skins & privacy
|
|
61
|
+
|
|
62
|
+
| 中文 | English |
|
|
63
|
+
|---|---|
|
|
64
|
+
| 三球共享 128 款皮肤(含经典旧皮肤) | Shares the 128-skin catalogue across the three balls |
|
|
65
|
+
| 零遥测、零上传,仅回环健康路由 | Zero telemetry, loopback-only health route |
|
|
66
|
+
|
|
67
|
+
## Features
|
|
68
|
+
|
|
69
|
+
本节内容详见 [English README](./README.md)。
|
|
70
|
+
|
|
71
|
+
## Pinned sessions & panel layout (v0.11.0)
|
|
72
|
+
|
|
73
|
+
本节内容详见 [English README](./README.md)。
|
|
74
|
+
|
|
75
|
+
## History & panel management (v0.10.0)
|
|
76
|
+
|
|
77
|
+
本节内容详见 [English README](./README.md)。
|
|
78
|
+
|
|
79
|
+
## Discipline injection (v0.9.0)
|
|
80
|
+
|
|
81
|
+
本节内容详见 [English README](./README.md)。
|
|
82
|
+
|
|
83
|
+
## Install
|
|
84
|
+
|
|
85
|
+
本节内容详见 [English README](./README.md)。
|
|
86
|
+
|
|
87
|
+
## How it works
|
|
88
|
+
|
|
89
|
+
本节内容详见 [English README](./README.md)。
|
|
90
|
+
|
|
91
|
+
## FAQ
|
|
92
|
+
|
|
93
|
+
本节内容详见 [English README](./README.md)。
|
|
94
|
+
|
|
95
|
+
## Compatibility
|
|
96
|
+
|
|
97
|
+
本节内容详见 [English README](./README.md)。
|
|
98
|
+
|
|
99
|
+
## License
|
|
100
|
+
|
|
101
|
+
MIT
|
package/icon.svg
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64" role="img" aria-label="dsh-todo-float-ball">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="g" x1="0" y1="0" x2="1" y2="1">
|
|
4
|
+
<stop offset="0%" stop-color="#4F6BED"/>
|
|
5
|
+
<stop offset="100%" stop-color="#7C3AED"/>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
</defs>
|
|
8
|
+
<rect x="2" y="2" width="60" height="60" rx="14" fill="url(#g)"/>
|
|
9
|
+
<text x="32" y="41" font-family="-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif"
|
|
10
|
+
font-size="26" font-weight="700" fill="#ffffff" text-anchor="middle">TF</text>
|
|
11
|
+
</svg>
|
package/lib/index.js
CHANGED
|
@@ -129,14 +129,37 @@ export function apply(ctx, config) {
|
|
|
129
129
|
if (!session || typeof session.snapshotEvents !== "function") return next();
|
|
130
130
|
var events = session.snapshotEvents();
|
|
131
131
|
if (!events || typeof events[Symbol.iterator] !== "function") return next();
|
|
132
|
-
|
|
132
|
+
// v0.13.2 修复(2026-10-10):并行竞态 + run_code 包装 + 计数卡死。
|
|
133
|
+
// 原判定 toolCallsThisTurn === 1 有三个致命问题:
|
|
134
|
+
// 1) append 时序假设相反:第一个调用到达 gate 时计数为 0(放行),放行后计数变 1,
|
|
135
|
+
// 而被拒的调用不 append——计数永久卡在 1,此后每个调用都命中 "=== 1" 被拒 → 死循环锁死;
|
|
136
|
+
// 2) AI 常用 run_code 包装调用(await tools.todo_write(...)),exec.name 是 run_code,
|
|
137
|
+
// 原 name 检查认不出,包装的 todo_write 永远触发不了放行分支;
|
|
138
|
+
// 3) 并行批次 append/dispatch 顺序不保证。
|
|
139
|
+
// 新判定:本 turn 第一个调用一律放行(给 todo_write 执行机会);从第二个起,
|
|
140
|
+
// 用「本 turn 是否已有 todo/write 会话事件」判断(无论直接调用还是 run_code 包装,
|
|
141
|
+
// todo_write 真正执行过必有该事件,比检查调用名可靠),辅以调用名/参数兜底识别。
|
|
142
|
+
var dispatchedThisTurn = 0;
|
|
143
|
+
var hasTodoWriteThisTurn = false;
|
|
144
|
+
var sawToolName = false;
|
|
133
145
|
for (var ev of events) {
|
|
134
146
|
var type = ev && ev.type;
|
|
135
|
-
if (type === "turn/start")
|
|
136
|
-
else if (type === "
|
|
147
|
+
if (type === "turn/start") { dispatchedThisTurn = 0; hasTodoWriteThisTurn = false; sawToolName = false; }
|
|
148
|
+
else if (type === "todo/write") { hasTodoWriteThisTurn = true; }
|
|
149
|
+
else if (type === "tool/call") {
|
|
150
|
+
dispatchedThisTurn++;
|
|
151
|
+
var callName = (ev.data && ev.data.name) || ev.name;
|
|
152
|
+
if (typeof callName === "string" && callName) {
|
|
153
|
+
sawToolName = true;
|
|
154
|
+
if (callName === "todo_write") hasTodoWriteThisTurn = true;
|
|
155
|
+
var callArgs = (ev.data && ev.data.arguments) || ev.arguments;
|
|
156
|
+
if (typeof callArgs === "string" && callArgs.indexOf("todo_write") !== -1) hasTodoWriteThisTurn = true;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
137
159
|
}
|
|
138
|
-
|
|
139
|
-
|
|
160
|
+
// fail-open:本 turn 有调用但一个 name 都读不到(事件结构不符)→ 放行,绝不阻塞
|
|
161
|
+
if (dispatchedThisTurn > 1 && sawToolName && !hasTodoWriteThisTurn) {
|
|
162
|
+
ctx.logger.info("dsh-todo-float-ball: GATE denied \"" + String(exec.name) + "\" (no todo_write in this turn yet)");
|
|
140
163
|
return {
|
|
141
164
|
kind: "deny",
|
|
142
165
|
reason: "【todo 进度表纪律·硬约束】每个回复 turn 的第一个工具调用必须是 todo_write(覆盖式写回完整清单:已完成的保留并标 completed、只增不减、进行中项带进度数字)。本轮你还没有写 todo 清单。请先用 todo_write 写回完整清单,再执行其它工具调用。"
|
package/locale/en.json
ADDED
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,65 +1,75 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"dsh"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-todo-float-ball",
|
|
3
|
+
"version": "0.14.5",
|
|
4
|
+
"description": "DSH todo 悬浮球:常驻可拖动悬浮球实时显示当前会话 todo_write 任务清单进度(总数/完成数/进行中),Shadow DOM 样式隔离,点击折叠/展开完整清单,状态颜色(待办灰/进行中橙脉动/完成绿)。数据双路同步:MutationObserver 抓官方 todo 面板为主 + 拦截会话投影帧为辅。双端可用(Desktop 桌面端 + Web 网页端)。",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"engines": {
|
|
9
|
+
"dsh": ">=0.1.7-rc.1",
|
|
10
|
+
"node": "^22.19.0 || >=24.0.0"
|
|
11
|
+
},
|
|
12
|
+
"exports": {
|
|
13
|
+
".": "./lib/index.js",
|
|
14
|
+
"./client": "./lib/client.js",
|
|
15
|
+
"./package.json": "./package.json",
|
|
16
|
+
"./locale/*.json": "./locale/*.json",
|
|
17
|
+
"./icon": "./icon.svg"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"lib",
|
|
21
|
+
"lib/**/*.js",
|
|
22
|
+
"cordis.patch.yml",
|
|
23
|
+
"README.md",
|
|
24
|
+
"README.zh.md",
|
|
25
|
+
"CHANGELOG.md",
|
|
26
|
+
"docs/*.md",
|
|
27
|
+
"docs/images/*",
|
|
28
|
+
"LICENSE",
|
|
29
|
+
"locale/*.json",
|
|
30
|
+
"icon.svg",
|
|
31
|
+
"README-zh.md",
|
|
32
|
+
"README-es.md",
|
|
33
|
+
"README-pt.md",
|
|
34
|
+
"README-hi.md"
|
|
35
|
+
],
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "git+https://github.com/loyalchiiina/dsh-todo-float-ball.git"
|
|
40
|
+
},
|
|
41
|
+
"homepage": "https://github.com/loyalchiiina/dsh-todo-float-ball#readme",
|
|
42
|
+
"bugs": {
|
|
43
|
+
"url": "https://github.com/loyalchiiina/dsh-todo-float-ball/issues"
|
|
44
|
+
},
|
|
45
|
+
"keywords": [
|
|
46
|
+
"dsh-plugin",
|
|
47
|
+
"deepseek-harness",
|
|
48
|
+
"todo",
|
|
49
|
+
"悬浮球",
|
|
50
|
+
"float-ball",
|
|
51
|
+
"task-list",
|
|
52
|
+
"progress",
|
|
53
|
+
"ui"
|
|
54
|
+
],
|
|
55
|
+
"dsh": {
|
|
56
|
+
"bundle": {
|
|
57
|
+
"patch": "./cordis.patch.yml"
|
|
58
|
+
},
|
|
59
|
+
"client": {
|
|
60
|
+
"inject": [
|
|
61
|
+
"@deepseek-ai/dsh-client-runtime"
|
|
62
|
+
],
|
|
63
|
+
"platform": "web"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"peerDependencies": {
|
|
67
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
68
|
+
"@deepseek-ai/dsh": ">=0.1.7-rc.1"
|
|
69
|
+
},
|
|
70
|
+
"devDependencies": {
|
|
71
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
72
|
+
"@deepseek-ai/dsh": ">=0.1.7-rc.1"
|
|
73
|
+
},
|
|
74
|
+
"packageManager": "pnpm@11.7.0"
|
|
75
|
+
}
|