Introduction¶
The core design philosophy of DeepSeek Harness is “everything is a plugin.” In the Web interface, users often need to polish or rewrite a draft before sending a message. The dsh-prompt-optimize plugin uses an auxiliary LLM call to let you rewrite the current Composer draft before sending a message, without changing session state.
What It Is¶
dsh-prompt-optimize is a DeepSeek Harness Web plugin maintained by peterliucius. Its core purpose is to rewrite the draft in the current input box in the Web Composer using an auxiliary model. Clicking the button only replaces the draft content; it never sends a new message or starts a new conversation turn.
Core Features¶
- Auxiliary Rewrite: Rewrites the draft by invoking an auxiliary LLM.
- No Side Effects: Clicking only replaces the draft; it does not send messages, start a new conversation, or append session events.
- Visibility: The Sparkle button is always visible.
- State Checks: The button is disabled when the draft is empty, contains special reference characters (U+FFFC), the session has been removed, or the input machine is not in the Plain stage.
- Routing Resolution: When both plugin
provider/modelare set, they take priority; otherwise it falls back to the session’srequest/headerconfiguration or the default proxy model. - Request Limits: Frames the draft as JSON, uses a fixed rewrite instruction, enforces configured byte and token limits, sets a timeout, and sets
reasoningEffort: 'off'.
Installation and Activation¶
First start the Web Profile:
dsh --profile web
The plugin is not mounted by default and must be installed with a command. If using a Git-hosted plugin and pnpm version is 10 or greater, the first installation will fail and print the allowBuilds key:
dsh plugin --profile web add github:peterliucius/dsh-prompt-optimize
Add the printed key to the Web Profile’s pnpm-workspace.yaml:
allowBuilds:
dsh-prompt-optimize: true
Run the installation command above again to complete it. If you already have the code locally and it includes a lib/ directory, allowBuilds is not needed; install it directly from the local path:
dsh plugin --profile web add /path/to/dsh-prompt-optimize
After installation, the plugin injects a configuration entry into the Profile, containing the following default values: maxInputBytes: 32768, maxOutputTokens: 4096, timeoutMs: 60000.
Typical Usage¶
In the Web interface, click the always-visible Sparkle button. The plugin captures the current draft and calls the auxiliary model to rewrite it. The rewritten content only updates the draft via inputActions.setDraft. If the draft is moved after capture, a Toast notification is shown and the draft is no longer replaced.
Use Cases and Notes¶
- Permissions and Security: The plugin runs with the permissions of the current DSH process. Before installing, ensure the source is trustworthy. If unsure, pin a specific Git commit hash when installing (
github:peterliucius/dsh-prompt-optimize#<sha>). - Configuration Requirements: All fields in the configuration entry are required unless a paired Route Override is provided; the plugin library itself does not provide default values.
- Development and Debugging: If you need to develop locally, reference dependencies from
../dsharnessvia a sibling checkout.
Conclusion¶
This plugin provides a convenient draft rewriting capability for the DeepSeek Harness Web Profile, suitable for scenarios where you need to polish a prompt before sending.