dsh-session-superagent 0.9.278 → 0.9.280

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.280] - 2026-11-06 —— 深层 UI 验收与高级区可访问性
6
+
7
+ ### 高级区 aria 关联
8
+
9
+ WatcherForm 高级区 trigger 现在有 `aria-controls=idPrefix-advanced-body`,展开 body 使用同 id。
10
+ 新增与编辑同页 id 不冲突,Enter/Space、摘要与草稿行为不变。
11
+ 新增用例修复前 25/26,修复后定向 128/128。
12
+
13
+ ### Tooltip 键盘回焦
14
+
15
+ 修复纯键盘 focus 打开 Tooltip 后,scroll remount 回焦让新实例立即重开的问题。
16
+ 仅在同步 `focus({preventScroll:true})` 窗口传官方 `disabled=true`,finally 立即恢复 false。
17
+ 独立模块真实键盘路径 **27/27**;client 内联镜像已同步同一逻辑,主线深层验收 **47/47**。
18
+
19
+ ### 深层真实验收
20
+
21
+ 完整 Chromium 新增 12 项:高级区展开/收起、aria 关联、5 面优先级 Switch、鼠标/Space、Tab 顺序、草稿恢复、InfoTip hover/Escape 与真实 scroll 关闭。
22
+ 最终 **47 PASS / 0 FAIL**,mutation=0,防写探针 403。截图通道问题单列 SKIP。
23
+
24
+ ### 计数
25
+
26
+ - 全量 **613/613**
27
+ - UI 体检 **11/11=100**
28
+ - 同源审计 84 项,0 漂移
29
+
30
+ 未验真实 DSH Web GUI 与真实 watcher 写操作。按 Git 工作流保留本地候选。
31
+
32
+ ## [0.9.279] - 2026-11-06 —— 官方 Input 与 Switch 全覆盖
33
+
34
+ ### 单行输入
35
+
36
+ 共享 `Input()` 在有官方导出时直接委托 DSH `Input`,搜索、repo/goal/ghDir、密码 token、数字和行内编辑全部统一。
37
+ 官方 wrapper 保留 `dt-input` 布局 className,icon 只由官方渲染;value/onChange、aria、disabled、required、min/max/step、ref 全透传。
38
+ 缺导出或 primitives 时完整回退旧 `span.dt-input > input`。textarea/select/time 不在本版强行迁移。
39
+
40
+ ### 开关
41
+
42
+ 共享 `Toggle()` 在有官方导出时委托 DSH `Switch`,保留 checked/onChange/label/disabled/title。
43
+ 官方不收 id,使用无样式的 `span[id]` 保留关联;不回填 `dt-switch` 主题类。
44
+ 缺导出时完整回退旧 button+thumb。新增与行内编辑业务逻辑不变。
45
+
46
+ ### 验证
47
+
48
+ - Input 定向 **116/116**;Switch 定向 **25/25**;合并全量 **612/612**。
49
+ - 真实 Chromium:搜索、行内编辑、三个凭证输入、goal、Orbit/Modal 全部 PASS。
50
+ - 新增表单 3 面普通开关真实点击,`aria-checked=false→true`,草稿标脏且无 mutation。
51
+ - UI 体检 **11/11=100**。
52
+
53
+ 未验真实 DSH Web GUI 与真实 watcher 写操作。按 Git 工作流保留本地候选。
54
+
5
55
  ## [0.9.278] - 2026-11-06 —— SegmentedTabs 与 Orbit DisclosureRow 原生化
6
56
 
