dsh-select-ask: Select Text to Quote and Ask Temporarily in the Sidebar

Introduction

When conversing with models in the DSH Web UI, two common operations arise: bringing a segment of the original text into the next input to ask a follow-up question, or simply wanting to quickly ask a question about a selected fragment without starting a new session or persisting logs. Manual copy-pasting clutters the input box, while opening a sidebar session often leaves behind session and workspace records.

Below is an introduction to the community plugin dsh-select-ask (repository YizhouLouisLu/dsh-select-ask), maintained by YizhouLouisLu and categorized as a Client-side plugin. When you select text in the conversation (or in page areas outside the input box), it pops up a small toolbar supporting Quote into composer or Ask in sidebar. The sidebar is a one-off small window; closing it creates no session and writes no session logs or workspace entries.

What is this

dsh-select-ask (npm package name dsh-select-ask-plugin, version 0.1.0) is aimed at the DSH Web client: after selecting text, Quote / Ask in sidebar (in English interfaces, Quote / Ask in sidebar corresponding text see README) appear. Quoting uses the composer’s reference chips, avoiding piling large sections of original text into the draft body; the sidebar sends a single POST per turn to a host-registered route, internally performing a single tool-less ctx.llm.stream, without creating a session. The transcript exists only in the sidebar component’s state and is discarded upon closing. The model and credentials still follow the current session’s request configuration (falling back to default selections if missing), and the adapter, retry, and metering behave consistently with normal turns.

The plugin was developed and validated on dsh core 0.2.0-rc.2 (DSH Desktop 2.0.15-beta.1); the README does not declare an engines.dsh range, only stating that the aforementioned versions have been tested. License MIT.

Core Features

Quote

Selecting text in the conversation (or anywhere outside the input box) causes a small bar to float up. Clicking Quote results in:

  • A pill appears above the input box showing 1 条注释 / 1 quote; hovering lists each comment (number + original text), allows single deletion, or × to clear all.
  • Each quote in the composer draft corresponds to an icon-only chip (rather than pasting the full text into the input box).
  • Upon sending, each chip is expanded into a Markdown blockquote by the plugin codec and written into the message; the user bubble side will display it as a Markdown blockquote (the plugin cannot hide the sent quote body within that bubble).

Quotes are registered via ctx.inputTriggers.registerSource as source select-ask (trigger @, no @ menu group); the chip’s ref in the draft is the quoted text. Serialization failure will block sending and report slash: no serializer for reference source … rather than silently sending a [注释] placeholder. If the chip cannot be inserted (no session scope or revision race failure), it degrades to appending the quote to the draft body and logs a message in the console.

Ask aside

Clicking Ask in sidebar opens a sidebar tab on the right bound to the selected fragment, containing a standalone mini-chat: each turn sends one POST to /dsh-select-ask/ask, with no session, no child session, and no workspace records. Closing the tab discards the entire transcript. Sidebar answers are rendered as plain text (preserving line breaks) without Markdown rendering. Selecting text again within the sidebar will not pop up the toolbar again; asking again with the same page-type sidebar reuses the tab and resets it with the new fragment. The toolbar writes to the most recently mounted composer—if a sidebar chat tab is already open, this might not be the main session’s input box.

/dsh-select-ask/ask consumes model quota and is judged by isTrustedRequest() based on headers (including a standalone test node --test test/trusted-request.test.mjs):

  • token armed: The index page injects a token via webServer.tapIndex; the browser reads it from window.__DSH_SELECT_ASK_TOKEN__, and requests must return it in the header x-dsh-select-ask; otherwise, they are rejected.
  • token unarmed: In some deployments (the README mentions that on DSH Desktop 2.0.15 the index did not go through webServer.renderIndex), the token does not reach the page; in this case, requests with Origin/Referer must be from the same-site origin, and requests without an origin are allowed (equivalent to the exposure level of other DSH profiles on loopback).

GET /dsh-select-ask/status returns the current guard mode and the resolved model.

Installation & Activation

The plugin is installed as a bundle. The command must be executed in a session with Full access, targeting the plugin directory (the path after git clone depends on your local bundle location):

# from a session with Full access:
plugin_manager action=install_bundle target=<this directory>

After installation, reload the Web UI page so the client bundle enters the boot graph. If the host half (host.js) is modified, DSH must be restarted: host modules are cached in-process by row specifier and cannot be re-imported in place. If only the client half is changed, pnpm run dev:web supports HMR in development scenarios; otherwise, it also relies on page reload.

Directory page: skillhub.cn/plugins/YizhouLouisLu/dsh-select-ask. The community inclusion process is described in submission/YizhouLouisLu__dsh-select-ask.yml in the repository and the awesome-dsh-plugin documentation. The DSH ecosystem emphasizes “everything is a plugin”; directories like SkillHub are community sites and have no official affiliation with DeepSeek or High-Flyer.

Typical Usage

  1. Open an existing conversation in the DSH Web UI and drag-select a piece of text in an assistant or user message that you want to ask about.
  2. Select Quote on the floating bar: confirm the pill above the composer and the number of chips, type your question in the input box, and send; the quote is sent with the user message as a blockquote.
  3. Or select Ask in sidebar: type your question in the small window on the right and read the plain-text answer; if you do not need to keep records, simply close the sidebar tab.
  4. When troubleshooting sidebar availability, the current guard, and model, you can request GET /dsh-select-ask/status from the host (requires a trusted request environment, consistent with the deployment method).

Suitable Scenarios & Notes

Suitable for: DSH Web users who frequently “point to a piece of original text to continue asking” in long conversations; scenarios where you want to ask a temporary question about a selected fragment without polluting the main session history or workspace.

Limitations (stated in README):

  • Unsent quotes exist only in the composer draft; refreshing the page or switching sessions will result in the placeholder [注释] losing the body text. The plugin strips orphan placeholders upon mount to avoid accidental sending.
  • Sent quotes are visible as blockquotes in the user bubble; the plugin cannot hide them.
  • Host row caching: running install_bundle again on an already installed bundle will not re-read cordis.patch.yml; changing the host half requires remove_bundle then install_bundle (with a row name different from the imported one) or restarting DSH.

Before installation: The plugin runs under the permissions of the current DSH process; the host half registers HTTP routes and calls the LLM. Before installing, you should read the source code and LICENSE to ensure compliance with your deployment and audit requirements.

Links

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

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

Xiaoye