tokentracker-cli 0.96.0 → 0.96.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 (110) hide show
  1. package/README.md +2 -0
  2. package/README.zh-CN.md +1 -1
  3. package/dashboard/dist/assets/{AchievementBadge-Bb2ljquW.js → AchievementBadge-DKyElm0T.js} +1 -1
  4. package/dashboard/dist/assets/{AchievementsPage-ByUP2x8a.js → AchievementsPage-BvCx3wND.js} +2 -2
  5. package/dashboard/dist/assets/{AchievementsSection-_L6sCLTw.js → AchievementsSection-DN69LzXX.js} +1 -1
  6. package/dashboard/dist/assets/{BadgeDetailModal-B9n_-45B.js → BadgeDetailModal-DGiKdZfz.js} +1 -1
  7. package/dashboard/dist/assets/{BotAnimated-lWmg-aZg.js → BotAnimated-zN8rH7_K.js} +1 -1
  8. package/dashboard/dist/assets/{Card-aSp259T0.js → Card-COWo-ClV.js} +1 -1
  9. package/dashboard/dist/assets/{ClawdAnimated-Cy-XaTXW.js → ClawdAnimated-BWsB7Eat.js} +2 -2
  10. package/dashboard/dist/assets/{CommandPalette-CNwtKCUm.js → CommandPalette-BfvIwuoJ.js} +1 -1
  11. package/dashboard/dist/assets/{CommunityStatsModal-DJSezaPV.js → CommunityStatsModal-BQWg7R_y.js} +1 -1
  12. package/dashboard/dist/assets/{ConfirmModal-CVjmhZd6.js → ConfirmModal-C7ABSI-O.js} +1 -1
  13. package/dashboard/dist/assets/{Controls-BIj6yVxE.js → Controls-vMzEZzej.js} +1 -1
  14. package/dashboard/dist/assets/DashboardPage-QBhbCMZF.js +1 -0
  15. package/dashboard/dist/assets/{DevicePage-ptsI2fZc.js → DevicePage-3ejUBLWM.js} +1 -1
  16. package/dashboard/dist/assets/{DialogClose-D1pLoZ56.js → DialogClose-D_dvtfGV.js} +1 -1
  17. package/dashboard/dist/assets/DialogDescription-ryGYdQjX.js +1 -0
  18. package/dashboard/dist/assets/{DialogTitle-DfSBUjWf.js → DialogTitle-_ahf0z8b.js} +1 -1
  19. package/dashboard/dist/assets/{FadeIn-DBn4L_BV.js → FadeIn-D7Jcfz1N.js} +1 -1
  20. package/dashboard/dist/assets/{HeaderGithubStar-EJLBwEqp.js → HeaderGithubStar-D--Rx5BS.js} +1 -1
  21. package/dashboard/dist/assets/{HoverTooltip-DaSrZhYd.js → HoverTooltip-n1W0z3Wr.js} +1 -1
  22. package/dashboard/dist/assets/{IpCheckPage-diQTVaYt.js → IpCheckPage-D202tl9B.js} +1 -1
  23. package/dashboard/dist/assets/{LandingPage-BqCxjwar.js → LandingPage-D6yL2EZo.js} +2 -2
  24. package/dashboard/dist/assets/{LeaderboardAvatar-CQImCsPN.js → LeaderboardAvatar-ChFg2mtA.js} +1 -1
  25. package/dashboard/dist/assets/{LeaderboardPage-D2ZDUi_O.js → LeaderboardPage-BXHwGs8r.js} +2 -2
  26. package/dashboard/dist/assets/{LeaderboardProfileModal-DHvADX1d.js → LeaderboardProfileModal-B5LoOpCk.js} +3 -3
  27. package/dashboard/dist/assets/{LeaderboardProfilePage-CJsedB28.js → LeaderboardProfilePage-jsukhRz8.js} +1 -1
  28. package/dashboard/dist/assets/{LimitsPage-CAwff24b.js → LimitsPage-PvqkOOwp.js} +1 -1
  29. package/dashboard/dist/assets/{LocalOnlyNotice-Cmnvu9tI.js → LocalOnlyNotice-Du0lz657.js} +1 -1
  30. package/dashboard/dist/assets/{LoginCard-BQmKkD7X.js → LoginCard-BFEX9x7-.js} +1 -1
  31. package/dashboard/dist/assets/{LoginModal-2oPROePZ.js → LoginModal-DqC7_d35.js} +1 -1
  32. package/dashboard/dist/assets/{LoginPage-aqdUJoQK.js → LoginPage-Dzx8N7HE.js} +1 -1
  33. package/dashboard/dist/assets/{PetPage-Bn3p_o5r.js → PetPage-CNlWHF4z.js} +1 -1
  34. package/dashboard/dist/assets/{PopoverPopup-DXD_YdiB.js → PopoverPopup-D9jadD3j.js} +1 -1
  35. package/dashboard/dist/assets/{ProviderIcon-BZZ45-gY.js → ProviderIcon-Caz5PuAm.js} +1 -1
  36. package/dashboard/dist/assets/{ResetPasswordPage-Bn5ITiHQ.js → ResetPasswordPage-x_GR79sR.js} +1 -1
  37. package/dashboard/dist/assets/{SegmentedControl-hGXboQZy.js → SegmentedControl-BxDiDV4R.js} +1 -1
  38. package/dashboard/dist/assets/{Select-BP8aVRZ1.js → Select-B5o-1sEl.js} +1 -1
  39. package/dashboard/dist/assets/{SelectItemText-Odx47kND.js → SelectItemText-CiA6L7Wk.js} +1 -1
  40. package/dashboard/dist/assets/{ServiceStatusPage-DUueam0N.js → ServiceStatusPage-BVQuVdjg.js} +1 -1
  41. package/dashboard/dist/assets/{SessionsPage-BA9IFqQ1.js → SessionsPage-DE39wNIO.js} +1 -1
  42. package/dashboard/dist/assets/SettingsPage-DJrb_fsK.js +2 -0
  43. package/dashboard/dist/assets/{SkillsPage-Ds2vH_PG.js → SkillsPage-COk-YQQ5.js} +1 -1
  44. package/dashboard/dist/assets/{TokenGalaxy-CWBR4jnB.js → TokenGalaxy-BPM779Wb.js} +1 -1
  45. package/dashboard/dist/assets/{ToolbarRootContext-Bmg56vYz.js → ToolbarRootContext-CozJT6Vs.js} +1 -1
  46. package/dashboard/dist/assets/{TrendMonitor-BQzcllvg.js → TrendMonitor-BkNy-o1D.js} +1 -1
  47. package/dashboard/dist/assets/{WidgetsPage-Bu3tHDjO.js → WidgetsPage-Bpg6H-ZB.js} +1 -1
  48. package/dashboard/dist/assets/{WrappedPage-BrAMJhgy.js → WrappedPage-C6-NM-RO.js} +1 -1
  49. package/dashboard/dist/assets/__vite-browser-external-BGnq8Ebm.js +45 -0
  50. package/dashboard/dist/assets/__vite-browser-external-CvMMIjhi.css +1 -0
  51. package/dashboard/dist/assets/{agent-logos-B8lT-HcI.js → agent-logos-DpbkRqXT.js} +1 -1
  52. package/dashboard/dist/assets/{arrow-up-right-rpBCOTg2.js → arrow-up-right-BjOtWUVs.js} +1 -1
  53. package/dashboard/dist/assets/{check-DIKw7TYH.js → check-BlxnX5jZ.js} +1 -1
  54. package/dashboard/dist/assets/{composite-_NeXO0lv.js → composite-Dxmivlk4.js} +1 -1
  55. package/dashboard/dist/assets/{copy-CsfAtL7P.js → copy-CIsWjLY5.js} +1 -1
  56. package/dashboard/dist/assets/{download-DM1W9pIW.js → download-QDaQbQdd.js} +1 -1
  57. package/dashboard/dist/assets/{external-link-CwbuMbeQ.js → external-link-DPV4VU3m.js} +1 -1
  58. package/dashboard/dist/assets/{flame-DcYbLdhE.js → flame-B_X-7VNp.js} +1 -1
  59. package/dashboard/dist/assets/{format-tokens-CEvr3dNy.js → format-tokens-DEx2TJj8.js} +1 -1
  60. package/dashboard/dist/assets/{icons-DaGMVsJ5.js → icons-983RyGSl.js} +1 -1
  61. package/dashboard/dist/assets/{index-BVVLPj3N.js → index-BONYA8HZ.js} +1 -1
  62. package/dashboard/dist/assets/{index-ChZkJjpk.js → index-Cjs5stC0.js} +1 -1
  63. package/dashboard/dist/assets/{index-T7OjmEuX.js → index-qtonw_x4.js} +1 -1
  64. package/dashboard/dist/assets/{info-CAjN3dX4.js → info-DpVOhXZI.js} +1 -1
  65. package/dashboard/dist/assets/{limits-providers-jn7Yln_V.js → limits-providers-BUoquSA-.js} +1 -1
  66. package/dashboard/dist/assets/{link-2-DaWH2Tyc.js → link-2-CBro-upz.js} +1 -1
  67. package/dashboard/dist/assets/{loader-circle-CnF8qPi1.js → loader-circle-wYFdSyOd.js} +1 -1
  68. package/dashboard/dist/assets/{maximize-2-B-2Pnj6g.js → maximize-2-DhTyQ4ly.js} +1 -1
  69. package/dashboard/dist/assets/{modifiers.esm-BoDOvUKl.js → modifiers.esm-CPljwVhN.js} +1 -1
  70. package/dashboard/dist/assets/{monitor-smartphone-DDgwxG_E.js → monitor-smartphone-D_wr-HOR.js} +1 -1
  71. package/dashboard/dist/assets/{plus-DIc1YUWB.js → plus-BNjfkBEF.js} +1 -1
  72. package/dashboard/dist/assets/{provider-display-yeNsVCO_.js → provider-display-BOBtUyFi.js} +1 -1
  73. package/dashboard/dist/assets/{react-DZqS6YTX.js → react-yHv9MTUA.js} +1 -1
  74. package/dashboard/dist/assets/{search-D6tEppYJ.js → search-Dfak92ZA.js} +1 -1
  75. package/dashboard/dist/assets/{skills-api-vsA1rc1Z.js → skills-api-By2PdNa1.js} +1 -1
  76. package/dashboard/dist/assets/{sortable.esm-DDCnS1HI.js → sortable.esm-B9xy66_v.js} +1 -1
  77. package/dashboard/dist/assets/{store-Crne4DqF.js → store-oQZR4d9M.js} +1 -1
  78. package/dashboard/dist/assets/{terminal-Ca7dkLMF.js → terminal-pbXWBmZM.js} +1 -1
  79. package/dashboard/dist/assets/{trash-2-CjEAS5ic.js → trash-2-CboDPwbW.js} +1 -1
  80. package/dashboard/dist/assets/{use-community-stats-BHx2YxyK.js → use-community-stats-D6HTdnHq.js} +1 -1
  81. package/dashboard/dist/assets/{use-latest-request-guard-BLGbXQdf.js → use-latest-request-guard-hwSr9Cam.js} +1 -1
  82. package/dashboard/dist/assets/{use-limits-display-prefs-DBkAp6ob.js → use-limits-display-prefs-B-pbwUS8.js} +1 -1
  83. package/dashboard/dist/assets/{use-ordered-list-BTfW5M9u.js → use-ordered-list-OtfOqrNb.js} +1 -1
  84. package/dashboard/dist/assets/use-reduced-motion-DGXcZBX3.js +1 -0
  85. package/dashboard/dist/assets/{use-session-efficiency-pref-DBmd-MqH.js → use-session-efficiency-pref-BScvtS8F.js} +1 -1
  86. package/dashboard/dist/assets/{use-transform-Bp5XrwaQ.js → use-transform-Cy1ykjEs.js} +1 -1
  87. package/dashboard/dist/assets/{use-usage-limits-BmqRcyhH.js → use-usage-limits-CSMb2zYW.js} +1 -1
  88. package/dashboard/dist/assets/{useCurrency-B0YsRDj-.js → useCurrency-VqF3cy1C.js} +1 -1
  89. package/dashboard/dist/assets/{useTokenFormat-PP3D0Ket.js → useTokenFormat-Cgub4MXu.js} +1 -1
  90. package/dashboard/dist/assets/{zap-BVOm1aBH.js → zap-DStzvQJI.js} +1 -1
  91. package/dashboard/dist/index.html +2 -2
  92. package/dashboard/dist/ip-check.html +2 -2
  93. package/dashboard/dist/leaderboard.html +2 -2
  94. package/dashboard/dist/share.html +2 -2
  95. package/package.json +1 -1
  96. package/src/commands/status.js +4 -4
  97. package/src/commands/sync.js +5 -3
  98. package/src/lib/ark-agent-plan-limits.js +4 -3
  99. package/src/lib/ark-coding-plan-limits.js +6 -8
  100. package/src/lib/command-runner.js +13 -0
  101. package/src/lib/local-api.js +3 -0
  102. package/src/lib/pricing/seed-snapshot.json +1 -1
  103. package/src/lib/rollout.js +17 -5
  104. package/src/lib/usage-limits.js +111 -13
  105. package/dashboard/dist/assets/DashboardPage-BjYZLmqQ.js +0 -1
  106. package/dashboard/dist/assets/DialogDescription-KY7X94CG.js +0 -1
  107. package/dashboard/dist/assets/SettingsPage-DLOHHB4f.js +0 -2
  108. package/dashboard/dist/assets/__vite-browser-external-4IGm4Djn.js +0 -45
  109. package/dashboard/dist/assets/__vite-browser-external-CCMdjCX2.css +0 -1
  110. package/dashboard/dist/assets/use-reduced-motion-D_kUnDs4.js +0 -1
@@ -1 +1 @@
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
+ import{m as c}from"./__vite-browser-external-BGnq8Ebm.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-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
+ import{N as E,O as I,P as R,Q as $}from"./__vite-browser-external-BGnq8Ebm.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-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:`
1
+ import{r as c,d as P,a3 as Oe}from"./__vite-browser-external-BGnq8Ebm.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-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
+ import{Z as t}from"./__vite-browser-external-BGnq8Ebm.js";import{F as p,P as g}from"./composite-Dxmivlk4.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-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
+ import{m as e}from"./__vite-browser-external-BGnq8Ebm.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-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
+ import{m as a}from"./__vite-browser-external-BGnq8Ebm.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-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
+ import{r as p,g as N,b as M}from"./__vite-browser-external-BGnq8Ebm.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-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
+ import{r as u}from"./__vite-browser-external-BGnq8Ebm.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-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
+ import{r as a,q as M,t as B,v as q,w as G}from"./__vite-browser-external-BGnq8Ebm.js";import{L as F}from"./limits-providers-BUoquSA-.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-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};
1
+ import{r as f}from"./__vite-browser-external-BGnq8Ebm.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-BGnq8Ebm.js";import{h as r,i as t,p as s}from"./react-yHv9MTUA.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-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
+ import{m as u,r as n}from"./__vite-browser-external-BGnq8Ebm.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-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
+ 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-yHv9MTUA.js";import{r as f}from"./__vite-browser-external-BGnq8Ebm.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 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
+ 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-BGnq8Ebm.js";import{l as L}from"./limits-providers-BUoquSA-.js";import{u as I}from"./use-latest-request-guard-hwSr9Cam.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-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
+ import{r as e,C as t,D as r,x as c}from"./__vite-browser-external-BGnq8Ebm.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-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
+ import{r as e,T as r,n,o as a,p as s}from"./__vite-browser-external-BGnq8Ebm.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-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};
1
+ import{m as a}from"./__vite-browser-external-BGnq8Ebm.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,8 +266,8 @@
266
266
  ]
267
267
  }
268
268
  </script>
269
- <script type="module" crossorigin src="/assets/__vite-browser-external-4IGm4Djn.js"></script>
270
- <link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-CCMdjCX2.css">
269
+ <script type="module" crossorigin src="/assets/__vite-browser-external-BGnq8Ebm.js"></script>
270
+ <link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-CvMMIjhi.css">
271
271
  </head>
272
272
  <body>
273
273
  <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-4IGm4Djn.js"></script>
169
- <link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-CCMdjCX2.css">
168
+ <script type="module" crossorigin src="/assets/__vite-browser-external-BGnq8Ebm.js"></script>
169
+ <link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-CvMMIjhi.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-4IGm4Djn.js"></script>
140
- <link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-CCMdjCX2.css">
139
+ <script type="module" crossorigin src="/assets/__vite-browser-external-BGnq8Ebm.js"></script>
140
+ <link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-CvMMIjhi.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-4IGm4Djn.js"></script>
79
- <link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-CCMdjCX2.css">
78
+ <script type="module" crossorigin src="/assets/__vite-browser-external-BGnq8Ebm.js"></script>
79
+ <link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-CvMMIjhi.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.96.0",
3
+ "version": "0.96.1",
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": {
@@ -531,10 +531,10 @@ async function cmdStatus(argv = []) {
531
531
  platform: process.platform,
532
532
  });
