decocms
Version:
Deco CMS — Self-hostable MCP Gateway for managing AI connections and tools
3 lines (2 loc) • 2.82 kB
JavaScript
import{c as w,an as $,i as S,K as T,b as K,m as b,j as s,o as E}from"./index-ztdGKvBm.js";function R(n){const e=w.c(9),f=$();let r;e[0]!==n?(r=T.user(n),e[0]=n,e[1]=r):r=e[1];let c;e[2]!==f||e[3]!==n?(c=async()=>{const{user:o}=await f.call("USER_GET",{id:n});return o},e[2]=f,e[3]=n,e[4]=c):c=e[4];const x=!!n;let t;return e[5]!==r||e[6]!==c||e[7]!==x?(t={queryKey:r,queryFn:c,staleTime:3e5,retry:1,enabled:x},e[5]=r,e[6]=c,e[7]=x,e[8]=t):t=e[8],S(t)}function q(n){const e=w.c(37),{id:f,size:r,showEmail:c,avatarOnly:x,className:t}=n,o=r===void 0?"xs":r,p=c===void 0?!1:c,d=x===void 0?!1:x,y=K(),{data:m,isLoading:U,isError:k}=R(f);if(U){let a;e[0]!==t?(a=b("flex items-center gap-2",t),e[0]=t,e[1]=a):a=e[1];let i;e[2]!==o?(i=s.jsx(E.Skeleton,{shape:"circle",size:o}),e[2]=o,e[3]=i):i=e[3];let l;e[4]!==d||e[5]!==p?(l=!d&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("div",{className:"h-3 w-24 bg-muted animate-pulse rounded"}),p&&s.jsx("div",{className:"h-2 w-32 bg-muted animate-pulse rounded"})]}),e[4]=d,e[5]=p,e[6]=l):l=e[6];let u;return e[7]!==a||e[8]!==i||e[9]!==l?(u=s.jsxs("div",{className:a,children:[i,l]}),e[7]=a,e[8]=i,e[9]=l,e[10]=u):u=e[10],u}if(k||!m){let a;e[11]!==t?(a=b("flex items-center gap-2",t),e[11]=t,e[12]=a):a=e[12];let i;e[13]!==o?(i=s.jsx(E,{shape:"circle",size:o,fallback:"?",muted:!0}),e[13]=o,e[14]=i):i=e[14];let l;e[15]!==d||e[16]!==y?(l=!d&&s.jsx("div",{className:"flex flex-col",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:y("user.user.unknownUser")})}),e[15]=d,e[16]=y,e[17]=l):l=e[17];let u;return e[18]!==a||e[19]!==i||e[20]!==l?(u=s.jsxs("div",{className:a,children:[i,l]}),e[18]=a,e[19]=i,e[20]=l,e[21]=u):u=e[21],u}let v;e[22]!==t?(v=b("flex items-center gap-2",t),e[22]=t,e[23]=v):v=e[23];const N=m.image??void 0;let h;e[24]!==o||e[25]!==N||e[26]!==m.name?(h=s.jsx(E,{shape:"circle",size:o,url:N,fallback:m.name}),e[24]=o,e[25]=N,e[26]=m.name,e[27]=h):h=e[27];let g;e[28]!==d||e[29]!==p||e[30]!==m.email||e[31]!==m.name?(g=!d&&s.jsxs("div",{className:"flex flex-col",children:[s.jsx("div",{className:"text-sm font-medium",children:m.name}),p&&s.jsx("div",{className:"text-xs text-muted-foreground",children:m.email})]}),e[28]=d,e[29]=p,e[30]=m.email,e[31]=m.name,e[32]=g):g=e[32];let j;return e[33]!==v||e[34]!==h||e[35]!==g?(j=s.jsxs("div",{className:v,children:[h,g]}),e[33]=v,e[34]=h,e[35]=g,e[36]=j):j=e[36],j}function z(n){const{managerAgentId:e,managerName:f,kind:r,id:c,instructions:x}=n,t=` to improve the instructions of ${r} "${c}". Here are its current instructions.
<current_instructions>${x}</current_instructions>`;return{type:"doc",content:[{type:"paragraph",content:[{type:"text",text:"Use "},{type:"mention",attrs:{id:e,name:f,char:"@",metadata:{agentId:e,title:f}}},{type:"text",text:t}]}]}}export{q as U,z as b};