dsh-session-superagent 0.8.43 → 0.8.44
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 +28 -0
- package/MAINTENANCE.md +1 -1
- package/README.md +2 -2
- package/client.js +102 -21
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,34 @@
|
|
|
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.44] - 2026-11-02 —— 判定页换官方时间线 + 补齐四个原语
|
|
6
|
+
|
|
7
|
+
按 `docs/ui-inventory.md` 第 3、4 项。
|
|
8
|
+
|
|
9
|
+
### 判定页:改用官方时间线结构
|
|
10
|
+
官方在 `thread.tsx` / `settings-kit.tsx` 里铺「发生过什么」用的是
|
|
11
|
+
`ol.dt-timeline > li.dt-event`(含 `dt-event-quiet` 静音态、`dt-event-foot` 元信息行、`dt-event-text` 正文)。
|
|
12
|
+
我们之前是普通 `dt-row` 堆叠,现在换成官方结构:跳过/仅观察的条目用 `dt-event-quiet` 弱化。
|
|
13
|
+
|
|
14
|
+
### 补齐四个官方原语(`controls.tsx`)
|
|
15
|
+
| 原语 | 官方行为 |
|
|
16
|
+
|---|---|
|
|
17
|
+
| `Pill` | 可切换小胶囊(`aria-pressed`) |
|
|
18
|
+
| `SegmentedControl` | 表单内互斥分段(`role=radiogroup` + `aria-checked`) |
|
|
19
|
+
| `DisclosureRow` | 折叠行:Enter / 空格可切换、`aria-expanded`、展开图标切换 |
|
|
20
|
+
| `InfoTip` | 点一下出气泡说明(`role=tooltip`) |
|
|
21
|
+
|
|
22
|
+
同时 `Section` 补上官方的 `hint` / `action` 两个插槽;「最近被过滤」改用 `DisclosureRow` 折叠
|
|
23
|
+
(默认只露第一条摘要,点开看全部)—— 原语不是摆着看的。
|
|
24
|
+
|
|
25
|
+
### 顺手修掉一个假守门
|
|
26
|
+
`meta.test.mjs` 里「watch.js 导出必须被 import」那条用了 `new RegExp('' + name + '')`,
|
|
27
|
+
但文件里实际是**单个反斜杠**(`''` 写成了 `''`→退格符),正则永远匹配不到东西 —— 这条守门此前形同虚设。
|
|
28
|
+
已改成真正的词边界,并另加一条「官方原语齐全」守门。
|
|
29
|
+
|
|
30
|
+
### 测试
|
|
31
|
+
- 合计 **102 例**;UI 体检 9/9 = 100 分(官方结构采用 8/8)。
|
|
32
|
+
|
|
5
33
|
## [0.8.43] - 2026-11-02 —— 行结构与设置页改用官方模板
|
|
6
34
|
|
|
7
35
|
按 `docs/ui-inventory.md` 的第 1、2 项打。
|
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` 102/102 通过
|
|
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 # 102 项单测
|
|
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.44'
|
|
18
18
|
let BASE = '/session-superagent'
|
|
19
19
|
/**
|
|
20
20
|
* 挑「最新的那个服务端实例」。
|
|
@@ -244,14 +244,81 @@ window.__ModuleLoader__.load({
|
|
|
244
244
|
return h('span', { className: 'dt-dot-wrap', title: label, role: 'img', 'aria-label': label }, dot)
|
|
245
245
|
}
|
|
246
246
|
|
|
247
|
-
|
|
247
|
+
// 官方 Section 还支持 hint(说明)与 action(右上角动作),我们之前只有 title/count。
|
|
248
|
+
function Section({ title, count, hint, action, children }) {
|
|
248
249
|
return h('section', { className: 'dt-section' },
|
|
249
|
-
title
|
|
250
|
-
h('
|
|
251
|
-
|
|
250
|
+
title
|
|
251
|
+
? h('div', { className: 'dt-section-title' },
|
|
252
|
+
h('span', { className: 'dt-section-name' }, title),
|
|
253
|
+
count !== undefined && count !== null ? h('span', { className: 'dt-count' }, String(count)) : null,
|
|
254
|
+
action ? h('span', { className: 'dt-subhead-actions' }, action) : null)
|
|
255
|
+
: null,
|
|
256
|
+
hint ? h(Hint, null, hint) : null,
|
|
252
257
|
children)
|
|
253
258
|
}
|
|
254
259
|
|
|
260
|
+
/** 官方 DisclosureRow 的实际用法:默认收起,点开看明细。 */
|
|
261
|
+
function CollapsibleList({ title, items }) {
|
|
262
|
+
const [open, setOpen] = useState(false)
|
|
263
|
+
return h(DisclosureRow, {
|
|
264
|
+
title: title + '(' + items.length + ')',
|
|
265
|
+
open, onToggle: () => setOpen(!open),
|
|
266
|
+
icon: h(Icon, { name: 'question', size: 14 }),
|
|
267
|
+
collapsedContent: h('span', { className: 'dt-hint' }, items[0] ? String(items[0]).slice(0, 40) : ''),
|
|
268
|
+
},
|
|
269
|
+
h('ul', { className: 'dt-plain-list' },
|
|
270
|
+
items.map((text, index) => h('li', { key: index }, text))))
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/** 官方 Pill:可切换的小胶囊(用于「全部 / 只看失败」这类就地过滤)。 */
|
|
274
|
+
function Pill({ active, onClick, children }) {
|
|
275
|
+
return h('button', {
|
|
276
|
+
type: 'button', className: cx('dt-pill', active && 'dt-pill-active'),
|
|
277
|
+
'aria-pressed': !!active, onClick,
|
|
278
|
+
}, children)
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/** 官方 SegmentedControl:单选分段(与 SegTabs 的页签语义不同,用于表单内的互斥选择)。 */
|
|
282
|
+
function SegmentedControl({ options, value, onChange, label, disabled }) {
|
|
283
|
+
return h('div', { className: 'dt-segmented', role: 'radiogroup', 'aria-label': label },
|
|
284
|
+
options.map((option) => h('button', {
|
|
285
|
+
key: option.value, type: 'button', role: 'radio',
|
|
286
|
+
'aria-checked': value === option.value, 'aria-selected': value === option.value,
|
|
287
|
+
className: 'dt-segment', disabled: disabled || option.disabled,
|
|
288
|
+
onClick: () => onChange(option.value),
|
|
289
|
+
}, option.label)))
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/** 官方 DisclosureRow:折叠行的标准写法(Enter / 空格可切换,带 aria-expanded)。 */
|
|
293
|
+
function DisclosureRow({ icon, title, open, onToggle, collapsedContent, children }) {
|
|
294
|
+
return h('div', { className: 'dt-disclosure', 'data-open': open ? 'true' : undefined },
|
|
295
|
+
h('div', {
|
|
296
|
+
className: 'dt-disclosure-row', role: 'button', tabIndex: 0, 'aria-expanded': !!open,
|
|
297
|
+
onClick: onToggle,
|
|
298
|
+
onKeyDown: (event) => {
|
|
299
|
+
if (event.key === 'Enter' || event.key === ' ') { event.preventDefault(); onToggle() }
|
|
300
|
+
},
|
|
301
|
+
},
|
|
302
|
+
h('span', { className: 'dt-disclosure-lead' },
|
|
303
|
+
h('span', { className: 'dt-disclosure-icon' }, icon),
|
|
304
|
+
h('span', { className: 'dt-disclosure-chevron' }, h(Icon, { name: open ? 'chevron-up' : 'chevron-down' }))),
|
|
305
|
+
h('span', { className: 'dt-disclosure-title' }, title),
|
|
306
|
+
!open ? collapsedContent : null),
|
|
307
|
+
open ? children : null)
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/** 官方 InfoTip:点一下出气泡(我们之前只有 dt-info 的样式,没有组件)。 */
|
|
311
|
+
function InfoTip({ text, icon = 'question', warn }) {
|
|
312
|
+
const [open, setOpen] = useState(false)
|
|
313
|
+
return h('span', { style: { position: 'relative', display: 'inline-flex' } },
|
|
314
|
+
h('button', {
|
|
315
|
+
type: 'button', className: cx('dt-info', warn && 'dt-info-warn'),
|
|
316
|
+
'aria-label': text, 'aria-expanded': open,
|
|
317
|
+
onClick: () => setOpen(!open), onBlur: () => setOpen(false),
|
|
318
|
+
}, h(Icon, { name: icon, size: 14 })),
|
|
319
|
+
open ? h('span', { className: 'dt-tooltip', role: 'tooltip', style: { position: 'absolute', bottom: '130%', left: 0, visibility: 'visible' } }, text) : null)
|
|
320
|
+
}
|
|
321
|
+
|
|
255
322
|
const Hint = ({ children }) => h('p', { className: 'dt-hint' }, children)
|
|
256
323
|
|
|
257
324
|
function KeyValues({ rows }) {
|
|
@@ -971,10 +1038,12 @@ window.__ModuleLoader__.load({
|
|
|
971
1038
|
|
|
972
1039
|
const overview = [
|
|
973
1040
|
watchers.some((w) => (w.filteredLog || []).length > 0)
|
|
974
|
-
? h(Section, { key: 'filtered', title: '最近被过滤'
|
|
975
|
-
h(
|
|
976
|
-
|
|
977
|
-
|
|
1041
|
+
? h(Section, { key: 'filtered', title: '最近被过滤' },
|
|
1042
|
+
h(CollapsibleList, {
|
|
1043
|
+
title: '看被过滤的条目',
|
|
1044
|
+
items: watchers.flatMap((w) => (w.filteredLog || []).slice(-2).map((entry) =>
|
|
1045
|
+
'#' + entry.number + ' ' + (entry.title || '') + ' — ' + entry.reason)),
|
|
1046
|
+
}))
|
|
978
1047
|
: null,
|
|
979
1048
|
problems.length > 0
|
|
980
1049
|
? h(Section, { key: 'problems', title: '需要关注', count: problems.length },
|
|
@@ -994,20 +1063,32 @@ window.__ModuleLoader__.load({
|
|
|
994
1063
|
]
|
|
995
1064
|
|
|
996
1065
|
// 判定日志(对应官方 eval 页):每轮的唤醒结果、跳过原因、被过滤记录,一次看全
|
|
997
|
-
|
|
1066
|
+
// 判定页用官方的时间线结构(dt-timeline / dt-event / dt-event-foot),
|
|
1067
|
+
// 官方在 thread.tsx 与 settings-kit.tsx 里就是这么铺「发生过什么」的。
|
|
1068
|
+
const judge = h(Section, {
|
|
1069
|
+
title: '判定日志',
|
|
1070
|
+
count: watchers.reduce((n, w) => n + (w.history || []).length, 0),
|
|
1071
|
+
action: h(InfoTip, { text: '每轮判定都会记一条:唤醒、仅观察,或跳过及其原因。只存最近若干条。' }),
|
|
1072
|
+
},
|
|
998
1073
|
watchers.length === 0
|
|
999
1074
|
? h(Hint, null, '还没有主理鱼。')
|
|
1000
|
-
: h('
|
|
1001
|
-
watchers.flatMap((watcher) => (watcher.history || []).slice(-6).reverse().map((entry, index) =>
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1075
|
+
: h('ol', { className: 'dt-timeline' },
|
|
1076
|
+
watchers.flatMap((watcher) => (watcher.history || []).slice(-6).reverse().map((entry, index) => {
|
|
1077
|
+
const label = entry.ok ? '已唤醒' : entry.reason === 'observe' ? '仅观察(未唤醒)' : '跳过:' + (entry.reason || '未知')
|
|
1078
|
+
return h('li', {
|
|
1079
|
+
key: watcher.repo + '#' + watcher.sessionId + entry.at + index,
|
|
1080
|
+
className: 'dt-event' + (entry.ok ? '' : ' dt-event-quiet'),
|
|
1081
|
+
},
|
|
1082
|
+
h('div', { className: 'dt-event-foot' },
|
|
1083
|
+
h('strong', { className: 'dt-event-actor' }, watcher.repo),
|
|
1084
|
+
h('span', null, ageText(entry.at))),
|
|
1085
|
+
h('p', { className: 'dt-event-text' }, label),
|
|
1086
|
+
h('div', { className: 'dt-event-foot' },
|
|
1087
|
+
(entry.numbers || []).length > 0
|
|
1088
|
+
? h('span', null, (entry.numbers || []).map((n) => '#' + n).join(' '))
|
|
1089
|
+
: null,
|
|
1090
|
+
h('span', null, (watcher.title || '未命名会话') + ' · ' + sessionTag(watcher.sessionId))))
|
|
1091
|
+
}))))
|
|
1011
1092
|
|
|
1012
1093
|
const trigger = h(Section, { title: '新增主理鱼' },
|
|
1013
1094
|
h('div', { className: 'dt-form' },
|
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.44'
|
|
34
34
|
export const inject = ['tools', 'agents', 'webServer']
|
|
35
35
|
|
|
36
36
|
/** 仅供测试:读写状态文件(生产代码不要用)。 */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-session-superagent",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.44",
|
|
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",
|