@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
@@ -0,0 +1,124 @@
1
+ import path from 'node:path';
2
+ const LEGACY_MANAGED_BLOCK_PATTERN = /<!-- BEGIN 1MCP MANAGED STARTUP DOCS -->[\s\S]*?<!-- END 1MCP MANAGED STARTUP DOCS -->\n?/gm;
3
+ export function shouldEagerlyInspectServer(server) {
4
+ if (server.type === 'template') {
5
+ return true;
6
+ }
7
+ return server.available !== false && server.status !== 'disconnected';
8
+ }
9
+ export function assembleInstructionDetail(input) {
10
+ const { summary, inspected } = input;
11
+ if (inspected) {
12
+ return {
13
+ server: inspected.server,
14
+ type: inspected.type,
15
+ status: inspected.status,
16
+ available: inspected.available,
17
+ toolCount: inspected.totalTools ?? inspected.tools.length,
18
+ hasInstructions: Boolean(inspected.instructions?.trim()),
19
+ instructions: inspected.instructions,
20
+ note: inspected.instructions ? undefined : '(none provided)',
21
+ };
22
+ }
23
+ return {
24
+ server: summary.server,
25
+ type: summary.type,
26
+ status: summary.status,
27
+ available: summary.available,
28
+ toolCount: summary.toolCount,
29
+ hasInstructions: summary.hasInstructions,
30
+ instructions: input.inspectFailed ? null : input.cachedInstructions,
31
+ note: summary.type === 'template' && input.inspectFailed
32
+ ? '(unavailable: template server could not be initialized with the current context)'
33
+ : '(unavailable: server is not currently connected)',
34
+ };
35
+ }
36
+ export async function collectInstructionDetails(input) {
37
+ const details = [];
38
+ const cachedInstructions = input.cachedInstructions ?? {};
39
+ for (const server of input.servers) {
40
+ if (!shouldEagerlyInspectServer(server)) {
41
+ details.push(assembleInstructionDetail({ summary: server, cachedInstructions: cachedInstructions[server.server] }));
42
+ continue;
43
+ }
44
+ try {
45
+ const inspected = await input.inspectServer(server.server);
46
+ if (!isInstructionServerInspectResult(inspected)) {
47
+ details.push(assembleUnavailableDetail(server));
48
+ continue;
49
+ }
50
+ details.push(assembleInstructionDetail({ summary: server, inspected }));
51
+ }
52
+ catch {
53
+ details.push(assembleInstructionDetail({ summary: server, inspectFailed: true }));
54
+ }
55
+ }
56
+ return details;
57
+ }
58
+ function isInstructionServerInspectResult(inspected) {
59
+ return inspected.kind === 'server';
60
+ }
61
+ function assembleUnavailableDetail(server) {
62
+ return {
63
+ server: server.server,
64
+ type: server.type,
65
+ status: server.status,
66
+ available: server.available,
67
+ toolCount: server.toolCount,
68
+ hasInstructions: server.hasInstructions,
69
+ instructions: null,
70
+ note: '(unavailable)',
71
+ };
72
+ }
73
+ export function renderManagedDocContent() {
74
+ return [
75
+ '# 1MCP Agent Bootstrap',
76
+ '',
77
+ 'If this session already received the current 1MCP instructions content from hooks, do not run `1mcp instructions` again.',
78
+ 'Otherwise, run `1mcp instructions` before using any 1MCP-managed MCP servers.',
79
+ '',
80
+ 'Always use the 1MCP CLI as the entrypoint for upstream MCP capabilities. Do not call replaced upstream MCP servers directly when 1MCP is available.',
81
+ '',
82
+ 'Required workflow after you have the instructions content:',
83
+ '1. Review the available servers and choose the one that matches the task.',
84
+ '2. Run `1mcp inspect <server>` before selecting a tool.',
85
+ '3. Run `1mcp inspect <server>/<tool>` before invoking that tool.',
86
+ "4. Run `1mcp run <server>/<tool> --args '<json>'` only after inspecting the tool schema.",
87
+ '',
88
+ 'Use `--preset`, `--tags`, or `--tag-filter` with `1mcp instructions`, `inspect`, and `run` when you need a narrower server set.',
89
+ '',
90
+ ].join('\n');
91
+ }
92
+ export function renderStartupDocManagedBlock(startupDocPath, managedDocPath) {
93
+ if (path.basename(startupDocPath) === 'AGENTS.md' && path.dirname(startupDocPath) === path.dirname(managedDocPath)) {
94
+ return `@${managedDocPath.replace(/\\/g, '/')}\n`;
95
+ }
96
+ const relativePath = path.relative(path.dirname(startupDocPath), managedDocPath).replace(/\\/g, '/');
97
+ return `@${relativePath}\n`;
98
+ }
99
+ export function renderStartupDocManagedBlockForClient(input) {
100
+ if (input.target === 'codex' && input.scope === 'global') {
101
+ return `@${input.managedDocPath.replace(/\\/g, '/')}\n`;
102
+ }
103
+ const relativePath = path.relative(path.dirname(input.startupDocPath), input.managedDocPath).replace(/\\/g, '/');
104
+ return `@${relativePath}\n`;
105
+ }
106
+ export function upsertStartupDocManagedBlock(existingContent, managedBlock) {
107
+ const normalizedExisting = existingContent.replace(/\r\n/g, '\n');
108
+ const referenceLine = managedBlock.trim();
109
+ const managedReferenceAliases = new Set([referenceLine]);
110
+ if (referenceLine.startsWith('@/') && referenceLine.endsWith('/1MCP.md')) {
111
+ managedReferenceAliases.add('@1MCP.md');
112
+ }
113
+ const withoutLegacyBlocks = normalizedExisting.replace(LEGACY_MANAGED_BLOCK_PATTERN, '');
114
+ const remainingLines = withoutLegacyBlocks
115
+ .split('\n')
116
+ .filter((line) => !managedReferenceAliases.has(line.trim()))
117
+ .join('\n')
118
+ .trimEnd();
119
+ if (remainingLines.length === 0) {
120
+ return `${referenceLine}\n`;
121
+ }
122
+ return `${remainingLines}\n${referenceLine}\n`;
123
+ }
124
+ //# sourceMappingURL=instructionsDistribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instructionsDistribution.js","sourceRoot":"","sources":["../../../src/core/instructions/instructionsDistribution.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAsD7B,MAAM,4BAA4B,GAChC,6FAA6F,CAAC;AAEhG,MAAM,UAAU,0BAA0B,CAAC,MAAgC;IACzE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notification(forwardedNotification);
39
+ await inboundConn.server.notification(forwardedNotification);
40
40
  }
