Foreword¶
The core philosophy of DeepSeek Harness (DSH) is “everything is a plugin.” When using DSH, developers often need to bridge local agent sessions with external services. dsh-xiaoyi is a DSH host-side plugin that integrates Huawei XiaoYi’s OpenClaw mode into local DSH sessions, allowing voice messages, text, and images sent from mobile devices to flow directly into agents running on your local machine.
Plugin Positioning¶
- Name:
dsh-xiaoyi - Type: DSH host-side plugin
- Maintainer: HangZhouXi
- License: MIT
- Function: Establishes a connection between local DSH sessions and Huawei Cloud XiaoYi OpenClaw service.
Core Features¶
This plugin implements the following capabilities:
- Zero third-party dependencies: Uses only Node.js built-in modules, including a hand-written minimal RFC6455 WebSocket client that handles text frames, fragmentation reassembly, heartbeat detection, and handshake verification.
- Complete protocol implementation: Supports authentication signatures, handshake, heartbeat detection (including connection failure detection), and JSON-RPC 2.0 streaming.
- Inbound attachment handling: Supports receiving images and files from XiaoYi, downloading them locally, and passing them to the DSH session.
- Session reuse: Reuses existing sessions on cold start to avoid starting new conversations each time.
- Outbound online files (experimental): Supports sending local files back to XiaoYi (the protocol only supports public HTTPS URLs, reliability should be treated with caution).
Installation and Configuration¶
Environment Requirements¶
Before installation, please ensure the following conditions are met:
- DSH Host: This is a host-side plugin that must run in a DSH environment.
- Huawei XiaoYi OpenClaw credentials: Requires
AK,SK, andagentId. These need to be applied for independently on the Huawei Cloud developer platform. - Node.js ≥ 20: The code relies on built-in
fetch,FormData, andBlob.
Installation Steps¶
-
Register the plugin:
Register the plugin source via DSH command:
dsh plugin --profile web add git+https://github.com/HangZhouXi/dsh-xiaoyi
- Run installation:
dsh plugin --profile web install
-
Cold start:
Host-side plugins do not support hot reload. After installation, a cold start of the DSH host is required for the plugin to take effect.
-
Configure credentials:
Edit the configuration file
~/.dsh/xiaoyi/state.json:
{
"enabled": true,
"ak": "XiaoYi Open Platform AK",
"sk": "XiaoYi Open Platform SK",
"agentId": "agentId of your OpenClaw-mode agent",
"wsUrl": "wss://hag.cloud.huawei.com/openclaw/v1/ws/link",
"sessionId": "",
"cwd": "C:\\Users\\<you>\\Desktop",
"publicBaseUrl": "",
"imageHost": ""
}
Configuration options explanation:
* `enabled`: Master switch.
* `ak` / `sk` / `agentId`: Required fields, XiaoYi credentials.
* `sessionId`: Session reuse ID, typically maintained automatically by the plugin.
* `cwd`: Session working directory.
* `publicBaseUrl` / `imageHost`: Configuration for outbound file functionality.
Typical Usage¶
After installation and cold start, you can call the following tools in your DSH session:
xiaoyi_status: View channel status (credential integrity, WebSocket connection, queue length, etc.).xiaoyi_set: Dynamically update credentials or switches (e.g.,ak,sk,enabled, etc.).xiaoyi_send: Push short messages to the current XiaoYi session.xiaoyi_send_photo: Send local images or files to XiaoYi (experimental feature).xiaoyi_reconnect: Force disconnect and reconnect.
Notes¶
- Not a standalone chatbot: XiaoYi acts only as an entry point; it connects to your local DSH session. The local session has the same toolset and working directory—there is no second independent agent.
- Permissions and credentials: The plugin only consumes AK/SK/agentId and cannot create these credentials for you.
- Direction reliability: The inbound direction (mobile -> local) is reliable; the outbound direction (local -> mobile) only supports text, and the ability to send images or files is experimental, with protocol limitations requiring public HTTPS URLs only.
Summary¶
dsh-xiaoyi provides DSH users with a native way to connect to Huawei XiaoYi’s OpenClaw mode, leveraging a zero-dependency protocol implementation to ensure stability with the host process. Developers can quickly integrate via configuration files or the xiaoyi_set tool, enabling seamless integration between mobile devices and local workflows.