@colinlu50/openclaw-lark-stream 260327.2.2 → 260327.2.4
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 +22 -10
- package/README.md +22 -10
- package/dist/index.js +20 -13
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -87,33 +87,45 @@ openclaw gateway restart
|
|
|
87
87
|
|
|
88
88
|
| Option | Default | Description |
|
|
89
89
|
|--------|---------|-------------|
|
|
90
|
-
| `footer.verbose` | ❌ off | Verbose mode: text labels
|
|
90
|
+
| `footer.verbose` | ❌ off | Verbose mode: use full text labels instead of compact format |
|
|
91
91
|
| `footer.status` | ✅ on | Completion state |
|
|
92
92
|
| `footer.elapsed` | ✅ on | Total response time |
|
|
93
93
|
| `footer.tokens` | ✅ on | Input / output token counts |
|
|
94
94
|
| `footer.context` | ✅ on | Context window usage |
|
|
95
|
-
| `footer.cache` | ❌ off | Cache hit
|
|
96
|
-
| `footer.model` | ❌ off | Model name (
|
|
95
|
+
| `footer.cache` | ❌ off | Cache hit rate (must enable separately) |
|
|
96
|
+
| `footer.model` | ❌ off | Model name (must enable separately) |
|
|
97
97
|
|
|
98
|
-
**
|
|
98
|
+
`verbose` only controls **display format** — each item's on/off is independent:
|
|
99
99
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
| Item | Compact (default) | Verbose |
|
|
101
|
+
|------|------------------|---------|
|
|
102
|
+
| status | `✅` / `❌` / `⏹` | `Completed` / `Error` / `Stopped` |
|
|
103
|
+
| elapsed | `8.3s` | `Elapsed 8.3s` |
|
|
104
|
+
| context | `1% ctx` | `Context 19k/200k (10%)` |
|
|
105
|
+
| cache | `94% cache` | `Cache 18k/1k (94%)` |
|
|
106
|
+
| tokens / model | same | same |
|
|
103
107
|
|
|
104
|
-
|
|
108
|
+
Default footer:
|
|
105
109
|
|
|
106
110
|
```
|
|
107
|
-
|
|
111
|
+
✅ · 8.3s · ↑ 19k ↓ 145 · 1% ctx
|
|
108
112
|
```
|
|
109
113
|
|
|
110
|
-
Enable verbose mode:
|
|
114
|
+
Enable verbose mode + cache + model:
|
|
111
115
|
|
|
112
116
|
```bash
|
|
113
117
|
openclaw config set channels.feishu.footer.verbose true
|
|
118
|
+
openclaw config set channels.feishu.footer.cache true
|
|
119
|
+
openclaw config set channels.feishu.footer.model true
|
|
114
120
|
openclaw gateway restart
|
|
115
121
|
```
|
|
116
122
|
|
|
123
|
+
Result:
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
Completed · Elapsed 8.3s · ↑ 19k ↓ 145 · Cache 18k/1k (94%) · Context 19k/200k (10%) · claude-3-7-sonnet
|
|
127
|
+
```
|
|
128
|
+
|
|
117
129
|
Example — hide token counts, show model name:
|
|
118
130
|
|
|
119
131
|
```bash
|
package/README.md
CHANGED
|
@@ -87,33 +87,45 @@ openclaw gateway restart
|
|
|
87
87
|
|
|
88
88
|
| 配置项 | 默认 | 说明 |
|
|
89
89
|
|--------|------|------|
|
|
90
|
-
| `footer.verbose` | ❌ 关 |
|
|
90
|
+
| `footer.verbose` | ❌ 关 | 详细模式:各项改用文字标签展示 |
|
|
91
91
|
| `footer.status` | ✅ 开 | 完成状态 |
|
|
92
92
|
| `footer.elapsed` | ✅ 开 | 总响应耗时 |
|
|
93
93
|
| `footer.tokens` | ✅ 开 | input / output token 数 |
|
|
94
94
|
| `footer.context` | ✅ 开 | context window 使用率 |
|
|
95
|
-
| `footer.cache` | ❌ 关 |
|
|
96
|
-
| `footer.model` | ❌ 关 |
|
|
95
|
+
| `footer.cache` | ❌ 关 | 缓存命中(需单独开启) |
|
|
96
|
+
| `footer.model` | ❌ 关 | 模型名称(需单独开启) |
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
`verbose` 只控制**展示格式**,各项的开关相互独立:
|
|
99
99
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
| 项目 | 简要(默认) | 详细(verbose) |
|
|
101
|
+
|------|------------|----------------|
|
|
102
|
+
| status | `✅` / `❌` / `⏹` | `已完成` / `出错` / `已停止` |
|
|
103
|
+
| elapsed | `8.3s` | `耗时 8.3s` |
|
|
104
|
+
| context | `1% ctx` | `上下文 19k/200k (10%)` |
|
|
105
|
+
| cache | `94% cache` | `缓存 18k/1k (94%)` |
|
|
106
|
+
| tokens / model | 相同 | 相同 |
|
|
103
107
|
|
|
104
|
-
|
|
108
|
+
默认效果:
|
|
105
109
|
|
|
106
110
|
```
|
|
107
|
-
|
|
111
|
+
✅ · 8.3s · ↑ 19k ↓ 145 · 1% ctx
|
|
108
112
|
```
|
|
109
113
|
|
|
110
|
-
|
|
114
|
+
开启详细模式 + cache + model:
|
|
111
115
|
|
|
112
116
|
```bash
|
|
113
117
|
openclaw config set channels.feishu.footer.verbose true
|
|
118
|
+
openclaw config set channels.feishu.footer.cache true
|
|
119
|
+
openclaw config set channels.feishu.footer.model true
|
|
114
120
|
openclaw gateway restart
|
|
115
121
|
```
|
|
116
122
|
|
|
123
|
+
效果:
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
已完成 · 耗时 8.3s · ↑ 19k ↓ 145 · 缓存 18k/1k (94%) · 上下文 19k/200k (10%) · claude-3-7-sonnet
|
|
127
|
+
```
|
|
128
|
+
|
|
117
129
|
示例 — 关闭 token 展示,开启模型名称:
|
|
118
130
|
|
|
119
131
|
```bash
|
package/dist/index.js
CHANGED
|
@@ -114375,15 +114375,14 @@ var init_handler_registry = __esm({
|
|
|
114375
114375
|
// src/core/footer-config.ts
|
|
114376
114376
|
function resolveFooterConfig(cfg) {
|
|
114377
114377
|
if (!cfg) return { ...DEFAULT_FOOTER_CONFIG };
|
|
114378
|
-
const verbose = cfg.verbose ?? DEFAULT_FOOTER_CONFIG.verbose;
|
|
114379
114378
|
return {
|
|
114380
|
-
verbose,
|
|
114379
|
+
verbose: cfg.verbose ?? DEFAULT_FOOTER_CONFIG.verbose,
|
|
114381
114380
|
status: cfg.status ?? DEFAULT_FOOTER_CONFIG.status,
|
|
114382
114381
|
elapsed: cfg.elapsed ?? DEFAULT_FOOTER_CONFIG.elapsed,
|
|
114383
114382
|
tokens: cfg.tokens ?? DEFAULT_FOOTER_CONFIG.tokens,
|
|
114384
|
-
cache: cfg.cache ??
|
|
114383
|
+
cache: cfg.cache ?? DEFAULT_FOOTER_CONFIG.cache,
|
|
114385
114384
|
context: cfg.context ?? DEFAULT_FOOTER_CONFIG.context,
|
|
114386
|
-
model: cfg.model ??
|
|
114385
|
+
model: cfg.model ?? DEFAULT_FOOTER_CONFIG.model
|
|
114387
114386
|
};
|
|
114388
114387
|
}
|
|
114389
114388
|
var DEFAULT_FOOTER_CONFIG;
|
|
@@ -114821,10 +114820,15 @@ function formatFooterRuntimeSegments(params) {
|
|
|
114821
114820
|
if (read != null && write != null && inputVal != null) {
|
|
114822
114821
|
const total = read + write + inputVal;
|
|
114823
114822
|
const hit = total > 0 ? Math.round(read / total * 100) : 0;
|
|
114824
|
-
|
|
114825
|
-
|
|
114826
|
-
|
|
114827
|
-
|
|
114823
|
+
if (verbose) {
|
|
114824
|
+
const left = compactNumber(read);
|
|
114825
|
+
const right = compactNumber(write);
|
|
114826
|
+
zhParts.push(`\u7F13\u5B58 ${left}/${right} (${hit}%)`);
|
|
114827
|
+
enParts.push(`Cache ${left}/${right} (${hit}%)`);
|
|
114828
|
+
} else {
|
|
114829
|
+
zhParts.push(`${hit}% cache`);
|
|
114830
|
+
enParts.push(`${hit}% cache`);
|
|
114831
|
+
}
|
|
114828
114832
|
}
|
|
114829
114833
|
}
|
|
114830
114834
|
if (footer?.context && metrics) {
|
|
@@ -114947,12 +114951,14 @@ function buildCompleteCard(params) {
|
|
|
114947
114951
|
innerLines.push("");
|
|
114948
114952
|
}
|
|
114949
114953
|
}
|
|
114950
|
-
const
|
|
114954
|
+
const toolEvents = streamEvents.filter((e) => e.type === "tool");
|
|
114955
|
+
const totalToolMs = toolEvents.reduce((s, e) => s + (e.durationMs ?? 0), 0);
|
|
114951
114956
|
const totalReasonMs = streamEvents.filter((e) => e.type === "reasoning").reduce((s, e) => s + (e.elapsedMs ?? 0), 0);
|
|
114952
114957
|
const totalMs = totalToolMs + totalReasonMs;
|
|
114953
114958
|
const totalDur = totalMs > 0 ? formatElapsed(totalMs) : "";
|
|
114954
|
-
const
|
|
114955
|
-
const
|
|
114959
|
+
const toolCount = toolEvents.length;
|
|
114960
|
+
const zhHeader = toolCount > 0 ? totalDur ? `${toolCount} \u6B21\u5DE5\u5177\u8C03\u7528 (${totalDur})` : `${toolCount} \u6B21\u5DE5\u5177\u8C03\u7528` : totalDur ? `\u601D\u8003\u8FC7\u7A0B (${totalDur})` : "\u601D\u8003\u8FC7\u7A0B";
|
|
114961
|
+
const enHeader = toolCount > 0 ? totalDur ? `${toolCount} tool calls (${totalDur})` : `${toolCount} tool calls` : totalDur ? `Process (${totalDur})` : "Process";
|
|
114956
114962
|
elements.push({
|
|
114957
114963
|
tag: "collapsible_panel",
|
|
114958
114964
|
expanded: false,
|
|
@@ -115683,8 +115689,8 @@ var init_streaming_card_controller = __esm({
|
|
|
115683
115689
|
const key = this.deps.sessionKey.trim().toLowerCase();
|
|
115684
115690
|
const sessionApi = runtime2.agent?.session;
|
|
115685
115691
|
if (sessionApi?.resolveStorePath && sessionApi?.loadSessionStore) {
|
|
115686
|
-
const storePath2 = sessionApi.resolveStorePath(sessionStorePath);
|
|
115687
|
-
const store3 = sessionApi.loadSessionStore(storePath2);
|
|
115692
|
+
const storePath2 = sessionApi.resolveStorePath(sessionStorePath, { agentId: this.deps.agentId });
|
|
115693
|
+
const store3 = sessionApi.loadSessionStore(storePath2, { skipCache: true });
|
|
115688
115694
|
const entry2 = store3[key];
|
|
115689
115695
|
if (!entry2 || typeof entry2 !== "object") {
|
|
115690
115696
|
log17.debug("footer metrics lookup: session entry missing", {
|
|
@@ -116475,6 +116481,7 @@ function createFeishuReplyDispatcher(params) {
|
|
|
116475
116481
|
});
|
|
116476
116482
|
const controller = useStreamingCards ? new StreamingCardController({
|
|
116477
116483
|
cfg,
|
|
116484
|
+
agentId,
|
|
116478
116485
|
sessionKey,
|
|
116479
116486
|
accountId,
|
|
116480
116487
|
chatId,
|