dsh-code 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.en.md +287 -286
  2. package/README.md +16 -13
  3. package/bin/deepseek.mjs +336 -11
  4. package/cordis.patch.yml +26 -18
  5. package/lib/index.mjs +1310 -439
  6. package/lib/types/app.d.ts +25 -6
  7. package/lib/types/attachments.d.ts +36 -4
  8. package/lib/types/git-workflow.d.ts +7 -2
  9. package/lib/types/history.d.ts +18 -11
  10. package/lib/types/index.d.ts +11 -2
  11. package/lib/types/presets.d.ts +4 -1
  12. package/lib/types/provider-settings.d.ts +6 -11
  13. package/lib/types/questions.d.ts +16 -12
  14. package/lib/types/render/animations.d.ts +74 -7
  15. package/lib/types/render/export.d.ts +0 -6
  16. package/lib/types/render/fuzzy.d.ts +21 -0
  17. package/lib/types/render/projection.d.ts +47 -5
  18. package/lib/types/session-directory.d.ts +48 -13
  19. package/lib/types/settings-file.d.ts +8 -0
  20. package/lib/types/store.d.ts +3 -0
  21. package/package.json +168 -159
  22. package/src/app.ts +480 -199
  23. package/src/attachments.ts +110 -11
  24. package/src/commands.ts +35 -5
  25. package/src/git-workflow.ts +29 -10
  26. package/src/history.ts +22 -13
  27. package/src/index.ts +1868 -1752
  28. package/src/internals.ts +61 -40
  29. package/src/permissions.ts +1 -1
  30. package/src/presets.ts +19 -6
  31. package/src/provider-settings.ts +12 -12
  32. package/src/questions.ts +57 -74
  33. package/src/render/animations.ts +606 -403
  34. package/src/render/export.ts +20 -10
  35. package/src/render/fuzzy.ts +83 -0
  36. package/src/render/projection.ts +1833 -1620
  37. package/src/session-directory.ts +94 -16
  38. package/src/settings-file.ts +38 -6
  39. package/src/skills.ts +23 -9
  40. package/src/store.ts +39 -1
  41. package/src/subagents.ts +26 -3
package/README.en.md CHANGED
@@ -1,286 +1,287 @@
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 composerstatus 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.1`). 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.1 dsh-code@1.0.6
34
+ npm install -g pnpm
35
+ dsh plugin --profile cli add dsh-code@1.0.6
36
+ ```
37
+
38
+ > Note: pnpm ignores packages published less than 24 hours ago, so use the exact version `dsh-code@1.0.6` 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.1`, with every Harness dependency pinned exactly to `0.1.5-rc.1`. 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, 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`, `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 |
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
+ | `/animation` | Toggle timed animations (shimmer/chase/blink/switch wave), `/animation [on\|off]` |
170
+ | `/help` | View key bindings, built-in commands, Harness commands, and user skills |
171
+ | `/quit` | Exit DSH-Code |
172
+
173
+ #### Input and key bindings
174
+
175
+ | Action | Purpose |
176
+ | --- | --- |
177
+ | `Enter` | Submit the current input |
178
+ | `Up` / `Down` | Recall the previous or next input-history entry |
179
+ | `Tab` | Complete commands, skills, or `@` references |
180
+ | `@` | Reference workspace files or existing sessions; image files are sent as attachments |
181
+ | `Ctrl+O` | Inspect full history and tool details |
182
+ | `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 through permission Presets |
184
+ | `Delete` | Cancel the newest queued message when the composer is empty |
185
+ | `Ctrl+K` | Delete from the cursor to the end of the line |
186
+ | `Ctrl+U` | Clear the current input line |
187
+ | `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 |
189
+ | `Ctrl+C` | Cancel a task, clear the input, or exit, depending on the current state |
190
+ | `Ctrl+D` | Exit DSH-Code |
191
+
192
+ #### Status indicators
193
+
194
+ | Indicator | Trigger |
195
+ | --- | --- |
196
+ | `✻ 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 |
197
+ | `✻ Thinking…` | Model reasoning is streaming; collapsed into the shimmer marker by default, expand with `Ctrl/Alt+R` |
198
+
199
+ ## 4. How DSH-Code integrates with DSH
200
+
201
+ ### 1. Runtime composition
202
+
203
+ 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.
204
+
205
+ `/plugin` provides a read-only view of the current Cordis loader state.
206
+
207
+ ### 2. Session-scoped Agent Presets
208
+
209
+ 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
+
211
+ - `standard` — a full-featured general-purpose coding Agent
212
+ - `ptc` — multi-operation workflows designed for PTC (formerly Code Mode); the legacy `code` id still works
213
+ - `minimal` — a single-tool composition keeping only the persistent shell
214
+ - `cordis`the full Agent plus runtime inspection and Preset-authoring guidance
215
+ - user Presets — custom tools, prompt sections, skills, context compaction, plan mode, and subagent behavior
216
+
217
+ 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
+
219
+ ### 3. Session history and recovery
220
+
221
+ 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
+
223
+ React state stores only temporary interface details such as the input draft, cursor, active panel, selection, and scroll position.
224
+
225
+ ```text
226
+ dsh profile
227
+ └─ Host plane: registries · persistence · queries · permissions · sandbox
228
+ ├─ Agent session A + preset code
229
+ ├─ Agent session B + preset minimal
230
+ └─ DSH-Code TUI
231
+ durable eventspure projection append-only transcript
232
+ └→ bounded panels → composer → status bar
233
+ ```
234
+
235
+ ## 5. Development
236
+
237
+ ```sh
238
+ pnpm install
239
+ pnpm test
240
+ pnpm typecheck
241
+ pnpm build
242
+ pnpm run gen:whale # regenerate src/whale-glyph.ts from the vendored logo path
243
+ ```
244
+
245
+ The whale glyph is generated from the DeepSeek FishLogo geometry vendored in `scripts/fish-logo.ts` (source: DeepSeek Harness, MIT).
246
+
247
+ ### 1. Source development installation
248
+
249
+ For a local checkout:
250
+
251
+ ```sh
252
+ dsh plugin --profile cli add file:C:/path/to/dsh-code
253
+ ```
254
+
255
+ GitHub installation is available for source development:
256
+
257
+ ```sh
258
+ dsh plugin --profile cli add github:unlinearity/dsh-code
259
+ ```
260
+
261
+ 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`.
262
+
263
+ ### 2. Uninstall
264
+
265
+ ```sh
266
+ dsh plugin --profile cli remove dsh-code # unmount the plugin from the cli profile
267
+ npm uninstall -g dsh-code # remove the global package and the deepseek / dsh-code commands
268
+ ```
269
+
270
+ 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.
271
+
272
+ ### 3. References
273
+
274
+ - Runtime services, events, plugin scopes, and the persistence model follow **DeepSeek Harness**.
275
+ - Session navigation, overlay sizing, scrollback, bottom layout, and resize handling refer to **Codex CLI**.
276
+ - Slash-command discovery, turn steering, reasoning folds, approvals, and question flows refer to **Claude Code**.
277
+
278
+ DSH-Code is an independent MIT-licensed community project and is not affiliated with OpenAI or Anthropic.
279
+
280
+ Communities:
281
+
282
+ - [Linux DO](https://linux.do/): Learn AI at L Station!
283
+ - [DeepSeek Harness](https://www.deepseek.com/harness): the official DSH website
284
+
285
+ ## License
286
+
287
+ [MIT](LICENSE). The vendored FishLogo geometry comes from DeepSeek Harness (MIT).