The plumbing already returned cacheReadTokens/cacheWriteTokens/freshInputTokens
at every scope of AgentUsageSeries, but the focused view rendered only the four
top-level stats and never surfaced them. Add an Input-breakdown subsection to the
totals card (Cache read / Cache write / Fresh input) gated on any known cache
value, and a compact per-model breakdown line. Fields follow the existing
unknown-not-zero semantics: absent subsets are omitted, a known-but-incomplete
value shows its lower bound with a Partial marker, and a scope with no cache data
renders no subsection at all.
Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Adds the agent-usage UI feature on top of the merged NIP-AM backend.
- `desktop/src/features/agent-usage/`: daily bars chart, 7/30-day range
tabs, focused agent view with caveats, hooks, and lib utilities. All
state is driven by the `get_agent_usage_series` Tauri command.
- Profile panel: usage ingress row + focused view wired into agent
profiles; gated on owner-scoped visibility (`viewerIsOwner && isBot`).
- `AgentsView`: agent-usage overview section.
- `AgentsScreen`/`ProfilePanelContext`: usage navigation state.
- `e2eBridge.ts` + `tests/helpers/bridge.ts`: `get_agent_usage_series`
mock handler + fixture types, including the M2 cache fields
(`cacheReadTokens`, `cacheWriteTokens`, `freshInputTokens`) the wire
type carries. The UI absorbs but does not display these fields.
- `tests/e2e/agent-usage.spec.ts` + `agent-usage-screenshots.spec.ts`:
Playwright coverage for loading, empty state, bars, range switching,
error/retry, focused view, caveats, and cache invalidation.
- `desktop/playwright.config.ts`: agent-usage specs added to suite.
- `desktop/package.json`: recharts dependency.
Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>