DeepSeek Harness plugin

dsh-im-gateway-lijianui

Multi-channel IM gateway plugin for DeepSeek Harness (dsh): DingTalk / QQ / WeChat(iLink) with QR-scan binding, streaming replies, and a unified ctx.imGateway service. 为 DeepSeek Harness

Jump to install

Source facts

Repository
lijian-ui/dsh-im-gateway
Latest update
Aug 16, 2026
Category
Remote & Mobile
GitHub stars
4
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/lijian-ui/dsh-im-gateway
Plugin: dsh-im-gateway-lijianui
Author: lijian-ui

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer4 files
README.en.mdSource · read only
README language

@lijian-ui/dsh-im-gateway

English | 简体中文

> A multi-channel IM gateway plugin for DeepSeek Harness (dsh) — connect DingTalk, QQ and WeChat (iLink) bots to your harness agent, with QR-scan binding and streaming replies.

![npm version](https://www.npmjs.com/package/@lijian-ui/dsh-im-gateway) ![License: MIT](LICENSE)

---

Features

  • Unified gateway service — one plugin, three channels. Every channel routes through a single ctx.imGateway core: session management, slash commands, streaming, status broadcast.
  • DingTalk — outbound WebSocket stream connection, group + single chats, @-mention filtering, AI card streaming (real-time incremental replies), slash commands.
  • QQ — WebSocket gateway (official qqbot-nodejs SDK), private (c2c) + group chats, QR-scan bot binding (no manual console setup), streaming messages (c2c).
  • WeChat (iLink) — official iLink long-poll protocol, QR-scan login + pairing code, single-chat only, media (AES-128-ECB CDN) in/out.
  • Multi-bot instances — the same channel type can appear many times (e.g. two DingTalk bots), each with its own credentials.
  • Built-in slash commands/help, /model, /status, /new, /reset, /stop … (see below).
  • Settings UI — a full web settings page ("IM 通道") rendered inside the official dsh web UI; QR-scan binding happens right there.
  • Streaming replies — DingTalk AI Card, QQ stream_messages; plain-text fallback when a channel doesn't support streaming.

---

Installation

Requires DeepSeek Harness (dsh) — the plugin is a standard dsh bundle and installs through the official plugin channel.

From npm (recommended)

dsh plugin --profile web add @lijian-ui/dsh-im-gateway

The npm package ships pre-built lib/no build authorization needed (allowBuilds is not required).

From tarball

npm pack @lijian-ui/dsh-im-gateway
dsh plugin --profile web add ./dsh-im-gateway-0.1.0.tgz

From GitHub

dsh plugin --profile web add github:lijian-ui/dsh-im-gateway

> Git installs fetch source, so the first install requires approving the package's prepare build script (pnpm ≥ 10). Add the package key to the profile's pnpm-workspace.yamlallowBuilds when prompted. Prefer npm/tarball to skip this.

Verify installation

dsh --profile web --dump-config     # should show a "# == @lijian-ui/dsh-im-gateway" config layer
dsh --profile web                   # open Settings → "IM 通道" in the browser

---

Quick Start

1. Open the dsh web UI → Settings → IM 通道. 2. Click 添加通道 (Add channel). 3. Pick a channel type: - QQ: click 扫码登录 → scan with mobile QQ → credentials auto-fill → save. - 个人微信 (WeChat): click 扫码登录 → scan with mobile WeChat → (enter the pairing code if asked) → credentials auto-fill → save. - 钉钉 (DingTalk): fill in AppKey / AppSecret manually (or edit the config file) → save. 4. Message your bot from the IM client — replies stream back in real time.

> Config is stored under ~/.dsh/settings.yaml (im-gateway.channels). Saving from the UI hot-reloads the channels (no restart needed).

---

Slash Commands

Sent to the bot in any IM channel:

CommandDescription
/helpList available commands
/modelList models with emoji numbers; /model 1 or /model <name> to switch (no session yet → sets default for next conversation)
/statusChannel / cwd / current model / agent state
/new /reset /clearStart a fresh conversation
/stopAbort the current reply

---

Configuration

Everything is editable from the settings UI; the underlying schema lives in ~/.dsh/settings.yaml:

im-gateway:
  channels:
    - id: dingtalk-main
      type: dingtalk
      name: 主机器人
      enabled: true
      config:
        clientId: "..."
        clientSecret: "..."
        # callbackBaseUrl, appId, botAppId, baseUrl, botId, cdnBaseUrl, pollIntervalMs...
FieldApplies toMeaning
clientId / clientSecretdingtalkDingTalk app key / secret (Stream mode)
appId / clientSecretqqQQ Open Platform credentials (QR-bound)
token / botId / baseUrl / cdnBaseUrlweixiniLink credentials (QR-bound)
enabledallWhether this instance connects

---

Architecture

IM client ──► channel adapter (dingtalk / qq / weixin)
                    │  ImInboundMessage
                    ▼
              ctx.imGateway (core)
                    │  ensureSession → agent.followup
                    ▼
             dsh harness agent (LLM loop)
                    │  session events (turn/start, assistant/chunk, tool/call, turn/end)
                    ▼
         streaming reply → adapter.beginStream/streamText/endStream
                    │  (AI Card / stream_messages / plain text fallback)
                    ▼
                 IM client
  • Host half (node): src/index.ts (apply), src/gateway/ (core + slash commands), src/channels/ (dingtalk / qq / weixin + protocol helpers), src/remote.ts (Typert RPC for the settings UI), src/sync.ts (channel reload on config save).
  • Client half (browser): src/client/ — settings page "IM 通道" (add/edit modal + QR-scan login + status dots).
  • Multi-bot: channels is an array; the same type may appear multiple times.

Extension points

Third parties can register their own channel without forking:

import { ImChannelAdapter } from '@lijian-ui/dsh-im-gateway'   // peerDependency on the core

class MyChannelAdapter implements ImChannelAdapter { /* ... */ }
ctx.imGateway.registerChannel(myAdapter)

---

Development

git clone https://github.com/lijian-ui/dsh-im-gateway.git
cd dsh-im-gateway
npm install
npm run build          # tsdown → lib/
npm run watch          # rebuild on save
npm run typecheck

Local link into a dsh profile:

dsh plugin --profile web add ./   # install from this directory (link)

> Windows note: the dsh subprocess loads lib/index.js from package.json main — after editing src/, always npm run build then restart the dsh process (its require cache keeps the old module).

---

Troubleshooting

  • No logs from the plugin — cordis buffers ctx.logger.* in memory by default. The plugin registers a console exporter on apply, so logs appear in the dsh subprocess stderr (desktop shells prefix them with [dsh]).
  • QQ client shows "连接中" (connecting) forever — streaming was opened too early or never closed. This plugin opens the stream on the first assistant text delta and always closes it on turn/end (fixed in 0.1.x).
  • Chat works but replies are not streaming — the channel fell back to plain text (e.g. QQ group chats don't support stream_messages; WeChat has no streaming concept). This is by design.

---

License

MIT © lijian-ui

Built for DeepSeek Harness — independent plugin, not affiliated with or endorsed by DeepSeek.