@xuce/dsh-prompt-enhancer
English | 中文
One-click prompt enhancement for the dsh composer. The plugin adds a compact 增强 / Enhance button immediately to the right of the permission selector in the chat input box. One click rewrites the current draft into a goal-clear, constraint-explicit, verifiable prompt through the configured model route and swaps the result back into the editor.
What it does
- Host half (
lib/index.js): a Typert Remote service (promptEnhancer/enhance) that streams one rewriter call throughctx.llmon the composition's default model route (or an explicitly configured provider/model) and returns the enhanced prompt. - Client half (
lib/client.js): registers thepromptEnhancerRemote contribution, thezh/endictionaries, and a small composer control in theconversation.input.leftslot — the position directly right of the permission selector. - Behavior: empty draft → the button reminds you to write something first; while the model runs the icon spins; on success the draft is replaced and the icon pulses a check; on failure the tooltip carries the reason.
Installation
The plugin is mounted as an ordinary profile row, so it survives app upgrades and applies live through profile HMR (no restart).
Keep this directory in place (
~/.dsh/plugins/dsh-prompt-enhancer).Append one row to your profile patch layer. The home-level file
~/.dsh/cordis.patch.ymlcovers every profile:- insert: - id: prompt-enhancer name: "file:///C:/Users/<you>/.dsh/plugins/dsh-prompt-enhancer/lib/index.js" config: timeoutMs: 90000 maxInputBytes: 32768 maxOutputTokens: 8192Adjust the absolute path to wherever this package lives. A per-profile
cordis.patch.ymlworks the same way.Save the file — HMR recomposes the profile and the button appears in the composer tool row beside the permission selector.
Configuration
| Field | Default | Meaning |
|---|---|---|
provider / model |
the composition's default model selection | Explicit rewrite route; set both or neither. |
reasoningEffort |
the route's own effort | Optional override. |
timeoutMs |
90000 |
One-call timeout in milliseconds. |
maxInputBytes |
32768 |
Draft byte cap before the call is refused. |
maxOutputTokens |
8192 |
Rewriter output cap. |
Uninstall
Remove the prompt-enhancer row from the patch file (and this directory). The
recomposition removes the button; nothing else is touched.
Notes
- The rewrite call never enters the conversation transcript; it is one
auxiliary model call with
purposeunset and no tools. - The host route defaults to the model picker's current default
(
agentDefaultModel), so switching models in the UI switches the rewriter too. - Zero dependencies by design. A patch-row plugin lives outside the
installation tree, so the app's runtime resolution (which covers only the
installation roots) cannot resolve
@deepseek-ai/*specifiers for it. The host half therefore imports nothing: it registers its Typert Remote surface by hand (typertRemotebinding plus the versioned Remote-method marker the Gateway's source-mode discovery reads), provides the service throughctx.reflect.provide, and assembles the onectx.llm.stream()request inline. The client half uses only the shell's static seed words (react,react/jsx-runtime,@deepseek-ai/dsh-client-ui-primitives). - After editing
lib/*.js, the running app does not hot-reload module files (profile HMR watches configuration only). Remove theprompt-enhancerrow from the patch, save, then add it back — the fresh entry re-imports the module.
No comments yet. Be the first to write one.