mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-08-26 17:03:31 +00:00
* feat(menubar): expose combined multi-device usage in menubar-json (#566) The macOS menubar reads `codeburn status --format menubar-json`, which only ever reflected the local machine. Multi-device "Combined" usage existed only in the terminal `devices` command. This exposes combined + per-device usage through the menubar-json contract so the menubar can mirror the combined dashboard. - Extract the per-device summary + combined reduce that was inline in renderDevices into a reusable pure `summarizeDeviceUsage(results, window?)`. Error/unreachable devices are excluded from the combined sums (kept in perDevice); deviceCount counts all, reachableCount counts the reachable ones. renderDevices now formats from it with byte-identical output. - Add an optional `combined?: CombinedUsage` block to MenubarPayload (perDevice list + combined totals incl. calls/sessions). Absent by default. - Add `--scope local|combined` to `status` (default local). `combined` builds the local payload, pulls paired devices (pullDevices isolates per-peer failures), and attaches the summary. - Correctness guards: reject `--scope combined` with `--days` (non-contiguous, not representable over the sharing query) and with `--provider`/`--project`/ `--exclude` (the sharing query carries no filters, so peers would report unfiltered usage). Window-scope the cache-token sum to the selected period (cache lives in 365-day daily history; current carries no cache counts). TS/CLI only. The menubar Local/Combined toggle + render is a follow-up. * fix(menubar): never let combined enrichment break the base local payload The status --format menubar-json --scope combined path pulls paired devices. Wrap that best-effort enrichment in a guard so an unexpected failure (corrupt remotes store, peer I/O) can never take down the base local menubar payload — on error the local payload is still emitted with combined omitted. Add a test that a corrupt remote-devices.json still yields a valid combined (local-only) payload. --------- Co-authored-by: AgentSeal <hello@agentseal.org> |
||
|---|---|---|
| .. | ||
| approve.test.ts | ||
| host.test.ts | ||
| pairing.test.ts | ||
| sanitize.test.ts | ||
| transport.test.ts | ||