{#if msg.type === 'init'}
Session started
{(msg.content as import('../../adapters/claude-messages').InitContent).model}
{:else if msg.type === 'text'}
{@const textContent = (msg.content as TextContent).text}
{@const firstLine = textContent.split('\n')[0].slice(0, 120)}
▶
{firstLine}{firstLine.length >= 120 ? '...' : ''}
{#if projectId}
{/if}
{@html renderMarkdown(textContent)}
{:else if msg.type === 'thinking'}
▶ Thinking...
{(msg.content as ThinkingContent).text}
{:else if msg.type === 'tool_call'}
{@const tc = msg.content as ToolCallContent}
{@const pairedResult = toolResultMap[tc.toolUseId]}
▶
{tc.name}
{#if pairedResult}
✓
{:else if isRunning}
⋯
{/if}
{#if pairedResult}
{@const outputStr = formatToolInput(pairedResult.output)}
{@const limit = getTruncationLimit(tc.name)}
{@const truncated = truncateByLines(outputStr, limit)}
{:else if isRunning}
⋯
Awaiting tool result
{/if}
{:else if msg.type === 'tool_result'}
{:else if msg.type === 'cost'}
{@const cost = msg.content as CostContent}
${cost.totalCostUsd.toFixed(4)}
{cost.inputTokens + cost.outputTokens} tokens
{cost.numTurns} turns
{(cost.durationMs / 1000).toFixed(1)}s
{#if cost.result}
▶
{cost.result.split('\n')[0].slice(0, 80)}{cost.result.length > 80 ? '...' : ''}
{cost.result}
{/if}
{:else if msg.type === 'error'}
{(msg.content as ErrorContent).message}
{:else if msg.type === 'status'}
{@const statusContent = msg.content as StatusContent}
{#if isHookMessage(statusContent)}
▶ ⚙ {hookDisplayName(statusContent.subtype)}
{statusContent.message || JSON.stringify(msg.content, null, 2)}
{:else}
{statusContent.message || statusContent.subtype}
{/if}
{/if}