dsh-prompt-wisp: One-click Optimization of Drafts into Structured Prompts Beside the DSH Input Box

Introduction

When writing prompts in DeepSeek Harness (DSH), a common practice is to first draft a colloquial version in the editor, then manually add output formatting, constraints, and scopes, or copy it to external tools for rewriting. For shorter drafts, the process is manageable; however, once contextual references like “apply the plan discussed above” in multi-turn conversations come into play, the rewriting cost increases significantly. The community plugin dsh-prompt-wisp integrates this step into the host interface: it adds a ✦ button to the left of the send key in the chat input box. A single click uses your configured model to rewrite the draft into a clearer, structured, and directly executable prompt. It also provides a session execution monitoring alert bar to help identify issues like stalled executions or idle spinning. The following introduces its positioning, capabilities, and installation usage.

About the Plugin

dsh-prompt-wisp is released by maintainer jr-create and categorized as a client-side plugin for the DSH web profile. In short: it adds a ✦ optimization button in the composer toolbar next to the send key. It reads the draft from the input box and uses the host to invoke a default or specified model to rewrite and write back the result. Model invocation uses services already configured by the host; the plugin itself has zero runtime dependencies, zero external network requests, and requires no build steps.

The project is hosted on GitHub (jr-create/dsh-prompt-wisp), with the current package version 0.2.0 and MIT license. Community directory page: skillhub.cn plugin page. The DSH ecosystem emphasizes “everything is a plugin”; SkillHub and similar platforms are community directories and are not officially affiliated with DeepSeek or High-Flyer.

Core Features

Prompt Optimization (✦ Button)

  • Slot: Official conversation.input.right (left of the send key), automatically adapting to light/dark themes.
  • Flow: Read draft → Host invokes model → Rewrite using built-in prompt engineering rules → Write back to input box. Rules focus on preserving intent and constraints, filling obvious gaps, eliminating vague expressions, and following the draft’s language; the model only returns the rewritten body.
  • Session context awareness (Detailed optimization mode): The browser only sends sessionId; session logs are read-only via sessionPersistence on the host, without touching raw .jsonl.zstd files. Summaries exclude injected messages where source.kind === 'plugin'; up to 80 recent events → up to 12 dialogues → max 600 characters per dialogue → total budget of 4000 characters. When no history exists or reading fails, it degrades to “optimize based solely on draft”; on success, a bubble annotation “(contextualized with session)” appears.
  • Security and feedback: HTTP routing is loopback-only + same-origin; draft size limit is 20,000 characters per request; empty drafts, oversized inputs, and model errors are shown inline next to the button, ensuring no silent failures.

Dual Modes and Fallback

Mode Description Documented Duration
Quick Optimization (default) Simplified prompt + model race, no context reading, 6s/route budget 0.5–1.5s
Detailed Optimization Full structured prompt + session context, 10s/route budget 1.4–4s

Both modes concurrently race up to 3 model routes; the first clean response wins. If racing fails or times out, a local rule engine (redundancy removal dictionary, shape normalization, duplicate sentence folding) serves as a fallback.

Model Routing (Priority)

  1. Explicit { provider, model } in the request (validated via registry);
  2. Host’s “default model” (agent-default-model);
  3. First model of the first registered provider.

GET /api/dsh-prompt-wisp/route allows querying the current model in use.

Session Execution Monitoring

The full-width alert bar appears above the input area at the conversation.input.dock slot: the browser polls every 5 seconds (paused in background tabs), and the host analyzes the last 120 events via sessionPersistence to detect issues like stalling/deadlocks (no new events for 45 seconds), invalid outputs (8+ steps without visible text), tool loops (same tool with similar parameters 5 consecutive times), and turn failures (within 120 seconds). It is read-only analysis, writing nothing to the session and not intervening in execution; if new issues are detected after dismissal, the alert bar reappears.

Settings Page

DSH Settings → Prompt Wisp: Two groups with six toggle switches, applied immediately upon saving; configuration is stored in <DSH_HOME>/dsh-prompt-wisp/config.json.

Prompt Optimization: “Remove fluff” (default off), “Detailed optimization” (default off).

Session Execution Monitoring: “Show session monitoring alert bar” (default on), “Stalling/deadlock detection” (default on), “Invalid output detection” (default on), “Tool loop detection” (default on).

HTTP API (loopback + same-origin)

Endpoint Method Description
/api/dsh-prompt-wisp/status GET Version, capability flags, draft length limit
/api/dsh-prompt-wisp/route GET Current model routing
/api/dsh-prompt-wisp/optimize POST { prompt, sessionId?, provider?, model? } → Optimization result and metadata
/api/dsh-prompt-wisp/watch GET Session execution monitoring (read-only)

Recoverable errors return 200 + { ok: false, error } for UI display; unexpected crashes return 500.

Installation & Activation

Installation commands follow the repository README:

# Install from GitHub (recommended to lock release tag)
dsh plugin --profile web add github:jr-create/dsh-prompt-wisp#v0.2.0

# Or track the latest repository status
dsh plugin --profile web add github:jr-create/dsh-prompt-wisp

# Local development (link source directory)
dsh plugin --profile web add link:<absolute path to this repository>

After installation, restart dsh web. The appearance of the ✦ button in the input toolbar indicates successful loading.

Compatibility (README declaration): DSH host 0.1.5-rc.2 (version verified by development and 81 tests); profile web; Node ^22.19.0 || >=24.0.0. The plugin can still load without an LLM service, showing a prompt that the host has no available LLM; context awareness and execution monitoring automatically disable when sessionPersistence is unavailable.

Typical Usage

  1. Write a draft normally in the input box (either Chinese or English is fine);
  2. Click ✦ (button grays out when the draft is empty);
  3. After a short wait, the optimized result replaces the draft, with a confirmation bubble appearing next to the button. On failure, a red error reason is shown.

For full structured rewriting with contextual references to recent conversations, enable “Detailed optimization” in settings. To verify the current model routing, access GET /api/dsh-prompt-wisp/route locally (must meet loopback + same-origin requirements).

Suitable Scenarios and Notes

Suitable for: Developers frequently writing long prompts in the DSH web interface who want to avoid switching tools for structured rewriting; those who want passive observation of stalled, idle, or tool-looping sessions above the composer.

Permissions and Risks (per plugin documentation): Reads drafts at ✦ click time and default model configurations (read-only); writes optimized draft text; does not directly connect to external APIs; session summaries are provided by the host in read-only mode for detailed optimization. The plugin runs with the current dsh process privileges. Before installation, it is recommended to read the source code and LICENSE to evaluate whether your environment meets the requirements.

Conclusion

dsh-prompt-wisp integrates “draft → executable prompt” and lightweight session monitoring into the DSH input area, relying on existing host models and sessionPersistence without additional builds or external requests. For more information and installation:

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

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

Xiaoye