@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 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: false,
114394
+ tokens: true,
114395
114395
  cache: false,
114396
- context: false,
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
- const pctLabel = `${pct}%`;
114835
- zhParts.push(`\u4E0A\u4E0B\u6587 ${totalLabel}/${ctxLabel} (${pctLabel})`);
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
- for (const event of streamEvents) {
114926
- if (event.type === "reasoning") {
114927
- const dur = event.elapsedMs ? formatReasoningDuration(event.elapsedMs) : null;
114928
- const zhLabel = dur ? dur.zh : "\u601D\u8003";
114929
- const enLabel = dur ? dur.en : "Thought";
114930
- elements.push({
114931
- tag: "collapsible_panel",
114932
- expanded: false,
114933
- header: {
114934
- title: {
114935
- tag: "markdown",
114936
- content: `\u{1F4AD} ${enLabel}`,
114937
- i18n_content: { zh_cn: `\u{1F4AD} ${zhLabel}`, en_us: `\u{1F4AD} ${enLabel}` }
114938
- },
114939
- vertical_align: "center",
114940
- icon: { tag: "standard_icon", token: "down-small-ccm_outlined", size: "16px 16px" },
114941
- icon_position: "follow_text",
114942
- icon_expanded_angle: -180
114943
- },
114944
- border: { color: "grey", corner_radius: "5px" },
114945
- vertical_spacing: "8px",
114946
- padding: "8px 8px 8px 8px",
114947
- elements: [{ tag: "markdown", content: event.text, text_size: "notation" }]
114948
- });
114949
- } else {
114950
- const statusIcon = event.status === "complete" ? "\u2705" : "\u274C";
114951
- const dur = event.durationMs != null ? formatElapsed(event.durationMs) : "";
114952
- const zhLabel = dur ? `\u{1F527} ${event.name} (${dur})` : `\u{1F527} ${event.name}`;
114953
- const enLabel = zhLabel;
114954
- const detailLine = dur ? `${statusIcon} **${event.name}** ${dur}` : `${statusIcon} **${event.name}**`;
114955
- elements.push({
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
- border: { color: "grey", corner_radius: "5px" },
114970
- vertical_spacing: "8px",
114971
- padding: "8px 8px 8px 8px",
114972
- elements: [{ tag: "markdown", content: detailLine, text_size: "notation" }]
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",