tokentracker-cli 0.87.0 → 0.87.2
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/dashboard/dist/assets/{AchievementBadge-CU9m5POo.js → AchievementBadge-C468-Rsw.js} +1 -1
- package/dashboard/dist/assets/{AchievementsPage-ESzayVR5.js → AchievementsPage-CZWzSdiH.js} +2 -2
- package/dashboard/dist/assets/{AchievementsSection-DUVRqw19.js → AchievementsSection-DXt6VbwH.js} +1 -1
- package/dashboard/dist/assets/{BadgeDetailModal-CxNQcN6_.js → BadgeDetailModal-BtGvpqQm.js} +1 -1
- package/dashboard/dist/assets/{Card-DXIoSOtO.js → Card-DZ-_fXkw.js} +1 -1
- package/dashboard/dist/assets/{ClawdAnimated-BsuxMkNd.js → ClawdAnimated-9rXaHo1-.js} +1 -1
- package/dashboard/dist/assets/{CommandPalette-C-amBp21.js → CommandPalette-sqIvZNsH.js} +1 -1
- package/dashboard/dist/assets/{CommunityStatsModal-ByFOQube.js → CommunityStatsModal-c8VohIqQ.js} +1 -1
- package/dashboard/dist/assets/{ConfirmModal-BnUyidbn.js → ConfirmModal-Ct2HLdds.js} +1 -1
- package/dashboard/dist/assets/Controls-DPtXGUGi.js +1 -0
- package/dashboard/dist/assets/DashboardPage-C65hbl8o.js +1 -0
- package/dashboard/dist/assets/{DevicePage-B_o-jhku.js → DevicePage-Ds4GEuqY.js} +1 -1
- package/dashboard/dist/assets/{DialogClose-BSd7Jiag.js → DialogClose-B2IAbJG4.js} +1 -1
- package/dashboard/dist/assets/DialogDescription-DeRza-LI.js +1 -0
- package/dashboard/dist/assets/{DialogTitle-XBpneDtQ.js → DialogTitle-BIwLH6gA.js} +1 -1
- package/dashboard/dist/assets/{FadeIn-Dg0v4V9p.js → FadeIn-DPS7_DOB.js} +1 -1
- package/dashboard/dist/assets/{HeaderGithubStar-BIsQD1OK.js → HeaderGithubStar-CsSgr9Hd.js} +1 -1
- package/dashboard/dist/assets/{HoverTooltip-CtmRa8ne.js → HoverTooltip-CLGZW2d-.js} +1 -1
- package/dashboard/dist/assets/{IpCheckPage-BUoLz5sL.js → IpCheckPage-DEM_uk69.js} +1 -1
- package/dashboard/dist/assets/{LandingPage-BheA-lw8.js → LandingPage-BQ3YzZ68.js} +2 -2
- package/dashboard/dist/assets/{LeaderboardAvatar-DAy9SOdL.js → LeaderboardAvatar-ySznr4Ml.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardPage-CwLqtEUN.js → LeaderboardPage-Br4JCoVE.js} +2 -2
- package/dashboard/dist/assets/{LeaderboardProfileModal-BZ9yGyjB.js → LeaderboardProfileModal-Drvsb5xF.js} +3 -3
- package/dashboard/dist/assets/{LeaderboardProfilePage-Cs-LTfvS.js → LeaderboardProfilePage-BD0P-zZF.js} +1 -1
- package/dashboard/dist/assets/{LimitsPage-BQle8e8N.js → LimitsPage-Mbn2mj6S.js} +1 -1
- package/dashboard/dist/assets/{LocalOnlyNotice-Bp4CqObQ.js → LocalOnlyNotice-BsKgtoVa.js} +1 -1
- package/dashboard/dist/assets/{LoginCard-BIXfWkR2.js → LoginCard-CTQDdHcx.js} +1 -1
- package/dashboard/dist/assets/{LoginModal-B-ubPXdr.js → LoginModal-BxCyLDEW.js} +1 -1
- package/dashboard/dist/assets/{LoginPage-9arjWT-s.js → LoginPage-ftxnX8g1.js} +1 -1
- package/dashboard/dist/assets/PetPage-CQsfqsm8.js +1 -0
- package/dashboard/dist/assets/{PopoverPopup-DMg7XE1h.js → PopoverPopup-C16r8jQC.js} +1 -1
- package/dashboard/dist/assets/{ProviderIcon-BG3oqeST.js → ProviderIcon-7Tkq9_m6.js} +1 -1
- package/dashboard/dist/assets/{ResetPasswordPage-LQ9rfcRE.js → ResetPasswordPage-D-MPpQd1.js} +1 -1
- package/dashboard/dist/assets/{SegmentedControl-GY2tRk1u.js → SegmentedControl-CYFrzu9w.js} +1 -1
- package/dashboard/dist/assets/{Select-CCngFwmz.js → Select-Dp4V9p6t.js} +1 -1
- package/dashboard/dist/assets/{SelectItemText-B9Zm8WTR.js → SelectItemText-CxhBeoxx.js} +1 -1
- package/dashboard/dist/assets/{ServiceStatusPage-BxPvk1-W.js → ServiceStatusPage-BT6hvvLW.js} +1 -1
- package/dashboard/dist/assets/{SessionsPage-DGo6yAwP.js → SessionsPage-BopeZBiH.js} +1 -1
- package/dashboard/dist/assets/SettingsPage-D03GJJBd.js +1 -0
- package/dashboard/dist/assets/{SkillsPage-D0PB3WR5.js → SkillsPage-Cr8O6eOH.js} +1 -1
- package/dashboard/dist/assets/{TokenGalaxy-Chh_fPIv.js → TokenGalaxy-BoUsrUEs.js} +1 -1
- package/dashboard/dist/assets/{ToolbarRootContext-BXacVvrF.js → ToolbarRootContext-CwRaHhMN.js} +1 -1
- package/dashboard/dist/assets/{TrendMonitor-CjiCwNmO.js → TrendMonitor-BV2ugEsw.js} +1 -1
- package/dashboard/dist/assets/WidgetsPage-B7r4mvrw.js +1 -0
- package/dashboard/dist/assets/{WrappedPage-CEpBAMZR.js → WrappedPage-CFU9l22i.js} +1 -1
- package/dashboard/dist/assets/__vite-browser-external-CzQk3FUc.css +1 -0
- package/dashboard/dist/assets/{__vite-browser-external-Dyag-P6u.js → __vite-browser-external-Db9onipF.js} +10 -3
- package/dashboard/dist/assets/{agent-logos-CLQGE0AM.js → agent-logos-DSSn_SPi.js} +1 -1
- package/dashboard/dist/assets/{arrow-up-right-CU2HDjoG.js → arrow-up-right-COvrArNz.js} +1 -1
- package/dashboard/dist/assets/{check-CucGM5lh.js → check-CasSqiev.js} +1 -1
- package/dashboard/dist/assets/{chevron-right-DYzUvcID.js → chevron-right-B1PMeNoD.js} +1 -1
- package/dashboard/dist/assets/{copy-BFeQ31Tr.js → copy-D67vycfp.js} +1 -1
- package/dashboard/dist/assets/{download-Coq_llCX.js → download-adOCFO2v.js} +1 -1
- package/dashboard/dist/assets/{external-link-BJiDBW3d.js → external-link-DVanKEuy.js} +1 -1
- package/dashboard/dist/assets/{flame-5stsnhc0.js → flame-RbiHZM9b.js} +1 -1
- package/dashboard/dist/assets/{format-tokens-CpTJbo-2.js → format-tokens-DhMp1e1L.js} +1 -1
- package/dashboard/dist/assets/{icons-jsuvmnnO.js → icons-BC0p_aGr.js} +1 -1
- package/dashboard/dist/assets/{index-DSD3RLQ4.js → index-A41xjc83.js} +1 -1
- package/dashboard/dist/assets/{index-BU6GsTbx.js → index-CaRyTJ6K.js} +1 -1
- package/dashboard/dist/assets/{index-Bs97feNM.js → index-DrgBqR3o.js} +1 -1
- package/dashboard/dist/assets/{info-DNNUzeV_.js → info-D9LwqlnC.js} +1 -1
- package/dashboard/dist/assets/{limits-providers-DKTqNO55.js → limits-providers-CRHpXhmW.js} +1 -1
- package/dashboard/dist/assets/{link-2-DC1hnQcE.js → link-2-B5f4qFR0.js} +1 -1
- package/dashboard/dist/assets/{loader-circle-DtInM4Io.js → loader-circle-DCmwZEdS.js} +1 -1
- package/dashboard/dist/assets/{maximize-2-DxpsaYXp.js → maximize-2-BMalEDCZ.js} +1 -1
- package/dashboard/dist/assets/{provider-display-hkyvfEJF.js → provider-display-qMFRUZHm.js} +1 -1
- package/dashboard/dist/assets/{react-TbJoDSP4.js → react-BnaPNGj8.js} +1 -1
- package/dashboard/dist/assets/{search-C7bnqB9b.js → search-BrqBkLs2.js} +1 -1
- package/dashboard/dist/assets/{skills-api-D7glOWg7.js → skills-api-vo3iM6yD.js} +1 -1
- package/dashboard/dist/assets/{store-CCVlzuqv.js → store-BwMVXuz3.js} +1 -1
- package/dashboard/dist/assets/{terminal-uQlsmzGi.js → terminal-BiyUh_8k.js} +1 -1
- package/dashboard/dist/assets/{trash-2-B1yuX-oD.js → trash-2-DAr4sqkX.js} +1 -1
- package/dashboard/dist/assets/{use-community-stats-0Fs5nY1G.js → use-community-stats-Cg48Zphy.js} +1 -1
- package/dashboard/dist/assets/{use-limits-display-prefs-CrftAn62.js → use-limits-display-prefs-DfKtH1Zn.js} +1 -1
- package/dashboard/dist/assets/{use-ordered-list-DAdPjLb5.js → use-ordered-list-CnXfrWeF.js} +1 -1
- package/dashboard/dist/assets/use-reduced-motion-BIgYrbON.js +1 -0
- package/dashboard/dist/assets/{use-session-efficiency-pref-Cc52HiK0.js → use-session-efficiency-pref-CMDTCAAd.js} +1 -1
- package/dashboard/dist/assets/{use-transform-D76wHhX0.js → use-transform-B2d9Txt5.js} +1 -1
- package/dashboard/dist/assets/{use-usage-limits-B7Prb8rk.js → use-usage-limits-CJbTUl9W.js} +1 -1
- package/dashboard/dist/assets/{useCurrency-DWoM_A3s.js → useCurrency-B0hJte5f.js} +1 -1
- package/dashboard/dist/assets/{useScrollLock-Bp6ddiQo.js → useScrollLock-DuosKdSB.js} +1 -1
- package/dashboard/dist/assets/{useTokenFormat-DZOYz5HT.js → useTokenFormat-DB8pKLFM.js} +1 -1
- package/dashboard/dist/assets/{zap-DyeAeO8l.js → zap-rbzC4XgP.js} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/dashboard/dist/ip-check.html +2 -2
- package/dashboard/dist/leaderboard.html +2 -2
- package/dashboard/dist/share.html +2 -2
- package/package.json +1 -1
- package/src/commands/device-login.js +12 -7
- package/src/commands/init.js +3 -0
- package/src/commands/sync.js +115 -20
- package/src/lib/grok-context-breakdown.js +124 -19
- package/src/lib/grok-limits.js +374 -9
- package/src/lib/pricing/seed-snapshot.json +1 -1
- package/src/lib/runtime-config.js +23 -3
- package/dashboard/dist/assets/DashboardPage-GyXkKYW0.js +0 -1
- package/dashboard/dist/assets/DialogDescription-BFBVGbUT.js +0 -1
- package/dashboard/dist/assets/PetPage-BzAVsvh6.js +0 -1
- package/dashboard/dist/assets/SettingsPage-ConPEiwO.js +0 -1
- package/dashboard/dist/assets/WidgetsPage-CBw9uBCO.js +0 -1
- package/dashboard/dist/assets/__vite-browser-external-hXV_ZYTG.css +0 -1
- package/dashboard/dist/assets/use-native-settings-CVqB9eoO.js +0 -1
- package/dashboard/dist/assets/use-reduced-motion-DVGYs3-k.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,c as a,N as R,O as E,r as b,q as O,d as $,e as W}from"./__vite-browser-external-Db9onipF.js";import{S as F}from"./Select-Dp4V9p6t.js";import{u as K,T as D}from"./Controls-DPtXGUGi.js";import{F as N,S as G,a as z}from"./FadeIn-DPS7_DOB.js";import{A as H}from"./arrow-up-right-COvrArNz.js";import{D as U}from"./download-adOCFO2v.js";import"./ToolbarRootContext-CwRaHhMN.js";import"./useScrollLock-DuosKdSB.js";import"./check-CasSqiev.js";import"./SelectItemText-CxhBeoxx.js";import"./Card-DZ-_fXkw.js";import"./react-BnaPNGj8.js";import"./use-reduced-motion-BIgYrbON.js";const V=["todayTokens","todayCost"],x="none",T=[{id:"todayTokens",label:"Today Tokens",shortLabel:"Tokens",category:"tokens"},{id:"todayCost",label:"Today Cost",shortLabel:"Cost",category:"cost"},{id:"last7dTokens",label:"Last 7 Days",shortLabel:"7d",category:"tokens"},{id:"totalTokens",label:"Total Tokens",shortLabel:"Total",category:"tokens"},{id:"totalCost",label:"Total Cost",shortLabel:"All $",category:"cost"},{id:"claude5h",label:"Claude 5h Limit",shortLabel:"Cl 5h",category:"limits"},{id:"claude7d",label:"Claude 7d Limit",shortLabel:"Cl 7d",category:"limits"},{id:"codex5h",label:"Codex 5h Limit",shortLabel:"Cx 5h",category:"limits"},{id:"codex7d",label:"Codex 7d Limit",shortLabel:"Cx 7d",category:"limits"},{id:"codexCredits",label:"Codex Credit Limit",shortLabel:"Cx Cred",category:"limits"},{id:"codexSpark5h",label:"Codex Spark 5h Limit",shortLabel:"Cx Spark 5h",category:"limits"},{id:"codexSpark7d",label:"Codex Spark 7d Limit",shortLabel:"Cx Spark 7d",category:"limits"},{id:"cursorPlan",label:"Cursor Plan Limit",shortLabel:"Cu Plan",category:"limits"},{id:"cursorAuto",label:"Cursor Auto Limit",shortLabel:"Cu Auto",category:"limits"},{id:"cursorAPI",label:"Cursor API Limit",shortLabel:"Cu API",category:"limits"},{id:"geminiPro",label:"Gemini Pro Limit",shortLabel:"Gm Pro",category:"limits"},{id:"geminiFlash",label:"Gemini Flash Limit",shortLabel:"Gm Flash",category:"limits"},{id:"geminiLite",label:"Gemini Lite Limit",shortLabel:"Gm Lite",category:"limits"},{id:"kimiWeekly",label:"Kimi Weekly Limit",shortLabel:"Km Wk",category:"limits"},{id:"kimi5h",label:"Kimi 5h Limit",shortLabel:"Km 5h",category:"limits"},{id:"kimiTotal",label:"Kimi Total Limit",shortLabel:"Km Tot",category:"limits"},{id:"kiroMonth",label:"Kiro Monthly Limit",shortLabel:"Kr Mo",category:"limits"},{id:"kiroBonus",label:"Kiro Bonus Limit",shortLabel:"Kr Bn",category:"limits"},{id:"copilotPremium",label:"Copilot Premium Limit",shortLabel:"Co Prem",category:"limits"},{id:"copilotChat",label:"Copilot Chat Limit",shortLabel:"Co Chat",category:"limits"},{id:"antigravityClaudeWeekly",label:"Antigravity Claude 7d Limit",shortLabel:"Ag Cl 7d",category:"limits"},{id:"antigravityClaude5h",label:"Antigravity Claude 5h Limit",shortLabel:"Ag Cl 5h",category:"limits"},{id:"antigravityGeminiWeekly",label:"Antigravity Gemini 7d Limit",shortLabel:"Ag Gm 7d",category:"limits"},{id:"antigravityGemini5h",label:"Antigravity Gemini 5h Limit",shortLabel:"Ag Gm 5h",category:"limits"}];function S(t,i=T,r=2){const s=new Set(i.map(n=>n.id)),o=new Set,l=Array.isArray(t)?t.filter(n=>n===x?!0:!s.has(n)||o.has(n)?!1:(o.add(n),!0)):[];return(l.length>0?l:V).slice(0,Math.max(1,Number(r)||2))}const X=264,Y=124,g="ui-rounded, -apple-system, system-ui",C=["#5A8CF2","#9973E6","#4DB8A6","#E68C59"],q={claude:"#C77DFF",codex:"#34C759",cursor:"#FFCC00",gemini:"#0A84FF"};function Z(t){return t>=.9?"#E64D4D":t>=.7?"#D9A633":"#33B866"}function y({size:t="sm",children:i}){const r=t==="lg",s=r?560:264,o=r?32:22;return e.jsx("div",{className:W("flex w-full items-center justify-center rounded-xl bg-oai-gray-100 dark:bg-oai-gray-950/60",r?"py-10 sm:py-14 px-6":"py-6 px-4"),children:e.jsx("div",{className:"overflow-hidden bg-white dark:bg-oai-gray-800 shadow-oai-md dark:shadow-[0_2px_4px_rgba(0,0,0,0.4),0_8px_24px_rgba(0,0,0,0.5)]",style:{width:"100%",maxWidth:s,aspectRatio:`${X} / ${Y}`,borderRadius:o},children:i})})}function J({size:t="sm"}){const i="M0,104 L14,104 C26,98 34,100 44,96 S58,88 68,92 80,100 90,94 102,80 112,82 126,92 136,88 150,74 162,76 178,88 188,86 204,72 216,74 236,84 250,80 L264,80",r=`${i} L264,124 L0,124 Z`,s=`sparkArea-${t}`;return e.jsx(y,{size:t,children:e.jsxs("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:s,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"#0A84FF",stopOpacity:"0.18"}),e.jsx("stop",{offset:"100%",stopColor:"#0A84FF",stopOpacity:"0"})]})}),e.jsx("text",{x:"14",y:"20",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"700",letterSpacing:"0.6",children:a("widgets.preview.today")}),e.jsx("text",{x:"14",y:"46",className:"fill-oai-black dark:fill-white",fontSize:"22",fontWeight:"700",fontFamily:g,children:"203.2M"}),e.jsx("text",{x:"14",y:"60",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"500",fontFamily:g,children:"$129.56 ±0%"}),e.jsx("text",{x:"134",y:"20",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"700",letterSpacing:"0.6",children:a("widgets.preview.seven_days")}),e.jsx("text",{x:"134",y:"46",className:"fill-oai-black dark:fill-white",fontSize:"22",fontWeight:"700",fontFamily:g,children:"880.9M"}),e.jsx("text",{x:"134",y:"60",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"500",fontFamily:g,children:"$673.61"}),e.jsx("path",{d:r,fill:`url(#${s})`,stroke:"none"}),e.jsx("path",{d:i,fill:"none",stroke:"#0A84FF",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})})}const _=(()=>{const r=[];for(let s=0;s<26;s++)for(let o=0;o<7;o++){const l=Math.sin((s+1)*12.9898+(o+1)*78.233+17)*43758.5453,c=Math.floor(Math.abs(l-Math.floor(l))*100);r.push({w:s,d:o,v:c})}return r})();function A(t,i){return t<18?i?"#262626":"#e5e5e5":t<38?"rgba(10, 132, 255, 0.28)":t<58?"rgba(10, 132, 255, 0.50)":t<80?"rgba(10, 132, 255, 0.75)":"#0A84FF"}function Q(){return e.jsx(y,{children:e.jsxs("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:[e.jsx("g",{transform:`translate(${19.5}, 10)`,className:"hidden dark:inline",children:_.map(l=>e.jsx("rect",{x:l.w*(7.5+1.2),y:l.d*(8+1.2),width:7.5,height:8,rx:"1.3",fill:A(l.v,!0)},`d-${l.w}-${l.d}`))}),e.jsx("g",{transform:`translate(${19.5}, 10)`,className:"dark:hidden",children:_.map(l=>e.jsx("rect",{x:l.w*(7.5+1.2),y:l.d*(8+1.2),width:7.5,height:8,rx:"1.3",fill:A(l.v,!1)},`l-${l.w}-${l.d}`))}),e.jsx("text",{x:19.5,y:"102",className:"fill-oai-black dark:fill-white",fontSize:"10",fontWeight:"700",fontFamily:g,children:"10.3B"}),e.jsx("text",{x:19.5+30,y:"102",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"9",fontWeight:"500",children:a("widgets.preview.heatmap_summary",{days:202})})]})})}function ee(){const t=[{name:"claude-opus-4-6",value:"586.4M",pct:59},{name:"claude-sonnet-4-5-20250929",value:"218.7M",pct:22},{name:"gpt-5.4",value:"80.6M",pct:8},{name:"composer-2-fast",value:"52.1M",pct:5}],i=22,r=28,s=14,o=236;return e.jsx(y,{children:e.jsx("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:t.map((l,c)=>{const n=r+c*i,h=C[c%C.length];return e.jsxs("g",{children:[e.jsx("circle",{cx:"18",cy:n-3,r:"2.5",fill:h}),e.jsx("text",{x:"26",y:n,className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"500",children:l.name}),e.jsx("text",{x:"218",y:n,textAnchor:"end",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"9",fontWeight:"600",fontFamily:g,children:l.value}),e.jsxs("text",{x:"250",y:n,textAnchor:"end",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"600",fontFamily:g,children:[l.pct,"%"]}),e.jsx("rect",{x:s,y:n+4,width:o,height:"2.8",rx:"1.4",className:"fill-oai-gray-200 dark:fill-oai-gray-700"}),e.jsx("rect",{x:s,y:n+4,width:Math.max(o*(l.pct/100),4),height:"2.8",rx:"1.4",fill:h})]},l.name)})})})}function te(){const t=[{label:`${a("limits.provider.claude")} · ${a("limits.label.claude_7d")}`,source:"claude",reset:a("widgets.preview.reset_days",{days:1}),pct:61},{label:`${a("limits.provider.claude")} · ${a("limits.label.claude_5h")}`,source:"claude",reset:a("widgets.preview.reset_hours_minutes",{hours:4,minutes:28}),pct:4},{label:a("limits.provider.cursor"),source:"cursor",reset:a("widgets.preview.reset_days",{days:25}),pct:51},{label:`${a("limits.provider.codex")} · ${a("limits.label.codex_7d")}`,source:"codex",reset:a("widgets.preview.reset_days",{days:1}),pct:32}],i=22,r=28,s=14,o=236;return e.jsx(y,{children:e.jsx("svg",{viewBox:"0 0 264 124",className:"h-full w-full","aria-hidden":"true",children:t.map((l,c)=>{const n=r+c*i,h=q[l.source],p=Z(l.pct/100);return e.jsxs("g",{children:[e.jsx("circle",{cx:"18",cy:n-3,r:"2.5",fill:h}),e.jsx("text",{x:"26",y:n,className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"500",children:l.label}),e.jsx("text",{x:"218",y:n,textAnchor:"end",className:"fill-oai-gray-500 dark:fill-oai-gray-400",fontSize:"8",fontWeight:"500",fontFamily:g,children:l.reset}),e.jsxs("text",{x:"250",y:n,textAnchor:"end",className:"fill-oai-black dark:fill-white",fontSize:"9",fontWeight:"700",fontFamily:g,children:[l.pct,"%"]}),e.jsx("rect",{x:s,y:n+4,width:o,height:"2.8",rx:"1.4",className:"fill-oai-gray-200 dark:fill-oai-gray-700"}),e.jsx("rect",{x:s,y:n+4,width:Math.max(o*(l.pct/100),4),height:"2.8",rx:"1.4",fill:p})]},l.label)})})})}function ae(t){switch(t.category){case"none":return"";case"cost":return"$8.42";case"limits":return"62%";default:return t.id==="last7dTokens"?"1.8B":"203M"}}function ie(t,i){switch(t){case x:return a("menubar.metric.none");case"todayTokens":return a("menubar.metric.today_tokens");case"todayCost":return a("menubar.metric.today_cost");case"last7dTokens":return a("menubar.metric.last_7d_tokens");case"totalTokens":return a("menubar.metric.total_tokens");case"totalCost":return a("menubar.metric.total_cost");case"claude5h":return a("menubar.metric.claude_5h");case"claude7d":return a("menubar.metric.claude_7d");case"codex5h":return a("menubar.metric.codex_5h");case"codex7d":return a("menubar.metric.codex_7d");case"codexCredits":return a("menubar.metric.codex_credits");case"codexSpark5h":return a("menubar.metric.codex_spark_5h");case"codexSpark7d":return a("menubar.metric.codex_spark_7d");default:return i}}function se(t,i){const r=new Set(i.map(o=>o.id)),s=t.filter(o=>o===x||r.has(o));for(const o of i){if(s.length>=2)break;o.id!==x&&(s.includes(o.id)||s.push(o.id))}return s.slice(0,2)}function re({slotConfigs:t,showStats:i}){return e.jsx("div",{className:"flex justify-center rounded-xl bg-gradient-to-b from-oai-gray-100 to-oai-gray-200 px-6 py-8 dark:from-oai-gray-950/80 dark:to-oai-gray-900/80",children:e.jsxs("div",{className:"inline-flex items-stretch rounded-md shadow-[0_1px_3px_rgba(0,0,0,0.18)] ring-1 ring-black/10 dark:ring-white/10 px-3",style:{background:"linear-gradient(180deg, #2c2c2e 0%, #1c1c1e 100%)"},children:[e.jsx("div",{className:"flex items-center pl-2 pr-1 py-2.5",children:e.jsx("img",{src:"/clawd/mini/idle-tight.svg",alt:"","aria-hidden":"true",className:"block shrink-0",style:{height:22,width:"auto"},draggable:"false"})}),i?t.filter(({item:r})=>r?.category!=="none").map(({slot:r,item:s},o)=>e.jsxs($.Fragment,{children:[o>0?e.jsx("span",{className:"my-1 w-px bg-white/20","aria-hidden":"true"}):null,e.jsxs("div",{className:W("flex min-w-[52px] flex-col items-center justify-center py-1.5",o===0?"pl-1 pr-2":"px-2"),children:[e.jsx("span",{className:"text-[13px] font-semibold leading-none tabular-nums text-white",children:s?.previewValue||"--"}),e.jsx("span",{className:"mt-[2px] text-[6px] font-semibold uppercase leading-none text-white/75",children:s?.shortLabel||a("widgets.preview.metric")})]})]},r)):null]})})}function le({slot:t,value:i,options:r,disabled:s,onChange:o}){const l=t===0?a("menubar.slot.primary"):a("menubar.slot.secondary");return e.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[e.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-[0.08em] text-oai-gray-500 dark:text-oai-gray-400",children:l}),e.jsx(F,{value:i,disabled:s,ariaLabel:l,onValueChange:c=>o(t,c),options:r.map(c=>({value:c.id,label:c.displayLabel})),matchTriggerWidth:!0,className:"w-full px-3 py-2 text-sm font-medium"})]})}function w({label:t,hint:i,checked:r,disabled:s,onChange:o}){return e.jsxs("div",{className:"flex items-center justify-between gap-3 py-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-oai-black dark:text-white",children:t}),i?e.jsx("p",{className:"mt-0.5 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:i}):null]}),e.jsx(D,{checked:r,disabled:s,onChange:o,ariaLabel:t})]})}function oe({label:t,hint:i,value:r,options:s,disabled:o,onChange:l}){return e.jsxs("div",{className:"flex items-center justify-between gap-3 py-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-oai-black dark:text-white",children:t}),i?e.jsx("p",{className:"mt-0.5 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:i}):null]}),e.jsx(F,{value:r,disabled:o,ariaLabel:t,onValueChange:l,options:s,className:"shrink-0 px-3 py-2 text-sm font-medium"})]})}function ne(){const{available:t,settings:i,setSetting:r}=K(),s=b.useMemo(()=>(Array.isArray(i?.menuBarAvailableItems)?i.menuBarAvailableItems:T).map(m=>({...m,displayLabel:ie(m.id,m.label),previewValue:ae(m)})),[i?.menuBarAvailableItems]),o=Number(i?.menuBarMaxItems)||2,l=b.useMemo(()=>S(i?.menuBarItems,s,o),[s,o,i?.menuBarItems]),c=b.useMemo(()=>se(l,s),[s,l]),n=i?.showStats!==!1,h=d=>{r("menuBarItems",S(d,s,o))},p=(d,m)=>{const u=[...c];m!==x&&u[d===0?1:0]===m||(u[d]=m,h(u))},k=[0,1].map(d=>{const m=c[d]||s[d]?.id||"",L=c[d===0?1:0],I=s.filter(f=>f.id===x||f.id===m||f.id!==L),P=s.find(f=>f.id===m);return{slot:d,currentValue:m,options:I,item:P}}),B=["clawd","cat","pet","static"].includes(i?.menuBarIconStyle)?i.menuBarIconStyle:"clawd",j=i?.toastOnReset!==!1,v=i?.confettiOnReset!==!1;return e.jsxs("article",{className:"rounded-xl border border-oai-gray-200 bg-white p-5 transition-colors duration-200 dark:border-oai-gray-800 dark:bg-oai-gray-900 sm:p-6",children:[e.jsx(re,{slotConfigs:k,showStats:n}),e.jsx("div",{className:"mt-5 grid grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-4",children:k.map(({slot:d,currentValue:m,options:u})=>e.jsx(le,{slot:d,value:m,options:u,disabled:!t||!n,onChange:p},d))}),e.jsxs("div",{className:"mt-5 divide-y divide-oai-gray-100 border-t border-oai-gray-100 dark:divide-oai-gray-800 dark:border-oai-gray-800",children:[e.jsx(w,{label:a("settings.menubar.showStats"),hint:t?a("settings.menubar.showStatsHint"):a("menubar.native_only"),checked:n,disabled:!t,onChange:()=>r("showStats",!n)}),e.jsx(oe,{label:a("settings.menubar.iconStyle"),hint:a("settings.menubar.iconStyleHint"),value:B,disabled:!t,options:[{value:"clawd",label:a("settings.menubar.iconStyle.clawd")},{value:"cat",label:a("settings.menubar.iconStyle.cat")},{value:"pet",label:a("settings.menubar.iconStyle.pet")},{value:"static",label:a("settings.menubar.iconStyle.static")}],onChange:d=>r("menuBarIconStyle",d)}),e.jsx(w,{label:a("settings.menubar.toastOnReset"),hint:a("settings.menubar.toastOnResetHint"),checked:j,disabled:!t,onChange:()=>r("toastOnReset",!j)}),e.jsx(w,{label:a("settings.menubar.confettiOnReset"),hint:a("settings.menubar.confettiOnResetHint"),checked:v,disabled:!t,onChange:()=>r("confettiOnReset",!v)})]})]})}function ce(){const[t,i]=b.useState("loading");return b.useEffect(()=>{if(typeof window>"u")return;if(O()){i("native");return}const r=(navigator.userAgent||"").toLowerCase(),s=/mac/.test(r)&&!/iphone|ipad/.test(r);i(s?"mac-web":"other")},[]),t}function de(){const t=ce();return t==="loading"?e.jsx("div",{className:"h-10 w-40","aria-hidden":"true"}):t==="native"?e.jsxs("button",{type:"button",onClick:()=>R("openWidgetGallery"),className:"inline-flex h-10 items-center gap-2 rounded-lg bg-oai-black px-4 text-sm font-medium text-white transition-colors hover:bg-oai-gray-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:bg-white dark:text-oai-black dark:hover:bg-oai-gray-200",children:[a("widgets.cta.open_gallery"),e.jsx(H,{className:"h-4 w-4","aria-hidden":"true"})]}):t==="mac-web"?e.jsxs("a",{href:"https://github.com/mm7894215/TokenTracker/releases/latest",target:"_blank",rel:"noopener noreferrer",className:"inline-flex h-10 items-center gap-2 rounded-lg bg-oai-black px-4 text-sm font-medium text-white no-underline transition-colors hover:bg-oai-gray-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:bg-white dark:text-oai-black dark:hover:bg-oai-gray-200",children:[e.jsx(U,{className:"h-4 w-4","aria-hidden":"true"}),a("widgets.cta.download")]}):e.jsxs("span",{className:"inline-flex h-10 items-center gap-2 rounded-lg border border-oai-gray-200 bg-oai-gray-50 px-4 text-sm font-medium text-oai-gray-500 dark:border-oai-gray-800 dark:bg-oai-gray-900 dark:text-oai-gray-400",children:[e.jsx(E,{className:"h-4 w-4","aria-hidden":"true"}),a("widgets.cta.macos_only")]})}const me=[{id:"summary",Preview:J,nameKey:"widgets.summary.name",descKey:"widgets.summary.description"},{id:"heatmap",Preview:Q,nameKey:"widgets.heatmap.name",descKey:"widgets.heatmap.description"},{id:"topModels",Preview:ee,nameKey:"widgets.topModels.name",descKey:"widgets.topModels.description"},{id:"limits",Preview:te,nameKey:"widgets.limits.name",descKey:"widgets.limits.description"}];function ge({Preview:t,nameKey:i,descKey:r}){return e.jsxs("article",{className:"flex h-full flex-col rounded-xl border border-oai-gray-200 bg-white p-4 transition-colors duration-200 dark:border-oai-gray-800 dark:bg-oai-gray-900 sm:p-5",children:[e.jsx(t,{}),e.jsxs("div",{className:"mt-4",children:[e.jsx("h3",{className:"text-[15px] font-semibold text-oai-black dark:text-white",children:a(i)}),e.jsx("p",{className:"mt-1.5 text-sm leading-relaxed text-oai-gray-500 dark:text-oai-gray-400",children:a(r)})]})]})}function M({titleKey:t}){return e.jsx("h2",{className:"mb-4 text-xl font-semibold tracking-tight text-oai-black dark:text-white sm:mb-5 sm:text-2xl",children:a(t)})}function Ce(){return e.jsx("div",{className:"flex flex-col flex-1 text-oai-black dark:text-oai-white font-oai antialiased",children:e.jsx("main",{className:"flex-1 pt-8 sm:pt-10 pb-12 sm:pb-16",children:e.jsxs("div",{className:"mx-auto max-w-5xl px-4 sm:px-6",children:[e.jsx(N,{y:12,children:e.jsxs("header",{className:"mb-10 flex items-start justify-between gap-4 sm:mb-12",children:[e.jsx("h1",{className:"text-3xl font-semibold tracking-tight text-oai-black dark:text-white sm:text-4xl",children:a("widgets.page.title")}),e.jsx("div",{className:"shrink-0",children:e.jsx(de,{})})]})}),e.jsx(N,{y:12,delay:.06,children:e.jsxs("section",{"aria-label":a("widgets.menubar.section.title"),className:"mb-12 sm:mb-14",children:[e.jsx(M,{titleKey:"widgets.menubar.section.title"}),e.jsx(ne,{})]})}),e.jsxs("section",{"aria-label":a("widgets.gallery.section.title"),children:[e.jsx(M,{titleKey:"widgets.gallery.section.title"}),e.jsx(G,{staggerDelay:.08,initialDelay:.04,children:e.jsx("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2 lg:gap-5",children:me.map(({id:t,Preview:i,nameKey:r,descKey:s})=>e.jsx(z,{children:e.jsx(ge,{Preview:i,nameKey:r,descKey:s})},t))})})]})]})})})}export{Ce as WidgetsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as x,j as e,c as s,k as j,l as f}from"./__vite-browser-external-
|
|
1
|
+
import{r as x,j as e,c as s,k as j,l as f}from"./__vite-browser-external-Db9onipF.js";function c(a){return Number.isFinite(a)?Math.abs(a)>=1e12?(a/1e12).toFixed(2).replace(/\.?0+$/,"")+"T":f(a,{decimals:2}):"0"}function o({children:a,accent:d=!1,className:n=""}){const l="rounded-2xl border border-oai-gray-200 dark:border-oai-gray-800 p-6 bg-white dark:bg-oai-gray-900",p=d?"bg-gradient-to-br from-emerald-50 to-cyan-50 dark:from-emerald-900/30 dark:to-cyan-900/30 border-transparent":"";return e.jsx("div",{className:`${l} ${p} ${n}`,children:a})}function N(){const[a,d]=x.useState(null),[n,l]=x.useState("loading"),[p,y]=x.useState("");if(x.useEffect(()=>{let t=!1;const g=new URLSearchParams(window.location.search).get("year"),k=g?`/functions/tokentracker-wrapped?year=${encodeURIComponent(g)}`:"/functions/tokentracker-wrapped";return fetch(k).then(async r=>{if(!r.ok)throw new Error(`HTTP ${r.status}`);return r.json()}).then(r=>{t||(d(r),l(r.totals&&r.totals.tokens>0?"ready":"empty"))}).catch(r=>{t||(y(String(r?.message||r)),l("error"))}),()=>{t=!0}},[]),n==="loading")return e.jsx("div",{className:"min-h-screen bg-white dark:bg-oai-gray-950 flex items-center justify-center",children:e.jsx("p",{className:"text-oai-gray-500",children:s("wrapped.loading")})});if(n==="error")return e.jsx("div",{className:"min-h-screen bg-white dark:bg-oai-gray-950 flex items-center justify-center px-6",children:e.jsx(o,{children:e.jsx("p",{className:"text-red-600 dark:text-red-300",children:s("wrapped.error",{error:p})})})});if(n==="empty"||!a)return e.jsx("div",{className:"min-h-screen bg-white dark:bg-oai-gray-950 flex items-center justify-center px-6",children:e.jsx(o,{children:e.jsx("p",{className:"text-oai-gray-500",children:s("wrapped.empty",{command:"tracker sync"})})})});const m=t=>`${(t*100).toFixed(0)}%`,u=j(),i=[];if(a.top.models.length>0){const t=a.top.models[0];i.push(s("wrapped.highlight.model",{model:t.model,percent:(t.share*100).toFixed(0)}))}if(a.top.days.length>0){const t=a.top.days[0];i.push(s("wrapped.highlight.day",{day:t.day,tokens:c(t.tokens)}))}return a.peak_hour&&i.push(s("wrapped.highlight.hour",{hour:String(a.peak_hour.hour).padStart(2,"0")})),a.longest_streak?.days>=2&&i.push(s("wrapped.highlight.streak",{days:a.longest_streak.days})),a.totals.sources>=4&&i.push(s("wrapped.highlight.tools",{count:a.totals.sources})),e.jsx("div",{className:"min-h-screen bg-gradient-to-b from-white to-oai-gray-50 dark:from-oai-gray-950 dark:to-oai-gray-900 px-6 py-12",children:e.jsxs("div",{className:"max-w-3xl mx-auto space-y-6",children:[e.jsxs("header",{className:"text-center pb-6",children:[e.jsx("p",{className:"text-sm uppercase tracking-widest text-oai-gray-500 dark:text-oai-gray-400",children:s("wrapped.kicker")}),e.jsx("h1",{className:"text-6xl font-bold text-oai-gray-900 dark:text-white mt-2",children:a.year})]}),e.jsxs(o,{accent:!0,className:"text-center",children:[e.jsx("p",{className:"text-xs uppercase tracking-widest text-oai-gray-600 dark:text-oai-gray-300",children:s("wrapped.total_tokens")}),e.jsx("p",{className:"text-7xl font-bold text-emerald-700 dark:text-emerald-300 mt-2",children:c(a.totals.tokens)}),e.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400 mt-4",children:s("wrapped.summary",{conversations:a.totals.conversations.toLocaleString(u),days:a.totals.active_days,tools:a.totals.sources})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs(o,{children:[e.jsx("h3",{className:"text-xs uppercase tracking-widest text-oai-gray-500 dark:text-oai-gray-400 mb-4",children:s("wrapped.top_tools")}),e.jsx("ul",{className:"space-y-3",children:a.top.sources.slice(0,5).map(t=>e.jsxs("li",{className:"flex items-baseline justify-between",children:[e.jsx("span",{className:"text-oai-gray-900 dark:text-white",children:t.source}),e.jsxs("span",{className:"text-oai-gray-500 dark:text-oai-gray-400 font-mono text-sm",children:[c(t.tokens)," · ",m(t.share)]})]},t.source))})]}),e.jsxs(o,{children:[e.jsx("h3",{className:"text-xs uppercase tracking-widest text-oai-gray-500 dark:text-oai-gray-400 mb-4",children:s("wrapped.top_models")}),e.jsx("ul",{className:"space-y-3",children:a.top.models.slice(0,5).map(t=>e.jsxs("li",{className:"flex items-baseline justify-between",children:[e.jsx("span",{className:"text-oai-gray-900 dark:text-white truncate pr-3",children:t.model}),e.jsxs("span",{className:"text-oai-gray-500 dark:text-oai-gray-400 font-mono text-sm whitespace-nowrap",children:[c(t.tokens)," · ",m(t.share)]})]},t.model))})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.peak_hour&&e.jsxs(o,{children:[e.jsx("p",{className:"text-xs uppercase tracking-widest text-oai-gray-500 dark:text-oai-gray-400",children:s("wrapped.peak_hour")}),e.jsxs("p",{className:"text-4xl font-semibold text-oai-gray-900 dark:text-white mt-2",children:[String(a.peak_hour.hour).padStart(2,"0"),":00 UTC"]}),e.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400 mt-1",children:s("wrapped.tokens",{count:c(a.peak_hour.tokens)})})]}),a.longest_streak&&a.longest_streak.days>0&&e.jsxs(o,{children:[e.jsx("p",{className:"text-xs uppercase tracking-widest text-oai-gray-500 dark:text-oai-gray-400",children:s("wrapped.longest_streak")}),e.jsx("p",{className:"text-4xl font-semibold text-oai-gray-900 dark:text-white mt-2",children:s("wrapped.days",{count:a.longest_streak.days})}),e.jsxs("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400 mt-1",children:[a.longest_streak.from," → ",a.longest_streak.to]})]})]}),a.top.days.length>0&&e.jsxs(o,{children:[e.jsx("h3",{className:"text-xs uppercase tracking-widest text-oai-gray-500 dark:text-oai-gray-400 mb-4",children:s("wrapped.top_days")}),e.jsx("ul",{className:"space-y-2",children:a.top.days.slice(0,5).map(t=>e.jsxs("li",{className:"flex items-baseline justify-between",children:[e.jsx("span",{className:"text-oai-gray-900 dark:text-white font-mono text-sm",children:t.day}),e.jsx("span",{className:"text-oai-gray-500 dark:text-oai-gray-400 font-mono text-sm",children:c(t.tokens)})]},t.day))})]}),i.length>0&&e.jsxs(o,{accent:!0,children:[e.jsx("h3",{className:"text-xs uppercase tracking-widest text-oai-gray-600 dark:text-oai-gray-300 mb-3",children:s("wrapped.highlights")}),e.jsx("ul",{className:"space-y-2 text-oai-gray-800 dark:text-oai-gray-200",children:i.map((t,h)=>e.jsxs("li",{className:"text-base",children:["· ",t]},h))})]}),e.jsx("footer",{className:"text-center text-xs text-oai-gray-400 dark:text-oai-gray-500 pt-6",children:s("wrapped.footer",{command:"tracker wrapped --json"})})]})})}export{N as default};
|