mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-07-29 10:55:35 +00:00
- Provider filter: Models-this-period sources current.topModels (history days carry empty topModels per provider); StackedBars falls back to a cost-proportional single segment like the Swift menubar - Chart windows align to the CLI (week -7, 30days -30, all = 6 months) and zero-fill a contiguous calendar window; history.daily is sparse and both sides key local YYYY-MM-DD, so lookups are safe (verified on real CLI output) - Custom range threads into Overview panels (chart, models table) and suppresses MTD/projected and vs-last-week comparisons; Compare states that custom dates fall back to the period - usePolled clears errors per attempt and sections show a StaleBanner instead of silently rendering last-good data after a failed refresh - Cache-hit denominator matches the CLI; hero savings relabeled 'Saved by applied fixes' + new 'Saved via local models' line; formatCompact everywhere; Optimize 'Fixes' count matches the rendered list App suite 163/163 (was 147), root 1613/1613. |
||
|---|---|---|
| .. | ||
| electron | ||
| renderer | ||
| .gitignore | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.electron.json | ||
| tsconfig.json | ||
| vite.config.ts | ||
| vitest.config.ts | ||
CodeBurn Desktop
Electron desktop shell for CodeBurn's local-first usage views. M1 runs as a developer app and reads data by spawning the installed codeburn CLI; it does not run a daemon or HTTP server.
Development
npm --prefix app install
npm --prefix app run dev
Validation:
npm --prefix app run test
npm --prefix app run typecheck
CLI Dependency
The app depends on a working codeburn CLI on the local machine. Electron resolves and spawns the CLI from the main process, then sends decoded JSON through the secure preload bridge into the renderer.
This follows the menubar pattern:
contextIsolation: true,nodeIntegration: false, andsandbox: true.- Renderer code calls
window.codeburnonly throughapp/renderer/lib/ipc.ts. - Main process handlers return JSON envelopes so structured CLI errors survive IPC.
- Missing CLI, bad JSON, timeout, and nonzero exits are surfaced as honest UI states.
- The renderer never imports CodeBurn engine code from
src/; the data contract is spawn CLI, decode JSON, poll.
Data Contract
Current bridge calls:
- Overview:
codeburn status --format menubar-json --period <period> [--provider <provider>] - Plans:
codeburn status --format json --period <period> - Models:
codeburn models --format json --period <period> [--provider <provider>] [--by-task] - Optimize:
codeburn yield --format json --period <period> - Spend flow:
codeburn spend --format flow-json --period <period> [--provider <provider>] - Devices:
codeburn devices --format json --period <period> - Device scan:
codeburn devices scan --format json - Share status:
codeburn share status --format json - Identity:
codeburn identity --format json
Supported M1 periods are today, week, 30days, month, and all. Provider filtering is passed through where the CLI command supports it.
Sections
- Overview: daily spend, spend stats, waste summary, and expensive sessions from
menubar-json. - Spend: project/activity/tool/MCP/subagent lenses plus model-to-project flow.
- Optimize: waste findings from
menubar-jsonand reverted/abandoned yield data. - Models: model and task tables from
models --format json. - Plans: plan pacing from
status --format json. - Settings: device identity, nearby scan results, paired-device usage, and M2 visual affordances.
M2 Backlog
- Deliver a self-contained app that bundles the CodeBurn engine and auto-updates itself with Electron
autoUpdater. - Ship end-user installs via
.dmgandinstall.sh; end users should not need npm. - Keep npm as a separate CLI-user channel at the same version as the desktop app.
- Add
electron-builderpackaging plus macOS code signing and notarization. - Add a
codeburn desktoplauncher subcommand. - Implement in-app pairing, approve, pull, and visibility mutations currently shown as M2 affordances.
- Build the Models Compare sheet.
- Add light theme support.
- Expand
codeburn optimize --format jsonwith evidence and fix commands so Optimize can show richer actionable fixes.