DeepSeek Harness Plugin Hub

Publish and manage complete Harness Profiles. Discover Plugins for your next setup.

Explore

PluginsPresetsDocsNews

Community

Publish a pluginContactReport an issue

Resources

Plugin Hub on GitHubDeepSeek HarnessSystem statusPrivacy notice
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

Independent and unofficial. Not affiliated with, authorized by, or endorsed by DeepSeek.

Feishucard — DSH Plugin for DeepSeek Harness
DeepSeek Harness Plugin Hub
ProfilesPluginsCategoriesNewsDocsSign inManage Profiles
ProfilesPluginsCategoriesNewsDocsSign in
← Plugins

dsh-feishucard

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 / te

The plugin will be installed here. Keep web if you are unsure.

npx -y @deepseek-ai/dsh plugin --profile web add dsh-feishucard@0.3.0
READMECompatibilityVersions

Description

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).

Compatibility and provenance

Feishucard is published as dsh-feishucard and currently resolves to version 0.3.0. The Hub verifies its manifest and preserves the exact installation source for reproducible installs.

DSH compatibility
*
Runtime surfaces
any
Release source
npm
Registry updated
9/18/2026

Versions

0.3.0stable
9/18/2026
0.2.0stable
9/8/2026
0.1.0stable
9/8/2026

Related plugins

Loading related plugins…

Latest
0.3.0
DSH
*
HMR
Process restart
Tree shaking
Safe tree shaking not declared
Unpacked size
187.8 kB
Files
9
Surface
any
License
MIT
Source
npm
GitHub
★ 3
Weekly downloads
0
Last push
9/18/2026
View source ↗
README badge

Click the badge to copy Markdown for your README.

Do you maintain this Plugin?Claim benefit · Priority security scan

Verify the GitHub repository declared in package.json to manage this listing. After you claim it, Hub will prioritize a security scan of the current version and publish the result when it passes.

Claim this Plugin →
Report an issue

Related plugins

More verified plugins in integrations-communication.

Acp App@deepseek-ai/dsh-acp-appThe dsh ACP profile bundle: automation-only JSON-RPC stdio and process lifecycle over dsh-baseIm@xmanrui/dsh-im把十一种 IM 渠道和公网 AI Office 接入本机 DeepSeek Harness。 Connect eleven IM channels and a public AI Office to a local DeepSeek Harness.Pocketdsh-pocketPut DeepSeek Harness in your pocket: one package, one settings page, and scan a QR code on your phone to access DSH on your computer in sync (LAN + public network, real-time screen mirroring).DSCODE@toddzheng024/dscode-bundleA complete DeepSeek coding agent with persistent shell, Ultra collaboration and automatic permission review.

README

dsh-feishucard — DSH ↔ Feishu Streaming Card Bridge

把飞书(Lark)机器人接入 DeepSeek Harness 的 Agent 会话——完全自研(非 fork)。官方 SDK 长连接收发(无需公网 IP/域名/隧道)、每聊天独立专属会话、/new /switch /list /help 命令、处理中表情回执,以及流式回复卡片:过程话语内联 + 工具调用折叠面板 + 限流/退避/熔断/文本兜底。

A self-developed (not a fork) bridge between Feishu (Lark) chats and DeepSeek Harness agent sessions: official-SDK long connection (no public URL needed), dedicated per-chat sessions, /new /switch /list /help commands, a typing reaction, and a streaming reply card — inline agent notes, collapsible tool-call panels with status symbols, and rate-limit / backoff / circuit-breaker / plain-text fallback reliability.

单包即用:Host 插件(桥接逻辑)+ helper 子进程(长连接)+ bundle 补丁(自动注册)。One package, three pieces: host plugin, long-connection helper subprocess, and an auto-registered bundle patch.

独立自研,不依赖任何第三方 DSH 飞书插件。配置独立存放于 ~/.dsh-feishucard/;检测到旧生态路径(~/.cc-connect/)有配置时启动自动迁移一次。不要与其他 DSH 飞书插件同时安装(同一飞书 App 的 WS 长连接互踢)。 Fully independent. Config lives in ~/.dsh-feishucard/; a legacy config found at ~/.cc-connect/ is auto-migrated once on boot. Do not install alongside other DSH Feishu plugins (two WS long connections on one app kick each other).

⚠️ Windows 开发陷阱(2026-08-15 实测):本包以 file: 依赖安装后,DSH profile 的 node_modules/dsh-feishucard/ 是实体副本而非软链——改源文件后 dsh 仍加载旧副本,改动"重启也不生效"。改代码后必须同步副本:cp index.js helper.cjs <profile>/node_modules/dsh-feishucard/(或重新 dsh plugin --profile web add dsh-feishucard),再重启 dsh。排查"改了没生效"先 md5sum 对比源与副本。

