dsh-session-superagent 0.9.182 → 0.9.183
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 +18 -7
- package/lib/index.js +1 -1
- 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.183] - 2026-11-05 —— 门禁互斥锁 + 来源页三条文案
|
|
6
|
+
|
|
7
|
+
### ① 门禁互斥锁(本轮最重要)
|
|
8
|
+
上一轮的事故根因:反向用例会**临时改坏文件再还原**,两个这样的进程交错时,后一个把前一个的注入当成原件写回去 ——
|
|
9
|
+
`client.js` 里永久留下 `ZZ_DUP` 两行、`package.json` 的 `files` 少了两项、`README.md` 单测数变成 `9999`。
|
|
10
|
+
这一轮 T6 子代理又亲眼撞了一次(它的改动被整份回滚)。
|
|
11
|
+
|
|
12
|
+
新增 `scripts/gate-lock.mjs`:
|
|
13
|
+
- 用 `mkdirSync` 的原子性做锁(`EEXIST` = 被占用),锁里记 pid 与起始时间;
|
|
14
|
+
- 持有者已死 / 占用超过 30 分钟 → 视为陈旧锁,自动清理重试;
|
|
15
|
+
- `regression-cases.mjs` 全程持锁;`audit-pack.mjs` 也拿同一把锁 ——
|
|
16
|
+
**只读检查遇到忙是 `SKIP` 而不是 `FAIL`**(假红比跳过更糟);
|
|
17
|
+
- 实测:A 持锁 1.5 秒,B 等 1312ms 后拿到;3 条用例覆盖基本/重复释放/陈旧锁。
|
|
18
|
+
|
|
19
|
+
### ② 来源页三条文案(T6 子代理)
|
|
20
|
+
| 位置 | 改前 | 改后 |
|
|
21
|
+
|---|---|---|
|
|
22
|
+
| 仓库 | `a/b, c/d, e/f`(518px 粘成一行,窄屏劈在 `owner/name` 中间) | `3 条:a/b、c/d、e/f`(超过 3 条补「等」) |
|
|
23
|
+
| 凭证 | 标签 `凭证`(与左栏分区同词) | 标签 `GitHub 凭证`;值写明二选一 |
|
|
24
|
+
| 隔离占用 | `2 个 · 256.0 KB(合计 256.0 KB)` | `2 个隔离根 · 256.0 KB`(单根不再重复合计) |
|
|
25
|
+
|
|
26
|
+
出图:`shot-set-source-after.png`(断行只发生在顿号处)。
|
|
27
|
+
|
|
28
|
+
### 证据
|
|
29
|
+
```
|
|
30
|
+
node --test → 297/297(新增 gate-lock 3 条)
|
|
31
|
+
ui-audit → 11/11(100)
|
|
32
|
+
preflight 全量 → 37/37
|
|
33
|
+
并发实测 → 后到的门禁等了 1312ms,仓库零残留(files 11 / 无 ZZ_DUP / README 297)
|
|
34
|
+
```
|
|
35
|
+
|
|
5
36
|
## [0.9.182] - 2026-11-05 —— Gitee 三种响应形状 + 分诊信号表两列化 + 用上一轮状态补 Gitee 缺的字段
|
|
6
37
|
|
|
7
38
|
### 派单(LEAD.md 纪律:Lead 只拆包/派单/集成/验收)
|
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
|
|
|
@@ -144,7 +144,7 @@ Gitee 私有仓库要在「设置 → 凭证」填私人令牌;公开仓库不
|
|
|
144
144
|
## 开发
|
|
145
145
|
|
|
146
146
|
```sh
|
|
147
|
-
node --test #
|
|
147
|
+
node --test # 297 项单测
|
|
148
148
|
```
|
|
149
149
|
|
|
150
150
|
### 工具输出:文本给人和 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.183'
|
|
18
18
|
let BASE = '/session-superagent'
|
|
19
19
|
/**
|
|
20
20
|
* 挑「最新的那个服务端实例」。
|
|
@@ -1695,16 +1695,24 @@ window.__ModuleLoader__.load({
|
|
|
1695
1695
|
h(Btn, { variant: 'primary', icon: h(Icon, { name: 'plus' }), onClick: addWatcher, disabled: !sessionId || !form.repo.trim() },
|
|
1696
1696
|
sessionId ? '添加到当前会话' : '先打开一个会话'))))
|
|
1697
1697
|
|
|
1698
|
+
// 「仓库」行:先给条数,再看名字;超过 3 条截断成「… 等」。
|
|
1699
|
+
// 原先用 ", " 把三个 owner/name 粘成一行(实测 518px / 可用 541px),
|
|
1700
|
+
// 读者数不清有几条守,窄屏还会劈在 owner/name 中间;改用顿号后换行只发生在条目之间。
|
|
1701
|
+
const repoListText = (list) => list.length + ' 条:'
|
|
1702
|
+
+ list.slice(0, 3).map((w) => w.repo).join('、')
|
|
1703
|
+
+ (list.length > 3 ? ' 等' : '')
|
|
1704
|
+
|
|
1698
1705
|
const settingsSections = [
|
|
1699
1706
|
h(Section, { key: 'source', title: '来源' },
|
|
1700
1707
|
h(KeyValues, { rows: [
|
|
1701
|
-
['仓库', watchers.length === 0 ? '未绑定' : watchers
|
|
1708
|
+
['仓库', watchers.length === 0 ? '未绑定' : repoListText(watchers)],
|
|
1702
1709
|
['gh CLI', !body.gh
|
|
1703
1710
|
? '检测中…'
|
|
1704
1711
|
: body.gh.ok
|
|
1705
1712
|
? '可用 · ' + (body.gh.version || '')
|
|
1706
1713
|
: '不可用 —— 先跑 gh auth login(或装 gh CLI);也可以直接在下面填 token · ' + String(body.gh.error || '').slice(0, 80)],
|
|
1707
|
-
|
|
1714
|
+
// 标签要能和左栏「凭证」分区区分开;值要写出「面板 token / gh 登录态」二选一。
|
|
1715
|
+
['GitHub 凭证', credentials.token === 'none' ? '回退到已登录的 gh CLI' : '用面板 token(不再需要 gh login)'],
|
|
1708
1716
|
['权限范围', (() => {
|
|
1709
1717
|
const info = body.tokenScopes
|
|
1710
1718
|
if (!info) return '正在探测…'
|
|
@@ -1715,10 +1723,13 @@ window.__ModuleLoader__.load({
|
|
|
1715
1723
|
(body.tokenScopes && body.tokenScopes.broad && body.tokenScopes.broad.length > 0)
|
|
1716
1724
|
? ['提示', '这个 token 带 ' + body.tokenScopes.broad.join(', ') + ' —— 我们的功能只需要「读 issue/PR + 写评论和标签」,建议换细粒度 token 只授 Issues 读写']
|
|
1717
1725
|
: null,
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1726
|
+
// 只有一个隔离根时「合计」恒等于前面那个数 —— 同一个数字写两遍;只有多根时才补合计。
|
|
1727
|
+
['隔离占用', (() => {
|
|
1728
|
+
const roots = (body.isolation && body.isolation.roots) || []
|
|
1729
|
+
if (roots.length === 0) return '没有开隔离执行'
|
|
1730
|
+
const each = roots.map((r) => r.count + ' 个隔离根 · ' + bytesText(r.bytes)).join(';')
|
|
1731
|
+
return roots.length > 1 ? each + '(合计 ' + bytesText(body.isolation.totalBytes) + ')' : each
|
|
1732
|
+
})()],
|
|
1722
1733
|
] })),
|
|
1723
1734
|
h(Section, { key: 'creds', title: '凭证' },
|
|
1724
1735
|
h(KeyValues, { rows: [['GitHub token', credentials.token === 'none' ? '未配置(回退到已登录的 gh CLI)' : '已配置'], ['SSH 私钥', credentials.sshKeyPath === 'none' ? '未配置(当前版本不使用)' : '已配置'],
|
package/lib/index.js
CHANGED
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
|
|
43
43
|
export const name = 'dsh-session-superagent'
|
|
44
44
|
/** 服务端版本:随 package.json 同步(meta 测试守着)。客户端据此挑「最新的那个实例」。 */
|
|
45
|
-
export const SERVER_VERSION = '0.9.
|
|
45
|
+
export const SERVER_VERSION = '0.9.183'
|
|
46
46
|
export const inject = ['tools', 'agents', 'webServer']
|
|
47
47
|
/** 一条会话每小时最多被唤醒几次(跨所有守累计)。单守上限挡不住多守叠加。 */
|
|
48
48
|
// 本进程启动时刻:用来区分「刚重启还没轮到」与「定时器真的丢了」
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-session-superagent",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.183",
|
|
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",
|