{#snippet chunkRow(rendered: RenderedChunk, sIdx: number)} {#if rendered.role === "user"}
{#if rendered.chunk.type === "text"}

{rendered.chunk.text}

{/if}
{:else if rendered.chunk.type === "thinking"}
{rendered.streaming ? "Thinking" : "Thoughts"} {#if rendered.streaming} {/if}

{rendered.chunk.text}

{:else if rendered.chunk.type === "tool-call" || rendered.chunk.type === "tool-result"} {@const step = currentTurnId ? stepMetrics(telemetry, currentTurnId, sIdx) : undefined} {@const toolDur = step?.toolDurationMs}
{#if rendered.chunk.type === "tool-call"}
{rendered.chunk.toolName} {#if toolDur !== undefined && toolDur > 0} {formatMs(toolDur)} {/if}
{JSON.stringify(rendered.chunk.input, null, 2)}
{:else}
{rendered.chunk.toolName} {#if toolDur !== undefined && toolDur > 0} {formatMs(toolDur)} {/if}
{rendered.chunk.content}
{/if}
{:else} {@const step = currentTurnId ? stepMetrics(telemetry, currentTurnId, sIdx) : undefined} {@const tps = step ? stepTps(step) : undefined}
{#if rendered.chunk.type === "text"} {:else if rendered.chunk.type === "error"} {:else if rendered.chunk.type === "system"}
{rendered.chunk.text}
{/if}
{/if} {/snippet}
{#each rows as { group, key, stepIdx } (key)} {#if group.kind === "single"} {@render chunkRow(group.chunk, stepIdx)} {:else} {@const step = currentTurnId ? stepMetrics(telemetry, currentTurnId, stepIdx) : undefined} {@const toolDur = step?.toolDurationMs}
    {#each group.entries as entry (entry.call.toolCallId)}
  • {entry.call.toolName} {#if toolDur !== undefined && toolDur > 0} {formatMs(toolDur)} {/if}
    {JSON.stringify(entry.call.input, null, 2)}
    {#if entry.result}
    {entry.result.content}
    {/if}
  • {/each}
{/if} {/each}