fifony 0.1.11 → 0.1.12
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 +131 -51
- package/app/dist/assets/KeyboardShortcutsHelp-DI0LzTPt.js +1 -0
- package/app/dist/assets/OnboardingWizard-D14g4Av8.js +1 -0
- package/app/dist/assets/analytics.lazy--EwAzrll.js +1 -0
- package/app/dist/assets/createLucideIcon-DDy-XBQG.js +1 -0
- package/app/dist/assets/index-CFbxnygd.js +42 -0
- package/app/dist/assets/index-Cdczus0s.css +1 -0
- package/app/dist/assets/rolldown-runtime-DF2fYuay.js +1 -0
- package/app/dist/assets/vendor-BoGBoEwT.js +9 -0
- package/app/dist/index.html +6 -5
- package/app/dist/service-worker.js +40 -3
- package/app/public/service-worker.js +40 -3
- package/bin/fifony.js +15 -6
- package/dist/{chunk-LH5V2WV2.js → chunk-JUSVR3DW.js} +4 -10
- package/dist/{chunk-LH5V2WV2.js.map → chunk-JUSVR3DW.js.map} +1 -1
- package/dist/mcp/server.js +602 -5
- package/dist/mcp/server.js.map +1 -1
- package/dist/runtime/run-local.js +960 -607
- package/dist/runtime/run-local.js.map +1 -1
- package/package.json +5 -2
- package/app/dist/assets/index-BE3a-eEo.js +0 -13
package/README.md
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
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
|
|
|
7
7
|
Point at a repo. Open the dashboard. AI plans, builds, and reviews — you approve.
|
|
8
8
|
|
|
9
9
|
One command. Full orchestra.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
[](LICENSE)
|
|
12
|
+
[]()
|
|
12
13
|
|
|
13
14
|
</div>
|
|
14
15
|
|
|
@@ -20,31 +21,53 @@ One command. Full orchestra.
|
|
|
20
21
|
npx -y fifony --port 4040
|
|
21
22
|
```
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
Open **http://localhost:4040**. First run launches the **onboarding wizard** — it detects your CLIs, scans your project, and configures everything.
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
State lives in `.fifony/`. No accounts, no cloud, no setup.
|
|
26
27
|
|
|
27
28
|
---
|
|
28
29
|
|
|
29
|
-
##
|
|
30
|
+
## What Makes Fifony Different
|
|
31
|
+
|
|
32
|
+
### Mixed-Agent Pipeline
|
|
33
|
+
|
|
34
|
+
The core idea: **different AI providers handle different stages** of a single task.
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
Plan Execute Review
|
|
38
|
+
┌─────────┐ ┌─────────┐ ┌─────────┐
|
|
39
|
+
│ Claude │──▶│ Codex │──▶│ Claude │
|
|
40
|
+
│ Opus 4.6 │ │ │ │ Sonnet │
|
|
41
|
+
│ high │ │ medium │ │ medium │
|
|
42
|
+
└─────────┘ └─────────┘ └─────────┘
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Claude plans. Codex executes. Claude reviews. Each stage gets its own **provider**, **model**, and **reasoning effort** — configurable per-project in Settings → Workflow.
|
|
46
|
+
|
|
47
|
+
### Onboarding Wizard
|
|
30
48
|
|
|
31
|
-
|
|
32
|
-
Open the dashboard, click "+", type what you want done. The issue starts in **Planning**.
|
|
49
|
+
First run detects your environment and walks you through setup:
|
|
33
50
|
|
|
34
|
-
|
|
35
|
-
|
|
51
|
+
1. **Pipeline** — Choose which CLI runs each stage (planner, executor, reviewer)
|
|
52
|
+
2. **Project Scan** — AI analyzes your codebase to detect language, stack, and domains
|
|
53
|
+
3. **Domains** — Pre-selected by AI, 21 options across Technical/Industry/Role
|
|
54
|
+
4. **Agents & Skills** — Curated catalog of 15 agents and 5 skills, auto-recommended by domain
|
|
55
|
+
5. **Effort** — Per-stage reasoning effort, reactive to which CLI is selected
|
|
56
|
+
6. **Workers & Theme** — Parallel worker count + visual theme
|
|
36
57
|
|
|
37
|
-
|
|
38
|
-
Review the plan. Approve it → the issue moves to **Todo** and agents pick it up automatically.
|
|
58
|
+
Settings saved progressively. Re-run anytime from Settings.
|
|
39
59
|
|
|
40
|
-
###
|
|
41
|
-
The configured executor agent (Claude or Codex) implements the changes in an isolated workspace. You can watch live output in the Agents tab.
|
|
60
|
+
### Language Agnostic
|
|
42
61
|
|
|
43
|
-
|
|
44
|
-
A reviewer agent inspects the diff and either approves (→ Done), requests rework (→ back to execution), or blocks for human intervention.
|
|
62
|
+
The project scanner works with any codebase — it detects build files for 18+ ecosystems:
|
|
45
63
|
|
|
46
|
-
|
|
47
|
-
|
|
64
|
+
`package.json` · `Cargo.toml` · `pyproject.toml` · `go.mod` · `build.gradle` · `Gemfile` · `mix.exs` · `pubspec.yaml` · `CMakeLists.txt` · `composer.json` · `Package.swift` · `deno.json` · `pom.xml` · `Dockerfile` · and more
|
|
65
|
+
|
|
66
|
+
Uses the detected CLI with `--reasoning-effort low` for fast, accurate analysis.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## How It Works
|
|
48
71
|
|
|
49
72
|
```
|
|
50
73
|
Planning → Todo → Queued → Running → In Review → Done
|
|
@@ -52,40 +75,81 @@ Planning → Todo → Queued → Running → In Review → Done
|
|
|
52
75
|
└──── Blocked ←── Rework ──────────────┘
|
|
53
76
|
```
|
|
54
77
|
|
|
78
|
+
1. **Create an Issue** — Click "+", describe what you want done
|
|
79
|
+
2. **AI Plans It** — Structured execution plan with steps, risks, file paths, complexity
|
|
80
|
+
3. **You Approve** — Review the plan, approve → agents pick it up
|
|
81
|
+
4. **Agents Execute** — Isolated workspace, live output streaming, PID tracking
|
|
82
|
+
5. **Automated Review** — Diff inspection, approve/rework/block decision
|
|
83
|
+
6. **You Ship** — Review the diff, merge
|
|
84
|
+
|
|
55
85
|
---
|
|
56
86
|
|
|
57
87
|
## Dashboard
|
|
58
88
|
|
|
59
|
-
Start with `--port` and get a full browser UI:
|
|
60
|
-
|
|
61
89
|
| Page | What you see |
|
|
62
90
|
|------|-------------|
|
|
63
|
-
| **Kanban** |
|
|
64
|
-
| **Issues** | Searchable
|
|
65
|
-
| **Agents** | Live cockpit
|
|
66
|
-
| **Settings** | Workflow
|
|
91
|
+
| **Kanban** | Drag-and-drop board. Cards flow through the pipeline with state-colored borders and stagger animations. |
|
|
92
|
+
| **Issues** | Searchable list with descriptions, labels, token usage, duration, and filter chips by state. |
|
|
93
|
+
| **Agents** | Live cockpit with agent slots, real-time log output, queue, token usage sparkline. |
|
|
94
|
+
| **Settings** | Tabbed: General, Workflow (pipeline config), Notifications, Providers. |
|
|
67
95
|
|
|
68
|
-
###
|
|
96
|
+
### Kanban Drag & Drop
|
|
69
97
|
|
|
70
|
-
|
|
98
|
+
Drag issues between columns to change state. Works on desktop (click + drag) and mobile (long-press). Valid drop targets highlight green, invalid ones dim. State machine enforces valid transitions only.
|
|
71
99
|
|
|
72
|
-
|
|
73
|
-
|-------|---------|-------------|
|
|
74
|
-
| **Plan** | Claude Sonnet (high effort) | Generates structured execution plan |
|
|
75
|
-
| **Execute** | Codex (medium effort) | Implements the code changes |
|
|
76
|
-
| **Review** | Claude Sonnet (medium effort) | Reviews the diff and decides pass/rework |
|
|
100
|
+
### Micro-interactions
|
|
77
101
|
|
|
78
|
-
|
|
102
|
+
Every interaction has visual feedback:
|
|
103
|
+
|
|
104
|
+
- **Cards** lift on hover with state-colored left border
|
|
105
|
+
- **Running cards** pulse with a breathing border glow
|
|
106
|
+
- **Buttons** scale on press, hover lift
|
|
107
|
+
- **Toasts** slide in with progress bar, typed as success/error/info
|
|
108
|
+
- **Drawers** slide in/out with backdrop fade
|
|
109
|
+
- **View transitions** fade between routes
|
|
110
|
+
- **Theme changes** cross-fade in 300ms
|
|
111
|
+
- **Counters** bounce when values change
|
|
112
|
+
- **Skeleton loaders** shimmer during initial load
|
|
113
|
+
- **Empty states** animate in with helpful guidance
|
|
114
|
+
- **Confetti** bursts on issue creation
|
|
79
115
|
|
|
80
116
|
### PWA
|
|
81
117
|
|
|
82
|
-
Install
|
|
118
|
+
Install as a desktop app. Works offline. Desktop notifications when issues change state. Service worker with stale-while-revalidate caching.
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Agent & Skill Catalog
|
|
123
|
+
|
|
124
|
+
Fifony ships with a curated catalog of specialist agents:
|
|
125
|
+
|
|
126
|
+
| Agent | Domain |
|
|
127
|
+
|-------|--------|
|
|
128
|
+
| Frontend Developer | React, Vue, CSS, responsive design |
|
|
129
|
+
| Backend Architect | APIs, microservices, scalable systems |
|
|
130
|
+
| Database Optimizer | Schema design, query optimization, indexing |
|
|
131
|
+
| Security Engineer | OWASP, threat modeling, secure code review |
|
|
132
|
+
| DevOps Automator | CI/CD, Docker, Kubernetes, cloud infra |
|
|
133
|
+
| Mobile App Builder | iOS, Android, React Native, Flutter |
|
|
134
|
+
| AI Engineer | ML models, LLM integration, data pipelines |
|
|
135
|
+
| UI Designer | Visual design, component libraries, design systems |
|
|
136
|
+
| UX Architect | UX patterns, accessibility, information architecture |
|
|
137
|
+
| Code Reviewer | Code quality, best practices, constructive feedback |
|
|
138
|
+
| Technical Writer | Docs, READMEs, API references, tutorials |
|
|
139
|
+
| SRE | Reliability, observability, incident response |
|
|
140
|
+
| Data Engineer | ETL, data warehousing, analytics infrastructure |
|
|
141
|
+
| Software Architect | System design, DDD, architectural patterns |
|
|
142
|
+
| Game Designer | Game mechanics, level design, cross-engine |
|
|
143
|
+
|
|
144
|
+
Skills: `commit`, `review-pr`, `debug`, `testing`, `impeccable` (frontend design).
|
|
145
|
+
|
|
146
|
+
Agents are installed to `.claude/agents/` during onboarding. Compatible with both Claude Code and Codex CLI.
|
|
83
147
|
|
|
84
148
|
---
|
|
85
149
|
|
|
86
150
|
## MCP Server
|
|
87
151
|
|
|
88
|
-
|
|
152
|
+
Use Fifony as tools inside your editor:
|
|
89
153
|
|
|
90
154
|
```bash
|
|
91
155
|
npx -y fifony mcp
|
|
@@ -102,30 +166,32 @@ npx -y fifony mcp
|
|
|
102
166
|
}
|
|
103
167
|
```
|
|
104
168
|
|
|
105
|
-
Create issues, check status, review workflows —
|
|
169
|
+
Create issues, check status, review workflows — without leaving the editor.
|
|
106
170
|
|
|
107
171
|
---
|
|
108
172
|
|
|
109
173
|
## API
|
|
110
174
|
|
|
111
|
-
|
|
175
|
+
REST + WebSocket API with auto-generated OpenAPI docs:
|
|
112
176
|
|
|
113
177
|
```
|
|
114
178
|
http://localhost:4040/docs
|
|
115
179
|
```
|
|
116
180
|
|
|
117
|
-
Key endpoints:
|
|
118
|
-
|
|
119
181
|
| Endpoint | Description |
|
|
120
182
|
|----------|-------------|
|
|
121
|
-
| `GET /api/state` |
|
|
183
|
+
| `GET /api/state` | Runtime state with issues, metrics, config |
|
|
122
184
|
| `POST /api/issues/create` | Create a new issue |
|
|
123
|
-
| `POST /api/issues/:id/plan` | Generate AI plan
|
|
124
|
-
| `POST /api/issues/:id/approve` | Approve plan
|
|
185
|
+
| `POST /api/issues/:id/plan` | Generate AI execution plan |
|
|
186
|
+
| `POST /api/issues/:id/approve` | Approve plan, start execution |
|
|
125
187
|
| `GET /api/live/:id` | Live agent output (PID, log tail, elapsed) |
|
|
126
188
|
| `GET /api/diff/:id` | Git diff of workspace changes |
|
|
127
|
-
| `GET /api/config/workflow` |
|
|
128
|
-
| `GET /api/
|
|
189
|
+
| `GET /api/config/workflow` | Pipeline workflow configuration |
|
|
190
|
+
| `GET /api/scan/project` | Project structure scan |
|
|
191
|
+
| `POST /api/scan/analyze` | AI-powered project analysis |
|
|
192
|
+
| `GET /api/catalog/agents` | Agent catalog (filterable by domain) |
|
|
193
|
+
| `POST /api/install/agents` | Install agents to project |
|
|
194
|
+
| `GET /api/settings` | All persisted settings |
|
|
129
195
|
| `/ws` | WebSocket for real-time state updates |
|
|
130
196
|
|
|
131
197
|
---
|
|
@@ -139,7 +205,7 @@ npx -y fifony --port 4040
|
|
|
139
205
|
# Dev mode — Vite HMR on port+1
|
|
140
206
|
npx -y fifony --port 4040 --dev
|
|
141
207
|
|
|
142
|
-
# Headless —
|
|
208
|
+
# Headless — scheduler only, no UI
|
|
143
209
|
npx -y fifony
|
|
144
210
|
|
|
145
211
|
# MCP server — stdio for editor integration
|
|
@@ -154,22 +220,36 @@ npx -y fifony --workspace /path/to/repo --port 4040
|
|
|
154
220
|
## Architecture
|
|
155
221
|
|
|
156
222
|
```
|
|
157
|
-
.fifony/
|
|
158
|
-
s3db/
|
|
159
|
-
source/
|
|
160
|
-
workspaces/
|
|
223
|
+
.fifony/ ← all state (gitignore it)
|
|
224
|
+
s3db/ ← durable database (issues, events, sessions, settings)
|
|
225
|
+
source/ ← codebase snapshot
|
|
226
|
+
workspaces/ ← isolated per-issue agent workspaces
|
|
161
227
|
```
|
|
162
228
|
|
|
163
|
-
**Persistence**: [s3db.js](https://github.com/forattini-dev/s3db.js)
|
|
229
|
+
**Persistence**: [s3db.js](https://github.com/forattini-dev/s3db.js) — filesystem-backed database. Issues, events, settings, agent sessions — all persisted and recoverable across restarts.
|
|
164
230
|
|
|
165
231
|
**State Machine**: `Planning → Todo → Queued → Running → Interrupted → In Review → Blocked → Done → Cancelled`
|
|
166
232
|
|
|
167
233
|
**Agent Protection**: Detached child processes survive server restarts. PID tracking for recovery. Graceful shutdown marks running issues as Interrupted.
|
|
168
234
|
|
|
169
|
-
**Token
|
|
235
|
+
**Token Tracking**: Per-model token usage with daily/weekly rollups and cost estimates.
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
## Credits
|
|
240
|
+
|
|
241
|
+
Fifony is built on the shoulders of:
|
|
242
|
+
|
|
243
|
+
- **[OpenAI Codex CLI](https://github.com/openai/codex)** — Original foundation (Apache 2.0). See [NOTICE](NOTICE) and [THIRD-PARTY-NOTICES](THIRD-PARTY-NOTICES.md).
|
|
244
|
+
- **[Agency Agents](https://github.com/msitarzewski/agency-agents)** — Inspiration for the agent catalog.
|
|
245
|
+
- **[Impeccable](https://github.com/pbakaus/impeccable)** — Frontend design skill system by Paul Bakaus.
|
|
246
|
+
- **[s3db.js](https://github.com/forattini-dev/s3db.js)** — Filesystem-backed persistence layer.
|
|
247
|
+
- **[DaisyUI](https://daisyui.com)** — Component library for the dashboard.
|
|
170
248
|
|
|
171
249
|
---
|
|
172
250
|
|
|
173
251
|
## License
|
|
174
252
|
|
|
175
|
-
|
|
253
|
+
Apache License 2.0 — see [LICENSE](LICENSE) for details.
|
|
254
|
+
|
|
255
|
+
This project includes code from OpenAI Codex CLI. See [NOTICE](NOTICE) for attribution.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DF2fYuay.js";import{I as t,h as n}from"./vendor-BoGBoEwT.js";import{t as r}from"./createLucideIcon-DDy-XBQG.js";import{r as i}from"./index-CFbxnygd.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-BoGBoEwT.js";import{t as i}from"./createLucideIcon-DDy-XBQG.js";import{E as a,S as o,_ as s,b as c,c as l,d as u,f as d,g as f,h as p,i as m,l as h,n as g,o as _,s as v,t as y,v as b,w as x,x as S}from"./index-CFbxnygd.js";var C=i(`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`}]]),w=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`}]]),T=i(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),E=i(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),D=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`}]]),O=i(`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`}]]),k=i(`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`}]]),A=i(`music`,[[`path`,{d:`M9 18V5l12-2v13`,key:`1jmyc2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`circle`,{cx:`18`,cy:`16`,r:`3`,key:`1hluhg`}]]),j=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`}]]),M=e(t(),1),N=n();function ee(){let e=(0,M.useRef)(null),t=(0,M.useRef)([]),n=(0,M.useRef)(null),r=[`♪`,`♫`,`♩`,`♬`,`★`,`●`],i=[`oklch(0.75 0.15 250 / 0.35)`,`oklch(0.80 0.14 200 / 0.30)`,`oklch(0.70 0.18 330 / 0.25)`,`oklch(0.85 0.12 85 / 0.30)`,`oklch(0.75 0.16 145 / 0.28)`,`oklch(0.80 0.10 280 / 0.22)`],a=(0,M.useCallback)((e,t)=>({x:Math.random()*e,y:Math.random()*t,vx:(Math.random()-.5)*.4,vy:-Math.random()*.3-.1,size:Math.random()*16+10,symbol:r[Math.floor(Math.random()*r.length)],color:i[Math.floor(Math.random()*i.length)],rotation:Math.random()*360,rotationSpeed:(Math.random()-.5)*.8,opacity:Math.random()*.4+.15,pulseOffset:Math.random()*Math.PI*2}),[]);return(0,M.useEffect)(()=>{let r=e.current;if(!r)return;let i=r.getContext(`2d`),o=()=>{let e=window.devicePixelRatio||1;r.width=window.innerWidth*e,r.height=window.innerHeight*e,r.style.width=window.innerWidth+`px`,r.style.height=window.innerHeight+`px`,i.scale(e,e)};o();let s=Math.min(Math.floor(window.innerWidth*window.innerHeight/18e3),40);t.current=Array.from({length:s},()=>a(window.innerWidth,window.innerHeight));let c=()=>{let e=window.innerWidth,r=window.innerHeight;i.clearRect(0,0,e,r);let a=Date.now()/1e3;for(let n of t.current){n.x+=n.vx,n.y+=n.vy,n.rotation+=n.rotationSpeed,n.y<-30&&(n.y=r+30,n.x=Math.random()*e),n.x<-30&&(n.x=e+30),n.x>e+30&&(n.x=-30);let t=Math.sin(a*1.5+n.pulseOffset)*.15+.85;i.save(),i.translate(n.x,n.y),i.rotate(n.rotation*Math.PI/180),i.globalAlpha=n.opacity*t,i.font=`${n.size}px serif`,i.textAlign=`center`,i.textBaseline=`middle`,i.fillStyle=n.color,i.fillText(n.symbol,0,0),i.restore()}n.current=requestAnimationFrame(c)};return n.current=requestAnimationFrame(c),window.addEventListener(`resize`,o),()=>{cancelAnimationFrame(n.current),window.removeEventListener(`resize`,o)}},[a]),(0,N.jsx)(`canvas`,{ref:e,className:`fixed inset-0 pointer-events-none`,style:{zIndex:0},"aria-hidden":`true`})}var P=8,F=[{value:`low`,label:`Low`,icon:g,description:`Quick and light -- fast responses, less thorough`,color:`text-info`},{value:`medium`,label:`Medium`,icon:u,description:`Balanced -- good mix of speed and quality`,color:`text-success`},{value:`high`,label:`High`,icon:w,description:`Thorough -- deeper analysis, takes more time`,color:`text-warning`},{value:`extra-high`,label:`Extra High`,icon:D,description:`Maximum depth -- most thorough, slowest`,color:`text-error`}],I={codex:F,claude:F.filter(e=>e.value!==`extra-high`)};function L(e,t){return I[t?.[e]||`claude`]||F}var R=[{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:`📊`}]}],z=[{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`}];async function B(e,t,n=`ui`){return a.post(`/settings/${encodeURIComponent(e)}`,{value:t,scope:n,source:`user`})}function V(e,t=`medium`){return F.some(t=>t.value===e)?e:t}function H(e){return!e||typeof e!=`object`||Array.isArray(e)?{planner:`medium`,executor:`medium`,reviewer:`medium`}:{planner:V(e.planner??e.default,`medium`),executor:V(e.executor??e.default,`medium`),reviewer:V(e.reviewer??e.default,`medium`)}}var U=[`Pipeline`,`Scan`,`Domains`,`Agents`,`Effort`,`Workers & Theme`,`Launch`];function te({current:e}){let t=e-1;return(0,N.jsx)(`ul`,{className:`steps steps-horizontal w-full max-w-2xl text-xs`,children:U.map((e,n)=>{let r=n<t,i=n===t;return(0,N.jsx)(`li`,{"data-content":r?`✓`:n+1,className:`step ${r||i?`step-primary`:``}`,style:{transition:`color 0.3s ease`},children:e},e)})})}function ne({direction:e,stepKey:t,center:n,children:r}){return(0,N.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 re({workspacePath:e}){return(0,N.jsxs)(`div`,{className:`flex flex-col items-center text-center gap-6 stagger-children py-4`,children:[(0,N.jsx)(`div`,{className:`text-6xl sm:text-7xl animate-bounce-in`,children:(0,N.jsx)(A,{className:`size-16 sm:size-20 text-primary mx-auto`})}),(0,N.jsxs)(`h1`,{className:`text-3xl sm:text-4xl font-bold tracking-tight`,children:[`Welcome to `,(0,N.jsx)(`span`,{className:`text-primary`,children:`Fifony`})]}),(0,N.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,N.jsxs)(`div`,{className:`badge badge-lg badge-soft badge-primary gap-2`,children:[(0,N.jsx)(_,{className:`size-3.5`}),e]})]})}var W=[{role:`planner`,label:`Planner`,description:`Scopes the issue, breaks it into steps, and decides the approach`,icon:w,color:`text-info`},{role:`executor`,label:`Executor`,description:`Implements the plan — writes code, edits files, runs commands`,icon:g,color:`text-primary`},{role:`reviewer`,label:`Reviewer`,description:`Validates the result — checks correctness, scope, and quality`,icon:v,color:`text-secondary`}];function ie({providers:e,providersLoading:t,pipeline:n,setPipeline:r}){let i=Array.isArray(e)?e:[],a=i.filter(e=>e.available!==!1);return(0,N.jsxs)(`div`,{className:`flex flex-col gap-6 stagger-children`,children:[(0,N.jsxs)(`div`,{className:`text-center`,children:[(0,N.jsx)(j,{className:`size-10 text-primary mx-auto mb-3`}),(0,N.jsx)(`h2`,{className:`text-2xl font-bold`,children:`Agent Pipeline`}),(0,N.jsx)(`p`,{className:`text-base-content/60 mt-1`,children:`Choose which CLI runs each stage of the pipeline`})]}),t?(0,N.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-8`,children:[(0,N.jsx)(h,{className:`size-8 text-primary animate-spin`}),(0,N.jsx)(`p`,{className:`text-sm text-base-content/50`,children:`Detecting available CLIs...`})]}):a.length===0?(0,N.jsx)(`div`,{className:`alert alert-warning text-sm`,children:`No providers detected. Make sure claude or codex CLI is installed.`}):(0,N.jsxs)(N.Fragment,{children:[(0,N.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,N.jsxs)(`span`,{className:`badge badge-lg gap-2 ${n?`badge-success`:`badge-ghost opacity-50`}`,children:[n?(0,N.jsx)(f,{className:`size-3.5`}):(0,N.jsx)(p,{className:`size-3.5`}),t,e.path&&(0,N.jsx)(`span`,{className:`font-mono text-[10px] opacity-60 hidden sm:inline`,children:e.path})]},t)})}),(0,N.jsx)(`div`,{className:`flex flex-col items-center gap-2`,children:W.map((e,t)=>{let i=e.icon,o=n[e.role]||a[0]?.name||``;return(0,N.jsxs)(`div`,{className:`w-full`,children:[t>0&&(0,N.jsx)(`div`,{className:`flex justify-center py-1`,children:(0,N.jsx)(E,{className:`size-5 rotate-90 opacity-30`})}),(0,N.jsx)(`div`,{className:`card bg-base-200`,children:(0,N.jsxs)(`div`,{className:`card-body p-4 flex-row items-center gap-4`,children:[(0,N.jsx)(`div`,{className:`size-10 rounded-full flex items-center justify-center bg-base-300 ${e.color}`,children:(0,N.jsx)(i,{className:`size-5`})}),(0,N.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,N.jsx)(`div`,{className:`font-semibold`,children:e.label}),(0,N.jsx)(`p`,{className:`text-xs text-base-content/50`,children:e.description})]}),(0,N.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,N.jsx)(`option`,{value:t,children:t},t)})})]})})]},e.role)})}),(0,N.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.`})]})]})}function ae({scanResult:e,setScanResult:t,projectDescription:n,setProjectDescription:r,analysisResult:i,setAnalysisResult:o,selectedProvider:s,analyzing:c,setAnalyzing:l}){let[u,m]=(0,M.useState)(!1),[g,v]=(0,M.useState)(null),[y,x]=(0,M.useState)(null),S=(0,M.useRef)(!1);(0,M.useEffect)(()=>{S.current||e||(S.current=!0,m(!0),v(null),a.get(`/scan/project`).then(e=>{if(t(e),!n){let t=e?.packageDescription||e?.packageInfo?.description||e?.readmeExcerpt||``;t&&r(t)}s&&!i&&(l(!0),a.post(`/scan/analyze`,{provider:s}).then(e=>{o(e),e.description&&r(e.description)}).catch(()=>{}).finally(()=>l(!1)))}).catch(e=>v(e.message||`Failed to scan project`)).finally(()=>m(!1)))},[]);let w=(0,M.useCallback)(async()=>{l(!0),x(null);try{let e=await a.post(`/scan/analyze`,{provider:s||`claude`});o(e),e.description&&r(e.description)}catch(e){x(e.message||`Analysis failed`)}finally{l(!1)}},[s,l,o,r]),T={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/`},E=e?.files||{},D=Object.entries(E).map(([e,t])=>({path:T[e]||e,exists:!!t})),k=(e?.existingAgents||[]).map(e=>typeof e==`string`?{name:e}:e),A=(e?.existingSkills||[]).map(e=>typeof e==`string`?{name:e}:e),j=i?.stack||[];return(0,N.jsxs)(`div`,{className:`flex flex-col gap-6 stagger-children`,children:[(0,N.jsxs)(`div`,{className:`text-center`,children:[(0,N.jsx)(O,{className:`size-10 text-primary mx-auto mb-3`}),(0,N.jsx)(`h2`,{className:`text-2xl font-bold`,children:`Scan Project`}),(0,N.jsx)(`p`,{className:`text-base-content/60 mt-1`,children:`We'll analyze your workspace to suggest the best setup`})]}),u&&(0,N.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-6`,children:[(0,N.jsx)(h,{className:`size-8 text-primary animate-spin`}),(0,N.jsx)(`p`,{className:`text-sm text-base-content/50`,children:`Scanning project files...`})]}),g&&(0,N.jsx)(`div`,{className:`alert alert-warning text-sm`,children:g}),e&&!u&&(0,N.jsx)(`div`,{className:`card bg-base-200`,children:(0,N.jsxs)(`div`,{className:`card-body p-4 gap-3`,children:[(0,N.jsxs)(`h3`,{className:`font-semibold text-sm flex items-center gap-2`,children:[(0,N.jsx)(d,{className:`size-4 opacity-50`}),`Project Files`]}),(0,N.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-1.5`,children:D.map(e=>(0,N.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[e.exists?(0,N.jsx)(f,{className:`size-4 text-success shrink-0`}):(0,N.jsx)(p,{className:`size-4 text-base-content/30 shrink-0`}),(0,N.jsx)(`span`,{className:`font-mono text-xs truncate ${e.exists?``:`text-base-content/40`}`,children:e.path})]},e.path))}),(k.length>0||A.length>0)&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`div`,{className:`divider my-0`}),(0,N.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[k.length>0&&(0,N.jsxs)(`span`,{className:`badge badge-sm badge-info gap-1`,children:[(0,N.jsx)(b,{className:`size-3`}),k.length,` agent`,k.length===1?``:`s`,` found`]}),A.length>0&&(0,N.jsxs)(`span`,{className:`badge badge-sm badge-secondary gap-1`,children:[(0,N.jsx)(C,{className:`size-3`}),A.length,` skill`,A.length===1?``:`s`,` found`]})]})]})]})}),!c&&!i&&(0,N.jsxs)(`button`,{className:`btn btn-primary btn-lg gap-2 mx-auto`,onClick:w,disabled:u,children:[(0,N.jsx)(_,{className:`size-5`}),`Analyze with AI`]}),c&&(0,N.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-4`,children:[(0,N.jsx)(h,{className:`size-8 text-primary animate-spin`}),(0,N.jsx)(`p`,{className:`text-sm text-base-content/50`,children:`AI is analyzing your project...`})]}),y&&(0,N.jsx)(`div`,{className:`alert alert-warning text-sm`,children:`Analysis failed. You can describe your project manually below.`}),j.length>0&&(0,N.jsx)(`div`,{className:`flex flex-wrap gap-2 justify-center`,children:j.map(e=>(0,N.jsx)(`span`,{className:`badge badge-sm badge-soft badge-primary`,children:e},e))}),(e||i||y)&&!u&&!c&&(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`label text-sm font-medium`,children:`Project Description`}),(0,N.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)})]})]})}function oe({selectedDomains:e,setSelectedDomains:t,analysisResult:n}){let r=(0,M.useRef)(!1);(0,M.useEffect)(()=>{r.current||!n?.domains?.length||e.length>0||(r.current=!0,t(n.domains))},[n]);let i=(0,M.useCallback)(e=>{t(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[t]);return(0,N.jsxs)(`div`,{className:`flex flex-col gap-6 stagger-children`,children:[(0,N.jsxs)(`div`,{className:`text-center`,children:[(0,N.jsx)(k,{className:`size-10 text-primary mx-auto mb-3`}),(0,N.jsx)(`h2`,{className:`text-2xl font-bold`,children:`Domains`}),(0,N.jsx)(`p`,{className:`text-base-content/60 mt-1`,children:`Select the domains relevant to your project`})]}),R.map(t=>(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-wider text-base-content/40 mb-2`,children:t.label}),(0,N.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t.domains.map(t=>(0,N.jsxs)(`button`,{className:`btn btn-sm gap-1.5 ${e.includes(t.value)?`btn-primary`:`btn-soft`}`,onClick:()=>i(t.value),children:[(0,N.jsx)(`span`,{children:t.emoji}),t.label]},t.value))})]},t.label))]})}function se({selectedDomains:e,selectedAgents:t,setSelectedAgents:n,selectedSkills:r,setSelectedSkills:i,existingAgents:o,existingSkills:c}){let[l,u]=(0,M.useState)([]),[d,f]=(0,M.useState)([]),[p,m]=(0,M.useState)(!1),g=(0,M.useRef)(!1);(0,M.useEffect)(()=>{if(g.current)return;g.current=!0,m(!0);let s=e.length>0?`?domains=${e.join(`,`)}`:``;Promise.all([a.get(`/catalog/agents${s}`).catch(()=>({agents:[]})),a.get(`/catalog/skills`).catch(()=>({skills:[]}))]).then(([e,a])=>{let s=e?.agents||[],l=a?.skills||[];u(s),f(l);let d=new Set((o||[]).map(e=>e.name)),p=s.filter(e=>!d.has(e.name)).map(e=>e.name);p.length>0&&t.length===0&&n(p);let m=new Set((c||[]).map(e=>e.name)),h=l.filter(e=>!m.has(e.name)).map(e=>e.name);h.length>0&&r.length===0&&i(h)}).finally(()=>m(!1))},[]);let _=new Set((o||[]).map(e=>e.name)),v=new Set((c||[]).map(e=>e.name)),y=(0,M.useCallback)(e=>{n(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[n]),x=(0,M.useCallback)(e=>{i(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[i]),S=(0,M.useCallback)(()=>{n(l.filter(e=>!_.has(e.name)).map(e=>e.name))},[l,_,n]),w=(0,M.useCallback)(()=>n([]),[n]),T=(0,M.useCallback)(()=>{i(d.filter(e=>!v.has(e.name)).map(e=>e.name))},[d,v,i]),E=(0,M.useCallback)(()=>i([]),[i]);return p?(0,N.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-12`,children:[(0,N.jsx)(h,{className:`size-8 text-primary animate-spin`}),(0,N.jsx)(`p`,{className:`text-sm text-base-content/50`,children:`Loading catalog...`})]}):(0,N.jsxs)(`div`,{className:`flex flex-col gap-6 stagger-children`,children:[(0,N.jsxs)(`div`,{className:`text-center`,children:[(0,N.jsx)(b,{className:`size-10 text-primary mx-auto mb-3`}),(0,N.jsx)(`h2`,{className:`text-2xl font-bold`,children:`Agents & Skills`}),(0,N.jsx)(`p`,{className:`text-base-content/60 mt-1`,children:`Choose which agents and skills to install`})]}),l.length>0&&(0,N.jsxs)(`div`,{children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,N.jsxs)(`h3`,{className:`font-semibold text-sm flex items-center gap-2`,children:[(0,N.jsx)(b,{className:`size-4 opacity-50`}),`Agents (`,l.length,`)`]}),(0,N.jsxs)(`div`,{className:`flex gap-1`,children:[(0,N.jsx)(`button`,{className:`btn btn-xs btn-ghost`,onClick:S,children:`Select All`}),(0,N.jsx)(`button`,{className:`btn btn-xs btn-ghost`,onClick:w,children:`None`})]})]}),(0,N.jsx)(`div`,{className:`grid gap-2`,children:l.map(e=>{let n=_.has(e.name),r=n||t.includes(e.name);return(0,N.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,N.jsxs)(`div`,{className:`card-body p-3 flex-row items-center gap-3`,children:[(0,N.jsx)(`div`,{className:`text-xl shrink-0`,children:e.emoji||`🤖`}),(0,N.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,N.jsx)(`div`,{className:`font-semibold text-sm truncate`,children:e.displayName||e.name}),e.description&&(0,N.jsx)(`p`,{className:`text-xs text-base-content/50 truncate`,children:e.description})]}),n?(0,N.jsxs)(`span`,{className:`badge badge-sm badge-success gap-1`,children:[(0,N.jsx)(s,{className:`size-3`}),` Installed`]}):(0,N.jsx)(`input`,{type:`checkbox`,className:`checkbox checkbox-primary checkbox-sm`,checked:r,readOnly:!0,tabIndex:-1})]})},e.name)})})]}),d.length>0&&(0,N.jsxs)(`div`,{children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,N.jsxs)(`h3`,{className:`font-semibold text-sm flex items-center gap-2`,children:[(0,N.jsx)(C,{className:`size-4 opacity-50`}),`Skills (`,d.length,`)`]}),(0,N.jsxs)(`div`,{className:`flex gap-1`,children:[(0,N.jsx)(`button`,{className:`btn btn-xs btn-ghost`,onClick:T,children:`Select All`}),(0,N.jsx)(`button`,{className:`btn btn-xs btn-ghost`,onClick:E,children:`None`})]})]}),(0,N.jsx)(`div`,{className:`grid gap-2`,children:d.map(e=>{let t=v.has(e.name),n=t||r.includes(e.name);return(0,N.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&&x(e.name),disabled:t,children:(0,N.jsxs)(`div`,{className:`card-body p-3 flex-row items-center gap-3`,children:[(0,N.jsx)(`div`,{className:`text-xl shrink-0`,children:e.emoji||`🧩`}),(0,N.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,N.jsx)(`div`,{className:`font-semibold text-sm truncate`,children:e.displayName||e.name}),e.description&&(0,N.jsx)(`p`,{className:`text-xs text-base-content/50 truncate`,children:e.description})]}),t?(0,N.jsxs)(`span`,{className:`badge badge-sm badge-success gap-1`,children:[(0,N.jsx)(s,{className:`size-3`}),` Installed`]}):(0,N.jsx)(`input`,{type:`checkbox`,className:`checkbox checkbox-primary checkbox-sm`,checked:n,readOnly:!0,tabIndex:-1})]})},e.name)})})]}),l.length===0&&d.length===0&&(0,N.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 G({role:e,title:t,description:n,providerName:r,value:i,onChange:a,options:o}){return(0,N.jsx)(`div`,{className:`card bg-base-200`,children:(0,N.jsxs)(`div`,{className:`card-body p-5 gap-3`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h3`,{className:`font-semibold`,children:t}),(0,N.jsx)(`p`,{className:`text-xs text-base-content/60 mt-1`,children:n})]}),r&&(0,N.jsx)(`span`,{className:`badge badge-sm badge-soft badge-primary capitalize`,children:r})]}),(0,N.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:o.map(t=>{let n=t.icon,r=i===t.value;return(0,N.jsx)(`button`,{className:`card card-interactive bg-base-100 cursor-pointer transition-all text-left ${r?`ring-2 ring-primary ring-offset-2 ring-offset-base-200`:``}`,onClick:()=>a(t.value),children:(0,N.jsxs)(`div`,{className:`card-body p-4 gap-2`,children:[(0,N.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,N.jsx)(n,{className:`size-5 ${t.color}`}),(0,N.jsx)(`span`,{className:`font-semibold`,children:t.label}),r&&(0,N.jsx)(s,{className:`size-4 text-primary ml-auto`})]}),(0,N.jsx)(`p`,{className:`text-xs text-base-content/60`,children:t.description})]})},`${e}-${t.value}`)})})]})})}function ce({efforts:e,setEfforts:t,pipeline:n}){return(0,M.useEffect)(()=>{for(let r of[`planner`,`executor`,`reviewer`]){let i=L(r,n),a=e[r];a&&!i.some(e=>e.value===a)&&t(e=>({...e,[r]:`high`}))}},[n,e,t]),(0,N.jsxs)(`div`,{className:`flex flex-col gap-6 stagger-children`,children:[(0,N.jsxs)(`div`,{className:`text-center`,children:[(0,N.jsx)(u,{className:`size-10 text-primary mx-auto mb-3`}),(0,N.jsx)(`h2`,{className:`text-2xl font-bold`,children:`Reasoning Effort By Stage`}),(0,N.jsx)(`p`,{className:`text-base-content/60 mt-1`,children:`Choose the depth for each pipeline stage. Options depend on the CLI selected.`})]}),(0,N.jsx)(G,{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:L(`planner`,n)}),(0,N.jsx)(G,{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:L(`executor`,n)}),(0,N.jsx)(G,{role:`reviewer`,title:`Review`,description:`Validates the result before approving.`,providerName:n?.reviewer,value:e.reviewer,onChange:e=>t(t=>({...t,reviewer:e})),options:L(`reviewer`,n)})]})}function le({concurrency:e,setConcurrency:t,selectedTheme:n,setSelectedTheme:r}){return(0,N.jsxs)(`div`,{className:`flex flex-col gap-6 stagger-children`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsxs)(`div`,{className:`text-center mb-4`,children:[(0,N.jsx)(m,{className:`size-10 text-primary mx-auto mb-3`}),(0,N.jsx)(`h2`,{className:`text-2xl font-bold`,children:`Workers & Theme`}),(0,N.jsx)(`p`,{className:`text-base-content/60 mt-1`,children:`Configure parallel workers and visual theme`})]}),(0,N.jsx)(`div`,{className:`card bg-base-200`,children:(0,N.jsxs)(`div`,{className:`card-body p-5 gap-3`,children:[(0,N.jsxs)(`h3`,{className:`font-semibold text-sm flex items-center gap-2`,children:[(0,N.jsx)(m,{className:`size-4 opacity-50`}),`Worker Concurrency`]}),(0,N.jsxs)(`p`,{className:`text-xs text-base-content/60`,children:[`How many agents can work in parallel (`,e,` worker`,e===1?``:`s`,`)`]}),(0,N.jsx)(`input`,{type:`range`,min:1,max:16,value:e,onChange:e=>t(Number(e.target.value)),className:`range range-primary range-sm`}),(0,N.jsxs)(`div`,{className:`flex justify-between text-xs text-base-content/40 px-1`,children:[(0,N.jsx)(`span`,{children:`1`}),(0,N.jsx)(`span`,{children:`4`}),(0,N.jsx)(`span`,{children:`8`}),(0,N.jsx)(`span`,{children:`12`}),(0,N.jsx)(`span`,{children:`16`})]})]})})]}),(0,N.jsx)(`div`,{className:`card bg-base-200`,children:(0,N.jsxs)(`div`,{className:`card-body p-5 gap-3`,children:[(0,N.jsxs)(`h3`,{className:`font-semibold text-sm flex items-center gap-2`,children:[(0,N.jsx)(l,{className:`size-4 opacity-50`}),`Theme`]}),(0,N.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:z.map(e=>(0,N.jsx)(`button`,{className:`btn btn-sm ${n===e.value?`btn-primary`:`btn-soft`}`,onClick:()=>r(e.value),children:e.label},e.value))})]})})]})}function ue({config:e,launching:t}){return(0,N.jsxs)(`div`,{className:`flex flex-col items-center text-center gap-6 stagger-children py-4`,children:[(0,N.jsx)(`div`,{className:`animate-bounce-in`,children:(0,N.jsx)(j,{className:`size-16 sm:size-20 text-primary mx-auto`})}),(0,N.jsx)(`h2`,{className:`text-2xl sm:text-3xl font-bold`,children:`You're All Set!`}),(0,N.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,N.jsx)(`div`,{className:`card bg-base-200 w-full max-w-sm`,children:(0,N.jsxs)(`div`,{className:`card-body p-4 gap-2 text-sm text-left`,children:[(0,N.jsxs)(`div`,{className:`flex justify-between`,children:[(0,N.jsx)(`span`,{className:`text-base-content/60`,children:`Pipeline`}),(0,N.jsxs)(`span`,{className:`font-semibold capitalize text-xs font-mono`,children:[e.pipeline?.planner||`?`,` → `,e.pipeline?.executor||`?`,` → `,e.pipeline?.reviewer||`?`]})]}),(0,N.jsx)(`div`,{className:`divider my-0`}),(0,N.jsxs)(`div`,{className:`flex justify-between`,children:[(0,N.jsx)(`span`,{className:`text-base-content/60`,children:`Domains`}),(0,N.jsx)(`span`,{className:`font-semibold`,children:e.domains?.length>0?e.domains.length+` selected`:`none`})]}),(0,N.jsx)(`div`,{className:`divider my-0`}),(0,N.jsxs)(`div`,{className:`flex justify-between`,children:[(0,N.jsx)(`span`,{className:`text-base-content/60`,children:`Agents`}),(0,N.jsxs)(`span`,{className:`font-semibold`,children:[e.agents?.length||0,` to install`]})]}),(0,N.jsx)(`div`,{className:`divider my-0`}),(0,N.jsxs)(`div`,{className:`flex justify-between`,children:[(0,N.jsx)(`span`,{className:`text-base-content/60`,children:`Skills`}),(0,N.jsxs)(`span`,{className:`font-semibold`,children:[e.skills?.length||0,` to install`]})]}),(0,N.jsx)(`div`,{className:`divider my-0`}),(0,N.jsxs)(`div`,{className:`flex justify-between`,children:[(0,N.jsx)(`span`,{className:`text-base-content/60`,children:`Plan`}),(0,N.jsx)(`span`,{className:`font-semibold capitalize`,children:e.efforts.planner})]}),(0,N.jsx)(`div`,{className:`divider my-0`}),(0,N.jsxs)(`div`,{className:`flex justify-between`,children:[(0,N.jsx)(`span`,{className:`text-base-content/60`,children:`Execute`}),(0,N.jsx)(`span`,{className:`font-semibold capitalize`,children:e.efforts.executor})]}),(0,N.jsx)(`div`,{className:`divider my-0`}),(0,N.jsxs)(`div`,{className:`flex justify-between`,children:[(0,N.jsx)(`span`,{className:`text-base-content/60`,children:`Review`}),(0,N.jsx)(`span`,{className:`font-semibold capitalize`,children:e.efforts.reviewer})]}),(0,N.jsx)(`div`,{className:`divider my-0`}),(0,N.jsxs)(`div`,{className:`flex justify-between`,children:[(0,N.jsx)(`span`,{className:`text-base-content/60`,children:`Workers`}),(0,N.jsx)(`span`,{className:`font-semibold`,children:e.concurrency})]}),(0,N.jsx)(`div`,{className:`divider my-0`}),(0,N.jsxs)(`div`,{className:`flex justify-between`,children:[(0,N.jsx)(`span`,{className:`text-base-content/60`,children:`Theme`}),(0,N.jsx)(`span`,{className:`font-semibold capitalize`,children:e.theme})]})]})}),t&&(0,N.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-base-content/50`,children:[(0,N.jsx)(h,{className:`size-4 animate-spin`}),`Saving configuration & installing agents...`]})]})}function K({onComplete:e}){let t=r(),n=x(),i=o(n.data),[s,l]=(0,M.useState)(0),[u,d]=(0,M.useState)(`forward`),[f,p]=(0,M.useState)(!1),[m,g]=(0,M.useState)(null),_=(0,M.useRef)(!1),[v,b]=(0,M.useState)(``),[C,w]=(0,M.useState)({planner:``,executor:``,reviewer:``}),[D,O]=(0,M.useState)(()=>H(null)),[k,A]=(0,M.useState)(2),[F,I]=(0,M.useState)(`auto`),[L,R]=(0,M.useState)(null),[z,V]=(0,M.useState)(null),[U,W]=(0,M.useState)(``),[G,K]=(0,M.useState)([]),[q,de]=(0,M.useState)([]),[J,fe]=(0,M.useState)([]),[pe,me]=(0,M.useState)(!1),[Y,X]=(0,M.useState)(null),[Z,Q]=(0,M.useState)(!1),[he,ge]=(0,M.useState)(``);(0,M.useEffect)(()=>{a.get(`/state`).then(e=>{ge(e?.sourceRepoUrl||e?.config?.sourceRepo||``)}).catch(()=>{})},[]),(0,M.useEffect)(()=>{if(_.current||n.isLoading)return;_.current=!0;let e=S(i,`runtime.agentProvider`,``),t=S(i,`runtime.defaultEffort`,null),r=S(i,`ui.theme`,`auto`),a=S(i,`runtime.workerConcurrency`,2);typeof e==`string`&&e.trim()&&b(e),O(H(t)),typeof r==`string`&&r.trim()&&I(r);let o=Number.parseInt(String(a??2),10);Number.isFinite(o)&&A(Math.min(16,Math.max(1,o)))},[i,n.isLoading]),(0,M.useEffect)(()=>{s===1&&Y===null&&(Q(!0),a.get(`/providers`).then(e=>{let t=Array.isArray(e)?e:e?.providers||[];X(t);let n=t.filter(e=>e.available!==!1),r=n[0]?.id||n[0]?.name||``;r&&!v&&b(r);let i=n.find(e=>(e.id||e.name)===`claude`),a=r,o=i?`claude`:a;w(e=>({planner:e.planner||o,executor:e.executor||a,reviewer:e.reviewer||o}))}).catch(()=>{X([])}).finally(()=>{Q(!1)}))},[s]),(0,M.useEffect)(()=>{let e=F===`auto`?window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:F;document.documentElement.setAttribute(`data-theme`,e)},[F]),(0,M.useEffect)(()=>{C.executor&&C.executor!==v&&b(C.executor)},[C.executor]);let $=(0,M.useCallback)(e=>{if(e===1){let e=[{provider:C.planner,role:`planner`},{provider:C.executor,role:`executor`},{provider:C.reviewer,role:`reviewer`}];B(`runtime.agentProvider`,C.executor,`runtime`).catch(()=>{}),B(`runtime.pipeline`,e,`runtime`).catch(()=>{})}else e===5?B(`runtime.defaultEffort`,D,`runtime`).catch(()=>{}):e===6&&(B(`ui.theme`,F,`ui`).catch(()=>{}),a.post(`/config/concurrency`,{concurrency:k}).catch(()=>{}))},[C,D,k,F]),_e=(0,M.useCallback)(()=>{s<P-1&&($(s),d(`forward`),l(e=>e+1))},[s,$]),ve=(0,M.useCallback)(()=>{s>0&&(d(`backward`),l(e=>e-1))},[s]),ye=(0,M.useCallback)(async()=>{p(!0);try{let n=[B(`ui.theme`,F,`ui`),B(`ui.onboarding.completed`,!0,`ui`)],r=[{provider:C.planner,role:`planner`},{provider:C.executor,role:`executor`},{provider:C.reviewer,role:`reviewer`}];n.push(B(`runtime.agentProvider`,C.executor,`runtime`)),n.push(B(`runtime.pipeline`,r,`runtime`)),n.push(B(`runtime.defaultEffort`,D,`runtime`)),n.push(a.post(`/config/concurrency`,{concurrency:k})),q.length>0&&n.push(a.post(`/install/agents`,{agents:q})),J.length>0&&n.push(a.post(`/install/skills`,{skills:J})),await Promise.allSettled(n),g({x:window.innerWidth/2,y:window.innerHeight/3}),setTimeout(()=>{t.invalidateQueries({queryKey:c}),e?.()},1200)}catch{await B(`ui.onboarding.completed`,!0,`ui`).catch(()=>{}),t.invalidateQueries({queryKey:c}),e?.()}},[v,D,k,F,q,J,t,e]),be=s===0||s===1&&(C.executor||Z)||s===2||s===3||s===4||s===5||s===6||s===7,xe=(L?.existingAgents||[]).map(e=>typeof e==`string`?{name:e}:e),Se=(L?.existingSkills||[]).map(e=>typeof e==`string`?{name:e}:e),Ce={pipeline:C,efforts:D,concurrency:k,theme:F,domains:G,agents:q,skills:J};return(0,N.jsxs)(`div`,{className:`fixed inset-0 z-50 bg-base-100 flex flex-col overflow-hidden`,children:[(0,N.jsx)(ee,{}),m&&(0,N.jsx)(y,{x:m.x,y:m.y,active:!0,onDone:()=>g(null)}),s>0&&(0,N.jsx)(`div`,{className:`relative z-10 pt-6 pb-2 px-4 flex justify-center`,children:(0,N.jsx)(te,{current:s})}),(0,N.jsx)(`div`,{className:`relative z-10 flex-1 flex flex-col items-center justify-start px-4 py-6 overflow-y-auto`,children:(0,N.jsxs)(ne,{direction:u,stepKey:s,center:s===0||s===1||s===7,children:[s===0&&(0,N.jsx)(re,{workspacePath:he}),s===1&&(0,N.jsx)(ie,{providers:Y||[],providersLoading:Z,pipeline:C,setPipeline:w}),s===2&&(0,N.jsx)(ae,{scanResult:L,setScanResult:R,projectDescription:U,setProjectDescription:W,analysisResult:z,setAnalysisResult:V,selectedProvider:v,analyzing:pe,setAnalyzing:me}),s===3&&(0,N.jsx)(oe,{selectedDomains:G,setSelectedDomains:K,analysisResult:z}),s===4&&(0,N.jsx)(se,{selectedDomains:G,selectedAgents:q,setSelectedAgents:de,selectedSkills:J,setSelectedSkills:fe,existingAgents:xe,existingSkills:Se}),s===5&&(0,N.jsx)(ce,{efforts:D,setEfforts:O,pipeline:C}),s===6&&(0,N.jsx)(le,{concurrency:k,setConcurrency:A,selectedTheme:F,setSelectedTheme:I}),s===7&&(0,N.jsx)(ue,{config:Ce,launching:f})]})}),(0,N.jsxs)(`div`,{className:`relative z-10 p-4 pb-6 flex justify-between items-center max-w-2xl mx-auto w-full`,children:[s>0?(0,N.jsxs)(`button`,{className:`btn btn-ghost gap-1`,onClick:ve,disabled:f,children:[(0,N.jsx)(T,{className:`size-4`}),` Back`]}):(0,N.jsx)(`div`,{}),s<P-1?(0,N.jsxs)(`button`,{className:`btn btn-primary gap-1`,onClick:_e,disabled:!be,children:[s===0?`Get Started`:`Next`,` `,(0,N.jsx)(E,{className:`size-4`})]}):(0,N.jsx)(`button`,{className:`btn btn-primary btn-lg gap-2 animate-pulse-soft`,onClick:ye,disabled:f,children:f?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(h,{className:`size-5 animate-spin`}),` Launching...`]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(j,{className:`size-5`}),` Launch Fifony`]})})]})]})}export{K 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-BoGBoEwT.js";import{C as i,T as a,a as o,m as s,n as c,p as l,u,y as d}from"./index-CFbxnygd.js";var f=e(t(),1),p=r();function m(e){return!e||e===0?`0`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function h(e){return!e||e===0?`0`:e.toLocaleString()}function g({value:e,format:t=m,className:n=``}){let[r,i]=(0,f.useState)(()=>t(e)),a=(0,f.useRef)(e),o=(0,f.useRef)(null);return(0,f.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,p.jsx)(`span`,{className:`${n} inline-block tabular-nums`,children:r})}var _=[{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 v({byPhase:e}){if(!e)return null;let t=_.reduce((t,n)=>t+(e[n.key]?.totalTokens||0),0);return t===0?null:(0,p.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,p.jsx)(`div`,{className:`flex h-4 rounded-full overflow-hidden bg-base-300 w-full`,children:_.map(n=>{let r=e[n.key]?.totalTokens||0,i=r/t*100;return i===0?null:(0,p.jsx)(`div`,{className:`${n.color} opacity-80 transition-all duration-500`,style:{width:`${i}%`},title:`${n.label}: ${h(r)} (${Math.round(i)}%)`},n.key)})}),(0,p.jsx)(`div`,{className:`flex items-center gap-4 flex-wrap`,children:_.map(n=>{let r=e[n.key]?.totalTokens||0,i=t>0?Math.round(r/t*100):0;return r===0?null:(0,p.jsxs)(`span`,{className:`flex items-center gap-1.5 text-sm`,children:[(0,p.jsx)(`span`,{className:`inline-block w-3 h-3 rounded-full ${n.color} shrink-0`}),(0,p.jsx)(`span`,{className:`opacity-60`,children:n.label}),(0,p.jsx)(`span`,{className:`font-mono font-semibold`,children:m(r)}),(0,p.jsxs)(`span`,{className:`opacity-40`,children:[`(`,i,`%)`]})]},n.key)})})]})}function y({data:e,height:t=160}){if(!e||e.length===0)return null;let n=Math.max(...e.map(e=>e.totalTokens||0),1);return(0,p.jsx)(`div`,{className:`flex items-end gap-2 w-full`,style:{height:t},children:e.map((e,r)=>{let i=e.totalTokens||0,a=Math.max(2,Math.round(i/n*t)),o=e.date?new Date(e.date+`T00:00:00`).toLocaleDateString(void 0,{weekday:`short`,month:`short`,day:`numeric`}):`Day ${r+1}`,s=e.date?new Date(e.date+`T00:00:00`).toLocaleDateString(void 0,{weekday:`short`}):`${r+1}`;return(0,p.jsxs)(`div`,{className:`flex-1 flex flex-col items-center gap-1.5 group`,children:[(0,p.jsx)(`span`,{className:`text-[10px] font-mono opacity-0 group-hover:opacity-70 transition-opacity`,children:m(i)}),(0,p.jsx)(`div`,{className:`w-full bg-primary rounded-t-md opacity-70 hover:opacity-100 transition-all duration-300 cursor-default`,style:{height:a},title:`${o}: ${h(i)} tokens`}),(0,p.jsx)(`span`,{className:`text-[10px] opacity-50`,children:s})]},e.date||r)})})}function b({data:e,valueKey:t=`totalTokens`,height:n=60,color:r=`stroke-primary`,label:i}){if(!e||e.length===0)return null;let a=e.map(e=>e[t]||e.count||0),o=Math.max(...a,1),s=a.map((e,t)=>`${t/Math.max(a.length-1,1)*200},${n-e/o*(n-4)-2}`).join(` `),c=a.reduce((e,t)=>e+t,0),l=a.length>0?Math.round(c/a.length):0,u=Math.max(...a);return(0,p.jsxs)(`div`,{className:`flex flex-col gap-2 flex-1 min-w-0`,children:[(0,p.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,p.jsx)(`span`,{className:`text-xs font-medium opacity-60`,children:i}),(0,p.jsxs)(`span`,{className:`flex items-center gap-3 text-[10px] opacity-50`,children:[(0,p.jsxs)(`span`,{children:[`avg: `,(0,p.jsxs)(`span`,{className:`font-mono`,children:[m(l),`/h`]})]}),(0,p.jsxs)(`span`,{children:[`peak: `,(0,p.jsxs)(`span`,{className:`font-mono`,children:[m(u),`/h`]})]})]})]}),(0,p.jsxs)(`svg`,{viewBox:`0 0 200 ${n}`,className:`w-full`,style:{height:n},preserveAspectRatio:`none`,children:[(0,p.jsx)(`polyline`,{points:`0,${n} ${s} 200,${n}`,fill:`currentColor`,className:r.replace(`stroke-`,`text-`),opacity:`0.08`}),(0,p.jsx)(`polyline`,{points:s,fill:`none`,className:r,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,vectorEffect:`non-scaling-stroke`})]})]})}function x({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,p.jsx)(`div`,{className:`overflow-x-auto`,children:(0,p.jsxs)(`table`,{className:`table table-sm`,children:[(0,p.jsx)(`thead`,{children:(0,p.jsxs)(`tr`,{children:[(0,p.jsx)(`th`,{children:`Model`}),(0,p.jsx)(`th`,{className:`text-right`,children:`Input`}),(0,p.jsx)(`th`,{className:`text-right`,children:`Output`}),(0,p.jsx)(`th`,{className:`text-right`,children:`Total`}),(0,p.jsx)(`th`,{className:`text-right`,children:`Share`})]})}),(0,p.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,p.jsxs)(`tr`,{children:[(0,p.jsxs)(`td`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(`span`,{className:`inline-block w-2.5 h-2.5 rounded-full ${r} shrink-0`}),(0,p.jsx)(`span`,{className:`font-mono text-xs`,children:e.model})]}),(0,p.jsx)(`td`,{className:`text-right font-mono text-xs`,children:m(e.inputTokens)}),(0,p.jsx)(`td`,{className:`text-right font-mono text-xs`,children:m(e.outputTokens)}),(0,p.jsx)(`td`,{className:`text-right font-mono text-xs font-semibold`,children:m(e.totalTokens)}),(0,p.jsx)(`td`,{className:`text-right`,children:(0,p.jsxs)(`div`,{className:`flex items-center justify-end gap-1.5`,children:[(0,p.jsx)(`div`,{className:`w-12 h-1.5 bg-base-300 rounded-full overflow-hidden`,children:(0,p.jsx)(`div`,{className:`h-full ${r} rounded-full`,style:{width:`${t}%`}})}),(0,p.jsxs)(`span`,{className:`text-xs opacity-60 w-8 text-right`,children:[t,`%`]})]})})]},e.model)})})]})})}function S({topIssues:e}){return!e||e.length===0?null:(0,p.jsx)(`div`,{className:`overflow-x-auto`,children:(0,p.jsxs)(`table`,{className:`table table-sm`,children:[(0,p.jsx)(`thead`,{children:(0,p.jsxs)(`tr`,{children:[(0,p.jsx)(`th`,{className:`w-20`,children:`Issue`}),(0,p.jsx)(`th`,{children:`Title`}),(0,p.jsx)(`th`,{className:`text-right`,children:`Tokens`}),(0,p.jsx)(`th`,{className:`hidden sm:table-cell`,children:`Phase Split`})]})}),(0,p.jsx)(`tbody`,{children:e.slice(0,10).map(e=>{let t=e.byPhase,n=e.totalTokens||0;return(0,p.jsxs)(`tr`,{children:[(0,p.jsx)(`td`,{className:`font-mono text-xs font-semibold text-primary`,children:e.identifier}),(0,p.jsx)(`td`,{className:`max-w-[200px] truncate text-sm`,title:e.title,children:e.title||`-`}),(0,p.jsx)(`td`,{className:`text-right font-mono text-xs font-semibold`,children:m(n)}),(0,p.jsx)(`td`,{className:`hidden sm:table-cell`,children:t?(0,p.jsx)(`div`,{className:`flex h-1.5 rounded-full overflow-hidden bg-base-300 w-24`,children:_.map(e=>{let r=t[e.key]?.totalTokens||0,i=n>0?r/n*100:0;return i===0?null:(0,p.jsx)(`div`,{className:`${e.color} opacity-80`,style:{width:`${i}%`},title:`${e.label}: ${m(r)}`},e.key)})}):(0,p.jsx)(`span`,{className:`opacity-30 text-xs`,children:`-`})})]},e.id||e.identifier)})})]})})}function C(){return(0,p.jsx)(`div`,{className:`flex-1 flex flex-col min-h-0 px-4 pb-4 pt-3`,children:(0,p.jsxs)(`div`,{className:`max-w-6xl w-full mx-auto space-y-6`,children:[(0,p.jsx)(`div`,{className:`skeleton-line h-8 w-48`}),(0,p.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4`,children:[...[,,,]].map((e,t)=>(0,p.jsx)(`div`,{className:`skeleton-card h-28`,style:{animationDelay:`${t*80}ms`}},t))}),(0,p.jsx)(`div`,{className:`skeleton-card h-52`}),(0,p.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4`,children:[(0,p.jsx)(`div`,{className:`skeleton-card h-32`}),(0,p.jsx)(`div`,{className:`skeleton-card h-32`})]}),(0,p.jsx)(`div`,{className:`skeleton-card h-64`})]})})}function w(){return(0,p.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center gap-4 px-4 pb-20 animate-fade-in`,children:[(0,p.jsx)(o,{className:`size-16 opacity-15`}),(0,p.jsx)(`h2`,{className:`text-lg font-semibold opacity-60`,children:`No analytics data yet`}),(0,p.jsx)(`p`,{className:`text-sm opacity-40 text-center max-w-md`,children:`Token usage and pipeline metrics will appear here once issues start processing.`})]})}var T=n(`/analytics`)({component:E});function E(){let{data:e,isLoading:t}=a(),{data:n,isLoading:r}=i(24);if(t&&!e)return(0,p.jsx)(C,{});let f=e?.overall?.totalTokens||0,_=e?.byPhase||null,T=e?.byModel||{},E=e?.daily||[],D=e?.topIssues||[],O=n?.tokensPerHour||[],k=n?.eventsPerHour||[],A=new Date().toISOString().slice(0,10),j=E.find(e=>e.date===A)?.totalTokens||0,M=E.reduce((e,t)=>e+(t.totalTokens||0),0);return f===0&&E.length===0&&D.length===0?(0,p.jsx)(w,{}):(0,p.jsx)(`div`,{className:`flex-1 flex flex-col min-h-0 px-4 pb-4 pt-3 overflow-y-auto`,children:(0,p.jsxs)(`div`,{className:`max-w-6xl w-full mx-auto space-y-6 stagger-children`,children:[(0,p.jsx)(`section`,{children:(0,p.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4`,children:[(0,p.jsxs)(`div`,{className:`stat bg-base-200 rounded-box`,children:[(0,p.jsx)(`div`,{className:`stat-figure text-primary`,children:(0,p.jsx)(c,{className:`size-6`})}),(0,p.jsx)(`div`,{className:`stat-title`,children:`Total Tokens`}),(0,p.jsx)(`div`,{className:`stat-value text-2xl`,children:(0,p.jsx)(g,{value:f})}),(0,p.jsx)(`div`,{className:`stat-desc font-mono`,children:h(f)})]}),(0,p.jsxs)(`div`,{className:`stat bg-base-200 rounded-box`,children:[(0,p.jsx)(`div`,{className:`stat-figure text-accent`,children:(0,p.jsx)(s,{className:`size-6`})}),(0,p.jsx)(`div`,{className:`stat-title`,children:`Today`}),(0,p.jsx)(`div`,{className:`stat-value text-2xl`,children:(0,p.jsx)(g,{value:j})}),(0,p.jsxs)(`div`,{className:`stat-desc`,children:[`This week: `,m(M)]})]}),(0,p.jsxs)(`div`,{className:`stat bg-base-200 rounded-box`,children:[(0,p.jsx)(`div`,{className:`stat-figure text-info`,children:(0,p.jsx)(u,{className:`size-6`})}),(0,p.jsx)(`div`,{className:`stat-title`,children:`Phase Split`}),(0,p.jsx)(`div`,{className:`stat-value text-2xl p-0`,children:_?(0,p.jsx)(v,{byPhase:_}):(0,p.jsx)(`span`,{className:`opacity-30`,children:`-`})})]})]})}),E.length>0&&(0,p.jsxs)(`section`,{className:`bg-base-200 rounded-box p-5`,children:[(0,p.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,p.jsxs)(`h2`,{className:`text-sm font-semibold flex items-center gap-2`,children:[(0,p.jsx)(o,{className:`size-4 text-primary`}),`Daily Token Usage`]}),(0,p.jsxs)(`span`,{className:`text-xs opacity-40`,children:[`Last `,E.length,` days`]})]}),(0,p.jsx)(y,{data:E,height:160})]}),(O.length>0||k.length>0)&&(0,p.jsxs)(`section`,{className:`bg-base-200 rounded-box p-5`,children:[(0,p.jsxs)(`h2`,{className:`text-sm font-semibold flex items-center gap-2 mb-4`,children:[(0,p.jsx)(d,{className:`size-4 text-secondary`}),`Hourly Activity (last 24h)`]}),(0,p.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-6`,children:[O.length>0&&(0,p.jsx)(b,{data:O,valueKey:`totalTokens`,height:60,color:`stroke-primary`,label:`Tokens / hour`}),k.length>0&&(0,p.jsx)(b,{data:k,valueKey:`count`,height:60,color:`stroke-secondary`,label:`Events / hour`})]})]}),D.length>0&&(0,p.jsxs)(`section`,{className:`bg-base-200 rounded-box p-5`,children:[(0,p.jsxs)(`h2`,{className:`text-sm font-semibold flex items-center gap-2 mb-4`,children:[(0,p.jsx)(c,{className:`size-4 text-accent`}),`Top Issues by Token Usage`]}),(0,p.jsx)(S,{topIssues:D})]}),Object.keys(T).length>0&&(0,p.jsxs)(`section`,{className:`bg-base-200 rounded-box p-5`,children:[(0,p.jsxs)(`h2`,{className:`text-sm font-semibold flex items-center gap-2 mb-4`,children:[(0,p.jsx)(l,{className:`size-4 text-info`}),`Model Breakdown`]}),(0,p.jsx)(x,{byModel:T})]})]})})}export{T as Route};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DF2fYuay.js";import{I as t}from"./vendor-BoGBoEwT.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};
|