dsh-efm-integration 0.4.1 → 0.4.5
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/README.md +367 -348
- package/README.zh.md +322 -316
- package/client.js +525 -356
- package/lib/lsp-servers/index.d.ts.map +1 -1
- package/lib/lsp-servers/index.js +4 -1
- package/lib/lsp-servers/index.js.map +1 -1
- package/lib/prompt/http.d.ts +36 -0
- package/lib/prompt/http.d.ts.map +1 -0
- package/lib/prompt/http.js +89 -0
- package/lib/prompt/http.js.map +1 -0
- package/lib/prompt/index.d.ts +7 -9
- package/lib/prompt/index.d.ts.map +1 -1
- package/lib/prompt/index.js +206 -51
- package/lib/prompt/index.js.map +1 -1
- package/lib/prompt/pure-mode.d.ts +85 -0
- package/lib/prompt/pure-mode.d.ts.map +1 -0
- package/lib/prompt/pure-mode.js +186 -0
- package/lib/prompt/pure-mode.js.map +1 -0
- package/lib/prompt/store.d.ts +44 -0
- package/lib/prompt/store.d.ts.map +1 -0
- package/lib/prompt/store.js +114 -0
- package/lib/prompt/store.js.map +1 -0
- package/lib/skill-router/index.d.ts.map +1 -1
- package/lib/skill-router/index.js +2 -1
- package/lib/skill-router/index.js.map +1 -1
- package/lib/verification/index.d.ts.map +1 -1
- package/lib/verification/index.js +3 -0
- package/lib/verification/index.js.map +1 -1
- package/package.json +142 -142
package/README.md
CHANGED
|
@@ -1,348 +1,367 @@
|
|
|
1
|
-
# dsh-efm-integration
|
|
2
|
-
|
|
3
|
-
English | [简体中文](README.zh.md)
|
|
4
|
-
|
|
5
|
-
`dsh-efm-integration` is a DeepSeek Harness (DSH) plugin bundle that adds coding
|
|
6
|
-
discipline, skill routing,
|
|
7
|
-
same underlying model. It does not replace the model, fork DSH, or modify the
|
|
8
|
-
upstream DeepSeek Harness checkout.
|
|
9
|
-
|
|
10
|
-
## What it adds
|
|
11
|
-
|
|
12
|
-
| Module | Behavior |
|
|
13
|
-
| --- | --- |
|
|
14
|
-
| `prompt` | Adds an action-first coding contract to the system prompt. |
|
|
15
|
-
| `skill-router` | Publishes `whenToUse` routing hints and injects `always-load` or resident skill bodies, deduplicating unchanged content. |
|
|
16
|
-
| `skill-guard` | Denies configured tools until their required skills have been loaded. |
|
|
17
|
-
| `
|
|
18
|
-
| `
|
|
19
|
-
| `
|
|
20
|
-
| `
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
```sh
|
|
54
|
-
dsh --profile web
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
The
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
1
|
+
# dsh-efm-integration
|
|
2
|
+
|
|
3
|
+
English | [简体中文](README.zh.md)
|
|
4
|
+
|
|
5
|
+
`dsh-efm-integration` is a DeepSeek Harness (DSH) plugin bundle that adds coding
|
|
6
|
+
discipline, skill routing, and archived-session maintenance to the
|
|
7
|
+
same underlying model. It does not replace the model, fork DSH, or modify the
|
|
8
|
+
upstream DeepSeek Harness checkout.
|
|
9
|
+
|
|
10
|
+
## What it adds
|
|
11
|
+
|
|
12
|
+
| Module | Behavior |
|
|
13
|
+
| --- | --- |
|
|
14
|
+
| `prompt` | Adds an action-first coding contract to the system prompt. |
|
|
15
|
+
| `skill-router` | Publishes `whenToUse` routing hints and injects `always-load` or resident skill bodies, deduplicating unchanged content. |
|
|
16
|
+
| `skill-guard` | Denies configured tools until their required skills have been loaded. |
|
|
17
|
+
| `command-guard` | Refuses long foreground sleeps and filesystem-root scans before execution. |
|
|
18
|
+
| `bundled-skill` | Ships the `powershell-usage` skill and exposes it without a user-directory copy. |
|
|
19
|
+
| `archive-cleaner` | Adds a sidebar page that permanently deletes archived Sessions and their descendants. |
|
|
20
|
+
| `lsp-servers` | Owns the DSH LSP stack and adds a sidebar page to enable or disable language servers without restarting. |
|
|
21
|
+
|
|
22
|
+
All host plugins are mounted by `cordis.patch.yml`. `client.js` provides the web
|
|
23
|
+
sidebar pages. The bundle's `dsh.bundle.patch` and `dsh.client` fields tell DSH how
|
|
24
|
+
to load both halves.
|
|
25
|
+
|
|
26
|
+
## Requirements
|
|
27
|
+
|
|
28
|
+
- DSH `>=0.2.2-rc.5 <0.3.0`
|
|
29
|
+
- Node.js `>=24.9.0`
|
|
30
|
+
- pnpm `10.18.3` when building from source
|
|
31
|
+
|
|
32
|
+
## Install
|
|
33
|
+
|
|
34
|
+
From npm (the published package, no build needed):
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
dsh plugin --profile web add dsh-efm-integration
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
`dsh plugin add` runs pnpm under the hood, so this resolves against the registry
|
|
41
|
+
your profile's pnpm uses. A freshly published version may take a while to reach
|
|
42
|
+
the npmmirror mirror; check with `pnpm view dsh-efm-integration version` or point
|
|
43
|
+
the profile at the official registry.
|
|
44
|
+
|
|
45
|
+
From a local checkout:
|
|
46
|
+
|
|
47
|
+
```sh
|
|
48
|
+
dsh plugin --profile web add /absolute/path/to/dsh-efm-integration
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
From a Git repository:
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
dsh plugin --profile web add github:eyeofflame/dsh-efm-integration
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Installing from a source checkout can run the package's `prepare` script, which
|
|
58
|
+
builds `lib/` with TypeScript. Review the source before allowing package build
|
|
59
|
+
scripts to execute.
|
|
60
|
+
|
|
61
|
+
Restart DSH, then inspect the composed profile:
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
dsh --profile web --dump-config
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The profile should contain the `dsh-efm-integration-client-anchor` row and the
|
|
68
|
+
other `dsh-efm-integration-*` plugin rows from `cordis.patch.yml`.
|
|
69
|
+
|
|
70
|
+
## System prompt
|
|
71
|
+
|
|
72
|
+
By default the `prompt` module appends one section — the coding-agent execution
|
|
73
|
+
contract — to the system prompt DSH assembles. To send a complete system prompt
|
|
74
|
+
of your own instead, set exactly one of `prompt` (inline text) or `promptFile`
|
|
75
|
+
(a UTF-8 file path) on the plugin row:
|
|
76
|
+
|
|
77
|
+
```yaml
|
|
78
|
+
- id: dsh-efm-integration-prompt
|
|
79
|
+
name: 'dsh-efm-integration/prompt'
|
|
80
|
+
config:
|
|
81
|
+
promptFile: 'D:/prompts/system.md'
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
The configured text then **replaces every system-prompt section**: DSH's
|
|
85
|
+
first-party guidance, the harness identity opener, and this bundle's execution
|
|
86
|
+
contract are all dropped. Three things are deliberately unaffected:
|
|
87
|
+
|
|
88
|
+
- **Tool schemas** are still assembled and sent, so the model keeps its tools.
|
|
89
|
+
- **Runtime context** such as the current-directory snapshot is delivered as
|
|
90
|
+
user-role context and is not part of the replaced text.
|
|
91
|
+
- **The text is not interpolated.** `{{…}}` stays literal, so a prompt that
|
|
92
|
+
documents template syntax cannot break assembly.
|
|
93
|
+
|
|
94
|
+
Setting both keys, an empty `prompt`, a missing `promptFile`, or an empty file
|
|
95
|
+
fails at plugin load time. Sections from other plugins (skills, MCP
|
|
96
|
+
instructions, LSP guidance) are dropped as well, so a replacement prompt is
|
|
97
|
+
responsible for any guidance the model still needs.
|
|
98
|
+
|
|
99
|
+
### Custom prompt sidebar and pure mode
|
|
100
|
+
|
|
101
|
+
The **系统提示词** sidebar page saves a replacement prompt at runtime. It is
|
|
102
|
+
stored under `$DSH_HOME/plugins/dsh-efm-integration/system-prompt.json` and
|
|
103
|
+
takes effect from the next model step without restarting DSH. **恢复默认**
|
|
104
|
+
deletes the saved file and restores the bundled contract. Text is limited to
|
|
105
|
+
128 KiB (UTF-8).
|
|
106
|
+
|
|
107
|
+
The page also has an **agent preset** selector. The saved text can target one
|
|
108
|
+
DSH preset (`standard`, `minimal`, …) or **全部预设** (all presets, the original
|
|
109
|
+
global behavior). Only sessions using the target preset receive the replacement
|
|
110
|
+
and its pure-mode effects; other presets keep their own prompt, runtime context,
|
|
111
|
+
tools, and plugin injections. The selector lists the presets DSH currently
|
|
112
|
+
declares, hiding broken ones. A saved target that later disappears is reported
|
|
113
|
+
as unavailable and does not silently become global. Older single-prompt files
|
|
114
|
+
are migrated to the all-presets target.
|
|
115
|
+
|
|
116
|
+
A saved prompt activates **pure mode** for its target:
|
|
117
|
+
|
|
118
|
+
- The saved text becomes the only system prompt. Harness identity, skill
|
|
119
|
+
routing, MCP instructions, tool guidance, and other plugins' sections are not
|
|
120
|
+
sent.
|
|
121
|
+
- `skill-router` stops injecting user-role messages for those sessions.
|
|
122
|
+
- Optional runtime-context snapshots (for example the current directory) are
|
|
123
|
+
suppressed for those sessions.
|
|
124
|
+
- Tools are denied for agents using the target preset (or for every agent with
|
|
125
|
+
the all-presets target), so the model receives no tool schemas and cannot
|
|
126
|
+
execute tools.
|
|
127
|
+
|
|
128
|
+
Deployment configuration wins: if `prompt`/`promptFile` is set on the plugin
|
|
129
|
+
row, the page is read-only and the configured replacement keeps its original
|
|
130
|
+
global semantics (tools and runtime context remain). The management route
|
|
131
|
+
requires an owner principal, a same-origin request, and the header
|
|
132
|
+
`x-dsh-efm-integration-confirm: SYSTEM_PROMPT_CHANGE`.
|
|
133
|
+
|
|
134
|
+
Pure mode has three limits: DSH records prompt changes as `system/message`
|
|
135
|
+
events in the Session; tools registered directly in an agent's own scope are
|
|
136
|
+
not affected by the global denial, so absolute zero tools cannot be guaranteed;
|
|
137
|
+
and a step already in progress may have resolved its tool set. Do not put
|
|
138
|
+
secrets in the saved text — it is model-visible and logged.
|
|
139
|
+
|
|
140
|
+
## Skill routing
|
|
141
|
+
|
|
142
|
+
The stock DSH catalog exposes a skill's `name` and `description`. This bundle adds
|
|
143
|
+
a routing supplement containing `whenToUse`, which is often more specific than the
|
|
144
|
+
short description.
|
|
145
|
+
|
|
146
|
+
Keep a skill active for the whole session with frontmatter:
|
|
147
|
+
|
|
148
|
+
```yaml
|
|
149
|
+
metadata:
|
|
150
|
+
always-load: true
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Or configure resident skills explicitly:
|
|
154
|
+
|
|
155
|
+
```yaml
|
|
156
|
+
- id: dsh-efm-integration-skill-router
|
|
157
|
+
config:
|
|
158
|
+
residentSkills:
|
|
159
|
+
- engineer-style
|
|
160
|
+
- project-conventions
|
|
161
|
+
maxTriggerChars: 500
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Resident content and the routing supplement are deduplicated by digest against
|
|
165
|
+
visible session history, so unchanged instructions are not injected again on the
|
|
166
|
+
next step.
|
|
167
|
+
|
|
168
|
+
## Bundled PowerShell skill
|
|
169
|
+
|
|
170
|
+
`powershell-usage` is packaged under `skills/powershell-usage/`, including its
|
|
171
|
+
syntax and version-difference references. It is marked `always-load`, so its
|
|
172
|
+
instructions are available before the first tool decision.
|
|
173
|
+
|
|
174
|
+
## Skill guard
|
|
175
|
+
|
|
176
|
+
`skill-guard` enforces prerequisites at `tools/pre-execute`. The default bundle
|
|
177
|
+
rule requires `powershell-usage` before the `pwsh` tool:
|
|
178
|
+
|
|
179
|
+
```yaml
|
|
180
|
+
requiredSkillsByTool:
|
|
181
|
+
pwsh:
|
|
182
|
+
- powershell-usage
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
A denied call receives the exact skill name and must retry after loading it. A
|
|
186
|
+
successful `skill` call, an explicit user skill invocation, a resident skill
|
|
187
|
+
injection, or a matching event in resumed session history satisfies the guard.
|
|
188
|
+
Additional tool/skill pairs can be added under the same configuration key.
|
|
189
|
+
|
|
190
|
+
## Legacy session repair
|
|
191
|
+
|
|
192
|
+
Earlier releases shipped `execution-budget` and `reasoning-budget` modules; both
|
|
193
|
+
were removed in 0.4.0. The reasoning module once wrote
|
|
194
|
+
`dsh-efm-integration/reasoning-replay` events, and DSH refuses to load a Session
|
|
195
|
+
whose event type is outside its static catalog unless the event carries
|
|
196
|
+
`ignorable: true`.
|
|
197
|
+
|
|
198
|
+
If DSH reports such an event as "not marked ignorable", stop DSH and repair the
|
|
199
|
+
affected Session file or the whole sessions directory:
|
|
200
|
+
|
|
201
|
+
```powershell
|
|
202
|
+
node scripts/repair-reasoning-replay.mjs "$env:USERPROFILE\.dsh\sessions" --dry-run
|
|
203
|
+
node scripts/repair-reasoning-replay.mjs "$env:USERPROFILE\.dsh\sessions"
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
The utility adds `ignorable: true` to legacy reasoning-replay events, creates a
|
|
207
|
+
timestamped `.bak-*` backup, and does not renumber events. Use the `DSH_HOME`
|
|
208
|
+
sessions path instead when `DSH_HOME` is customized.
|
|
209
|
+
|
|
210
|
+
## Command guard
|
|
211
|
+
|
|
212
|
+
`command-guard` refuses a foreground shell call before execution when it waits with
|
|
213
|
+
`sleep`/`Start-Sleep` for at least `maxSleepSeconds`, or scans a filesystem root.
|
|
214
|
+
Calls marked `run_in_background: true` are allowed by default.
|
|
215
|
+
|
|
216
|
+
```yaml
|
|
217
|
+
- id: dsh-efm-integration-command-guard
|
|
218
|
+
config:
|
|
219
|
+
maxSleepSeconds: 30
|
|
220
|
+
denyRootScans: true
|
|
221
|
+
allowBackground: true
|
|
222
|
+
extraDenyPatterns: []
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
The denial names a supported alternative: a background job with `job_output`, an
|
|
226
|
+
explicit `timeoutMs`, or a narrower path.
|
|
227
|
+
|
|
228
|
+
## Clear archived Sessions
|
|
229
|
+
|
|
230
|
+
The web sidebar includes **清空全部存档会话**. It counts the archived root
|
|
231
|
+
Sessions and all of their descendant Sessions. Deleting them requires browser
|
|
232
|
+
confirmation and the server-side header
|
|
233
|
+
`x-dsh-efm-integration-confirm: DELETE_ALL_ARCHIVED`.
|
|
234
|
+
|
|
235
|
+
Deletion removes:
|
|
236
|
+
|
|
237
|
+
- JSONL Session log directories for archived roots and their descendants;
|
|
238
|
+
- the Sessions' Workspace accounting;
|
|
239
|
+
- their entries in the global archive set.
|
|
240
|
+
|
|
241
|
+
The operation refuses the whole batch if any target is running or has a live
|
|
242
|
+
Agent, if persistence is not JSONL, or if a stored path does not follow the
|
|
243
|
+
per-Session `session-*` directory convention. Workspace source files and shared
|
|
244
|
+
attachments are preserved. After success the page reloads so the sidebar reflects
|
|
245
|
+
the new Session catalog.
|
|
246
|
+
|
|
247
|
+
## Language servers (LSP)
|
|
248
|
+
|
|
249
|
+
DSH ships an LSP stack (`@deepseek-ai/dsh-lsp`, `@deepseek-ai/dsh-lsp-stdio`,
|
|
250
|
+
`@deepseek-ai/dsh-tool-lsp`) but mounts none of it: a deployment must supply the
|
|
251
|
+
servers and the configuration. This bundle owns that stack. The `lsp-servers`
|
|
252
|
+
module mounts the `ctx.lsp` seam, one stdio provider per enabled server, and the
|
|
253
|
+
model-facing `lsp` tool.
|
|
254
|
+
|
|
255
|
+
The seam offers exactly four read-only operations — `goToDefinition`,
|
|
256
|
+
`findReferences`, `goToImplementation`, and `hover`. DSH deliberately excludes
|
|
257
|
+
diagnostics, symbol lists, rename, and formatting, so this bundle does not add
|
|
258
|
+
them either. Use a compiler for correctness checks.
|
|
259
|
+
|
|
260
|
+
### Sidebar page
|
|
261
|
+
|
|
262
|
+
The web sidebar includes **语言服务器**. It lists each built-in preset, whether its
|
|
263
|
+
executable was found, and which launch line will be used, and lets you enable or
|
|
264
|
+
disable any preset. Changes are written to
|
|
265
|
+
`$DSH_HOME/plugins/dsh-efm-integration/lsp-servers.json` and take effect for
|
|
266
|
+
subsequent queries without restarting DSH.
|
|
267
|
+
|
|
268
|
+
| Preset | Extensions | Install |
|
|
269
|
+
| --- | --- | --- |
|
|
270
|
+
| `typescript` | `.ts .tsx .mts .cts .js .jsx .mjs .cjs` | `npm install -g typescript-language-server typescript` |
|
|
271
|
+
| `python` | `.py .pyi` | `pip install pyright`, `npm install -g pyright`, or `pip install python-lsp-server` |
|
|
272
|
+
| `cpp` | `.c .h .cpp .cc .cxx .hpp .hh .hxx` | put `clangd` on `PATH` |
|
|
273
|
+
| `java` | `.java` | Eclipse JDT LS with `JDTLS_HOME` (and `JAVA_HOME`), or `jdtls` on `PATH` |
|
|
274
|
+
| `rust` | `.rs` | `rustup component add rust-analyzer` |
|
|
275
|
+
| `go` | `.go` | `go install golang.org/x/tools/gopls@latest` |
|
|
276
|
+
|
|
277
|
+
No preset is enabled by default. Language-server processes are reclaimed when DSH
|
|
278
|
+
exits; the page shows a restart hint instead of killing processes, because
|
|
279
|
+
`dsh-lsp-stdio` owns the pooled servers and a hard kill would leave them running.
|
|
280
|
+
|
|
281
|
+
### Configuration
|
|
282
|
+
|
|
283
|
+
```yaml
|
|
284
|
+
- id: dsh-efm-integration-lsp-servers
|
|
285
|
+
config:
|
|
286
|
+
# Presets to start enabled when the store has no entry for them yet.
|
|
287
|
+
presets: []
|
|
288
|
+
# `lazy` keeps the lsp tool out of the model's tool list until a provider is
|
|
289
|
+
# live; `always` mounts it permanently.
|
|
290
|
+
toolMount: lazy
|
|
291
|
+
# Refuse sidebar entries that name an arbitrary executable.
|
|
292
|
+
allowCustomServers: false
|
|
293
|
+
# Pin a launch line instead of probing PATH.
|
|
294
|
+
launchOverrides:
|
|
295
|
+
typescript:
|
|
296
|
+
command: node
|
|
297
|
+
args: ['C:/Users/you/AppData/Roaming/npm/node_modules/typescript-language-server/lib/cli.mjs', '--stdio']
|
|
298
|
+
tool:
|
|
299
|
+
maxLocations: 100
|
|
300
|
+
maxResultChars: 16000
|
|
301
|
+
timeoutMs: 60000
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
### Security boundary
|
|
305
|
+
|
|
306
|
+
The management route requires DSH authentication, an **owner** principal (API
|
|
307
|
+
tokens are refused), a same-origin request, and the header
|
|
308
|
+
`x-dsh-efm-integration-confirm: LSP_SERVER_CHANGE`.
|
|
309
|
+
|
|
310
|
+
A language server runs with the filesystem and process authority of the mounted
|
|
311
|
+
execution world, so the page cannot supply command lines unless
|
|
312
|
+
`allowCustomServers` is turned on in the plugin config. Even then, entries that
|
|
313
|
+
name a shell or script host (`cmd`, `powershell`, `pwsh`, `sh`, `bash`, `wscript`,
|
|
314
|
+
`mshta`, `rundll32`), contain shell metacharacters, or span multiple lines are
|
|
315
|
+
refused. Preset entries can never carry a command: they reference a built-in
|
|
316
|
+
preset id only.
|
|
317
|
+
|
|
318
|
+
### Windows note
|
|
319
|
+
|
|
320
|
+
The harness spawns without a shell, so an npm `.cmd` or `.ps1` shim cannot be
|
|
321
|
+
launched directly, and PATH lookups only accept `.exe`/`.com` targets. Presets
|
|
322
|
+
therefore read each installed package's own `package.json#bin` to find its
|
|
323
|
+
JavaScript entry point and run it with the harness's Node binary, searching both
|
|
324
|
+
every PATH directory and the sibling `lib/node_modules` of a `bin` directory.
|
|
325
|
+
`launchOverrides` is the fallback when a server lives outside those locations.
|
|
326
|
+
|
|
327
|
+
## MCP tool loading
|
|
328
|
+
|
|
329
|
+
DSH's MCP client supports deferred tool loading, but this bundle does not rewrite
|
|
330
|
+
MCP server rows it does not own. To reduce MCP context, set `toolLoading:
|
|
331
|
+
on-demand` on each large or infrequently used server:
|
|
332
|
+
|
|
333
|
+
```yaml
|
|
334
|
+
- id: mcp
|
|
335
|
+
config:
|
|
336
|
+
servers:
|
|
337
|
+
github:
|
|
338
|
+
transport: stdio
|
|
339
|
+
command: npx
|
|
340
|
+
args: ['-y', '@modelcontextprotocol/server-github']
|
|
341
|
+
toolLoading: on-demand
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
Existing server entries keep DSH's default unless explicitly overridden. Keep
|
|
345
|
+
credentials in DSH's credential provider rather than in this bundle or its files.
|
|
346
|
+
|
|
347
|
+
## Development
|
|
348
|
+
|
|
349
|
+
```powershell
|
|
350
|
+
pnpm install # runs `prepare` and builds lib/
|
|
351
|
+
pnpm run build # src/ -> lib/
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
`lib/` is generated and not committed. `client.js` is maintained by hand. Before
|
|
355
|
+
packaging, build first and then inspect the tarball:
|
|
356
|
+
|
|
357
|
+
```powershell
|
|
358
|
+
pnpm pack --pack-destination .pack
|
|
359
|
+
tar -tzf .pack/dsh-efm-integration-<version>.tgz
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
The package should contain `lib/`, `client.js`, `cordis.patch.yml`, `skills/`,
|
|
363
|
+
`scripts/`, `README.md`, `README.zh.md`, and `package.json`.
|
|
364
|
+
|
|
365
|
+
## License
|
|
366
|
+
|
|
367
|
+
MIT
|