533
533
  const qoderCnActive = formatResolvedPaths(qoderCnPaths);
534
- // CN new-JSONL mirrors sync.js: CN and international currently share
535
- // ~/.qoder/projects, and sync only parses the CN dir when it diverges from
536
- // the international one (same files must not count under two sources). Only
537
- // report CN JSONL when the dirs diverge.
534
+ // CN new-JSONL mirrors sync.js: the new CN app writes ~/.qoder-cn/projects,
535
+ // but sync only parses the CN dir when it diverges from the international
536
+ // one (same files must not count under two sources). Only report CN JSONL
537
+ // when the dirs diverge.
538
538
  const qoderCnProjectsDirResolved = resolveQoderCnProjectsDir({ home, env: process.env });
539
539
  const qoderCnSharesIntlDir = path.normalize(qoderCnProjectsDirResolved) === path.normalize(qoderProjectsDirResolved)
540
540
  || (process.platform === "win32"
@@ -1357,9 +1357,11 @@ async function cmdSync(argv, context = {}) {
1357
1357
  }
1358
1358
  }
1359
1359
 
1360
- // Qoder CN new (JSONL) — currently shares ~/.qoder/projects with international;
1361
- // keep distinct parsing only when CN projects dir diverges (future CN split)
1362
- // to avoid double-counting the same JSONL under two sources.
1360
+ // Qoder CN new (JSONL) — the new CN app (com.qodercn.app.stable) writes
1361
+ // ~/.qoder-cn/projects, a sibling of the international ~/.qoder/projects.
1362
+ // Keep the divergence guard: if a user (or a future app build) points both
1363
+ // resolvers at the same directory, the same JSONL files must not count
1364
+ // under two sources.
1363
1365
  if (sourceAllowed("qoder-cn")) {
1364
1366
  try {
1365
1367
  const cnProjectsDir = resolveQoderCnProjectsDir({ home, env: process.env });
@@ -25,7 +25,7 @@ const fs = require("node:fs");
25
25
  const os = require("node:os");
26
26
  const path = require("node:path");
27
27
 
28
- const { runCommand, resolveBinaryPath, statBinaryInDirs, commonGlobalBinDirectories } = require("./command-runner");
28
+ const { runCommand, resolveBinaryPath, statBinaryInDirs, commonGlobalBinDirectories, resolvedCliEnvironment } = require("./command-runner");
29
29
 
30
30
  const ARK_LIMITS_CACHE_FILE = "ark-agent-plan-limits-cache.json";
31
31
  const ARK_LIMITS_CACHE_UNKNOWN_RESET_TTL_MS = 12 * 60 * 60 * 1000;
@@ -315,6 +315,7 @@ async function fetchArkAgentPlanLimits({
315
315
  if (!arkcliPath) return { configured: false };
316
316
 
317
317
  const commandOptions = {
318
+ env: resolvedCliEnvironment(arkcliPath, { platform }),
318
319
  signal,
319
320
  killProcessGroup: true,
320
321
  platform,
@@ -362,10 +363,10 @@ async function fetchArkAgentPlanLimits({
362
363
  ? `arkcli exited with code ${result.status}`
363
364
  : "arkcli usage plan failed");
364
365
  const detail = isExit127
365
- ? "arkcli exited with code 127 — please update arkcli: npm i -g @volcengine/ark-cli"
366
+ ? "arkcli exited with code 127 — check its runtime/PATH or update arkcli: npm i -g @volcengine/ark-cli"
366
367
  : baseDetail;
367
368
  const stderr = trimStderr(result?.stderr);
368
- const message = stderr && !isExit127 ? `${detail}: ${stderr}` : detail;
369
+ const message = stderr ? `${detail}: ${stderr}` : detail;
369
370
  return failWithCache(message);
370
371
  }
371
372
 
@@ -25,7 +25,7 @@ const fs = require("node:fs");
25
25
  const os = require("node:os");
26
26
  const path = require("node:path");
27
27
 
28
- const { runCommand, resolveBinaryPath, statBinaryInDirs, commonGlobalBinDirectories } = require("./command-runner");
28
+ const { runCommand, resolveBinaryPath, statBinaryInDirs, commonGlobalBinDirectories, resolvedCliEnvironment } = require("./command-runner");
29
29
 
30
30
  const ARK_LIMITS_CACHE_FILE = "ark-coding-plan-limits-cache.json";
31
31
  const ARK_LIMITS_CACHE_UNKNOWN_RESET_TTL_MS = 12 * 60 * 60 * 1000;
@@ -382,6 +382,7 @@ async function fetchArkCodingPlanLimits({
382
382
  if (!arkcliPath) return { configured: false };
383
383
 
384
384
  const commandOptions = {
385
+ env: resolvedCliEnvironment(arkcliPath, { platform }),
385
386
  signal,
386
387
  killProcessGroup: true,
387
388
  platform,
@@ -446,16 +447,13 @@ async function fetchArkCodingPlanLimits({
446
447
  || (result?.status !== 0 && result?.status !== null
447
448
  ? `arkcli exited with code ${result.status}`
448
449
  : "arkcli usage plan failed");
449
- // 127 is the classic "command not found" on a machine with arkcli
450
- // installed it almost always means the installed arkcli is too old to
451
- // support `usage plan --format json` or the binary shim is broken.
452
- // Surface an actionable hint while still honoring the disk-cache fallback.
450
+ // Exit 127 can mean a missing interpreter as well as an outdated CLI.
451
+ // Preserve stderr so users can distinguish runtime and command failures.
453
452
  const detail = isExit127
454
- ? "arkcli exited with code 127 — please update arkcli: npm i -g @volcengine/ark-cli"
453
+ ? "arkcli exited with code 127 — check its runtime/PATH or update arkcli: npm i -g @volcengine/ark-cli"
455
454
  : baseDetail;
456
455
  const stderr = trimStderr(result?.stderr);
457
- // Avoid duplicating the stale 127 hint when stderr already contains it.
458
- const message = stderr && !isExit127 ? `${detail}: ${stderr}` : detail;
456
+ const message = stderr ? `${detail}: ${stderr}` : detail;
459
457
  return failWithCache(message);
460
458
  }
461
459
 
@@ -226,6 +226,8 @@ function commonGlobalBinDirectories({ home = os.homedir(), platform = process.pl
226
226
  return [
227
227
  "/opt/homebrew/bin",
228
228
  "/usr/local/bin",
229
+ path.join(home, ".local", "bin"),
230
+ path.join(home, ".bun", "bin"),
229
231
  path.join(home, ".npm-global", "bin"),
230
232
  // volta keeps shims for every global install here
231
233
  path.join(home, ".volta", "bin"),
@@ -276,6 +278,16 @@ async function resolveBinaryPath(binary, { commandRunner, home, platform = proce
276
278
  return statBinaryInDirs(binary, searchDirs, platform);
277
279
  }
278
280
 
281
+ // Resolving an npm CLI's absolute path does not resolve its /usr/bin/env node
282
+ // shebang. Finder-launched apps have a minimal PATH even when the CLI lives
283
+ // beside a working nvm/fnm/Homebrew Node. Scope this environment to the child;
284
+ // preserve the install's own runtime and use our running Node as a fallback.
285
+ function resolvedCliEnvironment(binaryPath, { env = process.env, platform = process.platform } = {}) {
286
+ if (platform === "win32") return { ...env };
287
+ const dirs = [path.dirname(binaryPath), ...(env.PATH || "/usr/bin:/bin").split(path.delimiter), path.dirname(process.execPath)];
288
+ return { ...env, PATH: [...new Set(dirs.filter(Boolean))].join(path.delimiter) };
289
+ }
290
+
279
291
  module.exports = {
280
292
  runCommand,
281
293
  whichBinary,
@@ -283,4 +295,5 @@ module.exports = {
283
295
  commonGlobalBinDirectories,
284
296
  statBinaryInDirs,
285
297
  resolveBinaryPath,
298
+ resolvedCliEnvironment,
286
299
  };
@@ -2019,6 +2019,9 @@ function createLocalApiHandler({ queuePath }) {
2019
2019
  const publishAccount =
2020
2020
  background && body.publishAccount === true && getCloudSyncPref();
2021
2021
  const allLocalSources = background && body.allLocalSources === true;
2022
+ if (background && body.nativeOnlyWsl === true) {
2023
+ extraEnv.TOKENTRACKER_WSL_MODE = "native-only";
2024
+ }
2022
2025
  if (typeof body.deviceToken === "string" && body.deviceToken.trim()) {
2023
2026
  extraEnv.TOKENTRACKER_DEVICE_TOKEN = body.deviceToken.trim();
2024
2027
  }