dsh-session-flow 0.1.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/LICENSE +201 -0
- package/README.en.md +126 -0
- package/README.md +126 -0
- package/cordis.patch.yml +7 -0
- package/lib/archive.js +272 -0
- package/lib/client.js +1913 -0
- package/lib/host.js +1132 -0
- package/lib/index-store.js +124 -0
- package/lib/timeline.js +257 -0
- package/package.json +51 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 YeqingTang
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.en.md
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# dsh-session-flow
|
|
2
|
+
|
|
3
|
+
> **English** | [中文](README.md)
|
|
4
|
+
|
|
5
|
+
> A DSH plugin that redesigns the session information flow: turning raw session message streams into a **foldable information flow with session-level summaries** — a cross-session archive cabinet.
|
|
6
|
+
|
|
7
|
+
**In one sentence**: Too many sessions, too slow to review? This plugin turns every DSH session into an "archive card" — understand in seconds what a session did, where it got to, which tools it used, which files it touched — and track running sessions in real time.
|
|
8
|
+
|
|
9
|
+
[DeepSeek Harness (dsh)](https://github.com/deepseek-ai/dsh) is an AI agent workbench. Its built-in session views (Trajectory / Chat) excel at the microscopic inspection of *what is happening right now*; this plugin fills the missing layer of **post-hoc review / archival / insight**: a cross-session, cross-workspace historical perspective.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## What it does
|
|
14
|
+
|
|
15
|
+
| Feature | Description |
|
|
16
|
+
|---|---|
|
|
17
|
+
| 🗂️ **Session overview workbench** | All sessions as cards: title, workspace, status (running / ended / empty / subagent), error count, duration, created time; sortable and filterable — find the target session at a glance |
|
|
18
|
+
| 🔍 **Structured search** | `tool:pwsh` finds sessions that used a tool, `file:src/` finds sessions that touched a path, `err:` finds sessions with errors, or just free-text search (title / tool name / file path) |
|
|
19
|
+
| 📜 **Folded detail view** | Turns are collapsed by default into a two-line "user message + conclusion" summary; expand to view in **true chronological order**: thinking → tool calls → replies, exactly as they happened — never re-stacked by type |
|
|
20
|
+
| 🧭 **Four-tab navigation** | Right panel: user message outline / tool call list / error list / in-session full-text search — click any entry to auto-expand the turn, scroll to it, and flash-highlight it |
|
|
21
|
+
| 🌳 **Subagent lineage tree** | Tree view of parent-session → subagent relationships; subagent details reuse the folded rendering; one-click "view subagent" from tool rows |
|
|
22
|
+
| 📝 **Dual-mode summary** | Auto summary card per session: **rule mode** (zero cost, assembled live: task count / first task / latest conclusion / top tools) + **LLM mode** (one-click, uses the DSH model, summarizes task by task; cached on disk, prompts regeneration when new conversation arrives) |
|
|
23
|
+
| ⚡ **Live tracking** | Click "Live" on a running session: auto-refresh every 3 seconds, the active turn gets a breathing highlight + a "generating…" indicator — no page refresh needed |
|
|
24
|
+
| 📦 **ZIP chunked export** | One-click export of the full session as a readable Markdown report (`00-overview.md` + timeline chunks, ≤700KB each), packed as a ZIP — great for archival, sharing, or handoff |
|
|
25
|
+
| 🧹 **Cache management** | Visual view and scoped cleanup of index/timeline caches (only this plugin's caches; never touches DSH data) |
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
### Option 1: Install from the plugin market (recommended)
|
|
30
|
+
|
|
31
|
+
Open "Plugin Market" in the DSH Web GUI sidebar, search for `dsh-session-flow`, and click install.
|
|
32
|
+
|
|
33
|
+
### Option 2: Install via npm
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
dsh plugin add dsh-session-flow
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Option 3: Install from GitHub
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
dsh plugin add github:YeqingTang/dsh-session-flow
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Option 4: Install from source (development)
|
|
46
|
+
|
|
47
|
+
```sh
|
|
48
|
+
git clone https://github.com/YeqingTang/dsh-session-flow.git
|
|
49
|
+
dsh plugin add link:/path/to/dsh-session-flow
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### After installing
|
|
53
|
+
|
|
54
|
+
Whatever method you chose: **restart the DSH Web service**, then **hard-refresh the browser** (Ctrl+Shift+R / Ctrl+F5).
|
|
55
|
+
Installation succeeds when the "**Session Flow**" entry appears in the sidebar.
|
|
56
|
+
|
|
57
|
+
### Requirements
|
|
58
|
+
|
|
59
|
+
- DSH Web GUI (latest stable)
|
|
60
|
+
- Node.js ≥ 22.19 (uses built-in zstd decoding, zero third-party dependencies)
|
|
61
|
+
|
|
62
|
+
## Usage guide
|
|
63
|
+
|
|
64
|
+
### 1. Open the overview
|
|
65
|
+
|
|
66
|
+
Click "**Session Flow**" in the sidebar → all sessions are shown as cards. Supports:
|
|
67
|
+
|
|
68
|
+
- **Search**: the top search box mixes structured prefixes and free text:
|
|
69
|
+
|
|
70
|
+
| Syntax | What it does | Example |
|
|
71
|
+
|---|---|---|
|
|
72
|
+
| `tool:xxx` | Sessions that used a tool | `tool:pwsh` |
|
|
73
|
+
| `file:xxx` | Sessions that touched a path | `file:src/` |
|
|
74
|
+
| `err:` | Sessions with errors | `err:` |
|
|
75
|
+
| free text | Title / workspace / tool name / file path | `session flow` |
|
|
76
|
+
|
|
77
|
+
- **Workspace tabs**: filter by workspace; **sort**: recently run (default) / recently created / oldest first / most tools / longest
|
|
78
|
+
- **Stats bar**: tool usage Top 6 + one-click filter for problem sessions (with errors)
|
|
79
|
+
|
|
80
|
+
### 2. View a session
|
|
81
|
+
|
|
82
|
+
Click any session card:
|
|
83
|
+
|
|
84
|
+
- **Turns collapsed by default**: only "👤 user message + ✅ conclusion" summaries are shown; click a turn header to expand
|
|
85
|
+
- **Expanded**: view in true chronological order — thinking (🧠), tool calls (🛠️, with args / result / duration / error marks), assistant replies
|
|
86
|
+
- **Right navigation**: four tabs — user messages / tools / errors / search; click to locate in the content area (selected turn gets a blue highlight)
|
|
87
|
+
- **Summary card**: rule summary at top; click "Generate LLM summary" for an intelligent summary (model quota consumed on demand)
|
|
88
|
+
|
|
89
|
+
### 3. Track a live session
|
|
90
|
+
|
|
91
|
+
When a session is **running** (a "running" badge in the header):
|
|
92
|
+
|
|
93
|
+
1. Click the "**Live**" button in the top-right
|
|
94
|
+
2. The timeline auto-refreshes (every 3 s); the active turn gets a **green breathing highlight** + a "generating…" indicator at the bottom
|
|
95
|
+
3. Click "Exit live" to return to the archived view
|
|
96
|
+
|
|
97
|
+
### 4. Export a report
|
|
98
|
+
|
|
99
|
+
In the detail view, click "**Export report (ZIP)**" → download `session-report-<title>.zip`, unzip to get:
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
00-overview.md # session metadata + summary + tool stats + artifact list + chunk guide
|
|
103
|
+
01-timeline-turn1-25.md # per-turn timeline (chunked, ≤700KB each)
|
|
104
|
+
02-timeline-turn26-50.md # …
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
The Markdown report opens in any editor / VSCode / Typora.
|
|
108
|
+
|
|
109
|
+
### 5. Cache management
|
|
110
|
+
|
|
111
|
+
Overview → "Cache management": view cache sizes and clean selectively (timeline cache / all). Caches rebuild automatically on next access; session data is never affected.
|
|
112
|
+
|
|
113
|
+
## Acknowledgements
|
|
114
|
+
|
|
115
|
+
This plugin stands on the shoulders of the DSH community. Thanks to:
|
|
116
|
+
|
|
117
|
+
- **[DeepSeek Harness (dsh)](https://github.com/deepseek-ai/deepseek-harness)** — the DSH agent workbench and plugin ecosystem this plugin runs on.
|
|
118
|
+
- **[@deepseek-ai/dsh-session-persistence-jsonl](https://github.com/deepseek-ai/deepseek-harness)** — the zstd multi-frame scanning algorithm for session archives (`scanZstdFrames` in `lib/archive.js` is adapted from this project, MIT licensed).
|
|
119
|
+
- **[dsh-web-ui (@linxin666 family)](https://github.com/zhu1090093659/dsh-web-ui)** — reference for the sidebar-entry and center-panel mounting pattern (DOM-level injection + panel mutual exclusion); no code copied; includes dsh-task-board / dsh-ssh etc.
|
|
120
|
+
- **[dsh-webui-market-plugin](https://www.npmjs.com/package/@sanqi-normal/dsh-webui-market-plugin)** — the plugin-market mechanism and a distribution channel for this plugin.
|
|
121
|
+
|
|
122
|
+
> Copyrights belong to their respective authors; this plugin is Apache-2.0 licensed and retains original license notices for third-party code (see comments in `lib/archive.js`).
|
|
123
|
+
|
|
124
|
+
## License
|
|
125
|
+
|
|
126
|
+
[Apache-2.0](LICENSE)
|
package/README.md
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# dsh-session-flow
|
|
2
|
+
|
|
3
|
+
> **中文** | [English](README.en.md)
|
|
4
|
+
|
|
5
|
+
> DSH 会话信息流重设计插件:把 DSH 会话的原始消息流重构成「可折叠的信息流 + 会话级汇总」——跨会话档案柜。
|
|
6
|
+
|
|
7
|
+
**一句话**:会话太多了,回看太慢?这个插件把 DSH 的每个会话变成一张「档案卡」——几秒看懂一次会话做了什么、干到哪一步、用过哪些工具、动过哪些文件,还能实时跟踪正在进行的会话。
|
|
8
|
+
|
|
9
|
+
DSH([DeepSeek Harness](https://github.com/deepseek-ai/dsh))是 AI 智能体工作台。它的官方会话视图(Trajectory / Chat)长于「正在发生时」的微观检查;本插件补足**事后回顾 / 归档 / 洞察**这一层:跨会话、跨工作区的历史视角。
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 它能做什么
|
|
14
|
+
|
|
15
|
+
| 能力 | 说明 |
|
|
16
|
+
|---|---|
|
|
17
|
+
| 🗂️ **会话总览工作台** | 所有会话卡片化展示:标题、工作区、状态(进行中/已结束/空会话/子代理)、错误数、耗时、创建时间;支持排序与筛选,一眼找到目标会话 |
|
|
18
|
+
| 🔍 **结构化搜索** | `tool:pwsh` 找用过某工具的会话、`file:src/` 找动过某路径的会话、`err:` 找有错误的会话,或直接搜自由文本(标题/工具名/文件路径) |
|
|
19
|
+
| 📜 **折叠详情页** | 回合默认折叠成「用户发言 + 结论」两行摘要;展开后按**真实时间序**查看:思考 → 工具调用 → 回复,与发生顺序完全一致,不再被堆叠打乱 |
|
|
20
|
+
| 🧭 **四标签导航** | 右侧面板:用户发言大纲 / 工具调用清单 / 错误列表 / 会话内全文检索——点击任意条目,正文区自动展开回合并滚动定位、高亮闪烁 |
|
|
21
|
+
| 🌳 **子代理血缘树** | 主会话与子代理的派生关系树状展示;子代理详情复用折叠渲染;工具行「查看子代理」一键直达 |
|
|
22
|
+
| 📝 **双模式摘要** | 每个会话自动生成摘要卡:**规则模式**(零开销,实时组装:任务数/首个任务/最近结论/工具 Top)+ **LLM 模式**(一键触发,调用 DSH 模型,按任务逐项概括;生成后落盘复用,有新对话自动提示重新生成) |
|
|
23
|
+
| ⚡ **实时跟踪** | 进行中的会话点「实时」:3 秒自动刷新最新进展,运行中的回合呼吸高亮 + 「正在生成…」动态标志,无需刷新页面 |
|
|
24
|
+
| 📦 **ZIP 分卷导出** | 一键把完整会话导出为可读 Markdown 报告(`00-概览.md` + 时间线分卷,单卷 ≤700KB),打包成 ZIP 下载——归档、分享、转给同事都方便 |
|
|
25
|
+
| 🧹 **缓存管理** | 索引与时间线缓存可视化查看、分类清理(仅清理本插件缓存,不影响 DSH 数据) |
|
|
26
|
+
|
|
27
|
+
## 安装
|
|
28
|
+
|
|
29
|
+
### 方式一:从插件市场安装(推荐)
|
|
30
|
+
|
|
31
|
+
打开 DSH Web GUI 侧边栏的「插件市场」,搜索 `dsh-session-flow`,点击安装即可。
|
|
32
|
+
|
|
33
|
+
### 方式二:通过 npm 安装
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
dsh plugin add dsh-session-flow
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 方式三:从 GitHub 安装
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
dsh plugin add github:YeqingTang/dsh-session-flow
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### 方式四:本地源码安装(开发/调试)
|
|
46
|
+
|
|
47
|
+
```sh
|
|
48
|
+
git clone https://github.com/YeqingTang/dsh-session-flow.git
|
|
49
|
+
dsh plugin add link:/path/to/dsh-session-flow
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### 安装后的生效步骤
|
|
53
|
+
|
|
54
|
+
任何安装方式完成后:**重启 DSH Web 服务**,然后浏览器**硬刷新**(Ctrl+Shift+R / Ctrl+F5)。
|
|
55
|
+
侧边栏出现「**会话流**」入口即安装成功。
|
|
56
|
+
|
|
57
|
+
### 环境要求
|
|
58
|
+
|
|
59
|
+
- DSH Web GUI(最新稳定版)
|
|
60
|
+
- Node.js ≥ 22.19(使用内置 zstd 解码,零第三方依赖)
|
|
61
|
+
|
|
62
|
+
## 使用指南
|
|
63
|
+
|
|
64
|
+
### 1. 进入总览
|
|
65
|
+
|
|
66
|
+
点击侧边栏「**会话流**」→ 所有会话卡片化展示。支持:
|
|
67
|
+
|
|
68
|
+
- **搜索**:顶部搜索框,支持结构化前缀与自由文本混用:
|
|
69
|
+
|
|
70
|
+
| 语法 | 作用 | 示例 |
|
|
71
|
+
|---|---|---|
|
|
72
|
+
| `tool:xxx` | 用过该工具的会话 | `tool:pwsh` |
|
|
73
|
+
| `file:xxx` | 动过该路径的会话 | `file:src/` |
|
|
74
|
+
| `err:` | 有错误记录的会话 | `err:` |
|
|
75
|
+
| 自由文本 | 标题/工作区/工具名/文件路径 | `会话流插件` |
|
|
76
|
+
|
|
77
|
+
- **工作区 tabs**:按工作区筛选;**排序**:最近运行(默认)/最近创建/最早创建/工具最多/耗时最长
|
|
78
|
+
- **统计条**:工具使用 Top 6 + 问题会话(有错误)一键筛选
|
|
79
|
+
|
|
80
|
+
### 2. 查看会话详情
|
|
81
|
+
|
|
82
|
+
点击任意会话卡片:
|
|
83
|
+
|
|
84
|
+
- **回合默认折叠**:只显示「👤 用户发言 + ✅ 结论」摘要;点击回合头展开
|
|
85
|
+
- **展开后**:按真实时间序查看思考(🧠)、工具调用(🛠️,含参数/结果/耗时/错误标记)、助手回复
|
|
86
|
+
- **右侧导航**:用户发言 / 工具 / 错误 / 检索 四个标签,点击定位到正文对应位置(选中回合蓝色高亮)
|
|
87
|
+
- **会话摘要卡**:顶部显示规则摘要;点「生成 LLM 摘要」获得智能摘要(按需消耗模型额度)
|
|
88
|
+
|
|
89
|
+
### 3. 跟踪实时会话
|
|
90
|
+
|
|
91
|
+
会话**进行中**时(头部显示「进行中」徽标):
|
|
92
|
+
|
|
93
|
+
1. 点右上角「**实时**」按钮
|
|
94
|
+
2. 时间线自动刷新(3 秒一次),运行中回合**绿色呼吸高亮** + 底部「正在生成…」动态标志
|
|
95
|
+
3. 点「退出实时」回到归档视图
|
|
96
|
+
|
|
97
|
+
### 4. 导出报告
|
|
98
|
+
|
|
99
|
+
详情页点「**导出报告 (ZIP)**」→ 下载 `会话报告-<标题>.zip`,解压即得:
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
00-概览.md # 会话元信息 + 摘要 + 工具统计 + 产物清单 + 分卷指引
|
|
103
|
+
01-时间线-回合1-25.md # 逐回合时间线(分卷,单卷 ≤700KB)
|
|
104
|
+
02-时间线-回合26-50.md # …
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Markdown 报告可直接用任意编辑器/VSCode/Typora 打开。
|
|
108
|
+
|
|
109
|
+
### 5. 缓存管理
|
|
110
|
+
|
|
111
|
+
总览页 →「缓存管理」:查看缓存体积、按需清理(时间线缓存 / 全部)。清理后首次访问自动重建,不影响会话数据。
|
|
112
|
+
|
|
113
|
+
## 致谢
|
|
114
|
+
|
|
115
|
+
本插件站在 DSH 社区的肩膀上,感谢以下项目:
|
|
116
|
+
|
|
117
|
+
- **[DeepSeek Harness (dsh)](https://github.com/deepseek-ai/deepseek-harness)** —— DSH 智能体工作台与插件体系,本插件的运行基础。
|
|
118
|
+
- **[@deepseek-ai/dsh-session-persistence-jsonl](https://github.com/deepseek-ai/deepseek-harness)** —— 会话存档的 zstd 多帧扫描算法(`lib/archive.js` 中 `scanZstdFrames` 借鉴自该项目,MIT 许可)。
|
|
119
|
+
- **[dsh-web-ui(@linxin666 全家桶)](https://github.com/zhu1090093659/dsh-web-ui)** —— 侧边栏入口与中栏面板的挂载模式参照(DOM 级注入 + 面板互斥协作),未复制代码;含 dsh-task-board / dsh-ssh 等。
|
|
120
|
+
- **[dsh-webui-market-plugin](https://www.npmjs.com/package/@sanqi-normal/dsh-webui-market-plugin)** —— 插件市场机制与本插件的分发渠道。
|
|
121
|
+
|
|
122
|
+
> 版权归各自作者所有;本插件遵循 Apache-2.0 许可,使用第三方代码时保留其原始许可声明(见 `lib/archive.js` 注释)。
|
|
123
|
+
|
|
124
|
+
## 许可
|
|
125
|
+
|
|
126
|
+
[Apache-2.0](LICENSE)
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# dsh-session-flow bundle patch: mounts the session-flow plugin over the web
|
|
2
|
+
# profile. The host half registers the /api/session-flow route; the client
|
|
3
|
+
# half contributes the "会话流" sidebar entry and the center-column view.
|
|
4
|
+
|
|
5
|
+
- insert:
|
|
6
|
+
- id: dsh-session-flow
|
|
7
|
+
name: dsh-session-flow
|