mirror of
https://github.com/tiennm99/claude-code-usage-bubble.git
synced 2026-10-22 14:16:31 +00:00
Replace the WinHTTP client with a ureq agent that keeps the same Client/Response surface: status errors come back as responses, gzip, 60 s connect / 30 s receive / 120 s total timeouts, rustls with the platform verifier and a per-request User-Agent override. Environment proxies come from ureq. On Windows, when none is set, the static Internet Settings proxy is read from HKCU and parsed by a pure core module (per-scheme ProxyServer, ProxyOverride globs and <local>); bypassed hosts go through a direct agent. PAC/WPAD is not evaluated. The usage providers and credential sources compile again on every platform. Refresh keeps the Windows candidates and CREATE_NO_WINDOW; Unix spawns claude/codex from PATH plus the usual per-user install directories and reaps the child on a detached thread. An empty CODEX_HOME now counts as unset and a float expiresAt is truncated instead of ignored. Fixture tests cover the OAuth usage body, rate-limit headers (including a 429 over loopback), the ChatGPT envelope, ISO 8601 edge cases, credential JSON and proxy strings. An ignored live_poll test polls the real providers.
71 lines
1.8 KiB
TOML
71 lines
1.8 KiB
TOML
[package]
|
|
name = "claude-code-usage-bubble"
|
|
version = "0.5.0"
|
|
edition = "2021"
|
|
license = "Apache-2.0"
|
|
description = "Floating bubble showing Claude Code and Codex usage"
|
|
homepage = "https://github.com/tiennm99/claude-code-usage-bubble"
|
|
repository = "https://github.com/tiennm99/claude-code-usage-bubble"
|
|
|
|
[lib]
|
|
name = "claude_code_usage_bubble_lib"
|
|
path = "src/lib.rs"
|
|
|
|
[[bin]]
|
|
name = "claude-code-usage-bubble"
|
|
path = "src/main.rs"
|
|
|
|
[dependencies]
|
|
tauri = { version = "2", features = ["tray-icon", "macos-private-api"] }
|
|
tauri-plugin-single-instance = "2"
|
|
tauri-plugin-autostart = "2"
|
|
# rustls with the OS verifier keeps corporate roots trusted; gzip is a default.
|
|
ureq = { version = "3", features = ["platform-verifier"] }
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
dirs = "6"
|
|
log = "0.4"
|
|
simplelog = "0.12"
|
|
thiserror = "2"
|
|
tiny-skia = "0.11"
|
|
sha2 = "0.10"
|
|
self-replace = "1.5"
|
|
|
|
[target.'cfg(unix)'.dependencies]
|
|
libc = "0.2"
|
|
|
|
[target.'cfg(target_os = "linux")'.dependencies]
|
|
x11rb = "0.14"
|
|
libloading = "0.9"
|
|
|
|
[target.'cfg(windows)'.dependencies]
|
|
# Keep the major in step with the `windows` crate tauri pulls
|
|
# (`cargo tree -i windows`), so only one copy is compiled.
|
|
windows = { version = "0.62", features = [
|
|
"Win32_Foundation",
|
|
"Win32_System_Registry",
|
|
"Win32_System_Threading",
|
|
"Win32_UI_WindowsAndMessaging",
|
|
"Win32_UI_Shell",
|
|
"Win32_Graphics_Dwm",
|
|
"Win32_Graphics_Gdi",
|
|
] }
|
|
# Same major as tauri's; used for the WebView2 runtime check.
|
|
webview2-com = "0.39"
|
|
# Same major as the copy auto-launch pulls; reads the system proxy.
|
|
windows-registry = "0.6"
|
|
|
|
[dev-dependencies]
|
|
flate2 = "1"
|
|
|
|
[build-dependencies]
|
|
tauri-build = { version = "2", features = [] }
|
|
serde_json = "1"
|
|
|
|
[profile.release]
|
|
opt-level = "z"
|
|
lto = true
|
|
strip = true
|
|
codegen-units = 1
|
|
panic = "abort"
|