dsh-session-superagent 0.9.281 → 0.9.283
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 +50 -0
- package/README.md +3 -3
- package/client.js +115 -53
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,56 @@
|
|
|
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.9.283] - 2026-11-06 —— 保存 pending 状态机修复
|
|
6
|
+
|
|
7
|
+
### 新草稿不再被旧响应覆盖
|
|
8
|
+
|
|
9
|
+
- 凭证与 goal 使用独立草稿版本号和保存序号。
|
|
10
|
+
- pending 后产生的新输入不会被旧响应清空或覆盖。
|
|
11
|
+
- 重复保存时,只有最新保存且草稿版本未变的响应能清理对应草稿。
|
|
12
|
+
|
|
13
|
+
### 严格回读与 null 同步
|
|
14
|
+
|
|
15
|
+
- 保存必须回读成功后才 Toast 成功;POST200+GET500 显示可重试错误,不回写旧 goal。
|
|
16
|
+
- `sessionGoal:null` 清空干净 goal 草稿,dirty 草稿仍由用户决定。
|
|
17
|
+
- 已有快照时 304 也视为成功回读,保存反馈可依赖它。
|
|
18
|
+
|
|
19
|
+
### 验证
|
|
20
|
+
|
|
21
|
+
- 新增回归修复前 5/7,修复后 7/7。
|
|
22
|
+
- 联合 144/144,全量 637/637。
|
|
23
|
+
- 主线 Chromium 47/47;pending/GET500/null 等专项合计 52/52。
|
|
24
|
+
- UI 体检 11/11=100。
|
|
25
|
+
|
|
26
|
+
未验真实 DSH Web GUI 与真实 watcher 写操作。按 Git 工作流保留本地候选。
|
|
27
|
+
|
|
28
|
+
## [0.9.282] - 2026-11-06 —— CollapsibleList 与首载/校验修复
|
|
29
|
+
|
|
30
|
+
### 折叠列表
|
|
31
|
+
|
|
32
|
+
CollapsibleList 有官方 DisclosureRow 时使用 `expandable=true + expandOnRowClick=true`,缺导出完整回退。
|
|
33
|
+
标题计数、摘要、ul/li、点击/Enter/Space 与焦点保留;高级区 aria-controls 不受影响。
|
|
34
|
+
|
|
35
|
+
### 首次加载与 Orbit
|
|
36
|
+
|
|
37
|
+
- 主面板仅在 snap.body 存在时渲染业务 tabpanel,首次 loading/失败不再显示零统计和 Onboarding。
|
|
38
|
+
- Orbit 区分读取中、读取失败和真实空列表;首败不写成“还没有主理鱼”,成功读取清除读取失败。
|
|
39
|
+
- 已有成功快照时保留旧数据并显示错误。
|
|
40
|
+
|
|
41
|
+
### 表单校验
|
|
42
|
+
|
|
43
|
+
原生保存点击在 checkValidity=false 时调用 reportValidity 并聚焦 :invalid,不发送 POST;有效路径不变。
|
|
44
|
+
|
|
45
|
+
### 验证
|
|
46
|
+
|
|
47
|
+
- CollapsibleList 定向 133/133、主线+专项 Chromium 51/51。
|
|
48
|
+
- 首载/校验定向 137/137,合并全量 630/630。
|
|
49
|
+
- 主线真实 Chromium 47/47;Orbit/Modal 契约 26/26。
|
|
50
|
+
- UI 体检 11/11=100。
|
|
51
|
+
|
|
52
|
+
严格审查报告同时入库:必须修 11、值得改 18,后续按批处理。
|
|
53
|
+
未验真实 DSH Web GUI 与真实 watcher 写操作。按 Git 工作流保留本地候选。
|
|
54
|
+
|
|
5
55
|
## [0.9.281] - 2026-11-06 —— Pill、Tag 与 StateDot 官方化
|
|
6
56
|
|
|
7
57
|
### 筛选 Pill
|
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
|
[](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin)
|
|
@@ -148,7 +148,7 @@ Gitee 私有仓库要在「设置 → 凭证」填私人令牌;公开仓库不
|
|
|
148
148
|
## 开发
|
|
149
149
|
|
|
150
150
|
```sh
|
|
151
|
-
npm test #
|
|
151
|
+
npm test # 637 项单测(带离线开关;裸 node --test 会真去 spawn gh,两分半)
|
|
152
152
|
```
|
|
153
153
|
|
|
154
154
|
### 工具输出:文本给人和 agent,JSON 给程序
|
|
@@ -208,7 +208,7 @@ dsh plugin --profile <profile> add dsh-session-superagent@latest
|
|
|
208
208
|
|
|
209
209
|
|
|
210
210
|
```bash
|
|
211
|
-
npm test #
|
|
211
|
+
npm test # 637 项单测(带离线开关,约 1.6 秒)
|
|
212
212
|
node scripts/ui-audit.mjs # 11 项 UI 指标(写死颜色 / 自造 token / 官方结构采用 …)
|
|
213
213
|
node scripts/preflight.mjs # 41 项门禁(含上面两条,外加 profile 一致性、路由面、包内容)
|
|
214
214
|
node scripts/render-preview.mjs preview.html # 双主题静态预览,直接浏览器打开
|
package/client.js
CHANGED
|
@@ -359,6 +359,7 @@ window.__ModuleLoader__.load({
|
|
|
359
359
|
let hostTag = null
|
|
360
360
|
let hostStateDot = null
|
|
361
361
|
let hostPill = null
|
|
362
|
+
let hostCollapsibleRow = null
|
|
362
363
|
let hostTooltip = null
|
|
363
364
|
let hostOrbit = null
|
|
364
365
|
let hostOrbitRow = null
|
|
@@ -377,6 +378,8 @@ window.__ModuleLoader__.load({
|
|
|
377
378
|
hostStateDot = primitives.StateDot || null
|
|
378
379
|
// Pill 同样独立探测:缺导出时完整保留下方本地胶囊,不影响其它原语。
|
|
379
380
|
hostPill = primitives.Pill || null
|
|
381
|
+
// 仅供 CollapsibleList:WatcherForm 高级区需要 bodyId/aria-controls,必须继续走本地 DisclosureRow。
|
|
382
|
+
hostCollapsibleRow = primitives.DisclosureRow || null
|
|
380
383
|
if (primitives && primitives.Modal && primitives.Toast && primitives.IconWarningOutlineMedium) {
|
|
381
384
|
hostUi = createHostUi({ React, primitives })
|
|
382
385
|
// Tooltip 独立探测:缺少它只回退 InfoTip,不把已接入的 Modal/Toast 一起降级。
|
|
@@ -391,6 +394,7 @@ window.__ModuleLoader__.load({
|
|
|
391
394
|
hostTag = null
|
|
392
395
|
hostStateDot = null
|
|
393
396
|
hostPill = null
|
|
397
|
+
hostCollapsibleRow = null
|
|
394
398
|
hostTooltip = null
|
|
395
399
|
}
|
|
396
400
|
|
|
@@ -414,7 +418,7 @@ window.__ModuleLoader__.load({
|
|
|
414
418
|
}
|
|
415
419
|
|
|
416
420
|
// 客户端版本探针:每次模块加载写一次,用来确认浏览器里跑的是哪一版
|
|
417
|
-
const CLIENT_VERSION = '0.9.
|
|
421
|
+
const CLIENT_VERSION = '0.9.283'
|
|
418
422
|
// SEMVER_COMPARATOR_SOURCE_START
|
|
419
423
|
// This block is duplicated verbatim in client.js because the browser UMD cannot import ESM.
|
|
420
424
|
// test/update-semver.test.mjs audits both copies and exercises their behavior.
|
|
@@ -883,15 +887,17 @@ window.__ModuleLoader__.load({
|
|
|
883
887
|
h(Hint, null, '想先看看效果?在「触发」页勾上「仅观察」:它只记录本会唤醒哪几条,不会真打扰你。'))
|
|
884
888
|
}
|
|
885
889
|
|
|
886
|
-
/** 官方 DisclosureRow
|
|
890
|
+
/** 官方 DisclosureRow 承载过滤清单;缺导出时完整保留本地键盘与焦点行为。 */
|
|
887
891
|
function CollapsibleList({ title, items }) {
|
|
888
892
|
const [open, setOpen] = useState(false)
|
|
889
|
-
|
|
893
|
+
const rowProps = {
|
|
890
894
|
title: title + '(' + items.length + ')',
|
|
891
|
-
open, onToggle: () => setOpen(!
|
|
895
|
+
open, onToggle: () => setOpen((current) => !current),
|
|
892
896
|
icon: h(Icon, { name: 'question', size: 14 }),
|
|
893
897
|
collapsedContent: h('span', { className: 'dt-hint' }, items[0] ? String(items[0]).slice(0, 40) : ''),
|
|
894
|
-
}
|
|
898
|
+
}
|
|
899
|
+
return h(hostCollapsibleRow || DisclosureRow,
|
|
900
|
+
hostCollapsibleRow ? { ...rowProps, expandable: true, expandOnRowClick: true } : rowProps,
|
|
895
901
|
h('ul', { className: 'dt-plain-list' },
|
|
896
902
|
items.map((text, index) => h('li', { key: index }, text))))
|
|
897
903
|
}
|
|
@@ -1141,7 +1147,12 @@ window.__ModuleLoader__.load({
|
|
|
1141
1147
|
if (event && typeof event.preventDefault === 'function') event.preventDefault()
|
|
1142
1148
|
// 原生点击保存时仍执行 constraints;测试桩没有 form,直接走同一提交函数。
|
|
1143
1149
|
const form = event && event.currentTarget && event.currentTarget.form
|
|
1144
|
-
if (form && typeof form.checkValidity === 'function' && !form.checkValidity())
|
|
1150
|
+
if (form && typeof form.checkValidity === 'function' && !form.checkValidity()) {
|
|
1151
|
+
if (typeof form.reportValidity === 'function') form.reportValidity()
|
|
1152
|
+
const invalid = typeof form.querySelector === 'function' ? form.querySelector(':invalid') : null
|
|
1153
|
+
if (invalid && typeof invalid.focus === 'function') invalid.focus()
|
|
1154
|
+
return false
|
|
1155
|
+
}
|
|
1145
1156
|
if (busyRef.current || disabled || (mode === 'edit' && !dirty)) return false
|
|
1146
1157
|
if (mode === 'create' && (!sessionId || !String(values.repo || '').trim())) return false
|
|
1147
1158
|
busyRef.current = true
|
|
@@ -1577,9 +1588,13 @@ window.__ModuleLoader__.load({
|
|
|
1577
1588
|
const load = async () => {
|
|
1578
1589
|
try {
|
|
1579
1590
|
const body = await call('/state')
|
|
1580
|
-
if (alive)
|
|
1581
|
-
|
|
1582
|
-
|
|
1591
|
+
if (alive) {
|
|
1592
|
+
setWatchers(Array.isArray(body && body.watchers) ? body.watchers : [])
|
|
1593
|
+
setOrbitError((current) => typeof current === 'string' && current.startsWith('读取失败:') ? null : current)
|
|
1594
|
+
}
|
|
1595
|
+
} catch (error) {
|
|
1596
|
+
// null=尚未读到,[]=成功读到空列表;首次失败不能伪造成“还没有主理鱼”。
|
|
1597
|
+
if (alive) setOrbitError('读取失败:' + String((error && error.message) || error).slice(0, 160))
|
|
1583
1598
|
}
|
|
1584
1599
|
}
|
|
1585
1600
|
load()
|
|
@@ -1619,15 +1634,18 @@ window.__ModuleLoader__.load({
|
|
|
1619
1634
|
}, [open])
|
|
1620
1635
|
|
|
1621
1636
|
const list = watchers || []
|
|
1637
|
+
const readError = typeof orbitError === 'string' && orbitError.startsWith('读取失败:') ? orbitError : null
|
|
1622
1638
|
// Never hide the entry: with nothing being watched it stays as a grey
|
|
1623
1639
|
// ring, so the affordance is always findable in the dock row.
|
|
1624
1640
|
const running = list.filter((w) => orbitStateOf(w) === 'active').length
|
|
1625
1641
|
const broken = list.filter((w) => orbitStateOf(w) === 'error').length
|
|
1626
|
-
const summary =
|
|
1627
|
-
? '
|
|
1628
|
-
:
|
|
1629
|
-
|
|
1630
|
-
|
|
1642
|
+
const summary = readError && watchers === null
|
|
1643
|
+
? '读不到主理鱼状态'
|
|
1644
|
+
: list.length === 0
|
|
1645
|
+
? '还没有主理鱼'
|
|
1646
|
+
: '会话级 superagent:' + running + ' 运行中'
|
|
1647
|
+
+ (broken ? ',' + broken + ' 异常' : '')
|
|
1648
|
+
+ '(共 ' + list.length + ' 条)'
|
|
1631
1649
|
|
|
1632
1650
|
const toggle = () => {
|
|
1633
1651
|
if (!hostOrbit) {
|
|
@@ -1643,9 +1661,11 @@ window.__ModuleLoader__.load({
|
|
|
1643
1661
|
const button = h('button', {
|
|
1644
1662
|
ref: btnRef,
|
|
1645
1663
|
type: 'button',
|
|
1646
|
-
title:
|
|
1647
|
-
?
|
|
1648
|
-
:
|
|
1664
|
+
title: readError && watchers === null
|
|
1665
|
+
? readError
|
|
1666
|
+
: list.length
|
|
1667
|
+
? list.map((w) => (w.repo + ' · ' + (w.title || '未命名会话') + ' · ' + sessionTag(w.sessionId) + ' · ' + STATE_TEXT[orbitStateOf(w)])).join('\n')
|
|
1668
|
+
: '还没有主理鱼 —— 在「主理鱼」页加一条',
|
|
1649
1669
|
'aria-label': summary,
|
|
1650
1670
|
'aria-expanded': open ? 'true' : 'false',
|
|
1651
1671
|
className: cx('dt-btn', 'dt-btn-ghost', 'sa-orbit-trigger', watchers === null && 'is-loading'),
|
|
@@ -1791,13 +1811,20 @@ window.__ModuleLoader__.load({
|
|
|
1791
1811
|
h('div', { className: 'sa-dock-head' },
|
|
1792
1812
|
h('span', { className: 'sa-dock-title' }, '主理鱼'),
|
|
1793
1813
|
// 和面板统计条同一套官方素材:dt-stat(数值强 + 单位弱),不再自己发明 sa-dock-metric-*
|
|
1794
|
-
h(Stat, {
|
|
1814
|
+
h(Stat, {
|
|
1815
|
+
className: 'sa-dock-metric',
|
|
1816
|
+
value: watchers === null ? '—' : running + ' / ' + list.length,
|
|
1817
|
+
unit: watchers === null ? (readError ? '读取失败' : '读取中') : '主理中',
|
|
1818
|
+
})),
|
|
1795
1819
|
bar,
|
|
1796
|
-
|
|
1797
|
-
? h('div', { className: 'sa-dock-empty' }, '
|
|
1798
|
-
:
|
|
1799
|
-
|
|
1800
|
-
|
|
1820
|
+
watchers === null
|
|
1821
|
+
? (!readError ? h('div', { className: 'sa-dock-empty' }, '正在读取…') : null)
|
|
1822
|
+
: list.length === 0
|
|
1823
|
+
? h('div', { className: 'sa-dock-empty' }, '还没有。在「主理鱼」标签页填 owner/name 加一条。')
|
|
1824
|
+
: h(hostOrbitRow ? 'ul' : 'div', { className: 'sa-dock-rows' }, rows),
|
|
1825
|
+
// 读失败与写操作失败分开说;旧列表仍可保留在错误上方。
|
|
1826
|
+
readError ? h('div', { className: 'sa-dock-err', role: 'alert' }, readError) : null,
|
|
1827
|
+
!readError && orbitError ? h('div', { className: 'sa-dock-err', role: 'alert' }, '操作失败:' + orbitError) : null,
|
|
1801
1828
|
list.length > 0
|
|
1802
1829
|
? h('div', { className: 'sa-dock-foot' }, '详细状态与凭证在「主理鱼」标签页')
|
|
1803
1830
|
: null)
|
|
@@ -1963,6 +1990,11 @@ window.__ModuleLoader__.load({
|
|
|
1963
1990
|
const createTouchedRef = useRef(new Set())
|
|
1964
1991
|
const createSnapshotRef = useRef({ ...CREATE_WATCHER_VALUES })
|
|
1965
1992
|
const editSnapshotRef = useRef(null)
|
|
1993
|
+
// 保存期间仍可输入:旧响应只能清理它提交的那份草稿,不能覆盖 pending 后的新输入。
|
|
1994
|
+
const credentialsDraftVersionRef = useRef(0)
|
|
1995
|
+
const credentialsSaveSeqRef = useRef(0)
|
|
1996
|
+
const goalDraftVersionRef = useRef(0)
|
|
1997
|
+
const goalSaveSeqRef = useRef(0)
|
|
1966
1998
|
const setField = (next) => {
|
|
1967
1999
|
const opening = editSnapshotRef.current && editSnapshotRef.current.values
|
|
1968
2000
|
for (const key of Object.keys(next)) {
|
|
@@ -2026,7 +2058,8 @@ window.__ModuleLoader__.load({
|
|
|
2026
2058
|
if (seq !== loadSeqRef.current) return null // 已经有更新的一次请求在飞:这次结果作废
|
|
2027
2059
|
// 304:内容没变,别白白重渲染 —— 前提是本地已经有一份能渲染的 body
|
|
2028
2060
|
if (payload && payload.notModified) {
|
|
2029
|
-
|
|
2061
|
+
// 有本地快照时,304 也是一次成功回读;保存后的成功反馈可以依赖它。
|
|
2062
|
+
if (hasBodyRef.current) return payload
|
|
2030
2063
|
// 本地没有数据:这次 304 是被状态栏的 etag 带出来的,清掉 etag 重取一次全量
|
|
2031
2064
|
stateEtag = null
|
|
2032
2065
|
return load()
|
|
@@ -2052,8 +2085,9 @@ window.__ModuleLoader__.load({
|
|
|
2052
2085
|
const credentials = body.credentials || { token: 'none', sshKeyPath: 'none' }
|
|
2053
2086
|
|
|
2054
2087
|
useEffect(() => {
|
|
2055
|
-
if (goalTouched
|
|
2056
|
-
|
|
2088
|
+
if (goalTouched) return
|
|
2089
|
+
// null 也是服务端事实:干净草稿要同步清空;dirty 草稿仍由用户自己决定保存或放弃。
|
|
2090
|
+
setGoalDraft(sessionGoal ? sessionGoal.objective || '' : '')
|
|
2057
2091
|
}, [goalTouched, sessionGoal])
|
|
2058
2092
|
|
|
2059
2093
|
const busyRef = useRef(false)
|
|
@@ -2070,8 +2104,14 @@ window.__ModuleLoader__.load({
|
|
|
2070
2104
|
setNotice(null)
|
|
2071
2105
|
try {
|
|
2072
2106
|
await work()
|
|
2107
|
+
if (options.requireReload) {
|
|
2108
|
+
const body = await load()
|
|
2109
|
+
if (!body) throw new Error(options.reloadError || '操作已提交,但回读失败,请重试')
|
|
2110
|
+
if (options.afterReload) options.afterReload(body)
|
|
2111
|
+
}
|
|
2112
|
+
// 必须回读的保存只有在确认成功后才提示;其它动作保留原有通知/刷新契约。
|
|
2073
2113
|
if (done) notify(done)
|
|
2074
|
-
await load()
|
|
2114
|
+
if (!options.requireReload) await load()
|
|
2075
2115
|
return true
|
|
2076
2116
|
} catch (error) {
|
|
2077
2117
|
const text = String((error && error.message) || error)
|
|
@@ -2224,30 +2264,52 @@ window.__ModuleLoader__.load({
|
|
|
2224
2264
|
return warnings
|
|
2225
2265
|
}, null, { rethrow: true })
|
|
2226
2266
|
|
|
2227
|
-
const saveCredentials = () =>
|
|
2228
|
-
const
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2267
|
+
const saveCredentials = () => {
|
|
2268
|
+
const draftVersion = credentialsDraftVersionRef.current
|
|
2269
|
+
let saveSeq = 0
|
|
2270
|
+
return run(async () => {
|
|
2271
|
+
saveSeq = ++credentialsSaveSeqRef.current
|
|
2272
|
+
const payload = {}
|
|
2273
|
+
if (token.trim()) payload.token = token.trim()
|
|
2274
|
+
if (giteeToken.trim()) payload.giteeToken = giteeToken.trim()
|
|
2275
|
+
// 审核 T24 M3:这里以前无条件带 "ghConfigDir" —— ghDir 初值恒为空串且从不回填服务端值,
|
|
2276
|
+
// 于是「只改 token」也会发 ghConfigDir:"",服务端把它当「显式清空」,
|
|
2277
|
+
// 已绑定的 gh 账号目录被静默解绑(评论改回宿主账号)。
|
|
2278
|
+
// 现在只有**填了东西**才发;要解绑请用旁边的「清除」按钮(它显式发空串)。
|
|
2279
|
+
if (ghDir.trim()) payload.ghConfigDir = ghDir.trim()
|
|
2280
|
+
await call('/credentials', { method: 'POST', body: JSON.stringify(payload) })
|
|
2281
|
+
}, '凭证已保存', {
|
|
2282
|
+
requireReload: true,
|
|
2283
|
+
reloadError: '凭证已提交,但回读失败,请重试',
|
|
2284
|
+
afterReload: () => {
|
|
2285
|
+
if (saveSeq !== credentialsSaveSeqRef.current || draftVersion !== credentialsDraftVersionRef.current) return
|
|
2286
|
+
setToken('')
|
|
2287
|
+
setGhDir('')
|
|
2288
|
+
setGiteeToken('')
|
|
2289
|
+
},
|
|
2290
|
+
})
|
|
2291
|
+
}
|
|
2241
2292
|
|
|
2242
2293
|
/** 显式解绑 gh 账号目录(T24 M3:不能在「只改 token」时顺带清掉)。 */
|
|
2243
2294
|
const clearGhDir = () => run(async () => {
|
|
2244
2295
|
await call('/credentials', { method: 'POST', body: JSON.stringify({ ghConfigDir: '' }) })
|
|
2245
2296
|
}, '已解绑 gh 账号目录(评论改回宿主账号)')
|
|
2246
2297
|
|
|
2247
|
-
const saveGoal = () =>
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2298
|
+
const saveGoal = () => {
|
|
2299
|
+
const draftVersion = goalDraftVersionRef.current
|
|
2300
|
+
let saveSeq = 0
|
|
2301
|
+
return run(async () => {
|
|
2302
|
+
saveSeq = ++goalSaveSeqRef.current
|
|
2303
|
+
await call('/goal', { method: 'POST', body: JSON.stringify({ sessionId, objective: goalDraft }) })
|
|
2304
|
+
}, 'goal 已保存', {
|
|
2305
|
+
requireReload: true,
|
|
2306
|
+
reloadError: 'goal 已提交,但回读失败,请重试',
|
|
2307
|
+
afterReload: () => {
|
|
2308
|
+
if (saveSeq !== goalSaveSeqRef.current || draftVersion !== goalDraftVersionRef.current) return
|
|
2309
|
+
setGoalTouched(false)
|
|
2310
|
+
},
|
|
2311
|
+
})
|
|
2312
|
+
}
|
|
2251
2313
|
|
|
2252
2314
|
// 四个数字必须加得上总数(以前「已暂停」按 enabled 数、「异常」按 lastError 数:
|
|
2253
2315
|
// 一条已暂停又有错误的守会被数两次,而「时段外」根本没被数)
|
|
@@ -2925,9 +2987,9 @@ window.__ModuleLoader__.load({
|
|
|
2925
2987
|
h(KeyValues, { rows: [['GitHub token', credentials.token === 'none' ? '未配置(回退到已登录的 gh CLI)' : '已配置'], ['SSH 私钥', credentials.sshKeyPath === 'none' ? '未配置(当前版本不使用)' : '已配置'],
|
|
2926
2988
|
['gh 账号', credentials.ghConfigDir === 'configured' ? '已绑定独立配置目录(评论挂智能体账号)' : '宿主当前登录的账号'],
|
|
2927
2989
|
['Gitee 令牌', credentials.giteeToken === 'configured' ? '已配置' : '未配置(公开仓库也能读,私有仓库需要)']] }),
|
|
2928
|
-
field('Token', h(Input, { type: 'password', value: token, placeholder: 'ghp_… / github_pat_…(留空不改)', onChange: (e) => setToken(e.target.value) })),
|
|
2929
|
-
field('Gitee 令牌', h(Input, { type: 'password', value: giteeToken, placeholder: '私人令牌(留空不改);只盯 GitHub 可以不管' , onChange: (e) => setGiteeToken(e.target.value) })),
|
|
2930
|
-
field('gh 账号目录', h(Input, { value: ghDir, placeholder: '绝对路径(留空 = 用宿主账号)', onChange: (e) => setGhDir(e.target.value) })),
|
|
2990
|
+
field('Token', h(Input, { type: 'password', value: token, placeholder: 'ghp_… / github_pat_…(留空不改)', onChange: (e) => { credentialsDraftVersionRef.current += 1; setToken(e.target.value) } })),
|
|
2991
|
+
field('Gitee 令牌', h(Input, { type: 'password', value: giteeToken, placeholder: '私人令牌(留空不改);只盯 GitHub 可以不管' , onChange: (e) => { credentialsDraftVersionRef.current += 1; setGiteeToken(e.target.value) } })),
|
|
2992
|
+
field('gh 账号目录', h(Input, { value: ghDir, placeholder: '绝对路径(留空 = 用宿主账号)', onChange: (e) => { credentialsDraftVersionRef.current += 1; setGhDir(e.target.value) } })),
|
|
2931
2993
|
// 解绑要**显式**:以前只改 token 时会顺带把已绑定的目录清掉,客户不知道评论为什么换回了宿主账号。
|
|
2932
2994
|
credentials.ghConfigDir === 'configured'
|
|
2933
2995
|
? h('div', { className: 'dt-actions' }, h(Btn, { variant: 'ghost', size: 'sm', onClick: clearGhDir }, '解绑 gh 账号目录'))
|
|
@@ -3008,7 +3070,7 @@ window.__ModuleLoader__.load({
|
|
|
3008
3070
|
h('textarea', {
|
|
3009
3071
|
className: 'dt-textarea', rows: 3, value: goalDraft,
|
|
3010
3072
|
placeholder: '这个会话要达成什么(会写进 /goal)',
|
|
3011
|
-
onChange: (e) => { setGoalTouched(true); setGoalDraft(e.target.value) },
|
|
3073
|
+
onChange: (e) => { goalDraftVersionRef.current += 1; setGoalTouched(true); setGoalDraft(e.target.value) },
|
|
3012
3074
|
}),
|
|
3013
3075
|
h('div', { className: 'dt-actions' }, h(Btn, { variant: 'primary', onClick: saveGoal, disabled: !sessionId }, '保存 goal'))),
|
|
3014
3076
|
]
|
|
@@ -3276,16 +3338,16 @@ window.__ModuleLoader__.load({
|
|
|
3276
3338
|
h('div', { className: 'dt-actions' }, h(Btn, { size: 'sm', variant: 'primary', onClick: () => load() }, '重试')))
|
|
3277
3339
|
: null,
|
|
3278
3340
|
snap.loading && !snap.body ? h(Hint, null, '正在读取…') : null,
|
|
3279
|
-
tab === 'overview' ? h('div', {
|
|
3341
|
+
snap.body && tab === 'overview' ? h('div', {
|
|
3280
3342
|
id: 'sa-main-panel-overview', role: 'tabpanel', 'aria-labelledby': 'sa-main-tab-overview', className: 'dt-tabpanel',
|
|
3281
3343
|
}, overview, repoSummary) : null,
|
|
3282
|
-
tab === 'judge' ? h('div', {
|
|
3344
|
+
snap.body && tab === 'judge' ? h('div', {
|
|
3283
3345
|
id: 'sa-main-panel-judge', role: 'tabpanel', 'aria-labelledby': 'sa-main-tab-judge', className: 'dt-tabpanel',
|
|
3284
3346
|
}, judge, timeline) : null,
|
|
3285
|
-
tab === 'trigger' ? h('div', {
|
|
3347
|
+
snap.body && tab === 'trigger' ? h('div', {
|
|
3286
3348
|
id: 'sa-main-panel-trigger', role: 'tabpanel', 'aria-labelledby': 'sa-main-tab-trigger', className: 'dt-tabpanel',
|
|
3287
3349
|
}, trigger) : null,
|
|
3288
|
-
tab === 'settings' ? h('div', {
|
|
3350
|
+
snap.body && tab === 'settings' ? h('div', {
|
|
3289
3351
|
id: 'sa-main-panel-settings', role: 'tabpanel', 'aria-labelledby': 'sa-main-tab-settings', className: 'dt-tabpanel',
|
|
3290
3352
|
}, settings) : null,
|
|
3291
3353
|
typeof glossary === 'string' ? h(PanelModal, {
|
package/lib/index.js
CHANGED
|
@@ -49,7 +49,7 @@ import {
|
|
|
49
49
|
|
|
50
50
|
export const name = 'dsh-session-superagent'
|
|
51
51
|
/** 服务端版本:随 package.json 同步(meta 测试守着)。客户端据此挑「最新的那个实例」。 */
|
|
52
|
-
export const SERVER_VERSION = '0.9.
|
|
52
|
+
export const SERVER_VERSION = '0.9.283'
|
|
53
53
|
export const inject = ['tools', 'agents', 'webServer']
|
|
54
54
|
/** 一条会话每小时最多被唤醒几次(跨所有守累计)。单守上限挡不住多守叠加。 */
|
|
55
55
|
// 本进程启动时刻:用来区分「刚重启还没轮到」与「定时器真的丢了」
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-session-superagent",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.283",
|
|
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",
|