agent-relay 1.0.21 → 1.0.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.
@@ -1 +1 @@
1
- <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/50ed6996e3df7bdd.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-c81f7fd28659d64f.js"/><script src="/_next/static/chunks/fd9d1056-26bd8d656b496dba.js" async=""></script><script src="/_next/static/chunks/117-3bef7b19f3e60751.js" async=""></script><script src="/_next/static/chunks/main-app-bae2e535de00de50.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><title>Agent Relay Dashboard</title><meta name="description" content="Fleet control dashboard for Agent Relay"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><script src="/_next/static/chunks/webpack-c81f7fd28659d64f.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/css/50ed6996e3df7bdd.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"2:I[2846,[],\"\"]\n4:I[4707,[],\"\"]\n5:I[6423,[],\"\"]\nb:I[1060,[],\"\"]\n6:{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"}\n7:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\n8:{\"display\":\"inline-block\"}\n9:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\nc:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L2\",null,{\"buildId\":\"gZXwjIKGDKJ0hiTH-HMeJ\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"_not-found\"],\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$L3\",[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null],null],null]},[null,[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/50ed6996e3df7bdd.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"children\":[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$6\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$7\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$8\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$9\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}]}]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],\"$La\"],\"globalErrorComponent\":\"$b\",\"missingSlots\":\"$Wc\"}]\n"])</script><script>self.__next_f.push([1,"a:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Agent Relay Dashboard\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Fleet control dashboard for Agent Relay\"}]]\n3:null\n"])</script></body></html>
1
+ <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/50ed6996e3df7bdd.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-c81f7fd28659d64f.js"/><script src="/_next/static/chunks/fd9d1056-26bd8d656b496dba.js" async=""></script><script src="/_next/static/chunks/117-3bef7b19f3e60751.js" async=""></script><script src="/_next/static/chunks/main-app-bae2e535de00de50.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><title>Agent Relay Dashboard</title><meta name="description" content="Fleet control dashboard for Agent Relay"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><script src="/_next/static/chunks/webpack-c81f7fd28659d64f.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/css/50ed6996e3df7bdd.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"2:I[2846,[],\"\"]\n4:I[4707,[],\"\"]\n5:I[6423,[],\"\"]\nb:I[1060,[],\"\"]\n6:{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"}\n7:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\n8:{\"display\":\"inline-block\"}\n9:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\nc:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L2\",null,{\"buildId\":\"DXFA-jj8wb3PcY5DX2xcU\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"_not-found\"],\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$L3\",[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null],null],null]},[null,[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/50ed6996e3df7bdd.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"children\":[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$6\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$7\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$8\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$9\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}]}]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],\"$La\"],\"globalErrorComponent\":\"$b\",\"missingSlots\":\"$Wc\"}]\n"])</script><script>self.__next_f.push([1,"a:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Agent Relay Dashboard\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Fleet control dashboard for Agent Relay\"}]]\n3:null\n"])</script></body></html>
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{8440:function(e,t,n){Promise.resolve().then(n.bind(n,7666))},7666:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return eD}});var s=n(7437),a=n(2265);let l={backend:{primary:"#1264a3",light:"#e8f4fd",dark:"#0d4f82",text:"#ffffff"},frontend:{primary:"#7c3aed",light:"#f3e8ff",dark:"#5b21b6",text:"#ffffff"},infra:{primary:"#ea580c",light:"#fff7ed",dark:"#c2410c",text:"#ffffff"},lead:{primary:"#2bac76",light:"#ecfdf5",dark:"#059669",text:"#ffffff"},test:{primary:"#0d9488",light:"#f0fdfa",dark:"#0f766e",text:"#ffffff"},data:{primary:"#dc2626",light:"#fef2f2",dark:"#b91c1c",text:"#ffffff"},api:{primary:"#2563eb",light:"#eff6ff",dark:"#1d4ed8",text:"#ffffff"},worker:{primary:"#9333ea",light:"#faf5ff",dark:"#7e22ce",text:"#ffffff"},monitor:{primary:"#0891b2",light:"#ecfeff",dark:"#0e7490",text:"#ffffff"},security:{primary:"#be123c",light:"#fff1f2",dark:"#9f1239",text:"#ffffff"}},r=[{primary:"#6366f1",light:"#eef2ff",dark:"#4f46e5",text:"#ffffff"},{primary:"#ec4899",light:"#fdf2f8",dark:"#db2777",text:"#ffffff"},{primary:"#14b8a6",light:"#f0fdfa",dark:"#0d9488",text:"#ffffff"},{primary:"#f59e0b",light:"#fffbeb",dark:"#d97706",text:"#000000"},{primary:"#8b5cf6",light:"#f5f3ff",dark:"#7c3aed",text:"#ffffff"},{primary:"#06b6d4",light:"#ecfeff",dark:"#0891b2",text:"#ffffff"},{primary:"#f43f5e",light:"#fff1f2",dark:"#e11d48",text:"#ffffff"},{primary:"#84cc16",light:"#f7fee7",dark:"#65a30d",text:"#000000"}],i={online:"#22c55e",offline:"#6b7280",busy:"#eab308",processing:"#6366f1",error:"#ef4444",attention:"#ef4444"};function c(e){return e.toLowerCase().split("-").filter(Boolean)}function o(e){return c(e)[0]||e.toLowerCase()}function d(e){let t=o(e);return t in l?l[t]:r[function(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return Math.abs(t)}(t)%r.length]}function u(e){let t=c(e);return 0===t.length?e.substring(0,2).toUpperCase():t.length>=2?(t[0][0]+t[1][0]).toUpperCase():t[0].substring(0,2).toUpperCase()}function h(e){let t=new Map;for(let n of e){let e=n.team||o(n.name),s=d(n.name),a=t.get(e);a||(a={prefix:e,displayName:g(e),color:s,agents:[],isExpanded:!0},t.set(e,a)),a.agents.push(n)}let n=Array.from(t.values()).sort((e,t)=>e.prefix.localeCompare(t.prefix));for(let e of n)e.agents.sort((e,t)=>e.name.localeCompare(t.name));return n}function m(e){let t=e.split("-").filter(Boolean);return 0===t.length?e:g(t[t.length-1])}function x(e){return e.split("-").filter(Boolean).map(g).join(" > ")}function p(e,t){return t?e.filter(e=>(function(e,t){if(!t)return!0;let n=t.toLowerCase(),s=e.toLowerCase();return!!s.includes(n)||s.split("-").some(e=>e.includes(n))})(e.name,t)):e}function g(e){return e?e.charAt(0).toUpperCase()+e.slice(1):e}function f(e){let t=0,n=0,s=0;for(let a of e)"online"===a.status?t++:"offline"===a.status&&n++,a.needsAttention&&s++;return{total:e.length,online:t,offline:n,needsAttention:s}}function j(e){let{isProcessing:t,processingStartedAt:n,size:l="medium",showElapsed:r=!1}=e,[i,c]=(0,a.useState)(0);return((0,a.useEffect)(()=>{if(!t||!n){c(0);return}let e=()=>{c(Date.now()-n)};e();let s=setInterval(e,1e3);return()=>clearInterval(s)},[t,n]),t)?(0,s.jsxs)("div",{className:"thinking-indicator ".concat({small:"thinking-indicator-small",medium:"thinking-indicator-medium",large:"thinking-indicator-large"}[l]),children:[(0,s.jsxs)("div",{className:"thinking-dots",children:[(0,s.jsx)("span",{className:"thinking-dot"}),(0,s.jsx)("span",{className:"thinking-dot"}),(0,s.jsx)("span",{className:"thinking-dot"})]}),r&&i>0&&(0,s.jsx)("span",{className:"thinking-elapsed",children:(e=>{let t=Math.floor(e/1e3);return t<60?"".concat(t,"s"):"".concat(Math.floor(t/60),"m ").concat(t%60,"s")})(i)})]}):null}function v(e){let{isProcessing:t}=e;return t?(0,s.jsx)("span",{className:"thinking-dot-inline",title:"Processing...",children:(0,s.jsx)("span",{className:"thinking-dot-pulse"})}):null}function y(e){let{agent:t,isSelected:n=!1,showBreadcrumb:a=!1,compact:l=!1,displayNameOverride:r,onClick:c,onMessageClick:o,onReleaseClick:h}=e,p=d(t.name),g=u(t.name),f=r||m(t.name),y=i[t.status]||i.offline,N=()=>{null==c||c(t)},b=e=>{e.stopPropagation(),null==h||h(t)};return l?(0,s.jsxs)("div",{className:"agent-card-compact ".concat(n?"selected":""),onClick:N,style:{"--agent-primary":p.primary,"--agent-light":p.light},children:[(0,s.jsx)("div",{className:"agent-avatar-small",style:{backgroundColor:p.primary},children:(0,s.jsx)("span",{style:{color:p.text},children:g})}),(0,s.jsxs)("div",{className:"agent-compact-info",children:[(0,s.jsx)("span",{className:"agent-name",children:f}),!r&&(0,s.jsx)("span",{className:"agent-breadcrumb-compact",children:x(t.name)})]}),(0,s.jsxs)("div",{className:"agent-compact-actions",children:[t.isSpawned&&h&&(0,s.jsx)("button",{className:"release-btn-compact",onClick:b,title:"Kill agent",children:(0,s.jsx)(w,{})}),t.isProcessing?(0,s.jsx)(v,{isProcessing:!0}):(0,s.jsx)("div",{className:"agent-status-dot",style:{backgroundColor:y}}),t.needsAttention&&(0,s.jsx)("div",{className:"attention-badge"})]})]}):(0,s.jsxs)("div",{className:"agent-card ".concat(n?"selected":""),onClick:N,style:{"--agent-primary":p.primary,"--agent-light":p.light,"--agent-dark":p.dark},children:[(0,s.jsxs)("div",{className:"agent-card-header",children:[(0,s.jsxs)("div",{className:"agent-avatar",style:{backgroundColor:p.primary},children:[(0,s.jsx)("span",{style:{color:p.text},children:g}),(0,s.jsx)("div",{className:"status-indicator",style:{backgroundColor:y}})]}),(0,s.jsxs)("div",{className:"agent-info",children:[(0,s.jsxs)("div",{className:"agent-name-row",children:[(0,s.jsx)("span",{className:"agent-display-name",children:f}),t.needsAttention&&(0,s.jsx)("span",{className:"attention-badge",title:"Needs attention",children:"!"})]}),a?(0,s.jsx)("span",{className:"agent-breadcrumb",children:x(t.name)}):(0,s.jsx)("span",{className:"agent-full-name",children:t.name})]})]}),t.isProcessing&&(0,s.jsxs)("div",{className:"agent-thinking",children:[(0,s.jsx)(j,{isProcessing:!0,processingStartedAt:t.processingStartedAt,size:"medium",showElapsed:!0}),(0,s.jsx)("span",{className:"thinking-label",children:"Thinking..."})]}),t.currentTask&&!t.isProcessing&&(0,s.jsxs)("div",{className:"agent-task",children:[(0,s.jsx)("span",{className:"task-label",children:"Working on:"}),(0,s.jsx)("span",{className:"task-text",children:t.currentTask})]}),(0,s.jsxs)("div",{className:"agent-card-footer",children:[(0,s.jsxs)("div",{className:"agent-meta",children:[t.cli&&(0,s.jsx)("span",{className:"agent-cli",children:t.cli}),void 0!==t.messageCount&&t.messageCount>0&&(0,s.jsxs)("span",{className:"message-count",children:[t.messageCount," msgs"]}),t.isSpawned&&(0,s.jsx)("span",{className:"agent-spawned-badge",children:"spawned"})]}),(0,s.jsxs)("div",{className:"agent-actions",children:[t.isSpawned&&h&&(0,s.jsx)("button",{className:"release-btn",onClick:b,title:"Release agent",children:(0,s.jsx)(w,{})}),o&&(0,s.jsx)("button",{className:"message-btn",onClick:e=>{e.stopPropagation(),null==o||o(t)},title:"Send message",children:(0,s.jsx)(k,{})})]})]})]})}function k(){return(0,s.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,s.jsx)("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})}function w(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",className:"release-icon",children:[(0,s.jsx)("path",{d:"M12 22c5.523 0 10-4.477 10-10a9.96 9.96 0 0 0-3-7.141",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),(0,s.jsx)("path",{d:"M12 22C6.477 22 2 17.523 2 12a9.96 9.96 0 0 1 3-7.141",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),(0,s.jsx)("line",{x1:"12",y1:"2",x2:"12",y2:"12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})]})}function N(e){let{agents:t,selectedAgent:n,searchQuery:l="",onAgentSelect:r,onAgentMessage:i,onReleaseClick:c,compact:o=!1,showGroupStats:d=!0}=e,[u,m]=(0,a.useState)(new Set),[x,g]=(0,a.useState)(!0),f=(0,a.useMemo)(()=>p(t,l),[t,l]),j=(0,a.useMemo)(()=>h(f),[f]);(0,a.useMemo)(()=>{0===u.size&&j.length>0&&m(new Set(j.map(e=>e.prefix)))},[j]);let v=e=>{m(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return 0===t.length?(0,s.jsxs)("div",{className:"agent-list-empty",children:[(0,s.jsx)(S,{}),(0,s.jsx)("p",{children:"No agents connected"})]}):0===f.length?(0,s.jsxs)("div",{className:"agent-list-empty",children:[(0,s.jsx)(A,{}),(0,s.jsxs)("p",{children:['No agents match "',l,'"']})]}):(0,s.jsxs)("div",{className:"agent-list",children:[j.length>1&&(0,s.jsxs)("div",{className:"agent-list-header",children:[(0,s.jsxs)("span",{className:"agent-count",children:[f.length," agents"]}),(0,s.jsx)("button",{className:"toggle-all-btn",onClick:()=>{x?m(new Set):m(new Set(j.map(e=>e.prefix))),g(!x)},children:x?"Collapse all":"Expand all"})]}),j.map(e=>(0,s.jsx)(b,{group:e,isExpanded:u.has(e.prefix),selectedAgent:n,compact:o,showStats:d,onToggle:()=>v(e.prefix),onAgentSelect:r,onAgentMessage:i,onReleaseClick:c},e.prefix))]})}function b(e){let{group:t,isExpanded:n,selectedAgent:a,compact:l,showStats:r,onToggle:c,onAgentSelect:o,onAgentMessage:d,onReleaseClick:u}=e,h=r?f(t.agents):null;return(0,s.jsxs)("div",{className:"agent-group",children:[(0,s.jsxs)("button",{className:"agent-group-header",onClick:c,style:{"--group-color":t.color.primary,"--group-light":t.color.light},children:[(0,s.jsx)("div",{className:"group-color-bar"}),(0,s.jsx)(C,{expanded:n}),(0,s.jsx)("span",{className:"group-name",children:t.displayName}),(0,s.jsxs)("span",{className:"group-count",children:["(",t.agents.length,")"]}),r&&h&&(0,s.jsxs)("div",{className:"group-stats",children:[h.online>0&&(0,s.jsxs)("span",{className:"stat online",children:[(0,s.jsx)("span",{className:"stat-dot",style:{backgroundColor:i.online}}),h.online]}),h.needsAttention>0&&(0,s.jsxs)("span",{className:"stat attention",children:[(0,s.jsx)("span",{className:"stat-dot",style:{backgroundColor:i.attention}}),h.needsAttention]})]})]}),n&&(0,s.jsx)("div",{className:"agent-group-content",children:t.agents.map(e=>(0,s.jsx)(y,{agent:e,isSelected:e.name===a,compact:l,displayNameOverride:m(e.name),onClick:o,onMessageClick:d,onReleaseClick:u},e.name))})]})}function C(e){let{expanded:t}=e;return(0,s.jsx)("svg",{className:"chevron-icon ".concat(t?"expanded":""),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,s.jsx)("polyline",{points:"9 18 15 12 9 6"})})}function S(){return(0,s.jsxs)("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1",children:[(0,s.jsx)("circle",{cx:"12",cy:"8",r:"5"}),(0,s.jsx)("path",{d:"M20 21a8 8 0 1 0-16 0"})]})}function A(){return(0,s.jsxs)("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1",children:[(0,s.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,s.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}function M(e){return e.split(/[-_]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")}function E(e){let{projects:t,localAgents:n=[],currentProject:l,selectedAgent:r,searchQuery:i="",onProjectSelect:c,onAgentSelect:o,onReleaseClick:d,compact:u=!1}=e,[h,m]=(0,a.useState)(()=>new Set(t.map(e=>e.id))),x=(0,a.useMemo)(()=>{let e=i.toLowerCase().trim();if(!e)return{projects:t,localAgents:n};let s=n.filter(t=>{var n;return t.name.toLowerCase().includes(e)||(null===(n=t.currentTask)||void 0===n?void 0:n.toLowerCase().includes(e))});return{projects:t.map(t=>{var n;let s=(null===(n=t.name)||void 0===n?void 0:n.toLowerCase().includes(e))||t.path.toLowerCase().includes(e),a=t.agents.filter(t=>{var n;return t.name.toLowerCase().includes(e)||(null===(n=t.currentTask)||void 0===n?void 0:n.toLowerCase().includes(e))});return s||a.length>0?{...t,agents:s?t.agents:a}:null}).filter(Boolean),localAgents:s}},[t,n,i]),p=e=>{m(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},g=x.localAgents.length+x.projects.reduce((e,t)=>e+t.agents.length,0);return 0===g&&0===t.length&&0===n.length?(0,s.jsxs)("div",{className:"project-list-empty",children:[(0,s.jsx)(R,{}),(0,s.jsx)("p",{children:"No projects or agents"})]}):0===g&&i?(0,s.jsxs)("div",{className:"project-list-empty",children:[(0,s.jsx)(T,{}),(0,s.jsxs)("p",{children:['No results for "',i,'"']})]}):(0,s.jsxs)("div",{className:"project-list",children:[x.localAgents.length>0&&(0,s.jsx)(D,{project:{id:"__local__",path:"",name:"Local",agents:x.localAgents},isExpanded:h.has("__local__"),isCurrentProject:!0,selectedAgent:r,compact:u,onToggle:()=>p("__local__"),onAgentSelect:e=>null==o?void 0:o(e),onReleaseClick:d}),x.projects.map(e=>(0,s.jsx)(D,{project:e,isExpanded:h.has(e.id),isCurrentProject:e.id===l,selectedAgent:r,compact:u,onToggle:()=>p(e.id),onProjectSelect:()=>null==c?void 0:c(e),onAgentSelect:t=>null==o?void 0:o(t,e),onReleaseClick:d},e.id))]})}function D(e){var t;let{project:n,isExpanded:l,isCurrentProject:r,selectedAgent:c,compact:o,onToggle:u,onProjectSelect:h,onAgentSelect:m,onReleaseClick:x}=e,[p,g]=(0,a.useState)(new Set),f=(0,a.useMemo)(()=>{let e=0,t=0;for(let s of n.agents)"online"===s.status&&e++,s.needsAttention&&t++;return{online:e,needsAttention:t,total:n.agents.length}},[n.agents]),{teams:j,ungroupedAgents:v}=(0,a.useMemo)(()=>{let e=new Map,t=[];for(let s of n.agents)if(s.team){let t=e.get(s.team)||[];t.push(s),e.set(s.team,t)}else t.push(s);return{teams:Array.from(e.entries()).map(e=>{let[t,n]=e;return{name:t,agents:n}}).sort((e,t)=>e.name.localeCompare(t.name)),ungroupedAgents:t}},[n.agents]),k=e=>{g(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};(0,a.useEffect)(()=>{l&&0===p.size&&j.length>0&&g(new Set(j.map(e=>e.name)))},[l,j,p]);let w=d(n.name||n.id),N=n.name||n.path.split("/").pop()||n.id;return(0,s.jsxs)("div",{className:"project-section ".concat(r?"current":""),children:[(0,s.jsxs)("button",{className:"project-header",onClick:u,onDoubleClick:h,style:{"--project-color":w.primary,"--project-light":w.light},children:[(0,s.jsx)("div",{className:"project-color-bar"}),(0,s.jsx)(B,{expanded:l}),(0,s.jsx)(W,{}),(0,s.jsx)("span",{className:"project-name",children:N}),(0,s.jsxs)("span",{className:"project-count",children:["(",f.total,")"]}),(0,s.jsxs)("div",{className:"project-stats",children:[f.online>0&&(0,s.jsxs)("span",{className:"stat online",children:[(0,s.jsx)("span",{className:"stat-dot",style:{backgroundColor:i.online}}),f.online]}),f.needsAttention>0&&(0,s.jsxs)("span",{className:"stat attention",children:[(0,s.jsx)("span",{className:"stat-dot",style:{backgroundColor:i.attention}}),f.needsAttention]})]}),(null===(t=n.lead)||void 0===t?void 0:t.connected)&&(0,s.jsx)("span",{className:"lead-indicator",title:"Lead: ".concat(n.lead.name),children:"★"})]}),l&&(0,s.jsxs)("div",{className:"project-agents",children:[j.map(e=>(0,s.jsxs)("div",{className:"team-group",children:[(0,s.jsxs)("button",{className:"team-header",onClick:()=>k(e.name),children:[(0,s.jsx)(B,{expanded:p.has(e.name)}),(0,s.jsx)(L,{}),(0,s.jsx)("span",{className:"team-name",children:e.name}),(0,s.jsxs)("span",{className:"team-count",children:["(",e.agents.length,")"]})]}),p.has(e.name)&&(0,s.jsx)("div",{className:"team-agents",children:e.agents.map(t=>(0,s.jsx)(y,{agent:t,isSelected:t.name===c,compact:o,displayNameOverride:function(e,t){let n=e.toLowerCase(),s=t.toLowerCase().replace(/-?team$/i,"");if(s&&n.startsWith(s+"-")||s&&n.startsWith(s+"_"))return M(e.substring(s.length+1));let a=e.split("-");return a.length>1?M(a[a.length-1]):M(e)}(t.name,e.name),onClick:m,onReleaseClick:x},t.name))})]},e.name)),v.map(e=>(0,s.jsx)(y,{agent:e,isSelected:e.name===c,compact:o,onClick:m,onReleaseClick:x},e.name))]})]})}function B(e){let{expanded:t}=e;return(0,s.jsx)("svg",{className:"chevron-icon ".concat(t?"expanded":""),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,s.jsx)("polyline",{points:"9 18 15 12 9 6"})})}function W(){return(0,s.jsx)("svg",{className:"folder-icon",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,s.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})})}function L(){return(0,s.jsxs)("svg",{className:"team-icon",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),(0,s.jsx)("circle",{cx:"9",cy:"7",r:"4"}),(0,s.jsx)("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),(0,s.jsx)("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]})}function R(){return(0,s.jsx)("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1",children:(0,s.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})})}function T(){return(0,s.jsxs)("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1",children:[(0,s.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,s.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}function P(e){let{agents:t,projects:n=[],currentProject:l,selectedAgent:r,viewMode:i,isFleetAvailable:c,isConnected:o,isOpen:d=!1,onAgentSelect:u,onProjectSelect:h,onViewModeChange:m,onSpawnClick:x,onReleaseClick:p,onClose:g}=e,[f,j]=(0,a.useState)(""),v=n.length>0;return(0,s.jsxs)("aside",{className:"sidebar ".concat(d?"open":""),children:[(0,s.jsxs)("div",{className:"sidebar-header",children:[(0,s.jsxs)("div",{className:"sidebar-title",children:[(0,s.jsx)("h1",{children:"Agent Relay"}),(0,s.jsx)(O,{isConnected:o})]}),c&&(0,s.jsxs)("div",{className:"view-mode-toggle",children:[(0,s.jsx)("button",{className:"toggle-btn ".concat("local"===i?"active":""),onClick:()=>null==m?void 0:m("local"),children:"Local"}),(0,s.jsx)("button",{className:"toggle-btn ".concat("fleet"===i?"active":""),onClick:()=>null==m?void 0:m("fleet"),children:"Fleet"})]})]}),(0,s.jsxs)("div",{className:"sidebar-search",children:[(0,s.jsx)(F,{}),(0,s.jsx)("input",{type:"text",placeholder:"Search agents...",value:f,onChange:e=>j(e.target.value)}),f&&(0,s.jsx)("button",{className:"clear-btn",onClick:()=>j(""),children:(0,s.jsx)(V,{})})]}),(0,s.jsx)("div",{className:"sidebar-content",children:v?(0,s.jsx)(E,{projects:n,localAgents:t,currentProject:l,selectedAgent:r,searchQuery:f,onProjectSelect:h,onAgentSelect:u,onReleaseClick:p,compact:!0}):(0,s.jsx)(N,{agents:t,selectedAgent:r,searchQuery:f,onAgentSelect:e=>null==u?void 0:u(e),onReleaseClick:p,compact:!0,showGroupStats:!0})}),(0,s.jsx)("div",{className:"sidebar-footer",children:(0,s.jsxs)("button",{className:"spawn-btn",onClick:x,children:[(0,s.jsx)(_,{}),"Spawn Agent"]})})]})}function O(e){let{isConnected:t}=e;return(0,s.jsx)("div",{className:"connection-indicator ".concat(t?"connected":"disconnected"),title:t?"Connected":"Disconnected"})}function F(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,s.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}function V(){return(0,s.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,s.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function _(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,s.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}function z(e){let{currentChannel:t,selectedAgent:n,onCommandPaletteOpen:a,onSettingsClick:l,onMenuClick:r}=e,i="general"===t,c=n?d(n.name):null;return(0,s.jsxs)("header",{className:"header",children:[(0,s.jsx)("button",{className:"mobile-menu-btn",onClick:r,"aria-label":"Open menu",children:(0,s.jsx)(U,{})}),(0,s.jsx)("div",{className:"header-left",children:i?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"channel-prefix",children:"#"}),(0,s.jsx)("span",{className:"channel-name",children:"general"}),(0,s.jsx)("span",{className:"channel-topic",children:"All agent communications"})]}):n?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"agent-avatar-small",style:{backgroundColor:null==c?void 0:c.primary},children:(0,s.jsx)("span",{style:{color:null==c?void 0:c.text},children:u(n.name)})}),(0,s.jsxs)("div",{className:"channel-info",children:[(0,s.jsx)("span",{className:"channel-name",children:n.name}),(0,s.jsx)("span",{className:"channel-breadcrumb",children:x(n.name)})]}),n.status&&(0,s.jsx)("span",{className:"agent-status-badge",children:n.status})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"channel-prefix",children:"@"}),(0,s.jsx)("span",{className:"channel-name",children:t})]})}),(0,s.jsxs)("div",{className:"header-right",children:[(0,s.jsxs)("button",{className:"header-btn command-palette-btn",onClick:a,title:"Command Palette (⌘K)",children:[(0,s.jsx)(I,{}),(0,s.jsx)("span",{children:"Search"}),(0,s.jsx)("kbd",{children:"⌘K"})]}),(0,s.jsx)("a",{href:"/metrics",className:"header-btn icon-btn",title:"Metrics",children:(0,s.jsx)(H,{})}),(0,s.jsx)("button",{className:"header-btn icon-btn",onClick:l,title:"Settings",children:(0,s.jsx)(K,{})})]})]})}function I(){return(0,s.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,s.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}function H(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("path",{d:"M3 3v18h18"}),(0,s.jsx)("path",{d:"M18 17V9"}),(0,s.jsx)("path",{d:"M13 17V5"}),(0,s.jsx)("path",{d:"M8 17v-3"})]})}function K(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"3"}),(0,s.jsx)("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"})]})}function U(){return(0,s.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),(0,s.jsx)("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),(0,s.jsx)("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})}function q(e){let{messages:t,currentChannel:n,onThreadClick:l,highlightedMessageId:r}=e,i=(0,a.useRef)(null),c=(0,a.useRef)(null);(0,a.useEffect)(()=>{var e;null===(e=c.current)||void 0===e||e.scrollIntoView({behavior:"smooth"})},[t.length]);let o=t.filter(e=>"general"===n?"*"===e.to||e.isBroadcast:e.from===n||e.to===n);return 0===o.length?(0,s.jsxs)("div",{className:"message-list-empty",children:[(0,s.jsx)(G,{}),(0,s.jsx)("h3",{children:"No messages yet"}),(0,s.jsx)("p",{children:"general"===n?"Broadcast messages will appear here":"Messages with ".concat(n," will appear here")})]}):(0,s.jsxs)("div",{className:"message-list",ref:i,children:[o.map(e=>(0,s.jsx)(J,{message:e,isHighlighted:e.id===r,onThreadClick:l},e.id)),(0,s.jsx)("div",{ref:c})]})}function J(e){let{message:t,isHighlighted:n,onThreadClick:l}=e,r=d(t.from),i=function(e){let t=new Date(e),n=new Date;if(t.toDateString()===n.toDateString())return t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});let s=new Date(n);return(s.setDate(s.getDate()-1),t.toDateString()===s.toDateString())?"Yesterday ".concat(t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})):t.toLocaleDateString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}(t.timestamp);return(0,s.jsxs)("div",{className:"message-item ".concat(n?"highlighted":""),children:[(0,s.jsx)("div",{className:"message-avatar",style:{backgroundColor:r.primary},children:(0,s.jsx)("span",{style:{color:r.text},children:u(t.from)})}),(0,s.jsxs)("div",{className:"message-content",children:[(0,s.jsxs)("div",{className:"message-header",children:[(0,s.jsx)("span",{className:"message-sender",children:t.from}),"*"!==t.to&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"message-arrow",children:"→"}),(0,s.jsx)("span",{className:"message-recipient",children:t.to})]}),(0,s.jsx)("span",{className:"message-time",children:i}),"*"===t.to&&(0,s.jsx)("span",{className:"message-badge broadcast",children:"broadcast"})]}),(0,s.jsx)("div",{className:"message-body",children:t.content.replace(/\\n/g,"\n").replace(/\r\n/g,"\n").replace(/\r/g,"\n").split("\n").map((e,t)=>(0,s.jsxs)(a.Fragment,{children:[t>0&&(0,s.jsx)("br",{}),function(e){let t=/(https?:\/\/[^\s]+)/g;return e.split(t).map((e,n)=>t.test(e)?(0,s.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"message-link",children:e},n):e)}(e)]},t))}),t.replyCount&&t.replyCount>0&&(0,s.jsxs)("button",{className:"message-thread-btn",onClick:()=>null==l?void 0:l(t.id),children:[(0,s.jsx)(Q,{}),(0,s.jsxs)("span",{children:[t.replyCount," ",1===t.replyCount?"reply":"replies"]})]})]})]})}function G(){return(0,s.jsx)("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})}function Q(){return(0,s.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,s.jsx)("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})}function Z(e){let{isOpen:t,onClose:n,agents:l,projects:r=[],currentProject:i,onAgentSelect:c,onProjectSelect:o,onSpawnClick:d,onSettingsClick:u,onGeneralClick:h,customCommands:m=[]}=e,[x,p]=(0,a.useState)(""),[g,f]=(0,a.useState)(0),j=(0,a.useRef)(null),v=(0,a.useRef)(null),y=(0,a.useMemo)(()=>[...r.map(e=>{let t=e.name||e.path.split("/").pop()||e.id,a=e.id===i;return{id:"project-".concat(e.id),label:t,description:a?"Current project • ".concat(e.agents.length," agents"):"".concat(e.agents.length," agents"),category:"projects",icon:(0,s.jsx)(es,{}),action:()=>{null==o||o(e),n()}}}),...l.map(e=>({id:"agent-".concat(e.name),label:e.name,description:e.currentTask||e.status,category:"agents",icon:(0,s.jsx)($,{name:e.name}),action:()=>{c(e),n()}})),{id:"spawn-agent",label:"Spawn Agent",description:"Launch a new agent instance",category:"actions",icon:(0,s.jsx)(X,{}),shortcut:"⌘⇧S",action:()=>{d(),n()}},{id:"broadcast",label:"Broadcast Message",description:"Send message to all agents",category:"actions",icon:(0,s.jsx)(ee,{}),action:()=>{n()}},{id:"nav-general",label:"Go to #general",description:"View all broadcast messages",category:"navigation",icon:(0,s.jsx)(et,{}),action:()=>{null==h||h(),n()}},...u?[{id:"settings",label:"Settings",description:"Configure dashboard preferences",category:"settings",icon:(0,s.jsx)(en,{}),shortcut:"⌘,",action:()=>{u(),n()}}]:[],...m],[l,r,i,c,o,d,u,h,n,m]),k=(0,a.useMemo)(()=>{if(!x.trim())return y;let e=x.toLowerCase();return y.filter(t=>{var n;return t.label.toLowerCase().includes(e)||(null===(n=t.description)||void 0===n?void 0:n.toLowerCase().includes(e))||t.category.toLowerCase().includes(e)})},[y,x]),w=(0,a.useMemo)(()=>{let e={};for(let t of k)e[t.category]||(e[t.category]=[]),e[t.category].push(t);return e},[k]),N=(0,a.useMemo)(()=>["projects","agents","actions","navigation","settings"].flatMap(e=>w[e]||[]),[w]);(0,a.useEffect)(()=>{f(0)},[x]),(0,a.useEffect)(()=>{t&&(p(""),f(0),setTimeout(()=>{var e;return null===(e=j.current)||void 0===e?void 0:e.focus()},0))},[t]),(0,a.useEffect)(()=>{if(v.current&&N.length>0){let e=v.current.querySelector('[data-index="'.concat(g,'"]'));null==e||e.scrollIntoView({block:"nearest"})}},[g,N.length]);let b=(0,a.useCallback)(e=>{switch(e.key){case"ArrowDown":e.preventDefault(),f(e=>Math.min(e+1,N.length-1));break;case"ArrowUp":e.preventDefault(),f(e=>Math.max(e-1,0));break;case"Enter":e.preventDefault(),N[g]&&N[g].action();break;case"Escape":e.preventDefault(),n()}},[N,g,n]);if(!t)return null;let C={projects:"Projects",agents:"Agents",actions:"Actions",navigation:"Navigation",settings:"Settings"},S=0;return(0,s.jsx)("div",{className:"command-palette-overlay",onClick:n,children:(0,s.jsxs)("div",{className:"command-palette",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"command-palette-input-wrapper",children:[(0,s.jsx)(Y,{}),(0,s.jsx)("input",{ref:j,type:"text",className:"command-palette-input",placeholder:"Search commands, agents...",value:x,onChange:e=>p(e.target.value),onKeyDown:b}),(0,s.jsx)("kbd",{className:"command-palette-kbd",children:"ESC"})]}),(0,s.jsx)("div",{className:"command-palette-list",ref:v,children:0===N.length?(0,s.jsxs)("div",{className:"command-palette-empty",children:['No results for "',x,'"']}):Object.entries(w).map(e=>{let[t,n]=e;return n.length?(0,s.jsxs)("div",{className:"command-palette-group",children:[(0,s.jsx)("div",{className:"command-palette-group-label",children:C[t]||t}),n.map(e=>{let t=S++;return(0,s.jsxs)("button",{"data-index":t,className:"command-palette-item ".concat(t===g?"selected":""),onClick:e.action,onMouseEnter:()=>f(t),children:[(0,s.jsx)("span",{className:"command-palette-item-icon",children:e.icon}),(0,s.jsxs)("span",{className:"command-palette-item-content",children:[(0,s.jsx)("span",{className:"command-palette-item-label",children:e.label}),e.description&&(0,s.jsx)("span",{className:"command-palette-item-desc",children:e.description})]}),e.shortcut&&(0,s.jsx)("kbd",{className:"command-palette-item-shortcut",children:e.shortcut})]},e.id)})]},t):null})})]})})}function $(e){let{name:t}=e,n=d(t);return(0,s.jsx)("div",{className:"command-palette-agent-icon",style:{backgroundColor:n.primary,color:n.text},children:u(t)})}function Y(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,s.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}function X(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,s.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}function ee(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"2"}),(0,s.jsx)("path",{d:"M16.24 7.76a6 6 0 0 1 0 8.49m-8.48-.01a6 6 0 0 1 0-8.49m11.31-2.82a10 10 0 0 1 0 14.14m-14.14 0a10 10 0 0 1 0-14.14"})]})}function et(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("line",{x1:"4",y1:"9",x2:"20",y2:"9"}),(0,s.jsx)("line",{x1:"4",y1:"15",x2:"20",y2:"15"}),(0,s.jsx)("line",{x1:"10",y1:"3",x2:"8",y2:"21"}),(0,s.jsx)("line",{x1:"16",y1:"3",x2:"14",y2:"21"})]})}function en(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"3"}),(0,s.jsx)("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"})]})}function es(){return(0,s.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,s.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})})}let ea=[{id:"claude",name:"Claude",command:"claude",description:"Claude Code CLI agent",icon:"\uD83E\uDD16"},{id:"codex",name:"Codex",command:"codex",description:"OpenAI Codex agent",icon:"⚡"},{id:"custom",name:"Custom",command:"",description:"Custom command",icon:"\uD83D\uDD27"}],el=["frontend","backend","lead","test","docs","review","deploy","data"];function er(e){let{isOpen:t,onClose:n,onSpawn:l,existingAgents:r,isSpawning:i=!1,error:c}=e,[o,h]=(0,a.useState)(ea[0]),[m,x]=(0,a.useState)(""),[p,g]=(0,a.useState)(""),[f,j]=(0,a.useState)(""),[v,y]=(0,a.useState)(""),[k,w]=(0,a.useState)(null),N=(0,a.useRef)(null),b=(0,a.useCallback)(()=>{let e="claude"===o.id?"claude":o.id,t=1;for(;r.includes("".concat(e,"-").concat(t));)t++;return"".concat(e,"-").concat(t)},[o,r]);(0,a.useEffect)(()=>{t&&(h(ea[0]),x(""),g(""),j(""),y(""),w(null),setTimeout(()=>{var e;return null===(e=N.current)||void 0===e?void 0:e.focus()},100))},[t]);let C=(0,a.useCallback)(e=>e.trim()?/^[a-zA-Z][a-zA-Z0-9-]*$/.test(e)?r.includes(e)?"An agent with this name already exists":null:"Name must start with a letter and contain only letters, numbers, and hyphens":"Name is required",[r]),S=async e=>{e.preventDefault();let t=m.trim()||b(),s=C(t);if(s){w(s);return}let a="custom"===o.id?p:o.command;if(!a.trim()){w("Command is required");return}w(null),await l({name:t,command:a.trim(),cwd:f.trim()||void 0,team:v.trim()||void 0})&&n()};if(!t)return null;let A=m?d(m):d(b()),M=c||k;return(0,s.jsx)("div",{className:"spawn-modal-overlay",onClick:n,children:(0,s.jsxs)("div",{className:"spawn-modal",onClick:e=>e.stopPropagation(),onKeyDown:e=>{"Escape"===e.key&&(e.preventDefault(),n())},children:[(0,s.jsxs)("div",{className:"spawn-modal-header",children:[(0,s.jsx)("h2",{children:"Spawn New Agent"}),(0,s.jsx)("button",{className:"spawn-modal-close",onClick:n,"aria-label":"Close",children:(0,s.jsx)(ei,{})})]}),(0,s.jsxs)("form",{onSubmit:S,children:[(0,s.jsxs)("div",{className:"spawn-modal-section",children:[(0,s.jsx)("label",{className:"spawn-modal-label",children:"Agent Type"}),(0,s.jsx)("div",{className:"spawn-modal-templates",children:ea.map(e=>(0,s.jsxs)("button",{type:"button",className:"spawn-modal-template ".concat(o.id===e.id?"selected":""),onClick:()=>h(e),children:[(0,s.jsx)("span",{className:"spawn-modal-template-icon",children:e.icon}),(0,s.jsx)("span",{className:"spawn-modal-template-name",children:e.name}),(0,s.jsx)("span",{className:"spawn-modal-template-desc",children:e.description})]},e.id))})]}),(0,s.jsxs)("div",{className:"spawn-modal-section",children:[(0,s.jsx)("label",{className:"spawn-modal-label",htmlFor:"agent-name",children:"Agent Name"}),(0,s.jsxs)("div",{className:"spawn-modal-name-input",children:[(0,s.jsx)("div",{className:"spawn-modal-name-preview",style:{backgroundColor:A.primary,color:A.text},children:u(m||b())}),(0,s.jsx)("input",{ref:N,id:"agent-name",type:"text",className:"spawn-modal-input",placeholder:b(),value:m,onChange:e=>{x(e.target.value),w(null)},disabled:i})]}),(0,s.jsx)("div",{className:"spawn-modal-name-suggestions",children:el.slice(0,4).map(e=>(0,s.jsxs)("button",{type:"button",className:"spawn-modal-suggestion",onClick:()=>x("".concat(e,"-1")),children:[e,"-"]},e))})]}),"custom"===o.id&&(0,s.jsxs)("div",{className:"spawn-modal-section",children:[(0,s.jsx)("label",{className:"spawn-modal-label",htmlFor:"agent-command",children:"Command"}),(0,s.jsx)("input",{id:"agent-command",type:"text",className:"spawn-modal-input",placeholder:"e.g., python agent.py",value:p,onChange:e=>g(e.target.value),disabled:i})]}),(0,s.jsxs)("div",{className:"spawn-modal-section",children:[(0,s.jsxs)("label",{className:"spawn-modal-label",htmlFor:"agent-cwd",children:["Working Directory ",(0,s.jsx)("span",{className:"spawn-modal-optional",children:"(optional)"})]}),(0,s.jsx)("input",{id:"agent-cwd",type:"text",className:"spawn-modal-input",placeholder:"Current directory",value:f,onChange:e=>j(e.target.value),disabled:i})]}),(0,s.jsxs)("div",{className:"spawn-modal-section",children:[(0,s.jsxs)("label",{className:"spawn-modal-label",htmlFor:"agent-team",children:["Team ",(0,s.jsx)("span",{className:"spawn-modal-optional",children:"(optional)"})]}),(0,s.jsx)("input",{id:"agent-team",type:"text",className:"spawn-modal-input",placeholder:"e.g., frontend, backend, infra",value:v,onChange:e=>y(e.target.value),disabled:i})]}),M&&(0,s.jsxs)("div",{className:"spawn-modal-error",children:[(0,s.jsx)(ec,{}),(0,s.jsx)("span",{children:M})]}),(0,s.jsxs)("div",{className:"spawn-modal-actions",children:[(0,s.jsx)("button",{type:"button",className:"spawn-modal-btn spawn-modal-btn-secondary",onClick:n,disabled:i,children:"Cancel"}),(0,s.jsx)("button",{type:"submit",className:"spawn-modal-btn spawn-modal-btn-primary",disabled:i,children:i?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ed,{}),"Spawning..."]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eo,{}),"Spawn Agent"]})})]})]})]})})}function ei(){return(0,s.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,s.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function ec(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,s.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,s.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})}function eo(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z"}),(0,s.jsx)("path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z"}),(0,s.jsx)("path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0"}),(0,s.jsx)("path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5"})]})}function ed(){return(0,s.jsx)("svg",{className:"spawn-modal-spinner",width:"16",height:"16",viewBox:"0 0 24 24",children:(0,s.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",fill:"none",strokeDasharray:"32",strokeLinecap:"round"})})}let eu={theme:"system",notifications:{enabled:!0,sound:!0,desktop:!1,mentionsOnly:!1},display:{compactMode:!1,showTimestamps:!0,showAvatars:!0,animationsEnabled:!0},connection:{autoReconnect:!0,reconnectDelay:3e3,keepAliveInterval:3e4}};function eh(e){let{isOpen:t,onClose:n,settings:l,onSettingsChange:r,onResetSettings:i}=e,[c,o]=(0,a.useState)("appearance"),d=(0,a.useCallback)((e,t,n)=>{let s=l[e];r({...l,[e]:{...s,[t]:n}})},[l,r]),u=(0,a.useCallback)(e=>{r({...l,theme:e})},[l,r]);return t?(0,s.jsx)("div",{className:"settings-overlay",onClick:n,children:(0,s.jsxs)("div",{className:"settings-panel",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"settings-header",children:[(0,s.jsx)("h2",{children:"Settings"}),(0,s.jsx)("button",{className:"settings-close",onClick:n,children:(0,s.jsx)(ex,{})})]}),(0,s.jsxs)("div",{className:"settings-tabs",children:[(0,s.jsxs)("button",{className:"settings-tab ".concat("appearance"===c?"active":""),onClick:()=>o("appearance"),children:[(0,s.jsx)(ep,{}),"Appearance"]}),(0,s.jsxs)("button",{className:"settings-tab ".concat("notifications"===c?"active":""),onClick:()=>o("notifications"),children:[(0,s.jsx)(eg,{}),"Notifications"]}),(0,s.jsxs)("button",{className:"settings-tab ".concat("connection"===c?"active":""),onClick:()=>o("connection"),children:[(0,s.jsx)(ef,{}),"Connection"]})]}),(0,s.jsxs)("div",{className:"settings-content",children:["appearance"===c&&(0,s.jsxs)("div",{className:"settings-section",children:[(0,s.jsxs)("div",{className:"settings-group",children:[(0,s.jsx)("label",{className:"settings-label",children:"Theme"}),(0,s.jsx)("div",{className:"settings-theme-options",children:["light","dark","system"].map(e=>(0,s.jsxs)("button",{className:"settings-theme-btn ".concat(l.theme===e?"active":""),onClick:()=>u(e),children:["light"===e&&(0,s.jsx)(ej,{}),"dark"===e&&(0,s.jsx)(ev,{}),"system"===e&&(0,s.jsx)(ey,{}),(0,s.jsx)("span",{children:e.charAt(0).toUpperCase()+e.slice(1)})]},e))})]}),(0,s.jsxs)("div",{className:"settings-group",children:[(0,s.jsx)("label",{className:"settings-label",children:"Display Options"}),(0,s.jsx)(em,{label:"Compact mode",description:"Show more content in less space",checked:l.display.compactMode,onChange:e=>d("display","compactMode",e)}),(0,s.jsx)(em,{label:"Show timestamps",description:"Display time for each message",checked:l.display.showTimestamps,onChange:e=>d("display","showTimestamps",e)}),(0,s.jsx)(em,{label:"Show avatars",description:"Display agent avatars in messages",checked:l.display.showAvatars,onChange:e=>d("display","showAvatars",e)}),(0,s.jsx)(em,{label:"Enable animations",description:"Smooth transitions and effects",checked:l.display.animationsEnabled,onChange:e=>d("display","animationsEnabled",e)})]})]}),"notifications"===c&&(0,s.jsx)("div",{className:"settings-section",children:(0,s.jsxs)("div",{className:"settings-group",children:[(0,s.jsx)("label",{className:"settings-label",children:"Notification Preferences"}),(0,s.jsx)(em,{label:"Enable notifications",description:"Receive alerts for new messages",checked:l.notifications.enabled,onChange:e=>d("notifications","enabled",e)}),(0,s.jsx)(em,{label:"Sound alerts",description:"Play sound for new messages",checked:l.notifications.sound,onChange:e=>d("notifications","sound",e),disabled:!l.notifications.enabled}),(0,s.jsx)(em,{label:"Desktop notifications",description:"Show system notifications",checked:l.notifications.desktop,onChange:e=>d("notifications","desktop",e),disabled:!l.notifications.enabled}),(0,s.jsx)(em,{label:"Mentions only",description:"Only notify when mentioned",checked:l.notifications.mentionsOnly,onChange:e=>d("notifications","mentionsOnly",e),disabled:!l.notifications.enabled})]})}),"connection"===c&&(0,s.jsx)("div",{className:"settings-section",children:(0,s.jsxs)("div",{className:"settings-group",children:[(0,s.jsx)("label",{className:"settings-label",children:"Connection Settings"}),(0,s.jsx)(em,{label:"Auto-reconnect",description:"Automatically reconnect on disconnect",checked:l.connection.autoReconnect,onChange:e=>d("connection","autoReconnect",e)}),(0,s.jsxs)("div",{className:"settings-input-group",children:[(0,s.jsx)("label",{children:"Reconnect delay (ms)"}),(0,s.jsx)("input",{type:"number",className:"settings-input",value:l.connection.reconnectDelay,onChange:e=>d("connection","reconnectDelay",parseInt(e.target.value)||3e3),min:1e3,max:3e4,step:1e3,disabled:!l.connection.autoReconnect})]}),(0,s.jsxs)("div",{className:"settings-input-group",children:[(0,s.jsx)("label",{children:"Keep-alive interval (ms)"}),(0,s.jsx)("input",{type:"number",className:"settings-input",value:l.connection.keepAliveInterval,onChange:e=>d("connection","keepAliveInterval",parseInt(e.target.value)||3e4),min:5e3,max:12e4,step:5e3})]})]})})]}),(0,s.jsxs)("div",{className:"settings-footer",children:[i&&(0,s.jsx)("button",{className:"settings-reset-btn",onClick:i,children:"Reset to defaults"}),(0,s.jsx)("button",{className:"settings-done-btn",onClick:n,children:"Done"})]})]})}):null}function em(e){let{label:t,description:n,checked:a,onChange:l,disabled:r}=e;return(0,s.jsxs)("div",{className:"settings-toggle-option ".concat(r?"disabled":""),children:[(0,s.jsxs)("div",{className:"settings-toggle-info",children:[(0,s.jsx)("span",{className:"settings-toggle-label",children:t}),(0,s.jsx)("span",{className:"settings-toggle-desc",children:n})]}),(0,s.jsx)("button",{className:"settings-toggle ".concat(a?"on":""),onClick:()=>!r&&l(!a),disabled:r,role:"switch","aria-checked":a,children:(0,s.jsx)("span",{className:"settings-toggle-thumb"})})]})}function ex(){return(0,s.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,s.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function ep(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("circle",{cx:"13.5",cy:"6.5",r:".5"}),(0,s.jsx)("circle",{cx:"17.5",cy:"10.5",r:".5"}),(0,s.jsx)("circle",{cx:"8.5",cy:"7.5",r:".5"}),(0,s.jsx)("circle",{cx:"6.5",cy:"12.5",r:".5"}),(0,s.jsx)("path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.555C21.965 6.012 17.461 2 12 2z"})]})}function eg(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("path",{d:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"}),(0,s.jsx)("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})]})}function ef(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("path",{d:"M5 12.55a11 11 0 0 1 14.08 0"}),(0,s.jsx)("path",{d:"M1.42 9a16 16 0 0 1 21.16 0"}),(0,s.jsx)("path",{d:"M8.53 16.11a6 6 0 0 1 6.95 0"}),(0,s.jsx)("line",{x1:"12",y1:"20",x2:"12.01",y2:"20"})]})}function ej(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"5"}),(0,s.jsx)("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),(0,s.jsx)("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),(0,s.jsx)("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),(0,s.jsx)("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),(0,s.jsx)("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),(0,s.jsx)("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),(0,s.jsx)("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),(0,s.jsx)("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]})}function ev(){return(0,s.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,s.jsx)("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})})}function ey(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",ry:"2"}),(0,s.jsx)("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),(0,s.jsx)("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]})}function ek(e,t){let n=e.match(/^@(\S*)/);return n&&t<=n[0].length?n[1]:null}function ew(e,t){let n=e.match(/^@\S*/);return n?"@".concat(t," ")+e.substring(n[0].length):e}function eN(e){let{agents:t,inputValue:n,cursorPosition:l,onSelect:r,onClose:i,isVisible:c}=e,[o,h]=(0,a.useState)(0),m=(0,a.useRef)(null),x=(0,a.useMemo)(()=>ek(n,l),[n,l]),p=(0,a.useMemo)(()=>{if(null===x)return[];let e=x.toLowerCase(),n=[];return("*".includes(e)||"everyone".includes(e)||"all".includes(e)||"broadcast".includes(e)||""===e)&&n.push({name:"*",displayName:"@everyone",description:"Broadcast to all agents",isBroadcast:!0}),t.filter(t=>t.name.toLowerCase().includes(e)).forEach(e=>{n.push({name:e.name,displayName:"@".concat(e.name),description:e.status||"Agent"})}),n},[x,t]);(0,a.useEffect)(()=>{h(0)},[p.length]),(0,a.useEffect)(()=>{if(!m.current)return;let e=m.current.querySelector(".mention-item.selected");e&&e.scrollIntoView({block:"nearest"})},[o]);let g=(0,a.useCallback)(e=>{if(c&&0!==p.length)switch(e.key){case"ArrowDown":e.preventDefault(),h(e=>(e+1)%p.length);break;case"ArrowUp":e.preventDefault(),h(e=>(e-1+p.length)%p.length);break;case"Enter":case"Tab":e.preventDefault();let t=p[o];if(t){let e=ew(n,t.name);r(t.name,e)}break;case"Escape":e.preventDefault(),i()}},[c,p,o,n,r,i]);(0,a.useEffect)(()=>{if(c)return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[c,g]);let f=(0,a.useCallback)(e=>{let t=ew(n,e.name);r(e.name,t)},[n,r]);return c&&0!==p.length?(0,s.jsx)("div",{className:"mention-autocomplete",ref:m,children:p.map((e,t)=>(0,s.jsxs)("div",{className:"mention-item ".concat(t===o?"selected":""),onClick:()=>f(e),onMouseEnter:()=>h(t),children:[(0,s.jsx)("div",{className:"mention-avatar",style:{background:e.isBroadcast?"var(--accent-warning, #f59e0b)":d(e.name).primary},children:e.isBroadcast?"*":u(e.name)}),(0,s.jsxs)("div",{className:"mention-info",children:[(0,s.jsx)("span",{className:"mention-name",children:e.displayName}),(0,s.jsx)("span",{className:"mention-description",children:e.description})]})]},e.name))}):null}let eb={url:"",autoConnect:!0,reconnect:!0,maxReconnectAttempts:10,reconnectDelay:1e3},eC={async sendMessage(e){try{let t=await fetch("".concat("","/api/send"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),n=await t.json();if(t.ok&&n.success)return{success:!0};return{success:!1,error:n.error||"Failed to send message"}}catch(e){return{success:!1,error:"Network error"}}},async spawnAgent(e){try{let t=await fetch("".concat("","/api/spawn"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await t.json()}catch(t){return{success:!1,name:e.name,error:"Network error"}}},async getSpawnedAgents(){try{let e=await fetch("".concat("","/api/spawned")),t=await e.json();if(e.ok&&t.success)return{success:!0,data:{agents:t.agents||[]}};return{success:!1,error:t.error}}catch(e){return{success:!1,error:"Network error"}}},async releaseAgent(e){try{let t=await fetch("".concat("","/api/spawned/").concat(encodeURIComponent(e)),{method:"DELETE"}),n=await t.json();if(t.ok&&n.success)return{success:!0};return{success:!1,error:n.error}}catch(e){return{success:!1,error:"Network error"}}},async getData(){try{let e=await fetch("".concat("","/api/data")),t=await e.json();if(e.ok)return{success:!0,data:t};return{success:!1,error:"Failed to fetch data"}}catch(e){return{success:!1,error:"Network error"}}},async getBridgeData(){try{let e=await fetch("".concat("","/api/bridge")),t=await e.json();if(e.ok)return{success:!0,data:t};return{success:!1,error:"Failed to fetch bridge data"}}catch(e){return{success:!1,error:"Network error"}}},async getMetrics(){try{let e=await fetch("".concat("","/api/metrics")),t=await e.json();if(e.ok)return{success:!0,data:t};return{success:!1,error:"Failed to fetch metrics"}}catch(e){return{success:!1,error:"Network error"}}}};function eS(e){var t,n,l,r;let{wsUrl:i}=e,{data:c,isConnected:o,error:u}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={...eb,...e},n=t.url||function(){let e="https:"===window.location.protocol?"wss:":"ws:";return"".concat(e,"//localhost:3888/ws")}(),[s,l]=(0,a.useState)(null),[r,i]=(0,a.useState)(!1),[c,o]=(0,a.useState)(null),d=(0,a.useRef)(null),u=(0,a.useRef)(0),h=(0,a.useRef)(null),m=(0,a.useCallback)(()=>{var e;if((null===(e=d.current)||void 0===e?void 0:e.readyState)!==WebSocket.OPEN)try{let e=new WebSocket(n);e.onopen=()=>{i(!0),o(null),u.current=0},e.onclose=()=>{if(i(!1),d.current=null,t.reconnect&&u.current<t.maxReconnectAttempts){let e=Math.min(t.reconnectDelay*Math.pow(2,u.current),3e4);u.current++,h.current=setTimeout(()=>{m()},e)}},e.onerror=e=>{o(Error("WebSocket connection error")),console.error("[useWebSocket] Error:",e)},e.onmessage=e=>{try{let t=JSON.parse(e.data);l(t)}catch(e){console.error("[useWebSocket] Failed to parse message:",e)}},d.current=e}catch(e){o(e instanceof Error?e:Error("Failed to create WebSocket"))}},[n,t.reconnect,t.maxReconnectAttempts,t.reconnectDelay]),x=(0,a.useCallback)(()=>{h.current&&(clearTimeout(h.current),h.current=null),d.current&&(d.current.close(),d.current=null),i(!1)},[]);return(0,a.useEffect)(()=>(t.autoConnect&&m(),()=>{x()}),[t.autoConnect,m,x]),{data:s,isConnected:r,error:c,connect:m,disconnect:x}}({url:i}),[m,x]=(0,a.useState)("local"),[g,j]=(0,a.useState)([]),[v,y]=(0,a.useState)(),[k,w]=(0,a.useState)(!1),[N,b]=(0,a.useState)(!1),[C,S]=(0,a.useState)(null),[A,M]=(0,a.useState)(!1),[E,D]=(0,a.useState)(!1),[B,W]=(0,a.useState)(eu),[L,R]=(0,a.useState)(!1),T=(0,a.useCallback)(()=>{window.innerWidth<=768&&R(!1)},[]),{agents:O,groups:F,selectedAgent:V,selectAgent:_,searchQuery:I,setSearchQuery:H,totalCount:K,onlineCount:U,needsAttentionCount:J}=function(e){let{agents:t,initialSelected:n,initialSearchQuery:s=""}=e,[l,r]=(0,a.useState)(null!=n?n:null),[i,c]=(0,a.useState)(s),o=(0,a.useMemo)(()=>p(t,i),[t,i]),u=(0,a.useMemo)(()=>h(o),[o]),m=(0,a.useMemo)(()=>[...o].sort((e,t)=>e.name.localeCompare(t.name)),[o]),x=(0,a.useMemo)(()=>{var e;return null!==(e=t.find(e=>e.name===l))&&void 0!==e?e:null},[t,l]),g=(0,a.useMemo)(()=>{let e=f(t);return{totalCount:e.total,onlineCount:e.online,needsAttentionCount:e.needsAttention}},[t]),j=(0,a.useCallback)(e=>{r(e)},[]),v=(0,a.useCallback)(e=>t.find(t=>t.name===e),[t]),y=(0,a.useCallback)(e=>({...e,color:d(e.name)}),[]);return{agents:o,groups:u,sortedAgents:m,selectedAgent:x,selectAgent:j,searchQuery:i,setSearchQuery:c,...g,getAgentByName:v,getAgentWithColor:y}}({agents:null!==(l=null==c?void 0:c.agents)&&void 0!==l?l:[]}),{messages:G,currentChannel:Q,setCurrentChannel:$,currentThread:Y,setCurrentThread:X,sendMessage:ee,isSending:et,sendError:en}=function(e){let{messages:t,currentChannel:n="general"}=e,[s,l]=(0,a.useState)(n),[r,i]=(0,a.useState)(null),[c,o]=(0,a.useState)(!1),[d,u]=(0,a.useState)(null),h=(0,a.useMemo)(()=>"general"===s?t:t.filter(e=>e.from===s||e.to===s),[t,s]),m=(0,a.useCallback)(e=>t.filter(t=>t.thread===e),[t]),x=(0,a.useMemo)(()=>{let e=t.filter(e=>!e.isRead).length;return{totalCount:t.length,unreadCount:e}},[t]);return{messages:h,threadMessages:m,currentChannel:s,setCurrentChannel:l,currentThread:r,setCurrentThread:i,sendMessage:(0,a.useCallback)(async(e,t,n)=>{o(!0),u(null);try{let s=await fetch("/api/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({to:e,message:t,thread:n})}),a=await s.json();if(s.ok&&a.success)return!0;return u(a.error||"Failed to send message"),!1}catch(e){return u("Network error"),!1}finally{o(!1)}},[]),isSending:c,sendError:d,...x}}({messages:null!==(r=null==c?void 0:c.messages)&&void 0!==r?r:[]}),es=!!(null==c?void 0:null===(n=c.fleet)||void 0===n?void 0:null===(t=n.servers)||void 0===t?void 0:t.length);(0,a.useEffect)(()=>{if(!es)return;let e=async()=>{let e=await eC.getBridgeData();if(e.success&&e.data){let{servers:t,agents:n}=e.data;j(t.map(e=>({id:e.id,path:e.url,name:e.name||e.url.split("/").pop(),agents:n.filter(t=>t.server===e.id),lead:void 0})))}};e();let t=setInterval(e,3e4);return()=>clearInterval(t)},[es]);let ea=(0,a.useCallback)(e=>{y(e.id),e.agents.length>0&&(_(e.agents[0].name),$(e.agents[0].name)),T()},[_,$,T]),el=(0,a.useCallback)(e=>{_(e.name),$(e.name),T()},[_,$,T]),ei=(0,a.useCallback)(()=>{S(null),w(!0)},[]),ec=(0,a.useCallback)(()=>{D(!0)},[]),eo=(0,a.useCallback)(async e=>{b(!0),S(null);try{let t=await eC.spawnAgent({name:e.name,cli:e.command,team:e.team});if(!t.success)return S(t.error||"Failed to spawn agent"),!1;return!0}catch(e){return S(e instanceof Error?e.message:"Failed to spawn agent"),!1}finally{b(!1)}},[]),ed=(0,a.useCallback)(async e=>{if(e.isSpawned&&window.confirm('Are you sure you want to release agent "'.concat(e.name,'"?')))try{let t=await eC.releaseAgent(e.name);t.success||console.error("Failed to release agent:",t.error)}catch(e){console.error("Failed to release agent:",e)}},[]),em=(0,a.useCallback)(()=>{M(!0)},[]);return a.useEffect(()=>{let e=e=>{let t;t="system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e,document.documentElement.setAttribute("data-theme",t)};if(e(B.theme),"system"===B.theme){let t=window.matchMedia("(prefers-color-scheme: dark)"),n=()=>e("system");return t.addEventListener("change",n),()=>t.removeEventListener("change",n)}},[B.theme]),a.useEffect(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&"k"===e.key&&(e.preventDefault(),M(!0)),(e.metaKey||e.ctrlKey)&&e.shiftKey&&"s"===e.key&&(e.preventDefault(),ei()),"Escape"===e.key&&(M(!1),w(!1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[ei]),(0,s.jsxs)("div",{className:"dashboard-app",children:[(0,s.jsx)("div",{className:"sidebar-overlay ".concat(L?"visible":""),onClick:()=>R(!1)}),(0,s.jsx)(P,{agents:O,projects:g,currentProject:v,selectedAgent:null==V?void 0:V.name,viewMode:m,isFleetAvailable:es,isConnected:o,isOpen:L,onAgentSelect:el,onProjectSelect:ea,onViewModeChange:x,onSpawnClick:ei,onReleaseClick:ed,onClose:()=>R(!1)}),(0,s.jsxs)("main",{className:"dashboard-main",children:[(0,s.jsx)(z,{currentChannel:Q,selectedAgent:V,onCommandPaletteOpen:em,onSettingsClick:ec,onMenuClick:()=>R(!0)}),(0,s.jsx)("div",{className:"dashboard-content",children:u?(0,s.jsxs)("div",{className:"error-state",children:[(0,s.jsx)(eE,{}),(0,s.jsx)("h2",{children:"Connection Error"}),(0,s.jsx)("p",{children:u.message}),(0,s.jsx)("button",{onClick:()=>window.location.reload(),children:"Retry Connection"})]}):c?(0,s.jsx)("div",{className:"messages-container",children:(0,s.jsx)(q,{messages:G,currentChannel:Q,onThreadClick:e=>X(e),highlightedMessageId:null!=Y?Y:void 0})}):(0,s.jsxs)("div",{className:"loading-state",children:[(0,s.jsx)(eM,{}),(0,s.jsx)("p",{children:"Connecting to dashboard..."})]})}),(0,s.jsx)("div",{className:"message-composer",children:(0,s.jsx)(eA,{recipient:"general"===Q?"*":Q,agents:O,onSend:ee,isSending:et,error:en})})]}),(0,s.jsx)(Z,{isOpen:A,onClose:()=>M(!1),agents:O,projects:g,currentProject:v,onAgentSelect:el,onProjectSelect:ea,onSpawnClick:ei,onGeneralClick:()=>{_(null),$("general")}}),(0,s.jsx)(er,{isOpen:k,onClose:()=>w(!1),onSpawn:eo,existingAgents:O.map(e=>e.name),isSpawning:N,error:C}),(0,s.jsx)(eh,{isOpen:E,onClose:()=>D(!1),settings:B,onSettingsChange:W,onResetSettings:()=>W(eu)})]})}function eA(e){let{recipient:t,agents:n,onSend:l,isSending:r,error:i}=e,[c,o]=(0,a.useState)(""),[d,u]=(0,a.useState)(0),[h,m]=(0,a.useState)(!1),x=(0,a.useRef)(null),p=async e=>{let n,s;if(e.preventDefault(),!c.trim()||r)return;let a=c.match(/^@(\S+)\s*([\s\S]*)/);if(a){let e=a[1];s=a[2]||"",n="*"===e||"everyone"===e.toLowerCase()||"all"===e.toLowerCase()?"*":e}else n=t,s=c;await l(n,s||c)&&(o(""),m(!1))};return(0,s.jsxs)("form",{className:"composer-form",onSubmit:p,children:[(0,s.jsxs)("div",{className:"composer-input-wrapper",children:[(0,s.jsx)(eN,{agents:n,inputValue:c,cursorPosition:d,onSelect:(e,t)=>{o(t),m(!1),setTimeout(()=>{if(x.current){x.current.focus();let e=t.indexOf(" ")+1;x.current.setSelectionRange(e,e)}},0)},onClose:()=>m(!1),isVisible:h}),(0,s.jsx)("textarea",{ref:x,className:"composer-input",placeholder:"Message ".concat("*"===t?"everyone":"@"+t,"... (Shift+Enter for new line)"),value:c,onChange:e=>{let t=e.target.value,n=e.target.selectionStart||0;o(t),u(n),m(null!==ek(t,n))},onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),c.trim()&&!r&&p(e))},onSelect:e=>u(e.target.selectionStart||0),disabled:r,rows:1})]}),(0,s.jsx)("button",{type:"submit",className:"composer-send",disabled:!c.trim()||r,title:r?"Sending...":"Send message",children:r?(0,s.jsx)("span",{className:"composer-send-text",children:"Sending..."}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"composer-send-text",children:"Send"}),(0,s.jsxs)("svg",{className:"composer-send-icon",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),(0,s.jsx)("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})]})}),i&&(0,s.jsx)("span",{className:"composer-error",children:i})]})}function eM(){return(0,s.jsx)("svg",{className:"spinner",width:"24",height:"24",viewBox:"0 0 24 24",children:(0,s.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",fill:"none",strokeDasharray:"32",strokeLinecap:"round"})})}function eE(){return(0,s.jsxs)("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,s.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,s.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})}function eD(){return(0,s.jsx)(eS,{})}}},function(e){e.O(0,[971,117,744],function(){return e(e.s=8440)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{8440:function(e,t,n){Promise.resolve().then(n.bind(n,7666))},7666:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return eD}});var s=n(7437),a=n(2265);let l={backend:{primary:"#1264a3",light:"#e8f4fd",dark:"#0d4f82",text:"#ffffff"},frontend:{primary:"#7c3aed",light:"#f3e8ff",dark:"#5b21b6",text:"#ffffff"},infra:{primary:"#ea580c",light:"#fff7ed",dark:"#c2410c",text:"#ffffff"},lead:{primary:"#2bac76",light:"#ecfdf5",dark:"#059669",text:"#ffffff"},test:{primary:"#0d9488",light:"#f0fdfa",dark:"#0f766e",text:"#ffffff"},data:{primary:"#dc2626",light:"#fef2f2",dark:"#b91c1c",text:"#ffffff"},api:{primary:"#2563eb",light:"#eff6ff",dark:"#1d4ed8",text:"#ffffff"},worker:{primary:"#9333ea",light:"#faf5ff",dark:"#7e22ce",text:"#ffffff"},monitor:{primary:"#0891b2",light:"#ecfeff",dark:"#0e7490",text:"#ffffff"},security:{primary:"#be123c",light:"#fff1f2",dark:"#9f1239",text:"#ffffff"}},r=[{primary:"#6366f1",light:"#eef2ff",dark:"#4f46e5",text:"#ffffff"},{primary:"#ec4899",light:"#fdf2f8",dark:"#db2777",text:"#ffffff"},{primary:"#14b8a6",light:"#f0fdfa",dark:"#0d9488",text:"#ffffff"},{primary:"#f59e0b",light:"#fffbeb",dark:"#d97706",text:"#000000"},{primary:"#8b5cf6",light:"#f5f3ff",dark:"#7c3aed",text:"#ffffff"},{primary:"#06b6d4",light:"#ecfeff",dark:"#0891b2",text:"#ffffff"},{primary:"#f43f5e",light:"#fff1f2",dark:"#e11d48",text:"#ffffff"},{primary:"#84cc16",light:"#f7fee7",dark:"#65a30d",text:"#000000"}],i={online:"#22c55e",offline:"#6b7280",busy:"#eab308",processing:"#6366f1",error:"#ef4444",attention:"#ef4444"};function c(e){return e.toLowerCase().split("-").filter(Boolean)}function o(e){return c(e)[0]||e.toLowerCase()}function d(e){let t=o(e);return t in l?l[t]:r[function(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return Math.abs(t)}(t)%r.length]}function u(e){let t=c(e);return 0===t.length?e.substring(0,2).toUpperCase():t.length>=2?(t[0][0]+t[1][0]).toUpperCase():t[0].substring(0,2).toUpperCase()}function h(e){let t=new Map;for(let n of e){let e=n.team||o(n.name),s=d(n.name),a=t.get(e);a||(a={prefix:e,displayName:g(e),color:s,agents:[],isExpanded:!0},t.set(e,a)),a.agents.push(n)}let n=Array.from(t.values()).sort((e,t)=>e.prefix.localeCompare(t.prefix));for(let e of n)e.agents.sort((e,t)=>e.name.localeCompare(t.name));return n}function m(e){let t=e.split("-").filter(Boolean);return 0===t.length?e:g(t[t.length-1])}function x(e){return e.split("-").filter(Boolean).map(g).join(" > ")}function p(e,t){return t?e.filter(e=>(function(e,t){if(!t)return!0;let n=t.toLowerCase(),s=e.toLowerCase();return!!s.includes(n)||s.split("-").some(e=>e.includes(n))})(e.name,t)):e}function g(e){return e?e.charAt(0).toUpperCase()+e.slice(1):e}function f(e){let t=0,n=0,s=0;for(let a of e)"online"===a.status?t++:"offline"===a.status&&n++,a.needsAttention&&s++;return{total:e.length,online:t,offline:n,needsAttention:s}}function j(e){let{isProcessing:t,processingStartedAt:n,size:l="medium",showElapsed:r=!1}=e,[i,c]=(0,a.useState)(0);return((0,a.useEffect)(()=>{if(!t||!n){c(0);return}let e=()=>{c(Date.now()-n)};e();let s=setInterval(e,1e3);return()=>clearInterval(s)},[t,n]),t)?(0,s.jsxs)("div",{className:"thinking-indicator ".concat({small:"thinking-indicator-small",medium:"thinking-indicator-medium",large:"thinking-indicator-large"}[l]),children:[(0,s.jsxs)("div",{className:"thinking-dots",children:[(0,s.jsx)("span",{className:"thinking-dot"}),(0,s.jsx)("span",{className:"thinking-dot"}),(0,s.jsx)("span",{className:"thinking-dot"})]}),r&&i>0&&(0,s.jsx)("span",{className:"thinking-elapsed",children:(e=>{let t=Math.floor(e/1e3);return t<60?"".concat(t,"s"):"".concat(Math.floor(t/60),"m ").concat(t%60,"s")})(i)})]}):null}function v(e){let{isProcessing:t}=e;return t?(0,s.jsx)("span",{className:"thinking-dot-inline",title:"Processing...",children:(0,s.jsx)("span",{className:"thinking-dot-pulse"})}):null}function y(e){let{agent:t,isSelected:n=!1,showBreadcrumb:a=!1,compact:l=!1,displayNameOverride:r,onClick:c,onMessageClick:o,onReleaseClick:h}=e,p=d(t.name),g=u(t.name),f=r||m(t.name),y=i[t.status]||i.offline,N=()=>{null==c||c(t)},b=e=>{e.stopPropagation(),null==h||h(t)};return l?(0,s.jsxs)("div",{className:"agent-card-compact ".concat(n?"selected":""),onClick:N,style:{"--agent-primary":p.primary,"--agent-light":p.light},children:[(0,s.jsx)("div",{className:"agent-avatar-small",style:{backgroundColor:p.primary},children:(0,s.jsx)("span",{style:{color:p.text},children:g})}),(0,s.jsxs)("div",{className:"agent-compact-info",children:[(0,s.jsx)("span",{className:"agent-name",children:f}),!r&&(0,s.jsx)("span",{className:"agent-breadcrumb-compact",children:x(t.name)})]}),(0,s.jsxs)("div",{className:"agent-compact-actions",children:[t.isSpawned&&h&&(0,s.jsx)("button",{className:"release-btn-compact",onClick:b,title:"Kill agent",children:(0,s.jsx)(w,{})}),t.isProcessing?(0,s.jsx)(v,{isProcessing:!0}):(0,s.jsx)("div",{className:"agent-status-dot",style:{backgroundColor:y}}),t.needsAttention&&(0,s.jsx)("div",{className:"attention-badge"})]})]}):(0,s.jsxs)("div",{className:"agent-card ".concat(n?"selected":""),onClick:N,style:{"--agent-primary":p.primary,"--agent-light":p.light,"--agent-dark":p.dark},children:[(0,s.jsxs)("div",{className:"agent-card-header",children:[(0,s.jsxs)("div",{className:"agent-avatar",style:{backgroundColor:p.primary},children:[(0,s.jsx)("span",{style:{color:p.text},children:g}),(0,s.jsx)("div",{className:"status-indicator",style:{backgroundColor:y}})]}),(0,s.jsxs)("div",{className:"agent-info",children:[(0,s.jsxs)("div",{className:"agent-name-row",children:[(0,s.jsx)("span",{className:"agent-display-name",children:f}),t.needsAttention&&(0,s.jsx)("span",{className:"attention-badge",title:"Needs attention",children:"!"})]}),a?(0,s.jsx)("span",{className:"agent-breadcrumb",children:x(t.name)}):(0,s.jsx)("span",{className:"agent-full-name",children:t.name})]})]}),t.isProcessing&&(0,s.jsxs)("div",{className:"agent-thinking",children:[(0,s.jsx)(j,{isProcessing:!0,processingStartedAt:t.processingStartedAt,size:"medium",showElapsed:!0}),(0,s.jsx)("span",{className:"thinking-label",children:"Thinking..."})]}),t.currentTask&&!t.isProcessing&&(0,s.jsxs)("div",{className:"agent-task",children:[(0,s.jsx)("span",{className:"task-label",children:"Working on:"}),(0,s.jsx)("span",{className:"task-text",children:t.currentTask})]}),(0,s.jsxs)("div",{className:"agent-card-footer",children:[(0,s.jsxs)("div",{className:"agent-meta",children:[t.cli&&(0,s.jsx)("span",{className:"agent-cli",children:t.cli}),void 0!==t.messageCount&&t.messageCount>0&&(0,s.jsxs)("span",{className:"message-count",children:[t.messageCount," msgs"]}),t.isSpawned&&(0,s.jsx)("span",{className:"agent-spawned-badge",children:"spawned"})]}),(0,s.jsxs)("div",{className:"agent-actions",children:[t.isSpawned&&h&&(0,s.jsx)("button",{className:"release-btn",onClick:b,title:"Release agent",children:(0,s.jsx)(w,{})}),o&&(0,s.jsx)("button",{className:"message-btn",onClick:e=>{e.stopPropagation(),null==o||o(t)},title:"Send message",children:(0,s.jsx)(k,{})})]})]})]})}function k(){return(0,s.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,s.jsx)("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})}function w(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",className:"release-icon",children:[(0,s.jsx)("path",{d:"M12 22c5.523 0 10-4.477 10-10a9.96 9.96 0 0 0-3-7.141",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),(0,s.jsx)("path",{d:"M12 22C6.477 22 2 17.523 2 12a9.96 9.96 0 0 1 3-7.141",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),(0,s.jsx)("line",{x1:"12",y1:"2",x2:"12",y2:"12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})]})}function N(e){let{agents:t,selectedAgent:n,searchQuery:l="",onAgentSelect:r,onAgentMessage:i,onReleaseClick:c,compact:o=!1,showGroupStats:d=!0}=e,[u,m]=(0,a.useState)(new Set),[x,g]=(0,a.useState)(!0),f=(0,a.useMemo)(()=>p(t,l),[t,l]),j=(0,a.useMemo)(()=>h(f),[f]);(0,a.useMemo)(()=>{0===u.size&&j.length>0&&m(new Set(j.map(e=>e.prefix)))},[j]);let v=e=>{m(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return 0===t.length?(0,s.jsxs)("div",{className:"agent-list-empty",children:[(0,s.jsx)(S,{}),(0,s.jsx)("p",{children:"No agents connected"})]}):0===f.length?(0,s.jsxs)("div",{className:"agent-list-empty",children:[(0,s.jsx)(A,{}),(0,s.jsxs)("p",{children:['No agents match "',l,'"']})]}):(0,s.jsxs)("div",{className:"agent-list",children:[j.length>1&&(0,s.jsxs)("div",{className:"agent-list-header",children:[(0,s.jsxs)("span",{className:"agent-count",children:[f.length," agents"]}),(0,s.jsx)("button",{className:"toggle-all-btn",onClick:()=>{x?m(new Set):m(new Set(j.map(e=>e.prefix))),g(!x)},children:x?"Collapse all":"Expand all"})]}),j.map(e=>(0,s.jsx)(b,{group:e,isExpanded:u.has(e.prefix),selectedAgent:n,compact:o,showStats:d,onToggle:()=>v(e.prefix),onAgentSelect:r,onAgentMessage:i,onReleaseClick:c},e.prefix))]})}function b(e){let{group:t,isExpanded:n,selectedAgent:a,compact:l,showStats:r,onToggle:c,onAgentSelect:o,onAgentMessage:d,onReleaseClick:u}=e,h=r?f(t.agents):null;return(0,s.jsxs)("div",{className:"agent-group",children:[(0,s.jsxs)("button",{className:"agent-group-header",onClick:c,style:{"--group-color":t.color.primary,"--group-light":t.color.light},children:[(0,s.jsx)("div",{className:"group-color-bar"}),(0,s.jsx)(C,{expanded:n}),(0,s.jsx)("span",{className:"group-name",children:t.displayName}),(0,s.jsxs)("span",{className:"group-count",children:["(",t.agents.length,")"]}),r&&h&&(0,s.jsxs)("div",{className:"group-stats",children:[h.online>0&&(0,s.jsxs)("span",{className:"stat online",children:[(0,s.jsx)("span",{className:"stat-dot",style:{backgroundColor:i.online}}),h.online]}),h.needsAttention>0&&(0,s.jsxs)("span",{className:"stat attention",children:[(0,s.jsx)("span",{className:"stat-dot",style:{backgroundColor:i.attention}}),h.needsAttention]})]})]}),n&&(0,s.jsx)("div",{className:"agent-group-content",children:t.agents.map(e=>(0,s.jsx)(y,{agent:e,isSelected:e.name===a,compact:l,displayNameOverride:m(e.name),onClick:o,onMessageClick:d,onReleaseClick:u},e.name))})]})}function C(e){let{expanded:t}=e;return(0,s.jsx)("svg",{className:"chevron-icon ".concat(t?"expanded":""),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,s.jsx)("polyline",{points:"9 18 15 12 9 6"})})}function S(){return(0,s.jsxs)("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1",children:[(0,s.jsx)("circle",{cx:"12",cy:"8",r:"5"}),(0,s.jsx)("path",{d:"M20 21a8 8 0 1 0-16 0"})]})}function A(){return(0,s.jsxs)("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1",children:[(0,s.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,s.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}function M(e){return e.split(/[-_]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")}function E(e){let{projects:t,localAgents:n=[],currentProject:l,selectedAgent:r,searchQuery:i="",onProjectSelect:c,onAgentSelect:o,onReleaseClick:d,compact:u=!1}=e,[h,m]=(0,a.useState)(()=>new Set(t.map(e=>e.id))),x=(0,a.useMemo)(()=>{let e=i.toLowerCase().trim();if(!e)return{projects:t,localAgents:n};let s=n.filter(t=>{var n;return t.name.toLowerCase().includes(e)||(null===(n=t.currentTask)||void 0===n?void 0:n.toLowerCase().includes(e))});return{projects:t.map(t=>{var n;let s=(null===(n=t.name)||void 0===n?void 0:n.toLowerCase().includes(e))||t.path.toLowerCase().includes(e),a=t.agents.filter(t=>{var n;return t.name.toLowerCase().includes(e)||(null===(n=t.currentTask)||void 0===n?void 0:n.toLowerCase().includes(e))});return s||a.length>0?{...t,agents:s?t.agents:a}:null}).filter(Boolean),localAgents:s}},[t,n,i]),p=e=>{m(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},g=x.localAgents.length+x.projects.reduce((e,t)=>e+t.agents.length,0);return 0===g&&0===t.length&&0===n.length?(0,s.jsxs)("div",{className:"project-list-empty",children:[(0,s.jsx)(R,{}),(0,s.jsx)("p",{children:"No projects or agents"})]}):0===g&&i?(0,s.jsxs)("div",{className:"project-list-empty",children:[(0,s.jsx)(T,{}),(0,s.jsxs)("p",{children:['No results for "',i,'"']})]}):(0,s.jsxs)("div",{className:"project-list",children:[x.localAgents.length>0&&(0,s.jsx)(D,{project:{id:"__local__",path:"",name:"Local",agents:x.localAgents},isExpanded:h.has("__local__"),isCurrentProject:!0,selectedAgent:r,compact:u,onToggle:()=>p("__local__"),onAgentSelect:e=>null==o?void 0:o(e),onReleaseClick:d}),x.projects.map(e=>(0,s.jsx)(D,{project:e,isExpanded:h.has(e.id),isCurrentProject:e.id===l,selectedAgent:r,compact:u,onToggle:()=>p(e.id),onProjectSelect:()=>null==c?void 0:c(e),onAgentSelect:t=>null==o?void 0:o(t,e),onReleaseClick:d},e.id))]})}function D(e){var t;let{project:n,isExpanded:l,isCurrentProject:r,selectedAgent:c,compact:o,onToggle:u,onProjectSelect:h,onAgentSelect:m,onReleaseClick:x}=e,[p,g]=(0,a.useState)(new Set),f=(0,a.useMemo)(()=>{let e=0,t=0;for(let s of n.agents)"online"===s.status&&e++,s.needsAttention&&t++;return{online:e,needsAttention:t,total:n.agents.length}},[n.agents]),{teams:j,ungroupedAgents:v}=(0,a.useMemo)(()=>{let e=new Map,t=[];for(let s of n.agents)if(s.team){let t=e.get(s.team)||[];t.push(s),e.set(s.team,t)}else t.push(s);return{teams:Array.from(e.entries()).map(e=>{let[t,n]=e;return{name:t,agents:n}}).sort((e,t)=>e.name.localeCompare(t.name)),ungroupedAgents:t}},[n.agents]),k=e=>{g(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};(0,a.useEffect)(()=>{l&&0===p.size&&j.length>0&&g(new Set(j.map(e=>e.name)))},[l,j,p]);let w=d(n.name||n.id),N=n.name||n.path.split("/").pop()||n.id;return(0,s.jsxs)("div",{className:"project-section ".concat(r?"current":""),children:[(0,s.jsxs)("button",{className:"project-header",onClick:u,onDoubleClick:h,style:{"--project-color":w.primary,"--project-light":w.light},children:[(0,s.jsx)("div",{className:"project-color-bar"}),(0,s.jsx)(B,{expanded:l}),(0,s.jsx)(W,{}),(0,s.jsx)("span",{className:"project-name",children:N}),(0,s.jsxs)("span",{className:"project-count",children:["(",f.total,")"]}),(0,s.jsxs)("div",{className:"project-stats",children:[f.online>0&&(0,s.jsxs)("span",{className:"stat online",children:[(0,s.jsx)("span",{className:"stat-dot",style:{backgroundColor:i.online}}),f.online]}),f.needsAttention>0&&(0,s.jsxs)("span",{className:"stat attention",children:[(0,s.jsx)("span",{className:"stat-dot",style:{backgroundColor:i.attention}}),f.needsAttention]})]}),(null===(t=n.lead)||void 0===t?void 0:t.connected)&&(0,s.jsx)("span",{className:"lead-indicator",title:"Lead: ".concat(n.lead.name),children:"★"})]}),l&&(0,s.jsxs)("div",{className:"project-agents",children:[j.map(e=>(0,s.jsxs)("div",{className:"team-group",children:[(0,s.jsxs)("button",{className:"team-header",onClick:()=>k(e.name),children:[(0,s.jsx)(B,{expanded:p.has(e.name)}),(0,s.jsx)(L,{}),(0,s.jsx)("span",{className:"team-name",children:e.name}),(0,s.jsxs)("span",{className:"team-count",children:["(",e.agents.length,")"]})]}),p.has(e.name)&&(0,s.jsx)("div",{className:"team-agents",children:e.agents.map(t=>(0,s.jsx)(y,{agent:t,isSelected:t.name===c,compact:o,displayNameOverride:function(e,t){let n=e.toLowerCase(),s=t.toLowerCase().replace(/-?team$/i,"");if(s&&n.startsWith(s+"-")||s&&n.startsWith(s+"_"))return M(e.substring(s.length+1));let a=e.split("-");return a.length>1?M(a[a.length-1]):M(e)}(t.name,e.name),onClick:m,onReleaseClick:x},t.name))})]},e.name)),v.map(e=>(0,s.jsx)(y,{agent:e,isSelected:e.name===c,compact:o,onClick:m,onReleaseClick:x},e.name))]})]})}function B(e){let{expanded:t}=e;return(0,s.jsx)("svg",{className:"chevron-icon ".concat(t?"expanded":""),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,s.jsx)("polyline",{points:"9 18 15 12 9 6"})})}function W(){return(0,s.jsx)("svg",{className:"folder-icon",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,s.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})})}function L(){return(0,s.jsxs)("svg",{className:"team-icon",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),(0,s.jsx)("circle",{cx:"9",cy:"7",r:"4"}),(0,s.jsx)("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),(0,s.jsx)("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]})}function R(){return(0,s.jsx)("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1",children:(0,s.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})})}function T(){return(0,s.jsxs)("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1",children:[(0,s.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,s.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}function P(e){let{agents:t,projects:n=[],currentProject:l,selectedAgent:r,viewMode:i,isFleetAvailable:c,isConnected:o,isOpen:d=!1,onAgentSelect:u,onProjectSelect:h,onViewModeChange:m,onSpawnClick:x,onReleaseClick:p,onClose:g}=e,[f,j]=(0,a.useState)(""),v=n.length>0;return(0,s.jsxs)("aside",{className:"sidebar ".concat(d?"open":""),children:[(0,s.jsxs)("div",{className:"sidebar-header",children:[(0,s.jsxs)("div",{className:"sidebar-title",children:[(0,s.jsx)("h1",{children:"Agent Relay"}),(0,s.jsx)(O,{isConnected:o})]}),c&&(0,s.jsxs)("div",{className:"view-mode-toggle",children:[(0,s.jsx)("button",{className:"toggle-btn ".concat("local"===i?"active":""),onClick:()=>null==m?void 0:m("local"),children:"Local"}),(0,s.jsx)("button",{className:"toggle-btn ".concat("fleet"===i?"active":""),onClick:()=>null==m?void 0:m("fleet"),children:"Fleet"})]})]}),(0,s.jsxs)("div",{className:"sidebar-search",children:[(0,s.jsx)(F,{}),(0,s.jsx)("input",{type:"text",placeholder:"Search agents...",value:f,onChange:e=>j(e.target.value)}),f&&(0,s.jsx)("button",{className:"clear-btn",onClick:()=>j(""),children:(0,s.jsx)(V,{})})]}),(0,s.jsx)("div",{className:"sidebar-content",children:v?(0,s.jsx)(E,{projects:n,localAgents:t,currentProject:l,selectedAgent:r,searchQuery:f,onProjectSelect:h,onAgentSelect:u,onReleaseClick:p,compact:!0}):(0,s.jsx)(N,{agents:t,selectedAgent:r,searchQuery:f,onAgentSelect:e=>null==u?void 0:u(e),onReleaseClick:p,compact:!0,showGroupStats:!0})}),(0,s.jsx)("div",{className:"sidebar-footer",children:(0,s.jsxs)("button",{className:"spawn-btn",onClick:x,children:[(0,s.jsx)(_,{}),"Spawn Agent"]})})]})}function O(e){let{isConnected:t}=e;return(0,s.jsx)("div",{className:"connection-indicator ".concat(t?"connected":"disconnected"),title:t?"Connected":"Disconnected"})}function F(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,s.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}function V(){return(0,s.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,s.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function _(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,s.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}function z(e){let{currentChannel:t,selectedAgent:n,onCommandPaletteOpen:a,onSettingsClick:l,onMenuClick:r}=e,i="general"===t,c=n?d(n.name):null;return(0,s.jsxs)("header",{className:"header",children:[(0,s.jsx)("button",{className:"mobile-menu-btn",onClick:r,"aria-label":"Open menu",children:(0,s.jsx)(U,{})}),(0,s.jsx)("div",{className:"header-left",children:i?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"channel-prefix",children:"#"}),(0,s.jsx)("span",{className:"channel-name",children:"general"}),(0,s.jsx)("span",{className:"channel-topic",children:"All agent communications"})]}):n?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"agent-avatar-small",style:{backgroundColor:null==c?void 0:c.primary},children:(0,s.jsx)("span",{style:{color:null==c?void 0:c.text},children:u(n.name)})}),(0,s.jsxs)("div",{className:"channel-info",children:[(0,s.jsx)("span",{className:"channel-name",children:n.name}),(0,s.jsx)("span",{className:"channel-breadcrumb",children:x(n.name)})]}),n.status&&(0,s.jsx)("span",{className:"agent-status-badge",children:n.status})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"channel-prefix",children:"@"}),(0,s.jsx)("span",{className:"channel-name",children:t})]})}),(0,s.jsxs)("div",{className:"header-right",children:[(0,s.jsxs)("button",{className:"header-btn command-palette-btn",onClick:a,title:"Command Palette (⌘K)",children:[(0,s.jsx)(I,{}),(0,s.jsx)("span",{children:"Search"}),(0,s.jsx)("kbd",{children:"⌘K"})]}),(0,s.jsx)("a",{href:"/metrics",className:"header-btn icon-btn",title:"Metrics",children:(0,s.jsx)(H,{})}),(0,s.jsx)("button",{className:"header-btn icon-btn",onClick:l,title:"Settings",children:(0,s.jsx)(K,{})})]})]})}function I(){return(0,s.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,s.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}function H(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("path",{d:"M3 3v18h18"}),(0,s.jsx)("path",{d:"M18 17V9"}),(0,s.jsx)("path",{d:"M13 17V5"}),(0,s.jsx)("path",{d:"M8 17v-3"})]})}function K(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"3"}),(0,s.jsx)("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"})]})}function U(){return(0,s.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),(0,s.jsx)("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),(0,s.jsx)("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})}function q(e){let{messages:t,currentChannel:n,onThreadClick:l,highlightedMessageId:r}=e,i=(0,a.useRef)(null),c=(0,a.useRef)(null);(0,a.useEffect)(()=>{var e;null===(e=c.current)||void 0===e||e.scrollIntoView({behavior:"smooth"})},[t.length]);let o=t.filter(e=>"general"===n?"*"===e.to||e.isBroadcast:e.from===n||e.to===n);return 0===o.length?(0,s.jsxs)("div",{className:"message-list-empty",children:[(0,s.jsx)(G,{}),(0,s.jsx)("h3",{children:"No messages yet"}),(0,s.jsx)("p",{children:"general"===n?"Broadcast messages will appear here":"Messages with ".concat(n," will appear here")})]}):(0,s.jsxs)("div",{className:"message-list",ref:i,children:[o.map(e=>(0,s.jsx)(J,{message:e,isHighlighted:e.id===r,onThreadClick:l},e.id)),(0,s.jsx)("div",{ref:c})]})}function J(e){let{message:t,isHighlighted:n,onThreadClick:l}=e,r=d(t.from),i=function(e){let t=new Date(e),n=new Date;if(t.toDateString()===n.toDateString())return t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});let s=new Date(n);return(s.setDate(s.getDate()-1),t.toDateString()===s.toDateString())?"Yesterday ".concat(t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})):t.toLocaleDateString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}(t.timestamp);return(0,s.jsxs)("div",{className:"message-item ".concat(n?"highlighted":""),children:[(0,s.jsx)("div",{className:"message-avatar",style:{backgroundColor:r.primary},children:(0,s.jsx)("span",{style:{color:r.text},children:u(t.from)})}),(0,s.jsxs)("div",{className:"message-content",children:[(0,s.jsxs)("div",{className:"message-header",children:[(0,s.jsx)("span",{className:"message-sender",children:t.from}),"*"!==t.to&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"message-arrow",children:"→"}),(0,s.jsx)("span",{className:"message-recipient",children:t.to})]}),(0,s.jsx)("span",{className:"message-time",children:i}),"*"===t.to&&(0,s.jsx)("span",{className:"message-badge broadcast",children:"broadcast"})]}),(0,s.jsx)("div",{className:"message-body",children:t.content.replace(/\\n/g,"\n").replace(/\r\n/g,"\n").replace(/\r/g,"\n").split("\n").map((e,t)=>(0,s.jsxs)(a.Fragment,{children:[t>0&&(0,s.jsx)("br",{}),function(e){let t=/(https?:\/\/[^\s]+)/g;return e.split(t).map((e,n)=>t.test(e)?(0,s.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"message-link",children:e},n):e)}(e)]},t))}),t.replyCount&&t.replyCount>0&&(0,s.jsxs)("button",{className:"message-thread-btn",onClick:()=>null==l?void 0:l(t.id),children:[(0,s.jsx)(Q,{}),(0,s.jsxs)("span",{children:[t.replyCount," ",1===t.replyCount?"reply":"replies"]})]})]})]})}function G(){return(0,s.jsx)("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})}function Q(){return(0,s.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,s.jsx)("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})}function Z(e){let{isOpen:t,onClose:n,agents:l,projects:r=[],currentProject:i,onAgentSelect:c,onProjectSelect:o,onSpawnClick:d,onSettingsClick:u,onGeneralClick:h,customCommands:m=[]}=e,[x,p]=(0,a.useState)(""),[g,f]=(0,a.useState)(0),j=(0,a.useRef)(null),v=(0,a.useRef)(null),y=(0,a.useMemo)(()=>[...r.map(e=>{let t=e.name||e.path.split("/").pop()||e.id,a=e.id===i;return{id:"project-".concat(e.id),label:t,description:a?"Current project • ".concat(e.agents.length," agents"):"".concat(e.agents.length," agents"),category:"projects",icon:(0,s.jsx)(es,{}),action:()=>{null==o||o(e),n()}}}),...l.map(e=>({id:"agent-".concat(e.name),label:e.name,description:e.currentTask||e.status,category:"agents",icon:(0,s.jsx)($,{name:e.name}),action:()=>{c(e),n()}})),{id:"spawn-agent",label:"Spawn Agent",description:"Launch a new agent instance",category:"actions",icon:(0,s.jsx)(X,{}),shortcut:"⌘⇧S",action:()=>{d(),n()}},{id:"broadcast",label:"Broadcast Message",description:"Send message to all agents",category:"actions",icon:(0,s.jsx)(ee,{}),action:()=>{n()}},{id:"nav-general",label:"Go to #general",description:"View all broadcast messages",category:"navigation",icon:(0,s.jsx)(et,{}),action:()=>{null==h||h(),n()}},...u?[{id:"settings",label:"Settings",description:"Configure dashboard preferences",category:"settings",icon:(0,s.jsx)(en,{}),shortcut:"⌘,",action:()=>{u(),n()}}]:[],...m],[l,r,i,c,o,d,u,h,n,m]),k=(0,a.useMemo)(()=>{if(!x.trim())return y;let e=x.toLowerCase();return y.filter(t=>{var n;return t.label.toLowerCase().includes(e)||(null===(n=t.description)||void 0===n?void 0:n.toLowerCase().includes(e))||t.category.toLowerCase().includes(e)})},[y,x]),w=(0,a.useMemo)(()=>{let e={};for(let t of k)e[t.category]||(e[t.category]=[]),e[t.category].push(t);return e},[k]),N=(0,a.useMemo)(()=>["projects","agents","actions","navigation","settings"].flatMap(e=>w[e]||[]),[w]);(0,a.useEffect)(()=>{f(0)},[x]),(0,a.useEffect)(()=>{t&&(p(""),f(0),setTimeout(()=>{var e;return null===(e=j.current)||void 0===e?void 0:e.focus()},0))},[t]),(0,a.useEffect)(()=>{if(v.current&&N.length>0){let e=v.current.querySelector('[data-index="'.concat(g,'"]'));null==e||e.scrollIntoView({block:"nearest"})}},[g,N.length]);let b=(0,a.useCallback)(e=>{switch(e.key){case"ArrowDown":e.preventDefault(),f(e=>Math.min(e+1,N.length-1));break;case"ArrowUp":e.preventDefault(),f(e=>Math.max(e-1,0));break;case"Enter":e.preventDefault(),N[g]&&N[g].action();break;case"Escape":e.preventDefault(),n()}},[N,g,n]);if(!t)return null;let C={projects:"Projects",agents:"Agents",actions:"Actions",navigation:"Navigation",settings:"Settings"},S=0;return(0,s.jsx)("div",{className:"command-palette-overlay",onClick:n,children:(0,s.jsxs)("div",{className:"command-palette",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"command-palette-input-wrapper",children:[(0,s.jsx)(Y,{}),(0,s.jsx)("input",{ref:j,type:"text",className:"command-palette-input",placeholder:"Search commands, agents...",value:x,onChange:e=>p(e.target.value),onKeyDown:b}),(0,s.jsx)("kbd",{className:"command-palette-kbd",children:"ESC"})]}),(0,s.jsx)("div",{className:"command-palette-list",ref:v,children:0===N.length?(0,s.jsxs)("div",{className:"command-palette-empty",children:['No results for "',x,'"']}):Object.entries(w).map(e=>{let[t,n]=e;return n.length?(0,s.jsxs)("div",{className:"command-palette-group",children:[(0,s.jsx)("div",{className:"command-palette-group-label",children:C[t]||t}),n.map(e=>{let t=S++;return(0,s.jsxs)("button",{"data-index":t,className:"command-palette-item ".concat(t===g?"selected":""),onClick:e.action,onMouseEnter:()=>f(t),children:[(0,s.jsx)("span",{className:"command-palette-item-icon",children:e.icon}),(0,s.jsxs)("span",{className:"command-palette-item-content",children:[(0,s.jsx)("span",{className:"command-palette-item-label",children:e.label}),e.description&&(0,s.jsx)("span",{className:"command-palette-item-desc",children:e.description})]}),e.shortcut&&(0,s.jsx)("kbd",{className:"command-palette-item-shortcut",children:e.shortcut})]},e.id)})]},t):null})})]})})}function $(e){let{name:t}=e,n=d(t);return(0,s.jsx)("div",{className:"command-palette-agent-icon",style:{backgroundColor:n.primary,color:n.text},children:u(t)})}function Y(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,s.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}function X(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,s.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}function ee(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"2"}),(0,s.jsx)("path",{d:"M16.24 7.76a6 6 0 0 1 0 8.49m-8.48-.01a6 6 0 0 1 0-8.49m11.31-2.82a10 10 0 0 1 0 14.14m-14.14 0a10 10 0 0 1 0-14.14"})]})}function et(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("line",{x1:"4",y1:"9",x2:"20",y2:"9"}),(0,s.jsx)("line",{x1:"4",y1:"15",x2:"20",y2:"15"}),(0,s.jsx)("line",{x1:"10",y1:"3",x2:"8",y2:"21"}),(0,s.jsx)("line",{x1:"16",y1:"3",x2:"14",y2:"21"})]})}function en(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"3"}),(0,s.jsx)("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"})]})}function es(){return(0,s.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,s.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})})}let ea=[{id:"claude",name:"Claude",command:"claude",description:"Claude Code CLI agent",icon:"\uD83E\uDD16"},{id:"codex",name:"Codex",command:"codex",description:"OpenAI Codex agent",icon:"⚡"},{id:"custom",name:"Custom",command:"",description:"Custom command",icon:"\uD83D\uDD27"}],el=["frontend","backend","lead","test","docs","review","deploy","data"];function er(e){let{isOpen:t,onClose:n,onSpawn:l,existingAgents:r,isSpawning:i=!1,error:c}=e,[o,h]=(0,a.useState)(ea[0]),[m,x]=(0,a.useState)(""),[p,g]=(0,a.useState)(""),[f,j]=(0,a.useState)(""),[v,y]=(0,a.useState)(""),[k,w]=(0,a.useState)(null),N=(0,a.useRef)(null),b=(0,a.useCallback)(()=>{let e="claude"===o.id?"claude":o.id,t=1;for(;r.includes("".concat(e,"-").concat(t));)t++;return"".concat(e,"-").concat(t)},[o,r]);(0,a.useEffect)(()=>{t&&(h(ea[0]),x(""),g(""),j(""),y(""),w(null),setTimeout(()=>{var e;return null===(e=N.current)||void 0===e?void 0:e.focus()},100))},[t]);let C=(0,a.useCallback)(e=>e.trim()?/^[a-zA-Z][a-zA-Z0-9-]*$/.test(e)?r.includes(e)?"An agent with this name already exists":null:"Name must start with a letter and contain only letters, numbers, and hyphens":"Name is required",[r]),S=async e=>{e.preventDefault();let t=m.trim()||b(),s=C(t);if(s){w(s);return}let a="custom"===o.id?p:o.command;if(!a.trim()){w("Command is required");return}w(null),await l({name:t,command:a.trim(),cwd:f.trim()||void 0,team:v.trim()||void 0})&&n()};if(!t)return null;let A=m?d(m):d(b()),M=c||k;return(0,s.jsx)("div",{className:"spawn-modal-overlay",onClick:n,children:(0,s.jsxs)("div",{className:"spawn-modal",onClick:e=>e.stopPropagation(),onKeyDown:e=>{"Escape"===e.key&&(e.preventDefault(),n())},children:[(0,s.jsxs)("div",{className:"spawn-modal-header",children:[(0,s.jsx)("h2",{children:"Spawn New Agent"}),(0,s.jsx)("button",{className:"spawn-modal-close",onClick:n,"aria-label":"Close",children:(0,s.jsx)(ei,{})})]}),(0,s.jsxs)("form",{onSubmit:S,children:[(0,s.jsxs)("div",{className:"spawn-modal-section",children:[(0,s.jsx)("label",{className:"spawn-modal-label",children:"Agent Type"}),(0,s.jsx)("div",{className:"spawn-modal-templates",children:ea.map(e=>(0,s.jsxs)("button",{type:"button",className:"spawn-modal-template ".concat(o.id===e.id?"selected":""),onClick:()=>h(e),children:[(0,s.jsx)("span",{className:"spawn-modal-template-icon",children:e.icon}),(0,s.jsx)("span",{className:"spawn-modal-template-name",children:e.name}),(0,s.jsx)("span",{className:"spawn-modal-template-desc",children:e.description})]},e.id))})]}),(0,s.jsxs)("div",{className:"spawn-modal-section",children:[(0,s.jsx)("label",{className:"spawn-modal-label",htmlFor:"agent-name",children:"Agent Name"}),(0,s.jsxs)("div",{className:"spawn-modal-name-input",children:[(0,s.jsx)("div",{className:"spawn-modal-name-preview",style:{backgroundColor:A.primary,color:A.text},children:u(m||b())}),(0,s.jsx)("input",{ref:N,id:"agent-name",type:"text",className:"spawn-modal-input",placeholder:b(),value:m,onChange:e=>{x(e.target.value),w(null)},disabled:i})]}),(0,s.jsx)("div",{className:"spawn-modal-name-suggestions",children:el.slice(0,4).map(e=>(0,s.jsxs)("button",{type:"button",className:"spawn-modal-suggestion",onClick:()=>x("".concat(e,"-1")),children:[e,"-"]},e))})]}),"custom"===o.id&&(0,s.jsxs)("div",{className:"spawn-modal-section",children:[(0,s.jsx)("label",{className:"spawn-modal-label",htmlFor:"agent-command",children:"Command"}),(0,s.jsx)("input",{id:"agent-command",type:"text",className:"spawn-modal-input",placeholder:"e.g., python agent.py",value:p,onChange:e=>g(e.target.value),disabled:i})]}),(0,s.jsxs)("div",{className:"spawn-modal-section",children:[(0,s.jsxs)("label",{className:"spawn-modal-label",htmlFor:"agent-cwd",children:["Working Directory ",(0,s.jsx)("span",{className:"spawn-modal-optional",children:"(optional)"})]}),(0,s.jsx)("input",{id:"agent-cwd",type:"text",className:"spawn-modal-input",placeholder:"Current directory",value:f,onChange:e=>j(e.target.value),disabled:i})]}),(0,s.jsxs)("div",{className:"spawn-modal-section",children:[(0,s.jsxs)("label",{className:"spawn-modal-label",htmlFor:"agent-team",children:["Team ",(0,s.jsx)("span",{className:"spawn-modal-optional",children:"(optional)"})]}),(0,s.jsx)("input",{id:"agent-team",type:"text",className:"spawn-modal-input",placeholder:"e.g., frontend, backend, infra",value:v,onChange:e=>y(e.target.value),disabled:i})]}),M&&(0,s.jsxs)("div",{className:"spawn-modal-error",children:[(0,s.jsx)(ec,{}),(0,s.jsx)("span",{children:M})]}),(0,s.jsxs)("div",{className:"spawn-modal-actions",children:[(0,s.jsx)("button",{type:"button",className:"spawn-modal-btn spawn-modal-btn-secondary",onClick:n,disabled:i,children:"Cancel"}),(0,s.jsx)("button",{type:"submit",className:"spawn-modal-btn spawn-modal-btn-primary",disabled:i,children:i?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ed,{}),"Spawning..."]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eo,{}),"Spawn Agent"]})})]})]})]})})}function ei(){return(0,s.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,s.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function ec(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,s.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,s.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})}function eo(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z"}),(0,s.jsx)("path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z"}),(0,s.jsx)("path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0"}),(0,s.jsx)("path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5"})]})}function ed(){return(0,s.jsx)("svg",{className:"spawn-modal-spinner",width:"16",height:"16",viewBox:"0 0 24 24",children:(0,s.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",fill:"none",strokeDasharray:"32",strokeLinecap:"round"})})}let eu={theme:"system",notifications:{enabled:!0,sound:!0,desktop:!1,mentionsOnly:!1},display:{compactMode:!1,showTimestamps:!0,showAvatars:!0,animationsEnabled:!0},connection:{autoReconnect:!0,reconnectDelay:3e3,keepAliveInterval:3e4}};function eh(e){let{isOpen:t,onClose:n,settings:l,onSettingsChange:r,onResetSettings:i}=e,[c,o]=(0,a.useState)("appearance"),d=(0,a.useCallback)((e,t,n)=>{let s=l[e];r({...l,[e]:{...s,[t]:n}})},[l,r]),u=(0,a.useCallback)(e=>{r({...l,theme:e})},[l,r]);return t?(0,s.jsx)("div",{className:"settings-overlay",onClick:n,children:(0,s.jsxs)("div",{className:"settings-panel",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"settings-header",children:[(0,s.jsx)("h2",{children:"Settings"}),(0,s.jsx)("button",{className:"settings-close",onClick:n,children:(0,s.jsx)(ex,{})})]}),(0,s.jsxs)("div",{className:"settings-tabs",children:[(0,s.jsxs)("button",{className:"settings-tab ".concat("appearance"===c?"active":""),onClick:()=>o("appearance"),children:[(0,s.jsx)(ep,{}),"Appearance"]}),(0,s.jsxs)("button",{className:"settings-tab ".concat("notifications"===c?"active":""),onClick:()=>o("notifications"),children:[(0,s.jsx)(eg,{}),"Notifications"]}),(0,s.jsxs)("button",{className:"settings-tab ".concat("connection"===c?"active":""),onClick:()=>o("connection"),children:[(0,s.jsx)(ef,{}),"Connection"]})]}),(0,s.jsxs)("div",{className:"settings-content",children:["appearance"===c&&(0,s.jsxs)("div",{className:"settings-section",children:[(0,s.jsxs)("div",{className:"settings-group",children:[(0,s.jsx)("label",{className:"settings-label",children:"Theme"}),(0,s.jsx)("div",{className:"settings-theme-options",children:["light","dark","system"].map(e=>(0,s.jsxs)("button",{className:"settings-theme-btn ".concat(l.theme===e?"active":""),onClick:()=>u(e),children:["light"===e&&(0,s.jsx)(ej,{}),"dark"===e&&(0,s.jsx)(ev,{}),"system"===e&&(0,s.jsx)(ey,{}),(0,s.jsx)("span",{children:e.charAt(0).toUpperCase()+e.slice(1)})]},e))})]}),(0,s.jsxs)("div",{className:"settings-group",children:[(0,s.jsx)("label",{className:"settings-label",children:"Display Options"}),(0,s.jsx)(em,{label:"Compact mode",description:"Show more content in less space",checked:l.display.compactMode,onChange:e=>d("display","compactMode",e)}),(0,s.jsx)(em,{label:"Show timestamps",description:"Display time for each message",checked:l.display.showTimestamps,onChange:e=>d("display","showTimestamps",e)}),(0,s.jsx)(em,{label:"Show avatars",description:"Display agent avatars in messages",checked:l.display.showAvatars,onChange:e=>d("display","showAvatars",e)}),(0,s.jsx)(em,{label:"Enable animations",description:"Smooth transitions and effects",checked:l.display.animationsEnabled,onChange:e=>d("display","animationsEnabled",e)})]})]}),"notifications"===c&&(0,s.jsx)("div",{className:"settings-section",children:(0,s.jsxs)("div",{className:"settings-group",children:[(0,s.jsx)("label",{className:"settings-label",children:"Notification Preferences"}),(0,s.jsx)(em,{label:"Enable notifications",description:"Receive alerts for new messages",checked:l.notifications.enabled,onChange:e=>d("notifications","enabled",e)}),(0,s.jsx)(em,{label:"Sound alerts",description:"Play sound for new messages",checked:l.notifications.sound,onChange:e=>d("notifications","sound",e),disabled:!l.notifications.enabled}),(0,s.jsx)(em,{label:"Desktop notifications",description:"Show system notifications",checked:l.notifications.desktop,onChange:e=>d("notifications","desktop",e),disabled:!l.notifications.enabled}),(0,s.jsx)(em,{label:"Mentions only",description:"Only notify when mentioned",checked:l.notifications.mentionsOnly,onChange:e=>d("notifications","mentionsOnly",e),disabled:!l.notifications.enabled})]})}),"connection"===c&&(0,s.jsx)("div",{className:"settings-section",children:(0,s.jsxs)("div",{className:"settings-group",children:[(0,s.jsx)("label",{className:"settings-label",children:"Connection Settings"}),(0,s.jsx)(em,{label:"Auto-reconnect",description:"Automatically reconnect on disconnect",checked:l.connection.autoReconnect,onChange:e=>d("connection","autoReconnect",e)}),(0,s.jsxs)("div",{className:"settings-input-group",children:[(0,s.jsx)("label",{children:"Reconnect delay (ms)"}),(0,s.jsx)("input",{type:"number",className:"settings-input",value:l.connection.reconnectDelay,onChange:e=>d("connection","reconnectDelay",parseInt(e.target.value)||3e3),min:1e3,max:3e4,step:1e3,disabled:!l.connection.autoReconnect})]}),(0,s.jsxs)("div",{className:"settings-input-group",children:[(0,s.jsx)("label",{children:"Keep-alive interval (ms)"}),(0,s.jsx)("input",{type:"number",className:"settings-input",value:l.connection.keepAliveInterval,onChange:e=>d("connection","keepAliveInterval",parseInt(e.target.value)||3e4),min:5e3,max:12e4,step:5e3})]})]})})]}),(0,s.jsxs)("div",{className:"settings-footer",children:[i&&(0,s.jsx)("button",{className:"settings-reset-btn",onClick:i,children:"Reset to defaults"}),(0,s.jsx)("button",{className:"settings-done-btn",onClick:n,children:"Done"})]})]})}):null}function em(e){let{label:t,description:n,checked:a,onChange:l,disabled:r}=e;return(0,s.jsxs)("div",{className:"settings-toggle-option ".concat(r?"disabled":""),children:[(0,s.jsxs)("div",{className:"settings-toggle-info",children:[(0,s.jsx)("span",{className:"settings-toggle-label",children:t}),(0,s.jsx)("span",{className:"settings-toggle-desc",children:n})]}),(0,s.jsx)("button",{className:"settings-toggle ".concat(a?"on":""),onClick:()=>!r&&l(!a),disabled:r,role:"switch","aria-checked":a,children:(0,s.jsx)("span",{className:"settings-toggle-thumb"})})]})}function ex(){return(0,s.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,s.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function ep(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("circle",{cx:"13.5",cy:"6.5",r:".5"}),(0,s.jsx)("circle",{cx:"17.5",cy:"10.5",r:".5"}),(0,s.jsx)("circle",{cx:"8.5",cy:"7.5",r:".5"}),(0,s.jsx)("circle",{cx:"6.5",cy:"12.5",r:".5"}),(0,s.jsx)("path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.555C21.965 6.012 17.461 2 12 2z"})]})}function eg(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("path",{d:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"}),(0,s.jsx)("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})]})}function ef(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("path",{d:"M5 12.55a11 11 0 0 1 14.08 0"}),(0,s.jsx)("path",{d:"M1.42 9a16 16 0 0 1 21.16 0"}),(0,s.jsx)("path",{d:"M8.53 16.11a6 6 0 0 1 6.95 0"}),(0,s.jsx)("line",{x1:"12",y1:"20",x2:"12.01",y2:"20"})]})}function ej(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"5"}),(0,s.jsx)("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),(0,s.jsx)("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),(0,s.jsx)("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),(0,s.jsx)("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),(0,s.jsx)("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),(0,s.jsx)("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),(0,s.jsx)("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),(0,s.jsx)("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]})}function ev(){return(0,s.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,s.jsx)("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})})}function ey(){return(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",ry:"2"}),(0,s.jsx)("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),(0,s.jsx)("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]})}function ek(e,t){let n=e.match(/^@(\S*)/);return n&&t<=n[0].length?n[1]:null}function ew(e,t){let n=e.match(/^@\S*/);return n?"@".concat(t," ")+e.substring(n[0].length):e}function eN(e){let{agents:t,inputValue:n,cursorPosition:l,onSelect:r,onClose:i,isVisible:c}=e,[o,h]=(0,a.useState)(0),m=(0,a.useRef)(null),x=(0,a.useMemo)(()=>ek(n,l),[n,l]),p=(0,a.useMemo)(()=>{if(null===x)return[];let e=x.toLowerCase(),n=[];return("*".includes(e)||"everyone".includes(e)||"all".includes(e)||"broadcast".includes(e)||""===e)&&n.push({name:"*",displayName:"@everyone",description:"Broadcast to all agents",isBroadcast:!0}),t.filter(t=>t.name.toLowerCase().includes(e)).forEach(e=>{n.push({name:e.name,displayName:"@".concat(e.name),description:e.status||"Agent"})}),n},[x,t]);(0,a.useEffect)(()=>{h(0)},[p.length]),(0,a.useEffect)(()=>{if(!m.current)return;let e=m.current.querySelector(".mention-item.selected");e&&e.scrollIntoView({block:"nearest"})},[o]);let g=(0,a.useCallback)(e=>{if(c&&0!==p.length)switch(e.key){case"ArrowDown":e.preventDefault(),h(e=>(e+1)%p.length);break;case"ArrowUp":e.preventDefault(),h(e=>(e-1+p.length)%p.length);break;case"Enter":case"Tab":e.preventDefault();let t=p[o];if(t){let e=ew(n,t.name);r(t.name,e)}break;case"Escape":e.preventDefault(),i()}},[c,p,o,n,r,i]);(0,a.useEffect)(()=>{if(c)return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[c,g]);let f=(0,a.useCallback)(e=>{let t=ew(n,e.name);r(e.name,t)},[n,r]);return c&&0!==p.length?(0,s.jsx)("div",{className:"mention-autocomplete",ref:m,children:p.map((e,t)=>(0,s.jsxs)("div",{className:"mention-item ".concat(t===o?"selected":""),onClick:()=>f(e),onMouseEnter:()=>h(t),children:[(0,s.jsx)("div",{className:"mention-avatar",style:{background:e.isBroadcast?"var(--accent-warning, #f59e0b)":d(e.name).primary},children:e.isBroadcast?"*":u(e.name)}),(0,s.jsxs)("div",{className:"mention-info",children:[(0,s.jsx)("span",{className:"mention-name",children:e.displayName}),(0,s.jsx)("span",{className:"mention-description",children:e.description})]})]},e.name))}):null}let eb={url:"",autoConnect:!0,reconnect:!0,maxReconnectAttempts:10,reconnectDelay:1e3},eC={async sendMessage(e){try{let t=await fetch("".concat("","/api/send"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),n=await t.json();if(t.ok&&n.success)return{success:!0};return{success:!1,error:n.error||"Failed to send message"}}catch(e){return{success:!1,error:"Network error"}}},async spawnAgent(e){try{let t=await fetch("".concat("","/api/spawn"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await t.json()}catch(t){return{success:!1,name:e.name,error:"Network error"}}},async getSpawnedAgents(){try{let e=await fetch("".concat("","/api/spawned")),t=await e.json();if(e.ok&&t.success)return{success:!0,data:{agents:t.agents||[]}};return{success:!1,error:t.error}}catch(e){return{success:!1,error:"Network error"}}},async releaseAgent(e){try{let t=await fetch("".concat("","/api/spawned/").concat(encodeURIComponent(e)),{method:"DELETE"}),n=await t.json();if(t.ok&&n.success)return{success:!0};return{success:!1,error:n.error}}catch(e){return{success:!1,error:"Network error"}}},async getData(){try{let e=await fetch("".concat("","/api/data")),t=await e.json();if(e.ok)return{success:!0,data:t};return{success:!1,error:"Failed to fetch data"}}catch(e){return{success:!1,error:"Network error"}}},async getBridgeData(){try{let e=await fetch("".concat("","/api/bridge")),t=await e.json();if(e.ok)return{success:!0,data:t};return{success:!1,error:"Failed to fetch bridge data"}}catch(e){return{success:!1,error:"Network error"}}},async getMetrics(){try{let e=await fetch("".concat("","/api/metrics")),t=await e.json();if(e.ok)return{success:!0,data:t};return{success:!1,error:"Failed to fetch metrics"}}catch(e){return{success:!1,error:"Network error"}}}};function eS(e){var t,n,l,r;let{wsUrl:i}=e,{data:c,isConnected:o,error:u}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={...eb,...e},[n,s]=(0,a.useState)(null),[l,r]=(0,a.useState)(!1),[i,c]=(0,a.useState)(null),o=(0,a.useRef)(null),d=(0,a.useRef)(0),u=(0,a.useRef)(null),h=(0,a.useCallback)(()=>{var e;if((null===(e=o.current)||void 0===e?void 0:e.readyState)===WebSocket.OPEN)return;let n=t.url||function(){let e="https:"===window.location.protocol?"wss:":"ws:";return"".concat(e,"//").concat(window.location.host,"/ws")}();try{let e=new WebSocket(n);e.onopen=()=>{r(!0),c(null),d.current=0},e.onclose=()=>{if(r(!1),o.current=null,t.reconnect&&d.current<t.maxReconnectAttempts){let e=Math.min(t.reconnectDelay*Math.pow(2,d.current),3e4);d.current++,u.current=setTimeout(()=>{h()},e)}},e.onerror=e=>{c(Error("WebSocket connection error")),console.error("[useWebSocket] Error:",e)},e.onmessage=e=>{try{let t=JSON.parse(e.data);s(t)}catch(e){console.error("[useWebSocket] Failed to parse message:",e)}},o.current=e}catch(e){c(e instanceof Error?e:Error("Failed to create WebSocket"))}},[t.url,t.reconnect,t.maxReconnectAttempts,t.reconnectDelay]),m=(0,a.useCallback)(()=>{u.current&&(clearTimeout(u.current),u.current=null),o.current&&(o.current.close(),o.current=null),r(!1)},[]);return(0,a.useEffect)(()=>(t.autoConnect&&h(),()=>{m()}),[t.autoConnect,h,m]),{data:n,isConnected:l,error:i,connect:h,disconnect:m}}({url:i}),[m,x]=(0,a.useState)("local"),[g,j]=(0,a.useState)([]),[v,y]=(0,a.useState)(),[k,w]=(0,a.useState)(!1),[N,b]=(0,a.useState)(!1),[C,S]=(0,a.useState)(null),[A,M]=(0,a.useState)(!1),[E,D]=(0,a.useState)(!1),[B,W]=(0,a.useState)(eu),[L,R]=(0,a.useState)(!1),T=(0,a.useCallback)(()=>{window.innerWidth<=768&&R(!1)},[]),{agents:O,groups:F,selectedAgent:V,selectAgent:_,searchQuery:I,setSearchQuery:H,totalCount:K,onlineCount:U,needsAttentionCount:J}=function(e){let{agents:t,initialSelected:n,initialSearchQuery:s=""}=e,[l,r]=(0,a.useState)(null!=n?n:null),[i,c]=(0,a.useState)(s),o=(0,a.useMemo)(()=>p(t,i),[t,i]),u=(0,a.useMemo)(()=>h(o),[o]),m=(0,a.useMemo)(()=>[...o].sort((e,t)=>e.name.localeCompare(t.name)),[o]),x=(0,a.useMemo)(()=>{var e;return null!==(e=t.find(e=>e.name===l))&&void 0!==e?e:null},[t,l]),g=(0,a.useMemo)(()=>{let e=f(t);return{totalCount:e.total,onlineCount:e.online,needsAttentionCount:e.needsAttention}},[t]),j=(0,a.useCallback)(e=>{r(e)},[]),v=(0,a.useCallback)(e=>t.find(t=>t.name===e),[t]),y=(0,a.useCallback)(e=>({...e,color:d(e.name)}),[]);return{agents:o,groups:u,sortedAgents:m,selectedAgent:x,selectAgent:j,searchQuery:i,setSearchQuery:c,...g,getAgentByName:v,getAgentWithColor:y}}({agents:null!==(l=null==c?void 0:c.agents)&&void 0!==l?l:[]}),{messages:G,currentChannel:Q,setCurrentChannel:$,currentThread:Y,setCurrentThread:X,sendMessage:ee,isSending:et,sendError:en}=function(e){let{messages:t,currentChannel:n="general"}=e,[s,l]=(0,a.useState)(n),[r,i]=(0,a.useState)(null),[c,o]=(0,a.useState)(!1),[d,u]=(0,a.useState)(null),h=(0,a.useMemo)(()=>"general"===s?t:t.filter(e=>e.from===s||e.to===s),[t,s]),m=(0,a.useCallback)(e=>t.filter(t=>t.thread===e),[t]),x=(0,a.useMemo)(()=>{let e=t.filter(e=>!e.isRead).length;return{totalCount:t.length,unreadCount:e}},[t]);return{messages:h,threadMessages:m,currentChannel:s,setCurrentChannel:l,currentThread:r,setCurrentThread:i,sendMessage:(0,a.useCallback)(async(e,t,n)=>{o(!0),u(null);try{let s=await fetch("/api/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({to:e,message:t,thread:n})}),a=await s.json();if(s.ok&&a.success)return!0;return u(a.error||"Failed to send message"),!1}catch(e){return u("Network error"),!1}finally{o(!1)}},[]),isSending:c,sendError:d,...x}}({messages:null!==(r=null==c?void 0:c.messages)&&void 0!==r?r:[]}),es=!!(null==c?void 0:null===(n=c.fleet)||void 0===n?void 0:null===(t=n.servers)||void 0===t?void 0:t.length);(0,a.useEffect)(()=>{if(!es)return;let e=async()=>{let e=await eC.getBridgeData();if(e.success&&e.data){let{servers:t,agents:n}=e.data;j(t.map(e=>({id:e.id,path:e.url,name:e.name||e.url.split("/").pop(),agents:n.filter(t=>t.server===e.id),lead:void 0})))}};e();let t=setInterval(e,3e4);return()=>clearInterval(t)},[es]);let ea=(0,a.useCallback)(e=>{y(e.id),e.agents.length>0&&(_(e.agents[0].name),$(e.agents[0].name)),T()},[_,$,T]),el=(0,a.useCallback)(e=>{_(e.name),$(e.name),T()},[_,$,T]),ei=(0,a.useCallback)(()=>{S(null),w(!0)},[]),ec=(0,a.useCallback)(()=>{D(!0)},[]),eo=(0,a.useCallback)(async e=>{b(!0),S(null);try{let t=await eC.spawnAgent({name:e.name,cli:e.command,team:e.team});if(!t.success)return S(t.error||"Failed to spawn agent"),!1;return!0}catch(e){return S(e instanceof Error?e.message:"Failed to spawn agent"),!1}finally{b(!1)}},[]),ed=(0,a.useCallback)(async e=>{if(e.isSpawned&&window.confirm('Are you sure you want to release agent "'.concat(e.name,'"?')))try{let t=await eC.releaseAgent(e.name);t.success||console.error("Failed to release agent:",t.error)}catch(e){console.error("Failed to release agent:",e)}},[]),em=(0,a.useCallback)(()=>{M(!0)},[]);return a.useEffect(()=>{let e=e=>{let t;t="system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e,document.documentElement.setAttribute("data-theme",t)};if(e(B.theme),"system"===B.theme){let t=window.matchMedia("(prefers-color-scheme: dark)"),n=()=>e("system");return t.addEventListener("change",n),()=>t.removeEventListener("change",n)}},[B.theme]),a.useEffect(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&"k"===e.key&&(e.preventDefault(),M(!0)),(e.metaKey||e.ctrlKey)&&e.shiftKey&&"s"===e.key&&(e.preventDefault(),ei()),"Escape"===e.key&&(M(!1),w(!1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[ei]),(0,s.jsxs)("div",{className:"dashboard-app",children:[(0,s.jsx)("div",{className:"sidebar-overlay ".concat(L?"visible":""),onClick:()=>R(!1)}),(0,s.jsx)(P,{agents:O,projects:g,currentProject:v,selectedAgent:null==V?void 0:V.name,viewMode:m,isFleetAvailable:es,isConnected:o,isOpen:L,onAgentSelect:el,onProjectSelect:ea,onViewModeChange:x,onSpawnClick:ei,onReleaseClick:ed,onClose:()=>R(!1)}),(0,s.jsxs)("main",{className:"dashboard-main",children:[(0,s.jsx)(z,{currentChannel:Q,selectedAgent:V,onCommandPaletteOpen:em,onSettingsClick:ec,onMenuClick:()=>R(!0)}),(0,s.jsx)("div",{className:"dashboard-content",children:u?(0,s.jsxs)("div",{className:"error-state",children:[(0,s.jsx)(eE,{}),(0,s.jsx)("h2",{children:"Connection Error"}),(0,s.jsx)("p",{children:u.message}),(0,s.jsx)("button",{onClick:()=>window.location.reload(),children:"Retry Connection"})]}):c?(0,s.jsx)("div",{className:"messages-container",children:(0,s.jsx)(q,{messages:G,currentChannel:Q,onThreadClick:e=>X(e),highlightedMessageId:null!=Y?Y:void 0})}):(0,s.jsxs)("div",{className:"loading-state",children:[(0,s.jsx)(eM,{}),(0,s.jsx)("p",{children:"Connecting to dashboard..."})]})}),(0,s.jsx)("div",{className:"message-composer",children:(0,s.jsx)(eA,{recipient:"general"===Q?"*":Q,agents:O,onSend:ee,isSending:et,error:en})})]}),(0,s.jsx)(Z,{isOpen:A,onClose:()=>M(!1),agents:O,projects:g,currentProject:v,onAgentSelect:el,onProjectSelect:ea,onSpawnClick:ei,onGeneralClick:()=>{_(null),$("general")}}),(0,s.jsx)(er,{isOpen:k,onClose:()=>w(!1),onSpawn:eo,existingAgents:O.map(e=>e.name),isSpawning:N,error:C}),(0,s.jsx)(eh,{isOpen:E,onClose:()=>D(!1),settings:B,onSettingsChange:W,onResetSettings:()=>W(eu)})]})}function eA(e){let{recipient:t,agents:n,onSend:l,isSending:r,error:i}=e,[c,o]=(0,a.useState)(""),[d,u]=(0,a.useState)(0),[h,m]=(0,a.useState)(!1),x=(0,a.useRef)(null),p=async e=>{let n,s;if(e.preventDefault(),!c.trim()||r)return;let a=c.match(/^@(\S+)\s*([\s\S]*)/);if(a){let e=a[1];s=a[2]||"",n="*"===e||"everyone"===e.toLowerCase()||"all"===e.toLowerCase()?"*":e}else n=t,s=c;await l(n,s||c)&&(o(""),m(!1))};return(0,s.jsxs)("form",{className:"composer-form",onSubmit:p,children:[(0,s.jsxs)("div",{className:"composer-input-wrapper",children:[(0,s.jsx)(eN,{agents:n,inputValue:c,cursorPosition:d,onSelect:(e,t)=>{o(t),m(!1),setTimeout(()=>{if(x.current){x.current.focus();let e=t.indexOf(" ")+1;x.current.setSelectionRange(e,e)}},0)},onClose:()=>m(!1),isVisible:h}),(0,s.jsx)("textarea",{ref:x,className:"composer-input",placeholder:"Message ".concat("*"===t?"everyone":"@"+t,"... (Shift+Enter for new line)"),value:c,onChange:e=>{let t=e.target.value,n=e.target.selectionStart||0;o(t),u(n),m(null!==ek(t,n))},onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),c.trim()&&!r&&p(e))},onSelect:e=>u(e.target.selectionStart||0),disabled:r,rows:1})]}),(0,s.jsx)("button",{type:"submit",className:"composer-send",disabled:!c.trim()||r,title:r?"Sending...":"Send message",children:r?(0,s.jsx)("span",{className:"composer-send-text",children:"Sending..."}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"composer-send-text",children:"Send"}),(0,s.jsxs)("svg",{className:"composer-send-icon",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),(0,s.jsx)("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})]})}),i&&(0,s.jsx)("span",{className:"composer-error",children:i})]})}function eM(){return(0,s.jsx)("svg",{className:"spinner",width:"24",height:"24",viewBox:"0 0 24 24",children:(0,s.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",fill:"none",strokeDasharray:"32",strokeLinecap:"round"})})}function eE(){return(0,s.jsxs)("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,s.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,s.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})}function eD(){return(0,s.jsx)(eS,{})}}},function(e){e.O(0,[971,117,744],function(){return e(e.s=8440)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/50ed6996e3df7bdd.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-c81f7fd28659d64f.js"/><script src="/_next/static/chunks/fd9d1056-26bd8d656b496dba.js" async=""></script><script src="/_next/static/chunks/117-3bef7b19f3e60751.js" async=""></script><script src="/_next/static/chunks/main-app-bae2e535de00de50.js" async=""></script><script src="/_next/static/chunks/app/page-49055e5d2b5e34ec.js" async=""></script><title>Agent Relay Dashboard</title><meta name="description" content="Fleet control dashboard for Agent Relay"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div class="dashboard-app"><div class="sidebar-overlay "></div><aside class="sidebar "><div class="sidebar-header"><div class="sidebar-title"><h1>Agent Relay</h1><div class="connection-indicator disconnected" title="Disconnected"></div></div></div><div class="sidebar-search"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg><input type="text" placeholder="Search agents..." value=""/></div><div class="sidebar-content"><div class="agent-list-empty"><svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1"><circle cx="12" cy="8" r="5"></circle><path d="M20 21a8 8 0 1 0-16 0"></path></svg><p>No agents connected</p></div></div><div class="sidebar-footer"><button class="spawn-btn"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>Spawn Agent</button></div></aside><main class="dashboard-main"><header class="header"><button class="mobile-menu-btn" aria-label="Open menu"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg></button><div class="header-left"><span class="channel-prefix">#</span><span class="channel-name">general</span><span class="channel-topic">All agent communications</span></div><div class="header-right"><button class="header-btn command-palette-btn" title="Command Palette (⌘K)"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg><span>Search</span><kbd>⌘K</kbd></button><a href="/metrics" class="header-btn icon-btn" title="Metrics"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 3v18h18"></path><path d="M18 17V9"></path><path d="M13 17V5"></path><path d="M8 17v-3"></path></svg></a><button class="header-btn icon-btn" title="Settings"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg></button></div></header><div class="dashboard-content"><div class="loading-state"><svg class="spinner" width="24" height="24" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2" fill="none" stroke-dasharray="32" stroke-linecap="round"></circle></svg><p>Connecting to dashboard...</p></div></div><div class="message-composer"><form class="composer-form"><div class="composer-input-wrapper"><textarea class="composer-input" placeholder="Message everyone... (Shift+Enter for new line)" rows="1"></textarea></div><button type="submit" class="composer-send" disabled="" title="Send message"><span class="composer-send-text">Send</span><svg class="composer-send-icon" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="22" y1="2" x2="11" y2="13"></line><polygon points="22 2 15 22 11 13 2 9 22 2"></polygon></svg></button></form></div></main></div><script src="/_next/static/chunks/webpack-c81f7fd28659d64f.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/css/50ed6996e3df7bdd.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"2:I[2846,[],\"\"]\n4:I[9107,[],\"ClientPageRoot\"]\n5:I[7666,[\"931\",\"static/chunks/app/page-49055e5d2b5e34ec.js\"],\"default\",1]\n6:I[4707,[],\"\"]\n7:I[6423,[],\"\"]\n9:I[1060,[],\"\"]\na:[]\n0:[\"$\",\"$L2\",null,{\"buildId\":\"gZXwjIKGDKJ0hiTH-HMeJ\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"\"],\"initialTree\":[\"\",{\"children\":[\"__PAGE__\",{}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"__PAGE__\",{},[[\"$L3\",[\"$\",\"$L4\",null,{\"props\":{\"params\":{},\"searchParams\":{}},\"Component\":\"$5\"}],null],null],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/50ed6996e3df7bdd.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"children\":[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyl"])</script><script>self.__next_f.push([1,"es\":[]}]}]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[null,\"$L8\"],\"globalErrorComponent\":\"$9\",\"missingSlots\":\"$Wa\"}]\n"])</script><script>self.__next_f.push([1,"8:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Agent Relay Dashboard\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Fleet control dashboard for Agent Relay\"}]]\n3:null\n"])</script></body></html>
1
+ <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/50ed6996e3df7bdd.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-c81f7fd28659d64f.js"/><script src="/_next/static/chunks/fd9d1056-26bd8d656b496dba.js" async=""></script><script src="/_next/static/chunks/117-3bef7b19f3e60751.js" async=""></script><script src="/_next/static/chunks/main-app-bae2e535de00de50.js" async=""></script><script src="/_next/static/chunks/app/page-4498be09a5157759.js" async=""></script><title>Agent Relay Dashboard</title><meta name="description" content="Fleet control dashboard for Agent Relay"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div class="dashboard-app"><div class="sidebar-overlay "></div><aside class="sidebar "><div class="sidebar-header"><div class="sidebar-title"><h1>Agent Relay</h1><div class="connection-indicator disconnected" title="Disconnected"></div></div></div><div class="sidebar-search"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg><input type="text" placeholder="Search agents..." value=""/></div><div class="sidebar-content"><div class="agent-list-empty"><svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1"><circle cx="12" cy="8" r="5"></circle><path d="M20 21a8 8 0 1 0-16 0"></path></svg><p>No agents connected</p></div></div><div class="sidebar-footer"><button class="spawn-btn"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>Spawn Agent</button></div></aside><main class="dashboard-main"><header class="header"><button class="mobile-menu-btn" aria-label="Open menu"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg></button><div class="header-left"><span class="channel-prefix">#</span><span class="channel-name">general</span><span class="channel-topic">All agent communications</span></div><div class="header-right"><button class="header-btn command-palette-btn" title="Command Palette (⌘K)"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg><span>Search</span><kbd>⌘K</kbd></button><a href="/metrics" class="header-btn icon-btn" title="Metrics"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 3v18h18"></path><path d="M18 17V9"></path><path d="M13 17V5"></path><path d="M8 17v-3"></path></svg></a><button class="header-btn icon-btn" title="Settings"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg></button></div></header><div class="dashboard-content"><div class="loading-state"><svg class="spinner" width="24" height="24" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2" fill="none" stroke-dasharray="32" stroke-linecap="round"></circle></svg><p>Connecting to dashboard...</p></div></div><div class="message-composer"><form class="composer-form"><div class="composer-input-wrapper"><textarea class="composer-input" placeholder="Message everyone... (Shift+Enter for new line)" rows="1"></textarea></div><button type="submit" class="composer-send" disabled="" title="Send message"><span class="composer-send-text">Send</span><svg class="composer-send-icon" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="22" y1="2" x2="11" y2="13"></line><polygon points="22 2 15 22 11 13 2 9 22 2"></polygon></svg></button></form></div></main></div><script src="/_next/static/chunks/webpack-c81f7fd28659d64f.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/css/50ed6996e3df7bdd.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"2:I[2846,[],\"\"]\n4:I[9107,[],\"ClientPageRoot\"]\n5:I[7666,[\"931\",\"static/chunks/app/page-4498be09a5157759.js\"],\"default\",1]\n6:I[4707,[],\"\"]\n7:I[6423,[],\"\"]\n9:I[1060,[],\"\"]\na:[]\n0:[\"$\",\"$L2\",null,{\"buildId\":\"DXFA-jj8wb3PcY5DX2xcU\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"\"],\"initialTree\":[\"\",{\"children\":[\"__PAGE__\",{}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"__PAGE__\",{},[[\"$L3\",[\"$\",\"$L4\",null,{\"props\":{\"params\":{},\"searchParams\":{}},\"Component\":\"$5\"}],null],null],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/50ed6996e3df7bdd.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"children\":[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyl"])</script><script>self.__next_f.push([1,"es\":[]}]}]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[null,\"$L8\"],\"globalErrorComponent\":\"$9\",\"missingSlots\":\"$Wa\"}]\n"])</script><script>self.__next_f.push([1,"8:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Agent Relay Dashboard\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Fleet control dashboard for Agent Relay\"}]]\n3:null\n"])</script></body></html>
@@ -1,7 +1,7 @@
1
1
  2:I[9107,[],"ClientPageRoot"]
2
- 3:I[7666,["931","static/chunks/app/page-49055e5d2b5e34ec.js"],"default",1]
2
+ 3:I[7666,["931","static/chunks/app/page-4498be09a5157759.js"],"default",1]
3
3
  4:I[4707,[],""]
4
4
  5:I[6423,[],""]
5
- 0:["gZXwjIKGDKJ0hiTH-HMeJ",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/50ed6996e3df7bdd.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]],null],null],["$L6",null]]]]
5
+ 0:["DXFA-jj8wb3PcY5DX2xcU",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/50ed6996e3df7bdd.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]],null],null],["$L6",null]]]]
6
6
  6:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"Agent Relay Dashboard"}],["$","meta","3",{"name":"description","content":"Fleet control dashboard for Agent Relay"}]]
