# Add cost/token chart metric and run-out panel token · lucenx/codexbar-plasma

[View on GitCafe](https://git.cafe/lucenx/codexbar-plasma/commit/4a5741cf7aae26caf0ec0f5441744aa7ed73a986)

Repository: [lucenx/codexbar-plasma](https://git.cafe/lucenx/codexbar-plasma)

Visibility: public

Requested revision: 4a5741cf7aae26caf0ec0f5441744aa7ed73a986

Requested commit: 4a5741cf7aae26caf0ec0f5441744aa7ed73a986

Commit: 4a5741cf7aae26caf0ec0f5441744aa7ed73a986

Tree: ca74ba4b810c784430ee5426cff6c72e6a3339dd

Author: Simone

Committer: Simone

## Message

```
Add cost/token chart metric and run-out panel token

Re-pin the macOS parity baseline to upstream v0.50.0, probed against a
locally upgraded CLI 0.50.0. The descriptor contract is still absent
(`--descriptors` is rejected and the plain payload carries no `descriptor`
key), so provider configuration stays blocked at the frontend boundary.

Two v0.50.0 menu-side features needed no new CLI contract, because the
Linux CLI already emits their data:

- Usage & Spend gains a Cost/Tokens selector. `cost --json` already
  reports per-day tokens, and the widget already normalized them, so the
  selected metric now drives the range chart, the heatmap, and the
  per-provider bars without a second CLI call. The choice persists
  through `costHistoryMetric`.
- The panel gains a `runOut` display mode that prints the predicted
  duration only when the pace forecast reports exhaustion before the
  reset, reusing the existing `paceWarningActive`/`paceEtaText` helpers.

The Spend tab also reads `historyCoverageIsEstablished`, which had never
been consumed, so a still-filling local scan is no longer misread as low
spend. A missing flag counts as established, keeping older CLIs quiet.

Verified with `make check`, `make package`, and on the live Plasma
session: token mode rescales the bars for a zero-cost/326M-token day,
and the panel token read "Codex 45 minutes" against a popup reporting
"Runs out in 46m".

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

```

## Parents

- [23999ca3dda5ddde18c56686158f4063faddfaa1](https://git.cafe/lucenx/codexbar-plasma/commit/23999ca3dda5ddde18c56686158f4063faddfaa1?format=markdown)

[Source at this commit](https://git.cafe/lucenx/codexbar-plasma/tree/4a5741cf7aae26caf0ec0f5441744aa7ed73a986?format=markdown)
