dsh-select-assist: Select-to-Act on Windows System-wide with DSH to Explain, Summarize, Translate, and Read Aloud

Preface

When researching or writing prompts in DeepSeek Harness (DSH), users frequently select text in browsers, IDEs, documents, or chat windows to query the model. Copying text into the sidebar for discussion clarifies the query but interrupts the current workflow and can disrupt the clipboard. Third-party selection tools often rely on browser overlays or persistent background processes, which may not align with DSH’s native models and themes.

This document introduces the community plugin Selection Assistant (package name dsh-select-assist, maintained by germyGao). It provides system-level text selection capabilities on Windows: users can select text in any application to trigger a menu, allowing DSH to explain, summarize, translate, or read aloud the content. Results appear in a draggable, resizable, always-on-top native floating window. By default, it utilizes UI Automation for text acquisition to avoid polluting the current DSH conversation. The plugin is categorized as a Client plugin and can be found in the SkillHub Directory. Source code and documentation are available on GitHub (MIT License, current version 0.9.0). SkillHub is a community ecosystem and is not officially affiliated with DeepSeek or High-Flyer.

What is this

dsh-select-assist is a bundle plugin for DSH. The Cordis side registers the API and settings page, while a Companion Process (Node + DSH’s built-in koffi FFI) handles global mouse gestures, UI Automation text acquisition, and Win32 layered windows with GDI+ rendering for the menu and answer panel. Build artifacts are committed to the repository, so no local compilation is required when installing from GitHub. It has no additional runtime dependencies and does not launch browser processes.

This project is an extension of fyisgod/dsh-selection-tools (MIT). It adds summarization, direct engine connection, text-to-speech (TTS), and a four-item selection menu, while fixing issues such as occasional menu failure to appear and fixed answer window positions.

Core Features

System-level Selection & Four-item Menu

After dragging or double-clicking to select text in any Windows application, a horizontal menu pops up in the fourth quadrant, anchored to the bottom-right corner of the selection area: Explain / Summarize / Translate / Read Aloud. Clicking an item opens an always-on-top floating window that displays the answer via streaming (Explain, Summarize, and Translate use the model; Read Aloud uses Windows SAPI to read the original selected text).

The menu has a default timeout of 3.6 seconds and can be dismissed by pressing Esc or clicking elsewhere. The menu appears only once per unique selection; if dismissed, it will not reappear for the same selection until a new selection is made. The answer window is independent of the menu: it remains visible until closed via the title bar button, and new selections will not automatically close existing answer windows.

Text Acquisition, Context, and Clipboard Policy

When the mouse gesture is released, the primary path uses UI Automation to read both the “selected text” and the “paragraph containing the selection” in a single pass. This provides automatic context (similar to “explain selection with paragraph context”). The selection and context are passed to the model only when a menu item is clicked. throughout the process, the clipboard is avoided as much as possible—the menu appears immediately upon gesture release and does not rely on “Ctrl+C to copy text before showing the menu.”

A Ctrl+C injection may occur only as a fallback when UIA cannot read the selection or to verify if text is actually selected. In such cases, it attempts to restore the user’s original clipboard. The plugin will not write to the clipboard if the user is currently pressing Ctrl+C or copying manually during the acquisition process. The environment variable DSH_SELECTION_CONFIRM=0 can disable certain confirmation-based clipboard injections. Console windows are skipped by default to prevent Ctrl+C from being interpreted as an interrupt signal.

Summary, Translation, and Floating Window Interaction

Summarize: Provides a one-sentence core conclusion followed by bullet points; preserves hierarchy if the original text has sections or lists. Translate: Words/phrases are handled with dictionary-style output (best translation, phonetic transcription, alternative translations); sentences/paragraphs provide a full translation, with key terminology notes added if necessary. Rules and default translation languages can be modified in the settings page.

The answer window’s title bar (right to left) offers buttons to close, copy the answer, and read the original text aloud. The window is draggable and resizable from all sides and corners. The system-level overlay uses GDI+ to render a “markdown-lite” style; for selections within the DSH page itself, it falls back to the shell.overlay path using official Markdown rendering, automatically yielding if the system-level method is unavailable.

