dsh-webpilot: A Browser Running Inside DSH

Introduction

The DeepSeek Harness (DSH) agent runs on headless machines, and many websites require login to access. Headless automation breaks down when encountering SSO, SMS verification codes, QR codes, or image captchas. Sending a screenshot to a chat window cannot solve the “click on the page” problem.

dsh-webpilot launches a real Chrome instance inside the DSH host: each session gets a dedicated tab driven by webpilot_* tools, while a visual panel on the right sidebar allows humans to observe or take over the same tab.

What It Is

dsh-webpilot is a DSH plugin that provides the capability of “a real browser embedded in the host.” It is maintained by frankfurtlin and categorized under “Web Tools.”

It communicates with Chrome via CDP, enabling the agent to navigate, read page structure, simulate real input events such as clicking, dragging, typing, and scrolling, and support human interaction through the sidebar (e.g., scanning a QR code to log in). Each session owns an independent tab while sharing a single persistent Chrome profile, so one QR login can be reused by subsequent sessions.

Installation & Activation

Installation command (assuming it is checked out to /opt/dsh/dsh-webpilot; adjust the path as needed):

sudo systemd-run --unit=dsh-webpilot-install --collect --property=Type=oneshot \
  /bin/bash /opt/dsh/dsh-webpilot/scripts/install.sh

The script performs the following actions:

  • Backs up the profile manifest
  • Registers link: dependency and the plugin bundle
  • Creates a node_modules symbolic link
  • Restarts the service and waits for the port to be ready
  • Exchanges the token Cookie and probes /api/dsh-webpilot/health
  • Rolls back on failure (manifest and symbolic link) and retries

If systemd is not available, you can run it in a separate process group:

setsid nohup /bin/bash /opt/dsh/dsh-webpilot/scripts/install.sh >/dev/null 2>&1 &

After refreshing the Web UI, the “WebPilot” entry will appear in the right sidebar.

Manual manifest editing:

  • Add "dsh-webpilot": "link:/opt/dsh/dsh-webpilot" to dependencies
  • Append "dsh-webpilot" to the end of the dsh.profile.bundles array
  • Create a node_modules/dsh-webpilot symbolic link in the profile directory pointing to the plugin directory
  • Restart DSH

Uninstallation (preserves the Chrome profile and login session; to also delete the profile, use the --purge option):

sudo systemd-run --unit=dsh-webpilot-uninstall --collect --property=Type=oneshot \
  /bin/bash /opt/dsh/dsh-webpilot/scripts/uninstall.sh

Agent Tools

The agent gains a set of webpilot_* tools for navigating, reading, and interacting with pages.

Status & Navigation

  • webpilot_status()
  • Returns whether the browser is running and the tab owned by the current session.

  • webpilot_navigate(url)

  • Opens the specified URL in the current session. Chrome launches, the session receives a tab, and the right sidebar panel opens.

Page Reading & Screenshot

  • webpilot_snapshot()
  • Reads the page as a set of numbered interactive elements. Each element returns box (bounding box), text (visible text), and href (absolute URL if it’s a link). Only clickable elements are numbered (overlapped elements are ignored).

  • webpilot_look()

  • Returns an annotated screenshot with element numbers drawn on the image along with a legend. You can interact with the image directly by saying “click element N.”

  • webpilot_screenshot()

  • Returns a page screenshot (image).

Interaction

  • webpilot_click(index | {x, y})
  • Clicks an element (supports index or coordinates). Before clicking, it probes for occlusion, disabled / [inert] attributes, and viewport position to avoid clicking overlapped buttons.

  • webpilot_drag(from, to | index, dx, dy)

  • Simulates mouse press, move, and release. Supports page coordinates (x1,y1 → x2,y2) or element index + dx/dy. Easing is applied to intermediate steps, making it suitable for sliding captchas.

  • webpilot_type(text, {replace: true})

  • Types text. replace: true clears the field first; otherwise, it defaults to appending. After typing, it reads the field value to detect whether a controlled input has swallowed the text.

  • webpilot_press(key)

  • Simulates a key press (e.g., Enter, Esc).

  • webpilot_scroll(delta)

  • Scrolls the page (in pixels).

  • webpilot_close()

  • Closes the current tab without deleting the profile.

Waiting & Human Intervention

  • webpilot_wait(selector, text, {timeout, pollInterval})
  • Polls until a CSS selector or visible text appears (or disappears). Default 10 seconds, maximum 120 seconds. Returns the match result or matched: false (timeout).

  • webpilot_ask_human(prompt)

  • Brings the current tab to the foreground and waits for a human to interact in the sidebar panel and press “Done.” This tool blocks the agent until human confirmation. While waiting, if the QR code expires, it re-requests the verification code.

Human Sidebar Panel

The right sidebar panel provides a live view (CDP screencast rendered to Canvas), supporting mouse, scroll wheel, keyboard, and IME input, and forwards all input to the tab the agent is using.

The panel includes:

  • Live address bar: clickable, typeable, and navigable with Enter
  • Back, forward, and refresh buttons
  • Status line: shows ● LIVE (running), STANDBY (idle), or HUMAN-TAKEOVER (human takeover)
  • Bottom log: records each agent action
  • Visual effects: spider cursor flight, click ripples, drag trails, reading scan lines, scroll bands, etc. These effects are drawn on the panel’s own overlay, are not injected into the visited page, and respect prefers-reduced-motion.

Typical Usage Example

In a session that requires logging in through a cloud console:

  1. The agent navigates to the login page:
   webpilot_navigate("https://console.cloud.tencent.com")
  1. A login dialog with a QR code appears on the page. The agent reads the page and presents it to the human:
   webpilot_snapshot()

The sidebar displays a numbered screenshot of the page.

  1. The agent requests the human to scan the QR code:
   webpilot_ask_human("Please scan the QR code in the sidebar, then press Done when finished")
  1. After the human scans and clicks “Done,” the agent reads the page again to confirm successful login:
   webpilot_snapshot()

Since login credentials are stored in the shared Chrome profile, subsequent sessions do not need to scan the QR code again.

Use Cases & Notes

Suitable for the following scenarios:

  • Websites that require login to access (SSO, SMS verification, QR code login)
  • Captchas that require human confirmation (sliding, image recognition)
  • Batch tasks that require persistent login sessions
  • Scenarios where the agent needs to perform real interactions (dragging sliders, clicking dynamic menus)

Notes:

  • The plugin runs with the permissions of the current DSH process. It is recommended to review the source code and license (MIT) before installation.
  • Chrome or Chromium must be installed on the host, along with Node.js >=22.19.
  • DSH engine version must be >=0.1.5-rc.2, with a web profile configured.
  • On machines without a GPU or display, you can launch headed mode using Xvfb + SwiftShader (mode: auto), with a fallback to --headless=new on failure.

Summary

dsh-webpilot provides the agent with browser capabilities by embedding a real Chrome instance inside the DSH host, while the sidebar panel supports human intervention and real-time monitoring. It resolves the bottlenecks of headless automation in login and captcha scenarios. Each session has an independent tab while sharing a persistent profile, making it well-suited for automation tasks that require login and complex interactions.

Plugin Directory | GitHub Repository

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

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

Xiaoye