dsh-qoder-input
A DeepSeek Harness composer plugin: a one-click prompt-rewrite button for the chat input.
给 DeepSeek Harness 的聊天输入框加一个「✨ 增强提示词」按钮。
⚠️ Compatibility / 兼容性警告
Read this before installing. / 装之前请先读完这一段。
- Tested on DeepSeek Harness 0.2.1-rc.3 (Electron 44.7.0, Windows).
- This plugin uses undocumented host APIs that are not part of a stable public contract:
- composer slots
conversation.input.right,conversation.input.overlay - the
useInputselector hook andinputActions.setDraft ctx.connection.fetch.registerfor the two local routesctx.llmfor the rewrite call
- composer slots
- DSH boots all-or-nothing: if one plugin fails to activate, the whole app refuses to start. So on an incompatible DSH version this plugin may make DSH unable to launch.
- 本插件使用宿主的未公开内部接口。DSH 启动是「全有或全无」:任一插件激活失败会导致整个应用无法启动。升级 DSH 后本插件可能失效,极端情况下会导致 DSH 打不开。
If DSH stops launching after enabling this plugin / 启用后打不开怎么办
Edit ~/.dsh/profiles/<your-profile>/package.json and remove the two dsh-qoder-input lines:
- the dependency entry under
"dependencies" - the entry in
"dsh".profile.bundles
Then start DSH again. (Removing only the bundles entry is enough; keeping the dependency line avoids a re-resolve.)
编辑 ~/.dsh/profiles/<你的 profile>/package.json,删掉 dsh-qoder-input 的两行登记(dependencies 里一行、dsh.profile.bundles 里一行),再启动 DSH 即可。只删 bundles 那行就足够恢复启动。
Features / 功能
1. ✨ Enhance prompt / 增强提示词(已验证 / verified)
A ✨ button in the composer's right-hand toolbar (conversation.input.right).
- Disabled while the draft is empty.
- Click it: the current draft is sent to
/api/qoder-input.enhance, rewritten by the host LLM with the currently selected session model, and written back into the composer. - The button turns into 「撤销增强」/ Undo enhance for 15 seconds — one click restores the original draft.
输入框为空时按钮置灰;点击后把当前草稿交给宿主模型改写并写回输入框;15 秒内可点「撤销增强」还原原文。
2. Voice-draft auto clean-up / 语音转写自动去口语化(实验性 / experimental)
An conversation.input.overlay effect that watches the draft and, when a single large insertion appears (previous frame empty → new frame ≥ 20 characters), calls /api/qoder-input.polish and writes the cleaned text back.
- Typing character by character does not trigger it (by design: previous frame is never empty).
- This path is experimental: the button above has been exercised end-to-end; the auto clean-up path has not been regression-tested against real speech-to-text input in every case.
这条链路按「一次性写入 ≥20 字」判定语音转写,逐字打字不会触发。标记为实验性:按钮功能已端到端验证,自动整理尚未在各种真实语音场景下逐一回归。
Install / 安装
From the DSH plugin market (once listed), or via CLI:
dsh plugin --profile desktop add dsh-qoder-input
Then fully quit and restart DSH (this plugin's profile has HMR disabled).
安装后需要完全退出并重启 DSH。
How it works / 实现
Host half (lib/index.js):
POST /api/qoder-input.enhance— rewrites a draft into a more precise, executable prompt.POST /api/qoder-input.polish— turns a voice transcript into clean text (removes filler words, repetitions, self-corrections).- Both call
ctx.llm.stream(...)with the session's selected model, collecttext-deltaframes, and return{ ok, value: { text, changed } }. - Failures are returned as
{ changed: false, degraded: true }— the draft is left untouched instead of showing an error.
Client half (lib/client.js):
- Registers the
✨button intoconversation.input.right(list slot,id+order). - Registers the auto clean-up effect into
conversation.input.overlay. - Subscribes to the composer draft with
useInput(selector)and writes back withinputActions.setDraft(...).
Notes / 说明
- No API keys, no telemetry, no network calls other than the host's own LLM route.
- Requires a working model route in DSH. If the default route is unavailable, requests degrade silently and the draft is unchanged.
- 不需要任何 API key,不上报数据;除宿主自己的模型调用外不发任何网络请求。
License
MIT — see LICENSE.
No comments yet. Be the first to write one.