dsh-moli: Driving the Local Moli Browser in DeepSeek Harness

Introduction

The web_fetch module of DeepSeek Harness (DSH) can handle standard HTTP requests and retrieve the HTML returned by the server. For plain text or static documents, this approach is sufficient and efficient. However, when dealing with single-page applications (SPAs) that require JavaScript rendering, pages that require a logged-in state, or web pages that need to be captured as screenshots, plain HTTP requests cannot retrieve the complete page content.

The dsh-moli plugin is designed to address this issue. It integrates the local Moli browser (a headless Rust browser designed for AI agents) into DeepSeek Harness, enabling agents to perform page rendering, semantic tree extraction, and screenshot or PDF generation like a real browser.

Plugin Overview

dsh-moli is a web utility plugin for DeepSeek Harness, maintained by developer 27painter. Its core functionality is to provide two tool interfaces: moli_fetch and moli_probe. Through these interfaces, agents can drive the locally installed Moli engine to handle content that must be rendered by a browser.

Core Features

The plugin primarily includes the following two capabilities:

  1. moli_fetch

    • Render the specified URL.
    • Return data in Markdown, HTML, semantic tree, or JSON format.
    • Evaluate JavaScript expressions in the page context.
    • Generate PNG screenshots or PDF documents.
  2. moli_probe

    • Check the installation status of the Moli engine, version information, and HTTPS availability.
    • Support automatic installation of the Moli engine.

Installation and Enablement

Installing the plugin requires two steps: first install the plugin code, then ensure the Moli engine is ready.

1. Install Plugin Code

The plugin code is published via npm and is very small (about 26KB).

dsh plugin --profile web add dsh-moli

2. Install Moli Engine

The npm package contains only the plugin code and does not include the Moli browser engine (about 101MB). If the engine is not installed locally, it must be installed separately.

Option 1: Automatic installation through the plugin

moli_probe action=install

Option 2: Use the official installer

The Moli engine is released under the MIT license and maintained by the lexmount/moli project. You can run the installer script provided officially:

# Windows
powershell -ExecutionPolicy ByPass -c "irm https://github.com/lexmount/moli/releases/latest/download/moli-installer.ps1 | iex"

# Linux / macOS
curl --proto '=https' --tlsv1.2 -fsSL https://github.com/lexmount/moli/releases/latest/download/moli-installer.sh | sh

Option 3: Manual download

Download the archive for the corresponding architecture from GitHub Releases (such as moli-x86_64-pc-windows-msvc.zip) and extract it to a specified directory.

If the Moli engine installation path is not in the default location, you can specify it via a configuration option:

config:
  exePath: 'C:\path\to\moli.exe'

After installation completes, restart DSH and run moli_probe to confirm that the version is correct.

Typical Usage

Check the environment status

Confirm whether the Moli engine is installed and check its version information:

moli_probe

Get rendered Markdown

Request a page that requires JS rendering and directly output Markdown:

moli_fetch url=https://example.com dump=markdown

Install the engine

When the engine is reported as missing, use the following command to trigger the installation process:

moli_probe action=install

Notes and Use Cases

Applicable scenarios

  • Single-page applications (SPAs): Content is entirely generated dynamically by JavaScript, and HTTP requests return an empty shell.
  • Login walls and session management: Pages that require browser cookies or a logged-in state to display content.
  • Visual verification: Screenshots or PDFs of web pages are needed for manual review or archiving.
  • Deep data extraction: Use selectors to extract specific fields from the page (such as prices or quantities).

Inapplicable scenarios

  • Purely static pages: If web_fetch can already return the required text content, prefer web_fetch because it is lighter and faster.

Limitations

  • Desktop profile not supported: This plugin does not support the dsh plugin --profile desktop installation command. The desktop profile belongs to the Electron application itself, so the plugin should be installed through the web profile.
  • Permissions and security: The plugin runs with the permissions of the current DSH process. Before use, it is recommended to review the source code and MIT license to ensure compliance with security requirements.

Conclusion

dsh-moli provides real browser rendering capabilities for DeepSeek Harness. By integrating the local Moli browser into the workflow, agents can overcome the limitations of static HTTP requests and handle the complex interactions and data extraction requirements of modern web applications.

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

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

Xiaoye