tokentracker-cli 1.1.11 → 1.1.13

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 (118) hide show
  1. package/README.md +2 -1
  2. package/dashboard/dist/assets/{AchievementBadge-DuEuFaXg.js → AchievementBadge-DHCKPAgO.js} +1 -1
  3. package/dashboard/dist/assets/{AchievementsPage-BTTFtk_Z.js → AchievementsPage-BqlGMD7S.js} +2 -2
  4. package/dashboard/dist/assets/{AchievementsSection-BZppKteZ.js → AchievementsSection-CTTTR9CN.js} +1 -1
  5. package/dashboard/dist/assets/{BadgeDetailModal-TzmxXy8k.js → BadgeDetailModal-e0Iz8ct4.js} +1 -1
  6. package/dashboard/dist/assets/BotAnimated-BLYZyT1O.js +1 -0
  7. package/dashboard/dist/assets/{Card-HigkIm_b.js → Card-EHkn9ktD.js} +1 -1
  8. package/dashboard/dist/assets/{CommandPalette-Bx_11gJk.js → CommandPalette-CuSVstX9.js} +1 -1
  9. package/dashboard/dist/assets/{CommunityStatsModal-BjDPCBol.js → CommunityStatsModal-Cb1vefLE.js} +1 -1
  10. package/dashboard/dist/assets/{ConfirmModal-DTo93RpG.js → ConfirmModal-pIUQJ7QM.js} +1 -1
  11. package/dashboard/dist/assets/Controls-CX4Di57j.js +1 -0
  12. package/dashboard/dist/assets/DashboardPage-D1Ox1y3E.js +1 -0
  13. package/dashboard/dist/assets/{DevicePage-BVupGt9K.js → DevicePage-Q57gBE8A.js} +1 -1
  14. package/dashboard/dist/assets/{DialogClose-BlQJpi7n.js → DialogClose-Dn-nxOSp.js} +1 -1
  15. package/dashboard/dist/assets/DialogDescription-GXslTq2z.js +1 -0
  16. package/dashboard/dist/assets/{DialogTitle-CDmxp9ap.js → DialogTitle-DuAY9sfZ.js} +1 -1
  17. package/dashboard/dist/assets/{FadeIn-DPercU5n.js → FadeIn-25jNO9JV.js} +1 -1
  18. package/dashboard/dist/assets/{HeaderGithubStar-DeVzeBIo.js → HeaderGithubStar-0-ne32-S.js} +1 -1
  19. package/dashboard/dist/assets/{HoverTooltip-Duo2Icus.js → HoverTooltip-C2Qop8B3.js} +1 -1
  20. package/dashboard/dist/assets/{IpCheckPage-DgYiaRrT.js → IpCheckPage-Q9lwiFdt.js} +1 -1
  21. package/dashboard/dist/assets/{LandingPage-CYTR4PbQ.js → LandingPage-iX6E8Flr.js} +2 -2
  22. package/dashboard/dist/assets/{LeaderboardAvatar-B67pMaIl.js → LeaderboardAvatar-CiQrgneF.js} +1 -1
  23. package/dashboard/dist/assets/{LeaderboardPage-2wIMkBgq.js → LeaderboardPage-BIhIA28A.js} +2 -2
  24. package/dashboard/dist/assets/{LeaderboardProfileModal-D3VxkFlx.js → LeaderboardProfileModal-CF-MI8rL.js} +4 -4
  25. package/dashboard/dist/assets/{LeaderboardProfilePage-BS01jN5M.js → LeaderboardProfilePage-DRbLb-fO.js} +3 -3
  26. package/dashboard/dist/assets/{LimitsPage-BGRZW-aH.js → LimitsPage-lvYidBkz.js} +2 -2
  27. package/dashboard/dist/assets/{LocalOnlyNotice-Do9KUdi_.js → LocalOnlyNotice-CAQTnlaI.js} +1 -1
  28. package/dashboard/dist/assets/{LoginCard-CzAXLXfZ.js → LoginCard-Ci2Rrsfl.js} +1 -1
  29. package/dashboard/dist/assets/{LoginModal-D1J8zG0C.js → LoginModal-DhyQPl-V.js} +1 -1
  30. package/dashboard/dist/assets/{LoginPage-DeZJNMLe.js → LoginPage-B6q8P6hE.js} +1 -1
  31. package/dashboard/dist/assets/PetPage-82Cldgg6.js +1 -0
  32. package/dashboard/dist/assets/{PopoverPopup-BYzzQJTD.js → PopoverPopup-Btcu7vU0.js} +1 -1
  33. package/dashboard/dist/assets/{ProviderIcon-BfFkS-OF.js → ProviderIcon-aLwclDsD.js} +1 -1
  34. package/dashboard/dist/assets/{ResetPasswordPage-BFyYvG24.js → ResetPasswordPage-BlRl_aJr.js} +1 -1
  35. package/dashboard/dist/assets/{SegmentedControl-D5USR3JT.js → SegmentedControl-2O_XVL8u.js} +1 -1
  36. package/dashboard/dist/assets/{Select-DmFQdVA1.js → Select-D5uuRQwh.js} +1 -1
  37. package/dashboard/dist/assets/{SelectItemText-B5MXGLN-.js → SelectItemText-Bq_ZdWU0.js} +1 -1
  38. package/dashboard/dist/assets/{ServiceStatusPage-Dvm5eUJK.js → ServiceStatusPage-Pd6dgJua.js} +1 -1
  39. package/dashboard/dist/assets/{SessionsPage-DQKezzUW.js → SessionsPage-DjHudcn6.js} +2 -2
  40. package/dashboard/dist/assets/SettingsPage-DOLhZiBE.js +2 -0
  41. package/dashboard/dist/assets/{SkillsPage-DyX_-dcr.js → SkillsPage-D9-ZorB5.js} +1 -1
  42. package/dashboard/dist/assets/{TokenGalaxy-aK3jhWW0.js → TokenGalaxy-BN71jQQ8.js} +1 -1
  43. package/dashboard/dist/assets/{ToolbarRootContext-CY_SULMC.js → ToolbarRootContext-B0cqyD1i.js} +1 -1
  44. package/dashboard/dist/assets/TrendMonitor-DWxtbzyQ.js +19 -0
  45. package/dashboard/dist/assets/{WidgetsPage-D8tzK-7m.js → WidgetsPage-BwmJ2Z9d.js} +1 -1
  46. package/dashboard/dist/assets/{WrappedPage-BjZPa_al.js → WrappedPage-Cq8DrzLm.js} +1 -1
  47. package/dashboard/dist/assets/__vite-browser-external-CPMSmJgP.js +45 -0
  48. package/dashboard/dist/assets/__vite-browser-external-DrXtuPP9.css +1 -0
  49. package/dashboard/dist/assets/{agent-logos-QSoXRwwJ.js → agent-logos-X7FQq7rz.js} +1 -1
  50. package/dashboard/dist/assets/{arrow-up-right-C3WUmTcI.js → arrow-up-right-CPxuidzy.js} +1 -1
  51. package/dashboard/dist/assets/{check-Gz5mnj6f.js → check-D2K19ObI.js} +1 -1
  52. package/dashboard/dist/assets/{composite-DJhoahpv.js → composite-BN1UKLj0.js} +1 -1
  53. package/dashboard/dist/assets/{copy-C5RiL5JQ.js → copy-CSN17qFv.js} +1 -1
  54. package/dashboard/dist/assets/{download-CccMGCc1.js → download-CpW-TB2h.js} +1 -1
  55. package/dashboard/dist/assets/{external-link-fdU7Lj6p.js → external-link-ChBchK6G.js} +1 -1
  56. package/dashboard/dist/assets/{flame-CYEjossP.js → flame-f7119ZMd.js} +1 -1
  57. package/dashboard/dist/assets/{format-tokens-xXCznLkf.js → format-tokens-COrRnk53.js} +1 -1
  58. package/dashboard/dist/assets/{icons-CYNYszil.js → icons-Dn9vA9Qu.js} +1 -1
  59. package/dashboard/dist/assets/{index-CQ5GHXiW.js → index-BCNOKYSO.js} +1 -1
  60. package/dashboard/dist/assets/{index-Czz7x_MZ.js → index-CA-94DFW.js} +1 -1
  61. package/dashboard/dist/assets/{index-Cgfb050k.js → index-CElyhNzh.js} +1 -1
  62. package/dashboard/dist/assets/{info-Zae50fSC.js → info-BHsPBczD.js} +1 -1
  63. package/dashboard/dist/assets/{link-2-DW_mHLzI.js → link-2-BHfEWv22.js} +1 -1
  64. package/dashboard/dist/assets/{loader-circle-Bl7dBXh1.js → loader-circle-DTIT1Uk1.js} +1 -1
  65. package/dashboard/dist/assets/{maximize-2-DTP25Fl_.js → maximize-2-BmtIBzLu.js} +1 -1
  66. package/dashboard/dist/assets/{modifiers.esm-CYXpOF3i.js → modifiers.esm-CPBla3OK.js} +1 -1
  67. package/dashboard/dist/assets/{monitor-smartphone--TLNLuLe.js → monitor-smartphone-CbsYB-S2.js} +1 -1
  68. package/dashboard/dist/assets/{plus-DgeFv3Xc.js → plus-CZiNoMsy.js} +1 -1
  69. package/dashboard/dist/assets/{provider-display-crAVn3qa.js → provider-display-CXKRt9q1.js} +2 -2
  70. package/dashboard/dist/assets/{react-QPulAuJP.js → react-CZdcuJ28.js} +1 -1
  71. package/dashboard/dist/assets/{search-DIUmGfar.js → search-q2ARMGca.js} +1 -1
  72. package/dashboard/dist/assets/{skills-api-09qiTRNb.js → skills-api-CIyqyk-w.js} +1 -1
  73. package/dashboard/dist/assets/skins-Mc0sI20C.js +1 -0
  74. package/dashboard/dist/assets/{sortable.esm-BbsbmOc2.js → sortable.esm-BztIEZTk.js} +1 -1
  75. package/dashboard/dist/assets/{store-DdyzwTsy.js → store-DvdXwk-7.js} +1 -1
  76. package/dashboard/dist/assets/{terminal-JpDnkjVA.js → terminal-CFQOW2Ey.js} +1 -1
  77. package/dashboard/dist/assets/{trash-CRsyysiP.js → trash-D0ptaWPk.js} +1 -1
  78. package/dashboard/dist/assets/{use-community-stats-D3PwUyvR.js → use-community-stats-DYibzhAl.js} +1 -1
  79. package/dashboard/dist/assets/{use-latest-request-guard-DTCniVRw.js → use-latest-request-guard-viIhH7H5.js} +1 -1
  80. package/dashboard/dist/assets/{use-limits-display-prefs-BbYcvoh_.js → use-limits-display-prefs-CbXApWU1.js} +1 -1
  81. package/dashboard/dist/assets/{use-ordered-list-ypqFhcs4.js → use-ordered-list-BBP8hr8y.js} +1 -1
  82. package/dashboard/dist/assets/use-pet-settings-CIrPZ9pB.js +2 -0
  83. package/dashboard/dist/assets/use-reduced-motion-Dpq-cKyM.js +1 -0
  84. package/dashboard/dist/assets/{use-session-efficiency-pref-C5BZmpkY.js → use-session-efficiency-pref-2Vb3tJrw.js} +1 -1
  85. package/dashboard/dist/assets/{use-transform-C3bGaC_U.js → use-transform-CECRFELz.js} +1 -1
  86. package/dashboard/dist/assets/use-usage-limits-DEnbjOVG.js +1 -0
  87. package/dashboard/dist/assets/{useCurrency-BianRgdW.js → useCurrency-Dh9pUzDO.js} +1 -1
  88. package/dashboard/dist/assets/useTokenFormat-CoGcVhPP.js +1 -0
  89. package/dashboard/dist/assets/{zap-BJTChg1t.js → zap-BdeAxq64.js} +1 -1
  90. package/dashboard/dist/index.html +2 -2
  91. package/dashboard/dist/ip-check.html +2 -2
  92. package/dashboard/dist/leaderboard.html +2 -2
  93. package/dashboard/dist/share.html +2 -2
  94. package/package.json +3 -2
  95. package/src/commands/sync.js +57 -29
  96. package/src/lib/claude-categorizer.js +4 -7
  97. package/src/lib/claude-user-identity.js +56 -0
  98. package/src/lib/cursor-store.js +636 -57
  99. package/src/lib/grok-limits.js +17 -4
  100. package/src/lib/kimi-profile.js +61 -0
  101. package/src/lib/multi-install-parser.js +3 -1
  102. package/src/lib/pricing/seed-snapshot.json +1 -1
  103. package/src/lib/rollout.js +91 -39
  104. package/src/lib/usage-limits.js +128 -79
  105. package/dashboard/dist/assets/BotAnimated-4hWTFjwp.js +0 -1
  106. package/dashboard/dist/assets/ClawdAnimated-BRoihVSd.js +0 -2
  107. package/dashboard/dist/assets/Controls-BvWTXyfI.js +0 -1
  108. package/dashboard/dist/assets/DashboardPage--1_GuEr-.js +0 -1
  109. package/dashboard/dist/assets/DialogDescription-DE2BF-HX.js +0 -1
  110. package/dashboard/dist/assets/PetPage-D2oqJ05F.js +0 -1
  111. package/dashboard/dist/assets/SettingsPage-DbUDye5r.js +0 -2
  112. package/dashboard/dist/assets/TrendMonitor-BH6Jx8nS.js +0 -19
  113. package/dashboard/dist/assets/__vite-browser-external-Bg0J-a5P.css +0 -1
  114. package/dashboard/dist/assets/__vite-browser-external-VmN0WaC3.js +0 -45
  115. package/dashboard/dist/assets/skins-C8EyB85e.js +0 -1
  116. package/dashboard/dist/assets/use-reduced-motion-Cdn1VrG0.js +0 -1
  117. package/dashboard/dist/assets/use-usage-limits-BRLNaZEv.js +0 -1
  118. package/dashboard/dist/assets/useTokenFormat-DO4vxqhW.js +0 -1
@@ -1 +1 @@
1
- import{m as c}from"./__vite-browser-external-VmN0WaC3.js";const e={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};e.node;const o=c(e);export{o as S};
1
+ import{m as c}from"./__vite-browser-external-CPMSmJgP.js";const e={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};e.node;const o=c(e);export{o as S};
@@ -1 +1 @@
1
- import{O as R,P as E,Q as I,S as C,U as L,V as $}from"./__vite-browser-external-VmN0WaC3.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 N(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 P(e){return(Array.isArray(e)?e:[]).filter(t=>t?.scope!=="system").map(t=>{const n=v(t?.directory),r=N(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 J(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 H(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=J(o);if(!(!a.id||a.id===n))for(const c of Array.isArray(o?.skills)?o.skills:[]){if(c?.scope==="system")continue;const u=S(c),p=s(c?.directory);if(!u||!p)continue;const h=u.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])],b=Object.fromEntries(A.map(j=>[j,"synced"]));r[y]=m({...f,targets:A,targetStates:b},a)}else r[y]=m(f,a);continue}const w=k,U=Object.fromEntries(w.map(f=>[f,"synced"])),_=m({id:`remote:${encodeURIComponent(u)}`,key:u,name:s(c.name)||p.split(/[\\/]/).pop()||"Skill",directory:p,description:"",targets:w,targetStates:U,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(_)}}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",K="tokentracker-account-skills",q=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 l(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 z(){return d({mode:"installed"})}function B(e={}){return d({mode:"discover",...e.force?{force:1}:{}})}function M(e,t=0,n=20){return d({mode:"search",q:e,offset:t,limit:n})}function D(){return d({mode:"repos"})}function F(e,t){return l({action:"install",skill:e,targets:t})}function G(e){return l({action:"update_all",ids:e})}function Q(e){return l({action:"uninstall",id:e})}function V(e){return l({action:"restore",id:e})}function W(e,t){return l({action:"set_targets",id:e,targets:t})}function Z(e,t){return l({action:"import_local",directory:e,targets:t})}function X(e,t){return l({action:"delete_local",directory:e,targets:t||[]})}function Y(e){return l({action:"add_repo",repo:e})}function ee(e,t){return l({action:"remove_repo",owner:e,name:t})}function te(e={}){return d({mode:"popular",...e.force?{force:1}:{}})}function ne(e={}){return d({mode:"updates",...e.force?{force:1}:{}})}function re(e={}){return d({mode:"skill_usage",...e.force?{force:1}:{}})}async function O({accessToken:e,method:t="GET",body:n}){if(!e||!R(e))throw new Error("Skills sync requires sign-in");const r=E();if(!r)throw new Error("InsForge base URL not configured");const i={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`},o=I();o&&(i.apikey=o);const a=new AbortController,c=setTimeout(()=>a.abort(),q);try{const u=await C(L(r,K),{method:t,headers:i,cache:"no-store",signal:a.signal,...n==null?{}:{body:JSON.stringify(n)}}),p=await u.json().catch(()=>null);if(!u.ok)throw new Error(p?.error||`Request failed with HTTP ${u.status}`);return p}finally{clearTimeout(c)}}function oe(e){return O({accessToken:e})}function se({accessToken:e,deviceId:t,skills:n}){return O({accessToken:e,method:"POST",body:{device_id:t,skills:P(n)}})}export{oe as a,D as b,te as c,B as d,ne as e,re as f,z as g,X as h,F as i,W as j,Z as k,G as l,H as m,ee as n,Y as o,se as p,V as r,M as s,Q as u};
1
+ import{P as R,Q as E,S as I,U as C,V as L,W as $}from"./__vite-browser-external-CPMSmJgP.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 N(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 P(e){return(Array.isArray(e)?e:[]).filter(t=>t?.scope!=="system").map(t=>{const n=v(t?.directory),r=N(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 J(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 H(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=J(o);if(!(!a.id||a.id===n))for(const c of Array.isArray(o?.skills)?o.skills:[]){if(c?.scope==="system")continue;const u=S(c),p=s(c?.directory);if(!u||!p)continue;const h=u.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])],b=Object.fromEntries(A.map(j=>[j,"synced"]));r[y]=m({...f,targets:A,targetStates:b},a)}else r[y]=m(f,a);continue}const w=k,U=Object.fromEntries(w.map(f=>[f,"synced"])),_=m({id:`remote:${encodeURIComponent(u)}`,key:u,name:s(c.name)||p.split(/[\\/]/).pop()||"Skill",directory:p,description:"",targets:w,targetStates:U,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(_)}}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",K="tokentracker-account-skills",q=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 l(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 z(){return d({mode:"installed"})}function B(e={}){return d({mode:"discover",...e.force?{force:1}:{}})}function M(e,t=0,n=20){return d({mode:"search",q:e,offset:t,limit:n})}function D(){return d({mode:"repos"})}function F(e,t){return l({action:"install",skill:e,targets:t})}function G(e){return l({action:"update_all",ids:e})}function W(e){return l({action:"uninstall",id:e})}function Q(e){return l({action:"restore",id:e})}function V(e,t){return l({action:"set_targets",id:e,targets:t})}function Z(e,t){return l({action:"import_local",directory:e,targets:t})}function X(e,t){return l({action:"delete_local",directory:e,targets:t||[]})}function Y(e){return l({action:"add_repo",repo:e})}function ee(e,t){return l({action:"remove_repo",owner:e,name:t})}function te(e={}){return d({mode:"popular",...e.force?{force:1}:{}})}function ne(e={}){return d({mode:"updates",...e.force?{force:1}:{}})}function re(e={}){return d({mode:"skill_usage",...e.force?{force:1}:{}})}async function O({accessToken:e,method:t="GET",body:n}){if(!e||!R(e))throw new Error("Skills sync requires sign-in");const r=E();if(!r)throw new Error("InsForge base URL not configured");const i={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`},o=I();o&&(i.apikey=o);const a=new AbortController,c=setTimeout(()=>a.abort(),q);try{const u=await C(L(r,K),{method:t,headers:i,cache:"no-store",signal:a.signal,...n==null?{}:{body:JSON.stringify(n)}}),p=await u.json().catch(()=>null);if(!u.ok)throw new Error(p?.error||`Request failed with HTTP ${u.status}`);return p}finally{clearTimeout(c)}}function oe(e){return O({accessToken:e})}function se({accessToken:e,deviceId:t,skills:n}){return O({accessToken:e,method:"POST",body:{device_id:t,skills:P(n)}})}export{oe as a,D as b,te as c,B as d,ne as e,re as f,z as g,X as h,F as i,V as j,Z as k,G as l,H as m,ee as n,Y as o,se as p,Q as r,M as s,W as u};
@@ -0,0 +1 @@
1
+ const R={egg:[.8369,.8424,.8497,.8585,.8674,.8775,.8878,.8983,.9089,.9185,.9288,.9374,.9445,.9504,.9543,.9559,.9555,.9519,.9466,.9389,.9302,.9193,.9085,.8969,.8852,.8734,.8625,.8513,.8411,.8325,.8243,.8179,.8137,.8112,.8102,.8128,.8178,.8262,.8374,.8518,.8702,.8922,.9169,.9446,.9741,1.0023,1.0267,1.0433,1.0481,1.0393,1.0216,.997,.9697,.9418,.9169,.8949,.876,.8604,.849,.8394,.8337,.8314,.8305,.8326],hexagon:[.921,.9282,.9441,.9706,.9984,1.0059,.9896,.9562,.929,.9124,.9047,.9058,.9157,.9349,.9642,.9873,.9882,.9665,.9336,.9105,.8968,.8918,.8955,.908,.9293,.9611,.982,.9812,.959,.9282,.9089,.8978,.8964,.9026,.9189,.9439,.9778,.999,.9964,.9713,.9439,.9274,.9196,.9206,.9308,.9502,.9799,1.0121,1.0226,1.0071,.9752,.951,.9366,.9316,.9351,.9485,.9711,1.0026,1.0213,1.0155,.9863,.9547,.9347,.9232],triangle:[.7819,.8211,.8747,.944,1.0223,1.096,1.1401,1.134,1.0808,1.0047,.9265,.8603,.8104,.773,.745,.7273,.7151,.7118,.7148,.7245,.7427,.768,.8037,.8518,.9148,.9876,1.0583,1.1073,1.1109,1.0667,.994,.9164,.8482,.7948,.7555,.7261,.7056,.6925,.6859,.6869,.6938,.7084,.7305,.7615,.804,.8595,.9311,1.0092,1.0791,1.1171,1.1054,1.0501,.9779,.905,.845,.799,.7656,.7413,.7258,.716,.7146,.7204,.733,.7528]},d=Math.PI*2,B=(t,o=0,n=1)=>t<o?o:t>n?n:t,P=(t,o,n)=>t+(o-t)*n,D={easeOutCubic:t=>1-(1-t)**3,easeInOutCubic:t=>t<.5?4*t**3:1-(-2*t+2)**3/2,easeOutQuint:t=>1-(1-t)**5};function G(t,o,n=0){const s=t/o*d;return .55*Math.sin(s+n)+.3*Math.sin(2*s+n*1.7+1.1)+.15*Math.sin(3*s+n*2.3+2.4)}function T(t){let o=t>>>0;return()=>{o=o+1831565813>>>0;let n=Math.imul(o^o>>>15,1|o);return n=n+Math.imul(n^n>>>7,61|n)^n,((n^n>>>14)>>>0)/4294967296}}const i=t=>Math.round(t*100)/100,E=Array.from({length:64},(t,o)=>o/64*d),S=E.map(Math.cos),L=E.map(Math.sin);function Y(t,o={}){return{radii:[...R[t]],rot:0,cx:0,cy:0,sx:1,sy:1,...o}}function z(t,o={}){return{radii:new Array(64).fill(t),rot:0,cx:0,cy:0,sx:1,sy:1,...o}}function Q(t,o,n,s){const c=s??{radii:new Array(64),rot:0,cx:0,cy:0,sx:1,sy:1};for(let e=0;e<64;e++)c.radii[e]=P(t.radii[e]??1,o.radii[e]??1,n);let r=o.rot-t.rot;for(;r>Math.PI;)r-=d;for(;r<-Math.PI;)r+=d;return c.rot=t.rot+r*n,c.cx=P(t.cx,o.cx,n),c.cy=P(t.cy,o.cy,n),c.sx=P(t.sx,o.sx,n),c.sy=P(t.sy,o.sy,n),c}function U(t,o,n=[]){const s=Math.cos(t.rot),c=Math.sin(t.rot);for(let r=0;r<64;r++){const e=t.radii[r]??1,h=e*(S[r]??0),a=e*(L[r]??0),l=h*s-a*c,u=h*c+a*s,f=n[r]??{x:0,y:0};f.x=(l*t.sx+t.cx)*o,f.y=(u*t.sy+t.cy)*o,n[r]=f}return n.length=64,n}function J(t,o=1/6){const n=t.length;if(n<3)return"";const s=t[0];let c=`M${i(s.x)} ${i(s.y)}`;for(let r=0;r<n;r++){const e=t[(r-1+n)%n],h=t[r],a=t[(r+1)%n],l=t[(r+2)%n],u=h.x+(a.x-e.x)*o,f=h.y+(a.y-e.y)*o,M=a.x-(l.x-h.x)*o,x=a.y-(l.y-h.y)*o;c+=`C${i(u)} ${i(f)} ${i(M)} ${i(x)} ${i(a.x)} ${i(a.y)}`}return`${c}Z`}function A(t,o,n){const s=new Array(64).fill(0),c=t.length;for(let r=0;r<64;r++){const e=S[r]??0,h=L[r]??0;let a=0;for(let l=0;l<c;l++){const u=t[l],f=t[(l+1)%c],M=f.x-u.x,x=f.y-u.y,y=e*x-h*M;if(Math.abs(y)<1e-9)continue;const p=u.x-o,g=u.y-n,m=(p*x-g*M)/y,I=(p*h-g*e)/y;m>a&&I>=0&&I<=1&&(a=m)}s[r]=a}return s}function _(t,o,n,s,c,r,e=96){const h=s-t,a=c-o,l=Math.hypot(h,a)||1e-6,u=Math.atan2(a,h),f=Math.acos(Math.max(-1,Math.min(1,(n-r)/l))),M=[];for(let x=0;x<=e/2;x++){const y=u+f+(d-2*f)*x/(e/2);M.push({x:t+Math.cos(y)*n,y:o+Math.sin(y)*n})}for(let x=0;x<=e/2;x++){const y=u-f+2*f*x/(e/2);M.push({x:s+Math.cos(y)*r,y:c+Math.sin(y)*r})}return M}function K(t,o){const n=t.length,s=(o/d%1+1)%1*n,c=Math.floor(s);return P(t[c%n]??1,t[(c+1)%n]??1,s-c)}function b(t,o=1,n=1){return E.map((s,c)=>{const r=Math.abs((S[c]??0)/o)**t,e=Math.abs((L[c]??0)/n)**t;return(r+e)**(-1/t)})}function F(t){const o=new Array(64).fill(0);for(let n=0;n<64;n++){const s=S[n]??0,c=L[n]??0;let r=0;for(const e of t){const h=s*e.x+c*e.y,a=h*h-(e.x*e.x+e.y*e.y-e.r*e.r);if(a<0)continue;const l=h+Math.sqrt(a);l>r&&(r=l)}o[n]=r}return o}function w(t,o,n=10){const s=t.length,c=[],r=(e,h)=>{const a=h.x-e.x,l=h.y-e.y,u=Math.hypot(a,l)||1;return Math.atan2(-a/u,l/u)};for(let e=0;e<s;e++){const h=t[(e-1+s)%s],a=t[e],l=t[(e+1)%s],u=r(h,a);let M=r(a,l)-u;for(;M>Math.PI;)M-=d;for(;M<-Math.PI;)M+=d;for(let x=0;x<=n;x++){const y=u+M*x/n;c.push({x:a.x+Math.cos(y)*o,y:a.y+Math.sin(y)*o})}}return c}function O(t,o,n,s=0){const c=s*Math.PI/180,r=Array.from({length:t},(e,h)=>{const a=c+h/t*d;return{x:Math.cos(a)*(o-n),y:Math.sin(a)*(o-n)}});return A(w(r,n),0,0)}function V(t,o=1){if(t.length<3)return"";let n="";for(let s=0;s<t.length;s++){const c=t[s];n+=`${s===0?"M":"L"}${i(c.x*o)} ${i(c.y*o)}`}return`${n}Z`}function W(t,o){const n=Math.max(t,.01)/2,s=Math.max(o,.01)/2,c=Math.min(n,s);return`M${i(-n)} ${i(-s+c)}A${i(c)} ${i(c)} 0 0 1 ${i(-n+c)} ${i(-s)}L${i(n-c)} ${i(-s)}A${i(c)} ${i(c)} 0 0 1 ${i(n)} ${i(-s+c)}L${i(n)} ${i(s-c)}A${i(c)} ${i(c)} 0 0 1 ${i(n-c)} ${i(s)}L${i(-n+c)} ${i(s)}A${i(c)} ${i(c)} 0 0 1 ${i(-n)} ${i(s-c)}Z`}function $(t,o=1){const n=Math.max(...t);if(n<=0)return t;const s=o/n;return t.map(c=>c*s)}const C=Array.from({length:64},(t,o)=>o/64*Math.PI*2),k=$(C.map(t=>1+.075*Math.cos(2*t+.5)+.035*Math.cos(3*t+2.1)),1.02),N=$(F([{x:-.44,y:.2,r:.54},{x:.46,y:.2,r:.5},{x:.02,y:.3,r:.6},{x:-.24,y:-.3,r:.48},{x:.3,y:-.24,r:.44}]),1.02),q=$(A(_(0,.28,.66,0,-.96,.05),0,0),1.04),H=A(_(-.42,0,.62,.42,0,.62),0,0),Z=[{id:"cercle",radii:new Array(64).fill(1)},{id:"galet",radii:k},{id:"squircle",radii:$(b(4.2),1.15)},{id:"capsule",radii:H},{id:"triangle",radii:O(3,1.12,.34,-90)},{id:"hexagone",radii:O(6,1.04,.26,0)},{id:"nuage",radii:N},{id:"goutte",radii:q}],X=new Map(Z.map(t=>[t.id,t])),j=[{id:"encre",hex:"#0a0a0c"},{id:"brun",hex:"#8b5e3c"},{id:"rouge",hex:"#e8483f"},{id:"orange",hex:"#f08a24"},{id:"ambre",hex:"#f0b429"},{id:"vert",hex:"#3ecf8e"},{id:"turquoise",hex:"#2fbfa0"},{id:"bleu",hex:"#3b93f0"},{id:"violet",hex:"#8b5cf6"},{id:"rose",hex:"#e152b0"},{id:"gris",hex:"#a3a3a3"},{id:"creme",hex:"#f1efe9"}],v=new Map(j.map(t=>[t.id,t]));function t0(t,o,n){const s=h=>{const a=parseInt(h.slice(1),16);return[a>>16&255,a>>8&255,a&255]},c=s(t),r=s(o);return`#${c.map((h,a)=>Math.round(h+(r[a]-h)*n)).map(h=>h.toString(16).padStart(2,"0")).join("")}`}export{v as C,Z as S,d as T,T as a,P as b,B as c,z as d,D as e,V as f,K as g,_ as h,J as i,W as j,Q as k,G as l,X as m,t0 as n,A as p,i as r,Y as s,U as t};
@@ -1,4 +1,4 @@
1
- import{r as c,d as P,a5 as Oe}from"./__vite-browser-external-VmN0WaC3.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,a6 as Oe}from"./__vite-browser-external-CPMSmJgP.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{E as r}from"./__vite-browser-external-VmN0WaC3.js";import{F as g}from"./composite-DJhoahpv.js";function a(e,n,u=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new g({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:n,syncOnly:!0,nested:u,onOpenChange:void 0}),floatingId:n,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:r,inactiveTriggerProps:r,popupProps:r}}const o=e=>e.triggerIdProp??e.activeTriggerId,t=e=>e.openProp??e.open,i=e=>(e.popupElement?.id??e.floatingId)||void 0;function p(e,n){return n!==void 0&&t(e)&&o(e)===n}function l(e,n){return p(e,n)?!0:n!==void 0&&t(e)&&o(e)==null&&e.triggerCount===1}const c={open:t,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)=>p(e,n),isMountedByTrigger:(e,n)=>n!==void 0&&o(e)===n&&e.mounted,triggerProps:(e,n)=>n?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,n)=>l(e,n)?i(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};export{a as c,c as p};
1
+ import{E as r}from"./__vite-browser-external-CPMSmJgP.js";import{F as g}from"./composite-BN1UKLj0.js";function a(e,n,u=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new g({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:n,syncOnly:!0,nested:u,onOpenChange:void 0}),floatingId:n,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:r,inactiveTriggerProps:r,popupProps:r}}const o=e=>e.triggerIdProp??e.activeTriggerId,t=e=>e.openProp??e.open,i=e=>(e.popupElement?.id??e.floatingId)||void 0;function p(e,n){return n!==void 0&&t(e)&&o(e)===n}function l(e,n){return p(e,n)?!0:n!==void 0&&t(e)&&o(e)==null&&e.triggerCount===1}const c={open:t,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)=>p(e,n),isMountedByTrigger:(e,n)=>n!==void 0&&o(e)===n&&e.mounted,triggerProps:(e,n)=>n?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,n)=>l(e,n)?i(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};export{a as c,c as p};
@@ -1 +1 @@
1
- import{m as a}from"./__vite-browser-external-VmN0WaC3.js";const e={name:"terminal",size:24,node:[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]};e.node;const o=a(e);export{o as T};
1
+ import{m as a}from"./__vite-browser-external-CPMSmJgP.js";const e={name:"terminal",size:24,node:[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]};e.node;const o=a(e);export{o as T};
@@ -1 +1 @@
1
- import{m as e}from"./__vite-browser-external-VmN0WaC3.js";const a={name:"trash",size:24,node:[["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"}]],aliases:["trash-2"]};a.node;const o=e(a);export{o as T};
1
+ import{m as e}from"./__vite-browser-external-CPMSmJgP.js";const a={name:"trash",size:24,node:[["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"}]],aliases:["trash-2"]};a.node;const o=e(a);export{o as T};
@@ -1 +1 @@
1
- import{r as p,g as N,b as M}from"./__vite-browser-external-VmN0WaC3.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-CPMSmJgP.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-VmN0WaC3.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-CPMSmJgP.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{c as a,r as c,J as N,K as B,M as F,N as H}from"./__vite-browser-external-VmN0WaC3.js";const Q=["claude","codex","cursor","gemini","kimi","kiro","grok","copilot","antigravity","zcode","opencodeGo","commandCode","qoder","qoderCn","codingPlan","agentPlan","devin"],W={claude:"CLAUDE",codex:"CODEX",cursor:"CURSOR",gemini:"GEMINI",kimi:"KIMI",kiro:"KIRO",grok:"GROK",copilot:"COPILOT",antigravity:"ANTIGRAVITY",zcode:"ZCODE",opencodeGo:"OPENCODE",commandCode:"COMMAND-CODE",qoder:"QODER",qoderCn:"QODER-CN",codingPlan:"VOLCANO-ARK",agentPlan:"VOLCANO-ARK",devin:"DEVIN"};function fe(e){return W[e]||null}function me(e){switch(e){case"claude":return a("limits.provider.claude");case"codex":return a("limits.provider.codex");case"cursor":return a("limits.provider.cursor");case"gemini":return a("limits.provider.gemini");case"kimi":return a("limits.provider.kimi");case"kiro":return a("limits.provider.kiro");case"grok":return a("limits.provider.grok");case"copilot":return a("limits.provider.copilot");case"antigravity":return a("limits.provider.antigravity");case"zcode":return a("limits.provider.zcode");case"opencodeGo":return a("limits.provider.opencode_go");case"commandCode":return a("limits.provider.command_code");case"qoder":return a("limits.provider.qoder");case"qoderCn":return a("limits.provider.qoder_cn");case"codingPlan":return a("limits.provider.ark_coding_plan");case"agentPlan":return a("limits.provider.ark_agent_plan");case"devin":return a("limits.provider.devin");default:return String(e||"")}}const m=Q,E="tt.limits.providerOrder",I="tt.limits.providerVisibility",A="tt.limits.displayMode",D="tt.limits.showSubscriptions",O="tt.limits.updatedAt",C="limitsPreferences",X="limitsDisplayMode",Z="tt:limits-prefs-changed",w=Object.freeze({USED:"used",REMAINING:"remaining"}),g=new Set(Object.values(w)),_=new Set([E,I,A,D,O]);function h(){return[...m]}const $=new Set(["devin"]);function b(){return Object.fromEntries(m.map(e=>[e,!$.has(e)]))}function L(e){const r=[];if(Array.isArray(e))for(const o of e)m.includes(o)&&!r.includes(o)&&r.push(o);for(const o of m)r.includes(o)||r.push(o);return r}function P(e){const r=b();if(!e||typeof e!="object"||Array.isArray(e))return r;for(const o of m)typeof e[o]=="boolean"&&(r[o]=e[o]);return r}function ee(e){return g.has(e)?e:w.USED}function k(e){return typeof e=="boolean"?e:!0}function S(e){if(e!=null){if(typeof e=="number")return Number.isSafeInteger(e)?e:void 0;if(typeof e=="string"){const r=e.trim();if(r==="")return;const o=Number(r);return Number.isSafeInteger(o)?o:void 0}}}function y(e={}){const r=e&&typeof e=="object"?e:{};return{displayMode:ee(r.displayMode),providerOrder:L(r.providerOrder),providerVisibility:P(r.providerVisibility),showSubscriptions:k(r.showSubscriptions),updatedAt:S(r.updatedAt)}}function re(){if(typeof window>"u")return h();try{const e=window.localStorage.getItem(E);return L(e?JSON.parse(e):void 0)}catch{return h()}}function R(){if(typeof window>"u")return b();try{const e=window.localStorage.getItem(I);return P(e?JSON.parse(e):void 0)}catch{return b()}}function Se(e){return e===null||_.has(e)}function we(){return R().devin===!0}function te(){if(typeof window>"u")return w.USED;try{const e=window.localStorage.getItem(A);return g.has(e)?e:w.USED}catch{return w.USED}}function ie(){if(typeof window>"u")return!0;try{const e=window.localStorage.getItem(D);return e===null?!0:k(JSON.parse(e))}catch{return!0}}function ne(){if(!(typeof window>"u"))try{return S(window.localStorage.getItem(O))}catch{return}}function oe(){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 v(){return y({displayMode:te(),providerOrder:re(),providerVisibility:R(),showSubscriptions:ie(),updatedAt:ne()})}function se(e){if(typeof window>"u")return;const r=y(e);try{window.localStorage.setItem(E,JSON.stringify(r.providerOrder)),window.localStorage.setItem(I,JSON.stringify(r.providerVisibility)),window.localStorage.setItem(A,r.displayMode),window.localStorage.setItem(D,JSON.stringify(r.showSubscriptions)),r.updatedAt===void 0?window.localStorage.removeItem(O):window.localStorage.setItem(O,String(r.updatedAt))}catch(o){console.warn("[tokentracker] limits preferences localStorage write failed:",o)}}function de(e){const r=y(e);return{displayMode:r.displayMode,providerOrder:[...r.providerOrder],providerVisibility:{...r.providerVisibility},showSubscriptions:r.showSubscriptions,updatedAt:r.updatedAt??null}}function ae(...e){let r;for(const d of e){const l=S(d);l!==void 0&&(r=r===void 0?l:Math.max(r,l))}const o=Date.now();return r!==void 0&&o<=r?r+1:o}function ce(e,r){return e.length===r.length&&e.every((o,d)=>o===r[d])}function ue(e,r){return m.every(o=>e[o]===r[o])}function K(e,r){return e.displayMode===r.displayMode&&ce(e.providerOrder,r.providerOrder)&&ue(e.providerVisibility,r.providerVisibility)&&e.showSubscriptions===r.showSubscriptions}function le(e,r){return K(e,r)&&S(e.updatedAt)===S(r.updatedAt)}function V(e,r){const o=S(e.updatedAt),d=S(r.updatedAt);return o!==void 0&&(d===void 0||o>d)}function ye(){const[e,r]=c.useState(v),o=c.useRef(e),d=c.useCallback((i,t={})=>{const n=y(i);return o.current=n,r(n),t.writeLocal&&se(n),typeof window<"u"&&window.dispatchEvent(new CustomEvent(Z)),n},[]),l=c.useCallback(i=>{N()&&B(C,de(i))},[]),u=c.useCallback(i=>{const t=v(),n=V(t,o.current)?d(t):o.current,s=y(i(n));if(K(n,s))return;const p=ae(t.updatedAt,n.updatedAt),f=d({...s,updatedAt:p},{writeLocal:!0});l(f)},[d,l]),T=c.useCallback(i=>{g.has(i)&&u(t=>({...t,displayMode:i}))},[u]),x=c.useCallback(i=>{u(t=>({...t,showSubscriptions:!!i}))},[u]),M=c.useCallback(i=>{if(!g.has(i))return;const t=v();if(t.updatedAt!==void 0){d(t);return}d({...t,displayMode:i,updatedAt:void 0},{writeLocal:!0})},[d]);c.useEffect(()=>{if(!N())return;const i=F(t=>{const n=t?.[C];if(n&&typeof n=="object"){const s=y(n);if(!oe()){d(s,{writeLocal:!0});return}const p=v();if(V(s,p))d(s,{writeLocal:!0});else{const f=d(p);le(s,p)||l(f)}return}M(t?.[X])});return H(),i},[M,d,l]),c.useEffect(()=>{if(typeof window>"u")return;const i=t=>{(t.key===null||_.has(t.key))&&d(v())};return window.addEventListener("storage",i),()=>window.removeEventListener("storage",i)},[d]);const U=c.useCallback(i=>{m.includes(i)&&u(t=>({...t,providerVisibility:{...t.providerVisibility,[i]:!t.providerVisibility[i]}}))},[u]),Y=c.useCallback(i=>{u(t=>{const n=t.providerOrder.indexOf(i);if(n<=0)return t;const s=[...t.providerOrder];return[s[n-1],s[n]]=[s[n],s[n-1]],{...t,providerOrder:s}})},[u]),z=c.useCallback(i=>{u(t=>{const n=t.providerOrder.indexOf(i);if(n<0||n>=t.providerOrder.length-1)return t;const s=[...t.providerOrder];return[s[n],s[n+1]]=[s[n+1],s[n]],{...t,providerOrder:s}})},[u]),q=c.useCallback((i,t)=>{i!==t&&u(n=>{const s=n.providerOrder.indexOf(i),p=n.providerOrder.indexOf(t);if(s<0||p<0)return n;const f=[...n.providerOrder],[j]=f.splice(s,1);return f.splice(p,0,j),{...n,providerOrder:f}})},[u]),G=c.useCallback(()=>{u(()=>({displayMode:w.USED,providerOrder:h(),providerVisibility:b(),showSubscriptions:!0}))},[u]),J=c.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:T,setShowSubscriptions:x,visibleOrdered:J,toggle:U,moveUp:Y,moveDown:z,moveToward:q,reset:G}}export{Z as L,Se as a,w as b,Q as c,fe as d,we as i,me as l,ye as u};
1
+ import{c as a,r as c,K as N,M as B,N as F,O as H}from"./__vite-browser-external-CPMSmJgP.js";const Q=["claude","codex","cursor","gemini","kimi","kiro","grok","copilot","antigravity","zcode","opencodeGo","commandCode","qoder","qoderCn","codingPlan","agentPlan","devin"],W={claude:"CLAUDE",codex:"CODEX",cursor:"CURSOR",gemini:"GEMINI",kimi:"KIMI",kiro:"KIRO",grok:"GROK",copilot:"COPILOT",antigravity:"ANTIGRAVITY",zcode:"ZCODE",opencodeGo:"OPENCODE",commandCode:"COMMAND-CODE",qoder:"QODER",qoderCn:"QODER-CN",codingPlan:"VOLCANO-ARK",agentPlan:"VOLCANO-ARK",devin:"DEVIN"};function fe(e){return W[e]||null}function me(e){switch(e){case"claude":return a("limits.provider.claude");case"codex":return a("limits.provider.codex");case"cursor":return a("limits.provider.cursor");case"gemini":return a("limits.provider.gemini");case"kimi":return a("limits.provider.kimi");case"kiro":return a("limits.provider.kiro");case"grok":return a("limits.provider.grok");case"copilot":return a("limits.provider.copilot");case"antigravity":return a("limits.provider.antigravity");case"zcode":return a("limits.provider.zcode");case"opencodeGo":return a("limits.provider.opencode_go");case"commandCode":return a("limits.provider.command_code");case"qoder":return a("limits.provider.qoder");case"qoderCn":return a("limits.provider.qoder_cn");case"codingPlan":return a("limits.provider.ark_coding_plan");case"agentPlan":return a("limits.provider.ark_agent_plan");case"devin":return a("limits.provider.devin");default:return String(e||"")}}const m=Q,E="tt.limits.providerOrder",I="tt.limits.providerVisibility",A="tt.limits.displayMode",D="tt.limits.showSubscriptions",O="tt.limits.updatedAt",C="limitsPreferences",X="limitsDisplayMode",Z="tt:limits-prefs-changed",w=Object.freeze({USED:"used",REMAINING:"remaining"}),g=new Set(Object.values(w)),_=new Set([E,I,A,D,O]);function h(){return[...m]}const $=new Set(["devin"]);function b(){return Object.fromEntries(m.map(e=>[e,!$.has(e)]))}function L(e){const r=[];if(Array.isArray(e))for(const o of e)m.includes(o)&&!r.includes(o)&&r.push(o);for(const o of m)r.includes(o)||r.push(o);return r}function P(e){const r=b();if(!e||typeof e!="object"||Array.isArray(e))return r;for(const o of m)typeof e[o]=="boolean"&&(r[o]=e[o]);return r}function ee(e){return g.has(e)?e:w.USED}function k(e){return typeof e=="boolean"?e:!0}function S(e){if(e!=null){if(typeof e=="number")return Number.isSafeInteger(e)?e:void 0;if(typeof e=="string"){const r=e.trim();if(r==="")return;const o=Number(r);return Number.isSafeInteger(o)?o:void 0}}}function y(e={}){const r=e&&typeof e=="object"?e:{};return{displayMode:ee(r.displayMode),providerOrder:L(r.providerOrder),providerVisibility:P(r.providerVisibility),showSubscriptions:k(r.showSubscriptions),updatedAt:S(r.updatedAt)}}function re(){if(typeof window>"u")return h();try{const e=window.localStorage.getItem(E);return L(e?JSON.parse(e):void 0)}catch{return h()}}function R(){if(typeof window>"u")return b();try{const e=window.localStorage.getItem(I);return P(e?JSON.parse(e):void 0)}catch{return b()}}function Se(e){return e===null||_.has(e)}function we(){return R().devin===!0}function te(){if(typeof window>"u")return w.USED;try{const e=window.localStorage.getItem(A);return g.has(e)?e:w.USED}catch{return w.USED}}function ie(){if(typeof window>"u")return!0;try{const e=window.localStorage.getItem(D);return e===null?!0:k(JSON.parse(e))}catch{return!0}}function ne(){if(!(typeof window>"u"))try{return S(window.localStorage.getItem(O))}catch{return}}function oe(){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 v(){return y({displayMode:te(),providerOrder:re(),providerVisibility:R(),showSubscriptions:ie(),updatedAt:ne()})}function se(e){if(typeof window>"u")return;const r=y(e);try{window.localStorage.setItem(E,JSON.stringify(r.providerOrder)),window.localStorage.setItem(I,JSON.stringify(r.providerVisibility)),window.localStorage.setItem(A,r.displayMode),window.localStorage.setItem(D,JSON.stringify(r.showSubscriptions)),r.updatedAt===void 0?window.localStorage.removeItem(O):window.localStorage.setItem(O,String(r.updatedAt))}catch(o){console.warn("[tokentracker] limits preferences localStorage write failed:",o)}}function de(e){const r=y(e);return{displayMode:r.displayMode,providerOrder:[...r.providerOrder],providerVisibility:{...r.providerVisibility},showSubscriptions:r.showSubscriptions,updatedAt:r.updatedAt??null}}function ae(...e){let r;for(const d of e){const l=S(d);l!==void 0&&(r=r===void 0?l:Math.max(r,l))}const o=Date.now();return r!==void 0&&o<=r?r+1:o}function ce(e,r){return e.length===r.length&&e.every((o,d)=>o===r[d])}function ue(e,r){return m.every(o=>e[o]===r[o])}function K(e,r){return e.displayMode===r.displayMode&&ce(e.providerOrder,r.providerOrder)&&ue(e.providerVisibility,r.providerVisibility)&&e.showSubscriptions===r.showSubscriptions}function le(e,r){return K(e,r)&&S(e.updatedAt)===S(r.updatedAt)}function V(e,r){const o=S(e.updatedAt),d=S(r.updatedAt);return o!==void 0&&(d===void 0||o>d)}function ye(){const[e,r]=c.useState(v),o=c.useRef(e),d=c.useCallback((i,t={})=>{const n=y(i);return o.current=n,r(n),t.writeLocal&&se(n),typeof window<"u"&&window.dispatchEvent(new CustomEvent(Z)),n},[]),l=c.useCallback(i=>{N()&&B(C,de(i))},[]),u=c.useCallback(i=>{const t=v(),n=V(t,o.current)?d(t):o.current,s=y(i(n));if(K(n,s))return;const p=ae(t.updatedAt,n.updatedAt),f=d({...s,updatedAt:p},{writeLocal:!0});l(f)},[d,l]),T=c.useCallback(i=>{g.has(i)&&u(t=>({...t,displayMode:i}))},[u]),x=c.useCallback(i=>{u(t=>({...t,showSubscriptions:!!i}))},[u]),M=c.useCallback(i=>{if(!g.has(i))return;const t=v();if(t.updatedAt!==void 0){d(t);return}d({...t,displayMode:i,updatedAt:void 0},{writeLocal:!0})},[d]);c.useEffect(()=>{if(!N())return;const i=F(t=>{const n=t?.[C];if(n&&typeof n=="object"){const s=y(n);if(!oe()){d(s,{writeLocal:!0});return}const p=v();if(V(s,p))d(s,{writeLocal:!0});else{const f=d(p);le(s,p)||l(f)}return}M(t?.[X])});return H(),i},[M,d,l]),c.useEffect(()=>{if(typeof window>"u")return;const i=t=>{(t.key===null||_.has(t.key))&&d(v())};return window.addEventListener("storage",i),()=>window.removeEventListener("storage",i)},[d]);const U=c.useCallback(i=>{m.includes(i)&&u(t=>({...t,providerVisibility:{...t.providerVisibility,[i]:!t.providerVisibility[i]}}))},[u]),Y=c.useCallback(i=>{u(t=>{const n=t.providerOrder.indexOf(i);if(n<=0)return t;const s=[...t.providerOrder];return[s[n-1],s[n]]=[s[n],s[n-1]],{...t,providerOrder:s}})},[u]),z=c.useCallback(i=>{u(t=>{const n=t.providerOrder.indexOf(i);if(n<0||n>=t.providerOrder.length-1)return t;const s=[...t.providerOrder];return[s[n],s[n+1]]=[s[n+1],s[n]],{...t,providerOrder:s}})},[u]),q=c.useCallback((i,t)=>{i!==t&&u(n=>{const s=n.providerOrder.indexOf(i),p=n.providerOrder.indexOf(t);if(s<0||p<0)return n;const f=[...n.providerOrder],[J]=f.splice(s,1);return f.splice(p,0,J),{...n,providerOrder:f}})},[u]),G=c.useCallback(()=>{u(()=>({displayMode:w.USED,providerOrder:h(),providerVisibility:b(),showSubscriptions:!0}))},[u]),j=c.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:T,setShowSubscriptions:x,visibleOrdered:j,toggle:U,moveUp:Y,moveDown:z,moveToward:q,reset:G}}export{Z as L,Se as a,w as b,Q as c,fe as d,we as i,me as l,ye as u};
@@ -1 +1 @@
1
- import{r as f}from"./__vite-browser-external-VmN0WaC3.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-CPMSmJgP.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,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/BotAnimated-BLYZyT1O.js","assets/__vite-browser-external-CPMSmJgP.js","assets/__vite-browser-external-DrXtuPP9.css","assets/skins-Mc0sI20C.js"])))=>i.map(i=>d[i]);
2
+ import{r as s,j as g,_ as T,$ as B,al as M,am as P,an as $,ao as z,ap as N}from"./__vite-browser-external-CPMSmJgP.js";const I=Object.assign(Object.create(null),{clawd:"clawd",bot:"vector"});function F(e){return I[f(e)]||"atlas"}function f(e){const t=String(e||"").trim().toLowerCase();return/^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/.test(t)?t:"clawd"}const D=.84,U=1.35,V=Object.assign(Object.create(null),{clawd:D,bot:U});function R(e){return V[f(e)]??1}const H={idle:{row:0,durations:[280,110,110,140,140,320]},"running-right":{row:1,durations:[120,120,120,120,120,120,120,220]},"running-left":{row:2,durations:[120,120,120,120,120,120,120,220]},waving:{row:3,durations:[140,140,140,280]},jumping:{row:4,durations:[140,140,140,140,280]},failed:{row:5,durations:[140,140,140,140,140,140,140,240]},waiting:{row:6,durations:[150,150,150,150,150,260]},running:{row:7,durations:[120,120,120,120,120,220]},review:{row:8,durations:[150,150,150,150,150,280]}};function q(e){return["error","disconnected","working-overheated"].includes(e)?"failed":["happy","waking","mini-happy","jumping"].includes(e)?"jumping":["working-typing","working-ultrathink","working-juggling","running"].includes(e)?"running":["working-thinking","working-wizard","review"].includes(e)?"review":["sleeping","idle-doze","mini-sleep","waiting"].includes(e)?"waiting":["mini-peek","waving"].includes(e)?"waving":e==="running-left"||e==="running-right"?e:"idle"}function K(){const[e,t]=s.useState(()=>typeof document>"u"?!0:document.visibilityState!=="hidden");return s.useEffect(()=>{if(typeof document>"u")return;const n=()=>t(document.visibilityState!=="hidden");return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},[]),e}function W(){const[e,t]=s.useState(()=>typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return s.useEffect(()=>{if(typeof window.matchMedia!="function")return;const n=window.matchMedia("(prefers-reduced-motion: reduce)"),i=o=>t(o.matches);return n.addEventListener("change",i),()=>n.removeEventListener("change",i)},[]),e}function G({character:e,pet:t=null,state:n="idle-living",dragState:i=null,size:o=48,className:d="",lookDirectionIndex:l=null}){const r=f(e),u=i==="running-left"||i==="running-right"?i:q(n),c=H[u],a=t?.spriteVersionNumber===2?2:1,p=a===2?11:9,w=a===2&&u==="idle"&&Number.isInteger(l)?(l%16+16)%16:null,h=w==null?c.row:9+Math.floor(w/8),m=w==null?null:w%8,k=W(),b=K(),[y,S]=s.useState(0);s.useEffect(()=>{if(S(0),k||!b||w!=null)return;let E=!1,_=0;const A=C=>{_=window.setTimeout(()=>{if(E)return;const L=(C+1)%c.durations.length;S(L),A(L)},c.durations[C])};return A(0),()=>{E=!0,window.clearTimeout(_)}},[w,k,b,c]);const O=s.useMemo(()=>({width:o*(192/208),height:o,backgroundImage:`url(${t?.assetUrl||`/pets/${r}/spritesheet.webp`})`,backgroundRepeat:"no-repeat",backgroundSize:`800% ${p*100}%`,backgroundPosition:`${(m??y)/7*100}% ${h/(p-1)*100}%`,imageRendering:"pixelated"}),[p,m,h,y,r,t?.assetUrl,o]);return g.jsx("div",{"aria-hidden":"true",className:`pet-atlas-animated ${d}`,style:O})}const X=s.lazy(()=>T(()=>import("./BotAnimated-BLYZyT1O.js"),__vite__mapDeps([0,1,2,3])).then(e=>({default:e.BotAnimated}))),x={"idle-living":"idle/living.svg","idle-doze":"idle/doze.svg","idle-follow":"idle/follow.svg","idle-look":"idle/look.svg","idle-yawn":"idle/yawn.svg","idle-collapse":"idle/collapse.svg","working-building":"working/building.svg","working-carrying":"working/carrying.svg","working-conducting":"working/conducting.svg","working-confused":"working/confused.svg","working-debugger":"working/debugger.svg","working-juggling":"working/juggling.svg","working-overheated":"working/overheated.svg","working-pushing":"working/pushing.svg","working-sweeping":"working/sweeping.svg","working-thinking":"working/thinking.svg","working-typing":"working/typing.svg","working-ultrathink":"working/ultrathink.svg","working-wizard":"working/wizard.svg","mini-alert":"mini/alert.svg","mini-crabwalk":"mini/crabwalk.svg","mini-enter":"mini/enter.svg","mini-enter-sleep":"mini/enter-sleep.svg","mini-happy":"mini/happy.svg","mini-idle":"mini/idle.svg","mini-peek":"mini/peek.svg","mini-sleep":"mini/sleep.svg","react-double":"react/double.svg","react-drag":"react/drag.svg","react-left":"react/left.svg","react-right":"react/right.svg","collapse-sleep":"sleep/collapse-sleep.svg",sleeping:"sleep/sleeping.svg",wake:"sleep/wake.svg",disconnected:"status/disconnected.svg",error:"status/error.svg",notification:"status/notification.svg",happy:"happy.svg","static-base":"static-base.svg"},v=new Map;async function J(e){if(v.has(e))return v.get(e);if(typeof fetch!="function")return null;let t;try{t=await fetch(`/clawd/${e}`)}catch{return null}if(!t.ok)return null;const i=(await t.text()).replace(/<svg([^>]*)>/,(o,d)=>`<svg${d.replace(/\s+width="[^"]*"/g,"").replace(/\s+height="[^"]*"/g,"")} width="100%" height="100%">`);return v.set(e,i),i}function Q({state:e="idle-living",size:t=48,className:n=""}){const[i,o]=s.useState(""),d=s.useRef(null),r=Y()?"static-base":e,u=x[r]||x["static-base"];return s.useEffect(()=>{let c=!1;return J(u).then(a=>{!c&&a&&o(a)}),()=>{c=!0}},[u]),s.useEffect(()=>{const c=d.current?.querySelector("svg");if(c)try{const a=c.getBBox();a.width>0&&a.height>0&&c.setAttribute("viewBox",`${a.x-2} ${a.y-2} ${a.width+4} ${a.height+4}`)}catch{}},[i]),g.jsx("div",{ref:d,"aria-hidden":"true",className:`clawd-animated ${n}`,style:{width:t,height:t,display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},dangerouslySetInnerHTML:{__html:i}})}function ae({state:e="idle-living",size:t=48,className:n="",character:i="clawd",pet:o=null,lookDirectionIndex:d=null,botColor:l="auto"}){const r=f(i),u=F(r);return u==="vector"?g.jsx(s.Suspense,{fallback:g.jsx("span",{"aria-hidden":"true",style:{width:t,height:t,display:"inline-block"}}),children:g.jsx(X,{state:e,size:t*R(r),className:n,color:l})}):u==="atlas"?g.jsx(G,{character:r,pet:o,state:e,size:t,className:n,lookDirectionIndex:d}):g.jsx(Q,{state:e,size:t*R(r),className:n})}function Y(){const[e,t]=s.useState(()=>typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return s.useEffect(()=>{if(typeof window.matchMedia!="function")return;const n=window.matchMedia("(prefers-reduced-motion: reduce)"),i=o=>t(o.matches);return n.addEventListener("change",i),()=>n.removeEventListener("change",i)},[]),e}const le="cercle",Z="neutre",ee="encre",te="creme",ce={light:"#f8fafc",dark:"#0f172a"};function ne(e){return e?te:ee}const j=["auto","bleu","turquoise","vert","ambre","rose","violet"];function de(e,t){const n=String(e||"auto");return n==="auto"||!j.includes(n)?ne(t):n}const ie={"idle-living":{state:"idle",expression:"neutre"},"idle-look":{state:"idle",expression:"curieux"},"idle-follow":{state:"idle",expression:"attentif"},"idle-yawn":{state:"idle",expression:"somnolent"},"static-base":{state:"idle",expression:"neutre"},sleeping:{state:"sleep"},"idle-doze":{state:"sleep"},"idle-collapse":{state:"sleep"},"collapse-sleep":{state:"sleep"},"mini-enter-sleep":{state:"sleep"},"mini-sleep":{state:"sleep"},waiting:{state:"sleep"},"working-typing":{state:"thinking"},"working-thinking":{state:"thinking"},"working-building":{state:"thinking"},"working-debugger":{state:"thinking"},running:{state:"thinking"},review:{state:"thinking"},"working-juggling":{state:"orbit"},"working-wizard":{state:"orbit"},"working-carrying":{state:"orbit"},"working-conducting":{state:"orbit"},"working-ultrathink":{state:"swirl"},"working-overheated":{state:"burst"},"working-confused":{state:"wide"},error:{state:"alert"},disconnected:{state:"alert"},happy:{state:"play"},jumping:{state:"play"},"mini-happy":{state:"play"},waking:{state:"play"},wake:{state:"play"},"react-double":{state:"play"},notification:{state:"notify"},"mini-alert":{state:"notify"},"mini-peek":{state:"wink"},waving:{state:"wink"},"mini-idle":{state:"idle",expression:"neutre"},"mini-enter":{state:"wink"},"running-left":{state:"comet"},"running-right":{state:"comet"},"react-drag":{state:"comet"}},re={state:"idle",expression:Z};function ue(e){return ie[e]||re}const se={visible:!1,character:"clawd",size:"medium",botColor:"auto"};function ge(){const e=(B()||M())&&P(),[t,n]=s.useState(se),[i,o]=s.useState(!1);s.useEffect(()=>{if(!e)return;const l=$(r=>{o(!0),n({visible:!!r.visible,character:f(r.character),size:["small","medium","large"].includes(r.size)?r.size:"medium",botColor:j.includes(r.botColor)?r.botColor:"auto"})});return z(),l},[e]);const d=s.useCallback((l,r)=>{n(u=>({...u,[l]:r})),e&&N(l,r)},[e]);return{available:e,loaded:i,settings:t,setSetting:d}}export{j as B,ae as C,ee as a,te as b,le as c,ce as d,ue as e,F as p,de as r,ge as u};
@@ -0,0 +1 @@
1
+ import{r as o}from"./__vite-browser-external-CPMSmJgP.js";import{h as r,i as t,p as s}from"./react-CZdcuJ28.js";function i(){!r.current&&t();const[e]=o.useState(s.current);return e}export{i as u};
@@ -1 +1 @@
1
- import{m as f,r as n}from"./__vite-browser-external-VmN0WaC3.js";const u={name:"pencil",size:24,node:[["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"}]]};u.node;const E=f(u),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 f,r as n}from"./__vite-browser-external-CPMSmJgP.js";const u={name:"pencil",size:24,node:[["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"}]]};u.node;const E=f(u),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-QPulAuJP.js";import{r as f}from"./__vite-browser-external-VmN0WaC3.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-CZdcuJ28.js";import{r as f}from"./__vite-browser-external-CPMSmJgP.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};
@@ -0,0 +1 @@
1
+ import{K as S,af as M,r as w,c as P,ag as O,ah as R,ai as g,aj as j}from"./__vite-browser-external-CPMSmJgP.js";import{l as q,i as _,L as F,a as z}from"./use-limits-display-prefs-CbXApWU1.js";import{u as T}from"./use-latest-request-guard-viIhH7H5.js";const L="native:notificationPermission";let I=null;function D(){return typeof window<"u"&&!!window.chrome?.webview}function x(){return S()?I||"unknown":D()?"granted":typeof Notification>"u"?"unsupported":Notification.permission}function $(e){if(typeof window>"u")return()=>{};const i=n=>{const s=n?.detail?.status;typeof s=="string"&&(I=s),e(x())};return window.addEventListener(L,i),e(x()),S()&&M({type:"getNotificationStatus"}),()=>window.removeEventListener(L,i)}async function B(){if(S()){M({type:"requestNotificationPermission"});return}D()||typeof Notification<"u"&&Notification.permission==="default"&&await Notification.requestPermission().catch(()=>"denied")}const v="tt.limitAlerts.enabled";function G(){try{return window.localStorage.getItem(v)==="1"}catch{return!1}}function le(){const[e,i]=w.useState(G),[n,s]=w.useState("unknown");w.useEffect(()=>$(s),[]);const y=w.useCallback(async o=>{const l=!!o;l&&await B();try{window.localStorage.setItem(v,l?"1":"0")}catch{}i(l)},[]);return{enabled:e,setEnabled:y,permissionBlocked:n==="denied"}}function V(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 H(e,i,n=.03){return e>i+n}function U(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 J(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 W(e){return e==null?NaN:typeof e=="number"?e*1e3:Date.parse(e)}function Y({usedPercent:e,windowSeconds:i,resetMs:n,mode:s,now:y=Date.now()}){const o=Math.min(Math.max(Number(e)||0,0),100)/100,l={pacePercent:null,paceOver:!1,expectedPercent:null,runsOutEta:null,projectedEnd:null};if(!(i>0)||!Number.isFinite(n)||n<=y)return l;const a=Math.max(0,(n-y)/1e3),r=V(i,a);if(r==null)return l;if(l.expectedPercent=Math.round(r*100),l.paceOver=H(o,r),o>0){const m=s==="remaining"?1-r:r;l.pacePercent=m*100}if(r>.02&&o>0){const m=i*r,u=o/m,f=o/r;f>=1&&u>0?l.runsOutEta=U((1-o)/u):l.projectedEnd=Math.round(Math.min(f,1)*100)}return l}const Q={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",s=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:s},{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){if(e.plan_kind==="coding-plan")return[{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}];const i=Array.isArray(e.buckets)?e.buckets.filter(n=>n?.label&&n.window):[];return i.length?i.map((n,s)=>({key:`bucket-${n.entitlement_id||s}`,label:n.label,window:n.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}]}},commandCode:{windows(e){return[{key:"5h",labelKey:"limits.label.command_code_5h",window:e.primary_window},{key:"weekly",labelKey:"limits.label.command_code_weekly",window:e.secondary_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}]}},devin:{windows(e){return[{key:"daily",labelKey:"limits.label.devin_daily",window:e.primary_window,windowSecondsField:"limit_window_seconds"},{key:"weekly",labelKey:"limits.label.devin_weekly",window:e.secondary_window,windowSecondsField:"limit_window_seconds"}]}}},A="tt.limitAlerts.cycles.v1";function X(){try{return JSON.parse(window.localStorage.getItem(A)||"{}")}catch{return{}}}function Z(e){try{window.localStorage.setItem(A,JSON.stringify(e))}catch{}}function ee(e,{now:i=Date.now()}={}){const n=[],s=Q;for(const[y,o]of Object.entries(e||{})){const l=s[y];if(!(!o?.configured||o.error||!l))for(const a of l.windows(o)){if(!a.window)continue;const r=Number(a.pctField==="utilization"?a.window.utilization:a.window.used_percent),m=a.resetField==="resets_at"?a.window.resets_at:a.window.reset_at,u=W(m),f=Y({usedPercent:r,windowSeconds:J(a,a.window),resetMs:u,mode:"used",now:i});!f.runsOutEta||!f.paceOver||r<20||!(u>i)||n.push({id:`${y}:${a.key}:${u}`,providerId:y,windowKey:a.key,resetMs:u,usedPercent:r,runsOutEta:f.runsOutEta})}}return n}function ie(e){const i=X(),n=ee(e);for(const o of n){if(i[o.id])continue;const l=q(o.providerId),a=P("limits.alert.title",{provider:l}),r=P("limits.alert.body",{eta:o.runsOutEta,percent:Math.round(o.usedPercent)});let m=O({title:a,body:r,id:o.id});!m&&typeof Notification<"u"&&Notification.permission==="granted"&&(new Notification(a,{body:r,tag:o.id}),m=!0),m&&(i[o.id]=Date.now())}const s=Date.now()-864e5,y=Object.fromEntries(Object.entries(i).filter(([o,l])=>{const a=Number(o.split(":").at(-1));return Number.isFinite(a)?a>=s:Number(l)>=s}).slice(-100));return Z(y),n.length}function k(e,i){return!e||i||!e.devin||e.devin.configured===!1&&Object.keys(e.devin).length===1?e:{...e,devin:{configured:!1}}}function re(e){const i=j(),n=i&&!!e?.initialState,[s,y]=w.useState(_),[o,l]=w.useState(()=>n?k(e?.initialState?.data??null,_()):null),[a,r]=w.useState(()=>n?e?.initialState?.error??null:null),[m,u]=w.useState(i&&!n),f=!!e?.initialRefresh,K=!!e?.publishToPreloadCache,b=T([s,i]);w.useEffect(()=>{if(typeof window>"u")return;const d=()=>y(_()),t=c=>{z(c.key)&&d()};return window.addEventListener(F,d),window.addEventListener("storage",t),()=>{window.removeEventListener(F,d),window.removeEventListener("storage",t)}},[]),w.useEffect(()=>{if(!(!i||!o||typeof window>"u"))try{window.localStorage.getItem(v)==="1"&&ie(o)}catch{}},[o,i]);const p=w.useCallback((d,t)=>{!i||!K||!d||typeof d!="object"||R(k(d,_()),{source:t})},[i,K]),C=w.useCallback(async()=>{if(!i)return;const d=b();try{const t=await g({refresh:!0,devinEnabled:_()});if(!d())return;const c=t&&typeof t=="object"?t:null;l(k(c,_())),r(null),u(!1),p(c,"manual-refresh")}catch(t){if(!d())return;r(t?.message||String(t)),u(!1)}},[b,i,p]),h=w.useCallback(async()=>{if(!i)return;const d=b();try{const t=await g({devinEnabled:_()});if(!d())return;const c=t&&typeof t=="object"?t:null;l(k(c,_())),r(null),u(!1),p(c,"page-load")}catch(t){if(!d())return;r(t?.message||String(t)),u(!1)}},[b,i,p]);w.useEffect(()=>{if(!i||typeof window>"u"||typeof document>"u")return;const d=15e3;let t=Date.now();const c=()=>{if(document.visibilityState!=="visible")return;const N=Date.now();N-t<d||(t=N,h())};return window.addEventListener("focus",c),document.addEventListener("visibilitychange",c),()=>{window.removeEventListener("focus",c),document.removeEventListener("visibilitychange",c)}},[i,h]);const E=w.useRef(s);return w.useEffect(()=>{E.current!==s&&(E.current=s,i&&(s||l(d=>k(d,!1)),h()))},[s,i,h]),w.useEffect(()=>{if(!i){l(null),r(null),u(!1);return}if(n&&!f)return;const d=b();(async()=>{try{const t=await g({devinEnabled:_()});if(!d())return;const c=t&&typeof t=="object"?t:null;l(k(c,_())),r(null),p(c,"page-load")}catch(t){if(!d())return;r(t?.message||String(t))}finally{d()&&u(!1)}})()},[b,n,f,i,p]),{data:o,error:a,isLoading:m,refresh:C}}export{Q as P,J as a,le as b,Y as c,W as r,ie as s,re as u};
@@ -1 +1 @@
1
- import{r as e,C as t,D as r,q as c}from"./__vite-browser-external-VmN0WaC3.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,t as c}from"./__vite-browser-external-CPMSmJgP.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};
@@ -0,0 +1 @@
1
+ import{r as e,T as r,n,o as s,p as a,q as T}from"./__vite-browser-external-CPMSmJgP.js";const m=Object.freeze({mode:s.COMPACT,setMode:()=>{},grouping:n.THOUSAND,setGrouping:()=>{},formatTokens:(o,t={})=>T(o,t),formatTokensTooltip:(o,t={})=>a(o,t)});function u(){return e.useContext(r)??m}export{u};
@@ -1 +1 @@
1
- import{m as e}from"./__vite-browser-external-VmN0WaC3.js";const a={name:"zap",size:24,node:[["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"}]]};a.node;const n=e(a);export{n as Z};
1
+ import{m as e}from"./__vite-browser-external-CPMSmJgP.js";const a={name:"zap",size:24,node:[["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"}]]};a.node;const n=e(a);export{n as Z};
@@ -272,8 +272,8 @@
272
272
  ]
