gsxdsm
765218f80f
FN-7449: include chat token usage in dashboard totals
Chat token usage now contributes to Command Center token analytics totals alongside task execution usage.
- Add durable chat token usage rows and persistence hooks for assistant and room messages.
- Aggregate chat usage into token totals, time series, provider/model groups, CSV export, and dashboard counts.
- Cover chat token persistence and analytics with core and dashboard tests.
- Document the expanded dashboard token usage behavior and add a changeset for the published package.
Files changed:
.changeset/fn-7449-chat-token-totals.md | 7 +
docs/dashboard-guide.md | 4 +-
.../core/src/__tests__/token-analytics.test.ts | 146 ++++++++++++++++++
packages/core/src/chat-store.ts | 105 +++++++++++++
packages/core/src/chat-types.ts | 37 +++++
packages/core/src/db.ts | 52 ++++++-
packages/core/src/index.ts | 3 +
packages/core/src/token-analytics.ts | 167 +++++++++++++++++----
.../__tests__/CommandCenter.test.tsx | 4 +-
.../components/command-center/areas/TokensArea.tsx | 4 +
.../src/__tests__/chat-manager-cli-send.test.ts | 40 +++++
.../dashboard/src/__tests__/chat-manager.test.ts | 100 ++++++++++++
.../src/__tests__/command-center-csv.test.ts | 2 +
packages/dashboard/src/chat.ts | 110 +++++++++++++-
packages/dashboard/src/command-center-csv.ts | 3 +
15 files changed, 745 insertions(+), 39 deletions(-)
Fusion-Task-Id: FN-7449
Fusion-Task-Lineage: f2bacbb6-93b9-4874-b431-2049981b66c1
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-02 15:00:40 -07:00
..
2026-07-02 15:00:40 -07:00
2026-07-02 15:00:40 -07:00
2026-06-30 10:30:57 -07:00
2026-06-23 12:17:04 -07:00
2026-07-02 12:34:35 -07:00
2026-06-26 14:38:12 -07:00
2026-06-27 21:39:40 -07:00
2026-06-19 04:37:04 -07:00
2026-06-25 19:57:49 -07:00
2026-06-19 04:27:01 -07:00
2026-06-15 20:05:14 -07:00
2026-06-19 04:27:01 -07:00
2026-06-18 06:25:08 -07:00