@samanhappy/mcphub 1.0.30 → 1.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (277) hide show
  1. package/dist/betterAuth.js +13 -5
  2. package/dist/betterAuth.js.map +1 -1
  3. package/dist/cli/commands/cache.js.map +1 -1
  4. package/dist/cli/commands/call.js +2 -2
  5. package/dist/cli/commands/call.js.map +1 -1
  6. package/dist/cli/commands/config.js.map +1 -1
  7. package/dist/cli/commands/discover.js.map +1 -1
  8. package/dist/cli/commands/export.js.map +1 -1
  9. package/dist/cli/commands/groups.js.map +1 -1
  10. package/dist/cli/commands/install.js +1 -1
  11. package/dist/cli/commands/install.js.map +1 -1
  12. package/dist/cli/commands/keys.js.map +1 -1
  13. package/dist/cli/commands/login.js.map +1 -1
  14. package/dist/cli/commands/servers.js.map +1 -1
  15. package/dist/cli/commands/tools.js +2 -2
  16. package/dist/cli/commands/tools.js.map +1 -1
  17. package/dist/cli/context.js +1 -1
  18. package/dist/cli/context.js.map +1 -1
  19. package/dist/cli/http.js +3 -1
  20. package/dist/cli/http.js.map +1 -1
  21. package/dist/clients/openapi.js +75 -7
  22. package/dist/clients/openapi.js.map +1 -1
  23. package/dist/config/DaoConfigService.js +3 -2
  24. package/dist/config/DaoConfigService.js.map +1 -1
  25. package/dist/config/configManager.js +11 -9
  26. package/dist/config/configManager.js.map +1 -1
  27. package/dist/config/index.js +32 -7
  28. package/dist/config/index.js.map +1 -1
  29. package/dist/config/jwt.js +2 -1
  30. package/dist/config/jwt.js.map +1 -1
  31. package/dist/config/migrationUtils.js +46 -45
  32. package/dist/config/migrationUtils.js.map +1 -1
  33. package/dist/constants/oauthServerDefaults.js.map +1 -1
  34. package/dist/controllers/activityController.js +6 -5
  35. package/dist/controllers/activityController.js.map +1 -1
  36. package/dist/controllers/authController.js +5 -4
  37. package/dist/controllers/authController.js.map +1 -1
  38. package/dist/controllers/bearerKeyController.js +7 -6
  39. package/dist/controllers/bearerKeyController.js.map +1 -1
  40. package/dist/controllers/betterAuthController.js +2 -1
  41. package/dist/controllers/betterAuthController.js.map +1 -1
  42. package/dist/controllers/builtinPromptController.js +13 -5
  43. package/dist/controllers/builtinPromptController.js.map +1 -1
  44. package/dist/controllers/builtinResourceController.js +14 -6
  45. package/dist/controllers/builtinResourceController.js.map +1 -1
  46. package/dist/controllers/changelogController.js +5 -2
  47. package/dist/controllers/changelogController.js.map +1 -1
  48. package/dist/controllers/cloudController.js +11 -10
  49. package/dist/controllers/cloudController.js.map +1 -1
  50. package/dist/controllers/configController.js +4 -3
  51. package/dist/controllers/configController.js.map +1 -1
  52. package/dist/controllers/contextCostController.js +3 -2
  53. package/dist/controllers/contextCostController.js.map +1 -1
  54. package/dist/controllers/groupController.js +2 -1
  55. package/dist/controllers/groupController.js.map +1 -1
  56. package/dist/controllers/healthController.js +2 -1
  57. package/dist/controllers/healthController.js.map +1 -1
  58. package/dist/controllers/hostedInternalController.js +2 -1
  59. package/dist/controllers/hostedInternalController.js.map +1 -1
  60. package/dist/controllers/logController.js +5 -4
  61. package/dist/controllers/logController.js.map +1 -1
  62. package/dist/controllers/mcpbController.js +17 -7
  63. package/dist/controllers/mcpbController.js.map +1 -1
  64. package/dist/controllers/oauthCallbackController.js +28 -27
  65. package/dist/controllers/oauthCallbackController.js.map +1 -1
  66. package/dist/controllers/oauthClientController.js +7 -6
  67. package/dist/controllers/oauthClientController.js.map +1 -1
  68. package/dist/controllers/oauthDynamicRegistrationController.js +22 -4
  69. package/dist/controllers/oauthDynamicRegistrationController.js.map +1 -1
  70. package/dist/controllers/oauthServerController.js +96 -10
  71. package/dist/controllers/oauthServerController.js.map +1 -1
  72. package/dist/controllers/openApiController.js +7 -6
  73. package/dist/controllers/openApiController.js.map +1 -1
  74. package/dist/controllers/promptController.js +2 -1
  75. package/dist/controllers/promptController.js.map +1 -1
  76. package/dist/controllers/registryController.js +4 -3
  77. package/dist/controllers/registryController.js.map +1 -1
  78. package/dist/controllers/serverController.js +46 -34
  79. package/dist/controllers/serverController.js.map +1 -1
  80. package/dist/controllers/templateController.js +2 -1
  81. package/dist/controllers/templateController.js.map +1 -1
  82. package/dist/controllers/toolController.js +2 -1
  83. package/dist/controllers/toolController.js.map +1 -1
  84. package/dist/dao/DaoFactory.js +3 -2
  85. package/dist/dao/DaoFactory.js.map +1 -1
  86. package/dist/dao/ServerDao.js.map +1 -1
  87. package/dist/dao/UserConfigDaoDbImpl.js.map +1 -1
  88. package/dist/dao/UserDao.js.map +1 -1
  89. package/dist/dao/base/JsonFileBaseDao.js +3 -2
  90. package/dist/dao/base/JsonFileBaseDao.js.map +1 -1
  91. package/dist/dao/examples.js +35 -34
  92. package/dist/dao/examples.js.map +1 -1
  93. package/dist/db/connection.js +59 -58
  94. package/dist/db/connection.js.map +1 -1
  95. package/dist/db/index.js +2 -1
  96. package/dist/db/index.js.map +1 -1
  97. package/dist/db/repositories/ServerRepository.js +3 -3
  98. package/dist/db/repositories/ServerRepository.js.map +1 -1
  99. package/dist/db/repositories/SystemConfigRepository.js +2 -1
  100. package/dist/db/repositories/SystemConfigRepository.js.map +1 -1
  101. package/dist/db/repositories/UserConfigRepository.js.map +1 -1
  102. package/dist/db/repositories/VectorEmbeddingRepository.js +6 -5
  103. package/dist/db/repositories/VectorEmbeddingRepository.js.map +1 -1
  104. package/dist/index.js +28 -19
  105. package/dist/index.js.map +1 -1
  106. package/dist/middlewares/auth.js +4 -3
  107. package/dist/middlewares/auth.js.map +1 -1
  108. package/dist/middlewares/index.js +2 -1
  109. package/dist/middlewares/index.js.map +1 -1
  110. package/dist/middlewares/userContext.js +7 -6
  111. package/dist/middlewares/userContext.js.map +1 -1
  112. package/dist/models/OAuth.js +7 -6
  113. package/dist/models/OAuth.js.map +1 -1
  114. package/dist/models/User.js +13 -12
  115. package/dist/models/User.js.map +1 -1
  116. package/dist/routes/index.js +9 -9
  117. package/dist/routes/index.js.map +1 -1
  118. package/dist/scripts/dao-demo.js +28 -27
  119. package/dist/scripts/dao-demo.js.map +1 -1
  120. package/dist/server.js +40 -30
  121. package/dist/server.js.map +1 -1
  122. package/dist/services/activityLoggingService.js +3 -2
  123. package/dist/services/activityLoggingService.js.map +1 -1
  124. package/dist/services/betterAuthConfig.js +1 -4
  125. package/dist/services/betterAuthConfig.js.map +1 -1
  126. package/dist/services/betterAuthSession.js +8 -7
  127. package/dist/services/betterAuthSession.js.map +1 -1
  128. package/dist/services/changelogService.js +5 -2
  129. package/dist/services/changelogService.js.map +1 -1
  130. package/dist/services/cloudService.js +10 -9
  131. package/dist/services/cloudService.js.map +1 -1
  132. package/dist/services/contextCostService.js +6 -2
  133. package/dist/services/contextCostService.js.map +1 -1
  134. package/dist/services/groupService.js +8 -7
  135. package/dist/services/groupService.js.map +1 -1
  136. package/dist/services/hostedAuthService.js +3 -2
  137. package/dist/services/hostedAuthService.js.map +1 -1
  138. package/dist/services/hostedControlPlaneClient.js.map +1 -1
  139. package/dist/services/hostedEventSubscriber.js +9 -8
  140. package/dist/services/hostedEventSubscriber.js.map +1 -1
  141. package/dist/services/hostedRuntimeCatalogNames.js +1 -3
  142. package/dist/services/hostedRuntimeCatalogNames.js.map +1 -1
  143. package/dist/services/keepAliveService.js +7 -6
  144. package/dist/services/keepAliveService.js.map +1 -1
  145. package/dist/services/marketService.js +2 -1
  146. package/dist/services/marketService.js.map +1 -1
  147. package/dist/services/mcpOAuthProvider.js +22 -21
  148. package/dist/services/mcpOAuthProvider.js.map +1 -1
  149. package/dist/services/mcpService.js +136 -123
  150. package/dist/services/mcpService.js.map +1 -1
  151. package/dist/services/oauthClientRegistration.js +30 -29
  152. package/dist/services/oauthClientRegistration.js.map +1 -1
  153. package/dist/services/oauthServerService.js +22 -17
  154. package/dist/services/oauthServerService.js.map +1 -1
  155. package/dist/services/oauthService.js +16 -15
  156. package/dist/services/oauthService.js.map +1 -1
  157. package/dist/services/oauthSettingsStore.js +4 -3
  158. package/dist/services/oauthSettingsStore.js.map +1 -1
  159. package/dist/services/openApiGeneratorService.js +1 -3
  160. package/dist/services/openApiGeneratorService.js.map +1 -1
  161. package/dist/services/registry.js +2 -1
  162. package/dist/services/registry.js.map +1 -1
  163. package/dist/services/requestContextService.js.map +1 -1
  164. package/dist/services/smartRoutingService.js +6 -5
  165. package/dist/services/smartRoutingService.js.map +1 -1
  166. package/dist/services/sseService.js +66 -55
  167. package/dist/services/sseService.js.map +1 -1
  168. package/dist/services/templateService.js +57 -12
  169. package/dist/services/templateService.js.map +1 -1
  170. package/dist/services/toolResultCompressionService.js +8 -5
  171. package/dist/services/toolResultCompressionService.js.map +1 -1
  172. package/dist/services/upstreamOAuthDisconnectService.js +9 -6
  173. package/dist/services/upstreamOAuthDisconnectService.js.map +1 -1
  174. package/dist/services/userService.js +5 -4
  175. package/dist/services/userService.js.map +1 -1
  176. package/dist/services/vectorSearchService.js +126 -112
  177. package/dist/services/vectorSearchService.js.map +1 -1
  178. package/dist/utils/abortIsolatingFetch.js +31 -0
  179. package/dist/utils/abortIsolatingFetch.js.map +1 -0
  180. package/dist/utils/basePath.js +13 -0
  181. package/dist/utils/basePath.js.map +1 -0
  182. package/dist/utils/cacheUtils.js +5 -4
  183. package/dist/utils/cacheUtils.js.map +1 -1
  184. package/dist/utils/corsOrigin.js +42 -0
  185. package/dist/utils/corsOrigin.js.map +1 -0
  186. package/dist/utils/dbRetry.js +2 -5
  187. package/dist/utils/dbRetry.js.map +1 -1
  188. package/dist/utils/frontendShell.js +89 -0
  189. package/dist/utils/frontendShell.js.map +1 -0
  190. package/dist/utils/i18n.js.map +1 -1
  191. package/dist/utils/logger.js +170 -0
  192. package/dist/utils/logger.js.map +1 -0
  193. package/dist/utils/migration.js +51 -50
  194. package/dist/utils/migration.js.map +1 -1
  195. package/dist/utils/oauthConsentResource.js +45 -0
  196. package/dist/utils/oauthConsentResource.js.map +1 -0
  197. package/dist/utils/parameterConversion.js +2 -1
  198. package/dist/utils/parameterConversion.js.map +1 -1
  199. package/dist/utils/path.js +9 -8
  200. package/dist/utils/path.js.map +1 -1
  201. package/dist/utils/proxyTrust.js.map +1 -1
  202. package/dist/utils/rateLimit.js +8 -0
  203. package/dist/utils/rateLimit.js.map +1 -1
  204. package/dist/utils/requireAdmin.js +15 -0
  205. package/dist/utils/requireAdmin.js.map +1 -0
  206. package/dist/utils/serverConfigPersistence.js.map +1 -1
  207. package/dist/utils/serverShutdown.js +3 -2
  208. package/dist/utils/serverShutdown.js.map +1 -1
  209. package/dist/utils/smartRouting.js +4 -3
  210. package/dist/utils/smartRouting.js.map +1 -1
  211. package/dist/utils/ssrf.js +19 -6
  212. package/dist/utils/ssrf.js.map +1 -1
  213. package/dist/utils/tokenCost.js.map +1 -1
  214. package/dist/utils/tokenTruncation.js +9 -4
  215. package/dist/utils/tokenTruncation.js.map +1 -1
  216. package/dist/utils/version.js +3 -2
  217. package/dist/utils/version.js.map +1 -1
  218. package/frontend/dist/assets/{ActivityPage-U9om5C9X.js → ActivityPage-C6m1hGLq.js} +2 -2
  219. package/frontend/dist/assets/{ActivityPage-U9om5C9X.js.map → ActivityPage-C6m1hGLq.js.map} +1 -1
  220. package/frontend/dist/assets/{ConfirmDialog-CYfXEuyU.js → ConfirmDialog-BCMNzi21.js} +2 -2
  221. package/frontend/dist/assets/{ConfirmDialog-CYfXEuyU.js.map → ConfirmDialog-BCMNzi21.js.map} +1 -1
  222. package/frontend/dist/assets/{Dashboard-DGqpU4bd.js → Dashboard-DFKfjPff.js} +2 -2
  223. package/frontend/dist/assets/{Dashboard-DGqpU4bd.js.map → Dashboard-DFKfjPff.js.map} +1 -1
  224. package/frontend/dist/assets/{DeleteDialog-DNe-zTEl.js → DeleteDialog-D9ycSRvn.js} +2 -2
  225. package/frontend/dist/assets/{DeleteDialog-DNe-zTEl.js.map → DeleteDialog-D9ycSRvn.js.map} +1 -1
  226. package/frontend/dist/assets/{EndpointCopy-DuGmhiMq.js → EndpointCopy-CP_Fb1To.js} +2 -2
  227. package/frontend/dist/assets/{EndpointCopy-DuGmhiMq.js.map → EndpointCopy-CP_Fb1To.js.map} +1 -1
  228. package/frontend/dist/assets/{GroupsPage-Dhqy02FY.js → GroupsPage-Cwfm5q-a.js} +3 -3
  229. package/frontend/dist/assets/{GroupsPage-Dhqy02FY.js.map → GroupsPage-Cwfm5q-a.js.map} +1 -1
  230. package/frontend/dist/assets/{LoginPage-BXRn47pC.js → LoginPage-CnF44h_n.js} +2 -2
  231. package/frontend/dist/assets/LoginPage-CnF44h_n.js.map +1 -0
  232. package/frontend/dist/assets/{LogsPage-CiO6LZEJ.js → LogsPage-BFIpICsM.js} +2 -2
  233. package/frontend/dist/assets/{LogsPage-CiO6LZEJ.js.map → LogsPage-BFIpICsM.js.map} +1 -1
  234. package/frontend/dist/assets/{MarketPage-BEdWfj0u.js → MarketPage-Du-NqiEl.js} +2 -2
  235. package/frontend/dist/assets/{MarketPage-BEdWfj0u.js.map → MarketPage-Du-NqiEl.js.map} +1 -1
  236. package/frontend/dist/assets/OAuthConsentPage-zqXUvKMF.js +2 -0
  237. package/frontend/dist/assets/OAuthConsentPage-zqXUvKMF.js.map +1 -0
  238. package/frontend/dist/assets/{Pagination-DLSuQ8hw.js → Pagination-Dwko3g48.js} +2 -2
  239. package/frontend/dist/assets/{Pagination-DLSuQ8hw.js.map → Pagination-Dwko3g48.js.map} +1 -1
  240. package/frontend/dist/assets/{PromptsPage-BG6oWgAk.js → PromptsPage-Cm8ykiI4.js} +2 -2
  241. package/frontend/dist/assets/{PromptsPage-BG6oWgAk.js.map → PromptsPage-Cm8ykiI4.js.map} +1 -1
  242. package/frontend/dist/assets/{ResourcesPage-BqJUKqnV.js → ResourcesPage-UMyO6mQ4.js} +2 -2
  243. package/frontend/dist/assets/{ResourcesPage-BqJUKqnV.js.map → ResourcesPage-UMyO6mQ4.js.map} +1 -1
  244. package/frontend/dist/assets/{ServersPage-CHbXHEcG.js → ServersPage-B0RoM8ez.js} +8 -8
  245. package/frontend/dist/assets/ServersPage-B0RoM8ez.js.map +1 -0
  246. package/frontend/dist/assets/{SettingsPage-B6yl-U9T.js → SettingsPage-BTB-36-n.js} +2 -2
  247. package/frontend/dist/assets/{SettingsPage-B6yl-U9T.js.map → SettingsPage-BTB-36-n.js.map} +1 -1
  248. package/frontend/dist/assets/{StatusDot-Bz7sBh0t.js → StatusDot-BAMXeT2x.js} +2 -2
  249. package/frontend/dist/assets/{StatusDot-Bz7sBh0t.js.map → StatusDot-BAMXeT2x.js.map} +1 -1
  250. package/frontend/dist/assets/{ToggleGroup-60voS_0U.js → ToggleGroup-Cfgt5lJo.js} +2 -2
  251. package/frontend/dist/assets/{ToggleGroup-60voS_0U.js.map → ToggleGroup-Cfgt5lJo.js.map} +1 -1
  252. package/frontend/dist/assets/{UsersPage-Dzzo9CC-.js → UsersPage-DlzYf7Su.js} +2 -2
  253. package/frontend/dist/assets/{UsersPage-Dzzo9CC-.js.map → UsersPage-DlzYf7Su.js.map} +1 -1
  254. package/frontend/dist/assets/{contextCost-CIOdvJNu.js → contextCost-kp2vZYp7.js} +2 -2
  255. package/frontend/dist/assets/{contextCost-CIOdvJNu.js.map → contextCost-kp2vZYp7.js.map} +1 -1
  256. package/frontend/dist/assets/{framework-vendor-I9Y6AgD5.js → framework-vendor-BHAQX05P.js} +3 -3
  257. package/frontend/dist/assets/{framework-vendor-I9Y6AgD5.js.map → framework-vendor-BHAQX05P.js.map} +1 -1
  258. package/frontend/dist/assets/{i18n-vendor-y9bLzIeh.js → i18n-vendor-CMcB7XUR.js} +2 -2
  259. package/frontend/dist/assets/{i18n-vendor-y9bLzIeh.js.map → i18n-vendor-CMcB7XUR.js.map} +1 -1
  260. package/frontend/dist/assets/{icons-vendor-hw0ScL8G.js → icons-vendor-HZHHWeTa.js} +65 -60
  261. package/frontend/dist/assets/icons-vendor-HZHHWeTa.js.map +1 -0
  262. package/frontend/dist/assets/index-CvXw771N.js +3 -0
  263. package/frontend/dist/assets/index-CvXw771N.js.map +1 -0
  264. package/frontend/dist/assets/{resourceService-DIIsi_li.js → resourceService-D2QmlFby.js} +2 -2
  265. package/frontend/dist/assets/{resourceService-DIIsi_li.js.map → resourceService-D2QmlFby.js.map} +1 -1
  266. package/frontend/dist/assets/useSettingsData-CeCvZ2nU.js +2 -0
  267. package/frontend/dist/assets/{useSettingsData-C84qj7ge.js.map → useSettingsData-CeCvZ2nU.js.map} +1 -1
  268. package/frontend/dist/assets/{variableDetection-Y9ymMI80.js → variableDetection-DKPiHkxr.js} +2 -2
  269. package/frontend/dist/assets/{variableDetection-Y9ymMI80.js.map → variableDetection-DKPiHkxr.js.map} +1 -1
  270. package/frontend/dist/index.html +4 -4
  271. package/package.json +2 -2
  272. package/frontend/dist/assets/LoginPage-BXRn47pC.js.map +0 -1
  273. package/frontend/dist/assets/ServersPage-CHbXHEcG.js.map +0 -1
  274. package/frontend/dist/assets/icons-vendor-hw0ScL8G.js.map +0 -1
  275. package/frontend/dist/assets/index-Ca9HKIrV.js +0 -3
  276. package/frontend/dist/assets/index-Ca9HKIrV.js.map +0 -1
  277. package/frontend/dist/assets/useSettingsData-C84qj7ge.js +0 -2
