dsh-ask-from-text 0.0.0-stage → 0.1.12

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/CHANGELOG.md ADDED
@@ -0,0 +1,86 @@
1
+ # Changelog
2
+
3
+ All notable changes to `dsh-ask-from-text` are documented here. The format is
4
+ based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this
5
+ project follows [Semantic Versioning](https://semver.org/).
6
+
7
+ ## [0.1.12] - 2026-11-13
8
+
9
+ ### Changed
10
+
11
+ - The main conversation row stays above its branch rows in the left sidebar,
12
+ regardless of the host recency sort.
13
+
14
+ ## [0.1.11] - 2026-11-13
15
+
16
+ ### Changed
17
+
18
+ - The stage now shows the selected quote as a colored, independent block above
19
+ the conversation and hides the duplicate native blockquote.
20
+ - The stage branch tree now matches the richer design: main-chat root, path/all
21
+ tabs, quote preview, parent context, status, and current/context badges.
22
+
23
+ ## [0.1.10] - 2026-11-13
24
+
25
+ ### Changed
26
+
27
+ - Renamed the package and GitHub repository to `dsh-ask-from-text`. The
28
+ localStorage UI key stays `dsh.inline-followup.v1` so existing branch metadata
29
+ survives the rename.
30
+
31
+ ## [0.1.9] - 2026-11-13
32
+
33
+ ### Changed
34
+
35
+ - Renamed the user-facing product to **划词追问 / Ask from Text**. At this
36
+ version the internal package name was still `dsh-inline-followup`.
37
+
38
+ ## [0.1.8] - 2026-11-13
39
+
40
+ ### Added
41
+
42
+ - Selection-based follow-up branches for completed assistant answers.
43
+ - Real Session forks at the durable anchor sequence, rendered with the shared
44
+ Conversation UI (`SessionProvider` + embedded `conversation.content`).
45
+ - Colored underlines, gutter `#n` markers, and a bottom-right branch dock.
46
+ - Independent floating conversation and new-draft input windows; both drag and
47
+ resize, while existing sent branches use one panel with the native composer.
48
+ - Stage view with breadcrumbs, back/forward history, branch tree, restore, and
49
+ close-to-main.
50
+ - Exact-range centering when opening a branch from the dock; the selected text
51
+ is centered rather than only its Turn.
52
+ - A collapsible `追问分支` group for branch Sessions in the left sidebar.
53
+ - Draft deletion from the input window header, branch dock, and stage tree.
54
+ - Light/dark theme support for highlights, panels, and the branch tree.
55
+
56
+ ### Changed
57
+
58
+ - New drafts open only a compact input window; the selected quote remains in the
59
+ transcript under its colored underline, without a duplicate quote window.
60
+ - The stage excludes the left sidebar and clears the macOS window-chrome band.
61
+ - Falling back to the native turn navigator when an anchored Turn is not mounted.
62
+ - Branch tree rows are ordered depth-first, matching the context hierarchy.
63
+
64
+ ### Known limitations
65
+
66
+ - Branch Sessions remain visible in the normal DSH Session list (now groupable
67
+ with the collapsible `追问分支` header).
68
+ - Sent branches cannot be deleted from the plugin; archive them in DSH. Only
69
+ unsent drafts can be deleted.
70
+ - Inherited branch context is loaded by the model but hidden in the UI through
71
+ DOM filtering; it is not an expandable context viewer yet.
72
+ - Desktop-focused. Narrow-screen and mobile polish are deferred.
73
+ - No merge between sibling branches, no cross-device branch tree sync.
74
+
75
+ ## [0.1.0] - 2026-11-13
76
+
77
+ ### Added
78
+
79
+ - Initial local prototype: selection chip, floating draft, real Session fork,
80
+ native conversation rendering, colored marks, stage, and branch tree.
81
+
82
+ [0.1.8]: https://github.com/gbn0219/dsh-inline-followup/releases/tag/v0.1.8
83
+ [0.1.9]: https://github.com/gbn0219/dsh-inline-followup/releases/tag/v0.1.9
84
+ [0.1.10]: https://github.com/gbn0219/dsh-ask-from-text/releases/tag/v0.1.10
85
+ [0.1.11]: https://github.com/gbn0219/dsh-ask-from-text/releases/tag/v0.1.11
86
+ [0.1.12]: https://github.com/gbn0219/dsh-ask-from-text/releases/tag/v0.1.12
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 gbn0219
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,247 @@
1
- # Temporary Holding Version
1
+ # 划词追问 · Ask from Text
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ 在 DeepSeek Harness 的回答里划选一句话,输入追问;回答会在独立的浮窗中继续,并保留原文标记。
4
+
5
+ ![多个追问与收起列表](docs/images/multi-branch.jpg)
6
+
7
+ > 界面示意图。当前版本新建追问时只弹出一个输入浮窗;发送后才会显示完整对话浮窗。
8
+
9
+ ## 安装
10
+
11
+ 需要 DeepSeek Harness 0.2.2-rc.x。
12
+
13
+ ### 从 GitHub 安装(当前可用)
14
+
15
+ ```sh
16
+ dsh plugin --profile web add github:gbn0219/dsh-ask-from-text
17
+ ```
18
+
19
+ ### 从 npm 安装(发布后可用)
20
+
21
+ ```sh
22
+ dsh plugin --profile web add dsh-ask-from-text
23
+ ```
24
+
25
+ ### 从本地目录安装
26
+
27
+ ```sh
28
+ dsh plugin --profile web add /absolute/path/to/dsh-ask-from-text
29
+ ```
30
+
31
+ 也可以打开 DSH Desktop 的 **插件 → 添加插件**,选择本地插件目录。
32
+
33
+ 安装完成后,完全退出 DSH 重开,或刷新 Web 页面。打开 **插件**,确认 `划词追问` 已启用。
34
+
35
+ ## 使用
36
+
37
+ ### 1. 划选文字
38
+
39
+ 在一条**已经生成完成**的 assistant 回答中划选文字。
40
+
41
+ 选区附近会出现 `✦ 追问` 按钮。点击它。
42
+
43
+ > 正在生成中的回答、用户消息、工具参数编辑区,以及浮窗自身不能作为追问对象。
44
+
45
+ ### 2. 输入第一个问题
46
+
47
+ 会弹出一个独立的输入浮窗:
48
+
49
+ - 输入问题;
50
+ - 按 `Enter` 或点「发送」;
51
+ - 发送成功后,输入浮窗消失,出现这个追问的对话浮窗。
52
+
53
+ 选中的原文会留在主对话里,并显示彩色下划线和行尾编号 `#1`。
54
+
55
+ ### 3. 继续追问或创建子分支
56
+
57
+ 在追问的对话浮窗中:
58
+
59
+ - 直接使用底部的原生输入框继续追问;
60
+ - 在回答里继续划选文字,可以创建子分支。
61
+
62
+ 每个追问只继承它的父级及祖先内容;兄弟分支之间互不可见。
63
+
64
+ ### 4. 收起和恢复
65
+
66
+ - 点浮窗头部的 `—` 收起;
67
+ - 收起后,原文仍保留彩色下划线和 `#n`;
68
+ - 点击 `#n`,或在右下角「已收起分支」列表里点一行,可以重新打开;
69
+ - 点击收起列表里的一行时,原文会自动滚到页面中央。
70
+
71
+ ### 5. 放大
72
+
73
+ 点浮窗头部的 `↗` 进入舞台。
74
+
75
+ 舞台中可以使用:
76
+
77
+ - `← 后退` / `前进 →`:在查看过的分支之间切换;
78
+ - `主对话 › #n`:点击面包屑跳转;
79
+ - `▤ 分支树`:查看完整分支树;
80
+ - `↘ 还原为浮窗`:回到小浮窗;
81
+ - `✕ 关闭`:回到主对话。
82
+
83
+ ![舞台与分支树](docs/images/stage-and-tree.jpg)
84
+
85
+ ### 6. 删除草稿
86
+
87
+ 还没有发送的追问是草稿,可以在三个地方点红色 `⌫` 删除:
88
+
89
+ - 输入浮窗头部;
90
+ - 右下角「已收起分支」列表;
91
+ - 舞台里的分支树。
92
+
93
+ 已经发送的追问是真实会话,插件不提供删除;需要时请到 DSH 的 Session 列表归档。
94
+
95
+ ### 7. 左侧栏折叠
96
+
97
+ 每个追问都会作为真实 Session 出现在左侧栏。
98
+
99
+ 它们会被归入 `追问分支` 分组;点分组标题即可收起或展开,不影响主对话和其他会话。主对话行会固定显示在分支分组之上,即使某个分支的最近活跃时间更靠后。
100
+
101
+ ## 使用须知
102
+
103
+ - 追问回答是真实的 DSH Session,可以使用思考、工具调用、Stop 和原生输入框。
104
+ - 分支只看到父级和祖先内容,不看到兄弟分支,也不会自动获得父级后来新增的内容。
105
+ - 分支对话会出现在普通 Session 列表中,这是正常现象。
106
+ - 当前浮窗和舞台的运行时按钮文案为中文;插件管理器的标题/描述提供中英文。
107
+ - 目前主要面向 DSH Desktop;Web 共用同一套 UI,窄屏体验尚未专门优化。
108
+
109
+ ## 常见问题
110
+
111
+ **为什么左侧栏多出了会话?**
112
+ 每个追问都是真实 Session。用 `追问分支` 分组收起即可。
113
+
114
+ **可以删除已发送的追问吗?**
115
+ 插件不提供;已发送的分支需要在 DSH 的 Session 列表中归档。只有草稿可以 `⌫` 删除。
116
+
117
+ **为什么原文没有跳到中间?**
118
+ 如果原文所在的轮次被折叠或尚未加载,插件会先尝试加载;仍失败时请把这一轮的对话展开后再点一次。
119
+
120
+ **会把我的对话发到其他地方吗?**
121
+ 不会。插件不发起网络请求;对话由 DSH 自己的 Session 和模型链路处理。
122
+
123
+ ## English
124
+
125
+ **Ask from Text** lets you select a sentence in a completed assistant answer and ask a question in a separate floating branch, while keeping the original text marked in place.
126
+
127
+ ![Multiple branches and the collapsed-branch list](docs/images/multi-branch.jpg)
128
+
129
+ > Interface illustration. In the current version a new follow-up opens only an input window; the full conversation window appears after you send the first question.
130
+
131
+ ### Install
132
+
133
+ Requires DeepSeek Harness 0.2.2-rc.x.
134
+
135
+ #### From GitHub (available now)
136
+
137
+ ```sh
138
+ dsh plugin --profile web add github:gbn0219/dsh-ask-from-text
139
+ ```
140
+
141
+ #### From npm (after the npm release)
142
+
143
+ ```sh
144
+ dsh plugin --profile web add dsh-ask-from-text
145
+ ```
146
+
147
+ #### From a local directory
148
+
149
+ ```sh
150
+ dsh plugin --profile web add /absolute/path/to/dsh-ask-from-text
151
+ ```
152
+
153
+ You can also open **Plugins → Add plugin** in DSH Desktop and choose the local plugin directory.
154
+
155
+ After installation, fully quit and reopen DSH, or refresh the Web page. Open **Plugins** and confirm that **Ask from Text** is enabled.
156
+
157
+ ### Usage
158
+
159
+ #### 1. Select text
160
+
161
+ Select text in a **completed** assistant answer.
162
+
163
+ A `✦ 追问` button appears near the selection. Click it.
164
+
165
+ > Streaming answers, user messages, tool argument editors, and the plugin's own windows cannot be used as follow-up sources.
166
+
167
+ #### 2. Enter the first question
168
+
169
+ An independent input window opens:
170
+
171
+ - Type your question.
172
+ - Press `Enter` or click **Send**.
173
+ - After the question is accepted, the input window disappears and the branch conversation window appears.
174
+
175
+ The selected text stays in the main transcript with a colored underline and a gutter number such as `#1`.
176
+
177
+ #### 3. Continue or create a child branch
178
+
179
+ In the branch conversation window:
180
+
181
+ - Use the native composer at the bottom to continue the conversation.
182
+ - Select text inside the branch answer to create a child branch.
183
+
184
+ A branch inherits its parent and ancestors only. Sibling branches cannot see one another.
185
+
186
+ #### 4. Collapse and restore
187
+
188
+ - Click `—` in the window header to collapse the branch.
189
+ - The source text keeps its colored underline and `#n` marker.
190
+ - Click the `#n` marker, or a row in the bottom-right **Collapsed branches** list, to reopen it.
191
+ - Opening a row scrolls the exact quoted range to the center of the transcript.
192
+
193
+ #### 5. Open the stage
194
+
195
+ Click `↗` in the window header to open the branch on the stage.
196
+
197
+ The stage provides:
198
+
199
+ - `← Back` / `Forward →` to move through branches you have viewed.
200
+ - `Main chat › #n` breadcrumbs to jump to a level.
201
+ - `▤ Branches` to open the full branch tree.
202
+ - `↘ Restore to window` to return to the floating window.
203
+ - `✕ Close` to return to the main chat.
204
+
205
+ ![Stage and branch tree](docs/images/stage-and-tree.jpg)
206
+
207
+ #### 6. Delete a draft
208
+
209
+ A follow-up that has not been sent is a draft. Delete it with the red `⌫` action in:
210
+
211
+ - The input window header.
212
+ - The bottom-right collapsed-branch list.
213
+ - The branch tree on the stage.
214
+
215
+ A sent follow-up is a real Session and cannot be deleted by the plugin. Archive it from the DSH Session list instead.
216
+
217
+ #### 7. Collapse branches in the left sidebar
218
+
219
+ Every follow-up appears as a real Session in the left sidebar.
220
+
221
+ These sessions are grouped under a `追问分支` header. Click the header to collapse or expand the group without affecting the main chat or other sessions. The main-chat row stays above the branch group even when a branch was used more recently.
222
+
223
+ ### Notes
224
+
225
+ - A follow-up is a real DSH Session. It can use reasoning, tool calls, Stop, and the native composer.
226
+ - A branch sees its parent and ancestors, not siblings, and does not automatically receive later turns added to its parent.
227
+ - Branch conversations also appear in the normal Session list. This is expected.
228
+ - Runtime UI labels are currently Chinese; Plugin Manager metadata is available in Chinese and English.
229
+ - DSH Desktop is the primary target. The Web client shares the same UI, but narrow-screen behavior has not been specifically polished.
230
+
231
+ ### FAQ
232
+
233
+ **Why are there extra sessions in the left sidebar?**
234
+ Each follow-up is a real Session. Use the `追问分支` group to collapse them.
235
+
236
+ **Can I delete a sent follow-up?**
237
+ Not from the plugin. Archive sent branches from the DSH Session list. Only drafts can be deleted with `⌫`.
238
+
239
+ **Why did the source text not scroll to the center?**
240
+ If its Turn is folded or not loaded yet, the plugin tries to load it first. If that still fails, expand that Turn and click the branch again.
241
+
242
+ **Does this send my conversation anywhere else?**
243
+ No. The plugin makes no network requests; conversations use DSH's own Session and model paths.
244
+
245
+ ## License
246
+
247
+ [MIT](LICENSE) © 2026 gbn0219