fifony 0.1.20 → 0.1.21-next.03e4d38
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/FIFONY.md +4 -4
- package/README.md +10 -10
- package/app/dist/assets/{KeyboardShortcutsHelp-BRB8beRh.js → KeyboardShortcutsHelp-DYP5-mkr.js} +1 -1
- package/app/dist/assets/OnboardingWizard-Bl9bnp5K.js +1 -0
- package/app/dist/assets/analytics.lazy-CxhM0TfH.js +1 -0
- package/app/dist/assets/{createLucideIcon-DtZs0TX0.js → createLucideIcon-avOLE_av.js} +1 -1
- package/app/dist/assets/index-CYfsYYqt.js +43 -0
- package/app/dist/assets/index-Dbj5H_Sx.css +1 -0
- package/app/dist/assets/vendor-CPpF6c4N.js +9 -0
- package/app/dist/assets/zap-B9KQBsrr.js +1 -0
- package/app/dist/index.html +7 -7
- package/app/dist/manifest.webmanifest +3 -3
- package/app/dist/offline.html +2 -2
- package/app/dist/service-worker.js +1 -1
- package/app/public/manifest.webmanifest +3 -3
- package/app/public/offline.html +2 -2
- 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 +92 -7849
- package/dist/agent/run-local.js.map +1 -1
- package/dist/{chunk-JUSVR3DW.js → chunk-MOWMPRHI.js} +412 -12
- package/dist/chunk-MOWMPRHI.js.map +1 -0
- package/dist/chunk-WWFQGSUB.js +8458 -0
- package/dist/chunk-WWFQGSUB.js.map +1 -0
- package/dist/issue-runner-PWD7BRKR.js +10 -0
- package/dist/issue-runner-PWD7BRKR.js.map +1 -0
- package/dist/mcp/server.js +589 -595
- package/dist/mcp/server.js.map +1 -1
- package/dist/queue-workers-2Y3DPUVP.js +20 -0
- package/dist/queue-workers-2Y3DPUVP.js.map +1 -0
- package/package.json +9 -8
- package/app/dist/assets/OnboardingWizard-bjnhdgsN.js +0 -1
- package/app/dist/assets/analytics.lazy-D9Mi0KEH.js +0 -1
- package/app/dist/assets/index-BK46risn.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-JUSVR3DW.js.map +0 -1
package/FIFONY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# fifony local runtime reference
|
|
2
2
|
|
|
3
|
-
This repository runs
|
|
3
|
+
This repository runs fifony as a pure TypeScript local orchestrator with no external tracker dependency.
|
|
4
4
|
|
|
5
5
|
## What this package provides
|
|
6
6
|
|
|
@@ -91,8 +91,8 @@ npx fifony --port 4040 --concurrency 2 --attempts 3
|
|
|
91
91
|
- `routing.overrides[]` can override the automatic provider/profile selection for matching tasks.
|
|
92
92
|
- `routing.overrides[].match.paths` can force routing based on target directories or files.
|
|
93
93
|
- Issue payloads can carry `paths[]` so routing can use the real change surface, not only text and labels.
|
|
94
|
-
- When `paths[]` is omitted,
|
|
95
|
-
-
|
|
94
|
+
- When `paths[]` is omitted, fifony infers routing hints from path-like text mentions and from files changed inside an existing persisted workspace.
|
|
95
|
+
- fifony derives labels like `capability:<category>` and `overlay:<name>` from the routing result for queue triage and visibility.
|
|
96
96
|
- The rendered prompt is written to `fifony-prompt.md` and exported through `FIFONY_PROMPT` and `FIFONY_PROMPT_FILE`.
|
|
97
97
|
- Each issue runs as a multi-turn session controlled by `agent.max_turns`.
|
|
98
98
|
- Each turn exports `FIFONY_AGENT_PROVIDER`, `FIFONY_AGENT_ROLE`, `FIFONY_AGENT_PROFILE`, `FIFONY_AGENT_PROFILE_FILE`, `FIFONY_AGENT_PROFILE_INSTRUCTIONS`, `FIFONY_SESSION_ID`, `FIFONY_SESSION_KEY`, `FIFONY_TURN_INDEX`, `FIFONY_MAX_TURNS`, `FIFONY_TURN_PROMPT`, `FIFONY_TURN_PROMPT_FILE`, `FIFONY_PREVIOUS_OUTPUT`, and `FIFONY_RESULT_FILE`.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
#
|
|
3
|
+
# fifony
|
|
4
4
|
|
|
5
5
|
**AI agents that actually ship code. You just watch.**
|
|
6
6
|
|
|
@@ -25,7 +25,7 @@ Open **http://localhost:4040**. The first run launches the onboarding wizard —
|
|
|
25
25
|
|
|
26
26
|
## How It Works
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
fifony breaks every task into three stages, each independently configurable:
|
|
29
29
|
|
|
30
30
|
```
|
|
31
31
|
Plan Execute Review
|
|
@@ -46,14 +46,14 @@ Planning → Todo → Queued → Running → In Review → Done
|
|
|
46
46
|
Interrupted Blocked → (retry with backoff)
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
1. **Create** — Describe what you want done.
|
|
49
|
+
1. **Create** — Describe what you want done. fifony AI-enhances the title and description before planning.
|
|
50
50
|
2. **Plan** — The planner agent generates a structured execution plan: phases, steps, target files, complexity, risks.
|
|
51
51
|
3. **Approve** — You review the plan. Optionally chat with the AI to refine it before approving.
|
|
52
52
|
4. **Execute** — Agents run in an isolated workspace (a copy of your project). Live output streams to the dashboard.
|
|
53
53
|
5. **Review** — The reviewer agent inspects the diff and either approves, requests rework, or blocks.
|
|
54
54
|
6. **Merge** — You review the diff and merge the workspace back to your project root.
|
|
55
55
|
|
|
56
|
-
Agents run as detached child processes, tracked by PID. If the server restarts mid-run,
|
|
56
|
+
Agents run as detached child processes, tracked by PID. If the server restarts mid-run, fifony recovers on the next boot.
|
|
57
57
|
|
|
58
58
|
---
|
|
59
59
|
|
|
@@ -97,7 +97,7 @@ Install as a desktop app. Works offline. Desktop notifications when issues chang
|
|
|
97
97
|
|
|
98
98
|
## Agent & Skill Catalog
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
fifony ships with 15 specialist agents:
|
|
101
101
|
|
|
102
102
|
| Agent | Focus |
|
|
103
103
|
|-------|-------|
|
|
@@ -119,7 +119,7 @@ Fifony ships with 15 specialist agents:
|
|
|
119
119
|
|
|
120
120
|
And 5 skills: `commit`, `review-pr`, `debug`, `testing`, `impeccable` (frontend design system).
|
|
121
121
|
|
|
122
|
-
Agents install to `.claude/agents/` and `.codex/agents/` during onboarding. Skills load from `SKILL.md` files in `.claude/skills/`, `.codex/skills/`, or your home directory.
|
|
122
|
+
Agents install to `.claude/agents/` and `.codex/agents/` during onboarding. Skills load from `SKILL.md` files in `.claude/skills/`, `.codex/skills/`, or your home directory. fifony infers the right agent from the issue description and target file paths — capability routing is automatic.
|
|
123
123
|
|
|
124
124
|
---
|
|
125
125
|
|
|
@@ -152,7 +152,7 @@ npx -y fifony --concurrency 2 --attempts 3 --poll 500
|
|
|
152
152
|
|
|
153
153
|
## MCP Server
|
|
154
154
|
|
|
155
|
-
Use
|
|
155
|
+
Use fifony as tools inside your editor:
|
|
156
156
|
|
|
157
157
|
```bash
|
|
158
158
|
npx -y fifony mcp --workspace /path/to/repo
|
|
@@ -206,7 +206,7 @@ Interactive docs at `http://localhost:4040/docs`.
|
|
|
206
206
|
|
|
207
207
|
## Configuration
|
|
208
208
|
|
|
209
|
-
|
|
209
|
+
fifony reads a `WORKFLOW.md` in your project root if present. Front matter configures the pipeline; the Markdown body defines the execution contract. Settings from the UI write to `.fifony/s3db/`.
|
|
210
210
|
|
|
211
211
|
**Environment variables** (all optional when using the UI or WORKFLOW.md):
|
|
212
212
|
|
|
@@ -236,7 +236,7 @@ FIFONY_AGENT_MAX_TURNS=4
|
|
|
236
236
|
|
|
237
237
|
**Token tracking**: O(1) in-memory ledger, no I/O on the hot path. Per-phase and per-model breakdown. Daily and hourly rollups via the `EventualConsistencyPlugin`. Cost estimates when the provider reports them.
|
|
238
238
|
|
|
239
|
-
**Capability routing**:
|
|
239
|
+
**Capability routing**: fifony infers task type from the issue description and target file paths. It derives `capability:<category>` and `overlay:<name>` labels for queue triage. When `paths[]` is omitted, routing falls back to path mentions in the issue text and files changed in an existing workspace.
|
|
240
240
|
|
|
241
241
|
**Graceful shutdown**: Running issues are marked `Interrupted` on SIGTERM. They resume from the last completed turn on the next boot.
|
|
242
242
|
|
|
@@ -251,7 +251,7 @@ FIFONY_AGENT_MAX_TURNS=4
|
|
|
251
251
|
|
|
252
252
|
## Credits
|
|
253
253
|
|
|
254
|
-
|
|
254
|
+
fifony is built on the shoulders of:
|
|
255
255
|
|
|
256
256
|
- **[OpenAI Codex CLI](https://github.com/openai/codex)** — Original foundation (Apache 2.0). See [NOTICE](NOTICE) and [THIRD-PARTY-NOTICES.md](THIRD-PARTY-NOTICES.md).
|
|
257
257
|
- **[Agency Agents](https://github.com/msitarzewski/agency-agents)** — Inspiration for the agent catalog.
|
package/app/dist/assets/{KeyboardShortcutsHelp-BRB8beRh.js → KeyboardShortcutsHelp-DYP5-mkr.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-CPpF6c4N.js";import{t as r}from"./createLucideIcon-avOLE_av.js";import{i}from"./index-CYfsYYqt.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-CPpF6c4N.js";import{T as i,b as a,c as o,l as s,n as c,t as l,u}from"./zap-B9KQBsrr.js";import{t as d}from"./createLucideIcon-avOLE_av.js";import{A as f,C as p,D as m,E as h,M as g,T as _,_ as v,a as y,b,d as x,f as S,j as C,k as w,l as T,m as E,n as D,o as O,p as k,r as ee,t as te,u as A,v as j,w as M,y as ne}from"./index-CYfsYYqt.js";var N=d(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),P=d(`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`}]]),F=d(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),I=d(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),re=d(`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`}]]),ie=d(`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`}]]),L=d(`folder-search`,[[`path`,{d:`M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1`,key:`1bw5m7`}],[`path`,{d:`m21 21-1.9-1.9`,key:`1g2n9r`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}]]),ae=d(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),oe=d(`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`}]]),R=d(`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`}]]),z=d(`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`}]]),B=e(t(),1),V=[`Welcome`,`Project`,`Branch`,`Providers`,`Scan Project`,`Domains`,`Agents & Skills`,`Effort`,`Workers & Theme`,`Launch`];function se(e){return e?[...V.slice(0,4),`Discover Issues`,...V.slice(4)]:V}function ce(e){return e?11:10}var H=[`Project`,`Branch`,`Pipeline`,`Scan`,`Domains`,`Agents`,`Effort`,`Workers & Theme`,`Launch`];function le(e){return e?[...H.slice(0,3),`Discover`,...H.slice(3)]:H}var U=[{value:`low`,label:`Low`,icon:l,description:`Quick and light -- fast responses, less thorough`,color:`text-info`},{value:`medium`,label:`Medium`,icon:j,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:re,description:`Maximum depth -- most thorough, slowest`,color:`text-error`}],ue={codex:U,claude:U.filter(e=>e.value!==`extra-high`)};function W(e,t){return ue[t?.[e]||`codex`]||U}var de=[{label:`Technical`,domains:[{value:`frontend`,label:`Frontend`,emoji:`🎨`},{value:`backend`,label:`Backend`,emoji:`⚙️`},{value:`mobile`,label:`Mobile`,emoji:`📱`},{value:`devops`,label:`DevOps / Infra`,emoji:`🚀`},{value:`database`,label:`Database`,emoji:`🗄️`},{value:`ai-ml`,label:`AI / ML`,emoji:`🤖`},{value:`security`,label:`Security`,emoji:`🔒`},{value:`testing`,label:`Testing / QA`,emoji:`🧪`},{value:`embedded`,label:`Embedded / IoT`,emoji:`🔌`}]},{label:`Industry`,domains:[{value:`games`,label:`Games`,emoji:`🎮`},{value:`ecommerce`,label:`E-commerce`,emoji:`🛒`},{value:`saas`,label:`SaaS`,emoji:`☁️`},{value:`fintech`,label:`Fintech`,emoji:`💰`},{value:`healthcare`,label:`Healthcare`,emoji:`🏥`},{value:`education`,label:`Education`,emoji:`📚`},{value:`blockchain`,label:`Blockchain`,emoji:`⛓️`},{value:`spatial-computing`,label:`Spatial / XR`,emoji:`🥽`}]},{label:`Role`,domains:[{value:`design`,label:`Design / UX`,emoji:`✏️`},{value:`product`,label:`Product`,emoji:`📋`},{value:`marketing`,label:`Marketing`,emoji:`📢`},{value:`data-engineering`,label:`Data Engineering`,emoji:`📊`}]}],fe=[{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`}],pe=[{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:l,color:`text-primary`},{role:`reviewer`,label:`Reviewer`,description:`Validates the result — checks correctness, scope, and quality`,icon:A,color:`text-secondary`}];async function G(e,t,n=`ui`){return i.post(`/settings/${encodeURIComponent(e)}`,{value:t,scope:n,source:`user`})}function K(e,t=`medium`){return U.some(t=>t.value===e)?e:t}function me(e){return!e||typeof e!=`object`||Array.isArray(e)?{planner:`medium`,executor:`medium`,reviewer:`medium`}:{planner:K(e.planner??e.default,`medium`),executor:K(e.executor??e.default,`medium`),reviewer:K(e.reviewer??e.default,`medium`)}}function q(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 J=n();function he({current:e,wantsDiscovery:t}){let n=le(t),r=e-1;return(0,J.jsx)(`ul`,{className:`steps steps-horizontal w-full max-w-2xl text-xs`,children:n.map((e,t)=>{let n=t<r,i=t===r;return(0,J.jsx)(`li`,{"data-content":n?`✓`:t+1,className:`step ${n||i?`step-primary`:``}`,style:{transition:`color 0.3s ease`},children:e},e)})})}function ge({direction:e,stepKey:t,center:n,children:r}){return(0,J.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 _e({step:e,stepCount:t,stepName:n,canProceed:r,launching:i,onBack:a,onNext:o,onLaunch:s}){return e===0?null:(0,J.jsxs)(`div`,{className:`relative z-10 p-4 pb-6 flex items-center max-w-2xl mx-auto w-full justify-between`,children:[(0,J.jsxs)(`button`,{className:`btn btn-ghost gap-1`,onClick:a,disabled:i,children:[(0,J.jsx)(F,{className:`size-4`}),` Back`]}),e<t-1?(0,J.jsxs)(`button`,{className:`btn btn-primary gap-1`,onClick:o,disabled:!r,children:[n===`Discover Issues`?`Continue`:`Next`,` `,(0,J.jsx)(I,{className:`size-4`})]}):(0,J.jsx)(`button`,{className:`btn btn-primary btn-lg gap-2 animate-pulse-soft`,onClick:s,disabled:i,children:i?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(E,{className:`size-5 animate-spin`}),` Launching...`]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(R,{className:`size-5`}),` Launch fifony`]})})]})}function ve({workspacePath:e,onGetStarted:t}){return(0,J.jsxs)(`div`,{className:`flex flex-col items-center text-center gap-6 stagger-children py-4`,children:[(0,J.jsx)(`div`,{className:`text-6xl sm:text-7xl animate-bounce-in`,children:(0,J.jsx)(S,{className:`size-16 sm:size-20 text-primary mx-auto`})}),(0,J.jsxs)(`h1`,{className:`text-3xl sm:text-4xl font-bold tracking-tight`,children:[`Welcome to `,(0,J.jsx)(`span`,{className:`text-primary`,children:`fifony`})]}),(0,J.jsx)(`p`,{className:`text-base-content/60 text-lg max-w-md`,children:`Let's set up your AI orchestration workspace in just a few steps.`}),e&&(0,J.jsxs)(`div`,{className:`badge badge-lg badge-soft badge-primary gap-2`,children:[(0,J.jsx)(T,{className:`size-3.5`}),e]}),(0,J.jsxs)(`button`,{className:`btn btn-primary btn-lg gap-2 mt-2`,onClick:t,children:[`Get Started `,(0,J.jsx)(I,{className:`size-5`})]})]})}function ye({projectName:e,setProjectName:t,detectedProjectName:n,projectSource:r,workspacePath:i}){let a=C(e),o=a?r===`saved`||r===`detected`?r:`manual`:n?`detected`:`missing`,s=f(a||n);return(0,J.jsxs)(`div`,{className:`flex flex-col gap-6 py-4`,children:[(0,J.jsxs)(`div`,{className:`text-center space-y-3`,children:[(0,J.jsx)(`div`,{className:`inline-flex size-14 items-center justify-center rounded-full bg-primary/10 text-primary mx-auto`,children:(0,J.jsx)(ie,{className:`size-7`})}),(0,J.jsxs)(`div`,{className:`space-y-2`,children:[(0,J.jsx)(`h2`,{className:`text-2xl sm:text-3xl font-bold tracking-tight`,children:`Name this execution queue`}),(0,J.jsx)(`p`,{className:`text-base-content/60 max-w-xl mx-auto`,children:`fifony uses your project name to label the queue. Confirm the suggestion below or adjust it before continuing.`})]})]}),(0,J.jsx)(`div`,{className:`card bg-base-200/70 border border-base-300/70 shadow-sm`,children:(0,J.jsxs)(`div`,{className:`card-body gap-4`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`div`,{className:`text-sm font-semibold`,children:`Project name`}),(0,J.jsx)(`div`,{className:`text-xs text-base-content/50`,children:`This becomes the default queue title for future runs.`})]}),o===`saved`&&(0,J.jsxs)(`span`,{className:`badge badge-primary badge-soft gap-1.5`,children:[(0,J.jsx)(T,{className:`size-3`}),`Saved configuration`]}),o===`detected`&&(0,J.jsxs)(`span`,{className:`badge badge-secondary badge-soft gap-1.5`,children:[(0,J.jsx)(T,{className:`size-3`}),`Detected automatically`]}),o===`manual`&&(0,J.jsxs)(`span`,{className:`badge badge-accent badge-soft gap-1.5`,children:[(0,J.jsx)(oe,{className:`size-3`}),`Edited manually`]}),o===`missing`&&(0,J.jsxs)(`span`,{className:`badge badge-warning badge-soft gap-1.5`,children:[(0,J.jsx)(O,{className:`size-3`}),`Manual entry required`]})]}),(0,J.jsxs)(`label`,{className:`form-control w-full gap-2`,children:[(0,J.jsx)(`span`,{className:`label-text text-sm font-medium`,children:`Project`}),(0,J.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=C(n.target.value);r!==e&&t(r)}})]}),i&&(0,J.jsxs)(`div`,{className:`text-xs text-base-content/50 break-all`,children:[`Workspace: `,i]}),!n&&!a&&(0,J.jsxs)(`div`,{className:`alert alert-warning text-sm`,children:[(0,J.jsx)(O,{className:`size-4 shrink-0`}),(0,J.jsx)(`span`,{children:`We could not detect a project name from the current directory. Enter one to continue.`})]}),(0,J.jsxs)(`div`,{className:`rounded-2xl border border-base-300/70 bg-base-100 px-4 py-3`,children:[(0,J.jsx)(`div`,{className:`text-xs uppercase tracking-[0.2em] text-base-content/40`,children:`Queue title preview`}),(0,J.jsx)(`div`,{className:`mt-2 text-lg font-semibold tracking-tight break-words`,children:s})]})]})})]})}var be=new Set([`main`,`master`]);function Y(){let[e,t]=(0,B.useState)(null),[n,r]=(0,B.useState)(!1),[a,o]=(0,B.useState)(!1);return(0,B.useEffect)(()=>{i.get(`/gitignore/status`).then(t).catch(()=>t({exists:!1,hasFifony:!1}))},[]),e===null||e.hasFifony?null:a?(0,J.jsxs)(`div`,{className:`alert alert-success py-2.5 text-sm animate-fade-in`,children:[(0,J.jsx)(z,{className:`size-4 shrink-0`}),(0,J.jsxs)(`span`,{children:[(0,J.jsx)(`code`,{children:`.fifony/`}),` adicionado ao `,(0,J.jsx)(`code`,{children:`.gitignore`})]})]}):(0,J.jsxs)(`div`,{className:`alert alert-warning py-2.5 text-sm`,children:[(0,J.jsx)(z,{className:`size-4 shrink-0`}),(0,J.jsxs)(`div`,{className:`flex-1`,children:[(0,J.jsxs)(`span`,{children:[(0,J.jsx)(`code`,{children:`.fifony/`}),` não está no `,(0,J.jsx)(`code`,{children:`.gitignore`})]}),(0,J.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,J.jsx)(`button`,{className:`btn btn-xs btn-warning`,onClick:async()=>{r(!0);try{await i.post(`/gitignore/add`),o(!0)}catch{}finally{r(!1)}},disabled:n,children:n?(0,J.jsx)(E,{className:`size-3 animate-spin`}):`Adicionar`})]})}function xe({currentBranch:e,onBranchCreated:t}){let[n,r]=(0,B.useState)(`develop`),[a,o]=(0,B.useState)(!1),[s,c]=(0,B.useState)(null),[l,u]=(0,B.useState)(!1),d=be.has(e),f=/^[a-zA-Z0-9/_.-]+$/.test(n.trim())&&n.trim().length>0;async function p(){if(!(!f||a)){o(!0),c(null);try{let e=await i.post(`/git/branch`,{branchName:n.trim()});if(!e.ok)throw Error(e.error||`Failed to create branch.`);u(!0),t?.(n.trim())}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(!1)}}}return l?(0,J.jsxs)(`div`,{className:`flex flex-col items-center gap-4 py-8 text-center`,children:[(0,J.jsx)(_,{className:`size-12 text-success`}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`p`,{className:`text-lg font-semibold`,children:`Branch criada com sucesso`}),(0,J.jsxs)(`p`,{className:`text-sm opacity-60 mt-1 font-mono`,children:[`Agora em `,(0,J.jsx)(`span`,{className:`text-primary`,children:n.trim()}),` — os agentes vão usar essa branch como base`]})]})]}):(0,J.jsxs)(`div`,{className:`flex flex-col gap-6 max-w-lg`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h2`,{className:`text-2xl font-bold mb-1`,children:`Branch de trabalho`}),(0,J.jsx)(`p`,{className:`opacity-60 text-sm`,children:`Os agentes criam worktrees baseados na branch atual. Recomendamos não usar diretamente a main.`})]}),(0,J.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 rounded-box border border-base-300 bg-base-200`,children:[(0,J.jsx)(v,{className:`size-4 opacity-50 shrink-0`}),(0,J.jsx)(`span`,{className:`text-sm opacity-50`,children:`Branch atual:`}),(0,J.jsx)(`span`,{className:`font-mono text-sm font-semibold`,children:e||`—`}),d&&(0,J.jsx)(`span`,{className:`badge badge-warning badge-sm ml-auto shrink-0`,children:`protegida`})]}),d&&(0,J.jsxs)(`div`,{className:`alert alert-warning py-3`,children:[(0,J.jsx)(O,{className:`size-4 shrink-0`}),(0,J.jsxs)(`div`,{className:`text-sm`,children:[(0,J.jsxs)(`p`,{className:`font-semibold`,children:[`Trabalhando direto na `,(0,J.jsx)(`span`,{className:`font-mono`,children:e})]}),(0,J.jsx)(`p`,{className:`opacity-80 mt-0.5`,children:`Em times com branch protegida, merges locais são rejeitados. Crie uma branch de trabalho ou use o modo Push PR.`})]})]}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`label`,{className:`text-sm font-medium`,children:`Criar uma branch nova agora`}),(0,J.jsxs)(`div`,{className:`flex gap-2`,children:[(0,J.jsxs)(`label`,{className:`input input-bordered flex items-center gap-2 flex-1`,children:[(0,J.jsx)(v,{className:`size-3.5 opacity-40`}),(0,J.jsx)(`input`,{type:`text`,className:`grow font-mono text-sm`,value:n,onChange:e=>{r(e.target.value),c(null)},onKeyDown:e=>e.key===`Enter`&&p(),placeholder:`develop`,disabled:a})]}),(0,J.jsx)(`button`,{className:`btn btn-primary`,onClick:p,disabled:!f||a,children:a?(0,J.jsx)(k,{className:`size-4 animate-spin`}):`Criar`})]}),s&&(0,J.jsxs)(`p`,{className:`text-xs text-error flex items-center gap-1`,children:[(0,J.jsx)(O,{className:`size-3`}),` `,s]}),(0,J.jsxs)(`p`,{className:`text-xs opacity-40`,children:[`Equivalente a: `,(0,J.jsxs)(`span`,{className:`font-mono`,children:[`git checkout -b `,n.trim()||`develop`]})]})]}),(0,J.jsx)(Y,{})]})}function Se({providers:e,providersLoading:t,pipeline:n,setPipeline:r}){let i=Array.isArray(e)?e:[],a=i.filter(e=>e.available!==!1);return(0,J.jsxs)(`div`,{className:`flex flex-col gap-6 stagger-children`,children:[(0,J.jsxs)(`div`,{className:`text-center`,children:[(0,J.jsx)(R,{className:`size-10 text-primary mx-auto mb-3`}),(0,J.jsx)(`h2`,{className:`text-2xl font-bold`,children:`Agent Pipeline`}),(0,J.jsx)(`p`,{className:`text-base-content/60 mt-1`,children:`Choose which CLI runs each stage of the pipeline`})]}),t?(0,J.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-8`,children:[(0,J.jsx)(E,{className:`size-8 text-primary animate-spin`}),(0,J.jsx)(`p`,{className:`text-sm text-base-content/50`,children:`Detecting available CLIs...`})]}):a.length===0?(0,J.jsx)(`div`,{className:`alert alert-warning text-sm`,children:`No providers detected. Make sure claude or codex CLI is installed.`}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`div`,{className:`flex flex-wrap gap-2 justify-center`,children:i.map(e=>{let t=e.id||e.name||e,n=e.available!==!1;return(0,J.jsxs)(`span`,{className:`badge badge-lg gap-2 ${n?`badge-success`:`badge-ghost opacity-50`}`,children:[n?(0,J.jsx)(M,{className:`size-3.5`}):(0,J.jsx)(p,{className:`size-3.5`}),t,e.path&&(0,J.jsx)(`span`,{className:`font-mono text-[10px] opacity-60 hidden sm:inline`,children:e.path})]},t)})}),(0,J.jsx)(`div`,{className:`flex flex-col items-center gap-2`,children:pe.map((e,t)=>{let i=e.icon,o=n[e.role]||a[0]?.name||``;return(0,J.jsxs)(`div`,{className:`w-full`,children:[t>0&&(0,J.jsx)(`div`,{className:`flex justify-center py-1`,children:(0,J.jsx)(I,{className:`size-5 rotate-90 opacity-30`})}),(0,J.jsx)(`div`,{className:`card bg-base-200`,children:(0,J.jsxs)(`div`,{className:`card-body p-4 flex-row items-center gap-4`,children:[(0,J.jsx)(`div`,{className:`size-10 rounded-full flex items-center justify-center bg-base-300 ${e.color}`,children:(0,J.jsx)(i,{className:`size-5`})}),(0,J.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,J.jsx)(`div`,{className:`font-semibold`,children:e.label}),(0,J.jsx)(`p`,{className:`text-xs text-base-content/50`,children:e.description})]}),(0,J.jsx)(`select`,{className:`select select-bordered select-sm w-32`,value:o,onChange:t=>r(n=>({...n,[e.role]:t.target.value})),children:a.map(e=>{let t=e.id||e.name||e;return(0,J.jsx)(`option`,{value:t,children:t},t)})})]})})]},e.role)})}),(0,J.jsx)(`p`,{className:`text-xs text-base-content/40 text-center max-w-md mx-auto`,children:`Each stage can use a different CLI. The pipeline flows top to bottom: plan, then execute, then review.`})]})]})}var X={claudeMd:`CLAUDE.md`,claudeDir:`.claude/`,codexDir:`.codex/`,readmeMd:`README.md`,packageJson:`package.json`,cargoToml:`Cargo.toml`,pyprojectToml:`pyproject.toml`,goMod:`go.mod`,buildGradle:`build.gradle`,gemfile:`Gemfile`,dockerfile:`Dockerfile`,workflowMd:`WORKFLOW.md`,agentsMd:`AGENTS.md`,claudeAgentsDir:`.claude/agents/`,claudeSkillsDir:`.claude/skills/`,codexAgentsDir:`.codex/agents/`,codexSkillsDir:`.codex/skills/`};function Ce({scanResult:e,setScanResult:t,projectDescription:n,setProjectDescription:r,analysisResult:a,setAnalysisResult:o,selectedProvider:s,analyzing:c,setAnalyzing:l,wantsDiscovery:u,setWantsDiscovery:d}){let[f,h]=(0,B.useState)(!1),[g,_]=(0,B.useState)(null),[v,y]=(0,B.useState)(null),x=(0,B.useRef)(!1);(0,B.useEffect)(()=>{x.current||e||(x.current=!0,h(!0),_(null),i.get(`/scan/project`).then(e=>{if(t(e),!n){let t=e?.packageDescription||e?.packageInfo?.description||e?.readmeExcerpt||``;t&&r(t)}s&&!a&&(l(!0),i.post(`/scan/analyze`,{provider:s}).then(e=>{o(e),e.description&&r(e.description)}).catch(()=>{}).finally(()=>l(!1)))}).catch(e=>_(e.message||`Failed to scan project`)).finally(()=>h(!1)))},[]);let S=(0,B.useCallback)(async()=>{l(!0),y(null);try{let e=await i.post(`/scan/analyze`,{provider:s||`codex`});o(e),e.description&&r(e.description)}catch(e){y(e.message||`Analysis failed`)}finally{l(!1)}},[s,l,o,r]),C=e?.files||{},w=Object.entries(C).map(([e,t])=>({path:X[e]||e,exists:!!t})),D=(e?.existingAgents||[]).map(e=>typeof e==`string`?{name:e}:e),O=(e?.existingSkills||[]).map(e=>typeof e==`string`?{name:e}:e),k=a?.stack||[];return(0,J.jsxs)(`div`,{className:`flex flex-col gap-6 stagger-children`,children:[(0,J.jsxs)(`div`,{className:`text-center`,children:[(0,J.jsx)(L,{className:`size-10 text-primary mx-auto mb-3`}),(0,J.jsx)(`h2`,{className:`text-2xl font-bold`,children:`Scan Project`}),(0,J.jsx)(`p`,{className:`text-base-content/60 mt-1`,children:`We'll analyze your workspace to suggest the best setup`})]}),f&&(0,J.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-6`,children:[(0,J.jsx)(E,{className:`size-8 text-primary animate-spin`}),(0,J.jsx)(`p`,{className:`text-sm text-base-content/50`,children:`Scanning project files...`})]}),g&&(0,J.jsx)(`div`,{className:`alert alert-warning text-sm`,children:g}),e&&!f&&(0,J.jsx)(`div`,{className:`card bg-base-200`,children:(0,J.jsxs)(`div`,{className:`card-body p-4 gap-3`,children:[(0,J.jsxs)(`h3`,{className:`font-semibold text-sm flex items-center gap-2`,children:[(0,J.jsx)(ne,{className:`size-4 opacity-50`}),`Project Files`]}),(0,J.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-1.5`,children:w.map(e=>(0,J.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[e.exists?(0,J.jsx)(M,{className:`size-4 text-success shrink-0`}):(0,J.jsx)(p,{className:`size-4 text-base-content/30 shrink-0`}),(0,J.jsx)(`span`,{className:`font-mono text-xs truncate ${e.exists?``:`text-base-content/40`}`,children:e.path})]},e.path))}),(D.length>0||O.length>0)&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`div`,{className:`divider my-0`}),(0,J.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[D.length>0&&(0,J.jsxs)(`span`,{className:`badge badge-sm badge-info gap-1`,children:[(0,J.jsx)(m,{className:`size-3`}),D.length,` agent`,D.length===1?``:`s`,` found`]}),O.length>0&&(0,J.jsxs)(`span`,{className:`badge badge-sm badge-secondary gap-1`,children:[(0,J.jsx)(N,{className:`size-3`}),O.length,` skill`,O.length===1?``:`s`,` found`]})]})]})]})}),!c&&!a&&(0,J.jsxs)(`button`,{className:`btn btn-primary btn-lg gap-2 mx-auto`,onClick:S,disabled:f,children:[(0,J.jsx)(T,{className:`size-5`}),`Analyze with AI`]}),c&&(0,J.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-4`,children:[(0,J.jsx)(E,{className:`size-8 text-primary animate-spin`}),(0,J.jsx)(`p`,{className:`text-sm text-base-content/50`,children:`AI is analyzing your project...`})]}),v&&(0,J.jsx)(`div`,{className:`alert alert-warning text-sm`,children:`Analysis failed. You can describe your project manually below.`}),k.length>0&&(0,J.jsx)(`div`,{className:`flex flex-wrap gap-2 justify-center`,children:k.map(e=>(0,J.jsx)(`span`,{className:`badge badge-sm badge-soft badge-primary`,children:e},e))}),(e||a||v)&&!f&&!c&&(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`label`,{className:`label text-sm font-medium`,children:`Project Description`}),(0,J.jsx)(`textarea`,{className:`textarea textarea-bordered w-full h-24 text-sm`,placeholder:`Describe your project so we can suggest the right agents and domains...`,value:n,onChange:e=>r(e.target.value)})]}),(0,J.jsx)(`div`,{className:`w-full max-w-lg`,children:(0,J.jsxs)(`label`,{className:`flex items-center gap-3 cursor-pointer p-3 rounded-lg bg-base-200/50 border border-base-300/50 hover:border-primary/30 transition-colors`,children:[(0,J.jsx)(`input`,{type:`checkbox`,className:`toggle toggle-primary toggle-sm`,checked:u,onChange:e=>d(e.target.checked)}),(0,J.jsxs)(`div`,{className:`flex-1`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(b,{className:`size-4 text-primary`}),(0,J.jsx)(`span`,{className:`text-sm font-medium`,children:`Discover existing issues`})]}),(0,J.jsx)(`p`,{className:`text-xs text-base-content/50 mt-0.5`,children:`Scan for TODOs, FIXMEs, and GitHub issues to import`})]})]})})]})}function we({selectedDomains:e,setSelectedDomains:t,analysisResult:n}){let r=(0,B.useRef)(!1);(0,B.useEffect)(()=>{r.current||!n?.domains?.length||e.length>0||(r.current=!0,t(n.domains))},[n]);let i=(0,B.useCallback)(e=>{t(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[t]);return(0,J.jsxs)(`div`,{className:`flex flex-col gap-6 stagger-children`,children:[(0,J.jsxs)(`div`,{className:`text-center`,children:[(0,J.jsx)(ae,{className:`size-10 text-primary mx-auto mb-3`}),(0,J.jsx)(`h2`,{className:`text-2xl font-bold`,children:`Domains`}),(0,J.jsx)(`p`,{className:`text-base-content/60 mt-1`,children:`Select the domains relevant to your project`})]}),de.map(t=>(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-wider text-base-content/40 mb-2`,children:t.label}),(0,J.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.domains.map(t=>(0,J.jsxs)(`button`,{className:`btn btn-sm gap-1.5 ${e.includes(t.value)?`btn-primary`:`btn-soft`}`,onClick:()=>i(t.value),children:[(0,J.jsx)(`span`,{children:t.emoji}),t.label]},t.value))})]},t.label))]})}function Te({selectedDomains:e,selectedAgents:t,setSelectedAgents:n,selectedSkills:r,setSelectedSkills:a,existingAgents:o,existingSkills:s}){let[c,l]=(0,B.useState)([]),[u,d]=(0,B.useState)([]),[f,p]=(0,B.useState)(!1),g=(0,B.useRef)(!1);(0,B.useEffect)(()=>{if(g.current)return;g.current=!0,p(!0);let c=e.length>0?`?domains=${e.join(`,`)}`:``;Promise.all([i.get(`/catalog/agents${c}`).catch(()=>({agents:[]})),i.get(`/catalog/skills`).catch(()=>({skills:[]}))]).then(([e,i])=>{let c=e?.agents||[],u=i?.skills||[];l(c),d(u);let f=new Set((o||[]).map(e=>e.name)),p=c.filter(e=>!f.has(e.name)).map(e=>e.name);p.length>0&&t.length===0&&n(p);let m=new Set((s||[]).map(e=>e.name)),h=u.filter(e=>!m.has(e.name)).map(e=>e.name);h.length>0&&r.length===0&&a(h)}).finally(()=>p(!1))},[]);let _=new Set((o||[]).map(e=>e.name)),v=new Set((s||[]).map(e=>e.name)),y=(0,B.useCallback)(e=>{n(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[n]),b=(0,B.useCallback)(e=>{a(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[a]),x=(0,B.useCallback)(()=>{n(c.filter(e=>!_.has(e.name)).map(e=>e.name))},[c,_,n]),S=(0,B.useCallback)(()=>n([]),[n]),C=(0,B.useCallback)(()=>{a(u.filter(e=>!v.has(e.name)).map(e=>e.name))},[u,v,a]),w=(0,B.useCallback)(()=>a([]),[a]);return f?(0,J.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-12`,children:[(0,J.jsx)(E,{className:`size-8 text-primary animate-spin`}),(0,J.jsx)(`p`,{className:`text-sm text-base-content/50`,children:`Loading catalog...`})]}):(0,J.jsxs)(`div`,{className:`flex flex-col gap-6 stagger-children`,children:[(0,J.jsxs)(`div`,{className:`text-center`,children:[(0,J.jsx)(m,{className:`size-10 text-primary mx-auto mb-3`}),(0,J.jsx)(`h2`,{className:`text-2xl font-bold`,children:`Agents & Skills`}),(0,J.jsx)(`p`,{className:`text-base-content/60 mt-1`,children:`Choose which agents and skills to install`})]}),c.length>0&&(0,J.jsxs)(`div`,{children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,J.jsxs)(`h3`,{className:`font-semibold text-sm flex items-center gap-2`,children:[(0,J.jsx)(m,{className:`size-4 opacity-50`}),`Agents (`,c.length,`)`]}),(0,J.jsxs)(`div`,{className:`flex gap-1`,children:[(0,J.jsx)(`button`,{className:`btn btn-xs btn-ghost`,onClick:x,children:`Select All`}),(0,J.jsx)(`button`,{className:`btn btn-xs btn-ghost`,onClick:S,children:`None`})]})]}),(0,J.jsx)(`div`,{className:`grid gap-2`,children:c.map(e=>{let n=_.has(e.name),r=n||t.includes(e.name);return(0,J.jsx)(`button`,{className:`card bg-base-200 cursor-pointer transition-all text-left ${r?`ring-2 ring-primary ring-offset-1 ring-offset-base-100`:``} ${n?`opacity-60`:``}`,onClick:()=>!n&&y(e.name),disabled:n,children:(0,J.jsxs)(`div`,{className:`card-body p-3 flex-row items-center gap-3`,children:[(0,J.jsx)(`div`,{className:`text-xl shrink-0`,children:e.emoji||`🤖`}),(0,J.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,J.jsx)(`div`,{className:`font-semibold text-sm truncate`,children:e.displayName||e.name}),e.description&&(0,J.jsx)(`p`,{className:`text-xs text-base-content/50 truncate`,children:e.description})]}),n?(0,J.jsxs)(`span`,{className:`badge badge-sm badge-success gap-1`,children:[(0,J.jsx)(h,{className:`size-3`}),` Installed`]}):(0,J.jsx)(`input`,{type:`checkbox`,className:`checkbox checkbox-primary checkbox-sm`,checked:r,readOnly:!0,tabIndex:-1})]})},e.name)})})]}),u.length>0&&(0,J.jsxs)(`div`,{children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,J.jsxs)(`h3`,{className:`font-semibold text-sm flex items-center gap-2`,children:[(0,J.jsx)(N,{className:`size-4 opacity-50`}),`Skills (`,u.length,`)`]}),(0,J.jsxs)(`div`,{className:`flex gap-1`,children:[(0,J.jsx)(`button`,{className:`btn btn-xs btn-ghost`,onClick:C,children:`Select All`}),(0,J.jsx)(`button`,{className:`btn btn-xs btn-ghost`,onClick:w,children:`None`})]})]}),(0,J.jsx)(`div`,{className:`grid gap-2`,children:u.map(e=>{let t=v.has(e.name),n=t||r.includes(e.name);return(0,J.jsx)(`button`,{className:`card bg-base-200 cursor-pointer transition-all text-left ${n?`ring-2 ring-primary ring-offset-1 ring-offset-base-100`:``} ${t?`opacity-60`:``}`,onClick:()=>!t&&b(e.name),disabled:t,children:(0,J.jsxs)(`div`,{className:`card-body p-3 flex-row items-center gap-3`,children:[(0,J.jsx)(`div`,{className:`text-xl shrink-0`,children:e.emoji||`🧩`}),(0,J.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,J.jsx)(`div`,{className:`font-semibold text-sm truncate`,children:e.displayName||e.name}),e.description&&(0,J.jsx)(`p`,{className:`text-xs text-base-content/50 truncate`,children:e.description})]}),t?(0,J.jsxs)(`span`,{className:`badge badge-sm badge-success gap-1`,children:[(0,J.jsx)(h,{className:`size-3`}),` Installed`]}):(0,J.jsx)(`input`,{type:`checkbox`,className:`checkbox checkbox-primary checkbox-sm`,checked:n,readOnly:!0,tabIndex:-1})]})},e.name)})})]}),c.length===0&&u.length===0&&(0,J.jsx)(`div`,{className:`alert alert-info text-sm`,children:`No agents or skills found in the catalog. You can add them later from the settings page.`})]})}function Z({role:e,title:t,description:n,providerName:r,value:i,onChange:a,options:o,model:s,onModelChange:c,availableModels:l}){let u=Math.max(0,o.findIndex(e=>e.value===i)),d=o[u]||o[0],f=d.icon;return(0,J.jsx)(`div`,{className:`card bg-base-200`,children:(0,J.jsxs)(`div`,{className:`card-body p-5 gap-4`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h3`,{className:`font-semibold`,children:t}),(0,J.jsx)(`p`,{className:`text-xs text-base-content/60 mt-0.5`,children:n})]}),r&&(0,J.jsx)(`span`,{className:`badge badge-sm badge-soft badge-primary capitalize`,children:r})]}),l&&l.length>0&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`label`,{className:`text-xs text-base-content/50`,children:`Model`}),(0,J.jsx)(`select`,{className:`select select-sm select-bordered w-full`,value:s||``,onChange:e=>c?.(e.target.value),children:l.map(e=>(0,J.jsx)(`option`,{value:e.id,children:e.label||e.id},e.id))})]}),(0,J.jsxs)(`div`,{className:`flex flex-col items-center gap-2 py-2`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2 text-lg font-bold ${d.color}`,children:[(0,J.jsx)(f,{className:`size-6`}),d.label]}),(0,J.jsx)(`p`,{className:`text-xs text-base-content/50 text-center max-w-xs`,children:d.description})]}),(0,J.jsxs)(`div`,{className:`px-1`,children:[(0,J.jsx)(`input`,{type:`range`,min:0,max:o.length-1,value:u,onChange:e=>a(o[Number(e.target.value)].value),className:`range range-primary range-sm w-full`,step:1}),(0,J.jsx)(`div`,{className:`flex justify-between mt-1 px-0.5`,children:o.map(t=>(0,J.jsx)(`span`,{className:`text-[10px] ${t.value===d.value?d.color+` font-semibold`:`text-base-content/30`}`,children:t.label},`${e}-tick-${t.value}`))})]})]})})}function Ee({efforts:e,setEfforts:t,pipeline:n,models:r,setModels:i,modelsByProvider:a}){(0,B.useEffect)(()=>{for(let r of[`planner`,`executor`,`reviewer`]){let i=W(r,n),a=e[r];a&&!i.some(e=>e.value===a)&&t(e=>({...e,[r]:`high`}))}},[n,e,t]);let o=a?.[n?.planner]||[],s=a?.[n?.executor]||[],c=a?.[n?.reviewer]||[];return(0,J.jsxs)(`div`,{className:`flex flex-col gap-6 stagger-children`,children:[(0,J.jsxs)(`div`,{className:`text-center`,children:[(0,J.jsx)(j,{className:`size-10 text-primary mx-auto mb-3`}),(0,J.jsx)(`h2`,{className:`text-2xl font-bold`,children:`Models & Reasoning Effort`}),(0,J.jsx)(`p`,{className:`text-base-content/60 mt-1`,children:`Choose the model and reasoning depth for each pipeline stage.`})]}),(0,J.jsx)(Z,{role:`planner`,title:`Planning`,description:`Scopes the issue and decides the overall approach.`,providerName:n?.planner,value:e.planner,onChange:e=>t(t=>({...t,planner:e})),options:W(`planner`,n),model:r?.plan,onModelChange:e=>i(t=>({...t,plan:e})),availableModels:o}),(0,J.jsx)(Z,{role:`executor`,title:`Execution`,description:`Implements the plan — writes code, edits files.`,providerName:n?.executor,value:e.executor,onChange:e=>t(t=>({...t,executor:e})),options:W(`executor`,n),model:r?.execute,onModelChange:e=>i(t=>({...t,execute:e})),availableModels:s}),(0,J.jsx)(Z,{role:`reviewer`,title:`Review`,description:`Validates the result before approving.`,providerName:n?.reviewer,value:e.reviewer,onChange:e=>t(t=>({...t,reviewer:e})),options:W(`reviewer`,n),model:r?.review,onModelChange:e=>i(t=>({...t,review:e})),availableModels:c})]})}function De({concurrency:e,setConcurrency:t,selectedTheme:n,setSelectedTheme:r}){return(0,J.jsxs)(`div`,{className:`flex flex-col gap-6 stagger-children`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsxs)(`div`,{className:`text-center mb-4`,children:[(0,J.jsx)(y,{className:`size-10 text-primary mx-auto mb-3`}),(0,J.jsx)(`h2`,{className:`text-2xl font-bold`,children:`Workers & Theme`}),(0,J.jsx)(`p`,{className:`text-base-content/60 mt-1`,children:`Configure parallel workers and visual theme`})]}),(0,J.jsx)(`div`,{className:`card bg-base-200`,children:(0,J.jsxs)(`div`,{className:`card-body p-5 gap-3`,children:[(0,J.jsxs)(`h3`,{className:`font-semibold text-sm flex items-center gap-2`,children:[(0,J.jsx)(y,{className:`size-4 opacity-50`}),`Worker Concurrency`]}),(0,J.jsxs)(`p`,{className:`text-xs text-base-content/60`,children:[`How many agents can work in parallel (`,e,` worker`,e===1?``:`s`,`)`]}),(0,J.jsx)(`input`,{type:`range`,min:1,max:16,value:e,onChange:e=>t(Number(e.target.value)),className:`range range-primary range-sm`}),(0,J.jsxs)(`div`,{className:`flex justify-between text-xs text-base-content/40 px-1`,children:[(0,J.jsx)(`span`,{children:`1`}),(0,J.jsx)(`span`,{children:`4`}),(0,J.jsx)(`span`,{children:`8`}),(0,J.jsx)(`span`,{children:`12`}),(0,J.jsx)(`span`,{children:`16`})]})]})})]}),(0,J.jsx)(`div`,{className:`card bg-base-200`,children:(0,J.jsxs)(`div`,{className:`card-body p-5 gap-3`,children:[(0,J.jsxs)(`h3`,{className:`font-semibold text-sm flex items-center gap-2`,children:[(0,J.jsx)(x,{className:`size-4 opacity-50`}),`Theme`]}),(0,J.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:fe.map(e=>(0,J.jsx)(`button`,{className:`btn btn-sm ${n===e.value?`btn-primary`:`btn-soft`}`,onClick:()=>r(e.value),children:e.label},e.value))})]})})]})}function Oe({config:e,launching:t}){return(0,J.jsxs)(`div`,{className:`flex flex-col items-center text-center gap-6 stagger-children py-4`,children:[(0,J.jsx)(`div`,{className:`animate-bounce-in`,children:(0,J.jsx)(R,{className:`size-16 sm:size-20 text-primary mx-auto`})}),(0,J.jsx)(`h2`,{className:`text-2xl sm:text-3xl font-bold`,children:`You're All Set!`}),(0,J.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,J.jsx)(`div`,{className:`card bg-base-200 w-full max-w-sm`,children:(0,J.jsxs)(`div`,{className:`card-body p-4 gap-2 text-sm text-left`,children:[(0,J.jsxs)(`div`,{className:`flex justify-between gap-4`,children:[(0,J.jsx)(`span`,{className:`text-base-content/60`,children:`Queue title`}),(0,J.jsx)(`span`,{className:`font-semibold text-right break-words`,children:e.queueTitle||`fifony`})]}),(0,J.jsx)(`div`,{className:`divider my-0`}),(0,J.jsxs)(`div`,{className:`flex justify-between`,children:[(0,J.jsx)(`span`,{className:`text-base-content/60`,children:`Pipeline`}),(0,J.jsxs)(`span`,{className:`font-semibold capitalize text-xs font-mono`,children:[e.pipeline?.planner||`?`,` → `,e.pipeline?.executor||`?`,` → `,e.pipeline?.reviewer||`?`]})]}),(0,J.jsx)(`div`,{className:`divider my-0`}),(0,J.jsxs)(`div`,{className:`flex justify-between`,children:[(0,J.jsx)(`span`,{className:`text-base-content/60`,children:`Domains`}),(0,J.jsx)(`span`,{className:`font-semibold`,children:e.domains?.length>0?e.domains.length+` selected`:`none`})]}),(0,J.jsx)(`div`,{className:`divider my-0`}),(0,J.jsxs)(`div`,{className:`flex justify-between`,children:[(0,J.jsx)(`span`,{className:`text-base-content/60`,children:`Agents`}),(0,J.jsxs)(`span`,{className:`font-semibold`,children:[e.agents?.length||0,` to install`]})]}),(0,J.jsx)(`div`,{className:`divider my-0`}),(0,J.jsxs)(`div`,{className:`flex justify-between`,children:[(0,J.jsx)(`span`,{className:`text-base-content/60`,children:`Skills`}),(0,J.jsxs)(`span`,{className:`font-semibold`,children:[e.skills?.length||0,` to install`]})]}),(0,J.jsx)(`div`,{className:`divider my-0`}),(0,J.jsxs)(`div`,{className:`flex justify-between`,children:[(0,J.jsx)(`span`,{className:`text-base-content/60`,children:`Plan`}),(0,J.jsx)(`span`,{className:`font-semibold capitalize`,children:e.efforts.planner})]}),(0,J.jsx)(`div`,{className:`divider my-0`}),(0,J.jsxs)(`div`,{className:`flex justify-between`,children:[(0,J.jsx)(`span`,{className:`text-base-content/60`,children:`Execute`}),(0,J.jsx)(`span`,{className:`font-semibold capitalize`,children:e.efforts.executor})]}),(0,J.jsx)(`div`,{className:`divider my-0`}),(0,J.jsxs)(`div`,{className:`flex justify-between`,children:[(0,J.jsx)(`span`,{className:`text-base-content/60`,children:`Review`}),(0,J.jsx)(`span`,{className:`font-semibold capitalize`,children:e.efforts.reviewer})]}),(0,J.jsx)(`div`,{className:`divider my-0`}),(0,J.jsxs)(`div`,{className:`flex justify-between`,children:[(0,J.jsx)(`span`,{className:`text-base-content/60`,children:`Workers`}),(0,J.jsx)(`span`,{className:`font-semibold`,children:e.concurrency})]}),(0,J.jsx)(`div`,{className:`divider my-0`}),(0,J.jsxs)(`div`,{className:`flex justify-between`,children:[(0,J.jsx)(`span`,{className:`text-base-content/60`,children:`Theme`}),(0,J.jsx)(`span`,{className:`font-semibold capitalize`,children:e.theme})]})]})}),t&&(0,J.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-base-content/50`,children:[(0,J.jsx)(E,{className:`size-4 animate-spin`}),`Saving configuration & installing agents...`]})]})}function ke({onComplete:e}){let t=r(),n=a(),l=s(n.data),[d,p]=(0,B.useState)(0),[m,h]=(0,B.useState)(`forward`),[_,v]=(0,B.useState)(!1),[y,b]=(0,B.useState)(null),x=(0,B.useRef)(!1),S=(0,B.useRef)(!1),[T,E]=(0,B.useState)({planner:``,executor:``,reviewer:``}),[O,k]=(0,B.useState)(()=>me(null)),[A,j]=(0,B.useState)(3),[M,ne]=(0,B.useState)(`auto`),[N,P]=(0,B.useState)(null),[F,I]=(0,B.useState)(null),[re,ie]=(0,B.useState)(``),[L,ae]=(0,B.useState)(``),[oe,R]=(0,B.useState)(`missing`),[z,V]=(0,B.useState)(null),[H,le]=(0,B.useState)([]),[U,ue]=(0,B.useState)([]),[W,de]=(0,B.useState)([]),[fe,pe]=(0,B.useState)(!1),[K,be]=(0,B.useState)(!1),Y=ce(K),X=se(K)[d]||``,[Z,ke]=(0,B.useState)(null),[Ae,je]=(0,B.useState)(!1),[Me,Ne]=(0,B.useState)({}),[Q,Pe]=(0,B.useState)({plan:``,execute:``,review:``}),[Fe,Ie]=(0,B.useState)(``),[Le,Re]=(0,B.useState)(``);(0,B.useEffect)(()=>{i.get(`/state`).then(e=>{V(e||{}),Ie(e?.sourceRepoUrl||e?.config?.sourceRepo||``),Re(e?.config?.defaultBranch||``)}).catch(()=>{V({})})},[]),(0,B.useEffect)(()=>{if(x.current||n.isLoading)return;x.current=!0;let e=o(l,`runtime.agentProvider`,``),t=o(l,`runtime.defaultEffort`,null),r=o(l,`ui.theme`,`auto`),i=o(l,`runtime.workerConcurrency`,3);typeof e==`string`&&e.trim()&&E(t=>({planner:t.planner||e,executor:t.executor||e,reviewer:t.reviewer||e})),k(me(t)),typeof r==`string`&&r.trim()&&ne(r);let a=Number.parseInt(String(i??2),10);Number.isFinite(a)&&j(Math.min(16,Math.max(1,a)))},[l,n.isLoading]),(0,B.useEffect)(()=>{if(S.current||n.isLoading||z===null)return;S.current=!0;let e=g(l,z);ae(e.projectName),R(e.source)},[z,l,n.isLoading]);let ze=(0,B.useCallback)(e=>{ae(e),R(`manual`)},[]),$=C(L),Be=f($);(0,B.useEffect)(()=>{document.title=f($||z?.detectedProjectName||z?.projectName||``)},[$,z]),(0,B.useEffect)(()=>{d>=2&&Z===null&&(je(!0),Promise.all([i.get(`/providers`),i.get(`/config/workflow?details=1`).catch(()=>null)]).then(([e,t])=>{let n=Array.isArray(e)?e:e?.providers||[];ke(n);let r=t?.models||{};Ne(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};E(e=>({planner:e.planner||l.planner,executor:e.executor||l.executor,reviewer:e.reviewer||l.reviewer})),Pe(e=>({plan:e.plan||r[c]?.[0]?.id||``,execute:e.execute||r[s]?.[0]?.id||``,review:e.review||r[c]?.[0]?.id||``}))}).catch(()=>{ke([])}).finally(()=>{je(!1)}))},[d,Z]),(0,B.useEffect)(()=>{let e=M===`auto`?window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:M;document.documentElement.setAttribute(`data-theme`,e)},[M]);let Ve=(0,B.useCallback)(e=>{if(e===`Project`)$&&G(w,$,`system`).catch(()=>{});else if(e===`Providers`){let e=[{provider:T.planner,role:`planner`},{provider:T.executor,role:`executor`},{provider:T.reviewer,role:`reviewer`}];G(`runtime.agentProvider`,T.executor,`runtime`).catch(()=>{}),G(`runtime.pipeline`,e,`runtime`).catch(()=>{}),G(`runtime.workflowConfig`,q(T,O,Q),`runtime`).catch(()=>{})}else e===`Effort`?(G(`runtime.defaultEffort`,O,`runtime`).catch(()=>{}),G(`runtime.workflowConfig`,q(T,O,Q),`runtime`).catch(()=>{})):e===`Workers & Theme`&&(G(`ui.theme`,M,`ui`).catch(()=>{}),i.post(`/config/concurrency`,{concurrency:A}).catch(()=>{}))},[T,O,Q,A,M,$]),He=(0,B.useCallback)(()=>{d<Y-1&&(Ve(X),h(`forward`),p(e=>e+1))},[d,Y,X,Ve]),Ue=(0,B.useCallback)(()=>{d>0&&(h(`backward`),p(e=>e-1))},[d]),We=(0,B.useCallback)(async()=>{if($){v(!0);try{let n=[G(w,$,`system`),G(`ui.theme`,M,`ui`),G(`ui.onboarding.completed`,!0,`ui`)],r=[{provider:T.planner,role:`planner`},{provider:T.executor,role:`executor`},{provider:T.reviewer,role:`reviewer`}];n.push(G(`runtime.agentProvider`,T.executor,`runtime`)),n.push(G(`runtime.pipeline`,r,`runtime`)),n.push(G(`runtime.defaultEffort`,O,`runtime`)),n.push(G(`runtime.workflowConfig`,q(T,O,Q),`runtime`)),n.push(i.post(`/config/concurrency`,{concurrency:A})),U.length>0&&n.push(i.post(`/install/agents`,{agents:U})),W.length>0&&n.push(i.post(`/install/skills`,{skills:W})),await Promise.allSettled(n),t.setQueryData(c,e=>u(e,{id:w,scope:`system`,value:$,source:`user`,updatedAt:new Date().toISOString()})),t.setQueryData(c,e=>u(e,{id:`ui.onboarding.completed`,scope:`ui`,value:!0,source:`user`,updatedAt:new Date().toISOString()})),b({x:window.innerWidth/2,y:window.innerHeight/3}),setTimeout(()=>{t.invalidateQueries({queryKey:c}),e?.()},1200)}catch{t.setQueryData(c,e=>u(e,{id:w,scope:`system`,value:$,source:`user`,updatedAt:new Date().toISOString()})),t.setQueryData(c,e=>u(e,{id:`ui.onboarding.completed`,scope:`ui`,value:!0,source:`user`,updatedAt:new Date().toISOString()})),await G(`ui.onboarding.completed`,!0,`ui`).catch(()=>{}),t.invalidateQueries({queryKey:c}),e?.()}}},[$,T,O,Q,A,M,U,W,t,e]),Ge=X===`Welcome`||X===`Project`&&!!$||X===`Branch`||X===`Providers`&&(T.executor||Ae)||X===`Scan Project`||X===`Discover Issues`||X===`Domains`||X===`Agents & Skills`||X===`Effort`||X===`Workers & Theme`||X===`Launch`,Ke=(N?.existingAgents||[]).map(e=>typeof e==`string`?{name:e}:e),qe=(N?.existingSkills||[]).map(e=>typeof e==`string`?{name:e}:e),Je={projectName:$,queueTitle:Be,pipeline:T,efforts:O,concurrency:A,theme:M,domains:H,agents:U,skills:W};return(0,J.jsxs)(`div`,{className:`fixed inset-0 z-50 bg-base-100 flex flex-col overflow-hidden`,children:[(0,J.jsx)(D,{}),y&&(0,J.jsx)(ee,{x:y.x,y:y.y,active:!0,onDone:()=>b(null)}),d>0&&(0,J.jsx)(`div`,{className:`relative z-10 pt-6 pb-2 px-4 flex justify-center`,children:(0,J.jsx)(he,{current:d,wantsDiscovery:K})}),(0,J.jsx)(`div`,{className:`relative z-10 flex-1 flex flex-col items-center justify-start px-4 py-6 overflow-y-auto`,children:(0,J.jsxs)(ge,{direction:m,stepKey:d,center:X===`Welcome`||X===`Project`||X===`Branch`||X===`Providers`||X===`Launch`,children:[X===`Welcome`&&(0,J.jsx)(ve,{workspacePath:Fe,onGetStarted:He}),X===`Project`&&(0,J.jsx)(ye,{projectName:L,setProjectName:ze,detectedProjectName:z?.detectedProjectName||``,projectSource:oe,workspacePath:Fe}),X===`Branch`&&(0,J.jsx)(xe,{currentBranch:Le,onBranchCreated:e=>Re(e)}),X===`Providers`&&(0,J.jsx)(Se,{providers:Z||[],providersLoading:Ae,pipeline:T,setPipeline:E}),X===`Scan Project`&&(0,J.jsx)(Ce,{scanResult:N,setScanResult:P,projectDescription:re,setProjectDescription:ie,analysisResult:F,setAnalysisResult:I,selectedProvider:T.executor,analyzing:fe,setAnalyzing:pe,wantsDiscovery:K,setWantsDiscovery:be}),X===`Discover Issues`&&(0,J.jsx)(te,{}),X===`Domains`&&(0,J.jsx)(we,{selectedDomains:H,setSelectedDomains:le,analysisResult:F}),X===`Agents & Skills`&&(0,J.jsx)(Te,{selectedDomains:H,selectedAgents:U,setSelectedAgents:ue,selectedSkills:W,setSelectedSkills:de,existingAgents:Ke,existingSkills:qe}),X===`Effort`&&(0,J.jsx)(Ee,{efforts:O,setEfforts:k,pipeline:T,models:Q,setModels:Pe,modelsByProvider:Me}),X===`Workers & Theme`&&(0,J.jsx)(De,{concurrency:A,setConcurrency:j,selectedTheme:M,setSelectedTheme:ne}),X===`Launch`&&(0,J.jsx)(Oe,{config:Je,launching:_})]})}),(0,J.jsx)(_e,{step:d,stepCount:Y,stepName:X,canProceed:Ge,launching:_,onBack:Ue,onNext:He,onLaunch:We})]})}export{ke 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-CPpF6c4N.js";import{O as i,S as a,d as o,f as s,t as c}from"./zap-B9KQBsrr.js";import{t as l}from"./createLucideIcon-avOLE_av.js";import{O as u,S as d,c as f,g as p,h as m,s as h,x as g}from"./index-CYfsYYqt.js";var _=l(`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}=o(),{data:r}=s();if(t&&!e)return(0,y.jsx)(N,{});let l=e?.overall?.totalTokens||0,v=e?.byPhase||null,C=e?.byModel||{},T=i(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)(c,{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:l})}),(0,y.jsx)(`div`,{className:`stat-desc font-mono`,children:x(l)})]}),(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)(d,{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)(u,{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)(m,{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)(p,{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)(p,{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:d,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:p,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)(c,{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)(g,{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-CPpF6c4N.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};
|