Skip to content

feat(io.github.muzimu217.usage-dashboard): add a PI-Desktop-native usage dashboard 0.1.0 - #53

Merged
vastsa merged 1 commit into
vastsa:mainfrom
muzimu217:feat/usage-dashboard
Sep 19, 2026
Merged

vastsa merged 1 commit into
vastsa:mainfrom
muzimu217:feat/usage-dashboard

Conversation

@muzimu217

Copy link
Copy Markdown
Contributor

Summary

A PI-Desktop-native usage dashboard panel, built entirely on the formal
read-only usage facts surface (pi.usage.listTurns, host PR
vastsa/PI-Desktop#503). No message bodies, no direct database access, no
write path.

  • Metrics row: total tokens (input+output), turn count, session count,
    peak day
  • Activity heatmap: 365-day GitHub-style weekly grid, month axis, legend,
    today outline
  • Model donut (top 6 + other) and per-day trend (total area +
    toggleable per-model lines)
  • Top sessions (title + 8-char id + tokens bar + relative time)
  • Diagnostics row: cache-read/write and reasoning counters, kept out of
    the headline totals (headline = input+output, matching the host's own
    convention)
  • sr-only data tables, aria labels, empty state, loading skeleton, light and
    dark themes, en/zh-CN throughout

Data flow

Plugin process pulls the full history through the keyset-paginated API
(365-day windows stepping backward until an empty window, turnId dedup
across seams, 8-window ceiling), aggregates into a fact cube, and publishes
it to plugin settings; the read-only panel bridge renders it. Scan state is
published alongside so the panel can show progress and an explicit
"host does not provide the usage surface" state on older hosts.

Dependencies and rollout

  • Requires the host usage facts surface (PI-Desktop #503). Effective once
    that host change ships
    ; on older hosts the panel shows the explicit
    unsupported state rather than an empty board.
  • Intended to land together with feat(pi.token-insights): read PI-Desktop turns through the formal usage API #51 (token-insights switching to the
    same contract): one adds the facts surface's first-party consumer, the
    other adds a second consumer proving the surface is sufficient for a
    full dashboard.

Tests

  • 10/10 plugin tests (manifest contract, aggregate math, window walk,
    fallback state, render hooks), full repo suite green, security audit
    passed, catalog + .piplug generated via the standard scripts

…age dashboard 0.1.0

A local usage dashboard panel built entirely on the formal
pi.usage.listTurns contract (PI-Desktop PR #503): no message bodies, no
direct database access, no write path. Requires the host build with the
usage facts surface.

- lib/aggregate.js: pure aggregation (headline tokens are input+output;
  cache/reasoning stay in a separate diagnostics row; local-day daily
  buckets, model share, top sessions, streaks)
- main.js: pulls the full history through the keyset-paginated API in
  365-day windows (walking backward until an empty window), publishes the
  cube to plugin settings for the read-only panel bridge
- renderer: self-contained panel (own light/dark tokens, no host design
  tokens) with metric cards, a GitHub-style activity heatmap, model donut,
  per-day trend with toggleable per-model lines, top sessions, sr-only
  data tables, and a provenance footnote
- en/zh-CN throughout; usage.read is the only data permission
@vercel

vercel Bot commented Sep 18, 2026

Copy link
Copy Markdown

@muzimu217 is attempting to deploy a commit to the vastsa's projects Team on Vercel.

A member of the Team first needs to authorize it.

@vastsa
vastsa merged commit 3b52b82 into vastsa:main Sep 19, 2026
1 of 2 checks passed
@vastsa

vastsa commented Sep 19, 2026

Copy link
Copy Markdown
Owner

Merged into main (merge commit 3b52b82).

Review: principle is sound. Read-only dashboard on pi.usage.listTurns; permissions ui.panel + usage.read; no fs/net/shell; panel uses textContent/createElement and CSP connect-src none.

catalog.json conflicted with main and was rebuilt. tests/panel-chrome.test.mjs expected 20 panel plugins; current tree has 19 (this plugin included), so the count was corrected in 09c832f.

Not on https://plugins.aiuo.net yet — merge here does not publish to the live center.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants