Introduction¶
When managing prompts in DeepSeek Harness, a common practice is to directly paste preset text into the input box. This pollutes the input box content and causes the conversation log to diverge from what the model actually receives. dsh-prompt-injector solves this problem by moving preset injection to the Host side, concatenating the content to the beginning of the message during the agent/pre-step stage before the message is sent.
Plugin Overview¶
This is a Web plugin for DeepSeek Harness that injects reusable prompt presets into the beginning of messages when sending. It supports injecting only into the next message or into every turn. The plugin is maintained by yukk4159-bit and is released under the MIT License.
Installation and Enablement¶
The plugin is provided as a bundle and can be installed without building. Run the following command to add the plugin:
dsh plugin --profile web add "github:yukk4159-bit/dsh-prompt-injector"
After installation, restart the profile to see the related UI in the interface.
Core Features¶
- Host-side injection: Injection occurs during the
agent/pre-stepstage before message sending, without polluting the input box content. - Dual-mode injection: Supports “inject only the next message” (default) and “inject every turn”.
- Preset management: Manage the preset library through the UI, with support for tag filtering and search.
- In-message triggering: Supports triggering preset injection with
{{id}}in the message body. - Configurability: Supports custom injection position, template, and separator.
- HTTP interface: Communicates with the Host process via
/prompt-injector/...routes and synchronizes session selection.
Usage¶
- Create a preset: Create a preset in the settings page, then restart the profile after saving. The preset library is persisted in the profile’s
cordis.patch.ymlfile. - Select a preset: Click the preset button to select a preset and injection mode. You can choose “inject only the next message” (default) or “inject every turn”.
- Send a message: Enter your text as usual and send it. The preset content will be automatically prepended to the beginning of the message.
- In-message triggering: Enter
{{id}}in the message body (idis the preset ID). After sending, that message will be injected with the corresponding preset.
Configuration¶
- enabled: Master switch, defaulting to
true. - position: Injection position, defaulting to
prefix(message beginning). You can also choosesuffix(message end). - template: Wrapper template around the preset body, supporting
{{name}},{{id}}, and{{text}}. - separator: Separator between the preset block and the user’s text, defaulting to two line breaks.
- defaultPresetId: Fallback preset ID. Leave it empty to disable injection. This preset is defined to be injected every turn.
Notes¶
- Session selection: The “inject only the next message” selection is stored in the Host process memory and is cleared after a restart.
- Dependency versions: Requires Node.js version >= 22.5.
- Permissions: The plugin runs with the permissions of the current dsh process. Review the source code and license before installation.
Conclusion¶
This tool addresses the need to reuse prompts in DeepSeek Harness while keeping the input box clean and the conversation log accurate. For more details and source code, visit GitHub.