273
273
  }
274
274
  </script>
275
- <script type="module" crossorigin src="/assets/__vite-browser-external-VmN0WaC3.js"></script>
276
- <link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-Bg0J-a5P.css">
275
+ <script type="module" crossorigin src="/assets/__vite-browser-external-CPMSmJgP.js"></script>
276
+ <link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-DrXtuPP9.css">
277
277
  </head>
278
278
  <body>
279
279
  <main class="aeo-seed-content" aria-label="Token Tracker AI-readable summary">
@@ -164,8 +164,8 @@
164
164
  ]
165
165
  }
166
166
  </script>
167
- <script type="module" crossorigin src="/assets/__vite-browser-external-VmN0WaC3.js"></script>
168
- <link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-Bg0J-a5P.css">
167
+ <script type="module" crossorigin src="/assets/__vite-browser-external-CPMSmJgP.js"></script>
168
+ <link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-DrXtuPP9.css">
169
169
  </head>
170
170
  <body>
171
171
  <main class="aeo-seed-content" aria-label="Claude IP Check AI-readable summary">
@@ -135,8 +135,8 @@
135
135
  ]
136
136
  }
137
137
  </script>
138
- <script type="module" crossorigin src="/assets/__vite-browser-external-VmN0WaC3.js"></script>
139
- <link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-Bg0J-a5P.css">
138
+ <script type="module" crossorigin src="/assets/__vite-browser-external-CPMSmJgP.js"></script>
139
+ <link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-DrXtuPP9.css">
140
140
  </head>
