fifony 0.1.21 → 0.1.22
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/README.md +7 -0
- package/app/dist/assets/{KeyboardShortcutsHelp-BTjiQe_Y.js → KeyboardShortcutsHelp-DFstgyXD.js} +1 -1
- package/app/dist/assets/OnboardingWizard-Daehu2Uj.js +1 -0
- package/app/dist/assets/analytics.lazy-C1-iSRM_.js +1 -0
- package/app/dist/assets/{createLucideIcon-DtZs0TX0.js → createLucideIcon-BWC-guQt.js} +1 -1
- package/app/dist/assets/index-DbIrs0MK.css +1 -0
- package/app/dist/assets/index-O_FDwkw6.js +43 -0
- package/app/dist/assets/vendor-BTlTWMUF.js +9 -0
- package/app/dist/index.html +4 -5
- package/app/dist/service-worker.js +1 -1
- package/bin/fifony-wrap.js +53 -0
- package/dist/agent/cli-wrapper.js +78 -0
- package/dist/agent/cli-wrapper.js.map +1 -0
- package/dist/agent/run-local.js +93 -7889
- package/dist/agent/run-local.js.map +1 -1
- package/dist/chunk-F6JEQIP2.js +449 -0
- package/dist/chunk-F6JEQIP2.js.map +1 -0
- package/dist/{chunk-SMGXYOWU.js → chunk-O665NS5E.js} +411 -9
- package/dist/chunk-O665NS5E.js.map +1 -0
- package/dist/chunk-VP6TGOMT.js +8915 -0
- package/dist/chunk-VP6TGOMT.js.map +1 -0
- package/dist/cli.js +182 -0
- package/dist/cli.js.map +1 -1
- package/dist/issue-runner-MDCJ4G26.js +11 -0
- package/dist/issue-runner-MDCJ4G26.js.map +1 -0
- package/dist/mcp/server.js +589 -595
- package/dist/mcp/server.js.map +1 -1
- package/dist/queue-workers-LAYOT4E5.js +21 -0
- package/dist/queue-workers-LAYOT4E5.js.map +1 -0
- package/package.json +10 -9
- package/app/dist/assets/OnboardingWizard-BALlquG0.js +0 -1
- package/app/dist/assets/analytics.lazy-DjSzXIey.js +0 -1
- package/app/dist/assets/index-BV11ScVl.js +0 -42
- package/app/dist/assets/index-DWbxgKSd.css +0 -1
- package/app/dist/assets/vendor-BoGBoEwT.js +0 -9
- package/app/dist/assets/zap-DpjdVd1i.js +0 -1
- package/dist/chunk-SMGXYOWU.js.map +0 -1
package/README.md
CHANGED
|
@@ -146,6 +146,13 @@ npx -y fifony --once
|
|
|
146
146
|
|
|
147
147
|
# Fine-grained control
|
|
148
148
|
npx -y fifony --concurrency 2 --attempts 3 --poll 500
|
|
149
|
+
|
|
150
|
+
# Onboarding reference repositories
|
|
151
|
+
fifony onboarding list
|
|
152
|
+
fifony onboarding sync
|
|
153
|
+
fifony onboarding sync --repository ring
|
|
154
|
+
fifony onboarding import ring --kind skills
|
|
155
|
+
fifony onboarding import agency-agents --kind agents --overwrite
|
|
149
156
|
```
|
|
150
157
|
|
|
151
158
|
---
|
package/app/dist/assets/{KeyboardShortcutsHelp-BTjiQe_Y.js → KeyboardShortcutsHelp-DFstgyXD.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DF2fYuay.js";import{I as t,h as n}from"./vendor-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DF2fYuay.js";import{I as t,h as n}from"./vendor-BTlTWMUF.js";import{t as r}from"./createLucideIcon-BWC-guQt.js";import{i}from"./index-O_FDwkw6.js";var a=r(`keyboard`,[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]),o=e(t(),1),s=n(),c=[{key:`n`,description:`Open New Issue drawer`},{key:`k`,description:`Navigate to Kanban`},{key:`i`,description:`Navigate to Issues`},{key:`a`,description:`Navigate to Agents`},{key:`t`,description:`Navigate to Analytics`},{key:`s`,description:`Navigate to Settings`},{key:`1–6`,description:`Jump to kanban column by index`},{key:`Esc`,description:`Close any open drawer / modal`},{key:`?`,description:`Show this help`}];function l({open:e,onClose:t}){let n=(0,o.useRef)(null);return(0,o.useEffect)(()=>{let t=n.current;t&&(e&&!t.open?t.showModal():!e&&t.open&&t.close())},[e]),(0,s.jsxs)(`dialog`,{ref:n,className:`modal modal-bottom sm:modal-middle`,onClose:t,children:[(0,s.jsxs)(`div`,{className:`modal-box max-w-md`,children:[(0,s.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,s.jsxs)(`h3`,{className:`font-bold text-lg flex items-center gap-2`,children:[(0,s.jsx)(a,{className:`size-5 opacity-60`}),`Keyboard Shortcuts`]}),(0,s.jsx)(`button`,{className:`btn btn-sm btn-ghost btn-circle`,onClick:t,children:(0,s.jsx)(i,{className:`size-4`})})]}),(0,s.jsx)(`div`,{className:`overflow-x-auto`,children:(0,s.jsxs)(`table`,{className:`table table-sm`,children:[(0,s.jsx)(`thead`,{children:(0,s.jsxs)(`tr`,{children:[(0,s.jsx)(`th`,{children:`Key`}),(0,s.jsx)(`th`,{children:`Action`})]})}),(0,s.jsx)(`tbody`,{children:c.map(e=>(0,s.jsxs)(`tr`,{children:[(0,s.jsx)(`td`,{children:(0,s.jsx)(`kbd`,{className:`kbd kbd-sm`,children:e.key})}),(0,s.jsx)(`td`,{children:e.description})]},e.key))})]})}),(0,s.jsx)(`div`,{className:`modal-action`,children:(0,s.jsx)(`button`,{className:`btn btn-sm`,onClick:t,children:`Close`})})]}),(0,s.jsx)(`form`,{method:`dialog`,className:`modal-backdrop`,children:(0,s.jsx)(`button`,{children:`close`})})]})}export{l as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DF2fYuay.js";import{I as t,h as n,m as r}from"./vendor-BTlTWMUF.js";import{t as i}from"./createLucideIcon-BWC-guQt.js";import{A as a,C as o,D as s,E as c,F as l,I as u,M as d,N as f,P as p,S as m,T as h,V as g,_,a as v,d as y,f as b,h as x,j as S,k as C,l as w,m as T,n as E,o as D,p as O,r as k,t as ee,u as A,v as j,w as M,y as N,z as te}from"./index-O_FDwkw6.js";var P=i(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),ne=i(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),F=i(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),I=i(`flame`,[[`path`,{d:`M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4`,key:`1slcih`}]]),L=i(`folder-root`,[[`path`,{d:`M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z`,key:`1fr9dc`}],[`circle`,{cx:`12`,cy:`13`,r:`2`,key:`1c1ljs`}],[`path`,{d:`M12 15v5`,key:`11xva1`}]]),R=i(`pencil-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`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`}]]),z=i(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]),B=i(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),V=e(t(),1),re=[`Welcome`,`Setup`,`Pipeline`,`Agents & Skills`,`Preferences`,`Launch`];function ie(){return re}function ae(){return re.length}var H=[`Setup`,`Pipeline`,`Agents`,`Preferences`,`Launch`];function U(){return H}var W=[{value:`low`,label:`Low`,icon:k,description:`Quick and light -- fast responses, less thorough`,color:`text-info`},{value:`medium`,label:`Medium`,icon:N,description:`Balanced -- good mix of speed and quality`,color:`text-success`},{value:`high`,label:`High`,icon:P,description:`Thorough -- deeper analysis, takes more time`,color:`text-warning`},{value:`extra-high`,label:`Extra High`,icon:I,description:`Maximum depth -- most thorough, slowest`,color:`text-error`}],oe={codex:W,claude:W.filter(e=>e.value!==`extra-high`),gemini:W.filter(e=>e.value!==`extra-high`)};function G(e,t){return oe[t?.[e]||`codex`]||W}var K=[{value:`auto`,label:`Auto`},{value:`light`,label:`Light`},{value:`dark`,label:`Dark`},{value:`black`,label:`Black`},{value:`cupcake`,label:`Cupcake`},{value:`night`,label:`Night`},{value:`sunset`,label:`Sunset`}],se=[{role:`planner`,label:`Planner`,description:`Scopes the issue, breaks it into steps, and decides the approach`,icon:P,color:`text-info`},{role:`executor`,label:`Executor`,description:`Implements the plan — writes code, edits files, runs commands`,icon:k,color:`text-primary`},{role:`reviewer`,label:`Reviewer`,description:`Validates the result — checks correctness, scope, and quality`,icon:A,color:`text-secondary`}];async function q(e,t,n=`ui`){return g.post(`/settings/${encodeURIComponent(e)}`,{value:t,scope:n,source:`user`})}function J(e,t=`medium`){return W.some(t=>t.value===e)?e:t}function ce(e){return!e||typeof e!=`object`||Array.isArray(e)?{planner:`medium`,executor:`medium`,reviewer:`medium`}:{planner:J(e.planner??e.default,`medium`),executor:J(e.executor??e.default,`medium`),reviewer:J(e.reviewer??e.default,`medium`)}}function le(e,t,n={}){return{plan:{provider:e.planner||e.executor||``,model:n.plan||``,effort:t.planner||`medium`},execute:{provider:e.executor||``,model:n.execute||``,effort:t.executor||`medium`},review:{provider:e.reviewer||e.executor||``,model:n.review||``,effort:t.reviewer||`medium`}}}var Y=n();function ue({current:e}){let t=U(),n=e-1;return(0,Y.jsx)(`ul`,{className:`steps steps-horizontal w-full max-w-2xl text-xs`,children:t.map((e,t)=>{let r=t<n,i=t===n;return(0,Y.jsx)(`li`,{"data-content":r?`✓`:t+1,className:`step ${r||i?`step-primary`:``}`,style:{transition:`color 0.3s ease`},children:e},e)})})}function de({direction:e,stepKey:t,center:n,children:r}){return(0,Y.jsx)(`div`,{className:`${e===`forward`?`animate-slide-in-right`:`animate-slide-in-left`} w-full max-w-2xl mx-auto ${n?`my-auto`:``}`,children:r},t)}function fe({step:e,stepCount:t,stepName:n,canProceed:r,launching:i,onBack:a,onNext:o,onLaunch:s}){return e===0?null:(0,Y.jsxs)(`div`,{className:`relative z-10 p-4 pb-6 flex items-center max-w-2xl mx-auto w-full justify-between`,children:[(0,Y.jsxs)(`button`,{className:`btn btn-ghost gap-1`,onClick:a,disabled:i,children:[(0,Y.jsx)(ne,{className:`size-4`}),` Back`]}),e<t-1?(0,Y.jsxs)(`button`,{className:`btn btn-primary gap-1`,onClick:o,disabled:!r,children:[`Next `,(0,Y.jsx)(F,{className:`size-4`})]}):(0,Y.jsx)(`button`,{className:`btn btn-primary btn-lg gap-2 animate-pulse-soft`,onClick:s,disabled:i,children:i?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(x,{className:`size-5 animate-spin`}),` Launching...`]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(z,{className:`size-5`}),` Launch fifony`]})})]})}function pe({workspacePath:e,onGetStarted:t}){return(0,Y.jsxs)(`div`,{className:`flex flex-col items-center text-center gap-6 stagger-children py-4`,children:[(0,Y.jsx)(`div`,{className:`text-6xl sm:text-7xl animate-bounce-in`,children:(0,Y.jsx)(O,{className:`size-16 sm:size-20 text-primary mx-auto`})}),(0,Y.jsxs)(`h1`,{className:`text-3xl sm:text-4xl font-bold tracking-tight`,children:[`Welcome to `,(0,Y.jsx)(`span`,{className:`text-primary`,children:`fifony`})]}),(0,Y.jsx)(`p`,{className:`text-base-content/60 text-lg max-w-md`,children:`Let's set up your AI orchestration project in just a few steps.`}),e&&(0,Y.jsxs)(`div`,{className:`badge badge-lg badge-soft badge-primary gap-2`,children:[(0,Y.jsx)(w,{className:`size-3.5`}),`Project target: `,e]}),(0,Y.jsxs)(`button`,{className:`btn btn-primary btn-lg gap-2 mt-2`,onClick:t,children:[`Get Started `,(0,Y.jsx)(F,{className:`size-5`})]})]})}var X=new Set([`main`,`master`]);function Z(){let[e,t]=(0,V.useState)(null),[n,r]=(0,V.useState)(!1),[i,a]=(0,V.useState)(!1);return(0,V.useEffect)(()=>{g.get(`/gitignore/status`).then(t).catch(()=>t({exists:!1,hasFifony:!1}))},[]),e===null||e.hasFifony?null:i?(0,Y.jsxs)(`div`,{className:`alert alert-success py-2.5 text-sm animate-fade-in`,children:[(0,Y.jsx)(B,{className:`size-4 shrink-0`}),(0,Y.jsxs)(`span`,{children:[(0,Y.jsx)(`code`,{children:`.fifony/`}),` adicionado ao `,(0,Y.jsx)(`code`,{children:`.gitignore`})]})]}):(0,Y.jsxs)(`div`,{className:`alert alert-warning py-2.5 text-sm`,children:[(0,Y.jsx)(B,{className:`size-4 shrink-0`}),(0,Y.jsxs)(`div`,{className:`flex-1`,children:[(0,Y.jsxs)(`span`,{children:[(0,Y.jsx)(`code`,{children:`.fifony/`}),` não está no `,(0,Y.jsx)(`code`,{children:`.gitignore`})]}),(0,Y.jsx)(`span`,{className:`text-base-content/50 block text-xs mt-0.5`,children:`O fifony guarda estado local lá — não deve ser commitado.`})]}),(0,Y.jsx)(`button`,{className:`btn btn-xs btn-warning`,onClick:async()=>{r(!0);try{await g.post(`/gitignore/add`),a(!0)}catch{}finally{r(!1)}},disabled:n,children:n?(0,Y.jsx)(x,{className:`size-3 animate-spin`}):`Adicionar`})]})}function Q({currentBranch:e,onBranchCreated:t}){let[n,r]=(0,V.useState)(null),[i,a]=(0,V.useState)(!1),[o,s]=(0,V.useState)(null),[c,l]=(0,V.useState)(e);(0,V.useEffect)(()=>{g.get(`/git/status`).then(e=>{r(e),e.branch&&l(e.branch)}).catch(()=>r({isGit:!0,branch:e,hasCommits:!0}))},[]);let[u,d]=(0,V.useState)(`develop`),[f,p]=(0,V.useState)(!1),[m,h]=(0,V.useState)(null),[v,y]=(0,V.useState)(!1),b=n===null||n.isGit,S=X.has(c),C=/^[a-zA-Z0-9/_.-]+$/.test(u.trim())&&u.trim().length>0;async function w(){a(!0),s(null);try{let e=await g.post(`/git/init`,{});if(!e.ok)throw Error(e.error||`Failed to initialize git.`);r({isGit:!0,branch:e.branch,hasCommits:!0}),l(e.branch)}catch(e){s(e instanceof Error?e.message:String(e))}finally{a(!1)}}async function E(){if(!(!C||f)){p(!0),h(null);try{let e=await g.post(`/git/branch`,{branchName:u.trim()});if(!e.ok)throw Error(e.error||`Failed to create branch.`);y(!0),t?.(u.trim())}catch(e){h(e instanceof Error?e.message:String(e))}finally{p(!1)}}}return(0,Y.jsxs)(`div`,{className:`bg-base-200 rounded-2xl p-5 flex flex-col gap-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(j,{className:`size-4 text-primary`}),(0,Y.jsx)(`div`,{className:`text-sm font-semibold`,children:`Working branch`})]}),(0,Y.jsx)(`p`,{className:`text-xs text-base-content/50 -mt-2`,children:`Agents create worktrees based on the current branch. We recommend not working directly on main.`}),n!==null&&!n.isGit&&(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Y.jsxs)(`div`,{className:`alert alert-warning py-3`,children:[(0,Y.jsx)(_,{className:`size-4 shrink-0`}),(0,Y.jsxs)(`div`,{className:`text-sm`,children:[(0,Y.jsx)(`p`,{className:`font-semibold`,children:`Not a git repository`}),(0,Y.jsx)(`p`,{className:`opacity-80 mt-0.5`,children:`fifony requires git to create agent worktrees. Initialize one here.`})]})]}),o&&(0,Y.jsxs)(`p`,{className:`text-xs text-error flex items-center gap-1`,children:[(0,Y.jsx)(D,{className:`size-3`}),` `,o]}),(0,Y.jsxs)(`button`,{className:`btn btn-primary gap-2 self-start`,onClick:w,disabled:i,children:[i?(0,Y.jsx)(x,{className:`size-4 animate-spin`}):(0,Y.jsx)(_,{className:`size-4`}),`Initialize git repository`]})]}),b&&(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 rounded-box border border-base-300 bg-base-100`,children:[(0,Y.jsx)(j,{className:`size-4 opacity-50 shrink-0`}),(0,Y.jsx)(`span`,{className:`text-sm opacity-50`,children:`Current branch:`}),(0,Y.jsx)(`span`,{className:`font-mono text-sm font-semibold`,children:c||(n===null?`…`:`—`)}),S&&(0,Y.jsx)(`span`,{className:`badge badge-warning badge-sm ml-auto shrink-0`,children:`protected`})]}),S&&(0,Y.jsxs)(`div`,{className:`alert alert-warning py-3`,children:[(0,Y.jsx)(D,{className:`size-4 shrink-0`}),(0,Y.jsxs)(`div`,{className:`text-sm`,children:[(0,Y.jsxs)(`p`,{className:`font-semibold`,children:[`Working directly on `,(0,Y.jsx)(`span`,{className:`font-mono`,children:c})]}),(0,Y.jsx)(`p`,{className:`opacity-80 mt-0.5`,children:`In teams with protected branches, local merges are rejected. Create a working branch or use Push PR mode.`})]})]}),v?(0,Y.jsxs)(`div`,{className:`alert alert-success py-3 text-sm`,children:[(0,Y.jsx)(M,{className:`size-4 shrink-0`}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`p`,{className:`font-semibold`,children:`Branch created successfully`}),(0,Y.jsxs)(`p`,{className:`opacity-75 font-mono mt-0.5`,children:[`Now on `,(0,Y.jsx)(`span`,{className:`text-success-content`,children:u.trim()}),` — agents will use this as the base branch`]})]})]}):(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(`label`,{className:`text-sm font-medium`,children:`Create a new branch now`}),(0,Y.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Y.jsxs)(`label`,{className:`input input-bordered flex items-center gap-2 flex-1`,children:[(0,Y.jsx)(j,{className:`size-3.5 opacity-40`}),(0,Y.jsx)(`input`,{type:`text`,className:`grow font-mono text-sm`,value:u,onChange:e=>{d(e.target.value),h(null)},onKeyDown:e=>e.key===`Enter`&&E(),placeholder:`develop`,disabled:f})]}),(0,Y.jsx)(`button`,{className:`btn btn-primary`,onClick:E,disabled:!C||f,children:f?(0,Y.jsx)(T,{className:`size-4 animate-spin`}):`Create`})]}),m&&(0,Y.jsxs)(`p`,{className:`text-xs text-error flex items-center gap-1`,children:[(0,Y.jsx)(D,{className:`size-3`}),` `,m]}),(0,Y.jsxs)(`p`,{className:`text-xs opacity-40`,children:[`Equivalent to: `,(0,Y.jsxs)(`span`,{className:`font-mono`,children:[`git checkout -b `,u.trim()||`develop`]})]})]}),(0,Y.jsx)(Z,{})]})]})}function me({projectName:e,setProjectName:t,detectedProjectName:n,projectSource:r,workspacePath:i,currentBranch:o,onBranchCreated:s}){let c=S(e),l=a(c||n),u=c?r===`saved`||r===`detected`?r:`manual`:n?`detected`:`missing`;return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-6 py-4`,children:[(0,Y.jsxs)(`div`,{className:`text-center space-y-3`,children:[(0,Y.jsx)(`div`,{className:`inline-flex size-14 items-center justify-center rounded-full bg-primary/10 text-primary mx-auto`,children:(0,Y.jsx)(L,{className:`size-7`})}),(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[(0,Y.jsx)(`h2`,{className:`text-2xl font-bold tracking-tight`,children:`Set up your workspace`}),(0,Y.jsx)(`p`,{className:`text-base-content/60 max-w-xl mx-auto text-sm`,children:`Name your project and configure the working branch`})]})]}),(0,Y.jsxs)(`div`,{className:`bg-base-200 rounded-2xl p-5 flex flex-col gap-4`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`div`,{className:`text-sm font-semibold`,children:`Project name`}),(0,Y.jsx)(`div`,{className:`text-xs text-base-content/50`,children:`This becomes the default queue title for future runs.`})]}),u===`saved`&&(0,Y.jsxs)(`span`,{className:`badge badge-primary badge-soft gap-1.5`,children:[(0,Y.jsx)(w,{className:`size-3`}),`Saved configuration`]}),u===`detected`&&(0,Y.jsxs)(`span`,{className:`badge badge-secondary badge-soft gap-1.5`,children:[(0,Y.jsx)(w,{className:`size-3`}),`Detected automatically`]}),u===`manual`&&(0,Y.jsxs)(`span`,{className:`badge badge-accent badge-soft gap-1.5`,children:[(0,Y.jsx)(R,{className:`size-3`}),`Edited manually`]}),u===`missing`&&(0,Y.jsxs)(`span`,{className:`badge badge-warning badge-soft gap-1.5`,children:[(0,Y.jsx)(D,{className:`size-3`}),`Manual entry required`]})]}),(0,Y.jsxs)(`label`,{className:`form-control w-full gap-2`,children:[(0,Y.jsx)(`span`,{className:`label-text text-sm font-medium`,children:`Project`}),(0,Y.jsx)(`input`,{type:`text`,className:`input input-bordered w-full text-base`,placeholder:n||`Enter your project name`,value:e,onChange:e=>t(e.target.value),onBlur:n=>{let r=S(n.target.value);r!==e&&t(r)}})]}),i&&(0,Y.jsxs)(`div`,{className:`text-xs text-base-content/50 break-all`,children:[`Workspace: `,i]}),!n&&!c&&(0,Y.jsxs)(`div`,{className:`alert alert-warning text-sm`,children:[(0,Y.jsx)(D,{className:`size-4 shrink-0`}),(0,Y.jsx)(`span`,{children:`We could not detect a project name from the current directory. Enter one to continue.`})]}),(0,Y.jsxs)(`div`,{className:`rounded-xl border border-base-300/70 bg-base-100 px-4 py-3`,children:[(0,Y.jsx)(`div`,{className:`text-xs uppercase tracking-[0.2em] text-base-content/40`,children:`Queue title preview`}),(0,Y.jsx)(`div`,{className:`mt-1.5 text-base font-semibold tracking-tight break-words`,children:l})]})]}),(0,Y.jsx)(Q,{currentBranch:o,onBranchCreated:s})]})}var he={planner:`plan`,executor:`execute`,reviewer:`review`};function ge({options:e,value:t,onChange:n}){return(0,Y.jsx)(`div`,{className:`flex gap-1 flex-wrap`,children:e.map(e=>{let r=e.value===t,i=e.icon;return(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>n(e.value),className:`flex items-center gap-1 px-2.5 py-1 rounded-full text-[11px] font-medium border transition-all ${r?`${e.color} border-current bg-base-300`:`text-base-content/35 border-base-content/10 hover:border-base-content/30 hover:text-base-content/60`}`,children:[(0,Y.jsx)(i,{className:`size-2.5`}),e.label]},e.value)})})}function _e({providers:e,providersLoading:t,pipeline:n,setPipeline:r,efforts:i,setEfforts:a,models:c,setModels:l,modelsByProvider:u}){let d=Array.isArray(e)?e:[],f=d.filter(e=>e.available!==!1);return(0,V.useEffect)(()=>{for(let e of[`planner`,`executor`,`reviewer`]){let t=G(e,n),r=i[e];r&&!t.some(e=>e.value===r)&&a(t=>({...t,[e]:`high`}))}},[n,i,a]),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-5 w-full max-w-lg`,children:[(0,Y.jsxs)(`div`,{className:`text-center`,children:[(0,Y.jsx)(z,{className:`size-9 text-primary mx-auto mb-2`}),(0,Y.jsx)(`h2`,{className:`text-2xl font-bold`,children:`Agent Pipeline`}),(0,Y.jsx)(`p`,{className:`text-sm text-base-content/50 mt-1`,children:`Configure which CLI and reasoning depth runs each stage`})]}),t?(0,Y.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-10`,children:[(0,Y.jsx)(x,{className:`size-7 text-primary animate-spin`}),(0,Y.jsx)(`p`,{className:`text-sm text-base-content/50`,children:`Detecting available CLIs…`})]}):f.length===0?(0,Y.jsx)(`div`,{className:`alert alert-warning text-sm`,children:`No providers detected. Install claude, codex, or gemini CLI first.`}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`flex flex-wrap gap-2 justify-center`,children:d.map(e=>{let t=e.id||e.name||e,n=e.available!==!1;return(0,Y.jsxs)(`span`,{className:`badge gap-1.5 badge-sm ${n?`badge-success`:`badge-ghost opacity-40`}`,children:[n?(0,Y.jsx)(o,{className:`size-3`}):(0,Y.jsx)(m,{className:`size-3`}),(0,Y.jsx)(`span`,{className:`font-mono`,children:t}),e.path&&(0,Y.jsx)(`span`,{className:`opacity-50 text-[9px] hidden sm:inline`,children:e.path})]},t)})}),(0,Y.jsx)(`div`,{className:`flex flex-col`,children:se.map((e,t)=>{let o=e.icon,d=n[e.role]||f[0]?.id||f[0]?.name||``,p=he[e.role],m=c?.[p]||``,h=u?.[d]||[],g=G(e.role,n),_=i?.[e.role]||`high`;return(0,Y.jsxs)(`div`,{children:[t>0&&(0,Y.jsx)(`div`,{className:`flex justify-center py-1.5 text-base-content/20`,children:(0,Y.jsx)(s,{className:`size-4`})}),(0,Y.jsx)(`div`,{className:`bg-base-200 rounded-xl p-4`,children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsx)(`div`,{className:`size-8 rounded-lg flex items-center justify-center bg-base-300 shrink-0 ${e.color}`,children:(0,Y.jsx)(o,{className:`size-4`})}),(0,Y.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,Y.jsx)(`span`,{className:`font-semibold text-sm`,children:e.label}),(0,Y.jsx)(`p`,{className:`text-[11px] text-base-content/40 leading-tight mt-0.5 truncate`,children:e.description})]}),(0,Y.jsx)(`select`,{className:`select select-sm select-bordered w-28 shrink-0`,value:d,onChange:t=>{let n=t.target.value;r(t=>({...t,[e.role]:n}));let i=u?.[n]?.[0]?.id||``;l(e=>({...e,[p]:i}))},children:f.map(e=>{let t=e.id||e.name||e;return(0,Y.jsx)(`option`,{value:t,children:t},t)})})]}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-[10px] text-base-content/40 shrink-0 w-10`,children:`Effort`}),(0,Y.jsx)(ge,{options:g,value:_,onChange:t=>a(n=>({...n,[e.role]:t}))})]}),h.length>0&&(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-[10px] text-base-content/40 shrink-0 w-10`,children:`Model`}),(0,Y.jsx)(`select`,{className:`select select-xs select-bordered flex-1`,value:m,onChange:e=>l(t=>({...t,[p]:e.target.value})),children:h.map(e=>(0,Y.jsx)(`option`,{value:e.id,children:e.label||e.id},e.id))})]})]})})]},e.role)})}),(0,Y.jsx)(`p`,{className:`text-[11px] text-base-content/35 text-center`,children:`Pipeline runs top to bottom: plan → execute → review`})]})]})}function ve({selectedAgents:e,setSelectedAgents:t,existingAgents:n}){let[r,i]=(0,V.useState)([]),[a,o]=(0,V.useState)(!1),s=(0,V.useRef)(!1),[l,u]=(0,V.useState)([]),[d,f]=(0,V.useState)(!1),[p,m]=(0,V.useState)(``),[_,v]=(0,V.useState)(()=>new Set),[b,S]=(0,V.useState)({}),C=(0,V.useRef)(!1),[w,T]=(0,V.useState)(``),E=(0,V.useCallback)(()=>g.get(`/catalog/agents`).catch(()=>({agents:[]})).then(e=>{let t=e?.agents||[];return i(t),t}),[]);(0,V.useEffect)(()=>{s.current||(s.current=!0,o(!0),E().then(r=>{let i=new Set((n||[]).map(e=>e.name)),a=r.filter(e=>!i.has(e.name)).map(e=>e.name);a.length>0&&e.length===0&&t(a)}).finally(()=>o(!1)))},[]);let D=(0,V.useCallback)(()=>(m(``),f(!0),g.get(`/reference-repositories`).then(e=>{u(e?.repositories||[])}).catch(e=>{let t=e?.message||`Failed to load reference repositories.`;t.toLowerCase().includes(`route not found`)?m(`Backend route not loaded. Start Fifony with --dev (or run pnpm build:server) and retry.`):m(t)}).finally(()=>f(!1))),[]);(0,V.useEffect)(()=>{C.current||(C.current=!0,D())},[D]);let O=(0,V.useMemo)(()=>new Set((n||[]).map(e=>e.name)),[n]),k=(0,V.useMemo)(()=>{let e=w.trim().toLowerCase();return e?r.filter(t=>[t?.name,t?.displayName,t?.description].filter(Boolean).join(` `).toLowerCase().includes(e)):r},[w,r]),ee=(0,V.useCallback)(e=>{t(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[t]),j=(0,V.useCallback)(()=>{t(r.filter(e=>!O.has(e.name)).map(e=>e.name))},[r,O,t]),M=(0,V.useCallback)(()=>t([]),[t]),N=(0,V.useCallback)(async e=>{v(t=>new Set([...t,e])),S(t=>({...t,[e]:``}));try{let t=((await g.post(`/reference-repositories/sync`,{repository:e}))?.results||[]).find(t=>t.id===e);if(t?.action===`failed`){S(n=>({...n,[e]:t.message||`Sync failed.`}));return}await g.post(`/reference-repositories/import`,{repository:e,kind:`agents`,global:!1}),await Promise.all([D(),E()]),S(t=>({...t,[e]:`Synced & imported.`}))}catch(t){S(n=>({...n,[e]:t?.message||`Failed.`}))}finally{v(t=>{let n=new Set(t);return n.delete(e),n})}},[D,E]);return a?(0,Y.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-12`,children:[(0,Y.jsx)(x,{className:`size-8 text-primary animate-spin`}),(0,Y.jsx)(`p`,{className:`text-sm text-base-content/50`,children:`Loading catalog...`})]}):(0,Y.jsxs)(`div`,{className:`flex flex-col gap-6 stagger-children`,children:[(0,Y.jsxs)(`div`,{className:`text-center`,children:[(0,Y.jsx)(c,{className:`size-10 text-primary mx-auto mb-3`}),(0,Y.jsx)(`h2`,{className:`text-2xl font-bold`,children:`Agents`}),(0,Y.jsx)(`p`,{className:`text-base-content/60 mt-1`,children:`Choose which agents to install`})]}),(0,Y.jsx)(`div`,{className:`card bg-base-200`,children:(0,Y.jsxs)(`div`,{className:`card-body gap-3 p-4`,children:[(0,Y.jsx)(`h3`,{className:`font-semibold text-sm`,children:`Sources`}),p&&(0,Y.jsx)(`div`,{className:`alert alert-warning text-xs`,children:p}),d?(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-base-content/60`,children:[(0,Y.jsx)(x,{className:`size-3 animate-spin`}),` Loading...`]}):(0,Y.jsx)(`div`,{className:`grid grid-cols-2 xl:grid-cols-4 gap-2`,children:l.map(e=>{let t=_.has(e.id),n=e?.artifactCounts??null,r=e?.present&&e?.synced;return(0,Y.jsxs)(`div`,{className:`rounded-lg border border-base-300/70 bg-base-100 p-2 flex flex-col gap-1.5`,children:[(0,Y.jsx)(`div`,{className:`font-medium text-xs truncate`,children:e.name}),r&&n?(0,Y.jsxs)(`div`,{className:`text-[11px] text-base-content/60`,children:[n.agents,` agents`]}):(0,Y.jsx)(`span`,{className:`badge badge-xs badge-warning`,children:`Not synced`}),b[e.id]&&(0,Y.jsx)(`p`,{className:`text-[11px] text-base-content/60 truncate`,children:b[e.id]}),(0,Y.jsxs)(`button`,{className:`btn btn-xs btn-outline gap-1 mt-auto`,onClick:()=>N(e.id),disabled:t,children:[t?(0,Y.jsx)(x,{className:`size-3 animate-spin`}):(0,Y.jsx)(y,{className:`size-3`}),t?`Syncing…`:r?`Re-sync`:`Sync`]})]},e.id)})})]})}),(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Y.jsxs)(`h3`,{className:`font-semibold text-sm flex items-center gap-2`,children:[(0,Y.jsx)(c,{className:`size-4 opacity-50`}),`Agents (`,r.length,`)`]}),(0,Y.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Y.jsx)(`button`,{className:`btn btn-xs btn-ghost`,onClick:j,children:`Select All`}),(0,Y.jsx)(`button`,{className:`btn btn-xs btn-ghost`,onClick:M,children:`None`})]})]}),(0,Y.jsxs)(`label`,{className:`input input-bordered input-sm flex items-center gap-2`,children:[(0,Y.jsx)(A,{className:`size-4 opacity-60`}),(0,Y.jsx)(`input`,{type:`text`,className:`grow`,placeholder:`Search agents...`,value:w,onChange:e=>T(e.target.value)})]}),k.length===0&&r.length>0&&(0,Y.jsx)(`div`,{className:`text-sm text-base-content/60`,children:`No agents match your search.`}),(0,Y.jsx)(`div`,{className:`space-y-1 pt-1`,children:k.map(t=>{let n=O.has(t.name),r=n||e.includes(t.name);return(0,Y.jsx)(`button`,{className:`w-full rounded-md border border-transparent px-2 py-2 text-left transition-all ${n?`opacity-70 bg-base-100/40`:`hover:bg-base-100`} ${r&&!n?`ring-1 ring-primary ring-offset-1 ring-offset-base-200`:``}`,onClick:()=>!n&&ee(t.name),disabled:n,children:(0,Y.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Y.jsx)(`span`,{className:`mt-0.5 text-base`,children:t.emoji||`🤖`}),(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`font-medium text-sm truncate`,children:t.displayName||t.name}),t.source&&(0,Y.jsx)(`span`,{className:`badge badge-xs badge-ghost shrink-0`,children:t.source}),n?(0,Y.jsxs)(`span`,{className:`badge badge-xs badge-success gap-1 shrink-0`,children:[(0,Y.jsx)(h,{className:`size-3`}),` Installed`]}):(0,Y.jsx)(`input`,{type:`checkbox`,className:`checkbox checkbox-primary checkbox-sm self-start mt-0.5 shrink-0`,checked:r,readOnly:!0,tabIndex:-1})]}),t.description&&(0,Y.jsx)(`p`,{className:`text-xs text-base-content/60 mt-1 truncate`,children:t.description})]})]})},t.name)})})]}),r.length===0&&(0,Y.jsx)(`div`,{className:`alert alert-info text-sm`,children:`No agents found in the catalog. Sync a source above or add them later from the settings page.`})]})}var ye={auto:{bg:null,label:`Auto`},light:{bg:`#ffffff`,accent:`#7c3aed`},dark:{bg:`#1d232a`,accent:`#661ae6`},black:{bg:`#000000`,accent:`#ffffff`},cupcake:{bg:`#faf7f5`,accent:`#ef9fbc`},night:{bg:`#0f172a`,accent:`#38bdf8`},sunset:{bg:`#1a1019`,accent:`#ff865b`}};function be({theme:e,selected:t,onClick:n}){let r=ye[e.value];return(0,Y.jsxs)(`button`,{onClick:n,title:e.label,className:`flex flex-col items-center gap-1.5 group focus:outline-none`,children:[(0,Y.jsx)(`div`,{className:`w-10 h-10 rounded-xl border-2 transition-all overflow-hidden flex-shrink-0 ${t?`border-primary ring-2 ring-primary ring-offset-2 ring-offset-base-200 scale-110`:`border-base-300 group-hover:border-base-content/30 group-hover:scale-105`}`,style:r.bg?{background:r.bg}:void 0,children:r.bg?(0,Y.jsxs)(`div`,{className:`w-full h-full flex flex-col`,children:[(0,Y.jsx)(`div`,{className:`flex-1`,style:{background:r.bg}}),(0,Y.jsx)(`div`,{className:`h-3 w-full`,style:{background:r.accent}})]}):(0,Y.jsxs)(`div`,{className:`w-full h-full flex`,children:[(0,Y.jsx)(`div`,{className:`flex-1 bg-white`}),(0,Y.jsx)(`div`,{className:`flex-1 bg-neutral`})]})}),(0,Y.jsx)(`span`,{className:`text-xs font-medium transition-colors ${t?`text-primary`:`text-base-content/50 group-hover:text-base-content/80`}`,children:e.label})]})}function xe({concurrency:e,setConcurrency:t,selectedTheme:n,setSelectedTheme:r}){return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-6 stagger-children`,children:[(0,Y.jsxs)(`div`,{className:`text-center`,children:[(0,Y.jsx)(v,{className:`size-10 text-primary mx-auto mb-3`}),(0,Y.jsx)(`h2`,{className:`text-2xl font-bold`,children:`Workers & Theme`}),(0,Y.jsx)(`p`,{className:`text-base-content/60 mt-1 text-sm`,children:`Configure parallel workers and visual theme`})]}),(0,Y.jsx)(`div`,{className:`card bg-base-200`,children:(0,Y.jsxs)(`div`,{className:`card-body p-5 gap-3`,children:[(0,Y.jsxs)(`h3`,{className:`font-semibold text-sm flex items-center gap-2`,children:[(0,Y.jsx)(v,{className:`size-4 opacity-50`}),`Worker Concurrency`]}),(0,Y.jsxs)(`p`,{className:`text-xs text-base-content/60`,children:[`How many agents can work in parallel (`,e,` worker`,e===1?``:`s`,`)`]}),(0,Y.jsx)(`input`,{type:`range`,min:1,max:16,value:e,onChange:e=>t(Number(e.target.value)),className:`range range-primary range-sm`}),(0,Y.jsxs)(`div`,{className:`flex justify-between text-xs text-base-content/40 px-1`,children:[(0,Y.jsx)(`span`,{children:`1`}),(0,Y.jsx)(`span`,{children:`4`}),(0,Y.jsx)(`span`,{children:`8`}),(0,Y.jsx)(`span`,{children:`12`}),(0,Y.jsx)(`span`,{children:`16`})]}),(0,Y.jsxs)(`p`,{className:`text-xs text-base-content/50 bg-base-100 rounded-lg px-3 py-2 mt-1`,children:[(0,Y.jsx)(`span`,{className:`font-medium text-base-content/70`,children:`Tip:`}),` 2–4 workers is recommended for most projects. More workers consume more API quota and may hit rate limits.`]})]})}),(0,Y.jsx)(`div`,{className:`card bg-base-200`,children:(0,Y.jsxs)(`div`,{className:`card-body p-5 gap-4`,children:[(0,Y.jsxs)(`h3`,{className:`font-semibold text-sm flex items-center gap-2`,children:[(0,Y.jsx)(b,{className:`size-4 opacity-50`}),`Theme`]}),(0,Y.jsx)(`div`,{className:`flex flex-wrap gap-5 justify-center py-1`,children:K.map(e=>(0,Y.jsx)(be,{theme:e,selected:n===e.value,onClick:()=>r(e.value)},e.value))})]})})]})}function Se({config:e,launching:t}){return(0,Y.jsxs)(`div`,{className:`flex flex-col items-center text-center gap-6 stagger-children py-4`,children:[(0,Y.jsx)(`div`,{className:`animate-bounce-in`,children:(0,Y.jsx)(z,{className:`size-16 sm:size-20 text-primary mx-auto`})}),(0,Y.jsx)(`h2`,{className:`text-2xl sm:text-3xl font-bold`,children:`You're All Set!`}),(0,Y.jsx)(`p`,{className:`text-base-content/60 max-w-md`,children:`Here's a summary of your configuration. Hit launch when you're ready.`}),(0,Y.jsx)(`div`,{className:`card bg-base-200 w-full max-w-sm`,children:(0,Y.jsxs)(`div`,{className:`card-body p-4 gap-2 text-sm text-left`,children:[(0,Y.jsxs)(`div`,{className:`flex justify-between gap-4`,children:[(0,Y.jsx)(`span`,{className:`text-base-content/60`,children:`Queue title`}),(0,Y.jsx)(`span`,{className:`font-semibold text-right break-words`,children:e.queueTitle||`fifony`})]}),(0,Y.jsx)(`div`,{className:`divider my-0`}),(0,Y.jsxs)(`div`,{className:`flex justify-between`,children:[(0,Y.jsx)(`span`,{className:`text-base-content/60`,children:`Pipeline`}),(0,Y.jsxs)(`span`,{className:`font-semibold capitalize text-xs font-mono`,children:[e.pipeline?.planner||`?`,` → `,e.pipeline?.executor||`?`,` → `,e.pipeline?.reviewer||`?`]})]}),(0,Y.jsx)(`div`,{className:`divider my-0`}),(0,Y.jsxs)(`div`,{className:`flex justify-between`,children:[(0,Y.jsx)(`span`,{className:`text-base-content/60`,children:`Domains`}),(0,Y.jsx)(`span`,{className:`font-semibold`,children:e.domains?.length>0?e.domains.length+` selected`:`none`})]}),(0,Y.jsx)(`div`,{className:`divider my-0`}),(0,Y.jsxs)(`div`,{className:`flex justify-between`,children:[(0,Y.jsx)(`span`,{className:`text-base-content/60`,children:`Agents`}),(0,Y.jsxs)(`span`,{className:`font-semibold`,children:[e.agents?.length||0,` to install`]})]}),(0,Y.jsx)(`div`,{className:`divider my-0`}),(0,Y.jsxs)(`div`,{className:`flex justify-between`,children:[(0,Y.jsx)(`span`,{className:`text-base-content/60`,children:`Skills`}),(0,Y.jsxs)(`span`,{className:`font-semibold`,children:[e.skills?.length||0,` to install`]})]}),(0,Y.jsx)(`div`,{className:`divider my-0`}),(0,Y.jsxs)(`div`,{className:`flex justify-between`,children:[(0,Y.jsx)(`span`,{className:`text-base-content/60`,children:`Plan`}),(0,Y.jsx)(`span`,{className:`font-semibold capitalize`,children:e.efforts.planner})]}),(0,Y.jsx)(`div`,{className:`divider my-0`}),(0,Y.jsxs)(`div`,{className:`flex justify-between`,children:[(0,Y.jsx)(`span`,{className:`text-base-content/60`,children:`Execute`}),(0,Y.jsx)(`span`,{className:`font-semibold capitalize`,children:e.efforts.executor})]}),(0,Y.jsx)(`div`,{className:`divider my-0`}),(0,Y.jsxs)(`div`,{className:`flex justify-between`,children:[(0,Y.jsx)(`span`,{className:`text-base-content/60`,children:`Review`}),(0,Y.jsx)(`span`,{className:`font-semibold capitalize`,children:e.efforts.reviewer})]}),(0,Y.jsx)(`div`,{className:`divider my-0`}),(0,Y.jsxs)(`div`,{className:`flex justify-between`,children:[(0,Y.jsx)(`span`,{className:`text-base-content/60`,children:`Workers`}),(0,Y.jsx)(`span`,{className:`font-semibold`,children:e.concurrency})]}),(0,Y.jsx)(`div`,{className:`divider my-0`}),(0,Y.jsxs)(`div`,{className:`flex justify-between`,children:[(0,Y.jsx)(`span`,{className:`text-base-content/60`,children:`Theme`}),(0,Y.jsx)(`span`,{className:`font-semibold capitalize`,children:e.theme})]})]})}),t&&(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-base-content/50`,children:[(0,Y.jsx)(x,{className:`size-4 animate-spin`}),`Saving configuration & installing agents...`]})]})}function $({onComplete:e}){let t=r(),n=te(),i=l(n.data),[o,s]=(0,V.useState)(0),[c,m]=(0,V.useState)(`forward`),[h,_]=(0,V.useState)(!1),[v,y]=(0,V.useState)(null),b=(0,V.useRef)(!1),x=(0,V.useRef)(!1),[w,T]=(0,V.useState)({planner:``,executor:``,reviewer:``}),[D,O]=(0,V.useState)(()=>ce(null)),[k,A]=(0,V.useState)(3),[j,M]=(0,V.useState)(`auto`),[N,P]=(0,V.useState)(``),[ne,F]=(0,V.useState)(`missing`),[I,L]=(0,V.useState)(null),[R,z]=(0,V.useState)([]),[B,re]=(0,V.useState)([]),H=ae(),U=ie()[o]||``,[W,oe]=(0,V.useState)(null),[G,K]=(0,V.useState)(!1),[se,J]=(0,V.useState)({}),[X,Z]=(0,V.useState)({plan:``,execute:``,review:``}),[Q,he]=(0,V.useState)(``),[ge,ye]=(0,V.useState)(``);(0,V.useEffect)(()=>{g.get(`/state`).then(e=>{L(e||{}),he(e?.sourceRepoUrl||e?.config?.sourceRepo||``),ye(e?.config?.defaultBranch||``)}).catch(()=>{L({})})},[]),(0,V.useEffect)(()=>{if(b.current||n.isLoading)return;b.current=!0;let e=p(i,`runtime.pipeline`,null),t=p(i,`runtime.workflowConfig`,null),r=p(i,`runtime.defaultEffort`,null),a=p(i,`ui.theme`,`auto`),o=p(i,`runtime.workerConcurrency`,3);if(Array.isArray(e)&&e.length>0){let t=Object.fromEntries(e.map(e=>[e.role,e.provider]));T({planner:t.planner||``,executor:t.executor||``,reviewer:t.reviewer||``})}t&&typeof t==`object`&&Z({plan:t.plan?.model||``,execute:t.execute?.model||``,review:t.review?.model||``}),O(ce(r)),typeof a==`string`&&a.trim()&&M(a);let s=Number.parseInt(String(o??2),10);Number.isFinite(s)&&A(Math.min(16,Math.max(1,s)))},[i,n.isLoading]),(0,V.useEffect)(()=>{if(x.current||n.isLoading||I===null)return;x.current=!0;let e=d(i,I);P(e.projectName),F(e.source)},[I,i,n.isLoading]);let be=(0,V.useCallback)(e=>{P(e),F(`manual`)},[]),$=S(N),Ce=a($);(0,V.useEffect)(()=>{document.title=a($||I?.detectedProjectName||I?.projectName||``)},[$,I]),(0,V.useEffect)(()=>{o>=1&&W===null&&(K(!0),Promise.all([g.get(`/providers`),g.get(`/config/workflow?details=1`).catch(()=>null)]).then(([e,t])=>{let n=Array.isArray(e)?e:e?.providers||[];oe(n);let r=t?.models||{};J(r);let i=n.filter(e=>e.available!==!1),a=i[0]?.id||i[0]?.name||``,o=i.find(e=>(e.id||e.name)===`claude`),s=a,c=o?`claude`:s,l={planner:c,executor:s,reviewer:c};T(e=>({planner:e.planner||l.planner,executor:e.executor||l.executor,reviewer:e.reviewer||l.reviewer})),Z(e=>({plan:e.plan||r[c]?.[0]?.id||``,execute:e.execute||r[s]?.[0]?.id||``,review:e.review||r[c]?.[0]?.id||``}))}).catch(()=>{oe([])}).finally(()=>{K(!1)}))},[o,W]),(0,V.useEffect)(()=>{let e=j===`auto`?window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:j;document.documentElement.setAttribute(`data-theme`,e)},[j]);let we=(0,V.useCallback)(e=>{if(e===`Setup`)$&&q(C,$,`system`).catch(()=>{});else if(e===`Pipeline`){let e=[{provider:w.planner,role:`planner`},{provider:w.executor,role:`executor`},{provider:w.reviewer,role:`reviewer`}];q(`runtime.agentProvider`,w.executor,`runtime`).catch(()=>{}),q(`runtime.pipeline`,e,`runtime`).catch(()=>{}),q(`runtime.defaultEffort`,D,`runtime`).catch(()=>{}),q(`runtime.workflowConfig`,le(w,D,X),`runtime`).catch(()=>{})}else e===`Preferences`&&(q(`ui.theme`,j,`ui`).catch(()=>{}),g.post(`/config/concurrency`,{concurrency:k}).catch(()=>{}))},[w,D,X,k,j,$]),Te=(0,V.useCallback)(()=>{o<H-1&&(we(U),m(`forward`),s(e=>e+1))},[o,H,U,we]),Ee=(0,V.useCallback)(()=>{o>0&&(m(`backward`),s(e=>e-1))},[o]),De=(0,V.useCallback)(async()=>{if($){_(!0);try{let n=[q(C,$,`system`),q(`ui.theme`,j,`ui`),q(`ui.onboarding.completed`,!0,`ui`)],r=[{provider:w.planner,role:`planner`},{provider:w.executor,role:`executor`},{provider:w.reviewer,role:`reviewer`}];n.push(q(`runtime.agentProvider`,w.executor,`runtime`)),n.push(q(`runtime.pipeline`,r,`runtime`)),n.push(q(`runtime.defaultEffort`,D,`runtime`)),n.push(q(`runtime.workflowConfig`,le(w,D,X),`runtime`)),n.push(g.post(`/config/concurrency`,{concurrency:k})),R.length>0&&n.push(g.post(`/install/agents`,{agents:R})),B.length>0&&n.push(g.post(`/install/skills`,{skills:B})),await Promise.allSettled(n),t.setQueryData(f,e=>u(e,{id:C,scope:`system`,value:$,source:`user`,updatedAt:new Date().toISOString()})),t.setQueryData(f,e=>u(e,{id:`ui.onboarding.completed`,scope:`ui`,value:!0,source:`user`,updatedAt:new Date().toISOString()})),y({x:window.innerWidth/2,y:window.innerHeight/3}),setTimeout(()=>{t.invalidateQueries({queryKey:f}),e?.()},1200)}catch{t.setQueryData(f,e=>u(e,{id:C,scope:`system`,value:$,source:`user`,updatedAt:new Date().toISOString()})),t.setQueryData(f,e=>u(e,{id:`ui.onboarding.completed`,scope:`ui`,value:!0,source:`user`,updatedAt:new Date().toISOString()})),await q(`ui.onboarding.completed`,!0,`ui`).catch(()=>{}),t.invalidateQueries({queryKey:f}),e?.()}}},[$,w,D,X,k,j,R,B,t,e]),Oe=U===`Welcome`||U===`Setup`&&!!$||U===`Pipeline`&&(w.executor||G)||U===`Agents & Skills`||U===`Preferences`||U===`Launch`,ke=[],Ae=[],je={projectName:$,queueTitle:Ce,pipeline:w,efforts:D,concurrency:k,theme:j,agents:R,skills:B};return(0,Y.jsxs)(`div`,{className:`fixed inset-0 z-50 bg-base-100 flex flex-col overflow-hidden`,children:[o===0&&(0,Y.jsx)(ee,{}),v&&(0,Y.jsx)(E,{x:v.x,y:v.y,active:!0,onDone:()=>y(null)}),o>0&&(0,Y.jsx)(`div`,{className:`relative z-10 pt-6 pb-2 px-4 flex justify-center`,children:(0,Y.jsx)(ue,{current:o})}),(0,Y.jsx)(`div`,{className:`relative z-10 flex-1 flex flex-col items-center justify-start px-4 py-6 overflow-y-auto`,children:(0,Y.jsxs)(de,{direction:c,stepKey:o,center:U===`Welcome`||U===`Setup`||U===`Pipeline`||U===`Launch`,children:[U===`Welcome`&&(0,Y.jsx)(pe,{workspacePath:Q,onGetStarted:Te}),U===`Setup`&&(0,Y.jsx)(me,{projectName:N,setProjectName:be,detectedProjectName:I?.detectedProjectName||``,projectSource:ne,workspacePath:Q,currentBranch:ge,onBranchCreated:e=>ye(e)}),U===`Pipeline`&&(0,Y.jsx)(_e,{providers:W||[],providersLoading:G,pipeline:w,setPipeline:T,efforts:D,setEfforts:O,models:X,setModels:Z,modelsByProvider:se}),U===`Agents & Skills`&&(0,Y.jsx)(ve,{selectedAgents:R,setSelectedAgents:z,selectedSkills:B,setSelectedSkills:re,existingAgents:ke,existingSkills:Ae}),U===`Preferences`&&(0,Y.jsx)(xe,{concurrency:k,setConcurrency:A,selectedTheme:j,setSelectedTheme:M}),U===`Launch`&&(0,Y.jsx)(Se,{config:je,launching:h})]})}),(0,Y.jsx)(fe,{step:o,stepCount:H,stepName:U,canProceed:Oe,launching:h,onBack:Ee,onNext:Te,onLaunch:De})]})}export{$ as default};
|
|
@@ -0,0 +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{t as i}from"./createLucideIcon-BWC-guQt.js";import{B as a,H as o,L as s,O as c,R as l,_ as u,b as d,c as f,g as p,r as m,s as h,x as g}from"./index-O_FDwkw6.js";var _=i(`git-pull-request-arrow`,[[`circle`,{cx:`5`,cy:`6`,r:`3`,key:`1qnov2`}],[`path`,{d:`M5 9v12`,key:`ih889a`}],[`circle`,{cx:`19`,cy:`18`,r:`3`,key:`1qljk2`}],[`path`,{d:`m15 9-3-3 3-3`,key:`1lwv8l`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v7`,key:`1yj91y`}]]),v=e(t(),1),y=r();function b(e){return!e||e===0?`0`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function x(e){return!e||e===0?`0`:e.toLocaleString()}function S({value:e,format:t=b,className:n=``}){let[r,i]=(0,v.useState)(()=>t(e)),a=(0,v.useRef)(e),o=(0,v.useRef)(null);return(0,v.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,y.jsx)(`span`,{className:`${n} inline-block tabular-nums`,children:r})}var C=[{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 w({byPhase:e}){if(!e)return null;let t=C.reduce((t,n)=>t+(e[n.key]?.totalTokens||0),0);return t===0?null:(0,y.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,y.jsx)(`div`,{className:`flex h-4 rounded-full overflow-hidden bg-base-300 w-full`,children:C.map(n=>{let r=e[n.key]?.totalTokens||0,i=r/t*100;return i===0?null:(0,y.jsx)(`div`,{className:`${n.color} opacity-80 transition-all duration-500`,style:{width:`${i}%`},title:`${n.label}: ${x(r)} (${Math.round(i)}%)`},n.key)})}),(0,y.jsx)(`div`,{className:`flex items-center gap-4 flex-wrap`,children:C.map(n=>{let r=e[n.key]?.totalTokens||0,i=t>0?Math.round(r/t*100):0;return r===0?null:(0,y.jsxs)(`span`,{className:`flex items-center gap-1.5 text-sm`,children:[(0,y.jsx)(`span`,{className:`inline-block w-3 h-3 rounded-full ${n.color} shrink-0`}),(0,y.jsx)(`span`,{className:`opacity-60`,children:n.label}),(0,y.jsx)(`span`,{className:`font-mono font-semibold`,children:b(r)}),(0,y.jsxs)(`span`,{className:`opacity-40`,children:[`(`,i,`%)`]})]},n.key)})})]})}function T({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,y.jsxs)(`div`,{className:`relative`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs opacity-50 mb-2`,children:[(0,y.jsx)(`span`,{className:`inline-block w-2.5 h-2.5 rounded-sm ${n}`}),r]}),f&&(0,y.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,y.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,y.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,y.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs`,children:[(0,y.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-sm ${n} shrink-0`}),(0,y.jsx)(`span`,{className:`font-mono font-semibold`,children:c?c(f[t]||0):(f[t]||0).toLocaleString()})]})]})}),(0,y.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,y.jsxs)(`div`,{className:`flex-1 relative cursor-default`,onMouseEnter:()=>s?.(r),onMouseLeave:()=>s?.(null),children:[c>0&&(0,y.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,y.jsx)(`div`,{className:`absolute inset-0 bg-base-content/5 rounded-sm`})]},e.date)})}),a&&(0,y.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,y.jsx)(`div`,{className:`flex-1 overflow-hidden`,children:i&&(0,y.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 E({daily:e}){let[t,n]=(0,v.useState)(null),r=e||[];return(0,y.jsxs)(`div`,{className:`space-y-4`,children:[(0,y.jsx)(T,{data:r,valueKey:`totalTokens`,barClass:`bg-primary`,label:`Tokens / day`,height:64,showXAxis:!1,hoveredIdx:t,onHover:n,formatTooltip:e=>e.toLocaleString()}),(0,y.jsx)(T,{data:r,valueKey:`events`,barClass:`bg-secondary`,label:`Events / day`,height:36,showXAxis:!0,hoveredIdx:t,onHover:n})]})}function D({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,y.jsx)(`div`,{className:`overflow-x-auto`,children:(0,y.jsxs)(`table`,{className:`table table-sm`,children:[(0,y.jsx)(`thead`,{children:(0,y.jsxs)(`tr`,{children:[(0,y.jsx)(`th`,{children:`Model`}),(0,y.jsx)(`th`,{className:`text-right`,children:`Input`}),(0,y.jsx)(`th`,{className:`text-right`,children:`Output`}),(0,y.jsx)(`th`,{className:`text-right`,children:`Total`}),(0,y.jsx)(`th`,{className:`text-right`,children:`Share`})]})}),(0,y.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,y.jsxs)(`tr`,{children:[(0,y.jsxs)(`td`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`span`,{className:`inline-block w-2.5 h-2.5 rounded-full ${r} shrink-0`}),(0,y.jsx)(`span`,{className:`font-mono text-xs`,children:e.model})]}),(0,y.jsx)(`td`,{className:`text-right font-mono text-xs`,children:b(e.inputTokens)}),(0,y.jsx)(`td`,{className:`text-right font-mono text-xs`,children:b(e.outputTokens)}),(0,y.jsx)(`td`,{className:`text-right font-mono text-xs font-semibold`,children:b(e.totalTokens)}),(0,y.jsx)(`td`,{className:`text-right`,children:(0,y.jsxs)(`div`,{className:`flex items-center justify-end gap-1.5`,children:[(0,y.jsx)(`div`,{className:`w-12 h-1.5 bg-base-300 rounded-full overflow-hidden`,children:(0,y.jsx)(`div`,{className:`h-full ${r} rounded-full`,style:{width:`${t}%`}})}),(0,y.jsxs)(`span`,{className:`text-xs opacity-60 w-8 text-right`,children:[t,`%`]})]})})]},e.model)})})]})})}function O({topIssues:e}){return!e||e.length===0?null:(0,y.jsx)(`div`,{className:`overflow-x-auto`,children:(0,y.jsxs)(`table`,{className:`table table-sm`,children:[(0,y.jsx)(`thead`,{children:(0,y.jsxs)(`tr`,{children:[(0,y.jsx)(`th`,{className:`w-20`,children:`Issue`}),(0,y.jsx)(`th`,{children:`Title`}),(0,y.jsx)(`th`,{className:`text-right`,children:`Tokens`}),(0,y.jsx)(`th`,{className:`hidden sm:table-cell`,children:`Phase Split`})]})}),(0,y.jsx)(`tbody`,{children:e.slice(0,10).map(e=>{let t=e.byPhase,n=e.totalTokens||0;return(0,y.jsxs)(`tr`,{children:[(0,y.jsx)(`td`,{className:`font-mono text-xs font-semibold text-primary`,children:e.identifier}),(0,y.jsx)(`td`,{className:`max-w-[200px] truncate text-sm`,title:e.title,children:e.title||`-`}),(0,y.jsx)(`td`,{className:`text-right font-mono text-xs font-semibold`,children:b(n)}),(0,y.jsx)(`td`,{className:`hidden sm:table-cell`,children:t?(0,y.jsx)(`div`,{className:`flex h-1.5 rounded-full overflow-hidden bg-base-300 w-24`,children:C.map(e=>{let r=t[e.key]?.totalTokens||0,i=n>0?r/n*100:0;return i===0?null:(0,y.jsx)(`div`,{className:`${e.color} opacity-80`,style:{width:`${i}%`},title:`${e.label}: ${b(r)}`},e.key)})}):(0,y.jsx)(`span`,{className:`opacity-30 text-xs`,children:`-`})})]},e.id||e.identifier)})})]})})}function k({daily:e}){let t=e||[],[n,r]=(0,v.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,y.jsxs)(`div`,{children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-5 mb-3`,children:[(0,y.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs opacity-50`,children:[(0,y.jsx)(`span`,{className:`inline-block w-2.5 h-2.5 rounded-sm bg-success`}),`Lines added / day`]}),(0,y.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs opacity-50`,children:[(0,y.jsx)(`span`,{className:`inline-block w-2.5 h-2.5 rounded-sm bg-error`}),`Lines removed / day`]})]}),(0,y.jsxs)(`div`,{className:`relative`,children:[c&&(0,y.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,y.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,y.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,y.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,y.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs`,children:[(0,y.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-sm bg-success shrink-0`}),(0,y.jsxs)(`span`,{className:`font-mono font-semibold`,children:[`+`,(c.linesAdded||0).toLocaleString()]}),(0,y.jsx)(`span`,{className:`opacity-50`,children:`added`})]}),(0,y.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs`,children:[(0,y.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-sm bg-error shrink-0`}),(0,y.jsxs)(`span`,{className:`font-mono font-semibold`,children:[`-`,(c.linesRemoved||0).toLocaleString()]}),(0,y.jsx)(`span`,{className:`opacity-50`,children:`removed`})]}),(c.filesChanged||0)>0&&(0,y.jsx)(`span`,{className:`flex items-center gap-1.5 text-xs`,children:(0,y.jsxs)(`span`,{className:`opacity-50`,children:[c.filesChanged,` file`,c.filesChanged===1?``:`s`]})})]})]})}),(0,y.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,y.jsxs)(`div`,{className:`flex-1 flex flex-col cursor-default`,onMouseEnter:()=>r(t),onMouseLeave:()=>r(null),children:[(0,y.jsxs)(`div`,{className:`relative`,style:{height:64},children:[l>0&&(0,y.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,y.jsx)(`div`,{className:`absolute inset-0 bg-base-content/5 rounded-sm`})]}),(0,y.jsx)(`div`,{className:`h-px transition-colors duration-100 ${f?`bg-base-content/20`:`bg-base-300`}`}),(0,y.jsxs)(`div`,{className:`relative`,style:{height:24},children:[u>0&&(0,y.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,y.jsx)(`div`,{className:`absolute inset-0 bg-base-content/5 rounded-sm`})]})]},e.date)})}),(0,y.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,y.jsx)(`div`,{className:`flex-1 overflow-hidden`,children:o&&(0,y.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 A(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 j(e){return e==null||!Number.isFinite(e)?`–`:e>=1e3?`${(e/1e3).toFixed(1)}K`:Math.round(e).toString()}function M({icon:e,iconClass:t,title:n,avg:r,median:i,n:a,formatValue:o,unit:s}){return(0,y.jsxs)(`div`,{className:`stat bg-base-200 rounded-box`,children:[(0,y.jsx)(`div`,{className:`stat-figure ${t}`,children:(0,y.jsx)(e,{className:`size-6`})}),(0,y.jsx)(`div`,{className:`stat-title`,children:n}),(0,y.jsxs)(`div`,{className:`stat-value text-2xl ${t}`,children:[o(r),s&&(0,y.jsx)(`span`,{className:`text-base font-normal opacity-50 ml-1`,children:s})]}),(0,y.jsxs)(`div`,{className:`stat-desc`,children:[i==null?`–`:`median ${o(i)}`,a!=null&&(0,y.jsxs)(`span`,{className:`opacity-40`,children:[` · n=`,a]})]})]})}function N(){return(0,y.jsx)(`div`,{className:`flex-1 flex flex-col min-h-0 px-4 pb-4 pt-3`,children:(0,y.jsxs)(`div`,{className:`max-w-6xl w-full mx-auto space-y-6`,children:[(0,y.jsx)(`div`,{className:`skeleton-line h-8 w-48`}),(0,y.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4`,children:[...[,,,]].map((e,t)=>(0,y.jsx)(`div`,{className:`skeleton-card h-28`,style:{animationDelay:`${t*80}ms`}},t))}),(0,y.jsx)(`div`,{className:`skeleton-card h-52`}),(0,y.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4`,children:[(0,y.jsx)(`div`,{className:`skeleton-card h-32`}),(0,y.jsx)(`div`,{className:`skeleton-card h-32`})]}),(0,y.jsx)(`div`,{className:`skeleton-card h-64`})]})})}var P=n(`/analytics`)({component:F});function F(){let{data:e,isLoading:t}=a(),{data:n}=s(),{data:r}=l();if(t&&!e)return(0,y.jsx)(N,{});let i=e?.overall?.totalTokens||0,v=e?.byPhase||null,C=e?.byModel||{},T=o(e?.daily,32),P=e?.topIssues||[],F=new Date().toISOString().slice(0,10),I=T.find(e=>e.date===F),L=I?.totalTokens||0,R=T.reduce((e,t)=>e+(t.totalTokens||0),0),z=T.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,y.jsx)(`div`,{className:`flex-1 flex flex-col min-h-0 px-4 pb-4 pt-3 overflow-y-auto`,children:(0,y.jsxs)(`div`,{className:`max-w-6xl w-full mx-auto space-y-6 stagger-children`,children:[(0,y.jsx)(`section`,{children:(0,y.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6 gap-4`,children:[(0,y.jsxs)(`div`,{className:`stat bg-base-200 rounded-box`,children:[(0,y.jsx)(`div`,{className:`stat-figure text-primary`,children:(0,y.jsx)(m,{className:`size-6`})}),(0,y.jsx)(`div`,{className:`stat-title`,children:`Total Tokens`}),(0,y.jsx)(`div`,{className:`stat-value text-2xl`,children:(0,y.jsx)(S,{value:i})}),(0,y.jsx)(`div`,{className:`stat-desc font-mono`,children:x(i)})]}),(0,y.jsxs)(`div`,{className:`stat bg-base-200 rounded-box`,children:[(0,y.jsx)(`div`,{className:`stat-figure text-accent`,children:(0,y.jsx)(g,{className:`size-6`})}),(0,y.jsx)(`div`,{className:`stat-title`,children:`Tokens Today`}),(0,y.jsx)(`div`,{className:`stat-value text-2xl`,children:(0,y.jsx)(S,{value:L})}),(0,y.jsxs)(`div`,{className:`stat-desc`,children:[`30d: `,b(R)]})]}),(0,y.jsxs)(`div`,{className:`stat bg-base-200 rounded-box`,children:[(0,y.jsx)(`div`,{className:`stat-figure text-secondary`,children:(0,y.jsx)(c,{className:`size-6`})}),(0,y.jsx)(`div`,{className:`stat-title`,children:`Total Events`}),(0,y.jsx)(`div`,{className:`stat-value text-2xl`,children:(0,y.jsx)(S,{value:z,format:e=>String(e||0)})}),(0,y.jsxs)(`div`,{className:`stat-desc`,children:[`Today: `,B]})]}),(0,y.jsxs)(`div`,{className:`stat bg-base-200 rounded-box`,children:[(0,y.jsx)(`div`,{className:`stat-figure text-info`,children:(0,y.jsx)(p,{className:`size-6`})}),(0,y.jsx)(`div`,{className:`stat-title`,children:`Phase Split`}),(0,y.jsx)(`div`,{className:`stat-value text-2xl p-0`,children:v?(0,y.jsx)(w,{byPhase:v}):(0,y.jsx)(`span`,{className:`opacity-30`,children:`-`})})]}),(0,y.jsxs)(`div`,{className:`stat bg-base-200 rounded-box`,children:[(0,y.jsx)(`div`,{className:`stat-figure text-success`,children:(0,y.jsx)(u,{className:`size-6`})}),(0,y.jsx)(`div`,{className:`stat-title`,children:`Lines Added`}),(0,y.jsx)(`div`,{className:`stat-value text-2xl text-success`,children:(0,y.jsx)(S,{value:H,format:e=>e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e||0)})}),(0,y.jsx)(`div`,{className:`stat-desc`,children:`30d total`})]}),(0,y.jsxs)(`div`,{className:`stat bg-base-200 rounded-box`,children:[(0,y.jsx)(`div`,{className:`stat-figure text-error`,children:(0,y.jsx)(u,{className:`size-6`})}),(0,y.jsx)(`div`,{className:`stat-title`,children:`Lines Removed`}),(0,y.jsx)(`div`,{className:`stat-value text-2xl text-error`,children:(0,y.jsx)(S,{value:U,format:e=>e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e||0)})}),(0,y.jsx)(`div`,{className:`stat-desc`,children:`30d total`})]})]})}),(0,y.jsxs)(`section`,{className:`bg-base-200 rounded-box p-5`,children:[(0,y.jsx)(`div`,{className:`flex items-center justify-between mb-4`,children:(0,y.jsxs)(`h2`,{className:`text-sm font-semibold flex items-center gap-2`,children:[(0,y.jsx)(h,{className:`size-4 text-primary`}),`Daily Activity`]})}),(0,y.jsx)(E,{daily:T}),(0,y.jsx)(`div`,{className:`border-t border-base-300 my-5`}),(0,y.jsx)(k,{daily:V})]}),(0,y.jsxs)(`section`,{className:`bg-base-200 rounded-box p-5`,children:[(0,y.jsxs)(`h2`,{className:`text-sm font-semibold flex items-center gap-2 mb-4`,children:[(0,y.jsx)(f,{className:`size-4 text-warning`}),`Engineering KPIs`,W?.sampleSize>0&&(0,y.jsxs)(`span`,{className:`text-xs font-normal opacity-40 ml-1`,children:[`based on `,W.sampleSize,` completed issue`,W.sampleSize===1?``:`s`]})]}),(0,y.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-4 gap-4`,children:[(0,y.jsx)(M,{icon:g,iconClass:`text-primary`,title:`Issue Cycle Time`,avg:W?.issueCycleTimeDays?.avg??null,median:W?.issueCycleTimeDays?.median??null,n:W?.issueCycleTimeDays?.n??null,formatValue:A}),(0,y.jsx)(M,{icon:_,iconClass:`text-secondary`,title:`PR Cycle Time`,avg:W?.prCycleTimeDays?.avg??null,median:W?.prCycleTimeDays?.median??null,n:W?.prCycleTimeDays?.n??null,formatValue:A}),(0,y.jsx)(M,{icon:f,iconClass:`text-warning`,title:`Review Turnaround`,avg:W?.reviewTurnaroundDays?.avg??null,median:W?.reviewTurnaroundDays?.median??null,n:W?.reviewTurnaroundDays?.n??null,formatValue:A}),(0,y.jsx)(M,{icon:u,iconClass:`text-info`,title:`PR Size`,avg:W?.prSizeLines?.avg??null,median:W?.prSizeLines?.median??null,n:W?.prSizeLines?.n??null,formatValue:j,unit:`lines`})]})]}),P.length>0&&(0,y.jsxs)(`section`,{className:`bg-base-200 rounded-box p-5`,children:[(0,y.jsxs)(`h2`,{className:`text-sm font-semibold flex items-center gap-2 mb-4`,children:[(0,y.jsx)(m,{className:`size-4 text-accent`}),`Top Issues by Token Usage`]}),(0,y.jsx)(O,{topIssues:P})]}),Object.keys(C).length>0&&(0,y.jsxs)(`section`,{className:`bg-base-200 rounded-box p-5`,children:[(0,y.jsxs)(`h2`,{className:`text-sm font-semibold flex items-center gap-2 mb-4`,children:[(0,y.jsx)(d,{className:`size-4 text-info`}),`Model Breakdown`]}),(0,y.jsx)(D,{byModel:C})]})]})})}export{P as Route};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DF2fYuay.js";import{I as t}from"./vendor-
|
|
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};
|