@@ -1,2 +1,2 @@
1
- import{f as c,e as t,h as n}from"./index-Ca9HKIrV.js";import"./framework-vendor-I9Y6AgD5.js";import"./i18n-vendor-y9bLzIeh.js";import"./icons-vendor-hw0ScL8G.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-DIIsi_li.js.map
1
+ import{f as c,e as t,h as n}from"./index-CvXw771N.js";import"./framework-vendor-BHAQX05P.js";import"./i18n-vendor-CMcB7XUR.js";import"./icons-vendor-HZHHWeTa.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-D2QmlFby.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"resourceService-DIIsi_li.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
+ {"version":3,"file":"resourceService-D2QmlFby.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"}
@@ -0,0 +1,2 @@
1
+ import{p as t}from"./index-CvXw771N.js";const e=()=>t();export{e as u};
2
+ //# sourceMappingURL=useSettingsData-CeCvZ2nU.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSettingsData-C84qj7ge.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"}
1
+ {"version":3,"file":"useSettingsData-CeCvZ2nU.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"}
@@ -1,4 +1,4 @@
1
- import{r as g,j as e}from"./framework-vendor-I9Y6AgD5.js";import{j as bs}from"./index-Ca9HKIrV.js";import{u as ys}from"./i18n-vendor-y9bLzIeh.js";import{X as vs}from"./icons-vendor-hw0ScL8G.js";const is=o=>{const i={};return o.forEach(({key:t,value:x})=>{const m=t.trim();m&&(i[m]=x)}),i},cs=o=>o?o.split(",").map(i=>i.trim()).filter(i=>i.length>0):[],fs=o=>Array.from(new Set((o||[]).map(i=>i.trim()).filter(i=>i.length>0))),js=o=>{const i={};return typeof(o==null?void 0:o.timeout)=="number"&&!Number.isNaN(o.timeout)&&(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},ks=o=>{var b,l,c,S,w,j,k,N;if(!o)return{};const i={},t=(b=o.clientId)==null?void 0:b.trim(),x=(l=o.clientSecret)==null?void 0:l.trim(),m=(c=o.scopes)==null?void 0:c.trim(),n=(S=o.accessToken)==null?void 0:S.trim(),u=(w=o.refreshToken)==null?void 0:w.trim(),h=(j=o.authorizationEndpoint)==null?void 0:j.trim(),d=(k=o.tokenEndpoint)==null?void 0:k.trim(),p=(N=o.resource)==null?void 0:N.trim();if(t&&(i.clientId=t),x&&(i.clientSecret=x),m){const v=m.split(/[\s,]+/).map(y=>y.trim()).filter(y=>y.length>0);v.length>0&&(i.scopes=v)}return n&&(i.accessToken=n),u&&(i.refreshToken=u),h&&(i.authorizationEndpoint=h),d&&(i.tokenEndpoint=d),p&&(i.resource=p),i},Ns=o=>{var u,h,d,p,b,l,c,S,w,j,k,N,v,y,I,f;const i={version:((u=o.openapi)==null?void 0:u.version)||"3.1.0",passthroughHeaders:cs((h=o.openapi)==null?void 0:h.passthroughHeaders),cookieSession:((d=o.openapi)==null?void 0:d.cookieSession)===!0?!0:void 0},t=(b=(p=o.openapi)==null?void 0:p.oauth2TokenUrl)==null?void 0:b.trim(),x=(c=(l=o.openapi)==null?void 0:l.oauth2ClientId)==null?void 0:c.trim(),m=(w=(S=o.openapi)==null?void 0:S.oauth2ClientSecret)==null?void 0:w.trim(),n=(k=(j=o.openapi)==null?void 0:j.oauth2Token)==null?void 0:k.trim();if(((N=o.openapi)==null?void 0:N.inputMode)==="url")i.url=((v=o.openapi)==null?void 0:v.url)||"";else if(((y=o.openapi)==null?void 0:y.inputMode)==="schema"&&((I=o.openapi)!=null&&I.schema))try{i.schema=JSON.parse(o.openapi.schema)}catch{throw new Error("Invalid JSON schema format")}return(f=o.openapi)!=null&&f.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:{...t&&{tokenUrl:t},...x&&{clientId:x},...m&&{clientSecret:m},...n&&{token:n}}},...o.openapi.securityType==="openIdConnect"&&{openIdConnect:{url:o.openapi.openIdConnectUrl||"",token:o.openapi.openIdConnectToken||""}}}),i},Cs=({formData:o,serverType:i,envVars:t,headerVars:x})=>{var p,b,l;const m=is(t),n=is(x),u=js(o.options),h=((p=o.description)==null?void 0:p.trim())||"",d={type:i,description:h,options:u,visibility:o.visibility??"private",sharedWithUsers:o.visibility==="group"?fs(o.sharedWithUsers):void 0,perSessionClient:o.perSessionClient===!0?!0:void 0,startOnDemand:o.startOnDemand===!0?!0:void 0,idleTimeoutMs:o.startOnDemand===!0?o.idleTimeoutMs??3e5:void 0,proxy:o.proxy};if(i==="openapi")d.headers=n,d.openapi=Ns(o);else if(i==="sse"||i==="streamable-http"){const c=((b=o.keepAlive)==null?void 0:b.enabled)===!0;d.url=o.url.trim(),d.env=m,d.headers=n,d.passthroughHeaders=cs(o.passthroughHeaders),d.oauth=ks(o.oauth),d.enableKeepAlive=c,d.keepAliveInterval=c?((l=o.keepAlive)==null?void 0:l.interval)||6e4:void 0}else d.command=o.command.trim(),d.args=o.args,d.env=m;return{name:o.name.trim(),config:d}},As=({onSubmit:o,onCancel:i,initialData:t=null,modalTitle:x,formError:m=null})=>{var J,G,Q,_,Y,Z,D,ee,se,re,te,ne,oe,ae,le,ie,ce,pe,de,me,ue,he,xe,ge,be,ye,ve,fe,je,ke,Ne,Ce,Se,we,Te,Ie,Ae,Oe,Ee,Ke,He,Fe,Ue,Me,Ve,Pe,ze,We,qe,Re,$e,Be,Le,Xe,Je,Ge,Qe,_e,Ye,Ze,De,es,ss,rs,ts,ns,os,as,ls;const{t:n}=ys(),u=()=>!t||!t.config?"stdio":t.config.type?t.config.type:t.config.url?"sse":"stdio",h=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)||""}},[p,b]=g.useState(u()),[l,c]=g.useState({name:t&&t.name||"",description:t&&t.config&&t.config.description||"",url:t&&t.config&&t.config.url||"",command:t&&t.config&&t.config.command||"",arguments:t&&t.config&&t.config.args?Array.isArray(t.config.args)?t.config.args.join(" "):String(t.config.args):"",args:t&&t.config&&t.config.args||[],type:u(),env:h(t),headers:[],passthroughHeaders:((G=(J=t==null?void 0:t.config)==null?void 0:J.passthroughHeaders)==null?void 0:G.join(", "))||"",visibility:((Q=t==null?void 0:t.config)==null?void 0:Q.visibility)??"private",sharedWithUsers:((_=t==null?void 0:t.config)==null?void 0:_.sharedWithUsers)||[],options:{timeout:t&&t.config&&t.config.options&&t.config.options.timeout||6e4,resetTimeoutOnProgress:((Z=(Y=t==null?void 0:t.config)==null?void 0:Y.options)==null?void 0:Z.resetTimeoutOnProgress)??!0,maxTotalTimeout:t&&t.config&&t.config.options&&t.config.options.maxTotalTimeout||void 0},oauth:d(t),keepAlive:{enabled:((D=t==null?void 0:t.config)==null?void 0:D.enableKeepAlive)===!0,interval:((ee=t==null?void 0:t.config)==null?void 0:ee.keepAliveInterval)||6e4},perSessionClient:((se=t==null?void 0:t.config)==null?void 0:se.perSessionClient)===!0,proxy:(re=t==null?void 0:t.config)==null?void 0:re.proxy,startOnDemand:((te=t==null?void 0:t.config)==null?void 0:te.startOnDemand)===!0,idleTimeoutMs:((ne=t==null?void 0:t.config)==null?void 0:ne.idleTimeoutMs)??3e5,openapi:t&&t.config&&t.config.openapi?{url:t.config.openapi.url||"",schema:t.config.openapi.schema?JSON.stringify(t.config.openapi.schema,null,2):"",inputMode:t.config.openapi.url?"url":t.config.openapi.schema?"schema":"url",version:t.config.openapi.version||"3.1.0",securityType:((oe=t.config.openapi.security)==null?void 0:oe.type)||"none",apiKeyName:((le=(ae=t.config.openapi.security)==null?void 0:ae.apiKey)==null?void 0:le.name)||"",apiKeyIn:((ce=(ie=t.config.openapi.security)==null?void 0:ie.apiKey)==null?void 0:ce.in)||"header",apiKeyValue:((de=(pe=t.config.openapi.security)==null?void 0:pe.apiKey)==null?void 0:de.value)||"",httpScheme:((ue=(me=t.config.openapi.security)==null?void 0:me.http)==null?void 0:ue.scheme)||"bearer",httpCredentials:((xe=(he=t.config.openapi.security)==null?void 0:he.http)==null?void 0:xe.credentials)||"",oauth2TokenUrl:((be=(ge=t.config.openapi.security)==null?void 0:ge.oauth2)==null?void 0:be.tokenUrl)||"",oauth2ClientId:((ve=(ye=t.config.openapi.security)==null?void 0:ye.oauth2)==null?void 0:ve.clientId)||"",oauth2ClientSecret:((je=(fe=t.config.openapi.security)==null?void 0:fe.oauth2)==null?void 0:je.clientSecret)||"",oauth2Token:((Ne=(ke=t.config.openapi.security)==null?void 0:ke.oauth2)==null?void 0:Ne.token)||"",openIdConnectUrl:((Se=(Ce=t.config.openapi.security)==null?void 0:Ce.openIdConnect)==null?void 0:Se.url)||"",openIdConnectToken:((Te=(we=t.config.openapi.security)==null?void 0:we.openIdConnect)==null?void 0:Te.token)||"",passthroughHeaders:t.config.openapi.passthroughHeaders?t.config.openapi.passthroughHeaders.join(", "):"",cookieSession:t.config.openapi.cookieSession===!0}:{inputMode:"url",url:"",schema:"",version:"3.1.0",securityType:"none",passthroughHeaders:"",cookieSession:!1}}),[S,w]=g.useState([]),[j,k]=g.useState(!1),[N,v]=g.useState(!1);g.useEffect(()=>{if(l.visibility!=="group"||!(t!=null&&t.name))return;let r=!1;return k(!0),v(!1),bs(`/servers/${encodeURIComponent(t.name)}/share-candidates`).then(s=>{r||(s.success&&Array.isArray(s.data)?w(s.data):v(!0))}).catch(()=>{r||v(!0)}).finally(()=>{r||k(!1)}),()=>{r=!0}},[l.visibility,t==null?void 0:t.name]);const y=Array.from(new Set([...l.sharedWithUsers||[],...S])).sort((r,s)=>r.localeCompare(s)),I=r=>{c(s=>{const a=new Set(s.sharedWithUsers||[]);return a.has(r)?a.delete(r):a.add(r),{...s,sharedWithUsers:Array.from(a)}})},[f,H]=g.useState(t&&t.config&&t.config.env?Object.entries(t.config.env).map(([r,s])=>({key:r,value:s})):[]),[T,F]=g.useState(t&&t.config&&t.config.headers?Object.entries(t.config.headers).map(([r,s])=>({key:r,value:s})):[]),[U,ps]=g.useState(!1),[M,ds]=g.useState(!1),[V,ms]=g.useState(!1),[P,us]=g.useState(!1),[W,q]=g.useState(null),hs=!!t,A=r=>{const{name:s,value:a}=r.target;c({...l,[s]:a})},xs=r=>{const s=r.split(" ").filter(a=>a.trim()!=="");c({...l,arguments:r,args:s})},O=r=>{b(r),c(s=>({...s,type:r}))},E=(r,s,a)=>{const C=[...f];C[r][s]=a,H(C)},R=()=>{H([...f,{key:"",value:""}])},$=r=>{const s=[...f];s.splice(r,1),H(s)},K=(r,s,a)=>{const C=[...T];C[r][s]=a,F(C)},B=()=>{F([...T,{key:"",value:""}])},L=r=>{const s=[...T];s.splice(r,1),F(s)},X=(r,s)=>{c(a=>({...a,oauth:{...a.oauth||{},[r]:s}}))},z=(r,s)=>{c(a=>({...a,options:{...a.options,[r]:s}}))},gs=async r=>{r.preventDefault(),q(null);try{const s=Cs({formData:l,serverType:p,envVars:f,headerVars:T});o(s)}catch(s){q(`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:x}),e.jsx("button",{onClick:i,className:"hub-icon-btn","aria-label":"Close",children:e.jsx(vs,{size:16})})]}),(W||m)&&e.jsx("div",{className:"bg-red-50 text-red-700 p-3 rounded mb-4",children:m||W}),e.jsxs("form",{onSubmit:gs,children:[e.jsxs("div",{className:"mb-5",children:[e.jsx("h3",{className:"text-sm font-semibold text-[var(--hub-ink)] mb-3 pb-2 border-b border-gray-200 dark:border-gray-700",children:n("server.sectionBasicInfo","Basic Info")}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4",children:[e.jsxs("div",{className:"md:col-span-1",children:[e.jsx("label",{className:"block text-sm font-medium mb-1.5 text-[var(--hub-ink-2)]",htmlFor:"name",children:n("server.name")}),e.jsx("input",{type:"text",name:"name",id:"name",value:l.name,onChange:A,className:"w-full py-2 px-3 form-input",placeholder:"e.g.: time-mcp",required:!0})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("label",{className:"block text-sm font-medium mb-1.5 text-[var(--hub-ink-2)]",htmlFor:"description",children:n("server.description")}),e.jsx("input",{type:"text",name:"description",id:"description",value:l.description||"",onChange:A,className:"w-full py-2 px-3 form-input",placeholder:n("server.descriptionPlaceholder")})]})]})]}),e.jsxs("div",{className:"mb-5",children:[e.jsx("h3",{className:"text-sm font-semibold text-[var(--hub-ink)] mb-3 pb-2 border-b border-gray-200 dark:border-gray-700",children:n("server.sectionConnection","Connection")}),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:n("server.type")}),e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-2",children:[e.jsxs("div",{children:[e.jsx("input",{type:"radio",id:"command",name:"serverType",value:"command",checked:p==="stdio",onChange:()=>O("stdio"),className:"mr-1"}),e.jsx("label",{htmlFor:"command",className:"text-[var(--hub-ink)]",children:n("server.typeStdio")})]}),e.jsxs("div",{children:[e.jsx("input",{type:"radio",id:"url",name:"serverType",value:"url",checked:p==="sse",onChange:()=>O("sse"),className:"mr-1"}),e.jsx("label",{htmlFor:"url",className:"text-[var(--hub-ink)]",children:n("server.typeSse")})]}),e.jsxs("div",{children:[e.jsx("input",{type:"radio",id:"streamable-http",name:"serverType",value:"streamable-http",checked:p==="streamable-http",onChange:()=>O("streamable-http"),className:"mr-1"}),e.jsx("label",{htmlFor:"streamable-http",className:"text-[var(--hub-ink)]",children:n("server.typeStreamableHttp")})]}),e.jsxs("div",{children:[e.jsx("input",{type:"radio",id:"openapi",name:"serverType",value:"openapi",checked:p==="openapi",onChange:()=>O("openapi"),className:"mr-1"}),e.jsx("label",{htmlFor:"openapi",className:"text-[var(--hub-ink)]",children:n("server.typeOpenapi")})]})]})]}),e.jsx("div",{className:"pl-4 border-l-2 border-gray-200 dark:border-gray-700 ml-2",children:p==="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:n("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:((Ie=l.openapi)==null?void 0:Ie.inputMode)==="url",onChange:()=>c(r=>({...r,openapi:{...r.openapi,inputMode:"url"}})),className:"mr-1"}),e.jsx("label",{htmlFor:"input-mode-url",children:n("server.openapi.inputModeUrl")})]}),e.jsxs("div",{children:[e.jsx("input",{type:"radio",id:"input-mode-schema",name:"inputMode",value:"schema",checked:((Ae=l.openapi)==null?void 0:Ae.inputMode)==="schema",onChange:()=>c(r=>({...r,openapi:{...r.openapi,inputMode:"schema"}})),className:"mr-1"}),e.jsx("label",{htmlFor:"input-mode-schema",children:n("server.openapi.inputModeSchema")})]})]})]}),((Oe=l.openapi)==null?void 0:Oe.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:n("server.openapi.specUrl")}),e.jsx("input",{type:"url",name:"openapi-url",id:"openapi-url",value:((Ee=l.openapi)==null?void 0:Ee.url)||"",onChange:r=>c(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:p==="openapi"&&((Ke=l.openapi)==null?void 0:Ke.inputMode)==="url"})]}),((He=l.openapi)==null?void 0:He.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:n("server.openapi.schema")}),e.jsx("textarea",{name:"openapi-schema",id:"openapi-schema",rows:10,value:((Fe=l.openapi)==null?void 0:Fe.schema)||"",onChange:r=>c(s=>({...s,openapi:{...s.openapi,schema:r.target.value}})),className:"w-full py-2 px-3 form-input font-mono text-sm",placeholder:`{
1
+ import{r as g,j as e}from"./framework-vendor-BHAQX05P.js";import{j as bs}from"./index-CvXw771N.js";import{u as ys}from"./i18n-vendor-CMcB7XUR.js";import{X as vs}from"./icons-vendor-HZHHWeTa.js";const is=o=>{const i={};return o.forEach(({key:t,value:x})=>{const m=t.trim();m&&(i[m]=x)}),i},cs=o=>o?o.split(",").map(i=>i.trim()).filter(i=>i.length>0):[],fs=o=>Array.from(new Set((o||[]).map(i=>i.trim()).filter(i=>i.length>0))),js=o=>{const i={};return typeof(o==null?void 0:o.timeout)=="number"&&!Number.isNaN(o.timeout)&&(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},ks=o=>{var b,l,c,S,w,j,k,N;if(!o)return{};const i={},t=(b=o.clientId)==null?void 0:b.trim(),x=(l=o.clientSecret)==null?void 0:l.trim(),m=(c=o.scopes)==null?void 0:c.trim(),n=(S=o.accessToken)==null?void 0:S.trim(),u=(w=o.refreshToken)==null?void 0:w.trim(),h=(j=o.authorizationEndpoint)==null?void 0:j.trim(),d=(k=o.tokenEndpoint)==null?void 0:k.trim(),p=(N=o.resource)==null?void 0:N.trim();if(t&&(i.clientId=t),x&&(i.clientSecret=x),m){const v=m.split(/[\s,]+/).map(y=>y.trim()).filter(y=>y.length>0);v.length>0&&(i.scopes=v)}return n&&(i.accessToken=n),u&&(i.refreshToken=u),h&&(i.authorizationEndpoint=h),d&&(i.tokenEndpoint=d),p&&(i.resource=p),i},Ns=o=>{var u,h,d,p,b,l,c,S,w,j,k,N,v,y,I,f;const i={version:((u=o.openapi)==null?void 0:u.version)||"3.1.0",passthroughHeaders:cs((h=o.openapi)==null?void 0:h.passthroughHeaders),cookieSession:((d=o.openapi)==null?void 0:d.cookieSession)===!0?!0:void 0},t=(b=(p=o.openapi)==null?void 0:p.oauth2TokenUrl)==null?void 0:b.trim(),x=(c=(l=o.openapi)==null?void 0:l.oauth2ClientId)==null?void 0:c.trim(),m=(w=(S=o.openapi)==null?void 0:S.oauth2ClientSecret)==null?void 0:w.trim(),n=(k=(j=o.openapi)==null?void 0:j.oauth2Token)==null?void 0:k.trim();if(((N=o.openapi)==null?void 0:N.inputMode)==="url")i.url=((v=o.openapi)==null?void 0:v.url)||"";else if(((y=o.openapi)==null?void 0:y.inputMode)==="schema"&&((I=o.openapi)!=null&&I.schema))try{i.schema=JSON.parse(o.openapi.schema)}catch{throw new Error("Invalid JSON schema format")}return(f=o.openapi)!=null&&f.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:{...t&&{tokenUrl:t},...x&&{clientId:x},...m&&{clientSecret:m},...n&&{token:n}}},...o.openapi.securityType==="openIdConnect"&&{openIdConnect:{url:o.openapi.openIdConnectUrl||"",token:o.openapi.openIdConnectToken||""}}}),i},Cs=({formData:o,serverType:i,envVars:t,headerVars:x})=>{var p,b,l;const m=is(t),n=is(x),u=js(o.options),h=((p=o.description)==null?void 0:p.trim())||"",d={type:i,description:h,options:u,visibility:o.visibility??"private",sharedWithUsers:o.visibility==="group"?fs(o.sharedWithUsers):void 0,perSessionClient:o.perSessionClient===!0?!0:void 0,startOnDemand:o.startOnDemand===!0?!0:void 0,idleTimeoutMs:o.startOnDemand===!0?o.idleTimeoutMs??3e5:void 0,proxy:o.proxy};if(i==="openapi")d.headers=n,d.openapi=Ns(o);else if(i==="sse"||i==="streamable-http"){const c=((b=o.keepAlive)==null?void 0:b.enabled)===!0;d.url=o.url.trim(),d.env=m,d.headers=n,d.passthroughHeaders=cs(o.passthroughHeaders),d.oauth=ks(o.oauth),d.enableKeepAlive=c,d.keepAliveInterval=c?((l=o.keepAlive)==null?void 0:l.interval)||6e4:void 0}else d.command=o.command.trim(),d.args=o.args,d.env=m;return{name:o.name.trim(),config:d}},As=({onSubmit:o,onCancel:i,initialData:t=null,modalTitle:x,formError:m=null})=>{var J,G,Q,_,Y,Z,D,ee,se,re,te,ne,oe,ae,le,ie,ce,pe,de,me,ue,he,xe,ge,be,ye,ve,fe,je,ke,Ne,Ce,Se,we,Te,Ie,Ae,Oe,Ee,Ke,He,Fe,Ue,Me,Ve,Pe,ze,We,qe,Re,$e,Be,Le,Xe,Je,Ge,Qe,_e,Ye,Ze,De,es,ss,rs,ts,ns,os,as,ls;const{t:n}=ys(),u=()=>!t||!t.config?"stdio":t.config.type?t.config.type:t.config.url?"sse":"stdio",h=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)||""}},[p,b]=g.useState(u()),[l,c]=g.useState({name:t&&t.name||"",description:t&&t.config&&t.config.description||"",url:t&&t.config&&t.config.url||"",command:t&&t.config&&t.config.command||"",arguments:t&&t.config&&t.config.args?Array.isArray(t.config.args)?t.config.args.join(" "):String(t.config.args):"",args:t&&t.config&&t.config.args||[],type:u(),env:h(t),headers:[],passthroughHeaders:((G=(J=t==null?void 0:t.config)==null?void 0:J.passthroughHeaders)==null?void 0:G.join(", "))||"",visibility:((Q=t==null?void 0:t.config)==null?void 0:Q.visibility)??"private",sharedWithUsers:((_=t==null?void 0:t.config)==null?void 0:_.sharedWithUsers)||[],options:{timeout:t&&t.config&&t.config.options&&t.config.options.timeout||6e4,resetTimeoutOnProgress:((Z=(Y=t==null?void 0:t.config)==null?void 0:Y.options)==null?void 0:Z.resetTimeoutOnProgress)??!0,maxTotalTimeout:t&&t.config&&t.config.options&&t.config.options.maxTotalTimeout||void 0},oauth:d(t),keepAlive:{enabled:((D=t==null?void 0:t.config)==null?void 0:D.enableKeepAlive)===!0,interval:((ee=t==null?void 0:t.config)==null?void 0:ee.keepAliveInterval)||6e4},perSessionClient:((se=t==null?void 0:t.config)==null?void 0:se.perSessionClient)===!0,proxy:(re=t==null?void 0:t.config)==null?void 0:re.proxy,startOnDemand:((te=t==null?void 0:t.config)==null?void 0:te.startOnDemand)===!0,idleTimeoutMs:((ne=t==null?void 0:t.config)==null?void 0:ne.idleTimeoutMs)??3e5,openapi:t&&t.config&&t.config.openapi?{url:t.config.openapi.url||"",schema:t.config.openapi.schema?JSON.stringify(t.config.openapi.schema,null,2):"",inputMode:t.config.openapi.url?"url":t.config.openapi.schema?"schema":"url",version:t.config.openapi.version||"3.1.0",securityType:((oe=t.config.openapi.security)==null?void 0:oe.type)||"none",apiKeyName:((le=(ae=t.config.openapi.security)==null?void 0:ae.apiKey)==null?void 0:le.name)||"",apiKeyIn:((ce=(ie=t.config.openapi.security)==null?void 0:ie.apiKey)==null?void 0:ce.in)||"header",apiKeyValue:((de=(pe=t.config.openapi.security)==null?void 0:pe.apiKey)==null?void 0:de.value)||"",httpScheme:((ue=(me=t.config.openapi.security)==null?void 0:me.http)==null?void 0:ue.scheme)||"bearer",httpCredentials:((xe=(he=t.config.openapi.security)==null?void 0:he.http)==null?void 0:xe.credentials)||"",oauth2TokenUrl:((be=(ge=t.config.openapi.security)==null?void 0:ge.oauth2)==null?void 0:be.tokenUrl)||"",oauth2ClientId:((ve=(ye=t.config.openapi.security)==null?void 0:ye.oauth2)==null?void 0:ve.clientId)||"",oauth2ClientSecret:((je=(fe=t.config.openapi.security)==null?void 0:fe.oauth2)==null?void 0:je.clientSecret)||"",oauth2Token:((Ne=(ke=t.config.openapi.security)==null?void 0:ke.oauth2)==null?void 0:Ne.token)||"",openIdConnectUrl:((Se=(Ce=t.config.openapi.security)==null?void 0:Ce.openIdConnect)==null?void 0:Se.url)||"",openIdConnectToken:((Te=(we=t.config.openapi.security)==null?void 0:we.openIdConnect)==null?void 0:Te.token)||"",passthroughHeaders:t.config.openapi.passthroughHeaders?t.config.openapi.passthroughHeaders.join(", "):"",cookieSession:t.config.openapi.cookieSession===!0}:{inputMode:"url",url:"",schema:"",version:"3.1.0",securityType:"none",passthroughHeaders:"",cookieSession:!1}}),[S,w]=g.useState([]),[j,k]=g.useState(!1),[N,v]=g.useState(!1);g.useEffect(()=>{if(l.visibility!=="group"||!(t!=null&&t.name))return;let r=!1;return k(!0),v(!1),bs(`/servers/${encodeURIComponent(t.name)}/share-candidates`).then(s=>{r||(s.success&&Array.isArray(s.data)?w(s.data):v(!0))}).catch(()=>{r||v(!0)}).finally(()=>{r||k(!1)}),()=>{r=!0}},[l.visibility,t==null?void 0:t.name]);const y=Array.from(new Set([...l.sharedWithUsers||[],...S])).sort((r,s)=>r.localeCompare(s)),I=r=>{c(s=>{const a=new Set(s.sharedWithUsers||[]);return a.has(r)?a.delete(r):a.add(r),{...s,sharedWithUsers:Array.from(a)}})},[f,H]=g.useState(t&&t.config&&t.config.env?Object.entries(t.config.env).map(([r,s])=>({key:r,value:s})):[]),[T,F]=g.useState(t&&t.config&&t.config.headers?Object.entries(t.config.headers).map(([r,s])=>({key:r,value:s})):[]),[U,ps]=g.useState(!1),[M,ds]=g.useState(!1),[V,ms]=g.useState(!1),[P,us]=g.useState(!1),[W,q]=g.useState(null),hs=!!t,A=r=>{const{name:s,value:a}=r.target;c({...l,[s]:a})},xs=r=>{const s=r.split(" ").filter(a=>a.trim()!=="");c({...l,arguments:r,args:s})},O=r=>{b(r),c(s=>({...s,type:r}))},E=(r,s,a)=>{const C=[...f];C[r][s]=a,H(C)},R=()=>{H([...f,{key:"",value:""}])},$=r=>{const s=[...f];s.splice(r,1),H(s)},K=(r,s,a)=>{const C=[...T];C[r][s]=a,F(C)},B=()=>{F([...T,{key:"",value:""}])},L=r=>{const s=[...T];s.splice(r,1),F(s)},X=(r,s)=>{c(a=>({...a,oauth:{...a.oauth||{},[r]:s}}))},z=(r,s)=>{c(a=>({...a,options:{...a.options,[r]:s}}))},gs=async r=>{r.preventDefault(),q(null);try{const s=Cs({formData:l,serverType:p,envVars:f,headerVars:T});o(s)}catch(s){q(`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:x}),e.jsx("button",{onClick:i,className:"hub-icon-btn","aria-label":"Close",children:e.jsx(vs,{size:16})})]}),(W||m)&&e.jsx("div",{className:"bg-red-50 text-red-700 p-3 rounded mb-4",children:m||W}),e.jsxs("form",{onSubmit:gs,children:[e.jsxs("div",{className:"mb-5",children:[e.jsx("h3",{className:"text-sm font-semibold text-[var(--hub-ink)] mb-3 pb-2 border-b border-gray-200 dark:border-gray-700",children:n("server.sectionBasicInfo","Basic Info")}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4",children:[e.jsxs("div",{className:"md:col-span-1",children:[e.jsx("label",{className:"block text-sm font-medium mb-1.5 text-[var(--hub-ink-2)]",htmlFor:"name",children:n("server.name")}),e.jsx("input",{type:"text",name:"name",id:"name",value:l.name,onChange:A,className:"w-full py-2 px-3 form-input",placeholder:"e.g.: time-mcp",required:!0})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("label",{className:"block text-sm font-medium mb-1.5 text-[var(--hub-ink-2)]",htmlFor:"description",children:n("server.description")}),e.jsx("input",{type:"text",name:"description",id:"description",value:l.description||"",onChange:A,className:"w-full py-2 px-3 form-input",placeholder:n("server.descriptionPlaceholder")})]})]})]}),e.jsxs("div",{className:"mb-5",children:[e.jsx("h3",{className:"text-sm font-semibold text-[var(--hub-ink)] mb-3 pb-2 border-b border-gray-200 dark:border-gray-700",children:n("server.sectionConnection","Connection")}),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:n("server.type")}),e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-2",children:[e.jsxs("div",{children:[e.jsx("input",{type:"radio",id:"command",name:"serverType",value:"command",checked:p==="stdio",onChange:()=>O("stdio"),className:"mr-1"}),e.jsx("label",{htmlFor:"command",className:"text-[var(--hub-ink)]",children:n("server.typeStdio")})]}),e.jsxs("div",{children:[e.jsx("input",{type:"radio",id:"url",name:"serverType",value:"url",checked:p==="sse",onChange:()=>O("sse"),className:"mr-1"}),e.jsx("label",{htmlFor:"url",className:"text-[var(--hub-ink)]",children:n("server.typeSse")})]}),e.jsxs("div",{children:[e.jsx("input",{type:"radio",id:"streamable-http",name:"serverType",value:"streamable-http",checked:p==="streamable-http",onChange:()=>O("streamable-http"),className:"mr-1"}),e.jsx("label",{htmlFor:"streamable-http",className:"text-[var(--hub-ink)]",children:n("server.typeStreamableHttp")})]}),e.jsxs("div",{children:[e.jsx("input",{type:"radio",id:"openapi",name:"serverType",value:"openapi",checked:p==="openapi",onChange:()=>O("openapi"),className:"mr-1"}),e.jsx("label",{htmlFor:"openapi",className:"text-[var(--hub-ink)]",children:n("server.typeOpenapi")})]})]})]}),e.jsx("div",{className:"pl-4 border-l-2 border-gray-200 dark:border-gray-700 ml-2",children:p==="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:n("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:((Ie=l.openapi)==null?void 0:Ie.inputMode)==="url",onChange:()=>c(r=>({...r,openapi:{...r.openapi,inputMode:"url"}})),className:"mr-1"}),e.jsx("label",{htmlFor:"input-mode-url",children:n("server.openapi.inputModeUrl")})]}),e.jsxs("div",{children:[e.jsx("input",{type:"radio",id:"input-mode-schema",name:"inputMode",value:"schema",checked:((Ae=l.openapi)==null?void 0:Ae.inputMode)==="schema",onChange:()=>c(r=>({...r,openapi:{...r.openapi,inputMode:"schema"}})),className:"mr-1"}),e.jsx("label",{htmlFor:"input-mode-schema",children:n("server.openapi.inputModeSchema")})]})]})]}),((Oe=l.openapi)==null?void 0:Oe.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:n("server.openapi.specUrl")}),e.jsx("input",{type:"url",name:"openapi-url",id:"openapi-url",value:((Ee=l.openapi)==null?void 0:Ee.url)||"",onChange:r=>c(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:p==="openapi"&&((Ke=l.openapi)==null?void 0:Ke.inputMode)==="url"})]}),((He=l.openapi)==null?void 0:He.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:n("server.openapi.schema")}),e.jsx("textarea",{name:"openapi-schema",id:"openapi-schema",rows:10,value:((Fe=l.openapi)==null?void 0:Fe.schema)||"",onChange:r=>c(s=>({...s,openapi:{...s.openapi,schema:r.target.value}})),className:"w-full py-2 px-3 form-input font-mono text-sm",placeholder:`{
2
2
  "openapi": "3.1.0",
3
3
  "info": {
4
4
  "title": "API",
@@ -13,4 +13,4 @@ import{r as g,j as e}from"./framework-vendor-I9Y6AgD5.js";import{j as bs}from"./
13
13
  ...
14
14
  }
15
15
  }`,required:p==="openapi"&&((Ue=l.openapi)==null?void 0:Ue.inputMode)==="schema"}),e.jsx("p",{className:"text-xs text-[var(--hub-ink-3)] mt-1",children:n("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:n("server.openapi.security")}),e.jsxs("select",{value:((Me=l.openapi)==null?void 0:Me.securityType)||"none",onChange:r=>c(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:n("server.openapi.securityNone")}),e.jsx("option",{value:"apiKey",children:n("server.openapi.securityApiKey")}),e.jsx("option",{value:"http",children:n("server.openapi.securityHttp")}),e.jsx("option",{value:"oauth2",children:n("server.openapi.securityOAuth2")}),e.jsx("option",{value:"openIdConnect",children:n("server.openapi.securityOpenIdConnect")})]})]}),((Ve=l.openapi)==null?void 0:Ve.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:n("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:n("server.openapi.apiKeyName")}),e.jsx("input",{type:"text",value:((Pe=l.openapi)==null?void 0:Pe.apiKeyName)||"",onChange:r=>c(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:n("server.openapi.apiKeyIn")}),e.jsxs("select",{value:((ze=l.openapi)==null?void 0:ze.apiKeyIn)||"header",onChange:r=>c(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:n("server.openapi.apiKeyInHeader")}),e.jsx("option",{value:"query",children:n("server.openapi.apiKeyInQuery")}),e.jsx("option",{value:"cookie",children:n("server.openapi.apiKeyInCookie")})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:n("server.openapi.apiKeyValue")}),e.jsx("input",{type:"password",value:((We=l.openapi)==null?void 0:We.apiKeyValue)||"",onChange:r=>c(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"})]})]})]}),((qe=l.openapi)==null?void 0:qe.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:n("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:n("server.openapi.httpScheme")}),e.jsxs("select",{value:((Re=l.openapi)==null?void 0:Re.httpScheme)||"bearer",onChange:r=>c(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:n("server.openapi.httpSchemeBasic")}),e.jsx("option",{value:"bearer",children:n("server.openapi.httpSchemeBearer")}),e.jsx("option",{value:"digest",children:n("server.openapi.httpSchemeDigest")})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:n("server.openapi.httpCredentials")}),e.jsx("input",{type:"password",value:(($e=l.openapi)==null?void 0:$e.httpCredentials)||"",onChange:r=>c(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:((Be=l.openapi)==null?void 0:Be.httpScheme)==="basic"?"base64-encoded-credentials":"bearer-token"})]})]})]}),((Le=l.openapi)==null?void 0:Le.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:n("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:n("server.openapi.openIdConnectUrl")}),e.jsx("input",{type:"url",value:((Xe=l.openapi)==null?void 0:Xe.openIdConnectUrl)||"",onChange:r=>c(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:n("server.openapi.openIdConnectToken")}),e.jsx("input",{type:"password",value:((Je=l.openapi)==null?void 0:Je.openIdConnectToken)||"",onChange:r=>c(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"})]})]})]}),((Ge=l.openapi)==null?void 0:Ge.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:n("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:n("server.oauth.tokenEndpoint")}),e.jsx("input",{type:"url",value:((Qe=l.openapi)==null?void 0:Qe.oauth2TokenUrl)||"",onChange:r=>c(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:n("server.oauth.clientId")}),e.jsx("input",{type:"text",value:((_e=l.openapi)==null?void 0:_e.oauth2ClientId)||"",onChange:r=>c(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:n("server.oauth.clientSecret")}),e.jsx("input",{type:"password",value:((Ye=l.openapi)==null?void 0:Ye.oauth2ClientSecret)||"",onChange:r=>c(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:n("server.openapi.oauth2Token")}),e.jsx("input",{type:"password",value:((Ze=l.openapi)==null?void 0:Ze.oauth2Token)||"",onChange:r=>c(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"})]})]})]}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex items-center mb-1",children:[e.jsx("input",{type:"checkbox",id:"openapiCookieSession",checked:((De=l.openapi)==null?void 0:De.cookieSession)||!1,onChange:r=>c(s=>{var a,C;return{...s,openapi:{...s.openapi,passthroughHeaders:((a=s.openapi)==null?void 0:a.passthroughHeaders)||"",url:((C=s.openapi)==null?void 0:C.url)||"",cookieSession:r.target.checked}}}),className:"mr-2"}),e.jsx("label",{htmlFor:"openapiCookieSession",className:"text-gray-700 dark:text-gray-300 text-sm font-medium",children:n("server.openapi.cookieSession","Cookie Session Handling")})]}),e.jsx("p",{className:"text-xs text-gray-500 ml-6",children:n("server.openapi.cookieSessionHelp","Capture Set-Cookie from upstream login responses and replay them on later calls within the same downstream session. Isolated per MCP session; not persisted.")})]}),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:n("server.headers")}),e.jsx("button",{type:"button",onClick:B,className:"hub-btn primary !w-[30px] !h-[30px] !p-0 justify-center text-base font-bold",children:"+"})]}),T.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:()=>L(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))]})]}):p==="sse"||p==="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:n("server.url")}),e.jsx("input",{type:"url",name:"url",id:"url",value:l.url,onChange:A,className:"w-full py-2 px-3 form-input",placeholder:p==="streamable-http"?"e.g.: http://localhost:3000/mcp":"e.g.: http://localhost:3000/sse",required:p==="sse"||p==="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:n("server.headers")}),e.jsx("button",{type:"button",onClick:B,className:"hub-btn primary !w-[30px] !h-[30px] !p-0 justify-center text-base font-bold",children:"+"})]}),T.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:()=>L(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 justify-between items-center mb-2",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:n("server.envVars")}),e.jsx("button",{type:"button",onClick:R,className:"hub-btn primary !w-[30px] !h-[30px] !p-0 justify-center text-base font-bold",children:"+"})]}),f.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=>E(s,"key",a.target.value),className:"w-1/2 py-2 px-3 form-input",placeholder:n("server.key")}),e.jsx("span",{className:"flex items-center",children:":"}),e.jsx("input",{type:"text",value:r.value,onChange:a=>E(s,"value",a.target.value),className:"w-1/2 py-2 px-3 form-input",placeholder:n("server.value")})]}),e.jsx("button",{type:"button",onClick:()=>$(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(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:n("server.command")}),e.jsx("input",{type:"text",name:"command",id:"command",value:l.command,onChange:A,className:"w-full py-2 px-3 form-input",placeholder:"e.g.: npx",required:p==="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:n("server.arguments")}),e.jsx("input",{type:"text",name:"arguments",id:"arguments",value:l.arguments,onChange:r=>xs(r.target.value),className:"w-full py-2 px-3 form-input",placeholder:"e.g.: -y time-mcp"})]}),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:n("server.envVars")}),e.jsx("button",{type:"button",onClick:R,className:"hub-btn primary !w-[30px] !h-[30px] !p-0 justify-center text-base font-bold",children:"+"})]}),f.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=>E(s,"key",a.target.value),className:"w-1/2 py-2 px-3 form-input",placeholder:n("server.key")}),e.jsx("span",{className:"flex items-center",children:":"}),e.jsx("input",{type:"text",value:r.value,onChange:a=>E(s,"value",a.target.value),className:"w-1/2 py-2 px-3 form-input",placeholder:n("server.value")})]}),e.jsx("button",{type:"button",onClick:()=>$(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 dark:hover:bg-gray-700 p-3 rounded border border-gray-200 dark:border-gray-700",onClick:()=>us(!P),children:[e.jsx("h3",{className:"text-sm font-semibold text-[var(--hub-ink)]",children:n("server.sectionAdvanced","Advanced Options")}),e.jsx("span",{className:"text-gray-500 text-sm",children:P?"▼":"▶"})]}),P&&e.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-b p-4 bg-white dark:bg-gray-900 border-t-0 space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1.5 text-[var(--hub-ink-2)]",htmlFor:"visibility",children:n("server.visibility","Visibility")}),e.jsxs("select",{id:"visibility",name:"visibility",value:l.visibility||"private",onChange:r=>c(s=>({...s,visibility:r.target.value})),className:"w-full py-2 px-3 form-input",children:[e.jsx("option",{value:"private",children:n("server.visibilityPrivate","Private — only the owner and admins")}),e.jsx("option",{value:"group",children:n("server.visibilityGroup","Shared — selected users only")}),e.jsx("option",{value:"public",children:n("server.visibilityPublic","Public — every authenticated user")})]}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:n("server.visibilityDescription","Controls which non-admin users can discover and call this server. Admins always have access.")}),l.visibility==="group"&&e.jsxs("div",{className:"mt-4 rounded border border-gray-200 dark:border-gray-700 p-3",children:[e.jsx("div",{className:"text-sm font-medium text-[var(--hub-ink-2)]",children:n("server.shareWithUsers","Share with users")}),e.jsx("p",{className:"text-xs text-gray-500 mt-1 mb-3",children:n("server.shareWithUsersDescription","Selected users can discover and call this server, but cannot manage its configuration.")}),t!=null&&t.name?e.jsxs(e.Fragment,{children:[j&&e.jsx("p",{className:"text-sm text-gray-500",children:n("server.shareCandidatesLoading","Loading users...")}),N&&e.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:n("server.shareCandidatesError","Failed to load users.")}),!j&&!N&&y.length===0&&e.jsx("p",{className:"text-sm text-gray-500",children:n("server.noShareCandidates","No other users are available.")}),y.length>0&&e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:y.map(r=>e.jsxs("label",{className:"flex items-center gap-2 rounded border border-gray-200 dark:border-gray-700 px-3 py-2 text-sm text-[var(--hub-ink-2)]",children:[e.jsx("input",{type:"checkbox",checked:(l.sharedWithUsers||[]).includes(r),onChange:()=>I(r)}),e.jsx("span",{children:r})]},r))})]}):e.jsx("p",{className:"text-sm text-gray-500",children:n("server.shareAfterCreate","Save the server before selecting users.")})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1.5 text-[var(--hub-ink-2)]",children:n("server.openapi.passthroughHeaders")}),p==="openapi"?e.jsx(e.Fragment,{children:e.jsx("input",{type:"text",value:((es=l.openapi)==null?void 0:es.passthroughHeaders)||"",onChange:r=>c(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("input",{type:"text",value:l.passthroughHeaders||"",onChange:r=>c(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:n("server.openapi.passthroughHeadersHelp")})]}),p!=="openapi"&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between cursor-pointer bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 p-3 rounded border border-gray-200 dark:border-gray-700",onClick:()=>ds(!M),children:[e.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:n("server.oauth.sectionTitle")}),e.jsx("span",{className:"text-gray-500 text-sm",children:M?"▼":"▶"})]}),M&&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:n("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:n("server.oauth.clientId")}),e.jsx("input",{type:"text",value:((ss=l.oauth)==null?void 0:ss.clientId)||"",onChange:r=>X("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:n("server.oauth.clientSecret")}),e.jsx("input",{type:"password",value:((rs=l.oauth)==null?void 0:rs.clientSecret)||"",onChange:r=>X("clientSecret",r.target.value),className:"w-full py-2 px-3 form-input",placeholder:"client secret",autoComplete:"off"})]})]})]})]}),p!=="openapi"&&e.jsxs("div",{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:()=>ps(!U),children:[e.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:n("server.requestOptions")}),e.jsx("span",{className:"text-gray-500 text-sm",children:U?"▼":"▶"})]}),U&&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:n("server.timeout")}),e.jsx("input",{type:"number",id:"timeout",value:((ts=l.options)==null?void 0:ts.timeout)||6e4,onChange:r=>z("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:n("server.timeoutDescription")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-gray-600 text-sm font-medium mb-1",htmlFor:"maxTotalTimeout",children:n("server.maxTotalTimeout")}),e.jsx("input",{type:"number",id:"maxTotalTimeout",value:((ns=l.options)==null?void 0:ns.maxTotalTimeout)||"",onChange:r=>z("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:n("server.maxTotalTimeoutDescription")})]})]}),e.jsxs("div",{className:"mt-3",children:[e.jsxs("label",{className:"flex items-center",children:[e.jsx("input",{type:"checkbox",checked:((os=l.options)==null?void 0:os.resetTimeoutOnProgress)??!0,onChange:r=>z("resetTimeoutOnProgress",r.target.checked),className:"mr-2"}),e.jsx("span",{className:"text-gray-600 text-sm",children:n("server.resetTimeoutOnProgress")})]}),e.jsx("p",{className:"text-xs text-gray-500 mt-1 ml-6",children:n("server.resetTimeoutOnProgressDescription")})]})]})]}),(p==="sse"||p==="streamable-http")&&e.jsxs("div",{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:()=>ms(!V),children:[e.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:n("server.keepAlive","Connection Health")}),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.jsxs("div",{className:"flex items-center mb-3",children:[e.jsx("input",{type:"checkbox",id:"enableKeepAlive",checked:((as=l.keepAlive)==null?void 0:as.enabled)||!1,onChange:r=>c(s=>({...s,keepAlive:{...s.keepAlive,enabled:r.target.checked}})),className:"mr-2"}),e.jsx("label",{htmlFor:"enableKeepAlive",className:"text-gray-600 text-sm",children:n("server.enableKeepAlive","Enable Health Checks and Auto Reconnect")})]}),e.jsx("p",{className:"text-xs text-gray-500 mb-3",children:n("server.keepAliveDescription","Run periodic health checks and automatically reconnect this remote server when it becomes disconnected.")}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-gray-600 text-sm font-medium mb-1",htmlFor:"keepAliveInterval",children:n("server.keepAliveInterval","Check interval (ms)")}),e.jsx("input",{type:"number",id:"keepAliveInterval",value:((ls=l.keepAlive)==null?void 0:ls.interval)||6e4,onChange:r=>c(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:n("server.keepAliveIntervalDescription","Time between health checks and automatic reconnect attempts in milliseconds (default: 60000ms = 1 minute)")})]})]})]}),p!=="openapi"&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center mb-1",children:[e.jsx("input",{type:"checkbox",id:"perSessionClient",checked:l.perSessionClient||!1,onChange:r=>c(s=>({...s,perSessionClient:r.target.checked})),className:"mr-2"}),e.jsx("label",{htmlFor:"perSessionClient",className:"text-gray-700 dark:text-gray-300 text-sm font-medium",children:n("server.perSessionClient","Per-Session Client Isolation")})]}),e.jsx("p",{className:"text-xs text-gray-500 ml-6",children:n("server.perSessionClientDescription","Create a dedicated upstream connection per session instead of sharing one across all sessions. Enable for stateful servers like Playwright. Increases upstream connections with concurrent sessions.")})]}),p==="stdio"&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center mb-1",children:[e.jsx("input",{type:"checkbox",id:"startOnDemand",checked:l.startOnDemand||!1,onChange:r=>c(s=>({...s,startOnDemand:r.target.checked})),className:"mr-2"}),e.jsx("label",{htmlFor:"startOnDemand",className:"text-gray-700 dark:text-gray-300 text-sm font-medium",children:n("server.startOnDemand","Start On Demand")})]}),e.jsx("p",{className:"text-xs text-gray-500 ml-6",children:n("server.startOnDemandDescription","Skip startup connect and spawn this server only when a tool call arrives. The process is shut down automatically after the idle timeout, then restarted on the next call. Reduces persistent memory usage for rarely-used servers.")}),l.startOnDemand&&e.jsxs("div",{className:"ml-6 mt-2",children:[e.jsx("label",{htmlFor:"idleTimeoutMs",className:"block text-xs text-gray-600 dark:text-gray-400 mb-1",children:n("server.idleTimeoutMs","Idle shutdown timeout (ms)")}),e.jsx("input",{type:"number",id:"idleTimeoutMs",min:1e4,step:1e3,value:l.idleTimeoutMs??3e5,onChange:r=>c(s=>({...s,idleTimeoutMs:Number(r.target.value)})),className:"hub-input w-40 text-sm"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:n("server.idleTimeoutMsDescription","Shut down the process after this many milliseconds with no tool calls. Default: 300000 (5 minutes).")})]})]})]})]}),e.jsxs("div",{className:"flex justify-end mt-6",children:[e.jsx("button",{type:"button",onClick:i,className:"hub-btn mr-2",children:n("server.cancel")}),e.jsx("button",{type:"submit",className:"hub-btn primary",children:n(hs?"server.save":"server.add")})]})]})]})},Os=o=>{const i=new Set,t=/\$\{([^}]+)\}/g,x=n=>{let u;for(;(u=t.exec(n))!==null;)i.add(u[1])},m=(n,u="")=>{typeof n=="string"?x(n):Array.isArray(n)?n.forEach((h,d)=>m(h,`${u}[${d}]`)):n&&typeof n=="object"&&Object.entries(n).forEach(([h,d])=>{m(d,u?`${u}.${h}`:h)})};return m(o),Array.from(i)};export{As as S,Os as d};
16
- //# sourceMappingURL=variableDetection-Y9ymMI80.js.map
16
+ //# sourceMappingURL=variableDetection-DKPiHkxr.js.map