dsh-session-matrix 0.17.1 → 0.17.3

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 CHANGED
@@ -16,8 +16,8 @@
16
16
  </p>
17
17
 
18
18
  <p align="center">
19
- 同时跑多个 Agent:四个原生会话窗格并排,一张按压缩风险着色的 Agent Graph,<br>
20
- 外加一份在上下文被压缩之前把工作交出去的协议。
19
+ 一个多 Agent 会话的<b>全景控制台</b>:四格原生会话并排,同时盯住多个会话与子代理并行跑任务,<br>
20
+ 一张神经链路图看清主 Agent 与子代理的关系,在上下文压缩、细节丢失之前把工作交出去。
21
21
  </p>
22
22
 
23
23
  <p align="center">
@@ -28,6 +28,11 @@
28
28
  <a href="#vs-context"><b>与 dsh-context</b></a>
29
29
  </p>
30
30
 
31
+ <p align="center">
32
+ <a href="https://github.com/deepseek-ai/deepseek-harness/discussions/13786"><b>官方社区介绍帖</b></a> ·
33
+ <a href="https://dev.to/wanqiu12345/running-four-ai-sessions-at-once-with-a-live-agent-graph-and-context-compaction-warnings-319"><b>英文介绍文章</b></a>
34
+ </p>
35
+
31
36
  ![左侧面板入口与智能体脉络](./docs/01-entry.png)
32
37
 
33
38
  ---
@@ -39,17 +44,19 @@
39
44
  | 位置 | 你得到什么 |
40
45
  |:--|:--|
41
46
  | **左侧面板列表** | 一行「会话矩阵工作台」,与「上下文洞察」「技能中心」同级 |
42
- | **面板顶部** | 两个标签:`工作区` · `智能体脉络` |
43
- | **面板右上角** | 一个 **通用交接提示词** 按钮。旁边的小圆点显示有几个会话进了注意区 |
47
+ | **面板顶部** | 两个标签:`工作区`(四格原生会话)· `智能体脉络`(主子 Agent 神经链路) |
48
+ | **面板右上角** | 一个 **通用交接提示词** 按钮。旁边的小圆点在会话达到「注意」或「建议交接」时点亮 |
44
49
 
45
- 它不改 DSH 任何核心代码,只使用公开的 Cordis 服务与 slot 扩展点。
50
+ 点进左侧入口,你看到的是一个全景视图:多个会话并行推进、主子 Agent 的父子关系一目了然、
51
+ 每个会话离压缩还有多远,靠节点颜色一眼看穿。它不改 DSH 任何核心代码,只使用公开的 Cordis 服务与 slot 扩展点。
46
52
 
47
53
  <a id="workspace"></a>
48
54
 
49
55
  ## 工作区:1–4 格原生会话
50
56
 
51
- 左侧是会话列表,按项目分组;子代理折叠在所属主会话下。**归档会话不显示**——和原生侧栏一致,
52
- 你在原生侧取消归档,这里下一次刷新就回来了。
57
+ 这是主战场:最多四格原生对话窗格并排,每格都能**直接打字发消息**(子代理窗格只读),
58
+ 不是一个只能看的截图墙。左侧是会话列表,按项目分组;子代理折叠在所属主会话下。
59
+ **归档会话不显示**——和原生侧栏一致,你在原生侧取消归档,这里下一次刷新就回来了。
53
60
 
54
61
  右侧窗格按格数自动排版:
55
62
 
@@ -73,16 +80,16 @@
73
80
 
74
81
  ## 智能体脉络:Agent Graph
75
82
 
76
- 一张四列有向拓扑,从左到右:
83
+ 一张神经链路图,把一个工作空间下的会话、以及每个会话派生的子代理之间的关系画出来。四列从左到右:
77
84
 
78
85
  ```
79
86
  工作台 → 项目 → 主会话 → 子代理
80
87
  ```
81
88
 
82
- - **边来自会话头的 `parentSession`**,不推断"同项目"这类弱关系。
83
- - **节点颜色 = 距离压缩点的远近**:正常 / 注意 / 临界。
84
- - **节点尺寸 = 累计用量**,谁最重一眼能看出来。
85
- - 选中任一节点,下方三个模块按该节点的子树重新计算。
89
+ - **边来自会话头真实的 `parentSession`**,不推断"同项目"这类弱关系——看到的就是实际发生的父子调度。
90
+ - **节点颜色 = 距离压缩点的远近**:正常 / 注意 / 临界;**节点尺寸 = 累计用量**,谁最重一眼能看出来。
91
+ - **点任一节点**,下方三个模块按它的子树重算:上下文构成、累计用量与预估费用、会话概览——
92
+ 不用来回切换会话,就能判断该不该继续、要不要交接。
86
93
 
87
94
  ![智能体脉络:节点颜色 = 距压缩点的远近,尺寸 = 累计用量(图中为模拟预警状态)](./docs/03-graph.png)
88
95
 
