dsh-code 1.0.5 → 1.0.7

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 (47) hide show
  1. package/README.en.md +338 -286
  2. package/README.md +68 -16
  3. package/bin/deepseek.mjs +204 -4
  4. package/cordis.patch.yml +105 -7
  5. package/lib/index.mjs +2148 -439
  6. package/lib/session-query.mjs +149 -0
  7. package/lib/types/app.d.ts +34 -8
  8. package/lib/types/attachments.d.ts +36 -4
  9. package/lib/types/index.d.ts +38 -2
  10. package/lib/types/kernel-panels.d.ts +23 -0
  11. package/lib/types/provider-settings.d.ts +6 -11
  12. package/lib/types/render/animations.d.ts +74 -7
  13. package/lib/types/render/editor.d.ts +4 -3
  14. package/lib/types/render/export.d.ts +0 -6
  15. package/lib/types/render/fuzzy.d.ts +21 -0
  16. package/lib/types/render/ime-cursor.d.ts +60 -0
  17. package/lib/types/render/projection.d.ts +80 -4
  18. package/lib/types/render/status.d.ts +1 -1
  19. package/lib/types/session-directory.d.ts +48 -13
  20. package/lib/types/session-query.d.ts +92 -0
  21. package/lib/types/store.d.ts +3 -0
  22. package/lib/types/terminal-title.d.ts +58 -0
  23. package/lib/types/update-panel.d.ts +49 -0
  24. package/lib/types/update.d.ts +66 -0
  25. package/package.json +307 -162
  26. package/src/app.ts +730 -266
  27. package/src/attachments.ts +110 -11
  28. package/src/commands.ts +35 -5
  29. package/src/index.ts +1986 -1779
  30. package/src/internals.ts +66 -40
  31. package/src/kernel-panels.ts +89 -3
  32. package/src/provider-settings.ts +12 -12
  33. package/src/render/animations.ts +606 -403
  34. package/src/render/editor.ts +5 -4
  35. package/src/render/export.ts +13 -3
  36. package/src/render/fuzzy.ts +83 -0
  37. package/src/render/ime-cursor.ts +147 -0
  38. package/src/render/projection.ts +1974 -1621
  39. package/src/render/status.ts +18 -4
  40. package/src/session-directory.ts +94 -16
  41. package/src/session-query.ts +235 -0
  42. package/src/skills.ts +23 -9
  43. package/src/store.ts +39 -1
  44. package/src/subagents.ts +26 -3
  45. package/src/terminal-title.ts +173 -0
  46. package/src/update-panel.ts +246 -0
  47. package/src/update.ts +110 -0
