@decocms/mesh 1.0.0-alpha.22 → 1.0.0-alpha.24
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/{alert-dialog-SFOK6jVt.js → alert-dialog-B5P__fSo.js} +1 -1
- package/dist/client/assets/{auth-DVZysXgn.js → auth-Cf-BfTK3.js} +1 -1
- package/dist/client/assets/{auth-catchall-DnTJzHE6.js → auth-catchall-CAFc22YR.js} +1 -1
- package/dist/client/assets/{avatar-DXWXW2D9.js → avatar-DPg_RyEl.js} +1 -1
- package/dist/client/assets/{badge-DdZ6WWL4.js → badge-BWSVXk6u.js} +1 -1
- package/dist/client/assets/{button-a-f_QGwE.js → button-7f3mJDt9.js} +1 -1
- package/dist/client/assets/{card-CoTR2BRq.js → card-C-FxKc9h.js} +1 -1
- package/dist/client/assets/{checkbox-xUpImUGX.js → checkbox-Cgzsx5iu.js} +1 -1
- package/dist/client/assets/{circle-alert-vRjzHVZa.js → circle-alert-DU3UcGxR.js} +1 -1
- package/dist/client/assets/collection-detail-CFgy96Yw.js +1 -0
- package/dist/client/assets/{collection-display-button-CsjbEnNB.js → collection-display-button-yCMREeFw.js} +1 -1
- package/dist/client/assets/{collection-header-BOidrCph.js → collection-header-BRT8x6Bu.js} +1 -1
- package/dist/client/assets/{collection-page-jjfHUK0N.js → collection-page-DutPWx_J.js} +1 -1
- package/dist/client/assets/{collection-search-mG8LyvuA.js → collection-search-Blu2oI67.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-C2C7zUkI.js → collection-table-wrapper-D77XIcPK.js} +1 -1
- package/dist/client/assets/{connection-card-FwvHBANG.js → connection-card-VvLWKVZB.js} +1 -1
- package/dist/client/assets/connection-detail-CIXniRq_.js +1 -0
- package/dist/client/assets/{connections-Qm1RDm9i.js → connections-B0k_3lJ6.js} +1 -1
- package/dist/client/assets/{core-RpjIO9ve.js → core-DSrr1gFw.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-DO93gNH_.js → create-organization-dialog-QRhVV4NP.js} +1 -1
- package/dist/client/assets/{dialog-7Hp_Rfs5.js → dialog-DxoCnO7f.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BgPAXaVp.js → dropdown-menu-Dsh1FAHq.js} +1 -1
- package/dist/client/assets/{empty-state-WNgz9fCm.js → empty-state-CLlWeA8F.js} +1 -1
- package/dist/client/assets/{error-boundary-BiEWgYTq.js → error-boundary-BpbgV8Mt.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BxXB87qU.js → extract-connection-data-Bubi-83r.js} +1 -1
- package/dist/client/assets/{form-DfOMWaCI.js → form-CEChYO-W.js} +1 -1
- package/dist/client/assets/{gateway-detail-CekGOa65.js → gateway-detail-ht9jY5Da.js} +1 -1
- package/dist/client/assets/{gateways-D7wgat-S.js → gateways-BG4qNJPZ.js} +1 -1
- package/dist/client/assets/{home-CBscUryL.js → home-CkLLsx37.js} +1 -1
- package/dist/client/assets/{icon-OJY1qvap.js → icon-Dk3IUZlY.js} +1 -1
- package/dist/client/assets/{index-BGqdpa9H.js → index-B3Svv0HD.js} +1 -1
- package/dist/client/assets/{index-mHl2jc64.js → index-CRXnV96L.js} +23 -23
- package/dist/client/assets/{index-DCBFOKhf.js → index-Pk85Lo4X.js} +1 -1
- package/dist/client/assets/{index-CpLt3yXK.js → index-tTqkKQJp.js} +2 -2
- package/dist/client/assets/{input-DADGlXgX.js → input-DsJLZuBe.js} +1 -1
- package/dist/client/assets/json-CPcRzrP7.js +1 -0
- package/dist/client/assets/{layout-D3oF0UXv.js → layout-7tvwsBuE.js} +1 -1
- package/dist/client/assets/{lazy-highlighter-YPXkqk41.js → lazy-highlighter-BXMzyI4V.js} +1 -1
- package/dist/client/assets/{localstorage-keys-CLnHFhAZ.js → localstorage-keys-2gInE9f9.js} +1 -1
- package/dist/client/assets/{login-nnqyC_26.js → login-BNugdJth.js} +1 -1
- package/dist/client/assets/mcp-oauth-BOA4hd1a.js +1 -0
- package/dist/client/assets/{members-DU6eKV9F.js → members-z4wBZKYX.js} +1 -1
- package/dist/client/assets/{monitoring-DTlGGDV7.js → monitoring-BoRkHos-.js} +1 -1
- package/dist/client/assets/{oauth-callback-CeQyWBYb.js → oauth-callback-z3iCI-Fn.js} +1 -1
- package/dist/client/assets/{page-vOsPd38r.js → page-DkuwHgHg.js} +1 -1
- package/dist/client/assets/{popover-BLFYmlOn.js → popover-CUCZevqJ.js} +1 -1
- package/dist/client/assets/prism-light-yh0IS_ur.js +1 -0
- package/dist/client/assets/{resource-tabs-DG4A8tWW.js → resource-tabs-Dr8QbV0u.js} +1 -1
- package/dist/client/assets/{schema-D8ew0NM5.js → schema-ggfLBohE.js} +1 -1
- package/dist/client/assets/{select-z4npQPjw.js → select-GwKsoZTV.js} +1 -1
- package/dist/client/assets/{settings-CmmfDzw9.js → settings-Cp1KZJA2.js} +1 -1
- package/dist/client/assets/{shell-layout-DlUj14rs.js → shell-layout-BAThlowD.js} +3 -3
- package/dist/client/assets/{spinner-D5s5xc0Q.js → spinner-DZz5BuLl.js} +1 -1
- package/dist/client/assets/{store-RIWxa-nd.js → store-CSHMTNbU.js} +1 -1
- package/dist/client/assets/{store-app-detail-BTgKTQqK.js → store-app-detail-DrtrpMu_.js} +1 -1
- package/dist/client/assets/{switch-C9-eZe0E.js → switch-BWlL3QAV.js} +1 -1
- package/dist/client/assets/{textarea-Dedeyf1a.js → textarea-DkvsoReo.js} +1 -1
- package/dist/client/assets/{tool-set-selector-BV79VfYU.js → tool-set-selector-BKqxCVz9.js} +1 -1
- package/dist/client/assets/{tooltip-B2bk3ddo.js → tooltip-DG1xYIL4.js} +1 -1
- package/dist/client/assets/{types-DtXr_1NB.js → types-Cp78eAtq.js} +3 -3
- package/dist/client/assets/{upload-CS-gkuco.js → upload-Bmv_uBao.js} +1 -1
- package/dist/client/assets/{use-binding-BUb3VGJz.js → use-binding-C_9S-BsF.js} +2 -2
- package/dist/client/assets/{use-connection-dLAoYo7_.js → use-connection-CJdd9H8R.js} +1 -1
- package/dist/client/assets/{use-gateway-BauM1JmV.js → use-gateway-DeuD2XcZ.js} +1 -1
- package/dist/client/assets/{use-list-state-8Cb6Qj6h.js → use-list-state-D4EpKod3.js} +1 -1
- package/dist/client/assets/{use-mcp-QQ5h4Jus.js → use-mcp-qYkX8fe3.js} +1 -1
- package/dist/client/assets/{use-members-BPiAXAIc.js → use-members-DcGjLl6z.js} +1 -1
- package/dist/client/assets/{use-mobile-Clv5smUY.js → use-mobile-CR4-zNel.js} +1 -1
- package/dist/client/assets/{use-organization-settings-B1r4lAAM.js → use-organization-settings-14jcjh3V.js} +1 -1
- package/dist/client/assets/{use-tool-call-Cbu6Hh2e.js → use-tool-call-CXd8t6dd.js} +1 -1
- package/dist/client/assets/useQuery-DcphYrFi.js +1 -0
- package/dist/client/assets/utils-D4LuHWBB.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +130 -130
- package/dist/server/migrate.js +19 -19
- package/dist/server/server.js +119 -119
- package/package.json +1 -1
- package/dist/client/assets/collection-detail-CW3Ypihz.js +0 -1
- package/dist/client/assets/connection-detail-B7zugsU8.js +0 -1
- package/dist/client/assets/json-DUg1mNkp.js +0 -1
- package/dist/client/assets/mcp-oauth-I-dydWHT.js +0 -1
- package/dist/client/assets/prism-light-WgmBP48C.js +0 -1
- package/dist/client/assets/useQuery-Dz8EP3Do.js +0 -1
- package/dist/client/assets/utils-DvXhQGkY.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as i,bQ as m,aM as A,j as r,bR as w,ax as T,ab as O,av as M,bS as I,ad as v,ac as z,aK as F,ae as L,a9 as G,aa as k,a8 as H,c as n}from"./index-
|
|
1
|
+
import{r as i,bQ as m,aM as A,j as r,bR as w,ax as T,ab as O,av as M,bS as I,ad as v,ac as z,aK as F,ae as L,a9 as G,aa as k,a8 as H,c as n}from"./index-tTqkKQJp.js";import{c as p}from"./utils-D4LuHWBB.js";import{b as D}from"./button-7f3mJDt9.js";var x="AlertDialog",[V]=T(x,[m]),d=m(),N=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(H,{...a,...t,modal:!0})};N.displayName=x;var W="AlertDialogTrigger",Y=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(F,{...o,...a,ref:e})});Y.displayName=W;var q="AlertDialogPortal",y=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(z,{...a,...t})};y.displayName=q;var B="AlertDialogOverlay",_=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(L,{...o,...a,ref:e})});_.displayName=B;var f="AlertDialogContent",[K,Q]=V(f),J=I("AlertDialogContent"),b=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,children:a,...o}=l,s=d(t),c=i.useRef(null),P=A(e,c),u=i.useRef(null);return r.jsx(w,{contentName:f,titleName:j,docsSlug:"alert-dialog",children:r.jsx(K,{scope:t,cancelRef:u,children:r.jsxs(O,{role:"alertdialog",...s,...o,ref:P,onOpenAutoFocus:M(o.onOpenAutoFocus,g=>{g.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:g=>g.preventDefault(),onInteractOutside:g=>g.preventDefault(),children:[r.jsx(J,{children:a}),r.jsx(X,{contentRef:c})]})})})});b.displayName=f;var j="AlertDialogTitle",h=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(G,{...o,...a,ref:e})});h.displayName=j;var R="AlertDialogDescription",E=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(k,{...o,...a,ref:e})});E.displayName=R;var U="AlertDialogAction",C=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(v,{...o,...a,ref:e})});C.displayName=U;var $="AlertDialogCancel",S=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,{cancelRef:o}=Q($,t),s=d(t),c=A(e,o);return r.jsx(v,{...s,...a,ref:c})});S.displayName=$;var X=({contentRef:l})=>{const e=`\`${f}\` requires a description for the component to be accessible for screen reader users.
|
|
2
2
|
|
|
3
3
|
You can add a description to the \`${f}\` by passing a \`${R}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bI as y,aq as t,bJ as f,ap as r,c8 as n,bF as u,bC as O,aE as i,aG as _,aF as I,bB as k,c9 as ze,ca as He,cb as Ve,bH as De}from"./index-CpLt3yXK.js";const ae="2025-06-18",xo=[ae,"2025-03-26","2024-11-05","2024-10-07"],z="2.0",fe=y([t(),f().int()]),we=t(),Je=r({progressToken:n(fe)}).passthrough(),x=r({_meta:n(Je)}).passthrough(),S=r({method:t(),params:n(x)}),q=r({_meta:n(r({}).passthrough())}).passthrough(),P=r({method:t(),params:n(q)}),C=r({_meta:n(r({}).passthrough())}).passthrough(),H=y([t(),f().int()]),Re=r({jsonrpc:u(z),id:H}).merge(S).strict(),Co=e=>Re.safeParse(e).success,ye=r({jsonrpc:u(z)}).merge(P).strict(),To=e=>ye.safeParse(e).success,Se=r({jsonrpc:u(z),id:H,result:C}).strict(),Po=e=>Se.safeParse(e).success;var me;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError"})(me||(me={}));const ve=r({jsonrpc:u(z),id:H,error:r({code:f().int(),message:t(),data:n(O())})}).strict(),bo=e=>ve.safeParse(e).success,ko=y([Re,ye,Se,ve]),xe=C.strict(),Ce=P.extend({method:u("notifications/cancelled"),params:q.extend({requestId:H,reason:t().optional()})}),Be=r({src:t(),mimeType:n(t()),sizes:n(i(t()))}).passthrough(),A=r({icons:i(Be).optional()}).passthrough(),M=r({name:t(),title:n(t())}).passthrough(),Te=M.extend({version:t(),websiteUrl:n(t())}).merge(A),We=r({experimental:n(r({}).passthrough()),sampling:n(r({}).passthrough()),elicitation:n(r({}).passthrough()),roots:n(r({listChanged:n(_())}).passthrough())}).passthrough(),Ge=S.extend({method:u("initialize"),params:x.extend({protocolVersion:t(),capabilities:We,clientInfo:Te})}),Ze=r({experimental:n(r({}).passthrough()),logging:n(r({}).passthrough()),completions:n(r({}).passthrough()),prompts:n(r({listChanged:n(_())}).passthrough()),resources:n(r({subscribe:n(_()),listChanged:n(_())}).passthrough()),tools:n(r({listChanged:n(_())}).passthrough())}).passthrough(),Ye=C.extend({protocolVersion:t(),capabilities:Ze,serverInfo:Te,instructions:n(t())}),Pe=P.extend({method:u("notifications/initialized")}),Uo=e=>Pe.safeParse(e).success,be=S.extend({method:u("ping")}),Ke=r({progress:f(),total:n(f()),message:n(t())}).passthrough(),ke=P.extend({method:u("notifications/progress"),params:q.merge(Ke).extend({progressToken:fe})}),V=S.extend({params:x.extend({cursor:n(we)}).optional()}),D=C.extend({nextCursor:n(we)}),Ue=r({uri:t(),mimeType:n(t()),_meta:n(r({}).passthrough())}).passthrough(),Le=Ue.extend({text:t()}),ie=t().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Ee=Ue.extend({blob:ie}),Oe=M.extend({uri:t(),description:n(t()),mimeType:n(t()),_meta:n(r({}).passthrough())}).merge(A),Qe=M.extend({uriTemplate:t(),description:n(t()),mimeType:n(t()),_meta:n(r({}).passthrough())}).merge(A),Xe=V.extend({method:u("resources/list")}),Fe=D.extend({resources:i(Oe)}),et=V.extend({method:u("resources/templates/list")}),tt=D.extend({resourceTemplates:i(Qe)}),ot=S.extend({method:u("resources/read"),params:x.extend({uri:t()})}),nt=C.extend({contents:i(y([Le,Ee]))}),st=P.extend({method:u("notifications/resources/list_changed")}),rt=S.extend({method:u("resources/subscribe"),params:x.extend({uri:t()})}),at=S.extend({method:u("resources/unsubscribe"),params:x.extend({uri:t()})}),it=P.extend({method:u("notifications/resources/updated"),params:q.extend({uri:t()})}),ct=r({name:t(),description:n(t()),required:n(_())}).passthrough(),ut=M.extend({description:n(t()),arguments:n(i(ct)),_meta:n(r({}).passthrough())}).merge(A),lt=V.extend({method:u("prompts/list")}),pt=D.extend({prompts:i(ut)}),dt=S.extend({method:u("prompts/get"),params:x.extend({name:t(),arguments:n(I(t()))})}),ce=r({type:u("text"),text:t(),_meta:n(r({}).passthrough())}).passthrough(),ue=r({type:u("image"),data:ie,mimeType:t(),_meta:n(r({}).passthrough())}).passthrough(),le=r({type:u("audio"),data:ie,mimeType:t(),_meta:n(r({}).passthrough())}).passthrough(),ht=r({type:u("resource"),resource:y([Le,Ee]),_meta:n(r({}).passthrough())}).passthrough(),mt=Oe.extend({type:u("resource_link")}),Ie=y([ce,ue,le,mt,ht]),_t=r({role:k(["user","assistant"]),content:Ie}).passthrough(),gt=C.extend({description:n(t()),messages:i(_t)}),ft=P.extend({method:u("notifications/prompts/list_changed")}),wt=r({title:n(t()),readOnlyHint:n(_()),destructiveHint:n(_()),idempotentHint:n(_()),openWorldHint:n(_())}).passthrough(),Rt=M.extend({description:n(t()),inputSchema:r({type:u("object"),properties:n(r({}).passthrough()),required:n(i(t()))}).passthrough(),outputSchema:n(r({type:u("object"),properties:n(r({}).passthrough()),required:n(i(t()))}).passthrough()),annotations:n(wt),_meta:n(r({}).passthrough())}).merge(A),yt=V.extend({method:u("tools/list")}),St=D.extend({tools:i(Rt)}),qe=C.extend({content:i(Ie).default([]),structuredContent:r({}).passthrough().optional(),isError:n(_())});qe.or(C.extend({toolResult:O()}));const vt=S.extend({method:u("tools/call"),params:x.extend({name:t(),arguments:n(I(O()))})}),xt=P.extend({method:u("notifications/tools/list_changed")}),Ae=k(["debug","info","notice","warning","error","critical","alert","emergency"]),Ct=S.extend({method:u("logging/setLevel"),params:x.extend({level:Ae})}),Tt=P.extend({method:u("notifications/message"),params:q.extend({level:Ae,logger:n(t()),data:O()})}),Pt=r({name:t().optional()}).passthrough(),bt=r({hints:n(i(Pt)),costPriority:n(f().min(0).max(1)),speedPriority:n(f().min(0).max(1)),intelligencePriority:n(f().min(0).max(1))}).passthrough(),kt=r({role:k(["user","assistant"]),content:y([ce,ue,le])}).passthrough(),Ut=S.extend({method:u("sampling/createMessage"),params:x.extend({messages:i(kt),systemPrompt:n(t()),includeContext:n(k(["none","thisServer","allServers"])),temperature:n(f()),maxTokens:f().int(),stopSequences:n(i(t())),metadata:n(r({}).passthrough()),modelPreferences:n(bt)})}),Lt=C.extend({model:t(),stopReason:n(k(["endTurn","stopSequence","maxTokens"]).or(t())),role:k(["user","assistant"]),content:ze("type",[ce,ue,le])}),Et=r({type:u("boolean"),title:n(t()),description:n(t()),default:n(_())}).passthrough(),Ot=r({type:u("string"),title:n(t()),description:n(t()),minLength:n(f()),maxLength:n(f()),format:n(k(["email","uri","date","date-time"]))}).passthrough(),It=r({type:k(["number","integer"]),title:n(t()),description:n(t()),minimum:n(f()),maximum:n(f())}).passthrough(),qt=r({type:u("string"),title:n(t()),description:n(t()),enum:i(t()),enumNames:n(i(t()))}).passthrough(),At=y([Et,Ot,It,qt]),Mt=S.extend({method:u("elicitation/create"),params:x.extend({message:t(),requestedSchema:r({type:u("object"),properties:I(t(),At),required:n(i(t()))}).passthrough()})}),Nt=C.extend({action:k(["accept","decline","cancel"]),content:n(I(t(),O()))}),jt=r({type:u("ref/resource"),uri:t()}).passthrough(),$t=r({type:u("ref/prompt"),name:t()}).passthrough(),zt=S.extend({method:u("completion/complete"),params:x.extend({ref:y([$t,jt]),argument:r({name:t(),value:t()}).passthrough(),context:n(r({arguments:n(I(t(),t()))}))})}),Ht=C.extend({completion:r({values:i(t()).max(100),total:n(f().int()),hasMore:n(_())}).passthrough()}),Vt=r({uri:t().startsWith("file://"),name:n(t()),_meta:n(r({}).passthrough())}).passthrough(),Dt=S.extend({method:u("roots/list")}),Jt=C.extend({roots:i(Vt)}),Bt=P.extend({method:u("notifications/roots/list_changed")});y([be,Ge,zt,Ct,dt,lt,Xe,et,ot,rt,at,vt,yt]);y([Ce,ke,Pe,Bt]);y([xe,Lt,Nt,Jt]);y([be,Ut,Mt,Dt]);y([Ce,ke,Tt,it,st,xt,ft]);y([xe,Ye,Ht,gt,pt,Fe,tt,nt,qe,St]);class Lo extends Error{constructor(o,a,s){super(`MCP error ${o}: ${a}`),this.code=o,this.data=s,this.name="McpError"}}let pe;pe=globalThis.crypto;async function Wt(e){return(await pe).getRandomValues(new Uint8Array(e))}async function Gt(e){const o="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",a=Math.pow(2,8)-Math.pow(2,8)%o.length;let s="";for(;s.length<e;){const c=await Wt(e-s.length);for(const p of c)p<a&&(s+=o[p%o.length])}return s}async function Zt(e){return await Gt(e)}async function Yt(e){const o=await(await pe).subtle.digest("SHA-256",new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(o))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function Kt(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;const o=await Zt(e),a=await Yt(o);return{code_verifier:o,code_challenge:a}}const w=t().url().superRefine((e,o)=>{if(!URL.canParse(e))return o.addIssue({code:He.custom,message:"URL must be parseable",fatal:!0}),Ve}).refine(e=>{const o=new URL(e);return o.protocol!=="javascript:"&&o.protocol!=="data:"&&o.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),Qt=r({resource:t().url(),authorization_servers:i(w).optional(),jwks_uri:t().url().optional(),scopes_supported:i(t()).optional(),bearer_methods_supported:i(t()).optional(),resource_signing_alg_values_supported:i(t()).optional(),resource_name:t().optional(),resource_documentation:t().optional(),resource_policy_uri:t().url().optional(),resource_tos_uri:t().url().optional(),tls_client_certificate_bound_access_tokens:_().optional(),authorization_details_types_supported:i(t()).optional(),dpop_signing_alg_values_supported:i(t()).optional(),dpop_bound_access_tokens_required:_().optional()}).passthrough(),Me=r({issuer:t(),authorization_endpoint:w,token_endpoint:w,registration_endpoint:w.optional(),scopes_supported:i(t()).optional(),response_types_supported:i(t()),response_modes_supported:i(t()).optional(),grant_types_supported:i(t()).optional(),token_endpoint_auth_methods_supported:i(t()).optional(),token_endpoint_auth_signing_alg_values_supported:i(t()).optional(),service_documentation:w.optional(),revocation_endpoint:w.optional(),revocation_endpoint_auth_methods_supported:i(t()).optional(),revocation_endpoint_auth_signing_alg_values_supported:i(t()).optional(),introspection_endpoint:t().optional(),introspection_endpoint_auth_methods_supported:i(t()).optional(),introspection_endpoint_auth_signing_alg_values_supported:i(t()).optional(),code_challenge_methods_supported:i(t()).optional()}).passthrough(),Xt=r({issuer:t(),authorization_endpoint:w,token_endpoint:w,userinfo_endpoint:w.optional(),jwks_uri:w,registration_endpoint:w.optional(),scopes_supported:i(t()).optional(),response_types_supported:i(t()),response_modes_supported:i(t()).optional(),grant_types_supported:i(t()).optional(),acr_values_supported:i(t()).optional(),subject_types_supported:i(t()),id_token_signing_alg_values_supported:i(t()),id_token_encryption_alg_values_supported:i(t()).optional(),id_token_encryption_enc_values_supported:i(t()).optional(),userinfo_signing_alg_values_supported:i(t()).optional(),userinfo_encryption_alg_values_supported:i(t()).optional(),userinfo_encryption_enc_values_supported:i(t()).optional(),request_object_signing_alg_values_supported:i(t()).optional(),request_object_encryption_alg_values_supported:i(t()).optional(),request_object_encryption_enc_values_supported:i(t()).optional(),token_endpoint_auth_methods_supported:i(t()).optional(),token_endpoint_auth_signing_alg_values_supported:i(t()).optional(),display_values_supported:i(t()).optional(),claim_types_supported:i(t()).optional(),claims_supported:i(t()).optional(),service_documentation:t().optional(),claims_locales_supported:i(t()).optional(),ui_locales_supported:i(t()).optional(),claims_parameter_supported:_().optional(),request_parameter_supported:_().optional(),request_uri_parameter_supported:_().optional(),require_request_uri_registration:_().optional(),op_policy_uri:w.optional(),op_tos_uri:w.optional()}).passthrough(),Ft=Xt.merge(Me.pick({code_challenge_methods_supported:!0})),Ne=r({access_token:t(),id_token:t().optional(),token_type:t(),expires_in:f().optional(),scope:t().optional(),refresh_token:t().optional()}).strip(),eo=r({error:t(),error_description:t().optional(),error_uri:t().optional()}),_e=w.optional().or(u("").transform(()=>{})),to=r({redirect_uris:i(w),token_endpoint_auth_method:t().optional(),grant_types:i(t()).optional(),response_types:i(t()).optional(),client_name:t().optional(),client_uri:w.optional(),logo_uri:_e,scope:t().optional(),contacts:i(t()).optional(),tos_uri:_e,policy_uri:t().optional(),jwks_uri:w.optional(),jwks:De().optional(),software_id:t().optional(),software_version:t().optional(),software_statement:t().optional()}).strip(),oo=r({client_id:t(),client_secret:t().optional(),client_id_issued_at:f().optional(),client_secret_expires_at:f().optional()}).strip(),no=to.merge(oo);r({error:t(),error_description:t().optional()}).strip();r({token:t(),token_type_hint:t().optional()}).strip();function so(e){const o=typeof e=="string"?new URL(e):new URL(e.href);return o.hash="",o}function ro({requestedResource:e,configuredResource:o}){const a=typeof e=="string"?new URL(e):new URL(e.href),s=typeof o=="string"?new URL(o):new URL(o.href);if(a.origin!==s.origin||a.pathname.length<s.pathname.length)return!1;const c=a.pathname.endsWith("/")?a.pathname:a.pathname+"/",p=s.pathname.endsWith("/")?s.pathname:s.pathname+"/";return c.startsWith(p)}class R extends Error{constructor(o,a){super(o),this.errorUri=a,this.name=this.constructor.name}toResponseObject(){const o={error:this.errorCode,error_description:this.message};return this.errorUri&&(o.error_uri=this.errorUri),o}get errorCode(){return this.constructor.errorCode}}class Z extends R{}Z.errorCode="invalid_request";class N extends R{}N.errorCode="invalid_client";class j extends R{}j.errorCode="invalid_grant";class $ extends R{}$.errorCode="unauthorized_client";class Y extends R{}Y.errorCode="unsupported_grant_type";class K extends R{}K.errorCode="invalid_scope";class Q extends R{}Q.errorCode="access_denied";class E extends R{}E.errorCode="server_error";class X extends R{}X.errorCode="temporarily_unavailable";class F extends R{}F.errorCode="unsupported_response_type";class ee extends R{}ee.errorCode="unsupported_token_type";class te extends R{}te.errorCode="invalid_token";class oe extends R{}oe.errorCode="method_not_allowed";class ne extends R{}ne.errorCode="too_many_requests";class se extends R{}se.errorCode="invalid_client_metadata";class re extends R{}re.errorCode="insufficient_scope";const ao={[Z.errorCode]:Z,[N.errorCode]:N,[j.errorCode]:j,[$.errorCode]:$,[Y.errorCode]:Y,[K.errorCode]:K,[Q.errorCode]:Q,[E.errorCode]:E,[X.errorCode]:X,[F.errorCode]:F,[ee.errorCode]:ee,[te.errorCode]:te,[oe.errorCode]:oe,[ne.errorCode]:ne,[se.errorCode]:se,[re.errorCode]:re};class Eo extends Error{constructor(o){super(o??"Unauthorized")}}const B="code",W="S256";function je(e,o){const a=e.client_secret!==void 0;return o.length===0?a?"client_secret_post":"none":a&&o.includes("client_secret_basic")?"client_secret_basic":a&&o.includes("client_secret_post")?"client_secret_post":o.includes("none")?"none":a?"client_secret_post":"none"}function $e(e,o,a,s){const{client_id:c,client_secret:p}=o;switch(e){case"client_secret_basic":io(c,p,a);return;case"client_secret_post":co(c,p,s);return;case"none":uo(c,s);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function io(e,o,a){if(!o)throw new Error("client_secret_basic authentication requires a client_secret");const s=btoa(`${e}:${o}`);a.set("Authorization",`Basic ${s}`)}function co(e,o,a){a.set("client_id",e),o&&a.set("client_secret",o)}function uo(e,o){o.set("client_id",e)}async function de(e){const o=e instanceof Response?e.status:void 0,a=e instanceof Response?await e.text():e;try{const s=eo.parse(JSON.parse(a)),{error:c,error_description:p,error_uri:d}=s,l=ao[c]||E;return new l(p||"",d)}catch(s){const c=`${o?`HTTP ${o}: `:""}Invalid OAuth error response: ${s}. Raw body: ${a}`;return new E(c)}}async function Oo(e,o){var a,s;try{return await G(e,o)}catch(c){if(c instanceof N||c instanceof $)return await((a=e.invalidateCredentials)===null||a===void 0?void 0:a.call(e,"all")),await G(e,o);if(c instanceof j)return await((s=e.invalidateCredentials)===null||s===void 0?void 0:s.call(e,"tokens")),await G(e,o);throw c}}async function G(e,{serverUrl:o,authorizationCode:a,scope:s,resourceMetadataUrl:c,fetchFn:p}){let d,l;try{d=await po(o,{resourceMetadataUrl:c},p),d.authorization_servers&&d.authorization_servers.length>0&&(l=d.authorization_servers[0])}catch{}l||(l=o);const h=await lo(o,e,d),g=await fo(l,{fetchFn:p});let m=await Promise.resolve(e.clientInformation());if(!m){if(a!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const v=await So(l,{metadata:g,clientMetadata:e.clientMetadata,fetchFn:p});await e.saveClientInformation(v),m=v}if(a!==void 0){const v=await e.codeVerifier(),J=await Ro(l,{metadata:g,clientInformation:m,authorizationCode:a,codeVerifier:v,redirectUri:e.redirectUrl,resource:h,addClientAuthentication:e.addClientAuthentication,fetchFn:p});return await e.saveTokens(J),"AUTHORIZED"}const T=await e.tokens();if(T?.refresh_token)try{const v=await yo(l,{metadata:g,clientInformation:m,refreshToken:T.refresh_token,resource:h,addClientAuthentication:e.addClientAuthentication,fetchFn:p});return await e.saveTokens(v),"AUTHORIZED"}catch(v){if(!(!(v instanceof R)||v instanceof E))throw v}const b=e.state?await e.state():void 0,{authorizationUrl:U,codeVerifier:L}=await wo(l,{metadata:g,clientInformation:m,state:b,redirectUrl:e.redirectUrl,scope:s||e.clientMetadata.scope,resource:h});return await e.saveCodeVerifier(L),await e.redirectToAuthorization(U),"REDIRECT"}async function lo(e,o,a){const s=so(e);if(o.validateResourceURL)return await o.validateResourceURL(s,a?.resource);if(a){if(!ro({requestedResource:s,configuredResource:a.resource}))throw new Error(`Protected resource ${a.resource} does not match expected ${s} (or origin)`);return new URL(a.resource)}}function Io(e){const o=e.headers.get("WWW-Authenticate");if(!o)return;const[a,s]=o.split(" ");if(a.toLowerCase()!=="bearer"||!s)return;const p=/resource_metadata="([^"]*)"/.exec(o);if(p)try{return new URL(p[1])}catch{return}}async function po(e,o,a=fetch){const s=await _o(e,"oauth-protected-resource",a,{protocolVersion:o?.protocolVersion,metadataUrl:o?.resourceMetadataUrl});if(!s||s.status===404)throw new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!s.ok)throw new Error(`HTTP ${s.status} trying to load well-known OAuth protected resource metadata.`);return Qt.parse(await s.json())}async function he(e,o,a=fetch){try{return await a(e,{headers:o})}catch(s){if(s instanceof TypeError)return o?he(e,void 0,a):void 0;throw s}}function ho(e,o="",a={}){return o.endsWith("/")&&(o=o.slice(0,-1)),a.prependPathname?`${o}/.well-known/${e}`:`/.well-known/${e}${o}`}async function ge(e,o,a=fetch){return await he(e,{"MCP-Protocol-Version":o},a)}function mo(e,o){return!e||e.status>=400&&e.status<500&&o!=="/"}async function _o(e,o,a,s){var c,p;const d=new URL(e),l=(c=s?.protocolVersion)!==null&&c!==void 0?c:ae;let h;if(s?.metadataUrl)h=new URL(s.metadataUrl);else{const m=ho(o,d.pathname);h=new URL(m,(p=s?.metadataServerUrl)!==null&&p!==void 0?p:d),h.search=d.search}let g=await ge(h,l,a);if(!s?.metadataUrl&&mo(g,d.pathname)){const m=new URL(`/.well-known/${o}`,d);g=await ge(m,l,a)}return g}function go(e){const o=typeof e=="string"?new URL(e):e,a=o.pathname!=="/",s=[];if(!a)return s.push({url:new URL("/.well-known/oauth-authorization-server",o.origin),type:"oauth"}),s.push({url:new URL("/.well-known/openid-configuration",o.origin),type:"oidc"}),s;let c=o.pathname;return c.endsWith("/")&&(c=c.slice(0,-1)),s.push({url:new URL(`/.well-known/oauth-authorization-server${c}`,o.origin),type:"oauth"}),s.push({url:new URL("/.well-known/oauth-authorization-server",o.origin),type:"oauth"}),s.push({url:new URL(`/.well-known/openid-configuration${c}`,o.origin),type:"oidc"}),s.push({url:new URL(`${c}/.well-known/openid-configuration`,o.origin),type:"oidc"}),s}async function fo(e,{fetchFn:o=fetch,protocolVersion:a=ae}={}){const s={"MCP-Protocol-Version":a,Accept:"application/json"},c=go(e);for(const{url:p,type:d}of c){const l=await he(p,s,o);if(l){if(!l.ok){if(l.status>=400&&l.status<500)continue;throw new Error(`HTTP ${l.status} trying to load ${d==="oauth"?"OAuth":"OpenID provider"} metadata from ${p}`)}return d==="oauth"?Me.parse(await l.json()):Ft.parse(await l.json())}}}async function wo(e,{metadata:o,clientInformation:a,redirectUrl:s,scope:c,state:p,resource:d}){let l;if(o){if(l=new URL(o.authorization_endpoint),!o.response_types_supported.includes(B))throw new Error(`Incompatible auth server: does not support response type ${B}`);if(o.code_challenge_methods_supported&&!o.code_challenge_methods_supported.includes(W))throw new Error(`Incompatible auth server: does not support code challenge method ${W}`)}else l=new URL("/authorize",e);const h=await Kt(),g=h.code_verifier,m=h.code_challenge;return l.searchParams.set("response_type",B),l.searchParams.set("client_id",a.client_id),l.searchParams.set("code_challenge",m),l.searchParams.set("code_challenge_method",W),l.searchParams.set("redirect_uri",String(s)),p&&l.searchParams.set("state",p),c&&l.searchParams.set("scope",c),c?.includes("offline_access")&&l.searchParams.append("prompt","consent"),d&&l.searchParams.set("resource",d.href),{authorizationUrl:l,codeVerifier:g}}async function Ro(e,{metadata:o,clientInformation:a,authorizationCode:s,codeVerifier:c,redirectUri:p,resource:d,addClientAuthentication:l,fetchFn:h}){var g;const m="authorization_code",T=o?.token_endpoint?new URL(o.token_endpoint):new URL("/token",e);if(o?.grant_types_supported&&!o.grant_types_supported.includes(m))throw new Error(`Incompatible auth server: does not support grant type ${m}`);const b=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"}),U=new URLSearchParams({grant_type:m,code:s,code_verifier:c,redirect_uri:String(p)});if(l)l(b,U,e,o);else{const v=(g=o?.token_endpoint_auth_methods_supported)!==null&&g!==void 0?g:[],J=je(a,v);$e(J,a,b,U)}d&&U.set("resource",d.href);const L=await(h??fetch)(T,{method:"POST",headers:b,body:U});if(!L.ok)throw await de(L);return Ne.parse(await L.json())}async function yo(e,{metadata:o,clientInformation:a,refreshToken:s,resource:c,addClientAuthentication:p,fetchFn:d}){var l;const h="refresh_token";let g;if(o){if(g=new URL(o.token_endpoint),o.grant_types_supported&&!o.grant_types_supported.includes(h))throw new Error(`Incompatible auth server: does not support grant type ${h}`)}else g=new URL("/token",e);const m=new Headers({"Content-Type":"application/x-www-form-urlencoded"}),T=new URLSearchParams({grant_type:h,refresh_token:s});if(p)p(m,T,e,o);else{const U=(l=o?.token_endpoint_auth_methods_supported)!==null&&l!==void 0?l:[],L=je(a,U);$e(L,a,m,T)}c&&T.set("resource",c.href);const b=await(d??fetch)(g,{method:"POST",headers:m,body:T});if(!b.ok)throw await de(b);return Ne.parse({refresh_token:s,...await b.json()})}async function So(e,{metadata:o,clientMetadata:a,fetchFn:s}){let c;if(o){if(!o.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");c=new URL(o.registration_endpoint)}else c=new URL("/register",e);const p=await(s??fetch)(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!p.ok)throw await de(p);return no.parse(await p.json())}export{Ce as C,me as E,gt as G,Ye as I,ko as J,ae as L,Lo as M,ke as P,nt as R,xo as S,Eo as U,be as a,bo as b,Co as c,To as d,xe as e,Ht as f,pt as g,Fe as h,Po as i,tt as j,qe as k,St as l,Oo as m,Io as n,Uo as o,po as p,fo as q,Ro as r};
|
|
1
|
+
import{bI as y,aq as t,bJ as f,ap as r,c8 as n,bF as u,bC as O,aE as i,aG as _,aF as I,bB as k,c9 as ze,ca as He,cb as Ve,bH as De}from"./index-tTqkKQJp.js";const ae="2025-06-18",xo=[ae,"2025-03-26","2024-11-05","2024-10-07"],z="2.0",fe=y([t(),f().int()]),we=t(),Je=r({progressToken:n(fe)}).passthrough(),x=r({_meta:n(Je)}).passthrough(),S=r({method:t(),params:n(x)}),q=r({_meta:n(r({}).passthrough())}).passthrough(),P=r({method:t(),params:n(q)}),C=r({_meta:n(r({}).passthrough())}).passthrough(),H=y([t(),f().int()]),Re=r({jsonrpc:u(z),id:H}).merge(S).strict(),Co=e=>Re.safeParse(e).success,ye=r({jsonrpc:u(z)}).merge(P).strict(),To=e=>ye.safeParse(e).success,Se=r({jsonrpc:u(z),id:H,result:C}).strict(),Po=e=>Se.safeParse(e).success;var me;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError"})(me||(me={}));const ve=r({jsonrpc:u(z),id:H,error:r({code:f().int(),message:t(),data:n(O())})}).strict(),bo=e=>ve.safeParse(e).success,ko=y([Re,ye,Se,ve]),xe=C.strict(),Ce=P.extend({method:u("notifications/cancelled"),params:q.extend({requestId:H,reason:t().optional()})}),Be=r({src:t(),mimeType:n(t()),sizes:n(i(t()))}).passthrough(),A=r({icons:i(Be).optional()}).passthrough(),M=r({name:t(),title:n(t())}).passthrough(),Te=M.extend({version:t(),websiteUrl:n(t())}).merge(A),We=r({experimental:n(r({}).passthrough()),sampling:n(r({}).passthrough()),elicitation:n(r({}).passthrough()),roots:n(r({listChanged:n(_())}).passthrough())}).passthrough(),Ge=S.extend({method:u("initialize"),params:x.extend({protocolVersion:t(),capabilities:We,clientInfo:Te})}),Ze=r({experimental:n(r({}).passthrough()),logging:n(r({}).passthrough()),completions:n(r({}).passthrough()),prompts:n(r({listChanged:n(_())}).passthrough()),resources:n(r({subscribe:n(_()),listChanged:n(_())}).passthrough()),tools:n(r({listChanged:n(_())}).passthrough())}).passthrough(),Ye=C.extend({protocolVersion:t(),capabilities:Ze,serverInfo:Te,instructions:n(t())}),Pe=P.extend({method:u("notifications/initialized")}),Uo=e=>Pe.safeParse(e).success,be=S.extend({method:u("ping")}),Ke=r({progress:f(),total:n(f()),message:n(t())}).passthrough(),ke=P.extend({method:u("notifications/progress"),params:q.merge(Ke).extend({progressToken:fe})}),V=S.extend({params:x.extend({cursor:n(we)}).optional()}),D=C.extend({nextCursor:n(we)}),Ue=r({uri:t(),mimeType:n(t()),_meta:n(r({}).passthrough())}).passthrough(),Le=Ue.extend({text:t()}),ie=t().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Ee=Ue.extend({blob:ie}),Oe=M.extend({uri:t(),description:n(t()),mimeType:n(t()),_meta:n(r({}).passthrough())}).merge(A),Qe=M.extend({uriTemplate:t(),description:n(t()),mimeType:n(t()),_meta:n(r({}).passthrough())}).merge(A),Xe=V.extend({method:u("resources/list")}),Fe=D.extend({resources:i(Oe)}),et=V.extend({method:u("resources/templates/list")}),tt=D.extend({resourceTemplates:i(Qe)}),ot=S.extend({method:u("resources/read"),params:x.extend({uri:t()})}),nt=C.extend({contents:i(y([Le,Ee]))}),st=P.extend({method:u("notifications/resources/list_changed")}),rt=S.extend({method:u("resources/subscribe"),params:x.extend({uri:t()})}),at=S.extend({method:u("resources/unsubscribe"),params:x.extend({uri:t()})}),it=P.extend({method:u("notifications/resources/updated"),params:q.extend({uri:t()})}),ct=r({name:t(),description:n(t()),required:n(_())}).passthrough(),ut=M.extend({description:n(t()),arguments:n(i(ct)),_meta:n(r({}).passthrough())}).merge(A),lt=V.extend({method:u("prompts/list")}),pt=D.extend({prompts:i(ut)}),dt=S.extend({method:u("prompts/get"),params:x.extend({name:t(),arguments:n(I(t()))})}),ce=r({type:u("text"),text:t(),_meta:n(r({}).passthrough())}).passthrough(),ue=r({type:u("image"),data:ie,mimeType:t(),_meta:n(r({}).passthrough())}).passthrough(),le=r({type:u("audio"),data:ie,mimeType:t(),_meta:n(r({}).passthrough())}).passthrough(),ht=r({type:u("resource"),resource:y([Le,Ee]),_meta:n(r({}).passthrough())}).passthrough(),mt=Oe.extend({type:u("resource_link")}),Ie=y([ce,ue,le,mt,ht]),_t=r({role:k(["user","assistant"]),content:Ie}).passthrough(),gt=C.extend({description:n(t()),messages:i(_t)}),ft=P.extend({method:u("notifications/prompts/list_changed")}),wt=r({title:n(t()),readOnlyHint:n(_()),destructiveHint:n(_()),idempotentHint:n(_()),openWorldHint:n(_())}).passthrough(),Rt=M.extend({description:n(t()),inputSchema:r({type:u("object"),properties:n(r({}).passthrough()),required:n(i(t()))}).passthrough(),outputSchema:n(r({type:u("object"),properties:n(r({}).passthrough()),required:n(i(t()))}).passthrough()),annotations:n(wt),_meta:n(r({}).passthrough())}).merge(A),yt=V.extend({method:u("tools/list")}),St=D.extend({tools:i(Rt)}),qe=C.extend({content:i(Ie).default([]),structuredContent:r({}).passthrough().optional(),isError:n(_())});qe.or(C.extend({toolResult:O()}));const vt=S.extend({method:u("tools/call"),params:x.extend({name:t(),arguments:n(I(O()))})}),xt=P.extend({method:u("notifications/tools/list_changed")}),Ae=k(["debug","info","notice","warning","error","critical","alert","emergency"]),Ct=S.extend({method:u("logging/setLevel"),params:x.extend({level:Ae})}),Tt=P.extend({method:u("notifications/message"),params:q.extend({level:Ae,logger:n(t()),data:O()})}),Pt=r({name:t().optional()}).passthrough(),bt=r({hints:n(i(Pt)),costPriority:n(f().min(0).max(1)),speedPriority:n(f().min(0).max(1)),intelligencePriority:n(f().min(0).max(1))}).passthrough(),kt=r({role:k(["user","assistant"]),content:y([ce,ue,le])}).passthrough(),Ut=S.extend({method:u("sampling/createMessage"),params:x.extend({messages:i(kt),systemPrompt:n(t()),includeContext:n(k(["none","thisServer","allServers"])),temperature:n(f()),maxTokens:f().int(),stopSequences:n(i(t())),metadata:n(r({}).passthrough()),modelPreferences:n(bt)})}),Lt=C.extend({model:t(),stopReason:n(k(["endTurn","stopSequence","maxTokens"]).or(t())),role:k(["user","assistant"]),content:ze("type",[ce,ue,le])}),Et=r({type:u("boolean"),title:n(t()),description:n(t()),default:n(_())}).passthrough(),Ot=r({type:u("string"),title:n(t()),description:n(t()),minLength:n(f()),maxLength:n(f()),format:n(k(["email","uri","date","date-time"]))}).passthrough(),It=r({type:k(["number","integer"]),title:n(t()),description:n(t()),minimum:n(f()),maximum:n(f())}).passthrough(),qt=r({type:u("string"),title:n(t()),description:n(t()),enum:i(t()),enumNames:n(i(t()))}).passthrough(),At=y([Et,Ot,It,qt]),Mt=S.extend({method:u("elicitation/create"),params:x.extend({message:t(),requestedSchema:r({type:u("object"),properties:I(t(),At),required:n(i(t()))}).passthrough()})}),Nt=C.extend({action:k(["accept","decline","cancel"]),content:n(I(t(),O()))}),jt=r({type:u("ref/resource"),uri:t()}).passthrough(),$t=r({type:u("ref/prompt"),name:t()}).passthrough(),zt=S.extend({method:u("completion/complete"),params:x.extend({ref:y([$t,jt]),argument:r({name:t(),value:t()}).passthrough(),context:n(r({arguments:n(I(t(),t()))}))})}),Ht=C.extend({completion:r({values:i(t()).max(100),total:n(f().int()),hasMore:n(_())}).passthrough()}),Vt=r({uri:t().startsWith("file://"),name:n(t()),_meta:n(r({}).passthrough())}).passthrough(),Dt=S.extend({method:u("roots/list")}),Jt=C.extend({roots:i(Vt)}),Bt=P.extend({method:u("notifications/roots/list_changed")});y([be,Ge,zt,Ct,dt,lt,Xe,et,ot,rt,at,vt,yt]);y([Ce,ke,Pe,Bt]);y([xe,Lt,Nt,Jt]);y([be,Ut,Mt,Dt]);y([Ce,ke,Tt,it,st,xt,ft]);y([xe,Ye,Ht,gt,pt,Fe,tt,nt,qe,St]);class Lo extends Error{constructor(o,a,s){super(`MCP error ${o}: ${a}`),this.code=o,this.data=s,this.name="McpError"}}let pe;pe=globalThis.crypto;async function Wt(e){return(await pe).getRandomValues(new Uint8Array(e))}async function Gt(e){const o="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",a=Math.pow(2,8)-Math.pow(2,8)%o.length;let s="";for(;s.length<e;){const c=await Wt(e-s.length);for(const p of c)p<a&&(s+=o[p%o.length])}return s}async function Zt(e){return await Gt(e)}async function Yt(e){const o=await(await pe).subtle.digest("SHA-256",new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(o))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function Kt(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;const o=await Zt(e),a=await Yt(o);return{code_verifier:o,code_challenge:a}}const w=t().url().superRefine((e,o)=>{if(!URL.canParse(e))return o.addIssue({code:He.custom,message:"URL must be parseable",fatal:!0}),Ve}).refine(e=>{const o=new URL(e);return o.protocol!=="javascript:"&&o.protocol!=="data:"&&o.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),Qt=r({resource:t().url(),authorization_servers:i(w).optional(),jwks_uri:t().url().optional(),scopes_supported:i(t()).optional(),bearer_methods_supported:i(t()).optional(),resource_signing_alg_values_supported:i(t()).optional(),resource_name:t().optional(),resource_documentation:t().optional(),resource_policy_uri:t().url().optional(),resource_tos_uri:t().url().optional(),tls_client_certificate_bound_access_tokens:_().optional(),authorization_details_types_supported:i(t()).optional(),dpop_signing_alg_values_supported:i(t()).optional(),dpop_bound_access_tokens_required:_().optional()}).passthrough(),Me=r({issuer:t(),authorization_endpoint:w,token_endpoint:w,registration_endpoint:w.optional(),scopes_supported:i(t()).optional(),response_types_supported:i(t()),response_modes_supported:i(t()).optional(),grant_types_supported:i(t()).optional(),token_endpoint_auth_methods_supported:i(t()).optional(),token_endpoint_auth_signing_alg_values_supported:i(t()).optional(),service_documentation:w.optional(),revocation_endpoint:w.optional(),revocation_endpoint_auth_methods_supported:i(t()).optional(),revocation_endpoint_auth_signing_alg_values_supported:i(t()).optional(),introspection_endpoint:t().optional(),introspection_endpoint_auth_methods_supported:i(t()).optional(),introspection_endpoint_auth_signing_alg_values_supported:i(t()).optional(),code_challenge_methods_supported:i(t()).optional()}).passthrough(),Xt=r({issuer:t(),authorization_endpoint:w,token_endpoint:w,userinfo_endpoint:w.optional(),jwks_uri:w,registration_endpoint:w.optional(),scopes_supported:i(t()).optional(),response_types_supported:i(t()),response_modes_supported:i(t()).optional(),grant_types_supported:i(t()).optional(),acr_values_supported:i(t()).optional(),subject_types_supported:i(t()),id_token_signing_alg_values_supported:i(t()),id_token_encryption_alg_values_supported:i(t()).optional(),id_token_encryption_enc_values_supported:i(t()).optional(),userinfo_signing_alg_values_supported:i(t()).optional(),userinfo_encryption_alg_values_supported:i(t()).optional(),userinfo_encryption_enc_values_supported:i(t()).optional(),request_object_signing_alg_values_supported:i(t()).optional(),request_object_encryption_alg_values_supported:i(t()).optional(),request_object_encryption_enc_values_supported:i(t()).optional(),token_endpoint_auth_methods_supported:i(t()).optional(),token_endpoint_auth_signing_alg_values_supported:i(t()).optional(),display_values_supported:i(t()).optional(),claim_types_supported:i(t()).optional(),claims_supported:i(t()).optional(),service_documentation:t().optional(),claims_locales_supported:i(t()).optional(),ui_locales_supported:i(t()).optional(),claims_parameter_supported:_().optional(),request_parameter_supported:_().optional(),request_uri_parameter_supported:_().optional(),require_request_uri_registration:_().optional(),op_policy_uri:w.optional(),op_tos_uri:w.optional()}).passthrough(),Ft=Xt.merge(Me.pick({code_challenge_methods_supported:!0})),Ne=r({access_token:t(),id_token:t().optional(),token_type:t(),expires_in:f().optional(),scope:t().optional(),refresh_token:t().optional()}).strip(),eo=r({error:t(),error_description:t().optional(),error_uri:t().optional()}),_e=w.optional().or(u("").transform(()=>{})),to=r({redirect_uris:i(w),token_endpoint_auth_method:t().optional(),grant_types:i(t()).optional(),response_types:i(t()).optional(),client_name:t().optional(),client_uri:w.optional(),logo_uri:_e,scope:t().optional(),contacts:i(t()).optional(),tos_uri:_e,policy_uri:t().optional(),jwks_uri:w.optional(),jwks:De().optional(),software_id:t().optional(),software_version:t().optional(),software_statement:t().optional()}).strip(),oo=r({client_id:t(),client_secret:t().optional(),client_id_issued_at:f().optional(),client_secret_expires_at:f().optional()}).strip(),no=to.merge(oo);r({error:t(),error_description:t().optional()}).strip();r({token:t(),token_type_hint:t().optional()}).strip();function so(e){const o=typeof e=="string"?new URL(e):new URL(e.href);return o.hash="",o}function ro({requestedResource:e,configuredResource:o}){const a=typeof e=="string"?new URL(e):new URL(e.href),s=typeof o=="string"?new URL(o):new URL(o.href);if(a.origin!==s.origin||a.pathname.length<s.pathname.length)return!1;const c=a.pathname.endsWith("/")?a.pathname:a.pathname+"/",p=s.pathname.endsWith("/")?s.pathname:s.pathname+"/";return c.startsWith(p)}class R extends Error{constructor(o,a){super(o),this.errorUri=a,this.name=this.constructor.name}toResponseObject(){const o={error:this.errorCode,error_description:this.message};return this.errorUri&&(o.error_uri=this.errorUri),o}get errorCode(){return this.constructor.errorCode}}class Z extends R{}Z.errorCode="invalid_request";class N extends R{}N.errorCode="invalid_client";class j extends R{}j.errorCode="invalid_grant";class $ extends R{}$.errorCode="unauthorized_client";class Y extends R{}Y.errorCode="unsupported_grant_type";class K extends R{}K.errorCode="invalid_scope";class Q extends R{}Q.errorCode="access_denied";class E extends R{}E.errorCode="server_error";class X extends R{}X.errorCode="temporarily_unavailable";class F extends R{}F.errorCode="unsupported_response_type";class ee extends R{}ee.errorCode="unsupported_token_type";class te extends R{}te.errorCode="invalid_token";class oe extends R{}oe.errorCode="method_not_allowed";class ne extends R{}ne.errorCode="too_many_requests";class se extends R{}se.errorCode="invalid_client_metadata";class re extends R{}re.errorCode="insufficient_scope";const ao={[Z.errorCode]:Z,[N.errorCode]:N,[j.errorCode]:j,[$.errorCode]:$,[Y.errorCode]:Y,[K.errorCode]:K,[Q.errorCode]:Q,[E.errorCode]:E,[X.errorCode]:X,[F.errorCode]:F,[ee.errorCode]:ee,[te.errorCode]:te,[oe.errorCode]:oe,[ne.errorCode]:ne,[se.errorCode]:se,[re.errorCode]:re};class Eo extends Error{constructor(o){super(o??"Unauthorized")}}const B="code",W="S256";function je(e,o){const a=e.client_secret!==void 0;return o.length===0?a?"client_secret_post":"none":a&&o.includes("client_secret_basic")?"client_secret_basic":a&&o.includes("client_secret_post")?"client_secret_post":o.includes("none")?"none":a?"client_secret_post":"none"}function $e(e,o,a,s){const{client_id:c,client_secret:p}=o;switch(e){case"client_secret_basic":io(c,p,a);return;case"client_secret_post":co(c,p,s);return;case"none":uo(c,s);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function io(e,o,a){if(!o)throw new Error("client_secret_basic authentication requires a client_secret");const s=btoa(`${e}:${o}`);a.set("Authorization",`Basic ${s}`)}function co(e,o,a){a.set("client_id",e),o&&a.set("client_secret",o)}function uo(e,o){o.set("client_id",e)}async function de(e){const o=e instanceof Response?e.status:void 0,a=e instanceof Response?await e.text():e;try{const s=eo.parse(JSON.parse(a)),{error:c,error_description:p,error_uri:d}=s,l=ao[c]||E;return new l(p||"",d)}catch(s){const c=`${o?`HTTP ${o}: `:""}Invalid OAuth error response: ${s}. Raw body: ${a}`;return new E(c)}}async function Oo(e,o){var a,s;try{return await G(e,o)}catch(c){if(c instanceof N||c instanceof $)return await((a=e.invalidateCredentials)===null||a===void 0?void 0:a.call(e,"all")),await G(e,o);if(c instanceof j)return await((s=e.invalidateCredentials)===null||s===void 0?void 0:s.call(e,"tokens")),await G(e,o);throw c}}async function G(e,{serverUrl:o,authorizationCode:a,scope:s,resourceMetadataUrl:c,fetchFn:p}){let d,l;try{d=await po(o,{resourceMetadataUrl:c},p),d.authorization_servers&&d.authorization_servers.length>0&&(l=d.authorization_servers[0])}catch{}l||(l=o);const h=await lo(o,e,d),g=await fo(l,{fetchFn:p});let m=await Promise.resolve(e.clientInformation());if(!m){if(a!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const v=await So(l,{metadata:g,clientMetadata:e.clientMetadata,fetchFn:p});await e.saveClientInformation(v),m=v}if(a!==void 0){const v=await e.codeVerifier(),J=await Ro(l,{metadata:g,clientInformation:m,authorizationCode:a,codeVerifier:v,redirectUri:e.redirectUrl,resource:h,addClientAuthentication:e.addClientAuthentication,fetchFn:p});return await e.saveTokens(J),"AUTHORIZED"}const T=await e.tokens();if(T?.refresh_token)try{const v=await yo(l,{metadata:g,clientInformation:m,refreshToken:T.refresh_token,resource:h,addClientAuthentication:e.addClientAuthentication,fetchFn:p});return await e.saveTokens(v),"AUTHORIZED"}catch(v){if(!(!(v instanceof R)||v instanceof E))throw v}const b=e.state?await e.state():void 0,{authorizationUrl:U,codeVerifier:L}=await wo(l,{metadata:g,clientInformation:m,state:b,redirectUrl:e.redirectUrl,scope:s||e.clientMetadata.scope,resource:h});return await e.saveCodeVerifier(L),await e.redirectToAuthorization(U),"REDIRECT"}async function lo(e,o,a){const s=so(e);if(o.validateResourceURL)return await o.validateResourceURL(s,a?.resource);if(a){if(!ro({requestedResource:s,configuredResource:a.resource}))throw new Error(`Protected resource ${a.resource} does not match expected ${s} (or origin)`);return new URL(a.resource)}}function Io(e){const o=e.headers.get("WWW-Authenticate");if(!o)return;const[a,s]=o.split(" ");if(a.toLowerCase()!=="bearer"||!s)return;const p=/resource_metadata="([^"]*)"/.exec(o);if(p)try{return new URL(p[1])}catch{return}}async function po(e,o,a=fetch){const s=await _o(e,"oauth-protected-resource",a,{protocolVersion:o?.protocolVersion,metadataUrl:o?.resourceMetadataUrl});if(!s||s.status===404)throw new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!s.ok)throw new Error(`HTTP ${s.status} trying to load well-known OAuth protected resource metadata.`);return Qt.parse(await s.json())}async function he(e,o,a=fetch){try{return await a(e,{headers:o})}catch(s){if(s instanceof TypeError)return o?he(e,void 0,a):void 0;throw s}}function ho(e,o="",a={}){return o.endsWith("/")&&(o=o.slice(0,-1)),a.prependPathname?`${o}/.well-known/${e}`:`/.well-known/${e}${o}`}async function ge(e,o,a=fetch){return await he(e,{"MCP-Protocol-Version":o},a)}function mo(e,o){return!e||e.status>=400&&e.status<500&&o!=="/"}async function _o(e,o,a,s){var c,p;const d=new URL(e),l=(c=s?.protocolVersion)!==null&&c!==void 0?c:ae;let h;if(s?.metadataUrl)h=new URL(s.metadataUrl);else{const m=ho(o,d.pathname);h=new URL(m,(p=s?.metadataServerUrl)!==null&&p!==void 0?p:d),h.search=d.search}let g=await ge(h,l,a);if(!s?.metadataUrl&&mo(g,d.pathname)){const m=new URL(`/.well-known/${o}`,d);g=await ge(m,l,a)}return g}function go(e){const o=typeof e=="string"?new URL(e):e,a=o.pathname!=="/",s=[];if(!a)return s.push({url:new URL("/.well-known/oauth-authorization-server",o.origin),type:"oauth"}),s.push({url:new URL("/.well-known/openid-configuration",o.origin),type:"oidc"}),s;let c=o.pathname;return c.endsWith("/")&&(c=c.slice(0,-1)),s.push({url:new URL(`/.well-known/oauth-authorization-server${c}`,o.origin),type:"oauth"}),s.push({url:new URL("/.well-known/oauth-authorization-server",o.origin),type:"oauth"}),s.push({url:new URL(`/.well-known/openid-configuration${c}`,o.origin),type:"oidc"}),s.push({url:new URL(`${c}/.well-known/openid-configuration`,o.origin),type:"oidc"}),s}async function fo(e,{fetchFn:o=fetch,protocolVersion:a=ae}={}){const s={"MCP-Protocol-Version":a,Accept:"application/json"},c=go(e);for(const{url:p,type:d}of c){const l=await he(p,s,o);if(l){if(!l.ok){if(l.status>=400&&l.status<500)continue;throw new Error(`HTTP ${l.status} trying to load ${d==="oauth"?"OAuth":"OpenID provider"} metadata from ${p}`)}return d==="oauth"?Me.parse(await l.json()):Ft.parse(await l.json())}}}async function wo(e,{metadata:o,clientInformation:a,redirectUrl:s,scope:c,state:p,resource:d}){let l;if(o){if(l=new URL(o.authorization_endpoint),!o.response_types_supported.includes(B))throw new Error(`Incompatible auth server: does not support response type ${B}`);if(o.code_challenge_methods_supported&&!o.code_challenge_methods_supported.includes(W))throw new Error(`Incompatible auth server: does not support code challenge method ${W}`)}else l=new URL("/authorize",e);const h=await Kt(),g=h.code_verifier,m=h.code_challenge;return l.searchParams.set("response_type",B),l.searchParams.set("client_id",a.client_id),l.searchParams.set("code_challenge",m),l.searchParams.set("code_challenge_method",W),l.searchParams.set("redirect_uri",String(s)),p&&l.searchParams.set("state",p),c&&l.searchParams.set("scope",c),c?.includes("offline_access")&&l.searchParams.append("prompt","consent"),d&&l.searchParams.set("resource",d.href),{authorizationUrl:l,codeVerifier:g}}async function Ro(e,{metadata:o,clientInformation:a,authorizationCode:s,codeVerifier:c,redirectUri:p,resource:d,addClientAuthentication:l,fetchFn:h}){var g;const m="authorization_code",T=o?.token_endpoint?new URL(o.token_endpoint):new URL("/token",e);if(o?.grant_types_supported&&!o.grant_types_supported.includes(m))throw new Error(`Incompatible auth server: does not support grant type ${m}`);const b=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"}),U=new URLSearchParams({grant_type:m,code:s,code_verifier:c,redirect_uri:String(p)});if(l)l(b,U,e,o);else{const v=(g=o?.token_endpoint_auth_methods_supported)!==null&&g!==void 0?g:[],J=je(a,v);$e(J,a,b,U)}d&&U.set("resource",d.href);const L=await(h??fetch)(T,{method:"POST",headers:b,body:U});if(!L.ok)throw await de(L);return Ne.parse(await L.json())}async function yo(e,{metadata:o,clientInformation:a,refreshToken:s,resource:c,addClientAuthentication:p,fetchFn:d}){var l;const h="refresh_token";let g;if(o){if(g=new URL(o.token_endpoint),o.grant_types_supported&&!o.grant_types_supported.includes(h))throw new Error(`Incompatible auth server: does not support grant type ${h}`)}else g=new URL("/token",e);const m=new Headers({"Content-Type":"application/x-www-form-urlencoded"}),T=new URLSearchParams({grant_type:h,refresh_token:s});if(p)p(m,T,e,o);else{const U=(l=o?.token_endpoint_auth_methods_supported)!==null&&l!==void 0?l:[],L=je(a,U);$e(L,a,m,T)}c&&T.set("resource",c.href);const b=await(d??fetch)(g,{method:"POST",headers:m,body:T});if(!b.ok)throw await de(b);return Ne.parse({refresh_token:s,...await b.json()})}async function So(e,{metadata:o,clientMetadata:a,fetchFn:s}){let c;if(o){if(!o.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");c=new URL(o.registration_endpoint)}else c=new URL("/register",e);const p=await(s??fetch)(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!p.ok)throw await de(p);return no.parse(await p.json())}export{Ce as C,me as E,gt as G,Ye as I,ko as J,ae as L,Lo as M,ke as P,nt as R,xo as S,Eo as U,be as a,bo as b,Co as c,To as d,xe as e,Ht as f,pt as g,Fe as h,Po as i,tt as j,qe as k,St as l,Oo as m,Io as n,Uo as o,po as p,fo as q,Ro as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as r,d as m,j as n,A as o}from"./index-
|
|
1
|
+
import{c as r,d as m,j as n,A as o}from"./index-tTqkKQJp.js";function i(){const e=r.c(3);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={from:"/auth/$pathname"},e[0]=t):t=e[0];const{pathname:s}=m(t);let a;return e[1]!==s?(a=n.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:n.jsx(o,{pathname:s})}),e[1]=s,e[2]=a):a=e[2],a}export{i as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as k,j as i,r as V,af as R,aH as $,aI as O,aJ as U}from"./index-
|
|
1
|
+
import{c as k,j as i,r as V,af as R,aH as $,aI as O,aJ as U}from"./index-tTqkKQJp.js";import{c as m}from"./utils-D4LuHWBB.js";import{I as L}from"./icon-Dk3IUZlY.js";function M(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("relative flex size-8 shrink-0 overflow-hidden rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(U,{"data-slot":"avatar",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function T(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("aspect-square size-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx($,{"data-slot":"avatar-image",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function _(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("bg-muted flex size-full items-center justify-center rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(O,{"data-slot":"avatar-fallback",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}const E=["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"],D="drop-shadow-lg text-muted-foreground bg-muted shadow-lg";function H(r){let e=0;for(let t=0;t<r.length;t++)e=r.charCodeAt(t)+((e<<5)-e);const s=Math.abs(e)%E.length;return E[s]}const S=R("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"}}),J=R("",{variants:{objectFit:{contain:"object-contain",cover:"object-cover"}},defaultVariants:{objectFit:"cover"}}),W=r=>{const e={"3xs":8,"2xs":8,xs:12,sm:16,base:24,lg:28,xl:36,"2xl":48,"3xl":80};return e[r]||e.base};function B(r){const e=k.c(35);let s,t,o,a,n,d,g,l;e[0]!==r?({url:l,fallback:t,shape:a,size:n,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,[f,x]=V.useState(!1);let I;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],I=c;break e}I=t}const C=I;let z;e:{if(j){z=D;break e}if(typeof t=="string"){let c;e[11]!==t?(c=H(t),e[11]=t,e[12]=c):c=e[12],z=c;break e}z=E[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 A=q;let w;e[18]!==s||e[19]!==b||e[20]!==h?(w=m(S({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]!==A||e[25]!==f||e[26]!==p||e[27]!==u||e[28]!==h||e[29]!==l?(v=p&&A?i.jsx("div",{className:m("flex items-center justify-center w-full h-full",y),children:i.jsx(L,{name:A,size:W(h)})}):i.jsxs(i.Fragment,{children:[l&&!f&&i.jsx(T,{src:l,loading:"lazy",alt:"Avatar",className:m(J({objectFit:u})),onError:()=>x(!0)}),(!l||f)&&i.jsx(_,{className:m(y,"rounded-none"),children:C})]}),e[22]=y,e[23]=C,e[24]=A,e[25]=f,e[26]=p,e[27]=u,e[28]=h,e[29]=l,e[30]=v):v=e[30];let F;return e[31]!==o||e[32]!==v||e[33]!==w?(F=i.jsx(M,{className:w,...o,children:v}),e[31]=o,e[32]=v,e[33]=w,e[34]=F):F=e[34],F}function G(r){const e=k.c(18);let s,t,o,a,n,d,g,l;e[0]!==r?({shape:a,size:n,url:l,fallback:t,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,f=h??"base";let x;return e[9]!==s||e[10]!==t||e[11]!==j||e[12]!==u||e[13]!==o||e[14]!==b||e[15]!==f||e[16]!==l?(x=i.jsx(B,{shape:b,url:l,fallback:t,size:f,objectFit:u,className:s,muted:j,...o}),e[9]=s,e[10]=t,e[11]=j,e[12]=u,e[13]=o,e[14]=b,e[15]=f,e[16]=l,e[17]=x):x=e[17],x}G.Skeleton=function({shape:e="square",size:s="base",className:t}){return i.jsx("div",{className:m(S({shape:e,size:s}),"bg-muted animate-pulse",t)})};export{G as A};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as d,af as u,j as l,ag as v}from"./index-
|
|
1
|
+
import{c as d,af as u,j as l,ag as v}from"./index-tTqkKQJp.js";import{c as g}from"./utils-D4LuHWBB.js";const f=u("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function m(o){const e=d.c(12);let r,s,i,t;e[0]!==o?({className:r,variant:t,asChild:i,...s}=o,e[0]=o,e[1]=r,e[2]=s,e[3]=i,e[4]=t):(r=e[1],s=e[2],i=e[3],t=e[4]);const c=(i===void 0?!1:i)?v:"span";let a;e[5]!==r||e[6]!==t?(a=g(f({variant:t}),r),e[5]=r,e[6]=t,e[7]=a):a=e[7];let n;return e[8]!==c||e[9]!==s||e[10]!==a?(n=l.jsx(c,{"data-slot":"badge",className:a,...s}),e[8]=c,e[9]=s,e[10]=a,e[11]=n):n=e[11],n}export{m as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bf as g,bh as p,c4 as l,c5 as v,bg as b,a1 as f,r as u,bo as m,c6 as x,c as y,af as O,j as k,ag as C}from"./index-
|
|
1
|
+
import{bf as g,bh as p,c4 as l,c5 as v,bg as b,a1 as f,r as u,bo as m,c6 as x,c as y,af as O,j as k,ag as C}from"./index-tTqkKQJp.js";import{c as E}from"./utils-D4LuHWBB.js";var M=class extends g{#e;#i=void 0;#t;#s;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#e.defaultMutationOptions(e),p(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#t,observer:this}),t?.mutationKey&&this.options.mutationKey&&l(t.mutationKey)!==l(this.options.mutationKey)?this.reset():this.#t?.state.status==="pending"&&this.#t.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#t?.removeObserver(this)}onMutationUpdate(e){this.#r(),this.#n(e)}getCurrentResult(){return this.#i}reset(){this.#t?.removeObserver(this),this.#t=void 0,this.#r(),this.#n()}mutate(e,t){return this.#s=t,this.#t?.removeObserver(this),this.#t=this.#e.getMutationCache().build(this.#e,this.options),this.#t.addObserver(this),this.#t.execute(e)}#r(){const e=this.#t?.state??v();this.#i={...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset}}#n(e){b.batch(()=>{if(this.#s&&this.hasListeners()){const t=this.#i.variables,i=this.#i.context,s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};e?.type==="success"?(this.#s.onSuccess?.(e.data,t,i,s),this.#s.onSettled?.(e.data,null,t,i,s)):e?.type==="error"&&(this.#s.onError?.(e.error,t,i,s),this.#s.onSettled?.(void 0,e.error,t,i,s))}this.listeners.forEach(t=>{t(this.#i)})})}};function K(e,t){const i=f(t),[s]=u.useState(()=>new M(i,e));u.useEffect(()=>{s.setOptions(e)},[s,e]);const r=u.useSyncExternalStore(u.useCallback(n=>s.subscribe(b.batchCalls(n)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),o=u.useCallback((n,d)=>{s.mutate(n,d).catch(m)},[s]);if(r.error&&x(s.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:o,mutateAsync:r.mutate}}const S=O("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border text-foreground bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-foreground/80 hover:text-foreground",brand:"bg-brand-green-light text-brand-green-dark hover:bg-brand-green-light/90"},size:{default:"h-10 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 px-3 has-[>svg]:px-2.5",xs:"h-6 gap-1 px-2 text-xs has-[>svg]:px-1.5",lg:"h-10 px-6 has-[>svg]:px-4",icon:"size-10"}},defaultVariants:{variant:"default",size:"default"}});function z(e){const t=y.c(14);let i,s,r,o,n;t[0]!==e?({className:i,variant:n,size:r,asChild:o,...s}=e,t[0]=e,t[1]=i,t[2]=s,t[3]=r,t[4]=o,t[5]=n):(i=t[1],s=t[2],r=t[3],o=t[4],n=t[5]);const c=(o===void 0?!1:o)?C:"button";let a;t[6]!==i||t[7]!==r||t[8]!==n?(a=E(S({variant:n,size:r,className:i})),t[6]=i,t[7]=r,t[8]=n,t[9]=a):a=t[9];let h;return t[10]!==c||t[11]!==s||t[12]!==a?(h=k.jsx(c,{"data-slot":"button",className:a,...s}),t[10]=c,t[11]=s,t[12]=a,t[13]=h):h=t[13],h}export{z as B,S as b,K as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as l,j as c}from"./index-
|
|
1
|
+
import{c as l,j as c}from"./index-tTqkKQJp.js";import{c as d}from"./utils-D4LuHWBB.js";function f(r){const e=l.c(8);let t,a;e[0]!==r?({className:t,...a}=r,e[0]=r,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=d("bg-card text-card-foreground hover:bg-accent/50 flex flex-col gap-6 rounded-xl border border-border/75",t),e[3]=t,e[4]=s):s=e[4];let o;return e[5]!==a||e[6]!==s?(o=c.jsx("div",{"data-slot":"card",className:s,...a}),e[5]=a,e[6]=s,e[7]=o):o=e[7],o}function p(r){const e=l.c(8);let t,a;e[0]!==r?({className:t,...a}=r,e[0]=r,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=d("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto]",t),e[3]=t,e[4]=s):s=e[4];let o;return e[5]!==a||e[6]!==s?(o=c.jsx("div",{"data-slot":"card-header",className:s,...a}),e[5]=a,e[6]=s,e[7]=o):o=e[7],o}function m(r){const e=l.c(8);let t,a;e[0]!==r?({className:t,...a}=r,e[0]=r,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=d("leading-none font-semibold",t),e[3]=t,e[4]=s):s=e[4];let o;return e[5]!==a||e[6]!==s?(o=c.jsx("div",{"data-slot":"card-title",className:s,...a}),e[5]=a,e[6]=s,e[7]=o):o=e[7],o}function u(r){const e=l.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let a;return e[2]!==t?(a=c.jsx("div",{"data-slot":"card-content",...t}),e[2]=t,e[3]=a):a=e[3],a}export{f as C,p as a,m as b,u as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as d,j as c,bv as n,bw as l}from"./index-
|
|
1
|
+
import{c as d,j as c,bv as n,bw as l}from"./index-tTqkKQJp.js";import{c as m}from"./utils-D4LuHWBB.js";import{f as b}from"./select-GwKsoZTV.js";function x(o){const e=d.c(9);let r,a;e[0]!==o?({className:r,...a}=o,e[0]=o,e[1]=r,e[2]=a):(r=e[1],a=e[2]);let i;e[3]!==r?(i=m("peer border-foreground dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",r),e[3]=r,e[4]=i):i=e[4];let t;e[5]===Symbol.for("react.memo_cache_sentinel")?(t=c.jsx(l,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-primary-foreground transition-none",children:c.jsx(b,{className:"size-3.5"})}),e[5]=t):t=e[5];let s;return e[6]!==a||e[7]!==i?(s=c.jsx(n,{"data-slot":"checkbox",className:i,...a,children:t}),e[6]=a,e[7]=i,e[8]=s):s=e[8],s}export{x as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{be as e}from"./index-
|
|
1
|
+
import{be as e}from"./index-tTqkKQJp.js";const c=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],y=e("circle-alert",c);export{y as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{be as _,r as N,d as O,as as ee,j as t,c as S,af as te,a6 as se,bd as K}from"./index-tTqkKQJp.js";import{f as oe,c as D,U as B,a as ne,e as re}from"./use-connection-CJdd9H8R.js";import{T as ae}from"./tool-set-selector-BKqxCVz9.js";import{B as ie}from"./badge-BWSVXk6u.js";import{B as I}from"./button-7f3mJDt9.js";import{I as z}from"./icon-Dk3IUZlY.js";import{I as U}from"./input-DsJLZuBe.js";import{S as le}from"./spinner-DZz5BuLl.js";import{T as W}from"./textarea-DkvsoReo.js";import{c as k}from"./utils-D4LuHWBB.js";import{a as G,u as ce,O as de,M as me,P as ue,E as xe}from"./index-CRXnV96L.js";import{b as Z,a as fe,V as H}from"./layout-7tvwsBuE.js";import{U as pe}from"./upload-Bmv_uBao.js";import{u as he}from"./use-mcp-qYkX8fe3.js";import{C as ge}from"./circle-alert-DU3UcGxR.js";import{E as be}from"./error-boundary-BpbgV8Mt.js";import"./tooltip-DG1xYIL4.js";import"./checkbox-Cgzsx5iu.js";import"./select-GwKsoZTV.js";import"./collection-search-Blu2oI67.js";import"./mcp-oauth-BOA4hd1a.js";import"./auth-Cf-BfTK3.js";import"./use-organization-settings-14jcjh3V.js";import"./empty-state-CLlWeA8F.js";import"./use-binding-C_9S-BsF.js";import"./use-tool-call-CXd8t6dd.js";import"./form-CEChYO-W.js";import"./use-gateway-DeuD2XcZ.js";import"./formatDistanceToNow-Ctx6mZEP.js";import"./extract-connection-data-Bubi-83r.js";import"./registry-utils-ulDDT0d8.js";import"./generate-id-Dyweu44Y.js";import"./index-Pk85Lo4X.js";import"./index-B3Svv0HD.js";import"./schema-ggfLBohE.js";import"./useQuery-DcphYrFi.js";const je=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],ve=_("box",je);const Ne=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ye=_("clock",Ne);const we=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],Se=_("code",we);const Ce=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],ke=_("copy",Ce);const $e=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],Ie=_("database",$e);const _e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Te=_("info",_e);const Ee=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],q=_("play",Ee);function Ae(s){const e=S.c(14),{value:r,onChange:a,alt:n}=s,o=N.useRef(null);let i;e[0]!==a?(i=j=>{const w=j.target.files?.[0];if(w){const y=new FileReader;y.onloadend=()=>{const g=y.result;a(g)},y.readAsDataURL(w)}},e[0]=a,e[1]=i):i=e[1];const u=i;let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{o.current?.click()},e[2]=l):l=e[2];const m=l;let c;e[3]!==u?(c=t.jsx("input",{type:"file",ref:o,className:"hidden",accept:"image/*",onChange:u}),e[3]=u,e[4]=c):c=e[4];let f;e[5]!==n||e[6]!==r?(f=r?t.jsx("img",{src:r,alt:n||"Avatar",className:"w-full h-full object-cover"}):t.jsx("div",{className:"w-full h-full flex items-center justify-center text-2xl",children:"🤖"}),e[5]=n,e[6]=r,e[7]=f):f=e[7];let p;e[8]===Symbol.for("react.memo_cache_sentinel")?(p=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(pe,{className:"h-5 w-5 text-white"})}),e[8]=p):p=e[8];let h;e[9]!==f?(h=t.jsxs("div",{className:"h-full w-full rounded-xl border border-border bg-muted/20 overflow-hidden relative",children:[f,p]}),e[9]=f,e[10]=h):h=e[10];let b;return e[11]!==c||e[12]!==h?(b=t.jsxs("div",{className:"relative h-14 w-14 shrink-0 cursor-pointer group",onClick:m,children:[c,h]}),e[11]=c,e[12]=h,e[13]=b):b=e[13],b}function ze({itemId:s,onBack:e,onUpdate:r}){const[a,n]=N.useState(!1),[o,i]=N.useState("profile"),{connectionId:u}=O({from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"}),l=u??B,m=D(l),c=oe(l,"AGENT",s,m),{register:f,handleSubmit:p,reset:h,setValue:b,watch:j,formState:{isDirty:w}}=ee({defaultValues:{title:"",description:"",instructions:"",avatar:"",tool_set:{}}}),y=j("avatar"),g=j("tool_set")??{};N.useEffect(()=>{c&&h({title:c.title??"",description:c.description??"",instructions:c.instructions??"",avatar:c.avatar??"",tool_set:c.tool_set??{}})},[c,h]);const x=async $=>{n(!0);try{await r($)}finally{n(!1)}},R=$=>{b("tool_set",$,{shouldDirty:!0})};return c?t.jsxs(Z,{onBack:e,children:[t.jsxs(fe,{children:[t.jsx(I,{variant:o==="profile"?"secondary":"ghost",size:"sm",className:k("h-7 font-normal",o==="profile"?"bg-muted text-foreground":"text-muted-foreground"),onClick:()=>i("profile"),children:"Profile"}),t.jsx(I,{variant:o==="tools"?"secondary":"ghost",size:"sm",className:k("h-7 font-normal",o==="tools"?"bg-muted text-foreground":"text-muted-foreground"),onClick:()=>i("tools"),children:"Tools"}),t.jsx(I,{variant:o==="triggers"?"secondary":"ghost",size:"sm",className:k("h-7 font-normal",o==="triggers"?"bg-muted text-foreground":"text-muted-foreground"),onClick:()=>i("triggers"),disabled:!0,children:"Triggers"}),t.jsx(I,{variant:o==="advanced"?"secondary":"ghost",size:"sm",className:k("h-7 font-normal",o==="advanced"?"bg-muted text-foreground":"text-muted-foreground"),onClick:()=>i("advanced"),disabled:!0,children:"Advanced"})]}),t.jsxs(H,{children:[t.jsx(G,{connectionId:u,title:c.title,icon:c.avatar??"smart_toy"}),t.jsx(I,{className:"bg-[#d0ec1a] text-[#07401a] hover:bg-[#d0ec1a]/90 h-7 text-xs font-medium",onClick:p(x),disabled:!w||a,children:a?t.jsxs(t.Fragment,{children:[t.jsx(z,{name:"progress_activity",size:12,className:"mr-2 animate-spin"}),"Saving..."]}):"Save changes"})]}),o==="profile"&&t.jsx("div",{className:"p-5",children:t.jsxs("div",{className:"max-w-3xl mx-auto space-y-6",children:[t.jsxs("div",{className:"flex gap-4 items-start",children:[t.jsx(Ae,{value:y,onChange:$=>b("avatar",$,{shouldDirty:!0}),alt:j("title")}),t.jsxs("div",{className:"space-y-3 pt-1 flex-1",children:[t.jsx(U,{...f("title"),className:"text-2xl font-medium text-foreground border-transparent hover:border-input focus:border-input px-0 h-auto bg-transparent shadow-none",placeholder:"Agent Name"}),t.jsx(U,{...f("description"),className:"text-sm text-muted-foreground border-transparent hover:border-input focus:border-input px-0 h-auto bg-transparent shadow-none",placeholder:"Brief description"})]})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs(ie,{variant:"secondary",className:"px-2 py-0.5 h-6 gap-1.5 bg-secondary/50 text-muted-foreground font-normal text-xs hover:bg-secondary/50",children:[t.jsx(Te,{className:"h-3.5 w-3.5"}),"Type @ to add tools and more"]}),t.jsx("div",{className:"relative",children:t.jsx(W,{...f("instructions"),className:"min-h-[400px] resize-none text-sm leading-relaxed font-normal border-0 focus-visible:ring-0 px-0 py-0 shadow-none",placeholder:"Enter agent instructions..."})})]})]})}),o==="tools"&&t.jsx(ae,{toolSet:g,onToolSetChange:R}),o==="triggers"&&t.jsx("div",{className:"p-5",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Triggers tab coming soon"})}),o==="advanced"&&t.jsx("div",{className:"p-5",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Advanced tab coming soon"})})]}):t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{})})}const Oe=te("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/10 text-destructive border-destructive [&>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 Re(s){const e=S.c(10);let r,a,n;e[0]!==s?({className:r,variant:n,...a}=s,e[0]=s,e[1]=r,e[2]=a,e[3]=n):(r=e[1],a=e[2],n=e[3]);let o;e[4]!==r||e[5]!==n?(o=k(Oe({variant:n}),r),e[4]=r,e[5]=n,e[6]=o):o=e[6];let i;return e[7]!==a||e[8]!==o?(i=t.jsx("div",{"data-slot":"alert",role:"alert",className:o,...a}),e[7]=a,e[8]=o,e[9]=i):i=e[9],i}function Me(s){const e=S.c(8);let r,a;e[0]!==s?({className:r,...a}=s,e[0]=s,e[1]=r,e[2]=a):(r=e[1],a=e[2]);let n;e[3]!==r?(n=k("line-clamp-1 min-h-4 font-medium tracking-tight",r),e[3]=r,e[4]=n):n=e[4];let o;return e[5]!==a||e[6]!==n?(o=t.jsx("div",{"data-slot":"alert-title",className:n,...a}),e[5]=a,e[6]=n,e[7]=o):o=e[7],o}function Pe(s){const e=S.c(8);let r,a;e[0]!==s?({className:r,...a}=s,e[0]=s,e[1]=r,e[2]=a):(r=e[1],a=e[2]);let n;e[3]!==r?(n=k("text-muted-foreground leading-relaxed",r),e[3]=r,e[4]=n):n=e[4];let o;return e[5]!==a||e[6]!==n?(o=t.jsx("div",{"data-slot":"alert-description",className:n,...a}),e[5]=a,e[6]=n,e[7]=o):o=e[7],o}const Ve=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ue(s){const e=S.c(13),{toolName:r,connectionId:a,onBack:n}=s,o=`/mcp/${a}`;let i;e[0]!==o?(i=new URL(o,window.location.origin),e[0]=o,e[1]=i):i=e[1];const u=i;let l;e[2]!==a?(l={connectionId:a},e[2]=a,e[3]=l):l=e[3];const m=ce(l);if(!m.isAuthenticated){let p;return e[4]!==m.supportsOAuth||e[5]!==n?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:m.supportsOAuth?t.jsx(de,{onAuthenticate:()=>n(),buttonText:"Go back to authenticate"}):t.jsx(me,{hasReadme:!1})}),e[4]=m.supportsOAuth,e[5]=n,e[6]=p):p=e[6],p}const c=`${a}:${r}`;let f;return e[7]!==a||e[8]!==u||e[9]!==n||e[10]!==c||e[11]!==r?(f=t.jsx(De,{toolName:r,connectionId:a,mcpProxyUrl:u,onBack:n},c),e[7]=a,e[8]=u,e[9]=n,e[10]=c,e[11]=r,e[12]=f):f=e[12],f}function De({toolName:s,connectionId:e,mcpProxyUrl:r,onBack:a}){const[n,o]=N.useState({}),[i,u]=N.useState("{}"),[l,m]=N.useState(null),[c,f]=N.useState(null),[p,h]=N.useState(!1),[b,j]=N.useState(null),[w,y]=N.useState("json"),g=he({url:r.href});N.useEffect(()=>{g.error&&console.error("MCP Error:",g.error)},[g.error]);const x=g.tools?.find(d=>d.name===s),R=x?.inputSchema?.properties,$=R?Object.keys(R):[],A=$.length>0,M={};if(A&&x?.inputSchema?.properties)for(const d of $)M[d]=x.inputSchema.required?.includes(d)?"":void 0;const J=d=>Object.prototype.hasOwnProperty.call(n,d),Q=async()=>{h(!0),f(null),m(null),j(null);const d=performance.now(),C=D(e);try{const v=A?{...M,...n}:(()=>{const T=i.trim();if(!T)return{};const E=JSON.parse(T);if(E&&typeof E=="object")return E;throw new Error("Raw JSON input must be an object.")})();A&&x?.inputSchema?.properties&&Object.entries(x.inputSchema.properties).forEach(([T,E])=>{if((E.type==="object"||E.type==="array")&&typeof v[T]=="string")try{v[T]=JSON.parse(v[T])}catch{}});const P=await C(s,v),V=performance.now(),X=Math.round(V-d);m(P);const Y=JSON.stringify(P),F=new TextEncoder().encode(Y).length;j({duration:`${X}ms`,bytes:`${F} bytes`,tokens:`~${Math.ceil(F/4)} tokens`,cost:"$0.0000"})}catch(v){const P=v instanceof Error?v.message:String(v);f(P||"Unknown error occurred");const V=performance.now();j({duration:`${Math.round(V-d)}ms`})}finally{h(!1)}},L=(d,C)=>{o(v=>({...v,[d]:C}))};return t.jsxs(Z,{onBack:a,children:[t.jsx(H,{children:t.jsx(G,{connectionId:e,title:x?.name??Ve(s),icon:"build"})}),t.jsxs("div",{className:"flex flex-col items-center w-full max-w-[1500px] mx-auto p-10 gap-4",children:[t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h1",{className:"text-2xl font-medium text-foreground",children:s}),t.jsx("p",{className:"text-muted-foreground text-base",children:x?.description||"No description available"})]}),t.jsxs("div",{className:"flex items-center gap-4 py-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[g.state==="ready"?t.jsx("div",{className:"h-2 w-2 rounded-full bg-green-500 animate-pulse"}):g.state==="connecting"?t.jsx(z,{name:"progress_activity",size:12,className:"animate-spin text-yellow-500"}):t.jsx("div",{className:"h-2 w-2 rounded-full bg-red-500"}),t.jsx("span",{className:"font-mono text-sm capitalize text-muted-foreground",children:g.state.replace("_"," ")})]}),t.jsx("div",{className:"w-px h-4 bg-border"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"h-4 w-4 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-sm",children:b?.duration||"-"})]}),t.jsx("div",{className:"w-px h-4 bg-border"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ve,{className:"h-4 w-4 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-sm",children:b?.tokens||"-"})]}),t.jsx("div",{className:"w-px h-4 bg-border"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Ie,{className:"h-4 w-4 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-sm",children:b?.bytes||"-"})]})]}),c&&t.jsxs(Re,{variant:"destructive",className:"max-w-[800px] w-full bg-red-50 dark:bg-red-900/10 border-red-200 dark:border-red-900",children:[t.jsx(ge,{className:"h-4 w-4"}),t.jsx(Me,{children:"Execution Failed"}),t.jsx(Pe,{children:c})]}),t.jsxs("div",{className:"flex flex-col gap-4 w-full max-w-[800px] items-center",children:[t.jsxs("div",{className:"w-full bg-card border border-border rounded-xl shadow-sm overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"h-4 w-4 rounded-sm bg-primary/10 flex items-center justify-center",children:t.jsx(q,{className:"h-3 w-3 text-primary"})}),t.jsx("span",{className:"font-medium text-sm",children:"Input"})]}),t.jsxs(I,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Q,disabled:p,children:[p?t.jsx(z,{name:"progress_activity",size:14,className:"animate-spin"}):t.jsx(q,{className:"h-3.5 w-3.5 fill-current"}),"Execute tool"]})]}),t.jsxs("div",{className:"p-4 space-y-4",children:[t.jsx("div",{className:"text-xs font-mono text-muted-foreground uppercase tracking-wider",children:"Arguments"}),A&&x?.inputSchema?.properties?Object.entries(x.inputSchema.properties).map(([d,C])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-baseline gap-2",children:[t.jsx("label",{className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:d}),x.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"}),t.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:C.type})]}),C.description&&t.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:C.description}),C.type==="object"||C.type==="array"?t.jsx(W,{className:"flex min-h-[60px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 font-mono",value:J(d)?n[d]??"":M[d]??"",onChange:v=>L(d,v.target.value),placeholder:`Enter ${d} as JSON...`}):t.jsx(U,{value:J(d)?n[d]??"":M[d]??"",onChange:v=>L(d,v.target.value),placeholder:`Enter ${d}...`})]},d)):t.jsx("div",{className:"text-sm text-muted-foreground italic",children:"No arguments defined in schema."}),x?.inputSchema&&!A&&t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx("textarea",{className:"flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",value:i,onChange:d=>u(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]})]})]}),t.jsxs("div",{className:"w-full bg-card border border-border rounded-xl shadow-sm overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-border bg-muted/30",children:[t.jsx("span",{className:"text-xs font-mono text-muted-foreground uppercase tracking-wider",children:"Execution Result"}),t.jsxs("div",{className:"flex items-center bg-muted rounded-lg p-1 h-8",children:[t.jsx("button",{onClick:()=>y("json"),className:k("px-3 py-1 text-xs font-medium rounded-md transition-all",w==="json"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:"JSON"}),t.jsxs("button",{onClick:()=>y("view"),className:k("px-3 py-1 text-xs font-medium rounded-md transition-all flex items-center gap-1",w==="view"?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),disabled:!0,title:"Coming soon",children:["Create view",t.jsx(ue,{className:"h-3 w-3"})]})]})]}),t.jsxs("div",{className:"relative min-h-[200px] max-h-[500px] overflow-auto bg-zinc-950 text-zinc-50 p-4 font-mono text-xs",children:[l?t.jsx("pre",{className:"whitespace-pre-wrap break-all",children:JSON.stringify(l,null,2)}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-zinc-700",children:[t.jsx(Se,{className:"h-8 w-8 mb-2 opacity-50"}),t.jsx("p",{children:"Run the tool to see results"})]}),l&&t.jsx("div",{className:"absolute top-4 right-4 flex gap-2",children:t.jsx(I,{size:"icon",variant:"secondary",className:"h-8 w-8 bg-zinc-800 text-zinc-400 hover:text-white hover:bg-zinc-700 border-zinc-700",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(l,null,2)),se.success("Copied to clipboard")},children:t.jsx(ke,{className:"h-4 w-4"})})})]})]})]})]})]})}function Be(s){const e=S.c(7),{itemId:r,onBack:a}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[0]=n):n=e[0];const i=O(n).connectionId??B;if(!ne(i)){let c;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=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]=c):c=e[1],c}let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(z,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),e[2]=l):l=e[2];let m;return e[3]!==i||e[4]!==a||e[5]!==r?(m=t.jsx(N.Suspense,{fallback:l,children:t.jsx(Ue,{toolName:r,connectionId:i,onBack:a})}),e[3]=i,e[4]=a,e[5]=r,e[6]=m):m=e[6],m}const Je={agent:ze};function Le(){const s=S.c(6),e=K();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},s[0]=r):r=s[0];const a=O(r),n=decodeURIComponent(a.itemId);let o;s[1]!==e.history?(o=()=>{e.history.back()},s[1]=e.history,s[2]=o):o=s[2];const i=o,u=Fe;let l;return s[3]!==i||s[4]!==n?(l=t.jsx(Be,{itemId:n,onBack:i,onUpdate:u}),s[3]=i,s[4]=n,s[5]=l):l=s[5],l}async function Fe(s){return Promise.resolve()}function qe(){const s=S.c(17),e=K();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},s[0]=r):r=s[0];const a=O(r),n=a.connectionId,o=decodeURIComponent(a.collectionName),i=decodeURIComponent(a.itemId);let u;s[1]!==e.history?(u=()=>{e.history.back()},s[1]=e.history,s[2]=u):u=s[2];const l=u,m=n??B;let c;s[3]!==m?(c=D(m),s[3]=m,s[4]=c):c=s[4];const p=re(m,o,c);let h;s[5]!==p||s[6]!==i?(h=async x=>{i&&await p.update.mutateAsync({id:i,data:x})},s[5]=p,s[6]=i,s[7]=h):h=s[7];const b=h;let j;s[8]!==o?(j=o?.toLowerCase(),s[8]=o,s[9]=j):j=s[9];const w=j,y=w&&Je[w];if(y){let x;return s[10]!==y||s[11]!==l||s[12]!==b||s[13]!==i?(x=t.jsx(y,{itemId:i,onBack:l,onUpdate:b}),s[10]=y,s[11]=l,s[12]=b,s[13]=i,s[14]=x):x=s[14],x}let g;return s[15]!==l?(g=t.jsx(xe,{icon:"extension",title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:l,children:"Go back"}}),s[15]=l,s[16]=g):g=s[16],g}function Ke(){const s=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 r=O(e);if(decodeURIComponent(r.collectionName)==="tools"){let i;return s[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Le,{}),s[1]=i):i=s[1],i}let o;return s[2]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(qe,{}),s[2]=o):o=s[2],o}function _t(){const s=S.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(be,{children:t.jsx(N.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(z,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Ke,{})})}),s[0]=e):e=s[0],e}export{_t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as X,r as O,j as s}from"./index-
|
|
1
|
+
import{c as X,r as O,j as s}from"./index-tTqkKQJp.js";import{B as se}from"./button-7f3mJDt9.js";import{c as oe,D as ne,b as ie,a as le}from"./dropdown-menu-Dsh1FAHq.js";import{I as E}from"./icon-Dk3IUZlY.js";import{d as ae,b as re,a as ce,T as ue}from"./tooltip-DG1xYIL4.js";import{c as u}from"./utils-D4LuHWBB.js";const de={sm:{button:"size-7",icon:"size-4"},md:{button:"size-9",icon:"size-5"},lg:{button:"size-12",icon:"size-6"}};function fe(K){const e=X.c(66),{value:o,onValueChange:l,options:t,size:f,fullWidth:m,className:d}=K,h=f===void 0?"sm":f,a=m===void 0?!1:m,x=O.useRef(null),p=O.useRef(null);let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={left:0,width:0,opacity:0},e[0]=i):i=e[0];const[n,b]=O.useState(i);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=P=>{if(!P.current)return;const{offsetLeft:ee,offsetWidth:te}=P.current;b({left:ee,width:te,opacity:1})},e[1]=r):r=e[1];const g=r;let W;e[2]!==t[0].value||e[3]!==o?(W=()=>{const P=o===t[0].value?x:p;g(P)},e[2]=t[0].value,e[3]=o,e[4]=W):W=e[4];let $;e[5]!==t||e[6]!==o?($=[o,t],e[5]=t,e[6]=o,e[7]=$):$=e[7],O.useEffect(W,$);const c=de[h];let v;e[8]!==d?(v=u("relative flex gap-0 bg-muted rounded-lg",d),e[8]=d,e[9]=v):v=e[9];let j;e[10]!==l||e[11]!==t[0].value?(j=()=>l(t[0].value),e[10]=l,e[11]=t[0].value,e[12]=j):j=e[12];const L=a?"flex-1 h-12 px-4":c.button,q=!a&&t[0].label?"px-3":"";let w;e[13]!==q||e[14]!==L?(w=u("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",L,q),e[13]=q,e[14]=L,e[15]=w):w=e[15];const Y=t[0].icon,A=o===t[0].value?"text-foreground":"text-muted-foreground";let y;e[16]!==c.icon||e[17]!==A?(y=u("transition-colors ease-out duration-200",c.icon,A),e[16]=c.icon,e[17]=A,e[18]=y):y=e[18];let N;e[19]!==t[0].icon||e[20]!==y?(N=s.jsx(E,{name:Y,className:y}),e[19]=t[0].icon,e[20]=y,e[21]=N):N=e[21];let z;e[22]!==t[0].label||e[23]!==t[0].value||e[24]!==o?(z=t[0].label&&s.jsx("span",{className:u("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[0].value?"text-foreground":"text-muted-foreground"),children:t[0].label}),e[22]=t[0].label,e[23]=t[0].value,e[24]=o,e[25]=z):z=e[25];let C;e[26]!==w||e[27]!==N||e[28]!==z||e[29]!==j?(C=s.jsxs("button",{ref:x,type:"button",onClick:j,className:w,children:[N,z]}),e[26]=w,e[27]=N,e[28]=z,e[29]=j,e[30]=C):C=e[30];let _;e[31]!==l||e[32]!==t[1].value?(_=()=>l(t[1].value),e[31]=l,e[32]=t[1].value,e[33]=_):_=e[33];const F=a?"flex-1 h-12 px-4":c.button,G=!a&&t[1].label?"px-3":"";let k;e[34]!==F||e[35]!==G?(k=u("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",F,G),e[34]=F,e[35]=G,e[36]=k):k=e[36];const Z=t[1].icon,H=o===t[1].value?"text-foreground":"text-muted-foreground";let S;e[37]!==c.icon||e[38]!==H?(S=u("transition-colors ease-out duration-200",c.icon,H),e[37]=c.icon,e[38]=H,e[39]=S):S=e[39];let T;e[40]!==t[1].icon||e[41]!==S?(T=s.jsx(E,{name:Z,className:S}),e[40]=t[1].icon,e[41]=S,e[42]=T):T=e[42];let D;e[43]!==t[1].label||e[44]!==t[1].value||e[45]!==o?(D=t[1].label&&s.jsx("span",{className:u("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[1].value?"text-foreground":"text-muted-foreground"),children:t[1].label}),e[43]=t[1].label,e[44]=t[1].value,e[45]=o,e[46]=D):D=e[46];let M;e[47]!==_||e[48]!==k||e[49]!==T||e[50]!==D?(M=s.jsxs("button",{ref:p,type:"button",onClick:_,className:k,children:[T,D]}),e[47]=_,e[48]=k,e[49]=T,e[50]=D,e[51]=M):M=e[51];const J=a?"h-12":c.button;let R;e[52]!==J?(R=u("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",J),e[52]=J,e[53]=R):R=e[53];const Q=`${n.left}px`,U=`${n.width}px`;let I;e[54]!==n.opacity||e[55]!==Q||e[56]!==U?(I={left:Q,width:U,opacity:n.opacity},e[54]=n.opacity,e[55]=Q,e[56]=U,e[57]=I):I=e[57];let V;e[58]!==R||e[59]!==I?(V=s.jsx("div",{className:R,style:I}),e[58]=R,e[59]=I,e[60]=V):V=e[60];let B;return e[61]!==C||e[62]!==M||e[63]!==V||e[64]!==v?(B=s.jsxs("div",{className:v,children:[C,M,V]}),e[61]=C,e[62]=M,e[63]=V,e[64]=v,e[65]=B):B=e[65],B}function ve(K){const e=X.c(15),{viewMode:o,onViewModeChange:l,sortKey:t,sortDirection:f,onSort:m,sortOptions:d}=K;let h;e[0]!==d?(h=d===void 0?[]:d,e[0]=d,e[1]=h):h=e[1];const a=h;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(ae,{children:s.jsxs(re,{children:[s.jsx(ce,{asChild:!0,children:s.jsx(ne,{asChild:!0,children:s.jsx(se,{variant:"outline",size:"icon",className:"size-7 border border-input",children:s.jsx(E,{name:"tune",size:16})})})}),s.jsx(ue,{children:"Search filters"})]})}),e[2]=x):x=e[2];let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p=[{value:"table",icon:"table_rows"},{value:"cards",icon:"grid_view"}],e[3]=p):p=e[3];let i;e[4]!==l||e[5]!==o?(i=s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(fe,{value:o,onValueChange:l,fullWidth:!0,options:p})}),e[4]=l,e[5]=o,e[6]=i):i=e[6];let n;e[7]!==m||e[8]!==f||e[9]!==t||e[10]!==a?(n=a.length>0&&m&&s.jsxs("div",{className:"p-2",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),a.map(r=>{const g=t===r.id;return s.jsx(oe,{onClick:()=>m(r.id),className:u("h-8 px-2 py-0 cursor-pointer",g&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[g&&s.jsx(E,{name:"check",size:16,className:"text-foreground shrink-0"}),!g&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:r.label}),g&&f&&s.jsx(E,{name:f==="asc"?"arrow_upward":"arrow_downward",size:16,className:"text-foreground shrink-0"})]})},r.id)})]}),e[7]=m,e[8]=f,e[9]=t,e[10]=a,e[11]=n):n=e[11];let b;return e[12]!==i||e[13]!==n?(b=s.jsxs(ie,{children:[x,s.jsxs(le,{align:"end",className:"w-[200px] p-0 gap-0",children:[i,n]})]}),e[12]=i,e[13]=n,e[14]=b):b=e[14],b}export{ve as C,fe as V};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as j,j as i}from"./index-
|
|
1
|
+
import{c as j,j as i}from"./index-tTqkKQJp.js";import{C as b}from"./collection-display-button-yCMREeFw.js";function g(h){const e=j.c(17),{title:d,viewMode:r,onViewModeChange:l,sortKey:m,sortDirection:f,onSort:x,sortOptions:n,ctaButton:p}=h;let c;e[0]!==n?(c=n===void 0?[]:n,e[0]=n,e[1]=c):c=e[1];const u=c;let t;e[2]!==d?(t=i.jsx("h1",{className:"text-sm font-medium text-foreground",children:d}),e[2]=d,e[3]=t):t=e[3];let s;e[4]!==x||e[5]!==l||e[6]!==f||e[7]!==m||e[8]!==u||e[9]!==r?(s=r&&l&&i.jsx(b,{viewMode:r,onViewModeChange:l,sortKey:m,sortDirection:f,onSort:x,sortOptions:u}),e[4]=x,e[5]=l,e[6]=f,e[7]=m,e[8]=u,e[9]=r,e[10]=s):s=e[10];let o;e[11]!==p||e[12]!==s?(o=i.jsxs("div",{className:"flex items-center gap-2",children:[s,p]}),e[11]=p,e[12]=s,e[13]=o):o=e[13];let a;return e[14]!==t||e[15]!==o?(a=i.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:i.jsxs("div",{className:"flex items-center justify-between gap-3 h-12 px-4",children:[t,o]})}),e[14]=t,e[15]=o,e[16]=a):a=e[16],a}export{g as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as s,j as c}from"./index-
|
|
1
|
+
import{c as s,j as c}from"./index-tTqkKQJp.js";function r(t){const e=s.c(2),{children:l}=t;let o;return e[0]!==l?(o=c.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden",children:l}),e[0]=l,e[1]=o):o=e[1],o}export{r as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as x,j as a}from"./index-
|
|
1
|
+
import{c as x,j as a}from"./index-tTqkKQJp.js";import{I as u}from"./icon-Dk3IUZlY.js";import{I as b}from"./input-DsJLZuBe.js";import{c as g}from"./utils-D4LuHWBB.js";function I(h){const e=x.c(13),{value:n,onChange:c,placeholder:d,onKeyDown:i,className:m}=h,f=d===void 0?"Search...":d;let r;e[0]!==m?(r=g("shrink-0 w-full border-b border-border h-12",m),e[0]=m,e[1]=r):r=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(u,{name:"search",size:16,className:"text-muted-foreground shrink-0"}),e[2]=o):o=e[2];let s;e[3]!==c?(s=p=>c(p.target.value),e[3]=c,e[4]=s):s=e[4];let t;e[5]!==i||e[6]!==f||e[7]!==s||e[8]!==n?(t=a.jsxs("div",{className:"flex items-center gap-2.5 h-12 px-4",children:[o,a.jsx(b,{value:n,onChange:s,onKeyDown:i,placeholder:f,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]}),e[5]=i,e[6]=f,e[7]=s,e[8]=n,e[9]=t):t=e[9];let l;return e[10]!==r||e[11]!==t?(l=a.jsx("div",{className:r,children:t}),e[10]=r,e[11]=t,e[12]=l):l=e[12],l}export{I as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as N,j as o}from"./index-
|
|
1
|
+
import{c as N,j as o}from"./index-tTqkKQJp.js";import{c as u}from"./utils-D4LuHWBB.js";import{I as T}from"./icon-Dk3IUZlY.js";function $(a){const e=N.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("w-full caption-bottom text-sm min-w-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("div",{"data-slot":"table-container",className:"relative w-full min-w-0",children:o.jsx("table",{"data-slot":"table",className:l,...s})}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function R(a){const e=N.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("[&_tr]:border-b",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("thead",{"data-slot":"table-header",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function H(a){const e=N.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("[&_tr:last-child]:border-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("tbody",{"data-slot":"table-body",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function S(a){const e=N.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("data-[state=selected]:bg-muted border-b transition-colors",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("tr",{"data-slot":"table-row",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function I(a){const e=N.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("th",{"data-slot":"table-head",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function L(a){const e=N.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("td",{"data-slot":"table-cell",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function z(a){const e=N.c(29),{columns:t,data:s,sortKey:l,sortDirection:r,onSort:m,onRowClick:c,rowClassName:p}=a;let h;e[0]!==r?(h=function(n,w){return o.jsx("div",{className:"w-4 flex items-center justify-center",children:w&&r&&o.jsx(T,{name:r==="asc"?"arrow_upward":"arrow_downward",size:16,className:"text-muted-foreground transition-colors"})})},e[0]=r,e[1]=h):h=e[1];const g=h;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=function(n,w){let C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider";return n===w-1&&(C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider w-8"),C},e[2]=x):x=e[2];const i=x;let d;if(e[3]!==t||e[4]!==m||e[5]!==g||e[6]!==l){let f;e[8]!==t.length||e[9]!==m||e[10]!==g||e[11]!==l?(f=(n,w)=>{const C=l===n.id;return o.jsx(I,{className:u(i(w,t.length),"group transition-colors select-none",n.sortable&&"hover:bg-accent cursor-pointer",n.rowClassName,n.cellClassName),onClick:n.sortable&&m?()=>m(n.id):void 0,children:o.jsxs("span",{className:"flex items-center gap-1",children:[n.header,n.sortable&&g(n.id,C)]})},n.id)},e[8]=t.length,e[9]=m,e[10]=g,e[11]=l,e[12]=f):f=e[12],d=t.map(f),e[3]=t,e[4]=m,e[5]=g,e[6]=l,e[7]=d}else d=e[7];let j;e[13]!==d?(j=o.jsx(R,{className:"sticky top-0 z-10 border-b-0 bg-muted/30",children:o.jsx(S,{className:"h-9 hover:bg-transparent border-b border-border",children:d})}),e[13]=d,e[14]=j):j=e[14];let v;if(e[15]!==t||e[16]!==s||e[17]!==c||e[18]!==p){let f;e[20]!==t||e[21]!==c||e[22]!==p?(f=(n,w)=>{const C=p?.(n);return o.jsx(S,{"data-row-index":w,className:u("group/data-row transition-colors border-b-0 hover:bg-accent/50",c?"cursor-pointer":"",C),onClick:c?()=>c(n):void 0,children:t.map(b=>o.jsx(L,{className:u("px-5 py-4 h-16 align-middle text-sm text-foreground",b.cellClassName,b.wrap?"whitespace-normal wrap-break-word":""),children:o.jsx("div",{className:u(b.wrap?"w-full":"min-w-0 w-full",!b.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:b.render?b.render(n):b.accessor?b.accessor(n):null})},b.id))},w)},e[20]=t,e[21]=c,e[22]=p,e[23]=f):f=e[23],v=s.map(f),e[15]=t,e[16]=s,e[17]=c,e[18]=p,e[19]=v}else v=e[19];let y;e[24]!==v?(y=o.jsx(H,{children:v}),e[24]=v,e[25]=y):y=e[25];let k;return e[26]!==j||e[27]!==y?(k=o.jsx("div",{className:"w-full bg-background min-w-0",children:o.jsxs($,{className:"w-full border-collapse",children:[j,y]})}),e[26]=j,e[27]=y,e[28]=k):k=e[28],k}function A(a){const e=N.c(12),{columns:t,data:s,isLoading:l,sortKey:r,sortDirection:m,onSort:c,onRowClick:p,emptyState:h}=a;if(l===void 0?!1:l){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=i):i=e[0],i}if(s.length===0){let i;e[1]!==h?(i=h||o.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=h,e[2]=i):i=e[2];let d;return e[3]!==i?(d=o.jsx("div",{className:"flex items-center justify-center h-full",children:i}),e[3]=i,e[4]=d):d=e[4],d}let x;return e[5]!==t||e[6]!==s||e[7]!==p||e[8]!==c||e[9]!==m||e[10]!==r?(x=o.jsx("div",{className:"flex-1 overflow-auto",children:o.jsx(z,{columns:t,data:s,sortKey:r,sortDirection:m,onSort:c,onRowClick:p})}),e[5]=t,e[6]=s,e[7]=p,e[8]=c,e[9]=m,e[10]=r,e[11]=x):x=e[11],x}export{A as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as S,j as s}from"./index-
|
|
1
|
+
import{c as S,j as s}from"./index-tTqkKQJp.js";import{C as _}from"./card-C-FxKc9h.js";import{c as j}from"./utils-D4LuHWBB.js";import{I as A}from"./use-connection-CJdd9H8R.js";function H(h){const e=S.c(40),{connection:t,onClick:g,headerActions:v,footer:C,className:k,size:R,fallbackIcon:z}=h,b=R===void 0?"md":R,y=b==="sm"?"p-4":"p-6",I=b==="sm"?"text-sm":"text-base",w=b==="sm"?"text-xs":"text-sm",E=g&&"hover:bg-muted/50";let i;e[0]!==k||e[1]!==E?(i=j("cursor-pointer transition-colors group",E,k),e[0]=k,e[1]=E,e[2]=i):i=e[2];let l;e[3]!==y?(l=j("flex flex-col gap-4 relative",y),e[3]=y,e[4]=l):l=e[4];let o;e[5]!==t.icon||e[6]!==t.title||e[7]!==z?(o=s.jsx(A,{icon:t.icon,name:t.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:z}),e[5]=t.icon,e[6]=t.title,e[7]=z,e[8]=o):o=e[8];let n;e[9]!==v?(n=v&&s.jsx("div",{className:j("transition-opacity","opacity-0 group-hover:opacity-100"),onClick:q,children:v}),e[9]=v,e[10]=n):n=e[10];let c;e[11]!==n?(c=s.jsx("div",{className:"relative",children:n}),e[11]=n,e[12]=c):c=e[12];let r;e[13]!==o||e[14]!==c?(r=s.jsxs("div",{className:"flex items-start justify-between",children:[o,c]}),e[13]=o,e[14]=c,e[15]=r):r=e[15];let a;e[16]!==I?(a=j("font-medium text-foreground truncate",I),e[16]=I,e[17]=a):a=e[17];let m;e[18]!==t.title||e[19]!==a?(m=s.jsx("h3",{className:a,children:t.title}),e[18]=t.title,e[19]=a,e[20]=m):m=e[20];let d;e[21]!==w?(d=j("text-muted-foreground line-clamp-2",w),e[21]=w,e[22]=d):d=e[22];const P=t.description||"No description";let f;e[23]!==d||e[24]!==P?(f=s.jsx("p",{className:d,children:P}),e[23]=d,e[24]=P,e[25]=f):f=e[25];let p;e[26]!==m||e[27]!==f?(p=s.jsxs("div",{className:"flex flex-col gap-0",children:[m,f]}),e[26]=m,e[27]=f,e[28]=p):p=e[28];let x;e[29]!==C?(x=C&&s.jsx("div",{onClick:$,children:C}),e[29]=C,e[30]=x):x=e[30];let u;e[31]!==p||e[32]!==x||e[33]!==l||e[34]!==r?(u=s.jsxs("div",{className:l,children:[r,p,x]}),e[31]=p,e[32]=x,e[33]=l,e[34]=r,e[35]=u):u=e[35];let N;return e[36]!==g||e[37]!==u||e[38]!==i?(N=s.jsx(_,{className:i,onClick:g,children:u}),e[36]=g,e[37]=u,e[38]=i,e[39]=N):N=e[39],N}function $(h){return h.stopPropagation()}function q(h){return h.stopPropagation()}export{H as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as V,j as s,a5 as ke,a as Ye,r as ze,a6 as Ze,d as et,b as tt,bd as st}from"./index-tTqkKQJp.js";import{E as Ee}from"./empty-state-CLlWeA8F.js";import{E as Fe}from"./error-boundary-BpbgV8Mt.js";import{I as ot,a as Ke,e as nt,u as it,c as lt,d as at}from"./use-connection-CJdd9H8R.js";import{b as rt}from"./use-binding-C_9S-BsF.js";import{E as Ve,P as ct,a as dt,u as mt,S as ut}from"./index-CRXnV96L.js";import{B as ge}from"./button-7f3mJDt9.js";import{I as U}from"./icon-Dk3IUZlY.js";import{a as ft,T as pt,R as ht}from"./resource-tabs-Dr8QbV0u.js";import{V as gt,a as xt,b as jt}from"./layout-7tvwsBuE.js";import{g as Re}from"./generate-id-Dyweu44Y.js";import{C as Le}from"./collection-display-button-yCMREeFw.js";import{C as bt}from"./collection-search-Blu2oI67.js";import{C as Ct}from"./card-C-FxKc9h.js";import{b as We,D as qe,a as He,c as R}from"./dropdown-menu-Dsh1FAHq.js";import{C as vt}from"./collection-table-wrapper-D77XIcPK.js";import{u as yt}from"./use-list-state-D4EpKod3.js";import{B as wt}from"./extract-connection-data-Bubi-83r.js";import{A as St,g as _t,c as Nt,b as Tt,d as It,e as At,a as Dt,f as $t}from"./alert-dialog-B5P__fSo.js";import"./utils-D4LuHWBB.js";import"./tooltip-DG1xYIL4.js";import"./auth-Cf-BfTK3.js";import"./mcp-oauth-BOA4hd1a.js";import"./use-organization-settings-14jcjh3V.js";import"./use-tool-call-CXd8t6dd.js";import"./form-CEChYO-W.js";import"./input-DsJLZuBe.js";import"./select-GwKsoZTV.js";import"./use-gateway-DeuD2XcZ.js";import"./formatDistanceToNow-Ctx6mZEP.js";import"./registry-utils-ulDDT0d8.js";import"./index-Pk85Lo4X.js";import"./index-B3Svv0HD.js";import"./schema-ggfLBohE.js";import"./useQuery-DcphYrFi.js";import"./badge-BWSVXk6u.js";import"./use-mobile-CR4-zNel.js";function Pt(t,e){const o=t.properties||{};for(const i in o){const a=o[i];if(a&&a.type==="string"&&(a.format==="url"||a.format==="uri")&&e&&typeof e=="object"&&i in e&&e[i])return e[i]}const l=["image","img","avatar","icon","logo","thumbnail","cover"];for(const i of l)if(e&&typeof e=="object"&&i in e&&typeof e[i]=="string")return e[i]}function Ot(t){const e=V.c(25),{item:o,schema:l,actions:i}=t;let a;e[0]!==o||e[1]!==l?(a=Pt(l,o),e[0]=o,e[1]=l,e[2]=a):a=e[2];const m=a,n=o&&typeof o=="object"&&"description"in o&&typeof o.description=="string"?o.description:void 0;let u;e[3]!==i?(u=i&&Object.keys(i).length>0,e[3]=i,e[4]=u):u=e[4];const h=u;let c;e[5]!==m||e[6]!==o.title?(c=s.jsx(ot,{icon:m,name:o.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=m,e[6]=o.title,e[7]=c):c=e[7];let d;e[8]!==o.title?(d=s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:o.title}),e[8]=o.title,e[9]=d):d=e[9];const g=n||"No description";let y;e[10]!==g?(y=s.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:g}),e[10]=g,e[11]=y):y=e[11];let f;e[12]!==d||e[13]!==y?(f=s.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[d,y]}),e[12]=d,e[13]=y,e[14]=f):f=e[14];let j;e[15]!==c||e[16]!==f?(j=s.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[c,f]}),e[15]=c,e[16]=f,e[17]=j):j=e[17];let r;e[18]!==i||e[19]!==h||e[20]!==o?(r=h&&s.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:Mt,onMouseDown:Et,children:s.jsxs(We,{children:[s.jsx(qe,{asChild:!0,children:s.jsx(ge,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:zt,children:s.jsx(U,{name:"more_vert",size:20})})}),s.jsxs(He,{align:"end",onClick:kt,children:[i.open&&s.jsxs(R,{onClick:C=>{C.stopPropagation(),i.open?.(o)},children:[s.jsx(U,{name:"visibility",size:16}),"Open"]}),i.edit&&s.jsxs(R,{onClick:C=>{C.stopPropagation(),i.edit?.(o)},children:[s.jsx(U,{name:"edit",size:16}),"Edit"]}),i.duplicate&&s.jsxs(R,{onClick:C=>{C.stopPropagation(),i.duplicate?.(o)},children:[s.jsx(U,{name:"content_copy",size:16}),"Duplicate"]}),i.delete&&s.jsxs(R,{variant:"destructive",onClick:C=>{C.stopPropagation(),i.delete?.(o)},children:[s.jsx(U,{name:"delete",size:16}),"Delete"]})]})]})}),e[18]=i,e[19]=h,e[20]=o,e[21]=r):r=e[21];let I;return e[22]!==j||e[23]!==r?(I=s.jsxs(Ct,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[j,r]}),e[22]=j,e[23]=r,e[24]=I):I=e[24],I}function kt(t){return t.stopPropagation()}function zt(t){return t.stopPropagation()}function Et(t){return t.stopPropagation()}function Mt(t){return t.stopPropagation()}function Je(t,e){return Object.keys(t.properties||{}).filter(o=>["id","created_at","updated_at","created_by","updated_by"].includes(o)?!1:e?e.includes(o):!0).map(o=>({id:o,label:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," ")}))}function Ut(t){const e=V.c(32),{data:o,schema:l,viewMode:i,onViewModeChange:a,search:m,sortKey:n,sortDirection:u,onSort:h,actions:c,onItemClick:d,headerActions:g,emptyState:y,readOnly:f,columns:j,hideToolbar:r,sortableFields:I}=t,C=a===void 0?Kt:a,b=u===void 0?"asc":u,P=h===void 0?Ft:h;let w;e[0]!==c?(w=c===void 0?{}:c,e[0]=c,e[1]=w):w=e[1];const p=w,A=d===void 0?Bt:d,D=g===void 0?null:g,v=y===void 0?null:y,O=f===void 0?!1:f,N=j===void 0?void 0:j,k=r===void 0?!1:r,S=I===void 0?void 0:I;let E;e[2]!==N||e[3]!==l||e[4]!==S?(E=N?N.filter(Rt).filter(M=>!S||S.includes(M.id)).map(Vt):Je(l,S),e[2]=N,e[3]=l,e[4]=S,e[5]=E):E=e[5];const T=E;let _;e[6]!==D||e[7]!==k||e[8]!==P||e[9]!==C||e[10]!==b||e[11]!==n||e[12]!==T||e[13]!==i?(_=!k&&s.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:s.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[s.jsx("div",{className:"flex items-center gap-2 flex-1",children:D}),s.jsx("div",{className:"flex items-center gap-2 shrink-0",children:s.jsx(Le,{viewMode:i,onViewModeChange:C,sortKey:n,sortDirection:b,onSort:P,sortOptions:T})})]})}),e[6]=D,e[7]=k,e[8]=P,e[9]=C,e[10]=b,e[11]=n,e[12]=T,e[13]=i,e[14]=_):_=e[14];let z;e[15]!==p||e[16]!==N||e[17]!==o||e[18]!==v||e[19]!==A||e[20]!==P||e[21]!==O||e[22]!==l||e[23]!==m||e[24]!==b||e[25]!==n||e[26]!==S||e[27]!==i?(z=i==="cards"?s.jsx("div",{className:"flex-1 overflow-auto p-5",children:o.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:v||s.jsx(Ve,{icon:"inbox",title:"No items found",description:m?"Try adjusting your search":"No items to display"})}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:o.map(M=>s.jsx("div",{onClick:()=>A?.(M),className:"cursor-pointer h-full",children:s.jsx(Ot,{item:M,schema:l,readOnly:O,actions:p})},M.id))})}):s.jsx(vt,{columns:Ht(N,l,S,p),data:o,sortKey:n,sortDirection:b,onSort:P,onRowClick:A,emptyState:v||s.jsx(Ve,{icon:"inbox",title:"No items found",description:m?"Try adjusting your search":"No items to display"})}),e[15]=p,e[16]=N,e[17]=o,e[18]=v,e[19]=A,e[20]=P,e[21]=O,e[22]=l,e[23]=m,e[24]=b,e[25]=n,e[26]=S,e[27]=i,e[28]=z):z=e[28];let x;return e[29]!==_||e[30]!==z?(x=s.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[_,z]}),e[29]=_,e[30]=z,e[31]=x):x=e[31],x}function Vt(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Rt(t){return t.sortable!==!1}function Bt(){}function Ft(){}function Kt(){}function Lt(t){return{id:"actions",header:"",render:e=>s.jsxs(We,{children:[s.jsx(qe,{asChild:!0,children:s.jsx(ge,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:s.jsx(U,{name:"more_vert",size:20})})}),s.jsxs(He,{align:"end",onClick:o=>o.stopPropagation(),children:[t.open&&s.jsxs(R,{onClick:o=>{o.stopPropagation(),t.open?.(e)},children:[s.jsx(U,{name:"visibility",size:16}),"Open"]}),t.edit&&s.jsxs(R,{onClick:o=>{o.stopPropagation(),t.edit?.(e)},children:[s.jsx(U,{name:"edit",size:16}),"Edit"]}),t.duplicate&&s.jsxs(R,{onClick:o=>{o.stopPropagation(),t.duplicate?.(e)},children:[s.jsx(U,{name:"content_copy",size:16}),"Duplicate"]}),t.delete&&s.jsxs(R,{variant:"destructive",onClick:o=>{o.stopPropagation(),t.delete?.(e)},children:[s.jsx(U,{name:"delete",size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function Wt(t){const e=t.type;return e==="string"||e==="number"||e==="integer"||e==="boolean"}function Be(t){return t.type==="string"&&(t.format==="url"||t.format==="uri")}function qt(t,e){const o=t.properties||{},l=Object.keys(o).filter(n=>{const u=o[n];return u&&Wt(u)}),i=l.find(n=>{const u=o[n];return u&&Be(u)}),a=new Set;i&&a.add(i);const m=["title","description","updated_at","updated_by"];for(const n of m)l.includes(n)&&i!==n&&!a.has(n)&&a.add(n);for(const n of l)a.has(n)||a.add(n);return[...a.values()].map(n=>{const u=o[n];if(!u)return{id:n,header:n.charAt(0).toUpperCase()+n.slice(1).replace(/_/g," "),render:c=>{const d=c[n];return d==null?"—":s.jsx("span",{className:"block truncate max-w-full",children:String(d)})},sortable:e?e.includes(n):!["id"].includes(n),cellClassName:"max-w-[200px]"};const h=e?e.includes(n):!["id"].includes(n);return u.format==="date-time"||n.endsWith("_at")?{id:n,header:n.charAt(0).toUpperCase()+n.slice(1).replace(/_/g," "),render:c=>{const d=c[n];return d?s.jsx("span",{className:"block truncate max-w-full",children:new Date(d).toLocaleDateString()}):"—"},sortable:h,cellClassName:"max-w-[200px]"}:i===n&&Be(u)?{id:n,header:n.charAt(0).toUpperCase()+n.slice(1).replace(/_/g," "),render:c=>{const d=c[n];return d?s.jsx("img",{src:String(d),alt:n,className:"h-8 w-8 rounded object-cover"}):"—"},sortable:h,cellClassName:"max-w-[200px]"}:{id:n,header:n.charAt(0).toUpperCase()+n.slice(1).replace(/_/g," "),render:c=>{const d=c[n];return d==null?"—":s.jsx("span",{className:"block truncate max-w-full",children:String(d)})},sortable:h,cellClassName:"max-w-[100px]"}})}function Ht(t,e,o,l){const i=t||qt(e,o);return i.some(n=>n.id==="actions")?i:Object.keys(l).length>0?[...i,Lt(l)]:i}function Jt(t){const e=V.c(117),{connectionId:o,org:l,activeCollection:i}=t,a=i.name,m=i.schema??wt,n=i.hasCreateTool,u=i.hasUpdateTool,h=i.hasDeleteTool,c=ke(),{data:d}=Ye.useSession(),g=d?.user?.id||"unknown",y=Ke(o);let f;e[0]!==o?(f=lt(o),e[0]=o,e[1]=f):f=e[1];const j=f,r=nt(o,a,j),I=`${o}-${a}`;let C;e[2]!==l||e[3]!==I?(C={namespace:l,resource:I,defaultSortKey:"updated_at"},e[2]=l,e[3]=I,e[4]=C):C=e[4];const{search:b,searchTerm:P,setSearch:w,viewMode:p,setViewMode:A,sortKey:D,sortDirection:v,handleSort:O}=yt(C);let N;e[5]!==P||e[6]!==v||e[7]!==D?(N={searchTerm:P,sortKey:D,sortDirection:v},e[5]=P,e[6]=v,e[7]=D,e[8]=N):N=e[8];const k=it(o,a,j,N),S=!n&&!u&&!h;let E;e[9]!==a||e[10]!==o||e[11]!==c||e[12]!==l?(E=$=>{c({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:l,connectionId:o,collectionName:a,itemId:$.id}})},e[9]=a,e[10]=o,e[11]=c,e[12]=l,e[13]=E):E=e[13];const T=E;let _;e[14]!==r.create||e[15]!==g?(_=async $=>{const he=new Date().toISOString();await r.create.mutateAsync({...$,id:Re("conn"),title:`${$.title} (Copy)`,created_at:he,updated_at:he,created_by:g,updated_by:g})},e[14]=r.create,e[15]=g,e[16]=_):_=e[16];const z=_,[x,M]=ze.useState(null);let le;e[17]===Symbol.for("react.memo_cache_sentinel")?(le=$=>{M($)},e[17]=le):le=e[17];const Ge=le;let B;e[18]!==T||e[19]!==u?(B=u&&{edit:T},e[18]=T,e[19]=u,e[20]=B):B=e[20];let F;e[21]!==z||e[22]!==n?(F=n&&{duplicate:z},e[21]=z,e[22]=n,e[23]=F):F=e[23];let K;e[24]!==h?(K=h&&{delete:Ge},e[24]=h,e[25]=K):K=e[25];let ae;e[26]!==K||e[27]!==B||e[28]!==F?(ae={...B,...F,...K},e[26]=K,e[27]=B,e[28]=F,e[29]=ae):ae=e[29];const xe=ae;let re;e[30]!==r.delete||e[31]!==x?(re=async()=>{x&&(await r.delete.mutateAsync(x.id),M(null))},e[30]=r.delete,e[31]=x,e[32]=re):re=e[32];const je=re;let ce;e[33]!==r.create||e[34]!==a||e[35]!==o||e[36]!==n||e[37]!==c||e[38]!==l||e[39]!==g?(ce=async()=>{if(!n){Ze.error("Create operation is not available for this collection");return}const $=new Date().toISOString(),he={id:Re("conn"),title:"New Item",created_at:$,updated_at:$,created_by:g,updated_by:g};try{const Oe=await r.create.mutateAsync(he);c({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:l,connectionId:o,collectionName:a,itemId:Oe.id}})}catch(Oe){console.error("Failed to create item:",Oe)}},e[33]=r.create,e[34]=a,e[35]=o,e[36]=n,e[37]=c,e[38]=l,e[39]=g,e[40]=ce):ce=e[40];const be=ce;let de;e[41]!==m?(de=Je(m),e[41]=m,e[42]=de):de=e[42];const Ce=de,Me=(k?.length??0)>0,Qe=n&&Me,Xe=n&&!Me&&!b;let me;e[43]!==r.create||e[44]!==be||e[45]!==n?(me=n?s.jsxs(ge,{onClick:be,size:"sm",disabled:r.create.isPending,className:"h-7",children:[s.jsx(ct,{className:"mr-2 h-4 w-4"}),r.create.isPending?"Creating...":"Create"]}):null,e[43]=r.create,e[44]=be,e[45]=n,e[46]=me):me=e[46];const Ue=me,ve=D;let L;e[47]!==O||e[48]!==A||e[49]!==v||e[50]!==Ce||e[51]!==ve||e[52]!==p?(L=s.jsx(Le,{viewMode:p,onViewModeChange:A,sortKey:ve,sortDirection:v,onSort:O,sortOptions:Ce}),e[47]=O,e[48]=A,e[49]=v,e[50]=Ce,e[51]=ve,e[52]=p,e[53]=L):L=e[53];const ye=`${a}s`,we=y?.icon??"grid_view";let W;e[54]!==o||e[55]!==ye||e[56]!==we?(W=s.jsx(dt,{connectionId:o,title:ye,icon:we}),e[54]=o,e[55]=ye,e[56]=we,e[57]=W):W=e[57];const Se=Qe&&Ue;let q;e[58]!==L||e[59]!==W||e[60]!==Se?(q=s.jsxs(gt,{children:[L,W,Se]}),e[58]=L,e[59]=W,e[60]=Se,e[61]=q):q=e[61];const _e=`Search ${a}...`;let H;e[62]!==w?(H=$=>{$.key==="Escape"&&(w(""),$.target.blur())},e[62]=w,e[63]=H):H=e[63];let J;e[64]!==b||e[65]!==w||e[66]!==_e||e[67]!==H?(J=s.jsx(bt,{value:b,onChange:w,placeholder:_e,onKeyDown:H}),e[64]=b,e[65]=w,e[66]=_e,e[67]=H,e[68]=J):J=e[68];let G;e[69]!==k?(G=k??[],e[69]=k,e[70]=G):G=e[70];const Ne=D;let Q;e[71]!==T?(Q=$=>T($),e[71]=T,e[72]=Q):Q=e[72];const Te="No items found",Ie=b?"Try adjusting your search terms":"This collection doesn't have any items yet.",Ae=Xe?Ue:void 0;let X;e[73]!==Te||e[74]!==Ie||e[75]!==Ae?(X=s.jsx(Ee,{image:null,title:Te,description:Ie,actions:Ae}),e[73]=Te,e[74]=Ie,e[75]=Ae,e[76]=X):X=e[76];let Y;e[77]!==O||e[78]!==S||e[79]!==xe||e[80]!==m||e[81]!==b||e[82]!==w||e[83]!==A||e[84]!==v||e[85]!==G||e[86]!==Ne||e[87]!==Q||e[88]!==X||e[89]!==p?(Y=s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx(Ut,{hideToolbar:!0,data:G,schema:m,viewMode:p,onViewModeChange:A,search:b,onSearchChange:w,sortKey:Ne,sortDirection:v,onSort:O,actions:xe,onItemClick:Q,readOnly:S,emptyState:X})}),e[77]=O,e[78]=S,e[79]=xe,e[80]=m,e[81]=b,e[82]=w,e[83]=A,e[84]=v,e[85]=G,e[86]=Ne,e[87]=Q,e[88]=X,e[89]=p,e[90]=Y):Y=e[90];let Z;e[91]!==J||e[92]!==Y?(Z=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[J,Y]}),e[91]=J,e[92]=Y,e[93]=Z):Z=e[93];const De=!!x;let ue;e[94]===Symbol.for("react.memo_cache_sentinel")?(ue=$=>{$||M(null)},e[94]=ue):ue=e[94];let fe;e[95]===Symbol.for("react.memo_cache_sentinel")?(fe=s.jsx(Nt,{children:"Delete item?"}),e[95]=fe):fe=e[95];const $e=x?.title;let ee;e[96]!==$e?(ee=s.jsxs(Tt,{children:[fe,s.jsxs(It,{children:['Are you sure you want to delete "',$e,'"? This action cannot be undone.']})]}),e[96]=$e,e[97]=ee):ee=e[97];let te;e[98]!==r.delete.isPending?(te=s.jsx(St,{disabled:r.delete.isPending,children:"Cancel"}),e[98]=r.delete.isPending,e[99]=te):te=e[99];const Pe=r.delete.isPending?"Deleting...":"Delete";let se;e[100]!==r.delete.isPending||e[101]!==je||e[102]!==Pe?(se=s.jsx(_t,{onClick:je,disabled:r.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Pe}),e[100]=r.delete.isPending,e[101]=je,e[102]=Pe,e[103]=se):se=e[103];let oe;e[104]!==te||e[105]!==se?(oe=s.jsxs(At,{children:[te,se]}),e[104]=te,e[105]=se,e[106]=oe):oe=e[106];let ne;e[107]!==ee||e[108]!==oe?(ne=s.jsxs(Dt,{children:[ee,oe]}),e[107]=ee,e[108]=oe,e[109]=ne):ne=e[109];let ie;e[110]!==De||e[111]!==ne?(ie=s.jsx($t,{open:De,onOpenChange:ue,children:ne}),e[110]=De,e[111]=ne,e[112]=ie):ie=e[112];let pe;return e[113]!==q||e[114]!==Z||e[115]!==ie?(pe=s.jsxs(s.Fragment,{children:[q,Z,ie]}),e[113]=q,e[114]=Z,e[115]=ie,e[116]=pe):pe=e[116],pe}function Gt(t){const e=V.c(2),{repository:o}=t;let l;return e[0]!==o?(l=s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(ft,{repository:o})}),e[0]=o,e[1]=l):l=e[1],l}function Qt(t){const e=V.c(4),{tools:o,connectionId:l,org:i}=t;let a;return e[0]!==l||e[1]!==i||e[2]!==o?(a=s.jsx(pt,{tools:o,connectionId:l,org:i}),e[0]=l,e[1]=i,e[2]=o,e[3]=a):a=e[3],a}function Xt(t){const e=V.c(50),{connection:o,connectionId:l,org:i,requestedTabId:a,collections:m,onUpdate:n,isUpdating:u}=t,h=st();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={from:"/$org/mcps/$connectionId"},e[0]=c):c=e[0];const d=ke(c);let g;e[1]!==l?(g={connectionId:l},e[1]=l,e[2]=g):g=e[2];const y=mt(g),f=y.isAuthenticated,j=o?.metadata?.repository,r=!!j?.url,I=o?.tools?.length??0;let C;e[3]===Symbol.for("react.memo_cache_sentinel")?(C={id:"settings",label:"Settings"},e[3]=C):C=e[3];let b;e[4]!==f||e[5]!==I?(b=f&&I>0?[{id:"tools",label:"Tools",count:I}]:[],e[4]=f,e[5]=I,e[6]=b):b=e[6];let P;if(e[7]!==m||e[8]!==r||e[9]!==f||e[10]!==b){let x;e[12]!==r?(x=r?[{id:"readme",label:"README"}]:[],e[12]=r,e[13]=x):x=e[13],P=[C,...b,...f?(m||[]).map(Yt):[],...x],e[7]=m,e[8]=r,e[9]=f,e[10]=b,e[11]=P}else P=e[11];const w=P,p=w.some(x=>x.id===a)?a:"settings";let A;e[14]!==d?(A=x=>{d({search:M=>({...M,tab:x}),replace:!0})},e[14]=d,e[15]=A):A=e[15];const D=A;let v;e[16]!==m?(v=m||[],e[16]=m,e[17]=v):v=e[17];let O;if(e[18]!==p||e[19]!==v){let x;e[21]!==p?(x=M=>M.name===p,e[21]=p,e[22]=x):x=e[22],O=v.find(x),e[18]=p,e[19]=v,e[20]=O}else O=e[20];const N=O;let k;e[23]!==h.history?(k=()=>h.history.back(),e[23]=h.history,e[24]=k):k=e[24];let S;e[25]!==p||e[26]!==D||e[27]!==w?(S=s.jsx(xt,{children:s.jsx(ht,{tabs:w,activeTab:p,onTabChange:D})}),e[25]=p,e[26]=D,e[27]=w,e[28]=S):S=e[28];let E;e[29]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx(U,{size:32,name:"progress_activity",className:"animate-spin text-muted-foreground"})}),e[29]=E):E=e[29];let T;e[30]!==N||e[31]!==p||e[32]!==y.supportsOAuth||e[33]!==o||e[34]!==l||e[35]!==D||e[36]!==r||e[37]!==f||e[38]!==u||e[39]!==n||e[40]!==i||e[41]!==j?(T=s.jsx(ze.Suspense,{fallback:E,children:p==="tools"?s.jsx(Qt,{tools:o.tools??void 0,connectionId:l,org:i}):p==="settings"?s.jsx(ut,{connection:o,onUpdate:n,isUpdating:u,isMCPAuthenticated:f,supportsOAuth:y.supportsOAuth,onViewReadme:r?()=>D("readme"):void 0}):p==="readme"&&r?s.jsx(Gt,{repository:j}):N&&f?s.jsx(Jt,{connectionId:l,org:i,activeCollection:N},p):s.jsx(Ee,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[30]=N,e[31]=p,e[32]=y.supportsOAuth,e[33]=o,e[34]=l,e[35]=D,e[36]=r,e[37]=f,e[38]=u,e[39]=n,e[40]=i,e[41]=j,e[42]=T):T=e[42];let _;e[43]!==p||e[44]!==T?(_=s.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:s.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-auto",children:s.jsx(Fe,{children:T},p)})}),e[43]=p,e[44]=T,e[45]=_):_=e[45];let z;return e[46]!==S||e[47]!==_||e[48]!==k?(z=s.jsxs(jt,{onBack:k,children:[S,_]}),e[46]=S,e[47]=_,e[48]=k,e[49]=z):z=e[49],z}function Yt(t){return{id:t.name,label:t.displayName}}function Zt(){const t=V.c(17);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/mcps/$connectionId"},t[0]=e):e=t[0];const o=ke(e);let l;t[1]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org/mcps/$connectionId"},t[1]=l):l=t[1];const{connectionId:i,org:a}=et(l);let m;t[2]===Symbol.for("react.memo_cache_sentinel")?(m={from:"/shell/$org/mcps/$connectionId"},t[2]=m):m=t[2];const u=tt(m).tab||"settings",h=Ke(i),c=at(),d=rt(h??void 0);let g;t[3]!==c.update||t[4]!==i?(g=async j=>{await c.update.mutateAsync({id:i,data:j})},t[3]=c.update,t[4]=i,t[5]=g):g=t[5];const y=g;if(!h){let j;return t[6]!==o||t[7]!==a?(j=s.jsx("div",{className:"flex h-full w-full bg-background",children:s.jsx(Ee,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:s.jsx(ge,{variant:"outline",onClick:()=>o({to:"/$org/mcps",params:{org:a}}),children:"Back to connections"})})}),t[6]=o,t[7]=a,t[8]=j):j=t[8],j}let f;return t[9]!==c.update.isPending||t[10]!==d||t[11]!==h||t[12]!==i||t[13]!==y||t[14]!==a||t[15]!==u?(f=s.jsx(Xt,{org:a,connection:h,connectionId:i,requestedTabId:u,collections:d,onUpdate:y,isUpdating:c.update.isPending}),t[9]=c.update.isPending,t[10]=d,t[11]=h,t[12]=i,t[13]=y,t[14]=a,t[15]=u,t[16]=f):f=t[16],f}function es(){const t=V.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Fe,{children:s.jsx(ze.Suspense,{fallback:s.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:s.jsx(U,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),children:s.jsx(Zt,{})})}),t[0]=e):e=t[0],e}function Vs(){const t=V.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(es,{}),t[0]=e):e=t[0],e}export{Vs as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as ze,j as t,r as Me,a5 as Fe,b as Ke,a as Be,ar as He,as as Oe}from"./index-CpLt3yXK.js";import{C as Re}from"./schema-D8ew0NM5.js";import{C as Ve}from"./collection-header-BOidrCph.js";import{C as Le}from"./collection-page-jjfHUK0N.js";import{C as Ue}from"./collection-search-mG8LyvuA.js";import{C as We}from"./collection-table-wrapper-C2C7zUkI.js";import{C as qe}from"./connection-card-FwvHBANG.js";import{E as Ne}from"./empty-state-WNgz9fCm.js";import{E as Ge}from"./error-boundary-BiEWgYTq.js";import{d as Je,b as Qe,I as Xe}from"./use-connection-dLAoYo7_.js";import{u as Ye}from"./use-list-state-8Cb6Qj6h.js";import{u as Ze}from"./tooltip-B2bk3ddo.js";import{c as et,b as tt,d as nt,A as ot,e as st,g as it,a as rt,f as lt}from"./alert-dialog-SFOK6jVt.js";import{B as ct}from"./badge-DdZ6WWL4.js";import{B as F}from"./button-a-f_QGwE.js";import{a as at,b as dt,D as mt,f as ut,c as pt,d as ht}from"./dialog-7Hp_Rfs5.js";import{b as Te,D as Ae,a as $e,c as fe}from"./dropdown-menu-BgPAXaVp.js";import{F as B,a as ft,b as H,c as O,d as R,f as V}from"./form-DfOMWaCI.js";import{I as m}from"./icon-OJY1qvap.js";import{I as Pe}from"./input-DADGlXgX.js";import{c as gt,a as xt,S as jt,b as Ct,d as Ie}from"./select-z4npQPjw.js";import{T as _t}from"./textarea-Dedeyf1a.js";import{g as St}from"./generate-id-Dyweu44Y.js";import"./collection-display-button-CsjbEnNB.js";import"./utils-DvXhQGkY.js";import"./card-CoTR2BRq.js";import"./use-mobile-Clv5smUY.js";const yt=Re.pick({title:!0,description:!0,connection_type:!0,connection_url:!0,connection_token:!0}).partial({description:!0,connection_token:!0});function vt(e,n){switch(n.type){case"edit":return{mode:"editing",connection:n.connection};case"delete":return{mode:"deleting",connection:n.connection};case"close":return{mode:"idle"}}}function bt(){const e=ze.c(126),{org:n}=Ze(),r=Fe();let L;e[0]===Symbol.for("react.memo_cache_sentinel")?(L={strict:!1},e[0]=L):L=e[0];const Ee=Ke(L),{data:ge}=Be.useSession();let U;e[1]!==n.slug?(U={namespace:n.slug,resource:"connections"},e[1]=n.slug,e[2]=U):U=e[2];const o=Ye(U),d=Je(),K=Qe(o);let W;e[3]===Symbol.for("react.memo_cache_sentinel")?(W={mode:"idle"},e[3]=W):W=e[3];const[c,u]=Me.useReducer(vt,W),q=Ee.action==="create";let G;e[4]!==r||e[5]!==n.slug?(G=()=>{r({to:"/$org/mcps",params:{org:n.slug},search:{action:"create"}})},e[4]=r,e[5]=n.slug,e[6]=G):G=e[6];const xe=G;let J;e[7]!==r||e[8]!==n.slug?(J=()=>{r({to:"/$org/mcps",params:{org:n.slug},search:{}})},e[7]=r,e[8]=n.slug,e[9]=J):J=e[9];const p=J;let Q;e[10]===Symbol.for("react.memo_cache_sentinel")?(Q={resolver:He(yt),defaultValues:{title:"",description:null,connection_type:"HTTP",connection_url:"",connection_token:null}},e[10]=Q):Q=e[10];const i=Oe(Q),l=c.mode==="editing"?c.connection:null;let X,Y;e[11]!==l||e[12]!==i?(X=()=>{l?i.reset({title:l.title,description:l.description,connection_type:l.connection_type,connection_url:l.connection_url,connection_token:null}):i.reset({title:"",description:null,connection_type:"HTTP",connection_url:"",connection_token:null})},Y=[l,i],e[11]=l,e[12]=i,e[13]=X,e[14]=Y):(X=e[13],Y=e[14]),Me.useEffect(X,Y);let Z;e[15]!==d||e[16]!==c.connection||e[17]!==c.mode?(Z=async()=>{if(c.mode!=="deleting")return;const s=c.connection.id;u({type:"close"});try{await d.delete.mutateAsync(s)}catch{}},e[15]=d,e[16]=c.connection,e[17]=c.mode,e[18]=Z):Z=e[18];const je=Z;let ee;e[19]!==d||e[20]!==p||e[21]!==l||e[22]!==i||e[23]!==r||e[24]!==n.id||e[25]!==n.slug||e[26]!==ge?.user?.id?(ee=async s=>{if(l){await d.update.mutateAsync({id:l.id,data:{title:s.title,description:s.description||null,connection_type:s.connection_type,connection_url:s.connection_url,...s.connection_token&&{connection_token:s.connection_token}}}),u({type:"close"}),i.reset();return}const a=St("conn");await d.create.mutateAsync({id:a,title:s.title,description:s.description||null,connection_type:s.connection_type,connection_url:s.connection_url,connection_token:s.connection_token||null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:ge?.user?.id||"system",organization_id:n.id,icon:null,app_name:null,app_id:null,connection_headers:null,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),p(),i.reset(),r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:a}})},e[19]=d,e[20]=p,e[21]=l,e[22]=i,e[23]=r,e[24]=n.id,e[25]=n.slug,e[26]=ge?.user?.id,e[27]=ee):ee=e[27];const Ce=ee;let te;e[28]!==p||e[29]!==i||e[30]!==q?(te=s=>{s||(q?p():u({type:"close"}),i.reset())},e[28]=p,e[29]=i,e[30]=q,e[31]=te):te=e[31];const h=te;let ne,oe,se,ie,re,le;e[32]===Symbol.for("react.memo_cache_sentinel")?(ne={id:"icon",header:"",render:Bt,cellClassName:"w-16 shrink-0",wrap:!0},oe={id:"title",header:"Name",render:Kt,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},se={id:"description",header:"Description",render:Ft,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},ie={id:"connection_type",header:"Type",accessor:Et,cellClassName:"w-24 shrink-0",sortable:!0},re={id:"connection_url",header:"URL",render:zt,wrap:!0,cellClassName:"w-48 min-w-0 shrink-0"},le={id:"status",header:"Status",render:$t,cellClassName:"w-24 shrink-0",sortable:!0},e[32]=ne,e[33]=oe,e[34]=se,e[35]=ie,e[36]=re,e[37]=le):(ne=e[32],oe=e[33],se=e[34],ie=e[35],re=e[36],le=e[37]);let ce;e[38]!==r||e[39]!==n.slug?(ce=[ne,oe,se,ie,re,le,{id:"actions",header:"",render:s=>t.jsxs(Te,{children:[t.jsx(Ae,{asChild:!0,children:t.jsx(F,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:At,children:t.jsx(m,{name:"more_vert",size:20})})}),t.jsxs($e,{align:"end",onClick:Tt,children:[t.jsxs(fe,{onClick:a=>{a.stopPropagation(),r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}})},children:[t.jsx(m,{name:"visibility",size:16}),"Inspect"]}),t.jsxs(fe,{variant:"destructive",onClick:a=>{a.stopPropagation(),u({type:"delete",connection:s})},children:[t.jsx(m,{name:"delete",size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],e[38]=r,e[39]=n.slug,e[40]=ce):ce=e[40];const _e=ce;let f;e[41]!==r||e[42]!==n.slug?(f=t.jsx(F,{variant:"outline",onClick:()=>r({to:"/$org/store",params:{org:n.slug}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e[41]=r,e[42]=n.slug,e[43]=f):f=e[43];let g;e[44]!==xe?(g=t.jsx(F,{onClick:xe,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Connect MCP Server"}),e[44]=xe,e[45]=g):g=e[45];let ae;e[46]!==f||e[47]!==g?(ae=t.jsxs("div",{className:"flex items-center gap-2",children:[f,g]}),e[46]=f,e[47]=g,e[48]=ae):ae=e[48];const Se=ae,ye=q||c.mode==="editing",ve=l?"Edit Connection":"Create New Connection";let x;e[49]!==ve?(x=t.jsx(at,{children:ve}),e[49]=ve,e[50]=x):x=e[50];const be=l?"Update the connection details below.":"Add a new connection to your organization. Fill in the details below.";let j;e[51]!==be?(j=t.jsx(dt,{children:be}),e[51]=be,e[52]=j):j=e[52];let C;e[53]!==x||e[54]!==j?(C=t.jsxs(mt,{children:[x,j]}),e[53]=x,e[54]=j,e[55]=C):C=e[55];let _;e[56]!==i||e[57]!==Ce?(_=i.handleSubmit(Ce),e[56]=i,e[57]=Ce,e[58]=_):_=e[58];let S;e[59]!==i.control?(S=t.jsxs("div",{className:"grid gap-4 py-4",children:[t.jsx(B,{control:i.control,name:"title",render:Pt}),t.jsx(B,{control:i.control,name:"description",render:Mt}),t.jsx(B,{control:i.control,name:"connection_type",render:It}),t.jsx(B,{control:i.control,name:"connection_url",render:Nt}),t.jsx(B,{control:i.control,name:"connection_token",render:kt})]}),e[59]=i.control,e[60]=S):S=e[60];let y;e[61]!==h?(y=t.jsx(F,{type:"button",variant:"outline",onClick:()=>h(!1),children:"Cancel"}),e[61]=h,e[62]=y):y=e[62];const we=i.formState.isSubmitting?"Saving...":l?"Update Connection":"Create Connection";let v;e[63]!==i.formState.isSubmitting||e[64]!==we?(v=t.jsx(F,{type:"submit",disabled:i.formState.isSubmitting,className:"min-w-40",children:we}),e[63]=i.formState.isSubmitting,e[64]=we,e[65]=v):v=e[65];let b;e[66]!==y||e[67]!==v?(b=t.jsxs(ut,{children:[y,v]}),e[66]=y,e[67]=v,e[68]=b):b=e[68];let w;e[69]!==_||e[70]!==S||e[71]!==b?(w=t.jsxs("form",{onSubmit:_,children:[S,b]}),e[69]=_,e[70]=S,e[71]=b,e[72]=w):w=e[72];let D;e[73]!==i||e[74]!==w?(D=t.jsx(ft,{...i,children:w}),e[73]=i,e[74]=w,e[75]=D):D=e[75];let k;e[76]!==C||e[77]!==D?(k=t.jsxs(pt,{className:"sm:max-w-[525px]",children:[C,D]}),e[76]=C,e[77]=D,e[78]=k):k=e[78];let N;e[79]!==h||e[80]!==ye||e[81]!==k?(N=t.jsx(ht,{open:ye,onOpenChange:h,children:k}),e[79]=h,e[80]=ye,e[81]=k,e[82]=N):N=e[82];const De=c.mode==="deleting";let de;e[83]===Symbol.for("react.memo_cache_sentinel")?(de=s=>!s&&u({type:"close"}),e[83]=de):de=e[83];let me;e[84]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx(et,{children:"Delete Connection?"}),e[84]=me):me=e[84];const ke=c.mode==="deleting"&&c.connection.title;let I;e[85]!==ke?(I=t.jsxs(tt,{children:[me,t.jsxs(nt,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:ke}),"."]})]}),e[85]=ke,e[86]=I):I=e[86];let ue;e[87]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(ot,{children:"Cancel"}),e[87]=ue):ue=e[87];let M;e[88]!==je?(M=t.jsxs(st,{children:[ue,t.jsx(it,{onClick:je,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[88]=je,e[89]=M):M=e[89];let P;e[90]!==I||e[91]!==M?(P=t.jsxs(rt,{children:[I,M]}),e[90]=I,e[91]=M,e[92]=P):P=e[92];let T;e[93]!==De||e[94]!==P?(T=t.jsx(lt,{open:De,onOpenChange:de,children:P}),e[93]=De,e[94]=P,e[95]=T):T=e[95];let pe;e[96]===Symbol.for("react.memo_cache_sentinel")?(pe=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"status",label:"Status"}],e[96]=pe):pe=e[96];let A;e[97]!==Se||e[98]!==o.handleSort||e[99]!==o.setViewMode||e[100]!==o.sortDirection||e[101]!==o.sortKey||e[102]!==o.viewMode?(A=t.jsx(Ve,{title:"MCP Servers",viewMode:o.viewMode,onViewModeChange:o.setViewMode,sortKey:o.sortKey,sortDirection:o.sortDirection,onSort:o.handleSort,sortOptions:pe,ctaButton:Se}),e[97]=Se,e[98]=o.handleSort,e[99]=o.setViewMode,e[100]=o.sortDirection,e[101]=o.sortKey,e[102]=o.viewMode,e[103]=A):A=e[103];let $;e[104]!==o?($=s=>{s.key==="Escape"&&(o.setSearch(""),s.target.blur())},e[104]=o,e[105]=$):$=e[105];let z;e[106]!==o.search||e[107]!==o.setSearch||e[108]!==$?(z=t.jsx(Ue,{value:o.search,onChange:o.setSearch,placeholder:"Search for an MCP Server...",onKeyDown:$}),e[106]=o.search,e[107]=o.setSearch,e[108]=$,e[109]=z):z=e[109];let E;e[110]!==_e||e[111]!==K||e[112]!==o.handleSort||e[113]!==o.search||e[114]!==o.sortDirection||e[115]!==o.sortKey||e[116]!==o.viewMode||e[117]!==r||e[118]!==n.slug?(E=o.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:K.length===0?t.jsx(Ne,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:500,height:223,"aria-hidden":"true"}),title:(o.search,"No MCP Servers found"),description:o.search?`No MCP Servers match "${o.search}"`:"Create a connection to get started."}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:K.map(s=>t.jsx(qe,{connection:s,fallbackIcon:"extension",onClick:()=>r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}}),headerActions:t.jsxs(Te,{children:[t.jsx(Ae,{asChild:!0,children:t.jsx(F,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Dt,children:t.jsx(m,{name:"more_vert",size:20})})}),t.jsxs($e,{align:"end",onClick:wt,children:[t.jsxs(fe,{onClick:a=>{a.stopPropagation(),r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}})},children:[t.jsx(m,{name:"visibility",size:16}),"Inspect"]}),t.jsxs(fe,{variant:"destructive",onClick:a=>{a.stopPropagation(),u({type:"delete",connection:s})},children:[t.jsx(m,{name:"delete",size:16}),"Delete"]})]})]})},s.id))})}):t.jsx(We,{columns:_e,data:K,isLoading:!1,sortKey:o.sortKey,sortDirection:o.sortDirection,onSort:o.handleSort,onRowClick:s=>r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}}),emptyState:o.search?t.jsx(Ne,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:500,height:223,"aria-hidden":"true"}),title:"No MCP Servers found",description:`No MCP Servers match "${o.search}"`}):t.jsx(Ne,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:500,height:223,"aria-hidden":"true"}),title:"No MCP Servers found",description:"Create a connection to get started."})}),e[110]=_e,e[111]=K,e[112]=o.handleSort,e[113]=o.search,e[114]=o.sortDirection,e[115]=o.sortKey,e[116]=o.viewMode,e[117]=r,e[118]=n.slug,e[119]=E):E=e[119];let he;return e[120]!==N||e[121]!==T||e[122]!==A||e[123]!==z||e[124]!==E?(he=t.jsxs(Le,{children:[N,T,A,z,E]}),e[120]=N,e[121]=T,e[122]=A,e[123]=z,e[124]=E,e[125]=he):he=e[125],he}function wt(e){return e.stopPropagation()}function Dt(e){return e.stopPropagation()}function kt(e){const{field:n}=e;return t.jsxs(H,{children:[t.jsx(O,{children:"Token (optional)"}),t.jsx(R,{children:t.jsx(Pe,{type:"password",placeholder:"Bearer token or API key",...n,value:n.value??""})}),t.jsx(V,{})]})}function Nt(e){const{field:n}=e;return t.jsxs(H,{children:[t.jsx(O,{children:"URL *"}),t.jsx(R,{children:t.jsx(Pe,{placeholder:"https://example.com/mcp",...n})}),t.jsx(V,{})]})}function It(e){const{field:n}=e;return t.jsxs(H,{children:[t.jsx(O,{children:"Type *"}),t.jsxs(gt,{value:n.value,onValueChange:n.onChange,children:[t.jsx(R,{children:t.jsx(xt,{children:t.jsx(jt,{})})}),t.jsxs(Ct,{children:[t.jsx(Ie,{value:"HTTP",children:"HTTP"}),t.jsx(Ie,{value:"SSE",children:"SSE"}),t.jsx(Ie,{value:"Websocket",children:"Websocket"})]})]}),t.jsx(V,{})]})}function Mt(e){const{field:n}=e;return t.jsxs(H,{children:[t.jsx(O,{children:"Description"}),t.jsx(R,{children:t.jsx(_t,{placeholder:"A brief description of this connection",rows:3,...n,value:n.value??""})}),t.jsx(V,{})]})}function Pt(e){const{field:n}=e;return t.jsxs(H,{children:[t.jsx(O,{children:"Name *"}),t.jsx(R,{children:t.jsx(Pe,{placeholder:"My Connection",...n})}),t.jsx(V,{})]})}function Tt(e){return e.stopPropagation()}function At(e){return e.stopPropagation()}function $t(e){return t.jsx(ct,{variant:e.status==="active"?"success":"outline",children:e.status})}function zt(e){return t.jsx("span",{className:"text-sm text-muted-foreground block truncate",children:e.connection_url})}function Et(e){return t.jsx("span",{className:"text-sm font-medium",children:e.connection_type})}function Ft(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function Kt(e){return t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})}function Bt(e){return t.jsx(Xe,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:"extension"})}function hn(){const e=ze.c(1);let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(Ge,{children:t.jsx(Me.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(m,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(bt,{})})}),e[0]=n):n=e[0],n}export{hn as default};
|
|
1
|
+
import{c as ze,j as t,r as Me,a5 as Fe,b as Ke,a as Be,ar as He,as as Oe}from"./index-tTqkKQJp.js";import{C as Re}from"./schema-ggfLBohE.js";import{C as Ve}from"./collection-header-BRT8x6Bu.js";import{C as Le}from"./collection-page-DutPWx_J.js";import{C as Ue}from"./collection-search-Blu2oI67.js";import{C as We}from"./collection-table-wrapper-D77XIcPK.js";import{C as qe}from"./connection-card-VvLWKVZB.js";import{E as Ne}from"./empty-state-CLlWeA8F.js";import{E as Ge}from"./error-boundary-BpbgV8Mt.js";import{d as Je,b as Qe,I as Xe}from"./use-connection-CJdd9H8R.js";import{u as Ye}from"./use-list-state-D4EpKod3.js";import{u as Ze}from"./tooltip-DG1xYIL4.js";import{c as et,b as tt,d as nt,A as ot,e as st,g as it,a as rt,f as lt}from"./alert-dialog-B5P__fSo.js";import{B as ct}from"./badge-BWSVXk6u.js";import{B as F}from"./button-7f3mJDt9.js";import{a as at,b as dt,D as mt,f as ut,c as pt,d as ht}from"./dialog-DxoCnO7f.js";import{b as Te,D as Ae,a as $e,c as fe}from"./dropdown-menu-Dsh1FAHq.js";import{F as B,a as ft,b as H,c as O,d as R,f as V}from"./form-CEChYO-W.js";import{I as m}from"./icon-Dk3IUZlY.js";import{I as Pe}from"./input-DsJLZuBe.js";import{c as gt,a as xt,S as jt,b as Ct,d as Ie}from"./select-GwKsoZTV.js";import{T as _t}from"./textarea-DkvsoReo.js";import{g as St}from"./generate-id-Dyweu44Y.js";import"./collection-display-button-yCMREeFw.js";import"./utils-D4LuHWBB.js";import"./card-C-FxKc9h.js";import"./use-mobile-CR4-zNel.js";const yt=Re.pick({title:!0,description:!0,connection_type:!0,connection_url:!0,connection_token:!0}).partial({description:!0,connection_token:!0});function vt(e,n){switch(n.type){case"edit":return{mode:"editing",connection:n.connection};case"delete":return{mode:"deleting",connection:n.connection};case"close":return{mode:"idle"}}}function bt(){const e=ze.c(126),{org:n}=Ze(),r=Fe();let L;e[0]===Symbol.for("react.memo_cache_sentinel")?(L={strict:!1},e[0]=L):L=e[0];const Ee=Ke(L),{data:ge}=Be.useSession();let U;e[1]!==n.slug?(U={namespace:n.slug,resource:"connections"},e[1]=n.slug,e[2]=U):U=e[2];const o=Ye(U),d=Je(),K=Qe(o);let W;e[3]===Symbol.for("react.memo_cache_sentinel")?(W={mode:"idle"},e[3]=W):W=e[3];const[c,u]=Me.useReducer(vt,W),q=Ee.action==="create";let G;e[4]!==r||e[5]!==n.slug?(G=()=>{r({to:"/$org/mcps",params:{org:n.slug},search:{action:"create"}})},e[4]=r,e[5]=n.slug,e[6]=G):G=e[6];const xe=G;let J;e[7]!==r||e[8]!==n.slug?(J=()=>{r({to:"/$org/mcps",params:{org:n.slug},search:{}})},e[7]=r,e[8]=n.slug,e[9]=J):J=e[9];const p=J;let Q;e[10]===Symbol.for("react.memo_cache_sentinel")?(Q={resolver:He(yt),defaultValues:{title:"",description:null,connection_type:"HTTP",connection_url:"",connection_token:null}},e[10]=Q):Q=e[10];const i=Oe(Q),l=c.mode==="editing"?c.connection:null;let X,Y;e[11]!==l||e[12]!==i?(X=()=>{l?i.reset({title:l.title,description:l.description,connection_type:l.connection_type,connection_url:l.connection_url,connection_token:null}):i.reset({title:"",description:null,connection_type:"HTTP",connection_url:"",connection_token:null})},Y=[l,i],e[11]=l,e[12]=i,e[13]=X,e[14]=Y):(X=e[13],Y=e[14]),Me.useEffect(X,Y);let Z;e[15]!==d||e[16]!==c.connection||e[17]!==c.mode?(Z=async()=>{if(c.mode!=="deleting")return;const s=c.connection.id;u({type:"close"});try{await d.delete.mutateAsync(s)}catch{}},e[15]=d,e[16]=c.connection,e[17]=c.mode,e[18]=Z):Z=e[18];const je=Z;let ee;e[19]!==d||e[20]!==p||e[21]!==l||e[22]!==i||e[23]!==r||e[24]!==n.id||e[25]!==n.slug||e[26]!==ge?.user?.id?(ee=async s=>{if(l){await d.update.mutateAsync({id:l.id,data:{title:s.title,description:s.description||null,connection_type:s.connection_type,connection_url:s.connection_url,...s.connection_token&&{connection_token:s.connection_token}}}),u({type:"close"}),i.reset();return}const a=St("conn");await d.create.mutateAsync({id:a,title:s.title,description:s.description||null,connection_type:s.connection_type,connection_url:s.connection_url,connection_token:s.connection_token||null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:ge?.user?.id||"system",organization_id:n.id,icon:null,app_name:null,app_id:null,connection_headers:null,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),p(),i.reset(),r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:a}})},e[19]=d,e[20]=p,e[21]=l,e[22]=i,e[23]=r,e[24]=n.id,e[25]=n.slug,e[26]=ge?.user?.id,e[27]=ee):ee=e[27];const Ce=ee;let te;e[28]!==p||e[29]!==i||e[30]!==q?(te=s=>{s||(q?p():u({type:"close"}),i.reset())},e[28]=p,e[29]=i,e[30]=q,e[31]=te):te=e[31];const h=te;let ne,oe,se,ie,re,le;e[32]===Symbol.for("react.memo_cache_sentinel")?(ne={id:"icon",header:"",render:Bt,cellClassName:"w-16 shrink-0",wrap:!0},oe={id:"title",header:"Name",render:Kt,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},se={id:"description",header:"Description",render:Ft,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},ie={id:"connection_type",header:"Type",accessor:Et,cellClassName:"w-24 shrink-0",sortable:!0},re={id:"connection_url",header:"URL",render:zt,wrap:!0,cellClassName:"w-48 min-w-0 shrink-0"},le={id:"status",header:"Status",render:$t,cellClassName:"w-24 shrink-0",sortable:!0},e[32]=ne,e[33]=oe,e[34]=se,e[35]=ie,e[36]=re,e[37]=le):(ne=e[32],oe=e[33],se=e[34],ie=e[35],re=e[36],le=e[37]);let ce;e[38]!==r||e[39]!==n.slug?(ce=[ne,oe,se,ie,re,le,{id:"actions",header:"",render:s=>t.jsxs(Te,{children:[t.jsx(Ae,{asChild:!0,children:t.jsx(F,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:At,children:t.jsx(m,{name:"more_vert",size:20})})}),t.jsxs($e,{align:"end",onClick:Tt,children:[t.jsxs(fe,{onClick:a=>{a.stopPropagation(),r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}})},children:[t.jsx(m,{name:"visibility",size:16}),"Inspect"]}),t.jsxs(fe,{variant:"destructive",onClick:a=>{a.stopPropagation(),u({type:"delete",connection:s})},children:[t.jsx(m,{name:"delete",size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],e[38]=r,e[39]=n.slug,e[40]=ce):ce=e[40];const _e=ce;let f;e[41]!==r||e[42]!==n.slug?(f=t.jsx(F,{variant:"outline",onClick:()=>r({to:"/$org/store",params:{org:n.slug}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e[41]=r,e[42]=n.slug,e[43]=f):f=e[43];let g;e[44]!==xe?(g=t.jsx(F,{onClick:xe,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Connect MCP Server"}),e[44]=xe,e[45]=g):g=e[45];let ae;e[46]!==f||e[47]!==g?(ae=t.jsxs("div",{className:"flex items-center gap-2",children:[f,g]}),e[46]=f,e[47]=g,e[48]=ae):ae=e[48];const Se=ae,ye=q||c.mode==="editing",ve=l?"Edit Connection":"Create New Connection";let x;e[49]!==ve?(x=t.jsx(at,{children:ve}),e[49]=ve,e[50]=x):x=e[50];const be=l?"Update the connection details below.":"Add a new connection to your organization. Fill in the details below.";let j;e[51]!==be?(j=t.jsx(dt,{children:be}),e[51]=be,e[52]=j):j=e[52];let C;e[53]!==x||e[54]!==j?(C=t.jsxs(mt,{children:[x,j]}),e[53]=x,e[54]=j,e[55]=C):C=e[55];let _;e[56]!==i||e[57]!==Ce?(_=i.handleSubmit(Ce),e[56]=i,e[57]=Ce,e[58]=_):_=e[58];let S;e[59]!==i.control?(S=t.jsxs("div",{className:"grid gap-4 py-4",children:[t.jsx(B,{control:i.control,name:"title",render:Pt}),t.jsx(B,{control:i.control,name:"description",render:Mt}),t.jsx(B,{control:i.control,name:"connection_type",render:It}),t.jsx(B,{control:i.control,name:"connection_url",render:Nt}),t.jsx(B,{control:i.control,name:"connection_token",render:kt})]}),e[59]=i.control,e[60]=S):S=e[60];let y;e[61]!==h?(y=t.jsx(F,{type:"button",variant:"outline",onClick:()=>h(!1),children:"Cancel"}),e[61]=h,e[62]=y):y=e[62];const we=i.formState.isSubmitting?"Saving...":l?"Update Connection":"Create Connection";let v;e[63]!==i.formState.isSubmitting||e[64]!==we?(v=t.jsx(F,{type:"submit",disabled:i.formState.isSubmitting,className:"min-w-40",children:we}),e[63]=i.formState.isSubmitting,e[64]=we,e[65]=v):v=e[65];let b;e[66]!==y||e[67]!==v?(b=t.jsxs(ut,{children:[y,v]}),e[66]=y,e[67]=v,e[68]=b):b=e[68];let w;e[69]!==_||e[70]!==S||e[71]!==b?(w=t.jsxs("form",{onSubmit:_,children:[S,b]}),e[69]=_,e[70]=S,e[71]=b,e[72]=w):w=e[72];let D;e[73]!==i||e[74]!==w?(D=t.jsx(ft,{...i,children:w}),e[73]=i,e[74]=w,e[75]=D):D=e[75];let k;e[76]!==C||e[77]!==D?(k=t.jsxs(pt,{className:"sm:max-w-[525px]",children:[C,D]}),e[76]=C,e[77]=D,e[78]=k):k=e[78];let N;e[79]!==h||e[80]!==ye||e[81]!==k?(N=t.jsx(ht,{open:ye,onOpenChange:h,children:k}),e[79]=h,e[80]=ye,e[81]=k,e[82]=N):N=e[82];const De=c.mode==="deleting";let de;e[83]===Symbol.for("react.memo_cache_sentinel")?(de=s=>!s&&u({type:"close"}),e[83]=de):de=e[83];let me;e[84]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx(et,{children:"Delete Connection?"}),e[84]=me):me=e[84];const ke=c.mode==="deleting"&&c.connection.title;let I;e[85]!==ke?(I=t.jsxs(tt,{children:[me,t.jsxs(nt,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:ke}),"."]})]}),e[85]=ke,e[86]=I):I=e[86];let ue;e[87]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(ot,{children:"Cancel"}),e[87]=ue):ue=e[87];let M;e[88]!==je?(M=t.jsxs(st,{children:[ue,t.jsx(it,{onClick:je,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[88]=je,e[89]=M):M=e[89];let P;e[90]!==I||e[91]!==M?(P=t.jsxs(rt,{children:[I,M]}),e[90]=I,e[91]=M,e[92]=P):P=e[92];let T;e[93]!==De||e[94]!==P?(T=t.jsx(lt,{open:De,onOpenChange:de,children:P}),e[93]=De,e[94]=P,e[95]=T):T=e[95];let pe;e[96]===Symbol.for("react.memo_cache_sentinel")?(pe=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"status",label:"Status"}],e[96]=pe):pe=e[96];let A;e[97]!==Se||e[98]!==o.handleSort||e[99]!==o.setViewMode||e[100]!==o.sortDirection||e[101]!==o.sortKey||e[102]!==o.viewMode?(A=t.jsx(Ve,{title:"MCP Servers",viewMode:o.viewMode,onViewModeChange:o.setViewMode,sortKey:o.sortKey,sortDirection:o.sortDirection,onSort:o.handleSort,sortOptions:pe,ctaButton:Se}),e[97]=Se,e[98]=o.handleSort,e[99]=o.setViewMode,e[100]=o.sortDirection,e[101]=o.sortKey,e[102]=o.viewMode,e[103]=A):A=e[103];let $;e[104]!==o?($=s=>{s.key==="Escape"&&(o.setSearch(""),s.target.blur())},e[104]=o,e[105]=$):$=e[105];let z;e[106]!==o.search||e[107]!==o.setSearch||e[108]!==$?(z=t.jsx(Ue,{value:o.search,onChange:o.setSearch,placeholder:"Search for an MCP Server...",onKeyDown:$}),e[106]=o.search,e[107]=o.setSearch,e[108]=$,e[109]=z):z=e[109];let E;e[110]!==_e||e[111]!==K||e[112]!==o.handleSort||e[113]!==o.search||e[114]!==o.sortDirection||e[115]!==o.sortKey||e[116]!==o.viewMode||e[117]!==r||e[118]!==n.slug?(E=o.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:K.length===0?t.jsx(Ne,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:500,height:223,"aria-hidden":"true"}),title:(o.search,"No MCP Servers found"),description:o.search?`No MCP Servers match "${o.search}"`:"Create a connection to get started."}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:K.map(s=>t.jsx(qe,{connection:s,fallbackIcon:"extension",onClick:()=>r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}}),headerActions:t.jsxs(Te,{children:[t.jsx(Ae,{asChild:!0,children:t.jsx(F,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Dt,children:t.jsx(m,{name:"more_vert",size:20})})}),t.jsxs($e,{align:"end",onClick:wt,children:[t.jsxs(fe,{onClick:a=>{a.stopPropagation(),r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}})},children:[t.jsx(m,{name:"visibility",size:16}),"Inspect"]}),t.jsxs(fe,{variant:"destructive",onClick:a=>{a.stopPropagation(),u({type:"delete",connection:s})},children:[t.jsx(m,{name:"delete",size:16}),"Delete"]})]})]})},s.id))})}):t.jsx(We,{columns:_e,data:K,isLoading:!1,sortKey:o.sortKey,sortDirection:o.sortDirection,onSort:o.handleSort,onRowClick:s=>r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}}),emptyState:o.search?t.jsx(Ne,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:500,height:223,"aria-hidden":"true"}),title:"No MCP Servers found",description:`No MCP Servers match "${o.search}"`}):t.jsx(Ne,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:500,height:223,"aria-hidden":"true"}),title:"No MCP Servers found",description:"Create a connection to get started."})}),e[110]=_e,e[111]=K,e[112]=o.handleSort,e[113]=o.search,e[114]=o.sortDirection,e[115]=o.sortKey,e[116]=o.viewMode,e[117]=r,e[118]=n.slug,e[119]=E):E=e[119];let he;return e[120]!==N||e[121]!==T||e[122]!==A||e[123]!==z||e[124]!==E?(he=t.jsxs(Le,{children:[N,T,A,z,E]}),e[120]=N,e[121]=T,e[122]=A,e[123]=z,e[124]=E,e[125]=he):he=e[125],he}function wt(e){return e.stopPropagation()}function Dt(e){return e.stopPropagation()}function kt(e){const{field:n}=e;return t.jsxs(H,{children:[t.jsx(O,{children:"Token (optional)"}),t.jsx(R,{children:t.jsx(Pe,{type:"password",placeholder:"Bearer token or API key",...n,value:n.value??""})}),t.jsx(V,{})]})}function Nt(e){const{field:n}=e;return t.jsxs(H,{children:[t.jsx(O,{children:"URL *"}),t.jsx(R,{children:t.jsx(Pe,{placeholder:"https://example.com/mcp",...n})}),t.jsx(V,{})]})}function It(e){const{field:n}=e;return t.jsxs(H,{children:[t.jsx(O,{children:"Type *"}),t.jsxs(gt,{value:n.value,onValueChange:n.onChange,children:[t.jsx(R,{children:t.jsx(xt,{children:t.jsx(jt,{})})}),t.jsxs(Ct,{children:[t.jsx(Ie,{value:"HTTP",children:"HTTP"}),t.jsx(Ie,{value:"SSE",children:"SSE"}),t.jsx(Ie,{value:"Websocket",children:"Websocket"})]})]}),t.jsx(V,{})]})}function Mt(e){const{field:n}=e;return t.jsxs(H,{children:[t.jsx(O,{children:"Description"}),t.jsx(R,{children:t.jsx(_t,{placeholder:"A brief description of this connection",rows:3,...n,value:n.value??""})}),t.jsx(V,{})]})}function Pt(e){const{field:n}=e;return t.jsxs(H,{children:[t.jsx(O,{children:"Name *"}),t.jsx(R,{children:t.jsx(Pe,{placeholder:"My Connection",...n})}),t.jsx(V,{})]})}function Tt(e){return e.stopPropagation()}function At(e){return e.stopPropagation()}function $t(e){return t.jsx(ct,{variant:e.status==="active"?"success":"outline",children:e.status})}function zt(e){return t.jsx("span",{className:"text-sm text-muted-foreground block truncate",children:e.connection_url})}function Et(e){return t.jsx("span",{className:"text-sm font-medium",children:e.connection_type})}function Ft(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function Kt(e){return t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})}function Bt(e){return t.jsx(Xe,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:"extension"})}function hn(){const e=ze.c(1);let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(Ge,{children:t.jsx(Me.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(m,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(bt,{})})}),e[0]=n):n=e[0],n}export{hn as default};
|