DSH Plugin Store
Back to home

Scotlight

dsh-win-computer-use

No description

Stars
0
Language
PowerShell
Created
Aug 14, 2026
Updated
Aug 14, 2026
Other
GitHub repo

Introduction

dsh-win-computer-use

Windows computer-use toolkit for DeepSeek Harness — give your text-only DSH agent hands on the Windows desktop.

UIA-semantic observation/control, window screenshots, built-in vision API (see images without a multimodal model), human-like bezier cursor motion, and a high-performance Rust helper backend.

Inspired by Anionex/dsh-computer-use (macOS), Harusame64/desktop-touch-mcp (Rust UIA engine) and sbroenne/mcp-windows.

Architecture

DSH Agent → win_* tools → executor (win-cu.ps1 / Rust helper) → Win32/UIA
                                             ↘ built-in vision API (win_see)

Two interchangeable executors, switchable at runtime via config.json (backend: ps1 | rust):

PowerShell (ps1)Rust helper (rust)
Startup costpowershell.exe ~200ms + Add-Type compilesingle binary ~10ms
UIA tree fetch (60 elements)~350ms~106ms
Focused element~370ms~2ms
Visioncurl + PSbuilt-in (WinHTTP/curl)

Performance reference from desktop-touch-mcp's measured PowerShell → Rust COM migration.

Tools

ToolDescription
win_list_appsList desktop windows: pid / process / title / bounds / foreground
win_observeUIA tree: index / type / name / AutomationId / bounds / patterns
win_screenshotPrintWindow PNG capture
win_clickSemantic-first (Invoke/Select/Toggle by id or index), bezier-cursor coordinate fallback
win_set_valueValuePattern set (no clipboard)
win_type_textSendInput Unicode (Chinese OK), auto focus + focus restore
win_press_keyVirtual keys + modifiers, focus restore
win_scrollMouse wheel with bezier cursor move
win_dragBezier-path drag
win_waitPoll UIA tree for element text
win_seeBuilt-in vision: any image → configured vision API → text description
win_launchLaunch an application

Design notes

  • Observe then act: use stable AutomationIds for actions — UIA tree indices shift when apps re-render (learned the hard way).
  • Visible, natural cursor: coordinate actions move the real cursor along a bezier path (random control points + easing + micro-jitter), so you see it move.
  • Focus protection: type/key/scroll bring the target window to foreground, then restore your previous foreground window.
  • Built-in vision loop: win_see sends screenshots straight to your configured OpenAI-compatible vision endpoint — works even with a text-only model.

Terminal console (win-cu)

Run win-cu in any PowerShell to open a persistent console (menu + live panel, no flicker):

  >> 视觉       |  VISION_API_KEY   **********
     控制       |  VISION_BASE_URL  https://ai.huan666.de
     运行时     |  VISION_MODEL     grok-4.5
     状态       |  AUTO_SCREENSHOT  [x] 开启
                |  [S] 保存   [T] 测试   [Tab] 字段   [q] 退出

Keys: Up/Down switch menu (right panel live-renders) · Tab next field · Enter edit/cycle · Space toggle · S save · T test · q quit. Edits persist to config.json — the DSH plugin reads it live on every call, no restart needed.

Config

C:\Users\XHY\.win-computer-use\config.json:

{
  "visionApiKey": "sk-...",
  "visionBaseUrl": "https://ai.huan666.de",
  "visionModel": "grok-4.5",
  "language": "zh",
  "autoScreenshot": true,
  "cursorSpeed": "normal",
  "cursorVisible": true,
  "focusRestore": true,
  "clickFallback": true,
  "backend": "rust",
  "rustHelperPath": "C:\\...\\win-cu-helper.exe"
}

Repository layout

src/main.rs       Rust helper (UIA + SendInput + bezier + PrintWindow + built-in vision)
win-cu.ps1        PowerShell backend (default executor)
win-cu-tui.ps1    Persistent terminal console (menu + panel)

License

MIT