The core design of DeepSeek Harness (DSH) is to extend capabilities to different channels through plugins. For developers or users, interacting directly with AI in WeChat is a common need. The dsh-wechat plugin bridges WeChat contacts to DSH sessions, enabling DeepSeek services to be invoked from WeChat.
This plugin is maintained by dAI-aigc and released under the MIT License. It uses Tencent’s official iLink channel to map WeChat contacts into independent DSH sessions, allowing specific WeChat IDs to drive DeepSeek Harness to generate replies.
Core Features¶
- Independent Session Management: Each WeChat contact has an independent DSH session (named using the format
wechat-<contactId>), ensuring that the conversation context is bound to that contact. - Multi-format Transfer: Supports transfer of text, images, and files. Images are fetched from the CDN and mounted into the session, while files are read directly.
- Native Typing Indicator: Supports WeChat’s native typing status display by obtaining tickets, sending status updates, and periodically refreshing.
- Whitelist Mechanism: Uses the
allowFromconfiguration option to control the list of WeChat IDs allowed to drive the agent. By default, only the account used for QR-code login is allowed; setting the list to an empty array means “only the login account is allowed.” - Local Execution: The login flow runs in the package directory on the local machine; the WeChat side only needs to scan and confirm.
Installation and Enablement¶
- Install the plugin:
Install the plugin under the Web profile:
dsh plugin --profile web add github:dAI-aigc/dsh-wechat
- Local login:
Enter the plugin directory, install dependencies, and start the login process:
cd <package dir>
pnpm install
pnpm login
The login script provides a QR-code page on local port 8899. After scanning and confirming, the credentials are stored in the `$DSH_HOME/data/dsh-wechat/weixin/` directory.
- Restart the service:
Restartdsh webso the plugin can read the stored credentials.
Typical Usage¶
- Configure the whitelist: Set
dsh-wechat.allowFromin the DSH configuration. For example, add a specific WeChat ID to the list to allow it to send messages. - Interact: Send a message from a whitelisted WeChat ID. DeepSeek Harness will process and reply within the corresponding independent session.
- Response chunking: Reply content is automatically chunked, with each chunk limited to 1800 characters.
- View accounts: Run
pnpm accountsin the plugin directory to list the accounts stored on the local machine.
Use Cases and Notes¶
- Permissions and security: The plugin runs with the permissions of the current
dshprocess. Ensure that you have reviewed the source code and the MIT License before installing it. - Concurrency limit: Only one process can perform long polling (
getupdates) at a time. If you manually runpnpm listen, the plugin will not work properly. - Feature limitations: Voice messages, video messages, and forwarded card messages are skipped, and no warning is displayed.
- Session maintenance: If you encounter error code
-14, it indicates that the session has expired. You need to runpnpm loginagain to log in.
This plugin is suitable for scenarios where WeChat needs to be used as an interaction entry point for DeepSeek Harness. Plugin repository: GitHub.