tokentracker-cli 0.95.2 → 0.96.0

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 (107) hide show
  1. package/dashboard/dist/assets/{AchievementBadge-DtB1MwFe.js → AchievementBadge-Bb2ljquW.js} +1 -1
  2. package/dashboard/dist/assets/{AchievementsPage--vddu0dC.js → AchievementsPage-ByUP2x8a.js} +2 -2
  3. package/dashboard/dist/assets/{AchievementsSection-CDl9hsbj.js → AchievementsSection-_L6sCLTw.js} +1 -1
  4. package/dashboard/dist/assets/{BadgeDetailModal-C7WsIRy9.js → BadgeDetailModal-B9n_-45B.js} +1 -1
  5. package/dashboard/dist/assets/{BotAnimated-CmXyzIhX.js → BotAnimated-lWmg-aZg.js} +1 -1
  6. package/dashboard/dist/assets/{Card-SUbC3VNS.js → Card-aSp259T0.js} +1 -1
  7. package/dashboard/dist/assets/{ClawdAnimated-BdEbs8Me.js → ClawdAnimated-Cy-XaTXW.js} +2 -2
  8. package/dashboard/dist/assets/{CommandPalette-D1RLLeHB.js → CommandPalette-CNwtKCUm.js} +1 -1
  9. package/dashboard/dist/assets/{CommunityStatsModal-5ESGJgZQ.js → CommunityStatsModal-DJSezaPV.js} +1 -1
  10. package/dashboard/dist/assets/{ConfirmModal-DsCd51b2.js → ConfirmModal-CVjmhZd6.js} +1 -1
  11. package/dashboard/dist/assets/{Controls-BVrLC_QD.js → Controls-BIj6yVxE.js} +1 -1
  12. package/dashboard/dist/assets/{DashboardPage-DtUOG6og.js → DashboardPage-BjYZLmqQ.js} +1 -1
  13. package/dashboard/dist/assets/{DevicePage-zYjj-m5V.js → DevicePage-ptsI2fZc.js} +1 -1
  14. package/dashboard/dist/assets/{DialogClose-D66yBqkd.js → DialogClose-D1pLoZ56.js} +1 -1
  15. package/dashboard/dist/assets/DialogDescription-KY7X94CG.js +1 -0
  16. package/dashboard/dist/assets/{DialogTitle-C4ia00lc.js → DialogTitle-DfSBUjWf.js} +1 -1
  17. package/dashboard/dist/assets/{FadeIn-DF2c8XaR.js → FadeIn-DBn4L_BV.js} +1 -1
  18. package/dashboard/dist/assets/{HeaderGithubStar-Cnr3aqcX.js → HeaderGithubStar-EJLBwEqp.js} +1 -1
  19. package/dashboard/dist/assets/{HoverTooltip-DBOpxlH7.js → HoverTooltip-DaSrZhYd.js} +1 -1
  20. package/dashboard/dist/assets/{IpCheckPage-CUY6KBaV.js → IpCheckPage-diQTVaYt.js} +1 -1
  21. package/dashboard/dist/assets/{LandingPage-DKL8hZEq.js → LandingPage-BqCxjwar.js} +2 -2
  22. package/dashboard/dist/assets/{LeaderboardAvatar-DRYeMNlq.js → LeaderboardAvatar-CQImCsPN.js} +1 -1
  23. package/dashboard/dist/assets/{LeaderboardPage-DpD9Az3k.js → LeaderboardPage-D2ZDUi_O.js} +2 -2
  24. package/dashboard/dist/assets/{LeaderboardProfileModal-Dfg0V13F.js → LeaderboardProfileModal-DHvADX1d.js} +3 -3
  25. package/dashboard/dist/assets/{LeaderboardProfilePage-DH-jcVDu.js → LeaderboardProfilePage-CJsedB28.js} +1 -1
  26. package/dashboard/dist/assets/LimitsPage-CAwff24b.js +6 -0
  27. package/dashboard/dist/assets/{LocalOnlyNotice-Bj_m0hw7.js → LocalOnlyNotice-Cmnvu9tI.js} +1 -1
  28. package/dashboard/dist/assets/{LoginCard-BVKvtx60.js → LoginCard-BQmKkD7X.js} +1 -1
  29. package/dashboard/dist/assets/{LoginModal-mUGiSIJN.js → LoginModal-2oPROePZ.js} +1 -1
  30. package/dashboard/dist/assets/{LoginPage-BORCuCUt.js → LoginPage-aqdUJoQK.js} +1 -1
  31. package/dashboard/dist/assets/{PetPage-D1JfEOVA.js → PetPage-Bn3p_o5r.js} +1 -1
  32. package/dashboard/dist/assets/{PopoverPopup-DK3et-HG.js → PopoverPopup-DXD_YdiB.js} +1 -1
  33. package/dashboard/dist/assets/{ProviderIcon-By8FAjxR.js → ProviderIcon-BZZ45-gY.js} +1 -1
  34. package/dashboard/dist/assets/{ResetPasswordPage-DPa81jqa.js → ResetPasswordPage-Bn5ITiHQ.js} +1 -1
  35. package/dashboard/dist/assets/{SegmentedControl-DLzS-2eZ.js → SegmentedControl-hGXboQZy.js} +1 -1
  36. package/dashboard/dist/assets/{Select-C05W6XEM.js → Select-BP8aVRZ1.js} +1 -1
  37. package/dashboard/dist/assets/{SelectItemText-CcfB3blP.js → SelectItemText-Odx47kND.js} +1 -1
  38. package/dashboard/dist/assets/{ServiceStatusPage-ByqLbHv1.js → ServiceStatusPage-DUueam0N.js} +1 -1
  39. package/dashboard/dist/assets/SessionsPage-BA9IFqQ1.js +2 -0
  40. package/dashboard/dist/assets/{SettingsPage-DAcndJZQ.js → SettingsPage-DLOHHB4f.js} +2 -2
  41. package/dashboard/dist/assets/{SkillsPage-BuuqQuNU.js → SkillsPage-Ds2vH_PG.js} +1 -1
  42. package/dashboard/dist/assets/{TokenGalaxy-DzccxkXW.js → TokenGalaxy-CWBR4jnB.js} +1 -1
  43. package/dashboard/dist/assets/{ToolbarRootContext-XUDMp5uy.js → ToolbarRootContext-Bmg56vYz.js} +1 -1
  44. package/dashboard/dist/assets/{TrendMonitor-B-yYabbz.js → TrendMonitor-BQzcllvg.js} +1 -1
  45. package/dashboard/dist/assets/{WidgetsPage-CwUDjEFo.js → WidgetsPage-Bu3tHDjO.js} +1 -1
  46. package/dashboard/dist/assets/{WrappedPage-Dr9ow3gH.js → WrappedPage-BrAMJhgy.js} +1 -1
  47. package/dashboard/dist/assets/{__vite-browser-external-DPOlUkcY.js → __vite-browser-external-4IGm4Djn.js} +12 -12
  48. package/dashboard/dist/assets/{agent-logos-Cqc_suYk.js → agent-logos-B8lT-HcI.js} +1 -1
  49. package/dashboard/dist/assets/{arrow-up-right-DSsR3Ntr.js → arrow-up-right-rpBCOTg2.js} +1 -1
  50. package/dashboard/dist/assets/{check-Cy35lAKh.js → check-DIKw7TYH.js} +1 -1
  51. package/dashboard/dist/assets/{composite-BDwOlhhX.js → composite-_NeXO0lv.js} +1 -1
  52. package/dashboard/dist/assets/{copy-4szu5cYh.js → copy-CsfAtL7P.js} +1 -1
  53. package/dashboard/dist/assets/{download-DdGW6Krz.js → download-DM1W9pIW.js} +1 -1
  54. package/dashboard/dist/assets/{external-link-DwSt83cq.js → external-link-CwbuMbeQ.js} +1 -1
  55. package/dashboard/dist/assets/{flame-DubukWqK.js → flame-DcYbLdhE.js} +1 -1
  56. package/dashboard/dist/assets/{format-tokens-B70EdQcN.js → format-tokens-CEvr3dNy.js} +1 -1
  57. package/dashboard/dist/assets/{icons-B86TLdAj.js → icons-DaGMVsJ5.js} +1 -1
  58. package/dashboard/dist/assets/{index-B_KMoBeK.js → index-BVVLPj3N.js} +1 -1
  59. package/dashboard/dist/assets/{index-DI-W-pun.js → index-ChZkJjpk.js} +1 -1
  60. package/dashboard/dist/assets/{index-DzEMcUwI.js → index-T7OjmEuX.js} +1 -1
  61. package/dashboard/dist/assets/{info-BzFpLbl6.js → info-CAjN3dX4.js} +1 -1
  62. package/dashboard/dist/assets/limits-providers-jn7Yln_V.js +1 -0
  63. package/dashboard/dist/assets/{link-2-BQp7-3T7.js → link-2-DaWH2Tyc.js} +1 -1
  64. package/dashboard/dist/assets/{loader-circle-lrDmbIg5.js → loader-circle-CnF8qPi1.js} +1 -1
  65. package/dashboard/dist/assets/{maximize-2-Cnd_Oth8.js → maximize-2-B-2Pnj6g.js} +1 -1
  66. package/dashboard/dist/assets/{modifiers.esm-CPTpZdHU.js → modifiers.esm-BoDOvUKl.js} +1 -1
  67. package/dashboard/dist/assets/{monitor-smartphone-C7UY1zRx.js → monitor-smartphone-DDgwxG_E.js} +1 -1
  68. package/dashboard/dist/assets/{plus-Bglp9N_7.js → plus-DIc1YUWB.js} +1 -1
  69. package/dashboard/dist/assets/{provider-display-CGsFySs6.js → provider-display-yeNsVCO_.js} +1 -1
  70. package/dashboard/dist/assets/{react-DKXriBSF.js → react-DZqS6YTX.js} +1 -1
  71. package/dashboard/dist/assets/{search-D_LLDRdU.js → search-D6tEppYJ.js} +1 -1
  72. package/dashboard/dist/assets/{skills-api-CJWjKIco.js → skills-api-vsA1rc1Z.js} +1 -1
  73. package/dashboard/dist/assets/{sortable.esm-zlY09tye.js → sortable.esm-DDCnS1HI.js} +1 -1
  74. package/dashboard/dist/assets/{store-8e16Ac2h.js → store-Crne4DqF.js} +1 -1
  75. package/dashboard/dist/assets/{terminal-CR228ekj.js → terminal-Ca7dkLMF.js} +1 -1
  76. package/dashboard/dist/assets/{trash-2-BjLWewOp.js → trash-2-CjEAS5ic.js} +1 -1
  77. package/dashboard/dist/assets/{use-community-stats-DhOJPaVg.js → use-community-stats-BHx2YxyK.js} +1 -1
  78. package/dashboard/dist/assets/{use-latest-request-guard-lcGhb-NC.js → use-latest-request-guard-BLGbXQdf.js} +1 -1
  79. package/dashboard/dist/assets/{use-limits-display-prefs-DJIImtLN.js → use-limits-display-prefs-DBkAp6ob.js} +1 -1
  80. package/dashboard/dist/assets/{use-ordered-list-BJZfZuoJ.js → use-ordered-list-BTfW5M9u.js} +1 -1
  81. package/dashboard/dist/assets/use-reduced-motion-D_kUnDs4.js +1 -0
  82. package/dashboard/dist/assets/{use-session-efficiency-pref-C-l4b1cD.js → use-session-efficiency-pref-DBmd-MqH.js} +1 -1
  83. package/dashboard/dist/assets/{use-transform-UjIt477N.js → use-transform-Bp5XrwaQ.js} +1 -1
  84. package/dashboard/dist/assets/{use-usage-limits-DqoTZrqT.js → use-usage-limits-BmqRcyhH.js} +1 -1
  85. package/dashboard/dist/assets/{useCurrency-CnM8aB4v.js → useCurrency-B0YsRDj-.js} +1 -1
  86. package/dashboard/dist/assets/{useTokenFormat-D4pAK2ld.js → useTokenFormat-PP3D0Ket.js} +1 -1
  87. package/dashboard/dist/assets/{zap-Du1IyEtj.js → zap-BVOm1aBH.js} +1 -1
  88. package/dashboard/dist/index.html +1 -1
  89. package/dashboard/dist/ip-check.html +1 -1
  90. package/dashboard/dist/leaderboard.html +1 -1
  91. package/dashboard/dist/share.html +1 -1
  92. package/package.json +1 -1
  93. package/src/lib/ark-agent-plan-limits.js +437 -0
  94. package/src/lib/ark-coding-plan-limits.js +104 -27
  95. package/src/lib/codex-model-attribution.js +128 -0
  96. package/src/lib/codex-rollout-parser.js +98 -4
  97. package/src/lib/pricing/curated-overrides.json +6 -6
  98. package/src/lib/pricing/index.js +38 -1
  99. package/src/lib/pricing/seed-snapshot.json +1 -1
  100. package/src/lib/rollout.js +50 -9
  101. package/src/lib/session-analytics.js +374 -110
  102. package/src/lib/usage-limits.js +19 -5
  103. package/dashboard/dist/assets/DialogDescription-BVlaoajd.js +0 -1
  104. package/dashboard/dist/assets/LimitsPage-CVCKPScf.js +0 -5
  105. package/dashboard/dist/assets/SessionsPage-CEDv1thj.js +0 -2
  106. package/dashboard/dist/assets/limits-providers-DxZOjiXQ.js +0 -1
  107. package/dashboard/dist/assets/use-reduced-motion-DdpxZQoh.js +0 -1
@@ -1 +1 @@
1
- import{m as c}from"./__vite-browser-external-DPOlUkcY.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-4IGm4Djn.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-DPOlUkcY.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-4IGm4Djn.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-DPOlUkcY.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-4IGm4Djn.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-DPOlUkcY.js";import{F as p,P as g}from"./composite-BDwOlhhX.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-4IGm4Djn.js";import{F as p,P as g}from"./composite-_NeXO0lv.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-DPOlUkcY.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-4IGm4Djn.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-DPOlUkcY.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-4IGm4Djn.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-DPOlUkcY.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-4IGm4Djn.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 +1 @@
1
- import{r as u}from"./__vite-browser-external-DPOlUkcY.js";function f(r,e){return r.length===e.length&&r.every((t,n)=>Object.is(t,e[n]))}function a(r){const e=u.useRef(r),t=u.useRef(0),n=u.useRef(!0);return u.useLayoutEffect(()=>{f(e.current,r)||(e.current=r,t.current+=1)}),u.useEffect(()=>(n.current=!0,()=>{n.current=!1,t.current+=1}),[]),u.useCallback(()=>{const c=++t.current,s=e.current;return()=>n.current&&t.current===c&&e.current===s},[])}export{a as u};
1
+ import{r as u}from"./__vite-browser-external-4IGm4Djn.js";function f(r,e){return r.length===e.length&&r.every((t,n)=>Object.is(t,e[n]))}function a(r){const e=u.useRef(r),t=u.useRef(0),n=u.useRef(!0);return u.useLayoutEffect(()=>{f(e.current,r)||(e.current=r,t.current+=1)}),u.useEffect(()=>(n.current=!0,()=>{n.current=!1,t.current+=1}),[]),u.useCallback(()=>{const c=++t.current,s=e.current;return()=>n.current&&t.current===c&&e.current===s},[])}export{a as u};
@@ -1 +1 @@
1
- import{r as a,q as M,t as B,v as q,w as G}from"./__vite-browser-external-DPOlUkcY.js";import{L as F}from"./limits-providers-DxZOjiXQ.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
+ import{r as a,q as M,t as B,v as q,w as G}from"./__vite-browser-external-4IGm4Djn.js";import{L as F}from"./limits-providers-jn7Yln_V.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-DPOlUkcY.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-4IGm4Djn.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-4IGm4Djn.js";import{h as r,i as t,p as s}from"./react-DZqS6YTX.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-DPOlUkcY.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-4IGm4Djn.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-DKXriBSF.js";import{r as f}from"./__vite-browser-external-DPOlUkcY.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-DZqS6YTX.js";import{r as f}from"./__vite-browser-external-4IGm4Djn.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 y,c as g,ad as x,ae as M,af as _}from"./__vite-browser-external-DPOlUkcY.js";import{l as L}from"./limits-providers-DxZOjiXQ.js";import{u as I}from"./use-latest-request-guard-lcGhb-NC.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 O(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 q(){if(b()){v({type:"requestNotificationPermission"});return}N()||typeof Notification<"u"&&Notification.permission==="default"&&await Notification.requestPermission().catch(()=>"denied")}const p="tt.limitAlerts.enabled";function A(){try{return window.localStorage.getItem(p)==="1"}catch{return!1}}function H(){const[e,i]=y.useState(A),[t,a]=y.useState("unknown");y.useEffect(()=>O(a),[]);const f=y.useCallback(async n=>{const r=!!n;r&&await q();try{window.localStorage.setItem(p,r?"1":"0")}catch{}i(r)},[]);return{enabled:e,setEnabled:f,permissionBlocked:t==="denied"}}function C(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 R(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 T({usedPercent:e,windowSeconds:i,resetMs:t,mode:a,now:f=Date.now()}){const n=Math.min(Math.max(Number(e)||0,0),100)/100,r={pacePercent:null,paceOver:!1,expectedPercent:null,runsOutEta:null,projectedEnd:null};if(!(i>0)||!Number.isFinite(t))return r;const o=Math.max(0,(t-f)/1e3),s=C(i,o);if(s==null)return r;if(r.expectedPercent=Math.round(s*100),r.paceOver=z(n,s),n>=.05){const m=a==="remaining"?1-s:s;r.pacePercent=m*100}if(s>.02&&n>0){const m=i*s,w=n/m,c=n/s;c>=1&&w>0?r.runsOutEta=D((1-n)/w):r.projectedEnd=Math.round(Math.min(c,1)*100)}return r}const $={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 B(){try{return JSON.parse(window.localStorage.getItem(P)||"{}")}catch{return{}}}function G(e){try{window.localStorage.setItem(P,JSON.stringify(e))}catch{}}function V(e,{now:i=Date.now()}={}){const t=[],a=$;for(const[f,n]of Object.entries(e||{})){const r=a[f];if(!(!n?.configured||n.error||!r))for(const o of r.windows(n)){if(!o.window)continue;const s=Number(o.pctField==="utilization"?o.window.utilization:o.window.used_percent),m=o.resetField==="resets_at"?o.window.resets_at:o.window.reset_at,w=j(m),c=T({usedPercent:s,windowSeconds:R(o,o.window),resetMs:w,mode:"used",now:i});!c.runsOutEta||!c.paceOver||s<20||!(w>i)||t.push({id:`${f}:${o.key}:${w}`,providerId:f,windowKey:o.key,resetMs:w,usedPercent:s,runsOutEta:c.runsOutEta})}}return t}function J(e){const i=B(),t=V(e);for(const n of t){if(i[n.id])continue;const r=L(n.providerId),o=g("limits.alert.title",{provider:r}),s=g("limits.alert.body",{eta:n.runsOutEta,percent:Math.round(n.usedPercent)});let m=x({title:o,body:s,id:n.id});!m&&typeof Notification<"u"&&Notification.permission==="granted"&&(new Notification(o,{body:s,tag:n.id}),m=!0),m&&(i[n.id]=Date.now())}const a=Date.now()-864e5,f=Object.fromEntries(Object.entries(i).filter(([n,r])=>{const o=Number(n.split(":").at(-1));return Number.isFinite(o)?o>=a:Number(r)>=a}).slice(-100));return G(f),t.length}function Q(e){const i=!!e?.initialState,[t,a]=y.useState(()=>i?e?.initialState?.data??null:null),[f,n]=y.useState(()=>i?e?.initialState?.error??null:null),[r,o]=y.useState(!i),s=!!e?.initialRefresh,m=!!e?.publishToPreloadCache,w=I([]);y.useEffect(()=>{if(!(!t||typeof window>"u"))try{window.localStorage.getItem(p)==="1"&&J(t)}catch{}},[t]);const c=y.useCallback((d,l)=>{!m||!d||typeof d!="object"||M(d,{source:l})},[m]),F=y.useCallback(async()=>{const d=w();try{const l=await _({refresh:!0});if(!d())return;const u=l&&typeof l=="object"?l:null;a(u),n(null),o(!1),c(u,"manual-refresh")}catch(l){if(!d())return;n(l?.message||String(l)),o(!1)}},[w,c]),k=y.useCallback(async()=>{const d=w();try{const l=await _();if(!d())return;const u=l&&typeof l=="object"?l:null;a(u),n(null),o(!1),c(u,"page-load")}catch(l){if(!d())return;n(l?.message||String(l)),o(!1)}},[w,c]);return y.useEffect(()=>{if(typeof window>"u"||typeof document>"u")return;const d=15e3;let l=Date.now();const u=()=>{if(document.visibilityState!=="visible")return;const h=Date.now();h-l<d||(l=h,k())};return window.addEventListener("focus",u),document.addEventListener("visibilitychange",u),()=>{window.removeEventListener("focus",u),document.removeEventListener("visibilitychange",u)}},[k]),y.useEffect(()=>{if(i&&!s)return;const d=w();(async()=>{try{const l=await _();if(!d())return;const u=l&&typeof l=="object"?l:null;a(u),n(null),c(u,"page-load")}catch(l){if(!d())return;n(l?.message||String(l))}finally{d()&&o(!1)}})()},[w,i,s,c]),{data:t,error:f,isLoading:r,refresh:F}}export{$ as P,R as a,H as b,T as c,j as r,J as s,Q as u};
1
+ import{q as b,ac as v,r as y,c as g,ad as x,ae as M,af as f}from"./__vite-browser-external-4IGm4Djn.js";import{l as L}from"./limits-providers-jn7Yln_V.js";import{u as I}from"./use-latest-request-guard-BLGbXQdf.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 O(e){if(typeof window>"u")return()=>{};const i=n=>{const a=n?.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 q(){if(b()){v({type:"requestNotificationPermission"});return}N()||typeof Notification<"u"&&Notification.permission==="default"&&await Notification.requestPermission().catch(()=>"denied")}const p="tt.limitAlerts.enabled";function A(){try{return window.localStorage.getItem(p)==="1"}catch{return!1}}function H(){const[e,i]=y.useState(A),[n,a]=y.useState("unknown");y.useEffect(()=>O(a),[]);const _=y.useCallback(async t=>{const r=!!t;r&&await q();try{window.localStorage.setItem(p,r?"1":"0")}catch{}i(r)},[]);return{enabled:e,setEnabled:_,permissionBlocked:n==="denied"}}function C(e,i){if(!(e>0))return null;const n=(e-i)/e;return Number.isFinite(n)?Math.min(Math.max(n,0),1):null}function z(e,i,n=.03){return e>i+n}function D(e){const i=Math.max(0,Math.floor(e)),n=Math.floor(i/3600);return n>24?`${Math.floor(n/24)}d`:n>0?`${n}h`:`${Math.floor(i/60)}m`}function R(e,i){if(typeof e.windowSeconds=="number")return e.windowSeconds;if(e.windowSecondsField&&i){const n=i[e.windowSecondsField];return typeof n=="number"&&n>0?n:null}return null}function j(e){return e==null?NaN:typeof e=="number"?e*1e3:Date.parse(e)}function T({usedPercent:e,windowSeconds:i,resetMs:n,mode:a,now:_=Date.now()}){const t=Math.min(Math.max(Number(e)||0,0),100)/100,r={pacePercent:null,paceOver:!1,expectedPercent:null,runsOutEta:null,projectedEnd:null};if(!(i>0)||!Number.isFinite(n))return r;const o=Math.max(0,(n-_)/1e3),s=C(i,o);if(s==null)return r;if(r.expectedPercent=Math.round(s*100),r.paceOver=z(t,s),t>=.05){const m=a==="remaining"?1-s:s;r.pacePercent=m*100}if(s>.02&&t>0){const m=i*s,w=t/m,c=t/s;c>=1&&w>0?r.runsOutEta=D((1-t)/w):r.projectedEnd=Math.round(Math.min(c,1)*100)}return r}const $={claude:{windows(e){const i=Array.isArray(e.weekly_scoped)?e.weekly_scoped.map(n=>({key:`scoped-${n.label}`,label:n.label,window:n,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,n=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:n,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}]}},agentPlan:{windows(e){return[{key:"5h",labelKey:"limits.label.ark_agent_plan_5h",window:e.primary_window},{key:"weekly",labelKey:"limits.label.ark_agent_plan_weekly",window:e.secondary_window},{key:"monthly",labelKey:"limits.label.ark_agent_plan_monthly",window:e.tertiary_window}]}}},P="tt.limitAlerts.cycles.v1";function B(){try{return JSON.parse(window.localStorage.getItem(P)||"{}")}catch{return{}}}function G(e){try{window.localStorage.setItem(P,JSON.stringify(e))}catch{}}function V(e,{now:i=Date.now()}={}){const n=[],a=$;for(const[_,t]of Object.entries(e||{})){const r=a[_];if(!(!t?.configured||t.error||!r))for(const o of r.windows(t)){if(!o.window)continue;const s=Number(o.pctField==="utilization"?o.window.utilization:o.window.used_percent),m=o.resetField==="resets_at"?o.window.resets_at:o.window.reset_at,w=j(m),c=T({usedPercent:s,windowSeconds:R(o,o.window),resetMs:w,mode:"used",now:i});!c.runsOutEta||!c.paceOver||s<20||!(w>i)||n.push({id:`${_}:${o.key}:${w}`,providerId:_,windowKey:o.key,resetMs:w,usedPercent:s,runsOutEta:c.runsOutEta})}}return n}function J(e){const i=B(),n=V(e);for(const t of n){if(i[t.id])continue;const r=L(t.providerId),o=g("limits.alert.title",{provider:r}),s=g("limits.alert.body",{eta:t.runsOutEta,percent:Math.round(t.usedPercent)});let m=x({title:o,body:s,id:t.id});!m&&typeof Notification<"u"&&Notification.permission==="granted"&&(new Notification(o,{body:s,tag:t.id}),m=!0),m&&(i[t.id]=Date.now())}const a=Date.now()-864e5,_=Object.fromEntries(Object.entries(i).filter(([t,r])=>{const o=Number(t.split(":").at(-1));return Number.isFinite(o)?o>=a:Number(r)>=a}).slice(-100));return G(_),n.length}function Q(e){const i=!!e?.initialState,[n,a]=y.useState(()=>i?e?.initialState?.data??null:null),[_,t]=y.useState(()=>i?e?.initialState?.error??null:null),[r,o]=y.useState(!i),s=!!e?.initialRefresh,m=!!e?.publishToPreloadCache,w=I([]);y.useEffect(()=>{if(!(!n||typeof window>"u"))try{window.localStorage.getItem(p)==="1"&&J(n)}catch{}},[n]);const c=y.useCallback((d,l)=>{!m||!d||typeof d!="object"||M(d,{source:l})},[m]),F=y.useCallback(async()=>{const d=w();try{const l=await f({refresh:!0});if(!d())return;const u=l&&typeof l=="object"?l:null;a(u),t(null),o(!1),c(u,"manual-refresh")}catch(l){if(!d())return;t(l?.message||String(l)),o(!1)}},[w,c]),k=y.useCallback(async()=>{const d=w();try{const l=await f();if(!d())return;const u=l&&typeof l=="object"?l:null;a(u),t(null),o(!1),c(u,"page-load")}catch(l){if(!d())return;t(l?.message||String(l)),o(!1)}},[w,c]);return y.useEffect(()=>{if(typeof window>"u"||typeof document>"u")return;const d=15e3;let l=Date.now();const u=()=>{if(document.visibilityState!=="visible")return;const h=Date.now();h-l<d||(l=h,k())};return window.addEventListener("focus",u),document.addEventListener("visibilitychange",u),()=>{window.removeEventListener("focus",u),document.removeEventListener("visibilitychange",u)}},[k]),y.useEffect(()=>{if(i&&!s)return;const d=w();(async()=>{try{const l=await f();if(!d())return;const u=l&&typeof l=="object"?l:null;a(u),t(null),c(u,"page-load")}catch(l){if(!d())return;t(l?.message||String(l))}finally{d()&&o(!1)}})()},[w,i,s,c]),{data:n,error:_,isLoading:r,refresh:F}}export{$ as P,R as a,H as b,T as c,j as r,J as s,Q as u};
@@ -1 +1 @@
1
- import{r as e,C as t,D as r,x as c}from"./__vite-browser-external-DPOlUkcY.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-4IGm4Djn.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-DPOlUkcY.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-4IGm4Djn.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-DPOlUkcY.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-4IGm4Djn.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};
@@ -266,7 +266,7 @@
266
266
  ]
267
267
  }
268
268
  </script>
269
- <script type="module" crossorigin src="/assets/__vite-browser-external-DPOlUkcY.js"></script>
269
+ <script type="module" crossorigin src="/assets/__vite-browser-external-4IGm4Djn.js"></script>
270
270
  <link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-CCMdjCX2.css">
271
271
  </head>
272
272
  <body>
@@ -165,7 +165,7 @@
165
165
  ]
166
166
  }
167
167
  </script>
168
- <script type="module" crossorigin src="/assets/__vite-browser-external-DPOlUkcY.js"></script>
168
+ <script type="module" crossorigin src="/assets/__vite-browser-external-4IGm4Djn.js"></script>
169
169
  <link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-CCMdjCX2.css">
170
170
  </head>
171
171
  <body>
@@ -136,7 +136,7 @@
136
136
  ]
137
137
  }
138
138
  </script>
139
- <script type="module" crossorigin src="/assets/__vite-browser-external-DPOlUkcY.js"></script>
139
+ <script type="module" crossorigin src="/assets/__vite-browser-external-4IGm4Djn.js"></script>
140
140
  <link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-CCMdjCX2.css">
141
141
  </head>
142
142
  <body>
@@ -75,7 +75,7 @@
75
75
  "description": "Shareable Token Tracker dashboard snapshot."
76
76
  }
77
77
  </script>
78
- <script type="module" crossorigin src="/assets/__vite-browser-external-DPOlUkcY.js"></script>
78
+ <script type="module" crossorigin src="/assets/__vite-browser-external-4IGm4Djn.js"></script>
79
79
  <link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-CCMdjCX2.css">
80
80
  </head>
81
81
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tokentracker-cli",
3
- "version": "0.95.2",
3
+ "version": "0.96.0",
4
4
  "description": "Local-first AI coding token usage and cost tracker for 36 tools, with a dashboard, desktop pet, widgets, achievements, and native macOS/Windows apps.",
5
5
  "main": "src/cli.js",
6
6
  "bin": {