141
141
  <body>
142
142
  <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-VmN0WaC3.js"></script>
79
- <link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-Bg0J-a5P.css">
78
+ <script type="module" crossorigin src="/assets/__vite-browser-external-CPMSmJgP.js"></script>
79
+ <link rel="stylesheet" crossorigin href="/assets/__vite-browser-external-DrXtuPP9.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": "1.1.11",
3
+ "version": "1.1.13",
4
4
  "description": "Local-first AI coding token usage and cost tracker for 43 tools, with a dashboard, desktop pet, widgets, achievements, and native macOS/Windows apps.",
5
5
  "main": "src/cli.js",
6
6
  "bin": {
@@ -25,7 +25,7 @@
25
25
  "copy:pull": "node scripts/copy-sync.cjs pull",
26
26
  "copy:push": "node scripts/copy-sync.cjs push",
27
27
  "dashboard:build": "npm --prefix dashboard run build",
28
- "linux:bundle": "npm run dashboard:build && npm --prefix TokenTrackerLinux run bundle:node",
28
+ "linux:bundle": "TOKENTRACKER_BUILD_PET=1 npm run dashboard:build && npm --prefix TokenTrackerLinux run bundle:node",
29
29
  "linux:build": "npm run linux:bundle && npm --prefix TokenTrackerLinux run build",
30
30
  "linux:package:local": "npm --prefix TokenTrackerLinux run package:local",
31
31
  "dashboard:dev": "npm --prefix dashboard run dev",
@@ -52,6 +52,7 @@
52
52
  "dependencies": {
53
53
  "@journeyapps/wa-sqlite": "2.0.6",
54
54
  "@mongodb-js/zstd": "^2.0.1",
55
+ "smol-toml": "^1.9.0",
55
56
  "undici": "8.11.2",
56
57
  "yauzl": "^3.4.0"
57
58
  },
@@ -1334,17 +1334,13 @@ async function cmdSync(argv, context = {}) {
1334
1334
  });
