Skip to content
Back to search

dsh-composer-polish

DeepSeek Harness plugin: one-click ✨ polish for composer drafts — flash rewrite, auto fill-back · DeepSeek Harness 插件:输入框草稿一键 ✨ 润色,flash 改写、自动回填

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/tianji-qingtian--dsh-composer-polish/badge.svg)](/listings/tianji-qingtian--dsh-composer-polish)

HTML

<a href="/listings/tianji-qingtian--dsh-composer-polish"><img src="/api/listings/tianji-qingtian--dsh-composer-polish/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

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.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 106 lines
  1. # dsh-composer-polish
  2. One-click draft polisher for the [DeepSeek Harness](https://github.com/deepseek-ai/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.
  3. > The harness is in developer preview and iterates quickly — expect compatibility-breaking changes.
  4. > 中文说明见 [README.zh.md](README.zh.md)。
  5. ## Features
  6. - **✨ 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.
  7. - **Zero-prefix flash rewrite** — the host half rewrites the draft with a single `deepseek-v4-flash` stream (`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 via `llm.listModels`.
  8. - **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.
  9. - **Fails silent** — a failed or empty rewrite leaves the draft untouched (console log only, no toasts).
  10. - **Privacy** — the `/polish` command registers with `recordInput: false`, so the raw draft never lands in the session log; only the polished result is recorded in `command/done`.
  11. - **No custom wire protocol** — Client→Host rides the harness's built-in `commands` remote (the same channel the shipped `/` commands use).
  12. - **i18n zh/en** — button label and tooltip follow the harness `locale` service.
  13. - **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.
  14. ## Screenshots
  15. The ✨ Polish button in the composer tool row, next to the send button:
  16. ![polish button demo](imgs/demo1.png)
  17. ## Install
  18. ### Prerequisites
  19. 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`):
  20. ```sh
  21. npm install -g @deepseek-ai/dsh
  22. ```
  23. `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 …`.
  24. ### Add the bundle
  25. ```sh
  26. # 1. add the bundle to your web profile (pnpm-backed; the built lib/ artifacts
  27. # are committed in this repo, so no build script runs at install time)
  28. dsh plugin --profile web add "github:tianji-qingtian/dsh-composer-polish#v0.1.6"
  29. # 2. restart the harness with that profile — `add` only edits the profile
  30. # files; a running instance does not hot-load the new bundle
  31. dsh --profile web
  32. ```
  33. 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.
  34. ## How it works
  35. | Piece | Mechanism |
  36. | --- | --- |
  37. | 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 |
  38. | 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 |
  39. | 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 |
  40. | Result channel | handler returns `{ kind: 'success', text }`; the client reads it from `CommandExecution.result.text` and fills it back via `setDraft` |
  41. | Privacy | `recordInput: false` → `command/run` omits `args`, so the raw draft is never written to the session log |
  42. | 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 |
  43. | Draft cap | both halves cap the draft at 50 KB; longer drafts are truncated client-side before sending |
  44. ## Behavior spec (from REQUIREMENTS.md)
  45. | # | Scenario | Behavior |
  46. | --- | --- | --- |
  47. | 1 | Non-empty draft, click ✨ | read draft → flash rewrite → fill back |
  48. | 2 | Empty / whitespace-only draft | button disabled |
  49. | 3 | Rewrite fails / returns empty | draft untouched, console log only, no toast |
  50. | 4 | Rewrite in flight | button shows spinner, repeat clicks blocked |
  51. | 5 | Draft has image attachments | only the text is polished; images untouched |
  52. | 6 | Chinese / English draft | rewritten in the draft's language |
  53. | 7 | Code blocks / lists / technical terms | structure kept, code verbatim, no accuracy changes |
  54. ## Harness compatibility
  55. Built and verified against harness `0.2.0-rc.1`.
  56. The harness checks a plugin's `@deepseek-ai/dsh*` `peerDependencies` ranges both when
  57. the package is installed and when a profile starts. A plugin whose declared range does
  58. not cover the running `dsh --version` is refused or skipped (`skipping profile bundle
  59. "dsh-composer-polish": Plugin dsh-composer-polish@… is incompatible with dsh …`), which
  60. is why an outdated plugin simply disappears from the composer after a harness upgrade.
  61. v0.1.6 widens the ranges to `^0.2.0-rc.1`; the host code itself needed no change —
  62. `commands.register` (with `recordInput`), `llm.stream`, and the client-side
  63. `useInput` selector + `inputActions.setDraft` + `remote.commands.execute(sessionId,
  64. line, [])` are unchanged in 0.2.0. For the `0.1.x` harness line use tag `v0.1.5`.
  65. ## Build
  66. ```sh
  67. pnpm install
  68. pnpm build # tsdown: lib/index.js (ESM host) + lib/client.js (ModuleLoader client bundle)
  69. ```
  70. ## Known limitations
  71. - The fill-back is skipped when the draft changed during the rewrite (stale-edit guard) — by design, your newer edits always win.
  72. - 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).
  73. - 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 via `recordInput: false`.
  74. - `deepseek-v4-flash` is pinned as the rewrite model; if the harness renames model ids, the catalog fallback picks a flash-class replacement and logs a line.
  75. ## License
  76. MIT

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.