Two Answer Engines

In “Settings → Selection Tools,” you can switch the engine:

Mode Behavior Trade-offs
direct (Default) Plugin streams model calls via the host llm service, without creating a DSH session. Low latency, true streaming; no system prompts or tools; selection does not appear in the sidebar; no click-through for follow-ups.
agent Runs a full agent turn via ctx.agents. Each selection creates a new session, not archived after completion. Requires waiting for the full turn for the first token; supports full conversation and tool capabilities; allows follow-ups in the sidebar “Ungrouped” section.

Settings such as TTS speed, volume, and the models and reasoning levels used for Explain/Summarize/Translate are configured on the same page and written to DSH_HOME/dsh-select-assist.json. Changes take effect immediately.

Installation & Activation

The official recommendation is to install via a one-line command from GitHub (use the complete command provided):

dsh plugin --profile web add "github:germyGao/dsh-select-assist"

If you have the repository locally, you can run dsh plugin --profile web add . in that directory. Restart dsh web (or restart the desktop client hosting it) after installation for the bundle to be composed at startup.

Uninstallation and Updates:

dsh plugin --profile web remove dsh-select-assist
dsh plugin --profile web update

Self-check for Companion Process and API readiness:

curl http://127.0.0.1:3080/api/dsh-select-assist/ping
curl http://127.0.0.1:3080/api/dsh-select-assist/system/status

In system/status, the companion.state should be running. If only Companion process or overlay code is changed, you can restart the Companion process via POST /api/dsh-select-assist/system/restart without restarting the entire DSH (see the repository README for details).

Typical Usage

  1. Ensure DSH has the plugin installed via the command above and dsh web has been restarted.
  2. Drag-select or double-click select a piece of text in Notepad, a browser, or an IDE, and wait for the four-item menu to appear at the bottom right.
  3. Click Explain, Summarize, or Translate to view streaming results in the always-on-top floating window. For follow-up questions, switch to the agent engine in settings and open the corresponding session in the sidebar.
  4. Click Read Aloud to hear the original text. To change the target language or prompts, open DSH Settings → Selection Tools to adjust rules and models.
  5. If you only select text within the DSH window, or if system-level capabilities are disabled or koffi is not installed, the same menu will be handled by the in-page overlay.

Scenarios & Notes

This plugin is suitable for long-term DSH users on Windows dealing with reading tasks: quick word lookups, getting key points from long articles, or translating paragraphs, where results are desired to float above the current application with minimal clipboard and sidebar interruption. The plugin runs with the permissions of the current dsh process. The Companion process listens to global mouse events and calls UIA. Before installation, it is recommended to review the source code and MIT license, and to assess whether your enterprise environment or sensitive applications allow such capabilities.

Platform: Windows only (marked as platform-Windows in README badges and description). Category: Client-side plugin, requires the --profile web installation path and works in conjunction with DSH Web/Desktop.

Some applications (like certain versions of WPS Qt) have incomplete UIA support and may rely more on clipboard fallback or degrade context to selection-only; Chromium-based apps may require a short delay and retry for the first UIA read. These behaviors are detailed in the repository’s “What it does” and “Capability Surface” sections. For troubleshooting, refer to lastCapture and lastResolve in /api/dsh-select-assist/system/status.

Conclusion

dsh-select-assist connects DSH’s Explain, Summarize, Translate, and Read Aloud capabilities to global Windows selections: native always-on-top floating windows, UI Automation as the primary path for text and paragraph context acquisition, optional direct or agent engines, and a fallback for in-page selection. To try it locally, install via the official command from the directory page or GitHub and restart dsh web.

  • Directory Page: https://www.skillhub.cn/plugins/germyGao/dsh-select-assist
  • GitHub: https://github.com/germyGao/dsh-select-assist
羽毛球分组比赛记分
小程序二维码

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

Xiaoye