dsh-win-cua
Verifieddsh-win-cua Β· v0.2.1 Β· MIT
Windows computer-use for DSH: real mouse and keyboard input through Win32 SendInput, screen capture through GDI BitBlt, window control. No external driver.
Install
dsh plugin add dsh-win-cua Confirm the layer applied with dsh --profile default --dump-config β see the install guide.
Source
Tags
Creators
Readme
dsh-win-cua
Windows computer-use for DeepSeek Harness: real mouse and keyboard input plus screen capture, with no external driver.
How it works
| Capability | Win32 API |
|---|---|
| Mouse move, click, wheel | user32!SendInput (INPUT_MOUSE) |
| Keyboard taps and shortcuts | user32!SendInput (INPUT_KEYBOARD) |
| Type literal text (incl. CJK) | SendInput with KEYEVENTF_UNICODE |
| Screen capture | gdi32!BitBlt + CAPTUREBLT (layered windows included) |
| Window list / focus | user32!EnumWindows, ShowWindow, SetForegroundWindow |
| DPI | SetProcessDpiAwarenessContext(-4) β per-monitor v2 |
FFI is koffi. Coordinates are physical pixels of
the virtual screen; the primary display's top-left is (0, 0). Absolute pointer moves use
MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_VIRTUALDESK, so displays left/right/above the primary
one are reachable too.
Tools
Look
cua_screenshotβ capture the whole virtual screen to a PNGcua_screenshot_windowβ capture one window by handle (PrintWindow, screen-blit fallback)cua_zoomβ capture a region and upscale it x1βx4 for reading small UI textcua_windowsβ visible top-level windows with bounds and flagscua_app_listβ same list enriched with the process executable namecua_cursorβ pointer position and virtual-screen geometry
Act
cua_mouse_moveβ move the pointer along a human pathcua_mouse_clickβ click / double / right / middle, optionally at x,ycua_dragβ press, travel and release with the button heldcua_scrollβ wheel, vertical or horizontalcua_keyβ one key with optional modifierscua_typeβ type text (unicode, incl. surrogate pairs)
Window & app
cua_focus_windowβ restore and foreground a windowcua_waitβ sleep and/or poll until a window title appearscua_app_launchβ launch an executable without a shell
Every tool declares output { schema, render } β the DSH tool registry rejects raw
definitions without it, so keep that shape when adding tools. Read-only tools are marked
readOnly and register as isConcurrencySafe.
Config
Set in this bundle's cordis.patch.yml under config:
| Key | Default | Meaning |
|---|---|---|
humanize |
true |
Pointer travels a smoothstep path, typing and clicking keep a human cadence |
keepScreenshots |
30 |
Newest captures kept per directory |
moveSteps |
16 |
Max pointer steps for a humanized move |
keyDelayMs |
[12, 34] |
Per-character delay range for humanized typing |
clickSettleMs |
[60, 140] |
Pause between the pointer arriving and the button press |
zoomFactor |
2 |
Default cua_zoom upscale factor (hard cap 4) |
zoomMaxPixels |
24000000 |
Largest upscaled image allowed |
maxWaitMs |
10000 |
Upper bound for cua_wait |
allowLaunch |
true |
Set false to disable cua_app_launch |
Pointer targets are clamped into the virtual screen, and astral code points (emoji,
CJK extension B) are sent as surrogate pairs so KEYEVENTF_UNICODE types them correctly.
allowLaunch lets the model start any program the host process can run; set it to false
when the session is not trusted.
No external driver
Unlike dsh-computer-use (which shells out to the cua-driver binary) this plugin calls
Win32 through koffi inside the host process: nothing to install, no daemon, no
CUA_DRIVER_BIN. The trade-off is honest: without the driver there is no UIA/accessibility
tree, so targeting is pixel-based β use cua_zoom / cua_screenshot_window to read a
window precisely before clicking.
Install
From npm:
dsh plugin --profile <profile> add dsh-win-cua
Or from a checkout / local directory:
dsh plugin --profile <profile> add <this directory>
Or in the Desktop app: Plugin Manager β install bundle β pick this directory.
Windows only. SendInput injects into the session whose input queue is active β a window
on a locked or disconnected desktop receives nothing.
Changelog
0.2.1
- Fixed: absolute pointer coordinates now carry
MOUSEEVENTF_VIRTUALDESK; without it a multi-monitor desktop silently mapped every move/click/drag onto the primary display. - Fixed:
cua_app_launchno longer crashes the host when the target is a directory or the launch is refused β it waits for the OS to confirm the process started and rejects cleanly. GetDIBitsis called with the bitmap selected out of the DC, as the API requires.keepScreenshotsnow rotateswindow-*andzoom-*captures too.cua_focus_windowreports whether the window actually took the foreground instead of always returningok: true.- Arrow/navigation keys are sent with
KEYEVENTF_EXTENDEDKEY. - Config values are normalized:
keyDelayMs: 20(a number) works the same as[20, 20]. cua_typesends one Enter for"\r\n";cua_zoomcoerces string coordinates safely;cua_scrollreports the delta it sent.package.jsongainedicon,repository,bugs,homepageand a>=20.11engine range.
0.2.0
- New look tools:
cua_screenshot_window(PrintWindow with screen-blit fallback),cua_zoom(region capture upscaled x1βx4),cua_app_list(windows with process names). - New act tools:
cua_drag,cua_wait,cua_app_launch(disabled withallowLaunch: false). humanizeis now a real config knob: smoothstep pointer path, per-character typing delay and click settle range, withmoveSteps/keyDelayMs/clickSettleMstuning.- PNG encoder, screenshot retention (
keepScreenshots) and coordinate clamping tightened.
0.1.0
First public release: screenshot, cursor, window list/focus, mouse move/click/scroll, key press and unicode typing.