dsh-feishucard
DeepSeek Harness <-> Feishu (Lark) bridge with a streaming reply card: official-SDK long connection (no public URL), per-chat dedicated agent sessions, /new /switch /list /help commands, collapsible tool-call panels with status symbols, inline agent notes, rate-limit / backoff / circuit-breaker / text fallback. Self-developed (not a fork). 适合需要将 DSH 智能体能力接入飞书群聊或单聊场景的企业用户。
インストール
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:cmfok/dsh-feishucardドキュメント
README 全文を読む ↗配置 / Configuration
写在 ~/.dsh-feishucard/feishu.config.json(与仓库解耦 / decoupled from any repo):
{
"bots": [
{
"name": "我的机器人",
"workspace": "",
"appId": "cli_xxxxxxxxxxxxxxxx",
"appSecret": "your_app_secret",
"reactionEmoji": "OnIt"
}
]
}
会话状态持久化在 ~/.dsh-feishucard/state-.json。配置支持热更新(10 秒轮询),改完无需重启。Session state persists to ~/.dsh-feishucard/state-.json; config is hot-reloaded every 10s.
开关 / Switches(环境变量作用于整个插件进程 / env vars are process-wide):
| 变量 / Variable | 缺省 / Default | 作用 / Effect |
|---|---|---|
DSH_FEISHU_GOAL_CARDS | 1(开) | 设 0 全局关闭「目标模式进度卡」。Set 0 to disable goal-round progress cards. |
DSH_FEISHU_APPROVAL | 1(开) | 默认开启。2026-10-02 改口径:「手机上得要能审批才行,不可以关了」(2026-09-16 的"默认关闭、不许改回"按 作废)。设 0/false/off/no 关闭。覆盖沙箱越权升级(sandbox_permissions)的审批。会话已是 danger-full-access(用户已授全权)时一律不弹卡 —— 插件不再加一道(2026-10-02 修,见 CHANGELOG 0.4.18)。 |
FS_CONFIG_DIR | ~/.dsh-feishucard | 配置文件目录(测试用)。 |
per-bot 配置项 notifyGoalRounds(false 关闭该机器人的目标卡)写在 feishu.config.json 的对应 bot 里。Per-bot notifyGoalRounds: false disables goal cards for that bot only.
splitConclusionMinMs(per-bot,毫秒,默认 30000) —— 本轮耗时 ≥ 该值才把结论单独发一张新卡
(新卡=新消息 ⇒ 飞书会提醒;过程卡退化成"工作日志",结论不会重复)。短任务维持单卡。
设 0 = 每轮都分卡。
✅ 2026-10-01 已修复(0.4.13):per-bot
splitConclusionMinMs现在真的生效 —— 此前配置归一化白名单(normalizeConfig)漏了这个字段,写进feishu.config.json会被丢掉 (由 smoke 38 首次测「配置通道」时抓出)。10 秒热读、不用重启。 优先级:bot 配置 → 环境变量DSH_FEISHU_SPLIT_MIN_MS→ 默认30000。
splitConclusionMinMs decides when a finished turn's conclusion is posted as a new card (so Feishu notifies).
Hot-reloaded from the bot config (10s), no restart needed — fixed in 0.4.13
(the field had been silently stripped by the config normaliser).
✅ 同一条结论不会重复发送(0.4.17):结论按「agent + 回复正文哈希」跨插件代际去重 (
globalThis上的表,先到先得,窗口 120 秒)—— 修复「插件热重载留下上一代仍在await whenIdle()的回合链条 ⇒ 新老两条链在同一秒各拆一张结论卡」造成的重复。 只在"本来就会开结论卡"的长回合生效(短回合/纯旁白完全不受影响)。 命中时打日志[fs] duplicate conclusion suppressed: agent=… hash=… age_ms=…。 Duplicate conclusions are de-duplicated per agent + reply hash across plugin generations (120s window).
从旧插件迁移 / migrating from the legacy plugin:无需手动操作。首次启动若新路径无配置而
~/.cc-connect/feishu.config.json存在,自动复制迁移(日志migrated config from legacy ...)。Nothing to do — the legacy config is copied automatically on first boot.
飞书开放平台一次性配置 / One-time Feishu Open Platform setup
- 创建企业自建应用,启用机器人 / create an enterprise self-built app, enable the bot
- 权限 / permissions:
im:message.p2p_msg:readonly、im:message.group_at_msg:readonly、im:message:send_as_bot、im:message.reaction(可选 / optional) - 事件与回调 → 订阅方式选「使用长连接接收事件」→ 添加事件
im.message.receive_v1/ events & callbacks → long-connection mode → addim.message.receive_v1 - 创建版本并发布 / create a version and publish