⚠️ 重启 dsh web 必须走带 key 的启动器(2026-09-08 事故教训):部署机上 DEEPSEEK_API_KEY 通常放在用户环境变量(Windows 注册表 HKCU\Environment)——它不在 dsh 凭据文件里、dsh 也没有 .env 层去读它。裸 node <dsh包>/lib/bin.js web 启动 = 进程没有 key = 所有 LLM 调用失败 = 飞书全部空白回复。需要重启时,请通过你本机的 dsh 启动脚本/计划任务(会先注入用户环境变量再拉起 dsh);不要 kill 进程后用裸 node 拉起。排查"为什么空白回复"先看进程环境里有没有 DEEPSEEK_API_KEY。

⚠️ session 事件 API 跨版本差异(2026-09-14 事故教训):DSH **0.1.0-rc.5(公开版)**暴露的是 agent.session.events(数组,下标=seq);0.1.2-rc.1(内含 dev 版)把它废弃为 agent.session.snapshotEvents()。两者不通用——写死任一版本都会在另一版本上炸 (0.1.0-rc.5 上写死 snapshotEvents 的症状 = 入站消息一进 runTurn 就 TypeError: snapshotEvents is not a function,机器人收消息但永不回复)。 本包统一走 sessionEvents(session) 兼容取值(有 snapshot 用 snapshot,否则退回 events), 改这块代码前先确认目标版本的真实 API(以部署机上实际运行的那版为准,不是 dev 仓库)。

功能 / Features

  • 长连接收发 / Long-connection messaging:im.message.receive_v1 官方 SDK WebSocket → 注入 Agent 会话 → 交互卡片回复同一会话,全程无需公网地址。Official SDK WebSocket; no public IP, domain, or tunnel required.

  • 流式回复卡片 / Streaming reply card:

    • 收到消息即建卡「正在工作中…」,agent 干活时实时 PATCH 更新。A card appears instantly and is PATCH-updated live as the agent works.
    • 过程话语(agent 每步说的话)按事件顺序内联可见。Inline agent narration, in event order.
    • 工具调用折叠面板:🛠️ 每工具一行「状态符号 · 工具名 · 参数摘要 · 失败原因」,默认折叠。Collapsible tool-call panels: status symbol, tool name, arg summary, failure reason per line.
    • 完成 sealed:最终回复入卡、状态行消失、面板保持折叠。Sealed with the final reply; status line removed.
    • 可靠性:串行更新队列 + 400ms 限流合并 + 指数退避 + 5 次熔断 + 15s 超时 + 卡片失败自动降级纯文本。Serialized queue, 400ms coalescing, exponential backoff, 5-failure breaker, 15s timeout, text fallback.
  • 每聊天独立会话 / Dedicated per-chat sessions:每个飞书聊天专属 Agent 会话池(绝不串进 GUI 会话);首条消息自动创建;持久化 + 重启恢复(live 会话直接复用、上下文不丢);/new [名称]、/switch、/list、/plan [off]、/goal、/stop、/help。Never shares GUI sessions; auto-created on first message; live sessions are reused across restarts so context is preserved.

  • 处理中表情 / Typing reaction:消息到达加 OnIt,回复送达后撤销(reactionEmoji 可配,none 关闭)。OnIt reaction added on arrival, removed after delivery.

  • 工具 / Model tool:feishu_send(agent 主动发消息,appId 指定机器人,缺省发到最近会话)。Proactive messaging from the agent.

  • 审批卡片 / Approval card:dsh 会话的工具调用需要确认时(audit 哨兵等),飞书弹出交互卡片「✅ 允许一次 / ❌ 拒绝」按钮,点击即回决策(card.action.trigger 长连接事件);10 分钟超时自动拒绝(2026-09-16 由 3 分钟延长;卡面文案由 APPROVAL_TIMEOUT_MIN 推导,不再写死)、会话取消自动取消——避免飞书通道下审批无人应答导致会话永久挂起。Approval approval/request for plugin-owned sessions is answered via a button card; timeout auto-rejects.

  • 保活 / Keep-alive:helper 崩溃自动重启(5s 冷却防重复)+ 凭据变更自动重连 + SDK 自带重连 + 状态可观测。Crash-restart with spawn cooldown, auto-reconnect, observable connection status.

  • 多机器人 / Multi-bot:一个实例多个机器人,各自绑定工作区。One instance, many bots, one workspace each.

  • 目标模式进度卡 / Goal-round progress cards(2026-09-16,CM 拍板方案 A):目标模式(goal 模式)的续轮不经过飞书入站,过去在飞书完全看不到它在干什么。现在插件订阅 :某轮由目标轮驱动 → 自动建卡「🎯 目标模式 · 第 N 轮开始,正在工作…」,流式卡(过程话语 / 工具面板 / 表格换卡全部生效),轮结束封口写「✅ 本轮结束」。只报目标轮,其它自动回合不建卡(不刷屏)。Goal-round continuations never pass through Feishu inbound, so they used to be invisible; an hook now opens the same streaming card per goal round.

快速开始 / Quick Start

dsh plugin --profile web add dsh-feishucard
dsh web   # 重启 / restart