package/README.en.md CHANGED
@@ -1,286 +1,338 @@
1
- # DSH-Code
2
-
3
- English | [中文](README.md)
4
-
5
- <p align="center"><img src="docs/pictures/dsh-1.png" width="95%" alt="DSH-Code welcome screen and model status"></p>
6
-
7
- <p align="center"><img alt="Typing SVG" src="https://readme-typing-svg.herokuapp.com?font=JetBrains+Mono&amp;weight=500&amp;size=22&amp;duration=4000&amp;pause=700&amp;color=4176E6&amp;center=true&amp;vCenter=true&amp;width=680&amp;lines=DeepSeek+Harness+Code;Terminal+Coding+Interface+for+the+DSH+Core"></p>
8
- <p align="center">
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&amp;logo=deepseek&amp;logoColor=white&amp;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.1--rc.2-4176E6?style=for-the-badge&amp;logo=deepseek&amp;logoColor=white&amp;labelColor=1c1917"></a>
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&amp;style=for-the-badge&amp;logo=github&amp;logoColor=white&amp;color=4176E6&amp;labelColor=1c1917"></a>
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&amp;style=for-the-badge&amp;logo=npm&amp;color=cb3837&amp;labelColor=1c1917"></a>
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&amp;style=for-the-badge&amp;logo=opensourceinitiative&amp;color=4176E6&amp;labelColor=1c1917"></a>
14
- </p>
15
-
16
- ---
17
-
18
- ## 1. Project overview
19
-
20
- **DSH-Code is a terminal coding interface for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (`dsh`).** It is composed as an out-of-tree bundle on top of the official `@deepseek-ai/dsh-base` and uses the same Agent, Session, tool, command, skill, permission, sandbox, context-compaction, and plugin services as the Harness Web UI.
21
-
22
- DeepSeek Harness registers models, tools, storage, policies, and interfaces as plugins through Cordis. Durable session events record the information required to restore conversations and runtime state. DSH-Code preserves that architecture while adding a terminal workflow suited to coding tasks. The interface follows terminal conventions familiar to developers, while runtime behavior remains governed by DSH services and configuration.
23
-
24
- ## 2. Quick start
25
-
26
- Requires Node `^22.19 || >=24` and the preview `dsh` CLI (current release line: `@deepseek-ai/dsh@0.1.1-rc.2`). You can still enter the TUI, browse sessions, and use non-model features without configuring a model; press `a` in `/model` to manage API keys, OAuth, and device-code sign-in.
27
-
28
- ### 1. Install and update
29
-
30
- Use the same commands for the initial installation and subsequent updates:
31
-
32
- ```sh
33
- npm install -g @deepseek-ai/dsh@0.1.1-rc.2 dsh-code@1.0.3
34
- npm install -g pnpm
35
- dsh plugin --profile cli add dsh-code@1.0.3
36
- ```
37
-
38
- > Note: pnpm ignores packages published less than 24 hours ago, so use the exact version `dsh-code@1.0.3` on release day; the version may be omitted after 24 hours. npm installation is not affected.
39
- >
40
- > Version alignment: dsh-code 1.0.3 targets dsh `0.1.1-rc.2`, with every Harness dependency pinned exactly to `0.1.1-rc.2`. Keep the global dsh CLI and dsh-code aligned instead of mixing release candidates. rc.2 removes the old DeepSeek setting `maxRequestImageBytes`.
41
-
42
- ### 2. Launch commands
43
-
44
- Available launch commands:
45
-
46
- ```sh
47
- dsh --profile cli
48
- deepseek
49
- dsh-code
50
- ```
51
-
52
- `dsh --profile cli`, `deepseek`, and `dsh-code` are equivalent launch commands. `deepseek` and `dsh-code` are global aliases for `dsh --profile cli`, and all additional arguments are forwarded unchanged, for example `deepseek --resume abc123`.
53
-
54
- > 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
-
56
- For installation, native-module, and plugin-loading issues, see [Troubleshooting](docs/problems.md).
57
-
58
- ## 3. Core features and usage
59
-
60
- DSH-Code brings DSH Agents, models, tools, and durable sessions directly into the terminal, covering the complete workflow from writing code to reviewing changes.
61
-
62
- ### 1. Session management
63
-
64
- - Create sessions with `/new`, or restore existing sessions with `/resume` and `--continue`
65
- - Create a new work branch from a historical point with `/fork` while preserving the original session
66
- - 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
- - Restore the session's Agent Preset and model selection when resuming it
70
-
71
- <p align="center"><img src="docs/pictures/dsh-3.png" width="95%" alt="Searchable session resume picker"></p>
72
-
73
- <p align="center"><img src="docs/pictures/dsh-4.png" width="95%" alt="Searchable prompt-history picker"></p>
74
-
75
- ### 2. Agents, models, and extensions
76
-
77
- - Select an independent Agent Preset for each session to compose tools, prompt sections, skills, context compaction, plan mode, and subagent capabilities
78
- - Use `/mode` to select `standard`, `code`, `minimal`, `cordis`, or a user-defined Preset
79
- - Use `/model` to switch models and manage providers, API keys, OAuth/device-code sign-in, endpoints, available models, and context windows
80
- - In the `/model` provider list, Enter manages a manual API key, `l` starts sign-in, and `o` logs out after confirmation
81
- - Automatically load commands and skills available in DSH; use `/help` to find them and `/plugin` to inspect extension status
82
- - Use plans, goals, todos, permissions, sandboxes, subagents, and additional instructions while a task is running
83
-
84
- <p align="center"><img src="docs/pictures/dsh-2.png" width="95%" alt="Per-session Agent Preset picker"></p>
85
-
86
- ### 3. Model-switch animations
87
-
88
- The composer plays Wave, Aurora, or Pulse when the model or reasoning effort changes under the following conditions:
89
-
90
- | Scenario | Trigger | Animation text | Effect tier |
91
- | --- | --- | --- | --- |
92
- | Official DeepSeek model | Switch to the model, or change its reasoning effort | `deepseek` | Flash uses the single-band tier; other DeepSeek models use the multi-band tier |
93
- | Other models | After changing the model or reasoning effort, the effective effort is strictly above `high` | `Into the Unknown` | Uses the same multi-band tier as non-Flash DeepSeek models |
94
-
95
- Levels above `high` include `xhigh`, `x-high`, `very-high`, `max`, `maximum`, and `ultra`. For non-DeepSeek models, `high`, `medium`, `low`, and `off` do not trigger an animation.
96
-
97
- | Style | Flash | Other DeepSeek / `Into the Unknown` |
98
- | --- | --- | --- |
99
- | Wave | One blue crest sweeps from left to right, about 1.2 seconds | Two offset blue crests sweep across in sequence with trailing `· ✦ ✧` sparkles, about 1.5 seconds |
100
- | Aurora | Two blue light bands drift across one another, about 1.5 seconds | Three differently hued light bands drift across one another, about 1.8 seconds |
101
- | Pulse | One ring expands outward from the center of the composer, about 1.1 seconds | Two rings expand outward in sequence, about 1.45 seconds |
102
-
103
- ### 4. Coding workflow
104
-
105
- - Use `@` to reference workspace files or existing sessions; selecting PNG, JPEG, WebP, or GIF files attaches the real image automatically
106
- - 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`
108
- - Copy the latest complete response with `/copy`, and inspect full history and tool details with Ctrl+O
109
- - Handle tool approvals, structured questions, plan reviews, multiple selections, and custom answers
110
- - Control what the Agent may do with permission Presets and sandboxes; add instructions or interrupt while a task is running
111
-
112
- ### 5. Commands and key bindings
113
-
114
- Start the TUI:
115
-
116
- ```sh
117
- dsh --profile cli # create a standard session
118
- dsh --profile cli --mode code # start with the specified Agent Preset
119
- dsh --profile cli --continue # resume the latest session for the current directory
120
- dsh --profile cli --resume abc123 # resume by id or unique prefix
121
- dsh --profile cli --session my-id # create a session with an explicit id
122
- ```
123
-
124
- The following built-in commands are available inside the TUI. Additional Harness commands and user skills depend on the active profile and installed packages; use `/help` for the complete current list.
125
-
126
- #### Sessions and history
127
-
128
- | Command | Purpose |
129
- | --- | --- |
130
- | `/new [preset]` | Create a session, optionally selecting an Agent Preset |
131
- | `/resume [id\|prefix]` | Search for or restore an existing session |
132
- | `/resume cancel` | Cancel a pending session switch |
133
- | `/fork [event-seq]` | Create a session branch from the latest completed turn or a specified event position |
134
- | `/delete [id\|prefix]` | Delete a session and its subagent sessions |
135
- | `/title <text>` | Change the current session title |
136
- | `/export [path]` | Export the current session as Markdown |
137
- | `/history` | Search and reuse previously submitted prompts |
138
- | `/clear` | Clear the current terminal display without deleting the durable session |
139
-
140
- #### Agents, models, and permissions
141
-
142
- | Command | Purpose |
143
- | --- | --- |
144
- | `/mode [preset]` | Inspect or select the current session's Agent Preset |
145
- | `/model` | Switch models and manage providers, API keys, browser sign-in, endpoints, and available models |
146
- | `/effort` | Adjust the current model's reasoning effort |
147
- | `/permission [preset]` | Inspect or switch the permission Preset |
148
- | `/subagent` | Select the model used when a subagent performs a task |
149
-
150
- #### Coding, tasks, and background work
151
-
152
- | Command | Purpose |
153
- | --- | --- |
154
- | `/diff [--staged\|ref]` | Inspect the working-tree, staged, or specified-ref Git diff by file |
155
- | `/review [--staged\|ref]` | Review Git changes with read-only permissions |
156
- | `/todos` | View the complete todo list for the current session |
157
- | `/agents` | View subagent sessions created by the current session |
158
- | `/jobs` | View background jobs and their runtime status |
159
- | `/copy` | Copy the latest complete assistant response |
160
-
161
- #### Extensions, display, and exit
162
-
163
- | Command | Purpose |
164
- | --- | --- |
165
- | `/plugin [query]` | Inspect loaded extensions and their status |
166
- | `/statusline` | Select the items displayed in the status bar |
167
- | `/vscode-keys` | Pass Ctrl+R through VS Code-family terminals (idempotent user-level keybindings.json write) |
168
- | `/theme` | Switch the terminal color theme |
169
- | `/help` | View key bindings, built-in commands, Harness commands, and user skills |
170
- | `/quit` | Exit DSH-Code |
171
-
172
- #### Input and key bindings
173
-
174
- | Action | Purpose |
175
- | --- | --- |
176
- | `Enter` | Submit the current input |
177
- | `Up` / `Down` | Recall the previous or next input-history entry |
178
- | `Tab` | Complete commands, skills, or `@` references |
179
- | `@` | Reference workspace files or existing sessions; image files are sent as attachments |
180
- | `Ctrl+O` | Inspect full history and tool details |
181
- | `Ctrl/Alt+R` | Fold or expand model reasoning; run /vscode-keys first in VS Code-family terminals to pass Ctrl+R through |
182
- | `Shift+Tab` | Cycle through permission Presets |
183
- | `Delete` | Cancel the newest queued message when the composer is empty |
184
- | `Ctrl+K` | Delete from the cursor to the end of the line |
185
- | `Ctrl+U` | Clear the current input line |
186
- | `Ctrl+A` / `Ctrl+E` | Move to the beginning or end of the current line |
187
- | `Esc` | Close the current menu or interrupt the running turn |
188
- | `Ctrl+C` | Cancel a task, clear the input, or exit, depending on the current state |
189
- | `Ctrl+D` | Exit DSH-Code |
190
-
191
- #### Status indicators
192
-
193
- | Indicator | Trigger |
194
- | --- | --- |
195
- | `✻ Deep diving...` | The turn is running while nothing is streaming (waiting for the first token, gaps during tool runs); an elapsed clock appears after 15 seconds |
196
- | `✻ Thinking…` | Model reasoning is streaming; collapsed into the shimmer marker by default, expand with `Ctrl/Alt+R` |
197
-
198
- ## 4. How DSH-Code integrates with DSH
199
-
200
- ### 1. Runtime composition
201
-
202
- DSH-Code reads the live Harness registries instead of maintaining a separate local copy. Model adapters, tool providers, skill sources, commands, permission policies, persistence backends, sandboxes, and subagent providers can all be added or replaced through DSH composition.
203
-
204
- `/plugin` provides a read-only view of the current Cordis loader state.
205
-
206
- ### 2. Session-scoped Agent Presets
207
-
208
- 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**:
209
-
210
- - `standard` — a full-featured general-purpose coding Agent
211
- - `code` multi-operation workflows designed for Code Mode / PTC
212
- - `minimal` — only a persistent shell and `str_replace_editor`
213
- - `cordis` — the full Agent plus runtime inspection and Preset-authoring guidance
214
- - user Presets custom tools, prompt sections, skills, context compaction, plan mode, and subagent behavior
215
-
216
- 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.
217
-
218
- ### 3. Session history and recovery
219
-
220
- 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.
221
-
222
- React state stores only temporary interface details such as the input draft, cursor, active panel, selection, and scroll position.
223
-
224
- ```text
225
- dsh profile
226
- └─ Host plane: registries · persistence · queries · permissions · sandbox
227
- ├─ Agent session A + preset code
228
- ├─ Agent session B + preset minimal
229
- └─ DSH-Code TUI
230
- durable events → pure projection → append-only transcript
231
- └→ bounded panels composer status bar
232
- ```
233
-
234
- ## 5. Development
235
-
236
- ```sh
237
- pnpm install
238
- pnpm test
239
- pnpm typecheck
240
- pnpm build
241
- pnpm run gen:whale # regenerate src/whale-glyph.ts from the vendored logo path
242
- ```
243
-
244
- The whale glyph is generated from the DeepSeek FishLogo geometry vendored in `scripts/fish-logo.ts` (source: DeepSeek Harness, MIT).
245
-
246
- ### 1. Source development installation
247
-
248
- For a local checkout:
249
-
250
- ```sh
251
- dsh plugin --profile cli add file:C:/path/to/dsh-code
252
- ```
253
-
254
- GitHub installation is available for source development:
255
-
256
- ```sh
257
- dsh plugin --profile cli add github:unlinearity/dsh-code
258
- ```
259
-
260
- The Git package builds during installation. If pnpm asks for an `allowBuilds` entry, copy the complete entry it prints into `~/.dsh/profiles/cli/pnpm-workspace.yaml`, then run the command again. The key contains the Git URL and commit, so it cannot be replaced with only `dsh-code`.
261
-
262
- ### 2. Uninstall
263
-
264
- ```sh
265
- dsh plugin --profile cli remove dsh-code # unmount the plugin from the cli profile
266
- npm uninstall -g dsh-code # remove the global package and the deepseek / dsh-code commands
267
- ```
268
-
269
- Both commands are required for a complete uninstall. The first only removes the profile mount, so the `deepseek` command still exists and reports "the cli profile does not mount dsh-code yet". The second removes the global npm package and its launch aliases. Uninstalling does not affect `@deepseek-ai/dsh` itself or any persisted session data.
270
-
271
- ### 3. References
272
-
273
- - Runtime services, events, plugin scopes, and the persistence model follow **DeepSeek Harness**.
274
- - Session navigation, overlay sizing, scrollback, bottom layout, and resize handling refer to **Codex CLI**.
275
- - Slash-command discovery, turn steering, reasoning folds, approvals, and question flows refer to **Claude Code**.
276
-
277
- DSH-Code is an independent MIT-licensed community project and is not affiliated with OpenAI or Anthropic.
278
-
279
- Communities:
280
-
281
- - [Linux DO](https://linux.do/): Learn AI at L Station!
282
- - [DeepSeek Harness](https://www.deepseek.com/harness): the official DSH website
283
-
284
- ## License
285
-
286
- [MIT](LICENSE). The vendored FishLogo geometry comes from DeepSeek Harness (MIT).
1
+ # DSH-Code
2
+
3
+ English | [中文](README.md)
4
+
5
+ <p align="center"><img src="docs/pictures/dsh-1.png" width="95%" alt="DSH-Code welcome screen and model status"></p>
6
+
7
+ <p align="center"><img alt="Typing SVG" src="https://readme-typing-svg.herokuapp.com?font=JetBrains+Mono&amp;weight=500&amp;size=22&amp;duration=4000&amp;pause=700&amp;color=4176E6&amp;center=true&amp;vCenter=true&amp;width=680&amp;lines=DeepSeek+Harness+Code;Terminal+Coding+Interface+for+the+DSH+Core"></p>
8
+ <p align="center">
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&amp;logo=deepseek&amp;logoColor=white&amp;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.1-4176E6?style=for-the-badge&amp;logo=deepseek&amp;logoColor=white&amp;labelColor=1c1917"></a>
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&amp;style=for-the-badge&amp;logo=github&amp;logoColor=white&amp;color=4176E6&amp;labelColor=1c1917"></a>
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&amp;style=for-the-badge&amp;logo=npm&amp;color=cb3837&amp;labelColor=1c1917"></a>
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&amp;style=for-the-badge&amp;logo=opensourceinitiative&amp;color=4176E6&amp;labelColor=1c1917"></a>
14
+ </p>
15
+
16
+ ---
17
+
18
+ ## 1. Project overview
19
+
20
+ **DSH-Code is a terminal coding interface for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (`dsh`).** It is composed as an out-of-tree bundle on top of the official `@deepseek-ai/dsh-base` and uses the same Agent, Session, tool, command, skill, permission, sandbox, context-compaction, and plugin services as the Harness Web UI.
21
+
22
+ DeepSeek Harness registers models, tools, storage, policies, and interfaces as plugins through Cordis. Durable session events record the information required to restore conversations and runtime state. DSH-Code preserves that architecture while adding a terminal workflow suited to coding tasks. The interface follows terminal conventions familiar to developers, while runtime behavior remains governed by DSH services and configuration.
23
+
24
+ ## 2. Quick start
25
+
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
+
28
+ ### 1. Install and update
29
+
30
+ Use the same commands for the initial installation and subsequent updates:
31
+
32
+ ```sh
33
+ npm install -g @deepseek-ai/dsh@0.1.5-rc.2 dsh-code@1.0.7
34
+ npm install -g pnpm
35
+ dsh plugin --profile cli add dsh-code@1.0.7
36
+ ```
37
+
38
+ > Note: pnpm ignores packages published less than 24 hours ago, so use the exact version `dsh-code@1.0.7` on release day; the version may be omitted after 24 hours. npm installation is not affected.
39
+ >
40
+ > Version alignment: dsh-code targets dsh `0.1.5-rc.2`, with every Harness dependency pinned exactly to `0.1.5-rc.2`. Keep the global dsh CLI and dsh-code aligned instead of mixing release candidates; the legacy `code` preset id maps to its renamed `ptc` automatically.
41
+
42
+ ### 2. Launch commands
43
+
44
+ Available launch commands:
45
+
46
+ ```sh
47
+ dsh --profile cli
48
+ deepseek
49
+ dsh-code
50
+ ```
51
+
52
+ `dsh --profile cli`, `deepseek`, and `dsh-code` are equivalent launch commands. `deepseek` and `dsh-code` are global aliases for `dsh --profile cli`, and all additional arguments are forwarded unchanged, for example `deepseek --resume abc123`.
53
+
54
+ > 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
+
56
+ For installation, native-module, and plugin-loading issues, see [Troubleshooting](docs/problems.md).
57
+
58
+ ## 3. Core features and usage
59
+
60
+ DSH-Code brings DSH Agents, models, tools, and durable sessions directly into the terminal, covering the complete workflow from writing code to reviewing changes.
61
+
62
+ ### 1. Session management
63
+
64
+ - Create sessions with `/new`, or restore existing sessions with `/resume` and `--continue`
65
+ - Create a new work branch from a historical point with `/fork` while preserving the original session
66
+ - Search history by current directory, update time, and session scope
67
+ - Recall input history with Up/Down (typed slash commands included), or search previous prompts and commands with `/history`
68
+ - Use persistent titles, Markdown export, context occupancy, token, cache, TTFT, and elapsed-time metrics
69
+ - Restore the session's Agent Preset and model selection when resuming it
70
+
71
+ <p align="center"><img src="docs/pictures/dsh-3.png" width="95%" alt="Searchable session resume picker"></p>
72
+
73
+ <p align="center"><img src="docs/pictures/dsh-4.png" width="95%" alt="Searchable prompt-history picker"></p>
74
+
75
+ ### 2. Agents, models, and extensions
76
+
77
+ - Select an independent Agent Preset for each session to compose tools, prompt sections, skills, context compaction, plan mode, and subagent capabilities
78
+ - Use `/mode` to select `standard`, `ptc`, `minimal`, `cordis`, or a user-defined Preset (the legacy `code` id maps to `ptc`)
79
+ - Use `/model` to switch models and manage providers, API keys, OAuth/device-code sign-in, endpoints, available models, and context windows
80
+ - In the `/model` provider list, Enter manages a manual API key, `l` starts sign-in, and `o` logs out after confirmation
81
+ - Automatically load commands and skills available in DSH; use `/help` to find them and `/plugin` to inspect extension status
82
+ - Use plans, goals, todos, permissions, sandboxes, subagents, and additional instructions while a task is running
83
+
84
+ <p align="center"><img src="docs/pictures/dsh-2.png" width="95%" alt="Per-session Agent Preset picker"></p>
85
+
86
+ ### 3. Model-switch animations
87
+
88
+ The composer plays Wave, Aurora, or Pulse when the model or reasoning effort changes under the following conditions:
89
+
90
+ | Scenario | Trigger | Animation text | Effect tier |
91
+ | --- | --- | --- | --- |
92
+ | Official DeepSeek model | Switch to the model, or change its reasoning effort | `deepseek` | Flash uses the single-band tier; other DeepSeek models use the multi-band tier |
93
+ | Other models | After changing the model or reasoning effort, the effective effort is strictly above `high` | `Into the Unknown` | Uses the same multi-band tier as non-Flash DeepSeek models |
94
+
95
+ Levels above `high` include `xhigh`, `x-high`, `very-high`, `max`, `maximum`, and `ultra`. For non-DeepSeek models, `high`, `medium`, `low`, and `off` do not trigger an animation.
96
+
97
+ | Style | Flash | Other DeepSeek / `Into the Unknown` |
98
+ | --- | --- | --- |
99
+ | Wave | One blue crest sweeps from left to right, about 1.2 seconds | Two offset blue crests sweep across in sequence with trailing `· ✦ ✧` sparkles, about 1.5 seconds |
100
+ | Aurora | Two blue light bands drift across one another, about 1.5 seconds | Three differently hued light bands drift across one another, about 1.8 seconds |
101
+ | Pulse | One ring expands outward from the center of the composer, about 1.1 seconds | Two rings expand outward in sequence, about 1.45 seconds |
102
+
103
+ ### 4. Coding workflow
104
+
105
+ - Use `@` to reference workspace files or existing sessions; selecting PNG, JPEG, WebP, or GIF files attaches the real image automatically
106
+ - 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`
108
+ - Copy the latest complete response with `/copy`, and inspect full history and tool details with Ctrl+O
109
+ - Handle tool approvals, structured questions, plan reviews, multiple selections, and custom answers
110
+ - Control what the Agent may do with permission Presets and sandboxes; add instructions or interrupt while a task is running
111
+
112
+ ### 5. Commands and key bindings
113
+
114
+ Start the TUI:
115
+
116
+ ```sh
117
+ dsh --profile cli # create a standard session
118
+ dsh --profile cli --mode code # start with the specified Agent Preset
119
+ dsh --profile cli --continue # resume the latest session for the current directory
120
+ dsh --profile cli --resume abc123 # resume by id or unique prefix
121
+ dsh --profile cli --session my-id # create a session with an explicit id
122
+ ```
123
+
124
+ The following built-in commands are available inside the TUI. Additional Harness commands and user skills depend on the active profile and installed packages; use `/help` for the complete current list.
125
+
126
+ #### Sessions and history
127
+
128
+ | Command | Purpose |
129
+ | --- | --- |
130
+ | `/new [preset]` | Create a session, optionally selecting an Agent Preset |
131
+ | `/resume [id\|prefix]` | Search for or restore an existing session |
132
+ | `/resume cancel` | Cancel a pending session switch |
133
+ | `/fork [event-seq]` | Create a session branch from the latest completed turn or a specified event position |
134
+ | `/delete [id\|prefix]` | Delete a session and its subagent sessions |
135
+ | `/title <text>` | Change the current session title |
136
+ | `/export [path]` | Export the current session as Markdown |
137
+ | `/history` | Search and reuse previously submitted prompts and slash commands |
138
+ | `/clear` | Clear the current terminal display without deleting the durable session |
139
+
140
+ #### Agents, models, and permissions
141
+
142
+ | Command | Purpose |
143
+ | --- | --- |
144
+ | `/mode [preset]` | Inspect or select the current session's Agent Preset |
145
+ | `/model` | Switch models and manage providers, API keys, browser sign-in, endpoints, and available models |
146
+ | `/effort` | Adjust the current model's reasoning effort |
147
+ | `/permission [preset]` | Inspect or switch the permission Preset |
148
+ | `/subagent` | Select the model used when a subagent performs a task |
149
+
150
+ #### Coding, tasks, and background work
151
+
152
+ | Command | Purpose |
153
+ | --- | --- |
154
+ | `/diff [--staged\|ref]` | Inspect the working-tree, staged, or specified-ref Git diff by file |
155
+ | `/review [--staged\|ref]` | Review Git changes with read-only permissions |
156
+ | `/todos` | View the complete todo list for the current session |
157
+ | `/agents` | View subagent sessions created by the current session |
158
+ | `/jobs` | View background jobs and their runtime status |
159
+ | `/schedule` | Inspect active reminders (created through the model's schedule tools; read-only, overdue first) |
160
+ | `/copy` | Copy the latest complete assistant response |
161
+
162
+ #### Extensions, display, and exit
163
+
164
+ | Command | Purpose |
165
+ | --- | --- |
166
+ | `/plugin [query]` | Inspect loaded extensions and their status |
167
+ | `/update` | One aligned upgrade: pins the global Harness host to the line the target release declares in its peers, moves dsh-code, the host, and profile companion plugins together, shows the full plan and refusal reasons before confirming, and prompts a restart when done |
168
+ | `/statusline` | Select the items displayed in the status bar |
169
+ | `/vscode-keys` | Pass Ctrl+R through VS Code-family terminals (idempotent user-level keybindings.json write) |
170
+ | `/theme` | Switch the terminal color theme |
171
+ | `/animation` | Toggle timed animations (shimmer/chase/blink/switch wave), `/animation [on\|off]` |
172
+ | `/help` | View key bindings, built-in commands, Harness commands, and user skills |
173
+ | `/quit` | Exit DSH-Code |
174
+
175
+ #### Input and key bindings
176
+
177
+ | Action | Purpose |
178
+ | --- | --- |
179
+ | `Enter` | Submit the current input |
180
+ | `Up` / `Down` | Recall the previous or next input-history entry |
181
+ | `Tab` | Complete commands, skills, or `@` references |
182
+ | `@` | Reference workspace files or existing sessions; image files are sent as attachments |
183
+ | `Ctrl+O` | Inspect full history and tool details |
184
+ | `Ctrl/Alt+R` | Fold or expand model reasoning; run /vscode-keys first in VS Code-family terminals to pass Ctrl+R through |
185
+ | `Shift+Tab` | Cycle through permission Presets |
186
+ | `Delete` | Cancel the newest queued message when the composer is empty |
187
+ | `Ctrl+K` | Delete from the cursor to the end of the line |
188
+ | `Ctrl+U` | Clear the current input line |
189
+ | `Ctrl+A` / `Ctrl+E` | Move to the beginning or end of the current line |
190
+ | `Esc` | Close the current menu or interrupt the running turn |
191
+ | `Ctrl+C` | Cancel a task, clear the input, or exit, depending on the current state |
192
+ | `Ctrl+D` | Exit DSH-Code |
193
+
194
+ #### Status indicators
195
+
196
+ | Indicator | Trigger |
197
+ | --- | --- |
198
+ | `✻ Deep diving...` | The turn is running while nothing is streaming (waiting for the first token, gaps during tool runs); an elapsed clock appears after 15 seconds |
199
+ | `✻ Thinking…` | Model reasoning is streaming; collapsed into the shimmer marker by default, expand with `Ctrl/Alt+R` |
200
+
201
+ ## 4. How DSH-Code integrates with DSH
202
+
203
+ ### 1. Runtime composition
204
+
205
+ DSH-Code reads the live Harness registries instead of maintaining a separate local copy. Model adapters, tool providers, skill sources, commands, permission policies, persistence backends, sandboxes, and subagent providers can all be added or replaced through DSH composition.
206
+
207
+ `/plugin` provides a read-only view of the current Cordis loader state.
208
+
209
+ ### 2. Bundled and optional official plugins
210
+
211
+ The following official plugins ship with DSH-Code and are enabled in the composition by default:
212
+
213
+ - **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).
214
+ - **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).
215
+ - **Clock for reminders**: `time-context` injects the current time for the model (throttled to 30s), so phrasings like "remind me at 5 pm" work.
216
+
217
+ 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):
218
+
219
+ - **MCP servers** (`@deepseek-ai/dsh-mcp-client`, one row per server; tools register as `mcp__<server>__<tool>`):
220
+
221
+ ```yaml
222
+ - insert:
223
+ - id: mcp-memory
224
+ name: '@deepseek-ai/dsh-mcp-client'
225
+ config:
226
+ transport: stdio
227
+ serverName: memory
228
+ command: mcp-server-memory
229
+ ```
230
+
231
+ (HTTP transports use `transport: streamable-http` plus `url`; an unreachable server degrades to a reconnect loop and never breaks startup.)
232
+ - **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:
233
+
234
+ ```yaml
235
+ - insert:
236
+ - id: hooks-claude
237
+ name: '@deepseek-ai/dsh-hooks-claude-code'
238
+ config:
239
+ configPath: C:/Users/you/.claude/hooks.json
240
+ ```
241
+ - **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. 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).
242
+ - **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. Enable in the user layer:
243
+ ```yaml
244
+ - id: tool-terminal
245
+ disabled: false
246
+ ```
247
+ (Background sends appear in the /jobs panel.)
248
+ - **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:
249
+ ```yaml
250
+ - insert:
251
+ - id: tmux-context
252
+ name: '@deepseek-ai/dsh-tmux-context'
253
+ config:
254
+ refreshIntervalMs: 60000
255
+ ```
256
+ - **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.
257
+
258
+ ### 3. Session-scoped Agent Presets
259
+
260
+ 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**:
261
+
262
+ - `standard` — a full-featured general-purpose coding Agent
263
+ - `ptc` — multi-operation workflows designed for PTC (formerly Code Mode); the legacy `code` id still works
264
+ - `minimal` — a single-tool composition keeping only the persistent shell
265
+ - `cordis` the full Agent plus runtime inspection and Preset-authoring guidance
266
+ - user Presets custom tools, prompt sections, skills, context compaction, plan mode, and subagent behavior
267
+
268
+ 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.
269
+
270
+ ### 4. Session history and recovery
271
+
272
+ 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.
273
+
274
+ React state stores only temporary interface details such as the input draft, cursor, active panel, selection, and scroll position.
275
+
276
+ ```text
277
+ dsh profile
278
+ └─ Host plane: registries · persistence · queries · permissions · sandbox
279
+ ├─ Agent session A + preset code
280
+ ├─ Agent session B + preset minimal
281
+ └─ DSH-Code TUI
282
+ durable events pure projection append-only transcript
283
+ └→ bounded panels → composer → status bar
284
+ ```
285
+
286
+ ## 5. Development
287
+
288
+ ```sh
289
+ pnpm install
290
+ pnpm test
291
+ pnpm typecheck
292
+ pnpm build
293
+ pnpm run gen:whale # regenerate src/whale-glyph.ts from the vendored logo path
294
+ ```
295
+
296
+ The whale glyph is generated from the DeepSeek FishLogo geometry vendored in `scripts/fish-logo.ts` (source: DeepSeek Harness, MIT).
297
+
298
+ ### 1. Source development installation
299
+
300
+ For a local checkout:
301
+
302
+ ```sh
303
+ dsh plugin --profile cli add file:C:/path/to/dsh-code
304
+ ```
305
+
306
+ GitHub installation is available for source development:
307
+
308
+ ```sh
309
+ dsh plugin --profile cli add github:unlinearity/dsh-code
310
+ ```
311
+
312
+ The Git package builds during installation. If pnpm asks for an `allowBuilds` entry, copy the complete entry it prints into `~/.dsh/profiles/cli/pnpm-workspace.yaml`, then run the command again. The key contains the Git URL and commit, so it cannot be replaced with only `dsh-code`.
313
+
314
+ ### 2. Uninstall
315
+
316
+ ```sh
317
+ dsh plugin --profile cli remove dsh-code # unmount the plugin from the cli profile
318
+ npm uninstall -g dsh-code # remove the global package and the deepseek / dsh-code commands
319
+ ```
320
+
321
+ Both commands are required for a complete uninstall. The first only removes the profile mount, so the `deepseek` command still exists and reports "the cli profile does not mount dsh-code yet". The second removes the global npm package and its launch aliases. Uninstalling does not affect `@deepseek-ai/dsh` itself or any persisted session data.
322
+
323
+ ### 3. References
324
+
325
+ - Runtime services, events, plugin scopes, and the persistence model follow **DeepSeek Harness**.
326
+ - Session navigation, overlay sizing, scrollback, bottom layout, and resize handling refer to **Codex CLI**.
327
+ - Slash-command discovery, turn steering, reasoning folds, approvals, and question flows refer to **Claude Code**.
328
+
329
+ DSH-Code is an independent MIT-licensed community project and is not affiliated with OpenAI or Anthropic.
330
+
331
+ Communities:
332
+
333
+ - [Linux DO](https://linux.do/): Learn AI at L Station!
334
+ - [DeepSeek Harness](https://www.deepseek.com/harness): the official DSH website
335
+
336
+ ## License
337
+
338
+ [MIT](LICENSE). The vendored FishLogo geometry comes from DeepSeek Harness (MIT).