dsh-todo-float-ball 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -0
- package/README.md +10 -0
- package/README.zh.md +10 -0
- package/cordis.patch.yml +25 -4
- package/lib/index.js +86 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,8 +3,52 @@
|
|
|
3
3
|
All notable changes to this project are documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
5
5
|
|
|
6
|
+
## [0.9.0] - 2026-09-10
|
|
7
|
+
|
|
8
|
+
> Local-only release (not published to npm yet). Adds an optional, ON-by-default
|
|
9
|
+
> system-prompt injection so the todo rules are resident in every session even
|
|
10
|
+
> when the `todo-show-discipline` skill is never loaded.
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **Host half now injects a "todo discipline" system-prompt section**
|
|
15
|
+
(user request: the todo 铁律 kept failing because skills are loaded on demand —
|
|
16
|
+
a session that never loads the skill never carries the rules). `lib/index.js`
|
|
17
|
+
adds `systemPrompt` to `inject` and registers
|
|
18
|
+
`ctx.systemPrompt.section({ name: "todo-discipline", order: 190, text })`,
|
|
19
|
+
disposed through `ctx.effect(...)` exactly like `dsh-taskboard`'s protocol
|
|
20
|
+
section (`order: 180`). Order 190 keeps the two work-discipline blocks
|
|
21
|
+
adjacent inside the built-in policy band (`DEPLOYMENT_PERSONA=0` →
|
|
22
|
+
`PLAN_POLICY=500`) and leaves 181..189 free for future sections.
|
|
23
|
+
The injected text is 362 characters (187 CJK) and carries only the 5 hardest
|
|
24
|
+
rules — the long-form rules stay in the `todo-show-discipline` skill.
|
|
25
|
+
Works on both the desktop and the web profile, and across presets, because it
|
|
26
|
+
is a plugin/host capability rather than a skill.
|
|
27
|
+
- **Config switch `injectDiscipline` (default `true`)**: set
|
|
28
|
+
`config: { injectDiscipline: false }` on the plugin's bundle-patch row to skip
|
|
29
|
+
the section entirely (no empty-text section is registered). Only an explicit
|
|
30
|
+
boolean `false` disables it. Ships as `config: { injectDiscipline: true }` in
|
|
31
|
+
`cordis.patch.yml`.
|
|
32
|
+
- `dev-verify-inject.cjs`: offline verifier that loads the real ESM host half and
|
|
33
|
+
drives `apply()` with a fake cordis context — asserts exports, inject list,
|
|
34
|
+
section name/order/text budget, the on/off switch behaviour, and that both
|
|
35
|
+
loopback health routes still register and answer 200/403.
|
|
36
|
+
|
|
37
|
+
### Changed
|
|
38
|
+
|
|
39
|
+
- `package.json` version 0.8.0 → 0.9.0 (local build ahead of the published
|
|
40
|
+
0.8.0, so a plugin-manager "update" cannot silently downgrade it).
|
|
41
|
+
|
|
42
|
+
### Unchanged (verified)
|
|
43
|
+
|
|
44
|
+
- `lib/client.js` display logic untouched; `/dsh-todo-float-ball/health` and
|
|
45
|
+
`/dsh-todo-float-ball/client-alive` behaviour and the loopback-only guard
|
|
46
|
+
unchanged.
|
|
47
|
+
|
|
6
48
|
## [0.8.0] - 2026-09-08
|
|
7
49
|
|
|
50
|
+
> Published: 2026-09-08. Repository first created 2026-09-06 (v0.1.0 skeleton); v0.8.0 ships six skins, multi-session monitoring, inline rename, capsule mode and durable persistence.
|
|
51
|
+
|
|
8
52
|
### Added
|
|
9
53
|
|
|
10
54
|
- **Nebula triple-variant** (user: 都保留 — keep all three texture
|
package/README.md
CHANGED
|
@@ -29,6 +29,16 @@ It is a pure, read-only companion: the plugin never modifies the official panel,
|
|
|
29
29
|
| 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 |
|
|
30
30
|
| 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 |
|
|
31
31
|
| Privacy-friendly | Zero telemetry, zero data upload. The only host-side surface is a loopback-only health route (`/dsh-todo-float-ball/health`) |
|
|
32
|
+
| **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` |
|
|
33
|
+
|
|
34
|
+
## Discipline injection (v0.9.0)
|
|
35
|
+
|
|
36
|
+
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.
|
|
37
|
+
|
|
38
|
+
- **ON by default** (no `config` row means ON).
|
|
39
|
+
- 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**.
|
|
40
|
+
- Only an explicit boolean `false` disables it; `"false"` / `0` / typos / a missing `config` all keep it ON (guards against accidental shutdown).
|
|
41
|
+
- 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.
|
|
32
42
|
|
|
33
43
|
## Install
|
|
34
44
|
|
package/README.zh.md
CHANGED
|
@@ -29,6 +29,16 @@ DSH 里的 AI 在推进多步骤任务时,会用内置的 `todo_write` 工具
|
|
|
29
29
|
| Shadow DOM 样式隔离 | 全部 UI 在 open Shadow DOM 内并加 `all:initial`——样式不进不出,主题/皮肤插件互不干扰 |
|
|
30
30
|
| 双端可用 | DSH Desktop 桌面端(Electron 窗口)与网页端(浏览器)同一份代码通用;UI 挂载在 `<html>` 根节点,规避 `transform` 导致的 `position:fixed` 失效 |
|
|
31
31
|
| 隐私友好 | 零遥测、零数据上传。宿主端只注册一个仅限本机回环访问的健康检查路由(`/dsh-todo-float-ball/health`) |
|
|
32
|
+
| **纪律注入(v0.9.0)** | 宿主端向**每次会话的系统提示**注入 5 条最硬的 todo 纪律(约 340 字,`order=190`)——**装上插件即生效,无需加载任何技能**;可用 `injectDiscipline: false` 关闭 |
|
|
33
|
+
|
|
34
|
+
## 纪律注入(v0.9.0)
|
|
35
|
+
|
|
36
|
+
DSH 的技能是**按需加载**的:一个会话若从未加载 `todo-show-discipline` 技能,就完全不带 todo 纪律。v0.9.0 起,宿主端会向每次会话的系统提示注入一段稳定的「todo 纪律」段落,因此**装上插件就等于纪律常驻**——与技能是否加载、用哪个预设、桌面端还是网页端都无关。
|
|
37
|
+
|
|
38
|
+
- 默认**开启**(不写 `config` 即为开)。
|
|
39
|
+
- 关闭:在 `cordis.patch.yml`(或 profile 的 patch 层)给本插件加 `config: { injectDiscipline: false }`,**重启 DSH 生效**。
|
|
40
|
+
- 只有**显式布尔 `false`** 才关闭;`"false"` / `0` / 拼错 / 缺 `config` 一律保持开启(防误关)。
|
|
41
|
+
- 注入文本刻意精简(系统提示每会话都占 token),完整规则仍留在 `todo-show-discipline` 技能里;该技能在装了本插件后默认不再随会话加载(`disable-model-invocation: true`)以避免重复占 token,未装本插件时可恢复启用。
|
|
32
42
|
|
|
33
43
|
## 安装
|
|
34
44
|
|
package/cordis.patch.yml
CHANGED
|
@@ -1,8 +1,29 @@
|
|
|
1
1
|
# dsh-todo-float-ball — floating ball showing live todo_write progress.
|
|
2
|
-
#
|
|
3
|
-
# the
|
|
4
|
-
#
|
|
5
|
-
#
|
|
2
|
+
# Dual-half plugin:
|
|
3
|
+
# * the host half (lib/index.js) registers a loopback-only health route AND a
|
|
4
|
+
# short "todo discipline" system-prompt section (ctx.systemPrompt.section),
|
|
5
|
+
# so the todo rules are resident in every session/preset without loading the
|
|
6
|
+
# `todo-show-discipline` skill (skills load on demand, a prompt section does
|
|
7
|
+
# not);
|
|
8
|
+
# * the client half (lib/client.js) draws the floating ball, mounted by the
|
|
9
|
+
# client-modules system once the host activates.
|
|
10
|
+
#
|
|
11
|
+
# Config switch `injectDiscipline` (default: true — also the explicit value
|
|
12
|
+
# below, so this row is the single place to flip it).
|
|
13
|
+
# Set it to false to stop injecting the prompt section, e.g. when you prefer the
|
|
14
|
+
# `todo-show-discipline` skill to be the only discipline source:
|
|
15
|
+
#
|
|
16
|
+
# - insert:
|
|
17
|
+
# - id: dsh-todo-float-ball
|
|
18
|
+
# name: dsh-todo-float-ball
|
|
19
|
+
# config:
|
|
20
|
+
# injectDiscipline: false
|
|
21
|
+
#
|
|
22
|
+
# Only an explicit boolean false disables the section (no empty-text section is
|
|
23
|
+
# registered in that case); any other value, or no config row at all, keeps the
|
|
24
|
+
# injection ON. The floating ball and the health routes are unaffected either way.
|
|
6
25
|
- insert:
|
|
7
26
|
- id: dsh-todo-float-ball
|
|
8
27
|
name: dsh-todo-float-ball
|
|
28
|
+
config:
|
|
29
|
+
injectDiscipline: true
|
package/lib/index.js
CHANGED
|
@@ -1,14 +1,64 @@
|
|
|
1
1
|
// dsh-todo-float-ball - host half.
|
|
2
|
-
//
|
|
3
|
-
// the host registers a loopback-only health route so the bundle has a real
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
2
|
+
// Dual-face mount (identical shape to the verified dsh-font-enhancer):
|
|
3
|
+
// (1) the host registers a loopback-only health route so the bundle has a real
|
|
4
|
+
// cordis activate (inject=['webServer']);
|
|
5
|
+
// (2) since v0.9.0 the host ALSO injects a short "todo discipline" system-prompt
|
|
6
|
+
// section (inject adds 'systemPrompt'), so the todo rules hold in every
|
|
7
|
+
// session / preset / desktop+web build even when the `todo-show-discipline`
|
|
8
|
+
// skill was never loaded (skills are loaded on demand, the prompt section is
|
|
9
|
+
// resident). The long-form rules stay in the skill; this text carries only
|
|
10
|
+
// the 5 hardest ones, because a system-prompt section costs tokens in EVERY
|
|
11
|
+
// session.
|
|
12
|
+
// The visual work still lives in lib/client.js, mounted by the client-modules
|
|
13
|
+
// system once the host activates. Works on both web and desktop profiles.
|
|
14
|
+
|
|
15
|
+
import { readFileSync } from "node:fs";
|
|
16
|
+
import { fileURLToPath } from "node:url";
|
|
17
|
+
import { dirname, join } from "node:path";
|
|
18
|
+
|
|
19
|
+
// Version reported by the health route, read from package.json so it can never
|
|
20
|
+
// drift from the released version again (it was hardcoded to "0.1.0" from the
|
|
21
|
+
// 0.1.0 skeleton until 2026-09-10, and kept reporting 0.1.0 while the package
|
|
22
|
+
// had moved on to 0.8.0/0.9.0). Falls back to "unknown" if the file cannot be
|
|
23
|
+
// read, so the route never throws.
|
|
24
|
+
var PKG_VERSION = (function () {
|
|
25
|
+
try {
|
|
26
|
+
var here = dirname(fileURLToPath(import.meta.url));
|
|
27
|
+
return JSON.parse(readFileSync(join(here, "..", "package.json"), "utf8")).version;
|
|
28
|
+
} catch (e) {
|
|
29
|
+
return "unknown";
|
|
30
|
+
}
|
|
31
|
+
})();
|
|
7
32
|
|
|
8
33
|
var SETTINGS_PREFIX = "/dsh-todo-float-ball";
|
|
9
34
|
|
|
35
|
+
// Stable identifier of the injected prompt section (same naming style as
|
|
36
|
+
// dsh-taskboard's own `TASKBOARD_PROTOCOL` section).
|
|
37
|
+
var DISCIPLINE_SECTION_NAME = "todo-discipline";
|
|
38
|
+
|
|
39
|
+
// Sort position. section() orders are plain numbers sorted ascending; the
|
|
40
|
+
// built-in band is DEPLOYMENT_PERSONA=0 -> PLAN_POLICY=500 -> TEAM_POLICY=600
|
|
41
|
+
// (see @deepseek-ai/dsh-system-prompt SECTION_ORDERS), and dsh-taskboard puts
|
|
42
|
+
// its protocol section at 180. 190 therefore keeps this discipline inside the
|
|
43
|
+
// same "how to work" band as the task-board protocol (rendered right after it,
|
|
44
|
+
// so the two work-discipline blocks stay together), stays clear of the 500
|
|
45
|
+
// plan-policy boundary, and leaves 181..189 free for future sections.
|
|
46
|
+
var DISCIPLINE_SECTION_ORDER = 190;
|
|
47
|
+
|
|
48
|
+
// Injected text - Chinese, deliberately short (hard character budget: <=500,
|
|
49
|
+
// actual ~340). Only the 5 hardest rules; everything else belongs to the
|
|
50
|
+
// `todo-show-discipline` skill, which is loaded on demand.
|
|
51
|
+
var DISCIPLINE_TEXT = [
|
|
52
|
+
"【todo 进度表纪律 · 由 dsh-todo-float-ball 插件常驻注入,无需加载技能】",
|
|
53
|
+
"1. 每个回复 turn 的第一个工具调用必须是 todo_write:覆盖式写回完整清单;先写 todo,再做检查、汇报或执行。",
|
|
54
|
+
"2. 清单只增不减:已完成项保留并标 completed,绝不删除、折叠或合并;新任务到达但旧任务未完成时合并追加,禁止替换式清空重写。",
|
|
55
|
+
"3. 进行中项必须带实时进度数字(如「19号 120rpm 求解 278/1000」);每完成一步立即刷新状态。",
|
|
56
|
+
"4. 用户说「消失/少了/不见了/关了」= 本纪律被违反:立即补全完整清单,并说明当轮首动作漏写。",
|
|
57
|
+
"5. 全部任务实际完成时也要再写一次 todo_write(全标 completed),不得残留 in_progress/pending。"
|
|
58
|
+
].join("\n");
|
|
59
|
+
|
|
10
60
|
export var name = "dsh-todo-float-ball";
|
|
11
|
-
export var inject = ["webServer"];
|
|
61
|
+
export var inject = ["webServer", "systemPrompt"];
|
|
12
62
|
|
|
13
63
|
function isLoopback(req) {
|
|
14
64
|
var a = (req.socket && req.socket.remoteAddress) || "";
|
|
@@ -18,13 +68,41 @@ function isLoopback(req) {
|
|
|
18
68
|
return n.startsWith("127.");
|
|
19
69
|
}
|
|
20
70
|
|
|
21
|
-
export function apply(ctx) {
|
|
71
|
+
export function apply(ctx, config) {
|
|
22
72
|
ctx.logger.info("dsh-todo-float-ball: host half mounted (health api + client)");
|
|
73
|
+
|
|
74
|
+
// Config switch `injectDiscipline` (default true).
|
|
75
|
+
// The default is deliberately permissive: an install that carries no `config`
|
|
76
|
+
// row at all - every existing user, including both local profiles - keeps the
|
|
77
|
+
// discipline ON, so this feature is "install the plugin and it works".
|
|
78
|
+
// Turn it OFF from the inserted bundle row (the plugin's own
|
|
79
|
+
// cordis.patch.yml, or a manual mount line in the profile's patch):
|
|
80
|
+
// - insert:
|
|
81
|
+
// - id: dsh-todo-float-ball
|
|
82
|
+
// name: dsh-todo-float-ball
|
|
83
|
+
// config:
|
|
84
|
+
// injectDiscipline: false
|
|
85
|
+
// Only an explicit boolean false disables it, so "0"/""/typos cannot silently
|
|
86
|
+
// switch the discipline off. When disabled the section is NOT registered at
|
|
87
|
+
// all (no empty-text section is left behind).
|
|
88
|
+
var injectDiscipline = !(config && config.injectDiscipline === false);
|
|
89
|
+
if (injectDiscipline) {
|
|
90
|
+
var disposeSection = ctx.systemPrompt.section({
|
|
91
|
+
name: DISCIPLINE_SECTION_NAME,
|
|
92
|
+
order: DISCIPLINE_SECTION_ORDER,
|
|
93
|
+
text: DISCIPLINE_TEXT
|
|
94
|
+
});
|
|
95
|
+
ctx.effect(function () { return disposeSection; }, "dsh-todo-float-ball: todo discipline section");
|
|
96
|
+
ctx.logger.info("dsh-todo-float-ball: todo discipline prompt section registered (order " + DISCIPLINE_SECTION_ORDER + ", " + DISCIPLINE_TEXT.length + " chars)");
|
|
97
|
+
} else {
|
|
98
|
+
ctx.logger.info("dsh-todo-float-ball: todo discipline prompt section disabled by config (injectDiscipline: false)");
|
|
99
|
+
}
|
|
100
|
+
|
|
23
101
|
ctx.effect(function () {
|
|
24
102
|
var h1 = ctx.webServer.register({ kind: "exact", path: SETTINGS_PREFIX + "/health", handler: function (req, res) {
|
|
25
103
|
if (!isLoopback(req)) { res.writeHead(403); res.end(); return; }
|
|
26
104
|
res.writeHead(200, { "content-type": "application/json; charset=utf-8" });
|
|
27
|
-
res.end(JSON.stringify({ ok: true, plugin: "dsh-todo-float-ball", version:
|
|
105
|
+
res.end(JSON.stringify({ ok: true, plugin: "dsh-todo-float-ball", version: PKG_VERSION }));
|
|
28
106
|
}});
|
|
29
107
|
var h2 = ctx.webServer.register({ kind: "exact", path: SETTINGS_PREFIX + "/client-alive", handler: function (req, res) {
|
|
30
108
|
ctx.logger.info("dsh-todo-float-ball: CLIENT-ALIVE ping received from browser");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-todo-float-ball",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "DSH todo 悬浮球:常驻可拖动悬浮球实时显示当前会话 todo_write 任务清单进度(总数/完成数/进行中),Shadow DOM 样式隔离,点击折叠/展开完整清单,状态颜色(待办灰/进行中橙脉动/完成绿)。数据双路同步:MutationObserver 抓官方 todo 面板为主 + 拦截会话投影帧为辅。双端可用(Desktop 桌面端 + Web 网页端)。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|