@decocms/mesh 1.0.0-alpha.8 → 1.0.0

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.
Files changed (171) hide show
  1. package/dist/README.md +287 -0
  2. package/dist/client/assets/AlertCircle-Cu9USDUK.js +1 -0
  3. package/dist/client/assets/ArrowLeft-nKBVB_NL.js +1 -0
  4. package/dist/client/assets/CheckCircle-BogvGi-0.js +1 -0
  5. package/dist/client/assets/ChevronDown-B5vWNgW1.js +1 -0
  6. package/dist/client/assets/Clock-Ck2lYkyl.js +1 -0
  7. package/dist/client/assets/Copy01-BeUF9LPk.js +1 -0
  8. package/dist/client/assets/CpuChip02-8BkRby_U.js +1 -0
  9. package/dist/client/assets/DotsVertical-CmKPHj4W.js +1 -0
  10. package/dist/client/assets/File06-Cn7JLPIx.js +1 -0
  11. package/dist/client/assets/Grid01-4uSGUJjV.js +1 -0
  12. package/dist/client/assets/Inbox01-C8nofD1D.js +1 -0
  13. package/dist/client/assets/InfoCircle-C21KXVBJ.js +1 -0
  14. package/dist/client/assets/Key01-CzDrcb2u.js +1 -0
  15. package/dist/client/assets/LinkExternal01-DhNFEAza.js +1 -0
  16. package/dist/client/assets/Loading01-BUZAT-Ht.js +1 -0
  17. package/dist/client/assets/Plus-DTWKiMkv.js +1 -0
  18. package/dist/client/assets/SearchMd-BXC4Yoz_.js +1 -0
  19. package/dist/client/assets/Trash01-KhsmIXrl.js +1 -0
  20. package/dist/client/assets/Upload01-Dm3ykMHj.js +1 -0
  21. package/dist/client/assets/X-BFstV52u.js +1 -0
  22. package/dist/client/assets/XClose-OisY7Sog.js +1 -0
  23. package/dist/client/assets/{alert-dialog-pYV3wSPs.js → alert-dialog-Ck-TQRXx.js} +3 -3
  24. package/dist/client/assets/app-name-gTETL9So.js +1 -0
  25. package/dist/client/assets/auth-DB_JGgAS.js +1 -0
  26. package/dist/client/assets/{auth-catchall-BZaDWHEa.js → auth-catchall-DDvXFYk4.js} +1 -1
  27. package/dist/client/assets/avatar-CqnXtnOZ.js +1 -0
  28. package/dist/client/assets/badge-RGvdF-cd.js +1 -0
  29. package/dist/client/assets/button-Chm7HSn5.js +1 -0
  30. package/dist/client/assets/{card-CE1-D3SY.js → card-BVamKRXq.js} +1 -1
  31. package/dist/client/assets/checkbox-BMbqVqRo.js +1 -0
  32. package/dist/client/assets/collection-detail-UyMhNT0c.js +1 -0
  33. package/dist/client/assets/collection-display-button-DDw_0fW6.js +1 -0
  34. package/dist/client/assets/collection-header-BVYMmoel.js +1 -0
  35. package/dist/client/assets/{collection-page-C_ScBEek.js → collection-page-BoS9hpji.js} +1 -1
  36. package/dist/client/assets/collection-search-CBHWh6W9.js +1 -0
  37. package/dist/client/assets/collection-table-wrapper-CGsO_-78.js +1 -0
  38. package/dist/client/assets/connection-card-D6fhK6Cn.js +1 -0
  39. package/dist/client/assets/connection-detail-ClFH3Tdf.js +1 -0
  40. package/dist/client/assets/connections-BtC-4KRY.js +1 -0
  41. package/dist/client/assets/core-BiybLldu.js +6 -0
  42. package/dist/client/assets/create-organization-dialog-D3ZZuPXS.js +1 -0
  43. package/dist/client/assets/deco-chat-skeleton-DHRag8GN.js +124 -0
  44. package/dist/client/assets/dialog-kXtxooG_.js +1 -0
  45. package/dist/client/assets/dropdown-menu-MeaPHHuN.js +1 -0
  46. package/dist/client/assets/error-boundary-m5kquR9K.js +1 -0
  47. package/dist/client/assets/{extract-connection-data-Cu9jjhV-.js → extract-connection-data-BSn-ydRW.js} +1 -1
  48. package/dist/client/assets/form-BBS_Tp5l.js +1 -0
  49. package/dist/client/assets/formatDistanceToNow-Dkl3nWpl.js +1 -0
  50. package/dist/client/assets/gateway-detail-B6IgcRfH.js +1 -0
  51. package/dist/client/assets/gateways-Bu8MP7ql.js +1 -0
  52. package/dist/client/assets/home-BYCoW2D_.js +1 -0
  53. package/dist/client/assets/index-BZz7aGs7.js +32 -0
  54. package/dist/client/assets/index-C4a1DvcM.js +118 -0
  55. package/dist/client/assets/index-MyldRbGR.css +1 -0
  56. package/dist/client/assets/index-RS2MPOun.js +1 -0
  57. package/dist/client/assets/index-hySmljwG.js +1 -0
  58. package/dist/client/assets/{input-CXe38a5R.js → input-DCV4VviT.js} +1 -1
  59. package/dist/client/assets/json-BESjz4hO.js +1 -0
  60. package/dist/client/assets/json-CtxcuNHM.js +1 -0
  61. package/dist/client/assets/json-syntax-highlighter-VMspUwuH.js +2 -0
  62. package/dist/client/assets/layout-BkDVhV_I.js +1 -0
  63. package/dist/client/assets/lazy-highlighter-Bx9tA9px.js +4 -0
  64. package/dist/client/assets/localstorage-keys-G21128-2.js +1 -0
  65. package/dist/client/assets/login-DEwqVT25.js +1 -0
  66. package/dist/client/assets/mcp-oauth-Cm2UNUay.js +1 -0
  67. package/dist/client/assets/members-BpGlve-L.js +3 -0
  68. package/dist/client/assets/monitoring-DHEto-A6.js +1 -0
  69. package/dist/client/assets/oauth-callback-DchNKQy2.js +1 -0
  70. package/dist/client/assets/page-BZV40eAE.css +1 -0
  71. package/dist/client/assets/page-DGoTXd70.js +21 -0
  72. package/dist/client/assets/popover-Cx3pFfUQ.js +1 -0
  73. package/dist/client/assets/prism-light-DhG4KyCm.js +1 -0
  74. package/dist/client/assets/resource-tabs-n23Yoxcd.js +1 -0
  75. package/dist/client/assets/schema-DIY49r7a.js +1 -0
  76. package/dist/client/assets/select-BXHiOY7b.js +1 -0
  77. package/dist/client/assets/settings-BwVTvZ32.js +1 -0
  78. package/dist/client/assets/shell-layout-BqZsnuW0.js +17 -0
  79. package/dist/client/assets/slugify-CEUa2lfQ.js +1 -0
  80. package/dist/client/assets/spinner-zi1IadXF.js +1 -0
  81. package/dist/client/assets/store-Bu-y0GHn.js +1 -0
  82. package/dist/client/assets/store-app-detail-BswrVEFL.js +1 -0
  83. package/dist/client/assets/switch-C8nDXRDi.js +1 -0
  84. package/dist/client/assets/{textarea-BK0_vna7.js → textarea-BA6caASm.js} +1 -1
  85. package/dist/client/assets/tools-list-Cw4QW2l7.js +1 -0
  86. package/dist/client/assets/tooltip-DZ8PMo3S.js +1 -0
  87. package/dist/client/assets/types-DsEr-_hk.js +44 -0
  88. package/dist/client/assets/use-binding-C1zXgwae.js +5 -0
  89. package/dist/client/assets/use-connection-8aFd9ZgQ.js +2 -0
  90. package/dist/client/assets/use-connection-resources-BaWWtVSI.js +1 -0
  91. package/dist/client/assets/{use-gateway-B9o1M04u.js → use-gateway-BGsZlt6a.js} +1 -1
  92. package/dist/client/assets/use-list-state-DhJWwg48.js +1 -0
  93. package/dist/client/assets/use-mcp-BJzX7M7c.js +1 -0
  94. package/dist/client/assets/use-members-BNSWYzmJ.js +1 -0
  95. package/dist/client/assets/{use-mobile-BjUr6Jaq.js → use-mobile-BQAr1bEF.js} +1 -1
  96. package/dist/client/assets/use-organization-settings-CAOHB7nk.js +1 -0
  97. package/dist/client/assets/use-tool-call-Dxebi6Uq.js +1 -0
  98. package/dist/client/assets/useQuery-39cprZL6.js +1 -0
  99. package/dist/client/assets/utils-BXNVuJET.js +1 -0
  100. package/dist/client/assets/well-known-mcp-DizRQm94.js +1 -0
  101. package/dist/client/index.html +2 -2
  102. package/dist/server/cli.js +247 -254
  103. package/dist/server/migrate.js +206 -204
  104. package/dist/server/server.js +261 -270
  105. package/package.json +10 -7
  106. package/dist/client/assets/app-name-DQPOjnhR.js +0 -1
  107. package/dist/client/assets/auth-D1xg1rd7.js +0 -1
  108. package/dist/client/assets/avatar-DAMcOnM4.js +0 -1
  109. package/dist/client/assets/badge-Bi_GpkO_.js +0 -1
  110. package/dist/client/assets/button-G3aMPyFq.js +0 -1
  111. package/dist/client/assets/checkbox-DgaTW36u.js +0 -1
  112. package/dist/client/assets/chunk-2RRQPJJO-DGhxLrrR.js +0 -1
  113. package/dist/client/assets/circle-alert-B9wPiUFk.js +0 -1
  114. package/dist/client/assets/collection-detail-Bj_y2m-h.js +0 -1
  115. package/dist/client/assets/collection-display-button-BOWw7rwa.js +0 -1
  116. package/dist/client/assets/collection-header-BeSLFcaG.js +0 -1
  117. package/dist/client/assets/collection-search-DFSSOoxU.js +0 -1
  118. package/dist/client/assets/collection-table-wrapper-CKt7U95e.js +0 -1
  119. package/dist/client/assets/connection-card-Bj0wmYgV.js +0 -1
  120. package/dist/client/assets/connection-detail-kWSPNag3.js +0 -1
  121. package/dist/client/assets/connections-C7HPEBbQ.js +0 -1
  122. package/dist/client/assets/create-organization-dialog-BpSaszPg.js +0 -1
  123. package/dist/client/assets/dialog-C1eFYVPZ.js +0 -1
  124. package/dist/client/assets/dropdown-menu-CtSLEdvQ.js +0 -1
  125. package/dist/client/assets/empty-state-YCqZyamY.js +0 -1
  126. package/dist/client/assets/error-boundary-9CuK9oWa.js +0 -1
  127. package/dist/client/assets/form-BsxjQn2d.js +0 -1
  128. package/dist/client/assets/formatDistanceToNow-Ctx6mZEP.js +0 -1
  129. package/dist/client/assets/gateway-detail-C5d-KPPl.js +0 -1
  130. package/dist/client/assets/gateways-BSgfG0sP.js +0 -1
  131. package/dist/client/assets/home-Bu1wH9nU.js +0 -1
  132. package/dist/client/assets/icon-Cxep_tfx.js +0 -1
  133. package/dist/client/assets/index-BRGTweKk.js +0 -1
  134. package/dist/client/assets/index-Bhg5-H1t.js +0 -32
  135. package/dist/client/assets/index-BtenH3n7.js +0 -1
  136. package/dist/client/assets/index-MoI-rvC3.js +0 -118
  137. package/dist/client/assets/index-feMggVqN.css +0 -1
  138. package/dist/client/assets/index-fqd6S2iW.js +0 -1
  139. package/dist/client/assets/integration-icon-C162QlgN.js +0 -1
  140. package/dist/client/assets/layout-DqgJyIdL.js +0 -1
  141. package/dist/client/assets/lazy-highlighter-DdBDXFu3.js +0 -1
  142. package/dist/client/assets/localstorage-keys-CzubTFSO.js +0 -1
  143. package/dist/client/assets/login-CTfLDBBt.js +0 -1
  144. package/dist/client/assets/members-B8JX8n6Q.js +0 -1
  145. package/dist/client/assets/monitoring-D7cSD8lu.js +0 -1
  146. package/dist/client/assets/monitoring-stats-row-CX3aDsAR.js +0 -42
  147. package/dist/client/assets/oauth-callback-BSpJjtnq.js +0 -10
  148. package/dist/client/assets/page-DEl_xdLR.js +0 -1
  149. package/dist/client/assets/popover-iDiv_aJK.js +0 -1
  150. package/dist/client/assets/prism-vdds-nIT.js +0 -9
  151. package/dist/client/assets/resource-tabs-CNxf_u1f.js +0 -1
  152. package/dist/client/assets/schema-BJ2fRDqu.js +0 -1
  153. package/dist/client/assets/select-B4j1Cb8E.js +0 -1
  154. package/dist/client/assets/settings-CJre-VTk.js +0 -1
  155. package/dist/client/assets/shell-layout-BqISuLuR.js +0 -124
  156. package/dist/client/assets/spinner-BgjBycmB.js +0 -1
  157. package/dist/client/assets/store-CL6xQwes.js +0 -1
  158. package/dist/client/assets/store-app-detail-BqHjNu0f.js +0 -1
  159. package/dist/client/assets/tool-set-selector-DYpFtHWh.js +0 -1
  160. package/dist/client/assets/tooltip-CyReuecv.js +0 -1
  161. package/dist/client/assets/upload-n_AaBb-Z.js +0 -1
  162. package/dist/client/assets/use-binding-DdwHCRqV.js +0 -5
  163. package/dist/client/assets/use-connection-DiHU9E79.js +0 -2
  164. package/dist/client/assets/use-list-state-CKwEYaZT.js +0 -1
  165. package/dist/client/assets/use-members-BH0kTiC2.js +0 -1
  166. package/dist/client/assets/use-organization-settings-Cywci2R8.js +0 -1
  167. package/dist/client/assets/use-tool-call-CPpXYXAZ.js +0 -1
  168. package/dist/client/assets/useQuery-BpCQj7wy.js +0 -1
  169. package/dist/client/assets/utils-BLlwSV8I.js +0 -1
  170. package/dist/client/assets/well-known-mcp-Dq2j3ucM.js +0 -1
  171. /package/dist/client/assets/{resource-tabs-CSRUKxnt.css → tools-list-CSRUKxnt.css} +0 -0
