@decocms/mesh 1.0.0-alpha.37 → 1.0.0-alpha.38
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-FgA4OE_Y.js → AlertCircle-BRDn8bYf.js} +1 -1
- package/dist/client/assets/{ArrowLeft-DZ8Qhlyz.js → ArrowLeft-qWOemv4m.js} +1 -1
- package/dist/client/assets/{CheckCircle-D9-mPjW-.js → CheckCircle-DNAL-vtD.js} +1 -1
- package/dist/client/assets/{ChevronDown-CRpCA4eQ.js → ChevronDown-CJBpL9ke.js} +1 -1
- package/dist/client/assets/{Clock-9Ud3hYi_.js → Clock-s023drCB.js} +1 -1
- package/dist/client/assets/{Copy01-DGZy8_Wa.js → Copy01-Bm7GrXLR.js} +1 -1
- package/dist/client/assets/{CpuChip02-9xkDTOQm.js → CpuChip02-CY8-jTO9.js} +1 -1
- package/dist/client/assets/{DotsVertical-7BehxNIr.js → DotsVertical-DakD93ro.js} +1 -1
- package/dist/client/assets/{File06-JZRzMAbM.js → File06-CaEGX5DR.js} +1 -1
- package/dist/client/assets/{Grid01-CKvZ5Bgj.js → Grid01-DzkX4KgN.js} +1 -1
- package/dist/client/assets/{Inbox01-Q7OGuD8_.js → Inbox01-BwvF7iId.js} +1 -1
- package/dist/client/assets/{InfoCircle-ZmqIswrk.js → InfoCircle-D8u9C2rC.js} +1 -1
- package/dist/client/assets/{Key01-Cc974JWF.js → Key01-CNozBS0S.js} +1 -1
- package/dist/client/assets/{LinkExternal01-0ybSN01c.js → LinkExternal01-v_wZOVfQ.js} +1 -1
- package/dist/client/assets/{Loading01-BpGj_YCN.js → Loading01-Bg5ZbX7j.js} +1 -1
- package/dist/client/assets/{Plus-BS5hPXY3.js → Plus-DHLB4x84.js} +1 -1
- package/dist/client/assets/{SearchMd-BbbPnMSd.js → SearchMd-dWvbF6MG.js} +1 -1
- package/dist/client/assets/{Trash01-DtIQgapG.js → Trash01-B8SyVfGZ.js} +1 -1
- package/dist/client/assets/{Upload01-Zx3GirGx.js → Upload01-B11bwIwD.js} +1 -1
- package/dist/client/assets/{X-CYjj99XI.js → X-B95LxPIt.js} +1 -1
- package/dist/client/assets/{XClose-BDRe0Ozk.js → XClose-B0ejekJj.js} +1 -1
- package/dist/client/assets/{alert-dialog-Bj94Mg43.js → alert-dialog-UMEPZCAs.js} +2 -2
- package/dist/client/assets/{auth-CbkV4JhC.js → auth-DzSQcnhF.js} +1 -1
- package/dist/client/assets/{auth-catchall-pG3jhayZ.js → auth-catchall-BYr2zijL.js} +1 -1
- package/dist/client/assets/avatar-BHmRC7PJ.js +1 -0
- package/dist/client/assets/{badge-B6NR5xty.js → badge-CsN_0CQA.js} +1 -1
- package/dist/client/assets/{button-WA21TIge.js → button-DGzvT_2A.js} +1 -1
- package/dist/client/assets/{card-fnco2BKy.js → card-DhiM8w8S.js} +1 -1
- package/dist/client/assets/{checkbox-Bq4Db1eq.js → checkbox-CazM39DL.js} +1 -1
- package/dist/client/assets/collection-detail-Be2q4lq8.js +1 -0
- package/dist/client/assets/{collection-display-button-CJgVNUjG.js → collection-display-button-HCh5o-4Q.js} +1 -1
- package/dist/client/assets/{collection-header-COdYt0yo.js → collection-header-QrVAH4kj.js} +1 -1
- package/dist/client/assets/{collection-page-IZEjeZDJ.js → collection-page-CUS5aOdu.js} +1 -1
- package/dist/client/assets/{collection-search-Dh2zcE6Z.js → collection-search-nvVuwapQ.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DOiiwQBc.js → collection-table-wrapper-D0FdiE30.js} +1 -1
- package/dist/client/assets/{connection-card-P2DYTKtD.js → connection-card-CtFpN05k.js} +1 -1
- package/dist/client/assets/{connection-detail-2kY4jzvr.js → connection-detail-DlPH1Rj9.js} +1 -1
- package/dist/client/assets/{connections-CfReLX9R.js → connections-CuXo1k5G.js} +1 -1
- package/dist/client/assets/{core-Bsa-CClQ.js → core-CPQcCrZ7.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-DjEf_yPL.js → create-organization-dialog-CO78Byme.js} +1 -1
- package/dist/client/assets/{deco-chat-skeleton-YKru_-uq.js → deco-chat-skeleton-BAqDOmQt.js} +3 -3
- package/dist/client/assets/{dialog-CzRcLMrO.js → dialog-BQqZMrZX.js} +1 -1
- package/dist/client/assets/{dropdown-menu-lNp795nL.js → dropdown-menu-D1IcmwBM.js} +1 -1
- package/dist/client/assets/{error-boundary-D10vdRO6.js → error-boundary-BePJNb-A.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CnaW3oDd.js → extract-connection-data-BzkcwZMq.js} +1 -1
- package/dist/client/assets/{form-BUVsmabM.js → form-CtkKIwlr.js} +1 -1
- package/dist/client/assets/{gateway-detail-DxVWCOGY.js → gateway-detail-BFm1a022.js} +1 -1
- package/dist/client/assets/{gateways-BDUTpLoJ.js → gateways-u5Ek3G6R.js} +1 -1
- package/dist/client/assets/{home-DcAStJkG.js → home-tHS3Zecm.js} +1 -1
- package/dist/client/assets/{index-B3MiP_oE.js → index-B3hUglpl.js} +1 -1
- package/dist/client/assets/{index-BWMTgSpJ.js → index-BFGV_ZyQ.js} +2 -2
- package/dist/client/assets/index-Bchib-vH.css +1 -0
- package/dist/client/assets/{index-DiIfEFEx.js → index-Co77-1xF.js} +1 -1
- package/dist/client/assets/{index-DXIf5jrv.js → index-RtH5C8CP.js} +1 -1
- package/dist/client/assets/{input-C8ckt9pD.js → input-CSN83rcG.js} +1 -1
- package/dist/client/assets/json-eo7c8zn7.js +1 -0
- package/dist/client/assets/{json-syntax-highlighter-DqTOcqS4.js → json-syntax-highlighter-s54gEg6g.js} +2 -2
- package/dist/client/assets/{layout-Ddw5vi1_.js → layout-By0mCM-C.js} +1 -1
- package/dist/client/assets/{lazy-highlighter-D0ldRF_z.js → lazy-highlighter-BA7LoVJl.js} +1 -1
- package/dist/client/assets/{localstorage-keys-C__QKrnP.js → localstorage-keys-CKD_ZpQC.js} +1 -1
- package/dist/client/assets/{login-Bfuntl4G.js → login-hHvv0tPc.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BeGFsv5e.js → mcp-oauth-BXBge9LN.js} +1 -1
- package/dist/client/assets/{members-DsJnPzlW.js → members-Bvub8C8H.js} +1 -1
- package/dist/client/assets/{monitoring-C4ZUhICh.js → monitoring-B76IY8Nx.js} +1 -1
- package/dist/client/assets/{oauth-callback-rQDuS0Y4.js → oauth-callback-Buaygh1B.js} +1 -1
- package/dist/client/assets/{page-CEwSU962.js → page-X28UCcuA.js} +1 -1
- package/dist/client/assets/popover-Bc_J6DJM.js +1 -0
- package/dist/client/assets/prism-light-CJ5lsPAv.js +1 -0
- package/dist/client/assets/{resource-tabs-TaJMxN6_.js → resource-tabs-talmxE-P.js} +1 -1
- package/dist/client/assets/{schema-B3tkq8IT.js → schema-BNYaaxve.js} +1 -1
- package/dist/client/assets/{select-DQatPXKJ.js → select-zI1MuLqv.js} +1 -1
- package/dist/client/assets/{settings-DIHeOoHX.js → settings-3CQfBwb4.js} +1 -1
- package/dist/client/assets/shell-layout-DrYzniBY.js +17 -0
- package/dist/client/assets/{spinner-DD8NRDSP.js → spinner-Bz0yGoI-.js} +1 -1
- package/dist/client/assets/store-DFp_70M-.js +1 -0
- package/dist/client/assets/{store-app-detail-C3gtVQGX.js → store-app-detail-lpZSA42O.js} +1 -1
- package/dist/client/assets/{switch-BLTM21B0.js → switch-hr3MPsBc.js} +1 -1
- package/dist/client/assets/{textarea-OUcFAiZD.js → textarea-B9KhTSks.js} +1 -1
- package/dist/client/assets/{tooltip-Dy-DsVOX.js → tooltip-B1UObqaJ.js} +1 -1
- package/dist/client/assets/{types-Be8keXIM.js → types-BH1WeggD.js} +1 -1
- package/dist/client/assets/{use-binding-pAqGO8UI.js → use-binding-BAah0fz3.js} +1 -1
- package/dist/client/assets/{use-connection-Lp9rwnx7.js → use-connection-DfrXFTVM.js} +2 -2
- package/dist/client/assets/{use-gateway-C0GNG4JP.js → use-gateway-MMJo-JLn.js} +1 -1
- package/dist/client/assets/{use-list-state-BxKaK11n.js → use-list-state-z01BeFuP.js} +1 -1
- package/dist/client/assets/{use-mcp-ClY7_5dz.js → use-mcp-BM47vnpW.js} +1 -1
- package/dist/client/assets/{use-members-4V3USNhz.js → use-members-ClMZBuqE.js} +1 -1
- package/dist/client/assets/{use-mobile-k1X2THZ9.js → use-mobile-CZP-mMZd.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CMytLZst.js → use-organization-settings-GOa26Bje.js} +1 -1
- package/dist/client/assets/use-tool-call-De--YQMp.js +1 -0
- package/dist/client/assets/useQuery-B00cZGqv.js +1 -0
- package/dist/client/assets/utils-D8oc_Xja.js +1 -0
- package/dist/client/assets/{well-known-mcp-CjKrCZkD.js → well-known-mcp-CJlqApJn.js} +1 -1
- package/dist/client/index.html +2 -2
- package/package.json +1 -1
- package/dist/client/assets/avatar-DQuAu06W.js +0 -1
- package/dist/client/assets/collection-detail-C45JavW1.js +0 -1
- package/dist/client/assets/index-LtFisB9d.css +0 -1
- package/dist/client/assets/json-DgiEbznW.js +0 -1
- package/dist/client/assets/popover-BSAaObMv.js +0 -1
- package/dist/client/assets/prism-light-BGWrXuVI.js +0 -1
- package/dist/client/assets/shell-layout-D1irgz1e.js +0 -1
- package/dist/client/assets/store-BlitdGFv.js +0 -1
- package/dist/client/assets/use-tool-call-z8Rn6Gss.js +0 -1
- package/dist/client/assets/useQuery-CdGzN_Sp.js +0 -1
- package/dist/client/assets/utils-CvrJmBA1.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as $,c as O,j as L,
|
|
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
|
|
1
|
+
import{r as $,c as O,j as L,Z as z,q as k,K as x,t as I}from"./index-BFGV_ZyQ.js";import{c as N}from"./utils-D8oc_Xja.js";import{u as b}from"./tooltip-B1UObqaJ.js";import{u as j}from"./button-DGzvT_2A.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
|
+
`).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 n}from"./index-
|
|
1
|
+
import{c as n}from"./index-BFGV_ZyQ.js";import{e as u,d as m,f,c as r}from"./use-connection-DfrXFTVM.js";import{u as a}from"./tooltip-B1UObqaJ.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-BFGV_ZyQ.js";import{u as D}from"./use-mobile-CZP-mMZd.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-BFGV_ZyQ.js";import{u as j}from"./useQuery-B00cZGqv.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,
|
|
1
|
+
import{c as o,q as n,K as u,a as i}from"./index-BFGV_ZyQ.js";import{u as a}from"./tooltip-B1UObqaJ.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-BFGV_ZyQ.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,
|
|
1
|
+
import{c as o,q as y,Z as T,K as f}from"./index-BFGV_ZyQ.js";import{u as p}from"./button-DGzvT_2A.js";import{c as m}from"./use-connection-DfrXFTVM.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as f,q,K}from"./index-BFGV_ZyQ.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-BFGV_ZyQ.js";function t(e,r){return u(e,s,r)}export{t as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{bs as s,V as t}from"./index-BFGV_ZyQ.js";function e(...r){return s(t(r))}export{e as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n}from"./index-
|
|
1
|
+
import{r as n}from"./index-BFGV_ZyQ.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-BFGV_ZyQ.js"></script>
|
|
7
|
+
<link rel="stylesheet" crossorigin href="/assets/index-Bchib-vH.css">
|
|
8
8
|
</head>
|
|
9
9
|
<body>
|
|
10
10
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as R,c as j,j as i,g as I,Z as U,_ as L,$ as M}from"./index-BWMTgSpJ.js";import{c as f}from"./utils-CvrJmBA1.js";const V=({size:a=24,color:e="currentColor",...s})=>R.createElement("svg",{viewBox:"0 0 24 24",width:a,height:a,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},R.createElement("path",{d:"M20 21c0-1.396 0-2.093-.172-2.661a4 4 0 0 0-2.667-2.667c-.568-.172-1.265-.172-2.661-.172h-5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C4 18.907 4 19.604 4 21M16.5 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));V.displayName="User01";function O(a){const e=j.c(8);let s,t;e[0]!==a?({className:s,...t}=a,e[0]=a,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=f("relative flex size-8 shrink-0 overflow-hidden rounded-full",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==t||e[6]!==o?(r=i.jsx(M,{"data-slot":"avatar",className:o,...t}),e[5]=t,e[6]=o,e[7]=r):r=e[7],r}function _(a){const e=j.c(8);let s,t;e[0]!==a?({className:s,...t}=a,e[0]=a,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=f("aspect-square size-full",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==t||e[6]!==o?(r=i.jsx(U,{"data-slot":"avatar-image",className:o,...t}),e[5]=t,e[6]=o,e[7]=r):r=e[7],r}function T(a){const e=j.c(8);let s,t;e[0]!==a?({className:s,...t}=a,e[0]=a,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=f("bg-muted flex size-full items-center justify-center rounded-full",s),e[3]=s,e[4]=o):o=e[4];let r;return e[5]!==t||e[6]!==o?(r=i.jsx(L,{"data-slot":"avatar-fallback",className:o,...t}),e[5]=t,e[6]=o,e[7]=r):r=e[7],r}const S=["drop-shadow-lg bg-gradient-to-br from-red-100 to-red-300 text-red-800 shadow-lg shadow-red-300/40 ring-1 ring-red-300/30","drop-shadow-lg bg-gradient-to-br from-lime-100 to-lime-300 text-lime-800 shadow-lg shadow-lime-300/40 ring-1 ring-lime-300/30","drop-shadow-lg bg-gradient-to-br from-emerald-100 to-emerald-300 text-emerald-800 shadow-lg shadow-emerald-300/40 ring-1 ring-emerald-300/30","drop-shadow-lg bg-gradient-to-br from-orange-100 to-orange-300 text-orange-800 shadow-lg shadow-orange-300/40 ring-1 ring-orange-300/30","drop-shadow-lg bg-gradient-to-br from-amber-100 to-amber-300 text-amber-800 shadow-lg shadow-amber-300/40 ring-1 ring-amber-300/30","drop-shadow-lg bg-gradient-to-br from-yellow-100 to-yellow-300 text-yellow-800 shadow-lg shadow-yellow-300/40 ring-1 ring-yellow-300/30","drop-shadow-lg bg-gradient-to-br from-green-100 to-green-300 text-green-800 shadow-lg shadow-green-300/40 ring-1 ring-green-300/30","drop-shadow-lg bg-gradient-to-br from-teal-100 to-teal-300 text-teal-800 shadow-lg shadow-teal-300/40 ring-1 ring-teal-300/30","drop-shadow-lg bg-gradient-to-br from-cyan-100 to-cyan-300 text-cyan-800 shadow-lg shadow-cyan-300/40 ring-1 ring-cyan-300/30","drop-shadow-lg bg-gradient-to-br from-sky-100 to-sky-300 text-sky-800 shadow-lg shadow-sky-300/40 ring-1 ring-sky-300/30","drop-shadow-lg bg-gradient-to-br from-blue-100 to-blue-300 text-blue-800 shadow-lg shadow-blue-300/40 ring-1 ring-blue-300/30","drop-shadow-lg bg-gradient-to-br from-indigo-100 to-indigo-300 text-indigo-800 shadow-lg shadow-indigo-300/40 ring-1 ring-indigo-300/30","drop-shadow-lg bg-gradient-to-br from-violet-100 to-violet-300 text-violet-800 shadow-lg shadow-violet-300/40 ring-1 ring-violet-300/30","drop-shadow-lg bg-gradient-to-br from-purple-100 to-purple-300 text-purple-800 shadow-lg shadow-purple-300/40 ring-1 ring-purple-300/30","drop-shadow-lg bg-gradient-to-br from-fuchsia-100 to-fuchsia-300 text-fuchsia-800 shadow-lg shadow-fuchsia-300/40 ring-1 ring-fuchsia-300/30","drop-shadow-lg bg-gradient-to-br from-pink-100 to-pink-300 text-pink-800 shadow-lg shadow-pink-300/40 ring-1 ring-pink-300/30","drop-shadow-lg bg-gradient-to-br from-rose-100 to-rose-300 text-rose-800 shadow-lg shadow-rose-300/40 ring-1 ring-rose-300/30"],W="drop-shadow-lg text-muted-foreground bg-muted shadow-lg";function Z(a){let e=0;for(let t=0;t<a.length;t++)e=a.charCodeAt(t)+((e<<5)-e);const s=Math.abs(e)%S.length;return S[s]}const $=I("border border-border",{variants:{shape:{circle:"rounded-full",square:""},size:{"3xs":"w-3 h-3 text-xs font-semibold","2xs":"w-4 h-4 text-xs font-semibold",xs:"w-6 h-6 text-sm font-semibold",sm:"w-8 h-8 text-lg font-semibold",base:"w-10 h-10 text-2xl font-semibold",lg:"w-12 h-12 text-3xl font-semibold",xl:"w-16 h-16 text-4xl font-semibold","2xl":"w-20 h-20 text-5xl font-semibold","3xl":"w-32 h-32 text-7xl font-semibold"}},compoundVariants:[{shape:"square",size:"xs",class:"rounded-lg"},{shape:"square",size:"sm",class:"rounded-xl"},{shape:"square",size:"base",class:"rounded-xl"},{shape:"square",size:"lg",class:"rounded-xl"},{shape:"square",size:"xl",class:"rounded-2xl"},{shape:"square",size:"2xl",class:"rounded-3xl"},{shape:"square",size:"3xl",class:"rounded-[40px]"}],defaultVariants:{shape:"square",size:"base"}}),B=I("",{variants:{objectFit:{contain:"object-contain",cover:"object-cover"}},defaultVariants:{objectFit:"cover"}}),D=a=>{const e={"3xs":8,"2xs":8,xs:12,sm:16,base:24,lg:28,xl:36,"2xl":48,"3xl":80};return e[a]||e.base};function G(a){const e=j.c(35);let s,t,o,r,n,d,g,l;e[0]!==a?({url:l,fallback:t,shape:r,size:n,objectFit:d,className:s,muted:g,...o}=a,e[0]=a,e[1]=s,e[2]=t,e[3]=o,e[4]=r,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],r=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=r===void 0?"square":r,h=n===void 0?"base":n,u=d===void 0?"cover":d,k=g===void 0?!1:g,[m,x]=R.useState(!1);let F;e:{if(typeof t=="string"){let c;e[9]!==t?(c=t.trim().slice(0,2).toUpperCase(),e[9]=t,e[10]=c):c=e[10],F=c;break e}F=t}const C=F;let z;e:{if(k){z=W;break e}if(typeof t=="string"){let c;e[11]!==t?(c=Z(t),e[11]=t,e[12]=c):c=e[12],z=c;break e}z=S[0]}const y=z;let N;e[13]!==l?(N=l?.startsWith("icon://"),e[13]=l,e[14]=N):N=e[14];const p=N;let q;e[15]!==p||e[16]!==l?(q=p?l?.replace("icon://",""):void 0,e[15]=p,e[16]=l,e[17]=q):q=e[17];const E=q;let w;e[18]!==s||e[19]!==b||e[20]!==h?(w=f($({shape:b,size:h}),s),e[18]=s,e[19]=b,e[20]=h,e[21]=w):w=e[21];let v;e[22]!==y||e[23]!==C||e[24]!==E||e[25]!==m||e[26]!==p||e[27]!==u||e[28]!==h||e[29]!==l?(v=p&&E?i.jsx("div",{className:f("flex items-center justify-center w-full h-full",y),children:i.jsx(V,{size:D(h)})}):i.jsxs(i.Fragment,{children:[l&&!m&&i.jsx(_,{src:l,loading:"lazy",alt:"Avatar",className:f(B({objectFit:u})),onError:()=>x(!0)}),(!l||m)&&i.jsx(T,{className:f(y,"rounded-none"),children:C})]}),e[22]=y,e[23]=C,e[24]=E,e[25]=m,e[26]=p,e[27]=u,e[28]=h,e[29]=l,e[30]=v):v=e[30];let A;return e[31]!==o||e[32]!==v||e[33]!==w?(A=i.jsx(O,{className:w,...o,children:v}),e[31]=o,e[32]=v,e[33]=w,e[34]=A):A=e[34],A}function H(a){const e=j.c(18);let s,t,o,r,n,d,g,l;e[0]!==a?({shape:r,size:n,url:l,fallback:t,objectFit:d,className:s,muted:g,...o}=a,e[0]=a,e[1]=s,e[2]=t,e[3]=o,e[4]=r,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],r=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=r===void 0?"square":r,h=n===void 0?"base":n,u=d===void 0?"cover":d,k=g===void 0?!1:g,m=h??"base";let x;return e[9]!==s||e[10]!==t||e[11]!==k||e[12]!==u||e[13]!==o||e[14]!==b||e[15]!==m||e[16]!==l?(x=i.jsx(G,{shape:b,url:l,fallback:t,size:m,objectFit:u,className:s,muted:k,...o}),e[9]=s,e[10]=t,e[11]=k,e[12]=u,e[13]=o,e[14]=b,e[15]=m,e[16]=l,e[17]=x):x=e[17],x}H.Skeleton=function({shape:e="square",size:s="base",className:t}){return i.jsx("div",{className:f($({shape:e,size:s}),"bg-muted animate-pulse",t)})};export{H as A};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as w,c as $,d as G,j as t,av as X,x as me,w as ue,g as xe,b as fe,t as he}from"./index-BWMTgSpJ.js";import{U as W,f as pe,c as ee,d as ne,b as re,I as ge,n as je}from"./use-connection-Lp9rwnx7.js";import{b as K,a as be,V as oe}from"./layout-Ddw5vi1_.js";import{E as ae}from"./SearchMd-BbbPnMSd.js";import{E as Z}from"./error-boundary-D10vdRO6.js";import{u as ve,L as Ne}from"./localstorage-keys-C__QKrnP.js";import{u as ye,a as we,c as Se,b as Ce,T as ke}from"./tooltip-Dy-DsVOX.js";import{B as J}from"./button-WA21TIge.js";import{j as se,d as Ie,C as D}from"./deco-chat-skeleton-YKru_-uq.js";import{I as Y}from"./input-C8ckt9pD.js";import{T as Q}from"./textarea-OUcFAiZD.js";import{A as $e}from"./use-binding-pAqGO8UI.js";import{i as q}from"./Loading01-BpGj_YCN.js";import{s as Ee}from"./Plus-BS5hPXY3.js";import{i as Te}from"./Upload01-Zx3GirGx.js";import{c as te}from"./utils-CvrJmBA1.js";import{i as Ae}from"./AlertCircle-FgA4OE_Y.js";import{s as ze}from"./Clock-9Ud3hYi_.js";import{a as _e}from"./Copy01-DGZy8_Wa.js";import{i as Oe,J as Me}from"./json-syntax-highlighter-DqTOcqS4.js";import{s as Le}from"./XClose-BDRe0Ozk.js";import{u as Pe,O as De,M as Re,P as Be,E as Ue}from"./index-B3MiP_oE.js";import{u as Ve}from"./use-mcp-ClY7_5dz.js";import"./ArrowLeft-DZ8Qhlyz.js";import"./useQuery-CdGzN_Sp.js";import"./Grid01-CKvZ5Bgj.js";import"./CpuChip02-9xkDTOQm.js";import"./select-DQatPXKJ.js";import"./ChevronDown-CRpCA4eQ.js";import"./use-mobile-k1X2THZ9.js";import"./use-gateway-C0GNG4JP.js";import"./connection-card-P2DYTKtD.js";import"./card-fnco2BKy.js";import"./LinkExternal01-0ybSN01c.js";import"./spinner-DD8NRDSP.js";import"./File06-JZRzMAbM.js";import"./InfoCircle-ZmqIswrk.js";import"./auth-CbkV4JhC.js";import"./mcp-oauth-BeGFsv5e.js";import"./use-organization-settings-CMytLZst.js";import"./use-tool-call-z8Rn6Gss.js";import"./Key01-Cc974JWF.js";import"./form-BUVsmabM.js";import"./formatDistanceToNow-Ctx6mZEP.js";import"./extract-connection-data-CnaW3oDd.js";import"./registry-utils-ulDDT0d8.js";import"./generate-id-Dyweu44Y.js";import"./index-DXIf5jrv.js";import"./index-DiIfEFEx.js";import"./schema-B3tkq8IT.js";const ie=({size:s=24,color:e="currentColor",...n})=>w.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},w.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"}));ie.displayName="Box";const le=({size:s=24,color:e="currentColor",...n})=>w.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},w.createElement("path",{d:"m16 18 6-6-6-6M8 6l-6 6 6 6"}));le.displayName="Code01";const ce=({size:s=24,color:e="currentColor",...n})=>w.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},w.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"}));ce.displayName="Database01";const de=({size:s=24,color:e="currentColor",...n})=>w.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},w.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"}));de.displayName="Edit05";const H=({size:s=24,color:e="currentColor",...n})=>w.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},w.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"}));H.displayName="Users02";function Fe(s){const e=$.c(53),{activeThreadId:n,mode:o,systemPrompt:r,onSystemPromptChange:i,gatewayId:a,model:l,onGatewayChange:m,onModelChange:c,title:h,description:v,avatar:b}=s;let S;e[0]!==n||e[1]!==r?(S={threadId:n,systemPrompt:r},e[0]=n,e[1]=r,e[2]=S):S=e[2];const u=Ie(S),I=!!a&&!!l?.id&&!!l?.connectionId,N=o!=="edit";let x;e[3]!==n||e[4]!==u||e[5]!==a||e[6]!==I||e[7]!==l?(x=async V=>{if(!I||!l)return;const P={created_at:new Date().toISOString(),thread_id:n,model:{id:l.id,connectionId:l.connectionId},gateway:{id:a??""},user:{name:"you"}};await u.sendMessage(V,P)},e[3]=n,e[4]=u,e[5]=a,e[6]=I,e[7]=l,e[8]=x):x=e[8];const C=x;let y;e[9]!==b||e[10]!==h?(y=b?t.jsx("div",{className:"size-[60px] rounded-[18px] border border-border shrink-0 overflow-hidden",children:t.jsx("img",{src:b,alt:h,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(H,{size:28,className:"text-muted-foreground"})}),e[9]=b,e[10]=h,e[11]=y):y=e[11];let f;e[12]!==h?(f=t.jsx("h3",{className:"text-xl font-medium text-foreground",children:h}),e[12]=h,e[13]=f):f=e[13];let p;e[14]!==v?(p=v?t.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:v}):null,e[14]=v,e[15]=p):p=e[15];let E;e[16]!==y||e[17]!==f||e[18]!==p?(E=t.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-8 text-center",children:[y,f,p]}),e[16]=y,e[17]=f,e[18]=p,e[19]=E):E=e[19];const T=E;let g;e[20]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"pb-2",children:t.jsx("label",{htmlFor:"assistant-system-prompt",className:"text-xs font-medium text-muted-foreground",children:"System prompt"})}),e[20]=g):g=e[20];const z=r??"";let O;e[21]!==i?(O=V=>i(V.target.value),e[21]=i,e[22]=O):O=e[22];let R;e[23]!==z||e[24]!==O?(R=t.jsxs("div",{className:"h-full py-5 flex flex-col max-w-2xl mx-auto w-full min-w-0",children:[g,t.jsx(Q,{id:"assistant-system-prompt",value:z,onChange:O,placeholder:"System prompt...",className:"flex-1 min-h-[300px] 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"})]}),e[23]=z,e[24]=O,e[25]=R):R=e[25];const B=R;let M;e[26]!==u.messages||e[27]!==u.status||e[28]!==B||e[29]!==T||e[30]!==o?(M=t.jsx(D.Main,{className:"h-full",innerClassName:"max-w-2xl mx-auto w-full min-w-0",children:o==="edit"?B:u.messages.length===0?t.jsx(D.EmptyState,{children:T}):t.jsx(D.Messages,{messages:u.messages,status:u.status,minHeightOffset:240})}),e[26]=u.messages,e[27]=u.status,e[28]=B,e[29]=T,e[30]=o,e[31]=M):M=e[31];const d=o==="edit"||!I,k=u.status==="submitted"||u.status==="streaming";let j;e[32]!==a||e[33]!==m||e[34]!==N?(j=t.jsx(D.Input.GatewaySelector,{disabled:N,selectedGatewayId:a,onGatewayChange:m}),e[32]=a,e[33]=m,e[34]=N,e[35]=j):j=e[35];let A;e[36]!==l?(A=l?{id:l.id,connectionId:l.connectionId}:void 0,e[36]=l,e[37]=A):A=e[37];let _;e[38]!==c||e[39]!==N||e[40]!==A?(_=t.jsx(D.Input.ModelSelector,{disabled:N,selectedModel:A,onModelChange:c}),e[38]=c,e[39]=N,e[40]=A,e[41]=_):_=e[41];let L;e[42]!==u.messages||e[43]!==u.stop||e[44]!==C||e[45]!==d||e[46]!==k||e[47]!==j||e[48]!==_?(L=t.jsx(D.Footer,{children:t.jsx("div",{className:"max-w-2xl mx-auto w-full min-w-0",children:t.jsxs(D.Input,{onSubmit:C,onStop:u.stop,disabled:d,isStreaming:k,placeholder:"Ask anything or @ for context",usageMessages:u.messages,children:[j,_]})})}),e[42]=u.messages,e[43]=u.stop,e[44]=C,e[45]=d,e[46]=k,e[47]=j,e[48]=_,e[49]=L):L=e[49];let U;return e[50]!==M||e[51]!==L?(U=t.jsxs(D,{children:[M,L]}),e[50]=M,e[51]=L,e[52]=U):U=e[52],U}function Je(s){const e=$.c(18),{value:n,onChange:o,alt:r,size:i}=s,a=i===void 0?"md":i,l=w.useRef(null),m=a==="xs"?"h-6 w-6":a==="sm"?"h-8 w-8":"h-16 w-16",c=a==="xs"?"h-3 w-3":a==="sm"?"h-4 w-4":"h-6 w-6",h=a==="xs"?"h-3 w-3":a==="sm"?"h-3.5 w-3.5":"h-5 w-5";let v;e[0]!==o?(v=E=>{const T=E.target.files?.[0];if(!T)return;const g=new FileReader;g.onloadend=()=>{const z=g.result;o(z)},g.readAsDataURL(T)},e[0]=o,e[1]=v):v=e[1];const b=v;let S;e[2]===Symbol.for("react.memo_cache_sentinel")?(S=()=>{l.current?.click()},e[2]=S):S=e[2];const u=S,I=`relative ${m} shrink-0 cursor-pointer group`;let N;e[3]!==b?(N=t.jsx("input",{type:"file",ref:l,className:"hidden",accept:"image/*",onChange:b}),e[3]=b,e[4]=N):N=e[4];let x;e[5]!==r||e[6]!==c||e[7]!==n?(x=n?t.jsx("img",{src:n,alt:r||"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(H,{className:c})}),e[5]=r,e[6]=c,e[7]=n,e[8]=x):x=e[8];const C=`${h} text-white`;let y;e[9]!==C?(y=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(Te,{className:C})}),e[9]=C,e[10]=y):y=e[10];let f;e[11]!==x||e[12]!==y?(f=t.jsxs("div",{className:"h-full w-full rounded-xl border border-border bg-muted/20 overflow-hidden relative",children:[x,y]}),e[11]=x,e[12]=y,e[13]=f):f=e[13];let p;return e[14]!==I||e[15]!==N||e[16]!==f?(p=t.jsxs("div",{className:I,onClick:u,children:[N,f]}),e[14]=I,e[15]=N,e[16]=f,e[17]=p):p=e[17],p}function We({providerId:s,assistantId:e,onBack:n}){const o=X(),r=n??(()=>o.history.back()),{locator:i}=ye(),[a,l]=ve(Ne.assistantChatActiveThread(i,e),g=>g||crypto.randomUUID()),m=ee(s||W),c=pe(s,"ASSISTANT",e,m),h=ne(s,"ASSISTANT",m),v=h.update.isPending,[b,S]=w.useState(c?.model.id&&c?.gateway_id?"chat":"edit"),{register:u,handleSubmit:I,setValue:N,watch:x,formState:{isDirty:C}}=me({resolver:ue($e),values:c??void 0}),y=x("gateway_id"),f=x("model"),p=x("avatar"),E=x("system_prompt"),T=I(async g=>{await h.update.mutateAsync({id:e,data:g}),S("chat")});return c?t.jsx(Z,{children:t.jsx(w.Suspense,{fallback:t.jsx(se,{}),children:t.jsxs(K,{onBack:r,children:[t.jsx(be,{children:b==="edit"?t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[t.jsx(Je,{size:"xs",value:p,onChange:g=>N("avatar",g,{shouldDirty:!0}),alt:x("title")}),t.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[t.jsx(Y,{...u("title"),placeholder:"Untitled assistant",className:"h-auto border-transparent hover:border-input focus:border-input bg-transparent shadow-none px-0 py-0 text-sm font-medium truncate"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal shrink-0",children:"•"}),t.jsx(Y,{...u("description"),placeholder:"Add a description…",className:"h-auto border-transparent hover:border-input focus:border-input bg-transparent shadow-none px-0 py-0 text-xs text-muted-foreground min-w-0"})]})]}):t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[t.jsx("div",{className:"h-6 w-6 min-w-6 rounded-lg border border-border bg-muted/20 overflow-hidden shrink-0",children:c.avatar?t.jsx("img",{src:c.avatar,alt:c.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(H,{size:12,className:"text-muted-foreground"})})}),t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:c.title}),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",children:c.description})]}):null]})]})}),t.jsx(oe,{children:b==="chat"?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>l(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(Ee,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})}),t.jsx("button",{type:"button",onClick:()=>S("edit"),title:"Edit",className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",children:t.jsx(de,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(J,{variant:"ghost",size:"sm",className:"h-7 gap-1.5",disabled:v,onClick:()=>S("chat"),children:"Cancel"}),t.jsx(J,{variant:"default",size:"sm",className:"h-7 gap-1.5",disabled:!C||v,onClick:()=>{T()},children:v?t.jsxs(t.Fragment,{children:[t.jsx(q,{size:14,className:"animate-spin"}),"Saving..."]}):"Save"})]})}),t.jsx("div",{className:"h-full",children:t.jsx(Fe,{activeThreadId:a,mode:b,systemPrompt:E,onSystemPromptChange:g=>N("system_prompt",g,{shouldDirty:!0}),gatewayId:y,model:f,onGatewayChange:g=>N("gateway_id",g,{shouldDirty:!0}),onModelChange:g=>N("model",{id:g.id,connectionId:g.connectionId},{shouldDirty:!0}),title:c.title,avatar:c.avatar,description:c.description})})]})})}):t.jsx(Z,{children:t.jsx(w.Suspense,{fallback:t.jsx(se,{}),children:t.jsx(K,{onBack:r,children:t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ae,{title:"Assistant not found",description:"This assistant may have been deleted or you may not have access to it."})})})})})}function qe(s){const e=$.c(6),{itemId:n,onBack:o}=s;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const a=G(r).connectionId??W;if(!a||a===W){let m;return e[1]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ae,{title:"Assistant not found",description:"Missing connection information in the current route."})}),e[1]=m):m=e[1],m}let l;return e[2]!==a||e[3]!==n||e[4]!==o?(l=t.jsx(We,{providerId:a,assistantId:n,onBack:o}),e[2]=a,e[3]=n,e[4]=o,e[5]=l):l=e[5],l}const Ge=xe("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 He(s){const e=$.c(10);let n,o,r;e[0]!==s?({className:n,variant:r,...o}=s,e[0]=s,e[1]=n,e[2]=o,e[3]=r):(n=e[1],o=e[2],r=e[3]);let i;e[4]!==n||e[5]!==r?(i=te(Ge({variant:r}),n),e[4]=n,e[5]=r,e[6]=i):i=e[6];let a;return e[7]!==o||e[8]!==i?(a=t.jsx("div",{"data-slot":"alert",role:"alert",className:i,...o}),e[7]=o,e[8]=i,e[9]=a):a=e[9],a}function Ke(s){const e=$.c(8);let n,o;e[0]!==s?({className:n,...o}=s,e[0]=s,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let r;e[3]!==n?(r=te("line-clamp-1 min-h-4 font-medium tracking-tight",n),e[3]=n,e[4]=r):r=e[4];let i;return e[5]!==o||e[6]!==r?(i=t.jsx("div",{"data-slot":"alert-title",className:r,...o}),e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function Ze(s){const e=$.c(8);let n,o;e[0]!==s?({className:n,...o}=s,e[0]=s,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let r;e[3]!==n?(r=te("text-muted-foreground leading-relaxed",n),e[3]=n,e[4]=r):r=e[4];let i;return e[5]!==o||e[6]!==r?(i=t.jsx("div",{"data-slot":"alert-description",className:r,...o}),e[5]=o,e[6]=r,e[7]=i):i=e[7],i}const Ye=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Qe(s){const e=$.c(13),{toolName:n,connectionId:o,onBack:r}=s,i=`/mcp/${o}`;let a;e[0]!==i?(a=new URL(i,window.location.origin),e[0]=i,e[1]=a):a=e[1];const l=a;let m;e[2]!==o?(m={connectionId:o},e[2]=o,e[3]=m):m=e[3];const c=Pe(m);if(!c.isAuthenticated){let b;return e[4]!==c.supportsOAuth||e[5]!==r?(b=t.jsx("div",{className:"flex h-full items-center justify-center",children:c.supportsOAuth?t.jsx(De,{onAuthenticate:()=>r(),buttonText:"Go back to authenticate"}):t.jsx(Re,{hasReadme:!1})}),e[4]=c.supportsOAuth,e[5]=r,e[6]=b):b=e[6],b}const h=`${o}:${n}`;let v;return e[7]!==o||e[8]!==l||e[9]!==r||e[10]!==h||e[11]!==n?(v=t.jsx(Xe,{toolName:n,connectionId:o,mcpProxyUrl:l,onBack:r},h),e[7]=o,e[8]=l,e[9]=r,e[10]=h,e[11]=n,e[12]=v):v=e[12],v}function Xe({toolName:s,connectionId:e,mcpProxyUrl:n,onBack:o}){const{replayId:r}=fe({strict:!1}),i=(()=>{if(!r)return null;const d=`replay-${r}`,k=sessionStorage.getItem(d);if(!k)return null;sessionStorage.removeItem(d);try{return JSON.parse(k)}catch{return null}})(),a=(()=>{if(!i)return null;const d={};for(const[k,j]of Object.entries(i))j!==null&&typeof j=="object"?d[k]=JSON.stringify(j,null,2):d[k]=j;return d})(),[l,m]=w.useState(a??{}),[c,h]=w.useState(i?JSON.stringify(i,null,2):"{}"),[v,b]=w.useState(null),[S,u]=w.useState(null),[I,N]=w.useState(!1),[x,C]=w.useState(null),y=re(e),f=Ve({url:n.href});w.useEffect(()=>{f.error&&console.error("MCP Error:",f.error)},[f.error]);const p=f.tools?.find(d=>d.name===s),E=p?.inputSchema?.properties,T=E?Object.keys(E):[],g=T.length>0,z={};if(g&&p?.inputSchema?.properties)for(const d of T)z[d]=p.inputSchema.required?.includes(d)?"":void 0;const O=d=>Object.prototype.hasOwnProperty.call(l,d),R=async()=>{N(!0),u(null),b(null),C(null);const d=performance.now(),k=ee(e);try{const j=g?{...z,...l}:(()=>{const P=c.trim();if(!P)return{};const F=JSON.parse(P);if(F&&typeof F=="object")return F;throw new Error("Raw JSON input must be an object.")})();g&&p?.inputSchema?.properties&&Object.entries(p.inputSchema.properties).forEach(([P,F])=>{if((F.type==="object"||F.type==="array")&&typeof j[P]=="string")try{j[P]=JSON.parse(j[P])}catch{}});const A=await k(s,j),_=performance.now(),L=Math.round(_-d);b(A);const U=JSON.stringify(A),V=new TextEncoder().encode(U).length;C({duration:`${L}ms`,bytes:`${V} bytes`,tokens:`~${Math.ceil(V/4)} tokens`,cost:"$0.0000"})}catch(j){const A=j instanceof Error?j.message:String(j);u(A||"Unknown error occurred");const _=performance.now();C({duration:`${Math.round(_-d)}ms`})}finally{N(!1)}},B=(d,k)=>{m(j=>({...j,[d]:k}))},M=()=>{b(null),u(null),C(null)};return t.jsxs(K,{onBack:o,children:[t.jsx(oe,{children:t.jsx(Be,{connectionId:e,title:p?.name??Ye(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(ge,{icon:y?.icon||null,name:y?.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:[f.state==="ready"?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):f.state==="connecting"?t.jsx(q,{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:f.state.replace("_"," ")})]})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:p?.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"}),p?.inputSchema?.required&&p.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:g&&p?.inputSchema?.properties?Object.entries(p.inputSchema.properties).map(([d,k])=>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,p.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:k.type})]}),k.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:k.description}),k.type==="object"||k.type==="array"?t.jsx(Q,{className:"font-mono text-xs",value:O(d)?l[d]??"":z[d]??"",onChange:j=>B(d,j.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):t.jsx(Y,{value:O(d)?l[d]??"":z[d]??"",onChange:j=>B(d,j.target.value),placeholder:`Enter ${d}...`})]},d)):p?.inputSchema&&!g?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(Q,{className:"font-mono text-xs min-h-[120px]",value:c,onChange:d=>h(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"}),x&&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(ze,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:x.duration})]}),x.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ie,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:x.tokens})]}),x.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ce,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:x.bytes})]}),x.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:x.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(J,{size:"sm",variant:"default",className:"h-8 gap-2 flex-1 lg:flex-none",onClick:R,disabled:I,children:I?t.jsxs(t.Fragment,{children:[t.jsx(q,{size:14,className:"animate-spin"}),"Executing..."]}):t.jsxs(t.Fragment,{children:[t.jsx(Oe,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})}),t.jsx(we,{children:t.jsxs(Se,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(J,{size:"icon",variant:"outline",className:"h-8 w-8 shrink-0",onClick:M,disabled:!v&&!S,children:t.jsx(Le,{size:14})})}),t.jsx(ke,{children:t.jsx("p",{children:"Clear results"})})]})})]})}),S&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(He,{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(Ae,{className:"h-4 w-4"}),t.jsx(Ke,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(Ze,{className:"text-xs text-destructive",children:S})]})})}),t.jsx("div",{className:"relative flex-1 overflow-auto bg-muted/50",children:v?t.jsxs(t.Fragment,{children:[t.jsx(Me,{jsonString:JSON.stringify(v,null,2),padding:"1.5rem"}),t.jsx(J,{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(v,null,2)),he.success("Copied to clipboard")},children:t.jsx(_e,{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(le,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]})]})]})}function et(s){const e=$.c(7),{itemId:n,onBack:o}=s;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const a=G(r).connectionId??W;if(!re(a)){let h;return e[1]===Symbol.for("react.memo_cache_sentinel")?(h=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]=h):h=e[1],h}let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(q,{size:32,className:"animate-spin text-muted-foreground"})}),e[2]=m):m=e[2];let c;return e[3]!==a||e[4]!==o||e[5]!==n?(c=t.jsx(w.Suspense,{fallback:m,children:t.jsx(Qe,{toolName:n,connectionId:a,onBack:o})}),e[3]=a,e[4]=o,e[5]=n,e[6]=c):c=e[6],c}const tt={assistant:qe};function st(){const s=$.c(6),e=X();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 o=G(n),r=decodeURIComponent(o.itemId);let i;s[1]!==e.history?(i=()=>{e.history.back()},s[1]=e.history,s[2]=i):i=s[2];const a=i,l=nt;let m;return s[3]!==a||s[4]!==r?(m=t.jsx(et,{itemId:r,onBack:a,onUpdate:l}),s[3]=a,s[4]=r,s[5]=m):m=s[5],m}async function nt(s){return Promise.resolve()}function rt(){const s=$.c(18),e=X();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 o=G(n),r=o.connectionId,i=decodeURIComponent(o.collectionName),a=decodeURIComponent(o.itemId);let l;s[1]!==e.history?(l=()=>{e.history.back()},s[1]=e.history,s[2]=l):l=s[2];const m=l,c=r??W;let h;s[3]!==c?(h=ee(c),s[3]=c,s[4]=h):h=s[4];const b=ne(c,i,h);let S;s[5]!==b||s[6]!==a?(S=async f=>{a&&await b.update.mutateAsync({id:a,data:f})},s[5]=b,s[6]=a,s[7]=S):S=s[7];const u=S;let I;s[8]!==i?(I=i?.toLowerCase(),s[8]=i,s[9]=I):I=s[9];const N=I,x=N&&tt[N];if(x){let f;return s[10]!==x||s[11]!==m||s[12]!==u||s[13]!==a?(f=t.jsx(x,{itemId:a,onBack:m,onUpdate:u}),s[10]=x,s[11]=m,s[12]=u,s[13]=a,s[14]=f):f=s[14],f}let C;s[15]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(je,{size:36,className:"text-muted-foreground"}),s[15]=C):C=s[15];let y;return s[16]!==m?(y=t.jsx(Ue,{icon:C,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:m,children:"Go back"}}),s[16]=m,s[17]=y):y=s[17],y}function ot(){const s=$.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=G(e);if(decodeURIComponent(n.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(st,{}),s[1]=a):a=s[1],a}let i;return s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(rt,{}),s[2]=i):i=s[2],i}function ss(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Z,{children:t.jsx(w.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(q,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(ot,{})})}),s[0]=e):e=s[0],e}export{ss as default};
|