@1mcp/agent 0.32.2 → 0.33.0-beta1

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 (347) hide show
  1. package/build/auth/oauthAuthorizationFlow.d.ts +145 -0
  2. package/build/auth/oauthAuthorizationFlow.d.ts.map +1 -0
  3. package/build/auth/oauthAuthorizationFlow.js +257 -0
  4. package/build/auth/oauthAuthorizationFlow.js.map +1 -0
  5. package/build/auth/sdkOAuthServerProvider.d.ts +4 -0
  6. package/build/auth/sdkOAuthServerProvider.d.ts.map +1 -1
  7. package/build/auth/sdkOAuthServerProvider.js +4 -0
  8. package/build/auth/sdkOAuthServerProvider.js.map +1 -1
  9. package/build/auth/storage/fileStorageService.d.ts.map +1 -1
  10. package/build/auth/storage/fileStorageService.js +9 -5
  11. package/build/auth/storage/fileStorageService.js.map +1 -1
  12. package/build/commands/cliSetup/setupFiles.d.ts +2 -4
  13. package/build/commands/cliSetup/setupFiles.d.ts.map +1 -1
  14. package/build/commands/cliSetup/setupFiles.js +8 -46
  15. package/build/commands/cliSetup/setupFiles.js.map +1 -1
  16. package/build/commands/inspect/inspect.d.ts +3 -0
  17. package/build/commands/inspect/inspect.d.ts.map +1 -1
  18. package/build/commands/inspect/inspect.js +90 -83
  19. package/build/commands/inspect/inspect.js.map +1 -1
  20. package/build/commands/instructions/instructions.d.ts.map +1 -1
  21. package/build/commands/instructions/instructions.js +11 -68
  22. package/build/commands/instructions/instructions.js.map +1 -1
  23. package/build/commands/mcp/install.d.ts.map +1 -1
  24. package/build/commands/mcp/install.js +62 -145
  25. package/build/commands/mcp/install.js.map +1 -1
  26. package/build/commands/mcp/installSource.d.ts +13 -0
  27. package/build/commands/mcp/installSource.d.ts.map +1 -0
  28. package/build/commands/mcp/installSource.js +69 -0
  29. package/build/commands/mcp/installSource.js.map +1 -0
  30. package/build/commands/mcp/uninstall.d.ts.map +1 -1
  31. package/build/commands/mcp/uninstall.js +20 -15
  32. package/build/commands/mcp/uninstall.js.map +1 -1
  33. package/build/commands/preset/edit.d.ts.map +1 -1
  34. package/build/commands/preset/edit.js +2 -0
  35. package/build/commands/preset/edit.js.map +1 -1
  36. package/build/commands/preset/interactive.d.ts.map +1 -1
  37. package/build/commands/preset/interactive.js +2 -0
  38. package/build/commands/preset/interactive.js.map +1 -1
  39. package/build/commands/preset/show.d.ts.map +1 -1
  40. package/build/commands/preset/show.js +2 -0
  41. package/build/commands/preset/show.js.map +1 -1
  42. package/build/commands/preset/test.d.ts.map +1 -1
  43. package/build/commands/preset/test.js +2 -0
  44. package/build/commands/preset/test.js.map +1 -1
  45. package/build/commands/proxy/proxy.d.ts.map +1 -1
  46. package/build/commands/proxy/proxy.js +11 -22
  47. package/build/commands/proxy/proxy.js.map +1 -1
  48. package/build/commands/registry/options.d.ts +14 -7
  49. package/build/commands/registry/options.d.ts.map +1 -1
  50. package/build/commands/registry/options.js +14 -7
  51. package/build/commands/registry/options.js.map +1 -1
  52. package/build/commands/run/run.d.ts +1 -0
  53. package/build/commands/run/run.d.ts.map +1 -1
  54. package/build/commands/run/run.js +124 -156
  55. package/build/commands/run/run.js.map +1 -1
  56. package/build/commands/serve/index.d.ts +5 -0
  57. package/build/commands/serve/index.d.ts.map +1 -1
  58. package/build/commands/serve/index.js +6 -1
  59. package/build/commands/serve/index.js.map +1 -1
  60. package/build/commands/serve/serve.d.ts +1 -0
  61. package/build/commands/serve/serve.d.ts.map +1 -1
  62. package/build/commands/serve/serve.js +5 -103
  63. package/build/commands/serve/serve.js.map +1 -1
  64. package/build/commands/serve/serveOptions.d.ts +6 -0
  65. package/build/commands/serve/serveOptions.d.ts.map +1 -0
  66. package/build/commands/serve/serveOptions.js +90 -0
  67. package/build/commands/serve/serveOptions.js.map +1 -0
  68. package/build/commands/shared/baseConfigUtils.d.ts +1 -25
  69. package/build/commands/shared/baseConfigUtils.d.ts.map +1 -1
  70. package/build/commands/shared/baseConfigUtils.js +3 -193
  71. package/build/commands/shared/baseConfigUtils.js.map +1 -1
  72. package/build/commands/shared/clientSurfaceAttachment.d.ts +131 -0
  73. package/build/commands/shared/clientSurfaceAttachment.d.ts.map +1 -0
  74. package/build/commands/shared/clientSurfaceAttachment.js +205 -0
  75. package/build/commands/shared/clientSurfaceAttachment.js.map +1 -0
  76. package/build/commands/shared/configParsingUtils.d.ts +9 -0
  77. package/build/commands/shared/configParsingUtils.d.ts.map +1 -0
  78. package/build/commands/shared/configParsingUtils.js +179 -0
  79. package/build/commands/shared/configParsingUtils.js.map +1 -0
  80. package/build/commands/shared/serveClient.d.ts.map +1 -1
  81. package/build/commands/shared/serveClient.js +35 -12
  82. package/build/commands/shared/serveClient.js.map +1 -1
  83. package/build/commands/shared/serveTargetResolver.d.ts.map +1 -1
  84. package/build/commands/shared/serveTargetResolver.js +42 -3
  85. package/build/commands/shared/serveTargetResolver.js.map +1 -1
  86. package/build/config/configLoader.d.ts +0 -1
  87. package/build/config/configLoader.d.ts.map +1 -1
  88. package/build/config/configLoader.js +12 -7
  89. package/build/config/configLoader.js.map +1 -1
  90. package/build/config/envProcessor.d.ts +3 -8
  91. package/build/config/envProcessor.d.ts.map +1 -1
  92. package/build/config/envProcessor.js +17 -34
  93. package/build/config/envProcessor.js.map +1 -1
  94. package/build/config/mcpConfigMerge.d.ts.map +1 -1
  95. package/build/config/mcpConfigMerge.js +15 -8
  96. package/build/config/mcpConfigMerge.js.map +1 -1
  97. package/build/constants/mcp.d.ts +1 -1
  98. package/build/constants/mcp.d.ts.map +1 -1
  99. package/build/constants/mcp.js +1 -1
  100. package/build/constants/mcp.js.map +1 -1
  101. package/build/core/capabilities/asyncLoadingOrchestrator.d.ts +2 -1
  102. package/build/core/capabilities/asyncLoadingOrchestrator.d.ts.map +1 -1
  103. package/build/core/capabilities/asyncLoadingOrchestrator.js +3 -1
  104. package/build/core/capabilities/asyncLoadingOrchestrator.js.map +1 -1
  105. package/build/core/capabilities/capabilityCatalog.d.ts +88 -0
  106. package/build/core/capabilities/capabilityCatalog.d.ts.map +1 -0
  107. package/build/core/capabilities/capabilityCatalog.js +235 -0
  108. package/build/core/capabilities/capabilityCatalog.js.map +1 -0
  109. package/build/core/capabilities/capabilityNotificationFacts.d.ts +9 -0
  110. package/build/core/capabilities/capabilityNotificationFacts.d.ts.map +1 -0
  111. package/build/core/capabilities/capabilityNotificationFacts.js +11 -0
  112. package/build/core/capabilities/capabilityNotificationFacts.js.map +1 -0
  113. package/build/core/capabilities/metaToolProvider.d.ts +2 -0
  114. package/build/core/capabilities/metaToolProvider.d.ts.map +1 -1
  115. package/build/core/capabilities/metaToolProvider.js +37 -77
  116. package/build/core/capabilities/metaToolProvider.js.map +1 -1
  117. package/build/core/capabilities/toolRegistry.d.ts +2 -1
  118. package/build/core/capabilities/toolRegistry.d.ts.map +1 -1
  119. package/build/core/capabilities/toolRegistry.js +2 -0
  120. package/build/core/capabilities/toolRegistry.js.map +1 -1
  121. package/build/core/configChangeHandler.d.ts.map +1 -1
  122. package/build/core/configChangeHandler.js +33 -16
  123. package/build/core/configChangeHandler.js.map +1 -1
  124. package/build/core/filtering/filterSelection.d.ts +72 -0
  125. package/build/core/filtering/filterSelection.d.ts.map +1 -0
  126. package/build/core/filtering/filterSelection.js +262 -0
  127. package/build/core/filtering/filterSelection.js.map +1 -0
  128. package/build/core/instructions/instructionsDistribution.d.ts +52 -0
  129. package/build/core/instructions/instructionsDistribution.d.ts.map +1 -0
  130. package/build/core/instructions/instructionsDistribution.js +124 -0
  131. package/build/core/instructions/instructionsDistribution.js.map +1 -0
  132. package/build/core/protocol/notificationHandlers.js +2 -2
  133. package/build/core/protocol/notificationHandlers.js.map +1 -1
  134. package/build/core/protocol/promptRequestHandlers.d.ts +4 -0
  135. package/build/core/protocol/promptRequestHandlers.d.ts.map +1 -0
  136. package/build/core/protocol/promptRequestHandlers.js +64 -0
  137. package/build/core/protocol/promptRequestHandlers.js.map +1 -0
  138. package/build/core/protocol/requestHandlerUtils.d.ts +8 -0
  139. package/build/core/protocol/requestHandlerUtils.d.ts.map +1 -0
  140. package/build/core/protocol/requestHandlerUtils.js +48 -0
  141. package/build/core/protocol/requestHandlerUtils.js.map +1 -0
  142. package/build/core/protocol/requestHandlers.d.ts +2 -0
  143. package/build/core/protocol/requestHandlers.d.ts.map +1 -1
  144. package/build/core/protocol/requestHandlers.js +7 -391
  145. package/build/core/protocol/requestHandlers.js.map +1 -1
  146. package/build/core/protocol/resourceRequestHandlers.d.ts +3 -0
  147. package/build/core/protocol/resourceRequestHandlers.d.ts.map +1 -0
  148. package/build/core/protocol/resourceRequestHandlers.js +76 -0
  149. package/build/core/protocol/resourceRequestHandlers.js.map +1 -0
  150. package/build/core/protocol/toolRequestHandlers.d.ts +4 -0
  151. package/build/core/protocol/toolRequestHandlers.d.ts.map +1 -0
  152. package/build/core/protocol/toolRequestHandlers.js +132 -0
  153. package/build/core/protocol/toolRequestHandlers.js.map +1 -0
  154. package/build/core/server/adapters/TemplateServerAdapter.d.ts +0 -5
  155. package/build/core/server/adapters/TemplateServerAdapter.d.ts.map +1 -1
  156. package/build/core/server/adapters/TemplateServerAdapter.js +7 -30
  157. package/build/core/server/adapters/TemplateServerAdapter.js.map +1 -1
  158. package/build/core/server/clientInstanceFactory.d.ts +13 -0
  159. package/build/core/server/clientInstanceFactory.d.ts.map +1 -0
  160. package/build/core/server/clientInstanceFactory.js +32 -0
  161. package/build/core/server/clientInstanceFactory.js.map +1 -0
  162. package/build/core/server/clientInstancePool.d.ts +8 -49
  163. package/build/core/server/clientInstancePool.d.ts.map +1 -1
  164. package/build/core/server/clientInstancePool.js +61 -72
  165. package/build/core/server/clientInstancePool.js.map +1 -1
  166. package/build/core/server/clientInstancePoolTypes.d.ts +52 -0
  167. package/build/core/server/clientInstancePoolTypes.d.ts.map +1 -0
  168. package/build/core/server/clientInstancePoolTypes.js +10 -0
  169. package/build/core/server/clientInstancePoolTypes.js.map +1 -0
  170. package/build/core/server/connectionResolver.d.ts.map +1 -1
  171. package/build/core/server/connectionResolver.js +34 -31
  172. package/build/core/server/connectionResolver.js.map +1 -1
  173. package/build/core/server/requestContextPreparation.d.ts +38 -0
  174. package/build/core/server/requestContextPreparation.d.ts.map +1 -0
  175. package/build/core/server/requestContextPreparation.js +49 -0
  176. package/build/core/server/requestContextPreparation.js.map +1 -0
  177. package/build/core/server/serverManager.js +1 -1
  178. package/build/core/server/serverManager.js.map +1 -1
  179. package/build/core/server/templateIdentity.d.ts +44 -0
  180. package/build/core/server/templateIdentity.d.ts.map +1 -0
  181. package/build/core/server/templateIdentity.js +95 -0
  182. package/build/core/server/templateIdentity.js.map +1 -0
  183. package/build/core/server/templateServerCleanup.d.ts +23 -0
  184. package/build/core/server/templateServerCleanup.d.ts.map +1 -0
  185. package/build/core/server/templateServerCleanup.js +155 -0
  186. package/build/core/server/templateServerCleanup.js.map +1 -0
  187. package/build/core/server/templateServerManager.d.ts +12 -3
  188. package/build/core/server/templateServerManager.d.ts.map +1 -1
  189. package/build/core/server/templateServerManager.js +82 -127
  190. package/build/core/server/templateServerManager.js.map +1 -1
  191. package/build/core/tools/internal/adapters/installation/types.d.ts +16 -11
  192. package/build/core/tools/internal/adapters/installation/types.d.ts.map +1 -1
  193. package/build/core/tools/internal/adapters/installationAdapter.d.ts +3 -13
  194. package/build/core/tools/internal/adapters/installationAdapter.d.ts.map +1 -1
  195. package/build/core/tools/internal/adapters/installationAdapter.js +85 -69
  196. package/build/core/tools/internal/adapters/installationAdapter.js.map +1 -1
  197. package/build/core/tools/internal/installationHandlers.d.ts.map +1 -1
  198. package/build/core/tools/internal/installationHandlers.js +10 -4
  199. package/build/core/tools/internal/installationHandlers.js.map +1 -1
  200. package/build/core/tools/internal/integration.domainMocks.testSetup.d.ts +2 -0
  201. package/build/core/tools/internal/integration.domainMocks.testSetup.d.ts.map +1 -0
  202. package/build/core/tools/internal/integration.domainMocks.testSetup.js +66 -0
  203. package/build/core/tools/internal/integration.domainMocks.testSetup.js.map +1 -0
  204. package/build/core/tools/internal/integration.testSetup.d.ts +2 -0
  205. package/build/core/tools/internal/integration.testSetup.d.ts.map +1 -0
  206. package/build/core/tools/internal/integration.testSetup.js +469 -0
  207. package/build/core/tools/internal/integration.testSetup.js.map +1 -0
  208. package/build/core/tools/internal/schemas/index.d.ts +6 -0
  209. package/build/core/tools/internal/schemas/index.d.ts.map +1 -1
  210. package/build/core/tools/internal/schemas/installation.d.ts +6 -0
  211. package/build/core/tools/internal/schemas/installation.d.ts.map +1 -1
  212. package/build/core/tools/internal/schemas/installation.js +13 -1
  213. package/build/core/tools/internal/schemas/installation.js.map +1 -1
  214. package/build/domains/config-change/backupRetention.d.ts +14 -0
  215. package/build/domains/config-change/backupRetention.d.ts.map +1 -0
  216. package/build/domains/config-change/backupRetention.js +36 -0
  217. package/build/domains/config-change/backupRetention.js.map +1 -0
  218. package/build/domains/config-change/configChange.d.ts +4 -0
  219. package/build/domains/config-change/configChange.d.ts.map +1 -0
  220. package/build/domains/config-change/configChange.js +346 -0
  221. package/build/domains/config-change/configChange.js.map +1 -0
  222. package/build/domains/config-change/configLock.d.ts +6 -0
  223. package/build/domains/config-change/configLock.d.ts.map +1 -0
  224. package/build/domains/config-change/configLock.js +62 -0
  225. package/build/domains/config-change/configLock.js.map +1 -0
  226. package/build/domains/config-change/types.d.ts +64 -0
  227. package/build/domains/config-change/types.d.ts.map +1 -0
  228. package/build/domains/config-change/types.js +2 -0
  229. package/build/domains/config-change/types.js.map +1 -0
  230. package/build/domains/installation/index.d.ts +4 -3
  231. package/build/domains/installation/index.d.ts.map +1 -1
  232. package/build/domains/installation/index.js +5 -3
  233. package/build/domains/installation/index.js.map +1 -1
  234. package/build/domains/installation/serverInstallationSourceResolution.d.ts +6 -0
  235. package/build/domains/installation/serverInstallationSourceResolution.d.ts.map +1 -0
  236. package/build/domains/installation/serverInstallationSourceResolution.js +210 -0
  237. package/build/domains/installation/serverInstallationSourceResolution.js.map +1 -0
  238. package/build/domains/installation/serverInstallationTypes.d.ts +105 -0
  239. package/build/domains/installation/serverInstallationTypes.d.ts.map +1 -0
  240. package/build/domains/installation/serverInstallationTypes.js +2 -0
  241. package/build/domains/installation/serverInstallationTypes.js.map +1 -0
  242. package/build/domains/installation/serverInstallationWorkflow.d.ts +4 -0
  243. package/build/domains/installation/serverInstallationWorkflow.d.ts.map +1 -0
  244. package/build/domains/installation/serverInstallationWorkflow.js +148 -0
  245. package/build/domains/installation/serverInstallationWorkflow.js.map +1 -0
  246. package/build/domains/preset/manager/presetManager.d.ts +0 -4
  247. package/build/domains/preset/manager/presetManager.d.ts.map +1 -1
  248. package/build/domains/preset/manager/presetManager.js +19 -153
  249. package/build/domains/preset/manager/presetManager.js.map +1 -1
  250. package/build/domains/preset/manager/presetManagerCleanup.d.ts +15 -0
  251. package/build/domains/preset/manager/presetManagerCleanup.d.ts.map +1 -0
  252. package/build/domains/preset/manager/presetManagerCleanup.js +34 -0
  253. package/build/domains/preset/manager/presetManagerCleanup.js.map +1 -0
  254. package/build/domains/preset/manager/presetStorage.d.ts +4 -0
  255. package/build/domains/preset/manager/presetStorage.d.ts.map +1 -0
  256. package/build/domains/preset/manager/presetStorage.js +27 -0
  257. package/build/domains/preset/manager/presetStorage.js.map +1 -0
  258. package/build/domains/preset/manager/presetTesting.d.ts +8 -0
  259. package/build/domains/preset/manager/presetTesting.d.ts.map +1 -0
  260. package/build/domains/preset/manager/presetTesting.js +38 -0
  261. package/build/domains/preset/manager/presetTesting.js.map +1 -0
  262. package/build/domains/preset/manager/presetValidation.d.ts +3 -0
  263. package/build/domains/preset/manager/presetValidation.d.ts.map +1 -0
  264. package/build/domains/preset/manager/presetValidation.js +41 -0
  265. package/build/domains/preset/manager/presetValidation.js.map +1 -0
  266. package/build/domains/registry/cacheManager.d.ts.map +1 -1
  267. package/build/domains/registry/cacheManager.js +1 -0
  268. package/build/domains/registry/cacheManager.js.map +1 -1
  269. package/build/domains/registry/mcpRegistryClient.d.ts.map +1 -1
  270. package/build/domains/registry/mcpRegistryClient.js +2 -1
  271. package/build/domains/registry/mcpRegistryClient.js.map +1 -1
  272. package/build/transport/http/middlewares/scopeAuthMiddleware.d.ts +3 -0
  273. package/build/transport/http/middlewares/scopeAuthMiddleware.d.ts.map +1 -1
  274. package/build/transport/http/middlewares/scopeAuthMiddleware.js +18 -28
  275. package/build/transport/http/middlewares/scopeAuthMiddleware.js.map +1 -1
  276. package/build/transport/http/middlewares/tagsExtractor.d.ts.map +1 -1
  277. package/build/transport/http/middlewares/tagsExtractor.js +46 -255
  278. package/build/transport/http/middlewares/tagsExtractor.js.map +1 -1
  279. package/build/transport/http/routes/cliTokenRoute.d.ts.map +1 -1
  280. package/build/transport/http/routes/cliTokenRoute.js +20 -14
  281. package/build/transport/http/routes/cliTokenRoute.js.map +1 -1
  282. package/build/transport/http/routes/inspectRequestContext.d.ts +5 -0
  283. package/build/transport/http/routes/inspectRequestContext.d.ts.map +1 -0
  284. package/build/transport/http/routes/inspectRequestContext.js +59 -0
  285. package/build/transport/http/routes/inspectRequestContext.js.map +1 -0
  286. package/build/transport/http/routes/inspectRoutes.d.ts +3 -3
  287. package/build/transport/http/routes/inspectRoutes.d.ts.map +1 -1
  288. package/build/transport/http/routes/inspectRoutes.js +60 -83
  289. package/build/transport/http/routes/inspectRoutes.js.map +1 -1
  290. package/build/transport/http/routes/oauthRoutes.d.ts.map +1 -1
  291. package/build/transport/http/routes/oauthRoutes.js +99 -223
  292. package/build/transport/http/routes/oauthRoutes.js.map +1 -1
  293. package/build/transport/http/routes/streamableHttpRoutes.d.ts +2 -2
  294. package/build/transport/http/routes/streamableHttpRoutes.d.ts.map +1 -1
  295. package/build/transport/http/routes/streamableHttpRoutes.js +39 -84
  296. package/build/transport/http/routes/streamableHttpRoutes.js.map +1 -1
  297. package/build/transport/http/routes/toolRoutes.d.ts.map +1 -1
  298. package/build/transport/http/routes/toolRoutes.js +138 -39
  299. package/build/transport/http/routes/toolRoutes.js.map +1 -1
  300. package/build/transport/http/server.d.ts.map +1 -1
  301. package/build/transport/http/server.js +93 -0
  302. package/build/transport/http/server.js.map +1 -1
  303. package/build/transport/http/streamableSessionLifecycle.d.ts +90 -0
  304. package/build/transport/http/streamableSessionLifecycle.d.ts.map +1 -0
  305. package/build/transport/http/streamableSessionLifecycle.js +348 -0
  306. package/build/transport/http/streamableSessionLifecycle.js.map +1 -0
  307. package/build/transport/http/utils/contextExtractor.d.ts +1 -1
  308. package/build/transport/http/utils/contextExtractor.d.ts.map +1 -1
  309. package/build/transport/http/utils/contextExtractor.js +1 -33
  310. package/build/transport/http/utils/contextExtractor.js.map +1 -1
  311. package/build/transport/stdioProxyTransport.d.ts +1 -0
  312. package/build/transport/stdioProxyTransport.d.ts.map +1 -1
  313. package/build/transport/stdioProxyTransport.js +3 -0
  314. package/build/transport/stdioProxyTransport.js.map +1 -1
  315. package/build/transport/transportFactory.d.ts +1 -2
  316. package/build/transport/transportFactory.d.ts.map +1 -1
  317. package/build/transport/transportFactory.js +54 -4
  318. package/build/transport/transportFactory.js.map +1 -1
  319. package/build/transport/transportFactory.testSetup.d.ts +2 -0
  320. package/build/transport/transportFactory.testSetup.d.ts.map +1 -0
  321. package/build/transport/transportFactory.testSetup.js +83 -0
  322. package/build/transport/transportFactory.testSetup.js.map +1 -0
  323. package/build/utils/context/sessionIdentity.d.ts +9 -0
  324. package/build/utils/context/sessionIdentity.d.ts.map +1 -0
  325. package/build/utils/context/sessionIdentity.js +39 -0
  326. package/build/utils/context/sessionIdentity.js.map +1 -0
  327. package/build/utils/ui/interactiveSelector.d.ts +0 -25
  328. package/build/utils/ui/interactiveSelector.d.ts.map +1 -1
  329. package/build/utils/ui/interactiveSelector.js +12 -329
  330. package/build/utils/ui/interactiveSelector.js.map +1 -1
  331. package/build/utils/ui/interactiveSelectorPrompts.d.ts +7 -0
  332. package/build/utils/ui/interactiveSelectorPrompts.d.ts.map +1 -0
  333. package/build/utils/ui/interactiveSelectorPrompts.js +60 -0
  334. package/build/utils/ui/interactiveSelectorPrompts.js.map +1 -0
  335. package/build/utils/ui/interactiveSelectorQuery.d.ts +5 -0
  336. package/build/utils/ui/interactiveSelectorQuery.d.ts.map +1 -0
  337. package/build/utils/ui/interactiveSelectorQuery.js +67 -0
  338. package/build/utils/ui/interactiveSelectorQuery.js.map +1 -0
  339. package/build/utils/ui/interactiveSelectorTagUi.d.ts +7 -0
  340. package/build/utils/ui/interactiveSelectorTagUi.d.ts.map +1 -0
  341. package/build/utils/ui/interactiveSelectorTagUi.js +129 -0
  342. package/build/utils/ui/interactiveSelectorTagUi.js.map +1 -0
  343. package/package.json +2 -2
  344. package/build/transport/http/utils/sessionService.d.ts +0 -106
  345. package/build/transport/http/utils/sessionService.d.ts.map +0 -1
  346. package/build/transport/http/utils/sessionService.js +0 -342
  347. package/build/transport/http/utils/sessionService.js.map +0 -1
