dsh-session-superagent 0.8.42 → 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 +54 -0
- package/MAINTENANCE.md +1 -1
- package/README.md +2 -2
- package/client.js +180 -71
- 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.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
|
+
|
|
33
|
+
## [0.8.43] - 2026-11-02 —— 行结构与设置页改用官方模板
|
|
34
|
+
|
|
35
|
+
按 `docs/ui-inventory.md` 的第 1、2 项打。
|
|
36
|
+
|
|
37
|
+
### 行列表:改用官方 `TicketLine` 结构
|
|
38
|
+
官方 `rows.tsx` 的行是 `<li class="dt-row dt-link dt-ticket">`,两列网格:
|
|
39
|
+
**左列状态(`dt-ticket-stage`)** + **右列正文(`dt-ticket-body`)**,标题本身是 `dt-open` 按钮。
|
|
40
|
+
我们之前是普通 `dt-row` + 一个单独的「编辑」按钮。现在:
|
|
41
|
+
|
|
42
|
+
- 列表容器 `dt-rows` → **`dt-list`**(只有 `.dt-list > .dt-ticket` 才有左侧状态列网格);
|
|
43
|
+
- 标题改成 `dt-open` 按钮(带 `aria-expanded`),点标题展开行内编辑 —— 官方就是点标题进详情;
|
|
44
|
+
- 行内 `dt-ticket-note` 承载会话/间隔/轮询/唤醒这串说明,错误行用 `dt-ticket-note-error`;
|
|
45
|
+
- 操作收进 `dt-ticket-actions`。
|
|
46
|
+
|
|
47
|
+
### 设置页:改用官方「左栏 + 内容」
|
|
48
|
+
`dt-settings` 网格(140px + 内容)之前搬来了 CSS 却没用。现在是四个分区(来源 / 凭证 / 版本与更新 / 会话 goal)
|
|
49
|
+
配 `dt-settings-nav` 左栏,当前项 `aria-current="page"`,深链路里不用一路滚到底。
|
|
50
|
+
|
|
51
|
+
### UI 体检扩到 9 项
|
|
52
|
+
新增「官方结构采用数」(`dt-ticket` / `dt-list` / `dt-open` / `dt-settings` / `dt-settings-nav` /
|
|
53
|
+
`dt-timeline` / `dt-event` / `dt-disclosure`),当前 **8/8**。合计 **9/9 = 100 分**。
|
|
54
|
+
|
|
55
|
+
### 测试
|
|
56
|
+
- 新增:设置页必须有 `dt-settings` 网格、4 个左栏项、且只有 1 个 `aria-current=page`;
|
|
57
|
+
- 「编辑按钮」用例改成断言 `dt-open` 标题(交互位置变了,行为没丢)。合计 **101 例**。
|
|
58
|
+
|
|
5
59
|
## [0.8.42] - 2026-11-02 —— 全界面盘点 + 弹层键盘行为对齐官方
|
|
6
60
|
|
|
7
61
|
用户要求:「所有 UI,包括二三级页面,有官方素材就用官方素材」。先做盘点,再按清单打。
|
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 }) {
|
|
@@ -747,6 +814,8 @@ window.__ModuleLoader__.load({
|
|
|
747
814
|
// 版本检查结果(只读):面板里直接告诉客户「有没有新版本、该跑什么命令」
|
|
748
815
|
const [update, setUpdate] = useState(null)
|
|
749
816
|
const [checking, setChecking] = useState(false)
|
|
817
|
+
// 设置页用官方的「左栏 + 内容」结构(dt-settings),所以要记当前分区
|
|
818
|
+
const [settingsSection, setSettingsSection] = useState('source')
|
|
750
819
|
|
|
751
820
|
const load = useCallback(async () => {
|
|
752
821
|
try {
|
|
@@ -871,61 +940,57 @@ window.__ModuleLoader__.load({
|
|
|
871
940
|
return h(Tag, { tone, title: state === 'dormant' ? '不在活跃时段:只攒条目,不唤醒' : undefined }, STATE_TEXT[state])
|
|
872
941
|
}
|
|
873
942
|
|
|
943
|
+
// 行结构对齐官方 rows.tsx 的 TicketLine:dt-ticket(左侧状态列)+ dt-open 标题 + dt-ticket-actions。
|
|
944
|
+
// 标题本身是按钮 —— 官方就是点标题进详情,我们点标题展开行内编辑,交互更轻但不脱离这套结构。
|
|
945
|
+
const STAGE_STATE = { active: undefined, paused: 'warning', error: 'error', dormant: 'warning' }
|
|
874
946
|
const row = (watcher) => {
|
|
875
947
|
const key = watcher.repo + '#' + watcher.sessionId
|
|
876
|
-
const
|
|
877
|
-
h('div', { className: 'dt-
|
|
878
|
-
h(Dot, { state: orbitStateOf(watcher) === 'active' ? 'done' : orbitStateOf(watcher) === 'error' ? 'error' : 'idle', label: STATE_TEXT[orbitStateOf(watcher)] }),
|
|
948
|
+
const state = orbitStateOf(watcher)
|
|
949
|
+
const rowBody = h('div', { className: 'dt-ticket-body' },
|
|
879
950
|
h('div', { className: 'dt-row-title' },
|
|
880
|
-
h('
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
(
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
951
|
+
h('button', {
|
|
952
|
+
type: 'button', className: 'dt-open', title: '展开或收起这条主理鱼的设置',
|
|
953
|
+
'aria-expanded': editing === key, onClick: () => {
|
|
954
|
+
setEditing(editing === key ? null : key)
|
|
955
|
+
setDraft({
|
|
956
|
+
intervalSec: String(watcher.intervalSec ?? 60),
|
|
957
|
+
labels: (watcher.filters && watcher.filters.labels ? watcher.filters.labels : []).join(','),
|
|
958
|
+
activeHours: watcher.activeHours || '',
|
|
959
|
+
goal: watcher.note || '',
|
|
960
|
+
onlyAssigned: !!(watcher.filters && watcher.filters.onlyAssigned),
|
|
961
|
+
})
|
|
962
|
+
},
|
|
963
|
+
}, watcher.repo)),
|
|
964
|
+
h('div', { className: 'dt-row-meta dt-ticket-meta' },
|
|
893
965
|
stateTag(watcher),
|
|
894
966
|
watcher.observe ? h(Tag, { tone: 'warning' }, '仅观察') : null,
|
|
895
967
|
watcher.activeHours ? h(Tag, null, '时段 ' + watcher.activeHours) : null,
|
|
896
968
|
watcher.isolated ? h(Tag, null, isolationText(watcher)) : null,
|
|
897
969
|
filterText(watcher.filters) ? h(Tag, null, filterText(watcher.filters)) : null,
|
|
898
|
-
backoffText(watcher) ? h(Tag, { tone: 'warning' }, backoffText(watcher)) : null)
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
label: watcher.enabled ? '暂停' : '恢复',
|
|
923
|
-
onClick: () => act(watcher, watcher.enabled ? 'pause' : 'resume'),
|
|
924
|
-
}, watcher.enabled ? '暂停' : '恢复'),
|
|
925
|
-
h(ConfirmBtn, {
|
|
926
|
-
size: 'sm', variant: 'ghost', icon: h(Icon, { name: 'trash' }), label: '删除',
|
|
927
|
-
confirmLabel: '确认删除', onConfirm: () => act(watcher, 'delete'),
|
|
928
|
-
})))
|
|
970
|
+
backoffText(watcher) ? h(Tag, { tone: 'warning' }, backoffText(watcher)) : null),
|
|
971
|
+
h('div', { className: 'dt-ticket-note' },
|
|
972
|
+
[
|
|
973
|
+
(watcher.title || '未命名会话') + ' · ' + sessionTag(watcher.sessionId),
|
|
974
|
+
'每 ' + watcher.intervalSec + 's',
|
|
975
|
+
'轮询 ' + ageText(watcher.lastPoll),
|
|
976
|
+
'唤醒 ' + wakeText(watcher.lastWake),
|
|
977
|
+
historyText(watcher),
|
|
978
|
+
watcher.note ? '目标: ' + String(watcher.note).slice(0, 40) : '',
|
|
979
|
+
].filter(Boolean).join(' · ')),
|
|
980
|
+
watcher.lastDeferred ? h('div', { className: 'dt-ticket-note' }, watcher.lastDeferred) : null,
|
|
981
|
+
watcher.lastError ? h('div', { className: 'dt-ticket-note dt-ticket-note-error' }, String(watcher.lastError).slice(0, 160)) : null,
|
|
982
|
+
h('div', { className: 'dt-ticket-actions' },
|
|
983
|
+
h(Btn, { size: 'sm', variant: 'outline', icon: h(Icon, { name: 'refresh' }), onClick: () => act(watcher, 'poll') }, '立刻'),
|
|
984
|
+
h(Btn, {
|
|
985
|
+
size: 'sm', variant: 'ghost',
|
|
986
|
+
icon: h(Icon, { name: watcher.enabled ? 'pause' : 'play' }),
|
|
987
|
+
label: watcher.enabled ? '暂停' : '恢复',
|
|
988
|
+
onClick: () => act(watcher, watcher.enabled ? 'pause' : 'resume'),
|
|
989
|
+
}, watcher.enabled ? '暂停' : '恢复'),
|
|
990
|
+
h(ConfirmBtn, {
|
|
991
|
+
size: 'sm', variant: 'ghost', icon: h(Icon, { name: 'trash' }), label: '删除',
|
|
992
|
+
confirmLabel: '确认删除', onConfirm: () => act(watcher, 'delete'),
|
|
993
|
+
})))
|
|
929
994
|
const editor = editing === key
|
|
930
995
|
? h('div', { className: 'dt-fieldset' },
|
|
931
996
|
field('间隔(秒)', h(Input, { value: draft.intervalSec, onChange: (e) => setDraft({ ...draft, intervalSec: e.target.value }) })),
|
|
@@ -942,7 +1007,17 @@ window.__ModuleLoader__.load({
|
|
|
942
1007
|
h(Btn, { size: 'sm', variant: 'primary', onClick: () => saveEdit(watcher) }, '保存'),
|
|
943
1008
|
h(Btn, { size: 'sm', onClick: () => setEditing(null) }, '放弃')))
|
|
944
1009
|
: null
|
|
945
|
-
|
|
1010
|
+
// 官方 TicketLine 是 <li class="dt-row dt-link dt-ticket"> 里套「状态列 + 正文列」,
|
|
1011
|
+
// 展开的表单跟在正文列里,不破坏两列网格。
|
|
1012
|
+
const bodyChildren = [].concat(rowBody.props.children || []).filter(Boolean)
|
|
1013
|
+
return h('li', {
|
|
1014
|
+
key,
|
|
1015
|
+
className: 'dt-row dt-link dt-ticket',
|
|
1016
|
+
'data-state': state === 'error' ? 'error' : undefined,
|
|
1017
|
+
},
|
|
1018
|
+
h('div', { className: 'dt-ticket-stage' },
|
|
1019
|
+
h('span', { className: 'dt-stage', 'data-state': STAGE_STATE[state] }, STATE_TEXT[state])),
|
|
1020
|
+
h('div', { className: 'dt-ticket-body' }, ...bodyChildren, editor))
|
|
946
1021
|
}
|
|
947
1022
|
|
|
948
1023
|
const problems = []
|
|
@@ -963,10 +1038,12 @@ window.__ModuleLoader__.load({
|
|
|
963
1038
|
|
|
964
1039
|
const overview = [
|
|
965
1040
|
watchers.some((w) => (w.filteredLog || []).length > 0)
|
|
966
|
-
? h(Section, { key: 'filtered', title: '最近被过滤'
|
|
967
|
-
h(
|
|
968
|
-
|
|
969
|
-
|
|
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
|
+
}))
|
|
970
1047
|
: null,
|
|
971
1048
|
problems.length > 0
|
|
972
1049
|
? h(Section, { key: 'problems', title: '需要关注', count: problems.length },
|
|
@@ -982,24 +1059,36 @@ window.__ModuleLoader__.load({
|
|
|
982
1059
|
? h(Hint, null, '还没有主理鱼。切到「触发」页填一个 owner/name 添加。')
|
|
983
1060
|
: visible.length === 0
|
|
984
1061
|
? h(Hint, null, '没有匹配「' + search + '」的主理鱼。')
|
|
985
|
-
: h('
|
|
1062
|
+
: h('ul', { className: 'dt-list' }, visible.map(row))),
|
|
986
1063
|
]
|
|
987
1064
|
|
|
988
1065
|
// 判定日志(对应官方 eval 页):每轮的唤醒结果、跳过原因、被过滤记录,一次看全
|
|
989
|
-
|
|
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
|
+
},
|
|
990
1073
|
watchers.length === 0
|
|
991
1074
|
? h(Hint, null, '还没有主理鱼。')
|
|
992
|
-
: h('
|
|
993
|
-
watchers.flatMap((watcher) => (watcher.history || []).slice(-6).reverse().map((entry, index) =>
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
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
|
+
}))))
|
|
1003
1092
|
|
|
1004
1093
|
const trigger = h(Section, { title: '新增主理鱼' },
|
|
1005
1094
|
h('div', { className: 'dt-form' },
|
|
@@ -1018,7 +1107,7 @@ window.__ModuleLoader__.load({
|
|
|
1018
1107
|
h(Btn, { variant: 'primary', icon: h(Icon, { name: 'plus' }), onClick: addWatcher, disabled: !sessionId || !form.repo.trim() },
|
|
1019
1108
|
sessionId ? '添加到当前会话' : '需要会话上下文'))))
|
|
1020
1109
|
|
|
1021
|
-
const
|
|
1110
|
+
const settingsSections = [
|
|
1022
1111
|
h(Section, { key: 'source', title: '来源' },
|
|
1023
1112
|
h(KeyValues, { rows: [
|
|
1024
1113
|
['仓库', watchers.length === 0 ? '未绑定' : watchers.map((w) => w.repo).join(', ')],
|
|
@@ -1054,6 +1143,26 @@ window.__ModuleLoader__.load({
|
|
|
1054
1143
|
h('div', { className: 'dt-actions' }, h(Btn, { variant: 'primary', onClick: saveGoal, disabled: !sessionId }, '保存 goal'))),
|
|
1055
1144
|
]
|
|
1056
1145
|
|
|
1146
|
+
|
|
1147
|
+
// 官方设置页是「左栏导航 + 右侧内容」的网格(dt-settings / dt-settings-nav / dt-settings-body)。
|
|
1148
|
+
// 我们之前是单列堆叠,四个分区一起铺开,深链路里翻起来很累。
|
|
1149
|
+
const SETTINGS_SECTIONS = [
|
|
1150
|
+
{ key: 'source', title: '来源' },
|
|
1151
|
+
{ key: 'creds', title: '凭证' },
|
|
1152
|
+
{ key: 'update', title: '版本与更新' },
|
|
1153
|
+
{ key: 'goal', title: '会话 goal' },
|
|
1154
|
+
]
|
|
1155
|
+
const settingsBody = settingsSections.find((node) => node && node.props && node.props.key === settingsSection)
|
|
1156
|
+
|| settingsSections.find(Boolean)
|
|
1157
|
+
const settings = h('div', { className: 'dt-settings' },
|
|
1158
|
+
h('nav', { className: 'dt-settings-nav', 'aria-label': '设置分区' },
|
|
1159
|
+
SETTINGS_SECTIONS.map((item) => h('button', {
|
|
1160
|
+
key: item.key, type: 'button', className: 'dt-settings-link',
|
|
1161
|
+
'aria-current': settingsSection === item.key ? 'page' : undefined,
|
|
1162
|
+
onClick: () => setSettingsSection(item.key),
|
|
1163
|
+
}, item.title))),
|
|
1164
|
+
h('div', { className: 'dt-settings-body' }, settingsBody))
|
|
1165
|
+
|
|
1057
1166
|
const checkUpdate = useCallback(async (force) => {
|
|
1058
1167
|
setChecking(true)
|
|
1059
1168
|
try {
|
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",
|