dsh-computer-use-pip: Always-on-Top Picture-in-Picture Window for DSH Agent

Introduction

When DSH developers debug their Agents, they frequently need to confirm which window the Agent is currently operating on. Traditional approaches either involve checking logs or taking screenshots while the Agent is running—neither provides intuitive, real-time feedback. This plugin offers a topmost floating window on macOS that mirrors the window the Agent is operating on in real time, without interrupting the Agent’s execution.

What Is This

dsh-computer-use-pip is a DSH client plugin developed by maintainer linabellbiu. It provides a Codex-style floating preview window for DeepSeek Harness’s computer use feature, mirroring the window the Agent is operating on on macOS. It stays on top, does not steal keyboard focus, and works across Spaces and in full-screen mode.

Core Features

Window Mirroring & Topmost

The small window is pinned to the top-right corner of the screen, 320pt wide, with a height that follows the target window’s aspect ratio (140–430pt). A 22pt transparent margin surrounds the window on all sides. A soft shadow is drawn (radius 18, offset 8pt downward), and the edges sit flush against the screen—no border. The small window lives on the floating layer, does not steal keyboard focus, and persists across Spaces and in full-screen mode.

Zoom & Position

Double-clicking the small window toggles between 1× / 3× (3× is capped by screen height). Dragging from any point repositions it. The position is saved in NSUserDefaults, so it reappears at the same location on the next launch (if the monitor changed and the position falls off-screen, it defaults back to the top-right corner).

Control Buttons

Two buttons are placed in a dark capsule at the top-right of the small window:
- ⤴ Takeover: brings the operated window to the foreground so the user can take over directly (does not affect the Agent’s continued execution).
- ✕ Close: dismisses only the small window without affecting the Agent; the Agent’s next action will cause the small window to reappear automatically.

State Directory

The plugin maintains state files under ~/.dsh/computer-use-pip/:
- activity.json: each computer-use action writes {pid, windowId, tool, action, at}.
- pin.json: computer_pip action=show manually pins the window (takes priority, never expires).
- state.json: bridge → small window {visible, status, aspect, frameSeq, updatedAt}.
- frame.png: the latest frame (atomically replaced).
- control.json: small window → bridge {seq, action: takeover|hide}.
- hidden.json: a flag for dismissing the small window, preventing an old pending action from popping it back up.
- overlay.pid: the small window process pid (only this pid is used for killing—never a fuzzy cmdline-based bulk pkill).
- bridge.log: bridge startup/exit log.

Lifecycle

  • App launch → the plugin starts pip-bridge.mjs --serve (idle, no frame capture).
  • An action occurs → a frame is captured for the target window, the small window is launched → each action refreshes one frame.
  • 90 seconds of inactivity → stop frame capture, dismiss the window.
  • 180 seconds → the small window process exits (re-launched on the next action).
  • If the small window is closed or crashes: the bridge checks once per second while the session is active and auto-restarts it.

Dismiss Behavior

  • Clicking the × button in the top-right of the small window: hides it immediately; it will not be re-launched by a new frame within 5 seconds.
  • Browser tasks idle for 120 seconds (PIP_IDLE) are closed automatically.
  • When the stream process exits (SIGTERM / TTL 300s), visible:false is written, and the small window dismisses accordingly.

Installation & Enabling

Requires macOS 13+ and Xcode Command Line Tools (to build the native small window).

git clone https://github.com/linabellbiu/dsh-computer-use-pip.git
cd dsh-computer-use-pip
./install.sh          # build small window + copy to ~/.dsh/tools + register profile + symlink

After installation, quit DSH with ⌘Q and relaunch it.

Typical Usage

Once installed, when the Agent executes a computer use action, the small window will automatically appear and refresh the current frame (~4 fps, sourced from cua-driver’s get_window_state with display_only:true). The user can:
- Double-click to toggle between 1× / 3×.
- Drag to reposition.
- Click the top-right buttons to take over the window or dismiss the small window.

If the user dismisses the small window, the Agent continues running, and the next action will bring the small window back (unless that action is flagged in hidden.json). The small window process will exit after 180 seconds of inactivity and be re-launched on the next action.

Use Cases & Notes

Ideal for developers who need to debug the DSH Agent’s computer use feature on macOS and want an intuitive way to confirm which target window the Agent is currently operating on.

The plugin runs with the current dsh process’s privileges. Review the source code and license (MIT) before installing.

Conclusion

dsh-computer-use-pip provides a low-intrusion window mirroring approach for DSH Agent development, delivering intuitive feedback without modifying any Agent code. Simply install and restart DSH to get started.

  • Directory page: https://www.skillhub.cn/plugins/linabellbiu/dsh-computer-use-pip
  • GitHub: https://github.com/linabellbiu/dsh-computer-use-pip
羽毛球分组比赛记分
小程序二维码

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

Xiaoye