No description
Find a file
2026-08-20 12:22:30 +08:00
assets feat: refine plugin branding and settings layout 2026-08-17 18:20:07 +08:00
bin Add DingTalk to unified IM plugin 2026-08-15 06:09:19 +08:00
docs/images update image 2026-08-19 03:33:09 +08:00
lib feat: execute AI Office jobs in Harness 2026-08-20 12:22:30 +08:00
plugin-src feat: execute AI Office jobs in Harness 2026-08-20 12:22:30 +08:00
scripts test: reject bundled DSH runtime packages 2026-08-20 01:59:00 +08:00
src/channels feat: execute AI Office jobs in Harness 2026-08-20 12:22:30 +08:00
test feat: execute AI Office jobs in Harness 2026-08-20 12:22:30 +08:00
worker docs: serve uncached random readme badge 2026-08-18 20:35:08 +08:00
.gitignore docs: serve uncached random readme badge 2026-08-18 20:35:08 +08:00
cordis.patch.yml Add unified IM channel plugin 2026-08-15 04:39:56 +08:00
LICENSE Add unified IM channel plugin 2026-08-15 04:39:56 +08:00
package-lock.json feat: execute AI Office jobs in Harness 2026-08-20 12:22:30 +08:00
package.json feat: execute AI Office jobs in Harness 2026-08-20 12:22:30 +08:00
README.en.md feat: execute AI Office jobs in Harness 2026-08-20 12:22:30 +08:00
README.md feat: execute AI Office jobs in Harness 2026-08-20 12:22:30 +08:00
THIRD_PARTY_NOTICES.md release: prepare dsh-im 0.2.0 2026-08-16 17:38:31 +08:00
wrangler.jsonc docs: serve uncached random readme badge 2026-08-18 20:35:08 +08:00

dsh-im logo dsh-im


DeepSeek Harness, always within reach

滑动变祖器:今天是梁子或今天是梁圣(随机) MIT license DeepSeek Harness dshfind dshfind: 分类第一

微信 飞书 钉钉 企业微信 QQ Slack Telegram Discord WhatsApp

简体中文 · English


Introduction

Connect IM bots to DeepSeek Harness by scanning a QR code, using an App Manifest, or entering existing bot credentials, and let the local Harness connect outward to a public AI Office. One plugin and one settings entry manage nine multi-bot IM channels and the AI Office Connector.

Interface

IM bot settings page

Built-in channels

Channel Setup Messaging and replies
Feishu Create a bot by QR code, or bind one with App ID + App Secret Persistent connection for incoming messages; streaming cards show thinking, tool progress, and replies
WeChat Scan a QR code to bind a WeChat bot Tencent iLink long polling for sending and receiving messages
DingTalk Create a bot by QR code, or bind one with Client ID + Client Secret DingTalk Stream connection; streaming replies through AI Cards
WeCom Create an intelligent bot by QR code, or bind one with Bot ID + Secret Official WebSocket connection; native thinking state, tool progress, and streaming replies
QQ Create a bot with mobile QQ QR scanning, or bind one with AppID + AppSecret WebSocket connection; native typing and streaming replies in private chats, replies when mentioned in groups
Slack Create an app from the bundled App Manifest, then enter a Bot Token (xoxb-) and App Token (xapp-) Socket Mode connection; direct DM replies, mention-only channel replies, and preferred native streaming API
Telegram Enter a Bot Token generated by @BotFather Bot API long polling; all groups ignored, private chats restricted to numeric IDs in telegram.allowedUsers, and streaming through message edits
Discord Enter a Bot Token generated in the Developer Portal Gateway v10 connection; direct DM replies, mention-only server replies, and streaming through message edits
WhatsApp Scan a QR code with mobile WhatsApp to link a device WhatsApp Web connection; read receipt and typing indicator followed by the final answer

Other IM platforms can be added through the same channel-adapter structure.

All nine built-in channels can send JPEG, PNG, and WebP images, plus GIFs sent as image files, with optional captions to Harness. Each image is limited to 5 MB, and images in one message are limited to 20 MB in total.

AI Office Connector

The AI Office page lets the local Harness connect outward to a public Office. The machine needs no public IP, forwarded port, or WebSocket server. The Device Token is written only to the Harness credential provider; the ordinary config file contains only the device ID, Office origin, workspace aliases, and instruction-preset aliases. Office selects aliases and never receives local absolute paths.

The current protocol is office-harness.v1. The connector authenticates and advertises capabilities with POST /api/harness/connector/heartbeat, then opens the downstream event plane with GET /api/harness/connector/stream over SSE. The settings page derives every fixed hook from the Office Base URL and reconnects with backoff after a disconnect.

A job.available event makes the local connector fetch the payload, validate Workspace/Preset aliases, claim a 90-second lease, and renew it every 30 seconds. It creates an isolated Harness Session, reports safe status/tool/text progress, and writes a terminal result exactly once. Tool approvals and follow-up questions surface in Office; approve, reject, and text answers return over SSE to the original Session. Heartbeats and leases recover from dropped connections.

