@bpinhosilva/agent-orchestrator 1.0.0-alpha.21 → 1.0.0-alpha.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/ui/assets/AgentFleet-CC0h_Ar0.js +1 -0
- package/dist/ui/assets/AgentFleet-CC0h_Ar0.js.map +1 -0
- package/dist/ui/assets/ConfirmDialog-mRH8i_xK.js +10 -0
- package/dist/ui/assets/ConfirmDialog-mRH8i_xK.js.map +1 -0
- package/dist/ui/assets/InitialsAvatar-0mIRaTK8.js +1 -0
- package/dist/ui/assets/InitialsAvatar-0mIRaTK8.js.map +1 -0
- package/dist/ui/assets/MarkdownField-flCuU7w3.js +1 -0
- package/dist/ui/assets/MarkdownField-flCuU7w3.js.map +1 -0
- package/dist/ui/assets/ProjectDetail-CY-VSV2D.js +1 -0
- package/dist/ui/assets/ProjectDetail-CY-VSV2D.js.map +1 -0
- package/dist/ui/assets/Providers-C9_lxOG1.js +1 -0
- package/dist/ui/assets/Providers-C9_lxOG1.js.map +1 -0
- package/dist/ui/assets/Scheduler-Du2cIGfB.js +1 -0
- package/dist/ui/assets/Scheduler-Du2cIGfB.js.map +1 -0
- package/dist/ui/assets/TaskDetail-BdQJCVo3.js +1 -0
- package/dist/ui/assets/TaskDetail-BdQJCVo3.js.map +1 -0
- package/dist/ui/assets/TaskManager-CWDh69pf.js +8 -0
- package/dist/ui/assets/TaskManager-CWDh69pf.js.map +1 -0
- package/dist/ui/assets/{activity-CYFCUKYz.js → activity-CIlCK2jL.js} +1 -1
- package/dist/ui/assets/activity-CIlCK2jL.js.map +1 -0
- package/dist/ui/assets/{brain-D1LPqnhA.js → brain-_N041Xks.js} +1 -1
- package/dist/ui/assets/brain-_N041Xks.js.map +1 -0
- package/dist/ui/assets/check-DgCfni6J.js +1 -0
- package/dist/ui/assets/check-DgCfni6J.js.map +1 -0
- package/dist/ui/assets/clock-C0d1RzP_.js +1 -0
- package/dist/ui/assets/clock-C0d1RzP_.js.map +1 -0
- package/dist/ui/assets/cn-i-5ItZGU.js +1 -0
- package/dist/ui/assets/cn-i-5ItZGU.js.map +1 -0
- package/dist/ui/assets/{eye-DSoNYXlu.js → eye-RB18-re_.js} +1 -1
- package/dist/ui/assets/eye-RB18-re_.js.map +1 -0
- package/dist/ui/assets/index-CCsHBe__.css +1 -0
- package/dist/ui/assets/index-yzhzS93F.js +2 -0
- package/dist/ui/assets/index-yzhzS93F.js.map +1 -0
- package/dist/ui/assets/{layers-BQR0gbW3.js → layers-D5ECV506.js} +1 -1
- package/dist/ui/assets/layers-D5ECV506.js.map +1 -0
- package/dist/ui/assets/providers-BMRq_pkm.js +1 -0
- package/dist/ui/assets/providers-BMRq_pkm.js.map +1 -0
- package/dist/ui/assets/rolldown-runtime-COnpUsM8.js +1 -0
- package/dist/ui/assets/{send-Cgv_rLex.js → send-BA7-sXzg.js} +1 -1
- package/dist/ui/assets/send-BA7-sXzg.js.map +1 -0
- package/dist/ui/assets/{shield-check-02qtz3Au.js → shield-check-D7JIluse.js} +1 -1
- package/dist/ui/assets/shield-check-D7JIluse.js.map +1 -0
- package/dist/ui/assets/{sparkles-cO3r5TCU.js → sparkles-CCXaTT3H.js} +1 -1
- package/dist/ui/assets/sparkles-CCXaTT3H.js.map +1 -0
- package/dist/ui/assets/{tasks-BZ0wO0e9.js → tasks-DEHCZk48.js} +1 -1
- package/dist/ui/assets/tasks-DEHCZk48.js.map +1 -0
- package/dist/ui/assets/{trash-2-7e8TY3SJ.js → trash-2-BNP4kC5c.js} +1 -1
- package/dist/ui/assets/trash-2-BNP4kC5c.js.map +1 -0
- package/dist/ui/assets/{trending-up-Dh3I3BnW.js → trending-up-DBTQIgW8.js} +1 -1
- package/dist/ui/assets/trending-up-DBTQIgW8.js.map +1 -0
- package/dist/ui/assets/useNotification-DK-pV16c.js +6 -0
- package/dist/ui/assets/useNotification-DK-pV16c.js.map +1 -0
- package/dist/ui/assets/{user-sikuVJBW.js → user-Cp55HCCi.js} +1 -1
- package/dist/ui/assets/user-Cp55HCCi.js.map +1 -0
- package/dist/ui/assets/vendor-dnd-CxfOy4-Z.js +5 -0
- package/dist/ui/assets/vendor-dnd-CxfOy4-Z.js.map +1 -0
- package/dist/ui/assets/vendor-forms-HC2wK6B9.js +39 -0
- package/dist/ui/assets/vendor-forms-HC2wK6B9.js.map +1 -0
- package/dist/ui/assets/vendor-markdown-Dl_1qnne.js +29 -0
- package/dist/ui/assets/vendor-markdown-Dl_1qnne.js.map +1 -0
- package/dist/ui/assets/vendor-motion-CkXYvnuI.js +9 -0
- package/dist/ui/assets/vendor-motion-CkXYvnuI.js.map +1 -0
- package/dist/ui/assets/vendor-query-DQlZ8h7P.js +1 -0
- package/dist/ui/assets/vendor-query-DQlZ8h7P.js.map +1 -0
- package/dist/ui/assets/vendor-react-CiDbU5Ns.js +11 -0
- package/dist/ui/assets/vendor-react-CiDbU5Ns.js.map +1 -0
- package/dist/ui/assets/{zap-CFqyHdPJ.js → zap-D1sST66b.js} +1 -1
- package/dist/ui/assets/zap-D1sST66b.js.map +1 -0
- package/dist/ui/index.html +9 -4
- package/package.json +1 -1
- package/dist/ui/assets/AgentFleet-CQIXvils.js +0 -6
- package/dist/ui/assets/ConfirmDialog-nQ8F6FEz.js +0 -1
- package/dist/ui/assets/MarkdownField-BvkVHJZh.js +0 -29
- package/dist/ui/assets/ProjectDetail-CZ-tFtQo.js +0 -1
- package/dist/ui/assets/Providers-C61nXOPZ.js +0 -1
- package/dist/ui/assets/Scheduler-BwWeFfsh.js +0 -1
- package/dist/ui/assets/TaskDetail-BKQ3Vgnu.js +0 -1
- package/dist/ui/assets/TaskManager-CCOnj4Gq.js +0 -16
- package/dist/ui/assets/check-BZcW41Vk.js +0 -1
- package/dist/ui/assets/clock-vIUNSAVw.js +0 -1
- package/dist/ui/assets/file-text-DyBkf5PF.js +0 -1
- package/dist/ui/assets/index-BX3YIi49.css +0 -1
- package/dist/ui/assets/index-Ctbpa_Ei.js +0 -20
- package/dist/ui/assets/providers-C3SQm75E.js +0 -1
- package/dist/ui/assets/useNotification-nXJIHD_q.js +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [1.0.0-alpha.22](https://github.com/bpinhosilva/agent-orchestrator/compare/v1.0.0-alpha.21...v1.0.0-alpha.22) (2026-04-02)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* add InitialsAvatar component and do some refactor ([417eff3](https://github.com/bpinhosilva/agent-orchestrator/commit/417eff3bdf4ac8cf072c99fc56744a3a93807a31))
|
|
7
|
+
|
|
1
8
|
# [1.0.0-alpha.21](https://github.com/bpinhosilva/agent-orchestrator/compare/v1.0.0-alpha.20...v1.0.0-alpha.21) (2026-03-30)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{g as t}from"./vendor-dnd-CxfOy4-Z.js";import{i as n,n as r,t as i}from"./vendor-query-DQlZ8h7P.js";import{r as a}from"./vendor-markdown-Dl_1qnne.js";import{o,t as s}from"./useNotification-DK-pV16c.js";import{t as c}from"./activity-CIlCK2jL.js";import{a as l,i as u,o as d,r as f,t as p}from"./providers-BMRq_pkm.js";import{t as m}from"./brain-_N041Xks.js";import{t as h}from"./check-DgCfni6J.js";import{n as g,t as _}from"./sparkles-CCXaTT3H.js";import{t as v}from"./layers-D5ECV506.js";import{t as y}from"./send-BA7-sXzg.js";import{t as b}from"./trash-2-BNP4kC5c.js";import{i as x,n as S,t as C}from"./ConfirmDialog-mRH8i_xK.js";import{n as w,t as T}from"./vendor-motion-CkXYvnuI.js";import{c as E,d as D,g as O,h as k,m as A,n as j,s as M}from"./index-yzhzS93F.js";import{t as N}from"./MarkdownField-flCuU7w3.js";import{a as P,c as F,o as I,s as L}from"./vendor-forms-HC2wK6B9.js";import"./tasks-DEHCZk48.js";var R=o(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),z=o(`grid-2x2`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),B=o(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),V=o(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),H=o(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),U=o(`pen`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),ee=o(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),W=e(t(),1),G=a(),K=({id:e,name:t,expertise:n,model:r,status:i,metricLabel:a,metricValue:o,onProbe:s,onConfigure:l,onDelete:d,onActivate:p})=>{let[h,g]=(0,W.useState)(!1),v=(0,W.useRef)(null),y={active:{color:`text-secondary`,bg:`bg-secondary/10`,dot:`bg-secondary`,animate:`animate-pulse`,icon:m},idle:{color:`text-on-surface-variant`,bg:`bg-on-surface-variant/10`,dot:`bg-on-surface-variant`,animate:``,icon:_},updating:{color:`text-primary`,bg:`bg-primary/10`,dot:`bg-primary`,animate:`animate-ping`,icon:c},inactive:{color:`text-error/60`,bg:`bg-error/5`,dot:`bg-error/40`,animate:``,icon:R}}[i];return(0,W.useEffect)(()=>{let e=e=>{v.current&&!v.current.contains(e.target)&&g(!1)};return h&&document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[h]),(0,G.jsxs)(`div`,{className:`group relative bg-surface-container-low rounded-xl p-6 transition-all duration-300 hover:translate-y-[-4px] shadow-lg border border-transparent hover:border-outline-variant/20`,children:[(0,G.jsxs)(`div`,{className:`absolute top-4 right-4 flex items-center gap-1.5 px-2.5 py-1 rounded-full ${y.bg} ${y.color} text-[10px] font-bold tracking-widest uppercase`,children:[(0,G.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full ${y.dot} ${y.animate}`}),i]}),(0,G.jsxs)(`div`,{className:`flex gap-5`,children:[(0,G.jsx)(`div`,{className:`w-16 h-16 rounded-xl bg-surface-container-high flex items-center justify-center ring-1 ring-outline-variant/30 group-hover:ring-primary/50 transition-all`,children:(0,G.jsx)(y.icon,{className:`text-3xl ${y.color}`,size:32})}),(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsx)(`h3`,{className:`text-lg font-bold font-headline text-white`,children:t}),(0,G.jsx)(`p`,{className:`text-on-surface-variant text-xs mt-1`,children:n}),(0,G.jsxs)(`div`,{className:`mt-4 flex items-center gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col`,children:[(0,G.jsx)(`span`,{className:`text-[10px] text-on-surface-variant/60 uppercase tracking-tighter`,children:`Model`}),(0,G.jsx)(`span`,{className:`text-xs font-semibold text-primary`,children:r})]}),(0,G.jsxs)(`div`,{className:`flex flex-col`,children:[(0,G.jsx)(`span`,{className:`text-[10px] text-on-surface-variant/60 uppercase tracking-tighter`,children:a}),(0,G.jsx)(`span`,{className:`text-xs font-semibold ${y.color}`,children:o})]})]})]})]}),(0,G.jsxs)(`div`,{className:`mt-6 flex gap-2`,children:[(0,G.jsx)(`button`,{onClick:t=>{t.stopPropagation(),l?.(e)},className:`flex-1 py-2 rounded bg-surface-container-high text-xs font-semibold text-on-surface hover:bg-surface-container-highest transition-colors`,children:`Configure`}),(0,G.jsxs)(`div`,{className:`relative`,ref:v,children:[(0,G.jsx)(`button`,{onClick:e=>{e.stopPropagation(),g(!h)},"aria-label":`Agent actions menu`,className:`px-3 py-2 rounded bg-surface-container-high text-on-surface-variant hover:text-white transition-colors h-full ${h?`bg-surface-container-highest text-white`:``}`,children:(0,G.jsx)(u,{size:16,"aria-hidden":`true`})}),h&&(0,G.jsxs)(`div`,{className:`absolute bottom-full right-0 mb-2 w-48 bg-surface-container-highest rounded-lg shadow-2xl py-2 ring-1 ring-outline-variant/20 animate-in fade-in slide-in-from-bottom-2 duration-200 z-20`,children:[(0,G.jsxs)(`button`,{onClick:t=>{t.stopPropagation(),s?.(e),g(!1)},disabled:i===`inactive`,className:`w-full flex items-center gap-3 px-4 py-2.5 text-xs text-on-surface-variant hover:text-white hover:bg-primary/10 transition-colors group disabled:opacity-30 disabled:grayscale disabled:cursor-not-allowed`,children:[(0,G.jsx)(f,{size:14,className:`group-hover:text-primary`}),`Probe Agent`]}),(0,G.jsxs)(`button`,{onClick:t=>{t.stopPropagation(),l?.(e),g(!1)},className:`w-full flex items-center gap-3 px-4 py-2.5 text-xs text-on-surface-variant hover:text-white hover:bg-white/5 transition-colors`,children:[(0,G.jsx)(E,{size:14}),`Control Matrix`]}),(0,G.jsx)(`div`,{className:`my-1 border-t border-outline-variant/10`}),i===`inactive`?(0,G.jsxs)(`button`,{onClick:t=>{t.stopPropagation(),p?.(e),g(!1)},className:`w-full flex items-center gap-3 px-4 py-2.5 text-xs text-secondary/60 hover:text-secondary hover:bg-secondary/10 transition-colors`,children:[(0,G.jsx)(m,{size:14}),`Activate Node`]}):(0,G.jsxs)(`button`,{onClick:t=>{t.stopPropagation(),d?.(e),g(!1)},className:`w-full flex items-center gap-3 px-4 py-2.5 text-xs text-error/60 hover:text-error hover:bg-error/10 transition-colors`,children:[(0,G.jsx)(b,{size:14}),`Decommission`]})]})]})]})]})},q=({isOpen:e,onClose:t,onUpdated:n,agent:r})=>{let{notifyError:i,notifySuccess:a}=s(),[o,c]=(0,W.useState)(!1),[u,d]=(0,W.useState)(!1),[f,m]=(0,W.useState)(!1),[g,_]=(0,W.useState)(!1),[v,y]=(0,W.useState)(``),[b,x]=(0,W.useState)(``),[S,C]=(0,W.useState)(``),[w,T]=(0,W.useState)(``),[E,D]=(0,W.useState)([]),[k,A]=(0,W.useState)(``),[P,F]=(0,W.useState)([]),[I,L]=(0,W.useState)(``);(0,W.useEffect)(()=>{e&&r&&(y(r.name||``),x(r.role||``),C(r.description||``),T(r.systemInstructions||``),L(r.model?.id||``),A(r.provider?.id??r.model?.provider?.id??``))},[e,r]),(0,W.useEffect)(()=>{e&&(async()=>{try{m(!0);let{data:e}=await p.findAll();D(e)}catch{}finally{m(!1)}})()},[e]),(0,W.useEffect)(()=>{if(!k){F([]);return}(async()=>{try{d(!0);let{data:e}=await p.findModels(k);F(e),I&&!e.find(e=>e.id===I)&&L(e[0]?.id??``)}catch{F([])}finally{d(!1)}})()},[k,I]);let R=()=>{r?.id&&(navigator.clipboard.writeText(r.id),_(!0),a(`Copied`,`Agent ID copied to clipboard`),setTimeout(()=>_(!1),2e3))},z=async()=>{if(r?.id)try{c(!0),await j.update(r.id,{name:v,role:b,description:S,systemInstructions:w,providerId:k||void 0,modelId:I||void 0}),n?.(),t()}catch{i(`Update Failed`,`An error occurred while saving the configuration.`)}finally{c(!1)}};return(0,W.useEffect)(()=>{let n=e=>{e.key===`Escape`&&t()};return e&&window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t]),e?(0,G.jsxs)(`div`,{className:`fixed inset-y-0 right-0 w-[420px] bg-surface-container-low shadow-2xl z-[60] flex flex-col ring-1 ring-outline-variant/10 animate-in slide-in-from-right duration-300`,children:[(0,G.jsxs)(`div`,{className:`p-6 border-b border-outline-variant/10 flex items-center justify-between`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`text-lg font-bold font-headline text-white`,children:`Agent Configuration`}),(0,G.jsxs)(`p`,{className:`text-[10px] text-on-surface-variant uppercase tracking-widest mt-0.5`,children:[`Edit Profile: `,r?.name||`Logic Specialist`]})]}),(0,G.jsx)(`button`,{onClick:t,className:`text-on-surface-variant hover:text-white transition-colors`,children:(0,G.jsx)(M,{size:20})})]}),(0,G.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-6 space-y-8 scrollbar-hide`,children:[(0,G.jsxs)(`section`,{className:`space-y-4`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,G.jsxs)(`div`,{className:`relative w-20 h-20 rounded-2xl bg-surface-container-high ring-1 ring-outline-variant/50 flex items-center justify-center overflow-hidden`,children:[(0,G.jsx)(`span`,{className:`text-4xl text-secondary`,children:`🧠`}),(0,G.jsx)(`button`,{className:`absolute inset-0 bg-black/60 opacity-0 hover:opacity-100 transition-opacity flex items-center justify-center text-white`,children:(0,G.jsx)(U,{size:16})})]}),(0,G.jsxs)(`div`,{className:`flex-1 space-y-3`,children:[(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`label`,{className:`text-[10px] font-bold uppercase tracking-tight text-on-surface-variant/60`,children:`Agent Name`}),(0,G.jsx)(`input`,{className:`w-full bg-surface-container-lowest border-none rounded-md text-sm text-on-surface focus:ring-1 focus:ring-primary h-9 px-3`,type:`text`,value:v,onChange:e=>y(e.target.value)})]}),(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`label`,{className:`text-[10px] font-bold uppercase tracking-tight text-on-surface-variant/60`,children:`Agent ID`}),(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[(0,G.jsx)(`input`,{className:`flex-1 bg-surface-container-lowest/50 border-none rounded-md text-[10px] font-mono text-on-surface-variant focus:ring-0 h-8 px-3 cursor-default`,type:`text`,value:r?.id||``,readOnly:!0}),(0,G.jsx)(`button`,{onClick:R,className:`p-1.5 rounded bg-surface-container-highest hover:bg-surface-container-highest/80 text-on-surface-variant transition-colors flex items-center justify-center aspect-square h-8`,title:`Copy ID`,children:g?(0,G.jsx)(h,{size:14,className:`text-primary`}):(0,G.jsx)(l,{size:14})})]})]})]})]}),(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`label`,{className:`text-[10px] font-bold uppercase tracking-tight text-on-surface-variant/60`,children:`Role`}),(0,G.jsx)(`input`,{className:`w-full bg-surface-container-lowest border-none rounded-md text-sm text-on-surface focus:ring-1 focus:ring-primary h-9 px-3 placeholder:text-on-surface-variant/30`,type:`text`,placeholder:`e.g. Researcher, Developer...`,value:b,onChange:e=>x(e.target.value)})]})]}),(0,G.jsx)(N,{label:`Description`,value:S,onChange:C,placeholder:`Detailed agent profile...`,height:`h-32`,maxLength:1e3}),(0,G.jsxs)(`section`,{className:`space-y-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,G.jsx)(`label`,{className:`text-[10px] font-bold uppercase tracking-tight text-on-surface-variant/60`,children:`Provider`}),f&&(0,G.jsx)(H,{size:12,className:`animate-spin text-primary`})]}),(0,G.jsxs)(`div`,{className:`relative`,children:[(0,G.jsxs)(`select`,{className:`w-full bg-surface-container-lowest border-none rounded-md text-sm text-on-surface focus:ring-1 focus:ring-primary h-11 appearance-none px-4 disabled:opacity-50`,value:k,onChange:e=>A(e.target.value),disabled:f,children:[(0,G.jsx)(`option`,{value:``,children:`Select a provider...`}),E.map(e=>(0,G.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),(0,G.jsx)(O,{className:`absolute right-3 top-3 pointer-events-none text-on-surface-variant/60`,size:18})]})]}),(0,G.jsxs)(`section`,{className:`space-y-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,G.jsx)(`label`,{className:`text-[10px] font-bold uppercase tracking-tight text-on-surface-variant/60`,children:`Model Engine`}),u&&(0,G.jsx)(H,{size:12,className:`animate-spin text-primary`})]}),(0,G.jsxs)(`div`,{className:`relative`,children:[(0,G.jsxs)(`select`,{className:`w-full bg-surface-container-lowest border-none rounded-md text-sm text-on-surface focus:ring-1 focus:ring-primary h-11 appearance-none px-4 disabled:opacity-50`,value:I,onChange:e=>L(e.target.value),disabled:u||P.length===0,children:[P.length===0&&!u&&(0,G.jsx)(`option`,{value:``,children:`No models available for this provider`}),P.map(e=>(0,G.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),(0,G.jsx)(O,{className:`absolute right-3 top-3 pointer-events-none text-on-surface-variant/60`,size:18})]})]}),(0,G.jsxs)(`section`,{className:`space-y-6`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,G.jsx)(`label`,{className:`text-[10px] font-bold uppercase tracking-tight text-on-surface-variant/60`,children:`Personality Matrix`}),(0,G.jsx)(`span`,{className:`text-[10px] text-tertiary px-2 py-0.5 rounded bg-tertiary/10`,children:`AI Optimized`})]}),(0,G.jsxs)(`div`,{className:`space-y-5`,children:[(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsxs)(`div`,{className:`flex justify-between text-xs`,children:[(0,G.jsx)(`span`,{className:`text-on-surface-variant`,children:`Creativity`}),(0,G.jsx)(`span`,{className:`text-primary font-mono font-bold`,children:`0.42`})]}),(0,G.jsx)(`input`,{type:`range`,className:`w-full accent-primary h-1 bg-surface-container-highest rounded-full appearance-none cursor-pointer`})]}),(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsxs)(`div`,{className:`flex justify-between text-xs`,children:[(0,G.jsx)(`span`,{className:`text-on-surface-variant`,children:`Strictness`}),(0,G.jsx)(`span`,{className:`text-secondary font-mono font-bold`,children:`0.85`})]}),(0,G.jsx)(`input`,{type:`range`,className:`w-full accent-secondary h-1 bg-surface-container-highest rounded-full appearance-none cursor-pointer`})]})]})]}),(0,G.jsx)(N,{label:`System Instructions`,value:w,onChange:T,placeholder:`Define operational logic...`,height:`h-64`,maxLength:2e3})]}),(0,G.jsxs)(`div`,{className:`p-6 bg-surface-container-high border-t border-outline-variant/10 flex gap-3`,children:[(0,G.jsx)(`button`,{onClick:()=>{z()},disabled:o,className:`flex-1 bg-primary text-on-primary py-2.5 rounded font-bold text-sm shadow-lg shadow-primary/10 hover:shadow-primary/20 transition-all flex items-center justify-center gap-2 active:scale-95 disabled:opacity-50`,children:o?(0,G.jsx)(`span`,{className:`w-4 h-4 border-2 border-on-primary/30 border-t-on-primary rounded-full animate-spin`}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(h,{size:16}),`Save Changes`]})}),(0,G.jsx)(`button`,{onClick:t,className:`px-4 py-2.5 rounded border border-outline-variant text-on-surface-variant hover:text-white transition-all`,children:`Reset`})]})]}):null},J={name:``,role:``,description:``,providerId:``,modelId:``,instructions:S},te=[{id:1,title:`Essential Config`,subtitle:`ID, ROLE & MODEL`},{id:2,title:`Intelligence Tuning`,subtitle:`COGNITIVE MATRIX`},{id:3,title:`Instructions`,subtitle:`KNOWLEDGE BASE`}],Y=({isOpen:e,onClose:t,onCreated:a})=>{let o=n(),{notifyApiError:c,notifyError:l,notifySuccess:u}=s(),[f,m]=(0,W.useState)(1),h=(0,W.useId)(),y=(0,W.useId)(),b=(0,W.useId)(),S=(0,W.useId)(),C=(0,W.useId)(),E=(0,W.useId)(),D=(0,W.useId)(),k=(0,W.useId)(),{control:A,formState:{errors:M},handleSubmit:R,register:z,reset:B,setValue:V}=L({resolver:P(x),defaultValues:J,mode:`onBlur`}),H=F({control:A,name:`providerId`}),U=F({control:A,name:`modelId`}),K=r({queryKey:[`providers`],enabled:e,queryFn:async()=>(await p.findAll()).data}),q=r({queryKey:[`provider-models`,H],enabled:e&&!!H,queryFn:async()=>(await p.findModels(H)).data});(0,W.useEffect)(()=>{if(!e){B(J);return}let n=e=>{e.key===`Escape`&&t()};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t,B]),(0,W.useEffect)(()=>{e&&K.error&&c(K.error,`Providers Load Failed`)},[e,c,K.error]),(0,W.useEffect)(()=>{e&&q.error&&c(q.error,`Models Load Failed`)},[e,q.error,c]);let Y=(0,W.useMemo)(()=>K.data??[],[K.data]),X=(0,W.useMemo)(()=>q.data??[],[q.data]);(0,W.useEffect)(()=>{if(e){if(Y.length===0){H&&V(`providerId`,``,{shouldDirty:!1,shouldValidate:!0});return}(!H||!Y.some(e=>e.id===H))&&V(`providerId`,Y[0].id,{shouldDirty:!1,shouldValidate:!0})}},[e,H,Y,V]),(0,W.useEffect)(()=>{if(e){if(!H){U&&V(`modelId`,``,{shouldDirty:!1,shouldValidate:!0});return}if(X.length===0){U&&V(`modelId`,``,{shouldDirty:!1,shouldValidate:!0});return}(!U||!X.some(e=>e.id===U))&&V(`modelId`,X[0].id,{shouldDirty:!1,shouldValidate:!0})}},[X,e,U,H,V]);let Z=i({mutationFn:async e=>(await j.create({name:e.name,role:e.role,description:e.description,systemInstructions:e.instructions,providerId:e.providerId,modelId:e.modelId,status:`active`}),e),onSuccess:e=>{o.invalidateQueries({queryKey:[`agents`]}),u(`Agent Deployed`,`Successfully commissioned ${e.name} into the fleet.`),a?.(),t(),B(J),m(1)},onError:e=>{c(e,`Deployment Failed`)}}),Q=Z.isPending,$=K.isPending||q.isPending,ne=R(async e=>{await Z.mutateAsync(e)},()=>{l(`Validation Error`,`Please review the highlighted fields before deploying the agent.`)}),re=()=>{Q||(m(1),t())};return e?(0,G.jsx)(w,{children:(0,G.jsxs)(`div`,{className:`fixed inset-0 z-[100] flex items-center justify-center p-4 md:p-8`,children:[(0,G.jsx)(T.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:re,className:`absolute inset-0 bg-surface/80 backdrop-blur-xl`,"aria-hidden":`true`}),(0,G.jsxs)(T.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},role:`dialog`,"aria-modal":`true`,"aria-labelledby":h,"aria-describedby":y,"aria-busy":Q||$,className:`relative w-full max-w-5xl h-full max-h-[850px] bg-surface-container-low rounded-2xl shadow-2xl overflow-hidden flex flex-col ring-1 ring-outline-variant/10`,children:[(0,G.jsxs)(`div`,{className:`px-8 py-6 border-b border-outline-variant/10 flex items-center justify-between bg-surface-container-low/50 backdrop-blur-md sticky top-0 z-10`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h2`,{id:h,className:`text-2xl font-black font-headline text-white tracking-tight`,children:`Create New Agent`}),(0,G.jsx)(`p`,{id:y,className:`text-sm text-on-surface-variant/80 mt-1`,children:`Configure a specialized AI persona to handle specific nodes in your automation flows.`})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,G.jsx)(`button`,{type:`button`,onClick:re,disabled:Q,className:`px-6 py-2.5 rounded-md text-sm font-bold text-on-surface-variant hover:text-white transition-all disabled:opacity-50 disabled:cursor-not-allowed`,children:`Cancel`}),(0,G.jsx)(`button`,{type:`button`,onClick:ne,disabled:Q||Y.length===0||X.length===0,className:`px-8 py-2.5 rounded-md bg-primary text-on-primary text-sm font-bold shadow-lg shadow-primary/20 hover:scale-[1.02] active:scale-[0.98] transition-all disabled:opacity-50 disabled:grayscale disabled:cursor-not-allowed disabled:hover:scale-100`,children:Q?`Deploying...`:`Deploy Agent`})]})]}),(0,G.jsxs)(`div`,{className:`flex-1 flex overflow-hidden`,children:[(0,G.jsxs)(`div`,{className:`w-72 bg-surface-container-low/30 border-r border-outline-variant/5 p-8 flex flex-col gap-10`,children:[(0,G.jsx)(`div`,{className:`space-y-8`,children:te.map(e=>(0,G.jsxs)(`button`,{type:`button`,className:`flex gap-4 group cursor-pointer text-left w-full`,onClick:()=>m(e.id),"aria-pressed":f===e.id,children:[(0,G.jsx)(`div`,{className:`w-8 h-8 rounded-full flex items-center justify-center text-[10px] font-black transition-all ${f===e.id?`bg-secondary text-surface`:`bg-surface-container-highest text-on-surface-variant`}`,children:e.id.toString().padStart(2,`0`)}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h4`,{className:`text-xs font-bold font-headline transition-colors ${f===e.id?`text-white`:`text-on-surface-variant`}`,children:e.title}),(0,G.jsx)(`p`,{className:`text-[9px] font-bold tracking-widest text-on-surface-variant/50 mt-0.5`,children:e.subtitle})]})]},e.id))}),(0,G.jsxs)(`div`,{className:`mt-auto bg-tertiary/10 rounded-xl p-5 ring-1 ring-tertiary/20 backdrop-blur-sm relative overflow-hidden group`,children:[(0,G.jsx)(`div`,{className:`absolute -right-4 -top-4 w-16 h-16 bg-tertiary/10 rounded-full blur-2xl group-hover:bg-tertiary/20 transition-all duration-700`}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2 mb-3 text-tertiary`,children:[(0,G.jsx)(_,{size:14,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`text-[10px] font-black uppercase tracking-widest`,children:`AI Suggestion`})]}),(0,G.jsxs)(`p`,{className:`text-[11px] text-on-surface-variant leading-relaxed italic`,children:[`"Try selecting `,(0,G.jsx)(`span`,{className:`text-tertiary font-bold`,children:`Researcher`}),` role for high-depth data synthesis tasks."`]})]})]}),(0,G.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-10 space-y-12 custom-scrollbar`,children:[(0,G.jsxs)(`section`,{className:`space-y-8`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(`div`,{className:`w-1 bg-secondary h-6 rounded-full`}),(0,G.jsx)(`h3`,{className:`text-lg font-bold font-headline text-white`,children:`Basic Configuration`})]}),(0,G.jsxs)(`div`,{className:`grid grid-cols-2 gap-6`,children:[(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsx)(`label`,{htmlFor:`create-agent-name`,className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60`,children:`Agent Name`}),(0,G.jsx)(`div`,{className:`bg-surface-container-highest/30 rounded-lg p-0.5 ring-1 ring-outline-variant/10 focus-within:ring-primary/40 transition-all`,children:(0,G.jsx)(`input`,{id:`create-agent-name`,type:`text`,placeholder:`e.g. Researcher-X`,"aria-invalid":!!M.name,"aria-describedby":M.name?b:void 0,className:`w-full bg-transparent border-none text-sm text-on-surface h-10 px-3 focus:outline-none placeholder:text-on-surface-variant/30`,...z(`name`)})}),M.name&&(0,G.jsx)(`p`,{id:b,className:`text-xs text-error font-semibold`,children:M.name.message})]}),(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsx)(`label`,{htmlFor:`create-agent-role`,className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60`,children:`Primary Role`}),(0,G.jsx)(`div`,{className:`bg-surface-container-highest/30 rounded-lg p-0.5 ring-1 ring-outline-variant/10 focus-within:ring-primary/40 transition-all text-on-surface`,children:(0,G.jsx)(`input`,{id:`create-agent-role`,type:`text`,placeholder:`e.g. Researcher`,"aria-invalid":!!M.role,"aria-describedby":M.role?S:void 0,className:`w-full bg-transparent border-none text-sm text-on-surface h-10 px-4 focus:outline-none placeholder:text-on-surface-variant/30`,...z(`role`)})}),M.role&&(0,G.jsx)(`p`,{id:S,className:`text-xs text-error font-semibold`,children:M.role.message})]})]}),(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsx)(I,{control:A,name:`description`,render:({field:e})=>(0,G.jsx)(N,{label:`Description`,value:e.value,onChange:e.onChange,placeholder:`Define what this agent aims to achieve... You can use markdown for formatting.`,height:`h-32`,maxLength:1e3})}),M.description&&(0,G.jsx)(`p`,{id:C,className:`text-xs text-error font-semibold`,children:M.description.message})]}),(0,G.jsxs)(`div`,{className:`pt-4 space-y-8 border-t border-outline-variant/10`,children:[(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,G.jsx)(`label`,{className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60`,children:`Select Provider`}),$&&(0,G.jsx)(`span`,{className:`text-[10px] text-primary animate-pulse font-bold uppercase tracking-widest`,children:`Updating...`})]}),(0,G.jsxs)(`div`,{className:`grid grid-cols-4 gap-4`,children:[Y.map(e=>(0,G.jsxs)(`button`,{type:`button`,"aria-pressed":H===e.id,onClick:()=>{H!==e.id&&(V(`providerId`,e.id,{shouldDirty:!0,shouldValidate:!0}),V(`modelId`,``,{shouldDirty:!0,shouldValidate:!1}))},className:`p-4 rounded-xl flex flex-col items-center gap-3 transition-all ${H===e.id?`bg-primary/10 ring-2 ring-primary shadow-[0_0_20px_rgba(173,198,255,0.15)]`:`bg-surface-container-highest/30 ring-1 ring-outline-variant/10 hover:bg-surface-container-highest/50`}`,children:[(0,G.jsx)(`div`,{className:`w-10 h-10 rounded-lg flex items-center justify-center transition-colors ${H===e.id?`bg-primary text-surface`:`bg-surface-container-high text-on-surface-variant`}`,children:(0,G.jsx)(d,{size:20,"aria-hidden":`true`})}),(0,G.jsx)(`div`,{className:`text-center`,children:(0,G.jsx)(`h4`,{className:`text-xs font-black uppercase tracking-wider ${H===e.id?`text-white`:`text-on-surface-variant`}`,children:e.name})})]},e.id)),Y.length===0&&!K.isPending&&(0,G.jsxs)(`div`,{className:`col-span-4 py-8 border-2 border-dashed border-outline-variant/10 rounded-xl flex flex-col items-center justify-center text-on-surface-variant/40 gap-2`,children:[(0,G.jsx)(v,{size:24,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-widest`,children:`No providers registered`})]})]}),M.providerId&&(0,G.jsx)(`p`,{id:E,className:`text-xs text-error font-semibold`,children:M.providerId.message})]}),(0,G.jsx)(w,{mode:`wait`,children:H&&(0,G.jsxs)(T.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:`space-y-4 pt-4 border-t border-outline-variant/5`,children:[(0,G.jsx)(`label`,{htmlFor:`create-agent-model`,className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60`,children:`Model Variant Selection`}),(0,G.jsxs)(`div`,{className:`bg-surface-container-highest/30 rounded-lg p-0.5 ring-1 ring-outline-variant/10 focus-within:ring-primary/40 transition-all relative`,children:[(0,G.jsxs)(`select`,{id:`create-agent-model`,value:U,onChange:e=>V(`modelId`,e.target.value,{shouldDirty:!0,shouldValidate:!0}),"aria-invalid":!!M.modelId,"aria-describedby":M.modelId?D:void 0,className:`w-full bg-transparent border-none text-sm text-on-surface h-10 px-3 focus:outline-none appearance-none cursor-pointer`,children:[(0,G.jsx)(`option`,{value:``,disabled:!0,className:`bg-surface-container-low text-on-surface`,children:`Select a model...`}),X.map(e=>(0,G.jsx)(`option`,{value:e.id,className:`bg-surface-container-low text-on-surface`,children:e.name},e.id))]}),(0,G.jsx)(`div`,{className:`absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none text-on-surface-variant/60`,children:(0,G.jsx)(O,{size:18,"aria-hidden":`true`})})]}),M.modelId&&(0,G.jsx)(`p`,{id:D,className:`text-xs text-error font-semibold`,children:M.modelId.message}),X.length===0&&!q.isPending&&(0,G.jsx)(`div`,{className:`py-6 text-center bg-error/5 rounded-xl border border-error/10`,children:(0,G.jsx)(`span`,{className:`text-[10px] font-bold text-error uppercase tracking-widest opacity-60`,children:`No model variants found for this provider`})})]},H)})]})]}),(0,G.jsxs)(`section`,{className:`space-y-10`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(`div`,{className:`w-1 bg-primary h-6 rounded-full`}),(0,G.jsx)(`h3`,{className:`text-lg font-bold font-headline text-white`,children:`Intelligence Tuning`})]}),(0,G.jsxs)(`div`,{className:`space-y-8`,children:[(0,G.jsx)(`label`,{className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60`,children:`Personality Matrix`}),[{label:`Precision`,min:`0.00`,max:`1.00`,value:.72,color:`accent-secondary`},{label:`Lement`,min:`0.00`,max:`1.00`,value:.45,color:`accent-primary`},{label:`Casual`,min:`0.00`,max:`1.00`,value:.9,color:`accent-tertiary`}].map(e=>(0,G.jsxs)(`div`,{className:`space-y-3`,children:[(0,G.jsxs)(`div`,{className:`flex justify-between items-center text-[10px] font-bold tracking-tighter uppercase`,children:[(0,G.jsxs)(`span`,{className:`text-on-surface-variant/50`,children:[e.label,` (`,e.min,`)`]}),(0,G.jsx)(`span`,{className:`text-white font-mono text-xs`,children:e.value.toFixed(2)}),(0,G.jsxs)(`span`,{className:`text-on-surface-variant/50`,children:[`Creativity (`,e.max,`)`]})]}),(0,G.jsx)(`input`,{type:`range`,min:`0`,max:`100`,defaultValue:e.value*100,className:`w-full h-1 bg-surface-container-highest rounded-full appearance-none cursor-pointer ${e.color}`,"aria-label":`${e.label} tuning slider`})]},e.label))]})]}),(0,G.jsxs)(`section`,{className:`space-y-8`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(`div`,{className:`w-1 bg-tertiary h-6 rounded-full`}),(0,G.jsx)(`h3`,{className:`text-lg font-bold font-headline text-white`,children:`Operational Directives`})]}),(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsx)(I,{control:A,name:`instructions`,render:({field:e})=>(0,G.jsx)(N,{label:`System Instructions`,value:e.value,onChange:e.onChange,height:`h-64`,helperText:`Prompt Engineering Active`,maxLength:1e3})}),M.instructions&&(0,G.jsx)(`p`,{id:k,className:`text-xs text-error font-semibold`,children:M.instructions.message})]}),(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsx)(`label`,{className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60`,children:`Knowledge Integration`}),(0,G.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,G.jsxs)(`button`,{type:`button`,className:`border-2 border-dashed border-outline-variant/10 rounded-xl p-6 flex flex-col items-center justify-center gap-2 group cursor-pointer hover:border-primary/30 transition-all`,children:[(0,G.jsx)(`div`,{className:`w-10 h-10 rounded-full bg-surface-container-high flex items-center justify-center text-on-surface-variant group-hover:text-primary transition-colors`,children:(0,G.jsx)(g,{size:18,"aria-hidden":`true`})}),(0,G.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-widest text-on-surface-variant`,children:`Connect Repo`})]}),(0,G.jsxs)(`button`,{type:`button`,className:`border-2 border-dashed border-outline-variant/10 rounded-xl p-6 flex flex-col items-center justify-center gap-2 group cursor-pointer hover:border-primary/30 transition-all`,children:[(0,G.jsx)(`div`,{className:`w-10 h-10 rounded-full bg-surface-container-high flex items-center justify-center text-on-surface-variant group-hover:text-primary transition-colors`,children:(0,G.jsx)(ee,{size:18,"aria-hidden":`true`})}),(0,G.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-widest text-on-surface-variant`,children:`Access Policies`})]})]})]})]})]})]})]})]})}):null},X=({isOpen:e,onClose:t,agent:n})=>{let r=`Wake up, who are you?`,[i,a]=(0,W.useState)(r),[o,s]=(0,W.useState)(``),[l,u]=(0,W.useState)(),[d,p]=(0,W.useState)(!1),[h,g]=(0,W.useState)(`idle`);return(0,W.useEffect)(()=>{let n=e=>{e.key===`Escape`&&t()};return e&&(window.addEventListener(`keydown`,n),s(``),u(void 0),g(`idle`),a(r)),()=>window.removeEventListener(`keydown`,n)},[e,t]),e?(0,G.jsx)(w,{children:(0,G.jsxs)(`div`,{className:`fixed inset-0 z-[100] flex items-center justify-center p-4`,children:[(0,G.jsx)(T.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:t,className:`absolute inset-0 bg-surface/80 backdrop-blur-xl`}),(0,G.jsxs)(T.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},className:`relative w-full max-w-2xl bg-surface-container-low rounded-2xl shadow-2xl overflow-hidden flex flex-col ring-1 ring-outline-variant/10`,children:[(0,G.jsxs)(`div`,{className:`px-6 py-4 border-b border-outline-variant/10 flex items-center justify-between bg-surface-container-low/50 backdrop-blur-md`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(`div`,{className:`w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center text-primary`,children:(0,G.jsx)(m,{size:20})}),(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`h2`,{className:`text-xl font-black font-headline text-white tracking-tight`,children:[`Probe: `,n?.name]}),(0,G.jsx)(`p`,{className:`text-[10px] text-on-surface-variant uppercase tracking-widest font-bold`,children:`Neural Direct Message`})]})]}),(0,G.jsx)(`button`,{onClick:t,className:`text-on-surface-variant hover:text-white transition-colors p-2`,children:(0,G.jsx)(M,{size:20})})]}),(0,G.jsxs)(`div`,{className:`p-6 space-y-6 max-h-[80vh] overflow-y-auto scrollbar-hide`,children:[(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsxs)(`label`,{className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60 flex items-center gap-2`,children:[(0,G.jsx)(f,{size:12}),`Command Input`]}),(0,G.jsxs)(`div`,{className:`relative group`,children:[(0,G.jsx)(`textarea`,{value:i,onChange:e=>a(e.target.value),placeholder:`Type your command...`,className:`w-full bg-surface-container-highest/30 rounded-xl p-4 text-sm text-on-surface h-32 focus:outline-none focus:ring-2 focus:ring-primary/40 transition-all resize-none border border-outline-variant/10 group-hover:border-outline-variant/30`}),(0,G.jsx)(`button`,{onClick:async()=>{if(!(!n?.id||!i.trim()))try{p(!0),g(`idle`),s(`Awaiting response from neural node...`),u(void 0);let{data:e}=await j.probe(n.id,i);s(e.content),u(e.image),g(`success`)}catch(e){console.error(`Probe failed:`,e);let t=`An unexpected error occurred during the probe.`;if(e&&typeof e==`object`&&`response`in e){let n=e;t=n.response?.data?.message||n.message||t}else e instanceof Error&&(t=e.message);s(`ERROR: ${t}`),g(`error`)}finally{p(!1)}},disabled:d||!i.trim(),className:`absolute bottom-3 right-3 p-2.5 rounded-lg bg-primary text-on-primary shadow-lg shadow-primary/20 hover:scale-[1.05] active:scale-[0.95] transition-all disabled:opacity-50 disabled:grayscale disabled:cursor-not-allowed group`,children:d?(0,G.jsx)(H,{size:18,className:`animate-spin`}):(0,G.jsx)(y,{size:18})})]})]}),(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,G.jsxs)(`label`,{className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60 flex items-center gap-2`,children:[(0,G.jsx)(c,{size:12,className:d?`animate-pulse`:``}),`Neural Response`]}),h===`success`&&(0,G.jsxs)(`span`,{className:`flex items-center gap-1 text-[9px] font-black text-secondary uppercase bg-secondary/10 px-2 py-0.5 rounded`,children:[(0,G.jsx)(A,{size:10}),` Sync Complete`]}),h===`error`&&(0,G.jsxs)(`span`,{className:`flex items-center gap-1 text-[9px] font-black text-error uppercase bg-error/10 px-2 py-0.5 rounded`,children:[(0,G.jsx)(k,{size:10}),` Link Severed`]})]}),(0,G.jsx)(`div`,{className:`w-full min-h-[100px] bg-black/40 rounded-xl p-5 border border-outline-variant/5 font-mono text-sm leading-relaxed transition-all duration-500 whitespace-pre-wrap ${h===`error`?`text-error/80 border-error/20`:h===`success`?`text-secondary/90 border-secondary/20 shadow-[inset_0_0_20px_rgba(102,231,175,0.05)]`:`text-on-surface-variant/60`}`,children:o||`Enter a command and initiate the probe to see the agent response.`}),(0,G.jsx)(w,{children:l&&(0,G.jsxs)(T.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`space-y-2`,children:[(0,G.jsxs)(`label`,{className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60 flex items-center gap-2`,children:[(0,G.jsx)(B,{size:12}),`Visual Output`]}),(0,G.jsxs)(`div`,{className:`relative rounded-xl overflow-hidden border border-outline-variant/10 bg-surface-container-highest/20 group`,children:[(0,G.jsx)(`img`,{src:`data:image/png;base64,${l}`,alt:`Neural Output`,className:`w-full h-auto max-h-[400px] object-contain mx-auto`}),(0,G.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 p-3 bg-gradient-to-t from-black/60 to-transparent opacity-0 group-hover:opacity-100 transition-opacity`,children:(0,G.jsx)(`span`,{className:`text-[10px] font-bold text-white uppercase tracking-wider`,children:`Generated Content`})})]})]})})]})]}),(0,G.jsx)(`div`,{className:`px-6 py-4 bg-surface-container-high/50 border-t border-outline-variant/10 flex justify-end`,children:(0,G.jsx)(`button`,{onClick:t,className:`px-6 py-2 rounded-lg text-sm font-bold text-on-surface hover:bg-surface-container-highest transition-all`,children:`Close Terminal`})})]})]})}):null},Z=()=>{let{notifySuccess:e,notifyApiError:t}=s(),a=n(),[o,c]=(0,W.useState)(null),[l,u]=(0,W.useState)(!1),[d,f]=(0,W.useState)(!1),[p,m]=(0,W.useState)(!1),[h,g]=(0,W.useState)(!1),[_,v]=(0,W.useState)(`grid`),{data:y=[],isLoading:b}=r({queryKey:[`agents`],queryFn:async()=>{let{data:e}=await j.findAll();return e}}),x=()=>a.invalidateQueries({queryKey:[`agents`]}),S=i({mutationFn:e=>j.delete(e),onSuccess:()=>{e(`Agent Inactivated`,`Neural node has been marked as inactive.`),g(!1),x()},onError:e=>t(e,`Operation Failed`)}),w=i({mutationFn:e=>j.update(e,{status:`active`}),onSuccess:()=>{e(`Neural Link Restored`,`The agent has been reactivated and synchronized.`),x()},onError:e=>t(e,`Activation Failed`)}),T=e=>{c(e),u(!0)},E=e=>{c(e),m(!0)},O=e=>{c(e),g(!0)},k=()=>{o&&S.mutate(o.id)},A=e=>{w.mutate(e)};return(0,G.jsxs)(`div`,{className:`space-y-8`,children:[(0,G.jsxs)(`div`,{className:`flex items-end justify-between`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h2`,{className:`text-4xl font-extrabold font-headline tracking-tight text-white`,children:`Agent Fleet`}),(0,G.jsxs)(`p`,{className:`text-on-surface-variant mt-2 font-body text-sm`,children:[`Commanding `,(0,G.jsx)(`span`,{className:`text-secondary font-bold`,children:y.filter(e=>e.status!==`inactive`).length}),` active neural nodes across the network.`]})]}),(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[(0,G.jsx)(`button`,{onClick:()=>v(`grid`),"aria-label":`Grid view`,"aria-pressed":_===`grid`,className:`p-2 rounded transition-colors ${_===`grid`?`bg-surface-container-high text-white`:`text-on-surface-variant hover:text-white`}`,children:(0,G.jsx)(z,{size:20,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{onClick:()=>v(`list`),"aria-label":`List view`,"aria-pressed":_===`list`,className:`p-2 rounded transition-colors ${_===`list`?`bg-surface-container-high text-white`:`text-on-surface-variant hover:text-white`}`,children:(0,G.jsx)(V,{size:20,"aria-hidden":`true`})})]})]}),b?(0,G.jsx)(`div`,{className:`flex items-center justify-center h-64`,children:(0,G.jsx)(H,{className:`w-12 h-12 text-primary animate-spin`})}):(0,G.jsxs)(`div`,{className:_===`grid`?`grid grid-cols-1 xl:grid-cols-2 2xl:grid-cols-3 gap-6`:`flex flex-col gap-4`,children:[y.map(e=>(0,G.jsx)(`div`,{onClick:()=>T(e),className:e.status===`inactive`?`opacity-50 grayscale hover:grayscale-0 transition-all`:``,children:(0,G.jsx)(K,{id:e.id,name:e.name,expertise:e.role||`General Assistant`,model:e.model?.name||`Unknown`,status:e.status||`active`,metricLabel:`Provider`,metricValue:e.provider?.name||`Unknown`,onConfigure:()=>T(e),onProbe:()=>E(e),onDelete:()=>O(e),onActivate:()=>A(e.id)})},e.id)),(0,G.jsxs)(`div`,{onClick:()=>f(!0),className:`border-2 border-dashed border-outline-variant/30 rounded-xl p-6 flex flex-col items-center justify-center text-center group cursor-pointer hover:border-primary/50 transition-all hover:bg-primary/5`,children:[(0,G.jsx)(`div`,{className:`w-12 h-12 rounded-full bg-surface-container-low flex items-center justify-center mb-4 group-hover:scale-110 transition-transform`,children:(0,G.jsx)(D,{size:24,className:`text-primary`})}),(0,G.jsx)(`span`,{className:`text-sm font-bold font-headline text-on-surface-variant group-hover:text-on-surface`,children:`Deploy New Agent`}),(0,G.jsx)(`p`,{className:`text-xs text-on-surface-variant/60 mt-1 max-w-[200px]`,children:`Expand your fleet with specialized intelligence units.`})]})]}),(0,G.jsx)(q,{isOpen:l,onClose:()=>u(!1),onUpdated:x,agent:o},o?.id||`none`),(0,G.jsx)(X,{isOpen:p,onClose:()=>m(!1),agent:o}),(0,G.jsx)(Y,{isOpen:d,onClose:()=>f(!1),onCreated:x}),(0,G.jsx)(C,{isOpen:h,onClose:()=>g(!1),onConfirm:k,title:`Decommission Neural Node?`,message:`This will mark ${o?.name} as inactive. The agent will remain in the database but will no longer be available for automated tasks or direct neural connection.`,confirmText:`Decommission`,variant:`danger`})]})};export{Z as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentFleet-CC0h_Ar0.js","names":["__iconNode","__iconNode","__iconNode","__iconNode","__iconNode","__iconNode"],"sources":["../../node_modules/lucide-react/dist/esm/icons/circle-x.js","../../node_modules/lucide-react/dist/esm/icons/grid-2x2.js","../../node_modules/lucide-react/dist/esm/icons/image.js","../../node_modules/lucide-react/dist/esm/icons/list.js","../../node_modules/lucide-react/dist/esm/icons/loader-circle.js","../../node_modules/lucide-react/dist/esm/icons/pen.js","../../node_modules/lucide-react/dist/esm/icons/shield.js","../../src/components/AgentCard.tsx","../../src/components/AgentConfigDrawer.tsx","../../src/components/CreateAgentModal.tsx","../../src/components/ProbeAgentModal.tsx","../../src/components/AgentFleet.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.577.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"path\", { d: \"m15 9-6 6\", key: \"1uzhvr\" }],\n [\"path\", { d: \"m9 9 6 6\", key: \"z0biqf\" }]\n];\nconst CircleX = createLucideIcon(\"circle-x\", __iconNode);\n\nexport { __iconNode, CircleX as default };\n//# sourceMappingURL=circle-x.js.map\n","/**\n * @license lucide-react v0.577.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M12 3v18\", key: \"108xh3\" }],\n [\"path\", { d: \"M3 12h18\", key: \"1i2n21\" }],\n [\"rect\", { x: \"3\", y: \"3\", width: \"18\", height: \"18\", rx: \"2\", key: \"h1oib\" }]\n];\nconst Grid2x2 = createLucideIcon(\"grid-2x2\", __iconNode);\n\nexport { __iconNode, Grid2x2 as default };\n//# sourceMappingURL=grid-2x2.js.map\n","/**\n * @license lucide-react v0.577.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"rect\", { width: \"18\", height: \"18\", x: \"3\", y: \"3\", rx: \"2\", ry: \"2\", key: \"1m3agn\" }],\n [\"circle\", { cx: \"9\", cy: \"9\", r: \"2\", key: \"af1f0g\" }],\n [\"path\", { d: \"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21\", key: \"1xmnt7\" }]\n];\nconst Image = createLucideIcon(\"image\", __iconNode);\n\nexport { __iconNode, Image as default };\n//# sourceMappingURL=image.js.map\n","/**\n * @license lucide-react v0.577.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M3 5h.01\", key: \"18ugdj\" }],\n [\"path\", { d: \"M3 12h.01\", key: \"nlz23k\" }],\n [\"path\", { d: \"M3 19h.01\", key: \"noohij\" }],\n [\"path\", { d: \"M8 5h13\", key: \"1pao27\" }],\n [\"path\", { d: \"M8 12h13\", key: \"1za7za\" }],\n [\"path\", { d: \"M8 19h13\", key: \"m83p4d\" }]\n];\nconst List = createLucideIcon(\"list\", __iconNode);\n\nexport { __iconNode, List as default };\n//# sourceMappingURL=list.js.map\n","/**\n * @license lucide-react v0.577.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [[\"path\", { d: \"M21 12a9 9 0 1 1-6.219-8.56\", key: \"13zald\" }]];\nconst LoaderCircle = createLucideIcon(\"loader-circle\", __iconNode);\n\nexport { __iconNode, LoaderCircle as default };\n//# sourceMappingURL=loader-circle.js.map\n","/**\n * @license lucide-react v0.577.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z\",\n key: \"1a8usu\"\n }\n ]\n];\nconst Pen = createLucideIcon(\"pen\", __iconNode);\n\nexport { __iconNode, Pen as default };\n//# sourceMappingURL=pen.js.map\n","/**\n * @license lucide-react v0.577.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\",\n key: \"oel41y\"\n }\n ]\n];\nconst Shield = createLucideIcon(\"shield\", __iconNode);\n\nexport { __iconNode, Shield as default };\n//# sourceMappingURL=shield.js.map\n","import React, { useState, useRef, useEffect } from 'react';\nimport { MoreVertical, Brain, Sparkles, Activity, Settings, Terminal, Trash2, XCircle } from 'lucide-react';\n\ninterface AgentCardProps {\n id: string;\n name: string;\n expertise: string;\n model: string;\n status: 'active' | 'idle' | 'updating' | 'inactive';\n metricLabel: string;\n metricValue: string;\n onProbe?: (id: string) => void;\n onConfigure?: (id: string) => void;\n onDelete?: (id: string) => void;\n onActivate?: (id: string) => void;\n}\n\nconst AgentCard: React.FC<AgentCardProps> = ({ \n id,\n name, \n expertise, \n model, \n status, \n metricLabel, \n metricValue,\n onProbe,\n onConfigure,\n onDelete,\n onActivate\n}) => {\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n const menuRef = useRef<HTMLDivElement>(null);\n\n const statusConfig = {\n active: {\n color: 'text-secondary',\n bg: 'bg-secondary/10',\n dot: 'bg-secondary',\n animate: 'animate-pulse',\n icon: Brain,\n },\n idle: {\n color: 'text-on-surface-variant',\n bg: 'bg-on-surface-variant/10',\n dot: 'bg-on-surface-variant',\n animate: '',\n icon: Sparkles,\n },\n updating: {\n color: 'text-primary',\n bg: 'bg-primary/10',\n dot: 'bg-primary',\n animate: 'animate-ping',\n icon: Activity,\n },\n inactive: {\n color: 'text-error/60',\n bg: 'bg-error/5',\n dot: 'bg-error/40',\n animate: '',\n icon: XCircle,\n },\n };\n\n const config = statusConfig[status];\n\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (menuRef.current && !menuRef.current.contains(event.target as Node)) {\n setIsMenuOpen(false);\n }\n };\n if (isMenuOpen) {\n document.addEventListener('mousedown', handleClickOutside);\n }\n return () => document.removeEventListener('mousedown', handleClickOutside);\n }, [isMenuOpen]);\n\n return (\n <div className=\"group relative bg-surface-container-low rounded-xl p-6 transition-all duration-300 hover:translate-y-[-4px] shadow-lg border border-transparent hover:border-outline-variant/20\">\n <div className={`absolute top-4 right-4 flex items-center gap-1.5 px-2.5 py-1 rounded-full ${config.bg} ${config.color} text-[10px] font-bold tracking-widest uppercase`}>\n <span className={`w-1.5 h-1.5 rounded-full ${config.dot} ${config.animate}`}></span>\n {status}\n </div>\n\n <div className=\"flex gap-5\">\n <div className=\"w-16 h-16 rounded-xl bg-surface-container-high flex items-center justify-center ring-1 ring-outline-variant/30 group-hover:ring-primary/50 transition-all\">\n <config.icon className={`text-3xl ${config.color}`} size={32} />\n </div>\n <div className=\"flex-1\">\n <h3 className=\"text-lg font-bold font-headline text-white\">{name}</h3>\n <p className=\"text-on-surface-variant text-xs mt-1\">{expertise}</p>\n \n <div className=\"mt-4 flex items-center gap-4\">\n <div className=\"flex flex-col\">\n <span className=\"text-[10px] text-on-surface-variant/60 uppercase tracking-tighter\">Model</span>\n <span className=\"text-xs font-semibold text-primary\">{model}</span>\n </div>\n <div className=\"flex flex-col\">\n <span className=\"text-[10px] text-on-surface-variant/60 uppercase tracking-tighter\">{metricLabel}</span>\n <span className={`text-xs font-semibold ${config.color}`}>{metricValue}</span>\n </div>\n </div>\n </div>\n </div>\n\n <div className=\"mt-6 flex gap-2\">\n <button \n onClick={(e) => {\n e.stopPropagation();\n onConfigure?.(id);\n }}\n className=\"flex-1 py-2 rounded bg-surface-container-high text-xs font-semibold text-on-surface hover:bg-surface-container-highest transition-colors\"\n >\n Configure\n </button>\n <div className=\"relative\" ref={menuRef}>\n <button \n onClick={(e) => {\n e.stopPropagation();\n setIsMenuOpen(!isMenuOpen);\n }}\n aria-label=\"Agent actions menu\"\n className={`px-3 py-2 rounded bg-surface-container-high text-on-surface-variant hover:text-white transition-colors h-full ${isMenuOpen ? 'bg-surface-container-highest text-white' : ''}`}\n >\n <MoreVertical size={16} aria-hidden=\"true\" />\n </button>\n\n {isMenuOpen && (\n <div className=\"absolute bottom-full right-0 mb-2 w-48 bg-surface-container-highest rounded-lg shadow-2xl py-2 ring-1 ring-outline-variant/20 animate-in fade-in slide-in-from-bottom-2 duration-200 z-20\">\n <button \n onClick={(e) => {\n e.stopPropagation();\n onProbe?.(id);\n setIsMenuOpen(false);\n }}\n disabled={status === 'inactive'}\n className=\"w-full flex items-center gap-3 px-4 py-2.5 text-xs text-on-surface-variant hover:text-white hover:bg-primary/10 transition-colors group disabled:opacity-30 disabled:grayscale disabled:cursor-not-allowed\"\n >\n <Terminal size={14} className=\"group-hover:text-primary\" />\n Probe Agent\n </button>\n <button \n onClick={(e) => {\n e.stopPropagation();\n onConfigure?.(id);\n setIsMenuOpen(false);\n }}\n className=\"w-full flex items-center gap-3 px-4 py-2.5 text-xs text-on-surface-variant hover:text-white hover:bg-white/5 transition-colors\"\n >\n <Settings size={14} />\n Control Matrix\n </button>\n <div className=\"my-1 border-t border-outline-variant/10\" />\n {status === 'inactive' ? (\n <button \n onClick={(e) => {\n e.stopPropagation();\n onActivate?.(id);\n setIsMenuOpen(false);\n }}\n className=\"w-full flex items-center gap-3 px-4 py-2.5 text-xs text-secondary/60 hover:text-secondary hover:bg-secondary/10 transition-colors\"\n >\n <Brain size={14} />\n Activate Node\n </button>\n ) : (\n <button \n onClick={(e) => {\n e.stopPropagation();\n onDelete?.(id);\n setIsMenuOpen(false);\n }}\n className=\"w-full flex items-center gap-3 px-4 py-2.5 text-xs text-error/60 hover:text-error hover:bg-error/10 transition-colors\"\n >\n <Trash2 size={14} />\n Decommission\n </button>\n )}\n </div>\n )}\n </div>\n </div>\n </div>\n );\n};\n\nexport default AgentCard;\n","import React, { useEffect, useState } from 'react';\nimport { X, Edit2, ChevronDown, Check, Copy, Loader2 } from 'lucide-react';\nimport { useNotification } from '../hooks/useNotification';\nimport MarkdownField from './MarkdownField';\nimport { agentsApi, type Agent } from '../api/agents';\nimport { type Model } from '../api/models';\nimport { providersApi, type Provider } from '../api/providers';\n\ninterface AgentConfigDrawerProps {\n isOpen: boolean;\n onClose: () => void;\n onUpdated?: () => void;\n agent: Agent | null;\n}\n\nconst AgentConfigDrawer: React.FC<AgentConfigDrawerProps> = ({\n isOpen,\n onClose,\n onUpdated,\n agent,\n}) => {\n const { notifyError, notifySuccess } = useNotification();\n const [saving, setSaving] = useState(false);\n const [loadingModels, setLoadingModels] = useState(false);\n const [loadingProviders, setLoadingProviders] = useState(false);\n const [copied, setCopied] = useState(false);\n\n const [name, setName] = useState('');\n const [role, setRole] = useState('');\n const [description, setDescription] = useState('');\n const [systemInstructions, setSystemInstructions] = useState('');\n const [providers, setProviders] = useState<Provider[]>([]);\n const [selectedProviderId, setSelectedProviderId] = useState('');\n const [availableModels, setAvailableModels] = useState<Model[]>([]);\n const [selectedModelId, setSelectedModelId] = useState('');\n\n // Populate form when agent changes or drawer opens\n useEffect(() => {\n if (isOpen && agent) {\n setName(agent.name || '');\n setRole(agent.role || '');\n setDescription(agent.description || '');\n setSystemInstructions(agent.systemInstructions || '');\n setSelectedModelId(agent.model?.id || '');\n const providerId = agent.provider?.id ?? agent.model?.provider?.id ?? '';\n setSelectedProviderId(providerId);\n }\n }, [isOpen, agent]);\n\n // Load providers once on open\n useEffect(() => {\n if (!isOpen) return;\n const load = async () => {\n try {\n setLoadingProviders(true);\n const { data } = await providersApi.findAll();\n setProviders(data);\n } catch {\n // non-fatal\n } finally {\n setLoadingProviders(false);\n }\n };\n void load();\n }, [isOpen]);\n\n // Reload models whenever provider changes\n useEffect(() => {\n if (!selectedProviderId) {\n setAvailableModels([]);\n return;\n }\n const load = async () => {\n try {\n setLoadingModels(true);\n const { data } = await providersApi.findModels(selectedProviderId);\n setAvailableModels(data);\n\n // If the current selected model is NOT in the new list, reset it\n // BUT don't reset if we just opened and it matches the initial agent model\n if (selectedModelId && !data.find((m) => m.id === selectedModelId)) {\n setSelectedModelId(data[0]?.id ?? '');\n }\n } catch {\n setAvailableModels([]);\n } finally {\n setLoadingModels(false);\n }\n };\n void load();\n }, [selectedProviderId, selectedModelId]);\n\n const handleCopyId = () => {\n if (!agent?.id) return;\n void navigator.clipboard.writeText(agent.id);\n setCopied(true);\n notifySuccess('Copied', 'Agent ID copied to clipboard');\n setTimeout(() => setCopied(false), 2000);\n };\n\n const handleSave = async () => {\n if (!agent?.id) return;\n try {\n setSaving(true);\n await agentsApi.update(agent.id, {\n name,\n role,\n description,\n systemInstructions,\n providerId: selectedProviderId || undefined,\n modelId: selectedModelId || undefined,\n });\n onUpdated?.();\n onClose();\n } catch {\n notifyError(\n 'Update Failed',\n 'An error occurred while saving the configuration.',\n );\n } finally {\n setSaving(false);\n }\n };\n\n useEffect(() => {\n const handleEsc = (e: KeyboardEvent) => {\n if (e.key === 'Escape') onClose();\n };\n if (isOpen) window.addEventListener('keydown', handleEsc);\n return () => window.removeEventListener('keydown', handleEsc);\n }, [isOpen, onClose]);\n\n if (!isOpen) return null;\n\n return (\n <div className=\"fixed inset-y-0 right-0 w-[420px] bg-surface-container-low shadow-2xl z-[60] flex flex-col ring-1 ring-outline-variant/10 animate-in slide-in-from-right duration-300\">\n <div className=\"p-6 border-b border-outline-variant/10 flex items-center justify-between\">\n <div>\n <h3 className=\"text-lg font-bold font-headline text-white\">\n Agent Configuration\n </h3>\n <p className=\"text-[10px] text-on-surface-variant uppercase tracking-widest mt-0.5\">\n Edit Profile: {agent?.name || 'Logic Specialist'}\n </p>\n </div>\n <button\n onClick={onClose}\n className=\"text-on-surface-variant hover:text-white transition-colors\"\n >\n <X size={20} />\n </button>\n </div>\n\n <div className=\"flex-1 overflow-y-auto p-6 space-y-8 scrollbar-hide\">\n {/* Identity Section */}\n <section className=\"space-y-4\">\n <div className=\"flex items-center gap-4\">\n <div className=\"relative w-20 h-20 rounded-2xl bg-surface-container-high ring-1 ring-outline-variant/50 flex items-center justify-center overflow-hidden\">\n <span className=\"text-4xl text-secondary\">🧠</span>\n <button className=\"absolute inset-0 bg-black/60 opacity-0 hover:opacity-100 transition-opacity flex items-center justify-center text-white\">\n <Edit2 size={16} />\n </button>\n </div>\n <div className=\"flex-1 space-y-3\">\n <div className=\"space-y-1\">\n <label className=\"text-[10px] font-bold uppercase tracking-tight text-on-surface-variant/60\">\n Agent Name\n </label>\n <input\n className=\"w-full bg-surface-container-lowest border-none rounded-md text-sm text-on-surface focus:ring-1 focus:ring-primary h-9 px-3\"\n type=\"text\"\n value={name}\n onChange={(e) => setName(e.target.value)}\n />\n </div>\n <div className=\"space-y-1\">\n <label className=\"text-[10px] font-bold uppercase tracking-tight text-on-surface-variant/60\">\n Agent ID\n </label>\n <div className=\"flex gap-2\">\n <input\n className=\"flex-1 bg-surface-container-lowest/50 border-none rounded-md text-[10px] font-mono text-on-surface-variant focus:ring-0 h-8 px-3 cursor-default\"\n type=\"text\"\n value={agent?.id || ''}\n readOnly\n />\n <button\n onClick={handleCopyId}\n className=\"p-1.5 rounded bg-surface-container-highest hover:bg-surface-container-highest/80 text-on-surface-variant transition-colors flex items-center justify-center aspect-square h-8\"\n title=\"Copy ID\"\n >\n {copied ? (\n <Check size={14} className=\"text-primary\" />\n ) : (\n <Copy size={14} />\n )}\n </button>\n </div>\n </div>\n </div>\n </div>\n\n {/* Role Field */}\n <div className=\"space-y-1\">\n <label className=\"text-[10px] font-bold uppercase tracking-tight text-on-surface-variant/60\">\n Role\n </label>\n <input\n className=\"w-full bg-surface-container-lowest border-none rounded-md text-sm text-on-surface focus:ring-1 focus:ring-primary h-9 px-3 placeholder:text-on-surface-variant/30\"\n type=\"text\"\n placeholder=\"e.g. Researcher, Developer...\"\n value={role}\n onChange={(e) => setRole(e.target.value)}\n />\n </div>\n </section>\n\n {/* Description Section */}\n <MarkdownField\n label=\"Description\"\n value={description}\n onChange={setDescription}\n placeholder=\"Detailed agent profile...\"\n height=\"h-32\"\n maxLength={1000}\n />\n\n {/* Provider Selection */}\n <section className=\"space-y-3\">\n <div className=\"flex items-center justify-between\">\n <label className=\"text-[10px] font-bold uppercase tracking-tight text-on-surface-variant/60\">\n Provider\n </label>\n {loadingProviders && (\n <Loader2 size={12} className=\"animate-spin text-primary\" />\n )}\n </div>\n <div className=\"relative\">\n <select\n className=\"w-full bg-surface-container-lowest border-none rounded-md text-sm text-on-surface focus:ring-1 focus:ring-primary h-11 appearance-none px-4 disabled:opacity-50\"\n value={selectedProviderId}\n onChange={(e) => setSelectedProviderId(e.target.value)}\n disabled={loadingProviders}\n >\n <option value=\"\">Select a provider...</option>\n {providers.map((p) => (\n <option key={p.id} value={p.id}>\n {p.name}\n </option>\n ))}\n </select>\n <ChevronDown\n className=\"absolute right-3 top-3 pointer-events-none text-on-surface-variant/60\"\n size={18}\n />\n </div>\n </section>\n\n {/* Model Selection */}\n <section className=\"space-y-3\">\n <div className=\"flex items-center justify-between\">\n <label className=\"text-[10px] font-bold uppercase tracking-tight text-on-surface-variant/60\">\n Model Engine\n </label>\n {loadingModels && (\n <Loader2 size={12} className=\"animate-spin text-primary\" />\n )}\n </div>\n <div className=\"relative\">\n <select\n className=\"w-full bg-surface-container-lowest border-none rounded-md text-sm text-on-surface focus:ring-1 focus:ring-primary h-11 appearance-none px-4 disabled:opacity-50\"\n value={selectedModelId}\n onChange={(e) => setSelectedModelId(e.target.value)}\n disabled={loadingModels || availableModels.length === 0}\n >\n {availableModels.length === 0 && !loadingModels && (\n <option value=\"\">No models available for this provider</option>\n )}\n {availableModels.map((m) => (\n <option key={m.id} value={m.id}>\n {m.name}\n </option>\n ))}\n </select>\n <ChevronDown\n className=\"absolute right-3 top-3 pointer-events-none text-on-surface-variant/60\"\n size={18}\n />\n </div>\n </section>\n\n {/* Personality Matrix */}\n <section className=\"space-y-6\">\n <div className=\"flex items-center justify-between\">\n <label className=\"text-[10px] font-bold uppercase tracking-tight text-on-surface-variant/60\">\n Personality Matrix\n </label>\n <span className=\"text-[10px] text-tertiary px-2 py-0.5 rounded bg-tertiary/10\">\n AI Optimized\n </span>\n </div>\n <div className=\"space-y-5\">\n <div className=\"space-y-2\">\n <div className=\"flex justify-between text-xs\">\n <span className=\"text-on-surface-variant\">Creativity</span>\n <span className=\"text-primary font-mono font-bold\">0.42</span>\n </div>\n <input\n type=\"range\"\n className=\"w-full accent-primary h-1 bg-surface-container-highest rounded-full appearance-none cursor-pointer\"\n />\n </div>\n <div className=\"space-y-2\">\n <div className=\"flex justify-between text-xs\">\n <span className=\"text-on-surface-variant\">Strictness</span>\n <span className=\"text-secondary font-mono font-bold\">0.85</span>\n </div>\n <input\n type=\"range\"\n className=\"w-full accent-secondary h-1 bg-surface-container-highest rounded-full appearance-none cursor-pointer\"\n />\n </div>\n </div>\n </section>\n\n {/* System Instructions */}\n <MarkdownField\n label=\"System Instructions\"\n value={systemInstructions}\n onChange={setSystemInstructions}\n placeholder=\"Define operational logic...\"\n height=\"h-64\"\n maxLength={2000}\n />\n </div>\n\n <div className=\"p-6 bg-surface-container-high border-t border-outline-variant/10 flex gap-3\">\n <button\n onClick={() => {\n void handleSave();\n }}\n disabled={saving}\n className=\"flex-1 bg-primary text-on-primary py-2.5 rounded font-bold text-sm shadow-lg shadow-primary/10 hover:shadow-primary/20 transition-all flex items-center justify-center gap-2 active:scale-95 disabled:opacity-50\"\n >\n {saving ? (\n <span className=\"w-4 h-4 border-2 border-on-primary/30 border-t-on-primary rounded-full animate-spin\" />\n ) : (\n <>\n <Check size={16} />\n Save Changes\n </>\n )}\n </button>\n <button\n onClick={onClose}\n className=\"px-4 py-2.5 rounded border border-outline-variant text-on-surface-variant hover:text-white transition-all\"\n >\n Reset\n </button>\n </div>\n </div>\n );\n};\n\nexport default AgentConfigDrawer;\n","import { useEffect, useId, useMemo, useState } from 'react';\nimport { Controller, useForm, useWatch } from 'react-hook-form';\nimport { zodResolver } from '@hookform/resolvers/zod';\nimport { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';\nimport { AnimatePresence, motion } from 'framer-motion';\nimport {\n Box,\n ChevronDown,\n Code,\n Layers,\n Shield,\n Sparkles,\n} from 'lucide-react';\nimport { agentsApi } from '../api/agents';\nimport { providersApi, type Provider } from '../api/providers';\nimport type { Model } from '../api/models';\nimport MarkdownField from './MarkdownField';\nimport { useNotification } from '../hooks/useNotification';\nimport {\n DEFAULT_AGENT_INSTRUCTIONS,\n createAgentSchema,\n type CreateAgentFormValues,\n} from '../lib/taskFormSchemas';\n\ninterface CreateAgentModalProps {\n isOpen: boolean;\n onClose: () => void;\n onCreated?: () => void;\n}\n\nconst createAgentDefaults: CreateAgentFormValues = {\n name: '',\n role: '',\n description: '',\n providerId: '',\n modelId: '',\n instructions: DEFAULT_AGENT_INSTRUCTIONS,\n};\n\nconst steps = [\n { id: 1, title: 'Essential Config', subtitle: 'ID, ROLE & MODEL' },\n { id: 2, title: 'Intelligence Tuning', subtitle: 'COGNITIVE MATRIX' },\n { id: 3, title: 'Instructions', subtitle: 'KNOWLEDGE BASE' },\n];\n\nconst CreateAgentModal = ({ isOpen, onClose, onCreated }: CreateAgentModalProps) => {\n const queryClient = useQueryClient();\n const { notifyApiError, notifyError, notifySuccess } = useNotification();\n const [activeStep, setActiveStep] = useState(1);\n const modalTitleId = useId();\n const modalDescriptionId = useId();\n const nameErrorId = useId();\n const roleErrorId = useId();\n const descriptionErrorId = useId();\n const providerErrorId = useId();\n const modelErrorId = useId();\n const instructionsErrorId = useId();\n\n const {\n control,\n formState: { errors },\n handleSubmit,\n register,\n reset,\n setValue,\n } = useForm<CreateAgentFormValues>({\n resolver: zodResolver(createAgentSchema),\n defaultValues: createAgentDefaults,\n mode: 'onBlur',\n });\n\n const providerId = useWatch({ control, name: 'providerId' });\n const modelId = useWatch({ control, name: 'modelId' });\n\n const providersQuery = useQuery({\n queryKey: ['providers'],\n enabled: isOpen,\n queryFn: async () => {\n const response = await providersApi.findAll();\n return response.data;\n },\n });\n\n const modelsQuery = useQuery({\n queryKey: ['provider-models', providerId],\n enabled: isOpen && Boolean(providerId),\n queryFn: async () => {\n const response = await providersApi.findModels(providerId);\n return response.data;\n },\n });\n\n useEffect(() => {\n if (!isOpen) {\n reset(createAgentDefaults);\n return;\n }\n\n const handleEsc = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n onClose();\n }\n };\n\n window.addEventListener('keydown', handleEsc);\n return () => window.removeEventListener('keydown', handleEsc);\n }, [isOpen, onClose, reset]);\n\n useEffect(() => {\n if (!isOpen) {\n return;\n }\n\n if (providersQuery.error) {\n notifyApiError(providersQuery.error, 'Providers Load Failed');\n }\n }, [isOpen, notifyApiError, providersQuery.error]);\n\n useEffect(() => {\n if (!isOpen) {\n return;\n }\n\n if (modelsQuery.error) {\n notifyApiError(modelsQuery.error, 'Models Load Failed');\n }\n }, [isOpen, modelsQuery.error, notifyApiError]);\n\n const providers = useMemo(() => providersQuery.data ?? [], [providersQuery.data]);\n const availableModels = useMemo(() => modelsQuery.data ?? [], [modelsQuery.data]);\n\n useEffect(() => {\n if (!isOpen) {\n return;\n }\n\n if (providers.length === 0) {\n if (providerId) {\n setValue('providerId', '', { shouldDirty: false, shouldValidate: true });\n }\n return;\n }\n\n if (!providerId || !providers.some((provider) => provider.id === providerId)) {\n setValue('providerId', providers[0].id, { shouldDirty: false, shouldValidate: true });\n }\n }, [isOpen, providerId, providers, setValue]);\n\n useEffect(() => {\n if (!isOpen) {\n return;\n }\n\n if (!providerId) {\n if (modelId) {\n setValue('modelId', '', { shouldDirty: false, shouldValidate: true });\n }\n return;\n }\n\n if (availableModels.length === 0) {\n if (modelId) {\n setValue('modelId', '', { shouldDirty: false, shouldValidate: true });\n }\n return;\n }\n\n if (!modelId || !availableModels.some((model) => model.id === modelId)) {\n setValue('modelId', availableModels[0].id, { shouldDirty: false, shouldValidate: true });\n }\n }, [availableModels, isOpen, modelId, providerId, setValue]);\n\n const createMutation = useMutation({\n mutationFn: async (values: CreateAgentFormValues) => {\n await agentsApi.create({\n name: values.name,\n role: values.role,\n description: values.description,\n systemInstructions: values.instructions,\n providerId: values.providerId,\n modelId: values.modelId,\n status: 'active',\n });\n\n return values;\n },\n onSuccess: (values) => {\n queryClient.invalidateQueries({ queryKey: ['agents'] });\n notifySuccess('Agent Deployed', `Successfully commissioned ${values.name} into the fleet.`);\n onCreated?.();\n onClose();\n reset(createAgentDefaults);\n setActiveStep(1);\n },\n onError: (error) => {\n notifyApiError(error, 'Deployment Failed');\n },\n });\n\n const loading = createMutation.isPending;\n const fetchingData = providersQuery.isPending || modelsQuery.isPending;\n\n const handleDeploy = handleSubmit(\n async (values) => {\n await createMutation.mutateAsync(values);\n },\n () => {\n notifyError('Validation Error', 'Please review the highlighted fields before deploying the agent.');\n },\n );\n\n const handleClose = () => {\n if (loading) {\n return;\n }\n setActiveStep(1);\n onClose();\n };\n\n if (!isOpen) {\n return null;\n }\n\n return (\n <AnimatePresence>\n <div className=\"fixed inset-0 z-[100] flex items-center justify-center p-4 md:p-8\">\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n onClick={handleClose}\n className=\"absolute inset-0 bg-surface/80 backdrop-blur-xl\"\n aria-hidden=\"true\"\n />\n\n <motion.div\n initial={{ opacity: 0, scale: 0.95, y: 20 }}\n animate={{ opacity: 1, scale: 1, y: 0 }}\n exit={{ opacity: 0, scale: 0.95, y: 20 }}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={modalTitleId}\n aria-describedby={modalDescriptionId}\n aria-busy={loading || fetchingData}\n className=\"relative w-full max-w-5xl h-full max-h-[850px] bg-surface-container-low rounded-2xl shadow-2xl overflow-hidden flex flex-col ring-1 ring-outline-variant/10\"\n >\n <div className=\"px-8 py-6 border-b border-outline-variant/10 flex items-center justify-between bg-surface-container-low/50 backdrop-blur-md sticky top-0 z-10\">\n <div>\n <h2 id={modalTitleId} className=\"text-2xl font-black font-headline text-white tracking-tight\">\n Create New Agent\n </h2>\n <p id={modalDescriptionId} className=\"text-sm text-on-surface-variant/80 mt-1\">\n Configure a specialized AI persona to handle specific nodes in your automation flows.\n </p>\n </div>\n <div className=\"flex items-center gap-4\">\n <button\n type=\"button\"\n onClick={handleClose}\n disabled={loading}\n className=\"px-6 py-2.5 rounded-md text-sm font-bold text-on-surface-variant hover:text-white transition-all disabled:opacity-50 disabled:cursor-not-allowed\"\n >\n Cancel\n </button>\n <button\n type=\"button\"\n onClick={handleDeploy}\n disabled={loading || providers.length === 0 || availableModels.length === 0}\n className=\"px-8 py-2.5 rounded-md bg-primary text-on-primary text-sm font-bold shadow-lg shadow-primary/20 hover:scale-[1.02] active:scale-[0.98] transition-all disabled:opacity-50 disabled:grayscale disabled:cursor-not-allowed disabled:hover:scale-100\"\n >\n {loading ? 'Deploying...' : 'Deploy Agent'}\n </button>\n </div>\n </div>\n\n <div className=\"flex-1 flex overflow-hidden\">\n <div className=\"w-72 bg-surface-container-low/30 border-r border-outline-variant/5 p-8 flex flex-col gap-10\">\n <div className=\"space-y-8\">\n {steps.map((step) => (\n <button\n key={step.id}\n type=\"button\"\n className=\"flex gap-4 group cursor-pointer text-left w-full\"\n onClick={() => setActiveStep(step.id)}\n aria-pressed={activeStep === step.id}\n >\n <div\n className={`w-8 h-8 rounded-full flex items-center justify-center text-[10px] font-black transition-all ${\n activeStep === step.id\n ? 'bg-secondary text-surface'\n : 'bg-surface-container-highest text-on-surface-variant'\n }`}\n >\n {step.id.toString().padStart(2, '0')}\n </div>\n <div>\n <h4\n className={`text-xs font-bold font-headline transition-colors ${\n activeStep === step.id ? 'text-white' : 'text-on-surface-variant'\n }`}\n >\n {step.title}\n </h4>\n <p className=\"text-[9px] font-bold tracking-widest text-on-surface-variant/50 mt-0.5\">\n {step.subtitle}\n </p>\n </div>\n </button>\n ))}\n </div>\n\n <div className=\"mt-auto bg-tertiary/10 rounded-xl p-5 ring-1 ring-tertiary/20 backdrop-blur-sm relative overflow-hidden group\">\n <div className=\"absolute -right-4 -top-4 w-16 h-16 bg-tertiary/10 rounded-full blur-2xl group-hover:bg-tertiary/20 transition-all duration-700\" />\n <div className=\"flex items-center gap-2 mb-3 text-tertiary\">\n <Sparkles size={14} aria-hidden=\"true\" />\n <span className=\"text-[10px] font-black uppercase tracking-widest\">AI Suggestion</span>\n </div>\n <p className=\"text-[11px] text-on-surface-variant leading-relaxed italic\">\n \"Try selecting <span className=\"text-tertiary font-bold\">Researcher</span> role for high-depth data synthesis tasks.\"\n </p>\n </div>\n </div>\n\n <div className=\"flex-1 overflow-y-auto p-10 space-y-12 custom-scrollbar\">\n <section className=\"space-y-8\">\n <div className=\"flex items-center gap-3\">\n <div className=\"w-1 bg-secondary h-6 rounded-full\" />\n <h3 className=\"text-lg font-bold font-headline text-white\">Basic Configuration</h3>\n </div>\n\n <div className=\"grid grid-cols-2 gap-6\">\n <div className=\"space-y-2\">\n <label\n htmlFor=\"create-agent-name\"\n className=\"text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60\"\n >\n Agent Name\n </label>\n <div className=\"bg-surface-container-highest/30 rounded-lg p-0.5 ring-1 ring-outline-variant/10 focus-within:ring-primary/40 transition-all\">\n <input\n id=\"create-agent-name\"\n type=\"text\"\n placeholder=\"e.g. Researcher-X\"\n aria-invalid={Boolean(errors.name)}\n aria-describedby={errors.name ? nameErrorId : undefined}\n className=\"w-full bg-transparent border-none text-sm text-on-surface h-10 px-3 focus:outline-none placeholder:text-on-surface-variant/30\"\n {...register('name')}\n />\n </div>\n {errors.name && (\n <p id={nameErrorId} className=\"text-xs text-error font-semibold\">\n {errors.name.message}\n </p>\n )}\n </div>\n <div className=\"space-y-2\">\n <label\n htmlFor=\"create-agent-role\"\n className=\"text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60\"\n >\n Primary Role\n </label>\n <div className=\"bg-surface-container-highest/30 rounded-lg p-0.5 ring-1 ring-outline-variant/10 focus-within:ring-primary/40 transition-all text-on-surface\">\n <input\n id=\"create-agent-role\"\n type=\"text\"\n placeholder=\"e.g. Researcher\"\n aria-invalid={Boolean(errors.role)}\n aria-describedby={errors.role ? roleErrorId : undefined}\n className=\"w-full bg-transparent border-none text-sm text-on-surface h-10 px-4 focus:outline-none placeholder:text-on-surface-variant/30\"\n {...register('role')}\n />\n </div>\n {errors.role && (\n <p id={roleErrorId} className=\"text-xs text-error font-semibold\">\n {errors.role.message}\n </p>\n )}\n </div>\n </div>\n\n <div className=\"space-y-2\">\n <Controller\n control={control}\n name=\"description\"\n render={({ field }) => (\n <MarkdownField\n label=\"Description\"\n value={field.value}\n onChange={field.onChange}\n placeholder=\"Define what this agent aims to achieve... You can use markdown for formatting.\"\n height=\"h-32\"\n maxLength={1000}\n />\n )}\n />\n {errors.description && (\n <p id={descriptionErrorId} className=\"text-xs text-error font-semibold\">\n {errors.description.message}\n </p>\n )}\n </div>\n\n <div className=\"pt-4 space-y-8 border-t border-outline-variant/10\">\n <div className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <label className=\"text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60\">\n Select Provider\n </label>\n {fetchingData && (\n <span className=\"text-[10px] text-primary animate-pulse font-bold uppercase tracking-widest\">\n Updating...\n </span>\n )}\n </div>\n <div className=\"grid grid-cols-4 gap-4\">\n {providers.map((provider: Provider) => (\n <button\n key={provider.id}\n type=\"button\"\n aria-pressed={providerId === provider.id}\n onClick={() => {\n if (providerId === provider.id) {\n return;\n }\n setValue('providerId', provider.id, {\n shouldDirty: true,\n shouldValidate: true,\n });\n setValue('modelId', '', {\n shouldDirty: true,\n shouldValidate: false,\n });\n }}\n className={`p-4 rounded-xl flex flex-col items-center gap-3 transition-all ${\n providerId === provider.id\n ? 'bg-primary/10 ring-2 ring-primary shadow-[0_0_20px_rgba(173,198,255,0.15)]'\n : 'bg-surface-container-highest/30 ring-1 ring-outline-variant/10 hover:bg-surface-container-highest/50'\n }`}\n >\n <div\n className={`w-10 h-10 rounded-lg flex items-center justify-center transition-colors ${\n providerId === provider.id\n ? 'bg-primary text-surface'\n : 'bg-surface-container-high text-on-surface-variant'\n }`}\n >\n <Box size={20} aria-hidden=\"true\" />\n </div>\n <div className=\"text-center\">\n <h4\n className={`text-xs font-black uppercase tracking-wider ${\n providerId === provider.id ? 'text-white' : 'text-on-surface-variant'\n }`}\n >\n {provider.name}\n </h4>\n </div>\n </button>\n ))}\n {providers.length === 0 && !providersQuery.isPending && (\n <div className=\"col-span-4 py-8 border-2 border-dashed border-outline-variant/10 rounded-xl flex flex-col items-center justify-center text-on-surface-variant/40 gap-2\">\n <Layers size={24} aria-hidden=\"true\" />\n <span className=\"text-[10px] font-bold uppercase tracking-widest\">\n No providers registered\n </span>\n </div>\n )}\n </div>\n {errors.providerId && (\n <p id={providerErrorId} className=\"text-xs text-error font-semibold\">\n {errors.providerId.message}\n </p>\n )}\n </div>\n\n <AnimatePresence mode=\"wait\">\n {providerId && (\n <motion.div\n key={providerId}\n initial={{ opacity: 0, y: 10 }}\n animate={{ opacity: 1, y: 0 }}\n exit={{ opacity: 0, y: -10 }}\n className=\"space-y-4 pt-4 border-t border-outline-variant/5\"\n >\n <label\n htmlFor=\"create-agent-model\"\n className=\"text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60\"\n >\n Model Variant Selection\n </label>\n <div className=\"bg-surface-container-highest/30 rounded-lg p-0.5 ring-1 ring-outline-variant/10 focus-within:ring-primary/40 transition-all relative\">\n <select\n id=\"create-agent-model\"\n value={modelId}\n onChange={(event) =>\n setValue('modelId', event.target.value, {\n shouldDirty: true,\n shouldValidate: true,\n })\n }\n aria-invalid={Boolean(errors.modelId)}\n aria-describedby={errors.modelId ? modelErrorId : undefined}\n className=\"w-full bg-transparent border-none text-sm text-on-surface h-10 px-3 focus:outline-none appearance-none cursor-pointer\"\n >\n <option value=\"\" disabled className=\"bg-surface-container-low text-on-surface\">\n Select a model...\n </option>\n {availableModels.map((model: Model) => (\n <option key={model.id} value={model.id} className=\"bg-surface-container-low text-on-surface\">\n {model.name}\n </option>\n ))}\n </select>\n <div className=\"absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none text-on-surface-variant/60\">\n <ChevronDown size={18} aria-hidden=\"true\" />\n </div>\n </div>\n {errors.modelId && (\n <p id={modelErrorId} className=\"text-xs text-error font-semibold\">\n {errors.modelId.message}\n </p>\n )}\n {availableModels.length === 0 && !modelsQuery.isPending && (\n <div className=\"py-6 text-center bg-error/5 rounded-xl border border-error/10\">\n <span className=\"text-[10px] font-bold text-error uppercase tracking-widest opacity-60\">\n No model variants found for this provider\n </span>\n </div>\n )}\n </motion.div>\n )}\n </AnimatePresence>\n </div>\n </section>\n\n <section className=\"space-y-10\">\n <div className=\"flex items-center gap-3\">\n <div className=\"w-1 bg-primary h-6 rounded-full\" />\n <h3 className=\"text-lg font-bold font-headline text-white\">Intelligence Tuning</h3>\n </div>\n\n <div className=\"space-y-8\">\n <label className=\"text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60\">\n Personality Matrix\n </label>\n\n {[\n { label: 'Precision', min: '0.00', max: '1.00', value: 0.72, color: 'accent-secondary' },\n { label: 'Lement', min: '0.00', max: '1.00', value: 0.45, color: 'accent-primary' },\n { label: 'Casual', min: '0.00', max: '1.00', value: 0.9, color: 'accent-tertiary' },\n ].map((slider) => (\n <div key={slider.label} className=\"space-y-3\">\n <div className=\"flex justify-between items-center text-[10px] font-bold tracking-tighter uppercase\">\n <span className=\"text-on-surface-variant/50\">\n {slider.label} ({slider.min})\n </span>\n <span className=\"text-white font-mono text-xs\">{slider.value.toFixed(2)}</span>\n <span className=\"text-on-surface-variant/50\">Creativity ({slider.max})</span>\n </div>\n <input\n type=\"range\"\n min=\"0\"\n max=\"100\"\n defaultValue={slider.value * 100}\n className={`w-full h-1 bg-surface-container-highest rounded-full appearance-none cursor-pointer ${slider.color}`}\n aria-label={`${slider.label} tuning slider`}\n />\n </div>\n ))}\n </div>\n </section>\n\n <section className=\"space-y-8\">\n <div className=\"flex items-center gap-3\">\n <div className=\"w-1 bg-tertiary h-6 rounded-full\" />\n <h3 className=\"text-lg font-bold font-headline text-white\">Operational Directives</h3>\n </div>\n\n <div className=\"space-y-2\">\n <Controller\n control={control}\n name=\"instructions\"\n render={({ field }) => (\n <MarkdownField\n label=\"System Instructions\"\n value={field.value}\n onChange={field.onChange}\n height=\"h-64\"\n helperText=\"Prompt Engineering Active\"\n maxLength={1000}\n />\n )}\n />\n {errors.instructions && (\n <p id={instructionsErrorId} className=\"text-xs text-error font-semibold\">\n {errors.instructions.message}\n </p>\n )}\n </div>\n\n <div className=\"space-y-4\">\n <label className=\"text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60\">\n Knowledge Integration\n </label>\n <div className=\"grid grid-cols-2 gap-4\">\n <button\n type=\"button\"\n className=\"border-2 border-dashed border-outline-variant/10 rounded-xl p-6 flex flex-col items-center justify-center gap-2 group cursor-pointer hover:border-primary/30 transition-all\"\n >\n <div className=\"w-10 h-10 rounded-full bg-surface-container-high flex items-center justify-center text-on-surface-variant group-hover:text-primary transition-colors\">\n <Code size={18} aria-hidden=\"true\" />\n </div>\n <span className=\"text-[10px] font-bold uppercase tracking-widest text-on-surface-variant\">\n Connect Repo\n </span>\n </button>\n <button\n type=\"button\"\n className=\"border-2 border-dashed border-outline-variant/10 rounded-xl p-6 flex flex-col items-center justify-center gap-2 group cursor-pointer hover:border-primary/30 transition-all\"\n >\n <div className=\"w-10 h-10 rounded-full bg-surface-container-high flex items-center justify-center text-on-surface-variant group-hover:text-primary transition-colors\">\n <Shield size={18} aria-hidden=\"true\" />\n </div>\n <span className=\"text-[10px] font-bold uppercase tracking-widest text-on-surface-variant\">\n Access Policies\n </span>\n </button>\n </div>\n </div>\n </section>\n </div>\n </div>\n </motion.div>\n </div>\n </AnimatePresence>\n );\n};\n\nexport default CreateAgentModal;\n","import React, { useState, useEffect } from 'react';\nimport { motion, AnimatePresence } from 'framer-motion';\nimport { Send, X, Terminal, Brain, Loader2, AlertCircle, CheckCircle2, Activity, ImageIcon } from 'lucide-react';\nimport { agentsApi, type Agent } from '../api/agents';\n\ninterface ProbeAgentModalProps {\n isOpen: boolean;\n onClose: () => void;\n agent: Agent | null;\n}\n\nconst ProbeAgentModal: React.FC<ProbeAgentModalProps> = ({ isOpen, onClose, agent }) => {\n const DEFAULT_INPUT = 'Wake up, who are you?';\n const [input, setInput] = useState(DEFAULT_INPUT);\n const [response, setResponse] = useState('');\n const [imageResponse, setImageResponse] = useState<string | undefined>();\n const [loading, setLoading] = useState(false);\n const [status, setStatus] = useState<'idle' | 'success' | 'error'>('idle');\n\n useEffect(() => {\n const handleEsc = (e: KeyboardEvent) => {\n if (e.key === 'Escape') onClose();\n };\n if (isOpen) {\n window.addEventListener('keydown', handleEsc);\n setResponse('');\n setImageResponse(undefined);\n setStatus('idle');\n setInput(DEFAULT_INPUT);\n }\n return () => window.removeEventListener('keydown', handleEsc);\n }, [isOpen, onClose]);\n\n const handleProbe = async () => {\n if (!agent?.id || !input.trim()) return;\n\n try {\n setLoading(true);\n setStatus('idle');\n setResponse('Awaiting response from neural node...');\n setImageResponse(undefined);\n \n const { data } = await agentsApi.probe(agent.id, input);\n setResponse(data.content);\n setImageResponse(data.image);\n setStatus('success');\n } catch (error: unknown) {\n console.error('Probe failed:', error);\n let errorMessage = 'An unexpected error occurred during the probe.';\n if (error && typeof error === 'object' && 'response' in error) {\n const anyError = error as {\n response?: { data?: { message?: string } };\n message?: string;\n };\n errorMessage =\n anyError.response?.data?.message || anyError.message || errorMessage;\n } else if (error instanceof Error) {\n errorMessage = error.message;\n }\n setResponse(`ERROR: ${errorMessage}`);\n setStatus('error');\n } finally {\n setLoading(false);\n }\n };\n\n if (!isOpen) return null;\n\n return (\n <AnimatePresence>\n <div className=\"fixed inset-0 z-[100] flex items-center justify-center p-4\">\n {/* Backdrop */}\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n onClick={onClose}\n className=\"absolute inset-0 bg-surface/80 backdrop-blur-xl\"\n />\n\n {/* Modal Container */}\n <motion.div\n initial={{ opacity: 0, scale: 0.95, y: 20 }}\n animate={{ opacity: 1, scale: 1, y: 0 }}\n exit={{ opacity: 0, scale: 0.95, y: 20 }}\n className=\"relative w-full max-w-2xl bg-surface-container-low rounded-2xl shadow-2xl overflow-hidden flex flex-col ring-1 ring-outline-variant/10\"\n >\n {/* Header */}\n <div className=\"px-6 py-4 border-b border-outline-variant/10 flex items-center justify-between bg-surface-container-low/50 backdrop-blur-md\">\n <div className=\"flex items-center gap-3\">\n <div className=\"w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center text-primary\">\n <Brain size={20} />\n </div>\n <div>\n <h2 className=\"text-xl font-black font-headline text-white tracking-tight\">Probe: {agent?.name}</h2>\n <p className=\"text-[10px] text-on-surface-variant uppercase tracking-widest font-bold\">Neural Direct Message</p>\n </div>\n </div>\n <button onClick={onClose} className=\"text-on-surface-variant hover:text-white transition-colors p-2\">\n <X size={20} />\n </button>\n </div>\n\n <div className=\"p-6 space-y-6 max-h-[80vh] overflow-y-auto scrollbar-hide\">\n {/* Input Section */}\n <div className=\"space-y-2\">\n <label className=\"text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60 flex items-center gap-2\">\n <Terminal size={12} />\n Command Input\n </label>\n <div className=\"relative group\">\n <textarea\n value={input}\n onChange={(e) => setInput(e.target.value)}\n placeholder=\"Type your command...\"\n className=\"w-full bg-surface-container-highest/30 rounded-xl p-4 text-sm text-on-surface h-32 focus:outline-none focus:ring-2 focus:ring-primary/40 transition-all resize-none border border-outline-variant/10 group-hover:border-outline-variant/30\"\n />\n <button\n onClick={handleProbe}\n disabled={loading || !input.trim()}\n className=\"absolute bottom-3 right-3 p-2.5 rounded-lg bg-primary text-on-primary shadow-lg shadow-primary/20 hover:scale-[1.05] active:scale-[0.95] transition-all disabled:opacity-50 disabled:grayscale disabled:cursor-not-allowed group\"\n >\n {loading ? <Loader2 size={18} className=\"animate-spin\" /> : <Send size={18} />}\n </button>\n </div>\n </div>\n\n {/* Output Section */}\n <div className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <label className=\"text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60 flex items-center gap-2\">\n <Activity size={12} className={loading ? 'animate-pulse' : ''} />\n Neural Response\n </label>\n {status === 'success' && (\n <span className=\"flex items-center gap-1 text-[9px] font-black text-secondary uppercase bg-secondary/10 px-2 py-0.5 rounded\">\n <CheckCircle2 size={10} /> Sync Complete\n </span>\n )}\n {status === 'error' && (\n <span className=\"flex items-center gap-1 text-[9px] font-black text-error uppercase bg-error/10 px-2 py-0.5 rounded\">\n <AlertCircle size={10} /> Link Severed\n </span>\n )}\n </div>\n \n {/* Text Response */}\n <div className={`w-full min-h-[100px] bg-black/40 rounded-xl p-5 border border-outline-variant/5 font-mono text-sm leading-relaxed transition-all duration-500 whitespace-pre-wrap ${\n status === 'error' ? 'text-error/80 border-error/20' : \n status === 'success' ? 'text-secondary/90 border-secondary/20 shadow-[inset_0_0_20px_rgba(102,231,175,0.05)]' :\n 'text-on-surface-variant/60'\n }`}>\n {response || 'Enter a command and initiate the probe to see the agent response.'}\n </div>\n\n {/* Image Response */}\n <AnimatePresence>\n {imageResponse && (\n <motion.div \n initial={{ opacity: 0, y: 10 }}\n animate={{ opacity: 1, y: 0 }}\n className=\"space-y-2\"\n >\n <label className=\"text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60 flex items-center gap-2\">\n <ImageIcon size={12} />\n Visual Output\n </label>\n <div className=\"relative rounded-xl overflow-hidden border border-outline-variant/10 bg-surface-container-highest/20 group\">\n <img \n src={`data:image/png;base64,${imageResponse}`} \n alt=\"Neural Output\" \n className=\"w-full h-auto max-h-[400px] object-contain mx-auto\"\n />\n <div className=\"absolute inset-x-0 bottom-0 p-3 bg-gradient-to-t from-black/60 to-transparent opacity-0 group-hover:opacity-100 transition-opacity\">\n <span className=\"text-[10px] font-bold text-white uppercase tracking-wider\">Generated Content</span>\n </div>\n </div>\n </motion.div>\n )}\n </AnimatePresence>\n </div>\n </div>\n\n <div className=\"px-6 py-4 bg-surface-container-high/50 border-t border-outline-variant/10 flex justify-end\">\n <button\n onClick={onClose}\n className=\"px-6 py-2 rounded-lg text-sm font-bold text-on-surface hover:bg-surface-container-highest transition-all\"\n >\n Close Terminal\n </button>\n </div>\n </motion.div>\n </div>\n </AnimatePresence>\n );\n};\n\nexport default ProbeAgentModal;\n","import { useState } from 'react';\nimport { Grid2X2, List, Plus, Loader2 } from 'lucide-react';\nimport { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';\nimport AgentCard from './AgentCard';\nimport AgentConfigDrawer from './AgentConfigDrawer';\nimport CreateAgentModal from './CreateAgentModal';\nimport ProbeAgentModal from './ProbeAgentModal';\nimport ConfirmDialog from './ConfirmDialog';\nimport { agentsApi, type Agent } from '../api/agents';\nimport { useNotification } from '../hooks/useNotification';\n\nconst AgentFleet = () => {\n const { notifySuccess, notifyApiError } = useNotification();\n const queryClient = useQueryClient();\n const [selectedAgent, setSelectedAgent] = useState<Agent | null>(null);\n const [isDrawerOpen, setIsDrawerOpen] = useState(false);\n const [isModalOpen, setIsModalOpen] = useState(false);\n const [isProbeModalOpen, setIsProbeModalOpen] = useState(false);\n const [isConfirmOpen, setIsConfirmOpen] = useState(false);\n const [viewMode, setViewMode] = useState<'grid' | 'list'>('grid');\n\n const { data: agents = [], isLoading: loading } = useQuery({\n queryKey: ['agents'],\n queryFn: async () => {\n const { data } = await agentsApi.findAll();\n return data;\n },\n });\n\n const invalidateAgents = () => queryClient.invalidateQueries({ queryKey: ['agents'] });\n\n const deleteMutation = useMutation({\n mutationFn: (id: string) => agentsApi.delete(id),\n onSuccess: () => {\n notifySuccess('Agent Inactivated', 'Neural node has been marked as inactive.');\n setIsConfirmOpen(false);\n invalidateAgents();\n },\n onError: (error) => notifyApiError(error, 'Operation Failed'),\n });\n\n const activateMutation = useMutation({\n mutationFn: (id: string) => agentsApi.update(id, { status: 'active' }),\n onSuccess: () => {\n notifySuccess('Neural Link Restored', 'The agent has been reactivated and synchronized.');\n invalidateAgents();\n },\n onError: (error) => notifyApiError(error, 'Activation Failed'),\n });\n\n const handleConfigure = (agent: Agent) => {\n setSelectedAgent(agent);\n setIsDrawerOpen(true);\n };\n\n const handleProbe = (agent: Agent) => {\n setSelectedAgent(agent);\n setIsProbeModalOpen(true);\n };\n\n const handleDeleteRequest = (agent: Agent) => {\n setSelectedAgent(agent);\n setIsConfirmOpen(true);\n };\n\n const handleConfirmDelete = () => {\n if (!selectedAgent) return;\n deleteMutation.mutate(selectedAgent.id);\n };\n\n const handleActivate = (id: string) => {\n activateMutation.mutate(id);\n };\n\n return (\n <div className=\"space-y-8\">\n <div className=\"flex items-end justify-between\">\n <div>\n <h2 className=\"text-4xl font-extrabold font-headline tracking-tight text-white\">Agent Fleet</h2>\n <p className=\"text-on-surface-variant mt-2 font-body text-sm\">\n Commanding <span className=\"text-secondary font-bold\">{agents.filter(a => a.status !== 'inactive').length}</span> active neural nodes across the network.\n </p>\n </div>\n <div className=\"flex gap-2\">\n <button \n onClick={() => setViewMode('grid')}\n aria-label=\"Grid view\"\n aria-pressed={viewMode === 'grid'}\n className={`p-2 rounded transition-colors ${viewMode === 'grid' ? 'bg-surface-container-high text-white' : 'text-on-surface-variant hover:text-white'}`}\n >\n <Grid2X2 size={20} aria-hidden=\"true\" />\n </button>\n <button \n onClick={() => setViewMode('list')}\n aria-label=\"List view\"\n aria-pressed={viewMode === 'list'}\n className={`p-2 rounded transition-colors ${viewMode === 'list' ? 'bg-surface-container-high text-white' : 'text-on-surface-variant hover:text-white'}`}\n >\n <List size={20} aria-hidden=\"true\" />\n </button>\n </div>\n </div>\n\n {loading ? (\n <div className=\"flex items-center justify-center h-64\">\n <Loader2 className=\"w-12 h-12 text-primary animate-spin\" />\n </div>\n ) : (\n <div className={viewMode === 'grid' ? \"grid grid-cols-1 xl:grid-cols-2 2xl:grid-cols-3 gap-6\" : \"flex flex-col gap-4\"}>\n {agents.map((agent) => (\n <div key={agent.id} onClick={() => handleConfigure(agent)} className={agent.status === 'inactive' ? 'opacity-50 grayscale hover:grayscale-0 transition-all' : ''}>\n <AgentCard \n id={agent.id}\n name={agent.name}\n expertise={agent.role || 'General Assistant'}\n model={agent.model?.name || 'Unknown'}\n status={agent.status || 'active'}\n metricLabel=\"Provider\"\n metricValue={agent.provider?.name || 'Unknown'}\n onConfigure={() => handleConfigure(agent)}\n onProbe={() => handleProbe(agent)}\n onDelete={() => handleDeleteRequest(agent)}\n onActivate={() => handleActivate(agent.id)}\n />\n </div>\n ))}\n \n {/* New Agent Placeholder */}\n <div \n onClick={() => setIsModalOpen(true)}\n className=\"border-2 border-dashed border-outline-variant/30 rounded-xl p-6 flex flex-col items-center justify-center text-center group cursor-pointer hover:border-primary/50 transition-all hover:bg-primary/5\"\n >\n <div className=\"w-12 h-12 rounded-full bg-surface-container-low flex items-center justify-center mb-4 group-hover:scale-110 transition-transform\">\n <Plus size={24} className=\"text-primary\" />\n </div>\n <span className=\"text-sm font-bold font-headline text-on-surface-variant group-hover:text-on-surface\">Deploy New Agent</span>\n <p className=\"text-xs text-on-surface-variant/60 mt-1 max-w-[200px]\">Expand your fleet with specialized intelligence units.</p>\n </div>\n </div>\n )}\n\n <AgentConfigDrawer \n key={selectedAgent?.id || 'none'}\n isOpen={isDrawerOpen} \n onClose={() => setIsDrawerOpen(false)} \n onUpdated={invalidateAgents}\n agent={selectedAgent} \n />\n\n <ProbeAgentModal \n isOpen={isProbeModalOpen}\n onClose={() => setIsProbeModalOpen(false)}\n agent={selectedAgent}\n />\n\n <CreateAgentModal \n isOpen={isModalOpen} \n onClose={() => setIsModalOpen(false)} \n onCreated={invalidateAgents}\n />\n\n <ConfirmDialog \n isOpen={isConfirmOpen}\n onClose={() => setIsConfirmOpen(false)}\n onConfirm={handleConfirmDelete}\n title=\"Decommission Neural Node?\"\n message={`This will mark ${selectedAgent?.name} as inactive. The agent will remain in the database but will no longer be available for automated tasks or direct neural connection.`}\n confirmText=\"Decommission\"\n variant=\"danger\"\n />\n </div>\n );\n};\n\nexport default AgentFleet;\n"],"x_google_ignoreList":[0,1,2,3,4,5,6],"mappings":"y8BAcA,IAAM,EAAU,EAAiB,WALd,CACjB,CAAC,SAAU,CAAE,GAAI,KAAM,GAAI,KAAM,EAAG,KAAM,IAAK,SAAU,CAAC,CAC1D,CAAC,OAAQ,CAAE,EAAG,YAAa,IAAK,SAAU,CAAC,CAC3C,CAAC,OAAQ,CAAE,EAAG,WAAY,IAAK,SAAU,CAAC,CAC3C,CACuD,CCAlD,EAAU,EAAiB,WALd,CACjB,CAAC,OAAQ,CAAE,EAAG,WAAY,IAAK,SAAU,CAA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UAAW,EAAM,MAAQ,oBACzB,MAAO,EAAM,OAAO,MAAQ,UAC5B,OAAQ,EAAM,QAAU,SACxB,YAAY,WACZ,YAAa,EAAM,UAAU,MAAQ,UACrC,gBAAmB,EAAgB,EAAM,CACzC,YAAe,EAAY,EAAM,CACjC,aAAgB,EAAoB,EAAM,CAC1C,eAAkB,EAAe,EAAM,GAAG,CAC1C,CAAA,CACE,CAdI,EAAM,GAcV,CACN,EAGF,EAAA,EAAA,MAAC,MAAD,CACE,YAAe,EAAe,GAAK,CACnC,UAAU,gNAFZ,EAIE,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,6IACb,EAAA,EAAA,KAAC,EAAD,CAAM,KAAM,GAAI,UAAU,eAAiB,CAAA,CACvC,CAAA,EACN,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,+FAAsF,mBAAuB,CAAA,EAC7H,EAAA,EAAA,KAAC,IAAD,CAAG,UAAU,iEAAwD,yDAA0D,CAAA,CAC3H,GACF,IAGR,EAAA,EAAA,KAAC,EAAD,CAEE,OAAQ,EACR,YAAe,EAAgB,GAAM,CACrC,UAAW,EACX,MAAO,EACP,CALK,GAAe,IAAM,OAK1B,EAEF,EAAA,EAAA,KAAC,EAAD,CACE,OAAQ,EACR,YAAe,EAAoB,GAAM,CACzC,MAAO,EACP,CAAA,EAEF,EAAA,EAAA,KAAC,EAAD,CACE,OAAQ,EACR,YAAe,EAAe,GAAM,CACpC,UAAW,EACX,CAAA,EAEF,EAAA,EAAA,KAAC,EAAD,CACE,OAAQ,EACR,YAAe,EAAiB,GAAM,CACtC,UAAW,EACX,MAAM,4BACN,QAAS,kBAAkB,GAAe,KAAK,sIAC/C,YAAY,eACZ,QAAQ,SACR,CAAA,CACE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import"./rolldown-runtime-COnpUsM8.js";import{g as e}from"./vendor-dnd-CxfOy4-Z.js";import{r as t}from"./vendor-markdown-Dl_1qnne.js";import{o as n}from"./useNotification-DK-pV16c.js";import{n as r,t as i}from"./vendor-motion-CkXYvnuI.js";import{m as a,p as o,s}from"./index-yzhzS93F.js";import{i as c,n as l,r as u,t as d}from"./vendor-forms-HC2wK6B9.js";import{n as f,t as p}from"./tasks-DEHCZk48.js";var m=n(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),h=`# Background
|
|
2
|
+
|
|
3
|
+
# To Do
|
|
4
|
+
|
|
5
|
+
# Validation`,g=`# ROLE DEFINITION
|
|
6
|
+
Act as a high-level quantitative researcher.
|
|
7
|
+
Prioritize source credibility and peer-reviewed data.
|
|
8
|
+
|
|
9
|
+
# OUTPUT FORMAT
|
|
10
|
+
Return all results in Markdown tables with clear citations.`,_=[p.CRITICAL,p.HIGH,p.MEDIUM,p.LOW],v=l({error:`Priority is required`}).int().refine(e=>_.includes(e),{message:`Select a valid priority level`}),y=[f.BACKLOG,f.IN_PROGRESS,f.REVIEW,f.DONE],b=[f.BACKLOG,f.IN_PROGRESS,f.REVIEW],x=u({title:c().trim().min(1,`Node designation is required`).max(120,`Node designation must be 120 characters or fewer`),description:c().trim().min(1,`Objective / parameters are required`).max(2e3,`Objective / parameters must be 2000 characters or fewer`),status:d(y,{error:`Select a valid status`}),priority:v,assigneeId:c()}),S=u({title:c().trim().min(1,`Task title is required`).max(120,`Task title must be 120 characters or fewer`),description:c().trim().min(1,`Objective / description is required`).max(2e3,`Objective / description must be 2000 characters or fewer`),status:d(b,{error:`Select a valid initial status`}),priority:v,assigneeId:c(),projectId:c().trim().min(1,`Target project is required`)}),C=u({name:c().trim().min(1,`Agent name is required`).max(80,`Agent name must be 80 characters or fewer`),role:c().trim().min(1,`Primary role is required`).max(80,`Primary role must be 80 characters or fewer`),description:c().max(1e3,`Description must be 1000 characters or fewer`),providerId:c().trim().min(1,`Provider is required`),modelId:c().trim().min(1,`Model is required`),instructions:c().max(1e3,`System instructions must be 1000 characters or fewer`)});e();var w=t(),T=({isOpen:e,onClose:t,onConfirm:n,title:c,message:l,confirmText:u=`Confirm`,cancelText:d=`Cancel`,variant:f=`primary`,loading:p=!1,showCheckbox:h=!1,checkboxLabel:g=`Don't show this again`,onCheckboxChange:_})=>{let v={danger:{icon:m,iconBg:`bg-error/10`,iconColor:`text-error`,buttonBg:`bg-error hover:bg-error/90`,buttonText:`text-white`,ring:`ring-error/20`},primary:{icon:o,iconBg:`bg-primary/10`,iconColor:`text-primary`,buttonBg:`bg-primary hover:bg-primary/90`,buttonText:`text-on-primary`,ring:`ring-primary/20`},success:{icon:a,iconBg:`bg-secondary/10`,iconColor:`text-secondary`,buttonBg:`bg-secondary hover:bg-secondary/90`,buttonText:`text-surface`,ring:`ring-secondary/20`},warning:{icon:m,iconBg:`bg-tertiary/10`,iconColor:`text-tertiary`,buttonBg:`bg-tertiary hover:bg-tertiary/90`,buttonText:`text-surface`,ring:`ring-tertiary/20`}}[f],y=v.icon;return e?(0,w.jsx)(r,{children:(0,w.jsxs)(`div`,{className:`fixed inset-0 z-[200] flex items-center justify-center p-4`,children:[(0,w.jsx)(i.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:t,className:`absolute inset-0 bg-surface/60 backdrop-blur-md`}),(0,w.jsxs)(i.div,{initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},className:`relative w-full max-w-md bg-surface-container-low rounded-2xl shadow-2xl overflow-hidden ring-1 ring-outline-variant/10 p-6 flex flex-col gap-6`,children:[(0,w.jsxs)(`div`,{className:`flex gap-4`,children:[(0,w.jsx)(`div`,{className:`w-12 h-12 rounded-xl flex-shrink-0 flex items-center justify-center ${v.iconBg} ${v.iconColor}`,children:(0,w.jsx)(y,{size:24})}),(0,w.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,w.jsx)(`h3`,{className:`text-xl font-black font-headline text-white tracking-tight mb-2`,children:c}),(0,w.jsx)(`p`,{className:`text-sm text-on-surface-variant leading-relaxed`,children:l})]}),(0,w.jsx)(`button`,{onClick:t,className:`text-on-surface-variant hover:text-white transition-colors h-fit p-1`,children:(0,w.jsx)(s,{size:20})})]}),h&&(0,w.jsx)(`div`,{className:`flex items-center gap-3 px-1 mt-[-12px]`,children:(0,w.jsxs)(`label`,{className:`flex items-center gap-3 cursor-pointer group`,children:[(0,w.jsxs)(`div`,{className:`relative flex items-center`,children:[(0,w.jsx)(`input`,{type:`checkbox`,onChange:e=>_?.(e.target.checked),className:`peer appearance-none w-5 h-5 rounded border border-outline-variant/30 bg-surface-container-highest checked:bg-primary checked:border-primary transition-all cursor-pointer`}),(0,w.jsx)(a,{size:14,className:`absolute inset-0 m-auto text-on-primary opacity-0 peer-checked:opacity-100 transition-opacity pointer-events-none`})]}),(0,w.jsx)(`span`,{className:`text-xs font-bold text-on-surface-variant group-hover:text-white transition-colors uppercase tracking-wider`,children:g})]})}),(0,w.jsxs)(`div`,{className:`flex items-center justify-end gap-3 mt-2`,children:[(0,w.jsx)(`button`,{onClick:t,disabled:p,className:`px-5 py-2.5 rounded-lg text-sm font-bold text-on-surface-variant hover:text-white hover:bg-surface-container-highest transition-all disabled:opacity-50`,children:d}),(0,w.jsx)(`button`,{onClick:n,disabled:p,className:`px-6 py-2.5 rounded-lg text-sm font-bold shadow-lg transition-all ${v.buttonBg} ${v.buttonText} ${v.ring} hover:scale-[1.02] active:scale-[0.98] disabled:opacity-50 disabled:grayscale disabled:cursor-not-allowed`,children:p?`Processing...`:u})]})]})]})}):null};export{S as a,C as i,g as n,x as o,h as r,T as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfirmDialog-mRH8i_xK.js","names":[],"sources":["../../node_modules/lucide-react/dist/esm/icons/triangle-alert.js","../../src/lib/taskFormSchemas.ts","../../src/components/ConfirmDialog.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.577.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\",\n key: \"wmoenq\"\n }\n ],\n [\"path\", { d: \"M12 9v4\", key: \"juzpu7\" }],\n [\"path\", { d: \"M12 17h.01\", key: \"p32p05\" }]\n];\nconst TriangleAlert = createLucideIcon(\"triangle-alert\", __iconNode);\n\nexport { __iconNode, TriangleAlert as default };\n//# sourceMappingURL=triangle-alert.js.map\n","import { z } from 'zod';\nimport { TaskPriority, TaskStatus } from '../api/tasks';\n\nexport const TASK_TEMPLATE = `# Background\n\n# To Do\n\n# Validation`;\n\nexport const DEFAULT_AGENT_INSTRUCTIONS = `# ROLE DEFINITION\nAct as a high-level quantitative researcher.\nPrioritize source credibility and peer-reviewed data.\n\n# OUTPUT FORMAT\nReturn all results in Markdown tables with clear citations.`;\n\nconst taskPriorityValues = [\n TaskPriority.CRITICAL,\n TaskPriority.HIGH,\n TaskPriority.MEDIUM,\n TaskPriority.LOW,\n] as const;\n\nconst taskPrioritySchema = z\n .number({ error: 'Priority is required' })\n .int()\n .refine((value) => taskPriorityValues.includes(value as (typeof taskPriorityValues)[number]), {\n message: 'Select a valid priority level',\n });\n\nconst taskDetailStatusValues = [\n TaskStatus.BACKLOG,\n TaskStatus.IN_PROGRESS,\n TaskStatus.REVIEW,\n TaskStatus.DONE,\n] as const;\n\nconst createTaskStatusValues = [\n TaskStatus.BACKLOG,\n TaskStatus.IN_PROGRESS,\n TaskStatus.REVIEW,\n] as const;\n\nexport const taskDetailSchema = z.object({\n title: z\n .string()\n .trim()\n .min(1, 'Node designation is required')\n .max(120, 'Node designation must be 120 characters or fewer'),\n description: z\n .string()\n .trim()\n .min(1, 'Objective / parameters are required')\n .max(2000, 'Objective / parameters must be 2000 characters or fewer'),\n status: z.enum(taskDetailStatusValues, {\n error: 'Select a valid status',\n }),\n priority: taskPrioritySchema,\n assigneeId: z.string(),\n});\n\nexport const createTaskSchema = z.object({\n title: z\n .string()\n .trim()\n .min(1, 'Task title is required')\n .max(120, 'Task title must be 120 characters or fewer'),\n description: z\n .string()\n .trim()\n .min(1, 'Objective / description is required')\n .max(2000, 'Objective / description must be 2000 characters or fewer'),\n status: z.enum(createTaskStatusValues, {\n error: 'Select a valid initial status',\n }),\n priority: taskPrioritySchema,\n assigneeId: z.string(),\n projectId: z.string().trim().min(1, 'Target project is required'),\n});\n\nexport const createAgentSchema = z.object({\n name: z\n .string()\n .trim()\n .min(1, 'Agent name is required')\n .max(80, 'Agent name must be 80 characters or fewer'),\n role: z\n .string()\n .trim()\n .min(1, 'Primary role is required')\n .max(80, 'Primary role must be 80 characters or fewer'),\n description: z.string().max(1000, 'Description must be 1000 characters or fewer'),\n providerId: z.string().trim().min(1, 'Provider is required'),\n modelId: z.string().trim().min(1, 'Model is required'),\n instructions: z.string().max(1000, 'System instructions must be 1000 characters or fewer'),\n});\n\nexport type TaskDetailFormValues = {\n title: string;\n description: string;\n status: (typeof taskDetailStatusValues)[number];\n priority: number;\n assigneeId: string;\n};\n\nexport type CreateTaskFormValues = {\n title: string;\n description: string;\n status: (typeof createTaskStatusValues)[number];\n priority: number;\n assigneeId: string;\n projectId: string;\n};\n\nexport type CreateAgentFormValues = {\n name: string;\n role: string;\n description: string;\n providerId: string;\n modelId: string;\n instructions: string;\n};\n","import React from 'react';\nimport { motion, AnimatePresence } from 'framer-motion';\nimport { AlertTriangle, Info, CheckCircle2, X } from 'lucide-react';\n\nexport type ConfirmVariant = 'danger' | 'primary' | 'success' | 'warning';\n\ninterface ConfirmDialogProps {\n isOpen: boolean;\n onClose: () => void;\n onConfirm: () => void;\n title: string;\n message: string;\n confirmText?: string;\n cancelText?: string;\n variant?: ConfirmVariant;\n loading?: boolean;\n showCheckbox?: boolean;\n checkboxLabel?: string;\n onCheckboxChange?: (checked: boolean) => void;\n}\n\nconst ConfirmDialog: React.FC<ConfirmDialogProps> = ({\n isOpen,\n onClose,\n onConfirm,\n title,\n message,\n confirmText = 'Confirm',\n cancelText = 'Cancel',\n variant = 'primary',\n loading = false,\n showCheckbox = false,\n checkboxLabel = \"Don't show this again\",\n onCheckboxChange,\n}) => {\n const variantConfig = {\n danger: {\n icon: AlertTriangle,\n iconBg: 'bg-error/10',\n iconColor: 'text-error',\n buttonBg: 'bg-error hover:bg-error/90',\n buttonText: 'text-white',\n ring: 'ring-error/20',\n },\n primary: {\n icon: Info,\n iconBg: 'bg-primary/10',\n iconColor: 'text-primary',\n buttonBg: 'bg-primary hover:bg-primary/90',\n buttonText: 'text-on-primary',\n ring: 'ring-primary/20',\n },\n success: {\n icon: CheckCircle2,\n iconBg: 'bg-secondary/10',\n iconColor: 'text-secondary',\n buttonBg: 'bg-secondary hover:bg-secondary/90',\n buttonText: 'text-surface',\n ring: 'ring-secondary/20',\n },\n warning: {\n icon: AlertTriangle,\n iconBg: 'bg-tertiary/10', // using tertiary for warning style\n iconColor: 'text-tertiary',\n buttonBg: 'bg-tertiary hover:bg-tertiary/90',\n buttonText: 'text-surface',\n ring: 'ring-tertiary/20',\n },\n };\n\n const config = variantConfig[variant];\n const Icon = config.icon;\n\n if (!isOpen) return null;\n\n return (\n <AnimatePresence>\n <div className=\"fixed inset-0 z-[200] flex items-center justify-center p-4\">\n {/* Backdrop */}\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n onClick={onClose}\n className=\"absolute inset-0 bg-surface/60 backdrop-blur-md\"\n />\n\n {/* Dialog Container */}\n <motion.div\n initial={{ opacity: 0, scale: 0.95, y: 10 }}\n animate={{ opacity: 1, scale: 1, y: 0 }}\n exit={{ opacity: 0, scale: 0.95, y: 10 }}\n className=\"relative w-full max-w-md bg-surface-container-low rounded-2xl shadow-2xl overflow-hidden ring-1 ring-outline-variant/10 p-6 flex flex-col gap-6\"\n >\n <div className=\"flex gap-4\">\n <div className={`w-12 h-12 rounded-xl flex-shrink-0 flex items-center justify-center ${config.iconBg} ${config.iconColor}`}>\n <Icon size={24} />\n </div>\n <div className=\"flex-1 min-w-0\">\n <h3 className=\"text-xl font-black font-headline text-white tracking-tight mb-2\">\n {title}\n </h3>\n <p className=\"text-sm text-on-surface-variant leading-relaxed\">\n {message}\n </p>\n </div>\n <button \n onClick={onClose}\n className=\"text-on-surface-variant hover:text-white transition-colors h-fit p-1\"\n >\n <X size={20} />\n </button>\n </div>\n \n {showCheckbox && (\n <div className=\"flex items-center gap-3 px-1 mt-[-12px]\">\n <label className=\"flex items-center gap-3 cursor-pointer group\">\n <div className=\"relative flex items-center\">\n <input \n type=\"checkbox\" \n onChange={(e) => onCheckboxChange?.(e.target.checked)}\n className=\"peer appearance-none w-5 h-5 rounded border border-outline-variant/30 bg-surface-container-highest checked:bg-primary checked:border-primary transition-all cursor-pointer\"\n />\n <CheckCircle2 size={14} className=\"absolute inset-0 m-auto text-on-primary opacity-0 peer-checked:opacity-100 transition-opacity pointer-events-none\" />\n </div>\n <span className=\"text-xs font-bold text-on-surface-variant group-hover:text-white transition-colors uppercase tracking-wider\">\n {checkboxLabel}\n </span>\n </label>\n </div>\n )}\n\n <div className=\"flex items-center justify-end gap-3 mt-2\">\n <button\n onClick={onClose}\n disabled={loading}\n className=\"px-5 py-2.5 rounded-lg text-sm font-bold text-on-surface-variant hover:text-white hover:bg-surface-container-highest transition-all disabled:opacity-50\"\n >\n {cancelText}\n </button>\n <button\n onClick={onConfirm}\n disabled={loading}\n className={`px-6 py-2.5 rounded-lg text-sm font-bold shadow-lg transition-all ${config.buttonBg} ${config.buttonText} ${config.ring} hover:scale-[1.02] active:scale-[0.98] disabled:opacity-50 disabled:grayscale disabled:cursor-not-allowed`}\n >\n {loading ? 'Processing...' : confirmText}\n </button>\n </div>\n </motion.div>\n </div>\n </AnimatePresence>\n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AG,EAAO,WAAW,GAAG,EAAO,KAAK,qHAEnI,EAAU,gBAAkB,EACtB,CAAA,CACL,GACK,GACT,GACU,CAAA,CA7EA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{g as t}from"./vendor-dnd-CxfOy4-Z.js";import{r as n}from"./vendor-markdown-Dl_1qnne.js";import{o as r}from"./useNotification-DK-pV16c.js";var i=r(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),a=e(t(),1),o=n(),s=[`#6366f1`,`#8b5cf6`,`#a855f7`,`#d946ef`,`#ec4899`,`#f43f5e`,`#ef4444`,`#f97316`,`#eab308`,`#84cc16`,`#22c55e`,`#14b8a6`,`#06b6d4`,`#0ea5e9`,`#3b82f6`,`#6d28d9`];function c(e){let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return Math.abs(t)}var l=({name:e,size:t=40,className:n=``})=>{let r=(0,a.useMemo)(()=>{let t=e.trim().split(/\s+/);return t.length>=2?(t[0][0]+t[t.length-1][0]).toUpperCase():(t[0]?.[0]??`U`).toUpperCase()},[e]),i=(0,a.useMemo)(()=>s[c(e)%s.length],[e]);return(0,o.jsx)(`div`,{role:`img`,"aria-label":`${e} avatar`,className:`inline-flex items-center justify-center rounded-full text-white font-bold select-none shrink-0 ${n}`,style:{width:t,height:t,backgroundColor:i,fontSize:t*.38},children:r})};export{i as n,l as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InitialsAvatar-0mIRaTK8.js","names":[],"sources":["../../node_modules/lucide-react/dist/esm/icons/file-text.js","../../src/components/InitialsAvatar.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.577.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\",\n key: \"1oefj6\"\n }\n ],\n [\"path\", { d: \"M14 2v5a1 1 0 0 0 1 1h5\", key: \"wfsgrz\" }],\n [\"path\", { d: \"M10 9H8\", key: \"b1mrlr\" }],\n [\"path\", { d: \"M16 13H8\", key: \"t4e002\" }],\n [\"path\", { d: \"M16 17H8\", key: \"z1uh3a\" }]\n];\nconst FileText = createLucideIcon(\"file-text\", __iconNode);\n\nexport { __iconNode, FileText as default };\n//# sourceMappingURL=file-text.js.map\n","import React, { useMemo } from 'react';\n\ninterface InitialsAvatarProps {\n name: string;\n size?: number;\n className?: string;\n}\n\nconst palette = [\n '#6366f1', '#8b5cf6', '#a855f7', '#d946ef',\n '#ec4899', '#f43f5e', '#ef4444', '#f97316',\n '#eab308', '#84cc16', '#22c55e', '#14b8a6',\n '#06b6d4', '#0ea5e9', '#3b82f6', '#6d28d9',\n];\n\nfunction hashCode(str: string): number {\n let hash = 0;\n for (let i = 0; i < str.length; i++) {\n hash = str.charCodeAt(i) + ((hash << 5) - hash);\n }\n return Math.abs(hash);\n}\n\nconst InitialsAvatar: React.FC<InitialsAvatarProps> = ({ name, size = 40, className = '' }) => {\n const initials = useMemo(() => {\n const parts = name.trim().split(/\\s+/);\n if (parts.length >= 2) {\n return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase();\n }\n return (parts[0]?.[0] ?? 'U').toUpperCase();\n }, [name]);\n\n const bg = useMemo(() => palette[hashCode(name) % palette.length], [name]);\n\n return (\n <div\n role=\"img\"\n aria-label={`${name} avatar`}\n className={`inline-flex items-center justify-center rounded-full text-white font-bold select-none shrink-0 ${className}`}\n style={{ width: size, height: size, backgroundColor: bg, fontSize: size * 0.38 }}\n >\n {initials}\n </div>\n );\n};\n\nexport default InitialsAvatar;\n"],"x_google_ignoreList":[0],"mappings":"oMAsBA,IAAM,EAAW,EAAiB,YAbf,CACjB,CACE,OACA,CACE,EAAG,iHACH,IAAK,SACN,CACF,CACD,CAAC,OAAQ,CAAE,EAAG,0BAA2B,IAAK,SAAU,CAAC,CACzD,CAAC,OAAQ,CAAE,EAAG,UAAW,IAAK,SAAU,CAAC,CACzC,CAAC,OAAQ,CAAE,EAAG,WAAY,IAAK,SAAU,CAAC,CAC1C,CAAC,OAAQ,CAAE,EAAG,WAAY,IAAK,SAAU,CAAC,CAC3C,CACyD,kBCdpD,EAAU,CACd,UAAW,UAAW,UAAW,UACjC,UAAW,UAAW,UAAW,UACjC,UAAW,UAAW,UAAW,UACjC,UAAW,UAAW,UAAW,UAClC,CAED,SAAS,EAAS,EAAqB,CACrC,IAAI,EAAO,EACX,IAAK,IAAI,EAAI,EAAG,EAAI,EAAI,OAAQ,IAC9B,EAAO,EAAI,WAAW,EAAE,GAAK,GAAQ,GAAK,GAE5C,OAAO,KAAK,IAAI,EAAK,CAGvB,IAAM,GAAiD,CAAE,OAAM,OAAO,GAAI,YAAY,MAAS,CAC7F,IAAM,GAAA,EAAA,EAAA,aAAyB,CAC7B,IAAM,EAAQ,EAAK,MAAM,CAAC,MAAM,MAAM,CAItC,OAHI,EAAM,QAAU,GACV,EAAM,GAAG,GAAK,EAAM,EAAM,OAAS,GAAG,IAAI,aAAa,EAEzD,EAAM,KAAK,IAAM,KAAK,aAAa,EAC1C,CAAC,EAAK,CAAC,CAEJ,GAAA,EAAA,EAAA,aAAmB,EAAQ,EAAS,EAAK,CAAG,EAAQ,QAAS,CAAC,EAAK,CAAC,CAE1E,OACE,EAAA,EAAA,KAAC,MAAD,CACE,KAAK,MACL,aAAY,GAAG,EAAK,SACpB,UAAW,kGAAkG,IAC7G,MAAO,CAAE,MAAO,EAAM,OAAQ,EAAM,gBAAiB,EAAI,SAAU,EAAO,IAAM,UAE/E,EACG,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{g as t}from"./vendor-dnd-CxfOy4-Z.js";import{n,r,t as i}from"./vendor-markdown-Dl_1qnne.js";import{n as a,t as o}from"./sparkles-CCXaTT3H.js";import{t as s}from"./eye-RB18-re_.js";var c=e(t(),1),l=r(),u=({label:e,value:t,onChange:r,placeholder:u,height:d=`h-40`,helperText:f,maxLength:p,onKeyDown:m,initialMode:h=`write`})=>{let[g,_]=(0,c.useState)(h);return(0,l.jsxs)(`div`,{className:`space-y-3`,children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between`,children:[e&&(0,l.jsx)(`label`,{className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60`,children:e}),(0,l.jsxs)(`div`,{className:`flex items-center gap-1 bg-surface-container-high/50 p-1 rounded-lg ring-1 ring-outline-variant/10`,children:[(0,l.jsxs)(`button`,{onClick:()=>_(`write`),className:`flex items-center gap-1.5 px-3 py-1 rounded-md text-[9px] font-black tracking-widest uppercase transition-all ${g===`write`?`bg-primary text-surface shadow-lg shadow-primary/20`:`text-on-surface-variant/60 hover:text-white`}`,children:[(0,l.jsx)(a,{size:12}),`Write`]}),(0,l.jsxs)(`button`,{onClick:()=>_(`preview`),className:`flex items-center gap-1.5 px-3 py-1 rounded-md text-[9px] font-black tracking-widest uppercase transition-all ${g===`preview`?`bg-secondary text-surface shadow-lg shadow-secondary/20`:`text-on-surface-variant/60 hover:text-white`}`,children:[(0,l.jsx)(s,{size:12}),`Preview`]})]})]}),(0,l.jsx)(`div`,{className:`relative group bg-surface-container-highest/30 rounded-lg ring-1 ring-outline-variant/10 focus-within:ring-primary/40 transition-all ${d} overflow-hidden`,children:g===`write`?(0,l.jsx)(`textarea`,{value:t,onChange:e=>r(e.target.value),onKeyDown:m,placeholder:u,maxLength:p,className:`w-full h-full bg-transparent border-none text-xs text-on-surface p-4 focus:outline-none placeholder:text-on-surface-variant/30 resize-none leading-relaxed font-mono`}):(0,l.jsx)(`div`,{className:`w-full h-full p-4 overflow-y-auto custom-scrollbar prose prose-invert prose-xs max-w-none`,children:(0,l.jsx)(n,{remarkPlugins:[i],children:t||`*Nothing to preview*`})})}),(0,l.jsxs)(`div`,{className:`flex items-center justify-between`,children:[f?(0,l.jsxs)(`div`,{className:`flex items-center gap-1.5 px-1 py-0.5 rounded bg-tertiary/10 text-[9px] font-black text-tertiary tracking-widest uppercase w-fit`,children:[(0,l.jsx)(o,{size:10}),f]}):(0,l.jsx)(`div`,{}),p&&(0,l.jsxs)(`div`,{className:`text-[10px] font-bold text-on-surface-variant/40 lowercase tracking-widest`,children:[t.length,` / `,p]})]})]})};export{u as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkdownField-flCuU7w3.js","names":[],"sources":["../../src/components/MarkdownField.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport ReactMarkdown from 'react-markdown';\nimport remarkGfm from 'remark-gfm';\nimport { Eye, Code as CodeIcon, Sparkles } from 'lucide-react';\n\ninterface MarkdownFieldProps {\n label?: string;\n value: string;\n onChange: (value: string) => void;\n placeholder?: string;\n height?: string;\n helperText?: string;\n maxLength?: number;\n onKeyDown?: (e: React.KeyboardEvent) => void;\n initialMode?: 'write' | 'preview';\n}\n\nconst MarkdownField: React.FC<MarkdownFieldProps> = ({ \n label, \n value, \n onChange, \n placeholder, \n height = 'h-40',\n helperText,\n maxLength,\n onKeyDown,\n initialMode = 'write'\n}) => {\n const [mode, setMode] = useState<'write' | 'preview'>(initialMode);\n\n return (\n <div className=\"space-y-3\">\n <div className=\"flex items-center justify-between\">\n {label && (\n <label className=\"text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60\">\n {label}\n </label>\n )}\n <div className=\"flex items-center gap-1 bg-surface-container-high/50 p-1 rounded-lg ring-1 ring-outline-variant/10\">\n <button\n onClick={() => setMode('write')}\n className={`flex items-center gap-1.5 px-3 py-1 rounded-md text-[9px] font-black tracking-widest uppercase transition-all ${\n mode === 'write' \n ? 'bg-primary text-surface shadow-lg shadow-primary/20' \n : 'text-on-surface-variant/60 hover:text-white'\n }`}\n >\n <CodeIcon size={12} />\n Write\n </button>\n <button\n onClick={() => setMode('preview')}\n className={`flex items-center gap-1.5 px-3 py-1 rounded-md text-[9px] font-black tracking-widest uppercase transition-all ${\n mode === 'preview' \n ? 'bg-secondary text-surface shadow-lg shadow-secondary/20' \n : 'text-on-surface-variant/60 hover:text-white'\n }`}\n >\n <Eye size={12} />\n Preview\n </button>\n </div>\n </div>\n\n <div className={`relative group bg-surface-container-highest/30 rounded-lg ring-1 ring-outline-variant/10 focus-within:ring-primary/40 transition-all ${height} overflow-hidden`}>\n {mode === 'write' ? (\n <textarea\n value={value}\n onChange={(e) => onChange(e.target.value)}\n onKeyDown={onKeyDown}\n placeholder={placeholder}\n maxLength={maxLength}\n className=\"w-full h-full bg-transparent border-none text-xs text-on-surface p-4 focus:outline-none placeholder:text-on-surface-variant/30 resize-none leading-relaxed font-mono\"\n />\n ) : (\n <div className=\"w-full h-full p-4 overflow-y-auto custom-scrollbar prose prose-invert prose-xs max-w-none\">\n <ReactMarkdown remarkPlugins={[remarkGfm]}>\n {value || '*Nothing to preview*'}\n </ReactMarkdown>\n </div>\n )}\n </div>\n\n <div className=\"flex items-center justify-between\">\n {helperText ? (\n <div className=\"flex items-center gap-1.5 px-1 py-0.5 rounded bg-tertiary/10 text-[9px] font-black text-tertiary tracking-widest uppercase w-fit\">\n <Sparkles size={10} />\n {helperText}\n </div>\n ) : <div />}\n \n {maxLength && (\n <div className=\"text-[10px] font-bold text-on-surface-variant/40 lowercase tracking-widest\">\n {value.length} / {maxLength}\n </div>\n )}\n </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EAAA,KAAC,MAAD,EAAO,CAAA,CAEV,IACC,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,sFAAf,CACG,EAAM,OAAO,MAAI,EACd,GAEJ,GACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{g as t}from"./vendor-dnd-CxfOy4-Z.js";import{c as n,s as r}from"./vendor-react-CiDbU5Ns.js";import{r as i}from"./vendor-markdown-Dl_1qnne.js";import{o as a,t as o}from"./useNotification-DK-pV16c.js";import{t as s}from"./sparkles-CCXaTT3H.js";import{t as c}from"./layers-D5ECV506.js";import{n as l,t as u}from"./shield-check-D7JIluse.js";import{t as d}from"./trash-2-BNP4kC5c.js";import{t as f}from"./user-Cp55HCCi.js";import{_ as p,g as m,i as h,n as g,o as _,r as v}from"./index-yzhzS93F.js";import{t as y}from"./MarkdownField-flCuU7w3.js";var b=a(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),x=e(t(),1),S=i(),C=()=>{let{projectId:e}=n(),t=r(),{notifySuccess:i,notifyApiError:a}=o(),{refreshProjects:C}=_(),[w,T]=(0,x.useState)(null),[E,D]=(0,x.useState)([]),[O,k]=(0,x.useState)(!0),[A,j]=(0,x.useState)(!1),[M,N]=(0,x.useState)(``),[P,F]=(0,x.useState)(``),[I,L]=(0,x.useState)(v.PLANNING),[R,z]=(0,x.useState)(``),B=(0,x.useCallback)(async()=>{try{k(!0);let[t,n]=await Promise.all([h.findOne(e),g.findAll()]),r=t.data;T(r),D(n.data),N(r.title),F(r.description||``),L(r.status||v.PLANNING),z(r.ownerAgent?.id||``)}catch(e){console.error(`Failed to load project details:`,e),a(e,`Fetch Error`)}finally{k(!1)}},[e,a]);return(0,x.useEffect)(()=>{e&&B()},[e,B]),O?(0,S.jsx)(`div`,{className:`flex items-center justify-center h-full min-h-[50vh]`,children:(0,S.jsx)(`div`,{className:`w-8 h-8 rounded-full border-4 border border-outline-variant/30 border-t-primary animate-spin`})}):w?(0,S.jsxs)(`div`,{className:`space-y-10 animate-in fade-in slide-in-from-bottom-4 duration-700`,children:[(0,S.jsxs)(`div`,{className:`flex flex-col md:flex-row justify-between items-start md:items-center gap-6`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-5`,children:[(0,S.jsx)(`button`,{onClick:()=>t(`/`),className:`w-12 h-12 rounded-2xl bg-surface-container-high border border-outline-variant/10 flex items-center justify-center text-on-surface-variant hover:text-white hover:bg-surface-container-highest transition-all group`,children:(0,S.jsx)(b,{size:20,className:`group-hover:-translate-x-1 transition-transform`})}),(0,S.jsxs)(`div`,{children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,S.jsx)(`div`,{className:`w-6 h-6 rounded-lg bg-secondary/20 flex items-center justify-center text-secondary`,children:(0,S.jsx)(p,{size:12})}),(0,S.jsx)(`span`,{className:`text-[10px] font-black uppercase tracking-[0.3em] text-on-surface-variant`,children:`Strategic Sector Console`})]}),(0,S.jsx)(`h1`,{className:`text-3xl font-black font-headline text-white tracking-tight -mt-1`,children:w.title})]})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-3 w-full md:w-auto`,children:[(0,S.jsxs)(`button`,{className:`flex-1 md:flex-initial px-6 py-3 rounded-2xl bg-surface-container-high text-on-article-variant font-bold text-sm flex items-center justify-center gap-2 hover:bg-error/10 hover:text-error transition-all ring-1 ring-outline-variant/10 border-none`,children:[(0,S.jsx)(d,{size:18}),`Decommission Sector`]}),(0,S.jsxs)(`button`,{onClick:async()=>{if(e)try{j(!0),await h.update(e,{title:M,description:P||void 0,status:I,ownerAgentId:R||null}),await C(),i(`Protocol Synchronized`,`Sector configurations have been updated`)}catch(e){console.error(`Failed to update project:`,e),a(e,`Sync Error`)}finally{j(!1)}},disabled:A,className:`flex-1 md:flex-initial px-8 py-3 rounded-2xl bg-primary text-surface font-black text-sm flex items-center justify-center gap-2 hover:scale-[1.02] active:scale-[0.98] transition-all shadow-lg shadow-primary/20 disabled:grayscale disabled:opacity-50`,children:[A?(0,S.jsx)(`div`,{className:`w-5 h-5 border-2 border-surface/30 border-t-surface rounded-full animate-spin`}):(0,S.jsx)(l,{size:18}),`Synchronize Parameters`]})]})]}),(0,S.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-3 gap-8`,children:[(0,S.jsx)(`div`,{className:`lg:col-span-2 space-y-8`,children:(0,S.jsxs)(`section`,{className:`bg-surface-container-low rounded-3xl border border-outline-variant/10 overflow-hidden shadow-2xl`,children:[(0,S.jsxs)(`div`,{className:`px-8 py-6 border-b border-outline-variant/5 flex items-center gap-3`,children:[(0,S.jsx)(c,{size:18,className:`text-primary`}),(0,S.jsx)(`h3`,{className:`text-sm font-black uppercase tracking-widest text-on-surface`,children:`Sector Parameters`})]}),(0,S.jsxs)(`div`,{className:`p-8 space-y-8`,children:[(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(`label`,{className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60 ml-1 italic`,children:`Identification Tag`}),(0,S.jsx)(`div`,{className:`bg-surface-container-highest/30 rounded-2xl p-0.5 ring-1 ring-outline-variant/10 focus-within:ring-primary/40 focus-within:bg-surface-container-highest/50 transition-all`,children:(0,S.jsx)(`input`,{type:`text`,value:M,onChange:e=>N(e.target.value),className:`w-full bg-transparent border-none text-base text-on-surface h-14 px-5 focus:outline-none font-bold`})})]}),(0,S.jsx)(`div`,{className:`space-y-2`,children:(0,S.jsx)(y,{label:`Operational Directives`,value:P,onChange:F,height:`h-64`,maxLength:5e3,placeholder:`Enter strategic goals, scope, and specific node instructions...`})})]})]})}),(0,S.jsxs)(`div`,{className:`space-y-8`,children:[(0,S.jsxs)(`section`,{className:`bg-surface-container-low rounded-3xl border border-outline-variant/10 p-8 space-y-6 shadow-2xl`,children:[(0,S.jsxs)(`div`,{className:`space-y-4`,children:[(0,S.jsxs)(`label`,{className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60 flex items-center gap-2`,children:[(0,S.jsx)(u,{size:14,className:`text-secondary`}),`Operational Protocol`]}),(0,S.jsx)(`div`,{className:`grid grid-cols-1 gap-2`,children:Object.values(v).map(e=>(0,S.jsx)(`button`,{onClick:()=>L(e),className:`px-4 py-3 rounded-xl border text-[11px] font-black uppercase tracking-widest transition-all text-left ${I===e?`bg-secondary/10 border-secondary text-secondary shadow-lg shadow-secondary/5`:`bg-surface-container-high/30 border-outline-variant/5 text-on-surface-variant/60 hover:bg-surface-container-high/60`}`,children:(0,S.jsxs)(`div`,{className:`flex items-center justify-between`,children:[e.replace(`_`,` `),I===e&&(0,S.jsx)(`div`,{className:`w-2 h-2 rounded-full bg-secondary animate-pulse`})]})},e))})]}),(0,S.jsxs)(`div`,{className:`pt-6 border-t border-outline-variant/5 space-y-4`,children:[(0,S.jsxs)(`label`,{className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60 flex items-center gap-2`,children:[(0,S.jsx)(f,{size:14,className:`text-primary`}),`Designated Sector Lead`]}),(0,S.jsxs)(`div`,{className:`bg-surface-container-high/30 rounded-2xl p-0.5 ring-1 ring-outline-variant/10 transition-all relative`,children:[(0,S.jsxs)(`select`,{value:R,onChange:e=>z(e.target.value),className:`w-full bg-transparent border-none text-[11px] font-bold text-on-surface h-12 px-5 focus:outline-none appearance-none cursor-pointer`,children:[(0,S.jsx)(`option`,{value:``,className:`bg-surface-container-low text-on-surface uppercase`,children:`Unassigned Protocol Lead`}),E.map(e=>(0,S.jsx)(`option`,{value:e.id,className:`bg-surface-container-low text-on-surface font-bold uppercase tracking-tight`,children:e.name},e.id))]}),(0,S.jsx)(`div`,{className:`absolute right-4 top-1/2 -translate-y-1/2 pointer-events-none text-on-surface-variant/60`,children:(0,S.jsx)(m,{size:14})})]}),(0,S.jsx)(`p`,{className:`px-1 text-[11px] text-on-surface-variant/70 italic leading-relaxed`,children:`*The Sector Lead will oversee autonomous reasoning and token allocation for this operational branch.`})]})]}),(0,S.jsxs)(`div`,{className:`px-8 py-10 rounded-3xl bg-surface-container-low/30 border border-dashed border-outline-variant/10 flex flex-col items-center justify-center text-center`,children:[(0,S.jsx)(`div`,{className:`w-12 h-12 rounded-full bg-surface-container-high flex items-center justify-center text-on-surface-variant/20 mb-4 animate-pulse`,children:(0,S.jsx)(s,{size:24})}),(0,S.jsx)(`p`,{className:`text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60 max-w-[180px]`,children:`Statistical insight logs will be synchronized here`})]})]})]})]}):(0,S.jsxs)(`div`,{className:`p-8 text-center bg-surface-container-low rounded-3xl border border-outline-variant/10 max-w-lg mx-auto mt-20`,children:[(0,S.jsx)(`h2`,{className:`text-xl font-black text-white mb-4`,children:`Sector Not Found`}),(0,S.jsx)(`button`,{onClick:()=>t(`/`),className:`bg-primary text-surface px-6 py-2 rounded-lg font-bold hover:scale-105 transition-all`,children:`Return to Hub`})]})};export{C as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProjectDetail-CY-VSV2D.js","names":[],"sources":["../../node_modules/lucide-react/dist/esm/icons/arrow-left.js","../../src/pages/ProjectDetail.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.577.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"m12 19-7-7 7-7\", key: \"1l729n\" }],\n [\"path\", { d: \"M19 12H5\", key: \"x3x0zl\" }]\n];\nconst ArrowLeft = createLucideIcon(\"arrow-left\", __iconNode);\n\nexport { __iconNode, ArrowLeft as default };\n//# sourceMappingURL=arrow-left.js.map\n","import React, { useState, useEffect, useCallback } from 'react';\nimport { useParams, useNavigate } from 'react-router-dom';\nimport { \n Briefcase, \n ArrowLeft, \n Save, \n Trash2, \n User, \n Layers,\n Sparkles,\n ShieldCheck,\n ChevronDown\n} from 'lucide-react';\nimport { projectsApi, type Project, ProjectStatus } from '../api/projects';\nimport { agentsApi, type Agent } from '../api/agents';\nimport { useNotification } from '../hooks/useNotification';\nimport { useProject } from '../hooks/useProject';\nimport MarkdownField from '../components/MarkdownField';\n\nconst ProjectDetail: React.FC = () => {\n const { projectId } = useParams<{ projectId: string }>();\n const navigate = useNavigate();\n const { notifySuccess, notifyApiError } = useNotification();\n const { refreshProjects } = useProject();\n\n const [project, setProject] = useState<Project | null>(null);\n const [agents, setAgents] = useState<Agent[]>([]);\n const [loading, setLoading] = useState(true);\n const [saving, setSaving] = useState(false);\n\n // Form State\n const [title, setTitle] = useState('');\n const [description, setDescription] = useState('');\n const [status, setStatus] = useState<ProjectStatus>(ProjectStatus.PLANNING);\n const [ownerAgentId, setOwnerAgentId] = useState<string>('');\n\n const loadData = useCallback(async () => {\n try {\n setLoading(true);\n const [projRes, agentsRes] = await Promise.all([\n projectsApi.findOne(projectId!),\n agentsApi.findAll()\n ]);\n \n const p = projRes.data;\n setProject(p);\n setAgents(agentsRes.data);\n \n // Initialize form\n setTitle(p.title);\n setDescription(p.description || '');\n setStatus(p.status || ProjectStatus.PLANNING);\n setOwnerAgentId(p.ownerAgent?.id || '');\n } catch (error) {\n console.error('Failed to load project details:', error);\n notifyApiError(error, 'Fetch Error');\n } finally {\n setLoading(false);\n }\n }, [projectId, notifyApiError]);\n\n useEffect(() => {\n if (projectId) {\n loadData();\n }\n }, [projectId, loadData]);\n\n const handleSave = async () => {\n if (!projectId) return;\n \n try {\n setSaving(true);\n await projectsApi.update(projectId, {\n title,\n description: description || undefined,\n status,\n ownerAgentId: ownerAgentId || null\n });\n \n await refreshProjects();\n notifySuccess('Protocol Synchronized', 'Sector configurations have been updated');\n } catch (error) {\n console.error('Failed to update project:', error);\n notifyApiError(error, 'Sync Error');\n } finally {\n setSaving(false);\n }\n };\n\n if (loading) {\n return (\n <div className=\"flex items-center justify-center h-full min-h-[50vh]\">\n <div className=\"w-8 h-8 rounded-full border-4 border border-outline-variant/30 border-t-primary animate-spin\"></div>\n </div>\n );\n }\n\n if (!project) {\n return (\n <div className=\"p-8 text-center bg-surface-container-low rounded-3xl border border-outline-variant/10 max-w-lg mx-auto mt-20\">\n <h2 className=\"text-xl font-black text-white mb-4\">Sector Not Found</h2>\n <button \n onClick={() => navigate('/')}\n className=\"bg-primary text-surface px-6 py-2 rounded-lg font-bold hover:scale-105 transition-all\"\n >\n Return to Hub\n </button>\n </div>\n );\n }\n\n return (\n <div className=\"space-y-10 animate-in fade-in slide-in-from-bottom-4 duration-700\">\n {/* Page Header */}\n <div className=\"flex flex-col md:flex-row justify-between items-start md:items-center gap-6\">\n <div className=\"flex items-center gap-5\">\n <button \n onClick={() => navigate('/')}\n className=\"w-12 h-12 rounded-2xl bg-surface-container-high border border-outline-variant/10 flex items-center justify-center text-on-surface-variant hover:text-white hover:bg-surface-container-highest transition-all group\"\n >\n <ArrowLeft size={20} className=\"group-hover:-translate-x-1 transition-transform\" />\n </button>\n <div>\n <div className=\"flex items-center gap-2 mb-1\">\n <div className=\"w-6 h-6 rounded-lg bg-secondary/20 flex items-center justify-center text-secondary\">\n <Briefcase size={12} />\n </div>\n <span className=\"text-[10px] font-black uppercase tracking-[0.3em] text-on-surface-variant\">Strategic Sector Console</span>\n </div>\n <h1 className=\"text-3xl font-black font-headline text-white tracking-tight -mt-1\">{project.title}</h1>\n </div>\n </div>\n\n <div className=\"flex items-center gap-3 w-full md:w-auto\">\n <button \n className=\"flex-1 md:flex-initial px-6 py-3 rounded-2xl bg-surface-container-high text-on-article-variant font-bold text-sm flex items-center justify-center gap-2 hover:bg-error/10 hover:text-error transition-all ring-1 ring-outline-variant/10 border-none\"\n >\n <Trash2 size={18} />\n Decommission Sector\n </button>\n <button \n onClick={handleSave}\n disabled={saving}\n className=\"flex-1 md:flex-initial px-8 py-3 rounded-2xl bg-primary text-surface font-black text-sm flex items-center justify-center gap-2 hover:scale-[1.02] active:scale-[0.98] transition-all shadow-lg shadow-primary/20 disabled:grayscale disabled:opacity-50\"\n >\n {saving ? <div className=\"w-5 h-5 border-2 border-surface/30 border-t-surface rounded-full animate-spin\" /> : <Save size={18} />}\n Synchronize Parameters\n </button>\n </div>\n </div>\n\n <div className=\"grid grid-cols-1 lg:grid-cols-3 gap-8\">\n {/* Left Column - Core Config */}\n <div className=\"lg:col-span-2 space-y-8\">\n <section className=\"bg-surface-container-low rounded-3xl border border-outline-variant/10 overflow-hidden shadow-2xl\">\n <div className=\"px-8 py-6 border-b border-outline-variant/5 flex items-center gap-3\">\n <Layers size={18} className=\"text-primary\" />\n <h3 className=\"text-sm font-black uppercase tracking-widest text-on-surface\">Sector Parameters</h3>\n </div>\n <div className=\"p-8 space-y-8\">\n <div className=\"space-y-2\">\n <label className=\"text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60 ml-1 italic\">Identification Tag</label>\n <div className=\"bg-surface-container-highest/30 rounded-2xl p-0.5 ring-1 ring-outline-variant/10 focus-within:ring-primary/40 focus-within:bg-surface-container-highest/50 transition-all\">\n <input\n type=\"text\"\n value={title}\n onChange={(e) => setTitle(e.target.value)}\n className=\"w-full bg-transparent border-none text-base text-on-surface h-14 px-5 focus:outline-none font-bold\"\n />\n </div>\n </div>\n\n <div className=\"space-y-2\">\n <MarkdownField\n label=\"Operational Directives\"\n value={description}\n onChange={setDescription}\n height=\"h-64\"\n maxLength={5000}\n placeholder=\"Enter strategic goals, scope, and specific node instructions...\"\n />\n </div>\n </div>\n </section>\n </div>\n\n {/* Right Column - Status & Personnel */}\n <div className=\"space-y-8\">\n {/* Status Block */}\n <section className=\"bg-surface-container-low rounded-3xl border border-outline-variant/10 p-8 space-y-6 shadow-2xl\">\n <div className=\"space-y-4\">\n <label className=\"text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60 flex items-center gap-2\">\n <ShieldCheck size={14} className=\"text-secondary\" />\n Operational Protocol\n </label>\n <div className=\"grid grid-cols-1 gap-2\">\n {Object.values(ProjectStatus).map((s) => (\n <button\n key={s}\n onClick={() => setStatus(s)}\n className={`px-4 py-3 rounded-xl border text-[11px] font-black uppercase tracking-widest transition-all text-left ${status === s \n ? 'bg-secondary/10 border-secondary text-secondary shadow-lg shadow-secondary/5' \n : 'bg-surface-container-high/30 border-outline-variant/5 text-on-surface-variant/60 hover:bg-surface-container-high/60'\n }`}\n >\n <div className=\"flex items-center justify-between\">\n {s.replace('_', ' ')}\n {status === s && <div className=\"w-2 h-2 rounded-full bg-secondary animate-pulse\" />}\n </div>\n </button>\n ))}\n </div>\n </div>\n\n <div className=\"pt-6 border-t border-outline-variant/5 space-y-4\">\n <label className=\"text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60 flex items-center gap-2\">\n <User size={14} className=\"text-primary\" />\n Designated Sector Lead\n </label>\n <div className=\"bg-surface-container-high/30 rounded-2xl p-0.5 ring-1 ring-outline-variant/10 transition-all relative\">\n <select \n value={ownerAgentId}\n onChange={(e) => setOwnerAgentId(e.target.value)}\n className=\"w-full bg-transparent border-none text-[11px] font-bold text-on-surface h-12 px-5 focus:outline-none appearance-none cursor-pointer\"\n >\n <option value=\"\" className=\"bg-surface-container-low text-on-surface uppercase\">Unassigned Protocol Lead</option>\n {agents.map((agent) => (\n <option key={agent.id} value={agent.id} className=\"bg-surface-container-low text-on-surface font-bold uppercase tracking-tight\">{agent.name}</option>\n ))}\n </select>\n <div className=\"absolute right-4 top-1/2 -translate-y-1/2 pointer-events-none text-on-surface-variant/60\">\n <ChevronDown size={14} />\n </div>\n </div>\n <p className=\"px-1 text-[11px] text-on-surface-variant/70 italic leading-relaxed\">\n *The Sector Lead will oversee autonomous reasoning and token allocation for this operational branch.\n </p>\n </div>\n </section>\n\n {/* Activity Placeholder */}\n <div className=\"px-8 py-10 rounded-3xl bg-surface-container-low/30 border border-dashed border-outline-variant/10 flex flex-col items-center justify-center text-center\">\n <div className=\"w-12 h-12 rounded-full bg-surface-container-high flex items-center justify-center text-on-surface-variant/20 mb-4 animate-pulse\">\n <Sparkles size={24} />\n </div>\n <p className=\"text-[10px] font-black uppercase tracking-widest text-on-surface-variant/60 max-w-[180px]\">Statistical insight logs will be synchronized here</p>\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nexport default ProjectDetail;\n"],"x_google_ignoreList":[0],"mappings":"ulBAaA,IAAM,EAAY,EAAiB,aAJhB,CACjB,CAAC,OAAQ,CAAE,EAAG,iBAAkB,IAAK,SAAU,CAAC,CAChD,CAAC,OAAQ,CAAE,EAAG,WAAY,IAAK,SAAU,CAAC,CAC3C,CAC2D,kBCMtD,MAAgC,CACpC,GAAM,CAAE,aAAc,GAAkC,CAClD,EAAW,GAAa,CACxB,CAAE,gBAAe,kBAAmB,GAAiB,CACrD,CAAE,mBAAoB,GAAY,CAElC,CAAC,EAAS,IAAA,EAAA,EAAA,UAAuC,KAAK,CACtD,CAAC,EAAQ,IAAA,EAAA,EAAA,UAA+B,EAAE,CAAC,CAC3C,CAAC,EAAS,IAAA,EAAA,EAAA,UAAuB,GAAK,CACtC,CAAC,EAAQ,IAAA,EAAA,EAAA,UAAsB,GAAM,CAGrC,CAAC,EAAO,IAAA,EAAA,EAAA,UAAqB,GAAG,CAChC,CAAC,EAAa,IAAA,EAAA,EAAA,UAA2B,GAAG,CAC5C,CAAC,EAAQ,IAAA,EAAA,EAAA,UAAqC,EAAc,SAAS,CACrE,CAAC,EAAc,IAAA,EAAA,EAAA,UAAoC,GAAG,CAEtD,GAAA,EAAA,EAAA,aAAuB,SAAY,CACvC,GAAI,CACF,EAAW,GAAK,CAChB,GAAM,CAAC,EAAS,GAAa,MAAM,QAAQ,IAAI,CAC7C,EAAY,QAAQ,EAAW,CAC/B,EAAU,SAAS,CACpB,CAAC,CAEI,EAAI,EAAQ,KAClB,EAAW,EAAE,CACb,EAAU,EAAU,KAAK,CAGzB,EAAS,EAAE,MAAM,CACjB,EAAe,EAAE,aAAe,GAAG,CACnC,EAAU,EAAE,QAAU,EAAc,SAAS,CAC7C,EAAgB,EAAE,YAAY,IAAM,GAAG,OAChC,EAAO,CACd,QAAQ,MAAM,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