dsh-native-uia 0.6.1 → 0.6.2
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/README.md +4 -3
- package/package.json +1 -1
- package/scripts/verify.mjs +23 -2
- package/worker/indicator-server.ps1 +8 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 御屏 · dsh-native-uia
|
|
2
2
|
|
|
3
|
-
给 DeepSeek Harness(DSH)桌面端加 **Windows 原生 computer-use**:以 UI Automation 控件树为主观测通道,纯文本模型就能看懂并操控桌面;动作后台投递(默认不动鼠标、不抢焦点),一次调用批量执行、逐步校验,成功的批次自动存成可回放配方。当前版本 **0.6.
|
|
3
|
+
给 DeepSeek Harness(DSH)桌面端加 **Windows 原生 computer-use**:以 UI Automation 控件树为主观测通道,纯文本模型就能看懂并操控桌面;动作后台投递(默认不动鼠标、不抢焦点),一次调用批量执行、逐步校验,成功的批次自动存成可回放配方。当前版本 **0.6.2**。
|
|
4
4
|
|
|
5
5
|
- 运行要求:Windows 10/11(UI Automation 客户端走 .NET Framework,由 PowerShell 5.1 承载),DSH 桌面端,Node ≥ 18。
|
|
6
6
|
- 组成:`src/`(DSH 插件主进程:工具定义、策略、状态、面板服务)、`worker/`(两个 PowerShell 进程:`uia-worker.ps1` 观察与投递,`indicator-server.ps1` 屏幕指示层)、`client/`(面板)、`scripts/`(闸门与回归)。
|
|
@@ -84,13 +84,13 @@ npm run uninstall-plugin
|
|
|
84
84
|
## 6. 验证与打包
|
|
85
85
|
|
|
86
86
|
```powershell
|
|
87
|
-
npm run check # 静态闸门
|
|
87
|
+
npm run check # 静态闸门 92 项:解析、策略、契约、外观不变量、工具与 worker 能力对齐
|
|
88
88
|
node scripts/check-lease.mjs # 租约 / 空闲自熄 / Esc 停止(不起桌面)
|
|
89
89
|
node scripts/smoke.mjs # worker 启停与 ping
|
|
90
90
|
powershell -NoProfile -ExecutionPolicy Bypass -File scripts/regression-worker.ps1 # 定位阶梯(mock 树)
|
|
91
91
|
node scripts/regression-tools.mjs # 工具面回归
|
|
92
92
|
node scripts/regression-quality.mjs # 渲染质量
|
|
93
|
-
npm pack # → dsh-native-uia-0.6.
|
|
93
|
+
npm pack # → dsh-native-uia-0.6.2.tgz
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
真机脚本(会动桌面):`verify-live.mjs`、`verify-live-clipboard.mjs`、`verify-live-style.mjs`、`bench-live.mjs`、`verify-locator.mjs`、`verify-capture-scale.mjs`。
|
|
@@ -106,6 +106,7 @@ npm pack # → dsh-native-uia-0.6.1.tgz
|
|
|
106
106
|
|
|
107
107
|
## 8. 变更记录(压缩版,细节见 git)
|
|
108
108
|
|
|
109
|
+
- **0.6.2** 修“停止后再启动,氛围灯还是红的”。`Hide-Overlay` 只把 phase 改成 `hidden`,不重烤边缘光;`Render-Layout` 又按布局键复用整棵树,所以下一次 `show`(phase=acting)只换了胶囊文字,环形贴图仍是上一次 `stopped` 的红。现在记录环形贴图烘焙时的相位(`ringPhase`),`Show-Overlay` 在 `win.Show()` 之前发现相位与贴图不一致就重烤,启动那一帧不会闪旧色。闸门 91 → 92。
|
|
109
110
|
- **0.6.1** 边缘光改成一整圈。原来四条 `E = 4×环厚` 的渐变带各自铺满整条边,四个角互相重叠、alpha 相加,读出来就是"四条叠着、角上更亮"。现在用 `IndRing` 在 C# 里按**到最近屏幕边的距离**烘焙一张距离场贴图(≤1280 px 宽,上采样由 WPF 做),整屏一个 `Image`,四边亮度一致、四角连续;换阶段只重烤这张图,脉冲照旧只写它一个 `Opacity`。删掉 `New-Bar` / `New-GradH` / `New-Fade` / `New-Vignette` 四个只服务旧四条带的函数。闸门 90 → 91。
|
|
110
111
|
- **0.6.0** 动作面收口。`computer_act` 新增 `deselect` / `add_to_selection`(多选列表叠加,select 会清空别的选择)、`scroll_to`(ScrollItem.ScrollIntoView)、`set_range`(RangeValue.SetValue,按 Min/Max 夹取);`$patternTypes` 补 `ScrollItem`,能拿到对象才算真的能滚动到可见。`click / drag / scroll / mouse` 收 `ref`,中心坐标由 `describe` 现算。`computer_run` 的 `lazy:true` 支持同批混指针与键盘步(共用策略检查、遇错即停、不存配方),非 lazy 批次明确拒绝混步。真机:`scroll_to` 在资源管理器 Pane 上 applied=true / 21.7 ms。闸门 88 → 90。
|
|
111
112
|
- **0.5.0** 节点树取数扩面。节点带 `state`(toggle / selected / expanded / range / scroll),缓存优先、桥接 provider 补一次实时读(整次快照上限 30 次);`view` 可选 control / raw / content;`root=<ref>` 只扫子树且不升 revision;`find_text within=<ref>` 把"搜进某个容器"变成真的;`[cut]` 标出深度上限处该下钻的节点;渲染每行带状态。实测资源管理器:state 命中 5/79 → 25/79,raw 比 control 多节点且更快(731 → 523 ms)。闸门 85 → 88。
|
package/package.json
CHANGED
package/scripts/verify.mjs
CHANGED
|
@@ -1176,6 +1176,23 @@ gate('a phase change recolours in place instead of rebuilding the capsule', () =
|
|
|
1176
1176
|
return 'phase changes recolour ring + mask + bloom in place; no rebuild, no replayed intro';
|
|
1177
1177
|
});
|
|
1178
1178
|
|
|
1179
|
+
gate('a show that resumes a stopped run repaints the ring', () => {
|
|
1180
|
+
// Stopped auto-hides with the red palette still baked into the ring element. Render-Layout reuses
|
|
1181
|
+
// the tree on the next show, so without an explicit repaint the capsule announces "running" over
|
|
1182
|
+
// a red edge light -- the "restart after a stop, the ring is red" report.
|
|
1183
|
+
const server = readFileSync(join(ROOT, 'worker', 'indicator-server.ps1'), 'utf8');
|
|
1184
|
+
assert(/ringPhase\s*=/.test(server), 'the baked ring phase is no longer tracked: a resumed show cannot tell the palette is stale');
|
|
1185
|
+
const show = server.slice(server.indexOf('function Show-Overlay'), server.indexOf('function Hide-Overlay'));
|
|
1186
|
+
assert(/if \(\$script:S\.phase -ne 'hidden' -and \$script:S\.ringPhase -ne \[string\]\$script:S\.phase\) \{ Update-PhaseLook \}/.test(show),
|
|
1187
|
+
'Show-Overlay no longer repaints a stale ring: resuming after a stop shows a red ring under a running capsule');
|
|
1188
|
+
assert(show.indexOf('Update-PhaseLook') < show.indexOf('win.Show()'),
|
|
1189
|
+
'the repaint happens after the window is shown: the stale colour flashes for a frame');
|
|
1190
|
+
const look = server.slice(server.indexOf('function Update-PhaseLook'), server.indexOf('function Render-Layout'));
|
|
1191
|
+
assert(/\$script:S\.ringPhase = \[string\]\$script:S\.phase/.test(look),
|
|
1192
|
+
'the in-place recolour no longer records which palette the ring now carries');
|
|
1193
|
+
return 'show repaints a stale ring before the window is shown';
|
|
1194
|
+
});
|
|
1195
|
+
|
|
1179
1196
|
gate('a look change is visible on an idle session, not only during a run', () => {
|
|
1180
1197
|
// Choosing a shape or a palette used to do nothing a person could SEE unless a run was already
|
|
1181
1198
|
// painting the capsule: `refresh()` returns early when no run is active, so the stored value
|
|
@@ -2195,8 +2212,12 @@ gate('notes persist across runs, and the clipboard read stays gated on the run o
|
|
|
2195
2212
|
assert(!/Set-Clipboard -Value ''/.test(ps), "Set-Clipboard -Value '' throws on Windows PowerShell 5.1; use [string[]]@()");
|
|
2196
2213
|
assert((ps.match(/\[string\[\]\]@\(\)/g) ?? []).length >= 2, 'clear and empty write no longer both use the empty-array form');
|
|
2197
2214
|
const pkg = JSON.parse(readFileSync(join(ROOT, 'package.json'), 'utf8'));
|
|
2198
|
-
|
|
2199
|
-
|
|
2215
|
+
// The release number lives in two places a person reads; pin them to each other instead of
|
|
2216
|
+
// hardcoding the current version here, which turns every bump into a gate failure.
|
|
2217
|
+
const readme = readFileSync(join(ROOT, 'README.md'), 'utf8');
|
|
2218
|
+
const claim = readme.match(/当前版本 \*\*([0-9]+\.[0-9]+\.[0-9]+)\*\*/)?.[1];
|
|
2219
|
+
assert(claim === pkg.version, `README advertises version ${claim} while package.json is ${pkg.version}`);
|
|
2220
|
+
return `notes capped/deduped/sanitised and read back by observations; clipboard read gated on ctrl+c; version ${pkg.version} matches README`;
|
|
2200
2221
|
});
|
|
2201
2222
|
|
|
2202
2223
|
gate('the worker body lives in lib, and the entry dot-sources the same list the gates read', () => {
|
|
@@ -594,6 +594,7 @@ $script:S = [ordered]@{
|
|
|
594
594
|
chosenFont = ''
|
|
595
595
|
dipW = 0.0
|
|
596
596
|
ringDip = 0.0
|
|
597
|
+
ringPhase = ''
|
|
597
598
|
pillX = 0
|
|
598
599
|
pillY = 0
|
|
599
600
|
pillW = 0
|
|
@@ -911,6 +912,7 @@ function Build-Ring([double]$W, [double]$H, [double]$T, $ph) {
|
|
|
911
912
|
Log 'ring texture unavailable: edge light skipped'
|
|
912
913
|
} else {
|
|
913
914
|
$script:S.ringImg = $layer
|
|
915
|
+
$script:S.ringPhase = [string]$script:S.phase
|
|
914
916
|
[void]$bloom.Add($layer)
|
|
915
917
|
}
|
|
916
918
|
return @{ bars = $bars; bloom = $bloom }
|
|
@@ -1841,7 +1843,7 @@ function Clear-Canvas {
|
|
|
1841
1843
|
# twenty actions must show layoutBuilds = 1, not 20.
|
|
1842
1844
|
$script:S.layoutBuilds += 1
|
|
1843
1845
|
if ($null -ne $script:S.canvas) { $script:S.canvas.Children.Clear() }
|
|
1844
|
-
$script:S.ring = @(); $script:S.bloom = @(); $script:S.ringImg = $null
|
|
1846
|
+
$script:S.ring = @(); $script:S.bloom = @(); $script:S.ringImg = $null; $script:S.ringPhase = ''
|
|
1845
1847
|
$script:S.pill = $null; $script:S.pillText = $null; $script:S.pillSub = $null
|
|
1846
1848
|
$script:S.pillOrb = $null; $script:S.pillOrbScale = $null; $script:S.pillOrbHalo = $null; $script:S.pillOrbHaloScale = $null; $script:S.pillBars = @()
|
|
1847
1849
|
$script:S.pillScale = $null; $script:S.pillBrandRun = $null; $script:S.pillRestRun = $null
|
|
@@ -1877,6 +1879,7 @@ function Update-PhaseLook {
|
|
|
1877
1879
|
$fresh = New-RingTexture $W $H $T $ph
|
|
1878
1880
|
if ($null -ne $fresh) { $script:S.ringImg.Source = $fresh }
|
|
1879
1881
|
}
|
|
1882
|
+
$script:S.ringPhase = [string]$script:S.phase
|
|
1880
1883
|
# The pill's bloom is the phase accent, so it has to follow too -- otherwise a red stopped phase
|
|
1881
1884
|
# sits in a silver halo.
|
|
1882
1885
|
if ($null -ne $script:S.pill) {
|
|
@@ -2186,6 +2189,10 @@ function Show-Overlay($m) {
|
|
|
2186
2189
|
$ds = (Get-DeviceScale)
|
|
2187
2190
|
if ($ds -gt 0) { $script:S.scale = $ds } else { $script:S.scale = ([double]$m.dpi / 96.0) }
|
|
2188
2191
|
Render-Layout | Out-Null
|
|
2192
|
+
# The tree is reused across a stop, and Hide-Overlay leaves the last baked palette on the ring:
|
|
2193
|
+
# a `show` that resumes with phase=acting would otherwise light a red ring under a running capsule
|
|
2194
|
+
# until the next phase command. Repaint before the window is shown, so no frame flashes the old colour.
|
|
2195
|
+
if ($script:S.phase -ne 'hidden' -and $script:S.ringPhase -ne [string]$script:S.phase) { Update-PhaseLook }
|
|
2189
2196
|
Move-To-Monitor $m
|
|
2190
2197
|
if (-not $script:S.visible) {
|
|
2191
2198
|
$win.Show() # ShowActivated=false, so this never takes the foreground
|