@samanhappy/mcphub 1.0.5 → 1.0.6
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/betterAuth.js +2 -2
- package/dist/betterAuth.js.map +1 -1
- package/dist/clients/openapi.js +98 -5
- package/dist/clients/openapi.js.map +1 -1
- package/dist/controllers/hostedInternalController.js +55 -0
- package/dist/controllers/hostedInternalController.js.map +1 -0
- package/dist/controllers/serverController.js +1 -1
- package/dist/controllers/serverController.js.map +1 -1
- package/dist/dao/ServerDao.js +24 -0
- package/dist/dao/ServerDao.js.map +1 -1
- package/dist/dao/ServerDaoDbImpl.js +11 -0
- package/dist/dao/ServerDaoDbImpl.js.map +1 -1
- package/dist/db/repositories/ServerRepository.js +16 -0
- package/dist/db/repositories/ServerRepository.js.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/routes/index.js +5 -1
- package/dist/routes/index.js.map +1 -1
- package/dist/services/betterAuthConfig.js +144 -33
- package/dist/services/betterAuthConfig.js.map +1 -1
- package/dist/services/hostedAuthService.js +314 -0
- package/dist/services/hostedAuthService.js.map +1 -0
- package/dist/services/hostedControlPlaneClient.js +90 -0
- package/dist/services/hostedControlPlaneClient.js.map +1 -0
- package/dist/services/hostedEventSubscriber.js +206 -0
- package/dist/services/hostedEventSubscriber.js.map +1 -0
- package/dist/services/hostedInternalAuth.js +108 -0
- package/dist/services/hostedInternalAuth.js.map +1 -0
- package/dist/services/hostedMode.js +4 -0
- package/dist/services/hostedMode.js.map +1 -0
- package/dist/services/hostedNodeIdentity.js +8 -0
- package/dist/services/hostedNodeIdentity.js.map +1 -0
- package/dist/services/hostedRuntimeCatalogNames.js +7 -0
- package/dist/services/hostedRuntimeCatalogNames.js.map +1 -0
- package/dist/services/hostedRuntimeCatalogService.js +31 -0
- package/dist/services/hostedRuntimeCatalogService.js.map +1 -0
- package/dist/services/mcpService.js +84 -10
- package/dist/services/mcpService.js.map +1 -1
- package/dist/services/requestContextService.js +12 -0
- package/dist/services/requestContextService.js.map +1 -1
- package/dist/services/sseService.js +61 -10
- package/dist/services/sseService.js.map +1 -1
- package/dist/utils/rateLimit.js +4 -0
- package/dist/utils/rateLimit.js.map +1 -1
- package/frontend/dist/assets/{ActivityPage-Ccbl6DLW.js → ActivityPage-CLXufyzU.js} +2 -2
- package/frontend/dist/assets/{ActivityPage-Ccbl6DLW.js.map → ActivityPage-CLXufyzU.js.map} +1 -1
- package/frontend/dist/assets/{Dashboard-CPkAALtS.js → Dashboard-YMaaIlIZ.js} +2 -2
- package/frontend/dist/assets/{Dashboard-CPkAALtS.js.map → Dashboard-YMaaIlIZ.js.map} +1 -1
- package/frontend/dist/assets/{EndpointCopy-BYHUhlpW.js → EndpointCopy-Cpc2WqQz.js} +2 -2
- package/frontend/dist/assets/{EndpointCopy-BYHUhlpW.js.map → EndpointCopy-Cpc2WqQz.js.map} +1 -1
- package/frontend/dist/assets/{GroupsPage-CJI35G25.js → GroupsPage-DqK5U5rY.js} +2 -2
- package/frontend/dist/assets/{GroupsPage-CJI35G25.js.map → GroupsPage-DqK5U5rY.js.map} +1 -1
- package/frontend/dist/assets/{LoginPage-BZ0WR09v.js → LoginPage-ByV35kun.js} +2 -2
- package/frontend/dist/assets/{LoginPage-BZ0WR09v.js.map → LoginPage-ByV35kun.js.map} +1 -1
- package/frontend/dist/assets/{LogsPage-C_U-xXX0.js → LogsPage-BygFVcaV.js} +2 -2
- package/frontend/dist/assets/{LogsPage-C_U-xXX0.js.map → LogsPage-BygFVcaV.js.map} +1 -1
- package/frontend/dist/assets/{MarketPage-dyC4ocP6.js → MarketPage-Cc7QeqSw.js} +2 -2
- package/frontend/dist/assets/{MarketPage-dyC4ocP6.js.map → MarketPage-Cc7QeqSw.js.map} +1 -1
- package/frontend/dist/assets/{PromptsPage-gNHl5xn5.js → PromptsPage-DvLm5TW4.js} +2 -2
- package/frontend/dist/assets/{PromptsPage-gNHl5xn5.js.map → PromptsPage-DvLm5TW4.js.map} +1 -1
- package/frontend/dist/assets/{ResourcesPage-DvgjlTqh.js → ResourcesPage-Dnn1u2fr.js} +2 -2
- package/frontend/dist/assets/{ResourcesPage-DvgjlTqh.js.map → ResourcesPage-Dnn1u2fr.js.map} +1 -1
- package/frontend/dist/assets/ServersPage-RQCARDfE.js +37 -0
- package/frontend/dist/assets/ServersPage-RQCARDfE.js.map +1 -0
- package/frontend/dist/assets/{SettingsPage-D66oC6py.js → SettingsPage-CF40R-50.js} +2 -2
- package/frontend/dist/assets/{SettingsPage-D66oC6py.js.map → SettingsPage-CF40R-50.js.map} +1 -1
- package/frontend/dist/assets/{StatusDot-C7XhRfMO.js → StatusDot-CkF9WMhU.js} +2 -2
- package/frontend/dist/assets/{StatusDot-C7XhRfMO.js.map → StatusDot-CkF9WMhU.js.map} +1 -1
- package/frontend/dist/assets/{ToggleGroup-_MiJO3n_.js → ToggleGroup-vRqJ9DIB.js} +2 -2
- package/frontend/dist/assets/{ToggleGroup-_MiJO3n_.js.map → ToggleGroup-vRqJ9DIB.js.map} +1 -1
- package/frontend/dist/assets/{UsersPage-COmrRpdL.js → UsersPage-DBN5qCeO.js} +2 -2
- package/frontend/dist/assets/{UsersPage-COmrRpdL.js.map → UsersPage-DBN5qCeO.js.map} +1 -1
- package/frontend/dist/assets/{index-D82vzW6B.js → index-C7dQApMG.js} +3 -3
- package/frontend/dist/assets/{index-D82vzW6B.js.map → index-C7dQApMG.js.map} +1 -1
- package/frontend/dist/assets/{resourceService-D-fKBZtF.js → resourceService-BgjWoJFK.js} +2 -2
- package/frontend/dist/assets/{resourceService-D-fKBZtF.js.map → resourceService-BgjWoJFK.js.map} +1 -1
- package/frontend/dist/assets/{useServerData-DgGTUuZ8.js → useServerData-CEGj5OU1.js} +2 -2
- package/frontend/dist/assets/{useServerData-DgGTUuZ8.js.map → useServerData-CEGj5OU1.js.map} +1 -1
- package/frontend/dist/assets/useSettingsData-C2-q9Okf.js +2 -0
- package/frontend/dist/assets/{useSettingsData-B3CTLIUT.js.map → useSettingsData-C2-q9Okf.js.map} +1 -1
- package/frontend/dist/assets/variableDetection-GTKqOf1F.js +16 -0
- package/frontend/dist/assets/variableDetection-GTKqOf1F.js.map +1 -0
- package/frontend/dist/index.html +1 -1
- package/package.json +2 -1
- package/frontend/dist/assets/ServersPage-CKuVFL3O.js +0 -37
- package/frontend/dist/assets/ServersPage-CKuVFL3O.js.map +0 -1
- package/frontend/dist/assets/useSettingsData-B3CTLIUT.js +0 -2
- package/frontend/dist/assets/variableDetection-DsYuiOB_.js +0 -16
- package/frontend/dist/assets/variableDetection-DsYuiOB_.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{f as c,e as t,h as n}from"./index-
|
|
2
|
-
//# sourceMappingURL=resourceService-
|
|
1
|
+
import{f as c,e as t,h as n}from"./index-C7dQApMG.js";import"./framework-vendor-BUhDPOUZ.js";import"./i18n-vendor-Kbr87Ofu.js";import"./icons-vendor-CKgJB3SC.js";const d=async(r,o,s)=>{try{const e=await t(`/servers/${encodeURIComponent(r)}/resources/${encodeURIComponent(o)}/toggle`,{enabled:s},{headers:{Authorization:`Bearer ${localStorage.getItem("mcphub_token")}`}});return{success:e.success,error:e.success?void 0:e.message}}catch(e){return console.error("Error toggling resource",{serverName:r,resourceUri:o,enabled:s,error:e}),{success:!1,error:e instanceof Error?e.message:"Unknown error occurred"}}},g=async(r,o,s)=>{try{const e=await n(`/servers/${encodeURIComponent(r)}/resources/${encodeURIComponent(o)}/description`,{description:s},{headers:{Authorization:`Bearer ${localStorage.getItem("mcphub_token")}`}});return{success:e.success,error:e.success?void 0:e.message}}catch(e){return console.error("Error updating resource description",{serverName:r,resourceUri:o,error:e}),{success:!1,error:e instanceof Error?e.message:"Unknown error occurred"}}},m=async(r,o)=>{var s;try{const e=await c(`/servers/${encodeURIComponent(r)}/resources/${encodeURIComponent(o)}/description`,{headers:{Authorization:`Bearer ${localStorage.getItem("mcphub_token")}`}});return{success:e.success,error:e.success?void 0:e.message,description:(s=e.data)==null?void 0:s.description}}catch(e){return console.error("Error resetting resource description",{serverName:r,resourceUri:o,error:e}),{success:!1,error:e instanceof Error?e.message:"Unknown error occurred"}}};export{m as resetResourceDescription,d as toggleResource,g as updateResourceDescription};
|
|
2
|
+
//# sourceMappingURL=resourceService-BgjWoJFK.js.map
|
package/frontend/dist/assets/{resourceService-D-fKBZtF.js.map → resourceService-BgjWoJFK.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resourceService-
|
|
1
|
+
{"version":3,"file":"resourceService-BgjWoJFK.js","sources":["../../src/services/resourceService.ts"],"sourcesContent":["import { apiDelete, apiPost, apiPut } from '../utils/fetchInterceptor';\n\n/**\n * Toggle a resource's enabled state for a specific server\n */\nexport const toggleResource = async (\n serverName: string,\n resourceUri: string,\n enabled: boolean,\n): Promise<{ success: boolean; error?: string }> => {\n try {\n const response = await apiPost<any>(\n `/servers/${encodeURIComponent(serverName)}/resources/${encodeURIComponent(resourceUri)}/toggle`,\n { enabled },\n {\n headers: {\n Authorization: `Bearer ${localStorage.getItem('mcphub_token')}`,\n },\n },\n );\n\n return {\n success: response.success,\n error: response.success ? undefined : response.message,\n };\n } catch (error) {\n console.error('Error toggling resource', { serverName, resourceUri, enabled, error });\n return {\n success: false,\n error: error instanceof Error ? error.message : 'Unknown error occurred',\n };\n }\n};\n\n/**\n * Update a resource's description for a specific server\n */\nexport const updateResourceDescription = async (\n serverName: string,\n resourceUri: string,\n description: string,\n): Promise<{ success: boolean; error?: string }> => {\n try {\n const response = await apiPut<any>(\n `/servers/${encodeURIComponent(serverName)}/resources/${encodeURIComponent(resourceUri)}/description`,\n { description },\n {\n headers: {\n Authorization: `Bearer ${localStorage.getItem('mcphub_token')}`,\n },\n },\n );\n\n return {\n success: response.success,\n error: response.success ? undefined : response.message,\n };\n } catch (error) {\n console.error('Error updating resource description', { serverName, resourceUri, error });\n return {\n success: false,\n error: error instanceof Error ? error.message : 'Unknown error occurred',\n };\n }\n};\n\nexport const resetResourceDescription = async (\n serverName: string,\n resourceUri: string,\n): Promise<{ success: boolean; error?: string; description?: string }> => {\n try {\n const response = await apiDelete<any>(\n `/servers/${encodeURIComponent(serverName)}/resources/${encodeURIComponent(resourceUri)}/description`,\n {\n headers: {\n Authorization: `Bearer ${localStorage.getItem('mcphub_token')}`,\n },\n },\n );\n\n return {\n success: response.success,\n error: response.success ? undefined : response.message,\n description: response.data?.description,\n };\n } catch (error) {\n console.error('Error resetting resource description', { serverName, resourceUri, error });\n return {\n success: false,\n error: error instanceof Error ? error.message : 'Unknown error occurred',\n };\n }\n};\n"],"names":["toggleResource","serverName","resourceUri","enabled","response","apiPost","error","updateResourceDescription","description","apiPut","resetResourceDescription","apiDelete","_a"],"mappings":"kKAKO,MAAMA,EAAiB,MAC5BC,EACAC,EACAC,IACkD,CAClD,GAAI,CACF,MAAMC,EAAW,MAAMC,EACrB,YAAY,mBAAmBJ,CAAU,CAAC,cAAc,mBAAmBC,CAAW,CAAC,UACvF,CAAE,QAAAC,CAAA,EACF,CACE,QAAS,CACP,cAAe,UAAU,aAAa,QAAQ,cAAc,CAAC,EAAA,CAC/D,CACF,EAGF,MAAO,CACL,QAASC,EAAS,QAClB,MAAOA,EAAS,QAAU,OAAYA,EAAS,OAAA,CAEnD,OAASE,EAAO,CACd,eAAQ,MAAM,0BAA2B,CAAE,WAAAL,EAAY,YAAAC,EAAa,QAAAC,EAAS,MAAAG,EAAO,EAC7E,CACL,QAAS,GACT,MAAOA,aAAiB,MAAQA,EAAM,QAAU,wBAAA,CAEpD,CACF,EAKaC,EAA4B,MACvCN,EACAC,EACAM,IACkD,CAClD,GAAI,CACF,MAAMJ,EAAW,MAAMK,EACrB,YAAY,mBAAmBR,CAAU,CAAC,cAAc,mBAAmBC,CAAW,CAAC,eACvF,CAAE,YAAAM,CAAA,EACF,CACE,QAAS,CACP,cAAe,UAAU,aAAa,QAAQ,cAAc,CAAC,EAAA,CAC/D,CACF,EAGF,MAAO,CACL,QAASJ,EAAS,QAClB,MAAOA,EAAS,QAAU,OAAYA,EAAS,OAAA,CAEnD,OAASE,EAAO,CACd,eAAQ,MAAM,sCAAuC,CAAE,WAAAL,EAAY,YAAAC,EAAa,MAAAI,EAAO,EAChF,CACL,QAAS,GACT,MAAOA,aAAiB,MAAQA,EAAM,QAAU,wBAAA,CAEpD,CACF,EAEaI,EAA2B,MACtCT,EACAC,IACwE,OACxE,GAAI,CACF,MAAME,EAAW,MAAMO,EACrB,YAAY,mBAAmBV,CAAU,CAAC,cAAc,mBAAmBC,CAAW,CAAC,eACvF,CACE,QAAS,CACP,cAAe,UAAU,aAAa,QAAQ,cAAc,CAAC,EAAA,CAC/D,CACF,EAGF,MAAO,CACL,QAASE,EAAS,QAClB,MAAOA,EAAS,QAAU,OAAYA,EAAS,QAC/C,aAAaQ,EAAAR,EAAS,OAAT,YAAAQ,EAAe,WAAA,CAEhC,OAASN,EAAO,CACd,eAAQ,MAAM,uCAAwC,CAAE,WAAAL,EAAY,YAAAC,EAAa,MAAAI,EAAO,EACjF,CACL,QAAS,GACT,MAAOA,aAAiB,MAAQA,EAAM,QAAU,wBAAA,CAEpD,CACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as t}from"./index-
|
|
2
|
-
//# sourceMappingURL=useServerData-
|
|
1
|
+
import{n as t}from"./index-C7dQApMG.js";import{r as u}from"./framework-vendor-BUhDPOUZ.js";const m=e=>{const r=t(),{refreshIfNeeded:f}=r;return u.useEffect(()=>{e!=null&&e.refreshOnMount&&f()},[e==null?void 0:e.refreshOnMount,f]),r};export{m as u};
|
|
2
|
+
//# sourceMappingURL=useServerData-CEGj5OU1.js.map
|
package/frontend/dist/assets/{useServerData-DgGTUuZ8.js.map → useServerData-CEGj5OU1.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useServerData-
|
|
1
|
+
{"version":3,"file":"useServerData-CEGj5OU1.js","sources":["../../src/hooks/useServerData.ts"],"sourcesContent":["// This hook now delegates to the ServerContext to avoid duplicate requests\n// All components will share the same server data and polling mechanism\nimport { useServerContext } from '@/contexts/ServerContext';\nimport { useEffect } from 'react';\n\nexport const useServerData = (options?: { refreshOnMount?: boolean }) => {\n const context = useServerContext();\n const { refreshIfNeeded } = context;\n\n // Optionally refresh on mount for pages that need fresh data\n useEffect(() => {\n if (options?.refreshOnMount) {\n refreshIfNeeded();\n }\n }, [options?.refreshOnMount, refreshIfNeeded]);\n\n return context;\n};\n\n"],"names":["useServerData","options","context","useServerContext","refreshIfNeeded","useEffect"],"mappings":"2FAKO,MAAMA,EAAiBC,GAA2C,CACvE,MAAMC,EAAUC,EAAA,EACV,CAAE,gBAAAC,GAAoBF,EAG5BG,OAAAA,EAAAA,UAAU,IAAM,CACVJ,GAAA,MAAAA,EAAS,gBACXG,EAAA,CAEJ,EAAG,CAACH,GAAA,YAAAA,EAAS,eAAgBG,CAAe,CAAC,EAEtCF,CACT"}
|
package/frontend/dist/assets/{useSettingsData-B3CTLIUT.js.map → useSettingsData-C2-q9Okf.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSettingsData-
|
|
1
|
+
{"version":3,"file":"useSettingsData-C2-q9Okf.js","sources":["../../src/hooks/useSettingsData.ts"],"sourcesContent":["import { useSettings } from '@/contexts/SettingsContext';\n\n/**\n * Hook that provides access to settings data via SettingsContext.\n * This hook is a thin wrapper around useSettings to maintain backward compatibility.\n * The actual data fetching happens once in SettingsProvider, avoiding duplicate API calls.\n */\nexport const useSettingsData = () => {\n return useSettings();\n};\n"],"names":["useSettingsData","useSettings"],"mappings":"wCAOO,MAAMA,EAAkB,IACtBC,EAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{r as N,j as e}from"./framework-vendor-BUhDPOUZ.js";import{u as ss}from"./i18n-vendor-Kbr87Ofu.js";import{X as rs}from"./icons-vendor-CKgJB3SC.js";const _e=o=>{const i={};return o.forEach(({key:n,value:h})=>{const m=n.trim();m&&(i[m]=h)}),i},We=o=>o?o.split(",").map(i=>i.trim()).filter(i=>i.length>0):[],ts=o=>{const i={};return o!=null&&o.timeout&&o.timeout!==6e4&&(i.timeout=o.timeout),typeof(o==null?void 0:o.resetTimeoutOnProgress)=="boolean"&&(i.resetTimeoutOnProgress=o.resetTimeoutOnProgress),o!=null&&o.maxTotalTimeout&&(i.maxTotalTimeout=o.maxTotalTimeout),i},ns=o=>{var b,l,p,g,f,y,j,k;if(!o)return{};const i={},n=(b=o.clientId)==null?void 0:b.trim(),h=(l=o.clientSecret)==null?void 0:l.trim(),m=(p=o.scopes)==null?void 0:p.trim(),t=(g=o.accessToken)==null?void 0:g.trim(),u=(f=o.refreshToken)==null?void 0:f.trim(),x=(y=o.authorizationEndpoint)==null?void 0:y.trim(),d=(j=o.tokenEndpoint)==null?void 0:j.trim(),c=(k=o.resource)==null?void 0:k.trim();if(n&&(i.clientId=n),h&&(i.clientSecret=h),m){const C=m.split(/[\s,]+/).map(v=>v.trim()).filter(v=>v.length>0);C.length>0&&(i.scopes=C)}return t&&(i.accessToken=t),u&&(i.refreshToken=u),x&&(i.authorizationEndpoint=x),d&&(i.tokenEndpoint=d),c&&(i.resource=c),i},as=o=>{var u,x,d,c,b,l,p,g,f,y,j,k,C,v,w;const i={version:((u=o.openapi)==null?void 0:u.version)||"3.1.0",passthroughHeaders:We((x=o.openapi)==null?void 0:x.passthroughHeaders)},n=(c=(d=o.openapi)==null?void 0:d.oauth2TokenUrl)==null?void 0:c.trim(),h=(l=(b=o.openapi)==null?void 0:b.oauth2ClientId)==null?void 0:l.trim(),m=(g=(p=o.openapi)==null?void 0:p.oauth2ClientSecret)==null?void 0:g.trim(),t=(y=(f=o.openapi)==null?void 0:f.oauth2Token)==null?void 0:y.trim();if(((j=o.openapi)==null?void 0:j.inputMode)==="url")i.url=((k=o.openapi)==null?void 0:k.url)||"";else if(((C=o.openapi)==null?void 0:C.inputMode)==="schema"&&((v=o.openapi)!=null&&v.schema))try{i.schema=JSON.parse(o.openapi.schema)}catch{throw new Error("Invalid JSON schema format")}return(w=o.openapi)!=null&&w.securityType&&o.openapi.securityType!=="none"&&(i.security={type:o.openapi.securityType,...o.openapi.securityType==="apiKey"&&{apiKey:{name:o.openapi.apiKeyName||"",in:o.openapi.apiKeyIn||"header",value:o.openapi.apiKeyValue||""}},...o.openapi.securityType==="http"&&{http:{scheme:o.openapi.httpScheme||"bearer",credentials:o.openapi.httpCredentials||""}},...o.openapi.securityType==="oauth2"&&{oauth2:{...n&&{tokenUrl:n},...h&&{clientId:h},...m&&{clientSecret:m},...t&&{token:t}}},...o.openapi.securityType==="openIdConnect"&&{openIdConnect:{url:o.openapi.openIdConnectUrl||"",token:o.openapi.openIdConnectToken||""}}}),i},os=({formData:o,serverType:i,envVars:n,headerVars:h})=>{var c,b,l;const m=_e(n),t=_e(h),u=ts(o.options),x=((c=o.description)==null?void 0:c.trim())||"",d={type:i,description:x,options:u,visibility:o.visibility??"private"};return i==="openapi"?(d.headers=t,d.openapi=as(o)):i==="sse"||i==="streamable-http"?(d.url=o.url.trim(),d.env=m,d.headers=t,d.passthroughHeaders=We(o.passthroughHeaders),d.oauth=ns(o.oauth),d.enableKeepAlive=((b=o.keepAlive)==null?void 0:b.enabled)||!1,d.keepAliveInterval=(l=o.keepAlive)!=null&&l.enabled?o.keepAlive.interval||6e4:void 0):(d.command=o.command.trim(),d.args=o.args,d.env=m),{name:o.name.trim(),config:d}},cs=({onSubmit:o,onCancel:i,initialData:n=null,modalTitle:h,formError:m=null})=>{var z,$,R,B,X,J,G,L,Q,_,W,Y,Z,D,ee,se,re,te,ne,ae,oe,le,ie,pe,ce,de,me,ue,xe,he,ge,ye,be,ve,fe,je,ke,Ne,Ce,Te,we,Ie,Se,Ae,Ke,Ee,Oe,He,Fe,Ve,Me,Pe,Ue,qe,ze,$e,Re,Be,Xe,Je,Ge,Le,Qe;const{t}=ss(),u=()=>!n||!n.config?"stdio":n.config.type?n.config.type:n.config.url?"sse":"stdio",x=r=>!r||!r.config||!r.config.env?[]:Object.entries(r.config.env).map(([s,a])=>({key:s,value:a,description:""})),d=r=>{var a;const s=(a=r==null?void 0:r.config)==null?void 0:a.oauth;return{clientId:(s==null?void 0:s.clientId)||"",clientSecret:(s==null?void 0:s.clientSecret)||"",scopes:s!=null&&s.scopes?s.scopes.join(" "):"",accessToken:(s==null?void 0:s.accessToken)||"",refreshToken:(s==null?void 0:s.refreshToken)||"",authorizationEndpoint:(s==null?void 0:s.authorizationEndpoint)||"",tokenEndpoint:(s==null?void 0:s.tokenEndpoint)||"",resource:(s==null?void 0:s.resource)||""}},[c,b]=N.useState(u()),[l,p]=N.useState({name:n&&n.name||"",description:n&&n.config&&n.config.description||"",url:n&&n.config&&n.config.url||"",command:n&&n.config&&n.config.command||"",arguments:n&&n.config&&n.config.args?Array.isArray(n.config.args)?n.config.args.join(" "):String(n.config.args):"",args:n&&n.config&&n.config.args||[],type:u(),env:x(n),headers:[],passthroughHeaders:(($=(z=n==null?void 0:n.config)==null?void 0:z.passthroughHeaders)==null?void 0:$.join(", "))||"",visibility:((R=n==null?void 0:n.config)==null?void 0:R.visibility)??"private",options:{timeout:n&&n.config&&n.config.options&&n.config.options.timeout||6e4,resetTimeoutOnProgress:((X=(B=n==null?void 0:n.config)==null?void 0:B.options)==null?void 0:X.resetTimeoutOnProgress)??!0,maxTotalTimeout:n&&n.config&&n.config.options&&n.config.options.maxTotalTimeout||void 0},oauth:d(n),keepAlive:{enabled:((J=n==null?void 0:n.config)==null?void 0:J.enableKeepAlive)||!1,interval:((G=n==null?void 0:n.config)==null?void 0:G.keepAliveInterval)||6e4},openapi:n&&n.config&&n.config.openapi?{url:n.config.openapi.url||"",schema:n.config.openapi.schema?JSON.stringify(n.config.openapi.schema,null,2):"",inputMode:n.config.openapi.url?"url":n.config.openapi.schema?"schema":"url",version:n.config.openapi.version||"3.1.0",securityType:((L=n.config.openapi.security)==null?void 0:L.type)||"none",apiKeyName:((_=(Q=n.config.openapi.security)==null?void 0:Q.apiKey)==null?void 0:_.name)||"",apiKeyIn:((Y=(W=n.config.openapi.security)==null?void 0:W.apiKey)==null?void 0:Y.in)||"header",apiKeyValue:((D=(Z=n.config.openapi.security)==null?void 0:Z.apiKey)==null?void 0:D.value)||"",httpScheme:((se=(ee=n.config.openapi.security)==null?void 0:ee.http)==null?void 0:se.scheme)||"bearer",httpCredentials:((te=(re=n.config.openapi.security)==null?void 0:re.http)==null?void 0:te.credentials)||"",oauth2TokenUrl:((ae=(ne=n.config.openapi.security)==null?void 0:ne.oauth2)==null?void 0:ae.tokenUrl)||"",oauth2ClientId:((le=(oe=n.config.openapi.security)==null?void 0:oe.oauth2)==null?void 0:le.clientId)||"",oauth2ClientSecret:((pe=(ie=n.config.openapi.security)==null?void 0:ie.oauth2)==null?void 0:pe.clientSecret)||"",oauth2Token:((de=(ce=n.config.openapi.security)==null?void 0:ce.oauth2)==null?void 0:de.token)||"",openIdConnectUrl:((ue=(me=n.config.openapi.security)==null?void 0:me.openIdConnect)==null?void 0:ue.url)||"",openIdConnectToken:((he=(xe=n.config.openapi.security)==null?void 0:xe.openIdConnect)==null?void 0:he.token)||"",passthroughHeaders:n.config.openapi.passthroughHeaders?n.config.openapi.passthroughHeaders.join(", "):""}:{inputMode:"url",url:"",schema:"",version:"3.1.0",securityType:"none",passthroughHeaders:""}}),[g,f]=N.useState(n&&n.config&&n.config.env?Object.entries(n.config.env).map(([r,s])=>({key:r,value:s})):[]),[y,j]=N.useState(n&&n.config&&n.config.headers?Object.entries(n.config.headers).map(([r,s])=>({key:r,value:s})):[]),[k,C]=N.useState(!1),[v,w]=N.useState(!1),[E,Ye]=N.useState(!1),[H,F]=N.useState(null),Ze=!!n,I=r=>{const{name:s,value:a}=r.target;p({...l,[s]:a})},De=r=>{const s=r.split(" ").filter(a=>a.trim()!=="");p({...l,arguments:r,args:s})},S=r=>{b(r),p(s=>({...s,type:r}))},A=(r,s,a)=>{const T=[...g];T[r][s]=a,f(T)},V=()=>{f([...g,{key:"",value:""}])},M=r=>{const s=[...g];s.splice(r,1),f(s)},K=(r,s,a)=>{const T=[...y];T[r][s]=a,j(T)},P=()=>{j([...y,{key:"",value:""}])},U=r=>{const s=[...y];s.splice(r,1),j(s)},q=(r,s)=>{p(a=>({...a,oauth:{...a.oauth||{},[r]:s}}))},O=(r,s)=>{p(a=>({...a,options:{...a.options,[r]:s}}))},es=async r=>{r.preventDefault(),F(null);try{const s=os({formData:l,serverType:c,envVars:g,headerVars:y});o(s)}catch(s){F(`Error: ${s instanceof Error?s.message:String(s)}`)}};return e.jsxs("div",{className:"hub-card p-6 w-full max-w-3xl max-h-screen overflow-y-auto",children:[e.jsxs("div",{className:"flex justify-between items-center mb-5",children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--hub-ink)]",children:h}),e.jsx("button",{onClick:i,className:"hub-icon-btn","aria-label":"Close",children:e.jsx(rs,{size:16})})]}),(H||m)&&e.jsx("div",{className:"bg-red-50 text-red-700 p-3 rounded mb-4",children:m||H}),e.jsxs("form",{onSubmit:es,children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium mb-1.5 text-[var(--hub-ink-2)]",htmlFor:"name",children:t("server.name")}),e.jsx("input",{type:"text",name:"name",id:"name",value:l.name,onChange:I,className:"w-full py-2 px-3 form-input",placeholder:"e.g.: time-mcp",required:!0})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium mb-1.5 text-[var(--hub-ink-2)]",htmlFor:"description",children:t("server.description")}),e.jsx("input",{type:"text",name:"description",id:"description",value:l.description||"",onChange:I,className:"w-full py-2 px-3 form-input",placeholder:t("server.descriptionPlaceholder")})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium mb-1.5 text-[var(--hub-ink-2)]",htmlFor:"visibility",children:t("server.visibility","Visibility")}),e.jsxs("select",{id:"visibility",name:"visibility",value:l.visibility||"private",onChange:r=>p(s=>({...s,visibility:r.target.value})),className:"w-full py-2 px-3 form-input",children:[e.jsx("option",{value:"private",children:t("server.visibilityPrivate","Private — only the owner and admins")}),l.visibility==="group"&&e.jsx("option",{value:"group",disabled:!0,children:t("server.visibilityGroup","Group (reserved — not yet implemented)")}),e.jsx("option",{value:"public",children:t("server.visibilityPublic","Public — every authenticated user")})]}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:t("server.visibilityDescription","Controls which non-admin users see this server in tools/list. Admins always see all servers regardless of this setting.")})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium mb-1.5 text-[var(--hub-ink-2)]",children:t("server.type")}),e.jsxs("div",{className:"flex space-x-4",children:[e.jsxs("div",{children:[e.jsx("input",{type:"radio",id:"command",name:"serverType",value:"command",checked:c==="stdio",onChange:()=>S("stdio"),className:"mr-1"}),e.jsx("label",{htmlFor:"command",className:"text-[var(--hub-ink)]",children:t("server.typeStdio")})]}),e.jsxs("div",{children:[e.jsx("input",{type:"radio",id:"url",name:"serverType",value:"url",checked:c==="sse",onChange:()=>S("sse"),className:"mr-1"}),e.jsx("label",{htmlFor:"url",className:"text-[var(--hub-ink)]",children:t("server.typeSse")})]}),e.jsxs("div",{children:[e.jsx("input",{type:"radio",id:"streamable-http",name:"serverType",value:"streamable-http",checked:c==="streamable-http",onChange:()=>S("streamable-http"),className:"mr-1"}),e.jsx("label",{htmlFor:"streamable-http",className:"text-[var(--hub-ink)]",children:t("server.typeStreamableHttp")})]}),e.jsxs("div",{children:[e.jsx("input",{type:"radio",id:"openapi",name:"serverType",value:"openapi",checked:c==="openapi",onChange:()=>S("openapi"),className:"mr-1"}),e.jsx("label",{htmlFor:"openapi",className:"text-[var(--hub-ink)]",children:t("server.typeOpenapi")})]})]})]}),c==="openapi"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium mb-1.5 text-[var(--hub-ink-2)]",children:t("server.openapi.inputMode")}),e.jsxs("div",{className:"flex space-x-4",children:[e.jsxs("div",{children:[e.jsx("input",{type:"radio",id:"input-mode-url",name:"inputMode",value:"url",checked:((ge=l.openapi)==null?void 0:ge.inputMode)==="url",onChange:()=>p(r=>({...r,openapi:{...r.openapi,inputMode:"url"}})),className:"mr-1"}),e.jsx("label",{htmlFor:"input-mode-url",children:t("server.openapi.inputModeUrl")})]}),e.jsxs("div",{children:[e.jsx("input",{type:"radio",id:"input-mode-schema",name:"inputMode",value:"schema",checked:((ye=l.openapi)==null?void 0:ye.inputMode)==="schema",onChange:()=>p(r=>({...r,openapi:{...r.openapi,inputMode:"schema"}})),className:"mr-1"}),e.jsx("label",{htmlFor:"input-mode-schema",children:t("server.openapi.inputModeSchema")})]})]})]}),((be=l.openapi)==null?void 0:be.inputMode)==="url"&&e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium mb-1.5 text-[var(--hub-ink-2)]",htmlFor:"openapi-url",children:t("server.openapi.specUrl")}),e.jsx("input",{type:"url",name:"openapi-url",id:"openapi-url",value:((ve=l.openapi)==null?void 0:ve.url)||"",onChange:r=>p(s=>({...s,openapi:{...s.openapi,url:r.target.value}})),className:"w-full py-2 px-3 form-input",placeholder:"e.g.: https://api.example.com/openapi.json",required:c==="openapi"&&((fe=l.openapi)==null?void 0:fe.inputMode)==="url"})]}),((je=l.openapi)==null?void 0:je.inputMode)==="schema"&&e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium mb-1.5 text-[var(--hub-ink-2)]",htmlFor:"openapi-schema",children:t("server.openapi.schema")}),e.jsx("textarea",{name:"openapi-schema",id:"openapi-schema",rows:10,value:((ke=l.openapi)==null?void 0:ke.schema)||"",onChange:r=>p(s=>({...s,openapi:{...s.openapi,schema:r.target.value}})),className:"w-full py-2 px-3 form-input font-mono text-sm",placeholder:`{
|
|
2
|
+
"openapi": "3.1.0",
|
|
3
|
+
"info": {
|
|
4
|
+
"title": "API",
|
|
5
|
+
"version": "1.0.0"
|
|
6
|
+
},
|
|
7
|
+
"servers": [
|
|
8
|
+
{
|
|
9
|
+
"url": "https://api.example.com"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"paths": {
|
|
13
|
+
...
|
|
14
|
+
}
|
|
15
|
+
}`,required:c==="openapi"&&((Ne=l.openapi)==null?void 0:Ne.inputMode)==="schema"}),e.jsx("p",{className:"text-xs text-[var(--hub-ink-3)] mt-1",children:t("server.openapi.schemaHelp")})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium mb-1.5 text-[var(--hub-ink-2)]",children:t("server.openapi.security")}),e.jsxs("select",{value:((Ce=l.openapi)==null?void 0:Ce.securityType)||"none",onChange:r=>p(s=>{var a;return{...s,openapi:{...s.openapi,securityType:r.target.value,url:((a=s.openapi)==null?void 0:a.url)||""}}}),className:"w-full py-2 px-3 form-input",children:[e.jsx("option",{value:"none",children:t("server.openapi.securityNone")}),e.jsx("option",{value:"apiKey",children:t("server.openapi.securityApiKey")}),e.jsx("option",{value:"http",children:t("server.openapi.securityHttp")}),e.jsx("option",{value:"oauth2",children:t("server.openapi.securityOAuth2")}),e.jsx("option",{value:"openIdConnect",children:t("server.openapi.securityOpenIdConnect")})]})]}),((Te=l.openapi)==null?void 0:Te.securityType)==="apiKey"&&e.jsxs("div",{className:"mb-4 p-4 border border-gray-200 dark:border-gray-700 rounded bg-gray-50 dark:bg-gray-800",children:[e.jsx("h4",{className:"text-sm font-medium mb-3 text-[var(--hub-ink-2)]",children:t("server.openapi.apiKeyConfig")}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-[var(--hub-ink-2)] mb-1",children:t("server.openapi.apiKeyName")}),e.jsx("input",{type:"text",value:((we=l.openapi)==null?void 0:we.apiKeyName)||"",onChange:r=>p(s=>{var a;return{...s,openapi:{...s.openapi,apiKeyName:r.target.value,url:((a=s.openapi)==null?void 0:a.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm form-input focus:outline-none",placeholder:"Authorization"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-[var(--hub-ink-2)] mb-1",children:t("server.openapi.apiKeyIn")}),e.jsxs("select",{value:((Ie=l.openapi)==null?void 0:Ie.apiKeyIn)||"header",onChange:r=>p(s=>{var a;return{...s,openapi:{...s.openapi,apiKeyIn:r.target.value,url:((a=s.openapi)==null?void 0:a.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",children:[e.jsx("option",{value:"header",children:t("server.openapi.apiKeyInHeader")}),e.jsx("option",{value:"query",children:t("server.openapi.apiKeyInQuery")}),e.jsx("option",{value:"cookie",children:t("server.openapi.apiKeyInCookie")})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:t("server.openapi.apiKeyValue")}),e.jsx("input",{type:"password",value:((Se=l.openapi)==null?void 0:Se.apiKeyValue)||"",onChange:r=>p(s=>{var a;return{...s,openapi:{...s.openapi,apiKeyValue:r.target.value,url:((a=s.openapi)==null?void 0:a.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:"your-api-key"})]})]})]}),((Ae=l.openapi)==null?void 0:Ae.securityType)==="http"&&e.jsxs("div",{className:"mb-4 p-4 border border-gray-200 dark:border-gray-700 rounded bg-gray-50 dark:bg-gray-800",children:[e.jsx("h4",{className:"text-sm font-medium mb-3 text-gray-700 dark:text-gray-300",children:t("server.openapi.httpAuthConfig")}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:t("server.openapi.httpScheme")}),e.jsxs("select",{value:((Ke=l.openapi)==null?void 0:Ke.httpScheme)||"bearer",onChange:r=>p(s=>{var a;return{...s,openapi:{...s.openapi,httpScheme:r.target.value,url:((a=s.openapi)==null?void 0:a.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",children:[e.jsx("option",{value:"basic",children:t("server.openapi.httpSchemeBasic")}),e.jsx("option",{value:"bearer",children:t("server.openapi.httpSchemeBearer")}),e.jsx("option",{value:"digest",children:t("server.openapi.httpSchemeDigest")})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:t("server.openapi.httpCredentials")}),e.jsx("input",{type:"password",value:((Ee=l.openapi)==null?void 0:Ee.httpCredentials)||"",onChange:r=>p(s=>{var a;return{...s,openapi:{...s.openapi,httpCredentials:r.target.value,url:((a=s.openapi)==null?void 0:a.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:((Oe=l.openapi)==null?void 0:Oe.httpScheme)==="basic"?"base64-encoded-credentials":"bearer-token"})]})]})]}),((He=l.openapi)==null?void 0:He.securityType)==="oauth2"&&e.jsxs("div",{className:"mb-4 p-4 border border-gray-200 dark:border-gray-700 rounded bg-gray-50 dark:bg-gray-800",children:[e.jsx("h4",{className:"text-sm font-medium mb-3 text-gray-700 dark:text-gray-300",children:t("server.openapi.oauth2Config")}),e.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:t("server.oauth.tokenEndpoint")}),e.jsx("input",{type:"url",value:((Fe=l.openapi)==null?void 0:Fe.oauth2TokenUrl)||"",onChange:r=>p(s=>{var a;return{...s,openapi:{...s.openapi,oauth2TokenUrl:r.target.value,url:((a=s.openapi)==null?void 0:a.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:"https://example.com/oauth/token"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:t("server.oauth.clientId")}),e.jsx("input",{type:"text",value:((Ve=l.openapi)==null?void 0:Ve.oauth2ClientId)||"",onChange:r=>p(s=>{var a;return{...s,openapi:{...s.openapi,oauth2ClientId:r.target.value,url:((a=s.openapi)==null?void 0:a.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:"client-id"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:t("server.oauth.clientSecret")}),e.jsx("input",{type:"password",value:((Me=l.openapi)==null?void 0:Me.oauth2ClientSecret)||"",onChange:r=>p(s=>{var a;return{...s,openapi:{...s.openapi,oauth2ClientSecret:r.target.value,url:((a=s.openapi)==null?void 0:a.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:"client-secret"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:t("server.openapi.oauth2Token")}),e.jsx("input",{type:"password",value:((Pe=l.openapi)==null?void 0:Pe.oauth2Token)||"",onChange:r=>p(s=>{var a;return{...s,openapi:{...s.openapi,oauth2Token:r.target.value,url:((a=s.openapi)==null?void 0:a.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:"access-token"})]})]})]}),((Ue=l.openapi)==null?void 0:Ue.securityType)==="openIdConnect"&&e.jsxs("div",{className:"mb-4 p-4 border border-gray-200 dark:border-gray-700 rounded bg-gray-50 dark:bg-gray-800",children:[e.jsx("h4",{className:"text-sm font-medium mb-3 text-gray-700 dark:text-gray-300",children:t("server.openapi.openIdConnectConfig")}),e.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:t("server.openapi.openIdConnectUrl")}),e.jsx("input",{type:"url",value:((qe=l.openapi)==null?void 0:qe.openIdConnectUrl)||"",onChange:r=>p(s=>{var a;return{...s,openapi:{...s.openapi,openIdConnectUrl:r.target.value,url:((a=s.openapi)==null?void 0:a.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:"https://example.com/.well-known/openid_configuration"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:t("server.openapi.openIdConnectToken")}),e.jsx("input",{type:"password",value:((ze=l.openapi)==null?void 0:ze.openIdConnectToken)||"",onChange:r=>p(s=>{var a;return{...s,openapi:{...s.openapi,openIdConnectToken:r.target.value,url:((a=s.openapi)==null?void 0:a.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:"id-token"})]})]})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium mb-1.5 text-gray-700 dark:text-gray-300",children:t("server.openapi.passthroughHeaders")}),e.jsx("input",{type:"text",value:(($e=l.openapi)==null?void 0:$e.passthroughHeaders)||"",onChange:r=>p(s=>{var a;return{...s,openapi:{...s.openapi,passthroughHeaders:r.target.value,url:((a=s.openapi)==null?void 0:a.url)||""}}}),className:"w-full py-2 px-3 form-input",placeholder:"Authorization, X-API-Key, X-Custom-Header"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:t("server.openapi.passthroughHeadersHelp")})]}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:t("server.headers")}),e.jsx("button",{type:"button",onClick:P,className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] btn-primary",children:"+"})]}),y.map((r,s)=>e.jsxs("div",{className:"flex items-center mb-2",children:[e.jsxs("div",{className:"flex items-center space-x-2 flex-grow",children:[e.jsx("input",{type:"text",value:r.key,onChange:a=>K(s,"key",a.target.value),className:"w-1/2 py-2 px-3 form-input",placeholder:"Authorization"}),e.jsx("span",{className:"flex items-center",children:":"}),e.jsx("input",{type:"text",value:r.value,onChange:a=>K(s,"value",a.target.value),className:"w-1/2 py-2 px-3 form-input",placeholder:"Bearer token..."})]}),e.jsx("button",{type:"button",onClick:()=>U(s),className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] ml-2 btn-danger",children:"-"})]},s))]})]}):c==="sse"||c==="streamable-http"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium mb-1.5 text-gray-700 dark:text-gray-300",htmlFor:"url",children:t("server.url")}),e.jsx("input",{type:"url",name:"url",id:"url",value:l.url,onChange:I,className:"w-full py-2 px-3 form-input",placeholder:c==="streamable-http"?"e.g.: http://localhost:3000/mcp":"e.g.: http://localhost:3000/sse",required:c==="sse"||c==="streamable-http"})]}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:t("server.headers")}),e.jsx("button",{type:"button",onClick:P,className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] btn-primary",children:"+"})]}),y.map((r,s)=>e.jsxs("div",{className:"flex items-center mb-2",children:[e.jsxs("div",{className:"flex items-center space-x-2 flex-grow",children:[e.jsx("input",{type:"text",value:r.key,onChange:a=>K(s,"key",a.target.value),className:"w-1/2 py-2 px-3 form-input",placeholder:"Authorization"}),e.jsx("span",{className:"flex items-center",children:":"}),e.jsx("input",{type:"text",value:r.value,onChange:a=>K(s,"value",a.target.value),className:"w-1/2 py-2 px-3 form-input",placeholder:"Bearer token..."})]}),e.jsx("button",{type:"button",onClick:()=>U(s),className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] ml-2 btn-danger",children:"-"})]},s))]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium mb-1.5 text-gray-700 dark:text-gray-300",children:t("server.openapi.passthroughHeaders")}),e.jsx("input",{type:"text",value:l.passthroughHeaders||"",onChange:r=>p(s=>({...s,passthroughHeaders:r.target.value})),className:"w-full py-2 px-3 form-input",placeholder:"Authorization, X-Custom-User-Id"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:t("server.openapi.passthroughHeadersHelp")})]}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:t("server.envVars")}),e.jsx("button",{type:"button",onClick:V,className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] btn-primary",children:"+"})]}),g.map((r,s)=>e.jsxs("div",{className:"flex items-center mb-2",children:[e.jsxs("div",{className:"flex items-center space-x-2 flex-grow",children:[e.jsx("input",{type:"text",value:r.key,onChange:a=>A(s,"key",a.target.value),className:"w-1/2 py-2 px-3 form-input",placeholder:t("server.key")}),e.jsx("span",{className:"flex items-center",children:":"}),e.jsx("input",{type:"text",value:r.value,onChange:a=>A(s,"value",a.target.value),className:"w-1/2 py-2 px-3 form-input",placeholder:t("server.value")})]}),e.jsx("button",{type:"button",onClick:()=>M(s),className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] ml-2 btn-danger",children:"-"})]},s))]}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex items-center justify-between cursor-pointer bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 p-3 rounded border border-gray-200 dark:border-gray-700",onClick:()=>w(!v),children:[e.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:t("server.oauth.sectionTitle")}),e.jsx("span",{className:"text-gray-500 text-sm",children:v?"▼":"▶"})]}),v&&e.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-b p-4 bg-gray-50 dark:bg-gray-800 border-t-0",children:[e.jsx("p",{className:"text-xs text-gray-500 mb-3",children:t("server.oauth.sectionDescription")}),e.jsxs("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:t("server.oauth.clientId")}),e.jsx("input",{type:"text",value:((Re=l.oauth)==null?void 0:Re.clientId)||"",onChange:r=>q("clientId",r.target.value),className:"w-full py-2 px-3 form-input",placeholder:"client id",autoComplete:"off"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:t("server.oauth.clientSecret")}),e.jsx("input",{type:"password",value:((Be=l.oauth)==null?void 0:Be.clientSecret)||"",onChange:r=>q("clientSecret",r.target.value),className:"w-full py-2 px-3 form-input",placeholder:"client secret",autoComplete:"off"})]})]})]})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium mb-1.5 text-gray-700 dark:text-gray-300",htmlFor:"command",children:t("server.command")}),e.jsx("input",{type:"text",name:"command",id:"command",value:l.command,onChange:I,className:"w-full py-2 px-3 form-input",placeholder:"e.g.: npx",required:c==="stdio"})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium mb-1.5 text-gray-700 dark:text-gray-300",htmlFor:"arguments",children:t("server.arguments")}),e.jsx("input",{type:"text",name:"arguments",id:"arguments",value:l.arguments,onChange:r=>De(r.target.value),className:"w-full py-2 px-3 form-input",placeholder:"e.g.: -y time-mcp",required:c==="stdio"})]}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:t("server.envVars")}),e.jsx("button",{type:"button",onClick:V,className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] btn-primary",children:"+"})]}),g.map((r,s)=>e.jsxs("div",{className:"flex items-center mb-2",children:[e.jsxs("div",{className:"flex items-center space-x-2 flex-grow",children:[e.jsx("input",{type:"text",value:r.key,onChange:a=>A(s,"key",a.target.value),className:"w-1/2 py-2 px-3 form-input",placeholder:t("server.key")}),e.jsx("span",{className:"flex items-center",children:":"}),e.jsx("input",{type:"text",value:r.value,onChange:a=>A(s,"value",a.target.value),className:"w-1/2 py-2 px-3 form-input",placeholder:t("server.value")})]}),e.jsx("button",{type:"button",onClick:()=>M(s),className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] ml-2 btn-danger",children:"-"})]},s))]})]}),c!=="openapi"&&e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex items-center justify-between cursor-pointer bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 p-3 rounded border border-gray-200 dark:border-gray-700",onClick:()=>C(!k),children:[e.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:t("server.requestOptions")}),e.jsx("span",{className:"text-gray-500 text-sm",children:k?"▼":"▶"})]}),k&&e.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-b p-4 bg-gray-50 dark:bg-gray-800 border-t-0",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-gray-600 text-sm font-medium mb-1",htmlFor:"timeout",children:t("server.timeout")}),e.jsx("input",{type:"number",id:"timeout",value:((Xe=l.options)==null?void 0:Xe.timeout)||6e4,onChange:r=>O("timeout",parseInt(r.target.value)||6e4),className:"w-full py-2 px-3 form-input",placeholder:"30000",min:"1000",max:"300000"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:t("server.timeoutDescription")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-gray-600 text-sm font-medium mb-1",htmlFor:"maxTotalTimeout",children:t("server.maxTotalTimeout")}),e.jsx("input",{type:"number",id:"maxTotalTimeout",value:((Je=l.options)==null?void 0:Je.maxTotalTimeout)||"",onChange:r=>O("maxTotalTimeout",r.target.value?parseInt(r.target.value):void 0),className:"w-full py-2 px-3 form-input",placeholder:"Optional",min:"1000"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:t("server.maxTotalTimeoutDescription")})]})]}),e.jsxs("div",{className:"mt-3",children:[e.jsxs("label",{className:"flex items-center",children:[e.jsx("input",{type:"checkbox",checked:((Ge=l.options)==null?void 0:Ge.resetTimeoutOnProgress)??!0,onChange:r=>O("resetTimeoutOnProgress",r.target.checked),className:"mr-2"}),e.jsx("span",{className:"text-gray-600 text-sm",children:t("server.resetTimeoutOnProgress")})]}),e.jsx("p",{className:"text-xs text-gray-500 mt-1 ml-6",children:t("server.resetTimeoutOnProgressDescription")})]})]})]}),(c==="sse"||c==="streamable-http")&&e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex items-center justify-between cursor-pointer bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 p-3 rounded border border-gray-200 dark:border-gray-700",onClick:()=>Ye(!E),children:[e.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:t("server.keepAlive","Keep-Alive")}),e.jsx("span",{className:"text-gray-500 text-sm",children:E?"▼":"▶"})]}),E&&e.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-b p-4 bg-gray-50 dark:bg-gray-800 border-t-0",children:[e.jsxs("div",{className:"flex items-center mb-3",children:[e.jsx("input",{type:"checkbox",id:"enableKeepAlive",checked:((Le=l.keepAlive)==null?void 0:Le.enabled)||!1,onChange:r=>p(s=>({...s,keepAlive:{...s.keepAlive,enabled:r.target.checked}})),className:"mr-2"}),e.jsx("label",{htmlFor:"enableKeepAlive",className:"text-gray-600 text-sm",children:t("server.enableKeepAlive","Enable Keep-Alive")})]}),e.jsx("p",{className:"text-xs text-gray-500 mb-3",children:t("server.keepAliveDescription","Send periodic ping requests to maintain the connection. Useful for long-running connections that may timeout.")}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-gray-600 text-sm font-medium mb-1",htmlFor:"keepAliveInterval",children:t("server.keepAliveInterval","Interval (ms)")}),e.jsx("input",{type:"number",id:"keepAliveInterval",value:((Qe=l.keepAlive)==null?void 0:Qe.interval)||6e4,onChange:r=>p(s=>({...s,keepAlive:{...s.keepAlive,interval:parseInt(r.target.value)||6e4}})),className:"w-full py-2 px-3 form-input",placeholder:"60000",min:"5000",max:"300000"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:t("server.keepAliveIntervalDescription","Time between keep-alive pings in milliseconds (default: 60000ms = 1 minute)")})]})]})]}),e.jsxs("div",{className:"flex justify-end mt-6",children:[e.jsx("button",{type:"button",onClick:i,className:"hub-btn mr-2",children:t("server.cancel")}),e.jsx("button",{type:"submit",className:"hub-btn primary",children:t(Ze?"server.save":"server.add")})]})]})]})},ds=o=>{const i=new Set,n=/\$\{([^}]+)\}/g,h=t=>{let u;for(;(u=n.exec(t))!==null;)i.add(u[1])},m=(t,u="")=>{typeof t=="string"?h(t):Array.isArray(t)?t.forEach((x,d)=>m(x,`${u}[${d}]`)):t&&typeof t=="object"&&Object.entries(t).forEach(([x,d])=>{m(d,u?`${u}.${x}`:x)})};return m(o),Array.from(i)};export{cs as S,ds as d};
|
|
16
|
+
//# sourceMappingURL=variableDetection-GTKqOf1F.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variableDetection-GTKqOf1F.js","sources":["../../src/utils/serverFormPayload.ts","../../src/components/ServerForm.tsx","../../src/utils/variableDetection.ts"],"sourcesContent":["import type { EnvVar, ServerConfig, ServerFormData } from '../types';\n\ntype ServerType = NonNullable<ServerConfig['type']>;\n\ninterface BuildServerPayloadInput {\n formData: ServerFormData;\n serverType: ServerType;\n envVars: EnvVar[];\n headerVars: EnvVar[];\n}\n\nconst buildKeyValueRecord = (vars: EnvVar[]): Record<string, string> => {\n const record: Record<string, string> = {};\n\n vars.forEach(({ key, value }) => {\n const trimmedKey = key.trim();\n if (trimmedKey) {\n record[trimmedKey] = value;\n }\n });\n\n return record;\n};\n\nconst parseCommaSeparatedList = (value?: string): string[] => {\n if (!value) {\n return [];\n }\n\n return value\n .split(',')\n .map((item) => item.trim())\n .filter((item) => item.length > 0);\n};\n\nconst buildOptions = (options?: ServerFormData['options']) => {\n const nextOptions: NonNullable<ServerFormData['options']> = {};\n\n if (options?.timeout && options.timeout !== 60000) {\n nextOptions.timeout = options.timeout;\n }\n\n if (typeof options?.resetTimeoutOnProgress === 'boolean') {\n nextOptions.resetTimeoutOnProgress = options.resetTimeoutOnProgress;\n }\n\n if (options?.maxTotalTimeout) {\n nextOptions.maxTotalTimeout = options.maxTotalTimeout;\n }\n\n return nextOptions;\n};\n\nconst buildOAuthConfig = (\n oauth?: ServerFormData['oauth'],\n): Partial<NonNullable<ServerConfig['oauth']>> => {\n if (!oauth) {\n return {};\n }\n\n const nextOAuth: Partial<NonNullable<ServerConfig['oauth']>> = {};\n const clientId = oauth.clientId?.trim();\n const clientSecret = oauth.clientSecret?.trim();\n const scopes = oauth.scopes?.trim();\n const accessToken = oauth.accessToken?.trim();\n const refreshToken = oauth.refreshToken?.trim();\n const authorizationEndpoint = oauth.authorizationEndpoint?.trim();\n const tokenEndpoint = oauth.tokenEndpoint?.trim();\n const resource = oauth.resource?.trim();\n\n if (clientId) nextOAuth.clientId = clientId;\n if (clientSecret) nextOAuth.clientSecret = clientSecret;\n if (scopes) {\n const parsedScopes = scopes\n .split(/[\\s,]+/)\n .map((scope) => scope.trim())\n .filter((scope) => scope.length > 0);\n\n if (parsedScopes.length > 0) {\n nextOAuth.scopes = parsedScopes;\n }\n }\n if (accessToken) nextOAuth.accessToken = accessToken;\n if (refreshToken) nextOAuth.refreshToken = refreshToken;\n if (authorizationEndpoint) nextOAuth.authorizationEndpoint = authorizationEndpoint;\n if (tokenEndpoint) nextOAuth.tokenEndpoint = tokenEndpoint;\n if (resource) nextOAuth.resource = resource;\n\n return nextOAuth;\n};\n\nconst buildOpenApiConfig = (formData: ServerFormData): NonNullable<ServerConfig['openapi']> => {\n const openapi: NonNullable<ServerConfig['openapi']> = {\n version: formData.openapi?.version || '3.1.0',\n passthroughHeaders: parseCommaSeparatedList(formData.openapi?.passthroughHeaders),\n };\n const oauth2TokenUrl = formData.openapi?.oauth2TokenUrl?.trim();\n const oauth2ClientId = formData.openapi?.oauth2ClientId?.trim();\n const oauth2ClientSecret = formData.openapi?.oauth2ClientSecret?.trim();\n const oauth2Token = formData.openapi?.oauth2Token?.trim();\n\n if (formData.openapi?.inputMode === 'url') {\n openapi.url = formData.openapi?.url || '';\n } else if (formData.openapi?.inputMode === 'schema' && formData.openapi?.schema) {\n try {\n openapi.schema = JSON.parse(formData.openapi.schema);\n } catch {\n throw new Error('Invalid JSON schema format');\n }\n }\n\n if (formData.openapi?.securityType && formData.openapi.securityType !== 'none') {\n openapi.security = {\n type: formData.openapi.securityType,\n ...(formData.openapi.securityType === 'apiKey' && {\n apiKey: {\n name: formData.openapi.apiKeyName || '',\n in: formData.openapi.apiKeyIn || 'header',\n value: formData.openapi.apiKeyValue || '',\n },\n }),\n ...(formData.openapi.securityType === 'http' && {\n http: {\n scheme: formData.openapi.httpScheme || 'bearer',\n credentials: formData.openapi.httpCredentials || '',\n },\n }),\n ...(formData.openapi.securityType === 'oauth2' && {\n oauth2: {\n ...(oauth2TokenUrl && {\n tokenUrl: oauth2TokenUrl,\n }),\n ...(oauth2ClientId && {\n clientId: oauth2ClientId,\n }),\n ...(oauth2ClientSecret && {\n clientSecret: oauth2ClientSecret,\n }),\n ...(oauth2Token && {\n token: oauth2Token,\n }),\n },\n }),\n ...(formData.openapi.securityType === 'openIdConnect' && {\n openIdConnect: {\n url: formData.openapi.openIdConnectUrl || '',\n token: formData.openapi.openIdConnectToken || '',\n },\n }),\n };\n }\n\n return openapi;\n};\n\nexport const buildServerPayload = ({\n formData,\n serverType,\n envVars,\n headerVars,\n}: BuildServerPayloadInput) => {\n const env = buildKeyValueRecord(envVars);\n const headers = buildKeyValueRecord(headerVars);\n const options = buildOptions(formData.options);\n const description = formData.description?.trim() || '';\n\n const config: Partial<ServerConfig> = {\n type: serverType,\n description,\n options,\n visibility: formData.visibility ?? 'private',\n };\n\n if (serverType === 'openapi') {\n config.headers = headers;\n config.openapi = buildOpenApiConfig(formData);\n } else if (serverType === 'sse' || serverType === 'streamable-http') {\n config.url = formData.url.trim();\n config.env = env;\n config.headers = headers;\n config.passthroughHeaders = parseCommaSeparatedList(formData.passthroughHeaders);\n config.oauth = buildOAuthConfig(formData.oauth);\n config.enableKeepAlive = formData.keepAlive?.enabled || false;\n config.keepAliveInterval = formData.keepAlive?.enabled\n ? formData.keepAlive.interval || 60000\n : undefined;\n } else {\n config.command = formData.command.trim();\n config.args = formData.args;\n config.env = env;\n }\n\n return {\n name: formData.name.trim(),\n config,\n };\n};","import { useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { X } from 'lucide-react';\nimport { Server, EnvVar, ServerFormData } from '@/types';\nimport { buildServerPayload } from '../utils/serverFormPayload';\n\ninterface ServerFormProps {\n onSubmit: (payload: any) => void;\n onCancel: () => void;\n initialData?: Server | null;\n modalTitle: string;\n formError?: string | null;\n}\n\nconst ServerForm = ({\n onSubmit,\n onCancel,\n initialData = null,\n modalTitle,\n formError = null,\n}: ServerFormProps) => {\n const { t } = useTranslation();\n\n // Determine the initial server type from the initialData\n const getInitialServerType = () => {\n if (!initialData || !initialData.config) return 'stdio';\n\n if (initialData.config.type) {\n return initialData.config.type; // Use explicit type if available\n } else if (initialData.config.url) {\n return 'sse'; // Fallback to SSE if URL exists\n } else {\n return 'stdio'; // Default to stdio\n }\n };\n\n const getInitialServerEnvVars = (data: Server | null): EnvVar[] => {\n if (!data || !data.config || !data.config.env) return [];\n\n return Object.entries(data.config.env).map(([key, value]) => ({\n key,\n value,\n description: '', // You can set a default description if needed\n }));\n };\n\n const getInitialOAuthConfig = (data: Server | null): ServerFormData['oauth'] => {\n const oauth = data?.config?.oauth;\n return {\n clientId: oauth?.clientId || '',\n clientSecret: oauth?.clientSecret || '',\n scopes: oauth?.scopes ? oauth.scopes.join(' ') : '',\n accessToken: oauth?.accessToken || '',\n refreshToken: oauth?.refreshToken || '',\n authorizationEndpoint: oauth?.authorizationEndpoint || '',\n tokenEndpoint: oauth?.tokenEndpoint || '',\n resource: oauth?.resource || '',\n };\n };\n\n const [serverType, setServerType] = useState<'stdio' | 'sse' | 'streamable-http' | 'openapi'>(\n getInitialServerType(),\n );\n\n const [formData, setFormData] = useState<ServerFormData>({\n name: (initialData && initialData.name) || '',\n description: (initialData && initialData.config && initialData.config.description) || '',\n url: (initialData && initialData.config && initialData.config.url) || '',\n command: (initialData && initialData.config && initialData.config.command) || '',\n arguments:\n initialData && initialData.config && initialData.config.args\n ? Array.isArray(initialData.config.args)\n ? initialData.config.args.join(' ')\n : String(initialData.config.args)\n : '',\n args: (initialData && initialData.config && initialData.config.args) || [],\n type: getInitialServerType(), // Initialize the type field\n env: getInitialServerEnvVars(initialData),\n headers: [],\n passthroughHeaders:\n initialData?.config?.passthroughHeaders?.join(', ') || '',\n visibility: (initialData?.config?.visibility ?? 'private') as\n | 'private'\n | 'group'\n | 'public',\n options: {\n timeout:\n (initialData &&\n initialData.config &&\n initialData.config.options &&\n initialData.config.options.timeout) ||\n 60000,\n resetTimeoutOnProgress:\n initialData?.config?.options?.resetTimeoutOnProgress ?? true,\n maxTotalTimeout:\n (initialData &&\n initialData.config &&\n initialData.config.options &&\n initialData.config.options.maxTotalTimeout) ||\n undefined,\n },\n oauth: getInitialOAuthConfig(initialData),\n // KeepAlive configuration initialization\n keepAlive: {\n enabled: initialData?.config?.enableKeepAlive || false,\n interval: initialData?.config?.keepAliveInterval || 60000,\n },\n // OpenAPI configuration initialization\n openapi:\n initialData && initialData.config && initialData.config.openapi\n ? {\n url: initialData.config.openapi.url || '',\n schema: initialData.config.openapi.schema\n ? JSON.stringify(initialData.config.openapi.schema, null, 2)\n : '',\n inputMode: initialData.config.openapi.url\n ? 'url'\n : initialData.config.openapi.schema\n ? 'schema'\n : 'url',\n version: initialData.config.openapi.version || '3.1.0',\n securityType: initialData.config.openapi.security?.type || 'none',\n // API Key initialization\n apiKeyName: initialData.config.openapi.security?.apiKey?.name || '',\n apiKeyIn: initialData.config.openapi.security?.apiKey?.in || 'header',\n apiKeyValue: initialData.config.openapi.security?.apiKey?.value || '',\n // HTTP auth initialization\n httpScheme: initialData.config.openapi.security?.http?.scheme || 'bearer',\n httpCredentials: initialData.config.openapi.security?.http?.credentials || '',\n // OAuth2 initialization\n oauth2TokenUrl: initialData.config.openapi.security?.oauth2?.tokenUrl || '',\n oauth2ClientId: initialData.config.openapi.security?.oauth2?.clientId || '',\n oauth2ClientSecret: initialData.config.openapi.security?.oauth2?.clientSecret || '',\n oauth2Token: initialData.config.openapi.security?.oauth2?.token || '',\n // OpenID Connect initialization\n openIdConnectUrl: initialData.config.openapi.security?.openIdConnect?.url || '',\n openIdConnectToken: initialData.config.openapi.security?.openIdConnect?.token || '',\n // Passthrough headers initialization\n passthroughHeaders: initialData.config.openapi.passthroughHeaders\n ? initialData.config.openapi.passthroughHeaders.join(', ')\n : '',\n }\n : {\n inputMode: 'url',\n url: '',\n schema: '',\n version: '3.1.0',\n securityType: 'none',\n passthroughHeaders: '',\n },\n });\n\n const [envVars, setEnvVars] = useState<EnvVar[]>(\n initialData && initialData.config && initialData.config.env\n ? Object.entries(initialData.config.env).map(([key, value]) => ({ key, value }))\n : [],\n );\n\n const [headerVars, setHeaderVars] = useState<EnvVar[]>(\n initialData && initialData.config && initialData.config.headers\n ? Object.entries(initialData.config.headers).map(([key, value]) => ({ key, value }))\n : [],\n );\n\n const [isRequestOptionsExpanded, setIsRequestOptionsExpanded] = useState<boolean>(false);\n const [isOAuthSectionExpanded, setIsOAuthSectionExpanded] = useState<boolean>(false);\n const [isKeepAliveSectionExpanded, setIsKeepAliveSectionExpanded] = useState<boolean>(false);\n const [error, setError] = useState<string | null>(null);\n const isEdit = !!initialData;\n\n const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const { name, value } = e.target;\n setFormData({ ...formData, [name]: value });\n };\n\n // Transform space-separated arguments string into array\n const handleArgsChange = (value: string) => {\n const args = value.split(' ').filter((arg) => arg.trim() !== '');\n setFormData({ ...formData, arguments: value, args });\n };\n\n const updateServerType = (type: 'stdio' | 'sse' | 'streamable-http' | 'openapi') => {\n setServerType(type);\n setFormData((prev) => ({ ...prev, type }));\n };\n\n const handleEnvVarChange = (index: number, field: 'key' | 'value', value: string) => {\n const newEnvVars = [...envVars];\n newEnvVars[index][field] = value;\n setEnvVars(newEnvVars);\n };\n\n const addEnvVar = () => {\n setEnvVars([...envVars, { key: '', value: '' }]);\n };\n\n const removeEnvVar = (index: number) => {\n const newEnvVars = [...envVars];\n newEnvVars.splice(index, 1);\n setEnvVars(newEnvVars);\n };\n\n const handleHeaderVarChange = (index: number, field: 'key' | 'value', value: string) => {\n const newHeaderVars = [...headerVars];\n newHeaderVars[index][field] = value;\n setHeaderVars(newHeaderVars);\n };\n\n const addHeaderVar = () => {\n setHeaderVars([...headerVars, { key: '', value: '' }]);\n };\n\n const removeHeaderVar = (index: number) => {\n const newHeaderVars = [...headerVars];\n newHeaderVars.splice(index, 1);\n setHeaderVars(newHeaderVars);\n };\n\n const handleOAuthChange = <K extends keyof NonNullable<ServerFormData['oauth']>>(\n field: K,\n value: string,\n ) => {\n setFormData((prev) => ({\n ...prev,\n oauth: {\n ...(prev.oauth || {}),\n [field]: value,\n },\n }));\n };\n\n // Handle options changes\n const handleOptionsChange = (\n field: 'timeout' | 'resetTimeoutOnProgress' | 'maxTotalTimeout',\n value: number | boolean | undefined,\n ) => {\n setFormData((prev) => ({\n ...prev,\n options: {\n ...prev.options,\n [field]: value,\n },\n }));\n };\n\n // Submit handler for server configuration\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n setError(null);\n\n try {\n const payload = buildServerPayload({\n formData,\n serverType,\n envVars,\n headerVars,\n });\n\n onSubmit(payload);\n } catch (err) {\n setError(`Error: ${err instanceof Error ? err.message : String(err)}`);\n }\n };\n\n return (\n <div className=\"hub-card p-6 w-full max-w-3xl max-h-screen overflow-y-auto\">\n <div className=\"flex justify-between items-center mb-5\">\n <h2 className=\"text-lg font-semibold text-[var(--hub-ink)]\">{modalTitle}</h2>\n <button\n onClick={onCancel}\n className=\"hub-icon-btn\"\n aria-label=\"Close\"\n >\n <X size={16} />\n </button>\n </div>\n\n {(error || formError) && (\n <div className=\"bg-red-50 text-red-700 p-3 rounded mb-4\">{formError || error}</div>\n )}\n\n <form onSubmit={handleSubmit}>\n <div className=\"mb-4\">\n <label className=\"block text-sm font-medium mb-1.5 text-[var(--hub-ink-2)]\" htmlFor=\"name\">\n {t('server.name')}\n </label>\n <input\n type=\"text\"\n name=\"name\"\n id=\"name\"\n value={formData.name}\n onChange={handleInputChange}\n className=\"w-full py-2 px-3 form-input\"\n placeholder=\"e.g.: time-mcp\"\n required\n />\n </div>\n\n <div className=\"mb-4\">\n <label className=\"block text-sm font-medium mb-1.5 text-[var(--hub-ink-2)]\" htmlFor=\"description\">\n {t('server.description')}\n </label>\n <input\n type=\"text\"\n name=\"description\"\n id=\"description\"\n value={formData.description || ''}\n onChange={handleInputChange}\n className=\"w-full py-2 px-3 form-input\"\n placeholder={t('server.descriptionPlaceholder')}\n />\n </div>\n\n <div className=\"mb-4\">\n <label className=\"block text-sm font-medium mb-1.5 text-[var(--hub-ink-2)]\" htmlFor=\"visibility\">\n {t('server.visibility', 'Visibility')}\n </label>\n <select\n id=\"visibility\"\n name=\"visibility\"\n value={formData.visibility || 'private'}\n onChange={(e) =>\n setFormData((prev) => ({\n ...prev,\n visibility: e.target.value as 'private' | 'group' | 'public',\n }))\n }\n className=\"w-full py-2 px-3 form-input\"\n >\n <option value=\"private\">\n {t('server.visibilityPrivate', 'Private — only the owner and admins')}\n </option>\n {formData.visibility === 'group' && (\n // 'group' is a reserved enum value; the filter doesn't yet honour it.\n // Surface it as a disabled option so a server pre-set to 'group' (e.g.\n // via direct DB update or a future user→group migration) renders\n // intelligibly rather than silently falling back to 'private' in the UI.\n <option value=\"group\" disabled>\n {t('server.visibilityGroup', 'Group (reserved — not yet implemented)')}\n </option>\n )}\n <option value=\"public\">\n {t('server.visibilityPublic', 'Public — every authenticated user')}\n </option>\n </select>\n <p className=\"text-xs text-gray-500 mt-1\">\n {t(\n 'server.visibilityDescription',\n \"Controls which non-admin users see this server in tools/list. Admins always see all servers regardless of this setting.\",\n )}\n </p>\n </div>\n\n <div className=\"mb-4\">\n <label className=\"block text-sm font-medium mb-1.5 text-[var(--hub-ink-2)]\">{t('server.type')}</label>\n <div className=\"flex space-x-4\">\n <div>\n <input\n type=\"radio\"\n id=\"command\"\n name=\"serverType\"\n value=\"command\"\n checked={serverType === 'stdio'}\n onChange={() => updateServerType('stdio')}\n className=\"mr-1\"\n />\n <label htmlFor=\"command\" className=\"text-[var(--hub-ink)]\">{t('server.typeStdio')}</label>\n </div>\n <div>\n <input\n type=\"radio\"\n id=\"url\"\n name=\"serverType\"\n value=\"url\"\n checked={serverType === 'sse'}\n onChange={() => updateServerType('sse')}\n className=\"mr-1\"\n />\n <label htmlFor=\"url\" className=\"text-[var(--hub-ink)]\">{t('server.typeSse')}</label>\n </div>\n <div>\n <input\n type=\"radio\"\n id=\"streamable-http\"\n name=\"serverType\"\n value=\"streamable-http\"\n checked={serverType === 'streamable-http'}\n onChange={() => updateServerType('streamable-http')}\n className=\"mr-1\"\n />\n <label htmlFor=\"streamable-http\" className=\"text-[var(--hub-ink)]\">{t('server.typeStreamableHttp')}</label>\n </div>\n <div>\n <input\n type=\"radio\"\n id=\"openapi\"\n name=\"serverType\"\n value=\"openapi\"\n checked={serverType === 'openapi'}\n onChange={() => updateServerType('openapi')}\n className=\"mr-1\"\n />\n <label htmlFor=\"openapi\" className=\"text-[var(--hub-ink)]\">{t('server.typeOpenapi')}</label>\n </div>\n </div>\n </div>\n\n {serverType === 'openapi' ? (\n <>\n {/* Input Mode Selection */}\n <div className=\"mb-4\">\n <label className=\"block text-sm font-medium mb-1.5 text-[var(--hub-ink-2)]\">\n {t('server.openapi.inputMode')}\n </label>\n <div className=\"flex space-x-4\">\n <div>\n <input\n type=\"radio\"\n id=\"input-mode-url\"\n name=\"inputMode\"\n value=\"url\"\n checked={formData.openapi?.inputMode === 'url'}\n onChange={() =>\n setFormData((prev) => ({\n ...prev,\n openapi: { ...prev.openapi!, inputMode: 'url' },\n }))\n }\n className=\"mr-1\"\n />\n <label htmlFor=\"input-mode-url\">{t('server.openapi.inputModeUrl')}</label>\n </div>\n <div>\n <input\n type=\"radio\"\n id=\"input-mode-schema\"\n name=\"inputMode\"\n value=\"schema\"\n checked={formData.openapi?.inputMode === 'schema'}\n onChange={() =>\n setFormData((prev) => ({\n ...prev,\n openapi: { ...prev.openapi!, inputMode: 'schema' },\n }))\n }\n className=\"mr-1\"\n />\n <label htmlFor=\"input-mode-schema\">{t('server.openapi.inputModeSchema')}</label>\n </div>\n </div>\n </div>\n\n {/* URL Input */}\n {formData.openapi?.inputMode === 'url' && (\n <div className=\"mb-4\">\n <label className=\"block text-sm font-medium mb-1.5 text-[var(--hub-ink-2)]\" htmlFor=\"openapi-url\">\n {t('server.openapi.specUrl')}\n </label>\n <input\n type=\"url\"\n name=\"openapi-url\"\n id=\"openapi-url\"\n value={formData.openapi?.url || ''}\n onChange={(e) =>\n setFormData((prev) => ({\n ...prev,\n openapi: { ...prev.openapi!, url: e.target.value },\n }))\n }\n className=\"w-full py-2 px-3 form-input\"\n placeholder=\"e.g.: https://api.example.com/openapi.json\"\n required={serverType === 'openapi' && formData.openapi?.inputMode === 'url'}\n />\n </div>\n )}\n\n {/* Schema Input */}\n {formData.openapi?.inputMode === 'schema' && (\n <div className=\"mb-4\">\n <label\n className=\"block text-sm font-medium mb-1.5 text-[var(--hub-ink-2)]\"\n htmlFor=\"openapi-schema\"\n >\n {t('server.openapi.schema')}\n </label>\n <textarea\n name=\"openapi-schema\"\n id=\"openapi-schema\"\n rows={10}\n value={formData.openapi?.schema || ''}\n onChange={(e) =>\n setFormData((prev) => ({\n ...prev,\n openapi: { ...prev.openapi!, schema: e.target.value },\n }))\n }\n className=\"w-full py-2 px-3 form-input font-mono text-sm\"\n placeholder={`{\n \"openapi\": \"3.1.0\",\n \"info\": {\n \"title\": \"API\",\n \"version\": \"1.0.0\"\n },\n \"servers\": [\n {\n \"url\": \"https://api.example.com\"\n }\n ],\n \"paths\": {\n ...\n }\n}`}\n required={serverType === 'openapi' && formData.openapi?.inputMode === 'schema'}\n />\n <p className=\"text-xs text-[var(--hub-ink-3)] mt-1\">{t('server.openapi.schemaHelp')}</p>\n </div>\n )}\n\n {/* Security Configuration */}\n <div className=\"mb-4\">\n <label className=\"block text-sm font-medium mb-1.5 text-[var(--hub-ink-2)]\">\n {t('server.openapi.security')}\n </label>\n <select\n value={formData.openapi?.securityType || 'none'}\n onChange={(e) =>\n setFormData((prev) => ({\n ...prev,\n openapi: {\n ...prev.openapi,\n securityType: e.target.value as any,\n url: prev.openapi?.url || '',\n },\n }))\n }\n className=\"w-full py-2 px-3 form-input\"\n >\n <option value=\"none\">{t('server.openapi.securityNone')}</option>\n <option value=\"apiKey\">{t('server.openapi.securityApiKey')}</option>\n <option value=\"http\">{t('server.openapi.securityHttp')}</option>\n <option value=\"oauth2\">{t('server.openapi.securityOAuth2')}</option>\n <option value=\"openIdConnect\">{t('server.openapi.securityOpenIdConnect')}</option>\n </select>\n </div>\n\n {/* API Key Configuration */}\n {formData.openapi?.securityType === 'apiKey' && (\n <div className=\"mb-4 p-4 border border-gray-200 dark:border-gray-700 rounded bg-gray-50 dark:bg-gray-800\">\n <h4 className=\"text-sm font-medium mb-3 text-[var(--hub-ink-2)]\">\n {t('server.openapi.apiKeyConfig')}\n </h4>\n <div className=\"grid grid-cols-1 md:grid-cols-3 gap-3\">\n <div>\n <label className=\"block text-xs text-[var(--hub-ink-2)] mb-1\">\n {t('server.openapi.apiKeyName')}\n </label>\n <input\n type=\"text\"\n value={formData.openapi?.apiKeyName || ''}\n onChange={(e) =>\n setFormData((prev) => ({\n ...prev,\n openapi: {\n ...prev.openapi,\n apiKeyName: e.target.value,\n url: prev.openapi?.url || '',\n },\n }))\n }\n className=\"w-full border rounded px-2 py-1 text-sm form-input focus:outline-none\"\n placeholder=\"Authorization\"\n />\n </div>\n <div>\n <label className=\"block text-xs text-[var(--hub-ink-2)] mb-1\">\n {t('server.openapi.apiKeyIn')}\n </label>\n <select\n value={formData.openapi?.apiKeyIn || 'header'}\n onChange={(e) =>\n setFormData((prev) => ({\n ...prev,\n openapi: {\n ...prev.openapi,\n apiKeyIn: e.target.value as any,\n url: prev.openapi?.url || '',\n },\n }))\n }\n className=\"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input\"\n >\n <option value=\"header\">{t('server.openapi.apiKeyInHeader')}</option>\n <option value=\"query\">{t('server.openapi.apiKeyInQuery')}</option>\n <option value=\"cookie\">{t('server.openapi.apiKeyInCookie')}</option>\n </select>\n </div>\n <div>\n <label className=\"block text-xs text-gray-600 mb-1\">\n {t('server.openapi.apiKeyValue')}\n </label>\n <input\n type=\"password\"\n value={formData.openapi?.apiKeyValue || ''}\n onChange={(e) =>\n setFormData((prev) => ({\n ...prev,\n openapi: {\n ...prev.openapi,\n apiKeyValue: e.target.value,\n url: prev.openapi?.url || '',\n },\n }))\n }\n className=\"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input\"\n placeholder=\"your-api-key\"\n />\n </div>\n </div>\n </div>\n )}\n\n {/* HTTP Authentication Configuration */}\n {formData.openapi?.securityType === 'http' && (\n <div className=\"mb-4 p-4 border border-gray-200 dark:border-gray-700 rounded bg-gray-50 dark:bg-gray-800\">\n <h4 className=\"text-sm font-medium mb-3 text-gray-700 dark:text-gray-300\">\n {t('server.openapi.httpAuthConfig')}\n </h4>\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-3\">\n <div>\n <label className=\"block text-xs text-gray-600 mb-1\">\n {t('server.openapi.httpScheme')}\n </label>\n <select\n value={formData.openapi?.httpScheme || 'bearer'}\n onChange={(e) =>\n setFormData((prev) => ({\n ...prev,\n openapi: {\n ...prev.openapi,\n httpScheme: e.target.value as any,\n url: prev.openapi?.url || '',\n },\n }))\n }\n className=\"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input\"\n >\n <option value=\"basic\">{t('server.openapi.httpSchemeBasic')}</option>\n <option value=\"bearer\">{t('server.openapi.httpSchemeBearer')}</option>\n <option value=\"digest\">{t('server.openapi.httpSchemeDigest')}</option>\n </select>\n </div>\n <div>\n <label className=\"block text-xs text-gray-600 mb-1\">\n {t('server.openapi.httpCredentials')}\n </label>\n <input\n type=\"password\"\n value={formData.openapi?.httpCredentials || ''}\n onChange={(e) =>\n setFormData((prev) => ({\n ...prev,\n openapi: {\n ...prev.openapi,\n httpCredentials: e.target.value,\n url: prev.openapi?.url || '',\n },\n }))\n }\n className=\"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input\"\n placeholder={\n formData.openapi?.httpScheme === 'basic'\n ? 'base64-encoded-credentials'\n : 'bearer-token'\n }\n />\n </div>\n </div>\n </div>\n )}\n\n {/* OAuth2 Configuration */}\n {formData.openapi?.securityType === 'oauth2' && (\n <div className=\"mb-4 p-4 border border-gray-200 dark:border-gray-700 rounded bg-gray-50 dark:bg-gray-800\">\n <h4 className=\"text-sm font-medium mb-3 text-gray-700 dark:text-gray-300\">\n {t('server.openapi.oauth2Config')}\n </h4>\n <div className=\"grid grid-cols-1 gap-3\">\n <div>\n <label className=\"block text-xs text-gray-600 mb-1\">\n {t('server.oauth.tokenEndpoint')}\n </label>\n <input\n type=\"url\"\n value={formData.openapi?.oauth2TokenUrl || ''}\n onChange={(e) =>\n setFormData((prev) => ({\n ...prev,\n openapi: {\n ...prev.openapi,\n oauth2TokenUrl: e.target.value,\n url: prev.openapi?.url || '',\n },\n }))\n }\n className=\"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input\"\n placeholder=\"https://example.com/oauth/token\"\n />\n </div>\n <div>\n <label className=\"block text-xs text-gray-600 mb-1\">\n {t('server.oauth.clientId')}\n </label>\n <input\n type=\"text\"\n value={formData.openapi?.oauth2ClientId || ''}\n onChange={(e) =>\n setFormData((prev) => ({\n ...prev,\n openapi: {\n ...prev.openapi,\n oauth2ClientId: e.target.value,\n url: prev.openapi?.url || '',\n },\n }))\n }\n className=\"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input\"\n placeholder=\"client-id\"\n />\n </div>\n <div>\n <label className=\"block text-xs text-gray-600 mb-1\">\n {t('server.oauth.clientSecret')}\n </label>\n <input\n type=\"password\"\n value={formData.openapi?.oauth2ClientSecret || ''}\n onChange={(e) =>\n setFormData((prev) => ({\n ...prev,\n openapi: {\n ...prev.openapi,\n oauth2ClientSecret: e.target.value,\n url: prev.openapi?.url || '',\n },\n }))\n }\n className=\"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input\"\n placeholder=\"client-secret\"\n />\n </div>\n <div>\n <label className=\"block text-xs text-gray-600 mb-1\">\n {t('server.openapi.oauth2Token')}\n </label>\n <input\n type=\"password\"\n value={formData.openapi?.oauth2Token || ''}\n onChange={(e) =>\n setFormData((prev) => ({\n ...prev,\n openapi: {\n ...prev.openapi,\n oauth2Token: e.target.value,\n url: prev.openapi?.url || '',\n },\n }))\n }\n className=\"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input\"\n placeholder=\"access-token\"\n />\n </div>\n </div>\n </div>\n )}\n\n {/* OpenID Connect Configuration */}\n {formData.openapi?.securityType === 'openIdConnect' && (\n <div className=\"mb-4 p-4 border border-gray-200 dark:border-gray-700 rounded bg-gray-50 dark:bg-gray-800\">\n <h4 className=\"text-sm font-medium mb-3 text-gray-700 dark:text-gray-300\">\n {t('server.openapi.openIdConnectConfig')}\n </h4>\n <div className=\"grid grid-cols-1 gap-3\">\n <div>\n <label className=\"block text-xs text-gray-600 mb-1\">\n {t('server.openapi.openIdConnectUrl')}\n </label>\n <input\n type=\"url\"\n value={formData.openapi?.openIdConnectUrl || ''}\n onChange={(e) =>\n setFormData((prev) => ({\n ...prev,\n openapi: {\n ...prev.openapi,\n openIdConnectUrl: e.target.value,\n url: prev.openapi?.url || '',\n },\n }))\n }\n className=\"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input\"\n placeholder=\"https://example.com/.well-known/openid_configuration\"\n />\n </div>\n <div>\n <label className=\"block text-xs text-gray-600 mb-1\">\n {t('server.openapi.openIdConnectToken')}\n </label>\n <input\n type=\"password\"\n value={formData.openapi?.openIdConnectToken || ''}\n onChange={(e) =>\n setFormData((prev) => ({\n ...prev,\n openapi: {\n ...prev.openapi,\n openIdConnectToken: e.target.value,\n url: prev.openapi?.url || '',\n },\n }))\n }\n className=\"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input\"\n placeholder=\"id-token\"\n />\n </div>\n </div>\n </div>\n )}\n\n {/* Passthrough Headers Configuration */}\n <div className=\"mb-4\">\n <label className=\"block text-sm font-medium mb-1.5 text-gray-700 dark:text-gray-300\">\n {t('server.openapi.passthroughHeaders')}\n </label>\n <input\n type=\"text\"\n value={formData.openapi?.passthroughHeaders || ''}\n onChange={(e) =>\n setFormData((prev) => ({\n ...prev,\n openapi: {\n ...prev.openapi,\n passthroughHeaders: e.target.value,\n url: prev.openapi?.url || '',\n },\n }))\n }\n className=\"w-full py-2 px-3 form-input\"\n placeholder=\"Authorization, X-API-Key, X-Custom-Header\"\n />\n <p className=\"text-xs text-gray-500 mt-1\">\n {t('server.openapi.passthroughHeadersHelp')}\n </p>\n </div>\n\n <div className=\"mb-4\">\n <div className=\"flex justify-between items-center mb-2\">\n <label className=\"block text-sm font-medium text-gray-700 dark:text-gray-300\">\n {t('server.headers')}\n </label>\n <button\n type=\"button\"\n onClick={addHeaderVar}\n className=\"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] btn-primary\"\n >\n +\n </button>\n </div>\n {headerVars.map((headerVar, index) => (\n <div key={index} className=\"flex items-center mb-2\">\n <div className=\"flex items-center space-x-2 flex-grow\">\n <input\n type=\"text\"\n value={headerVar.key}\n onChange={(e) => handleHeaderVarChange(index, 'key', e.target.value)}\n className=\"w-1/2 py-2 px-3 form-input\"\n placeholder=\"Authorization\"\n />\n <span className=\"flex items-center\">:</span>\n <input\n type=\"text\"\n value={headerVar.value}\n onChange={(e) => handleHeaderVarChange(index, 'value', e.target.value)}\n className=\"w-1/2 py-2 px-3 form-input\"\n placeholder=\"Bearer token...\"\n />\n </div>\n <button\n type=\"button\"\n onClick={() => removeHeaderVar(index)}\n className=\"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] ml-2 btn-danger\"\n >\n -\n </button>\n </div>\n ))}\n </div>\n </>\n ) : serverType === 'sse' || serverType === 'streamable-http' ? (\n <>\n <div className=\"mb-4\">\n <label className=\"block text-sm font-medium mb-1.5 text-gray-700 dark:text-gray-300\" htmlFor=\"url\">\n {t('server.url')}\n </label>\n <input\n type=\"url\"\n name=\"url\"\n id=\"url\"\n value={formData.url}\n onChange={handleInputChange}\n className=\"w-full py-2 px-3 form-input\"\n placeholder={\n serverType === 'streamable-http'\n ? 'e.g.: http://localhost:3000/mcp'\n : 'e.g.: http://localhost:3000/sse'\n }\n required={serverType === 'sse' || serverType === 'streamable-http'}\n />\n </div>\n\n <div className=\"mb-4\">\n <div className=\"flex justify-between items-center mb-2\">\n <label className=\"block text-sm font-medium text-gray-700 dark:text-gray-300\">\n {t('server.headers')}\n </label>\n <button\n type=\"button\"\n onClick={addHeaderVar}\n className=\"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] btn-primary\"\n >\n +\n </button>\n </div>\n {headerVars.map((headerVar, index) => (\n <div key={index} className=\"flex items-center mb-2\">\n <div className=\"flex items-center space-x-2 flex-grow\">\n <input\n type=\"text\"\n value={headerVar.key}\n onChange={(e) => handleHeaderVarChange(index, 'key', e.target.value)}\n className=\"w-1/2 py-2 px-3 form-input\"\n placeholder=\"Authorization\"\n />\n <span className=\"flex items-center\">:</span>\n <input\n type=\"text\"\n value={headerVar.value}\n onChange={(e) => handleHeaderVarChange(index, 'value', e.target.value)}\n className=\"w-1/2 py-2 px-3 form-input\"\n placeholder=\"Bearer token...\"\n />\n </div>\n <button\n type=\"button\"\n onClick={() => removeHeaderVar(index)}\n className=\"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] ml-2 btn-danger\"\n >\n -\n </button>\n </div>\n ))}\n </div>\n\n <div className=\"mb-4\">\n <label className=\"block text-sm font-medium mb-1.5 text-gray-700 dark:text-gray-300\">\n {t('server.openapi.passthroughHeaders')}\n </label>\n <input\n type=\"text\"\n value={formData.passthroughHeaders || ''}\n onChange={(e) =>\n setFormData((prev) => ({\n ...prev,\n passthroughHeaders: e.target.value,\n }))\n }\n className=\"w-full py-2 px-3 form-input\"\n placeholder=\"Authorization, X-Custom-User-Id\"\n />\n <p className=\"text-xs text-gray-500 mt-1\">\n {t('server.openapi.passthroughHeadersHelp')}\n </p>\n </div>\n\n <div className=\"mb-4\">\n <div className=\"flex justify-between items-center mb-2\">\n <label className=\"block text-sm font-medium text-gray-700 dark:text-gray-300\">\n {t('server.envVars')}\n </label>\n <button\n type=\"button\"\n onClick={addEnvVar}\n className=\"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] btn-primary\"\n >\n +\n </button>\n </div>\n {envVars.map((envVar, index) => (\n <div key={index} className=\"flex items-center mb-2\">\n <div className=\"flex items-center space-x-2 flex-grow\">\n <input\n type=\"text\"\n value={envVar.key}\n onChange={(e) => handleEnvVarChange(index, 'key', e.target.value)}\n className=\"w-1/2 py-2 px-3 form-input\"\n placeholder={t('server.key')}\n />\n <span className=\"flex items-center\">:</span>\n <input\n type=\"text\"\n value={envVar.value}\n onChange={(e) => handleEnvVarChange(index, 'value', e.target.value)}\n className=\"w-1/2 py-2 px-3 form-input\"\n placeholder={t('server.value')}\n />\n </div>\n <button\n type=\"button\"\n onClick={() => removeEnvVar(index)}\n className=\"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] ml-2 btn-danger\"\n >\n -\n </button>\n </div>\n ))}\n </div>\n\n <div className=\"mb-4\">\n <div\n className=\"flex items-center justify-between cursor-pointer bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 p-3 rounded border border-gray-200 dark:border-gray-700\"\n onClick={() => setIsOAuthSectionExpanded(!isOAuthSectionExpanded)}\n >\n <label className=\"text-sm font-medium text-gray-700 dark:text-gray-300\">\n {t('server.oauth.sectionTitle')}\n </label>\n <span className=\"text-gray-500 text-sm\">{isOAuthSectionExpanded ? '▼' : '▶'}</span>\n </div>\n\n {isOAuthSectionExpanded && (\n <div className=\"border border-gray-200 dark:border-gray-700 rounded-b p-4 bg-gray-50 dark:bg-gray-800 border-t-0\">\n <p className=\"text-xs text-gray-500 mb-3\">\n {t('server.oauth.sectionDescription')}\n </p>\n <div className=\"grid grid-cols-1 gap-3 md:grid-cols-2\">\n <div>\n <label className=\"block text-xs text-gray-600 mb-1\">\n {t('server.oauth.clientId')}\n </label>\n <input\n type=\"text\"\n value={formData.oauth?.clientId || ''}\n onChange={(e) => handleOAuthChange('clientId', e.target.value)}\n className=\"w-full py-2 px-3 form-input\"\n placeholder=\"client id\"\n autoComplete=\"off\"\n />\n </div>\n <div>\n <label className=\"block text-xs text-gray-600 mb-1\">\n {t('server.oauth.clientSecret')}\n </label>\n <input\n type=\"password\"\n value={formData.oauth?.clientSecret || ''}\n onChange={(e) => handleOAuthChange('clientSecret', e.target.value)}\n className=\"w-full py-2 px-3 form-input\"\n placeholder=\"client secret\"\n autoComplete=\"off\"\n />\n </div>\n {/* \n <div>\n <label className=\"block text-xs text-gray-600 mb-1\">\n {t('server.oauth.authorizationEndpoint')}\n </label>\n <input\n type=\"url\"\n value={formData.oauth?.authorizationEndpoint || ''}\n onChange={(e) => handleOAuthChange('authorizationEndpoint', e.target.value)}\n className=\"w-full py-2 px-3 form-input\"\n placeholder=\"https://auth.example.com/authorize\"\n />\n </div>\n <div>\n <label className=\"block text-xs text-gray-600 mb-1\">\n {t('server.oauth.tokenEndpoint')}\n </label>\n <input\n type=\"url\"\n value={formData.oauth?.tokenEndpoint || ''}\n onChange={(e) => handleOAuthChange('tokenEndpoint', e.target.value)}\n className=\"w-full py-2 px-3 form-input\"\n placeholder=\"https://auth.example.com/token\"\n />\n </div>\n <div>\n <label className=\"block text-xs text-gray-600 mb-1\">\n {t('server.oauth.scopes')}\n </label>\n <input\n type=\"text\"\n value={formData.oauth?.scopes || ''}\n onChange={(e) => handleOAuthChange('scopes', e.target.value)}\n className=\"w-full py-2 px-3 form-input\"\n placeholder={t('server.oauth.scopesPlaceholder')}\n autoComplete=\"off\"\n />\n </div>\n <div>\n <label className=\"block text-xs text-gray-600 mb-1\">\n {t('server.oauth.resource')}\n </label>\n <input\n type=\"text\"\n value={formData.oauth?.resource || ''}\n onChange={(e) => handleOAuthChange('resource', e.target.value)}\n className=\"w-full py-2 px-3 form-input\"\n placeholder=\"https://mcp.example.com/mcp\"\n autoComplete=\"off\"\n />\n </div>\n <div>\n <label className=\"block text-xs text-gray-600 mb-1\">\n {t('server.oauth.accessToken')}\n </label>\n <input\n type=\"password\"\n value={formData.oauth?.accessToken || ''}\n onChange={(e) => handleOAuthChange('accessToken', e.target.value)}\n className=\"w-full py-2 px-3 form-input\"\n placeholder=\"access-token\"\n autoComplete=\"off\"\n />\n </div>\n <div>\n <label className=\"block text-xs text-gray-600 mb-1\">\n {t('server.oauth.refreshToken')}\n </label>\n <input\n type=\"password\"\n value={formData.oauth?.refreshToken || ''}\n onChange={(e) => handleOAuthChange('refreshToken', e.target.value)}\n className=\"w-full py-2 px-3 form-input\"\n placeholder=\"refresh-token\"\n autoComplete=\"off\"\n />\n </div>\n */}\n </div>\n </div>\n )}\n </div>\n </>\n ) : (\n <>\n <div className=\"mb-4\">\n <label className=\"block text-sm font-medium mb-1.5 text-gray-700 dark:text-gray-300\" htmlFor=\"command\">\n {t('server.command')}\n </label>\n <input\n type=\"text\"\n name=\"command\"\n id=\"command\"\n value={formData.command}\n onChange={handleInputChange}\n className=\"w-full py-2 px-3 form-input\"\n placeholder=\"e.g.: npx\"\n required={serverType === 'stdio'}\n />\n </div>\n <div className=\"mb-4\">\n <label className=\"block text-sm font-medium mb-1.5 text-gray-700 dark:text-gray-300\" htmlFor=\"arguments\">\n {t('server.arguments')}\n </label>\n <input\n type=\"text\"\n name=\"arguments\"\n id=\"arguments\"\n value={formData.arguments}\n onChange={(e) => handleArgsChange(e.target.value)}\n className=\"w-full py-2 px-3 form-input\"\n placeholder=\"e.g.: -y time-mcp\"\n required={serverType === 'stdio'}\n />\n </div>\n\n <div className=\"mb-4\">\n <div className=\"flex justify-between items-center mb-2\">\n <label className=\"block text-sm font-medium text-gray-700 dark:text-gray-300\">\n {t('server.envVars')}\n </label>\n <button\n type=\"button\"\n onClick={addEnvVar}\n className=\"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] btn-primary\"\n >\n +\n </button>\n </div>\n {envVars.map((envVar, index) => (\n <div key={index} className=\"flex items-center mb-2\">\n <div className=\"flex items-center space-x-2 flex-grow\">\n <input\n type=\"text\"\n value={envVar.key}\n onChange={(e) => handleEnvVarChange(index, 'key', e.target.value)}\n className=\"w-1/2 py-2 px-3 form-input\"\n placeholder={t('server.key')}\n />\n <span className=\"flex items-center\">:</span>\n <input\n type=\"text\"\n value={envVar.value}\n onChange={(e) => handleEnvVarChange(index, 'value', e.target.value)}\n className=\"w-1/2 py-2 px-3 form-input\"\n placeholder={t('server.value')}\n />\n </div>\n <button\n type=\"button\"\n onClick={() => removeEnvVar(index)}\n className=\"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] ml-2 btn-danger\"\n >\n -\n </button>\n </div>\n ))}\n </div>\n </>\n )}\n\n {/* Request Options Configuration */}\n {serverType !== 'openapi' && (\n <div className=\"mb-4\">\n <div\n className=\"flex items-center justify-between cursor-pointer bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 p-3 rounded border border-gray-200 dark:border-gray-700\"\n onClick={() => setIsRequestOptionsExpanded(!isRequestOptionsExpanded)}\n >\n <label className=\"text-sm font-medium text-gray-700 dark:text-gray-300\">\n {t('server.requestOptions')}\n </label>\n <span className=\"text-gray-500 text-sm\">{isRequestOptionsExpanded ? '▼' : '▶'}</span>\n </div>\n\n {isRequestOptionsExpanded && (\n <div className=\"border border-gray-200 dark:border-gray-700 rounded-b p-4 bg-gray-50 dark:bg-gray-800 border-t-0\">\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n <div>\n <label\n className=\"block text-gray-600 text-sm font-medium mb-1\"\n htmlFor=\"timeout\"\n >\n {t('server.timeout')}\n </label>\n <input\n type=\"number\"\n id=\"timeout\"\n value={formData.options?.timeout || 60000}\n onChange={(e) =>\n handleOptionsChange('timeout', parseInt(e.target.value) || 60000)\n }\n className=\"w-full py-2 px-3 form-input\"\n placeholder=\"30000\"\n min=\"1000\"\n max=\"300000\"\n />\n <p className=\"text-xs text-gray-500 mt-1\">{t('server.timeoutDescription')}</p>\n </div>\n\n <div>\n <label\n className=\"block text-gray-600 text-sm font-medium mb-1\"\n htmlFor=\"maxTotalTimeout\"\n >\n {t('server.maxTotalTimeout')}\n </label>\n <input\n type=\"number\"\n id=\"maxTotalTimeout\"\n value={formData.options?.maxTotalTimeout || ''}\n onChange={(e) =>\n handleOptionsChange(\n 'maxTotalTimeout',\n e.target.value ? parseInt(e.target.value) : undefined,\n )\n }\n className=\"w-full py-2 px-3 form-input\"\n placeholder=\"Optional\"\n min=\"1000\"\n />\n <p className=\"text-xs text-gray-500 mt-1\">\n {t('server.maxTotalTimeoutDescription')}\n </p>\n </div>\n </div>\n\n <div className=\"mt-3\">\n <label className=\"flex items-center\">\n <input\n type=\"checkbox\"\n checked={formData.options?.resetTimeoutOnProgress ?? true}\n onChange={(e) =>\n handleOptionsChange('resetTimeoutOnProgress', e.target.checked)\n }\n className=\"mr-2\"\n />\n <span className=\"text-gray-600 text-sm\">\n {t('server.resetTimeoutOnProgress')}\n </span>\n </label>\n <p className=\"text-xs text-gray-500 mt-1 ml-6\">\n {t('server.resetTimeoutOnProgressDescription')}\n </p>\n </div>\n </div>\n )}\n </div>\n )}\n\n {/* KeepAlive Configuration - only for SSE/Streamable HTTP */}\n {(serverType === 'sse' || serverType === 'streamable-http') && (\n <div className=\"mb-4\">\n <div\n className=\"flex items-center justify-between cursor-pointer bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 p-3 rounded border border-gray-200 dark:border-gray-700\"\n onClick={() => setIsKeepAliveSectionExpanded(!isKeepAliveSectionExpanded)}\n >\n <label className=\"text-sm font-medium text-gray-700 dark:text-gray-300\">\n {t('server.keepAlive', 'Keep-Alive')}\n </label>\n <span className=\"text-gray-500 text-sm\">\n {isKeepAliveSectionExpanded ? '▼' : '▶'}\n </span>\n </div>\n\n {isKeepAliveSectionExpanded && (\n <div className=\"border border-gray-200 dark:border-gray-700 rounded-b p-4 bg-gray-50 dark:bg-gray-800 border-t-0\">\n <div className=\"flex items-center mb-3\">\n <input\n type=\"checkbox\"\n id=\"enableKeepAlive\"\n checked={formData.keepAlive?.enabled || false}\n onChange={(e) =>\n setFormData((prev) => ({\n ...prev,\n keepAlive: {\n ...prev.keepAlive,\n enabled: e.target.checked,\n },\n }))\n }\n className=\"mr-2\"\n />\n <label htmlFor=\"enableKeepAlive\" className=\"text-gray-600 text-sm\">\n {t('server.enableKeepAlive', 'Enable Keep-Alive')}\n </label>\n </div>\n <p className=\"text-xs text-gray-500 mb-3\">\n {t(\n 'server.keepAliveDescription',\n 'Send periodic ping requests to maintain the connection. Useful for long-running connections that may timeout.',\n )}\n </p>\n <div>\n <label\n className=\"block text-gray-600 text-sm font-medium mb-1\"\n htmlFor=\"keepAliveInterval\"\n >\n {t('server.keepAliveInterval', 'Interval (ms)')}\n </label>\n <input\n type=\"number\"\n id=\"keepAliveInterval\"\n value={formData.keepAlive?.interval || 60000}\n onChange={(e) =>\n setFormData((prev) => ({\n ...prev,\n keepAlive: {\n ...prev.keepAlive,\n interval: parseInt(e.target.value) || 60000,\n },\n }))\n }\n className=\"w-full py-2 px-3 form-input\"\n placeholder=\"60000\"\n min=\"5000\"\n max=\"300000\"\n />\n <p className=\"text-xs text-gray-500 mt-1\">\n {t(\n 'server.keepAliveIntervalDescription',\n 'Time between keep-alive pings in milliseconds (default: 60000ms = 1 minute)',\n )}\n </p>\n </div>\n </div>\n )}\n </div>\n )}\n\n <div className=\"flex justify-end mt-6\">\n <button\n type=\"button\"\n onClick={onCancel}\n className=\"hub-btn mr-2\"\n >\n {t('server.cancel')}\n </button>\n <button\n type=\"submit\"\n className=\"hub-btn primary\"\n >\n {isEdit ? t('server.save') : t('server.add')}\n </button>\n </div>\n </form>\n </div>\n );\n};\n\nexport default ServerForm;\n","// Utility function to detect ${} variables in server configurations\nexport const detectVariables = (payload: any): string[] => {\n const variables = new Set<string>();\n const variableRegex = /\\$\\{([^}]+)\\}/g;\n\n const checkString = (str: string) => {\n let match;\n while ((match = variableRegex.exec(str)) !== null) {\n variables.add(match[1]);\n }\n };\n\n const checkObject = (obj: any, path: string = '') => {\n if (typeof obj === 'string') {\n checkString(obj);\n } else if (Array.isArray(obj)) {\n obj.forEach((item, index) => checkObject(item, `${path}[${index}]`));\n } else if (obj && typeof obj === 'object') {\n Object.entries(obj).forEach(([key, value]) => {\n checkObject(value, path ? `${path}.${key}` : key);\n });\n }\n };\n\n checkObject(payload);\n return Array.from(variables);\n};\n"],"names":["buildKeyValueRecord","vars","record","key","value","trimmedKey","parseCommaSeparatedList","item","buildOptions","options","nextOptions","buildOAuthConfig","oauth","nextOAuth","clientId","_a","clientSecret","_b","scopes","_c","accessToken","_d","refreshToken","_e","authorizationEndpoint","_f","tokenEndpoint","_g","resource","_h","parsedScopes","scope","buildOpenApiConfig","formData","openapi","oauth2TokenUrl","oauth2ClientId","oauth2ClientSecret","oauth2Token","_j","_i","_k","_l","_m","_n","_o","buildServerPayload","serverType","envVars","headerVars","env","headers","description","config","ServerForm","onSubmit","onCancel","initialData","modalTitle","formError","useTranslation","getInitialServerType","getInitialServerEnvVars","data","getInitialOAuthConfig","setServerType","useState","setFormData","_p","_r","_q","_t","_s","_v","_u","_x","_w","_z","_y","_B","_A","_D","_C","setEnvVars","setHeaderVars","isRequestOptionsExpanded","setIsRequestOptionsExpanded","isOAuthSectionExpanded","setIsOAuthSectionExpanded","isKeepAliveSectionExpanded","setIsKeepAliveSectionExpanded","error","setError","isEdit","handleInputChange","e","name","handleArgsChange","args","arg","updateServerType","type","prev","handleEnvVarChange","index","field","newEnvVars","addEnvVar","removeEnvVar","handleHeaderVarChange","newHeaderVars","addHeaderVar","removeHeaderVar","handleOAuthChange","handleOptionsChange","handleSubmit","payload","err","jsxs","jsx","X","Fragment","_E","_F","_G","_H","_I","_J","_K","_L","_M","_N","_O","_P","_Q","_R","_S","_T","_U","_V","_W","_X","_Y","_Z","__","_$","_aa","_ba","headerVar","envVar","_ca","_da","_ea","_fa","_ga","_ha","_ia","detectVariables","variables","variableRegex","checkString","str","match","checkObject","obj","path"],"mappings":"yJAWA,MAAMA,GAAuBC,GAA2C,CACtE,MAAMC,EAAiC,CAAA,EAEvC,OAAAD,EAAK,QAAQ,CAAC,CAAE,IAAAE,EAAK,MAAAC,KAAY,CAC/B,MAAMC,EAAaF,EAAI,KAAA,EACnBE,IACFH,EAAOG,CAAU,EAAID,EAEzB,CAAC,EAEMF,CACT,EAEMI,GAA2BF,GAC1BA,EAIEA,EACJ,MAAM,GAAG,EACT,IAAKG,GAASA,EAAK,KAAA,CAAM,EACzB,OAAQA,GAASA,EAAK,OAAS,CAAC,EAN1B,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CAAA,CAC7C,CAAA,CACF,CAAA,CAAA,CACF,CAAA,EACF,CAEJ,ECv4CagE,GAAmBzC,GAA2B,CACzD,MAAM0C,MAAgB,IAChBC,EAAgB,iBAEhBC,EAAeC,GAAgB,CACnC,IAAIC,EACJ,MAAQA,EAAQH,EAAc,KAAKE,CAAG,KAAO,MAC3CH,EAAU,IAAII,EAAM,CAAC,CAAC,CAE1B,EAEMC,EAAc,CAACC,EAAUC,EAAe,KAAO,CAC/C,OAAOD,GAAQ,SACjBJ,EAAYI,CAAG,EACN,MAAM,QAAQA,CAAG,EAC1BA,EAAI,QAAQ,CAAC7J,EAAMiG,IAAU2D,EAAY5J,EAAM,GAAG8J,CAAI,IAAI7D,CAAK,GAAG,CAAC,EAC1D4D,GAAO,OAAOA,GAAQ,UAC/B,OAAO,QAAQA,CAAG,EAAE,QAAQ,CAAC,CAACjK,EAAKC,CAAK,IAAM,CAC5C+J,EAAY/J,EAAOiK,EAAO,GAAGA,CAAI,IAAIlK,CAAG,GAAKA,CAAG,CAClD,CAAC,CAEL,EAEA,OAAAgK,EAAY/C,CAAO,EACZ,MAAM,KAAK0C,CAAS,CAC7B"}
|
package/frontend/dist/index.html
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
10
10
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
11
11
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
|
12
|
-
<script type="module" crossorigin src="./assets/index-
|
|
12
|
+
<script type="module" crossorigin src="./assets/index-C7dQApMG.js"></script>
|
|
13
13
|
<link rel="modulepreload" crossorigin href="./assets/framework-vendor-BUhDPOUZ.js">
|
|
14
14
|
<link rel="modulepreload" crossorigin href="./assets/i18n-vendor-Kbr87Ofu.js">
|
|
15
15
|
<link rel="modulepreload" crossorigin href="./assets/icons-vendor-CKgJB3SC.js">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@samanhappy/mcphub",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "A hub server for mcp servers",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
"pg": "^8.16.3",
|
|
61
61
|
"pgvector": "^0.2.1",
|
|
62
62
|
"postgres": "^3.4.7",
|
|
63
|
+
"redis": "^5.12.1",
|
|
63
64
|
"reflect-metadata": "^0.2.2",
|
|
64
65
|
"typeorm": "^0.3.26",
|
|
65
66
|
"undici": "^7.16.0",
|