1335
1335
 
1336
1336
  const parseOpencodeForInstall = async (options) => {
1337
- const { storageDir, dbDir, cursors } = options;
1337
+ const { dbDir, cursors, messageFiles } = options;
1338
1338
  let filesResult = { filesProcessed: 0, eventsAggregated: 0, bucketsQueued: 0 };
1339
- if (storageDir) {
1340
- const storagePath = path.join(storageDir, "storage");
1341
- const messageFiles = await listOpencodeMessageFiles(storagePath);
1342
- if (messageFiles.length > 0) {
1343
- filesResult = await parseOpencodeIncremental({
1344
- ...options,
1345
- messageFiles,
1346
- });
1347
- }
1339
+ if (messageFiles.length > 0) {
1340
+ filesResult = await parseOpencodeIncremental({
1341
+ ...options,
1342
+ messageFiles,
1343
+ });
1348
1344
  }
1349
1345
 
1350
1346
  let dbResult = { messagesProcessed: 0, eventsAggregated: 0, bucketsQueued: 0 };
@@ -1360,6 +1356,7 @@ async function cmdSync(argv, context = {}) {
1360
1356
  dbMessages: dbRead.messages,
1361
1357
  dbCursor: dbRead.cursor,
1362
1358
  dbPath,
1359
+ opencodeCursorStore: cursorStore,
1363
1360
  });
1364
1361
  }
