dsh-prompt-suggestion: Next-Step Prompt Prediction in Composer

Preface

When engaging in multi-turn conversations with agents in DSH, formulating the next prompt often requires reviewing the previous round’s results: adding constraints, changing direction, or continuing to break down tasks. The Composer itself is blank; it lacks the layer of “guessing what you will say next based on context.” Products like Claude Code use gray ghost text in the input box to provide predictions, which can be accepted with the Tab key to continue editing. dsh-prompt-suggestion brings similar capabilities to the DSH Composer: after each task round ends, when the input box is empty, it displays the model’s predicted next user prompt, accompanied by historical prefix completion and a dedicated settings page. The following section covers installation, operation, and implementation highlights.

What is this

dsh-prompt-suggestion is a community-maintained DSH bundle, hosted at GoldenLoaf24h/dsh-prompt-suggestion and categorized under “Model Inference” in the SkillHub directory. When a conversation round ends, the input box is empty, there are no command chips, and the session is not running, the plugin calls a helper model to generate a “next user prompt.” This is displayed as gray ghost text within the input box. Additionally, it offers historical prefix completion based on prompts already sent in the current session, which does not obstruct the prediction feature. It is written in pure JavaScript with no build step and zero third-party runtime dependencies. The package.json version is 0.1.0, licensed under MIT, and requires Node >=22.0.0.

Core Features

Next Step Prediction and Acceptance

Predictions appear as gray text appended to the end of the Composer. You can use the shortcuts listed in the table below (consistent with the README behavior table):

Action Result
Tab Fills the entire prediction into the input box (can be further edited, not sent)
Alt + → Fills the prediction word by word; the remainder stays as gray text
Enter Fills the prediction and sends it immediately (can be disabled in settings)
Esc Ignores the current prediction and marks it so no further prompts appear for this round
Typing directly The prediction disappears automatically; it reappears if you erase back to the original state
Alt + R Fetch a new prediction (the old one is passed to the model as a “do not repeat” signal)
↑ When the input box is empty, fills in the last sent prompt from the current session (gray text returns after clearing)

Accepting with Tab only affects the current screen view; refreshing the page will still show the same cached prediction. Only Esc marks the round as “do not prompt again” and persists this to disk.

Historical Prefix Completion

After typing a few characters, if a prompt starting with that prefix has been sent in the current session, the remaining part will be suggested as gray text, which can also be accepted with Tab. Prediction and completion do not interfere with each other: if the prediction no longer matches the current input, it automatically yields to completion.

Appearance Conditions and Caching

Predictions only appear when a task round has ended, the input box is empty, there are no command chips, and the session is not running. Repeated requests for the same round hit the disk cache without calling the model again. Opening a session only reads the cache with zero model calls; a real call is made only if the cache is missing (e.g., the session predates the plugin installation, or the entry has expired). If the supplementary call fails, it automatically retries once after one minute. Failures (timeouts, empty model returns) are held in memory for one minute only and not written to disk; they will be retried upon restart.

Settings Page

Under “Plugins → Prompt Suggestion,” you can modify the following items. All settings are persisted to ~/.dsh/plugin-data/dsh-prompt-suggestion/settings.json:

  • Enable Next Step Prediction — Master switch
  • Model Provider / Model — Leave empty to follow the route actually used by the current session; if a provider is selected, the model becomes a dropdown with options from that adapter’s directory
  • Thinking Effort — Auto (Eco) or explicit off / low / high / max
  • Alt + → Word-by-word Accept / Enter Accept & Send / Historical Prefix Completion / ↑ Fill Last Sent — Four independent switches
  • Generation Parameters — Max prediction length, timeout, output limit, number of recent messages to include, context character limit
  • Context Sanitization — Scrub secrets, tokens, passwords, and other sensitive strings before sending to the model
  • Recent Predictions — The original text, latency, and model used for the last few entries

The bundle-level cordis.patch.yml is also configurable:

- id: prompt-suggestion
  name: dsh-prompt-suggestion
  config:
    enabled: true   # Equivalent to the switch in the settings page; settings page takes precedence

Installation and Activation

This directory is a standard DSH bundle (dsh.bundle.patch points to cordis.patch.yml). The official README provides three methods:

  1. Desktop Plugin Panel (desktop profile, Electron exclusive): Plugins → Add Plugin → Enter the absolute path of this directory, or github:GoldenLoaf24h/dsh-prompt-suggestion
  2. CLI (Non-desktop profiles):
dsh plugin --profile <profile> add github:GoldenLoaf24h/dsh-prompt-suggestion
  1. Inside an Agent Session:
plugin_manager({action:'install_bundle', target:'github:GoldenLoaf24h/dsh-prompt-suggestion'})

Once installed, dsh.profile.bundles in package.json will be automatically registered. Changes to lib/index.js require turning the plugin off and on in the plugin panel (the host does not support hot-reloading); changes to lib/client.js only require a page refresh.

Typical Usage

  1. Install and enable the plugin, and ensure “Enable Next Step Prediction” is turned on in the settings page (or consistent with the bundle’s config.enabled).
  2. Complete a normal conversation round in DSH; wait for the task to finish and the input box to become empty. If conditions are met, you should see gray prediction text.
  3. Press Tab to fill in the full sentence draft if you need to edit it; press Alt + → to accept word-by-word if you want to fill it while thinking.
  4. If the prediction is unsuitable, press Alt + R to swap for a new one, or press Esc to ignore it and prevent further prompts for this round.
  5. If you frequently repeat similar openings, simply type the prefix, observe the gray text for historical completion, and use Tab to accept it.

Use Cases and Notes

This is suitable for users engaged in long-term multi-turn coding, troubleshooting, or prompt writing within DSH: it reduces the pause of “staring at a blank box thinking about the next sentence” while retaining control to edit before sending. The helper call reads the session transcript (trimmed by both message count and character budgets) and can enable context sanitization in settings. However, you should still assume the plugin runs with the permissions of the current DSH process. Please review the Repository Source Code and the MIT license before installation. Custom HTTP routes do not pass through host cookie authentication; the implementation includes Origin / Sec-Fetch-Site same-origin validation.

In terms of implementation, the host provides routes such as /suggest, /session, /dismiss, /catalog, and /settings in lib/index.js, sending helper calls via ctx.llm.prepareCall and call.stream. The client registers conversation.input.overlay and plugins.bundle.config slots in lib/client.js. The gray text is passed via the CSS custom property --dsh-ps-ghost on the editor to accommodate DOM behavior when Lexical rebuilds paragraphs.

Conclusion

dsh-prompt-suggestion turns “the next user prompt” into ghost text within the Composer and configurable shortcuts, distinguishing between disk caching, memory-based failure retries, and Esc-based persistent ignoring. See the SkillHub Plugin Page for a directory introduction, and the GitHub Repository for source code and complete behavior descriptions.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye