m0yun/dsh-computer-control: A Computer Controller That's Visible, Precise, and Verifiable

Introduction

In DeepSeek Harness (DSH), for an agent to operate desktop applications, it first needs to see the interface clearly, then click reliably, and finally feed the action results back to the model. Most approaches either rely on screenshots with limited precision or depend on coordinate estimation, making it hard to verify whether an action actually took effect. The m0yun/dsh-computer-control plugin provides a solution that is “visible, precise, and verifiable,” while also supporting a “watch & learn” mode that captures screen changes and operation sequences into reusable skills.

The plugin is maintained by M0yun, categorized as a client, and currently has 0 stars. It provides two core states: control (control the computer) and watch (watch & learn), which can be switched at any time.

Two Core Features

1. Computer Control (control)

On first run, the plugin uses the system’s built-in csc.exe to compile a persistent C# helper on the fly, then reuses it thereafter. The helper is Per-Monitor-V2 DPI aware, and all coordinates are unified as physical pixels.

Mouse operations supported: move, left/right/middle click, double-click, drag, scroll wheel. Keyboard supported: key combinations, Unicode typing (Chinese characters and punctuation can all be input).

Every action is a closed loop: screenshot before action → execute → poll for 1.6 seconds to detect changes → return “effective / no change / undetermined” + change ratio + changed region + post-action screenshot.

The screenshot displays a crosshair marking the click point, shows coordinates, and includes a 2× magnifier in the bottom-right corner for verifying “where the click landed and what the screen looks like.”

cc_look provides not only a screenshot but also a UI Automation element list for the foreground window (ref ID, type, name, center coordinates). You can click precisely by ref instead of guessing coordinates; ref-bound snapshots are valid for 20 seconds, after which a re-look is required.

For small targets or small text, you can use cc_look’s region + zoom for partial zoom (2–4×); when cc_act has refinement enabled, it returns a 3× zoomed image of the click point.

In the settings page, you can turn off “Refined Mouse Clicks”: when enabled, each action additionally returns the target element info + a 3× zoomed image—more accurate but more token-consuming; when disabled, only one full-screen screenshot is captured per action. Enabled by default.

cc_act results explain “what’s under the click point”: window title, process, UIA element type and name. For games or custom-drawn UIs where no element can be found, it explicitly states so and degrades to window + process only, without throwing an error.

If a click misses, it won’t spam clicks: by default it only attempts once, returns “no change” along with the screenshot, and lets the model decide the next step.

User-priority (default): by polling the cursor every 45 ms and calculating “user is operating” within 350 ms, it detects when the user is interacting and pauses first. If a click is interrupted, it yields quickly; for typing/keypress/drag, it waits an additional 3 seconds. If the user grabs the mouse mid-drag, it releases immediately and stops. When yielding, the Floating Island displays “Stopped: User Priority” and resumes after a few seconds. Can be disabled in the settings page.

To the left of “End” on the Floating Island is “Pause/Resume”: after pausing, all control actions are rejected; clicking “Resume” restores them; pause only affects the current session, is not persisted to disk, and is automatically cleared when switching states, closing the Floating Island, or resetting the floating window.

Rapid left-right mouse shaking (≥4 back-and-forth movements within 1 second, with each leftward and rightward sweep covering ≥120 px) will automatically pause control, and the Floating Island displays “Paused: Mouse shake detected.” Shaking in only one direction with a small return does not count. Disabled by default; can be enabled via this gesture in the settings page.

2. Watch & Learn (watch)

In watch mode, the Floating Island gains an extra “Chat” button: clicking it opens a drawer (the button changes to “Collapse”); the upper half shows recent conversation history, and below you can type directly—sent messages are injected into the current session; when the drawer is open, the Floating Island temporarily allows focus acquisition for easier typing.

When screen changes are detected, the first line of the Floating Island displays “Change 46.7% · 0,88 2560x1423.” With auto-narration enabled, changes are automatically captured and described in one or two sentences (8-second cooldown, triggers only when idle, to avoid spam and self-trigger loops).

The screen is sampled at 2 frames/second, and images are only saved when the change exceeds a threshold—saving disk space and also serving directly as a timeline.

Idle auto-downgrade: if there’s no change for 2 consecutive seconds, it drops to 0.5 frames/second; as soon as a change is detected, it immediately returns to 2 frames/second. Still only writes to disk on change; when static, typically only one baseline image is kept.

Global low-level hooks record actual mouse clicks, scroll wheel, and keyboard presses, along with the current window title and process.

cc_learn start begins recording a sequence of operations: screen change frames + input events + window switches are all logged together. After stop, it generates timeline.md (a chronologically ordered complete operation log) and events.jsonl.

After learning, you can use cc_learn save_skill to consolidate the workflow into a skill markdown file, and later use read_skill to read it back and follow the steps.

Floating Island (Always-on-Top Widget)

During control or watch mode, a Dynamic Island-style bar floats at the top of the screen, auto-collapsing after 2 seconds of returning to idle.

The first line shows the current state and the most recent action (e.g., Click (1200, 340), Drag (1200, 31) → (800, 200), Type 12 chars, Key ctrl+s, Scroll 3 ticks). The second line displays the currently focused window’s title and process in real time, refreshing every second; if it doesn’t fit, it auto-truncates.

Cumulative step count is not displayed on the Floating Island; use cc_log to check.

Four buttons on the right: Pause/Resume (temporarily stop control), End (always available, immediately ends the current behavior and returns to idle), Lock icon (unlock/lock), × (close the Floating Island).

When locked: × is hidden, and it cannot be dragged or closed; it can only be dragged or closed with × after unlocking.

After clicking ×, subsequent control/watch sessions will no longer pop it up until “Reset Floating Island Position” is clicked in the settings page.

Hold and drag the bar to reposition it; after an actual drag, the position is automatically saved as “custom” and persisted. Simply clicking the lock does not change the position.

Position, lock state, length, and opacity are all stored in %USERPROFILE%\.dsh\computer-control\config.json and persist across plugin restarts and DSH restarts; “Reset Floating Island Position” only resets the position without affecting lock/length/opacity.

When unlocked, dragging the left or right edge adjusts the length; both sides resize symmetrically (center stays fixed), and the width is remembered. The settings page also allows direct input of 300–900.

Opacity is adjustable, default 85% (range 30%–100%), and changes in the settings page take effect immediately and are remembered.

The settings page allows selecting top-center / top-left / top-right / custom, as well as toggling, locking, and resetting the position.

Normally invisible to screenshots (so it doesn’t interfere with action verification); the “Preview 5 s” option in the settings page temporarily allows it to be captured, for style checking.

Open/collapse has animation: collapsing pulls both sides toward the center into a circle, then shrinks and fades out; opening reverses this, expanding from the circle.

If a control action’s target point happens to land on the Floating Island, the island temporarily hides and automatically returns after the action completes; AI-injected clicks also cannot hit buttons on the Floating Island—only real human clicks take effect.

The Floating Island is an independent always-on-top window that does not steal focus; clicking it won’t interrupt your current typing.

States

State What it does
control See the screen, click, type; each action includes verification and a screenshot
watch Observe only, no actions: capture screen changes, log inputs, learn workflows
idle Standby, no capture and no actions

Switch with cc_mode {action:"set", mode:"control|watch|idle"}. The current state is written into the system prompt and every tool response, so the model always knows which step it’s in. Switching to control stops capture; if a learning recording is in progress, switching away is not allowed—run cc_learn stop first.

Settings Page

In the DSH settings sidebar, there is a computer control card (same category as “Bilibili Partner”):

  • View current state, cumulative action count, whether the helper is running, foreground window, and screen size
  • One-click switch between Idle / Computer Control / Watch & Learn
  • Start/stop watch capture, start/stop learning recording (with a task name)
  • Floating Island toggle, position (center/top-left/top-right/custom), length, opacity, lock position, Preview 5 s, Reset Floating Island Position
  • View storage usage, clean up screenshots, change frames, expired learning records (skills are not deleted)
  • Modify learning record retention days, auto-cleanup delay; one-click open data directory

