mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-21 09:01:20 +00:00
feat(coding-agent): show tool name instead of result content in tree selector
This commit is contained in:
parent
6b7ad0ed4b
commit
b153b528e8
1 changed files with 6 additions and 2 deletions
|
|
@ -296,11 +296,15 @@ class TreeList implements Component {
|
||||||
case "message": {
|
case "message": {
|
||||||
const msg = entry.message;
|
const msg = entry.message;
|
||||||
const role = msg.role;
|
const role = msg.role;
|
||||||
if (role === "user" || role === "assistant" || role === "toolResult") {
|
if (role === "user" || role === "assistant") {
|
||||||
const msgWithContent = msg as { content?: unknown };
|
const msgWithContent = msg as { content?: unknown };
|
||||||
const content = normalize(this.extractContent(msgWithContent.content));
|
const content = normalize(this.extractContent(msgWithContent.content));
|
||||||
const roleColor = role === "user" ? "accent" : role === "assistant" ? "success" : "muted";
|
const roleColor = role === "user" ? "accent" : "success";
|
||||||
result = theme.fg(roleColor, `${role}: `) + content;
|
result = theme.fg(roleColor, `${role}: `) + content;
|
||||||
|
} else if (role === "toolResult") {
|
||||||
|
const toolMsg = msg as { toolName?: string };
|
||||||
|
const toolName = toolMsg.toolName ?? "tool";
|
||||||
|
result = theme.fg("muted", `[${toolName}]`);
|
||||||
} else if (role === "bashExecution") {
|
} else if (role === "bashExecution") {
|
||||||
const bashMsg = msg as { command?: string };
|
const bashMsg = msg as { command?: string };
|
||||||
result = theme.fg("dim", `[bash]: ${normalize(bashMsg.command ?? "")}`);
|
result = theme.fg("dim", `[bash]: ${normalize(bashMsg.command ?? "")}`);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue