dsh-session-superagent 0.9.15 → 0.9.17
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 +44 -0
- package/README.md +1 -1
- package/client.js +25 -2
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,50 @@
|
|
|
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.17] - 2026-11-02 —— 抽检扩到六条路径:抓到"同一件事两种说法"
|
|
6
|
+
|
|
7
|
+
### 学到的(知识库第 66 条)
|
|
8
|
+
同语义的两份实现(服务端 + 客户端)会慢慢走偏 —— 本轮有实测证据。
|
|
9
|
+
|
|
10
|
+
### 抓到的三处
|
|
11
|
+
| 路径 | 抽检发现 | 处理 |
|
|
12
|
+
|---|---|---|
|
|
13
|
+
| ④ 面板接口 500 | 已有"复制诊断 → 重启"的下一步 | ✅ 不动 |
|
|
14
|
+
| ⑤ gh 未安装/未登录 | 设置页只有原始错误,且**不进「需要关注」** | ✅ 补人话 + 后果 + 下一步 |
|
|
15
|
+
| ⑥ 归档 / 禁用仓库 | **客户端 `repoStructureNote` 少了这两条**(服务端早有) | ✅ 对齐,顺序也统一 |
|
|
16
|
+
|
|
17
|
+
### 为什么⑥ 会发生
|
|
18
|
+
面板不能跨包 import 服务端模块,于是 `repoBadges` / `durationText` / `accessNote` / `repoStructureNote`
|
|
19
|
+
各有一份同语义实现。改一边忘另一边,就出现"唤醒消息说已归档、面板什么都不说"。
|
|
20
|
+
|
|
21
|
+
### 防再走偏
|
|
22
|
+
1. 每处重复都要**两端各一条用例**(本轮补了客户端这条);
|
|
23
|
+
2. 改一边时同步 `grep` 另一边;
|
|
24
|
+
3. 抽检脚本把面板文案打出来,走查时更容易发现不一致。
|
|
25
|
+
|
|
26
|
+
### 测试
|
|
27
|
+
- 新增 2 例(gh 不可用的文案与后果;归档/禁用必须在面板出现)。合计 **162 例**。
|
|
28
|
+
|
|
29
|
+
## [0.9.16] - 2026-11-02 —— 可用性抽检:只读仓库没进「需要关注」
|
|
30
|
+
|
|
31
|
+
### 怎么做的(知识库第 65 条)
|
|
32
|
+
写了 `scripts/audit-ux-copy.mjs`,把三条失败路径的**现有文案**直接打出来看,
|
|
33
|
+
而不是凭记忆判断:
|
|
34
|
+
- ① 仓库没写权限 → 只有行内一个 `只读` 徽章,**「需要关注」里没有** ❌
|
|
35
|
+
- ② 会话没规则 → 有原因 + 「看建议规则」✅
|
|
36
|
+
- ③ 一直没动静 → 时间线 + 「还没唤醒过…点立刻 / 看需要关注」✅
|
|
37
|
+
|
|
38
|
+
### 改了什么
|
|
39
|
+
补上 `accessNoteForPanel()`(与服务端 `accessNote` 同语义),写进「需要关注」:
|
|
40
|
+
> 你对 owner/name 只有读权限:能看、能被叫醒,但没法回写评论或打标签 ——
|
|
41
|
+
> 要么换有写权限的 token,要么把结论写在本地/PR 描述里。
|
|
42
|
+
|
|
43
|
+
客户端独立一份是有意为之(不把服务端依赖带进浏览器包),这已是第三个这样的重复
|
|
44
|
+
(`repoBadges` / `durationText` / 本项)—— **每次都要两端各有用例**。
|
|
45
|
+
|
|
46
|
+
### 测试
|
|
47
|
+
- 新增 1 例。合计 **160 例**。
|
|
48
|
+
|
|
5
49
|
## [0.9.15] - 2026-11-02 —— 「只看有问题的」一键筛掉健康的守
|
|
6
50
|
|
|
7
51
|
### 学到的(知识库第 64 条)
|
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
|
|
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.17'
|
|
18
18
|
let BASE = '/session-superagent'
|
|
19
19
|
/**
|
|
20
20
|
* 挑「最新的那个服务端实例」。
|
|
@@ -1112,6 +1112,10 @@ window.__ModuleLoader__.load({
|
|
|
1112
1112
|
for (const watcher of watchers) {
|
|
1113
1113
|
// 仓库结构问题(关闭 Issues / 是 fork)比轮询失败更早该说:它注定收不到条目
|
|
1114
1114
|
const structure = repoStructureNote(watcher.repoAccess)
|
|
1115
|
+
if (structure) problems.push({ key: 's-' + watcher.repo, text: structure })
|
|
1116
|
+
// 只读:以前只在行内显示一个徽章,客户在「需要关注」里看不到,也不知道回写会 403
|
|
1117
|
+
const readOnly = accessNoteForPanel(watcher.repoAccess)
|
|
1118
|
+
if (readOnly) problems.push({ key: 'ro-' + watcher.repo, text: readOnly })
|
|
1115
1119
|
// 叫醒了但没回音:守在工作、消息也进去了,但会话没动手(规则缺失或被忽略)
|
|
1116
1120
|
if (Number(watcher.silentWakes) >= 2) {
|
|
1117
1121
|
problems.push({
|
|
@@ -1128,6 +1132,9 @@ window.__ModuleLoader__.load({
|
|
|
1128
1132
|
if (watcher.lastError) problems.push({ key: 'e-' + watcher.repo, text: watcher.repo + ' 轮询失败:' + watcher.lastError })
|
|
1129
1133
|
else if (watcher.lastDeferred) problems.push({ key: 'd-' + watcher.repo, text: watcher.repo + ' 暂停唤醒:' + watcher.lastDeferred })
|
|
1130
1134
|
}
|
|
1135
|
+
if (body.gh && body.gh.ok === false && credentials.token === 'none') {
|
|
1136
|
+
problems.push({ key: 'gh', text: 'gh CLI 不可用,且没有配置 token —— 现在所有轮询都会失败。先跑 gh auth login,或在「设置 → 来源」填一个 token。' })
|
|
1137
|
+
}
|
|
1131
1138
|
if (watchers.length > 0 && credentials.token === 'none') {
|
|
1132
1139
|
problems.push({ key: 'cred', text: '未配置 token,正在复用已登录的 gh CLI(可用 panel 填 token 换成独立凭据)' })
|
|
1133
1140
|
}
|
|
@@ -1304,7 +1311,11 @@ window.__ModuleLoader__.load({
|
|
|
1304
1311
|
h(Section, { key: 'source', title: '来源' },
|
|
1305
1312
|
h(KeyValues, { rows: [
|
|
1306
1313
|
['仓库', watchers.length === 0 ? '未绑定' : watchers.map((w) => w.repo).join(', ')],
|
|
1307
|
-
['gh CLI', !body.gh
|
|
1314
|
+
['gh CLI', !body.gh
|
|
1315
|
+
? '检测中…'
|
|
1316
|
+
: body.gh.ok
|
|
1317
|
+
? '可用 · ' + (body.gh.version || '')
|
|
1318
|
+
: '不可用 —— 先跑 gh auth login(或装 gh CLI);也可以直接在下面填 token · ' + String(body.gh.error || '').slice(0, 80)],
|
|
1308
1319
|
['凭证', credentials.token === 'none' ? '回退到 gh CLI 登录态' : '使用面板配置的 token'],
|
|
1309
1320
|
['权限范围', (() => {
|
|
1310
1321
|
const info = body.tokenScopes
|
|
@@ -1484,6 +1495,15 @@ window.__ModuleLoader__.load({
|
|
|
1484
1495
|
return rest > 0 ? hours + ' 小时 ' + rest + ' 分' : hours + ' 小时'
|
|
1485
1496
|
}
|
|
1486
1497
|
|
|
1498
|
+
/** 只读仓库的提示(与服务端 gh-format.js:accessNote 同语义;面板要独立一份)。 */
|
|
1499
|
+
function accessNoteForPanel(access) {
|
|
1500
|
+
if (!access || typeof access !== 'object') return ''
|
|
1501
|
+
if (access.push === true) return ''
|
|
1502
|
+
if (access.push !== false) return ''
|
|
1503
|
+
return '你对 ' + String(access.repo || '这个仓库') + ' 只有读权限:能看、能被叫醒,但没法回写评论或打标签 —— ' +
|
|
1504
|
+
'要么换有写权限的 token,要么把结论写在本地/PR 描述里。'
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1487
1507
|
/** 仓库能力徽章(与服务端 watch.js:repoBadges 同语义)。 */
|
|
1488
1508
|
function repoBadges(access) {
|
|
1489
1509
|
if (!access || typeof access !== 'object') return []
|
|
@@ -1501,6 +1521,9 @@ window.__ModuleLoader__.load({
|
|
|
1501
1521
|
function repoStructureNote(access) {
|
|
1502
1522
|
if (!access || typeof access !== 'object') return ''
|
|
1503
1523
|
const repo = String(access.repo || '这个仓库')
|
|
1524
|
+
// 顺序与服务端 gh-format.js:repoStructureNote 保持一致:归档/禁用优先
|
|
1525
|
+
if (access.archived === true) return repo + ' 已归档:GitHub 上归档仓库是只读的,评论和打标签都会失败 —— 守它只能看、不能回写。'
|
|
1526
|
+
if (access.disabled === true) return repo + ' 已被禁用:这个仓库当前不可用,主理鱼不会拿到任何条目。'
|
|
1504
1527
|
if (access.hasIssues === false) return repo + ' 关闭了 Issues —— 主理鱼只认 issue / PR,这里不会有任何条目可接。'
|
|
1505
1528
|
if (access.fork === true && access.parent && access.hasIssues !== true) {
|
|
1506
1529
|
return repo + ' 是 ' + String(access.parent) + ' 的 fork。fork 默认不带 Issues,issue 大多落在上游 —— 确认你要守的是哪一个。'
|
package/lib/index.js
CHANGED
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
|
|
33
33
|
export const name = 'dsh-session-superagent'
|
|
34
34
|
/** 服务端版本:随 package.json 同步(meta 测试守着)。客户端据此挑「最新的那个实例」。 */
|
|
35
|
-
export const SERVER_VERSION = '0.9.
|
|
35
|
+
export const SERVER_VERSION = '0.9.17'
|
|
36
36
|
export const inject = ['tools', 'agents', 'webServer']
|
|
37
37
|
/** 一条会话每小时最多被唤醒几次(跨所有守累计)。单守上限挡不住多守叠加。 */
|
|
38
38
|
const DEFAULT_SESSION_WAKES = 12
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-session-superagent",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.17",
|
|
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",
|