rg2304luyue/dsh-pa ↗★ 0

dsh-pa

一键将草稿重写为精准提示词并支持撤销 适合在输入框中快速润色、优化提示词的DSH用户。

包名
dsh-pa
兼容性
待验证
版本
0.4.3
许可证
MIT
最近更新
2026年10月23日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:rg2304luyue/dsh-pa

Usage

Type a draft, then click the diamond left of the model selector:

  1. Local guards run first. An empty draft, a draft whose phase is submitting or adjudicating, a draft that already looks like a finished prompt, and a runtime without setDraft all leave the button idled with a tooltip naming the reason — no request is spent.
  2. While the rewrite runs the diamond pulses and is not clickable. Your draft is untouched until the answer arrives.
  3. The answer replaces the composer text in place and the diamond turns active. A screen-reader announcement says how to undo.
  4. Click the diamond again: the original returns character for character and the button idles. Click a third time: the cached result comes back in well under a second, with no model call.
  5. If you edit the enhanced text by hand, the stored original is dropped — the next click re-enhances the new text instead of resurrecting stale content.

The plugin never submits, and it never touches attachments, the queue, or the session history. Nothing is sent to the conversation until you press send yourself.

Configuration

Every tunable lives in the plugin's Config (a hand-written ~standard schema), so it can change without editing the source and the setting survives plugin upgrades. The bundle already inserts the row, so add an entry with the same id to your profile's user layer (cordis.patch.yml), which applies after every bundle layer:

- id: dsh-pa
  name: dsh-pa
  config:
    model: ''            # '' = follow the session's selected model
    temperature: 0
    timeoutMs: 120000
    maxDraftChars: 24000
    structuredMinChars: 800
    cacheTtlMs: 300000

Any key you omit keeps its default (Config accepts a partial object).

KeyDefaultDescription
model''provider or provider/model used for the rewrite, e.g. deepseek-official/deepseek-flash. Empty follows the composer's current selection; when neither resolves, the host half falls back to the first configured provider
temperature0Sampling temperature, 0–2. Low values keep a repeated draft's wording and shape stable
timeoutMs120000Deadline for one rewrite, 5 s – 10 min. A timeout answers 504 ABORTED
maxDraftChars24000Longer drafts are rejected with 413 DRAFT_TOO_LARGE rather than truncated — truncation would change your meaning
structuredMinChars800Length at which a draft counts as a finished prompt and the diamond idles. 0 removes only the length shortcut; a draft that still carries both list markers and an output expectation stays skipped
cacheTtlMs300000How long one draft's rewrite is reused for the same model. 0 turns the cache off

Model routing precedence: Config.model → the session's modelSelection projection → the first provider and model ctx.llm reports. If none of them resolves a route, the endpoint answers 503 NO_MODEL instead of guessing.

When a change applies: model, temperature, timeoutMs, and maxDraftChars are read per request, so they take effect immediately. structuredMinChars and cacheTtlMs are read by the browser half when the button mounts (from GET /api/dsh-pa/enhance, the same endpoint, same fences), so they apply to a button that mounts afterwards — a reload or a new session.