dsh-plugin-tool-management 0.5.1 → 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 +131 -0
- package/README.md +185 -238
- package/README_EN.md +185 -304
- package/cordis.patch.yml +9 -55
- package/docs/images/1/345/234/272/346/231/257.png +0 -0
- package/docs/images/1/345/234/272/346/231/257_en.png +0 -0
- package/docs/images/2MCP.png +0 -0
- package/docs/images/2MCP_en.png +0 -0
- package/docs/images/3/346/212/200/350/203/275.png +0 -0
- package/docs/images/3/346/212/200/350/203/275_en.png +0 -0
- package/docs/images/4/345/255/220/346/231/272/350/203/275/344/275/223.png +0 -0
- package/docs/images/4/345/255/220/346/231/272/350/203/275/344/275/223_en.png +0 -0
- package/docs/images/5/346/217/220/347/244/272/350/257/215.png +0 -0
- package/docs/images/5/346/217/220/347/244/272/350/257/215_en.png +0 -0
- package/docs/images/6/350/256/260/345/277/206.png +0 -0
- package/docs/images/6/350/256/260/345/277/206_en.png +0 -0
- package/docs/images/7/344/274/232/350/257/235.png +0 -0
- package/docs/images/7/344/274/232/350/257/235_en.png +0 -0
- package/docs/images/8/345/205/274/345/256/271.png +0 -0
- package/docs/images/8/345/205/274/345/256/271_en.png +0 -0
- package/docs/update.md +55 -0
- package/lib/agents-md/preset-id.js +49 -0
- package/lib/agents-md/service.js +180 -57
- package/lib/client.js +4710 -3560
- package/lib/compat/preset-reach.js +425 -0
- package/lib/compat/probe.js +665 -0
- package/lib/history/bridge.js +293 -0
- package/lib/history/workspace.js +498 -52
- package/lib/http-fence.js +94 -0
- package/lib/hub.js +160 -2
- package/lib/index.js +759 -157
- package/lib/mcp/override-blocks.js +195 -0
- package/lib/rules/provider.js +3 -3
- package/lib/rules/service.js +342 -31
- package/lib/scene-prompt-sync.js +112 -0
- package/lib/skills/core.js +123 -35
- package/lib/skills/service.js +9 -1
- package/lib/subagents/service.js +197 -23
- package/lib/subagents/tools.js +8 -2
- package/package.json +6 -3
- package/screenshots.json +10 -9
- package/docs/Changelog.md +0 -517
- package/docs/images/MCP.png +0 -0
- package/docs/images//344/274/232/350/257/235.png +0 -0
- package/docs/images//345/234/272/346/231/257.png +0 -0
- package/docs/images//345/255/220/346/231/272/350/203/275/344/275/223.png +0 -0
- package/docs/images//346/212/200/350/203/275.png +0 -0
- package/docs/images//346/217/220/347/244/272/350/257/215.png +0 -0
- package/docs/images//350/256/260/345/277/206.png +0 -0
package/README_EN.md
CHANGED
|
@@ -1,304 +1,185 @@
|
|
|
1
|
-
# dsh-plugin-tool-management
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/dsh-plugin-tool-management)
|
|
4
|
-
[](LICENSE)
|
|
5
|
-
[](package.json)
|
|
6
|
-
[](https://github.com/ouli-1242/dsh-plugin-tool-management)
|
|
7
|
-
[](https://dsh.market/)
|
|
8
|
-
|
|
9
|
-
[简体中文](README.md) · **English** · [Changelog](docs/
|
|
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
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
|
51
|
-
|
|
52
|
-
|
|
|
53
|
-
|
|
|
54
|
-
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
- **
|
|
101
|
-
- **
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
- **
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
- **
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
|
149
|
-
|
|
150
|
-
|
|
|
151
|
-
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
| `~/.dsh/subagents/<persona>.md` | `~/.dsh/tool-management/agents/<persona>.md` |
|
|
187
|
-
| plugin dir `data/agents-md-presets/` | `~/.dsh/tool-management/agents-md/` |
|
|
188
|
-
|
|
189
|
-
The move uses `rename` (instant on one volume) and leaves the source folder as an empty shell you can
|
|
190
|
-
delete once you are satisfied. `~/.dsh/skills/` (the official DSH skill directory) is **not** moved: it
|
|
191
|
-
stays listed as a switchable source, while skills **created or imported by the plugin** now land in
|
|
192
|
-
`tool-management/skills/` (the hub copy wins when both define the same name).
|
|
193
|
-
|
|
194
|
-
### Let the model and scripts help
|
|
195
|
-
|
|
196
|
-
| Entry point | What it does |
|
|
197
|
-
|---|---|
|
|
198
|
-
| `skill_mcp_manager_list / set_enabled / restart / add` | Let the model query and operate MCP servers |
|
|
199
|
-
| `skill_manager_list / set_enabled / create` | Let the model query and operate skills (creating asks for your consent) |
|
|
200
|
-
| `agentsmd_list / agentsmd_apply` | Let the model list the AGENTS.md preset library and switch the active preset (writes `~/.dsh/AGENTS.md`, effective for new sessions); **no create or delete**, so the model cannot wipe your presets |
|
|
201
|
-
| `rule_manager_list / read / write` | Let the model query and write scene memories (writes ask for your consent; can be disabled in settings) |
|
|
202
|
-
| `subagent_list / subagent_run` | Let the model list personas and run a one-shot persona subagent (result only, discarded afterwards; running asks for your consent by default, can be disabled in settings) |
|
|
203
|
-
| `POST /dsh-plugin-tool-management/api` | HTTP API for scripts (`{op, args}` protocol) |
|
|
204
|
-
|
|
205
|
-
> v0.4 **no longer registers slash commands** (there used to be `/mcp`, `/skills`, `/agents-md`,
|
|
206
|
-
> `/scene-memory`): they could only print a text snapshot, could not operate anything, and drifted from
|
|
207
|
-
> the panel state. Every one of them has an equivalent entry in the settings panel.
|
|
208
|
-
|
|
209
|
-
## Configuration & security
|
|
210
|
-
|
|
211
|
-
Optional fields on the plugin loader row (`dsh plugin add` inserts it automatically):
|
|
212
|
-
|
|
213
|
-
| Field | Description |
|
|
214
|
-
|---|---|
|
|
215
|
-
| `token` | Optional access token. When set, **every write operation and "Reveal"** requires the `x-dsh-token` header. The client reads it from localStorage (key `dsh-plugin-tool-management-token`; set it in the DevTools console and refresh), or via the `DSH_PLUGIN_TOOL_MANAGEMENT_TOKEN` environment variable. |
|
|
216
|
-
| `maxBodyBytes` | Request body cap, default 88 MiB (skill ZIP uploads need it). |
|
|
217
|
-
|
|
218
|
-
Why a token: the cross-site protection (POST-only + custom header + same-origin check) assumes DSH listens on localhost only. If you forward the port to a LAN or the public internet, the token is the last line of defense against strangers injecting MCP commands (equivalent to remote code execution) and reading plaintext secrets — not needed for local single-user setups.
|
|
219
|
-
|
|
220
|
-
## Where data lives
|
|
221
|
-
|
|
222
|
-
| Content | Location |
|
|
223
|
-
|---|---|
|
|
224
|
-
| MCP server definitions | `profiles/<profile>/cordis.patch.yml` (project) or `~/.dsh/cordis.patch.yml` (global), auto-`.bak` before every rewrite |
|
|
225
|
-
| Server notes / page settings / disabled tools / export | Sidecar JSON files under the DSH home (`dsh-plugin-tool-management-*.json`) |
|
|
226
|
-
| Skill toggle policy / custom directories | `~/.dsh/tool-management/state.json` |
|
|
227
|
-
| Skill recycle bin / import staging | `~/.dsh/tool-management/trash`, `uploads` |
|
|
228
|
-
| Skills created/imported by the plugin | `~/.dsh/tool-management/skills/<skill>/` (the official `~/.dsh/skills/` stays listed as a source, read-only) |
|
|
229
|
-
| AGENTS.md presets / applied file | `~/.dsh/tool-management/agents-md/<preset id>/AGENTS.md`; "Apply" writes `~/.dsh/AGENTS.md` |
|
|
230
|
-
| Archived session ledger / retention | Plugin dir `data/history-archived-at.json`, `data/history-retention.json` |
|
|
231
|
-
| Memory files (source of truth) | `~/.dsh/tool-management/memories/<scene>/<name>.md` (flat) or `<scene>/<name>/SKILL.md` (bundle); scene names may be non-ASCII; the reserved scene **`global`** (shown as "Global") is injected into every conversation; a bare `.md` in the `memories/` root belongs to no scene and is **never injected** (the checkup reports `noScene`) |
|
|
232
|
-
| Memory index / scene records / enabled scenes | `~/.dsh/tool-management/rules-index.json` (`enabled` / order / tags + `scenes` records (label/description/order) + `active` enabled-scene set (`null` = all) + `archives` profile selections + `mode` snapshot) |
|
|
233
|
-
| Persona files (source of truth) | `~/.dsh/tool-management/agents/<persona>.md` (frontmatter optional, body = persona prompt) |
|
|
234
|
-
| Page settings / confirm switches | `~/.dsh/dsh-plugin-tool-management-settings.json` (`requireConfirmForModelSubagentRun` etc.) |
|
|
235
|
-
| Memory recycle bin | `~/.dsh/tool-management/rules-trash/<trashId>/` (deleted memories land here and can be restored) |
|
|
236
|
-
| Runtime log | `~/.dsh/dsh-plugin-tool-management.log` (rolling) |
|
|
237
|
-
|
|
238
|
-
## FAQ
|
|
239
|
-
|
|
240
|
-
| Symptom | Fix |
|
|
241
|
-
|---|---|
|
|
242
|
-
| Pages missing in Settings after install | Hard refresh; if that fails, restart DSH once. |
|
|
243
|
-
| Duplicate MCP tabs / duplicated tools | Stale loader row double-mounting the plugin — remove the old entry from `cordis.patch.yml` and restart. |
|
|
244
|
-
| Broken config, DSH won't boot | Restore the newest `cordis.patch.yml.bak-<timestamp>` next to it. |
|
|
245
|
-
| Page data not refreshing | Wait for the automatic polling (default 5s) or click "Refresh". |
|
|
246
|
-
| Latest version not found on a mirror | Add `--registry=https://registry.npmjs.org` and retry later. |
|
|
247
|
-
| Do the confirmations still apply in full access (`approval=never`)? | **No, and no card appears.** The three confirm gates (`rule_manager_write` / `skill_manager_create` / `subagent_run`) treat a `never` session as "the user has pre-approved", so they pass straight through and write a `confirm-bypass` line to `~/.dsh/dsh-plugin-tool-management.log`. Switch the access mode back to "workspace write" to get asked again, or turn off a single gate with the matching `requireConfirmForModel*` setting. |
|
|
248
|
-
| `subagent_run` reports "spawn provider unavailable" | **Conditional**: the host ships a `spawn` provider (recent versions need no extra package and no mount). It only appears when the host really registers none *and* this plugin cannot mount `@deepseek-ai/dsh-subagent-spawn-in-process` either — the message carries the original reason, and it is mostly an older version or a specific profile. Mount that package in the host profile and restart DSH: this plugin deliberately keeps it out of `cordis.patch.yml` so a host without the package still boots. |
|
|
249
|
-
| The scene binds only persona A, so why did an unbound subagent still run? | **There are two subagent channels.** This plugin's `subagent_run` goes through its confirm gate and the scene persona binding; DSH's own `subagent` / `subagent_fork` are host capabilities with **no confirm gate and no notion of this plugin's personas**, so they honour neither in any mode (verified live: in one message the official `subagent` returned with no approval card while the following `subagent_run` did prompt; `subagent_fork` likewise ran card-free). This plugin's governance covers `subagent_run` only — tightening the official pair would take a host-side convention or a later version that brings them into the plugin's pre-execute gate. |
|
|
250
|
-
|
|
251
|
-
## Development
|
|
252
|
-
|
|
253
|
-
```bash
|
|
254
|
-
npm install
|
|
255
|
-
npm run build # build (tsc + sync client bundle)
|
|
256
|
-
npm run build:client # sync src/client.js → lib/client.js only
|
|
257
|
-
npm run lint # syntax self-check (node --check on both artifacts)
|
|
258
|
-
npm run check:i18n # zh/en dictionary key-set + placeholder alignment
|
|
259
|
-
npm test # build + i18n check + all semantic-contract tests (node --test test/*.test.mjs, 11 groups / 85 cases)
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
> Changes are verified by **actually exercising the real behaviour** (evidence and known issues live in
|
|
263
|
-
> [Changelog](docs/Changelog.md)) instead of asserting what the code currently does — the latter
|
|
264
|
-
> just copies the implementation and passes by construction. The exception is eleven groups of
|
|
265
|
-
> **semantic-contract** tests (`npm test`, run against the built `lib/`, 85 cases):
|
|
266
|
-
> `archive.test.mjs` (engine state machine), `import.test.mjs` (ZIP expansion, landing plans, limit
|
|
267
|
-
> reporting), `approval-policy.test.mjs` (never-policy detection, driving a real cordis context and
|
|
268
|
-
> a real `ApprovalService`), `subagent-scene.test.mjs` (scene binding must reject *before* a
|
|
269
|
-
> subagent runs), `subagent-persona.test.mjs` (persona frontmatter round-trip: `provider`,
|
|
270
|
-
> `model` and `toolsDeny` survive a UI save; creating a persona with no directory present),
|
|
271
|
-
> `hub-layout.test.mjs` (unified data directory: legacy layouts move without overwriting, the
|
|
272
|
-
> reserved `global` scene always exists and cannot be deleted, a memory must belong to an existing
|
|
273
|
-
> scene, and the profile memory section only affects projection), `skills-delete.test.mjs` (which
|
|
274
|
-
> skills may be deleted: user-level sources cannot be, read-only sources stay read-only),
|
|
275
|
-
> `skills-state.test.mjs` (state-file read resilience: missing keys self-heal, type errors stay
|
|
276
|
-
> fail-closed), `skills-source-remove.test.mjs` (the "remove a source" semantics: a removed source is
|
|
277
|
-
> no longer read, drops out of the same-name priority and is invisible to the model, while not a byte
|
|
278
|
-
> on disk changes and it can be restored), `client-exports.test.mjs`
|
|
279
|
-
> (client export contract: evaluating the factory alone — without running `apply` — must already
|
|
280
|
-
> expose `dict`/`pages`; exports written inside the `apply` method body are rejected), and
|
|
281
|
-
> `client-render.test.mjs` (assembly and rendering: a fake ctx drives the whole `apply`, asserts
|
|
282
|
-
> `settings.section` is registered, then renders the entire component tree without throwing; it also
|
|
283
|
-
> pins the **Scenes page contract** — the reserved `global` scene does not appear there (an
|
|
284
|
-
> only-global data set renders the empty state), switchable presets still render, and an over-long
|
|
285
|
-
> description is always clipped to the cap — plus the **profile default-pick contract**: "Add" on
|
|
286
|
-
> MCP/skills/
|
|
287
|
-
> subagents yields an empty set, the memory section pre-checks only the enabled `global` memories,
|
|
288
|
-
> and "Select all" really selects everything — plus the **mode-bar state contract**: the "Active
|
|
289
|
-
> mode" bar exists only while a mode is active and is absent otherwise). They
|
|
290
|
-
> assert contracts, not
|
|
291
|
-
> implementation copies; real-behaviour
|
|
292
|
-
> acceptance still happens
|
|
293
|
-
> in the browser/host and these tests do not replace it.
|
|
294
|
-
> `npm run check:i18n` additionally checks the zh/en dictionaries for key-set and placeholder
|
|
295
|
-
> drift, and `node scripts/i18n-debt.mjs` reports how much hard-coded Chinese is left (113 lines
|
|
296
|
-
> today: 38 on the prompts page, 75 on the sessions page).
|
|
297
|
-
|
|
298
|
-
Layout: host half `src/index.ts` (object-form Cordis plugin, `lib/index.js` is the shipped artifact); data-directory constants and migration `src/hub.ts`; skill core `src/skills/core.js` (pure Node); AGENTS.md presets `src/agents-md/service.ts`; archived session management `lib/history/` (`workspace.js` / `projcache.js` / `tombstone.js`); transcript import parsing `src/imports/parsers.js`; scene-memory store `src/rules/` (`service.ts` discovery/CRUD/index/checkup/two-phase section render, `provider.ts` per-agent `systemPrompt` section registration; the module path and `rules-*` op names stay as internal protocol, while the user-visible page and folder became “Scene Memory” / `memories/`); browser half `src/client.js` (ModuleLoader CJS bundle, `dsm-*` design system, talks to the host through the same-origin API). The only runtime dependency is `fflate` (ZIP extraction).
|
|
299
|
-
|
|
300
|
-
Publish: `npm version patch && npm publish` (`prepublishOnly` builds automatically).
|
|
301
|
-
|
|
302
|
-
## License
|
|
303
|
-
|
|
304
|
-
MIT
|
|
1
|
+
# dsh-plugin-tool-management
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/dsh-plugin-tool-management)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
[](package.json)
|
|
6
|
+
[](https://github.com/ouli-1242/dsh-plugin-tool-management)
|
|
7
|
+
[](https://dsh.market/)
|
|
8
|
+
|
|
9
|
+
[简体中文](README.md) · **English** · [Changelog](CHANGELOG.md) · [Release overview](docs/update.md)
|
|
10
|
+
|
|
11
|
+
- An **MCP, skills, scenes, memories, subagents, prompts & archived sessions** manager for DeepSeek Harness.
|
|
12
|
+
- Eight tabs: **Scenes**, **MCP**, **Skills**, **Subagents**, **Prompts**, **Memories**, **Sessions**, **Host**.
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
dsh plugin --profile web add dsh-plugin-tool-management@latest
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Hard-refresh the browser (Cmd/Ctrl+Shift-R) afterwards — a **Tools** panel in Settings means it worked. No hand-editing of `cordis.patch.yml`, no skill source files touched, configuration survives restarts and upgrades.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Screenshots
|
|
23
|
+
|
|
24
|
+
| | |
|
|
25
|
+
|:---:|:---:|
|
|
26
|
+
|  |  |
|
|
27
|
+
| **Scenes** | **MCP** |
|
|
28
|
+
|  |  |
|
|
29
|
+
| **Skills** | **Subagents** |
|
|
30
|
+
|  |  |
|
|
31
|
+
| **Prompts** | **Memories** |
|
|
32
|
+
|  |  |
|
|
33
|
+
| **Sessions** | **Host** |
|
|
34
|
+
|
|
35
|
+
## Highlights
|
|
36
|
+
|
|
37
|
+
| Capability | Description |
|
|
38
|
+
|---|---|
|
|
39
|
+
| Scene memory | `.md` bodies in an enabled scene are **injected into the system prompt**, effective on the next request |
|
|
40
|
+
| Scene profile | Every scene freely combines **MCP tools / skills / subagents / memories**; "Enter mode" narrows injection in one click |
|
|
41
|
+
| Scene prompt | A scene can bind a prompt preset; switching scenes rewrites `~/.dsh/AGENTS.md` (auto-restores on exit) |
|
|
42
|
+
| Per-tool switches | **Individual tools** inside one MCP server can be disabled: invisible to the model, blocked at call time |
|
|
43
|
+
| Restart semantics | Restart only reconnects — it **never flips the enabled state** |
|
|
44
|
+
| Secret safety | Secrets masked by default; "Reveal" & export **require a token** — no `token` configured means no plaintext |
|
|
45
|
+
| Skill sources | Hooks up `~/.agents` / `~/.codex` / `~/.claude` & custom dirs; default sources must be read but skills can be deleted |
|
|
46
|
+
| Recycle bin | Personas / scenes / prompts / memories / skills all go to recycle bin on delete, restorable |
|
|
47
|
+
| AGENTS.md presets | Multiple global baselines, one-click apply, 5-generation backup |
|
|
48
|
+
| Archived sessions | Grouped by project, batch restore / delete, retention cleanup; rebuildable after workspace deletion |
|
|
49
|
+
| Transcript import/export | Take over Claude Code / Cursor / Codex / any text; export Markdown / JSONL |
|
|
50
|
+
| Subagents | One file per persona, run-and-discard, never enters History, inherits scene memories |
|
|
51
|
+
| Prefix-cache friendly | Section text depends only on enabled scenes + file contents, byte-stable |
|
|
52
|
+
| Compatibility check | The **Host** tab shows host capabilities, per-action routing, and degradations at a glance |
|
|
53
|
+
| Model tools | **14** (`skill_mcp_manager_*` / `skill_manager_*` / `agentsmd_*` / `rule_manager_*` / `subagent_*`) |
|
|
54
|
+
| UI | Custom design system, **eight tabs**, bilingual, follows host language |
|
|
55
|
+
|
|
56
|
+
## Quick start
|
|
57
|
+
|
|
58
|
+
Prerequisites: DSH installed (`dsh web` runs), Node.js ≥ 18.
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
dsh plugin --profile web add dsh-plugin-tool-management@latest # install / update
|
|
62
|
+
dsh plugin --profile web remove dsh-plugin-tool-management # uninstall
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Hard-refresh the browser — a **Tools** panel with eight tabs means it worked. Client changes hot-reload; host-side changes need `dsh web` restarted.
|
|
66
|
+
|
|
67
|
+
You can also ask the model:
|
|
68
|
+
|
|
69
|
+
```text
|
|
70
|
+
Install the dsh-plugin-tool-management plugin:
|
|
71
|
+
dsh plugin --profile web add dsh-plugin-tool-management@latest
|
|
72
|
+
Then remind me to hard-refresh the browser.
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
The model can manage everything above via 14 tools (see highlights); scripts use `POST /dsh-plugin-tool-management/api` (`{op, args}` protocol).
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Features
|
|
80
|
+
|
|
81
|
+
### Scenes & memories
|
|
82
|
+
|
|
83
|
+
- **A scene = a group, a memory = a `.md` file**. `memories/<scene>/<name>.md`, the whole body is injected, file names can be non-ASCII.
|
|
84
|
+
- **Single-choice toggle**: only one scene at a time (others greyed out); turning all off = only `global` and `_shared` inject. New scenes start off.
|
|
85
|
+
- **Scene-bound prompt**: switching scenes rewrites `~/.dsh/AGENTS.md` (5-gen backup, auto-restore on exit).
|
|
86
|
+
- **Scene profile**: every scene combines MCP tools / skills / subagents / memories (any mix); "Enter mode" applies and narrows in one click, exit restores verbatim.
|
|
87
|
+
- **Import**: `.md` / `.zip` (dir name = scene, bundles carry attachments), same names skipped never overwritten, over-limit items reported.
|
|
88
|
+
- **Injection budget**: default 64 KiB, oversized memories skipped with a list. Deletes go to recycle bin.
|
|
89
|
+
|
|
90
|
+
### Subagents
|
|
91
|
+
|
|
92
|
+
- **One file per persona**: `agents/<persona>.md`, frontmatter entirely optional.
|
|
93
|
+
- **Tool limits per Agent preset**: each preset gets its own allow/deny list (mutually exclusive), effective at runtime by the current preset — fixes the old "union of all presets" list that broke subagents after a preset switch.
|
|
94
|
+
- **Run and discard**: `subagent_run` runs with the persona, returns only the result, never enters History, inherits scene memories. Scenes can bind which personas are available.
|
|
95
|
+
|
|
96
|
+
### MCP servers
|
|
97
|
+
|
|
98
|
+
- **CRUD + immediate effect**: writes to `cordis.patch.yml`, HMR picks it up.
|
|
99
|
+
- **Per-tool switches**: disable individual tools (invisible to the model, blocked at call), whole-server batch.
|
|
100
|
+
- **Secret masking**: defaults to `••••••`, "Reveal" needs a token.
|
|
101
|
+
- **Migrate & back up**: cross-project/global migration rolls back on failure; JSON export/import.
|
|
102
|
+
|
|
103
|
+
### Skills
|
|
104
|
+
|
|
105
|
+
- **Sources at a glance**: project / DSH / Agents / Codex / Claude / custom dirs, grouped by source.
|
|
106
|
+
- **Opposite permissions**: default sources must be read but skills can be deleted; external dirs can be disabled/removed but skills are read-only.
|
|
107
|
+
- **Remove ≠ disable**: remove = directory not scanned at all (files untouched, restorable); disable = still listed but not callable.
|
|
108
|
+
- **Same-name picker / custom dirs / ZIP import / recycle bin**.
|
|
109
|
+
|
|
110
|
+
### Prompt presets
|
|
111
|
+
|
|
112
|
+
- Multiple `~/.dsh/AGENTS.md` baselines, one-click apply (new sessions only, current unchanged), 5-gen backup.
|
|
113
|
+
- Create with body inline, edit can change id (= dir rename, scene bindings follow). Active preset can't be deleted; deletes go to recycle bin.
|
|
114
|
+
|
|
115
|
+
### Archived sessions
|
|
116
|
+
|
|
117
|
+
- Grouped by project, search, batch restore / delete, retention auto-cleanup.
|
|
118
|
+
- Workspace registration deleted → group rebuilt from session dirs, one-click re-register.
|
|
119
|
+
- Import Claude Code / Cursor / Codex / any text; export Markdown / JSONL.
|
|
120
|
+
|
|
121
|
+
### Host compatibility
|
|
122
|
+
|
|
123
|
+
The plugin uses the host's own `@deepseek-ai/*` libraries at runtime — they must be the same physical modules, or every "adapt to host" decision degrades into guesswork.
|
|
124
|
+
|
|
125
|
+
- **Host tab**: host version, usable capability count, per-action routing (native/adapter/unavailable), degradations & reasons. Read-only.
|
|
126
|
+
- **Command line**: `node scripts/doctor.mjs` (check), `node scripts/host-deps.mjs --fix` (align deps).
|
|
127
|
+
- Under `minimal` preset, scene memory / AGENTS.md / skill directory don't take effect (by design); the Host tab marks this per column.
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Where data lives
|
|
132
|
+
|
|
133
|
+
| Content | Location |
|
|
134
|
+
|---|---|
|
|
135
|
+
| MCP definitions | `cordis.patch.yml` (auto `.bak` before rewrite) |
|
|
136
|
+
| Skill policy / custom dirs | `~/.dsh/tool-management/state.json` |
|
|
137
|
+
| Skills / memories / personas / presets | `~/.dsh/tool-management/{skills,memories,agents,agents-md}/` |
|
|
138
|
+
| Recycle bin | `~/.dsh/tool-management/trash/` |
|
|
139
|
+
| Archive ledger / retention | `~/.dsh/tool-management/history-*.json` |
|
|
140
|
+
| Memory index / scenes / profiles | `~/.dsh/tool-management/rules-index.json` |
|
|
141
|
+
| Page settings | `~/.dsh/dsh-plugin-tool-management-settings.json` |
|
|
142
|
+
| Runtime log | `~/.dsh/dsh-plugin-tool-management.log` |
|
|
143
|
+
|
|
144
|
+
**No user data is stored inside the plugin's install directory** (`dsh plugin update` replaces it wholesale).
|
|
145
|
+
|
|
146
|
+
## Configuration & security
|
|
147
|
+
|
|
148
|
+
| Field | Description |
|
|
149
|
+
|---|---|
|
|
150
|
+
| `token` | Access token. When set, **all writes + plaintext secrets** require `x-dsh-token`; **unset = plaintext endpoints closed**. Also the escape hatch for curl / LAN. |
|
|
151
|
+
| `maxBodyBytes` | Request body cap, default 88 MiB. |
|
|
152
|
+
|
|
153
|
+
- **Browser**: reads/writes via cookie, no token needed; but **plaintext secrets** (Reveal / export) need a token.
|
|
154
|
+
- **curl / scripts**: send `x-dsh-token`, or carry the browser cookie.
|
|
155
|
+
- **Port forwarded to public**: configure a token — prevents strangers injecting MCP commands (≈ remote code execution) and stealing secrets.
|
|
156
|
+
|
|
157
|
+
## FAQ
|
|
158
|
+
|
|
159
|
+
| Symptom | Fix |
|
|
160
|
+
|---|---|
|
|
161
|
+
| Pages missing after install | Hard refresh; restart DSH if that fails. |
|
|
162
|
+
| Duplicate MCP tabs | Remove the stale loader row from `cordis.patch.yml`, restart. |
|
|
163
|
+
| Broken config, DSH won't boot | Restore the newest `.bak-<timestamp>`. |
|
|
164
|
+
| Action stopped after DSH upgrade | Settings → Tools → **Host** for the reason; `doctor.mjs` → `host-deps.mjs --fix`. |
|
|
165
|
+
| Still asked to confirm in `approval=never`? | No card appears — straight through with a log line; switch back to "workspace write" to get asked again. |
|
|
166
|
+
| `subagent_run` reports spawn unavailable | Host has no spawn provider; mount `@deepseek-ai/dsh-subagent-spawn-in-process` and restart. |
|
|
167
|
+
| Scene binds persona A, but official `subagent` ran something else | Two channels: this plugin only governs `subagent_run`; official `subagent` / `subagent_fork` have no gate and don't know about personas. |
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## Development
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
npm install
|
|
175
|
+
npm run build # tsc + sync client
|
|
176
|
+
npm test # build + i18n + semantic-contract tests
|
|
177
|
+
npm run check:i18n # dictionary self-check
|
|
178
|
+
npm run doctor # host compatibility check
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
`lib/` is not tracked — run `npm run build` after cloning. Changes need `dsh web` restarted. Runtime dep is only `fflate`; `@deepseek-ai/*` all come from the host.
|
|
182
|
+
|
|
183
|
+
## License
|
|
184
|
+
|
|
185
|
+
MIT
|