dsh-session-superagent 0.8.43 → 0.8.45
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 +54 -0
- package/MAINTENANCE.md +1 -1
- package/README.md +2 -2
- package/client.js +119 -27
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,60 @@
|
|
|
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.45] - 2026-11-02 —— 表单字段补齐官方 Field,状态色全部 token 化
|
|
6
|
+
|
|
7
|
+
### ① 表单字段用官方 `Field`(带 hint / note)
|
|
8
|
+
官方 `settings-kit.tsx` 的 `Field` 是 `label + hint(InfoTip) + 控件 + note(small)`。
|
|
9
|
+
我们之前只有 `label`,说明只能塞进 placeholder。现在字段名旁有 `?` 图标,点开看人话:
|
|
10
|
+
|
|
11
|
+
- 「间隔(秒)」→ 多长时间检查一次这个仓库,最小 30 秒
|
|
12
|
+
- 「活跃时段」→ 只在这个时间段内唤醒;窗口外只攒条目,不打扰
|
|
13
|
+
|
|
14
|
+
### ② 状态色不再写死
|
|
15
|
+
轨道环的四个状态色之前是 `#3fb950 / #d29922 / #f85149 / #8b949e`(写死 hex,深色主题里就是错的),
|
|
16
|
+
toast 的错误左边条同样写死了 `#f85149`。现在全部改成 `--dsw-alias-state-*` / `--dsw-alias-label-caption`。
|
|
17
|
+
|
|
18
|
+
### ③ UI 体检加第 10 项:写死颜色(含 inline style 与 JS 常量)
|
|
19
|
+
之前只扫样式块,所以漏掉了上面这些。现在扫整个 client.js(排除搬来的 `PORTED_CSS`),
|
|
20
|
+
要求 0 处 —— 否则「换主题就有一条颜色是错的」这类问题永远发现不了。
|
|
21
|
+
|
|
22
|
+
### 指标
|
|
23
|
+
```
|
|
24
|
+
10/10 通过(100 分)
|
|
25
|
+
写死颜色(样式块)0 · 写死颜色(inline/JS)0 · 官方结构 8/8 · 弹层键盘 3/3
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### 测试
|
|
29
|
+
- 合计 **102 例**。
|
|
30
|
+
|
|
31
|
+
## [0.8.44] - 2026-11-02 —— 判定页换官方时间线 + 补齐四个原语
|
|
32
|
+
|
|
33
|
+
按 `docs/ui-inventory.md` 第 3、4 项。
|
|
34
|
+
|
|
35
|
+
### 判定页:改用官方时间线结构
|
|
36
|
+
官方在 `thread.tsx` / `settings-kit.tsx` 里铺「发生过什么」用的是
|
|
37
|
+
`ol.dt-timeline > li.dt-event`(含 `dt-event-quiet` 静音态、`dt-event-foot` 元信息行、`dt-event-text` 正文)。
|
|
38
|
+
我们之前是普通 `dt-row` 堆叠,现在换成官方结构:跳过/仅观察的条目用 `dt-event-quiet` 弱化。
|
|
39
|
+
|
|
40
|
+
### 补齐四个官方原语(`controls.tsx`)
|
|
41
|
+
| 原语 | 官方行为 |
|
|
42
|
+
|---|---|
|
|
43
|
+
| `Pill` | 可切换小胶囊(`aria-pressed`) |
|
|
44
|
+
| `SegmentedControl` | 表单内互斥分段(`role=radiogroup` + `aria-checked`) |
|
|
45
|
+
| `DisclosureRow` | 折叠行:Enter / 空格可切换、`aria-expanded`、展开图标切换 |
|
|
46
|
+
| `InfoTip` | 点一下出气泡说明(`role=tooltip`) |
|
|
47
|
+
|
|
48
|
+
同时 `Section` 补上官方的 `hint` / `action` 两个插槽;「最近被过滤」改用 `DisclosureRow` 折叠
|
|
49
|
+
(默认只露第一条摘要,点开看全部)—— 原语不是摆着看的。
|
|
50
|
+
|
|
51
|
+
### 顺手修掉一个假守门
|
|
52
|
+
`meta.test.mjs` 里「watch.js 导出必须被 import」那条用了 `new RegExp('' + name + '')`,
|
|
53
|
+
但文件里实际是**单个反斜杠**(`''` 写成了 `''`→退格符),正则永远匹配不到东西 —— 这条守门此前形同虚设。
|
|
54
|
+
已改成真正的词边界,并另加一条「官方原语齐全」守门。
|
|
55
|
+
|
|
56
|
+
### 测试
|
|
57
|
+
- 合计 **102 例**;UI 体检 9/9 = 100 分(官方结构采用 8/8)。
|
|
58
|
+
|
|
5
59
|
## [0.8.43] - 2026-11-02 —— 行结构与设置页改用官方模板
|
|
6
60
|
|
|
7
61
|
按 `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.45'
|
|
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 }) {
|
|
@@ -371,7 +438,13 @@ window.__ModuleLoader__.load({
|
|
|
371
438
|
return 'active'
|
|
372
439
|
}
|
|
373
440
|
|
|
374
|
-
|
|
441
|
+
// 状态色一律走 token(写死 hex 在深色/浅色两套主题里会有一个是错的)
|
|
442
|
+
const SAT_COLOR = {
|
|
443
|
+
active: 'var(--dsw-alias-state-success-primary)',
|
|
444
|
+
paused: 'var(--dsw-alias-state-warn-primary)',
|
|
445
|
+
error: 'var(--dsw-alias-state-error-primary)',
|
|
446
|
+
dormant: 'var(--dsw-alias-label-caption)',
|
|
447
|
+
}
|
|
375
448
|
const STATE_TEXT = { active: '主理中', paused: '已暂停', error: '异常', dormant: '时段外' }
|
|
376
449
|
|
|
377
450
|
/** 尊重系统的「减少动态效果」设置。 */
|
|
@@ -721,7 +794,7 @@ window.__ModuleLoader__.load({
|
|
|
721
794
|
'aria-live': 'polite',
|
|
722
795
|
// 官方 toast 是深底白字;错误态不要改成浅红底(白字会看不清),改用左侧红条标记
|
|
723
796
|
style: item.tone === 'error'
|
|
724
|
-
? { '--dt-toast-hold': '3600ms', borderLeft: '3px solid
|
|
797
|
+
? { '--dt-toast-hold': '3600ms', borderLeft: '3px solid var(--dsw-alias-state-error-primary)' }
|
|
725
798
|
: { '--dt-toast-hold': '3600ms' },
|
|
726
799
|
}, item.text)
|
|
727
800
|
return [view, notify]
|
|
@@ -926,9 +999,9 @@ window.__ModuleLoader__.load({
|
|
|
926
999
|
})))
|
|
927
1000
|
const editor = editing === key
|
|
928
1001
|
? h('div', { className: 'dt-fieldset' },
|
|
929
|
-
field('间隔(秒)', h(Input, { value: draft.intervalSec, onChange: (e) => setDraft({ ...draft, intervalSec: e.target.value }) })),
|
|
1002
|
+
field('间隔(秒)', h(Input, { value: draft.intervalSec, onChange: (e) => setDraft({ ...draft, intervalSec: e.target.value }) }), '多长时间检查一次这个仓库,最小 30 秒'),
|
|
930
1003
|
field('只处理这些标签', h(Input, { value: draft.labels, placeholder: '逗号分隔,留空 = 全部', onChange: (e) => setDraft({ ...draft, labels: e.target.value }) })),
|
|
931
|
-
field('活跃时段', h(Input, { value: draft.activeHours, placeholder: '09:00-23:00,留空 = 全天', onChange: (e) => setDraft({ ...draft, activeHours: e.target.value }) })),
|
|
1004
|
+
field('活跃时段', h(Input, { value: draft.activeHours, placeholder: '09:00-23:00,留空 = 全天', onChange: (e) => setDraft({ ...draft, activeHours: e.target.value }) }), '只在这个时间段内唤醒;窗口外只攒条目,不打扰'),
|
|
932
1005
|
field('目标/规则', h(Input, { value: draft.goal || '', placeholder: '可选,会附在唤醒消息里', onChange: (e) => setDraft({ ...draft, goal: e.target.value }) })),
|
|
933
1006
|
h('label', { className: 'dt-switch-row' }, h(Toggle, { checked: !!draft.onlyAssigned, onChange: (v) => setDraft({ ...draft, onlyAssigned: v }), label: '只看已指派' }), '只处理已指派给人的条目'),
|
|
934
1007
|
field('单次最多唤醒条数', h(Input, { value: draft.batchLimit || '', placeholder: '5(1-20)', onChange: (e) => setDraft({ ...draft, batchLimit: e.target.value }) })),
|
|
@@ -971,10 +1044,12 @@ window.__ModuleLoader__.load({
|
|
|
971
1044
|
|
|
972
1045
|
const overview = [
|
|
973
1046
|
watchers.some((w) => (w.filteredLog || []).length > 0)
|
|
974
|
-
? h(Section, { key: 'filtered', title: '最近被过滤'
|
|
975
|
-
h(
|
|
976
|
-
|
|
977
|
-
|
|
1047
|
+
? h(Section, { key: 'filtered', title: '最近被过滤' },
|
|
1048
|
+
h(CollapsibleList, {
|
|
1049
|
+
title: '看被过滤的条目',
|
|
1050
|
+
items: watchers.flatMap((w) => (w.filteredLog || []).slice(-2).map((entry) =>
|
|
1051
|
+
'#' + entry.number + ' ' + (entry.title || '') + ' — ' + entry.reason)),
|
|
1052
|
+
}))
|
|
978
1053
|
: null,
|
|
979
1054
|
problems.length > 0
|
|
980
1055
|
? h(Section, { key: 'problems', title: '需要关注', count: problems.length },
|
|
@@ -994,20 +1069,32 @@ window.__ModuleLoader__.load({
|
|
|
994
1069
|
]
|
|
995
1070
|
|
|
996
1071
|
// 判定日志(对应官方 eval 页):每轮的唤醒结果、跳过原因、被过滤记录,一次看全
|
|
997
|
-
|
|
1072
|
+
// 判定页用官方的时间线结构(dt-timeline / dt-event / dt-event-foot),
|
|
1073
|
+
// 官方在 thread.tsx 与 settings-kit.tsx 里就是这么铺「发生过什么」的。
|
|
1074
|
+
const judge = h(Section, {
|
|
1075
|
+
title: '判定日志',
|
|
1076
|
+
count: watchers.reduce((n, w) => n + (w.history || []).length, 0),
|
|
1077
|
+
action: h(InfoTip, { text: '每轮判定都会记一条:唤醒、仅观察,或跳过及其原因。只存最近若干条。' }),
|
|
1078
|
+
},
|
|
998
1079
|
watchers.length === 0
|
|
999
1080
|
? 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
|
-
|
|
1081
|
+
: h('ol', { className: 'dt-timeline' },
|
|
1082
|
+
watchers.flatMap((watcher) => (watcher.history || []).slice(-6).reverse().map((entry, index) => {
|
|
1083
|
+
const label = entry.ok ? '已唤醒' : entry.reason === 'observe' ? '仅观察(未唤醒)' : '跳过:' + (entry.reason || '未知')
|
|
1084
|
+
return h('li', {
|
|
1085
|
+
key: watcher.repo + '#' + watcher.sessionId + entry.at + index,
|
|
1086
|
+
className: 'dt-event' + (entry.ok ? '' : ' dt-event-quiet'),
|
|
1087
|
+
},
|
|
1088
|
+
h('div', { className: 'dt-event-foot' },
|
|
1089
|
+
h('strong', { className: 'dt-event-actor' }, watcher.repo),
|
|
1090
|
+
h('span', null, ageText(entry.at))),
|
|
1091
|
+
h('p', { className: 'dt-event-text' }, label),
|
|
1092
|
+
h('div', { className: 'dt-event-foot' },
|
|
1093
|
+
(entry.numbers || []).length > 0
|
|
1094
|
+
? h('span', null, (entry.numbers || []).map((n) => '#' + n).join(' '))
|
|
1095
|
+
: null,
|
|
1096
|
+
h('span', null, (watcher.title || '未命名会话') + ' · ' + sessionTag(watcher.sessionId))))
|
|
1097
|
+
}))))
|
|
1011
1098
|
|
|
1012
1099
|
const trigger = h(Section, { title: '新增主理鱼' },
|
|
1013
1100
|
h('div', { className: 'dt-form' },
|
|
@@ -1104,8 +1191,13 @@ window.__ModuleLoader__.load({
|
|
|
1104
1191
|
return () => { alive = false }
|
|
1105
1192
|
}, [])
|
|
1106
1193
|
|
|
1107
|
-
|
|
1108
|
-
|
|
1194
|
+
// 官方 settings-kit.tsx 的 Field:label + hint(InfoTip) + 控件 + note(small)。
|
|
1195
|
+
// 我们之前只有 label,说明只能塞进 placeholder —— 用户看不到「这个字段到底什么意思」。
|
|
1196
|
+
function field(label, control, hint, note) {
|
|
1197
|
+
return h('label', { className: 'dt-field', key: label },
|
|
1198
|
+
h('span', { className: 'dt-field-head' }, label, hint ? h(InfoTip, { text: hint }) : null),
|
|
1199
|
+
control,
|
|
1200
|
+
note ? h('small', null, note) : null)
|
|
1109
1201
|
}
|
|
1110
1202
|
|
|
1111
1203
|
return h('div', { className: 'dt-page' },
|
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.45'
|
|
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.45",
|
|
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",
|