dsh-session-superagent 0.9.228 → 0.9.229

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,39 @@
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.229] - 2026-11-05 —— 合并唤醒时「接下来」整段被吃掉,最需要指令的场景没有指令
6
+
7
+ ### ① M2 · 合并多条唤醒后,「接下来」出现 **0 次**
8
+
9
+ `mergeWakeTexts` 里先去重【完成标准】:重复时**从「【完成标准】」一口气切到末尾** ——
10
+ 连同它后面的「接下来」三步一起切掉。
11
+
12
+ 于是 `withTail` 只剩 1 条,而 `tailBlock` 要求 **>1** 才取,最后 `stripped` 又把唯一那条的也切了。
13
+
14
+ **结果:单条唤醒有「接下来」,合并 2 个守之后一条都没有。** 而「这一批一起怎么处理」恰恰是最需要指令的场景。
15
+
16
+ 修法:**先把「接下来」整段抽出来存好,再做完成标准去重**。实测合并后「接下来」出现 1 次、`读 AGENTS.md` 还在。
17
+
18
+ ### ② M3 · 「按『最近更新』取前 N 条」是在骗人
19
+
20
+ 真实排序是 `priorityScore`(重开 +100 / 评论 +10 / 标签 +5),不是最近更新。
21
+ 实测:5 分钟前的那条落进「另有」,300 分钟前的排第一。
22
+
23
+ 客户按「最近更新」理解,会觉得插件的挑选逻辑是坏的。文案已改成
24
+ **「按优先级取前 N 条(重开的排最前)」**。
25
+
26
+ ### ③ M1 · 单行 120 字符上限已失守,而门禁还报 PASS
27
+
28
+ 实测唤醒消息里有 **175 / 156 / 162 / 492** 字符的行(150 字标题、goal、isolation 行、「另有 N 条」行),
29
+ 而 `audit-line-length.mjs` 仍输出 `PASS …(最长 108)` —— **它只量 `scripts/first-run.mjs` 的短标题**,
30
+ 真实唤醒消息四个超限一个都测不到。这是又一个假阴性,已登记(改它要先有稳定的消息样本)。
31
+
32
+ ### 证据
33
+
34
+ ```
35
+ npm test → 373/373(新增 2 条:合并后「接下来」必须还在 / 文案说优先级不说最近更新)
36
+ ```
37
+
5
38
  ## [0.9.228] - 2026-11-05 —— 状态路径惰性化:改 env 立刻生效,不用重新 import
6
39
 