首次安装若提示 ERR_PNPM_IGNORED_BUILDS(pnpm ≥10 默认拦截 protobufjs 构建脚本):编辑 $DSH_HOME/profiles/web/pnpm-workspace.yaml,把 allowBuilds 下的 protobufjs 改为 true 后重跑安装命令。 If pnpm blocks protobufjs's build script, set allowBuilds.protobufjs to true in the profile's pnpm-workspace.yaml and re-run.

本地开发安装 / local install: dsh plugin --profile web add <本包目录> 或 file:<本包目录>。

配置 / Configuration

写在 ~/.dsh-feishucard/feishu.config.json(与仓库解耦 / decoupled from any repo):

{
  "bots": [
    {
      "name": "我的机器人",
      "workspace": "C:\\path\\to\\workspace",
      "appId": "cli_xxxxxxxxxxxxxxxx",
      "appSecret": "your_app_secret",
      "reactionEmoji": "OnIt"
    }
  ]
}

会话状态持久化在 ~/.dsh-feishucard/state-<appId>.json。配置支持热更新(10 秒轮询),改完无需重启。Session state persists to ~/.dsh-feishucard/state-<appId>.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_APPROVAL0(关)设 1 恢复飞书审批拦截卡片(CM 2026-09-16 拍板默认关闭,不许改回)。
FS_CONFIG_DIR~/.dsh-feishucard配置文件目录(测试用)。

per-bot 配置项 notifyGoalRounds(false 关闭该机器人的目标卡)写在 feishu.config.json 的对应 bot 里。Per-bot notifyGoalRounds: false disables goal cards for that bot only.

从旧插件迁移 / 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

架构 / Architecture

飞书开放平台 ⇄ WebSocket 长连接 ⇄ helper.cjs(官方 SDK WSClient / official SDK)
                                        ⇅ stdout JSON 行(ready/status/event/error)
                                   index.js(Host 插件,id=feishu-stream)
                                        ⇅ ctx.agents(dedicated 会话)/ fetch(卡片 API)
                                   Agent 会话(绑定配置工作区 / bound workspace)
  • 事件轮询:agent.session.events(assistant/message → note;tool/call、tool/result → 工具面板),300ms 轮询 + seal 前补扫(快速回合不丢中间过程)。300ms polling plus a seal-time catch-up scan so fast turns keep their narration.
  • 会话恢复 / session recovery:优先复用 live 会话(agents.list() 命中 → 上下文保留),其次 resume 持久化会话,最后才新建。Reuse live sessions first, then resume persisted ones, create only as a last resort.
  • 卡片 / card:POST /im/v1/messages 创建 → PATCH /im/v1/messages/{id} 更新 → sealed 终态。
  • 配置热读 / hot config:10s 轮询;helper 每机器人一个子进程,崩溃自动重启(5s 冷却)。One helper subprocess per bot, crash-restarted with a 5s cooldown.

开发 / Development

npm i                          # 安装依赖 / install deps
npm run check                  # node --check 语法检查 / syntax check
npm run smoke                  # 冒烟测试:mock DSH ctx + mock 飞书 API,跑完整回合链路

冒烟测试覆盖 / covered by the smoke suite:helper 注册、入站消息管线(会话创建/消息投递)、流式卡片(create/PATCH/schema/工具面板/状态符号/note/seal)、命令处理、链路稳定性。Helper registration, inbound pipeline, streaming card lifecycle, commands, end-to-end stability.

License

MIT

agent/status
复用与普通回合同一套
agent/status
  • /goal 命令 / Goal command:飞书里直接 /goal <目标> 即可让当前会话进入目标模式(透传到 harness 的 command-goal,pause/resume/clear/edit <新目标> 子命令同样可用;无参数 = 查看状态)。命令注册表不可用时兜底直连 goals 服务创建目标。/goal <objective> starts goal mode for that chat's session from Feishu; subcommands pass through to the harness command.

  • /switch 会话/工作区切换 / Session & workspace picker(2026-09-16):无参数 /switch 发一张卡片,分三组列出可切换目标 —— ① 本聊天的会话 ② 本工作区的其它会话(含 GUI 里开的)③ 其它工作区;每行「接管 / 新建」两个按钮,点一下即切。🟡 运行中的会话只给"新建"(同一会话被两处同时驱动会写坏历史)。序号从本聊天会话开始连续编号,/switch <序号>、/switch <序号> new 为文字兜底。会话名优先用 session/title,其次首条用户消息摘要(仅对 <4MB 日志读)。/switch with no argument posts a picker card grouping this chat's sessions, this workspace's other sessions (including GUI ones), and other workspaces; each row offers takeover/new buttons.

  • 文件收件 / File inbox(2026-09-09):飞书文件/图片/语音消息不再被静默丢弃——自动下载到 ileInbox(配置项,缺省 /downloaded_files),并向会话注入「收到文件+本地路径」,agent 可直接读取。Inbound Feishu file/image/audio messages are downloaded to ileInbox and surfaced to the agent with a local path.