leo-lab-2026/dsh-lark-bridge ↗★ 1
dsh-lark-bridge
DeepSeek Harness plugin: real-time Feishu/Lark notifications when a DSH session pauses for user interaction (permission asks, questions, fatal errors).
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:leo-lab-2026/dsh-lark-bridge说明文档
阅读完整 README ↗首次配置(三步,约 5 分钟)
1. 准备飞书应用与 lark-cli
- 在飞书开放平台创建企业自建应用(或使用已有应用),拿到 App ID 与 App Secret;在「应用能力」里启用机器人;
- 在「权限管理」开通发送消息权限(三选一即可):
im:message(获取与发送单聊、群组消息)或im:message:send_as_bot(以应用的身份发消息)或im:message:send(历史版本)——参考官方发送消息文档; - 若想用
setup自动配置:在「事件与回调」开通im.message.receive_v1事件订阅,并授予im:message:readonly与im:message.p2p_msg:readonly权限; - 安装并配置 lark-cli(凭据存于 lark-cli 自身,插件从不接触 App Secret):
npx @larksuite/cli@latest install lark-cli config init # 交互输入 App ID / App Secret lark-cli auth status --json --verify # 确认 bot identity: ready
2. 配置通知目标(三种方式任选)
方式 A(推荐):/lark-notify setup 自动配置 — 在 DSH Web 里输入:
/lark-notify setup
然后去飞书给机器人发任意一条消息(默认 3 分钟窗口)。插件会自动捕获你与机器人的会话 chat_id 并写入设置(持久化到 settings.yaml,无需改任何 YAML),同时发送一条测试通知确认链路。
方式 B:DSH Web 设置面板手动填写 — 打开 DSH 设置 → 「lark-notify」分节 → 填入 chatId(oc_ 开头)或 userId(ou_ 开头),保存即生效(无需重启)。chat_id 可这样获取:
lark-cli event consume im.message.receive_v1 --max-events 1 --timeout 60s
### 2. 配置通知目标(三种方式任选)
**方式 A(推荐):`/lark-notify setup` 自动配置** — 在 DSH Web 里输入:
/lark-notify setup
然后去飞书给机器人发**任意一条消息**(默认 3 分钟窗口)。插件会自动捕获你与机器人的会话 `chat_id` 并写入设置(持久化到 `settings.yaml`,无需改任何 YAML),同时发送一条测试通知确认链路。
**方式 B:DSH Web 设置面板手动填写** — 打开 DSH 设置 → 「lark-notify」分节 → 填入 `chatId`(`oc_` 开头)或 `userId`(`ou_` 开头),保存即生效(无需重启)。`chat_id` 可这样获取:
```sh
lark-cli event consume im.message.receive_v1 --max-events 1 --timeout 60s
## 配置参考
完整配置项、模板变量、每类别开关见 [docs/09-notify-plugin.md](https://github.com/leo-lab-2026/dsh-lark-bridge/blob/dcbf70929fa06ec93e13ef0ed5527a8a8f8df931/docs/09-notify-plugin.md)。
模板变量:公共 `{sessionId} {sessionTitle} {webUrl} {time}`;permission `{tool} {reason}`;question `{header} {question} {options} {questions} {number}`;error `{errorLabel} {errorCode} {errorStatus} {errorMessage} {turn}`;complete `{turn}`;stop:blocked `{turn} {reason}`;stop:max-tokens `{turn}`;stop:aborted `{turn} {cancelCause}`;stop:interrupted `{turn}`;retry `{retry} {maxRetries} {maxRetriesLabel} {delaySec} {provider} {mode} {errorLabel} {errorCode} {errorStatus} {errorMessage} {turn}`;stall `{stalledMin}`;goodbye `{time}`。当 `{options}` 为空时,仅由 `Options: {options}` 构成的整行自动省略。