agi-farm 1.7.3 → 1.8.1
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 +53 -8
- package/dashboard-dist/assets/Agents-R6RWu0N3.js +1 -0
- package/dashboard-dist/assets/Alerts-T-KcEJKx.js +1 -0
- package/dashboard-dist/assets/Approvals-DlAxXjQq.js +1 -0
- package/dashboard-dist/assets/AuditLog-Cc1GUGYz.js +1 -0
- package/dashboard-dist/assets/Budget-DRJWqsop.js +1 -0
- package/dashboard-dist/assets/Comms-DT2o5TCi.js +1 -0
- package/dashboard-dist/assets/Crons-Z7WYAc2l.js +1 -0
- package/dashboard-dist/assets/Decisions-B3i1Rijg.js +3 -0
- package/dashboard-dist/assets/Failures-CaEvQ0t1.js +2 -0
- package/dashboard-dist/assets/HITL-DLdfKu9S.js +1 -0
- package/dashboard-dist/assets/Jobs-Ch4D8P85.js +1 -0
- package/dashboard-dist/assets/Knowledge-C92uZhl9.js +1 -0
- package/dashboard-dist/assets/Memory-DFU5CtTT.js +2 -0
- package/dashboard-dist/assets/OKRs-Dt0HzTQQ.js +1 -0
- package/dashboard-dist/assets/Overview-jyL2WFAq.js +2 -0
- package/dashboard-dist/assets/Policies-CbemgLkX.js +1 -0
- package/dashboard-dist/assets/Processes-btq7Pyex.js +1 -0
- package/dashboard-dist/assets/Projects-BwJwue3A.js +1 -0
- package/dashboard-dist/assets/Security-BVLBAnlu.js +1 -0
- package/dashboard-dist/assets/Settings-CGB5pOXa.js +1 -0
- package/dashboard-dist/assets/Tasks-bypXrRI-.js +1 -0
- package/dashboard-dist/assets/Usage-Cvfmkgit.js +1 -0
- package/dashboard-dist/assets/Velocity-DzCZH_YB.js +1 -0
- package/dashboard-dist/assets/charts-CjCN_e1M.js +36 -0
- package/dashboard-dist/assets/index-C5VVgT-r.js +2 -0
- package/dashboard-dist/assets/index-Cti3NWck.css +1 -0
- package/dashboard-dist/assets/vendor-gUVFsxOc.js +9 -0
- package/dashboard-dist/index.html +3 -3
- package/openclaw.plugin.json +2 -2
- package/package.json +3 -2
- package/scripts/agi-farm.js +52 -0
- package/dashboard-dist/assets/Agents-DcKfepd3.js +0 -1
- package/dashboard-dist/assets/Alerts-TfW5ABV3.js +0 -1
- package/dashboard-dist/assets/Approvals-C5wNSjYp.js +0 -1
- package/dashboard-dist/assets/AuditLog-CHFz6bEN.js +0 -1
- package/dashboard-dist/assets/Broadcast-DQhD3m2_.js +0 -2
- package/dashboard-dist/assets/Budget-CN9H2Y25.js +0 -1
- package/dashboard-dist/assets/Comms-BcwiENia.js +0 -4
- package/dashboard-dist/assets/Crons-BxBNpj3e.js +0 -1
- package/dashboard-dist/assets/Decisions-DTWsU-7w.js +0 -3
- package/dashboard-dist/assets/Failures-BtEA2rZ7.js +0 -3
- package/dashboard-dist/assets/HITL-7I_B710r.js +0 -1
- package/dashboard-dist/assets/Jobs-DYjwOyMg.js +0 -1
- package/dashboard-dist/assets/Knowledge-CnmW_tUG.js +0 -1
- package/dashboard-dist/assets/LastUpdated-BVeFtHFH.js +0 -1
- package/dashboard-dist/assets/Memory-stu2EMxi.js +0 -2
- package/dashboard-dist/assets/OKRs-BM2TyrJ5.js +0 -1
- package/dashboard-dist/assets/Overview-BrtNZRwZ.js +0 -2
- package/dashboard-dist/assets/Policies-DapvMkY1.js +0 -1
- package/dashboard-dist/assets/Processes-BDyc1hjd.js +0 -1
- package/dashboard-dist/assets/Projects-h06ZA4vt.js +0 -1
- package/dashboard-dist/assets/RD-CB2gaSB6.js +0 -1
- package/dashboard-dist/assets/Security-BsPrQ5iZ.js +0 -1
- package/dashboard-dist/assets/Settings-rkZTafJC.js +0 -1
- package/dashboard-dist/assets/Skills-CVHjiY3i.js +0 -1
- package/dashboard-dist/assets/Tasks-CCwHeS9A.js +0 -1
- package/dashboard-dist/assets/Usage-BTZvdAS7.js +0 -1
- package/dashboard-dist/assets/Velocity-CPmKIjkH.js +0 -1
- package/dashboard-dist/assets/charts-BrUY2WWl.js +0 -36
- package/dashboard-dist/assets/index-8xXIj60a.js +0 -2
- package/dashboard-dist/assets/index-CButpJQR.css +0 -1
- package/dashboard-dist/assets/vendor-5MxLWm27.js +0 -9
package/README.md
CHANGED
|
@@ -37,9 +37,47 @@
|
|
|
37
37
|
|
|
38
38
|
---
|
|
39
39
|
|
|
40
|
-
## 🆕 What's New in v1.
|
|
40
|
+
## 🆕 What's New in v1.8.0
|
|
41
|
+
|
|
42
|
+
### 🎨 Complete Dashboard Redesign — Day Theme (Minimalism 3.0 + Glassmorphism 2.0)
|
|
43
|
+
|
|
44
|
+
The AGI Farm dashboard has been **completely redesigned** with a modern, light-mode UI. Every single one of the 26 tabs has been rewritten from scratch with a premium day-themed aesthetic.
|
|
45
|
+
|
|
46
|
+
#### ✨ Design System
|
|
47
|
+
- **Off-white/pearl backgrounds** (`#F8FAFC` slate palette) with glassmorphism cards and subtle depth shadows
|
|
48
|
+
- **Premium typography** — Inter for UI, JetBrains Mono for technical values
|
|
49
|
+
- **Accent palette** — Indigo primary, Emerald mint for success, Amber for warnings, Violet for AI/HITL, Red for errors
|
|
50
|
+
- **Hover-lift animations**, smooth fade-in transitions, and pill-shaped status badges throughout
|
|
51
|
+
- **100% light mode** — All dark `#050505`/`#000`/`rgba(0,0,0)` backgrounds purged from every file
|
|
52
|
+
|
|
53
|
+
#### 📋 All 26 Tabs Redesigned
|
|
54
|
+
|
|
55
|
+
| Pillar | Tabs |
|
|
56
|
+
|--------|------|
|
|
57
|
+
| **Agent Intelligence** | Overview, Agents, Tasks, HITL, Alerts, Velocity, Budget |
|
|
58
|
+
| **Project Oversight** | Projects, OKRs, Approvals, Knowledge, Comms |
|
|
59
|
+
| **System** | Security, Jobs & Crons, Processes, Policies, Skills, Usage, Memory, Failures, Decisions, Audit Log, Settings, R&D |
|
|
60
|
+
|
|
61
|
+
#### 🏗️ Key Changes
|
|
62
|
+
- **Projects tab** — Full rewrite with light progress rings, health badges, tabbed detail view (Overview / Timeline / Tasks / Budget / OKRs / Logs), light Gantt chart and burndown chart
|
|
63
|
+
- **HITL tab** — Soft-purple glass cards with clear Approve/Reject actions and status banner
|
|
64
|
+
- **Velocity tab** — KPI cards + area chart + success rate trend line
|
|
65
|
+
- **Approvals tab** — Card layout matching HITL with optional notes field
|
|
66
|
+
- **Settings tab** — Toggle switches, budget limit inputs, workspace info grid
|
|
67
|
+
- **Crons tab** — Status-dot rows with Run / Pause / Resume action buttons
|
|
68
|
+
- **Knowledge tab** — Masonry card grid with tag pills and expand-to-read
|
|
69
|
+
- **Comms tab** — Agent list sidebar with Inbox / Outbox panels
|
|
70
|
+
- **OKRs tab** — Objective cards with animated KR progress bars
|
|
71
|
+
- **R&D tab** — Light experiment table, benchmark leaderboard, and evolution pipeline backlog
|
|
72
|
+
|
|
73
|
+
#### 🧹 Legacy Cleanup
|
|
74
|
+
- Deleted `TopBar.jsx` and `Sidebar.jsx` (unused dark-theme stubs)
|
|
75
|
+
- Removed all cyberpunk/neon language (`SYSTEM_LIVE`, `ENCRYPTED`, `VECTOR_ID`, `NEURAL`, etc.)
|
|
76
|
+
- All chart grid lines and tooltips updated to light theme
|
|
41
77
|
|
|
42
|
-
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
### Previous: v1.7.2 — Enhanced Wizard with Workflow Templates + Agent Browser
|
|
43
81
|
- **4 workflow templates** — Pre-built teams for common use cases: Startup MVP (5 agents), Marketing Campaign (5 agents), Enterprise Feature (6 agents), Quality-First (4 agents)
|
|
44
82
|
- **Agent browser** — Browse and select from all **91 agents** across 11 categories (AGI Farm + ECC + Agency-Agents)
|
|
45
83
|
- **Auto-template copying** — SOUL.md templates automatically copied to agent workspaces during setup
|
|
@@ -181,14 +219,21 @@ Run enhanced wizard: `node scripts/setup-enhanced.js`
|
|
|
181
219
|
|
|
182
220
|
## 🚀 Quick Start
|
|
183
221
|
|
|
184
|
-
### Install
|
|
222
|
+
### One-Step Install & Setup
|
|
223
|
+
|
|
224
|
+
The recommended way to install and configure AGI Farm is with this single command. It will globally install the CLI and immediately launch the interactive setup wizard:
|
|
185
225
|
|
|
186
226
|
```bash
|
|
187
|
-
|
|
188
|
-
|
|
227
|
+
npm install -g agi-farm && agi-farm setup
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### Alternative Installation
|
|
231
|
+
|
|
232
|
+
If you prefer to install it purely as an OpenClaw plugin (without the global CLI binary), you can use the built-in plugin manager, but you **must** use the `npx` runner to execute the setup wizard:
|
|
189
233
|
|
|
190
|
-
|
|
191
|
-
|
|
234
|
+
```bash
|
|
235
|
+
openclaw plugins install agi-farm
|
|
236
|
+
npx agi-farm setup
|
|
192
237
|
```
|
|
193
238
|
|
|
194
239
|
### Upgrade (Existing Install)
|
|
@@ -204,7 +249,7 @@ openclaw plugins install agi-farm || openclaw plugins update agi-farm
|
|
|
204
249
|
### Run Setup Wizard
|
|
205
250
|
|
|
206
251
|
```bash
|
|
207
|
-
# Start the interactive wizard
|
|
252
|
+
# Start the interactive wizard anytime
|
|
208
253
|
agi-farm setup
|
|
209
254
|
```
|
|
210
255
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as p,a4 as e,at as j,au as F,av as S,ak as C}from"./vendor-gUVFsxOc.js";import{a as E}from"./index-C5VVgT-r.js";const y={active:{bg:"#EEF2FF",color:"var(--accent)",label:"Active"},available:{bg:"#ECFDF5",color:"var(--mint)",label:"Available"},busy:{bg:"#FFFBEB",color:"var(--amber)",label:"Busy"},error:{bg:"#FEF2F2",color:"var(--red)",label:"Error"},running:{bg:"#EEF2FF",color:"var(--accent)",label:"Running"}};function k({minutes:s}){const a=s??999,r=a<5?"var(--mint)":a<15?"var(--amber)":"var(--red)",d=Math.max(0,Math.min(100,100-a/60*100));return e.jsxs("div",{children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:11,color:"var(--muted)",marginBottom:4},children:[e.jsx("span",{children:"Heartbeat"}),e.jsx("span",{style:{color:r,fontWeight:600},children:a<999?`${a}m ago`:"Offline"})]}),e.jsx("div",{className:"progress-track",children:e.jsx("div",{className:"progress-fill",style:{width:`${d}%`,background:r}})})]})}function b({label:s,value:a,color:r}){return e.jsxs("div",{style:{textAlign:"center",padding:"10px 8px",background:"#F8FAFC",borderRadius:10,border:"1px solid var(--border)"},children:[e.jsx("div",{style:{fontSize:18,fontWeight:700,color:r||"var(--text)"},children:a}),e.jsx("div",{style:{fontSize:9,color:"var(--muted)",fontWeight:700,textTransform:"uppercase",marginTop:2},children:s})]})}function z({agent:s,tasks:a,toast:r,index:d}){const[c,x]=p.useState(!1),[i,g]=p.useState(""),[u,f]=p.useState(!1),v=a.filter(n=>n.assigned_to===s.id),m=v.find(n=>n.status==="in-progress"),t=v.find(n=>n.status==="needs_human_decision"),l=!!t,o=y[s.status]||y.available,h=async()=>{if(i.trim()){f(!0);try{await E(`/api/comms/${s.id}/send`,{message:i.trim()}),r?.(`Message sent to ${s.name}`,"success"),g(""),x(!1)}catch(n){r?.(n.message,"error")}f(!1)}};return e.jsxs("div",{className:"card fade-in",style:{animationDelay:`${d*.05}s`,display:"flex",flexDirection:"column",gap:16,borderColor:l?"#EDE9FE":s.status==="error"?"#FEE2E2":"var(--border)",borderWidth:l||s.status==="error"?2:1},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:12},children:[e.jsx("span",{style:{fontSize:28,flexShrink:0},children:s.emoji||"🤖"}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{fontSize:15,fontWeight:700,color:"var(--text)",marginBottom:3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.name||s.id}),e.jsx("div",{style:{fontSize:11,color:"var(--text-dim)",marginBottom:6},children:s.role||"Agent"}),e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:5,background:o.bg,color:o.color,borderRadius:999,padding:"2px 10px",fontSize:11,fontWeight:600},children:[e.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:o.color,display:"inline-block"}}),o.label]})]})]}),l?e.jsxs("div",{style:{padding:"10px 14px",background:"#F5F3FF",border:"1px solid #EDE9FE",borderRadius:10},children:[e.jsx("div",{style:{fontSize:10,color:"var(--purple)",fontWeight:700,textTransform:"uppercase",marginBottom:3},children:"⚡ HITL Required"}),e.jsx("div",{style:{fontSize:12,color:"var(--text)",fontWeight:500},children:t?.hitl_reason||t?.title})]}):m?e.jsxs("div",{style:{padding:"10px 14px",background:"#EEF2FF",border:"1px solid #E0E7FF",borderRadius:10},children:[e.jsx("div",{style:{fontSize:10,color:"var(--accent)",fontWeight:700,textTransform:"uppercase",marginBottom:3},children:"▶ Working On"}),e.jsx("div",{style:{fontSize:12,color:"var(--text)",fontWeight:500,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:m.title})]}):e.jsx("div",{style:{padding:"10px 14px",background:"#F8FAFC",borderRadius:10,textAlign:"center"},children:e.jsx("span",{style:{fontSize:12,color:"var(--muted)"},children:"Idle — awaiting task"})}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:8},children:[e.jsx(b,{label:"Done",value:s.tasks_completed??0,color:"var(--mint)"}),e.jsx(b,{label:"Failed",value:s.tasks_failed??0,color:"var(--red)"}),e.jsx(b,{label:"Cred.",value:(s.credibility||1).toFixed(1),color:"var(--accent)"})]}),e.jsx(k,{minutes:s.heartbeat_age_minutes}),e.jsxs("div",{style:{fontSize:11,color:"var(--text-dim)",display:"flex",flexDirection:"column",gap:4},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between"},children:[e.jsx("span",{style:{color:"var(--muted)"},children:"Model"}),e.jsx("span",{style:{fontWeight:600},children:s.model||"--"})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[e.jsx(j,{size:11,color:"var(--muted)"}),e.jsx("span",{style:{color:"var(--muted)"},children:"Inbox"})]}),e.jsx("span",{style:{fontWeight:600,color:s.inbox_count>0?"var(--amber)":"var(--text-dim)"},children:s.inbox_count>0?`${s.inbox_count} messages`:"Empty"})]})]}),e.jsx("div",{style:{borderTop:"1px solid var(--border)",paddingTop:12},children:c?e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsx("input",{className:"input-base",style:{flex:1,fontSize:12},placeholder:"Send a message…",value:i,onChange:n=>g(n.target.value),onKeyDown:n=>n.key==="Enter"&&h(),autoFocus:!0}),e.jsxs("button",{onClick:h,disabled:u||!i.trim(),style:{background:"var(--accent)",color:"#fff",border:"none",borderRadius:10,padding:"8px 12px",cursor:"pointer",display:"flex",alignItems:"center",gap:4,fontSize:12,fontWeight:600},children:[e.jsx(F,{size:13})," ",u?"…":"Send"]}),e.jsx("button",{onClick:()=>x(!1),style:{background:"transparent",border:"1px solid var(--border)",borderRadius:10,padding:"8px 10px",cursor:"pointer"},children:e.jsx(S,{size:13,color:"var(--muted)"})})]}):e.jsxs("button",{onClick:()=>x(!0),style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:8,background:"#F8FAFC",border:"1px solid var(--border)",borderRadius:10,padding:"10px",cursor:"pointer",fontSize:12,color:"var(--text-dim)",fontWeight:500,transition:"all 0.15s"},children:[e.jsx(C,{size:13})," Message Agent"]})})]})}function A({data:s,toast:a}){const{agents:r=[],tasks:d=[]}=s||{},[c,x]=p.useState(""),[i,g]=p.useState("all"),u=r.filter(t=>{const l=c.toLowerCase(),o=!c||(t.name||"").toLowerCase().includes(l)||(t.id||"").toLowerCase().includes(l),h=i==="all"||t.status===i;return o&&h}),f=r.filter(t=>t.status!=="available").length,v=r.filter(t=>t.status==="available").length,m=r.filter(t=>t.status==="error").length;return e.jsxs("div",{className:"fade-in",style:{display:"flex",flexDirection:"column",gap:28},children:[e.jsxs("div",{children:[e.jsx("h1",{style:{marginBottom:4},children:"Agent Directory"}),e.jsx("p",{style:{color:"var(--text-dim)",fontSize:14},children:"Monitor and message your autonomous agent fleet"})]}),e.jsxs("div",{style:{display:"flex",gap:10},children:[[{label:`${f} Active`,color:"var(--accent)",bg:"#EEF2FF",status:"active"},{label:`${v} Idle`,color:"var(--mint)",bg:"#ECFDF5",status:"available"},{label:`${m} Error`,color:"var(--red)",bg:"#FEF2F2",status:"error"}].map(t=>e.jsx("button",{onClick:()=>g(i===t.status?"all":t.status),style:{background:i===t.status?t.bg:"#F8FAFC",color:i===t.status?t.color:"var(--muted)",border:`1px solid ${i===t.status?t.color+"44":"var(--border)"}`,borderRadius:999,padding:"5px 14px",fontSize:12,fontWeight:600,cursor:"pointer",transition:"all 0.15s"},children:t.label},t.status)),e.jsx("input",{className:"input-base",placeholder:"Search agents…",value:c,onChange:t=>x(t.target.value),style:{marginLeft:"auto",width:220,fontSize:13}})]}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(300px, 1fr))",gap:20},children:u.length>0?u.map((t,l)=>e.jsx(z,{agent:t,tasks:d,toast:a,index:l},t.id)):e.jsx("div",{style:{gridColumn:"1 / -1",textAlign:"center",padding:64,color:"var(--muted)",fontSize:13},children:"No agents match your filter"})})]})}export{A as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as x,a4 as r,aH as F,av as S}from"./vendor-gUVFsxOc.js";const g={critical:{bg:"#FEF2F2",border:"#FEE2E2",color:"var(--red)",label:"Critical"},high:{bg:"#FFF7ED",border:"#FED7AA",color:"var(--amber)",label:"High"},medium:{bg:"#FFFBEB",border:"#FEF3C7",color:"#D97706",label:"Medium"},low:{bg:"#F8FAFC",border:"var(--border)",color:"var(--muted)",label:"Low"}},m={hitl:"🔔",sla_breach:"⏰",agent_error:"🔴",cron_error:"⚙️",blocked:"🚫"},b={hitl:"HITL",sla_breach:"SLA Breach",agent_error:"Agent Error",cron_error:"Cron Error",blocked:"Blocked"};function k(n){if(!n)return"";try{const i=Math.round((Date.now()-new Date(n))/6e4);return i<1?"just now":i<60?`${i}m ago`:`${Math.round(i/60)}h ago`}catch{return""}}function C({data:n}){const{alerts:i=[],agents:u=[]}=n||{},[a,f]=x.useState(new Set),[o,y]=x.useState("all"),[l,v]=x.useState("all"),d=i.filter(e=>!a.has(e.id)),h=d.filter(e=>(o==="all"||e.type===o)&&(l==="all"||e.severity===l)),j=["all",...new Set(i.map(e=>e.type))],c={critical:0,high:0,medium:0,low:0};return d.forEach(e=>{c[e.severity]!==void 0&&c[e.severity]++}),r.jsxs("div",{className:"fade-in",style:{display:"flex",flexDirection:"column",gap:24},children:[r.jsxs("div",{children:[r.jsx("h1",{style:{marginBottom:4},children:"Alert Center"}),r.jsxs("p",{style:{color:"var(--text-dim)",fontSize:14},children:[d.length," active alerts across the system"]})]}),r.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:12},children:Object.entries(c).map(([e,t])=>{const s=g[e];return r.jsxs("button",{onClick:()=>v(l===e?"all":e),style:{background:l===e?s.bg:"#F8FAFC",border:`1px solid ${l===e?s.border:"var(--border)"}`,borderRadius:14,padding:"16px",textAlign:"center",cursor:"pointer",transition:"all 0.15s"},children:[r.jsx("div",{style:{fontSize:22,fontWeight:700,color:t>0?s.color:"var(--muted)"},children:t}),r.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--muted)",textTransform:"capitalize",marginTop:4},children:e})]},e)})}),r.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[j.map(e=>r.jsxs("button",{onClick:()=>y(e),style:{background:o===e?"var(--accent)":"#F8FAFC",color:o===e?"#fff":"var(--text-dim)",border:`1px solid ${o===e?"var(--accent)":"var(--border)"}`,borderRadius:8,padding:"5px 12px",fontSize:12,fontWeight:500,cursor:"pointer",transition:"all 0.15s"},children:[m[e]||""," ",b[e]||e.charAt(0).toUpperCase()+e.slice(1)]},e)),a.size>0&&r.jsxs("button",{onClick:()=>f(new Set),style:{marginLeft:"auto",background:"#F8FAFC",border:"1px solid var(--border)",color:"var(--muted)",borderRadius:8,padding:"5px 12px",fontSize:12,cursor:"pointer",display:"flex",alignItems:"center",gap:5},children:[r.jsx(F,{size:12})," Restore ",a.size," dismissed"]})]}),h.length===0?r.jsxs("div",{className:"card",style:{textAlign:"center",padding:64},children:[r.jsx("div",{style:{fontSize:32,marginBottom:12},children:"✅"}),r.jsx("div",{style:{fontSize:14,fontWeight:600,color:"var(--text)"},children:i.length===0?"No alerts — all systems nominal":"All alerts filtered or dismissed"})]}):r.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10},children:h.map(e=>{const t=g[e.severity]||g.low,s=u.find(p=>p.id===e.agent_id);return r.jsxs("div",{style:{background:t.bg,border:`1px solid ${t.border}`,borderRadius:14,display:"flex",gap:14,padding:"16px 18px",alignItems:"flex-start",transition:"transform 0.15s",cursor:"default"},children:[r.jsx("span",{style:{fontSize:22,flexShrink:0},children:m[e.type]||"⚠️"}),r.jsxs("div",{style:{flex:1,minWidth:0},children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4,flexWrap:"wrap"},children:[r.jsx("span",{style:{fontWeight:700,fontSize:14,color:"var(--text)"},children:e.title}),r.jsx("span",{style:{background:t.color+"18",color:t.color,border:`1px solid ${t.color}44`,borderRadius:999,fontSize:10,fontWeight:700,padding:"1px 8px"},children:t.label})]}),e.detail&&r.jsx("div",{style:{fontSize:13,color:"var(--text-dim)",lineHeight:1.5,marginBottom:6},children:e.detail}),r.jsxs("div",{style:{fontSize:11,color:"var(--muted)",display:"flex",gap:10,flexWrap:"wrap"},children:[s&&r.jsxs("span",{children:[s.emoji," ",s.name]}),r.jsx("span",{children:b[e.type]||e.type}),r.jsx("span",{children:k(e.ts)}),e.task_id&&r.jsx("span",{style:{fontFamily:"var(--font-mono)"},children:e.task_id})]})]}),r.jsx("button",{onClick:()=>f(p=>new Set([...p,e.id])),style:{background:"rgba(255,255,255,0.6)",border:"1px solid var(--border)",borderRadius:8,padding:"4px 8px",cursor:"pointer",flexShrink:0},children:r.jsx(S,{size:12,color:"var(--muted)"})})]},e.id)})})]})}export{C as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as c,a4 as t,ax as j,am as b,aB as F,aD as z}from"./vendor-gUVFsxOc.js";import{a as S}from"./index-C5VVgT-r.js";function C(o){if(!o)return"—";try{const r=Math.round((Date.now()-new Date(o))/6e4);return r<1?"just now":r<60?`${r}m ago`:r<1440?`${Math.round(r/60)}h ago`:`${Math.round(r/1440)}d ago`}catch{return o}}function k({data:o,toast:r}){const{approvals:l=[],agents:h=[]}=o||{},[n,m]=c.useState({}),[g,v]=c.useState({}),[d,x]=c.useState({}),a=l.filter(e=>e.status==="pending"&&!n[e.id]),u=l.filter(e=>n[e.id]),p=l.filter(e=>e.status!=="pending"&&!n[e.id]);async function f(e,s){x(i=>({...i,[e.id]:s}));try{await S(`/api/approvals/${e.id}/${s}`,{note:g[e.id]||""}),m(i=>({...i,[e.id]:s})),r?.(`Approval ${s}d`,s==="approve"?"success":"error")}catch(i){r?.(i.message,"error")}x(i=>({...i,[e.id]:null}))}return t.jsxs("div",{className:"fade-in",style:{display:"flex",flexDirection:"column",gap:24},children:[t.jsxs("div",{children:[t.jsx("h1",{style:{marginBottom:4},children:"Approval Queue"}),t.jsxs("p",{style:{color:"var(--text-dim)",fontSize:14},children:[a.length," pending approvals require a decision"]})]}),a.length===0&&t.jsxs("div",{className:"card",style:{textAlign:"center",padding:48},children:[t.jsx("div",{style:{fontSize:32,marginBottom:12},children:"✅"}),t.jsx("div",{style:{fontSize:15,fontWeight:600,color:"var(--text)"},children:"All caught up"}),t.jsx("div",{style:{fontSize:13,color:"var(--muted)",marginTop:4},children:"No pending approvals"})]}),a.map(e=>{const s=h.find(i=>i.id===e.requestedBy||i.id===e.agentId);return t.jsxs("div",{style:{background:"#FDFCFF",border:"2px solid #EDE9FE",borderRadius:16,padding:24},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:14},children:[t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:15,fontWeight:700,color:"var(--text)",marginBottom:4},children:e.action||"Action requires approval"}),t.jsxs("div",{style:{display:"flex",gap:10,fontSize:12,color:"var(--muted)"},children:[s&&t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4},children:[t.jsx(j,{size:11}),s.emoji," ",s.name]}),t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4},children:[t.jsx(b,{size:11}),C(e.created_at||e.requestedAt)]})]})]}),t.jsx("span",{style:{background:"#F5F3FF",color:"var(--purple)",borderRadius:999,padding:"4px 12px",fontSize:11,fontWeight:600},children:"Pending"})]}),e.reason&&t.jsxs("div",{style:{padding:"12px 14px",background:"#F5F3FF",border:"1px solid #EDE9FE",borderRadius:10,marginBottom:14},children:[t.jsx("div",{style:{fontSize:11,fontWeight:700,color:"var(--purple)",marginBottom:4},children:"Reason"}),t.jsx("div",{style:{fontSize:13,color:"var(--text)"},children:e.reason})]}),e.payload&&Object.keys(e.payload).length>0&&t.jsxs("div",{style:{marginBottom:14},children:[t.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--muted)",textTransform:"uppercase",marginBottom:6},children:"Payload"}),t.jsx("pre",{style:{background:"#F8FAFC",border:"1px solid var(--border)",borderRadius:10,padding:12,fontSize:11,color:"var(--text-dim)",overflow:"auto",fontFamily:"var(--font-mono)",maxHeight:140},children:JSON.stringify(e.payload,null,2)})]}),t.jsx("input",{className:"input-base",placeholder:"Optional note…",value:g[e.id]||"",onChange:i=>v(y=>({...y,[e.id]:i.target.value})),style:{marginBottom:12,width:"100%",boxSizing:"border-box"}}),t.jsxs("div",{style:{display:"flex",gap:10},children:[t.jsxs("button",{onClick:()=>f(e,"approve"),disabled:!!d[e.id],style:{flex:1,padding:12,background:"#ECFDF5",border:"1px solid #6EE7B7",color:"var(--mint)",borderRadius:10,fontWeight:700,fontSize:13,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:8},children:[t.jsx(F,{size:15})," ",d[e.id]==="approve"?"Processing…":"Approve"]}),t.jsxs("button",{onClick:()=>f(e,"reject"),disabled:!!d[e.id],style:{flex:1,padding:12,background:"#FEF2F2",border:"1px solid #FCA5A5",color:"var(--red)",borderRadius:10,fontWeight:700,fontSize:13,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:8},children:[t.jsx(z,{size:15})," ",d[e.id]==="reject"?"Processing…":"Reject"]})]})]},e.id)}),(u.length>0||p.length>0)&&t.jsxs("div",{children:[t.jsx("h2",{style:{marginBottom:12,fontSize:16,color:"var(--text-dim)"},children:"Resolved"}),[...u,...p].map(e=>t.jsxs("div",{style:{background:"#F8FAFC",border:"1px solid var(--border)",borderRadius:12,padding:"14px 18px",marginBottom:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[t.jsx("div",{style:{fontSize:13,color:"var(--text-dim)",fontWeight:500},children:e.action||e.id}),t.jsx("span",{style:{background:(n[e.id]||e.status)==="approve"||(n[e.id]||e.status)==="approved"?"#ECFDF5":"#FEF2F2",color:(n[e.id]||e.status)==="approve"||(n[e.id]||e.status)==="approved"?"var(--mint)":"var(--red)",borderRadius:999,padding:"3px 10px",fontSize:11,fontWeight:600},children:n[e.id]||e.status})]},e.id))]})]})}export{k as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a4 as e,ax as a,am as s}from"./vendor-gUVFsxOc.js";function n(d){if(!d)return"";try{const t=Math.round((Date.now()-new Date(d))/6e4);return t<1?"just now":t<60?`${t}m ago`:t<1440?`${Math.round(t/60)}h ago`:`${Math.round(t/1440)}d ago`}catch{return""}}const l={policy_denied_api:"🚫",policy_approval_requested_api:"🔔",intake_task_created:"📥",job_status_changed:"↔",project_created:"📁",project_updated:"✏️",task_created:"📋",task_updated:"✏️"};function c({data:d}){const t=d?.audit||d?.audit_log||[];return e.jsxs("div",{className:"fade-in",style:{display:"flex",flexDirection:"column",gap:24},children:[e.jsxs("div",{children:[e.jsx("h1",{style:{marginBottom:4},children:"Audit Log"}),e.jsxs("p",{style:{color:"var(--text-dim)",fontSize:14},children:[t.length," audit events"]})]}),t.length===0?e.jsx("div",{className:"card",style:{textAlign:"center",padding:48,color:"var(--muted)",fontSize:13},children:"No audit events recorded yet"}):e.jsx("div",{style:{background:"#fff",border:"1px solid var(--border)",borderRadius:16,overflow:"hidden",boxShadow:"var(--shadow)"},children:t.slice().reverse().map((i,r)=>e.jsxs("div",{style:{display:"flex",gap:14,padding:"12px 18px",borderBottom:"1px solid var(--border)",background:r%2===0?"#fff":"#FAFAFA"},children:[e.jsx("span",{style:{fontSize:18,flexShrink:0},children:l[i.action]||"📝"}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{fontSize:13,fontWeight:600,color:"var(--text)",marginBottom:2},children:i.action?.replace(/_/g," ")}),i.agentId&&e.jsxs("div",{style:{fontSize:11,color:"var(--muted)",display:"flex",alignItems:"center",gap:4},children:[e.jsx(a,{size:10})," ",i.agentId]})]}),e.jsxs("div",{style:{fontSize:11,color:"var(--muted)",flexShrink:0,textAlign:"right",display:"flex",flexDirection:"column",alignItems:"flex-end",gap:2},children:[e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:3},children:[e.jsx(s,{size:10})," ",n(i.ts)]}),i.rule&&e.jsxs("span",{style:{background:"#F1F5F9",borderRadius:999,padding:"1px 6px",fontSize:10},children:["Rule: ",i.rule]})]})]},r))})]})}export{c as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a4 as e,as as h,ad as g}from"./vendor-gUVFsxOc.js";import{R as y,B as f,X as m,Y as j,T as b,d as u,e as v}from"./charts-CjCN_e1M.js";function F({label:c,spent:r,limit:i,threshold:t}){const s=i>0?Math.min(100,r/i*100):0,n=s>=t,d=s>t?"var(--red)":s>t*.8?"var(--amber)":"var(--mint)",p=s>t?"#FEF2F2":s>t*.5?"#FFFBEB":"#F0FDF4",a=s>t?"#FEE2E2":s>t*.5?"#FEF3C7":"#D1FAE5";return e.jsxs("div",{style:{background:p,border:`1px solid ${a}`,borderRadius:16,padding:"20px 24px"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:12},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:11,fontWeight:700,color:"var(--muted)",textTransform:"uppercase",letterSpacing:"0.07em",marginBottom:4},children:c}),e.jsxs("div",{style:{fontSize:24,fontWeight:800,color:"var(--text)"},children:["$",r.toFixed(2)," ",e.jsxs("span",{style:{fontSize:14,color:"var(--muted)",fontWeight:500},children:["/ $",i]})]})]}),e.jsxs("div",{style:{fontSize:22,fontWeight:800,color:d},children:[s.toFixed(0),"%"]})]}),e.jsxs("div",{style:{position:"relative"},children:[e.jsxs("div",{className:"progress-track",style:{height:10,position:"relative"},children:[e.jsx("div",{className:"progress-fill",style:{width:`${s}%`,background:d,height:"100%",borderRadius:8}}),e.jsx("div",{style:{position:"absolute",top:-6,bottom:-6,left:`${t}%`,width:2,background:"var(--amber)",borderRadius:2}})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:8,fontSize:10,color:"var(--muted)",fontWeight:500},children:[e.jsxs("span",{children:["Utilization ",s.toFixed(1),"%"]}),e.jsxs("span",{style:{color:"var(--amber)"},children:["Alert at ",t,"%"]})]})]}),n&&e.jsxs("div",{style:{marginTop:10,display:"flex",alignItems:"center",gap:6,padding:"6px 10px",background:"#FEE2E2",borderRadius:8},children:[e.jsx(g,{size:12,color:"var(--red)"}),e.jsx("span",{style:{fontSize:11,color:"var(--red)",fontWeight:600},children:"Budget threshold exceeded"})]})]})}function x({title:c,data:r}){const i=Object.entries(r).sort(([,t],[,s])=>{const n=typeof t=="object"?t.spent??0:t;return(typeof s=="object"?s.spent??0:s)-n});return e.jsxs("div",{style:{background:"#fff",border:"1px solid var(--border)",borderRadius:16,overflow:"hidden",boxShadow:"var(--shadow)"},children:[e.jsx("div",{style:{background:"#F8FAFC",padding:"12px 16px",borderBottom:"1px solid var(--border)"},children:e.jsx("div",{style:{fontSize:12,fontWeight:700,color:"var(--text)"},children:c})}),i.length===0?e.jsx("div",{style:{padding:32,textAlign:"center",color:"var(--muted)",fontSize:13},children:"No data yet"}):e.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[e.jsx("thead",{children:e.jsx("tr",{style:{background:"#FAFAFA",borderBottom:"1px solid var(--border)"},children:["Name","Spend","Calls"].map(t=>e.jsx("th",{style:{textAlign:t==="Name"?"left":"right",padding:"8px 16px",fontSize:10,color:"var(--muted)",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.07em"},children:t},t))})}),e.jsx("tbody",{children:i.map(([t,s],n)=>{const d=typeof s=="object"?s.spent??0:s,p=typeof s=="object"?s.calls??"—":"—";return e.jsxs("tr",{style:{borderBottom:"1px solid var(--border)",background:n%2===0?"#fff":"#FAFAFA"},children:[e.jsx("td",{style:{padding:"10px 16px",fontWeight:600,color:"var(--text)"},children:t}),e.jsxs("td",{style:{padding:"10px 16px",textAlign:"right",color:"var(--mint)",fontWeight:700,fontFamily:"var(--font-mono)"},children:["$",d.toFixed(3)]}),e.jsx("td",{style:{padding:"10px 16px",textAlign:"right",color:"var(--muted)",fontFamily:"var(--font-mono)"},children:p})]},t)})})]})]})}function z({data:c}){const{budget:r={}}=c||{},i=r.limits||{},t=r.current||{},s=r.alerts||{},n=r.per_agent||{},d=r.per_model||{},p=[{label:"Daily",spent:t.daily_usd??0,limit:i.daily_usd??0,threshold:s.daily_threshold_pct??70},{label:"Weekly",spent:t.weekly_usd??0,limit:i.weekly_usd??0,threshold:s.weekly_threshold_pct??70},{label:"Monthly",spent:t.monthly_usd??0,limit:i.monthly_usd??0,threshold:80}],a=Object.entries(n).map(([o,l])=>({name:o,spent:typeof l=="object"?l.spent??0:l})).sort((o,l)=>l.spent-o.spent).slice(0,10);return e.jsxs("div",{className:"fade-in",style:{display:"flex",flexDirection:"column",gap:28},children:[e.jsxs("div",{children:[e.jsx("h1",{style:{marginBottom:4},children:"Budget & Spend"}),e.jsx("p",{style:{color:"var(--text-dim)",fontSize:14},children:"Resource consumption across daily, weekly, and monthly quotas"})]}),r.notes&&e.jsxs("div",{style:{padding:"14px 18px",background:"#FFFBEB",border:"1px solid #FED7AA",borderRadius:14,display:"flex",alignItems:"flex-start",gap:12},children:[e.jsx("span",{style:{fontSize:20,flexShrink:0},children:"⚠️"}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:12,fontWeight:700,color:"var(--amber)",marginBottom:4},children:"Budget Alert"}),e.jsx("div",{style:{fontSize:13,color:"var(--text)"},children:r.notes})]})]}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:16},children:p.map(o=>e.jsx(F,{...o},o.label))}),a.length>0&&e.jsxs("div",{className:"card",children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:20},children:[e.jsx(h,{size:16,color:"var(--accent)"}),e.jsx("h2",{style:{fontSize:16,margin:0},children:"Spend by Agent"})]}),e.jsx("div",{style:{height:Math.max(200,a.length*40)},children:e.jsx(y,{width:"100%",height:"100%",children:e.jsxs(f,{data:a,layout:"vertical",margin:{left:120,right:30,top:0,bottom:0},children:[e.jsx(m,{type:"number",hide:!0}),e.jsx(j,{type:"category",dataKey:"name",axisLine:!1,tickLine:!1,tick:{fill:"var(--text-dim)",fontSize:12,fontWeight:500},width:110}),e.jsx(b,{contentStyle:{background:"#fff",border:"1px solid var(--border)",borderRadius:10,fontSize:12},formatter:o=>[`$${o.toFixed(3)}`,"Spend"]}),e.jsx(u,{dataKey:"spent",radius:[0,6,6,0],barSize:14,children:a.map((o,l)=>e.jsx(v,{fill:`hsl(${220+l*25}, 70%, 55%)`},l))})]})})})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:20},children:[e.jsx(x,{title:"Spend by Agent",data:n}),e.jsx(x,{title:"Spend by Model",data:d})]})]})}export{z as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as g,a4 as e,ak as h,at as f,au as v}from"./vendor-gUVFsxOc.js";function j({data:c}){const{comms:l={},agents:a=[]}=c||{},[x,p]=g.useState(null),n=Object.keys(l),r=x||n[0],i=a.find(t=>t.id===r),d=l[r]||{};return e.jsxs("div",{className:"fade-in",style:{display:"flex",flexDirection:"column",gap:24},children:[e.jsxs("div",{children:[e.jsx("h1",{style:{marginBottom:4},children:"Agent Communications"}),e.jsx("p",{style:{color:"var(--text-dim)",fontSize:14},children:"View inbox and outbox for each agent"})]}),n.length===0?e.jsxs("div",{className:"card",style:{textAlign:"center",padding:64},children:[e.jsx(h,{size:32,style:{marginBottom:12,opacity:.4}}),e.jsx("div",{style:{fontSize:14,fontWeight:600},children:"No communications yet"})]}):e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"200px 1fr",gap:24,minHeight:400},children:[e.jsx("div",{style:{background:"#fff",border:"1px solid var(--border)",borderRadius:16,overflow:"hidden",boxShadow:"var(--shadow)"},children:n.map(t=>{const o=a.find(m=>m.id===t),s=t===r;return e.jsxs("button",{onClick:()=>p(t),style:{display:"flex",alignItems:"center",gap:10,width:"100%",padding:"12px 14px",background:s?"#EEF2FF":"transparent",border:"none",cursor:"pointer",borderBottom:"1px solid var(--border)",textAlign:"left",borderLeft:s?"3px solid var(--accent)":"3px solid transparent",transition:"all 0.15s"},children:[e.jsx("span",{style:{fontSize:18},children:o?.emoji||"🤖"}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:13,fontWeight:s?700:500,color:s?"var(--accent)":"var(--text)"},children:o?.name||t}),e.jsx("div",{style:{fontSize:10,color:"var(--muted)"},children:o?.role||"Agent"})]})]},t)})}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[i&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"16px",background:"#EEF2FF",borderRadius:14},children:[e.jsx("span",{style:{fontSize:24},children:i.emoji||"🤖"}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:16,fontWeight:700,color:"var(--text)"},children:i.name}),e.jsxs("div",{style:{fontSize:12,color:"var(--muted)"},children:[i.role," · ",i.status]})]})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:16},children:[e.jsxs("div",{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:10},children:[e.jsx(f,{size:14,color:"var(--accent)"}),e.jsx("span",{style:{fontSize:13,fontWeight:700,color:"var(--text)"},children:"Inbox"})]}),e.jsx("div",{style:{background:"#F8FAFC",border:"1px solid var(--border)",borderRadius:12,padding:16,minHeight:200,fontSize:13,color:"var(--text-dim)",lineHeight:1.8,whiteSpace:"pre-wrap",overflowY:"auto",maxHeight:400},children:d.inbox?.trim()||e.jsx("span",{style:{color:"var(--muted)",fontStyle:"italic"},children:"Inbox is empty"})})]}),e.jsxs("div",{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:10},children:[e.jsx(v,{size:14,color:"var(--mint)"}),e.jsx("span",{style:{fontSize:13,fontWeight:700,color:"var(--text)"},children:"Outbox"})]}),e.jsx("div",{style:{background:"#F0FDF4",border:"1px solid #D1FAE5",borderRadius:12,padding:16,minHeight:200,fontSize:13,color:"var(--text-dim)",lineHeight:1.8,whiteSpace:"pre-wrap",overflowY:"auto",maxHeight:400},children:d.outbox?.trim()||e.jsx("span",{style:{color:"var(--muted)",fontStyle:"italic"},children:"Outbox is empty"})})]})]})]})]})]})}export{j as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as p,a4 as e,aF as h,am as g,aA as c,aG as f}from"./vendor-gUVFsxOc.js";import{a as u}from"./index-C5VVgT-r.js";function x(r){if(!r)return"Never";try{const n=Math.round((Date.now()-new Date(r))/6e4);return n<1?"just now":n<60?`${n}m ago`:n<1440?`${Math.round(n/60)}h ago`:`${Math.round(n/1440)}d ago`}catch{return r}}function b({errors:r}){const n=r>=3?"var(--red)":r>0?"var(--amber)":"var(--mint)";return e.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:n,display:"inline-block",flexShrink:0}})}function m({cron:r,toast:n}){const[a,t]=p.useState(null),i=r._consecutive_errors||0;async function d(){t("toggle");try{await u(`/api/crons/${r.id}/toggle`),n?.(r.enabled!==!1?"Job paused":"Job resumed","success")}catch(l){n?.(l.message,"error")}t(null)}async function o(){t("run");try{await u(`/api/crons/${r.id}/run`),n?.("Job triggered","success")}catch(l){n?.(l.message,"error")}t(null)}const s=r.enabled!==!1;return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:14,padding:"14px 18px",borderBottom:"1px solid var(--border)",background:i>=3?"#FFF8F8":"#fff",transition:"background 0.2s"},children:[e.jsx(b,{errors:i}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:3},children:[e.jsx("span",{style:{fontSize:14,fontWeight:600,color:"var(--text)"},children:r.name||r.id}),!s&&e.jsx("span",{style:{fontSize:10,background:"#F1F5F9",color:"var(--muted)",borderRadius:999,padding:"1px 8px",fontWeight:600},children:"Paused"}),i>=3&&e.jsxs("span",{style:{fontSize:10,background:"#FEF2F2",color:"var(--red)",borderRadius:999,padding:"1px 8px",fontWeight:600},children:["⚠ ",i," errors"]})]}),e.jsxs("div",{style:{fontSize:11,color:"var(--muted)",display:"flex",gap:12},children:[e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4},children:[e.jsx(g,{size:10})," ",r.schedule||"No schedule"]}),e.jsxs("span",{children:["Last: ",x(r.last_run)]}),r.next_run&&e.jsxs("span",{children:["Next: ",x(r.next_run)]})]})]}),e.jsxs("div",{style:{display:"flex",gap:8,flexShrink:0},children:[e.jsxs("button",{onClick:o,disabled:!!a,title:"Run now",style:{background:"#EEF2FF",border:"1px solid #E0E7FF",borderRadius:8,padding:"6px 10px",cursor:"pointer",display:"flex",alignItems:"center",gap:4,fontSize:11,color:"var(--accent)",fontWeight:600},children:[e.jsx(c,{size:11})," ",a==="run"?"…":"Run"]}),e.jsxs("button",{onClick:d,disabled:!!a,title:s?"Pause":"Resume",style:{background:s?"#FEF2F2":"#ECFDF5",border:`1px solid ${s?"#FEE2E2":"#D1FAE5"}`,borderRadius:8,padding:"6px 10px",cursor:"pointer",display:"flex",alignItems:"center",gap:4,fontSize:11,color:s?"var(--red)":"var(--mint)",fontWeight:600},children:[s?e.jsx(f,{size:11}):e.jsx(c,{size:11})," ",s?"Pause":"Resume"]})]})]})}function F({data:r,toast:n}){const{crons:a=[]}=r||{},[t,i]=p.useState(""),d=a.filter(s=>!t||(s.name||s.id||"").toLowerCase().includes(t.toLowerCase())),o=a.filter(s=>(s._consecutive_errors||0)>=3);return e.jsxs("div",{className:"fade-in",style:{display:"flex",flexDirection:"column",gap:24},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end"},children:[e.jsxs("div",{children:[e.jsx("h1",{style:{marginBottom:4},children:"Jobs & Crons"}),e.jsxs("p",{style:{color:"var(--text-dim)",fontSize:14},children:[a.length," scheduled jobs"]})]}),e.jsx("input",{className:"input-base",placeholder:"Search jobs…",value:t,onChange:s=>i(s.target.value),style:{width:220}})]}),o.length>0&&e.jsxs("div",{style:{padding:"14px 18px",background:"#FFF1F2",border:"1px solid #FEE2E2",borderRadius:14,display:"flex",alignItems:"center",gap:12},children:[e.jsx(h,{size:18,color:"var(--red)"}),e.jsxs("span",{style:{fontSize:13,fontWeight:600,color:"var(--red)"},children:[o.length," job",o.length>1?"s":""," with repeated errors"]})]}),e.jsxs("div",{style:{background:"#fff",border:"1px solid var(--border)",borderRadius:16,overflow:"hidden",boxShadow:"var(--shadow)"},children:[e.jsxs("div",{style:{background:"#F8FAFC",padding:"10px 18px",borderBottom:"1px solid var(--border)",display:"flex",gap:14,fontSize:10,fontWeight:700,color:"var(--muted)",textTransform:"uppercase",letterSpacing:"0.07em"},children:[e.jsx("span",{style:{flex:1},children:"Job Name"}),e.jsx("span",{style:{minWidth:100},children:"Schedule"}),e.jsx("span",{style:{minWidth:120},children:"Actions"})]}),d.length===0?e.jsx("div",{style:{padding:48,textAlign:"center",color:"var(--muted)",fontSize:13},children:"No jobs match your search"}):d.map(s=>e.jsx(m,{cron:s,toast:n},s.id))]})]})}export{F as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a4 as e,aO as l}from"./vendor-gUVFsxOc.js";function d({data:n}){const{decisions:o=""}=n||{},r=(o||"").split(`
|
|
2
|
+
`).filter(i=>i.trim()),s=[];let t=null;for(const i of r)i.startsWith("#")?(t&&s.push(t),t={title:i.replace(/^#+\s*/,""),body:[]}):t&&t.body.push(i);return t&&s.push(t),e.jsxs("div",{className:"fade-in",style:{display:"flex",flexDirection:"column",gap:24},children:[e.jsxs("div",{children:[e.jsx("h1",{style:{marginBottom:4},children:"Decision Log"}),e.jsx("p",{style:{color:"var(--text-dim)",fontSize:14},children:"Strategic decisions recorded by agents"})]}),s.length===0?e.jsxs("div",{className:"card",style:{textAlign:"center",padding:64},children:[e.jsx(l,{size:32,style:{marginBottom:12,opacity:.4}}),e.jsx("div",{style:{fontSize:14,fontWeight:600},children:"No decisions logged yet"})]}):e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12},children:s.map((i,c)=>e.jsxs("div",{className:"card",children:[e.jsxs("div",{style:{fontSize:15,fontWeight:700,color:"var(--text)",marginBottom:8,display:"flex",alignItems:"center",gap:8},children:[e.jsx(l,{size:15,color:"var(--accent)"})," ",i.title]}),e.jsx("div",{style:{fontSize:13,color:"var(--text-dim)",lineHeight:1.7,whiteSpace:"pre-wrap"},children:i.body.join(`
|
|
3
|
+
`)})]},c))})]})}export{d as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a4 as e,aD as a}from"./vendor-gUVFsxOc.js";function o({data:s}){const{failures:l=""}=s||{},r=(l||"").split(`
|
|
2
|
+
`).filter(i=>i.trim());return e.jsxs("div",{className:"fade-in",style:{display:"flex",flexDirection:"column",gap:24},children:[e.jsxs("div",{children:[e.jsx("h1",{style:{marginBottom:4},children:"Failures Log"}),e.jsxs("p",{style:{color:"var(--text-dim)",fontSize:14},children:[r.length," entries in the failure log"]})]}),r.length===0?e.jsxs("div",{className:"card",style:{textAlign:"center",padding:64},children:[e.jsx("div",{style:{fontSize:32,marginBottom:12},children:"✅"}),e.jsx("div",{style:{fontSize:14,fontWeight:600},children:"No failures recorded"}),e.jsx("div",{style:{fontSize:12,color:"var(--muted)",marginTop:4},children:"Agents log failures to FAILURES.md as they occur"})]}):e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:r.map((i,n)=>{const t=/critical|fatal|crashed/i.test(i);return e.jsxs("div",{style:{display:"flex",gap:12,padding:"12px 16px",alignItems:"flex-start",background:t?"#FFF1F2":"#F8FAFC",border:`1px solid ${t?"#FEE2E2":"var(--border)"}`,borderRadius:10},children:[e.jsx(a,{size:15,color:t?"var(--red)":"var(--muted)",style:{flexShrink:0,marginTop:1}}),e.jsx("span",{style:{fontSize:13,color:"var(--text-dim)",lineHeight:1.6},children:i})]},n)})})]})}export{o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as x,a4 as e,am as u,aB as f,aD as m}from"./vendor-gUVFsxOc.js";import{a as v}from"./index-C5VVgT-r.js";function y(i){if(!i)return"—";try{const n=Math.round((Date.now()-new Date(i))/6e4);return n<1?"just now":n<60?`${n}m ago`:n<1440?`${Math.round(n/60)}h ago`:`${Math.round(n/1440)}d ago`}catch{return i}}function j({task:i,agents:n,onAction:d,toast:c}){const[s,p]=x.useState(""),[t,r]=x.useState(null),a=n.find(o=>o.id===i.assigned_to),l=(i.sla?.priority||i.priority||"").toUpperCase();async function g(o){r(o);try{await v(`/api/hitl/${i.id}/${o}`,{note:s||void 0}),d(i.id,o)}catch(h){c?.(h.message,"error")}r(null)}return e.jsxs("div",{style:{background:"#FDFCFF",border:"2px solid #EDE9FE",borderRadius:16,padding:24,display:"flex",flexDirection:"column",gap:16,boxShadow:"0 4px 24px rgba(139,92,246,0.08)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:14},children:[e.jsx("span",{style:{fontSize:28,flexShrink:0},children:"🔔"}),e.jsxs("div",{style:{flex:1},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6,flexWrap:"wrap"},children:[e.jsx("span",{style:{fontWeight:700,fontSize:16,color:"var(--text)"},children:i.title}),e.jsx("span",{style:{fontSize:10,color:"var(--muted)",fontFamily:"var(--font-mono)"},children:i.id}),l&&e.jsx("span",{style:{background:l==="P1"?"#FEF2F2":"#F1F5F9",color:l==="P1"?"var(--red)":"var(--muted)",borderRadius:999,padding:"2px 8px",fontSize:10,fontWeight:700},children:l})]}),e.jsxs("div",{style:{fontSize:12,color:"var(--text-dim)",display:"flex",alignItems:"center",gap:6},children:[a&&e.jsxs("span",{children:[a.emoji," ",a.name," ·"]}),e.jsx(u,{size:11,style:{flexShrink:0}}),e.jsxs("span",{children:["Waiting ",e.jsx("span",{style:{color:"var(--amber)",fontWeight:600},children:y(i.created_at)})]}),i.sla?.deadline&&e.jsxs("span",{children:["· Due ",new Date(i.sla.deadline).toLocaleString()]})]})]})]}),e.jsxs("div",{style:{padding:"14px 16px",background:"#F5F3FF",border:"1px solid #EDE9FE",borderRadius:12},children:[e.jsx("div",{style:{fontSize:10,color:"var(--purple)",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.06em",marginBottom:8},children:"⚡ Decision Required"}),e.jsx("div",{style:{fontSize:13,color:"var(--text)",lineHeight:1.7},children:i.hitl_reason||"Human decision required before agent can proceed."})]}),i.description&&e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:11,color:"var(--muted)",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",marginBottom:6},children:"Context"}),e.jsx("div",{style:{fontSize:13,color:"var(--text-dim)",lineHeight:1.6,background:"#F8FAFC",padding:14,borderRadius:10,border:"1px solid var(--border)"},children:i.description})]}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:11,color:"var(--muted)",fontWeight:500,marginBottom:6},children:"Add a note for the agent (optional)"}),e.jsx("input",{value:s,onChange:o=>p(o.target.value),placeholder:"Provide guidance or context…",className:"input-base",style:{width:"100%",boxSizing:"border-box"}})]}),e.jsxs("div",{style:{display:"flex",gap:12},children:[e.jsxs("button",{onClick:()=>g("approve"),disabled:!!t,style:{flex:1,padding:"12px",background:t==="approve"?"#D1FAE5":"#ECFDF5",border:"1px solid #6EE7B7",color:"var(--mint)",borderRadius:12,fontFamily:"inherit",fontSize:14,fontWeight:700,cursor:t?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:8,transition:"all 0.15s"},children:[e.jsx(f,{size:16})," ",t==="approve"?"Processing…":"✅ Approve — Continue"]}),e.jsxs("button",{onClick:()=>g("reject"),disabled:!!t,style:{flex:1,padding:"12px",background:t==="reject"?"#FEE2E2":"#FEF2F2",border:"1px solid #FCA5A5",color:"var(--red)",borderRadius:12,fontFamily:"inherit",fontSize:14,fontWeight:700,cursor:t?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:8,transition:"all 0.15s"},children:[e.jsx(m,{size:16})," ",t==="reject"?"Processing…":"❌ Reject — Block"]})]})]})}function S({data:i,toast:n}){const{hitl_tasks:d=[],agents:c=[]}=i||{},[s,p]=x.useState(new Set),t=d.filter(r=>!s.has(r.id));return e.jsxs("div",{className:"fade-in",style:{display:"flex",flexDirection:"column",gap:24},children:[e.jsxs("div",{children:[e.jsx("h1",{style:{marginBottom:4},children:"HITL Queue"}),e.jsx("p",{style:{color:"var(--text-dim)",fontSize:14},children:"Human-in-the-loop decisions requiring your input"})]}),e.jsxs("div",{style:{padding:"16px 20px",borderRadius:14,display:"flex",alignItems:"center",gap:12,background:t.length>0?"#FFF7ED":"#ECFDF5",border:`1px solid ${t.length>0?"#FED7AA":"#A7F3D0"}`},children:[e.jsx("span",{style:{fontSize:22},children:t.length>0?"🔔":"✅"}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:15,fontWeight:700,color:t.length>0?"var(--amber)":"var(--mint)"},children:t.length>0?`${t.length} decision${t.length>1?"s":""} awaiting your input`:"All clear — no pending decisions"}),e.jsx("div",{style:{fontSize:12,color:"var(--text-dim)",marginTop:2},children:t.length>0?"Agents are paused at approval gates below":"All agents are running autonomously"})]}),s.size>0&&e.jsxs("div",{style:{marginLeft:"auto",fontSize:12,color:"var(--mint)",fontWeight:600},children:[s.size," resolved this session"]})]}),t.map(r=>e.jsx(j,{task:r,agents:c,toast:n,onAction:a=>p(l=>new Set([...l,a]))},r.id))]})}export{S as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a4 as e,aC as a}from"./vendor-gUVFsxOc.js";function i({data:s}){const{jobs:d=[]}=s||{};return e.jsxs("div",{className:"fade-in",style:{display:"flex",flexDirection:"column",gap:24},children:[e.jsxs("div",{children:[e.jsx("h1",{style:{marginBottom:4},children:"Jobs"}),e.jsxs("p",{style:{color:"var(--text-dim)",fontSize:14},children:[d.length," jobs tracked"]})]}),d.length===0?e.jsxs("div",{className:"card",style:{textAlign:"center",padding:64},children:[e.jsx(a,{size:32,style:{marginBottom:12,opacity:.4}}),e.jsx("div",{style:{fontSize:14,fontWeight:600},children:"No jobs yet"})]}):e.jsx("div",{style:{background:"#fff",border:"1px solid var(--border)",borderRadius:16,overflow:"hidden",boxShadow:"var(--shadow)"},children:e.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsx("tr",{style:{background:"#F8FAFC",borderBottom:"1px solid var(--border)"},children:["ID","Name","Status","Agent","Created"].map(t=>e.jsx("th",{style:{padding:"10px 16px",textAlign:"left",fontSize:10,color:"var(--muted)",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.07em"},children:t},t))})}),e.jsx("tbody",{children:d.map((t,r)=>e.jsxs("tr",{style:{borderBottom:"1px solid var(--border)",background:r%2===0?"#fff":"#FAFAFA"},children:[e.jsx("td",{style:{padding:"10px 16px",fontSize:11,color:"var(--muted)",fontFamily:"var(--font-mono)"},children:t.id?.slice(0,12)||"--"}),e.jsx("td",{style:{padding:"10px 16px",fontSize:13,fontWeight:600,color:"var(--text)"},children:t.name||t.title||"--"}),e.jsx("td",{style:{padding:"10px 16px"},children:e.jsx("span",{style:{background:t.status==="done"?"#ECFDF5":t.status==="failed"?"#FEF2F2":"#EEF2FF",color:t.status==="done"?"var(--mint)":t.status==="failed"?"var(--red)":"var(--accent)",borderRadius:999,padding:"3px 10px",fontSize:11,fontWeight:600},children:t.status||"unknown"})}),e.jsx("td",{style:{padding:"10px 16px",fontSize:12,color:"var(--text-dim)"},children:t.agent||t.assigned_to||"—"}),e.jsx("td",{style:{padding:"10px 16px",fontSize:11,color:"var(--muted)"},children:t.created_at?new Date(t.created_at).toLocaleDateString():"—"})]},t.id||r))})]})})]})}export{i as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as d,a4 as e,aK as g,aj as p,am as u,aL as f}from"./vendor-gUVFsxOc.js";function h(t){if(!t)return"";try{const s=Math.round((Date.now()-new Date(t))/6e4);return s<60?`${s}m ago`:s<1440?`${Math.round(s/60)}h ago`:`${Math.round(s/1440)}d ago`}catch{return""}}function y({item:t}){const[s,o]=d.useState(!1);return e.jsx("div",{style:{background:"#fff",border:"1px solid var(--border)",borderRadius:14,overflow:"hidden",transition:"box-shadow 0.2s"},onMouseOver:a=>a.currentTarget.style.boxShadow="var(--shadow-lg)",onMouseOut:a=>a.currentTarget.style.boxShadow="",children:e.jsxs("div",{onClick:()=>o(!s),style:{padding:"16px 18px",cursor:"pointer"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:8},children:[e.jsx("div",{style:{fontSize:14,fontWeight:700,color:"var(--text)",flex:1,paddingRight:10},children:t.title||t.key||"Untitled"}),t.category&&e.jsx("span",{style:{background:"#EEF2FF",color:"var(--accent)",borderRadius:999,padding:"2px 10px",fontSize:10,fontWeight:600,flexShrink:0},children:t.category})]}),e.jsx("div",{style:{fontSize:13,color:"var(--text-dim)",lineHeight:1.5,display:"-webkit-box",WebkitLineClamp:s?"none":2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:t.content||t.value||t.summary||""}),e.jsxs("div",{style:{display:"flex",gap:10,marginTop:10,alignItems:"center"},children:[t.agent&&e.jsx("span",{style:{fontSize:11,color:"var(--muted)"},children:t.agent}),t.timestamp&&e.jsxs("span",{style:{fontSize:11,color:"var(--muted)",display:"flex",alignItems:"center",gap:3},children:[e.jsx(u,{size:10}),h(t.timestamp)]}),t.tags?.map(a=>e.jsxs("span",{style:{background:"#F1F5F9",color:"var(--muted)",borderRadius:999,padding:"1px 8px",fontSize:10,display:"flex",alignItems:"center",gap:3},children:[e.jsx(f,{size:9}),a]},a))]})]})})}function j({data:t}){const{shared_knowledge:s=[],knowledge:o=[]}=t||{},[a,c]=d.useState(""),l=s.length>0?s:o,i=l.filter(n=>{if(!a)return!0;const r=a.toLowerCase();return(n.title||n.key||"").toLowerCase().includes(r)||(n.content||n.summary||"").toLowerCase().includes(r)||(n.tags||[]).some(x=>x.toLowerCase().includes(r))});return e.jsxs("div",{className:"fade-in",style:{display:"flex",flexDirection:"column",gap:24},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end"},children:[e.jsxs("div",{children:[e.jsx("h1",{style:{marginBottom:4},children:"Knowledge Base"}),e.jsxs("p",{style:{color:"var(--text-dim)",fontSize:14},children:[l.length," shared knowledge entries"]})]}),e.jsxs("div",{style:{position:"relative"},children:[e.jsx(g,{size:14,style:{position:"absolute",left:10,top:"50%",transform:"translateY(-50%)",color:"var(--muted)"}}),e.jsx("input",{className:"input-base",placeholder:"Search knowledge…",value:a,onChange:n=>c(n.target.value),style:{paddingLeft:32,width:240}})]})]}),i.length===0?e.jsxs("div",{className:"card",style:{textAlign:"center",padding:64},children:[e.jsx(p,{size:32,style:{marginBottom:12,opacity:.4}}),e.jsx("div",{style:{fontSize:14,fontWeight:600},children:l.length===0?"No knowledge entries yet":"No results found"})]}):e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(340px, 1fr))",gap:16},children:i.map((n,r)=>e.jsx(y,{item:n},n.id||n.key||r))})]})}export{j as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a4 as e,aM as s}from"./vendor-gUVFsxOc.js";function l({title:r,content:i,icon:t}){return i?.trim()?(i.split(`
|
|
2
|
+
`),e.jsxs("div",{className:"card",style:{display:"flex",flexDirection:"column",gap:12},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[t&&e.jsx("span",{style:{fontSize:18},children:t}),e.jsx("h2",{style:{fontSize:16,margin:0},children:r})]}),e.jsx("div",{style:{background:"#F8FAFC",borderRadius:10,padding:"16px",fontSize:13,lineHeight:1.8,color:"var(--text-dim)",whiteSpace:"pre-wrap",fontFamily:"var(--font-main)",maxHeight:400,overflowY:"auto",border:"1px solid var(--border)"},children:i})]})):null}function o({data:r}){const{memory:i="",memory_lines:t=0}=r||{};return e.jsxs("div",{className:"fade-in",style:{display:"flex",flexDirection:"column",gap:24},children:[e.jsxs("div",{children:[e.jsx("h1",{style:{marginBottom:4},children:"Shared Memory"}),e.jsxs("p",{style:{color:"var(--text-dim)",fontSize:14},children:[t," lines in the shared memory file"]})]}),i?.trim()?e.jsx(l,{title:"Memory Contents",content:i,icon:"🧠"}):e.jsxs("div",{className:"card",style:{textAlign:"center",padding:64},children:[e.jsx(s,{size:32,style:{marginBottom:12,opacity:.4}}),e.jsx("div",{style:{fontSize:14,fontWeight:600},children:"Memory is empty"}),e.jsx("div",{style:{fontSize:12,color:"var(--muted)",marginTop:4},children:"Agents will populate MEMORY.md as they work"})]})]})}export{o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a4 as e,ah as d}from"./vendor-gUVFsxOc.js";function m({kr:s}){const r=Math.round((s.current??0)/(s.target??1)*100),i=Math.min(100,Math.max(0,r)),t=i>=100?"var(--mint)":i>=60?"var(--accent)":i>=30?"var(--amber)":"var(--red)";return e.jsxs("div",{style:{marginBottom:12},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:12,marginBottom:5},children:[e.jsx("span",{style:{color:"var(--text)",fontWeight:500,flex:1,paddingRight:12},children:s.description||s.id}),e.jsxs("span",{style:{fontWeight:700,color:t,flexShrink:0},children:[i,"%"]})]}),e.jsx("div",{className:"progress-track",children:e.jsx("div",{className:"progress-fill",style:{width:`${i}%`,background:t}})}),e.jsxs("div",{style:{fontSize:10,color:"var(--muted)",marginTop:3},children:[s.current??0," / ",s.target??"?"," ",s.unit||""]})]})}function g({data:s}){const{okrs:r={}}=s||{},i=r.objectives||r.okrs||(Array.isArray(r)?r:[]);return e.jsxs("div",{className:"fade-in",style:{display:"flex",flexDirection:"column",gap:24},children:[e.jsxs("div",{children:[e.jsx("h1",{style:{marginBottom:4},children:"OKRs & Goals"}),e.jsx("p",{style:{color:"var(--text-dim)",fontSize:14},children:"Objectives and key results tracking"})]}),i.length===0?e.jsxs("div",{className:"card",style:{textAlign:"center",padding:64},children:[e.jsx(d,{size:32,style:{marginBottom:12,opacity:.4}}),e.jsx("div",{style:{fontSize:14,fontWeight:600},children:"No OKRs configured"}),e.jsx("div",{style:{fontSize:12,color:"var(--muted)",marginTop:4},children:"Define objectives in OKRs.json"})]}):e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(380px, 1fr))",gap:20},children:i.map((t,x)=>{const n=t.key_results||t.krs||[],l=n.length>0?Math.round(n.reduce((a,c)=>a+Math.min(100,(c.current??0)/(c.target??1)*100),0)/n.length):0,o=l>=80?"var(--mint)":l>=50?"var(--accent)":"var(--amber)";return e.jsxs("div",{className:"card",style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"},children:[e.jsxs("div",{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[e.jsx(d,{size:16,color:"var(--accent)"}),e.jsx("span",{style:{fontSize:15,fontWeight:700,color:"var(--text)"},children:t.objective||t.title||t.id})]}),t.owner&&e.jsxs("div",{style:{fontSize:11,color:"var(--muted)"},children:["Owner: ",t.owner]})]}),e.jsxs("div",{style:{fontSize:22,fontWeight:800,color:o},children:[l,"%"]})]}),e.jsx("div",{className:"progress-track",children:e.jsx("div",{className:"progress-fill",style:{width:`${l}%`,background:o}})}),n.length>0&&e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:11,fontWeight:700,color:"var(--muted)",textTransform:"uppercase",letterSpacing:"0.05em",marginBottom:12},children:"Key Results"}),n.map((a,c)=>e.jsx(m,{kr:a},a.id||c))]})]},t.id||x)})})]})}export{g as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a4 as e,aa as y,ag as v,ad as j,af as b,as as F}from"./vendor-gUVFsxOc.js";function k(t){const n=t._task_counts||{},s=t.target_completion?Math.ceil((new Date(t.target_completion)-Date.now())/864e5):999;return(n.blocked||0)>2||s<-3?"critical":(n.hitl||0)>0||s<0?"at-risk":"healthy"}function S(t,n,s){const r=n.filter(o=>(t.task_ids||[]).includes(o.id)),l=r.filter(o=>o.status==="complete").length,i=r.length,c=(t.team||[]).map(o=>s.find(g=>g.id===o)).filter(Boolean);return{...t,_task_counts:{total:i,done:l,active:r.filter(o=>o.status==="in-progress").length,blocked:r.filter(o=>o.status==="blocked").length,hitl:r.filter(o=>o.status==="needs_human_decision").length},_progress_pct:i>0?Math.round(l/i*100):0,_team_agents:c}}const f={healthy:{color:"var(--mint)",bg:"#ECFDF5",text:"On Track",borderColor:"#D1FAE5"},"at-risk":{color:"var(--amber)",bg:"#FFFBEB",text:"At Risk",borderColor:"#FEF3C7"},critical:{color:"var(--red)",bg:"#FEF2F2",text:"Critical",borderColor:"#FEE2E2"}};function p({icon:t,label:n,value:s,sub:r,color:l,accentBg:i}){return e.jsxs("div",{className:"card",style:{display:"flex",alignItems:"center",gap:16},children:[e.jsx("div",{style:{width:48,height:48,borderRadius:14,background:i||"#EEF2FF",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(t,{size:20,color:l||"var(--accent)",strokeWidth:2})}),e.jsxs("div",{style:{minWidth:0},children:[e.jsx("div",{style:{fontSize:11,color:"var(--muted)",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em"},children:n}),e.jsx("div",{style:{fontSize:26,fontWeight:700,color:"var(--text)",lineHeight:1.2,marginTop:2},children:s}),r&&e.jsx("div",{style:{fontSize:11,color:"var(--text-dim)",marginTop:2},children:r})]})]})}function z({project:t}){const n=k(t),s=f[n]||f.healthy,r=t._progress_pct??0,l=t._task_counts||{};return e.jsxs("div",{style:{background:s.bg,border:`1px solid ${s.borderColor}`,borderRadius:16,padding:"18px 20px",display:"flex",flexDirection:"column",gap:12,transition:"transform 0.2s, box-shadow 0.2s"},onMouseOver:i=>{i.currentTarget.style.transform="translateY(-2px)",i.currentTarget.style.boxShadow="var(--shadow-lg)"},onMouseOut:i=>{i.currentTarget.style.transform="",i.currentTarget.style.boxShadow=""},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:15,fontWeight:700,color:"var(--text)",marginBottom:3},children:t.name||t.id}),e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:5,background:s.color+"22",color:s.color,borderRadius:999,padding:"2px 8px",fontSize:11,fontWeight:600},children:[e.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:s.color,display:"inline-block"}}),s.text]})]}),e.jsxs("div",{style:{fontSize:22,fontWeight:800,color:s.color},children:[r,"%"]})]}),e.jsx("div",{className:"progress-track",children:e.jsx("div",{className:"progress-fill",style:{width:`${r}%`,background:s.color}})}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:4,textAlign:"center"},children:[{v:`${l.done}/${l.total}`,l:"Done"},{v:l.active,l:"Active"},{v:l.hitl,l:"HITL"},{v:l.blocked,l:"Blocked"}].map(i=>e.jsxs("div",{style:{background:"rgba(255,255,255,0.7)",borderRadius:8,padding:"6px 4px"},children:[e.jsx("div",{style:{fontSize:14,fontWeight:700,color:"var(--text)"},children:i.v??0}),e.jsx("div",{style:{fontSize:9,color:"var(--muted)",fontWeight:600,textTransform:"uppercase"},children:i.l})]},i.l))}),t._team_agents?.length>0&&e.jsx("div",{style:{display:"flex",gap:4,paddingTop:8,borderTop:"1px solid rgba(0,0,0,0.06)"},children:t._team_agents.slice(0,6).map(i=>e.jsx("span",{title:i.name,style:{fontSize:14},children:i.emoji||"🤖"},i.id))})]})}function T({agent:t,tasks:n}){const s=n.filter(a=>a.assigned_to===t.id),r=s.find(a=>a.status==="in-progress"),l=s.find(a=>a.status==="needs_human_decision"),i=t.heartbeat_age_minutes??999,c=!!r,o=!!l,g=o?"#F5F3FF":c?"#EEF2FF":"#F8FAFC",h=i<5?"var(--mint)":i<15?"var(--amber)":"var(--red)";return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"10px 16px",borderBottom:"1px solid var(--border)",background:g,transition:"background 0.2s"},children:[e.jsx("span",{style:{fontSize:20,flexShrink:0},children:t.emoji||"🤖"}),e.jsxs("div",{style:{minWidth:120,flex:"0 0 120px"},children:[e.jsx("div",{style:{fontSize:13,fontWeight:600,color:"var(--text)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.name||t.id}),e.jsx("div",{style:{fontSize:10,color:"var(--muted)",textTransform:"capitalize",fontWeight:500},children:t.status||"unknown"})]}),e.jsx("div",{style:{flex:1,minWidth:0},children:o?e.jsxs("span",{style:{fontSize:12,color:"var(--purple)",fontWeight:600},children:["🔔 HITL: ",l.title]}):c?e.jsxs("span",{style:{fontSize:12,color:"var(--accent)",fontWeight:500,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:["▶ ",r.title]}):e.jsx("span",{style:{fontSize:12,color:"var(--muted)"},children:"Idle"})}),e.jsxs("div",{style:{textAlign:"center",minWidth:50},children:[e.jsx("div",{style:{fontSize:15,fontWeight:700,color:"var(--text)"},children:t.tasks_completed??0}),e.jsx("div",{style:{fontSize:9,color:"var(--muted)",fontWeight:600,textTransform:"uppercase"},children:"Done"})]}),e.jsx("div",{style:{minWidth:38,textAlign:"right",fontSize:11,fontWeight:700,color:h},children:i<999?`${i}m`:"--"})]})}function w({broadcast:t}){const n=(t||"").split(`
|
|
2
|
+
`).filter(s=>s.trim()).slice(-8);return e.jsxs("div",{style:{background:"#FAFAFA",border:"1px solid var(--border)",borderRadius:16,padding:"16px",display:"flex",flexDirection:"column",gap:8,minHeight:260,overflowY:"auto"},children:[n.length>0?n.map((s,r)=>{const l=/critical|failed/i.test(s),i=/hitl/i.test(s),c=/success|complete|done/i.test(s),o=l?"var(--red)":i?"var(--purple)":c?"var(--mint)":"var(--text-dim)";return e.jsxs("div",{style:{display:"flex",gap:10,alignItems:"flex-start"},children:[e.jsx("span",{style:{fontSize:10,color:"var(--muted)",fontFamily:"var(--font-mono)",flexShrink:0,marginTop:1},children:new Date().toLocaleTimeString([],{hour12:!0,hour:"2-digit",minute:"2-digit"})}),e.jsx("span",{style:{fontSize:12,color:o,lineHeight:1.5},children:s})]},r)}):e.jsx("div",{style:{color:"var(--muted)",fontSize:12,textAlign:"center",marginTop:40},children:"Awaiting live events…"}),e.jsxs("div",{style:{marginTop:"auto",paddingTop:8,borderTop:"1px solid var(--border)",display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--mint)",display:"inline-block",animation:"pulse 2s infinite"}}),e.jsx("span",{style:{fontSize:10,color:"var(--mint)",fontWeight:600},children:"Live"})]})]})}function _({data:t}){const{agents:n=[],tasks:s=[],task_counts:r={},projects:l=[],budget:i={},broadcast:c="",alerts:o=[]}=t||{},g=l.map(d=>S(d,s,n)),h=g.filter(d=>["active","ACTIVE"].includes(d.status)),a=i.current?.daily_usd??0,x=i.limits?.daily_usd??1,m=r.needs_human_decision??0,u=n.filter(d=>d.status!=="available").length;return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:32},children:[e.jsxs("div",{children:[e.jsx("h1",{style:{marginBottom:4},children:"Operations Overview"}),e.jsx("p",{style:{color:"var(--text-dim)",fontSize:14},children:"Real-time view of your AGI team and active projects"})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:16},children:[e.jsx(p,{icon:y,label:"Active Agents",value:`${u}/${n.length}`,color:"var(--accent)",accentBg:"#EEF2FF"}),e.jsx(p,{icon:v,label:"Active Projects",value:h.length,color:"var(--cyan)",accentBg:"#ECFEFF",sub:`of ${g.length} total`}),e.jsx(p,{icon:j,label:"HITL Queue",value:m,color:m>0?"var(--purple)":"var(--mint)",accentBg:m>0?"#F5F3FF":"#ECFDF5",sub:"Needs your input"}),e.jsx(p,{icon:b,label:"Daily Spend",value:`$${a.toFixed(2)}`,color:"var(--mint)",accentBg:"#ECFDF5",sub:`of $${x} limit`})]}),e.jsxs("div",{className:"card",style:{padding:"16px 24px",display:"flex",alignItems:"center",gap:20},children:[e.jsx(F,{size:16,color:"var(--accent)"}),e.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--text-dim)",minWidth:120},children:"Daily Budget Usage"}),e.jsx("div",{className:"progress-track",style:{flex:1},children:e.jsx("div",{className:"progress-fill",style:{width:`${Math.min(100,a/x*100)}%`,background:a/x>.8?"var(--red)":a/x>.6?"var(--amber)":"var(--mint)"}})}),e.jsxs("span",{style:{fontSize:13,fontWeight:700,color:"var(--text)",minWidth:60,textAlign:"right"},children:[Math.round(a/x*100),"%"]})]}),e.jsxs("div",{children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:16},children:[e.jsx("h2",{children:"Project Matrix"}),e.jsxs("span",{style:{fontSize:12,color:"var(--muted)"},children:[h.length," active"]})]}),h.length>0?e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(300px, 1fr))",gap:16},children:h.map(d=>e.jsx(z,{project:d},d.id))}):e.jsxs("div",{className:"card",style:{textAlign:"center",padding:"64px",color:"var(--muted)"},children:[e.jsx(v,{size:32,style:{marginBottom:12,opacity:.4}}),e.jsx("div",{style:{fontSize:13,fontWeight:500},children:"No active projects"})]})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1.6fr) minmax(0, 1fr)",gap:24},children:[e.jsxs("div",{children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:12},children:[e.jsx("h2",{children:"Fleet Pulse"}),e.jsxs("span",{style:{fontSize:12,color:"var(--muted)"},children:[n.length," agents"]})]}),e.jsxs("div",{className:"card",style:{padding:0,overflow:"hidden"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"8px 16px",background:"#F8FAFC",borderBottom:"1px solid var(--border)",fontSize:10,fontWeight:700,color:"var(--muted)",textTransform:"uppercase",letterSpacing:"0.07em"},children:[e.jsx("span",{style:{minWidth:20}}),e.jsx("span",{style:{minWidth:120},children:"Agent"}),e.jsx("span",{style:{flex:1},children:"Current Work"}),e.jsx("span",{style:{minWidth:50,textAlign:"center"},children:"Done"}),e.jsx("span",{style:{minWidth:38,textAlign:"right"},children:"HB"})]}),n.length>0?n.map(d=>e.jsx(T,{agent:d,tasks:s},d.id)):e.jsx("div",{style:{padding:32,textAlign:"center",color:"var(--muted)",fontSize:13},children:"No agents found"})]})]}),e.jsxs("div",{children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:12},children:[e.jsx("h2",{children:"Event Stream"}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:5},children:[e.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--mint)",display:"inline-block"}}),e.jsx("span",{style:{fontSize:11,color:"var(--mint)",fontWeight:600},children:"Live"})]})]}),e.jsx(w,{broadcast:c})]})]}),e.jsx("style",{children:"@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.4;} }"})]})}export{_ as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a4 as e,aB as n,aD as l,ai as d}from"./vendor-gUVFsxOc.js";function c({data:t}){const{featureFlags:a={}}=t||{},r=t?.policies||[];return e.jsxs("div",{className:"fade-in",style:{display:"flex",flexDirection:"column",gap:24},children:[e.jsxs("div",{children:[e.jsx("h1",{style:{marginBottom:4},children:"Policies & Governance"}),e.jsx("p",{style:{color:"var(--text-dim)",fontSize:14},children:"Feature flags and policy rules governing agent behavior"})]}),e.jsxs("div",{className:"card",children:[e.jsx("h2",{style:{fontSize:15,marginBottom:16},children:"Feature Flags"}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:10},children:Object.entries(a).map(([i,s])=>e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"12px 14px",background:s?"#ECFDF5":"#F8FAFC",border:`1px solid ${s?"#D1FAE5":"var(--border)"}`,borderRadius:10},children:[s?e.jsx(n,{size:14,color:"var(--mint)"}):e.jsx(l,{size:14,color:"var(--muted)"}),e.jsx("span",{style:{fontSize:13,fontWeight:500,color:s?"var(--text)":"var(--muted)",fontFamily:"var(--font-mono)"},children:i})]},i))})]}),r.length>0&&e.jsxs("div",{className:"card",children:[e.jsxs("h2",{style:{fontSize:15,marginBottom:16,display:"flex",alignItems:"center",gap:8},children:[e.jsx(d,{size:16,color:"var(--accent)"})," Policy Rules"]}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:r.map((i,s)=>e.jsxs("div",{style:{padding:"14px 16px",background:"#F8FAFC",border:"1px solid var(--border)",borderRadius:10,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:13,fontWeight:600,color:"var(--text)",marginBottom:3},children:i.name||i.id}),i.description&&e.jsx("div",{style:{fontSize:12,color:"var(--muted)"},children:i.description})]}),e.jsx("span",{style:{background:i.enabled!==!1?"#ECFDF5":"#F8FAFC",color:i.enabled!==!1?"var(--mint)":"var(--muted)",borderRadius:999,padding:"3px 10px",fontSize:11,fontWeight:600},children:i.enabled!==!1?"Active":"Inactive"})]},i.id||s))})]}),Object.keys(a).length===0&&r.length===0&&e.jsx("div",{className:"card",style:{textAlign:"center",padding:48,color:"var(--muted)",fontSize:13},children:"No policies or feature flags configured"})]})}export{c as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a4 as e,an as d,al as l,aN as a}from"./vendor-gUVFsxOc.js";function o({proc:s}){const t=s.status==="running"?"var(--mint)":s.status==="error"?"var(--red)":"var(--muted)",n=s.status==="running"?"#ECFDF5":s.status==="error"?"#FEF2F2":"#F8FAFC";return e.jsxs("div",{className:"card",style:{display:"flex",flexDirection:"column",gap:12},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:14,fontWeight:700,color:"var(--text)",marginBottom:3},children:s.name||s.id}),e.jsxs("div",{style:{fontSize:11,color:"var(--muted)",fontFamily:"var(--font-mono)"},children:["PID: ",s.pid||"—"]})]}),e.jsx("span",{style:{background:n,color:t,borderRadius:999,padding:"3px 10px",fontSize:11,fontWeight:600},children:s.status||"unknown"})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[s.cpu_pct!==void 0&&e.jsxs("div",{style:{background:"#F8FAFC",borderRadius:8,padding:"8px 12px"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:5,fontSize:10,color:"var(--muted)",marginBottom:3},children:[e.jsx(l,{size:10})," CPU"]}),e.jsxs("div",{style:{fontSize:16,fontWeight:700,color:"var(--text)"},children:[s.cpu_pct?.toFixed(1),"%"]})]}),s.mem_mb!==void 0&&e.jsxs("div",{style:{background:"#F8FAFC",borderRadius:8,padding:"8px 12px"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:5,fontSize:10,color:"var(--muted)",marginBottom:3},children:[e.jsx(a,{size:10})," Memory"]}),e.jsxs("div",{style:{fontSize:16,fontWeight:700,color:"var(--text)"},children:[s.mem_mb?.toFixed(0),"MB"]})]})]}),s.description&&e.jsx("div",{style:{fontSize:12,color:"var(--text-dim)"},children:s.description})]})}function x({data:s}){const{processes:t=[]}=s||{},n=t.filter(i=>i.status==="running").length;return e.jsxs("div",{className:"fade-in",style:{display:"flex",flexDirection:"column",gap:24},children:[e.jsxs("div",{children:[e.jsx("h1",{style:{marginBottom:4},children:"System Processes"}),e.jsxs("p",{style:{color:"var(--text-dim)",fontSize:14},children:[n," of ",t.length," processes running"]})]}),t.length===0?e.jsxs("div",{className:"card",style:{textAlign:"center",padding:64},children:[e.jsx(d,{size:32,style:{marginBottom:12,opacity:.4}}),e.jsx("div",{style:{fontSize:14,fontWeight:600},children:"No processes tracked"})]}):e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:16},children:t.map((i,r)=>e.jsx(o,{proc:i},i.id||r))})]})}export{x as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as j,a4 as e,a7 as B,aw as O,aA as H,av as K,aB as G,aq as U,ad as q}from"./vendor-gUVFsxOc.js";import{l as X,s as Y,p as J,e as Q}from"./index-C5VVgT-r.js";import{R as V,L as Z,C as ee,X as te,Y as re,T as ie,a as se,b as W,c as ne}from"./charts-CjCN_e1M.js";const _={active:{bg:"#EEF2FF",color:"var(--accent)",label:"Active"},complete:{bg:"#ECFDF5",color:"var(--mint)",label:"Complete"},paused:{bg:"#FFFBEB",color:"var(--amber)",label:"Paused"},archived:{bg:"#F8FAFC",color:"var(--muted)",label:"Archived"},pending:{bg:"#F8FAFC",color:"var(--muted)",label:"Pending"}},T={green:{bg:"#ECFDF5",color:"var(--mint)",label:"On Track"},amber:{bg:"#FFFBEB",color:"var(--amber)",label:"At Risk"},red:{bg:"#FEF2F2",color:"var(--red)",label:"Critical"}};function z(t){if(!t)return"—";try{const s=Math.round((Date.now()-new Date(t))/6e4);return s<1?"just now":s<60?`${s}m ago`:s<1440?`${Math.round(s/60)}h ago`:`${Math.round(s/1440)}d ago`}catch{return t}}function R(t){if(!t)return null;try{const s=Math.ceil((new Date(t)-Date.now())/864e5);return s<0?{label:`${Math.abs(s)}d overdue`,color:"var(--red)"}:s===0?{label:"Due today",color:"var(--amber)"}:s<=3?{label:`${s}d left`,color:"var(--amber)"}:{label:`${s}d left`,color:"var(--muted)"}}catch{return null}}function E(t){const s=(t._risks||[]).filter(f=>!f.resolved),n=t._progress_pct??0,d=t.target_completion?Math.ceil((new Date(t.target_completion)-Date.now())/864e5):999,l=t._task_counts||{};return s.some(f=>f.severity==="critical")||(l.blocked||0)>2||d<-3?"red":s.length>1||(l.hitl||0)>0||d<0||n<30?"amber":"green"}function I({pct:t,size:s=56,color:n="var(--accent)"}){const d=(s-8)/2,l=2*Math.PI*d,f=l*(t/100);return e.jsxs("div",{style:{position:"relative",width:s,height:s,flexShrink:0},children:[e.jsxs("svg",{width:s,height:s,style:{transform:"rotate(-90deg)"},children:[e.jsx("circle",{cx:s/2,cy:s/2,r:d,fill:"none",stroke:"#E2E8F0",strokeWidth:5}),e.jsx("circle",{cx:s/2,cy:s/2,r:d,fill:"none",stroke:n,strokeWidth:5,strokeDasharray:`${f} ${l}`,strokeLinecap:"round",style:{transition:"stroke-dasharray .8s cubic-bezier(0.4,0,0.2,1)"}})]}),e.jsxs("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",fontSize:s*.2,fontWeight:800,color:n},children:[t,"%"]})]})}function N({agentId:t,agents:s,isOwner:n}){const d=s.find(l=>l.id===t);return e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:5,fontSize:11,padding:"3px 10px",borderRadius:999,background:n?"#EEF2FF":"#F8FAFC",color:n?"var(--accent)":"var(--muted)",border:`1px solid ${n?"#E0E7FF":"var(--border)"}`,fontWeight:600},children:[e.jsx("span",{style:{fontSize:14},children:d?.emoji||"🤖"}),e.jsx("span",{children:d?.name||t}),n&&e.jsx("span",{style:{opacity:.6},children:"· Owner"})]})}function P({health:t}){const s=T[t];return e.jsx("span",{style:{background:s.bg,color:s.color,borderRadius:999,padding:"2px 10px",fontSize:10,fontWeight:700},children:s.label})}function ae({project:t}){const s=t.milestones||[];if(!s.length)return e.jsx("div",{style:{padding:32,textAlign:"center",color:"var(--muted)",fontSize:13,background:"#F8FAFC",borderRadius:10,border:"1px solid var(--border)"},children:"No milestones defined"});const n=new Date(t.created_at||Date.now()),d=new Date(t.target_completion||Date.now()+30*864e5),l=Math.max(1,d-n),f=Math.max(0,Math.min(100,(Date.now()-n)/l*100)),c={complete:"var(--mint)","in-progress":"var(--accent)",pending:"#E2E8F0",blocked:"var(--red)"};return e.jsxs("div",{style:{position:"relative"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:11,color:"var(--muted)",marginBottom:12},children:[e.jsx("span",{children:n.toLocaleDateString()}),e.jsx("span",{style:{color:"var(--amber)",fontWeight:600},children:"Today"}),e.jsx("span",{children:d.toLocaleDateString()})]}),e.jsxs("div",{style:{position:"relative",background:"#F8FAFC",border:"1px solid var(--border)",borderRadius:10,padding:"16px 0",overflow:"hidden"},children:[e.jsx("div",{style:{position:"absolute",left:`${f}%`,top:0,bottom:0,width:2,background:"var(--amber)",opacity:.7}}),s.map(u=>{const m=u.due?new Date(u.due):d,y=Math.max(4,Math.min(100,(m-n)/l*100)),h=u.status==="complete";return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:10,padding:"0 16px"},children:[e.jsx("div",{style:{fontSize:12,color:h?"var(--muted)":"var(--text)",width:130,flexShrink:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:500,textDecoration:h?"line-through":"none"},children:u.title}),e.jsx("div",{style:{flex:1,position:"relative",height:10,background:"#E2E8F0",borderRadius:999},children:e.jsx("div",{style:{position:"absolute",left:0,width:`${y}%`,height:"100%",background:c[u.status]||"#E2E8F0",borderRadius:999,transition:"width 1s ease"}})}),e.jsx("div",{style:{fontSize:10,color:"var(--muted)",width:60,flexShrink:0,textAlign:"right"},children:u.due?new Date(u.due).toLocaleDateString("en",{month:"short",day:"numeric"}):"—"})]},u.id)})]})]})}function oe({project:t,tasks:s}){const n=s.filter(h=>(t.task_ids||[]).includes(h.id)),d=n.length;if(!d)return e.jsx("div",{style:{padding:32,textAlign:"center",color:"var(--muted)",fontSize:13},children:"No tasks to plot"});const l=new Date(t.created_at||Date.now()),f=new Date(t.target_completion||Date.now()+7*864e5),c=Math.max(1,Math.ceil((f-l)/864e5)),u=n.filter(h=>h.completed_at).map(h=>Math.max(0,Math.ceil((new Date(h.completed_at)-l)/864e5))).sort((h,x)=>h-x),m=Math.ceil((Date.now()-l)/864e5),y=Array.from({length:c+1},(h,x)=>({day:x,ideal:Math.round(d-d/c*x),actual:x<=m?d-u.filter(g=>g<=x).length:void 0}));return e.jsx(V,{width:"100%",height:220,children:e.jsxs(Z,{data:y,margin:{top:10,right:20,left:0,bottom:10},children:[e.jsx(ee,{strokeDasharray:"3 3",stroke:"var(--border)",vertical:!1}),e.jsx(te,{dataKey:"day",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted)"}}),e.jsx(re,{axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted)"},orientation:"right"}),e.jsx(ie,{contentStyle:{background:"#fff",border:"1px solid var(--border)",borderRadius:10,fontSize:12}}),e.jsx(se,{verticalAlign:"top",height:32,iconType:"rect",wrapperStyle:{fontSize:11}}),e.jsx(W,{type:"stepAfter",dataKey:"ideal",stroke:"#CBD5E1",strokeDasharray:"4 4",dot:!1,name:"Ideal"}),e.jsx(W,{type:"stepAfter",dataKey:"actual",stroke:"var(--accent)",strokeWidth:2,dot:{r:3,fill:"var(--accent)"},name:"Actual"}),e.jsx(ne,{x:m,stroke:"var(--amber)",strokeDasharray:"3 3"})]})})}function le({project:t,agents:s,selected:n,onClick:d}){const l=t._task_counts||{},f=t._progress_pct??0,c=(t._risks||[]).filter(x=>!x.resolved),u=E(t),m=_[t.status]||_.pending,y=f===100?"var(--mint)":c.length?"var(--red)":"var(--accent)",h=R(t.target_completion);return e.jsxs("div",{onClick:d,className:"card fade-in",style:{cursor:"pointer",padding:"20px",borderColor:n?"var(--accent)":c.length>0?"#FEE2E2":"var(--border)",borderWidth:n?2:1,background:n?"#FAFAFF":"#fff"},children:[e.jsxs("div",{style:{display:"flex",gap:14,marginBottom:16},children:[e.jsx(I,{pct:f,size:52,color:y}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4,flexWrap:"wrap"},children:[e.jsx("span",{style:{fontWeight:700,fontSize:15,color:"var(--text)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.name}),e.jsx(P,{health:u})]}),e.jsxs("div",{style:{display:"flex",gap:6,flexWrap:"wrap",alignItems:"center"},children:[e.jsx("span",{style:{background:m.bg,color:m.color,borderRadius:999,padding:"2px 8px",fontSize:10,fontWeight:600},children:m.label}),h&&e.jsx("span",{style:{fontSize:11,color:h.color,fontWeight:600},children:h.label})]})]}),e.jsx(U,{size:16,color:"var(--muted)",style:{flexShrink:0,marginTop:4}})]}),t.description&&e.jsx("div",{style:{fontSize:13,color:"var(--text-dim)",lineHeight:1.5,marginBottom:14,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:t.description}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:8,marginBottom:14},children:[{l:"Tasks",v:`${l.done||0}/${l.total||0}`,c:"var(--accent)"},{l:"HITL",v:l.hitl||0,c:l.hitl?"var(--purple)":"var(--muted)"},{l:"Blocked",v:l.blocked||0,c:l.blocked?"var(--red)":"var(--muted)"},{l:"Spend",v:`$${(t.budget?.spent_usd??0).toFixed(0)}`,c:"var(--text-dim)"}].map(x=>e.jsxs("div",{style:{background:"#F8FAFC",border:"1px solid var(--border)",borderRadius:8,padding:"8px 10px"},children:[e.jsx("div",{style:{fontSize:9,color:"var(--muted)",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",marginBottom:3},children:x.l}),e.jsx("div",{style:{fontSize:14,fontWeight:700,color:x.c},children:x.v})]},x.l))}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsx(N,{agentId:t.owner,agents:s,isOwner:!0}),c.length>0&&e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4,fontSize:11,color:"var(--red)",fontWeight:600},children:[e.jsx(q,{size:12})," ",c.length," risk",c.length>1?"s":""]})]})]})}const de=["Overview","Timeline","Tasks","Budget","OKRs","Logs"];function ce({project:t,agents:s,tasks:n,onClose:d,onReplan:l,onExecute:f}){const[c,u]=j.useState("Overview");t._task_counts;const m=t._progress_pct??0,y=(t._risks||[]).filter(i=>!i.resolved),h=E(t),x=m===100?"var(--mint)":y.length?"var(--red)":"var(--accent)",g=_[t.status]||_.pending,S=R(t.target_completion);return e.jsxs("div",{className:"fade-in",style:{background:"#fff",border:"2px solid #E0E7FF",borderRadius:20,marginBottom:32,overflow:"hidden",boxShadow:"0 8px 32px rgba(79,70,229,0.08)"},children:[e.jsxs("div",{style:{padding:"28px 32px",background:"linear-gradient(135deg, #FAFAFF 0%, #fff 100%)",borderBottom:"1px solid var(--border)",display:"flex",gap:24,alignItems:"flex-start"},children:[e.jsx(I,{pct:m,size:80,color:x}),e.jsxs("div",{style:{flex:1},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:8,flexWrap:"wrap"},children:[e.jsx("span",{style:{fontSize:24,fontWeight:800,color:"var(--text)"},children:t.name}),e.jsx("span",{style:{background:g.bg,color:g.color,borderRadius:999,padding:"4px 12px",fontSize:12,fontWeight:600},children:g.label}),e.jsx(P,{health:h})]}),t.description&&e.jsx("div",{style:{fontSize:14,color:"var(--text-dim)",lineHeight:1.6,marginBottom:12,maxWidth:600},children:t.description}),e.jsxs("div",{style:{display:"flex",gap:10,flexWrap:"wrap",alignItems:"center"},children:[e.jsx(N,{agentId:t.owner,agents:s,isOwner:!0}),S&&e.jsx("span",{style:{fontSize:12,color:S.color,fontWeight:600},children:S.label}),(t.tags||[]).map(i=>e.jsx("span",{style:{background:"#EEF2FF",color:"var(--accent)",borderRadius:999,padding:"2px 8px",fontSize:10,fontWeight:600},children:i},i))]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,width:140,flexShrink:0},children:[e.jsxs("button",{className:"btn-primary",onClick:()=>f?.(t.id),style:{padding:"10px",fontSize:13,display:"flex",alignItems:"center",justifyContent:"center",gap:6},children:[e.jsx(H,{size:13})," Execute"]}),e.jsxs("button",{className:"btn-secondary",onClick:()=>l?.(t.id),style:{padding:"10px",fontSize:13,display:"flex",alignItems:"center",justifyContent:"center",gap:6},children:[e.jsx(B,{size:13})," Replan"]}),e.jsxs("button",{className:"btn-secondary",onClick:d,style:{padding:"10px",fontSize:13,display:"flex",alignItems:"center",justifyContent:"center",gap:6},children:[e.jsx(K,{size:13})," Close"]})]})]}),e.jsx("div",{style:{display:"flex",background:"#F8FAFC",borderBottom:"1px solid var(--border)",padding:"0 24px",gap:4},children:de.map(i=>{const p=c===i;return e.jsx("button",{onClick:()=>u(i),style:{background:"none",border:"none",cursor:"pointer",padding:"14px 16px",fontSize:13,fontWeight:p?700:500,color:p?"var(--accent)":"var(--muted)",borderBottom:`2px solid ${p?"var(--accent)":"transparent"}`,transition:"all 0.15s"},children:i},i)})}),e.jsxs("div",{style:{padding:"28px 32px",minHeight:360},children:[c==="Overview"&&e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1.2fr 1fr",gap:40},children:[e.jsxs("div",{children:[e.jsx("h3",{style:{marginBottom:16,fontSize:14,color:"var(--muted)",textTransform:"uppercase",letterSpacing:"0.05em",fontWeight:700},children:"Timeline"}),e.jsx(ae,{project:t}),e.jsx("h3",{style:{marginTop:32,marginBottom:12,fontSize:14,color:"var(--muted)",textTransform:"uppercase",letterSpacing:"0.05em",fontWeight:700},children:"Risks"}),y.length>0?y.map(i=>e.jsxs("div",{style:{padding:"12px 14px",background:"#FFF1F2",border:"1px solid #FEE2E2",borderRadius:10,marginBottom:8},children:[e.jsx("div",{style:{fontSize:13,fontWeight:600,color:"var(--text)",marginBottom:4},children:i.description}),e.jsxs("div",{style:{fontSize:11,color:"var(--red)",fontWeight:600},children:[i.severity," · ",z(i.detected_at)]})]},i.id)):e.jsxs("div",{style:{padding:"16px",background:"#ECFDF5",border:"1px solid #D1FAE5",borderRadius:10,display:"flex",alignItems:"center",gap:8,fontSize:13,color:"var(--mint)",fontWeight:500},children:[e.jsx(G,{size:15})," No active risks"]})]}),e.jsxs("div",{children:[e.jsx("h3",{style:{marginBottom:16,fontSize:14,color:"var(--muted)",textTransform:"uppercase",letterSpacing:"0.05em",fontWeight:700},children:"Activity"}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[(t._activity||[]).slice(0,10).map((i,p)=>e.jsxs("div",{style:{display:"flex",gap:10,fontSize:13,padding:"8px 0",borderBottom:"1px solid var(--border)"},children:[e.jsx("span",{style:{color:"var(--muted)",flexShrink:0},children:z(i.ts)}),e.jsx("span",{style:{color:"var(--text-dim)",flex:1},children:i.text})]},p)),(t._activity||[]).length===0&&e.jsx("span",{style:{color:"var(--muted)",fontSize:13},children:"No activity yet"})]})]})]}),c==="Timeline"&&e.jsxs("div",{children:[e.jsx("h3",{style:{marginBottom:20,fontSize:15},children:"Burndown Chart"}),e.jsx(oe,{project:t,tasks:n})]}),c==="Tasks"&&e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:16},children:["in-progress","blocked","needs_human_decision","complete"].map(i=>{const v={"in-progress":{label:"In Progress",color:"var(--accent)",bg:"#EEF2FF"},blocked:{label:"Blocked",color:"var(--red)",bg:"#FEF2F2"},needs_human_decision:{label:"HITL",color:"var(--purple)",bg:"#F5F3FF"},complete:{label:"Complete",color:"var(--mint)",bg:"#ECFDF5"}}[i],b=n.filter(a=>(t.task_ids||[]).includes(a.id)&&a.status===i);return e.jsxs("div",{children:[e.jsxs("div",{style:{fontSize:12,fontWeight:700,color:v.color,textTransform:"uppercase",marginBottom:10,padding:"4px 10px",background:v.bg,borderRadius:8,display:"inline-block"},children:[v.label," (",b.length,")"]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[b.map(a=>e.jsxs("div",{style:{padding:"10px 12px",background:"#F8FAFC",border:"1px solid var(--border)",borderRadius:10},children:[e.jsx("div",{style:{fontSize:12,fontWeight:600,color:"var(--text)",marginBottom:3},children:a.title}),e.jsx("div",{style:{fontSize:10,color:"var(--muted)",fontFamily:"var(--font-mono)"},children:a.id?.slice(0,12)})]},a.id)),b.length===0&&e.jsx("div",{style:{fontSize:12,color:"var(--muted)",fontStyle:"italic"},children:"None"})]})]},i)})}),c==="Budget"&&e.jsx("div",{children:(()=>{const i=t.budget?.allocated_usd||0,p=t.budget?.spent_usd||0,v=i?Math.round(p/i*100):0,b=v>90?"var(--red)":v>75?"var(--amber)":"var(--mint)",a=v>90?"#FEF2F2":v>75?"#FFFBEB":"#F0FDF4";return e.jsxs("div",{style:{background:a,border:`1px solid ${b}44`,borderRadius:16,padding:28,maxWidth:520},children:[e.jsx("div",{style:{fontSize:13,fontWeight:700,color:"var(--muted)",textTransform:"uppercase",letterSpacing:"0.06em",marginBottom:12},children:"Budget Expenditure"}),e.jsxs("div",{style:{fontSize:32,fontWeight:800,color:b,marginBottom:16},children:["$",p.toFixed(2)," ",e.jsxs("span",{style:{fontSize:16,color:"var(--muted)",fontWeight:500},children:["/ $",i.toFixed(2)]})]}),e.jsx("div",{className:"progress-track",style:{height:12},children:e.jsx("div",{className:"progress-fill",style:{width:`${Math.min(100,v)}%`,background:b,height:"100%",borderRadius:999}})}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:8,fontSize:12,color:"var(--muted)"},children:[e.jsxs("span",{children:[v,"% utilized"]}),i>0&&e.jsxs("span",{children:["$",(i-p).toFixed(2)," remaining"]})]})]})})()}),c==="OKRs"&&e.jsxs("div",{children:[(t.okr_links||[]).length===0?e.jsx("div",{style:{textAlign:"center",padding:48,color:"var(--muted)",fontSize:13},children:"No OKR links for this project"}):e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12},children:(t.okr_links||[]).map((i,p)=>e.jsxs("div",{style:{padding:"16px 18px",background:"#FAFAFF",border:"1px solid #E0E7FF",borderRadius:14},children:[e.jsx("div",{style:{fontSize:14,fontWeight:700,color:"var(--text)",marginBottom:4},children:i.objective||i.title||`OKR #${p+1}`}),i.key_result&&e.jsxs("div",{style:{fontSize:12,color:"var(--accent)",marginBottom:4},children:["KR: ",i.key_result]}),i.contribution&&e.jsxs("div",{style:{fontSize:12,color:"var(--muted)"},children:["Contribution: ",i.contribution]})]},p))}),(t.decisions||[]).length>0&&e.jsxs("div",{style:{marginTop:28},children:[e.jsx("h3",{style:{marginBottom:12,fontSize:15},children:"Decisions"}),t.decisions.map((i,p)=>e.jsxs("div",{style:{padding:"14px 16px",background:"#F8FAFC",border:"1px solid var(--border)",borderRadius:12,marginBottom:8},children:[e.jsx("div",{style:{fontSize:13,fontWeight:600,color:"var(--text)",marginBottom:4},children:i.decision}),i.rationale&&e.jsx("div",{style:{fontSize:12,color:"var(--muted)"},children:i.rationale})]},p))]})]}),c==="Logs"&&e.jsxs("div",{style:{background:"#F8FAFC",border:"1px solid var(--border)",borderRadius:12,overflow:"hidden"},children:[(t._sessions||[]).map((i,p)=>e.jsxs("div",{style:{display:"flex",gap:20,padding:"10px 16px",borderBottom:"1px solid var(--border)",fontSize:12,fontFamily:"var(--font-mono)",background:p%2===0?"#fff":"#F8FAFC"},children:[e.jsx("span",{style:{color:"var(--accent)",minWidth:80},children:i.proc_id||"--"}),e.jsx("span",{style:{flex:1,color:"var(--text-dim)"},children:i.task_id}),e.jsx("span",{style:{color:i.status==="failed"?"var(--red)":"var(--mint)",fontWeight:600},children:i.status}),e.jsx("span",{style:{color:"var(--muted)"},children:z(i.completed_at)})]},p)),(t._sessions||[]).length===0&&e.jsx("div",{style:{padding:32,textAlign:"center",color:"var(--muted)",fontSize:13},children:"No session logs"})]})]})]})}function ue({data:t,lastUpdated:s,toast:n}){const{agents:d=[],tasks:l=[],okrs:f={}}=t||{},[c,u]=j.useState([]),[m,y]=j.useState(null),[h,x]=j.useState(!0),[g,S]=j.useState({status:"all",search:"",health:"all"}),[i,p]=j.useState(!1),[v,b]=j.useState(!1),[a,F]=j.useState({title:"",intent:"",description:"",priority:"P2",tags:"",project_hint:"",deadline:"",budget_usd:""}),C=j.useCallback(async()=>{try{const r=await X();u(r.projects||[])}catch{u([])}finally{x(!1)}},[]);j.useEffect(()=>{C()},[C]);const L=async()=>{if(!(!a.intent.trim()&&!a.title.trim())){p(!0);try{const r=await Y({...a,tags:a.tags.split(",").map(o=>o.trim()).filter(Boolean)});await C(),F({title:"",intent:"",description:"",priority:"P2",tags:"",project_hint:"",deadline:"",budget_usd:""}),b(!1),n?.(`Task routed: ${r.projectId}`,"success")}catch(r){n?.(r.message,"error")}finally{p(!1)}}},M=async r=>{try{await J(r),await C(),n?.("Replan initiated","success")}catch(o){n?.(o.message,"error")}},$=async r=>{try{await Q(r),await C(),n?.("Execution started","success")}catch(o){n?.(o.message,"error")}},w=j.useMemo(()=>c.map(r=>{const o=l.filter(k=>(r.task_ids||[]).includes(k.id)),A=o.filter(k=>k.status==="complete").length;return{...r,_task_counts:{total:o.length,done:A,active:o.filter(k=>k.status==="in-progress").length,blocked:o.filter(k=>k.status==="blocked").length,hitl:o.filter(k=>k.status==="needs_human_decision").length},_progress_pct:o.length>0?Math.round(A/o.length*100):0,_risks:r._risks||[],_activity:r._activity||[]}}),[c,l]),D=j.useMemo(()=>w.filter(r=>!(g.status!=="all"&&r.status!==g.status||g.health!=="all"&&E(r)!==g.health||g.search&&!(r.name||"").toLowerCase().includes(g.search.toLowerCase()))).sort((r,o)=>(o.priority_weight||0)-(r.priority_weight||0)),[w,g]);return h?e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:80},children:[e.jsx(B,{size:20,color:"var(--accent)",style:{animation:"spin 1s linear infinite"}}),e.jsx("span",{style:{marginLeft:12,color:"var(--muted)",fontSize:13},children:"Loading projects…"})]}):e.jsxs("div",{className:"fade-in",style:{display:"flex",flexDirection:"column",gap:24},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end"},children:[e.jsxs("div",{children:[e.jsx("h1",{style:{marginBottom:4},children:"Projects"}),e.jsxs("p",{style:{color:"var(--text-dim)",fontSize:14},children:[w.length," projects · ",w.filter(r=>r.status==="active").length," active"]})]}),e.jsxs("div",{style:{display:"flex",gap:10},children:[e.jsxs("button",{className:"btn-secondary",onClick:C,style:{display:"flex",alignItems:"center",gap:6,padding:"8px 16px"},children:[e.jsx(B,{size:13})," Refresh"]}),e.jsxs("button",{className:"btn-primary",onClick:()=>b(!v),style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx(O,{size:14})," New Project"]})]})]}),e.jsxs("div",{style:{display:"flex",gap:12},children:[[{label:"All Health",value:"all",color:"var(--text-dim)",bg:"#F8FAFC"},...Object.entries(T).map(([r,o])=>({label:o.label,value:r,color:o.color,bg:o.bg}))].map(r=>e.jsx("button",{onClick:()=>S(o=>({...o,health:r.value})),style:{background:g.health===r.value?r.bg:"#F8FAFC",color:g.health===r.value?r.color:"var(--muted)",border:`1px solid ${g.health===r.value?r.color+"44":"var(--border)"}`,borderRadius:999,padding:"5px 14px",fontSize:12,fontWeight:600,cursor:"pointer",transition:"all 0.15s"},children:r.label},r.value)),e.jsx("input",{className:"input-base",placeholder:"Search projects…",value:g.search,onChange:r=>S(o=>({...o,search:r.target.value})),style:{marginLeft:"auto",width:220}}),e.jsxs("select",{className:"input-base",value:g.status,onChange:r=>S(o=>({...o,status:r.target.value})),style:{width:140},children:[e.jsx("option",{value:"all",children:"All Status"}),Object.entries(_).map(([r,o])=>e.jsx("option",{value:r,children:o.label},r))]})]}),v&&e.jsxs("div",{className:"card",style:{background:"#FAFAFF",border:"2px solid #E0E7FF"},children:[e.jsx("div",{style:{fontSize:15,fontWeight:700,color:"var(--accent)",marginBottom:16},children:"New Project Request"}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:12,marginBottom:12},children:[e.jsx("input",{className:"input-base",placeholder:"Title",value:a.title,onChange:r=>F({...a,title:r.target.value})}),e.jsx("input",{className:"input-base",placeholder:"Primary intent (required)",value:a.intent,onChange:r=>F({...a,intent:r.target.value})}),e.jsxs("select",{className:"input-base",value:a.priority,onChange:r=>F({...a,priority:r.target.value}),children:[e.jsx("option",{value:"P1",children:"P1 — Critical"}),e.jsx("option",{value:"P2",children:"P2 — Normal"}),e.jsx("option",{value:"P3",children:"P3 — Low"})]}),e.jsx("input",{className:"input-base",placeholder:"Project hint (optional)",value:a.project_hint,onChange:r=>F({...a,project_hint:r.target.value})})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr 1fr 120px",gap:12},children:[e.jsx("input",{className:"input-base",placeholder:"Description / constraints",value:a.description,onChange:r=>F({...a,description:r.target.value})}),e.jsx("input",{className:"input-base",placeholder:"Tags (comma separated)",value:a.tags,onChange:r=>F({...a,tags:r.target.value})}),e.jsx("input",{className:"input-base",type:"date",value:a.deadline,onChange:r=>F({...a,deadline:r.target.value})}),e.jsx("input",{className:"input-base",type:"number",placeholder:"Budget (USD)",value:a.budget_usd,onChange:r=>F({...a,budget_usd:r.target.value})}),e.jsx("button",{className:"btn-primary",onClick:L,disabled:i||!a.intent.trim(),children:i?"…":"Submit"})]})]}),(()=>{const r=w.find(o=>o.id===m);return r?e.jsx(ce,{project:r,agents:d,tasks:l,okrs:f,lastUpdated:s,onReplan:M,onExecute:$,onClose:()=>y(null)}):null})(),D.length===0?e.jsxs("div",{className:"card",style:{textAlign:"center",padding:64},children:[e.jsx("div",{style:{fontSize:32,marginBottom:12},children:"📁"}),e.jsx("div",{style:{fontSize:14,fontWeight:600},children:"No projects found"}),e.jsx("div",{style:{fontSize:12,color:"var(--muted)",marginTop:4},children:'Use the "New Project" button to get started'})]}):e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(360px, 1fr))",gap:20,opacity:m?.4:1,transition:"opacity 0.3s"},children:D.map(r=>e.jsx(le,{project:r,agents:d,selected:m===r.id,onClick:()=>y(r.id)},r.id))})]})}export{ue as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a4 as t,aP as d,aB as c,ad as u}from"./vendor-gUVFsxOc.js";function s({label:l,value:n,status:e}){const i=e==="ok"?"var(--mint)":e==="warn"?"var(--amber)":e==="error"?"var(--red)":"var(--text-dim)",r=e==="ok"?c:e==="error"?u:null;return t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 0",borderBottom:"1px solid var(--border)"},children:[t.jsx("span",{style:{fontSize:13,color:"var(--text)",fontWeight:500},children:l}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[r&&t.jsx(r,{size:13,color:i}),t.jsx("span",{style:{fontSize:13,fontWeight:700,color:i},children:n})]})]})}function g({data:l}){const{security_status:n={}}=l||{},e=n,i=e.gateway_auth&&e.csrf_enabled&&!e.risky_permissions,r=i?"var(--mint)":"var(--amber)";return t.jsxs("div",{className:"fade-in",style:{display:"flex",flexDirection:"column",gap:24},children:[t.jsxs("div",{children:[t.jsx("h1",{style:{marginBottom:4},children:"Security Status"}),t.jsx("p",{style:{color:"var(--text-dim)",fontSize:14},children:"System security posture overview"})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:20,padding:"24px",borderRadius:16,background:i?"#ECFDF5":"#FFFBEB",border:`1px solid ${i?"#D1FAE5":"#FEF3C7"}`},children:[t.jsx("div",{style:{width:56,height:56,borderRadius:"50%",background:i?"#D1FAE5":"#FEF3C7",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:t.jsx(d,{size:26,color:r})}),t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:20,fontWeight:800,color:r},children:i?"Secure":"Review Recommended"}),t.jsx("div",{style:{fontSize:13,color:"var(--text-dim)",marginTop:3},children:i?"All security checks passing":"Some security settings need attention"})]})]}),Object.keys(e).length>0?t.jsxs("div",{className:"card",children:[t.jsx("h2",{style:{fontSize:15,marginBottom:8},children:"Security Checks"}),e.gateway_auth!==void 0&&t.jsx(s,{label:"Gateway Authentication",value:e.gateway_auth?"Enabled":"Disabled",status:e.gateway_auth?"ok":"error"}),e.csrf_enabled!==void 0&&t.jsx(s,{label:"CSRF Protection",value:e.csrf_enabled?"Enabled":"Disabled",status:e.csrf_enabled?"ok":"error"}),e.rate_limiting!==void 0&&t.jsx(s,{label:"Rate Limiting",value:e.rate_limiting?"Active":"Off",status:e.rate_limiting?"ok":"warn"}),e.risky_permissions!==void 0&&t.jsx(s,{label:"Risky Permissions",value:e.risky_permissions?"Detected":"None",status:e.risky_permissions?"error":"ok"}),e.audit_log!==void 0&&t.jsx(s,{label:"Audit Logging",value:e.audit_log?"Enabled":"Disabled",status:e.audit_log?"ok":"warn"}),e.tls!==void 0&&t.jsx(s,{label:"TLS",value:e.tls?"Enabled":"Not detected",status:e.tls?"ok":"warn"}),Object.entries(e).filter(([a])=>!["gateway_auth","csrf_enabled","rate_limiting","risky_permissions","audit_log","tls"].includes(a)).map(([a,o])=>t.jsx(s,{label:a.replace(/_/g," "),value:String(o),status:typeof o=="boolean"?o?"ok":"warn":"ok"},a))]}):t.jsx("div",{className:"card",style:{textAlign:"center",padding:48,color:"var(--muted)",fontSize:13},children:"No security data available. Enable security monitoring in your workspace."})]})}export{g as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as g,a4 as e,a7 as x,aQ as p}from"./vendor-gUVFsxOc.js";import{a as b}from"./index-C5VVgT-r.js";function f({data:r,toast:o}){const i=r?.workspace||{},[a,n]=g.useState({budget_daily:i.budget?.limits?.daily_usd??"",budget_weekly:i.budget?.limits?.weekly_usd??"",budget_monthly:i.budget?.limits?.monthly_usd??"",hitl_enabled:i.hitl_enabled!==!1,auto_resume:i.auto_resume??!1}),[d,c]=g.useState(!1),m=async()=>{c(!0);try{await b("/api/settings",a),o?.("Settings saved","success")}catch(t){o?.(t.message,"error")}c(!1)};function l({label:t,sub:s,children:h}){return e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px 0",borderBottom:"1px solid var(--border)"},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:14,fontWeight:500,color:"var(--text)"},children:t}),s&&e.jsx("div",{style:{fontSize:12,color:"var(--muted)",marginTop:2},children:s})]}),e.jsx("div",{style:{flexShrink:0},children:h})]})}function u({value:t,onChange:s}){return e.jsx("button",{onClick:()=>s(!t),style:{width:44,height:24,borderRadius:999,border:"none",cursor:"pointer",background:t?"var(--accent)":"#D1D5DB",position:"relative",transition:"background 0.2s",padding:0},children:e.jsx("span",{style:{position:"absolute",top:3,left:t?22:3,width:18,height:18,borderRadius:"50%",background:"#fff",transition:"left 0.2s",display:"block",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"}})})}return e.jsxs("div",{className:"fade-in",style:{display:"flex",flexDirection:"column",gap:24},children:[e.jsxs("div",{children:[e.jsx("h1",{style:{marginBottom:4},children:"Settings"}),e.jsx("p",{style:{color:"var(--text-dim)",fontSize:14},children:"Configure your AGI Farm workspace settings"})]}),e.jsxs("div",{className:"card",children:[e.jsx("h2",{style:{fontSize:15,marginBottom:12},children:"Workspace Info"}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10,fontSize:13,color:"var(--text-dim)"},children:[{k:"Workspace Path",v:i.path||i.workspace_path||"—"},{k:"Team Name",v:i.team||i.team_name||"—"},{k:"Version",v:i.version||r?.version||"1.4.0"},{k:"Process ID",v:i.pid||"—"}].map(t=>e.jsxs("div",{style:{padding:"12px",background:"#F8FAFC",borderRadius:10,border:"1px solid var(--border)"},children:[e.jsx("div",{style:{fontSize:10,fontWeight:700,color:"var(--muted)",textTransform:"uppercase",marginBottom:4},children:t.k}),e.jsx("div",{style:{fontWeight:600,color:"var(--text)",wordBreak:"break-all"},children:t.v})]},t.k))})]}),e.jsxs("div",{className:"card",children:[e.jsx("h2",{style:{fontSize:15,marginBottom:4},children:"Budget Limits"}),e.jsx("div",{style:{fontSize:12,color:"var(--muted)",marginBottom:16},children:"Spending limits in USD. Leave blank for no limit."}),e.jsx(l,{label:"Daily Limit",sub:"Maximum spend in 24h",children:e.jsx("input",{className:"input-base",style:{width:120,textAlign:"right"},placeholder:"e.g. 1.00",value:a.budget_daily,onChange:t=>n(s=>({...s,budget_daily:t.target.value}))})}),e.jsx(l,{label:"Weekly Limit",sub:"Maximum spend in 7 days",children:e.jsx("input",{className:"input-base",style:{width:120,textAlign:"right"},placeholder:"e.g. 5.00",value:a.budget_weekly,onChange:t=>n(s=>({...s,budget_weekly:t.target.value}))})}),e.jsx(l,{label:"Monthly Limit",sub:"Maximum spend in 30 days",children:e.jsx("input",{className:"input-base",style:{width:120,textAlign:"right"},placeholder:"e.g. 20.00",value:a.budget_monthly,onChange:t=>n(s=>({...s,budget_monthly:t.target.value}))})})]}),e.jsxs("div",{className:"card",children:[e.jsx("h2",{style:{fontSize:15,marginBottom:4},children:"Behavior"}),e.jsx(l,{label:"HITL Gate",sub:"Pause agents at human approval gates",children:e.jsx(u,{value:a.hitl_enabled,onChange:t=>n(s=>({...s,hitl_enabled:t}))})}),e.jsx(l,{label:"Auto Resume",sub:"Automatically resume tasks after approval",children:e.jsx(u,{value:a.auto_resume,onChange:t=>n(s=>({...s,auto_resume:t}))})})]}),e.jsx("button",{onClick:m,disabled:d,className:"btn-primary",style:{alignSelf:"flex-start",display:"flex",alignItems:"center",gap:8,padding:"10px 28px"},children:d?e.jsxs(e.Fragment,{children:[e.jsx(x,{size:14,className:"spin"})," Saving…"]}):e.jsxs(e.Fragment,{children:[e.jsx(p,{size:14})," Save Settings"]})})]})}export{f as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as x,a4 as e,aw as E,ax as N,ay as D,az as P,am as _}from"./vendor-gUVFsxOc.js";import{c as A,u as W}from"./index-C5VVgT-r.js";const I=["all","pending","in-progress","complete","failed","blocked","hitl"],j=25,v={complete:{bg:"#ECFDF5",color:"var(--mint)",label:"Complete"},"in-progress":{bg:"#EEF2FF",color:"var(--accent)",label:"In Progress"},failed:{bg:"#FEF2F2",color:"var(--red)",label:"Failed"},needs_human_decision:{bg:"#F5F3FF",color:"var(--purple)",label:"HITL"},blocked:{bg:"#FEF2F2",color:"var(--red)",label:"Blocked"},pending:{bg:"#F1F5F9",color:"var(--muted)",label:"Pending"}};function L({deadline:s}){const[,c]=x.useState(0);if(x.useEffect(()=>{const n=setInterval(()=>c(o=>o+1),1e4);return()=>clearInterval(n)},[]),!s)return null;try{const n=new Date(s),o=Math.round((n-Date.now())/6e4),i=Math.abs(o),d=o<0,r=d?"var(--red)":o<60?"var(--amber)":"var(--text-dim)",p=i<60?`${d?"-":""}${i}m`:i<1440?`${d?"-":""}${Math.round(i/60)}h`:n.toLocaleDateString();return e.jsxs("span",{title:n.toLocaleString(),style:{display:"inline-flex",alignItems:"center",gap:4,color:r,fontSize:11,fontWeight:600},children:[e.jsx(_,{size:11}),p,d?" !":""]})}catch{return null}}function R({task:s,expanded:c,onToggle:n,toast:o}){const i=(s.status||"").toLowerCase(),d=v[i]||v.pending,r=(s.sla?.priority||s.priority||"P3").toUpperCase(),p=i==="needs_human_decision";return e.jsxs(e.Fragment,{children:[e.jsxs("tr",{onClick:n,style:{borderBottom:"1px solid var(--border)",background:p||c?"#FAFAFF":"#fff",cursor:"pointer",transition:"background 0.15s"},children:[e.jsx("td",{style:{padding:"12px 16px",fontSize:11,color:"var(--muted)",fontFamily:"var(--font-mono)"},children:s.id?.slice(0,12)||"--"}),e.jsx("td",{style:{padding:"12px 16px"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[p&&e.jsx("span",{style:{fontSize:14},children:"🔔"}),e.jsx("span",{style:{fontSize:13,fontWeight:600,color:"var(--text)"},children:s.title||"--"})]})}),e.jsx("td",{style:{padding:"12px 16px"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:5,fontSize:12,color:"var(--text-dim)"},children:[e.jsx(N,{size:12}),s.assigned_to||"—"]})}),e.jsx("td",{style:{padding:"12px 16px"},children:e.jsx("span",{style:{background:r==="P1"?"#FEF2F2":"#F1F5F9",color:r==="P1"?"var(--red)":"var(--muted)",border:`1px solid ${r==="P1"?"#FEE2E2":"#E2E8F0"}`,borderRadius:999,fontSize:10,fontWeight:700,padding:"2px 8px"},children:r})}),e.jsx("td",{style:{padding:"12px 16px"},children:e.jsx("span",{style:{background:d.bg,color:d.color,borderRadius:999,fontSize:11,fontWeight:600,padding:"3px 10px"},children:d.label})}),e.jsx("td",{style:{padding:"12px 16px"},children:e.jsx(L,{deadline:s.sla?.deadline||s.sla?.target})}),e.jsx("td",{style:{padding:"12px 16px",color:"var(--muted)",textAlign:"right"},children:c?e.jsx(D,{size:14}):e.jsx(P,{size:14})})]}),c&&e.jsx("tr",{style:{background:"#FAFAFF",borderBottom:"2px solid #E0E7FF"},children:e.jsx("td",{colSpan:7,style:{padding:"24px 32px"},children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1.5fr 1fr",gap:32},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[s.hitl_reason&&e.jsxs("div",{style:{padding:"14px 16px",background:"#F5F3FF",border:"1px solid #EDE9FE",borderRadius:12},children:[e.jsx("div",{style:{fontSize:11,color:"var(--purple)",fontWeight:700,marginBottom:6},children:"⚡ Intervention Required"}),e.jsx("div",{style:{fontSize:13,color:"var(--text)"},children:s.hitl_reason})]}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:12,fontWeight:600,color:"var(--muted)",textTransform:"uppercase",marginBottom:8,letterSpacing:"0.05em"},children:"Description"}),e.jsx("div",{style:{fontSize:13,color:"var(--text-dim)",lineHeight:1.7,background:"#F8FAFC",padding:"14px",borderRadius:10,border:"1px solid var(--border)"},children:s.description||"No description available."})]}),s.output&&e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:12,fontWeight:600,color:"var(--mint)",textTransform:"uppercase",marginBottom:8,letterSpacing:"0.05em"},children:"Output"}),e.jsx("div",{style:{fontSize:12,color:"var(--text-dim)",lineHeight:1.7,background:"#F0FDF4",padding:"14px",borderRadius:10,border:"1px solid #D1FAE5",fontFamily:"var(--font-mono)"},children:s.output})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsxs("div",{className:"card",style:{gap:8,display:"flex",flexDirection:"column"},children:[e.jsx("div",{style:{fontSize:12,fontWeight:700,color:"var(--muted)",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Details"}),[{k:"Type",v:s.type},{k:"Created",v:s.created_at?new Date(s.created_at).toLocaleString():"—"},{k:"Completed",v:s.completed_at?new Date(s.completed_at).toLocaleString():"—"}].filter(l=>l.v).map(l=>e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:12},children:[e.jsx("span",{style:{color:"var(--muted)"},children:l.k}),e.jsx("span",{style:{color:"var(--text)",fontWeight:500},children:l.v})]},l.k))]}),e.jsxs("div",{className:"card",style:{gap:8,display:"flex",flexDirection:"column"},children:[e.jsx("div",{style:{fontSize:12,fontWeight:700,color:"var(--muted)",textTransform:"uppercase",letterSpacing:"0.05em",marginBottom:4},children:"Update Status"}),e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:["pending","in-progress","complete","failed","blocked"].filter(l=>l!==i).map(l=>{const g=v[l]||v.pending;return e.jsx("button",{onClick:async h=>{h.stopPropagation();try{await W(s.id,{status:l}),o?.("Status updated","success")}catch(y){o?.(y.message,"error")}},style:{background:g.bg,color:g.color,border:`1px solid ${g.color}44`,borderRadius:8,padding:"5px 12px",fontSize:11,fontWeight:600,cursor:"pointer",transition:"all 0.15s"},children:g.label},l)})})]})]})]})})})]})}function M({data:s,toast:c}){const{tasks:n=[],agents:o=[]}=s||{},[i,d]=x.useState("all"),[r,p]=x.useState(0),[l,g]=x.useState(null),[h,y]=x.useState(""),[b,F]=x.useState(!1),[a,u]=x.useState({id:"",title:"",description:"",priority:"P2",assigned_to:"",type:"dev"}),[S,k]=x.useState(!1),z=async()=>{if(!(!a.id||!a.title)){k(!0);try{await A(a),c?.("Task created","success"),F(!1),u({id:"",title:"",description:"",priority:"P2",assigned_to:"",type:"dev"})}catch(t){c?.(t.message,"error")}finally{k(!1)}}},C=n.filter(t=>{if(i!=="all"&&t.status!==(i==="hitl"?"needs_human_decision":i))return!1;if(!h)return!0;const m=h.toLowerCase();return(t.id||"").toLowerCase().includes(m)||(t.title||"").toLowerCase().includes(m)}),f=Math.ceil(C.length/j),w=C.slice(r*j,(r+1)*j);return e.jsxs("div",{className:"fade-in",style:{display:"flex",flexDirection:"column",gap:24},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end"},children:[e.jsxs("div",{children:[e.jsx("h1",{style:{marginBottom:4},children:"Task Queue"}),e.jsxs("p",{style:{color:"var(--text-dim)",fontSize:14},children:[n.length," tasks across all agents"]})]}),e.jsxs("button",{className:"btn-primary",onClick:()=>F(!b),style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx(E,{size:14})," New Task"]})]}),b&&e.jsxs("div",{className:"card",style:{background:"#FAFAFF",borderColor:"#E0E7FF",borderWidth:2},children:[e.jsx("div",{style:{fontSize:14,fontWeight:700,color:"var(--accent)",marginBottom:16},children:"Create New Task"}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:12},children:[e.jsx("input",{className:"input-base",placeholder:"Task ID *",value:a.id,onChange:t=>u({...a,id:t.target.value})}),e.jsx("input",{className:"input-base",placeholder:"Title *",value:a.title,onChange:t=>u({...a,title:t.target.value}),style:{gridColumn:"span 2"}}),e.jsx("textarea",{className:"input-base",placeholder:"Description",value:a.description,onChange:t=>u({...a,description:t.target.value}),style:{gridColumn:"span 3",minHeight:80,resize:"vertical"}}),e.jsxs("select",{className:"input-base",value:a.priority,onChange:t=>u({...a,priority:t.target.value}),children:[e.jsx("option",{value:"P1",children:"P1 — Critical"}),e.jsx("option",{value:"P2",children:"P2 — Normal"}),e.jsx("option",{value:"P3",children:"P3 — Low"})]}),e.jsxs("select",{className:"input-base",value:a.assigned_to,onChange:t=>u({...a,assigned_to:t.target.value}),children:[e.jsx("option",{value:"",children:"Assign to agent…"}),o.map(t=>e.jsxs("option",{value:t.id,children:[t.emoji," ",t.name||t.id]},t.id))]}),e.jsx("button",{className:"btn-primary",onClick:z,disabled:S||!a.id||!a.title,children:S?"Creating…":"Create Task"})]})]}),e.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[e.jsx("div",{style:{display:"flex",gap:4},children:I.map(t=>{const m=t==="all"?n.length:n.filter(T=>T.status===(t==="hitl"?"needs_human_decision":t)).length;return e.jsxs("button",{onClick:()=>{d(t),p(0)},style:{background:i===t?"var(--accent)":"#F8FAFC",color:i===t?"#fff":"var(--text-dim)",border:`1px solid ${i===t?"var(--accent)":"var(--border)"}`,borderRadius:8,padding:"6px 14px",fontSize:12,fontWeight:600,cursor:"pointer",transition:"all 0.15s",textTransform:"capitalize"},children:[t," ",m>0&&e.jsxs("span",{style:{opacity:.75},children:["(",m,")"]})]},t)})}),e.jsx("input",{className:"input-base",placeholder:"Search tasks…",value:h,onChange:t=>{y(t.target.value),p(0)},style:{marginLeft:"auto",width:220}})]}),e.jsx("div",{style:{background:"#fff",border:"1px solid var(--border)",borderRadius:16,overflow:"hidden",boxShadow:"var(--shadow)"},children:e.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsx("tr",{style:{background:"#F8FAFC",borderBottom:"1px solid var(--border)"},children:["ID","Title","Assigned To","Priority","Status","Deadline",""].map(t=>e.jsx("th",{style:{padding:"10px 16px",textAlign:"left",fontSize:10,color:"var(--muted)",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.07em"},children:t},t))})}),e.jsx("tbody",{children:w.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:7,style:{padding:64,textAlign:"center",color:"var(--muted)",fontSize:13},children:"No tasks match your filter"})}):w.map(t=>e.jsx(R,{task:t,expanded:l===t.id,onToggle:()=>g(l===t.id?null:t.id),toast:c},t.id))})]})}),f>1&&e.jsxs("div",{style:{display:"flex",gap:12,justifyContent:"center",alignItems:"center"},children:[e.jsx("button",{className:"btn-secondary",onClick:()=>p(Math.max(0,r-1)),disabled:r===0,style:{padding:"6px 16px"},children:"← Prev"}),e.jsxs("span",{style:{fontSize:13,color:"var(--muted)"},children:["Page ",r+1," of ",f]}),e.jsx("button",{className:"btn-secondary",onClick:()=>p(Math.min(f-1,r+1)),disabled:r===f-1,style:{padding:"6px 16px"},children:"Next →"})]})]})}export{M as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a4 as e,aE as l}from"./vendor-gUVFsxOc.js";import{R as d,B as c,X as x,Y as m,T as h,d as g,e as f}from"./charts-CjCN_e1M.js";function j({data:i}){const{usage:a={},model_usage:n={}}=i||{},r=a.by_model||n||{},o=Object.entries(r).map(([t,s])=>({name:t,tokens:typeof s=="object"?s.tokens??s.total_tokens??0:s})).sort((t,s)=>s.tokens-t.tokens);return e.jsxs("div",{className:"fade-in",style:{display:"flex",flexDirection:"column",gap:24},children:[e.jsxs("div",{children:[e.jsx("h1",{style:{marginBottom:4},children:"Model Usage"}),e.jsx("p",{style:{color:"var(--text-dim)",fontSize:14},children:"Token consumption across models"})]}),o.length===0?e.jsxs("div",{className:"card",style:{textAlign:"center",padding:64},children:[e.jsx(l,{size:32,style:{marginBottom:12,opacity:.4}}),e.jsx("div",{style:{fontSize:14,fontWeight:600},children:"No usage data yet"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"card",children:[e.jsx("h2",{style:{fontSize:15,marginBottom:16},children:"Token Usage by Model"}),e.jsx("div",{style:{height:Math.max(200,o.length*44)},children:e.jsx(d,{width:"100%",height:"100%",children:e.jsxs(c,{data:o,layout:"vertical",margin:{left:140,right:30,top:0,bottom:0},children:[e.jsx(x,{type:"number",hide:!0}),e.jsx(m,{type:"category",dataKey:"name",axisLine:!1,tickLine:!1,tick:{fontSize:12,fill:"var(--text-dim)",fontWeight:500},width:130}),e.jsx(h,{contentStyle:{background:"#fff",border:"1px solid var(--border)",borderRadius:10,fontSize:12},formatter:t=>[t.toLocaleString(),"Tokens"]}),e.jsx(g,{dataKey:"tokens",radius:[0,6,6,0],barSize:16,children:o.map((t,s)=>e.jsx(f,{fill:`hsl(${220+s*30}, 65%, 55%)`},s))})]})})})]}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(180px, 1fr))",gap:12},children:o.map((t,s)=>e.jsxs("div",{style:{background:"#F8FAFC",border:"1px solid var(--border)",borderRadius:14,padding:"14px 16px"},children:[e.jsx("div",{style:{fontSize:11,color:"var(--muted)",marginBottom:6,fontWeight:600},children:t.name}),e.jsx("div",{style:{fontSize:20,fontWeight:800,color:`hsl(${220+s*30}, 65%, 45%)`},children:t.tokens>1e6?`${(t.tokens/1e6).toFixed(1)}M`:t.tokens>1e3?`${(t.tokens/1e3).toFixed(1)}K`:t.tokens}),e.jsx("div",{style:{fontSize:11,color:"var(--muted)"},children:"tokens"})]},t.name))})]})]})}export{j as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a4 as e,ae as u,as as g,aI as b,aJ as S}from"./vendor-gUVFsxOc.js";import{R as m,A as k,C as p,X as f,Y as y,T as v,f as z,L as T,b as _}from"./charts-CjCN_e1M.js";function l({label:c,value:i,unit:r,trend:s,sub:o,color:d}){const x=s>0?g:s<0?b:S,a=s>0?"var(--mint)":s<0?"var(--red)":"var(--muted)";return e.jsxs("div",{className:"card",style:{display:"flex",flexDirection:"column",gap:8},children:[e.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--muted)",textTransform:"uppercase",letterSpacing:"0.05em"},children:c}),e.jsxs("div",{style:{fontSize:28,fontWeight:800,color:d||"var(--text)"},children:[i,e.jsx("span",{style:{fontSize:14,color:"var(--muted)",fontWeight:500,marginLeft:4},children:r})]}),o&&e.jsx("div",{style:{fontSize:11,color:"var(--text-dim)"},children:o}),s!==void 0&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,fontSize:12,color:a,fontWeight:600},children:[e.jsx(x,{size:13})," ",Math.abs(s),"% vs last period"]})]})}function R({data:c}){const{velocity:i={}}=c||{},r=i.current||{},s=i.history||[],o=i.benchmarks||{},d=r.tasks_per_day??0,x=r.success_rate??0,a=r.avg_cycle_time_minutes??0,j=r.throughput_per_hour??0,h=s.map((t,n)=>({ts:t.timestamp?new Date(t.timestamp).toLocaleDateString():`Day ${n+1}`,tpd:t.tasks_per_day??0,sr:((t.success_rate??0)*100).toFixed(1),ct:t.avg_cycle_time_minutes??0}));return e.jsxs("div",{className:"fade-in",style:{display:"flex",flexDirection:"column",gap:28},children:[e.jsxs("div",{children:[e.jsx("h1",{style:{marginBottom:4},children:"Velocity & Throughput"}),e.jsx("p",{style:{color:"var(--text-dim)",fontSize:14},children:"Agent performance metrics and trend analysis"})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:16},children:[e.jsx(l,{label:"Tasks / Day",value:d.toFixed(1),color:"var(--accent)"}),e.jsx(l,{label:"Success Rate",value:`${(x*100).toFixed(1)}`,unit:"%",color:"var(--mint)"}),e.jsx(l,{label:"Avg Cycle Time",value:a<60?a.toFixed(0):(a/60).toFixed(1),unit:a<60?"min":"hr",color:"var(--amber)"}),e.jsx(l,{label:"Throughput/hr",value:j.toFixed(2),color:"var(--purple)"})]}),h.length>1&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"card",children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:18},children:[e.jsx(u,{size:16,color:"var(--accent)"}),e.jsx("h2",{style:{fontSize:15,margin:0},children:"Task Throughput Trend"})]}),e.jsx("div",{style:{height:200},children:e.jsx(m,{width:"100%",height:"100%",children:e.jsxs(k,{data:h,children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"tpdGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"5%",stopColor:"var(--accent)",stopOpacity:.2}),e.jsx("stop",{offset:"95%",stopColor:"var(--accent)",stopOpacity:0})]})}),e.jsx(p,{strokeDasharray:"3 3",stroke:"var(--border)"}),e.jsx(f,{dataKey:"ts",tick:{fontSize:11,fill:"var(--muted)"}}),e.jsx(y,{tick:{fontSize:11,fill:"var(--muted)"}}),e.jsx(v,{contentStyle:{background:"#fff",border:"1px solid var(--border)",borderRadius:10,fontSize:12}}),e.jsx(z,{type:"monotone",dataKey:"tpd",stroke:"var(--accent)",fill:"url(#tpdGrad)",strokeWidth:2,name:"Tasks/Day"})]})})})]}),e.jsxs("div",{className:"card",children:[e.jsx("div",{style:{marginBottom:18},children:e.jsx("h2",{style:{fontSize:15,margin:0},children:"Success Rate Trend"})}),e.jsx("div",{style:{height:180},children:e.jsx(m,{width:"100%",height:"100%",children:e.jsxs(T,{data:h,children:[e.jsx(p,{strokeDasharray:"3 3",stroke:"var(--border)"}),e.jsx(f,{dataKey:"ts",tick:{fontSize:11,fill:"var(--muted)"}}),e.jsx(y,{domain:[0,100],tick:{fontSize:11,fill:"var(--muted)"}}),e.jsx(v,{contentStyle:{background:"#fff",border:"1px solid var(--border)",borderRadius:10,fontSize:12},formatter:t=>[`${t}%`,"Success Rate"]}),e.jsx(_,{type:"monotone",dataKey:"sr",stroke:"var(--mint)",strokeWidth:2.5,dot:{r:3,fill:"var(--mint)"},name:"Success Rate"})]})})})]})]}),Object.keys(o).length>0&&e.jsxs("div",{className:"card",children:[e.jsx("h2",{style:{fontSize:15,marginBottom:16},children:"Benchmarks"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Object.entries(o).map(([t,n])=>e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",padding:"10px 0",borderBottom:"1px solid var(--border)",fontSize:13},children:[e.jsx("span",{style:{color:"var(--text-dim)",fontWeight:500},children:t.replace(/_/g," ")}),e.jsx("span",{style:{color:"var(--text)",fontWeight:700},children:typeof n=="number"?n.toFixed(2):n})]},t))})]})]})}export{R as default};
|