41
41
  catch (error) {
42
42
  if (error instanceof Error && error.message.includes('Not connected')) {
@@ -85,7 +85,7 @@ export function setupServerToClientNotifications(outboundConns, inboundConn) {
85
85
  client: name,
86
86
  },
87
87
  };
88
- outboundConn.client.notification(forwardedNotification);
88
+ await outboundConn.client.notification(forwardedNotification);
89
89
  }
90
90
  catch (error) {
91
91
  if (error instanceof Error && error.message.includes('Not connected')) {
@@ -1 +1 @@
1
- {"version":3,"file":"notificationHandlers.js","sourceRoot":"","sources":["../../../src/core/protocol/notificationHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,gCAAgC,EAChC,0BAA0B,EAC1B,mCAAmC,EACnC,qCAAqC,EACrC,iCAAiC,EACjC,kCAAkC,EAClC,iCAAiC,GAClC,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,YAAY,EAA0C,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC9G,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAErE;;;;GAIG;AACH,MAAM,UAAU,gCAAgC,CAC9C,aAAkC,EAClC,WAA8B;IAE9B,MAAM,yBAAyB,GAAG;QAChC,2BAA2B;QAC3B,0BAA0B;QAC1B,gCAAgC;QAChC,iCAAiC;QACjC,qCAAqC;QACrC,iCAAiC;QACjC,mCAAmC;KACpC,CAAC;IAEF,KAAK,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,IAAI,aAAa,CAAC,OAAO,EAAE,EAAE,CAAC;QAC3D,yBAAyB,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;YAC3C,YAAY,CAAC,MAAM,CAAC,sBAAsB,CACxC,MAAM,EACN,iBAAiB,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE;gBACvC,MAAM,CAAC,IAAI,CAAC,oCAAoC,IAAI,IAAI,IAAI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H,CAAC"}
1
+ {"version":3,"file":"notificationHandlers.js","sourceRoot":"","sources":["../../../src/core/protocol/notificationHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,gCAAgC,EAChC,0BAA0B,EAC1B,mCAAmC,EACnC,qCAAqC,EACrC,iCAAiC,EACjC,kCAAkC,EAClC,iCAAiC,GAClC,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,YAAY,EAA0C,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC9G,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAErE;;;;GAIG;AACH,MAAM,UAAU,gCAAgC,CAC9C,aAAkC,EAClC,WAA8B;IAE9B,MAAM,yBAAyB,GAAG;QAChC,2BAA2B;QAC3B,0BAA0B;QAC1B,gCAAgC;QAChC,iCAAiC;QACjC,qCAAqC;QACrC,iCAAiC;QACjC,mCAAmC;KACpC,CAAC;IAEF,KAAK,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,IAAI,aAAa,CAAC,OAAO,EAAE,EAAE,CAAC;QAC3D,yBAAyB,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;YAC3C,YAAY,CAAC,MAAM,CAAC,sBAAsB,CACxC,MAAM,EACN,iBAAiB,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE;gBACvC,MAAM,CAAC,IAAI,CAAC,oCAAoC,IAAI,IAAI,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;gBAExF,yDAAyD;gBACzD,IAAI,WAAW,CAAC,MAAM,KAAK,YAAY,CAAC,SAAS,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;oBACnF,MAAM,CAAC,IAAI,CAAC,8DAA8D,IAAI,EAAE,CAAC,CAAC;oBAClF,OAAO;gBACT,CAAC;gBAED,+DAA+D;gBAC/D,IAAI,CAAC;oBACH,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,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;gBACxF,IAAI,YAAY,CAAC,MAAM,KAAK,YAAY,CAAC,SAAS,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;oBACrF,MAAM,CAAC,IAAI,CAAC,UAAU,IAAI,2CAA2C,CAAC,CAAC;oBACvE,OAAO;gBACT,CAAC;gBAED,+DAA+D;gBAC/D,IAAI,CAAC;oBACH,6DAA6D;oBAC7D,MAAM,qBAAqB,GAAG;wBAC5B,MAAM,EAAE,YAAY,CAAC,MAAM;wBAC3B,MAAM,EAAE;4BACN,GAAG,YAAY,CAAC,MAAM;4BACtB,MAAM,EAAE,IAAI;yBACb;qBACF,CAAC;oBACF,MAAM,YAAY,CAAC,MAAM,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;gBAChE,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,IAAI,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;wBACtE,MAAM,CAAC,IAAI,CAAC,UAAU,IAAI,kDAAkD,CAAC,CAAC;oBAChF,CAAC;yBAAM,CAAC;wBACN,MAAM,CAAC,KAAK,CAAC,kCAAkC,IAAI,KAAK,KAAK,EAAE,CAAC,CAAC;oBACnE,CAAC;gBACH,CAAC;YACH,CAAC,EAAE,yCAAyC,IAAI,EAAE,CAAC,CACpD,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { InboundConnection, OutboundConnections } from '../../core/types/index.js';
2
+ export declare function registerPromptHandlers(outboundConns: OutboundConnections, inboundConn: InboundConnection): void;
3
+ export declare function registerCompletionHandlers(outboundConns: OutboundConnections, inboundConn: InboundConnection): void;
4
+ //# sourceMappingURL=promptRequestHandlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promptRequestHandlers.d.ts","sourceRoot":"","sources":["../../../src/core/protocol/promptRequestHandlers.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAQlF,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,mBAAmB,EAAE,WAAW,EAAE,iBAAiB,GAAG,IAAI,CA6C/G;AAED,wBAAgB,0BAA0B,CAAC,aAAa,EAAE,mBAAmB,EAAE,WAAW,EAAE,iBAAiB,GAAG,IAAI,CAkCnH"}
@@ -0,0 +1,64 @@
1
+ import { CompleteRequestSchema, GetPromptRequestSchema, ListPromptsRequestSchema, } 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 registerPromptHandlers(outboundConns, inboundConn) {
11
+ const sessionId = getRequestSession(inboundConn);
12
+ inboundConn.server.setRequestHandler(ListPromptsRequestSchema, withErrorHandling(async (request) => {
13
+ const sessionFilteredConns = filterConnectionsForSession(outboundConns, sessionId);
14
+ const capabilityFilteredClients = byCapabilities({ prompts: {} })(sessionFilteredConns);
15
+ const filteredClients = FilteringService.getFilteredConnections(capabilityFilteredClients, inboundConn);
16
+ const result = await handlePagination(filteredClients, request.params || {}, (client, params, opts) => client.listPrompts(params, opts), (outboundConn, result) => result.prompts?.map((prompt) => ({
17
+ ...prompt,
18
+ name: buildUri(outboundConn.name, prompt.name, MCP_URI_SEPARATOR),
19
+ })) ?? [], inboundConn.enablePagination ?? false);
20
+ return {
21
+ prompts: result.items,
22
+ nextCursor: result.nextCursor,
23
+ };
24
+ }, 'Error listing prompts'));
25
+ inboundConn.server.setRequestHandler(GetPromptRequestSchema, withErrorHandling(async (request) => {
26
+ const { clientName, resourceName: promptName } = parseUri(request.params.name, MCP_URI_SEPARATOR);
27
+ const outboundConn = resolveOutboundConnection(clientName, sessionId, outboundConns, inboundConn);
28
+ if (!outboundConn) {
29
+ throw new Error(`Unknown client: ${clientName}`);
30
+ }
31
+ return outboundConn.client.getPrompt({ ...request.params, name: promptName }, {
32
+ timeout: getRequestTimeout(outboundConn.transport),
33
+ });
34
+ }, 'Error getting prompt'));
35
+ }
36
+ export function registerCompletionHandlers(outboundConns, inboundConn) {
37
+ const sessionId = getRequestSession(inboundConn);
38
+ inboundConn.server.setRequestHandler(CompleteRequestSchema, withErrorHandling(async (request) => {
39
+ const { ref } = request.params;
40
+ let clientName;
41
+ let updatedRef;
42
+ if (ref.type === 'ref/prompt') {
43
+ const { clientName: cn, resourceName } = parseUri(ref.name, MCP_URI_SEPARATOR);
44
+ clientName = cn;
45
+ updatedRef = { ...ref, name: resourceName };
46
+ }
47
+ else if (ref.type === 'ref/resource') {
48
+ const { clientName: cn, resourceName } = parseUri(ref.uri, MCP_URI_SEPARATOR);
49
+ clientName = cn;
50
+ updatedRef = { ...ref, uri: resourceName };
51
+ }
52
+ else {
53
+ throw new Error(`Unsupported completion reference type: ${ref.type}`);
54
+ }
55
+ const outboundConn = resolveOutboundConnection(clientName, sessionId, outboundConns, inboundConn);
56
+ if (!outboundConn) {
57
+ throw new Error(`Unknown client: ${clientName}`);
58
+ }
59
+ return outboundConn.client.complete({ ...request.params, ref: updatedRef }, {
60
+ timeout: getRequestTimeout(outboundConn.transport),
61
+ });
62
+ }, 'Error handling completion'));
63
+ }
64
+ //# sourceMappingURL=promptRequestHandlers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promptRequestHandlers.js","sourceRoot":"","sources":["../../../src/core/protocol/promptRequestHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL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AAC,SAAS,CAAC;SACnD,CACF,CAAC;IACJ,CAAC,EAAE,2BAA2B,CAAC,CAChC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { CapabilityCatalog } from '../../core/capabilities/capabilityCatalog.js';
2
+ import { InboundConnection, OutboundConnection, OutboundConnections } from '../../core/types/index.js';
3
+ import type { MCPServerParams } from '../../core/types/transport.js';
4
+ export declare function getRequestSession(inboundConn: InboundConnection): string | undefined;
5
+ export declare function createCapabilityCatalogFromConnections(connections: OutboundConnections, getServerConfigs?: () => Record<string, MCPServerParams>): Promise<CapabilityCatalog>;
6
+ export declare function resolveOutboundConnection(clientName: string, sessionId: string | undefined, outboundConns: OutboundConnections, inboundConn?: InboundConnection): OutboundConnection | undefined;
7
+ export declare function filterConnectionsForSession(outboundConns: OutboundConnections, sessionId: string | undefined): OutboundConnections;
8
+ //# sourceMappingURL=requestHandlerUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requestHandlerUtils.d.ts","sourceRoot":"","sources":["../../../src/core/protocol/requestHandlerUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAMhF,OAAO,EAAgB,iBAAiB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAGpE,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,iBAAiB,GAAG,MAAM,GAAG,SAAS,CAEpF;AAED,wBAAsB,sCAAsC,CAC1D,WAAW,EAAE,mBAAmB,EAChC,gBAAgB,GAAE,MAAM,MAAM,CAAC,MAAM,EAAE,eAAe,CAA6D,GAClH,OAAO,CAAC,iBAAiB,CAAC,CA8B5B;AAED,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,aAAa,EAAE,mBAAmB,EAClC,WAAW,CAAC,EAAE,iBAAiB,GAC9B,kBAAkB,GAAG,SAAS,CAMhC;AAED,wBAAgB,2BAA2B,CACzC,aAAa,EAAE,mBAAmB,EAClC,SAAS,EAAE,MAAM,GAAG,SAAS,GAC5B,mBAAmB,CAIrB"}
@@ -0,0 +1,48 @@
1
+ import { McpConfigManager } from '../../config/mcpConfigManager.js';
2
+ import { CapabilityCatalog } from '../../core/capabilities/capabilityCatalog.js';
3
+ import { SchemaCache } from '../../core/capabilities/schemaCache.js';
4
+ import { ToolRegistry } from '../../core/capabilities/toolRegistry.js';
5
+ import { FilteringService } from '../../core/filtering/filteringService.js';
6
+ import { createConnectionResolver } from '../../core/server/connectionResolver.js';
7
+ import { ServerManager } from '../../core/server/serverManager.js';
8
+ import { ClientStatus } from '../../core/types/index.js';
9
+ import { getRequestTimeout } from '../../utils/core/timeoutUtils.js';
10
+ export function getRequestSession(inboundConn) {
11
+ return inboundConn.context?.sessionId;
12
+ }
13
+ export async function createCapabilityCatalogFromConnections(connections, getServerConfigs = () => McpConfigManager.getInstance().getTransportConfig()) {
14
+ const toolsByServer = new Map();
15
+ const tagsByServer = new Map();
16
+ await Promise.all(Array.from(connections.entries()).map(async ([connectionKey, connection]) => {
17
+ if (connection.status !== ClientStatus.Connected)
18
+ return;
19
+ const serverName = connection.name || (connectionKey.includes(':') ? connectionKey.split(':')[0] : connectionKey);
20
+ const result = await connection.client.listTools(undefined, {
21
+ timeout: getRequestTimeout(connection.transport),
22
+ });
23
+ toolsByServer.set(serverName, result.tools ?? []);
24
+ tagsByServer.set(serverName, Array.isArray(connection.transport.tags)
25
+ ? connection.transport.tags.filter((tag) => typeof tag === 'string')
26
+ : []);
27
+ }));
28
+ return new CapabilityCatalog({
29
+ getToolRegistry: () => ToolRegistry.fromToolsMap(toolsByServer, tagsByServer),
30
+ schemaCache: new SchemaCache({ maxEntries: 100 }),
31
+ outboundConnections: connections,
32
+ getServerConfigs,
33
+ templateHashProvider: ServerManager.current.getTemplateServerManager(),
34
+ });
35
+ }
36
+ export function resolveOutboundConnection(clientName, sessionId, outboundConns, inboundConn) {
37
+ const scopedConns = filterConnectionsForSession(outboundConns, sessionId);
38
+ const filteredConns = inboundConn ? FilteringService.getFilteredConnections(scopedConns, inboundConn) : scopedConns;
39
+ const templateServerManager = ServerManager.current.getTemplateServerManager();
40
+ const resolver = createConnectionResolver(filteredConns, templateServerManager);
41
+ return resolver.resolve(clientName, sessionId);
42
+ }
43
+ export function filterConnectionsForSession(outboundConns, sessionId) {
44
+ const templateServerManager = ServerManager.current.getTemplateServerManager();
45
+ const resolver = createConnectionResolver(outboundConns, templateServerManager);
46
+ return resolver.filterForSession(sessionId);
47
+ }
48
+ //# sourceMappingURL=requestHandlerUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requestHandlerUtils.js","sourceRoot":"","sources":["../../../src/core/protocol/requestHandlerUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,YAAY,EAA8D,MAAM,0BAA0B,CAAC;AAEpH,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAEpE,MAAM,UAAU,iBAAiB,CAAC,WAA8B;IAC9D,OAAO,WAAW,CAAC,OAAO,EAAE,SAAS,CAAC;AACxC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,sCAAsC,CAC1D,WAAgC,EAChC,mBAA0D,GAAG,EAAE,CAAC,gBAAgB,CAAC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,IAAI,WAAW,CAAC,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC;QACjD,mBAAmB,EAAE,WAAW;QAChC,gBAAgB;QAChB,oBAAoB,EAAE,aAAa,CAAC,OAAO,CAAC,wBAAwB,EAAE;KACvE,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,yBAAyB,CACvC,UAAkB,EAClB,SAA6B,EAC7B,aAAkC,EAClC,WAA+B;IAE/B,MAAM,WAAW,GAAG,2BAA2B,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;IAC1E,MAAM,aAAa,GAAG,WAAW,CAAC,CAAC,CAAC,gBAAgB,CAAC,sBAAsB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;IACpH,MAAM,qBAAqB,GAAG,aAAa,CAAC,OAAO,CAAC,wBAAwB,EAAE,CAAC;IAC/E,MAAM,QAAQ,GAAG,wBAAwB,CAAC,aAAa,EAAE,qBAAqB,CAAC,CAAC;IAChF,OAAO,QAAQ,CAAC,OAAO,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,2BAA2B,CACzC,aAAkC,EAClC,SAA6B;IAE7B,MAAM,qBAAqB,GAAG,aAAa,CAAC,OAAO,CAAC,wBAAwB,EAAE,CAAC;IAC/E,MAAM,QAAQ,GAAG,wBAAwB,CAAC,aAAa,EAAE,qBAAqB,CAAC,CAAC;IAChF,OAAO,QAAQ,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;AAC9C,CAAC"}
@@ -1,5 +1,7 @@
1
1
  import { LazyLoadingOrchestrator } from '../../core/capabilities/lazyLoadingOrchestrator.js';
2
2
  import { InboundConnection, OutboundConnections } from '../../core/types/index.js';
3
+ import { createCapabilityCatalogFromConnections, filterConnectionsForSession, getRequestSession, resolveOutboundConnection } from './requestHandlerUtils.js';
4
+ export { createCapabilityCatalogFromConnections, filterConnectionsForSession, getRequestSession, resolveOutboundConnection, };
3
5
  /**
4
6
  * Registers all request handlers based on available capabilities
5
7
  * @param clients Record of client instances
@@ -1 +1 @@
1
- {"version":3,"file":"requestHandlers.d.ts","sourceRoot":"","sources":["../../../src/core/protocol/requestHandlers.ts"],"names":[],"mappings":"AA8BA,OAAO,EAAE,uBAAuB,EAAE,MAAM,mDAAmD,CAAC;AAM5F,OAAO,EAAgB,iBAAiB,EAAsB,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAuIpH;;;;;;GAMG;AAEH,wBAAgB,uBAAuB,CACrC,aAAa,EAAE,mBAAmB,EAClC,WAAW,EAAE,iBAAiB,EAC9B,uBAAuB,CAAC,EAAE,uBAAuB,GAChD,IAAI,CA6CN"}
1
+ {"version":3,"file":"requestHandlers.d.ts","sourceRoot":"","sources":["../../../src/core/protocol/requestHandlers.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,uBAAuB,EAAE,MAAM,mDAAmD,CAAC;AAE5F,OAAO,EAAgB,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAMhG,OAAO,EACL,sCAAsC,EACtC,2BAA2B,EAC3B,iBAAiB,EACjB,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EACL,sCAAsC,EACtC,2BAA2B,EAC3B,iBAAiB,EACjB,yBAAyB,GAC1B,CAAC;AAsEF;;;;;;GAMG;AAEH,wBAAgB,uBAAuB,CACrC,aAAa,EAAE,mBAAmB,EAClC,WAAW,EAAE,iBAAiB,EAC9B,uBAAuB,CAAC,EAAE,uBAAuB,GAChD,IAAI,CA6CN"}