sliverp/DeepSeek-harness-lark ↗★ 0
deepseek-harness-lark
飞书和Lark文本、图片和文件渠道桥接器,用于DeepSeek Harness
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:sliverp/DeepSeek-harness-lark说明文档
阅读完整 README ↗DeepSeek Harness 飞书 / Lark 插件
基于飞书官方 @larksuiteoapi/node-sdk 的 DeepSeek Harness 长连接通道。无需公网 IP 或回调服务器,支持飞书中国版和国际版 Lark。
功能
- 官方 WebSocket 长连接与自动重连
- 单聊和群聊访问策略,群聊默认要求
@机器人 - 普通文字、富文本、图片和普通文件消息输入
- 图片下载后保存为 Harness 附件,并按模型能力启用多模态输入
- 普通文件下载到 Agent 工作目录下的
.dsh-lark/inbox/,可由标准文件工具读取 - 模型文字回复、生成图片上传和工作区文件回传
- 每个聊天独立、可恢复的 Harness 会话;
/new可保留旧记录并切换到空白会话 - 新建与恢复会话均挂载并记录 Harness Agent preset,默认使用
standard - Harness 已注册斜命令直接执行,不会作为普通文字发送给模型
/bot-ping、/bot-help、/bot-image-test、/bot-file-test、/bot-status、/bot-cancel- App Secret 通过 Harness 凭据服务解析,不写入插件配置
安装
pnpm dsh plugin --profile web add github:sliverp/DeepSeek-harness-lark
本地开发版本:
pnpm dsh plugin --profile web add /absolute/path/to/DeepSeek-harness-lark
飞书开放平台配置
- 在飞书开放平台创建企业自建应用并启用机器人能力。
- 添加权限:
im:message.p2p_msg:readonly、im:message.group_at_msg:readonly、im:message:readonly、im:message:send_as_bot、im:resource。其中,用户发送的图片和文件必须通过“消息中的资源”接口下载,该接口需要im:message:readonly。 - 在「事件与回调」选择「使用长连接接收事件」,订阅
im.message.receive_v1(接收消息)。 - 创建并发布应用版本,将机器人加入需要使用的聊天。
- 把 App ID 写入
LARK_APP_ID,把 App Secret 保存为 Harness 凭据LARK_APP_SECRET。
开发时可从环境变量注入:
export LARK_APP_ID='cli_your-app-id'
export LARK_APP_SECRET='your-app-secret'
pnpm dsh --profile web
长期运行时,建议把 App ID 放在 ~/.dsh/.env,并通过 Harness 凭据设置界面保存 App Secret。不要把真实凭据提交到 Git。
配置
安装包默认添加:
- id: lark-channel
name: deepseek-harness-lark
config:
appId: !!js process.env.LARK_APP_ID
appSecretRef: LARK_APP_SECRET
cwd: !!js process.env.DSH_LARK_CWD ?? process.cwd()
需要国际版 Lark、群聊白名单或其他策略时,可在配置中覆盖:
domain: lark
singlePolicy: allowlist
singleAllowFrom: [ou_xxx]
groupPolicy: allowlist
groupAllowChats: [oc_xxx]
groupRequireMention: true
imageInputMode: auto
maxInboundFiles: 10
maxInboundFileBytes: 52428800
maxInboundMessageFileBytes: 104857600
maxReplyFiles: 5
maxOutboundFileBytes: 31457280
agentPreset: standard