dsh-session-flow 0.1.0 → 1.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/README.en.md +49 -99
- package/README.md +47 -97
- package/assets/screenshots/dock-right.png +0 -0
- package/assets/screenshots/folded-detail.png +0 -0
- package/assets/screenshots/fulltext-search.png +0 -0
- package/assets/screenshots/overview.png +0 -0
- package/assets/screenshots/session-flow-tab.png +0 -0
- package/assets/screenshots/turn-rail.png +0 -0
- package/lib/archive.js +40 -2
- package/lib/client.js +1528 -17
- package/lib/host.js +198 -3
- package/lib/index-store.js +1 -1
- package/lib/renames.js +80 -0
- package/package.json +4 -3
package/README.en.md
CHANGED
|
@@ -1,125 +1,75 @@
|
|
|
1
|
-
# dsh-session-flow
|
|
1
|
+
# dsh-session-flow — session review & archive plugin for DSH
|
|
2
2
|
|
|
3
3
|
> **English** | [中文](README.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Restructures DSH session message streams into a **foldable information flow with session-level summaries**: every session becomes an archive card for cross-workspace review, search, and export. The 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**.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Interface tour
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## What it does
|
|
14
|
-
|
|
15
|
-
| Feature | Description |
|
|
9
|
+
| Overview workbench | Session Flow tab |
|
|
16
10
|
|---|---|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
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) |
|
|
11
|
+
|  |  |
|
|
12
|
+
| Session cards with status, conclusion line, first task; hover ✎ to rename inline | "Session Flow" tab embedded in the native conversation page |
|
|
26
13
|
|
|
27
|
-
|
|
14
|
+
| Turn rail | Cross-session full-text search |
|
|
15
|
+
|---|---|
|
|
16
|
+
|  |  |
|
|
17
|
+
| Turn navigation on the left of the Chat tab: collapsed dashes ⇄ expanded cards, one-click jump | Free text in the overview triggers full-text mode: recall across workspaces, hits jump & locate |
|
|
28
18
|
|
|
29
|
-
|
|
19
|
+
| Dock details right | Folded detail view |
|
|
20
|
+
|---|---|
|
|
21
|
+
|  |  |
|
|
22
|
+
| Dock the detail into the official right panel: conversation + flow side by side, drag to resize | Turns folded by default; expand in true chronological order; four-tab navigation |
|
|
30
23
|
|
|
31
|
-
|
|
24
|
+
## Features
|
|
32
25
|
|
|
33
|
-
|
|
26
|
+
| Capability | Description |
|
|
27
|
+
|---|---|
|
|
28
|
+
| Overview workbench | Session cards (status / errors / duration) + conclusion line; sort, filter, workspace tabs |
|
|
29
|
+
| Structured search | `tool:` `file:` `err:` prefixes + free text |
|
|
30
|
+
| Folded detail view | Turns collapse to "user message + conclusion"; expand in true chronological order; on-demand loading |
|
|
31
|
+
| Four-tab navigation | User messages / tools / errors / search, click to locate & highlight |
|
|
32
|
+
| Lineage tree | Subagent derivation tree (offline archive + live runtime channels) |
|
|
33
|
+
| Dual-mode summary | Rule summary (zero cost, assembled live) + LLM summary (cached, prompts regeneration) |
|
|
34
|
+
| Live tracking | 3s polling for running sessions, breathing highlight + generating indicator |
|
|
35
|
+
| ZIP export | Overview + chunked timeline as a Markdown report |
|
|
36
|
+
| Session rename | Same data source as the official title (log-backed), synced both ways in real time |
|
|
37
|
+
| Health monitor | Four-level classification: active / tool-running / quiet / likely stalled; overview badges + detail live bar |
|
|
38
|
+
| Header health chip | Next to the mode label in the session header; a vertical bar that expands into a status card on hover, click to open detail |
|
|
39
|
+
| Session Flow tab | Embedded tab on the native conversation page, cross-navigates with the workbench |
|
|
40
|
+
| Turn rail | Turn jumps on the left of the Chat tab (Chat tab only) |
|
|
41
|
+
| Cross-session full-text search | Content-level recall, hits jump into the Session Flow tab and locate |
|
|
42
|
+
| Dock details right | Side-by-side with the main conversation |
|
|
43
|
+
| Cache management | View & clean index/timeline caches (never touches DSH data) |
|
|
44
|
+
|
|
45
|
+
## Install
|
|
34
46
|
|
|
35
47
|
```sh
|
|
48
|
+
# From the plugin market (search dsh-session-flow), or:
|
|
36
49
|
dsh plugin add dsh-session-flow
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
### Option 3: Install from GitHub
|
|
40
|
-
|
|
41
|
-
```sh
|
|
42
50
|
dsh plugin add github:YeqingTang/dsh-session-flow
|
|
43
51
|
```
|
|
44
52
|
|
|
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
|
-
### 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
|
|
53
|
+
After installing: **restart the DSH Web service** and **hard-refresh the browser** (Ctrl+Shift+R). Success shows the "Session Flow" entry in the sidebar.
|
|
63
54
|
|
|
64
|
-
|
|
55
|
+
Requirements: DSH Web GUI (latest stable); Node.js ≥ 22.19 (built-in zstd decoding, zero third-party dependencies).
|
|
65
56
|
|
|
66
|
-
|
|
57
|
+
## Usage
|
|
67
58
|
|
|
68
|
-
- **
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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.
|
|
59
|
+
- **Overview**: sidebar "Session Flow" → all session cards. Search supports `tool:` / `file:` / `err:` prefixes; free text of ≥2 characters additionally triggers cross-session full-text search.
|
|
60
|
+
- **Detail**: click a card. Turns are folded by default — click a turn header to expand; the four-tab navigation locates entries; the header offers LLM summary, ZIP export, dock right, and lineage.
|
|
61
|
+
- **Native conversation page**: the "Session Flow" tab reviews the current session in place; the turn rail on the Chat tab jumps to any turn; hover the title for ✎ rename (synced with the official title in real time).
|
|
62
|
+
- **Health status**: the health chip right of the mode label in the header (vertical bar: green = active / amber = tool running / red = likely stalled) expands on hover; click to open the Session Flow detail. Overview cards and the live bar show the same badges.
|
|
63
|
+
- **Live**: click "Live" on a running session, auto-refresh every 3 seconds.
|
|
112
64
|
|
|
113
65
|
## Acknowledgements
|
|
114
66
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
- **[
|
|
118
|
-
- **[
|
|
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.
|
|
67
|
+
- **[DeepSeek Harness (dsh)](https://github.com/deepseek-ai/deepseek-harness)** — the runtime this plugin builds on.
|
|
68
|
+
- **[@deepseek-ai/dsh-session-persistence-jsonl](https://github.com/deepseek-ai/deepseek-harness)** — the zstd multi-frame scanning algorithm (`lib/archive.js` adapted, MIT licensed).
|
|
69
|
+
- **[dsh-web-ui (@linxin666 family)](https://github.com/zhu1090093659/dsh-web-ui)** — reference for the sidebar-entry / panel mounting pattern; no code copied.
|
|
70
|
+
- **[dsh-webui-market-plugin](https://www.npmjs.com/package/@sanqi-normal/dsh-webui-market-plugin)** — plugin-market mechanism and distribution channel.
|
|
121
71
|
|
|
122
|
-
|
|
72
|
+
Apache-2.0 licensed; original license notices for third-party code are retained.
|
|
123
73
|
|
|
124
74
|
## License
|
|
125
75
|
|
package/README.md
CHANGED
|
@@ -1,125 +1,75 @@
|
|
|
1
|
-
# dsh-session-flow
|
|
1
|
+
# dsh-session-flow — DSH 会话回顾与归档插件
|
|
2
2
|
|
|
3
3
|
> **中文** | [English](README.en.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
把 DSH 会话的原始消息流重构成「可折叠的信息流 + 会话级汇总」:每个会话变成一张档案卡,跨工作区回顾、检索、导出。官方会话视图(Trajectory / Chat)长于正在发生的微观检查,本插件补足**事后回顾 / 归档 / 洞察**这一层。
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## 界面一览
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
| 总览工作台 | 会话流标签页 |
|
|
10
|
+
|---|---|
|
|
11
|
+
|  |  |
|
|
12
|
+
| 会话卡片墙:标题、状态、结论摘要行、首个任务;hover ✎ 行内重命名 | 原生会话页内嵌「会话流」标签:当前会话直接回顾 |
|
|
10
13
|
|
|
11
|
-
|
|
14
|
+
| 轮次悬浮条 | 跨会话全文检索 |
|
|
15
|
+
|---|---|
|
|
16
|
+
|  |  |
|
|
17
|
+
| 对话页左侧轮次导航:收拢短横条 ⇄ 展开条目卡,一键跳转任意轮次 | 总览自由文本搜索触发全文模式:跨工作区召回,命中直达定位 |
|
|
12
18
|
|
|
13
|
-
|
|
19
|
+
| 详情并入右栏 | 折叠详情页 |
|
|
20
|
+
|---|---|
|
|
21
|
+
|  |  |
|
|
22
|
+
| 详情并入官方右侧面板:主对话与会话流并行,拖拽调宽 | 回合默认折叠,展开按真实时间序;右侧四标签导航 |
|
|
23
|
+
|
|
24
|
+
## 功能
|
|
14
25
|
|
|
15
26
|
| 能力 | 说明 |
|
|
16
27
|
|---|---|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
22
|
-
|
|
|
23
|
-
|
|
|
24
|
-
|
|
|
25
|
-
|
|
|
28
|
+
| 总览工作台 | 会话卡片(状态/错误/耗时)+ 结论摘要行;排序、筛选、工作区 tabs |
|
|
29
|
+
| 结构化搜索 | `tool:` `file:` `err:` 前缀 + 自由文本 |
|
|
30
|
+
| 折叠详情页 | 回合折叠成「用户发言+结论」,展开按真实时间序;按需加载 |
|
|
31
|
+
| 四标签导航 | 用户发言 / 工具 / 错误 / 检索,点击定位高亮 |
|
|
32
|
+
| 血缘树 | 子代理派生关系树(离线档案 + 运行时实时双通道) |
|
|
33
|
+
| 双模式摘要 | 规则摘要(零开销实时组装)+ LLM 摘要(落盘复用、新对话提示重生成) |
|
|
34
|
+
| 实时跟踪 | 运行中会话 3 秒轮询,呼吸高亮 + 生成标志 |
|
|
35
|
+
| ZIP 导出 | 概览 + 时间线分卷 Markdown 报告 |
|
|
36
|
+
| 会话重命名 | 与官方标题同一数据源(log-backed),双向实时同步,随时改名 |
|
|
37
|
+
| 健康监控 | 活跃 / 工具执行中 / 静默中 / 疑似卡死四级分类;总览徽标 + 详情实时条 |
|
|
38
|
+
| 头部健康芯片 | 会话页顶栏模式标识右侧,竖条收拢 ⇄ 悬浮展开状态卡,点击直达详情 |
|
|
39
|
+
| 会话流标签页 | 原生会话页内嵌标签,与工作台互跳 |
|
|
40
|
+
| 轮次悬浮条 | 对话页左侧轮次跳转(仅对话页显示) |
|
|
41
|
+
| 跨会话全文检索 | 内容级召回,命中直达会话流标签页定位 |
|
|
42
|
+
| 详情并入右栏 | 与主对话双视角并行 |
|
|
43
|
+
| 缓存管理 | 索引/时间线缓存查看与清理(不影响 DSH 数据) |
|
|
26
44
|
|
|
27
45
|
## 安装
|
|
28
46
|
|
|
29
|
-
### 方式一:从插件市场安装(推荐)
|
|
30
|
-
|
|
31
|
-
打开 DSH Web GUI 侧边栏的「插件市场」,搜索 `dsh-session-flow`,点击安装即可。
|
|
32
|
-
|
|
33
|
-
### 方式二:通过 npm 安装
|
|
34
|
-
|
|
35
47
|
```sh
|
|
48
|
+
# 插件市场搜索 dsh-session-flow,或:
|
|
36
49
|
dsh plugin add dsh-session-flow
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
### 方式三:从 GitHub 安装
|
|
40
|
-
|
|
41
|
-
```sh
|
|
42
50
|
dsh plugin add github:YeqingTang/dsh-session-flow
|
|
43
51
|
```
|
|
44
52
|
|
|
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 解码,零第三方依赖)
|
|
53
|
+
安装后**重启 DSH Web 服务**并**硬刷新浏览器**(Ctrl+Shift+R),侧边栏出现「会话流」入口即成功。
|
|
61
54
|
|
|
62
|
-
|
|
55
|
+
环境要求:DSH Web GUI(最新稳定版);Node.js ≥ 22.19(内置 zstd 解码,零第三方依赖)。
|
|
63
56
|
|
|
64
|
-
|
|
57
|
+
## 使用
|
|
65
58
|
|
|
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
|
-
总览页 →「缓存管理」:查看缓存体积、按需清理(时间线缓存 / 全部)。清理后首次访问自动重建,不影响会话数据。
|
|
59
|
+
- **总览**:侧边栏「会话流」→ 全部会话卡片。搜索支持 `tool:` / `file:` / `err:` 前缀;自由文本 ≥2 字符自动追加跨会话全文检索结果。
|
|
60
|
+
- **详情**:点卡片进入。回合默认折叠,点回合头展开;右侧四标签导航定位;顶部可生成 LLM 摘要、导出 ZIP、并入右栏、查看血缘。
|
|
61
|
+
- **原生会话页**:会话顶部「会话流」标签直接回顾当前会话;对话页左侧轮次悬浮条跳转任意轮次;标题 hover ✎ 重命名(与官方标题实时同步)。
|
|
62
|
+
- **健康状态**:顶栏模式标识右侧的健康芯片(竖条:绿=活跃 / 黄=工具执行中 / 红=疑似卡死),悬浮展开看详情,点击直达会话流详情页;总览卡片与详情实时条同步显示徽标。
|
|
63
|
+
- **实时**:运行中会话点「实时」,3 秒自动刷新。
|
|
112
64
|
|
|
113
65
|
## 致谢
|
|
114
66
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
- **[
|
|
118
|
-
- **[
|
|
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)** —— 插件市场机制与本插件的分发渠道。
|
|
67
|
+
- **[DeepSeek Harness (dsh)](https://github.com/deepseek-ai/deepseek-harness)** —— 运行基础。
|
|
68
|
+
- **[@deepseek-ai/dsh-session-persistence-jsonl](https://github.com/deepseek-ai/deepseek-harness)** —— zstd 多帧扫描算法(`lib/archive.js` 借鉴,MIT 许可)。
|
|
69
|
+
- **[dsh-web-ui(@linxin666 全家桶)](https://github.com/zhu1090093659/dsh-web-ui)** —— 侧边栏入口与面板挂载模式参照,未复制代码。
|
|
70
|
+
- **[dsh-webui-market-plugin](https://www.npmjs.com/package/@sanqi-normal/dsh-webui-market-plugin)** —— 插件市场机制与分发渠道。
|
|
121
71
|
|
|
122
|
-
|
|
72
|
+
本插件遵循 Apache-2.0 许可,使用第三方代码时保留其原始许可声明。
|
|
123
73
|
|
|
124
74
|
## 许可
|
|
125
75
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/archive.js
CHANGED
|
@@ -129,6 +129,22 @@ export function parseSession(plaintext) {
|
|
|
129
129
|
const isErrorBlock = (block) =>
|
|
130
130
|
block !== null && typeof block === 'object' && block.type === 'tool-result' && block.isError === true
|
|
131
131
|
|
|
132
|
+
/** 候选 B:消息 content 的 text 块拼接(与 timeline.js textTextOf 同口径,内联避免循环依赖)。 */
|
|
133
|
+
const textOf = (content) => {
|
|
134
|
+
if (!Array.isArray(content)) return ''
|
|
135
|
+
return content
|
|
136
|
+
.filter((b) => b && b.type === 'text' && typeof b.text === 'string')
|
|
137
|
+
.map((b) => b.text)
|
|
138
|
+
.join('\n')
|
|
139
|
+
.trim()
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/** 候选 B:截断预览(与 timeline.js preview 同口径)。 */
|
|
143
|
+
const previewText = (text, max) => {
|
|
144
|
+
const t = String(text || '')
|
|
145
|
+
return t.length > max ? t.slice(0, max) + '…' : t
|
|
146
|
+
}
|
|
147
|
+
|
|
132
148
|
/** 从解析结果派生会话摘要(索引用,纯规则统计)。 */
|
|
133
149
|
export function summarizeParsed({ header, title, events }) {
|
|
134
150
|
const counts = {}
|
|
@@ -143,6 +159,9 @@ export function summarizeParsed({ header, title, events }) {
|
|
|
143
159
|
let steps = 0
|
|
144
160
|
let todos = 0
|
|
145
161
|
let lastError = null
|
|
162
|
+
// 候选 B:最近结论(最后一条有正文的 assistant 消息)+ 首个任务(第一个真实用户发言)。
|
|
163
|
+
let lastConclusion = null
|
|
164
|
+
let firstTask = null
|
|
146
165
|
const toolNames = new Set()
|
|
147
166
|
const artifactPaths = new Set()
|
|
148
167
|
for (const ev of events) {
|
|
@@ -168,8 +187,24 @@ export function summarizeParsed({ header, title, events }) {
|
|
|
168
187
|
lastError = { seq: ev.seq, time: ev.time }
|
|
169
188
|
}
|
|
170
189
|
break
|
|
171
|
-
case 'user/message':
|
|
172
|
-
|
|
190
|
+
case 'user/message':
|
|
191
|
+
userMessages++
|
|
192
|
+
// 候选 B:首个任务 = 第一个真实用户发言(source.kind 为空或 user,排除 plugin/goal 注入)。
|
|
193
|
+
if (firstTask === null) {
|
|
194
|
+
const kind = ev.data && ev.data.source ? String(ev.data.source.kind || '') : ''
|
|
195
|
+
if (kind === '' || kind === 'user') {
|
|
196
|
+
firstTask = previewText(textOf(ev.data && ev.data.content), 200) || null
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
break
|
|
200
|
+
case 'assistant/message':
|
|
201
|
+
assistantMessages++
|
|
202
|
+
// 候选 B:最近结论 = 最后一条有正文的 assistant 消息(每次覆盖 → 最终为最后一条)。
|
|
203
|
+
{
|
|
204
|
+
const text = textOf(ev.data && ev.data.message && ev.data.message.content)
|
|
205
|
+
if (text) lastConclusion = previewText(text, 500)
|
|
206
|
+
}
|
|
207
|
+
break
|
|
173
208
|
case 'turn/start': turns++; break
|
|
174
209
|
case 'step/start': steps++; break
|
|
175
210
|
case 'todo/write': todos++; break
|
|
@@ -203,6 +238,9 @@ export function summarizeParsed({ header, title, events }) {
|
|
|
203
238
|
toolNames: [...toolNames].sort(),
|
|
204
239
|
// 去重路径列表(M5c 文件检索索引,上限 60 条)。
|
|
205
240
|
artifactPaths: [...artifactPaths],
|
|
241
|
+
// 候选 B:最近结论 / 首个任务(null = 无正文结论 / 无真实用户发言)。
|
|
242
|
+
lastConclusion,
|
|
243
|
+
firstTask,
|
|
206
244
|
// 空会话:新建后未发生任何实质对话(无用户消息、无工具调用、无回合)。
|
|
207
245
|
empty: userMessages === 0 && toolCalls === 0 && turns === 0,
|
|
208
246
|
}
|