dsh-session-superagent 0.9.229 → 0.9.230
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 +34 -0
- package/README.md +3 -3
- package/client.js +1 -1
- package/lib/index.js +1 -1
- package/lib/watch.js +13 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,40 @@
|
|
|
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.230] - 2026-11-05 —— 那条「单行 120」的门禁,量的一直是错的东西
|
|
6
|
+
|
|
7
|
+
### ① 门禁量的是「首次演练」的短标题
|
|
8
|
+
|
|
9
|
+
`audit-line-length.mjs` 只跑 `first-run.mjs` 的输出,最长 108 字符 → 一直 PASS。
|
|
10
|
+
|
|
11
|
+
而**真实唤醒消息**里有 **178 / 175 / 156 / 162 / 492** 字符的行 —— 一个都测不到。
|
|
12
|
+
|
|
13
|
+
新增 `scripts/wake-samples.mjs`:用**真实的纯函数**造 7 种场景(1 条 / 超 batchLimit / 带目标 /
|
|
14
|
+
带跳过原因 / PR+CI / 150 字标题 / 合并两个守),让门禁量真东西。
|
|
15
|
+
|
|
16
|
+
改完立刻红:`FAIL 1 行超过上限:178 字符:#55 [open] [超长标题]…`
|
|
17
|
+
|
|
18
|
+
### ② 修法:按整行反算标题长度
|
|
19
|
+
|
|
20
|
+
以前标题固定截 200 字符,而 `head` 前面还有 `#55 [open] ` 和后面的 ` — @who` —— 150 字的标题造出 178 字符的行。
|
|
21
|
+
|
|
22
|
+
现在按「整行不超过 120」**反算**标题可用长度,超了加省略号;第二行(补充信息)同理。
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
⑥ 150 字标题 + 长目标 最长行 178 → 120
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### ③ 顺带
|
|
29
|
+
|
|
30
|
+
`safeTitle` 的省略号以前是「硬切」,现在带 `…` —— 客户看得出「这是被截断的」而不是「标题就这么短」。
|
|
31
|
+
|
|
32
|
+
### 证据
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
npm test → 374/374(新增:超长标题不超过 120 且带省略号)
|
|
36
|
+
audit-line-length → PASS(7 种真实场景全部 ≤120)
|
|
37
|
+
```
|
|
38
|
+
|
|
5
39
|
## [0.9.229] - 2026-11-05 —— 合并唤醒时「接下来」整段被吃掉,最需要指令的场景没有指令
|
|
6
40
|
|
|
7
41
|
### ① M2 · 合并多条唤醒后,「接下来」出现 **0 次**
|
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
|
[](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin)
|
|
@@ -146,7 +146,7 @@ Gitee 私有仓库要在「设置 → 凭证」填私人令牌;公开仓库不
|
|
|
146
146
|
## 开发
|
|
147
147
|
|
|
148
148
|
```sh
|
|
149
|
-
npm test #
|
|
149
|
+
npm test # 374 项单测(带离线开关;裸 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 #
|
|
201
|
+
npm test # 374 项单测(带离线开关,约 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.
|
|
17
|
+
const CLIENT_VERSION = '0.9.230'
|
|
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.
|
|
46
|
+
export const SERVER_VERSION = '0.9.230'
|
|
47
47
|
export const inject = ['tools', 'agents', 'webServer']
|
|
48
48
|
/** 一条会话每小时最多被唤醒几次(跨所有守累计)。单守上限挡不住多守叠加。 */
|
|
49
49
|
// 本进程启动时刻:用来区分「刚重启还没轮到」与「定时器真的丢了」
|
package/lib/watch.js
CHANGED
|
@@ -150,10 +150,20 @@ export function formatWatchText(repo, fresh, options = {}) {
|
|
|
150
150
|
.split('【').join('[')
|
|
151
151
|
.split('】').join(']')
|
|
152
152
|
.slice(0, 200)
|
|
153
|
-
const
|
|
153
|
+
const MAX_LINE = 120
|
|
154
|
+
const prefix = `#${item.number} [${item.state}] `
|
|
155
|
+
const suffix = ` — @${who}`
|
|
156
|
+
// 标题按「整行不超过上限」反算 —— 以前固定截 200,前面还有前缀,整行就爆了
|
|
157
|
+
const room = Math.max(20, MAX_LINE - [...prefix].length - [...suffix].length)
|
|
158
|
+
const chars = [...safeTitle]
|
|
159
|
+
const shown = chars.length <= room ? safeTitle : chars.slice(0, room - 1).join('') + '…'
|
|
160
|
+
const head = `${prefix}${shown}${suffix}`
|
|
154
161
|
const oneLine = tail ? `${head} ${tail}` : head
|
|
155
|
-
if (oneLine.length <=
|
|
156
|
-
|
|
162
|
+
if ([...oneLine].length <= MAX_LINE) return oneLine
|
|
163
|
+
// 第二行(补充信息)也可能很长:同样按上限截断,别让它变成一堵墙
|
|
164
|
+
const tailChars = [...tail]
|
|
165
|
+
const tailFit = tailChars.length <= MAX_LINE ? tail : tailChars.slice(0, MAX_LINE - 1).join('') + '…'
|
|
166
|
+
return `${head}\n ${tailFit}`
|
|
157
167
|
})
|
|
158
168
|
const rest = (options.restNumbers ?? []).map((n) => '#' + n).join(' ')
|
|
159
169
|
const iso = options.isolation
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-session-superagent",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.230",
|
|
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",
|