DeepSeek Harness Enhanced Prompt Plugin

Introduction

In DeepSeek Harness (DSH), drafts typed directly into the composer tend to be colloquial or incomplete. If you want the same model to automatically rewrite a draft into a ready-to-send prompt based on the current conversation context, you’d otherwise need to adjust it manually or rely on external tools. DSH’s plugin architecture allows extending capabilities at the composer row, command, and tool levels — this plugin is designed for exactly that purpose.

Plugin Overview

dsh-enhanced-prompt is a DSH plugin that rewrites drafts in the composer into prompts a model can understand. It calls the current model via the host-side ctx.llm, leverages the session’s conversation history, and generates a structured, ready-to-send prompt with one click. The plugin includes a composer button, the /enhance command, the enhance_prompt tool, and a settings panel.

Core Features

The plugin provides capabilities at four locations: the composer row, the settings panel, the command, and the tool.

Composer Row Button

On the left side of the bottom control row in the composer, next to the model selector, there is a ✦ button. Clicking it replaces the current draft with the rewritten prompt. There is also a ↩ button that lets you restore the original text with one click.

Settings Panel

Via the ⚙ panel in the bottom-right corner of the composer, you can configure the rewrite strategy, output style, length, language, conversation context, model, timeout, and extra instructions. Configuration items include:

  • strategy: llm (model-based rewrite, consumes tokens) or rule (offline rule engine, no model call)
  • style: natural (plain text) or structured (sectioned template)
  • length: short, normal, detailed
  • language: auto, zh, en
  • extraInstruction: extra instruction string
  • history: whether to enable history context, along with the number of messages to retain and the character limit
  • llm: provider, model, maxOutputTokens, temperature, timeoutMs, fallbackToRule
  • bridge: whether to enable the host-to-client bridge, and the maximum concurrency
  • diagnostics: whether to enable diagnostic logging

/enhance Command

Type /enhance <request> in the chat to preview the rewrite result. The command supports:

  • apply: send the rewrite result as the next message
  • preset: switch the offline rule engine template
  • lang: switch the offline rule engine language
  • status: print the currently active configuration
  • settings: view or modify settings
  • set key=value: quickly modify a single setting

enhance_prompt Tool

The enhance_prompt tool is available to the agent, allowing it to rephrase vague requests before executing a task and then proceed with subsequent operations based on the rewritten prompt.

Installation & Enablement

Requirements

  • DeepSeek Harness >= 0.2.1-rc.4
  • Node.js >= 18
  • Git

Option 1: Install via the Plugin Manager

In a DSH session, use the plugin_manager tool:

// plugin_manager tool
{ "action": "install_bundle", "target": "github:mowei1600/dsh-enhanced-prompt" }

After installation, refresh the page. The plugin will load its button in the composer row. If the plugin does not appear in the Host logs, restart DSH.

Option 2: One-Click Install Script

PowerShell:

irm https://raw.githubusercontent.com/mowei1600/dsh-enhanced-prompt/main/scripts/install.ps1 | iex

bash / zsh:

curl -fsSL https://raw.githubusercontent.com/mowei1600/dsh-enhanced-prompt/main/scripts/install.sh | sh

The script clones the repository to a temporary directory and then installs using --profile desktop.

Option 3: Manual Installation

git clone https://github.com/mowei1600/dsh-enhanced-prompt.git
cd dsh-enhanced-prompt
node bin/install.mjs install --profile desktop
node bin/install.mjs status --profile desktop --json

After installation, refresh the page and restart DSH.

Update & Uninstall

Update (Option 2/3):

git pull && node bin/install.mjs install --profile desktop

Uninstall:

node bin/install.mjs uninstall --profile desktop

For Option 1, use the plugin manager’s update/remove actions.

Configuration & Runtime

The runtime configuration file is located at $DSH_HOME/enhanced-prompt.settings.json and can be modified via the panel in the bottom-right corner of the composer, the plugin card, or /enhance set key=value. Default configuration is loaded from the bundle’s cordis.patch.yml.

Configuration example:

- id: enhanced-prompt
  config:
    enabled: true
    strategy: llm
    style: natural
    length: normal
    language: auto
    extraInstruction: ''
    history: { enabled: true, messages: 6, chars: 2000 }
    llm:
      provider: ''
      model: ''
      maxOutputTokens: 1400
      temperature: 0.2
      timeoutMs: 45000
      fallbackToRule: false
    bridge: { enabled: true, maxInFlight: 2 }
    diagnostics: true

Security & Privacy

  • Rewrites are performed on the Host side via ctx.llm; provider credentials are never exposed to the browser.
  • The composer button communicates with the same-origin endpoint POST /enhance/api using POST + JSON. Only one concurrent rewrite is allowed per session, and an Origin check is enforced.
  • Drafts and conversation tails are used solely for the rewrite request. They are not written to session logs and are only recorded in the plugin’s own configuration file.
  • The rule engine does not call any model, making it suitable for offline environments.

Development & Compatibility

The plugin is built against the DSH 0.2.1-rc.4 API (ctx.commands, ctx.tools, ctx.systemPrompt, ctx.webServer, ctx.llm, ctx.sessions, ctx.agentDefaultModel) and is injected via the conversation.input.right client slot.

Development commands:

npm test                 # 85 unit tests
npm run check:client     # check that client.js and client/ui.js are in sync
npm run check:text       # check text file encoding and line endings
npm run build:client     # regenerate client.js

The project structure includes index.js (Host plugin), lib (LLM, bridge, settings, history, offline engine), client/ui.js (template), and bin/install.mjs (install script).

Use Cases & Notes

This plugin is ideal for DSH users who need to quickly transform colloquial or vague composer drafts into structured prompts, especially those who want to leverage the current model and conversation context for automatic optimization.

Note: The plugin runs under DSH process privileges. It is recommended to review the source code and the license (MIT) before installing.

Summary

This plugin provides three interfaces — a composer button, a command, and a tool — enabling DSH users to rewrite prompts using the current model and conversation context without leaving the composer. It adheres to the DSH plugin specification, does not modify harness files, does not send telemetry data, and is well-suited for local or intranet environments.

Directory: https://www.skillhub.cn/plugins/mowei1600/dsh-enhanced-prompt
GitHub: https://github.com/mowei1600/dsh-enhanced-prompt

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye