dsh-plugin-tool-management 0.21.4 → 0.21.6

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.
Files changed (48) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +125 -225
  3. package/README_EN.md +131 -228
  4. package/docs/UPDATE.md +41 -39
  5. package/docs/images/1-EN.png +0 -0
  6. package/docs/images/1.png +0 -0
  7. package/docs/images/2-EN.png +0 -0
  8. package/docs/images/2.png +0 -0
  9. package/docs/images/3-EN.png +0 -0
  10. package/docs/images/3.png +0 -0
  11. package/docs/images/4-EN.png +0 -0
  12. package/docs/images/4.png +0 -0
  13. package/docs/images/5-EN.png +0 -0
  14. package/docs/images/5.png +0 -0
  15. package/docs/images/6-EN.png +0 -0
  16. package/docs/images/6.png +0 -0
  17. package/docs/images/7-EN.png +0 -0
  18. package/docs/images/7.png +0 -0
  19. package/docs/images/8-EN.png +0 -0
  20. package/docs/images/8.png +0 -0
  21. package/docs/images/banner-en.png +0 -0
  22. package/docs/images/banner-zh.png +0 -0
  23. package/lib/compat/host-roots.js +1 -1
  24. package/lib/compat/probe.js +7 -6
  25. package/lib/confirm-gate.js +134 -0
  26. package/lib/index.js +43 -0
  27. package/lib/op-registry.js +7 -5
  28. package/lib/ops/memory.js +10 -2
  29. package/lib/ops/prompts.js +2 -1
  30. package/lib/prompts/quick-service.js +3 -2
  31. package/lib/prompts/service.js +3 -2
  32. package/lib/subagents/persona-parse.js +44 -2
  33. package/lib/subagents/persona-write.js +11 -3
  34. package/lib/subagents/service.js +2 -2
  35. package/lib/subagents/tools.js +11 -2
  36. package/lib/tools/deps.js +61 -5
  37. package/lib/tools/mcp.js +28 -5
  38. package/lib/tools/memory.js +17 -4
  39. package/lib/tools/prompt.js +9 -3
  40. package/lib/tools/remove.js +101 -17
  41. package/lib/tools/scene.js +17 -3
  42. package/lib/tools/skills.js +12 -3
  43. package/lib/tools/table.js +4 -1
  44. package/lib/trash-retention.js +6 -2
  45. package/package.json +13 -13
  46. package/docs/images/icon.png +0 -0
  47. package/docs/images/promo-cover-EN.png +0 -0
  48. package/docs/images/promo-cover.png +0 -0
package/README_EN.md CHANGED
@@ -1,271 +1,174 @@
1
1
  <p align="center">
2
- <img src="docs/images/logo.png" width="120" height="120" alt="dsh-plugin-tool-management">
2
+ <img src="docs/images/banner-en.png" alt="Tool Management — one click swaps the entire environment" width="100%">
3
3
  </p>
4
4
 
