dsh-treecom 1.0.1 → 1.0.2
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.md +30 -108
- package/assets/runtime.webp +0 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,132 +1,54 @@
|
|
|
1
1
|
# TreeCom — 对话树
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
- 右侧详情的提问框 / 回答框设置最大高度:内容短时自动收缩,超过上限才在框内向下滚动;复制按钮固定在框上方;
|
|
21
|
-
- 右侧详情和悬停预览里的提问 / 回答都按 Markdown 渲染(标题、列表、代码块、表格、链接、强调等);右侧提问 / 回答框上方有「复制」按钮,复制成功后短暂显示「已复制」;
|
|
22
|
-
- **两个入口**:
|
|
23
|
-
- 标题栏右上角的「对话树」按钮:打开右侧边栏里的「对话树」标签页;边栏本身负责关闭和拖动宽度,对话区保持可见;
|
|
24
|
-
- 会话视图里的「对话树」标签页:和「对话 / 轨迹 / 上下文」并排,全宽显示画布 + 右侧详情;此标签页激活时输入框隐藏,切回「对话」即可继续输入;对话区的宽度拖拽手柄在此标签页下也会停用,避免误出现横向缩放光标;
|
|
25
|
-
- 没有第三个入口,也不再有任何浮动遮罩层;
|
|
26
|
-
- 重命名 / 归档 / 分叉按钮固定显示在右侧详情的标题下方,不再藏在长对话底部;
|
|
27
|
-
- 每次对话结束后的分叉统一使用宿主自带的「在新对话中分支」,插件不再额外加「分叉」按钮;树节点详情里的「分叉」用于从任意旧节点开分支;
|
|
28
|
-
- 新分支不再自动归档,会直接出现在左侧工作区;每个非根节点在详情里有「归档」;
|
|
29
|
-
- **归档同步**:已归档的分支不在树里显示;在左侧取消归档后,它会自动回到树里。
|
|
30
|
-
|
|
31
|
-
## 为什么底层是 fork
|
|
32
|
-
|
|
33
|
-
DSH 的会话日志是 append-only 的线性 surface,聊天区只渲染「追加」消息。
|
|
34
|
-
在一个物理会话里用 `surfaceOp: replace` 切分支,只会改变模型看到的内容,
|
|
35
|
-
不会改变聊天记录;要做到「界面也跟着切」,只能重写整套 Chat 渲染层。
|
|
36
|
-
|
|
37
|
-
DSH 官方支持的分支原语是 fork:把某一轮之前的完整事件前缀复制成子会话。
|
|
38
|
-
子会话的聊天区显示的就是「到该轮为止的同一段对话」,因此切分支看起来是
|
|
39
|
-
「回到那一轮」,不是打开一个新对话。TreeCom 把这个过程藏在一个树面板后面。
|
|
40
|
-
|
|
41
|
-
## 环境要求
|
|
42
|
-
|
|
43
|
-
- DeepSeek Harness(Web UI),已启用本地插件/bundle。
|
|
44
|
-
- 插件是纯 JavaScript,无构建步骤;Host 半与 Client 半都在仓库里。
|
|
3
|
+
把一段对话的所有分叉管理成一棵可平移、可缩放的画布树。每个分支仍然是普通 DSH 会话,会正常出现在左侧工作区。
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
版本 **1.0.2** · MIT · DeepSeek Harness Web 插件
|
|
8
|
+
|
|
9
|
+
## 功能介绍
|
|
10
|
+
|
|
11
|
+
- **两个入口**:标题栏右上角的「对话树」按钮打开右侧边栏;会话视图中的「对话树」标签页全宽显示画布和详情。
|
|
12
|
+
- **画布树**:根节点在上方,分支向下生长;拖动空白处平移,滚轮或触控板缩放,树可以无限延伸。
|
|
13
|
+
- **查看节点**:点击节点只会选中并在右侧显示详情,不会切换分支;点「回到这一轮」才会切到该分支并定位。
|
|
14
|
+
- **悬停预览**:鼠标停在节点上可快速查看本轮提问、上下文占用和后续轮数;移入预览框不会消失,可直接选中文字、滚动查看完整问答。
|
|
15
|
+
- **分叉**:在节点详情里点「分叉」创建新分支;新分支会从父节点逐渐生长出来,并自动获得焦点。空白分支可以直接在右侧的「提问」框里开始对话。
|
|
16
|
+
- **详情面板**:显示上下文占用、后续轮数、完整提问 / 回答,支持 Markdown 渲染、复制、重命名、归档和分叉。
|
|
17
|
+
- **连续轮次折叠**:没有分叉的连续轮次会合并成一个带数字的节点,点击展开;展开后可折叠上方部分。
|
|
18
|
+
- **左侧分组**:左侧会话按对话树分组,同一根节点的会话放在一起,可整体展开 / 收起;当前对话树带一个绿色圆点,生成中时闪烁。
|
|
19
|
+
- **树管理**:树文件夹和「全部对话树」列表都支持删除整棵树;删除前会确认,并归档树内所有会话。
|
|
45
20
|
|
|
46
21
|
## 安装
|
|
47
22
|
|
|
48
|
-
`dsh plugin` 会把参数转发给 profile 目录里的 pnpm
|
|
23
|
+
`dsh plugin` 会把参数转发给 profile 目录里的 pnpm,npm 包名、`github:`、`link:`、`file:` 等 spec 都支持。
|
|
49
24
|
|
|
50
|
-
|
|
25
|
+
**从 npm 安装:**
|
|
51
26
|
|
|
52
27
|
```bash
|
|
53
28
|
dsh plugin --profile web add dsh-treecom
|
|
54
29
|
```
|
|
55
30
|
|
|
56
|
-
|
|
31
|
+
**从 GitHub 安装:**
|
|
57
32
|
|
|
58
33
|
```bash
|
|
59
34
|
dsh plugin --profile web add github:Serenity-2026/dsh-treecom
|
|
60
35
|
```
|
|
61
36
|
|
|
62
|
-
|
|
37
|
+
**本地开发:**
|
|
63
38
|
|
|
64
39
|
```bash
|
|
65
40
|
git clone https://github.com/Serenity-2026/dsh-treecom.git
|
|
66
41
|
dsh plugin --profile web add link:"$PWD/dsh-treecom"
|
|
67
42
|
```
|
|
68
43
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
> 仓库名和 npm 包名都是 `dsh-treecom`;Host 内部的 bundle id 仍是 `treecom`,不影响安装。
|
|
72
|
-
|
|
73
|
-
## 使用
|
|
74
|
-
|
|
75
|
-
画布的缩放和位置会按会话树记住:从侧边栏切到「对话树」标签页、重新打开面板或切换分支再回来时,画布会回到上次的位置,而不是每次都跳回根节点。
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
1. 点标题栏右上角的「对话树」打开右侧边栏,或使用会话视图里的「对话树」标签页;
|
|
79
|
-
2. 拖动空白处平移画布;滚轮 / 触控板缩放,节点始终按树形展开;没有分叉的连续轮次会折叠成一个节点,点击展开;
|
|
80
|
-
3. 点任意节点,在右侧查看该轮详情;点「回到这一轮」才切换分支并定位到那一轮;
|
|
81
|
-
4. 悬停节点可快速看本轮提问、上下文占用和后续轮数;鼠标移进预览框后可继续滚轮查看完整对话;
|
|
82
|
-
5. 在详情里「分叉」开新分支,新分支会作为普通会话出现在左侧,但当前对话区仍然停在原分支;新节点会在约 0.6 秒内从父节点位置逐渐生长出来,不再瞬间出现;
|
|
83
|
-
6. 分叉创建后会显示「分支创建成功,正在刷新对话树…」的进度提示;刷新完成前树上的选择、拖动、缩放、详情操作和刷新按钮都会锁定,完成后提示「分支已创建,对话树已刷新」;
|
|
84
|
-
7. 分叉完成后,树的选中状态和视野会自动移到新分支;新分支详情里会显示「回到这一轮」,点击即可切到该分支并继续提问;
|
|
85
|
-
8. 在详情里「重命名」改名,对话区会话标题会同步;叶子节点也会同步显示会话标题;
|
|
86
|
-
9. 在详情里「归档」把分支移出树;在左侧取消归档即可恢复。
|
|
87
|
-
|
|
88
|
-
## 结构与数据
|
|
89
|
-
|
|
90
|
-
- `index.js`:Host 半。只读索引 `/treecom`,读 `sessionQuery` 的会话日志,
|
|
91
|
-
把轮次按 `inheritedEventCount` 归一化,共享主干只画一次;标签写到
|
|
92
|
-
`~/.dsh/storages/treecom/state.json`。不写任何会话日志。
|
|
93
|
-
- `plugin.client.js`:Client 半。可平移/缩放画布树、右侧详情面板、标题栏入口、
|
|
94
|
-
会话视图「对话树」标签页;数据按会话缓存,会话变化时刷新;fork/切换走正常 Client 服务。
|
|
95
|
-
- `locale/`:中英文案;`icon.svg`:插件图标;`cordis.patch.yml`:bundle 挂载行。
|
|
96
|
-
|
|
97
|
-
所有数据都在本地:树索引读本地会话日志,标签写本地 sidecar 文件,只与本机 DSH 的 `/treecom` 路由通信,不发起外部网络请求。
|
|
98
|
-
|
|
99
|
-
## 已知边界
|
|
100
|
-
|
|
101
|
-
- 底层每个分支是一条 fork 会话,会正常出现在左侧工作区(标题带 (1)、(2) 后缀)。
|
|
102
|
-
- 点节点的「分叉」才会创建分支;如果随后不提问,会留下一个空分支,
|
|
103
|
-
在树里显示为「新分支 · 等待提问」;它也会出现在侧栏,可在节点上归档,或在左侧取消归档恢复。
|
|
104
|
-
- 当前分支正在生成时,分叉按钮、树上的分叉动作和归档按钮会禁用;
|
|
105
|
-
- 刷新按钮会转圈,完成后弹出「刷新成功」提示;点击时会清掉该会话缓存并强制重新请求 `/treecom`,不会因为缓存而看起来没有变化;空闲时不会自动轮询,避免反复重绘;生成中的会话会低频刷新;
|
|
106
|
-
- 卸载插件后所有会话仍在;归档的分支可在 DSH 的归档列表里取消归档。
|
|
107
|
-
|
|
108
|
-
## License
|
|
109
|
-
|
|
110
|
-
MIT © 2026 Minchuan Deng
|
|
111
|
-
|
|
112
|
-
### Ask a blank branch from the tree
|
|
113
|
-
|
|
114
|
-
Select a newly forked “新分支 / 等待提问” node, type directly into the 提问 box in the right detail pane, and press Enter. The question is sent to that branch’s own session, the current branch switches to the new turn (the green dot moves), the 对话树 tab is reopened, and the answer streams into the same 回答 box. The child tree is prefetched before the switch so it appears instantly.
|
|
115
|
-
|
|
116
|
-
### Collapse parent subtrees
|
|
117
|
-
|
|
118
|
-
Select a node that has children and use 「收起子节点 / 展开子节点」 in its detail header. Collapsing hides the complete subtree; expanding restores the previous nested state — a child that was expanded before stays expanded.
|
|
119
|
-
|
|
120
|
-
### Promote a branch into a new tree
|
|
121
|
-
|
|
122
|
-
Long-press a non-root node on the canvas and drag it to the top drop banner (「拖到这里,设为新树根」). This creates a new tree view rooted at that node and keeps the original tree intact. The promoted root is stored per folder and listed in the all-trees list.
|
|
123
|
-
|
|
124
|
-
Use the header switcher to choose 「当前对话树」 (default) or 「全部对话树」. The all-trees view is a list of every root conversation tree in the same folder (promoted views are not separate session trees); clicking an item opens that tree. The all-trees list uses the new Host `forest` action, so restart the Host once after updating.
|
|
125
|
-
|
|
126
|
-
The tree title is the name of its root node. In the detail header, each node is titled by its own name; an unnamed turn defaults to the first 10 characters of its question followed by an ellipsis.
|
|
127
|
-
|
|
128
|
-
### Grouped left sidebar
|
|
44
|
+
安装或更新后需要重新启动 DSH Host,并刷新 Web 页面。
|
|
129
45
|
|
|
130
|
-
|
|
46
|
+
## 如何使用
|
|
131
47
|
|
|
132
|
-
|
|
48
|
+
1. 点标题栏右上角的「对话树」,或切换到会话视图里的「对话树」标签页。
|
|
49
|
+
2. 拖动空白区域平移画布,滚轮缩放;用左上角「回到当前」定位当前叶子,用「居中」把树移回视野。
|
|
50
|
+
3. 点击任意节点查看右侧详情;点「回到这一轮」切换到该分支继续对话。
|
|
51
|
+
4. 在详情里点「分叉」创建新分支。新分支会出现在左侧工作区,但当前对话区仍停留在原分支;点击新分支详情里的「回到这一轮」即可切过去。
|
|
52
|
+
5. 对「新分支 / 等待提问」节点,可以直接在右侧「提问」框输入问题并发送,回答会显示在同一个「回答」框中。
|
|
53
|
+
6. 用详情里的「重命名」「归档」管理分支;左侧取消归档后,分支会重新回到树里。
|
|
54
|
+
7. 连续无分叉的轮次会折叠成带数字的节点,点击展开;悬停展开后的节点可只折叠上方部分。
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-treecom",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Tree-shaped conversation branching for DeepSeek Harness: one visible conversation, a right-sidebar tree and Conversation \"Tree\" view, and branch-from-any-turn.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"cordis.patch.yml",
|
|
18
18
|
"locale/*.json",
|
|
19
19
|
"icon.svg",
|
|
20
|
-
"README.md"
|
|
20
|
+
"README.md",
|
|
21
|
+
"assets/*"
|
|
21
22
|
],
|
|
22
23
|
"dsh": {
|
|
23
24
|
"bundle": {
|