@springbrand/message-panel 0.2.0-alpha.43 → 0.2.0-alpha.44

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.
@@ -709,11 +709,11 @@ export function CloudOsChatMessages({
709
709
 
710
710
  const entryIsActive =
711
711
  isActive && entryIndex === entries.length - 1;
712
- const finalTextBlocks = entryIsActive
712
+ const visibleTextBlocks = entryIsActive
713
713
  ? []
714
714
  : entry.blocks.filter(
715
715
  (block): block is Extract<AssistantBlock, { kind: "text" }> =>
716
- block.kind === "text" && block.final,
716
+ block.kind === "text" && (block.final || block.substantive),
717
717
  );
718
718
  const actionResultBlocks = entry.blocks.filter(
719
719
  (block): block is Extract<AssistantBlock, { kind: "actionPresentation" }> =>
@@ -730,9 +730,13 @@ export function CloudOsChatMessages({
730
730
  block.kind !== "image" &&
731
731
  block.kind !== "file" &&
732
732
  block.kind !== "actionPresentation" &&
733
- !(block.kind === "text" && block.final && !entryIsActive),
733
+ !(
734
+ block.kind === "text" &&
735
+ (block.final || block.substantive) &&
736
+ !entryIsActive
737
+ ),
734
738
  );
735
- const hasNarrative = finalTextBlocks.length > 0;
739
+ const hasNarrative = visibleTextBlocks.length > 0;
736
740
  const insufficientFailures = entry.blocks.filter(
737
741
  (block) => block.kind === "actionPresentation" &&
738
742
  block.presentation.state === "failed" &&
@@ -906,7 +910,7 @@ export function CloudOsChatMessages({
906
910
  </div>
907
911
  )}
908
912
 
909
- {(finalMediaBlocks.length > 0 || finalTextBlocks.length > 0) && (
913
+ {(finalMediaBlocks.length > 0 || visibleTextBlocks.length > 0) && (
910
914
  <div data-final-message="" className="space-y-4">
911
915
  {finalMediaBlocks.map((block) => {
912
916
  if (block.kind === "image") {
@@ -940,7 +944,7 @@ export function CloudOsChatMessages({
940
944
  </Fragment>
941
945
  );
942
946
  })}
943
- {finalTextBlocks.map((block) => (
947
+ {visibleTextBlocks.map((block) => (
944
948
  <div key={block.key} className="cos-markdown px-1.5 text-[14px] leading-[22px] tracking-[-0.25px] text-kumo-default">
945
949
  <MarkdownMessage
946
950
  message={block.text}
@@ -78,7 +78,13 @@ export type AssistantBlock =
78
78
  text: string;
79
79
  running: boolean;
80
80
  }
81
- | { kind: "text"; key: string; text: string; final: boolean }
81
+ | {
82
+ kind: "text";
83
+ key: string;
84
+ text: string;
85
+ final: boolean;
86
+ substantive: boolean;
87
+ }
82
88
  | { kind: "toolGroup"; key: string; group: ToolCallGroup }
83
89
  | { kind: "plan"; key: string; steps: PlanStep[]; running: boolean }
84
90
  // 答案就在 call.output 里(`ask_user` 是 client-settled tool,用户点选后
@@ -421,7 +427,13 @@ function assistantBlocks(
421
427
  const text = String(record.text ?? "").trim();
422
428
  if (!text) return;
423
429
  flush();
424
- blocks.push({ kind: "text", key, text, final: false });
430
+ blocks.push({
431
+ kind: "text",
432
+ key,
433
+ text,
434
+ final: false,
435
+ substantive: Array.from(text).length > 400,
436
+ });
425
437
  return;
426
438
  }
427
439
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@springbrand/message-panel",
3
- "version": "0.2.0-alpha.43",
3
+ "version": "0.2.0-alpha.44",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src",