import { Gauge } from './Gauge'
import { MetricCard } from './MetricCard'
import { MemoryViz } from './MemoryViz'
import type { Metrics, MemorySamples } from '../types'
interface DashboardProps {
metrics: Metrics | null
memorySamples: MemorySamples | null
}
function formatBig(n: number): string {
if (n >= 1e9) return `${(n / 1e9).toFixed(1)}B`
if (n >= 1e6) return `${(n / 1e6).toFixed(1)}M`
if (n >= 1e3) return `${(n / 1e3).toFixed(1)}K`
return n.toString()
}
function formatLog2Cap(log2: number): string {
const exponent = Math.floor(log2 / 3.32)
return `10^${exponent}`
}
export function Dashboard({ metrics, memorySamples }: DashboardProps) {
if (!metrics) {
return (
{/* Section: Model */}
{/* Section: Capacity gauges */}
{/* Section: Theoretical capacity */}
Theoretical Capacity
2^{formatBig(model.theoretical_capacity_log2)}
≈ associations
{formatLog2Cap(model.theoretical_capacity_log2)}
{formatBig(model.n_traces)} used of ~{formatLog2Cap(model.theoretical_capacity_log2)} possible
{/* Section: Conversation state */}
{/* Section: Memory weights */}
{/* Section: Config */}
{/* Section: Long Context (hierarchical) */}
{metrics.long_context && (
🚀 Long Context
1M TOKENS
Context Usage
{((metrics.long_context.n_tokens / metrics.long_context.max_context_tokens) * 100).toFixed(1)}%
)}
{/* Memory visualization */}
{memorySamples && memorySamples.traces.length > 0 && (
Memory Activity (last {memorySamples.traces.length})
)}
)
}
function ConfigRow({ label, value }: { label: string; value: string | number }) {
return (