@@ -1,67 +1,14 @@
1
- import { CallToolRequestSchema, CallToolResultSchema, CompleteRequestSchema, CreateMessageRequestSchema, ElicitRequestSchema, GetPromptRequestSchema, ListPromptsRequestSchema, ListResourcesRequestSchema, ListResourceTemplatesRequestSchema, ListRootsRequestSchema, ListToolsRequestSchema, PingRequestSchema, ReadResourceRequestSchema, SetLevelRequestSchema, SubscribeRequestSchema, UnsubscribeRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
2
- import { McpConfigManager } from '../../config/mcpConfigManager.js';
3
- import { MCP_URI_SEPARATOR } from '../../constants.js';
4
- import { InternalCapabilitiesProvider } from '../../core/capabilities/internalCapabilitiesProvider.js';
5
- import { byCapabilities } from '../../core/filtering/clientFiltering.js';
6
- import { FilteringService } from '../../core/filtering/filteringService.js';
7
- import { createConnectionResolver } from '../../core/server/connectionResolver.js';
8
- import { filterDisabledTools, getDisabledToolError } from '../../core/server/disabledTools.js';
1
+ import { CreateMessageRequestSchema, ElicitRequestSchema, ListRootsRequestSchema, PingRequestSchema, SetLevelRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
9
2
  import { ServerManager } from '../../core/server/serverManager.js';
10
3
  import { ClientStatus } from '../../core/types/index.js';
11
- import { setLogLevel } from '../../logger/logger.js';
12
- import logger from '../../logger/logger.js';
4
+ import logger, { setLogLevel } from '../../logger/logger.js';
13
5
  import { withErrorHandling } from '../../utils/core/errorHandling.js';
14
- import { buildUri, parseUri } from '../../utils/core/parsing.js';
15
6
  import { getRequestTimeout } from '../../utils/core/timeoutUtils.js';
16
- import { handlePagination } from '../../utils/ui/pagination.js';
17
- /**
18
- * Extract session ID from inbound connection context
19
- * @param inboundConn The inbound connection
20
- * @returns The session ID or undefined
21
- */
22
- function getRequestSession(inboundConn) {
23
- return inboundConn.context?.sessionId;
24
- }
25
- /**
26
- * Resolve outbound connection by client name and session ID.
27
- * Key format:
28
- * - Static servers: name (no colon)
29
- * - Shareable template servers: name:renderedHash
30
- * - Per-client template servers: name:sessionId
31
- *
32
- * Resolution order:
33
- * 1. Try session-scoped key (for per-client template servers: name:sessionId)
34
- * 2. Try rendered hash-based key (for shareable template servers: name:renderedHash)
35
- * 3. Fall back to direct name lookup (for static servers: name)
36
- *
37
- * @param clientName The client/server name
38
- * @param sessionId The session ID (optional)
39
- * @param outboundConns The outbound connections map
40
- * @returns The resolved outbound connection or undefined
41
- */
42
- function resolveOutboundConnection(clientName, sessionId, outboundConns) {
43
- // Delegate to ConnectionResolver for cleaner abstraction
44
- const templateServerManager = ServerManager.current.getTemplateServerManager();
45
- const resolver = createConnectionResolver(outboundConns, templateServerManager);
46
- return resolver.resolve(clientName, sessionId);
47
- }
48
- /**
49
- * Filter outbound connections for a specific session.
50
- * Key format:
51
- * - Static servers: name (no colon) - always included
52
- * - Shareable template servers: name:renderedHash - included if session uses this hash
53
- * - Per-client template servers: name:sessionId - only included if session matches
54
- *
55
- * @param outboundConns The outbound connections map
56
- * @param sessionId The session ID (optional)
57
- * @returns A filtered map of outbound connections
58
- */
59
- function filterConnectionsForSession(outboundConns, sessionId) {
60
- // Delegate to ConnectionResolver for cleaner abstraction
61
- const templateServerManager = ServerManager.current.getTemplateServerManager();
62
- const resolver = createConnectionResolver(outboundConns, templateServerManager);
63
- return resolver.filterForSession(sessionId);
64
- }
7
+ import { registerCompletionHandlers, registerPromptHandlers } from './promptRequestHandlers.js';
8
+ import { createCapabilityCatalogFromConnections, filterConnectionsForSession, getRequestSession, resolveOutboundConnection, } from './requestHandlerUtils.js';
9
+ import { registerResourceHandlers } from './resourceRequestHandlers.js';
10
+ import { registerToolHandlers } from './toolRequestHandlers.js';
11
+ export { createCapabilityCatalogFromConnections, filterConnectionsForSession, getRequestSession, resolveOutboundConnection, };
65
12
  /**
66
13
  * Registers server-specific request handlers
67
14
  * @param outboundConns Record of client instances
@@ -143,335 +90,4 @@ export function registerRequestHandlers(outboundConns, inboundConn, lazyLoadingO
143
90
  // Register server-specific request handlers
144
91
  registerServerRequestHandlers(outboundConns, inboundConn);
145
92
  }
146
- /**
147
- * Registers resource-related request handlers
148
- * @param clients Record of client instances
149
- * @param serverInfo The MCP server instance
150
- */
151
- function registerResourceHandlers(outboundConns, inboundConn) {
152
- const sessionId = getRequestSession(inboundConn);
153
- // List Resources handler
154
- inboundConn.server.setRequestHandler(ListResourcesRequestSchema, withErrorHandling(async (request) => {
155
- // Filter connections for this session first
156
- const sessionFilteredConns = filterConnectionsForSession(outboundConns, sessionId);
157
- // Then filter by capabilities, then by tags
158
- const capabilityFilteredClients = byCapabilities({ resources: {} })(sessionFilteredConns);
159
- const filteredClients = FilteringService.getFilteredConnections(capabilityFilteredClients, inboundConn);
160
- const result = await handlePagination(filteredClients, request.params || {}, (client, params, opts) => client.listResources(params, opts), (outboundConn, result) => result.resources?.map((resource) => ({
161
- ...resource,
162
- uri: buildUri(outboundConn.name, resource.uri, MCP_URI_SEPARATOR),
163
- })) ?? [], inboundConn.enablePagination ?? false);
164
- return {
165
- resources: result.items,
166
- nextCursor: result.nextCursor,
167
- };
168
- }, 'Error listing resources'));
169
- // List Resource Templates handler
170
- inboundConn.server.setRequestHandler(ListResourceTemplatesRequestSchema, withErrorHandling(async (request) => {
171
- // Filter connections for this session first
172
- const sessionFilteredConns = filterConnectionsForSession(outboundConns, sessionId);
173
- // Then filter by capabilities, then by tags
174
- const capabilityFilteredClients = byCapabilities({ resources: {} })(sessionFilteredConns);
175
- const filteredClients = FilteringService.getFilteredConnections(capabilityFilteredClients, inboundConn);
176
- const result = await handlePagination(filteredClients, request.params || {}, (client, params, opts) => client.listResourceTemplates(params, opts), (outboundConn, result) => result.resourceTemplates?.map((template) => ({
177
- ...template,
178
- uriTemplate: buildUri(outboundConn.name, template.uriTemplate, MCP_URI_SEPARATOR),
179
- })) ?? [], inboundConn.enablePagination ?? false);
180
- return {
181
- resourceTemplates: result.items,
182
- nextCursor: result.nextCursor,
183
- };
184
- }, 'Error listing resource templates'));
185
- // Subscribe Resource handler
186
- inboundConn.server.setRequestHandler(SubscribeRequestSchema, withErrorHandling(async (request) => {
187
- const { clientName, resourceName } = parseUri(request.params.uri, MCP_URI_SEPARATOR);
188
- const outboundConn = resolveOutboundConnection(clientName, sessionId, outboundConns);
189
- if (!outboundConn) {
190
- throw new Error(`Unknown client: ${clientName}`);
191
- }
192
- return outboundConn.client.subscribeResource({ ...request.params, uri: resourceName }, {
193
- timeout: getRequestTimeout(outboundConn.transport),
194
- });
195
- }, 'Error subscribing to resource'));
196
- // Unsubscribe Resource handler
197
- inboundConn.server.setRequestHandler(UnsubscribeRequestSchema, withErrorHandling(async (request) => {
198
- const { clientName, resourceName } = parseUri(request.params.uri, MCP_URI_SEPARATOR);
199
- const outboundConn = resolveOutboundConnection(clientName, sessionId, outboundConns);
200
- if (!outboundConn) {
201
- throw new Error(`Unknown client: ${clientName}`);
202
- }
203
- return outboundConn.client.unsubscribeResource({ ...request.params, uri: resourceName }, {
204
- timeout: getRequestTimeout(outboundConn.transport),
205
- });
206
- }, 'Error unsubscribing from resource'));
207
- // Read Resource handler
208
- inboundConn.server.setRequestHandler(ReadResourceRequestSchema, withErrorHandling(async (request) => {
209
- const { clientName, resourceName } = parseUri(request.params.uri, MCP_URI_SEPARATOR);
210
- const outboundConn = resolveOutboundConnection(clientName, sessionId, outboundConns);
211
- if (!outboundConn) {
212
- throw new Error(`Unknown client: ${clientName}`);
213
- }
214
- const resource = await outboundConn.client.readResource({ ...request.params, uri: resourceName }, {
215
- timeout: getRequestTimeout(outboundConn.transport),
216
- });
217
- // Transform resource content URIs to include client name prefix
218
- const transformedResource = {
219
- ...resource,
220
- contents: resource.contents.map((content) => ({
221
- ...content,
222
- uri: buildUri(outboundConn.name, content.uri, MCP_URI_SEPARATOR),
223
- })),
224
- };
225
- return transformedResource;
226
- }, 'Error reading resource'));
227
- }
228
- /**
229
- * Registers tool-related request handlers
230
- * @param clients Record of client instances
231
- * @param serverInfo The MCP server instance
232
- */
233
- function registerToolHandlers(outboundConns, inboundConn, lazyLoadingOrchestrator) {
234
- const sessionId = getRequestSession(inboundConn);
235
- const lazyLoadingEnabled = lazyLoadingOrchestrator?.isEnabled();
236
- const getServerConfigs = () => McpConfigManager.getInstance().getTransportConfig();
237
- // List Tools handler
238
- inboundConn.server.setRequestHandler(ListToolsRequestSchema, withErrorHandling(async (request) => {
239
- // If lazy loading is enabled, use LazyLoadingOrchestrator for tool listing
240
- if (lazyLoadingEnabled && lazyLoadingOrchestrator) {
241
- // Apply the same filtering chain as normal mode
242
- // Step 1: Filter by session (for template servers like serena)
243
- const sessionFilteredConns = filterConnectionsForSession(outboundConns, sessionId);
244
- // Step 2: Filter by capability (servers with tools)
245
- const capabilityFilteredClients = byCapabilities({ tools: {} })(sessionFilteredConns);
246
- // Step 3: Filter by preset/tag configuration
247
- const filteredClients = FilteringService.getFilteredConnections(capabilityFilteredClients, inboundConn);
248
- // Get the set of filtered server names
249
- const filteredServerNames = new Set(Array.from(filteredClients.values()).map((conn) => conn.name));
250
- // Debug logging
251
- logger.info('Lazy loading: filtered servers', {
252
- totalOutbound: outboundConns.size,
253
- sessionFiltered: sessionFilteredConns.size,
254
- capabilityFiltered: capabilityFilteredClients.size,
255
- finalFiltered: filteredClients.size,
256
- filteredServerNames: Array.from(filteredServerNames),
257
- inboundConfig: {
258
- tagFilterMode: inboundConn.tagFilterMode,
259
- tags: inboundConn.tags,
260
- tagExpression: inboundConn.tagExpression,
261
- },
262
- });
263
- // Get capabilities from orchestrator with filtered servers
264
- // Store the session filter so that subsequent tool_list meta-tool calls
265
- // will return only tools from the filtered servers
266
- const capabilities = await lazyLoadingOrchestrator.getCapabilitiesForFilteredServers(filteredServerNames, sessionId);
267
- // Get internal tools (always fully loaded) - filter out lazy tools when lazy loading is enabled
268
- const internalProvider = InternalCapabilitiesProvider.getInstance();
269
- await internalProvider.initialize();
270
- const internalTools = internalProvider.getAvailableTools();
271
- // Filter out lazy tools since they're provided by the MetaToolProvider
272
- const lazyToolNames = ['tool_list', 'tool_schema', 'tool_invoke'];
273
- const nonLazyTools = internalTools.filter((tool) => !lazyToolNames.includes(tool.name));
274
- // Add internal tools to the result (with 1mcp prefix)
275
- const internalToolsWithPrefix = nonLazyTools.map((tool) => ({
276
- ...tool,
277
- name: buildUri('1mcp', tool.name, MCP_URI_SEPARATOR),
278
- }));
279
- // Combine lazy-loaded tools with internal tools
280
- const allTools = [...capabilities.tools, ...internalToolsWithPrefix];
281
- return {
282
- tools: allTools,
283
- };
284
- }
285
- // Normal mode: get tools from external MCP servers
286
- // Filter connections for this session first
287
- const sessionFilteredConns = filterConnectionsForSession(outboundConns, sessionId);
288
- // Then filter by capabilities, then by tags
289
- const capabilityFilteredClients = byCapabilities({ tools: {} })(sessionFilteredConns);
290
- const filteredClients = FilteringService.getFilteredConnections(capabilityFilteredClients, inboundConn);
291
- // Get tools from external MCP servers
292
- const result = await handlePagination(filteredClients, request.params || {}, (client, params, opts) => client.listTools(params, opts), (outboundConn, result) => filterDisabledTools(result.tools || [], getServerConfigs(), outboundConn.name).map((tool) => ({
293
- ...tool,
294
- name: buildUri(outboundConn.name, tool.name, MCP_URI_SEPARATOR),
295
- })) ?? [], inboundConn.enablePagination ?? false);
296
- // Get internal tools if enabled
297
- const internalProvider = InternalCapabilitiesProvider.getInstance();
298
- await internalProvider.initialize();
299
- const internalTools = internalProvider.getAvailableTools();
300
- // Add internal tools to the result (with 1mcp prefix)
301
- const internalToolsWithPrefix = internalTools.map((tool) => ({
302
- ...tool,
303
- name: buildUri('1mcp', tool.name, MCP_URI_SEPARATOR),
304
- }));
305
- // Combine external and internal tools
306
- const allTools = [...result.items, ...internalToolsWithPrefix];
307
- return {
308
- tools: allTools,
309
- nextCursor: result.nextCursor,
310
- };
311
- }, 'Error listing tools'));
312
- // Call Tool handler
313
- inboundConn.server.setRequestHandler(CallToolRequestSchema, withErrorHandling(async (request) => {
314
- const toolName = request.params.name;
315
- // Check if this is an unprefixed meta-tool call (when lazy loading is enabled)
316
- const isUnprefixedMetaTool = lazyLoadingEnabled && lazyLoadingOrchestrator && lazyLoadingOrchestrator.isMetaTool(toolName);
317
- if (isUnprefixedMetaTool && lazyLoadingOrchestrator) {
318
- let result;
319
- try {
320
- result = await lazyLoadingOrchestrator.callMetaTool(toolName, request.params.arguments, sessionId);
321
- }
322
- catch (metaToolError) {
323
- logger.error(`Meta-tool ${toolName} execution failed: ${metaToolError}`);
324
- throw new Error(`Meta-tool ${toolName} failed: ${metaToolError instanceof Error ? metaToolError.message : String(metaToolError)}`);
325
- }
326
- // CRITICAL: Do not throw errors for structured error responses
327
- // Meta-tools return structured errors in the result itself (with error.type and error.message)
328
- // These should be returned to the client as-is, not thrown as exceptions
329
- // The client will parse the structured error from the content field
330
- // Return both content and structuredContent (required by MCP protocol for tools with outputSchema)
331
- return {
332
- content: [
333
- {
334
- type: 'text',
335
- text: JSON.stringify(result, null, 2),
336
- },
337
- ],
338
- structuredContent: result,
339
- };
340
- }
341
- // CRITICAL: Handle unprefixed tool names when lazy loading is enabled
342
- // If lazy loading is on and the tool name doesn't have the URI separator format,
343
- // return a proper error instead of throwing during URI parsing
344
- const isUnprefixedTool = lazyLoadingEnabled && !toolName.includes(MCP_URI_SEPARATOR);
345
- if (isUnprefixedTool) {
346
- // Unknown unprefixed tool in lazy loading mode
347
- const errorResult = {
348
- error: {
349
- type: 'not_found',
350
- message: `Unknown tool: ${toolName}. In lazy loading mode, use meta-tools (tool_list, tool_schema, tool_invoke) to discover and call tools.`,
351
- },
352
- };
353
- return {
354
- content: [
355
- {
356
- type: 'text',
357
- text: JSON.stringify(errorResult, null, 2),
358
- },
359
- ],
360
- structuredContent: errorResult,
361
- };
362
- }
363
- const { clientName, resourceName: extractedToolName } = parseUri(toolName, MCP_URI_SEPARATOR);
364
- // Handle 1mcp tools (includes both internal tools and lazy tools)
365
- if (clientName === '1mcp') {
366
- const internalProvider = InternalCapabilitiesProvider.getInstance();
367
- await internalProvider.initialize();
368
- const result = await internalProvider.executeTool(extractedToolName, request.params.arguments, sessionId);
369
- // For tools with output schemas, return both content and structuredContent
370
- // This is required by the MCP protocol when outputSchema is defined
371
- return {
372
- content: [
373
- {
374
- type: 'text',
375
- text: JSON.stringify(result, null, 2),
376
- },
377
- ],
378
- structuredContent: result,
379
- };
380
- }
381
- // Handle external MCP server tools
382
- const disabledError = getDisabledToolError(getServerConfigs(), clientName, extractedToolName);
383
- if (disabledError) {
384
- const errorResult = {
385
- error: {
386
- type: disabledError.type,
387
- message: disabledError.message,
388
- },
389
- };
390
- return {
391
- content: [
392
- {
393
- type: 'text',
394
- text: JSON.stringify(errorResult, null, 2),
395
- },
396
- ],
397
- structuredContent: errorResult,
398
- };
399
- }
400
- const outboundConn = resolveOutboundConnection(clientName, sessionId, outboundConns);
401
- if (!outboundConn) {
402
- throw new Error(`Unknown client: ${clientName}`);
403
- }
404
- return outboundConn.client.callTool({ ...request.params, name: extractedToolName }, CallToolResultSchema, {
405
- timeout: getRequestTimeout(outboundConn.transport),
406
- });
407
- }, 'Error calling tool'));
408
- }
409
- /**
410
- * Registers prompt-related request handlers
411
- * @param clients Record of client instances
412
- * @param serverInfo The MCP server instance
413
- */
414
- function registerPromptHandlers(outboundConns, inboundConn) {
415
- const sessionId = getRequestSession(inboundConn);
416
- // List Prompts handler
417
- inboundConn.server.setRequestHandler(ListPromptsRequestSchema, withErrorHandling(async (request) => {
418
- // Filter connections for this session first
419
- const sessionFilteredConns = filterConnectionsForSession(outboundConns, sessionId);
420
- // Then filter by capabilities, then by tags
421
- const capabilityFilteredClients = byCapabilities({ prompts: {} })(sessionFilteredConns);
422
- const filteredClients = FilteringService.getFilteredConnections(capabilityFilteredClients, inboundConn);
423
- const result = await handlePagination(filteredClients, request.params || {}, (client, params, opts) => client.listPrompts(params, opts), (outboundConn, result) => result.prompts?.map((prompt) => ({
424
- ...prompt,
425
- name: buildUri(outboundConn.name, prompt.name, MCP_URI_SEPARATOR),
426
- })) ?? [], inboundConn.enablePagination ?? false);
427
- return {
428
- prompts: result.items,
429
- nextCursor: result.nextCursor,
430
- };
431
- }, 'Error listing prompts'));
432
- // Get Prompt handler
433
- inboundConn.server.setRequestHandler(GetPromptRequestSchema, withErrorHandling(async (request) => {
434
- const { clientName, resourceName: promptName } = parseUri(request.params.name, MCP_URI_SEPARATOR);
435
- const outboundConn = resolveOutboundConnection(clientName, sessionId, outboundConns);
436
- if (!outboundConn) {
437
- throw new Error(`Unknown client: ${clientName}`);
438
- }
439
- return outboundConn.client.getPrompt({ ...request.params, name: promptName });
440
- }, 'Error getting prompt'));
441
- }
442
- /**
443
- * Registers completion-related request handlers
444
- * @param clients Record of client instances
445
- * @param serverInfo The MCP server instance
446
- */
447
- function registerCompletionHandlers(outboundConns, inboundConn) {
448
- const sessionId = getRequestSession(inboundConn);
449
- inboundConn.server.setRequestHandler(CompleteRequestSchema, withErrorHandling(async (request) => {
450
- const { ref } = request.params;
451
- let clientName;
452
- let updatedRef;
453
- if (ref.type === 'ref/prompt') {
454
- const { clientName: cn, resourceName } = parseUri(ref.name, MCP_URI_SEPARATOR);
455
- clientName = cn;
456
- updatedRef = { ...ref, name: resourceName };
457
- }
458
- else if (ref.type === 'ref/resource') {
459
- const { clientName: cn, resourceName } = parseUri(ref.uri, MCP_URI_SEPARATOR);
460
- clientName = cn;
461
- updatedRef = { ...ref, uri: resourceName };
462
- }
463
- else {
464
- // This should be caught by the schema validation, but as a safeguard:
465
- throw new Error(`Unsupported completion reference type: ${ref.type}`);
466
- }
467
- const params = { ...request.params, ref: updatedRef };
468
- const outboundConn = resolveOutboundConnection(clientName, sessionId, outboundConns);
469
- if (!outboundConn) {
470
- throw new Error(`Unknown client: ${clientName}`);
471
- }
472
- return outboundConn.client.complete(params, {
473
- timeout: getRequestTimeout(outboundConn.transport),
474
- });
475
- }, 'Error handling completion'));
476
- }
477
93
  //# sourceMappingURL=requestHandlers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"requestHandlers.js","sourceRoot":"","sources":["../../../src/core/protocol/requestHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EAEpB,qBAAqB,EAErB,0BAA0B,EAE1B,mBAAmB,EACnB,sBAAsB,EAEtB,wBAAwB,EAExB,0BAA0B,EAE1B,kCAAkC,EAElC,sBAAsB,EAEtB,sBAAsB,EACtB,iBAAiB,EACjB,yBAAyB,EACzB,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,4BAA4B,EAAE,MAAM,wDAAwD,CAAC;AAEtG,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAC9F,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,YAAY,EAA8D,MAAM,0BAA0B,CAAC;AAEpH,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,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AAuB,CAAC,CAAC;IAE1E,mCAAmC;IACnC,sBAAsB,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;IAEnD,uCAAuC;IACvC,0BAA0B,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;IAEvD,4CAA4C;IAC5C,6BAA6B,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;AAC5D,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { InboundConnection, OutboundConnections } from '../../core/types/index.js';
2
+ export declare function registerResourceHandlers(outboundConns: OutboundConnections, inboundConn: InboundConnection): void;
3
+ //# sourceMappingURL=resourceRequestHandlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resourceRequestHandlers.d.ts","sourceRoot":"","sources":["../../../src/core/protocol/resourceRequestHandlers.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAQlF,wBAAgB,wBAAwB,CAAC,aAAa,EAAE,mBAAmB,EAAE,WAAW,EAAE,iBAAiB,GAAG,IAAI,CAiHjH"}
@@ -0,0 +1,76 @@
1
+ import { ListResourcesRequestSchema, ListResourceTemplatesRequestSchema, ReadResourceRequestSchema, SubscribeRequestSchema, UnsubscribeRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
2
+ import { MCP_URI_SEPARATOR } from '../../constants.js';
3
+ import { byCapabilities } from '../../core/filtering/clientFiltering.js';
4
+ import { FilteringService } from '../../core/filtering/filteringService.js';
5
+ import { withErrorHandling } from '../../utils/core/errorHandling.js';
6
+ import { buildUri, parseUri } from '../../utils/core/parsing.js';
7
+ import { getRequestTimeout } from '../../utils/core/timeoutUtils.js';
8
+ import { handlePagination } from '../../utils/ui/pagination.js';
9
+ import { filterConnectionsForSession, getRequestSession, resolveOutboundConnection } from './requestHandlerUtils.js';
10
+ export function registerResourceHandlers(outboundConns, inboundConn) {
11
+ const sessionId = getRequestSession(inboundConn);
12
+ inboundConn.server.setRequestHandler(ListResourcesRequestSchema, withErrorHandling(async (request) => {
13
+ const sessionFilteredConns = filterConnectionsForSession(outboundConns, sessionId);
14
+ const capabilityFilteredClients = byCapabilities({ resources: {} })(sessionFilteredConns);
15
+ const filteredClients = FilteringService.getFilteredConnections(capabilityFilteredClients, inboundConn);
16
+ const result = await handlePagination(filteredClients, request.params || {}, (client, params, opts) => client.listResources(params, opts), (outboundConn, result) => result.resources?.map((resource) => ({
17
+ ...resource,
18
+ uri: buildUri(outboundConn.name, resource.uri, MCP_URI_SEPARATOR),
19
+ })) ?? [], inboundConn.enablePagination ?? false);
20
+ return {
21
+ resources: result.items,
22
+ nextCursor: result.nextCursor,
23
+ };
24
+ }, 'Error listing resources'));
25
+ inboundConn.server.setRequestHandler(ListResourceTemplatesRequestSchema, withErrorHandling(async (request) => {
26
+ const sessionFilteredConns = filterConnectionsForSession(outboundConns, sessionId);
27
+ const capabilityFilteredClients = byCapabilities({ resources: {} })(sessionFilteredConns);
28
+ const filteredClients = FilteringService.getFilteredConnections(capabilityFilteredClients, inboundConn);
29
+ const result = await handlePagination(filteredClients, request.params || {}, (client, params, opts) => client.listResourceTemplates(params, opts), (outboundConn, result) => result.resourceTemplates?.map((template) => ({
30
+ ...template,
31
+ uriTemplate: buildUri(outboundConn.name, template.uriTemplate, MCP_URI_SEPARATOR),
32
+ })) ?? [], inboundConn.enablePagination ?? false);
33
+ return {
34
+ resourceTemplates: result.items,
35
+ nextCursor: result.nextCursor,
36
+ };
37
+ }, 'Error listing resource templates'));
38
+ inboundConn.server.setRequestHandler(SubscribeRequestSchema, withErrorHandling(async (request) => {
39
+ const { clientName, resourceName } = parseUri(request.params.uri, MCP_URI_SEPARATOR);
40
+ const outboundConn = resolveOutboundConnection(clientName, sessionId, outboundConns, inboundConn);
41
+ if (!outboundConn) {
42
+ throw new Error(`Unknown client: ${clientName}`);
43
+ }
44
+ return outboundConn.client.subscribeResource({ ...request.params, uri: resourceName }, {
45
+ timeout: getRequestTimeout(outboundConn.transport),
46
+ });
47
+ }, 'Error subscribing to resource'));
48
+ inboundConn.server.setRequestHandler(UnsubscribeRequestSchema, withErrorHandling(async (request) => {
49
+ const { clientName, resourceName } = parseUri(request.params.uri, MCP_URI_SEPARATOR);
50
+ const outboundConn = resolveOutboundConnection(clientName, sessionId, outboundConns, inboundConn);
51
+ if (!outboundConn) {
52
+ throw new Error(`Unknown client: ${clientName}`);
53
+ }
54
+ return outboundConn.client.unsubscribeResource({ ...request.params, uri: resourceName }, {
55
+ timeout: getRequestTimeout(outboundConn.transport),
56
+ });
57
+ }, 'Error unsubscribing from resource'));
58
+ inboundConn.server.setRequestHandler(ReadResourceRequestSchema, withErrorHandling(async (request) => {
59
+ const { clientName, resourceName } = parseUri(request.params.uri, MCP_URI_SEPARATOR);
60
+ const outboundConn = resolveOutboundConnection(clientName, sessionId, outboundConns, inboundConn);
61
+ if (!outboundConn) {
62
+ throw new Error(`Unknown client: ${clientName}`);
63
+ }
64
+ const resource = await outboundConn.client.readResource({ ...request.params, uri: resourceName }, {
65
+ timeout: getRequestTimeout(outboundConn.transport),
66
+ });
67
+ return {
68
+ ...resource,
69
+ contents: resource.contents.map((content) => ({
70
+ ...content,
71
+ uri: buildUri(outboundConn.name, content.uri, MCP_URI_SEPARATOR),
72
+ })),
73
+ };
74
+ }, 'Error reading resource'));
75
+ }
76
+ //# sourceMappingURL=resourceRequestHandlers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resourceRequestHandlers.js","sourceRoot":"","sources":["../../../src/core/protocol/resourceRequestHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,0BAA0B,EAE1B,kCAAkC,EAClC,yBAAyB,EACzB,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AA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AC,SAAS,CAAC;SACnD,CACF,CAAC;IACJ,CAAC,EAAE,mCAAmC,CAAC,CACxC,CAAC;IAEF,WAAW,CAAC,MAAM,CAAC,iBAAiB,CAClC,yBAAyB,EACzB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QAClC,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC;QACrF,MAAM,YAAY,GAAG,yBAAyB,CAAC,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC;QAClG,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CAAC,mBAAmB,UAAU,EAAE,CAAC,CAAC;QACnD,CAAC;QACD,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,MAAM,CAAC,YAAY,CACrD,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,GAAG,EAAE,YAAY,EAAE,EACxC;YACE,OAAO,EAAE,iBAAiB,CAAC,YAAY,CAAC,SAAS,CAAC;SACnD,CACF,CAAC;QAEF,OAAO;YACL,GAAG,QAAQ;YACX,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;gBAC5C,GAAG,OAAO;gBACV,GAAG,EAAE,QAAQ,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,EAAE,iBAAiB,CAAC;aACjE,CAAC,CAAC;SACJ,CAAC;IACJ,CAAC,EAAE,wBAAwB,CAAC,CAC7B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { LazyLoadingOrchestrator } from '../../core/capabilities/lazyLoadingOrchestrator.js';
2
+ import { InboundConnection, OutboundConnections } from '../../core/types/index.js';
3
+ export declare function registerToolHandlers(outboundConns: OutboundConnections, inboundConn: InboundConnection, lazyLoadingOrchestrator?: LazyLoadingOrchestrator): void;
4
+ //# sourceMappingURL=toolRequestHandlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolRequestHandlers.d.ts","sourceRoot":"","sources":["../../../src/core/protocol/toolRequestHandlers.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,uBAAuB,EAAE,MAAM,mDAAmD,CAAC;AAI5F,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAclF,wBAAgB,oBAAoB,CAClC,aAAa,EAAE,mBAAmB,EAClC,WAAW,EAAE,iBAAiB,EAC9B,uBAAuB,CAAC,EAAE,uBAAuB,GAChD,IAAI,CA0IN"}