Skip to content
Back to search

dsh-selection-ask

ChatGPT-style select→ask for DeepSeek Harness Web: select text in a conversation, a floating 「询问 DeepSeek」 button appears — click it to quote the selection into the composer.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/lzbaclz--dsh-selection-ask/badge.svg)](/listings/lzbaclz--dsh-selection-ask)

HTML

<a href="/listings/lzbaclz--dsh-selection-ask"><img src="/api/listings/lzbaclz--dsh-selection-ask/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

> **Requirements**: DSH ≥ `0.1.5-rc.2` (the `next` channel / the DSH Desktop app). > > | Plugin version | Works with | > |---|---| > | `0.1.1` | DSH ≥ `0.1.5-rc.2` | > | `0.1.0` | DSH `0.1.0-rc.x` (the `dsh-client-runtime` era) | ation

> **Using the DSH Desktop app?** Run the same command in the app's built-in > terminal **without `--profile`** — it targets the `desktop` profile > automatically. The first install needs one restart of that DSH; later upgrades > hot-reload (no restart).

1. Install the package

**From npm (recommended — one command)**

dsh plugin --profile web add dsh-selection-ask

**From GitHub** (latest commit, no build step needed)

dsh plugin --profile web add github:lzbaclz/dsh-selection-ask

Pin a release for reproducibility: `dsh plugin --profile web add github:lzbaclz/dsh-selection-ask#v0.1.1`

**From a local clone**

git clone https://github.com/lzbaclz/dsh-selection-ask.git
dsh plugin --profile web add link:/absolute/path/to/dsh-selection-ask

2. Activate it

`dsh plugin add` already registers the package in your profile's `dsh.profile.bundles` list, and this package ships its own `cordis.patch.yml`, so the entry row is inserted **automatically at boot**. Choose **one** of the two activation paths — **never both**.

**Path A — restart (zero YAML editing; recommended for new setups)**

Restart `dsh web` (or just start it if it is not running). Done — no config files to edit.

# stop your dsh web process, then:
dsh web

**Path B — hot activation on a running server (no restart)**

Use raw `pnpm` (not `dsh plugin`, which would also register the bundle) so the bundles list is untouched, then patch the profile's patch layer, which DSH watches and applies live:

cd ~/.dsh/profiles/web
pnpm add github:lzbaclz/dsh-selection-ask

Now open `~/.dsh/profiles/web/cordis.patch.yml` and **replace** the `[]` with the insert block — the file must stay a valid YAML list:

# BEFORE:
# Your patch layer for this dsh profile, applied after every bundle layer:
# a top-level YAML array of loader patch entries (id-targeted config
# overrides, disables, and insert lists; `!!js` expressions allowed).
[]

# AFTER:
# Your patch layer for this dsh profile, applied after every bundle layer:
# a top-level YAML array of loader patch entries (id-targeted config
# overrides, disables, and insert lists; `!!js` expressions allowed).
- insert:
    - id: dsh-selection-ask
      name: dsh-selection-ask
      config: {}

Save the file and **refresh the browser page** — the plugin is loaded.

> ⚠️ **Do not combine Path A and Path B** (e.g. `dsh plugin add` + a manual patch row): the entry would be registered twice and `dsh web` fails to boot with `duplicate loader entry id: dsh-selection-ask`. > > ⚠️ **Do not append** the YAML block after an existing `[]` — that produces an invalid file and `dsh web` fails to boot with `failed to parse patches`. Replace the `[]` as shown above. > > If your profile is not named `web`, substitute your profile name; if you set a custom harness home, substitute your `$DSH_HOME` for `~/.dsh`.

**Older profiles** (created by an earlier dsh version) may lack the `autoInstallPeers: false` line in `pnpm-workspace.yaml`. Add it so pnpm never tries to auto-install pre-release peers:

packages:
  - .

nodeLinker: hoisted
autoInstallPeers: false

3. Verify

Refresh the GUI page and select a sentence in the chat flow — the **「询问 DeepSeek」** button floats beside the selection. Click it: the text lands in the composer as a quote.

Upgrade & hot reload

dsh plugin --profile web add dsh-selection-ask@latest   # fetch the new version

The DSH composition always mounts the `dsh-client-hmr` chain, which watches installed plugin bundles and reloads them:

- **Upgrading an installed plugin** (same entry, new file content) is hot — no app restart, usually not even a page refresh.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 219 lines
  1. # dsh-selection-ask
  2. ![banner](assets/banner.png)
  3. [![npm](https://img.shields.io/npm/v/dsh-selection-ask.svg)](https://www.npmjs.com/package/dsh-selection-ask)
  4. [![npm downloads](https://img.shields.io/npm/dm/dsh-selection-ask.svg)](https://www.npmjs.com/package/dsh-selection-ask)
  5. [![license](https://img.shields.io/npm/l/dsh-selection-ask.svg)](LICENSE)
  6. [![node](https://img.shields.io/badge/node-%5E22.19%20%7C%7C%20%3E%3D24-5FA04E?logo=nodedotjs)](https://nodejs.org/)
  7. [![stars](https://img.shields.io/github/stars/lzbaclz/dsh-selection-ask.svg)](https://github.com/lzbaclz/dsh-selection-ask)
  8. [![dsh plugin](https://img.shields.io/badge/dsh-plugin-4d6bfe)](https://github.com/deepseek-ai/deepseek-harness)
  9. [简体中文](README.zh.md) · [Installation](#installation) · [Usage](#usage) · [Development](#development) · [Troubleshooting](#troubleshooting) · [License](#license)
  10. **Select it. Quote it. Ask DeepSeek.**
  11. DeepSeek Harness is a text-first terminal/agent workspace. But quoting a piece of context back into the chat should be one gesture, not a copy-paste chore. **dsh-selection-ask** gives the web GUI a ChatGPT-style selection helper: select text in a conversation and a floating **「询问 DeepSeek」** button appears beside it. Click it — the selection is quoted into the composer as a Markdown blockquote (`> `), the composer is focused, and the caret is parked at the end. Just type your follow-up and send.
  12. ## Why
  13. - **Zero friction quoting** — the exact gesture you know from ChatGPT, in DeepSeek Harness.
  14. - **Official integration, no hacks** — writes through the harness's `inputActions.setDraft` input-machine API, so undo history and draft persistence keep working. It never touches DSH internals or DOM state directly.
  15. - **One command to install** — the compiled `lib/` is committed, so a `github:` install fetches ready-to-load artifacts with no build step.
  16. ## Features
  17. - **Button follows the selection** — positioned at the selection's screen coordinates (`position: fixed`), clamped to the viewport, hidden once the selection scrolls away.
  18. - **Quotes conversation text only** — selections must be inside the transcript (`[data-conversation-scroll]`); selecting inside the composer itself does nothing (quoting the draft back into itself is nonsense).
  19. - **Quote-aware append** — every selected line gets a `> ` prefix; an empty draft is replaced, a non-empty draft gets the quote appended as its own paragraph (blank line in between).
  20. - **Session-scoped** — the button state resets on session switch, and the button hides while a takeover composer (question/approval) replaces the default one.
  21. ## Requirements
  22. - DeepSeek Harness with the `web` profile (`dsh web`), DSH packages of the `0.1.0-rc.6` era.
  23. - A browser page on the harness GUI (`http://127.0.0.1:3080` by default).
  24. - Building from source needs Node `^22.19.0 || >=24` and pnpm. **Installing the prebuilt package does not** (compiled `lib/` is committed).
  25. ## Install
  26. > **Requirements**: DSH ≥ `0.1.5-rc.2` (the `next` channel / the DSH Desktop app).
  27. >
  28. > | Plugin version | Works with |
  29. > |---|---|
  30. > | `0.1.1` | DSH ≥ `0.1.5-rc.2` |
  31. > | `0.1.0` | DSH `0.1.0-rc.x` (the `dsh-client-runtime` era) |
  32. ation
  33. > **Using the DSH Desktop app?** Run the same command in the app's built-in
  34. > terminal **without `--profile`** — it targets the `desktop` profile
  35. > automatically. The first install needs one restart of that DSH; later upgrades
  36. > hot-reload (no restart).
  37. ### 1. Install the package
  38. **From npm (recommended — one command)**
  39. ```bash
  40. dsh plugin --profile web add dsh-selection-ask
  41. ```
  42. **From GitHub** (latest commit, no build step needed)
  43. ```bash
  44. dsh plugin --profile web add github:lzbaclz/dsh-selection-ask
  45. ```
  46. Pin a release for reproducibility: `dsh plugin --profile web add github:lzbaclz/dsh-selection-ask#v0.1.1`
  47. **From a local clone**
  48. ```bash
  49. git clone https://github.com/lzbaclz/dsh-selection-ask.git
  50. dsh plugin --profile web add link:/absolute/path/to/dsh-selection-ask
  51. ```
  52. ### 2. Activate it
  53. `dsh plugin add` already registers the package in your profile's `dsh.profile.bundles` list, and this package ships its own `cordis.patch.yml`, so the entry row is inserted **automatically at boot**. Choose **one** of the two activation paths — **never both**.
  54. **Path A — restart (zero YAML editing; recommended for new setups)**
  55. Restart `dsh web` (or just start it if it is not running). Done — no config files to edit.
  56. ```bash
  57. # stop your dsh web process, then:
  58. dsh web
  59. ```
  60. **Path B — hot activation on a running server (no restart)**
  61. Use raw `pnpm` (not `dsh plugin`, which would also register the bundle) so the bundles list is untouched, then patch the profile's patch layer, which DSH watches and applies live:
  62. ```bash
  63. cd ~/.dsh/profiles/web
  64. pnpm add github:lzbaclz/dsh-selection-ask
  65. ```
  66. Now open `~/.dsh/profiles/web/cordis.patch.yml` and **replace** the `[]` with the insert block — the file must stay a valid YAML list:
  67. ```yaml
  68. # BEFORE:
  69. # Your patch layer for this dsh profile, applied after every bundle layer:
  70. # a top-level YAML array of loader patch entries (id-targeted config
  71. # overrides, disables, and insert lists; `!!js` expressions allowed).
  72. []
  73. # AFTER:
  74. # Your patch layer for this dsh profile, applied after every bundle layer:
  75. # a top-level YAML array of loader patch entries (id-targeted config
  76. # overrides, disables, and insert lists; `!!js` expressions allowed).
  77. - insert:
  78. - id: dsh-selection-ask
  79. name: dsh-selection-ask
  80. config: {}
  81. ```
  82. Save the file and **refresh the browser page** — the plugin is loaded.
  83. > ⚠️ **Do not combine Path A and Path B** (e.g. `dsh plugin add` + a manual patch row): the entry would be registered twice and `dsh web` fails to boot with `duplicate loader entry id: dsh-selection-ask`.
  84. >
  85. > ⚠️ **Do not append** the YAML block after an existing `[]` — that produces an invalid file and `dsh web` fails to boot with `failed to parse patches`. Replace the `[]` as shown above.
  86. >
  87. > If your profile is not named `web`, substitute your profile name; if you set a custom harness home, substitute your `$DSH_HOME` for `~/.dsh`.
  88. **Older profiles** (created by an earlier dsh version) may lack the `autoInstallPeers: false` line in `pnpm-workspace.yaml`. Add it so pnpm never tries to auto-install pre-release peers:
  89. ```yaml
  90. packages:
  91. - .
  92. nodeLinker: hoisted
  93. autoInstallPeers: false
  94. ```
  95. ### 3. Verify
  96. Refresh the GUI page and select a sentence in the chat flow — the **「询问 DeepSeek」** button floats beside the selection. Click it: the text lands in the composer as a quote.
  97. ### Upgrade & hot reload
  98. ```sh
  99. dsh plugin --profile web add dsh-selection-ask@latest # fetch the new version
  100. ```
  101. The DSH composition always mounts the `dsh-client-hmr` chain, which watches
  102. installed plugin bundles and reloads them:
  103. - **Upgrading an installed plugin** (same entry, new file content) is hot — no app
  104. restart, usually not even a page refresh.
  105. - **Installing a brand-new plugin** (a new roster entry) needs one DSH restart.
  106. Every side effect (style tag, locale dictionaries, slot registrations) is owned by
  107. the plugin fiber, so a hot reload never leaves stale code behind.
  108. ## Usage
  109. 1. Select text anywhere in the conversation transcript.
  110. 2. Click the **「询问 DeepSeek」** button floating beside the selection.
  111. 3. The selection is quoted into the composer (`> selected text`), the composer is focused and the caret is at the end — type your follow-up question and send.
  112. ## Uninstall
  113. ```bash
  114. dsh plugin --profile web remove dsh-selection-ask
  115. ```
  116. If you used Path B, also remove the `insert` block from `cordis.patch.yml` (put the `[]` back), then refresh / restart.
  117. ## Troubleshooting
  118. | Symptom | Cause & fix |
  119. |---|---|
  120. | `dsh plugin add` fails with `ERR_PNPM_NO_MATCHING_VERSION` for `@deepseek-ai/...` | Your profile is missing the `autoInstallPeers: false` line in `pnpm-workspace.yaml` (older profiles), so pnpm tries to auto-install pre-release peers. Add the line (see below), remove any stray `@deepseek-ai/*` entries from the profile's `package.json` dependencies, delete the profile's `pnpm-lock.yaml`, then re-run. This plugin also marks every peer `optional`, so it never triggers auto-install. |
  121. | `dsh web` fails to boot: `failed to parse patches` | The insert block was appended after the file's existing `[]`, making the YAML invalid. Replace the `[]` with the block instead (see [Path B](#2-activate-it)). |
  122. | `dsh web` fails to boot: `duplicate loader entry id: dsh-selection-ask` | The package is registered twice — you used `dsh plugin add` (which adds the bundle) **and** a manual patch row. Remove one of the two. |
  123. | Installed via `dsh plugin add` but nothing appears after a page refresh | Bundle-list changes are composed at boot — restart `dsh web` (Path A), or use the hot-activation Path B. |
  124. | Button never appears after selecting text | Selection is outside the transcript (try selecting a chat message), the page wasn't refreshed after activation, or the `insert` row is missing. |
  125. | Button appears but click does nothing | An outdated bundle is cached — hard-refresh the page (Cmd/Ctrl+Shift+R). If the package was rebuilt locally, re-run `pnpm build` and re-`link:` it. |
  126. | Button gone while a question card is showing | Expected: the overlay hides with the default composer under a takeover. It returns when the default composer does. |
  127. | `dsh plugin add` fails | Any pnpm specifier works (`link:`, `github:`, tarball URL). Check the profile path under `~/.dsh/profiles/` and your Node version. |
  128. ## Development
  129. The compiled `lib/` is committed, so normal installs never need a build. To hack on it:
  130. ```bash
  131. git clone https://github.com/lzbaclz/dsh-selection-ask.git
  132. cd dsh-selection-ask
  133. pnpm install
  134. pnpm typecheck # host + client tsc programs, zero errors
  135. pnpm build # tsc(host) + tsc(client) + tsdown bundle
  136. pnpm verify # offline smoke: manifest/exports/patch/bundle shape
  137. pnpm test:dom # headless DOM test: mounts the built button in jsdom and asserts the quote flow # offline smoke checks over the built artifacts
  138. ```
  139. - `src/index.ts` — host half (empty `apply`; exists so the roster scan finds the package).
  140. - `src/client/index.tsx` — browser half: injects CSS, registers into the `conversation.input.overlay` slot.
  141. - `src/client/SelectionAskButton.tsx` — the floating button: selection detection, positioning, quote writing.
  142. - `src/client/quote.ts` — pure `buildQuote` / `appendQuote` helpers (exercised offline by `verify`).
  143. - `src/client/styles.ts` — button CSS + HMR-safe `<style>` injection.
  144. After changing `src/`, rebuild, reinstall (or re-`link:`), and refresh the page.
  145. ## How it works
  146. The plugin registers a component into the session-scoped `conversation.input.overlay` slot, which grants it the session input kit (`useInput`, `inputActions`). A document-level `selectionchange`/`mouseup` listener detects selections inside the transcript and renders a `position: fixed` button at the selection's bounding rect. Clicking builds a Markdown quote, joins it with the current draft, writes the full draft through `inputActions.setDraft` — the input machine's official write path — then focuses the composer textarea.
  147. ## Roadmap
  148. - [ ] Publish to npm (`dsh plugin --profile web add dsh-selection-ask`).
  149. - [ ] Optional keyboard shortcut (e.g. ⌘⇧Q) to quote the current selection.
  150. - [ ] Configurable button label / language.
  151. ## License
  152. [MIT](./LICENSE) © lzbaclz
  153. ---
  154. Issues and PRs are welcome any time — [open an issue](https://github.com/lzbaclz/dsh-selection-ask/issues) and tell us what you built with it.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.