dsh-session-superagent 0.9.262 → 0.9.263

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 CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  格式参照 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),版本号遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
4
4
 
5
+ ## [0.9.263] - 2026-11-05 —— 官方 Thread 详情并入「判定」,不再只发 Toast
6
+
7
+ ### `/trace` 同时返回结构化数据
8
+
9
+ 旧字段 `text` 保留给模型与旧客户端;新增 `traces`,供面板渲染真实时间线。
10
+ 工具与 HTTP 的文本仍逐字一致,无痕迹时 `traces: []`。
11
+
12
+ ### 判定页内联时间线
13
+
14
+ 点击「追溯 #42」后,结果直接出现在判定页:
15
+
16
+ - 首次看到 / 上次上报;
17
+ - 被过滤及原因;
18
+ - 被冷却期吸收;
19
+ - 唤醒成功或失败。
20
+
21
+ 采用官方 `dt-timeline / dt-event / dt-event-head / dt-event-foot` 结构,
22
+ 不增加新的一级 Tab,也不再只把多行结果压进一条 Toast。
23
+
24
+ ### 证据
25
+
26
+ ```
27
+ npm test → 445/445(新增:结构化 /trace 2 + 面板点击到内联时间线 1)
28
+ ```
29
+
5
30
  ## [0.9.262] - 2026-11-05 —— 状态可迁移、唤醒可分段、安装可复述
6
31
 
