dsh-plugin-tool-management 0.22.2 → 0.22.4

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 (46) hide show
  1. package/CHANGELOG.md +1395 -1341
  2. package/README.md +177 -176
  3. package/README_EN.md +177 -176
  4. package/docs/UPDATE.md +49 -47
  5. package/lib/catalog-caps.js +22 -0
  6. package/lib/client.js +4797 -4544
  7. package/lib/compat/host-contracts.js +18 -3
  8. package/lib/compat/preset-reach.js +69 -12
  9. package/lib/confirm-gate.js +49 -18
  10. package/lib/context-inject-contract.js +2 -1
  11. package/lib/context-inject-frame.js +100 -48
  12. package/lib/context-inject-select.js +28 -0
  13. package/lib/index.js +258 -73
  14. package/lib/legacy-tool-names.js +46 -0
  15. package/lib/mcp/manager.js +13 -1
  16. package/lib/mcp/secret-guard.js +27 -0
  17. package/lib/mcp/state-section.js +25 -11
  18. package/lib/memories/archive.js +44 -0
  19. package/lib/memories/constants.js +9 -7
  20. package/lib/memories/index-io.js +4 -1
  21. package/lib/memories/snapshot.js +8 -8
  22. package/lib/op-registry.js +5 -1
  23. package/lib/ops/compat.js +13 -1
  24. package/lib/ops/scene-capture.js +72 -0
  25. package/lib/scenes/candidates.js +17 -2
  26. package/lib/scope/scope-overrides.js +9 -2
  27. package/lib/settings-sidecars.js +9 -2
  28. package/lib/skills/catalog.js +46 -14
  29. package/lib/skills/provider-registration.js +41 -4
  30. package/lib/skills/service.js +4 -4
  31. package/lib/subagents/catalog.js +24 -10
  32. package/lib/subagents/run-provider.js +41 -10
  33. package/lib/subagents/tools.js +63 -7
  34. package/lib/tool-table-switch.js +41 -4
  35. package/lib/tools/control.js +158 -0
  36. package/lib/tools/deps.js +88 -0
  37. package/lib/tools/mcp.js +35 -10
  38. package/lib/tools/memory.js +9 -5
  39. package/lib/tools/prompt.js +7 -8
  40. package/lib/tools/remove.js +84 -65
  41. package/lib/tools/scene.js +179 -76
  42. package/lib/tools/skills.js +13 -8
  43. package/lib/tools/subagent.js +19 -10
  44. package/lib/tools/table.js +92 -57
  45. package/lib/trash-id.js +3 -2
  46. package/package.json +152 -152
