UNPKG

decocms

Version:

Deco CMS — Self-hostable MCP Gateway for managing AI connections and tools

2 lines (1 loc) • 7.86 kB
import{c as M,j as t,v as _,D as G,r as U,e3 as L,m as A,x as H,hI as W,B as I,b8 as O}from"./index-DoEtSiIe.js";import{i as K}from"./Zap-CxPsn4FS.js";import{M as R}from"./markdown-DeZATUv_.js";import{F as V}from"./file-preview-BKJnTrOe.js";import{F as J}from"./file-type-icon-R4tsODq6.js";import{l as Z,h as q,u as Q}from"./use-org-fs-C62_MbqW.js";import{O as X,J as E}from"./chat-context-vJ6R-Clt.js";import{c as Y}from"./context-shell-0fpmlncZ.js";import{s as ee}from"./Eye-DwRCQHLk.js";function te(o){const e=M.c(18),{skillPath:i,onClose:r,variant:l}=o,a=X(i),{volume:n,dirPath:F}=a,$=Z(),s=$(n??"",`${F}/SKILL.md`),w=q(s),D=Q(n??"",F);let v;e[0]!==F?(v=E(F),e[0]=F,e[1]=v):v=e[1];const P=v;let x;e[2]!==w.data?(x=w.data?Y(w.data):null,e[2]=w.data,e[3]=x):x=e[3];const h=x,C=le;let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=(m,z)=>C(m.path)?-1:C(z.path)?1:E(m.path).localeCompare(E(z.path)),e[4]=p):p=e[4];const B=(D.data??[]).filter(se).sort(p),[k,S]=U.useState(null),c=k===null?null:B.find(m=>m.path===k)??null,u=h?.name??P;let g;e[5]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:t.jsx(K,{size:18})}),e[5]=g):g=e[5];let d;e[6]!==u||e[7]!==l?(d=l==="dialog"?t.jsx(H,{className:"flex-1 truncate text-base font-medium text-foreground",children:u}):t.jsx("span",{className:"flex-1 truncate text-base font-medium text-foreground",children:u}),e[6]=u,e[7]=l,e[8]=d):d=e[8];let f;e[9]!==r||e[10]!==l?(f=l==="dialog"?t.jsx(W,{asChild:!0,children:t.jsx(I,{variant:"ghost",size:"icon",className:"shrink-0",children:t.jsx(O,{size:16})})}):t.jsx(I,{variant:"ghost",size:"icon",className:"shrink-0",onClick:r,children:t.jsx(O,{size:16})}),e[9]=r,e[10]=l,e[11]=f):f=e[11];let j;e[12]!==d||e[13]!==f?(j=t.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[g,d,f]}),e[12]=d,e[13]=f,e[14]=j):j=e[14];let b;e[15]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("p",{className:"px-2 py-1.5 text-sm font-medium text-foreground",children:"Files"}),e[15]=b):b=e[15];const T="relative flex min-w-0 flex-1 flex-col overflow-y-auto",y=c?t.jsx(V,{file:{key:c.path,filename:E(c.path),size:c.size,downloadUrl:$(n??"",c.path)}}):w.isPending?t.jsxs("div",{className:"flex flex-col gap-2 p-6",children:[t.jsx(L,{className:"h-4 w-1/3"}),t.jsx(L,{className:"h-3 w-full"}),t.jsx(L,{className:"h-3 w-5/6"}),t.jsx(L,{className:"h-3 w-2/3"})]}):w.isError||!h?t.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"This skill is no longer available."}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex flex-col gap-4 border-b border-border p-6",children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Description"}),t.jsx("p",{className:"text-base text-muted-foreground",children:h.description??"Claude Code skill"})]}),t.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none p-6",children:t.jsx(R,{id:`skill-preview-${i}`,text:h.body})})]});let N;return e[16]!==y?(N=t.jsx("div",{className:T,children:y}),e[16]=y,e[17]=N):N=e[17],t.jsxs(t.Fragment,{children:[j,t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsxs("div",{className:"flex w-[220px] shrink-0 flex-col gap-1 overflow-y-auto border-r border-border bg-muted p-3",children:[b,D.isPending?t.jsx(L,{className:"mx-2 h-4 w-24"}):B.map(m=>{const z=C(m.path)?c===null:k===m.path;return t.jsxs("button",{type:"button",onClick:()=>S(C(m.path)?null:m.path),className:A("flex items-center gap-2.5 rounded-lg px-2 py-1.5 text-left",z?"bg-background shadow-edge":"hover:bg-accent"),children:[t.jsx(J,{filename:E(m.path),className:"h-6 w-5 shrink-0"}),t.jsx("span",{className:A("truncate text-sm",z?"text-foreground":"text-muted-foreground"),children:E(m.path)})]},m.path)})]}),N]})]})}function se(o){return o.kind==="file"}function le(o){return E(o)==="SKILL.md"}function ue(o){const e=M.c(8),{skillPath:i,onClose:r}=o;let l;e[0]!==r?(l=F=>{F||r()},e[0]=r,e[1]=l):l=e[1];let a;e[2]!==r||e[3]!==i?(a=t.jsx(_,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl!",closeButtonClassName:"hidden",children:t.jsx(te,{skillPath:i,onClose:r,variant:"dialog"})}),e[2]=r,e[3]=i,e[4]=a):a=e[4];let n;return e[5]!==l||e[6]!==a?(n=t.jsx(G,{open:!0,onOpenChange:l,children:a}),e[5]=l,e[6]=a,e[7]=n):n=e[7],n}const re={default:{backFrom:"#4D87DF",backTo:"#296FE8",frontFrom:"#72B6FA",frontTo:"#5BB1EF",stripe:"#84CDFB",glyph:"#014AC9"},system:{backFrom:"#8A94A6",backTo:"#6B7687",frontFrom:"#B6BEC9",frontTo:"#A3ADBA",stripe:"#D5DBE3",glyph:"#3D4757"}},oe=[-7,0,7];function ge(o){const e=M.c(50);let i,r,l,a,n;e[0]!==o?({glyph:i,readOnly:l,tone:a,sheets:n,...r}=o,e[0]=o,e[1]=i,e[2]=r,e[3]=l,e[4]=a,e[5]=n):(i=e[1],r=e[2],l=e[3],a=e[4],n=e[5]);const F=a===void 0?"default":a,$=n===void 0?0:n,s=re[F],w=U.useId(),D=`${w}-back`,v=`${w}-front`,P=`url(#${D})`;let x;e[6]!==P?(x=t.jsx("path",{d:"M2.53738 2.55C1.13602 2.55 0 3.68602 0 5.08738V11.535H31.931V7.65326C31.931 6.23616 30.7822 5.08738 29.3651 5.08738H14.7681L13.8775 5.02542C13.3886 4.99141 12.9197 4.81809 12.5261 4.52596L10.7726 3.22419C10.1828 2.78638 9.46784 2.55 8.73334 2.55H2.53738Z",fill:P}),e[6]=P,e[7]=x):x=e[7];let h;e[8]!==$?(h=oe.slice(0,Math.min(Math.max($,0),3)).map(ie),e[8]=$,e[9]=h):h=e[9];const C=`url(#${v})`;let p;e[10]!==C?(p=t.jsx("rect",{y:"8.72",width:"32",height:"21",rx:"2.566",fill:C}),e[10]=C,e[11]=p):p=e[11];let B;e[12]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx("rect",{x:"0.3",y:"8.86",width:"31.4",height:"0.55",rx:"0.275",fill:"#FFFFFF",opacity:"0.25"}),e[12]=B):B=e[12];let k,S;e[13]!==s.stripe?(S=t.jsx("rect",{y:"25.81",width:"32",height:"0.552",fill:s.stripe}),k=t.jsx("rect",{y:"27.05",width:"32",height:"0.552",fill:s.stripe}),e[13]=s.stripe,e[14]=k,e[15]=S):(k=e[14],S=e[15]);let c;e[16]!==i||e[17]!==s.glyph?(c=i&&t.jsx(i,{x:10.5,y:13.2,width:11,height:11,strokeWidth:2.2,style:{color:s.glyph,opacity:.55}}),e[16]=i,e[17]=s.glyph,e[18]=c):c=e[18];let u;e[19]!==l?(u=l&&t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"25.5",cy:"25.5",r:"6.2",strokeWidth:"1",className:"fill-background stroke-border"}),t.jsx(ee,{x:22.1,y:22.1,width:6.8,height:6.8,strokeWidth:2.2,className:"text-muted-foreground"})]}),e[19]=l,e[20]=u):u=e[20];let g;e[21]!==s.backFrom?(g=t.jsx("stop",{offset:"0.3",stopColor:s.backFrom}),e[21]=s.backFrom,e[22]=g):g=e[22];let d;e[23]!==s.backTo?(d=t.jsx("stop",{offset:"1",stopColor:s.backTo}),e[23]=s.backTo,e[24]=d):d=e[24];let f;e[25]!==D||e[26]!==g||e[27]!==d?(f=t.jsxs("linearGradient",{id:D,x1:"15.97",y1:"2.55",x2:"15.97",y2:"9.53",gradientUnits:"userSpaceOnUse",children:[g,d]}),e[25]=D,e[26]=g,e[27]=d,e[28]=f):f=e[28];let j;e[29]!==s.frontFrom?(j=t.jsx("stop",{stopColor:s.frontFrom}),e[29]=s.frontFrom,e[30]=j):j=e[30];let b;e[31]!==s.frontTo?(b=t.jsx("stop",{offset:"1",stopColor:s.frontTo}),e[31]=s.frontTo,e[32]=b):b=e[32];let T;e[33]!==v||e[34]!==j||e[35]!==b?(T=t.jsxs("radialGradient",{id:v,cx:"0",cy:"0",r:"10",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(1.6 0 0 2.1538 16 19.22)",children:[j,b]}),e[33]=v,e[34]=j,e[35]=b,e[36]=T):T=e[36];let y;e[37]!==f||e[38]!==T?(y=t.jsxs("defs",{children:[f,T]}),e[37]=f,e[38]=T,e[39]=y):y=e[39];let N;return e[40]!==r||e[41]!==k||e[42]!==c||e[43]!==u||e[44]!==y||e[45]!==x||e[46]!==h||e[47]!==p||e[48]!==S?(N=t.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...r,children:[x,h,p,B,S,k,c,u,y]}),e[40]=r,e[41]=k,e[42]=c,e[43]=u,e[44]=y,e[45]=x,e[46]=h,e[47]=p,e[48]=S,e[49]=N):N=e[49],N}function ie(o){return t.jsx("rect",{x:"9",y:"3.4",width:"14",height:"12",rx:"1.2",fill:"#F4F6F9",stroke:"#C9D2DC",strokeWidth:"0.7",transform:`rotate(${o} 16 12)`},o)}export{ge as F,ue as S};