dsh-pa
Prompt enhancer for the DeepSeek Harness composer: rewrite a draft into a precise prompt, click again to restore it. 适合在输入框中快速润色、优化提示词的DSH用户。
설치
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:rg2304luyue/dsh-paUsage
Type a draft, then click the diamond left of the model selector:
- Local guards run first. An empty draft, a draft whose phase is
submittingoradjudicating, a draft that already looks like a finished prompt, and a runtime withoutsetDraftall leave the button idled with a tooltip naming the reason — no request is spent. - While the rewrite runs the diamond pulses and is not clickable. Your draft is untouched until the answer arrives.
- The answer replaces the composer text in place and the diamond turns active. A screen-reader announcement says how to undo.
- 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.
- 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).
| Key | Default | Description |
|---|---|---|
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 |
temperature | 0 | Sampling temperature, 0–2. Low values keep a repeated draft's wording and shape stable |
timeoutMs | 120000 | Deadline for one rewrite, 5 s – 10 min. A timeout answers 504 ABORTED |
maxDraftChars | 24000 | Longer drafts are rejected with 413 DRAFT_TOO_LARGE rather than truncated — truncation would change your meaning |
structuredMinChars | 800 | Length 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 |
cacheTtlMs | 300000 | How 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.