7
7
  1:null
@@ -512,4 +512,4 @@
512
512
  grid-template-columns: repeat(2, 1fr);
513
513
  }
514
514
  }
515
- </style><div class="loading"><div class="spinner"></div><p>Loading metrics...</p></div></div><script src="/_next/static/chunks/webpack-c81f7fd28659d64f.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/css/50ed6996e3df7bdd.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"2:I[2846,[],\"\"]\n4:I[9107,[],\"ClientPageRoot\"]\n5:I[5804,[\"648\",\"static/chunks/648-6cf686106c891ad3.js\",\"860\",\"static/chunks/app/metrics/page-8aa9936bc6c771ab.js\"],\"default\",1]\n6:I[4707,[],\"\"]\n7:I[6423,[],\"\"]\n9:I[1060,[],\"\"]\na:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L2\",null,{\"buildId\":\"gZXwjIKGDKJ0hiTH-HMeJ\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"metrics\"],\"initialTree\":[\"\",{\"children\":[\"metrics\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"metrics\",{\"children\":[\"__PAGE__\",{},[[\"$L3\",[\"$\",\"$L4\",null,{\"props\":{\"params\":{},\"searchParams\":{}},\"Component\":\"$5\"}],null],null],null]},[null,[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"metrics\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/50ed6996e3df7bdd.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"children\":[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}]}]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[null,\"$L8\"],\"globalErrorComponent\":\"$9\",\"missingSlots\":\"$Wa\"}]\n"])</script><script>self.__next_f.push([1,"8:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Agent Relay Dashboard\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Fleet control dashboard for Agent Relay\"}]]\n3:null\n"])</script></body></html>
515
+ </style><div class="loading"><div class="spinner"></div><p>Loading metrics...</p></div></div><script src="/_next/static/chunks/webpack-c81f7fd28659d64f.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/_next/static/css/50ed6996e3df7bdd.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"2:I[2846,[],\"\"]\n4:I[9107,[],\"ClientPageRoot\"]\n5:I[5804,[\"648\",\"static/chunks/648-6cf686106c891ad3.js\",\"860\",\"static/chunks/app/metrics/page-8aa9936bc6c771ab.js\"],\"default\",1]\n6:I[4707,[],\"\"]\n7:I[6423,[],\"\"]\n9:I[1060,[],\"\"]\na:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L2\",null,{\"buildId\":\"DXFA-jj8wb3PcY5DX2xcU\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"metrics\"],\"initialTree\":[\"\",{\"children\":[\"metrics\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"metrics\",{\"children\":[\"__PAGE__\",{},[[\"$L3\",[\"$\",\"$L4\",null,{\"props\":{\"params\":{},\"searchParams\":{}},\"Component\":\"$5\"}],null],null],null]},[null,[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"metrics\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/50ed6996e3df7bdd.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"children\":[\"$\",\"$L6\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L7\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}]}]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[null,\"$L8\"],\"globalErrorComponent\":\"$9\",\"missingSlots\":\"$Wa\"}]\n"])</script><script>self.__next_f.push([1,"8:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"Agent Relay Dashboard\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Fleet control dashboard for Agent Relay\"}]]\n3:null\n"])</script></body></html>
@@ -2,6 +2,6 @@
2
2
  3:I[5804,["648","static/chunks/648-6cf686106c891ad3.js","860","static/chunks/app/metrics/page-8aa9936bc6c771ab.js"],"default",1]
3
3
  4:I[4707,[],""]
4
4
  5:I[6423,[],""]
5
- 0:["gZXwjIKGDKJ0hiTH-HMeJ",[[["",{"children":["metrics",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["metrics",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","metrics","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/50ed6996e3df7bdd.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]],null],null],["$L6",null]]]]
5
+ 0:["DXFA-jj8wb3PcY5DX2xcU",[[["",{"children":["metrics",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["metrics",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","metrics","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/50ed6996e3df7bdd.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]}]}]],null],null],["$L6",null]]]]
6
6
  6:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"Agent Relay Dashboard"}],["$","meta","3",{"name":"description","content":"Fleet control dashboard for Agent Relay"}]]
7
7
  1:null
@@ -46,6 +46,7 @@ export declare class PtyWrapper extends EventEmitter {
46
46
  private isInjecting;
47
47
  private logFilePath?;
48
48
  private logStream?;
49
+ private hasAcceptedPrompt;
49
50
  constructor(config: PtyWrapperConfig);
50
51
  /**
51
52
  * Start the agent process
@@ -55,6 +56,11 @@ export declare class PtyWrapper extends EventEmitter {
55
56
  * Handle output from the process
56
57
  */
57
58
  private handleOutput;
59
+ /**
60
+ * Auto-accept Claude's first-run prompts for --dangerously-skip-permissions
61
+ * Detects the acceptance prompt and sends "2" to select "Yes, I accept"
62
+ */
63
+ private handleAutoAcceptPrompts;
58
64
  /**
59
65
  * Parse relay commands from output.
60
66
  * Handles both single-line and multi-line (fenced) formats.
@@ -1 +1 @@
1
- {"version":3,"file":"pty-wrapper.d.ts","sourceRoot":"","sources":["../../src/wrapper/pty-wrapper.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAQ3C,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8CAA8C;IAC9C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+FAA+F;IAC/F,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sEAAsE;IACtE,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EA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IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAsE5B;;OAEG;IACH,OAAO,CAAC,YAAY;IAiCpB;;;OAGG;IACH,OAAO,CAAC,uBAAuB;IAmB/B;;;;OAIG;IACH,OAAO,CAAC,kBAAkB;IAa1B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAuC3B;;OAEG;IACH,OAAO,CAAC,uBAAuB;IA4C/B;;;OAGG;IACH,OAAO,CAAC,SAAS;IAkBjB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAiBxB;;;;OAIG;IACH,OAAO,CAAC,yBAAyB;IAmDjC;;OAEG;YACW,YAAY;IA4B1B;;OAEG;YACW,cAAc;IA0B5B;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAK7B;;OAEG;YACW,mBAAmB;IAkCjC;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAa1B;;OAEG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAMzB;;OAEG;IACH,SAAS,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE;IAOnC;;OAEG;IACH,YAAY,IAAI,MAAM;IAItB;;OAEG;IACH,IAAI,IAAI,IAAI;IAkBZ;;OAEG;IACH,IAAI,IAAI,IAAI;IASZ;;OAEG;IACH,OAAO,CAAC,KAAK;IAIb;;OAEG;IACH,OAAO,CAAC,cAAc;IAQtB,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,GAAG,IAAI,MAAM,GAAG,SAAS,CAE5B;IAED,IAAI,OAAO,IAAI,MAAM,GAAG,SAAS,CAEhC;CACF"}
@@ -27,6 +27,7 @@ export class PtyWrapper extends EventEmitter {
27
27
  isInjecting = false;
28
28
  logFilePath;
29
29
  logStream;
30
+ hasAcceptedPrompt = false;
30
31
  constructor(config) {
31
32
  super();
32
33
  this.config = config;
@@ -122,6 +123,9 @@ export class PtyWrapper extends EventEmitter {
122
123
  }
123
124
  // Emit for external listeners
124
125
  this.emit('output', data);
126
+ // Auto-accept Claude's first-run prompt for --dangerously-skip-permissions
127
+ // The prompt shows: "2. Yes, I accept" - we send "2" to accept
128
+ this.handleAutoAcceptPrompts(data);
125
129
  // Store in line buffer for logs
126
130
  const lines = data.split('\n');
127
131
  for (const line of lines) {
@@ -136,6 +140,29 @@ export class PtyWrapper extends EventEmitter {
136
140
  // Parse for relay commands
137
141
  this.parseRelayCommands();
138
142
  }
143
+ /**
144
+ * Auto-accept Claude's first-run prompts for --dangerously-skip-permissions
145
+ * Detects the acceptance prompt and sends "2" to select "Yes, I accept"
146
+ */
147
+ handleAutoAcceptPrompts(data) {
148
+ if (this.hasAcceptedPrompt)
149
+ return;
150
+ if (!this.ptyProcess || !this.running)
151
+ return;
152
+ // Check for the permission acceptance prompt
153
+ // Pattern: "2. Yes, I accept" in the output
154
+ const cleanData = this.stripAnsi(data);
155
+ if (cleanData.includes('Yes, I accept') && cleanData.includes('No, exit')) {
156
+ console.log(`[pty:${this.config.name}] Detected permission prompt, auto-accepting...`);
157
+ this.hasAcceptedPrompt = true;
158
+ // Send "2" to select "Yes, I accept" and Enter to confirm
159
+ setTimeout(() => {
160
+ if (this.ptyProcess && this.running) {
161
+ this.ptyProcess.write('2');
162
+ }
163
+ }, 100);
164
+ }
165
+ }
139
166
  /**
140
167
  * Parse relay commands from output.
141
168
  * Handles both single-line and multi-line (fenced) formats.
@@ -1 +1 @@
1
- {"version":3,"file":"pty-wrapper.js","sourceRoot":"","sources":["../../src/wrapper/pty-wrapper.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI1C,6CAA6C;AAC7C,MAA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,CAAC,MAAM,CAAC,IAAI,eAAe,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;YACtG,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC;YACrB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC7B,CAAC;IACH,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;IAC1B,CAAC;IAED,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC;IAC9B,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-relay",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
4
4
  "description": "Real-time agent-to-agent communication system",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",