为 DSH Web UI 提供工作台面板,包含聊天、语法高亮编辑器、文件与 Git、终端、浏览器、控制平面和模型工具。README 要求 DeepSeek Harness 0.1.5 或更高版本;较旧宿主会拒绝安装。
编辑器
dsh-composer-polish
作者 tianji-qingtian · community
在 DSH 输入框中用 DeepSeek Flash 改写草稿并填回编辑框,用户可预览、修改后再发送;依赖宿主模型目录中的 Flash 模型。
DeepSeek Harness 插件,分类: 编辑器
安装
运行这条 DSH 插件命令前,请先审阅来源及信任等级。
dsh plugin --profile web add dsh-composer-polish来源
- 仓库
- registry — DSH Plugin Registry (independent directory) · 2026-11-05T00:15:41.406Z · 证据
- github — tianji-qingtian upstream package manifest · 2026-11-05T00:18:01.550Z · 证据
- github — tianji-qingtian upstream package manifest · 2026-11-05T22:11:29.814Z · 证据
- github — tianji-qingtian upstream package manifest · 2026-11-05T22:23:58.530Z · 证据
README
README 状态: fetch_failed — GitHub metadata HTTP 403 · 沿用旧摘录,抓取于2026-11-05T22:11:29.495Z
dsh-composer-polish
One-click draft polisher for the DeepSeek Harness (dsh) composer. Type a rambling draft, hit the ✨ 润色 / Polish button in the input tool row, and a few seconds later the polished text replaces the draft in the input box — you preview, maybe edit, then send. No scoring, no evaluations: draft in → better draft out.
The harness is in developer preview and iterates quickly — expect compatibility-breaking changes.
中文说明见 README.zh.md。
Features
- ✨ button in the tool row — sits in
conversation.input.right, the official seat for clickable controls beside the send button. Disabled while the draft is empty or pure whitespace, shows a spinner while polishing, and never lets double-clicks fire a second request. - Zero-prefix flash rewrite — the host half rewrites the draft with a single
deepseek-v4-flashstream (reasoningEffort: 'off', ~2000 token cap). The main model never runs and its prefix cache is never touched. If the pinned model id is missing from the provider catalog, it retries once with a flash-class model discovered viallm.listModels. - Fill-back, not chat — the polished text goes straight into the input box through
inputActions.setDraft, the official public draft write path. You can edit it again or polish a second time; nothing is sent until you press send. Image attachments are never touched — only the text is replaced. - Fails silent — a failed or empty rewrite leaves the draft untouched (console log only, no toasts).
- Privacy — the
/polishcommand registers withrecordInput: false, so the raw draft never lands in the session log; only the polished result is recorded incommand/done. - No custom wire protocol — Client→Host rides the harness's built-in
commandsremote (the same channel the shipped/commands use). - i18n zh/en — button label and tooltip follow the harness
localeservice. - Language and voice follow the draft — the rewrite answers in the draft's language and keeps the user's voice (it strips filler but won't turn the text more formal, salesy, or robotic); code blocks, file paths, command lines, identifiers, and technical terms stay verbatim.
Screenshots
The ✨ Polish button in the composer tool row, next to the send button:
Install
Prerequisites
The dsh CLI must be on your PATH. If you only ever ran the harness through npx, dsh is not installed and you will get zsh: command not found: dsh — install it globally first. This release targets harness 0.2.0-rc.1 (for an older harness use tag v0.1.5):
npm install -g @deepseek-ai/dsh
pnpm add -g @deepseek-ai/dsh also works if your pnpm global bin dir is on PATH (otherwise pnpm asks you to run pnpm setup first). Alternatively skip the global install and prefix the commands below with npx @deepseek-ai/dsh ….
Add the bundle
# 1. add the bundle to your web profile (pnpm-backed; the built lib/ artifacts
# are committed in this repo, so no build script runs at install time)
dsh plugin --profile web add "github:tianji-qingtian/dsh-composer-polish#v0.1.6"
# 2. restart the harness with that profile — `add` only edits the profile
# files; a running instance does not hot-load the new bundle
dsh --profile web
After the restart the ✨ button appears in the composer tool row, next to the send button, and the /polish command is registered once the host half loads. Verify under Settings → Plugins that dsh-composer-polish is listed.
How it works
| Piece | Mechanism |
|---|---|
| Button seat | conversation.input.right list slot (session scope); the standard kit's selector hook useInput((s) => s) reads the draft, inputActions.setDraft() writes it back |
| Client → Host | built-in commands remote, hard-injected (inject: ['remote', 'remote.commands']): ctx.remote.commands.execute(sessionId, '/polish ' + draft) — the same roundtrip the shipped slash commands use; no custom RPC |
| Host rewrite | /polish command handler → zero-prefix ctx.llm.stream on deepseek-official / deepseek-v4-flash (reasoningEffort: 'off', maxTokens 2000), one-shot, with a one-time catalog fallback when the pinned model id is unavailable |
| Result channel | handler returns { kind: 'success', text }; the client reads it from CommandExecution.result.text and fills it back via setDraft |
| Privacy | recordInput: false → command/run omits args, so the raw draft is never written to the session log |
| Stale-edit guard | the client captures draftRev at click time; if the draft changed while polishing, the result is discarded instead of clobbering newer edits |
| Draft cap | both halves cap the draft at 50 KB; longer drafts are truncated client-side before sending |
Behavior spec (from REQUIREMENTS.md)
| # | Scenario | Behavior |
|---|---|---|
| 1 | Non-empty draft, click ✨ | read draft → flash rewrite → fill back |
| 2 | Empty / whitespace-only draft | button disabled |
| 3 | Rewrite fails / returns empty | draft untouched, console log only, no toast |
| 4 | Rewrite in flight | button shows spinner, repeat clicks blocked |
| 5 | Draft has image attachments | only the text is polished; images untouched |
| 6 | Chinese / English draft | rewritten in the draft's language |
| 7 | Code blocks / lists / technical terms | structure kept, code verbatim, no accuracy changes |
Harness compatibility
Built and verified against harness 0.2.0-rc.1.
The harness checks a plugin's @deepseek-ai/dsh* peerDependencies ranges both when
the package is installed and when a profile starts. A plugin whose declared range does
not cover the running dsh --version is refused or skipped (skipping profile bundle "dsh-composer-polish": Plugin dsh-composer-polish@… is incompatible with dsh …), which
is why an outdated plugin simply disappears from the composer after a harness upgrade.
v0.1.6 widens the ranges to ^0.2.0-rc.1; the host code itself needed no change —
commands.register (with recordInput), llm.stream, and the client-side
useInput selector + inputActions.setDraft + remote.commands.execute(sessionId, line, []) are unchanged in 0.2.0. For the 0.1.x harness line use tag v0.1.5.
Build
pnpm install
pnpm build # tsdown: lib/index.js (ESM host) + lib/client.js (ModuleLoader client bundle)
Known limitations
- The fill-back is skipped when the draft changed during the rewrite (stale-edit guard) — by design, your newer edits always win.
- Drafts over 50 KB are truncated before the rewrite (a draft of that size is beyond what a single flash call can meaningfully restructure anyway).
- The polished result is recorded in
command/done(the commands channel's own lifecycle log); only the original draft is kept out of the log viarecordInput: false. deepseek-v4-flashis pinned as the rewrite model; if the harness renames model ids, the catalog fallback picks a flash-class replacement and logs a line.
License
MIT
数据截至 2026-11-05
同类插件
编辑器
dsh-at-file
在 DSH Web 撰写框输入 @,搜索当前工作区的文件和目录并插入路径引用;只发送工作区相对路径,不读取被引用文件内容。上游提示新版 DSH 已内建 @file 与 @session,插件仅以 best-effort 方式维护。
为 DSH 输入框提供草稿提示词改写和语音输入增强,包括热键、停顿检测、口语词清理与纠错;具体语音能力依赖项目实现与宿主环境。
编辑器
dsh-cc-tui
提供 DeepSeek Harness 会话、工具与代理交互的全屏终端界面,含会话管理、模型切换和终端面板;需 Node.js 与 DSH。
为 DeepSeek Harness 提供交互式终端界面,含流式 Markdown、工具卡、会话恢复、LSP 诊断与主题;需 pnpm 和 DSH 0.2.1-rc.4(next)。