deepseek-computer-use 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +302 -2
- package/cordis.patch.yml +28 -0
- package/lib/bridge.js +224 -0
- package/lib/build-helper.mjs +106 -0
- package/lib/build-native.mjs +52 -0
- package/lib/build.mjs +22 -0
- package/lib/config.js +95 -0
- package/lib/index.js +156 -0
- package/lib/safety.js +247 -0
- package/lib/tools.js +534 -0
- package/native/Driver.cs +1803 -0
- package/native/Json.cs +274 -0
- package/native/Overlay.cs +669 -0
- package/native/Program.cs +158 -0
- package/native/audio/Audio.csproj +17 -0
- package/native/audio/Program.cs +95 -0
- package/native/wgcfw/Capture.csproj +23 -0
- package/native/wgcfw/Program.cs +249 -0
- package/package.json +66 -4
- package/skills/computer-use/SKILL.md +90 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: computer-use-windows
|
|
3
|
+
description: Drive Windows desktop apps through DSH Computer Use tools (UIA observation, window capture, click/type/key/scroll/drag). Load when a task must operate a GUI application, not a shell.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Computer Use (Windows)
|
|
7
|
+
|
|
8
|
+
The `deepseek-computer-use` plugin exposes the Codex window2 API on Windows.
|
|
9
|
+
Prefer shell, files and web tools whenever they can do the job: GUI automation is
|
|
10
|
+
the slowest, most fragile option and it moves the user's real mouse and keyboard.
|
|
11
|
+
|
|
12
|
+
## The loop
|
|
13
|
+
|
|
14
|
+
```text
|
|
15
|
+
list_apps / list_windows find the target, note its id
|
|
16
|
+
|
|
|
17
|
+
get_window_state screenshot by default; ask include_text for indexes
|
|
18
|
+
|
|
|
19
|
+
one action click / type_text / press_key / scroll / drag / set_value
|
|
20
|
+
|
|
|
21
|
+
get_window_state observe again and VERIFY before continuing
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
# Observation
|
|
25
|
+
|
|
26
|
+
- `get_window_state({window})` captures a **screenshot by default** and returns
|
|
27
|
+
`accessibility: null`. That is the right default for Electron, Canvas and games.
|
|
28
|
+
- Ask `include_text: true` when you need numbered elements. Element indexes belong
|
|
29
|
+
to that one observation; any action that changes the layout invalidates them.
|
|
30
|
+
- `screenshots` is an **array**: the window plus related transient UI (open menus,
|
|
31
|
+
tooltips) each with `id`, `zIndex`, `originX`/`originY`, size.
|
|
32
|
+
- Pass that `screenshotId` to `click`/`scroll`/`drag` when you are aiming at
|
|
33
|
+
coordinates inside a specific screenshot (a menu popup, for example).
|
|
34
|
+
- The runtime waits ~1s after an action before the next capture, so you rarely need
|
|
35
|
+
your own sleeps.
|
|
36
|
+
- Screenshot pixels are the coordinate space you click in. For DPI-virtualized apps
|
|
37
|
+
(many older WinForms/Win32 programs) the returned image is already cropped to the
|
|
38
|
+
painted area and the plugin converts screenshot pixels to physical screen pixels
|
|
39
|
+
internally — never scale the coordinates yourself.
|
|
40
|
+
|
|
41
|
+
# Choosing an action
|
|
42
|
+
|
|
43
|
+
| Goal | Tool | Why |
|
|
44
|
+
|---|---|---|
|
|
45
|
+
| Press a named button | `click` with `element_index` | Uses the semantic Invoke when available; survives occlusion |
|
|
46
|
+
| Aim at a pixel | `click` with `x`/`y` (+ `screenshotId`) | Coordinates are in that screenshot's space |
|
|
47
|
+
| Fill a field | `set_value` | One call, no focus dance, no keystroke race |
|
|
48
|
+
| Type into the focus | `type_text` | Layout-independent Unicode; CJK safe |
|
|
49
|
+
| Shortcut | `press_key` `Control_L+s` | X keysym names, KP_0 / Numpad_0 aliases supported |
|
|
50
|
+
| Scroll a pane | `scroll` with `x`, `y` | x/y are required; click the pane first if it needs focus |
|
|
51
|
+
|
|
52
|
+
# While the agent is acting
|
|
53
|
+
|
|
54
|
+
While the agent works, a breathing accent border and a virtual cursor show what it is doing, with a "DSH 正在使用您的电脑 / Esc 取消" chip.
|
|
55
|
+
The user can press Esc at any moment:
|
|
56
|
+
|
|
57
|
+
- the first call after Esc fails with `cancelled_by_user`
|
|
58
|
+
- every further Computer Use call **in the same turn** fails fast with `turn_stopped`
|
|
59
|
+
|
|
60
|
+
Both mean the same thing: stop working, send a final message noting the user
|
|
61
|
+
stopped Computer Use, and do not retry — the block lifts only in a new turn.
|
|
62
|
+
|
|
63
|
+
# Safety: what is refused outright
|
|
64
|
+
|
|
65
|
+
These are hard denials. User approval cannot override them.
|
|
66
|
+
|
|
67
|
+
- Terminals and shells (Windows Terminal, cmd, PowerShell, WSL, mintty), the Run
|
|
68
|
+
dialog, and console window classes.
|
|
69
|
+
- Password managers and credential UIs; Windows Security / anti-malware apps;
|
|
70
|
+
UAC and authentication dialogs.
|
|
71
|
+
- The agent's own host app (and other assistant apps).
|
|
72
|
+
- The Windows / Meta / Super key family, alone or in any chord.
|
|
73
|
+
|
|
74
|
+
Additionally: an app must be approved once per session before Computer Use drives
|
|
75
|
+
it, and any action whose target label looks irreversible (delete, uninstall, pay,
|
|
76
|
+
submit, publish, install, 删除, 卸载, 支付, 提交 …) asks for confirmation.
|
|
77
|
+
|
|
78
|
+
# Failure playbook
|
|
79
|
+
|
|
80
|
+
| Symptom | Meaning | Move |
|
|
81
|
+
|---|---|---|
|
|
82
|
+
| `stale_snapshot` | element indexes expired | `get_window_state include_text:true` again |
|
|
83
|
+
| `stale_screenshot` | coordinate screenshot expired | observe again and use the new id |
|
|
84
|
+
| `window_gone` | app closed / handle changed | `list_windows` again |
|
|
85
|
+
| `window_minimized` | nothing to observe | `activate_window`, then observe |
|
|
86
|
+
| `focus_failed` | another window holds the foreground | stop, ask the user; do not retry in a loop |
|
|
87
|
+
| `screen_locked` | the desktop is locked (LockApp) | stop and ask the user to unlock |
|
|
88
|
+
| `hard_denied` | the surface is never automatable | tell the user, do not route around it |
|
|
89
|
+
| `turn_ended` | the turn is over | wait for the user to continue |
|
|
90
|
+
| empty tree | Electron/Canvas surface | observe with the screenshot and act by coordinates |
|