dsh-session-superagent 0.9.127 → 0.9.129
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 +55 -0
- package/README.md +2 -2
- package/client.js +1 -1
- package/lib/gh-format.js +3 -1
- package/lib/index.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,61 @@
|
|
|
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.129] - 2026-11-03 —— Windows 上找不到 gh 会说"不是命令",我们原来不认
|
|
6
|
+
|
|
7
|
+
### 学到什么(出处)
|
|
8
|
+
Node 的错误页把系统级错误码(`ENOENT`、`EACCES`…)列成一张表,指出**同一个失败在不同平台上措辞不同**:
|
|
9
|
+
|
|
10
|
+
> Common system errors … `ENOENT` (No such file or directory) …
|
|
11
|
+
|
|
12
|
+
<https://nodejs.org/api/errors.html#common-system-errors>
|
|
13
|
+
|
|
14
|
+
我们的 `classifyGhError` 只认 `ENOENT` / `gh: command not found`,**不认 Windows cmd 的措辞**:
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
spawn gh ENOENT → nogh ✅
|
|
18
|
+
gh: command not found → nogh ✅
|
|
19
|
+
'gh' is not recognized as an internal or external ... → other ❌(提示"没归类的错误")
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
也就是说:Windows 客户没装 gh 时,看到的是"没归类的错误",而不是"找不到 gh:确认已安装且在 PATH"。
|
|
23
|
+
|
|
24
|
+
### 改法
|
|
25
|
+
1. `classifyGhError` 认全三种措辞(补 `not recognized as an internal or external command`);
|
|
26
|
+
2. 顺手把 `watch_doctor` 里写死的「最多每 **2 小时**一次」改成从 `RETRY_SLOW_CAP_MINUTES` 算 ——
|
|
27
|
+
上一轮立的规矩(数字要能指回来源)还没覆盖到 `lib/` 自己的中文提示。
|
|
28
|
+
|
|
29
|
+
### 测试
|
|
30
|
+
- 新增 1 例:三种措辞都归 `nogh` 且提示指向 PATH;
|
|
31
|
+
- 更新 1 例:doctor 的"X 小时"改为按常量断言(常量改了用例自动跟随)。
|
|
32
|
+
合计 **244 例**。
|
|
33
|
+
|
|
34
|
+
## [0.9.128] - 2026-11-03 —— 面板上写死的四个数字,各自绑到真实来源
|
|
35
|
+
|
|
36
|
+
### 学到什么(出处)
|
|
37
|
+
这一轮没有可用的新外部来源(`en.wikipedia.org`/`raw.githubusercontent.com` 仍超时或 502),
|
|
38
|
+
所以直接把上两轮提炼的判据**做成守卫**:*要么同源,要么同测*
|
|
39
|
+
(见 KB `policy-numbers-have-one-home.md`、`defaults-are-data-not-copy.md`)。
|
|
40
|
+
|
|
41
|
+
### 现场(扫描 `client.js` 里含数字的中文文案,共 14 条)
|
|
42
|
+
真正有"漂移风险"的是这 4 个,其余都是示例值(`如 42`、`09:00-23:00`)或 HTTP 码(401/404/5xx):
|
|
43
|
+
|
|
44
|
+
| 面板文案 | 真实来源 |
|
|
45
|
+
|---|---|
|
|
46
|
+
| `最小 30 秒` | `Math.max(30, Math.min(3600, …))`(watch_start 的夹紧) |
|
|
47
|
+
| `判定日志(最近 5 次唤醒)` | `/state` 里 `filteredLog.slice(-5)` |
|
|
48
|
+
| `时间线(最近 20 条)` | `pushHistory(history, record, max = 20)` |
|
|
49
|
+
| `连续 2 次就会在「需要关注」里提示` | 面板判断 `silentWakes >= 2` |
|
|
50
|
+
|
|
51
|
+
### 改法
|
|
52
|
+
新增 `test/panel-numbers.test.mjs`:从 `client.js` 抽出这四处数字,和 `lib/` 里的真实阈值逐条比对。
|
|
53
|
+
|
|
54
|
+
### 验证它会红
|
|
55
|
+
把面板文案改成「最小 **15** 秒」→ `pass 3 / fail 1`;还原后 `4/4` 通过。
|
|
56
|
+
|
|
57
|
+
### 测试
|
|
58
|
+
新增 4 例,合计 **243 例**。
|
|
59
|
+
|
|
5
60
|
## [0.9.127] - 2026-11-03 —— 面板里的「默认值提示」改成从 `/state` 读
|
|
6
61
|
|
|
7
62
|
### 学到什么(出处)
|
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 # 244 项单测
|
|
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.129'
|
|
18
18
|
let BASE = '/session-superagent'
|
|
19
19
|
/**
|
|
20
20
|
* 挑「最新的那个服务端实例」。
|
package/lib/gh-format.js
CHANGED
|
@@ -66,7 +66,9 @@ export function classifyGhError(detail) {
|
|
|
66
66
|
if (/HTTP 50[0234]|Bad Gateway|Service Unavailable|Gateway Time-?out/i.test(text)) {
|
|
67
67
|
return { kind: 'gateway', short, hint: '(GitHub 或本地代理短暂故障:已按退避自动重试,不需要手动处理;持续出现就检查代理)' }
|
|
68
68
|
}
|
|
69
|
-
|
|
69
|
+
// Windows 的 cmd 报法不一样:'gh' is not recognized as an internal or external command
|
|
70
|
+
// 出处(Node 的错误码语义):https://nodejs.org/api/errors.html#common-system-errors
|
|
71
|
+
if (/ENOENT|not found.*gh|gh: command not found|not recognized as an internal or external command/i.test(text)) {
|
|
70
72
|
return { kind: 'nogh', short, hint: '(找不到 gh 命令:确认已安装且在 PATH)' }
|
|
71
73
|
}
|
|
72
74
|
// 条件请求命中:gh 把 304 当失败(非 2xx 就 exit 1),但语义是「没有变化」,不是错误
|
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.129'
|
|
44
44
|
export const inject = ['tools', 'agents', 'webServer']
|
|
45
45
|
/** 一条会话每小时最多被唤醒几次(跨所有守累计)。单守上限挡不住多守叠加。 */
|
|
46
46
|
// 本进程启动时刻:用来区分「刚重启还没轮到」与「定时器真的丢了」
|
|
@@ -2110,7 +2110,7 @@ const UPDATE_CACHE_MS = 10 * 60 * 1000
|
|
|
2110
2110
|
}
|
|
2111
2111
|
// 连续失败很多次时间隔已被拉长(retry budget):要解释清楚,别让人以为又卡住了
|
|
2112
2112
|
if (Number(entry.consecutiveFailures) >= 6) {
|
|
2113
|
-
lines.push(`INFO ${entry.repo} 已连续失败 ${entry.consecutiveFailures} 次,重试间隔已放慢到最多每
|
|
2113
|
+
lines.push(`INFO ${entry.repo} 已连续失败 ${entry.consecutiveFailures} 次,重试间隔已放慢到最多每 ${RETRY_SLOW_CAP_MINUTES / 60} 小时一次`)
|
|
2114
2114
|
}
|
|
2115
2115
|
}
|
|
2116
2116
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-session-superagent",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.129",
|
|
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",
|