7
57
  ### 主页面 tabs
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.278-green.svg)](https://github.com/MYCF711/dsh-session-superagent/releases)
6
+ [![Version](https://img.shields.io/badge/version-0.9.280-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 # 606 项单测(带离线开关;裸 node --test 会真去 spawn gh,两分半)
151
+ npm test # 613 项单测(带离线开关;裸 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 # 606 项单测(带离线开关,约 1.6 秒)
211
+ npm test # 613 项单测(带离线开关,约 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
@@ -76,6 +76,7 @@ window.__ModuleLoader__.load({
76
76
  const TooltipPrimitive = primitive('Tooltip')
77
77
  if (!TooltipTrigger) throw new Error('DSH Tooltip 需要宿主 React.forwardRef')
78
78
  const [remountKey, setRemountKey] = HostReact.useState(0)
79
+ const [scrollFocusSuppressed, setScrollFocusSuppressed] = HostReact.useState(false)
79
80
  const triggerNodeRef = HostReact.useRef(null)
80
81
  const restoreFocusRef = HostReact.useRef(false)
81
82
  HostReact.useEffect(() => {
@@ -89,6 +90,7 @@ window.__ModuleLoader__.load({
89
90
  || (typeof triggerNode.contains === 'function' && triggerNode.contains(activeElement))
90
91
  ))
91
92
  setRemountKey((current) => current + 1)
93
+ setScrollFocusSuppressed(restoreFocusRef.current)
92
94
  }
93
95
  // Tooltip 没有受控 open API;capture 覆盖主面板及任意嵌套滚动容器。
94
96
  window.addEventListener('scroll', closeOnScroll, true)
@@ -98,10 +100,14 @@ window.__ModuleLoader__.load({
98
100
  if (!restoreFocusRef.current) return undefined
99
101
  restoreFocusRef.current = false
100
102
  const triggerNode = triggerNodeRef.current
101
- if (triggerNode && typeof triggerNode.focus === 'function'
102
- && (!('isConnected' in triggerNode) || triggerNode.isConnected)) {
103
- // 防止焦点归还再次滚动容器,形成 scroll -> remount 循环。
104
- triggerNode.focus({ preventScroll: true })
103
+ try {
104
+ if (triggerNode && typeof triggerNode.focus === 'function'
105
+ && (!('isConnected' in triggerNode) || triggerNode.isConnected)) {
106
+ // disabled 只覆盖这次同步回焦,避免 focus 让新 Tooltip 立即重开。
107
+ triggerNode.focus({ preventScroll: true })
108
+ }
109
+ } finally {
110
+ setScrollFocusSuppressed(false)
105
111
  }
106
112
  return undefined
107
113
  }, [remountKey])
@@ -111,6 +117,7 @@ window.__ModuleLoader__.load({
111
117
  side: 'top',
112
118
  portal: true,
113
119
  openOnClick: true,
120
+ disabled: scrollFocusSuppressed,
114
121
  gap: 8,
115
122
  }, hostH(TooltipTrigger, { text, icon, warn, triggerRef: triggerNodeRef }))
116
123
  }
@@ -346,6 +353,8 @@ window.__ModuleLoader__.load({
346
353
  // 老宿主没有这个映射时 require 会抛错;可选探测失败必须完整保留本地实现。
347
354
  let hostUi = null
348
355
  let hostButton = null
356
+ let hostInput = null
357
+ let hostSwitch = null
349
358
  let hostSegmentedTabs = null
350
359
  let hostTooltip = null
351
360
  let hostOrbit = null
@@ -354,6 +363,10 @@ window.__ModuleLoader__.load({
354
363
  const primitives = require('@deepseek-ai/dsh-client-ui-primitives')
355
364
  // Button 独立探测:老宿主缺 Modal/Toast 时仍可复用官方按钮;缺 Button 时所有 variant 完整回退旧 Btn。
356
365
  hostButton = primitives.Button || null
366
+ // Input 同样独立探测:缺导出只回退共享输入框,不影响 Button/Tabs 等其它原语。
367
+ hostInput = primitives.Input || null
368
+ // Switch 同样独立探测:缺导出只回退共享 Toggle,不影响其它原语。
369
+ hostSwitch = primitives.Switch || null
357
370
  // SegmentedTabs 同样独立探测:缺导出时完整保留下方 SegTabs,不影响其它原语。
358
371
  hostSegmentedTabs = primitives.SegmentedTabs || null
359
372
  if (primitives && primitives.Modal && primitives.Toast && primitives.IconWarningOutlineMedium) {
@@ -364,6 +377,8 @@ window.__ModuleLoader__.load({
364
377
  } catch {
365
378
  hostUi = null
366
379
  hostButton = null
380
+ hostInput = null
381
+ hostSwitch = null
367
382
  hostSegmentedTabs = null
368
383
  hostTooltip = null
369
384
  }
@@ -388,7 +403,7 @@ window.__ModuleLoader__.load({
388
403
  }
389
404
 
390
405
  // 客户端版本探针:每次模块加载写一次,用来确认浏览器里跑的是哪一版
391
- const CLIENT_VERSION = '0.9.278'
406
+ const CLIENT_VERSION = '0.9.280'
392
407
  // SEMVER_COMPARATOR_SOURCE_START
393
408
  // This block is duplicated verbatim in client.js because the browser UMD cannot import ESM.
394
409
  // test/update-semver.test.mjs audits both copies and exercises their behavior.
@@ -753,15 +768,26 @@ window.__ModuleLoader__.load({
753
768
  }, item.label)))
754
769
  }
755
770
 
756
- function Input({ icon, ...rest }) {
771
+ function Input({ icon, className, ...rest }) {
772
+ if (hostInput) {
773
+ // 官方 className 作用于唯一 wrapper;保留 dt-input 让现有 Field/Search 布局选择器继续命中。
774
+ // icon 只交给官方渲染,ref 随 rest 交给官方 forwardRef,不能再包本地 span 或复刻 icon。
775
+ return h(hostInput, { ...rest, icon, className: cx('dt-input', className) })
776
+ }
777
+ // 老宿主完整保留 superagent 同源结构;ref 与全部原生 input 属性仍落在真正的 input 上。
757
778
  return h('span', { className: 'dt-input' },
758
779
  icon !== undefined ? h('span', { className: 'dt-input-icon' }, icon) : null,
759
- h('input', rest))
780
+ h('input', { ...rest, className }))
760
781
  }
761
782
 
762
- function Toggle({ checked, onChange, label, id, disabled }) {
783
+ function Toggle({ checked, onChange, label, id, disabled, title }) {
784
+ if (hostSwitch) {
785
+ const control = h(hostSwitch, { checked: !!checked, onChange, label, disabled, title })
786
+ // 官方 Switch 不接收 id;仅用无样式 span 保留调用方 id,官方仍拥有 switch 语义与交互。
787
+ return id === undefined ? control : h('span', { id }, control)
788
+ }
763
789
  return h('button', {
764
- id, type: 'button', role: 'switch', 'aria-checked': !!checked, 'aria-label': label,
790
+ id, type: 'button', role: 'switch', 'aria-checked': !!checked, 'aria-label': label, title,
765
791
  className: 'dt-switch', disabled, onClick: () => onChange(!checked),
766
792
  }, h('span', { className: 'dt-switch-thumb' }))
767
793
  }
@@ -873,10 +899,12 @@ window.__ModuleLoader__.load({
873
899
  }
874
900
 
875
901
  /** 官方 DisclosureRow:折叠行的标准写法(Enter / 空格可切换,带 aria-expanded)。 */
876
- function DisclosureRow({ icon, title, open, onToggle, collapsedContent, children }) {
902
+ function DisclosureRow({ icon, title, open, onToggle, collapsedContent, bodyId, children }) {
903
+ const content = Array.isArray(children) && children.length === 1 ? children[0] : children
877
904
  return h('div', { className: 'dt-disclosure', 'data-open': open ? 'true' : undefined },
878
905
  h('div', {
879
906
  className: 'dt-disclosure-row', role: 'button', tabIndex: 0, 'aria-expanded': !!open,
907
+ 'aria-controls': bodyId,
880
908
  onClick: onToggle,
881
909
  onKeyDown: (event) => {
882
910
  if (event.key === 'Enter' || event.key === ' ') { event.preventDefault(); onToggle() }
@@ -887,7 +915,13 @@ window.__ModuleLoader__.load({
887
915
  h('span', { className: 'dt-disclosure-chevron' }, h(Icon, { name: open ? 'chevron-up' : 'chevron-down' }))),
888
916
  h('span', { className: 'dt-disclosure-title' }, title),
889
917
  !open ? collapsedContent : null),
890
- open ? children : null)
918
+ open
919
+ ? bodyId
920
+ ? content && typeof content === 'object' && !Array.isArray(content)
921
+ ? { ...content, props: { ...(content.props || {}), id: bodyId } }
922
+ : h('div', { id: bodyId }, content)
923
+ : children
924
+ : null)
891
925
  }
892
926
 
893
927
  /** 无 DSH Tooltip 时完整保留原实现:原 trigger、点击/失焦与本地气泡都不改写。 */
@@ -1149,7 +1183,7 @@ window.__ModuleLoader__.load({
1149
1183
  h(DisclosureRow, {
1150
1184
  icon: h(Icon, { name: 'settings' }), title: '高级设置', open: advancedOpen,
1151
1185
  onToggle: () => { if (!busy && !disabled) setAdvancedOpen(!advancedOpen) },
1152
- collapsedContent: collapsedAdvanced,
1186
+ collapsedContent: collapsedAdvanced, bodyId: idPrefix + '-advanced-body',
1153
1187
  }, h('div', { className: 'dt-disclosure-body' }, advanced))),
1154
1188
  h(SaveBar, { dirty, busy, error, disabled, onDiscard: discard, onSave: submitFromClick, saveLabel: submitLabel }),
1155
1189
  // 新建空白表单也要给入口;开始输入后由 SaveBar 接管,不在屏幕上重复两个提交按钮。
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.278'
52
+ export const SERVER_VERSION = '0.9.280'
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.278",
3
+ "version": "0.9.280",
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",
@@ -75,6 +75,7 @@ export function createHostUi({ React, primitives } = {}) {
75
75
  throw new TypeError('Tooltip 需要宿主 React.cloneElement 以合并 trigger ref')
76
76
  }
77
77
  const [remountKey, setRemountKey] = React.useState(0)
78
+ const [scrollFocusSuppressed, setScrollFocusSuppressed] = React.useState(false)
78
79
  const triggerNodeRef = React.useRef(null)
79
80
  const restoreFocusRef = React.useRef(false)
80
81
  React.useEffect(() => {
@@ -89,6 +90,7 @@ export function createHostUi({ React, primitives } = {}) {
89
90
  || (typeof triggerNode.contains === 'function' && triggerNode.contains(activeElement))
90
91
  ))
91
92
  setRemountKey((current) => current + 1)
93
+ setScrollFocusSuppressed(restoreFocusRef.current)
92
94
  }
93
95
  // DSH Tooltip 没有受控 open 或 scroll listener;capture 可同时覆盖嵌套滚动容器。
94
96
  target.addEventListener('scroll', closeOnScroll, true)
@@ -116,10 +118,16 @@ export function createHostUi({ React, primitives } = {}) {
116
118
  // 标记只消费一次;即使新 ref 缺失,也不能在后续无关渲染中抢焦点。
117
119
  restoreFocusRef.current = false
118
120
  const triggerNode = triggerNodeRef.current
119
- if (triggerNode && typeof triggerNode.focus === 'function'
120
- && (!('isConnected' in triggerNode) || triggerNode.isConnected)) {
121
- // 避免焦点归还自身再次滚动容器,形成 scroll -> remount 循环。
122
- triggerNode.focus({ preventScroll: true })
121
+ try {
122
+ if (triggerNode && typeof triggerNode.focus === 'function'
123
+ && (!('isConnected' in triggerNode) || triggerNode.isConnected)) {
124
+ // 官方 disabled 会清 open/pinned,并让 focus 打开路径早退;只覆盖这次同步回焦,避免立即重开。
125
+ // preventScroll 同时避免焦点归还自身再次滚动容器,形成 scroll -> remount 循环。
126
+ triggerNode.focus({ preventScroll: true })
127
+ }
128
+ } finally {
129
+ // focus 返回立即恢复官方 hover/focus/click;不改变 key,也不再 detach/attach trigger。
130
+ setScrollFocusSuppressed(false)
123
131
  }
124
132
  return undefined
125
133
  }, [remountKey])
@@ -130,6 +138,7 @@ export function createHostUi({ React, primitives } = {}) {
130
138
  side: 'top',
131
139
  portal: true,
132
140
  openOnClick: true,
141
+ disabled: scrollFocusSuppressed,
133
142
  gap: 8,
134
143
  }, React.cloneElement(trigger, { ref: setTriggerRef }))
135
144
  }