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 14:18:08 -07:00
2026-06-22 03:48:08 -07:00
2026-07-02 15:00:40 -07:00
2026-07-01 11:01:50 -07:00
2026-07-02 11:38:30 -07:00
2026-07-02 14:18:08 -07:00
2026-06-19 04:27:01 -07:00
2026-06-27 17:11:13 -07:00
2026-06-20 05:04:25 -07:00
2026-06-22 19:48:50 -07:00
2026-06-22 04:18:35 -07:00
2026-06-20 05:04:25 -07:00
2026-07-02 11:38:31 -07:00
2026-07-02 11:38:31 -07:00
2026-06-30 01:50:52 -07:00
2026-06-20 05:04:25 -07:00
2026-06-03 17:14:42 -07:00
2026-06-20 05:04:25 -07:00
2026-06-27 17:11:13 -07:00
2026-07-01 11:07:32 -07:00
2026-07-01 11:07:32 -07:00
2026-06-25 08:34:44 -07:00
2026-06-03 19:06:53 -07:00
2026-06-20 05:04:25 -07:00
2026-07-01 09:45:30 -07:00
2026-07-01 09:45:30 -07:00
2026-06-20 05:04:25 -07:00
2026-06-03 20:52:44 -07:00
2026-06-19 04:27:01 -07:00
2026-06-17 21:37:18 -07:00
2026-06-20 05:04:25 -07:00
2026-06-20 05:04:25 -07:00
2026-06-23 00:15:38 -07:00
2026-06-27 17:11:13 -07:00
2026-06-27 17:11:13 -07:00
2026-06-03 19:06:53 -07:00
2026-07-01 07:33:56 -07:00
2026-06-03 19:06:53 -07:00
2026-06-21 23:07:55 -07:00
2026-06-29 15:34:06 -07:00
2026-06-03 19:06:53 -07:00
2026-06-03 19:06:53 -07:00
2026-06-10 06:02:12 -07:00
2026-06-05 01:16:13 -07:00
2026-06-22 16:21:03 -07:00
2026-07-01 23:15:12 -07:00
2026-06-08 13:32:58 -07:00
2026-07-02 13:07:16 -07:00
2026-07-02 13:07:16 -07:00
2026-06-03 19:06:53 -07:00
2026-06-04 08:00:33 -07:00
2026-06-16 20:13:13 -07:00
2026-06-16 20:13:13 -07:00
2026-07-02 14:09:35 -07:00
2026-07-02 14:09:35 -07:00
2026-06-15 12:43:08 -07:00
2026-06-19 04:27:01 -07:00
2026-06-03 19:06:53 -07:00
2026-06-19 04:27:01 -07:00
2026-06-20 05:04:25 -07:00
2026-06-05 02:38:38 -07:00
2026-07-01 11:01:50 -07:00
2026-06-21 03:53:43 -07:00
2026-06-03 01:08:09 -07:00
2026-06-22 10:26:14 -07:00
2026-06-03 19:06:53 -07:00
2026-06-19 04:27:01 -07:00
2026-06-19 22:14:57 -07:00
2026-06-21 03:53:43 -07:00
2026-07-02 11:38:33 -07:00
2026-07-02 11:38:33 -07:00
2026-06-23 16:47:38 -07:00
2026-07-01 15:39:34 -07:00
2026-06-03 20:52:44 -07:00
2026-06-30 01:23:09 -07:00
2026-06-30 01:23:09 -07:00
2026-06-19 04:27:01 -07:00
2026-06-27 20:27:09 -07:00
2026-06-03 19:06:53 -07:00
2026-06-03 19:48:40 -07:00
2026-06-03 20:52:44 -07:00
2026-06-19 04:27:01 -07:00
2026-06-03 19:06:53 -07:00
2026-06-03 20:52:44 -07:00
2026-06-25 14:37:52 -07:00
2026-06-23 16:47:38 -07:00
2026-06-19 04:27:01 -07:00
2026-06-06 07:01:48 -07:00
2026-06-19 22:14:57 -07:00
2026-06-03 19:48:40 -07:00
2026-06-03 19:06:53 -07:00
2026-06-03 19:06:53 -07:00
2026-06-03 19:06:53 -07:00
2026-06-26 00:43:55 -07:00
2026-07-02 13:44:41 -07:00
2026-06-28 21:10:28 -07:00
2026-06-28 21:10:28 -07:00
2026-07-02 12:00:58 -07:00
2026-07-02 12:00:58 -07:00
2026-06-03 20:52:44 -07:00
2026-06-22 23:42:45 -07:00
2026-06-22 23:42:45 -07:00
2026-07-01 09:30:00 -07:00
2026-06-30 23:45:02 -07:00
2026-06-29 19:29:36 -07:00
2026-06-25 08:35:44 -07:00
2026-06-25 08:35:44 -07:00
2026-06-20 23:57:37 -07:00
2026-06-21 02:15:24 -07:00
2026-06-19 01:33:13 -07:00
2026-06-20 05:04:25 -07:00
2026-06-22 11:47:52 -07:00
2026-06-22 11:47:52 -07:00
2026-06-24 23:32:52 -07:00
2026-06-27 22:02:59 -07:00
2026-06-22 03:48:08 -07:00
2026-07-02 13:44:41 -07:00
2026-07-02 13:44:41 -07:00
2026-07-02 13:44:41 -07:00
2026-06-22 15:23:43 -07:00
2026-06-25 08:34:44 -07:00
2026-06-03 19:06:53 -07:00
2026-06-29 23:12:56 -07:00
2026-06-27 19:48:50 -07:00
2026-06-22 05:52:44 -07:00
2026-06-27 23:47:21 -07:00
2026-06-22 03:57:10 -07:00
2026-07-02 11:38:34 -07:00
2026-07-02 13:30:08 -07:00
2026-06-03 22:35:28 -07:00
2026-06-20 05:04:25 -07:00
2026-07-02 11:38:34 -07:00
2026-06-29 20:24:24 -07:00
2026-06-27 20:02:33 -07:00
2026-06-30 21:59:03 -07:00
2026-07-01 07:33:56 -07:00
2026-06-19 04:27:01 -07:00
2026-06-30 18:15:10 -07:00
2026-06-25 08:34:44 -07:00
2026-07-01 23:58:55 -07:00
2026-07-01 07:33:56 -07:00
2026-06-20 05:04:25 -07:00
2026-06-21 00:22:34 -07:00
2026-06-30 13:53:01 -07:00
2026-06-22 19:48:50 -07:00
2026-06-22 23:58:38 -07:00
2026-06-25 08:34:44 -07:00
2026-06-20 05:04:25 -07:00
2026-06-20 23:43:13 -07:00
2026-06-30 01:57:09 -07:00
2026-06-19 04:27:01 -07:00
2026-06-03 17:33:16 -07:00
2026-06-22 23:58:38 -07:00
2026-06-28 12:10:10 -07:00
2026-06-30 01:57:09 -07:00
2026-07-01 10:13:33 -07:00
2026-06-03 20:52:44 -07:00
2026-06-21 03:53:43 -07:00
2026-06-21 03:53:43 -07:00
2026-06-22 11:15:46 -07:00
2026-06-22 15:23:43 -07:00
2026-06-23 12:17:04 -07:00
2026-06-23 12:17:04 -07:00
2026-06-22 11:15:46 -07:00
2026-06-22 12:07:20 -07:00
2026-06-22 12:07:20 -07:00
2026-06-19 04:27:01 -07:00
2026-06-03 20:52:44 -07:00
2026-06-03 19:06:53 -07:00
2026-06-22 11:08:25 -07:00
2026-06-03 19:06:53 -07:00
2026-06-22 15:23:43 -07:00
2026-06-26 21:31:42 -07:00
2026-06-02 23:47:32 -07:00
2026-06-25 16:31:10 -07:00
2026-06-26 21:31:42 -07:00
2026-06-22 18:21:06 -07:00
2026-06-27 20:27:09 -07:00
2026-06-24 23:32:52 -07:00
2026-06-28 12:10:10 -07:00
2026-06-19 04:27:01 -07:00
2026-06-17 03:12:16 -07:00
2026-06-22 04:39:35 -07:00
2026-06-22 04:39:35 -07:00
2026-06-29 18:32:36 -07:00
2026-06-21 03:53:43 -07:00
2026-07-01 23:01:45 -07:00
2026-06-03 20:52:44 -07:00
2026-06-03 19:06:53 -07:00
2026-06-22 23:58:38 -07:00
2026-06-22 23:58:38 -07:00
2026-06-30 14:03:50 -07:00
2026-06-30 09:46:26 -07:00
2026-06-03 20:52:44 -07:00
2026-07-01 16:43:08 -07:00
2026-06-03 19:06:53 -07:00
2026-06-25 08:34:44 -07:00
2026-06-19 23:16:19 -07:00
2026-05-27 21:31:12 -07:00
2026-07-02 12:10:13 -07:00
2026-06-19 04:27:01 -07:00
2026-06-03 19:48:40 -07:00
2026-06-03 19:06:53 -07:00
2026-06-03 20:52:44 -07:00
2026-06-28 20:11:43 -07:00
2026-06-03 20:52:44 -07:00
2026-06-21 03:53:43 -07:00
2026-07-01 09:24:50 -07:00
2026-07-02 13:38:02 -07:00
2026-07-01 07:33:56 -07:00
2026-06-19 04:27:01 -07:00
2026-06-22 19:48:50 -07:00
2026-06-28 12:10:10 -07:00
2026-06-03 19:06:53 -07:00
2026-06-19 04:27:01 -07:00
2026-06-03 20:52:44 -07:00
2026-06-03 01:08:09 -07:00
2026-06-17 21:37:18 -07:00
2026-06-28 01:17:22 -07:00
2026-06-28 01:17:22 -07:00
2026-06-03 19:06:53 -07:00
2026-06-27 19:54:22 -07:00
2026-06-03 19:06:53 -07:00
2026-06-03 19:06:53 -07:00
2026-06-03 20:52:44 -07:00
2026-06-22 19:48:50 -07:00
2026-06-22 18:21:06 -07:00
2026-06-22 03:34:15 -07:00
2026-06-20 21:23:17 -07:00
2026-06-29 18:32:36 -07:00
2026-06-27 23:37:24 -07:00
2026-06-27 23:37:24 -07:00
2026-06-27 23:08:10 -07:00
2026-06-27 23:08:10 -07:00
2026-06-22 15:23:43 -07:00
2026-06-22 15:23:43 -07:00
2026-06-30 14:42:45 -07:00
2026-06-30 23:45:00 -07:00
2026-06-19 08:06:38 -07:00
2026-06-19 08:06:38 -07:00
2026-06-03 19:06:53 -07:00
2026-06-22 03:34:16 -07:00
2026-06-22 03:34:16 -07:00
2026-06-27 22:55:40 -07:00
2026-06-28 21:10:28 -07:00
2026-06-22 19:35:26 -07:00
2026-06-26 02:45:29 -07:00
2026-06-20 05:04:25 -07:00
2026-07-01 16:43:08 -07:00
2026-06-03 19:06:53 -07:00
2026-06-20 05:04:25 -07:00
2026-06-26 02:45:29 -07:00
2026-06-26 02:45:29 -07:00
2026-06-26 02:45:29 -07:00
2026-06-29 20:24:24 -07:00
2026-06-20 05:04:25 -07:00
2026-06-22 19:48:50 -07:00
2026-06-22 11:36:20 -07:00
2026-06-17 03:29:39 -07:00
2026-06-17 03:29:39 -07:00
2026-06-25 19:35:05 -07:00
2026-06-15 02:29:08 -07:00
2026-06-20 21:02:51 -07:00
2026-07-01 15:39:33 -07:00
2026-06-25 22:19:24 -07:00
2026-07-02 11:38:33 -07:00
2026-06-03 19:06:53 -07:00
2026-06-09 18:49:02 -07:00
2026-06-21 03:53:43 -07:00
2026-06-03 19:06:53 -07:00
2026-06-03 19:06:53 -07:00
2026-07-02 11:38:34 -07:00
2026-07-02 11:38:34 -07:00
2026-06-30 10:26:23 -07:00
2026-06-30 10:26:23 -07:00
2026-06-21 16:13:54 -07:00
2026-06-19 04:27:01 -07:00
2026-06-21 03:53:43 -07:00
2026-06-26 13:51:32 -07:00
2026-06-25 19:35:47 -07:00
2026-07-01 00:28:25 -07:00
2026-06-03 20:52:44 -07:00
2026-07-01 10:45:19 -07:00
2026-06-21 03:40:56 -07:00
2026-06-20 01:52:26 -07:00
2026-06-21 03:53:43 -07:00
2026-06-03 19:06:53 -07:00
2026-06-20 18:04:02 -07:00
2026-07-01 08:10:05 -07:00
2026-07-02 11:38:34 -07:00
2026-07-02 11:38:34 -07:00
2026-06-24 23:32:52 -07:00
2026-06-24 19:05:11 -07:00
2026-07-01 00:07:42 -07:00
2026-07-01 11:07:32 -07:00
2026-06-20 10:35:40 -07:00
2026-06-30 01:57:09 -07:00
2026-07-01 11:18:57 -07:00
2026-07-02 11:38:34 -07:00
2026-07-02 13:07:16 -07:00
2026-06-21 23:07:55 -07:00
2026-06-30 00:18:04 +00:00
2026-06-19 04:27:01 -07:00
2026-06-04 16:16:50 -07:00
2026-06-30 14:03:50 -07:00
2026-06-03 19:48:40 -07:00
2026-06-03 20:52:44 -07:00
2026-07-01 10:30:45 -07:00
2026-07-01 23:44:05 -07:00
2026-06-28 00:02:24 -07:00
2026-06-28 02:04:31 -07:00
2026-06-29 15:46:35 -07:00
2026-06-27 17:56:32 -07:00
2026-07-01 16:43:08 -07:00
2026-06-25 14:37:52 -07:00
2026-06-21 22:43:34 -07:00
2026-07-02 13:51:25 -07:00
2026-07-02 13:51:25 -07:00
2026-06-03 19:06:53 -07:00
2026-06-22 19:48:50 -07:00
2026-06-21 16:13:54 -07:00
2026-07-01 18:01:17 -07:00
2026-07-01 18:01:17 -07:00
2026-06-30 13:43:28 -07:00
2026-06-25 14:37:52 -07:00
2026-06-22 18:21:06 -07:00
2026-06-03 19:06:53 -07:00
2026-06-03 19:06:53 -07:00
2026-06-13 16:30:28 -07:00
2026-06-13 16:30:28 -07:00
2026-06-22 03:34:15 -07:00
2026-06-22 03:34:15 -07:00
2026-06-30 23:45:01 -07:00
2026-06-22 18:21:06 -07:00
2026-06-22 03:34:15 -07:00
2026-06-27 15:39:01 -07:00
2026-07-02 11:38:30 -07:00
2026-06-29 23:41:51 -07:00
2026-06-28 09:09:03 -07:00
2026-06-28 09:09:03 -07:00
2026-06-30 13:12:27 -07:00
2026-06-22 19:48:50 -07:00
2026-06-19 05:31:47 -07:00
2026-06-04 12:44:43 -07:00
2026-06-30 12:21:25 -07:00
2026-06-30 12:21:25 -07:00
2026-06-30 12:21:25 -07:00
2026-07-02 11:38:30 -07:00
2026-06-28 09:09:03 -07:00
2026-06-25 20:28:38 -07:00
2026-06-28 09:09:03 -07:00
2026-06-29 01:48:27 -07:00
2026-06-09 09:16:59 -07:00
2026-06-20 10:35:40 -07:00
2026-06-19 05:31:47 -07:00
2026-07-02 14:18:08 -07:00
2026-07-01 07:33:56 -07:00
2026-06-30 12:21:25 -07:00
2026-06-30 12:21:25 -07:00
2026-06-19 04:27:01 -07:00
2026-06-03 19:06:53 -07:00
2026-06-21 21:07:20 -07:00
2026-07-01 07:33:56 -07:00
2026-06-03 19:06:53 -07:00