@decocms/mesh 1.0.0-alpha.3 → 1.0.0-alpha.30
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/README.md +287 -0
- package/dist/client/assets/{alert-dialog-Caf0mgW9.js → alert-dialog-lT7fjsnS.js} +3 -3
- package/dist/client/assets/app-name-gTETL9So.js +1 -0
- package/dist/client/assets/{auth-CGqqbEan.js → auth-B4DV4YJb.js} +1 -1
- package/dist/client/assets/{auth-catchall-Bw-KJI1v.js → auth-catchall-BXXli3-E.js} +1 -1
- package/dist/client/assets/{avatar-CdPaDOIs.js → avatar-DrbrX3Fb.js} +1 -1
- package/dist/client/assets/{badge-j-myHF25.js → badge-Sw-5Fjm_.js} +1 -1
- package/dist/client/assets/{button-DnKGwZ1P.js → button-De8TtfIc.js} +1 -1
- package/dist/client/assets/{card-I0CWqn2J.js → card-Clgs1Ler.js} +1 -1
- package/dist/client/assets/{checkbox-v3iP8MNg.js → checkbox-BZTG8MjG.js} +1 -1
- package/dist/client/assets/{circle-alert-CpqBZI3V.js → circle-alert-Bo6PdNJA.js} +1 -1
- package/dist/client/assets/collection-detail-bCm7IhzQ.js +1 -0
- package/dist/client/assets/collection-display-button-CANVxM78.js +1 -0
- package/dist/client/assets/collection-header-DWpT3ZvE.js +1 -0
- package/dist/client/assets/{collection-page-CkAonVNX.js → collection-page-BDYpmZx2.js} +1 -1
- package/dist/client/assets/{collection-search-Bd4XQ4_K.js → collection-search-7dvS8CPU.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Dv4rgxdy.js → collection-table-wrapper-DFImlrAn.js} +1 -1
- package/dist/client/assets/connection-card-Dgd2qOAx.js +1 -0
- package/dist/client/assets/connection-detail-B5XIo4jJ.js +1 -0
- package/dist/client/assets/connections-DgVq2Zi4.js +1 -0
- package/dist/client/assets/core-6UZH86ZU.js +6 -0
- package/dist/client/assets/{create-organization-dialog-CWgFMDXV.js → create-organization-dialog-DpintAfW.js} +1 -1
- package/dist/client/assets/dialog-CcWkQ3-q.js +1 -0
- package/dist/client/assets/{dropdown-menu-BIeRR6rM.js → dropdown-menu-BMBTO1aI.js} +1 -1
- package/dist/client/assets/{empty-state-DV83eIhT.js → empty-state-WuOT2hFn.js} +1 -1
- package/dist/client/assets/{error-boundary-qOVcoWbq.js → error-boundary-Sj1-czrQ.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DzgXoQyz.js → extract-connection-data-q7cQAIMM.js} +1 -1
- package/dist/client/assets/{form-0C1lYHJ2.js → form-CTTDgzck.js} +1 -1
- package/dist/client/assets/gateway-detail-DrTM5RUx.js +1 -0
- package/dist/client/assets/gateways-C0TCQRt5.js +1 -0
- package/dist/client/assets/{home-B1IT0slW.js → home-Dy-_EeTf.js} +1 -1
- package/dist/client/assets/{icon-C1glN-Ga.js → icon-Dk9j-Z4d.js} +1 -1
- package/dist/client/assets/index-BMLzl8gY.css +1 -0
- package/dist/client/assets/index-BSuuYE7a.js +32 -0
- package/dist/client/assets/index-DIXLDBVl.js +118 -0
- package/dist/client/assets/{index-Chpp7zg0.js → index-Dss36SHE.js} +1 -1
- package/dist/client/assets/{index-D2ODleHN.js → index-GY3GXADp.js} +1 -1
- package/dist/client/assets/{input-DpAKmHHm.js → input-ByJBGfq3.js} +1 -1
- package/dist/client/assets/json-B2EH3aa6.js +1 -0
- package/dist/client/assets/json-BESjz4hO.js +1 -0
- package/dist/client/assets/layout-DRBUzMK7.js +1 -0
- package/dist/client/assets/lazy-highlighter-BZ3JTPPT.js +4 -0
- package/dist/client/assets/{localstorage-keys-DC7ymQmZ.js → localstorage-keys-CrXjwcSZ.js} +1 -1
- package/dist/client/assets/login-baVguqcM.js +1 -0
- package/dist/client/assets/mcp-oauth-Chn8Vl6o.js +1 -0
- package/dist/client/assets/members-BL6-e_ID.js +3 -0
- package/dist/client/assets/monitoring-DSGI33MK.js +1 -0
- package/dist/client/assets/oauth-callback-BxWJgxm-.js +1 -0
- package/dist/client/assets/page-BZV40eAE.css +1 -0
- package/dist/client/assets/page-D0r-m9VX.js +21 -0
- package/dist/client/assets/{popover-TCQphQTw.js → popover-C_H6Z3YS.js} +1 -1
- package/dist/client/assets/prism-light-CKU-zSUS.js +1 -0
- package/dist/client/assets/resource-tabs-Dptn276z.js +1 -0
- package/dist/client/assets/{schema-BLzWyGtx.js → schema-iWDGcZfv.js} +1 -1
- package/dist/client/assets/{select-fvQCifl4.js → select-KKeuY_8A.js} +1 -1
- package/dist/client/assets/settings-DOQRUeGN.js +1 -0
- package/dist/client/assets/shell-layout-DxFvs5RE.js +124 -0
- package/dist/client/assets/slugify-CEUa2lfQ.js +1 -0
- package/dist/client/assets/{spinner-Cck765yW.js → spinner-C5mTiECQ.js} +1 -1
- package/dist/client/assets/store-BsHJOv3r.js +1 -0
- package/dist/client/assets/store-app-detail-D8K1UJ66.js +1 -0
- package/dist/client/assets/switch-BN3gNP3v.js +1 -0
- package/dist/client/assets/{textarea--4iImQiq.js → textarea-DYrEFGVo.js} +1 -1
- package/dist/client/assets/tool-set-selector-BU0xXwDF.js +1 -0
- package/dist/client/assets/{tooltip-DjXyjtiH.js → tooltip-ZzCYSPeH.js} +1 -1
- package/dist/client/assets/types-DndJPAWa.js +45 -0
- package/dist/client/assets/{upload-DkfUhTLj.js → upload-CsXE0eHm.js} +1 -1
- package/dist/client/assets/{use-binding-BLIUV5ER.js → use-binding-CIVQUW9t.js} +2 -2
- package/dist/client/assets/use-connection-CgusccPZ.js +2 -0
- package/dist/client/assets/use-gateway-iwW9W997.js +1 -0
- package/dist/client/assets/{use-list-state-Bas0EIwN.js → use-list-state-B2svGg01.js} +1 -1
- package/dist/client/assets/use-mcp-ByPLvFZj.js +1 -0
- package/dist/client/assets/use-members-dzf6tzsH.js +1 -0
- package/dist/client/assets/{use-mobile-CxX0wu31.js → use-mobile-BqnROvZt.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CpvpbwdB.js → use-organization-settings-DYa2j-qu.js} +1 -1
- package/dist/client/assets/{use-tool-call-p0lqBezD.js → use-tool-call-CFjw03Kh.js} +1 -1
- package/dist/client/assets/useQuery-B5H-PpIX.js +1 -0
- package/dist/client/assets/utils-Ny57I_y6.js +1 -0
- package/dist/client/assets/well-known-mcp-Dg77mwx9.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +191 -211
- package/dist/server/migrate.js +204 -204
- package/dist/server/server.js +245 -267
- package/package.json +7 -5
- package/dist/client/assets/app-name-DQPOjnhR.js +0 -1
- package/dist/client/assets/chunk-2RRQPJJO-DGhxLrrR.js +0 -1
- package/dist/client/assets/collection-detail-BSfYYwzG.js +0 -1
- package/dist/client/assets/collection-display-button-Cws3c2TG.js +0 -1
- package/dist/client/assets/collection-header-CJC3zXGa.js +0 -1
- package/dist/client/assets/connection-card-CgJm9r5i.js +0 -1
- package/dist/client/assets/connection-detail-HAGAOVY9.js +0 -1
- package/dist/client/assets/connections-C8Z338-P.js +0 -1
- package/dist/client/assets/dialog-Qusr5Dgc.js +0 -1
- package/dist/client/assets/gateway-detail-mD14k5vr.js +0 -1
- package/dist/client/assets/gateways-BSGLH5Mc.js +0 -1
- package/dist/client/assets/index-B5e6fytH.js +0 -118
- package/dist/client/assets/index-C1xA8jg5.js +0 -1
- package/dist/client/assets/index-DqmRoUE9.js +0 -32
- package/dist/client/assets/index-feMggVqN.css +0 -1
- package/dist/client/assets/integration-icon-C_Dk6BbN.js +0 -1
- package/dist/client/assets/layout-BMHVtK0w.js +0 -1
- package/dist/client/assets/lazy-highlighter-9rAB2zZq.js +0 -1
- package/dist/client/assets/login-BMjQy3tL.js +0 -1
- package/dist/client/assets/members-k_V-Gxfi.js +0 -1
- package/dist/client/assets/monitoring-BG-rBDyv.js +0 -1
- package/dist/client/assets/monitoring-stats-row-PYfuhQHX.js +0 -42
- package/dist/client/assets/oauth-callback-CQ4D18kW.js +0 -10
- package/dist/client/assets/page-h-kmS-QS.js +0 -1
- package/dist/client/assets/prism-CcSucC56.js +0 -9
- package/dist/client/assets/resource-tabs-E4yf0eYT.js +0 -1
- package/dist/client/assets/settings-Bjk195Z6.js +0 -1
- package/dist/client/assets/shell-layout-B8oNCzSa.js +0 -124
- package/dist/client/assets/store-DD1aCoWU.js +0 -1
- package/dist/client/assets/store-app-detail-DZvzqAVf.js +0 -1
- package/dist/client/assets/tool-set-selector-Fu1vBXWK.js +0 -1
- package/dist/client/assets/use-connection-IMyxygAc.js +0 -2
- package/dist/client/assets/use-gateway-CuMrhcvh.js +0 -1
- package/dist/client/assets/use-members-DHcrnzKP.js +0 -1
- package/dist/client/assets/useQuery-BO2jzwkw.js +0 -1
- package/dist/client/assets/utils-BLBjpUfr.js +0 -1
- package/dist/client/assets/well-known-mcp-Dq2j3ucM.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a2 as U,j as t,c as F,a5 as W,r as M}from"./index-B5e6fytH.js";import{u as Y}from"./useQuery-BO2jzwkw.js";import{I as K}from"./icon-C1glN-Ga.js";import{e as J}from"./registry-utils-ulDDT0d8.js";import{C as P}from"./collection-display-button-Cws3c2TG.js";import{C as X}from"./collection-search-Bd4XQ4_K.js";import{C as Z}from"./collection-table-wrapper-Dv4rgxdy.js";import{E as H}from"./empty-state-DV83eIhT.js";import{I as ee}from"./integration-icon-C_Dk6BbN.js";import{C as te}from"./card-I0CWqn2J.js";import{V as oe}from"./layout-BMHVtK0w.js";import{c as $}from"./utils-BLBjpUfr.js";import{B as re}from"./badge-j-myHF25.js";import{B as se}from"./button-DnKGwZ1P.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{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-B5e6fytH.js";import{C as H}from"./collection-header-CJC3zXGa.js";import{C as X}from"./collection-page-CkAonVNX.js";import{u as Y}from"./tooltip-DjXyjtiH.js";import{u as G,B as p}from"./button-DnKGwZ1P.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-0C1lYHJ2.js";import{I as q}from"./input-DpAKmHHm.js";import{c as I}from"./utils-BLBjpUfr.js";import{U as W}from"./upload-DkfUhTLj.js";import"./collection-display-button-Cws3c2TG.js";import"./dropdown-menu-BIeRR6rM.js";import"./icon-C1glN-Ga.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};
|