itr-del/dsh-feishu
Feishu (Lark) IM bridge for DeepSeek Harness (dsh) — a cordis plugin
已收录
2
Notify
Bundle 已验证
功能介绍
DeepSeek Harness 的飞书/Lark 私聊桥接插件,支持 `dsh plugin add` 一键安装,配套完整调试文档。
适合
- 希望把每位飞书或 Lark 私聊用户映射到持久 DSH 对话的团队。
- 需要跨重连保留多轮对话的自托管机器人工作流。
- 需要基于 Cordis、并带有明确配置和调试文档的飞书桥接方案的运维人员。
不适合
- 飞书群聊工作流;该插件只支持私聊。
- 必须处理图片、文件、卡片或富文本消息的机器人;该桥接仅支持文本。
- 要求在飞书中逐 Token 流式显示回复的体验;回复要等 Agent 回合完成后才发送。
- 无法创建并发布飞书自建应用,或无法配置所需事件订阅、权限和凭据的部署。
README
dsh-feishu — Feishu (Lark) IM bridge for DeepSeek Harness
Pluggable cordis plugin wiring a Feishu self-built bot into a running DeepSeek Harness (dsh)
webprofile — installable viadsh plugin add.
┌────────┐ WS ┌──────────────┐ cordis ┌──────────┐ LLM ┌──────────┐
│ Feishu │ ──────> │ this plugin │ ──────────> │ dsh agent │ ────────> │ DeepSeek │
│ IM │ <────── │ │ <────────── │ │ <──────── │ │
└────────┘ API └──────────────┘ events └──────────┘ stream └──────────┘

Features
- One Feishu DM user ↔ one persistent dsh session (
feishu:<open_id>). - Multi-turn conversations across reconnects.
- Streams assistant replies back into Feishu, chunked at 4000 chars.
- Filters DeepSeek
<|DSML|...>tool-call markers from outbound text. - Pure ESM, no TypeScript compile step.
- No telemetry, fully local.
Installation
1. Install dsh
npm install -g @deepseek-ai/dsh
dsh web --help
2. Install the plugin
dsh plugin add dsh-feishu
This installs the plugin into ~/.dsh/profiles/web/node_modules/dsh-feishu and
patches cordis.patch.yml automatically.
3. Configure your Feishu app
Create a Custom App at https://open.feishu.cn/app and copy appId + appSecret.
Under Event Subscriptions (事件与回调):
- Set mode to Receive events via persistent connection (使用长连接接收事件/回调).
- Add the event
im.message.receive_v1.
Under Permissions (权限), grant:
im:message-
im:message.p2p_msg(required for DMs)
Publish a version (发布版本) — without this the bot cannot receive events. Wait ~2 minutes after publishing.
4. Export env vars and run
export DEEPSEEK_API_KEY="sk-..."
export FEISHU_APP_ID="cli_..."
export FEISHU_APP_SECRET="..."
dsh web
You should see in logs:
[feishu] WebSocket started (appId=cli_xxx)
[feishu] FeishuBridgeService initialized
DM the bot anything — the agent will reply in the same conversation.
Environment variables
| Variable | Required | Default | Notes |
|---|---|---|---|
DEEPSEEK_API_KEY |
yes (LLM) | — | https://platform.deepseek.com |
DEEPSEEK_BASE_URL |
no | https://api.deepseek.com |
For proxies |
FEISHU_APP_ID |
yes | — |
cli_xxx from app console |
FEISHU_APP_SECRET |
yes | — | From app console — never commit |
How a message flows
- User DMs the bot.
- Feishu SDK fires
im.message.receive_v1→ this plugin. - Plugin loads/creates the agent for
feishu:<open_id>. - Plugin calls
agent.followup(userMessage). - When agent returns to
idle, plugin readsagent.session.events, strips DSML noise, and posts the reply vialarkClient.im.message.create(...).
Limitations
- Text only. Image / file / card / post messages are not handled.
- No streaming. Reply sent after turn completes.
- No groups yet. DMs only.
License
MIT.
Acknowledgments
- DeepSeek Harness (dsh) — the agent runtime this plugin extends.
- @larksuiteoapi/node-sdk — official Feishu (Lark) SDK, MIT licensed.
- DeepSeek API — LLM backend.
Author
itr-del — 13918029394@163.com
Built while integrating dsh with a self-hosted Feishu bot on Ubuntu 22.04.
📖 Open-sourcing story: PUBLISHING.md — how this repo got published and listed.
中文文档见 README.zh.md。
常见问题常见问题
在启用了 DSH 的终端中执行已验证命令 dsh plugin --profile default add github:itr-del/dsh-feishu。命令会解析公开 package 元数据,并保持插件与本页展示的目录身份一致。
兼容性以页面上展示的 bundle 与 profile 状态为准。如果某个 profile 尚未检测到,请先保持禁用,并在生产启用前阅读仓库文档。
GitHub 链接和 activity 元数据是 release 与维护状态的来源。新版本发布后重新查看本页,确认目录已经观察到最新版本。