fengs2021/dsh-feishu-bridge ↗★ 0
dsh-feishu-bridge
DSH 飞书机器人桥接插件:通过飞书机器人与 DeepSeek Harness 对话——飞书消息进 DSH 会话由 AI 处理,回复以流式交互卡片实时发回(思维链/正文/工具链分区、打字机效果),无需公网 webhook
AI 分析
核心用途是将 DSH 的 AI 能力桥接到飞书客户端。适合习惯使用飞书进行日常沟通、需要通过飞书单聊或群聊 @ 机器人来调用 DSH 的团队或个人。
インストール
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:fengs2021/dsh-feishu-bridgeドキュメント
README 全文を読む ↗Usage
- Open the bot chat in Feishu (or add the bot to a group)
- Message it directly; in groups, @ the bot
- Commands:
/help,/reset,/status
Channel direct-send (DSH → Feishu): de_channel_send channels=feishu content=...; attachments via attachments=[{kind:'image'|'file', path|url|base64, fileName?}]; target defaults to the most recent Feishu chat, or explicit target: 'p2p:oc_xxx'. Implemented in lib/channel-registry.js (standalone, zero deps on the notification module).
配置
在 ~/.dsh/profiles/web/cordis.patch.yml 中覆盖配置(全部可选,均有默认值):
- id: feishu-bridge
config:
botOpenId: 'ou_xxxxxx' # 机器人 open_id(群聊 @ 判断用;见下方获取方式)
allowlist: ['ou_xxxxxx'] # open_id 白名单;空数组 = 允许所有人
cwd: '~' # 新会话工作目录(默认用户主目录)
enableGroup: true # 是否响应群聊中 @ 机器人的消息
maxReplyChars: 3500 # 文本模式单条回复上限(超出分段)
typingHint: true # 文本模式下收到先回「思考中」提示
replyMarkdown: true # 文本模式回复使用 markdown 排版
streamCard: true # 流式卡片模式(默认开;关闭则退回文本分段回复)
cardPollMs: 600 # 流式轮询间隔(毫秒,兜底检测 turn 结束)
cardMinIntervalMs: 1200 # 卡片更新最小间隔(毫秒,飞书接口限频保护)
maxTurnMs: 600000 # 单轮最长等待(毫秒),超时停止更新并提示
larkBin: 'lark-cli' # lark-cli 可执行文件路径
stateFile: '~/.dsh/plugins/dsh-feishu-bridge/state.json'
botOpenId 获取方式
- 插件启动时自动探测(
/open-apis/bot/v3/info;部分应用权限下返回为空); - 在任意群里 @ 机器人发一条消息,插件日志会打印
learned botOpenId=ou_xxx from group mention,填入配置即可; - 飞书开放平台后台 → 应用 → 机器人,查看机器人 open_id。
使用
- 在飞书中搜索并打开机器人会话(或让管理员把机器人拉进群聊);
- 直接发消息即可对话;群聊中需 @ 机器人;
渠道直发(DSH → 飞书)
插件在 apply 时把主动发送能力登记到 DSH 渠道注册表(与 dsh-memory-evolve 通知模块的 globalThis.__dshChannelNotify 约定一致),因此 DSH 的 de_channel_send / de_notify 工具可直接发到飞书:
- 文本:
de_channel_send channels=feishu content=... - 附件:
attachments=[{kind:'image'|'file', path|url|base64, fileName?}](本地路径/base64 经临时目录 + 相对路径发送;图片走--image,其余走--file) - 目标:缺省 = 最近交互的飞书会话(插件 state 记录);显式传
target: 'p2p:oc_xxx' - 实现:
lib/channel-registry.js(独立模块,零依赖通知模块)
- 命令:
/help— 帮助/reset— 清空当前对话上下文,重新开始/status— 查看会话状态(sessionId / 模型 / 已处理消息数)