dsh-select-quote 0.3.20 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +113 -0
- package/README.md +7 -1
- package/lib/client.js +5006 -1408
- package/lib/index.js +1 -0
- package/locale/de.json +1 -1
- package/locale/en.json +1 -1
- package/locale/es.json +1 -1
- package/locale/fr.json +1 -1
- package/locale/ja.json +1 -1
- package/locale/pt.json +1 -1
- package/locale/ru.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +5 -2
package/README.en.md
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# dsh-select-quote
|
|
2
|
+
|
|
3
|
+
[简体中文](README.md) | English
|
|
4
|
+
|
|
5
|
+
A [DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harness/guide/quickstart) client plugin: adds **selection annotations and quotes**, **in-place translation**, and **sidebar subagent questions** to DSH, and opens links in your **default browser**. The selected text and your comment ride along with the next message; the source keeps its highlight and ordinal mark for jumping back. The menu can appear on selection or open from the right-click menu, and translation can use its own model.
|
|
6
|
+
|
|
7
|
+
[](https://dshopen.org/zh/plugins/dsh-select-quote/)
|
|
8
|
+
[](https://www.dsh.so/artifact/dsh-select-quote/?ref=badge)
|
|
9
|
+
[](https://www.npmjs.com/package/dsh-select-quote)
|
|
10
|
+
[](https://www.npmjs.com/package/dsh-select-quote)
|
|
11
|
+
[](LICENSE)
|
|
12
|
+
[](https://awesome-dsh-plugin.com/)
|
|
13
|
+
[](package.json)
|
|
14
|
+
|
|
15
|
+

|
|
16
|
+
|
|
17
|
+
## Features
|
|
18
|
+
|
|
19
|
+
- **Selection toolbar**: select text in the conversation to get **Open link / Copy / Translate / Add annotation / Ask in sidebar**. The toolbar can sit above or below the selection
|
|
20
|
+
- **In-place translation**: translates the selection into the target language, streaming next to it. While the model is thinking, a progress icon shows live reasoning; once the translation lands, the reasoning collapses but stays available. The target follows the UI language by default and can be switched on the spot; the result copies in one click. Reopening the same text with the same settings reuses the in-memory cache for the session without calling the model
|
|
21
|
+
- **Right-click menu and shortcuts**: the same actions open from the selection's context menu or from the keyboard; key bindings are configurable in the host's settings
|
|
22
|
+
- **Annotation summary**: the composer shows "N annotations" above it; expand to edit or jump back to the source. Deleting asks for a second "Confirm removal" click; the summary clears when the message is sent
|
|
23
|
+
- **Marks in the text**: annotated text keeps a tint and an ordinal mark. Click the mark to see the source and comment; pending annotations can be edited or removed from the mark's popover, matching the summary card
|
|
24
|
+
- **Send to another session**: puts the selected text and comment into another session's composer, either staying on the current page or going there directly, including a workspace's "New session". The source keeps an arrow mark; the target card shows "From: <session>" and both sides can jump back. Once the target sends, the source mark is labeled "Sent"
|
|
25
|
+
- **Model references**: when a model points at an annotation in its answer, it renders as a chip with a preview
|
|
26
|
+
- **Sidebar subagents**: ask about a passage in the sidebar without interrupting the main conversation. Pick a separate model and reasoning level, or reuse the same subagent (the directory keeps a single entry)
|
|
27
|
+
- **Eight UI languages**: 简体中文 / English / 日本語 / Español / Français / Deutsch / Русский / Português
|
|
28
|
+
|
|
29
|
+
## Install
|
|
30
|
+
|
|
31
|
+
Web:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
dsh plugin --profile web add dsh-select-quote
|
|
35
|
+
dsh --profile web
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Desktop: enter `dsh-select-quote` inside the app, or find it in the plugin page and install; restart the client to take effect.
|
|
39
|
+
|
|
40
|
+
Local development:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
git clone https://github.com/latte03/dsh-select-quote && cd dsh-select-quote
|
|
44
|
+
pnpm install && pnpm run build
|
|
45
|
+
cp dev.patch.example.yml dev.patch.yml # replace <CHECKOUT> with this checkout's absolute path
|
|
46
|
+
dsh web --patch "$PWD/dev.patch.yml"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Open `http://127.0.0.1:3080` to try it. `dev.patch.yml` is a local, untracked file; the repository only ships the template.
|
|
50
|
+
|
|
51
|
+
## Usage
|
|
52
|
+
|
|
53
|
+
1. Select text in the conversation → click **Add annotation**; the annotation is saved immediately. Add a comment in the box; `Enter` or `⌘/Ctrl + Enter` submits, `Shift + Enter` inserts a newline
|
|
54
|
+
2. Hover (or tap on touch) the summary above the composer to expand the list: edit, delete, or jump back to the text. Click a mark in the text to preview its annotation
|
|
55
|
+
3. Send as usual: annotations go to the model with the message, the summary disappears, the marks stay; model references render as chips
|
|
56
|
+
4. **Ask in sidebar** opens the composer first; the subagent is created and shown in the right sidebar only after you press send. The directory names it "Ask in sidebar · question summary"
|
|
57
|
+
5. **Translate** opens the translation popover and starts streaming right away: switch languages in the header, **Stop** cancels; **Copy translation** when done; Esc or an outside click closes it
|
|
58
|
+
6. **Send to session** picks a target: **Send** stays on the current page, **Send and open** opens the target. Entries in the target composer carry "From"; click one to return to the source
|
|
59
|
+
|
|
60
|
+
There are three ways to open the menu after selecting text: auto (default), right-click on the selection, or a shortcut. Touch always uses the bottom action bar.
|
|
61
|
+
|
|
62
|
+
| Action | Desktop macOS | Desktop Win/Linux | Web macOS | Web Windows | Web Linux |
|
|
63
|
+
|---|---|---|---|---|---|
|
|
64
|
+
| Open selection menu | `⌘L` | `Ctrl+Shift+L` | `⇧⌘L` | `Ctrl+Shift+L` | `Ctrl+Shift+,` |
|
|
65
|
+
| Add annotation | `⇧⌘L` | `Ctrl+Shift+.` | `⌥⌘L` | `Ctrl+Shift+.` | `Ctrl+Shift+.` |
|
|
66
|
+
|
|
67
|
+
## Settings
|
|
68
|
+
|
|
69
|
+
Plugin page → `dsh-select-quote`; configuration is shown directly on the plugin's outer page:
|
|
70
|
+
|
|
71
|
+
- **Selection trigger**: auto / right-click menu / both, auto by default
|
|
72
|
+
- **Toolbar placement**: above (default) or below, for auto or both; flips automatically when space runs out
|
|
73
|
+
- **Shortcuts**: enable the two commands and see the effective keys; change them in the host's Shortcuts settings
|
|
74
|
+
- **Sidebar subagent**: fresh each time (default) or reuse one; in reuse mode the directory keeps a single entry, and context and model stay at first creation
|
|
75
|
+
- **Translation target**: auto (default, follows the UI language; translates to English when the source is already in that language) or one of eight fixed languages
|
|
76
|
+
- **Hide translate for same language**: when on, the toolbar and right-click menu omit **Translate** if the selection is already in the target language; auto target compares against the UI language (off by default)
|
|
77
|
+
- **Translation model**: follows the current conversation by default, or pick a faster model just for translation
|
|
78
|
+
- **Custom prompt**: the input's placeholder is the built-in prompt; leave it empty to use the built-in one, or fill it in to override the whole prompt. `{target}` is replaced with the target language
|
|
79
|
+
|
|
80
|
+
## Languages
|
|
81
|
+
|
|
82
|
+
The UI follows dsh's language setting; the plugin UI, its page title, and its description switch together across eight languages (see above).
|
|
83
|
+
|
|
84
|
+
## Known limitations
|
|
85
|
+
|
|
86
|
+
- **Annotations persist per session**: after a refresh or restart, unsent annotations come back (last 20 sessions, 7 days); sending clears them, and forked sessions do not inherit them
|
|
87
|
+
- **Send-to-session depends on the current dsh version**: it needs the host's workspace and `openSession` APIs; older versions hide the entry. Unsent handoffs are pruned in pairs after 20 sessions / 7 days; once the target sends, the source mark stays forever. Jumping back from the target only guarantees history that is loaded; a miss shows a notice
|
|
88
|
+
- **Takes over user bubbles**: mounts on the built-in `user` / `steering` nodes at `priority: -10`, then delegates rendering to the host's view. Another plugin must use a priority lower than `-10` to win
|
|
89
|
+
- **Selection works in the conversation only**: it does not touch editors or terminals; keyboard users need caret browsing or assistive technology to create a selection
|
|
90
|
+
- **Sidebar questions must be sent**: the host does not allow creating a subagent in an empty session; reuse mode has no model entry
|
|
91
|
+
- **Translation sends only the selection**: the request carries no conversation context and does not write an annotation; copy the translation if the model needs it. One request is capped at about 6,000 characters and times out after 90 seconds; failures show an error summary in the popover, with details in the console
|
|
92
|
+
- **Web Linux shortcuts are limited**: the host accepts only `Ctrl+/`, `Ctrl+Shift+,`, and `Ctrl+Shift+.`; this plugin uses the latter two
|
|
93
|
+
|
|
94
|
+
## Development
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
pnpm run check # typecheck + test + build + verify; run before committing
|
|
98
|
+
pnpm run watch # incremental rebuild
|
|
99
|
+
pnpm run sync:desktop # push to the installed desktop client (500ms hot reload)
|
|
100
|
+
pnpm run release # check → CHANGELOG → version + tag
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
`lib/` is committed with the source and read at runtime. Publishing uses `npm publish --registry=https://registry.npmjs.org/`, then syncs the npmmirror mirror.
|
|
104
|
+
|
|
105
|
+
For internals, conventions, and troubleshooting, see [`docs/internals.md`](docs/internals.md); historical investigations live in [`docs/archive/`](docs/archive/).
|
|
106
|
+
|
|
107
|
+
## Acknowledgements
|
|
108
|
+
|
|
109
|
+
[@imallakov](https://github.com/imallakov) (multilingual support and cross-platform builds), [@Ladersbt](https://github.com/Ladersbt) (chip preview feedback), [@EliteOtaku](https://github.com/EliteOtaku) (desktop issue diagnosis).
|
|
110
|
+
|
|
111
|
+
## License
|
|
112
|
+
|
|
113
|
+
[MIT](LICENSE) © 2026 agan
|
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# dsh-select-quote
|
|
2
2
|
|
|
3
|
+
简体中文 | [English](README.en.md)
|
|
4
|
+
|
|
3
5
|
[DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harness/guide/quickstart) 客户端插件:为 DSH 增加**划词批注、引用**、**划词翻译**、**侧边子代理提问**,链接用**默认浏览器**打开。选中的原文连同评论随下一条消息交给模型,正文保留高亮与序号角标、可跳回原文;菜单可划词浮出或从右键打开,翻译可单独指定模型。
|
|
4
6
|
|
|
5
7
|
[](https://dshopen.org/zh/plugins/dsh-select-quote/)
|
|
@@ -17,8 +19,9 @@
|
|
|
17
19
|
- **划词工具条**:选中对话里的文字,浮出「打开链接 / 复制 / 翻译 / 添加批注 / 在侧边提问」;可选显示在选区上方或下方
|
|
18
20
|
- **就地翻译**:把选中文字直接翻成目标语言,译文在选区旁流式出现;模型思考时显示进度图标并实时展开推理,译文出现后推理折叠可查,目标语言默认跟随界面语言,可随时切换,结果可一键复制;同一段原文与设置再次打开时直接复用本次会话的内存缓存,不再调用模型
|
|
19
21
|
- **右键菜单与快捷键**:同一套操作也能从选区右键或键盘打开,键位可在宿主设置里改
|
|
20
|
-
- **批注摘要**:输入框上方显示「N
|
|
22
|
+
- **批注摘要**:输入框上方显示「N 条批注」,可展开编辑、跳回原文;删除需再点一次「确认移除」,防止误删;发送后随消息清除
|
|
21
23
|
- **正文标记**:被划中的文字留下淡色底与序号角标,点击角标查看原文和评论;待发批注可在角标浮层里直接编辑或删除,与输入框展开的操作一致
|
|
24
|
+
- **放入其他会话**:把选中的原文连同评论放进另一个会话的输入框,可留在当前页或直接前往,也可放入当前工作区的「新会话」;源正文留下箭头角标,目标会话的批注卡显示「来自:<会话>」,可双向跳回。目标发送后源角标标为「已发送」
|
|
22
25
|
- **模型回指**:模型在回答里指向某条批注时渲染成带预览的 chip
|
|
23
26
|
- **侧边子代理**:就某段原文单独追问,在右侧栏开启子代理,不打断主会话;可独立选模型与推理等级,也可复用同一个子代理(目录只保留一条)
|
|
24
27
|
- **八种界面语言**:简体中文 / English / 日本語 / Español / Français / Deutsch / Русский / Português
|
|
@@ -52,6 +55,7 @@ dsh web --patch "$PWD/dev.patch.yml"
|
|
|
52
55
|
3. 正常发送:批注随消息交给模型,摘要消失,正文标记保留;模型回指处显示 chip
|
|
53
56
|
4. 「在侧边提问」会先打开输入框,点发送才创建子代理并在右侧栏打开;目录用「在侧边提问 · 问题摘要」命名
|
|
54
57
|
5. 「翻译」直接打开译文浮层并开始流式翻译:顶栏可换语言,「停止」可中断;完成后「复制译文」;Esc 或点外面关闭
|
|
58
|
+
6. 「放入会话」选择目标会话后点「放入」留在当前页,点「放入并前往」打开目标;目标输入框里的条目带「来自」,点它回到原文
|
|
55
59
|
|
|
56
60
|
选中文字后有三种方式打开菜单:自动浮出(默认)、选区右键、快捷键。触屏始终使用底部操作条。
|
|
57
61
|
|
|
@@ -69,6 +73,7 @@ dsh web --patch "$PWD/dev.patch.yml"
|
|
|
69
73
|
- **快捷键**:开关两个命令并显示当前生效键位,改键在宿主的「快捷键」设置里
|
|
70
74
|
- **侧边提问的子代理**:每次独立(默认)/ 复用同一个;复用时目录只保留一条,但上下文与模型停在第一次创建时
|
|
71
75
|
- **翻译目标语言**:自动(默认,跟随界面语言;原文已是该语言时译成英文)或固定八种语言之一
|
|
76
|
+
- **同语言隐藏翻译**:开启后,选中的文字已是目标语言时,工具条与右键菜单不再显示「翻译」;自动目标按界面语言判断(默认关闭)
|
|
72
77
|
- **翻译模型**:默认跟随当前对话,也可以单独选一个更快的模型
|
|
73
78
|
- **自定义提示词**:输入框的占位文字就是内置提示;留空使用内置提示,填写后整段覆盖,`{target}` 会替换为目标语言
|
|
74
79
|
|
|
@@ -79,6 +84,7 @@ dsh web --patch "$PWD/dev.patch.yml"
|
|
|
79
84
|
## 已知限制
|
|
80
85
|
|
|
81
86
|
- **批注按会话持久化**:刷新或重启后未发送的批注会回来(保留最近 20 个会话、7 天);发送即清除,分叉会话不继承
|
|
87
|
+
- **放入其他会话依赖当前 dsh 版本**:需要宿主提供工作区与 `openSession`;旧版本自动隐藏该入口。未发送的放入记录按 20 会话 / 7 天成对淘汰,目标发送后源角标永久保留;从目标跳回只保证已加载的历史,找不到时会提示
|
|
82
88
|
- **接管用户气泡**:以 `priority: -10` 接管内置 `user` / `steering` 节点,再委托宿主视图渲染;其它插件要赢过它,优先级必须小于 `-10`
|
|
83
89
|
- **划词只在对话区生效**:不介入编辑器、终端等面板;键盘用户需借助光标浏览或辅助技术建立选区
|
|
84
90
|
- **侧边提问要先发送**:宿主不允许在空会话上直接开子代理;复用模式没有模型入口
|