|
688 | 688 | .turn-row:hover { border-color: var(--accent); } |
689 | 689 | .turn-row.role-user { border-left: 3px solid #4a9eff; } |
690 | 690 | .turn-row.role-assistant { border-left: 3px solid var(--accent); } |
| 691 | + .turn-row.role-tool-result { border-left: 3px solid #f59e0b; } |
691 | 692 | .turn-row-header { |
692 | 693 | display: flex; |
693 | 694 | align-items: center; |
|
713 | 714 | } |
714 | 715 | .role-badge.user { background: rgba(74,158,255,0.15); color: #4a9eff; } |
715 | 716 | .role-badge.assistant { background: rgba(0,210,255,0.15); color: var(--accent); } |
| 717 | + .role-badge.tool-result { background: rgba(245,158,11,0.15); color: #f59e0b; } |
716 | 718 | .turn-timestamp { |
717 | 719 | font-size: 11px; |
718 | 720 | color: var(--text-muted); |
@@ -1489,7 +1491,7 @@ <h3>Cost Breakdown</h3> |
1489 | 1491 | html += '<div class="turn-list">'; |
1490 | 1492 | reversed.forEach((t, idx) => { |
1491 | 1493 | const isExpanded = expandedTurns.has(t.number); |
1492 | | - const roleClass = t.role === 'user' ? 'role-user' : 'role-assistant'; |
| 1494 | + const roleClass = t.role === 'tool-result' ? 'role-tool-result' : t.role === 'user' ? 'role-user' : 'role-assistant'; |
1493 | 1495 | const durClass = durationClass(t.durationMs); |
1494 | 1496 | const tok = t.tokens || {}; |
1495 | 1497 |
|
@@ -1525,7 +1527,9 @@ <h3>Cost Breakdown</h3> |
1525 | 1527 |
|
1526 | 1528 | // Expanded content |
1527 | 1529 | html += '<div class="turn-expanded">'; |
1528 | | - const content = (t.content || []).filter(c => c.type !== 'tool_result'); |
| 1530 | + const content = t.role === 'tool-result' |
| 1531 | + ? (t.content || []) // show tool_result blocks for tool-result turns |
| 1532 | + : (t.content || []).filter(c => c.type !== 'tool_result'); |
1529 | 1533 | if (content.length === 0) { |
1530 | 1534 | html += '<div style="color:var(--text-muted);font-size:12px;">No content blocks.</div>'; |
1531 | 1535 | } |
@@ -1596,6 +1600,35 @@ <h3>Cost Breakdown</h3> |
1596 | 1600 | } |
1597 | 1601 | } |
1598 | 1602 | } |
| 1603 | + } else if (c.type === 'tool_result') { |
| 1604 | + const tr = c.toolResult; |
| 1605 | + if (tr) { |
| 1606 | + if (tr.stdout) { |
| 1607 | + const outTrunc = truncate(tr.stdout, 500); |
| 1608 | + const outKey = `tr-stdout-${blockKey}`; |
| 1609 | + const isOutExpanded = expandedOutputs.has(outKey); |
| 1610 | + html += `<div class="tcb-result-label">stdout</div>`; |
| 1611 | + html += `<div class="tcb-code tcb-stdout">${escHtml(isOutExpanded || !outTrunc.truncated ? tr.stdout : outTrunc.text)}</div>`; |
| 1612 | + if (outTrunc.truncated) { |
| 1613 | + html += `<span class="tcb-code-toggle" data-output-toggle="${outKey}">${isOutExpanded ? 'Show less' : 'Show full output'}</span>`; |
| 1614 | + } |
| 1615 | + } |
| 1616 | + if (tr.stderr) { |
| 1617 | + const errTrunc = truncate(tr.stderr, 500); |
| 1618 | + const errKey = `tr-stderr-${blockKey}`; |
| 1619 | + const isErrExpanded = expandedOutputs.has(errKey); |
| 1620 | + html += `<div class="tcb-result-label">stderr</div>`; |
| 1621 | + html += `<div class="tcb-code tcb-stderr">${escHtml(isErrExpanded || !errTrunc.truncated ? tr.stderr : errTrunc.text)}</div>`; |
| 1622 | + if (errTrunc.truncated) { |
| 1623 | + html += `<span class="tcb-code-toggle" data-output-toggle="${errKey}">${isErrExpanded ? 'Show less' : 'Show full output'}</span>`; |
| 1624 | + } |
| 1625 | + } |
| 1626 | + if (tr.interrupted) html += `<span class="interrupted-badge">interrupted</span>`; |
| 1627 | + if (tr.isImage) html += `<div style="color:var(--text-muted);font-size:11px;font-style:italic;">Image content</div>`; |
| 1628 | + if (!tr.stdout && !tr.stderr && !tr.isImage) { |
| 1629 | + html += '<div style="color:var(--text-muted);font-size:12px;">No output.</div>'; |
| 1630 | + } |
| 1631 | + } |
1599 | 1632 | } else if (c.type === 'other') { |
1600 | 1633 | html += `<div class="tcb-code">${escHtml(c.text || '')}</div>`; |
1601 | 1634 | } |
|
0 commit comments