@decocms/mesh 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-Cu9USDUK.js → AlertCircle-B8WzALlj.js} +1 -1
- package/dist/client/assets/{ArrowLeft-nKBVB_NL.js → ArrowLeft-SgBR4f-6.js} +1 -1
- package/dist/client/assets/{CheckCircle-BogvGi-0.js → CheckCircle-C3sySS46.js} +1 -1
- package/dist/client/assets/{ChevronDown-B5vWNgW1.js → ChevronDown-BxLZ-BwW.js} +1 -1
- package/dist/client/assets/{Clock-Ck2lYkyl.js → Clock-TIjVIbKP.js} +1 -1
- package/dist/client/assets/{Copy01-BeUF9LPk.js → Copy01-BkbwVIul.js} +1 -1
- package/dist/client/assets/{CpuChip02-8BkRby_U.js → CpuChip02-CC-Dp6F1.js} +1 -1
- package/dist/client/assets/{DotsVertical-CmKPHj4W.js → DotsVertical-DQfGRdit.js} +1 -1
- package/dist/client/assets/{File06-Cn7JLPIx.js → File06-D3j-_l3Y.js} +1 -1
- package/dist/client/assets/{Grid01-4uSGUJjV.js → Grid01-DIRPk51L.js} +1 -1
- package/dist/client/assets/{Inbox01-C8nofD1D.js → Inbox01-BIUwtEav.js} +1 -1
- package/dist/client/assets/{InfoCircle-C21KXVBJ.js → InfoCircle-CFUb6Jpt.js} +1 -1
- package/dist/client/assets/{Key01-CzDrcb2u.js → Key01-B2rq6kEN.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DhNFEAza.js → LinkExternal01-CAkXzUlW.js} +1 -1
- package/dist/client/assets/{Loading01-BUZAT-Ht.js → Loading01-DTFQGF3V.js} +1 -1
- package/dist/client/assets/{Plus-DTWKiMkv.js → Plus-B3CN4dBU.js} +1 -1
- package/dist/client/assets/{SearchMd-BXC4Yoz_.js → SearchMd-BPWxuRkj.js} +1 -1
- package/dist/client/assets/{Trash01-KhsmIXrl.js → Trash01-CH-h89Hr.js} +1 -1
- package/dist/client/assets/{Upload01-Dm3ykMHj.js → Upload01-Ct74PFhX.js} +1 -1
- package/dist/client/assets/{X-BFstV52u.js → X-LeStUghn.js} +1 -1
- package/dist/client/assets/{XClose-OisY7Sog.js → XClose-j18oqVHB.js} +1 -1
- package/dist/client/assets/{alert-dialog-Ck-TQRXx.js → alert-dialog-B2NSkPAP.js} +1 -1
- package/dist/client/assets/{auth-catchall-DDvXFYk4.js → auth-catchall-DMiIJMy0.js} +1 -1
- package/dist/client/assets/{auth-DB_JGgAS.js → auth-kUy_Jrn6.js} +1 -1
- package/dist/client/assets/{avatar-CqnXtnOZ.js → avatar-CaXo-sJU.js} +1 -1
- package/dist/client/assets/{badge-RGvdF-cd.js → badge-BL81A2D9.js} +1 -1
- package/dist/client/assets/{button-Chm7HSn5.js → button-DnyoEVK8.js} +1 -1
- package/dist/client/assets/{card-BVamKRXq.js → card-BcC-l6DX.js} +1 -1
- package/dist/client/assets/{checkbox-BMbqVqRo.js → checkbox-Dpoo4JO-.js} +1 -1
- package/dist/client/assets/collection-detail-B2TvgBcx.js +1 -0
- package/dist/client/assets/{collection-display-button-DDw_0fW6.js → collection-display-button-CA9GlJwg.js} +1 -1
- package/dist/client/assets/{collection-header-BVYMmoel.js → collection-header-B91jkaib.js} +1 -1
- package/dist/client/assets/{collection-page-BoS9hpji.js → collection-page-BtJx-FnI.js} +1 -1
- package/dist/client/assets/{collection-search-CBHWh6W9.js → collection-search-Ds-yN20C.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CGsO_-78.js → collection-table-wrapper-D2RVsbV4.js} +1 -1
- package/dist/client/assets/{connection-card-D6fhK6Cn.js → connection-card-BF8NggDz.js} +1 -1
- package/dist/client/assets/{connection-detail-ClFH3Tdf.js → connection-detail-CayqndPT.js} +1 -1
- package/dist/client/assets/{connections-BtC-4KRY.js → connections-PN9GTsMt.js} +1 -1
- package/dist/client/assets/{core-BiybLldu.js → core-BxxwdZ0l.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-D3ZZuPXS.js → create-organization-dialog-DdsRNcVZ.js} +1 -1
- package/dist/client/assets/{deco-chat-skeleton-DHRag8GN.js → deco-chat-skeleton-BtL4NJKj.js} +9 -9
- package/dist/client/assets/{dialog-kXtxooG_.js → dialog-C_mCXNPn.js} +1 -1
- package/dist/client/assets/{dropdown-menu-MeaPHHuN.js → dropdown-menu-BjXMIWsH.js} +1 -1
- package/dist/client/assets/{error-boundary-m5kquR9K.js → error-boundary-BNRf0Z_d.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BSn-ydRW.js → extract-connection-data-DIxtpeCl.js} +1 -1
- package/dist/client/assets/{form-BBS_Tp5l.js → form-DLD0iUB1.js} +1 -1
- package/dist/client/assets/{formatDistanceToNow-Dkl3nWpl.js → formatDistanceToNow-UOl6UodJ.js} +1 -1
- package/dist/client/assets/{gateway-detail-B6IgcRfH.js → gateway-detail-BM4lyQBI.js} +1 -1
- package/dist/client/assets/{gateways-Bu8MP7ql.js → gateways-D141tE52.js} +1 -1
- package/dist/client/assets/{home-BYCoW2D_.js → home-DnEBQg-P.js} +1 -1
- package/dist/client/assets/{index-RS2MPOun.js → index-9VkcomD8.js} +1 -1
- package/dist/client/assets/{index-C4a1DvcM.js → index-BwIycbkl.js} +2 -2
- package/dist/client/assets/index-CL5fDzg4.css +1 -0
- package/dist/client/assets/{index-hySmljwG.js → index-DKfVknIL.js} +1 -1
- package/dist/client/assets/{index-BZz7aGs7.js → index-DjbPwKVD.js} +1 -1
- package/dist/client/assets/{input-DCV4VviT.js → input-DgJjHSjn.js} +1 -1
- package/dist/client/assets/json-Ddf8NUV6.js +1 -0
- package/dist/client/assets/{json-syntax-highlighter-VMspUwuH.js → json-syntax-highlighter-CLln0bIB.js} +2 -2
- package/dist/client/assets/{layout-BkDVhV_I.js → layout-B9P1Jda-.js} +1 -1
- package/dist/client/assets/{lazy-highlighter-Bx9tA9px.js → lazy-highlighter-CSuBJcB3.js} +1 -1
- package/dist/client/assets/{localstorage-keys-G21128-2.js → localstorage-keys-DMCzgQsw.js} +1 -1
- package/dist/client/assets/{login-DEwqVT25.js → login-D9lqXy5H.js} +1 -1
- package/dist/client/assets/{mcp-oauth-Cm2UNUay.js → mcp-oauth-CZ0mx3dR.js} +1 -1
- package/dist/client/assets/{members-BpGlve-L.js → members-DmlstHz6.js} +1 -1
- package/dist/client/assets/{monitoring-DHEto-A6.js → monitoring-CHBcrHGw.js} +1 -1
- package/dist/client/assets/{oauth-callback-DchNKQy2.js → oauth-callback-CGO4Y9Al.js} +1 -1
- package/dist/client/assets/{page-DGoTXd70.js → page-B5792JFX.js} +1 -1
- package/dist/client/assets/{popover-Cx3pFfUQ.js → popover-CSkaDh07.js} +1 -1
- package/dist/client/assets/prism-light-CAmWzFv1.js +1 -0
- package/dist/client/assets/{resource-tabs-n23Yoxcd.js → resource-tabs-X0PM9BUP.js} +1 -1
- package/dist/client/assets/{schema-DIY49r7a.js → schema-B4_124hK.js} +1 -1
- package/dist/client/assets/{select-BXHiOY7b.js → select-5Rhp6rDg.js} +1 -1
- package/dist/client/assets/{settings-BwVTvZ32.js → settings-CELHD1Jl.js} +1 -1
- package/dist/client/assets/shell-layout-BHBG7prd.js +17 -0
- package/dist/client/assets/{spinner-zi1IadXF.js → spinner-B-1fZDt4.js} +1 -1
- package/dist/client/assets/{store-Bu-y0GHn.js → store-BE-Np0JC.js} +1 -1
- package/dist/client/assets/{store-app-detail-BswrVEFL.js → store-app-detail-M6YUKsa8.js} +1 -1
- package/dist/client/assets/{switch-C8nDXRDi.js → switch-C4e5SzCN.js} +1 -1
- package/dist/client/assets/{textarea-BA6caASm.js → textarea-KAZ9GxmQ.js} +1 -1
- package/dist/client/assets/{tools-list-Cw4QW2l7.js → tools-list-DuXV_F--.js} +1 -1
- package/dist/client/assets/{tooltip-DZ8PMo3S.js → tooltip-BTKqwvT1.js} +1 -1
- package/dist/client/assets/{types-DsEr-_hk.js → types-BtyZOhyu.js} +1 -1
- package/dist/client/assets/{use-binding-C1zXgwae.js → use-binding-C4c5f24x.js} +1 -1
- package/dist/client/assets/{use-connection-8aFd9ZgQ.js → use-connection-BD_e6paU.js} +1 -1
- package/dist/client/assets/{use-connection-resources-BaWWtVSI.js → use-connection-resources-Cmjs97Ft.js} +1 -1
- package/dist/client/assets/{use-gateway-BGsZlt6a.js → use-gateway-BILrrMAQ.js} +1 -1
- package/dist/client/assets/{use-list-state-DhJWwg48.js → use-list-state-Bia1waZw.js} +1 -1
- package/dist/client/assets/{use-mcp-BJzX7M7c.js → use-mcp-DL05pdPY.js} +1 -1
- package/dist/client/assets/{use-members-BNSWYzmJ.js → use-members-PiUY0eRd.js} +1 -1
- package/dist/client/assets/{use-mobile-BQAr1bEF.js → use-mobile-x3HeLt5h.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CAOHB7nk.js → use-organization-settings-BBB0BWnN.js} +1 -1
- package/dist/client/assets/{use-tool-call-Dxebi6Uq.js → use-tool-call-C8wBsNUK.js} +1 -1
- package/dist/client/assets/useQuery-CLGLmvxT.js +1 -0
- package/dist/client/assets/utils-D2xyI3jn.js +1 -0
- package/dist/client/assets/{well-known-mcp-DizRQm94.js → well-known-mcp-DTsHpQm1.js} +1 -1
- package/dist/client/index.html +2 -2
- package/package.json +1 -1
- package/dist/client/assets/collection-detail-UyMhNT0c.js +0 -1
- package/dist/client/assets/index-MyldRbGR.css +0 -1
- package/dist/client/assets/json-CtxcuNHM.js +0 -1
- package/dist/client/assets/prism-light-DhG4KyCm.js +0 -1
- package/dist/client/assets/shell-layout-BqZsnuW0.js +0 -17
- package/dist/client/assets/useQuery-39cprZL6.js +0 -1
- package/dist/client/assets/utils-BXNVuJET.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as $,c as O,j as L,Z as z,q as k,K as x,t as I}from"./index-
|
|
1
|
+
import{r as $,c as O,j as L,Z as z,q as k,K as x,t as I}from"./index-BwIycbkl.js";import{c as N}from"./utils-D2xyI3jn.js";import{u as b}from"./tooltip-BTKqwvT1.js";import{u as j}from"./button-DnyoEVK8.js";const Q=({size:n=24,color:e="currentColor",...r})=>$.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},$.createElement("path",{d:"M20.5 7.278 12 12m0 0L3.5 7.278M12 12v9.5m9-5.441V7.942c0-.343 0-.514-.05-.667a1 1 0 0 0-.215-.364c-.109-.119-.258-.202-.558-.368l-7.4-4.111c-.284-.158-.425-.237-.575-.267a1 1 0 0 0-.403 0c-.15.03-.292.11-.576.267l-7.4 4.11c-.3.167-.45.25-.558.369a1 1 0 0 0-.215.364C3 7.428 3 7.599 3 7.942v8.117c0 .342 0 .514.05.666a1 1 0 0 0 .215.364c.109.119.258.202.558.368l7.4 4.111c.284.158.425.237.576.268.133.027.27.027.402 0 .15-.031.292-.11.576-.268l7.4-4.11c.3-.167.45-.25.558-.369a.999.999 0 0 0 .215-.364c.05-.152.05-.324.05-.666Z"}));Q.displayName="Container";const A={xs:"h-6 w-6",sm:"h-8 w-8",md:"h-12 w-12",lg:"h-16 w-16"},U={xs:"min-w-6",sm:"min-w-8",md:"min-w-12",lg:"min-w-16"},D={xs:12,sm:16,md:24,lg:32};function ne(n){const e=O.c(7),{icon:r,name:t,size:s,className:i,fallbackIcon:o}=n,a=s===void 0?"md":s,c=r??"no-icon";let l;return e[0]!==i||e[1]!==o||e[2]!==r||e[3]!==t||e[4]!==a||e[5]!==c?(l=L.jsx(W,{icon:r,name:t,size:a,className:i,fallbackIcon:o},c),e[0]=i,e[1]=o,e[2]=r,e[3]=t,e[4]=a,e[5]=c,e[6]=l):l=e[6],l}function W(n){const e=O.c(24),{icon:r,name:t,size:s,className:i,fallbackIcon:o}=n,a=s===void 0?"md":s,[c,l]=$.useState(!1),u=!!r&&c,f=A[a],p=U[a];let w;e[0]!==i||e[1]!==f||e[2]!==p?(w=N("rounded-lg border border-border shrink-0 overflow-hidden",f,p,i),e[0]=i,e[1]=f,e[2]=p,e[3]=w):w=e[3];const h=r||void 0,g=!u&&"hidden";let E;e[4]!==g?(E=N("h-full w-full object-cover",g),e[4]=g,e[5]=E):E=e[5];let T,S;e[6]===Symbol.for("react.memo_cache_sentinel")?(T=()=>l(!1),S=()=>l(!0),e[6]=T,e[7]=S):(T=e[6],S=e[7]);let d;e[8]!==t||e[9]!==h||e[10]!==E?(d=L.jsx("img",{src:h,alt:t,className:E,onError:T,onLoad:S}),e[8]=t,e[9]=h,e[10]=E,e[11]=d):d=e[11];const v=u&&"hidden";let y;e[12]!==v?(y=N("h-full w-full flex items-center justify-center bg-muted/20",v),e[12]=v,e[13]=y):y=e[13];let C;e[14]!==o||e[15]!==a?(C=o??L.jsx(Q,{size:D[a],className:"text-muted-foreground"}),e[14]=o,e[15]=a,e[16]=C):C=e[16];let m;e[17]!==y||e[18]!==C?(m=L.jsx("div",{className:y,children:C}),e[17]=y,e[18]=C,e[19]=m):m=e[19];let _;return e[20]!==d||e[21]!==m||e[22]!==w?(_=L.jsxs("div",{className:w,children:[d,m]}),e[20]=d,e[21]=m,e[22]=w,e[23]=_):_=e[23],_}const B="UNKNOWN_CONNECTION_ID",J=async n=>{const r=(await n.text()).split(`
|
|
2
2
|
`).find(s=>s.startsWith("data: "));if(!r)throw new Error("No data received from the server");return JSON.parse(r.replace("data: ",""))};function q(n){if(n===B)return(async()=>{});const e=n?`/mcp/${n}`:"/mcp";return async(r,t)=>{const s=await fetch(e,{method:"POST",body:JSON.stringify({jsonrpc:"2.0",id:1,method:"tools/call",params:{name:r,arguments:t}}),headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream"},credentials:"include"});if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);const i=s.headers.get("Content-Type")==="application/json"?await s.json():await J(s);if(i.result?.isError)throw new Error(i.result.content?.[0]?.text||"Tool call failed");return i.result?.structuredContent||i.result}}function M(n,e,r){const t=[];if(n?.trim()){const s=n.trim(),i=r.map(o=>({field:[String(o)],operator:"contains",value:s}));i.length===1&&i[0]?t.push(i[0]):i.length>1&&t.push({operator:"or",conditions:i})}if(e&&e.length>0)for(const s of e)t.push({field:[s.column],operator:"eq",value:s.value});if(t.length!==0)return t.length===1?t[0]:{operator:"and",conditions:t}}function R(n,e,r){const t=n??r,s=e??"asc";return[{field:[String(t)],direction:s}]}function Z(n,e,r,t){const s=O.c(13);let i;s[0]!==e?(i=e.toUpperCase(),s[0]=e,s[1]=i):i=s[1];const a=`COLLECTION_${i}_GET`;let c;s[2]!==e||s[3]!==r||s[4]!==n?(c=x.collectionItem(n,e,r??""),s[2]=e,s[3]=r,s[4]=n,s[5]=c):c=s[5];let l;s[6]!==a||s[7]!==r||s[8]!==t?(l=async()=>r?await t(a,{id:r}):{item:null},s[6]=a,s[7]=r,s[8]=t,s[9]=l):l=s[9];let u;s[10]!==c||s[11]!==l?(u={queryKey:c,queryFn:l,staleTime:6e4},s[10]=c,s[11]=l,s[12]=u):u=s[12];const{data:f}=k(u);return f.item}function H(n,e,r,t){const s=O.c(20);let i,o,a,c,l,u;if(s[0]!==e||s[1]!==n||s[2]!==t){const h=t===void 0?{}:t,{searchTerm:g,filters:E,sortKey:T,sortDirection:S,searchFields:d,defaultSortKey:v,pageSize:y}=h,C=d===void 0?["title","description"]:d,m=v===void 0?"updated_at":v;a=y===void 0?100:y;let _;s[9]!==e?(_=e.toUpperCase(),s[9]=e,s[10]=_):_=s[10],i=`COLLECTION_${_}_LIST`,u=M(g,E,C),o=R(T,S,m);const P=JSON.stringify({where:u,orderBy:o,limit:a});l=k,c=x.collectionList(n,e,P),s[0]=e,s[1]=n,s[2]=t,s[3]=i,s[4]=o,s[5]=a,s[6]=c,s[7]=l,s[8]=u}else i=s[3],o=s[4],a=s[5],c=s[6],l=s[7],u=s[8];let f;s[11]!==i||s[12]!==o||s[13]!==a||s[14]!==r||s[15]!==u?(f=async()=>{const h={...u&&{where:u},...o&&{orderBy:o},limit:a,offset:0};return await r(i,h)??[]},s[11]=i,s[12]=o,s[13]=a,s[14]=r,s[15]=u,s[16]=f):f=s[16];let p;s[17]!==c||s[18]!==f?(p={queryKey:c,queryFn:f},s[17]=c,s[18]=f,s[19]=p):p=s[19];const{data:w}=l(p);return w.items}function G(n,e,r){const t=O.c(36),s=z();let i;t[0]!==e?(i=e.toUpperCase(),t[0]=e,t[1]=i):i=t[1];const o=i,a=`COLLECTION_${o}_CREATE`,c=`COLLECTION_${o}_UPDATE`,l=`COLLECTION_${o}_DELETE`;let u;t[2]!==a||t[3]!==r?(u=async m=>(await r(a,{data:m})).item,t[2]=a,t[3]=r,t[4]=u):u=t[4];let f;t[5]!==e||t[6]!==s||t[7]!==n?(f=()=>{s.invalidateQueries({queryKey:x.collectionListPrefix(n,e)}),s.invalidateQueries({queryKey:x.collectionListInfinitePrefix(n,e)}),I.success("Item created successfully")},t[5]=e,t[6]=s,t[7]=n,t[8]=f):f=t[8];let p;t[9]!==u||t[10]!==f?(p={mutationFn:u,onSuccess:f,onError:Y},t[9]=u,t[10]=f,t[11]=p):p=t[11];const w=j(p);let h;t[12]!==r||t[13]!==c?(h=async m=>{const{id:_,data:F}=m;return(await r(c,{id:_,data:F})).item},t[12]=r,t[13]=c,t[14]=h):h=t[14];let g;t[15]!==e||t[16]!==s||t[17]!==n?(g=m=>{s.invalidateQueries({queryKey:x.collectionListPrefix(n,e)}),s.invalidateQueries({queryKey:x.collectionListInfinitePrefix(n,e)}),s.invalidateQueries({queryKey:x.collectionItem(n,e,m.id)}),I.success("Item updated successfully")},t[15]=e,t[16]=s,t[17]=n,t[18]=g):g=t[18];let E;t[19]!==h||t[20]!==g?(E={mutationFn:h,onSuccess:g,onError:V},t[19]=h,t[20]=g,t[21]=E):E=t[21];const T=j(E);let S;t[22]!==l||t[23]!==r?(S=async m=>(await r(l,{id:m})).item.id,t[22]=l,t[23]=r,t[24]=S):S=t[24];let d;t[25]!==e||t[26]!==s||t[27]!==n?(d=()=>{s.invalidateQueries({queryKey:x.collectionListPrefix(n,e)}),s.invalidateQueries({queryKey:x.collectionListInfinitePrefix(n,e)}),I.success("Item deleted successfully")},t[25]=e,t[26]=s,t[27]=n,t[28]=d):d=t[28];let v;t[29]!==S||t[30]!==d?(v={mutationFn:S,onSuccess:d,onError:K},t[29]=S,t[30]=d,t[31]=v):v=t[31];const y=j(v);let C;return t[32]!==w||t[33]!==y||t[34]!==T?(C={create:w,update:T,delete:y},t[32]=w,t[33]=y,t[34]=T,t[35]=C):C=t[35],C}function K(n){const e=n instanceof Error?n.message:String(n);I.error(`Failed to delete item: ${e}`)}function V(n){const e=n instanceof Error?n.message:String(n);I.error(`Failed to update item: ${e}`)}function Y(n){const e=n instanceof Error?n.message:String(n);I.error(`Failed to create item: ${e}`)}function re(n){const e=O.c(3);let r;e[0]!==n?(r=n===void 0?{}:n,e[0]=n,e[1]=r):r=e[1];const t=r,{org:s}=b();let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=q(),e[2]=i):i=e[2];const o=i;return H(s.slug,"CONNECTIONS",o,t)}function ie(n){const e=O.c(1),{org:r}=b();let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=q(),e[0]=t):t=e[0];const s=t;return Z(r.slug,"CONNECTIONS",n,s)}function oe(){const n=O.c(1),{org:e}=b();let r;n[0]===Symbol.for("react.memo_cache_sentinel")?(r=q(),n[0]=r):r=n[0];const t=r;return G(e.slug,"CONNECTIONS",t)}export{ne as I,B as U,oe as a,ie as b,q as c,G as d,H as e,Z as f,Q as n,re as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,K as l}from"./index-
|
|
1
|
+
import{c as f,K as l}from"./index-BwIycbkl.js";import{u as y}from"./formatDistanceToNow-UOl6UodJ.js";async function h(t){const e=`/mcp/${t}`,s={"Content-Type":"application/json",Accept:"application/json, text/event-stream"};try{const o=await fetch(e,{method:"POST",headers:s,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"mesh-prompts",version:"1.0.0"}}})});if(!o.ok)return[];if((await o.json()).error)return[];const i=await fetch(e,{method:"POST",headers:s,body:JSON.stringify({jsonrpc:"2.0",id:2,method:"prompts/list",params:{}})});if(!i.ok)return[];const r=await i.json();return r.error?[]:r.result?.prompts||[]}catch{return[]}}function P(t){const e=f.c(13);let s;e[0]!==t?(s=t.map(q),e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s?(o={queries:s},e[2]=s,e[3]=o):o=e[3];const n=y(o);let i,r;if(e[4]!==t||e[5]!==n){r=new Map;let p;e[8]!==n?(p=n.some(j),e[8]=n,e[9]=p):p=e[9],i=p,t.forEach((u,m)=>{const c=n[m];c?.data?r.set(u,c.data.map(d)):r.set(u,[])}),e[4]=t,e[5]=n,e[6]=i,e[7]=r}else i=e[6],r=e[7];let a;return e[10]!==i||e[11]!==r?(a={promptsMap:r,isLoading:i},e[10]=i,e[11]=r,e[12]=a):a=e[12],a}function d(t){return{name:t.name,description:t.description}}function j(t){return t.isLoading}function q(t){return{queryKey:l.connectionPrompts(t),queryFn:()=>h(t),staleTime:6e4,retry:!1}}async function w(t){const e=`/mcp/${t}`,s={"Content-Type":"application/json",Accept:"application/json, text/event-stream"};try{const o=await fetch(e,{method:"POST",headers:s,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"mesh-resources",version:"1.0.0"}}})});if(!o.ok)return[];if((await o.json()).error)return[];const i=await fetch(e,{method:"POST",headers:s,body:JSON.stringify({jsonrpc:"2.0",id:2,method:"resources/list",params:{}})});if(!i.ok)return[];const r=await i.json();return r.error?[]:r.result?.resources||[]}catch{return[]}}function $(t){const e=f.c(13);let s;e[0]!==t?(s=t.map(O),e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s?(o={queries:s},e[2]=s,e[3]=o):o=e[3];const n=y(o);let i,r;if(e[4]!==t||e[5]!==n){r=new Map;let p;e[8]!==n?(p=n.some(g),e[8]=n,e[9]=p):p=e[9],i=p,t.forEach((u,m)=>{const c=n[m];c?.data?r.set(u,c.data.map(S)):r.set(u,[])}),e[4]=t,e[5]=n,e[6]=i,e[7]=r}else i=e[6],r=e[7];let a;return e[10]!==i||e[11]!==r?(a={resourcesMap:r,isLoading:i},e[10]=i,e[11]=r,e[12]=a):a=e[12],a}function S(t){return{uri:t.uri,name:t.name,description:t.description}}function g(t){return t.isLoading}function O(t){return{queryKey:l.connectionResources(t),queryFn:()=>w(t),staleTime:6e4,retry:!1}}export{$ as a,P as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n}from"./index-
|
|
1
|
+
import{c as n}from"./index-BwIycbkl.js";import{e as u,d as m,f,c as r}from"./use-connection-BD_e6paU.js";import{u as a}from"./tooltip-BTKqwvT1.js";function g(t){const e=n.c(3);let o;e[0]!==t?(o=t===void 0?{}:t,e[0]=t,e[1]=o):o=e[1];const s=o,{org:c}=a();let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=r(),e[2]=l):l=e[2];const i=l;return u(c.slug,"GATEWAY",i,s)}function y(t){const e=n.c(1),{org:o}=a();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=r(),e[0]=s):s=e[0];const c=s;return f(o.slug,"GATEWAY",t,c)}function G(){const t=n.c(1),{org:e}=a();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=r(),t[0]=o):o=t[0];const s=o;return m(e.slug,"GATEWAY",s)}export{G as a,y as b,g as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,c as T}from"./index-
|
|
1
|
+
import{r as a,c as T}from"./index-BwIycbkl.js";import{u as D}from"./use-mobile-x3HeLt5h.js";const W=({size:l=24,color:e="currentColor",...t})=>a.createElement("svg",{viewBox:"0 0 24 24",width:l,height:l,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},a.createElement("path",{d:"M2.42 12.713c-.136-.215-.204-.323-.242-.49a1.173 1.173 0 0 1 0-.446c.038-.167.106-.274.242-.49C3.546 9.505 6.895 5 12 5s8.455 4.505 9.58 6.287c.137.215.205.323.243.49.029.125.029.322 0 .446-.038.167-.106.274-.242.49C20.455 14.495 17.105 19 12 19c-5.106 0-8.455-4.505-9.58-6.287Z"}),a.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}));W.displayName="Eye";function k(l){const e=`deco-filters-${l}`,[t,c]=a.useState(()=>{try{const o=globalThis.localStorage?.getItem(e);if(o)return JSON.parse(o)}catch(o){console.error("Failed to parse stored filters:",o)}return[]});return[t,o=>{c(o);try{globalThis.localStorage?.setItem(e,JSON.stringify(o))}catch(i){console.error("Failed to save filters:",i)}}]}function C(l){const e=T.c(7),[t,c]=a.useState(l),[s,o]=a.useState(l?"desc":null);let i;e[0]!==s||e[1]!==t?(i=h=>{t!==h?(c(h),o("asc")):s==="asc"?o("desc"):s==="desc"&&(c(void 0),o(null))},e[0]=s,e[1]=t,e[2]=i):i=e[2];const u=i;let r;return e[3]!==u||e[4]!==s||e[5]!==t?(r={sortKey:t,sortDirection:s,handleSort:u},e[3]=u,e[4]=s,e[5]=t,e[6]=r):r=e[6],r}function L(l,e){const t=T.c(12),c=e===void 0?"cards":e,s=D(),o=a.useRef(s),i=l?`deco-view-mode-${l}`:"deco-view-mode";let u;t[0]!==c||t[1]!==i?(u=()=>{const d=globalThis.localStorage?.getItem(i);return d==="cards"||d==="table"?d:c},t[0]=c,t[1]=i,t[2]=u):u=t[2];const[r,h]=a.useState(u);let f;t[3]!==i?(f=d=>{h(d),globalThis.localStorage?.setItem(i,d)},t[3]=i,t[4]=f):f=t[4];const p=f;let S,g;t[5]!==s||t[6]!==r?(S=()=>{!o.current&&s&&r==="table"&&h("cards"),o.current=s},g=[s,r],t[5]=s,t[6]=r,t[7]=S,t[8]=g):(S=t[7],g=t[8]),a.useEffect(S,g);let n;return t[9]!==p||t[10]!==r?(n=[r,p],t[9]=p,t[10]=r,t[11]=n):n=t[11],n}function O(l){const e=T.c(20),{namespace:t,resource:c,defaultSortKey:s,defaultViewMode:o}=l,i=s===void 0?"title":s,u=o===void 0?"table":o,[r,h]=a.useState(""),f=a.useDeferredValue(r),p=`${t}-${c}`,[S,g]=k(p),n=`mesh-${c}-filter-visible-${t}`;let d;e[0]!==n?(d=()=>globalThis.localStorage?.getItem(n)==="true",e[0]=n,e[1]=d):d=e[1];const[m,B]=a.useState(d);let y;e[2]!==n?(y=I=>{B(I),globalThis.localStorage?.setItem(n,String(I))},e[2]=n,e[3]=y):y=e[3];const b=y;let M;e[4]!==m||e[5]!==b?(M=()=>{b(!m)},e[4]=m,e[5]=b,e[6]=M):M=e[6];const w=M,[V,$]=L(`mesh-${c}-${t}`,u),{sortKey:x,sortDirection:F,handleSort:K}=C(i),E=x;let v;return e[7]!==m||e[8]!==S||e[9]!==K||e[10]!==r||e[11]!==f||e[12]!==b||e[13]!==g||e[14]!==$||e[15]!==F||e[16]!==E||e[17]!==w||e[18]!==V?(v={search:r,searchTerm:f,setSearch:h,filters:S,setFilters:g,filterBarVisible:m,setFilterBarVisible:b,toggleFilterBar:w,viewMode:V,setViewMode:$,sortKey:E,sortDirection:F,handleSort:K},e[7]=m,e[8]=S,e[9]=K,e[10]=r,e[11]=f,e[12]=b,e[13]=g,e[14]=$,e[15]=F,e[16]=E,e[17]=w,e[18]=V,e[19]=v):v=e[19],v}export{W as s,O as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as E,K as b}from"./index-
|
|
1
|
+
import{c as E,K as b}from"./index-BwIycbkl.js";import{u as j}from"./useQuery-CLGLmvxT.js";function T(g){const e=E.c(18),{url:o,token:r,enabled:w}=g,$=w===void 0?!0:w;let i;e[0]!==r||e[1]!==o?(i=b.mcpTools(o,r),e[0]=r,e[1]=o,e[2]=i):i=e[2];let s;e[3]!==r||e[4]!==o?(s=async()=>{if(!o)return[];const m={"Content-Type":"application/json",Accept:"application/json, text/event-stream"};r&&(m.Authorization=`Bearer ${r}`);const u=await fetch(o,{method:"POST",headers:m,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"mesh-mcp",version:"1.0.0"}}})});if(!u.ok)throw new Error(`MCP initialization failed: ${u.status}`);const h=await u.json();if(h.error)throw new Error(`MCP initialization error: ${h.error.message} (code: ${h.error.code})`);const y=await fetch(o,{method:"POST",headers:m,body:JSON.stringify({jsonrpc:"2.0",id:2,method:"tools/list",params:{}})});if(!y.ok)throw new Error(`Failed to list tools: ${y.status}`);const l=await y.json();if(l.error)throw new Error(`Failed to list tools: ${l.error.message} (code: ${l.error.code})`);return l.result?.tools||[]},e[3]=r,e[4]=o,e[5]=s):s=e[5];const d=$&&!!o;let a;e[6]!==i||e[7]!==s||e[8]!==d?(a={queryKey:i,queryFn:s,enabled:d,staleTime:3e4,retry:!1},e[6]=i,e[7]=s,e[8]=d,e[9]=a):a=e[9];const t=j(a),f=o?t.isLoading?"connecting":t.isError?"error":"ready":"disconnected";let n;e[10]!==t.data?(n=t.data||[],e[10]=t.data,e[11]=n):n=e[11];const p=t.error;let c;return e[12]!==t.isLoading||e[13]!==t.refetch||e[14]!==f||e[15]!==n||e[16]!==p?(c={tools:n,state:f,error:p,isLoading:t.isLoading,refetch:t.refetch},e[12]=t.isLoading,e[13]=t.refetch,e[14]=f,e[15]=n,e[16]=p,e[17]=c):c=e[17],c}export{T as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as o,q as n,K as u,a as i}from"./index-
|
|
1
|
+
import{c as o,q as n,K as u,a as i}from"./index-BwIycbkl.js";import{u as a}from"./tooltip-BTKqwvT1.js";function p(){const e=o.c(4),{locator:s}=a();let t;e[0]!==s?(t=u.members(s),e[0]=s,e[1]=t):t=e[1];let r;return e[2]!==t?(r={queryKey:t,queryFn:m},e[2]=t,e[3]=r):r=e[3],n(r)}function m(){return i.organization.listMembers()}export{p as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as m,r}from"./index-
|
|
1
|
+
import{c as m,r}from"./index-BwIycbkl.js";const a=768,o=()=>globalThis.innerWidth<a;function u(){const e=m.c(2),[l,n]=r.useState(o);let t,s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{const i=()=>n(o),c=globalThis.matchMedia(`(max-width: ${a-1}px)`);return c.addEventListener("change",i),n(o),()=>c.removeEventListener("change",i)},s=[],e[0]=t,e[1]=s):(t=e[0],s=e[1]),r.useEffect(t,s),l}export{u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as o,q as y,Z as T,K as f}from"./index-
|
|
1
|
+
import{c as o,q as y,Z as T,K as f}from"./index-BwIycbkl.js";import{u as p}from"./button-DnyoEVK8.js";import{c as m}from"./use-connection-BD_e6paU.js";function N(t){const e=o.c(8);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=m(),e[0]=n):n=e[0];const c=n;let r;e[1]!==t?(r=f.organizationSettings(t),e[1]=t,e[2]=r):r=e[2];let s;e[3]!==t?(s=async()=>{const u=await c("ORGANIZATION_SETTINGS_GET",{});return u||{organizationId:t,sidebar_items:null,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}},e[3]=t,e[4]=s):s=e[4];let l;e[5]!==r||e[6]!==s?(l={queryKey:r,queryFn:s,staleTime:6e4},e[5]=r,e[6]=s,e[7]=l):l=e[7];const{data:i}=y(l);return i}function q(t){const e=o.c(11),n=T();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=m(),e[0]=c):c=e[0];const r=c;let s;e[1]!==t?(s=async S=>await r("ORGANIZATION_SETTINGS_UPDATE",{organizationId:t,...S}),e[1]=t,e[2]=s):s=e[2];let l;e[3]!==t||e[4]!==n?(l=()=>{n.invalidateQueries({queryKey:f.organizationSettings(t)})},e[3]=t,e[4]=n,e[5]=l):l=e[5];let i;e[6]!==s||e[7]!==l?(i={mutationFn:s,onSuccess:l},e[6]=s,e[7]=l,e[8]=i):i=e[8];const u=p(i);let a;return e[9]!==u?(a={update:u},e[9]=u,e[10]=a):a=e[10],a}export{q as a,N as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,q,K}from"./index-
|
|
1
|
+
import{c as f,q,K}from"./index-BwIycbkl.js";function S(p){const e=f.c(23);let s,o,r,t,l;e[0]!==p?({toolCaller:r,toolName:l,toolInputParams:t,scope:o,...s}=p,e[0]=p,e[1]=s,e[2]=o,e[3]=r,e[4]=t,e[5]=l):(s=e[1],o=e[2],r=e[3],t=e[4],l=e[5]);let a,u,i,c;if(e[6]!==s||e[7]!==o||e[8]!==t||e[9]!==l){const y=JSON.stringify(t);c=q,a=s,u=s.staleTime??6e4,i=K.toolCall(o,l,y),e[6]=s,e[7]=o,e[8]=t,e[9]=l,e[10]=a,e[11]=u,e[12]=i,e[13]=c}else a=e[10],u=e[11],i=e[12],c=e[13];let n;e[14]!==r||e[15]!==t||e[16]!==l?(n=async()=>await r(l,t),e[14]=r,e[15]=t,e[16]=l,e[17]=n):n=e[17];let m;return e[18]!==a||e[19]!==u||e[20]!==i||e[21]!==n?(m={...a,staleTime:u,queryKey:i,queryFn:n},e[18]=a,e[19]=u,e[20]=i,e[21]=n,e[22]=m):m=e[22],c(m)}export{S as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{at as u,ap as s}from"./index-BwIycbkl.js";function t(e,r){return u(e,s,r)}export{t as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{be as e,V as t}from"./index-BwIycbkl.js";function n(...r){return e(t(r))}export{n as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n}from"./index-
|
|
1
|
+
import{r as n}from"./index-BwIycbkl.js";const i=({size:e=24,color:o="currentColor",...c})=>n.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:o,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...c},n.createElement("path",{d:"M17 10V8A5 5 0 0 0 7 8v2m5 4.5v2M8.8 21h6.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C20 18.72 20 17.88 20 16.2v-1.4c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C17.72 10 16.88 10 15.2 10H8.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C4 12.28 4 13.12 4 14.8v1.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C6.28 21 7.12 21 8.8 21Z"}));i.displayName="Lock01";const t={SELF:"self",REGISTRY:"registry",COMMUNITY_REGISTRY:"community-registry"},r={SELF:e=>`${e}_${t.SELF}`,REGISTRY:e=>`${e}_${t.REGISTRY}`,COMMUNITY_REGISTRY:e=>`${e}_${t.COMMUNITY_REGISTRY}`};function a(e){return{id:r.REGISTRY(e),title:"Deco Store",description:"Official deco MCP registry with curated integrations",connection_type:"HTTP",connection_url:"https://api.decocms.com/mcp/registry",icon:"https://assets.decocache.com/decocms/00ccf6c3-9e13-4517-83b0-75ab84554bb9/596364c63320075ca58483660156b6d9de9b526e.png",app_name:"deco-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function l(){return{id:t.COMMUNITY_REGISTRY,title:"MCP Registry",description:"Community MCP registry with thousands of handy MCPs",connection_type:"HTTP",connection_url:"https://sites-registry.decocache.com/mcp",icon:"https://assets.decocache.com/decocms/cd7ca472-0f72-463a-b0de-6e44bdd0f9b4/mcp.png",app_name:"mcp-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}export{t as W,l as a,a as g,i};
|
package/dist/client/index.html
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<title>MCP Mesh</title>
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
6
|
-
<script type="module" crossorigin src="/assets/index-
|
|
7
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
6
|
+
<script type="module" crossorigin src="/assets/index-BwIycbkl.js"></script>
|
|
7
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CL5fDzg4.css">
|
|
8
8
|
</head>
|
|
9
9
|
<body>
|
|
10
10
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as I,c as P,d as Q,j as t,av as ie,x as Ne,y as ue,v as ye,w as le,h as we,b as Se,t as Ce}from"./index-C4a1DvcM.js";import{U as V,f as fe,d as ce,c as ne,b as xe,I as ke,n as Ie}from"./use-connection-8aFd9ZgQ.js";import{d as _e,C as H,e as $e,I as Ee,k as me,G as Te,M as Ae}from"./deco-chat-skeleton-DHRag8GN.js";import{E as oe}from"./SearchMd-BXC4Yoz_.js";import{E as Y}from"./error-boundary-m5kquR9K.js";import{u as ze,L as Me}from"./localstorage-keys-G21128-2.js";import{u as Pe,a as Oe,c as Be,b as De,T as Fe}from"./tooltip-DZ8PMo3S.js";import{B as W}from"./button-Chm7HSn5.js";import{F as R,a as he,b as J,c as X,d as Z}from"./form-BBS_Tp5l.js";import{I as ee}from"./input-DCV4VviT.js";import{T as te}from"./textarea-BA6caASm.js";import{c as K}from"./utils-BXNVuJET.js";import{A as Le}from"./use-binding-C1zXgwae.js";import{i as G}from"./Loading01-BUZAT-Ht.js";import{s as Re}from"./Plus-DTWKiMkv.js";import{i as Ue}from"./Upload01-Dm3ykMHj.js";import{V as de,b as se,a as pe}from"./layout-BkDVhV_I.js";import{i as Ve}from"./AlertCircle-Cu9USDUK.js";import{s as Je}from"./Clock-Ck2lYkyl.js";import{a as We}from"./Copy01-BeUF9LPk.js";import{i as Ge,J as qe}from"./json-syntax-highlighter-VMspUwuH.js";import{s as He}from"./XClose-OisY7Sog.js";import{u as Ke,O as Ze,M as Ye,P as Qe,E as Xe}from"./index-BZz7aGs7.js";import{u as et}from"./use-mcp-BJzX7M7c.js";import"./Grid01-4uSGUJjV.js";import"./CpuChip02-8BkRby_U.js";import"./select-BXHiOY7b.js";import"./ChevronDown-B5vWNgW1.js";import"./use-mobile-BQAr1bEF.js";import"./use-gateway-BGsZlt6a.js";import"./connection-card-D6fhK6Cn.js";import"./card-BVamKRXq.js";import"./LinkExternal01-DhNFEAza.js";import"./spinner-zi1IadXF.js";import"./File06-Cn7JLPIx.js";import"./InfoCircle-C21KXVBJ.js";import"./useQuery-39cprZL6.js";import"./auth-DB_JGgAS.js";import"./ArrowLeft-nKBVB_NL.js";import"./mcp-oauth-Cm2UNUay.js";import"./use-organization-settings-CAOHB7nk.js";import"./use-tool-call-Dxebi6Uq.js";import"./Key01-CzDrcb2u.js";import"./formatDistanceToNow-Dkl3nWpl.js";import"./extract-connection-data-BSn-ydRW.js";import"./registry-utils-ulDDT0d8.js";import"./generate-id-Dyweu44Y.js";import"./index-hySmljwG.js";import"./index-RS2MPOun.js";import"./schema-DIY49r7a.js";const ge=({size:s=24,color:e="currentColor",...n})=>I.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},I.createElement("path",{d:"M20.5 8v8.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.22 21 17.38 21 15.7 21H8.3c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3.5 18.72 3.5 17.88 3.5 16.2V8m.1-5h16.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C22 3.76 22 4.04 22 4.6v1.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C21.24 8 20.96 8 20.4 8H3.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C2 7.24 2 6.96 2 6.4V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C2.76 3 3.04 3 3.6 3Zm6 8.5h4.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C16 12.26 16 12.54 16 13.1v.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437c-.214.109-.494.109-1.054.109H9.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C8 14.74 8 14.46 8 13.9v-.8c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C8.76 11.5 9.04 11.5 9.6 11.5Z"}));ge.displayName="Box";const je=({size:s=24,color:e="currentColor",...n})=>I.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},I.createElement("path",{d:"m16 18 6-6-6-6M8 6l-6 6 6 6"}));je.displayName="Code01";const ve=({size:s=24,color:e="currentColor",...n})=>I.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},I.createElement("path",{d:"M21 5c0 1.657-4.03 3-9 3S3 6.657 3 5m18 0c0-1.657-4.03-3-9-3S3 3.343 3 5m18 0v14c0 1.66-4 3-9 3s-9-1.34-9-3V5m18 7c0 1.66-4 3-9 3s-9-1.34-9-3"}));ve.displayName="Database01";const be=({size:s=24,color:e="currentColor",...n})=>I.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},I.createElement("path",{d:"M11 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 6.28 2 7.12 2 8.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 22 5.12 22 6.8 22h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C20 19.72 20 18.88 20 17.2V13M8 16h1.675c.489 0 .733 0 .963-.055.204-.05.4-.13.579-.24.201-.123.374-.296.72-.642L21.5 5.5a2.121 2.121 0 0 0-3-3l-9.563 9.563c-.346.346-.519.519-.642.72a2 2 0 0 0-.24.579c-.055.23-.055.474-.055.963V16Z"}));be.displayName="Edit05";const re=({size:s=24,color:e="currentColor",...n})=>I.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},I.createElement("path",{d:"M16 3.468a4.5 4.5 0 0 1 0 8.064m2 5.234c1.512.684 2.872 1.799 4 3.234M2 20c1.946-2.477 4.59-4 7.5-4s5.553 1.523 7.5 4M14 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));re.displayName="Users02";function tt(s){const e=P.c(3),{gatewayId:n,onSelect:r}=s,{data:o}=$e(n);if(o.length===0)return null;let l;return e[0]!==r||e[1]!==o?(l=t.jsx(Ee,{prompts:o,onSelect:r,className:"mt-6"}),e[0]=r,e[1]=o,e[2]=l):l=e[2],l}function st(s){const e=P.c(20),{form:n}=s;let r;e[0]!==n?(r=p=>{const{field:g}=p;return t.jsx(dt,{size:"md",value:g.value,onChange:g.onChange,alt:n.watch("title")})},e[0]=n,e[1]=r):r=e[1];let o;e[2]!==n.control||e[3]!==r?(o=t.jsx(R,{control:n.control,name:"avatar",render:r}),e[2]=n.control,e[3]=r,e[4]=o):o=e[4];let l;e[5]!==n.control?(l=t.jsxs("div",{className:"flex flex-col gap-3 flex-1 min-w-0",children:[t.jsx(R,{control:n.control,name:"title",render:at}),t.jsx(R,{control:n.control,name:"description",render:lt})]}),e[5]=n.control,e[6]=l):l=e[6];let a;e[7]!==o||e[8]!==l?(a=t.jsxs("div",{className:"flex gap-4 items-start",children:[o,l]}),e[7]=o,e[8]=l,e[9]=a):a=e[9];let i,c;e[10]!==n.control?(i=t.jsxs("div",{className:"flex gap-4",children:[t.jsx(R,{control:n.control,name:"gateway_id",render:rt}),t.jsx(R,{control:n.control,name:"model",render:ot})]}),c=t.jsx(R,{control:n.control,name:"system_prompt",render:nt}),e[10]=n.control,e[11]=i,e[12]=c):(i=e[11],c=e[12]);let m;e[13]!==a||e[14]!==i||e[15]!==c?(m=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-2xl mx-auto w-full min-w-0 gap-6 overflow-y-auto",children:[a,i,c]}),e[13]=a,e[14]=i,e[15]=c,e[16]=m):m=e[16];let f;return e[17]!==n||e[18]!==m?(f=t.jsx(he,{...n,children:m}),e[17]=n,e[18]=m,e[19]=f):f=e[19],f}function nt(s){const{field:e}=s;return t.jsxs(J,{className:"flex-1 flex flex-col min-h-0",children:[t.jsx(X,{className:"text-xs text-muted-foreground",children:"System prompt"}),t.jsx(Z,{children:t.jsx(te,{...e,placeholder:"You are a helpful assistant...",className:"flex-1 min-h-[200px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})]})}function ot(s){const{field:e}=s;return t.jsxs(J,{className:"flex-1",children:[t.jsx(X,{className:"text-xs text-muted-foreground",children:"Model"}),t.jsx(Ae,{selectedModel:e.value?{id:e.value.id,connectionId:e.value.connectionId}:void 0,onModelChange:n=>e.onChange({id:n.id,connectionId:n.connectionId}),placeholder:"Select model",variant:"bordered",className:"w-full"})]})}function rt(s){const{field:e}=s;return t.jsxs(J,{className:"flex-1",children:[t.jsx(X,{className:"text-xs text-muted-foreground",children:"Gateway"}),t.jsx(Te,{selectedGatewayId:e.value,onGatewayChange:e.onChange,placeholder:"Select gateway",variant:"bordered",className:"w-full"})]})}function lt(s){const{field:e}=s;return t.jsxs(J,{children:[t.jsx(X,{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(Z,{children:t.jsx(ee,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function at(s){const{field:e}=s;return t.jsxs(J,{children:[t.jsx(X,{className:"text-xs text-muted-foreground",children:"Name"}),t.jsx(Z,{children:t.jsx(ee,{...e,placeholder:"Untitled assistant",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function it(s){const e=P.c(62),{activeThreadId:n,mode:r,assistant:o,form:l}=s;let a;e[0]!==n||e[1]!==o.system_prompt?(a={threadId:n,systemPrompt:o.system_prompt},e[0]=n,e[1]=o.system_prompt,e[2]=a):a=e[2];const i=_e(a),c=!!o.gateway_id&&!!o.model?.id&&!!o.model?.connectionId;let m;e[3]!==n||e[4]!==o.gateway_id||e[5]!==o.model||e[6]!==i||e[7]!==c?(m=async L=>{if(!c)return;const U={created_at:new Date().toISOString(),thread_id:n,model:{id:o.model.id,connectionId:o.model.connectionId},gateway:{id:o.gateway_id??""},user:{name:"you"}};await i.sendMessage(L,U)},e[3]=n,e[4]=o.gateway_id,e[5]=o.model,e[6]=i,e[7]=c,e[8]=m):m=e[8];const f=m;let p;e[9]!==o.avatar||e[10]!==o.title?(p=o.avatar?t.jsx("div",{className:"size-[60px] rounded-[18px] border border-border shrink-0 overflow-hidden",children:t.jsx("img",{src:o.avatar,alt:o.title,className:"h-full w-full object-cover"})}):t.jsx("div",{className:"size-[60px] rounded-[18px] border border-border shrink-0 overflow-hidden bg-muted/20 flex items-center justify-center",children:t.jsx(re,{size:28,className:"text-muted-foreground"})}),e[9]=o.avatar,e[10]=o.title,e[11]=p):p=e[11];let g;e[12]!==o.title?(g=t.jsx("h3",{className:"text-xl font-medium text-foreground",children:o.title}),e[12]=o.title,e[13]=g):g=e[13];let x;e[14]!==o.description?(x=o.description?t.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:o.description}):null,e[14]=o.description,e[15]=x):x=e[15];let _;e[16]!==p||e[17]!==g||e[18]!==x?(_=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[p,g,x]}),e[16]=p,e[17]=g,e[18]=x,e[19]=_):_=e[19];let u;e[20]!==o.gateway_id||e[21]!==f?(u=o.gateway_id&&t.jsx(Y,{fallback:null,children:t.jsx(I.Suspense,{fallback:t.jsx("div",{className:"flex justify-center mt-6",children:t.jsx(G,{size:20,className:"animate-spin text-muted-foreground"})}),children:t.jsx(tt,{gatewayId:o.gateway_id,onSelect:L=>{f(L.description??L.name)}})})}),e[20]=o.gateway_id,e[21]=f,e[22]=u):u=e[22];let k;e[23]!==_||e[24]!==u?(k=t.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-8 text-center",children:[_,u]}),e[23]=_,e[24]=u,e[25]=k):k=e[25];const j=k;let b;e[26]!==i.messages?(b=i.messages.filter(ct),e[26]=i.messages,e[27]=b):b=e[27];const w=b,h=r==="edit",N=h?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none";let $;e[28]!==N?($=K("absolute inset-0 px-2 transition-opacity duration-200 ease-out",N),e[28]=N,e[29]=$):$=e[29];let S;e[30]!==l?(S=t.jsx(st,{form:l}),e[30]=l,e[31]=S):S=e[31];let C;e[32]!==$||e[33]!==S?(C=t.jsx("div",{className:$,children:S}),e[32]=$,e[33]=S,e[34]=C):C=e[34];const A=h?"opacity-0 pointer-events-none":"opacity-100";let z;e[35]!==A?(z=K("h-full transition-opacity duration-200 ease-out",A),e[35]=A,e[36]=z):z=e[36];let T;e[37]!==i.messages||e[38]!==i.status||e[39]!==j||e[40]!==w.length?(T=w.length===0?t.jsx(H.EmptyState,{children:j}):t.jsx(H.Messages,{messages:i.messages,status:i.status,minHeightOffset:240}),e[37]=i.messages,e[38]=i.status,e[39]=j,e[40]=w.length,e[41]=T):T=e[41];let E;e[42]!==z||e[43]!==T?(E=t.jsx("div",{className:z,children:T}),e[42]=z,e[43]=T,e[44]=E):E=e[44];let M;e[45]!==C||e[46]!==E?(M=t.jsxs(H.Main,{className:"h-full relative overflow-hidden",innerClassName:"px-2",children:[C,E]}),e[45]=C,e[46]=E,e[47]=M):M=e[47];const d=h?"translate-y-full":"translate-y-0";let v;e[48]!==d?(v=K("transition-transform duration-300 ease-out",d),e[48]=d,e[49]=v):v=e[49];const y=!c,O=i.status==="submitted"||i.status==="streaming";let B;e[50]!==i.messages||e[51]!==i.stop||e[52]!==f||e[53]!==y||e[54]!==O?(B=t.jsx(H.Footer,{children:t.jsx("div",{className:"max-w-2xl mx-auto w-full min-w-0",children:t.jsx(H.Input,{onSubmit:f,onStop:i.stop,disabled:y,isStreaming:O,placeholder:"Ask anything or @ for context",usageMessages:i.messages})})}),e[50]=i.messages,e[51]=i.stop,e[52]=f,e[53]=y,e[54]=O,e[55]=B):B=e[55];let D;e[56]!==v||e[57]!==B?(D=t.jsx("div",{className:v,children:B}),e[56]=v,e[57]=B,e[58]=D):D=e[58];let F;return e[59]!==M||e[60]!==D?(F=t.jsxs(H,{children:[M,D]}),e[59]=M,e[60]=D,e[61]=F):F=e[61],F}function ct(s){return s.role!=="system"}function dt(s){const e=P.c(18),{value:n,onChange:r,alt:o,size:l}=s,a=l===void 0?"md":l,i=I.useRef(null),c=a==="xs"?"h-6 w-6":a==="sm"?"h-8 w-8":"h-16 w-16",m=a==="xs"?"h-3 w-3":a==="sm"?"h-4 w-4":"h-6 w-6",f=a==="xs"?"h-3 w-3":a==="sm"?"h-3.5 w-3.5":"h-5 w-5";let p;e[0]!==r?(p=$=>{const S=$.target.files?.[0];if(!S)return;const C=new FileReader;C.onloadend=()=>{const A=C.result;r(A)},C.readAsDataURL(S)},e[0]=r,e[1]=p):p=e[1];const g=p;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=()=>{i.current?.click()},e[2]=x):x=e[2];const _=x,u=`relative ${c} shrink-0 cursor-pointer group`;let k;e[3]!==g?(k=t.jsx("input",{type:"file",ref:i,className:"hidden",accept:"image/*",onChange:g}),e[3]=g,e[4]=k):k=e[4];let j;e[5]!==o||e[6]!==m||e[7]!==n?(j=n?t.jsx("img",{src:n,alt:o||"Avatar",className:"w-full h-full object-cover"}):t.jsx("div",{className:"w-full h-full flex items-center justify-center text-muted-foreground",children:t.jsx(re,{className:m})}),e[5]=o,e[6]=m,e[7]=n,e[8]=j):j=e[8];const b=`${f} text-white`;let w;e[9]!==b?(w=t.jsx("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center rounded-xl",children:t.jsx(Ue,{className:b})}),e[9]=b,e[10]=w):w=e[10];let h;e[11]!==j||e[12]!==w?(h=t.jsxs("div",{className:"h-full w-full rounded-xl border border-border bg-muted/20 overflow-hidden relative",children:[j,w]}),e[11]=j,e[12]=w,e[13]=h):h=e[13];let N;return e[14]!==u||e[15]!==k||e[16]!==h?(N=t.jsxs("div",{className:u,onClick:_,children:[k,h]}),e[14]=u,e[15]=k,e[16]=h,e[17]=N):N=e[17],N}function mt(s){const e=P.c(49),{providerId:n,assistantId:r,onBack:o}=s,l=ie();let a;e[0]!==o||e[1]!==l?(a=o??(()=>l.history.back()),e[0]=o,e[1]=l,e[2]=a):a=e[2];const i=a,{locator:c}=Pe();let m;e[3]!==r||e[4]!==c?(m=Me.assistantChatActiveThread(c,r),e[3]=r,e[4]=c,e[5]=m):m=e[5];const[f,p]=ze(m,ut),g=n||V;let x;e[6]!==g?(x=ne(g),e[6]=g,e[7]=x):x=e[7];const _=x,u=fe(n,"ASSISTANT",r,_),k=ce(n,"ASSISTANT",_),j=k.update.isPending,[b,w]=I.useState(u?.model.id&&u?.gateway_id?"chat":"edit");let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=Ne(Le),e[8]=h):h=e[8];const N=u??void 0;let $;e[9]!==N?($={resolver:h,values:N},e[9]=N,e[10]=$):$=e[10];const S=ue($);let C;e[11]!==k.update||e[12]!==r||e[13]!==S?(C=S.handleSubmit(async D=>{const F=await k.update.mutateAsync({id:r,data:D});S.reset(F),w("chat")}),e[11]=k.update,e[12]=r,e[13]=S,e[14]=C):C=e[14];const A=C;if(!u){let D;e[15]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(me,{}),e[15]=D):D=e[15];let F;e[16]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(oe,{title:"Assistant not found",description:"This assistant may have been deleted or you may not have access to it."})}),e[16]=F):F=e[16];let L;return e[17]!==i?(L=t.jsx(Y,{children:t.jsx(I.Suspense,{fallback:D,children:t.jsx(se,{onBack:i,children:F})})}),e[17]=i,e[18]=L):L=e[18],L}let z;e[19]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(me,{}),e[19]=z):z=e[19];let T;e[20]!==u.avatar||e[21]!==u.title?(T=t.jsx("div",{className:"h-6 w-6 min-w-6 rounded-lg border border-border bg-muted/20 overflow-hidden shrink-0",children:u.avatar?t.jsx("img",{src:u.avatar,alt:u.title,className:"h-full w-full object-cover"}):t.jsx("div",{className:"h-full w-full flex items-center justify-center text-muted-foreground",children:t.jsx(re,{size:12,className:"text-muted-foreground"})})}),e[20]=u.avatar,e[21]=u.title,e[22]=T):T=e[22];let E;e[23]!==u.title?(E=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:u.title}),e[23]=u.title,e[24]=E):E=e[24];let M;e[25]!==u.description?(M=u.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:u.description})]}):null,e[25]=u.description,e[26]=M):M=e[26];let d;e[27]!==E||e[28]!==M?(d=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[E,M]}),e[27]=E,e[28]=M,e[29]=d):d=e[29];let v;e[30]!==T||e[31]!==d?(v=t.jsx(pe,{children:t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[T,d]})}),e[30]=T,e[31]=d,e[32]=v):v=e[32];let y;e[33]!==S.formState.isDirty||e[34]!==j||e[35]!==b||e[36]!==A||e[37]!==p?(y=t.jsx(de,{children:b==="chat"?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>p(crypto.randomUUID()),title:"New thread",className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",children:t.jsx(Re,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})}),t.jsx("button",{type:"button",onClick:()=>w("edit"),title:"Edit",className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",children:t.jsx(be,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(W,{variant:"ghost",size:"sm",className:"h-7 gap-1.5",disabled:j,onClick:()=>w("chat"),children:"Cancel"}),t.jsx(W,{variant:"default",size:"sm",className:"h-7 gap-1.5",disabled:!S.formState.isDirty||j,onClick:()=>{A()},children:j?t.jsxs(t.Fragment,{children:[t.jsx(G,{size:14,className:"animate-spin"}),"Saving..."]}):"Save"})]})}),e[33]=S.formState.isDirty,e[34]=j,e[35]=b,e[36]=A,e[37]=p,e[38]=y):y=e[38];let O;e[39]!==f||e[40]!==u||e[41]!==S||e[42]!==b?(O=t.jsx("div",{className:"h-full",children:t.jsx(it,{activeThreadId:f,mode:b,assistant:u,form:S},S.formState.submitCount)}),e[39]=f,e[40]=u,e[41]=S,e[42]=b,e[43]=O):O=e[43];let B;return e[44]!==i||e[45]!==v||e[46]!==y||e[47]!==O?(B=t.jsx(Y,{children:t.jsx(I.Suspense,{fallback:z,children:t.jsxs(se,{onBack:i,children:[v,y,O]})})}),e[44]=i,e[45]=v,e[46]=y,e[47]=O,e[48]=B):B=e[48],B}function ut(s){return s||crypto.randomUUID()}function ft(s){const e=P.c(6),{itemId:n,onBack:r}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[0]=o):o=e[0];const a=Q(o).connectionId??V;if(!a||a===V){let c;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(oe,{title:"Assistant not found",description:"Missing connection information in the current route."})}),e[1]=c):c=e[1],c}let i;return e[2]!==a||e[3]!==n||e[4]!==r?(i=t.jsx(mt,{providerId:a,assistantId:n,onBack:r}),e[2]=a,e[3]=n,e[4]=r,e[5]=i):i=e[5],i}ye({title:le().min(1),description:le().nullable(),body:le()});function ae(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function xt(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(r=>r==="mcps"),n=e>=0?s[e+1]:void 0;return n?decodeURIComponent(n):void 0}function ht(s){const e=P.c(13),{form:n}=s;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=r):r=e[0];let o;e[1]!==n.control?(o=t.jsxs("div",{className:"flex flex-col gap-4",children:[r,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(R,{control:n.control,name:"title",render:jt}),t.jsx(R,{control:n.control,name:"description",render:gt})]})]}),e[1]=n.control,e[2]=o):o=e[2];let l,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),a=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=l,e[4]=a):(l=e[3],a=e[4]);let i;e[5]!==n.control?(i=t.jsxs("div",{className:"flex flex-col gap-2",children:[l,a,t.jsx(R,{control:n.control,name:"body",render:pt})]}),e[5]=n.control,e[6]=i):i=e[6];let c;e[7]!==o||e[8]!==i?(c=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[o,i]}),e[7]=o,e[8]=i,e[9]=c):c=e[9];let m;return e[10]!==n||e[11]!==c?(m=t.jsx(he,{...n,children:c}),e[10]=n,e[11]=c,e[12]=m):m=e[12],m}function pt(s){const{field:e}=s;return t.jsx(J,{children:t.jsx(Z,{children:t.jsx(te,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function gt(s){const{field:e}=s;return t.jsxs(J,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(Z,{children:t.jsx(ee,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function jt(s){const{field:e}=s;return t.jsxs(J,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(Z,{children:t.jsx(ee,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function vt(s){const e=P.c(42),{providerId:n,promptId:r,onBack:o}=s,l=n||V;let a;e[0]!==l?(a=ne(l),e[0]=l,e[1]=a):a=e[1];const i=a,c=fe(n,"PROMPT",r,i),m=ce(n,"PROMPT",i),f=m.update.isPending;let p;e[2]!==c?(p=c?{title:c.title,description:c.description??null,body:ae(c)}:void 0,e[2]=c,e[3]=p):p=e[3];let g;e[4]!==p?(g={values:p},e[4]=p,e[5]=g):g=e[5];const x=ue(g);let _;e[6]!==x||e[7]!==c?(_=()=>{c&&x.reset({title:c.title,description:c.description??null,body:ae(c)})},e[6]=x,e[7]=c,e[8]=_):_=e[8];const u=_;let k;e[9]!==m.update||e[10]!==x||e[11]!==r?(k=x.handleSubmit(async d=>{const v=await m.update.mutateAsync({id:r,data:{title:d.title,description:d.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:d.body}}]}});x.reset({title:v.title,description:v.description??null,body:ae(v)})}),e[9]=m.update,e[10]=x,e[11]=r,e[12]=k):k=e[12];const j=k;if(!c){let d;return e[13]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(oe,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[13]=d):d=e[13],d}let b;e[14]!==c.title?(b=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:c.title}),e[14]=c.title,e[15]=b):b=e[15];let w;e[16]!==c.description?(w=c.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:c.description})]}):null,e[16]=c.description,e[17]=w):w=e[17];let h;e[18]!==b||e[19]!==w?(h=t.jsx(pe,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[b,w]})}),e[18]=b,e[19]=w,e[20]=h):h=e[20];const N=!x.formState.isDirty||f;let $;e[21]!==u||e[22]!==N?($=t.jsx(W,{variant:"ghost",size:"sm",className:"h-7 gap-1.5",disabled:N,onClick:u,children:"Cancel"}),e[21]=u,e[22]=N,e[23]=$):$=e[23];const S=!x.formState.isDirty||f;let C;e[24]!==j?(C=()=>{j()},e[24]=j,e[25]=C):C=e[25];let A;e[26]!==f?(A=f?t.jsxs(t.Fragment,{children:[t.jsx(G,{size:14,className:"animate-spin"}),"Saving..."]}):"Save",e[26]=f,e[27]=A):A=e[27];let z;e[28]!==S||e[29]!==C||e[30]!==A?(z=t.jsx(W,{variant:"default",size:"sm",className:"h-7 gap-1.5",disabled:S,onClick:C,children:A}),e[28]=S,e[29]=C,e[30]=A,e[31]=z):z=e[31];let T;e[32]!==$||e[33]!==z?(T=t.jsxs(de,{children:[$,z]}),e[32]=$,e[33]=z,e[34]=T):T=e[34];let E;e[35]!==x?(E=t.jsx("div",{className:"h-full",children:t.jsx(ht,{form:x})}),e[35]=x,e[36]=E):E=e[36];let M;return e[37]!==o||e[38]!==T||e[39]!==E||e[40]!==h?(M=t.jsxs(se,{onBack:o,children:[h,T,E]}),e[37]=o,e[38]=T,e[39]=E,e[40]=h,e[41]=M):M=e[41],M}function bt(s){const e=P.c(5),{itemId:n,onBack:r}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=xt()??V,e[0]=o):o=e[0];const l=o;if(!l||l===V){let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(oe,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=i):i=e[1],i}let a;return e[2]!==n||e[3]!==r?(a=t.jsx(Y,{children:t.jsx(I.Suspense,{fallback:null,children:t.jsx(vt,{providerId:l,promptId:n,onBack:r})})}),e[2]=n,e[3]=r,e[4]=a):a=e[4],a}const Nt=we("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function yt(s){const e=P.c(10);let n,r,o;e[0]!==s?({className:n,variant:o,...r}=s,e[0]=s,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]);let l;e[4]!==n||e[5]!==o?(l=K(Nt({variant:o}),n),e[4]=n,e[5]=o,e[6]=l):l=e[6];let a;return e[7]!==r||e[8]!==l?(a=t.jsx("div",{"data-slot":"alert",role:"alert",className:l,...r}),e[7]=r,e[8]=l,e[9]=a):a=e[9],a}function wt(s){const e=P.c(8);let n,r;e[0]!==s?({className:n,...r}=s,e[0]=s,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=K("line-clamp-1 min-h-4 font-medium tracking-tight",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=t.jsx("div",{"data-slot":"alert-title",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function St(s){const e=P.c(8);let n,r;e[0]!==s?({className:n,...r}=s,e[0]=s,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=K("text-muted-foreground leading-relaxed",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=t.jsx("div",{"data-slot":"alert-description",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}const Ct=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function kt(s){const e=P.c(13),{toolName:n,connectionId:r,onBack:o}=s,l=`/mcp/${r}`;let a;e[0]!==l?(a=new URL(l,window.location.origin),e[0]=l,e[1]=a):a=e[1];const i=a;let c;e[2]!==r?(c={connectionId:r},e[2]=r,e[3]=c):c=e[3];const m=Ke(c);if(!m.isAuthenticated){let g;return e[4]!==m.supportsOAuth||e[5]!==o?(g=t.jsx("div",{className:"flex h-full items-center justify-center",children:m.supportsOAuth?t.jsx(Ze,{onAuthenticate:()=>o(),buttonText:"Go back to authenticate"}):t.jsx(Ye,{hasReadme:!1})}),e[4]=m.supportsOAuth,e[5]=o,e[6]=g):g=e[6],g}const f=`${r}:${n}`;let p;return e[7]!==r||e[8]!==i||e[9]!==o||e[10]!==f||e[11]!==n?(p=t.jsx(It,{toolName:n,connectionId:r,mcpProxyUrl:i,onBack:o},f),e[7]=r,e[8]=i,e[9]=o,e[10]=f,e[11]=n,e[12]=p):p=e[12],p}function It({toolName:s,connectionId:e,mcpProxyUrl:n,onBack:r}){const{replayId:o}=Se({strict:!1}),l=(()=>{if(!o)return null;const d=`replay-${o}`,v=sessionStorage.getItem(d);if(!v)return null;sessionStorage.removeItem(d);try{return JSON.parse(v)}catch{return null}})(),a=(()=>{if(!l)return null;const d={};for(const[v,y]of Object.entries(l))y!==null&&typeof y=="object"?d[v]=JSON.stringify(y,null,2):d[v]=y;return d})(),[i,c]=I.useState(a??{}),[m,f]=I.useState(l?JSON.stringify(l,null,2):"{}"),[p,g]=I.useState(null),[x,_]=I.useState(null),[u,k]=I.useState(!1),[j,b]=I.useState(null),w=xe(e),h=et({url:n.href});I.useEffect(()=>{h.error&&console.error("MCP Error:",h.error)},[h.error]);const N=h.tools?.find(d=>d.name===s),$=N?.inputSchema?.properties,S=$?Object.keys($):[],C=S.length>0,A={};if(C&&N?.inputSchema?.properties)for(const d of S)A[d]=N.inputSchema.required?.includes(d)?"":void 0;const z=d=>Object.prototype.hasOwnProperty.call(i,d),T=async()=>{k(!0),_(null),g(null),b(null);const d=performance.now(),v=ne(e);try{const y=C?{...A,...i}:(()=>{const U=m.trim();if(!U)return{};const q=JSON.parse(U);if(q&&typeof q=="object")return q;throw new Error("Raw JSON input must be an object.")})();C&&N?.inputSchema?.properties&&Object.entries(N.inputSchema.properties).forEach(([U,q])=>{if((q.type==="object"||q.type==="array")&&typeof y[U]=="string")try{y[U]=JSON.parse(y[U])}catch{}});const O=await v(s,y),B=performance.now(),D=Math.round(B-d);g(O);const F=JSON.stringify(O),L=new TextEncoder().encode(F).length;b({duration:`${D}ms`,bytes:`${L} bytes`,tokens:`~${Math.ceil(L/4)} tokens`,cost:"$0.0000"})}catch(y){const O=y instanceof Error?y.message:String(y);_(O||"Unknown error occurred");const B=performance.now();b({duration:`${Math.round(B-d)}ms`})}finally{k(!1)}},E=(d,v)=>{c(y=>({...y,[d]:v}))},M=()=>{g(null),_(null),b(null)};return t.jsxs(se,{onBack:r,children:[t.jsx(de,{children:t.jsx(Qe,{connectionId:e,title:N?.name??Ct(s),icon:"build"})}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 h-full",children:[t.jsx("div",{className:"flex flex-col border-r border-border overflow-hidden",children:t.jsxs("div",{className:"flex-1 overflow-auto",children:[t.jsx("div",{className:"flex flex-col gap-4 p-6 border-b border-border min-h-28",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(ke,{icon:w?.icon||null,name:w?.title||s,size:"sm",className:"shadow-sm shrink-0"}),t.jsx("h1",{className:"text-lg font-medium text-foreground leading-none",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit",children:[h.state==="ready"?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):h.state==="connecting"?t.jsx(G,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:h.state.replace("_"," ")})]})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:N?.description||"No description available"})]})}),t.jsxs("div",{className:"flex flex-col p-6 gap-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),N?.inputSchema?.required&&N.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:C&&N?.inputSchema?.properties?Object.entries(N.inputSchema.properties).map(([d,v])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,N.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:v.type})]}),v.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:v.description}),v.type==="object"||v.type==="array"?t.jsx(te,{className:"font-mono text-xs",value:z(d)?i[d]??"":A[d]??"",onChange:y=>E(d,y.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):t.jsx(ee,{value:z(d)?i[d]??"":A[d]??"",onChange:y=>E(d,y.target.value),placeholder:`Enter ${d}...`})]},d)):N?.inputSchema&&!C?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(te,{className:"font-mono text-xs min-h-[120px]",value:m,onChange:d=>f(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})})]})]})}),t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-t lg:border-t-0 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),j&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(Je,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:j.duration})]}),j.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ge,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:j.tokens})]}),j.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ve,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:j.bytes})]}),j.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:j.cost})})]})]}),t.jsx("div",{className:"flex items-center justify-end lg:justify-between px-4 h-14 border-b border-border bg-background",children:t.jsxs("div",{className:"flex items-center gap-2 w-full lg:w-auto",children:[t.jsx(W,{size:"sm",variant:"default",className:"h-8 gap-2 flex-1 lg:flex-none",onClick:T,disabled:u,children:u?t.jsxs(t.Fragment,{children:[t.jsx(G,{size:14,className:"animate-spin"}),"Executing..."]}):t.jsxs(t.Fragment,{children:[t.jsx(Ge,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})}),t.jsx(Oe,{children:t.jsxs(Be,{children:[t.jsx(De,{asChild:!0,children:t.jsx(W,{size:"icon",variant:"outline",className:"h-8 w-8 shrink-0",onClick:M,disabled:!p&&!x,children:t.jsx(He,{size:14})})}),t.jsx(Fe,{children:t.jsx("p",{children:"Clear results"})})]})})]})}),x&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(yt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Ve,{className:"h-4 w-4"}),t.jsx(wt,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(St,{className:"text-xs text-destructive",children:x})]})})}),t.jsx("div",{className:"relative flex-1 overflow-auto bg-muted/50",children:p?t.jsxs(t.Fragment,{children:[t.jsx(qe,{jsonString:JSON.stringify(p,null,2),padding:"1.5rem"}),t.jsx(W,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(p,null,2)),Ce.success("Copied to clipboard")},children:t.jsx(We,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(je,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]})]})]})}function _t(s){const e=P.c(7),{itemId:n,onBack:r}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[0]=o):o=e[0];const a=Q(o).connectionId??V;if(!xe(a)){let f;return e[1]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[1]=f):f=e[1],f}let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(G,{size:32,className:"animate-spin text-muted-foreground"})}),e[2]=c):c=e[2];let m;return e[3]!==a||e[4]!==r||e[5]!==n?(m=t.jsx(I.Suspense,{fallback:c,children:t.jsx(kt,{toolName:n,connectionId:a,onBack:r})}),e[3]=a,e[4]=r,e[5]=n,e[6]=m):m=e[6],m}const $t={assistant:ft,prompt:bt};function Et(){const s=P.c(6),e=ie();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},s[0]=n):n=s[0];const r=Q(n),o=decodeURIComponent(r.itemId);let l;s[1]!==e.history?(l=()=>{e.history.back()},s[1]=e.history,s[2]=l):l=s[2];const a=l,i=Tt;let c;return s[3]!==a||s[4]!==o?(c=t.jsx(_t,{itemId:o,onBack:a,onUpdate:i}),s[3]=a,s[4]=o,s[5]=c):c=s[5],c}async function Tt(s){return Promise.resolve()}function At(){const s=P.c(18),e=ie();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},s[0]=n):n=s[0];const r=Q(n),o=r.connectionId,l=decodeURIComponent(r.collectionName),a=decodeURIComponent(r.itemId);let i;s[1]!==e.history?(i=()=>{e.history.back()},s[1]=e.history,s[2]=i):i=s[2];const c=i,m=o??V;let f;s[3]!==m?(f=ne(m),s[3]=m,s[4]=f):f=s[4];const g=ce(m,l,f);let x;s[5]!==g||s[6]!==a?(x=async h=>{a&&await g.update.mutateAsync({id:a,data:h})},s[5]=g,s[6]=a,s[7]=x):x=s[7];const _=x;let u;s[8]!==l?(u=l?.toLowerCase(),s[8]=l,s[9]=u):u=s[9];const k=u,j=k&&$t[k];if(j){let h;return s[10]!==j||s[11]!==c||s[12]!==_||s[13]!==a?(h=t.jsx(j,{itemId:a,onBack:c,onUpdate:_}),s[10]=j,s[11]=c,s[12]=_,s[13]=a,s[14]=h):h=s[14],h}let b;s[15]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Ie,{size:36,className:"text-muted-foreground"}),s[15]=b):b=s[15];let w;return s[16]!==c?(w=t.jsx(Xe,{icon:b,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[16]=c,s[17]=w):w=s[17],w}function zt(){const s=P.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},s[0]=e):e=s[0];const n=Q(e);if(decodeURIComponent(n.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Et,{}),s[1]=a):a=s[1],a}let l;return s[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(At,{}),s[2]=l):l=s[2],l}function Es(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Y,{children:t.jsx(I.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(G,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(zt,{})})}),s[0]=e):e=s[0],e}export{Es as default};
|