qianshe/dsh-assistant-optimization
Five capabilities, all plug-and-play. Official rendering is never replaced — the plugin shadows DSH components and delegates back to them, so Markdown, tool cards, images, and tables keep working exactly as shipped.
catalog 简介 / catalog descriptioncatalog description:DSH plugin: fold mis-rendered thinking/reasoning content into collapsible blocks and render mermaid diagrams inline.
项目介绍Project Overview
这是 DSH web 配置的插件,用于优化模型输出可读性与提示词编写。它折叠误渲染的思维链、渲染可交互 Mermaid 图、显示编辑增删行数、一键润色草稿,并提供基于 Windsurf 的语义代码搜索。适合在 web UI 中阅读长回答、查看改动、整理提示或模糊定位代码时使用。注意:语义搜索需配置 Windsurf 密钥,未配置时不会注册该工具;安装、更新或卸载后需重启。
This is a DSH plugin for the web profile that improves output readability and prompt authoring. It folds mis-rendered chain-of-thought, renders interactive Mermaid diagrams, shows edit diff counts, enhances rough prompts in one click, and provides Windsurf-backed semantic code search. Use it in the web UI when reading long answers, reviewing edits, refining instructions, or locating code from vague descriptions. Caveat: semantic search requires a resolvable Windsurf key; otherwise the tool is not registered, and restarts are needed after install, update, or removal.
请帮我了解并安装插件:【dsh-assistant-optimization】【https://github.com/qianshe/dsh-assistant-optimization】
把上面这条消息直接发给当前会话里的 DSH,让它帮你了解并安装。安装命令不一定准确,发给 DSH 更稳。Send this message to DSH in your current session. CLI install commands may not be accurate across systems — DSH will figure it out for you.
或使用命令行安装(适合开发者)Or use CLI install (for developers)
命令行安装CLI Install
dsh plugin --profile web add github:qianshe/dsh-assistant-optimization
把 qianshe/dsh-assistant-optimization 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-assistant-optimization
A DSH plugin for the web profile that makes model output easier to read and your prompts easier to write.
Features
Five capabilities, all plug-and-play. Official rendering is never replaced — the plugin shadows DSH components and delegates back to them, so Markdown, tool cards, images, and tables keep working exactly as shipped.
| Capability | What it does | |
|---|---|---|
| 💭 | Reasoning fold | Collapses mis-rendered chain-of-thought into the native "Think" block |
| 📊 | Mermaid diagrams | Renders mermaid code blocks as interactive SVG (zoom / pan / touch) |
| ✎ | Edit diff counts | Shows +10/-2 on collapsed Write & Edit rows, no expand needed |
| ✨ | Prompt enhance | Rewrites a rough draft into a clearer instruction in one click |
| 🛰️ | Semantic search | context_search — locate code from a vague description (Windsurf-backed) |
Reasoning fold
Some providers (OpenAI-compatible APIs with no dedicated reasoning_content channel) dump chain-of-thought into the regular text stream:
The user wants to know about X, I should explain Y first...
</thinking>
Here is the answer to your question...
DSH renders that as a single block. This plugin splits it at configurable markers so the reasoning folds into the native "Think" disclosure and only the answer stays visible. Manage the markers under Settings → General → Thinking Tag Markers.
Mermaid diagrams
Mermaid code blocks render inline as interactive SVG. Toolbar buttons zoom and reset, the scroll wheel zooms, and mouse or touch drag pans.
Edit diff counts
Write and Edit rows carry a +N (added) / -N (removed) badge right after the file path, visible without expanding the row. A failed edit produces no diff, so it gets no badge.
Prompt enhance
A sparkle button sits left of the send button and rewrites a rough draft into a clearer instruction using the model already selected in the composer. It sends one plain chat request — no session, nothing logged — and replaces the draft in place, so Ctrl/Cmd+Z undoes it.
While running it shows a spinning arc and "增强中"; on success a green check; on failure the icon flashes red with the reason in its tooltip and the draft is never cleared. The tooltip also reports how much context the last call actually received — the first thing to check when a rewrite is unhelpful.
Semantic search (context_search)
A host-side tool for vague or unclear searches: pass a natural-language query and get back the matching files with their line ranges and code. It runs an agentic search loop built on the fast-context approach and driven by a Windsurf key.
Key gating — the whole point. The tool and its one-line prompt guidance are registered only when a Windsurf key resolves. With no key, nothing is registered, so the model is never told about a tool it cannot call.
The key is resolved in this order (first hit wins): WINDSURF_API_KEY env → manual entry (Settings → General → Windsurf API Key, stored at ~/.dsh/dsao-windsurf-key, 0600) → local auto-read from the logged-in Windsurf/Devin editor's state.vscdb. DSAO_FC_AUTO_KEY=0 disables auto-read. See lib/fast-context/NOTICE.md for the non-official protocol note.
Installation
dsh plugin --profile web add github:qianshe/dsh-assistant-optimization
dsh web
Open http://127.0.0.1:3080 — the plugin activates automatically. A restart is required after install, update, and removal.
| From source | dsh plugin --profile web add . |
| Update | dsh plugin --profile web update dsh-assistant-optimization |
| Uninstall | dsh plugin --profile web remove dsh-assistant-optimization |
Configuration
| Setting | Default | Description |
|---|---|---|
| Thinking Tag Markers | ["</thinking>"] |
Strings that split reasoning from body text. Multiple supported. Edit at Settings → General. |
| Windsurf API Key | — | Credential for context_search. See key resolution above. No key ⇒ tool not registered. |
Requirements
- DSH (DeepSeek Harness) with the web profile
- Internet access only for the mermaid.js CDN, and only when a diagram is present
Development
node test/diff-stats.test.mjs
node test/ensure-badge.test.mjs
node test/context.test.mjs
node test/prompt-enhance.test.mjs
node test/host-prompt-enhance.test.mjs
node test/fast-context-gate.test.mjs
node test/content-embed.test.mjs
node --check lib/client.js
Tests load shipped modules from lib/client.js / lib/index.js. For slot keys, priorities, the reference-extraction contract, the failure-status map, and the full file structure, see docs/technical-reference.md.
License
MIT
nexu-io/open-design
ruvnet/ruflo
amruthpillai/reactive-resume
esengine/DeepSeek-Reasonix
volcengine/OpenViking
Molunerfinn/PicGo
titanwings/distilly
titanwings/colleague-skill