@jmoksz/lark-bridge
Feishu (Lark) entry point for DSH: one-command install plugin that lets users drive DSH agents from a Feishu bot over the long-connection event channel, with image/file/video/audio attachments, interactive ask/approval cards, live streaming progress cards with a tool panel, and proactive feishu_send pushes.
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:JMOKSZ/dsh-lark-bridge说明文档
阅读完整 README ↗配置
1. 飞书开放平台(一次性)
- 创建企业自建应用,添加机器人能力,记下 App ID / App Secret
- 开通权限:
im:message、im:message:send_as_bot、im:message.group_at_msg、im:chat、im:resource(附件必需)、im:message:update(卡片更新必需) - 事件与回调 → 订阅方式选 「使用长连接接收事件」,添加事件
im.message.receive_v1;如需卡片按钮点击,另订阅card.action.trigger - 可用范围设为需要使用的成员/部门,发布版本
2. 环境变量
凭据全部来自环境变量(不写入配置文件):
| 变量 | 必填 | 说明 |
|---|---|---|
LARK_APP_ID | 是 | 飞书应用 App ID |
LARK_APP_SECRET | 是 | 飞书应用 App Secret |
LARK_WORKSPACE | 否 | agent 工作目录(默认启动目录) |
模型 key 与 DSH 一致:export DEEPSEEK_API_KEY=sk-xxx 或写入 $DSH_HOME/.credentials.yaml。
3. 运行
LARK_APP_ID=cli_xxx LARK_APP_SECRET=xxx LARK_WORKSPACE=/path/to/work dsh --profile lark
看到 [lark-bridge] Feishu long connection ready 即连接成功。后台常驻用 nohup ... &;macOS 开机自启可配 launchd(参考仓库 scripts/)。
可调配置
在 $DSH_HOME/profiles/lark/cordis.patch.yml 的 lark-bridge 行下覆盖(常用):
| 字段 | 默认 | 说明 |
|---|---|---|
cardMode | true | 卡片总开关(流式回复 + 问答/审批按钮卡片) |
replyToMentionOnly | true | 群聊仅响应 @ 机器人的消息 |
ackEnabled | false | 是否先回「⏳ 收到」确认 |
streaming.patchIntervalMs | 700 | 卡片 PATCH 节流间隔(毫秒) |
streaming.showReasoning | true | 卡片上展示思考过程 |
streaming.showToolCalls | true | 卡片上展示工具调用面板 |
push.enabled | true | 注册 feishu_send 主动推送工具 |
maxUploadBytes | 104857600 | 附件大小上限(飞书上限 100MB) |
可调配置
在 $DSH_HOME/profiles/lark/cordis.patch.yml 的 lark-bridge 行下覆盖(常用):
| 字段 | 默认 | 说明 |
|---|---|---|
cardMode | true | 卡片总开关(流式回复 + 问答/审批按钮卡片) |
replyToMentionOnly | true | 群聊仅响应 @ 机器人的消息 |
ackEnabled | false | 是否先回「⏳ 收到」确认 |
streaming.patchIntervalMs | 700 | 卡片 PATCH 节流间隔(毫秒) |
streaming.showReasoning | true | 卡片上展示思考过程 |
streaming.showToolCalls | true | 卡片上展示工具调用面板 |
push.enabled | true | 注册 feishu_send 主动推送工具 |
maxUploadBytes | 104857600 | 附件大小上限(飞书上限 100MB) |
使用
- 单聊:直接发消息;群聊:@机器人 后发消息
- 发图片/文件/视频/音频:自动下载处理,可附文字说明(如「这张图里有什么?」)
- 需要选择/审批时:点击卡片按钮,或直接回复编号/文字
- 命令:
/new/status/whoami/help