use crate::color; use crate::format; use crate::section::{RenderContext, SectionOutput}; pub fn render(ctx: &RenderContext) -> Option { if !ctx.config.sections.token_velocity.enabled { return None; } ctx.input.cost.as_ref()?; let velocity = ctx.metrics.token_velocity.unwrap_or(0.0); let raw = format!("{} tok/min", format::human_tokens(velocity as u64)); let ansi = if ctx.color_enabled { format!("{}{raw}{}", color::DIM, color::RESET) } else { raw.clone() }; Some(SectionOutput { raw, ansi }) }