From b22003b6a86f16f3de6f77093fb94d8b89203dc2 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Tue, 10 Nov 2026 18:16:32 +0100 Subject: feat(llm): desktop-assistant usage as Local Agent The LLM usage card gets a third section, the desktop-assistant program from llm-cost-dashboard, with the same session and total stats as opencode. The per-program aggregation now takes the program. Co-Authored-By: Claude Opus 5.5 --- static/modules/llm.js | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'static/modules') 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 = ''; const OPENCODE_ICON = ''; +const AGENT_ICON = '\uf086'; 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); + } }, }; -- cgit v1.2.3