The card calls the local same-origin endpoint /api/computer-control, bypassing the model, and changes take effect immediately upon clicking.

Tools

Tool Purpose
cc_mode View / switch state
cc_look Screenshot (optional grid/zoom) + foreground window + clickable element list (ref, center coordinates)
cc_act Click/double-click/right-click/move/drag/scroll/keypress/type/wait; includes preview, expect conditions; returns element info at the target point and a 3× zoomed image
cc_verify No action taken; only verifies screen change / window appearance / text appearance / screen quiet
cc_watch Start, view, stop watch capture; peek returns the latest change frame and your operations
cc_learn Record, stop, list, read, save/read skills
cc_log Review what each recent step did, coordinates, and verification results
cc_storage View / clean up stored screenshots, change frames, learning records (skills are not deleted)

Verification Mechanism

  • Full screen: 64×36 grid HSV/RGB diff, threshold 0.25%.
  • Local around target: 460×340 local diff around the click point, threshold 0.4%, so even small control changes are detected.
  • Window: a change in the foreground window title also counts as effective (e.g., a dialog opens, or a document title changes to “Unsaved”).
  • Text: cc_verify {kind:"text"} reads window text via UI Automation to confirm.

Data Directory

%USERPROFILE%\.dsh\computer-control\

Location Contents Retention Policy
tmp/ Pre/post-action screenshots Aligned with “auto-cleanup delay”: old images are cleaned after this duration since the last call
watch/ Change frames during watch mode Cleared each time watch starts; rolling max of 400 images
sessions/ Learning records (timeline, events, frame images) Default 30-day retention; adjustable via config.retentionDays; 0 = no auto-delete
skills/ Consolidated skill markdown files Long-term retention, no auto-delete
state.json / steps.jsonl Current state, action log Long-term retention, very small
config.json Retention days, cleanup delay, Floating Island toggle/position/lock Long-term retention, manually editable

Use cc_storage {action:"status"} to check usage per section; cc_storage {action:"clean", area:"tmp|watch|sessions|all", days:30} for manual cleanup (skills are never deleted by this).

Auto-cleanup is not on a fixed schedule: after each tool response, a one-time job is scheduled for “auto-cleanup delay” minutes later (default 30 min); rescheduling only keeps the latest one (consecutive calls don’t stack, they only push the time forward). When the deadline arrives, old screenshots older than the delay window are deleted; if watch or recording is in progress, it defers by the same duration and retries. Manual cleanup of change frames also requires stopping watch first.

helper/CCHelper.exe is a compiled artifact; if deleted, it will be automatically recompiled on next use.

Installation / Uninstallation

git clone https://github.com/M0Yun/dsh-computer-control.git

Then in the DSH desktop profile, install it as a local bundle (set the profile’s dependencies to link:<plugin directory>, and add dsh-computer-control to dsh.profile.bundles), then run in the profile directory:

pnpm install

You can also install this directory directly via the plugin manager.

To uninstall, remove it from both places and reinstall dependencies; the data directory can be manually deleted.

Use Cases & Notes

Suitable for scenarios requiring stable desktop application control within DSH and consolidating operation workflows into reusable skills. The plugin runs with the same privileges as the current DSH process: if the target application runs with elevated (administrator) privileges, SendInput may be discarded by the system and an explicit error will be reported; DSH must be launched with the same privilege level. Under lock screen / UAC secure desktop, injection is not possible and reliable screenshots cannot be captured. For a few windows like browsers, the UI Automation tree is very shallow (only exposes Chrome Legacy Window); in such cases, use screenshots + coordinates. For browser operations, prefer the dedicated browser tools. Watch capture defaults to 2 frames/second (dropping to 0.5 frames/second when idle); fast animations may only leave one representative frame.

Before use, review the source code and license to ensure compliance with your security and regulatory requirements.

In Short

The plugin provides “visible, precise, and verifiable” control capabilities, while also supporting the consolidation of screen changes and operation sequences into reusable skills. It is well-suited for DSH tasks requiring fine-grained desktop interaction and workflow reuse. For more details and updates, visit the plugin directory and the GitHub repository.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye