feat: ratio-based growth display and per-agent tokens in scope chips - #15
Closed
SunChJ wants to merge 96 commits into
Closed
feat: ratio-based growth display and per-agent tokens in scope chips#15SunChJ wants to merge 96 commits into
SunChJ wants to merge 96 commits into
Conversation
Turn the Claude-only dashboard into a multi-agent one behind a UsageSource-style adapter layer; Codex CLI is the first new source. Backend: - store.rs: multi-root incremental ingest; Codex adapter parses ~/.codex/sessions rollout JSONL (token_count turn deltas via last_token_usage, model from turn_context, session from session_meta/ filename, mcp__* function calls). Normalizes Codex cached_input_tokens (a subset of input) into the shared input/cacheRead schema. Persists the newest rate_limits snapshot. Store cache bumped to v5. - parser.rs: dashboard now returns scopes — a single scope (classic UI, zero change) with one source, or All + per-agent scopes with several. All scope carries per-agent slices (hero split bar, stacked chart) and agent-tinted model palettes (Claude coral / Codex teal). - config.rs: Codex MCP whitelist from ~/.codex/config.toml [mcp_servers.*], '-'/'_' normalized to match logged tool names. - lib.rs: fs watcher covers all source roots; milestones read the aggregate scope; quieten pre-existing objc/cocoa dependency warnings. Frontend: - Agent filter chips (shown only when >=2 sources have data); filtering to one agent re-tints the whole panel with its accent per theme. - All view stacks the trend chart and hero bar by agent; single-agent views keep the Input/Output split. - Codex quota card: 5h + weekly rate-limit windows, plan, reset countdown, stale marker, amber warning at >=80%. - Skills section hides for Codex (no such concept); cost donut keeps agent-tinted model colors in multi-source mode. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ne, v1.1.0 - READMEs (en/zh): reposition as a unified dashboard for local AI coding agents (Claude Code + Codex), document the Codex data sources, quota card, agent chips, and cross-agent token normalization; point install links and the Homebrew cask at this repo's releases and tap (sunchj/tokenscope/tokenscope); credit the upstream remix. - release.yml: publish releases from this repo, update the SunChJ/homebrew-tokenscope tap, and skip the tap step quietly when HOMEBREW_TAP_TOKEN isn't configured instead of failing the job. - bump version to 1.1.0 (Codex support feature release). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds self-updating via tauri-plugin-updater backed by GitHub Releases:
- Backend: register updater + process plugins; updater endpoint is the
release feed's latest.json, packages verified against the bundled
minisign pubkey (bundle.createUpdaterArtifacts on).
- Frontend: UpdateBanner in the panel — checks on launch and every 6h,
shows "vX.Y.Z is available → Update", streams download progress,
then offers a one-click Restart. A dismissed version stays hidden
until the next one. All failure paths (offline, no latest.json yet,
bad signature) stay silent and retry later.
- CI: release workflow passes TAURI_SIGNING_PRIVATE_KEY(+_PASSWORD)
to tauri-action so update packages are signed and latest.json is
published; builds still succeed without the secrets (updater is
then simply inert).
- Version 1.2.0; README (en/zh) documents the update flow.
Note: the updater keypair lives outside the repo
(~/.tauri/tokenscope-updater.key{,.pub,.password} locally); losing the
private key or password permanently breaks the update chain for
shipped builds — back it up.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
feat(updater): in-app update check, download, and install
…ents - Drop the upstream Product Hunt badge (it belongs to the original project's marketing) and the top-of-page remix blockquote. - Add a proper Acknowledgements (致谢) section at the end of both READMEs: credits @HduSy's tokenscope for the architecture and design this project inherits (MIT retained), and directs issues here rather than upstream. - Title the READMEs "Tokenscope Remix" to match the repo identity (the app/cask keep the Tokenscope product name). Repo metadata updated alongside (not in this diff): description now reflects the multi-agent scope, homepage points at our releases page instead of the upstream landing site, and topics were added. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
docs: own branding + upstream acknowledgements
[codex] fix tray popover main-thread updates
Restructure around the current feature set: bundled HappyUsage quota with its lookup/fallback chain and Menu Bar Display modes, three-agent support, and updated structure/release sections.
Render the current panel (provider limits card, new model list, Pi scope) in dark and light via headless Chrome and compose the dual-panel shot.
docs: refresh README for the 1.5.1 feature set
chore: bump version to 1.5.2
tauri-action warns that `uploadUpdaterJson` is not a valid input; the supported flag is `includeUpdaterJson`. No behavior change.
Remove the session-log based quota pipeline (codex_quota/spark_quota, quota_history, one-time migrations, and their cache files): local logs count tokens, they do not describe subscription limits. quota_api now talks only to the HappyUsage `hu` CLI (bundled binary, auto- install when missing). A failed fetch leaves that provider None instead of falling back to ~/.claude.json caches, persisted snapshots, or the native wham/usage call; the dashboard shows an explicit Unavailable state. The in-memory readings still carry trend points across refreshes. Quota/Scope.quota types are removed from the model and frontend.
refactor: hu is the only quota source, drop local quota computation
build-hu.sh queried api.github.com for the latest release tag, which 403s on shared CI runner IPs (unauthenticated rate limit). Resolve the version from the releases/latest HTML redirect instead; HAPPYUSAGE_VERSION still overrides. This unblocks the macOS universal release job.
fix: resolve hu version via releases redirect, not the rate-limited API
A platform failure must not leave a partial public release: v1.5.3 once published Windows assets while the macOS job failed. Build jobs now upload to a draft release; a publish job (needs: all platform jobs) flips it public and updates the Homebrew cask only when every asset succeeded. Also switch to the supported includeUpdaterJson input name.
chore: bump version to 1.5.4
ci: fix tauri-action updater json input name
ci: publish releases atomically via draft
Two platform jobs concurrently creating the same tag's release race: the loser gets 403 "Resource not accessible by integration" (v1.5.4 failed this way when both jobs finished within seconds). prepare now creates the draft release once, before the matrix jobs, so each platform job finds it and uploads assets; publish flips it public only after all succeeded.
ci: pre-create draft release to avoid the create-release race
fix: package architecture-matched HappyUsage on macOS
fix(ci): pass release tag to draft creation
release: Tokenscope v1.5.6
…in scope chips - Delta badge renders ▲/▼ with a multiple of the previous period (63x instead of 6240%), exact ratio kept in the tooltip - Agent chips now display each source's tokens for the current period, with its own growth ratio on hover
|
|
Author
|
Wrong target: this repo is stale (v1.0.5); the active repo is the fork. Reopening there. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
▲63.4x) instead of a percentage (▲6240%), with the exact ratio in the tooltip. Downward changes render as▼0.53x.All / Claude / Codex / Pi) now show each source's token total for the current period (day / week / month / custom range), with that agent's own growth ratio on hover.Verification
tsc && vite buildpasses.src/App.tsx) and the dev preview panel (tokenscope-panel.html) updated in sync.