7
40
  ### 上一轮试过、回退了;这一轮做成了
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.228-green.svg)](https://github.com/MYCF711/dsh-session-superagent/releases)
6
+ [![Version](https://img.shields.io/badge/version-0.9.229-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 # 371 项单测(带离线开关;裸 node --test 会真去 spawn gh,两分半)
149
+ npm test # 373 项单测(带离线开关;裸 node --test 会真去 spawn gh,两分半)
150
150
  ```
151
151
 
152
152
  ### 工具输出:文本给人和 agent,JSON 给程序
@@ -198,7 +198,7 @@ dsh plugin --profile <profile> add dsh-session-superagent@latest
198
198
  ## 验收(不用装宿主也能跑)
199
199
 
200
200
  ```bash
201
- npm test # 371 项单测(带离线开关,约 1.6 秒)
201
+ npm test # 373 项单测(带离线开关,约 1.6 秒)
202
202
  node scripts/ui-audit.mjs # 11 项 UI 指标(写死颜色 / 自造 token / 官方结构采用 …)
203
203
  node scripts/preflight.mjs # 40 项门禁(含上面两条,外加 profile 一致性、路由面、包内容)
204
204
  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.228'
17
+ const CLIENT_VERSION = '0.9.229'
18
18
  let BASE = '/session-superagent'
19
19
  /**
20
20
  * 挑「最新的那个服务端实例」。
package/lib/index.js CHANGED
@@ -43,7 +43,7 @@ import {
43
43
 
44
44
  export const name = 'dsh-session-superagent'
45
45
  /** 服务端版本:随 package.json 同步(meta 测试守着)。客户端据此挑「最新的那个实例」。 */
46
- export const SERVER_VERSION = '0.9.228'
46
+ export const SERVER_VERSION = '0.9.229'
47
47
  export const inject = ['tools', 'agents', 'webServer']
48
48
  /** 一条会话每小时最多被唤醒几次(跨所有守累计)。单守上限挡不住多守叠加。 */
49
49
  // 本进程启动时刻:用来区分「刚重启还没轮到」与「定时器真的丢了」
package/lib/watch.js CHANGED
@@ -188,7 +188,14 @@ export function formatWatchText(repo, fresh, options = {}) {
188
188
  const onlyOne = count <= 1 && (!Number.isFinite(changed) || changed <= 1)
189
189
  if (!onlyOne) {
190
190
  if (Number.isFinite(changed) && changed > 0) parts.push('本轮共 ' + changed + ' 条变化')
191
- if (options.batchLimit) parts.push('按「最近更新」取前 ' + options.batchLimit + ' 条')
191
+ if (options.batchLimit) {
192
+ // 审核 T31 M3:真实排序是 priorityScore(重开 +100 / 评论 +10 / 标签 +5),不是「最近更新」。
193
+ // 写「按最近更新」等于骗人:客户会以为越新越靠前,实测 5 分钟前的落进「另有」。
194
+ const priorityOn = Boolean(options.priority && (options.priority.reopened !== false || options.priority.comments !== false || options.priority.labels !== false))
195
+ parts.push(priorityOn
196
+ ? '按优先级取前 ' + options.batchLimit + ' 条(重开的排最前)'
197
+ : '按优先级取前 ' + options.batchLimit + ' 条')
198
+ }
192
199
  }
193
200
  const skipped = options.skippedReasons && typeof options.skippedReasons === 'object'
194
201
  ? Object.entries(options.skippedReasons).filter(([, n]) => Number(n) > 0).slice(0, 3)
@@ -777,14 +784,20 @@ export function mergeWakeTexts(parts) {
777
784
  // 它就是同一份指令,客户读一遍就够。依据:SRE 的「Every page should be actionable」,
778
785
  // 但 actionable 不等于把同一份指令印 N 次。
779
786
  const TAIL = '接下来:'
780
- const withTail = trimmed.filter((text) => text.includes(TAIL))
787
+ // 审核 T31 M2:先把「接下来」整段抽出来,再做去重 ——
788
+ // 以前去重会从【完成标准】一口气切到末尾,把「接下来」也切掉,
789
+ // 于是「合并多条」这个最需要指令的场景反而一条指令都没有。
790
+ const tailBlock = (() => {
791
+ for (const text of trimmed) {
792
+ const at = text.indexOf(TAIL)
793
+ if (at >= 0) return text.slice(at).replace(/[\s]+$/, '')
794
+ }
795
+ return ''
796
+ })()
781
797
  const stripped = trimmed.map((text) => {
782
798
  const at = text.indexOf(TAIL)
783
799
  return at < 0 ? text : text.slice(0, at).replace(/[\s]+$/, '')
784
800
  })
785
- const tailBlock = withTail.length > 1
786
- ? withTail[0].slice(withTail[0].indexOf(TAIL))
787
- : ''
788
801
 
789
802
  const head = '【主理鱼】这一小段时间内有 ' + list.length + ' 处变化,合并成一条:'
790
803
  const body = stripped.map((text, i) => String.fromCharCode(10, 10) + '—— 第 ' + (i + 1) + ' 处 ——' + String.fromCharCode(10) + text).join('')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-session-superagent",
3
- "version": "0.9.228",
3
+ "version": "0.9.229",
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",