Rewrites drafts with one model call or predicts the next reply when empty; independent tasks, safe draft replacement, result previews, and original-text recovery.
Install
# from a prebuilt release tarball
dsh plugin --profile web add -w "https://github.com/Zian-anson/dsh-prompt-seed/releases/download/v0.21.1/dsh-prompt-seed-0.21.1.tgz"
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:Zian-anson/dsh-prompt-seed
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
English | 简体中文
One contextual DSH composer entry: ✦ Optimize when the draft has content; 🔮 Crystal ball when empty. The tools improve the draft or predict the user's most likely next reply. Neither sends messages.
Version 0.21.1. See acceptance evidence for model quality, real-UI verification and known limitations.
Rewrite with useful substance
Short drafts gain essential execution details, boundaries and proportionate verification. Long spoken drafts become organized and shorter. Precise requests stay concise. Preserve intent, scope, facts, authorization, language, numbers, technical names and negative requirements—including “discuss only, do not implement.” Do not invent features, metrics or an unchosen stack.
After generation, Another version uses the round's original draft, not the previous rewrite. Manual edits start a new round on the next click. Use ⋯ → Restore original directly while untouched; after editing, preview it before explicitly replacing the draft. Empty input, greetings and pure confirmations make no call. Unchanged results say “Unchanged,” distinct from improvement and failure.
Predict the reply, not a recommended action
Crystal ball is available when the composer is empty, the conversation has an assistant reply and the assistant is idle. It uses recent conversation and user style to suggest one short reply: acknowledgement, question, correction, extra information or continuation. With insufficient evidence it reports “Unable to predict for now.” Blank conversations make no call. After a prediction fills the draft, the main icon switches to Optimize. ⋯ offers Another reply and Withdraw while the candidate is untouched; editing removes those actions.
Success has no persistent text; a spinner indicates progress. Failure and unchanged results use short labels with details on hover. ⋯ appears only when recovery, background cancellation or a retained result is available. Switching the icon does not cancel either feature’s job.
Independent features, safe drafts
Each feature owns its prompt, context strategy, controller, task state, result and undo. Only connection, task storage, timeout and safe-write primitives are shared.
- At most one model call per generation; no hidden retries, repair calls or semantic judge.
- Jobs are scoped by conversation and kind. Switching, unmounting or disconnecting never cancels them; explicit cancellation only affects its own kind.
- Automatic application requires the same conversation, editable input and unchanged draft revision, semantic references and attachments. Editing and reverting to the same text still prevents overwrite.
- When unchanged state cannot be proved, including reload/remount, results remain available in a preview with explicit Replace draft.
- Reference chips use the host's semantic draft API. Unsafe reconstruction or newly inserted incompatible chips makes the result preview-only. Text writes do not change attachments.
- Each conversation retains its latest rewrite original/candidate across edits and switches. Confirmed submission clears recovery; submission failure retains it. Draft persistence remains host-owned; recovery records live in the browser tab.
- Existing session IDs, including blank sessions, are reused without creating a session or changing its title. A truly unbound draft starts generation first, then asynchronously creates a necessary session and binds that same job, without stealing navigation.
- Host jobs have a ten-minute in-memory retention period. Host restart removes stale running state cleanly.
Install
Published release:
dsh plugin --profile <name> add \
https://github.com/Zian-anson/dsh-prompt-seed/releases/download/v0.21.1/dsh-prompt-seed-0.21.1.tgz
For a local candidate, run npm pack, then dsh plugin --profile <name> add ./dsh-prompt-seed-0.21.1.tgz.
Keep the previous package for recovery and restart DSH while idle after Host changes. Use the compatible CLI bundled with Desktop. Do not edit the installed copy.
Remove with dsh plugin --profile <name> remove dsh-prompt-seed.
Config
config:
route: /api/prompt-seed/optimize
# provider / model: specify both, or follow the Host default selection
requestTimeoutMs: 20000
context: true
samples: true
templates: true
# ui:
# button: true # 0.21.1: set false when another package owns the optimize entry; the crystal ball stays
User templates in $DSH_HOME/prompt-seed/prompts/ remain intact: optimize.md takes precedence, then legacy seed.md.
Existing clarify, precise and chat files are preserved but are not selected by the single rewrite contract.
Local sample logs contain input/output previews and are never automatically uploaded; samples:false disables them.
HTTP compatibility
POST /api/prompt-seed/optimize remains loopback-only and requires application/json.
{ "action": "optimize", "kind": "optimize", "text": "...", "sessionId": "...", "stream": true }
Actions: optimize / predict / status / bind / cancel / consume. Queries and binding default to optimize when kind is omitted. New clients pass "optimize" or "predict". Cancellation/consumption retain legacy jobId-only calls; an explicit kind validates ownership.
Both generators accept stream:true and return NDJSON meta / delta / final events with jobId and kind.
Nonstream optimize retains its final JSON. Nonstream predict retains {ok:true,text} or {ok:false,code,error} without requiring new fields.
Status adds protocolVersion:2, ui.composerButton, context availability and the last persisted user-message identifier, not chat content. ?debug=1 adds diagnostics to nonstream optimize.
Failures, empty/truncated results and lost explicit full paths/files/URLs/identifiers never overwrite the draft.
Development and acceptance
Node ≥22.19; zero runtime dependencies, no install step needed.
npm test # builds lib/, runs 68 tests and documentation/install guards
npm run bench -- --dsh <compatible-dsh-command> --profile web
node tools/quality-judge.mjs bench/latest.json # offline review sheet, no model call
| Validation | Count |
|---|---|
| Real-socket checks | ✅ 13 checks, run by npm test |
src/ is authoritative; rebuild lib/ after editing. Behavioral tests drive the shipped toolbar/controller with controllable drafts, sessions and model streams rather than checking function names.
bench/corpus.json contains 30 rewrite cases; bench/predict-corpus.json contains 10 contextual prediction cases.
The benchmark temporarily loads a development-only plugin into a separate web Host and uses DSH's llm service and templates. It never reads credentials or calls a provider directly. Synthetic context stays in fixtures, not user sessions; the benchmark entry is not packaged.
The test Host must already have a working model connection. Desktop-account evaluation requires explicit temporary-loading approval; see benchmark setup.
Options: --start, --limit, --out, --provider, --model.
Measure both features separately, excluding zero-call cases: p50 ≤3 seconds, p95 ≤8 seconds. At least 80% of improvable rewrite cases should gain useful substance without distortion. Synonyms, politeness and filler do not count; precise originals may remain unchanged. Judge predictions by whether the user might plausibly reply that way, not whether they advance the task. Model evaluation and static checks do not replace real DSH clicks.
Limits
A model can be slow or wrong. Idle timeout is 15 seconds; the default total Host budget is 20 seconds. Rewrite context favors newest messages: up to 3 user turns and 2 assistant tails, 1400 characters total. Prediction has its own six-turn window. Without reliable revision/semantic APIs, results remain preview-only.
DSH 0.2.1-rc.2 does not persist unsent image attachments across app restart. Rewriting preserves them, but after restarting, reattach the original images. Text and reference chips use host-owned draft recovery; see acceptance evidence.
MIT.
Links
More in this category
zhu1090093659/dsh-web#packages/dsh-task-board★ 10686
Task board for the dsh web GUI: a sidebar multi-column kanban whose cards run in real DSH agent sessions and can also be scheduled with cron expressions, executed host-side even with the browser closed.
zhu1090093659/dsh-web#packages/dsh-web-all★ 10686
Plugin and skin collection for the DSH Web UI: task board, Git graph, right-side panel, remote mobile UI, pet, live token stats, and a skin center.
ccch1mneyyy/dsh-TUI★ 8436
Claude Code-style full-screen terminal UI: pixel-whale header, live status line, and streaming thought expansion.
MeteorNOX/DeepSeek-Balance-Whale-Widget★ 7504
A fixed-corner whale widget for the DSH web GUI — balance, today's usage and per-turn cost with peak/off-peak pricing, editable balance-alert and daily-budget bubbles, a module-based custom bubble queue with A/B weighted choices and random lines or images, 30+ vendor templates (OpenAI, OpenRouter, Kimi, SiliconFlow, Ark, Zhipu, MiniMax and more) with per-model balance and subscription quota, plus task-end sound, imported audio, custom roles and a resource manager. Local-only, no telemetry.
omdsh-dev/DSH-better-sidebar★ 5379
Full sidebar workbench with file rendering and editing, terminal, Git, and subagents; third-party plugins can register new tabs.
omdsh-dev/dsh-genui★ 1076
Interactive UI components rendered inline in replies: layout, charts, forms, quizzes, mermaid, 3D scenes, and an action event loop back to the model.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.