dsh-session-superagent 0.9.119 → 0.9.120
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 +31 -0
- package/README.md +2 -2
- package/client.js +1 -1
- package/lib/index.js +1 -1
- package/lib/watch.js +15 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,37 @@
|
|
|
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.120] - 2026-11-03 —— 合并唤醒消息:同一份「接下来」只印一次
|
|
6
|
+
|
|
7
|
+
### 学到什么(出处)
|
|
8
|
+
Google SRE 书《Monitoring Distributed Systems》讲告警的核心原则:
|
|
9
|
+
|
|
10
|
+
> **Every page should be actionable.** … Every time the pager goes off, I should be able to react
|
|
11
|
+
> with a sense of urgency.
|
|
12
|
+
|
|
13
|
+
<https://sre.google/sre-book/monitoring-distributed-systems/>
|
|
14
|
+
|
|
15
|
+
但 **actionable ≠ 把同一份指令印 N 遍** —— 合并唤醒(多条一起叫)原来每条都带一份
|
|
16
|
+
「接下来:1/2/3」,三条就是同一段指令重复三次,读者只会更快跳过它。
|
|
17
|
+
|
|
18
|
+
### 改法
|
|
19
|
+
`mergeWakeTexts()` 把每条消息里 `接下来:` 之后的收尾剥掉,最后**统一附一份**,
|
|
20
|
+
每条自己的【完成标准】仍各自保留(内容不同,不能合并)。
|
|
21
|
+
|
|
22
|
+
### 证据(3 条合并,实测)
|
|
23
|
+
| | 长度 |
|
|
24
|
+
|---|---|
|
|
25
|
+
| 改前 | 309 字符(「接下来」出现 **3** 次) |
|
|
26
|
+
| 改后 | 259 字符(出现 **1** 次,净省 50) |
|
|
27
|
+
|
|
28
|
+
省下的不是大头(分隔行会补回来一点),关键是**读起来的噪音**:一份指令只出现一次。
|
|
29
|
+
|
|
30
|
+
### 测试
|
|
31
|
+
新增 1 例:3 条合并后「接下来」恰好 1 次、每条完成标准都在、净省长度 > 30。合计 **229 例**。
|
|
32
|
+
|
|
33
|
+
### 说明
|
|
34
|
+
`raw.githubusercontent.com` 与 `api.github.com` 本轮仍 502,所以学习源换成了 `sre.google`(可访问)。
|
|
35
|
+
|
|
5
36
|
## [0.9.119] - 2026-11-03 —— 凭证失效要单独报,并说清"不会自己恢复"
|
|
6
37
|
|
|
7
38
|
### 真机现场
|
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)
|
|
6
|
-
[](https://github.com/MYCF711/dsh-session-superagent/releases)
|
|
7
7
|
[](https://www.npmjs.com/package/dsh-session-superagent)
|
|
8
8
|
[](https://github.com/topics/dsh-plugin)
|
|
9
9
|
|
|
@@ -123,7 +123,7 @@ dsh plugin install /path/to/dsh-session-superagent
|
|
|
123
123
|
## 开发
|
|
124
124
|
|
|
125
125
|
```sh
|
|
126
|
-
node --test #
|
|
126
|
+
node --test # 229 项单测
|
|
127
127
|
```
|
|
128
128
|
|
|
129
129
|
### 工具输出:文本给人和 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.
|
|
17
|
+
const CLIENT_VERSION = '0.9.120'
|
|
18
18
|
let BASE = '/session-superagent'
|
|
19
19
|
/**
|
|
20
20
|
* 挑「最新的那个服务端实例」。
|
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.
|
|
43
|
+
export const SERVER_VERSION = '0.9.120'
|
|
44
44
|
export const inject = ['tools', 'agents', 'webServer']
|
|
45
45
|
/** 一条会话每小时最多被唤醒几次(跨所有守累计)。单守上限挡不住多守叠加。 */
|
|
46
46
|
// 本进程启动时刻:用来区分「刚重启还没轮到」与「定时器真的丢了」
|
package/lib/watch.js
CHANGED
|
@@ -663,9 +663,22 @@ export function mergeWakeTexts(parts) {
|
|
|
663
663
|
.join(String.fromCharCode(10))
|
|
664
664
|
return out
|
|
665
665
|
})
|
|
666
|
+
// 「接下来」那一整段是每次唤醒都一样的收尾(三条动作)。合并后重复 N 遍纯噪音:
|
|
667
|
+
// 它就是同一份指令,客户读一遍就够。依据:SRE 的「Every page should be actionable」,
|
|
668
|
+
// 但 actionable 不等于把同一份指令印 N 次。
|
|
669
|
+
const TAIL = '接下来:'
|
|
670
|
+
const withTail = trimmed.filter((text) => text.includes(TAIL))
|
|
671
|
+
const stripped = trimmed.map((text) => {
|
|
672
|
+
const at = text.indexOf(TAIL)
|
|
673
|
+
return at < 0 ? text : text.slice(0, at).replace(/[\s]+$/, '')
|
|
674
|
+
})
|
|
675
|
+
const tailBlock = withTail.length > 1
|
|
676
|
+
? withTail[0].slice(withTail[0].indexOf(TAIL))
|
|
677
|
+
: ''
|
|
678
|
+
|
|
666
679
|
const head = '【主理鱼】这一小段时间内有 ' + list.length + ' 处变化,合并成一条:'
|
|
667
|
-
const body =
|
|
668
|
-
return head + body
|
|
680
|
+
const body = stripped.map((text, i) => String.fromCharCode(10, 10) + '—— 第 ' + (i + 1) + ' 处 ——' + String.fromCharCode(10) + text).join('')
|
|
681
|
+
return head + body + (tailBlock ? String.fromCharCode(10, 10) + tailBlock : '')
|
|
669
682
|
}
|
|
670
683
|
|
|
671
684
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-session-superagent",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.120",
|
|
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",
|