diff options
Diffstat (limited to 'static/modules/llm.js')
| -rw-r--r-- | static/modules/llm.js | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/static/modules/llm.js b/static/modules/llm.js index 9ee28e1..1bbbcce 100644 --- a/static/modules/llm.js +++ b/static/modules/llm.js @@ -28,6 +28,7 @@ const tokens = (n) => { const CLAUDE_ICON = '<span class="brand claude"></span>'; const OPENCODE_ICON = '<span class="brand opencode"></span>'; +const AGENT_ICON = '<i class="nf brand-nf">\uf086</i>'; function section(icon, title, model) { const sec = document.createElement("section"); @@ -89,7 +90,7 @@ export default { offline(box, { icon: "/logos/claude.svg", title: "Usage dashboard is off", - detail: "Start llm-cost-dashboard and Claude and opencode usage appear here.", + detail: "Start llm-cost-dashboard and Claude, opencode and assistant usage appear here.", }); return; } @@ -108,14 +109,17 @@ export default { claude.append(gauges); box.append(claude); - const opencode = section(OPENCODE_ICON, "opencode", o.model); - const pair = document.createElement("div"); - pair.className = "lpair"; - pair.append( - stat("session", money(o.session_cost), `${tokens(o.session_tokens)} · ${o.session_calls ?? 0} calls`), - stat("total", money(o.cost), `${tokens(o.tokens)} · ${o.calls ?? 0} calls`), - ); - opencode.append(pair); - box.append(opencode); + for (const [icon, title, p] of [[OPENCODE_ICON, "opencode", o], + [AGENT_ICON, "Local Agent", state.assistant ?? {}]]) { + const sec = section(icon, title, p.model); + const pair = document.createElement("div"); + pair.className = "lpair"; + pair.append( + stat("session", money(p.session_cost), `${tokens(p.session_tokens)} · ${p.session_calls ?? 0} calls`), + stat("total", money(p.cost), `${tokens(p.tokens)} · ${p.calls ?? 0} calls`), + ); + sec.append(pair); + box.append(sec); + } }, }; |