A successful heartbeat response must be JSON: {"ok":true,"protocolVersion":"office-harness.v1"}. This makes a successful connection test proof of a compatible Office Connector instead of any URL that happens to return 200.

Installation

Install the published stable release from npm (recommended):

dsh plugin --profile web add -w @xmanrui/dsh-im

Restart dsh web, then open Settings → Plugins → IM Bot.

To try the latest code before it is published to npm, use the GitHub-source installer instead:

npx -y github:xmanrui/dsh-im install

A GitHub-source installation fetches and builds a Git dependency directly. With pnpm 10 or newer, the profile may first need an allowBuilds entry in pnpm-workspace.yaml. Most users should prefer the stable npm release.

After installation, follow the built-in instructions on each channel page to scan a QR code or enter credentials. Secrets and Tokens are sent only to the local Harness Host and stored through its protected credential provider; status responses and bot lists never return them.

Default behavior Description
Bot workspace Each bot stores its workspace independently. New bots start with the Host's current working directory, which can later be changed from the bot card.
Agent Preset New Sessions inherit Harness's agent-presets.default unless the channel explicitly overrides it. Later changes do not affect existing Sessions.

Telegram denies all inbound messages by default. Configure the numeric User IDs allowed to message the bot privately in the Web profile's cordis.patch.yml; group messages are ignored even when they mention the bot:

- id: xmanrui-dsh-im
  config:
    telegram:
      allowedUsers:
        - 123456789

allowedUsers accepts numbers or decimal strings, removes duplicates, and rejects invalid values when the plugin starts. An empty allowlist remains deny-all.

Bot commands

Command Description
/help Show the commands and usage supported by the bot.
/new Unbind the current chat so its next ordinary message starts a new Harness Session.
/status Check the connection between the current bot and DeepSeek Harness.
/models List every currently configured model with a number.
/model Show the model used by the Session bound to this chat.
/model <number or provider/model-id> Switch the model for the Session bound to this chat.
/stop Immediately stop this chat's running task while preserving work that has not started.
/steer <additional instruction> Inject an additional instruction into this chat's running task.
/compact Immediately compact older context in the Session bound to the current chat.
/workspace <absolute workspace path> Switch the current bot's Harness workspace.
/workspacelist List workspace absolute paths that still exist on the current Harness Host.
/sessionlist [workspace number or absolute path] List every registered session ID and title in the selected workspace; omit the argument to use the current workspace.
/session <Session ID> Bind the current chat to an existing Harness session.
Interactive question Reply with an option number, option label, or custom text; separate multiple choices with commas.
Remote approval Reply with 批准 / 拒绝 / 同意 / 不同意 / yes / no.

Example: send /models, then /model 2 to switch to the second model in the list. Other examples: /help, /new, /status, /model deepseek-official/deepseek-v4-pro, /steer inspect only the configuration file, /stop, /compact, /workspace /Users/alice/projects/my-app, /sessionlist 2, /sessionlist /Users/alice/projects/my-app, or /session session-id

Command details

  • /help takes no arguments and never creates a Session. It returns the complete command list supported by the current bot.
  • /status takes no arguments, never prompts the model, and does not change the Session binding. It confirms that the current bot can reach DeepSeek Harness.
  • /new only removes the current chat's saved dsh-im Session binding; it never deletes, empties, or archives the old Session. The next ordinary message creates and binds a new Session in the current workspace. If a task is running or waiting for a question or approval, finish the interaction or use /stop before /new.
  • /models takes no arguments and never creates a Session. It assigns a number to every currently configured Harness model and also shows its stable, copyable provider/model-id. If one provider fails, models from the remaining providers are still shown.
  • Bare /model only displays the current Session model. A model can be selected by the number or exact full ID returned by /models, for example /model 2. When the chat has no Session yet, a valid switch creates and binds a blank Session without prompting the model. The switch affects only that Session; Harness also attempts to save it as the default for future Sessions, while other existing Sessions remain unchanged.
  • A model cannot be switched while a task is running or waiting for an approval or question answer. Wait for it to finish or use /stop first. A Session containing images cannot switch to a model that does not accept image input.
  • /stop and /steer control only a running task started by this chat. Even when multiple chats bind the same Session, they do not intentionally control another chat's task. /stop does not delete the Session or its history, preserves queued work that has not started, and is safe to repeat.
  • /steer accepts text only, including multiple lines. It neither creates another Session nor starts a second task. Send an ordinary message when no task is running; while an approval or question is pending, answer it first or use /stop.
  • /compact acts only on the Harness Session already bound to the current chat and is never sent to the model. The bot reports the applicable status when the chat has no Session yet, the Session is generating a reply, or there is no compactable history.
  • The path must be an existing absolute directory. The bot returns an actionable error and the correct usage when validation fails.
  • /workspacelist takes no arguments. It combines the Harness global registry with the current bot's path. When that current path still exists and is safe to display, it appears first and is marked as current. Any listed path can be copied directly into /workspace.
  • A numeric /sessionlist argument uses the same freshly resolved order as /workspacelist at command execution time. An absolute path can also select a workspace directly, and the result echoes the resolved path.
  • /sessionlist includes every session registered to the selected workspace. Archived sessions are marked as archived; blank and subagent sessions are included when they belong to that workspace; sessions without a title are shown as No title yet. Any listed ID can be passed directly to /session Session ID.
  • /session accepts exactly one Session ID obtained from /sessionlist. It neither creates a session nor immediately prompts the model; later messages in the current chat continue the bound session. Regular archived sessions can be bound without being unarchived, while subagent sessions cannot be bound.
  • /session locates the session's unique workspace automatically. Binding inside the current workspace replaces only this chat's mapping. A cross-workspace binding switches the bot workspace, clears the old session mappings for all of that bot's chats, and then binds this chat, so it affects the bot's other chats. A reply already being generated may still finish.
  • Workspace switches and session bindings only clear or replace dsh-im chat mappings. They never delete, empty, or archive old Session contents; an old Session can still be listed and bound again.
  • Except on Telegram, any user who is already within the platform bot's visibility scope and can normally message it can run these commands; Telegram admits only private users in telegram.allowedUsers and always ignores group commands.
  • The list comes from the Harness Host's global registry and can include local absolute paths for other bots, other channels, or non-IM projects. Restrict the bot's visibility to trusted users.
  • Session results also come from the global Harness Host. Session IDs and titles can belong to other bots, other channels, or non-IM projects, and may contain sensitive metadata. Enable these commands only when every user in the bot's visibility scope is trusted.
  • Any user who can run /session can continue the selected session and use later messages to write to it or invoke its available tools. Expose the bot and session list only to trusted users.
  • A successful switch clears only the current bot's old Harness session mappings and does not affect other bots.
  • The new workspace applies to subsequent messages; a reply that has already started generating is allowed to finish.

