Introduction¶
In DSH (DeepSeek Harness), the input box often contains a fleeting thought before sending—such as “help me write a script to batch rename files” or “how do I fix this error.” The model has to guess the system, rules, and boundaries based on this alone, and a wrong guess leads to multi-turn clarification. Some users write long prompts externally and paste them in; others send directly, leaving the cost of refining the intent to subsequent dialogue turns.
The community plugin dsh-enhance-prompt (maintainer adcx222) is introduced below: it inserts a step before sending. It utilizes the LLM on the current route to perform a single-turn rewrite, expanding the draft into instructions with clearer constraints. It writes the result back to the input box, and you decide whether to send it. The plugin is classified as a client and integrates into DSH Desktop / dsh web as a dsh.bundle.
What is this¶
dsh-enhance-prompt adds a ✨ button to the DSH input box toolbar (28×28 pure icon, located to the left of the send button). Upon clicking, it reads the current draft (including @ file references in the composer), calls the host interface for a single-turn, tool-free text rewrite, and writes the result back to the input box.
It only rewrites, does not execute: it does not answer questions, call tools, create sessions, or write to conversation history. The rewriting utilizes DSH’s native ctx.llm.stream(); the model and provider default to following the current session but can be hardcoded in the configuration.
Compatible DSH version: >=0.2.0-rc.2 <0.3.0 (see engines.dsh in the repository’s package.json).
Core Features¶
Rewrite Boundaries¶
- One-click Trigger via Toolbar: Locates the composer via MutationObserver and injects the button into the toolbar; in split-screen or multi-session views, each composer gets its own button.
- Single-turn, Tool-free:
toolsis empty, ensuring via the API that the toolchain is not executed. - No History Pollution: The enhancement process does not enter the conversation record.
- Language Follows: Chinese input yields Chinese output, English yields English; the system prompt requires no language tags to be appended.
- Write-back Path: Prioritizes
inputActions.setDraft(Lexical); falls back to edit commands; then falls back to copying to clipboard. It does not directly modifycontenteditable. - Overwrite Prevention During Request: If you continue typing or add files while waiting for the result, the enhancement result goes only to the clipboard and does not overwrite the current draft.
- Usage Visibility: Right-clicking the button allows viewing cumulative input/output tokens, call count, and failure count (stored in local
stats.json). - Configurable Model: If
provider/modelare left empty, it follows the session; the resolution order is Request Body → Current Session → Config; if neither can be resolved, it returnscode: no_model.
Prompt Design (Narrow Task)¶
The system prompt for rewriting explicitly requires: rewrite only, do not answer; do not fabricate technical or factual details; output language must match input; Chinese output should be approx. 200–350 characters, English approx. 300–450 characters; output only the rewritten prompt. The goal is to prevent the model from “answering as a favor” and introducing unmentioned stacks or facts.
Installation and Enablement¶
The plugin runs with DSH process permissions. Before installing, it is recommended to review the GitHub repository source code and the MIT license.
Plugin Market¶
Open Settings → Plugin Market in DSH, search for dsh-enhance-prompt, and install.
Command Line (GitHub Source)¶
If not listed in the market or if you need to track main:
dsh plugin --profile web add github:adcx222/dsh-enhance-prompt
Manual Installation (Windows Path Example)¶
The steps outlined in the README are as follows:
- Place the repository in
%APPDATA%\dsh-desktop\harness\plugins\dsh-enhance-prompt - Add
"dsh-enhance-prompt": "link:../../plugins/dsh-enhance-prompt"todependenciesinprofiles/web/package.json - Add
"dsh-enhance-prompt"to thedsh.profile.bundlesarray in the same file - Run
harness\.desktop-bin\pnpm.cmd install - Restart DSH
To uninstall, remove it from bundles and dependencies, run pnpm install, restart, and delete the plugin directory.
Configuration¶
Default values can be overridden under config in cordis.patch.yml (snippet from README):
- insert:
- id: enhance-prompt
name: 'dsh-enhance-prompt'
config:
provider: ''
model: ''
maxTokens: 8192
timeoutMs: 60000
maxInputChars: 5000
| Field | Default | Description |
|---|---|---|
provider |
Empty | If empty, follows the model provider of the current session |
model |
Empty | If empty, follows the model name of the current session |
maxTokens |
8192 |
Output limit for a single rewrite (reasoning models’ thinking also counts towards the quota) |
timeoutMs |
60000 |
Request timeout (milliseconds) |
maxInputChars |
5000 |
If draft exceeds this length, it is rejected directly without initiating a call |
Typical Usage¶
The example from the README is as follows. Input is approx. 13 characters:
帮我写个脚本批量重命名文件
After clicking ✨, the output expands into an instruction with confirmation items and boundaries (README example is approx. 203 characters), such as requiring confirmation of the operating system, paths, matching rules, rename rules, conflict handling, and defaulting to a preview first. You can review the rewritten result, manually edit it if unsatisfied, and click send once satisfied.
How it Works (Overview)¶
The browser-side lib/client.js injects the button and reads the draft, submitting { text } via POST /enhance-prompt to the host. The host lib/index.js validates length, resolves provider/model, calls ctx.llm.stream(), assembles text blocks and records them in stats.json, returning { success, text, tokens }. The client then writes back to the draft. The route is registered via ctx.effect along with the plugin lifecycle; GET on the same path reads cumulative statistics.
The repository has no separate build step; lib/ is the artifact. After modifications, restart DSH or wait for HMR to reorganize.
Use Cases and Notes¶
Suitable for: Users who often start with short sentences in DSH but want to structure their intent before sending; users who want the enhancement to go through the locally configured model route and do not want to mix “polishing” into the conversation history.
Notes:
- DOM Injection: Depends on the composer structure (editor, send button, file input). Upstream UI changes may cause the button to disappear (usually without errors).
- One Paragraph at a Time: Only processes the entire draft, not selected fragments.
- Local Statistics:
stats.jsonis in the plugin directory and is not involved in cloud metering. - Community Plugin: The directory page is at SkillHub. It has no official affiliation with DeepSeek / High-Flyer; the DSH ecosystem emphasizes “everything is a plugin,” so please evaluate permissions and source code yourself before installing third-party bundles.
Conclusion¶
dsh-enhance-prompt adds a “single-turn rewrite” step before sending: it does not execute tasks for the model, but simply turns the thought in the input box into a clearer, constrained prompt, and attempts to safely write back via official InputActions. To further understand features, limitations, and development layout, please refer to the plugin directory page and the repository README.
- Directory Page: https://www.skillhub.cn/plugins/adcx222/dsh-enhance-prompt
- GitHub: https://github.com/adcx222/dsh-enhance-prompt