@momasiku/dsh-pilot 0.5.14 → 0.5.16
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 +19 -1
- package/lib/index.js +25 -29
- package/lib/scripts/_dsh-uia.ps1 +5 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,14 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
# dsh-pilot
|
|
4
4
|
|
|
5
|
+
## 让 DSH 看见并高效地操作你的电脑
|
|
6
|
+
|
|
5
7
|
**Give DeepSeek Harness hands and eyes on your desktop.**
|
|
6
8
|
|
|
9
|
+
[](https://awesome-dsh-plugin.com/p/momasiku/dsh-pilot/)
|
|
7
10
|
[](https://www.npmjs.com/package/@momasiku/dsh-pilot)
|
|
8
11
|
[](https://github.com/momasiku/dsh-pilot/actions/workflows/compat.yml)
|
|
9
12
|
[](LICENSE)
|
|
10
13
|
|
|
11
14
|

|
|
12
|
-

|
|
13
15
|
|
|
14
16
|
[English](#why-this-exists) · [中文说明](#中文说明)
|
|
15
17
|
|
|
@@ -232,6 +234,18 @@ and what `dsh plugin add` checks before it installs anything. Requirements:
|
|
|
232
234
|
|
|
233
235
|
### Recent changes
|
|
234
236
|
|
|
237
|
+
**0.5.14** — the coordinate contract stops guessing how big the image you see is.
|
|
238
|
+
|
|
239
|
+
- **The request pipeline resizes again after capture**, and this plugin never saw
|
|
240
|
+
that step: on a 2560x1600 display the frame reached the model as 1610x1006 while
|
|
241
|
+
the contract said "delivered at capture size … do not rescale", so every reading
|
|
242
|
+
taken off it was 1.59x off. The contract now **predicts** the projected size from
|
|
243
|
+
the image budget the deployment publishes, and prints the size and the multiplier:
|
|
244
|
+
`2560x1600 capture -> 1609x1006 preview, multiply every reading by 1.5911`. A frame
|
|
245
|
+
whose area fits the budget arrives untouched, so framing the window or a region
|
|
246
|
+
gives a true 1:1 frame — 1365x960 does, 1024x768 does, 4K and 5K say 2.2642x and
|
|
247
|
+
3.0189x instead.
|
|
248
|
+
|
|
235
249
|
**0.5.12** — a cold tree, and an empty list that explained nothing.
|
|
236
250
|
|
|
237
251
|
- **Chromium builds its accessibility tree lazily**, and the first caller pays for it:
|
|
@@ -628,6 +642,10 @@ dsh plugin --profile <你的profile> add "file:E:\path\to\dsh-pilot"
|
|
|
628
642
|
|
|
629
643
|
### 最近改动
|
|
630
644
|
|
|
645
|
+
**0.5.14** —— 坐标契约不再猜「你看到的那张图有多大」。
|
|
646
|
+
|
|
647
|
+
- **请求管线会在抓取之后再缩一次**,而插件看不到这一步:2560×1600 的屏幕上,帧送到模型时是 1610×1006,契约却写着「交付即抓取尺寸……不要缩放」,于是每个读数都偏 1.59 倍。现在契约用部署公布的图片预算**预测**投影尺寸,并把尺寸和乘数一起写出来:`2560x1600 抓取 → 1609x1006 预览,把每个读数乘 1.5911`。面积落在预算内的帧会原样送达,所以抓窗口或抓区域能得到真正的 1:1 —— 1365×960 可以,1024×768 可以;4K 和 5K 则分别写 2.2642 倍和 3.0189 倍。
|
|
648
|
+
|
|
631
649
|
**0.5.12** —— 冷树,以及一个什么都没说的空列表。
|
|
632
650
|
|
|
633
651
|
- **Chromium 的无障碍树是懒加载的**,而且由第一个来问的人付账:实测重启后在 1.2 秒时只有 3 个元素,下一次调用 0.3 秒时是 77 个。信任第一个答案的人会认定「这窗口没有树」,白白退回像素。现在 `controls` 在「worker 还没见过完整树、且结果异常少」时会等 300 ms 重试一次。
|
package/lib/index.js
CHANGED
|
@@ -789,36 +789,28 @@ function coordinateContract(value) {
|
|
|
789
789
|
const height = Number(capture?.imageHeight);
|
|
790
790
|
const sizeKnown = Number.isFinite(width) && width > 0 && Number.isFinite(height) && height > 0;
|
|
791
791
|
const frame = sizeKnown ? `${width}x${height}` : 'the captured frame';
|
|
792
|
-
const
|
|
793
|
-
const
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
const
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
].join(' ');
|
|
792
|
+
const scale = deliveredScale(capture);
|
|
793
|
+
const storeShrank = !scaleIsOne(scale);
|
|
794
|
+
// No prediction. The request pipeline resizes a frame to fit the model's image
|
|
795
|
+
// budget, after this plugin has let go of it, and the budget it uses is not the
|
|
796
|
+
// deployment's admission limit the plugin can read: measured 64,000,000 in
|
|
797
|
+
// imageLimits.maxImagePixels against an actual projection of ~1,640,000. A
|
|
798
|
+
// predicted size built from the wrong number reads as a promise, so the contract
|
|
799
|
+
// stops predicting and points at the one size that is not a guess - the preview
|
|
800
|
+
// size the message itself states.
|
|
801
|
+
const lines = [
|
|
802
|
+
`Image pixel (0,0) is the top-left of this frame, which was captured at ${frame} physical screen pixels; both halves of this device are per-monitor DPI aware.`
|
|
803
|
+
];
|
|
804
|
+
if (storeShrank) {
|
|
805
|
+
lines.push(axesAgree(scale)
|
|
806
|
+
? `The attachment store already delivered it at ${printed((scale.x + scale.y) / 2)}x that.`
|
|
807
|
+
: `The attachment store already delivered it at ${printed(scale.x)}x horizontally and ${printed(scale.y)}x vertically.`);
|
|
809
808
|
}
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
const shown = predicted === undefined ? 'delivered' : 'the request pipeline will show it to you';
|
|
816
|
-
return [
|
|
817
|
-
`This frame was captured at ${frame} physical screen pixels and ${shown} at ${final.width}x${final.height} (${printed(final.width / width)}x the capture), so image pixels are NOT screen pixels.`,
|
|
818
|
-
`${budgetLine}To act on a feature at image (x,y), ${multiply} and pass those physical screen pixels to desktop_control, or read the ruler labels, which are already screen coordinates.`,
|
|
819
|
-
'A capture whose area is at or under the budget arrives at capture size: framing the window or a region instead of the whole screen gives a true 1:1 frame.',
|
|
820
|
-
guard
|
|
821
|
-
].join(' ');
|
|
809
|
+
lines.push('The image you are looking at may be smaller again: the request pipeline resizes a frame to fit the model image budget, and this plugin cannot see that step, so do not trust the capture size as the size on screen. This same message states what it settled on as "request preview WxH" - that number is authoritative.');
|
|
810
|
+
lines.push(sizeKnown
|
|
811
|
+
? `If the preview is not ${frame}, multiply every reading by ${width} / preview_width (and ${height} / preview_height) before passing it to desktop_control; if it is, call desktop_control with exactly x and y. Ruler labels, when drawn, are already screen coordinates.`
|
|
812
|
+
: 'If the preview is smaller than the capture, multiply every reading by capture_width / preview_width before passing it to desktop_control.');
|
|
813
|
+
return lines.join(' ');
|
|
822
814
|
}
|
|
823
815
|
|
|
824
816
|
/**
|
|
@@ -1453,6 +1445,10 @@ function apply(ctx, config) {
|
|
|
1453
1445
|
// Copy the declared fields only: the helper's own bookkeeping keys
|
|
1454
1446
|
// must not reach the closed output schema.
|
|
1455
1447
|
const value = { action: args.action };
|
|
1448
|
+
// A one-element list can still arrive unrolled from the helper; the output
|
|
1449
|
+
// schema wants an array, and a string here is a rejected result, not a bug the
|
|
1450
|
+
// caller can see.
|
|
1451
|
+
if (typeof acted.controls === 'string') acted.controls = [acted.controls];
|
|
1456
1452
|
for (const field of ['cursor', 'foregroundTitle', 'foregroundClass', 'foregroundProcess', 'notes', 'windowCount', 'actedAt', 'controls', 'controlCount', 'controlsTruncated', 'controlsWindow']) {
|
|
1457
1453
|
if (acted[field] !== undefined) value[field] = acted[field];
|
|
1458
1454
|
}
|
package/lib/scripts/_dsh-uia.ps1
CHANGED
|
@@ -124,7 +124,11 @@ function Format-DshUiaNodes {
|
|
|
124
124
|
$lines.Add(('{0} [{1}] ''{2}'' @ {3}{4}' -f $n.index, $n.role, $name, $rect, $tail))
|
|
125
125
|
}
|
|
126
126
|
if ($Truncated) { $lines.Add(('... truncated at the node cap ({0} elements in total)' -f $Total)) }
|
|
127
|
-
return
|
|
127
|
+
# The unary comma stops PowerShell unrolling a one-element array on return:
|
|
128
|
+
# without it a window that exposes a single control comes back as a bare
|
|
129
|
+
# string, and the result then fails its own schema ("controls must be an
|
|
130
|
+
# array"). Measured on a LibreOffice window that publishes exactly one.
|
|
131
|
+
return ,($lines.ToArray())
|
|
128
132
|
}
|
|
129
133
|
|
|
130
134
|
<# Resolve an index back to an element by re-reading the same listing. #>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@momasiku/dsh-pilot",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.16",
|
|
4
4
|
"description": "Desktop vision and control for DeepSeek Harness - the whole Windows machine, any application, not browser automation: screen_view captures the live screen as an image the model can see, desktop_control drives the mouse, keyboard, and windows against the exact same pixel space; desktop_sequence runs a whole batch of actions in one call and looks once at the end.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "momasiku",
|