codex-barbar is a Tauri 2 desktop tray app for Windows 11 x64. The active
product surface is apps/desktop-tauri; the shared domain/backend and CLI
live in the rust/ crate codexbar.
| Area | Path | Role |
|---|---|---|
| Shared backend + CLI | rust/ (codexbar) |
App paths, settings, accounts/vault, providers (Codex App Server), tray icon pixels, diagnostics, purge |
| Desktop shell | apps/desktop-tauri/src-tauri/ (codex-barbar-desktop-tauri) |
Tauri 2 host: startup coordinator, tray, windows, IPC commands, proof harness |
| Frontend | apps/desktop-tauri/src/ |
React 18 + Vite surfaces: hidden main webview routing to TrayPanel / Settings |
Cargo workspace (root Cargo.toml): members rust and
apps/desktop-tauri/src-tauri; the default-member is the Tauri crate.
The shell depends on codexbar = { path = "../../../rust" }.
- Desktop:
apps/desktop-tauri/src-tauri/src/main.rs— fixed internal--purge-user-dataearly-exit, logging, coordinator, single-instance plugin, command registration, tray setup. Binary:codex-barbar.exe. - CLI:
rust/src/cli/— subcommands only. Binary:codexbar.exe. - Frontend bootstrap:
apps/desktop-tauri/src/App.tsxroutes by window label / surface mode (TrayPanel,Settings;mainstarts hidden).
-
Profile refresh
codexbar::core::instantiate_provider(rust/src/core/provider_factory.rs) →Provider::fetch_usage→ shellcommands/providers.rs(semaphore + timeout) →AppState.provider_cache→ events → ReactuseProviders. -
Settings
%LOCALAPPDATA%\codex-barbar\settings.jsonviaSettings::load/saveandsecure_file(DPAPI-capable). FrontendupdateSettingspatches → save →codexbar:settings-updatedevents. -
Tray
tray_bridge+tray_menu; icon pixels come from the sharedcodexbar::tray::{render_bar_icon_rgba, render_percent_icon_rgba}. -
Accounts
codexbar::accountsowns the SQLite store, DPAPI vault, isolatedCODEX_HOMEruntimes, recovery, and the App Server job. The React WebView receives only redacted DTOs. -
Diagnostics
rust/src/rolling_log.rs(5 MiB rotated, redacted, 14-day retention) andrust/src/diagnostics.rs(fixed-path redacted export with pre/post secret scans).
- Tray panel — left-click tray opens the flyout; blur dismisses it (suppressed in proof mode).
- Settings — detached window; tabs:
general,providers,notifications,menuBar,menu,usageSpend,advanced,about.
- Rust edition 2024; async via Tokio.
AppCoordinatorowns ordered startup and one-shot graceful quit.- Windows-specific: DPAPI Current User vault, DWM dark caption, tray
promotion, start-at-login (
HKCU\...\Run), WebView2, NSIS current-user install. - Validate tray/DPAPI/installer behavior on native Windows; WSL is insufficient.
V1 ships one provider (Codex via the official App Server), one desktop
binary, an NSIS setup, and a portable ZIP. Legacy providers, cookie import,
auxiliary always-on-top surfaces, telemetry, and auto-update are removed
from the compiled graph; scripts/assert-v1-boundaries.ps1 enforces the
frozen allowlist.
- BUILDING.md — build / test / release commands
- RELEASING.md — release workflow and artifacts
- WINDOWS_PROOF.md — Windows proof checklist
- Root AGENTS.md — agent/contributor guidelines