dsh-checklist-mode 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +81 -2
- package/client.js +113 -0
- package/cordis.patch.yml +3 -0
- package/docs/DETAIL.en.md +51 -0
- package/docs/DETAIL.md +51 -0
- package/icon.svg +12 -0
- package/index.js +123 -0
- package/locale/en.json +7 -0
- package/locale/ru.json +7 -0
- package/package.json +57 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 kotovich-ux
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,82 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-checklist-mode
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Strict checklist mode for [DeepSeek Harness](https://www.deepseek.com/en/harness/): a slash
|
|
4
|
+
command plus a system-prompt policy that makes the agent plan first, then execute the plan
|
|
5
|
+
step by step — without reworking what already works and without inventing choices on its own.
|
|
6
|
+
|
|
7
|
+
A DSH bundle, not a model: it works with whatever model a user has configured.
|
|
8
|
+
|
|
9
|
+
## What it does
|
|
10
|
+
|
|
11
|
+
`/checklist` turns on a mode for the current session. While the mode is on, the agent's system
|
|
12
|
+
prompt carries a `checklist:policy` section:
|
|
13
|
+
|
|
14
|
+
1. **Plan first.** The very first action is a numbered plan written to `todo_write`, each step
|
|
15
|
+
with a completion criterion. The plan is the single source of truth.
|
|
16
|
+
2. **One step at a time.** Steps run strictly in order; each one is marked `completed` right
|
|
17
|
+
after it is done.
|
|
18
|
+
3. **No rework.** Finished steps are not revisited, working parts are not "improved".
|
|
19
|
+
4. **Ask, don't guess.** If a step needs a choice (technology, path, format, trade-off), the
|
|
20
|
+
agent asks with `ask_user_question` and waits.
|
|
21
|
+
5. **No side quests.** New items appear only with the user's consent.
|
|
22
|
+
6. **Short answers.** Short reports, and a final "step → result" summary.
|
|
23
|
+
|
|
24
|
+
## Requirements
|
|
25
|
+
|
|
26
|
+
- DeepSeek Harness `>= 0.2.2-rc.3 < 0.3.0-0` (tested on Desktop 0.2.2-rc.3, Windows).
|
|
27
|
+
- The Web UI (Desktop or `dsh web`) — the command and the menu row live there.
|
|
28
|
+
|
|
29
|
+
## Install
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
dsh plugin --profile desktop add dsh-checklist-mode
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Then restart DSH (or reload the Web UI). In DSH itself you can add the package by name from
|
|
36
|
+
**Plugins → Add plugin**.
|
|
37
|
+
|
|
38
|
+
## Use
|
|
39
|
+
|
|
40
|
+
Type `/` in the composer and pick **Checklist**, or type the command directly:
|
|
41
|
+
|
|
42
|
+
| Input | Result |
|
|
43
|
+
|---|---|
|
|
44
|
+
| `/checklist` | Turns the mode on; send the task as the next message. |
|
|
45
|
+
| `/checklist <task>` | Turns the mode on and sends the task at once. |
|
|
46
|
+
| `/checklist off` | Turns the mode off. |
|
|
47
|
+
|
|
48
|
+
The menu row shows an icon (a sheet with two lines: the first has a checked box, the second an
|
|
49
|
+
empty one), a localized title (system language) and the English command name.
|
|
50
|
+
|
|
51
|
+
## How the menu row is made
|
|
52
|
+
|
|
53
|
+
DSH 0.2.2 ships icons and localized titles only for its built-in commands; a host command
|
|
54
|
+
descriptor carries just `name`, `description` and `input.hint`. The public `ctx.commandUi`
|
|
55
|
+
contract covers fully client-side commands and behavioral decorations — neither can dress a
|
|
56
|
+
host command row.
|
|
57
|
+
|
|
58
|
+
So the client half (`client.js`) wraps `CommandUiRuntime.candidates`, the single place where
|
|
59
|
+
menu rows are assembled, and adds `label`/`description`/`icon` to its own `checklist` row.
|
|
60
|
+
The wrap is deliberately soft: if a future DSH changes or renames that private method, the
|
|
61
|
+
icon and title simply do not appear (a warning is logged), and the command keeps working.
|
|
62
|
+
|
|
63
|
+
If you are upgrading DSH beyond the range above, expect the cosmetic part to need a small
|
|
64
|
+
update; `engines.dsh` states the tested range.
|
|
65
|
+
|
|
66
|
+
## Caveats
|
|
67
|
+
|
|
68
|
+
- The policy is a prompt-level instruction, not a sandbox: a model can still deviate, it just
|
|
69
|
+
gets an explicit instruction not to.
|
|
70
|
+
- Mode state lives in process memory: after a DSH restart the mode is off and `/checklist`
|
|
71
|
+
must be turned on again.
|
|
72
|
+
- The plugin registers no HTTP routes, reads no credentials and writes no files.
|
|
73
|
+
|
|
74
|
+
## Uninstall
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
dsh plugin --profile desktop remove dsh-checklist-mode
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## License
|
|
81
|
+
|
|
82
|
+
MIT © kotovich-ux
|
package/client.js
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// Клиентская половина dsh-checklist-mode.
|
|
2
|
+
//
|
|
3
|
+
// Задача: в меню «Команды» строка /checklist должна выглядеть как штатные
|
|
4
|
+
// команды — иконка, название на языке системы и (рядом) английское имя.
|
|
5
|
+
//
|
|
6
|
+
// В DSH 2026-11 иконка и локализованное название есть только у встроенных
|
|
7
|
+
// команд: клиент держит их в таблице HOST_FACES
|
|
8
|
+
// (@deepseek-ai/dsh-client-ui-commands/src/client/presentation.ts), а дескриптор
|
|
9
|
+
// хостовой команды несёт лишь name/description/input.hint. Публичный API
|
|
10
|
+
// ctx.commandUi умеет только полностью клиентские команды (contribution; имя не
|
|
11
|
+
// должно совпадать с хостовой) и decorations (поведение, без иконки).
|
|
12
|
+
//
|
|
13
|
+
// Поэтому здесь мы оборачиваем CommandUiRuntime.candidates — единственное место,
|
|
14
|
+
// где собираются строки меню, — и дорисовываем свою строку. Подмена мягкая: если
|
|
15
|
+
// в новой версии DSH метода не станет, иконка и название просто не появятся,
|
|
16
|
+
// сама команда продолжит работать.
|
|
17
|
+
window.__ModuleLoader__.load({
|
|
18
|
+
id: "dsh-checklist-mode",
|
|
19
|
+
factory: (require) => {
|
|
20
|
+
var module = { exports: {} }
|
|
21
|
+
var exports = module.exports
|
|
22
|
+
|
|
23
|
+
const React = require("react")
|
|
24
|
+
const h = React.createElement
|
|
25
|
+
|
|
26
|
+
// «Лист с двумя строками»: у первой чекбокс с галочкой, у второй — пустой.
|
|
27
|
+
// Штриховая монохромная графика в духе штатных иконок меню; размер и цвет
|
|
28
|
+
// приходят от MenuView (<item.icon size={14} />) и currentColor.
|
|
29
|
+
function ChecklistIcon(props) {
|
|
30
|
+
const size = (props && props.size) || 16
|
|
31
|
+
const line = {
|
|
32
|
+
fill: "none",
|
|
33
|
+
stroke: "currentColor",
|
|
34
|
+
strokeWidth: 1.15,
|
|
35
|
+
strokeLinecap: "round",
|
|
36
|
+
strokeLinejoin: "round",
|
|
37
|
+
}
|
|
38
|
+
return h(
|
|
39
|
+
"svg",
|
|
40
|
+
{
|
|
41
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
42
|
+
width: size,
|
|
43
|
+
height: size,
|
|
44
|
+
viewBox: "0 0 16 16",
|
|
45
|
+
className: props && props.className,
|
|
46
|
+
"aria-hidden": "true",
|
|
47
|
+
focusable: "false",
|
|
48
|
+
},
|
|
49
|
+
h("rect", { ...line, x: 2.4, y: 1.7, width: 11.2, height: 12.6, rx: 1.8 }),
|
|
50
|
+
// первая строка: чекбокс с галочкой + «нечитаемая» линия текста
|
|
51
|
+
h("rect", { ...line, x: 4.2, y: 4.1, width: 2.5, height: 2.5, rx: 0.6 }),
|
|
52
|
+
h("path", { ...line, d: "M4.75 5.35l0.75 0.75 1.35-1.55" }),
|
|
53
|
+
h("line", { ...line, x1: 7.9, y1: 5.35, x2: 11.9, y2: 5.35 }),
|
|
54
|
+
// вторая строка: пустой чекбокс + такая же линия
|
|
55
|
+
h("rect", { ...line, x: 4.2, y: 8.5, width: 2.5, height: 2.5, rx: 0.6 }),
|
|
56
|
+
h("line", { ...line, x1: 7.9, y1: 9.75, x2: 11.9, y2: 9.75 }),
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Язык системы (navigator.language), как у штатных подписей меню.
|
|
61
|
+
const LANG = String(
|
|
62
|
+
(typeof navigator !== "undefined" && navigator.language) || "en",
|
|
63
|
+
).toLowerCase()
|
|
64
|
+
const RU = LANG.startsWith("ru")
|
|
65
|
+
const LABEL = RU ? "Чеклист" : "Checklist"
|
|
66
|
+
const DESCRIPTION = RU
|
|
67
|
+
? "Строгий режим: план по пунктам, без переделок, вопросы при выборе"
|
|
68
|
+
: "Strict mode: a numbered plan, one step at a time"
|
|
69
|
+
|
|
70
|
+
const COMMAND = "checklist"
|
|
71
|
+
const MARK = "__dshChecklistFace"
|
|
72
|
+
|
|
73
|
+
/** Добавить нашей строке иконку и локализованное название; чужие строки не трогаем. */
|
|
74
|
+
function faceRows(rows) {
|
|
75
|
+
if (!Array.isArray(rows)) return rows
|
|
76
|
+
let changed = false
|
|
77
|
+
const next = rows.map((row) => {
|
|
78
|
+
if (!row || row.name !== COMMAND || row.icon !== undefined) return row
|
|
79
|
+
changed = true
|
|
80
|
+
return { ...row, label: LABEL, description: DESCRIPTION, icon: ChecklistIcon }
|
|
81
|
+
})
|
|
82
|
+
return changed ? next : rows
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
exports.inject = ["commandUi"]
|
|
86
|
+
|
|
87
|
+
exports.apply = (ctx) => {
|
|
88
|
+
const ui = ctx.commandUi
|
|
89
|
+
const proto = ui === undefined || ui === null ? undefined : Object.getPrototypeOf(ui)
|
|
90
|
+
const original = proto && proto.candidates
|
|
91
|
+
if (typeof original !== "function") {
|
|
92
|
+
console.warn(
|
|
93
|
+
"[dsh-checklist] меню команд: CommandUiRuntime.candidates не найден — иконка и название не применены",
|
|
94
|
+
)
|
|
95
|
+
return
|
|
96
|
+
}
|
|
97
|
+
if (original[MARK] === true) return
|
|
98
|
+
const wrapped = async function candidatesWithChecklistFace(...args) {
|
|
99
|
+
return faceRows(await original.apply(this, args))
|
|
100
|
+
}
|
|
101
|
+
wrapped[MARK] = true
|
|
102
|
+
proto.candidates = wrapped
|
|
103
|
+
ctx.effect(
|
|
104
|
+
() => () => {
|
|
105
|
+
if (proto.candidates === wrapped) proto.candidates = original
|
|
106
|
+
},
|
|
107
|
+
"dsh-checklist: command face",
|
|
108
|
+
)
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return module.exports
|
|
112
|
+
},
|
|
113
|
+
})
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Checklist mode
|
|
2
|
+
|
|
3
|
+
Strict task execution mode: first a numbered plan, then execution strictly by that plan.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
Type `/checklist` in the composer — the command appears in the `/` menu (Commands section).
|
|
8
|
+
|
|
9
|
+
| Input | Result |
|
|
10
|
+
|---|---|
|
|
11
|
+
| `/checklist` | Turns the mode on. Send the task as a normal message next. |
|
|
12
|
+
| `/checklist <task>` | Turns the mode on and sends the task to the agent at once. |
|
|
13
|
+
| `/checklist off` | Turns the mode off. |
|
|
14
|
+
|
|
15
|
+
## What changes in behavior
|
|
16
|
+
|
|
17
|
+
While the mode is active, a `checklist:policy` section is added to the agent's system prompt:
|
|
18
|
+
|
|
19
|
+
1. first action — a numbered plan with a completion criterion per step, written to `todo_write`;
|
|
20
|
+
2. steps run one at a time, in order, each marked `completed` as soon as it is done;
|
|
21
|
+
3. finished steps are not revisited, working parts are not reworked;
|
|
22
|
+
4. any choice is asked through `ask_user_question` instead of being guessed;
|
|
23
|
+
5. no side tasks or improvements beyond the checklist;
|
|
24
|
+
6. short answers, final report as "step → result".
|
|
25
|
+
|
|
26
|
+
## How the menu row looks
|
|
27
|
+
|
|
28
|
+
The `/checklist` row is dressed like the built-in commands: an icon (a sheet with two lines —
|
|
29
|
+
the first with a checked box, the second with an empty one), a title in the system language, and
|
|
30
|
+
the English command name.
|
|
31
|
+
|
|
32
|
+
This is done by the plugin's client half — [`client.js`](../client.js):
|
|
33
|
+
|
|
34
|
+
- In DSH 2026-11 icons and localized titles exist only for built-in commands — the `HOST_FACES`
|
|
35
|
+
table in `@deepseek-ai/dsh-client-ui-commands/src/client/presentation.ts`; a host command
|
|
36
|
+
descriptor carries only `name`/`description`/`input.hint`. The public `ctx.commandUi` contract
|
|
37
|
+
covers fully client-side commands (contributions — whose name must not collide with a host
|
|
38
|
+
command) and decorations (behavior, no icon).
|
|
39
|
+
- Therefore `client.js` wraps `CommandUiRuntime.candidates` — the single place where menu rows
|
|
40
|
+
are assembled — and adds `label`/`description`/`icon` to its own row.
|
|
41
|
+
- The wrap is soft: if a future DSH drops the method, a warning is logged, the row loses the
|
|
42
|
+
icon, and the command keeps working.
|
|
43
|
+
|
|
44
|
+
## Limitations
|
|
45
|
+
|
|
46
|
+
- The limitation is soft: this is system-prompt text, not a tool ban. A model can deviate, but it
|
|
47
|
+
gets an explicit instruction not to.
|
|
48
|
+
- Mode state lives in process memory: after a DSH restart the mode is off and must be enabled
|
|
49
|
+
again.
|
|
50
|
+
- The command registers in the Commands section of the `/` menu: the Add section list
|
|
51
|
+
(File, Goal, Plan, Feedback) is hardcoded in the client and unavailable to third-party plugins.
|
package/docs/DETAIL.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Режим «Чеклист»
|
|
2
|
+
|
|
3
|
+
Строгий режим выполнения задач: сначала план по пунктам, потом выполнение строго по нему.
|
|
4
|
+
|
|
5
|
+
## Как пользоваться
|
|
6
|
+
|
|
7
|
+
В composer'е наберите `/checklist` — команда появится в меню «+» (секция Commands).
|
|
8
|
+
|
|
9
|
+
| Ввод | Что произойдёт |
|
|
10
|
+
|---|---|
|
|
11
|
+
| `/checklist` | Включает режим. Дальше отправляйте задачу обычным сообщением. |
|
|
12
|
+
| `/checklist <задача>` | Включает режим и сразу отправляет задачу агенту. |
|
|
13
|
+
| `/checklist off` | Выключает режим. |
|
|
14
|
+
|
|
15
|
+
## Что меняется в поведении
|
|
16
|
+
|
|
17
|
+
Пока режим активен, в системный промпт агента добавляется секция `checklist:policy`:
|
|
18
|
+
|
|
19
|
+
1. первым действием — план из пронумерованных шагов с критерием готовности, записанный в `todo_write`;
|
|
20
|
+
2. шаги выполняются по одному, по порядку, с отметкой `completed`;
|
|
21
|
+
3. завершённые шаги не пересматриваются, работающее не переделывается;
|
|
22
|
+
4. при любом выборе — вопрос пользователю через `ask_user_question`, а не догадка;
|
|
23
|
+
5. никаких «попутных» улучшений сверх чек-листа;
|
|
24
|
+
6. короткие ответы, финал — отчёт «пункт → результат».
|
|
25
|
+
|
|
26
|
+
## Как это выглядит в меню
|
|
27
|
+
|
|
28
|
+
Строка `/checklist` в меню «Команды» оформлена как штатные команды: иконка
|
|
29
|
+
(лист с двумя строками — у первой чекбокс с галочкой, у второй пустой),
|
|
30
|
+
название на языке системы и английское имя команды.
|
|
31
|
+
|
|
32
|
+
Сделано клиентской половиной плагина — [`client.js`](../client.js):
|
|
33
|
+
|
|
34
|
+
- В DSH 2026-11 иконка и локализованное название есть только у встроенных
|
|
35
|
+
команд — таблица `HOST_FACES` в
|
|
36
|
+
`@deepseek-ai/dsh-client-ui-commands/src/client/presentation.ts`; дескриптор
|
|
37
|
+
хостовой команды несёт только `name`/`description`/`input.hint`.
|
|
38
|
+
Публичный `ctx.commandUi` умеет лишь полностью клиентские команды
|
|
39
|
+
(contribution — имя не должно совпадать с хостовой) и decorations (поведение,
|
|
40
|
+
без иконки).
|
|
41
|
+
- Поэтому `client.js` оборачивает `CommandUiRuntime.candidates` — единственное
|
|
42
|
+
место, где собираются строки меню, — и дорисовывает нашей строке
|
|
43
|
+
`label`/`description`/`icon`.
|
|
44
|
+
- Подмена мягкая: если в новой версии DSH метода не станет, в консоли будет
|
|
45
|
+
предупреждение, строка останется без иконки, а команда продолжит работать.
|
|
46
|
+
|
|
47
|
+
## Ограничения
|
|
48
|
+
|
|
49
|
+
- Ограничение мягкое: это текст системного промпта, а не запрет инструментов. Модель может отклониться, но получит явную инструкцию этого не делать.
|
|
50
|
+
- Состояние режима хранится в памяти процесса: после перезапуска Harness режим выключен, его нужно включить заново.
|
|
51
|
+
- Команда регистрируется в секции Commands меню «+»: список секции Add (File, Goal, Plan, Feedback) зашит в клиент и сторонним плагинам недоступен.
|
package/icon.svg
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64" role="img" aria-label="Checklist mode">
|
|
2
|
+
<rect x="6" y="6" width="52" height="52" rx="14" fill="#1f6feb"/>
|
|
3
|
+
<rect x="18" y="14" width="28" height="8" rx="4" fill="#ffffff" opacity="0.55"/>
|
|
4
|
+
<g stroke="#ffffff" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" fill="none">
|
|
5
|
+
<path d="M20 30l4 4 7-8"/>
|
|
6
|
+
<path d="M20 44l4 4 7-8"/>
|
|
7
|
+
</g>
|
|
8
|
+
<g stroke="#ffffff" stroke-width="4" stroke-linecap="round" opacity="0.9">
|
|
9
|
+
<path d="M37 33h9"/>
|
|
10
|
+
<path d="M37 47h9"/>
|
|
11
|
+
</g>
|
|
12
|
+
</svg>
|
package/index.js
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Режим «Чеклист» — строгое следование плану.
|
|
3
|
+
*
|
|
4
|
+
* Команда /checklist:
|
|
5
|
+
* /checklist — включить режим;
|
|
6
|
+
* /checklist off — выключить;
|
|
7
|
+
* /checklist <задача> — включить и сразу отправить задачу агенту.
|
|
8
|
+
*
|
|
9
|
+
* Пока режим активен для агента, в его системный промпт добавлена секция
|
|
10
|
+
* `checklist:policy`. Состояние живёт в памяти процесса: после перезапуска
|
|
11
|
+
* Harness режим нужно включить заново.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
export const name = 'dsh-checklist-mode'
|
|
15
|
+
export const inject = ['commands']
|
|
16
|
+
|
|
17
|
+
const POLICY = `## Режим «Чеклист» (строгое следование плану)
|
|
18
|
+
|
|
19
|
+
1. Первым действием составь план: пронумерованные шаги, у каждого — критерий готовности.
|
|
20
|
+
Запиши план в todo_write. План — единственный источник истины.
|
|
21
|
+
2. Выполняй шаги строго по порядку, по одному. Закончил шаг — сразу отметь его
|
|
22
|
+
completed в todo_write и переходи к следующему.
|
|
23
|
+
3. Не возвращайся к завершённым шагам, не переделывай и не «улучшай» то, что уже
|
|
24
|
+
работает. Правки вне текущего шага запрещены.
|
|
25
|
+
4. Если шаг требует выбора (технология, путь, формат, компромисс) — не угадывай:
|
|
26
|
+
задай вопрос через ask_user_question с 2–4 конкретными вариантами и жди ответа.
|
|
27
|
+
5. Если выяснилось, что план неверен — не импровизируй: сформулируй, какой пункт
|
|
28
|
+
менять, и спроси пользователя.
|
|
29
|
+
6. Никаких «попутных» задач, рефакторингов и улучшений: новый пункт появляется
|
|
30
|
+
только с согласия пользователя.
|
|
31
|
+
7. Ответы короткие: что сделано по текущему пункту и что дальше. Не пересказывай
|
|
32
|
+
уже сделанное и не повторяй план целиком.
|
|
33
|
+
8. Финал: когда все пункты completed — короткий отчёт «пункт → результат».`
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Полноценное UserMessage для agent.steer().
|
|
37
|
+
*
|
|
38
|
+
* Обязательны role и id: LLM-слой сериализует историю как есть, и сообщение без
|
|
39
|
+
* role превращается в объект без поля `role`, который транспорт отвергает
|
|
40
|
+
* (`422 missing field role`). Кроме того, сериализатор DeepSeek ставит
|
|
41
|
+
* in-history обновление системного промпта только после хода с ролью user —
|
|
42
|
+
* сообщение без роли ломает и эту проверку.
|
|
43
|
+
*/
|
|
44
|
+
function userMessage(text) {
|
|
45
|
+
return {
|
|
46
|
+
role: 'user',
|
|
47
|
+
id: globalThis.crypto.randomUUID(),
|
|
48
|
+
content: [{ type: 'text', text }],
|
|
49
|
+
source: { kind: 'user' },
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function apply(ctx) {
|
|
54
|
+
/** agent -> disposer секции промпта */
|
|
55
|
+
const active = new Map()
|
|
56
|
+
|
|
57
|
+
function enable(agent) {
|
|
58
|
+
if (active.has(agent)) return false
|
|
59
|
+
const systemPrompt = agent.ctx?.systemPrompt
|
|
60
|
+
if (typeof systemPrompt?.section !== 'function') throw new Error('systemPrompt недоступен')
|
|
61
|
+
const off = systemPrompt.section({
|
|
62
|
+
name: 'checklist:policy',
|
|
63
|
+
order: 500,
|
|
64
|
+
text: POLICY,
|
|
65
|
+
})
|
|
66
|
+
active.set(agent, off)
|
|
67
|
+
return true
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function disable(agent) {
|
|
71
|
+
const off = active.get(agent)
|
|
72
|
+
if (!off) return false
|
|
73
|
+
try { off() } catch { /* секция уже снята вместе с агентом */ }
|
|
74
|
+
active.delete(agent)
|
|
75
|
+
return true
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
ctx.commands.register({
|
|
79
|
+
name: 'checklist',
|
|
80
|
+
description: 'Строгий режим: план по пунктам, без переделок, вопросы при выборе',
|
|
81
|
+
input: { hint: '<задача | off>' },
|
|
82
|
+
handler: ({ agent, rawInput }) => {
|
|
83
|
+
const text = String(rawInput || '').trim()
|
|
84
|
+
if (text.toLowerCase() === 'off') {
|
|
85
|
+
return disable(agent)
|
|
86
|
+
? { kind: 'success', text: 'режим «Чеклист» выключен' }
|
|
87
|
+
: { kind: 'success', text: 'режим «Чеклист» и так выключен' }
|
|
88
|
+
}
|
|
89
|
+
let turnedOn
|
|
90
|
+
try {
|
|
91
|
+
turnedOn = enable(agent)
|
|
92
|
+
} catch (error) {
|
|
93
|
+
return { kind: 'error', text: `не удалось включить режим «Чеклист»: ${error?.message ?? error}` }
|
|
94
|
+
}
|
|
95
|
+
if (!text) {
|
|
96
|
+
return {
|
|
97
|
+
kind: 'success',
|
|
98
|
+
text: turnedOn
|
|
99
|
+
? 'режим «Чеклист» включён — отправьте задачу'
|
|
100
|
+
: 'режим «Чеклист» уже включён — отправьте задачу',
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
try {
|
|
104
|
+
agent.steer(userMessage(text))
|
|
105
|
+
} catch (error) {
|
|
106
|
+
return { kind: 'error', text: `режим включён, но задача не отправлена: ${error?.message ?? error}` }
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
kind: 'success',
|
|
110
|
+
text: turnedOn
|
|
111
|
+
? 'режим «Чеклист» включён, задача отправлена'
|
|
112
|
+
: 'режим «Чеклист» уже включён, задача отправлена',
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
ctx.on('agent/disposed', ({ agent }) => {
|
|
118
|
+
const off = active.get(agent)
|
|
119
|
+
if (!off) return
|
|
120
|
+
try { off() } catch { /* ignore */ }
|
|
121
|
+
active.delete(agent)
|
|
122
|
+
})
|
|
123
|
+
}
|
package/locale/en.json
ADDED
package/locale/ru.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,59 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-checklist-mode",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Strict checklist mode for DeepSeek Harness: /checklist adds a numbered-plan policy to the agent's system prompt and can send the task in one step.",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "kotovich-ux",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/kotovich-ux/dsh-checklist-mode.git"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/kotovich-ux/dsh-checklist-mode#readme",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/kotovich-ux/dsh-checklist-mode/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"dsh",
|
|
18
|
+
"dsh-plugin",
|
|
19
|
+
"dsh-bundle",
|
|
20
|
+
"deepseek-harness",
|
|
21
|
+
"deepseek",
|
|
22
|
+
"cordis",
|
|
23
|
+
"checklist",
|
|
24
|
+
"plan-mode",
|
|
25
|
+
"agent-policy"
|
|
26
|
+
],
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=20",
|
|
29
|
+
"dsh": ">=0.2.2-rc.3 <0.3.0-0"
|
|
30
|
+
},
|
|
31
|
+
"main": "index.js",
|
|
32
|
+
"exports": {
|
|
33
|
+
".": "./index.js",
|
|
34
|
+
"./client": "./client.js",
|
|
35
|
+
"./locale/*.json": "./locale/*.json",
|
|
36
|
+
"./icon": "./icon.svg"
|
|
37
|
+
},
|
|
38
|
+
"files": [
|
|
39
|
+
"index.js",
|
|
40
|
+
"client.js",
|
|
41
|
+
"cordis.patch.yml",
|
|
42
|
+
"locale/*.json",
|
|
43
|
+
"docs",
|
|
44
|
+
"icon.svg",
|
|
45
|
+
"README.md",
|
|
46
|
+
"LICENSE"
|
|
47
|
+
],
|
|
48
|
+
"dsh": {
|
|
49
|
+
"bundle": {
|
|
50
|
+
"patch": "./cordis.patch.yml"
|
|
51
|
+
},
|
|
52
|
+
"client": {
|
|
53
|
+
"platform": "web",
|
|
54
|
+
"inject": [
|
|
55
|
+
"@deepseek-ai/dsh-client-ui-commands"
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|