fifony 0.1.26 → 0.1.27-next.84df008

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 (36) hide show
  1. package/README.md +152 -129
  2. package/app/dist/assets/{KeyboardShortcutsHelp-lTNj9GiT.js → KeyboardShortcutsHelp-By0KcDhZ.js} +1 -1
  3. package/app/dist/assets/OnboardingWizard-5cz7Onsu.js +1 -0
  4. package/app/dist/assets/{analytics.lazy-C42PFRzr.js → analytics.lazy-ArFwnOEn.js} +1 -1
  5. package/app/dist/assets/{createLucideIcon-BWC-guQt.js → createLucideIcon-DgMTp0yx.js} +1 -1
  6. package/app/dist/assets/index-59O8esMr.js +45 -0
  7. package/app/dist/assets/{index-Qr2OPvRO.css → index-DuBwUsuf.css} +1 -1
  8. package/app/dist/assets/vendor-D-IqxHHu.js +9 -0
  9. package/app/dist/dinofffaur.webp +0 -0
  10. package/app/dist/index.html +4 -4
  11. package/app/dist/service-worker.js +1 -1
  12. package/dist/agent/run-local.js +57 -144
  13. package/dist/agent-KMXNVDRO.js +74 -0
  14. package/dist/chunk-FJR4ALEN.js +847 -0
  15. package/dist/{chunk-2F3Q2MAG.js → chunk-HSGUPFTV.js} +1224 -611
  16. package/dist/chunk-O5AEQXUV.js +311 -0
  17. package/dist/chunk-OONOOWNC.js +123 -0
  18. package/dist/{chunk-NFHVAIPW.js → chunk-UYCDOH6S.js} +380 -795
  19. package/dist/chunk-XENKNHFS.js +295 -0
  20. package/dist/cli.js +6 -4
  21. package/dist/issue-runner-JJAFMHKV.js +15 -0
  22. package/dist/{issue-state-machine-OWABY5S2.js → issue-state-machine-ACMUJSXC.js} +5 -3
  23. package/dist/issues-VDFXBK3N.js +40 -0
  24. package/dist/mcp/server.js +23 -121
  25. package/dist/queue-workers-U47CVPTO.js +23 -0
  26. package/dist/scheduler-MEXEDV4M.js +21 -0
  27. package/dist/{store-WN47MDT5.js → store-AG6LLYJ7.js} +7 -5
  28. package/dist/workspace-474CCKTW.js +44 -0
  29. package/package.json +6 -6
  30. package/app/dist/assets/OnboardingWizard-B6LlJR9B.js +0 -1
  31. package/app/dist/assets/index-fVSxs9d5.js +0 -43
  32. package/app/dist/assets/vendor-BTlTWMUF.js +0 -9
  33. package/dist/chunk-AMOGDOM7.js +0 -796
  34. package/dist/chunk-IA7IMQ5F.js +0 -91
  35. package/dist/issue-runner-DA4IDLKX.js +0 -13
  36. package/dist/queue-workers-JIH5ZMNQ.js +0 -20
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DF2fYuay.js";import{I as t,a as n,h as r}from"./vendor-BTlTWMUF.js";import{D as i,I as a,L as o,V as s,b as c,g as l,h as u,m as d,n as f,o as p,s as m,y as h,z as g}from"./index-fVSxs9d5.js";var _=e(t(),1),v=r();function y(e){return!e||e===0?`0`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function b(e){return!e||e===0?`0`:e.toLocaleString()}function x({value:e,format:t=y,className:n=``}){let[r,i]=(0,_.useState)(()=>t(e)),a=(0,_.useRef)(e),o=(0,_.useRef)(null);return(0,_.useEffect)(()=>{let n=a.current||0,r=e||0;if(a.current=r,n===r){i(t(r));return}let s=performance.now(),c=e=>{let a=e-s,l=Math.min(a/600,1),u=1-(1-l)**3,d=n+(r-n)*u;i(t(Math.round(d))),l<1&&(o.current=requestAnimationFrame(c))};return cancelAnimationFrame(o.current),o.current=requestAnimationFrame(c),()=>cancelAnimationFrame(o.current)},[e,t]),(0,v.jsx)(`span`,{className:`${n} inline-block tabular-nums`,children:r})}var S=[{key:`planner`,label:`Plan`,color:`bg-info`,textColor:`text-info`},{key:`executor`,label:`Execute`,color:`bg-primary`,textColor:`text-primary`},{key:`reviewer`,label:`Review`,color:`bg-secondary`,textColor:`text-secondary`}];function C({byPhase:e}){if(!e)return null;let t=S.reduce((t,n)=>t+(e[n.key]?.totalTokens||0),0);return t===0?null:(0,v.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,v.jsx)(`div`,{className:`flex h-4 rounded-full overflow-hidden bg-base-300 w-full`,children:S.map(n=>{let r=e[n.key]?.totalTokens||0,i=r/t*100;return i===0?null:(0,v.jsx)(`div`,{className:`${n.color} opacity-80 transition-all duration-500`,style:{width:`${i}%`},title:`${n.label}: ${b(r)} (${Math.round(i)}%)`},n.key)})}),(0,v.jsx)(`div`,{className:`flex items-center gap-3 flex-wrap text-xs`,children:S.map(n=>{let r=e[n.key]?.totalTokens||0,i=t>0?Math.round(r/t*100):0;return r===0?null:(0,v.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,v.jsx)(`span`,{className:`inline-block size-2 rounded-full ${n.color} shrink-0`}),(0,v.jsx)(`span`,{className:`opacity-60`,children:n.label}),(0,v.jsx)(`span`,{className:`font-mono font-semibold`,children:y(r)}),(0,v.jsxs)(`span`,{className:`opacity-40`,children:[`(`,i,`%)`]})]},n.key)})})]})}function w({data:e,valueKey:t,barClass:n,label:r,height:i=64,showXAxis:a=!1,hoveredIdx:o,onHover:s,formatTooltip:c}){if(!e||e.length===0)return null;let l=new Date().toISOString().slice(0,10),u=Math.max(...e.map(e=>e[t]||0),1),d=e.length<=7?1:e.length<=14?2:e.length<=21?3:5,f=o==null?null:e[o],p=o==null?`center`:o<e.length/3?`left`:o>e.length*2/3?`right`:`center`;return(0,v.jsxs)(`div`,{className:`relative`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs opacity-50 mb-2`,children:[(0,v.jsx)(`span`,{className:`inline-block w-2.5 h-2.5 rounded-sm ${n}`}),r]}),f&&(0,v.jsx)(`div`,{className:`absolute top-5 z-10 pointer-events-none`,style:{left:p===`right`?void 0:`${(o+.5)/e.length*100}%`,right:p===`right`?`${(e.length-1-o)/e.length*100}%`:void 0,transform:p===`center`?`translateX(-50%) translateY(-100%)`:`translateY(-100%)`},children:(0,v.jsxs)(`div`,{className:`bg-base-300 border border-base-content/10 rounded-lg px-2.5 py-1.5 shadow-lg text-left whitespace-nowrap`,children:[(0,v.jsx)(`div`,{className:`text-[10px] font-semibold opacity-60 mb-0.5`,children:f.date===l?`Today`:new Date(f.date+`T00:00:00`).toLocaleDateString(void 0,{weekday:`short`,month:`short`,day:`numeric`})}),(0,v.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs`,children:[(0,v.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-sm ${n} shrink-0`}),(0,v.jsx)(`span`,{className:`font-mono font-semibold`,children:c?c(f[t]||0):(f[t]||0).toLocaleString()})]})]})}),(0,v.jsx)(`div`,{className:`flex gap-px`,style:{height:i},children:e.map((e,r)=>{let a=e[t]||0,c=a>0?Math.max(3,Math.round(a/u*i)):0,d=e.date===l,f=o===r;return(0,v.jsxs)(`div`,{className:`flex-1 relative cursor-default`,onMouseEnter:()=>s?.(r),onMouseLeave:()=>s?.(null),children:[c>0&&(0,v.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 rounded-t-[2px] ${n} transition-opacity duration-100 ${f?`opacity-80`:d?`opacity-90`:`opacity-35`}`,style:{height:c}}),f&&(0,v.jsx)(`div`,{className:`absolute inset-0 bg-base-content/5 rounded-sm`})]},e.date)})}),a&&(0,v.jsx)(`div`,{className:`flex gap-px mt-1.5`,children:e.map((e,t)=>{let n=e.date===l,r=o===t,i=n||t===0||t%d===0,a=e.date?new Date(e.date+`T00:00:00`).toLocaleDateString(void 0,{month:`numeric`,day:`numeric`}):``;return(0,v.jsx)(`div`,{className:`flex-1 overflow-hidden`,children:i&&(0,v.jsx)(`span`,{className:`block text-center text-[9px] truncate transition-opacity duration-100 ${r?`opacity-80`:n?`opacity-60 font-semibold`:`opacity-30`}`,children:n?`today`:a})},e.date)})})]})}function T({daily:e}){let[t,n]=(0,_.useState)(null),r=e||[];return(0,v.jsxs)(`div`,{className:`space-y-4`,children:[(0,v.jsx)(w,{data:r,valueKey:`totalTokens`,barClass:`bg-primary`,label:`Tokens / day`,height:64,showXAxis:!1,hoveredIdx:t,onHover:n,formatTooltip:e=>e.toLocaleString()}),(0,v.jsx)(w,{data:r,valueKey:`events`,barClass:`bg-secondary`,label:`Events / day`,height:36,showXAxis:!0,hoveredIdx:t,onHover:n})]})}function E({byModel:e}){if(!e)return null;let t=Object.entries(e).map(([e,t])=>({model:e,inputTokens:t?.inputTokens||0,outputTokens:t?.outputTokens||0,totalTokens:t?.totalTokens||0})).sort((e,t)=>t.totalTokens-e.totalTokens);if(t.length===0)return null;let n=t.reduce((e,t)=>e+t.totalTokens,0);return(0,v.jsx)(`div`,{className:`overflow-x-auto`,children:(0,v.jsxs)(`table`,{className:`table table-sm`,children:[(0,v.jsx)(`thead`,{children:(0,v.jsxs)(`tr`,{children:[(0,v.jsx)(`th`,{children:`Model`}),(0,v.jsx)(`th`,{className:`text-right`,children:`Input`}),(0,v.jsx)(`th`,{className:`text-right`,children:`Output`}),(0,v.jsx)(`th`,{className:`text-right`,children:`Total`}),(0,v.jsx)(`th`,{className:`text-right`,children:`Share`})]})}),(0,v.jsx)(`tbody`,{children:t.map(e=>{let t=n>0?Math.round(e.totalTokens/n*100):0,r=e.model.includes(`claude`)?`bg-primary`:e.model.includes(`codex`)?`bg-secondary`:`bg-accent`;return(0,v.jsxs)(`tr`,{children:[(0,v.jsxs)(`td`,{className:`flex items-center gap-2`,children:[(0,v.jsx)(`span`,{className:`inline-block w-2.5 h-2.5 rounded-full ${r} shrink-0`}),(0,v.jsx)(`span`,{className:`font-mono text-xs`,children:e.model})]}),(0,v.jsx)(`td`,{className:`text-right font-mono text-xs`,children:y(e.inputTokens)}),(0,v.jsx)(`td`,{className:`text-right font-mono text-xs`,children:y(e.outputTokens)}),(0,v.jsx)(`td`,{className:`text-right font-mono text-xs font-semibold`,children:y(e.totalTokens)}),(0,v.jsx)(`td`,{className:`text-right`,children:(0,v.jsxs)(`div`,{className:`flex items-center justify-end gap-1.5`,children:[(0,v.jsx)(`div`,{className:`w-12 h-1.5 bg-base-300 rounded-full overflow-hidden`,children:(0,v.jsx)(`div`,{className:`h-full ${r} rounded-full`,style:{width:`${t}%`}})}),(0,v.jsxs)(`span`,{className:`text-xs opacity-60 w-8 text-right`,children:[t,`%`]})]})})]},e.model)})})]})})}function D({topIssues:e}){return!e||e.length===0?null:(0,v.jsx)(`div`,{className:`overflow-x-auto`,children:(0,v.jsxs)(`table`,{className:`table table-sm`,children:[(0,v.jsx)(`thead`,{children:(0,v.jsxs)(`tr`,{children:[(0,v.jsx)(`th`,{className:`w-20`,children:`Issue`}),(0,v.jsx)(`th`,{children:`Title`}),(0,v.jsx)(`th`,{className:`text-right`,children:`Tokens`}),(0,v.jsx)(`th`,{className:`hidden sm:table-cell`,children:`Phase Split`})]})}),(0,v.jsx)(`tbody`,{children:e.slice(0,10).map(e=>{let t=e.byPhase,n=e.totalTokens||0;return(0,v.jsxs)(`tr`,{children:[(0,v.jsx)(`td`,{className:`font-mono text-xs font-semibold text-primary`,children:e.identifier}),(0,v.jsx)(`td`,{className:`max-w-[200px] truncate text-sm`,title:e.title,children:e.title||`-`}),(0,v.jsx)(`td`,{className:`text-right font-mono text-xs font-semibold`,children:y(n)}),(0,v.jsx)(`td`,{className:`hidden sm:table-cell`,children:t?(0,v.jsx)(`div`,{className:`flex h-1.5 rounded-full overflow-hidden bg-base-300 w-24`,children:S.map(e=>{let r=t[e.key]?.totalTokens||0,i=n>0?r/n*100:0;return i===0?null:(0,v.jsx)(`div`,{className:`${e.color} opacity-80`,style:{width:`${i}%`},title:`${e.label}: ${y(r)}`},e.key)})}):(0,v.jsx)(`span`,{className:`opacity-30 text-xs`,children:`-`})})]},e.id||e.identifier)})})]})})}function O({daily:e}){let t=e||[],[n,r]=(0,_.useState)(null),i=new Date().toISOString().slice(0,10),a=Math.max(...t.map(e=>e.linesAdded||0),1),o=Math.max(...t.map(e=>e.linesRemoved||0),1),s=t.length<=7?1:t.length<=14?2:t.length<=21?3:5,c=n==null?null:t[n],l=n==null?`center`:n<t.length/3?`left`:n>t.length*2/3?`right`:`center`;return(0,v.jsxs)(`div`,{children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-5 mb-3`,children:[(0,v.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs opacity-50`,children:[(0,v.jsx)(`span`,{className:`inline-block w-2.5 h-2.5 rounded-sm bg-success`}),`Lines added / day`]}),(0,v.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs opacity-50`,children:[(0,v.jsx)(`span`,{className:`inline-block w-2.5 h-2.5 rounded-sm bg-error`}),`Lines removed / day`]})]}),(0,v.jsxs)(`div`,{className:`relative`,children:[c&&(0,v.jsx)(`div`,{className:`absolute -top-1 z-10 pointer-events-none`,style:{left:l===`right`?void 0:`${(n+.5)/t.length*100}%`,right:l===`right`?`${(t.length-1-n)/t.length*100}%`:void 0,transform:l===`center`?`translateX(-50%) translateY(-100%)`:`translateY(-100%)`},children:(0,v.jsxs)(`div`,{className:`bg-base-300 border border-base-content/10 rounded-lg px-2.5 py-1.5 shadow-lg text-left whitespace-nowrap`,children:[(0,v.jsx)(`div`,{className:`text-[10px] font-semibold opacity-60 mb-1`,children:c.date===i?`Today`:new Date(c.date+`T00:00:00`).toLocaleDateString(void 0,{weekday:`short`,month:`short`,day:`numeric`})}),(0,v.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,v.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs`,children:[(0,v.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-sm bg-success shrink-0`}),(0,v.jsxs)(`span`,{className:`font-mono font-semibold`,children:[`+`,(c.linesAdded||0).toLocaleString()]}),(0,v.jsx)(`span`,{className:`opacity-50`,children:`added`})]}),(0,v.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs`,children:[(0,v.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-sm bg-error shrink-0`}),(0,v.jsxs)(`span`,{className:`font-mono font-semibold`,children:[`-`,(c.linesRemoved||0).toLocaleString()]}),(0,v.jsx)(`span`,{className:`opacity-50`,children:`removed`})]}),(c.filesChanged||0)>0&&(0,v.jsx)(`span`,{className:`flex items-center gap-1.5 text-xs`,children:(0,v.jsxs)(`span`,{className:`opacity-50`,children:[c.filesChanged,` file`,c.filesChanged===1?``:`s`]})})]})]})}),(0,v.jsx)(`div`,{className:`flex gap-px`,children:t.map((e,t)=>{let s=e.linesAdded||0,c=e.linesRemoved||0,l=s>0?Math.max(3,Math.round(s/a*64)):0,u=c>0?Math.max(3,Math.round(c/o*24)):0,d=e.date===i,f=n===t;return(0,v.jsxs)(`div`,{className:`flex-1 flex flex-col cursor-default`,onMouseEnter:()=>r(t),onMouseLeave:()=>r(null),children:[(0,v.jsxs)(`div`,{className:`relative`,style:{height:64},children:[l>0&&(0,v.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 rounded-t-[2px] bg-success transition-opacity duration-100 ${f?`opacity-80`:d?`opacity-90`:`opacity-35`}`,style:{height:l}}),f&&(0,v.jsx)(`div`,{className:`absolute inset-0 bg-base-content/5 rounded-sm`})]}),(0,v.jsx)(`div`,{className:`h-px transition-colors duration-100 ${f?`bg-base-content/20`:`bg-base-300`}`}),(0,v.jsxs)(`div`,{className:`relative`,style:{height:24},children:[u>0&&(0,v.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 rounded-t-[2px] bg-error transition-opacity duration-100 ${f?`opacity-80`:d?`opacity-90`:`opacity-35`}`,style:{height:u}}),f&&(0,v.jsx)(`div`,{className:`absolute inset-0 bg-base-content/5 rounded-sm`})]})]},e.date)})}),(0,v.jsx)(`div`,{className:`flex gap-px mt-1.5`,children:t.map((e,t)=>{let r=e.date===i,a=n===t,o=r||t===0||t%s===0,c=e.date?new Date(e.date+`T00:00:00`).toLocaleDateString(void 0,{month:`numeric`,day:`numeric`}):``;return(0,v.jsx)(`div`,{className:`flex-1 overflow-hidden`,children:o&&(0,v.jsx)(`span`,{className:`block text-center text-[9px] truncate transition-opacity duration-100 ${a?`opacity-80`:r?`opacity-60 font-semibold`:`opacity-30`}`,children:r?`today`:c})},e.date)})})]})]})}function k(e){return e==null||!Number.isFinite(e)?`–`:e<1/24?`${Math.round(e*24*60)}m`:e<1?`${(e*24).toFixed(1)}h`:`${e.toFixed(1)}d`}function A(e){return e==null||!Number.isFinite(e)?`–`:e>=1e3?`${(e/1e3).toFixed(1)}K`:Math.round(e).toString()}function j({icon:e,iconClass:t,title:n,avg:r,median:i,n:a,formatValue:o,unit:s}){return(0,v.jsxs)(`div`,{className:`stat bg-base-200 rounded-box`,children:[(0,v.jsx)(`div`,{className:`stat-figure ${t}`,children:(0,v.jsx)(e,{className:`size-6`})}),(0,v.jsx)(`div`,{className:`stat-title`,children:n}),(0,v.jsxs)(`div`,{className:`stat-value text-2xl ${t}`,children:[o(r),s&&(0,v.jsx)(`span`,{className:`text-base font-normal opacity-50 ml-1`,children:s})]}),(0,v.jsxs)(`div`,{className:`stat-desc`,children:[i==null?`–`:`median ${o(i)}`,a!=null&&(0,v.jsxs)(`span`,{className:`opacity-40`,children:[` · n=`,a]})]})]})}function M(){return(0,v.jsx)(`div`,{className:`flex-1 flex flex-col min-h-0 px-4 pb-4 pt-3`,children:(0,v.jsxs)(`div`,{className:`max-w-6xl w-full mx-auto space-y-6`,children:[(0,v.jsx)(`div`,{className:`skeleton-line h-8 w-48`}),(0,v.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4`,children:[...[,,,]].map((e,t)=>(0,v.jsx)(`div`,{className:`skeleton-card h-28`,style:{animationDelay:`${t*80}ms`}},t))}),(0,v.jsx)(`div`,{className:`skeleton-card h-52`}),(0,v.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4`,children:[(0,v.jsx)(`div`,{className:`skeleton-card h-32`}),(0,v.jsx)(`div`,{className:`skeleton-card h-32`})]}),(0,v.jsx)(`div`,{className:`skeleton-card h-64`})]})})}var N=n(`/analytics`)({component:P});function P(){let{data:e,isLoading:t}=g(),{data:n}=a(),{data:r}=o();if(t&&!e)return(0,v.jsx)(M,{});let _=e?.overall?.totalTokens||0,S=e?.byPhase||null,w=e?.byModel||{},N=s(e?.daily,32),P=e?.topIssues||[],F=new Date().toISOString().slice(0,10),I=N.find(e=>e.date===F),L=I?.totalTokens||0,R=N.reduce((e,t)=>e+(t.totalTokens||0),0),z=N.reduce((e,t)=>e+(t.events||0),0),B=I?.events||0,V=(()=>{let e=new Map((n?.lines||[]).filter(e=>e.date).map(e=>[e.date,e])),t=[];for(let n=31;n>=0;n--){let r=new Date;r.setDate(r.getDate()-n);let i=r.toISOString().slice(0,10);t.push(e.get(i)??{date:i,linesAdded:0,linesRemoved:0,filesChanged:0})}return t})(),H=V.reduce((e,t)=>e+(t.linesAdded||0),0),U=V.reduce((e,t)=>e+(t.linesRemoved||0),0),W=r?.ok?r:null;return(0,v.jsx)(`div`,{className:`flex-1 flex flex-col min-h-0 px-4 pb-4 pt-3 overflow-y-auto`,children:(0,v.jsxs)(`div`,{className:`max-w-6xl w-full mx-auto space-y-6 stagger-children`,children:[(0,v.jsx)(`section`,{children:(0,v.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-7 gap-4`,children:[(0,v.jsxs)(`div`,{className:`stat bg-base-200 rounded-box`,children:[(0,v.jsx)(`div`,{className:`stat-figure text-primary`,children:(0,v.jsx)(f,{className:`size-6`})}),(0,v.jsx)(`div`,{className:`stat-title`,children:`Total Tokens`}),(0,v.jsx)(`div`,{className:`stat-value text-2xl`,children:(0,v.jsx)(x,{value:_})}),(0,v.jsx)(`div`,{className:`stat-desc font-mono`,children:b(_)})]}),(0,v.jsxs)(`div`,{className:`stat bg-base-200 rounded-box`,children:[(0,v.jsx)(`div`,{className:`stat-figure text-accent`,children:(0,v.jsx)(c,{className:`size-6`})}),(0,v.jsx)(`div`,{className:`stat-title`,children:`Tokens Today`}),(0,v.jsx)(`div`,{className:`stat-value text-2xl`,children:(0,v.jsx)(x,{value:L})}),(0,v.jsxs)(`div`,{className:`stat-desc`,children:[`30d: `,y(R)]})]}),(0,v.jsxs)(`div`,{className:`stat bg-base-200 rounded-box`,children:[(0,v.jsx)(`div`,{className:`stat-figure text-secondary`,children:(0,v.jsx)(i,{className:`size-6`})}),(0,v.jsx)(`div`,{className:`stat-title`,children:`Total Events`}),(0,v.jsx)(`div`,{className:`stat-value text-2xl`,children:(0,v.jsx)(x,{value:z,format:e=>String(e||0)})}),(0,v.jsxs)(`div`,{className:`stat-desc`,children:[`Today: `,B]})]}),(0,v.jsxs)(`div`,{className:`stat bg-base-200 rounded-box xl:col-span-2 overflow-hidden`,children:[(0,v.jsx)(`div`,{className:`stat-figure text-info`,children:(0,v.jsx)(d,{className:`size-6`})}),(0,v.jsx)(`div`,{className:`stat-title`,children:`Phase Split`}),(0,v.jsx)(`div`,{className:`stat-value text-2xl p-0`,children:S?(0,v.jsx)(C,{byPhase:S}):(0,v.jsx)(`span`,{className:`opacity-30`,children:`-`})})]}),(0,v.jsxs)(`div`,{className:`stat bg-base-200 rounded-box`,children:[(0,v.jsx)(`div`,{className:`stat-figure text-success`,children:(0,v.jsx)(l,{className:`size-6`})}),(0,v.jsx)(`div`,{className:`stat-title`,children:`Lines Added`}),(0,v.jsx)(`div`,{className:`stat-value text-2xl text-success`,children:(0,v.jsx)(x,{value:H,format:e=>e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e||0)})}),(0,v.jsx)(`div`,{className:`stat-desc`,children:`30d total`})]}),(0,v.jsxs)(`div`,{className:`stat bg-base-200 rounded-box`,children:[(0,v.jsx)(`div`,{className:`stat-figure text-error`,children:(0,v.jsx)(l,{className:`size-6`})}),(0,v.jsx)(`div`,{className:`stat-title`,children:`Lines Removed`}),(0,v.jsx)(`div`,{className:`stat-value text-2xl text-error`,children:(0,v.jsx)(x,{value:U,format:e=>e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e||0)})}),(0,v.jsx)(`div`,{className:`stat-desc`,children:`30d total`})]})]})}),(0,v.jsxs)(`section`,{className:`bg-base-200 rounded-box p-5`,children:[(0,v.jsx)(`div`,{className:`flex items-center justify-between mb-4`,children:(0,v.jsxs)(`h2`,{className:`text-sm font-semibold flex items-center gap-2`,children:[(0,v.jsx)(p,{className:`size-4 text-primary`}),`Daily Activity`]})}),(0,v.jsx)(T,{daily:N}),(0,v.jsx)(`div`,{className:`border-t border-base-300 my-5`}),(0,v.jsx)(O,{daily:V})]}),(0,v.jsxs)(`section`,{className:`bg-base-200 rounded-box p-5`,children:[(0,v.jsxs)(`h2`,{className:`text-sm font-semibold flex items-center gap-2 mb-4`,children:[(0,v.jsx)(m,{className:`size-4 text-warning`}),`Engineering KPIs`,W?.sampleSize>0&&(0,v.jsxs)(`span`,{className:`text-xs font-normal opacity-40 ml-1`,children:[`based on `,W.sampleSize,` completed issue`,W.sampleSize===1?``:`s`]})]}),(0,v.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-4 gap-4`,children:[(0,v.jsx)(j,{icon:c,iconClass:`text-primary`,title:`Issue Cycle Time`,avg:W?.issueCycleTimeDays?.avg??null,median:W?.issueCycleTimeDays?.median??null,n:W?.issueCycleTimeDays?.n??null,formatValue:k}),(0,v.jsx)(j,{icon:u,iconClass:`text-secondary`,title:`PR Cycle Time`,avg:W?.prCycleTimeDays?.avg??null,median:W?.prCycleTimeDays?.median??null,n:W?.prCycleTimeDays?.n??null,formatValue:k}),(0,v.jsx)(j,{icon:m,iconClass:`text-warning`,title:`Review Turnaround`,avg:W?.reviewTurnaroundDays?.avg??null,median:W?.reviewTurnaroundDays?.median??null,n:W?.reviewTurnaroundDays?.n??null,formatValue:k}),(0,v.jsx)(j,{icon:l,iconClass:`text-info`,title:`PR Size`,avg:W?.prSizeLines?.avg??null,median:W?.prSizeLines?.median??null,n:W?.prSizeLines?.n??null,formatValue:A,unit:`lines`})]})]}),P.length>0&&(0,v.jsxs)(`section`,{className:`bg-base-200 rounded-box p-5`,children:[(0,v.jsxs)(`h2`,{className:`text-sm font-semibold flex items-center gap-2 mb-4`,children:[(0,v.jsx)(f,{className:`size-4 text-accent`}),`Top Issues by Token Usage`]}),(0,v.jsx)(D,{topIssues:P})]}),Object.keys(w).length>0&&(0,v.jsxs)(`section`,{className:`bg-base-200 rounded-box p-5`,children:[(0,v.jsxs)(`h2`,{className:`text-sm font-semibold flex items-center gap-2 mb-4`,children:[(0,v.jsx)(h,{className:`size-4 text-info`}),`Model Breakdown`]}),(0,v.jsx)(E,{byModel:w})]})]})})}export{N as Route};
1
+ import{n as e}from"./rolldown-runtime-DF2fYuay.js";import{I as t,h as n,o as r}from"./vendor-D-IqxHHu.js";import{R as i,S as a,U as o,V as s,_ as c,g as l,k as u,m as d,n as f,o as p,s as m,x as h,z as g}from"./index-59O8esMr.js";var _=e(t(),1),v=n();function y(e){return!e||e===0?`0`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function b(e){return!e||e===0?`0`:e.toLocaleString()}function x({value:e,format:t=y,className:n=``}){let[r,i]=(0,_.useState)(()=>t(e)),a=(0,_.useRef)(e),o=(0,_.useRef)(null);return(0,_.useEffect)(()=>{let n=a.current||0,r=e||0;if(a.current=r,n===r){i(t(r));return}let s=performance.now(),c=e=>{let a=e-s,l=Math.min(a/600,1),u=1-(1-l)**3,d=n+(r-n)*u;i(t(Math.round(d))),l<1&&(o.current=requestAnimationFrame(c))};return cancelAnimationFrame(o.current),o.current=requestAnimationFrame(c),()=>cancelAnimationFrame(o.current)},[e,t]),(0,v.jsx)(`span`,{className:`${n} inline-block tabular-nums`,children:r})}var S=[{key:`planner`,label:`Plan`,color:`bg-info`,textColor:`text-info`},{key:`executor`,label:`Execute`,color:`bg-primary`,textColor:`text-primary`},{key:`reviewer`,label:`Review`,color:`bg-secondary`,textColor:`text-secondary`}];function C({byPhase:e}){if(!e)return null;let t=S.reduce((t,n)=>t+(e[n.key]?.totalTokens||0),0);return t===0?null:(0,v.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,v.jsx)(`div`,{className:`flex h-4 rounded-full overflow-hidden bg-base-300 w-full`,children:S.map(n=>{let r=e[n.key]?.totalTokens||0,i=r/t*100;return i===0?null:(0,v.jsx)(`div`,{className:`${n.color} opacity-80 transition-all duration-500`,style:{width:`${i}%`},title:`${n.label}: ${b(r)} (${Math.round(i)}%)`},n.key)})}),(0,v.jsx)(`div`,{className:`flex items-center gap-3 flex-wrap text-xs`,children:S.map(n=>{let r=e[n.key]?.totalTokens||0,i=t>0?Math.round(r/t*100):0;return r===0?null:(0,v.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,v.jsx)(`span`,{className:`inline-block size-2 rounded-full ${n.color} shrink-0`}),(0,v.jsx)(`span`,{className:`opacity-60`,children:n.label}),(0,v.jsx)(`span`,{className:`font-mono font-semibold`,children:y(r)}),(0,v.jsxs)(`span`,{className:`opacity-40`,children:[`(`,i,`%)`]})]},n.key)})})]})}function w({data:e,valueKey:t,barClass:n,label:r,height:i=64,showXAxis:a=!1,hoveredIdx:o,onHover:s,formatTooltip:c}){if(!e||e.length===0)return null;let l=new Date().toISOString().slice(0,10),u=Math.max(...e.map(e=>e[t]||0),1),d=e.length<=7?1:e.length<=14?2:e.length<=21?3:5,f=o==null?null:e[o],p=o==null?`center`:o<e.length/3?`left`:o>e.length*2/3?`right`:`center`;return(0,v.jsxs)(`div`,{className:`relative`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs opacity-50 mb-2`,children:[(0,v.jsx)(`span`,{className:`inline-block w-2.5 h-2.5 rounded-sm ${n}`}),r]}),f&&(0,v.jsx)(`div`,{className:`absolute top-5 z-10 pointer-events-none`,style:{left:p===`right`?void 0:`${(o+.5)/e.length*100}%`,right:p===`right`?`${(e.length-1-o)/e.length*100}%`:void 0,transform:p===`center`?`translateX(-50%) translateY(-100%)`:`translateY(-100%)`},children:(0,v.jsxs)(`div`,{className:`bg-base-300 border border-base-content/10 rounded-lg px-2.5 py-1.5 shadow-lg text-left whitespace-nowrap`,children:[(0,v.jsx)(`div`,{className:`text-[10px] font-semibold opacity-60 mb-0.5`,children:f.date===l?`Today`:new Date(f.date+`T00:00:00`).toLocaleDateString(void 0,{weekday:`short`,month:`short`,day:`numeric`})}),(0,v.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs`,children:[(0,v.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-sm ${n} shrink-0`}),(0,v.jsx)(`span`,{className:`font-mono font-semibold`,children:c?c(f[t]||0):(f[t]||0).toLocaleString()})]})]})}),(0,v.jsx)(`div`,{className:`flex gap-px`,style:{height:i},children:e.map((e,r)=>{let a=e[t]||0,c=a>0?Math.max(3,Math.round(a/u*i)):0,d=e.date===l,f=o===r;return(0,v.jsxs)(`div`,{className:`flex-1 relative cursor-default`,onMouseEnter:()=>s?.(r),onMouseLeave:()=>s?.(null),children:[c>0&&(0,v.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 rounded-t-[2px] ${n} transition-opacity duration-100 ${f?`opacity-80`:d?`opacity-90`:`opacity-35`}`,style:{height:c}}),f&&(0,v.jsx)(`div`,{className:`absolute inset-0 bg-base-content/5 rounded-sm`})]},e.date)})}),a&&(0,v.jsx)(`div`,{className:`flex gap-px mt-1.5`,children:e.map((e,t)=>{let n=e.date===l,r=o===t,i=n||t===0||t%d===0,a=e.date?new Date(e.date+`T00:00:00`).toLocaleDateString(void 0,{month:`numeric`,day:`numeric`}):``;return(0,v.jsx)(`div`,{className:`flex-1 overflow-hidden`,children:i&&(0,v.jsx)(`span`,{className:`block text-center text-[9px] truncate transition-opacity duration-100 ${r?`opacity-80`:n?`opacity-60 font-semibold`:`opacity-30`}`,children:n?`today`:a})},e.date)})})]})}function T({daily:e}){let[t,n]=(0,_.useState)(null),r=e||[];return(0,v.jsxs)(`div`,{className:`space-y-4`,children:[(0,v.jsx)(w,{data:r,valueKey:`totalTokens`,barClass:`bg-primary`,label:`Tokens / day`,height:64,showXAxis:!1,hoveredIdx:t,onHover:n,formatTooltip:e=>e.toLocaleString()}),(0,v.jsx)(w,{data:r,valueKey:`events`,barClass:`bg-secondary`,label:`Events / day`,height:36,showXAxis:!0,hoveredIdx:t,onHover:n})]})}function E({byModel:e}){if(!e)return null;let t=Object.entries(e).map(([e,t])=>({model:e,inputTokens:t?.inputTokens||0,outputTokens:t?.outputTokens||0,totalTokens:t?.totalTokens||0})).sort((e,t)=>t.totalTokens-e.totalTokens);if(t.length===0)return null;let n=t.reduce((e,t)=>e+t.totalTokens,0);return(0,v.jsx)(`div`,{className:`overflow-x-auto`,children:(0,v.jsxs)(`table`,{className:`table table-sm`,children:[(0,v.jsx)(`thead`,{children:(0,v.jsxs)(`tr`,{children:[(0,v.jsx)(`th`,{children:`Model`}),(0,v.jsx)(`th`,{className:`text-right`,children:`Input`}),(0,v.jsx)(`th`,{className:`text-right`,children:`Output`}),(0,v.jsx)(`th`,{className:`text-right`,children:`Total`}),(0,v.jsx)(`th`,{className:`text-right`,children:`Share`})]})}),(0,v.jsx)(`tbody`,{children:t.map(e=>{let t=n>0?Math.round(e.totalTokens/n*100):0,r=e.model.includes(`claude`)?`bg-primary`:e.model.includes(`codex`)?`bg-secondary`:`bg-accent`;return(0,v.jsxs)(`tr`,{children:[(0,v.jsxs)(`td`,{className:`flex items-center gap-2`,children:[(0,v.jsx)(`span`,{className:`inline-block w-2.5 h-2.5 rounded-full ${r} shrink-0`}),(0,v.jsx)(`span`,{className:`font-mono text-xs`,children:e.model})]}),(0,v.jsx)(`td`,{className:`text-right font-mono text-xs`,children:y(e.inputTokens)}),(0,v.jsx)(`td`,{className:`text-right font-mono text-xs`,children:y(e.outputTokens)}),(0,v.jsx)(`td`,{className:`text-right font-mono text-xs font-semibold`,children:y(e.totalTokens)}),(0,v.jsx)(`td`,{className:`text-right`,children:(0,v.jsxs)(`div`,{className:`flex items-center justify-end gap-1.5`,children:[(0,v.jsx)(`div`,{className:`w-12 h-1.5 bg-base-300 rounded-full overflow-hidden`,children:(0,v.jsx)(`div`,{className:`h-full ${r} rounded-full`,style:{width:`${t}%`}})}),(0,v.jsxs)(`span`,{className:`text-xs opacity-60 w-8 text-right`,children:[t,`%`]})]})})]},e.model)})})]})})}function D({topIssues:e}){return!e||e.length===0?null:(0,v.jsx)(`div`,{className:`overflow-x-auto`,children:(0,v.jsxs)(`table`,{className:`table table-sm`,children:[(0,v.jsx)(`thead`,{children:(0,v.jsxs)(`tr`,{children:[(0,v.jsx)(`th`,{className:`w-20`,children:`Issue`}),(0,v.jsx)(`th`,{children:`Title`}),(0,v.jsx)(`th`,{className:`text-right`,children:`Tokens`}),(0,v.jsx)(`th`,{className:`hidden sm:table-cell`,children:`Phase Split`})]})}),(0,v.jsx)(`tbody`,{children:e.slice(0,10).map(e=>{let t=e.byPhase,n=e.totalTokens||0;return(0,v.jsxs)(`tr`,{children:[(0,v.jsx)(`td`,{className:`font-mono text-xs font-semibold text-primary`,children:e.identifier}),(0,v.jsx)(`td`,{className:`max-w-[200px] truncate text-sm`,title:e.title,children:e.title||`-`}),(0,v.jsx)(`td`,{className:`text-right font-mono text-xs font-semibold`,children:y(n)}),(0,v.jsx)(`td`,{className:`hidden sm:table-cell`,children:t?(0,v.jsx)(`div`,{className:`flex h-1.5 rounded-full overflow-hidden bg-base-300 w-24`,children:S.map(e=>{let r=t[e.key]?.totalTokens||0,i=n>0?r/n*100:0;return i===0?null:(0,v.jsx)(`div`,{className:`${e.color} opacity-80`,style:{width:`${i}%`},title:`${e.label}: ${y(r)}`},e.key)})}):(0,v.jsx)(`span`,{className:`opacity-30 text-xs`,children:`-`})})]},e.id||e.identifier)})})]})})}function O({daily:e}){let t=e||[],[n,r]=(0,_.useState)(null),i=new Date().toISOString().slice(0,10),a=Math.max(...t.map(e=>e.linesAdded||0),1),o=Math.max(...t.map(e=>e.linesRemoved||0),1),s=t.length<=7?1:t.length<=14?2:t.length<=21?3:5,c=n==null?null:t[n],l=n==null?`center`:n<t.length/3?`left`:n>t.length*2/3?`right`:`center`;return(0,v.jsxs)(`div`,{children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-5 mb-3`,children:[(0,v.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs opacity-50`,children:[(0,v.jsx)(`span`,{className:`inline-block w-2.5 h-2.5 rounded-sm bg-success`}),`Lines added / day`]}),(0,v.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs opacity-50`,children:[(0,v.jsx)(`span`,{className:`inline-block w-2.5 h-2.5 rounded-sm bg-error`}),`Lines removed / day`]})]}),(0,v.jsxs)(`div`,{className:`relative`,children:[c&&(0,v.jsx)(`div`,{className:`absolute -top-1 z-10 pointer-events-none`,style:{left:l===`right`?void 0:`${(n+.5)/t.length*100}%`,right:l===`right`?`${(t.length-1-n)/t.length*100}%`:void 0,transform:l===`center`?`translateX(-50%) translateY(-100%)`:`translateY(-100%)`},children:(0,v.jsxs)(`div`,{className:`bg-base-300 border border-base-content/10 rounded-lg px-2.5 py-1.5 shadow-lg text-left whitespace-nowrap`,children:[(0,v.jsx)(`div`,{className:`text-[10px] font-semibold opacity-60 mb-1`,children:c.date===i?`Today`:new Date(c.date+`T00:00:00`).toLocaleDateString(void 0,{weekday:`short`,month:`short`,day:`numeric`})}),(0,v.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,v.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs`,children:[(0,v.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-sm bg-success shrink-0`}),(0,v.jsxs)(`span`,{className:`font-mono font-semibold`,children:[`+`,(c.linesAdded||0).toLocaleString()]}),(0,v.jsx)(`span`,{className:`opacity-50`,children:`added`})]}),(0,v.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs`,children:[(0,v.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-sm bg-error shrink-0`}),(0,v.jsxs)(`span`,{className:`font-mono font-semibold`,children:[`-`,(c.linesRemoved||0).toLocaleString()]}),(0,v.jsx)(`span`,{className:`opacity-50`,children:`removed`})]}),(c.filesChanged||0)>0&&(0,v.jsx)(`span`,{className:`flex items-center gap-1.5 text-xs`,children:(0,v.jsxs)(`span`,{className:`opacity-50`,children:[c.filesChanged,` file`,c.filesChanged===1?``:`s`]})})]})]})}),(0,v.jsx)(`div`,{className:`flex gap-px`,children:t.map((e,t)=>{let s=e.linesAdded||0,c=e.linesRemoved||0,l=s>0?Math.max(3,Math.round(s/a*64)):0,u=c>0?Math.max(3,Math.round(c/o*24)):0,d=e.date===i,f=n===t;return(0,v.jsxs)(`div`,{className:`flex-1 flex flex-col cursor-default`,onMouseEnter:()=>r(t),onMouseLeave:()=>r(null),children:[(0,v.jsxs)(`div`,{className:`relative`,style:{height:64},children:[l>0&&(0,v.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 rounded-t-[2px] bg-success transition-opacity duration-100 ${f?`opacity-80`:d?`opacity-90`:`opacity-35`}`,style:{height:l}}),f&&(0,v.jsx)(`div`,{className:`absolute inset-0 bg-base-content/5 rounded-sm`})]}),(0,v.jsx)(`div`,{className:`h-px transition-colors duration-100 ${f?`bg-base-content/20`:`bg-base-300`}`}),(0,v.jsxs)(`div`,{className:`relative`,style:{height:24},children:[u>0&&(0,v.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 rounded-t-[2px] bg-error transition-opacity duration-100 ${f?`opacity-80`:d?`opacity-90`:`opacity-35`}`,style:{height:u}}),f&&(0,v.jsx)(`div`,{className:`absolute inset-0 bg-base-content/5 rounded-sm`})]})]},e.date)})}),(0,v.jsx)(`div`,{className:`flex gap-px mt-1.5`,children:t.map((e,t)=>{let r=e.date===i,a=n===t,o=r||t===0||t%s===0,c=e.date?new Date(e.date+`T00:00:00`).toLocaleDateString(void 0,{month:`numeric`,day:`numeric`}):``;return(0,v.jsx)(`div`,{className:`flex-1 overflow-hidden`,children:o&&(0,v.jsx)(`span`,{className:`block text-center text-[9px] truncate transition-opacity duration-100 ${a?`opacity-80`:r?`opacity-60 font-semibold`:`opacity-30`}`,children:r?`today`:c})},e.date)})})]})]})}function k(e){return e==null||!Number.isFinite(e)?`–`:e<1/24?`${Math.round(e*24*60)}m`:e<1?`${(e*24).toFixed(1)}h`:`${e.toFixed(1)}d`}function A(e){return e==null||!Number.isFinite(e)?`–`:e>=1e3?`${(e/1e3).toFixed(1)}K`:Math.round(e).toString()}function j({icon:e,iconClass:t,title:n,avg:r,median:i,n:a,formatValue:o,unit:s}){return(0,v.jsxs)(`div`,{className:`stat bg-base-200 rounded-box`,children:[(0,v.jsx)(`div`,{className:`stat-figure ${t}`,children:(0,v.jsx)(e,{className:`size-6`})}),(0,v.jsx)(`div`,{className:`stat-title`,children:n}),(0,v.jsxs)(`div`,{className:`stat-value text-2xl ${t}`,children:[o(r),s&&(0,v.jsx)(`span`,{className:`text-base font-normal opacity-50 ml-1`,children:s})]}),(0,v.jsxs)(`div`,{className:`stat-desc`,children:[i==null?`–`:`median ${o(i)}`,a!=null&&(0,v.jsxs)(`span`,{className:`opacity-40`,children:[` · n=`,a]})]})]})}var M=r(`/analytics`)({component:z});function N({h:e=`h-28`}){return(0,v.jsx)(`div`,{className:`skeleton-card ${e} w-full rounded-box`})}function P(){let{data:e}=s(),{data:t}=i(),n=e?.overall?.totalTokens||0,r=e?.byPhase||null,l=o(e?.daily,32),p=new Date().toISOString().slice(0,10),m=l.find(e=>e.date===p),h=m?.totalTokens||0,g=l.reduce((e,t)=>e+(t.totalTokens||0),0),_=l.reduce((e,t)=>e+(t.events||0),0),S=m?.events||0,w=(()=>{let e=new Map((t?.lines||[]).filter(e=>e.date).map(e=>[e.date,e])),n=[];for(let t=31;t>=0;t--){let r=new Date;r.setDate(r.getDate()-t);let i=r.toISOString().slice(0,10);n.push(e.get(i)??{date:i,linesAdded:0,linesRemoved:0,filesChanged:0})}return n})(),T=w.reduce((e,t)=>e+(t.linesAdded||0),0),E=w.reduce((e,t)=>e+(t.linesRemoved||0),0);return e?(0,v.jsx)(`section`,{children:(0,v.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-7 gap-4`,children:[(0,v.jsxs)(`div`,{className:`stat bg-base-200 rounded-box`,children:[(0,v.jsx)(`div`,{className:`stat-figure text-primary`,children:(0,v.jsx)(f,{className:`size-6`})}),(0,v.jsx)(`div`,{className:`stat-title`,children:`Total Tokens`}),(0,v.jsx)(`div`,{className:`stat-value text-2xl`,children:(0,v.jsx)(x,{value:n})}),(0,v.jsx)(`div`,{className:`stat-desc font-mono`,children:b(n)})]}),(0,v.jsxs)(`div`,{className:`stat bg-base-200 rounded-box`,children:[(0,v.jsx)(`div`,{className:`stat-figure text-accent`,children:(0,v.jsx)(a,{className:`size-6`})}),(0,v.jsx)(`div`,{className:`stat-title`,children:`Tokens Today`}),(0,v.jsx)(`div`,{className:`stat-value text-2xl`,children:(0,v.jsx)(x,{value:h})}),(0,v.jsxs)(`div`,{className:`stat-desc`,children:[`30d: `,y(g)]})]}),(0,v.jsxs)(`div`,{className:`stat bg-base-200 rounded-box`,children:[(0,v.jsx)(`div`,{className:`stat-figure text-secondary`,children:(0,v.jsx)(u,{className:`size-6`})}),(0,v.jsx)(`div`,{className:`stat-title`,children:`Total Events`}),(0,v.jsx)(`div`,{className:`stat-value text-2xl`,children:(0,v.jsx)(x,{value:_,format:e=>String(e||0)})}),(0,v.jsxs)(`div`,{className:`stat-desc`,children:[`Today: `,S]})]}),(0,v.jsxs)(`div`,{className:`stat bg-base-200 rounded-box xl:col-span-2 overflow-hidden`,children:[(0,v.jsx)(`div`,{className:`stat-figure text-info`,children:(0,v.jsx)(d,{className:`size-6`})}),(0,v.jsx)(`div`,{className:`stat-title`,children:`Phase Split`}),(0,v.jsx)(`div`,{className:`stat-value text-2xl p-0`,children:r?(0,v.jsx)(C,{byPhase:r}):(0,v.jsx)(`span`,{className:`opacity-30`,children:`-`})})]}),(0,v.jsxs)(`div`,{className:`stat bg-base-200 rounded-box`,children:[(0,v.jsx)(`div`,{className:`stat-figure text-success`,children:(0,v.jsx)(c,{className:`size-6`})}),(0,v.jsx)(`div`,{className:`stat-title`,children:`Lines Added`}),(0,v.jsx)(`div`,{className:`stat-value text-2xl text-success`,children:(0,v.jsx)(x,{value:T,format:e=>e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e||0)})}),(0,v.jsx)(`div`,{className:`stat-desc`,children:`30d total`})]}),(0,v.jsxs)(`div`,{className:`stat bg-base-200 rounded-box`,children:[(0,v.jsx)(`div`,{className:`stat-figure text-error`,children:(0,v.jsx)(c,{className:`size-6`})}),(0,v.jsx)(`div`,{className:`stat-title`,children:`Lines Removed`}),(0,v.jsx)(`div`,{className:`stat-value text-2xl text-error`,children:(0,v.jsx)(x,{value:E,format:e=>e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e||0)})}),(0,v.jsx)(`div`,{className:`stat-desc`,children:`30d total`})]})]})}):(0,v.jsx)(N,{h:`h-32`})}function F(){let{data:e}=s(),{data:t}=i(),n=o(e?.daily,32),r=(()=>{let e=new Map((t?.lines||[]).filter(e=>e.date).map(e=>[e.date,e])),n=[];for(let t=31;t>=0;t--){let r=new Date;r.setDate(r.getDate()-t);let i=r.toISOString().slice(0,10);n.push(e.get(i)??{date:i,linesAdded:0,linesRemoved:0,filesChanged:0})}return n})();return e?(0,v.jsxs)(`section`,{className:`bg-base-200 rounded-box p-5`,children:[(0,v.jsx)(`div`,{className:`flex items-center justify-between mb-4`,children:(0,v.jsxs)(`h2`,{className:`text-sm font-semibold flex items-center gap-2`,children:[(0,v.jsx)(p,{className:`size-4 text-primary`}),`Daily Activity`]})}),(0,v.jsx)(T,{daily:n}),(0,v.jsx)(`div`,{className:`border-t border-base-300 my-5`}),(0,v.jsx)(O,{daily:r})]}):(0,v.jsx)(N,{h:`h-52`})}function I(){let{data:e}=g(),t=e?.ok?e:null;return e?(0,v.jsxs)(`section`,{className:`bg-base-200 rounded-box p-5`,children:[(0,v.jsxs)(`h2`,{className:`text-sm font-semibold flex items-center gap-2 mb-4`,children:[(0,v.jsx)(m,{className:`size-4 text-warning`}),`Engineering KPIs`,t?.sampleSize>0&&(0,v.jsxs)(`span`,{className:`text-xs font-normal opacity-40 ml-1`,children:[`based on `,t.sampleSize,` completed issue`,t.sampleSize===1?``:`s`]})]}),(0,v.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-4 gap-4`,children:[(0,v.jsx)(j,{icon:a,iconClass:`text-primary`,title:`Issue Cycle Time`,avg:t?.issueCycleTimeDays?.avg??null,median:t?.issueCycleTimeDays?.median??null,n:t?.issueCycleTimeDays?.n??null,formatValue:k}),(0,v.jsx)(j,{icon:l,iconClass:`text-secondary`,title:`PR Cycle Time`,avg:t?.prCycleTimeDays?.avg??null,median:t?.prCycleTimeDays?.median??null,n:t?.prCycleTimeDays?.n??null,formatValue:k}),(0,v.jsx)(j,{icon:m,iconClass:`text-warning`,title:`Review Turnaround`,avg:t?.reviewTurnaroundDays?.avg??null,median:t?.reviewTurnaroundDays?.median??null,n:t?.reviewTurnaroundDays?.n??null,formatValue:k}),(0,v.jsx)(j,{icon:c,iconClass:`text-info`,title:`PR Size`,avg:t?.prSizeLines?.avg??null,median:t?.prSizeLines?.median??null,n:t?.prSizeLines?.n??null,formatValue:A,unit:`lines`})]})]}):(0,v.jsx)(N,{h:`h-36`})}function L(){let{data:e}=s(),t=e?.topIssues||[];return e?t.length===0?null:(0,v.jsxs)(`section`,{className:`bg-base-200 rounded-box p-5`,children:[(0,v.jsxs)(`h2`,{className:`text-sm font-semibold flex items-center gap-2 mb-4`,children:[(0,v.jsx)(f,{className:`size-4 text-accent`}),`Top Issues by Token Usage`]}),(0,v.jsx)(D,{topIssues:t})]}):(0,v.jsx)(N,{h:`h-40`})}function R(){let{data:e}=s(),t=e?.byModel||{};return e?Object.keys(t).length===0?null:(0,v.jsxs)(`section`,{className:`bg-base-200 rounded-box p-5`,children:[(0,v.jsxs)(`h2`,{className:`text-sm font-semibold flex items-center gap-2 mb-4`,children:[(0,v.jsx)(h,{className:`size-4 text-info`}),`Model Breakdown`]}),(0,v.jsx)(E,{byModel:t})]}):(0,v.jsx)(N,{h:`h-40`})}function z(){return(0,v.jsx)(`div`,{className:`flex-1 flex flex-col min-h-0 px-4 pb-4 pt-3 overflow-y-auto`,children:(0,v.jsxs)(`div`,{className:`max-w-6xl w-full mx-auto space-y-6`,children:[(0,v.jsx)(P,{}),(0,v.jsx)(F,{}),(0,v.jsx)(I,{}),(0,v.jsx)(L,{}),(0,v.jsx)(R,{})]})})}export{M as Route};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DF2fYuay.js";import{I as t}from"./vendor-BTlTWMUF.js";var n=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),r=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),i=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),a=e=>{let t=i(e);return t.charAt(0).toUpperCase()+t.slice(1)},o={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},s=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},c=e(t()),l=(0,c.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:a=``,children:l,iconNode:u,...d},f)=>(0,c.createElement)(`svg`,{ref:f,...o,width:t,height:t,stroke:e,strokeWidth:i?Number(r)*24/Number(t):r,className:n(`lucide`,a),...!l&&!s(d)&&{"aria-hidden":`true`},...d},[...u.map(([e,t])=>(0,c.createElement)(e,t)),...Array.isArray(l)?l:[l]])),u=(e,t)=>{let i=(0,c.forwardRef)(({className:i,...o},s)=>(0,c.createElement)(l,{ref:s,iconNode:t,className:n(`lucide-${r(a(e))}`,`lucide-${e}`,i),...o}));return i.displayName=a(e),i};export{u as t};
1
+ import{n as e}from"./rolldown-runtime-DF2fYuay.js";import{I as t}from"./vendor-D-IqxHHu.js";var n=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),r=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),i=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),a=e=>{let t=i(e);return t.charAt(0).toUpperCase()+t.slice(1)},o={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},s=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},c=e(t()),l=(0,c.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:a=``,children:l,iconNode:u,...d},f)=>(0,c.createElement)(`svg`,{ref:f,...o,width:t,height:t,stroke:e,strokeWidth:i?Number(r)*24/Number(t):r,className:n(`lucide`,a),...!l&&!s(d)&&{"aria-hidden":`true`},...d},[...u.map(([e,t])=>(0,c.createElement)(e,t)),...Array.isArray(l)?l:[l]])),u=(e,t)=>{let i=(0,c.forwardRef)(({className:i,...o},s)=>(0,c.createElement)(l,{ref:s,iconNode:t,className:n(`lucide-${r(a(e))}`,`lucide-${e}`,i),...o}));return i.displayName=a(e),i};export{u as t};