MCPcopy Index your code
hub / github.com/ColinLu50/openclaw-lark-stream

github.com/ColinLu50/openclaw-lark-stream @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
1,057 symbols 3,151 edges 183 files 187 documented · 18%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

English | 中文

OpenClaw 飞书插件 — 流式卡片版

基于官方 openclaw-lark 插件,支持实时流式输出Agent 执行过程可视化

▲ 群中真流式输出,并显示全部执行逻辑

▲ 卡片底栏:完成状态、响应耗时、token 用量、context 使用率,均可独立开关

✨ 改动说明

官方插件在 LLM 生成完一个 block 后才一次性推送结果。本版本实现了:

  • 实时流式输出 — 每个 block 的内容在生成过程中逐步追加到飞书卡片
  • 群聊流式输出 — 群聊中也可使用流式输出
  • Agent 执行过程可视化 — 完整还原 agent 的推理与执行流程
  • 推理过程展示 — 推理模型(DeepSeek-R1、Claude 3.7 等)的 think 内容实时流出
  • 工具调用状态 — agent 调用工具时,卡片顶部实时显示当前工具名称
  • 思考过程面板 — 完成后,所有推理块和工具调用按发生顺序折叠进一个可展开面板
  • Token 用量展示 — 卡片底部默认显示 input/output token 数和 context 使用百分比

📢 News

  • 2026.3.30
  • 安装脚本自动禁用 OpenClaw 内置飞书插件,避免冲突
  • 安装后自动执行 gateway install 注册服务并健康检查
  • ⚠️ 暂不支持 OpenClaw 3.28,该版本存在兼容性问题,建议回退到 3.24 版本(预计 4.4 前支持)
  • 2026.3.27
  • 适配 OpenClaw >= 2026.3.22
  • 新增 AskUserQuestion 交互式提问工具
  • 推理块与工具调用按发生顺序合并为单个可展开面板
  • 底栏默认显示 token 用量和 context 使用百分比
  • 修复卡片表格超限错误 230099
  • 2026.3.23 — 发布第一版,支持实时流式输出和工具调用状态展示(适配 OpenClaw < 2026.3.22,请切换到 0322 分支)

📦 安装

需要 OpenClaw 和 Node.js(>= v22)。

[!WARNING] 暂不支持 OpenClaw 3.28,该版本存在兼容性问题(预计 4.4 前支持)。如已升级到 3.28,请回退到 3.24 版本后再安装: bash npm install -g openclaw@2026.3.24

安装脚本会自动检测 OpenClaw 版本并安装对应的插件版本: - OpenClaw >= 2026.3.22 → 自动安装最新版(支持推理流式、AskUserQuestion 等) - OpenClaw < 2026.3.22 → 自动安装兼容旧版的插件

[!NOTE] 不支持阿里云 OpenClaw 套餐(权限限制),请使用自建服务器安装。

npx -y @colinlu50/openclaw-lark-stream install

已安装后更新:

npx -y @colinlu50/openclaw-lark-stream update

从源码安装(开发用)

cd ~/.openclaw/extensions
git clone https://github.com/ColinLu50/openclaw-lark-stream.git openclaw-lark-stream
cd openclaw-lark-stream && npm install && npm run build
openclaw gateway restart

⚙️ 配置

流式输出

安装后默认开启流式输出。如需关闭:

openclaw config set channels.feishu.streaming false
openclaw config set channels.feishu.replyMode.direct static
openclaw config set channels.feishu.replyMode.group static
openclaw config set channels.feishu.replyMode.default static
openclaw gateway restart

重新开启:

openclaw config set channels.feishu.streaming true
openclaw config set channels.feishu.replyMode.direct streaming
openclaw config set channels.feishu.replyMode.group streaming
openclaw config set channels.feishu.replyMode.default streaming
openclaw gateway restart

卡片底栏

底栏各项均可通过 channels.feishu.footer.* 独立开关,修改后重启生效:

openclaw gateway restart
配置项 默认 说明
footer.verbose ❌ 关 详细模式:各项改用文字标签展示
footer.status ✅ 开 完成状态
footer.elapsed ✅ 开 总响应耗时
footer.tokens ✅ 开 input / output token 数
footer.context ✅ 开 context window 使用率
footer.cache ❌ 关 缓存命中(需单独开启)
footer.model ❌ 关 模型名称(需单独开启)

verbose 只控制展示格式,各项的开关相互独立:

项目 简要(默认) 详细(verbose)
status / / 已完成 / 出错 / 已停止
elapsed 8.3s 耗时 8.3s
context 1% ctx 上下文 19k/200k (10%)
cache 94% cache 缓存 18k/1k (94%)
tokens ↑ 19k ↓ 145 输入 19k 输出 145
model 相同 相同

默认效果:

✅ · 8.3s · ↑ 19k ↓ 145 · 1% ctx

开启详细模式 + cache + model:

openclaw config set channels.feishu.footer.verbose true
openclaw config set channels.feishu.footer.cache true
openclaw config set channels.feishu.footer.model true
openclaw gateway restart

效果:

已完成 · 耗时 8.3s · 输入 19k 输出 145 · 缓存 18k/1k (94%) · 上下文 19k/200k (10%) · claude-3-7-sonnet

示例 — 关闭 token 展示,开启模型名称:

openclaw config set channels.feishu.footer.tokens false
openclaw config set channels.feishu.footer.model true
openclaw gateway restart

📄 许可证

MIT

Extension points exported contracts — how you extend this code

LarkClientStatic (Interface)
Minimal structural type for LarkClient class (avoids circular import). [1 implementers]
src/core/chat-info-cache.ts
AuthBatchEntry (Interface)
缓冲中的授权请求
src/tools/auto-auth.ts
FeishuSendParams (Interface)
Typed parameters extracted from a send action.
src/messaging/outbound/actions.ts
TraceEvent (Interface)
Parsed trace event extracted from a log line.
src/commands/diagnose.ts
CardKitResponse (Interface)
* 飞书 CardKit SDK 响应的通用结构。 * SDK 的 TypeScript 类型定义不包含 code/msg 字段,但运行时实际返回。 * 使用此接口代替 `as any` 以获得类型安全的字段访问。
src/card/cardkit.ts
ActiveDispatcherEntry (Interface)
(no doc)
src/channel/chat-queue.ts
AgentIdentity (Interface)
Minimal agent identity fields used by the Feishu plugin.
src/core/agent-config.ts
QuestionContext (Interface)
Lightweight context stored while awaiting user response (no Promise / timeout).
src/tools/ask-user-question.ts

Core symbols most depended-on inside this repo

info
called by 437
src/core/lark-logger.ts
json
called by 225
src/tools/oapi/helpers.ts
invoke
called by 116
src/core/tool-client.ts
assertLarkOk
called by 106
src/core/api-error.ts
get
called by 95
src/core/token-store.ts
warn
called by 93
src/core/lark-logger.ts
set
called by 68
src/core/token-store.ts
StringEnum
called by 52
src/tools/oapi/helpers.ts

Shape

Function 670
Method 194
Interface 153
Class 40

Languages

TypeScript100%

Modules by API surface

src/messaging/converters/interactive/card-converter.ts63 symbols
src/card/streaming-card-controller.ts40 symbols
src/core/lark-client.ts29 symbols
src/messaging/outbound/media.ts26 symbols
src/core/token-store.ts23 symbols
src/commands/diagnose.ts22 symbols
src/tools/ask-user-question.ts21 symbols
src/tools/auto-auth.ts20 symbols
src/core/lark-logger.ts20 symbols
src/tools/oapi/im/message-read.ts19 symbols
src/card/builder.ts19 symbols
src/messaging/inbound/user-name-cache.ts18 symbols

For agents

$ claude mcp add openclaw-lark-stream \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page