(n: number)
| 1015 | ]; |
| 1016 | const ctx = contextUsage ?? sessionStats.contextUsage; |
| 1017 | const formatCompact = (n: number) => n >= 1_000_000 ? `${(n / 1_000_000).toFixed(1)}M` : n >= 1000 ? `${(n / 1000).toFixed(0)}k` : String(n); |
| 1018 | const extraTokenRows = [ |
| 1019 | ...(sessionStats.cost > 0 ? [["Cost", `$${sessionStats.cost.toFixed(4)}`]] : []), |
| 1020 | ...(ctx?.contextWindow ? [["Context", `${ctx.percent !== null ? `${ctx.percent.toFixed(1)}%` : "?"} / ${formatCompact(ctx.contextWindow)}`]] : []), |