7
32
  继续吸收官方工程纪律,不引入多角色或独立 Runtime。
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  <img src="assets/icon-180.png" width="88" height="88" alt="">
4
4
 
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
6
- [![Version](https://img.shields.io/badge/version-0.9.262-green.svg)](https://github.com/MYCF711/dsh-session-superagent/releases)
6
+ [![Version](https://img.shields.io/badge/version-0.9.263-green.svg)](https://github.com/MYCF711/dsh-session-superagent/releases)
7
7
  [![npm](https://img.shields.io/npm/v/dsh-session-superagent.svg)](https://www.npmjs.com/package/dsh-session-superagent)
8
8
  [![dsh](https://img.shields.io/badge/DeepSeek%20Harness-plugin-orange.svg)](https://github.com/topics/dsh-plugin)
9
9
  [![awesome](https://img.shields.io/badge/awesome-dsh--plugin-%E2%9C%93-success.svg)](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin)
@@ -146,7 +146,7 @@ Gitee 私有仓库要在「设置 → 凭证」填私人令牌;公开仓库不
146
146
  ## 开发
147
147
 
148
148
  ```sh
149
- npm test # 442 项单测(带离线开关;裸 node --test 会真去 spawn gh,两分半)
149
+ npm test # 445 项单测(带离线开关;裸 node --test 会真去 spawn gh,两分半)
150
150
  ```
151
151
 
152
152
  ### 工具输出:文本给人和 agent,JSON 给程序
@@ -206,7 +206,7 @@ dsh plugin --profile <profile> add dsh-session-superagent@latest
206
206
 
207
207
 
208
208
  ```bash
209
- npm test # 442 项单测(带离线开关,约 1.6 秒)
209
+ npm test # 445 项单测(带离线开关,约 1.6 秒)
210
210
  node scripts/ui-audit.mjs # 11 项 UI 指标(写死颜色 / 自造 token / 官方结构采用 …)
211
211
  node scripts/preflight.mjs # 41 项门禁(含上面两条,外加 profile 一致性、路由面、包内容)
212
212
  node scripts/render-preview.mjs preview.html # 双主题静态预览,直接浏览器打开
package/client.js CHANGED
@@ -14,7 +14,7 @@ window.__ModuleLoader__.load({
14
14
  const { useCallback, useEffect, useRef, useState } = React
15
15
 
16
16
  // 客户端版本探针:每次模块加载写一次,用来确认浏览器里跑的是哪一版
17
- const CLIENT_VERSION = '0.9.262'
17
+ const CLIENT_VERSION = '0.9.263'
18
18
  let BASE = '/session-superagent'
19
19
  /**
20
20
  * 挑「最新的那个服务端实例」。
@@ -968,6 +968,26 @@ window.__ModuleLoader__.load({
968
968
  return [view, notify]
969
969
  }
970
970
 
971
+ /** 判定页内联追溯时间线:结构化 traces 优先,旧服务端只有 text 时降级。 */
972
+ function TraceTimeline({ payload }) {
973
+ if (payload.loading) return h('p', { className: 'dt-hint' }, '正在追溯 #' + payload.number + '…')
974
+ if (payload.error) return h('p', { className: 'dt-error' }, '追溯失败:' + payload.error)
975
+ const traces = Array.isArray(payload.traces) ? payload.traces : []
976
+ if (traces.length === 0) return h('p', { className: 'dt-hint' }, payload.text || '没有结果')
977
+ return h('ol', { className: 'dt-timeline' }, traces.map((trace) => {
978
+ const events = []
979
+ if (trace.seen) events.push({ at: trace.seen, label: '首次看到' })
980
+ if (trace.reported) events.push({ at: trace.reported, label: '上次上报' })
981
+ for (const item of trace.filtered || []) events.push({ at: item.at, label: '被过滤:' + (item.reason || '未知') })
982
+ for (const item of trace.absorbed || []) events.push({ at: item.at, label: '被冷却期吸收' })
983
+ for (const item of trace.wakes || []) events.push({ at: item.at, label: item.ok ? '唤醒成功' : '唤醒失败:' + (item.reason || '未知') })
984
+ events.sort((a, b) => String(a.at || '').localeCompare(String(b.at || '')))
985
+ return h('li', { className: 'dt-event', key: String(trace.repo) + '#' + trace.number },
986
+ h('div', { className: 'dt-event-head' }, '#' + trace.number + ' @ ' + (trace.repo || '?') + ':' + trace.verdict),
987
+ events.map((event, index) => h('div', { className: 'dt-event-foot', key: index }, event.label + ' · ' + event.at)))
988
+ }))
989
+ }
990
+
971
991
  function ZhuliPanel(props) {
972
992
  const sessionId = props && props.sessionId
973
993
  /** 暂停原因码 → 人话(服务端 deferReason 是唯一来源)。 */
@@ -1027,6 +1047,8 @@ window.__ModuleLoader__.load({
1027
1047
  const [ghDir, setGhDir] = useState('')
1028
1048
  // Gitee 私人令牌(和 GitHub token 分开存;留空 = 公开仓库也能读)
1029
1049
  const [giteeToken, setGiteeToken] = useState('')
1050
+ // 判定页内联追溯结果(官方 Thread 详情最小吸收):不再只塞进一条 Toast。
1051
+ const [traceResult, setTraceResult] = useState(null)
1030
1052
  // 建议规则弹层:给"叫醒了没回音"一个下一步动作(只提供可复制的规则,不替客户写仓库文件)
1031
1053
 
1032
1054
  // 「我现在手上有没有能渲染的数据」。判断依据必须是**当前 snap**,不是"以前拿到过一次" ——
@@ -1685,17 +1707,19 @@ window.__ModuleLoader__.load({
1685
1707
  className: 'dt-textlink',
1686
1708
  type: 'button',
1687
1709
  onClick: async () => {
1710
+ setTraceResult({ loading: true, number: asNumber })
1688
1711
  try {
1689
1712
  const query = '/trace?number=' + encodeURIComponent(asNumber) + (onlyRepo ? '&repo=' + encodeURIComponent(onlyRepo) : '')
1690
1713
  const payload = await call(query)
1691
- notify(String((payload && payload.text) || '没有结果').split(String.fromCharCode(10)).join(' · '), 'info')
1714
+ setTraceResult(payload || { text: '没有结果', traces: [] })
1692
1715
  } catch (error) {
1693
- notify('追溯失败:' + String((error && error.message) || error), 'error')
1716
+ setTraceResult({ error: String((error && error.message) || error), number: asNumber })
1694
1717
  }
1695
1718
  },
1696
1719
  }, '追溯 #' + asNumber),
1697
1720
  h('span', { className: 'dt-row-meta' }, onlyRepo ? '(在 ' + onlyRepo + ' 里查)' : '(在所有守里查)'))
1698
- : null)
1721
+ : null,
1722
+ traceResult ? h(TraceTimeline, { payload: traceResult }) : null)
1699
1723
  })(),
1700
1724
  (() => {
1701
1725
  const counts = new Map()
package/lib/index.js CHANGED
@@ -47,7 +47,7 @@ import {
47
47
 
48
48
  export const name = 'dsh-session-superagent'
49
49
  /** 服务端版本:随 package.json 同步(meta 测试守着)。客户端据此挑「最新的那个实例」。 */
50
- export const SERVER_VERSION = '0.9.262'
50
+ export const SERVER_VERSION = '0.9.263'
51
51
  export const inject = ['tools', 'agents', 'webServer']
52
52
  /** 一条会话每小时最多被唤醒几次(跨所有守累计)。单守上限挡不住多守叠加。 */
53
53
  // 本进程启动时刻:用来区分「刚重启还没轮到」与「定时器真的丢了」
@@ -2320,7 +2320,8 @@ const UPDATE_CACHE_MS = 10 * 60 * 1000
2320
2320
  const text = traces.length > 0
2321
2321
  ? formatTraceText(traces)
2322
2322
  : noTraceText(number, repo ? ' ' + repo : '所有守')
2323
- json(res, 200, { ok: true, text })
2323
+ // text 给模型与旧客户端;traces 给面板渲染结构化时间线(官方 Thread 详情的最小吸收)。
2324
+ json(res, 200, { ok: true, text, traces })
2324
2325
  },
2325
2326
  })
2326
2327
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-session-superagent",
3
- "version": "0.9.262",
3
+ "version": "0.9.263",
4
4
  "description": "Session-level superagent for DeepSeek Harness: watch a GitHub repository and wake a session when something needs doing. Credentials never reach the model.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",