From da929845a989a272d4cdd0b9f16231314f5fa0d3 Mon Sep 17 00:00:00 2001 From: Hitonabi Date: Fri, 26 Jun 2026 08:15:44 +0200 Subject: [PATCH] fix: rename Modell-Zentrale to Modell-Manager and highlight configured models --- .../{index-CiscfPzK.js => index-2FQWjU7Q.js} | 4 ++-- frontend/dist/index.html | 2 +- frontend/src/nav.ts | 2 +- frontend/src/views/ModelsView.tsx | 16 ++++++++++++---- 4 files changed, 16 insertions(+), 8 deletions(-) rename frontend/dist/assets/{index-CiscfPzK.js => index-2FQWjU7Q.js} (82%) diff --git a/frontend/dist/assets/index-CiscfPzK.js b/frontend/dist/assets/index-2FQWjU7Q.js similarity index 82% rename from frontend/dist/assets/index-CiscfPzK.js rename to frontend/dist/assets/index-2FQWjU7Q.js index 6d30bda..5f53a82 100644 --- a/frontend/dist/assets/index-CiscfPzK.js +++ b/frontend/dist/assets/index-2FQWjU7Q.js @@ -287,7 +287,7 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const yi=ge("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ii=[{id:"dashboard",label:"Zentrale",hint:"System- & Stack-Status",icon:hh},{id:"models",label:"Modell-Zentrale",hint:"Verwalten, laden & Gateway-Routing",icon:th},{id:"system",label:"Diagnose",hint:"Metriken, Dienste, Logs",icon:vr},{id:"memory",label:"Gedächtnis",hint:"Geteiltes Memory verwalten",icon:qs},{id:"connect",label:"Verbinden",hint:"IDE-/Agent-Configs erzeugen",icon:xh},{id:"agent",label:"Hermes",hint:"Agent-Status & WebUI öffnen",icon:go},{id:"guide",label:"Anleitung",hint:"Einrichten & Vibe-Coding",icon:lh}];var jd=1,Sh=.9,Ch=.8,Eh=.17,Qa=.1,qa=.999,_h=.9999,Ph=.99,Mh=/[\\\/_+.#"@\[\(\{&]/,Rh=/[\\\/_+.#"@\[\(\{&]/g,Lh=/[\s-]/,of=/[\s-]/g;function ui(s,u,a,c,f,m,p){if(m===u.length)return f===s.length?jd:Ph;var g=`${f},${m}`;if(p[g]!==void 0)return p[g];for(var N=c.charAt(m),E=a.indexOf(N,f),j=0,S,O,z,L;E>=0;)S=ui(s,u,a,c,E+1,m+1,p),S>j&&(E===f?S*=jd:Mh.test(s.charAt(E-1))?(S*=Ch,z=s.slice(f,E-1).match(Rh),z&&f>0&&(S*=Math.pow(qa,z.length))):Lh.test(s.charAt(E-1))?(S*=Sh,L=s.slice(f,E-1).match(of),L&&f>0&&(S*=Math.pow(qa,L.length))):(S*=Eh,f>0&&(S*=Math.pow(qa,E-f))),s.charAt(E)!==u.charAt(m)&&(S*=_h)),(SS&&(S=O*Qa)),S>j&&(j=S),E=a.indexOf(N,E+1);return p[g]=j,j}function Nd(s){return s.toLowerCase().replace(of," ")}function zh(s,u,a){return s=a&&a.length>0?`${s+" "+a.join(" ")}`:s,ui(s,u,Nd(s),Nd(u),0,0,{})}function xr(s,u,{checkForDefaultPrevented:a=!0}={}){return function(f){if(s==null||s(f),a===!1||!f.defaultPrevented)return u==null?void 0:u(f)}}function Sd(s,u){if(typeof s=="function")return s(u);s!=null&&(s.current=u)}function kn(...s){return u=>{let a=!1;const c=s.map(f=>{const m=Sd(f,u);return!a&&typeof m=="function"&&(a=!0),m});if(a)return()=>{for(let f=0;f{var D;const{scope:O,children:z,...L}=S,b=((D=O==null?void 0:O[s])==null?void 0:D[N])||g,P=h.useMemo(()=>L,Object.values(L));return n.jsx(b.Provider,{value:P,children:z})};E.displayName=m+"Provider";function j(S,O){var b;const z=((b=O==null?void 0:O[s])==null?void 0:b[N])||g,L=h.useContext(z);if(L)return L;if(p!==void 0)return p;throw new Error(`\`${S}\` must be used within \`${m}\``)}return[E,j]}const f=()=>{const m=a.map(p=>h.createContext(p));return function(g){const N=(g==null?void 0:g[s])||m;return h.useMemo(()=>({[`__scope${s}`]:{...g,[s]:N}}),[g,N])}};return f.scopeName=s,[c,Dh(f,...u)]}function Dh(...s){const u=s[0];if(s.length===1)return u;const a=()=>{const c=s.map(f=>({useScope:f(),scopeName:f.scopeName}));return function(m){const p=c.reduce((g,{useScope:N,scopeName:E})=>{const S=N(m)[`__scope${E}`];return{...g,...S}},{});return h.useMemo(()=>({[`__scope${u.scopeName}`]:p}),[p])}};return a.scopeName=u.scopeName,a}var vo=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},Th=gi[" useId ".trim().toString()]||(()=>{}),Ah=0;function Kt(s){const[u,a]=h.useState(Th());return vo(()=>{a(c=>c??String(Ah++))},[s]),u?`radix-${u}`:""}var Ih=gi[" useInsertionEffect ".trim().toString()]||vo;function Fh({prop:s,defaultProp:u,onChange:a=()=>{},caller:c}){const[f,m,p]=$h({defaultProp:u,onChange:a}),g=s!==void 0,N=g?s:f;{const j=h.useRef(s!==void 0);h.useEffect(()=>{const S=j.current;S!==g&&console.warn(`${c} is changing from ${S?"controlled":"uncontrolled"} to ${g?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),j.current=g},[g,c])}const E=h.useCallback(j=>{var S;if(g){const O=Uh(j)?j(s):j;O!==s&&((S=p.current)==null||S.call(p,O))}else m(j)},[g,s,m,p]);return[N,E]}function $h({defaultProp:s,onChange:u}){const[a,c]=h.useState(s),f=h.useRef(a),m=h.useRef(u);return Ih(()=>{m.current=u},[u]),h.useEffect(()=>{var p;f.current!==a&&((p=m.current)==null||p.call(m,a),f.current=a)},[a,f]),[a,c,m]}function Uh(s){return typeof s=="function"}var sf=Zd();function lf(s){const u=h.forwardRef((a,c)=>{let{children:f,...m}=a,p=null,g=!1;const N=[];Cd(f)&&typeof Ls=="function"&&(f=Ls(f._payload)),h.Children.forEach(f,O=>{var z;if(Gh(O)){g=!0;const L=O;let b="child"in L.props?L.props.child:L.props.children;Cd(b)&&typeof Ls=="function"&&(b=Ls(b._payload)),p=Vh(L,b),N.push((z=p==null?void 0:p.props)==null?void 0:z.children)}else N.push(O)}),p?p=h.cloneElement(p,void 0,N):!g&&h.Children.count(f)===1&&h.isValidElement(f)&&(p=f);const E=p?Hh(p):void 0,j=Ar(c,E);if(!p){if(f||f===0)throw new Error(g?Zh(s):qh(s));return f}const S=Wh(m,p.props??{});return p.type!==h.Fragment&&(S.ref=c?j:E),h.cloneElement(p,S)});return u.displayName=`${s}.Slot`,u}var Bh=Symbol.for("radix.slottable"),Vh=(s,u)=>{if("child"in s.props){const a=s.props.child;return h.isValidElement(a)?h.cloneElement(a,void 0,s.props.children(a.props.children)):null}return h.isValidElement(u)?u:null};function Wh(s,u){const a={...u};for(const c in u){const f=s[c],m=u[c];/^on[A-Z]/.test(c)?f&&m?a[c]=(...g)=>{const N=m(...g);return f(...g),N}:f&&(a[c]=f):c==="style"?a[c]={...f,...m}:c==="className"&&(a[c]=[f,m].filter(Boolean).join(" "))}return{...s,...a}}function Hh(s){var c,f;let u=(c=Object.getOwnPropertyDescriptor(s.props,"ref"))==null?void 0:c.get,a=u&&"isReactWarning"in u&&u.isReactWarning;return a?s.ref:(u=(f=Object.getOwnPropertyDescriptor(s,"ref"))==null?void 0:f.get,a=u&&"isReactWarning"in u&&u.isReactWarning,a?s.props.ref:s.props.ref||s.ref)}function Gh(s){return h.isValidElement(s)&&typeof s.type=="function"&&"__radixId"in s.type&&s.type.__radixId===Bh}var Kh=Symbol.for("react.lazy");function Cd(s){return s!=null&&typeof s=="object"&&"$$typeof"in s&&s.$$typeof===Kh&&"_payload"in s&&Qh(s._payload)}function Qh(s){return typeof s=="object"&&s!==null&&"then"in s}var qh=s=>`${s} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Zh=s=>`${s} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Ls=gi[" use ".trim().toString()],Yh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ye=Yh.reduce((s,u)=>{const a=lf(`Primitive.${u}`),c=h.forwardRef((f,m)=>{const{asChild:p,...g}=f,N=p?a:u;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),n.jsx(N,{...g,ref:m})});return c.displayName=`Primitive.${u}`,{...s,[u]:c}},{});function Xh(s,u){s&&sf.flushSync(()=>s.dispatchEvent(u))}function yo(s){const u=h.useRef(s);return h.useEffect(()=>{u.current=s}),h.useMemo(()=>((...a)=>{var c;return(c=u.current)==null?void 0:c.call(u,...a)}),[])}function Jh(s,u=globalThis==null?void 0:globalThis.document){const a=yo(s);h.useEffect(()=>{const c=f=>{f.key==="Escape"&&a(f)};return u.addEventListener("keydown",c,{capture:!0}),()=>u.removeEventListener("keydown",c,{capture:!0})},[a,u])}var eg="DismissableLayer",ci="dismissableLayer.update",tg="dismissableLayer.pointerDownOutside",rg="dismissableLayer.focusOutside",Ed,bi=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),af=h.forwardRef((s,u)=>{const{disableOutsidePointerEvents:a=!1,deferPointerDownOutside:c=!1,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:g,onDismiss:N,...E}=s,j=h.useContext(bi),[S,O]=h.useState(null),z=(S==null?void 0:S.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,L]=h.useState({}),b=Ar(u,fe=>O(fe)),P=Array.from(j.layers),[D]=[...j.layersWithOutsidePointerEventsDisabled].slice(-1),M=P.indexOf(D),B=S?P.indexOf(S):-1,G=j.layersWithOutsidePointerEventsDisabled.size>0,Q=B>=M,K=h.useRef(!1),le=lg(fe=>{const A=fe.target;if(!(A instanceof Node))return;const pe=[...j.branches].some(ae=>ae.contains(A));!Q||pe||(m==null||m(fe),g==null||g(fe),fe.defaultPrevented||N==null||N())},{ownerDocument:z,deferPointerDownOutside:c,isDeferredPointerDownOutsideRef:K,dismissableSurfaces:j.dismissableSurfaces}),we=ag(fe=>{if(c&&K.current)return;const A=fe.target;[...j.branches].some(ae=>ae.contains(A))||(p==null||p(fe),g==null||g(fe),fe.defaultPrevented||N==null||N())},z);return Jh(fe=>{B===j.layers.size-1&&(f==null||f(fe),!fe.defaultPrevented&&N&&(fe.preventDefault(),N()))},z),h.useEffect(()=>{if(S)return a&&(j.layersWithOutsidePointerEventsDisabled.size===0&&(Ed=z.body.style.pointerEvents,z.body.style.pointerEvents="none"),j.layersWithOutsidePointerEventsDisabled.add(S)),j.layers.add(S),_d(),()=>{a&&(j.layersWithOutsidePointerEventsDisabled.delete(S),j.layersWithOutsidePointerEventsDisabled.size===0&&(z.body.style.pointerEvents=Ed))}},[S,z,a,j]),h.useEffect(()=>()=>{S&&(j.layers.delete(S),j.layersWithOutsidePointerEventsDisabled.delete(S),_d())},[S,j]),h.useEffect(()=>{const fe=()=>L({});return document.addEventListener(ci,fe),()=>document.removeEventListener(ci,fe)},[]),n.jsx(Ye.div,{...E,ref:b,style:{pointerEvents:G?Q?"auto":"none":void 0,...s.style},onFocusCapture:xr(s.onFocusCapture,we.onFocusCapture),onBlurCapture:xr(s.onBlurCapture,we.onBlurCapture),onPointerDownCapture:xr(s.onPointerDownCapture,le.onPointerDownCapture)})});af.displayName=eg;var ng="DismissableLayerBranch",og=h.forwardRef((s,u)=>{const a=h.useContext(bi),c=h.useRef(null),f=Ar(u,c);return h.useEffect(()=>{const m=c.current;if(m)return a.branches.add(m),()=>{a.branches.delete(m)}},[a.branches]),n.jsx(Ye.div,{...s,ref:f})});og.displayName=ng;function sg(){const s=h.useContext(bi),[u,a]=h.useState(null);return h.useEffect(()=>{if(u)return s.dismissableSurfaces.add(u),()=>{s.dismissableSurfaces.delete(u)}},[u,s.dismissableSurfaces]),a}function lg(s,u){const{ownerDocument:a=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:c=!1,isDeferredPointerDownOutsideRef:f,dismissableSurfaces:m}=u,p=yo(s),g=h.useRef(!1),N=h.useRef(!1),E=h.useRef(new Map),j=h.useRef(()=>{});return h.useEffect(()=>{function S(){N.current=!1,f.current=!1,E.current.clear()}function O(){return Array.from(E.current.values()).some(Boolean)}function z(M){if(!N.current)return;const B=M.target;B instanceof Node&&[...m].some(Q=>Q.contains(B))||E.current.set(M.type,!0),M.type==="click"&&window.setTimeout(()=>{N.current&&j.current()},0)}function L(M){N.current&&E.current.set(M.type,!1)}const b=M=>{if(M.target&&!g.current){let B=function(){a.removeEventListener("click",j.current);const Q=O();S(),Q||uf(tg,p,G,{discrete:!0})};const G={originalEvent:M};N.current=!0,f.current=c&&M.button===0,E.current.clear(),!c||M.button!==0?B():(a.removeEventListener("click",j.current),j.current=B,a.addEventListener("click",j.current,{once:!0}))}else a.removeEventListener("click",j.current),S();g.current=!1},P=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const M of P)a.addEventListener(M,z,!0),a.addEventListener(M,L);const D=window.setTimeout(()=>{a.addEventListener("pointerdown",b)},0);return()=>{window.clearTimeout(D),a.removeEventListener("pointerdown",b),a.removeEventListener("click",j.current);for(const M of P)a.removeEventListener(M,z,!0),a.removeEventListener(M,L)}},[a,p,c,f,m]),{onPointerDownCapture:()=>g.current=!0}}function ag(s,u=globalThis==null?void 0:globalThis.document){const a=yo(s),c=h.useRef(!1);return h.useEffect(()=>{const f=m=>{m.target&&!c.current&&uf(rg,a,{originalEvent:m},{discrete:!1})};return u.addEventListener("focusin",f),()=>u.removeEventListener("focusin",f)},[u,a]),{onFocusCapture:()=>c.current=!0,onBlurCapture:()=>c.current=!1}}function _d(){const s=new CustomEvent(ci);document.dispatchEvent(s)}function uf(s,u,a,{discrete:c}){const f=a.originalEvent.target,m=new CustomEvent(s,{bubbles:!1,cancelable:!0,detail:a});u&&f.addEventListener(s,u,{once:!0}),c?Xh(f,m):f.dispatchEvent(m)}var Za="focusScope.autoFocusOnMount",Ya="focusScope.autoFocusOnUnmount",Pd={bubbles:!1,cancelable:!0},ig="FocusScope",cf=h.forwardRef((s,u)=>{const{loop:a=!1,trapped:c=!1,onMountAutoFocus:f,onUnmountAutoFocus:m,...p}=s,[g,N]=h.useState(null),E=yo(f),j=yo(m),S=h.useRef(null),O=Ar(u,b=>N(b)),z=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(c){let b=function(B){if(z.paused||!g)return;const G=B.target;g.contains(G)?S.current=G:gr(S.current,{select:!0})},P=function(B){if(z.paused||!g)return;const G=B.relatedTarget;G!==null&&(g.contains(G)||gr(S.current,{select:!0}))},D=function(B){if(document.activeElement===document.body)for(const Q of B)Q.removedNodes.length>0&&gr(g)};document.addEventListener("focusin",b),document.addEventListener("focusout",P);const M=new MutationObserver(D);return g&&M.observe(g,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",P),M.disconnect()}}},[c,g,z.paused]),h.useEffect(()=>{if(g){Rd.add(z);const b=document.activeElement;if(!g.contains(b)){const D=new CustomEvent(Za,Pd);g.addEventListener(Za,E),g.dispatchEvent(D),D.defaultPrevented||(ug(mg(df(g)),{select:!0}),document.activeElement===b&&gr(g))}return()=>{g.removeEventListener(Za,E),setTimeout(()=>{const D=new CustomEvent(Ya,Pd);g.addEventListener(Ya,j),g.dispatchEvent(D),D.defaultPrevented||gr(b??document.body,{select:!0}),g.removeEventListener(Ya,j),Rd.remove(z)},0)}}},[g,E,j,z]);const L=h.useCallback(b=>{if(!a&&!c||z.paused)return;const P=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,D=document.activeElement;if(P&&D){const M=b.currentTarget,[B,G]=cg(M);B&&G?!b.shiftKey&&D===G?(b.preventDefault(),a&&gr(B,{select:!0})):b.shiftKey&&D===B&&(b.preventDefault(),a&&gr(G,{select:!0})):D===M&&b.preventDefault()}},[a,c,z.paused]);return n.jsx(Ye.div,{tabIndex:-1,...p,ref:O,onKeyDown:L})});cf.displayName=ig;function ug(s,{select:u=!1}={}){const a=document.activeElement;for(const c of s)if(gr(c,{select:u}),document.activeElement!==a)return}function cg(s){const u=df(s),a=Md(u,s),c=Md(u.reverse(),s);return[a,c]}function df(s){const u=[],a=document.createTreeWalker(s,NodeFilter.SHOW_ELEMENT,{acceptNode:c=>{const f=c.tagName==="INPUT"&&c.type==="hidden";return c.disabled||c.hidden||f?NodeFilter.FILTER_SKIP:c.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)u.push(a.currentNode);return u}function Md(s,u){for(const a of s)if(!dg(a,{upTo:u}))return a}function dg(s,{upTo:u}){if(getComputedStyle(s).visibility==="hidden")return!0;for(;s;){if(u!==void 0&&s===u)return!1;if(getComputedStyle(s).display==="none")return!0;s=s.parentElement}return!1}function fg(s){return s instanceof HTMLInputElement&&"select"in s}function gr(s,{select:u=!1}={}){if(s&&s.focus){const a=document.activeElement;s.focus({preventScroll:!0}),s!==a&&fg(s)&&u&&s.select()}}var Rd=pg();function pg(){let s=[];return{add(u){const a=s[0];u!==a&&(a==null||a.pause()),s=Ld(s,u),s.unshift(u)},remove(u){var a;s=Ld(s,u),(a=s[0])==null||a.resume()}}}function Ld(s,u){const a=[...s],c=a.indexOf(u);return c!==-1&&a.splice(c,1),a}function mg(s){return s.filter(u=>u.tagName!=="A")}var hg="Portal",ff=h.forwardRef((s,u)=>{var g;const{container:a,...c}=s,[f,m]=h.useState(!1);vo(()=>m(!0),[]);const p=a||f&&((g=globalThis==null?void 0:globalThis.document)==null?void 0:g.body);return p?sf.createPortal(n.jsx(Ye.div,{...c,ref:u}),p):null});ff.displayName=hg;function gg(s,u){return h.useReducer((a,c)=>u[a][c]??a,s)}var Zs=s=>{const{present:u,children:a}=s,c=xg(u),f=typeof a=="function"?a({present:c.isPresent}):h.Children.only(a),m=vg(c.ref,yg(f));return typeof a=="function"||c.isPresent?h.cloneElement(f,{ref:m}):null};Zs.displayName="Presence";function xg(s){const[u,a]=h.useState(),c=h.useRef(null),f=h.useRef(s),m=h.useRef("none"),p=s?"mounted":"unmounted",[g,N]=gg(p,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const E=zs(c.current);m.current=g==="mounted"?E:"none"},[g]),vo(()=>{const E=c.current,j=f.current;if(j!==s){const O=m.current,z=zs(E);s?N("MOUNT"):z==="none"||(E==null?void 0:E.display)==="none"?N("UNMOUNT"):N(j&&O!==z?"ANIMATION_OUT":"UNMOUNT"),f.current=s}},[s,N]),vo(()=>{if(u){let E;const j=u.ownerDocument.defaultView??window,S=z=>{const b=zs(c.current).includes(CSS.escape(z.animationName));if(z.target===u&&b&&(N("ANIMATION_END"),!f.current)){const P=u.style.animationFillMode;u.style.animationFillMode="forwards",E=j.setTimeout(()=>{u.style.animationFillMode==="forwards"&&(u.style.animationFillMode=P)})}},O=z=>{z.target===u&&(m.current=zs(c.current))};return u.addEventListener("animationstart",O),u.addEventListener("animationcancel",S),u.addEventListener("animationend",S),()=>{j.clearTimeout(E),u.removeEventListener("animationstart",O),u.removeEventListener("animationcancel",S),u.removeEventListener("animationend",S)}}else N("ANIMATION_END")},[u,N]),{isPresent:["mounted","unmountSuspended"].includes(g),ref:h.useCallback(E=>{c.current=E?getComputedStyle(E):null,a(E)},[])}}function zd(s,u){if(typeof s=="function")return s(u);s!=null&&(s.current=u)}function vg(...s){const u=h.useRef(s);return u.current=s,h.useCallback(a=>{const c=u.current;let f=!1;const m=c.map(p=>{const g=zd(p,a);return!f&&typeof g=="function"&&(f=!0),g});if(f)return()=>{for(let p=0;p{Dt||(Dt={start:Od(),end:Od()});const{start:s,end:u}=Dt;return document.body.firstElementChild!==s&&document.body.insertAdjacentElement("afterbegin",s),document.body.lastElementChild!==u&&document.body.insertAdjacentElement("beforeend",u),Os++,()=>{Os===1&&(Dt==null||Dt.start.remove(),Dt==null||Dt.end.remove(),Dt=null),Os=Math.max(0,Os-1)}},[])}function Od(){const s=document.createElement("span");return s.setAttribute("data-radix-focus-guard",""),s.tabIndex=0,s.style.outline="none",s.style.opacity="0",s.style.position="fixed",s.style.pointerEvents="none",s}var Tt=function(){return Tt=Object.assign||function(u){for(var a,c=1,f=arguments.length;c"u")return Ag;var u=Ig(s),a=document.documentElement.clientWidth,c=window.innerWidth;return{left:u[0],top:u[1],right:u[2],gap:Math.max(0,c-a+u[2]-u[0])}},$g=gf(),vn="data-scroll-locked",Ug=function(s,u,a,c){var f=s.left,m=s.top,p=s.right,g=s.gap;return a===void 0&&(a="margin"),` + */const yi=ge("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ii=[{id:"dashboard",label:"Zentrale",hint:"System- & Stack-Status",icon:hh},{id:"models",label:"Modell-Manager",hint:"Verwalten, laden & Gateway-Routing",icon:th},{id:"system",label:"Diagnose",hint:"Metriken, Dienste, Logs",icon:vr},{id:"memory",label:"Gedächtnis",hint:"Geteiltes Memory verwalten",icon:qs},{id:"connect",label:"Verbinden",hint:"IDE-/Agent-Configs erzeugen",icon:xh},{id:"agent",label:"Hermes",hint:"Agent-Status & WebUI öffnen",icon:go},{id:"guide",label:"Anleitung",hint:"Einrichten & Vibe-Coding",icon:lh}];var jd=1,Sh=.9,Ch=.8,Eh=.17,Qa=.1,qa=.999,_h=.9999,Ph=.99,Mh=/[\\\/_+.#"@\[\(\{&]/,Rh=/[\\\/_+.#"@\[\(\{&]/g,Lh=/[\s-]/,of=/[\s-]/g;function ui(s,u,a,c,f,m,p){if(m===u.length)return f===s.length?jd:Ph;var g=`${f},${m}`;if(p[g]!==void 0)return p[g];for(var N=c.charAt(m),E=a.indexOf(N,f),j=0,S,O,z,L;E>=0;)S=ui(s,u,a,c,E+1,m+1,p),S>j&&(E===f?S*=jd:Mh.test(s.charAt(E-1))?(S*=Ch,z=s.slice(f,E-1).match(Rh),z&&f>0&&(S*=Math.pow(qa,z.length))):Lh.test(s.charAt(E-1))?(S*=Sh,L=s.slice(f,E-1).match(of),L&&f>0&&(S*=Math.pow(qa,L.length))):(S*=Eh,f>0&&(S*=Math.pow(qa,E-f))),s.charAt(E)!==u.charAt(m)&&(S*=_h)),(SS&&(S=O*Qa)),S>j&&(j=S),E=a.indexOf(N,E+1);return p[g]=j,j}function Nd(s){return s.toLowerCase().replace(of," ")}function zh(s,u,a){return s=a&&a.length>0?`${s+" "+a.join(" ")}`:s,ui(s,u,Nd(s),Nd(u),0,0,{})}function xr(s,u,{checkForDefaultPrevented:a=!0}={}){return function(f){if(s==null||s(f),a===!1||!f.defaultPrevented)return u==null?void 0:u(f)}}function Sd(s,u){if(typeof s=="function")return s(u);s!=null&&(s.current=u)}function kn(...s){return u=>{let a=!1;const c=s.map(f=>{const m=Sd(f,u);return!a&&typeof m=="function"&&(a=!0),m});if(a)return()=>{for(let f=0;f{var D;const{scope:O,children:z,...L}=S,b=((D=O==null?void 0:O[s])==null?void 0:D[N])||g,P=h.useMemo(()=>L,Object.values(L));return n.jsx(b.Provider,{value:P,children:z})};E.displayName=m+"Provider";function j(S,O){var b;const z=((b=O==null?void 0:O[s])==null?void 0:b[N])||g,L=h.useContext(z);if(L)return L;if(p!==void 0)return p;throw new Error(`\`${S}\` must be used within \`${m}\``)}return[E,j]}const f=()=>{const m=a.map(p=>h.createContext(p));return function(g){const N=(g==null?void 0:g[s])||m;return h.useMemo(()=>({[`__scope${s}`]:{...g,[s]:N}}),[g,N])}};return f.scopeName=s,[c,Dh(f,...u)]}function Dh(...s){const u=s[0];if(s.length===1)return u;const a=()=>{const c=s.map(f=>({useScope:f(),scopeName:f.scopeName}));return function(m){const p=c.reduce((g,{useScope:N,scopeName:E})=>{const S=N(m)[`__scope${E}`];return{...g,...S}},{});return h.useMemo(()=>({[`__scope${u.scopeName}`]:p}),[p])}};return a.scopeName=u.scopeName,a}var vo=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},Th=gi[" useId ".trim().toString()]||(()=>{}),Ah=0;function Kt(s){const[u,a]=h.useState(Th());return vo(()=>{a(c=>c??String(Ah++))},[s]),u?`radix-${u}`:""}var Ih=gi[" useInsertionEffect ".trim().toString()]||vo;function Fh({prop:s,defaultProp:u,onChange:a=()=>{},caller:c}){const[f,m,p]=$h({defaultProp:u,onChange:a}),g=s!==void 0,N=g?s:f;{const j=h.useRef(s!==void 0);h.useEffect(()=>{const S=j.current;S!==g&&console.warn(`${c} is changing from ${S?"controlled":"uncontrolled"} to ${g?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),j.current=g},[g,c])}const E=h.useCallback(j=>{var S;if(g){const O=Uh(j)?j(s):j;O!==s&&((S=p.current)==null||S.call(p,O))}else m(j)},[g,s,m,p]);return[N,E]}function $h({defaultProp:s,onChange:u}){const[a,c]=h.useState(s),f=h.useRef(a),m=h.useRef(u);return Ih(()=>{m.current=u},[u]),h.useEffect(()=>{var p;f.current!==a&&((p=m.current)==null||p.call(m,a),f.current=a)},[a,f]),[a,c,m]}function Uh(s){return typeof s=="function"}var sf=Zd();function lf(s){const u=h.forwardRef((a,c)=>{let{children:f,...m}=a,p=null,g=!1;const N=[];Cd(f)&&typeof Ls=="function"&&(f=Ls(f._payload)),h.Children.forEach(f,O=>{var z;if(Gh(O)){g=!0;const L=O;let b="child"in L.props?L.props.child:L.props.children;Cd(b)&&typeof Ls=="function"&&(b=Ls(b._payload)),p=Vh(L,b),N.push((z=p==null?void 0:p.props)==null?void 0:z.children)}else N.push(O)}),p?p=h.cloneElement(p,void 0,N):!g&&h.Children.count(f)===1&&h.isValidElement(f)&&(p=f);const E=p?Hh(p):void 0,j=Ar(c,E);if(!p){if(f||f===0)throw new Error(g?Zh(s):qh(s));return f}const S=Wh(m,p.props??{});return p.type!==h.Fragment&&(S.ref=c?j:E),h.cloneElement(p,S)});return u.displayName=`${s}.Slot`,u}var Bh=Symbol.for("radix.slottable"),Vh=(s,u)=>{if("child"in s.props){const a=s.props.child;return h.isValidElement(a)?h.cloneElement(a,void 0,s.props.children(a.props.children)):null}return h.isValidElement(u)?u:null};function Wh(s,u){const a={...u};for(const c in u){const f=s[c],m=u[c];/^on[A-Z]/.test(c)?f&&m?a[c]=(...g)=>{const N=m(...g);return f(...g),N}:f&&(a[c]=f):c==="style"?a[c]={...f,...m}:c==="className"&&(a[c]=[f,m].filter(Boolean).join(" "))}return{...s,...a}}function Hh(s){var c,f;let u=(c=Object.getOwnPropertyDescriptor(s.props,"ref"))==null?void 0:c.get,a=u&&"isReactWarning"in u&&u.isReactWarning;return a?s.ref:(u=(f=Object.getOwnPropertyDescriptor(s,"ref"))==null?void 0:f.get,a=u&&"isReactWarning"in u&&u.isReactWarning,a?s.props.ref:s.props.ref||s.ref)}function Gh(s){return h.isValidElement(s)&&typeof s.type=="function"&&"__radixId"in s.type&&s.type.__radixId===Bh}var Kh=Symbol.for("react.lazy");function Cd(s){return s!=null&&typeof s=="object"&&"$$typeof"in s&&s.$$typeof===Kh&&"_payload"in s&&Qh(s._payload)}function Qh(s){return typeof s=="object"&&s!==null&&"then"in s}var qh=s=>`${s} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Zh=s=>`${s} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Ls=gi[" use ".trim().toString()],Yh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ye=Yh.reduce((s,u)=>{const a=lf(`Primitive.${u}`),c=h.forwardRef((f,m)=>{const{asChild:p,...g}=f,N=p?a:u;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),n.jsx(N,{...g,ref:m})});return c.displayName=`Primitive.${u}`,{...s,[u]:c}},{});function Xh(s,u){s&&sf.flushSync(()=>s.dispatchEvent(u))}function yo(s){const u=h.useRef(s);return h.useEffect(()=>{u.current=s}),h.useMemo(()=>((...a)=>{var c;return(c=u.current)==null?void 0:c.call(u,...a)}),[])}function Jh(s,u=globalThis==null?void 0:globalThis.document){const a=yo(s);h.useEffect(()=>{const c=f=>{f.key==="Escape"&&a(f)};return u.addEventListener("keydown",c,{capture:!0}),()=>u.removeEventListener("keydown",c,{capture:!0})},[a,u])}var eg="DismissableLayer",ci="dismissableLayer.update",tg="dismissableLayer.pointerDownOutside",rg="dismissableLayer.focusOutside",Ed,bi=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),af=h.forwardRef((s,u)=>{const{disableOutsidePointerEvents:a=!1,deferPointerDownOutside:c=!1,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:g,onDismiss:N,...E}=s,j=h.useContext(bi),[S,O]=h.useState(null),z=(S==null?void 0:S.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,L]=h.useState({}),b=Ar(u,fe=>O(fe)),P=Array.from(j.layers),[D]=[...j.layersWithOutsidePointerEventsDisabled].slice(-1),M=P.indexOf(D),B=S?P.indexOf(S):-1,G=j.layersWithOutsidePointerEventsDisabled.size>0,Q=B>=M,K=h.useRef(!1),le=lg(fe=>{const A=fe.target;if(!(A instanceof Node))return;const pe=[...j.branches].some(ae=>ae.contains(A));!Q||pe||(m==null||m(fe),g==null||g(fe),fe.defaultPrevented||N==null||N())},{ownerDocument:z,deferPointerDownOutside:c,isDeferredPointerDownOutsideRef:K,dismissableSurfaces:j.dismissableSurfaces}),we=ag(fe=>{if(c&&K.current)return;const A=fe.target;[...j.branches].some(ae=>ae.contains(A))||(p==null||p(fe),g==null||g(fe),fe.defaultPrevented||N==null||N())},z);return Jh(fe=>{B===j.layers.size-1&&(f==null||f(fe),!fe.defaultPrevented&&N&&(fe.preventDefault(),N()))},z),h.useEffect(()=>{if(S)return a&&(j.layersWithOutsidePointerEventsDisabled.size===0&&(Ed=z.body.style.pointerEvents,z.body.style.pointerEvents="none"),j.layersWithOutsidePointerEventsDisabled.add(S)),j.layers.add(S),_d(),()=>{a&&(j.layersWithOutsidePointerEventsDisabled.delete(S),j.layersWithOutsidePointerEventsDisabled.size===0&&(z.body.style.pointerEvents=Ed))}},[S,z,a,j]),h.useEffect(()=>()=>{S&&(j.layers.delete(S),j.layersWithOutsidePointerEventsDisabled.delete(S),_d())},[S,j]),h.useEffect(()=>{const fe=()=>L({});return document.addEventListener(ci,fe),()=>document.removeEventListener(ci,fe)},[]),n.jsx(Ye.div,{...E,ref:b,style:{pointerEvents:G?Q?"auto":"none":void 0,...s.style},onFocusCapture:xr(s.onFocusCapture,we.onFocusCapture),onBlurCapture:xr(s.onBlurCapture,we.onBlurCapture),onPointerDownCapture:xr(s.onPointerDownCapture,le.onPointerDownCapture)})});af.displayName=eg;var ng="DismissableLayerBranch",og=h.forwardRef((s,u)=>{const a=h.useContext(bi),c=h.useRef(null),f=Ar(u,c);return h.useEffect(()=>{const m=c.current;if(m)return a.branches.add(m),()=>{a.branches.delete(m)}},[a.branches]),n.jsx(Ye.div,{...s,ref:f})});og.displayName=ng;function sg(){const s=h.useContext(bi),[u,a]=h.useState(null);return h.useEffect(()=>{if(u)return s.dismissableSurfaces.add(u),()=>{s.dismissableSurfaces.delete(u)}},[u,s.dismissableSurfaces]),a}function lg(s,u){const{ownerDocument:a=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:c=!1,isDeferredPointerDownOutsideRef:f,dismissableSurfaces:m}=u,p=yo(s),g=h.useRef(!1),N=h.useRef(!1),E=h.useRef(new Map),j=h.useRef(()=>{});return h.useEffect(()=>{function S(){N.current=!1,f.current=!1,E.current.clear()}function O(){return Array.from(E.current.values()).some(Boolean)}function z(M){if(!N.current)return;const B=M.target;B instanceof Node&&[...m].some(Q=>Q.contains(B))||E.current.set(M.type,!0),M.type==="click"&&window.setTimeout(()=>{N.current&&j.current()},0)}function L(M){N.current&&E.current.set(M.type,!1)}const b=M=>{if(M.target&&!g.current){let B=function(){a.removeEventListener("click",j.current);const Q=O();S(),Q||uf(tg,p,G,{discrete:!0})};const G={originalEvent:M};N.current=!0,f.current=c&&M.button===0,E.current.clear(),!c||M.button!==0?B():(a.removeEventListener("click",j.current),j.current=B,a.addEventListener("click",j.current,{once:!0}))}else a.removeEventListener("click",j.current),S();g.current=!1},P=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const M of P)a.addEventListener(M,z,!0),a.addEventListener(M,L);const D=window.setTimeout(()=>{a.addEventListener("pointerdown",b)},0);return()=>{window.clearTimeout(D),a.removeEventListener("pointerdown",b),a.removeEventListener("click",j.current);for(const M of P)a.removeEventListener(M,z,!0),a.removeEventListener(M,L)}},[a,p,c,f,m]),{onPointerDownCapture:()=>g.current=!0}}function ag(s,u=globalThis==null?void 0:globalThis.document){const a=yo(s),c=h.useRef(!1);return h.useEffect(()=>{const f=m=>{m.target&&!c.current&&uf(rg,a,{originalEvent:m},{discrete:!1})};return u.addEventListener("focusin",f),()=>u.removeEventListener("focusin",f)},[u,a]),{onFocusCapture:()=>c.current=!0,onBlurCapture:()=>c.current=!1}}function _d(){const s=new CustomEvent(ci);document.dispatchEvent(s)}function uf(s,u,a,{discrete:c}){const f=a.originalEvent.target,m=new CustomEvent(s,{bubbles:!1,cancelable:!0,detail:a});u&&f.addEventListener(s,u,{once:!0}),c?Xh(f,m):f.dispatchEvent(m)}var Za="focusScope.autoFocusOnMount",Ya="focusScope.autoFocusOnUnmount",Pd={bubbles:!1,cancelable:!0},ig="FocusScope",cf=h.forwardRef((s,u)=>{const{loop:a=!1,trapped:c=!1,onMountAutoFocus:f,onUnmountAutoFocus:m,...p}=s,[g,N]=h.useState(null),E=yo(f),j=yo(m),S=h.useRef(null),O=Ar(u,b=>N(b)),z=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(c){let b=function(B){if(z.paused||!g)return;const G=B.target;g.contains(G)?S.current=G:gr(S.current,{select:!0})},P=function(B){if(z.paused||!g)return;const G=B.relatedTarget;G!==null&&(g.contains(G)||gr(S.current,{select:!0}))},D=function(B){if(document.activeElement===document.body)for(const Q of B)Q.removedNodes.length>0&&gr(g)};document.addEventListener("focusin",b),document.addEventListener("focusout",P);const M=new MutationObserver(D);return g&&M.observe(g,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",P),M.disconnect()}}},[c,g,z.paused]),h.useEffect(()=>{if(g){Rd.add(z);const b=document.activeElement;if(!g.contains(b)){const D=new CustomEvent(Za,Pd);g.addEventListener(Za,E),g.dispatchEvent(D),D.defaultPrevented||(ug(mg(df(g)),{select:!0}),document.activeElement===b&&gr(g))}return()=>{g.removeEventListener(Za,E),setTimeout(()=>{const D=new CustomEvent(Ya,Pd);g.addEventListener(Ya,j),g.dispatchEvent(D),D.defaultPrevented||gr(b??document.body,{select:!0}),g.removeEventListener(Ya,j),Rd.remove(z)},0)}}},[g,E,j,z]);const L=h.useCallback(b=>{if(!a&&!c||z.paused)return;const P=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,D=document.activeElement;if(P&&D){const M=b.currentTarget,[B,G]=cg(M);B&&G?!b.shiftKey&&D===G?(b.preventDefault(),a&&gr(B,{select:!0})):b.shiftKey&&D===B&&(b.preventDefault(),a&&gr(G,{select:!0})):D===M&&b.preventDefault()}},[a,c,z.paused]);return n.jsx(Ye.div,{tabIndex:-1,...p,ref:O,onKeyDown:L})});cf.displayName=ig;function ug(s,{select:u=!1}={}){const a=document.activeElement;for(const c of s)if(gr(c,{select:u}),document.activeElement!==a)return}function cg(s){const u=df(s),a=Md(u,s),c=Md(u.reverse(),s);return[a,c]}function df(s){const u=[],a=document.createTreeWalker(s,NodeFilter.SHOW_ELEMENT,{acceptNode:c=>{const f=c.tagName==="INPUT"&&c.type==="hidden";return c.disabled||c.hidden||f?NodeFilter.FILTER_SKIP:c.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)u.push(a.currentNode);return u}function Md(s,u){for(const a of s)if(!dg(a,{upTo:u}))return a}function dg(s,{upTo:u}){if(getComputedStyle(s).visibility==="hidden")return!0;for(;s;){if(u!==void 0&&s===u)return!1;if(getComputedStyle(s).display==="none")return!0;s=s.parentElement}return!1}function fg(s){return s instanceof HTMLInputElement&&"select"in s}function gr(s,{select:u=!1}={}){if(s&&s.focus){const a=document.activeElement;s.focus({preventScroll:!0}),s!==a&&fg(s)&&u&&s.select()}}var Rd=pg();function pg(){let s=[];return{add(u){const a=s[0];u!==a&&(a==null||a.pause()),s=Ld(s,u),s.unshift(u)},remove(u){var a;s=Ld(s,u),(a=s[0])==null||a.resume()}}}function Ld(s,u){const a=[...s],c=a.indexOf(u);return c!==-1&&a.splice(c,1),a}function mg(s){return s.filter(u=>u.tagName!=="A")}var hg="Portal",ff=h.forwardRef((s,u)=>{var g;const{container:a,...c}=s,[f,m]=h.useState(!1);vo(()=>m(!0),[]);const p=a||f&&((g=globalThis==null?void 0:globalThis.document)==null?void 0:g.body);return p?sf.createPortal(n.jsx(Ye.div,{...c,ref:u}),p):null});ff.displayName=hg;function gg(s,u){return h.useReducer((a,c)=>u[a][c]??a,s)}var Zs=s=>{const{present:u,children:a}=s,c=xg(u),f=typeof a=="function"?a({present:c.isPresent}):h.Children.only(a),m=vg(c.ref,yg(f));return typeof a=="function"||c.isPresent?h.cloneElement(f,{ref:m}):null};Zs.displayName="Presence";function xg(s){const[u,a]=h.useState(),c=h.useRef(null),f=h.useRef(s),m=h.useRef("none"),p=s?"mounted":"unmounted",[g,N]=gg(p,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const E=zs(c.current);m.current=g==="mounted"?E:"none"},[g]),vo(()=>{const E=c.current,j=f.current;if(j!==s){const O=m.current,z=zs(E);s?N("MOUNT"):z==="none"||(E==null?void 0:E.display)==="none"?N("UNMOUNT"):N(j&&O!==z?"ANIMATION_OUT":"UNMOUNT"),f.current=s}},[s,N]),vo(()=>{if(u){let E;const j=u.ownerDocument.defaultView??window,S=z=>{const b=zs(c.current).includes(CSS.escape(z.animationName));if(z.target===u&&b&&(N("ANIMATION_END"),!f.current)){const P=u.style.animationFillMode;u.style.animationFillMode="forwards",E=j.setTimeout(()=>{u.style.animationFillMode==="forwards"&&(u.style.animationFillMode=P)})}},O=z=>{z.target===u&&(m.current=zs(c.current))};return u.addEventListener("animationstart",O),u.addEventListener("animationcancel",S),u.addEventListener("animationend",S),()=>{j.clearTimeout(E),u.removeEventListener("animationstart",O),u.removeEventListener("animationcancel",S),u.removeEventListener("animationend",S)}}else N("ANIMATION_END")},[u,N]),{isPresent:["mounted","unmountSuspended"].includes(g),ref:h.useCallback(E=>{c.current=E?getComputedStyle(E):null,a(E)},[])}}function zd(s,u){if(typeof s=="function")return s(u);s!=null&&(s.current=u)}function vg(...s){const u=h.useRef(s);return u.current=s,h.useCallback(a=>{const c=u.current;let f=!1;const m=c.map(p=>{const g=zd(p,a);return!f&&typeof g=="function"&&(f=!0),g});if(f)return()=>{for(let p=0;p{Dt||(Dt={start:Od(),end:Od()});const{start:s,end:u}=Dt;return document.body.firstElementChild!==s&&document.body.insertAdjacentElement("afterbegin",s),document.body.lastElementChild!==u&&document.body.insertAdjacentElement("beforeend",u),Os++,()=>{Os===1&&(Dt==null||Dt.start.remove(),Dt==null||Dt.end.remove(),Dt=null),Os=Math.max(0,Os-1)}},[])}function Od(){const s=document.createElement("span");return s.setAttribute("data-radix-focus-guard",""),s.tabIndex=0,s.style.outline="none",s.style.opacity="0",s.style.position="fixed",s.style.pointerEvents="none",s}var Tt=function(){return Tt=Object.assign||function(u){for(var a,c=1,f=arguments.length;c"u")return Ag;var u=Ig(s),a=document.documentElement.clientWidth,c=window.innerWidth;return{left:u[0],top:u[1],right:u[2],gap:Math.max(0,c-a+u[2]-u[0])}},$g=gf(),vn="data-scroll-locked",Ug=function(s,u,a,c){var f=s.left,m=s.top,p=s.right,g=s.gap;return a===void 0&&(a="margin"),` .`.concat(kg,` { overflow: hidden `).concat(c,`; padding-right: `).concat(g,"px ").concat(c,`; @@ -337,7 +337,7 @@ Error generating stack: `+i.message+` stroke-dasharray: 4 6; animation: flow-dash 1s linear infinite; } - `}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-3.5",children:[n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(li,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"VRAM / Memory Belegung"})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground",children:["Llama Swap VRAM-Pool: ",hn(X)," / ",hn(he)," geladen"]}),a.length>0&&n.jsx("button",{onClick:te,className:"h-6 px-2.5 rounded border border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/10 text-amber-400 text-[9px] font-bold uppercase transition-all cursor-pointer",children:"Alle entladen"})]})]}),n.jsx("div",{className:"h-7 w-full rounded-xl bg-background/50 border border-border/40 overflow-hidden flex p-0.5 relative group",children:V.length===0?n.jsx("div",{className:"w-full h-full flex items-center justify-center text-[10px] text-muted-foreground/60 italic font-mono select-none",children:"VRAM Leer — Auto-Swap lädt Modelle bei Anfrage"}):V.map((T,de)=>{var Ae;const be=(T.size_bytes||0)/he*100,Pe=["from-teal-500 to-emerald-500","from-indigo-500 to-blue-500","from-purple-500 to-pink-500","from-cyan-500 to-sky-500"][de%4];return n.jsxs("div",{style:{width:`${be}%`},className:oe("h-full rounded bg-gradient-to-r flex items-center justify-between px-2.5 transition-all text-white/95 shrink-0 shadow-inner select-none",Pe),title:`${T.name} (${hn(T.size_bytes)})`,children:[n.jsxs("span",{className:"text-[9px] font-bold truncate max-w-[120px] font-space tracking-wide",children:[T.role?`[${T.role}] `:"",(Ae=T.name.split("/").pop())==null?void 0:Ae.replace(".gguf","")]}),n.jsx("span",{className:"text-[8px] font-mono opacity-80",children:hn(T.size_bytes)})]},T.name)})})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 shadow-lg shadow-black/10 space-y-4",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Interactive Gateway Graph"}),n.jsx("p",{className:"text-[10px] text-muted-foreground mt-0.5 leading-relaxed",children:"Klicke links auf Editoren, um Configs zu kopieren. Klicke rechts auf Rollen, um GGUF-Zuweisungen live zu ändern."})]}),n.jsxs("div",{ref:pe,className:"relative w-full h-[360px] border border-border/30 rounded-xl bg-black/25 overflow-hidden flex",children:[n.jsxs("svg",{className:"absolute inset-0 pointer-events-none w-full h-full",children:[n.jsxs("defs",{children:[n.jsxs("linearGradient",{id:"cyan-to-teal",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[n.jsx("stop",{offset:"0%",stopColor:"#06b6d4",stopOpacity:"0.45"}),n.jsx("stop",{offset:"100%",stopColor:"#0d9488",stopOpacity:"0.45"})]}),n.jsxs("linearGradient",{id:"active-glow",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[n.jsx("stop",{offset:"0%",stopColor:"#3b82f6",stopOpacity:"0.8"}),n.jsx("stop",{offset:"100%",stopColor:"#10b981",stopOpacity:"0.8"})]})]}),n.jsx("path",{d:ye(.1),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(G==="roocode"||L==="roocode")&&n.jsx("path",{d:ye(.1),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:ye(.3),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(G==="cursor"||L==="cursor")&&n.jsx("path",{d:ye(.3),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:ye(.5),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(G==="opencode"||L==="opencode")&&n.jsx("path",{d:ye(.5),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:ye(.7),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(G==="zed"||L==="zed")&&n.jsx("path",{d:ye(.7),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:ye(.9),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(G==="continue"||L==="continue")&&n.jsx("path",{d:ye(.9),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:Ne(.12),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),De("fast")&&n.jsx("path",{d:Ne(.12),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:Ne(.31),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),De("heavy")&&n.jsx("path",{d:Ne(.31),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:Ne(.5),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),De("coder")&&n.jsx("path",{d:Ne(.5),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:Ne(.69),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),De("vision")&&n.jsx("path",{d:Ne(.69),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:Ne(.88),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),De("scout")&&n.jsx("path",{d:Ne(.88),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"10%"},onMouseEnter:()=>Q("roocode"),onMouseLeave:()=>Q(null),onClick:()=>b(T=>T==="roocode"?null:"roocode"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"Roo Code"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"30%"},onMouseEnter:()=>Q("cursor"),onMouseLeave:()=>Q(null),onClick:()=>b(T=>T==="cursor"?null:"cursor"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"Cursor IDE"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"50%"},onMouseEnter:()=>Q("opencode"),onMouseLeave:()=>Q(null),onClick:()=>b(T=>T==="opencode"?null:"opencode"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"OpenCode"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"70%"},onMouseEnter:()=>Q("zed"),onMouseLeave:()=>Q(null),onClick:()=>b(T=>T==="zed"?null:"zed"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"Zed"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"90%"},onMouseEnter:()=>Q("continue"),onMouseLeave:()=>Q(null),onClick:()=>b(T=>T==="continue"?null:"continue"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"Continue"})]}),n.jsxs("div",{className:"absolute select-none z-10 w-36 py-3 px-4 -translate-y-1/2 -translate-x-1/2 rounded-2xl border border-primary/50 bg-card/90 backdrop-blur-md flex flex-col items-center justify-center text-center shadow-lg shadow-primary/5",style:{left:"50%",top:"50%"},children:[n.jsx("div",{className:"text-[10px] uppercase font-bold text-primary font-space tracking-wide",children:"Gateway Auto"}),n.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground mt-0.5",children:["Schwelle: > ",f!=null&&f.heavy_threshold_chars?f.heavy_threshold_chars/1e3:"4","k Zeichen"]}),n.jsx("div",{className:"mt-1 px-1.5 py-0.5 rounded bg-primary/10 border border-primary/20 text-[9px] font-semibold text-primary uppercase font-mono",children:"Auto-Swap"})]}),g0.map(T=>{var ct;const de=["12%","31%","50%","69%","88%"],be=xe(T),Pe=be?a.includes(be.name):!1;if(T==="reasoning"||T==="agent")return null;const Ae={fast:0,heavy:1,coder:2,vision:3,scout:4}[T];return n.jsxs("div",{className:oe("absolute z-10 w-44 py-1.5 px-3 -translate-y-1/2 -translate-x-1/2 rounded-xl border flex flex-col justify-center hover:border-primary/50 transition-all text-left shadow select-none cursor-pointer",Pe?"border-emerald-500/50 bg-emerald-500/5 shadow-emerald-500/5":be?"border-border/60 bg-card/75":"border-dashed border-border/40 bg-background/20"),style:{left:"90%",top:de[Ae]},onClick:()=>D(P===T?null:T),children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:T}),Pe&&n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"})]}),n.jsx("div",{className:"text-[10px] font-mono font-medium truncate mt-0.5 text-foreground max-w-[150px]",children:be?(ct=be.name.split("/").pop())==null?void 0:ct.replace(".gguf",""):"Keine Zuweisung"}),P===T&&n.jsxs("div",{className:"absolute right-0 top-full mt-1 z-35 w-52 rounded-xl border border-border/80 bg-popover/95 backdrop-blur-md p-1.5 shadow-2xl space-y-1",children:[n.jsx("div",{className:"text-[9px] uppercase font-bold text-muted-foreground/60 px-2 py-1 select-none",children:"Modell zuweisen:"}),n.jsx("button",{onClick:()=>Z(T,""),className:"w-full text-left px-2.5 py-1.5 rounded-lg text-[10px] hover:bg-accent text-red-400 font-semibold cursor-pointer",children:"Zuweisung entfernen"}),s.map(dt=>{var At;return n.jsxs("button",{onClick:()=>Z(T,dt.name),className:oe("w-full text-left px-2.5 py-1.5 rounded-lg text-[10px] hover:bg-accent flex items-center justify-between font-mono cursor-pointer",dt.role===T?"text-primary font-bold":"text-foreground"),children:[n.jsx("span",{className:"truncate max-w-[150px]",children:(At=dt.name.split("/").pop())==null?void 0:At.replace(".gguf","")}),dt.role===T&&n.jsx(Hs,{className:"h-3 w-3 shrink-0"})]},dt.name)})]})]},T)}),L&&p&&n.jsxs("div",{className:"absolute z-30 md:w-96 w-[90%] rounded-2xl border border-border/80 bg-card/95 backdrop-blur-xl p-4 shadow-2xl space-y-3 flex flex-col justify-between",style:{left:"22%",top:L==="roocode"?"5%":L==="cursor"?"20%":L==="opencode"?"40%":L==="zed"?"55%":"65%"},children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[n.jsxs("span",{className:"text-[11px] font-bold uppercase tracking-wider text-primary",children:[L==="roocode"&&"Roo Code Setup",L==="cursor"&&"Cursor Setup",L==="opencode"&&"OpenCode Setup",L==="zed"&&"Zed Setup",L==="continue"&&"Continue Setup"]}),n.jsx("button",{onClick:()=>b(null),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:n.jsx(yi,{className:"h-3.5 w-3.5"})})]}),n.jsxs("div",{className:"text-[10px] text-muted-foreground leading-relaxed space-y-2",children:[L==="roocode"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsxs("li",{children:["Suche in VS Code nach der Erweiterung ",n.jsx("strong",{children:"Roo Code"})," und installiere sie."]}),n.jsxs("li",{children:["Wähle in den Roo Code Einstellungen: Provider: ",n.jsx("strong",{children:"OpenAI Compatible"}),"."]}),n.jsxs("li",{children:["Füge das untenstehende JSON-Snippet in die ",n.jsx("code",{children:"settings.json"})," ein."]})]}),L==="cursor"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsxs("li",{children:["Öffne Cursor Settings ➔ ",n.jsx("strong",{children:"Models"}),"."]}),n.jsxs("li",{children:["Deaktiviere Cloud-Modelle, klappe ",n.jsx("strong",{children:"OpenAI API"})," auf."]}),n.jsxs("li",{children:["Trage die Base URL unten ein und aktiviere das Modell ",n.jsx("strong",{children:"auto"}),"."]})]}),L==="opencode"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsxs("li",{children:["Öffne die ",n.jsx("code",{children:"opencode.jsonc"})," Konfigurationsdatei."]}),n.jsxs("li",{children:["Ersetze den Provider-Eintrag unter ",n.jsx("code",{children:"provider"})," mit dem Snippet unten."]})]}),L==="zed"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsxs("li",{children:["Öffne die Zed Settings (",n.jsx("code",{children:"ctrl+,"}),")."]}),n.jsxs("li",{children:["Füge das untenstehende JSON-Segment unter ",n.jsx("code",{children:"language_models"})," ein."]})]}),L==="continue"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsx("li",{children:"Klicke auf das Zahnrad-Symbol in der Continue-Erweiterung."}),n.jsxs("li",{children:["Füge den Gateway-Eintrag zum ",n.jsx("code",{children:"models"}),"-Array hinzu."]})]})]}),p.tools&&n.jsxs("div",{className:"relative rounded-xl border border-border/40 bg-black/40 overflow-hidden mt-1 shrink-0",children:[n.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-border/20 bg-black/20",children:[n.jsx("span",{className:"text-[8px] font-mono text-muted-foreground",children:"JSON Config"}),n.jsxs("button",{onClick:()=>{var T,de,be,Pe,Ae;return q(L==="roocode"?(T=p.tools.cline)==null?void 0:T.snippet:L==="cursor"?(de=p.tools.cursor)==null?void 0:de.snippet:L==="opencode"?(be=p.tools.opencode)==null?void 0:be.snippet:L==="zed"?(Pe=p.tools.zed)==null?void 0:Pe.snippet:(Ae=p.tools.continue)==null?void 0:Ae.snippet)},className:"text-[9px] font-semibold text-primary hover:text-primary-foreground flex items-center gap-1 cursor-pointer",children:[M?n.jsx(Hs,{className:"h-3 w-3 text-emerald-400"}):n.jsx(ef,{className:"h-3 w-3"}),n.jsx("span",{children:M?"Kopiert":"Kopieren"})]})]}),n.jsx("pre",{className:"p-3 max-h-36 overflow-y-auto text-[9px] font-mono text-cyan-200/90 whitespace-pre scrollbar-thin select-text",children:n.jsxs("code",{children:[L==="roocode"&&((br=p.tools.cline)==null?void 0:br.snippet),L==="cursor"&&((Sn=p.tools.cursor)==null?void 0:Sn.snippet),L==="opencode"&&((wr=p.tools.opencode)==null?void 0:wr.snippet),L==="zed"&&((Ir=p.tools.zed)==null?void 0:Ir.snippet),L==="continue"&&((Cn=p.tools.continue)==null?void 0:Cn.snippet)]})})]})]})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-6 mt-3 text-[10px] text-muted-foreground border-t border-border/20 pt-3",children:[n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"h-2 w-2 rounded-full bg-cyan-400"}),n.jsx("span",{children:"Cyan-Fluss: Client-Anfrage an Gateway"})]}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500 animate-pulse"}),n.jsx("span",{children:"Grüner Puls: Aktive Verbindung / Warmes Modell geladen"})]}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"h-2 w-2 rounded bg-gradient-to-r from-teal-500 to-emerald-500"}),n.jsx("span",{children:"VRAM-Verlauf: Modellspezifischer Speicheranteil"})]})]})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between px-1",children:[n.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Installierte Modell-Bibliothek"}),n.jsxs("div",{className:"flex rounded-lg border border-border/40 bg-card/45 p-0.5",children:[n.jsx("button",{onClick:()=>le("grid"),className:oe("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",K==="grid"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Grid"}),n.jsx("button",{onClick:()=>le("list"),className:oe("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",K==="list"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"List"})]})]}),K==="grid"?n.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:s.length===0?n.jsx("div",{className:"col-span-full text-xs text-muted-foreground border border-dashed border-border/60 rounded-2xl p-12 text-center select-none",children:'Keine Modelle konfiguriert. Verwende den Tab "Modelle finden" zum Herunterladen.'}):s.map(T=>{const de=a.includes(T.name),be=N==null?void 0:N.model_list.find(Ae=>Ae.role===T.role),Pe=Hd(T.name);return n.jsxs("div",{className:oe("rounded-2xl border bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-4 transition-all duration-300 hover:border-primary/40 group",de?"border-primary/45 shadow-primary/5":"border-border/60"),children:[n.jsxs("div",{className:"space-y-3",children:[n.jsx("div",{className:"flex items-start justify-between gap-3",children:n.jsxs("div",{className:"flex gap-2.5 min-w-0",children:[n.jsx("div",{className:oe("w-7 h-7 rounded-lg border flex items-center justify-center font-bold text-xs shrink-0 shadow-sm",Pe.color),title:Pe.name,children:Pe.initial}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("h3",{className:"text-xs font-bold tracking-tight text-foreground line-clamp-2 break-all font-mono",title:T.name,children:T.name.split("/").pop()}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap mt-1",children:[n.jsx("span",{className:"text-[9px] font-mono text-muted-foreground bg-background/40 px-1.5 py-0.5 rounded border border-border/30",children:T.quant||"GGUF"}),de&&n.jsxs("span",{className:"flex items-center gap-1 text-[9px] font-semibold text-emerald-400 uppercase tracking-wider",children:[n.jsx(Ws,{className:"h-3 w-3 animate-pulse"})," Warm"]}),T.role&&n.jsx("span",{className:"px-1.5 py-0.5 rounded bg-primary/10 border border-primary/20 text-[9px] font-mono text-primary font-bold uppercase",children:T.role})]})]})]})}),n.jsx("div",{className:"border-t border-border/30 pt-3 flex flex-wrap gap-1",children:n.jsx(Vd,{caps:T.capabilities})})]}),n.jsxs("div",{className:"space-y-3 pt-1",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-2 text-[10px] font-mono text-muted-foreground",children:[n.jsxs("div",{className:"flex items-center gap-1.5 p-2 bg-background/20 rounded-lg border border-border/20",children:[n.jsx(li,{className:"h-3.5 w-3.5 text-primary/80"}),n.jsxs("div",{children:[n.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Größe"}),n.jsx("div",{className:"text-foreground font-semibold",children:hn(T.size_bytes)})]})]}),n.jsxs("div",{className:"flex items-center gap-1.5 p-2 bg-background/20 rounded-lg border border-border/20",children:[n.jsx(gh,{className:"h-3.5 w-3.5 text-primary/80"}),n.jsxs("div",{children:[n.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Kontext"}),n.jsx("div",{className:"text-foreground font-semibold",children:Wd(T.ctx)})]})]})]}),be&&n.jsxs("div",{className:"p-3 bg-amber-500/5 border border-amber-500/30 rounded-xl space-y-2 flex flex-col justify-between shrink-0",children:[n.jsxs("div",{className:"text-[9px] font-semibold text-amber-400 flex items-center gap-1",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-ping"}),n.jsxs("span",{children:["Upgrade verfügbar: ",be.repo.split("/").pop()]})]}),n.jsxs("button",{onClick:()=>F(be.repo,T.role,T.quant||"Q4_K_M",T.capabilities.tools!=="no"),className:"h-7 w-full flex items-center justify-center gap-1 rounded-lg bg-amber-500 text-black text-[10px] font-bold hover:bg-amber-400 transition-colors cursor-pointer",children:[n.jsx(bn,{className:"h-3 w-3"})," Smart-Swap starten"]})]}),n.jsxs("div",{className:"flex items-center gap-1.5 border-t border-border/20 pt-3 mt-auto",children:[n.jsx("button",{onClick:()=>de?H(T.name):Se(T.name),className:oe("flex-1 h-7 rounded-lg text-[9px] font-bold uppercase transition-all cursor-pointer border flex items-center justify-center gap-1",de?"border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/15 text-amber-400":"border-primary/30 bg-primary/5 hover:bg-primary/15 text-primary"),children:de?"Entladen":"Laden"}),n.jsx("button",{onClick:()=>k(T.name,T.ctx),className:"h-7 px-2.5 rounded-lg border border-border/40 text-[9px] font-bold uppercase hover:bg-accent text-muted-foreground transition-colors cursor-pointer",title:"Kontextlänge anpassen",children:"Ctx"}),n.jsx("button",{onClick:()=>x(T.name),className:"h-7 w-7 rounded-lg border border-border/40 text-muted-foreground hover:text-red-400 hover:bg-red-500/5 flex items-center justify-center transition-colors cursor-pointer",title:"Modell löschen",children:n.jsx(ai,{className:"h-3.5 w-3.5"})})]})]})]},T.name)})}):n.jsx("div",{className:"space-y-2",children:s.length===0?n.jsx("div",{className:"text-xs text-muted-foreground border border-dashed border-border/60 rounded-2xl p-12 text-center select-none",children:'Keine Modelle konfiguriert. Verwende den Tab "Modelle finden" zum Herunterladen.'}):s.map(T=>{const de=a.includes(T.name),be=Hd(T.name);return n.jsxs("div",{className:oe("rounded-xl border bg-card/45 backdrop-blur-md p-3.5 shadow-lg shadow-black/5 flex flex-col sm:flex-row sm:items-center justify-between gap-3 hover:border-primary/40 transition-all",de?"border-primary/45":"border-border/60"),children:[n.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[n.jsx("div",{className:oe("w-8 h-8 rounded-lg border border-border/40 flex items-center justify-center font-bold text-xs shrink-0 shadow-sm",be.color),title:be.name,children:be.initial}),n.jsxs("div",{className:"min-w-0 text-left",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("h4",{className:"text-xs font-bold text-foreground truncate max-w-[250px] sm:max-w-[400px] break-all font-mono",title:T.name,children:T.name.split("/").pop()}),T.role&&n.jsx("span",{className:"px-1.5 py-0.5 rounded bg-primary/10 border border-primary/20 text-[8px] font-mono text-primary font-bold uppercase shrink-0",children:T.role}),de&&n.jsxs("span",{className:"flex items-center gap-0.5 text-[8px] font-semibold text-emerald-400 uppercase tracking-wider shrink-0",children:[n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," warm"]})]}),n.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2 mt-0.5",children:[n.jsxs("span",{children:["Größe: ",hn(T.size_bytes)]}),n.jsx("span",{children:"•"}),n.jsxs("span",{children:["Kontext: ",Wd(T.ctx)]}),n.jsx("span",{children:"•"}),n.jsx("span",{className:"font-mono text-[9px]",children:T.quant||"GGUF"})]})]})]}),n.jsxs("div",{className:"flex items-center gap-3 shrink-0 self-end sm:self-auto",children:[n.jsx("div",{className:"hidden lg:flex flex-wrap gap-1",children:n.jsx(Vd,{caps:T.capabilities})}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("button",{onClick:()=>de?H(T.name):Se(T.name),className:oe("h-7 px-3 rounded-lg text-[9px] font-bold uppercase transition-all cursor-pointer border flex items-center gap-1",de?"border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/15 text-amber-400":"border-primary/30 bg-primary/5 hover:bg-primary/15 text-primary"),children:de?"Entladen":"Laden"}),n.jsx("button",{onClick:()=>k(T.name,T.ctx),className:"h-7 px-2.5 rounded-lg border border-border/40 text-[9px] font-bold uppercase hover:bg-accent text-muted-foreground transition-all cursor-pointer",title:"Kontextlänge anpassen",children:"Ctx"}),n.jsx("button",{onClick:()=>x(T.name),className:"h-7 w-7 rounded-lg flex items-center justify-center border border-border/40 text-muted-foreground hover:text-red-400 hover:bg-red-500/5 transition-all cursor-pointer",title:"Modell löschen",children:n.jsx(ai,{className:"h-3.5 w-3.5"})})]})]})]},T.name)})})]})]})}function v0(){const[s,u]=h.useState(""),[a,c]=h.useState([]),[f,m]=h.useState("Q4_K_M"),[p,g]=h.useState(""),[N,E]=h.useState(""),[j,S]=h.useState([]);async function O(b){const P=b??s;if(P.trim()){g("Analysiere HuggingFace Repository...");try{const D=await ie(`/api/hf/quants?repo=${encodeURIComponent(P)}`);u(D.repo),c(D.quants),D.quants.length&&m(D.quants.includes("Q4_K_M")?"Q4_K_M":D.quants[0]),g(D.quants.length?"":"Keine GGUF-Dateien in diesem Repository gefunden.")}catch(D){g(`Fehler: ${D}`)}}}async function z(){if(N.trim()){g("Durchsuche HuggingFace...");try{const b=await ie(`/api/hf/search?q=${encodeURIComponent(N)}`);S(b.results),g(b.results.length?"":"Keine Ergebnisse gefunden.")}catch(b){g(`Suche fehlgeschlagen: ${b}`)}}}async function L(){if(s.trim()){g("Download-Job wird initiiert...");try{await ie("/api/models/install",{method:"POST",body:JSON.stringify({repo:s,quant:f,jinja:!0})}),g(`Download gestartet: ${s} (${f}). Fortschritt wird oben angezeigt.`)}catch(b){g(`Download-Fehler: ${b}`)}}}return n.jsxs("div",{className:"space-y-4 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10",children:[n.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"HF Download & Suche"}),n.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[n.jsx("input",{value:s,onChange:b=>u(b.target.value),placeholder:"HF-URL oder org/repo (z.B. unsloth/Qwen2.5-Coder-7B-Instruct-GGUF)",className:"flex-1 h-9 rounded-lg border border-border/60 bg-background/40 px-3 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>O(),className:"h-9 px-4 rounded-lg border border-border/60 bg-background/20 text-xs font-semibold hover:border-primary/50 hover:bg-background/40 transition-all cursor-pointer whitespace-nowrap",children:"Quants laden"}),a.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("select",{value:f,onChange:b=>m(b.target.value),className:"h-9 rounded-lg border border-border/60 bg-background/40 px-3 text-xs outline-none text-foreground font-semibold",children:a.map(b=>n.jsx("option",{value:b,className:"bg-popover text-foreground",children:b},b))}),n.jsxs("button",{onClick:L,className:"h-9 px-4 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all cursor-pointer flex items-center gap-1.5",children:[n.jsx(bn,{className:"h-3.5 w-3.5"})," Herunterladen"]})]})]})]}),n.jsxs("div",{className:"flex gap-2 border-t border-border/20 pt-4",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx("input",{value:N,onChange:b=>E(b.target.value),onKeyDown:b=>b.key==="Enter"&&z(),placeholder:"HuggingFace durchsuchen (z.B. Llama-3.1)...",className:"w-full h-9 pl-9 pr-3 rounded-lg border border-border/60 bg-background/40 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"}),n.jsx(xi,{className:"absolute left-3 top-2.5 h-3.5 w-3.5 text-muted-foreground"})]}),n.jsx("button",{onClick:z,className:"h-9 px-4 rounded-lg border border-border/60 bg-background/20 text-xs font-semibold hover:border-primary/50 hover:bg-background/40 transition-all cursor-pointer",children:"Suchen"})]}),j.length>0&&n.jsx("div",{className:"max-h-48 space-y-1.5 overflow-y-auto border border-border/40 bg-background/20 p-2 rounded-xl scrollbar-thin",children:j.map(b=>n.jsxs("button",{onClick:()=>{u(b.repo),S([]),E(""),O(b.repo)},className:"flex w-full items-center justify-between rounded-lg px-3 py-2 text-left text-xs bg-background/10 border border-border/10 hover:border-primary/30 hover:bg-background/30 transition-all",children:[n.jsx("span",{className:"font-semibold truncate",children:b.repo}),n.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground flex items-center gap-1 shrink-0",children:[n.jsx(bn,{className:"h-3 w-3"})," ",b.downloads.toLocaleString()]})]},b.repo))}),p&&n.jsx("div",{className:"text-[10px] font-medium text-primary font-mono",children:p})]})}const y0={vision:{title:"Bilder & Vision",desc:"Verarbeitet Bilder, Screenshots und visuelle Diagramme in multimodalen Chats.",icon:dh},coder:{title:"Coden & Entwicklung",desc:"Autovervollständigung, Refactoring und Codegenerierung direkt in deiner IDE.",icon:Jd},reasoning:{title:"Logik & Nachdenken",desc:"Komplexe logische Gedankengänge, Mathematik und tiefgründiges Planen (Reasoning).",icon:qs},agent:{title:"Autonomer Agent (Hermes)",desc:"Führt selbstständig Terminalbefehle aus und interagiert mit deinem Homelab.",icon:go},scout:{title:"Allrounder & Chat",desc:"Schnelle Antworten, Zusammenfassungen, Übersetzungen und alltägliche Fragen.",icon:uh}};function b0(){const[s,u]=h.useState(null),[a,c]=h.useState([]),[f,m]=h.useState(null),[p,g]=h.useState(""),[N,E]=h.useState(!0),[j,S]=h.useState({}),[O,z]=h.useState({}),[L,b]=h.useState(!1);h.useEffect(()=>{Promise.all([ie("/api/discover"),ie("/api/models"),ie("/api/maintenance/updates").catch(()=>null)]).then(([D,M,B])=>{u(D),c(M.models||[]),B&&m(B)}).catch(D=>g(String(D))).finally(()=>E(!1))},[]);async function P(D,M,B,G){S(Q=>({...Q,[D]:"Starte..."}));try{await ie("/api/models/install",{method:"POST",body:JSON.stringify({repo:D,role:M,quant:B,jinja:G})}),S(Q=>({...Q,[D]:"Download läuft"}))}catch{S(K=>({...K,[D]:"Fehler"}))}}return N?n.jsx("div",{className:"text-xs text-muted-foreground py-12 text-center",children:"Analysiere Hardware und suche passende GGUF-Empfehlungen…"}):p||!s?n.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Empfehlungsdienst temporär nicht erreichbar (",p,")."]}):n.jsxs("div",{className:"space-y-8",children:[n.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground bg-background/25 border border-border/40 p-4 rounded-xl flex flex-col sm:flex-row sm:items-center justify-between gap-3 shadow-sm",children:[n.jsxs("div",{children:["Modell-Registry geladen für ",n.jsxs("span",{className:"text-foreground font-bold",children:[s.sys_ram_gb," GB"]})," System-RAM."]}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(nf,{className:"h-3.5 w-3.5 text-primary fill-primary/20"}),n.jsx("span",{children:"Empfehlungen sind automatisch auf deine Box-Hardware optimiert."})]})]}),n.jsx("div",{className:"grid gap-6 md:grid-cols-2",children:s.categories.map(D=>{const M=y0[D.role]||{title:D.title||D.role,desc:"Spezifisches Modell für diese Systemrolle.",icon:Ks},B=M.icon,G=a.find(A=>A.role===D.role),Q=f==null?void 0:f.model_list.find(A=>A.role===D.role),K=D.models.find(A=>A.repo===D.recommended)||D.models[0];if(!K)return null;const le=j[K.repo],we=D.models.filter(A=>A.repo!==D.recommended),fe=!!O[D.role];return n.jsxs("div",{className:oe("rounded-2xl border bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-5 transition-all duration-300 hover:border-primary/40",G?"border-border/60":"border-primary/20 shadow-primary/5"),children:[n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 border border-primary/20 flex items-center justify-center text-primary shadow-sm shrink-0",children:n.jsx(B,{className:"h-5.5 w-5.5"})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-sm font-bold tracking-tight text-foreground",children:M.title}),n.jsxs("span",{className:"text-[9px] font-mono text-muted-foreground uppercase bg-background/50 px-1.5 py-0.5 rounded border border-border/30 inline-block mt-0.5",children:["Rolle: ",D.role]})]})]}),G?n.jsxs("span",{className:"flex items-center gap-1.5 text-[9px] font-bold text-emerald-400 uppercase tracking-wider bg-emerald-500/10 border border-emerald-500/20 px-2.5 py-1 rounded-lg",children:[n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"}),"Aktiviert"]}):n.jsx("span",{className:"text-[9px] font-bold text-primary/70 uppercase tracking-wider bg-primary/10 border border-primary/20 px-2.5 py-1 rounded-lg",children:"Frei"})]}),n.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:M.desc}),n.jsx("div",{className:"p-3.5 rounded-xl bg-background/35 border border-border/30 space-y-2.5",children:G?n.jsxs("div",{className:"space-y-1.5",children:[n.jsx("div",{className:"text-[9px] font-bold uppercase tracking-wider text-muted-foreground/60",children:"Aktive GGUF-Belegung"}),n.jsx("div",{className:"text-xs font-mono font-bold text-foreground truncate",title:G.name,children:G.name.split("/").pop()}),n.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2",children:[n.jsxs("span",{children:["Größe: ",mi(G.size_bytes||0)]}),n.jsx("span",{children:"•"}),n.jsxs("span",{children:["Quant: ",G.quant||"GGUF"]})]})]}):n.jsxs("div",{className:"space-y-1.5",children:[n.jsx("div",{className:"text-[9px] font-bold uppercase tracking-wider text-primary/80",children:"Empfohlenes Modell"}),n.jsx("div",{className:"text-xs font-mono font-bold text-foreground truncate",title:K.name,children:K.name}),n.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2 flex-wrap",children:[n.jsxs("span",{children:["Ersteller: ",K.author]}),n.jsx("span",{children:"•"}),n.jsxs("span",{children:["Quant: ",K.quant]})]}),n.jsx("div",{className:"flex items-center gap-1.5 pt-0.5",children:n.jsx(h0,{fit:K.fit})})]})}),n.jsx("div",{className:"pt-1",children:G?Q?n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"text-[9px] font-semibold text-amber-400 flex items-center gap-1.5",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-ping shrink-0"}),n.jsxs("span",{children:["Bessere Version in der Registry: ",Q.repo.split("/").pop()]})]}),n.jsxs("button",{onClick:()=>P(Q.repo,D.role,K.quant||"Q4_K_M",K.caps.tools!=="no"),disabled:!!j[Q.repo],className:"h-8 w-full flex items-center justify-center gap-1.5 rounded-lg bg-amber-500 text-black text-xs font-bold hover:bg-amber-400 disabled:opacity-50 transition-all cursor-pointer shadow-md shadow-amber-500/10",children:[n.jsx(bn,{className:"h-3.5 w-3.5"}),j[Q.repo]||"Auf neue Version aktualisieren"]})]}):n.jsxs("div",{className:"h-8 flex items-center justify-center gap-1.5 text-[10px] font-bold text-emerald-400 uppercase tracking-wide bg-emerald-500/5 border border-emerald-500/10 rounded-lg select-none",children:[n.jsx(Hs,{className:"h-4 w-4"})," Auf neuestem Stand"]}):n.jsxs("button",{onClick:()=>P(K.repo,D.role,K.quant||"Q4_K_M",K.caps.tools!=="no"),disabled:!!le,className:oe("h-8 w-full flex items-center justify-center gap-1.5 rounded-lg text-xs font-bold transition-all cursor-pointer border",le?"border-primary/40 bg-primary/5 text-primary":"bg-primary text-primary-foreground hover:opacity-90 shadow-md shadow-primary/10"),children:[n.jsx(bn,{className:"h-3.5 w-3.5"}),le||"Optimales Modell einsetzen"]})})]}),we.length>0&&n.jsxs("div",{className:"border-t border-border/20 pt-3",children:[n.jsxs("button",{onClick:()=>z(A=>({...A,[D.role]:!fe})),className:"flex items-center gap-1.5 text-[10px] text-muted-foreground/80 hover:text-foreground transition-colors cursor-pointer",children:[fe?n.jsx(sh,{className:"h-3 w-3"}):n.jsx(rh,{className:"h-3 w-3"}),n.jsxs("span",{children:["Alternative Empfehlungen anzeigen (",we.length,")"]})]}),fe&&n.jsx("div",{className:"mt-2.5 space-y-2 max-h-36 overflow-y-auto pr-1 scrollbar-thin",children:we.map(A=>n.jsxs("div",{className:"p-2 rounded-lg bg-background/25 border border-border/20 flex items-center justify-between gap-3",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"text-[10px] font-mono font-bold text-foreground truncate",title:A.name,children:A.name}),n.jsxs("div",{className:"text-[9px] text-muted-foreground flex items-center gap-1.5 mt-0.5",children:[n.jsxs("span",{children:["Quant: ",A.quant]}),n.jsx("span",{children:"•"}),n.jsx("span",{children:A.fit.text})]})]}),n.jsx("button",{onClick:()=>P(A.repo,D.role,A.quant||"Q4_K_M",A.caps.tools!=="no"),disabled:!!j[A.repo],className:"h-6 px-2.5 rounded bg-background/40 hover:bg-background/80 border border-border/40 text-[9px] font-bold text-foreground transition-all cursor-pointer shrink-0 disabled:opacity-50",children:j[A.repo]||"Installieren"})]},A.repo))})]})]},D.role)})}),n.jsxs("div",{className:"border border-border/50 bg-card/20 rounded-2xl overflow-hidden shadow-md mt-4",children:[n.jsxs("button",{onClick:()=>b(!L),className:"w-full px-5 py-4 flex items-center justify-between text-xs font-bold uppercase tracking-wider text-muted-foreground hover:bg-card/30 transition-colors cursor-pointer",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(xi,{className:"h-4 w-4 text-primary"}),n.jsx("span",{children:"Eigenes Modell von Hugging Face laden (Erweiterte Ansicht)"})]}),n.jsx("span",{className:"text-[10px] text-primary hover:underline",children:L?"Ausblenden ▲":"Anzeigen ▼"})]}),L&&n.jsx("div",{className:"p-5 border-t border-border/20 bg-card/10",children:n.jsx(v0,{})})]})]})}function w0(){const[s,u]=h.useState("cockpit");return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Modell-Zentrale"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Verwalte deine Modelle und passe das Gateway-Routing live über das interaktive Cockpit an."})]}),n.jsx("div",{className:"flex rounded-xl border border-border/60 bg-card/45 backdrop-blur-md p-1 self-start",children:["cockpit","discover"].map(a=>n.jsx("button",{onClick:()=>u(a),className:oe("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",s===a?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:a==="cockpit"?"Cockpit":"Modelle finden"},a))})]}),n.jsx(m0,{}),n.jsx("div",{className:"transition-all duration-300",children:s==="cockpit"?n.jsx(x0,{}):n.jsx(b0,{})})]})}function hr(s){return(s/1024**3).toFixed(1)}function $s({label:s,percent:u,detail:a,icon:c}){const f=u>90?"bg-red-500 shadow-md shadow-red-500/20":u>75?"bg-amber-500 shadow-md shadow-amber-500/20":"bg-primary shadow-md shadow-primary/20";return n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-3 hover:border-primary/30 transition-all duration-300",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(c,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-foreground",children:s})]}),n.jsxs("span",{className:"text-xs font-mono font-bold text-foreground",children:[Math.round(u),"%"]})]}),n.jsx("div",{className:"w-full h-2 bg-background/40 rounded-full overflow-hidden border border-border/20",children:n.jsx("div",{className:oe("h-full transition-all duration-700 ease-out",f),style:{width:`${Math.min(u,100)}%`}})}),a&&n.jsx("div",{className:"text-[10px] font-mono text-muted-foreground/80",children:a})]})}function k0(){const[s,u]=h.useState(null),[a,c]=h.useState(null),[f,m]=h.useState(""),[p,g]=h.useState(""),[N,E]=h.useState({});function j(){ie("/api/system/status").then(u).catch(z=>m(String(z))),ie("/api/system/services").then(c).catch(()=>{})}h.useEffect(()=>{j();const z=setInterval(j,3e3);return()=>clearInterval(z)},[]);async function S(){g("Backup snapshotted...");try{const z=await ie("/api/system/backup",{method:"POST"});g(z.ok?`Snapshot erzeugt: ${z.snapshot} (${z.files.length} Dateien)`:"Keine Änderungen zu sichern.")}catch(z){g(`Fehler: ${z.message}`)}}async function O(z){E(L=>({...L,[z]:!0}));try{const L=await ie("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:z})});L.ok?alert(`Dienst ${z} wurde erfolgreich neu gestartet.`):alert(`Fehler beim Neustart: ${L.err||"Unbekannter Fehler"}`)}catch(L){alert(`Fehler: ${L.message}`)}finally{E(L=>({...L,[z]:!1}))}}return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"System-Diagnose & Status"}),n.jsx("p",{className:"text-sm text-muted-foreground flex items-center gap-1",children:"Echtzeit-Ressourcen der Box, Dienst-Überwachung und Systempflege."})]}),f&&n.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400 font-mono",children:["System-Status nicht lesbar (",f,")."]}),s&&n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[n.jsx($s,{label:"CPU",percent:s.cpu.percent,detail:s.cpu.cores?`${s.cpu.cores} Cores`:void 0,icon:vr}),n.jsx($s,{label:"RAM",percent:s.ram.percent,detail:`${hr(s.ram.used)} / ${hr(s.ram.total)} GB`,icon:Ws}),s.gpu&&s.gpu.busy_percent!=null&&n.jsx($s,{label:"GPU",percent:s.gpu.busy_percent,detail:s.gpu.gtt_used!=null&&s.gpu.gtt_total?`${hr(s.gpu.gtt_used)} / ${hr(s.gpu.gtt_total)} GB (GTT/unified)`:s.gpu.vram_used!=null&&s.gpu.vram_total?`${hr(s.gpu.vram_used)} / ${hr(s.gpu.vram_total)} GB VRAM`:void 0,icon:vr}),s.disk&&n.jsx($s,{label:"Disk",percent:s.disk.percent,detail:`${hr(s.disk.used)} / ${hr(s.disk.total)} GB`,icon:li})]}),s.temp&&(s.temp.cpu||s.temp.gpu)&&n.jsxs("div",{className:"flex gap-3 text-[10px] font-mono text-muted-foreground bg-background/25 border border-border/40 p-2.5 rounded-xl self-start w-fit",children:[s.temp.cpu!=null&&n.jsxs("span",{className:"flex items-center gap-1",children:["CPU-Temperatur: ",n.jsxs("span",{className:"text-foreground font-bold",children:[s.temp.cpu," °C"]})]}),s.temp.cpu!=null&&s.temp.gpu!=null&&n.jsx("span",{children:"|"}),s.temp.gpu!=null&&n.jsxs("span",{className:"flex items-center gap-1",children:["GPU-Temperatur: ",n.jsxs("span",{className:"text-foreground font-bold",children:[s.temp.gpu," °C"]})]})]})]}),a&&n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Homelab-Dienste"}),n.jsx("button",{onClick:()=>window.dispatchEvent(new CustomEvent("open-system-drawer",{detail:{tab:"logs"}})),className:"h-7 px-3 rounded-lg border border-border/60 bg-background/25 text-[10px] font-bold uppercase hover:bg-accent text-muted-foreground transition-all cursor-pointer",children:"System-Logs anzeigen"})]}),n.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:a.services.map(z=>n.jsxs("div",{className:"flex items-center justify-between p-3.5 rounded-xl bg-background/20 border border-border/30 hover:border-primary/20 transition-all group",children:[n.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[n.jsx("span",{className:oe("h-2.5 w-2.5 rounded-full ring-2 ring-black/40",z.ok?"bg-emerald-500":"bg-amber-500")}),n.jsxs("div",{className:"truncate",children:[n.jsx("div",{className:"text-xs font-bold text-foreground truncate",children:z.name}),n.jsx("div",{className:"text-[9px] text-muted-foreground/60 font-mono mt-0.5 truncate",children:z.url})]})]}),n.jsx("button",{onClick:()=>O(z.name),disabled:N[z.name],className:"h-7 w-7 rounded-lg border border-border/40 text-muted-foreground hover:text-primary hover:bg-primary/5 flex items-center justify-center transition-all opacity-0 group-hover:opacity-100",title:"Dienst neu starten",children:n.jsx(wn,{className:oe("h-3.5 w-3.5",N[z.name]&&"animate-spin")})})]},z.name))}),n.jsxs("div",{className:"flex flex-wrap gap-4 border-t border-border/20 pt-4 text-[10px] font-semibold text-muted-foreground",children:[n.jsxs("a",{href:bo(a.links.engine_ui),target:"_blank",rel:"noopener",className:"flex items-center gap-1 text-primary hover:text-primary-foreground hover:bg-primary/10 px-2 py-1 rounded transition-colors",children:[n.jsx(Gs,{className:"h-3 w-3"})," Engine Dashboard (llama-swap)"]}),n.jsxs("a",{href:bo(a.links.gateway),target:"_blank",rel:"noopener",className:"flex items-center gap-1 text-primary hover:text-primary-foreground hover:bg-primary/10 px-2 py-1 rounded transition-colors",children:[n.jsx(Gs,{className:"h-3 w-3"})," OpenAI Gateway"]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"System-Backup & Snapshot"}),n.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Erzeuge einen Git-Snapshot der aktuellen Konfigurationen und des System-Zustands."})]}),n.jsx("div",{className:"flex items-center gap-3 self-start sm:self-auto shrink-0",children:n.jsxs("button",{onClick:S,className:"h-9 px-4 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all flex items-center gap-1.5 cursor-pointer shadow-md shadow-primary/10",children:[n.jsx(vh,{className:"h-4 w-4"})," Snapshot erstellen"]})})]}),p&&n.jsx("div",{className:"text-[10px] font-mono text-primary font-medium bg-primary/5 p-3 rounded-xl border border-primary/20",children:p})]})}function j0(){const[s,u]=h.useState(localStorage.getItem("mc_host")||"192.168.178.151"),[a,c]=h.useState(localStorage.getItem("mc_mcp_path")||""),[f,m]=h.useState(null),[p,g]=h.useState("cline"),[N,E]=h.useState(!1),[j,S]=h.useState("");h.useEffect(()=>{const P=new URLSearchParams;P.set("host",s),a&&P.set("mcp_path",a),ie(`/api/connect?${P}`).then(m).catch(D=>S(String(D)))},[s,a]);function O(P){u(P),P&&localStorage.setItem("mc_host",P)}function z(P){c(P),localStorage.setItem("mc_mcp_path",P)}const L=f==null?void 0:f.tools[p];async function b(){L&&(await navigator.clipboard.writeText(L.snippet),E(!0),setTimeout(()=>E(!1),1500))}return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Verbindung & Integration"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Kopiere vorgefertigte Konfigurationsdateien für deinen lokalen PC (IDEs, Cline, Roo Code, Cursor), um direkt auf das geteilte Gedächtnis und den Auto-Swap-Gateway der Box zuzugreifen."})]}),n.jsxs("div",{className:"grid gap-4 md:grid-cols-2 p-5 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md shadow-lg shadow-black/10",children:[n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5",children:[n.jsx(ph,{className:"h-3.5 w-3.5 text-primary"})," Box LAN IP-Adresse"]}),n.jsx("input",{value:s,onChange:P=>O(P.target.value),placeholder:"z.B. 192.168.178.151",className:"w-full h-9 rounded-lg border border-border/60 bg-background/40 px-3 font-mono text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"})]}),n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5",children:[n.jsx(fh,{className:"h-3.5 w-3.5 text-primary"})," Lokaler MCP-Scriptpfad"]}),n.jsx("input",{value:a,onChange:P=>z(P.target.value),placeholder:"z.B. F:\\Coding Stuff\\mission-control-2\\mcp\\mcp_memory.py",className:"w-full h-9 rounded-lg border border-border/60 bg-background/40 px-3 font-mono text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"})]})]}),j&&n.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Fehler beim Generieren der Snippets: ",j]}),f&&n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:"flex flex-wrap gap-1 bg-card/20 p-1 border border-border/40 rounded-xl max-w-fit",children:Object.entries(f.tools).map(([P,D])=>n.jsx("button",{onClick:()=>g(P),className:oe("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",p===P?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:D.label},P))}),L&&n.jsxs("div",{className:"space-y-3",children:[L.note&&n.jsxs("div",{className:"flex items-start gap-2.5 p-3 rounded-xl bg-primary/5 border border-primary/20 text-xs text-muted-foreground leading-relaxed",children:[n.jsx(mh,{className:"h-4.5 w-4.5 text-primary shrink-0 mt-0.5"}),n.jsx("span",{children:L.note})]}),n.jsxs("div",{className:"flex flex-col border border-border/60 bg-black/60 rounded-2xl overflow-hidden shadow-2xl",children:[n.jsxs("div",{className:"flex h-11 items-center justify-between px-4 border-b border-border/40 bg-black/40 shrink-0",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"h-3 w-3 rounded-full bg-red-500/80 shadow-md shadow-red-500/10"}),n.jsx("span",{className:"h-3 w-3 rounded-full bg-amber-500/80 shadow-md shadow-amber-500/10"}),n.jsx("span",{className:"h-3 w-3 rounded-full bg-emerald-500/80 shadow-md shadow-emerald-500/10"})]}),n.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-mono text-muted-foreground/75 bg-background/30 px-3 py-1 rounded-md border border-border/20",children:[n.jsx(vi,{className:"h-3.5 w-3.5 text-primary"}),n.jsx("span",{children:p==="cline"||p==="cursor"?"config.json":"settings.json"})]}),n.jsxs("button",{onClick:b,className:"flex h-7 px-2.5 items-center gap-1.5 rounded-lg border border-border/40 bg-background/30 text-[10px] font-semibold text-muted-foreground hover:text-foreground hover:bg-background/60 transition-all cursor-pointer",children:[N?n.jsx(Hs,{className:"h-3.5 w-3.5 text-emerald-400"}):n.jsx(ef,{className:"h-3.5 w-3.5"}),n.jsx("span",{children:N?"Kopiert":"Kopieren"})]})]}),n.jsx("pre",{className:"p-5 overflow-x-auto text-xs font-mono text-cyan-200/90 whitespace-pre leading-relaxed scrollbar-thin select-text bg-black/10",children:n.jsx("code",{children:L.snippet})})]})]})]})]})}const Gd=["user","instruction","stable","versioned","ephemeral"],oi={user:{label:"User",icon:Nh,color:"text-cyan-400",border:"border-cyan-500/30",bg:"bg-cyan-500/10",text:"text-cyan-400"},instruction:{label:"Regel",icon:yh,color:"text-violet-400",border:"border-violet-500/30",bg:"bg-violet-500/10",text:"text-violet-400"},stable:{label:"Fakt",icon:xo,color:"text-indigo-400",border:"border-indigo-500/30",bg:"bg-indigo-500/10",text:"text-indigo-400"},versioned:{label:"Version",icon:jh,color:"text-amber-400",border:"border-amber-500/30",bg:"bg-amber-500/10",text:"text-amber-400"},ephemeral:{label:"Temporär",icon:ah,color:"text-pink-400",border:"border-pink-500/30",bg:"bg-pink-500/10",text:"text-pink-400"}},Kd={label:"Gedächtnis",icon:Xd,bg:"bg-muted/10",text:"text-muted-foreground"},N0={user:"border-l-cyan-500/80",instruction:"border-l-violet-500/80",stable:"border-l-indigo-500/80",versioned:"border-l-amber-500/80",ephemeral:"border-l-pink-500/80"};function S0(){const[s,u]=h.useState([]),[a,c]=h.useState(""),[f,m]=h.useState(""),[p,g]=h.useState(""),[N,E]=h.useState("stable"),[j,S]=h.useState(""),[O,z]=h.useState(!1);function L(){const M=new URLSearchParams;f&&M.set("q",f),a&&M.set("category",a),ie(`/api/memory?${M}`).then(u).catch(B=>S(String(B)))}h.useEffect(L,[f,a]);async function b(){p.trim()&&(await ie("/api/memory",{method:"POST",body:JSON.stringify({content:p,category:N,source:"ui"})}),g(""),L())}async function P(M){await ie(`/api/memory/${M}`,{method:"DELETE"}),L()}async function D(){z(!0);try{const M=await ie("/api/memory/dedupe",{method:"POST",body:JSON.stringify({apply:!1})});if(M.duplicate_count===0){alert("Keine Dubletten gefunden — alles sauber.");return}confirm(`${M.duplicate_count} Dublette(n) in ${M.groups.length} Gruppe(n) gefunden. Entfernen?`)&&(await ie("/api/memory/dedupe",{method:"POST",body:JSON.stringify({apply:!0})}),L())}catch(M){alert(`Fehler: ${M.message}`)}finally{z(!1)}}return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Gedächtnis-Pool (Memory)"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Die geteilte Konstitution des Systems. Alle Instanzen (Hermes, IDEs, Gateway) lesen und schreiben hierauf per MCP-Protokoll."})]}),n.jsxs("button",{onClick:D,disabled:O,className:"flex h-9 px-4 items-center gap-1.5 text-xs font-semibold rounded-lg border border-border/60 bg-card hover:border-primary/50 transition-all cursor-pointer shadow-md disabled:opacity-50 shrink-0 self-start",children:[n.jsx(kh,{className:"h-4 w-4 text-primary animate-pulse"}),n.jsx("span",{children:"Deduplizieren"})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-4",children:[n.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Neuen Eintrag anlegen"}),n.jsx("textarea",{value:p,onChange:M=>g(M.target.value),placeholder:"Füge eine neue Regel, eine Vorliebe oder einen stabilen Fakt über das Projekt oder dich hinzu...",rows:3,className:"w-full resize-none rounded-xl border border-border/60 bg-background/30 p-3.5 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground transition-all leading-relaxed"}),n.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wider",children:"Kategorie"}),n.jsx("select",{value:N,onChange:M=>E(M.target.value),className:"h-8 rounded-lg border border-border/60 bg-background/50 px-2 py-1 text-xs outline-none font-semibold text-foreground cursor-pointer",children:Gd.map(M=>{var B;return n.jsx("option",{value:M,className:"bg-popover text-foreground",children:((B=oi[M])==null?void 0:B.label)||M},M)})})]}),n.jsxs("button",{onClick:b,className:"h-9 px-4 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all flex items-center gap-1.5 cursor-pointer shadow-md shadow-primary/10",children:[n.jsx(tf,{className:"h-4 w-4"})," Speichern"]})]})]}),n.jsxs("div",{className:"flex flex-col md:flex-row items-stretch md:items-center gap-3",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx("input",{value:f,onChange:M=>m(M.target.value),placeholder:"Gedächtnis durchsuchen...",className:"w-full h-9 pl-9 pr-3 rounded-lg border border-border/60 bg-card/45 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"}),n.jsx(xi,{className:"absolute left-3 top-2.5 h-3.5 w-3.5 text-muted-foreground"})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 p-1 bg-card/30 border border-border/40 rounded-xl overflow-x-auto max-w-full",children:[n.jsx("button",{onClick:()=>c(""),className:oe("h-7 px-3 rounded-lg text-[10px] font-semibold uppercase tracking-wider transition-all cursor-pointer whitespace-nowrap",a?"text-muted-foreground hover:text-foreground":"bg-primary text-primary-foreground"),children:"Alle"}),Gd.map(M=>{const B=oi[M]||Kd,G=B.icon;return n.jsxs("button",{onClick:()=>c(M),className:oe("h-7 px-2.5 rounded-lg text-[10px] font-semibold uppercase tracking-wider transition-all cursor-pointer flex items-center gap-1 whitespace-nowrap",a===M?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:[n.jsx(G,{className:"h-3 w-3"}),n.jsx("span",{children:B.label})]},M)})]})]}),j&&n.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Fehler beim Laden des Gedächtnisses: ",j]}),n.jsx("div",{className:"space-y-3",children:s.length===0?n.jsx("div",{className:"text-xs text-muted-foreground border border-dashed border-border/60 rounded-2xl p-12 text-center",children:"Keine Einträge für die aktuellen Filterkriterien gefunden."}):s.map(M=>{const B=oi[M.category]||Kd,G=B.icon;return n.jsxs("div",{className:oe("flex items-start justify-between gap-4 p-4 rounded-xl border border-l-4 bg-card/45 backdrop-blur-md border-border/60 shadow-md shadow-black/5 hover:border-primary/20 transition-all group",N0[M.category]||"border-l-muted"),children:[n.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[n.jsxs("span",{className:oe("flex items-center gap-1 px-2 py-0.5 rounded text-[9px] font-bold uppercase tracking-wider font-mono shrink-0",B.bg,B.text),children:[n.jsx(G,{className:"h-3 w-3"}),n.jsx("span",{className:"hidden sm:inline",children:B.label})]}),n.jsx("span",{className:"text-xs text-foreground leading-relaxed break-words whitespace-pre-wrap flex-1",children:M.content})]}),n.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[n.jsx("span",{className:"text-[9px] font-mono text-muted-foreground/60 bg-background/20 px-1.5 py-0.5 rounded uppercase tracking-wider",children:M.source}),n.jsx("button",{onClick:()=>P(M.id),className:"h-7 w-7 rounded-lg flex items-center justify-center border border-border/40 text-muted-foreground hover:text-red-400 hover:bg-red-500/5 transition-all opacity-0 group-hover:opacity-100",title:"Eintrag löschen",children:n.jsx(ai,{className:"h-3.5 w-3.5"})})]})]},M.id)})})]})}function Us({label:s,ok:u,detail:a,icon:c}){return n.jsxs("div",{className:oe("rounded-2xl border bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-3 hover:border-primary/40 transition-all duration-300",u?"border-border/60":"border-amber-500/30"),children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:s}),n.jsx(c,{className:oe("h-4.5 w-4.5",u?"text-primary":"text-amber-500")})]}),n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:oe("h-2 w-2 rounded-full ring-2 ring-black/40",u?"bg-emerald-500 animate-pulse":"bg-amber-500")}),n.jsx("span",{className:"text-xs font-semibold text-foreground",children:u?"Bereit / Online":"Offline / Inaktiv"})]}),a&&n.jsx("div",{className:"text-[10px] font-mono text-muted-foreground truncate max-w-[200px]",title:a,children:a})]})]})}function C0(){const[s,u]=h.useState(null),[a,c]=h.useState(""),[f,m]=h.useState(null),[p,g]=h.useState({width:800,height:360}),N=h.useRef(null),E=h.useCallback(L=>{if(N.current&&(N.current.disconnect(),N.current=null),L){const b=new ResizeObserver(P=>{if(!P||P.length===0)return;const D=P[0].contentRect;g({width:D.width,height:D.height})});b.observe(L),N.current=b}},[]),j=p.width,S=p.height,O=(L,b,P,D)=>{const M=(L+P)/2;return`M ${L} ${b} C ${M} ${b}, ${M} ${D}, ${P} ${D}`};function z(){ie("/api/agent/status").then(u).catch(L=>c(String(L)))}return h.useEffect(()=>{z();const L=setInterval(z,5e3);return()=>clearInterval(L)},[]),n.jsxs("div",{className:"space-y-6",children:[n.jsx("style",{children:` + `}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-3.5",children:[n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(li,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"VRAM / Memory Belegung"})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground",children:["Llama Swap VRAM-Pool: ",hn(X)," / ",hn(he)," geladen"]}),a.length>0&&n.jsx("button",{onClick:te,className:"h-6 px-2.5 rounded border border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/10 text-amber-400 text-[9px] font-bold uppercase transition-all cursor-pointer",children:"Alle entladen"})]})]}),n.jsx("div",{className:"h-7 w-full rounded-xl bg-background/50 border border-border/40 overflow-hidden flex p-0.5 relative group",children:V.length===0?n.jsx("div",{className:"w-full h-full flex items-center justify-center text-[10px] text-muted-foreground/60 italic font-mono select-none",children:"VRAM Leer — Auto-Swap lädt Modelle bei Anfrage"}):V.map((T,de)=>{var Ae;const be=(T.size_bytes||0)/he*100,Pe=["from-teal-500 to-emerald-500","from-indigo-500 to-blue-500","from-purple-500 to-pink-500","from-cyan-500 to-sky-500"][de%4];return n.jsxs("div",{style:{width:`${be}%`},className:oe("h-full rounded bg-gradient-to-r flex items-center justify-between px-2.5 transition-all text-white/95 shrink-0 shadow-inner select-none",Pe),title:`${T.name} (${hn(T.size_bytes)})`,children:[n.jsxs("span",{className:"text-[9px] font-bold truncate max-w-[120px] font-space tracking-wide",children:[T.role?`[${T.role}] `:"",(Ae=T.name.split("/").pop())==null?void 0:Ae.replace(".gguf","")]}),n.jsx("span",{className:"text-[8px] font-mono opacity-80",children:hn(T.size_bytes)})]},T.name)})})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 shadow-lg shadow-black/10 space-y-4",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Interactive Gateway Graph"}),n.jsx("p",{className:"text-[10px] text-muted-foreground mt-0.5 leading-relaxed",children:"Klicke links auf Editoren, um Configs zu kopieren. Klicke rechts auf Rollen, um GGUF-Zuweisungen live zu ändern."})]}),n.jsxs("div",{ref:pe,className:"relative w-full h-[360px] border border-border/30 rounded-xl bg-black/25 overflow-hidden flex",children:[n.jsxs("svg",{className:"absolute inset-0 pointer-events-none w-full h-full",children:[n.jsxs("defs",{children:[n.jsxs("linearGradient",{id:"cyan-to-teal",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[n.jsx("stop",{offset:"0%",stopColor:"#06b6d4",stopOpacity:"0.45"}),n.jsx("stop",{offset:"100%",stopColor:"#0d9488",stopOpacity:"0.45"})]}),n.jsxs("linearGradient",{id:"active-glow",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[n.jsx("stop",{offset:"0%",stopColor:"#3b82f6",stopOpacity:"0.8"}),n.jsx("stop",{offset:"100%",stopColor:"#10b981",stopOpacity:"0.8"})]})]}),n.jsx("path",{d:ye(.1),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(G==="roocode"||L==="roocode")&&n.jsx("path",{d:ye(.1),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:ye(.3),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(G==="cursor"||L==="cursor")&&n.jsx("path",{d:ye(.3),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:ye(.5),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(G==="opencode"||L==="opencode")&&n.jsx("path",{d:ye(.5),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:ye(.7),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(G==="zed"||L==="zed")&&n.jsx("path",{d:ye(.7),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:ye(.9),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(G==="continue"||L==="continue")&&n.jsx("path",{d:ye(.9),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:Ne(.12),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),De("fast")&&n.jsx("path",{d:Ne(.12),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:Ne(.31),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),De("heavy")&&n.jsx("path",{d:Ne(.31),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:Ne(.5),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),De("coder")&&n.jsx("path",{d:Ne(.5),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:Ne(.69),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),De("vision")&&n.jsx("path",{d:Ne(.69),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:Ne(.88),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),De("scout")&&n.jsx("path",{d:Ne(.88),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"10%"},onMouseEnter:()=>Q("roocode"),onMouseLeave:()=>Q(null),onClick:()=>b(T=>T==="roocode"?null:"roocode"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"Roo Code"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"30%"},onMouseEnter:()=>Q("cursor"),onMouseLeave:()=>Q(null),onClick:()=>b(T=>T==="cursor"?null:"cursor"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"Cursor IDE"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"50%"},onMouseEnter:()=>Q("opencode"),onMouseLeave:()=>Q(null),onClick:()=>b(T=>T==="opencode"?null:"opencode"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"OpenCode"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"70%"},onMouseEnter:()=>Q("zed"),onMouseLeave:()=>Q(null),onClick:()=>b(T=>T==="zed"?null:"zed"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"Zed"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"90%"},onMouseEnter:()=>Q("continue"),onMouseLeave:()=>Q(null),onClick:()=>b(T=>T==="continue"?null:"continue"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"Continue"})]}),n.jsxs("div",{className:"absolute select-none z-10 w-36 py-3 px-4 -translate-y-1/2 -translate-x-1/2 rounded-2xl border border-primary/50 bg-card/90 backdrop-blur-md flex flex-col items-center justify-center text-center shadow-lg shadow-primary/5",style:{left:"50%",top:"50%"},children:[n.jsx("div",{className:"text-[10px] uppercase font-bold text-primary font-space tracking-wide",children:"Gateway Auto"}),n.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground mt-0.5",children:["Schwelle: > ",f!=null&&f.heavy_threshold_chars?f.heavy_threshold_chars/1e3:"4","k Zeichen"]}),n.jsx("div",{className:"mt-1 px-1.5 py-0.5 rounded bg-primary/10 border border-primary/20 text-[9px] font-semibold text-primary uppercase font-mono",children:"Auto-Swap"})]}),g0.map(T=>{var ct;const de=["12%","31%","50%","69%","88%"],be=xe(T),Pe=be?a.includes(be.name):!1;if(T==="reasoning"||T==="agent")return null;const Ae={fast:0,heavy:1,coder:2,vision:3,scout:4}[T];return n.jsxs("div",{className:oe("absolute z-10 w-44 py-1.5 px-3 -translate-y-1/2 -translate-x-1/2 rounded-xl border flex flex-col justify-center hover:border-primary/50 transition-all text-left shadow select-none cursor-pointer",Pe?"border-emerald-500/50 bg-emerald-500/5 shadow-emerald-500/5":be?"border-border/60 bg-card/75":"border-dashed border-border/40 bg-background/20"),style:{left:"90%",top:de[Ae]},onClick:()=>D(P===T?null:T),children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:T}),Pe&&n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"})]}),n.jsx("div",{className:"text-[10px] font-mono font-medium truncate mt-0.5 text-foreground max-w-[150px]",children:be?(ct=be.name.split("/").pop())==null?void 0:ct.replace(".gguf",""):"Keine Zuweisung"}),P===T&&n.jsxs("div",{className:"absolute right-0 top-full mt-1 z-35 w-52 rounded-xl border border-border/80 bg-popover/95 backdrop-blur-md p-1.5 shadow-2xl space-y-1",children:[n.jsx("div",{className:"text-[9px] uppercase font-bold text-muted-foreground/60 px-2 py-1 select-none",children:"Modell zuweisen:"}),n.jsx("button",{onClick:()=>Z(T,""),className:"w-full text-left px-2.5 py-1.5 rounded-lg text-[10px] hover:bg-accent text-red-400 font-semibold cursor-pointer",children:"Zuweisung entfernen"}),s.map(dt=>{var At;return n.jsxs("button",{onClick:()=>Z(T,dt.name),className:oe("w-full text-left px-2.5 py-1.5 rounded-lg text-[10px] hover:bg-accent flex items-center justify-between font-mono cursor-pointer",dt.role===T?"text-primary font-bold":"text-foreground"),children:[n.jsx("span",{className:"truncate max-w-[150px]",children:(At=dt.name.split("/").pop())==null?void 0:At.replace(".gguf","")}),dt.role===T&&n.jsx(Hs,{className:"h-3 w-3 shrink-0"})]},dt.name)})]})]},T)}),L&&p&&n.jsxs("div",{className:"absolute z-30 md:w-96 w-[90%] rounded-2xl border border-border/80 bg-card/95 backdrop-blur-xl p-4 shadow-2xl space-y-3 flex flex-col justify-between",style:{left:"22%",top:L==="roocode"?"5%":L==="cursor"?"20%":L==="opencode"?"40%":L==="zed"?"55%":"65%"},children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[n.jsxs("span",{className:"text-[11px] font-bold uppercase tracking-wider text-primary",children:[L==="roocode"&&"Roo Code Setup",L==="cursor"&&"Cursor Setup",L==="opencode"&&"OpenCode Setup",L==="zed"&&"Zed Setup",L==="continue"&&"Continue Setup"]}),n.jsx("button",{onClick:()=>b(null),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:n.jsx(yi,{className:"h-3.5 w-3.5"})})]}),n.jsxs("div",{className:"text-[10px] text-muted-foreground leading-relaxed space-y-2",children:[L==="roocode"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsxs("li",{children:["Suche in VS Code nach der Erweiterung ",n.jsx("strong",{children:"Roo Code"})," und installiere sie."]}),n.jsxs("li",{children:["Wähle in den Roo Code Einstellungen: Provider: ",n.jsx("strong",{children:"OpenAI Compatible"}),"."]}),n.jsxs("li",{children:["Füge das untenstehende JSON-Snippet in die ",n.jsx("code",{children:"settings.json"})," ein."]})]}),L==="cursor"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsxs("li",{children:["Öffne Cursor Settings ➔ ",n.jsx("strong",{children:"Models"}),"."]}),n.jsxs("li",{children:["Deaktiviere Cloud-Modelle, klappe ",n.jsx("strong",{children:"OpenAI API"})," auf."]}),n.jsxs("li",{children:["Trage die Base URL unten ein und aktiviere das Modell ",n.jsx("strong",{children:"auto"}),"."]})]}),L==="opencode"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsxs("li",{children:["Öffne die ",n.jsx("code",{children:"opencode.jsonc"})," Konfigurationsdatei."]}),n.jsxs("li",{children:["Ersetze den Provider-Eintrag unter ",n.jsx("code",{children:"provider"})," mit dem Snippet unten."]})]}),L==="zed"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsxs("li",{children:["Öffne die Zed Settings (",n.jsx("code",{children:"ctrl+,"}),")."]}),n.jsxs("li",{children:["Füge das untenstehende JSON-Segment unter ",n.jsx("code",{children:"language_models"})," ein."]})]}),L==="continue"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsx("li",{children:"Klicke auf das Zahnrad-Symbol in der Continue-Erweiterung."}),n.jsxs("li",{children:["Füge den Gateway-Eintrag zum ",n.jsx("code",{children:"models"}),"-Array hinzu."]})]})]}),p.tools&&n.jsxs("div",{className:"relative rounded-xl border border-border/40 bg-black/40 overflow-hidden mt-1 shrink-0",children:[n.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-border/20 bg-black/20",children:[n.jsx("span",{className:"text-[8px] font-mono text-muted-foreground",children:"JSON Config"}),n.jsxs("button",{onClick:()=>{var T,de,be,Pe,Ae;return q(L==="roocode"?(T=p.tools.cline)==null?void 0:T.snippet:L==="cursor"?(de=p.tools.cursor)==null?void 0:de.snippet:L==="opencode"?(be=p.tools.opencode)==null?void 0:be.snippet:L==="zed"?(Pe=p.tools.zed)==null?void 0:Pe.snippet:(Ae=p.tools.continue)==null?void 0:Ae.snippet)},className:"text-[9px] font-semibold text-primary hover:text-primary-foreground flex items-center gap-1 cursor-pointer",children:[M?n.jsx(Hs,{className:"h-3 w-3 text-emerald-400"}):n.jsx(ef,{className:"h-3 w-3"}),n.jsx("span",{children:M?"Kopiert":"Kopieren"})]})]}),n.jsx("pre",{className:"p-3 max-h-36 overflow-y-auto text-[9px] font-mono text-cyan-200/90 whitespace-pre scrollbar-thin select-text",children:n.jsxs("code",{children:[L==="roocode"&&((br=p.tools.cline)==null?void 0:br.snippet),L==="cursor"&&((Sn=p.tools.cursor)==null?void 0:Sn.snippet),L==="opencode"&&((wr=p.tools.opencode)==null?void 0:wr.snippet),L==="zed"&&((Ir=p.tools.zed)==null?void 0:Ir.snippet),L==="continue"&&((Cn=p.tools.continue)==null?void 0:Cn.snippet)]})})]})]})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-6 mt-3 text-[10px] text-muted-foreground border-t border-border/20 pt-3",children:[n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"h-2 w-2 rounded-full bg-cyan-400"}),n.jsx("span",{children:"Cyan-Fluss: Client-Anfrage an Gateway"})]}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500 animate-pulse"}),n.jsx("span",{children:"Grüner Puls: Aktive Verbindung / Warmes Modell geladen"})]}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"h-2 w-2 rounded bg-gradient-to-r from-teal-500 to-emerald-500"}),n.jsx("span",{children:"VRAM-Verlauf: Modellspezifischer Speicheranteil"})]})]})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between px-1",children:[n.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Installierte Modell-Bibliothek"}),n.jsxs("div",{className:"flex rounded-lg border border-border/40 bg-card/45 p-0.5",children:[n.jsx("button",{onClick:()=>le("grid"),className:oe("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",K==="grid"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Grid"}),n.jsx("button",{onClick:()=>le("list"),className:oe("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",K==="list"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"List"})]})]}),K==="grid"?n.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:s.length===0?n.jsx("div",{className:"col-span-full text-xs text-muted-foreground border border-dashed border-border/60 rounded-2xl p-12 text-center select-none",children:'Keine Modelle konfiguriert. Verwende den Tab "Modelle finden" zum Herunterladen.'}):s.map(T=>{const de=a.includes(T.name),be=N==null?void 0:N.model_list.find(Ae=>Ae.role===T.role),Pe=Hd(T.name);return n.jsxs("div",{className:oe("rounded-2xl border bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-4 transition-all duration-300 hover:border-primary/40 group relative overflow-hidden",de?"border-primary/45 shadow-primary/5":T.role?"border-primary/30 bg-primary/5 shadow-inner":"border-border/60"),children:[n.jsxs("div",{className:"space-y-3",children:[n.jsx("div",{className:"flex items-start justify-between gap-3",children:n.jsxs("div",{className:"flex gap-2.5 min-w-0",children:[n.jsx("div",{className:oe("w-7 h-7 rounded-lg border flex items-center justify-center font-bold text-xs shrink-0 shadow-sm",Pe.color),title:Pe.name,children:Pe.initial}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("h3",{className:"text-xs font-bold tracking-tight text-foreground line-clamp-2 break-all font-mono",title:T.name,children:T.name.split("/").pop()}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap mt-1",children:[n.jsx("span",{className:"text-[9px] font-mono text-muted-foreground bg-background/40 px-1.5 py-0.5 rounded border border-border/30",children:T.quant||"GGUF"}),de&&n.jsxs("span",{className:"flex items-center gap-1 text-[9px] font-semibold text-emerald-400 uppercase tracking-wider",children:[n.jsx(Ws,{className:"h-3 w-3 animate-pulse"})," Warm"]}),T.role&&n.jsx("span",{className:"px-1.5 py-0.5 rounded bg-primary/10 border border-primary/20 text-[9px] font-mono text-primary font-bold uppercase",children:T.role})]})]})]})}),n.jsx("div",{className:"border-t border-border/30 pt-3 flex flex-wrap gap-1",children:n.jsx(Vd,{caps:T.capabilities})})]}),n.jsxs("div",{className:"space-y-3 pt-1",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-2 text-[10px] font-mono text-muted-foreground",children:[n.jsxs("div",{className:"flex items-center gap-1.5 p-2 bg-background/20 rounded-lg border border-border/20",children:[n.jsx(li,{className:"h-3.5 w-3.5 text-primary/80"}),n.jsxs("div",{children:[n.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Größe"}),n.jsx("div",{className:"text-foreground font-semibold",children:hn(T.size_bytes)})]})]}),n.jsxs("div",{className:"flex items-center gap-1.5 p-2 bg-background/20 rounded-lg border border-border/20",children:[n.jsx(gh,{className:"h-3.5 w-3.5 text-primary/80"}),n.jsxs("div",{children:[n.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Kontext"}),n.jsx("div",{className:"text-foreground font-semibold",children:Wd(T.ctx)})]})]})]}),be&&n.jsxs("div",{className:"p-3 bg-amber-500/5 border border-amber-500/30 rounded-xl space-y-2 flex flex-col justify-between shrink-0",children:[n.jsxs("div",{className:"text-[9px] font-semibold text-amber-400 flex items-center gap-1",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-ping"}),n.jsxs("span",{children:["Upgrade verfügbar: ",be.repo.split("/").pop()]})]}),n.jsxs("button",{onClick:()=>F(be.repo,T.role,T.quant||"Q4_K_M",T.capabilities.tools!=="no"),className:"h-7 w-full flex items-center justify-center gap-1 rounded-lg bg-amber-500 text-black text-[10px] font-bold hover:bg-amber-400 transition-colors cursor-pointer",children:[n.jsx(bn,{className:"h-3 w-3"})," Smart-Swap starten"]})]}),n.jsxs("div",{className:"flex items-center gap-1.5 border-t border-border/20 pt-3 mt-auto",children:[n.jsx("button",{onClick:()=>de?H(T.name):Se(T.name),className:oe("flex-1 h-7 rounded-lg text-[9px] font-bold uppercase transition-all cursor-pointer border flex items-center justify-center gap-1",de?"border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/15 text-amber-400":"border-primary/30 bg-primary/5 hover:bg-primary/15 text-primary"),children:de?"Entladen":"Laden"}),n.jsx("button",{onClick:()=>k(T.name,T.ctx),className:"h-7 px-2.5 rounded-lg border border-border/40 text-[9px] font-bold uppercase hover:bg-accent text-muted-foreground transition-colors cursor-pointer",title:"Kontextlänge anpassen",children:"Ctx"}),n.jsx("button",{onClick:()=>x(T.name),className:"h-7 w-7 rounded-lg border border-border/40 text-muted-foreground hover:text-red-400 hover:bg-red-500/5 flex items-center justify-center transition-colors cursor-pointer",title:"Modell löschen",children:n.jsx(ai,{className:"h-3.5 w-3.5"})})]})]})]},T.name)})}):n.jsx("div",{className:"space-y-2",children:s.length===0?n.jsx("div",{className:"text-xs text-muted-foreground border border-dashed border-border/60 rounded-2xl p-12 text-center select-none",children:'Keine Modelle konfiguriert. Verwende den Tab "Modelle finden" zum Herunterladen.'}):s.map(T=>{const de=a.includes(T.name),be=Hd(T.name);return n.jsxs("div",{className:oe("rounded-xl border bg-card/45 backdrop-blur-md p-3.5 shadow-lg shadow-black/5 flex flex-col sm:flex-row sm:items-center justify-between gap-3 hover:border-primary/40 transition-all",de?"border-primary/45":T.role?"border-primary/30 bg-primary/5":"border-border/60"),children:[n.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[n.jsx("div",{className:oe("w-8 h-8 rounded-lg border border-border/40 flex items-center justify-center font-bold text-xs shrink-0 shadow-sm",be.color),title:be.name,children:be.initial}),n.jsxs("div",{className:"min-w-0 text-left",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("h4",{className:"text-xs font-bold text-foreground truncate max-w-[250px] sm:max-w-[400px] break-all font-mono",title:T.name,children:T.name.split("/").pop()}),T.role&&n.jsx("span",{className:"px-1.5 py-0.5 rounded bg-primary/10 border border-primary/20 text-[8px] font-mono text-primary font-bold uppercase shrink-0",children:T.role}),de&&n.jsxs("span",{className:"flex items-center gap-0.5 text-[8px] font-semibold text-emerald-400 uppercase tracking-wider shrink-0",children:[n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," warm"]})]}),n.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2 mt-0.5",children:[n.jsxs("span",{children:["Größe: ",hn(T.size_bytes)]}),n.jsx("span",{children:"•"}),n.jsxs("span",{children:["Kontext: ",Wd(T.ctx)]}),n.jsx("span",{children:"•"}),n.jsx("span",{className:"font-mono text-[9px]",children:T.quant||"GGUF"})]})]})]}),n.jsxs("div",{className:"flex items-center gap-3 shrink-0 self-end sm:self-auto",children:[n.jsx("div",{className:"hidden lg:flex flex-wrap gap-1",children:n.jsx(Vd,{caps:T.capabilities})}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("button",{onClick:()=>de?H(T.name):Se(T.name),className:oe("h-7 px-3 rounded-lg text-[9px] font-bold uppercase transition-all cursor-pointer border flex items-center gap-1",de?"border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/15 text-amber-400":"border-primary/30 bg-primary/5 hover:bg-primary/15 text-primary"),children:de?"Entladen":"Laden"}),n.jsx("button",{onClick:()=>k(T.name,T.ctx),className:"h-7 px-2.5 rounded-lg border border-border/40 text-[9px] font-bold uppercase hover:bg-accent text-muted-foreground transition-all cursor-pointer",title:"Kontextlänge anpassen",children:"Ctx"}),n.jsx("button",{onClick:()=>x(T.name),className:"h-7 w-7 rounded-lg flex items-center justify-center border border-border/40 text-muted-foreground hover:text-red-400 hover:bg-red-500/5 transition-all cursor-pointer",title:"Modell löschen",children:n.jsx(ai,{className:"h-3.5 w-3.5"})})]})]})]},T.name)})})]})]})}function v0(){const[s,u]=h.useState(""),[a,c]=h.useState([]),[f,m]=h.useState("Q4_K_M"),[p,g]=h.useState(""),[N,E]=h.useState(""),[j,S]=h.useState([]);async function O(b){const P=b??s;if(P.trim()){g("Analysiere HuggingFace Repository...");try{const D=await ie(`/api/hf/quants?repo=${encodeURIComponent(P)}`);u(D.repo),c(D.quants),D.quants.length&&m(D.quants.includes("Q4_K_M")?"Q4_K_M":D.quants[0]),g(D.quants.length?"":"Keine GGUF-Dateien in diesem Repository gefunden.")}catch(D){g(`Fehler: ${D}`)}}}async function z(){if(N.trim()){g("Durchsuche HuggingFace...");try{const b=await ie(`/api/hf/search?q=${encodeURIComponent(N)}`);S(b.results),g(b.results.length?"":"Keine Ergebnisse gefunden.")}catch(b){g(`Suche fehlgeschlagen: ${b}`)}}}async function L(){if(s.trim()){g("Download-Job wird initiiert...");try{await ie("/api/models/install",{method:"POST",body:JSON.stringify({repo:s,quant:f,jinja:!0})}),g(`Download gestartet: ${s} (${f}). Fortschritt wird oben angezeigt.`)}catch(b){g(`Download-Fehler: ${b}`)}}}return n.jsxs("div",{className:"space-y-4 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10",children:[n.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"HF Download & Suche"}),n.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[n.jsx("input",{value:s,onChange:b=>u(b.target.value),placeholder:"HF-URL oder org/repo (z.B. unsloth/Qwen2.5-Coder-7B-Instruct-GGUF)",className:"flex-1 h-9 rounded-lg border border-border/60 bg-background/40 px-3 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>O(),className:"h-9 px-4 rounded-lg border border-border/60 bg-background/20 text-xs font-semibold hover:border-primary/50 hover:bg-background/40 transition-all cursor-pointer whitespace-nowrap",children:"Quants laden"}),a.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("select",{value:f,onChange:b=>m(b.target.value),className:"h-9 rounded-lg border border-border/60 bg-background/40 px-3 text-xs outline-none text-foreground font-semibold",children:a.map(b=>n.jsx("option",{value:b,className:"bg-popover text-foreground",children:b},b))}),n.jsxs("button",{onClick:L,className:"h-9 px-4 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all cursor-pointer flex items-center gap-1.5",children:[n.jsx(bn,{className:"h-3.5 w-3.5"})," Herunterladen"]})]})]})]}),n.jsxs("div",{className:"flex gap-2 border-t border-border/20 pt-4",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx("input",{value:N,onChange:b=>E(b.target.value),onKeyDown:b=>b.key==="Enter"&&z(),placeholder:"HuggingFace durchsuchen (z.B. Llama-3.1)...",className:"w-full h-9 pl-9 pr-3 rounded-lg border border-border/60 bg-background/40 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"}),n.jsx(xi,{className:"absolute left-3 top-2.5 h-3.5 w-3.5 text-muted-foreground"})]}),n.jsx("button",{onClick:z,className:"h-9 px-4 rounded-lg border border-border/60 bg-background/20 text-xs font-semibold hover:border-primary/50 hover:bg-background/40 transition-all cursor-pointer",children:"Suchen"})]}),j.length>0&&n.jsx("div",{className:"max-h-48 space-y-1.5 overflow-y-auto border border-border/40 bg-background/20 p-2 rounded-xl scrollbar-thin",children:j.map(b=>n.jsxs("button",{onClick:()=>{u(b.repo),S([]),E(""),O(b.repo)},className:"flex w-full items-center justify-between rounded-lg px-3 py-2 text-left text-xs bg-background/10 border border-border/10 hover:border-primary/30 hover:bg-background/30 transition-all",children:[n.jsx("span",{className:"font-semibold truncate",children:b.repo}),n.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground flex items-center gap-1 shrink-0",children:[n.jsx(bn,{className:"h-3 w-3"})," ",b.downloads.toLocaleString()]})]},b.repo))}),p&&n.jsx("div",{className:"text-[10px] font-medium text-primary font-mono",children:p})]})}const y0={vision:{title:"Bilder & Vision",desc:"Verarbeitet Bilder, Screenshots und visuelle Diagramme in multimodalen Chats.",icon:dh},coder:{title:"Coden & Entwicklung",desc:"Autovervollständigung, Refactoring und Codegenerierung direkt in deiner IDE.",icon:Jd},reasoning:{title:"Logik & Nachdenken",desc:"Komplexe logische Gedankengänge, Mathematik und tiefgründiges Planen (Reasoning).",icon:qs},agent:{title:"Autonomer Agent (Hermes)",desc:"Führt selbstständig Terminalbefehle aus und interagiert mit deinem Homelab.",icon:go},scout:{title:"Allrounder & Chat",desc:"Schnelle Antworten, Zusammenfassungen, Übersetzungen und alltägliche Fragen.",icon:uh}};function b0(){const[s,u]=h.useState(null),[a,c]=h.useState([]),[f,m]=h.useState(null),[p,g]=h.useState(""),[N,E]=h.useState(!0),[j,S]=h.useState({}),[O,z]=h.useState({}),[L,b]=h.useState(!1);h.useEffect(()=>{Promise.all([ie("/api/discover"),ie("/api/models"),ie("/api/maintenance/updates").catch(()=>null)]).then(([D,M,B])=>{u(D),c(M.models||[]),B&&m(B)}).catch(D=>g(String(D))).finally(()=>E(!1))},[]);async function P(D,M,B,G){S(Q=>({...Q,[D]:"Starte..."}));try{await ie("/api/models/install",{method:"POST",body:JSON.stringify({repo:D,role:M,quant:B,jinja:G})}),S(Q=>({...Q,[D]:"Download läuft"}))}catch{S(K=>({...K,[D]:"Fehler"}))}}return N?n.jsx("div",{className:"text-xs text-muted-foreground py-12 text-center",children:"Analysiere Hardware und suche passende GGUF-Empfehlungen…"}):p||!s?n.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Empfehlungsdienst temporär nicht erreichbar (",p,")."]}):n.jsxs("div",{className:"space-y-8",children:[n.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground bg-background/25 border border-border/40 p-4 rounded-xl flex flex-col sm:flex-row sm:items-center justify-between gap-3 shadow-sm",children:[n.jsxs("div",{children:["Modell-Registry geladen für ",n.jsxs("span",{className:"text-foreground font-bold",children:[s.sys_ram_gb," GB"]})," System-RAM."]}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(nf,{className:"h-3.5 w-3.5 text-primary fill-primary/20"}),n.jsx("span",{children:"Empfehlungen sind automatisch auf deine Box-Hardware optimiert."})]})]}),n.jsx("div",{className:"grid gap-6 md:grid-cols-2",children:s.categories.map(D=>{const M=y0[D.role]||{title:D.title||D.role,desc:"Spezifisches Modell für diese Systemrolle.",icon:Ks},B=M.icon,G=a.find(A=>A.role===D.role),Q=f==null?void 0:f.model_list.find(A=>A.role===D.role),K=D.models.find(A=>A.repo===D.recommended)||D.models[0];if(!K)return null;const le=j[K.repo],we=D.models.filter(A=>A.repo!==D.recommended),fe=!!O[D.role];return n.jsxs("div",{className:oe("rounded-2xl border bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-5 transition-all duration-300 hover:border-primary/40",G?"border-border/60":"border-primary/20 shadow-primary/5"),children:[n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 border border-primary/20 flex items-center justify-center text-primary shadow-sm shrink-0",children:n.jsx(B,{className:"h-5.5 w-5.5"})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-sm font-bold tracking-tight text-foreground",children:M.title}),n.jsxs("span",{className:"text-[9px] font-mono text-muted-foreground uppercase bg-background/50 px-1.5 py-0.5 rounded border border-border/30 inline-block mt-0.5",children:["Rolle: ",D.role]})]})]}),G?n.jsxs("span",{className:"flex items-center gap-1.5 text-[9px] font-bold text-emerald-400 uppercase tracking-wider bg-emerald-500/10 border border-emerald-500/20 px-2.5 py-1 rounded-lg",children:[n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"}),"Aktiviert"]}):n.jsx("span",{className:"text-[9px] font-bold text-primary/70 uppercase tracking-wider bg-primary/10 border border-primary/20 px-2.5 py-1 rounded-lg",children:"Frei"})]}),n.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:M.desc}),n.jsx("div",{className:"p-3.5 rounded-xl bg-background/35 border border-border/30 space-y-2.5",children:G?n.jsxs("div",{className:"space-y-1.5",children:[n.jsx("div",{className:"text-[9px] font-bold uppercase tracking-wider text-muted-foreground/60",children:"Aktive GGUF-Belegung"}),n.jsx("div",{className:"text-xs font-mono font-bold text-foreground truncate",title:G.name,children:G.name.split("/").pop()}),n.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2",children:[n.jsxs("span",{children:["Größe: ",mi(G.size_bytes||0)]}),n.jsx("span",{children:"•"}),n.jsxs("span",{children:["Quant: ",G.quant||"GGUF"]})]})]}):n.jsxs("div",{className:"space-y-1.5",children:[n.jsx("div",{className:"text-[9px] font-bold uppercase tracking-wider text-primary/80",children:"Empfohlenes Modell"}),n.jsx("div",{className:"text-xs font-mono font-bold text-foreground truncate",title:K.name,children:K.name}),n.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2 flex-wrap",children:[n.jsxs("span",{children:["Ersteller: ",K.author]}),n.jsx("span",{children:"•"}),n.jsxs("span",{children:["Quant: ",K.quant]})]}),n.jsx("div",{className:"flex items-center gap-1.5 pt-0.5",children:n.jsx(h0,{fit:K.fit})})]})}),n.jsx("div",{className:"pt-1",children:G?Q?n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"text-[9px] font-semibold text-amber-400 flex items-center gap-1.5",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-ping shrink-0"}),n.jsxs("span",{children:["Bessere Version in der Registry: ",Q.repo.split("/").pop()]})]}),n.jsxs("button",{onClick:()=>P(Q.repo,D.role,K.quant||"Q4_K_M",K.caps.tools!=="no"),disabled:!!j[Q.repo],className:"h-8 w-full flex items-center justify-center gap-1.5 rounded-lg bg-amber-500 text-black text-xs font-bold hover:bg-amber-400 disabled:opacity-50 transition-all cursor-pointer shadow-md shadow-amber-500/10",children:[n.jsx(bn,{className:"h-3.5 w-3.5"}),j[Q.repo]||"Auf neue Version aktualisieren"]})]}):n.jsxs("div",{className:"h-8 flex items-center justify-center gap-1.5 text-[10px] font-bold text-emerald-400 uppercase tracking-wide bg-emerald-500/5 border border-emerald-500/10 rounded-lg select-none",children:[n.jsx(Hs,{className:"h-4 w-4"})," Auf neuestem Stand"]}):n.jsxs("button",{onClick:()=>P(K.repo,D.role,K.quant||"Q4_K_M",K.caps.tools!=="no"),disabled:!!le,className:oe("h-8 w-full flex items-center justify-center gap-1.5 rounded-lg text-xs font-bold transition-all cursor-pointer border",le?"border-primary/40 bg-primary/5 text-primary":"bg-primary text-primary-foreground hover:opacity-90 shadow-md shadow-primary/10"),children:[n.jsx(bn,{className:"h-3.5 w-3.5"}),le||"Optimales Modell einsetzen"]})})]}),we.length>0&&n.jsxs("div",{className:"border-t border-border/20 pt-3",children:[n.jsxs("button",{onClick:()=>z(A=>({...A,[D.role]:!fe})),className:"flex items-center gap-1.5 text-[10px] text-muted-foreground/80 hover:text-foreground transition-colors cursor-pointer",children:[fe?n.jsx(sh,{className:"h-3 w-3"}):n.jsx(rh,{className:"h-3 w-3"}),n.jsxs("span",{children:["Alternative Empfehlungen anzeigen (",we.length,")"]})]}),fe&&n.jsx("div",{className:"mt-2.5 space-y-2 max-h-36 overflow-y-auto pr-1 scrollbar-thin",children:we.map(A=>n.jsxs("div",{className:"p-2 rounded-lg bg-background/25 border border-border/20 flex items-center justify-between gap-3",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"text-[10px] font-mono font-bold text-foreground truncate",title:A.name,children:A.name}),n.jsxs("div",{className:"text-[9px] text-muted-foreground flex items-center gap-1.5 mt-0.5",children:[n.jsxs("span",{children:["Quant: ",A.quant]}),n.jsx("span",{children:"•"}),n.jsx("span",{children:A.fit.text})]})]}),n.jsx("button",{onClick:()=>P(A.repo,D.role,A.quant||"Q4_K_M",A.caps.tools!=="no"),disabled:!!j[A.repo],className:"h-6 px-2.5 rounded bg-background/40 hover:bg-background/80 border border-border/40 text-[9px] font-bold text-foreground transition-all cursor-pointer shrink-0 disabled:opacity-50",children:j[A.repo]||"Installieren"})]},A.repo))})]})]},D.role)})}),n.jsxs("div",{className:"border border-border/50 bg-card/20 rounded-2xl overflow-hidden shadow-md mt-4",children:[n.jsxs("button",{onClick:()=>b(!L),className:"w-full px-5 py-4 flex items-center justify-between text-xs font-bold uppercase tracking-wider text-muted-foreground hover:bg-card/30 transition-colors cursor-pointer",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(xi,{className:"h-4 w-4 text-primary"}),n.jsx("span",{children:"Eigenes Modell von Hugging Face laden (Erweiterte Ansicht)"})]}),n.jsx("span",{className:"text-[10px] text-primary hover:underline",children:L?"Ausblenden ▲":"Anzeigen ▼"})]}),L&&n.jsx("div",{className:"p-5 border-t border-border/20 bg-card/10",children:n.jsx(v0,{})})]})]})}function w0(){const[s,u]=h.useState("cockpit");return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Modell-Manager"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Verwalte deine Modelle und passe das Gateway-Routing live über das interaktive Cockpit an."})]}),n.jsx("div",{className:"flex rounded-xl border border-border/60 bg-card/45 backdrop-blur-md p-1 self-start",children:["cockpit","discover"].map(a=>n.jsx("button",{onClick:()=>u(a),className:oe("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",s===a?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:a==="cockpit"?"Cockpit":"Modelle finden"},a))})]}),n.jsx(m0,{}),n.jsx("div",{className:"transition-all duration-300",children:s==="cockpit"?n.jsx(x0,{}):n.jsx(b0,{})})]})}function hr(s){return(s/1024**3).toFixed(1)}function $s({label:s,percent:u,detail:a,icon:c}){const f=u>90?"bg-red-500 shadow-md shadow-red-500/20":u>75?"bg-amber-500 shadow-md shadow-amber-500/20":"bg-primary shadow-md shadow-primary/20";return n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-3 hover:border-primary/30 transition-all duration-300",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(c,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-foreground",children:s})]}),n.jsxs("span",{className:"text-xs font-mono font-bold text-foreground",children:[Math.round(u),"%"]})]}),n.jsx("div",{className:"w-full h-2 bg-background/40 rounded-full overflow-hidden border border-border/20",children:n.jsx("div",{className:oe("h-full transition-all duration-700 ease-out",f),style:{width:`${Math.min(u,100)}%`}})}),a&&n.jsx("div",{className:"text-[10px] font-mono text-muted-foreground/80",children:a})]})}function k0(){const[s,u]=h.useState(null),[a,c]=h.useState(null),[f,m]=h.useState(""),[p,g]=h.useState(""),[N,E]=h.useState({});function j(){ie("/api/system/status").then(u).catch(z=>m(String(z))),ie("/api/system/services").then(c).catch(()=>{})}h.useEffect(()=>{j();const z=setInterval(j,3e3);return()=>clearInterval(z)},[]);async function S(){g("Backup snapshotted...");try{const z=await ie("/api/system/backup",{method:"POST"});g(z.ok?`Snapshot erzeugt: ${z.snapshot} (${z.files.length} Dateien)`:"Keine Änderungen zu sichern.")}catch(z){g(`Fehler: ${z.message}`)}}async function O(z){E(L=>({...L,[z]:!0}));try{const L=await ie("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:z})});L.ok?alert(`Dienst ${z} wurde erfolgreich neu gestartet.`):alert(`Fehler beim Neustart: ${L.err||"Unbekannter Fehler"}`)}catch(L){alert(`Fehler: ${L.message}`)}finally{E(L=>({...L,[z]:!1}))}}return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"System-Diagnose & Status"}),n.jsx("p",{className:"text-sm text-muted-foreground flex items-center gap-1",children:"Echtzeit-Ressourcen der Box, Dienst-Überwachung und Systempflege."})]}),f&&n.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400 font-mono",children:["System-Status nicht lesbar (",f,")."]}),s&&n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[n.jsx($s,{label:"CPU",percent:s.cpu.percent,detail:s.cpu.cores?`${s.cpu.cores} Cores`:void 0,icon:vr}),n.jsx($s,{label:"RAM",percent:s.ram.percent,detail:`${hr(s.ram.used)} / ${hr(s.ram.total)} GB`,icon:Ws}),s.gpu&&s.gpu.busy_percent!=null&&n.jsx($s,{label:"GPU",percent:s.gpu.busy_percent,detail:s.gpu.gtt_used!=null&&s.gpu.gtt_total?`${hr(s.gpu.gtt_used)} / ${hr(s.gpu.gtt_total)} GB (GTT/unified)`:s.gpu.vram_used!=null&&s.gpu.vram_total?`${hr(s.gpu.vram_used)} / ${hr(s.gpu.vram_total)} GB VRAM`:void 0,icon:vr}),s.disk&&n.jsx($s,{label:"Disk",percent:s.disk.percent,detail:`${hr(s.disk.used)} / ${hr(s.disk.total)} GB`,icon:li})]}),s.temp&&(s.temp.cpu||s.temp.gpu)&&n.jsxs("div",{className:"flex gap-3 text-[10px] font-mono text-muted-foreground bg-background/25 border border-border/40 p-2.5 rounded-xl self-start w-fit",children:[s.temp.cpu!=null&&n.jsxs("span",{className:"flex items-center gap-1",children:["CPU-Temperatur: ",n.jsxs("span",{className:"text-foreground font-bold",children:[s.temp.cpu," °C"]})]}),s.temp.cpu!=null&&s.temp.gpu!=null&&n.jsx("span",{children:"|"}),s.temp.gpu!=null&&n.jsxs("span",{className:"flex items-center gap-1",children:["GPU-Temperatur: ",n.jsxs("span",{className:"text-foreground font-bold",children:[s.temp.gpu," °C"]})]})]})]}),a&&n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Homelab-Dienste"}),n.jsx("button",{onClick:()=>window.dispatchEvent(new CustomEvent("open-system-drawer",{detail:{tab:"logs"}})),className:"h-7 px-3 rounded-lg border border-border/60 bg-background/25 text-[10px] font-bold uppercase hover:bg-accent text-muted-foreground transition-all cursor-pointer",children:"System-Logs anzeigen"})]}),n.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:a.services.map(z=>n.jsxs("div",{className:"flex items-center justify-between p-3.5 rounded-xl bg-background/20 border border-border/30 hover:border-primary/20 transition-all group",children:[n.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[n.jsx("span",{className:oe("h-2.5 w-2.5 rounded-full ring-2 ring-black/40",z.ok?"bg-emerald-500":"bg-amber-500")}),n.jsxs("div",{className:"truncate",children:[n.jsx("div",{className:"text-xs font-bold text-foreground truncate",children:z.name}),n.jsx("div",{className:"text-[9px] text-muted-foreground/60 font-mono mt-0.5 truncate",children:z.url})]})]}),n.jsx("button",{onClick:()=>O(z.name),disabled:N[z.name],className:"h-7 w-7 rounded-lg border border-border/40 text-muted-foreground hover:text-primary hover:bg-primary/5 flex items-center justify-center transition-all opacity-0 group-hover:opacity-100",title:"Dienst neu starten",children:n.jsx(wn,{className:oe("h-3.5 w-3.5",N[z.name]&&"animate-spin")})})]},z.name))}),n.jsxs("div",{className:"flex flex-wrap gap-4 border-t border-border/20 pt-4 text-[10px] font-semibold text-muted-foreground",children:[n.jsxs("a",{href:bo(a.links.engine_ui),target:"_blank",rel:"noopener",className:"flex items-center gap-1 text-primary hover:text-primary-foreground hover:bg-primary/10 px-2 py-1 rounded transition-colors",children:[n.jsx(Gs,{className:"h-3 w-3"})," Engine Dashboard (llama-swap)"]}),n.jsxs("a",{href:bo(a.links.gateway),target:"_blank",rel:"noopener",className:"flex items-center gap-1 text-primary hover:text-primary-foreground hover:bg-primary/10 px-2 py-1 rounded transition-colors",children:[n.jsx(Gs,{className:"h-3 w-3"})," OpenAI Gateway"]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"System-Backup & Snapshot"}),n.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Erzeuge einen Git-Snapshot der aktuellen Konfigurationen und des System-Zustands."})]}),n.jsx("div",{className:"flex items-center gap-3 self-start sm:self-auto shrink-0",children:n.jsxs("button",{onClick:S,className:"h-9 px-4 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all flex items-center gap-1.5 cursor-pointer shadow-md shadow-primary/10",children:[n.jsx(vh,{className:"h-4 w-4"})," Snapshot erstellen"]})})]}),p&&n.jsx("div",{className:"text-[10px] font-mono text-primary font-medium bg-primary/5 p-3 rounded-xl border border-primary/20",children:p})]})}function j0(){const[s,u]=h.useState(localStorage.getItem("mc_host")||"192.168.178.151"),[a,c]=h.useState(localStorage.getItem("mc_mcp_path")||""),[f,m]=h.useState(null),[p,g]=h.useState("cline"),[N,E]=h.useState(!1),[j,S]=h.useState("");h.useEffect(()=>{const P=new URLSearchParams;P.set("host",s),a&&P.set("mcp_path",a),ie(`/api/connect?${P}`).then(m).catch(D=>S(String(D)))},[s,a]);function O(P){u(P),P&&localStorage.setItem("mc_host",P)}function z(P){c(P),localStorage.setItem("mc_mcp_path",P)}const L=f==null?void 0:f.tools[p];async function b(){L&&(await navigator.clipboard.writeText(L.snippet),E(!0),setTimeout(()=>E(!1),1500))}return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Verbindung & Integration"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Kopiere vorgefertigte Konfigurationsdateien für deinen lokalen PC (IDEs, Cline, Roo Code, Cursor), um direkt auf das geteilte Gedächtnis und den Auto-Swap-Gateway der Box zuzugreifen."})]}),n.jsxs("div",{className:"grid gap-4 md:grid-cols-2 p-5 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md shadow-lg shadow-black/10",children:[n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5",children:[n.jsx(ph,{className:"h-3.5 w-3.5 text-primary"})," Box LAN IP-Adresse"]}),n.jsx("input",{value:s,onChange:P=>O(P.target.value),placeholder:"z.B. 192.168.178.151",className:"w-full h-9 rounded-lg border border-border/60 bg-background/40 px-3 font-mono text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"})]}),n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5",children:[n.jsx(fh,{className:"h-3.5 w-3.5 text-primary"})," Lokaler MCP-Scriptpfad"]}),n.jsx("input",{value:a,onChange:P=>z(P.target.value),placeholder:"z.B. F:\\Coding Stuff\\mission-control-2\\mcp\\mcp_memory.py",className:"w-full h-9 rounded-lg border border-border/60 bg-background/40 px-3 font-mono text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"})]})]}),j&&n.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Fehler beim Generieren der Snippets: ",j]}),f&&n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:"flex flex-wrap gap-1 bg-card/20 p-1 border border-border/40 rounded-xl max-w-fit",children:Object.entries(f.tools).map(([P,D])=>n.jsx("button",{onClick:()=>g(P),className:oe("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",p===P?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:D.label},P))}),L&&n.jsxs("div",{className:"space-y-3",children:[L.note&&n.jsxs("div",{className:"flex items-start gap-2.5 p-3 rounded-xl bg-primary/5 border border-primary/20 text-xs text-muted-foreground leading-relaxed",children:[n.jsx(mh,{className:"h-4.5 w-4.5 text-primary shrink-0 mt-0.5"}),n.jsx("span",{children:L.note})]}),n.jsxs("div",{className:"flex flex-col border border-border/60 bg-black/60 rounded-2xl overflow-hidden shadow-2xl",children:[n.jsxs("div",{className:"flex h-11 items-center justify-between px-4 border-b border-border/40 bg-black/40 shrink-0",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"h-3 w-3 rounded-full bg-red-500/80 shadow-md shadow-red-500/10"}),n.jsx("span",{className:"h-3 w-3 rounded-full bg-amber-500/80 shadow-md shadow-amber-500/10"}),n.jsx("span",{className:"h-3 w-3 rounded-full bg-emerald-500/80 shadow-md shadow-emerald-500/10"})]}),n.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-mono text-muted-foreground/75 bg-background/30 px-3 py-1 rounded-md border border-border/20",children:[n.jsx(vi,{className:"h-3.5 w-3.5 text-primary"}),n.jsx("span",{children:p==="cline"||p==="cursor"?"config.json":"settings.json"})]}),n.jsxs("button",{onClick:b,className:"flex h-7 px-2.5 items-center gap-1.5 rounded-lg border border-border/40 bg-background/30 text-[10px] font-semibold text-muted-foreground hover:text-foreground hover:bg-background/60 transition-all cursor-pointer",children:[N?n.jsx(Hs,{className:"h-3.5 w-3.5 text-emerald-400"}):n.jsx(ef,{className:"h-3.5 w-3.5"}),n.jsx("span",{children:N?"Kopiert":"Kopieren"})]})]}),n.jsx("pre",{className:"p-5 overflow-x-auto text-xs font-mono text-cyan-200/90 whitespace-pre leading-relaxed scrollbar-thin select-text bg-black/10",children:n.jsx("code",{children:L.snippet})})]})]})]})]})}const Gd=["user","instruction","stable","versioned","ephemeral"],oi={user:{label:"User",icon:Nh,color:"text-cyan-400",border:"border-cyan-500/30",bg:"bg-cyan-500/10",text:"text-cyan-400"},instruction:{label:"Regel",icon:yh,color:"text-violet-400",border:"border-violet-500/30",bg:"bg-violet-500/10",text:"text-violet-400"},stable:{label:"Fakt",icon:xo,color:"text-indigo-400",border:"border-indigo-500/30",bg:"bg-indigo-500/10",text:"text-indigo-400"},versioned:{label:"Version",icon:jh,color:"text-amber-400",border:"border-amber-500/30",bg:"bg-amber-500/10",text:"text-amber-400"},ephemeral:{label:"Temporär",icon:ah,color:"text-pink-400",border:"border-pink-500/30",bg:"bg-pink-500/10",text:"text-pink-400"}},Kd={label:"Gedächtnis",icon:Xd,bg:"bg-muted/10",text:"text-muted-foreground"},N0={user:"border-l-cyan-500/80",instruction:"border-l-violet-500/80",stable:"border-l-indigo-500/80",versioned:"border-l-amber-500/80",ephemeral:"border-l-pink-500/80"};function S0(){const[s,u]=h.useState([]),[a,c]=h.useState(""),[f,m]=h.useState(""),[p,g]=h.useState(""),[N,E]=h.useState("stable"),[j,S]=h.useState(""),[O,z]=h.useState(!1);function L(){const M=new URLSearchParams;f&&M.set("q",f),a&&M.set("category",a),ie(`/api/memory?${M}`).then(u).catch(B=>S(String(B)))}h.useEffect(L,[f,a]);async function b(){p.trim()&&(await ie("/api/memory",{method:"POST",body:JSON.stringify({content:p,category:N,source:"ui"})}),g(""),L())}async function P(M){await ie(`/api/memory/${M}`,{method:"DELETE"}),L()}async function D(){z(!0);try{const M=await ie("/api/memory/dedupe",{method:"POST",body:JSON.stringify({apply:!1})});if(M.duplicate_count===0){alert("Keine Dubletten gefunden — alles sauber.");return}confirm(`${M.duplicate_count} Dublette(n) in ${M.groups.length} Gruppe(n) gefunden. Entfernen?`)&&(await ie("/api/memory/dedupe",{method:"POST",body:JSON.stringify({apply:!0})}),L())}catch(M){alert(`Fehler: ${M.message}`)}finally{z(!1)}}return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Gedächtnis-Pool (Memory)"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Die geteilte Konstitution des Systems. Alle Instanzen (Hermes, IDEs, Gateway) lesen und schreiben hierauf per MCP-Protokoll."})]}),n.jsxs("button",{onClick:D,disabled:O,className:"flex h-9 px-4 items-center gap-1.5 text-xs font-semibold rounded-lg border border-border/60 bg-card hover:border-primary/50 transition-all cursor-pointer shadow-md disabled:opacity-50 shrink-0 self-start",children:[n.jsx(kh,{className:"h-4 w-4 text-primary animate-pulse"}),n.jsx("span",{children:"Deduplizieren"})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-4",children:[n.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Neuen Eintrag anlegen"}),n.jsx("textarea",{value:p,onChange:M=>g(M.target.value),placeholder:"Füge eine neue Regel, eine Vorliebe oder einen stabilen Fakt über das Projekt oder dich hinzu...",rows:3,className:"w-full resize-none rounded-xl border border-border/60 bg-background/30 p-3.5 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground transition-all leading-relaxed"}),n.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wider",children:"Kategorie"}),n.jsx("select",{value:N,onChange:M=>E(M.target.value),className:"h-8 rounded-lg border border-border/60 bg-background/50 px-2 py-1 text-xs outline-none font-semibold text-foreground cursor-pointer",children:Gd.map(M=>{var B;return n.jsx("option",{value:M,className:"bg-popover text-foreground",children:((B=oi[M])==null?void 0:B.label)||M},M)})})]}),n.jsxs("button",{onClick:b,className:"h-9 px-4 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all flex items-center gap-1.5 cursor-pointer shadow-md shadow-primary/10",children:[n.jsx(tf,{className:"h-4 w-4"})," Speichern"]})]})]}),n.jsxs("div",{className:"flex flex-col md:flex-row items-stretch md:items-center gap-3",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx("input",{value:f,onChange:M=>m(M.target.value),placeholder:"Gedächtnis durchsuchen...",className:"w-full h-9 pl-9 pr-3 rounded-lg border border-border/60 bg-card/45 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"}),n.jsx(xi,{className:"absolute left-3 top-2.5 h-3.5 w-3.5 text-muted-foreground"})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 p-1 bg-card/30 border border-border/40 rounded-xl overflow-x-auto max-w-full",children:[n.jsx("button",{onClick:()=>c(""),className:oe("h-7 px-3 rounded-lg text-[10px] font-semibold uppercase tracking-wider transition-all cursor-pointer whitespace-nowrap",a?"text-muted-foreground hover:text-foreground":"bg-primary text-primary-foreground"),children:"Alle"}),Gd.map(M=>{const B=oi[M]||Kd,G=B.icon;return n.jsxs("button",{onClick:()=>c(M),className:oe("h-7 px-2.5 rounded-lg text-[10px] font-semibold uppercase tracking-wider transition-all cursor-pointer flex items-center gap-1 whitespace-nowrap",a===M?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:[n.jsx(G,{className:"h-3 w-3"}),n.jsx("span",{children:B.label})]},M)})]})]}),j&&n.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Fehler beim Laden des Gedächtnisses: ",j]}),n.jsx("div",{className:"space-y-3",children:s.length===0?n.jsx("div",{className:"text-xs text-muted-foreground border border-dashed border-border/60 rounded-2xl p-12 text-center",children:"Keine Einträge für die aktuellen Filterkriterien gefunden."}):s.map(M=>{const B=oi[M.category]||Kd,G=B.icon;return n.jsxs("div",{className:oe("flex items-start justify-between gap-4 p-4 rounded-xl border border-l-4 bg-card/45 backdrop-blur-md border-border/60 shadow-md shadow-black/5 hover:border-primary/20 transition-all group",N0[M.category]||"border-l-muted"),children:[n.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[n.jsxs("span",{className:oe("flex items-center gap-1 px-2 py-0.5 rounded text-[9px] font-bold uppercase tracking-wider font-mono shrink-0",B.bg,B.text),children:[n.jsx(G,{className:"h-3 w-3"}),n.jsx("span",{className:"hidden sm:inline",children:B.label})]}),n.jsx("span",{className:"text-xs text-foreground leading-relaxed break-words whitespace-pre-wrap flex-1",children:M.content})]}),n.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[n.jsx("span",{className:"text-[9px] font-mono text-muted-foreground/60 bg-background/20 px-1.5 py-0.5 rounded uppercase tracking-wider",children:M.source}),n.jsx("button",{onClick:()=>P(M.id),className:"h-7 w-7 rounded-lg flex items-center justify-center border border-border/40 text-muted-foreground hover:text-red-400 hover:bg-red-500/5 transition-all opacity-0 group-hover:opacity-100",title:"Eintrag löschen",children:n.jsx(ai,{className:"h-3.5 w-3.5"})})]})]},M.id)})})]})}function Us({label:s,ok:u,detail:a,icon:c}){return n.jsxs("div",{className:oe("rounded-2xl border bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-3 hover:border-primary/40 transition-all duration-300",u?"border-border/60":"border-amber-500/30"),children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:s}),n.jsx(c,{className:oe("h-4.5 w-4.5",u?"text-primary":"text-amber-500")})]}),n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:oe("h-2 w-2 rounded-full ring-2 ring-black/40",u?"bg-emerald-500 animate-pulse":"bg-amber-500")}),n.jsx("span",{className:"text-xs font-semibold text-foreground",children:u?"Bereit / Online":"Offline / Inaktiv"})]}),a&&n.jsx("div",{className:"text-[10px] font-mono text-muted-foreground truncate max-w-[200px]",title:a,children:a})]})]})}function C0(){const[s,u]=h.useState(null),[a,c]=h.useState(""),[f,m]=h.useState(null),[p,g]=h.useState({width:800,height:360}),N=h.useRef(null),E=h.useCallback(L=>{if(N.current&&(N.current.disconnect(),N.current=null),L){const b=new ResizeObserver(P=>{if(!P||P.length===0)return;const D=P[0].contentRect;g({width:D.width,height:D.height})});b.observe(L),N.current=b}},[]),j=p.width,S=p.height,O=(L,b,P,D)=>{const M=(L+P)/2;return`M ${L} ${b} C ${M} ${b}, ${M} ${D}, ${P} ${D}`};function z(){ie("/api/agent/status").then(u).catch(L=>c(String(L)))}return h.useEffect(()=>{z();const L=setInterval(z,5e3);return()=>clearInterval(L)},[]),n.jsxs("div",{className:"space-y-6",children:[n.jsx("style",{children:` @keyframes flow-dash { to { stroke-dashoffset: -20; diff --git a/frontend/dist/index.html b/frontend/dist/index.html index b4ab5fb..28b7b5c 100644 --- a/frontend/dist/index.html +++ b/frontend/dist/index.html @@ -7,7 +7,7 @@ Mission Control 2.0 - + diff --git a/frontend/src/nav.ts b/frontend/src/nav.ts index bf63b50..30644a0 100644 --- a/frontend/src/nav.ts +++ b/frontend/src/nav.ts @@ -21,7 +21,7 @@ export interface NavItem { // Eine Quelle der Wahrheit für Sidebar UND Command-Palette. export const NAV: NavItem[] = [ { id: "dashboard", label: "Zentrale", hint: "System- & Stack-Status", icon: LayoutDashboard }, - { id: "models", label: "Modell-Zentrale", hint: "Verwalten, laden & Gateway-Routing", icon: Boxes }, + { id: "models", label: "Modell-Manager", hint: "Verwalten, laden & Gateway-Routing", icon: Boxes }, { id: "system", label: "Diagnose", hint: "Metriken, Dienste, Logs", icon: Cpu }, { id: "memory", label: "Gedächtnis", hint: "Geteiltes Memory verwalten", icon: Brain }, { id: "connect", label: "Verbinden", hint: "IDE-/Agent-Configs erzeugen", icon: Plug }, diff --git a/frontend/src/views/ModelsView.tsx b/frontend/src/views/ModelsView.tsx index df06fa9..9ac82f2 100644 --- a/frontend/src/views/ModelsView.tsx +++ b/frontend/src/views/ModelsView.tsx @@ -770,8 +770,12 @@ function Cockpit() {
@@ -895,7 +899,11 @@ function Cockpit() { key={m.name} className={cn( "rounded-xl border bg-card/45 backdrop-blur-md p-3.5 shadow-lg shadow-black/5 flex flex-col sm:flex-row sm:items-center justify-between gap-3 hover:border-primary/40 transition-all", - isRunning ? "border-primary/45" : "border-border/60" + isRunning + ? "border-primary/45" + : m.role + ? "border-primary/30 bg-primary/5" + : "border-border/60" )} >
@@ -1402,7 +1410,7 @@ export function ModelsView() {

- Modell-Zentrale + Modell-Manager

Verwalte deine Modelle und passe das Gateway-Routing live über das interaktive Cockpit an.