tokentracker-cli 0.93.7 → 0.94.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.
Files changed (117) hide show
  1. package/README.de.md +1 -1
  2. package/README.ja.md +1 -1
  3. package/README.ko.md +1 -1
  4. package/README.md +1 -1
  5. package/README.zh-CN.md +1 -1
  6. package/dashboard/dist/assets/{AchievementBadge-DqvblIQY.js → AchievementBadge-DnmgEa4q.js} +1 -1
  7. package/dashboard/dist/assets/{AchievementsPage-C-xm27pB.js → AchievementsPage-B7YTbAuK.js} +2 -2
  8. package/dashboard/dist/assets/{AchievementsSection-D8Oe2FGJ.js → AchievementsSection-CwgT5sqH.js} +1 -1
  9. package/dashboard/dist/assets/{BadgeDetailModal-BJOcOnHo.js → BadgeDetailModal-Dets6jzW.js} +1 -1
  10. package/dashboard/dist/assets/{BotAnimated-6fB046ld.js → BotAnimated-5KwUvC9F.js} +1 -1
  11. package/dashboard/dist/assets/{Card-BKbWtBaL.js → Card-jf9w-4-N.js} +1 -1
  12. package/dashboard/dist/assets/{ClawdAnimated-DbpeAldp.js → ClawdAnimated-CGxDVQ0c.js} +2 -2
  13. package/dashboard/dist/assets/{CommandPalette-Jte7TBon.js → CommandPalette-B1bUUf32.js} +1 -1
  14. package/dashboard/dist/assets/{CommunityStatsModal-DDm7tCXO.js → CommunityStatsModal-DRDpZycV.js} +1 -1
  15. package/dashboard/dist/assets/{ConfirmModal-CrIjcrpZ.js → ConfirmModal-BR-aIRH9.js} +1 -1
  16. package/dashboard/dist/assets/{Controls-BWJtMkIy.js → Controls-CbHsJAqV.js} +1 -1
  17. package/dashboard/dist/assets/{DashboardPage-Bcq4EwG5.js → DashboardPage-B5XMQoxy.js} +1 -1
  18. package/dashboard/dist/assets/{DevicePage-C9NcPZGX.js → DevicePage-DDlicLLn.js} +1 -1
  19. package/dashboard/dist/assets/{DialogClose-CY-LguUG.js → DialogClose-B89uLXqp.js} +1 -1
  20. package/dashboard/dist/assets/DialogDescription-DiVbwvTR.js +1 -0
  21. package/dashboard/dist/assets/{DialogTitle-BkAmJrQ_.js → DialogTitle-jOyycYKF.js} +1 -1
  22. package/dashboard/dist/assets/{FadeIn-U-bxcM-y.js → FadeIn-BEND42ze.js} +1 -1
  23. package/dashboard/dist/assets/{HeaderGithubStar-4HUCxVhg.js → HeaderGithubStar-Dacl1WGS.js} +1 -1
  24. package/dashboard/dist/assets/{HoverTooltip-BXcXOCs8.js → HoverTooltip-B2Mh2LTi.js} +1 -1
  25. package/dashboard/dist/assets/{IpCheckPage-Cppkc-gE.js → IpCheckPage-CPEuRhiU.js} +1 -1
  26. package/dashboard/dist/assets/{LandingPage-D3KXfYKE.js → LandingPage-BYWNR_dx.js} +2 -2
  27. package/dashboard/dist/assets/{LeaderboardAvatar-CdsHg6L0.js → LeaderboardAvatar-B9_5LDVj.js} +1 -1
  28. package/dashboard/dist/assets/{LeaderboardPage-niat0TZW.js → LeaderboardPage-_Hl1NaIa.js} +2 -2
  29. package/dashboard/dist/assets/{LeaderboardProfileModal-DgjhhEbB.js → LeaderboardProfileModal-Cydp7CyA.js} +3 -3
  30. package/dashboard/dist/assets/{LeaderboardProfilePage-CZej8gpc.js → LeaderboardProfilePage-Dz0ecujs.js} +1 -1
  31. package/dashboard/dist/assets/LimitsPage-CmdT2qOZ.js +5 -0
  32. package/dashboard/dist/assets/{LocalOnlyNotice-DQswDMSD.js → LocalOnlyNotice-DhuPGUkw.js} +1 -1
  33. package/dashboard/dist/assets/{LoginCard-glPyVqYh.js → LoginCard-DQtHaX_5.js} +1 -1
  34. package/dashboard/dist/assets/{LoginModal-slsdEXC7.js → LoginModal-DvpPRnYV.js} +1 -1
  35. package/dashboard/dist/assets/{LoginPage-DX5QT917.js → LoginPage-DOjfmdwb.js} +1 -1
  36. package/dashboard/dist/assets/{PetPage-B8U3CJwt.js → PetPage-Dd6U9fh2.js} +1 -1
  37. package/dashboard/dist/assets/{PopoverPopup-BVPcQAio.js → PopoverPopup-B1V01u10.js} +1 -1
  38. package/dashboard/dist/assets/{ProviderIcon-CljIacVj.js → ProviderIcon-BLRe55c7.js} +1 -1
  39. package/dashboard/dist/assets/{ResetPasswordPage-DTBmQk2y.js → ResetPasswordPage-BJ95vy1S.js} +1 -1
  40. package/dashboard/dist/assets/{SegmentedControl-C6npelCT.js → SegmentedControl-DacS_m9M.js} +1 -1
  41. package/dashboard/dist/assets/{Select-D1elkRBG.js → Select-bQDO5BEA.js} +1 -1
  42. package/dashboard/dist/assets/{SelectItemText-3N-hvYuD.js → SelectItemText-CUGrs9CY.js} +1 -1
  43. package/dashboard/dist/assets/{ServiceStatusPage-C5ZK9X2o.js → ServiceStatusPage-CsERvmVC.js} +1 -1
  44. package/dashboard/dist/assets/SessionsPage-0VvqEfPx.js +2 -0
  45. package/dashboard/dist/assets/SettingsPage-9EHh2HfD.js +2 -0
  46. package/dashboard/dist/assets/{SkillsPage-Cwkevv29.js → SkillsPage-B1AcLX41.js} +1 -1
  47. package/dashboard/dist/assets/{TokenGalaxy-a1-E6_jp.js → TokenGalaxy-DSKTHQSs.js} +1 -1
  48. package/dashboard/dist/assets/{ToolbarRootContext-Cm5cQb9Z.js → ToolbarRootContext-DP4mQLbq.js} +1 -1
  49. package/dashboard/dist/assets/{TrendMonitor-DoNDyarF.js → TrendMonitor-rabtcE5w.js} +1 -1
  50. package/dashboard/dist/assets/{WidgetsPage-QMTmKnRl.js → WidgetsPage-Cr6Wg9QX.js} +1 -1
  51. package/dashboard/dist/assets/{WrappedPage-C9rJcY2o.js → WrappedPage-DqQvRcnA.js} +1 -1
  52. package/dashboard/dist/assets/__vite-browser-external-BHz2N7Ih.css +1 -0
  53. package/dashboard/dist/assets/{__vite-browser-external-CsbVaBbw.js → __vite-browser-external-C8KwSyTz.js} +12 -12
  54. package/dashboard/dist/assets/{agent-logos-B39DKy3X.js → agent-logos-BjIh_mqf.js} +1 -1
  55. package/dashboard/dist/assets/{arrow-up-right-Cw5mMBik.js → arrow-up-right-BIhbN0NO.js} +1 -1
  56. package/dashboard/dist/assets/{check-DrQztnq1.js → check-U-wNzPvd.js} +1 -1
  57. package/dashboard/dist/assets/{chevron-right-CEelysET.js → chevron-right-Du-QVNj4.js} +1 -1
  58. package/dashboard/dist/assets/{composite-MhgOkYfv.js → composite-BR91CxNl.js} +1 -1
  59. package/dashboard/dist/assets/{copy-Bouz-qQR.js → copy-Bw3hXBCu.js} +1 -1
  60. package/dashboard/dist/assets/{download-BugS2cl5.js → download-WOqcQzvK.js} +1 -1
  61. package/dashboard/dist/assets/{external-link-Ceqto-f4.js → external-link-BZtf6WfS.js} +1 -1
  62. package/dashboard/dist/assets/{flame-B67y0kLz.js → flame-B5kp2VI9.js} +1 -1
  63. package/dashboard/dist/assets/{format-tokens-CR8njNJs.js → format-tokens-BOCnuMuJ.js} +1 -1
  64. package/dashboard/dist/assets/{icons-DFj5ctTx.js → icons-CA3FiIa_.js} +1 -1
  65. package/dashboard/dist/assets/{index-ZGfRrxuq.js → index-DQaanK52.js} +1 -1
  66. package/dashboard/dist/assets/{index-CrymIhtC.js → index-DjWC63Bs.js} +1 -1
  67. package/dashboard/dist/assets/{index-Bx6EP36K.js → index-mEG0HZ-a.js} +1 -1
  68. package/dashboard/dist/assets/{info-C6XoktLa.js → info-Djer9i3-.js} +1 -1
  69. package/dashboard/dist/assets/{limits-providers-B9L6hIZT.js → limits-providers-F-RnNFAb.js} +1 -1
  70. package/dashboard/dist/assets/{link-2-DKG2j43e.js → link-2-DV4ocD0l.js} +1 -1
  71. package/dashboard/dist/assets/{loader-circle-DB2txq05.js → loader-circle-DJK72c-o.js} +1 -1
  72. package/dashboard/dist/assets/{maximize-2-3-dz0brp.js → maximize-2-BwBA_lMm.js} +1 -1
  73. package/dashboard/dist/assets/{modifiers.esm-D0KjKi1o.js → modifiers.esm-B3sl4qyZ.js} +1 -1
  74. package/dashboard/dist/assets/{monitor-smartphone-Ds8H_QW9.js → monitor-smartphone-BUTpM4ng.js} +1 -1
  75. package/dashboard/dist/assets/{plus-BDsmAe4Z.js → plus-BA9RP5L6.js} +1 -1
  76. package/dashboard/dist/assets/{provider-display-DRz643iD.js → provider-display-DqsJzGSr.js} +1 -1
  77. package/dashboard/dist/assets/{react-D3Afmy9b.js → react-BYw5AVSz.js} +1 -1
  78. package/dashboard/dist/assets/{search-CO2Xf-Kg.js → search-BzcnFWVD.js} +1 -1
  79. package/dashboard/dist/assets/{skills-api-C1BZuUIq.js → skills-api-vAME1P7G.js} +1 -1
  80. package/dashboard/dist/assets/{sortable.esm-DutNEc4F.js → sortable.esm-BpEiRqqI.js} +1 -1
  81. package/dashboard/dist/assets/{store-a-oUpY-g.js → store-GeT5fhRX.js} +1 -1
  82. package/dashboard/dist/assets/{terminal-DAePk67T.js → terminal-CZCMYQ8K.js} +1 -1
  83. package/dashboard/dist/assets/{trash-2-bnFmtRSG.js → trash-2-DzlWEwKO.js} +1 -1
  84. package/dashboard/dist/assets/{use-community-stats-PJBeXyek.js → use-community-stats-DOvJfj-i.js} +1 -1
  85. package/dashboard/dist/assets/use-limits-display-prefs-BmLs4HyN.js +1 -0
  86. package/dashboard/dist/assets/{use-ordered-list-BaVvCzZ9.js → use-ordered-list-BgozDSSV.js} +1 -1
  87. package/dashboard/dist/assets/use-reduced-motion-Bc3RFJdg.js +1 -0
  88. package/dashboard/dist/assets/{use-session-efficiency-pref-COTG-zJs.js → use-session-efficiency-pref-HP1ckVkS.js} +1 -1
  89. package/dashboard/dist/assets/{use-transform-BQEPyChL.js → use-transform-B4VSogOx.js} +1 -1
  90. package/dashboard/dist/assets/{use-usage-limits-LR2gHJJn.js → use-usage-limits-DNNhD2H6.js} +1 -1
  91. package/dashboard/dist/assets/{useCurrency-CeqKrzFz.js → useCurrency-CSuzCBAL.js} +1 -1
  92. package/dashboard/dist/assets/{useTokenFormat-D0IMlZlO.js → useTokenFormat-ClnL9OFe.js} +1 -1
  93. package/dashboard/dist/assets/{zap-BBn6G5_E.js → zap-C_T9CCiS.js} +1 -1
  94. package/dashboard/dist/index.html +2 -2
  95. package/dashboard/dist/ip-check.html +2 -2
  96. package/dashboard/dist/leaderboard.html +2 -2
  97. package/dashboard/dist/share.html +2 -2
  98. package/package.json +1 -1
  99. package/src/commands/status.js +3 -1
  100. package/src/commands/sync.js +8 -3
  101. package/src/lib/codex-rollout-parser.js +35 -4
  102. package/src/lib/grok-context-breakdown.js +24 -33
  103. package/src/lib/grok-usage.js +95 -0
  104. package/src/lib/local-api.js +2 -0
  105. package/src/lib/pricing/index.js +10 -0
  106. package/src/lib/pricing/seed-snapshot.json +1 -1
  107. package/src/lib/rollout.js +817 -239
  108. package/src/lib/session-analytics.js +305 -50
  109. package/src/lib/telemetry.js +2 -2
  110. package/src/lib/usage-limits.js +20 -10
  111. package/dashboard/dist/assets/DialogDescription-DPyhpdeR.js +0 -1
  112. package/dashboard/dist/assets/LimitsPage-BXzzX87I.js +0 -5
  113. package/dashboard/dist/assets/SessionsPage-CJ0JvE8-.js +0 -2
  114. package/dashboard/dist/assets/SettingsPage-C32uYzqG.js +0 -2
  115. package/dashboard/dist/assets/__vite-browser-external-D95WhsZe.css +0 -1
  116. package/dashboard/dist/assets/use-limits-display-prefs-Blvn-7CB.js +0 -1
  117. package/dashboard/dist/assets/use-reduced-motion-f51jgK_S.js +0 -1
@@ -1 +1 @@
1
- import{m as c}from"./__vite-browser-external-CsbVaBbw.js";const e=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],o=c("search",e);export{o as S};
1
+ import{m as c}from"./__vite-browser-external-C8KwSyTz.js";const e=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],o=c("search",e);export{o as S};
@@ -1 +1 @@
1
- import{N as E,O as I,P as R,Q as $}from"./__vite-browser-external-CsbVaBbw.js";function s(e){return typeof e=="string"?e.trim():""}function g(e){return Array.isArray(e)?[...new Set(e.map(s).filter(Boolean))]:[]}function v(e){const t=s(e).replace(/\\/g,"/");if(!t||t.startsWith("/")||/^[A-Za-z]:\//.test(t))return"";const n=t.replace(/\/+$/g,"").split("/").filter(Boolean);return!n.length||n.some(r=>r==="."||r==="..")?"":n.join("/")}function C(e){const t=s(e).replace(/\\/g,"/");return!t||t.startsWith("/")||t.includes(":/")||/[A-Za-z]:\//.test(t)?"":t}function S(e){return s(e?.key)||s(e?.id)||`local:${s(e?.directory)}`}function L(e){return(Array.isArray(e)?e:[]).filter(t=>t?.scope!=="system").map(t=>{const n=v(t?.directory),r=C(S(t));if(!r||!n)return null;const i=t?.scope==="plugin"?"plugin":t?.managed?"managed":"local",o=v(t?.sourceName);return{key:r,name:s(t?.name)||n.split("/").pop()||"Skill",directory:n,targets:g(t?.targets),managed:t?.managed===!0,readOnly:t?.readOnly===!0,scope:i,...o?{sourceName:o}:{}}}).filter(t=>!!t)}function N(e){return{id:s(e?.id),name:s(e?.device_name)||s(e?.id),platform:s(e?.platform)||null,scannedAt:s(e?.scanned_at)||null}}function m(e,t){const n=Array.isArray(e.deviceSources)?e.deviceSources:[];return n.some(r=>r.id===t.id)?e:{...e,deviceSources:[...n,t]}}function q(e,t,n){const r=(Array.isArray(e)?e:[]).filter(o=>o?.scope!=="system").map(o=>({...o})),i=new Map;r.forEach((o,a)=>i.set(S(o).toLowerCase(),a));for(const o of Array.isArray(t?.devices)?t.devices:[]){const a=N(o);if(!(!a.id||a.id===n))for(const c of Array.isArray(o?.skills)?o.skills:[]){if(c?.scope==="system")continue;const l=S(c),p=s(c?.directory);if(!l||!p)continue;const h=l.toLowerCase(),k=g(c.targets),y=i.get(h);if(y!=null){const f=r[y];if(f.remote===!0&&f.inventoryOnly===!0){const A=[...new Set([...g(f.targets),...k])],U=Object.fromEntries(A.map(_=>[_,"synced"]));r[y]=m({...f,targets:A,targetStates:U},a)}else r[y]=m(f,a);continue}const w=k,b=Object.fromEntries(w.map(f=>[f,"synced"])),j=m({id:`remote:${encodeURIComponent(l)}`,key:l,name:s(c.name)||p.split(/[\\/]/).pop()||"Skill",directory:p,description:"",targets:w,targetStates:b,managed:!1,readOnly:!0,inventoryOnly:!0,remote:!0,scope:s(c.scope)||"local",sourceName:s(c.sourceName)||null},a);i.set(h,r.length),r.push(j)}}return r.sort((o,a)=>String(o.name||o.directory).localeCompare(String(a.name||a.directory))||String(o.id||o.key).localeCompare(String(a.id||a.key)))}const T="tokentracker-skills",P="tokentracker-account-skills",J=15e3;async function d(e){const t=new URL(`/functions/${T}`,window.location.origin);if(e)for(const[i,o]of Object.entries(e))o!=null&&o!==""&&t.searchParams.set(i,String(o));const n=await fetch(t.toString(),{headers:{Accept:"application/json"},cache:"no-store"}),r=await n.json().catch(()=>null);if(!n.ok)throw new Error(r?.error||`Request failed with HTTP ${n.status}`);return r}async function u(e){const t=await $(),n=await fetch(`/functions/${T}`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",...t},cache:"no-store",body:JSON.stringify(e)}),r=await n.json().catch(()=>null);if(!n.ok||r?.ok===!1)throw new Error(r?.error||`Request failed with HTTP ${n.status}`);return r}function x(){return d({mode:"installed"})}function H(e={}){return d({mode:"discover",...e.force?{force:1}:{}})}function z(e,t=0,n=20){return d({mode:"search",q:e,offset:t,limit:n})}function B(){return d({mode:"repos"})}function M(e,t){return u({action:"install",skill:e,targets:t})}function D(e){return u({action:"uninstall",id:e})}function G(e){return u({action:"restore",id:e})}function Q(e,t){return u({action:"set_targets",id:e,targets:t})}function W(e,t){return u({action:"import_local",directory:e,targets:t})}function Z(e,t){return u({action:"delete_local",directory:e,targets:t||[]})}function F(e){return u({action:"add_repo",repo:e})}function V(e,t){return u({action:"remove_repo",owner:e,name:t})}function X(e={}){return d({mode:"popular",...e.force?{force:1}:{}})}function Y(e={}){return d({mode:"updates",...e.force?{force:1}:{}})}function ee(e={}){return d({mode:"skill_usage",...e.force?{force:1}:{}})}async function O({accessToken:e,method:t="GET",body:n}){if(!e||!E(e))throw new Error("Skills sync requires sign-in");const r=I();if(!r)throw new Error("InsForge base URL not configured");const i={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`},o=R();o&&(i.apikey=o);const a=new AbortController,c=setTimeout(()=>a.abort(),J);try{const l=await fetch(`${r.replace(/\/$/,"")}/functions/${P}`,{method:t,headers:i,cache:"no-store",signal:a.signal,...n==null?{}:{body:JSON.stringify(n)}}),p=await l.json().catch(()=>null);if(!l.ok)throw new Error(p?.error||`Request failed with HTTP ${l.status}`);return p}finally{clearTimeout(c)}}function te(e){return O({accessToken:e})}function ne({accessToken:e,deviceId:t,skills:n}){return O({accessToken:e,method:"POST",body:{device_id:t,skills:L(n)}})}export{te as a,B as b,X as c,H as d,Y as e,ee as f,x as g,Z as h,M as i,Q as j,W as k,V as l,q as m,F as n,ne as p,G as r,z as s,D as u};
1
+ import{N as E,O as I,P as R,Q as $}from"./__vite-browser-external-C8KwSyTz.js";function s(e){return typeof e=="string"?e.trim():""}function g(e){return Array.isArray(e)?[...new Set(e.map(s).filter(Boolean))]:[]}function v(e){const t=s(e).replace(/\\/g,"/");if(!t||t.startsWith("/")||/^[A-Za-z]:\//.test(t))return"";const n=t.replace(/\/+$/g,"").split("/").filter(Boolean);return!n.length||n.some(r=>r==="."||r==="..")?"":n.join("/")}function C(e){const t=s(e).replace(/\\/g,"/");return!t||t.startsWith("/")||t.includes(":/")||/[A-Za-z]:\//.test(t)?"":t}function S(e){return s(e?.key)||s(e?.id)||`local:${s(e?.directory)}`}function L(e){return(Array.isArray(e)?e:[]).filter(t=>t?.scope!=="system").map(t=>{const n=v(t?.directory),r=C(S(t));if(!r||!n)return null;const i=t?.scope==="plugin"?"plugin":t?.managed?"managed":"local",o=v(t?.sourceName);return{key:r,name:s(t?.name)||n.split("/").pop()||"Skill",directory:n,targets:g(t?.targets),managed:t?.managed===!0,readOnly:t?.readOnly===!0,scope:i,...o?{sourceName:o}:{}}}).filter(t=>!!t)}function N(e){return{id:s(e?.id),name:s(e?.device_name)||s(e?.id),platform:s(e?.platform)||null,scannedAt:s(e?.scanned_at)||null}}function m(e,t){const n=Array.isArray(e.deviceSources)?e.deviceSources:[];return n.some(r=>r.id===t.id)?e:{...e,deviceSources:[...n,t]}}function q(e,t,n){const r=(Array.isArray(e)?e:[]).filter(o=>o?.scope!=="system").map(o=>({...o})),i=new Map;r.forEach((o,a)=>i.set(S(o).toLowerCase(),a));for(const o of Array.isArray(t?.devices)?t.devices:[]){const a=N(o);if(!(!a.id||a.id===n))for(const c of Array.isArray(o?.skills)?o.skills:[]){if(c?.scope==="system")continue;const l=S(c),p=s(c?.directory);if(!l||!p)continue;const h=l.toLowerCase(),k=g(c.targets),y=i.get(h);if(y!=null){const f=r[y];if(f.remote===!0&&f.inventoryOnly===!0){const A=[...new Set([...g(f.targets),...k])],U=Object.fromEntries(A.map(_=>[_,"synced"]));r[y]=m({...f,targets:A,targetStates:U},a)}else r[y]=m(f,a);continue}const w=k,b=Object.fromEntries(w.map(f=>[f,"synced"])),j=m({id:`remote:${encodeURIComponent(l)}`,key:l,name:s(c.name)||p.split(/[\\/]/).pop()||"Skill",directory:p,description:"",targets:w,targetStates:b,managed:!1,readOnly:!0,inventoryOnly:!0,remote:!0,scope:s(c.scope)||"local",sourceName:s(c.sourceName)||null},a);i.set(h,r.length),r.push(j)}}return r.sort((o,a)=>String(o.name||o.directory).localeCompare(String(a.name||a.directory))||String(o.id||o.key).localeCompare(String(a.id||a.key)))}const T="tokentracker-skills",P="tokentracker-account-skills",J=15e3;async function d(e){const t=new URL(`/functions/${T}`,window.location.origin);if(e)for(const[i,o]of Object.entries(e))o!=null&&o!==""&&t.searchParams.set(i,String(o));const n=await fetch(t.toString(),{headers:{Accept:"application/json"},cache:"no-store"}),r=await n.json().catch(()=>null);if(!n.ok)throw new Error(r?.error||`Request failed with HTTP ${n.status}`);return r}async function u(e){const t=await $(),n=await fetch(`/functions/${T}`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",...t},cache:"no-store",body:JSON.stringify(e)}),r=await n.json().catch(()=>null);if(!n.ok||r?.ok===!1)throw new Error(r?.error||`Request failed with HTTP ${n.status}`);return r}function x(){return d({mode:"installed"})}function H(e={}){return d({mode:"discover",...e.force?{force:1}:{}})}function z(e,t=0,n=20){return d({mode:"search",q:e,offset:t,limit:n})}function B(){return d({mode:"repos"})}function M(e,t){return u({action:"install",skill:e,targets:t})}function D(e){return u({action:"uninstall",id:e})}function G(e){return u({action:"restore",id:e})}function Q(e,t){return u({action:"set_targets",id:e,targets:t})}function W(e,t){return u({action:"import_local",directory:e,targets:t})}function Z(e,t){return u({action:"delete_local",directory:e,targets:t||[]})}function F(e){return u({action:"add_repo",repo:e})}function V(e,t){return u({action:"remove_repo",owner:e,name:t})}function X(e={}){return d({mode:"popular",...e.force?{force:1}:{}})}function Y(e={}){return d({mode:"updates",...e.force?{force:1}:{}})}function ee(e={}){return d({mode:"skill_usage",...e.force?{force:1}:{}})}async function O({accessToken:e,method:t="GET",body:n}){if(!e||!E(e))throw new Error("Skills sync requires sign-in");const r=I();if(!r)throw new Error("InsForge base URL not configured");const i={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`},o=R();o&&(i.apikey=o);const a=new AbortController,c=setTimeout(()=>a.abort(),J);try{const l=await fetch(`${r.replace(/\/$/,"")}/functions/${P}`,{method:t,headers:i,cache:"no-store",signal:a.signal,...n==null?{}:{body:JSON.stringify(n)}}),p=await l.json().catch(()=>null);if(!l.ok)throw new Error(p?.error||`Request failed with HTTP ${l.status}`);return p}finally{clearTimeout(c)}}function te(e){return O({accessToken:e})}function ne({accessToken:e,deviceId:t,skills:n}){return O({accessToken:e,method:"POST",body:{device_id:t,skills:L(n)}})}export{te as a,B as b,X as c,H as d,Y as e,ee as f,x as g,Z as h,M as i,Q as j,W as k,V as l,q as m,F as n,ne as p,G as r,z as s,D as u};
@@ -1,4 +1,4 @@
1
- import{r as c,d as P,a3 as Oe}from"./__vite-browser-external-CsbVaBbw.js";function Sn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const tt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function me(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function bt(e){return"nodeType"in e}function B(e){var t,n;return e?me(e)?e:bt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function wt(e){const{Document:t}=B(e);return e instanceof t}function Be(e){return me(e)?!1:e instanceof B(e).HTMLElement}function Wt(e){return e instanceof B(e).SVGElement}function ye(e){return e?me(e)?e.document:bt(e)?wt(e)?e:Be(e)||Wt(e)?e.ownerDocument:document:document:document}const Q=tt?c.useLayoutEffect:c.useEffect;function mt(e){const t=c.useRef(e);return Q(()=>{t.current=e}),c.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function En(){const e=c.useRef(null),t=c.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=c.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function ke(e,t){t===void 0&&(t=[e]);const n=c.useRef(e);return Q(()=>{n.current!==e&&(n.current=e)},t),n}function Fe(e,t){const n=c.useRef();return c.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Je(e){const t=mt(e),n=c.useRef(null),r=c.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function ft(e){const t=c.useRef();return c.useEffect(()=>{t.current=e},[e]),t.current}let ct={};function $e(e,t){return c.useMemo(()=>{if(t)return t;const n=ct[e]==null?0:ct[e]+1;return ct[e]=n,e+"-"+n},[e,t])}function Ht(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((i,s)=>{const a=Object.entries(s);for(const[l,u]of a){const f=i[l];f!=null&&(i[l]=f+e*u)}return i},{...t})}}const we=Ht(1),ze=Ht(-1);function In(e){return"clientX"in e&&"clientY"in e}function yt(e){if(!e)return!1;const{KeyboardEvent:t}=B(e.target);return t&&e instanceof t}function Mn(e){if(!e)return!1;const{TouchEvent:t}=B(e.target);return t&&e instanceof t}function ht(e){if(Mn(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return In(e)?{x:e.clientX,y:e.clientY}:null}const _e=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[_e.Translate.toString(e),_e.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Tt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function An(e){return e.matches(Tt)?e:e.querySelector(Tt)}const On={display:"none"};function Tn(e){let{id:t,value:n}=e;return P.createElement("div",{id:t,style:On},n)}function Nn(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return P.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function Ln(){const[e,t]=c.useState("");return{announce:c.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Kt=c.createContext(null);function kn(e){const t=c.useContext(Kt);c.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function zn(){const[e]=c.useState(()=>new Set),t=c.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[c.useCallback(r=>{let{type:o,event:i}=r;e.forEach(s=>{var a;return(a=s[o])==null?void 0:a.call(s,i)})},[e]),t]}const Pn={draggable:`
1
+ import{r as c,d as P,a3 as Oe}from"./__vite-browser-external-C8KwSyTz.js";function Sn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const tt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function me(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function bt(e){return"nodeType"in e}function B(e){var t,n;return e?me(e)?e:bt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function wt(e){const{Document:t}=B(e);return e instanceof t}function Be(e){return me(e)?!1:e instanceof B(e).HTMLElement}function Wt(e){return e instanceof B(e).SVGElement}function ye(e){return e?me(e)?e.document:bt(e)?wt(e)?e:Be(e)||Wt(e)?e.ownerDocument:document:document:document}const Q=tt?c.useLayoutEffect:c.useEffect;function mt(e){const t=c.useRef(e);return Q(()=>{t.current=e}),c.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function En(){const e=c.useRef(null),t=c.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=c.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function ke(e,t){t===void 0&&(t=[e]);const n=c.useRef(e);return Q(()=>{n.current!==e&&(n.current=e)},t),n}function Fe(e,t){const n=c.useRef();return c.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Je(e){const t=mt(e),n=c.useRef(null),r=c.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function ft(e){const t=c.useRef();return c.useEffect(()=>{t.current=e},[e]),t.current}let ct={};function $e(e,t){return c.useMemo(()=>{if(t)return t;const n=ct[e]==null?0:ct[e]+1;return ct[e]=n,e+"-"+n},[e,t])}function Ht(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((i,s)=>{const a=Object.entries(s);for(const[l,u]of a){const f=i[l];f!=null&&(i[l]=f+e*u)}return i},{...t})}}const we=Ht(1),ze=Ht(-1);function In(e){return"clientX"in e&&"clientY"in e}function yt(e){if(!e)return!1;const{KeyboardEvent:t}=B(e.target);return t&&e instanceof t}function Mn(e){if(!e)return!1;const{TouchEvent:t}=B(e.target);return t&&e instanceof t}function ht(e){if(Mn(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return In(e)?{x:e.clientX,y:e.clientY}:null}const _e=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[_e.Translate.toString(e),_e.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Tt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function An(e){return e.matches(Tt)?e:e.querySelector(Tt)}const On={display:"none"};function Tn(e){let{id:t,value:n}=e;return P.createElement("div",{id:t,style:On},n)}function Nn(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return P.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function Ln(){const[e,t]=c.useState("");return{announce:c.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Kt=c.createContext(null);function kn(e){const t=c.useContext(Kt);c.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function zn(){const[e]=c.useState(()=>new Set),t=c.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[c.useCallback(r=>{let{type:o,event:i}=r;e.forEach(s=>{var a;return(a=s[o])==null?void 0:a.call(s,i)})},[e]),t]}const Pn={draggable:`
2
2
  To pick up a draggable item, press the space bar.
3
3
  While dragging, use the arrow keys to move the item.
4
4
  Press space again to drop the item in its new position, or press escape to cancel.
@@ -1 +1 @@
1
- import{Z as t}from"./__vite-browser-external-CsbVaBbw.js";import{F as p,P as g}from"./composite-MhgOkYfv.js";function d(){return new p({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new g,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function c(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:d(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:t,inactiveTriggerProps:t,popupProps:t}}function m(e,n,l=!1){return new p({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:n,syncOnly:!0,nested:l,onOpenChange:void 0})}const o=e=>e.triggerIdProp??e.activeTriggerId,r=e=>e.openProp??e.open,i=e=>(e.popupElement?.id??e.floatingId)||void 0;function u(e,n){return n!==void 0&&r(e)&&o(e)===n}function a(e,n){return u(e,n)?!0:n!==void 0&&r(e)&&o(e)==null&&e.triggerCount===1}const P={open:r,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:o,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:i,isTriggerActive:(e,n)=>n!==void 0&&o(e)===n,isOpenedByTrigger:(e,n)=>u(e,n),isMountedByTrigger:(e,n)=>n!==void 0&&o(e)===n&&e.mounted,triggerProps:(e,n)=>n?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,n)=>a(e,n)?i(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};export{m as a,c,P as p};
1
+ import{Z as t}from"./__vite-browser-external-C8KwSyTz.js";import{F as p,P as g}from"./composite-BR91CxNl.js";function d(){return new p({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new g,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function c(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:d(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:t,inactiveTriggerProps:t,popupProps:t}}function m(e,n,l=!1){return new p({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:n,syncOnly:!0,nested:l,onOpenChange:void 0})}const o=e=>e.triggerIdProp??e.activeTriggerId,r=e=>e.openProp??e.open,i=e=>(e.popupElement?.id??e.floatingId)||void 0;function u(e,n){return n!==void 0&&r(e)&&o(e)===n}function a(e,n){return u(e,n)?!0:n!==void 0&&r(e)&&o(e)==null&&e.triggerCount===1}const P={open:r,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:o,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:i,isTriggerActive:(e,n)=>n!==void 0&&o(e)===n,isOpenedByTrigger:(e,n)=>u(e,n),isMountedByTrigger:(e,n)=>n!==void 0&&o(e)===n&&e.mounted,triggerProps:(e,n)=>n?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,n)=>a(e,n)?i(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};export{m as a,c,P as p};
@@ -1 +1 @@
1
- import{m as e}from"./__vite-browser-external-CsbVaBbw.js";const o=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],a=e("terminal",o);export{a as T};
1
+ import{m as e}from"./__vite-browser-external-C8KwSyTz.js";const o=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],a=e("terminal",o);export{a as T};
@@ -1 +1 @@
1
- import{m as a}from"./__vite-browser-external-CsbVaBbw.js";const t=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],o=a("trash-2",t);export{o as T};
1
+ import{m as a}from"./__vite-browser-external-C8KwSyTz.js";const t=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],o=a("trash-2",t);export{o as T};
@@ -1 +1 @@
1
- import{r as p,g as N,b as M}from"./__vite-browser-external-CsbVaBbw.js";const D=6e3,S=2500,E=100;function h(t,r){let o;const n=new Promise((a,i)=>{o=setTimeout(()=>i(new Error("landing stats timeout")),r)});return Promise.race([t,n]).finally(()=>{o!=null&&clearTimeout(o)})}const A=5*6e4,P=1440*6e4,k="tokentracker:community-stats:v2";let s=null;function C(t){const r=Number(t?.tokenFloor)||0,o=Number(t?.totalEntries)||0;return!(r>0)||!(o>0)?null:{tokenFloor:r,totalEntries:o,top:Array.isArray(t?.top)?t.top:[],topModels:Array.isArray(t?.topModels)?t.topModels:[],providers:Array.isArray(t?.providers)?t.providers:[],dailyGrowth:Array.isArray(t?.dailyGrowth)?t.dailyGrowth:[],tokenMix:Array.isArray(t?.tokenMix)?t.tokenMix:[],userDistribution:Array.isArray(t?.userDistribution)?t.userDistribution:[],platforms:Array.isArray(t?.platforms)?t.platforms:[],activeDevelopersTotal:Number(t?.activeDevelopersTotal)||0,activeDevelopers30d:Number(t?.activeDevelopers30d)||0,tokens30d:Number(t?.tokens30d)||0,tokenGrowthPct:t?.tokenGrowthPct!=null&&Number.isFinite(Number(t.tokenGrowthPct))?Number(t.tokenGrowthPct):null,developerGrowthPct:t?.developerGrowthPct!=null&&Number.isFinite(Number(t.developerGrowthPct))?Number(t.developerGrowthPct):null,generatedAt:typeof t?.generatedAt=="string"?t.generatedAt:null}}function G(){if(typeof window>"u"||!window.localStorage)return null;try{const t=JSON.parse(window.localStorage.getItem(k)||"null"),r=Number(t?.cachedAt)||0,o=C(t?.data),n=Date.now()-r;return!o||n<0||n>P?null:{data:o,isFresh:n<A}}catch{return null}}function I(t){if(!(typeof window>"u"||!window.localStorage))try{window.localStorage.setItem(k,JSON.stringify({cachedAt:Date.now(),data:t}))}catch{}}function F(){if(s&&Date.now()-s.at<A)return s.promise;const t=Promise.all([h(N({period:"total",limit:E,offset:0}),D),h(M(),S).catch(()=>null)]);return s={at:Date.now(),promise:t},t.catch(()=>{s?.promise===t&&(s=null)}),t}function O({enabled:t=!0}={}){const[r]=p.useState(()=>G()),[o,n]=p.useState(()=>r?{status:"ready",...r.data}:{status:"loading",tokenFloor:null,totalEntries:null,top:[]});return p.useEffect(()=>{if(!t||r?.isFresh)return;let a=!1,i=null,u=null;const y=async()=>{try{const[l,e]=await F();if(a)return;const c=Array.isArray(l?.entries)?l.entries:[],b=c.reduce((m,T)=>m+(Number(T?.total_tokens)||0),0),d=Number(e?.total_tokens)||0;d>0||(s=null);const w=Number(r?.data?.tokenFloor)||0,f=d>0?d:w>0?w:b;if(!c.length||!(f>0)){n(m=>({...m,status:"error"}));return}const g=Array.isArray(e?.top_models)?e.top_models:r?.data?.topModels||[],_={tokenFloor:f,totalEntries:Number(l?.total_entries)||c.length,top:c.slice(0,3),topModels:g,providers:Array.isArray(e?.providers)?e.providers:[],dailyGrowth:Array.isArray(e?.daily_growth)?e.daily_growth:[],tokenMix:Array.isArray(e?.token_mix)?e.token_mix:[],userDistribution:Array.isArray(e?.user_distribution)?e.user_distribution:[],platforms:Array.isArray(e?.platforms)?e.platforms:[],activeDevelopersTotal:Number(e?.active_developers_total)||0,activeDevelopers30d:Number(e?.active_developers_30d)||0,tokens30d:Number(e?.tokens_30d)||0,tokenGrowthPct:e?.token_growth_pct==null?null:Number(e.token_growth_pct),developerGrowthPct:e?.developer_growth_pct==null?null:Number(e.developer_growth_pct),generatedAt:typeof e?.generated_at=="string"?e.generated_at:null};n({status:"ready",..._}),d>0&&I(_)}catch{a||n(e=>e.status==="ready"?e:{...e,status:"error"})}};return typeof window<"u"&&"requestIdleCallback"in window?i=window.requestIdleCallback(y,{timeout:1500}):u=setTimeout(y,400),()=>{a=!0,i!=null&&typeof window.cancelIdleCallback=="function"&&window.cancelIdleCallback(i),u!=null&&clearTimeout(u)}},[t,r]),o}export{O as u};
1
+ import{r as p,g as N,b as M}from"./__vite-browser-external-C8KwSyTz.js";const D=6e3,S=2500,E=100;function h(t,r){let o;const n=new Promise((a,i)=>{o=setTimeout(()=>i(new Error("landing stats timeout")),r)});return Promise.race([t,n]).finally(()=>{o!=null&&clearTimeout(o)})}const A=5*6e4,P=1440*6e4,k="tokentracker:community-stats:v2";let s=null;function C(t){const r=Number(t?.tokenFloor)||0,o=Number(t?.totalEntries)||0;return!(r>0)||!(o>0)?null:{tokenFloor:r,totalEntries:o,top:Array.isArray(t?.top)?t.top:[],topModels:Array.isArray(t?.topModels)?t.topModels:[],providers:Array.isArray(t?.providers)?t.providers:[],dailyGrowth:Array.isArray(t?.dailyGrowth)?t.dailyGrowth:[],tokenMix:Array.isArray(t?.tokenMix)?t.tokenMix:[],userDistribution:Array.isArray(t?.userDistribution)?t.userDistribution:[],platforms:Array.isArray(t?.platforms)?t.platforms:[],activeDevelopersTotal:Number(t?.activeDevelopersTotal)||0,activeDevelopers30d:Number(t?.activeDevelopers30d)||0,tokens30d:Number(t?.tokens30d)||0,tokenGrowthPct:t?.tokenGrowthPct!=null&&Number.isFinite(Number(t.tokenGrowthPct))?Number(t.tokenGrowthPct):null,developerGrowthPct:t?.developerGrowthPct!=null&&Number.isFinite(Number(t.developerGrowthPct))?Number(t.developerGrowthPct):null,generatedAt:typeof t?.generatedAt=="string"?t.generatedAt:null}}function G(){if(typeof window>"u"||!window.localStorage)return null;try{const t=JSON.parse(window.localStorage.getItem(k)||"null"),r=Number(t?.cachedAt)||0,o=C(t?.data),n=Date.now()-r;return!o||n<0||n>P?null:{data:o,isFresh:n<A}}catch{return null}}function I(t){if(!(typeof window>"u"||!window.localStorage))try{window.localStorage.setItem(k,JSON.stringify({cachedAt:Date.now(),data:t}))}catch{}}function F(){if(s&&Date.now()-s.at<A)return s.promise;const t=Promise.all([h(N({period:"total",limit:E,offset:0}),D),h(M(),S).catch(()=>null)]);return s={at:Date.now(),promise:t},t.catch(()=>{s?.promise===t&&(s=null)}),t}function O({enabled:t=!0}={}){const[r]=p.useState(()=>G()),[o,n]=p.useState(()=>r?{status:"ready",...r.data}:{status:"loading",tokenFloor:null,totalEntries:null,top:[]});return p.useEffect(()=>{if(!t||r?.isFresh)return;let a=!1,i=null,u=null;const y=async()=>{try{const[l,e]=await F();if(a)return;const c=Array.isArray(l?.entries)?l.entries:[],b=c.reduce((m,T)=>m+(Number(T?.total_tokens)||0),0),d=Number(e?.total_tokens)||0;d>0||(s=null);const w=Number(r?.data?.tokenFloor)||0,f=d>0?d:w>0?w:b;if(!c.length||!(f>0)){n(m=>({...m,status:"error"}));return}const g=Array.isArray(e?.top_models)?e.top_models:r?.data?.topModels||[],_={tokenFloor:f,totalEntries:Number(l?.total_entries)||c.length,top:c.slice(0,3),topModels:g,providers:Array.isArray(e?.providers)?e.providers:[],dailyGrowth:Array.isArray(e?.daily_growth)?e.daily_growth:[],tokenMix:Array.isArray(e?.token_mix)?e.token_mix:[],userDistribution:Array.isArray(e?.user_distribution)?e.user_distribution:[],platforms:Array.isArray(e?.platforms)?e.platforms:[],activeDevelopersTotal:Number(e?.active_developers_total)||0,activeDevelopers30d:Number(e?.active_developers_30d)||0,tokens30d:Number(e?.tokens_30d)||0,tokenGrowthPct:e?.token_growth_pct==null?null:Number(e.token_growth_pct),developerGrowthPct:e?.developer_growth_pct==null?null:Number(e.developer_growth_pct),generatedAt:typeof e?.generated_at=="string"?e.generated_at:null};n({status:"ready",..._}),d>0&&I(_)}catch{a||n(e=>e.status==="ready"?e:{...e,status:"error"})}};return typeof window<"u"&&"requestIdleCallback"in window?i=window.requestIdleCallback(y,{timeout:1500}):u=setTimeout(y,400),()=>{a=!0,i!=null&&typeof window.cancelIdleCallback=="function"&&window.cancelIdleCallback(i),u!=null&&clearTimeout(u)}},[t,r]),o}export{O as u};
@@ -0,0 +1 @@
1
+ import{r as a,q as M,t as B,v as q,w as G}from"./__vite-browser-external-C8KwSyTz.js";import{L as F}from"./limits-providers-F-RnNFAb.js";const l=F,g="tt.limits.providerOrder",A="tt.limits.providerVisibility",E="tt.limits.displayMode",I="tt.limits.showSubscriptions",m="tt.limits.updatedAt",V="limitsPreferences",H="limitsDisplayMode",S=Object.freeze({USED:"used",REMAINING:"remaining"}),O=new Set(Object.values(S)),_=new Set([g,A,E,I,m]);function v(){return[...l]}function h(){return Object.fromEntries(l.map(e=>[e,!0]))}function N(e){const t=[];if(Array.isArray(e))for(const o of e)l.includes(o)&&!t.includes(o)&&t.push(o);for(const o of l)t.includes(o)||t.push(o);return t}function k(e){const t=h();if(!e||typeof e!="object"||Array.isArray(e))return t;for(const o of l)typeof e[o]=="boolean"&&(t[o]=e[o]);return t}function W(e){return O.has(e)?e:S.USED}function P(e){return typeof e=="boolean"?e:!0}function w(e){if(e!=null){if(typeof e=="number")return Number.isSafeInteger(e)?e:void 0;if(typeof e=="string"){const t=e.trim();if(t==="")return;const o=Number(t);return Number.isSafeInteger(o)?o:void 0}}}function y(e={}){const t=e&&typeof e=="object"?e:{};return{displayMode:W(t.displayMode),providerOrder:N(t.providerOrder),providerVisibility:k(t.providerVisibility),showSubscriptions:P(t.showSubscriptions),updatedAt:w(t.updatedAt)}}function Q(){if(typeof window>"u")return v();try{const e=window.localStorage.getItem(g);return N(e?JSON.parse(e):void 0)}catch{return v()}}function X(){if(typeof window>"u")return h();try{const e=window.localStorage.getItem(A);return k(e?JSON.parse(e):void 0)}catch{return h()}}function Z(){if(typeof window>"u")return S.USED;try{const e=window.localStorage.getItem(E);return O.has(e)?e:S.USED}catch{return S.USED}}function $(){if(typeof window>"u")return!0;try{const e=window.localStorage.getItem(I);return e===null?!0:P(JSON.parse(e))}catch{return!0}}function ee(){if(!(typeof window>"u"))try{return w(window.localStorage.getItem(m))}catch{return}}function te(){if(typeof window>"u")return!1;try{for(const e of _)if(window.localStorage.getItem(e)!==null)return!0}catch{return!1}return!1}function b(){return y({displayMode:Z(),providerOrder:Q(),providerVisibility:X(),showSubscriptions:$(),updatedAt:ee()})}function re(e){if(typeof window>"u")return;const t=y(e);try{window.localStorage.setItem(g,JSON.stringify(t.providerOrder)),window.localStorage.setItem(A,JSON.stringify(t.providerVisibility)),window.localStorage.setItem(E,t.displayMode),window.localStorage.setItem(I,JSON.stringify(t.showSubscriptions)),t.updatedAt===void 0?window.localStorage.removeItem(m):window.localStorage.setItem(m,String(t.updatedAt))}catch(o){console.warn("[tokentracker] limits preferences localStorage write failed:",o)}}function ie(e){const t=y(e);return{displayMode:t.displayMode,providerOrder:[...t.providerOrder],providerVisibility:{...t.providerVisibility},showSubscriptions:t.showSubscriptions,updatedAt:t.updatedAt??null}}function ne(...e){let t;for(const d of e){const c=w(d);c!==void 0&&(t=t===void 0?c:Math.max(t,c))}const o=Date.now();return t!==void 0&&o<=t?t+1:o}function oe(e,t){return e.length===t.length&&e.every((o,d)=>o===t[d])}function se(e,t){return l.every(o=>e[o]===t[o])}function U(e,t){return e.displayMode===t.displayMode&&oe(e.providerOrder,t.providerOrder)&&se(e.providerVisibility,t.providerVisibility)&&e.showSubscriptions===t.showSubscriptions}function de(e,t){return U(e,t)&&w(e.updatedAt)===w(t.updatedAt)}function L(e,t){const o=w(e.updatedAt),d=w(t.updatedAt);return o!==void 0&&(d===void 0||o>d)}function ce(){const[e,t]=a.useState(b),o=a.useRef(e),d=a.useCallback((i,r={})=>{const n=y(i);return o.current=n,t(n),r.writeLocal&&re(n),n},[]),c=a.useCallback(i=>{M()&&B(V,ie(i))},[]),u=a.useCallback(i=>{const r=b(),n=L(r,o.current)?d(r):o.current,s=y(i(n));if(U(n,s))return;const f=ne(r.updatedAt,n.updatedAt),p=d({...s,updatedAt:f},{writeLocal:!0});c(p)},[d,c]),C=a.useCallback(i=>{O.has(i)&&u(r=>({...r,displayMode:i}))},[u]),x=a.useCallback(i=>{u(r=>({...r,showSubscriptions:!!i}))},[u]),D=a.useCallback(i=>{if(!O.has(i))return;const r=b();if(r.updatedAt!==void 0){d(r);return}d({...r,displayMode:i,updatedAt:void 0},{writeLocal:!0})},[d]);a.useEffect(()=>{if(!M())return;const i=q(r=>{const n=r?.[V];if(n&&typeof n=="object"){const s=y(n);if(!te()){d(s,{writeLocal:!0});return}const f=b();if(L(s,f))d(s,{writeLocal:!0});else{const p=d(f);de(s,f)||c(p)}return}D(r?.[H])});return G(),i},[D,d,c]),a.useEffect(()=>{if(typeof window>"u")return;const i=r=>{(r.key===null||_.has(r.key))&&d(b())};return window.addEventListener("storage",i),()=>window.removeEventListener("storage",i)},[d]);const R=a.useCallback(i=>{l.includes(i)&&u(r=>({...r,providerVisibility:{...r.providerVisibility,[i]:!r.providerVisibility[i]}}))},[u]),Y=a.useCallback(i=>{u(r=>{const n=r.providerOrder.indexOf(i);if(n<=0)return r;const s=[...r.providerOrder];return[s[n-1],s[n]]=[s[n],s[n-1]],{...r,providerOrder:s}})},[u]),T=a.useCallback(i=>{u(r=>{const n=r.providerOrder.indexOf(i);if(n<0||n>=r.providerOrder.length-1)return r;const s=[...r.providerOrder];return[s[n],s[n+1]]=[s[n+1],s[n]],{...r,providerOrder:s}})},[u]),z=a.useCallback((i,r)=>{i!==r&&u(n=>{const s=n.providerOrder.indexOf(i),f=n.providerOrder.indexOf(r);if(s<0||f<0)return n;const p=[...n.providerOrder],[J]=p.splice(s,1);return p.splice(f,0,J),{...n,providerOrder:p}})},[u]),K=a.useCallback(()=>{u(()=>({displayMode:S.USED,providerOrder:v(),providerVisibility:h(),showSubscriptions:!0}))},[u]),j=a.useMemo(()=>e.providerOrder.filter(i=>e.providerVisibility[i]!==!1),[e.providerOrder,e.providerVisibility]);return{order:e.providerOrder,visibility:e.providerVisibility,displayMode:e.displayMode,showSubscriptions:e.showSubscriptions,setDisplayMode:C,setShowSubscriptions:x,visibleOrdered:j,toggle:R,moveUp:Y,moveDown:T,moveToward:z,reset:K}}export{S as L,ce as u};
@@ -1 +1 @@
1
- import{r as f}from"./__vite-browser-external-CsbVaBbw.js";function O(t){if(typeof window>"u")return null;try{const n=window.localStorage.getItem(t);if(!n)return null;const i=JSON.parse(n);return Array.isArray(i)?i.filter(o=>typeof o=="string"):null}catch{return null}}function m(t,n){if(!(typeof window>"u"))try{window.localStorage.setItem(t,JSON.stringify(n))}catch{}}function S(t,n){if(!t)return n;const i=new Set(n),o=t.filter(u=>i.has(u)),c=n.filter(u=>!o.includes(u));return[...o,...c]}function p(t,n){const i=f.useMemo(()=>n.join("|"),[n]),[o,c]=f.useState(()=>S(O(t),n));f.useEffect(()=>{c(r=>{const e=S(r,n);return e.length===r.length&&e.every((l,d)=>l===r[d])?r:(m(t,e),e)})},[i,n,t]);const u=f.useCallback((r,e)=>{!r||!e||r===e||c(s=>{const l=s.indexOf(r),d=s.indexOf(e);if(l===-1||d===-1)return s;const w=s.slice(),[h]=w.splice(l,1);return w.splice(d,0,h),m(t,w),w})},[t]),a=f.useCallback(()=>{m(t,n),c(n)},[t,n]);return{order:o,reorder:u,reset:a}}export{p as u};
1
+ import{r as f}from"./__vite-browser-external-C8KwSyTz.js";function O(t){if(typeof window>"u")return null;try{const n=window.localStorage.getItem(t);if(!n)return null;const i=JSON.parse(n);return Array.isArray(i)?i.filter(o=>typeof o=="string"):null}catch{return null}}function m(t,n){if(!(typeof window>"u"))try{window.localStorage.setItem(t,JSON.stringify(n))}catch{}}function S(t,n){if(!t)return n;const i=new Set(n),o=t.filter(u=>i.has(u)),c=n.filter(u=>!o.includes(u));return[...o,...c]}function p(t,n){const i=f.useMemo(()=>n.join("|"),[n]),[o,c]=f.useState(()=>S(O(t),n));f.useEffect(()=>{c(r=>{const e=S(r,n);return e.length===r.length&&e.every((l,d)=>l===r[d])?r:(m(t,e),e)})},[i,n,t]);const u=f.useCallback((r,e)=>{!r||!e||r===e||c(s=>{const l=s.indexOf(r),d=s.indexOf(e);if(l===-1||d===-1)return s;const w=s.slice(),[h]=w.splice(l,1);return w.splice(d,0,h),m(t,w),w})},[t]),a=f.useCallback(()=>{m(t,n),c(n)},[t,n]);return{order:o,reorder:u,reset:a}}export{p as u};
@@ -0,0 +1 @@
1
+ import{r as o}from"./__vite-browser-external-C8KwSyTz.js";import{h as r,i as t,p as s}from"./react-BYw5AVSz.js";function i(){!r.current&&t();const[e]=o.useState(s.current);return e}export{i as u};
@@ -1 +1 @@
1
- import{m as u,r as n}from"./__vite-browser-external-CsbVaBbw.js";const f=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],E=u("pencil",f),i="tt.qualityPerDollar.enabled";function l(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(i)==="1"}catch{return!1}}function y(){const[r,o]=n.useState(l);n.useEffect(()=>{if(typeof window>"u")return;const t=e=>{(e.key===null||e.key===i)&&o(l())};return window.addEventListener("storage",t),()=>window.removeEventListener("storage",t)},[]);const a=n.useCallback(t=>{const e=!!t;o(e);try{window.localStorage.setItem(i,e?"1":"0")}catch{}},[]),s=n.useCallback(()=>a(!l()),[a]);return{enabled:r,setEnabled:a,toggle:s}}const d="tt.sessionEfficiency.enabled";function c(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(d)==="1"}catch{return!1}}function g(){const[r,o]=n.useState(c);n.useEffect(()=>{if(typeof window>"u")return;const t=e=>{(e.key===null||e.key===d)&&o(c())};return window.addEventListener("storage",t),()=>window.removeEventListener("storage",t)},[]);const a=n.useCallback(t=>{const e=!!t;o(e);try{window.localStorage.setItem(d,e?"1":"0")}catch{}},[]),s=n.useCallback(()=>a(!c()),[a]);return{enabled:r,setEnabled:a,toggle:s}}export{E as P,g as a,y as u};
1
+ import{m as u,r as n}from"./__vite-browser-external-C8KwSyTz.js";const f=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],E=u("pencil",f),i="tt.qualityPerDollar.enabled";function l(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(i)==="1"}catch{return!1}}function y(){const[r,o]=n.useState(l);n.useEffect(()=>{if(typeof window>"u")return;const t=e=>{(e.key===null||e.key===i)&&o(l())};return window.addEventListener("storage",t),()=>window.removeEventListener("storage",t)},[]);const a=n.useCallback(t=>{const e=!!t;o(e);try{window.localStorage.setItem(i,e?"1":"0")}catch{}},[]),s=n.useCallback(()=>a(!l()),[a]);return{enabled:r,setEnabled:a,toggle:s}}const d="tt.sessionEfficiency.enabled";function c(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(d)==="1"}catch{return!1}}function g(){const[r,o]=n.useState(c);n.useEffect(()=>{if(typeof window>"u")return;const t=e=>{(e.key===null||e.key===d)&&o(c())};return window.addEventListener("storage",t),()=>window.removeEventListener("storage",t)},[]);const a=n.useCallback(t=>{const e=!!t;o(e);try{window.localStorage.setItem(d,e?"1":"0")}catch{}},[]),s=n.useCallback(()=>a(!c()),[a]);return{enabled:r,setEnabled:a,toggle:s}}export{E as P,g as a,y as u};
@@ -1 +1 @@
1
- import{d as y,u as l,e as A,M as p,b as h,f as C,g as V,j as u}from"./react-D3Afmy9b.js";import{r as f}from"./__vite-browser-external-CsbVaBbw.js";function x(...t){const e=!Array.isArray(t[0]),n=e?0:-1,o=t[0+n],s=t[1+n],c=t[2+n],r=t[3+n],a=y(s,c,r);return e?a(o):a}function E(t){const e=l(()=>A(t)),{isStatic:n}=f.useContext(p);if(n){const[,o]=f.useState(t);f.useEffect(()=>e.on("change",o),[])}return e}function m(t,e){const n=E(e()),o=()=>n.set(e());return o(),h(()=>{const s=()=>V.preRender(o,!1,!0),c=t.map(r=>r.on("change",s));return()=>{c.forEach(r=>r()),C(o)}}),n}function L(t){u.current=[],t();const e=m(u.current,t);return u.current=void 0,e}function g(t,e,n,o){if(typeof t=="function")return L(t);const c=typeof e=="function"?e:x(e,n,o),r=Array.isArray(t)?i(t,c):i([t],([d])=>c(d)),a=Array.isArray(t)?void 0:t.accelerate;return a&&!a.isTransformed&&typeof e!="function"&&Array.isArray(n)&&o?.clamp!==!1&&(r.accelerate={...a,times:e,keyframes:n,isTransformed:!0}),r}function i(t,e){const n=l(()=>[]);return m(t,()=>{n.length=0;const o=t.length;for(let s=0;s<o;s++)n[s]=t[s].get();return e(n)})}export{g as a,E as u};
1
+ import{d as y,u as l,e as A,M as p,b as h,f as C,g as V,j as u}from"./react-BYw5AVSz.js";import{r as f}from"./__vite-browser-external-C8KwSyTz.js";function x(...t){const e=!Array.isArray(t[0]),n=e?0:-1,o=t[0+n],s=t[1+n],c=t[2+n],r=t[3+n],a=y(s,c,r);return e?a(o):a}function E(t){const e=l(()=>A(t)),{isStatic:n}=f.useContext(p);if(n){const[,o]=f.useState(t);f.useEffect(()=>e.on("change",o),[])}return e}function m(t,e){const n=E(e()),o=()=>n.set(e());return o(),h(()=>{const s=()=>V.preRender(o,!1,!0),c=t.map(r=>r.on("change",s));return()=>{c.forEach(r=>r()),C(o)}}),n}function L(t){u.current=[],t();const e=m(u.current,t);return u.current=void 0,e}function g(t,e,n,o){if(typeof t=="function")return L(t);const c=typeof e=="function"?e:x(e,n,o),r=Array.isArray(t)?i(t,c):i([t],([d])=>c(d)),a=Array.isArray(t)?void 0:t.accelerate;return a&&!a.isTransformed&&typeof e!="function"&&Array.isArray(n)&&o?.clamp!==!1&&(r.accelerate={...a,times:e,keyframes:n,isTransformed:!0}),r}function i(t,e){const n=l(()=>[]);return m(t,()=>{n.length=0;const o=t.length;for(let s=0;s<o;s++)n[s]=t[s].get();return e(n)})}export{g as a,E as u};
@@ -1 +1 @@
1
- import{q as b,ac as v,r as c,c as g,ad as F,ae as x,af as f}from"./__vite-browser-external-CsbVaBbw.js";import{l as M}from"./limits-providers-B9L6hIZT.js";const S="native:notificationPermission";let E=null;function N(){return typeof window<"u"&&!!window.chrome?.webview}function K(){return b()?E||"unknown":N()?"granted":typeof Notification>"u"?"unsupported":Notification.permission}function L(e){if(typeof window>"u")return()=>{};const i=t=>{const a=t?.detail?.status;typeof a=="string"&&(E=a),e(K())};return window.addEventListener(S,i),e(K()),b()&&v({type:"getNotificationStatus"}),()=>window.removeEventListener(S,i)}async function I(){if(b()){v({type:"requestNotificationPermission"});return}N()||typeof Notification<"u"&&Notification.permission==="default"&&await Notification.requestPermission().catch(()=>"denied")}const p="tt.limitAlerts.enabled";function O(){try{return window.localStorage.getItem(p)==="1"}catch{return!1}}function U(){const[e,i]=c.useState(O),[t,a]=c.useState("unknown");c.useEffect(()=>L(a),[]);const y=c.useCallback(async n=>{const l=!!n;l&&await I();try{window.localStorage.setItem(p,l?"1":"0")}catch{}i(l)},[]);return{enabled:e,setEnabled:y,permissionBlocked:t==="denied"}}function A(e,i){if(!(e>0))return null;const t=(e-i)/e;return Number.isFinite(t)?Math.min(Math.max(t,0),1):null}function z(e,i,t=.03){return e>i+t}function D(e){const i=Math.max(0,Math.floor(e)),t=Math.floor(i/3600);return t>24?`${Math.floor(t/24)}d`:t>0?`${t}h`:`${Math.floor(i/60)}m`}function q(e,i){if(typeof e.windowSeconds=="number")return e.windowSeconds;if(e.windowSecondsField&&i){const t=i[e.windowSecondsField];return typeof t=="number"&&t>0?t:null}return null}function j(e){return e==null?NaN:typeof e=="number"?e*1e3:Date.parse(e)}function C({usedPercent:e,windowSeconds:i,resetMs:t,mode:a,now:y=Date.now()}){const n=Math.min(Math.max(Number(e)||0,0),100)/100,l={pacePercent:null,paceOver:!1,expectedPercent:null,runsOutEta:null,projectedEnd:null};if(!(i>0)||!Number.isFinite(t))return l;const r=Math.max(0,(t-y)/1e3),s=A(i,r);if(s==null)return l;if(l.expectedPercent=Math.round(s*100),l.paceOver=z(n,s),n>=.05){const u=a==="remaining"?1-s:s;l.pacePercent=u*100}if(s>.02&&n>0){const u=i*s,w=n/u,m=n/s;m>=1&&w>0?l.runsOutEta=D((1-n)/w):l.projectedEnd=Math.round(Math.min(m,1)*100)}return l}const R={claude:{windows(e){const i=Array.isArray(e.weekly_scoped)?e.weekly_scoped.map(t=>({key:`scoped-${t.label}`,label:t.label,window:t,pctField:"utilization",resetField:"resets_at",windowSeconds:604800})):[];return[{key:"5h",labelKey:"limits.label.claude_5h",window:e.five_hour,pctField:"utilization",resetField:"resets_at",windowSeconds:5*3600},{key:"7d",labelKey:"limits.label.claude_7d",window:e.seven_day,pctField:"utilization",resetField:"resets_at",windowSeconds:7*86400},{key:"opus",labelKey:"limits.label.claude_opus",window:e.seven_day_opus,pctField:"utilization",resetField:"resets_at",windowSeconds:7*86400},...i]}},codex:{extra:"codex_meta",windows(e){return[{key:"5h",labelKey:"limits.label.codex_5h",window:e.primary_window,windowSecondsField:"limit_window_seconds"},{key:"7d",labelKey:"limits.label.codex_7d",window:e.secondary_window,windowSecondsField:"limit_window_seconds"},{key:"credits",labelKey:"limits.label.codex_credits",window:e.credit_window},{key:"spark-5h",labelKey:"limits.label.codex_spark_5h",window:e.spark_primary_window,windowSecondsField:"limit_window_seconds"},{key:"spark-7d",labelKey:"limits.label.codex_spark_7d",window:e.spark_secondary_window,windowSecondsField:"limit_window_seconds"}]}},cursor:{windows(e){return[{key:"plan",labelKey:"limits.label.cursor_plan",window:e.primary_window,windowSecondsField:"limit_window_seconds"},{key:"auto",labelKey:"limits.label.cursor_auto",window:e.secondary_window,windowSecondsField:"limit_window_seconds"},{key:"api",labelKey:"limits.label.cursor_api",window:e.tertiary_window,windowSecondsField:"limit_window_seconds"},{key:"grok-bot",labelKey:"limits.label.cursor_grok_bot",window:e.quaternary_window,windowSecondsField:"limit_window_seconds"}]}},gemini:{windows(e){return[{key:"pro",labelKey:"limits.label.gemini_pro",window:e.primary_window},{key:"flash",labelKey:"limits.label.gemini_flash",window:e.secondary_window},{key:"lite",labelKey:"limits.label.gemini_lite",window:e.tertiary_window}]}},kimi:{extra:"kimi_parallel",windows(e){return[{key:"weekly",labelKey:"limits.label.kimi_weekly",window:e.primary_window,windowSeconds:7*86400},{key:"5h",labelKey:"limits.label.kimi_5h",window:e.secondary_window,windowSeconds:5*3600},{key:"total",labelKey:"limits.label.kimi_total",window:e.tertiary_window}]}},kiro:{extra:"kiro_credits",windows(e){return[{key:"month",labelKey:"limits.label.kiro_month",window:e.primary_window},{key:"bonus",labelKey:"limits.label.kiro_bonus",window:e.secondary_window}]}},grok:{windows(e){const i=typeof e.period_type=="string"?e.period_type:null,t=i==="weekly"?"limits.label.grok_week":i==="daily"?"limits.label.grok_day":"limits.label.grok_month",a=i==="weekly"?7*86400:i==="daily"?86400:void 0;return[{key:i==="weekly"?"week":i==="daily"?"day":"month",labelKey:t,window:e.primary_window,windowSeconds:a},{key:"ondemand",labelKey:"limits.label.grok_ondemand",window:e.secondary_window}]}},antigravity:{windows(e){return[{key:"claude-weekly",labelKey:"limits.label.antigravity_claude_weekly",window:e.primary_window},{key:"claude-5h",labelKey:"limits.label.antigravity_claude_5h",window:e.secondary_window},{key:"gemini-weekly",labelKey:"limits.label.antigravity_gemini_weekly",window:e.tertiary_window},{key:"gemini-5h",labelKey:"limits.label.antigravity_gemini_5h",window:e.quaternary_window}]}},copilot:{extra:"copilot_otel",windows(e){return[{key:"premium",labelKey:"limits.label.copilot_premium",window:e.primary_window},{key:"chat",labelKey:"limits.label.copilot_chat",window:e.secondary_window}]}},zcode:{windows(e){return e.plan_kind==="coding-plan"?[{key:"5h",labelKey:"limits.label.zcode_5h",window:e.primary_window},{key:"weekly",labelKey:"limits.label.zcode_weekly",window:e.secondary_window},{key:"tools",labelKey:"limits.label.zcode_tools",window:e.tertiary_window}]:[{key:"glm52",labelKey:"limits.label.zcode_glm52",window:e.primary_window},{key:"glm5t",labelKey:"limits.label.zcode_glm5t",window:e.secondary_window}]}},opencodeGo:{windows(e){return[{key:"5h",labelKey:"limits.label.opencode_go_5h",window:e.primary_window},{key:"weekly",labelKey:"limits.label.opencode_go_weekly",window:e.secondary_window},{key:"monthly",labelKey:"limits.label.opencode_go_monthly",window:e.tertiary_window}]}},qoder:{windows(e){return[{key:"credits",labelKey:"limits.label.qoder_credits",window:e.primary_window},{key:"ultimate",labelKey:"limits.label.qoder_ultimate",window:e.secondary_window,timeKind:"expiry"}]}},qoderCn:{windows(e){return[{key:"credits",labelKey:"limits.label.qoder_cn_credits",window:e.primary_window},{key:"ultimate",labelKey:"limits.label.qoder_cn_ultimate",window:e.secondary_window,timeKind:"expiry"}]}},codingPlan:{windows(e){return[{key:"5h",labelKey:"limits.label.ark_coding_plan_5h",window:e.primary_window},{key:"weekly",labelKey:"limits.label.ark_coding_plan_weekly",window:e.secondary_window},{key:"monthly",labelKey:"limits.label.ark_coding_plan_monthly",window:e.tertiary_window}]}}},P="tt.limitAlerts.cycles.v1";function T(){try{return JSON.parse(window.localStorage.getItem(P)||"{}")}catch{return{}}}function $(e){try{window.localStorage.setItem(P,JSON.stringify(e))}catch{}}function B(e,{now:i=Date.now()}={}){const t=[],a=R;for(const[y,n]of Object.entries(e||{})){const l=a[y];if(!(!n?.configured||n.error||!l))for(const r of l.windows(n)){if(!r.window)continue;const s=Number(r.pctField==="utilization"?r.window.utilization:r.window.used_percent),u=r.resetField==="resets_at"?r.window.resets_at:r.window.reset_at,w=j(u),m=C({usedPercent:s,windowSeconds:q(r,r.window),resetMs:w,mode:"used",now:i});!m.runsOutEta||!m.paceOver||s<20||!(w>i)||t.push({id:`${y}:${r.key}:${w}`,providerId:y,windowKey:r.key,resetMs:w,usedPercent:s,runsOutEta:m.runsOutEta})}}return t}function V(e){const i=T(),t=B(e);for(const n of t){if(i[n.id])continue;const l=M(n.providerId),r=g("limits.alert.title",{provider:l}),s=g("limits.alert.body",{eta:n.runsOutEta,percent:Math.round(n.usedPercent)});let u=F({title:r,body:s,id:n.id});!u&&typeof Notification<"u"&&Notification.permission==="granted"&&(new Notification(r,{body:s,tag:n.id}),u=!0),u&&(i[n.id]=Date.now())}const a=Date.now()-864e5,y=Object.fromEntries(Object.entries(i).filter(([n,l])=>{const r=Number(n.split(":").at(-1));return Number.isFinite(r)?r>=a:Number(l)>=a}).slice(-100));return $(y),t.length}function W(e){const i=!!e?.initialState,[t,a]=c.useState(()=>i?e?.initialState?.data??null:null),[y,n]=c.useState(()=>i?e?.initialState?.error??null:null),[l,r]=c.useState(!i),s=!!e?.initialRefresh,u=!!e?.publishToPreloadCache;c.useEffect(()=>{if(!(!t||typeof window>"u"))try{window.localStorage.getItem(p)==="1"&&V(t)}catch{}},[t]);const w=c.useCallback((o,d)=>{!u||!o||typeof o!="object"||x(o,{source:d})},[u]),m=c.useCallback(async()=>{try{const o=await f({refresh:!0}),d=o&&typeof o=="object"?o:null;a(d),n(null),w(d,"manual-refresh")}catch(o){n(o?.message||String(o))}},[w]),k=c.useCallback(async()=>{try{const o=await f(),d=o&&typeof o=="object"?o:null;a(d),n(null),w(d,"page-load")}catch(o){n(o?.message||String(o))}},[w]);return c.useEffect(()=>{if(typeof window>"u"||typeof document>"u")return;const o=15e3;let d=Date.now();const _=()=>{if(document.visibilityState!=="visible")return;const h=Date.now();h-d<o||(d=h,k())};return window.addEventListener("focus",_),document.addEventListener("visibilitychange",_),()=>{window.removeEventListener("focus",_),document.removeEventListener("visibilitychange",_)}},[k]),c.useEffect(()=>{if(i&&!s)return;let o=!1;return(async()=>{try{const d=await f();if(o)return;const _=d&&typeof d=="object"?d:null;a(_),n(null),w(_,"page-load")}catch(d){if(o)return;n(d?.message||String(d))}finally{o||r(!1)}})(),()=>{o=!0}},[i,s,w]),{data:t,error:y,isLoading:l,refresh:m}}export{R as P,q as a,U as b,C as c,j as r,V as s,W as u};
1
+ import{q as b,ac as v,r as c,c as g,ad as F,ae as x,af as f}from"./__vite-browser-external-C8KwSyTz.js";import{l as M}from"./limits-providers-F-RnNFAb.js";const S="native:notificationPermission";let E=null;function N(){return typeof window<"u"&&!!window.chrome?.webview}function K(){return b()?E||"unknown":N()?"granted":typeof Notification>"u"?"unsupported":Notification.permission}function L(e){if(typeof window>"u")return()=>{};const i=t=>{const a=t?.detail?.status;typeof a=="string"&&(E=a),e(K())};return window.addEventListener(S,i),e(K()),b()&&v({type:"getNotificationStatus"}),()=>window.removeEventListener(S,i)}async function I(){if(b()){v({type:"requestNotificationPermission"});return}N()||typeof Notification<"u"&&Notification.permission==="default"&&await Notification.requestPermission().catch(()=>"denied")}const p="tt.limitAlerts.enabled";function O(){try{return window.localStorage.getItem(p)==="1"}catch{return!1}}function U(){const[e,i]=c.useState(O),[t,a]=c.useState("unknown");c.useEffect(()=>L(a),[]);const y=c.useCallback(async n=>{const l=!!n;l&&await I();try{window.localStorage.setItem(p,l?"1":"0")}catch{}i(l)},[]);return{enabled:e,setEnabled:y,permissionBlocked:t==="denied"}}function A(e,i){if(!(e>0))return null;const t=(e-i)/e;return Number.isFinite(t)?Math.min(Math.max(t,0),1):null}function z(e,i,t=.03){return e>i+t}function D(e){const i=Math.max(0,Math.floor(e)),t=Math.floor(i/3600);return t>24?`${Math.floor(t/24)}d`:t>0?`${t}h`:`${Math.floor(i/60)}m`}function q(e,i){if(typeof e.windowSeconds=="number")return e.windowSeconds;if(e.windowSecondsField&&i){const t=i[e.windowSecondsField];return typeof t=="number"&&t>0?t:null}return null}function j(e){return e==null?NaN:typeof e=="number"?e*1e3:Date.parse(e)}function C({usedPercent:e,windowSeconds:i,resetMs:t,mode:a,now:y=Date.now()}){const n=Math.min(Math.max(Number(e)||0,0),100)/100,l={pacePercent:null,paceOver:!1,expectedPercent:null,runsOutEta:null,projectedEnd:null};if(!(i>0)||!Number.isFinite(t))return l;const r=Math.max(0,(t-y)/1e3),s=A(i,r);if(s==null)return l;if(l.expectedPercent=Math.round(s*100),l.paceOver=z(n,s),n>=.05){const u=a==="remaining"?1-s:s;l.pacePercent=u*100}if(s>.02&&n>0){const u=i*s,w=n/u,m=n/s;m>=1&&w>0?l.runsOutEta=D((1-n)/w):l.projectedEnd=Math.round(Math.min(m,1)*100)}return l}const R={claude:{windows(e){const i=Array.isArray(e.weekly_scoped)?e.weekly_scoped.map(t=>({key:`scoped-${t.label}`,label:t.label,window:t,pctField:"utilization",resetField:"resets_at",windowSeconds:604800})):[];return[{key:"5h",labelKey:"limits.label.claude_5h",window:e.five_hour,pctField:"utilization",resetField:"resets_at",windowSeconds:5*3600},{key:"7d",labelKey:"limits.label.claude_7d",window:e.seven_day,pctField:"utilization",resetField:"resets_at",windowSeconds:7*86400},{key:"opus",labelKey:"limits.label.claude_opus",window:e.seven_day_opus,pctField:"utilization",resetField:"resets_at",windowSeconds:7*86400},...i]}},codex:{extra:"codex_meta",windows(e){return[{key:"5h",labelKey:"limits.label.codex_5h",window:e.primary_window,windowSecondsField:"limit_window_seconds"},{key:"7d",labelKey:"limits.label.codex_7d",window:e.secondary_window,windowSecondsField:"limit_window_seconds"},{key:"credits",labelKey:"limits.label.codex_credits",window:e.credit_window},{key:"spark-5h",labelKey:"limits.label.codex_spark_5h",window:e.spark_primary_window,windowSecondsField:"limit_window_seconds"},{key:"spark-7d",labelKey:"limits.label.codex_spark_7d",window:e.spark_secondary_window,windowSecondsField:"limit_window_seconds"}]}},cursor:{windows(e){return[{key:"plan",labelKey:"limits.label.cursor_plan",window:e.primary_window,windowSecondsField:"limit_window_seconds"},{key:"auto",labelKey:"limits.label.cursor_auto",window:e.secondary_window,windowSecondsField:"limit_window_seconds"},{key:"api",labelKey:"limits.label.cursor_api",window:e.tertiary_window,windowSecondsField:"limit_window_seconds"},{key:"grok-bot",labelKey:"limits.label.cursor_grok_bot",window:e.quaternary_window,windowSecondsField:"limit_window_seconds"}]}},gemini:{windows(e){return[{key:"pro",labelKey:"limits.label.gemini_pro",window:e.primary_window},{key:"flash",labelKey:"limits.label.gemini_flash",window:e.secondary_window},{key:"lite",labelKey:"limits.label.gemini_lite",window:e.tertiary_window}]}},kimi:{extra:"kimi_parallel",windows(e){return[{key:"weekly",labelKey:"limits.label.kimi_weekly",window:e.primary_window,windowSeconds:7*86400},{key:"5h",labelKey:"limits.label.kimi_5h",window:e.secondary_window,windowSeconds:5*3600},{key:"total",labelKey:"limits.label.kimi_total",window:e.tertiary_window}]}},kiro:{extra:"kiro_credits",windows(e){return[{key:"month",labelKey:"limits.label.kiro_month",window:e.primary_window},{key:"bonus",labelKey:"limits.label.kiro_bonus",window:e.secondary_window}]}},grok:{windows(e){const i=typeof e.period_type=="string"?e.period_type:null,t=i==="weekly"?"limits.label.grok_week":i==="daily"?"limits.label.grok_day":"limits.label.grok_month",a=i==="weekly"?7*86400:i==="daily"?86400:void 0;return[{key:i==="weekly"?"week":i==="daily"?"day":"month",labelKey:t,window:e.primary_window,windowSeconds:a},{key:"ondemand",labelKey:"limits.label.grok_ondemand",window:e.secondary_window}]}},antigravity:{windows(e){return[{key:"claude-weekly",labelKey:"limits.label.antigravity_claude_weekly",window:e.primary_window},{key:"claude-5h",labelKey:"limits.label.antigravity_claude_5h",window:e.secondary_window},{key:"gemini-weekly",labelKey:"limits.label.antigravity_gemini_weekly",window:e.tertiary_window},{key:"gemini-5h",labelKey:"limits.label.antigravity_gemini_5h",window:e.quaternary_window}]}},copilot:{extra:"copilot_otel",windows(e){return[{key:"premium",labelKey:"limits.label.copilot_premium",window:e.primary_window},{key:"chat",labelKey:"limits.label.copilot_chat",window:e.secondary_window}]}},zcode:{windows(e){return e.plan_kind==="coding-plan"?[{key:"5h",labelKey:"limits.label.zcode_5h",window:e.primary_window},{key:"weekly",labelKey:"limits.label.zcode_weekly",window:e.secondary_window},{key:"tools",labelKey:"limits.label.zcode_tools",window:e.tertiary_window}]:[{key:"glm52",labelKey:"limits.label.zcode_glm52",window:e.primary_window},{key:"glm5t",labelKey:"limits.label.zcode_glm5t",window:e.secondary_window}]}},opencodeGo:{windows(e){return[{key:"5h",labelKey:"limits.label.opencode_go_5h",window:e.primary_window},{key:"weekly",labelKey:"limits.label.opencode_go_weekly",window:e.secondary_window},{key:"monthly",labelKey:"limits.label.opencode_go_monthly",window:e.tertiary_window}]}},qoder:{windows(e){return[{key:"credits",labelKey:"limits.label.qoder_credits",window:e.primary_window},{key:"ultimate",labelKey:"limits.label.qoder_ultimate",window:e.secondary_window,timeKind:"expiry"}]}},qoderCn:{windows(e){return[{key:"credits",labelKey:"limits.label.qoder_cn_credits",window:e.primary_window},{key:"ultimate",labelKey:"limits.label.qoder_cn_ultimate",window:e.secondary_window,timeKind:"expiry"}]}},codingPlan:{windows(e){return[{key:"5h",labelKey:"limits.label.ark_coding_plan_5h",window:e.primary_window},{key:"weekly",labelKey:"limits.label.ark_coding_plan_weekly",window:e.secondary_window},{key:"monthly",labelKey:"limits.label.ark_coding_plan_monthly",window:e.tertiary_window}]}}},P="tt.limitAlerts.cycles.v1";function T(){try{return JSON.parse(window.localStorage.getItem(P)||"{}")}catch{return{}}}function $(e){try{window.localStorage.setItem(P,JSON.stringify(e))}catch{}}function B(e,{now:i=Date.now()}={}){const t=[],a=R;for(const[y,n]of Object.entries(e||{})){const l=a[y];if(!(!n?.configured||n.error||!l))for(const r of l.windows(n)){if(!r.window)continue;const s=Number(r.pctField==="utilization"?r.window.utilization:r.window.used_percent),u=r.resetField==="resets_at"?r.window.resets_at:r.window.reset_at,w=j(u),m=C({usedPercent:s,windowSeconds:q(r,r.window),resetMs:w,mode:"used",now:i});!m.runsOutEta||!m.paceOver||s<20||!(w>i)||t.push({id:`${y}:${r.key}:${w}`,providerId:y,windowKey:r.key,resetMs:w,usedPercent:s,runsOutEta:m.runsOutEta})}}return t}function V(e){const i=T(),t=B(e);for(const n of t){if(i[n.id])continue;const l=M(n.providerId),r=g("limits.alert.title",{provider:l}),s=g("limits.alert.body",{eta:n.runsOutEta,percent:Math.round(n.usedPercent)});let u=F({title:r,body:s,id:n.id});!u&&typeof Notification<"u"&&Notification.permission==="granted"&&(new Notification(r,{body:s,tag:n.id}),u=!0),u&&(i[n.id]=Date.now())}const a=Date.now()-864e5,y=Object.fromEntries(Object.entries(i).filter(([n,l])=>{const r=Number(n.split(":").at(-1));return Number.isFinite(r)?r>=a:Number(l)>=a}).slice(-100));return $(y),t.length}function W(e){const i=!!e?.initialState,[t,a]=c.useState(()=>i?e?.initialState?.data??null:null),[y,n]=c.useState(()=>i?e?.initialState?.error??null:null),[l,r]=c.useState(!i),s=!!e?.initialRefresh,u=!!e?.publishToPreloadCache;c.useEffect(()=>{if(!(!t||typeof window>"u"))try{window.localStorage.getItem(p)==="1"&&V(t)}catch{}},[t]);const w=c.useCallback((o,d)=>{!u||!o||typeof o!="object"||x(o,{source:d})},[u]),m=c.useCallback(async()=>{try{const o=await f({refresh:!0}),d=o&&typeof o=="object"?o:null;a(d),n(null),w(d,"manual-refresh")}catch(o){n(o?.message||String(o))}},[w]),k=c.useCallback(async()=>{try{const o=await f(),d=o&&typeof o=="object"?o:null;a(d),n(null),w(d,"page-load")}catch(o){n(o?.message||String(o))}},[w]);return c.useEffect(()=>{if(typeof window>"u"||typeof document>"u")return;const o=15e3;let d=Date.now();const _=()=>{if(document.visibilityState!=="visible")return;const h=Date.now();h-d<o||(d=h,k())};return window.addEventListener("focus",_),document.addEventListener("visibilitychange",_),()=>{window.removeEventListener("focus",_),document.removeEventListener("visibilitychange",_)}},[k]),c.useEffect(()=>{if(i&&!s)return;let o=!1;return(async()=>{try{const d=await f();if(o)return;const _=d&&typeof d=="object"?d:null;a(_),n(null),w(_,"page-load")}catch(d){if(o)return;n(d?.message||String(d))}finally{o||r(!1)}})(),()=>{o=!0}},[i,s,w]),{data:t,error:y,isLoading:l,refresh:m}}export{R as P,q as a,U as b,C as c,j as r,V as s,W as u};
@@ -1 +1 @@
1
- import{r as e,C as t,D as r,x as c}from"./__vite-browser-external-CsbVaBbw.js";const s=Object.freeze({currency:c,rate:1,symbol:"$",rates:{...r},rateSource:"default",rateFetchedAt:null,setCurrency:()=>{}});function a(){return e.useContext(t)??s}export{a as u};
1
+ import{r as e,C as t,D as r,x as c}from"./__vite-browser-external-C8KwSyTz.js";const s=Object.freeze({currency:c,rate:1,symbol:"$",rates:{...r},rateSource:"default",rateFetchedAt:null,setCurrency:()=>{}});function a(){return e.useContext(t)??s}export{a as u};
@@ -1 +1 @@
1
- import{r as e,T as r,n,o as a,p as s}from"./__vite-browser-external-CsbVaBbw.js";const T=Object.freeze({mode:n.COMPACT,setMode:()=>{},formatTokens:(o,t={})=>s(o,t),formatTokensTooltip:(o,t={})=>a(o,t)});function f(){return e.useContext(r)??T}export{f as u};
1
+ import{r as e,T as r,n,o as a,p as s}from"./__vite-browser-external-C8KwSyTz.js";const T=Object.freeze({mode:n.COMPACT,setMode:()=>{},formatTokens:(o,t={})=>s(o,t),formatTokensTooltip:(o,t={})=>a(o,t)});function f(){return e.useContext(r)??T}export{f as u};
@@ -1 +1 @@
1
- import{m as a}from"./__vite-browser-external-CsbVaBbw.js";const o=[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z",key:"1v7up4"}]],e=a("zap",o);export{e as Z};
1
+ import{m as a}from"./__vite-browser-external-C8KwSyTz.js";const o=[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z",key:"1v7up4"}]],e=a("zap",o);export{e as Z};
@@ -264,8 +264,8 @@
264
264
  ]
265
265
  }
266
266
  </script>
267
- <script type="module" crossorigin src="/assets/__vite-browser-external-CsbVaBbw.js"></script>
268
- <link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-D95WhsZe.css">
267
+ <script type="module" crossorigin src="/assets/__vite-browser-external-C8KwSyTz.js"></script>
268
+ <link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-BHz2N7Ih.css">
269
269
  </head>
270
270
  <body>
271
271
  <main class="aeo-seed-content" aria-label="Token Tracker AI-readable summary">
@@ -165,8 +165,8 @@
165
165
  ]
166
166
  }
167
167
  </script>
168
- <script type="module" crossorigin src="/assets/__vite-browser-external-CsbVaBbw.js"></script>
169
- <link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-D95WhsZe.css">
168
+ <script type="module" crossorigin src="/assets/__vite-browser-external-C8KwSyTz.js"></script>
169
+ <link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-BHz2N7Ih.css">
170
170
  </head>
171
171
  <body>
172
172
  <main class="aeo-seed-content" aria-label="Claude IP Check AI-readable summary">
@@ -136,8 +136,8 @@
136
136
  ]
137
137
  }
138
138
  </script>
139
- <script type="module" crossorigin src="/assets/__vite-browser-external-CsbVaBbw.js"></script>
140
- <link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-D95WhsZe.css">
139
+ <script type="module" crossorigin src="/assets/__vite-browser-external-C8KwSyTz.js"></script>
140
+ <link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-BHz2N7Ih.css">
141
141
  </head>
142
142
  <body>
143
143
  <main class="aeo-seed-content" aria-label="AI Coding Token Usage Leaderboard AI-readable summary">
@@ -75,8 +75,8 @@
75
75
  "description": "Shareable Token Tracker dashboard snapshot."
76
76
  }
77
77
  </script>
78
- <script type="module" crossorigin src="/assets/__vite-browser-external-CsbVaBbw.js"></script>
79
- <link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-D95WhsZe.css">
78
+ <script type="module" crossorigin src="/assets/__vite-browser-external-C8KwSyTz.js"></script>
79
+ <link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-BHz2N7Ih.css">
80
80
  </head>
81
81
  <body>
82
82
  <main class="aeo-seed-content" aria-label="Token Tracker share page summary">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tokentracker-cli",
3
- "version": "0.93.7",
3
+ "version": "0.94.1",
4
4
  "description": "Local-first AI coding token usage and cost tracker for 34 tools, with a dashboard, desktop pet, widgets, achievements, and native macOS/Windows apps.",
5
5
  "main": "src/cli.js",
6
6
  "bin": {
@@ -1215,8 +1215,10 @@ function formatCopilotLines({ token, otel, sessionStore, appDb }) {
1215
1215
  const appDbState = appDb?.app_db_has_file
1216
1216
  ? `${appDb.app_db_mode || "set"} (${(appDb.app_db_paths || []).join(", ")})`
1217
1217
  : `not found (${appDb?.app_db_path || "unknown"})`;
1218
+ const otelLocation =
1219
+ otel.otel_path || otel.otel_detected_paths?.[0] || otel.otel_default_dir;
1218
1220
  const usageState = otel.otel_has_files
1219
- ? `set (${otel.otel_path || otel.otel_default_dir})`
1221
+ ? `set (${otelLocation})`
1220
1222
  : otel.otel_enabled
1221
1223
  ? "enabled but no files yet"
1222
1224
  : "unset (OTEL export not enabled)";
@@ -26,6 +26,7 @@ const {
26
26
  listGeminiSessionFiles,
27
27
  listOpencodeMessageFiles,
28
28
  readOpencodeDbMessages,
29
+ readOpencodeDbMessagesIncremental,
29
30
  readMimoDbMessages,
30
31
  readZcodeDbMessages,
31
32
  hasZcodeNativeUsageSchema,
@@ -1164,11 +1165,15 @@ async function cmdSync(argv, context = {}) {
1164
1165
  let dbResult = { messagesProcessed: 0, eventsAggregated: 0, bucketsQueued: 0 };
1165
1166
  if (dbDir) {
1166
1167
  const dbPath = path.join(dbDir, "opencode.db");
1167
- const dbMessages = readOpencodeDbMessages(dbPath);
1168
- if (dbMessages.length > 0) {
1168
+ const dbRead = readOpencodeDbMessagesIncremental(
1169
+ dbPath,
1170
+ cursors?.opencode?.dbCursor,
1171
+ );
1172
+ if (dbRead.messages.length > 0 || dbRead.cursor) {
1169
1173
  dbResult = await parseOpencodeDbIncremental({
1170
1174
  ...options,
1171
- dbMessages,
1175
+ dbMessages: dbRead.messages,
1176
+ dbCursor: dbRead.cursor,
1172
1177
  dbPath,
1173
1178
  });
1174
1179
  }
@@ -568,6 +568,14 @@ async function parseCodexRolloutFile(filePath, {
568
568
  let model = isResuming ? resumeState.model || null : null;
569
569
  let provider = isResuming ? resumeState.provider || null : null;
570
570
  let cliVersion = isResuming ? resumeState.cliVersion || null : null;
571
+ let forkedFromId = isResuming ? resumeState.forkedFromId || null : null;
572
+ let parentThreadId = isResuming ? resumeState.parentThreadId || null : null;
573
+ let threadSource = isResuming ? resumeState.threadSource || null : null;
574
+ let agentNickname = isResuming ? resumeState.agentNickname || null : null;
575
+ let agentRole = isResuming ? resumeState.agentRole || null : null;
576
+ let sessionLineageCaptured = isResuming
577
+ ? Boolean(resumeState.sessionLineageCaptured || resumeState.sessionId)
578
+ : false;
571
579
 
572
580
  const usageDeltaState = createUsageDeltaState({
573
581
  lastTotal: isResuming ? resumeState.prevTotals || null : null,
@@ -820,10 +828,22 @@ async function parseCodexRolloutFile(filePath, {
820
828
 
821
829
  if (obj.type === "session_meta") {
822
830
  const p = obj.payload || {};
823
- sessionId = p.id || sessionId;
824
- cwd = p.cwd || cwd;
825
- cliVersion = p.cli_version || cliVersion;
826
- provider = p.model_provider || provider;
831
+ // Forked rollouts replay historical session_meta rows after their own
832
+ // child metadata. Only the first row describes this file's lineage.
833
+ if (!sessionLineageCaptured) {
834
+ sessionId = p.id || sessionId;
835
+ cwd = p.cwd || cwd;
836
+ cliVersion = p.cli_version || cliVersion;
837
+ provider = p.model_provider || provider;
838
+ forkedFromId = p.forked_from_id || null;
839
+ parentThreadId = p.parent_thread_id || null;
840
+ threadSource = p.thread_source || p.source || null;
841
+ agentNickname = p.agent_nickname || null;
842
+ agentRole = p.agent_role || null;
843
+ sessionLineageCaptured = true;
844
+ } else if (!sessionId) {
845
+ sessionId = p.id || null;
846
+ }
827
847
  }
828
848
 
829
849
  if (obj.type === "turn_context") {
@@ -878,6 +898,11 @@ async function parseCodexRolloutFile(filePath, {
878
898
  model: model || provider,
879
899
  provider,
880
900
  version: cliVersion,
901
+ forkedFromId,
902
+ parentThreadId,
903
+ threadSource,
904
+ agentNickname,
905
+ agentRole,
881
906
  filePath: primaryFilePath,
882
907
  turnCount,
883
908
  totals,
@@ -903,6 +928,12 @@ async function parseCodexRolloutFile(filePath, {
903
928
  model,
904
929
  provider,
905
930
  cliVersion,
931
+ forkedFromId,
932
+ parentThreadId,
933
+ threadSource,
934
+ agentNickname,
935
+ agentRole,
936
+ sessionLineageCaptured,
906
937
  prevTotals: usageDeltaState.lastTotal,
907
938
  tokenUsageBaselines: snapshotUsageBaselines(usageDeltaState),
908
939
  pendingToolNames,
@@ -26,8 +26,9 @@ const {
26
26
  sanitizeCommandSignature,
27
27
  getExecutableName,
28
28
  } = require("./categorizer-utils");
29
+ const { normalizeGrokUsage } = require("./grok-usage");
29
30
 
30
- const CACHE_SCHEMA_VERSION = "grok-context-v2";
31
+ const CACHE_SCHEMA_VERSION = "grok-context-v3";
31
32
  const CACHE = new Map();
32
33
  // Result-level TTL. Per-file parse cache is the main win when flipping tabs.
33
34
  const CACHE_TTL_MS = 5 * 60_000;
@@ -246,31 +247,7 @@ function outputSizeBucket(lines, chars) {
246
247
  }
247
248
 
248
249
  function readUsageTotals(usage) {
249
- if (!usage || typeof usage !== "object") return null;
250
- const inputRaw = Math.max(0, Number(usage.inputTokens ?? usage.input_tokens ?? 0) || 0);
251
- const cached = Math.max(
252
- 0,
253
- Number(usage.cachedReadTokens ?? usage.cache_read_input_tokens ?? usage.cached_input_tokens ?? 0) || 0,
254
- );
255
- const output = Math.max(0, Number(usage.outputTokens ?? usage.output_tokens ?? 0) || 0);
256
- const reasoning = Math.max(
257
- 0,
258
- Number(usage.reasoningTokens ?? usage.reasoning_output_tokens ?? 0) || 0,
259
- );
260
- const nonCachedInput = Math.max(0, inputRaw - cached);
261
- // Prefer the reported totalTokens (authoritative billable total). Fallback
262
- // includes reasoning so a missing total still matches usage-parser shape.
263
- let total = Math.max(0, Number(usage.totalTokens ?? usage.total_tokens ?? 0) || 0);
264
- if (total <= 0) total = nonCachedInput + cached + output + reasoning;
265
- if (total <= 0) return null;
266
- return {
267
- input_tokens: nonCachedInput,
268
- cached_input_tokens: cached,
269
- cache_creation_input_tokens: 0,
270
- output_tokens: output,
271
- reasoning_output_tokens: reasoning,
272
- total_tokens: total,
273
- };
250
+ return normalizeGrokUsage(usage);
274
251
  }
275
252
 
276
253
  // ---------------------------------------------------------------------------
@@ -778,15 +755,17 @@ async function computeGrokContextBreakdownUncached({
778
755
  }))
779
756
  .sort((a, b) => (b.totals?.total_tokens || 0) - (a.totals?.total_tokens || 0));
780
757
 
781
- // Message breakdown: residual "text_response" tools + reasoning/output split
782
- const textResponse = toolRows.find((r) => r.name === "text_response");
783
- const textTotals = textResponse?.totals || emptyTotals();
758
+ // Message breakdown uses the same mutually exclusive columns as the parser.
759
+ // Grok's raw outputTokens includes reasoning, but readUsageTotals has already
760
+ // split it, so subtracting reasoning here would undercount assistant output.
784
761
  const reasoning = Number(grand.reasoning_output_tokens || 0);
785
- const assistantOut = Math.max(0, Number(grand.output_tokens || 0) - Math.min(reasoning, Number(grand.output_tokens || 0)));
762
+ const assistantOut = Number(grand.output_tokens || 0);
786
763
  // For Grok, cached reads dominate conversation history; non-cached input is
787
764
  // closer to "current user/context injection". Heuristic only — matches Codex
788
765
  // message_breakdown intent without reading message bodies.
789
- const historyTokens = Number(grand.cached_input_tokens || 0);
766
+ const cachedHistoryTokens = Number(grand.cached_input_tokens || 0);
767
+ const cacheCreationTokens = Number(grand.cache_creation_input_tokens || 0);
768
+ const historyTokens = cachedHistoryTokens + cacheCreationTokens;
790
769
  const userish = Number(grand.input_tokens || 0);
791
770
  const messageBreakdown = [
792
771
  {
@@ -806,8 +785,8 @@ async function computeGrokContextBreakdownUncached({
806
785
  name: "Conversation history",
807
786
  totals: roundTotals({
808
787
  input_tokens: 0,
809
- cached_input_tokens: historyTokens,
810
- cache_creation_input_tokens: 0,
788
+ cached_input_tokens: cachedHistoryTokens,
789
+ cache_creation_input_tokens: cacheCreationTokens,
811
790
  output_tokens: 0,
812
791
  reasoning_output_tokens: 0,
813
792
  total_tokens: historyTokens,
@@ -825,6 +804,18 @@ async function computeGrokContextBreakdownUncached({
825
804
  total_tokens: assistantOut,
826
805
  }),
827
806
  },
807
+ {
808
+ key: "reasoning",
809
+ name: "Reasoning",
810
+ totals: roundTotals({
811
+ input_tokens: 0,
812
+ cached_input_tokens: 0,
813
+ cache_creation_input_tokens: 0,
814
+ output_tokens: 0,
815
+ reasoning_output_tokens: reasoning,
816
+ total_tokens: reasoning,
817
+ }),
818
+ },
828
819
  ].sort((a, b) => (b.totals?.total_tokens || 0) - (a.totals?.total_tokens || 0));
829
820
 
830
821
  const serializeExecRows = (rows) =>
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+
3
+ // Grok's ACP turn_completed.usage uses camelCase fields. In that shape,
4
+ // inputTokens is the whole prompt (cache reads/writes included) and
5
+ // outputTokens includes reasoningTokens. TokenTracker stores mutually
6
+ // exclusive columns, so both reported totals need to be split before pricing.
7
+ //
8
+ // Grok's headless/CLI summaries may use snake_case fields whose input_tokens is
9
+ // already the non-cached portion. Keep the two shapes distinct instead of
10
+ // subtracting cache tokens twice.
11
+
12
+ const USD_TICKS_PER_USD = 10_000_000_000;
13
+
14
+ function nonNegative(value) {
15
+ const n = Number(value);
16
+ return Number.isFinite(n) && n > 0 ? n : 0;
17
+ }
18
+
19
+ function firstBoolean(...values) {
20
+ for (const value of values) {
21
+ if (typeof value === "boolean") return value;
22
+ }
23
+ return false;
24
+ }
25
+
26
+ function reportedCostUsd(usage, { costIsPartial, usageIsIncomplete }) {
27
+ if (costIsPartial || usageIsIncomplete) return null;
28
+
29
+ const ticks = Number(
30
+ usage.costUsdTicks ??
31
+ usage.totalCostUsdTicks ??
32
+ usage.cost_usd_ticks ??
33
+ usage.total_cost_usd_ticks,
34
+ );
35
+ if (Number.isFinite(ticks) && ticks >= 0) return ticks / USD_TICKS_PER_USD;
36
+
37
+ const usd = Number(usage.costUsd ?? usage.totalCostUsd ?? usage.cost_usd ?? usage.total_cost_usd);
38
+ return Number.isFinite(usd) && usd >= 0 ? usd : null;
39
+ }
40
+
41
+ function normalizeGrokUsage(usage) {
42
+ if (!usage || typeof usage !== "object") return null;
43
+
44
+ const camelCaseInput = usage.inputTokens != null;
45
+ const reportedInput = nonNegative(usage.inputTokens ?? usage.input_tokens);
46
+ const cachedInput = nonNegative(
47
+ usage.cachedReadTokens ?? usage.cacheReadInputTokens ?? usage.cache_read_input_tokens ?? usage.cached_input_tokens,
48
+ );
49
+ const cacheCreationInput = nonNegative(
50
+ usage.cacheCreationTokens ??
51
+ usage.cachedWriteTokens ??
52
+ usage.cacheWriteInputTokens ??
53
+ usage.cache_creation_input_tokens,
54
+ );
55
+ const rawOutput = nonNegative(usage.outputTokens ?? usage.output_tokens);
56
+ const reasoningOutput = nonNegative(usage.reasoningTokens ?? usage.reasoning_output_tokens);
57
+
58
+ const inputTokens = camelCaseInput
59
+ ? Math.max(0, reportedInput - cachedInput - cacheCreationInput)
60
+ : reportedInput;
61
+ const outputTokens = Math.max(0, rawOutput - reasoningOutput);
62
+
63
+ let totalTokens = nonNegative(usage.totalTokens ?? usage.total_tokens);
64
+ if (totalTokens <= 0) {
65
+ totalTokens = inputTokens
66
+ + cachedInput
67
+ + cacheCreationInput
68
+ + outputTokens
69
+ + reasoningOutput;
70
+ }
71
+ if (totalTokens <= 0) return null;
72
+
73
+ const costIsPartial = firstBoolean(usage.costIsPartial, usage.cost_is_partial);
74
+ const usageIsIncomplete = firstBoolean(usage.usageIsIncomplete, usage.usage_is_incomplete);
75
+
76
+ return {
77
+ input_tokens: inputTokens,
78
+ cached_input_tokens: cachedInput,
79
+ cache_creation_input_tokens: cacheCreationInput,
80
+ output_tokens: outputTokens,
81
+ reasoning_output_tokens: reasoningOutput,
82
+ total_tokens: totalTokens,
83
+ billable_total_tokens: totalTokens,
84
+ total_cost_usd: reportedCostUsd(usage, { costIsPartial, usageIsIncomplete }),
85
+ cost_is_partial: costIsPartial,
86
+ usage_is_incomplete: usageIsIncomplete,
87
+ model_calls: nonNegative(usage.modelCalls ?? usage.model_calls),
88
+ api_duration_ms: nonNegative(usage.apiDurationMs ?? usage.api_duration_ms),
89
+ };
90
+ }
91
+
92
+ module.exports = {
93
+ USD_TICKS_PER_USD,
94
+ normalizeGrokUsage,
95
+ };
@@ -2291,6 +2291,8 @@ function createLocalApiHandler({ queuePath }) {
2291
2291
  ma.totals.cached_input_tokens += row.cached_input_tokens || 0;
2292
2292
  ma.totals.cache_creation_input_tokens += row.cache_creation_input_tokens || 0;
2293
2293
  ma.totals.reasoning_output_tokens += row.reasoning_output_tokens || 0;
2294
+ ma.totals.total_cost_usd = Number(ma.totals.total_cost_usd || 0)
2295
+ + (Number(row.total_cost_usd) || 0);
2294
2296
  }
2295
2297
 
2296
2298
  const sources = Array.from(bySource.values()).map((s) => {