@colinlu50/openclaw-lark-stream 260327.1.0 → 260327.2.0
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/dist/index.js +45 -56
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -114391,9 +114391,9 @@ var init_footer_config = __esm({
|
|
|
114391
114391
|
DEFAULT_FOOTER_CONFIG = {
|
|
114392
114392
|
status: true,
|
|
114393
114393
|
elapsed: true,
|
|
114394
|
-
tokens:
|
|
114394
|
+
tokens: true,
|
|
114395
114395
|
cache: false,
|
|
114396
|
-
context:
|
|
114396
|
+
context: true,
|
|
114397
114397
|
model: false
|
|
114398
114398
|
};
|
|
114399
114399
|
__name(resolveFooterConfig, "resolveFooterConfig");
|
|
@@ -114828,12 +114828,9 @@ function formatFooterRuntimeSegments(params) {
|
|
|
114828
114828
|
const total = typeof freshTotal === "number" ? Math.max(0, freshTotal) : void 0;
|
|
114829
114829
|
const ctx = typeof metrics.contextTokens === "number" ? Math.max(0, metrics.contextTokens) : void 0;
|
|
114830
114830
|
if (total != null && ctx != null) {
|
|
114831
|
-
const totalLabel = compactNumber(total);
|
|
114832
|
-
const ctxLabel = compactNumber(ctx);
|
|
114833
114831
|
const pct = ctx > 0 ? Math.round(total / ctx * 100) : 0;
|
|
114834
|
-
|
|
114835
|
-
|
|
114836
|
-
enParts.push(`Context ${totalLabel}/${ctxLabel} (${pctLabel})`);
|
|
114832
|
+
zhParts.push(`${pct}% ctx`);
|
|
114833
|
+
enParts.push(`${pct}% ctx`);
|
|
114837
114834
|
}
|
|
114838
114835
|
}
|
|
114839
114836
|
if (footer?.model && metrics?.model) {
|
|
@@ -114922,56 +114919,48 @@ ${reasoningText}`
|
|
|
114922
114919
|
function buildCompleteCard(params) {
|
|
114923
114920
|
const { text, streamEvents, elapsedMs, isError, isAborted, footer, footerMetrics } = params;
|
|
114924
114921
|
const elements = [];
|
|
114925
|
-
|
|
114926
|
-
|
|
114927
|
-
|
|
114928
|
-
|
|
114929
|
-
|
|
114930
|
-
|
|
114931
|
-
|
|
114932
|
-
|
|
114933
|
-
|
|
114934
|
-
|
|
114935
|
-
|
|
114936
|
-
|
|
114937
|
-
|
|
114938
|
-
|
|
114939
|
-
|
|
114940
|
-
|
|
114941
|
-
|
|
114942
|
-
|
|
114943
|
-
|
|
114944
|
-
|
|
114945
|
-
|
|
114946
|
-
|
|
114947
|
-
|
|
114948
|
-
|
|
114949
|
-
|
|
114950
|
-
|
|
114951
|
-
|
|
114952
|
-
|
|
114953
|
-
|
|
114954
|
-
|
|
114955
|
-
|
|
114956
|
-
tag: "collapsible_panel",
|
|
114957
|
-
expanded: false,
|
|
114958
|
-
header: {
|
|
114959
|
-
title: {
|
|
114960
|
-
tag: "markdown",
|
|
114961
|
-
content: enLabel,
|
|
114962
|
-
i18n_content: { zh_cn: zhLabel, en_us: enLabel }
|
|
114963
|
-
},
|
|
114964
|
-
vertical_align: "center",
|
|
114965
|
-
icon: { tag: "standard_icon", token: "down-small-ccm_outlined", size: "16px 16px" },
|
|
114966
|
-
icon_position: "follow_text",
|
|
114967
|
-
icon_expanded_angle: -180
|
|
114922
|
+
if (streamEvents.length > 0) {
|
|
114923
|
+
const innerLines = [];
|
|
114924
|
+
for (const event of streamEvents) {
|
|
114925
|
+
if (event.type === "reasoning") {
|
|
114926
|
+
const dur = event.elapsedMs ? formatReasoningDuration(event.elapsedMs) : null;
|
|
114927
|
+
const zhLabel = dur ? `\u{1F4AD} ${dur.zh}` : "\u{1F4AD} \u601D\u8003";
|
|
114928
|
+
const enLabel = dur ? `\u{1F4AD} ${dur.en}` : "\u{1F4AD} Thought";
|
|
114929
|
+
innerLines.push(`**${enLabel}**`);
|
|
114930
|
+
innerLines.push(event.text);
|
|
114931
|
+
innerLines.push("");
|
|
114932
|
+
} else {
|
|
114933
|
+
const statusIcon = event.status === "complete" ? "\u2705" : "\u274C";
|
|
114934
|
+
const dur = event.durationMs != null ? formatElapsed(event.durationMs) : "";
|
|
114935
|
+
innerLines.push(dur ? `${statusIcon} \u{1F527} **${event.name}** (${dur})` : `${statusIcon} \u{1F527} **${event.name}**`);
|
|
114936
|
+
innerLines.push("");
|
|
114937
|
+
}
|
|
114938
|
+
}
|
|
114939
|
+
const totalToolMs = streamEvents.filter((e) => e.type === "tool").reduce((s, e) => s + (e.durationMs ?? 0), 0);
|
|
114940
|
+
const totalReasonMs = streamEvents.filter((e) => e.type === "reasoning").reduce((s, e) => s + (e.elapsedMs ?? 0), 0);
|
|
114941
|
+
const totalMs = totalToolMs + totalReasonMs;
|
|
114942
|
+
const totalDur = totalMs > 0 ? formatElapsed(totalMs) : "";
|
|
114943
|
+
const zhHeader = totalDur ? `\u601D\u8003\u8FC7\u7A0B (${totalDur})` : "\u601D\u8003\u8FC7\u7A0B";
|
|
114944
|
+
const enHeader = totalDur ? `Process (${totalDur})` : "Process";
|
|
114945
|
+
elements.push({
|
|
114946
|
+
tag: "collapsible_panel",
|
|
114947
|
+
expanded: false,
|
|
114948
|
+
header: {
|
|
114949
|
+
title: {
|
|
114950
|
+
tag: "markdown",
|
|
114951
|
+
content: enHeader,
|
|
114952
|
+
i18n_content: { zh_cn: zhHeader, en_us: enHeader }
|
|
114968
114953
|
},
|
|
114969
|
-
|
|
114970
|
-
|
|
114971
|
-
|
|
114972
|
-
|
|
114973
|
-
}
|
|
114974
|
-
|
|
114954
|
+
vertical_align: "center",
|
|
114955
|
+
icon: { tag: "standard_icon", token: "down-small-ccm_outlined", size: "16px 16px" },
|
|
114956
|
+
icon_position: "follow_text",
|
|
114957
|
+
icon_expanded_angle: -180
|
|
114958
|
+
},
|
|
114959
|
+
border: { color: "grey", corner_radius: "5px" },
|
|
114960
|
+
vertical_spacing: "8px",
|
|
114961
|
+
padding: "8px 8px 8px 8px",
|
|
114962
|
+
elements: [{ tag: "markdown", content: innerLines.join("\n").trim(), text_size: "notation" }]
|
|
114963
|
+
});
|
|
114975
114964
|
}
|
|
114976
114965
|
elements.push({
|
|
114977
114966
|
tag: "markdown",
|