dsh-prompt-picker 0.0.0-stage → 0.7.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 +115 -0
- package/README.md +31 -2
- package/README.zh.md +32 -0
- package/client.js +711 -0
- package/cordis.patch.yml +6 -0
- package/docs/preview-bolt-off.svg +1 -0
- package/docs/preview-bolt-on.svg +1 -0
- package/docs/preview-en-off.png +0 -0
- package/docs/preview-en-on.png +0 -0
- package/docs/preview-prts-off.png +0 -0
- package/docs/preview-prts-on.png +0 -0
- package/icon.svg +5 -0
- package/index.js +537 -0
- package/locale/en.json +21 -0
- package/locale/zh.json +21 -0
- package/package.json +40 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.7.0
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- **The built-in row is editable.** The `update` action now accepts
|
|
8
|
+
`full-throttle` like any row — pencil, scope chip and the footer's edit list
|
|
9
|
+
all work on it (the footer list shows every row, built-in included). The
|
|
10
|
+
edit persists as a `builtin` override in `prompt-picker.json` and survives
|
|
11
|
+
restarts; editing the row back to its generated default drops the override
|
|
12
|
+
key entirely, so an uncustomized row keeps following config `instructions`.
|
|
13
|
+
Only deletion stays rejected: the row itself is code.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- The footer's edit list now contains every row (the built-in one first), so
|
|
18
|
+
"Edit prompt…" is never disabled and the unreachable empty hint is gone.
|
|
19
|
+
|
|
20
|
+
## 0.6.0
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
|
|
24
|
+
- **Clear all** — the footer's new button (right of the prompt button) removes
|
|
25
|
+
every saved row after its own second confirmation (`将删除全部 {n} 条自建提示词…`),
|
|
26
|
+
through the new host RPC action `deleteAll` (`{action:'deleteAll'}`). One
|
|
27
|
+
serialized persist; the built-in row is code and keeps its own checked state.
|
|
28
|
+
Disabled while no user row exists.
|
|
29
|
+
- **Two-level prompt menu** — the footer's prompt button now expands
|
|
30
|
+
`新增提示词… / 修改提示词…` instead of opening the add dialog directly; the
|
|
31
|
+
edit branch lists every saved row (name + scope chip), and picking one opens
|
|
32
|
+
the shared dialog prefilled. The per-row inline pencil stays.
|
|
33
|
+
|
|
34
|
+
### Changed
|
|
35
|
+
|
|
36
|
+
- **Removed the footer's Uncheck-all item** (unchecking stays one click per row,
|
|
37
|
+
and `deleteAll` empties the list outright). The host `clear` RPC action is
|
|
38
|
+
unchanged for API compatibility.
|
|
39
|
+
- The add/edit dialogs merged into one `PromptDialog` (mode add | edit) whose
|
|
40
|
+
save is awaited: a rejected RPC keeps the dialog open and surfaces the message
|
|
41
|
+
inline, instead of closing and erroring the whole widget.
|
|
42
|
+
|
|
43
|
+
### Fixed
|
|
44
|
+
|
|
45
|
+
- Verified scope routing end to end against a live harness: a `main` row reached
|
|
46
|
+
only the top session (`why=header:main`), a `sub` row only a spawned child
|
|
47
|
+
(`why=origin=subagent,delegationDepth=1`), `both` reached both.
|
|
48
|
+
|
|
49
|
+
## 0.5.1
|
|
50
|
+
|
|
51
|
+
### Fixed
|
|
52
|
+
|
|
53
|
+
- **Concurrent state writes no longer drift.** `persist()` used a temporary file
|
|
54
|
+
named only after `process.pid`, so overlapping `toggle` / `update` / `delete`
|
|
55
|
+
calls clobbered the same temporary file and raced their rename/unlink steps; the
|
|
56
|
+
in-memory `selectedIds` could then disagree with the state file until the next
|
|
57
|
+
successful write (the file never tore, and a reload took the disk as truth).
|
|
58
|
+
Writes are now serialized through one promise chain and each uses a unique
|
|
59
|
+
temporary name (`<pid>.<time>.<random>.tmp`); the payload is serialized when
|
|
60
|
+
the write runs, so the last write always reflects the current rows.
|
|
61
|
+
|
|
62
|
+
### Changed
|
|
63
|
+
|
|
64
|
+
- Documented the validation contract of `update`: an empty name or text answers
|
|
65
|
+
`400 rejected`, while an out-of-range `scope` falls back to `both` — the same
|
|
66
|
+
`scopeOf()` rule `add` has always applied, kept identical on purpose.
|
|
67
|
+
- `test/edit-delete.test.mjs` now also covers 36 overlapping toggle/update calls
|
|
68
|
+
(memory must equal disk, no `.tmp` residue, a reload must agree) and the
|
|
69
|
+
documented scope fallback.
|
|
70
|
+
|
|
71
|
+
## 0.5.0
|
|
72
|
+
|
|
73
|
+
### Added
|
|
74
|
+
|
|
75
|
+
- Per-row **edit** (pencil → inline form for name / text / scope, saved through the
|
|
76
|
+
new `update` action) and **delete** (trash → second confirmation, then the new
|
|
77
|
+
`delete` action). The built-in row is read-only: it shows neither entry.
|
|
78
|
+
- Host RPC actions on `/_dsh/prompt-picker/rpc`:
|
|
79
|
+
- `update` — `{action:'update', id, name?, text?, scope?}`; a partial update.
|
|
80
|
+
Unchanged fields keep their value; validation matches `add` (name trimmed to
|
|
81
|
+
60 characters and non-empty, text non-empty, scope through `scopeOf`);
|
|
82
|
+
the in-memory row is restored if the write fails.
|
|
83
|
+
- `delete` — `{action:'delete', id}`; removes the row and drops its id from
|
|
84
|
+
`selectedIds`, rolling both back if the write fails.
|
|
85
|
+
- Both answer `{ok:true, value:<state>}`, or `400 {ok:false, error:{code:'rejected', message}}`
|
|
86
|
+
for an unknown id, an empty field, or the built-in row.
|
|
87
|
+
- `test/edit-delete.test.mjs`: action-level, RPC-contract, restart-reload,
|
|
88
|
+
toggle/update interleaving, scope-routing and zh/en copy-parity coverage.
|
|
89
|
+
|
|
90
|
+
### Fixed
|
|
91
|
+
|
|
92
|
+
- **Sub-agent detection.** `classifyAgent` read `delegationDepth` / `origin` off
|
|
93
|
+
the flat assembly context, which never carries them, so every assembly fell
|
|
94
|
+
through to the `default-main` branch. `scope: 'main'` rows therefore leaked
|
|
95
|
+
into sub-agents — including teammates (18/18 assemblies in a real session).
|
|
96
|
+
It now reads the durable session header (`context.agent.session.header`) plus
|
|
97
|
+
`AgentOptions.subagentDepth`, matching `delegationDepthOf()` in
|
|
98
|
+
`@deepseek-ai/dsh-subagent`, and the calibration log distinguishes
|
|
99
|
+
`origin=…`, `delegationDepth=…`, `header:main` and
|
|
100
|
+
`default-main:no-header`.
|
|
101
|
+
|
|
102
|
+
### Changed
|
|
103
|
+
|
|
104
|
+
- Version 0.4.0 → 0.5.0. README (both languages) documents the scope
|
|
105
|
+
discriminator, the degradation path and the new row actions.
|
|
106
|
+
|
|
107
|
+
## 0.4.0
|
|
108
|
+
|
|
109
|
+
- Published as the standalone plugin `dsh-prompt-picker`: multi-select prompts,
|
|
110
|
+
per-row scopes (both / main / sub), solid-hollow bolt icon, same-origin host RPC.
|
|
111
|
+
|
|
112
|
+
## 0.3.x
|
|
113
|
+
|
|
114
|
+
- Earlier releases under the previous `dsh-full-throttle` identity (single switch →
|
|
115
|
+
multi-select picker).
|
package/README.md
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-prompt-picker
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
English | [中文](README.zh.md)
|
|
4
|
+
|
|
5
|
+
One bolt icon ⚡ in the composer toolbar: click it and check the system prompts to inject. Multi-select.
|
|
6
|
+
|
|
7
|
+
| Off (hollow) | On (solid) |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
|  |  |
|
|
10
|
+
|
|
11
|
+
## What it does
|
|
12
|
+
|
|
13
|
+
- **Check = inject**: checked rows go into the system prompt in list order, separated by blank lines; check nothing and nothing is injected
|
|
14
|
+
- **Per-row scope**: all / main agent only / sub-agents only (click the chip at the end of a row; teammate sessions count as sub-agents)
|
|
15
|
+
- **Manage**: add, edit (the built-in "Full Throttle" row included), delete one by one, or clear every saved row at once
|
|
16
|
+
- **Survives restarts**: state lives in `~/.dsh/prompt-picker.json`
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
|
|
20
|
+
- **Market**: search `dsh-prompt-picker` in the DSH plugin market (dshmarket), one click
|
|
21
|
+
- **Manual**: Plugins page → Add plugin → paste `https://github.com/solopole/dsh-prompt-picker`
|
|
22
|
+
- **CLI**: `dsh plugin --profile <name> add dsh-prompt-picker`
|
|
23
|
+
|
|
24
|
+
## Customize the built-in text (optional)
|
|
25
|
+
|
|
26
|
+
Edit the built-in row right in the menu, or change its generated default in the profile's `cordis.patch.yml`:
|
|
27
|
+
|
|
28
|
+
```yaml
|
|
29
|
+
- id: prompt-picker
|
|
30
|
+
config:
|
|
31
|
+
instructions: 'Your default text'
|
|
32
|
+
```
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# dsh-prompt-picker(提示词选择器)
|
|
2
|
+
|
|
3
|
+
[English](README.md) | 中文
|
|
4
|
+
|
|
5
|
+
输入框工具栏的闪电图标 ⚡:点开勾选要注入的系统提示词,可多选。
|
|
6
|
+
|
|
7
|
+
| 关(空心) | 开(实心) |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
|  |  |
|
|
10
|
+
|
|
11
|
+
## 功能
|
|
12
|
+
|
|
13
|
+
- **勾选即注入**:勾选的提示词按列表顺序、空行分隔写进系统提示词;一条不勾就什么都不注入
|
|
14
|
+
- **每条可设作用域**:全部 / 仅主 agent / 仅子 agent(点行尾圆片切换;teammate 会话也算子 agent)
|
|
15
|
+
- **管理**:新增、修改(内置「火力全开」行也能改)、单条删除、一键全清自建条目
|
|
16
|
+
- **重启不丢**:状态保存在 `~/.dsh/prompt-picker.json`
|
|
17
|
+
|
|
18
|
+
## 安装
|
|
19
|
+
|
|
20
|
+
- **插件市场**:DSH 插件市场(dshmarket)搜 `dsh-prompt-picker`,一键安装
|
|
21
|
+
- **手动**:插件页 → 添加插件 → 贴 `https://github.com/solopole/dsh-prompt-picker`
|
|
22
|
+
- **CLI**:`dsh plugin --profile <名字> add dsh-prompt-picker`
|
|
23
|
+
|
|
24
|
+
## 自定义内置文案(可选)
|
|
25
|
+
|
|
26
|
+
内置「火力全开」可以在菜单里直接改;也可以在 profile 的 `cordis.patch.yml` 里改它的默认值:
|
|
27
|
+
|
|
28
|
+
```yaml
|
|
29
|
+
- id: prompt-picker
|
|
30
|
+
config:
|
|
31
|
+
instructions: '你的默认文案'
|
|
32
|
+
```
|