ccgauge 0.4.0 → 1.0.1
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/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-build-manifest.json +37 -37
- package/.next/standalone/.next/app-path-routes-manifest.json +5 -5
- package/.next/standalone/.next/build-manifest.json +2 -2
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/server/app/_not-found/page.js +2 -2
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/blocks/route.js +1 -1
- package/.next/standalone/.next/server/app/api/blocks/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/blocks/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/export/usage/route.js +1 -1
- package/.next/standalone/.next/server/app/api/export/usage/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/export/usage/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/pricing/route.js +1 -1
- package/.next/standalone/.next/server/app/api/pricing/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/route.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/scan/route.js +1 -1
- package/.next/standalone/.next/server/app/api/scan/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/scan/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/sessions/route.js +1 -1
- package/.next/standalone/.next/server/app/api/sessions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/usage/route.js +1 -1
- package/.next/standalone/.next/server/app/api/usage/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/usage/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/models/page.js +2 -2
- package/.next/standalone/.next/server/app/models/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/models/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/page.js +2 -2
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/projects/[id]/page.js +2 -2
- package/.next/standalone/.next/server/app/projects/[id]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/projects/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/projects/page.js +2 -2
- package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/sessions/[id]/page.js +2 -2
- package/.next/standalone/.next/server/app/sessions/[id]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/sessions/page.js +2 -2
- package/.next/standalone/.next/server/app/sessions/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings/page.js +2 -2
- package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/usage/page.js +3 -2
- package/.next/standalone/.next/server/app/usage/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/usage/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app-paths-manifest.json +5 -5
- package/.next/standalone/.next/server/chunks/155.js +1 -0
- package/.next/standalone/.next/server/chunks/567.js +28 -0
- package/.next/standalone/.next/server/chunks/716.js +1 -1
- package/.next/standalone/.next/server/chunks/775.js +1 -1
- package/.next/standalone/.next/server/functions-config-manifest.json +3 -3
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/static/chunks/148-d2db1767205d1ca8.js +1 -0
- package/.next/standalone/.next/static/chunks/app/{error-89ee9e078058915d.js → error-3e48784f89c5ae8d.js} +1 -1
- package/.next/standalone/.next/static/chunks/app/layout-ca9328306c8cbb8e.js +1 -0
- package/.next/standalone/.next/static/chunks/app/models/page-dcd29049a7b0641c.js +1 -0
- package/.next/standalone/.next/static/chunks/app/page-11fc9a0ded501248.js +1 -0
- package/.next/standalone/.next/static/chunks/app/projects/[id]/page-d6725ed17b04a743.js +1 -0
- package/.next/standalone/.next/static/chunks/app/sessions/[id]/page-d6725ed17b04a743.js +1 -0
- package/.next/standalone/.next/static/chunks/app/settings/page-cfeb089549c94f88.js +1 -0
- package/.next/standalone/.next/static/chunks/app/usage/page-63c230b1e2c5c63c.js +1 -0
- package/.next/standalone/.next/static/css/b34dbb2d1cbeaf5e.css +3 -0
- package/.next/standalone/package.json +15 -4
- package/CHANGELOG.md +192 -0
- package/README.md +41 -2
- package/README.zh-CN.md +50 -2
- package/bin/cli.mjs +95 -3
- package/dist/mcp/server.mjs +151 -30
- package/dist/report/index.mjs +2177 -0
- package/package.json +15 -4
- package/.next/standalone/.next/server/chunks/426.js +0 -23
- package/.next/standalone/.next/server/chunks/520.js +0 -1
- package/.next/standalone/.next/static/chunks/454-d0e7d0fa6f643c41.js +0 -1
- package/.next/standalone/.next/static/chunks/app/layout-a6e30ba3a7f39737.js +0 -1
- package/.next/standalone/.next/static/chunks/app/models/page-e0e1b5979547421a.js +0 -1
- package/.next/standalone/.next/static/chunks/app/page-9347dfa20dabb24b.js +0 -1
- package/.next/standalone/.next/static/chunks/app/projects/[id]/page-5804875e3dc384df.js +0 -1
- package/.next/standalone/.next/static/chunks/app/sessions/[id]/page-5804875e3dc384df.js +0 -1
- package/.next/standalone/.next/static/chunks/app/settings/page-334168b522eac1b1.js +0 -1
- package/.next/standalone/.next/static/chunks/app/usage/page-7789fec27778df9a.js +0 -1
- package/.next/standalone/.next/static/css/c34cd36ce5fc39e2.css +0 -3
- /package/.next/standalone/.next/static/{w_l54xHgbhALYXmZcmUxC → 2kImy5ZkabMplKu3i19s7}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{w_l54xHgbhALYXmZcmUxC → 2kImy5ZkabMplKu3i19s7}/_ssgManifest.js +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ccgauge",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Local web dashboard for Claude Code and OpenAI Codex CLI token usage and cost",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude",
|
|
@@ -32,6 +32,15 @@
|
|
|
32
32
|
"engines": {
|
|
33
33
|
"node": ">=20"
|
|
34
34
|
},
|
|
35
|
+
"os": [
|
|
36
|
+
"darwin",
|
|
37
|
+
"linux",
|
|
38
|
+
"win32"
|
|
39
|
+
],
|
|
40
|
+
"cpu": [
|
|
41
|
+
"x64",
|
|
42
|
+
"arm64"
|
|
43
|
+
],
|
|
35
44
|
"packageManager": "pnpm@10.30.3",
|
|
36
45
|
"bin": {
|
|
37
46
|
"ccgauge": "bin/cli.mjs"
|
|
@@ -40,22 +49,24 @@
|
|
|
40
49
|
"bin/cli.mjs",
|
|
41
50
|
".next/standalone",
|
|
42
51
|
"dist/mcp",
|
|
52
|
+
"dist/report",
|
|
43
53
|
"README.md",
|
|
44
54
|
"README.zh-CN.md",
|
|
45
55
|
"CHANGELOG.md",
|
|
46
56
|
"LICENSE"
|
|
47
57
|
],
|
|
48
58
|
"scripts": {
|
|
49
|
-
"dev": "next dev -p
|
|
50
|
-
"build": "next build && node scripts/build-mcp.mjs && node scripts/postbuild.mjs",
|
|
59
|
+
"dev": "next dev -p 3738",
|
|
60
|
+
"build": "next build && node scripts/build-mcp.mjs && node scripts/build-report.mjs && node scripts/postbuild.mjs",
|
|
51
61
|
"build:mcp": "node scripts/build-mcp.mjs",
|
|
62
|
+
"build:report": "node scripts/build-report.mjs",
|
|
52
63
|
"start": "node bin/cli.mjs",
|
|
53
64
|
"start:next": "next start -p 3737",
|
|
54
65
|
"lint": "eslint .",
|
|
55
66
|
"typecheck": "tsc --noEmit",
|
|
56
67
|
"test": "node --experimental-strip-types --no-warnings scripts/test-codex-parser.mjs",
|
|
57
68
|
"test:mcp": "node scripts/test-mcp-server.mjs",
|
|
58
|
-
"clean": "
|
|
69
|
+
"clean": "node -e \"for (const p of ['.next','node_modules','tsconfig.tsbuildinfo']) require('node:fs').rmSync(p,{recursive:true,force:true})\"",
|
|
59
70
|
"screenshots": "node scripts/screenshots.mjs",
|
|
60
71
|
"prepack": "pnpm build"
|
|
61
72
|
},
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
exports.id=426,exports.ids=[426],exports.modules={7475:(a,b,c)=>{"use strict";c.d(b,{CY:()=>i,s9:()=>j,kj:()=>k});var d=c(21124),e=c(38301),f=c(42378);let g={en:{"brand.tagline":"usage dashboard for AI coding CLIs","nav.overview":"Overview","nav.usage":"Usage","nav.sessions":"Sessions","nav.projects":"Projects","nav.models":"Models","nav.settings":"Settings","nav.localBadge":"local","nav.source":"Data source","source.claude":"Claude","source.codex":"Codex","cost.footnote.codex":"Cost shown is the OpenAI API equivalent (subscription plans pay differently).","common.requests":"requests","common.tokens":"tokens","common.cost":"Cost","common.savedViaCache":"Saved {amount} via cache","common.savedTodayViaCache":"Saved {amount} today","common.live":"live","common.allModels":"All","common.allProjects":"All","common.unknown":"(unknown)","common.session":"Session","common.sessions":"sessions","common.projects":"projects","common.req":"req","common.day":"day","common.days":"days","common.activity":"activity","common.fallbackPrice":"fallback price","common.thinking":"thinking","common.lastActivity":"last activity","common.empty.title":"No usage data yet","common.empty.desc":"Open Claude Code, send a message, then refresh.","common.refresh":"Refresh","common.search":"Search…","common.searchPlaceholder":"Search model, project, session, tool…","common.exportCsv":"Export CSV","common.rows":"{count} rows","common.prev":"‹ Prev","common.next":"Next ›","common.first":"\xab","common.last":"\xbb","common.pageOf":"Page {page} of {total}","common.allSessions":"← All sessions","common.allProjectsLink":"← All projects","common.noMatchingRows":"No matching rows","range.label":"Date range","range.today":"Today","range.7d":"7d","range.30d":"30d","range.90d":"90d","range.all":"All","gran.label":"Granularity","gran.hour":"Hour","gran.day":"Day","gran.week":"Week","gran.month":"Month","overview.title":"Overview","overview.subtitle":"{count} requests across {files} files \xb7 scan in {ms}ms","overview.subtitle.empty":"Scanned {dirs} directory(ies). Open Claude Code, send a message, then refresh.","overview.empty.title":"No usage data yet","overview.kpi.tokensToday":"Tokens today","overview.kpi.costToday":"Cost today","overview.kpi.thisMonth":"This month","overview.kpi.cacheHit":"Cache hit rate","overview.kpi.topModel":"Top model","overview.kpi.activeSessions":"Sessions today","overview.kpi.activeSessions.hint":"{count} project(s)","overview.kpi.thisMonth.hint":"{tokens} tokens \xb7 {req} req","overview.kpi.tokensToday.hint":"{count} requests","overview.kpi.topModel.hint":"{pct} of cost this month","overview.kpi.cacheHit.hint":"Saved {amount} today","overview.delta.title":"vs yesterday","overview.delta.firstTime":"NEW","common.loading":"Loading…","common.error.title":"Something went wrong","common.error.desc":"Failed to load this page. Try again.","common.error.retry":"Retry","overview.trend.title":"Token usage trend","overview.trend.desc":"Last 30 days \xb7 stacked by token type","overview.trend.activeDays":"{n} day with activity","overview.trend.activeDays.plural":"{n} days with activity","overview.costByModel.title":"Cost by model","overview.costByModel.desc":"This month, sorted by spend","block.title":"Active 5h block","block.remaining":"remaining","block.elapsed":"{pct}% elapsed","block.tokensSuffix":"tokens","block.spentSoFar":"Spent so far","block.burnPerMin":"Burn / min","block.projectedTotal":"Projected total","block.requests":"Requests","block.empty":"No active block","block.emptyDesc":"Send a message in Claude Code to start one.","chart.legend.input":"Input","chart.legend.output":"Output","chart.legend.cacheRead":"Cache read","chart.legend.cacheWrite":"Cache write","chart.tooltip.total":"Total","chart.tooltip.cost":"Cost","chart.tooltip.requests":"Requests","chart.empty":"No data in this range","chart.empty.short":"No data","usage.title":"Usage","usage.subtitle":"{count} turns in selected range","usage.col.calls":"Calls","usage.col.userMessage":"Prompt","usage.turn.expand":"Expand","usage.turn.collapse":"Collapse","usage.turn.callsCount":"{count} calls","usage.turn.noPrompt":"(no user text)","usage.requests.desc":"One row per turn (user message + tool calls); click ▸ to expand","usage.kpi.totalTokens":"Total tokens","usage.kpi.totalCost":"Total cost","usage.kpi.cacheSaved":"Cache saved","usage.kpi.cacheHit":"Cache hit","usage.trend":"Trend","usage.trend.gran":"Granularity: {gran}","usage.requests.title":"Requests","usage.col.time":"Time","usage.col.model":"Model","usage.col.project":"Project","usage.col.session":"Session","usage.col.input":"Input","usage.col.output":"Output","usage.col.cacheRead":"Cache R","usage.col.cacheWrite":"Cache W","usage.col.cost":"Cost","usage.col.tools":"Tools","usage.col.total":"Total","usage.columns.button":"Columns","usage.columns.title":"Visible columns","usage.columns.reset":"Reset","usage.breakdown.title":"Token breakdown","usage.breakdown.headerTokens":"Tokens","usage.breakdown.headerCost":"Cost","usage.breakdown.total":"Total","usage.breakdown.reasoning":"reasoning","usage.breakdown.reasoningNote":"incl. above","filter.modelLabel":"Model","filter.projectLabel":"Project","filter.modelAll":"Model: All","filter.projectAll":"Project: All","filter.modelSingle":"Model: {value}","filter.projectSingle":"Project: {value}","filter.modelMulti":"Model: {count}","filter.projectMulti":"Project: {count}","filter.clearAll":"Clear all","filter.noOptions":"No options","sessions.title":"Sessions","sessions.subtitle":"{count} sessions \xb7 sorted by most recent activity","sessions.col.session":"Session","sessions.col.project":"Project","sessions.col.models":"Model(s)","sessions.col.requests":"Requests","sessions.col.tokens":"Tokens","sessions.col.cost":"Cost","sessions.col.duration":"Duration","sessions.col.lastActivity":"Last activity","sessions.untitled":"Session {hash}","sessions.empty":"No sessions yet","session.kpi.requests":"Requests","session.kpi.totalTokens":"Total tokens","session.kpi.cost":"Cost","session.kpi.duration":"Duration","session.timeline.title":"Message timeline","session.timeline.desc":"In order; newest at the bottom","session.perMessage.title":"Per-message tokens","session.modelsInSession":"Models in this session","session.modelLine":"{requests} req \xb7 {tokens} tokens","session.token.in":"in","session.token.out":"out","session.token.cacheR":"cache r","session.token.cacheW":"cache w","projects.title":"Projects","projects.subtitle":"{count} projects \xb7 sorted by spend","projects.empty":"No projects yet","projects.stat.sessions":"Sessions","projects.stat.requests":"Requests","projects.stat.tokens":"Tokens","project.activity":"Activity (last 30 days)","project.sessions.title":"Sessions ({count})","models.title":"Models","models.subtitle":"{count} model(s) used in total","models.empty":"No model usage yet","models.share.cost":"Cost share","models.share.tokens":"Tokens share","models.share.cacheHit":"Cache hit","models.field.requests":"Requests","models.field.savedByCache":"Saved by cache","models.field.input1M":"Input / 1M","models.field.output1M":"Output / 1M","models.field.cacheRead1M":"Cache read / 1M","models.field.pctOfTotal":"{pct} of total spend \xb7 {tokens} tokens","models.eachTrend":"Combined trend (last 30 days)","settings.title":"Settings","settings.subtitle":"Data sources, pricing, and behavior","settings.dataSources.title":"Data sources","settings.dataSources.desc":"ccgauge scans these locations for JSONL files","settings.dataSources.active":"active","settings.dataSources.notPresent":"not present","settings.dataSources.envHint":"Override with {env1} or {env2} environment variables (the dashboard appends {appendix}).","settings.rescan":"Rescan now","settings.rescanning":"Rescanning…","settings.scanStats.title":"Scan stats","settings.scanStats.files":"Files scanned","settings.scanStats.records":"Records parsed","settings.scanStats.assistant":"Assistant records (deduped)","settings.scanStats.duration":"Scan duration","settings.pricing.title":"Pricing table","settings.pricing.desc":"USD per 1M tokens \xb7 built-in snapshot, fuzzy match for date-suffixed model names","settings.pricing.col.model":"Model","settings.pricing.col.input":"Input","settings.pricing.col.output":"Output","settings.pricing.col.write5m":"Cache write 5m","settings.pricing.col.write1h":"Cache write 1h","settings.pricing.col.read":"Cache read","settings.preferences.title":"Preferences","settings.preferences.language":"Language","settings.preferences.theme":"Theme","settings.theme.light":"Light","settings.theme.dark":"Dark","settings.theme.system":"System","settings.about.title":"About","settings.about.subtitle":"Version {version} \xb7 MIT licensed","settings.about.line1":"Fully local: data never leaves your machine; no telemetry, no network calls.","settings.about.line2":"Read-only: ccgauge only reads JSONL files, never writes back to ~/.claude.","settings.about.line3":'Cache: scan results are memoized for 5s; click "Rescan" to force a fresh read.',"settings.about.line4":"Stop with Ctrl+C in the terminal that started ccgauge.","settings.indexer.desc":"Background indexer keeps the cache fresh via file watchers.","settings.indexer.lastIndexedAt":"Last indexed","settings.indexer.indexDuration":"Last index time","settings.indexer.watchers":"Active watchers","settings.indexer.loadedFromDisk":"Loaded from disk","settings.indexer.status":"Status","settings.indexer.indexing":"indexing…","settings.indexer.idle":"idle","settings.indexer.recentErrors":"Recent indexer errors","common.yes":"yes","common.no":"no","lang.label":"Language","lang.en":"English","lang.zh":"中文","theme.label":"Theme"},zh:{"brand.tagline":"AI 编程 CLI 的本地用量看板","nav.overview":"概览","nav.usage":"用量","nav.sessions":"会话","nav.projects":"项目","nav.models":"模型","nav.settings":"设置","nav.localBadge":"本地","nav.source":"数据源","source.claude":"Claude","source.codex":"Codex","cost.footnote.codex":"按 OpenAI API 单价折算估值(订阅计划实际计费不同)","common.requests":"次请求","common.tokens":"tokens","common.cost":"花费","common.savedViaCache":"通过缓存节省 {amount}","common.savedTodayViaCache":"今日缓存节省 {amount}","common.live":"进行中","common.allModels":"全部","common.allProjects":"全部","common.unknown":"(未知)","common.session":"会话","common.sessions":"个会话","common.projects":"个项目","common.req":"请求","common.day":"天","common.days":"天","common.activity":"活跃","common.fallbackPrice":"使用兜底单价","common.thinking":"思考","common.lastActivity":"最近活跃","common.empty.title":"暂无用量数据","common.empty.desc":"打开 Claude Code 发送一条消息后刷新本页。","common.refresh":"刷新","common.search":"搜索…","common.searchPlaceholder":"搜索模型 / 项目 / 会话 / 工具…","common.exportCsv":"导出 CSV","common.rows":"{count} 行","common.prev":"‹ 上一页","common.next":"下一页 ›","common.first":"\xab","common.last":"\xbb","common.pageOf":"第 {page} / {total} 页","common.allSessions":"← 返回会话列表","common.allProjectsLink":"← 返回项目列表","common.noMatchingRows":"没有匹配的记录","range.label":"时间范围","range.today":"今天","range.7d":"7 天","range.30d":"30 天","range.90d":"90 天","range.all":"全部","gran.label":"粒度","gran.hour":"小时","gran.day":"天","gran.week":"周","gran.month":"月","overview.title":"概览","overview.subtitle":"{count} 次请求,覆盖 {files} 个文件 \xb7 扫描耗时 {ms}ms","overview.subtitle.empty":"已扫描 {dirs} 个目录。打开 Claude Code 发一条消息后刷新本页。","overview.empty.title":"暂无用量数据","overview.kpi.tokensToday":"今日 tokens","overview.kpi.costToday":"今日花费","overview.kpi.thisMonth":"本月累计","overview.kpi.cacheHit":"缓存命中率","overview.kpi.topModel":"主力模型","overview.kpi.activeSessions":"今日会话","overview.kpi.activeSessions.hint":"涉及 {count} 个项目","overview.kpi.thisMonth.hint":"{tokens} tokens \xb7 {req} 次请求","overview.kpi.tokensToday.hint":"{count} 次请求","overview.kpi.topModel.hint":"本月成本占比 {pct}","overview.kpi.cacheHit.hint":"今日缓存节省 {amount}","overview.delta.title":"相比昨日","overview.delta.firstTime":"首次","common.loading":"加载中…","common.error.title":"出错了","common.error.desc":"加载失败,请重试。","common.error.retry":"重试","overview.trend.title":"Token 用量趋势","overview.trend.desc":"近 30 天 \xb7 按 token 类型堆叠","overview.trend.activeDays":"{n} 天有数据","overview.trend.activeDays.plural":"{n} 天有数据","overview.costByModel.title":"按模型成本分布","overview.costByModel.desc":"本月,按花费排序","block.title":"当前 5h block","block.remaining":"剩余","block.elapsed":"已用 {pct}%","block.tokensSuffix":"tokens","block.spentSoFar":"已花费","block.burnPerMin":"每分钟消耗","block.projectedTotal":"预计总花费","block.requests":"请求数","block.empty":"当前无活跃 block","block.emptyDesc":"在 Claude Code 中发送消息会启动一个新 block。","chart.legend.input":"输入","chart.legend.output":"输出","chart.legend.cacheRead":"缓存读取","chart.legend.cacheWrite":"缓存写入","chart.tooltip.total":"合计","chart.tooltip.cost":"花费","chart.tooltip.requests":"请求数","chart.empty":"区间内无数据","chart.empty.short":"暂无数据","usage.title":"用量明细","usage.subtitle":"当前筛选范围内 {count} 轮对话","usage.kpi.totalTokens":"总 tokens","usage.kpi.totalCost":"总花费","usage.kpi.cacheSaved":"缓存节省","usage.kpi.cacheHit":"缓存命中","usage.trend":"趋势","usage.trend.gran":"粒度:{gran}","usage.requests.title":"对话轮次","usage.requests.desc":"每轮对话一行(用户消息 + 工具调用),点击 ▸ 展开明细","usage.col.calls":"调用","usage.col.userMessage":"提示","usage.turn.expand":"展开","usage.turn.collapse":"收起","usage.turn.callsCount":"{count} 次调用","usage.turn.noPrompt":"(无用户文本)","usage.col.time":"时间","usage.col.model":"模型","usage.col.project":"项目","usage.col.session":"会话","usage.col.input":"输入","usage.col.output":"输出","usage.col.cacheRead":"缓存读","usage.col.cacheWrite":"缓存写","usage.col.cost":"花费","usage.col.tools":"工具","usage.col.total":"总量","usage.columns.button":"列","usage.columns.title":"显示列","usage.columns.reset":"重置","usage.breakdown.title":"总量明细","usage.breakdown.headerTokens":"Token","usage.breakdown.headerCost":"花费","usage.breakdown.total":"合计","usage.breakdown.reasoning":"其中推理","usage.breakdown.reasoningNote":"已含在 output","filter.modelLabel":"模型","filter.projectLabel":"项目","filter.modelAll":"模型:全部","filter.projectAll":"项目:全部","filter.modelSingle":"模型:{value}","filter.projectSingle":"项目:{value}","filter.modelMulti":"模型:{count} 个","filter.projectMulti":"项目:{count} 个","filter.clearAll":"清除筛选","filter.noOptions":"没有可选项","sessions.title":"会话","sessions.subtitle":"共 {count} 个会话 \xb7 按最近活跃排序","sessions.col.session":"会话","sessions.col.project":"项目","sessions.col.models":"模型","sessions.col.requests":"请求数","sessions.col.tokens":"Tokens","sessions.col.cost":"花费","sessions.col.duration":"时长","sessions.col.lastActivity":"最近活跃","sessions.untitled":"会话 {hash}","sessions.empty":"暂无会话","session.kpi.requests":"请求数","session.kpi.totalTokens":"总 tokens","session.kpi.cost":"花费","session.kpi.duration":"时长","session.timeline.title":"消息时间线","session.timeline.desc":"按时间正序,最新的在最下方","session.perMessage.title":"逐条消息 tokens","session.modelsInSession":"本会话使用的模型","session.modelLine":"{requests} 次 \xb7 {tokens} tokens","session.token.in":"输入","session.token.out":"输出","session.token.cacheR":"缓存读","session.token.cacheW":"缓存写","projects.title":"项目","projects.subtitle":"共 {count} 个项目 \xb7 按花费排序","projects.empty":"暂无项目","projects.stat.sessions":"会话","projects.stat.requests":"请求","projects.stat.tokens":"Tokens","project.activity":"活跃情况(近 30 天)","project.sessions.title":"会话({count})","models.title":"模型","models.subtitle":"共使用过 {count} 个模型","models.empty":"暂无模型用量","models.share.cost":"成本占比","models.share.tokens":"Tokens 占比","models.share.cacheHit":"缓存命中","models.field.requests":"请求数","models.field.savedByCache":"缓存节省","models.field.input1M":"输入 / 1M","models.field.output1M":"输出 / 1M","models.field.cacheRead1M":"缓存读 / 1M","models.field.pctOfTotal":"占总花费 {pct} \xb7 {tokens} tokens","models.eachTrend":"整体趋势(近 30 天)","settings.title":"设置","settings.subtitle":"数据源、价格表与行为偏好","settings.dataSources.title":"数据源","settings.dataSources.desc":"ccgauge 会扫描以下路径的 JSONL 文件","settings.dataSources.active":"已启用","settings.dataSources.notPresent":"不存在","settings.dataSources.envHint":"可以通过环境变量 {env1} 或 {env2} 自定义路径(看板会自动追加 {appendix})。","settings.rescan":"立即重新扫描","settings.rescanning":"扫描中…","settings.scanStats.title":"扫描统计","settings.scanStats.files":"扫描文件数","settings.scanStats.records":"解析记录数","settings.scanStats.assistant":"去重后 assistant 记录","settings.scanStats.duration":"扫描耗时","settings.pricing.title":"价格表","settings.pricing.desc":"美元 / 1M tokens \xb7 内置快照,对带日期后缀的模型名做 fuzzy 匹配","settings.pricing.col.model":"模型","settings.pricing.col.input":"输入","settings.pricing.col.output":"输出","settings.pricing.col.write5m":"缓存写入 5 分钟","settings.pricing.col.write1h":"缓存写入 1 小时","settings.pricing.col.read":"缓存读取","settings.preferences.title":"偏好设置","settings.preferences.language":"语言","settings.preferences.theme":"主题","settings.theme.light":"亮色","settings.theme.dark":"暗色","settings.theme.system":"跟随系统","settings.about.title":"关于","settings.about.subtitle":"版本 {version} \xb7 MIT 协议","settings.about.line1":"完全本地:数据从不离开你的机器,没有任何遥测、没有任何网络调用。","settings.about.line2":"只读:ccgauge 只读取 JSONL,绝不会写回 ~/.claude。","settings.about.line3":'缓存:扫描结果会缓存 5 秒;点击"重新扫描"可强制刷新。',"settings.about.line4":"在启动 ccgauge 的终端按 Ctrl+C 即可停止。","settings.indexer.desc":"后台 indexer 通过文件监听增量维护缓存。","settings.indexer.lastIndexedAt":"最近索引时间","settings.indexer.indexDuration":"最近索引耗时","settings.indexer.watchers":"活跃 watcher 数","settings.indexer.loadedFromDisk":"从磁盘恢复","settings.indexer.status":"状态","settings.indexer.indexing":"索引中…","settings.indexer.idle":"空闲","settings.indexer.recentErrors":"最近的索引错误","common.yes":"是","common.no":"否","lang.label":"语言","lang.en":"English","lang.zh":"中文","theme.label":"主题"}},h=(0,e.createContext)({locale:"en",setLocale:()=>{},t:a=>a});function i({initialLocale:a,children:b}){let c=(0,f.useRouter)(),i=(0,e.useCallback)(a=>{try{localStorage.setItem("ccgauge.locale",a)}catch{}document.cookie=`ccgauge_locale=${a}; path=/; max-age=31536000; SameSite=Lax`,c.refresh()},[c]),j=(0,e.useCallback)((b,c)=>(function(a,b,c){let d=g[a]?.[b];if(void 0===d&&(d=g.en[b]),void 0===d&&(d=b),c)for(let[a,b]of Object.entries(c))d=d.replace(RegExp(`\\{${a}\\}`,"g"),String(b));return d})(a,b,c),[a]),k=(0,e.useMemo)(()=>({locale:a,setLocale:i,t:j}),[a,i,j]);return(0,d.jsx)(h.Provider,{value:k,children:b})}function j(){return(0,e.useContext)(h)}function k(){return(0,e.useContext)(h).t}},11734:(a,b,c)=>{"use strict";c.d(b,{N:()=>h,D:()=>i});var d=c(21124),e=c(38301);let f=(0,e.createContext)({theme:"system",resolved:"dark",setTheme:()=>{}});function g(a){return"light"===a?"light":"dark"}function h({initialTheme:a,children:b}){let[c,h]=(0,e.useState)(a),[i,j]=(0,e.useState)(()=>"system"===a?"dark":a),k=(0,e.useCallback)(a=>{try{localStorage.setItem("ccgauge.theme",a)}catch{}document.cookie=`ccgauge_theme=${a}; path=/; max-age=31536000; SameSite=Lax`,h(a),j(g(a)),function(a){if("undefined"==typeof document)return;let b=document.documentElement,c=g(a);b.classList.remove("theme-light","theme-dark"),b.classList.add("light"===c?"theme-light":"theme-dark"),b.setAttribute("data-theme",c)}(a)},[]);return(0,d.jsx)(f.Provider,{value:{theme:c,resolved:i,setTheme:k},children:b})}function i(){return(0,e.useContext)(f)}},13132:(a,b,c)=>{Promise.resolve().then(c.bind(c,88267)),Promise.resolve().then(c.bind(c,17290))},15514:(a,b,c)=>{"use strict";c.d(b,{BC:()=>n,P6:()=>p,PJ:()=>m,R8:()=>k,az:()=>i,cn:()=>f,jh:()=>h,l7:()=>j,r6:()=>l});var d=c(43249),e=c(58829);function f(...a){return(0,e.QP)((0,d.$)(a))}function g(a,b){return new Intl.NumberFormat("en-US",{maximumFractionDigits:b?.maxFrac??0}).format(a)}function h(a,b="en"){return Number.isFinite(a)?"zh"===b?a>=1e8?(a/1e8).toFixed(2)+"亿":a>=1e4?(a/1e4).toFixed(1)+"万":g(a):a>=1e9?(a/1e9).toFixed(2)+"B":a>=1e6?(a/1e6).toFixed(2)+"M":a>=1e3?(a/1e3).toFixed(1)+"K":g(a):"0"}function i(a,b){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:b?.minFrac??2,maximumFractionDigits:b?.maxFrac??2}).format(a)}function j(a){return 0===a?"$0":a<.01?new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:4,maximumFractionDigits:6}).format(a):i(a)}function k(a,b=1){return Number.isFinite(a)?`${(100*a).toFixed(b)}%`:"0%"}function l(a){let b="string"==typeof a||"number"==typeof a?new Date(a):a;if(Number.isNaN(b.getTime()))return"";let c=b.getFullYear(),d=String(b.getMonth()+1).padStart(2,"0"),e=String(b.getDate()).padStart(2,"0"),f=String(b.getHours()).padStart(2,"0"),g=String(b.getMinutes()).padStart(2,"0"),h=String(b.getSeconds()).padStart(2,"0");return`${c}-${d}-${e} ${f}:${g}:${h}`}function m(a){if(!a)return"(unknown)";let b=a.replace(/\/+$/,"").split("/");return b[b.length-1]||a}function n(a,b=8){return a?a.replace(/-/g,"").slice(0,b):""}let o={mini:"Mini",nano:"Nano",pro:"Pro",turbo:"Turbo",preview:"Preview"};function p(a){if(!a)return"(unknown)";let b=a.replace(/^(vertex_ai|bedrock|anthropic|openai)\//,""),c=b.toLowerCase();if(c.startsWith("gpt-")||/^o\d/.test(c))return c.startsWith("gpt-")?"GPT-"+b.slice(4).split("-").map(a=>o[a.toLowerCase()]??a).join(" "):b.toUpperCase();let d=b.replace(/-(\d{8})$/,""),e=(d=d.replace(/^claude-/,"")).split("-");if(e.length>=2){let a=e[0],b=e.slice(1).join(".");return q(a)+" "+b}return q(d.replace(/-/g," "))}function q(a){return a.replace(/\b\w/g,a=>a.toUpperCase())}},16124:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,81170,23)),Promise.resolve().then(c.t.bind(c,23597,23)),Promise.resolve().then(c.t.bind(c,36893,23)),Promise.resolve().then(c.t.bind(c,89748,23)),Promise.resolve().then(c.t.bind(c,6060,23)),Promise.resolve().then(c.t.bind(c,7184,23)),Promise.resolve().then(c.t.bind(c,69576,23)),Promise.resolve().then(c.t.bind(c,73041,23)),Promise.resolve().then(c.t.bind(c,51384,23))},17290:(a,b,c)=>{"use strict";c.d(b,{Providers:()=>g});var d=c(21124),e=c(7475),f=c(11734);function g({locale:a,theme:b,children:c}){return(0,d.jsx)(e.CY,{initialLocale:a,children:(0,d.jsx)(f.N,{initialTheme:b,children:c})})}},25088:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>p,generateMetadata:()=>n,viewport:()=>o});var d=c(75338);c(82704);var e=c(64285),f=c(66664);function g(){let a=`
|
|
2
|
-
(function(){
|
|
3
|
-
try {
|
|
4
|
-
var t = null;
|
|
5
|
-
try { t = localStorage.getItem('ccgauge.theme'); } catch (_) {}
|
|
6
|
-
if (!t) {
|
|
7
|
-
var m = document.cookie.match(/(?:^|; )ccgauge_theme=([^;]+)/);
|
|
8
|
-
if (m) t = decodeURIComponent(m[1]);
|
|
9
|
-
}
|
|
10
|
-
if (t !== 'light' && t !== 'dark' && t !== 'system') t = 'system';
|
|
11
|
-
var resolved = t;
|
|
12
|
-
if (t === 'system') {
|
|
13
|
-
resolved = window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark';
|
|
14
|
-
}
|
|
15
|
-
var root = document.documentElement;
|
|
16
|
-
root.classList.remove('theme-light','theme-dark');
|
|
17
|
-
root.classList.add(resolved === 'light' ? 'theme-light' : 'theme-dark');
|
|
18
|
-
root.setAttribute('data-theme', resolved);
|
|
19
|
-
} catch (e) {}
|
|
20
|
-
})();
|
|
21
|
-
`;return(0,d.jsx)("script",{dangerouslySetInnerHTML:{__html:a}})}var h=c(91719),i=c(86802);async function j(){try{let a=await (0,i.UL)(),b=a.get("ccgauge_theme")?.value;if("light"===b||"dark"===b||"system"===b)return b}catch{}return"system"}var k=c(55340),l=c(60704),m=c(46796);async function n(){let a=await (0,h.sG)();return{title:"ccgauge — Claude Code & Codex Dashboard",description:(0,k.nA)(a,"brand.tagline"),icons:{icon:[{url:"/favicon.svg",type:"image/svg+xml"}],shortcut:"/favicon.svg",apple:"/favicon.svg"}}}let o={width:"device-width",initialScale:1};async function p({children:a}){let b=await (0,h.sG)(),c=await j(),i=await (0,l.Fw)(),k=await (0,m.ev)(null),n=(0,l.R0)().map(a=>({id:a.id,shortLabel:a.shortLabel,fg:a.color.fg,bg:a.color.bg,displayEn:a.displayName.en,displayZh:a.displayName.zh}));return(0,d.jsxs)("html",{lang:"zh"===b?"zh-CN":"en",className:"light"===c?"theme-light":"theme-dark",suppressHydrationWarning:!0,children:[(0,d.jsx)("head",{children:(0,d.jsx)(g,{})}),(0,d.jsx)("body",{className:"min-h-screen bg-bg text-text-primary",children:(0,d.jsxs)(f.Providers,{locale:b,theme:c,children:[(0,d.jsx)(e.Nav,{availableProviders:i,initialSource:k,providerInfos:n}),(0,d.jsx)("main",{children:a})]})})]})}},26284:(a,b,c)=>{Promise.resolve().then(c.bind(c,64285)),Promise.resolve().then(c.bind(c,66664))},28607:(a,b,c)=>{"use strict";c.d(b,{ThemeSwitcher:()=>h});var d=c(21124),e=c(11734),f=c(7475);let g={light:"dark",dark:"system",system:"light"};function h(){let{theme:a,resolved:b,setTheme:c}=(0,e.D)(),{t:h}=(0,f.s9)(),j=g[a];return(0,d.jsx)("button",{onClick:()=>c(j),className:"h-7 w-9 inline-flex items-center justify-center rounded-md border border-border bg-bg-surface text-text-secondary hover:text-text-primary hover:bg-bg-surface-hi hover:border-border-hi transition-colors",title:`${h("theme.label")}: ${h(`settings.theme.${a}`)} (${b}) → ${h(`settings.theme.${j}`)}`,"aria-label":h("theme.label"),children:(0,d.jsx)(i,{theme:a})})}function i({theme:a}){return"light"===a?(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,d.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,d.jsx)("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"})]}):"dark"===a?(0,d.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:(0,d.jsx)("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}):(0,d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,d.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,d.jsx)("path",{d:"M12 3v18"}),(0,d.jsx)("path",{d:"M12 3a9 9 0 0 1 0 18z",fill:"currentColor",stroke:"none"})]})}},41697:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(97954).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/zuopeng.cheng/personal/workspace/ccgauge/app/error.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/zuopeng.cheng/personal/workspace/ccgauge/app/error.tsx","default")},46796:(a,b,c)=>{"use strict";c.d(b,{ev:()=>f,rY:()=>g});var d=c(86802),e=c(60704);async function f(a){if(a&&(0,e.rl)(a))return a;let b=await (0,d.UL)(),c=b.get("ccgauge_source")?.value,f=c&&(0,e.rl)(c)?c:e.Gr,g=await (0,e.Fw)();return g.length>0&&!g.includes(f)?g[0]:f}function g(a,b){return a.filter(a=>a.source===b)}},55340:(a,b,c)=>{"use strict";c.d(b,{Xn:()=>d,nA:()=>f});let d="en",e={en:{"brand.tagline":"usage dashboard for AI coding CLIs","nav.overview":"Overview","nav.usage":"Usage","nav.sessions":"Sessions","nav.projects":"Projects","nav.models":"Models","nav.settings":"Settings","nav.localBadge":"local","nav.source":"Data source","source.claude":"Claude","source.codex":"Codex","cost.footnote.codex":"Cost shown is the OpenAI API equivalent (subscription plans pay differently).","common.requests":"requests","common.tokens":"tokens","common.cost":"Cost","common.savedViaCache":"Saved {amount} via cache","common.savedTodayViaCache":"Saved {amount} today","common.live":"live","common.allModels":"All","common.allProjects":"All","common.unknown":"(unknown)","common.session":"Session","common.sessions":"sessions","common.projects":"projects","common.req":"req","common.day":"day","common.days":"days","common.activity":"activity","common.fallbackPrice":"fallback price","common.thinking":"thinking","common.lastActivity":"last activity","common.empty.title":"No usage data yet","common.empty.desc":"Open Claude Code, send a message, then refresh.","common.refresh":"Refresh","common.search":"Search…","common.searchPlaceholder":"Search model, project, session, tool…","common.exportCsv":"Export CSV","common.rows":"{count} rows","common.prev":"‹ Prev","common.next":"Next ›","common.first":"\xab","common.last":"\xbb","common.pageOf":"Page {page} of {total}","common.allSessions":"← All sessions","common.allProjectsLink":"← All projects","common.noMatchingRows":"No matching rows","range.label":"Date range","range.today":"Today","range.7d":"7d","range.30d":"30d","range.90d":"90d","range.all":"All","gran.label":"Granularity","gran.hour":"Hour","gran.day":"Day","gran.week":"Week","gran.month":"Month","overview.title":"Overview","overview.subtitle":"{count} requests across {files} files \xb7 scan in {ms}ms","overview.subtitle.empty":"Scanned {dirs} directory(ies). Open Claude Code, send a message, then refresh.","overview.empty.title":"No usage data yet","overview.kpi.tokensToday":"Tokens today","overview.kpi.costToday":"Cost today","overview.kpi.thisMonth":"This month","overview.kpi.cacheHit":"Cache hit rate","overview.kpi.topModel":"Top model","overview.kpi.activeSessions":"Sessions today","overview.kpi.activeSessions.hint":"{count} project(s)","overview.kpi.thisMonth.hint":"{tokens} tokens \xb7 {req} req","overview.kpi.tokensToday.hint":"{count} requests","overview.kpi.topModel.hint":"{pct} of cost this month","overview.kpi.cacheHit.hint":"Saved {amount} today","overview.delta.title":"vs yesterday","overview.delta.firstTime":"NEW","common.loading":"Loading…","common.error.title":"Something went wrong","common.error.desc":"Failed to load this page. Try again.","common.error.retry":"Retry","overview.trend.title":"Token usage trend","overview.trend.desc":"Last 30 days \xb7 stacked by token type","overview.trend.activeDays":"{n} day with activity","overview.trend.activeDays.plural":"{n} days with activity","overview.costByModel.title":"Cost by model","overview.costByModel.desc":"This month, sorted by spend","block.title":"Active 5h block","block.remaining":"remaining","block.elapsed":"{pct}% elapsed","block.tokensSuffix":"tokens","block.spentSoFar":"Spent so far","block.burnPerMin":"Burn / min","block.projectedTotal":"Projected total","block.requests":"Requests","block.empty":"No active block","block.emptyDesc":"Send a message in Claude Code to start one.","chart.legend.input":"Input","chart.legend.output":"Output","chart.legend.cacheRead":"Cache read","chart.legend.cacheWrite":"Cache write","chart.tooltip.total":"Total","chart.tooltip.cost":"Cost","chart.tooltip.requests":"Requests","chart.empty":"No data in this range","chart.empty.short":"No data","usage.title":"Usage","usage.subtitle":"{count} turns in selected range","usage.col.calls":"Calls","usage.col.userMessage":"Prompt","usage.turn.expand":"Expand","usage.turn.collapse":"Collapse","usage.turn.callsCount":"{count} calls","usage.turn.noPrompt":"(no user text)","usage.requests.desc":"One row per turn (user message + tool calls); click ▸ to expand","usage.kpi.totalTokens":"Total tokens","usage.kpi.totalCost":"Total cost","usage.kpi.cacheSaved":"Cache saved","usage.kpi.cacheHit":"Cache hit","usage.trend":"Trend","usage.trend.gran":"Granularity: {gran}","usage.requests.title":"Requests","usage.col.time":"Time","usage.col.model":"Model","usage.col.project":"Project","usage.col.session":"Session","usage.col.input":"Input","usage.col.output":"Output","usage.col.cacheRead":"Cache R","usage.col.cacheWrite":"Cache W","usage.col.cost":"Cost","usage.col.tools":"Tools","usage.col.total":"Total","usage.columns.button":"Columns","usage.columns.title":"Visible columns","usage.columns.reset":"Reset","usage.breakdown.title":"Token breakdown","usage.breakdown.headerTokens":"Tokens","usage.breakdown.headerCost":"Cost","usage.breakdown.total":"Total","usage.breakdown.reasoning":"reasoning","usage.breakdown.reasoningNote":"incl. above","filter.modelLabel":"Model","filter.projectLabel":"Project","filter.modelAll":"Model: All","filter.projectAll":"Project: All","filter.modelSingle":"Model: {value}","filter.projectSingle":"Project: {value}","filter.modelMulti":"Model: {count}","filter.projectMulti":"Project: {count}","filter.clearAll":"Clear all","filter.noOptions":"No options","sessions.title":"Sessions","sessions.subtitle":"{count} sessions \xb7 sorted by most recent activity","sessions.col.session":"Session","sessions.col.project":"Project","sessions.col.models":"Model(s)","sessions.col.requests":"Requests","sessions.col.tokens":"Tokens","sessions.col.cost":"Cost","sessions.col.duration":"Duration","sessions.col.lastActivity":"Last activity","sessions.untitled":"Session {hash}","sessions.empty":"No sessions yet","session.kpi.requests":"Requests","session.kpi.totalTokens":"Total tokens","session.kpi.cost":"Cost","session.kpi.duration":"Duration","session.timeline.title":"Message timeline","session.timeline.desc":"In order; newest at the bottom","session.perMessage.title":"Per-message tokens","session.modelsInSession":"Models in this session","session.modelLine":"{requests} req \xb7 {tokens} tokens","session.token.in":"in","session.token.out":"out","session.token.cacheR":"cache r","session.token.cacheW":"cache w","projects.title":"Projects","projects.subtitle":"{count} projects \xb7 sorted by spend","projects.empty":"No projects yet","projects.stat.sessions":"Sessions","projects.stat.requests":"Requests","projects.stat.tokens":"Tokens","project.activity":"Activity (last 30 days)","project.sessions.title":"Sessions ({count})","models.title":"Models","models.subtitle":"{count} model(s) used in total","models.empty":"No model usage yet","models.share.cost":"Cost share","models.share.tokens":"Tokens share","models.share.cacheHit":"Cache hit","models.field.requests":"Requests","models.field.savedByCache":"Saved by cache","models.field.input1M":"Input / 1M","models.field.output1M":"Output / 1M","models.field.cacheRead1M":"Cache read / 1M","models.field.pctOfTotal":"{pct} of total spend \xb7 {tokens} tokens","models.eachTrend":"Combined trend (last 30 days)","settings.title":"Settings","settings.subtitle":"Data sources, pricing, and behavior","settings.dataSources.title":"Data sources","settings.dataSources.desc":"ccgauge scans these locations for JSONL files","settings.dataSources.active":"active","settings.dataSources.notPresent":"not present","settings.dataSources.envHint":"Override with {env1} or {env2} environment variables (the dashboard appends {appendix}).","settings.rescan":"Rescan now","settings.rescanning":"Rescanning…","settings.scanStats.title":"Scan stats","settings.scanStats.files":"Files scanned","settings.scanStats.records":"Records parsed","settings.scanStats.assistant":"Assistant records (deduped)","settings.scanStats.duration":"Scan duration","settings.pricing.title":"Pricing table","settings.pricing.desc":"USD per 1M tokens \xb7 built-in snapshot, fuzzy match for date-suffixed model names","settings.pricing.col.model":"Model","settings.pricing.col.input":"Input","settings.pricing.col.output":"Output","settings.pricing.col.write5m":"Cache write 5m","settings.pricing.col.write1h":"Cache write 1h","settings.pricing.col.read":"Cache read","settings.preferences.title":"Preferences","settings.preferences.language":"Language","settings.preferences.theme":"Theme","settings.theme.light":"Light","settings.theme.dark":"Dark","settings.theme.system":"System","settings.about.title":"About","settings.about.subtitle":"Version {version} \xb7 MIT licensed","settings.about.line1":"Fully local: data never leaves your machine; no telemetry, no network calls.","settings.about.line2":"Read-only: ccgauge only reads JSONL files, never writes back to ~/.claude.","settings.about.line3":'Cache: scan results are memoized for 5s; click "Rescan" to force a fresh read.',"settings.about.line4":"Stop with Ctrl+C in the terminal that started ccgauge.","settings.indexer.desc":"Background indexer keeps the cache fresh via file watchers.","settings.indexer.lastIndexedAt":"Last indexed","settings.indexer.indexDuration":"Last index time","settings.indexer.watchers":"Active watchers","settings.indexer.loadedFromDisk":"Loaded from disk","settings.indexer.status":"Status","settings.indexer.indexing":"indexing…","settings.indexer.idle":"idle","settings.indexer.recentErrors":"Recent indexer errors","common.yes":"yes","common.no":"no","lang.label":"Language","lang.en":"English","lang.zh":"中文","theme.label":"Theme"},zh:{"brand.tagline":"AI 编程 CLI 的本地用量看板","nav.overview":"概览","nav.usage":"用量","nav.sessions":"会话","nav.projects":"项目","nav.models":"模型","nav.settings":"设置","nav.localBadge":"本地","nav.source":"数据源","source.claude":"Claude","source.codex":"Codex","cost.footnote.codex":"按 OpenAI API 单价折算估值(订阅计划实际计费不同)","common.requests":"次请求","common.tokens":"tokens","common.cost":"花费","common.savedViaCache":"通过缓存节省 {amount}","common.savedTodayViaCache":"今日缓存节省 {amount}","common.live":"进行中","common.allModels":"全部","common.allProjects":"全部","common.unknown":"(未知)","common.session":"会话","common.sessions":"个会话","common.projects":"个项目","common.req":"请求","common.day":"天","common.days":"天","common.activity":"活跃","common.fallbackPrice":"使用兜底单价","common.thinking":"思考","common.lastActivity":"最近活跃","common.empty.title":"暂无用量数据","common.empty.desc":"打开 Claude Code 发送一条消息后刷新本页。","common.refresh":"刷新","common.search":"搜索…","common.searchPlaceholder":"搜索模型 / 项目 / 会话 / 工具…","common.exportCsv":"导出 CSV","common.rows":"{count} 行","common.prev":"‹ 上一页","common.next":"下一页 ›","common.first":"\xab","common.last":"\xbb","common.pageOf":"第 {page} / {total} 页","common.allSessions":"← 返回会话列表","common.allProjectsLink":"← 返回项目列表","common.noMatchingRows":"没有匹配的记录","range.label":"时间范围","range.today":"今天","range.7d":"7 天","range.30d":"30 天","range.90d":"90 天","range.all":"全部","gran.label":"粒度","gran.hour":"小时","gran.day":"天","gran.week":"周","gran.month":"月","overview.title":"概览","overview.subtitle":"{count} 次请求,覆盖 {files} 个文件 \xb7 扫描耗时 {ms}ms","overview.subtitle.empty":"已扫描 {dirs} 个目录。打开 Claude Code 发一条消息后刷新本页。","overview.empty.title":"暂无用量数据","overview.kpi.tokensToday":"今日 tokens","overview.kpi.costToday":"今日花费","overview.kpi.thisMonth":"本月累计","overview.kpi.cacheHit":"缓存命中率","overview.kpi.topModel":"主力模型","overview.kpi.activeSessions":"今日会话","overview.kpi.activeSessions.hint":"涉及 {count} 个项目","overview.kpi.thisMonth.hint":"{tokens} tokens \xb7 {req} 次请求","overview.kpi.tokensToday.hint":"{count} 次请求","overview.kpi.topModel.hint":"本月成本占比 {pct}","overview.kpi.cacheHit.hint":"今日缓存节省 {amount}","overview.delta.title":"相比昨日","overview.delta.firstTime":"首次","common.loading":"加载中…","common.error.title":"出错了","common.error.desc":"加载失败,请重试。","common.error.retry":"重试","overview.trend.title":"Token 用量趋势","overview.trend.desc":"近 30 天 \xb7 按 token 类型堆叠","overview.trend.activeDays":"{n} 天有数据","overview.trend.activeDays.plural":"{n} 天有数据","overview.costByModel.title":"按模型成本分布","overview.costByModel.desc":"本月,按花费排序","block.title":"当前 5h block","block.remaining":"剩余","block.elapsed":"已用 {pct}%","block.tokensSuffix":"tokens","block.spentSoFar":"已花费","block.burnPerMin":"每分钟消耗","block.projectedTotal":"预计总花费","block.requests":"请求数","block.empty":"当前无活跃 block","block.emptyDesc":"在 Claude Code 中发送消息会启动一个新 block。","chart.legend.input":"输入","chart.legend.output":"输出","chart.legend.cacheRead":"缓存读取","chart.legend.cacheWrite":"缓存写入","chart.tooltip.total":"合计","chart.tooltip.cost":"花费","chart.tooltip.requests":"请求数","chart.empty":"区间内无数据","chart.empty.short":"暂无数据","usage.title":"用量明细","usage.subtitle":"当前筛选范围内 {count} 轮对话","usage.kpi.totalTokens":"总 tokens","usage.kpi.totalCost":"总花费","usage.kpi.cacheSaved":"缓存节省","usage.kpi.cacheHit":"缓存命中","usage.trend":"趋势","usage.trend.gran":"粒度:{gran}","usage.requests.title":"对话轮次","usage.requests.desc":"每轮对话一行(用户消息 + 工具调用),点击 ▸ 展开明细","usage.col.calls":"调用","usage.col.userMessage":"提示","usage.turn.expand":"展开","usage.turn.collapse":"收起","usage.turn.callsCount":"{count} 次调用","usage.turn.noPrompt":"(无用户文本)","usage.col.time":"时间","usage.col.model":"模型","usage.col.project":"项目","usage.col.session":"会话","usage.col.input":"输入","usage.col.output":"输出","usage.col.cacheRead":"缓存读","usage.col.cacheWrite":"缓存写","usage.col.cost":"花费","usage.col.tools":"工具","usage.col.total":"总量","usage.columns.button":"列","usage.columns.title":"显示列","usage.columns.reset":"重置","usage.breakdown.title":"总量明细","usage.breakdown.headerTokens":"Token","usage.breakdown.headerCost":"花费","usage.breakdown.total":"合计","usage.breakdown.reasoning":"其中推理","usage.breakdown.reasoningNote":"已含在 output","filter.modelLabel":"模型","filter.projectLabel":"项目","filter.modelAll":"模型:全部","filter.projectAll":"项目:全部","filter.modelSingle":"模型:{value}","filter.projectSingle":"项目:{value}","filter.modelMulti":"模型:{count} 个","filter.projectMulti":"项目:{count} 个","filter.clearAll":"清除筛选","filter.noOptions":"没有可选项","sessions.title":"会话","sessions.subtitle":"共 {count} 个会话 \xb7 按最近活跃排序","sessions.col.session":"会话","sessions.col.project":"项目","sessions.col.models":"模型","sessions.col.requests":"请求数","sessions.col.tokens":"Tokens","sessions.col.cost":"花费","sessions.col.duration":"时长","sessions.col.lastActivity":"最近活跃","sessions.untitled":"会话 {hash}","sessions.empty":"暂无会话","session.kpi.requests":"请求数","session.kpi.totalTokens":"总 tokens","session.kpi.cost":"花费","session.kpi.duration":"时长","session.timeline.title":"消息时间线","session.timeline.desc":"按时间正序,最新的在最下方","session.perMessage.title":"逐条消息 tokens","session.modelsInSession":"本会话使用的模型","session.modelLine":"{requests} 次 \xb7 {tokens} tokens","session.token.in":"输入","session.token.out":"输出","session.token.cacheR":"缓存读","session.token.cacheW":"缓存写","projects.title":"项目","projects.subtitle":"共 {count} 个项目 \xb7 按花费排序","projects.empty":"暂无项目","projects.stat.sessions":"会话","projects.stat.requests":"请求","projects.stat.tokens":"Tokens","project.activity":"活跃情况(近 30 天)","project.sessions.title":"会话({count})","models.title":"模型","models.subtitle":"共使用过 {count} 个模型","models.empty":"暂无模型用量","models.share.cost":"成本占比","models.share.tokens":"Tokens 占比","models.share.cacheHit":"缓存命中","models.field.requests":"请求数","models.field.savedByCache":"缓存节省","models.field.input1M":"输入 / 1M","models.field.output1M":"输出 / 1M","models.field.cacheRead1M":"缓存读 / 1M","models.field.pctOfTotal":"占总花费 {pct} \xb7 {tokens} tokens","models.eachTrend":"整体趋势(近 30 天)","settings.title":"设置","settings.subtitle":"数据源、价格表与行为偏好","settings.dataSources.title":"数据源","settings.dataSources.desc":"ccgauge 会扫描以下路径的 JSONL 文件","settings.dataSources.active":"已启用","settings.dataSources.notPresent":"不存在","settings.dataSources.envHint":"可以通过环境变量 {env1} 或 {env2} 自定义路径(看板会自动追加 {appendix})。","settings.rescan":"立即重新扫描","settings.rescanning":"扫描中…","settings.scanStats.title":"扫描统计","settings.scanStats.files":"扫描文件数","settings.scanStats.records":"解析记录数","settings.scanStats.assistant":"去重后 assistant 记录","settings.scanStats.duration":"扫描耗时","settings.pricing.title":"价格表","settings.pricing.desc":"美元 / 1M tokens \xb7 内置快照,对带日期后缀的模型名做 fuzzy 匹配","settings.pricing.col.model":"模型","settings.pricing.col.input":"输入","settings.pricing.col.output":"输出","settings.pricing.col.write5m":"缓存写入 5 分钟","settings.pricing.col.write1h":"缓存写入 1 小时","settings.pricing.col.read":"缓存读取","settings.preferences.title":"偏好设置","settings.preferences.language":"语言","settings.preferences.theme":"主题","settings.theme.light":"亮色","settings.theme.dark":"暗色","settings.theme.system":"跟随系统","settings.about.title":"关于","settings.about.subtitle":"版本 {version} \xb7 MIT 协议","settings.about.line1":"完全本地:数据从不离开你的机器,没有任何遥测、没有任何网络调用。","settings.about.line2":"只读:ccgauge 只读取 JSONL,绝不会写回 ~/.claude。","settings.about.line3":'缓存:扫描结果会缓存 5 秒;点击"重新扫描"可强制刷新。',"settings.about.line4":"在启动 ccgauge 的终端按 Ctrl+C 即可停止。","settings.indexer.desc":"后台 indexer 通过文件监听增量维护缓存。","settings.indexer.lastIndexedAt":"最近索引时间","settings.indexer.indexDuration":"最近索引耗时","settings.indexer.watchers":"活跃 watcher 数","settings.indexer.loadedFromDisk":"从磁盘恢复","settings.indexer.status":"状态","settings.indexer.indexing":"索引中…","settings.indexer.idle":"空闲","settings.indexer.recentErrors":"最近的索引错误","common.yes":"是","common.no":"否","lang.label":"语言","lang.en":"English","lang.zh":"中文","theme.label":"主题"}};function f(a,b,c){let d=e[a]?.[b];if(void 0===d&&(d=e.en[b]),void 0===d&&(d=b),c)for(let[a,b]of Object.entries(c))d=d.replace(RegExp(`\\{${a}\\}`,"g"),String(b));return d}},64285:(a,b,c)=>{"use strict";c.d(b,{Nav:()=>d});let d=(0,c(97954).registerClientReference)(function(){throw Error("Attempted to call Nav() from the server but Nav is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/zuopeng.cheng/personal/workspace/ccgauge/components/nav.tsx","Nav")},66664:(a,b,c)=>{"use strict";c.d(b,{Providers:()=>d});let d=(0,c(97954).registerClientReference)(function(){throw Error("Attempted to call Providers() from the server but Providers is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/zuopeng.cheng/personal/workspace/ccgauge/components/providers.tsx","Providers")},74268:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,54160,23)),Promise.resolve().then(c.t.bind(c,31603,23)),Promise.resolve().then(c.t.bind(c,68495,23)),Promise.resolve().then(c.t.bind(c,75170,23)),Promise.resolve().then(c.t.bind(c,77526,23)),Promise.resolve().then(c.t.bind(c,78922,23)),Promise.resolve().then(c.t.bind(c,29234,23)),Promise.resolve().then(c.t.bind(c,12263,23)),Promise.resolve().then(c.bind(c,82146))},77731:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>f});var d=c(21124);c(38301);var e=c(7475);function f({error:a,reset:b}){let c=(0,e.kj)();return(0,d.jsx)("div",{className:"max-w-2xl mx-auto px-6 py-12",children:(0,d.jsxs)("div",{className:"card card-pad text-center",children:[(0,d.jsx)("div",{className:"text-base font-semibold text-text-primary",children:c("common.error.title")}),(0,d.jsx)("p",{className:"text-sm text-text-secondary mt-2",children:c("common.error.desc")}),a.message&&(0,d.jsxs)("pre",{className:"mt-4 text-xs text-text-tertiary text-left bg-bg-surface-hi rounded p-3 overflow-auto max-h-48 whitespace-pre-wrap",children:[a.message,a.digest?`
|
|
22
|
-
|
|
23
|
-
#${a.digest}`:""]}),(0,d.jsx)("button",{onClick:()=>b(),className:"btn mt-4",children:c("common.error.retry")})]})})}},78288:(a,b,c)=>{Promise.resolve().then(c.bind(c,41697))},80489:(a,b,c)=>{"use strict";c.d(b,{Q:()=>i,n:()=>f});var d=c(75338),e=c(95012);function f({label:a,value:b,hint:c,delta:f,deltaTitle:i,progress:j,accent:k="default",className:l}){return(0,d.jsxs)("div",{className:(0,e.cn)("card card-pad flex flex-col gap-2 min-h-[128px] transition-colors","brand"===k&&"border-brand/30","success"===k&&"border-success/30","warning"===k&&"border-warning/30",l),children:[(0,d.jsx)("div",{className:"label truncate",children:a}),(0,d.jsxs)("div",{className:"flex items-baseline gap-2 flex-wrap min-w-0",children:[(0,d.jsx)("div",{className:"num-hero min-w-0 max-w-full",children:b}),f&&"firstTime"in f&&f.firstTime&&(0,d.jsx)("span",{className:"pill text-[11px] font-medium whitespace-nowrap text-brand bg-brand/10 border border-brand/20",title:i,children:f.label??"NEW"}),f&&"value"in f&&Number.isFinite(f.value)&&(0,d.jsx)(g,{value:f.value,positiveIsGood:f.positiveIsGood,title:i})]}),c&&(0,d.jsx)("div",{className:"text-xs text-text-secondary mt-auto leading-snug",children:c}),j&&(0,d.jsx)("div",{className:"mt-auto pt-2",children:(0,d.jsx)(h,{value:j.value,tone:j.tone})})]})}function g({value:a,positiveIsGood:b=!0,title:c}){let f=a>=0;return(0,d.jsxs)("span",{className:(0,e.cn)("pill text-[11px] font-medium whitespace-nowrap",f===b?"text-success bg-success/10":"text-danger bg-danger/10"),title:c,children:[f?"↑":"↓"," ",Math.abs(a).toFixed(0),"%"]})}function h({value:a,tone:b="brand"}){let c=Math.max(0,Math.min(1,a));return(0,d.jsx)("div",{className:"h-1.5 w-full bg-bg-surface-hi rounded-full overflow-hidden",children:(0,d.jsx)("div",{className:(0,e.cn)("h-full rounded-full transition-all",{brand:"bg-brand",success:"bg-success",warning:"bg-warning",danger:"bg-danger"}[b]),style:{width:`${100*c}%`}})})}function i(){return(0,d.jsxs)("div",{className:"card card-pad min-h-[128px] animate-pulse",children:[(0,d.jsx)("div",{className:"h-3 w-20 bg-bg-surface-hi rounded mb-3"}),(0,d.jsx)("div",{className:"h-8 w-32 bg-bg-surface-hi rounded mb-2"}),(0,d.jsx)("div",{className:"h-3 w-24 bg-bg-surface-hi rounded mt-auto"})]})}},82704:()=>{},88016:(a,b,c)=>{Promise.resolve().then(c.bind(c,77731))},88267:(a,b,c)=>{"use strict";c.d(b,{Nav:()=>p});var d=c(21124),e=c(3991),f=c.n(e),g=c(42378),h=c(15514),i=c(7475),j=c(95546),k=c(28607);function l({className:a,withBackground:b=!0}){return(0,d.jsxs)("svg",{viewBox:"0 0 64 64",fill:"none","aria-hidden":!0,className:(0,h.cn)("block",a),children:[b&&(0,d.jsx)("rect",{width:"64",height:"64",rx:"14",className:"fill-brand"}),(0,d.jsx)("path",{d:"M14 41 A18 18 0 0 1 50 41",stroke:"currentColor",strokeOpacity:b?.32:.25,strokeWidth:"4.5",strokeLinecap:"round",className:b?"text-white":""}),(0,d.jsx)("path",{d:"M14 41 A18 18 0 0 1 43.2 25.4",stroke:"currentColor",strokeWidth:"4.5",strokeLinecap:"round",className:b?"text-white":"text-brand"}),(0,d.jsx)("line",{x1:"32",y1:"41",x2:"42",y2:"27",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",className:b?"text-white":"text-brand"}),(0,d.jsx)("circle",{cx:"32",cy:"41",r:"3",className:b?"fill-white":"fill-brand"})]})}var m=c(38301);function n({available:a,initial:b,providers:c}){let e=(0,g.useRouter)(),f=(0,g.usePathname)(),h=(0,g.useSearchParams)(),j=(0,i.kj)(),{locale:k}=(0,i.s9)(),[l,n]=(0,m.useTransition)(),o=h.get("source"),[p,q]=(0,m.useState)(o??b);return a.length<2?null:(0,d.jsx)("div",{role:"group","aria-label":j("nav.source"),className:"inline-flex items-center rounded-md border border-border bg-bg-surface p-0.5 gap-0.5",title:j("nav.source"),children:c.filter(b=>a.includes(b.id)).map(a=>{let b=a.id===p,c="zh"===k?a.displayZh:a.displayEn;return(0,d.jsxs)("button",{type:"button",onClick:()=>(a=>{var b;if(a===p)return;q(a),b=a,"undefined"!=typeof document&&(document.cookie=`ccgauge_source=${encodeURIComponent(b)}; path=/; max-age=31536000; SameSite=Lax`);let c=new URLSearchParams(h.toString());c.set("source",a);let d=/^\/sessions\/[^/]+|^\/projects\/[^/]+/.test(f)?`/${f.split("/")[1]}?${c.toString()}`:`${f}?${c.toString()}`;n(()=>{e.push(d)})})(a.id),"aria-pressed":b,disabled:l,className:`px-2.5 h-6 text-xs inline-flex items-center gap-1.5 rounded transition-all ${b?"bg-brand text-white font-semibold shadow-sm ring-1 ring-brand/40":"text-text-tertiary font-medium hover:text-text-primary hover:bg-bg-surface-hi"}`,children:[(0,d.jsx)("span",{className:`inline-flex items-center justify-center w-3.5 h-3.5 rounded-full text-[9px] font-bold leading-none ${b?"ring-1 ring-white/40":""}`,style:{background:a.bg,color:a.fg},children:a.shortLabel}),(0,d.jsx)("span",{children:c})]},a.id)})})}let o=[{href:"/",tk:"nav.overview",exact:!0},{href:"/usage",tk:"nav.usage"},{href:"/sessions",tk:"nav.sessions"},{href:"/projects",tk:"nav.projects"},{href:"/models",tk:"nav.models"},{href:"/settings",tk:"nav.settings"}];function p({availableProviders:a,initialSource:b,providerInfos:c}){let e=(0,g.usePathname)(),m=(0,i.kj)();return(0,d.jsx)("header",{className:"sticky top-0 z-30 border-b border-border bg-bg-base/80 backdrop-blur",children:(0,d.jsxs)("div",{className:"max-w-7xl mx-auto px-3 sm:px-6 h-14 flex items-center gap-2 sm:gap-4",children:[(0,d.jsxs)(f(),{href:"/",className:"flex items-center gap-2 font-semibold tracking-tight whitespace-nowrap shrink-0","aria-label":"ccgauge home",children:[(0,d.jsx)(l,{className:"w-7 h-7"}),(0,d.jsx)("span",{className:"hidden xs:inline sm:inline",children:"ccgauge"}),(0,d.jsx)("span",{className:"text-xs text-text-tertiary font-normal hidden lg:inline",children:m("brand.tagline")})]}),(0,d.jsx)("nav",{className:"flex-1 min-w-0 flex items-center gap-1 overflow-x-auto scrollbar-thin","aria-label":"Primary",children:o.map(a=>{let b=a.exact?e===a.href:e===a.href||e.startsWith(a.href+"/");return(0,d.jsx)(f(),{href:a.href,prefetch:!1,"aria-current":b?"page":void 0,className:(0,h.cn)("px-2.5 sm:px-3 py-1.5 text-sm rounded-button font-medium transition-colors whitespace-nowrap shrink-0",b?"text-text-primary bg-bg-surface-hi":"text-text-secondary hover:text-text-primary hover:bg-bg-surface"),children:m(a.tk)},a.href)})}),(0,d.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,d.jsx)(n,{available:a,initial:b,providers:c}),(0,d.jsx)("span",{className:"pill bg-bg-surface-hi text-text-tertiary text-[10px] uppercase tracking-wide hidden md:inline-flex",children:m("nav.localBadge")}),(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)(j.LanguageSwitcher,{}),(0,d.jsx)(k.ThemeSwitcher,{})]})]})]})})}},90391:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>f});var d=c(75338),e=c(80489);function f(){return(0,d.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 py-6 sm:py-8 space-y-6",children:[(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)("div",{className:"h-7 w-48 bg-bg-surface-hi rounded animate-pulse"}),(0,d.jsx)("div",{className:"h-4 w-72 bg-bg-surface-hi rounded animate-pulse"})]}),(0,d.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:Array.from({length:4}).map((a,b)=>(0,d.jsx)(e.Q,{},b))}),(0,d.jsx)("div",{className:"card card-pad min-h-[280px] animate-pulse"})]})}},91719:(a,b,c)=>{"use strict";c.d(b,{sG:()=>f,yO:()=>g});var d=c(86802),e=c(55340);async function f(){try{let a=await (0,d.UL)(),b=a.get("ccgauge_locale")?.value;if("zh"===b||"en"===b)return b}catch{}return e.Xn}async function g(){let a=await f();return(b,c)=>(0,e.nA)(a,b,c)}},95012:(a,b,c)=>{"use strict";c.d(b,{BC:()=>o,PJ:()=>n,R8:()=>j,a3:()=>k,az:()=>i,cn:()=>f,jh:()=>h,om:()=>l,r6:()=>m});var d=c(81171),e=c(11167);function f(...a){return(0,e.QP)((0,d.$)(a))}function g(a,b){return new Intl.NumberFormat("en-US",{maximumFractionDigits:b?.maxFrac??0}).format(a)}function h(a,b="en"){return Number.isFinite(a)?"zh"===b?a>=1e8?(a/1e8).toFixed(2)+"亿":a>=1e4?(a/1e4).toFixed(1)+"万":g(a):a>=1e9?(a/1e9).toFixed(2)+"B":a>=1e6?(a/1e6).toFixed(2)+"M":a>=1e3?(a/1e3).toFixed(1)+"K":g(a):"0"}function i(a,b){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:b?.minFrac??2,maximumFractionDigits:b?.maxFrac??2}).format(a)}function j(a,b=1){return Number.isFinite(a)?`${(100*a).toFixed(b)}%`:"0%"}function k(a){if(a<1e3)return`${a}ms`;let b=Math.floor(a/1e3);if(b<60)return`${b}s`;let c=Math.floor(b/60);if(c<60){let a=b%60;return a?`${c}m ${a}s`:`${c}m`}let d=Math.floor(c/60),e=c%60;return e?`${d}h ${e}m`:`${d}h`}function l(a,b="en"){let c="string"==typeof a||"number"==typeof a?new Date(a):a,d=Date.now()-c.getTime(),e="zh"===b;if(d<0)return e?"刚刚":"just now";let f=Math.floor(d/1e3);if(f<60)return e?"刚刚":`${f}s ago`;let g=Math.floor(f/60);if(g<60)return e?`${g} 分钟前`:`${g}m ago`;let h=Math.floor(g/60);if(h<24)return e?`${h} 小时前`:`${h}h ago`;let i=Math.floor(h/24);if(i<7)return e?`${i} 天前`:`${i}d ago`;let j=Math.floor(i/7);if(j<5)return e?`${j} 周前`:`${j}w ago`;let k=Math.floor(i/30);if(k<12)return e?`${k} 个月前`:`${k}mo ago`;let m=Math.floor(i/365);return e?`${m} 年前`:`${m}y ago`}function m(a){let b="string"==typeof a||"number"==typeof a?new Date(a):a;if(Number.isNaN(b.getTime()))return"";let c=b.getFullYear(),d=String(b.getMonth()+1).padStart(2,"0"),e=String(b.getDate()).padStart(2,"0"),f=String(b.getHours()).padStart(2,"0"),g=String(b.getMinutes()).padStart(2,"0"),h=String(b.getSeconds()).padStart(2,"0");return`${c}-${d}-${e} ${f}:${g}:${h}`}function n(a){if(!a)return"(unknown)";let b=a.replace(/\/+$/,"").split("/");return b[b.length-1]||a}function o(a,b=8){return a?a.replace(/-/g,"").slice(0,b):""}},95546:(a,b,c)=>{"use strict";c.d(b,{LanguageSwitcher:()=>i});var d=c(21124),e=c(7475);let f={en:"EN",zh:"中"},g={en:"zh",zh:"en"},h={en:"English",zh:"中文"};function i(){let{locale:a,setLocale:b,t:c}=(0,e.s9)(),i=g[a];return(0,d.jsx)("button",{onClick:()=>b(i),className:"h-7 w-9 inline-flex items-center justify-center rounded-md border border-border bg-bg-surface text-xs font-medium text-text-secondary hover:text-text-primary hover:bg-bg-surface-hi hover:border-border-hi transition-colors",title:`${c("lang.label")}: ${h[a]} → ${h[i]}`,"aria-label":c("lang.label"),children:f[a]})}}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=520,exports.ids=[520],exports.modules={27520:(a,b,c)=>{c.d(b,{So:()=>r,mo:()=>t,TF:()=>s});var d=c(60704),e=c(73024),f=c(76760),g=c.n(f),h=c(48161),i=c.n(h);let j="default";function k(a){let b=a===j?"index-v2.json":`index-${a}-v2.json`;return g().join(process.env.CCGAUGE_STATE_DIR?process.env.CCGAUGE_STATE_DIR:g().join(i().homedir(),".ccgauge"),"cache",b)}async function l(a=j){let b=k(a);try{let a=await e.promises.readFile(b,"utf8"),c=JSON.parse(a);if(2!==c.schemaVersion||!Array.isArray(c.files))return null;return c}catch{return null}}async function m(a,b=j){let c=k(b),d=g().dirname(c);await e.promises.mkdir(d,{recursive:!0});let f={schemaVersion:2,savedAt:a.savedAt,files:a.files},h=`${c}.tmp-${process.pid}`;await e.promises.writeFile(h,JSON.stringify(f)),await e.promises.rename(h,c)}class n{constructor(a=j){this.files=new Map,this.snapshot=null,this.watchers=new Map,this.pollTimer=null,this.snapshotRebuildTimer=null,this.persistTimer=null,this.fileDebouncers=new Map,this.initPromise=null,this.isIndexing=!1,this.lastIndexedAt=null,this.indexDurationMs=null,this.existingDirs=[],this.dirToProvider=new Map,this.errors=[],this.loadedFromDisk=!1,this.lastWorkStart=null,this.rescanPromise=null,this.cacheName=a}init(){return this.initPromise||(this.initPromise=this.doInit()),this.initPromise}async doInit(){let a=Date.now();this.isIndexing=!0,this.lastWorkStart=a;try{await this.detectProviderDirs();let b=await l(this.cacheName);this.loadedFromDisk=null!==b;let c=new Map;if(b)for(let a of b.files)c.set(a.filePath,a);await this.fullScan(c),this.rebuildSnapshotNow(),this.indexDurationMs=Date.now()-a,this.lastIndexedAt=new Date().toISOString(),this.syncWatchersToDirs(),this.setupPolling(),this.schedulePersist()}finally{this.isIndexing=!1}}async detectProviderDirs(){let a=new Map,b=[];for(let c of(0,d.R0)())for(let d of c.getDirs())await o(d)&&!a.has(d)&&(a.set(d,c),b.push(d));let c=[],e=[];for(let b of a.keys())this.dirToProvider.has(b)||c.push(b);for(let b of this.dirToProvider.keys())a.has(b)||e.push(b);return this.dirToProvider=a,this.existingDirs=b,{added:c,removed:e}}async fullScan(a){let b=[];for(let[a,c]of this.dirToProvider)for(let d of(await p(a,c)))b.push({file:d,provider:c});let c=new Set(b.map(a=>a.file));for(let d of(await Promise.all(b.map(async({file:b,provider:c})=>{try{let d=await e.promises.stat(b),f=a.get(b);if(f&&f.source===c.id&&f.parserVersion===c.parserVersion&&f.mtimeMs===d.mtimeMs&&f.size===d.size)return void this.files.set(b,{source:c.id,parserVersion:c.parserVersion,mtimeMs:d.mtimeMs,size:d.size,assistantRecords:f.assistantRecords,userRecords:f.userRecords,parentLinks:f.parentLinks});let g=await c.parseFile(b);this.files.set(b,{source:c.id,parserVersion:c.parserVersion,mtimeMs:d.mtimeMs,size:d.size,assistantRecords:g.assistant,userRecords:g.user,parentLinks:g.parentLinks})}catch(a){this.recordError(`parse ${b}: ${a.message}`)}})),Array.from(this.files.keys())))c.has(d)||this.files.delete(d)}syncWatchersToDirs(){for(let[a,b]of this.watchers)if(!this.dirToProvider.has(a)){try{b.close()}catch{}this.watchers.delete(a)}for(let[a,b]of this.dirToProvider)if(!this.watchers.has(a))try{let c=(0,e.watch)(a,{recursive:!0},(c,d)=>{if(!d||"string"!=typeof d||!d.endsWith(".jsonl"))return;let e=g().join(a,d);this.scheduleFileReconcile(e,b)});c.on("error",b=>{this.recordError(`watcher ${a}: ${b.message}`)}),this.watchers.set(a,c)}catch(b){this.recordError(`watch ${a}: ${b.message}`)}}setupPolling(){this.pollTimer&&clearInterval(this.pollTimer),this.pollTimer=setInterval(()=>{this.pollOnce().catch(a=>this.recordError(`poll: ${a.message}`))},3e4),this.pollTimer.unref?.()}async pollOnce(){let a=Date.now(),b=await this.detectProviderDirs(),c=b.added.length>0||b.removed.length>0;c&&this.syncWatchersToDirs();let d=[];for(let[a,b]of this.dirToProvider)for(let c of(await p(a,b)))d.push({file:c,provider:b});let f=new Set(d.map(a=>a.file));for(let a of(await Promise.all(d.map(async({file:a,provider:b})=>{try{let d=await e.promises.stat(a),f=this.files.get(a);if(f&&f.mtimeMs===d.mtimeMs&&f.size===d.size)return;let g=await b.parseFile(a);this.files.set(a,{source:b.id,parserVersion:b.parserVersion,mtimeMs:d.mtimeMs,size:d.size,assistantRecords:g.assistant,userRecords:g.user,parentLinks:g.parentLinks}),c=!0}catch(b){this.recordError(`poll-parse ${a}: ${b.message}`)}})),Array.from(this.files.keys())))f.has(a)||(this.files.delete(a),c=!0);c&&(this.lastWorkStart=a,this.scheduleSnapshotRebuild(),this.schedulePersist())}scheduleFileReconcile(a,b){let c=this.fileDebouncers.get(a);c&&clearTimeout(c);let d=setTimeout(()=>{this.fileDebouncers.delete(a),this.reconcileFile(a,b).catch(b=>this.recordError(`reconcile ${a}: ${b.message}`))},200);d.unref?.(),this.fileDebouncers.set(a,d)}async reconcileFile(a,b){let c=Date.now(),d=null;try{d=await e.promises.stat(a)}catch{}if(!d||!d.isFile()){this.files.has(a)&&(this.files.delete(a),this.lastWorkStart=c,this.scheduleSnapshotRebuild(),this.schedulePersist());return}let f=this.files.get(a);if(!f||f.mtimeMs!==d.mtimeMs||f.size!==d.size)try{let e=await b.parseFile(a);this.files.set(a,{source:b.id,parserVersion:b.parserVersion,mtimeMs:d.mtimeMs,size:d.size,assistantRecords:e.assistant,userRecords:e.user,parentLinks:e.parentLinks}),this.lastWorkStart=c,this.scheduleSnapshotRebuild(),this.schedulePersist()}catch(b){this.recordError(`parse ${a}: ${b.message}`)}}scheduleSnapshotRebuild(){this.snapshotRebuildTimer&&clearTimeout(this.snapshotRebuildTimer),this.snapshotRebuildTimer=setTimeout(()=>{this.snapshotRebuildTimer=null,this.rebuildSnapshotNow()},100),this.snapshotRebuildTimer.unref?.()}rebuildSnapshotNow(){let a=Date.now(),b=this.lastWorkStart??a,c=[],d=[],e={},f=0,g={claude:{source:"claude",filesScanned:0,recordsParsed:0,assistantRecords:0,scannedDirs:[]},codex:{source:"codex",filesScanned:0,recordsParsed:0,assistantRecords:0,scannedDirs:[]}};for(let[a,b]of this.dirToProvider)g[b.id].scannedDirs.push(a);for(let a of this.files.values()){for(let[b,f]of(c.push(...a.assistantRecords),d.push(...a.userRecords),a.parentLinks))e[b]=f;f+=a.assistantRecords.length+a.userRecords.length,g[a.source].filesScanned+=1,g[a.source].recordsParsed+=a.assistantRecords.length+a.userRecords.length}let h=(function(a){let b=new Map;for(let c of a){let a=function(a){let b=`${a.source}:`;return a.messageId&&a.requestId?`${b}${a.messageId}::${a.requestId}`:a.messageId?`${b}mid:${a.messageId}`:a.requestId?`${b}req:${a.requestId}`:`${b}uuid:${a.uuid}`}(c),d=b.get(a);if(!d){b.set(a,c);continue}c.timestamp<d.timestamp&&b.set(a,c)}return Array.from(b.values())})(c).sort((a,b)=>a.timestamp.localeCompare(b.timestamp)),i=(function(a){let b=new Set;return a.filter(a=>{let c=a.uuid;return!c||!b.has(c)&&(b.add(c),!0)})})(d).sort((a,b)=>a.timestamp.localeCompare(b.timestamp));for(let a of h)g[a.source].assistantRecords+=1;let j={filesScanned:this.files.size,recordsParsed:f,assistantRecords:h.length,durationMs:Date.now()-b,scannedDirs:this.existingDirs};this.snapshot={records:h,userRecords:i,parentMap:e,stats:j,bySource:Object.values(g)},this.lastWorkStart=null}getSnapshot(){if(!this.snapshot)throw Error("Indexer not initialized — call init() first.");return this.snapshot}async forceRescan(){if(!this.initPromise)return await this.init(),this.snapshot;if(this.rescanPromise)return this.rescanPromise;this.rescanPromise=this.runRescan();try{return await this.rescanPromise}finally{this.rescanPromise=null}}async runRescan(){let a=Date.now();this.isIndexing=!0,this.lastWorkStart=a;try{return this.files.clear(),await this.detectProviderDirs(),await this.fullScan(new Map),this.rebuildSnapshotNow(),this.indexDurationMs=Date.now()-a,this.lastIndexedAt=new Date().toISOString(),this.syncWatchersToDirs(),this.schedulePersist(),this.snapshot}finally{this.isIndexing=!1}}getStatus(){let a=this.snapshot;return{initialized:null!==a,isIndexing:this.isIndexing,lastIndexedAt:this.lastIndexedAt,indexDurationMs:this.indexDurationMs,filesIndexed:this.files.size,recordsIndexed:a?.stats.assistantRecords??0,bySource:a?.bySource??[],watchers:this.watchers.size,errors:this.errors.slice(-20),pendingReconciles:this.fileDebouncers.size,loadedFromDisk:this.loadedFromDisk}}schedulePersist(){this.persistTimer&&clearTimeout(this.persistTimer),this.persistTimer=setTimeout(()=>{this.persistTimer=null;let a=[];for(let[b,c]of this.files)a.push({filePath:b,source:c.source,parserVersion:c.parserVersion,mtimeMs:c.mtimeMs,size:c.size,assistantRecords:c.assistantRecords,userRecords:c.userRecords,parentLinks:c.parentLinks});m({savedAt:new Date().toISOString(),files:a},this.cacheName).catch(a=>this.recordError(`persist: ${a.message}`))},2e3),this.persistTimer.unref?.()}recordError(a){let b=`${new Date().toISOString()} ${function(a){let b=i().homedir();if(!b)return a;let c=b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return a.replace(RegExp(c,"g"),"~")}(a)}`;this.errors.push(b),this.errors.length>40&&this.errors.splice(0,this.errors.length-20),process.env.CCGAUGE_DEBUG&&console.error(`[ccgauge:indexer] ${new Date().toISOString()} ${a}`)}disposeWatchers(){for(let a of this.watchers.values())try{a.close()}catch{}this.watchers.clear()}dispose(){for(let a of(this.disposeWatchers(),this.pollTimer&&clearInterval(this.pollTimer),this.snapshotRebuildTimer&&clearTimeout(this.snapshotRebuildTimer),this.persistTimer&&clearTimeout(this.persistTimer),this.fileDebouncers.values()))clearTimeout(a);this.fileDebouncers.clear()}}async function o(a){try{return(await e.promises.stat(a)).isDirectory()}catch{return!1}}async function p(a,b){let c=[];async function d(a,f){let h;if(!(f>8)){try{h=await e.promises.readdir(a,{withFileTypes:!0})}catch{return}for(let e of h){let h=g().join(a,e.name);if(e.isDirectory()){if(b.shouldSkipDir(e.name))continue;await d(h,f+1)}else e.isFile()&&e.name.endsWith(".jsonl")&&c.push(h)}}}return await d(a,0),c}let q=function(a=j){let b=(globalThis.__ccgaugeIndexers||(globalThis.__ccgaugeIndexers=new Map),globalThis.__ccgaugeIndexers),c=b.get(a);return c||(c=new n(a),b.set(a,c)),c}();async function r(a={}){return a.force?q.forceRescan():(await q.init(),q.getSnapshot())}function s(){return(0,d.R0)().map(a=>({source:a.id,dirs:a.getDirs()}))}function t(){return q.getStatus()}}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[454],{19454:(e,s,t)=>{t.d(s,{CY:()=>d,s9:()=>u,kj:()=>m});var o=t(95155),n=t(12115),i=t(20063);let a={en:{"brand.tagline":"usage dashboard for AI coding CLIs","nav.overview":"Overview","nav.usage":"Usage","nav.sessions":"Sessions","nav.projects":"Projects","nav.models":"Models","nav.settings":"Settings","nav.localBadge":"local","nav.source":"Data source","source.claude":"Claude","source.codex":"Codex","cost.footnote.codex":"Cost shown is the OpenAI API equivalent (subscription plans pay differently).","common.requests":"requests","common.tokens":"tokens","common.cost":"Cost","common.savedViaCache":"Saved {amount} via cache","common.savedTodayViaCache":"Saved {amount} today","common.live":"live","common.allModels":"All","common.allProjects":"All","common.unknown":"(unknown)","common.session":"Session","common.sessions":"sessions","common.projects":"projects","common.req":"req","common.day":"day","common.days":"days","common.activity":"activity","common.fallbackPrice":"fallback price","common.thinking":"thinking","common.lastActivity":"last activity","common.empty.title":"No usage data yet","common.empty.desc":"Open Claude Code, send a message, then refresh.","common.refresh":"Refresh","common.search":"Search…","common.searchPlaceholder":"Search model, project, session, tool…","common.exportCsv":"Export CSV","common.rows":"{count} rows","common.prev":"‹ Prev","common.next":"Next ›","common.first":"\xab","common.last":"\xbb","common.pageOf":"Page {page} of {total}","common.allSessions":"← All sessions","common.allProjectsLink":"← All projects","common.noMatchingRows":"No matching rows","range.label":"Date range","range.today":"Today","range.7d":"7d","range.30d":"30d","range.90d":"90d","range.all":"All","gran.label":"Granularity","gran.hour":"Hour","gran.day":"Day","gran.week":"Week","gran.month":"Month","overview.title":"Overview","overview.subtitle":"{count} requests across {files} files \xb7 scan in {ms}ms","overview.subtitle.empty":"Scanned {dirs} directory(ies). Open Claude Code, send a message, then refresh.","overview.empty.title":"No usage data yet","overview.kpi.tokensToday":"Tokens today","overview.kpi.costToday":"Cost today","overview.kpi.thisMonth":"This month","overview.kpi.cacheHit":"Cache hit rate","overview.kpi.topModel":"Top model","overview.kpi.activeSessions":"Sessions today","overview.kpi.activeSessions.hint":"{count} project(s)","overview.kpi.thisMonth.hint":"{tokens} tokens \xb7 {req} req","overview.kpi.tokensToday.hint":"{count} requests","overview.kpi.topModel.hint":"{pct} of cost this month","overview.kpi.cacheHit.hint":"Saved {amount} today","overview.delta.title":"vs yesterday","overview.delta.firstTime":"NEW","common.loading":"Loading…","common.error.title":"Something went wrong","common.error.desc":"Failed to load this page. Try again.","common.error.retry":"Retry","overview.trend.title":"Token usage trend","overview.trend.desc":"Last 30 days \xb7 stacked by token type","overview.trend.activeDays":"{n} day with activity","overview.trend.activeDays.plural":"{n} days with activity","overview.costByModel.title":"Cost by model","overview.costByModel.desc":"This month, sorted by spend","block.title":"Active 5h block","block.remaining":"remaining","block.elapsed":"{pct}% elapsed","block.tokensSuffix":"tokens","block.spentSoFar":"Spent so far","block.burnPerMin":"Burn / min","block.projectedTotal":"Projected total","block.requests":"Requests","block.empty":"No active block","block.emptyDesc":"Send a message in Claude Code to start one.","chart.legend.input":"Input","chart.legend.output":"Output","chart.legend.cacheRead":"Cache read","chart.legend.cacheWrite":"Cache write","chart.tooltip.total":"Total","chart.tooltip.cost":"Cost","chart.tooltip.requests":"Requests","chart.empty":"No data in this range","chart.empty.short":"No data","usage.title":"Usage","usage.subtitle":"{count} turns in selected range","usage.col.calls":"Calls","usage.col.userMessage":"Prompt","usage.turn.expand":"Expand","usage.turn.collapse":"Collapse","usage.turn.callsCount":"{count} calls","usage.turn.noPrompt":"(no user text)","usage.requests.desc":"One row per turn (user message + tool calls); click ▸ to expand","usage.kpi.totalTokens":"Total tokens","usage.kpi.totalCost":"Total cost","usage.kpi.cacheSaved":"Cache saved","usage.kpi.cacheHit":"Cache hit","usage.trend":"Trend","usage.trend.gran":"Granularity: {gran}","usage.requests.title":"Requests","usage.col.time":"Time","usage.col.model":"Model","usage.col.project":"Project","usage.col.session":"Session","usage.col.input":"Input","usage.col.output":"Output","usage.col.cacheRead":"Cache R","usage.col.cacheWrite":"Cache W","usage.col.cost":"Cost","usage.col.tools":"Tools","usage.col.total":"Total","usage.columns.button":"Columns","usage.columns.title":"Visible columns","usage.columns.reset":"Reset","usage.breakdown.title":"Token breakdown","usage.breakdown.headerTokens":"Tokens","usage.breakdown.headerCost":"Cost","usage.breakdown.total":"Total","usage.breakdown.reasoning":"reasoning","usage.breakdown.reasoningNote":"incl. above","filter.modelLabel":"Model","filter.projectLabel":"Project","filter.modelAll":"Model: All","filter.projectAll":"Project: All","filter.modelSingle":"Model: {value}","filter.projectSingle":"Project: {value}","filter.modelMulti":"Model: {count}","filter.projectMulti":"Project: {count}","filter.clearAll":"Clear all","filter.noOptions":"No options","sessions.title":"Sessions","sessions.subtitle":"{count} sessions \xb7 sorted by most recent activity","sessions.col.session":"Session","sessions.col.project":"Project","sessions.col.models":"Model(s)","sessions.col.requests":"Requests","sessions.col.tokens":"Tokens","sessions.col.cost":"Cost","sessions.col.duration":"Duration","sessions.col.lastActivity":"Last activity","sessions.untitled":"Session {hash}","sessions.empty":"No sessions yet","session.kpi.requests":"Requests","session.kpi.totalTokens":"Total tokens","session.kpi.cost":"Cost","session.kpi.duration":"Duration","session.timeline.title":"Message timeline","session.timeline.desc":"In order; newest at the bottom","session.perMessage.title":"Per-message tokens","session.modelsInSession":"Models in this session","session.modelLine":"{requests} req \xb7 {tokens} tokens","session.token.in":"in","session.token.out":"out","session.token.cacheR":"cache r","session.token.cacheW":"cache w","projects.title":"Projects","projects.subtitle":"{count} projects \xb7 sorted by spend","projects.empty":"No projects yet","projects.stat.sessions":"Sessions","projects.stat.requests":"Requests","projects.stat.tokens":"Tokens","project.activity":"Activity (last 30 days)","project.sessions.title":"Sessions ({count})","models.title":"Models","models.subtitle":"{count} model(s) used in total","models.empty":"No model usage yet","models.share.cost":"Cost share","models.share.tokens":"Tokens share","models.share.cacheHit":"Cache hit","models.field.requests":"Requests","models.field.savedByCache":"Saved by cache","models.field.input1M":"Input / 1M","models.field.output1M":"Output / 1M","models.field.cacheRead1M":"Cache read / 1M","models.field.pctOfTotal":"{pct} of total spend \xb7 {tokens} tokens","models.eachTrend":"Combined trend (last 30 days)","settings.title":"Settings","settings.subtitle":"Data sources, pricing, and behavior","settings.dataSources.title":"Data sources","settings.dataSources.desc":"ccgauge scans these locations for JSONL files","settings.dataSources.active":"active","settings.dataSources.notPresent":"not present","settings.dataSources.envHint":"Override with {env1} or {env2} environment variables (the dashboard appends {appendix}).","settings.rescan":"Rescan now","settings.rescanning":"Rescanning…","settings.scanStats.title":"Scan stats","settings.scanStats.files":"Files scanned","settings.scanStats.records":"Records parsed","settings.scanStats.assistant":"Assistant records (deduped)","settings.scanStats.duration":"Scan duration","settings.pricing.title":"Pricing table","settings.pricing.desc":"USD per 1M tokens \xb7 built-in snapshot, fuzzy match for date-suffixed model names","settings.pricing.col.model":"Model","settings.pricing.col.input":"Input","settings.pricing.col.output":"Output","settings.pricing.col.write5m":"Cache write 5m","settings.pricing.col.write1h":"Cache write 1h","settings.pricing.col.read":"Cache read","settings.preferences.title":"Preferences","settings.preferences.language":"Language","settings.preferences.theme":"Theme","settings.theme.light":"Light","settings.theme.dark":"Dark","settings.theme.system":"System","settings.about.title":"About","settings.about.subtitle":"Version {version} \xb7 MIT licensed","settings.about.line1":"Fully local: data never leaves your machine; no telemetry, no network calls.","settings.about.line2":"Read-only: ccgauge only reads JSONL files, never writes back to ~/.claude.","settings.about.line3":'Cache: scan results are memoized for 5s; click "Rescan" to force a fresh read.',"settings.about.line4":"Stop with Ctrl+C in the terminal that started ccgauge.","settings.indexer.desc":"Background indexer keeps the cache fresh via file watchers.","settings.indexer.lastIndexedAt":"Last indexed","settings.indexer.indexDuration":"Last index time","settings.indexer.watchers":"Active watchers","settings.indexer.loadedFromDisk":"Loaded from disk","settings.indexer.status":"Status","settings.indexer.indexing":"indexing…","settings.indexer.idle":"idle","settings.indexer.recentErrors":"Recent indexer errors","common.yes":"yes","common.no":"no","lang.label":"Language","lang.en":"English","lang.zh":"中文","theme.label":"Theme"},zh:{"brand.tagline":"AI 编程 CLI 的本地用量看板","nav.overview":"概览","nav.usage":"用量","nav.sessions":"会话","nav.projects":"项目","nav.models":"模型","nav.settings":"设置","nav.localBadge":"本地","nav.source":"数据源","source.claude":"Claude","source.codex":"Codex","cost.footnote.codex":"按 OpenAI API 单价折算估值(订阅计划实际计费不同)","common.requests":"次请求","common.tokens":"tokens","common.cost":"花费","common.savedViaCache":"通过缓存节省 {amount}","common.savedTodayViaCache":"今日缓存节省 {amount}","common.live":"进行中","common.allModels":"全部","common.allProjects":"全部","common.unknown":"(未知)","common.session":"会话","common.sessions":"个会话","common.projects":"个项目","common.req":"请求","common.day":"天","common.days":"天","common.activity":"活跃","common.fallbackPrice":"使用兜底单价","common.thinking":"思考","common.lastActivity":"最近活跃","common.empty.title":"暂无用量数据","common.empty.desc":"打开 Claude Code 发送一条消息后刷新本页。","common.refresh":"刷新","common.search":"搜索…","common.searchPlaceholder":"搜索模型 / 项目 / 会话 / 工具…","common.exportCsv":"导出 CSV","common.rows":"{count} 行","common.prev":"‹ 上一页","common.next":"下一页 ›","common.first":"\xab","common.last":"\xbb","common.pageOf":"第 {page} / {total} 页","common.allSessions":"← 返回会话列表","common.allProjectsLink":"← 返回项目列表","common.noMatchingRows":"没有匹配的记录","range.label":"时间范围","range.today":"今天","range.7d":"7 天","range.30d":"30 天","range.90d":"90 天","range.all":"全部","gran.label":"粒度","gran.hour":"小时","gran.day":"天","gran.week":"周","gran.month":"月","overview.title":"概览","overview.subtitle":"{count} 次请求,覆盖 {files} 个文件 \xb7 扫描耗时 {ms}ms","overview.subtitle.empty":"已扫描 {dirs} 个目录。打开 Claude Code 发一条消息后刷新本页。","overview.empty.title":"暂无用量数据","overview.kpi.tokensToday":"今日 tokens","overview.kpi.costToday":"今日花费","overview.kpi.thisMonth":"本月累计","overview.kpi.cacheHit":"缓存命中率","overview.kpi.topModel":"主力模型","overview.kpi.activeSessions":"今日会话","overview.kpi.activeSessions.hint":"涉及 {count} 个项目","overview.kpi.thisMonth.hint":"{tokens} tokens \xb7 {req} 次请求","overview.kpi.tokensToday.hint":"{count} 次请求","overview.kpi.topModel.hint":"本月成本占比 {pct}","overview.kpi.cacheHit.hint":"今日缓存节省 {amount}","overview.delta.title":"相比昨日","overview.delta.firstTime":"首次","common.loading":"加载中…","common.error.title":"出错了","common.error.desc":"加载失败,请重试。","common.error.retry":"重试","overview.trend.title":"Token 用量趋势","overview.trend.desc":"近 30 天 \xb7 按 token 类型堆叠","overview.trend.activeDays":"{n} 天有数据","overview.trend.activeDays.plural":"{n} 天有数据","overview.costByModel.title":"按模型成本分布","overview.costByModel.desc":"本月,按花费排序","block.title":"当前 5h block","block.remaining":"剩余","block.elapsed":"已用 {pct}%","block.tokensSuffix":"tokens","block.spentSoFar":"已花费","block.burnPerMin":"每分钟消耗","block.projectedTotal":"预计总花费","block.requests":"请求数","block.empty":"当前无活跃 block","block.emptyDesc":"在 Claude Code 中发送消息会启动一个新 block。","chart.legend.input":"输入","chart.legend.output":"输出","chart.legend.cacheRead":"缓存读取","chart.legend.cacheWrite":"缓存写入","chart.tooltip.total":"合计","chart.tooltip.cost":"花费","chart.tooltip.requests":"请求数","chart.empty":"区间内无数据","chart.empty.short":"暂无数据","usage.title":"用量明细","usage.subtitle":"当前筛选范围内 {count} 轮对话","usage.kpi.totalTokens":"总 tokens","usage.kpi.totalCost":"总花费","usage.kpi.cacheSaved":"缓存节省","usage.kpi.cacheHit":"缓存命中","usage.trend":"趋势","usage.trend.gran":"粒度:{gran}","usage.requests.title":"对话轮次","usage.requests.desc":"每轮对话一行(用户消息 + 工具调用),点击 ▸ 展开明细","usage.col.calls":"调用","usage.col.userMessage":"提示","usage.turn.expand":"展开","usage.turn.collapse":"收起","usage.turn.callsCount":"{count} 次调用","usage.turn.noPrompt":"(无用户文本)","usage.col.time":"时间","usage.col.model":"模型","usage.col.project":"项目","usage.col.session":"会话","usage.col.input":"输入","usage.col.output":"输出","usage.col.cacheRead":"缓存读","usage.col.cacheWrite":"缓存写","usage.col.cost":"花费","usage.col.tools":"工具","usage.col.total":"总量","usage.columns.button":"列","usage.columns.title":"显示列","usage.columns.reset":"重置","usage.breakdown.title":"总量明细","usage.breakdown.headerTokens":"Token","usage.breakdown.headerCost":"花费","usage.breakdown.total":"合计","usage.breakdown.reasoning":"其中推理","usage.breakdown.reasoningNote":"已含在 output","filter.modelLabel":"模型","filter.projectLabel":"项目","filter.modelAll":"模型:全部","filter.projectAll":"项目:全部","filter.modelSingle":"模型:{value}","filter.projectSingle":"项目:{value}","filter.modelMulti":"模型:{count} 个","filter.projectMulti":"项目:{count} 个","filter.clearAll":"清除筛选","filter.noOptions":"没有可选项","sessions.title":"会话","sessions.subtitle":"共 {count} 个会话 \xb7 按最近活跃排序","sessions.col.session":"会话","sessions.col.project":"项目","sessions.col.models":"模型","sessions.col.requests":"请求数","sessions.col.tokens":"Tokens","sessions.col.cost":"花费","sessions.col.duration":"时长","sessions.col.lastActivity":"最近活跃","sessions.untitled":"会话 {hash}","sessions.empty":"暂无会话","session.kpi.requests":"请求数","session.kpi.totalTokens":"总 tokens","session.kpi.cost":"花费","session.kpi.duration":"时长","session.timeline.title":"消息时间线","session.timeline.desc":"按时间正序,最新的在最下方","session.perMessage.title":"逐条消息 tokens","session.modelsInSession":"本会话使用的模型","session.modelLine":"{requests} 次 \xb7 {tokens} tokens","session.token.in":"输入","session.token.out":"输出","session.token.cacheR":"缓存读","session.token.cacheW":"缓存写","projects.title":"项目","projects.subtitle":"共 {count} 个项目 \xb7 按花费排序","projects.empty":"暂无项目","projects.stat.sessions":"会话","projects.stat.requests":"请求","projects.stat.tokens":"Tokens","project.activity":"活跃情况(近 30 天)","project.sessions.title":"会话({count})","models.title":"模型","models.subtitle":"共使用过 {count} 个模型","models.empty":"暂无模型用量","models.share.cost":"成本占比","models.share.tokens":"Tokens 占比","models.share.cacheHit":"缓存命中","models.field.requests":"请求数","models.field.savedByCache":"缓存节省","models.field.input1M":"输入 / 1M","models.field.output1M":"输出 / 1M","models.field.cacheRead1M":"缓存读 / 1M","models.field.pctOfTotal":"占总花费 {pct} \xb7 {tokens} tokens","models.eachTrend":"整体趋势(近 30 天)","settings.title":"设置","settings.subtitle":"数据源、价格表与行为偏好","settings.dataSources.title":"数据源","settings.dataSources.desc":"ccgauge 会扫描以下路径的 JSONL 文件","settings.dataSources.active":"已启用","settings.dataSources.notPresent":"不存在","settings.dataSources.envHint":"可以通过环境变量 {env1} 或 {env2} 自定义路径(看板会自动追加 {appendix})。","settings.rescan":"立即重新扫描","settings.rescanning":"扫描中…","settings.scanStats.title":"扫描统计","settings.scanStats.files":"扫描文件数","settings.scanStats.records":"解析记录数","settings.scanStats.assistant":"去重后 assistant 记录","settings.scanStats.duration":"扫描耗时","settings.pricing.title":"价格表","settings.pricing.desc":"美元 / 1M tokens \xb7 内置快照,对带日期后缀的模型名做 fuzzy 匹配","settings.pricing.col.model":"模型","settings.pricing.col.input":"输入","settings.pricing.col.output":"输出","settings.pricing.col.write5m":"缓存写入 5 分钟","settings.pricing.col.write1h":"缓存写入 1 小时","settings.pricing.col.read":"缓存读取","settings.preferences.title":"偏好设置","settings.preferences.language":"语言","settings.preferences.theme":"主题","settings.theme.light":"亮色","settings.theme.dark":"暗色","settings.theme.system":"跟随系统","settings.about.title":"关于","settings.about.subtitle":"版本 {version} \xb7 MIT 协议","settings.about.line1":"完全本地:数据从不离开你的机器,没有任何遥测、没有任何网络调用。","settings.about.line2":"只读:ccgauge 只读取 JSONL,绝不会写回 ~/.claude。","settings.about.line3":'缓存:扫描结果会缓存 5 秒;点击"重新扫描"可强制刷新。',"settings.about.line4":"在启动 ccgauge 的终端按 Ctrl+C 即可停止。","settings.indexer.desc":"后台 indexer 通过文件监听增量维护缓存。","settings.indexer.lastIndexedAt":"最近索引时间","settings.indexer.indexDuration":"最近索引耗时","settings.indexer.watchers":"活跃 watcher 数","settings.indexer.loadedFromDisk":"从磁盘恢复","settings.indexer.status":"状态","settings.indexer.indexing":"索引中…","settings.indexer.idle":"空闲","settings.indexer.recentErrors":"最近的索引错误","common.yes":"是","common.no":"否","lang.label":"语言","lang.en":"English","lang.zh":"中文","theme.label":"主题"}},c="ccgauge_locale",r=(0,n.createContext)({locale:"en",setLocale:()=>{},t:e=>e}),l="ccgauge.locale";function d(e){let{initialLocale:s,children:t}=e,d=(0,i.useRouter)();(0,n.useEffect)(()=>{try{let e=localStorage.getItem(l);e&&e!==s&&("en"===e||"zh"===e)&&(document.cookie="".concat(c,"=").concat(e,"; path=/; max-age=").concat(31536e3,"; SameSite=Lax"),d.refresh())}catch(e){}},[]);let u=(0,n.useCallback)(e=>{try{localStorage.setItem(l,e)}catch(e){}document.cookie="".concat(c,"=").concat(e,"; path=/; max-age=").concat(31536e3,"; SameSite=Lax"),d.refresh()},[d]),m=(0,n.useCallback)((e,t)=>(function(e,s,t){var o;let n=null==(o=a[e])?void 0:o[s];if(void 0===n&&(n=a.en[s]),void 0===n&&(n=s),t)for(let[e,s]of Object.entries(t))n=n.replace(RegExp("\\{".concat(e,"\\}"),"g"),String(s));return n})(s,e,t),[s]),g=(0,n.useMemo)(()=>({locale:s,setLocale:u,t:m}),[s,u,m]);return(0,o.jsx)(r.Provider,{value:g,children:t})}function u(){return(0,n.useContext)(r)}function m(){return(0,n.useContext)(r).t}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[177],{12112:(e,t,r)=>{"use strict";r.d(t,{Providers:()=>s});var n=r(95155),a=r(19454),i=r(84479);function s(e){let{locale:t,theme:r,children:s}=e;return(0,n.jsx)(a.CY,{initialLocale:t,children:(0,n.jsx)(i.N,{initialTheme:r,children:s})})}},21264:(e,t,r)=>{"use strict";r.d(t,{LanguageSwitcher:()=>o});var n=r(95155),a=r(19454);let i={en:"EN",zh:"中"},s={en:"zh",zh:"en"},c={en:"English",zh:"中文"};function o(){let{locale:e,setLocale:t,t:r}=(0,a.s9)(),o=s[e];return(0,n.jsx)("button",{onClick:()=>t(o),className:"h-7 w-9 inline-flex items-center justify-center rounded-md border border-border bg-bg-surface text-xs font-medium text-text-secondary hover:text-text-primary hover:bg-bg-surface-hi hover:border-border-hi transition-colors",title:"".concat(r("lang.label"),": ").concat(c[e]," → ").concat(c[o]),"aria-label":r("lang.label"),children:i[e]})}},25016:(e,t,r)=>{"use strict";r.d(t,{BC:()=>m,P6:()=>g,PJ:()=>u,R8:()=>d,az:()=>o,cn:()=>i,jh:()=>c,l7:()=>l,r6:()=>h});var n=r(2821),a=r(75889);function i(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,a.QP)((0,n.$)(t))}function s(e,t){var r;return new Intl.NumberFormat("en-US",{maximumFractionDigits:null!=(r=null==t?void 0:t.maxFrac)?r:0}).format(e)}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en";return Number.isFinite(e)?"zh"===t?e>=1e8?(e/1e8).toFixed(2)+"亿":e>=1e4?(e/1e4).toFixed(1)+"万":s(e):e>=1e9?(e/1e9).toFixed(2)+"B":e>=1e6?(e/1e6).toFixed(2)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":s(e):"0"}function o(e,t){var r,n;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:null!=(r=null==t?void 0:t.minFrac)?r:2,maximumFractionDigits:null!=(n=null==t?void 0:t.maxFrac)?n:2}).format(e)}function l(e){return 0===e?"$0":e<.01?new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:4,maximumFractionDigits:6}).format(e):o(e)}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Number.isFinite(e)?"".concat((100*e).toFixed(t),"%"):"0%"}function h(e){let t="string"==typeof e||"number"==typeof e?new Date(e):e;if(Number.isNaN(t.getTime()))return"";let r=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),a=String(t.getDate()).padStart(2,"0"),i=String(t.getHours()).padStart(2,"0"),s=String(t.getMinutes()).padStart(2,"0"),c=String(t.getSeconds()).padStart(2,"0");return"".concat(r,"-").concat(n,"-").concat(a," ").concat(i,":").concat(s,":").concat(c)}function u(e){if(!e)return"(unknown)";let t=e.replace(/\/+$/,"").split("/");return t[t.length-1]||e}function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return e?e.replace(/-/g,"").slice(0,t):""}let x={mini:"Mini",nano:"Nano",pro:"Pro",turbo:"Turbo",preview:"Preview"};function g(e){if(!e)return"(unknown)";let t=e.replace(/^(vertex_ai|bedrock|anthropic|openai)\//,""),r=t.toLowerCase();if(r.startsWith("gpt-")||/^o\d/.test(r))return r.startsWith("gpt-")?"GPT-"+t.slice(4).split("-").map(e=>{var t;return null!=(t=x[e.toLowerCase()])?t:e}).join(" "):t.toUpperCase();let n=t.replace(/-(\d{8})$/,""),a=(n=n.replace(/^claude-/,"")).split("-");if(a.length>=2){let e=a[0],t=a.slice(1).join(".");return f(e)+" "+t}return f(n.replace(/-/g," "))}function f(e){return e.replace(/\b\w/g,e=>e.toUpperCase())}},41290:()=>{},44703:(e,t,r)=>{"use strict";r.d(t,{ThemeSwitcher:()=>c});var n=r(95155),a=r(84479),i=r(19454);let s={light:"dark",dark:"system",system:"light"};function c(){let{theme:e,resolved:t,setTheme:r}=(0,a.D)(),{t:c}=(0,i.s9)(),l=s[e];return(0,n.jsx)("button",{onClick:()=>r(l),className:"h-7 w-9 inline-flex items-center justify-center rounded-md border border-border bg-bg-surface text-text-secondary hover:text-text-primary hover:bg-bg-surface-hi hover:border-border-hi transition-colors",title:"".concat(c("theme.label"),": ").concat(c("settings.theme.".concat(e))," (").concat(t,") → ").concat(c("settings.theme.".concat(l))),"aria-label":c("theme.label"),children:(0,n.jsx)(o,{theme:e})})}function o(e){let{theme:t}=e;return"light"===t?(0,n.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,n.jsx)("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"})]}):"dark"===t?(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:(0,n.jsx)("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}):(0,n.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,n.jsx)("path",{d:"M12 3v18"}),(0,n.jsx)("path",{d:"M12 3a9 9 0 0 1 0 18z",fill:"currentColor",stroke:"none"})]})}},57581:(e,t,r)=>{"use strict";r.d(t,{Nav:()=>g});var n=r(95155),a=r(52619),i=r.n(a),s=r(20063),c=r(25016),o=r(19454),l=r(21264),d=r(44703);function h(e){let{className:t,withBackground:r=!0}=e;return(0,n.jsxs)("svg",{viewBox:"0 0 64 64",fill:"none","aria-hidden":!0,className:(0,c.cn)("block",t),children:[r&&(0,n.jsx)("rect",{width:"64",height:"64",rx:"14",className:"fill-brand"}),(0,n.jsx)("path",{d:"M14 41 A18 18 0 0 1 50 41",stroke:"currentColor",strokeOpacity:r?.32:.25,strokeWidth:"4.5",strokeLinecap:"round",className:r?"text-white":""}),(0,n.jsx)("path",{d:"M14 41 A18 18 0 0 1 43.2 25.4",stroke:"currentColor",strokeWidth:"4.5",strokeLinecap:"round",className:r?"text-white":"text-brand"}),(0,n.jsx)("line",{x1:"32",y1:"41",x2:"42",y2:"27",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",className:r?"text-white":"text-brand"}),(0,n.jsx)("circle",{cx:"32",cy:"41",r:"3",className:r?"fill-white":"fill-brand"})]})}var u=r(12115);function m(e){let{available:t,initial:r,providers:a}=e,i=(0,s.useRouter)(),c=(0,s.usePathname)(),l=(0,s.useSearchParams)(),d=(0,o.kj)(),{locale:h}=(0,o.s9)(),[m,x]=(0,u.useTransition)(),g=l.get("source"),[f,p]=(0,u.useState)(null!=g?g:r);return((0,u.useEffect)(()=>{g&&g!==f&&p(g)},[g,f]),t.length<2)?null:(0,n.jsx)("div",{role:"group","aria-label":d("nav.source"),className:"inline-flex items-center rounded-md border border-border bg-bg-surface p-0.5 gap-0.5",title:d("nav.source"),children:a.filter(e=>t.includes(e.id)).map(e=>{let t=e.id===f,r="zh"===h?e.displayZh:e.displayEn;return(0,n.jsxs)("button",{type:"button",onClick:()=>(e=>{var t;if(e===f)return;p(e),t=e,"undefined"!=typeof document&&(document.cookie="".concat("ccgauge_source","=").concat(encodeURIComponent(t),"; path=/; max-age=").concat(31536e3,"; SameSite=Lax"));let r=new URLSearchParams(l.toString());r.set("source",e);let n=/^\/sessions\/[^/]+|^\/projects\/[^/]+/.test(c)?"/".concat(c.split("/")[1],"?").concat(r.toString()):"".concat(c,"?").concat(r.toString());x(()=>{i.push(n)})})(e.id),"aria-pressed":t,disabled:m,className:"px-2.5 h-6 text-xs inline-flex items-center gap-1.5 rounded transition-all ".concat(t?"bg-brand text-white font-semibold shadow-sm ring-1 ring-brand/40":"text-text-tertiary font-medium hover:text-text-primary hover:bg-bg-surface-hi"),children:[(0,n.jsx)("span",{className:"inline-flex items-center justify-center w-3.5 h-3.5 rounded-full text-[9px] font-bold leading-none ".concat(t?"ring-1 ring-white/40":""),style:{background:e.bg,color:e.fg},children:e.shortLabel}),(0,n.jsx)("span",{children:r})]},e.id)})})}let x=[{href:"/",tk:"nav.overview",exact:!0},{href:"/usage",tk:"nav.usage"},{href:"/sessions",tk:"nav.sessions"},{href:"/projects",tk:"nav.projects"},{href:"/models",tk:"nav.models"},{href:"/settings",tk:"nav.settings"}];function g(e){let{availableProviders:t,initialSource:r,providerInfos:a}=e,u=(0,s.usePathname)(),g=(0,o.kj)();return(0,n.jsx)("header",{className:"sticky top-0 z-30 border-b border-border bg-bg-base/80 backdrop-blur",children:(0,n.jsxs)("div",{className:"max-w-7xl mx-auto px-3 sm:px-6 h-14 flex items-center gap-2 sm:gap-4",children:[(0,n.jsxs)(i(),{href:"/",className:"flex items-center gap-2 font-semibold tracking-tight whitespace-nowrap shrink-0","aria-label":"ccgauge home",children:[(0,n.jsx)(h,{className:"w-7 h-7"}),(0,n.jsx)("span",{className:"hidden xs:inline sm:inline",children:"ccgauge"}),(0,n.jsx)("span",{className:"text-xs text-text-tertiary font-normal hidden lg:inline",children:g("brand.tagline")})]}),(0,n.jsx)("nav",{className:"flex-1 min-w-0 flex items-center gap-1 overflow-x-auto scrollbar-thin","aria-label":"Primary",children:x.map(e=>{let t=e.exact?u===e.href:u===e.href||u.startsWith(e.href+"/");return(0,n.jsx)(i(),{href:e.href,prefetch:!1,"aria-current":t?"page":void 0,className:(0,c.cn)("px-2.5 sm:px-3 py-1.5 text-sm rounded-button font-medium transition-colors whitespace-nowrap shrink-0",t?"text-text-primary bg-bg-surface-hi":"text-text-secondary hover:text-text-primary hover:bg-bg-surface"),children:g(e.tk)},e.href)})}),(0,n.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,n.jsx)(m,{available:t,initial:r,providers:a}),(0,n.jsx)("span",{className:"pill bg-bg-surface-hi text-text-tertiary text-[10px] uppercase tracking-wide hidden md:inline-flex",children:g("nav.localBadge")}),(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,n.jsx)(l.LanguageSwitcher,{}),(0,n.jsx)(d.ThemeSwitcher,{})]})]})]})})}},79076:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,41290,23)),Promise.resolve().then(r.bind(r,57581)),Promise.resolve().then(r.bind(r,12112))},84479:(e,t,r)=>{"use strict";r.d(t,{N:()=>d,D:()=>h});var n=r(95155),a=r(12115);let i="ccgauge_theme",s=(0,a.createContext)({theme:"system",resolved:"dark",setTheme:()=>{}}),c="ccgauge.theme";function o(e){return"light"===e?"light":"dark"===e?"dark":window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"}function l(e){if("undefined"==typeof document)return;let t=document.documentElement,r=o(e);t.classList.remove("theme-light","theme-dark"),t.classList.add("light"===r?"theme-light":"theme-dark"),t.setAttribute("data-theme",r)}function d(e){let{initialTheme:t,children:r}=e,[d,h]=(0,a.useState)(t),[u,m]=(0,a.useState)(()=>"system"===t?"dark":t);(0,a.useEffect)(()=>{try{let e=localStorage.getItem(c);if("light"===e||"dark"===e||"system"===e){e!==t&&(document.cookie="".concat(i,"=").concat(e,"; path=/; max-age=").concat(31536e3,"; SameSite=Lax")),h(e);let r=o(e);m(r),l(e)}else{let e=o(t);m(e),l(t)}}catch(e){m(o(t)),l(t)}},[]),(0,a.useEffect)(()=>{if("system"!==d)return;let e=window.matchMedia("(prefers-color-scheme: light)"),t=()=>{m(e.matches?"light":"dark"),l("system")};return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[d]);let x=(0,a.useCallback)(e=>{try{localStorage.setItem(c,e)}catch(e){}document.cookie="".concat(i,"=").concat(e,"; path=/; max-age=").concat(31536e3,"; SameSite=Lax"),h(e),m(o(e)),l(e)},[]);return(0,n.jsx)(s.Provider,{value:{theme:d,resolved:u,setTheme:x},children:r})}function h(){return(0,a.useContext)(s)}}},e=>{e.O(0,[741,760,619,454,441,255,358],()=>e(e.s=79076)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[329],{25016:(e,t,a)=>{"use strict";a.d(t,{BC:()=>h,P6:()=>p,PJ:()=>m,R8:()=>u,az:()=>l,cn:()=>i,jh:()=>s,l7:()=>o,r6:()=>d});var r=a(2821),n=a(75889);function i(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,n.QP)((0,r.$)(t))}function c(e,t){var a;return new Intl.NumberFormat("en-US",{maximumFractionDigits:null!=(a=null==t?void 0:t.maxFrac)?a:0}).format(e)}function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en";return Number.isFinite(e)?"zh"===t?e>=1e8?(e/1e8).toFixed(2)+"亿":e>=1e4?(e/1e4).toFixed(1)+"万":c(e):e>=1e9?(e/1e9).toFixed(2)+"B":e>=1e6?(e/1e6).toFixed(2)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":c(e):"0"}function l(e,t){var a,r;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:null!=(a=null==t?void 0:t.minFrac)?a:2,maximumFractionDigits:null!=(r=null==t?void 0:t.maxFrac)?r:2}).format(e)}function o(e){return 0===e?"$0":e<.01?new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:4,maximumFractionDigits:6}).format(e):l(e)}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Number.isFinite(e)?"".concat((100*e).toFixed(t),"%"):"0%"}function d(e){let t="string"==typeof e||"number"==typeof e?new Date(e):e;if(Number.isNaN(t.getTime()))return"";let a=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),i=String(t.getHours()).padStart(2,"0"),c=String(t.getMinutes()).padStart(2,"0"),s=String(t.getSeconds()).padStart(2,"0");return"".concat(a,"-").concat(r,"-").concat(n," ").concat(i,":").concat(c,":").concat(s)}function m(e){if(!e)return"(unknown)";let t=e.replace(/\/+$/,"").split("/");return t[t.length-1]||e}function h(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return e?e.replace(/-/g,"").slice(0,t):""}let x={mini:"Mini",nano:"Nano",pro:"Pro",turbo:"Turbo",preview:"Preview"};function p(e){if(!e)return"(unknown)";let t=e.replace(/^(vertex_ai|bedrock|anthropic|openai)\//,""),a=t.toLowerCase();if(a.startsWith("gpt-")||/^o\d/.test(a))return a.startsWith("gpt-")?"GPT-"+t.slice(4).split("-").map(e=>{var t;return null!=(t=x[e.toLowerCase()])?t:e}).join(" "):t.toUpperCase();let r=t.replace(/-(\d{8})$/,""),n=(r=r.replace(/^claude-/,"")).split("-");if(n.length>=2){let e=n[0],t=n.slice(1).join(".");return g(e)+" "+t}return g(r.replace(/-/g," "))}function g(e){return e.replace(/\b\w/g,e=>e.toUpperCase())}},38059:(e,t,a)=>{"use strict";a.d(t,{TokenStackChart:()=>x});var r=a(95155),n=a(26991),i=a(94632),c=a(68425),s=a(47734),l=a(73697),o=a(23508),u=a(26736),d=a(25016),m=a(19454);let h={input:"rgb(var(--chart-input))",output:"rgb(var(--chart-output))",cacheRead:"rgb(var(--chart-cache-read))",cacheCreation:"rgb(var(--chart-cache-create))"};function x(e){let{data:t,height:a="h-72"}=e,x=(0,m.kj)(),{locale:f}=(0,m.s9)();return t.length?(0,r.jsxs)("div",{className:"".concat(a," w-full"),children:[(0,r.jsx)(n.u,{width:"100%",height:"100%",children:(0,r.jsxs)(i.E,{data:t,margin:{top:12,right:8,bottom:4,left:8},children:[(0,r.jsx)(c.d,{stroke:"rgb(var(--chart-grid))",strokeDasharray:"3 3",vertical:!1}),(0,r.jsx)(s.W,{dataKey:"label",tick:{fill:"rgb(var(--chart-axis))",fontSize:11},tickLine:!1,axisLine:{stroke:"rgb(var(--chart-grid))"},interval:"preserveStartEnd",minTickGap:32}),(0,r.jsx)(l.h,{tickFormatter:e=>(0,d.jh)(Number(e),f),tick:{fill:"rgb(var(--chart-axis))",fontSize:11},tickLine:!1,axisLine:{stroke:"rgb(var(--chart-grid))"},width:56}),(0,r.jsx)(o.m,{content:(0,r.jsx)(g,{}),cursor:{fill:"rgb(var(--text-primary) / 0.04)"}}),(0,r.jsx)(u.y,{dataKey:"input",stackId:"a",fill:h.input,isAnimationActive:!1}),(0,r.jsx)(u.y,{dataKey:"cacheCreation",stackId:"a",fill:h.cacheCreation,isAnimationActive:!1}),(0,r.jsx)(u.y,{dataKey:"cacheRead",stackId:"a",fill:h.cacheRead,isAnimationActive:!1}),(0,r.jsx)(u.y,{dataKey:"output",stackId:"a",fill:h.output,radius:[3,3,0,0],isAnimationActive:!1})]})}),(0,r.jsxs)("div",{className:"flex items-center flex-wrap justify-center gap-4 text-xs text-text-secondary mt-2",children:[(0,r.jsx)(p,{color:h.input,label:x("chart.legend.input")}),(0,r.jsx)(p,{color:h.cacheCreation,label:x("chart.legend.cacheWrite")}),(0,r.jsx)(p,{color:h.cacheRead,label:x("chart.legend.cacheRead")}),(0,r.jsx)(p,{color:h.output,label:x("chart.legend.output")})]})]}):(0,r.jsx)("div",{className:"".concat(a," flex items-center justify-center text-text-tertiary text-sm"),children:x("chart.empty")})}function p(e){let{color:t,label:a}=e;return(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,r.jsx)("span",{className:"w-2.5 h-2.5 rounded-sm",style:{background:t}}),(0,r.jsx)("span",{children:a})]})}function g(e){let t=(0,m.kj)(),{locale:a}=(0,m.s9)();if(!e.active||!e.payload||!e.payload.length)return null;let n=e.payload[0].payload,i=n.input+n.output+n.cacheRead+n.cacheCreation;return(0,r.jsxs)("div",{className:"card border-border-hi shadow-lg p-3 text-xs min-w-[200px]",children:[(0,r.jsx)("div",{className:"font-medium text-text-primary mb-2",children:e.label}),(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)(f,{color:h.input,label:t("chart.legend.input"),value:n.input,locale:a}),(0,r.jsx)(f,{color:h.cacheCreation,label:t("chart.legend.cacheWrite"),value:n.cacheCreation,locale:a}),(0,r.jsx)(f,{color:h.cacheRead,label:t("chart.legend.cacheRead"),value:n.cacheRead,locale:a}),(0,r.jsx)(f,{color:h.output,label:t("chart.legend.output"),value:n.output,locale:a})]}),(0,r.jsxs)("div",{className:"mt-2 pt-2 border-t border-border flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-text-secondary",children:t("chart.tooltip.total")}),(0,r.jsx)("span",{className:"num-mono text-text-primary",children:(0,d.jh)(i,a)})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between mt-1",children:[(0,r.jsx)("span",{className:"text-text-secondary",children:t("chart.tooltip.cost")}),(0,r.jsx)("span",{className:"num-mono text-brand",children:(0,d.az)(n.cost)})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between mt-1",children:[(0,r.jsx)("span",{className:"text-text-secondary",children:t("chart.tooltip.requests")}),(0,r.jsx)("span",{className:"num-mono text-text-primary",children:n.requests})]})]})}function f(e){let{color:t,label:a,value:n,locale:i}=e;return(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-text-secondary",children:[(0,r.jsx)("span",{className:"w-2 h-2 rounded-sm",style:{background:t}}),a]}),(0,r.jsx)("span",{className:"num-mono text-text-primary",children:(0,d.jh)(n,i)})]})}},85653:(e,t,a)=>{Promise.resolve().then(a.bind(a,38059))}},e=>{e.O(0,[760,930,454,441,255,358],()=>e(e.s=85653)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[974],{8608:(e,t,a)=>{"use strict";a.d(t,{ModelBarChart:()=>i});var r=a(95155),s=a(25016),n=a(19454);let c={opus:"rgb(var(--chart-output))",sonnet:"rgb(var(--chart-input))",haiku:"rgb(var(--chart-cache-read))"};function i(e){let{models:t}=e,a=(0,n.kj)(),{locale:i}=(0,n.s9)();if(!t.length)return(0,r.jsx)("div",{className:"text-sm text-text-tertiary",children:a("chart.empty")});let l=Math.max(...t.map(e=>e.cost),1e-4),o=t.reduce((e,t)=>e+t.cost,0);return(0,r.jsx)("div",{className:"space-y-3",children:t.map(e=>{let t=o>0?e.cost/o:0;return(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsxs)("div",{className:"flex items-baseline justify-between gap-3 text-sm",children:[(0,r.jsx)("span",{className:"font-medium text-text-primary",children:(0,s.P6)(e.model)}),(0,r.jsxs)("span",{className:"text-xs text-text-secondary tabular-nums flex-1 text-right",children:[(0,s.jh)(e.totalTokens,i)," \xb7 ",(0,s.R8)(t)]}),(0,r.jsx)("span",{className:"num-mono text-text-primary min-w-[80px] text-right",children:(0,s.az)(e.cost)})]}),(0,r.jsx)("div",{className:"h-2 w-full bg-bg-surface-hi rounded overflow-hidden",children:(0,r.jsx)("div",{className:"h-full rounded",style:{width:"".concat(e.cost/l*100,"%"),background:function(e){for(let t of Object.keys(c))if(e.toLowerCase().includes(t))return c[t];return"rgb(var(--chart-cache-create))"}(e.model)}})})]},e.model)})})}},15468:(e,t,a)=>{Promise.resolve().then(a.bind(a,25763)),Promise.resolve().then(a.bind(a,8608)),Promise.resolve().then(a.bind(a,38059))},25016:(e,t,a)=>{"use strict";a.d(t,{BC:()=>u,P6:()=>p,PJ:()=>x,R8:()=>d,az:()=>l,cn:()=>n,jh:()=>i,l7:()=>o,r6:()=>m});var r=a(2821),s=a(75889);function n(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,s.QP)((0,r.$)(t))}function c(e,t){var a;return new Intl.NumberFormat("en-US",{maximumFractionDigits:null!=(a=null==t?void 0:t.maxFrac)?a:0}).format(e)}function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en";return Number.isFinite(e)?"zh"===t?e>=1e8?(e/1e8).toFixed(2)+"亿":e>=1e4?(e/1e4).toFixed(1)+"万":c(e):e>=1e9?(e/1e9).toFixed(2)+"B":e>=1e6?(e/1e6).toFixed(2)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":c(e):"0"}function l(e,t){var a,r;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:null!=(a=null==t?void 0:t.minFrac)?a:2,maximumFractionDigits:null!=(r=null==t?void 0:t.maxFrac)?r:2}).format(e)}function o(e){return 0===e?"$0":e<.01?new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:4,maximumFractionDigits:6}).format(e):l(e)}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Number.isFinite(e)?"".concat((100*e).toFixed(t),"%"):"0%"}function m(e){let t="string"==typeof e||"number"==typeof e?new Date(e):e;if(Number.isNaN(t.getTime()))return"";let a=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),s=String(t.getDate()).padStart(2,"0"),n=String(t.getHours()).padStart(2,"0"),c=String(t.getMinutes()).padStart(2,"0"),i=String(t.getSeconds()).padStart(2,"0");return"".concat(a,"-").concat(r,"-").concat(s," ").concat(n,":").concat(c,":").concat(i)}function x(e){if(!e)return"(unknown)";let t=e.replace(/\/+$/,"").split("/");return t[t.length-1]||e}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return e?e.replace(/-/g,"").slice(0,t):""}let h={mini:"Mini",nano:"Nano",pro:"Pro",turbo:"Turbo",preview:"Preview"};function p(e){if(!e)return"(unknown)";let t=e.replace(/^(vertex_ai|bedrock|anthropic|openai)\//,""),a=t.toLowerCase();if(a.startsWith("gpt-")||/^o\d/.test(a))return a.startsWith("gpt-")?"GPT-"+t.slice(4).split("-").map(e=>{var t;return null!=(t=h[e.toLowerCase()])?t:e}).join(" "):t.toUpperCase();let r=t.replace(/-(\d{8})$/,""),s=(r=r.replace(/^claude-/,"")).split("-");if(s.length>=2){let e=s[0],t=s.slice(1).join(".");return j(e)+" "+t}return j(r.replace(/-/g," "))}function j(e){return e.replace(/\b\w/g,e=>e.toUpperCase())}},25763:(e,t,a)=>{"use strict";a.d(t,{BlockProgress:()=>i});var r=a(95155),s=a(12115),n=a(25016),c=a(19454);function i(e){let{initial:t}=e,a=(0,c.kj)(),{locale:s}=(0,c.s9)(),i=e=>(0,n.jh)(e,s);return t.hasBlock&&t.endTime&&t.startTime?(0,r.jsxs)("div",{className:"card card-pad min-h-[180px]",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("div",{className:"label",children:a("block.title")}),(0,r.jsxs)("span",{className:"pill bg-success/10 text-success border border-success/20",children:[(0,r.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-success mr-1 animate-pulse"}),a("common.live")]})]}),(0,r.jsx)(l,{startTime:t.startTime,endTime:t.endTime,totalTokens:t.totalTokens,remainingLabel:a("block.remaining"),renderElapsed:e=>a("block.elapsed",{pct:e}),tokensSuffix:a("block.tokensSuffix"),fmtTokens:i}),(0,r.jsxs)("div",{className:"mt-4 pt-4 border-t border-border grid grid-cols-2 gap-3 text-xs",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-text-tertiary",children:a("block.spentSoFar")}),(0,r.jsx)("div",{className:"num-mono text-text-primary mt-0.5 text-base",children:(0,n.az)(t.cost)})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-text-tertiary",children:a("block.burnPerMin")}),(0,r.jsx)("div",{className:"num-mono text-text-primary mt-0.5 text-base",children:i(t.burnRatePerMin)})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-text-tertiary",children:a("block.projectedTotal")}),(0,r.jsx)("div",{className:"num-mono text-text-secondary mt-0.5",children:(0,n.az)(t.projectedCost)})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-text-tertiary",children:a("block.requests")}),(0,r.jsx)("div",{className:"num-mono text-text-secondary mt-0.5",children:t.requests})]})]})]}):(0,r.jsxs)("div",{className:"card card-pad min-h-[180px] flex flex-col",children:[(0,r.jsx)("div",{className:"label",children:a("block.title")}),(0,r.jsx)("div",{className:"text-sm text-text-tertiary mt-4",children:a("block.empty")}),(0,r.jsx)("div",{className:"text-xs text-text-tertiary mt-1",children:a("block.emptyDesc")})]})}function l(e){let{startTime:t,endTime:a,totalTokens:n,remainingLabel:c,renderElapsed:i,tokensSuffix:l,fmtTokens:o}=e,[d,m]=(0,s.useState)(()=>Date.now());(0,s.useEffect)(()=>{let e=setInterval(()=>m(Date.now()),1e3);return()=>clearInterval(e)},[]);let x=new Date(t).getTime(),u=new Date(a).getTime(),h=Math.max(0,d-x),p=Math.max(0,u-d),j=Math.min(1,h/(u-x)),f=i((100*j).toFixed(1));return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"mt-3 flex items-baseline gap-2",children:[(0,r.jsx)("div",{className:"num-hero",children:function(e){if(e<=0)return"0s";let t=Math.floor(e/1e3),a=Math.floor(t/3600),r=Math.floor(t%3600/60),s=t%60;return a>0?"".concat(a,"h ").concat(String(r).padStart(2,"0"),"m"):r>0?"".concat(r,"m ").concat(String(s).padStart(2,"0"),"s"):"".concat(s,"s")}(p)}),(0,r.jsx)("div",{className:"text-xs text-text-secondary",children:c})]}),(0,r.jsxs)("div",{className:"mt-3 space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between text-xs text-text-secondary",children:[(0,r.jsx)("span",{children:f}),(0,r.jsxs)("span",{className:"num-mono",children:[o(n)," ",l]})]}),(0,r.jsx)("div",{className:"h-1.5 bg-bg-surface-hi rounded-full overflow-hidden",children:(0,r.jsx)("div",{className:"h-full bg-gradient-to-r from-brand to-brand-hover transition-all",style:{width:"".concat(100*j,"%")},suppressHydrationWarning:!0})})]})]})}},38059:(e,t,a)=>{"use strict";a.d(t,{TokenStackChart:()=>h});var r=a(95155),s=a(26991),n=a(94632),c=a(68425),i=a(47734),l=a(73697),o=a(23508),d=a(26736),m=a(25016),x=a(19454);let u={input:"rgb(var(--chart-input))",output:"rgb(var(--chart-output))",cacheRead:"rgb(var(--chart-cache-read))",cacheCreation:"rgb(var(--chart-cache-create))"};function h(e){let{data:t,height:a="h-72"}=e,h=(0,x.kj)(),{locale:f}=(0,x.s9)();return t.length?(0,r.jsxs)("div",{className:"".concat(a," w-full"),children:[(0,r.jsx)(s.u,{width:"100%",height:"100%",children:(0,r.jsxs)(n.E,{data:t,margin:{top:12,right:8,bottom:4,left:8},children:[(0,r.jsx)(c.d,{stroke:"rgb(var(--chart-grid))",strokeDasharray:"3 3",vertical:!1}),(0,r.jsx)(i.W,{dataKey:"label",tick:{fill:"rgb(var(--chart-axis))",fontSize:11},tickLine:!1,axisLine:{stroke:"rgb(var(--chart-grid))"},interval:"preserveStartEnd",minTickGap:32}),(0,r.jsx)(l.h,{tickFormatter:e=>(0,m.jh)(Number(e),f),tick:{fill:"rgb(var(--chart-axis))",fontSize:11},tickLine:!1,axisLine:{stroke:"rgb(var(--chart-grid))"},width:56}),(0,r.jsx)(o.m,{content:(0,r.jsx)(j,{}),cursor:{fill:"rgb(var(--text-primary) / 0.04)"}}),(0,r.jsx)(d.y,{dataKey:"input",stackId:"a",fill:u.input,isAnimationActive:!1}),(0,r.jsx)(d.y,{dataKey:"cacheCreation",stackId:"a",fill:u.cacheCreation,isAnimationActive:!1}),(0,r.jsx)(d.y,{dataKey:"cacheRead",stackId:"a",fill:u.cacheRead,isAnimationActive:!1}),(0,r.jsx)(d.y,{dataKey:"output",stackId:"a",fill:u.output,radius:[3,3,0,0],isAnimationActive:!1})]})}),(0,r.jsxs)("div",{className:"flex items-center flex-wrap justify-center gap-4 text-xs text-text-secondary mt-2",children:[(0,r.jsx)(p,{color:u.input,label:h("chart.legend.input")}),(0,r.jsx)(p,{color:u.cacheCreation,label:h("chart.legend.cacheWrite")}),(0,r.jsx)(p,{color:u.cacheRead,label:h("chart.legend.cacheRead")}),(0,r.jsx)(p,{color:u.output,label:h("chart.legend.output")})]})]}):(0,r.jsx)("div",{className:"".concat(a," flex items-center justify-center text-text-tertiary text-sm"),children:h("chart.empty")})}function p(e){let{color:t,label:a}=e;return(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,r.jsx)("span",{className:"w-2.5 h-2.5 rounded-sm",style:{background:t}}),(0,r.jsx)("span",{children:a})]})}function j(e){let t=(0,x.kj)(),{locale:a}=(0,x.s9)();if(!e.active||!e.payload||!e.payload.length)return null;let s=e.payload[0].payload,n=s.input+s.output+s.cacheRead+s.cacheCreation;return(0,r.jsxs)("div",{className:"card border-border-hi shadow-lg p-3 text-xs min-w-[200px]",children:[(0,r.jsx)("div",{className:"font-medium text-text-primary mb-2",children:e.label}),(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)(f,{color:u.input,label:t("chart.legend.input"),value:s.input,locale:a}),(0,r.jsx)(f,{color:u.cacheCreation,label:t("chart.legend.cacheWrite"),value:s.cacheCreation,locale:a}),(0,r.jsx)(f,{color:u.cacheRead,label:t("chart.legend.cacheRead"),value:s.cacheRead,locale:a}),(0,r.jsx)(f,{color:u.output,label:t("chart.legend.output"),value:s.output,locale:a})]}),(0,r.jsxs)("div",{className:"mt-2 pt-2 border-t border-border flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-text-secondary",children:t("chart.tooltip.total")}),(0,r.jsx)("span",{className:"num-mono text-text-primary",children:(0,m.jh)(n,a)})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between mt-1",children:[(0,r.jsx)("span",{className:"text-text-secondary",children:t("chart.tooltip.cost")}),(0,r.jsx)("span",{className:"num-mono text-brand",children:(0,m.az)(s.cost)})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between mt-1",children:[(0,r.jsx)("span",{className:"text-text-secondary",children:t("chart.tooltip.requests")}),(0,r.jsx)("span",{className:"num-mono text-text-primary",children:s.requests})]})]})}function f(e){let{color:t,label:a,value:s,locale:n}=e;return(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-text-secondary",children:[(0,r.jsx)("span",{className:"w-2 h-2 rounded-sm",style:{background:t}}),a]}),(0,r.jsx)("span",{className:"num-mono text-text-primary",children:(0,m.jh)(s,n)})]})}}},e=>{e.O(0,[760,930,454,441,255,358],()=>e(e.s=15468)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[801,824],{25016:(e,t,a)=>{"use strict";a.d(t,{BC:()=>h,P6:()=>p,PJ:()=>m,R8:()=>u,az:()=>l,cn:()=>i,jh:()=>s,l7:()=>o,r6:()=>d});var r=a(2821),n=a(75889);function i(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,n.QP)((0,r.$)(t))}function c(e,t){var a;return new Intl.NumberFormat("en-US",{maximumFractionDigits:null!=(a=null==t?void 0:t.maxFrac)?a:0}).format(e)}function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en";return Number.isFinite(e)?"zh"===t?e>=1e8?(e/1e8).toFixed(2)+"亿":e>=1e4?(e/1e4).toFixed(1)+"万":c(e):e>=1e9?(e/1e9).toFixed(2)+"B":e>=1e6?(e/1e6).toFixed(2)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":c(e):"0"}function l(e,t){var a,r;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:null!=(a=null==t?void 0:t.minFrac)?a:2,maximumFractionDigits:null!=(r=null==t?void 0:t.maxFrac)?r:2}).format(e)}function o(e){return 0===e?"$0":e<.01?new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:4,maximumFractionDigits:6}).format(e):l(e)}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Number.isFinite(e)?"".concat((100*e).toFixed(t),"%"):"0%"}function d(e){let t="string"==typeof e||"number"==typeof e?new Date(e):e;if(Number.isNaN(t.getTime()))return"";let a=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),i=String(t.getHours()).padStart(2,"0"),c=String(t.getMinutes()).padStart(2,"0"),s=String(t.getSeconds()).padStart(2,"0");return"".concat(a,"-").concat(r,"-").concat(n," ").concat(i,":").concat(c,":").concat(s)}function m(e){if(!e)return"(unknown)";let t=e.replace(/\/+$/,"").split("/");return t[t.length-1]||e}function h(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return e?e.replace(/-/g,"").slice(0,t):""}let x={mini:"Mini",nano:"Nano",pro:"Pro",turbo:"Turbo",preview:"Preview"};function p(e){if(!e)return"(unknown)";let t=e.replace(/^(vertex_ai|bedrock|anthropic|openai)\//,""),a=t.toLowerCase();if(a.startsWith("gpt-")||/^o\d/.test(a))return a.startsWith("gpt-")?"GPT-"+t.slice(4).split("-").map(e=>{var t;return null!=(t=x[e.toLowerCase()])?t:e}).join(" "):t.toUpperCase();let r=t.replace(/-(\d{8})$/,""),n=(r=r.replace(/^claude-/,"")).split("-");if(n.length>=2){let e=n[0],t=n.slice(1).join(".");return g(e)+" "+t}return g(r.replace(/-/g," "))}function g(e){return e.replace(/\b\w/g,e=>e.toUpperCase())}},38059:(e,t,a)=>{"use strict";a.d(t,{TokenStackChart:()=>x});var r=a(95155),n=a(26991),i=a(94632),c=a(68425),s=a(47734),l=a(73697),o=a(23508),u=a(26736),d=a(25016),m=a(19454);let h={input:"rgb(var(--chart-input))",output:"rgb(var(--chart-output))",cacheRead:"rgb(var(--chart-cache-read))",cacheCreation:"rgb(var(--chart-cache-create))"};function x(e){let{data:t,height:a="h-72"}=e,x=(0,m.kj)(),{locale:f}=(0,m.s9)();return t.length?(0,r.jsxs)("div",{className:"".concat(a," w-full"),children:[(0,r.jsx)(n.u,{width:"100%",height:"100%",children:(0,r.jsxs)(i.E,{data:t,margin:{top:12,right:8,bottom:4,left:8},children:[(0,r.jsx)(c.d,{stroke:"rgb(var(--chart-grid))",strokeDasharray:"3 3",vertical:!1}),(0,r.jsx)(s.W,{dataKey:"label",tick:{fill:"rgb(var(--chart-axis))",fontSize:11},tickLine:!1,axisLine:{stroke:"rgb(var(--chart-grid))"},interval:"preserveStartEnd",minTickGap:32}),(0,r.jsx)(l.h,{tickFormatter:e=>(0,d.jh)(Number(e),f),tick:{fill:"rgb(var(--chart-axis))",fontSize:11},tickLine:!1,axisLine:{stroke:"rgb(var(--chart-grid))"},width:56}),(0,r.jsx)(o.m,{content:(0,r.jsx)(g,{}),cursor:{fill:"rgb(var(--text-primary) / 0.04)"}}),(0,r.jsx)(u.y,{dataKey:"input",stackId:"a",fill:h.input,isAnimationActive:!1}),(0,r.jsx)(u.y,{dataKey:"cacheCreation",stackId:"a",fill:h.cacheCreation,isAnimationActive:!1}),(0,r.jsx)(u.y,{dataKey:"cacheRead",stackId:"a",fill:h.cacheRead,isAnimationActive:!1}),(0,r.jsx)(u.y,{dataKey:"output",stackId:"a",fill:h.output,radius:[3,3,0,0],isAnimationActive:!1})]})}),(0,r.jsxs)("div",{className:"flex items-center flex-wrap justify-center gap-4 text-xs text-text-secondary mt-2",children:[(0,r.jsx)(p,{color:h.input,label:x("chart.legend.input")}),(0,r.jsx)(p,{color:h.cacheCreation,label:x("chart.legend.cacheWrite")}),(0,r.jsx)(p,{color:h.cacheRead,label:x("chart.legend.cacheRead")}),(0,r.jsx)(p,{color:h.output,label:x("chart.legend.output")})]})]}):(0,r.jsx)("div",{className:"".concat(a," flex items-center justify-center text-text-tertiary text-sm"),children:x("chart.empty")})}function p(e){let{color:t,label:a}=e;return(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,r.jsx)("span",{className:"w-2.5 h-2.5 rounded-sm",style:{background:t}}),(0,r.jsx)("span",{children:a})]})}function g(e){let t=(0,m.kj)(),{locale:a}=(0,m.s9)();if(!e.active||!e.payload||!e.payload.length)return null;let n=e.payload[0].payload,i=n.input+n.output+n.cacheRead+n.cacheCreation;return(0,r.jsxs)("div",{className:"card border-border-hi shadow-lg p-3 text-xs min-w-[200px]",children:[(0,r.jsx)("div",{className:"font-medium text-text-primary mb-2",children:e.label}),(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)(f,{color:h.input,label:t("chart.legend.input"),value:n.input,locale:a}),(0,r.jsx)(f,{color:h.cacheCreation,label:t("chart.legend.cacheWrite"),value:n.cacheCreation,locale:a}),(0,r.jsx)(f,{color:h.cacheRead,label:t("chart.legend.cacheRead"),value:n.cacheRead,locale:a}),(0,r.jsx)(f,{color:h.output,label:t("chart.legend.output"),value:n.output,locale:a})]}),(0,r.jsxs)("div",{className:"mt-2 pt-2 border-t border-border flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-text-secondary",children:t("chart.tooltip.total")}),(0,r.jsx)("span",{className:"num-mono text-text-primary",children:(0,d.jh)(i,a)})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between mt-1",children:[(0,r.jsx)("span",{className:"text-text-secondary",children:t("chart.tooltip.cost")}),(0,r.jsx)("span",{className:"num-mono text-brand",children:(0,d.az)(n.cost)})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between mt-1",children:[(0,r.jsx)("span",{className:"text-text-secondary",children:t("chart.tooltip.requests")}),(0,r.jsx)("span",{className:"num-mono text-text-primary",children:n.requests})]})]})}function f(e){let{color:t,label:a,value:n,locale:i}=e;return(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-text-secondary",children:[(0,r.jsx)("span",{className:"w-2 h-2 rounded-sm",style:{background:t}}),a]}),(0,r.jsx)("span",{className:"num-mono text-text-primary",children:(0,d.jh)(n,i)})]})}},62509:(e,t,a)=>{Promise.resolve().then(a.bind(a,38059)),Promise.resolve().then(a.t.bind(a,52619,23))}},e=>{e.O(0,[760,930,619,454,441,255,358],()=>e(e.s=62509)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[801,824],{25016:(e,t,a)=>{"use strict";a.d(t,{BC:()=>h,P6:()=>p,PJ:()=>m,R8:()=>u,az:()=>l,cn:()=>i,jh:()=>s,l7:()=>o,r6:()=>d});var r=a(2821),n=a(75889);function i(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,n.QP)((0,r.$)(t))}function c(e,t){var a;return new Intl.NumberFormat("en-US",{maximumFractionDigits:null!=(a=null==t?void 0:t.maxFrac)?a:0}).format(e)}function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en";return Number.isFinite(e)?"zh"===t?e>=1e8?(e/1e8).toFixed(2)+"亿":e>=1e4?(e/1e4).toFixed(1)+"万":c(e):e>=1e9?(e/1e9).toFixed(2)+"B":e>=1e6?(e/1e6).toFixed(2)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":c(e):"0"}function l(e,t){var a,r;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:null!=(a=null==t?void 0:t.minFrac)?a:2,maximumFractionDigits:null!=(r=null==t?void 0:t.maxFrac)?r:2}).format(e)}function o(e){return 0===e?"$0":e<.01?new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:4,maximumFractionDigits:6}).format(e):l(e)}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Number.isFinite(e)?"".concat((100*e).toFixed(t),"%"):"0%"}function d(e){let t="string"==typeof e||"number"==typeof e?new Date(e):e;if(Number.isNaN(t.getTime()))return"";let a=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),i=String(t.getHours()).padStart(2,"0"),c=String(t.getMinutes()).padStart(2,"0"),s=String(t.getSeconds()).padStart(2,"0");return"".concat(a,"-").concat(r,"-").concat(n," ").concat(i,":").concat(c,":").concat(s)}function m(e){if(!e)return"(unknown)";let t=e.replace(/\/+$/,"").split("/");return t[t.length-1]||e}function h(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return e?e.replace(/-/g,"").slice(0,t):""}let x={mini:"Mini",nano:"Nano",pro:"Pro",turbo:"Turbo",preview:"Preview"};function p(e){if(!e)return"(unknown)";let t=e.replace(/^(vertex_ai|bedrock|anthropic|openai)\//,""),a=t.toLowerCase();if(a.startsWith("gpt-")||/^o\d/.test(a))return a.startsWith("gpt-")?"GPT-"+t.slice(4).split("-").map(e=>{var t;return null!=(t=x[e.toLowerCase()])?t:e}).join(" "):t.toUpperCase();let r=t.replace(/-(\d{8})$/,""),n=(r=r.replace(/^claude-/,"")).split("-");if(n.length>=2){let e=n[0],t=n.slice(1).join(".");return g(e)+" "+t}return g(r.replace(/-/g," "))}function g(e){return e.replace(/\b\w/g,e=>e.toUpperCase())}},38059:(e,t,a)=>{"use strict";a.d(t,{TokenStackChart:()=>x});var r=a(95155),n=a(26991),i=a(94632),c=a(68425),s=a(47734),l=a(73697),o=a(23508),u=a(26736),d=a(25016),m=a(19454);let h={input:"rgb(var(--chart-input))",output:"rgb(var(--chart-output))",cacheRead:"rgb(var(--chart-cache-read))",cacheCreation:"rgb(var(--chart-cache-create))"};function x(e){let{data:t,height:a="h-72"}=e,x=(0,m.kj)(),{locale:f}=(0,m.s9)();return t.length?(0,r.jsxs)("div",{className:"".concat(a," w-full"),children:[(0,r.jsx)(n.u,{width:"100%",height:"100%",children:(0,r.jsxs)(i.E,{data:t,margin:{top:12,right:8,bottom:4,left:8},children:[(0,r.jsx)(c.d,{stroke:"rgb(var(--chart-grid))",strokeDasharray:"3 3",vertical:!1}),(0,r.jsx)(s.W,{dataKey:"label",tick:{fill:"rgb(var(--chart-axis))",fontSize:11},tickLine:!1,axisLine:{stroke:"rgb(var(--chart-grid))"},interval:"preserveStartEnd",minTickGap:32}),(0,r.jsx)(l.h,{tickFormatter:e=>(0,d.jh)(Number(e),f),tick:{fill:"rgb(var(--chart-axis))",fontSize:11},tickLine:!1,axisLine:{stroke:"rgb(var(--chart-grid))"},width:56}),(0,r.jsx)(o.m,{content:(0,r.jsx)(g,{}),cursor:{fill:"rgb(var(--text-primary) / 0.04)"}}),(0,r.jsx)(u.y,{dataKey:"input",stackId:"a",fill:h.input,isAnimationActive:!1}),(0,r.jsx)(u.y,{dataKey:"cacheCreation",stackId:"a",fill:h.cacheCreation,isAnimationActive:!1}),(0,r.jsx)(u.y,{dataKey:"cacheRead",stackId:"a",fill:h.cacheRead,isAnimationActive:!1}),(0,r.jsx)(u.y,{dataKey:"output",stackId:"a",fill:h.output,radius:[3,3,0,0],isAnimationActive:!1})]})}),(0,r.jsxs)("div",{className:"flex items-center flex-wrap justify-center gap-4 text-xs text-text-secondary mt-2",children:[(0,r.jsx)(p,{color:h.input,label:x("chart.legend.input")}),(0,r.jsx)(p,{color:h.cacheCreation,label:x("chart.legend.cacheWrite")}),(0,r.jsx)(p,{color:h.cacheRead,label:x("chart.legend.cacheRead")}),(0,r.jsx)(p,{color:h.output,label:x("chart.legend.output")})]})]}):(0,r.jsx)("div",{className:"".concat(a," flex items-center justify-center text-text-tertiary text-sm"),children:x("chart.empty")})}function p(e){let{color:t,label:a}=e;return(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,r.jsx)("span",{className:"w-2.5 h-2.5 rounded-sm",style:{background:t}}),(0,r.jsx)("span",{children:a})]})}function g(e){let t=(0,m.kj)(),{locale:a}=(0,m.s9)();if(!e.active||!e.payload||!e.payload.length)return null;let n=e.payload[0].payload,i=n.input+n.output+n.cacheRead+n.cacheCreation;return(0,r.jsxs)("div",{className:"card border-border-hi shadow-lg p-3 text-xs min-w-[200px]",children:[(0,r.jsx)("div",{className:"font-medium text-text-primary mb-2",children:e.label}),(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)(f,{color:h.input,label:t("chart.legend.input"),value:n.input,locale:a}),(0,r.jsx)(f,{color:h.cacheCreation,label:t("chart.legend.cacheWrite"),value:n.cacheCreation,locale:a}),(0,r.jsx)(f,{color:h.cacheRead,label:t("chart.legend.cacheRead"),value:n.cacheRead,locale:a}),(0,r.jsx)(f,{color:h.output,label:t("chart.legend.output"),value:n.output,locale:a})]}),(0,r.jsxs)("div",{className:"mt-2 pt-2 border-t border-border flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-text-secondary",children:t("chart.tooltip.total")}),(0,r.jsx)("span",{className:"num-mono text-text-primary",children:(0,d.jh)(i,a)})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between mt-1",children:[(0,r.jsx)("span",{className:"text-text-secondary",children:t("chart.tooltip.cost")}),(0,r.jsx)("span",{className:"num-mono text-brand",children:(0,d.az)(n.cost)})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between mt-1",children:[(0,r.jsx)("span",{className:"text-text-secondary",children:t("chart.tooltip.requests")}),(0,r.jsx)("span",{className:"num-mono text-text-primary",children:n.requests})]})]})}function f(e){let{color:t,label:a,value:n,locale:i}=e;return(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-text-secondary",children:[(0,r.jsx)("span",{className:"w-2 h-2 rounded-sm",style:{background:t}}),a]}),(0,r.jsx)("span",{className:"num-mono text-text-primary",children:(0,d.jh)(n,i)})]})}},62509:(e,t,a)=>{Promise.resolve().then(a.bind(a,38059)),Promise.resolve().then(a.t.bind(a,52619,23))}},e=>{e.O(0,[760,930,619,454,441,255,358],()=>e(e.s=62509)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[662],{8783:(e,t,r)=>{"use strict";r.d(t,{PricingTable:()=>s});var n=r(95155),i=r(12115),a=r(25016),o=r(19454),c=r(20857);function s(e){let{rows:t}=e,r=(0,o.kj)(),[s,d]=(0,i.useState)(""),[u,h]=(0,i.useState)("model"),[m,x]=(0,i.useState)("asc");function g(e){e===u?x("asc"===m?"desc":"asc"):(h(e),x("model"===e?"asc":"desc"))}let p=(0,i.useMemo)(()=>{let e=s.trim().toLowerCase();return e?t.filter(t=>t.model.toLowerCase().includes(e)||(0,a.P6)(t.model).toLowerCase().includes(e)):t},[t,s]),f=(0,i.useMemo)(()=>{let e=[...p];return e.sort((e,t)=>{if("model"===u){let r=e.model.localeCompare(t.model);return"asc"===m?r:-r}let r=e[u],n=t[u];return r===n?0:"asc"===m?r<n?-1:1:r<n?1:-1}),e},[p,u,m]);return(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-3 mb-3 flex-wrap",children:[(0,n.jsx)("input",{value:s,onChange:e=>d(e.target.value),placeholder:r("common.searchPlaceholder"),"aria-label":r("common.searchPlaceholder"),className:"px-3 py-1.5 text-sm rounded-button border border-border bg-bg-surface focus:outline-none focus:border-border-hi w-72 placeholder:text-text-tertiary text-text-primary"}),(0,n.jsx)("span",{className:"text-xs text-text-tertiary tabular-nums",children:r("common.rows",{count:f.length.toLocaleString()})})]}),(0,n.jsx)(c.H,{children:(0,n.jsxs)("table",{className:"w-full text-sm",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{className:"border-b border-border",children:[(0,n.jsx)(l,{sorted:"model"===u,dir:m,onClick:()=>g("model"),children:r("settings.pricing.col.model")}),(0,n.jsx)(l,{align:"right",sorted:"input"===u,dir:m,onClick:()=>g("input"),children:r("settings.pricing.col.input")}),(0,n.jsx)(l,{align:"right",sorted:"output"===u,dir:m,onClick:()=>g("output"),children:r("settings.pricing.col.output")}),(0,n.jsx)(l,{align:"right",sorted:"cacheCreation5m"===u,dir:m,onClick:()=>g("cacheCreation5m"),children:r("settings.pricing.col.write5m")}),(0,n.jsx)(l,{align:"right",sorted:"cacheCreation1h"===u,dir:m,onClick:()=>g("cacheCreation1h"),children:r("settings.pricing.col.write1h")}),(0,n.jsx)(l,{align:"right",sorted:"cacheRead"===u,dir:m,onClick:()=>g("cacheRead"),children:r("settings.pricing.col.read")})]})}),(0,n.jsxs)("tbody",{children:[f.map(e=>(0,n.jsxs)("tr",{className:"border-b border-border last:border-b-0 hover:bg-bg-surface-hi/30",children:[(0,n.jsx)("td",{className:"px-3 py-2 text-text-primary",title:e.model,children:(0,a.P6)(e.model)}),(0,n.jsx)("td",{className:"px-3 py-2 num-mono text-right",children:(0,a.az)(e.input)}),(0,n.jsx)("td",{className:"px-3 py-2 num-mono text-right",children:(0,a.az)(e.output)}),(0,n.jsx)("td",{className:"px-3 py-2 num-mono text-right text-text-secondary",children:(0,a.az)(e.cacheCreation5m)}),(0,n.jsx)("td",{className:"px-3 py-2 num-mono text-right text-text-secondary",children:(0,a.az)(e.cacheCreation1h)}),(0,n.jsx)("td",{className:"px-3 py-2 num-mono text-right text-success",children:(0,a.az)(e.cacheRead)})]},e.model)),0===f.length&&(0,n.jsx)("tr",{children:(0,n.jsx)("td",{colSpan:6,className:"px-3 py-8 text-center text-text-tertiary text-sm",children:r("common.noMatchingRows")})})]})]})})]})}function l(e){let{children:t,align:r="left",sorted:i,dir:o,onClick:c}=e;return(0,n.jsx)("th",{onClick:c,className:(0,a.cn)("px-3 py-2 text-xs font-medium text-text-tertiary uppercase tracking-wide whitespace-nowrap","right"===r?"text-right":"text-left",c&&"cursor-pointer hover:text-text-primary select-none"),children:(0,n.jsxs)("span",{className:"inline-flex items-center gap-1",children:[t,i&&(0,n.jsx)("span",{className:"text-[10px]",children:"asc"===o?"▲":"▼"})]})})}},20857:(e,t,r)=>{"use strict";r.d(t,{H:()=>o});var n=r(95155),i=r(12115),a=r(25016);function o(e){let{children:t,className:r}=e,o=(0,i.useRef)(null),[c,s]=(0,i.useState)(!1),[l,d]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{let e=o.current;if(!e)return;function t(){if(!e)return;let{scrollLeft:t,scrollWidth:r,clientWidth:n}=e;s(t>4),d(t+n<r-4)}t(),e.addEventListener("scroll",t,{passive:!0});let r=new ResizeObserver(t);return r.observe(e),()=>{e.removeEventListener("scroll",t),r.disconnect()}},[]),(0,n.jsxs)("div",{className:(0,a.cn)("relative",r),children:[(0,n.jsx)("div",{ref:o,className:"overflow-x-auto",children:t}),(0,n.jsx)("div",{"aria-hidden":!0,className:(0,a.cn)("pointer-events-none absolute left-0 top-0 bottom-0 w-8 bg-gradient-to-r from-bg-surface to-transparent transition-opacity duration-150",c?"opacity-100":"opacity-0")}),(0,n.jsx)("div",{"aria-hidden":!0,className:(0,a.cn)("pointer-events-none absolute right-0 top-0 bottom-0 w-8 bg-gradient-to-l from-bg-surface to-transparent transition-opacity duration-150",l?"opacity-100":"opacity-0")})]})}},21264:(e,t,r)=>{"use strict";r.d(t,{LanguageSwitcher:()=>s});var n=r(95155),i=r(19454);let a={en:"EN",zh:"中"},o={en:"zh",zh:"en"},c={en:"English",zh:"中文"};function s(){let{locale:e,setLocale:t,t:r}=(0,i.s9)(),s=o[e];return(0,n.jsx)("button",{onClick:()=>t(s),className:"h-7 w-9 inline-flex items-center justify-center rounded-md border border-border bg-bg-surface text-xs font-medium text-text-secondary hover:text-text-primary hover:bg-bg-surface-hi hover:border-border-hi transition-colors",title:"".concat(r("lang.label"),": ").concat(c[e]," → ").concat(c[s]),"aria-label":r("lang.label"),children:a[e]})}},25016:(e,t,r)=>{"use strict";r.d(t,{BC:()=>m,P6:()=>g,PJ:()=>h,R8:()=>d,az:()=>s,cn:()=>a,jh:()=>c,l7:()=>l,r6:()=>u});var n=r(2821),i=r(75889);function a(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,i.QP)((0,n.$)(t))}function o(e,t){var r;return new Intl.NumberFormat("en-US",{maximumFractionDigits:null!=(r=null==t?void 0:t.maxFrac)?r:0}).format(e)}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en";return Number.isFinite(e)?"zh"===t?e>=1e8?(e/1e8).toFixed(2)+"亿":e>=1e4?(e/1e4).toFixed(1)+"万":o(e):e>=1e9?(e/1e9).toFixed(2)+"B":e>=1e6?(e/1e6).toFixed(2)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":o(e):"0"}function s(e,t){var r,n;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:null!=(r=null==t?void 0:t.minFrac)?r:2,maximumFractionDigits:null!=(n=null==t?void 0:t.maxFrac)?n:2}).format(e)}function l(e){return 0===e?"$0":e<.01?new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:4,maximumFractionDigits:6}).format(e):s(e)}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Number.isFinite(e)?"".concat((100*e).toFixed(t),"%"):"0%"}function u(e){let t="string"==typeof e||"number"==typeof e?new Date(e):e;if(Number.isNaN(t.getTime()))return"";let r=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0"),a=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0"),c=String(t.getSeconds()).padStart(2,"0");return"".concat(r,"-").concat(n,"-").concat(i," ").concat(a,":").concat(o,":").concat(c)}function h(e){if(!e)return"(unknown)";let t=e.replace(/\/+$/,"").split("/");return t[t.length-1]||e}function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return e?e.replace(/-/g,"").slice(0,t):""}let x={mini:"Mini",nano:"Nano",pro:"Pro",turbo:"Turbo",preview:"Preview"};function g(e){if(!e)return"(unknown)";let t=e.replace(/^(vertex_ai|bedrock|anthropic|openai)\//,""),r=t.toLowerCase();if(r.startsWith("gpt-")||/^o\d/.test(r))return r.startsWith("gpt-")?"GPT-"+t.slice(4).split("-").map(e=>{var t;return null!=(t=x[e.toLowerCase()])?t:e}).join(" "):t.toUpperCase();let n=t.replace(/-(\d{8})$/,""),i=(n=n.replace(/^claude-/,"")).split("-");if(i.length>=2){let e=i[0],t=i.slice(1).join(".");return p(e)+" "+t}return p(n.replace(/-/g," "))}function p(e){return e.replace(/\b\w/g,e=>e.toUpperCase())}},42361:(e,t,r)=>{Promise.resolve().then(r.bind(r,21264)),Promise.resolve().then(r.bind(r,8783)),Promise.resolve().then(r.bind(r,91107)),Promise.resolve().then(r.bind(r,44703))},44703:(e,t,r)=>{"use strict";r.d(t,{ThemeSwitcher:()=>c});var n=r(95155),i=r(84479),a=r(19454);let o={light:"dark",dark:"system",system:"light"};function c(){let{theme:e,resolved:t,setTheme:r}=(0,i.D)(),{t:c}=(0,a.s9)(),l=o[e];return(0,n.jsx)("button",{onClick:()=>r(l),className:"h-7 w-9 inline-flex items-center justify-center rounded-md border border-border bg-bg-surface text-text-secondary hover:text-text-primary hover:bg-bg-surface-hi hover:border-border-hi transition-colors",title:"".concat(c("theme.label"),": ").concat(c("settings.theme.".concat(e))," (").concat(t,") → ").concat(c("settings.theme.".concat(l))),"aria-label":c("theme.label"),children:(0,n.jsx)(s,{theme:e})})}function s(e){let{theme:t}=e;return"light"===t?(0,n.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,n.jsx)("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"})]}):"dark"===t?(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:(0,n.jsx)("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}):(0,n.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,n.jsx)("path",{d:"M12 3v18"}),(0,n.jsx)("path",{d:"M12 3a9 9 0 0 1 0 18z",fill:"currentColor",stroke:"none"})]})}},84479:(e,t,r)=>{"use strict";r.d(t,{N:()=>d,D:()=>u});var n=r(95155),i=r(12115);let a="ccgauge_theme",o=(0,i.createContext)({theme:"system",resolved:"dark",setTheme:()=>{}}),c="ccgauge.theme";function s(e){return"light"===e?"light":"dark"===e?"dark":window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"}function l(e){if("undefined"==typeof document)return;let t=document.documentElement,r=s(e);t.classList.remove("theme-light","theme-dark"),t.classList.add("light"===r?"theme-light":"theme-dark"),t.setAttribute("data-theme",r)}function d(e){let{initialTheme:t,children:r}=e,[d,u]=(0,i.useState)(t),[h,m]=(0,i.useState)(()=>"system"===t?"dark":t);(0,i.useEffect)(()=>{try{let e=localStorage.getItem(c);if("light"===e||"dark"===e||"system"===e){e!==t&&(document.cookie="".concat(a,"=").concat(e,"; path=/; max-age=").concat(31536e3,"; SameSite=Lax")),u(e);let r=s(e);m(r),l(e)}else{let e=s(t);m(e),l(t)}}catch(e){m(s(t)),l(t)}},[]),(0,i.useEffect)(()=>{if("system"!==d)return;let e=window.matchMedia("(prefers-color-scheme: light)"),t=()=>{m(e.matches?"light":"dark"),l("system")};return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[d]);let x=(0,i.useCallback)(e=>{try{localStorage.setItem(c,e)}catch(e){}document.cookie="".concat(a,"=").concat(e,"; path=/; max-age=").concat(31536e3,"; SameSite=Lax"),u(e),m(s(e)),l(e)},[]);return(0,n.jsx)(o.Provider,{value:{theme:d,resolved:h,setTheme:x},children:r})}function u(){return(0,i.useContext)(o)}},91107:(e,t,r)=>{"use strict";r.d(t,{ScanRefresh:()=>c});var n=r(95155),i=r(12115),a=r(20063),o=r(19454);function c(){let e=(0,o.kj)(),[t,r]=(0,i.useState)(!1),c=(0,a.useRouter)();async function s(){r(!0);try{await fetch("/api/scan",{method:"POST",cache:"no-store"}),c.refresh()}finally{r(!1)}}return(0,n.jsx)("button",{onClick:s,disabled:t,className:"btn",children:e(t?"settings.rescanning":"settings.rescan")})}}},e=>{e.O(0,[760,454,441,255,358],()=>e(e.s=42361)),_N_E=e.O()}]);
|