dsh-session-superagent 0.9.89 → 0.9.91

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,36 @@
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.91] - 2026-11-02 —— 「最近 5 次唤醒」其实早就有,只是名字看不出来
6
+
7
+ ### 先确认(结果和预期相反)
8
+ 我准备给每条守加一个「最近 5 次唤醒」折叠区,写到一半发现**判定页的「判定日志」已经在显示这些**:
9
+ 每轮的结果、跳过原因、条目编号全都在(`history` 取最近 5 条)。
10
+
11
+ 所以:**这不是能力缺失,是命名问题** —— 标题写着"判定日志",客户不知道那就是"最近几次唤醒"。
12
+
13
+ ### 改法
14
+ - 撤掉我刚加的重复区块(不留两份实现);
15
+ - 标题改成 **`判定日志(最近 5 次唤醒)`**;
16
+ - 用例改成锁"标题能看出这是最近几次",并继续断言条目与失败原因可见。
17
+
18
+ ### 测试
19
+ 新增 1 例。合计 **203 例**。
20
+
21
+ ## [0.9.90] - 2026-11-02 —— 之前叫醒过的条目,消息里标出来
22
+
23
+ ### 为什么
24
+ `history` 里一直记着"哪次叫醒处理了哪几条",但**消息里完全没用**。
25
+ 结果同一个问题第二次被叫醒时,会话以为这是新问题,会从头分析一遍。
26
+
27
+ ### 改法
28
+ - 发消息前把 `entry.history` 压成 `{条目号: 最近一次叫醒时间}`;
29
+ - 条目行尾追加 `⏰ 之前叫醒过(2026-10-30)`(只标日期,不占版面)。
30
+
31
+ ### 测试
32
+ - 新增 1 例:叫醒过的标、没叫醒过的不标、没传 `seenBefore` 时行为不变。合计 **202 例**。
33
+ - 单行长度仍 ≤ 120(`audit-line-length` 通过);演练快照 62 行未变(示例历史为空,符合预期)。
34
+
5
35
  ## [0.9.89] - 2026-11-02 —— watch_start 一次加多个仓库(客户三仓库不用点三次)
6
36
 
7
37
  ### 为什么
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.89-green.svg)](https://github.com/MYCF711/dsh-session-superagent/releases)
6
+ [![Version](https://img.shields.io/badge/version-0.9.91-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
 
@@ -121,7 +121,7 @@ dsh plugin install /path/to/dsh-session-superagent
121
121
  ## 开发
122
122
 
123
123
  ```sh
124
- node --test # 201 项单测
124
+ node --test # 203 项单测
125
125
  ```
126
126
 
127
127
  ### 工具输出:文本给人和 agent,JSON 给程序
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.89'
17
+ const CLIENT_VERSION = '0.9.91'
18
18
  let BASE = '/session-superagent'
19
19
  /**
20
20
  * 挑「最新的那个服务端实例」。
@@ -1253,7 +1253,7 @@ window.__ModuleLoader__.load({
1253
1253
  return Object.entries(merged).sort((a, b) => b[1] - a[1]).slice(0, 8)
1254
1254
  })()
1255
1255
  const judge = h(Section, {
1256
- title: '判定日志',
1256
+ title: '判定日志(最近 5 次唤醒)',
1257
1257
  count: watchers.reduce((n, w) => n + (w.history || []).length, 0),
1258
1258
  action: h(InfoTip, { text: '每轮判定都会记一条:唤醒、仅观察,或跳过及其原因。只存最近若干条。' }),
1259
1259
  },
package/lib/index.js CHANGED
@@ -40,7 +40,7 @@ import {
40
40
 
41
41
  export const name = 'dsh-session-superagent'
42
42
  /** 服务端版本:随 package.json 同步(meta 测试守着)。客户端据此挑「最新的那个实例」。 */
43
- export const SERVER_VERSION = '0.9.89'
43
+ export const SERVER_VERSION = '0.9.91'
44
44
  export const inject = ['tools', 'agents', 'webServer']
45
45
  /** 一条会话每小时最多被唤醒几次(跨所有守累计)。单守上限挡不住多守叠加。 */
46
46
  const DEFAULT_SESSION_WAKES = 12
@@ -1029,6 +1029,14 @@ async function pollOnce(ctx, entry, baseMs) {
1029
1029
  changedTotal: fresh.length,
1030
1030
  batchLimit: listed.length,
1031
1031
  skippedReasons: entry.filterCounts || {},
1032
+ // 这条以前被叫醒过吗?history 里一直有数据,但消息从没用过
1033
+ seenBefore: (() => {
1034
+ const map = {}
1035
+ for (const event of entry.history || []) {
1036
+ for (const n of event.numbers || []) map[String(n)] = map[String(n)] || event.at
1037
+ }
1038
+ return map
1039
+ })(),
1032
1040
  })
1033
1041
  entry.lastWakeCount = fresh.length
1034
1042
  entry.lastBatch = listed.map((item) => item.number)
package/lib/watch.js CHANGED
@@ -107,6 +107,10 @@ export function formatWatchText(repo, fresh, options = {}) {
107
107
  assignmentNote(item) || null,
108
108
  (item.state === 'open' ? stalenessNote(item) : '') || null,
109
109
  linkedPrNote(item.linkedPr) || null,
110
+ // 之前叫醒过这条:会话该知道「这不是新问题」
111
+ (options.seenBefore && options.seenBefore[String(item.number)])
112
+ ? '⏰ 之前叫醒过(' + String(options.seenBefore[String(item.number)]).slice(0, 10) + ')'
113
+ : null,
110
114
  item.lastComment
111
115
  ? '最后评论: ' + commentSummaryLine({
112
116
  login: item.lastComment.self ? '' : item.lastComment.login,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-session-superagent",
3
- "version": "0.9.89",
3
+ "version": "0.9.91",
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",