@@ -1 +0,0 @@
1
- import{a2 as U,j as t,c as F,a5 as W,r as M}from"./index-MoI-rvC3.js";import{u as Y}from"./useQuery-BpCQj7wy.js";import{I as K}from"./icon-Cxep_tfx.js";import{e as J}from"./registry-utils-ulDDT0d8.js";import{C as P}from"./collection-display-button-BOWw7rwa.js";import{C as X}from"./collection-search-DFSSOoxU.js";import{C as Z}from"./collection-table-wrapper-CKt7U95e.js";import{E as H}from"./empty-state-YCqZyamY.js";import{I as ee}from"./integration-icon-C162QlgN.js";import{C as te}from"./card-CE1-D3SY.js";import{V as oe}from"./layout-DqgJyIdL.js";import{c as $}from"./utils-BLlwSV8I.js";import{B as re}from"./badge-Bi_GpkO_.js";import{B as se}from"./button-G3aMPyFq.js";function ne(o){return o.replace(/<a[^>]*class="[^"]*anchor[^"]*"[^>]*>.*?<\/a>/gi,"")}function ae(o){return o.replace(/<a\s+([^>]*href="[^"]*"[^>]*)>/gi,(e,a)=>a.includes("target=")?e.replace(/target="[^"]*"/gi,'target="_blank"'):`<a ${a} target="_blank" rel="noopener noreferrer">`)}function ie(o){let e=ne(o);return e=ae(e),e}function Ee({repository:o}){const e=o?J(o):null,{data:a,isLoading:c}=Y({queryKey:U.githubReadme(e?.owner,e?.repo),queryFn:async()=>{if(!e)return null;try{const s=await fetch(`https://api.github.com/repos/${e.owner}/${e.repo}/readme`,{headers:{Accept:"application/vnd.github.v3.html"}});if(!s.ok){if(s.status===404)return null;throw new Error(`Failed to fetch README: ${s.statusText}`)}const m=await s.text();return ie(m)}catch(s){return console.error("Error fetching README:",s),null}},enabled:!!e&&!!o,staleTime:3600*1e3,gcTime:1440*60*1e3});return c?t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx(K,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}):a?t.jsx("div",{className:"p-6 markdown-body",style:{backgroundColor:"transparent"},dangerouslySetInnerHTML:{__html:a}}):t.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-6",children:[t.jsx(K,{name:"description",size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"README not found"}),t.jsx("p",{className:"text-muted-foreground max-w-md",children:"This repository doesn't have a README file, or it's not publicly accessible."})]})}function Re(o){const e=F.c(39),{tools:a,connectionId:c,org:s,onToolClick:m,showToolbar:u,emptyMessage:f}=o,h=u===void 0?!0:u,p=f===void 0?"This connection doesn't have any tools yet.":f,d=W(),[n,A]=M.useState(""),[x,q]=M.useState("table"),[i,_]=M.useState("name"),[l,V]=M.useState("asc");let C;e[0]!==l||e[1]!==i?(C=r=>{i===r?(V(ue),l==="desc"&&_(void 0)):(_(r),V("asc"))},e[0]=l,e[1]=i,e[2]=C):C=e[2];const g=C;let S;e[3]!==c||e[4]!==d||e[5]!==m||e[6]!==s?(S=r=>{m?m(r):c&&s&&d({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:s,connectionId:c,collectionName:"tools",itemId:encodeURIComponent(r.name)}})},e[3]=c,e[4]=d,e[5]=m,e[6]=s,e[7]=S):S=e[7];const T=S;let E;if(e[8]!==n||e[9]!==l||e[10]!==i||e[11]!==a){const r=!a||a.length===0?[]:n.trim()?(()=>{const L=n.toLowerCase();return a.filter(w=>w.name.toLowerCase().includes(L)||w.description&&w.description.toLowerCase().includes(L))})():a;E=!i||!l?r:[...r].sort((L,w)=>{const O=L[i]||"",Q=w[i]||"",B=String(O).localeCompare(String(Q));return l==="asc"?B:-B}),e[8]=n,e[9]=l,e[10]=i,e[11]=a,e[12]=E}else E=e[12];const v=E;let R;e[13]===Symbol.for("react.memo_cache_sentinel")?(R=[{id:"name",header:"Name",render:de,sortable:!0},{id:"description",header:"Description",render:me,cellClassName:"flex-1",sortable:!0}],e[13]=R):R=e[13];const z=R;let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=z.filter(ce).map(le),e[14]=k):k=e[14];const G=k;let b;e[15]!==g||e[16]!==h||e[17]!==l||e[18]!==i||e[19]!==x?(b=h&&t.jsx(oe,{children:t.jsx(P,{viewMode:x,onViewModeChange:q,sortKey:i,sortDirection:l,onSort:g,sortOptions:G})}),e[15]=g,e[16]=h,e[17]=l,e[18]=i,e[19]=x,e[20]=b):b=e[20];let I;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=r=>{r.key==="Escape"&&(A(""),r.target.blur())},e[21]=I):I=e[21];let j;e[22]!==n?(j=t.jsx(X,{value:n,onChange:A,placeholder:"Search tools...",onKeyDown:I}),e[22]=n,e[23]=j):j=e[23];let y;e[24]!==p||e[25]!==g||e[26]!==T||e[27]!==n||e[28]!==l||e[29]!==i||e[30]!==v||e[31]!==x?(y=x==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:v.length===0?t.jsx(H,{image:null,title:n?"No tools found":"No tools available",description:n?"Try adjusting your search terms":p}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:v.map(r=>t.jsx(te,{className:"cursor-pointer transition-colors",onClick:()=>T(r),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(ee,{icon:null,name:r.name,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:r.name}),t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:r.description||"No description"})]})]})},r.name))})}):t.jsx(Z,{columns:z,data:v,isLoading:!1,sortKey:i,sortDirection:l,onSort:g,onRowClick:r=>T(r),emptyState:t.jsx(H,{image:null,title:n?"No tools found":"No tools available",description:n?"Try adjusting your search terms":p})}),e[24]=p,e[25]=g,e[26]=T,e[27]=n,e[28]=l,e[29]=i,e[30]=v,e[31]=x,e[32]=y):y=e[32];let N;e[33]!==j||e[34]!==y?(N=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[j,y]}),e[33]=j,e[34]=y,e[35]=N):N=e[35];let D;return e[36]!==N||e[37]!==b?(D=t.jsxs(t.Fragment,{children:[b,N]}),e[36]=N,e[37]=b,e[38]=D):D=e[38],D}function le(o){return{id:o.id,label:typeof o.header=="string"?o.header:o.id}}function ce(o){return o.sortable}function me(o){return t.jsx("span",{className:"text-sm text-foreground",children:o.description||"—"})}function de(o){return t.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:o.name})}function ue(o){return o==="asc"?"desc":o==="desc"?null:"asc"}function ke(o){const e=F.c(12),{tabs:a,activeTab:c,onTabChange:s,className:m}=o;let u;e[0]!==m?(u=$("flex items-center gap-2 overflow-x-auto no-scrollbar",m),e[0]=m,e[1]=u):u=e[1];let f;if(e[2]!==c||e[3]!==s||e[4]!==a){let p;e[6]!==c||e[7]!==s?(p=d=>{const n=c===d.id;return t.jsxs(se,{variant:"outline",size:"sm",onClick:()=>s(d.id),className:$("h-8 rounded-lg border border-transparent bg-transparent px-3 py-1 hover:bg-muted",n&&"bg-muted border-input text-foreground font-medium",!n&&"text-muted-foreground font-normal"),children:[d.label,d.count!==void 0&&t.jsx(re,{variant:"secondary",className:$("ml-2 h-5 min-w-5 px-1 rounded-full text-[10px] font-mono",n?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:d.count})]},d.id)},e[6]=c,e[7]=s,e[8]=p):p=e[8],f=a.map(p),e[2]=c,e[3]=s,e[4]=a,e[5]=f}else f=e[5];let h;return e[9]!==u||e[10]!==f?(h=t.jsx("div",{className:u,children:f}),e[9]=u,e[10]=f,e[11]=h):h=e[11],h}export{ke as R,Re as T,Ee as a};
@@ -1 +0,0 @@
1
- import{ap as a,bi as i,bj as n,bk as t,aq as e,bl as o}from"./index-MoI-rvC3.js";const r=a({authorizationEndpoint:e().url(),tokenEndpoint:e().url(),introspectionEndpoint:e().url().optional(),clientId:e(),clientSecret:e().optional(),scopes:n(e()),grantType:i(["authorization_code","client_credentials"])}),s=a({name:e(),description:e().optional(),inputSchema:t(o()),outputSchema:t(o()).optional()}),c=a({id:e().describe("Unique identifier for the connection"),title:e().describe("Human-readable name for the connection"),created_at:e().describe("When the connection was created"),updated_at:e().describe("When the connection was last updated"),created_by:e().describe("User ID who created the connection"),updated_by:e().optional().describe("User ID who last updated the connection"),organization_id:e().describe("Organization ID this connection belongs to"),description:e().nullable().describe("Description of the connection"),icon:e().nullable().describe("Icon URL for the connection"),app_name:e().nullable().describe("Associated app name"),app_id:e().nullable().describe("Associated app ID"),connection_type:i(["HTTP","SSE","Websocket"]).describe("Type of connection"),connection_url:e().describe("URL for the connection"),connection_token:e().nullable().describe("Authentication token"),connection_headers:t(e(),e()).nullable().describe("Custom headers"),oauth_config:r.nullable().describe("OAuth configuration"),configuration_state:t(o()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:n(e()).nullable().optional().describe("Configuration scopes"),metadata:t(o()).nullable().describe("Additional metadata (includes repository info)"),tools:n(s).nullable().describe("Discovered tools from MCP"),bindings:n(e()).nullable().describe("Detected bindings"),status:i(["active","inactive","error"]).describe("Current status")});c.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!0}).partial({id:!0,description:!0,icon:!0,app_name:!0,app_id:!0,connection_token:!0,connection_headers:!0,oauth_config:!0,configuration_state:!0,configuration_scopes:!0,metadata:!0});c.partial();export{c as C};
@@ -1 +0,0 @@
1
- import{r as i,aM as Ee,aA as rt,aO as Ne,j as d,aP as st,aB as lt,aQ as be,bh as at,az as k,aN as ct,aC as j,aE as N,aF as $,aR as it,aJ as Re,bf as dt,a0 as ut,aS as pt,aV as ft,aT as mt,aU as ht,aW as vt,aX as gt,aY as xt,aZ as St,c as ee}from"./index-MoI-rvC3.js";import{V as wt,c as Te}from"./tooltip-CyReuecv.js";import{c as oe}from"./utils-BLlwSV8I.js";function Pe(r,[e,t]){return Math.min(t,Math.max(e,r))}var Ct=[" ","Enter","ArrowUp","ArrowDown"],yt=[" ","Enter"],J="Select",[de,ue,It]=at(J),[ne]=lt(J,[It,Ee]),pe=Ee(),[bt,G]=ne(J),[Tt,_t]=ne(J),je=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:c,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:w,required:C,form:S}=r,p=pe(e),[v,y]=i.useState(null),[m,x]=i.useState(null),[z,M]=i.useState(!1),re=rt(u),[P,O]=Ne({prop:o,defaultProp:n??!1,onChange:c,caller:J}),[F,q]=Ne({prop:s,defaultProp:l,onChange:a,caller:J}),L=i.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=i.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(st,{...p,children:d.jsxs(bt,{required:C,scope:e,trigger:v,onTriggerChange:y,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:z,onValueNodeHasChildrenChange:M,contentId:be(),value:F,onValueChange:q,open:P,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:w,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Tt,{scope:r.__scopeSelect,onNativeOptionAdd:i.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:i.useCallback(E=>{V(D=>{const U=new Set(D);return U.delete(E),U})},[]),children:t})}),B?d.jsxs(Qe,{"aria-hidden":!0,required:C,tabIndex:-1,name:h,autoComplete:g,value:F,onChange:E=>q(E.target.value),disabled:w,form:S,children:[F===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=J;var Me="SelectTrigger",Ae=i.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,c=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=i.useRef("touch"),[g,w,C]=tt(p=>{const v=u().filter(x=>!x.disabled),y=v.find(x=>x.value===s.value),m=ot(v,p,y);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),C()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(ct,{asChild:!0,...c,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...n,ref:a,onClick:N(n.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:N(n.onPointerDown,p=>{h.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:N(n.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&w(p.key),!(v&&p.key===" ")&&Ct.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:c,placeholder:s="",...l}=r,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=c!==void 0,g=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):c})});De.displayName=Oe;var Nt="SelectIcon",ke=i.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return d.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});ke.displayName=Nt;var Pt="SelectPortal",Le=r=>d.jsx(it,{asChild:!0,...r});Le.displayName=Pt;var Q="SelectContent",Be=i.forwardRef((r,e)=>{const t=G(Q,r.__scopeSelect),[o,n]=i.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const c=o;return c?Re.createPortal(d.jsx(Ve,{scope:r.__scopeSelect,children:d.jsx(de.Slot,{scope:r.__scopeSelect,children:d.jsx("div",{children:r.children})})}),c):null}return d.jsx(He,{...r,ref:e})});Be.displayName=Q;var A=10,[Ve,Y]=ne(Q),Et="SelectContentImpl",Rt=ht("SelectContent.RemoveScroll"),He=i.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:c,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:w,collisionPadding:C,sticky:S,hideWhenDetached:p,avoidCollisions:v,...y}=r,m=G(Q,t),[x,z]=i.useState(null),[M,re]=i.useState(null),P=k(e,f=>z(f)),[O,F]=i.useState(null),[q,L]=i.useState(null),B=ue(t),[W,V]=i.useState(!1),H=i.useRef(!1);i.useEffect(()=>{if(x)return pt(x)},[x]),ft();const E=i.useCallback(f=>{const[T,...R]=B().map(_=>_.ref.current),[I]=R.slice(-1),b=document.activeElement;for(const _ of f)if(_===b||(_?.scrollIntoView({block:"nearest"}),_===T&&M&&(M.scrollTop=0),_===I&&M&&(M.scrollTop=M.scrollHeight),_?.focus(),document.activeElement!==b))return},[B,M]),D=i.useCallback(()=>E([O,x]),[E,O,x]);i.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:U,triggerPointerDownPosRef:K}=m;i.useEffect(()=>{if(x){let f={x:0,y:0};const T=I=>{f={x:Math.abs(Math.round(I.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(I.pageY)-(K.current?.y??0))}},R=I=>{f.x<=10&&f.y<=10?I.preventDefault():x.contains(I.target)||U(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,U,K]),i.useEffect(()=>{const f=()=>U(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[U]);const[fe,ae]=tt(f=>{const T=B().filter(b=>!b.disabled),R=T.find(b=>b.ref.current===document.activeElement),I=ot(T,f,R);I&&setTimeout(()=>I.ref.current.focus())}),me=i.useCallback((f,T,R)=>{const I=!H.current&&!R;(m.value!==void 0&&m.value===T||I)&&(F(f),I&&(H.current=!0))},[m.value]),he=i.useCallback(()=>x?.focus(),[x]),te=i.useCallback((f,T,R)=>{const I=!H.current&&!R;(m.value!==void 0&&m.value===T||I)&&L(f)},[m.value]),ce=o==="popper"?Se:Ue,se=ce===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:w,collisionPadding:C,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return d.jsx(Ve,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:d.jsx(mt,{as:Rt,allowPinchZoom:!0,children:d.jsx(vt,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:N(n,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(gt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ce,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...y,...se,onPlaced:()=>V(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:N(y.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let I=B().filter(b=>!b.disabled).map(b=>b.ref.current);if(["ArrowUp","End"].includes(f.key)&&(I=I.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const b=f.target,_=I.indexOf(b);I=I.slice(_+1)}setTimeout(()=>E(I)),f.preventDefault()}})})})})})})});He.displayName=Et;var jt="SelectItemAlignedPosition",Ue=i.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,c=G(Q,t),s=Y(Q,t),[l,a]=i.useState(null),[u,h]=i.useState(null),g=k(e,P=>h(P)),w=ue(t),C=i.useRef(!1),S=i.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:y,focusSelectedItem:m}=s,x=i.useCallback(()=>{if(c.trigger&&c.valueNode&&l&&u&&p&&v&&y){const P=c.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),F=c.valueNode.getBoundingClientRect(),q=y.getBoundingClientRect();if(c.dir!=="rtl"){const b=q.left-O.left,_=F.left-b,X=P.left-_,Z=P.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Pe(_,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const b=O.right-q.right,_=window.innerWidth-F.right-b,X=window.innerWidth-P.right-_,Z=P.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Pe(_,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=w(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),U=parseInt(V.paddingBottom,10),K=H+E+W+U+D,fe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=P.top+P.height/2-A,ce=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const b=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const _=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ce,se+(b?he:0)+_+D),Z=T+X;l.style.height=Z+"px"}else{const b=L.length>0&&v===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(b?me:0)+se)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>C.current=!0)}},[w,c.trigger,c.valueNode,l,u,p,v,y,c.dir,o]);$(()=>x(),[x]);const[z,M]=i.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=i.useCallback(P=>{P&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(At,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:C,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:z},children:d.jsx(j.div,{...n,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});Ue.displayName=jt;var Mt="SelectPopperPosition",Se=i.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...c}=r,s=pe(t);return d.jsx(xt,{...s,...c,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...c.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=Mt;var[At,_e]=ne(Q,{}),we="SelectViewport",ze=i.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,c=Y(we,t),s=_e(we,t),l=k(e,c.onViewportChange),a=i.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:N(n.onScroll,u=>{const h=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:w}=s;if(w?.current&&g){const C=Math.abs(a.current-h.scrollTop);if(C>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),y=Math.max(p,v);if(y<S){const m=y+C,x=Math.min(S,m),z=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=z>0?z:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});ze.displayName=we;var Fe="SelectGroup",[Ot,Dt]=ne(Fe),kt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=be();return d.jsx(Ot,{scope:t,id:n,children:d.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});kt.displayName=Fe;var We="SelectLabel",Lt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=Dt(We,t);return d.jsx(j.div,{id:n.id,...o,ref:e})});Lt.displayName=We;var ie="SelectItem",[Bt,Ke]=ne(ie),$e=i.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:c,...s}=r,l=G(ie,t),a=Y(ie,t),u=l.value===o,[h,g]=i.useState(c??""),[w,C]=i.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=be(),v=i.useRef("touch"),y=()=>{n||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Bt,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:i.useCallback(m=>{g(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":w?"":void 0,"aria-selected":u&&w,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:N(s.onFocus,()=>C(!0)),onBlur:N(s.onBlur,()=>C(!1)),onClick:N(s.onClick,()=>{v.current!=="mouse"&&y()}),onPointerUp:N(s.onPointerUp,()=>{v.current==="mouse"&&y()}),onPointerDown:N(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:N(s.onPointerMove,m=>{v.current=m.pointerType,n?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:N(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(yt.includes(m.key)&&y(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ie;var le="SelectItemText",Ge=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...c}=r,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=_t(le,t),[h,g]=i.useState(null),w=k(e,y=>g(y),a.onItemTextChange,y=>l.itemTextRefCallback?.(y,a.value,a.disabled)),C=h?.textContent,S=i.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:C},a.value),[a.disabled,a.value,C]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...c,ref:w}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Re.createPortal(c.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var Ce="SelectScrollUpButton",Xe=i.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=_e(Ce,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;c(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});Xe.displayName=Ce;var ye="SelectScrollDownButton",Ze=i.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=_e(ye,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;c(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=ye;var Je=i.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,c=Y("SelectScrollButton",t),s=i.useRef(null),l=ue(t),a=i.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return i.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:N(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:N(n.onPointerMove,()=>{c.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:N(n.onPointerLeave,()=>{a()})})}),Vt="SelectSeparator",Ht=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});Ht.displayName=Vt;var Ie="SelectArrow",Ut=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),c=G(Ie,t),s=Y(Ie,t);return c.open&&s.position==="popper"?d.jsx(St,{...n,...o,ref:e}):null});Ut.displayName=Ie;var zt="SelectBubbleInput",Qe=i.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=i.useRef(null),c=k(o,n),s=dt(e);return i.useEffect(()=>{const l=n.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const g=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(j.select,{...t,style:{...wt,...t.style},ref:c,defaultValue:e})});Qe.displayName=zt;function et(r){return r===""||r===void 0}function tt(r){const e=ut(r),t=i.useRef(""),o=i.useRef(0),n=i.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),c=i.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return i.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,c]}function ot(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,c=t?r.indexOf(t):-1;let s=Ft(r,Math.max(c,0));n.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return a!==t?a:void 0}function Ft(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var Wt=je,Kt=Ae,$t=De,Gt=ke,Yt=Le,qt=Be,Xt=ze,Zt=$e,Jt=Ge,Qt=qe,eo=Xe,to=Ze;const oo=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],no=Te("check",oo);const ro=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],nt=Te("chevron-down",ro);const so=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],lo=Te("chevron-up",so);function fo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Wt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function mo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx($t,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function ho(r){const e=ee.c(13);let t,o,n,c;e[0]!==r?({className:o,size:c,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?"default":c;let l;e[5]!==o?(l=oe("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-xl border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-10 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Gt,{asChild:!0,children:d.jsx(nt,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==s||e[11]!==l?(u=d.jsxs(Kt,{"data-slot":"select-trigger","data-size":s,className:l,...n,children:[t,a]}),e[8]=t,e[9]=n,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function vo(r){const e=ee.c(20);let t,o,n,c;e[0]!==r?({className:o,children:t,position:c,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?"popper":c,l=s==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let a;e[5]!==o||e[6]!==l?(a=oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-xl border shadow-md",l,o),e[5]=o,e[6]=l,e[7]=a):a=e[7];let u;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=d.jsx(ao,{}),e[8]=u):u=e[8];const h=s==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let g;e[9]!==h?(g=oe("p-1",h),e[9]=h,e[10]=g):g=e[10];let w;e[11]!==t||e[12]!==g?(w=d.jsx(Xt,{className:g,children:t}),e[11]=t,e[12]=g,e[13]=w):w=e[13];let C;e[14]===Symbol.for("react.memo_cache_sentinel")?(C=d.jsx(co,{}),e[14]=C):C=e[14];let S;return e[15]!==s||e[16]!==n||e[17]!==a||e[18]!==w?(S=d.jsx(Yt,{children:d.jsxs(qt,{"data-slot":"select-content",className:a,position:s,...n,children:[u,w,C]})}),e[15]=s,e[16]=n,e[17]=a,e[18]=w,e[19]=S):S=e[19],S}function go(r){const e=ee.c(16);let t,o,n,c;e[0]!==r?({className:o,children:t,hideCheck:c,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?!1:c;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-xl py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(Qt,{children:d.jsx(no,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Jt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==n||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Zt,{"data-slot":"select-item",className:l,...n,children:[a,u]}),e[11]=n,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function ao(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(lo,{className:"size-4"}),e[5]=c):c=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(eo,{"data-slot":"select-scroll-up-button",className:n,...o,children:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function co(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(nt,{className:"size-4"}),e[5]=c):c=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(to,{"data-slot":"select-scroll-down-button",className:n,...o,children:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{nt as C,mo as S,ho as a,vo as b,fo as c,go as d,Pe as e,no as f};
@@ -1 +0,0 @@
1
- import{a5 as D,a1 as P,r as E,as as B,ar as $,j as t,ap as K,c as Q,a6 as C,a2 as L,a as A,aq as F,ay as T}from"./index-MoI-rvC3.js";import{C as H}from"./collection-header-BeSLFcaG.js";import{C as X}from"./collection-page-C_ScBEek.js";import{u as Y}from"./tooltip-CyReuecv.js";import{u as G,B as p}from"./button-G3aMPyFq.js";import{a as J,F as O,b as R,c as k,d as M,f as U,e as V}from"./form-BsxjQn2d.js";import{I as q}from"./input-CXe38a5R.js";import{c as I}from"./utils-BLlwSV8I.js";import{U as W}from"./upload-n_AaBb-Z.js";import"./collection-display-button-BOWw7rwa.js";import"./dropdown-menu-CtSLEdvQ.js";import"./icon-Cxep_tfx.js";const Z=K({name:F().min(1,"Name is required").max(255,"Name is too long"),slug:F().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:F().optional()});function _(j){const e=Q.c(24),{value:r,onChange:s,name:u}=j,l=E.useRef(null);let c;e[0]!==s?(c=z=>{const w=z.target.files?.[0];if(w){if(w.size>2097152){C.error("Image must be smaller than 2MB");return}const m=new FileReader;m.onerror=()=>{const N=m.error;console.error("FileReader error:",N),C.error(N?.message||"Failed to read image file. Please try again."),l.current&&(l.current.value="")},m.onloadend=()=>{if(m.readyState===FileReader.DONE&&m.result){const N=m.result;s(N)}},m.readAsDataURL(w)}},e[0]=s,e[1]=c):c=e[1];const a=c;let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{l.current?.click()},e[2]=g):g=e[2];const v=g;let d;e[3]!==s?(d=z=>{z.stopPropagation(),s("")},e[3]=s,e[4]=d):d=e[4];const o=d;let i;e[5]!==a?(i=t.jsx("input",{type:"file",ref:l,className:"hidden",accept:"image/*",onChange:a}),e[5]=a,e[6]=i):i=e[6];let n;e[7]!==o||e[8]!==u||e[9]!==r?(n=r?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:t.jsx("img",{src:r,alt:u||"Organization logo",className:"w-full h-full object-cover"})}),t.jsx("button",{type:"button",onClick:o,className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:t.jsx(T,{className:"h-3 w-3"})})]}):t.jsxs("button",{type:"button",onClick:v,className:"h-20 w-20 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-1 text-muted-foreground hover:text-foreground",children:[t.jsx(W,{className:"h-5 w-5"}),t.jsx("span",{className:"text-xs",children:"Upload"})]}),e[7]=o,e[8]=u,e[9]=r,e[10]=n):n=e[10];const S=r?"Change Logo":"Upload Logo";let x;e[11]!==S?(x=t.jsx(p,{type:"button",variant:"outline",size:"sm",onClick:v,className:"mb-2",children:S}),e[11]=S,e[12]=x):x=e[12];let h;e[13]!==o||e[14]!==r?(h=r&&t.jsx(p,{type:"button",variant:"ghost",size:"sm",onClick:o,className:"ml-2",children:"Remove"}),e[13]=o,e[14]=r,e[15]=h):h=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),e[16]=b):b=e[16];let f;e[17]!==x||e[18]!==h?(f=t.jsxs("div",{className:"flex-1",children:[x,h,b]}),e[17]=x,e[18]=h,e[19]=f):f=e[19];let y;return e[20]!==f||e[21]!==i||e[22]!==n?(y=t.jsxs("div",{className:"flex items-start gap-4",children:[i,n,f]}),e[20]=f,e[21]=i,e[22]=n,e[23]=y):y=e[23],y}function ue(){const j=D(),{org:e}=Y(),r=P(),[s,u]=E.useState(!1),[l,c]=E.useState("organization"),a=B({resolver:$(Z),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),g=G({mutationFn:async o=>{const i={name:o.name,slug:o.slug};o.logo!==void 0&&(i.logo=o.logo||null);const n=await A.organization.update({organizationId:e.id,data:i});if(n?.error)throw new Error(n.error.message||"Failed to update organization");return n},onSuccess:o=>{r.invalidateQueries({queryKey:L.organizations()}),r.invalidateQueries({queryKey:L.activeOrganization(e.slug)}),C.success("Organization settings updated successfully"),o?.data?.slug&&o.data.slug!==e.slug&&j({to:"/$org/settings",params:{org:o.data.slug}})},onError:o=>{C.error(o instanceof Error?o.message:"Failed to update organization")},onSettled:()=>{u(!1)}}),v=o=>{u(!0),g.mutate(o)},d=a.formState.isDirty;return t.jsxs(X,{children:[t.jsx(H,{title:"Settings"}),t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsxs("div",{className:"flex h-full",children:[t.jsx("div",{className:"w-64 border-r border-border bg-background",children:t.jsxs("nav",{className:"p-5 space-y-1",children:[t.jsx("button",{onClick:()=>c("organization"),className:I("w-full text-left px-3 py-2 text-sm font-medium rounded-md transition-colors",l==="organization"?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:"Organization"}),t.jsx("button",{onClick:()=>c("connection"),className:I("w-full text-left px-3 py-2 text-sm font-medium rounded-md transition-colors",l==="connection"?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:"Connection"})]})}),t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsxs("div",{className:"p-5 max-w-2xl",children:[l==="organization"&&t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Organization"}),t.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Update your organization's name, slug, and logo."})]}),t.jsx(J,{...a,children:t.jsxs("form",{onSubmit:a.handleSubmit(v),className:"space-y-6",children:[t.jsx(O,{control:a.control,name:"name",render:({field:o})=>t.jsxs(R,{children:[t.jsx(k,{children:"Organization Name"}),t.jsx(M,{children:t.jsx(q,{placeholder:"My Organization",...o,disabled:s})}),t.jsx(U,{})]})}),t.jsx(O,{control:a.control,name:"slug",render:({field:o})=>t.jsxs(R,{children:[t.jsx(k,{children:"Organization Slug"}),t.jsx(M,{children:t.jsx(q,{placeholder:"my-organization",...o,disabled:s,onChange:i=>{const n=i.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");o.onChange(n)}})}),t.jsx(V,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),t.jsx(U,{})]})}),t.jsx(O,{control:a.control,name:"logo",render:({field:o})=>t.jsxs(R,{children:[t.jsx(k,{children:"Logo"}),t.jsx(M,{children:t.jsx(_,{value:o.value,onChange:o.onChange,name:a.watch("name")})}),t.jsx(U,{})]})}),t.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[t.jsx(p,{type:"submit",disabled:!d||s,className:"min-w-24",children:s?"Saving...":"Save Changes"}),d&&t.jsx(p,{type:"button",variant:"outline",onClick:()=>a.reset(),disabled:s,children:"Cancel"})]})]})})]}),l==="connection"&&t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Connection"}),t.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Models and agents are automatically discovered from your MCP connections."})]}),t.jsx("div",{children:t.jsx(p,{onClick:()=>j({to:"/$org/mcps",params:{org:e.slug}}),children:"Manage Connections"})})]})]})})]})})]})}export{ue as default};