The open source coding agent.
TypeScript
wip: refactoring tui
adamdottv8a2f370eda77
diff --git a/packages/tui/internal/components/chat/message.go b/packages/tui/internal/components/chat/message.goindex 5b91427d774..61c2c544614 100644--- a/packages/tui/internal/components/chat/message.go+++ b/packages/tui/internal/components/chat/message.go@@ -266,6 +266,14 @@ func renderToolInvocation(if finished {body = *result}++ if metadata["error"] != nil && metadata["message"] != nil {+ body = styles.BaseStyle().+ Width(outerWidth).+ Foreground(t.Error()).+ Render(metadata["message"].(string))+ }+elapsed := ""if metadata["time"] != nil {timeMap := metadata["time"].(map[string]any)@@ -345,20 +353,9 @@ func renderToolInvocation(}default:toolName := renderToolName(toolCall.ToolName)- title = style.Render(fmt.Sprintf("%s: %s %s", toolName, toolArgs, elapsed))- // return title-- // toolName := renderToolName(toolCall.ToolName)- // title = fmt.Sprintf("%s: %s", toolName, toolArgs)- // body = fmt.Sprintf("```txt\n%s\n```", truncateHeight(body, 10))- // body = toMarkdown(body, contentWidth)- }-- if metadata["error"] != nil && metadata["message"] != nil {- body = styles.BaseStyle().- Width(outerWidth).- Foreground(t.Error()).- Render(metadata["message"].(string))+ title = fmt.Sprintf("%s: %s %s", toolName, toolArgs, elapsed)+ body = truncateHeight(body, 10)+ body = renderMarkdown(body, WithFullWidth(), WithPaddingTop(1), WithPaddingBottom(1))}content := style.Render(title)@@ -368,7 +365,6 @@ func renderToolInvocation(content += "\n" + body}return content- // return styles.ForceReplaceBackgroundWithLipgloss(content, t.Background())}func renderToolName(name string) string {