从飞书/Lark 操作 DeepSeek Harness:私聊发送任务,agent 用你配置的模型执行并把结果回到会话;feishu_send 工具可让 agent 主动推送结果。基于 lark-cli 的 WebSocket 长连接,无需公网 webhook,并附常驻启动器。注意:插件不校验发送者身份,因此任何能私聊到该机器人的人(默认即该飞书应用所属企业内的成员)都能驱动一个使用宿主机自身模型凭据与文件权限运行的 agent。安装不是一条 `dsh plugin add` 就完事:需要先全局安装并登录一次 `lark-cli`,并在飞书开放平台建一个带 README 所列权限的自建应用。
安装
# npm 包(预构建)
dsh plugin --profile web add dsh-feishu-remote
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:ShiXiangYu2/dsh-feishu-remote
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 README 只有英文版本。
Control your DeepSeek Harness agent from Feishu / Lark on your phone. Send a task by DM — get the result back in chat. Fully working closed loop.
✨ What it does
- 📨 Feishu → Agent → Feishu: DM your bot a task (e.g.
2+3等于几?), a DSH agent runs it with your configured LLM, and the answer comes back to the chat. - 🖼️ Image understanding: send a screenshot or photo — it's downloaded and analyzed by a vision model (Qwen3-VL), then the agent replies with what it sees.
- 🎨 Image generation round-trip: the agent can generate an image (
generate_image), download it locally (feishu_download), and send the actual image back to your Feishu chat (feishu_send_image) — not just a link. - 📤 Agent → Feishu: the model gets
feishu_send/feishu_send_image/feishu_downloadtools to push results, files, and generated images to any user or chat. - 🧹 Retention cleanup: downloaded images are kept for 7 days (configurable via
FEISHU_IMG_RETENTION_DAYS), then auto-deleted — no unbounded disk growth. - 🤖 Long connection: uses
lark-cli's WebSocket event bus — no public webhook server needed, works on localhost/LAN/private servers. - 🔒 Secure: reuses
lark-cli's OS-keychain credential storage and permission system; event listener runs unsandboxed by design (it must hold the WebSocket).
🚀 Install
0. Prerequisites
A Feishu/Lark self-built app with:
- Bot ability enabled
- Event subscription
im.message.receive_v1(long-connection mode) - Permissions:
im:message,im:message:send_as_bot,im:message.p2p_msg:readonly,im:chat:read,im:resource - A published version
- (Setup in the Feishu developer console — the CLI can enable the bot ability via API, but events/permissions need the console.)
lark-cliinstalled & authenticated once:
npm i -g @larksuite/cli
lark-cli config init # paste your App ID / Secret
lark-cli auth login --recommend # scan QR to authorize
1. Install the plugin
dsh plugin --profile demo add github:ShiXiangYu2/dsh-feishu-remote
The bundle contains two pieces:
index.js— the Cordis plugin: registers thefeishu_sendmodel tool and attempts an in-process event listener.feishu-resident.mjs— the recommended resident launcher: boots the web profile and runs the long-connection event loop in a detached process (see below).
2. Configure the model
The DSH profile must have a working LLM route (e.g. DeepSeek via SiliconFlow):
# profile cordis.patch.yml
- id: llm-deepseek
config:
apiKeyEnv: SILICONFLOW_API_KEY
baseURL: https://api.siliconflow.cn/v1
thinking: disabled
reasoningEffort: off
models:
- id: deepseek-ai/DeepSeek-V3.2
name: DeepSeek-V3.2 (via SiliconFlow)
contextWindow: 65536
maxTokens: 8192
- id: agent-default-model
config:
provider: deepseek-official
model: deepseek-ai/DeepSeek-V3.2
3. Run the resident (recommended)
The closed loop must live in a long-lived process. Use the included resident launcher:
# Adjust the absolute paths in feishu-resident.mjs (LARK_HOME, CLI) to your setup.
DSH_HOME=~/.dsh SILICONFLOW_API_KEY=sk-... \
node --import tsx/esm feishu-resident.mjs
It boots the web profile, spawns lark-cli event consume as a detached process (holding stdin open via a tail -f /dev/null pipe so the listener never exits on EOF), and for each inbound DM: ack → create agent → run task → extract final text → reply.
4. Use it
DM your Feishu bot anything, e.g. 帮我总结一下 ~/projects 的 README — the agent runs and the result comes back to the chat.
🛠 Tools
| Tool | Description |
|---|---|
feishu_send |
Model-facing: send a message to a Feishu user (ou_) or chat (oc_). |
feishu_send_image |
Model-facing: send a local image file to a Feishu user or chat. |
feishu_download |
Model-facing: download a URL to a local file (so generated images can be sent via feishu_send_image). |
🔌 How it works
Feishu DM ──► lark-cli event consume (WebSocket long-connection, detached process)
│ NDJSON event on stdout
▼
feishu-resident.mjs (long-lived process)
│ image? → download (messages-resources-download)
│ → vision describe (Qwen3-VL via SiliconFlow)
│ agents.create + followup(task) + whenIdle()
▼
final assistant text (ev.data.message.content)
│ lark-cli im +messages-send
▼
Feishu chat reply
Image handling
- The event content for an image arrives as
[Image: img_v3_xxx]. - The resident detects that pattern, downloads the resource via
lark-cli im +messages-resources-download(using the event's realmessage_id- the
image_key), then asks a SiliconFlow vision model (Qwen/Qwen3-VL-8B-Instruct, overridable withFEISHU_VISION_MODEL) to describe the picture.
- the
- The description is prepended to the user's message and fed to the DSH agent, so the agent can reason about the image and reply in Feishu.
- Downloaded images land in the
IMG_DIR(/root/dsh /feishu-imagesby default; the download command requires a relative--outputpath, so the residentcds into that directory first).
⚠️ Notes
- Why a resident process? DSH's shell service binds background processes to the calling plugin fiber; a listener started inside a plugin's
apply()is killed when the fiber settles. The resident launcher owns the listener in its own process, so it survives. - Text extraction: the final answer is read from the session log's
assistant/messageevents (ev.data.message.content, mirroring the official headlesssummarize()). - Long tasks: replies are truncated to the final text block; very long runs may exceed Feishu message limits.
- lark-cli event output streams as NDJSON on stdout (stderr carries
[event]log lines) — both are parsed.
📄 License
MIT
链接
同类插件
xmanrui/dsh-im★ 3737
通过二维码或机器人凭据将 IM 机器人接入 DeepSeek Harness(支持飞书、微信、钉钉、企业微信、QQ、Slack、Telegram、Discord 和 WhatsApp 共 9 种渠道)。
shaobeichen/dsh-pocket★ 3092
手机远程访问 DSH Web 界面:扫码即用局域网或公网(cloudflared 隧道)访问,实时同屏、移动端适配布局,带设置页管理。
c1overzz/dsh-bili-scroll★ 1459
让你的 DSH 自己刷 B站 —— 读字幕原文挑内容、写日报,遇到值得看的会发评论 @ 你。
OpenPetsHQ/openpets#dsh★ 1399
将 DeepSeek Harness 的生命周期状态、错误与审批请求,桥接到本地运行的 OpenPets 桌面伙伴。
inclusionAI/Avernet#deepseek-harness-channel-bcn★ 608
通过 WebSocket V2 将 DeepSeek Harness 接入 Avernet Bot 协作网络,支持自动注册、Agent 会话隔离、工具调用事件和多 Bot 路由工具。
zaofan-make/dsh-qqbot★ 270
QQ 官方机器人通道(tencent-connect/dsh-qqbot 的增强 fork):群/私聊ai陪聊、富媒体收发、表情包打标入库+检索发图、入群审批/禁言/群发、定时唤醒、QQ 远程审批与提问卡、互动按钮卡、多账号多实例、扩展接口、群友记忆注入、按消息价值唤醒省token、上下文自动压缩、悬浮球设置面板。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。