cmfok/dsh-feishucard ↗★ 3

dsh-feishucard

连接飞书机器人,提供流式回复卡片与会话管理。 适合需要将 DSH 智能体能力接入飞书群聊或单聊场景的企业用户。

套件
dsh-feishucard
相容性
待驗證
Harness 依賴範圍
>=0.1.0-rc.5 <0.3.0-0
版本
0.8.13
授權
MIT
最近更新
2026年10月12日

安裝

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:cmfok/dsh-feishucard

配置 / 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_CARDS1(开)设 0 全局关闭「目标模式进度卡」。Set 0 to disable goal-round progress cards.
DSH_FEISHU_APPROVAL1(开)默认开启。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 → add im.message.receive_v1
  • 创建版本并发布 / create a version and publish