@@ -161,7 +168,7 @@ DSH 每次压缩都会在会话里留下一个检查点(`compact-checkpoint`
161
168
  | V4.1 Flash `deepseek-flash`(旧名 `deepseek-v4-flash`) | 0.02 | 1 | 4 |
162
169
  | V4 Pro `deepseek-v4-pro` | 0.15 | 4.5 | 13.5 |
163
170
 
164
- 峰时(北京时间工作日 09:00–12:00、14:00–18:00,节假日除外)**×2**。
171
+ 峰时(北京时间工作日 09:00–12:00、14:00–18:00)**×2**。法定节假日暂未建模,仍按工作日峰时计——见下方 Requirements 说明。
165
172
  `contextTimeline.cost` 已按峰谷分桶,直接分桶计算,不做时间推断。
166
173
  非 `deepseek` provider 回退 models.dev 美元价,按 `1 CNY = 0.15 USD` 折算。
167
174
 
@@ -290,9 +297,11 @@ npm pack --dry-run # 约 10 个文件 / 72 KB
290
297
  <details>
291
298
  <summary><b>English</b></summary>
292
299
 
293
- **A multi-agent workspace for DeepSeek Harness.** One sidebar entry, two views: up to four native
294
- conversation panes, and an Agent Graph that draws `workbench → project → session → subagent` coloured
295
- by compaction risk. A handoff protocol moves work to a fresh session before compaction drops the details.
300
+ **A panoramic console for multi-Agent sessions in DeepSeek Harness.** Watch up to four native
301
+ conversation panes at once and track several sessions and subagents running in parallel without
302
+ switching back and forth. A neural-link Agent graph draws `workbench → project → session → subagent`
303
+ from real `parentSession` data, and a handoff protocol moves work to a fresh session before compaction
304
+ drops the details.
296
305
 
297
306
  ```bash
298
307
  dsh plugin --profile web add dsh-session-matrix
package/lib/client.js CHANGED
@@ -2046,8 +2046,12 @@ window.__ModuleLoader__.load({
2046
2046
  const EMPTY_PANES = [null, null, null, null]
2047
2047
 
2048
2048
  function WorkspaceView({
2049
- sessions, projects, filter, setFilter, panes, setPanes, onOpenNative, railW, onRailW, kit, th, flashId,
2049
+ sessions, allSessions, projects, filter, setFilter, panes, setPanes, onOpenNative, railW, onRailW, kit, th, flashId,
2050
2050
  }) {
2051
+ // Pane pruning must judge against EVERY live session, not the filtered
2052
+ // view: pruning on the filtered list would close a pane whenever its
2053
+ // session merely fell outside the current search/scope.
2054
+ const knownSessions = allSessions ?? sessions
2051
2055
  const openIds = new Set(panes.filter(Boolean))
2052
2056
  const full = panes.length >= MAX_PANES
2053
2057
 
@@ -2169,13 +2173,13 @@ window.__ModuleLoader__.load({
2169
2173
  // forever. Clear those ids once the list has loaded; never prune while
2170
2174
  // the list is empty (that is a failed poll, not an empty workspace).
2171
2175
  React.useEffect(() => {
2172
- if (!sessions.length) return
2173
- const known = new Set(sessions.map(s => s.id))
2176
+ if (!knownSessions.length) return
2177
+ const known = new Set(knownSessions.map(s => s.id))
2174
2178
  setPanes(prev => {
2175
2179
  const next = prev.map(v => (v && !known.has(v) ? null : v))
2176
2180
  return next.some((v, i) => v !== prev[i]) ? next : prev
2177
2181
  })
2178
- }, [sessions, setPanes])
2182
+ }, [knownSessions, setPanes])
2179
2183
  const expanded = React.useMemo(() => new Set(expandedIds), [expandedIds])
2180
2184
  // A subagent opened in a pane must be visible even while collapsed.
2181
2185
  const forced = new Set()
@@ -3263,6 +3267,7 @@ window.__ModuleLoader__.load({
3263
3267
  ? h(WorkspaceView, {
3264
3268
  key: 'ws',
3265
3269
  sessions: filtered,
3270
+ allSessions,
3266
3271
  projects,
3267
3272
  filter,
3268
3273
  setFilter,
package/lib/index.js CHANGED
@@ -282,8 +282,10 @@ export function riskLevel(ratio, point, cfg, stats) {
282
282
  if (firstApproach) level = 'warn'
283
283
  else if (typeof count === 'number' && count >= 3 && level === 'warn') level = 'crit'
284
284
 
285
- const fresh = stats?.lastCompactionAt != null
286
- && Date.now() - stats.lastCompactionAt < COMPACTION_FRESH_MS
285
+ // A timestamp in the future (clock skew between machines) must not keep the
286
+ // freshness exemption alive until the clock catches up.
287
+ const sinceLast = stats?.lastCompactionAt != null ? Date.now() - stats.lastCompactionAt : null
288
+ const fresh = sinceLast != null && sinceLast >= 0 && sinceLast < COMPACTION_FRESH_MS
287
289
  if (fresh) level = level === 'crit' ? 'warn' : level === 'warn' ? 'ok' : level
288
290
  return level
289
291
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-session-matrix",
3
- "version": "0.17.1",
4
- "description": "A multi-agent workspace for DeepSeek Harness: run parallel sessions, visualize agent relationships, monitor context usage, and manage task handoffs.",
3
+ "version": "0.17.3",
4
+ "description": "A panoramic console for DeepSeek Harness: run multiple native sessions and subagents in parallel, see the agent graph, get compaction warnings, and hand work off before context is lost.",
5
5
  "keywords": [
6
6
  "deepseek-harness",
7
7
  "dsh",
@@ -11,12 +11,17 @@
11
11
  "session-management",
12
12
  "parallel-sessions",
13
13
  "context-monitoring",
14
+ "context-rot",
15
+ "compaction",
16
+ "compaction-count",
14
17
  "agent-graph",
15
18
  "agent-handoff",
19
+ "handoff-protocol",
16
20
  "agent-network",
17
21
  "多智能体工作台",
18
22
  "多会话管理",
19
- "会话关系图谱",
23
+ "会话矩阵",
24
+ "上下文压缩预警",
20
25
  "上下文监控"
21
26
  ],
22
27
  "homepage": "https://github.com/Wanqiu12345/dsh-session-matrix#readme",