1365
1362
  }
@@ -1375,26 +1372,57 @@ async function cmdSync(argv, context = {}) {
1375
1372
  native: storagePaths.native || dbPaths.native,
1376
1373
  wsl: storagePaths.wsl || dbPaths.wsl,
1377
1374
  };
1375
+ const installKeys = Object.keys(opencodePaths).filter((key) => opencodePaths[key]);
1376
+ const messageFilesByInstall = {};
1377
+ for (const key of installKeys) {
1378
+ messageFilesByInstall[key] = storagePaths[key]
1379
+ ? await listOpencodeMessageFiles(path.join(storagePaths[key], "storage"))
1380
+ : [];
1381
+ }
1382
+ const storedOpencode = cursors.opencode;
1383
+ const storedNamespaced = Boolean(
1384
+ storedOpencode &&
1385
+ typeof storedOpencode === "object" &&
1386
+ (storedOpencode.native !== undefined || storedOpencode.wsl !== undefined),
1387
+ );
1388
+ if (
1389
+ storedNamespaced !== (installKeys.length > 1) ||
1390
+ Object.values(messageFilesByInstall).some((files) => files.length > 0)
1391
+ ) {
1392
+ await cursorStore.materializeAllOpencodeState();
1393
+ }
1378
1394
 
1379
- const multiResult = await multiInstallParse({
1380
- paths: opencodePaths,
1381
- parserFn: parseOpencodeForInstall,
1382
- providerName: "opencode",
1383
- cursors,
1384
- queuePath,
1385
- projectQueuePath,
1386
- getParams: (p, key) => ({ storageDir: storagePaths[key], dbDir: dbPaths[key] }),
1387
- onProgress: (p) => {
1388
- if (!progress?.enabled) return;
1389
- const pct = p.total > 0 ? p.index / p.total : 1;
1390
- progress.update(
1391
- `Parsing Opencode (${p.install || "default"}) ${renderBar(pct)} ${formatNumber(
1392
- p.index,
1393
- )}/${formatNumber(p.total)} | buckets ${formatNumber(p.bucketsQueued)}`,
1394
- );
1395
- },
1396
- source: "opencode",
1397
- });
1395
+ let multiResult;
1396
+ for (let attempt = 0; attempt < 2; attempt += 1) {
1397
+ try {
1398
+ multiResult = await multiInstallParse({
1399
+ paths: opencodePaths,
1400
+ parserFn: parseOpencodeForInstall,
1401
+ providerName: "opencode",
1402
+ cursors,
1403
+ queuePath,
1404
+ projectQueuePath,
1405
+ getParams: (_p, key) => ({
1406
+ dbDir: dbPaths[key],
1407
+ messageFiles: messageFilesByInstall[key] || [],
1408
+ opencodeCursorNamespace: installKeys.length > 1 ? key : "flat",
1409
+ }),
1410
+ onProgress: (p) => {
1411
+ if (!progress?.enabled) return;
1412
+ const pct = p.total > 0 ? p.index / p.total : 1;
1413
+ progress.update(
1414
+ `Parsing Opencode (${p.install || "default"}) ${renderBar(pct)} ${formatNumber(
1415
+ p.index,
1416
+ )}/${formatNumber(p.total)} | buckets ${formatNumber(p.bucketsQueued)}`,
1417
+ );
1418
+ },
1419
+ source: "opencode",
1420
+ });
1421
+ break;
1422
+ } catch (error) {
1423
+ if (!isCursorStoreRetry(error) || attempt > 0) throw error;
1424
+ }
1425
+ }
1398
1426
 
