dsh-session-superagent 0.9.279 → 0.9.281

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.281] - 2026-11-06 —— Pill、Tag 与 StateDot 官方化
6
+
7
+ ### 筛选 Pill
8
+
9
+ 共享 `Pill()` 迁移到官方组件,9 个过滤/清除调用点不变。
10
+ active/className/children/onClick/rest 全透传,交互形态补 `aria-pressed`;无 onClick 时使用官方静态 span,不伪造按钮。
11
+ 缺导出时交互回退 `button.dt-pill`,静态回退 `span.dt-pill`。
12
+
13
+ ### 只读 Tag 与状态点
14
+
15
+ - `Tag()` 委托官方 `tone/className/children`,官方不收 title 时用无样式 span 保留。
16
+ - `StateDot()` 原样传递 done/warning/ongoing/error/idle、size 与 className。
17
+ - 两个组件独立探测、独立回退;ongoing 回退也保留调用方 className。
18
+
19
+ ### 验证
20
+
21
+ - Pill 定向 **124/124**;Tag/StateDot 定向 **125/125**。
22
+ - 合并后定向 **129/129**,全量 **622/622**。
23
+ - 真实 Chromium **47/47**:筛选、Orbit/Modal、深层表单与防写 403 全部通过。
24
+ - UI 体检 **11/11=100**。
25
+
26
+ 未验真实 DSH Web GUI 与真实 watcher 写操作。按 Git 工作流保留本地候选。
27
+
28
+ ## [0.9.280] - 2026-11-06 —— 深层 UI 验收与高级区可访问性
29
+
30
+ ### 高级区 aria 关联
31
+
32
+ WatcherForm 高级区 trigger 现在有 `aria-controls=idPrefix-advanced-body`,展开 body 使用同 id。
33
+ 新增与编辑同页 id 不冲突,Enter/Space、摘要与草稿行为不变。
34
+ 新增用例修复前 25/26,修复后定向 128/128。
35
+
36
+ ### Tooltip 键盘回焦
37
+
38
+ 修复纯键盘 focus 打开 Tooltip 后,scroll remount 回焦让新实例立即重开的问题。
39
+ 仅在同步 `focus({preventScroll:true})` 窗口传官方 `disabled=true`,finally 立即恢复 false。
40
+ 独立模块真实键盘路径 **27/27**;client 内联镜像已同步同一逻辑,主线深层验收 **47/47**。
41
+
42
+ ### 深层真实验收
43
+
44
+ 完整 Chromium 新增 12 项:高级区展开/收起、aria 关联、5 面优先级 Switch、鼠标/Space、Tab 顺序、草稿恢复、InfoTip hover/Escape 与真实 scroll 关闭。
45
+ 最终 **47 PASS / 0 FAIL**,mutation=0,防写探针 403。截图通道问题单列 SKIP。
46
+
47
+ ### 计数
48
+
49
+ - 全量 **613/613**
50
+ - UI 体检 **11/11=100**
51
+ - 同源审计 84 项,0 漂移
52
+
53
+ 未验真实 DSH Web GUI 与真实 watcher 写操作。按 Git 工作流保留本地候选。
54
+
5
55
  ## [0.9.279] - 2026-11-06 —— 官方 Input 与 Switch 全覆盖
6
56
 
