dsh-plugin-tool-management 0.19.0 → 0.19.1
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 +31 -0
- package/README.md +254 -223
- package/README_EN.md +223 -223
- package/docs/images/logo.png +0 -0
- package/docs/images/promo-cover-EN.png +0 -0
- package/docs/images/promo-cover.png +0 -0
- package/docs/update.md +28 -518
- package/lib/client.js +805 -84
- package/lib/index.js +40 -0
- package/lib/op-registry.js +16 -1
- package/lib/ops/prompts.js +64 -7
- package/lib/ops/trash-retention.js +55 -0
- package/lib/prompts/service.js +191 -25
- package/lib/scene-prompt-sync.js +1 -1
- package/lib/tools/scene.js +4 -1
- package/lib/trash-retention.js +256 -0
- package/package.json +1 -1
package/README_EN.md
CHANGED
|
@@ -1,223 +1,223 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
[](https://www.npmjs.com/package/dsh-plugin-tool-management)
|
|
8
|
+
[](LICENSE)
|
|
9
|
+
[](package.json)
|
|
10
|
+
[](https://github.com/ouli-1242/dsh-plugin-tool-management)
|
|
11
|
+
|
|
12
|
+
[](https://dsh.market/)
|
|
13
|
+
[](https://awesome-dsh-plugin.com)
|
|
14
|
+
[](https://dshfind.com/en/plugins/ouli-1242/dsh-plugin-tool-management)
|
|
15
|
+
[](https://github.com/0xsline/awesome-deepseek-harness)
|
|
16
|
+
|
|
17
|
+
[简体中文](README.md) · **English** · [Changelog](CHANGELOG.md) · [Release overview](docs/update.md)
|
|
18
|
+
|
|
19
|
+
An **MCP, skills, scenes, memories, subagents, prompts & archived sessions** manager for DeepSeek Harness. Eight tabs: Scenes / MCP / Skills / Subagents / Prompts / Memories / Sessions / Host.
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
dsh plugin --profile web add dsh-plugin-tool-management@latest # web
|
|
23
|
+
dsh plugin --profile desktop add dsh-plugin-tool-management@latest # desktop
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Hard-refresh the browser after installing for web (Cmd/Ctrl+Shift+R), or restart the desktop app after installing for desktop — a **Tools** panel in Settings means it worked. The plugin only writes its own files, never touches skill sources, and your configuration survives restarts and upgrades.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Demo
|
|
31
|
+
|
|
32
|
+
<video controls src="https://github.com/user-attachments/assets/91b9673d-d201-462a-83de-8bc663c7629d"></video>
|
|
33
|
+
|
|
34
|
+
Every interface shown is a real screenshot of the running product — no redrawn UI, no fabricated controls.
|
|
35
|
+
|
|
36
|
+
Music: Kevin MacLeod「Limit 70」, [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Screenshots
|
|
41
|
+
|
|
42
|
+
| | |
|
|
43
|
+
|:---------------------------------:|:----------------------------------:|
|
|
44
|
+
|  |  |
|
|
45
|
+
| **Scenes** | **MCP** |
|
|
46
|
+
|  |  |
|
|
47
|
+
| **Skills** | **Subagents** |
|
|
48
|
+
|  |  |
|
|
49
|
+
| **Prompts** | **Memories** |
|
|
50
|
+
|  |  |
|
|
51
|
+
| **Sessions** | **Host** |
|
|
52
|
+
|
|
53
|
+
## Highlights
|
|
54
|
+
|
|
55
|
+
In one line: **configure "work / writing / coding" each as a scene and switch the whole stack with one click — and the model always sees whatever this plugin manages.**
|
|
56
|
+
|
|
57
|
+
| Highlight | What it means |
|
|
58
|
+
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
|
|
59
|
+
| One-click scene switch | Each scene carries its own MCP / skills / personas / memories; entering applies them, leaving restores. The model can switch for you too |
|
|
60
|
+
| Manage without leaving chat | Type `/` for a "Tools" section and toggle any domain's items — one click, done |
|
|
61
|
+
| Memories reach the model | A few `.md` files under a scene become its knowledge base, injected automatically |
|
|
62
|
+
| Notes for MCP servers | A note you write is seen by the model every turn and acted on |
|
|
63
|
+
| Disable a single tool | Mute one tool on a server: invisible to the model and uncallable |
|
|
64
|
+
| Skills at a glance | The copy in effect is marked "preferred"; shadowed ones name the winning source |
|
|
65
|
+
| Subagent = one file, one role | Write a role file and delegate to it; only the result comes back, never in History |
|
|
66
|
+
| Several prompt presets | Keep multiple `AGENTS.md` baselines and switch with one click; each scene can bind its own, or none |
|
|
67
|
+
| Sessions no longer lost | Archives grouped by project, searchable, batch-restorable; imports Claude Code / Cursor / Codex transcripts |
|
|
68
|
+
| The model always sees it | One context message per domain, republished only when the content changes |
|
|
69
|
+
| Lock it and relax | Locking a scene makes create/update/delete across the five domains read-only |
|
|
70
|
+
| Deleted is not gone | Skills / memories / personas / presets / scenes land in a recycle bin (permanent session deletion excepted); tick items to delete in bulk, or set a retention period so it cleans itself (keep-forever by default) |
|
|
71
|
+
| Safe by default | Only the plugin's own files are written; secrets masked, plaintext needs a token |
|
|
72
|
+
|
|
73
|
+
## Quick start
|
|
74
|
+
|
|
75
|
+
Prerequisites: DSH installed (`dsh web` runs), Node.js ≥ 18. Pick the profile matching your client: `--profile web` for the browser app, `--profile desktop` for the desktop app. The desktop profile is initialized by DSH Desktop itself — open the app once, then quit it completely before running the command.
|
|
76
|
+
|
|
77
|
+
```sh
|
|
78
|
+
dsh plugin --profile web add dsh-plugin-tool-management@latest # web · install / update
|
|
79
|
+
dsh plugin --profile web remove dsh-plugin-tool-management # web · uninstall
|
|
80
|
+
dsh plugin --profile desktop add dsh-plugin-tool-management@latest # desktop · install / update
|
|
81
|
+
dsh plugin --profile desktop remove dsh-plugin-tool-management # desktop · uninstall
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Hard-refresh the browser (web) or restart the desktop app, then a **Tools** panel with eight tabs means it worked. Client changes hot-reload; host-side changes need the client restarted (`dsh web` / the desktop app).
|
|
85
|
+
|
|
86
|
+
You can also ask the model:
|
|
87
|
+
|
|
88
|
+
```text
|
|
89
|
+
Install the dsh-plugin-tool-management plugin:
|
|
90
|
+
dsh plugin --profile web add dsh-plugin-tool-management@latest
|
|
91
|
+
Then remind me to hard-refresh the browser.
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
For the desktop app, swap `web` for `desktop` and end with "remind me to restart the desktop app" instead.
|
|
95
|
+
|
|
96
|
+
## Features
|
|
97
|
+
|
|
98
|
+
### Slash commands (manage from the chat box)
|
|
99
|
+
|
|
100
|
+
- **Type `/` for a "Tools" section**: scenes / skills / MCP servers / subagents / prompts / memories. Click a row to enter that domain, click an item to apply it; the menu stays open.
|
|
101
|
+
- **State is visible** (green check / empty box / note in grey), and long lists scroll on their own; each external skill directory gets one row that toggles the whole source.
|
|
102
|
+
- **Only reversible actions**: entering a scene and the various toggles; create / delete / edit / import / export stay on their own pages.
|
|
103
|
+
|
|
104
|
+
### Scenes & memories
|
|
105
|
+
|
|
106
|
+
- **A scene = a group, a memory = a `.md` file**: `memories/<scene>/<name>.md`, the whole body is injected.
|
|
107
|
+
- **"Enabled" and "entered" are two axes**: enabled decides which scene the injection follows (single-select; none enabled = only `global` and `_shared`); entering applies the scene's whole MCP / skills / personas set and writes its bound prompt into `AGENTS.md`.
|
|
108
|
+
- **Scene profile**: ticked = on, unchecked = off, a section never created means that domain is off; leaving restores the pre-scene state.
|
|
109
|
+
- **Every domain offers "None"**: for MCP / skills / personas / memories / global prompt it means the scene leaves that domain alone; for quick prompts it means none are enabled while the scene is on, and it is the default for a new scene.
|
|
110
|
+
- **Scene lock** makes those five domains read-only; deleting a scene takes its memories with it into one recycle-bin entry. Import / export `.md` / `.zip`, same names skipped.
|
|
111
|
+
|
|
112
|
+
### Subagents
|
|
113
|
+
|
|
114
|
+
- **One file per persona**: `subagents/<persona>.md`, frontmatter entirely optional.
|
|
115
|
+
- **Delegation**: `subagent_manager_run` runs with the persona, returns only its final result, and never enters History; `inherit: true` seeds the child with this conversation's finished turns.
|
|
116
|
+
- **On/off**: a disabled persona is neither injected nor visible to the model; new / imported / restored personas start disabled.
|
|
117
|
+
- **Tool limits per agent preset**: one allow or deny list per preset (mutually exclusive). Model and provider are picked from the host LLM catalogue; empty means inherit the main session.
|
|
118
|
+
|
|
119
|
+
### MCP servers
|
|
120
|
+
|
|
121
|
+
- **CRUD with immediate effect**: written into `cordis.patch.yml`, backed up before every change.
|
|
122
|
+
- **Per-tool switches**: disable individual tools, or a whole server; a stopped server still shows the tools last seen.
|
|
123
|
+
- **Secret masking**: a credential is replaced as a whole, and "Reveal" needs a token; a masked value is never written back.
|
|
124
|
+
- A per-server note travels along as a decision hint; migration rolls back on failure, with JSON export/import.
|
|
125
|
+
|
|
126
|
+
### Skills
|
|
127
|
+
|
|
128
|
+
- **Sources at a glance**: project / DSH / Agents / Codex / Claude / custom directories, grouped by source.
|
|
129
|
+
- **Opposite permissions**: default sources are readable and their skills deletable; external directories can be disabled or removed but their files stay read-only.
|
|
130
|
+
- **Remove ≠ disable**: removing stops scanning the directory at all (nothing is written, restorable); disabling keeps it listed but uncallable.
|
|
131
|
+
- The winning copy of a shared name is marked "preferred"; custom directories, ZIP import/export and the recycle bin are all here.
|
|
132
|
+
|
|
133
|
+
### Prompt presets
|
|
134
|
+
|
|
135
|
+
- Multiple `~/.dsh/AGENTS.md` baselines, applied with one click (next turn), with 5 generations of backups; each preset can carry a one-line description that is never injected.
|
|
136
|
+
- **The switch on the left of a card is the answer to "is this one in effect"**: flip it on and that preset is written into `AGENTS.md`; flip it off to **un-apply**, which restores the state from before you started applying (and deletes the file if there was none back then). The confirmation says which one it will be, and a receipt afterwards states what happened.
|
|
137
|
+
- **Two kinds cannot be deleted directly**: a scene-bound preset, and the one currently applied. The copy auto-created on first open can be deleted. Deletes always go to the recycle bin.
|
|
138
|
+
- **Quick prompts** (the second section on the same page): save a piece of text you keep typing, then hit `/` and click it; a scene can bind a set of them.
|
|
139
|
+
- **This page's recycle bin is split in two by domain**, each half scrolling on its own with its own batch bar.
|
|
140
|
+
|
|
141
|
+
### Archived sessions
|
|
142
|
+
|
|
143
|
+
- Grouped by project, searchable, batch restore / delete, retention auto-cleanup; a workspace whose registration was deleted can be re-registered in one click.
|
|
144
|
+
- Import Claude Code / Cursor / Codex / any text; export Markdown / JSONL in three cumulative modes: text only → plus tool calls → plus reasoning. **An export is a transcript, not a backup**.
|
|
145
|
+
|
|
146
|
+
### Host compatibility
|
|
147
|
+
|
|
148
|
+
- **Host tab**: host version, usable capability count, per-action routing (native / adapter / unavailable), degradations and reasons; three write entries: access token, injection settings, model tool table.
|
|
149
|
+
- **Command line**: `node scripts/doctor.mjs` (health check), `node scripts/host-deps.mjs --fix` (align dependencies).
|
|
150
|
+
- Under a **suppressing preset** such as `minimal`, this plugin's injection is off by default; the Host tab can force any domain back on.
|
|
151
|
+
- Unchecking "Skills" or "Prompt" really stops them — under standard presets the host delivers those two itself.
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Where data lives
|
|
156
|
+
|
|
157
|
+
| Content | Location |
|
|
158
|
+
| -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
|
|
159
|
+
| MCP definitions | `~/.dsh/cordis.patch.yml` (written by the plugin; pre-write copies land in the hub's `backups/`) |
|
|
160
|
+
| Skill policy / custom dirs | `~/.dsh/tool-management/skills-state.json` |
|
|
161
|
+
| Skills / memories / personas / presets | `~/.dsh/tool-management/{skills,memories,subagents,prompts}/` |
|
|
162
|
+
| Subagent toggles | `~/.dsh/tool-management/subagents-index.json` |
|
|
163
|
+
| Recycle bin (skills / personas / presets / scenes) | `~/.dsh/tool-management/trash/{skills,subagents,prompts,scenes}-trash/` |
|
|
164
|
+
| Memory recycle bin | `~/.dsh/tool-management/memories-trash/` (a directory at the hub root, not under `trash/`) |
|
|
165
|
+
| Archive ledger / retention | `~/.dsh/tool-management/history-*.json` |
|
|
166
|
+
| Recycle-bin retention | `~/.dsh/tool-management/trash-retention.json` (`0` = keep forever) |
|
|
167
|
+
| Memory index / scenes / profiles | `~/.dsh/tool-management/memories-index.json` |
|
|
168
|
+
| MCP sidecars (disabled tools / known tools / notes / settings) | `~/.dsh/tool-management/mcp-*.json` |
|
|
169
|
+
| Injection settings (six domain switches) | `~/.dsh/tool-management/inject-settings.json` |
|
|
170
|
+
| Model tool table (switched-off tools + saved sets) | `~/.dsh/tool-management/tool-table.json` |
|
|
171
|
+
| Scene page preference (preview card before entering a scene) | `~/.dsh/tool-management/scene-settings.json` |
|
|
172
|
+
| Runtime log / patch backups | `~/.dsh/tool-management/tool-management.log` · `backups/` |
|
|
173
|
+
|
|
174
|
+
**No user data is stored inside the plugin's install directory** (`dsh plugin update` replaces it wholesale). `backups/` keeps **5 copies per patch file** — the global patch and each profile patch count separately.
|
|
175
|
+
|
|
176
|
+
## Configuration & security
|
|
177
|
+
|
|
178
|
+
| Field | What it does |
|
|
179
|
+
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
180
|
+
| `token` | Access token. Once set, **every write and every plaintext credential** requires `x-dsh-token`; with no token the plaintext endpoints are closed entirely. Prefer not to keep it in the config? Use the `DSH_PLUGIN_TOOL_MANAGEMENT_TOKEN` environment variable. |
|
|
181
|
+
| `tokenDisabled` | `true` = the token stays in the config but is not enforced (this is the line written by "Turn protection off"). Writes no longer need it; revealing plaintext still does. |
|
|
182
|
+
| `maxBodyBytes` | Request body cap, 88 MiB by default. |
|
|
183
|
+
|
|
184
|
+
**Plaintext on disk (read this)**: masking is **display-only**; MCP `env` / `headers` and the plugin's own `token` stay in cleartext inside `cordis.patch.yml` (and each profile copy), and every config change copies the whole file into `~/.dsh/tool-management/backups/` — unencrypted, never rotated, not reclaimed on uninstall. One secret can therefore exist as `5 × (patch files holding it) + 1` plaintext copies. The token gate decides *who may read plaintext over HTTP*; it does nothing about *reading the files*, where the only defence is your filesystem permissions. **To clean up: Settings → Tools → Host → "Clean old backups"**.
|
|
185
|
+
|
|
186
|
+
- **Browser**: reads and writes go through cookies, no token needed; **plaintext credentials** (reveal / export) do. The token is managed in the **Access token** block on the Host tab.
|
|
187
|
+
- **Every destructive direction asks for the current token again** (turn protection off / change / delete). Being unlocked this run does not count.
|
|
188
|
+
- **curl / scripts**: send `x-dsh-token`, or carry the browser cookie. Except for the fence's 401 / 403, failures come back as **HTTP 200 + `{ ok: false, error }`** — branch on `body.ok`.
|
|
189
|
+
- **Port forwarding**: when the host has no `connection` service the fence falls back to "loopback Host + same origin", which any local process can imitate. If you forward the port to a LAN or the public internet, **configure a token**.
|
|
190
|
+
- **Avoid `__` in a server name**: a tool's full name is `mcp__<server>__<tool>`, so an extra `__` inside a server name makes it ambiguous; the Host tab shows an informational note.
|
|
191
|
+
|
|
192
|
+
## FAQ
|
|
193
|
+
|
|
194
|
+
| Symptom | Fix |
|
|
195
|
+
| --------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
196
|
+
| Pages missing after install | Hard refresh; restart DSH if that fails. |
|
|
197
|
+
| Duplicate MCP tabs | Remove the stale loader row from `cordis.patch.yml`, restart. |
|
|
198
|
+
| Broken config, DSH won't boot | Restore the newest `cordis.patch.yml.<level>.bak-<timestamp>` from `~/.dsh/tool-management/backups/` (5 per patch file). |
|
|
199
|
+
| Action stopped working after a DSH upgrade | Settings → Tools → **Host** for the reason; `doctor.mjs` → `host-deps.mjs --fix`. |
|
|
200
|
+
| The model cannot call a tool it should have | Check the **Model tool table** on the Host tab — 15 tools ship switched off. The panel and scripts are unaffected either way. |
|
|
201
|
+
| Still asked to confirm with `approval=never`? | No card appears — straight through with a log line. Switch back to "workspace write" to get the questions again. |
|
|
202
|
+
| `subagent_manager_run` reports provider unavailable | The provider is not registered: `spawn` (default) / `fork` (`inherit`) come from `@deepseek-ai/dsh-subagent-spawn-in-process` / `-fork-in-process` — mount and restart. |
|
|
203
|
+
| Scene binds persona A, but the official `subagent` ran something else | Those two are host tools and this plugin cannot hide them; work matching a persona goes to `subagent_manager_run`, host tools only when no persona fits or a background job is needed. |
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Development
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
npm install
|
|
211
|
+
npm run build # tsc + sync client
|
|
212
|
+
npm test # build + i18n + contract tests (pure-function invariants & host contracts)
|
|
213
|
+
npm run check:i18n # dictionary self-check
|
|
214
|
+
npm run doctor # host compatibility check
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
`lib/` is not tracked — run `npm run build` after cloning. Changes need `dsh web` restarted. Runtime deps: `fflate` (export bundling) and `js-yaml` (parse check before writing host patches, loaded lazily); `@deepseek-ai/*` all come from the host.
|
|
218
|
+
|
|
219
|
+
> **Deployment note**: the profile mirror produced by `npm run build` does **not** include `node_modules`, so a runtime dependency added locally (e.g. `js-yaml`) must either be installed on the profile side or accepted as "patch-write check skipped and reported". Regular `npm install` deployments are unaffected.
|
|
220
|
+
|
|
221
|
+
## License
|
|
222
|
+
|
|
223
|
+
MIT
|
|
Binary file
|
|
Binary file
|
|
Binary file
|