dsh-code 1.0.6 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +123 -26
- package/README.md +124 -27
- package/bin/deepseek.mjs +283 -35
- package/cordis.patch.yml +97 -0
- package/lib/index.mjs +5008 -881
- package/lib/session-query.mjs +150 -0
- package/lib/startup.mjs +4 -4
- package/lib/{theme-DCT8Y2xf.mjs → theme-7u5Qo3dF.mjs} +657 -20
- package/lib/types/app.d.ts +106 -62
- package/lib/types/authorization-panel.d.ts +3 -3
- package/lib/types/git-workflow.d.ts +91 -2
- package/lib/types/i18n.d.ts +39 -0
- package/lib/types/index.d.ts +100 -1
- package/lib/types/input-split.d.ts +1 -1
- package/lib/types/kernel-panels.d.ts +107 -29
- package/lib/types/language-panel.d.ts +12 -0
- package/lib/types/locales/en.d.ts +450 -0
- package/lib/types/locales/zh.d.ts +9 -0
- package/lib/types/mentions.d.ts +7 -3
- package/lib/types/models.d.ts +14 -0
- package/lib/types/panel-accent.d.ts +28 -0
- package/lib/types/rainbow.d.ts +69 -0
- package/lib/types/render/animations.d.ts +42 -0
- package/lib/types/render/editor.d.ts +4 -3
- package/lib/types/render/ime-cursor.d.ts +60 -0
- package/lib/types/render/inspector.d.ts +26 -0
- package/lib/types/render/lines.d.ts +21 -1
- package/lib/types/render/markdown.d.ts +1 -1
- package/lib/types/render/projection.d.ts +130 -4
- package/lib/types/render/status.d.ts +9 -9
- package/lib/types/render/text.d.ts +6 -0
- package/lib/types/render/usage.d.ts +113 -0
- package/lib/types/session-directory.d.ts +17 -0
- package/lib/types/session-query.d.ts +92 -0
- package/lib/types/startup.d.ts +1 -1
- package/lib/types/terminal-title.d.ts +66 -0
- package/lib/types/theme-panel.d.ts +2 -2
- package/lib/types/theme.d.ts +271 -52
- package/lib/types/update-panel.d.ts +49 -0
- package/lib/types/update.d.ts +75 -0
- package/lib/types/version.d.ts +4 -3
- package/package.json +246 -90
- package/src/app.ts +1369 -509
- package/src/approval.ts +166 -166
- package/src/authorization-panel.ts +19 -16
- package/src/editor-keys.ts +371 -371
- package/src/git-workflow.ts +229 -3
- package/src/i18n.ts +68 -0
- package/src/index.ts +534 -80
- package/src/input-split.ts +3 -3
- package/src/internals.ts +5 -0
- package/src/kernel-panels.ts +554 -86
- package/src/keyboard.ts +5 -4
- package/src/language-panel.ts +53 -0
- package/src/locales/en.ts +489 -0
- package/src/locales/zh.ts +488 -0
- package/src/mentions.ts +8 -4
- package/src/models.ts +264 -212
- package/src/panel-accent.ts +41 -0
- package/src/presets.ts +1 -1
- package/src/provider-settings.ts +1 -1
- package/src/rainbow.ts +208 -0
- package/src/render/animations.ts +104 -6
- package/src/render/editor.ts +25 -24
- package/src/render/export.ts +116 -95
- package/src/render/ime-cursor.ts +147 -0
- package/src/render/inspector.ts +42 -0
- package/src/render/lines.ts +628 -415
- package/src/render/markdown.ts +15 -3
- package/src/render/projection.ts +572 -21
- package/src/render/status.ts +59 -39
- package/src/render/text.ts +14 -0
- package/src/render/tool-preview.ts +77 -77
- package/src/render/usage.ts +430 -0
- package/src/render/width.ts +2 -2
- package/src/session-directory.ts +8 -6
- package/src/session-query.ts +239 -0
- package/src/startup.ts +3 -3
- package/src/subagents.ts +229 -229
- package/src/terminal-title.ts +190 -0
- package/src/theme-panel.ts +17 -21
- package/src/theme.ts +281 -33
- package/src/update-panel.ts +256 -0
- package/src/update.ts +126 -0
- package/src/version.ts +58 -20
- package/src/whale-glyph.ts +23 -23
package/README.en.md
CHANGED
|
@@ -7,7 +7,7 @@ English | [中文](README.md)
|
|
|
7
7
|
<p align="center"><img alt="Typing SVG" src="https://readme-typing-svg.herokuapp.com?font=JetBrains+Mono&weight=500&size=22&duration=4000&pause=700&color=4176E6&center=true&vCenter=true&width=680&lines=DeepSeek+Harness+Code;Terminal+Coding+Interface+for+the+DSH+Core"></p>
|
|
8
8
|
<p align="center">
|
|
9
9
|
<a href="https://github.com/deepseek-ai/deepseek-harness"><img alt="DeepSeek Harness" src="https://img.shields.io/badge/DeepSeek-Harness-4176E6?style=for-the-badge&logo=deepseek&logoColor=white&labelColor=1c1917"></a>
|
|
10
|
-
<a href="https://www.npmjs.com/package/@deepseek-ai/dsh"><img alt="dsh version" src="https://img.shields.io/badge/dsh-0.1.5--rc.
|
|
10
|
+
<a href="https://www.npmjs.com/package/@deepseek-ai/dsh"><img alt="dsh version" src="https://img.shields.io/badge/dsh-0.1.5--rc.2-4176E6?style=for-the-badge&logo=deepseek&logoColor=white&labelColor=1c1917"></a>
|
|
11
11
|
<a href="https://github.com/UNLINEARITY/dsh-code/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/UNLINEARITY/dsh-code?label=Stars&style=for-the-badge&logo=github&logoColor=white&color=4176E6&labelColor=1c1917"></a>
|
|
12
12
|
<a href="https://www.npmjs.com/package/dsh-code"><img alt="npm version" src="https://img.shields.io/npm/v/dsh-code?label=npm&style=for-the-badge&logo=npm&color=cb3837&labelColor=1c1917"></a>
|
|
13
13
|
<a href="https://github.com/UNLINEARITY/dsh-code/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/github/license/UNLINEARITY/dsh-code?label=License&style=for-the-badge&logo=opensourceinitiative&color=4176E6&labelColor=1c1917"></a>
|
|
@@ -23,21 +23,31 @@ DeepSeek Harness registers models, tools, storage, policies, and interfaces as p
|
|
|
23
23
|
|
|
24
24
|
## 2. Quick start
|
|
25
25
|
|
|
26
|
-
Requires Node `^22.19 || >=24` and the preview `dsh` CLI (current release line: `@deepseek-ai/dsh@0.1.5-rc.
|
|
26
|
+
Requires Node `^22.19 || >=24` and the preview `dsh` CLI (current release line: `@deepseek-ai/dsh@0.1.5-rc.2`). You can still enter the TUI, browse sessions, and use non-model features without configuring a model; press `Tab` in `/model` to manage API keys, OAuth, device-code sign-in, endpoints, and models.
|
|
27
27
|
|
|
28
28
|
### 1. Install and update
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
Install from npm (recommended). `/update` and `deepseek update --apply` both work afterwards: they check npm for a newer version and walk you through the upgrade.
|
|
31
31
|
|
|
32
32
|
```sh
|
|
33
|
-
npm install -g @deepseek-ai/dsh@0.1.5-rc.
|
|
34
|
-
npm install -g
|
|
35
|
-
dsh plugin --profile cli add dsh-code@1.0
|
|
33
|
+
npm install -g @deepseek-ai/dsh@0.1.5-rc.2 pnpm
|
|
34
|
+
npm install -g dsh-code@1.2.0
|
|
35
|
+
dsh plugin --profile cli add dsh-code@1.2.0
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
When npm is unreachable (restricted network, a mirror outage), install the GitHub Release tarball instead. CI builds it on every tag and attaches it to the release; lib is prebuilt, so the installing machine needs no toolchain:
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
npm install -g @deepseek-ai/dsh@0.1.5-rc.2 pnpm
|
|
42
|
+
npm install -g https://github.com/unlinearity/dsh-code/releases/download/1.2.0/dsh-code-1.2.0.tgz
|
|
43
|
+
dsh plugin --profile cli add https://github.com/unlinearity/dsh-code/releases/download/1.2.0/dsh-code-1.2.0.tgz
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
> npm script prompts: npm 11.6+ may print `npm warn install-scripts` during a global install (unapproved build scripts for node-pty, koffi, and friends). The host ships prebuilt artifacts, so common platforms can ignore the warning; if a native-module error appears after installing, follow npm's own hint and rerun with `npm install -g --allow-scripts=<package list>`.
|
|
39
47
|
>
|
|
40
|
-
> Version alignment: dsh-code targets dsh `0.1.5-rc.
|
|
48
|
+
> Version alignment: dsh-code targets dsh `0.1.5-rc.2`, with every Harness dependency pinned exactly to `0.1.5-rc.2`. A local `link:` mount should be rebuilt with `git pull && pnpm install && pnpm build`; do not run the updater against a checkout.
|
|
49
|
+
>
|
|
50
|
+
> A GitHub tarball install can lead npm by one release (until the registry carries the same version). The updater only reads npm, so it reports that this install is newer and refuses to downgrade, instead of claiming everything is up to date; use `/update` once npm catches up.
|
|
41
51
|
|
|
42
52
|
### 2. Launch commands
|
|
43
53
|
|
|
@@ -53,7 +63,7 @@ dsh-code
|
|
|
53
63
|
|
|
54
64
|
> DeepSeek Harness is still a developer preview and may introduce compatibility-breaking changes. DSH-Code will continue to track the evolution of its plugin interfaces.
|
|
55
65
|
|
|
56
|
-
For installation, native-module, and plugin-loading issues, see [Troubleshooting](docs/problems.md).
|
|
66
|
+
For installation, native-module, and plugin-loading issues, run `deepseek doctor` first, then see [Troubleshooting](docs/problems.md).
|
|
57
67
|
|
|
58
68
|
## 3. Core features and usage
|
|
59
69
|
|
|
@@ -64,9 +74,10 @@ DSH-Code brings DSH Agents, models, tools, and durable sessions directly into th
|
|
|
64
74
|
- Create sessions with `/new`, or restore existing sessions with `/resume` and `--continue`
|
|
65
75
|
- Create a new work branch from a historical point with `/fork` while preserving the original session
|
|
66
76
|
- Search history by current directory, update time, and session scope
|
|
67
|
-
- Recall input history with Up/Down, or search previous prompts with `/history`
|
|
68
|
-
- Use persistent titles, Markdown export, context occupancy, token, cache, TTFT, and elapsed-time metrics
|
|
69
|
-
-
|
|
77
|
+
- Recall input history with Up/Down (typed slash commands included), or search previous prompts and commands with `/history`
|
|
78
|
+
- Use persistent titles, Markdown export, context occupancy, token, cache, TTFT, and elapsed-time metrics; `/usage` reports the harness token meter's four disjoint buckets, the totals merged by model, and a per-turn breakdown
|
|
79
|
+
- The status bar's `in` counts only uncached input, and `cache` shows both the cache-read volume and the hit share — together they are the billed prompt side
|
|
80
|
+
- Restore the session's Agent Preset, model selection, and subagent list when resuming it; the welcome header shows both the dsh and dsh-code versions
|
|
70
81
|
|
|
71
82
|
<p align="center"><img src="docs/pictures/dsh-3.png" width="95%" alt="Searchable session resume picker"></p>
|
|
72
83
|
|
|
@@ -104,18 +115,41 @@ Levels above `high` include `xhigh`, `x-high`, `very-high`, `max`, `maximum`, an
|
|
|
104
115
|
|
|
105
116
|
- Use `@` to reference workspace files or existing sessions; selecting PNG, JPEG, WebP, or GIF files attaches the real image automatically
|
|
106
117
|
- Attach images through the initial prompt, repeated `--image` arguments, or by dragging one or more images into the terminal
|
|
107
|
-
- Inspect changes by file with `/diff`, and start a read-only code review with `/review`
|
|
118
|
+
- Inspect changes by file with `/diff`, and start a read-only code review with `/review` (a range picker; diffs use full-row green/red)
|
|
119
|
+
- `run_code` lists nested tool calls as they run; workflow runs list their member agents until they finish
|
|
108
120
|
- Copy the latest complete response with `/copy`, and inspect full history and tool details with Ctrl+O
|
|
109
121
|
- Handle tool approvals, structured questions, plan reviews, multiple selections, and custom answers
|
|
110
122
|
- Control what the Agent may do with permission Presets and sandboxes; add instructions or interrupt while a task is running
|
|
111
123
|
|
|
112
|
-
### 5.
|
|
124
|
+
### 5. Queued and steered messages
|
|
125
|
+
|
|
126
|
+
While a turn is running you can keep typing. There are two ways to send what you type:
|
|
127
|
+
|
|
128
|
+
- **Queue** — it waits until the turn finishes and then runs as a new turn. Use it for "do this once you are done with that".
|
|
129
|
+
- **Steer** — it reaches the model before the next step of the running turn, as part of that request. Use it when the work has gone the wrong way and you want it corrected now.
|
|
130
|
+
|
|
131
|
+
The difference is **when the model sees it**: a queued message is read once the turn has finished, a steered one before the turn makes its next move.
|
|
132
|
+
|
|
133
|
+
How to send each way:
|
|
134
|
+
|
|
135
|
+
- Press `Tab` on an empty composer to switch between them. The prompt glyph (`❯` / `↳`), the placeholder text, and the notice shown on switching all say which one is selected. With text in the box, `Tab` still completes commands and references.
|
|
136
|
+
- `/queue` opens the queue panel: press `Enter` on a message to send it as steering instead, `e` to edit its text (attachments are kept as they are), or `d` to remove it.
|
|
137
|
+
- Press `Delete` on an empty composer to cancel the newest queued message.
|
|
138
|
+
- Pressing `Esc` to cancel the turn keeps **queued messages and sends them next**, while steered messages are dropped with the turn.
|
|
139
|
+
|
|
140
|
+
Every prompt in the transcript is a full-width coloured row, and the colour says how it was sent: the theme's bright brand colour for an ordinary message, its warning colour for a queued one, and its third accent for a steered one, each labelled with "queued" or "steered". The colour is computed from the theme, so switching themes or rerolling rainbow changes it too.
|
|
141
|
+
|
|
142
|
+
A message counts as queued or steered only when a turn was **already running** at the moment you sent it. A message sent while idle is an ordinary one even if the composer is set to steer, because it starts a new turn straight away.
|
|
143
|
+
|
|
144
|
+
See [Queued and steered messages](docs/message-queue.md) for the queue behaviour, the order the upstream queues are read in, and the colour values per theme.
|
|
145
|
+
|
|
146
|
+
### 6. Commands and key bindings
|
|
113
147
|
|
|
114
148
|
Start the TUI:
|
|
115
149
|
|
|
116
150
|
```sh
|
|
117
151
|
dsh --profile cli # create a standard session
|
|
118
|
-
dsh --profile cli --mode
|
|
152
|
+
dsh --profile cli --mode ptc # start with the specified Agent Preset (standard/minimal/cordis/ptc)
|
|
119
153
|
dsh --profile cli --continue # resume the latest session for the current directory
|
|
120
154
|
dsh --profile cli --resume abc123 # resume by id or unique prefix
|
|
121
155
|
dsh --profile cli --session my-id # create a session with an explicit id
|
|
@@ -129,12 +163,13 @@ The following built-in commands are available inside the TUI. Additional Harness
|
|
|
129
163
|
| --- | --- |
|
|
130
164
|
| `/new [preset]` | Create a session, optionally selecting an Agent Preset |
|
|
131
165
|
| `/resume [id\|prefix]` | Search for or restore an existing session |
|
|
166
|
+
| `/search [query]` | Full-text search across persisted sessions (Enter resumes the hit) |
|
|
132
167
|
| `/resume cancel` | Cancel a pending session switch |
|
|
133
168
|
| `/fork [event-seq]` | Create a session branch from the latest completed turn or a specified event position |
|
|
134
169
|
| `/delete [id\|prefix]` | Delete a session and its subagent sessions |
|
|
135
170
|
| `/title <text>` | Change the current session title |
|
|
136
171
|
| `/export [path]` | Export the current session as Markdown |
|
|
137
|
-
| `/history` | Search and reuse previously submitted prompts |
|
|
172
|
+
| `/history` | Search and reuse previously submitted prompts and slash commands |
|
|
138
173
|
| `/clear` | Clear the current terminal display without deleting the durable session |
|
|
139
174
|
|
|
140
175
|
#### Agents, models, and permissions
|
|
@@ -152,10 +187,13 @@ The following built-in commands are available inside the TUI. Additional Harness
|
|
|
152
187
|
| Command | Purpose |
|
|
153
188
|
| --- | --- |
|
|
154
189
|
| `/diff [--staged\|ref]` | Inspect the working-tree, staged, or specified-ref Git diff by file |
|
|
155
|
-
| `/review [
|
|
190
|
+
| `/review [note]` | Bare /review opens a candidate picker (uncommitted changes / pick a branch / pick a commit / custom focus); any argument becomes a review note over the uncommitted diff (`/review in Chinese`). The diff is pasted into the current session under read-only permissions, and findings arrive with P0-P3 priorities and file anchors |
|
|
156
191
|
| `/todos` | View the complete todo list for the current session |
|
|
192
|
+
| `/queue` | See the messages waiting for the next turn: enter sends one as steering instead, `e` edits its text, `d` removes it; `↑↓`/`PageUp`/`PageDown`/`g`/`G` move |
|
|
193
|
+
| `/usage` | See this session's token usage: the four disjoint buckets (uncached input, cache write, cache read, output), the totals merged by model, and the per-turn breakdown |
|
|
157
194
|
| `/agents` | View subagent sessions created by the current session |
|
|
158
195
|
| `/jobs` | View background jobs and their runtime status |
|
|
196
|
+
| `/schedule` | Inspect active reminders (created through the model's schedule tools; read-only, overdue first) |
|
|
159
197
|
| `/copy` | Copy the latest complete assistant response |
|
|
160
198
|
|
|
161
199
|
#### Extensions, display, and exit
|
|
@@ -163,9 +201,12 @@ The following built-in commands are available inside the TUI. Additional Harness
|
|
|
163
201
|
| Command | Purpose |
|
|
164
202
|
| --- | --- |
|
|
165
203
|
| `/plugin [query]` | Inspect loaded extensions and their status |
|
|
204
|
+
| `/update` | Checks npm for a newer version and confirms the upgrade. A GitHub tarball install can lead npm, in which case it says so and refuses to downgrade |
|
|
166
205
|
| `/statusline` | Select the items displayed in the status bar |
|
|
167
206
|
| `/vscode-keys` | Pass Ctrl+R through VS Code-family terminals (idempotent user-level keybindings.json write) |
|
|
168
|
-
| `/theme` | Switch
|
|
207
|
+
| `/theme` | Switch colors: `dark` / `light` / `prismatic` / `rainbow` / `auto` |
|
|
208
|
+
| `/rainbow [seed]` | Reroll or pin the rainbow theme seed; a bare `/rainbow` rolls a new seed and switches to rainbow |
|
|
209
|
+
| `/language [en\|zh]` | Switch the interface language, default English; model prompts and factual status values stay in English |
|
|
169
210
|
| `/animation` | Toggle timed animations (shimmer/chase/blink/switch wave), `/animation [on\|off]` |
|
|
170
211
|
| `/help` | View key bindings, built-in commands, Harness commands, and user skills |
|
|
171
212
|
| `/quit` | Exit DSH-Code |
|
|
@@ -175,17 +216,18 @@ The following built-in commands are available inside the TUI. Additional Harness
|
|
|
175
216
|
| Action | Purpose |
|
|
176
217
|
| --- | --- |
|
|
177
218
|
| `Enter` | Submit the current input |
|
|
219
|
+
| `Ctrl+J` / `Alt+Enter` | Insert a newline in the composer (with the enhanced keyboard protocol, `Shift+Enter` / `Ctrl+Enter` work too) |
|
|
178
220
|
| `Up` / `Down` | Recall the previous or next input-history entry |
|
|
179
|
-
| `Tab` | Complete commands, skills, or `@` references |
|
|
221
|
+
| `Tab` | Complete commands, skills, or `@` references; on an empty composer, switch the next message between queue and steer |
|
|
180
222
|
| `@` | Reference workspace files or existing sessions; image files are sent as attachments |
|
|
181
|
-
| `Ctrl+O` | Inspect full history and tool details |
|
|
223
|
+
| `Ctrl+O` | Inspect full history and tool details, with a kind label on each entry (user prompt / reply / tool call, and so on) |
|
|
182
224
|
| `Ctrl/Alt+R` | Fold or expand model reasoning; run /vscode-keys first in VS Code-family terminals to pass Ctrl+R through |
|
|
183
|
-
| `Shift+Tab` | Cycle
|
|
184
|
-
| `Delete` | Cancel the newest queued message when the composer is empty |
|
|
225
|
+
| `Shift+Tab` | Cycle permission Presets, and the plan station when `/plan` is available |
|
|
226
|
+
| `Delete` | Cancel the newest queued message when the composer is empty (steering is not in the queue; press `Esc` to end the turn instead) |
|
|
185
227
|
| `Ctrl+K` | Delete from the cursor to the end of the line |
|
|
186
228
|
| `Ctrl+U` | Clear the current input line |
|
|
187
229
|
| `Ctrl+A` / `Ctrl+E` | Move to the beginning or end of the current line |
|
|
188
|
-
| `Esc` | Close the current menu or interrupt the running turn |
|
|
230
|
+
| `Esc` | Close the current menu or interrupt the running turn; queued messages are kept and sent next, steered ones are dropped with the turn |
|
|
189
231
|
| `Ctrl+C` | Cancel a task, clear the input, or exit, depending on the current state |
|
|
190
232
|
| `Ctrl+D` | Exit DSH-Code |
|
|
191
233
|
|
|
@@ -204,7 +246,56 @@ DSH-Code reads the live Harness registries instead of maintaining a separate loc
|
|
|
204
246
|
|
|
205
247
|
`/plugin` provides a read-only view of the current Cordis loader state.
|
|
206
248
|
|
|
207
|
-
### 2.
|
|
249
|
+
### 2. Bundled and optional official plugins
|
|
250
|
+
|
|
251
|
+
The following official plugins ship with DSH-Code and are enabled in the composition by default:
|
|
252
|
+
|
|
253
|
+
- **Session search**: the model gets five read-only tools — `session_search`, `session_event_search`, `session_trace`, `session_event_trace`, `session_event_read` — over prior session logs (the index builds lazily on the first search; cross-session access is scoped by exact working directory; on Node 22 the first search prints a one-time `node:sqlite` experimental warning, which is expected).
|
|
254
|
+
- **Reminders**: `schedule` provides durable, restart-surviving reminders (created through the `schedule_create` / `schedule_list` / `schedule_delete` tools); the `/schedule` panel shows them read-only with overdue rows first. `time-context` injects a clock reading for the model (throttled to 30s).
|
|
255
|
+
- **Clock for reminders**: `time-context` injects the current time for the model (throttled to 30s), so phrasings like "remind me at 5 pm" work.
|
|
256
|
+
|
|
257
|
+
The following official plugins are installed but opt-in (append rows in the user layer `~/.dsh/profiles/cli/cordis.patch.yml`, or install as noted):
|
|
258
|
+
|
|
259
|
+
- **MCP servers** (`@deepseek-ai/dsh-mcp-client`, one row per server; tools register as `mcp__<server>__<tool>`):
|
|
260
|
+
|
|
261
|
+
```yaml
|
|
262
|
+
- insert:
|
|
263
|
+
- id: mcp-memory
|
|
264
|
+
name: '@deepseek-ai/dsh-mcp-client'
|
|
265
|
+
config:
|
|
266
|
+
transport: stdio
|
|
267
|
+
serverName: memory
|
|
268
|
+
command: mcp-server-memory
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
(HTTP transports use `transport: streamable-http` plus `url`; an unreachable server degrades to a reconnect loop and never breaks startup.)
|
|
272
|
+
- **Claude Code / Codex hooks bridges** (`@deepseek-ai/dsh-hooks-claude-code` / `-codex`): run existing hooks configurations at the interception seams; a missing hooks file is a silent no-op:
|
|
273
|
+
|
|
274
|
+
```yaml
|
|
275
|
+
- insert:
|
|
276
|
+
- id: hooks-claude
|
|
277
|
+
name: '@deepseek-ai/dsh-hooks-claude-code'
|
|
278
|
+
config:
|
|
279
|
+
configPath: C:/Users/you/.claude/hooks.json
|
|
280
|
+
```
|
|
281
|
+
- **LSP navigation**: the composition carries `lsp` / `lsp-stdio` / `tool-lsp` rows in a disabled state — language-server binaries resolve at mount, and a missing binary would fail the whole composition boot. The host CLI does not bundle the three packages: install them into the profile first (`dsh plugin --profile cli add @deepseek-ai/dsh-lsp @deepseek-ai/dsh-lsp-stdio @deepseek-ai/dsh-tool-lsp`), then flip the three rows to `disabled: false` in the user layer and configure `lsp-stdio` `servers` (extension to language to server command); the model then gets the `lsp` tool (goToDefinition / findReferences / goToImplementation / hover).
|
|
282
|
+
- **Persistent terminals**: the PTY service and platform backends (pwsh dialect on Windows, bash on POSIX) mount by default, but the six model tools `terminal_open` / `terminal_send` / `terminal_read` / `terminal_signal` / `terminal_close` / `terminal_list` ship DISABLED — enabling them grants shell capability to every session, which the preset layer is supposed to gate, so deployments opt in explicitly. `@deepseek-ai/dsh-tool-terminal` is likewise not bundled by the host: run `dsh plugin --profile cli add @deepseek-ai/dsh-tool-terminal` first, then enable in the user layer:
|
|
283
|
+
```yaml
|
|
284
|
+
- id: tool-terminal
|
|
285
|
+
disabled: false
|
|
286
|
+
```
|
|
287
|
+
(Background sends appear in the /jobs panel.)
|
|
288
|
+
- **tmux pane context** (`@deepseek-ai/dsh-tmux-context`): injects the current tmux pane into the model context when running inside tmux (`config: { refreshIntervalMs: 60000 }`); outside tmux every step degrades to a harmless no-op:
|
|
289
|
+
```yaml
|
|
290
|
+
- insert:
|
|
291
|
+
- id: tmux-context
|
|
292
|
+
name: '@deepseek-ai/dsh-tmux-context'
|
|
293
|
+
config:
|
|
294
|
+
refreshIntervalMs: 60000
|
|
295
|
+
```
|
|
296
|
+
- **External CLI delegation**: `dsh plugin --profile cli add @deepseek-ai/dsh-subagent-claude-code` (or `-codex`) installs the dormant provider; following the upstream contract, copy the preset and enable the `tool-subagent-claude-code` / `tool-subagent-codex` row to let the model delegate tasks to the claude / codex CLIs.
|
|
297
|
+
|
|
298
|
+
### 3. Session-scoped Agent Presets
|
|
208
299
|
|
|
209
300
|
The Host owns the shared infrastructure—registries, persistence, session queries, permissions, and sandbox policies—while each session receives an isolated Agent scope composed by an **Agent Preset**:
|
|
210
301
|
|
|
@@ -216,7 +307,7 @@ The Host owns the shared infrastructure—registries, persistence, session queri
|
|
|
216
307
|
|
|
217
308
|
Use `/mode` before the first turn, or start directly with `--mode <preset>`. The selected Preset is written to the session and restored when the session resumes.
|
|
218
309
|
|
|
219
|
-
###
|
|
310
|
+
### 4. Session history and recovery
|
|
220
311
|
|
|
221
312
|
Prompts, streaming chunks, tool calls and results, model selections, plan state, permissions, titles, and Preset selections are all projected from durable Session events. Session recovery, export, history inspection, context metrics, and terminal replay use the same record.
|
|
222
313
|
|
|
@@ -236,12 +327,18 @@ dsh profile
|
|
|
236
327
|
|
|
237
328
|
```sh
|
|
238
329
|
pnpm install
|
|
330
|
+
pnpm lint # type-aware ESLint over src, tests, scripts, and the root configs
|
|
331
|
+
pnpm typecheck # the build project (src)
|
|
332
|
+
pnpm typecheck:tests # the spec suite and scripts
|
|
239
333
|
pnpm test
|
|
240
|
-
pnpm
|
|
334
|
+
pnpm test:coverage # coverage report (reporting only, no threshold)
|
|
241
335
|
pnpm build
|
|
336
|
+
pnpm verify # lint + both typechecks + tests in one pass
|
|
242
337
|
pnpm run gen:whale # regenerate src/whale-glyph.ts from the vendored logo path
|
|
243
338
|
```
|
|
244
339
|
|
|
340
|
+
`tsconfig.test.json` puts the specs inside a TypeScript project, so a fixture that drifts from the interface it fakes fails `pnpm typecheck:tests` instead of surfacing (or not) at runtime.
|
|
341
|
+
|
|
245
342
|
The whale glyph is generated from the DeepSeek FishLogo geometry vendored in `scripts/fish-logo.ts` (source: DeepSeek Harness, MIT).
|
|
246
343
|
|
|
247
344
|
### 1. Source development installation
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<p align="center"><img alt="Typing SVG" src="https://readme-typing-svg.herokuapp.com?font=JetBrains+Mono&weight=500&size=22&duration=4000&pause=700&color=4176E6&center=true&vCenter=true&width=680&lines=DeepSeek+Harness+Code;DSH+%E5%86%85%E6%A0%B8%E7%9A%84%E7%BB%88%E7%AB%AF%E7%BC%96%E7%A0%81%E7%95%8C%E9%9D%A2"></p>
|
|
8
8
|
<p align="center">
|
|
9
9
|
<a href="https://github.com/deepseek-ai/deepseek-harness"><img alt="DeepSeek Harness" src="https://img.shields.io/badge/DeepSeek-Harness-4176E6?style=for-the-badge&logo=deepseek&logoColor=white&labelColor=1c1917"></a>
|
|
10
|
-
<a href="https://www.npmjs.com/package/@deepseek-ai/dsh"><img alt="dsh version" src="https://img.shields.io/badge/dsh-0.1.5--rc.
|
|
10
|
+
<a href="https://www.npmjs.com/package/@deepseek-ai/dsh"><img alt="dsh version" src="https://img.shields.io/badge/dsh-0.1.5--rc.2-4176E6?style=for-the-badge&logo=deepseek&logoColor=white&labelColor=1c1917"></a>
|
|
11
11
|
<a href="https://github.com/UNLINEARITY/dsh-code/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/UNLINEARITY/dsh-code?label=Stars&style=for-the-badge&logo=github&logoColor=white&color=4176E6&labelColor=1c1917"></a>
|
|
12
12
|
<a href="https://www.npmjs.com/package/dsh-code"><img alt="npm version" src="https://img.shields.io/npm/v/dsh-code?label=npm&style=for-the-badge&logo=npm&color=cb3837&labelColor=1c1917"></a>
|
|
13
13
|
<a href="https://github.com/UNLINEARITY/dsh-code/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/github/license/UNLINEARITY/dsh-code?label=License&style=for-the-badge&logo=opensourceinitiative&color=4176E6&labelColor=1c1917"></a>
|
|
@@ -25,23 +25,33 @@ DeepSeek Harness 将模型、工具、存储、策略和界面作为插件,通
|
|
|
25
25
|
|
|
26
26
|
## 二、快速开始
|
|
27
27
|
|
|
28
|
-
需要 Node `^22.19 || >=24` 和预览版 `dsh` CLI(当前版本线:`@deepseek-ai/dsh@0.1.5-rc.
|
|
28
|
+
需要 Node `^22.19 || >=24` 和预览版 `dsh` CLI(当前版本线:`@deepseek-ai/dsh@0.1.5-rc.2`)。未配置模型时仍可进入 TUI、查看会话和使用非模型功能;在 `/model` 中按 Tab 进入供应商管理,配置 API key、OAuth 与设备码登录。
|
|
29
29
|
|
|
30
30
|
### 1. 安装与更新
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
从 npm 安装(推荐)。装好后 `/update` 和 `deepseek update --apply` 都能用:它们查询 npm 上的新版本,确认后按提示升级。
|
|
33
33
|
|
|
34
34
|
```sh
|
|
35
|
-
npm install -g @deepseek-ai/dsh@0.1.5-rc.
|
|
36
|
-
npm install -g
|
|
37
|
-
dsh plugin --profile cli add dsh-code@1.0
|
|
35
|
+
npm install -g @deepseek-ai/dsh@0.1.5-rc.2 pnpm
|
|
36
|
+
npm install -g dsh-code@1.2.0
|
|
37
|
+
dsh plugin --profile cli add dsh-code@1.2.0
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
npm 不可达时(网络受限、镜像临时故障),改用 GitHub Release tarball。每次打 tag 由 CI 构建并挂到 Release,lib 已预构建,安装机不需要工具链:
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
npm install -g @deepseek-ai/dsh@0.1.5-rc.2 pnpm
|
|
44
|
+
npm install -g https://github.com/unlinearity/dsh-code/releases/download/1.2.0/dsh-code-1.2.0.tgz
|
|
45
|
+
dsh plugin --profile cli add https://github.com/unlinearity/dsh-code/releases/download/1.2.0/dsh-code-1.2.0.tgz
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
> npm 脚本提示:npm 11.6+ 可能在全局安装时提示 `npm warn install-scripts`(node-pty、koffi 等原生依赖的构建脚本未获批准)。宿主随包自带预编译产物,常规平台可直接忽略;若安装后出现原生模块报错,按 npm 提示执行 `npm install -g --allow-scripts=<包名列表>` 后重装。
|
|
41
49
|
>
|
|
42
|
-
> 版本对齐:dsh-code 面向 dsh `0.1.5-rc.
|
|
50
|
+
> 版本对齐:dsh-code 面向 dsh `0.1.5-rc.2` 构建,全部 Harness 依赖均精确锁定为 `0.1.5-rc.2`。本地 `link:` 挂载请先 `git pull && pnpm install && pnpm build`,不要对开发挂载跑更新器。
|
|
43
51
|
>
|
|
44
52
|
> 升级说明:旧会话与旧参数中记录的 `code` 预设会自动映射到上游已改名的 `ptc`,无需手动迁移。会话日志读取端随上游升级到格式 v3:旧格式日志在读取时由内核自动迁移,磁盘上的原始文件保持不变。
|
|
53
|
+
>
|
|
54
|
+
> 从 GitHub tarball 装的版本可能领先 npm 一步(npm 上还没同步这个版本时)。更新器只认 npm,这种情况会写明「新于 npm,不降级」而不是「已是最新」;等 npm 同步后再用 `/update`。
|
|
45
55
|
|
|
46
56
|
### 2. 启动指令
|
|
47
57
|
|
|
@@ -57,7 +67,7 @@ dsh-code
|
|
|
57
67
|
|
|
58
68
|
> DeepSeek Harness 目前仍处于 developer preview,可能出现破坏兼容性的变化;DSH-Code 会持续跟随其插件接口演进。
|
|
59
69
|
|
|
60
|
-
|
|
70
|
+
安装、原生模块和插件加载问题,请先运行 `deepseek doctor` 自检,更多排查见[常见问题与排障](docs/problems.md)。
|
|
61
71
|
|
|
62
72
|
## 三、核心功能与使用方式
|
|
63
73
|
|
|
@@ -68,9 +78,10 @@ DSH-Code 的重点是让 DSH 的 Agent、模型、工具和持久会话可以直
|
|
|
68
78
|
- 使用 `/new` 新建会话,或通过 `/resume`、`--continue` 恢复已有会话
|
|
69
79
|
- 使用 `/fork` 从历史节点创建新的工作分支,同时保留原会话
|
|
70
80
|
- 按当前目录、更新时间和会话范围搜索历史记录
|
|
71
|
-
- 使用 Up/Down
|
|
72
|
-
- 支持持久标题、Markdown 导出、上下文占用、token、缓存、TTFT
|
|
73
|
-
-
|
|
81
|
+
- 使用 Up/Down 召回输入历史(含 / 指令),或通过 `/history` 搜索过去的提示词与指令
|
|
82
|
+
- 支持持久标题、Markdown 导出、上下文占用、token、缓存、TTFT 和耗时统计;`/usage` 面板按上游 token 统计给出四个互不重叠的桶、按模型合并的总量和按回合明细
|
|
83
|
+
- 状态栏的 `入` 只算未命中缓存的输入,`缓存` 同时给出缓存读取量与命中率——两者相加才是真正计费的输入侧
|
|
84
|
+
- 恢复会话时同步恢复该会话使用的 Agent Preset、模型选择和子代理列表;欢迎页同时显示 dsh 与 dsh-code 版本
|
|
74
85
|
|
|
75
86
|
<p align="center"><img src="docs/pictures/dsh-3.png" width="95%" alt="可搜索的会话恢复选择器"></p>
|
|
76
87
|
|
|
@@ -112,12 +123,35 @@ DSH-Code 的重点是让 DSH 的 Agent、模型、工具和持久会话可以直
|
|
|
112
123
|
|
|
113
124
|
- 使用 `@` 引用工作区文件或已有会话;选择 PNG、JPEG、WebP、GIF 时会自动作为真实图片附件
|
|
114
125
|
- 支持启动 prompt、多个 `--image` 参数,以及从终端拖入或粘贴附件:图片按图片附件发送,其他文件按原样文件附件发送(单文件 8 MiB、每条消息 8 个以内)
|
|
115
|
-
- 使用 `/diff` 按文件检查改动,使用 `/review`
|
|
126
|
+
- 使用 `/diff` 按文件检查改动,使用 `/review` 发起只读代码审查(弹出范围选择,diff 整行红绿着色)
|
|
127
|
+
- `run_code` 会列出正在执行的子工具调用;workflow 会列出各成员直到结束
|
|
116
128
|
- 使用 `/copy` 复制最近一条完整回复,使用 Ctrl+O 查看完整历史和工具详情
|
|
117
129
|
- 支持工具审批、结构化提问、plan review、多选和自定义答案
|
|
118
130
|
- 使用权限 Preset 和 sandbox 控制 Agent 可以执行的操作;任务运行中仍可补充指令或中断
|
|
119
131
|
|
|
120
|
-
### 5.
|
|
132
|
+
### 5. 排队与插队
|
|
133
|
+
|
|
134
|
+
回合运行中你还可以继续输入消息,有两种发送方式:
|
|
135
|
+
|
|
136
|
+
- **排队**:等这一回合全部结束后,作为新的一回合处理。适合「做完这件再做下一件」。
|
|
137
|
+
- **插队**:在这一回合的下一个步骤开始之前交给模型,和当前这次请求一起处理。适合发现它做偏了、要立刻纠正或补充要求。
|
|
138
|
+
|
|
139
|
+
两者的区别是**模型什么时候能看到它**:排队是等它做完再说,插队是在它下一步动手之前就告诉它。
|
|
140
|
+
|
|
141
|
+
怎么用:
|
|
142
|
+
|
|
143
|
+
- 输入框空着按 `Tab` 在两种方式之间切换。提示符(`❯` / `↳`)、空输入框的提示文字和切换时的通知都会写明当前是哪一种;输入框有内容时 `Tab` 仍是补全。
|
|
144
|
+
- `/queue` 打开队列面板:对某条按回车即可改为插队,按 `e` 改文字(附件原样保留),按 `d` 删除。
|
|
145
|
+
- 输入框空着按 `Delete`,直接取消最新一条排队消息。
|
|
146
|
+
- 按 `Esc` 取消当前回合时,**排队的消息保留并接着发出**,插队的消息随这一回合一起丢掉。
|
|
147
|
+
|
|
148
|
+
会话区里每条提问都是一整行带底色的消息,颜色说明它是怎么发出的:普通消息用主题的亮品牌色,排队用警示色,插队用主题的第三种强调色,并分别带「排队」「插队」字样。底色由主题色算出,所以换主题或重新随机 rainbow 之后会跟着变。
|
|
149
|
+
|
|
150
|
+
只有**提交那一刻已经有回合在运行**,才记为排队或插队;空闲时提交的消息(哪怕当时选的是插队)都算普通消息,因为它本来就会立刻开始新的一回合。
|
|
151
|
+
|
|
152
|
+
队列的具体行为、上游两条队列的取出顺序和各主题的色值见 [排队与插队](docs/message-queue.md)。
|
|
153
|
+
|
|
154
|
+
### 6. 命令与快捷键
|
|
121
155
|
|
|
122
156
|
启动 TUI:
|
|
123
157
|
|
|
@@ -137,12 +171,13 @@ dsh --profile cli --session my-id # 使用指定 id 新建会话
|
|
|
137
171
|
| --- | --- |
|
|
138
172
|
| `/new [preset]` | 创建新会话,可同时指定 Agent Preset |
|
|
139
173
|
| `/resume [id\|前缀]` | 搜索或恢复已有会话 |
|
|
174
|
+
| `/search [query]` | 跨会话全文检索(复用 session-query 引擎,回车恢复命中的会话) |
|
|
140
175
|
| `/resume cancel` | 取消正在等待的会话切换 |
|
|
141
176
|
| `/fork [event-seq]` | 从最近完成的 turn 或指定事件位置创建分支会话 |
|
|
142
177
|
| `/delete [id\|前缀]` | 删除指定会话及其 subagent 会话 |
|
|
143
178
|
| `/title <text>` | 修改当前会话标题 |
|
|
144
179
|
| `/export [path]` | 将当前会话导出为 Markdown |
|
|
145
|
-
| `/history` |
|
|
180
|
+
| `/history` | 搜索并复用过去提交的提示词与 / 指令 |
|
|
146
181
|
| `/clear` | 清空当前终端显示,不删除持久会话 |
|
|
147
182
|
|
|
148
183
|
#### Agent、模型与权限
|
|
@@ -160,10 +195,13 @@ dsh --profile cli --session my-id # 使用指定 id 新建会话
|
|
|
160
195
|
| 命令 | 用途 |
|
|
161
196
|
| --- | --- |
|
|
162
197
|
| `/diff [--staged\|ref]` | 按文件查看工作区、暂存区或指定 ref 的 Git diff |
|
|
163
|
-
| `/review [
|
|
198
|
+
| `/review [说明]` | 直接回车弹出候选面板(未提交改动 / 选择分支 / 选择提交 / 自定义关注点);带任意文字则作为审查说明搭配未提交 diff(如 `/review 使用中文`)。diff 直接附在当前会话的审查提示里,自动切换只读权限,结论按 P0–P3 分级带文件行号 |
|
|
164
199
|
| `/todos` | 查看当前会话的完整 todo 列表 |
|
|
200
|
+
| `/queue` | 查看等待下一回合的消息:按回车改为插队、`e` 改文字、`d` 删除;`↑↓`/`PageUp`/`PageDown`/`g`/`G` 移动 |
|
|
201
|
+
| `/usage` | 查看本会话的 token 用量:四个互不重叠的桶(未命中输入、缓存写入、缓存读取、输出)、按模型合并的总量、以及按回合的明细 |
|
|
165
202
|
| `/agents` | 查看当前会话创建的 subagent 会话 |
|
|
166
203
|
| `/jobs` | 查看后台任务及其运行状态 |
|
|
204
|
+
| `/schedule` | 查看活动提醒(模型经 schedule 工具创建/取消,面板只读展示,逾期优先) |
|
|
167
205
|
| `/copy` | 复制最近一条完整助手回复 |
|
|
168
206
|
|
|
169
207
|
#### 扩展、显示与退出
|
|
@@ -171,9 +209,12 @@ dsh --profile cli --session my-id # 使用指定 id 新建会话
|
|
|
171
209
|
| 命令 | 用途 |
|
|
172
210
|
| --- | --- |
|
|
173
211
|
| `/plugin [query]` | 查看已加载扩展及其状态 |
|
|
212
|
+
| `/update` | 查询 npm 上的新版本并确认升级。从 GitHub tarball 装的版本可能领先 npm,此时会写明不降级 |
|
|
174
213
|
| `/statusline` | 选择状态栏显示的项目 |
|
|
175
214
|
| `/vscode-keys` | 将 Ctrl+R 放行进 VS Code 系终端(幂等写入用户级 keybindings.json) |
|
|
176
|
-
| `/theme` |
|
|
215
|
+
| `/theme` | 切换配色:`dark` / `light` / `prismatic` / `rainbow` / `auto` |
|
|
216
|
+
| `/rainbow [seed]` | 重掷或指定 rainbow 主题的配色种子;无参数换一颗并切到 rainbow |
|
|
217
|
+
| `/language [en\|zh]` | 切换界面语言,默认英文;模型提示词和状态栏事实数据仍为英文 |
|
|
177
218
|
| `/animation` | 开关计时动画(shimmer/追逐/闪烁/切换波浪),`/animation [on\|off]` |
|
|
178
219
|
| `/help` | 查看快捷键、内置命令、Harness 命令和用户技能 |
|
|
179
220
|
| `/quit` | 退出 DSH-Code |
|
|
@@ -183,17 +224,18 @@ dsh --profile cli --session my-id # 使用指定 id 新建会话
|
|
|
183
224
|
| 操作 | 用途 |
|
|
184
225
|
| --- | --- |
|
|
185
226
|
| `Enter` | 提交当前输入 |
|
|
227
|
+
| `Ctrl+J` / `Alt+Enter` | 在输入中插入换行(增强键盘协议下 `Shift+Enter` / `Ctrl+Enter` 同效) |
|
|
186
228
|
| `Up` / `Down` | 召回上一条或下一条输入记录 |
|
|
187
|
-
| `Tab` | 补全命令、技能或 `@`
|
|
229
|
+
| `Tab` | 补全命令、技能或 `@` 引用;输入框为空时切换下一条消息是排队还是插队 |
|
|
188
230
|
| `@` | 引用工作区文件或已有会话;图片文件自动作为附件发送 |
|
|
189
|
-
| `Ctrl+O` |
|
|
231
|
+
| `Ctrl+O` | 查看完整历史与工具详情,每条带种类标签(user prompt / reply / tool call 等) |
|
|
190
232
|
| `Ctrl/Alt+R` | 折叠或展开思考过程;VS Code 系终端先运行 /vscode-keys 放行 Ctrl+R |
|
|
191
|
-
| `Shift+Tab` |
|
|
192
|
-
| `Delete` |
|
|
233
|
+
| `Shift+Tab` | 循环权限 Preset,并在提供 `/plan` 时经过 plan 档 |
|
|
234
|
+
| `Delete` | 输入框为空时取消最新一条排队消息(插队不在队列里,要取消请按 `Esc` 结束回合) |
|
|
193
235
|
| `Ctrl+K` | 删除光标到行尾的内容 |
|
|
194
236
|
| `Ctrl+U` | 清空当前输入行 |
|
|
195
237
|
| `Ctrl+A` / `Ctrl+E` | 移动到当前行开头或结尾 |
|
|
196
|
-
| `Esc` |
|
|
238
|
+
| `Esc` | 关闭当前菜单或中断正在运行的回合;排队的消息保留并接着发出,插队的随回合丢掉 |
|
|
197
239
|
| `Ctrl+C` | 依次用于取消任务、清空输入或退出 |
|
|
198
240
|
| `Ctrl+D` | 退出 DSH-Code |
|
|
199
241
|
|
|
@@ -212,7 +254,56 @@ DSH-Code 读取 Harness 的实时注册表,不在本地维护另一套副本
|
|
|
212
254
|
|
|
213
255
|
`/plugin` 提供当前 Cordis loader 状态的只读视图。
|
|
214
256
|
|
|
215
|
-
### 2.
|
|
257
|
+
### 2. 内置扩展与可选官方插件
|
|
258
|
+
|
|
259
|
+
以下官方插件已随 DSH-Code 一起安装并在组合中默认启用:
|
|
260
|
+
|
|
261
|
+
- **会话检索**:模型获得 `session_search` / `session_event_search` / `session_trace` / `session_event_trace` / `session_event_read` 五个只读工具,可检索历史会话内容(首次搜索时才构建索引,按工作目录精确匹配授权;Node 22 上首次搜索会当场打印一次 `node:sqlite` 实验性警告,属正常现象)。
|
|
262
|
+
- **定时提醒**:`schedule` 提供跨重启的持久提醒(`schedule_create` / `schedule_list` / `schedule_delete` 工具创建),`/schedule` 面板只读展示、逾期条目置顶标红;`time-context` 为模型注入时钟读数(30 秒节流)。
|
|
263
|
+
- **提醒的时钟读数**:`time-context` 为模型注入当前时间(30 秒节流),「下午五点提醒我」这类表述因此可用。
|
|
264
|
+
|
|
265
|
+
以下官方插件已安装但需按需启用(在用户层 `~/.dsh/profiles/cli/cordis.patch.yml` 追加行,或按说明安装):
|
|
266
|
+
|
|
267
|
+
- **MCP 服务器**(`@deepseek-ai/dsh-mcp-client`,每个服务器一行,工具注册为 `mcp__<server>__<tool>`):
|
|
268
|
+
|
|
269
|
+
```yaml
|
|
270
|
+
- insert:
|
|
271
|
+
- id: mcp-memory
|
|
272
|
+
name: '@deepseek-ai/dsh-mcp-client'
|
|
273
|
+
config:
|
|
274
|
+
transport: stdio
|
|
275
|
+
serverName: memory
|
|
276
|
+
command: mcp-server-memory
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
(HTTP 传输改用 `transport: streamable-http` + `url`;服务器不可达时安全降级为重连循环,不影响启动。)
|
|
280
|
+
- **Claude Code / Codex hooks 桥**(`@deepseek-ai/dsh-hooks-claude-code` / `-codex`):在拦截缝上运行既有 hooks 配置;hooks 文件缺失时静默不生效:
|
|
281
|
+
|
|
282
|
+
```yaml
|
|
283
|
+
- insert:
|
|
284
|
+
- id: hooks-claude
|
|
285
|
+
name: '@deepseek-ai/dsh-hooks-claude-code'
|
|
286
|
+
config:
|
|
287
|
+
configPath: C:/Users/you/.claude/hooks.json
|
|
288
|
+
```
|
|
289
|
+
- **LSP 导航**:组合里预置了 `lsp` / `lsp-stdio` / `tool-lsp` 三行(禁用状态——语言服务器二进制在挂载期解析,缺失会让整个组合启动失败)。这三个包宿主 CLI 未捆绑:先装入 profile(`dsh plugin --profile cli add @deepseek-ai/dsh-lsp @deepseek-ai/dsh-lsp-stdio @deepseek-ai/dsh-tool-lsp`),再在用户层将三行 `disabled: false` 并为 `lsp-stdio` 配置 `servers`(扩展名到语言再到服务器命令),模型即获得 `lsp` 工具(goToDefinition / findReferences / goToImplementation / hover)。
|
|
290
|
+
- **持久终端**:PTY 服务与平台后端(Windows 走 pwsh 方言、POSIX 走 bash)已默认挂载,但六个模型工具 `terminal_open` / `terminal_send` / `terminal_read` / `terminal_signal` / `terminal_close` / `terminal_list` 出厂禁用——启用等于向所有会话放开 shell 能力,与 preset 把关原则一致,由部署显式决定。`@deepseek-ai/dsh-tool-terminal` 同样不在宿主捆绑内:先 `dsh plugin --profile cli add @deepseek-ai/dsh-tool-terminal`,再在用户层开启:
|
|
291
|
+
```yaml
|
|
292
|
+
- id: tool-terminal
|
|
293
|
+
disabled: false
|
|
294
|
+
```
|
|
295
|
+
(后台发送会出现在 /jobs 面板。)
|
|
296
|
+
- **tmux 面板上下文**(`@deepseek-ai/dsh-tmux-context`):在 tmux 内运行时把当前面板内容注入模型上下文(`config: { refreshIntervalMs: 60000 }`);不在 tmux 内时逐步为无害空操作:
|
|
297
|
+
```yaml
|
|
298
|
+
- insert:
|
|
299
|
+
- id: tmux-context
|
|
300
|
+
name: '@deepseek-ai/dsh-tmux-context'
|
|
301
|
+
config:
|
|
302
|
+
refreshIntervalMs: 60000
|
|
303
|
+
```
|
|
304
|
+
- **外部 CLI 委托**:`dsh plugin --profile cli add @deepseek-ai/dsh-subagent-claude-code`(或 `-codex`)安装休眠 provider,再按上游契约复制预设并启用 `tool-subagent-claude-code` / `tool-subagent-codex` 行,模型即可把任务委托给 claude / codex CLI。
|
|
305
|
+
|
|
306
|
+
### 3. 会话级 Agent Preset
|
|
216
307
|
|
|
217
308
|
Host 持有共享基础设施——注册表、持久化、会话查询、权限和 sandbox 策略;每个会话则获得一个隔离的 Agent scope,并由 **Agent Preset** 进行组合:
|
|
218
309
|
|
|
@@ -224,9 +315,9 @@ Host 持有共享基础设施——注册表、持久化、会话查询、权限
|
|
|
224
315
|
|
|
225
316
|
在第一次 turn 之前使用 `/mode`,或通过 `--mode <preset>` 直接启动。选中的 preset 会写入会话,并在恢复时还原。
|
|
226
317
|
|
|
227
|
-
###
|
|
318
|
+
### 4. 会话记录与恢复
|
|
228
319
|
|
|
229
|
-
提示词、工具调用与结果、模型选择、plan 状态、权限、标题和 preset
|
|
320
|
+
提示词、工具调用与结果、模型选择、plan 状态、权限、标题和 preset 选择都从持久的 Session 事件记录推导而来;会话恢复、导出、历史检查、上下文统计和终端回放使用同一份记录。实时流式文本经进程内流帧呈现,落盘日志只保留装配完成的回复(内嵌计时流),两者在回放时得到同一视图。
|
|
230
321
|
|
|
231
322
|
React state 只保存输入草稿、光标、当前面板、选中项和滚动位置等临时界面状态。
|
|
232
323
|
|
|
@@ -237,19 +328,25 @@ dsh profile
|
|
|
237
328
|
├─ Agent 会话 B + preset minimal
|
|
238
329
|
└─ DSH-Code TUI
|
|
239
330
|
持久事件 → 纯投影 → 只追加的历史转录
|
|
240
|
-
└→
|
|
331
|
+
└→ 受限面板 → 输入框 → 状态栏
|
|
241
332
|
```
|
|
242
333
|
|
|
243
334
|
## 五、开发
|
|
244
335
|
|
|
245
336
|
```sh
|
|
246
337
|
pnpm install
|
|
338
|
+
pnpm lint # ESLint(类型敏感):src、tests、scripts、根配置
|
|
339
|
+
pnpm typecheck # 构建项目的类型检查(src)
|
|
340
|
+
pnpm typecheck:tests # 测试套件与 scripts 的类型检查
|
|
247
341
|
pnpm test
|
|
248
|
-
pnpm
|
|
342
|
+
pnpm test:coverage # 覆盖率报告(只报告,不设门槛)
|
|
249
343
|
pnpm build
|
|
344
|
+
pnpm verify # lint + 两个类型检查 + 测试,一次跑完
|
|
250
345
|
pnpm run gen:whale # 从 vendored Logo 路径重新生成 src/whale-glyph.ts
|
|
251
346
|
```
|
|
252
347
|
|
|
348
|
+
测试文件由 `tsconfig.test.json` 纳入类型检查:spec 里的假实现若与真实接口脱节,会在 `pnpm typecheck:tests` 直接报错,而不是留到运行时。
|
|
349
|
+
|
|
253
350
|
鲸鱼字形由 `scripts/fish-logo.ts` 中 vendored 的 DeepSeek FishLogo 几何数据生成(来源:DeepSeek Harness,MIT)。
|
|
254
351
|
|
|
255
352
|
### 1. 源码开发安装
|