@colinlu50/openclaw-lark-stream 260327.2.0 → 260327.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.en.md CHANGED
@@ -1,86 +1,131 @@
1
- English | [中文](./README.md)
2
-
3
- # OpenClaw Lark/Feishu Plugin — Stream Card Edition
4
-
5
- ![demo](./demo.gif)
6
-
7
- Based on the official [openclaw-lark](https://github.com/larksuite/openclaw-lark) plugin, with **real-time streaming output**, **reasoning display**, and **tool call indicators**.
8
-
9
- ## ✨ What's Changed
10
-
11
- The official plugin delivers LLM block results all at once after completion. This version enables:
12
-
13
- - **Real-time streaming output** — each block's content is progressively appended to the streaming card as it's generated
14
- - **Group chat streaming** — streaming output works in group chats as well
15
- - **Reasoning display** — think content from reasoning models (DeepSeek-R1, Claude 3.7, etc.) streams live, then collapses into an expandable panel
16
- - **Tool call indicators** — when the agent calls a tool, the card shows the current tool at the top in real-time, collapsing into an expandable panel on completion
17
- - **Ordered event panels** — the final card shows toggle panels in the order they occurred: think tool think tool, preserving the full reasoning flow
18
-
19
- ## 📢 News
20
-
21
- - **2026.3.27** — Compatible with OpenClaw >= 2026.3.22; added AskUserQuestion interactive tool; reasoning and tool panels now appear in chronological order; fixed card table limit error 230099
22
- - **2026.3.23** — First release with real-time streaming output and tool call indicators (for OpenClaw < 2026.3.22, use the `0322` branch)
23
-
24
- ## 📦 Installation
25
-
26
- Requires [OpenClaw](https://openclaw.ai) and Node.js (>= v22).
27
-
28
- The install script automatically detects your OpenClaw version and installs the right plugin:
29
- - OpenClaw **>= 2026.3.22** → installs the latest version (reasoning streaming, AskUserQuestion, etc.)
30
- - OpenClaw **< 2026.3.22** installs the legacy-compatible version
31
-
32
- > [!NOTE]
33
- > **Alibaba Cloud OpenClaw plans are not supported** (permission restrictions). Please use a self-hosted server.
34
-
35
- ```bash
36
- npx -y @colinlu50/openclaw-lark-stream install
37
- ```
38
-
39
- ### From source (for development)
40
-
41
- ```bash
42
- cd ~/.openclaw/extensions
43
- git clone https://github.com/ColinLu50/openclaw-lark-stream.git openclaw-lark-stream
44
- cd openclaw-lark-stream && npm install && npm run build
45
- openclaw gateway restart
46
- ```
47
-
48
- ## ⚙️ Configuration
49
-
50
- ### Streaming Output
51
-
52
- Streaming is enabled by default after installation. To disable:
53
-
54
- ```bash
55
- openclaw config set channels.feishu.streaming false
56
- openclaw config set channels.feishu.replyMode.direct card
57
- openclaw config set channels.feishu.replyMode.group card
58
- openclaw config set channels.feishu.replyMode.default card
59
- openclaw gateway restart
60
- ```
61
-
62
- To re-enable:
63
-
64
- ```bash
65
- openclaw config set channels.feishu.streaming true
66
- openclaw config set channels.feishu.replyMode.direct streaming
67
- openclaw config set channels.feishu.replyMode.group streaming
68
- openclaw config set channels.feishu.replyMode.default streaming
69
- openclaw gateway restart
70
- ```
71
-
72
- ### Card Footer
73
-
74
- Elapsed time and completion status are shown by default. To disable:
75
-
76
- ```bash
77
- openclaw config set channels.feishu.footer.elapsed false # hide elapsed time
78
- openclaw config set channels.feishu.footer.status false # hide completion status
79
- ```
80
-
81
- - **elapsed** — displays total response time (e.g. `Elapsed 3.2s`) in the card footer
82
- - **status** displays completion state (`Completed` / `Error` / `Stopped`) in the card footer
83
-
84
- ## 📄 License
85
-
86
- MIT
1
+ English | [中文](./README.md)
2
+
3
+ # OpenClaw Lark/Feishu Plugin — Stream Card Edition
4
+
5
+ ![demo](./demo.gif)
6
+
7
+ Based on the official [openclaw-lark](https://github.com/larksuite/openclaw-lark) plugin, with **real-time streaming output**, **reasoning display**, and **tool call indicators**.
8
+
9
+ ## ✨ What's Changed
10
+
11
+ The official plugin delivers LLM block results all at once after completion. This version enables:
12
+
13
+ - **Real-time streaming output** — each block's content is progressively appended to the streaming card as it's generated
14
+ - **Group chat streaming** — streaming output works in group chats as well
15
+ - **Reasoning display** — think content from reasoning models (DeepSeek-R1, Claude 3.7, etc.) streams live
16
+ - **Tool call indicators** — when the agent calls a tool, the card shows the current tool name in real-time
17
+ - **Process panel** — on completion, all reasoning blocks and tool calls are folded into a single expandable "Process" panel in chronological order
18
+ - **Token usage** — the card footer shows input/output token counts and context window usage percentage by default
19
+
20
+ ## 📢 News
21
+
22
+ - **2026.3.27 v2** — Collapsed panels merged into a single "Process" panel; footer now shows token usage and context % by default
23
+ - **2026.3.27 v1** — Compatible with OpenClaw >= 2026.3.22; added AskUserQuestion interactive tool; panels appear in chronological order; fixed card table limit error 230099
24
+ - **2026.3.23** — First release with real-time streaming output and tool call indicators (for OpenClaw < 2026.3.22, use the `0322` branch)
25
+
26
+ ## 📦 Installation
27
+
28
+ Requires [OpenClaw](https://openclaw.ai) and Node.js (>= v22).
29
+
30
+ The install script automatically detects your OpenClaw version and installs the right plugin:
31
+ - OpenClaw **>= 2026.3.22** → installs the latest version (reasoning streaming, AskUserQuestion, etc.)
32
+ - OpenClaw **< 2026.3.22** → installs the legacy-compatible version
33
+
34
+ > [!NOTE]
35
+ > **Alibaba Cloud OpenClaw plans are not supported** (permission restrictions). Please use a self-hosted server.
36
+
37
+ ```bash
38
+ npx -y @colinlu50/openclaw-lark-stream install
39
+ ```
40
+
41
+ To update an existing installation:
42
+
43
+ ```bash
44
+ npx -y @colinlu50/openclaw-lark-stream update
45
+ ```
46
+
47
+ ### From source (for development)
48
+
49
+ ```bash
50
+ cd ~/.openclaw/extensions
51
+ git clone https://github.com/ColinLu50/openclaw-lark-stream.git openclaw-lark-stream
52
+ cd openclaw-lark-stream && npm install && npm run build
53
+ openclaw gateway restart
54
+ ```
55
+
56
+ ## ⚙️ Configuration
57
+
58
+ ### Streaming Output
59
+
60
+ Streaming is enabled by default after installation. To disable:
61
+
62
+ ```bash
63
+ openclaw config set channels.feishu.streaming false
64
+ openclaw config set channels.feishu.replyMode.direct card
65
+ openclaw config set channels.feishu.replyMode.group card
66
+ openclaw config set channels.feishu.replyMode.default card
67
+ openclaw gateway restart
68
+ ```
69
+
70
+ To re-enable:
71
+
72
+ ```bash
73
+ openclaw config set channels.feishu.streaming true
74
+ openclaw config set channels.feishu.replyMode.direct streaming
75
+ openclaw config set channels.feishu.replyMode.group streaming
76
+ openclaw config set channels.feishu.replyMode.default streaming
77
+ openclaw gateway restart
78
+ ```
79
+
80
+ ### Card Footer
81
+
82
+ Each footer item can be toggled independently via `channels.feishu.footer.*`. Restart after changes:
83
+
84
+ ```bash
85
+ openclaw gateway restart
86
+ ```
87
+
88
+ | Option | Default | Description |
89
+ |--------|---------|-------------|
90
+ | `footer.status` | ✅ on | Completion state (`Completed` / `Error` / `Stopped`) |
91
+ | `footer.elapsed` | ✅ on | Total response time (e.g. `Elapsed 3.2s`) |
92
+ | `footer.tokens` | ✅ on | Input / output token counts (e.g. `↑ 19k ↓ 145`) |
93
+ | `footer.context` | ✅ on | Context window usage percentage (e.g. `1% ctx`) |
94
+ | `footer.cache` | ❌ off | Cache hit details (e.g. `Cache 18k/1k (94%)`) |
95
+ | `footer.model` | ❌ off | Model name (e.g. `claude-3-7-sonnet`) |
96
+
97
+ Default footer looks like:
98
+
99
+ ```
100
+ ✅ · 8.3s · ↑ 19k ↓ 145 · 1% ctx
101
+ ```
102
+
103
+ Enable everything:
104
+
105
+ ```bash
106
+ openclaw config set channels.feishu.footer.status true
107
+ openclaw config set channels.feishu.footer.elapsed true
108
+ openclaw config set channels.feishu.footer.tokens true
109
+ openclaw config set channels.feishu.footer.context true
110
+ openclaw config set channels.feishu.footer.cache true
111
+ openclaw config set channels.feishu.footer.model true
112
+ openclaw gateway restart
113
+ ```
114
+
115
+ With all options enabled:
116
+
117
+ ```
118
+ ✅ · 8.3s · ↑ 19k ↓ 145 · Cache 18k/1k (94%) · 1% ctx · claude-3-7-sonnet
119
+ ```
120
+
121
+ Example — hide token counts, show model name:
122
+
123
+ ```bash
124
+ openclaw config set channels.feishu.footer.tokens false
125
+ openclaw config set channels.feishu.footer.model true
126
+ openclaw gateway restart
127
+ ```
128
+
129
+ ## 📄 License
130
+
131
+ MIT
package/README.md CHANGED
@@ -1,86 +1,131 @@
1
- [English](./README.en.md) | 中文
2
-
3
- # OpenClaw 飞书插件 — 流式卡片版
4
-
5
- ![demo](./demo.gif)
6
-
7
- 基于官方 [openclaw-lark](https://github.com/larksuite/openclaw-lark) 插件,支持**实时流式输出**、**推理过程展示**和**工具调用状态**。
8
-
9
- ## ✨ 改动说明
10
-
11
- 官方插件在 LLM 生成完一个 block 后才一次性推送结果。本版本实现了:
12
-
13
- - **实时流式输出** — 每个 block 的内容在生成过程中逐步追加到流式卡片
14
- - **群聊流式输出** — 群聊中也可使用流式输出
15
- - **推理过程展示** — 推理模型(DeepSeek-R1、Claude 3.7 等)的 think 内容实时流出,完成后折叠为可展开面板
16
- - **工具调用状态** — agent 调用工具时,卡片顶部实时显示当前工具,完成后折叠为可展开面板
17
- - **有序事件面板**最终卡片按 think → tool → think → tool 的顺序展示折叠面板,完整还原推理过程
18
-
19
- ## 📢 News
20
-
21
- - **2026.3.27** — 适配 OpenClaw >= 2026.3.22;新增 AskUserQuestion 交互式提问工具;推理块与工具调用面板按发生顺序排列;修复卡片表格超限错误 230099
22
- - **2026.3.23** — 发布第一版,支持实时流式输出和工具调用状态展示(适配 OpenClaw < 2026.3.22,请切换到 `0322` 分支)
23
-
24
- ## 📦 安装
25
-
26
- 需要 [OpenClaw](https://openclaw.ai) 和 Node.js(>= v22)。
27
-
28
- 安装脚本会自动检测 OpenClaw 版本并安装对应的插件版本:
29
- - OpenClaw **>= 2026.3.22** → 自动安装最新版(支持推理流式、AskUserQuestion 等)
30
- - OpenClaw **< 2026.3.22** → 自动安装兼容旧版的插件
31
-
32
- > [!NOTE]
33
- > **不支持阿里云 OpenClaw 套餐**(权限限制),请使用自建服务器安装。
34
-
35
- ```bash
36
- npx -y @colinlu50/openclaw-lark-stream install
37
- ```
38
-
39
- ### 从源码安装(开发用)
40
-
41
- ```bash
42
- cd ~/.openclaw/extensions
43
- git clone https://github.com/ColinLu50/openclaw-lark-stream.git openclaw-lark-stream
44
- cd openclaw-lark-stream && npm install && npm run build
45
- openclaw gateway restart
46
- ```
47
-
48
- ## ⚙️ 配置
49
-
50
- ### 流式输出
51
-
52
- 安装后默认开启流式输出。如需关闭:
53
-
54
- ```bash
55
- openclaw config set channels.feishu.streaming false
56
- openclaw config set channels.feishu.replyMode.direct card
57
- openclaw config set channels.feishu.replyMode.group card
58
- openclaw config set channels.feishu.replyMode.default card
59
- openclaw gateway restart
60
- ```
61
-
62
- 重新开启:
63
-
64
- ```bash
65
- openclaw config set channels.feishu.streaming true
66
- openclaw config set channels.feishu.replyMode.direct streaming
67
- openclaw config set channels.feishu.replyMode.group streaming
68
- openclaw config set channels.feishu.replyMode.default streaming
69
- openclaw gateway restart
70
- ```
71
-
72
- ### 卡片底栏
73
-
74
- 默认显示耗时和完成状态,如需关闭:
75
-
76
- ```bash
77
- openclaw config set channels.feishu.footer.elapsed false # 隐藏耗时
78
- openclaw config set channels.feishu.footer.status false # 隐藏完成状态
79
- ```
80
-
81
- - **elapsed** — 卡片底栏显示总响应耗时(如 `耗时 3.2s`)
82
- - **status** — 卡片底栏显示完成状态(`已完成` / `出错` / `已停止`)
83
-
84
- ## 📄 许可证
85
-
86
- MIT
1
+ [English](./README.en.md) | 中文
2
+
3
+ # OpenClaw 飞书插件 — 流式卡片版
4
+
5
+ ![demo](./demo.gif)
6
+
7
+ 基于官方 [openclaw-lark](https://github.com/larksuite/openclaw-lark) 插件,支持**实时流式输出**、**推理过程展示**和**工具调用状态**。
8
+
9
+ ## ✨ 改动说明
10
+
11
+ 官方插件在 LLM 生成完一个 block 后才一次性推送结果。本版本实现了:
12
+
13
+ - **实时流式输出** — 每个 block 的内容在生成过程中逐步追加到流式卡片
14
+ - **群聊流式输出** — 群聊中也可使用流式输出
15
+ - **推理过程展示** — 推理模型(DeepSeek-R1、Claude 3.7 等)的 think 内容实时流出
16
+ - **工具调用状态** — agent 调用工具时,卡片顶部实时显示当前工具名称
17
+ - **思考过程面板**完成后,所有推理块和工具调用按发生顺序折叠进一个「思考过程」可展开面板
18
+ - **Token 用量展示** — 卡片底部默认显示 input/output token 数和 context 使用百分比
19
+
20
+ ## 📢 News
21
+
22
+ - **2026.3.27 v2** — 折叠面板合并为单个「思考过程」;底栏默认显示 token 用量和 context 使用率
23
+ - **2026.3.27 v1** — 适配 OpenClaw >= 2026.3.22;新增 AskUserQuestion 交互式提问工具;推理块与工具调用面板按发生顺序排列;修复卡片表格超限错误 230099
24
+ - **2026.3.23** — 发布第一版,支持实时流式输出和工具调用状态展示(适配 OpenClaw < 2026.3.22,请切换到 `0322` 分支)
25
+
26
+ ## 📦 安装
27
+
28
+ 需要 [OpenClaw](https://openclaw.ai) 和 Node.js(>= v22)。
29
+
30
+ 安装脚本会自动检测 OpenClaw 版本并安装对应的插件版本:
31
+ - OpenClaw **>= 2026.3.22** → 自动安装最新版(支持推理流式、AskUserQuestion 等)
32
+ - OpenClaw **< 2026.3.22** → 自动安装兼容旧版的插件
33
+
34
+ > [!NOTE]
35
+ > **不支持阿里云 OpenClaw 套餐**(权限限制),请使用自建服务器安装。
36
+
37
+ ```bash
38
+ npx -y @colinlu50/openclaw-lark-stream install
39
+ ```
40
+
41
+ 已安装后更新:
42
+
43
+ ```bash
44
+ npx -y @colinlu50/openclaw-lark-stream update
45
+ ```
46
+
47
+ ### 从源码安装(开发用)
48
+
49
+ ```bash
50
+ cd ~/.openclaw/extensions
51
+ git clone https://github.com/ColinLu50/openclaw-lark-stream.git openclaw-lark-stream
52
+ cd openclaw-lark-stream && npm install && npm run build
53
+ openclaw gateway restart
54
+ ```
55
+
56
+ ## ⚙️ 配置
57
+
58
+ ### 流式输出
59
+
60
+ 安装后默认开启流式输出。如需关闭:
61
+
62
+ ```bash
63
+ openclaw config set channels.feishu.streaming false
64
+ openclaw config set channels.feishu.replyMode.direct card
65
+ openclaw config set channels.feishu.replyMode.group card
66
+ openclaw config set channels.feishu.replyMode.default card
67
+ openclaw gateway restart
68
+ ```
69
+
70
+ 重新开启:
71
+
72
+ ```bash
73
+ openclaw config set channels.feishu.streaming true
74
+ openclaw config set channels.feishu.replyMode.direct streaming
75
+ openclaw config set channels.feishu.replyMode.group streaming
76
+ openclaw config set channels.feishu.replyMode.default streaming
77
+ openclaw gateway restart
78
+ ```
79
+
80
+ ### 卡片底栏
81
+
82
+ 底栏各项均可通过 `channels.feishu.footer.*` 独立开关,修改后重启生效:
83
+
84
+ ```bash
85
+ openclaw gateway restart
86
+ ```
87
+
88
+ | 配置项 | 默认 | 说明 |
89
+ |--------|------|------|
90
+ | `footer.status` | ✅ 开 | 完成状态(`已完成` / `出错` / `已停止`) |
91
+ | `footer.elapsed` | ✅ 开 | 总响应耗时(如 `耗时 3.2s`) |
92
+ | `footer.tokens` | ✅ 开 | 本次 input / output token 数(如 `↑ 19k ↓ 145`) |
93
+ | `footer.context` | ✅ 开 | context window 使用百分比(如 `1% ctx`) |
94
+ | `footer.cache` | ❌ 关 | 缓存命中详情(如 `缓存 18k/1k (94%)`) |
95
+ | `footer.model` | ❌ 关 | 模型名称(如 `claude-3-7-sonnet`) |
96
+
97
+ 默认底栏效果:
98
+
99
+ ```
100
+ ✅ · 8.3s · ↑ 19k ↓ 145 · 1% ctx
101
+ ```
102
+
103
+ 全部开启:
104
+
105
+ ```bash
106
+ openclaw config set channels.feishu.footer.status true
107
+ openclaw config set channels.feishu.footer.elapsed true
108
+ openclaw config set channels.feishu.footer.tokens true
109
+ openclaw config set channels.feishu.footer.context true
110
+ openclaw config set channels.feishu.footer.cache true
111
+ openclaw config set channels.feishu.footer.model true
112
+ openclaw gateway restart
113
+ ```
114
+
115
+ 全部开启后效果:
116
+
117
+ ```
118
+ ✅ · 8.3s · ↑ 19k ↓ 145 · 缓存 18k/1k (94%) · 1% ctx · claude-3-7-sonnet
119
+ ```
120
+
121
+ 示例 — 关闭 token 展示,开启模型名称:
122
+
123
+ ```bash
124
+ openclaw config set channels.feishu.footer.tokens false
125
+ openclaw config set channels.feishu.footer.model true
126
+ openclaw gateway restart
127
+ ```
128
+
129
+ ## 📄 许可证
130
+
131
+ MIT
package/dist/index.js CHANGED
@@ -114785,20 +114785,20 @@ function formatFooterRuntimeSegments(params) {
114785
114785
  const enParts = [];
114786
114786
  if (footer?.status) {
114787
114787
  if (isError) {
114788
- zhParts.push("\u51FA\u9519");
114789
- enParts.push("Error");
114788
+ zhParts.push("\u274C");
114789
+ enParts.push("\u274C");
114790
114790
  } else if (isAborted) {
114791
- zhParts.push("\u5DF2\u505C\u6B62");
114792
- enParts.push("Stopped");
114791
+ zhParts.push("\u23F9");
114792
+ enParts.push("\u23F9");
114793
114793
  } else {
114794
- zhParts.push("\u5DF2\u5B8C\u6210");
114795
- enParts.push("Completed");
114794
+ zhParts.push("\u2705");
114795
+ enParts.push("\u2705");
114796
114796
  }
114797
114797
  }
114798
114798
  if (footer?.elapsed && elapsedMs != null) {
114799
114799
  const d = formatElapsed(elapsedMs);
114800
- zhParts.push(`\u8017\u65F6 ${d}`);
114801
- enParts.push(`Elapsed ${d}`);
114800
+ zhParts.push(d);
114801
+ enParts.push(d);
114802
114802
  }
114803
114803
  if (footer?.tokens && metrics) {
114804
114804
  const inTokens = typeof metrics.inputTokens === "number" ? Math.max(0, metrics.inputTokens) : void 0;