Introduction¶
In DeepSeek Harness (DSH), performing online tasks typically relies on globally installed Playwright, OpenCLI, or external CLIs. When environments differ, plugins struggle to share the same browser backend. Online plugins like dsh-web-search-pro often need to handle driver installation and invocation paths separately.
@anweat/dsh-browser packages Playwright (Chromium) and OpenCLI as local npm dependencies for the plugin, exposing a browser service and a set of interactive browser tools. Other plugins can inject this service via inject: ['browser'] to reuse the same runtime, eliminating the dependency on global CLIs.
What is this?¶
@anweat/dsh-browser is an online tool plugin for DSH maintained by anweat, currently at npm version 0.1.9 under the MIT license. It registers the browser service in apply() via ctx.provide('browser', service), allowing models to directly invoke tools and other plugins to consume them.
In short: A self-contained browser runtime plugin—locally packages Playwright/optional Patchright drivers and OpenCLI by default, falls back to global reuse when unavailable, and shares the system cache for the Chromium kernel (approximately 400MB, located at %LOCALAPPDATA%\ms-playwright).
Core Features¶
Browser Service and Toolset¶
The plugin exposes up to 21 tools, covering scenarios like page opening, interaction, screenshot capture, script execution, limited crawling, and OpenCLI invocation. Common entry points include:
| Tool | Function |
|---|---|
browser_open |
Opens a URL, returns title, readable text, and full-page screenshot path |
browser_read / browser_screenshot |
Reads the current page or captures a screenshot, suitable for public pages |
browser_click / browser_type / browser_scroll |
Clicks, types, scrolls, handles forms and lazy loading |
browser_recipe_run |
Declarative multi-step Playwright Recipes, up to 25 steps |
browser_crawl |
Anonymous, limited breadth-first traversal, constrained by usagePolicy |
browser_opencli_run |
Generic OpenCLI gateway, adapted for platforms like Reddit and Xiaohongshu |
browser_status |
Checks runtime status, automationMode, and approval policies |
After installation, it’s recommended to call browser_status first to verify driver and tool directories are functioning correctly. If Chromium is missing, executing browser_install once will complete the setup.
Automation Freedom¶
automationMode controls the tool set visible to the model and execution approvals, with standard as the default: read operations execute directly, while write operations like clicks, typing, and scrolling go through DSH’s native one-time approval. Optional modes include read-only, autonomous, and unrestricted. Mode changes require restarting the DSH profile for the tool directory to re-register based on the new configuration.
unrestricted bypasses human confirmation but does not override usagePolicy’s concurrency, burst, page, depth, retry, and cooldown protections. It’s suitable only for isolated test profiles.
Reusable Automation Assets (Experimental)¶
Starting from version 0.1.9, supported governed Recipe/UserScript drafts: the default persistenceMode: suggest only records anonymized semantic steps. When candidates reach a threshold, they can be summarized into drafts in the panel. They must be manually activated after being replayed in a real browser. Models can retrieve, develop, and invoke activated assets via browser_automation_search, browser_automation_develop, and browser_automation_run. This feature is still marked as Experimental and is recommended for trial in isolated profiles.
Collaboration with Other Plugins¶
dsh-web-search-pro injects this plugin’s browser service via inject: ['browser'] to drive its browser and OpenCLI backends. The README notes: dsh-web-search-pro >= 0.1.8 requires @anweat/dsh-browser >= 0.1.8. Web Search Pro and the browser plugin should be upgraded together; do not upgrade only the former.
Installation and Activation¶
The following sections introduce the official installation commands. The plugin is compatible with DSH baseline ^0.1.1-rc.2 and requires Node ^22.19 || >=24.
dsh plugin --profile web add @anweat/dsh-browser
It can also be installed from a local directory or tarball:
dsh plugin --profile web add ./dsh-browser
The web profile disables HMR, so a full restart is required after installation:
dsh --profile web
When upgrading from an older version, it’s recommended to upgrade both the browser plugin and Web Search Pro simultaneously:
dsh plugin --profile web add @anweat/dsh-browser@^0.1.9 dsh-web-search-pro@^0.1.11
After upgrading, completely stop and restart the Web profile, then verify by calling browser_status, browser_opencli_status, and web_backend_status. Simply refreshing the web page will not reload plugin services.
Typical Usage¶
Public Page Reading¶
Suitable for tasks that do not require login. Check the status first, then open the target page:
First, call browser_status; then use browser_open to open the target page.
For reading content, use browser_read; for screenshots, use browser_screenshot.
Sites Requiring Login¶
Use authProfile to manage login state, with allowedDomains configured; do not put cookies into tool parameters. Example session prompts:
First, call browser_status; then use browser_open to open the target page.
If the page requires login, use authProfile=forum; do not put cookies into tool parameters.
Choose Tools by Scenario¶
| Scenario | Recommended Approach |
|---|---|
| Reading and screenshotting public web pages | browser_open → browser_read / browser_screenshot |
| Forms, pagination, lazy loading | browser_click / browser_type / browser_scroll |
| Post-login sites | authProfile + allowedDomains |
| Model-generated multi-step operations | browser_recipe_run |
| OpenCLI platforms like Reddit / Xiaohongshu | browser_opencli_status → browser_opencli_catalog → browser_opencli_run |
| Poor compatibility with regular sites | Configure browserRuntime: patchright (Chromium-only) |
Providing browser Service to Other Plugins¶
Other plugins can obtain BrowserService after declaring inject: ['browser']:
export const inject = ['tools', 'browser']
export function apply(ctx: Context) {
const browser = ctx.get('browser') as BrowserService
// browser.render / snapshot / searchResults / opencli / recipe /
// runBuiltinScript / runUserscript / open / click / type / scroll / read / screenshot / close
}
The service interface definition can be found in the repository’s src/browser-service.ts.
Applicable Scenarios and Notes¶
Who is this for: Developers who need a stable browser backend in the DSH web profile and want online plugins to share Playwright and OpenCLI; scenarios involving search, page reading, and platform adaptation in conjunction with dsh-web-search-pro.
Usage Notes:
- The plugin runs with the current DSH process permissions. Check the source code and MIT license before installation.
usagePolicylimits concurrency, burst, retry, and crawl budgets. All automationModes share the same Governor and cannot be bypassed by switching modes.- General crawling uses anonymous context by default and does not inherit global login state. For post-login reading, use explicitly scoped single-page or Recipe tools.
- Reusable automation assets are still experimental; drafts must be replayed in a real browser before activation and should not be used as unsupervised production write operation entry points.
- If the harness is a local source checkout, version numbers may differ from npm published packages. Use
dsh plugin --profile web add ./<path>and align versions in the profile’spnpm-workspace.yamlbefore reinstalling.
Conclusion¶
@anweat/dsh-browser encapsulates Playwright, optional Patchright, and OpenCLI within the plugin boundary, exposing them uniformly via the browser service, freeing DSH online tasks from reliance on global CLIs. Start with the standard mode and browser_status, then choose the appropriate tools based on the task.
- Community directory: skillhub.cn/plugins/anweat/dsh-browser
- Source code and documentation: github.com/anweat/dsh-browser