package/README_EN.md CHANGED
@@ -1,176 +1,177 @@
1
- <p align="center">
2
- <img src="docs/images/banner-en.png" alt="Tool Management — one click swaps the entire environment" width="100%">
3
- </p>
4
-
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.2-4f7cf7?style=flat-square" alt="DSH 0.2.2">
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
-
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>
18
-
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>
22
-
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.
24
-
25
- ```sh
26
- dsh plugin --profile web add dsh-plugin-tool-management@latest # web
27
- dsh plugin --profile desktop add dsh-plugin-tool-management@latest # desktop
28
- ```
29
-
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.
31
-
32
- ---
33
-
34
- ## Highlights
35
-
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 (except in a full-permission session, where the card is skipped and only a log line is written); 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>
48
-
49
- ## Demo
50
-
51
- <video controls width="100%" src="https://github.com/user-attachments/assets/ff3111c3-4228-45b7-9e28-b85dc60fb6b3"></video>
52
-
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).
54
-
55
- Every interface shown is a real screenshot of the running product.
56
-
57
- Music: Kevin MacLeod「Limit 70」, [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
58
-
59
- ## Screenshots
60
-
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. Items whose names can be checked but whose timing or rendering cannot are listed under “not automatically verifiable”. If an upgrade quietly breaks something, it shows up here; the “Re-check” button re-runs the probe in place.
110
- - **Upgrade diff**: per-package versions for cordis, the 11 peers and 15 runtime-only official packages against the verified baseline (out-of-range peers become blockers), plus canaries for event names, session-directory layout, patch dialect, MCP config keys and tool argument schemas, prompt section ordering, client UI slots and official skill assets.
111
- - **Access token**: set / disable / change / delete; writes and plaintext secrets go through it.
112
- - **Scope**: all global / per workspace / per conversation.
113
- - **Injection**: per-domain switches, minimal-preset fallback, the two slash-menu entries, sidebar entry.
114
- - **Model tools**: per-tool visibility for all 26, saved per layer.
115
- - **Maintenance**: old-backup cleanup, feature overview, recent changes.
116
-
117
- <details>
118
- <summary><b>Where data lives · security boundaries</b></summary>
119
-
120
- | Content | Location |
121
- |:-------------------------------------------------------------- |:---------------------------------------------------------------------------- |
122
- | MCP definitions | `~/.dsh/cordis.patch.yml` (global) · `~/.dsh/profiles/<name>/cordis.patch.yml` (current profile) |
123
- | Skill policy / custom directories | `~/.dsh/tool-management/skills-state.json` |
124
- | Skills / memories / personas / presets | `~/.dsh/tool-management/{skills,memories,subagents,prompts}/` |
125
- | Memory index / scenes / profiles | `~/.dsh/tool-management/memories-index.json` |
126
- | Recycle bins (skills / memories / personas / presets / scenes) | `~/.dsh/tool-management/trash/<domain>-trash/` |
127
- | Archive ledger / retention | `~/.dsh/tool-management/history-*.json` |
128
- | MCP sidecars (disabled tools / known tools / notes / settings) | `~/.dsh/tool-management/mcp-*.json` |
129
- | Injection settings (six domain switches) | `~/.dsh/tool-management/inject-settings.json` |
130
- | Model-tool table / scope overrides | `~/.dsh/tool-management/tool-table.json` · `scope-overrides.json` |
131
- | Runtime log / patch backups | `~/.dsh/tool-management/tool-management.log` · `backups/` |
132
-
133
- - **Write scope**: skill sources are never touched; MCP changes go to the two patch files above (five backups each); applying a prompt overwrites the `~/.dsh/AGENTS.md` the host reads (the previous text is kept inside the hub); the desktop build clears `dsh-auth-*` cookies older than ten minutes at startup.
134
- - **Token**: once set, every write and every plaintext secret requires `x-dsh-token`; the UI stores it in browser localStorage bound to the current boot (a restart asks again), and plaintext still needs the token.
135
- - **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.
136
- - **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 not encrypted. The token gate cannot stop disk reads — file permissions are the boundary.
137
- - **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).
138
-
139
- </details>
140
-
141
- ## FAQ
142
-
143
- | Symptom | Fix |
144
- |:--------------------------------------- |:-------------------------------------------------------------------------------------------------------------------------------------------------------- |
145
- | No panel after installing | Hard-refresh the browser; if that fails, restart DSH. |
146
- | 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. |
147
- | 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`. |
148
- | Version mismatch | Supports DSH **0.2.2** only (`>=0.2.2-rc.1 <0.2.3`); cross-generation upgrades wait for the plugin to catch up. Install 0.21.x for older hosts. |
149
- | Duplicate MCP tab | Remove the old loader line from `cordis.patch.yml` and restart. |
150
- | DSH won't start after a bad edit | Restore the newest `cordis.patch.yml.*.bak-*` from `~/.dsh/tool-management/backups/`. |
151
-
152
- Full troubleshooting guide: [docs/TROUBLESHOOTING.md](docs/TROUBLESHOOTING.md).
153
-
154
- ## Docs
155
-
156
- | Doc | When to read it |
157
- |:-------------------------------------------------------------- |:--------------------------------------------------------------------------------------------------------- |
158
- | [Troubleshooting](docs/TROUBLESHOOTING.md) | Missing panel, duplicate tab, actions unavailable after an upgrade, broken sidecars |
159
- | [Architecture](docs/ARCHITECTURE.md) | How content reaches the model, why one toggle differs between conversations, which file a change lands in |
160
- | [Compatibility matrix](docs/COMPATIBILITY.md) | Capability matrix per DSH version (verified / untested / unavailable) |
161
- | [Changelog](CHANGELOG.md) · [Release overview](docs/UPDATE.md) | What changed in each version |
162
-
163
- ## Development
164
-
165
- ```bash
166
- npm install
167
- npm run build # tsc + sync client
168
- npm test # build + i18n + contract tests
169
- npm run doctor # host compatibility check
170
- ```
171
-
172
- `lib/` is not committed — run `npm run build` after cloning, and restart `dsh web` to pick up changes. Runtime dependencies are `fflate`, `js-yaml` and `semver` (static imports in the build; the plugin will not load without any of them); every `@deepseek-ai/*` package uses the host's copy.
173
-
174
- ## License
175
-
176
- MIT
1
+ <p align="center">
2
+ <img src="docs/images/banner-en.png" alt="Tool Management — one click swaps the entire environment" width="100%">
3
+ </p>
4
+
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.2-4f7cf7?style=flat-square" alt="DSH 0.2.2">
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
+
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>
18
+
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>
22
+
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.
24
+
25
+ ```sh
26
+ dsh plugin --profile web add dsh-plugin-tool-management@latest # web
27
+ dsh plugin --profile desktop add dsh-plugin-tool-management@latest # desktop
28
+ ```
29
+
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.
31
+
32
+ ---
33
+
34
+ ## Highlights
35
+
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>24 model tools across six domains: list, read, create, update, delete, toggle, enter scenes, apply prompts, run personas. Writes ask for confirmation (except in a full-permission session, where the card is skipped and only a log line is written); 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>
48
+
49
+ ## Demo
50
+
51
+ <video controls width="100%" src="https://github.com/user-attachments/assets/ff3111c3-4228-45b7-9e28-b85dc60fb6b3"></video>
52
+
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).
54
+
55
+ Every interface shown is a real screenshot of the running product.
56
+
57
+ Music: Kevin MacLeod「Limit 70」, [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
58
+
59
+ ## Screenshots
60
+
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, **24 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.5k tokens/turn); the other 18 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 24 on is ~6.1k tokens/turn; profiles can be saved per task and switched together with a scene.
104
+ - **The model can switch tools back on**: the always-on `tool_manager_tools` lists the tools that are off in this conversation (name, purpose, ≈tokens) and turns them on as needed — when the user asks for a scene whose tools happen to be off, the model has a way forward instead of bouncing back to the user.
105
+
106
+ ## The Host page
107
+
108
+ More than a version number:
109
+
110
+ - **Checks**: host version, the plugin build actually loaded this run, and whether each action is native / adapted / unavailable, with reasons. Items whose names can be checked but whose timing or rendering cannot are listed under “not automatically verifiable”. If an upgrade quietly breaks something, it shows up here; the “Re-check” button re-runs the probe in place.
111
+ - **Upgrade diff**: per-package versions for cordis, the 11 peers and 15 runtime-only official packages against the verified baseline (out-of-range peers become blockers), plus canaries for event names, session-directory layout, patch dialect, MCP config keys and tool argument schemas, prompt section ordering, client UI slots and official skill assets.
112
+ - **Access token**: set / disable / change / delete; writes and plaintext secrets go through it.
113
+ - **Scope**: all global / per workspace / per conversation.
114
+ - **Injection**: per-domain switches, minimal-preset fallback, catalog caps for skills / MCP / subagents (overflow folds into a one-line count; per-entry description length is configurable too), the two slash-menu entries, sidebar entry.
115
+ - **Model tools**: per-tool visibility for all 26, saved per layer.
116
+ - **Maintenance**: old-backup cleanup, feature overview, recent changes.
117
+
118
+ <details>
119
+ <summary><b>Where data lives · security boundaries</b></summary>
120
+
121
+ | Content | Location |
122
+ |:-------------------------------------------------------------- |:---------------------------------------------------------------------------- |
123
+ | MCP definitions | `~/.dsh/cordis.patch.yml` (global) · `~/.dsh/profiles/<name>/cordis.patch.yml` (current profile) |
124
+ | Skill policy / custom directories | `~/.dsh/tool-management/skills-state.json` |
125
+ | Skills / memories / personas / presets | `~/.dsh/tool-management/{skills,memories,subagents,prompts}/` |
126
+ | Memory index / scenes / profiles | `~/.dsh/tool-management/memories-index.json` |
127
+ | Recycle bins (skills / memories / personas / presets / scenes) | `~/.dsh/tool-management/trash/<domain>-trash/` |
128
+ | Archive ledger / retention | `~/.dsh/tool-management/history-*.json` |
129
+ | MCP sidecars (disabled tools / known tools / notes / settings) | `~/.dsh/tool-management/mcp-*.json` |
130
+ | Injection settings (six domain switches · catalog caps) | `~/.dsh/tool-management/inject-settings.json` |
131
+ | Model-tool table / scope overrides | `~/.dsh/tool-management/tool-table.json` · `scope-overrides.json` |
132
+ | Runtime log / patch backups | `~/.dsh/tool-management/tool-management.log` · `backups/` |
133
+
134
+ - **Write scope**: skill sources are never touched; MCP changes go to the two patch files above (five backups each); applying a prompt overwrites the `~/.dsh/AGENTS.md` the host reads (the previous text is kept inside the hub); the desktop build clears `dsh-auth-*` cookies older than ten minutes at startup.
135
+ - **Token**: once set, every write and every plaintext secret requires `x-dsh-token`; the UI stores it in browser localStorage bound to the current boot (a restart asks again), and plaintext still needs the token.
136
+ - **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.
137
+ - **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 not encrypted. The token gate cannot stop disk reads — file permissions are the boundary.
138
+ - **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).
139
+
140
+ </details>
141
+
142
+ ## FAQ
143
+
144
+ | Symptom | Fix |
145
+ |:--------------------------------------- |:-------------------------------------------------------------------------------------------------------------------------------------------------------- |
146
+ | No panel after installing | Hard-refresh the browser; if that fails, restart DSH. |
147
+ | The model cannot call a tool | Host page → “Model tools”, make sure the right conversation / workspace is selected (18 tools are off by default). The panel and scripts are unaffected. |
148
+ | 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`. |
149
+ | Version mismatch | Supports DSH **0.2.2** only (`>=0.2.2-rc.1 <0.2.3`); cross-generation upgrades wait for the plugin to catch up. Install 0.21.x for older hosts. |
150
+ | Duplicate MCP tab | Remove the old loader line from `cordis.patch.yml` and restart. |
151
+ | DSH won't start after a bad edit | Restore the newest `cordis.patch.yml.*.bak-*` from `~/.dsh/tool-management/backups/`. |
152
+
153
+ Full troubleshooting guide: [docs/TROUBLESHOOTING.md](docs/TROUBLESHOOTING.md).
154
+
155
+ ## Docs
156
+
157
+ | Doc | When to read it |
158
+ |:-------------------------------------------------------------- |:--------------------------------------------------------------------------------------------------------- |
159
+ | [Troubleshooting](docs/TROUBLESHOOTING.md) | Missing panel, duplicate tab, actions unavailable after an upgrade, broken sidecars |
160
+ | [Architecture](docs/ARCHITECTURE.md) | How content reaches the model, why one toggle differs between conversations, which file a change lands in |
161
+ | [Compatibility matrix](docs/COMPATIBILITY.md) | Capability matrix per DSH version (verified / untested / unavailable) |
162
+ | [Changelog](CHANGELOG.md) · [Release overview](docs/UPDATE.md) | What changed in each version |
163
+
164
+ ## Development
165
+
166
+ ```bash
167
+ npm install
168
+ npm run build # tsc + sync client
169
+ npm test # build + i18n + contract tests
170
+ npm run doctor # host compatibility check
171
+ ```
172
+
173
+ `lib/` is not committed — run `npm run build` after cloning, and restart `dsh web` to pick up changes. Runtime dependencies are `fflate`, `js-yaml` and `semver` (static imports in the build; the plugin will not load without any of them); every `@deepseek-ai/*` package uses the host's copy.
174
+
175
+ ## License
176
+
177
+ MIT