diff --git a/src/components/ChatPane.tsx b/src/components/ChatPane.tsx
index 499a30d..ce4f202 100644
--- a/src/components/ChatPane.tsx
+++ b/src/components/ChatPane.tsx
@@ -244,13 +244,22 @@ export function ChatPane({ session, cfg, messages, onSend, onStop, browsePath, b
{msg.role === 'user' ? (
/, '
u: '), session.cwd) }} />
+ ) : msg.role === 'call' ? (
+
) : msg.role === 'tool' ? (
-
+
+ ) : msg.role === 'reasoning' ? (
+ thinking
{msg.content}
+ ) : msg.role === 'error' ? (
+
{msg.content}
) : msg.role === 'info' ? (
) : (
@@ -261,7 +270,8 @@ export function ChatPane({ session, cfg, messages, onSend, onStop, browsePath, b
)}
- ))}
+ )
+ })}
{isRunning && (
@@ -361,15 +371,7 @@ function DiagramModal({ html, onClose }: { html: string; onClose: () => void })
)
}
-function formatToolContent(raw: string): { name: string; detail: string; body: string; output: string } {
- // Call is always on the first line; output follows after the newline.
- const nl = raw.indexOf("\n")
- const callLine = nl === -1 ? raw : raw.slice(0, nl)
- const output = nl === -1 ? "" : raw.slice(nl + 1).trimEnd()
- const m = callLine.match(/^(\w+)\((.*)\)$/)
- if (!m) return { name: "", detail: "", body: raw, output: "" }
- const name = m[1]
- const argsRaw = m[2]
+function formatToolArgs(name: string, argsRaw: string): { detail: string; body: string } {
try {
const obj = JSON.parse(argsRaw)
let detail = ""
@@ -381,9 +383,9 @@ function formatToolContent(raw: string): { name: string; detail: string; body: s
} else {
detail = obj.steps?.[0]?.language ?? "bash"
}
- return { name, detail, body: JSON.stringify(obj, null, 2), output }
+ return { detail, body: JSON.stringify(obj, null, 2) }
} catch {
- return { name, detail: "", body: argsRaw, output }
+ return { detail: "", body: argsRaw }
}
}
@@ -429,25 +431,34 @@ function InfoMessage({ content }: { content: string }) {
shell
{cmd}
-
{output || '(no output)'}
+
)
}
-function ToolCall({ content }: { content: string }) {
- const { name, detail, body, output } = formatToolContent(content)
+function ToolOutput({ text }: { text: string }) {
+ const parts = text.split(/\n*^