dsh-session-superagent 0.9.280 → 0.9.282

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 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.282] - 2026-11-06 —— CollapsibleList 与首载/校验修复
6
+
7
+ ### 折叠列表
8
+
9
+ CollapsibleList 有官方 DisclosureRow 时使用 `expandable=true + expandOnRowClick=true`,缺导出完整回退。
10
+ 标题计数、摘要、ul/li、点击/Enter/Space 与焦点保留;高级区 aria-controls 不受影响。
11
+
12
+ ### 首次加载与 Orbit
13
+
14
+ - 主面板仅在 snap.body 存在时渲染业务 tabpanel,首次 loading/失败不再显示零统计和 Onboarding。
15
+ - Orbit 区分读取中、读取失败和真实空列表;首败不写成“还没有主理鱼”,成功读取清除读取失败。
16
+ - 已有成功快照时保留旧数据并显示错误。
17
+
18
+ ### 表单校验
19
+
20
+ 原生保存点击在 checkValidity=false 时调用 reportValidity 并聚焦 :invalid,不发送 POST;有效路径不变。
21
+
22
+ ### 验证
23
+
24
+ - CollapsibleList 定向 133/133、主线+专项 Chromium 51/51。
25
+ - 首载/校验定向 137/137,合并全量 630/630。
26
+ - 主线真实 Chromium 47/47;Orbit/Modal 契约 26/26。
27
+ - UI 体检 11/11=100。
28
+
29
+ 严格审查报告同时入库:必须修 11、值得改 18,后续按批处理。
30
+ 未验真实 DSH Web GUI 与真实 watcher 写操作。按 Git 工作流保留本地候选。
31
+
32
+ ## [0.9.281] - 2026-11-06 —— Pill、Tag 与 StateDot 官方化
33
+
34
+ ### 筛选 Pill
35
+
36
+ 共享 `Pill()` 迁移到官方组件,9 个过滤/清除调用点不变。
37
+ active/className/children/onClick/rest 全透传,交互形态补 `aria-pressed`;无 onClick 时使用官方静态 span,不伪造按钮。
38
+ 缺导出时交互回退 `button.dt-pill`,静态回退 `span.dt-pill`。
39
+
40
+ ### 只读 Tag 与状态点
41
+
42
+ - `Tag()` 委托官方 `tone/className/children`,官方不收 title 时用无样式 span 保留。
43
+ - `StateDot()` 原样传递 done/warning/ongoing/error/idle、size 与 className。
44
+ - 两个组件独立探测、独立回退;ongoing 回退也保留调用方 className。
45
+
46
+ ### 验证
47
+
48
+ - Pill 定向 **124/124**;Tag/StateDot 定向 **125/125**。
49
+ - 合并后定向 **129/129**,全量 **622/622**。
50
+ - 真实 Chromium **47/47**:筛选、Orbit/Modal、深层表单与防写 403 全部通过。
51
+ - UI 体检 **11/11=100**。
52
+
53
+ 未验真实 DSH Web GUI 与真实 watcher 写操作。按 Git 工作流保留本地候选。
54
+
5
55
  ## [0.9.280] - 2026-11-06 —— 深层 UI 验收与高级区可访问性
6
56
 
7
57
  ### 高级区 aria 关联
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: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
6
- [![Version](https://img.shields.io/badge/version-0.9.280-green.svg)](https://github.com/MYCF711/dsh-session-superagent/releases)
6
+ [![Version](https://img.shields.io/badge/version-0.9.282-green.svg)](https://github.com/MYCF711/dsh-session-superagent/releases)
7
7
  [![npm](https://img.shields.io/npm/v/dsh-session-superagent.svg)](https://www.npmjs.com/package/dsh-session-superagent)
8
8
  [![dsh](https://img.shields.io/badge/DeepSeek%20Harness-plugin-orange.svg)](https://github.com/topics/dsh-plugin)
9
9
  [![awesome](https://img.shields.io/badge/awesome-dsh--plugin-%E2%9C%93-success.svg)](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin)
@@ -148,7 +148,7 @@ Gitee 私有仓库要在「设置 → 凭证」填私人令牌;公开仓库不
148
148
  ## 开发
149
149
 
150
150
  ```sh
151
- npm test # 613 项单测(带离线开关;裸 node --test 会真去 spawn gh,两分半)
151
+ npm test # 630 项单测(带离线开关;裸 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 # 613 项单测(带离线开关,约 1.6 秒)
211
+ npm test # 630 项单测(带离线开关,约 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
@@ -356,6 +356,10 @@ window.__ModuleLoader__.load({
356
356
  let hostInput = null
357
357
  let hostSwitch = null
358
358
  let hostSegmentedTabs = null
359
+ let hostTag = null
360
+ let hostStateDot = null
361
+ let hostPill = null
362
+ let hostCollapsibleRow = null
359
363
  let hostTooltip = null
360
364
  let hostOrbit = null
361
365
  let hostOrbitRow = null
@@ -369,6 +373,13 @@ window.__ModuleLoader__.load({
369
373
  hostSwitch = primitives.Switch || null
370
374
  // SegmentedTabs 同样独立探测:缺导出时完整保留下方 SegTabs,不影响其它原语。
371
375
  hostSegmentedTabs = primitives.SegmentedTabs || null
376
+ // Tag 与 StateDot 各自独立探测:任何一个缺导出都只回退自己,不影响另一个或其它原语。
377
+ hostTag = primitives.Tag || null
378
+ hostStateDot = primitives.StateDot || null
379
+ // Pill 同样独立探测:缺导出时完整保留下方本地胶囊,不影响其它原语。
380
+ hostPill = primitives.Pill || null
381
+ // 仅供 CollapsibleList:WatcherForm 高级区需要 bodyId/aria-controls,必须继续走本地 DisclosureRow。
382
+ hostCollapsibleRow = primitives.DisclosureRow || null
372
383
  if (primitives && primitives.Modal && primitives.Toast && primitives.IconWarningOutlineMedium) {
373
384
  hostUi = createHostUi({ React, primitives })
374
385
  // Tooltip 独立探测:缺少它只回退 InfoTip,不把已接入的 Modal/Toast 一起降级。
@@ -380,6 +391,10 @@ window.__ModuleLoader__.load({
380
391
  hostInput = null
381
392
  hostSwitch = null
382
393
  hostSegmentedTabs = null
394
+ hostTag = null
395
+ hostStateDot = null
396
+ hostPill = null
397
+ hostCollapsibleRow = null
383
398
  hostTooltip = null
384
399
  }
385
400
 
@@ -403,7 +418,7 @@ window.__ModuleLoader__.load({
403
418
  }
404
419
 
405
420
  // 客户端版本探针:每次模块加载写一次,用来确认浏览器里跑的是哪一版
406
- const CLIENT_VERSION = '0.9.280'
421
+ const CLIENT_VERSION = '0.9.282'
407
422
  // SEMVER_COMPARATOR_SOURCE_START
408
423
  // This block is duplicated verbatim in client.js because the browser UMD cannot import ESM.
409
424
  // test/update-semver.test.mjs audits both copies and exercises their behavior.
@@ -730,8 +745,13 @@ window.__ModuleLoader__.load({
730
745
  // 保留安装动作现有调用面;其它受支持 variant 也统一由 Btn 内的宿主分支委托,老宿主完整回退。
731
746
  const UpdateButton = hostButton || Btn
732
747
 
733
- function Tag({ tone = 'outline', title, children }) {
734
- return h('span', { className: 'dt-tag', 'data-tone': tone, title }, children)
748
+ function Tag({ tone = 'outline', title, className, children }) {
749
+ if (hostTag) {
750
+ const tag = h(hostTag, { tone, className }, children)
751
+ // 官方 Tag 是静态只读组件,不收 title;只在确有提示时加无样式 wrapper,不丢原有悬停语义。
752
+ return title === undefined ? tag : h('span', { title }, tag)
753
+ }
754
+ return h('span', { className: cx('dt-tag', className), 'data-tone': tone, title }, children)
735
755
  }
736
756
 
737
757
  /** 页级 tab 条:点当前页会再发一次 onChange(回调里可重置到根部)。 */
@@ -792,9 +812,10 @@ window.__ModuleLoader__.load({
792
812
  }, h('span', { className: 'dt-switch-thumb' }))
793
813
  }
794
814
 
795
- function StateDot({ state, className }) {
815
+ function StateDot({ state, size, className }) {
816
+ if (hostStateDot) return h(hostStateDot, { state, size, className })
796
817
  if (state === 'ongoing') {
797
- return h('svg', { className: 'dt-spinner', 'data-state': 'ongoing', width: 14, height: 14, viewBox: '0 0 24 24', 'aria-hidden': 'true' },
818
+ return h('svg', { className: cx('dt-spinner', className), 'data-state': 'ongoing', width: size ?? 14, height: size ?? 14, viewBox: '0 0 24 24', 'aria-hidden': 'true' },
798
819
  h('g', null,
799
820
  h('circle', { cx: 12, cy: 12, r: 9.5 }),
800
821
  h('animateTransform', { attributeName: 'transform', type: 'rotate', from: '0 12 12', to: '360 12 12', dur: '1.6s', repeatCount: 'indefinite' })))
@@ -866,23 +887,35 @@ window.__ModuleLoader__.load({
866
887
  h(Hint, null, '想先看看效果?在「触发」页勾上「仅观察」:它只记录本会唤醒哪几条,不会真打扰你。'))
867
888
  }
868
889
 
869
- /** 官方 DisclosureRow 的实际用法:默认收起,点开看明细。 */
890
+ /** 官方 DisclosureRow 承载过滤清单;缺导出时完整保留本地键盘与焦点行为。 */
870
891
  function CollapsibleList({ title, items }) {
871
892
  const [open, setOpen] = useState(false)
872
- return h(DisclosureRow, {
893
+ const rowProps = {
873
894
  title: title + '(' + items.length + ')',
874
- open, onToggle: () => setOpen(!open),
895
+ open, onToggle: () => setOpen((current) => !current),
875
896
  icon: h(Icon, { name: 'question', size: 14 }),
876
897
  collapsedContent: h('span', { className: 'dt-hint' }, items[0] ? String(items[0]).slice(0, 40) : ''),
877
- },
898
+ }
899
+ return h(hostCollapsibleRow || DisclosureRow,
900
+ hostCollapsibleRow ? { ...rowProps, expandable: true, expandOnRowClick: true } : rowProps,
878
901
  h('ul', { className: 'dt-plain-list' },
879
902
  items.map((text, index) => h('li', { key: index }, text))))
880
903
  }
881
904
 
882
- /** 官方 Pill:可切换的小胶囊(用于「全部 / 只看失败」这类就地过滤)。 */
883
- function Pill({ active, onClick, children }) {
905
+ /** DSH Pill:有 onClick 时是可切换按钮,否则是静态只读胶囊。 */
906
+ function Pill({ active = false, className, onClick, children, ...rest }) {
907
+ if (hostPill) {
908
+ // 官方没有 aria-pressed;只在交互形态最小补齐,不把只读 badge 变成按钮。
909
+ return h(hostPill, {
910
+ ...rest, active, className, onClick,
911
+ 'aria-pressed': onClick ? !!active : undefined,
912
+ }, children)
913
+ }
914
+ if (!onClick) {
915
+ return h('span', { className: cx('dt-pill', active && 'dt-pill-active', className) }, children)
916
+ }
884
917
  return h('button', {
885
- type: 'button', className: cx('dt-pill', active && 'dt-pill-active'),
918
+ type: 'button', ...rest, className: cx('dt-pill', active && 'dt-pill-active', className),
886
919
  'aria-pressed': !!active, onClick,
887
920
  }, children)
888
921
  }
@@ -1114,7 +1147,12 @@ window.__ModuleLoader__.load({
1114
1147
  if (event && typeof event.preventDefault === 'function') event.preventDefault()
1115
1148
  // 原生点击保存时仍执行 constraints;测试桩没有 form,直接走同一提交函数。
1116
1149
  const form = event && event.currentTarget && event.currentTarget.form
1117
- if (form && typeof form.checkValidity === 'function' && !form.checkValidity()) return false
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
+ }
1118
1156
  if (busyRef.current || disabled || (mode === 'edit' && !dirty)) return false
1119
1157
  if (mode === 'create' && (!sessionId || !String(values.repo || '').trim())) return false
1120
1158
  busyRef.current = true
@@ -1550,9 +1588,13 @@ window.__ModuleLoader__.load({
1550
1588
  const load = async () => {
1551
1589
  try {
1552
1590
  const body = await call('/state')
1553
- if (alive) setWatchers(Array.isArray(body && body.watchers) ? body.watchers : [])
1554
- } catch {
1555
- if (alive) setWatchers((prev) => (prev === null ? [] : prev))
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))
1556
1598
  }
1557
1599
  }
1558
1600
  load()
@@ -1592,15 +1634,18 @@ window.__ModuleLoader__.load({
1592
1634
  }, [open])
1593
1635
 
1594
1636
  const list = watchers || []
1637
+ const readError = typeof orbitError === 'string' && orbitError.startsWith('读取失败:') ? orbitError : null
1595
1638
  // Never hide the entry: with nothing being watched it stays as a grey
1596
1639
  // ring, so the affordance is always findable in the dock row.
1597
1640
  const running = list.filter((w) => orbitStateOf(w) === 'active').length
1598
1641
  const broken = list.filter((w) => orbitStateOf(w) === 'error').length
1599
- const summary = list.length === 0
1600
- ? '还没有主理鱼'
1601
- : '会话级 superagent:' + running + ' 运行中'
1602
- + (broken ? ',' + broken + ' 异常' : '')
1603
- + '(共 ' + list.length + ' 条)'
1642
+ const summary = readError && watchers === null
1643
+ ? '读不到主理鱼状态'
1644
+ : list.length === 0
1645
+ ? '还没有主理鱼'
1646
+ : '会话级 superagent:' + running + ' 运行中'
1647
+ + (broken ? ',' + broken + ' 异常' : '')
1648
+ + '(共 ' + list.length + ' 条)'
1604
1649
 
1605
1650
  const toggle = () => {
1606
1651
  if (!hostOrbit) {
@@ -1616,9 +1661,11 @@ window.__ModuleLoader__.load({
1616
1661
  const button = h('button', {
1617
1662
  ref: btnRef,
1618
1663
  type: 'button',
1619
- title: list.length
1620
- ? list.map((w) => (w.repo + ' · ' + (w.title || '未命名会话') + ' · ' + sessionTag(w.sessionId) + ' · ' + STATE_TEXT[orbitStateOf(w)])).join('\n')
1621
- : '还没有主理鱼 —— 在「主理鱼」页加一条',
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
+ : '还没有主理鱼 —— 在「主理鱼」页加一条',
1622
1669
  'aria-label': summary,
1623
1670
  'aria-expanded': open ? 'true' : 'false',
1624
1671
  className: cx('dt-btn', 'dt-btn-ghost', 'sa-orbit-trigger', watchers === null && 'is-loading'),
@@ -1764,13 +1811,20 @@ window.__ModuleLoader__.load({
1764
1811
  h('div', { className: 'sa-dock-head' },
1765
1812
  h('span', { className: 'sa-dock-title' }, '主理鱼'),
1766
1813
  // 和面板统计条同一套官方素材:dt-stat(数值强 + 单位弱),不再自己发明 sa-dock-metric-*
1767
- h(Stat, { className: 'sa-dock-metric', value: running + ' / ' + list.length, unit: '主理中' })),
1814
+ h(Stat, {
1815
+ className: 'sa-dock-metric',
1816
+ value: watchers === null ? '—' : running + ' / ' + list.length,
1817
+ unit: watchers === null ? (readError ? '读取失败' : '读取中') : '主理中',
1818
+ })),
1768
1819
  bar,
1769
- list.length === 0
1770
- ? h('div', { className: 'sa-dock-empty' }, '还没有。在「主理鱼」标签页填 owner/name 加一条。')
1771
- : h(hostOrbitRow ? 'ul' : 'div', { className: 'sa-dock-rows' }, rows),
1772
- // 写操作的失败必须出现在弹层里(M4):以前两层空 catch,点了没反应也没提示
1773
- orbitError ? h('div', { className: 'sa-dock-err', role: 'alert' }, '操作失败:' + orbitError) : null,
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,
1774
1828
  list.length > 0
1775
1829
  ? h('div', { className: 'sa-dock-foot' }, '详细状态与凭证在「主理鱼」标签页')
1776
1830
  : null)
@@ -3249,16 +3303,16 @@ window.__ModuleLoader__.load({
3249
3303
  h('div', { className: 'dt-actions' }, h(Btn, { size: 'sm', variant: 'primary', onClick: () => load() }, '重试')))
3250
3304
  : null,
3251
3305
  snap.loading && !snap.body ? h(Hint, null, '正在读取…') : null,
3252
- tab === 'overview' ? h('div', {
3306
+ snap.body && tab === 'overview' ? h('div', {
3253
3307
  id: 'sa-main-panel-overview', role: 'tabpanel', 'aria-labelledby': 'sa-main-tab-overview', className: 'dt-tabpanel',
3254
3308
  }, overview, repoSummary) : null,
3255
- tab === 'judge' ? h('div', {
3309
+ snap.body && tab === 'judge' ? h('div', {
3256
3310
  id: 'sa-main-panel-judge', role: 'tabpanel', 'aria-labelledby': 'sa-main-tab-judge', className: 'dt-tabpanel',
3257
3311
  }, judge, timeline) : null,
3258
- tab === 'trigger' ? h('div', {
3312
+ snap.body && tab === 'trigger' ? h('div', {
3259
3313
  id: 'sa-main-panel-trigger', role: 'tabpanel', 'aria-labelledby': 'sa-main-tab-trigger', className: 'dt-tabpanel',
3260
3314
  }, trigger) : null,
3261
- tab === 'settings' ? h('div', {
3315
+ snap.body && tab === 'settings' ? h('div', {
3262
3316
  id: 'sa-main-panel-settings', role: 'tabpanel', 'aria-labelledby': 'sa-main-tab-settings', className: 'dt-tabpanel',
3263
3317
  }, settings) : null,
3264
3318
  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.280'
52
+ export const SERVER_VERSION = '0.9.282'
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.280",
3
+ "version": "0.9.282",
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",