Preface¶
When performing desktop task automation with DeepSeek Harness (DSH), common challenges include: either being able to see screenshots but unable to interact, or being able to simulate clicks but lacking verification of environment state and safety boundaries. The dsh-computer-use plugin provides DSH with a set of deterministic desktop I/O infrastructure and a safety layer, enabling the model to execute real input based on screen state while controlling run-away risk within acceptable bounds through intent, risk, approval, audit, and physical pause mechanisms.
Plugin Positioning and Core Value¶
dsh-computer-use is a plugin designed for DeepSeek Harness (DSH) that registers two model-facing tools: computer_screenshot and computer. It is neither a screenshot understanding model nor a workflow engine, but rather provides a closed-loop “observe → act → re-observe” capability with a safety layer: the model decides where to click and what to do, while the approval policy determines whether high-risk operations are permitted. The plugin has no dependencies on OCR, cloud calls, or runtime npm packages, and uses native backends on both Windows and Linux/X11.
Core Features¶
-
Dual tool interface:
computer_screenshotcaptures a single display as a PNG, returning the file path, geometry, cursor position, foreground window, display list, and a one-time observation tokenstate_id. The default tool invocation iscomputer({action:"screenshot"}); the standalonecomputer_screenshottool is enabled in advanced mode.computerhandles real input actions (move, click, double-click, right-click, drag, scroll, type, key press) as well as flow actionswait,sequence,inputcheck, andpause. -
Native backends, zero runtime dependencies:
- Windows: PowerShell 5.1 + in-memory compiled C#
SendInputhelper (backends/win32.mjs), supporting foreground window detection, DPI awareness, and display enumeration. -
Linux/X11:
xdotoolfor XTest input, screenshot tools (scrotpreferred,import/xwdas fallback),xprop/xwininfofor foreground window facts,xrandrfor display layout. PNG processing usesnode:zlibwith no additional image libraries required. -
Single observation token with secondary verification: Each screenshot generates a one-time
state_idbound to the foreground window (handle, title, process, bounds) and an 8×8 pixel fingerprint (full-screen fingerprint is used on Linux when the window is on another display). Before sending input, the system re-reads the display layout and foreground window and re-samples the fingerprint. Any changes in window/bounds/layout/pixels will reject the operation with astale_observationerror, preventing blind clicking. -
Intent/Risk/Approval integration: Input actions require a brief intent (≤200 characters). Matching high-risk verbs (
send,delete,pay,password,install,confirm, etc.), suspected banking/account/email interfaces, and system-level key combinations (Alt+F4,Ctrl+Alt+Del,Win+R) are flagged as high-risk. High-risk actions requireconfirm_risk: trueand go through the DSHapprovalservice; missing approval, rejection, or cancellation all result in a “denied execution” outcome. -
Audit and physical pause: Every attempt is appended to a local JSONL audit log at
~/.dsh/computer-use/audit.jsonl(recording only timestamp, session, invocation, action, intent, risk level, result, denial code, coordinates, key combinations, and text length — never the text itself). The presence of~/.dsh/computer-use/pause.jsonblocks all input; the model can initiate a pause but cannot resume — only the user can clear it from the Desktop tab. Windows and X11 (requirespython3+Xlib) support a global hotkeyCtrl+Alt+Shift+Q(fallbackCtrl+Alt+Shift+F12) to write the pause file. -
Per-session capability toggles and DSH window protection: During tool registration,
whenconditions read the shared config~/.dsh/capability-toggles.json; toggles in the Desktop view write to the same flag. When disabled, the tools become unavailable for the next agent step without requiring a restart. The DSH window itself is protected: keyboard operations are denied when DSH has focus, and pointer operations are denied only when the target lands on DSH (Linux) or denied unconditionally (Windows). -
Input check diagnostics:
computer { "action": "inputcheck" }probes the input path and environment: on Linux, it checks session type, tools, display layout/DPI, pointer offset, clipboard helper, pause/lock status, and emergency brake; on Windows, it checks helper file placement, integrity, lock status, dispatch confirmation, pointer drift, and brake status. It returns installation hints and actionable diagnostics; missing tools produce structured denials instead of raw stack traces.
Installation and Enablement¶
Install via the DSH directory:
dsh plugin add https://www.skillhub.cn/plugins/nicken/dsh-computer-use
After installation, tools are not registered by default. You need to enable the “Desktop Control” toggle in the Desktop tab of the conversation before the tools become available for the next turn. Advanced mode can enable the standalone computer_screenshot tool under the same toggle.
Typical Usage¶
- Take a screenshot and obtain a token:
{
"action": "screenshot"
}
- Use the token to execute an input action (click example):
{
"action": "click",
"x": 500,
"y": 300,
"state_id": "<state_id returned from the previous step>",
"intent": "Click the login button"
}
- Input check diagnostics:
{
"action": "inputcheck"
}
Use Cases and Notes¶
- Suitable for scenarios that require executing automation tasks in a real desktop environment with precise input and state awareness.
- The plugin runs with the privileges of the current DSH process. Please review the source code and license (MIT) beforehand and use it in a trusted environment.
- Currently supports Linux/X11 and Windows only; Wayland and macOS are not supported.
In Summary¶
dsh-computer-use provides DSH with verifiable, auditable, and pausable real desktop operation capabilities, enabling the model to complete complex desktop tasks within controlled boundaries. For more details and documentation, see the directory page and the GitHub repository.