dsh-session-superagent 0.8.65 → 0.8.67
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 +32 -0
- package/MAINTENANCE.md +1 -1
- package/README.md +2 -2
- package/client.js +29 -2
- package/lib/index.js +4 -2
- package/lib/watch.js +28 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,38 @@
|
|
|
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.8.67] - 2026-11-02 —— 能力徽章可点筛选;顺手记下「限流是分池的」
|
|
6
|
+
|
|
7
|
+
### 学到的(知识库第 16 条,判断准则)
|
|
8
|
+
GitHub 限流**分池**:`X-RateLimit-Resource` 就是池名(core / search / graphql …),
|
|
9
|
+
search 池额度更紧、GraphQL 完全独立。
|
|
10
|
+
<https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api>
|
|
11
|
+
|
|
12
|
+
我们 0.8.53 的「剩余 < 500 推到 reset」没区分池 —— 目前只打 core,所以没出错;
|
|
13
|
+
但将来加"按关键字搜 issue"就必须按 `resource` 分账。这条**先记准则、暂不改代码**(诚实标注:未落地)。
|
|
14
|
+
|
|
15
|
+
### 改了什么(本轮代码)
|
|
16
|
+
行内能力徽章从 `Tag`(只读)换成官方 `Pill`(可点):
|
|
17
|
+
- 点 `只读` / `已归档` / `无 Issues` / `私有` → 只看这类守,再点取消;
|
|
18
|
+
- 顶部显示「只看 只读 的守(1 条)· 清除」,与「跳过原因」的交互一致。
|
|
19
|
+
|
|
20
|
+
### 测试
|
|
21
|
+
- 新增 1 例:未筛选两条都在 → 选「只读」只剩 ro/two 且有状态提示。合计 **120 例**。
|
|
22
|
+
|
|
23
|
+
## [0.8.66] - 2026-11-02 —— 归档仓库:能读不能写,行内加能力徽章
|
|
24
|
+
|
|
25
|
+
### 学到的(知识库第 15 条)
|
|
26
|
+
`GET /repos` 还有 `archived` / `disabled` / `visibility`(实测 `atom/atom` 就是 `archived: true`)。
|
|
27
|
+
归档是 GitHub 的"冻结":内容只读,评论/打标签全部失败 —— **换 token 也没用**,比"没写权限"更彻底。
|
|
28
|
+
|
|
29
|
+
### 改了什么
|
|
30
|
+
1. `probeAccess` 一并取 `archived` / `disabled`;
|
|
31
|
+
2. 「需要关注」区新增归档 / 禁用两条人话(排在轮询失败之前);
|
|
32
|
+
3. 行内加**能力徽章**:`已归档` `已禁用` `无 Issues` `fork · 上游 x/y` `只读` `私有`。
|
|
33
|
+
|
|
34
|
+
### 测试
|
|
35
|
+
- 新增 1 例(6 种组合 + fork 自己开了 Issues 不误伤)。合计 **119 例**。
|
|
36
|
+
|
|
5
37
|
## [0.8.65] - 2026-11-02 —— 关闭 Issues / 是 fork 的仓库,提前说清楚
|
|
6
38
|
|
|
7
39
|
### 学到的(知识库第 14 条)
|
package/MAINTENANCE.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
## 二、当前状态(2026-11-01)
|
|
11
11
|
|
|
12
|
-
- [x] 七个工具可用(github / repo_here / watch_start / watch_status / watch_stop / watch_ack / watch_doctor),`node --test`
|
|
12
|
+
- [x] 七个工具可用(github / repo_here / watch_start / watch_status / watch_stop / watch_ack / watch_doctor),`node --test` 120/120 通过
|
|
13
13
|
- [x] 自回声抑制(逐条水位)
|
|
14
14
|
- [x] 仅空闲注入(避免草稿回放)
|
|
15
15
|
- [x] 唤醒失败不推进水位
|
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
|
|
|
@@ -99,7 +99,7 @@ dsh plugin install /path/to/dsh-session-superagent
|
|
|
99
99
|
## 开发
|
|
100
100
|
|
|
101
101
|
```sh
|
|
102
|
-
node --test #
|
|
102
|
+
node --test # 120 项单测
|
|
103
103
|
```
|
|
104
104
|
|
|
105
105
|
版本与发布流程见 [UPDATING.md](UPDATING.md),交付门见 [CHECKLIST.md](CHECKLIST.md),接手台账见 [MAINTENANCE.md](MAINTENANCE.md)。
|
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.8.
|
|
17
|
+
const CLIENT_VERSION = '0.8.67'
|
|
18
18
|
let BASE = '/session-superagent'
|
|
19
19
|
/**
|
|
20
20
|
* 挑「最新的那个服务端实例」。
|
|
@@ -842,6 +842,8 @@ window.__ModuleLoader__.load({
|
|
|
842
842
|
const [settingsSection, setSettingsSection] = useState('source')
|
|
843
843
|
// 判定页:点「跳过原因」标签就只看这一类(知识库里记的"还没做",本轮补上)
|
|
844
844
|
const [reasonFilter, setReasonFilter] = useState(null)
|
|
845
|
+
// 行内徽章可点:点「只读」就只看只读的守(与跳过原因筛选同一套交互)
|
|
846
|
+
const [badgeFilter, setBadgeFilter] = useState(null)
|
|
845
847
|
|
|
846
848
|
const load = useCallback(async () => {
|
|
847
849
|
try {
|
|
@@ -997,6 +999,11 @@ window.__ModuleLoader__.load({
|
|
|
997
999
|
}, watcher.repo)),
|
|
998
1000
|
h('div', { className: 'dt-row-meta dt-ticket-meta' },
|
|
999
1001
|
stateTag(watcher),
|
|
1002
|
+
...repoBadges(watcher.repoAccess).map((badge) => h(Pill, {
|
|
1003
|
+
key: 'b-' + badge.text,
|
|
1004
|
+
active: badgeFilter === badge.text,
|
|
1005
|
+
onClick: () => setBadgeFilter(badgeFilter === badge.text ? null : badge.text),
|
|
1006
|
+
}, badge.text)),
|
|
1000
1007
|
watcher.observe ? h(Tag, { tone: 'warning' }, '仅观察') : null,
|
|
1001
1008
|
watcher.activeHours ? h(Tag, null, '时段 ' + watcher.activeHours) : null,
|
|
1002
1009
|
watcher.isolated ? h(Tag, null, isolationText(watcher)) : null,
|
|
@@ -1072,7 +1079,9 @@ window.__ModuleLoader__.load({
|
|
|
1072
1079
|
|| watcher.repo.toLowerCase().includes(needle)
|
|
1073
1080
|
|| (watcher.title || '').toLowerCase().includes(needle)
|
|
1074
1081
|
|| (watcher.filteredLog || []).some((entry) => String(entry.number).includes(needle) || String(entry.title || '').toLowerCase().includes(needle))
|
|
1075
|
-
const
|
|
1082
|
+
const matchesBadge = (watcher) => !badgeFilter
|
|
1083
|
+
|| repoBadges(watcher.repoAccess).some((badge) => badge.text === badgeFilter)
|
|
1084
|
+
const visible = watchers.filter((watcher) => matches(watcher) && matchesBadge(watcher))
|
|
1076
1085
|
|
|
1077
1086
|
const overview = [
|
|
1078
1087
|
watchers.some((w) => (w.filteredLog || []).length > 0)
|
|
@@ -1087,6 +1096,11 @@ window.__ModuleLoader__.load({
|
|
|
1087
1096
|
? h(Section, { key: 'problems', title: '需要关注', count: problems.length },
|
|
1088
1097
|
h('ul', { className: 'dt-plain-list' }, problems.map((item) => h('li', { key: item.key, className: 'dt-danger' }, item.text))))
|
|
1089
1098
|
: null,
|
|
1099
|
+
badgeFilter
|
|
1100
|
+
? h('div', { className: 'dt-row-meta', key: 'badge-filter' },
|
|
1101
|
+
h('span', null, '只看 ' + badgeFilter + ' 的守(' + visible.length + ' 条):'),
|
|
1102
|
+
h(Pill, { onClick: () => setBadgeFilter(null) }, '清除'))
|
|
1103
|
+
: null,
|
|
1090
1104
|
h('div', { className: 'dt-stats', key: 'stats' },
|
|
1091
1105
|
h('div', { className: 'dt-stat' }, h('span', { className: 'dt-stat-value' }, String(watchers.length)), h('span', null, '条主理鱼')),
|
|
1092
1106
|
h('div', { className: 'dt-stat' }, h('span', { className: 'dt-stat-value' }, String(running)), h('span', null, '主理中')),
|
|
@@ -1279,6 +1293,19 @@ window.__ModuleLoader__.load({
|
|
|
1279
1293
|
return () => { alive = false }
|
|
1280
1294
|
}, [])
|
|
1281
1295
|
|
|
1296
|
+
/** 仓库能力徽章(与服务端 watch.js:repoBadges 同语义)。 */
|
|
1297
|
+
function repoBadges(access) {
|
|
1298
|
+
if (!access || typeof access !== 'object') return []
|
|
1299
|
+
const badges = []
|
|
1300
|
+
if (access.archived === true) badges.push({ text: '已归档', tone: 'warning' })
|
|
1301
|
+
if (access.disabled === true) badges.push({ text: '已禁用', tone: 'danger' })
|
|
1302
|
+
if (access.hasIssues === false) badges.push({ text: '无 Issues', tone: 'warning' })
|
|
1303
|
+
if (access.fork === true && access.parent && access.hasIssues !== true) badges.push({ text: 'fork · 上游 ' + String(access.parent), tone: 'outline' })
|
|
1304
|
+
if (access.push === false) badges.push({ text: '只读', tone: 'warning' })
|
|
1305
|
+
if (access.private === true) badges.push({ text: '私有', tone: 'outline' })
|
|
1306
|
+
return badges
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1282
1309
|
/** 仓库结构提示(与服务端 watch.js:repoStructureNote 同语义;客户端要独立一份,不能跨包 import)。 */
|
|
1283
1310
|
function repoStructureNote(access) {
|
|
1284
1311
|
if (!access || typeof access !== 'object') return ''
|
package/lib/index.js
CHANGED
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
|
|
31
31
|
export const name = 'dsh-session-superagent'
|
|
32
32
|
/** 服务端版本:随 package.json 同步(meta 测试守着)。客户端据此挑「最新的那个实例」。 */
|
|
33
|
-
export const SERVER_VERSION = '0.8.
|
|
33
|
+
export const SERVER_VERSION = '0.8.67'
|
|
34
34
|
export const inject = ['tools', 'agents', 'webServer']
|
|
35
35
|
|
|
36
36
|
/** 仅供测试:读写状态文件(生产代码不要用)。 */
|
|
@@ -789,7 +789,7 @@ export function apply(ctx) {
|
|
|
789
789
|
const probeAccess = async (entry) => {
|
|
790
790
|
try {
|
|
791
791
|
const res = await run('gh', ['api', 'repos/' + entry.repo, '--jq',
|
|
792
|
-
'{push: .permissions.push, private: .private, fork: .fork, hasIssues: .has_issues, parent: (.parent.full_name // null)}'],
|
|
792
|
+
'{push: .permissions.push, private: .private, fork: .fork, hasIssues: .has_issues, archived: .archived, disabled: .disabled, parent: (.parent.full_name // null)}'],
|
|
793
793
|
{ timeoutMs: 20000, env: ghEnv() })
|
|
794
794
|
if (res.code !== 0) return
|
|
795
795
|
const info = JSON.parse(res.stdout)
|
|
@@ -799,6 +799,8 @@ export function apply(ctx) {
|
|
|
799
799
|
private: info.private === true,
|
|
800
800
|
fork: info.fork === true,
|
|
801
801
|
hasIssues: info.hasIssues !== false,
|
|
802
|
+
archived: info.archived === true,
|
|
803
|
+
disabled: info.disabled === true,
|
|
802
804
|
parent: info.parent || null,
|
|
803
805
|
checkedAt: new Date().toISOString(),
|
|
804
806
|
}
|
package/lib/watch.js
CHANGED
|
@@ -582,6 +582,12 @@ export function accessNote(repoAccess) {
|
|
|
582
582
|
export function repoStructureNote(repoAccess) {
|
|
583
583
|
if (!repoAccess || typeof repoAccess !== 'object') return ''
|
|
584
584
|
const repo = String(repoAccess.repo || '这个仓库')
|
|
585
|
+
if (repoAccess.archived === true) {
|
|
586
|
+
return repo + ' 已归档:GitHub 上归档仓库是只读的,评论和打标签都会失败 —— 守它只能看、不能回写。'
|
|
587
|
+
}
|
|
588
|
+
if (repoAccess.disabled === true) {
|
|
589
|
+
return repo + ' 已被禁用:这个仓库当前不可用,主理鱼不会拿到任何条目。'
|
|
590
|
+
}
|
|
585
591
|
if (repoAccess.hasIssues === false) {
|
|
586
592
|
return repo + ' 关闭了 Issues —— 主理鱼只认 issue / PR,这里不会有任何条目可接。'
|
|
587
593
|
}
|
|
@@ -591,3 +597,25 @@ export function repoStructureNote(repoAccess) {
|
|
|
591
597
|
}
|
|
592
598
|
return ''
|
|
593
599
|
}
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* 仓库能力徽章:把「这条守到底能不能干活」压缩成几个短标签。
|
|
603
|
+
*
|
|
604
|
+
* 依据:`GET /repos` 的 `archived` / `disabled` / `private` / `fork` / `has_issues` / `permissions.push`
|
|
605
|
+
* 就是全部需要的判断依据(本机实测 atom/atom 的 `archived` 为 true)。
|
|
606
|
+
* 出处:https://docs.github.com/en/rest/repos/repos#get-a-repository
|
|
607
|
+
*/
|
|
608
|
+
export function repoBadges(repoAccess) {
|
|
609
|
+
if (!repoAccess || typeof repoAccess !== 'object') return []
|
|
610
|
+
const badges = []
|
|
611
|
+
// 归档仓库在 GitHub 上是完全只读的:评论、打标签都会失败 —— 比"没有写权限"更彻底
|
|
612
|
+
if (repoAccess.archived === true) badges.push({ text: '已归档', tone: 'warning' })
|
|
613
|
+
if (repoAccess.disabled === true) badges.push({ text: '已禁用', tone: 'danger' })
|
|
614
|
+
if (repoAccess.hasIssues === false) badges.push({ text: '无 Issues', tone: 'warning' })
|
|
615
|
+
if (repoAccess.fork === true && repoAccess.parent && repoAccess.hasIssues !== true) {
|
|
616
|
+
badges.push({ text: 'fork · 上游 ' + String(repoAccess.parent), tone: 'outline' })
|
|
617
|
+
}
|
|
618
|
+
if (repoAccess.push === false) badges.push({ text: '只读', tone: 'warning' })
|
|
619
|
+
if (repoAccess.private === true) badges.push({ text: '私有', tone: 'outline' })
|
|
620
|
+
return badges
|
|
621
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-session-superagent",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.67",
|
|
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",
|