Tools were only visible after tool_execution_end because the UI relied solely on toolResult messages (created at tool_execution_start, ~8ms before end). Now MessageList detects toolCall blocks in the streaming assistant message and renders them as "running" ToolCallItems immediately. Once a real toolResult message arrives, the synthetic one is replaced. - Add resolvedToolCallIds set to deduplicate assistant vs toolResult renders - Extract getTextContent to shared utils to avoid duplication - Wrap MessageList and ToolCallItem in memo for performance - Add accessible region/tabIndex to expanded result panel Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
15 lines
477 B
TypeScript
15 lines
477 B
TypeScript
import { clsx, type ClassValue } from "clsx"
|
|
import { twMerge } from "tailwind-merge"
|
|
import type { ContentBlock } from "@multica/sdk"
|
|
|
|
export function cn(...inputs: ClassValue[]) {
|
|
return twMerge(clsx(inputs))
|
|
}
|
|
|
|
/** Extract concatenated plain text from a ContentBlock array */
|
|
export function getTextContent(blocks: ContentBlock[]): string {
|
|
return blocks
|
|
.filter((b): b is { type: "text"; text: string } => b.type === "text")
|
|
.map((b) => b.text)
|
|
.join("")
|
|
}
|