1399
1427
  opencodeResult = {
1400
1428
  filesProcessed: multiResult.recordsProcessed,
@@ -1,3 +1,4 @@
1
+ const { claudeUserIdentity, collectClaudeForkAliases } = require("./claude-user-identity");
1
2
  // Claude Code "Context Breakdown" categorizer.
2
3
  //
3
4
  // Reads ~/.claude/projects/**/*.jsonl and splits each assistant message's
@@ -1210,6 +1211,7 @@ async function computeClaudeGroundTruthBuckets({ rootDir = null, rootDirs = null
1210
1211
  const buckets = new Map(); // `${model}|${hourStart}` → totals
1211
1212
  const seenHashes = new Set();
1212
1213
  const userMessageBuckets = new Map(); // for conversation_count tracking
1214
+ const forkAliases = await collectClaudeForkAliases(files);
1213
1215
 
1214
1216
  for (const fp of files) {
1215
1217
  let stream;
@@ -1241,13 +1243,7 @@ async function computeClaudeGroundTruthBuckets({ rootDir = null, rootDirs = null
1241
1243
  typeof content === "string" ||
1242
1244
  (Array.isArray(content) && content.some((b) => b?.type === "text"));
1243
1245
  if (hasText) {
1244
- // Dedup by line uuid (mirrors parseClaudeFile): with multiple
1245
- // roots the same session file exists under both the native and
1246
- // the \\wsl$ path, and without this every user message — and so
1247
- // conversation_count — would double. Usage rows are already
1248
- // guarded by claudeMessageDedupKey below.
1249
- const userKey =
1250
- typeof userObj?.uuid === "string" && userObj.uuid ? `u:${userObj.uuid}` : null;
1246
+ const userKey = claudeUserIdentity(userObj, forkAliases);
1251
1247
  if (!userKey || !seenHashes.has(userKey)) {
1252
1248
  if (userKey) seenHashes.add(userKey);
1253
1249
  const ts = typeof userObj?.timestamp === "string" ? userObj.timestamp : null;
@@ -1328,6 +1324,7 @@ async function computeClaudeGroundTruthBuckets({ rootDir = null, rootDirs = null
1328
1324
  return {
1329
1325
  rows: out,
1330
1326
  seenHashes: Array.from(seenHashes),
1327
+ forkAliases,
1331
1328
  fileList: files,
1332
1329
  };
1333
1330
  }
@@ -0,0 +1,56 @@
1
+ const fs = require("node:fs");
2
+ const fsp = require("node:fs/promises");
3
+ const readline = require("node:readline");
4
+
5
+ function noteClaudeFork(aliases, obj) {
6
+ const uuid = obj?.uuid;
7
+ const parent = obj?.forkedFrom?.messageUuid;
8
+ if (typeof uuid === "string" && uuid && typeof parent === "string" && parent && uuid !== parent) {
9
+ aliases[uuid] = parent;
10
+ }
11
+ }
12
+
13
+ function claudeUserIdentity(obj, aliases) {
14
+ let uuid = typeof obj?.uuid === "string" && obj.uuid ? obj.uuid : null;
15
+ if (!uuid) return null;
16
+ const chain = new Set();
17
+ while (!chain.has(uuid)) {
18
+ chain.add(uuid);
19
+ const parent = aliases[uuid];
20
+ if (typeof parent !== "string" || !parent) return `u:${uuid}`;
21
+ uuid = parent;
22
+ }
23
+ // Malformed cycles still collapse deterministically regardless of file order.
24
+ return `u:${Array.from(chain).slice(Array.from(chain).indexOf(uuid)).sort()[0]}`;
25
+ }
26
+
27
+ async function collectClaudeForkAliases(files, cursors = {}, onFork = () => {}) {
28
+ const aliases = Object.assign(Object.create(null), cursors.claudeForkAliases || {});
29
+ for (const entry of files) {
30
+ const filePath = typeof entry === "string" ? entry : entry?.path;
31
+ if (!filePath || /[\\/]subagents[\\/]/.test(filePath)) continue;
32
+ const stat = await fsp.stat(filePath).catch(() => null);
33
+ if (!stat?.isFile()) continue;
34
+ const prev = cursors.files?.[filePath];
35
+ const start = prev?.claudeForkIndexed && prev.inode === (stat.ino || 0) && prev.offset <= stat.size ? prev.offset || 0 : 0;
36
+ if (start >= stat.size) continue;
37
+ const stream = fs.createReadStream(filePath, { encoding: "utf8", start });
38
+ const lines = readline.createInterface({ input: stream, crlfDelay: Infinity });
39
+ try {
40
+ for await (const line of lines) {
41
+ if (!line.includes('"forkedFrom"')) continue;
42
+ try {
43
+ const obj = JSON.parse(line);
44
+ if (obj?.type === "user") { noteClaudeFork(aliases, obj); onFork(obj); }
45
+ } catch { /* Ignore incomplete or malformed JSONL records. */ }
46
+ }
47
+ } finally {
48
+ lines.close();
49
+ stream.destroy();
50
+ }
51
+ if (prev) prev.claudeForkIndexed = true;
52
+ }
53
+ return aliases;
54
+ }
55
+
56
+ module.exports = { noteClaudeFork, claudeUserIdentity, collectClaudeForkAliases };