dsh-cua-preview: DSH Browser Automation with Approval and Screenshot Preview

Preface

When using DSH to drive a browser, navigation, clicking, form filling, and submission directly alter page states. Without an auditable context and a clear approval step, operations become difficult to retract once issued, and it is also hard to determine if they truly took effect by comparing “pre-execution” and “post-execution” screens.

Here, we introduce the community plugin dsh-cua-preview (maintainer ffyfox): it uses Puppeteer to drive local Chrome/Chromium and applies DSH approval workflows to tool calls that modify the page. It captures the current screen before approval for user inspection; if approved, it executes and returns screenshots along a timeline in the results. The approval logic references the design of ZCode’s cua-permission-broker without copying its source code. The plugin is categorized as admin-security in the SkillHub directory.

What is this?

dsh-cua-preview is a bundle plugin for DeepSeek Harness (npm package name dsh-cua-preview, version 0.2.0 in current documentation, MIT License). It addresses “browser automation + human oversight”: navigation and interaction operations are only executed after the user selects “allow” during an approval request; read-only tools do not trigger approval.

Core Features

The plugin exposes four types of browser-related tools to DSH. Their behaviors are as follows (subject to the repository README):

Tool Approval Required? Return Content
browser_navigate Yes The page after navigation completes and waits for bounded page reaction
browser_act (click / fill / submit) Yes The page after action completes and waits for bounded page reaction
browser_snapshot No Current URL, title, and visible text
browser_screenshot No Current screen image

The read-only pair does not modify the page, so no approval pops up. The pair requiring approval will ask first; they execute only when the Host side grants “allow once,” otherwise no page operations are performed.

Relationship between Screenshots and Approval (Brief): Approval happens before the action. When the user makes a decision, the conversation line first displays the screen at the moment of approval (captured by the Host just before asking); if execution is allowed, the result usually includes a frame annotated as before the action followed by the result image after the action completes; if rejected, only the screen at the approval moment is returned and annotated as at approval time (no action ran). Blank, unloaded pages will not forcefully output meaningless white images.

DSH Versions and Approval Text: The plugin was developed and verified on DSH 0.2.0-rc.2 (@deepseek-ai/dsh-tools 0.2.0-rc.2, @deepseek-ai/cordis 4.0.4) and is backward compatible to 0.1.5-rc.2. On 0.2.0-rc.2, the approval prompt line is fixed in English (the Host no longer exposes language preferences for plugins to read); on 0.1.5-rc.2 / rc.3, it can be localized.

Browser Stack: Uses puppeteer-core. It does not download a browser package during installation but connects directly to an existing local Chrome/Chromium, consistent with the browser you use on your desktop.

Installation and Enablement

Environment Requirements (from README):

  • Node ≥ 22.12 (required by puppeteer-core)
  • A Chrome or Chromium executable is installed locally; the plugin will not auto-download a browser during installation. If missing, an actionable error message will be provided.

DSH plugins are installed via profile. The dsh plugin command forwards arguments to the package manager under that profile directory:

# Install by package name
dsh plugin --profile demo add dsh-cua-preview

# Install from a local directory (e.g., existing checkout)
dsh plugin --profile demo add ./dsh-cua-preview

dsh --profile demo --dump-config   # "# == dsh-cua-preview" will appear in the config layer
dsh --profile demo                 # Start

This package is a DSH bundle: it comes with a configuration layer (cordis.patch.yml) which is loaded and started by the profile. To mount it on an existing profile without reinstalling, you can use overlays (the repository tests also adopt this method). Example snippet:

- insert:
    - id: cua-preview
      name: 'dsh-cua-preview'
      config:
        artifactsDir: '/tmp/cua-artifacts'   # Optional
        headless: true                       # Optional, defaults to true
        chromePath: '/usr/bin/google-chrome-stable'  # Optional, auto-detectable

Configuration Options

Key Default Value Meaning
artifactsDir $DSH_HOME/cua-preview/artifacts Directory where screenshot evidence PNGs are written
headless true Whether to run Chrome in headless mode
chromePath Auto-detect Explicitly specify the Chrome/Chromium path
settle {graceMs: 250, idleMs: 400, capMs: 3000} Strategy for waiting for page reaction before capturing the “result image” after an action

The Chrome path also reads the environment variable $DSH_CUA_CHROME_PATH and probes common Linux paths (e.g., /usr/bin/google-chrome-stable, /usr/bin/chromium, etc.). settle can be false, a number (total millisecond budget), or an object overriding graceMs / idleMs / capMs; invalid values will be logged and fall back to defaults to prevent erroneous timers from blocking plugin loading.

Waiting for Page Reaction (Why settle is needed)

page.click() returns immediately after input dispatch; goto returning at domcontentloaded may also be earlier than front-end rendering completion. If a screenshot is taken at the moment the action returns, the screen often remains in the pre-action state. Therefore, every approved action waits for the page to react within a bounded time according to settle before capturing the “result frame”; design details can be found in the repository’s docs/design.md.

Typical Usage

  1. Add dsh-cua-preview to the target profile using the command above. Configure chromePath or headless: false if necessary for local observation.
  2. Start dsh --profile <name>. In the session, let the model call read-only tools (such as browser_snapshot) to understand the page without needing approval.
  3. When the model calls browser_navigate or browser_act, check the current screen screenshot in the Host approval UI. The operation only executes after selecting “Allow once”; check the effect by comparing before the action and the post-action screen in the results.
  4. To retain evidence, pay attention to the PNGs written under artifactsDir; to debug waiting strategies, adjust settle.

The repository provides npm test and acceptance / real-load scripts to verify loading and behavior. See the scripts field in package.json for specific entry points.

Use Cases and Notes

Suitable for: Scenarios requiring controlled browser operations (form filling, clicking, submission, navigation) within DSH agent workflows, where human review via screenshots before execution is desired. Consistent with the admin-security category, it emphasizes operation gating rather than unrestricted automation.

Notes:

  • The plugin runs with the permissions of the current DSH process user; the scope accessible to the browser is consistent with that user. Before installation and enablement, you should review the GitHub Source Code and the MIT License to ensure compliance with your security policy.
  • Depends on local Chrome/Chromium. In containers or CI, it must be pre-installed and pointed to via chromePath or $DSH_CUA_CHROME_PATH.
  • The DeepSeek Harness ecosystem adopts the philosophy of “everything is a plugin”; the SkillHub plugin directory is a community site with no official affiliation with DeepSeek / High-Flyer. The facts in this article are based on the repository README and package metadata.

Links

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

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

Xiaoye