Adds lightweight selected-text references to DSH assistant replies: selections stay outside the editor as removable draft contexts, remain marked beside the source, and render as hoverable annotations after submission.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:choco9527/dsh-add-to-chat
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
Select text in a DSH assistant reply and choose Add to chat. The plugin keeps the selection as a separate annotation and submits it as plugin-source context only when the user sends their next message.
Demo
- Select text in an assistant reply, then choose the floating Add to chat action.

- Add as many annotations as needed. The composer remains plain text; hover the “x annotations” pill to read and remove individual selections.

- Keep writing normally and send. The annotations travel as independent context for that submission, are consumed after a successful send, and return if the submission fails.

Features
- Browser-only DSH client plugin; no Host service or product-specific integration.
- Each selection stays within one assistant reply; multiple annotations can be added in succession.
- Triple-click paragraph selection remains available when its trailing newline ends at a timestamp's start after empty action icons. Floating controls stay outside text selection, including on the last paragraph with existing annotations. Selections containing another message or toolbar text remain excluded.
- Does not send automatically. The user can edit ordinary draft text or send annotations without text.
- The “x annotations” hover card shows the full source text and supports individual or bulk removal.
- Previews and the annotation pill share one surface: a visible 1px boundary, 9px corners and layered shadows; quotes use a 3px vertical line. The bulk-remove × is centered in an 18px white circle that stays round under host corner smoothing and turns light gray when the remove button is hovered. It overlays the annotations control without reserving width or animating, appears when the control is hovered or keyboard-focused, and stays visible on touch screens.
- Draft annotation previews open above the pill when space permits, fall back below otherwise, and sit above the composer so details and remove buttons remain accessible.
- It never writes Markdown, hidden nodes, or chips into the Lexical editor, so Backspace cannot remove an annotation by accident.
- A blue teardrop marker with a white number stays above the selection's right edge without a text popup. Numbers follow the current annotation order and update after removal. Read the original text in the annotations card above the composer.
- Interface copy follows the active DSH locale, supports Chinese and English, and refreshes immediately after a language switch.
Compatibility
The plugin relies on an assistant body marked with data-dsh-message-role="assistant", the sessions.list catalog, the conversation.draftContexts submission service, and the DSH locale service. It does not depend on page CSS classes, a Host service, or product-specific code.
Multiple conversation views use the data-conversation-session ancestor of each assistant reply and composer. Each composer displays its own pending annotations. Quotes record separate source and target sessions, so a side conversation cannot accidentally attach its references to the main conversation. Failed submission restores references only to their original target; reopening that conversation restores its draft references.
Legacy single-conversation pages support the catalog's current field or the unique retainedBy.mainView owner in DSH 0.2.0-rc.1. Catalog order and background ownership never select a target. Multiple composers without explicit conversation markers disable the default add action.
Selection action extensions
Client plugins access chatSelection through ctx.inject(['chatSelection'], ...). registerAction extends the existing selection popup and returns a disposer that the consumer releases on unload. Rejected asynchronous actions show localized retry feedback and preserve the selection; consumers own detailed error reporting.
const off = ctx.chatSelection.registerAction({
id: 'example-side-chat',
label: () => localizedLabel,
run: async selection => {
const targetSessionId = await openSideChat(selection.sourceSessionId)
ctx.chatSelection.addQuote({ ...selection, targetSessionId })
},
})
Selections include only the actual sourceSessionId and selected text, without inferred message sequence numbers. addQuote requires explicit source and target sessions and nonempty text; it queues context without creating a session or sending a prompt. Import types from dsh-add-to-chat/client-api. Consumers using a renamed Cordis package declare the same service on their own Context. This plugin does not import product-specific side-chat code.
Install
dsh plugin --profile web add github:choco9527/dsh-add-to-chat
For DSH Desktop, install into the active Desktop profile. The Electron renderer uses the same DSH Web client module graph.
Development
Builds use pnpm 11.28.5 pinned in package.json; lifecycle scripts invoke Corepack to avoid inheriting the host App’s bundled pnpm.
corepack pnpm install
corepack pnpm run check
dsh plugin --profile web add .
Restart the selected DSH profile after installation. Do not also manually add this plugin id to a profile cordis.patch.yml: the bundle already registers itself.
corepack pnpm test loads the real client plugin and checks both catalog APIs, multiple-composer isolation, explicit quote targets, accepted submission, failed-submission recovery, and asynchronous extension feedback. It does not launch a model or access real conversations. TypeScript uses browser bundler resolution to read Cordis declarations with extensionless imports; emitted modules remain ESM.
Browser regression: with Playwright installed, run node --test test/preview.browser.mjs. Set PLAYWRIGHT_MODULE to use an alternate module entry and CHROME_EXECUTABLE to use a specific Chrome executable. The test loads the real plugin into an isolated page and checks composer layers 7/9, narrow-window fallback, triple-click paragraph selection, cross-message exclusion, light and dark styling, and hover, keyboard, and touch removal without accessing real conversations.
License
MIT
Links
More in this category
zhu1090093659/dsh-web#packages/dsh-task-board★ 10735
Task board for the dsh web GUI: a sidebar multi-column kanban whose cards run in real DSH agent sessions and can also be scheduled with cron expressions, executed host-side even with the browser closed.
zhu1090093659/dsh-web#packages/dsh-web-all★ 10735
Plugin and skin collection for the DSH Web UI: task board, Git graph, right-side panel, remote mobile UI, pet, live token stats, and a skin center.
ccch1mneyyy/dsh-TUI★ 8661
Claude Code-style full-screen terminal UI: pixel-whale header, live status line, and streaming thought expansion.
MeteorNOX/DeepSeek-Balance-Whale-Widget★ 7538
A fixed-corner whale widget for the DSH web GUI — balance, today's usage and per-turn cost with peak/off-peak pricing, editable balance-alert and daily-budget bubbles, a module-based custom bubble queue with A/B weighted choices and random lines or images, 30+ vendor templates (OpenAI, OpenRouter, Kimi, SiliconFlow, Ark, Zhipu, MiniMax and more) with per-model balance and subscription quota, plus task-end sound, imported audio, custom roles and a resource manager. Local-only, no telemetry.
omdsh-dev/DSH-better-sidebar★ 5419
Full sidebar workbench with file rendering and editing, terminal, Git, and subagents; third-party plugins can register new tabs.
omdsh-dev/dsh-genui★ 1103
Interactive UI components rendered inline in replies: layout, charts, forms, quizzes, mermaid, 3D scenes, and an action event loop back to the model.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.