{statusLabel(status)} {model} {fmtTokens(tokens)} tok {fmtCost(costUsd)} {#if status === 'running' && onStop} {/if}
{#each messages as msg, idx (msg.id)} {@const isFirst = idx === 0} {@const isLast = idx === messages.length - 1}
{#if msg.role === 'user'}
{msg.content}
{:else if msg.role === 'assistant'}
{#if !isFirst}
{/if}
{#if !isLast}
{/if}
{msg.content}
{:else if msg.role === 'thinking'}
{#if !isFirst}
{/if}
{#if !isLast}
{/if}
{msg.content}
{:else if msg.role === 'system'}
{#if !isFirst}
{/if}
{#if !isLast}
{/if}
{msg.content}
{:else if msg.role === 'tool-call'}
{#if !isFirst}
{/if}
{#if !isLast}
{/if}
{msg.toolName ?? 'Tool'} {#if msg.toolPath} {msg.toolPath} {/if}
input {msg.content}
{#if !expandedTools.has(msg.id)}
{/if}
{#if expandedTools.has(msg.id)} {/if}
{:else if msg.role === 'tool-result'}
{#if !isFirst}
{/if}
{#if !isLast}
{/if}
result {msg.content}
{/if}
{/each}
(promptText = v)} />