tokentracker-cli 0.87.6 → 0.87.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.de.md +32 -32
- package/README.ja.md +31 -31
- package/README.ko.md +31 -31
- package/README.md +37 -36
- package/README.zh-CN.md +34 -33
- package/dashboard/dist/assets/{AchievementBadge-BRh6I-jK.js → AchievementBadge-CpxX02OK.js} +1 -1
- package/dashboard/dist/assets/{AchievementsPage-BsAJOqK8.js → AchievementsPage-CSms8IjI.js} +2 -2
- package/dashboard/dist/assets/{AchievementsSection-DebeB3vT.js → AchievementsSection-Sm43tnkh.js} +1 -1
- package/dashboard/dist/assets/{BadgeDetailModal-DniVJwrw.js → BadgeDetailModal-cSNqMLsK.js} +1 -1
- package/dashboard/dist/assets/{Card-DvKbmZEl.js → Card-wNwNRVSb.js} +1 -1
- package/dashboard/dist/assets/{ClawdAnimated-DCyXpvgK.js → ClawdAnimated-S8sIS2Ca.js} +1 -1
- package/dashboard/dist/assets/{CommandPalette-BadO9q-D.js → CommandPalette-DVeiwbPM.js} +1 -1
- package/dashboard/dist/assets/{CommunityStatsModal-DzBeGuLk.js → CommunityStatsModal-g5P4j3um.js} +1 -1
- package/dashboard/dist/assets/{ConfirmModal-BLppThU-.js → ConfirmModal-2P2D5iIp.js} +1 -1
- package/dashboard/dist/assets/{Controls-BBVOO6-V.js → Controls-CCaotoQP.js} +1 -1
- package/dashboard/dist/assets/{DashboardPage-DgV2-5pv.js → DashboardPage-DxPGTJpe.js} +1 -1
- package/dashboard/dist/assets/{DevicePage-BZ8Z3veC.js → DevicePage-_nLwNash.js} +1 -1
- package/dashboard/dist/assets/{DialogClose-Be7JwC-H.js → DialogClose-D0giFwO3.js} +1 -1
- package/dashboard/dist/assets/DialogDescription-8veCvaUb.js +1 -0
- package/dashboard/dist/assets/{DialogTitle-Bgr5ftrn.js → DialogTitle-JS_04eUC.js} +1 -1
- package/dashboard/dist/assets/{FadeIn-Cc5Grbxc.js → FadeIn-tFzTWDkC.js} +1 -1
- package/dashboard/dist/assets/HeaderGithubStar-B2EUJUTH.js +1 -0
- package/dashboard/dist/assets/{HoverTooltip-BwRvWZqo.js → HoverTooltip-BJzHksPT.js} +1 -1
- package/dashboard/dist/assets/{IpCheckPage-Ce4dWLI1.js → IpCheckPage-B8mA0mut.js} +1 -1
- package/dashboard/dist/assets/{LandingPage-CuDfsomP.js → LandingPage-DmJZDKr9.js} +2 -2
- package/dashboard/dist/assets/{LeaderboardAvatar-D50UCqhG.js → LeaderboardAvatar-CDeRQUCg.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardPage-fXYjgVOH.js → LeaderboardPage-Dkgm89kY.js} +2 -2
- package/dashboard/dist/assets/{LeaderboardProfileModal-DiIM1-8L.js → LeaderboardProfileModal-B6_kuR1z.js} +3 -3
- package/dashboard/dist/assets/{LeaderboardProfilePage-UzcVaHbK.js → LeaderboardProfilePage-BRs8sJBV.js} +2 -2
- package/dashboard/dist/assets/LimitsPage-DZ1s5NWV.js +4 -0
- package/dashboard/dist/assets/LocalOnlyNotice-Cu_hSnux.js +1 -0
- package/dashboard/dist/assets/{LoginCard-e4xbbFLq.js → LoginCard-yDZbGsHR.js} +1 -1
- package/dashboard/dist/assets/{LoginModal-CLxWc3FD.js → LoginModal-DEvzCUfQ.js} +1 -1
- package/dashboard/dist/assets/{LoginPage-sf34MK6Q.js → LoginPage-DBySF9do.js} +1 -1
- package/dashboard/dist/assets/{PetPage-BA_BAFKG.js → PetPage-DnzH9t-r.js} +1 -1
- package/dashboard/dist/assets/{PopoverPopup-BwFAXu-Z.js → PopoverPopup-DgFsEMax.js} +1 -1
- package/dashboard/dist/assets/{ProviderIcon-MRSlzNzV.js → ProviderIcon-BEixe-xP.js} +1 -1
- package/dashboard/dist/assets/{ResetPasswordPage-DJAq2p4v.js → ResetPasswordPage-excKqsCL.js} +1 -1
- package/dashboard/dist/assets/{SegmentedControl-LWEqN03-.js → SegmentedControl-DDFkH64o.js} +1 -1
- package/dashboard/dist/assets/{Select-tkoxDrUN.js → Select-ChEPIuJf.js} +1 -1
- package/dashboard/dist/assets/{SelectItemText-bBnvuF48.js → SelectItemText--b7ISnJm.js} +1 -1
- package/dashboard/dist/assets/{ServiceStatusPage-DDGNQfQ1.js → ServiceStatusPage-DtAY-Qnn.js} +1 -1
- package/dashboard/dist/assets/{SessionsPage-x7-I3BLn.js → SessionsPage-CKFglvuj.js} +1 -1
- package/dashboard/dist/assets/{SettingsPage-ColZX8Yi.js → SettingsPage-s0605qWg.js} +1 -1
- package/dashboard/dist/assets/{SkillsPage-DELWPebQ.js → SkillsPage-DTsbCucq.js} +1 -1
- package/dashboard/dist/assets/{TokenGalaxy-Bz8Cto8i.js → TokenGalaxy-C_M7q8S4.js} +1 -1
- package/dashboard/dist/assets/{ToolbarRootContext-BvOVtmfA.js → ToolbarRootContext-CXQwpea-.js} +1 -1
- package/dashboard/dist/assets/{TrendMonitor-DuNGP2Rf.js → TrendMonitor-1Yhlplf0.js} +1 -1
- package/dashboard/dist/assets/{WidgetsPage-CRGlX9WP.js → WidgetsPage-DC6pmtld.js} +1 -1
- package/dashboard/dist/assets/{WrappedPage-DQ3hLeL1.js → WrappedPage-DixoqR13.js} +1 -1
- package/dashboard/dist/assets/{__vite-browser-external-CGdlUam8.js → __vite-browser-external-5aLUeBkM.js} +6 -4
- package/dashboard/dist/assets/{agent-logos-FfNeyajM.js → agent-logos-DILTbPLg.js} +1 -1
- package/dashboard/dist/assets/{arrow-up-right-BEQHH_0c.js → arrow-up-right-DgIDgjVW.js} +1 -1
- package/dashboard/dist/assets/{check-Bl_xgq6c.js → check-Bz6l09VH.js} +1 -1
- package/dashboard/dist/assets/{chevron-right-YO2OTiWy.js → chevron-right-EvGQXbI3.js} +1 -1
- package/dashboard/dist/assets/{copy-DtRgnD2D.js → copy-DbsB0OVy.js} +1 -1
- package/dashboard/dist/assets/{download-BiCrU4Wh.js → download-R8nUvXYh.js} +1 -1
- package/dashboard/dist/assets/{external-link-CVogXP9K.js → external-link-x0oNzGeq.js} +1 -1
- package/dashboard/dist/assets/{flame-GFlQvi3d.js → flame-Bo4IdG6k.js} +1 -1
- package/dashboard/dist/assets/{format-tokens-BZrnF3-R.js → format-tokens-BSGC1-Gz.js} +1 -1
- package/dashboard/dist/assets/{icons-CzzsWeR-.js → icons-D0Okncmo.js} +1 -1
- package/dashboard/dist/assets/{index-mrU077Y8.js → index-BbOkC6wf.js} +1 -1
- package/dashboard/dist/assets/{index-CyOwnTlp.js → index-Bvvmei-I.js} +1 -1
- package/dashboard/dist/assets/{index-B1S00F5t.js → index-D6F8eNr_.js} +1 -1
- package/dashboard/dist/assets/{info-CL-k0W8L.js → info-DXXKNpLG.js} +1 -1
- package/dashboard/dist/assets/{limits-providers-DGKlD0uY.js → limits-providers-DYa4fdsE.js} +1 -1
- package/dashboard/dist/assets/{link-2-DOsRG9tT.js → link-2-C9mxEnT6.js} +1 -1
- package/dashboard/dist/assets/{loader-circle-Da-W_cCG.js → loader-circle-Y8V8Mq9L.js} +1 -1
- package/dashboard/dist/assets/{maximize-2-CPp2Asek.js → maximize-2-QuP69Xcg.js} +1 -1
- package/dashboard/dist/assets/{modifiers.esm-B0cihd2s.js → modifiers.esm-B3SleRKs.js} +1 -1
- package/dashboard/dist/assets/{monitor-smartphone-CLMr7OcT.js → monitor-smartphone-B2LslYi7.js} +1 -1
- package/dashboard/dist/assets/{provider-display-h1GGY5sy.js → provider-display-DzBwrDZp.js} +2 -2
- package/dashboard/dist/assets/{react-BXj1W2tW.js → react-BooKG84W.js} +1 -1
- package/dashboard/dist/assets/{search-DTwQkbLa.js → search-zdYuHmL-.js} +1 -1
- package/dashboard/dist/assets/{skills-api-B7_r_5CR.js → skills-api-C2IkKfwE.js} +1 -1
- package/dashboard/dist/assets/{sortable.esm-Ba4_NOAf.js → sortable.esm-BHvl5vG5.js} +1 -1
- package/dashboard/dist/assets/{store-CZZj0fmU.js → store-BBP4jx0R.js} +1 -1
- package/dashboard/dist/assets/{terminal-Dd0uhXcN.js → terminal-C0nhFNQ0.js} +1 -1
- package/dashboard/dist/assets/{trash-2-CyBqbulx.js → trash-2-DNVSqbxA.js} +1 -1
- package/dashboard/dist/assets/{use-community-stats-D657285K.js → use-community-stats-BK070d1s.js} +1 -1
- package/dashboard/dist/assets/{use-limits-display-prefs-z0wBtxb1.js → use-limits-display-prefs-BXOUxblO.js} +1 -1
- package/dashboard/dist/assets/{use-ordered-list-CiIuzdVF.js → use-ordered-list-0SVHZHaW.js} +1 -1
- package/dashboard/dist/assets/use-reduced-motion-abZbtoVS.js +1 -0
- package/dashboard/dist/assets/{use-session-efficiency-pref-BiHWvNJQ.js → use-session-efficiency-pref-eaUpwuLK.js} +1 -1
- package/dashboard/dist/assets/{use-transform-DcbCiXLq.js → use-transform-Bhar2U4w.js} +1 -1
- package/dashboard/dist/assets/{use-usage-limits-tUq-_GSd.js → use-usage-limits-BGGCMVzi.js} +1 -1
- package/dashboard/dist/assets/{useCurrency-BlOEzUvV.js → useCurrency-gIJVmq3w.js} +1 -1
- package/dashboard/dist/assets/{useScrollLock-CFKQBf15.js → useScrollLock-BhFzeRtR.js} +1 -1
- package/dashboard/dist/assets/{useTokenFormat-ggxahHK0.js → useTokenFormat-BZ8WT-A6.js} +1 -1
- package/dashboard/dist/assets/{zap-De7YrxAq.js → zap-Dvc_Jt1t.js} +1 -1
- package/dashboard/dist/brand-logos/omp.svg +33 -0
- package/dashboard/dist/brand-logos/pi.svg +16 -0
- package/dashboard/dist/index.html +7 -7
- package/dashboard/dist/ip-check.html +1 -1
- package/dashboard/dist/leaderboard.html +1 -1
- package/dashboard/dist/llms.txt +4 -4
- package/dashboard/dist/share.html +2 -2
- package/package.json +3 -3
- package/src/commands/init.js +49 -8
- package/src/commands/status.js +12 -5
- package/src/commands/sync.js +1 -0
- package/src/commands/uninstall.js +36 -1
- package/src/lib/grok-hook.js +11 -2
- package/src/lib/omp-hook.js +589 -0
- package/src/lib/opencode-go-limits.js +59 -30
- package/src/lib/pricing/seed-snapshot.json +1 -1
- package/src/lib/rollout.js +283 -68
- package/src/lib/star-cta.js +1 -1
- package/src/lib/usage-limits.js +3 -3
- package/dashboard/dist/assets/DialogDescription-fYPOWV-6.js +0 -1
- package/dashboard/dist/assets/HeaderGithubStar-BN1WZPnH.js +0 -1
- package/dashboard/dist/assets/LimitsPage-Clg8P5-M.js +0 -4
- package/dashboard/dist/assets/LocalOnlyNotice-rdNf4GvF.js +0 -1
- package/dashboard/dist/assets/use-reduced-motion-DXlYG36v.js +0 -1
package/README.md
CHANGED
|
@@ -10,14 +10,14 @@ An accurate, local-first token usage and cost dashboard for **29 AI coding tools
|
|
|
10
10
|
|
|
11
11
|
[](https://www.npmjs.com/package/tokentracker-cli)
|
|
12
12
|
[](https://www.npmjs.com/package/tokentracker-cli)
|
|
13
|
-
[](https://github.com/xiufengsun/homebrew-tokentracker)
|
|
14
14
|
[](https://opensource.org/licenses/MIT)
|
|
15
15
|
[](https://www.npmjs.com/package/tokentracker-cli)
|
|
16
|
-
[](https://github.com/
|
|
17
|
-
[](https://github.com/
|
|
18
|
-
[](https://github.com/xiufengsun/TokenTracker/releases/latest)
|
|
17
|
+
[](https://github.com/xiufengsun/TokenTracker/releases/latest)
|
|
18
|
+
[](https://github.com/xiufengsun/TokenTracker/stargazers)
|
|
19
19
|
[](https://github.com/ruanyf/weekly/blob/master/docs/issue-393.md)
|
|
20
|
-
[](https://github.com/
|
|
20
|
+
[](https://github.com/xiufengsun/TokenTracker)
|
|
21
21
|
|
|
22
22
|
<br/>
|
|
23
23
|
|
|
@@ -25,7 +25,7 @@ An accurate, local-first token usage and cost dashboard for **29 AI coding tools
|
|
|
25
25
|
|
|
26
26
|
<br/><br/>
|
|
27
27
|
|
|
28
|
-
<video src="https://github.com/user-attachments/assets/3275979d-bbed-4639-83e2-8b7d83bed6af" controls muted playsinline poster="https://raw.githubusercontent.com/
|
|
28
|
+
<video src="https://github.com/user-attachments/assets/3275979d-bbed-4639-83e2-8b7d83bed6af" controls muted playsinline poster="https://raw.githubusercontent.com/xiufengsun/tokentracker/main/docs/screenshots/dashboard-light.png" width="820"></video>
|
|
29
29
|
|
|
30
30
|
<br/><br/>
|
|
31
31
|
|
|
@@ -56,13 +56,13 @@ An accurate, local-first token usage and cost dashboard for **29 AI coding tools
|
|
|
56
56
|
|
|
57
57
|
<br/><br/>
|
|
58
58
|
|
|
59
|
-
<video src="https://github.com/user-attachments/assets/5e709422-5af8-4e4c-8109-f5bb711eb3f8" controls muted playsinline poster="https://raw.githubusercontent.com/
|
|
60
|
-
<img src="https://raw.githubusercontent.com/
|
|
59
|
+
<video src="https://github.com/user-attachments/assets/5e709422-5af8-4e4c-8109-f5bb711eb3f8" controls muted playsinline poster="https://raw.githubusercontent.com/xiufengsun/tokentracker/main/docs/screenshots/dashboard-dark.png" width="820">
|
|
60
|
+
<img src="https://raw.githubusercontent.com/xiufengsun/tokentracker/main/docs/screenshots/dashboard-dark.png" alt="Token Tracker Dashboard" width="820" />
|
|
61
61
|
</video>
|
|
62
62
|
|
|
63
63
|
<br/><br/>
|
|
64
64
|
|
|
65
|
-
⭐ **If TokenTracker saves you time, please [star it on GitHub](https://github.com/
|
|
65
|
+
⭐ **If TokenTracker saves you time, please [star it on GitHub](https://github.com/xiufengsun/TokenTracker) — it helps other developers find it.**
|
|
66
66
|
|
|
67
67
|
<br/>
|
|
68
68
|
|
|
@@ -89,8 +89,8 @@ That's it. First run installs hooks, syncs your data, and opens the dashboard at
|
|
|
89
89
|
- 🧩 *Optional:* a Skills tab that browses 250+ public skills and syncs them across Claude · Codex · Grok · Antigravity · Gemini · OpenCode · Hermes
|
|
90
90
|
|
|
91
91
|
> **Want a native desktop app?**
|
|
92
|
-
> - **macOS** — [Download `TokenTrackerBar.dmg`](https://github.com/
|
|
93
|
-
> - **Windows** — [Download `TokenTracker-Setup.exe`](https://github.com/
|
|
92
|
+
> - **macOS** — [Download `TokenTrackerBar.dmg`](https://github.com/xiufengsun/TokenTracker/releases/latest/download/TokenTrackerBar.dmg) → drag to Applications. Menu bar status icon, desktop widgets, and the dashboard in a WKWebView.
|
|
93
|
+
> - **Windows** — [Download `TokenTracker-Setup.exe`](https://github.com/xiufengsun/TokenTracker/releases/latest/download/TokenTracker-Setup.exe) → run the per-user installer (no admin needed). System-tray app with the dashboard in WebView2. Portable zip also on the [releases page](https://github.com/xiufengsun/TokenTracker/releases/latest).
|
|
94
94
|
|
|
95
95
|
Install globally for shorter commands:
|
|
96
96
|
|
|
@@ -111,13 +111,13 @@ Prefer `brew`? Install directly — no extra tap step needed:
|
|
|
111
111
|
|
|
112
112
|
```bash
|
|
113
113
|
# macOS menu bar app (DMG)
|
|
114
|
-
brew install --cask
|
|
114
|
+
brew install --cask xiufengsun/tokentracker/tokentracker
|
|
115
115
|
|
|
116
116
|
# CLI only
|
|
117
|
-
brew install
|
|
117
|
+
brew install xiufengsun/tokentracker/tokentracker
|
|
118
118
|
```
|
|
119
119
|
|
|
120
|
-
Upgrade with `brew upgrade --cask
|
|
120
|
+
Upgrade with `brew upgrade --cask xiufengsun/tokentracker/tokentracker`. The tap auto-bumps within an hour of every new release.
|
|
121
121
|
|
|
122
122
|
---
|
|
123
123
|
|
|
@@ -150,14 +150,14 @@ Upgrade with `brew upgrade --cask mm7894215/tokentracker/tokentracker`. The tap
|
|
|
150
150
|
|
|
151
151
|
**Dashboard** — usage trends, model breakdown, cost analysis
|
|
152
152
|
|
|
153
|
-
<img src="https://raw.githubusercontent.com/
|
|
153
|
+
<img src="https://raw.githubusercontent.com/xiufengsun/tokentracker/main/docs/screenshots/dashboard-light.png" alt="Dashboard" />
|
|
154
154
|
|
|
155
155
|
</td>
|
|
156
156
|
<td width="50%">
|
|
157
157
|
|
|
158
158
|
**Desktop Widgets** — pin usage to your desktop
|
|
159
159
|
|
|
160
|
-
<img src="https://raw.githubusercontent.com/
|
|
160
|
+
<img src="https://raw.githubusercontent.com/xiufengsun/tokentracker/main/docs/screenshots/widgets-overview.png" alt="Desktop Widgets" />
|
|
161
161
|
|
|
162
162
|
</td>
|
|
163
163
|
</tr>
|
|
@@ -166,14 +166,14 @@ Upgrade with `brew upgrade --cask mm7894215/tokentracker/tokentracker`. The tap
|
|
|
166
166
|
|
|
167
167
|
**Menu Bar App** — animated Clawd companion + native panels
|
|
168
168
|
|
|
169
|
-
<img src="https://raw.githubusercontent.com/
|
|
169
|
+
<img src="https://raw.githubusercontent.com/xiufengsun/tokentracker/main/docs/screenshots/menubar.gif" alt="Menu Bar App" />
|
|
170
170
|
|
|
171
171
|
</td>
|
|
172
172
|
<td width="50%">
|
|
173
173
|
|
|
174
174
|
**Global Leaderboard** — compare with developers worldwide
|
|
175
175
|
|
|
176
|
-
<img src="https://raw.githubusercontent.com/
|
|
176
|
+
<img src="https://raw.githubusercontent.com/xiufengsun/tokentracker/main/docs/screenshots/leaderboard.png" alt="Leaderboard" />
|
|
177
177
|
|
|
178
178
|
</td>
|
|
179
179
|
</tr>
|
|
@@ -182,7 +182,7 @@ Upgrade with `brew upgrade --cask mm7894215/tokentracker/tokentracker`. The tap
|
|
|
182
182
|
|
|
183
183
|
**Skills Manager** — browse 250+ public skills from GitHub & `skills.sh`, install once, sync to Claude / Codex / Grok / Antigravity / Gemini / OpenCode / Hermes. Per-target toggles, one-click Undo, no manual file copying.
|
|
184
184
|
|
|
185
|
-
<img src="https://raw.githubusercontent.com/
|
|
185
|
+
<img src="https://raw.githubusercontent.com/xiufengsun/tokentracker/main/docs/screenshots/skills.png" alt="Skills Manager" />
|
|
186
186
|
|
|
187
187
|
</td>
|
|
188
188
|
</tr>
|
|
@@ -191,7 +191,7 @@ Upgrade with `brew upgrade --cask mm7894215/tokentracker/tokentracker`. The tap
|
|
|
191
191
|
|
|
192
192
|
**Desktop Pet** — a pixel companion that floats on your desktop and reacts to your real token burn: it codes when you code, celebrates streaks, and sleeps when you rest. Import community pets from [codex-pets.net](https://codex-pets.net) with a link or a `.codex-pet.zip` — V2 pets even turn their head to follow your cursor in 16 directions. macOS, Windows, and web.
|
|
193
193
|
|
|
194
|
-
<img src="https://raw.githubusercontent.com/
|
|
194
|
+
<img src="https://raw.githubusercontent.com/xiufengsun/tokentracker/main/docs/screenshots/pet.png" alt="Desktop Pet" />
|
|
195
195
|
|
|
196
196
|
</td>
|
|
197
197
|
</tr>
|
|
@@ -200,7 +200,7 @@ Upgrade with `brew upgrade --cask mm7894215/tokentracker/tokentracker`. The tap
|
|
|
200
200
|
|
|
201
201
|
**Achievements** — 15 tracks turn usage milestones, streaks, tools, and models into collectible badges — with progress visible before each unlock.
|
|
202
202
|
|
|
203
|
-
<img src="https://raw.githubusercontent.com/
|
|
203
|
+
<img src="https://raw.githubusercontent.com/xiufengsun/tokentracker/main/docs/screenshots/achievements.png" alt="TokenTracker Achievements" />
|
|
204
204
|
|
|
205
205
|
</td>
|
|
206
206
|
</tr>
|
|
@@ -224,7 +224,7 @@ Upgrade with `brew upgrade --cask mm7894215/tokentracker/tokentracker`. The tap
|
|
|
224
224
|
| **GitHub Copilot App / CLI** | ✅ Auto | Unified per-request SQLite usage (`~/.copilot/session-store.db`); App DB legacy baseline |
|
|
225
225
|
| **GitHub Copilot Chat extension / legacy CLI** | ✅ Auto | OpenTelemetry file exporter (`COPILOT_OTEL_FILE_EXPORTER_PATH`) |
|
|
226
226
|
| **Kimi Code** | ✅ Auto | Passive `wire.jsonl` reader (`~/.kimi/sessions/**/wire.jsonl`) |
|
|
227
|
-
| **oh-my-pi (Pi Coding Agent)** | ✅ Auto | Passive reader (`~/.omp/agent/sessions/**/*.jsonl`) |
|
|
227
|
+
| **oh-my-pi (Pi Coding Agent)** | ✅ Auto | Passive reader (`~/.omp/agent/sessions/**/*.jsonl`) + managed notify extension written by `tokentracker init` to `~/.omp/agent/extensions/tokentracker-notify.ts` for near-real-time sync (skipped if a same-named unmanaged file already exists; removed by `tokentracker uninstall` when still managed) |
|
|
228
228
|
| **CodeBuddy** (Tencent) | ✅ Auto | SessionEnd hook in `~/.codebuddy/settings.json` (Claude-Code fork) |
|
|
229
229
|
| **WorkBuddy** (Tencent) | ✅ Auto | SessionEnd hook in `~/.workbuddy/settings.json` (Claude-Code fork) + passive `projects/**/*.jsonl` scan |
|
|
230
230
|
| **Grok Build** (xAI) | ✅ Auto | SessionEnd hook + passive `updates.jsonl` / `signals.json` scan (`~/.grok/sessions/**/`) |
|
|
@@ -246,14 +246,15 @@ Upgrade with `brew upgrade --cask mm7894215/tokentracker/tokentracker`. The tap
|
|
|
246
246
|
> **Do I need to install any plugin or hook manually?** No. `tokentracker` (or `tokentracker init`) handles everything on first run:
|
|
247
247
|
> - **Hook-based** tools (Claude Code, Codex, Gemini, Every Code, **CodeBuddy**, **WorkBuddy**, **Grok Build**) — we write a SessionEnd hook or TOML notify entry into the tool's own config.
|
|
248
248
|
> - **Plugin-based** tools (OpenCode, **OpenClaw**) — plugins ship inside the npm package. OpenClaw's session plugin lives at `~/.tokentracker/tracker/openclaw-plugin/openclaw-session-sync/`; we link and enable it via OpenClaw's own CLI, then set `hooks.allowConversationAccess=true` so OpenClaw permits the session-finished event that triggers sync. No download, no drag-and-drop.
|
|
249
|
-
> - **
|
|
249
|
+
> - **oh-my-pi** — passive session scan is always the billing/token source of truth (`~/.omp/agent/sessions/**/*.jsonl`). When OMP is detected, `tokentracker init` also writes a managed notify extension to `~/.omp/agent/extensions/tokentracker-notify.ts` so turns can trigger near-real-time sync. That file is owned only when it carries TokenTracker's managed marker: a same-named user-authored extension is never overwritten or deleted. `tokentracker uninstall` removes the extension only while it is still managed.
|
|
250
|
+
> - **Passive readers** (Cursor, Kiro, Hermes, Kimi Code, Copilot, **Grok Build**, **pi**, **Craft Agents**, **Kilo CLI**, **Kilo Code**, **Roo Code**, **Antigravity**, **Zed Agent**, **Goose**, **Droid**, **Mimo Code**, **ZCode**, **Qoder**, **AnythingLLM Desktop**, **Claude Science**) — nothing is installed into those tools. We only read files they already produce (SQLite DB, JSONL, OTEL export, session logs). Copilot App / CLI usage is read per request from `~/.copilot/session-store.db`; `data.db` provides the one-time legacy adoption baseline and stays observe-only after the store becomes canonical, while the Chat extension and legacy CLI continue using OTEL. TokenTracker coordinates the sources so overlapping requests are counted once. Mixed App/CLI usage that predates adoption is retained as a `github-copilot-legacy` aggregate rather than assigned to a guessed request model.
|
|
250
251
|
> - **Grok Build estimate** — current local telemetry exposes cumulative `updates.jsonl` `totalTokens`, but not a stable prompt/output/cache split; `signals.json` remains a fallback with `contextTokensUsed` snapshots. TokenTracker estimates Grok cost until per-call usage details are available.
|
|
251
252
|
>
|
|
252
253
|
> Run `tokentracker status` anytime to verify every integration's state. If something shows `skipped`, the `detail` column explains why (e.g. tool CLI not on `PATH`, config unreadable).
|
|
253
254
|
>
|
|
254
255
|
> Deeper dives: [OpenClaw integration & troubleshooting](docs/openclaw-integration.md).
|
|
255
256
|
|
|
256
|
-
Missing your tool? [Open an issue](https://github.com/
|
|
257
|
+
Missing your tool? [Open an issue](https://github.com/xiufengsun/TokenTracker/issues/new) — adding new providers is usually one parser file away.
|
|
257
258
|
|
|
258
259
|
---
|
|
259
260
|
|
|
@@ -352,7 +353,7 @@ Supported providers for WSL auto-discovery and aggregation:
|
|
|
352
353
|
## 🛠️ Development
|
|
353
354
|
|
|
354
355
|
```bash
|
|
355
|
-
git clone https://github.com/
|
|
356
|
+
git clone https://github.com/xiufengsun/TokenTracker.git
|
|
356
357
|
cd TokenTracker
|
|
357
358
|
npm install
|
|
358
359
|
|
|
@@ -437,7 +438,7 @@ Then run the doctor for a deeper health check:
|
|
|
437
438
|
tokentracker doctor
|
|
438
439
|
```
|
|
439
440
|
|
|
440
|
-
If a provider shows as not configured even though you use it, try `tokentracker activate-if-needed` to re-run hook detection. If still missing, [open an issue](https://github.com/
|
|
441
|
+
If a provider shows as not configured even though you use it, try `tokentracker activate-if-needed` to re-run hook detection. If still missing, [open an issue](https://github.com/xiufengsun/TokenTracker/issues/new) with the `doctor` output attached.
|
|
441
442
|
|
|
442
443
|
</details>
|
|
443
444
|
|
|
@@ -515,9 +516,9 @@ To get `YOUR_USER_ID`:
|
|
|
515
516
|
Then drop one of these in:
|
|
516
517
|
|
|
517
518
|
```markdown
|
|
518
|
-
[](https://github.com/
|
|
519
|
-
[](https://github.com/
|
|
520
|
-
[](https://github.com/
|
|
519
|
+
[](https://github.com/xiufengsun/TokenTracker)
|
|
520
|
+
[](https://github.com/xiufengsun/TokenTracker)
|
|
521
|
+
[](https://github.com/xiufengsun/TokenTracker)
|
|
521
522
|
```
|
|
522
523
|
|
|
523
524
|
> The link target defaults to the TokenTracker repo so every click helps other developers discover the tool. Swap it for your leaderboard profile, personal site, or `https://www.tokentracker.cc` if you'd rather route clicks elsewhere.
|
|
@@ -538,11 +539,11 @@ Renders shields.io-compatible badges with your current totals (60s cache):
|
|
|
538
539
|
|
|
539
540
|
## ⭐ Star History
|
|
540
541
|
|
|
541
|
-
<a href="https://www.star-history.com/?type=date&
|
|
542
|
+
<a href="https://www.star-history.com/?repos=xiufengsun%2FTokenTracker&type=date&legend=top-left">
|
|
542
543
|
<picture>
|
|
543
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=
|
|
544
|
-
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=
|
|
545
|
-
<img alt="Star History Chart" src="https://api.star-history.com/chart?repos=
|
|
544
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=xiufengsun/TokenTracker&type=date&theme=dark&legend=top-left&sealed_token=Vr7qbPNqOTtzQEdtkxS2yArAReX2QkBZKNJgs3n32Q5oJa1iXddLlrT201teNSnt7QnsXtDcHy_T387xvXJ_HXHrPtvH2QQ1xqQZ67N_HV45ulWrt3j6hziDW5eshRCmu8CAT_W31PY0-WVZpFv7NQD-acv1stVK8ndribTokIp9ukSYAedx3icuUrOu" />
|
|
545
|
+
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=xiufengsun/TokenTracker&type=date&legend=top-left&sealed_token=Vr7qbPNqOTtzQEdtkxS2yArAReX2QkBZKNJgs3n32Q5oJa1iXddLlrT201teNSnt7QnsXtDcHy_T387xvXJ_HXHrPtvH2QQ1xqQZ67N_HV45ulWrt3j6hziDW5eshRCmu8CAT_W31PY0-WVZpFv7NQD-acv1stVK8ndribTokIp9ukSYAedx3icuUrOu" />
|
|
546
|
+
<img alt="Star History Chart" src="https://api.star-history.com/chart?repos=xiufengsun/TokenTracker&type=date&legend=top-left&sealed_token=Vr7qbPNqOTtzQEdtkxS2yArAReX2QkBZKNJgs3n32Q5oJa1iXddLlrT201teNSnt7QnsXtDcHy_T387xvXJ_HXHrPtvH2QQ1xqQZ67N_HV45ulWrt3j6hziDW5eshRCmu8CAT_W31PY0-WVZpFv7NQD-acv1stVK8ndribTokIp9ukSYAedx3icuUrOu" />
|
|
546
547
|
</picture>
|
|
547
548
|
</a>
|
|
548
549
|
|
|
@@ -550,10 +551,10 @@ Renders shields.io-compatible badges with your current totals (60s cache):
|
|
|
550
551
|
|
|
551
552
|
## 🤝 Contributing & Support
|
|
552
553
|
|
|
553
|
-
- **Bugs / feature requests**: [open an issue](https://github.com/
|
|
554
|
+
- **Bugs / feature requests**: [open an issue](https://github.com/xiufengsun/TokenTracker/issues/new)
|
|
554
555
|
- **Security**: see [SECURITY.md](SECURITY.md) — please don't open public issues for security reports
|
|
555
556
|
- **Pull requests**: see [CONTRIBUTING.md](CONTRIBUTING.md) for setup, tests, and how to add a new AI tool integration
|
|
556
|
-
- **Questions / showcase**: [GitHub Discussions](https://github.com/
|
|
557
|
+
- **Questions / showcase**: [GitHub Discussions](https://github.com/xiufengsun/TokenTracker/discussions)
|
|
557
558
|
|
|
558
559
|
## 🙏 Credits
|
|
559
560
|
|
|
@@ -573,6 +574,6 @@ The Clawd character design belongs to Anthropic. This is a community project wit
|
|
|
573
574
|
|
|
574
575
|
**Token Tracker** — Quantify your AI output.
|
|
575
576
|
|
|
576
|
-
<a href="https://www.tokentracker.cc">tokentracker.cc</a> · <a href="https://www.npmjs.com/package/tokentracker-cli">npm</a> · <a href="https://github.com/
|
|
577
|
+
<a href="https://www.tokentracker.cc">tokentracker.cc</a> · <a href="https://www.npmjs.com/package/tokentracker-cli">npm</a> · <a href="https://github.com/xiufengsun/TokenTracker">GitHub</a>
|
|
577
578
|
|
|
578
579
|
</div>
|
package/README.zh-CN.md
CHANGED
|
@@ -10,24 +10,24 @@
|
|
|
10
10
|
|
|
11
11
|
[](https://www.npmjs.com/package/tokentracker-cli)
|
|
12
12
|
[](https://www.npmjs.com/package/tokentracker-cli)
|
|
13
|
-
[](https://github.com/xiufengsun/homebrew-tokentracker)
|
|
14
14
|
[](https://opensource.org/licenses/MIT)
|
|
15
15
|
[](https://www.apple.com/macos/)
|
|
16
|
-
[](https://github.com/xiufengsun/TokenTracker/stargazers)
|
|
17
17
|
[](https://github.com/ruanyf/weekly/blob/master/docs/issue-393.md)
|
|
18
|
-
[](https://github.com/
|
|
18
|
+
[](https://github.com/xiufengsun/TokenTracker)
|
|
19
19
|
|
|
20
20
|
<br/>
|
|
21
21
|
|
|
22
|
-
<video src="https://github.com/user-attachments/assets/5e709422-5af8-4e4c-8109-f5bb711eb3f8" controls muted playsinline poster="https://raw.githubusercontent.com/
|
|
23
|
-
<img src="https://raw.githubusercontent.com/
|
|
22
|
+
<video src="https://github.com/user-attachments/assets/5e709422-5af8-4e4c-8109-f5bb711eb3f8" controls muted playsinline poster="https://raw.githubusercontent.com/xiufengsun/tokentracker/main/docs/screenshots/dashboard-dark.png" width="820">
|
|
23
|
+
<img src="https://raw.githubusercontent.com/xiufengsun/tokentracker/main/docs/screenshots/dashboard-dark.png" alt="Token Tracker Dashboard" width="820" />
|
|
24
24
|
</video>
|
|
25
25
|
|
|
26
|
-
<video src="https://github.com/user-attachments/assets/3275979d-bbed-4639-83e2-8b7d83bed6af" controls muted playsinline poster="https://raw.githubusercontent.com/
|
|
26
|
+
<video src="https://github.com/user-attachments/assets/3275979d-bbed-4639-83e2-8b7d83bed6af" controls muted playsinline poster="https://raw.githubusercontent.com/xiufengsun/tokentracker/main/docs/screenshots/dashboard-light.png" width="820"></video>
|
|
27
27
|
|
|
28
28
|
<br/><br/>
|
|
29
29
|
|
|
30
|
-
⭐ **如果 TokenTracker 帮你省了时间,欢迎 [在 GitHub 上 Star](https://github.com/
|
|
30
|
+
⭐ **如果 TokenTracker 帮你省了时间,欢迎 [在 GitHub 上 Star](https://github.com/xiufengsun/TokenTracker) —— 可以让更多开发者发现它。**
|
|
31
31
|
|
|
32
32
|
<br/>
|
|
33
33
|
|
|
@@ -54,8 +54,8 @@ npx tokentracker-cli
|
|
|
54
54
|
- 🧩 *可选:* Skills 面板——浏览 250+ 公开 skill,并在 Claude · Codex · Grok · Antigravity · Gemini · OpenCode · Hermes 之间同步
|
|
55
55
|
|
|
56
56
|
> **想要原生桌面 App?**
|
|
57
|
-
> - **macOS** —— [下载 `TokenTrackerBar.dmg`](https://github.com/
|
|
58
|
-
> - **Windows** —— [下载 `TokenTracker-Setup.exe`](https://github.com/
|
|
57
|
+
> - **macOS** —— [下载 `TokenTrackerBar.dmg`](https://github.com/xiufengsun/TokenTracker/releases/latest/download/TokenTrackerBar.dmg) → 拖入「应用程序」即可。包含桌面小组件、菜单栏状态图标,以及同一套 Dashboard(跑在 WKWebView 里)。
|
|
58
|
+
> - **Windows** —— [下载 `TokenTracker-Setup.exe`](https://github.com/xiufengsun/TokenTracker/releases/latest/download/TokenTracker-Setup.exe) → 运行免管理员的单用户安装包即可。系统托盘 App,Dashboard 跑在 WebView2 里。便携版 zip 见[发布页](https://github.com/xiufengsun/TokenTracker/releases/latest)。
|
|
59
59
|
|
|
60
60
|
全局安装可以少敲字:
|
|
61
61
|
|
|
@@ -76,13 +76,13 @@ tokentracker doctor # 健康检查
|
|
|
76
76
|
|
|
77
77
|
```bash
|
|
78
78
|
# macOS 菜单栏 App(DMG)
|
|
79
|
-
brew install --cask
|
|
79
|
+
brew install --cask xiufengsun/tokentracker/tokentracker
|
|
80
80
|
|
|
81
81
|
# 只装 CLI
|
|
82
|
-
brew install
|
|
82
|
+
brew install xiufengsun/tokentracker/tokentracker
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
升级:`brew upgrade --cask
|
|
85
|
+
升级:`brew upgrade --cask xiufengsun/tokentracker/tokentracker`。每次新版本发布后,tap 会在一小时内自动跟上。
|
|
86
86
|
|
|
87
87
|
---
|
|
88
88
|
|
|
@@ -113,14 +113,14 @@ brew install mm7894215/tokentracker/tokentracker
|
|
|
113
113
|
|
|
114
114
|
**Dashboard** —— 用量趋势、模型分布、成本分析
|
|
115
115
|
|
|
116
|
-
<img src="https://raw.githubusercontent.com/
|
|
116
|
+
<img src="https://raw.githubusercontent.com/xiufengsun/tokentracker/main/docs/screenshots/dashboard-light.png" alt="Dashboard" />
|
|
117
117
|
|
|
118
118
|
</td>
|
|
119
119
|
<td width="50%">
|
|
120
120
|
|
|
121
121
|
**桌面小组件** —— 把用量钉在桌面
|
|
122
122
|
|
|
123
|
-
<img src="https://raw.githubusercontent.com/
|
|
123
|
+
<img src="https://raw.githubusercontent.com/xiufengsun/tokentracker/main/docs/screenshots/widgets-overview.png" alt="Desktop Widgets" />
|
|
124
124
|
|
|
125
125
|
</td>
|
|
126
126
|
</tr>
|
|
@@ -129,14 +129,14 @@ brew install mm7894215/tokentracker/tokentracker
|
|
|
129
129
|
|
|
130
130
|
**菜单栏 App** —— 带动画的 Clawd 小伙伴 + 原生面板
|
|
131
131
|
|
|
132
|
-
<img src="https://raw.githubusercontent.com/
|
|
132
|
+
<img src="https://raw.githubusercontent.com/xiufengsun/tokentracker/main/docs/screenshots/menubar.gif" alt="Menu Bar App" />
|
|
133
133
|
|
|
134
134
|
</td>
|
|
135
135
|
<td width="50%">
|
|
136
136
|
|
|
137
137
|
**全球排行榜** —— 和世界各地开发者比一比
|
|
138
138
|
|
|
139
|
-
<img src="https://raw.githubusercontent.com/
|
|
139
|
+
<img src="https://raw.githubusercontent.com/xiufengsun/tokentracker/main/docs/screenshots/leaderboard.png" alt="Leaderboard" />
|
|
140
140
|
|
|
141
141
|
</td>
|
|
142
142
|
</tr>
|
|
@@ -145,7 +145,7 @@ brew install mm7894215/tokentracker/tokentracker
|
|
|
145
145
|
|
|
146
146
|
**Skills 管理器** —— 浏览 250+ 公开 skill(GitHub 仓库 & `skills.sh`),一次安装,同步到 Claude / Codex / Grok / Antigravity / Gemini / OpenCode / Hermes。每个 Agent 单独开关,一键撤销,再也不用手动复制文件夹。
|
|
147
147
|
|
|
148
|
-
<img src="https://raw.githubusercontent.com/
|
|
148
|
+
<img src="https://raw.githubusercontent.com/xiufengsun/tokentracker/main/docs/screenshots/skills.png" alt="Skills Manager" />
|
|
149
149
|
|
|
150
150
|
</td>
|
|
151
151
|
</tr>
|
|
@@ -154,7 +154,7 @@ brew install mm7894215/tokentracker/tokentracker
|
|
|
154
154
|
|
|
155
155
|
**桌面宠物** —— 悬浮在桌面上的像素小伙伴,实时响应你的 token 消耗:你写代码它也写,连击时庆祝,休息时打盹。粘贴 [codex-pets.net](https://codex-pets.net) 链接或 `.codex-pet.zip` 即可导入社区宠物,V2 宠物还能 16 方向转头追随你的鼠标。macOS / Windows / Web 三端支持。
|
|
156
156
|
|
|
157
|
-
<img src="https://raw.githubusercontent.com/
|
|
157
|
+
<img src="https://raw.githubusercontent.com/xiufengsun/tokentracker/main/docs/screenshots/pet.png" alt="Desktop Pet" />
|
|
158
158
|
|
|
159
159
|
</td>
|
|
160
160
|
</tr>
|
|
@@ -179,7 +179,7 @@ brew install mm7894215/tokentracker/tokentracker
|
|
|
179
179
|
| **GitHub Copilot App / CLI** | ✅ 自动 | 统一逐请求 SQLite 用量(`~/.copilot/session-store.db`);App DB 作为旧数据基线 |
|
|
180
180
|
| **GitHub Copilot Chat 扩展 / 旧版 CLI** | ✅ 自动 | OpenTelemetry 文件导出(`COPILOT_OTEL_FILE_EXPORTER_PATH`) |
|
|
181
181
|
| **Kimi Code** | ✅ 自动 | 被动读取 `wire.jsonl`(`~/.kimi/sessions/**/wire.jsonl`) |
|
|
182
|
-
| **oh-my-pi (Pi Coding Agent)** | ✅ 自动 | 被动读取(`~/.omp/agent/sessions/**/*.jsonl
|
|
182
|
+
| **oh-my-pi (Pi Coding Agent)** | ✅ 自动 | 被动读取(`~/.omp/agent/sessions/**/*.jsonl`)+ `tokentracker init` 会写入托管的 notify 扩展(`~/.omp/agent/extensions/tokentracker-notify.ts`)用于近实时同步(若同名非托管文件已存在则跳过;`tokentracker uninstall` 仅在仍为托管时删除) |
|
|
183
183
|
| **CodeBuddy** (腾讯) | ✅ 自动 | 写入 `~/.codebuddy/settings.json` 的 SessionEnd hook(Claude-Code fork) |
|
|
184
184
|
| **WorkBuddy** (腾讯) | ✅ 自动 | 写入 `~/.workbuddy/settings.json` 的 SessionEnd hook(Claude-Code fork)+ 被动扫描 `projects/**/*.jsonl` |
|
|
185
185
|
| **Grok Build** (xAI) | ✅ 自动 | SessionEnd hook + 被动扫描 `updates.jsonl` / `signals.json`(`~/.grok/sessions/**/`) |
|
|
@@ -200,14 +200,15 @@ brew install mm7894215/tokentracker/tokentracker
|
|
|
200
200
|
> **需要手动装什么插件 / hook 吗?** 不需要。`tokentracker`(或 `tokentracker init`)第一次跑的时候会全部搞定:
|
|
201
201
|
> - **基于 hook 的工具**(Claude Code、Codex、Gemini、Every Code、**CodeBuddy**、**WorkBuddy**、**Grok Build**)—— 我们把 SessionEnd hook 或 TOML notify 条目写入它们自己的配置文件
|
|
202
202
|
> - **基于插件的工具**(OpenCode、**OpenClaw**)—— 插件随 npm 包一起分发。OpenClaw 的 session plugin 位于 `~/.tokentracker/tracker/openclaw-plugin/openclaw-session-sync/`;TokenTracker 会通过 OpenClaw 自己的 CLI 挂接并启用它,然后写入 `hooks.allowConversationAccess=true`,让 OpenClaw 放行触发同步的会话结束事件。无需下载、无需拖拽
|
|
203
|
-
> -
|
|
203
|
+
> - **oh-my-pi** —— 被动会话扫描始终是计费/token 的事实来源(`~/.omp/agent/sessions/**/*.jsonl`)。检测到 OMP 时,`tokentracker init` 还会写入托管的 notify 扩展到 `~/.omp/agent/extensions/tokentracker-notify.ts`,以便回合结束后近实时触发同步。仅当文件带有 TokenTracker 托管标记时才视为我们拥有:同名用户自写扩展绝不会被覆盖或删除。`tokentracker uninstall` 也仅在文件仍为托管状态时删除它。
|
|
204
|
+
> - **被动读取类**(Cursor、Kiro、Hermes、Kimi Code、Copilot、**Grok Build**、**pi**、**Craft Agents**、**Kilo CLI**、**Kilo Code**、**Roo Code**、**Antigravity**、**Zed Agent**、**Goose**、**Droid**、**Mimo Code**、**ZCode**、**AnythingLLM Desktop**、**Claude Science**)—— 完全不往它们里面塞东西,只读取它们自己产生的文件(SQLite DB、JSONL、OTEL 导出、会话轨迹日志)。Copilot App / CLI 的用量按请求读取 `~/.copilot/session-store.db`;`data.db` 只提供一次旧数据迁移基线,并在 store 成为主源后保持仅观察,Chat 扩展和旧版 CLI 继续使用 OTEL。TokenTracker 会协调这些数据源,使重叠请求只统计一次。迁移前无法无损拆分模型的 App/CLI 混合历史会保留为 `github-copilot-legacy` 聚合量,而不会猜测请求模型
|
|
204
205
|
> - **Grok Build 估算说明** —— Grok 当前本地遥测提供 `updates.jsonl` 里的累计 `totalTokens`,但还没有稳定的输入/输出/cache 拆分;`signals.json` 仍作为 `contextTokensUsed` 快照兜底。所以在 Grok 提供按调用粒度的用量明细之前,TokenTracker 对 Grok 成本仍是估算值
|
|
205
206
|
>
|
|
206
207
|
> 任何时候都可以用 `tokentracker status` 查看每个集成的状态。如果显示 `skipped`,`detail` 列会解释原因(例如某工具 CLI 不在 `PATH` 上、config 不可读等)。
|
|
207
208
|
>
|
|
208
209
|
> 更深入的资料:[OpenClaw 集成与排障](docs/openclaw-integration.md)。
|
|
209
210
|
|
|
210
|
-
工具没在列表里?[提个 Issue](https://github.com/
|
|
211
|
+
工具没在列表里?[提个 Issue](https://github.com/xiufengsun/TokenTracker/issues/new) —— 加一个新 provider 通常只是加一个 parser 文件的事。
|
|
211
212
|
|
|
212
213
|
---
|
|
213
214
|
|
|
@@ -279,7 +280,7 @@ flowchart LR
|
|
|
279
280
|
## 🛠️ 本地开发
|
|
280
281
|
|
|
281
282
|
```bash
|
|
282
|
-
git clone https://github.com/
|
|
283
|
+
git clone https://github.com/xiufengsun/TokenTracker.git
|
|
283
284
|
cd TokenTracker
|
|
284
285
|
npm install
|
|
285
286
|
|
|
@@ -364,7 +365,7 @@ tokentracker status
|
|
|
364
365
|
tokentracker doctor
|
|
365
366
|
```
|
|
366
367
|
|
|
367
|
-
如果你明明在用某个工具却显示未配置,跑一下 `tokentracker activate-if-needed` 重新探测。还不行的话 [提个 Issue](https://github.com/
|
|
368
|
+
如果你明明在用某个工具却显示未配置,跑一下 `tokentracker activate-if-needed` 重新探测。还不行的话 [提个 Issue](https://github.com/xiufengsun/TokenTracker/issues/new),把 `doctor` 的输出贴上。
|
|
368
369
|
|
|
369
370
|
</details>
|
|
370
371
|
|
|
@@ -442,9 +443,9 @@ xattr -cr /Applications/TokenTracker.app
|
|
|
442
443
|
然后贴一段:
|
|
443
444
|
|
|
444
445
|
```markdown
|
|
445
|
-
[](https://github.com/
|
|
446
|
-
[](https://github.com/
|
|
447
|
-
[](https://github.com/
|
|
446
|
+
[](https://github.com/xiufengsun/TokenTracker)
|
|
447
|
+
[](https://github.com/xiufengsun/TokenTracker)
|
|
448
|
+
[](https://github.com/xiufengsun/TokenTracker)
|
|
448
449
|
```
|
|
449
450
|
|
|
450
451
|
> 链接默认指向 TokenTracker 仓库,每次点击都能帮其他开发者发现 TokenTracker。如果你想让点击跳到你自己的 leaderboard profile、个人主页或 `https://www.tokentracker.cc`,改 URL 即可。
|
|
@@ -465,11 +466,11 @@ xattr -cr /Applications/TokenTracker.app
|
|
|
465
466
|
|
|
466
467
|
## ⭐ Star 历史
|
|
467
468
|
|
|
468
|
-
<a href="https://www.star-history.com/?type=date&
|
|
469
|
+
<a href="https://www.star-history.com/?repos=xiufengsun%2FTokenTracker&type=date&legend=top-left">
|
|
469
470
|
<picture>
|
|
470
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=
|
|
471
|
-
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=
|
|
472
|
-
<img alt="Star History Chart" src="https://api.star-history.com/chart?repos=
|
|
471
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=xiufengsun/TokenTracker&type=date&theme=dark&legend=top-left&sealed_token=Vr7qbPNqOTtzQEdtkxS2yArAReX2QkBZKNJgs3n32Q5oJa1iXddLlrT201teNSnt7QnsXtDcHy_T387xvXJ_HXHrPtvH2QQ1xqQZ67N_HV45ulWrt3j6hziDW5eshRCmu8CAT_W31PY0-WVZpFv7NQD-acv1stVK8ndribTokIp9ukSYAedx3icuUrOu" />
|
|
472
|
+
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=xiufengsun/TokenTracker&type=date&legend=top-left&sealed_token=Vr7qbPNqOTtzQEdtkxS2yArAReX2QkBZKNJgs3n32Q5oJa1iXddLlrT201teNSnt7QnsXtDcHy_T387xvXJ_HXHrPtvH2QQ1xqQZ67N_HV45ulWrt3j6hziDW5eshRCmu8CAT_W31PY0-WVZpFv7NQD-acv1stVK8ndribTokIp9ukSYAedx3icuUrOu" />
|
|
473
|
+
<img alt="Star History Chart" src="https://api.star-history.com/chart?repos=xiufengsun/TokenTracker&type=date&legend=top-left&sealed_token=Vr7qbPNqOTtzQEdtkxS2yArAReX2QkBZKNJgs3n32Q5oJa1iXddLlrT201teNSnt7QnsXtDcHy_T387xvXJ_HXHrPtvH2QQ1xqQZ67N_HV45ulWrt3j6hziDW5eshRCmu8CAT_W31PY0-WVZpFv7NQD-acv1stVK8ndribTokIp9ukSYAedx3icuUrOu" />
|
|
473
474
|
</picture>
|
|
474
475
|
</a>
|
|
475
476
|
|
|
@@ -477,10 +478,10 @@ xattr -cr /Applications/TokenTracker.app
|
|
|
477
478
|
|
|
478
479
|
## 🤝 贡献与支持
|
|
479
480
|
|
|
480
|
-
- **Bug / 功能建议**:[提个 Issue](https://github.com/
|
|
481
|
+
- **Bug / 功能建议**:[提个 Issue](https://github.com/xiufengsun/TokenTracker/issues/new)
|
|
481
482
|
- **安全问题**:见 [SECURITY.md](SECURITY.md) —— 请不要在公开 Issue 里提交安全报告
|
|
482
483
|
- **Pull Request**:见 [CONTRIBUTING.md](CONTRIBUTING.md),里面有开发环境搭建、测试流程和新增 AI 工具集成的指南
|
|
483
|
-
- **提问 / 展示作品**:[GitHub Discussions](https://github.com/
|
|
484
|
+
- **提问 / 展示作品**:[GitHub Discussions](https://github.com/xiufengsun/TokenTracker/discussions)
|
|
484
485
|
|
|
485
486
|
## 🙏 致谢
|
|
486
487
|
|
|
@@ -500,6 +501,6 @@ Clawd 角色设计归属 Anthropic。本项目是社区项目,和 Anthropic
|
|
|
500
501
|
|
|
501
502
|
**Token Tracker** —— 把你的 AI 产出量化。
|
|
502
503
|
|
|
503
|
-
<a href="https://www.tokentracker.cc">tokentracker.cc</a> · <a href="https://www.npmjs.com/package/tokentracker-cli">npm</a> · <a href="https://github.com/
|
|
504
|
+
<a href="https://www.tokentracker.cc">tokentracker.cc</a> · <a href="https://www.npmjs.com/package/tokentracker-cli">npm</a> · <a href="https://github.com/xiufengsun/TokenTracker">GitHub</a>
|
|
504
505
|
|
|
505
506
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as o,d as N,j as r}from"./__vite-browser-external-
|
|
1
|
+
import{m as o,d as N,j as r}from"./__vite-browser-external-5aLUeBkM.js";import{Z as $}from"./zap-Dvc_Jt1t.js";import{F as A}from"./flame-Bo4IdG6k.js";const j=[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]],E=o("blocks",j);const L=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],C=o("brain",L);const T=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],z=o("calendar-days",T);const q=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],B=o("crown",q);const H=[["path",{d:"M14.086 18.412A2 2 0 0112.67 19H5v-7.672a2 2 0 01.586-1.414L11.75 3.75a6 6 0 118.49 8.49z",key:"1nq9jb"}],["path",{d:"M16 8 2 22",key:"vp34q"}],["path",{d:"M17.488 15H9",key:"16yirz"}]],R=o("feather",H);const D=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],F=o("folder-git-2",D);const I=[["path",{d:"M4 16v-2.38C4 11.5 2.97 10.5 3 8c.03-2.72 1.49-6 4.5-6C9.37 2 10 3.8 10 5.5c0 3.11-2 5.66-2 8.68V16a2 2 0 1 1-4 0Z",key:"1dudjm"}],["path",{d:"M20 20v-2.38c0-2.12 1.03-3.12 1-5.62-.03-2.72-1.49-6-4.5-6C14.63 6 14 7.8 14 9.5c0 3.11 2 5.66 2 8.68V20a2 2 0 1 0 4 0Z",key:"l2t8xc"}],["path",{d:"M16 17h4",key:"1dejxt"}],["path",{d:"M4 13h4",key:"1bwh8b"}]],G=o("footprints",I);const S=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],V=o("heart",S);const Z=[["path",{d:"M7.21 15 2.66 7.14a2 2 0 0 1 .13-2.2L4.4 2.8A2 2 0 0 1 6 2h12a2 2 0 0 1 1.6.8l1.6 2.14a2 2 0 0 1 .14 2.2L16.79 15",key:"143lza"}],["path",{d:"M11 12 5.12 2.2",key:"qhuxz6"}],["path",{d:"m13 12 5.88-9.8",key:"hbye0f"}],["path",{d:"M8 7h8",key:"i86dvs"}],["circle",{cx:"12",cy:"17",r:"5",key:"qbz8iq"}],["path",{d:"M12 18v-2h-.5",key:"fawc4q"}]],O=o("medal",Z);const P=[["path",{d:"M18 5h4",key:"1lhgn2"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],X=o("moon-star",P);const K=[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]],U=o("rocket",K);const W=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Y=o("shield-check",W);const J=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Q=o("trending-up",J),k=[{id:"token_titan",scope:"cloud",icon:B,format:"tokens",art:"/achievements/token-titan.png"},{id:"big_day",scope:"cloud",icon:$,format:"tokens",art:"/achievements/big-day.png"},{id:"wordsmith",scope:"cloud",icon:R,format:"tokens",art:"/achievements/wordsmith.png"},{id:"marathoner",scope:"cloud",icon:G,format:"days",art:"/achievements/marathoner.png"},{id:"streak",scope:"cloud",icon:A,format:"days",art:"/achievements/streak.png"},{id:"weekend_warrior",scope:"cloud",icon:z,format:"days",art:"/achievements/weekend-warrior.png"},{id:"momentum",scope:"cloud",icon:Q,format:"multiplier",art:"/achievements/momentum.png"},{id:"polyglot",scope:"cloud",icon:C,format:"count",art:"/achievements/polyglot.png"},{id:"trendsetter",scope:"cloud",icon:U,format:"count",art:"/achievements/trendsetter.png"},{id:"multitool",scope:"cloud",icon:E,format:"count",art:"/achievements/multitool.png"},{id:"podium",scope:"cloud",icon:O,format:"rank",art:"/achievements/podium.png"},{id:"veteran",scope:"cloud",icon:Y,format:"days",art:"/achievements/veteran.png"},{id:"project_hopper",scope:"local",icon:F,format:"count",art:"/achievements/project-hopper.png"},{id:"project_devotion",scope:"local",icon:V,format:"tokens",art:"/achievements/project-devotion.png"},{id:"night_owl",scope:"local",icon:X,format:"count",art:"/achievements/night-owl.png"}],u=new Map(k.map(e=>[e.id,e])),m=new Map(k.map((e,a)=>[e.id,a]));function de(e,a){return`achievements.badge.${e}.${a}`}function ee(e){return[...e||[]].sort((a,t)=>{const c=(t?.tier||0)-(a?.tier||0);return c!==0?c:(m.get(a?.id)??99)-(m.get(t?.id)??99)})}function re(e){const a=(e||[]).filter(t=>t&&(t.tier||0)>=1&&u.has(t.id));return a.length===0?null:ee(a)[0]}const v={1:"bronze",2:"silver",3:"gold",4:"diamond"},ie=["bronze","silver","gold","diamond"],ae={bronze:{rim:["#a06a44","#5c3a22"],face:["#d29a6c","#96602f"],glyph:"#3f2817",ring:"#e8c3a0",sheen:"rgba(255, 236, 220, 0.45)",label:"#a06a44"},silver:{rim:["#aab3bb","#67707b"],face:["#dde2e7","#9ba5ae"],glyph:"#39424b",ring:"#f2f5f7",sheen:"rgba(255, 255, 255, 0.55)",label:"#8b959f"},gold:{rim:["#c9971c","#8a6508"],face:["#f2ca52","#cf9c26"],glyph:"#5c430e",ring:"#ffe9a8",sheen:"rgba(255, 248, 214, 0.55)",label:"#b8860b"},diamond:{rim:["#62b1e0","#7c6fd9"],face:["#c8ecf6","#84b4ea"],glyph:"#27496d",ring:"#eafcff",sheen:"rgba(255, 255, 255, 0.65)",label:"#5a9bd8"}},y={rim:["#a8ada9","#7c817d"],face:["#cdd2ce","#a3a8a4"],glyph:"#6a706c",ring:"#dde1de",sheen:"rgba(255, 255, 255, 0.25)",label:"#8b908c"};function te(e,a=!1){return a||!e||e<1?y:ae[v[Math.min(e,4)]]||y}function se(e){return v[e]||null}const g={xs:18,sm:24,md:44,xl:88,lg:108},f={xs:.75,sm:1,md:1.5,xl:2,lg:2};function le({badgeId:e,tier:a=0,size:t="md",locked:c=!1,label:i,className:M=""}){const s=u.get(e),h=c||!a||a<1,n=te(a,h),d=t==="fill",l=d?"100%":g[t]||g.md,b=d?4:f[t]||f.md,[_,x]=N.useState(!1),p=s?.icon||null,w=!!s?.art&&!_;return r.jsx("span",{role:i?"img":void 0,"aria-label":i||void 0,"aria-hidden":i?void 0:!0,className:`inline-flex shrink-0 rounded-full ${M}`,style:{width:l,height:l,padding:b,background:`linear-gradient(135deg, ${n.rim[0]} 0%, ${n.ring} 42%, ${n.rim[1]} 100%)`,boxShadow:d||t==="md"||t==="xl"||t==="lg"?"0 0 0 1px rgba(10, 15, 12, 0.06), 0 1px 2px rgba(10, 15, 12, 0.08)":void 0},children:w?r.jsx("img",{src:s.art,alt:"",draggable:!1,loading:"lazy",onError:()=>x(!0),className:"h-full w-full rounded-full object-cover",style:h?{filter:"grayscale(1)",opacity:.55}:void 0}):r.jsx("span",{className:"flex h-full w-full items-center justify-center rounded-full",style:{background:`linear-gradient(145deg, ${n.face[0]}, ${n.face[1]})`},children:p?r.jsx(p,{size:d?64:Math.round(l*.5),color:n.glyph,strokeWidth:2}):null})})}export{le as A,k as B,V as H,Q as T,ae as a,de as b,u as c,ie as d,re as h,te as p,ee as s,se as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/BadgeDetailModal-
|
|
2
|
-
import{r as l,G as
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/BadgeDetailModal-cSNqMLsK.js","assets/__vite-browser-external-5aLUeBkM.js","assets/__vite-browser-external-CRYifSM4.css","assets/react-BooKG84W.js","assets/AchievementBadge-CpxX02OK.js","assets/zap-Dvc_Jt1t.js","assets/flame-Bo4IdG6k.js","assets/use-transform-Bhar2U4w.js","assets/use-reduced-motion-abZbtoVS.js","assets/AchievementsSection-Sm43tnkh.js","assets/format-tokens-BSGC1-Gz.js","assets/DialogTitle-JS_04eUC.js","assets/useScrollLock-BhFzeRtR.js","assets/store-BBP4jx0R.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as l,G as h,H as f,I as v,j as e,c,L as p,d as g,a as y,J as b,K as k,_ as j}from"./__vite-browser-external-5aLUeBkM.js";import{A as w}from"./AchievementsSection-Sm43tnkh.js";import{B as x}from"./AchievementBadge-CpxX02OK.js";import"./react-BooKG84W.js";import"./format-tokens-BSGC1-Gz.js";import"./use-reduced-motion-abZbtoVS.js";import"./zap-Dvc_Jt1t.js";import"./flame-Bo4IdG6k.js";function N({enabled:a=!0}={}){const[n,t]=l.useState({status:"loading",achievements:[],error:null}),s=l.useMemo(()=>h(),[]);return l.useEffect(()=>{if(!a){t({status:"disabled",achievements:[],error:null});return}let i=!1;return t(r=>({...r,status:"loading"})),f({timeZone:s,tzOffsetMinutes:v()}).then(r=>{i||t({status:"ready",achievements:Array.isArray(r?.achievements)?r.achievements:[],error:null})}).catch(r=>{i||t({status:"error",achievements:[],error:r})}),()=>{i=!0}},[a,s]),n}const A=g.lazy(()=>j(()=>import("./BadgeDetailModal-cSNqMLsK.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])));function I({authLoading:a,authEnabled:n,authUserId:t,mockEnabled:s}){if(s)return{authLoading:!1,signedIn:!0,userId:"mock-user"};const i=!!(n&&t);return{authLoading:!!a,signedIn:i,userId:i?t:null}}function B(){const a=y(),[n,t]=l.useState({status:"loading",achievements:[],userId:null}),s=b(),{authLoading:i,signedIn:r,userId:o}=I({authLoading:a?.loading,authEnabled:a?.enabled,authUserId:a?.user?.id,mockEnabled:s});return l.useEffect(()=>{if(i){t({status:"loading",achievements:[],userId:null});return}if(!r){t({status:"signed-out",achievements:[],userId:null});return}let d=!1;return t({status:"loading",achievements:[],userId:o}),(async()=>{try{const u=s?null:await a.getAccessToken?.(),m=await k({accessToken:u,userId:o});if(d)return;t({status:"ready",achievements:Array.isArray(m?.badges)?m.badges:[],userId:o})}catch{d||t({status:"error",achievements:[],userId:o})}})(),()=>{d=!0}},[i,s,r,o]),{...n,signedIn:r,settled:_({authLoading:i,signedIn:r,userId:o,state:n})}}function _({authLoading:a,signedIn:n,userId:t,state:s}){return a?!1:n?s.userId===t&&(s.status==="ready"||s.status==="error"):s.status==="signed-out"}function S(){return e.jsx("div",{className:"mx-0 grid animate-pulse grid-cols-[repeat(3,max-content)] justify-between gap-y-7 sm:-mx-2 sm:grid-cols-[repeat(4,max-content)] lg:grid-cols-[repeat(5,max-content)]","aria-hidden":!0,children:Array.from({length:x.length}).map((a,n)=>e.jsxs("div",{className:"flex w-[6.75rem] flex-col items-center px-0 pb-3 pt-4 sm:w-[7.75rem]",children:[e.jsx("div",{className:"h-[108px] w-[108px] rounded-full bg-oai-gray-200 dark:bg-oai-gray-800"}),e.jsx("div",{className:"mt-3 h-3 w-16 rounded bg-oai-gray-200 dark:bg-oai-gray-800"}),e.jsx("div",{className:"mt-2 h-2 w-10 rounded bg-oai-gray-100 dark:bg-oai-gray-800/60"})]},n))})}function D(){const a=N(),n=B(),[t,s]=l.useState(null),i=a.status==="loading"||!n.settled,r=l.useMemo(()=>[...n.achievements||[],...a.achievements||[]],[n.achievements,a.achievements]),o=l.useMemo(()=>r.filter(u=>(u?.tier||0)>=1).length,[r]),d=x.length;return e.jsxs("div",{className:"flex flex-1 flex-col font-oai text-oai-black antialiased dark:text-oai-white",children:[e.jsx("main",{className:"flex-1 pb-12 pt-8 sm:pb-16 sm:pt-10",children:e.jsxs("div",{className:"mx-auto max-w-4xl px-4 sm:px-6",children:[e.jsxs("div",{className:"mb-7 flex items-baseline justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-3xl font-semibold tracking-tight text-oai-black dark:text-white sm:text-4xl",children:c("achievements.page.title")}),e.jsx("p",{className:"mt-1.5 text-sm text-oai-gray-500 dark:text-oai-gray-400",children:c("achievements.page.local_note")})]}),!i&&e.jsxs("div",{className:"shrink-0 text-right",children:[e.jsxs("div",{className:"font-mono text-2xl font-semibold leading-none tabular-nums text-oai-black dark:text-white",children:[o,e.jsxs("span",{className:"text-oai-gray-400 dark:text-oai-gray-600",children:["/",d]})]}),e.jsx("div",{className:"mt-2 h-1 w-24 overflow-hidden rounded-full bg-oai-gray-200 dark:bg-oai-gray-800",children:e.jsx("div",{className:"h-full rounded-full bg-oai-brand-600 transition-[width] duration-500",style:{width:`${Math.round(o/d*100)}%`}})})]})]}),!n.signedIn&&!i&&e.jsxs("div",{className:"mb-6 flex flex-wrap items-center justify-between gap-x-4 gap-y-2 rounded-xl border border-oai-gray-200 bg-oai-gray-50 px-4 py-3 dark:border-oai-gray-800 dark:bg-oai-gray-900/60",children:[e.jsx("p",{className:"text-sm text-oai-gray-600 dark:text-oai-gray-300",children:c("achievements.signin.prompt")}),e.jsx(p,{to:"/login",className:"shrink-0 rounded-lg bg-oai-brand-600 px-3 py-1.5 text-sm font-medium text-white transition-colors duration-200 hover:bg-oai-brand-700 active:scale-[0.98]",children:c("achievements.signin.action")})]}),i?e.jsx(S,{}):e.jsxs(e.Fragment,{children:[e.jsx(w,{achievements:r,isOwn:!0,columns:"wide",size:"lg",animateIn:!0,onSelect:s}),e.jsxs("p",{className:"mt-10 text-center text-xs text-oai-gray-400 dark:text-oai-gray-500",children:[c("achievements.page.suggest")," ",e.jsx("a",{href:"https://github.com/xiufengsun/TokenTracker/issues",target:"_blank",rel:"noopener noreferrer",className:"underline decoration-oai-gray-300 underline-offset-2 transition-colors hover:text-oai-gray-700 hover:decoration-oai-gray-500 dark:decoration-oai-gray-600 dark:hover:text-oai-gray-300",children:c("achievements.page.suggest_link")})]})]})]})}),t&&e.jsx(g.Suspense,{fallback:null,children:e.jsx(A,{badge:t,onClose:()=>s(null)})})]})}export{_ as cloudBadgesSettled,D as default,I as resolveCloudBadgeIdentity};
|
package/dashboard/dist/assets/{AchievementsSection-DebeB3vT.js → AchievementsSection-Sm43tnkh.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as _,j as s,c as l}from"./__vite-browser-external-
|
|
1
|
+
import{m as _,j as s,c as l}from"./__vite-browser-external-5aLUeBkM.js";import{m as $}from"./react-BooKG84W.js";import{B as x,s as b,b as C,t as T,A as B,a as E}from"./AchievementBadge-CpxX02OK.js";import{f as L}from"./format-tokens-BSGC1-Gz.js";import{u as I}from"./use-reduced-motion-abZbtoVS.js";const D=[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]],F=_("hard-drive",D);function V(r,i){const t=Number(i)||0;switch(r){case"tokens":return L(t);case"rank":return`#${Math.round(t)}`;case"multiplier":return`${(Math.round(t*10)/10).toString()}×`;default:return Math.round(t).toLocaleString()}}function H(r){if(!r)return 0;const i=Number(r.next_threshold),t=Number(r.metric_value??r.value);if(!Number.isFinite(i)||i<=0)return r.tier>=4?1:0;if(!Number.isFinite(t)||t<=0)return 0;const o=r.lower_is_better?i/t:t/i;return Math.max(0,Math.min(1,o))}function q(r){const i=r?.achieved||{},t=Object.values(i).map(o=>o?Date.parse(o):NaN).filter(o=>Number.isFinite(o));return t.length>0?Math.max(...t):null}function K({achievements:r,isOwn:i=!1,scope:t,onSelect:o,size:m="xl",columns:v="default",animateIn:y=!1,className:N=""}){const k=I(),u=y&&!k,p=new Map;for(const e of Array.isArray(r)?r:[])e&&e.id&&p.set(e.id,e);const g=t?x.filter(e=>e.scope===t):x;let c;if(i){const e=g.map(a=>({entry:a,record:p.get(a.id)||{id:a.id,tier:0}})),n=b(e.filter(a=>(a.record.tier||0)>=1).map(a=>({...a,id:a.entry.id,tier:a.record.tier}))),h=e.filter(a=>(a.record.tier||0)<1);c=[...n,...h]}else c=b(g.map(e=>({entry:e,record:p.get(e.id)})).filter(e=>e.record&&(e.record.tier||0)>=1).map(e=>({...e,id:e.entry.id,tier:e.record.tier}))).map(({entry:e,record:n})=>({entry:e,record:n}));if(c.length===0)return null;const j=v==="wide"?"grid-cols-[repeat(3,max-content)] sm:grid-cols-[repeat(4,max-content)] lg:grid-cols-[repeat(5,max-content)]":"grid-cols-[repeat(3,max-content)] sm:grid-cols-[repeat(4,max-content)]",w=m==="lg"?"mx-0 sm:-mx-2":"-mx-2 sm:-mx-4",M=m==="lg"?"px-0":"px-1";return s.jsx("div",{className:`${w} grid justify-between gap-y-7 ${j} ${N}`,children:c.map(({entry:e,record:n},h)=>{const a=(n.tier||0)>=1,f=l(C(e.id,"name")),d=a?T(n.tier):null,A=H(n);return s.jsxs($.button,{type:"button",initial:u?{opacity:0,y:16,scale:.9}:!1,animate:u?{opacity:1,y:0,scale:1}:void 0,whileTap:u?{scale:.97}:void 0,transition:{delay:.05+h*.035,duration:.45,ease:[.16,1,.3,1]},onClick:o?()=>o({...n,id:e.id}):void 0,className:`group flex w-[6.75rem] flex-col items-center rounded-xl ${M} pb-3 pt-4 text-center transition-[background-color,transform] duration-200 ease-out hover:bg-oai-gray-50 active:scale-[0.97] dark:hover:bg-oai-gray-900/70 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand/60 sm:w-[7.75rem]`,"aria-label":l("achievements.badge.aria",{name:f,tier:d?l(`achievements.tier.${d}`):l("achievements.modal.locked")}),children:[s.jsx(B,{badgeId:e.id,tier:n.tier,locked:!a,size:m,className:"transition-transform duration-200 ease-out group-hover:-translate-y-0.5 group-hover:scale-105"}),s.jsxs("span",{className:"mt-2.5 flex w-full items-center justify-center gap-1",children:[s.jsx("span",{title:f,className:"min-w-0 truncate text-xs font-medium leading-tight text-oai-gray-800 dark:text-oai-gray-200",children:f}),e.scope==="local"&&s.jsx("span",{title:l("achievements.page.local_note"),"aria-label":l("achievements.scope.local"),className:"inline-flex shrink-0 text-oai-gray-400 dark:text-oai-gray-500",children:s.jsx(F,{size:11,strokeWidth:2,"aria-hidden":!0})})]}),s.jsx("span",{className:"mt-1 flex h-4 w-full items-center justify-center",children:a?s.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-[0.08em]",style:{color:E[d]?.label},children:l(`achievements.tier.${d}`)}):i?s.jsx("span",{className:"h-[3px] w-14 overflow-hidden rounded-full bg-oai-gray-200 dark:bg-oai-gray-800",children:s.jsx("span",{className:"block h-full rounded-full bg-oai-brand/70",style:{width:`${Math.round(A*100)}%`}})}):null})]},e.id)})})}export{K as A,H as b,V as f,q as l};
|