5
- # dsh-plugin-tool-management
6
-
7
- [![npm version](https://img.shields.io/npm/v/dsh-plugin-tool-management?logo=npm&color=cb3837)](https://www.npmjs.com/package/dsh-plugin-tool-management)
8
- [![License](https://img.shields.io/badge/license-MIT-blue)](LICENSE)
9
- [![Node](https://img.shields.io/badge/node-%3E%3D18-339933?logo=node.js)](package.json)
10
- [![GitHub](https://img.shields.io/badge/GitHub-ouli--1242%2Fdsh--plugin--tool--management-181717?logo=github)](https://github.com/ouli-1242/dsh-plugin-tool-management)
5
+ <p align="center">
6
+ <a href="https://www.npmjs.com/package/dsh-plugin-tool-management"><img src="https://img.shields.io/npm/v/dsh-plugin-tool-management?logo=npm&color=cb3837&style=flat-square" alt="npm"></a>
7
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" alt="MIT"></a>
8
+ <img src="https://img.shields.io/badge/DSH-0.2.1-4f7cf7?style=flat-square" alt="DSH 0.2.1">
9
+ <a href="https://github.com/ouli-1242/dsh-plugin-tool-management"><img src="https://img.shields.io/badge/GitHub-ouli--1242-181717?logo=github&style=flat-square" alt="GitHub"></a>
10
+ </p>
11
11
 
12
- [![DSH Market](https://raw.githubusercontent.com/2BingLing/dsh-market/master/assets/readme/badge-listed-en.svg)](https://dsh.market/)
13
- [![awesome-dsh-plugin](https://img.shields.io/badge/awesome--dsh--plugin-listed-3fb950)](https://awesome-dsh-plugin.com)
14
- [![dshfind](https://dshfind.com/api/badge/ouli-1242/dsh-plugin-tool-management?lang=en)](https://dshfind.com/en/plugins/ouli-1242/dsh-plugin-tool-management)
15
- [![0xsline](https://img.shields.io/badge/0xsline-listed-3fb950)](https://github.com/0xsline/awesome-deepseek-harness)
12
+ <p align="center">
13
+ <a href="https://dsh.market/"><img src="https://raw.githubusercontent.com/2BingLing/dsh-market/master/assets/readme/badge-listed-en.svg" height="20" alt="DSH Market"></a>
14
+ <a href="https://awesome-dsh-plugin.com"><img src="https://img.shields.io/badge/awesome--dsh--plugin-listed-3fb950?style=flat-square" alt="awesome-dsh-plugin"></a>
15
+ <a href="https://dshfind.com/en/plugins/ouli-1242/dsh-plugin-tool-management"><img src="https://dshfind.com/api/badge/ouli-1242/dsh-plugin-tool-management?lang=en" alt="dshfind"></a>
16
+ <a href="https://github.com/0xsline/awesome-deepseek-harness"><img src="https://img.shields.io/badge/0xsline-listed-3fb950?style=flat-square" alt="0xsline"></a>
17
+ </p>
16
18
 
17
- [简体中文](README.md) · **English** · [Changelog](CHANGELOG.md) · [Release overview](docs/UPDATE.md)
19
+ <p align="center">
20
+ <a href="README.md">简体中文</a> · <b>English</b> · <a href="CHANGELOG.md">Changelog</a> · <a href="docs/UPDATE.md">Release overview</a>
21
+ </p>
18
22
 
19
- An **MCP, skills, scenes, memories, subagents, prompts & archived sessions** manager for DeepSeek Harness. Eight tabs: Scenes / MCP / Skills / Subagents / Prompts / Memories / Sessions / Host.
23
+ MCP servers, skills, subagents, prompts, memories and archived sessions for DeepSeek Harness — all in one panel. Bundle them into a **scene**, swap the whole environment with one click, and roll back to the pre-entry snapshot when you leave.
20
24
 
21
25
  ```sh
22
26
  dsh plugin --profile web add dsh-plugin-tool-management@latest # web
23
27
  dsh plugin --profile desktop add dsh-plugin-tool-management@latest # desktop
24
28
  ```
25
29
 
26
- Hard-refresh the browser after installing for web (Cmd/Ctrl+Shift+R), or restart the desktop app after installing for desktop — a **Tools Management** panel in Settings means it worked. The plugin only writes its own files, never touches skill sources, and your configuration survives restarts and upgrades.
30
+ Hard-refresh the browser after installing for web (Cmd/Ctrl+Shift+R), or restart the desktop app — then open **Settings → Tools Management**. For desktop, open the app once and quit it completely before running the command. An older version usually means registry lag or pnpm's `minimumReleaseAge` — install an exact version (`@0.X.X`) instead.
27
31
 
28
32
  ---
29
33
 
30
- ## Demo
31
-
32
- <video controls src="https://github.com/user-attachments/assets/8f785896-891a-4a91-9845-768a1d0bc829"></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
- | ![Scenes](docs/images/1-EN.png) | ![MCP](docs/images/2-EN.png) |
45
- | **Scenes** | **MCP** |
46
- | ![Skills](docs/images/3-EN.png) | ![Subagents](docs/images/4-EN.png) |
47
- | **Skills** | **Subagents** |
48
- | ![Prompts](docs/images/5-EN.png) | ![Memories](docs/images/6-EN.png) |
49
- | **Prompts** | **Memories** |
50
- | ![Sessions](docs/images/7-EN.png) | ![Host](docs/images/8-EN.png) |
51
- | **Sessions** | **Host** |
52
-
53
34
  ## Highlights
54
35
 
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
- | Per-conversation or workspace | Pick a layer at the top of the panel; every domain's toggles apply to that layer only (all global / per conversation / per workspace), the others stay as they were |
73
-
74
- ## Quick start
75
-
76
- 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.
77
-
78
- ```sh
79
- dsh plugin --profile web add dsh-plugin-tool-management@latest # web · install / update
80
- dsh plugin --profile web remove dsh-plugin-tool-management # web · uninstall
81
- dsh plugin --profile desktop add dsh-plugin-tool-management@latest # desktop · install / update
82
- dsh plugin --profile desktop remove dsh-plugin-tool-management # desktop · uninstall
83
- ```
84
-
85
- Two reasons you might not get the newest release, and neither one errors out: npm mirrors / proxies lag behind, and pnpm's `minimumReleaseAge` (release cooldown) skips anything published inside the window. You just quietly end up on an older version. Pinning an exact version bypasses `@latest` resolution:
86
-
87
- ```sh
88
- dsh plugin --profile web add dsh-plugin-tool-management@0.21.2
89
- ```
90
-
91
- To check what you actually got: the "plugin adapter version" on the **Host** tab is the version baked into the code **loaded this session** (not what `package.json` says), and it should match `version` in `~/.dsh/tool-management/mount.json`.
92
-
93
- Hard-refresh the browser (web) or restart the desktop app, then a **Tools Management** panel with eight tabs means it worked. Client changes hot-reload; host-side changes need the client restarted (`dsh web` / the desktop app).
36
+ <table>
37
+ <tr>
38
+ <td width="33%" valign="top"><b>One-click scene switch</b><br>Each scene stores a full profile: MCP, skills, subagents, memories, quick prompts, a prompt preset and a model-tool table. Enter it and the whole stack switches; leave it and the pre-entry snapshot comes back.</td>
39
+ <td width="33%" valign="top"><b>Control from the chat</b><br>Type <code>/</code> for a “Tools” section: enter or leave a scene, toggle any of the six domains. The menu stays open and leaves no command text in the composer.</td>
40
+ <td width="34%" valign="top"><b>Three scopes</b><br>All global / per workspace / per conversation. By default every conversation has its own settings — two conversations in the same project can run two different environments at once.</td>
41
+ </tr>
42
+ <tr>
43
+ <td valign="top"><b>The agent can drive it</b><br>26 model tools across six domains: list, read, create, update, delete, toggle, enter scenes, apply prompts, run personas. Writes ask for confirmation; disabled tools are not in the schema at all.</td>
44
+ <td valign="top"><b>The Host page is a control center</b><br>Version and capability checks, access token, scope mode, per-domain injection switches, the model-tool table and the sidebar entry — all on one page.</td>
45
+ <td valign="top"><b>One panel, eight tabs</b><br>Scenes / MCP / Skills / Subagents / Prompts / Memories / Sessions / Host — no more hunting through six different settings pages.</td>
46
+ </tr>
47
+ </table>
94
48
 
95
- You can also ask the model:
96
-
97
- ```text
98
- Install the dsh-plugin-tool-management plugin:
99
- dsh plugin --profile web add dsh-plugin-tool-management@latest
100
- Then remind me to hard-refresh the browser.
101
- ```
102
-
103
- For the desktop app, swap `web` for `desktop` and end with "remind me to restart the desktop app" instead.
104
-
105
- ## Features
106
-
107
- ### Slash commands (manage from the chat box)
108
-
109
- - **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 and the command text is cleaned out of the input.
110
- - **State is visible**: green check / empty box / note in grey, plus a status summary on the domain row.
111
- - **Long lists stay out of the way**: every domain lists in full and scrolls on its own; skills group by source directory, memories by scene, enabled ones first.
112
- - **Both kinds of prompts are here**: the global group picks which one is written into `AGENTS.md` (single-select); the quick group is on/off, and clicking one pastes the saved text into the input box without sending it.
113
- - **Only reversible actions**: entering a scene and the various toggles; create / delete / edit / import / export stay on their own pages.
114
-
115
- ### Scope isolation (all global / per conversation / per workspace)
116
-
117
- - **One panel, three granularities**: switch between "all global", "per conversation" and "per workspace" on the Host tab — all-global has no conversation layer, so every conversation shares one set (the way it worked before scopes existed); per-conversation keeps A and B apart; per-workspace shares one copy inside a workspace while different workspaces stay isolated; conversations without a cwd (or with an overlong path) stay independent. Switching away deletes nothing — switch back and it all returns.
118
- - **Four layers stack up**: overrides made on this layer > the entered scene > the snapshot taken when the conversation was created > global; each cell takes the topmost layer that has a say, and matching the lower value clears the override.
119
- - **Enter and leave scenes from a conversation**: from the Scenes page or the `/` menu; the archive's memories / skills / personas / MCP servers apply live to the current layer, and leaving returns to how that layer started (never back to a global that keeps changing).
120
- - **Eight domains follow the current layer**: scenes, skills (incl. source directories), subagents, memories, quick prompts, MCP server and per-tool visibility, and the model tool table (one whole list per layer; the global one is only the default for new conversations / workspaces).
121
- - **Globally off, still usable here — with honest badges**: a server or skill source runs as a lease for the current layer, invisible to others; seven domains plus per-tool cells show live badges; a row's "Close everywhere" stops it immediately and switches it off in the conversations / workspaces using it too (one-shot; you can turn it back on later); while leases exist, the Scenes / MCP / Skills / Subagents / Prompts / Memory pages show "Close all" in the header to clear every lease in that domain at once.
122
- - **Prompts can also be overridden per layer**: applying a preset or editing the body changes only this layer (sidecar, never `~/.dsh/AGENTS.md`); the preset library stays global, so edit it on the global layer.
123
- - **Model tools write to the current layer by default**: receipts name the layer; `scope: "global"` changes the global one. Two independent locks: the scene lock freezes global writes, the conversation / workspace lock only that layer.
124
-
125
- ### Scenes & memories
126
-
127
- - **A scene = a group, a memory = a `.md` file**: `memories/<scene>/<name>.md`, the whole body is injected, file names may be Chinese.
128
- - **"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`.
129
- - **Scene profile**: each scene pairs a set of MCP tools (with scene-level note overrides) / skills / subagents / quick prompts / a model tool-table scheme, plus a bound global prompt preset; ticked = on, unchecked = off, a section never created means that domain is off (quick prompts excepted: unbound = left alone on entry); leaving restores the pre-scene state.
130
- - **Every domain also offers "None"**: this scene leaves that domain alone (the prompt cell = leave `AGENTS.md` as-is; quick prompts = none enabled). It differs from "keep current" — that one really changes nothing.
131
- - **Scene lock** makes those five domains read-only.
132
- - **Deleting a scene takes its memories with it**: the record, the profile and every memory go into one recycle-bin entry and come back together; a scene in use refuses to be deleted.
133
- - **Import / export** `.md` / `.zip` (directory name = scene, bundles carry attachments), same names skipped and never overwritten; the injection budget defaults to 128 KiB, and anything that does not fit is skipped and listed.
134
-
135
- ### Subagents
136
-
137
- - **One file per persona**: `subagents/<persona>.md`, frontmatter entirely optional; `output:` gives one line per requirement for what the result must look like. The body is used verbatim under a `# Persona: <name>` heading, and the file itself needs no changes.
138
- - **Delegation**: `subagent_manager_run` runs with the persona, returns only its final result, and never enters History; it starts a fresh session by default, and `inherit: true` seeds it with this conversation's finished turns.
139
- - **On/off and catalogue**: a disabled persona is neither injected nor visible to the model (the file stays put); new / imported / restored personas start disabled. The catalogue lists name + description only.
140
- - **Tool limits per agent preset**: one allow or deny list per preset (mutually exclusive); candidates list only that preset's own tools, split into "plugin tools / official tools / other tools".
141
- - **Model and provider**: both are picked from the host LLM catalogue (choosing a provider narrows the model list); empty means inherit the main session, and the reasoning-effort level comes from the chosen model.
142
-
143
- ### MCP servers
144
-
145
- - **CRUD with immediate effect**: written into `cordis.patch.yml`, backed up before every change; scope is "global / app-level", and new entries default to global.
146
- - **Per-tool switches**: disable individual tools (invisible and uncallable to the model), or a whole server in one go.
147
- - **A stopped server still shows its list**: tools last seen are listed with their descriptions (marked "as of last run"); one that never ran can be started to read them.
148
- - **Notes and secrets**: a per-server note for the model travels along with the status section; credentials are masked as a whole (`$VAR`, `!!js` and similar indirect references are left alone), and "Reveal" needs a token.
149
- - **Migration and backups**: a cross-scope migration rolls back on failure; JSON export/import is supported.
150
-
151
- ### Skills
152
-
153
- - **Sources at a glance**: project / DSH / Agents / Codex / Claude / custom directories, grouped by source.
154
- - **Opposite permissions**: default sources are readable and their skills deletable; external directories can be disabled or removed but their files stay read-only.
155
- - **Remove ≠ disable**: removing stops scanning the directory at all (nothing is written, restorable); disabling keeps it listed but uncallable.
156
- - **The winning copy of a shared name** is marked "preferred", and the ones it shadows are marked with their source.
157
- - **Custom directories / ZIP import-export / recycle bin.**
158
-
159
- ### Prompt presets
160
-
161
- - **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 lives only on the plugin side; the last applied preset is always identifiable, even after you edit `AGENTS.md` by hand.
162
- - **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**. The confirmation says which one it will be (the button turns red when the file is going to be deleted), and a receipt follows.
163
- - **"Un-apply" goes back to the start of the chain, not one step**: it restores whatever was there before this run of apply / un-apply began (deleting the file if there was none); every intermediate version stays in `__last-applied__/AGENTS.md.bak-*` (5 generations), so it can be applied again.
164
- - **Two kinds cannot be deleted directly**: a scene-bound preset, and the one currently applied (un-apply it first). The copy auto-created on first open was never applied and can be deleted. Deletes always go to the recycle bin.
165
- - **Quick prompts** (the second section on the same page): save a piece of text you keep typing, then hit `/` and click it to paste it in; a scene can bind a set of them (only the ticked ones are on while the scene is entered, restored on exit, or pick "None").
166
- - **The shared global instruction file is visible too**: `~/.agents/AGENTS.md` is shared with other agent tools and is also injected; when it exists the page says so (read-only — edit that file to change it).
49
+ ## Demo
167
50
 
168
- ### Archived sessions
51
+ <video controls width="100%" src="https://github.com/user-attachments/assets/ff3111c3-4228-45b7-9e28-b85dc60fb6b3"></video>
169
52
 
170
- - Grouped by project, searchable, batch restore / delete, retention auto-cleanup; a workspace whose registration was deleted can be re-registered in one click.
171
- - Import Claude Code / Cursor / Codex / any text (pick a workspace, browse for one, or type a path).
172
- - Export Markdown / JSONL in three cumulative modes: text only → plus tool calls → plus reasoning. **An export is a transcript, not a backup** — use "archive" to keep everything.
53
+ Player refuses to start (browsers with a stricter CSP sometimes block the inline embed)? [Watch the same file directly](https://github.com/user-attachments/assets/ff3111c3-4228-45b7-9e28-b85dc60fb6b3).
173
54
 
174
- ### Host compatibility
55
+ Every interface shown is a real screenshot of the running product.
175
56
 
176
- - **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.
177
- - **Compatibility page overview**: one row per feature point. The four host contracts (subagent persona delegation / tool restriction / creation ordering / Web admission) and the "bare module resolution" block all live there — a feature that silently stops working after a host upgrade shows up at a glance.
178
- - **Sidebar entry**: a "Tools Management" row in the sidebar opens the same eight pages; the Host tab's "Hide from sidebar / Show in sidebar" button adds or removes that row at any time (on by default, alongside Settings → Tools Management).
179
- - **Command line**: `node scripts/doctor.mjs` (health check), `node scripts/host-deps.mjs --fix` (align dependencies).
180
- - Under a **suppressing preset** such as `minimal`, this plugin's injection is off by default; the Host tab can force any domain back on.
181
- - Unchecking "Skills" or "Prompt" really stops them — under standard presets the host delivers those two itself; the other three domains follow the checkbox exactly.
182
- - **What the injection looks like**: one framed message per domain. Names, descriptions, notes and bodies go in verbatim, and a hand-written frame-closing marker inside the body is escaped so it cannot end the frame early.
57
+ Music: Kevin MacLeod「Limit 70」, [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
183
58
 
184
- ---
59
+ ## Screenshots
185
60
 
186
- ## Where data lives
187
-
188
- | Content | Location |
189
- | -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
190
- | MCP definitions | `~/.dsh/cordis.patch.yml` (written by the plugin; pre-write copies land in the hub's `backups/`) |
191
- | Skill policy / custom dirs | `~/.dsh/tool-management/skills-state.json` |
192
- | Skills / memories / personas / presets | `~/.dsh/tool-management/{skills,memories,subagents,prompts}/` |
193
- | Subagent toggles | `~/.dsh/tool-management/subagents-index.json` |
194
- | Recycle bin (skills / memories / personas / presets / scenes) | `~/.dsh/tool-management/trash/<domain>-trash/` (one directory per kind) |
195
- | Archive ledger / retention | `~/.dsh/tool-management/history-*.json` |
196
- | Recycle-bin retention | `~/.dsh/tool-management/trash-retention.json` (`0` = keep forever) |
197
- | Memory index / scenes / profiles | `~/.dsh/tool-management/memories-index.json` |
198
- | MCP sidecars (disabled tools / known tools / notes / settings) | `~/.dsh/tool-management/mcp-*.json` |
199
- | Injection settings (six domain switches) | `~/.dsh/tool-management/inject-settings.json` |
200
- | Model tool table (global default + saved sets) | `~/.dsh/tool-management/tool-table.json` |
201
- | Scope overrides (conversation / workspace, incl. tool table) | `~/.dsh/tool-management/scope-overrides.json` |
202
- | Global intent (default MCP / skill-source switches) | `~/.dsh/tool-management/scope-intent.json` |
203
- | Scene page preference (preview card before entering a scene) | `~/.dsh/tool-management/scene-settings.json` |
204
- | Runtime log / patch backups | `~/.dsh/tool-management/tool-management.log` · `backups/` |
205
-
206
- **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.
207
-
208
- The six recycle bins each own one directory under `trash/`: `{skills,memories,subagents,prompts,scenes,quick-prompts}-trash/`. The memories one moved in from the hub root on 2026-10-10; existing data is carried over by the startup migration.
209
-
210
- ## Configuration & security
211
-
212
- | Field | What it does |
213
- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
214
- | `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. |
215
- | `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. |
216
- | `maxBodyBytes` | Request body cap, 88 MiB by default. |
217
-
218
- **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 Management → Host → "Clean old backups"**.
219
-
220
- - **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.
221
- - **Every destructive direction asks for the current token again** (turn protection off / change / delete). Being unlocked this run does not count.
222
- - **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`.
223
- - **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**.
224
- - **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.
225
- - **Do not hand-edit the sidecars**: if `mcp-disabled-tools.json` is corrupted every `mcp__*` tool is refused (the MCP page offers "Reset table" and keeps a forensic copy first); if `tool-table.json` is corrupted the last good value stays in effect and saving is blocked.
61
+ | | |
62
+ |:----------------------------------------------------------------------------:|:------------------------------------------------------------------------------:|
63
+ | <img src="docs/images/1-EN.png" alt="Scenes" width="100%"><br>**Scenes** | <img src="docs/images/2-EN.png" alt="MCP" width="100%"><br>**MCP** |
64
+ | <img src="docs/images/3-EN.png" alt="Skills" width="100%"><br>**Skills** | <img src="docs/images/4-EN.png" alt="Subagents" width="100%"><br>**Subagents** |
65
+ | <img src="docs/images/5-EN.png" alt="Prompts" width="100%"><br>**Prompts** | <img src="docs/images/6-EN.png" alt="Memories" width="100%"><br>**Memories** |
66
+ | <img src="docs/images/7-EN.png" alt="Sessions" width="100%"><br>**Sessions** | <img src="docs/images/8-EN.png" alt="Host" width="100%"><br>**Host** |
67
+
68
+ ## Three scopes
69
+
70
+ Every conversation gets its own settings by default. Switch once on the **Host page → Scope**, and the whole panel plus every model tool follows that layer:
71
+
72
+ | | All global | Per workspace | Per conversation (default) |
73
+ |:------------------------ |:---------------------------------------------- |:------------------------------------------ |:------------------------------------------ |
74
+ | **Who shares one set** | Every conversation | Conversations in the same workspace | Each conversation separately |
75
+ | **Best for** | One person, one machine, consistent everywhere | One project, one environment | Parallel tasks in one project |
76
+ | **Lost when switching?** | — | Nothing is deleted; switch back to restore | Nothing is deleted; switch back to restore |
77
+
78
+ The selector at the top of the panel jumps to a specific conversation or workspace and shows its own copy; when that layer is locked, the unlock button sits on the same row. Within a layer, every switch resolves top-down: **this layer's edit > entered scene > creation snapshot > global**.
79
+
80
+ Scenes work in all three scopes. Under per-conversation, conversation A can sit in “Coding” while B stays in “Writing”, each with its own MCP servers, skills and personas.
81
+
82
+ ## What each tab does
83
+
84
+ <table>
85
+ <tr><th width="15%" align="left">Tab</th><th align="left">What it does</th></tr>
86
+ <tr><td><b>Scenes</b></td><td>Save the whole environment as a profile; enter and leave with one click; lock it against edits; bind a prompt preset and a model-tool table; deleting it sends its memories to the recycle bin too.</td></tr>
87
+ <tr><td><b>MCP</b></td><td>Add, edit and remove servers; toggle individual tools; write a note the model sees; inspect the last-known tool list while a server is stopped; import/export with automatic backups.</td></tr>
88
+ <tr><td><b>Skills</b></td><td>Grouped by source; enable, remove, import, edit; same-name skills show which copy is in effect; external directories stay read-only.</td></tr>
89
+ <tr><td><b>Subagents</b></td><td>One <code>.md</code> per persona; delegate work, limit tools, pick a model; only the result comes back, never into your History.</td></tr>
90
+ <tr><td><b>Prompts</b></td><td>Multiple <code>AGENTS.md</code> baselines with one-click apply/undo and five generations of backups; quick prompts paste into the composer from <code>/</code>.</td></tr>
91
+ <tr><td><b>Memories</b></td><td>A scene is the folder; <code>.md</code> bodies are injected automatically; import/export, recycle bin, injection budget.</td></tr>
92
+ <tr><td><b>Sessions</b></td><td>Archived by project, searchable, batch restore; import Claude Code / Cursor / Codex transcripts; export Markdown / JSONL.</td></tr>
93
+ <tr><td><b>Host</b></td><td>Version and capability checks, access token, scope mode, injection switches, model-tool table, sidebar entry, backup cleanup.</td></tr>
94
+ </table>
95
+
96
+ ## Let the agent drive it
97
+
98
+ Six domains, **26 model tools**: list, read, create, update, delete, toggle, enter or leave a scene, apply a prompt, run a persona.
99
+
100
+ - **Only 6 ship enabled** (~1.6k tokens/turn); the other 20 stay off. Off means **not in the schema at all** — the model cannot see them, let alone call them.
101
+ - **Scoped writes**: the model writes to the current layer by default and the receipt says which one; `scope: "global"` is required to touch everything.
102
+ - **Confirmation cards**: stopping servers, deleting, machine-wide toggles and similar writes ask first; recovery actions (restart, restore, undo apply) go straight through.
103
+ - **Per-tool control**: the model-tool table on the Host page adjusts visibility per layer. All 26 on is ~6.2k tokens/turn; profiles can be saved per task and switched together with a scene.
104
+
105
+ ## The Host page
106
+
107
+ More than a version number:
108
+
109
+ - **Checks**: host version, the plugin build actually loaded this run, and whether each action is native / adapted / unavailable, with reasons. If an upgrade quietly breaks something, it shows up here.
110
+ - **Access token**: set / disable / change / delete; writes and plaintext secrets go through it.
111
+ - **Scope**: all global / per workspace / per conversation.
112
+ - **Injection**: per-domain switches, minimal-preset fallback, the two slash-menu entries, sidebar entry.
113
+ - **Model tools**: per-tool visibility for all 26, saved per layer.
114
+ - **Maintenance**: old-backup cleanup, feature overview, recent changes.
115
+
116
+ <details>
117
+ <summary><b>Where data lives · security boundaries</b></summary>
118
+
119
+ | Content | Location |
120
+ |:-------------------------------------------------------------- |:---------------------------------------------------------------------------- |
121
+ | MCP definitions | `~/.dsh/cordis.patch.yml` (the only file the plugin writes; backed up first) |
122
+ | Skill policy / custom directories | `~/.dsh/tool-management/skills-state.json` |
123
+ | Skills / memories / personas / presets | `~/.dsh/tool-management/{skills,memories,subagents,prompts}/` |
124
+ | Memory index / scenes / profiles | `~/.dsh/tool-management/memories-index.json` |
125
+ | Recycle bins (skills / memories / personas / presets / scenes) | `~/.dsh/tool-management/trash/<domain>-trash/` |
126
+ | Archive ledger / retention | `~/.dsh/tool-management/history-*.json` |
127
+ | MCP sidecars (disabled tools / known tools / notes / settings) | `~/.dsh/tool-management/mcp-*.json` |
128
+ | Injection settings (six domain switches) | `~/.dsh/tool-management/inject-settings.json` |
129
+ | Model-tool table / scope overrides | `~/.dsh/tool-management/tool-table.json` · `scope-overrides.json` |
130
+ | Runtime log / patch backups | `~/.dsh/tool-management/tool-management.log` · `backups/` |
131
+
132
+ - **Only its own files**: skill sources are never touched; MCP changes go to `cordis.patch.yml`, with five backups per patch file.
133
+ - **Token**: once set, every write and every plaintext secret requires `x-dsh-token`; browser reads and writes use cookies, but plaintext still needs the token.
134
+ - **Process-level boundary is the token**: writes normally sit behind the host's browser auth; when the host fence is absent the route falls back to a loopback-only check, which any local process can pass — only the access token gives you a process-level boundary.
135
+ - **Plaintext on disk**: masking happens in the UI only. MCP `env` / `headers` and the plugin `token` stay plaintext in the patch file, and backups are neither encrypted nor rotated. The token gate cannot stop disk reads — file permissions are the boundary.
136
+ - **Deletes are recoverable**: skills / memories / personas / presets / scenes go to the recycle bin (permanent session deletion excepted), with an optional retention period (keep forever by default).
137
+
138
+ </details>
226
139
 
227
140
  ## FAQ
228
141
 
229
- The full runbook (symptom → why → how to confirm → how to fix) lives in **[docs/TROUBLESHOOTING.md](https://github.com/ouli-1242/dsh-plugin-tool-management/blob/main/docs/TROUBLESHOOTING.md)**. Only the most common cases are listed here.
230
-
231
- | Symptom | Fix |
232
- | --------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
233
- | Pages missing after install | Hard refresh; restart DSH if that fails. |
234
- | Duplicate MCP tabs | Remove the stale loader row from `cordis.patch.yml`, restart. |
235
- | Broken config, DSH won't boot | Restore the newest `cordis.patch.yml.<level>.bak-<timestamp>` from `~/.dsh/tool-management/backups/` (5 per patch file). |
236
- | Action stopped working after a DSH upgrade | Settings → Tools Management → **Host** for the reason; `doctor.mjs` → `host-deps.mjs --fix`. |
237
- | Won't install / peer mismatch after a DSH upgrade | This plugin only supports DSH **0.2.1** (`>=0.2.1-rc.2 <0.2.2`). For any other host generation, install the plugin release that matches it. |
238
- | The model cannot call a tool it should have | Check the **Model tool table** on the Host tab (pick that conversation / workspace in the layer picker first) — 20 tools ship switched off. The panel and scripts are unaffected either way. |
239
- | 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. |
240
- | `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. |
241
- | 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. |
142
+ | Symptom | Fix |
143
+ |:--------------------------------------- |:-------------------------------------------------------------------------------------------------------------------------------------------------------- |
144
+ | No panel after installing | Hard-refresh the browser; if that fails, restart DSH. |
145
+ | The model cannot call a tool | Host page → “Model tools”, make sure the right conversation / workspace is selected (20 tools are off by default). The panel and scripts are unaffected. |
146
+ | Actions unavailable after a DSH upgrade | Check the reason on the Host page; run `node scripts/doctor.mjs`, then `node scripts/host-deps.mjs --fix`. |
147
+ | Version mismatch | Supports DSH **0.2.1** only (`>=0.2.1-rc.2 <0.2.2`); cross-generation upgrades wait for the plugin to catch up. |
148
+ | Duplicate MCP tab | Remove the old loader line from `cordis.patch.yml` and restart. |
149
+ | DSH won't start after a bad edit | Restore the newest `cordis.patch.yml.*.bak-*` from `~/.dsh/tool-management/backups/`. |
242
150
 
243
- ---
151
+ Full troubleshooting guide: [docs/TROUBLESHOOTING.md](docs/TROUBLESHOOTING.md).
244
152
 
245
153
  ## Docs
246
154
 
247
- | Doc | When to read it |
248
- | --- | --- |
249
- | [Troubleshooting](https://github.com/ouli-1242/dsh-plugin-tool-management/blob/main/docs/TROUBLESHOOTING.md) | No panel after install, duplicate tabs, actions broken after an upgrade, corrupted disable table or sidecars |
250
- | [Architecture](https://github.com/ouli-1242/dsh-plugin-tool-management/blob/main/docs/ARCHITECTURE.md) | How content reaches the model, why one switch differs between two conversations, which file a change lands in |
251
- | [Compatibility matrix](https://github.com/ouli-1242/dsh-plugin-tool-management/blob/main/docs/COMPATIBILITY.md) | Per-host capability matrix (verified / untested / unavailable) |
252
- | [CHANGELOG](https://github.com/ouli-1242/dsh-plugin-tool-management/blob/main/CHANGELOG.md) | What changed in each release |
253
-
254
- ---
155
+ | Doc | When to read it |
156
+ |:-------------------------------------------------------------- |:--------------------------------------------------------------------------------------------------------- |
157
+ | [Troubleshooting](docs/TROUBLESHOOTING.md) | Missing panel, duplicate tab, actions unavailable after an upgrade, broken sidecars |
158
+ | [Architecture](docs/ARCHITECTURE.md) | How content reaches the model, why one toggle differs between conversations, which file a change lands in |
159
+ | [Compatibility matrix](docs/COMPATIBILITY.md) | Capability matrix per DSH version (verified / untested / unavailable) |
160
+ | [Changelog](CHANGELOG.md) · [Release overview](docs/UPDATE.md) | What changed in each version |
255
161
 
256
162
  ## Development
257
163
 
258
164
  ```bash
259
165
  npm install
260
166
  npm run build # tsc + sync client
261
- npm test # build + i18n + contract tests (pure-function invariants & host contracts)
262
- npm run check:i18n # dictionary self-check
167
+ npm test # build + i18n + contract tests
263
168
  npm run doctor # host compatibility check
264
169
  ```
265
170
 
266
- `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.
267
-
268
- > **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.
171
+ `lib/` is not committed — run `npm run build` after cloning, and restart `dsh web` to pick up changes. Runtime dependencies are only `fflate` and `js-yaml` (lazy-loaded); every `@deepseek-ai/*` package uses the host's copy.
269
172
 
270
173
  ## License
271
174