Introduction¶
One of the ways to extend DSH is through plugins. Some plugins solve toolchain issues, while another category of lightweight Web GUI plugins is used for temporary interactions during the wait for agent responses. dsh-doudizhu belongs to the latter category: it integrates the card game “Dou Dizhu” into the DeepSeek Harness Web GUI, allowing you to play an online game during the wait time.
Plugin Positioning¶
dsh-doudizhu is a DSH Dou Dizhu plugin running within the DeepSeek Harness Web GUI (http://127.0.0.1:3080).
It is maintained by AwesomeHou and is licensed under the MIT License. Current capabilities focus on online battles: 3-player online PVP, automatically filling in bots when real players are insufficient within 15 seconds. The client uses a React/TypeScript plugin entry point and provides a light-themed lobby and table interface.
Online battles rely on a backend deployed on Cloudflare, using Workers, Durable Objects, and D1 to handle matching, real-time synchronization, and server-side economic accounting. The client has a built-in default API address, so users do not need to set up their own backend.
Current Capabilities¶
The capabilities listed below all come from the current plugin documentation:
- 3-player online PVP.
- Auto-fill bots when real players are fewer than 3 within 15 seconds.
- Token/Check-in.
- Matching.
- WS games.
- Economic cycle.
- React/TypeScript plugin entry.
- Light-themed lobby/table UI.
- Default avatar selection.
- Nickname editing.
- Rule engine.
- Protocol version and application version forced verification, used to prevent desynchronization in online games.
The client is in online-only mode; there are no local offline games.
Installation and Enablement¶
The prerequisites are:
- Node.js ≥ 20.
- The
dshcommand is in your PATH.dshis provided by the npm package@deepseek-ai/dsh, not by the system. pnpmis in your PATH.dsh plugindepends onpnpm.
Recommended installation command:
dsh plugin --profile web add github:AwesomeHou/dsh-doudizhu
If you get a workspace root error, specifically ERR_PNPM_ADDING_TO_ROOT, you can add -w:
dsh plugin --profile web add -w github:AwesomeHou/dsh-doudizhu
After installation, restart dsh web, refresh the interface, and check the “Dou Dizhu” entry in the sidebar.
The installation action adds the plugin to the current profile’s bundle stack, with the patch file being cordis.patch.yml.
If you see a prompt related to git-hosted plugins allowBuilds during installation, the current plugin documentation does not contain a prepare/install build script, so there is no need to add an allowBuilds entry. As long as pnpm is available, you can run the installation command again.
Uninstall command:
dsh plugin --profile web remove dsh-doudizhu
Usage and Local Debugging¶
After installation and restarting dsh web, enter the Dou Dizhu entry from the sidebar. Once inside, you can select a default avatar, edit your nickname, and enter an online game via matching.
In an online game, bots will fill the gaps within 15 seconds when there are not enough real players. Token/Check-in, matching, WS games, and the economic cycle are all available.
If you are maintaining or debugging the plugin source code, the local development workflow is as follows:
npm install
npm run typecheck
npm test
npm run build
After modifying the source code, you must rebuild it and submit the changes to lib/. Distribution dependencies are included in the build artifacts provided by the repository.
Local debugging for the backend:
cd worker && wrangler dev
Notes¶
Online PVP requires that all players’ client protocols are consistent with the server. If the protocols are inconsistent, the client will prompt for an update; the server can also return 426 to refuse the connection.
Please note the following points:
- The client is in online-only mode; there are no local offline games.
- Online battles rely on the Cloudflare backend; the client has a built-in default API address.
dsh plugindepends onpnpm.- The plugin runs within the DSH / dsh plugin environment and possesses the permissions obtainable by the current
dshprocess. You should check the source code and the MIT license before installing. - Both installation and uninstallation act on the current
--profile web.
References¶
GitHub:
https://github.com/AwesomeHou/dsh-doudizhu