Other features

  • Image understanding: all nine built-in channels can send JPEG, PNG, WebP, and GIF files sent as images to Harness, with an optional text description. Each image is limited to 5 MB, and all images in one message are limited to 20 MB in total.
  • Switch workspaces from a bot card: every bot card on the settings page shows its current Harness workspace. Enter an existing absolute directory path directly or open the directory picker. Switching clears only that bot's old chat mappings; it never deletes, empties, or archives old Sessions. Replies already in progress may finish, while later messages use the new workspace.
  • Check the connection and send a test message: when a bot is online, clicking Check connection verifies the platform connection and sends a “DeepSeek Harness connection test succeeded” message to the bot's most recently remembered direct conversation; WhatsApp uses the account's self-chat. The test neither creates a Harness Session nor invokes the model. The bot must have received at least one direct message before it has a remembered test target; otherwise the page reports that no test conversation is available yet.
  • Retry a connection or remove an integration: when a bot is offline, its card action changes to Retry connection. Use Remove integration when the bot is no longer needed. Each action affects only the selected bot and leaves other bots and channels unchanged.
  • Manage multiple bots independently: a channel can have multiple connected bots. Credentials, connection state, workspace, and chat-to-Session mappings are kept separately for every bot, so card actions do not affect sibling bots.
  • Streaming replies and progress: the plugin uses each platform's available capabilities to show thinking state, tool progress, and incremental answers. Platforms without a native streaming API complete replies through message edits, card updates, or a final message.

Design

  • Registers one IM Bot settings page containing nine IM channels and one AI Office Connector.
  • Maintains the Host, client, and runtime sources for all nine channels and the Office Connector in this repository without external standalone plugins.
  • Follows the DeepSeek Harness language preference and switches the settings UI live between Chinese and English.
  • Uses logos for WeChat, Feishu, DingTalk, WeCom, QQ, Slack, Telegram, Discord, WhatsApp, and AI Office navigation without enable/disable switches.
  • Keeps RPC endpoints, credentials, connection supervision, and session mappings isolated by IM channel; the Office Connector separately owns Device credentials, Job leases, approval waits, and concurrency limits.
  • Returns only QR codes, the public Slack Manifest, and redacted status data to the browser. Manually entered secrets and Tokens travel one way to the local Host; no RPC response returns App Secrets, bot_token, DingTalk client_secret, WeCom Secrets, QQ app_secret, Slack Bot/App Tokens, Telegram/Discord Bot Tokens, WhatsApp linked-device keys, AI Office Device Tokens, or raw user identifiers.

Local development

npm install
npm run check
node bin/dsh-im.mjs install --source .

npm run check runs unit tests, builds the Host and Client artifacts, and verifies that the published package contains neither credentials nor standalone channel settings-page registrations.

IM management RPCs accept loopback browsers by default. When a Web profile is deliberately served on a trusted LAN, opt the plugin into the Host authorities already trusted by Connection in that profile's cordis.patch.yml:

- id: xmanrui-dsh-im
  config:
    rpcAuthority: trusted-host

trusted-host reuses Harness's Host/Origin fence; it is not user authentication. Anyone who can reach that LAN authority can inspect bot status, scan or submit application credentials, reconnect bots, and remove bots. Enable it only on a trusted network.


Contact

You can reach me by email, WeChat, or Xiaohongshu.

Email WeChat Xiaohongshu
longmanr307@gmail.com WeChat QR code Xiaohongshu QR code