agi-farm 1.8.1 → 1.10.0
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 +35 -2
- package/dashboard-dist/assets/{Agents-R6RWu0N3.js → Agents-s1Pcdrga.js} +1 -1
- package/dashboard-dist/assets/{Approvals-DlAxXjQq.js → Approvals-e-y0qIwz.js} +1 -1
- package/dashboard-dist/assets/Crons-BsUNSrso.js +1 -0
- package/dashboard-dist/assets/{HITL-DLdfKu9S.js → HITL-BX5-FQjS.js} +1 -1
- package/dashboard-dist/assets/Overview-Cp6HOIJF.js +2 -0
- package/dashboard-dist/assets/{Projects-BwJwue3A.js → Projects-DGWbAWDb.js} +1 -1
- package/dashboard-dist/assets/Settings-DWsfHIfK.js +1 -0
- package/dashboard-dist/assets/{Tasks-bypXrRI-.js → Tasks-DFJ-nyg0.js} +1 -1
- package/dashboard-dist/assets/index-DUjHkafG.js +2 -0
- package/dashboard-dist/index.html +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +4 -2
- package/scripts/sync-lobsterboard-upstream.js +135 -0
- package/server/dashboard.js +910 -24
- package/server/services/security.js +23 -6
- package/dashboard-dist/assets/Crons-Z7WYAc2l.js +0 -1
- package/dashboard-dist/assets/Overview-jyL2WFAq.js +0 -2
- package/dashboard-dist/assets/Settings-CGB5pOXa.js +0 -1
- package/dashboard-dist/assets/index-C5VVgT-r.js +0 -2
package/README.md
CHANGED
|
@@ -37,6 +37,29 @@
|
|
|
37
37
|
|
|
38
38
|
---
|
|
39
39
|
|
|
40
|
+
## 🙏 Upstream Acknowledgement
|
|
41
|
+
|
|
42
|
+
Parts of AGI Farm dashboard direction are inspired by the excellent work in **LobsterBoard** by [Curbob](https://github.com/Curbob):
|
|
43
|
+
|
|
44
|
+
- Upstream repository: https://github.com/Curbob/LobsterBoard
|
|
45
|
+
- Upstream license: Business Source License 1.1 (BSL-1.1)
|
|
46
|
+
|
|
47
|
+
AGI Farm does not copy LobsterBoard code directly; features are re-implemented for AGI Farm architecture and compatibility.
|
|
48
|
+
|
|
49
|
+
### 🔄 Always-Sync Policy
|
|
50
|
+
|
|
51
|
+
To stay aligned with upstream updates, this repo now includes:
|
|
52
|
+
|
|
53
|
+
- Automated scheduled sync workflow: `.github/workflows/lobsterboard-upstream-sync.yml`
|
|
54
|
+
- Local sync script: `npm run sync:lobsterboard`
|
|
55
|
+
- Snapshot mirror for review/porting: `upstream/lobsterboard/`
|
|
56
|
+
- Tracking file: `lobsterboard-resources/LOBSTERBOARD_VERSION`
|
|
57
|
+
- Parity plan: `docs/LOBSTERBOARD_PARITY.md`
|
|
58
|
+
|
|
59
|
+
This keeps upstream diffs visible in PRs so feature ports can be done continuously.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
40
63
|
## 🆕 What's New in v1.8.0
|
|
41
64
|
|
|
42
65
|
### 🎨 Complete Dashboard Redesign — Day Theme (Minimalism 3.0 + Glassmorphism 2.0)
|
|
@@ -626,12 +649,22 @@ The dashboard enables direct control over team operations via authenticated REST
|
|
|
626
649
|
- `GET /api/usage` — Usage and cost aggregates for dashboard
|
|
627
650
|
|
|
628
651
|
**CRUD Operations:**
|
|
629
|
-
- `POST /api/
|
|
630
|
-
- `POST /api/
|
|
652
|
+
- `POST /api/tasks` — Create a new task with assignee, priority, dependencies
|
|
653
|
+
- `POST /api/comms/:id/send` — Send a message to a specific agent inbox
|
|
631
654
|
- `POST /api/broadcast` — Post a team-wide broadcast message
|
|
632
655
|
- `POST /api/knowledge` — Add a shared knowledge entry
|
|
633
656
|
- `DELETE /api/knowledge/:id` — Remove a knowledge entry
|
|
634
657
|
|
|
658
|
+
**LobsterBoard Parity Foundations (P0):**
|
|
659
|
+
- `GET /api/auth/status` — PIN/public-mode status + write unlock state
|
|
660
|
+
- `POST /api/auth/verify-pin` — Verify PIN and issue write auth token
|
|
661
|
+
- `POST /api/auth/set-pin` / `POST /api/auth/remove-pin` — Manage dashboard PIN lock
|
|
662
|
+
- `POST /api/auth/public-mode` — Toggle read-only public mode
|
|
663
|
+
- `GET /api/secrets` / `GET /api/secrets/:scope` — List masked secrets metadata
|
|
664
|
+
- `POST /api/secrets/:scope` / `DELETE /api/secrets/:scope/:key` — Store/delete scoped secrets
|
|
665
|
+
- `GET /api/templates` / `GET /api/templates/:id` — List and inspect dashboard templates
|
|
666
|
+
- `POST /api/templates/export` / `POST /api/templates/import` — Export/import template settings
|
|
667
|
+
|
|
635
668
|
**Auto-Update:**
|
|
636
669
|
- `GET /api/update-check` — Force a fresh GitHub release check
|
|
637
670
|
- `POST /api/update-install` — Install latest version via npm
|
|
@@ -1 +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-
|
|
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-DUjHkafG.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};
|
|
@@ -1 +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-
|
|
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-DUjHkafG.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{r as p,a4 as r,aF as x,am as f,aA as c,aG as g}from"./vendor-gUVFsxOc.js";import{a as u}from"./index-DUjHkafG.js";function h(e){if(!e)return"Never";try{const t=Math.round((Date.now()-new Date(e))/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 e}}function m({errors:e}){const t=e>=3?"var(--red)":e>0?"var(--amber)":"var(--mint)";return r.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:t,display:"inline-block",flexShrink:0}})}function b(e){return e?typeof e=="string"?e:e.kind==="every"&&Number(e.everyMs)>0?`every ${Math.round(Number(e.everyMs)/6e4)}m`:typeof e.cronExpression=="string"?e.cronExpression:typeof e.expr=="string"?e.tz?`${e.expr} (${e.tz})`:e.expr:e.kind||"No schedule":"No schedule"}function y(e){return e==null||Number.isNaN(Number(e))?null:new Date(Date.now()-Number(e)*1e3).toISOString()}function v(e){return e==null||Number.isNaN(Number(e))?"—":e<0?"overdue":e<60?`${e}s`:e<3600?`${Math.round(e/60)}m`:`${Math.round(e/3600)}h`}function j({cron:e,toast:t}){const[i,s]=p.useState(null),o=e._consecutive_errors||0;async function d(){s("toggle");try{await u(`/api/cron/${e.id}/toggle`),t?.(e.enabled!==!1?"Job paused":"Job resumed","success")}catch(l){t?.(l.message,"error")}s(null)}async function a(){s("run");try{await u(`/api/cron/${e.id}/trigger`),t?.("Job triggered","success")}catch(l){t?.(l.message,"error")}s(null)}const n=e.enabled!==!1;return r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:14,padding:"14px 18px",borderBottom:"1px solid var(--border)",background:o>=3?"#FFF8F8":"#fff",transition:"background 0.2s"},children:[r.jsx(m,{errors:o}),r.jsxs("div",{style:{flex:1,minWidth:0},children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:3},children:[r.jsx("span",{style:{fontSize:14,fontWeight:600,color:"var(--text)"},children:e.name||e.id}),!n&&r.jsx("span",{style:{fontSize:10,background:"#F1F5F9",color:"var(--muted)",borderRadius:999,padding:"1px 8px",fontWeight:600},children:"Paused"}),o>=3&&r.jsxs("span",{style:{fontSize:10,background:"#FEF2F2",color:"var(--red)",borderRadius:999,padding:"1px 8px",fontWeight:600},children:["⚠ ",o," errors"]})]}),r.jsxs("div",{style:{fontSize:11,color:"var(--muted)",display:"flex",gap:12},children:[r.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4},children:[r.jsx(f,{size:10})," ",b(e.schedule)]}),r.jsxs("span",{children:["Last: ",h(y(e._last_run_sec))]}),r.jsxs("span",{children:["Next: ",v(e._next_run_sec)]})]})]}),r.jsxs("div",{style:{display:"flex",gap:8,flexShrink:0},children:[r.jsxs("button",{onClick:a,disabled:!!i,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:[r.jsx(c,{size:11})," ",i==="run"?"…":"Run"]}),r.jsxs("button",{onClick:d,disabled:!!i,title:n?"Pause":"Resume",style:{background:n?"#FEF2F2":"#ECFDF5",border:`1px solid ${n?"#FEE2E2":"#D1FAE5"}`,borderRadius:8,padding:"6px 10px",cursor:"pointer",display:"flex",alignItems:"center",gap:4,fontSize:11,color:n?"var(--red)":"var(--mint)",fontWeight:600},children:[n?r.jsx(g,{size:11}):r.jsx(c,{size:11})," ",n?"Pause":"Resume"]})]})]})}function N({data:e,toast:t}){const{crons:i=[]}=e||{},[s,o]=p.useState(""),d=i.filter(n=>!s||(n.name||n.id||"").toLowerCase().includes(s.toLowerCase())),a=i.filter(n=>(n._consecutive_errors||0)>=3);return r.jsxs("div",{className:"fade-in",style:{display:"flex",flexDirection:"column",gap:24},children:[r.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end"},children:[r.jsxs("div",{children:[r.jsx("h1",{style:{marginBottom:4},children:"Jobs & Crons"}),r.jsxs("p",{style:{color:"var(--text-dim)",fontSize:14},children:[i.length," scheduled jobs"]})]}),r.jsx("input",{className:"input-base",placeholder:"Search jobs…",value:s,onChange:n=>o(n.target.value),style:{width:220}})]}),a.length>0&&r.jsxs("div",{style:{padding:"14px 18px",background:"#FFF1F2",border:"1px solid #FEE2E2",borderRadius:14,display:"flex",alignItems:"center",gap:12},children:[r.jsx(x,{size:18,color:"var(--red)"}),r.jsxs("span",{style:{fontSize:13,fontWeight:600,color:"var(--red)"},children:[a.length," job",a.length>1?"s":""," with repeated errors"]})]}),r.jsxs("div",{style:{background:"#fff",border:"1px solid var(--border)",borderRadius:16,overflow:"hidden",boxShadow:"var(--shadow)"},children:[r.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:[r.jsx("span",{style:{flex:1},children:"Job Name"}),r.jsx("span",{style:{minWidth:100},children:"Schedule"}),r.jsx("span",{style:{minWidth:120},children:"Actions"})]}),d.length===0?r.jsx("div",{style:{padding:48,textAlign:"center",color:"var(--muted)",fontSize:13},children:"No jobs match your search"}):d.map(n=>r.jsx(j,{cron:n,toast:t},n.id))]})]})}export{N as default};
|
|
@@ -1 +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-
|
|
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-DUjHkafG.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,2 @@
|
|
|
1
|
+
import{a4 as e,aa as b,ag as u,ad as F,af as k,as as S}from"./vendor-gUVFsxOc.js";function z(i){const n=i._task_counts||{},s=i.target_completion?Math.ceil((new Date(i.target_completion)-Date.now())/864e5):999;return(n.blocked||0)>2||s<-3?"critical":(n.hitl||0)>0||s<0?"at-risk":"healthy"}function T(i,n,s){const r=n.filter(o=>(i.task_ids||[]).includes(o.id)),l=r.filter(o=>o.status==="complete").length,t=r.length,d=(i.team||[]).map(o=>s.find(g=>g.id===o)).filter(Boolean);return{...i,_task_counts:{total:t,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:t>0?Math.round(l/t*100):0,_team_agents:d}}const y={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:i,label:n,value:s,sub:r,color:l,accentBg:t}){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:t||"#EEF2FF",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e.jsx(i,{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 _({project:i}){const n=z(i),s=y[n]||y.healthy,r=i._progress_pct??0,l=i._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:t=>{t.currentTarget.style.transform="translateY(-2px)",t.currentTarget.style.boxShadow="var(--shadow-lg)"},onMouseOut:t=>{t.currentTarget.style.transform="",t.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:i.name||i.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(t=>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:t.v??0}),e.jsx("div",{style:{fontSize:9,color:"var(--muted)",fontWeight:600,textTransform:"uppercase"},children:t.l})]},t.l))}),i._team_agents?.length>0&&e.jsx("div",{style:{display:"flex",gap:4,paddingTop:8,borderTop:"1px solid rgba(0,0,0,0.06)"},children:i._team_agents.slice(0,6).map(t=>e.jsx("span",{title:t.name,style:{fontSize:14},children:t.emoji||"🤖"},t.id))})]})}function w({agent:i,tasks:n}){const s=n.filter(c=>c.assigned_to===i.id),r=s.find(c=>c.status==="in-progress"),l=s.find(c=>c.status==="needs_human_decision"),t=i.heartbeat_age_minutes??999,d=!!r,o=!!l,g=o?"#F5F3FF":d?"#EEF2FF":"#F8FAFC",h=t<5?"var(--mint)":t<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:i.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:i.name||i.id}),e.jsx("div",{style:{fontSize:10,color:"var(--muted)",textTransform:"capitalize",fontWeight:500},children:i.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]}):d?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:i.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:t<999?`${t}m`:"--"})]})}function W({broadcast:i}){const n=(i||"").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),t=/hitl/i.test(s),d=/success|complete|done/i.test(s),o=l?"var(--red)":t?"var(--purple)":d?"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 C({data:i}){const{agents:n=[],tasks:s=[],task_counts:r={},projects:l=[],budget:t={},broadcast:d="",alerts:o=[]}=i||{},g=l.map(a=>T(a,s,n)),h=g.filter(a=>["active","ACTIVE"].includes(a.status)),c=t.current?.daily_usd??0,m=typeof t.limits?.daily_usd=="number"&&t.limits.daily_usd>0,f=m?t.limits.daily_usd:0,x=m?Math.min(100,c/f*100):0,v=r.needs_human_decision??0,j=n.filter(a=>a.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:b,label:"Active Agents",value:`${j}/${n.length}`,color:"var(--accent)",accentBg:"#EEF2FF"}),e.jsx(p,{icon:u,label:"Active Projects",value:h.length,color:"var(--cyan)",accentBg:"#ECFEFF",sub:`of ${g.length} total`}),e.jsx(p,{icon:F,label:"HITL Queue",value:v,color:v>0?"var(--purple)":"var(--mint)",accentBg:v>0?"#F5F3FF":"#ECFDF5",sub:"Needs your input"}),e.jsx(p,{icon:k,label:"Daily Spend",value:`$${c.toFixed(2)}`,color:"var(--mint)",accentBg:"#ECFDF5",sub:m?`of $${f} limit`:"No daily limit set"})]}),e.jsxs("div",{className:"card",style:{padding:"16px 24px",display:"flex",alignItems:"center",gap:20},children:[e.jsx(S,{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:`${x}%`,background:x>80?"var(--red)":x>60?"var(--amber)":"var(--mint)"}})}),e.jsxs("span",{style:{fontSize:13,fontWeight:700,color:"var(--text)",minWidth:60,textAlign:"right"},children:[Math.round(x),"%"]})]}),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(a=>e.jsx(_,{project:a},a.id))}):e.jsxs("div",{className:"card",style:{textAlign:"center",padding:"64px",color:"var(--muted)"},children:[e.jsx(u,{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(a=>e.jsx(w,{agent:a,tasks:s},a.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:d})]})]}),e.jsx("style",{children:"@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.4;} }"})]})}export{C as default};
|
|
@@ -1 +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};
|
|
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-DUjHkafG.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{r as i,a4 as e,a7 as Z,aQ as ee}from"./vendor-gUVFsxOc.js";import{g as te,b as se,d as ae,a as ie,v as le,f as ne,r as re,h as oe,i as ce,j as de,k as ue,m as me}from"./index-DUjHkafG.js";function ge({data:m,toast:a}){const p=m?.workspace_meta||{},s=m?.settings||{},[o,c]=i.useState({budget_daily:s.budget_daily??"",budget_weekly:s.budget_weekly??"",budget_monthly:s.budget_monthly??"",hitl_enabled:s.hitl_enabled!==!1,auto_resume:s.auto_resume===!0,auth:{public_mode:s.auth?.public_mode===!0,has_pin:s.auth?.has_pin===!0}}),[v,j]=i.useState(!1),[g,f]=i.useState(""),[S,w]=i.useState(""),[k,N]=i.useState(""),[_,C]=i.useState(""),[P,I]=i.useState(""),[b,R]=i.useState({hasPin:!1,publicMode:!1,writeUnlocked:!1}),[A,D]=i.useState([]),[T,U]=i.useState("My Dashboard"),[h,W]=i.useState(""),[B,E]=i.useState("replace"),[F,L]=i.useState([]),[d,K]=i.useState("default"),[u,V]=i.useState(""),[x,M]=i.useState("");i.useEffect(()=>{c({budget_daily:s.budget_daily??"",budget_weekly:s.budget_weekly??"",budget_monthly:s.budget_monthly??"",hitl_enabled:s.hitl_enabled!==!1,auto_resume:s.auto_resume===!0,auth:{public_mode:s.auth?.public_mode===!0,has_pin:s.auth?.has_pin===!0}})},[s.budget_daily,s.budget_weekly,s.budget_monthly,s.hitl_enabled,s.auto_resume,s.auth?.public_mode,s.auth?.has_pin]);const n=async()=>{try{const[t,l,y]=await Promise.all([te(),se(),ae()]);R({hasPin:t?.hasPin===!0,publicMode:t?.publicMode===!0,writeUnlocked:t?.writeUnlocked===!0}),D(l?.templates||[]),L(y?.scopes||[])}catch{}};i.useEffect(()=>{n()},[]);const $=async()=>{j(!0);try{await ie("/api/settings",o),a?.("Settings saved","success")}catch(t){a?.(t.message,"error")}j(!1)},G=async()=>{if(g.trim())try{await le(g.trim()),f(""),await n(),a?.("Write access unlocked","success")}catch(t){a?.(t.message,"error")}},q=async()=>{try{await ne(k.trim(),S.trim()),w(""),N(""),await n(),a?.("PIN updated","success")}catch(t){a?.(t.message,"error")}},H=async()=>{try{await re(_.trim()),C(""),await n(),a?.("PIN removed","success")}catch(t){a?.(t.message,"error")}},Q=async()=>{try{await oe(!b.publicMode,P.trim()),I(""),await n(),a?.("Public mode updated","success")}catch(t){a?.(t.message,"error")}},J=async()=>{try{await ce({name:T.trim(),id:h.trim()||void 0}),await n(),a?.("Template exported","success")}catch(t){a?.(t.message,"error")}},O=async()=>{if(h.trim())try{await de({id:h.trim(),mode:B}),await n(),a?.("Template imported","success")}catch(t){a?.(t.message,"error")}},X=async()=>{if(!(!d.trim()||!u.trim()||!x.trim()))try{await ue(d.trim(),{[u.trim()]:x}),M(""),await n(),a?.("Secret stored","success")}catch(t){a?.(t.message,"error")}},Y=async()=>{if(!(!d.trim()||!u.trim()))try{await me(d.trim(),u.trim()),await n(),a?.("Secret removed","success")}catch(t){a?.(t.message,"error")}};function r({label:t,sub:l,children:y}){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}),l&&e.jsx("div",{style:{fontSize:12,color:"var(--muted)",marginTop:2},children:l})]}),e.jsx("div",{style:{flexShrink:0},children:y})]})}function z({value:t,onChange:l}){return e.jsx("button",{onClick:()=>l(!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:p.path||m?.workspace||"—"},{k:"Team Name",v:p.team_name||"—"},{k:"Version",v:p.version||m?.version||"—"},{k:"Process ID",v:p.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(r,{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:o.budget_daily,onChange:t=>c(l=>({...l,budget_daily:t.target.value}))})}),e.jsx(r,{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:o.budget_weekly,onChange:t=>c(l=>({...l,budget_weekly:t.target.value}))})}),e.jsx(r,{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:o.budget_monthly,onChange:t=>c(l=>({...l,budget_monthly:t.target.value}))})})]}),e.jsxs("div",{className:"card",children:[e.jsx("h2",{style:{fontSize:15,marginBottom:4},children:"Behavior"}),e.jsx(r,{label:"HITL Gate",sub:"Pause agents at human approval gates",children:e.jsx(z,{value:o.hitl_enabled,onChange:t=>c(l=>({...l,hitl_enabled:t}))})}),e.jsx(r,{label:"Auto Resume",sub:"Automatically resume tasks after approval",children:e.jsx(z,{value:o.auto_resume,onChange:t=>c(l=>({...l,auto_resume:t}))})})]}),e.jsxs("div",{className:"card",children:[e.jsx("h2",{style:{fontSize:15,marginBottom:4},children:"Access Control"}),e.jsx(r,{label:"Write Access",sub:b.writeUnlocked?"Unlocked for this browser session":"PIN required for edits",children:e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsx("input",{className:"input-base",style:{width:130},placeholder:"PIN",value:g,onChange:t=>f(t.target.value)}),e.jsx("button",{className:"btn-secondary",onClick:G,children:"Unlock"})]})}),e.jsx(r,{label:"Public Mode",sub:"Read-only dashboard mode",children:e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsx("input",{className:"input-base",style:{width:130},placeholder:"PIN (if set)",value:P,onChange:t=>I(t.target.value)}),e.jsx("button",{className:"btn-secondary",onClick:Q,children:b.publicMode?"Disable":"Enable"})]})}),e.jsx(r,{label:"Set/Rotate PIN",sub:"4-8 digits",children:e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsx("input",{className:"input-base",style:{width:130},placeholder:"Current PIN",value:S,onChange:t=>w(t.target.value)}),e.jsx("input",{className:"input-base",style:{width:130},placeholder:"New PIN",value:k,onChange:t=>N(t.target.value)}),e.jsx("button",{className:"btn-secondary",onClick:q,children:"Save PIN"})]})}),e.jsx(r,{label:"Remove PIN",sub:"Disables PIN lock",children:e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsx("input",{className:"input-base",style:{width:130},placeholder:"Current PIN",value:_,onChange:t=>C(t.target.value)}),e.jsx("button",{className:"btn-secondary",onClick:H,children:"Remove"})]})})]}),e.jsxs("div",{className:"card",children:[e.jsx("h2",{style:{fontSize:15,marginBottom:4},children:"Templates"}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10,marginBottom:12},children:[e.jsx("input",{className:"input-base",placeholder:"Template name",value:T,onChange:t=>U(t.target.value)}),e.jsx("input",{className:"input-base",placeholder:"Template id (optional)",value:h,onChange:t=>W(t.target.value)})]}),e.jsxs("div",{style:{display:"flex",gap:8,marginBottom:12},children:[e.jsx("button",{className:"btn-secondary",onClick:J,children:"Export Current"}),e.jsxs("select",{className:"input-base",value:B,onChange:t=>E(t.target.value),style:{width:130},children:[e.jsx("option",{value:"replace",children:"Replace"}),e.jsx("option",{value:"merge",children:"Merge"})]}),e.jsx("button",{className:"btn-secondary",onClick:O,children:"Import Selected ID"})]}),e.jsxs("div",{style:{fontSize:12,color:"var(--muted)"},children:["Available: ",(A||[]).map(t=>t.id).join(", ")||"none"]})]}),e.jsxs("div",{className:"card",children:[e.jsx("h2",{style:{fontSize:15,marginBottom:4},children:"Secrets"}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:10,marginBottom:12},children:[e.jsx("input",{className:"input-base",placeholder:"Scope",value:d,onChange:t=>K(t.target.value)}),e.jsx("input",{className:"input-base",placeholder:"Key",value:u,onChange:t=>V(t.target.value)}),e.jsx("input",{className:"input-base",placeholder:"Value",value:x,onChange:t=>M(t.target.value)})]}),e.jsxs("div",{style:{display:"flex",gap:8,marginBottom:12},children:[e.jsx("button",{className:"btn-secondary",onClick:X,children:"Store Secret"}),e.jsx("button",{className:"btn-secondary",onClick:Y,children:"Delete Secret Key"})]}),e.jsxs("div",{style:{fontSize:12,color:"var(--muted)"},children:["Scopes: ",(F||[]).map(t=>`${t.scope}(${t.count})`).join(", ")||"none"]})]}),e.jsx("button",{onClick:$,disabled:v,className:"btn-primary",style:{alignSelf:"flex-start",display:"flex",alignItems:"center",gap:8,padding:"10px 28px"},children:v?e.jsxs(e.Fragment,{children:[e.jsx(Z,{size:14,className:"spin"})," Saving…"]}):e.jsxs(e.Fragment,{children:[e.jsx(ee,{size:14})," Save Settings"]})})]})}export{ge as default};
|
|
@@ -1 +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};
|
|
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-DUjHkafG.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,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Overview-Cp6HOIJF.js","assets/vendor-gUVFsxOc.js","assets/Agents-s1Pcdrga.js","assets/Tasks-DFJ-nyg0.js","assets/Projects-DGWbAWDb.js","assets/charts-CjCN_e1M.js","assets/Jobs-Ch4D8P85.js","assets/Approvals-e-y0qIwz.js","assets/Usage-Cvfmkgit.js","assets/Crons-BsUNSrso.js","assets/HITL-BX5-FQjS.js","assets/Alerts-T-KcEJKx.js","assets/Velocity-DzCZH_YB.js","assets/Budget-DRJWqsop.js","assets/OKRs-Dt0HzTQQ.js","assets/Knowledge-C92uZhl9.js","assets/Comms-DT2o5TCi.js","assets/Memory-DFU5CtTT.js","assets/Processes-btq7Pyex.js","assets/Failures-CaEvQ0t1.js","assets/Decisions-B3i1Rijg.js","assets/Security-BVLBAnlu.js","assets/Policies-CbemgLkX.js","assets/AuditLog-Cc1GUGYz.js","assets/Settings-DWsfHIfK.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as d,a4 as t,a5 as $,a6 as U,a7 as M,a8 as B,a9 as F,aa as H,ab as K,ac as q,ad as J,ae as Y,af as G,ag as Q,ah as X,ai as Z,aj as ee,ak as te,al as re,am as ne,an as se,ao as oe,ap as ie,aq as ae,ar as ce}from"./vendor-gUVFsxOc.js";(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(o){if(o.ep)return;o.ep=!0;const a=n(o);fetch(o.href,a)}})();const le="modulepreload",ue=function(e){return"/"+e},C={},f=function(r,n,s){let o=Promise.resolve();if(n&&n.length>0){let u=function(i){return Promise.all(i.map(c=>Promise.resolve(c).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),m=l?.nonce||l?.getAttribute("nonce");o=u(n.map(i=>{if(i=ue(i),i in C)return;C[i]=!0;const c=i.endsWith(".css"),h=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${h}`))return;const g=document.createElement("link");if(g.rel=c?"stylesheet":le,c||(g.as="script"),g.crossOrigin="",g.href=i,m&&g.setAttribute("nonce",m),document.head.appendChild(g),c)return new Promise((y,_)=>{g.addEventListener("load",y),g.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${i}`)))})}))}function a(l){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=l,window.dispatchEvent(m),!m.defaultPrevented)throw l}return o.then(l=>{for(const m of l||[])m.status==="rejected"&&a(m.reason);return r().catch(a)})};let w=null;const O="agi_farm_write_auth_token";async function de(){const e=await fetch("/api/session");if(!e.ok)throw new Error("failed_to_fetch_session");const r=await e.json();if(!r?.csrfToken)throw new Error("missing_csrf_token");return r.csrfToken}async function T(){return w||(w=de().catch(e=>{throw w=null,e})),w}function fe(){try{return window.localStorage.getItem(O)||""}catch{return""}}function pe(e){try{if(!e){window.localStorage.removeItem(O);return}window.localStorage.setItem(O,String(e))}catch{}}function A(e={}){const r=fe();return r?{...e,"x-agi-farm-auth":r}:e}async function he(e){const r=await T(),n=await fetch(e,{method:"DELETE",headers:A({"x-agi-farm-csrf":r})});let s={};try{s=await n.json()}catch{s={}}if(!n.ok)throw new Error(s?.error||`request_failed_${n.status}`);return s}async function v(e,r=null){const s={"Content-Type":"application/json","x-agi-farm-csrf":await T()},o={method:"POST",headers:A(s)};r!==null&&(o.body=JSON.stringify(r));const a=await fetch(e,o);let l={};try{l=await a.json()}catch{l={}}if(!a.ok)throw new Error(l?.error||`request_failed_${a.status}`);return l}async function I(e){const r=await T(),n=await fetch(e,{headers:A({"x-agi-farm-csrf":r})});let s={};try{s=await n.json()}catch{s={}}if(!n.ok)throw new Error(s?.error||`request_failed_${n.status}`);return s}async function et(e){return v("/api/intake/task",e)}async function tt(e={}){const r=new URLSearchParams;Object.entries(e||{}).forEach(([s,o])=>{o==null||o===""||o==="all"||r.set(s,String(o))});const n=r.toString()?`?${r.toString()}`:"";return I(`/api/projects${n}`)}async function rt(e){return v("/api/tasks",e)}async function nt(e,r){return me(`/api/tasks/${e}`,r)}async function st(e,r={}){return v(`/api/projects/${e}/plan`,r)}async function ot(e,r={}){return v(`/api/projects/${e}/execute`,r)}async function me(e,r=null){const n=await T(),s={method:"PATCH",headers:A({"Content-Type":"application/json","x-agi-farm-csrf":n})};r!==null&&(s.body=JSON.stringify(r));const o=await fetch(e,s);let a={};try{a=await o.json()}catch{a={}}if(!o.ok)throw new Error(a?.error||`request_failed_${o.status}`);return a}async function it(){return I("/api/auth/status")}async function at(e){const r=await v("/api/auth/verify-pin",{pin:e});return r?.authToken&&pe(r.authToken),r}async function ct(e,r=""){return v("/api/auth/set-pin",{pin:e,currentPin:r||void 0})}async function lt(e){return v("/api/auth/remove-pin",{pin:e})}async function ut(e,r=""){return v("/api/auth/public-mode",{publicMode:e,pin:r||void 0})}async function dt(){return I("/api/templates")}async function ft(e){return v("/api/templates/export",e)}async function pt(e){return v("/api/templates/import",e)}async function ht(){return I("/api/secrets")}async function mt(e,r){return v(`/api/secrets/${e}`,{updates:r})}async function gt(e,r){return he(`/api/secrets/${e}/${r}`)}const ge=1e4,D=3e3,z=6e4;function xe(){const[e,r]=d.useState(window.INITIAL_DATA||null),[n,s]=d.useState(!1),[o,a]=d.useState(window.INITIAL_DATA?new Date:null),[l,m]=d.useState(0),u=d.useRef(null),i=d.useRef(!0),c=d.useRef(null),h=d.useRef(null),g=d.useRef(null),y=d.useRef(D),_=d.useCallback(x=>{!x||x.error||x.type==="keepalive"||(r(S=>({...x})),s(!0),a(new Date),m(S=>S+1))},[]),E=d.useCallback(()=>{c.current&&clearInterval(c.current),c.current=setInterval(async()=>{if(!(!i.current||!g.current))try{const x=await fetch("/api/data",{headers:{"x-agi-farm-csrf":g.current}});x.ok&&_(await x.json())}catch{}},ge)},[_]),b=d.useCallback(async()=>{if(!i.current)return;if(u.current)try{u.current.close()}catch{}if(!g.current)try{g.current=await T()}catch{h.current=setTimeout(b,y.current),y.current=Math.min(y.current*2,z);return}const x=new EventSource(`/api/stream?token=${encodeURIComponent(g.current)}`);u.current=x,x.onopen=()=>{i.current&&(s(!0),y.current=D,h.current&&(clearTimeout(h.current),h.current=null))},x.onmessage=S=>{if(i.current)try{_(JSON.parse(S.data))}catch{}},x.onerror=()=>{if(i.current){s(!1);try{x.close()}catch{}u.current=null,h.current=setTimeout(b,y.current),y.current=Math.min(y.current*2,z)}}},[_]);return d.useEffect(()=>(i.current=!0,b(),E(),()=>{if(i.current=!1,u.current)try{u.current.close()}catch{}c.current&&clearInterval(c.current),h.current&&clearTimeout(h.current)}),[b,E]),{data:e,connected:n,lastUpdated:o,updateCount:l}}function ye(){const[e,r]=d.useState(new Date);return d.useEffect(()=>{const n=setInterval(()=>r(new Date),1e3);return()=>clearInterval(n)},[]),t.jsx("span",{style:{color:"var(--text-dim)",fontSize:"12px",fontFamily:"var(--font-mono)",fontWeight:500},children:e.toLocaleTimeString([],{hour12:!0})})}function k({label:e,value:r,color:n}){return t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",padding:"6px 14px",borderRadius:10,background:"#F8FAFC",border:"1px solid var(--border)"},children:[t.jsx("span",{style:{fontSize:10,color:"var(--muted)",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em"},children:e}),t.jsx("span",{style:{fontSize:14,fontWeight:700,color:n||"var(--text)",marginTop:1},children:r})]})}function ve({data:e,connected:r,lastUpdated:n,toast:s}){const o=e?.agents||[],a=e?.task_counts||{},l=e?.budget||{},u=r&&(e||{}).gateway_online!==!1,i=r&&u,c=e?.update_info,[h,g]=d.useState(()=>sessionStorage.getItem("update-dismissed")==="true"),[y,_]=d.useState(!1),E=c?.updateAvailable&&!h,b=async()=>{_(!0);try{const j=await v("/api/update-install");j.success?s?.("Update installed — please restart","success"):s?.(j.error||"Update failed","error")}catch(j){s?.(j.message,"error")}_(!1)},x=o.filter(j=>j.status!=="available").length,S=o.length,L=a.needs_human_decision??0,W=(l.current?.daily_usd??0).toFixed(2);return t.jsxs(t.Fragment,{children:[t.jsxs("header",{style:{height:60,borderBottom:"1px solid var(--border)",background:"var(--bg-panel)",display:"flex",alignItems:"center",padding:"0 32px",gap:20,position:"sticky",top:0,zIndex:200,backdropFilter:"blur(20px)",boxShadow:"var(--shadow-sm)",flexShrink:0},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[i?t.jsx($,{size:14,color:"var(--mint)"}):t.jsx(U,{size:14,color:"var(--red)"}),t.jsx("span",{style:{fontSize:11,fontWeight:600,color:i?"var(--mint)":"var(--red)"},children:i?"Connected":r?"Gateway Down":"Offline"})]}),t.jsx("div",{style:{width:1,height:24,background:"var(--border)"}}),t.jsx(k,{label:"Active Agents",value:`${x} / ${S}`,color:"var(--accent)"}),t.jsx(k,{label:"HITL Queue",value:L,color:L>0?"var(--purple)":"var(--text-dim)"}),t.jsx(k,{label:"Daily Spend",value:`$${W}`,color:"var(--mint)"}),t.jsx("div",{style:{flex:1}}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16},children:[n&&t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,color:"var(--muted)",fontSize:11},children:[t.jsx(M,{size:11}),t.jsxs("span",{children:["Updated ",n.toLocaleTimeString([],{hour12:!0})]})]}),t.jsx(ye,{})]})]}),E&&t.jsxs("div",{style:{background:"var(--accent)",color:"#fff",padding:"8px 32px",display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"12px",fontWeight:600},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[t.jsx(B,{size:14}),t.jsxs("span",{children:["Update available: v",c.currentVersion," → v",c.latestVersion]})]}),t.jsxs("div",{style:{display:"flex",gap:12},children:[t.jsx("button",{onClick:b,disabled:y,style:{background:"rgba(255,255,255,0.2)",color:"#fff",border:"1px solid rgba(255,255,255,0.3)",padding:"4px 14px",borderRadius:8,cursor:"pointer",fontSize:11,fontWeight:700},children:y?"Installing…":"Install Now"}),t.jsx("button",{onClick:()=>{g(!0),sessionStorage.setItem("update-dismissed","true")},style:{background:"none",border:"none",cursor:"pointer",color:"#fff",fontSize:16},children:"✕"})]})]})]})}const _e=[{id:"Overview",icon:F,label:"Overview"},{id:"Agents",icon:H,label:"Agents"},{id:"Tasks",icon:K,label:"Tasks"},{id:"HITL",icon:q,label:"HITL",badge:"hitl"},{id:"Alerts",icon:J,label:"Alerts",badge:"alerts"},{id:"Velocity",icon:Y,label:"Velocity"},{id:"Budget",icon:G,label:"Budget"}],be=[{id:"Projects",icon:Q,label:"Projects"},{id:"OKRs",icon:X,label:"OKRs"},{id:"Approvals",icon:Z,label:"Approvals",badge:"approvals"},{id:"Knowledge",icon:ee,label:"Knowledge"},{id:"Comms",icon:te,label:"Comms"}],Se=[{id:"Security",icon:re,label:"Security"},{id:"Crons",icon:ne,label:"Jobs & Crons",badge:"crons"},{id:"Processes",icon:se,label:"Processes"},{id:"Memory",icon:oe,label:"Memory"},{id:"Settings",icon:ie,label:"Settings"}];function P({title:e,items:r,active:n,onChange:s,badges:o={}}){return t.jsxs("div",{style:{marginBottom:24},children:[t.jsx("div",{style:{fontSize:"10px",fontWeight:700,color:"var(--muted)",letterSpacing:"0.08em",textTransform:"uppercase",padding:"0 12px",marginBottom:6},children:e}),r.map(({id:a,icon:l,label:m,badge:u})=>{const i=n===a,c=u&&o[u]||0;return t.jsxs("button",{onClick:()=>s(a),style:{width:"100%",display:"flex",alignItems:"center",gap:10,padding:"9px 12px",borderRadius:10,border:"none",cursor:"pointer",background:i?"rgba(79,70,229,0.08)":"transparent",color:i?"var(--accent)":"var(--text-dim)",fontWeight:i?600:400,fontSize:13,fontFamily:"var(--font-main)",transition:"all 0.15s ease",textAlign:"left",marginBottom:2},children:[t.jsx(l,{size:15,strokeWidth:i?2.2:1.8,style:{flexShrink:0}}),t.jsx("span",{style:{flex:1},children:m}),c>0&&t.jsx("span",{style:{background:i?"var(--accent)":"#EEF2FF",color:i?"#fff":"var(--accent)",fontSize:10,fontWeight:700,borderRadius:999,padding:"1px 6px",minWidth:18,textAlign:"center"},children:c}),i&&t.jsx(ae,{size:12,style:{flexShrink:0}})]},a)})]})}function je({active:e,onChange:r,badges:n={}}){const s={hitl:n.HITL,alerts:n.Alerts,crons:n.Crons,approvals:n.Approvals};return t.jsxs("nav",{style:{width:220,background:"var(--bg-panel)",borderRight:"1px solid var(--border)",display:"flex",flexDirection:"column",padding:"16px 8px",overflowY:"auto",boxShadow:"var(--shadow-sm)",flexShrink:0},children:[t.jsxs("div",{style:{padding:"4px 12px 20px",display:"flex",alignItems:"center",gap:10},children:[t.jsx("span",{style:{fontSize:22},children:"🦅"}),t.jsxs("div",{children:[t.jsx("div",{style:{fontWeight:700,fontSize:13,color:"var(--text)",letterSpacing:"-0.01em"},children:"AGI Farm"}),t.jsx("div",{style:{fontSize:10,color:"var(--muted)",fontWeight:400},children:"Ops Dashboard"})]})]}),t.jsx(P,{title:"Agent Intelligence",items:_e,active:e,onChange:r,badges:s}),t.jsx(P,{title:"Project Oversight",items:be,active:e,onChange:r,badges:s}),t.jsx("div",{style:{flex:1}}),t.jsx(P,{title:"System",items:Se,active:e,onChange:r,badges:s})]})}const V=d.createContext(null);let Te=0;function Ee(){return d.useContext(V)}function we({children:e}){const[r,n]=d.useState([]),s=d.useRef({}),o=d.useCallback((u,i="info")=>{const c=++Te;return n(h=>[...h,{id:c,message:u,type:i}]),s.current[c]=setTimeout(()=>{n(h=>h.filter(g=>g.id!==c)),delete s.current[c]},4e3),c},[]),a=d.useCallback(u=>{n(i=>i.filter(c=>c.id!==u)),s.current[u]&&(clearTimeout(s.current[u]),delete s.current[u])},[]),l={success:"var(--green)",error:"var(--red)",info:"var(--cyan)"},m={success:"✅",error:"❌",info:"ℹ️"};return t.jsxs(V.Provider,{value:o,children:[e,t.jsx("div",{style:{position:"fixed",bottom:20,right:20,zIndex:99999,display:"flex",flexDirection:"column-reverse",gap:8,maxWidth:360},children:r.map(u=>t.jsxs("div",{className:"toast-enter",style:{background:"var(--bg2)",border:`1px solid ${l[u.type]||l.info}`,borderRadius:6,padding:"10px 14px",fontSize:12,color:"var(--text)",display:"flex",alignItems:"center",gap:8,boxShadow:`0 4px 20px rgba(0,0,0,.5), 0 0 8px ${l[u.type]}33`},children:[t.jsx("span",{style:{fontSize:14,flexShrink:0},children:m[u.type]}),t.jsx("span",{style:{flex:1,lineHeight:1.4},children:u.message}),t.jsx("button",{onClick:()=>a(u.id),style:{background:"none",border:"none",color:"var(--muted)",cursor:"pointer",fontSize:14,padding:0,lineHeight:1},children:"×"})]},u.id))})]})}const R="agi-farm-lazy-retry";function p(e){return d.lazy(async()=>{try{const r=await e();return sessionStorage.removeItem(R),r}catch(r){throw sessionStorage.getItem(R)==="1"||(sessionStorage.setItem(R,"1"),window.location.reload()),r}})}const N=p(()=>f(()=>import("./Overview-Cp6HOIJF.js"),__vite__mapDeps([0,1]))),Ae=p(()=>f(()=>import("./Agents-s1Pcdrga.js"),__vite__mapDeps([2,1]))),Ie=p(()=>f(()=>import("./Tasks-DFJ-nyg0.js"),__vite__mapDeps([3,1]))),ke=p(()=>f(()=>import("./Projects-DGWbAWDb.js"),__vite__mapDeps([4,1,5]))),Pe=p(()=>f(()=>import("./Jobs-Ch4D8P85.js"),__vite__mapDeps([6,1]))),Re=p(()=>f(()=>import("./Approvals-e-y0qIwz.js"),__vite__mapDeps([7,1]))),Oe=p(()=>f(()=>import("./Usage-Cvfmkgit.js"),__vite__mapDeps([8,1,5]))),Le=p(()=>f(()=>import("./Crons-BsUNSrso.js"),__vite__mapDeps([9,1]))),Ce=p(()=>f(()=>import("./HITL-BX5-FQjS.js"),__vite__mapDeps([10,1]))),De=p(()=>f(()=>import("./Alerts-T-KcEJKx.js"),__vite__mapDeps([11,1]))),ze=p(()=>f(()=>import("./Velocity-DzCZH_YB.js"),__vite__mapDeps([12,1,5]))),Ve=p(()=>f(()=>import("./Budget-DRJWqsop.js"),__vite__mapDeps([13,1,5]))),Ne=p(()=>f(()=>import("./OKRs-Dt0HzTQQ.js"),__vite__mapDeps([14,1]))),We=p(()=>f(()=>import("./Knowledge-C92uZhl9.js"),__vite__mapDeps([15,1]))),$e=p(()=>f(()=>import("./Comms-DT2o5TCi.js"),__vite__mapDeps([16,1]))),Ue=p(()=>f(()=>import("./Memory-DFU5CtTT.js"),__vite__mapDeps([17,1]))),Me=p(()=>f(()=>import("./Processes-btq7Pyex.js"),__vite__mapDeps([18,1]))),Be=p(()=>f(()=>import("./Failures-CaEvQ0t1.js"),__vite__mapDeps([19,1]))),Fe=p(()=>f(()=>import("./Decisions-B3i1Rijg.js"),__vite__mapDeps([20,1]))),He=p(()=>f(()=>import("./Security-BVLBAnlu.js"),__vite__mapDeps([21,1]))),Ke=p(()=>f(()=>import("./Policies-CbemgLkX.js"),__vite__mapDeps([22,1]))),qe=p(()=>f(()=>import("./AuditLog-Cc1GUGYz.js"),__vite__mapDeps([23,1]))),Je=p(()=>f(()=>import("./Settings-DWsfHIfK.js"),__vite__mapDeps([24,1]))),Ye={Overview:N,Agents:Ae,Tasks:Ie,HITL:Ce,Alerts:De,Velocity:ze,Budget:Ve,Projects:ke,OKRs:Ne,Approvals:Re,Knowledge:We,Comms:$e,Security:He,Crons:Le,Processes:Me,Memory:Ue,Failures:Be,Decisions:Fe,Jobs:Pe,Usage:Oe,Policies:Ke,Settings:Je,Audit:qe};function Ge(){return t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",gap:16,color:"var(--text-dim)"},children:[t.jsx("span",{style:{fontSize:48,filter:"grayscale(0.4)"},children:"🦅"}),t.jsx("div",{style:{fontSize:16,fontWeight:600,color:"var(--text)"},children:"Connecting to Ops Room…"}),t.jsx("div",{style:{fontSize:13,color:"var(--muted)"},children:"Waiting for SSE stream from dashboard server"})]})}function Qe(){return t.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"200px"},children:t.jsx("div",{style:{fontSize:13,color:"var(--muted)"},children:"Loading…"})})}function Xe(){const[e,r]=d.useState("Overview"),{data:n,connected:s,lastUpdated:o,updateCount:a}=xe(),l=Ee(),m={data:n,lastUpdated:o,toast:l},u=n?{HITL:(n.hitl_tasks||[]).length,Alerts:(n.alerts||[]).length,Crons:(n.crons||[]).filter(c=>(c._consecutive_errors||0)>=3).length,Approvals:(n.approvals||[]).filter(c=>c.status==="pending").length}:{},i=d.useMemo(()=>Ye[e]||N,[e]);return t.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100vh",overflow:"hidden"},children:[t.jsx(ve,{data:n,connected:s,lastUpdated:o,updateCount:a,toast:l}),t.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[t.jsx(je,{active:e,onChange:r,badges:u}),t.jsx("main",{style:{flex:1,overflowY:"auto",padding:"40px 48px",background:"var(--bg)"},children:n?t.jsx("div",{className:"fade-in",children:t.jsx(d.Suspense,{fallback:t.jsx(Qe,{}),children:t.jsx(i,{...m})})}):t.jsx(Ge,{})})]})]})}ce.createRoot(document.getElementById("root")).render(t.jsx(d.StrictMode,{children:t.jsx(we,{children:t.jsx(Xe,{})})}));export{v as a,dt as b,rt as c,ht as d,ot as e,ct as f,it as g,ut as h,ft as i,pt as j,mt as k,tt as l,gt as m,st as p,lt as r,et as s,nt as u,at as v};
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; connect-src 'self'; img-src 'self' data:;" />
|
|
8
8
|
<title>AGI Farm — Ops Room</title>
|
|
9
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
+
<script type="module" crossorigin src="/assets/index-DUjHkafG.js"></script>
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/vendor-gUVFsxOc.js">
|
|
11
11
|
<link rel="stylesheet" crossorigin href="/assets/index-Cti3NWck.css">
|
|
12
12
|
</head>
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "agi-farm",
|
|
3
3
|
"kind": "team-orchestration",
|
|
4
4
|
"name": "AGI Farm — Multi-Agent Team Builder",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.10.0",
|
|
6
6
|
"description": "Bootstrap complete multi-agent AI teams with auto-dispatcher, live dashboard, and infrastructure. Includes interactive wizard, SOUL.md generation, comms setup, cron registration, and React + SSE ops room.",
|
|
7
7
|
"author": "oabdelmaksoud",
|
|
8
8
|
"homepage": "https://github.com/oabdelmaksoud/AGI-FARM-PLUGIN",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agi-farm",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"description": "Multi-agent AI team builder for OpenClaw — bootstrap complete teams with auto-dispatcher, dashboard, and infrastructure",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -67,7 +67,9 @@
|
|
|
67
67
|
"test:install:real-openclaw": "bash scripts/test-install-smoke.sh",
|
|
68
68
|
"start-dashboard": "node server/dashboard.js",
|
|
69
69
|
"validate": "node scripts/validate-config.js",
|
|
70
|
-
"lint": "eslint src --ext .ts,.js"
|
|
70
|
+
"lint": "eslint src --ext .ts,.js",
|
|
71
|
+
"sync:lobsterboard": "node scripts/sync-lobsterboard-upstream.js",
|
|
72
|
+
"sync:lobsterboard:check": "node scripts/sync-lobsterboard-upstream.js --dry-run"
|
|
71
73
|
},
|
|
72
74
|
"keywords": [
|
|
73
75
|
"openclaw",
|