dsh-session-superagent 0.8.42 → 0.8.43
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 +26 -0
- package/MAINTENANCE.md +1 -1
- package/README.md +2 -2
- package/client.js +79 -51
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,32 @@
|
|
|
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.43] - 2026-11-02 —— 行结构与设置页改用官方模板
|
|
6
|
+
|
|
7
|
+
按 `docs/ui-inventory.md` 的第 1、2 项打。
|
|
8
|
+
|
|
9
|
+
### 行列表:改用官方 `TicketLine` 结构
|
|
10
|
+
官方 `rows.tsx` 的行是 `<li class="dt-row dt-link dt-ticket">`,两列网格:
|
|
11
|
+
**左列状态(`dt-ticket-stage`)** + **右列正文(`dt-ticket-body`)**,标题本身是 `dt-open` 按钮。
|
|
12
|
+
我们之前是普通 `dt-row` + 一个单独的「编辑」按钮。现在:
|
|
13
|
+
|
|
14
|
+
- 列表容器 `dt-rows` → **`dt-list`**(只有 `.dt-list > .dt-ticket` 才有左侧状态列网格);
|
|
15
|
+
- 标题改成 `dt-open` 按钮(带 `aria-expanded`),点标题展开行内编辑 —— 官方就是点标题进详情;
|
|
16
|
+
- 行内 `dt-ticket-note` 承载会话/间隔/轮询/唤醒这串说明,错误行用 `dt-ticket-note-error`;
|
|
17
|
+
- 操作收进 `dt-ticket-actions`。
|
|
18
|
+
|
|
19
|
+
### 设置页:改用官方「左栏 + 内容」
|
|
20
|
+
`dt-settings` 网格(140px + 内容)之前搬来了 CSS 却没用。现在是四个分区(来源 / 凭证 / 版本与更新 / 会话 goal)
|
|
21
|
+
配 `dt-settings-nav` 左栏,当前项 `aria-current="page"`,深链路里不用一路滚到底。
|
|
22
|
+
|
|
23
|
+
### UI 体检扩到 9 项
|
|
24
|
+
新增「官方结构采用数」(`dt-ticket` / `dt-list` / `dt-open` / `dt-settings` / `dt-settings-nav` /
|
|
25
|
+
`dt-timeline` / `dt-event` / `dt-disclosure`),当前 **8/8**。合计 **9/9 = 100 分**。
|
|
26
|
+
|
|
27
|
+
### 测试
|
|
28
|
+
- 新增:设置页必须有 `dt-settings` 网格、4 个左栏项、且只有 1 个 `aria-current=page`;
|
|
29
|
+
- 「编辑按钮」用例改成断言 `dt-open` 标题(交互位置变了,行为没丢)。合计 **101 例**。
|
|
30
|
+
|
|
5
31
|
## [0.8.42] - 2026-11-02 —— 全界面盘点 + 弹层键盘行为对齐官方
|
|
6
32
|
|
|
7
33
|
用户要求:「所有 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` 101/101 通过
|
|
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 # 101 项单测
|
|
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.43'
|
|
18
18
|
let BASE = '/session-superagent'
|
|
19
19
|
/**
|
|
20
20
|
* 挑「最新的那个服务端实例」。
|
|
@@ -747,6 +747,8 @@ window.__ModuleLoader__.load({
|
|
|
747
747
|
// 版本检查结果(只读):面板里直接告诉客户「有没有新版本、该跑什么命令」
|
|
748
748
|
const [update, setUpdate] = useState(null)
|
|
749
749
|
const [checking, setChecking] = useState(false)
|
|
750
|
+
// 设置页用官方的「左栏 + 内容」结构(dt-settings),所以要记当前分区
|
|
751
|
+
const [settingsSection, setSettingsSection] = useState('source')
|
|
750
752
|
|
|
751
753
|
const load = useCallback(async () => {
|
|
752
754
|
try {
|
|
@@ -871,61 +873,57 @@ window.__ModuleLoader__.load({
|
|
|
871
873
|
return h(Tag, { tone, title: state === 'dormant' ? '不在活跃时段:只攒条目,不唤醒' : undefined }, STATE_TEXT[state])
|
|
872
874
|
}
|
|
873
875
|
|
|
876
|
+
// 行结构对齐官方 rows.tsx 的 TicketLine:dt-ticket(左侧状态列)+ dt-open 标题 + dt-ticket-actions。
|
|
877
|
+
// 标题本身是按钮 —— 官方就是点标题进详情,我们点标题展开行内编辑,交互更轻但不脱离这套结构。
|
|
878
|
+
const STAGE_STATE = { active: undefined, paused: 'warning', error: 'error', dormant: 'warning' }
|
|
874
879
|
const row = (watcher) => {
|
|
875
880
|
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)] }),
|
|
881
|
+
const state = orbitStateOf(watcher)
|
|
882
|
+
const rowBody = h('div', { className: 'dt-ticket-body' },
|
|
879
883
|
h('div', { className: 'dt-row-title' },
|
|
880
|
-
h('
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
(
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
884
|
+
h('button', {
|
|
885
|
+
type: 'button', className: 'dt-open', title: '展开或收起这条主理鱼的设置',
|
|
886
|
+
'aria-expanded': editing === key, onClick: () => {
|
|
887
|
+
setEditing(editing === key ? null : key)
|
|
888
|
+
setDraft({
|
|
889
|
+
intervalSec: String(watcher.intervalSec ?? 60),
|
|
890
|
+
labels: (watcher.filters && watcher.filters.labels ? watcher.filters.labels : []).join(','),
|
|
891
|
+
activeHours: watcher.activeHours || '',
|
|
892
|
+
goal: watcher.note || '',
|
|
893
|
+
onlyAssigned: !!(watcher.filters && watcher.filters.onlyAssigned),
|
|
894
|
+
})
|
|
895
|
+
},
|
|
896
|
+
}, watcher.repo)),
|
|
897
|
+
h('div', { className: 'dt-row-meta dt-ticket-meta' },
|
|
893
898
|
stateTag(watcher),
|
|
894
899
|
watcher.observe ? h(Tag, { tone: 'warning' }, '仅观察') : null,
|
|
895
900
|
watcher.activeHours ? h(Tag, null, '时段 ' + watcher.activeHours) : null,
|
|
896
901
|
watcher.isolated ? h(Tag, null, isolationText(watcher)) : null,
|
|
897
902
|
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
|
-
})))
|
|
903
|
+
backoffText(watcher) ? h(Tag, { tone: 'warning' }, backoffText(watcher)) : null),
|
|
904
|
+
h('div', { className: 'dt-ticket-note' },
|
|
905
|
+
[
|
|
906
|
+
(watcher.title || '未命名会话') + ' · ' + sessionTag(watcher.sessionId),
|
|
907
|
+
'每 ' + watcher.intervalSec + 's',
|
|
908
|
+
'轮询 ' + ageText(watcher.lastPoll),
|
|
909
|
+
'唤醒 ' + wakeText(watcher.lastWake),
|
|
910
|
+
historyText(watcher),
|
|
911
|
+
watcher.note ? '目标: ' + String(watcher.note).slice(0, 40) : '',
|
|
912
|
+
].filter(Boolean).join(' · ')),
|
|
913
|
+
watcher.lastDeferred ? h('div', { className: 'dt-ticket-note' }, watcher.lastDeferred) : null,
|
|
914
|
+
watcher.lastError ? h('div', { className: 'dt-ticket-note dt-ticket-note-error' }, String(watcher.lastError).slice(0, 160)) : null,
|
|
915
|
+
h('div', { className: 'dt-ticket-actions' },
|
|
916
|
+
h(Btn, { size: 'sm', variant: 'outline', icon: h(Icon, { name: 'refresh' }), onClick: () => act(watcher, 'poll') }, '立刻'),
|
|
917
|
+
h(Btn, {
|
|
918
|
+
size: 'sm', variant: 'ghost',
|
|
919
|
+
icon: h(Icon, { name: watcher.enabled ? 'pause' : 'play' }),
|
|
920
|
+
label: watcher.enabled ? '暂停' : '恢复',
|
|
921
|
+
onClick: () => act(watcher, watcher.enabled ? 'pause' : 'resume'),
|
|
922
|
+
}, watcher.enabled ? '暂停' : '恢复'),
|
|
923
|
+
h(ConfirmBtn, {
|
|
924
|
+
size: 'sm', variant: 'ghost', icon: h(Icon, { name: 'trash' }), label: '删除',
|
|
925
|
+
confirmLabel: '确认删除', onConfirm: () => act(watcher, 'delete'),
|
|
926
|
+
})))
|
|
929
927
|
const editor = editing === key
|
|
930
928
|
? h('div', { className: 'dt-fieldset' },
|
|
931
929
|
field('间隔(秒)', h(Input, { value: draft.intervalSec, onChange: (e) => setDraft({ ...draft, intervalSec: e.target.value }) })),
|
|
@@ -942,7 +940,17 @@ window.__ModuleLoader__.load({
|
|
|
942
940
|
h(Btn, { size: 'sm', variant: 'primary', onClick: () => saveEdit(watcher) }, '保存'),
|
|
943
941
|
h(Btn, { size: 'sm', onClick: () => setEditing(null) }, '放弃')))
|
|
944
942
|
: null
|
|
945
|
-
|
|
943
|
+
// 官方 TicketLine 是 <li class="dt-row dt-link dt-ticket"> 里套「状态列 + 正文列」,
|
|
944
|
+
// 展开的表单跟在正文列里,不破坏两列网格。
|
|
945
|
+
const bodyChildren = [].concat(rowBody.props.children || []).filter(Boolean)
|
|
946
|
+
return h('li', {
|
|
947
|
+
key,
|
|
948
|
+
className: 'dt-row dt-link dt-ticket',
|
|
949
|
+
'data-state': state === 'error' ? 'error' : undefined,
|
|
950
|
+
},
|
|
951
|
+
h('div', { className: 'dt-ticket-stage' },
|
|
952
|
+
h('span', { className: 'dt-stage', 'data-state': STAGE_STATE[state] }, STATE_TEXT[state])),
|
|
953
|
+
h('div', { className: 'dt-ticket-body' }, ...bodyChildren, editor))
|
|
946
954
|
}
|
|
947
955
|
|
|
948
956
|
const problems = []
|
|
@@ -982,7 +990,7 @@ window.__ModuleLoader__.load({
|
|
|
982
990
|
? h(Hint, null, '还没有主理鱼。切到「触发」页填一个 owner/name 添加。')
|
|
983
991
|
: visible.length === 0
|
|
984
992
|
? h(Hint, null, '没有匹配「' + search + '」的主理鱼。')
|
|
985
|
-
: h('
|
|
993
|
+
: h('ul', { className: 'dt-list' }, visible.map(row))),
|
|
986
994
|
]
|
|
987
995
|
|
|
988
996
|
// 判定日志(对应官方 eval 页):每轮的唤醒结果、跳过原因、被过滤记录,一次看全
|
|
@@ -1018,7 +1026,7 @@ window.__ModuleLoader__.load({
|
|
|
1018
1026
|
h(Btn, { variant: 'primary', icon: h(Icon, { name: 'plus' }), onClick: addWatcher, disabled: !sessionId || !form.repo.trim() },
|
|
1019
1027
|
sessionId ? '添加到当前会话' : '需要会话上下文'))))
|
|
1020
1028
|
|
|
1021
|
-
const
|
|
1029
|
+
const settingsSections = [
|
|
1022
1030
|
h(Section, { key: 'source', title: '来源' },
|
|
1023
1031
|
h(KeyValues, { rows: [
|
|
1024
1032
|
['仓库', watchers.length === 0 ? '未绑定' : watchers.map((w) => w.repo).join(', ')],
|
|
@@ -1054,6 +1062,26 @@ window.__ModuleLoader__.load({
|
|
|
1054
1062
|
h('div', { className: 'dt-actions' }, h(Btn, { variant: 'primary', onClick: saveGoal, disabled: !sessionId }, '保存 goal'))),
|
|
1055
1063
|
]
|
|
1056
1064
|
|
|
1065
|
+
|
|
1066
|
+
// 官方设置页是「左栏导航 + 右侧内容」的网格(dt-settings / dt-settings-nav / dt-settings-body)。
|
|
1067
|
+
// 我们之前是单列堆叠,四个分区一起铺开,深链路里翻起来很累。
|
|
1068
|
+
const SETTINGS_SECTIONS = [
|
|
1069
|
+
{ key: 'source', title: '来源' },
|
|
1070
|
+
{ key: 'creds', title: '凭证' },
|
|
1071
|
+
{ key: 'update', title: '版本与更新' },
|
|
1072
|
+
{ key: 'goal', title: '会话 goal' },
|
|
1073
|
+
]
|
|
1074
|
+
const settingsBody = settingsSections.find((node) => node && node.props && node.props.key === settingsSection)
|
|
1075
|
+
|| settingsSections.find(Boolean)
|
|
1076
|
+
const settings = h('div', { className: 'dt-settings' },
|
|
1077
|
+
h('nav', { className: 'dt-settings-nav', 'aria-label': '设置分区' },
|
|
1078
|
+
SETTINGS_SECTIONS.map((item) => h('button', {
|
|
1079
|
+
key: item.key, type: 'button', className: 'dt-settings-link',
|
|
1080
|
+
'aria-current': settingsSection === item.key ? 'page' : undefined,
|
|
1081
|
+
onClick: () => setSettingsSection(item.key),
|
|
1082
|
+
}, item.title))),
|
|
1083
|
+
h('div', { className: 'dt-settings-body' }, settingsBody))
|
|
1084
|
+
|
|
1057
1085
|
const checkUpdate = useCallback(async (force) => {
|
|
1058
1086
|
setChecking(true)
|
|
1059
1087
|
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.43'
|
|
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.43",
|
|
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",
|