@decocms/mesh 1.0.0-alpha.23 → 1.0.0-alpha.25
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-BzVvrda9.js → alert-dialog-B5P__fSo.js} +1 -1
- package/dist/client/assets/{auth-zpR1tl-t.js → auth-Cf-BfTK3.js} +1 -1
- package/dist/client/assets/{auth-catchall-DgeIVQ2f.js → auth-catchall-CAFc22YR.js} +1 -1
- package/dist/client/assets/{avatar-TIkmrysR.js → avatar-DPg_RyEl.js} +1 -1
- package/dist/client/assets/{badge-xutB_EEN.js → badge-BWSVXk6u.js} +1 -1
- package/dist/client/assets/{button-Ngdsb528.js → button-7f3mJDt9.js} +1 -1
- package/dist/client/assets/{card-CQm1e1mc.js → card-C-FxKc9h.js} +1 -1
- package/dist/client/assets/{checkbox-CaQAAt_M.js → checkbox-Cgzsx5iu.js} +1 -1
- package/dist/client/assets/{circle-alert-Cx7YqOWW.js → circle-alert-DU3UcGxR.js} +1 -1
- package/dist/client/assets/collection-detail-CFgy96Yw.js +1 -0
- package/dist/client/assets/{collection-display-button-DbcLjEj-.js → collection-display-button-yCMREeFw.js} +1 -1
- package/dist/client/assets/{collection-header-DnBZxnX8.js → collection-header-BRT8x6Bu.js} +1 -1
- package/dist/client/assets/{collection-page-DYfA-3b1.js → collection-page-DutPWx_J.js} +1 -1
- package/dist/client/assets/{collection-search-B58CSVO1.js → collection-search-Blu2oI67.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-9F2m6I4T.js → collection-table-wrapper-D77XIcPK.js} +1 -1
- package/dist/client/assets/{connection-card-CBVTM8da.js → connection-card-VvLWKVZB.js} +1 -1
- package/dist/client/assets/connection-detail-CIXniRq_.js +1 -0
- package/dist/client/assets/{connections-D7q54Ojo.js → connections-B0k_3lJ6.js} +1 -1
- package/dist/client/assets/{core-CfjUrBnH.js → core-DSrr1gFw.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-CqQsNffS.js → create-organization-dialog-QRhVV4NP.js} +1 -1
- package/dist/client/assets/{dialog-drPd0DYR.js → dialog-DxoCnO7f.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CA5IGNpp.js → dropdown-menu-Dsh1FAHq.js} +1 -1
- package/dist/client/assets/{empty-state-GNQmVYL5.js → empty-state-CLlWeA8F.js} +1 -1
- package/dist/client/assets/{error-boundary-B1cvAwRo.js → error-boundary-BpbgV8Mt.js} +1 -1
- package/dist/client/assets/{extract-connection-data-Cp1pOhpZ.js → extract-connection-data-Bubi-83r.js} +1 -1
- package/dist/client/assets/{form-DB-vzIPN.js → form-CEChYO-W.js} +1 -1
- package/dist/client/assets/{gateway-detail-BERbOnev.js → gateway-detail-ht9jY5Da.js} +1 -1
- package/dist/client/assets/{gateways-BnKheBfB.js → gateways-BG4qNJPZ.js} +1 -1
- package/dist/client/assets/{home-CFeHbGL9.js → home-CkLLsx37.js} +1 -1
- package/dist/client/assets/{icon-BEvt1BW0.js → icon-Dk3IUZlY.js} +1 -1
- package/dist/client/assets/{index-nKHbxM5v.js → index-B3Svv0HD.js} +1 -1
- package/dist/client/assets/{index-B55FG-4l.js → index-CRXnV96L.js} +23 -23
- package/dist/client/assets/{index-CUOu49uS.js → index-Pk85Lo4X.js} +1 -1
- package/dist/client/assets/{index-Bg6hz_Hz.js → index-tTqkKQJp.js} +2 -2
- package/dist/client/assets/{input-DeeRidPU.js → input-DsJLZuBe.js} +1 -1
- package/dist/client/assets/json-CPcRzrP7.js +1 -0
- package/dist/client/assets/{layout-NRAvk8gW.js → layout-7tvwsBuE.js} +1 -1
- package/dist/client/assets/{lazy-highlighter-DIeUJT_E.js → lazy-highlighter-BXMzyI4V.js} +1 -1
- package/dist/client/assets/{localstorage-keys-DkmqVmoD.js → localstorage-keys-2gInE9f9.js} +1 -1
- package/dist/client/assets/{login-DotAynhy.js → login-BNugdJth.js} +1 -1
- package/dist/client/assets/mcp-oauth-BOA4hd1a.js +1 -0
- package/dist/client/assets/{members-D6qp7ZUL.js → members-z4wBZKYX.js} +1 -1
- package/dist/client/assets/{monitoring-CHnwo7uy.js → monitoring-BoRkHos-.js} +1 -1
- package/dist/client/assets/{oauth-callback-BokgYivx.js → oauth-callback-z3iCI-Fn.js} +1 -1
- package/dist/client/assets/{page-DI5H70Ii.js → page-DkuwHgHg.js} +1 -1
- package/dist/client/assets/{popover-CX1-TebO.js → popover-CUCZevqJ.js} +1 -1
- package/dist/client/assets/prism-light-yh0IS_ur.js +1 -0
- package/dist/client/assets/{resource-tabs-Oz2fQ-IO.js → resource-tabs-Dr8QbV0u.js} +1 -1
- package/dist/client/assets/{schema-BKa04Vln.js → schema-ggfLBohE.js} +1 -1
- package/dist/client/assets/{select-BTr_dkQY.js → select-GwKsoZTV.js} +1 -1
- package/dist/client/assets/{settings-jZdDHZ78.js → settings-Cp1KZJA2.js} +1 -1
- package/dist/client/assets/{shell-layout-CTaPEgXT.js → shell-layout-BAThlowD.js} +3 -3
- package/dist/client/assets/{spinner-DcOXl8-0.js → spinner-DZz5BuLl.js} +1 -1
- package/dist/client/assets/{store-ZOK0AT5q.js → store-CSHMTNbU.js} +1 -1
- package/dist/client/assets/{store-app-detail-Ct3YK9at.js → store-app-detail-DrtrpMu_.js} +1 -1
- package/dist/client/assets/{switch-BegBdxvh.js → switch-BWlL3QAV.js} +1 -1
- package/dist/client/assets/{textarea-QMiU4OEo.js → textarea-DkvsoReo.js} +1 -1
- package/dist/client/assets/{tool-set-selector-CMgj30nU.js → tool-set-selector-BKqxCVz9.js} +1 -1
- package/dist/client/assets/{tooltip-gSizL4Cv.js → tooltip-DG1xYIL4.js} +1 -1
- package/dist/client/assets/{types-Bv_SBT8V.js → types-Cp78eAtq.js} +3 -3
- package/dist/client/assets/{upload-DUA-D2IE.js → upload-Bmv_uBao.js} +1 -1
- package/dist/client/assets/{use-binding-CS-HVfPQ.js → use-binding-C_9S-BsF.js} +2 -2
- package/dist/client/assets/{use-connection-jae8g8Tv.js → use-connection-CJdd9H8R.js} +1 -1
- package/dist/client/assets/{use-gateway-BW9hKt-h.js → use-gateway-DeuD2XcZ.js} +1 -1
- package/dist/client/assets/{use-list-state-BBSv4_n4.js → use-list-state-D4EpKod3.js} +1 -1
- package/dist/client/assets/{use-mcp-BV4u1keN.js → use-mcp-qYkX8fe3.js} +1 -1
- package/dist/client/assets/{use-members-CuLkyXeY.js → use-members-DcGjLl6z.js} +1 -1
- package/dist/client/assets/{use-mobile-CdIx2Lxx.js → use-mobile-CR4-zNel.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CGLHcYYL.js → use-organization-settings-14jcjh3V.js} +1 -1
- package/dist/client/assets/{use-tool-call-CY79elQX.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 +1 -1
- package/dist/server/server.js +119 -119
- package/package.json +1 -1
- package/dist/client/assets/collection-detail-BR-OufkK.js +0 -1
- package/dist/client/assets/connection-detail-DTdb21q1.js +0 -1
- package/dist/client/assets/json-D_HgWS-M.js +0 -1
- package/dist/client/assets/mcp-oauth-BoRvpq09.js +0 -1
- package/dist/client/assets/prism-light-lShpcgQz.js +0 -1
- package/dist/client/assets/useQuery-BxMITYbc.js +0 -1
- package/dist/client/assets/utils-DM-D9fBL.js +0 -1
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{be as _,r as N,d as M,as as ee,j as t,c as S,af as te,a6 as se,bd as W}from"./index-Bg6hz_Hz.js";import{f as oe,c as D,U as B,a as ne,e as re}from"./use-connection-jae8g8Tv.js";import{T as ae}from"./tool-set-selector-CMgj30nU.js";import{B as ie}from"./badge-xutB_EEN.js";import{B as I}from"./button-Ngdsb528.js";import{I as z}from"./icon-BEvt1BW0.js";import{I as U}from"./input-DeeRidPU.js";import{S as le}from"./spinner-DcOXl8-0.js";import{T as q}from"./textarea-QMiU4OEo.js";import{c as k}from"./utils-DM-D9fBL.js";import{a as G,u as ce,O as de,P as me,E as ue}from"./index-B55FG-4l.js";import{b as Z,a as xe,V as H}from"./layout-NRAvk8gW.js";import{U as fe}from"./upload-DUA-D2IE.js";import{u as pe}from"./use-mcp-BV4u1keN.js";import{C as he}from"./circle-alert-Cx7YqOWW.js";import{E as ge}from"./error-boundary-B1cvAwRo.js";import"./tooltip-gSizL4Cv.js";import"./checkbox-CaQAAt_M.js";import"./select-BTr_dkQY.js";import"./collection-search-B58CSVO1.js";import"./mcp-oauth-BoRvpq09.js";import"./auth-zpR1tl-t.js";import"./use-organization-settings-CGLHcYYL.js";import"./empty-state-GNQmVYL5.js";import"./use-binding-CS-HVfPQ.js";import"./use-tool-call-CY79elQX.js";import"./form-DB-vzIPN.js";import"./use-gateway-BW9hKt-h.js";import"./formatDistanceToNow-Ctx6mZEP.js";import"./extract-connection-data-Cp1pOhpZ.js";import"./registry-utils-ulDDT0d8.js";import"./generate-id-Dyweu44Y.js";import"./index-CUOu49uS.js";import"./index-nKHbxM5v.js";import"./schema-BKa04Vln.js";import"./useQuery-BxMITYbc.js";const be=[["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"}]],je=_("box",be);const ve=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Ne=_("clock",ve);const ye=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],we=_("code",ye);const Se=[["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"}]],Ce=_("copy",Se);const ke=[["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"}]],$e=_("database",ke);const Ie=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],_e=_("info",Ie);const Te=[["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"}]],K=_("play",Te);function Ee(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 m=i;let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{o.current?.click()},e[2]=l):l=e[2];const p=l;let c;e[3]!==m?(c=t.jsx("input",{type:"file",ref:o,className:"hidden",accept:"image/*",onChange:m}),e[3]=m,e[4]=c):c=e[4];let x;e[5]!==n||e[6]!==r?(x=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]=x):x=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=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(fe,{className:"h-5 w-5 text-white"})}),e[8]=f):f=e[8];let h;e[9]!==x?(h=t.jsxs("div",{className:"h-full w-full rounded-xl border border-border bg-muted/20 overflow-hidden relative",children:[x,f]}),e[9]=x,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:p,children:[c,h]}),e[11]=c,e[12]=h,e[13]=b):b=e[13],b}function Ae({itemId:s,onBack:e,onUpdate:r}){const[a,n]=N.useState(!1),[o,i]=N.useState("profile"),{connectionId:m}=M({from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"}),l=m??B,p=D(l),c=oe(l,"AGENT",s,p),{register:x,handleSubmit:f,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 u=async $=>{n(!0);try{await r($)}finally{n(!1)}},O=$=>{b("tool_set",$,{shouldDirty:!0})};return c?t.jsxs(Z,{onBack:e,children:[t.jsxs(xe,{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:m,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:f(u),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(Ee,{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,{...x("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,{...x("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(_e,{className:"h-3.5 w-3.5"}),"Type @ to add tools and more"]}),t.jsx("div",{className:"relative",children:t.jsx(q,{...x("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:O}),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 ze=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 Me(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(ze({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 Oe(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 Re=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ve(s){const e=S.c(12),{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 m=i;let l;if(e[2]!==a?(l={connectionId:a},e[2]=a,e[3]=l):l=e[3],!ce(l)){let f;return e[4]!==n?(f=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{onAuthenticate:()=>n(),buttonText:"Go back"})}),e[4]=n,e[5]=f):f=e[5],f}const c=`${a}:${r}`;let x;return e[6]!==a||e[7]!==m||e[8]!==n||e[9]!==c||e[10]!==r?(x=t.jsx(Ue,{toolName:r,connectionId:a,mcpProxyUrl:m,onBack:n},c),e[6]=a,e[7]=m,e[8]=n,e[9]=c,e[10]=r,e[11]=x):x=e[11],x}function Ue({toolName:s,connectionId:e,mcpProxyUrl:r,onBack:a}){const[n,o]=N.useState({}),[i,m]=N.useState("{}"),[l,p]=N.useState(null),[c,x]=N.useState(null),[f,h]=N.useState(!1),[b,j]=N.useState(null),[w,y]=N.useState("json"),g=pe({url:r.href});N.useEffect(()=>{g.error&&console.error("MCP Error:",g.error)},[g.error]);const u=g.tools?.find(d=>d.name===s),O=u?.inputSchema?.properties,$=O?Object.keys(O):[],A=$.length>0,P={};if(A&&u?.inputSchema?.properties)for(const d of $)P[d]=u.inputSchema.required?.includes(d)?"":void 0;const J=d=>Object.prototype.hasOwnProperty.call(n,d),Q=async()=>{h(!0),x(null),p(null),j(null);const d=performance.now(),C=D(e);try{const v=A?{...P,...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&&u?.inputSchema?.properties&&Object.entries(u.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 R=await C(s,v),V=performance.now(),X=Math.round(V-d);p(R);const Y=JSON.stringify(R),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 R=v instanceof Error?v.message:String(v);x(R||"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:u?.name??Re(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:u?.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(Ne,{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(je,{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($e,{className:"h-4 w-4 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-sm",children:b?.bytes||"-"})]})]}),c&&t.jsxs(Me,{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(he,{className:"h-4 w-4"}),t.jsx(Oe,{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(K,{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:f,children:[f?t.jsx(z,{name:"progress_activity",size:14,className:"animate-spin"}):t.jsx(K,{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&&u?.inputSchema?.properties?Object.entries(u.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}),u.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(q,{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]??"":P[d]??"",onChange:v=>L(d,v.target.value),placeholder:`Enter ${d} as JSON...`}):t.jsx(U,{value:J(d)?n[d]??"":P[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."}),u?.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=>m(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(me,{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(we,{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(Ce,{className:"h-4 w-4"})})})]})]})]})]})]})}function De(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=M(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 p;return e[3]!==i||e[4]!==a||e[5]!==r?(p=t.jsx(N.Suspense,{fallback:l,children:t.jsx(Ve,{toolName:r,connectionId:i,onBack:a})}),e[3]=i,e[4]=a,e[5]=r,e[6]=p):p=e[6],p}const Be={agent:Ae};function Je(){const s=S.c(6),e=W();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=M(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,m=Le;let l;return s[3]!==i||s[4]!==n?(l=t.jsx(De,{itemId:n,onBack:i,onUpdate:m}),s[3]=i,s[4]=n,s[5]=l):l=s[5],l}async function Le(s){return Promise.resolve()}function Fe(){const s=S.c(17),e=W();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=M(r),n=a.connectionId,o=decodeURIComponent(a.collectionName),i=decodeURIComponent(a.itemId);let m;s[1]!==e.history?(m=()=>{e.history.back()},s[1]=e.history,s[2]=m):m=s[2];const l=m,p=n??B;let c;s[3]!==p?(c=D(p),s[3]=p,s[4]=c):c=s[4];const f=re(p,o,c);let h;s[5]!==f||s[6]!==i?(h=async u=>{i&&await f.update.mutateAsync({id:i,data:u})},s[5]=f,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&&Be[w];if(y){let u;return s[10]!==y||s[11]!==l||s[12]!==b||s[13]!==i?(u=t.jsx(y,{itemId:i,onBack:l,onUpdate:b}),s[10]=y,s[11]=l,s[12]=b,s[13]=i,s[14]=u):u=s[14],u}let g;return s[15]!==l?(g=t.jsx(ue,{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=M(e);if(decodeURIComponent(r.collectionName)==="tools"){let i;return s[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Je,{}),s[1]=i):i=s[1],i}let o;return s[2]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Fe,{}),s[2]=o):o=s[2],o}function It(){const s=S.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ge,{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{It as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as V,j as s,a5 as Oe,a as Ye,r as ze,a6 as Ze,d as et,b as tt,bd as st}from"./index-Bg6hz_Hz.js";import{E as Ee}from"./empty-state-GNQmVYL5.js";import{E as Fe}from"./error-boundary-B1cvAwRo.js";import{I as ot,a as Ke,e as nt,u as it,c as lt,d as at}from"./use-connection-jae8g8Tv.js";import{b as rt}from"./use-binding-CS-HVfPQ.js";import{E as Ve,P as ct,a as dt,u as mt,S as ft}from"./index-B55FG-4l.js";import{B as ge}from"./button-Ngdsb528.js";import{I as M}from"./icon-BEvt1BW0.js";import{a as ut,T as pt,R as ht}from"./resource-tabs-Oz2fQ-IO.js";import{V as gt,a as xt,b as jt}from"./layout-NRAvk8gW.js";import{g as Be}from"./generate-id-Dyweu44Y.js";import{C as Le}from"./collection-display-button-DbcLjEj-.js";import{C as bt}from"./collection-search-B58CSVO1.js";import{C as Ct}from"./card-CQm1e1mc.js";import{b as We,D as qe,a as He,c as B}from"./dropdown-menu-CA5IGNpp.js";import{C as vt}from"./collection-table-wrapper-9F2m6I4T.js";import{u as yt}from"./use-list-state-BBSv4_n4.js";import{B as wt}from"./extract-connection-data-Cp1pOhpZ.js";import{A as _t,g as St,c as Nt,b as It,d as Tt,e as Dt,a as $t,f as At}from"./alert-dialog-BzVvrda9.js";import"./utils-DM-D9fBL.js";import"./tooltip-gSizL4Cv.js";import"./auth-zpR1tl-t.js";import"./mcp-oauth-BoRvpq09.js";import"./use-organization-settings-CGLHcYYL.js";import"./use-tool-call-CY79elQX.js";import"./form-DB-vzIPN.js";import"./input-DeeRidPU.js";import"./select-BTr_dkQY.js";import"./use-gateway-BW9hKt-h.js";import"./formatDistanceToNow-Ctx6mZEP.js";import"./registry-utils-ulDDT0d8.js";import"./index-CUOu49uS.js";import"./index-nKHbxM5v.js";import"./schema-BKa04Vln.js";import"./useQuery-BxMITYbc.js";import"./badge-xutB_EEN.js";import"./use-mobile-CdIx2Lxx.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 kt(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 f=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 g=u;let r;e[5]!==f||e[6]!==o.title?(r=s.jsx(ot,{icon:f,name:o.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=f,e[6]=o.title,e[7]=r):r=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 x=n||"No description";let h;e[10]!==x?(h=s.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:x}),e[10]=x,e[11]=h):h=e[11];let j;e[12]!==d||e[13]!==h?(j=s.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[d,h]}),e[12]=d,e[13]=h,e[14]=j):j=e[14];let p;e[15]!==r||e[16]!==j?(p=s.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[r,j]}),e[15]=r,e[16]=j,e[17]=p):p=e[17];let c;e[18]!==i||e[19]!==g||e[20]!==o?(c=g&&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(M,{name:"more_vert",size:20})})}),s.jsxs(He,{align:"end",onClick:Ot,children:[i.open&&s.jsxs(B,{onClick:C=>{C.stopPropagation(),i.open?.(o)},children:[s.jsx(M,{name:"visibility",size:16}),"Open"]}),i.edit&&s.jsxs(B,{onClick:C=>{C.stopPropagation(),i.edit?.(o)},children:[s.jsx(M,{name:"edit",size:16}),"Edit"]}),i.duplicate&&s.jsxs(B,{onClick:C=>{C.stopPropagation(),i.duplicate?.(o)},children:[s.jsx(M,{name:"content_copy",size:16}),"Duplicate"]}),i.delete&&s.jsxs(B,{variant:"destructive",onClick:C=>{C.stopPropagation(),i.delete?.(o)},children:[s.jsx(M,{name:"delete",size:16}),"Delete"]})]})]})}),e[18]=i,e[19]=g,e[20]=o,e[21]=c):c=e[21];let N;return e[22]!==p||e[23]!==c?(N=s.jsxs(Ct,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[p,c]}),e[22]=p,e[23]=c,e[24]=N):N=e[24],N}function Ot(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:f,sortKey:n,sortDirection:u,onSort:g,actions:r,onItemClick:d,headerActions:x,emptyState:h,readOnly:j,columns:p,hideToolbar:c,sortableFields:N}=t,C=a===void 0?Kt:a,v=u===void 0?"asc":u,P=g===void 0?Ft:g;let m;e[0]!==r?(m=r===void 0?{}:r,e[0]=r,e[1]=m):m=e[1];const I=m,k=d===void 0?Rt:d,T=x===void 0?null:x,y=h===void 0?null:h,O=j===void 0?!1:j,w=p===void 0?void 0:p,z=c===void 0?!1:c,_=N===void 0?void 0:N;let D;e[2]!==w||e[3]!==l||e[4]!==_?(D=w?w.filter(Bt).filter(U=>!_||_.includes(U.id)).map(Vt):Je(l,_),e[2]=w,e[3]=l,e[4]=_,e[5]=D):D=e[5];const S=D;let $;e[6]!==T||e[7]!==z||e[8]!==P||e[9]!==C||e[10]!==v||e[11]!==n||e[12]!==S||e[13]!==i?($=!z&&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:T}),s.jsx("div",{className:"flex items-center gap-2 shrink-0",children:s.jsx(Le,{viewMode:i,onViewModeChange:C,sortKey:n,sortDirection:v,onSort:P,sortOptions:S})})]})}),e[6]=T,e[7]=z,e[8]=P,e[9]=C,e[10]=v,e[11]=n,e[12]=S,e[13]=i,e[14]=$):$=e[14];let b;e[15]!==I||e[16]!==w||e[17]!==o||e[18]!==y||e[19]!==k||e[20]!==P||e[21]!==O||e[22]!==l||e[23]!==f||e[24]!==v||e[25]!==n||e[26]!==_||e[27]!==i?(b=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:y||s.jsx(Ve,{icon:"inbox",title:"No items found",description:f?"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(U=>s.jsx("div",{onClick:()=>k?.(U),className:"cursor-pointer h-full",children:s.jsx(kt,{item:U,schema:l,readOnly:O,actions:I})},U.id))})}):s.jsx(vt,{columns:Ht(w,l,_,I),data:o,sortKey:n,sortDirection:v,onSort:P,onRowClick:k,emptyState:y||s.jsx(Ve,{icon:"inbox",title:"No items found",description:f?"Try adjusting your search":"No items to display"})}),e[15]=I,e[16]=w,e[17]=o,e[18]=y,e[19]=k,e[20]=P,e[21]=O,e[22]=l,e[23]=f,e[24]=v,e[25]=n,e[26]=_,e[27]=i,e[28]=b):b=e[28];let E;return e[29]!==$||e[30]!==b?(E=s.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[$,b]}),e[29]=$,e[30]=b,e[31]=E):E=e[31],E}function Vt(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Bt(t){return t.sortable!==!1}function Rt(){}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(M,{name:"more_vert",size:20})})}),s.jsxs(He,{align:"end",onClick:o=>o.stopPropagation(),children:[t.open&&s.jsxs(B,{onClick:o=>{o.stopPropagation(),t.open?.(e)},children:[s.jsx(M,{name:"visibility",size:16}),"Open"]}),t.edit&&s.jsxs(B,{onClick:o=>{o.stopPropagation(),t.edit?.(e)},children:[s.jsx(M,{name:"edit",size:16}),"Edit"]}),t.duplicate&&s.jsxs(B,{onClick:o=>{o.stopPropagation(),t.duplicate?.(e)},children:[s.jsx(M,{name:"content_copy",size:16}),"Duplicate"]}),t.delete&&s.jsxs(B,{variant:"destructive",onClick:o=>{o.stopPropagation(),t.delete?.(e)},children:[s.jsx(M,{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 Re(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&&Re(u)}),a=new Set;i&&a.add(i);const f=["title","description","updated_at","updated_by"];for(const n of f)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:r=>{const d=r[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 g=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:r=>{const d=r[n];return d?s.jsx("span",{className:"block truncate max-w-full",children:new Date(d).toLocaleDateString()}):"—"},sortable:g,cellClassName:"max-w-[200px]"}:i===n&&Re(u)?{id:n,header:n.charAt(0).toUpperCase()+n.slice(1).replace(/_/g," "),render:r=>{const d=r[n];return d?s.jsx("img",{src:String(d),alt:n,className:"h-8 w-8 rounded object-cover"}):"—"},sortable:g,cellClassName:"max-w-[200px]"}:{id:n,header:n.charAt(0).toUpperCase()+n.slice(1).replace(/_/g," "),render:r=>{const d=r[n];return d==null?"—":s.jsx("span",{className:"block truncate max-w-full",children:String(d)})},sortable:g,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,f=i.schema??wt,n=i.hasCreateTool,u=i.hasUpdateTool,g=i.hasDeleteTool,r=Oe(),{data:d}=Ye.useSession(),x=d?.user?.id||"unknown",h=Ke(o);let j;e[0]!==o?(j=lt(o),e[0]=o,e[1]=j):j=e[1];const p=j,c=nt(o,a,p),N=`${o}-${a}`;let C;e[2]!==l||e[3]!==N?(C={namespace:l,resource:N,defaultSortKey:"updated_at"},e[2]=l,e[3]=N,e[4]=C):C=e[4];const{search:v,searchTerm:P,setSearch:m,viewMode:I,setViewMode:k,sortKey:T,sortDirection:y,handleSort:O}=yt(C);let w;e[5]!==P||e[6]!==y||e[7]!==T?(w={searchTerm:P,sortKey:T,sortDirection:y},e[5]=P,e[6]=y,e[7]=T,e[8]=w):w=e[8];const z=it(o,a,p,w),_=!n&&!u&&!g;let D;e[9]!==a||e[10]!==o||e[11]!==r||e[12]!==l?(D=A=>{r({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:l,connectionId:o,collectionName:a,itemId:A.id}})},e[9]=a,e[10]=o,e[11]=r,e[12]=l,e[13]=D):D=e[13];const S=D;let $;e[14]!==c.create||e[15]!==x?($=async A=>{const he=new Date().toISOString();await c.create.mutateAsync({...A,id:Be("conn"),title:`${A.title} (Copy)`,created_at:he,updated_at:he,created_by:x,updated_by:x})},e[14]=c.create,e[15]=x,e[16]=$):$=e[16];const b=$,[E,U]=ze.useState(null);let le;e[17]===Symbol.for("react.memo_cache_sentinel")?(le=A=>{U(A)},e[17]=le):le=e[17];const Ge=le;let R;e[18]!==S||e[19]!==u?(R=u&&{edit:S},e[18]=S,e[19]=u,e[20]=R):R=e[20];let F;e[21]!==b||e[22]!==n?(F=n&&{duplicate:b},e[21]=b,e[22]=n,e[23]=F):F=e[23];let K;e[24]!==g?(K=g&&{delete:Ge},e[24]=g,e[25]=K):K=e[25];let ae;e[26]!==K||e[27]!==R||e[28]!==F?(ae={...R,...F,...K},e[26]=K,e[27]=R,e[28]=F,e[29]=ae):ae=e[29];const xe=ae;let re;e[30]!==c.delete||e[31]!==E?(re=async()=>{E&&(await c.delete.mutateAsync(E.id),U(null))},e[30]=c.delete,e[31]=E,e[32]=re):re=e[32];const je=re;let ce;e[33]!==c.create||e[34]!==a||e[35]!==o||e[36]!==n||e[37]!==r||e[38]!==l||e[39]!==x?(ce=async()=>{if(!n){Ze.error("Create operation is not available for this collection");return}const A=new Date().toISOString(),he={id:Be("conn"),title:"New Item",created_at:A,updated_at:A,created_by:x,updated_by:x};try{const ke=await c.create.mutateAsync(he);r({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:l,connectionId:o,collectionName:a,itemId:ke.id}})}catch(ke){console.error("Failed to create item:",ke)}},e[33]=c.create,e[34]=a,e[35]=o,e[36]=n,e[37]=r,e[38]=l,e[39]=x,e[40]=ce):ce=e[40];const be=ce;let de;e[41]!==f?(de=Je(f),e[41]=f,e[42]=de):de=e[42];const Ce=de,Me=(z?.length??0)>0,Qe=n&&Me,Xe=n&&!Me&&!v;let me;e[43]!==c.create||e[44]!==be||e[45]!==n?(me=n?s.jsxs(ge,{onClick:be,size:"sm",disabled:c.create.isPending,className:"h-7",children:[s.jsx(ct,{className:"mr-2 h-4 w-4"}),c.create.isPending?"Creating...":"Create"]}):null,e[43]=c.create,e[44]=be,e[45]=n,e[46]=me):me=e[46];const Ue=me,ve=T;let L;e[47]!==O||e[48]!==k||e[49]!==y||e[50]!==Ce||e[51]!==ve||e[52]!==I?(L=s.jsx(Le,{viewMode:I,onViewModeChange:k,sortKey:ve,sortDirection:y,onSort:O,sortOptions:Ce}),e[47]=O,e[48]=k,e[49]=y,e[50]=Ce,e[51]=ve,e[52]=I,e[53]=L):L=e[53];const ye=`${a}s`,we=h?.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 _e=Qe&&Ue;let q;e[58]!==L||e[59]!==W||e[60]!==_e?(q=s.jsxs(gt,{children:[L,W,_e]}),e[58]=L,e[59]=W,e[60]=_e,e[61]=q):q=e[61];const Se=`Search ${a}...`;let H;e[62]!==m?(H=A=>{A.key==="Escape"&&(m(""),A.target.blur())},e[62]=m,e[63]=H):H=e[63];let J;e[64]!==v||e[65]!==m||e[66]!==Se||e[67]!==H?(J=s.jsx(bt,{value:v,onChange:m,placeholder:Se,onKeyDown:H}),e[64]=v,e[65]=m,e[66]=Se,e[67]=H,e[68]=J):J=e[68];let G;e[69]!==z?(G=z??[],e[69]=z,e[70]=G):G=e[70];const Ne=T;let Q;e[71]!==S?(Q=A=>S(A),e[71]=S,e[72]=Q):Q=e[72];const Ie="No items found",Te=v?"Try adjusting your search terms":"This collection doesn't have any items yet.",De=Xe?Ue:void 0;let X;e[73]!==Ie||e[74]!==Te||e[75]!==De?(X=s.jsx(Ee,{image:null,title:Ie,description:Te,actions:De}),e[73]=Ie,e[74]=Te,e[75]=De,e[76]=X):X=e[76];let Y;e[77]!==O||e[78]!==_||e[79]!==xe||e[80]!==f||e[81]!==v||e[82]!==m||e[83]!==k||e[84]!==y||e[85]!==G||e[86]!==Ne||e[87]!==Q||e[88]!==X||e[89]!==I?(Y=s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx(Ut,{hideToolbar:!0,data:G,schema:f,viewMode:I,onViewModeChange:k,search:v,onSearchChange:m,sortKey:Ne,sortDirection:y,onSort:O,actions:xe,onItemClick:Q,readOnly:_,emptyState:X})}),e[77]=O,e[78]=_,e[79]=xe,e[80]=f,e[81]=v,e[82]=m,e[83]=k,e[84]=y,e[85]=G,e[86]=Ne,e[87]=Q,e[88]=X,e[89]=I,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 $e=!!E;let fe;e[94]===Symbol.for("react.memo_cache_sentinel")?(fe=A=>{A||U(null)},e[94]=fe):fe=e[94];let ue;e[95]===Symbol.for("react.memo_cache_sentinel")?(ue=s.jsx(Nt,{children:"Delete item?"}),e[95]=ue):ue=e[95];const Ae=E?.title;let ee;e[96]!==Ae?(ee=s.jsxs(It,{children:[ue,s.jsxs(Tt,{children:['Are you sure you want to delete "',Ae,'"? This action cannot be undone.']})]}),e[96]=Ae,e[97]=ee):ee=e[97];let te;e[98]!==c.delete.isPending?(te=s.jsx(_t,{disabled:c.delete.isPending,children:"Cancel"}),e[98]=c.delete.isPending,e[99]=te):te=e[99];const Pe=c.delete.isPending?"Deleting...":"Delete";let se;e[100]!==c.delete.isPending||e[101]!==je||e[102]!==Pe?(se=s.jsx(St,{onClick:je,disabled:c.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Pe}),e[100]=c.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(Dt,{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($t,{children:[ee,oe]}),e[107]=ee,e[108]=oe,e[109]=ne):ne=e[109];let ie;e[110]!==$e||e[111]!==ne?(ie=s.jsx(At,{open:$e,onOpenChange:fe,children:ne}),e[110]=$e,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(ut,{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(48),{connection:o,connectionId:l,org:i,requestedTabId:a,collections:f,onUpdate:n,isUpdating:u}=t,g=st();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/$org/mcps/$connectionId"},e[0]=r):r=e[0];const d=Oe(r);let x;e[1]!==l?(x={connectionId:l},e[1]=l,e[2]=x):x=e[2];const h=mt(x),j=o?.metadata?.repository,p=!!j?.url,c=o?.tools?.length??0;let N;e[3]===Symbol.for("react.memo_cache_sentinel")?(N={id:"settings",label:"Settings"},e[3]=N):N=e[3];let C;e[4]!==h||e[5]!==c?(C=h&&c>0?[{id:"tools",label:"Tools",count:c}]:[],e[4]=h,e[5]=c,e[6]=C):C=e[6];let v;if(e[7]!==f||e[8]!==p||e[9]!==h||e[10]!==C){let b;e[12]!==p?(b=p?[{id:"readme",label:"README"}]:[],e[12]=p,e[13]=b):b=e[13],v=[N,...C,...h?(f||[]).map(Yt):[],...b],e[7]=f,e[8]=p,e[9]=h,e[10]=C,e[11]=v}else v=e[11];const P=v,m=P.some(b=>b.id===a)?a:"settings";let I;e[14]!==d?(I=b=>{d({search:E=>({...E,tab:b}),replace:!0})},e[14]=d,e[15]=I):I=e[15];const k=I;let T;e[16]!==f?(T=f||[],e[16]=f,e[17]=T):T=e[17];let y;if(e[18]!==m||e[19]!==T){let b;e[21]!==m?(b=E=>E.name===m,e[21]=m,e[22]=b):b=e[22],y=T.find(b),e[18]=m,e[19]=T,e[20]=y}else y=e[20];const O=y;let w;e[23]!==g.history?(w=()=>g.history.back(),e[23]=g.history,e[24]=w):w=e[24];let z;e[25]!==m||e[26]!==k||e[27]!==P?(z=s.jsx(xt,{children:s.jsx(ht,{tabs:P,activeTab:m,onTabChange:k})}),e[25]=m,e[26]=k,e[27]=P,e[28]=z):z=e[28];let _;e[29]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx(M,{size:32,name:"progress_activity",className:"animate-spin text-muted-foreground"})}),e[29]=_):_=e[29];let D;e[30]!==O||e[31]!==m||e[32]!==o||e[33]!==l||e[34]!==p||e[35]!==h||e[36]!==u||e[37]!==n||e[38]!==i||e[39]!==j?(D=s.jsx(ze.Suspense,{fallback:_,children:m==="tools"?s.jsx(Qt,{tools:o.tools??void 0,connectionId:l,org:i}):m==="settings"?s.jsx(ft,{connection:o,onUpdate:n,isUpdating:u,isMCPAuthenticated:h}):m==="readme"&&p?s.jsx(Gt,{repository:j}):O&&h?s.jsx(Jt,{connectionId:l,org:i,activeCollection:O},m):s.jsx(Ee,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[30]=O,e[31]=m,e[32]=o,e[33]=l,e[34]=p,e[35]=h,e[36]=u,e[37]=n,e[38]=i,e[39]=j,e[40]=D):D=e[40];let S;e[41]!==m||e[42]!==D?(S=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:D},m)})}),e[41]=m,e[42]=D,e[43]=S):S=e[43];let $;return e[44]!==z||e[45]!==S||e[46]!==w?($=s.jsxs(jt,{onBack:w,children:[z,S]}),e[44]=z,e[45]=S,e[46]=w,e[47]=$):$=e[47],$}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=Oe(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 f;t[2]===Symbol.for("react.memo_cache_sentinel")?(f={from:"/shell/$org/mcps/$connectionId"},t[2]=f):f=t[2];const u=tt(f).tab||"settings",g=Ke(i),r=at(),d=rt(g??void 0);let x;t[3]!==r.update||t[4]!==i?(x=async p=>{await r.update.mutateAsync({id:i,data:p})},t[3]=r.update,t[4]=i,t[5]=x):x=t[5];const h=x;if(!g){let p;return t[6]!==o||t[7]!==a?(p=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]=p):p=t[8],p}let j;return t[9]!==r.update.isPending||t[10]!==d||t[11]!==g||t[12]!==i||t[13]!==h||t[14]!==a||t[15]!==u?(j=s.jsx(Xt,{org:a,connection:g,connectionId:i,requestedTabId:u,collections:d,onUpdate:h,isUpdating:r.update.isPending}),t[9]=r.update.isPending,t[10]=d,t[11]=g,t[12]=i,t[13]=h,t[14]=a,t[15]=u,t[16]=j):j=t[16],j}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(M,{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 +0,0 @@
|
|
|
1
|
-
import{X as o}from"./index-Bg6hz_Hz.js";import{r}from"./json-BESjz4hO.js";var s=r();const e=o(s);export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as O,q as V,r as P,m as $}from"./auth-zpR1tl-t.js";function y(r){let e=0;for(let t=0;t<r.length;t++){const o=r.charCodeAt(t);e=(e<<5)-e+o,e=e&e}return Math.abs(e).toString(16)}const U=new Map,C="mcp:oauth:callback:";class L{serverUrl;_clientMetadata;_redirectUrl;_state=null;_codeVerifier=null;_clientInfo=null;_tokens=null;constructor(e){this.serverUrl=e.serverUrl,this._redirectUrl=e.callbackUrl??`${window.location.origin}/oauth/callback`,this._clientMetadata={redirect_uris:[this._redirectUrl],token_endpoint_auth_method:"none",grant_types:["authorization_code","refresh_token"],response_types:["code"],client_name:e.clientName??"@decocms/mesh MCP client",scope:"mcp"},U.set(y(this.serverUrl),this)}get redirectUrl(){return this._redirectUrl}get clientMetadata(){return this._clientMetadata}state(){return this._state||(this._state=crypto.randomUUID()),this._state}getStoredState(){return this._state}clientInformation(){return this._clientInfo??void 0}saveClientInformation(e){this._clientInfo=e}tokens(){return this._tokens??void 0}saveTokens(e){this._tokens=e}redirectToAuthorization(e){const c=window.screenX+(window.outerWidth-600)/2,s=window.screenY+(window.outerHeight-700)/2;window.open(e.toString(),"mcp-oauth",`width=600,height=700,left=${c},top=${s},popup=yes`)}saveCodeVerifier(e){this._codeVerifier=e}codeVerifier(){if(!this._codeVerifier)throw new Error("Code verifier not found");return this._codeVerifier}invalidateCredentials(){this._clientInfo=null,this._tokens=null,this._codeVerifier=null,this._state=null}getServerUrl(){return this.serverUrl}cleanup(){U.delete(y(this.serverUrl))}}async function R(r){const e=new URL(`/mcp/${r.connectionId}`,window.location.origin),t=new L({serverUrl:e.href,clientName:r.clientName,clientUri:r.clientUri,callbackUrl:r.callbackUrl});try{const o=new Promise((d,n)=>{const l=r.timeout||12e4;let w,h=!1;const M=t.state(),p=`${C}${M}`,a=()=>{if(!h){h=!0,window.removeEventListener("message",g),window.removeEventListener("storage",_),clearTimeout(w);try{localStorage.removeItem(p)}catch{}}},m=async i=>{if(h)return;if(!i.success){a(),n(new Error(i.error||"OAuth authentication failed"));return}const{code:u,state:b}=i;if(!u){a(),n(new Error("Missing authorization code"));return}if(t.getStoredState()!==b){a(),n(new Error("OAuth state mismatch - possible CSRF attack"));return}try{const v=(await O(e))?.authorization_servers?.[0]||e,A=await V(v),S=t.clientInformation();if(!S){a(),n(new Error("Client information not found"));return}const E=t.codeVerifier(),I=await P(v,{metadata:A,clientInformation:S,authorizationCode:u,codeVerifier:E,redirectUri:t.redirectUrl,resource:new URL(e)});a(),d(I)}catch(k){a(),n(k)}},g=async i=>{i.origin===window.location.origin&&i.data?.type==="mcp:oauth:callback"&&await m(i.data)},_=async i=>{if(!(i.key!==p||!i.newValue))try{const u=JSON.parse(i.newValue);await m(u)}catch{}};window.addEventListener("message",g),window.addEventListener("storage",_),w=setTimeout(()=>{a(),n(new Error("OAuth authentication timeout"))},l)});return await $(t,{serverUrl:e})==="REDIRECT"?{token:(await o).access_token,error:null}:{token:t.tokens()?.access_token||null,error:null}}catch(o){return{token:null,error:o instanceof Error?o.message:String(o)}}finally{t.cleanup()}}function f(r,e){if(window.opener&&!window.opener.closed)return window.opener.postMessage(r,window.location.origin),!0;if(e)try{const t=`${C}${e}`;return localStorage.setItem(t,JSON.stringify(r)),!0}catch{}return!1}async function N(){const r=new URLSearchParams(window.location.search),e=r.get("code");let t=r.get("state");const o=r.get("error"),c=r.get("error_description");let s=t;if(t)try{const n=atob(t),l=JSON.parse(n);l.clientState&&(s=l.clientState)}catch{}if(o){const n=c||o;return f({type:"mcp:oauth:callback",success:!1,error:n},s),{success:!1,error:n}}if(!e||!t){const n="Missing code or state parameter";return f({type:"mcp:oauth:callback",success:!1,error:n},s),{success:!1,error:n}}return t=s||t,f({type:"mcp:oauth:callback",success:!0,code:e,state:t},t)?{success:!0}:{success:!1,error:"Parent window not available"}}async function D({url:r,token:e}){try{const t=new Headers;return t.set("Content-Type","application/json"),t.set("Accept","application/json, text/event-stream"),(await fetch(r,{method:"POST",headers:t,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"@decocms/mesh MCP client",version:"1.0.0"}}})})).ok}catch(t){return console.error("[isConnectionAuthenticated] Error:",t),!1}}export{R as a,N as h,D as i};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,h as i}from"./core-CfjUrBnH.js";import{X as s}from"./index-Bg6hz_Hz.js";var g=o();const t=s(g);var a=i(t,{});a.registerLanguage=function(e,r){return t.register(r)};a.alias=function(e,r){return t.alias(e,r)};export{a as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b9 as u,b5 as s}from"./index-Bg6hz_Hz.js";function o(e,r){return u(e,s,r)}export{o as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{bu as t,aD as a}from"./index-Bg6hz_Hz.js";function e(...r){return t(a(r))}export{e as c};
|