ryco-cli 0.1.15 → 0.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.cjs +2 -2
- package/dist/bin.mjs +2 -2
- package/dist/client/assets/{AccountSettings-Cey-16wq.js → AccountSettings-F4ZOTHid.js} +1 -1
- package/dist/client/assets/AiFocusSettings-DwIYKKIc.js +1 -0
- package/dist/client/assets/BranchToolbar.logic-B2jdtYEs.js +1 -0
- package/dist/client/assets/ChatRightPanel-CxA4EQ1O.js +27 -0
- package/dist/client/assets/{ChatThreadRouteView-tEo-zoCf.js → ChatThreadRouteView-BJ6OSbWZ.js} +1 -1
- package/dist/client/assets/CommandPaletteDialog-DywhkOKa.js +1 -0
- package/dist/client/assets/{ConnectionsSettings-B0-Hkwof.js → ConnectionsSettings-B8t9Z17K.js} +2 -2
- package/dist/client/assets/DiagnosticsSettings-Bt7j-SXg.js +2 -0
- package/dist/client/assets/{DraftChatThreadRouteView-BU2IGTR6.js → DraftChatThreadRouteView-BzcBT-YW.js} +1 -1
- package/dist/client/assets/{HostedConnectionControls-Cux_sRCM.js → HostedConnectionControls-DLrwfgKF.js} +1 -1
- package/dist/client/assets/{HostedHubRoot-CyySCdJV.js → HostedHubRoot-eqwMpBq5.js} +1 -1
- package/dist/client/assets/{HostedNativeAuthorizationRoute-490iDXmk.js → HostedNativeAuthorizationRoute-C11yMgF7.js} +1 -1
- package/dist/client/assets/{HostedRelayTrustNotice-CcDOAwgS.js → HostedRelayTrustNotice-CMrrvMuJ.js} +1 -1
- package/dist/client/assets/{IntegrationsSettingsPanel-BFTAvxtn.js → IntegrationsSettingsPanel-rkW9RyYH.js} +1 -1
- package/dist/client/assets/{KeybindingsSettings-VYgbhiZF.js → KeybindingsSettings-CjU5J7hU.js} +1 -1
- package/dist/client/assets/{McpServersSettings-DSDCjoTn.js → McpServersSettings-D-Gq3vgy.js} +2 -2
- package/dist/client/assets/{NewWorktreeDialog-C65Aifeb.js → NewWorktreeDialog-C4D-dD0C.js} +2 -2
- package/dist/client/assets/{NoActiveThreadState-DehHNgAp.js → NoActiveThreadState-z_FeP4Al.js} +1 -1
- package/dist/client/assets/{NodeSecuritySettings-DW9GJ-kU.js → NodeSecuritySettings-CMjnKY0w.js} +1 -1
- package/dist/client/assets/OpinionatedPluginsSettings-D9INVQf7.js +1 -0
- package/dist/client/assets/{PhoneGetAppInterstitial-CbyVrtDn.js → PhoneGetAppInterstitial-B8iVzT22.js} +1 -1
- package/dist/client/assets/{PhoneHome-c0j_TBEC.js → PhoneHome-BonZTgK7.js} +1 -1
- package/dist/client/assets/{PhoneSettingsSurface-5LFRIx_5.js → PhoneSettingsSurface-B-6LoBMV.js} +1 -1
- package/dist/client/assets/{ProjectFavicon-CeVJCQCy.js → ProjectFavicon-CxXx07Sa.js} +1 -1
- package/dist/client/assets/{ProviderModelPicker-MFRYAv_3.js → ProviderModelPicker-M_Ezjlmq.js} +1 -1
- package/dist/client/assets/{ProvidersSettingsPanel-FYBEqSr_.js → ProvidersSettingsPanel-CtTyCMP0.js} +1 -1
- package/dist/client/assets/RootAppShell-DJfVW8Xa.js +6 -0
- package/dist/client/assets/{SettingsDialog-CpwoqGS8.js → SettingsDialog-ClIbtJ2y.js} +1 -1
- package/dist/client/assets/{SettingsPanels-COWRB29-.js → SettingsPanels-DshjYQGk.js} +3 -3
- package/dist/client/assets/{SourceControlSettings-DvBNelcO.js → SourceControlSettings-C_GMp7qk.js} +1 -1
- package/dist/client/assets/{StatisticsPage-DxAKqvVX.js → StatisticsPage-CDukahZF.js} +1 -1
- package/dist/client/assets/{StatisticsPanel-C0xGLlMA.js → StatisticsPanel-BTdaxoVf.js} +1 -1
- package/dist/client/assets/{ThreadStatusIndicators-CIOM98q2.js → ThreadStatusIndicators-D_6jI6us.js} +0 -0
- package/dist/client/assets/{ThreadTerminalDrawer-DRelLlEP.js → ThreadTerminalDrawer-C2B3Ry66.js} +3 -3
- package/dist/client/assets/{ThreadWorkspacePanel-CktVSliZ.js → ThreadWorkspacePanel-D8gR7mQC.js} +6 -6
- package/dist/client/assets/{WorkItemsTab-CahU_t_S.js → WorkItemsTab-QQXGM1BH.js} +5 -5
- package/dist/client/assets/{branding-B7DcCXjn.js → branding-BS9Iv2ln.js} +1 -1
- package/dist/client/assets/{capabilities-B1FHGoov.js → capabilities-tpmeGBtr.js} +1 -1
- package/dist/client/assets/{desktopUpdateAtoms-CPlZiFRm.js → desktopUpdateAtoms-BpN7gP0v.js} +1 -1
- package/dist/client/assets/desktopWorkspace-CIvAIvMt.js +1 -0
- package/dist/client/assets/{device-CHdXzvhB.js → device-B3lHunk1.js} +1 -1
- package/dist/client/assets/{editorPreferences-B4GvqMiF.js → editorPreferences-DiUypD3L.js} +1 -1
- package/dist/client/assets/{index-Gre6bNC8.js → index-C536LXZ6.js} +1 -1
- package/dist/client/assets/main-BjfqengQ.js +9 -0
- package/dist/client/assets/{projectPaths-D6fHIU1b.js → projectPaths-3WDk4ziK.js} +1 -1
- package/dist/client/assets/{providerIconUtils-DiDJeNtT.js → providerIconUtils-DLRASbiu.js} +1 -1
- package/dist/client/assets/{runtime-CPM0EUhb.js → runtime-CYtynKGT.js} +1 -1
- package/dist/client/assets/{session-logic-BalPN1Sc.js → session-logic-DfaSS3p9.js} +1 -1
- package/dist/client/assets/{sidebarProjectFolders-bhNsO9Z_.js → sidebarProjectFolders-DKxZsoOv.js} +2 -2
- package/dist/client/assets/storeSelectors-BeLJe5C1.js +1 -0
- package/dist/client/assets/{threadPinning-BLqwZebi.js → threadPinning-UKIVw0OX.js} +1 -1
- package/dist/client/assets/{threadPriorityRefreshRuntime-BoNAlBXK.js → threadPriorityRefreshRuntime-BbiIUPfh.js} +1 -1
- package/dist/client/assets/types-BeLJe5C1.js +1 -0
- package/dist/client/assets/{useAtlassian-CoHKzu-e.js → useAtlassian-BTWMzLgJ.js} +0 -0
- package/dist/client/assets/useHandleNewThread-9FAjhuhK.js +1 -0
- package/dist/client/assets/{usePhoneThreadActions-BIDUSWSI.js → usePhoneThreadActions-B7yDFO2l.js} +1 -1
- package/dist/client/assets/{useStatistics-B91973jb.js → useStatistics-C9g3i7bQ.js} +1 -1
- package/dist/client/assets/{useThreadActions-BCH01d6u.js → useThreadActions-CouKkjbt.js} +1 -1
- package/dist/client/index.html +1 -1
- package/package.json +1 -1
- package/dist/client/assets/AiFocusSettings-CaHQXDaQ.js +0 -1
- package/dist/client/assets/BranchToolbar.logic-DILAA3Cz.js +0 -1
- package/dist/client/assets/ChatRightPanel-D-AL07IU.js +0 -27
- package/dist/client/assets/CommandPaletteDialog-s7yf5Y2S.js +0 -1
- package/dist/client/assets/DiagnosticsSettings-DX5LH9Bt.js +0 -2
- package/dist/client/assets/OpinionatedPluginsSettings-DbxPOokL.js +0 -1
- package/dist/client/assets/RootAppShell-5HrP6N8H.js +0 -6
- package/dist/client/assets/desktopWorkspace-DEZ30LlY.js +0 -1
- package/dist/client/assets/main-Dz0zookE.js +0 -9
- package/dist/client/assets/storeSelectors-Cf2WDMfx.js +0 -1
- package/dist/client/assets/types-Cf2WDMfx.js +0 -1
- package/dist/client/assets/useHandleNewThread-Bw460iXT.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{It as r}from"./composerDraftStore-TYv9j3vY.js";import{f as i}from"./useRenderElement-DchFnsR8.js";import{t as a}from"./activity-1CkdQG5u.js";import{C as o,D as s,E as c,N as l,O as u,T as d,_ as f,a as ee,b as te,c as ne,d as re,f as ie,g as ae,h as oe,i as se,k as ce,l as p,m,n as le,o as ue,p as h,r as de,s as fe,t as pe,u as me,v as he,w as g,x as ge,y as _e}from"./useStatistics-B91973jb.js";import{t as ve}from"./chart-column-Dw6ACmXM.js";import{t as ye}from"./clock-nNA05brA.js";import{n as be,t as xe}from"./layers-BYi0v17h.js";import{t as Se}from"./git-branch-BKr-Ij4u.js";import{t as Ce}from"./messages-square-DiMgWzoq.js";import{t as we}from"./refresh-cw-DopCMrtR.js";import{t as Te}from"./triangle-alert-RL_T3KLo.js";import{t as Ee}from"./button-DG8WqjNn.js";import{n as _}from"./settingsLayout-CHJT5wtl.js";var De=i(`chart-pie`,[[`path`,{d:`M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z`,key:`pzmjnu`}],[`path`,{d:`M21.21 15.89A10 10 0 1 1 8 2.83`,key:`k2fpak`}]]),Oe=i(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),ke=i(`dollar-sign`,[[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`22`,key:`7eqyqh`}],[`path`,{d:`M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6`,key:`1b0p4s`}]]),Ae=e(t(),1),v=n(),y=r();function je(e){let t=(0,v.c)(10),{models:n}=e;if(n.length===0){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(`div`,{className:`px-4 py-8 text-center text-muted-foreground text-xs`,children:`No model usage yet.`}),t[0]=e):e=t[0],e}let r;t[1]===n?r=t[2]:(r=n.reduce(b,0)||1,t[1]=n,t[2]=r);let i=r,a;if(t[3]!==i||t[4]!==n){let e;t[6]===i?e=t[7]:(e=(e,t)=>{let n=l(t),r=Math.max(2,e.totalTokens/i*100);return(0,y.jsxs)(`li`,{className:`flex items-center gap-3 px-4 py-3`,children:[(0,y.jsx)(`span`,{className:`w-4 text-center font-medium text-[11px] text-muted-foreground tabular-nums`,children:t+1}),(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,y.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[(0,y.jsx)(`span`,{className:`truncate font-medium text-[13px] text-foreground`,children:d(e.model)}),(0,y.jsx)(`span`,{className:`shrink-0 font-medium text-foreground text-xs tabular-nums`,children:u(e.totalTokens)})]}),(0,y.jsx)(`div`,{className:`mt-1.5 h-1.5 w-full overflow-hidden rounded-full bg-muted`,children:(0,y.jsx)(`div`,{className:`h-full rounded-full transition-[width] duration-500`,style:{width:`${r}%`,backgroundColor:n}})}),(0,y.jsxs)(`div`,{className:`mt-1 flex items-center justify-between text-[11px] text-muted-foreground`,children:[(0,y.jsx)(`span`,{className:`truncate`,children:c(e.provider)}),(0,y.jsx)(`span`,{className:`shrink-0 tabular-nums`,children:e.costUsd===null?`—`:`~${ce(e.costUsd)}`})]})]})]},`${e.provider??`unknown`}:${e.model}`)},t[6]=i,t[7]=e),a=n.map(e),t[3]=i,t[4]=n,t[5]=a}else a=t[5];let o;return t[8]===a?o=t[9]:(o=(0,y.jsx)(`ol`,{className:`divide-y divide-border/50`,children:a}),t[8]=a,t[9]=o),o}function b(e,t){return Math.max(e,t.totalTokens)}function x(){let e=(0,v.c)(92),{snapshot:t,loading:n,error:r,refresh:i,refreshing:l}=pe(),b;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(b={range:`30d`,projectId:null,model:null,provider:null},e[0]=b):b=e[0];let[x,Ie]=(0,Ae.useState)(b),w;bb0:{if(!t){w=null;break bb0}let n,r,i,a,o,s,c,l;if(e[1]!==x||e[2]!==t){let u=ne(t,x),d=ue(t),f=le(u),te=f.reduce(Fe,0);n=re(u),r=me(t,x),i=f,a=te,o=se(u),s=de(u,d),c=fe(t,u,x.range),l=ee(f),e[1]=x,e[2]=t,e[3]=n,e[4]=r,e[5]=i,e[6]=a,e[7]=o,e[8]=s,e[9]=c,e[10]=l}else n=e[3],r=e[4],i=e[5],a=e[6],o=e[7],s=e[8],c=e[9],l=e[10];let u;e[11]!==n||e[12]!==r||e[13]!==i||e[14]!==a||e[15]!==o||e[16]!==s||e[17]!==c||e[18]!==l?(u={totals:n,previous:r,models:i,totalsAllModels:a,providers:o,projects:s,series:c,cost:l},e[11]=n,e[12]=r,e[13]=i,e[14]=a,e[15]=o,e[16]=s,e[17]=c,e[18]=l,e[19]=u):u=e[19],w=u}let Le=w;if(n&&!t){let t;return e[20]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,y.jsx)(_,{children:(0,y.jsx)(oe,{})}),e[20]=t):t=e[20],t}if(r&&!t){let t;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,y.jsx)(we,{}),e[21]=t):t=e[21];let n;e[22]===i?n=e[23]:(n=(0,y.jsxs)(Ee,{size:`sm`,variant:`outline`,onClick:i,children:[t,` Try again`]}),e[22]=i,e[23]=n);let a;return e[24]!==r||e[25]!==n?(a=(0,y.jsx)(_,{children:(0,y.jsx)(ae,{icon:Te,title:`Couldn’t load statistics`,description:r,action:n})}),e[24]=r,e[25]=n,e[26]=a):a=e[26],a}if(!t||!Le)return null;let T=t.dailyBuckets.length>0,{totals:E,previous:D,models:O,totalsAllModels:k,providers:A,projects:j,series:M,cost:N}=Le,P=O[0],F;e[27]!==P||e[28]!==k?(F=P&&k>0?Math.round(P.totalTokens/k*100):0,e[27]=P,e[28]=k,e[29]=F):F=e[29];let I=F,L;e[30]===M?L=e[31]:(L=M.map(Pe),e[30]=M,e[31]=L);let R=L,z;e[32]===M?z=e[33]:(z=M.map(Ne),e[32]=M,e[33]=z);let Re=z,B=Math.max(0,E.totalTokens-E.inputTokens-E.outputTokens),V;e[34]!==E.inputTokens||e[35]!==E.outputTokens||e[36]!==B?(V=B>0?`${u(E.inputTokens)} in · ${u(E.outputTokens)} out · ${u(B)} other`:`${u(E.inputTokens)} in · ${u(E.outputTokens)} out`,e[34]=E.inputTokens,e[35]=E.outputTokens,e[36]=B,e[37]=V):V=e[37];let ze=V,H;e[38]===M?H=e[39]:(H=M.some(Me),e[38]=M,e[39]=H);let Be=H,Ve=t.tokenAttribution===`thread-cumulative`?`Token figures use cumulative thread snapshots when providers or older sessions do not expose per-turn deltas.`:t.tokenAttribution===`mixed`?`Token figures combine exact per-turn deltas where available with cumulative snapshots for older or provider-limited sessions.`:`Token figures use exact per-turn deltas where providers report them.`,U;e[40]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,y.jsx)(`h1`,{className:`font-semibold text-foreground text-lg`,children:`Statistics`}),e[40]=U):U=e[40];let W;e[41]===t.generatedAt?W=e[42]:(W=s(t.generatedAt),e[41]=t.generatedAt,e[42]=W);let G;e[43]===W?G=e[44]:(G=(0,y.jsxs)(`div`,{className:`space-y-0.5`,children:[U,(0,y.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`Usage across your projects · as of `,W]})]}),e[43]=W,e[44]=G);let K=l?`animate-spin`:void 0,q;e[45]===K?q=e[46]:(q=(0,y.jsx)(we,{className:K}),e[45]=K,e[46]=q);let J;e[47]!==i||e[48]!==l||e[49]!==q?(J=(0,y.jsxs)(Ee,{size:`xs`,variant:`outline`,onClick:i,disabled:l,"aria-label":`Refresh statistics`,children:[q,`Refresh`]}),e[47]=i,e[48]=l,e[49]=q,e[50]=J):J=e[50];let Y;e[51]!==J||e[52]!==G?(Y=(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[G,J]}),e[51]=J,e[52]=G,e[53]=Y):Y=e[53];let X;e[54]!==x||e[55]!==t.models||e[56]!==t.projects?(X=(0,y.jsx)(ie,{filter:x,onChange:Ie,projects:t.projects,models:t.models}),e[54]=x,e[55]=t.models,e[56]=t.projects,e[57]=X):X=e[57];let Z;e[58]!==Y||e[59]!==X?(Z=(0,y.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[Y,X]}),e[58]=Y,e[59]=X,e[60]=Z):Z=e[60];let Q;e[61]!==Re||e[62]!==Ve||e[63]!==N||e[64]!==T||e[65]!==Be||e[66]!==O||e[67]!==D?.activeMs||e[68]!==D?.threadsCreated||e[69]!==D?.totalTokens||e[70]!==j||e[71]!==A||e[72]!==M||e[73]!==t.worktrees||e[74]!==R||e[75]!==ze||e[76]!==P||e[77]!==I||e[78]!==E.activeMs||e[79]!==E.additions||e[80]!==E.commits||e[81]!==E.deletions||e[82]!==E.filesChanged||e[83]!==E.pushes||e[84]!==E.threadsCreated||e[85]!==E.toolUses||e[86]!==E.totalTokens||e[87]!==E.turns?(Q=T?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-5`,children:[(0,y.jsx)(m,{label:`Total tokens`,icon:Oe,value:u(E.totalTokens),sub:ze,delta:p(E.totalTokens,D?.totalTokens),sparkline:R}),(0,y.jsx)(m,{label:`Est. cost`,icon:ke,value:`~${ce(N.usd)}`,sub:N.hasUnpriced?`excludes unpriced models`:`estimated spend`}),(0,y.jsx)(m,{label:`Most used model`,icon:xe,value:(0,y.jsx)(`span`,{className:`block max-w-full truncate text-lg`,title:P?d(P.model):void 0,children:P?d(P.model):`—`}),sub:P?`${c(P.provider)} · ${I}% of tokens`:`no usage in range`}),(0,y.jsx)(m,{label:`Chats`,icon:Ce,value:g(E.threadsCreated),sub:`threads started`,delta:p(E.threadsCreated,D?.threadsCreated)}),(0,y.jsx)(m,{label:`Active time`,icon:ye,value:o(E.activeMs),sub:`${g(E.turns)} turns`,delta:p(E.activeMs,D?.activeMs),sparkline:Re})]}),(0,y.jsxs)(h,{title:`Token usage over time`,icon:ve,bodyClassName:`p-4`,children:[(0,y.jsx)(te,{data:M}),(0,y.jsxs)(`div`,{className:`mt-2 flex items-center gap-4 px-1 text-[11px] text-muted-foreground`,children:[(0,y.jsx)(S,{colorIndex:0,label:`Input`}),(0,y.jsx)(S,{colorIndex:1,label:`Output`}),Be?(0,y.jsx)(S,{colorIndex:2,label:`Other`}):null]})]}),(0,y.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,y.jsx)(h,{title:`Models`,icon:xe,bodyClassName:`overflow-hidden`,action:(0,y.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[O.length,` total`]}),children:(0,y.jsx)(je,{models:O})}),(0,y.jsx)(h,{title:`Tokens by provider`,icon:De,bodyClassName:`p-4`,children:(0,y.jsx)(_e,{data:A})})]}),(0,y.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,y.jsx)(h,{title:`Tokens by project`,icon:ve,bodyClassName:`p-4`,children:(0,y.jsx)(he,{data:j})}),(0,y.jsxs)(h,{title:`Activity`,icon:a,bodyClassName:`p-4`,children:[(0,y.jsx)(ge,{points:M,metric:`turns`}),(0,y.jsx)(`p`,{className:`mt-3 text-[11px] text-muted-foreground`,children:`Turns per day`})]})]}),(0,y.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,y.jsxs)(h,{title:`Code changes`,icon:be,bodyClassName:`p-4`,children:[(0,y.jsxs)(`div`,{className:`mb-3 flex items-center gap-4 text-sm`,children:[(0,y.jsx)(C,{label:`Files`,value:g(E.filesChanged)}),(0,y.jsx)(C,{label:`Added`,value:`+${g(E.additions)}`,tone:`success`}),(0,y.jsx)(C,{label:`Removed`,value:`−${g(E.deletions)}`,tone:`destructive`})]}),(0,y.jsx)(f,{data:M})]}),(0,y.jsxs)(h,{title:`Source control`,icon:Se,bodyClassName:`p-4`,children:[(0,y.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,y.jsx)(C,{label:`Worktrees`,value:g(t.worktrees.created)}),(0,y.jsx)(C,{label:`Active`,value:g(t.worktrees.active)}),(0,y.jsx)(C,{label:`Open PRs`,value:g(t.worktrees.openPrs)}),(0,y.jsx)(C,{label:`Tool uses`,value:g(E.toolUses)})]}),E.commits+E.pushes>0?(0,y.jsxs)(`div`,{className:`mt-3 grid grid-cols-2 gap-3 border-border/60 border-t pt-3`,children:[(0,y.jsx)(C,{label:`Commits`,value:g(E.commits)}),(0,y.jsx)(C,{label:`Pushes`,value:g(E.pushes)})]}):(0,y.jsx)(`p`,{className:`mt-3 border-border/60 border-t pt-3 text-[11px] text-muted-foreground`,children:`Commit & push counts aren’t recorded yet.`})]})]}),(0,y.jsxs)(`p`,{className:`px-1 text-[11px] text-muted-foreground/80`,children:[Ve,` Costs are rough estimates from a built-in price table and exclude subscription-billed or breakdown-less usage.`]})]}):(0,y.jsx)(ae,{icon:ve,title:`No activity yet`,description:`Once you start chatting with agents, your token usage, models, and code changes will show up here.`}),e[61]=Re,e[62]=Ve,e[63]=N,e[64]=T,e[65]=Be,e[66]=O,e[67]=D?.activeMs,e[68]=D?.threadsCreated,e[69]=D?.totalTokens,e[70]=j,e[71]=A,e[72]=M,e[73]=t.worktrees,e[74]=R,e[75]=ze,e[76]=P,e[77]=I,e[78]=E.activeMs,e[79]=E.additions,e[80]=E.commits,e[81]=E.deletions,e[82]=E.filesChanged,e[83]=E.pushes,e[84]=E.threadsCreated,e[85]=E.toolUses,e[86]=E.totalTokens,e[87]=E.turns,e[88]=Q):Q=e[88];let $;return e[89]!==Z||e[90]!==Q?($=(0,y.jsxs)(_,{children:[Z,Q]}),e[89]=Z,e[90]=Q,e[91]=$):$=e[91],$}function Me(e){return e.uncategorizedTokens>0}function Ne(e){return e.activeMs}function Pe(e){return e.totalTokens}function Fe(e,t){return e+t.totalTokens}function S(e){let t=(0,v.c)(7),{colorIndex:n,label:r}=e,i;t[0]===n?i=t[1]:(i=l(n),t[0]=n,t[1]=i);let a;t[2]===i?a=t[3]:(a=(0,y.jsx)(`span`,{className:`size-2.5 rounded-[3px]`,style:{backgroundColor:i}}),t[2]=i,t[3]=a);let o;return t[4]!==r||t[5]!==a?(o=(0,y.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[a,r]}),t[4]=r,t[5]=a,t[6]=o):o=t[6],o}function C(e){let t=(0,v.c)(8),{label:n,value:r,tone:i}=e,a;t[0]===n?a=t[1]:(a=(0,y.jsx)(`span`,{className:`text-[11px] text-muted-foreground uppercase tracking-[0.06em]`,children:n}),t[0]=n,t[1]=a);let o=i===`success`?`font-semibold text-base text-success-foreground tabular-nums`:i===`destructive`?`font-semibold text-base text-destructive tabular-nums`:`font-semibold text-base text-foreground tabular-nums`,s;t[2]!==o||t[3]!==r?(s=(0,y.jsx)(`span`,{className:o,children:r}),t[2]=o,t[3]=r,t[4]=s):s=t[4];let c;return t[5]!==a||t[6]!==s?(c=(0,y.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[a,s]}),t[5]=a,t[6]=s,t[7]=c):c=t[7],c}export{x as StatisticsPanel};
|
|
1
|
+
import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{It as r}from"./composerDraftStore-TYv9j3vY.js";import{f as i}from"./useRenderElement-DchFnsR8.js";import{t as a}from"./activity-1CkdQG5u.js";import{C as o,D as s,E as c,N as l,O as u,T as d,_ as f,a as ee,b as te,c as ne,d as re,f as ie,g as ae,h as oe,i as se,k as ce,l as p,m,n as le,o as ue,p as h,r as de,s as fe,t as pe,u as me,v as he,w as g,x as ge,y as _e}from"./useStatistics-C9g3i7bQ.js";import{t as ve}from"./chart-column-Dw6ACmXM.js";import{t as ye}from"./clock-nNA05brA.js";import{n as be,t as xe}from"./layers-BYi0v17h.js";import{t as Se}from"./git-branch-BKr-Ij4u.js";import{t as Ce}from"./messages-square-DiMgWzoq.js";import{t as we}from"./refresh-cw-DopCMrtR.js";import{t as Te}from"./triangle-alert-RL_T3KLo.js";import{t as Ee}from"./button-DG8WqjNn.js";import{n as _}from"./settingsLayout-CHJT5wtl.js";var De=i(`chart-pie`,[[`path`,{d:`M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z`,key:`pzmjnu`}],[`path`,{d:`M21.21 15.89A10 10 0 1 1 8 2.83`,key:`k2fpak`}]]),Oe=i(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),ke=i(`dollar-sign`,[[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`22`,key:`7eqyqh`}],[`path`,{d:`M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6`,key:`1b0p4s`}]]),Ae=e(t(),1),v=n(),y=r();function je(e){let t=(0,v.c)(10),{models:n}=e;if(n.length===0){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(`div`,{className:`px-4 py-8 text-center text-muted-foreground text-xs`,children:`No model usage yet.`}),t[0]=e):e=t[0],e}let r;t[1]===n?r=t[2]:(r=n.reduce(b,0)||1,t[1]=n,t[2]=r);let i=r,a;if(t[3]!==i||t[4]!==n){let e;t[6]===i?e=t[7]:(e=(e,t)=>{let n=l(t),r=Math.max(2,e.totalTokens/i*100);return(0,y.jsxs)(`li`,{className:`flex items-center gap-3 px-4 py-3`,children:[(0,y.jsx)(`span`,{className:`w-4 text-center font-medium text-[11px] text-muted-foreground tabular-nums`,children:t+1}),(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,y.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[(0,y.jsx)(`span`,{className:`truncate font-medium text-[13px] text-foreground`,children:d(e.model)}),(0,y.jsx)(`span`,{className:`shrink-0 font-medium text-foreground text-xs tabular-nums`,children:u(e.totalTokens)})]}),(0,y.jsx)(`div`,{className:`mt-1.5 h-1.5 w-full overflow-hidden rounded-full bg-muted`,children:(0,y.jsx)(`div`,{className:`h-full rounded-full transition-[width] duration-500`,style:{width:`${r}%`,backgroundColor:n}})}),(0,y.jsxs)(`div`,{className:`mt-1 flex items-center justify-between text-[11px] text-muted-foreground`,children:[(0,y.jsx)(`span`,{className:`truncate`,children:c(e.provider)}),(0,y.jsx)(`span`,{className:`shrink-0 tabular-nums`,children:e.costUsd===null?`—`:`~${ce(e.costUsd)}`})]})]})]},`${e.provider??`unknown`}:${e.model}`)},t[6]=i,t[7]=e),a=n.map(e),t[3]=i,t[4]=n,t[5]=a}else a=t[5];let o;return t[8]===a?o=t[9]:(o=(0,y.jsx)(`ol`,{className:`divide-y divide-border/50`,children:a}),t[8]=a,t[9]=o),o}function b(e,t){return Math.max(e,t.totalTokens)}function x(){let e=(0,v.c)(92),{snapshot:t,loading:n,error:r,refresh:i,refreshing:l}=pe(),b;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(b={range:`30d`,projectId:null,model:null,provider:null},e[0]=b):b=e[0];let[x,Ie]=(0,Ae.useState)(b),w;bb0:{if(!t){w=null;break bb0}let n,r,i,a,o,s,c,l;if(e[1]!==x||e[2]!==t){let u=ne(t,x),d=ue(t),f=le(u),te=f.reduce(Fe,0);n=re(u),r=me(t,x),i=f,a=te,o=se(u),s=de(u,d),c=fe(t,u,x.range),l=ee(f),e[1]=x,e[2]=t,e[3]=n,e[4]=r,e[5]=i,e[6]=a,e[7]=o,e[8]=s,e[9]=c,e[10]=l}else n=e[3],r=e[4],i=e[5],a=e[6],o=e[7],s=e[8],c=e[9],l=e[10];let u;e[11]!==n||e[12]!==r||e[13]!==i||e[14]!==a||e[15]!==o||e[16]!==s||e[17]!==c||e[18]!==l?(u={totals:n,previous:r,models:i,totalsAllModels:a,providers:o,projects:s,series:c,cost:l},e[11]=n,e[12]=r,e[13]=i,e[14]=a,e[15]=o,e[16]=s,e[17]=c,e[18]=l,e[19]=u):u=e[19],w=u}let Le=w;if(n&&!t){let t;return e[20]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,y.jsx)(_,{children:(0,y.jsx)(oe,{})}),e[20]=t):t=e[20],t}if(r&&!t){let t;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,y.jsx)(we,{}),e[21]=t):t=e[21];let n;e[22]===i?n=e[23]:(n=(0,y.jsxs)(Ee,{size:`sm`,variant:`outline`,onClick:i,children:[t,` Try again`]}),e[22]=i,e[23]=n);let a;return e[24]!==r||e[25]!==n?(a=(0,y.jsx)(_,{children:(0,y.jsx)(ae,{icon:Te,title:`Couldn’t load statistics`,description:r,action:n})}),e[24]=r,e[25]=n,e[26]=a):a=e[26],a}if(!t||!Le)return null;let T=t.dailyBuckets.length>0,{totals:E,previous:D,models:O,totalsAllModels:k,providers:A,projects:j,series:M,cost:N}=Le,P=O[0],F;e[27]!==P||e[28]!==k?(F=P&&k>0?Math.round(P.totalTokens/k*100):0,e[27]=P,e[28]=k,e[29]=F):F=e[29];let I=F,L;e[30]===M?L=e[31]:(L=M.map(Pe),e[30]=M,e[31]=L);let R=L,z;e[32]===M?z=e[33]:(z=M.map(Ne),e[32]=M,e[33]=z);let Re=z,B=Math.max(0,E.totalTokens-E.inputTokens-E.outputTokens),V;e[34]!==E.inputTokens||e[35]!==E.outputTokens||e[36]!==B?(V=B>0?`${u(E.inputTokens)} in · ${u(E.outputTokens)} out · ${u(B)} other`:`${u(E.inputTokens)} in · ${u(E.outputTokens)} out`,e[34]=E.inputTokens,e[35]=E.outputTokens,e[36]=B,e[37]=V):V=e[37];let ze=V,H;e[38]===M?H=e[39]:(H=M.some(Me),e[38]=M,e[39]=H);let Be=H,Ve=t.tokenAttribution===`thread-cumulative`?`Token figures use cumulative thread snapshots when providers or older sessions do not expose per-turn deltas.`:t.tokenAttribution===`mixed`?`Token figures combine exact per-turn deltas where available with cumulative snapshots for older or provider-limited sessions.`:`Token figures use exact per-turn deltas where providers report them.`,U;e[40]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,y.jsx)(`h1`,{className:`font-semibold text-foreground text-lg`,children:`Statistics`}),e[40]=U):U=e[40];let W;e[41]===t.generatedAt?W=e[42]:(W=s(t.generatedAt),e[41]=t.generatedAt,e[42]=W);let G;e[43]===W?G=e[44]:(G=(0,y.jsxs)(`div`,{className:`space-y-0.5`,children:[U,(0,y.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`Usage across your projects · as of `,W]})]}),e[43]=W,e[44]=G);let K=l?`animate-spin`:void 0,q;e[45]===K?q=e[46]:(q=(0,y.jsx)(we,{className:K}),e[45]=K,e[46]=q);let J;e[47]!==i||e[48]!==l||e[49]!==q?(J=(0,y.jsxs)(Ee,{size:`xs`,variant:`outline`,onClick:i,disabled:l,"aria-label":`Refresh statistics`,children:[q,`Refresh`]}),e[47]=i,e[48]=l,e[49]=q,e[50]=J):J=e[50];let Y;e[51]!==J||e[52]!==G?(Y=(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[G,J]}),e[51]=J,e[52]=G,e[53]=Y):Y=e[53];let X;e[54]!==x||e[55]!==t.models||e[56]!==t.projects?(X=(0,y.jsx)(ie,{filter:x,onChange:Ie,projects:t.projects,models:t.models}),e[54]=x,e[55]=t.models,e[56]=t.projects,e[57]=X):X=e[57];let Z;e[58]!==Y||e[59]!==X?(Z=(0,y.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[Y,X]}),e[58]=Y,e[59]=X,e[60]=Z):Z=e[60];let Q;e[61]!==Re||e[62]!==Ve||e[63]!==N||e[64]!==T||e[65]!==Be||e[66]!==O||e[67]!==D?.activeMs||e[68]!==D?.threadsCreated||e[69]!==D?.totalTokens||e[70]!==j||e[71]!==A||e[72]!==M||e[73]!==t.worktrees||e[74]!==R||e[75]!==ze||e[76]!==P||e[77]!==I||e[78]!==E.activeMs||e[79]!==E.additions||e[80]!==E.commits||e[81]!==E.deletions||e[82]!==E.filesChanged||e[83]!==E.pushes||e[84]!==E.threadsCreated||e[85]!==E.toolUses||e[86]!==E.totalTokens||e[87]!==E.turns?(Q=T?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-5`,children:[(0,y.jsx)(m,{label:`Total tokens`,icon:Oe,value:u(E.totalTokens),sub:ze,delta:p(E.totalTokens,D?.totalTokens),sparkline:R}),(0,y.jsx)(m,{label:`Est. cost`,icon:ke,value:`~${ce(N.usd)}`,sub:N.hasUnpriced?`excludes unpriced models`:`estimated spend`}),(0,y.jsx)(m,{label:`Most used model`,icon:xe,value:(0,y.jsx)(`span`,{className:`block max-w-full truncate text-lg`,title:P?d(P.model):void 0,children:P?d(P.model):`—`}),sub:P?`${c(P.provider)} · ${I}% of tokens`:`no usage in range`}),(0,y.jsx)(m,{label:`Chats`,icon:Ce,value:g(E.threadsCreated),sub:`threads started`,delta:p(E.threadsCreated,D?.threadsCreated)}),(0,y.jsx)(m,{label:`Active time`,icon:ye,value:o(E.activeMs),sub:`${g(E.turns)} turns`,delta:p(E.activeMs,D?.activeMs),sparkline:Re})]}),(0,y.jsxs)(h,{title:`Token usage over time`,icon:ve,bodyClassName:`p-4`,children:[(0,y.jsx)(te,{data:M}),(0,y.jsxs)(`div`,{className:`mt-2 flex items-center gap-4 px-1 text-[11px] text-muted-foreground`,children:[(0,y.jsx)(S,{colorIndex:0,label:`Input`}),(0,y.jsx)(S,{colorIndex:1,label:`Output`}),Be?(0,y.jsx)(S,{colorIndex:2,label:`Other`}):null]})]}),(0,y.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,y.jsx)(h,{title:`Models`,icon:xe,bodyClassName:`overflow-hidden`,action:(0,y.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[O.length,` total`]}),children:(0,y.jsx)(je,{models:O})}),(0,y.jsx)(h,{title:`Tokens by provider`,icon:De,bodyClassName:`p-4`,children:(0,y.jsx)(_e,{data:A})})]}),(0,y.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,y.jsx)(h,{title:`Tokens by project`,icon:ve,bodyClassName:`p-4`,children:(0,y.jsx)(he,{data:j})}),(0,y.jsxs)(h,{title:`Activity`,icon:a,bodyClassName:`p-4`,children:[(0,y.jsx)(ge,{points:M,metric:`turns`}),(0,y.jsx)(`p`,{className:`mt-3 text-[11px] text-muted-foreground`,children:`Turns per day`})]})]}),(0,y.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,y.jsxs)(h,{title:`Code changes`,icon:be,bodyClassName:`p-4`,children:[(0,y.jsxs)(`div`,{className:`mb-3 flex items-center gap-4 text-sm`,children:[(0,y.jsx)(C,{label:`Files`,value:g(E.filesChanged)}),(0,y.jsx)(C,{label:`Added`,value:`+${g(E.additions)}`,tone:`success`}),(0,y.jsx)(C,{label:`Removed`,value:`−${g(E.deletions)}`,tone:`destructive`})]}),(0,y.jsx)(f,{data:M})]}),(0,y.jsxs)(h,{title:`Source control`,icon:Se,bodyClassName:`p-4`,children:[(0,y.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,y.jsx)(C,{label:`Worktrees`,value:g(t.worktrees.created)}),(0,y.jsx)(C,{label:`Active`,value:g(t.worktrees.active)}),(0,y.jsx)(C,{label:`Open PRs`,value:g(t.worktrees.openPrs)}),(0,y.jsx)(C,{label:`Tool uses`,value:g(E.toolUses)})]}),E.commits+E.pushes>0?(0,y.jsxs)(`div`,{className:`mt-3 grid grid-cols-2 gap-3 border-border/60 border-t pt-3`,children:[(0,y.jsx)(C,{label:`Commits`,value:g(E.commits)}),(0,y.jsx)(C,{label:`Pushes`,value:g(E.pushes)})]}):(0,y.jsx)(`p`,{className:`mt-3 border-border/60 border-t pt-3 text-[11px] text-muted-foreground`,children:`Commit & push counts aren’t recorded yet.`})]})]}),(0,y.jsxs)(`p`,{className:`px-1 text-[11px] text-muted-foreground/80`,children:[Ve,` Costs are rough estimates from a built-in price table and exclude subscription-billed or breakdown-less usage.`]})]}):(0,y.jsx)(ae,{icon:ve,title:`No activity yet`,description:`Once you start chatting with agents, your token usage, models, and code changes will show up here.`}),e[61]=Re,e[62]=Ve,e[63]=N,e[64]=T,e[65]=Be,e[66]=O,e[67]=D?.activeMs,e[68]=D?.threadsCreated,e[69]=D?.totalTokens,e[70]=j,e[71]=A,e[72]=M,e[73]=t.worktrees,e[74]=R,e[75]=ze,e[76]=P,e[77]=I,e[78]=E.activeMs,e[79]=E.additions,e[80]=E.commits,e[81]=E.deletions,e[82]=E.filesChanged,e[83]=E.pushes,e[84]=E.threadsCreated,e[85]=E.toolUses,e[86]=E.totalTokens,e[87]=E.turns,e[88]=Q):Q=e[88];let $;return e[89]!==Z||e[90]!==Q?($=(0,y.jsxs)(_,{children:[Z,Q]}),e[89]=Z,e[90]=Q,e[91]=$):$=e[91],$}function Me(e){return e.uncategorizedTokens>0}function Ne(e){return e.activeMs}function Pe(e){return e.totalTokens}function Fe(e,t){return e+t.totalTokens}function S(e){let t=(0,v.c)(7),{colorIndex:n,label:r}=e,i;t[0]===n?i=t[1]:(i=l(n),t[0]=n,t[1]=i);let a;t[2]===i?a=t[3]:(a=(0,y.jsx)(`span`,{className:`size-2.5 rounded-[3px]`,style:{backgroundColor:i}}),t[2]=i,t[3]=a);let o;return t[4]!==r||t[5]!==a?(o=(0,y.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[a,r]}),t[4]=r,t[5]=a,t[6]=o):o=t[6],o}function C(e){let t=(0,v.c)(8),{label:n,value:r,tone:i}=e,a;t[0]===n?a=t[1]:(a=(0,y.jsx)(`span`,{className:`text-[11px] text-muted-foreground uppercase tracking-[0.06em]`,children:n}),t[0]=n,t[1]=a);let o=i===`success`?`font-semibold text-base text-success-foreground tabular-nums`:i===`destructive`?`font-semibold text-base text-destructive tabular-nums`:`font-semibold text-base text-foreground tabular-nums`,s;t[2]!==o||t[3]!==r?(s=(0,y.jsx)(`span`,{className:o,children:r}),t[2]=o,t[3]=r,t[4]=s):s=t[4];let c;return t[5]!==a||t[6]!==s?(c=(0,y.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[a,s]}),t[5]=a,t[6]=s,t[7]=c):c=t[7],c}export{x as StatisticsPanel};
|