dsh-session-superagent 0.8.54 → 0.8.55
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 +18 -0
- package/MAINTENANCE.md +1 -1
- package/README.md +2 -2
- package/client.js +14 -1
- package/lib/index.js +5 -2
- package/lib/watch.js +20 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
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.55] - 2026-11-02 —— 「为什么没叫醒」现在有答案
|
|
6
|
+
|
|
7
|
+
### 学到的(知识库第 5 条)
|
|
8
|
+
GitHub 的 issue 过滤语义是「限定词 + 集合运算」,用户能自己复现「为什么这条没出现」——
|
|
9
|
+
**可枚举的条件**,而不是黑盒结果。
|
|
10
|
+
<https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/filtering-and-searching-issues-and-pull-requests>
|
|
11
|
+
|
|
12
|
+
主理鱼有 8 种过滤原因,但原来只保留最近 5 条日志。客户问「我加了标签为什么还是一条都没叫醒」,
|
|
13
|
+
我们只能看到最近 5 条,说不出全貌。
|
|
14
|
+
|
|
15
|
+
### 改了什么
|
|
16
|
+
- 按原因**累计计数**(`countReasons`,只留最多的 12 种),存进每条守的 `filterCounts`;
|
|
17
|
+
- `/state` 回传,「判定」页顶部显示一行:
|
|
18
|
+
`跳过原因累计: 不在标签白名单: ai-fix × 37 机器人 × 12 …`
|
|
19
|
+
|
|
20
|
+
### 测试
|
|
21
|
+
- 新增 1 例:累计 / 排序 / 空原因不记 / 种类上限。合计 **109 例**。
|
|
22
|
+
|
|
5
23
|
## [0.8.54] - 2026-11-02 —— 第二阶段限流:照 Retry-After 等,别猜
|
|
6
24
|
|
|
7
25
|
### 学到的一条(知识库第 4 条)
|
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` 109/109 通过
|
|
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 # 109 项单测
|
|
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.55'
|
|
18
18
|
let BASE = '/session-superagent'
|
|
19
19
|
/**
|
|
20
20
|
* 挑「最新的那个服务端实例」。
|
|
@@ -1089,11 +1089,24 @@ window.__ModuleLoader__.load({
|
|
|
1089
1089
|
// 判定日志(对应官方 eval 页):每轮的唤醒结果、跳过原因、被过滤记录,一次看全
|
|
1090
1090
|
// 判定页用官方的时间线结构(dt-timeline / dt-event / dt-event-foot),
|
|
1091
1091
|
// 官方在 thread.tsx 与 settings-kit.tsx 里就是这么铺「发生过什么」的。
|
|
1092
|
+
// 跳过原因分布:把「为什么没叫醒」做成可读的统计(客户最常问的问题)
|
|
1093
|
+
const reasonTotals = (() => {
|
|
1094
|
+
const merged = {}
|
|
1095
|
+
for (const w of watchers) for (const [reason, n] of Object.entries(w.filterCounts || {})) {
|
|
1096
|
+
merged[reason] = (Number(merged[reason]) || 0) + (Number(n) || 0)
|
|
1097
|
+
}
|
|
1098
|
+
return Object.entries(merged).sort((a, b) => b[1] - a[1]).slice(0, 8)
|
|
1099
|
+
})()
|
|
1092
1100
|
const judge = h(Section, {
|
|
1093
1101
|
title: '判定日志',
|
|
1094
1102
|
count: watchers.reduce((n, w) => n + (w.history || []).length, 0),
|
|
1095
1103
|
action: h(InfoTip, { text: '每轮判定都会记一条:唤醒、仅观察,或跳过及其原因。只存最近若干条。' }),
|
|
1096
1104
|
},
|
|
1105
|
+
reasonTotals.length > 0
|
|
1106
|
+
? h('div', { className: 'dt-row-meta', key: 'reason-totals' },
|
|
1107
|
+
h('span', null, '跳过原因累计:'),
|
|
1108
|
+
reasonTotals.map(([reason, n]) => h(Tag, { key: reason, tone: 'quiet' }, reason + ' × ' + n)))
|
|
1109
|
+
: null,
|
|
1097
1110
|
watchers.length === 0
|
|
1098
1111
|
? h(Hint, null, '还没有主理鱼。')
|
|
1099
1112
|
: h('ol', { className: 'dt-timeline' },
|
package/lib/index.js
CHANGED
|
@@ -24,13 +24,13 @@ import { redact } from './redact.js'
|
|
|
24
24
|
import { decodeBody } from './body.js'
|
|
25
25
|
import {
|
|
26
26
|
advanceSeen, applyWatcherAction, batchFresh, decideWake, DEFAULT_ACK_LABEL, formatWatchText,
|
|
27
|
-
classifyGhError, filterReason, hasAckLabel, jitterMs, parseGhInclude, retryAfterMs, throttleDelayMs, inActiveHours, newestUpdatedAt, nextDelayMs, pushFiltered, normalizeFilters, partitionItems, passesFilters,
|
|
27
|
+
classifyGhError, countReasons, filterReason, hasAckLabel, jitterMs, parseGhInclude, retryAfterMs, throttleDelayMs, inActiveHours, newestUpdatedAt, nextDelayMs, pushFiltered, normalizeFilters, partitionItems, passesFilters,
|
|
28
28
|
mergeFilters, mergePollResult, pruneSeen, pruneWakeTimes, pushHistory, recordReported, staleWorktrees, worktreePlan,
|
|
29
29
|
} from './watch.js'
|
|
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.55'
|
|
34
34
|
export const inject = ['tools', 'agents', 'webServer']
|
|
35
35
|
|
|
36
36
|
/** 仅供测试:读写状态文件(生产代码不要用)。 */
|
|
@@ -495,10 +495,12 @@ async function pollOnce(ctx, entry, baseMs) {
|
|
|
495
495
|
for (const item of items) {
|
|
496
496
|
if (hasAckLabel(item, ackLabel)) {
|
|
497
497
|
entry.filteredLog = pushFiltered(entry.filteredLog, { at: entry.lastPoll, number: item.number, title: String(item.title || '').slice(0, 80), reason: '已 ack' })
|
|
498
|
+
entry.filterCounts = countReasons(entry.filterCounts, '已 ack')
|
|
498
499
|
continue
|
|
499
500
|
}
|
|
500
501
|
const reason = filterReason(item, entry.filters)
|
|
501
502
|
if (reason) {
|
|
503
|
+
entry.filterCounts = countReasons(entry.filterCounts, reason)
|
|
502
504
|
entry.filteredLog = pushFiltered(entry.filteredLog, { at: entry.lastPoll, number: item.number, title: String(item.title || '').slice(0, 80), reason })
|
|
503
505
|
continue
|
|
504
506
|
}
|
|
@@ -758,6 +760,7 @@ export function apply(ctx) {
|
|
|
758
760
|
lastDeferred: w.lastDeferred ?? null,
|
|
759
761
|
observe: w.observe === true,
|
|
760
762
|
filteredLog: (w.filteredLog ?? []).slice(-5),
|
|
763
|
+
filterCounts: w.filterCounts ?? {},
|
|
761
764
|
lastBatch: w.lastBatch ?? [],
|
|
762
765
|
isolated: w.isolated === true,
|
|
763
766
|
workdir: w.workdir ?? null,
|
package/lib/watch.js
CHANGED
|
@@ -510,3 +510,23 @@ export function jitterMs(key, windowMs) {
|
|
|
510
510
|
for (let i = 0; i < text.length; i += 1) hash = (hash * 31 + text.charCodeAt(i)) % 1000003
|
|
511
511
|
return hash % width
|
|
512
512
|
}
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* 把「为什么没叫醒」做成可统计的分布。
|
|
516
|
+
*
|
|
517
|
+
* 背景:我们每轮只留最近 5 条过滤记录(`filteredLog`),客户想知道
|
|
518
|
+
* 「为什么我加的标签一条都没被叫醒」时看不出全貌。这里按原因累计次数,
|
|
519
|
+
* 面板上就能直接读「不在标签白名单: ai-fix × 37」这种结论。
|
|
520
|
+
*
|
|
521
|
+
* 依据:GitHub 的 issue 过滤语义本身就是「限定词 + 集合运算」
|
|
522
|
+
* (label:/assignee:/state:…,见 GitHub 文档「Filtering and searching issues」),
|
|
523
|
+
* 所以「被哪条限定词刷掉」比「被刷掉」更值得告诉用户。
|
|
524
|
+
*/
|
|
525
|
+
export function countReasons(counts, reason, { maxKinds = 12 } = {}) {
|
|
526
|
+
const map = { ...(counts || {}) }
|
|
527
|
+
if (!reason) return map
|
|
528
|
+
const key = String(reason).slice(0, 60)
|
|
529
|
+
map[key] = (Number(map[key]) || 0) + 1
|
|
530
|
+
const entries = Object.entries(map).sort((a, b) => b[1] - a[1]).slice(0, maxKinds)
|
|
531
|
+
return Object.fromEntries(entries)
|
|
532
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-session-superagent",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.55",
|
|
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",
|