dsh-session-superagent 0.8.55 → 0.8.57

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,46 @@
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.8.57] - 2026-11-02 —— 唤醒消息带上「为什么是这几条」
6
+
7
+ ### 学到的(知识库第 6 条)
8
+ GitHub 通知自带 `reason`(为什么通知你),Slack 摘要把分组依据写出来。
9
+ 共性:**只给结果不给依据,接收方没法判断要不要调过滤条件。**
10
+
11
+ 主理鱼的唤醒消息就是任务书,原来只有条目列表 —— 会话看到 3 条,不知道是不是一共 9 条、
12
+ 也不知道另外 30 条被什么刷掉了。
13
+
14
+ ### 改了什么
15
+ 唤醒消息里多一行:
16
+
17
+ ```
18
+ 【为什么是这几条】本轮共 9 条变化;按「最近更新」取前 3 条;同时跳过 不在标签白名单: ai-fix × 5、机器人 × 3
19
+ ```
20
+
21
+ 数据来自本轮统计(`changedTotal` / `batchLimit` / `filterCounts`),次数为 0 的原因不凑数;
22
+ 拿不到依据时**不加这一行**(不硬编)。
23
+
24
+ ### 测试
25
+ - 新增 1 例:有依据必须出现该行、0 次数不出现、无信息时不出现。合计 **111 例**。
26
+
27
+ ## [0.8.56] - 2026-11-02 —— 跳过原因可点开看明细
28
+
29
+ 0.8.55 把「跳过原因」做成了累计分布,但只能看数字。客户下一步必然问「那这 37 条是哪些?」
30
+
31
+ ### 改法
32
+ - 原因标签从 `Tag`(纯展示)换成官方 `Pill`(可点);
33
+ - 点一下 → 只看这类条目(`#42 一个被刷掉的 issue`),再点一次取消;
34
+ - 旁边多一个「清除筛选」,避免不知道自己在筛选状态。
35
+
36
+ 顺带说明一次**没做**的事:我本来想加「分页拉取防止一次刷新超过 20 条漏掉」,
37
+ 实测目标仓库 `MYCF711/dsh-GOkifu-compact` 只有 4 条 issue,而且我们是
38
+ `sort=updated&direction=desc` 取最近 20 条 —— 这正是变更检测需要的形态,
39
+ **加分页是凭空的复杂度**,故放弃(这条判断记在知识库里,免得以后又想起来重做)。
40
+
41
+ ### 测试
42
+ - 新增 1 例:原因渲染成 Pill、文案带次数、选中后列出该类条目(#42)。
43
+ - 合计 **110 例**。
44
+
5
45
  ## [0.8.55] - 2026-11-02 —— 「为什么没叫醒」现在有答案
6
46
 
7
47
  ### 学到的(知识库第 5 条)
package/MAINTENANCE.md CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  ## 二、当前状态(2026-11-01)
11
11
 
12
- - [x] 七个工具可用(github / repo_here / watch_start / watch_status / watch_stop / watch_ack / watch_doctor),`node --test` 109/109 通过
12
+ - [x] 七个工具可用(github / repo_here / watch_start / watch_status / watch_stop / watch_ack / watch_doctor),`node --test` 111/111 通过
13
13
  - [x] 自回声抑制(逐条水位)
14
14
  - [x] 仅空闲注入(避免草稿回放)
15
15
  - [x] 唤醒失败不推进水位
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.8.55-green.svg)](https://github.com/MYCF711/dsh-session-superagent/releases)
6
+ [![Version](https://img.shields.io/badge/version-0.8.57-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
 
@@ -99,7 +99,7 @@ dsh plugin install /path/to/dsh-session-superagent
99
99
  ## 开发
100
100
 
101
101
  ```sh
102
- node --test # 109 项单测
102
+ node --test # 111 项单测
103
103
  ```
104
104
 
105
105
  版本与发布流程见 [UPDATING.md](UPDATING.md),交付门见 [CHECKLIST.md](CHECKLIST.md),接手台账见 [MAINTENANCE.md](MAINTENANCE.md)。
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.8.55'
17
+ const CLIENT_VERSION = '0.8.57'
18
18
  let BASE = '/session-superagent'
19
19
  /**
20
20
  * 挑「最新的那个服务端实例」。
@@ -840,6 +840,8 @@ window.__ModuleLoader__.load({
840
840
  const [checking, setChecking] = useState(false)
841
841
  // 设置页用官方的「左栏 + 内容」结构(dt-settings),所以要记当前分区
842
842
  const [settingsSection, setSettingsSection] = useState('source')
843
+ // 判定页:点「跳过原因」标签就只看这一类(知识库里记的"还没做",本轮补上)
844
+ const [reasonFilter, setReasonFilter] = useState(null)
843
845
 
844
846
  const load = useCallback(async () => {
845
847
  try {
@@ -1105,7 +1107,19 @@ window.__ModuleLoader__.load({
1105
1107
  reasonTotals.length > 0
1106
1108
  ? h('div', { className: 'dt-row-meta', key: 'reason-totals' },
1107
1109
  h('span', null, '跳过原因累计:'),
1108
- reasonTotals.map(([reason, n]) => h(Tag, { key: reason, tone: 'quiet' }, reason + ' × ' + n)))
1110
+ reasonTotals.map(([reason, n]) => h(Pill, {
1111
+ key: reason,
1112
+ active: reasonFilter === reason,
1113
+ onClick: () => setReasonFilter(reasonFilter === reason ? null : reason),
1114
+ }, reason + ' × ' + n)),
1115
+ reasonFilter ? h(Pill, { key: 'clear', onClick: () => setReasonFilter(null) }, '清除筛选') : null)
1116
+ : null,
1117
+ reasonFilter
1118
+ ? h('ul', { className: 'dt-plain-list', key: 'reason-entries' },
1119
+ watchers.flatMap((w) => (w.filteredLog || [])
1120
+ .filter((entry) => entry.reason === reasonFilter)
1121
+ .map((entry) => h('li', { key: w.repo + '#' + entry.number + entry.at },
1122
+ w.repo + ' #' + entry.number + ' ' + String(entry.title || '').slice(0, 60)))))
1109
1123
  : null,
1110
1124
  watchers.length === 0
1111
1125
  ? h(Hint, null, '还没有主理鱼。')
package/lib/index.js CHANGED
@@ -30,7 +30,7 @@ import {
30
30
 
31
31
  export const name = 'dsh-session-superagent'
32
32
  /** 服务端版本:随 package.json 同步(meta 测试守着)。客户端据此挑「最新的那个实例」。 */
33
- export const SERVER_VERSION = '0.8.55'
33
+ export const SERVER_VERSION = '0.8.57'
34
34
  export const inject = ['tools', 'agents', 'webServer']
35
35
 
36
36
  /** 仅供测试:读写状态文件(生产代码不要用)。 */
@@ -583,6 +583,10 @@ async function pollOnce(ctx, entry, baseMs) {
583
583
  isolation,
584
584
  // entry.goal 之前只写不读:现在真的进唤醒消息
585
585
  goal: entry.goal || '',
586
+ // 「为什么是这几条」:把本轮的筛选依据一并写进任务书
587
+ changedTotal: fresh.length,
588
+ batchLimit: listed.length,
589
+ skippedReasons: entry.filterCounts || {},
586
590
  }))
587
591
  entry.lastWake = result.ok ? new Date().toISOString() : `failed: ${result.reason}`
588
592
  entry.lastWakeCount = fresh.length
package/lib/watch.js CHANGED
@@ -118,9 +118,23 @@ export function formatWatchText(repo, fresh, options = {}) {
118
118
  const moreLine = more > 0
119
119
  ? `\n(另有 ${more} 条:${rest},处理完这批再看)`
120
120
  : ''
121
+ // 「为什么是这几条」:只给结果不给依据,会话/客户都没法判断要不要调过滤条件。
122
+ // 依据:GitHub 的通知带 reason(为什么通知你)、Slack 摘要会说明分组依据 —— 同一个道理。
123
+ const whyLine = (() => {
124
+ const parts = []
125
+ const changed = Number(options.changedTotal)
126
+ if (Number.isFinite(changed) && changed > 0) parts.push('本轮共 ' + changed + ' 条变化')
127
+ if (options.batchLimit) parts.push('按「最近更新」取前 ' + options.batchLimit + ' 条')
128
+ const skipped = options.skippedReasons && typeof options.skippedReasons === 'object'
129
+ ? Object.entries(options.skippedReasons).filter(([, n]) => Number(n) > 0).slice(0, 3)
130
+ : []
131
+ if (skipped.length > 0) parts.push('同时跳过 ' + skipped.map(([reason, n]) => reason + ' × ' + n).join('、'))
132
+ return parts.length > 0 ? String.fromCharCode(10) + '【为什么是这几条】' + parts.join(';') : ''
133
+ })()
121
134
  return (
122
135
  `【主理鱼】${repo} 有 ${lines.length} 条新动态:\n` +
123
136
  lines.join('\n') +
137
+ whyLine +
124
138
  moreLine +
125
139
  isoLine +
126
140
  goalLine +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-session-superagent",
3
- "version": "0.8.55",
3
+ "version": "0.8.57",
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",