Introduction¶
When writing composer prompts in DeepSeek Harness (DSH), a common problem is that the draft is only half a sentence, and specific constraints are scattered across previous rounds of conversation. Manually copying paths, errors, and acceptance criteria into the input box is time-consuming and prone to missing “what cannot be touched.” Another npm package in the community is dsh-prompt-refine, which aims to provide three improvement suggestions before sending, different from this plugin. dsh-prompt-complete (Chinese name “完善提示词”) is published by maintainer haiwenxiang061-dev, categorized under “Model Inference” in the directory. It reads the conversation within the current session, performs a rewrite using the same model routing, and fills the result back into the input box, which can be undone within 12 seconds.
Below, I introduce what it does, how to install it, and the boundaries and configurations during use.
What is it¶
dsh-prompt-complete is a DSH dual-half plugin: the host half registers an HTTP route and calls the LLM, while the client half injects a “Refine” button into the composer toolbar. It does not configure a model separately; the rewrite request uses the provider and model already existing in the current session’s requestHeader().config.
- Repository: haiwenxiang061-dev/dsh-prompt-complete
- Community Directory: SkillHub Plugin Page
- License: MIT (consistent with README and package.json)
- NPM Package Name:
dsh-prompt-complete(The documentation records the published version as1.0.1; you can check the latest version withnpm view dsh-prompt-complete version)
Core Features¶
Where does the conversation context come from¶
The host reads the actual message sequence seen by the model via deriveMessages(), truncating the most recent 24 user/assistant turns, which participate in the rewrite together with the draft in the input box.
Rewrite Rules (Summarized from README original text)¶
- Preserve original intent and existing constraints without narrowing the scope.
- Write implied requests as explicit items: goals, current status, what to change, acceptance criteria, and what cannot be touched.
- Use real facts from the conversation (paths, errors, decisions) to resolve pronouns and dangling references; do not invent paths, APIs, or versions.
- When the draft is empty, infer the “next message that should be sent” based on unfinished work in the conversation.
Two Entry Points¶
Button (with UI): On the right side of the composer toolbar, slot conversation.input.right, order 60, inline labeled “提示词完善” (Prompt Refine). After clicking, it reads the draft → requests the host → fills back into the input box, undoable within 12 seconds.
Slash Command (no UI): Send /refine your draft, the rewrite result is returned as a command reply, not entering the conversation history; when the draft is empty, it also infers based on the current conversation.
They share the host path POST /dsh-prompt-complete/refine and the same set of validations, differing only in the output.
Host API¶
| Method | Path | Description |
|---|---|---|
POST |
/dsh-prompt-complete/refine |
body { sessionId, draft } → { ok, prompt, provider, model, finish, usage } |
GET |
/dsh-prompt-complete/status |
Liveness probe, returns { ok, plugin, build, maxTokens, temperature } |
The request passes through same-origin gate: Host must be loopback, sec-fetch-site cannot be cross-site; if there is Origin, it must be same-origin as Host, otherwise 403. Request body limit is 256 KiB.
Failure and Error Display¶
The button enters an error state and floats the reason above; the content in the input box remains unchanged. The text is like “Refinement failed: …”, followed by the real error returned by the host (e.g., no-model-route, empty-completion, or the provider’s failure code).
Installation and Enablement¶
The local machine must be able to call pnpm (dsh plugin passes arguments to pnpm in the profile directory, can npm i -g pnpm). After installation, refresh the page to see the button. The host half does not support hot reload; if you modify the code, you need to restart Harness; or use plugin_manager’s action=set_plugin to disable then enable the entryId include:prompt-complete.
Method 1: npm (Recommended)¶
Replace web / desktop with your actual profile names:
dsh plugin --profile web add dsh-prompt-complete
dsh plugin --profile desktop add dsh-prompt-complete
Method 2: GitHub tarball (via npm)¶
Use the codeload HTTPS address to avoid the github:owner/repo shorthand reset common in git transfers in China:
dsh plugin --profile web add https://codeload.github.com/haiwenxiang061-dev/dsh-prompt-complete/tar.gz/refs/tags/v1.0.1
dsh plugin --profile desktop add https://codeload.github.com/haiwenxiang061-dev/dsh-prompt-complete/tar.gz/refs/tags/v1.0.1
Release attachment equivalent installation example (desktop):
dsh plugin --profile desktop add https://github.com/haiwenxiang061-dev/dsh-prompt-complete/releases/download/v1.0.1/dsh-prompt-complete-1.0.1.tgz
Typical Usage¶
- Write a short draft in composer (or leave it empty for the plugin to infer the next message).
- Click “完善” (Refine) on the right of the toolbar, wait for the fill-back; if it’s not suitable, undo within 12 seconds.
- In non-UI scenarios, send in the conversation:
/refine 你的草稿内容
After the rewrite is complete, check the fill-back or command reply to ensure the paths and constraints match the conversation, then send formally.
Optional Configuration¶
You can configure the host half under config: in cordis.patch.yml:
- insert:
- id: prompt-complete
name: dsh-prompt-complete
config:
maxTokens: 1600
temperature: 0.2
timeoutMs: 180000
Applicable Scenarios and Notes¶
Who is it for: Developers of agents or applications who often need to complete prompts after long conversations in DSH and want to write out all constraints with one click.
Permissions and Runtime: The plugin runs with the current DSH process permissions; it will read the current session conversation transcript and initiate an additional LLM call using that session’s model routing (consuming tokens). At the network level, it does not connect to the external network, only accessing the host routes on the local loopback. It is recommended to review the repository source code and the MIT license before installation.
Known Boundaries:
- Rejects execution when the input box has a reference chip (when
occurrencesis not empty or in theclaimedphase), to avoid replacing the entire paragraph and losing the chip; clear the chip and retry. - The rewrite is an additional model call and will incur token overhead.
- The client has an error boundary: when rendering errors occur, the button disappears, which does not affect the host composer.
Compatibility Scope (package.json engines):
| Item | Requirement |
|---|---|
| DSH | >=0.2.0-rc.2 <0.3.0-0 |
| Node | >=22 |
| Platform | All platforms (does not depend on local GIS) |
| Host Capabilities | Requires webServer and llm (included in dsh-base) |
Conclusion¶
dsh-prompt-complete synthesizes “what has already been said in the conversation” and “what is not fully written in the input box” into a prompt that can be sent directly, and reuses the current session’s model routing, eliminating the need to configure another rewrite model. If you want to install it or see implementation details, you can visit the SkillHub Directory Page and the GitHub Repository. The community plugin directory is an independent site with no official affiliation to DeepSeek / Huafan; the DSH ecosystem itself follows the “everything is a plugin” extension method, and this plugin is one implementation focused on prompt refinement for composers.