dsh-gateway
One DeepSeek Harness Host, one Gateway. You create your Slack app and your Feishu app, paste the tokens into this DSH, and talk to the same agent from your phone.
There is no official shared bot. Tokens never leave your machine.
You do not need dshx. The default path is official dsh.
Loader id: dsh-messaging-gateway. After install, open DSH 设置 → 消息.
Install · 中文配对 · English pairing · For agents
What you get
- Slack DM and Feishu DM become real DSH sessions (tools, history,
/commands). - Computer sidebar lists them under Slack / Feishu, collapsed until you open a group.
- Computer Recents keeps the main DM only. Channel
@still replies on Slack/Feishu, in a separate session, not mixed into the DM. /newor/resetstarts a fresh session in that chat./compactshrinks context without resetting.
Requirements
- Official DSH with a web profile (DSH.app or
dsh --profile web). Built against dsh-v0.1.0-rc.8. - The
dshCLI that came with that install. - A Slack workspace you can install apps into, and/or a Feishu tenant where you can create a 企业自建应用.
Install (official dsh)
This is the path for people who only want official DSH.
From GitHub:
dsh plugin --profile web add github:aa2246740/dsh-gateway
Or from a clone:
git clone https://github.com/aa2246740/dsh-gateway.git
dsh plugin --profile web add ./dsh-gateway
Then restart that DSH Host and reload the page. dsh plugin add writes the profile; it does not hot-load a running Host.
Remove:
dsh plugin --profile web remove dsh-messaging-gateway
Prefer this official path. If you already use dshx, see below.
中文:自己配对
装好插件并重启 Host 之后做这些。
1. 打开配对页
DSH → 左下角 设置 → 左侧 消息。
徽章显示 已绑定 / 已连接 才算接通。密钥输入框永远是空的:已保存的 token 不会回显。
也可以打开 /plugins/dsh-messaging-gateway/setup 看 Slack Manifest。
2. 接 Slack
- 在 消息 页点 复制 Manifest。
- 打开 创建 Slack 应用(From a manifest),登录你的 workspace,整段贴上,Create,再 Install to workspace。
- Basic Information
- Bot User OAuth Token →
xoxb-… - App-Level Token → 建一个
xapp-…,scope 必须含connections:write(Socket Mode)。
- Bot User OAuth Token →
- 点你自己的头像 → Copy member ID →
U…(不要复制 bot 的成员号)。 - 填回 消息 页:Member ID、Bot token、App token → 保存并连接。
- 在 Slack 里给这个 bot 发一条私信。
完成:徽章 Slack 已绑定 U…,按钮变成灰色 已连接,Computer 侧栏出现 Slack 主 DM。
频道里要 @bot 才会回。没 @ 的闲聊会静音。
3. 接飞书
- 打开 飞书开放平台,创建 企业自建应用,启用机器人。
- 权限(发布一个新版本之后才生效):
application:app_slash_command:writeapplication:app_slash_command:readim:message.p2p_msg:readonlyim:message.group_at_msg:readonlyim:message:send_as_bot
- 事件订阅选 使用长连接接收事件,订阅 接收消息 v2.0。长连接要等本插件先连上,飞书后台才能保存这项。
- 凭证与基础信息:App ID(
cli_…)、App Secret。头像旁复制自己的 open_id(ou_…,不是机器人的)。 - 填回 消息 页 → 保存并连接。
- 在飞书里给这个机器人发一条私信。
完成:徽章 飞书 已绑定。斜杠面板大约 5 分钟 后出现;可重启飞书客户端加速。飞书网页版往往没有 / 面板,用官方桌面端(PC ≥ 7.70)或手机(≥ 7.71)。
群里同样要 @ 机器人才会回。
第一条未绑定的私信会把发信人收成这台 Gateway 的 Owner。设置里没填 open_id 也不妨碍已经在聊的飞书 DM。
4. 别人找你的 bot 聊天
未在 allowlist 里的人私信 bot,会收到 pairing code。当前 消息 页还没有「批准访客」按钮;Gateway 会把 code 记在 $DSH_HOME/messaging-gateway/state.json。自己用就填自己的 member id / open_id,不要把 bot 公开到陌生频道。
5. 怎么确认成了
- 设置 → 消息:对应平台 已绑定,按钮 已连接。
GET /plugins/dsh-messaging-gateway/list里有该 platform。- 私信 bot,DSH 会回;Computer 侧栏能点开同一条对话。
- 频道不 @ 则不回。
Pair it yourself
After official install and a Host restart.
Open pairing
Settings → 消息 (left nav). Badges 已绑定 / 已连接 mean the platform is live. Secret fields stay blank on purpose.
Manifest: 复制 Manifest or /plugins/dsh-messaging-gateway/slack-manifest.
Slack
- Copy the manifest from Settings → 消息.
- Create an app from manifest, paste, Create, Install to workspace.
- Bot token
xoxb-. App-level tokenxapp-withconnections:write(Socket Mode). - Your member id
U…(avatar → Copy member ID), not the bot’s. - Save. DM the bot.
Channels only respond when @mentioned.
Feishu
- Open platform: enterprise self-built app, enable the bot.
- Scopes (publish a version):
application:app_slash_command:write,application:app_slash_command:read,im:message.p2p_msg:readonly,im:message.group_at_msg:readonly,im:message:send_as_bot. - Event subscription: long connection, event receive message v2.0. Save that after this plugin is connected.
- App ID
cli_…, App Secret, yourou_…open_id. - Save. DM the bot.
Slash picker: ~5 minutes, official Feishu client (PC ≥ 7.70, mobile ≥ 7.71). Feishu web often has no / panel.
Guests
Unknown DMs get a pairing code. There is no approve button on 消息 yet. For a personal Gateway, bind your own ids and do not invite the bot into public rooms.
For agents
Follow AGENTS.md. Default to official dsh. If the machine already has dshx, give the agent this repo and the dshx repo and let it install.
dsh plugin --profile web add github:aa2246740/dsh-gateway- Human restarts that Host and reloads the page.
- Open Settings → 消息. Never invent tokens.
- Slack: copy manifest from the page; human creates the app; paste
xoxb-,xapp-withconnections:write, and the human’sU…. - Feishu: human creates the app; paste App ID, App Secret, human
ou_…; long-connection events after the plugin is up. - Done when badges say 已绑定 / 已连接,
GET /plugins/dsh-messaging-gateway/listlists the platform, and a DM gets a reply. - Never print secrets. Never dump
$DSH_HOME/messaging-gateway/state.jsoninto the transcript.
Commands
From Slack or Feishu:
| Command | What |
|---|---|
/help |
Catalog |
/model |
Show or switch this session’s model |
/new /reset |
Fresh session in this chat |
/compact |
Shrink context, keep the session |
/dsh <cmd> |
Catch-all when Slack reserves the name |
!help etc. |
Same commands inside a Slack thread |
Layout
src/gateway/ reducer: handle, list, access, pairing
src/slack.ts Slack Socket Mode adapter
src/feishu.ts Feishu WS + slash sync
src/client/ Settings → 消息, sidebar dock
State: $DSH_HOME/messaging-gateway/state.json (override with MESSAGING_GATEWAY_STATE). Settings tokens: DSH settings namespace dsh-messaging-gateway.
Optional: dshx
Already using an Agent against a Harness checkout? Install dshx, then give the Agent both that repo and this one (https://github.com/aa2246740/dsh-gateway). It can take it from there.
License
MIT. See LICENSE.
No comments yet. Be the first to write one.