codeburn/desktop/package.json
Resham Joshi 8590087392 feat(desktop): scaffold Tauri 2.x tray app for Linux + Windows
Adds desktop/ with a native tray app that mirrors the macOS popover via
a shared tokens.json and the same codeburn status --format menubar-json
data source. Same security posture as the Swift app: argv-validated CLI
spawn, O_NOFOLLOW cache writes, flock on config.json, FX rate clamping
to [0.0001, 1_000_000].

Stack:
- Tauri 2.x (Rust) for tray + window lifecycle, shells out to the CLI
- React + TypeScript + Vite for the popover UI
- libayatana-appindicator on Linux, system tray on Windows
- Produces .deb / .rpm / .AppImage on ubuntu-latest, .msi on
  windows-latest. Both workflows run on free GitHub Actions minutes.

Rust modules (src-tauri/src/):
- lib.rs:    tray icon, menu events, popover toggle, state wiring
- cli.rs:    CodeburnCli with argv allowlist and bounded pipe drain
             (20 MB stdout / 256 KB stderr / 60 s wall time)
- config.rs: flock-guarded read-modify-write of ~/.config/codeburn/config.json
- fx.rs:     Frankfurter fetch with 24 h disk cache, bounds check

Frontend:
- App.tsx with agent tabs, period switcher, hero cost, activity rows,
  optimize findings CTA, footer (currency picker / refresh / Open
  Full Report). Listens for `codeburn://refresh` tray events.
- lib/payload.ts mirrors the CLI's MenubarPayload shape
- lib/currency.ts mirrors the Swift Double.asCurrency helpers
- styles.css with design tokens as CSS custom properties

CLI:
- `codeburn menubar` now platform-dispatches: macOS (.app zip),
  Linux (.AppImage into ~/.local/bin), Windows (.msi via msiexec).
  macOS behaviour preserved exactly.

Release workflow:
- .github/workflows/release-desktop-linux.yml triggers on `linux-v*`
  tags, builds all three Linux formats, uploads to GitHub Releases.

Scaffold verified:
- cargo check -> clean
- tsc --noEmit -> clean
- npm run build (CLI) -> 205 KB
- Existing test suite: 230 / 230 still pass
2026-04-17 17:53:10 -07:00

28 lines
766 B
JSON

{
"name": "codeburn-desktop",
"private": true,
"version": "0.1.0",
"description": "CodeBurn menubar / tray app for Linux and Windows. Shares design tokens with the native macOS app under mac/.",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc --noEmit && vite build",
"preview": "vite preview",
"tauri": "tauri"
},
"dependencies": {
"@tauri-apps/api": "^2.0.0",
"@tauri-apps/plugin-opener": "^2.0.0",
"@tauri-apps/plugin-shell": "^2.0.0",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"devDependencies": {
"@tauri-apps/cli": "^2.0.0",
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
"@vitejs/plugin-react": "^4.3.0",
"typescript": "^5.6.0",
"vite": "^6.0.0"
}
}