reifyui 0.15.1 → 0.15.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1671,7 +1671,9 @@ function TurnOutcome(props) {
1671
1671
  if (!turn || turn.status === "running") return null;
1672
1672
  const ms = turn.startedAt != null && turn.endedAt != null ? turn.endedAt - turn.startedAt : turn.elapsedMs;
1673
1673
  const time = ms != null && ms >= 0 ? formatElapsed(ms) : "";
1674
- const tok = turn.usage && (turn.usage.total_tokens ?? (turn.usage.input_tokens || 0) + (turn.usage.output_tokens || 0));
1674
+ const u = turn.usage || null;
1675
+ const parts = u ? ["input_tokens", "output_tokens", "cache_read_tokens", "cache_write_tokens"].map((k) => Number(u[k]) || 0) : [];
1676
+ const tok = u ? parts.some(Boolean) ? parts.reduce((a, b) => a + b, 0) : Number(u.total_tokens) || 0 : 0;
1675
1677
  const tokens = tok ? labels.tokens(formatTokens(tok)) : "";
1676
1678
  if (turn.status === "done") {
1677
1679
  if (!time && !tokens) return null;