7
57
  ### 单行输入
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.279-green.svg)](https://github.com/MYCF711/dsh-session-superagent/releases)
6
+ [![Version](https://img.shields.io/badge/version-0.9.281-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 # 612 项单测(带离线开关;裸 node --test 会真去 spawn gh,两分半)
151
+ npm test # 622 项单测(带离线开关;裸 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 # 612 项单测(带离线开关,约 1.6 秒)
211
+ npm test # 622 项单测(带离线开关,约 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
  }
@@ -349,6 +356,9 @@ window.__ModuleLoader__.load({
349
356
  let hostInput = null
350
357
  let hostSwitch = null
351
358
  let hostSegmentedTabs = null
359
+ let hostTag = null
360
+ let hostStateDot = null
361
+ let hostPill = null
352
362
  let hostTooltip = null
353
363
  let hostOrbit = null
354
364
  let hostOrbitRow = null
@@ -362,6 +372,11 @@ window.__ModuleLoader__.load({
362
372
  hostSwitch = primitives.Switch || null
363
373
  // SegmentedTabs 同样独立探测:缺导出时完整保留下方 SegTabs,不影响其它原语。
364
374
  hostSegmentedTabs = primitives.SegmentedTabs || null
375
+ // Tag 与 StateDot 各自独立探测:任何一个缺导出都只回退自己,不影响另一个或其它原语。
376
+ hostTag = primitives.Tag || null
377
+ hostStateDot = primitives.StateDot || null
378
+ // Pill 同样独立探测:缺导出时完整保留下方本地胶囊,不影响其它原语。
379
+ hostPill = primitives.Pill || null
365
380
  if (primitives && primitives.Modal && primitives.Toast && primitives.IconWarningOutlineMedium) {
366
381
  hostUi = createHostUi({ React, primitives })
367
382
  // Tooltip 独立探测:缺少它只回退 InfoTip,不把已接入的 Modal/Toast 一起降级。
@@ -373,6 +388,9 @@ window.__ModuleLoader__.load({
373
388
  hostInput = null
374
389
  hostSwitch = null
375
390
  hostSegmentedTabs = null
391
+ hostTag = null
392
+ hostStateDot = null
393
+ hostPill = null
376
394
  hostTooltip = null
377
395
  }
378
396
 
@@ -396,7 +414,7 @@ window.__ModuleLoader__.load({
396
414
  }
397
415
 
398
416
  // 客户端版本探针:每次模块加载写一次,用来确认浏览器里跑的是哪一版
399
- const CLIENT_VERSION = '0.9.279'
417
+ const CLIENT_VERSION = '0.9.281'
400
418
  // SEMVER_COMPARATOR_SOURCE_START
401
419
  // This block is duplicated verbatim in client.js because the browser UMD cannot import ESM.
402
420
  // test/update-semver.test.mjs audits both copies and exercises their behavior.
@@ -723,8 +741,13 @@ window.__ModuleLoader__.load({
723
741
  // 保留安装动作现有调用面;其它受支持 variant 也统一由 Btn 内的宿主分支委托,老宿主完整回退。
724
742
  const UpdateButton = hostButton || Btn
725
743
 
726
- function Tag({ tone = 'outline', title, children }) {
727
- return h('span', { className: 'dt-tag', 'data-tone': tone, title }, children)
744
+ function Tag({ tone = 'outline', title, className, children }) {
745
+ if (hostTag) {
746
+ const tag = h(hostTag, { tone, className }, children)
747
+ // 官方 Tag 是静态只读组件,不收 title;只在确有提示时加无样式 wrapper,不丢原有悬停语义。
748
+ return title === undefined ? tag : h('span', { title }, tag)
749
+ }
750
+ return h('span', { className: cx('dt-tag', className), 'data-tone': tone, title }, children)
728
751
  }
729
752
 
730
753
  /** 页级 tab 条:点当前页会再发一次 onChange(回调里可重置到根部)。 */
@@ -785,9 +808,10 @@ window.__ModuleLoader__.load({
785
808
  }, h('span', { className: 'dt-switch-thumb' }))
786
809
  }
787
810
 
788
- function StateDot({ state, className }) {
811
+ function StateDot({ state, size, className }) {
812
+ if (hostStateDot) return h(hostStateDot, { state, size, className })
789
813
  if (state === 'ongoing') {
790
- return h('svg', { className: 'dt-spinner', 'data-state': 'ongoing', width: 14, height: 14, viewBox: '0 0 24 24', 'aria-hidden': 'true' },
814
+ 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' },
791
815
  h('g', null,
792
816
  h('circle', { cx: 12, cy: 12, r: 9.5 }),
793
817
  h('animateTransform', { attributeName: 'transform', type: 'rotate', from: '0 12 12', to: '360 12 12', dur: '1.6s', repeatCount: 'indefinite' })))
@@ -872,10 +896,20 @@ window.__ModuleLoader__.load({
872
896
  items.map((text, index) => h('li', { key: index }, text))))
873
897
  }
874
898
 
875
- /** 官方 Pill:可切换的小胶囊(用于「全部 / 只看失败」这类就地过滤)。 */
876
- function Pill({ active, onClick, children }) {
899
+ /** DSH Pill:有 onClick 时是可切换按钮,否则是静态只读胶囊。 */
900
+ function Pill({ active = false, className, onClick, children, ...rest }) {
901
+ if (hostPill) {
902
+ // 官方没有 aria-pressed;只在交互形态最小补齐,不把只读 badge 变成按钮。
903
+ return h(hostPill, {
904
+ ...rest, active, className, onClick,
905
+ 'aria-pressed': onClick ? !!active : undefined,
906
+ }, children)
907
+ }
908
+ if (!onClick) {
909
+ return h('span', { className: cx('dt-pill', active && 'dt-pill-active', className) }, children)
910
+ }
877
911
  return h('button', {
878
- type: 'button', className: cx('dt-pill', active && 'dt-pill-active'),
912
+ type: 'button', ...rest, className: cx('dt-pill', active && 'dt-pill-active', className),
879
913
  'aria-pressed': !!active, onClick,
880
914
  }, children)
881
915
  }
@@ -892,10 +926,12 @@ window.__ModuleLoader__.load({
892
926
  }
893
927
 
894
928
  /** 官方 DisclosureRow:折叠行的标准写法(Enter / 空格可切换,带 aria-expanded)。 */
895
- function DisclosureRow({ icon, title, open, onToggle, collapsedContent, children }) {
929
+ function DisclosureRow({ icon, title, open, onToggle, collapsedContent, bodyId, children }) {
930
+ const content = Array.isArray(children) && children.length === 1 ? children[0] : children
896
931
  return h('div', { className: 'dt-disclosure', 'data-open': open ? 'true' : undefined },
897
932
  h('div', {
898
933
  className: 'dt-disclosure-row', role: 'button', tabIndex: 0, 'aria-expanded': !!open,
934
+ 'aria-controls': bodyId,
899
935
  onClick: onToggle,
900
936
  onKeyDown: (event) => {
901
937
  if (event.key === 'Enter' || event.key === ' ') { event.preventDefault(); onToggle() }
@@ -906,7 +942,13 @@ window.__ModuleLoader__.load({
906
942
  h('span', { className: 'dt-disclosure-chevron' }, h(Icon, { name: open ? 'chevron-up' : 'chevron-down' }))),
907
943
  h('span', { className: 'dt-disclosure-title' }, title),
908
944
  !open ? collapsedContent : null),
909
- open ? children : null)
945
+ open
946
+ ? bodyId
947
+ ? content && typeof content === 'object' && !Array.isArray(content)
948
+ ? { ...content, props: { ...(content.props || {}), id: bodyId } }
949
+ : h('div', { id: bodyId }, content)
950
+ : children
951
+ : null)
910
952
  }
911
953
 
912
954
  /** 无 DSH Tooltip 时完整保留原实现:原 trigger、点击/失焦与本地气泡都不改写。 */
@@ -1168,7 +1210,7 @@ window.__ModuleLoader__.load({
1168
1210
  h(DisclosureRow, {
1169
1211
  icon: h(Icon, { name: 'settings' }), title: '高级设置', open: advancedOpen,
1170
1212
  onToggle: () => { if (!busy && !disabled) setAdvancedOpen(!advancedOpen) },
1171
- collapsedContent: collapsedAdvanced,
1213
+ collapsedContent: collapsedAdvanced, bodyId: idPrefix + '-advanced-body',
1172
1214
  }, h('div', { className: 'dt-disclosure-body' }, advanced))),
1173
1215
  h(SaveBar, { dirty, busy, error, disabled, onDiscard: discard, onSave: submitFromClick, saveLabel: submitLabel }),
1174
1216
  // 新建空白表单也要给入口;开始输入后由 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.279'
52
+ export const SERVER_VERSION = '0.9.281'
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.279",
3
+ "version": "0.9.281",
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
  }