@1mcp/agent 0.39.0-beta.2 → 0.39.0-beta.4

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 (761) hide show
  1. package/build/admin/assets/{admin-OAuthServicesWorkspace-CKPMmDQI.js → admin-OAuthServicesWorkspace-CKR1HA-8.js} +1 -1
  2. package/build/admin/assets/{admin-console-CwgYre_s.js → admin-console-OfHKqRm-.js} +3 -3
  3. package/build/admin/index.html +1 -1
  4. package/build/application/services/healthService.js +3 -3
  5. package/build/application/services/healthService.js.map +1 -1
  6. package/build/application/services/tokenEstimationService.d.ts.map +1 -1
  7. package/build/application/services/tokenEstimationService.js +15 -13
  8. package/build/application/services/tokenEstimationService.js.map +1 -1
  9. package/build/auth/oauthAuthority.d.ts +149 -0
  10. package/build/auth/oauthAuthority.d.ts.map +1 -0
  11. package/build/auth/oauthAuthority.js +101 -0
  12. package/build/auth/oauthAuthority.js.map +1 -0
  13. package/build/auth/oauthAuthorizationFlow.d.ts +7 -1
  14. package/build/auth/oauthAuthorizationFlow.d.ts.map +1 -1
  15. package/build/auth/oauthAuthorizationFlow.js +60 -74
  16. package/build/auth/oauthAuthorizationFlow.js.map +1 -1
  17. package/build/auth/oauthEndpointFetch.d.ts +20 -0
  18. package/build/auth/oauthEndpointFetch.d.ts.map +1 -0
  19. package/build/auth/oauthEndpointFetch.js +246 -0
  20. package/build/auth/oauthEndpointFetch.js.map +1 -0
  21. package/build/auth/sessionTypes.d.ts +1 -1
  22. package/build/auth/storage/authCodeRepository.js +2 -2
  23. package/build/auth/storage/authCodeRepository.js.map +1 -1
  24. package/build/auth/storage/authRequestRepository.js +2 -2
  25. package/build/auth/storage/authRequestRepository.js.map +1 -1
  26. package/build/auth/storage/clientDataRepository.js +2 -2
  27. package/build/auth/storage/clientDataRepository.js.map +1 -1
  28. package/build/auth/storage/clientSessionRepository.d.ts +19 -0
  29. package/build/auth/storage/clientSessionRepository.d.ts.map +1 -1
  30. package/build/auth/storage/clientSessionRepository.js +179 -1
  31. package/build/auth/storage/clientSessionRepository.js.map +1 -1
  32. package/build/auth/storage/fileStorageService.d.ts +9 -1
  33. package/build/auth/storage/fileStorageService.d.ts.map +1 -1
  34. package/build/auth/storage/fileStorageService.js +82 -51
  35. package/build/auth/storage/fileStorageService.js.map +1 -1
  36. package/build/auth/storage/inboundOAuthStorage.d.ts +14 -0
  37. package/build/auth/storage/inboundOAuthStorage.d.ts.map +1 -0
  38. package/build/auth/storage/inboundOAuthStorage.js +29 -0
  39. package/build/auth/storage/inboundOAuthStorage.js.map +1 -0
  40. package/build/auth/storage/nativeCredentialStore.d.ts +44 -0
  41. package/build/auth/storage/nativeCredentialStore.d.ts.map +1 -0
  42. package/build/auth/storage/nativeCredentialStore.js +177 -0
  43. package/build/auth/storage/nativeCredentialStore.js.map +1 -0
  44. package/build/auth/storage/oauthStorageService.d.ts +8 -1
  45. package/build/auth/storage/oauthStorageService.d.ts.map +1 -1
  46. package/build/auth/storage/oauthStorageService.js +69 -49
  47. package/build/auth/storage/oauthStorageService.js.map +1 -1
  48. package/build/auth/storage/protectedRecordStorage.d.ts +129 -0
  49. package/build/auth/storage/protectedRecordStorage.d.ts.map +1 -0
  50. package/build/auth/storage/protectedRecordStorage.js +1139 -0
  51. package/build/auth/storage/protectedRecordStorage.js.map +1 -0
  52. package/build/auth/storage/sessionRepository.d.ts.map +1 -1
  53. package/build/auth/storage/sessionRepository.js +13 -3
  54. package/build/auth/storage/sessionRepository.js.map +1 -1
  55. package/build/auth/storage/upstreamOAuthStorage.d.ts +15 -0
  56. package/build/auth/storage/upstreamOAuthStorage.d.ts.map +1 -0
  57. package/build/auth/storage/upstreamOAuthStorage.js +25 -0
  58. package/build/auth/storage/upstreamOAuthStorage.js.map +1 -0
  59. package/build/auth/storage/upstreamOAuthStoragePath.d.ts +3 -0
  60. package/build/auth/storage/upstreamOAuthStoragePath.d.ts.map +1 -0
  61. package/build/auth/storage/upstreamOAuthStoragePath.js +8 -0
  62. package/build/auth/storage/upstreamOAuthStoragePath.js.map +1 -0
  63. package/build/cli.d.ts +4 -0
  64. package/build/cli.d.ts.map +1 -0
  65. package/build/cli.js +133 -0
  66. package/build/cli.js.map +1 -0
  67. package/build/commands/auth/exportOAuthCredentials.d.ts +9 -0
  68. package/build/commands/auth/exportOAuthCredentials.d.ts.map +1 -0
  69. package/build/commands/auth/exportOAuthCredentials.js +71 -0
  70. package/build/commands/auth/exportOAuthCredentials.js.map +1 -0
  71. package/build/commands/auth/exportUpstreamCredentials.d.ts +5 -0
  72. package/build/commands/auth/exportUpstreamCredentials.d.ts.map +1 -0
  73. package/build/commands/auth/exportUpstreamCredentials.js +6 -0
  74. package/build/commands/auth/exportUpstreamCredentials.js.map +1 -0
  75. package/build/commands/auth/index.d.ts.map +1 -1
  76. package/build/commands/auth/index.js +23 -1
  77. package/build/commands/auth/index.js.map +1 -1
  78. package/build/commands/cliSetup/setupFiles.js +1 -1
  79. package/build/commands/cliSetup/setupFiles.js.map +1 -1
  80. package/build/commands/inspect/inspectUtils.d.ts.map +1 -1
  81. package/build/commands/inspect/inspectUtils.js +2 -3
  82. package/build/commands/inspect/inspectUtils.js.map +1 -1
  83. package/build/commands/mcp/install.js +7 -7
  84. package/build/commands/mcp/install.js.map +1 -1
  85. package/build/commands/mcp/installSource.js +2 -2
  86. package/build/commands/mcp/installSource.js.map +1 -1
  87. package/build/commands/mcp/tokens.js +6 -6
  88. package/build/commands/mcp/tokens.js.map +1 -1
  89. package/build/commands/mcp/uninstall.js +4 -4
  90. package/build/commands/mcp/uninstall.js.map +1 -1
  91. package/build/commands/mcp/utils/installWizard.js +2 -2
  92. package/build/commands/mcp/utils/installWizard.js.map +1 -1
  93. package/build/commands/mcp/utils/mcpServerConfig.js +5 -5
  94. package/build/commands/mcp/utils/mcpServerConfig.js.map +1 -1
  95. package/build/commands/mcp/utils/serverUtils.js +4 -4
  96. package/build/commands/mcp/utils/serverUtils.js.map +1 -1
  97. package/build/commands/mcp/wizard/search.js +1 -1
  98. package/build/commands/mcp/wizard/search.js.map +1 -1
  99. package/build/commands/preset/create.js +1 -1
  100. package/build/commands/preset/create.js.map +1 -1
  101. package/build/commands/preset/delete.js +1 -1
  102. package/build/commands/preset/delete.js.map +1 -1
  103. package/build/commands/preset/edit.js +1 -1
  104. package/build/commands/preset/edit.js.map +1 -1
  105. package/build/commands/preset/interactive.js +1 -1
  106. package/build/commands/preset/interactive.js.map +1 -1
  107. package/build/commands/preset/list.js +1 -1
  108. package/build/commands/preset/list.js.map +1 -1
  109. package/build/commands/preset/show.js +1 -1
  110. package/build/commands/preset/show.js.map +1 -1
  111. package/build/commands/preset/test.js +1 -1
  112. package/build/commands/preset/test.js.map +1 -1
  113. package/build/commands/preset/url.js +1 -1
  114. package/build/commands/preset/url.js.map +1 -1
  115. package/build/commands/proxy/proxy.js +13 -13
  116. package/build/commands/proxy/proxy.js.map +1 -1
  117. package/build/commands/registry/search.js +2 -2
  118. package/build/commands/registry/search.js.map +1 -1
  119. package/build/commands/registry/show.d.ts.map +1 -1
  120. package/build/commands/registry/show.js +2 -2
  121. package/build/commands/registry/show.js.map +1 -1
  122. package/build/commands/registry/status.js +2 -2
  123. package/build/commands/registry/status.js.map +1 -1
  124. package/build/commands/registry/versions.js +2 -2
  125. package/build/commands/registry/versions.js.map +1 -1
  126. package/build/commands/run/run.js +3 -3
  127. package/build/commands/run/run.js.map +1 -1
  128. package/build/commands/run/runUtils.js +2 -2
  129. package/build/commands/run/runUtils.js.map +1 -1
  130. package/build/commands/serve/cooperativeRuntime.d.ts.map +1 -1
  131. package/build/commands/serve/cooperativeRuntime.js +24 -20
  132. package/build/commands/serve/cooperativeRuntime.js.map +1 -1
  133. package/build/commands/serve/index.d.ts +5 -0
  134. package/build/commands/serve/index.d.ts.map +1 -1
  135. package/build/commands/serve/index.js +5 -0
  136. package/build/commands/serve/index.js.map +1 -1
  137. package/build/commands/serve/serveBackground.d.ts.map +1 -1
  138. package/build/commands/serve/serveBackground.js +5 -5
  139. package/build/commands/serve/serveBackground.js.map +1 -1
  140. package/build/commands/serve/serveLifecycleError.d.ts +16 -0
  141. package/build/commands/serve/serveLifecycleError.d.ts.map +1 -0
  142. package/build/commands/serve/serveLifecycleError.js +31 -0
  143. package/build/commands/serve/serveLifecycleError.js.map +1 -0
  144. package/build/commands/serve/serveOptions.d.ts.map +1 -1
  145. package/build/commands/serve/serveOptions.js +14 -18
  146. package/build/commands/serve/serveOptions.js.map +1 -1
  147. package/build/commands/serve/serveStop.js +5 -5
  148. package/build/commands/serve/serveStop.js.map +1 -1
  149. package/build/commands/shared/authProfileStore.d.ts.map +1 -1
  150. package/build/commands/shared/authProfileStore.js +4 -2
  151. package/build/commands/shared/authProfileStore.js.map +1 -1
  152. package/build/commands/shared/baseConfigUtils.d.ts.map +1 -1
  153. package/build/commands/shared/baseConfigUtils.js +12 -12
  154. package/build/commands/shared/baseConfigUtils.js.map +1 -1
  155. package/build/commands/shared/clientSurfaceAttachment.d.ts.map +1 -1
  156. package/build/commands/shared/clientSurfaceAttachment.js +4 -2
  157. package/build/commands/shared/clientSurfaceAttachment.js.map +1 -1
  158. package/build/commands/shared/configParsingUtils.js +1 -1
  159. package/build/commands/shared/configParsingUtils.js.map +1 -1
  160. package/build/commands/shared/connectionHelper.d.ts.map +1 -1
  161. package/build/commands/shared/connectionHelper.js +17 -18
  162. package/build/commands/shared/connectionHelper.js.map +1 -1
  163. package/build/commands/shared/inspectApiSchemas.d.ts +20 -20
  164. package/build/config/configLoader.d.ts.map +1 -1
  165. package/build/config/configLoader.js +38 -38
  166. package/build/config/configLoader.js.map +1 -1
  167. package/build/config/configManager.d.ts.map +1 -1
  168. package/build/config/configManager.js +65 -26
  169. package/build/config/configManager.js.map +1 -1
  170. package/build/config/configWatcher.d.ts.map +1 -1
  171. package/build/config/configWatcher.js +15 -18
  172. package/build/config/configWatcher.js.map +1 -1
  173. package/build/config/envProcessor.d.ts.map +1 -1
  174. package/build/config/envProcessor.js +9 -9
  175. package/build/config/envProcessor.js.map +1 -1
  176. package/build/config/mcpConfigManager.d.ts.map +1 -1
  177. package/build/config/mcpConfigManager.js +24 -28
  178. package/build/config/mcpConfigManager.js.map +1 -1
  179. package/build/config/projectConfigLoader.d.ts.map +1 -1
  180. package/build/config/projectConfigLoader.js +14 -11
  181. package/build/config/projectConfigLoader.js.map +1 -1
  182. package/build/config/templateProcessor.d.ts.map +1 -1
  183. package/build/config/templateProcessor.js +5 -5
  184. package/build/config/templateProcessor.js.map +1 -1
  185. package/build/constants/mcp.d.ts +1 -1
  186. package/build/constants/mcp.js +1 -1
  187. package/build/core/capabilities/asyncLoadingOrchestrator.d.ts.map +1 -1
  188. package/build/core/capabilities/asyncLoadingOrchestrator.js +67 -38
  189. package/build/core/capabilities/asyncLoadingOrchestrator.js.map +1 -1
  190. package/build/core/capabilities/capabilityAggregator.d.ts +3 -1
  191. package/build/core/capabilities/capabilityAggregator.d.ts.map +1 -1
  192. package/build/core/capabilities/capabilityAggregator.js +9 -2
  193. package/build/core/capabilities/capabilityAggregator.js.map +1 -1
  194. package/build/core/capabilities/capabilityCatalog.d.ts +24 -1
  195. package/build/core/capabilities/capabilityCatalog.d.ts.map +1 -1
  196. package/build/core/capabilities/capabilityCatalog.js +412 -41
  197. package/build/core/capabilities/capabilityCatalog.js.map +1 -1
  198. package/build/core/capabilities/capabilityManager.js +8 -8
  199. package/build/core/capabilities/capabilityManager.js.map +1 -1
  200. package/build/core/capabilities/capabilityPagination.d.ts +34 -1
  201. package/build/core/capabilities/capabilityPagination.d.ts.map +1 -1
  202. package/build/core/capabilities/capabilityPagination.js +238 -31
  203. package/build/core/capabilities/capabilityPagination.js.map +1 -1
  204. package/build/core/capabilities/capabilityVisibility.d.ts +13 -1
  205. package/build/core/capabilities/capabilityVisibility.d.ts.map +1 -1
  206. package/build/core/capabilities/capabilityVisibility.js +24 -1
  207. package/build/core/capabilities/capabilityVisibility.js.map +1 -1
  208. package/build/core/capabilities/catalogGeneration.d.ts.map +1 -1
  209. package/build/core/capabilities/catalogGeneration.js +20 -1
  210. package/build/core/capabilities/catalogGeneration.js.map +1 -1
  211. package/build/core/capabilities/configuredToolSnapshot.d.ts +1 -0
  212. package/build/core/capabilities/configuredToolSnapshot.d.ts.map +1 -1
  213. package/build/core/capabilities/configuredToolSnapshot.js +30 -4
  214. package/build/core/capabilities/configuredToolSnapshot.js.map +1 -1
  215. package/build/core/capabilities/internalCapabilitiesProvider.d.ts.map +1 -1
  216. package/build/core/capabilities/internalCapabilitiesProvider.js +6 -14
  217. package/build/core/capabilities/internalCapabilitiesProvider.js.map +1 -1
  218. package/build/core/capabilities/lazyLoadingOrchestrator.d.ts +2 -0
  219. package/build/core/capabilities/lazyLoadingOrchestrator.d.ts.map +1 -1
  220. package/build/core/capabilities/lazyLoadingOrchestrator.js +37 -31
  221. package/build/core/capabilities/lazyLoadingOrchestrator.js.map +1 -1
  222. package/build/core/capabilities/metaToolProvider.d.ts +3 -1
  223. package/build/core/capabilities/metaToolProvider.d.ts.map +1 -1
  224. package/build/core/capabilities/metaToolProvider.js +45 -13
  225. package/build/core/capabilities/metaToolProvider.js.map +1 -1
  226. package/build/core/capabilities/runtimeCapabilityCatalog.d.ts +18 -3
  227. package/build/core/capabilities/runtimeCapabilityCatalog.d.ts.map +1 -1
  228. package/build/core/capabilities/runtimeCapabilityCatalog.js +181 -17
  229. package/build/core/capabilities/runtimeCapabilityCatalog.js.map +1 -1
  230. package/build/core/capabilities/schemaCache.d.ts.map +1 -1
  231. package/build/core/capabilities/schemaCache.js +53 -15
  232. package/build/core/capabilities/schemaCache.js.map +1 -1
  233. package/build/core/capabilities/schemas/metaToolSchemas.d.ts +4 -3
  234. package/build/core/capabilities/schemas/metaToolSchemas.d.ts.map +1 -1
  235. package/build/core/capabilities/schemas/metaToolSchemas.js +1 -0
  236. package/build/core/capabilities/schemas/metaToolSchemas.js.map +1 -1
  237. package/build/core/capabilities/toolRegistry.d.ts +7 -3
  238. package/build/core/capabilities/toolRegistry.d.ts.map +1 -1
  239. package/build/core/capabilities/toolRegistry.js +34 -19
  240. package/build/core/capabilities/toolRegistry.js.map +1 -1
  241. package/build/core/client/postAuthOAuthRecovery.d.ts.map +1 -1
  242. package/build/core/client/postAuthOAuthRecovery.js +5 -3
  243. package/build/core/client/postAuthOAuthRecovery.js.map +1 -1
  244. package/build/core/configChangeHandler.d.ts.map +1 -1
  245. package/build/core/configChangeHandler.js +44 -65
  246. package/build/core/configChangeHandler.js.map +1 -1
  247. package/build/core/context/globalContextManager.d.ts.map +1 -1
  248. package/build/core/context/globalContextManager.js +6 -6
  249. package/build/core/context/globalContextManager.js.map +1 -1
  250. package/build/core/filtering/clientFiltering.d.ts.map +1 -1
  251. package/build/core/filtering/clientFiltering.js +16 -67
  252. package/build/core/filtering/clientFiltering.js.map +1 -1
  253. package/build/core/filtering/clientTemplateTracker.d.ts.map +1 -1
  254. package/build/core/filtering/clientTemplateTracker.js +13 -41
  255. package/build/core/filtering/clientTemplateTracker.js.map +1 -1
  256. package/build/core/filtering/filterCache.d.ts.map +1 -1
  257. package/build/core/filtering/filterCache.js +13 -32
  258. package/build/core/filtering/filterCache.js.map +1 -1
  259. package/build/core/filtering/filteringService.d.ts.map +1 -1
  260. package/build/core/filtering/filteringService.js +22 -80
  261. package/build/core/filtering/filteringService.js.map +1 -1
  262. package/build/core/filtering/templateFilteringService.d.ts.map +1 -1
  263. package/build/core/filtering/templateFilteringService.js +25 -89
  264. package/build/core/filtering/templateFilteringService.js.map +1 -1
  265. package/build/core/filtering/templateIndex.d.ts.map +1 -1
  266. package/build/core/filtering/templateIndex.js +11 -23
  267. package/build/core/filtering/templateIndex.js.map +1 -1
  268. package/build/core/flags/flagManager.d.ts.map +1 -1
  269. package/build/core/flags/flagManager.js +2 -5
  270. package/build/core/flags/flagManager.js.map +1 -1
  271. package/build/core/instructions/instructionAggregator.d.ts.map +1 -1
  272. package/build/core/instructions/instructionAggregator.js +18 -36
  273. package/build/core/instructions/instructionAggregator.js.map +1 -1
  274. package/build/core/instructions/templateTypes.d.ts +1 -1
  275. package/build/core/instructions/templateTypes.d.ts.map +1 -1
  276. package/build/core/instructions/templateTypes.js +3 -3
  277. package/build/core/loading/loadingStateTracker.d.ts.map +1 -1
  278. package/build/core/loading/loadingStateTracker.js +17 -9
  279. package/build/core/loading/loadingStateTracker.js.map +1 -1
  280. package/build/core/loading/mcpLoadingManager.d.ts.map +1 -1
  281. package/build/core/loading/mcpLoadingManager.js +33 -30
  282. package/build/core/loading/mcpLoadingManager.js.map +1 -1
  283. package/build/core/loading/parallelExecutor.d.ts.map +1 -1
  284. package/build/core/loading/parallelExecutor.js +1 -4
  285. package/build/core/loading/parallelExecutor.js.map +1 -1
  286. package/build/core/notifications/notificationManager.js +11 -11
  287. package/build/core/notifications/notificationManager.js.map +1 -1
  288. package/build/core/protocol/requestHandlerUtils.d.ts +2 -2
  289. package/build/core/protocol/requestHandlerUtils.d.ts.map +1 -1
  290. package/build/core/protocol/requestHandlerUtils.js +7 -4
  291. package/build/core/protocol/requestHandlerUtils.js.map +1 -1
  292. package/build/core/server/adapters/TemplateServerAdapter.js +3 -3
  293. package/build/core/server/adapters/TemplateServerAdapter.js.map +1 -1
  294. package/build/core/server/agentConfig.d.ts +1 -0
  295. package/build/core/server/agentConfig.d.ts.map +1 -1
  296. package/build/core/server/agentConfig.js +1 -0
  297. package/build/core/server/agentConfig.js.map +1 -1
  298. package/build/core/server/connectionResolver.d.ts.map +1 -1
  299. package/build/core/server/connectionResolver.js +7 -13
  300. package/build/core/server/connectionResolver.js.map +1 -1
  301. package/build/core/server/disabledTools.d.ts +1 -1
  302. package/build/core/server/disabledTools.d.ts.map +1 -1
  303. package/build/core/server/disabledTools.js +18 -25
  304. package/build/core/server/disabledTools.js.map +1 -1
  305. package/build/core/server/pidFileManager.js +6 -6
  306. package/build/core/server/pidFileManager.js.map +1 -1
  307. package/build/core/server/processIdentity.d.ts.map +1 -1
  308. package/build/core/server/processIdentity.js +67 -18
  309. package/build/core/server/processIdentity.js.map +1 -1
  310. package/build/core/server/runtimeLaunchIpc.d.ts +15 -2
  311. package/build/core/server/runtimeLaunchIpc.d.ts.map +1 -1
  312. package/build/core/server/runtimeLifecycle.js +2 -2
  313. package/build/core/server/runtimeLifecycle.js.map +1 -1
  314. package/build/core/server/runtimeReplacementConfig.d.ts +15 -2
  315. package/build/core/server/runtimeReplacementConfig.d.ts.map +1 -1
  316. package/build/core/server/runtimeScopeOwnership.js +1 -1
  317. package/build/core/server/runtimeScopeOwnership.js.map +1 -1
  318. package/build/core/server/templateConfigurationManager.js +16 -15
  319. package/build/core/server/templateConfigurationManager.js.map +1 -1
  320. package/build/core/server/toolDescriptionOverrides.d.ts +1 -0
  321. package/build/core/server/toolDescriptionOverrides.d.ts.map +1 -1
  322. package/build/core/server/toolDescriptionOverrides.js +30 -5
  323. package/build/core/server/toolDescriptionOverrides.js.map +1 -1
  324. package/build/core/tools/handlers/registryHandler.d.ts.map +1 -1
  325. package/build/core/tools/handlers/registryHandler.js +2 -6
  326. package/build/core/tools/handlers/registryHandler.js.map +1 -1
  327. package/build/core/tools/handlers/searchHandler.js +2 -2
  328. package/build/core/tools/handlers/searchHandler.js.map +1 -1
  329. package/build/core/tools/handlers/serverManagementHandler.d.ts +21 -0
  330. package/build/core/tools/handlers/serverManagementHandler.d.ts.map +1 -1
  331. package/build/core/tools/handlers/serverManagementHandler.js +11 -20
  332. package/build/core/tools/handlers/serverManagementHandler.js.map +1 -1
  333. package/build/core/tools/handlers/showHandler.js +2 -2
  334. package/build/core/tools/handlers/showHandler.js.map +1 -1
  335. package/build/core/tools/handlers/versionsHandler.js +2 -2
  336. package/build/core/tools/handlers/versionsHandler.js.map +1 -1
  337. package/build/core/tools/internal/adapters/discoveryAdapter.d.ts.map +1 -1
  338. package/build/core/tools/internal/adapters/discoveryAdapter.js +12 -29
  339. package/build/core/tools/internal/adapters/discoveryAdapter.js.map +1 -1
  340. package/build/core/tools/internal/adapters/helpers/configTransformers.d.ts +3 -0
  341. package/build/core/tools/internal/adapters/helpers/configTransformers.d.ts.map +1 -1
  342. package/build/core/tools/internal/adapters/installation/directInstallation.d.ts.map +1 -1
  343. package/build/core/tools/internal/adapters/installation/directInstallation.js +4 -6
  344. package/build/core/tools/internal/adapters/installation/directInstallation.js.map +1 -1
  345. package/build/core/tools/internal/adapters/installation/packageResolver.d.ts.map +1 -1
  346. package/build/core/tools/internal/adapters/installation/packageResolver.js +8 -14
  347. package/build/core/tools/internal/adapters/installation/packageResolver.js.map +1 -1
  348. package/build/core/tools/internal/adapters/installationAdapter.d.ts.map +1 -1
  349. package/build/core/tools/internal/adapters/installationAdapter.js +38 -35
  350. package/build/core/tools/internal/adapters/installationAdapter.js.map +1 -1
  351. package/build/core/tools/internal/adapters/management/managementAdapter.d.ts +1 -1
  352. package/build/core/tools/internal/adapters/management/managementAdapter.d.ts.map +1 -1
  353. package/build/core/tools/internal/adapters/management/managementAdapter.js +22 -28
  354. package/build/core/tools/internal/adapters/management/managementAdapter.js.map +1 -1
  355. package/build/core/tools/internal/adapters/management/toolHandlers.js +10 -10
  356. package/build/core/tools/internal/adapters/management/toolHandlers.js.map +1 -1
  357. package/build/core/tools/internal/adapters/management/validation.d.ts.map +1 -1
  358. package/build/core/tools/internal/adapters/management/validation.js +6 -3
  359. package/build/core/tools/internal/adapters/management/validation.js.map +1 -1
  360. package/build/core/tools/internal/discoveryHandlers.d.ts.map +1 -1
  361. package/build/core/tools/internal/discoveryHandlers.js +10 -25
  362. package/build/core/tools/internal/discoveryHandlers.js.map +1 -1
  363. package/build/core/tools/internal/index.js +3 -3
  364. package/build/core/tools/internal/index.js.map +1 -1
  365. package/build/core/tools/internal/installationHandlers.d.ts.map +1 -1
  366. package/build/core/tools/internal/installationHandlers.js +9 -27
  367. package/build/core/tools/internal/installationHandlers.js.map +1 -1
  368. package/build/core/tools/internal/managementHandlers.d.ts.map +1 -1
  369. package/build/core/tools/internal/managementHandlers.js +10 -25
  370. package/build/core/tools/internal/managementHandlers.js.map +1 -1
  371. package/build/core/tools/internal/schemas/discovery.d.ts +1 -1
  372. package/build/core/tools/internal/schemas/index.d.ts +7 -7
  373. package/build/core/tools/internal/schemas/installation.d.ts +1 -1
  374. package/build/core/tools/internal/schemas/management.d.ts +5 -5
  375. package/build/core/types/transport.d.ts +26 -3
  376. package/build/core/types/transport.d.ts.map +1 -1
  377. package/build/core/types/transport.js +12 -0
  378. package/build/core/types/transport.js.map +1 -1
  379. package/build/domains/admin/configuredToolInventory.d.ts.map +1 -1
  380. package/build/domains/admin/configuredToolInventory.js +47 -9
  381. package/build/domains/admin/configuredToolInventory.js.map +1 -1
  382. package/build/domains/admin/runtimeConfiguredToolInspectionService.d.ts.map +1 -1
  383. package/build/domains/admin/runtimeConfiguredToolInspectionService.js +13 -3
  384. package/build/domains/admin/runtimeConfiguredToolInspectionService.js.map +1 -1
  385. package/build/domains/admin/runtimeScopeAdminLock.js +2 -3
  386. package/build/domains/admin/runtimeScopeAdminLock.js.map +1 -1
  387. package/build/domains/backend-logs/backendLogBroker.d.ts +2 -0
  388. package/build/domains/backend-logs/backendLogBroker.d.ts.map +1 -1
  389. package/build/domains/backend-logs/backendLogBroker.js +7 -0
  390. package/build/domains/backend-logs/backendLogBroker.js.map +1 -1
  391. package/build/domains/backend-logs/backendLogProjection.d.ts.map +1 -1
  392. package/build/domains/backend-logs/backendLogProjection.js +2 -13
  393. package/build/domains/backend-logs/backendLogProjection.js.map +1 -1
  394. package/build/domains/config-change/configChange.js +3 -3
  395. package/build/domains/config-change/configChange.js.map +1 -1
  396. package/build/domains/preset/manager/presetManager.d.ts.map +1 -1
  397. package/build/domains/preset/manager/presetManager.js +29 -66
  398. package/build/domains/preset/manager/presetManager.js.map +1 -1
  399. package/build/domains/preset/manager/presetManagerCleanup.js +8 -8
  400. package/build/domains/preset/manager/presetManagerCleanup.js.map +1 -1
  401. package/build/domains/preset/manager/presetTesting.js +1 -7
  402. package/build/domains/preset/manager/presetTesting.js.map +1 -1
  403. package/build/domains/preset/services/presetNotificationService.d.ts.map +1 -1
  404. package/build/domains/preset/services/presetNotificationService.js +15 -32
  405. package/build/domains/preset/services/presetNotificationService.js.map +1 -1
  406. package/build/domains/registry/cacheManager.d.ts.map +1 -1
  407. package/build/domains/registry/cacheManager.js +5 -6
  408. package/build/domains/registry/cacheManager.js.map +1 -1
  409. package/build/domains/registry/mcpRegistryClient.js +11 -11
  410. package/build/domains/registry/mcpRegistryClient.js.map +1 -1
  411. package/build/domains/server-management/progressTrackingService.d.ts.map +1 -1
  412. package/build/domains/server-management/progressTrackingService.js +7 -10
  413. package/build/domains/server-management/progressTrackingService.js.map +1 -1
  414. package/build/domains/server-management/serverInstallationService.d.ts.map +1 -1
  415. package/build/domains/server-management/serverInstallationService.js +14 -12
  416. package/build/domains/server-management/serverInstallationService.js.map +1 -1
  417. package/build/gateway/adapters/legacy/legacyInboundEraAdapter.d.ts.map +1 -1
  418. package/build/gateway/adapters/legacy/legacyInboundEraAdapter.js +2 -1
  419. package/build/gateway/adapters/legacy/legacyInboundEraAdapter.js.map +1 -1
  420. package/build/gateway/adapters/legacy/legacyOutboundEraAdapter.d.ts +4 -1
  421. package/build/gateway/adapters/legacy/legacyOutboundEraAdapter.d.ts.map +1 -1
  422. package/build/gateway/adapters/legacy/legacyOutboundEraAdapter.js +4 -1
  423. package/build/gateway/adapters/legacy/legacyOutboundEraAdapter.js.map +1 -1
  424. package/build/gateway/adapters/modern/modernInboundEraAdapter.d.ts.map +1 -1
  425. package/build/gateway/adapters/modern/modernInboundEraAdapter.js +5 -4
  426. package/build/gateway/adapters/modern/modernInboundEraAdapter.js.map +1 -1
  427. package/build/gateway/adapters/modern/modernOutboundEraAdapter.d.ts.map +1 -1
  428. package/build/gateway/adapters/modern/modernOutboundEraAdapter.js +18 -5
  429. package/build/gateway/adapters/modern/modernOutboundEraAdapter.js.map +1 -1
  430. package/build/gateway/contracts/gatewayFailure.d.ts +39 -1
  431. package/build/gateway/contracts/gatewayFailure.d.ts.map +1 -1
  432. package/build/gateway/contracts/gatewayFailure.js +139 -0
  433. package/build/gateway/contracts/gatewayFailure.js.map +1 -1
  434. package/build/gateway/contracts/gatewayRequest.d.ts +6 -6
  435. package/build/gateway/contracts/immutableJson.d.ts +2 -1
  436. package/build/gateway/contracts/immutableJson.d.ts.map +1 -1
  437. package/build/gateway/contracts/immutableJson.js +2 -2
  438. package/build/gateway/contracts/immutableJson.js.map +1 -1
  439. package/build/gateway/core/gatewayDispatcher.js +1 -1
  440. package/build/gateway/core/gatewayDispatcher.js.map +1 -1
  441. package/build/gateway/interactions/interactionBroker.d.ts.map +1 -1
  442. package/build/gateway/interactions/interactionBroker.js +5 -3
  443. package/build/gateway/interactions/interactionBroker.js.map +1 -1
  444. package/build/gateway/interactions/nativeInputResponses.d.ts +16 -0
  445. package/build/gateway/interactions/nativeInputResponses.d.ts.map +1 -0
  446. package/build/gateway/interactions/nativeInputResponses.js +76 -0
  447. package/build/gateway/interactions/nativeInputResponses.js.map +1 -0
  448. package/build/gateway/interactions/validateInteractionResponse.d.ts.map +1 -1
  449. package/build/gateway/interactions/validateInteractionResponse.js +20 -1
  450. package/build/gateway/interactions/validateInteractionResponse.js.map +1 -1
  451. package/build/gateway/ports/outboundEraAdapter.d.ts +5 -0
  452. package/build/gateway/ports/outboundEraAdapter.d.ts.map +1 -1
  453. package/build/index.d.ts +1 -3
  454. package/build/index.d.ts.map +1 -1
  455. package/build/index.js +7 -131
  456. package/build/index.js.map +1 -1
  457. package/build/logger/backgroundSupervisorLogger.d.ts +4 -0
  458. package/build/logger/backgroundSupervisorLogger.d.ts.map +1 -0
  459. package/build/logger/backgroundSupervisorLogger.js +21 -0
  460. package/build/logger/backgroundSupervisorLogger.js.map +1 -0
  461. package/build/logger/diagnosticRedaction.d.ts +3 -0
  462. package/build/logger/diagnosticRedaction.d.ts.map +1 -0
  463. package/build/logger/diagnosticRedaction.js +12 -0
  464. package/build/logger/diagnosticRedaction.js.map +1 -0
  465. package/build/logger/httpDiagnostics.d.ts +25 -0
  466. package/build/logger/httpDiagnostics.d.ts.map +1 -0
  467. package/build/logger/httpDiagnostics.js +125 -0
  468. package/build/logger/httpDiagnostics.js.map +1 -0
  469. package/build/logger/localDiagnosticRecord.d.ts +11 -0
  470. package/build/logger/localDiagnosticRecord.d.ts.map +1 -0
  471. package/build/logger/localDiagnosticRecord.js +9 -0
  472. package/build/logger/localDiagnosticRecord.js.map +1 -0
  473. package/build/logger/localDiagnostics.d.ts +5 -0
  474. package/build/logger/localDiagnostics.d.ts.map +1 -0
  475. package/build/logger/localDiagnostics.js +116 -0
  476. package/build/logger/localDiagnostics.js.map +1 -0
  477. package/build/logger/logger.d.ts +39 -37
  478. package/build/logger/logger.d.ts.map +1 -1
  479. package/build/logger/logger.js +120 -154
  480. package/build/logger/logger.js.map +1 -1
  481. package/build/logger/secureLogger.d.ts +3 -9
  482. package/build/logger/secureLogger.d.ts.map +1 -1
  483. package/build/logger/secureLogger.js +4 -30
  484. package/build/logger/secureLogger.js.map +1 -1
  485. package/build/observability/events/normalize.d.ts +14 -0
  486. package/build/observability/events/normalize.d.ts.map +1 -0
  487. package/build/observability/events/normalize.js +39 -0
  488. package/build/observability/events/normalize.js.map +1 -0
  489. package/build/observability/events/registry.d.ts +5697 -0
  490. package/build/observability/events/registry.d.ts.map +1 -0
  491. package/build/observability/events/registry.js +5674 -0
  492. package/build/observability/events/registry.js.map +1 -0
  493. package/build/observability/privacy/fields.d.ts +25 -0
  494. package/build/observability/privacy/fields.d.ts.map +1 -0
  495. package/build/observability/privacy/fields.js +195 -0
  496. package/build/observability/privacy/fields.js.map +1 -0
  497. package/build/observability/tracing/bootstrap.d.ts +3 -0
  498. package/build/observability/tracing/bootstrap.d.ts.map +1 -0
  499. package/build/observability/tracing/bootstrap.js +6 -0
  500. package/build/observability/tracing/bootstrap.js.map +1 -0
  501. package/build/observability/tracing/context.d.ts +4 -0
  502. package/build/observability/tracing/context.d.ts.map +1 -0
  503. package/build/observability/tracing/context.js +3 -0
  504. package/build/observability/tracing/context.js.map +1 -0
  505. package/build/observability/tracing/otelAdapter.d.ts +17 -0
  506. package/build/observability/tracing/otelAdapter.d.ts.map +1 -0
  507. package/build/observability/tracing/otelAdapter.js +160 -0
  508. package/build/observability/tracing/otelAdapter.js.map +1 -0
  509. package/build/sdk/contracts/catalogCoverageInvalidation.d.ts +4 -0
  510. package/build/sdk/contracts/catalogCoverageInvalidation.d.ts.map +1 -0
  511. package/build/sdk/contracts/catalogCoverageInvalidation.js +13 -0
  512. package/build/sdk/contracts/catalogCoverageInvalidation.js.map +1 -0
  513. package/build/sdk/contracts/jsonValue.d.ts +30 -7
  514. package/build/sdk/contracts/jsonValue.d.ts.map +1 -1
  515. package/build/sdk/contracts/jsonValue.js +37 -9
  516. package/build/sdk/contracts/jsonValue.js.map +1 -1
  517. package/build/sdk/contracts/mcpParamHeaders.d.ts +17 -0
  518. package/build/sdk/contracts/mcpParamHeaders.d.ts.map +1 -0
  519. package/build/sdk/contracts/mcpParamHeaders.js +134 -0
  520. package/build/sdk/contracts/mcpParamHeaders.js.map +1 -0
  521. package/build/sdk/contracts/requestProgress.d.ts +29 -0
  522. package/build/sdk/contracts/requestProgress.d.ts.map +1 -0
  523. package/build/sdk/contracts/requestProgress.js +126 -0
  524. package/build/sdk/contracts/requestProgress.js.map +1 -0
  525. package/build/sdk/legacy/auth/sdkOAuthClientProvider.d.ts +77 -84
  526. package/build/sdk/legacy/auth/sdkOAuthClientProvider.d.ts.map +1 -1
  527. package/build/sdk/legacy/auth/sdkOAuthClientProvider.js +632 -209
  528. package/build/sdk/legacy/auth/sdkOAuthClientProvider.js.map +1 -1
  529. package/build/sdk/legacy/auth/sdkOAuthServerProvider.d.ts.map +1 -1
  530. package/build/sdk/legacy/auth/sdkOAuthServerProvider.js +42 -37
  531. package/build/sdk/legacy/auth/sdkOAuthServerProvider.js.map +1 -1
  532. package/build/sdk/legacy/client/runtime/clientManager.d.ts +5 -1
  533. package/build/sdk/legacy/client/runtime/clientManager.d.ts.map +1 -1
  534. package/build/sdk/legacy/client/runtime/clientManager.js +247 -93
  535. package/build/sdk/legacy/client/runtime/clientManager.js.map +1 -1
  536. package/build/sdk/legacy/client/runtime/connectionHandler.d.ts.map +1 -1
  537. package/build/sdk/legacy/client/runtime/connectionHandler.js +77 -15
  538. package/build/sdk/legacy/client/runtime/connectionHandler.js.map +1 -1
  539. package/build/sdk/legacy/client/runtime/legacyInteractionLease.d.ts +2 -1
  540. package/build/sdk/legacy/client/runtime/legacyInteractionLease.d.ts.map +1 -1
  541. package/build/sdk/legacy/client/runtime/legacyInteractionLease.js +11 -2
  542. package/build/sdk/legacy/client/runtime/legacyInteractionLease.js.map +1 -1
  543. package/build/sdk/legacy/client/runtime/legacySdkClientAdapter.d.ts.map +1 -1
  544. package/build/sdk/legacy/client/runtime/legacySdkClientAdapter.js +40 -12
  545. package/build/sdk/legacy/client/runtime/legacySdkClientAdapter.js.map +1 -1
  546. package/build/sdk/legacy/client/runtime/mcpParamHeaders.d.ts +2 -0
  547. package/build/sdk/legacy/client/runtime/mcpParamHeaders.d.ts.map +1 -0
  548. package/build/sdk/legacy/client/runtime/mcpParamHeaders.js +2 -0
  549. package/build/sdk/legacy/client/runtime/mcpParamHeaders.js.map +1 -0
  550. package/build/sdk/legacy/client/runtime/modernSdkClientAdapter.d.ts +6 -0
  551. package/build/sdk/legacy/client/runtime/modernSdkClientAdapter.d.ts.map +1 -1
  552. package/build/sdk/legacy/client/runtime/modernSdkClientAdapter.js +119 -6
  553. package/build/sdk/legacy/client/runtime/modernSdkClientAdapter.js.map +1 -1
  554. package/build/sdk/legacy/client/runtime/oauthFlowHandler.d.ts +1 -1
  555. package/build/sdk/legacy/client/runtime/oauthFlowHandler.d.ts.map +1 -1
  556. package/build/sdk/legacy/client/runtime/oauthFlowHandler.js +73 -21
  557. package/build/sdk/legacy/client/runtime/oauthFlowHandler.js.map +1 -1
  558. package/build/sdk/legacy/client/runtime/serveClient.js +1 -1
  559. package/build/sdk/legacy/client/runtime/serveClient.js.map +1 -1
  560. package/build/sdk/legacy/commands/serve.d.ts +1 -0
  561. package/build/sdk/legacy/commands/serve.d.ts.map +1 -1
  562. package/build/sdk/legacy/commands/serve.js +99 -88
  563. package/build/sdk/legacy/commands/serve.js.map +1 -1
  564. package/build/sdk/legacy/server/protocol/notificationHandlers.d.ts.map +1 -1
  565. package/build/sdk/legacy/server/protocol/notificationHandlers.js +9 -14
  566. package/build/sdk/legacy/server/protocol/notificationHandlers.js.map +1 -1
  567. package/build/sdk/legacy/server/protocol/privateInteractionConnection.d.ts +1 -1
  568. package/build/sdk/legacy/server/protocol/privateInteractionConnection.d.ts.map +1 -1
  569. package/build/sdk/legacy/server/protocol/privateInteractionConnection.js +31 -11
  570. package/build/sdk/legacy/server/protocol/privateInteractionConnection.js.map +1 -1
  571. package/build/sdk/legacy/server/protocol/promptRequestHandlers.d.ts.map +1 -1
  572. package/build/sdk/legacy/server/protocol/promptRequestHandlers.js +10 -5
  573. package/build/sdk/legacy/server/protocol/promptRequestHandlers.js.map +1 -1
  574. package/build/sdk/legacy/server/protocol/requestHandlers.js +4 -4
  575. package/build/sdk/legacy/server/protocol/requestHandlers.js.map +1 -1
  576. package/build/sdk/legacy/server/protocol/requestInteractionScope.d.ts.map +1 -1
  577. package/build/sdk/legacy/server/protocol/requestInteractionScope.js +68 -12
  578. package/build/sdk/legacy/server/protocol/requestInteractionScope.js.map +1 -1
  579. package/build/sdk/legacy/server/protocol/requestProviderProgress.d.ts +8 -0
  580. package/build/sdk/legacy/server/protocol/requestProviderProgress.d.ts.map +1 -0
  581. package/build/sdk/legacy/server/protocol/requestProviderProgress.js +29 -0
  582. package/build/sdk/legacy/server/protocol/requestProviderProgress.js.map +1 -0
  583. package/build/sdk/legacy/server/protocol/resourceRequestHandlers.d.ts.map +1 -1
  584. package/build/sdk/legacy/server/protocol/resourceRequestHandlers.js +23 -2
  585. package/build/sdk/legacy/server/protocol/resourceRequestHandlers.js.map +1 -1
  586. package/build/sdk/legacy/server/protocol/resourceSubscriptions.js +1 -1
  587. package/build/sdk/legacy/server/protocol/resourceSubscriptions.js.map +1 -1
  588. package/build/sdk/legacy/server/protocol/toolRequestHandlers.d.ts.map +1 -1
  589. package/build/sdk/legacy/server/protocol/toolRequestHandlers.js +157 -62
  590. package/build/sdk/legacy/server/protocol/toolRequestHandlers.js.map +1 -1
  591. package/build/sdk/legacy/server/retained-sdk/LICENSE +21 -0
  592. package/build/sdk/legacy/server/retained-sdk/provenance.json +17 -0
  593. package/build/sdk/legacy/server/retained-sdk/streamableHttp.js +160 -0
  594. package/build/sdk/legacy/server/retained-sdk/webStandardStreamableHttp.js +950 -0
  595. package/build/sdk/legacy/server/runtime/clientInstancePool.d.ts.map +1 -1
  596. package/build/sdk/legacy/server/runtime/clientInstancePool.js +45 -76
  597. package/build/sdk/legacy/server/runtime/clientInstancePool.js.map +1 -1
  598. package/build/sdk/legacy/server/runtime/connectionManager.d.ts.map +1 -1
  599. package/build/sdk/legacy/server/runtime/connectionManager.js +25 -18
  600. package/build/sdk/legacy/server/runtime/connectionManager.js.map +1 -1
  601. package/build/sdk/legacy/server/runtime/legacySdkServerAdapter.d.ts +2 -0
  602. package/build/sdk/legacy/server/runtime/legacySdkServerAdapter.d.ts.map +1 -1
  603. package/build/sdk/legacy/server/runtime/legacySdkServerAdapter.js +17 -1
  604. package/build/sdk/legacy/server/runtime/legacySdkServerAdapter.js.map +1 -1
  605. package/build/sdk/legacy/server/runtime/mcpLoggingEnhancer.d.ts.map +1 -1
  606. package/build/sdk/legacy/server/runtime/mcpLoggingEnhancer.js +17 -32
  607. package/build/sdk/legacy/server/runtime/mcpLoggingEnhancer.js.map +1 -1
  608. package/build/sdk/legacy/server/runtime/mcpServerLifecycleManager.d.ts.map +1 -1
  609. package/build/sdk/legacy/server/runtime/mcpServerLifecycleManager.js +33 -42
  610. package/build/sdk/legacy/server/runtime/mcpServerLifecycleManager.js.map +1 -1
  611. package/build/sdk/legacy/server/runtime/serverManager.d.ts.map +1 -1
  612. package/build/sdk/legacy/server/runtime/serverManager.js +26 -32
  613. package/build/sdk/legacy/server/runtime/serverManager.js.map +1 -1
  614. package/build/sdk/legacy/server/runtime/templateServerCleanup.d.ts.map +1 -1
  615. package/build/sdk/legacy/server/runtime/templateServerCleanup.js +15 -43
  616. package/build/sdk/legacy/server/runtime/templateServerCleanup.js.map +1 -1
  617. package/build/sdk/legacy/server/runtime/templateServerManager.d.ts.map +1 -1
  618. package/build/sdk/legacy/server/runtime/templateServerManager.js +37 -38
  619. package/build/sdk/legacy/server/runtime/templateServerManager.js.map +1 -1
  620. package/build/sdk/legacy/server/streamableHttp.js +1 -1
  621. package/build/sdk/legacy/shared/capabilityListCapture.d.ts +2 -2
  622. package/build/sdk/legacy/shared/capabilityListCapture.d.ts.map +1 -1
  623. package/build/sdk/legacy/shared/capabilityListCapture.js +3 -3
  624. package/build/sdk/legacy/shared/capabilityListCapture.js.map +1 -1
  625. package/build/sdk/legacy/shared/resourceTemplateRouting.d.ts.map +1 -1
  626. package/build/sdk/legacy/shared/resourceTemplateRouting.js +29 -11
  627. package/build/sdk/legacy/shared/resourceTemplateRouting.js.map +1 -1
  628. package/build/sdk/legacy/shared/schemaProjection.d.ts +3 -1
  629. package/build/sdk/legacy/shared/schemaProjection.d.ts.map +1 -1
  630. package/build/sdk/legacy/shared/schemaProjection.js +7 -2
  631. package/build/sdk/legacy/shared/schemaProjection.js.map +1 -1
  632. package/build/sdk/legacy/transport/http/loggingSseTransport.d.ts.map +1 -1
  633. package/build/sdk/legacy/transport/http/loggingSseTransport.js +2 -11
  634. package/build/sdk/legacy/transport/http/loggingSseTransport.js.map +1 -1
  635. package/build/sdk/legacy/transport/http/middlewares/scopeAuthMiddleware.d.ts.map +1 -1
  636. package/build/sdk/legacy/transport/http/middlewares/scopeAuthMiddleware.js +13 -2
  637. package/build/sdk/legacy/transport/http/middlewares/scopeAuthMiddleware.js.map +1 -1
  638. package/build/sdk/legacy/transport/http/modernInboundLegacyBridge.d.ts +4 -0
  639. package/build/sdk/legacy/transport/http/modernInboundLegacyBridge.d.ts.map +1 -1
  640. package/build/sdk/legacy/transport/http/modernInboundLegacyBridge.js +14 -2
  641. package/build/sdk/legacy/transport/http/modernInboundLegacyBridge.js.map +1 -1
  642. package/build/sdk/legacy/transport/http/routes/sseRoutes.js +5 -5
  643. package/build/sdk/legacy/transport/http/routes/sseRoutes.js.map +1 -1
  644. package/build/sdk/legacy/transport/http/server.d.ts.map +1 -1
  645. package/build/sdk/legacy/transport/http/server.js +20 -7
  646. package/build/sdk/legacy/transport/http/server.js.map +1 -1
  647. package/build/sdk/legacy/transport/http/streamableSessionLifecycle.d.ts.map +1 -1
  648. package/build/sdk/legacy/transport/http/streamableSessionLifecycle.js +28 -45
  649. package/build/sdk/legacy/transport/http/streamableSessionLifecycle.js.map +1 -1
  650. package/build/sdk/legacy/transport/restartableStdioTransport.d.ts.map +1 -1
  651. package/build/sdk/legacy/transport/restartableStdioTransport.js +8 -11
  652. package/build/sdk/legacy/transport/restartableStdioTransport.js.map +1 -1
  653. package/build/sdk/legacy/transport/stdioProxyTransport.d.ts.map +1 -1
  654. package/build/sdk/legacy/transport/stdioProxyTransport.js +28 -36
  655. package/build/sdk/legacy/transport/stdioProxyTransport.js.map +1 -1
  656. package/build/sdk/legacy/transport/transportFactory.d.ts +1 -1
  657. package/build/sdk/legacy/transport/transportFactory.d.ts.map +1 -1
  658. package/build/sdk/legacy/transport/transportFactory.js +53 -40
  659. package/build/sdk/legacy/transport/transportFactory.js.map +1 -1
  660. package/build/server.d.ts.map +1 -1
  661. package/build/server.js +19 -24
  662. package/build/server.js.map +1 -1
  663. package/build/transport/http/middlewares/errorHandler.js +1 -1
  664. package/build/transport/http/middlewares/errorHandler.js.map +1 -1
  665. package/build/transport/http/middlewares/httpRequestLogger.d.ts +4 -14
  666. package/build/transport/http/middlewares/httpRequestLogger.d.ts.map +1 -1
  667. package/build/transport/http/middlewares/httpRequestLogger.js +134 -40
  668. package/build/transport/http/middlewares/httpRequestLogger.js.map +1 -1
  669. package/build/transport/http/middlewares/mcpAvailabilityMiddleware.d.ts.map +1 -1
  670. package/build/transport/http/middlewares/mcpAvailabilityMiddleware.js +8 -20
  671. package/build/transport/http/middlewares/mcpAvailabilityMiddleware.js.map +1 -1
  672. package/build/transport/http/middlewares/securityMiddleware.d.ts.map +1 -1
  673. package/build/transport/http/middlewares/securityMiddleware.js +7 -38
  674. package/build/transport/http/middlewares/securityMiddleware.js.map +1 -1
  675. package/build/transport/http/middlewares/tagsExtractor.js +2 -2
  676. package/build/transport/http/middlewares/tagsExtractor.js.map +1 -1
  677. package/build/transport/http/routes/cliTokenRoute.d.ts.map +1 -1
  678. package/build/transport/http/routes/cliTokenRoute.js +2 -1
  679. package/build/transport/http/routes/cliTokenRoute.js.map +1 -1
  680. package/build/transport/http/routes/healthRoutes.d.ts +11 -1
  681. package/build/transport/http/routes/healthRoutes.d.ts.map +1 -1
  682. package/build/transport/http/routes/healthRoutes.js +12 -8
  683. package/build/transport/http/routes/healthRoutes.js.map +1 -1
  684. package/build/transport/http/routes/inspectHelpers.d.ts.map +1 -1
  685. package/build/transport/http/routes/inspectHelpers.js +4 -3
  686. package/build/transport/http/routes/inspectHelpers.js.map +1 -1
  687. package/build/transport/http/routes/inspectRoutes.js +3 -3
  688. package/build/transport/http/routes/inspectRoutes.js.map +1 -1
  689. package/build/transport/http/routes/instructionsRoutes.js +1 -1
  690. package/build/transport/http/routes/instructionsRoutes.js.map +1 -1
  691. package/build/transport/http/routes/modernHttpRoutes.d.ts +4 -0
  692. package/build/transport/http/routes/modernHttpRoutes.d.ts.map +1 -1
  693. package/build/transport/http/routes/modernHttpRoutes.js +169 -24
  694. package/build/transport/http/routes/modernHttpRoutes.js.map +1 -1
  695. package/build/transport/http/routes/modernInteractionBinding.d.ts +2 -1
  696. package/build/transport/http/routes/modernInteractionBinding.d.ts.map +1 -1
  697. package/build/transport/http/routes/modernInteractionBinding.js +7 -4
  698. package/build/transport/http/routes/modernInteractionBinding.js.map +1 -1
  699. package/build/transport/http/routes/modernToolHeaderRegistry.d.ts +16 -0
  700. package/build/transport/http/routes/modernToolHeaderRegistry.d.ts.map +1 -0
  701. package/build/transport/http/routes/modernToolHeaderRegistry.js +161 -0
  702. package/build/transport/http/routes/modernToolHeaderRegistry.js.map +1 -0
  703. package/build/transport/http/routes/oauthRoutes.d.ts.map +1 -1
  704. package/build/transport/http/routes/oauthRoutes.js +12 -9
  705. package/build/transport/http/routes/oauthRoutes.js.map +1 -1
  706. package/build/transport/http/routes/streamableHttpRoutes.d.ts.map +1 -1
  707. package/build/transport/http/routes/streamableHttpRoutes.js +11 -21
  708. package/build/transport/http/routes/streamableHttpRoutes.js.map +1 -1
  709. package/build/transport/http/routes/toolRoutes.d.ts.map +1 -1
  710. package/build/transport/http/routes/toolRoutes.js +25 -9
  711. package/build/transport/http/routes/toolRoutes.js.map +1 -1
  712. package/build/transport/http/storage/streamableSessionRepository.d.ts.map +1 -1
  713. package/build/transport/http/storage/streamableSessionRepository.js +21 -36
  714. package/build/transport/http/storage/streamableSessionRepository.js.map +1 -1
  715. package/build/transport/http/utils/contextExtractor.d.ts.map +1 -1
  716. package/build/transport/http/utils/contextExtractor.js +6 -6
  717. package/build/transport/http/utils/contextExtractor.js.map +1 -1
  718. package/build/transport/http/utils/httpErrorHandler.d.ts +1 -1
  719. package/build/transport/http/utils/httpErrorHandler.d.ts.map +1 -1
  720. package/build/transport/http/utils/httpErrorHandler.js +5 -19
  721. package/build/transport/http/utils/httpErrorHandler.js.map +1 -1
  722. package/build/transport/http/utils/templateContextAuthority.d.ts.map +1 -1
  723. package/build/transport/http/utils/templateContextAuthority.js +6 -21
  724. package/build/transport/http/utils/templateContextAuthority.js.map +1 -1
  725. package/build/transport/http/utils/unifiedLogger.d.ts +10 -50
  726. package/build/transport/http/utils/unifiedLogger.d.ts.map +1 -1
  727. package/build/transport/http/utils/unifiedLogger.js +9 -77
  728. package/build/transport/http/utils/unifiedLogger.js.map +1 -1
  729. package/build/transport/managedStdioStderr.d.ts.map +1 -1
  730. package/build/transport/managedStdioStderr.js +2 -6
  731. package/build/transport/managedStdioStderr.js.map +1 -1
  732. package/build/utils/core/errorHandling.js +1 -1
  733. package/build/utils/core/errorHandling.js.map +1 -1
  734. package/build/utils/core/operationExecution.js +2 -2
  735. package/build/utils/core/operationExecution.js.map +1 -1
  736. package/build/utils/core/parsing.d.ts +2 -0
  737. package/build/utils/core/parsing.d.ts.map +1 -1
  738. package/build/utils/core/parsing.js +19 -0
  739. package/build/utils/core/parsing.js.map +1 -1
  740. package/build/utils/core/resourceUris.d.ts +6 -0
  741. package/build/utils/core/resourceUris.d.ts.map +1 -0
  742. package/build/utils/core/resourceUris.js +104 -0
  743. package/build/utils/core/resourceUris.js.map +1 -0
  744. package/build/utils/core/toolNames.d.ts +8 -0
  745. package/build/utils/core/toolNames.d.ts.map +1 -0
  746. package/build/utils/core/toolNames.js +56 -0
  747. package/build/utils/core/toolNames.js.map +1 -0
  748. package/build/utils/filePermissions.d.ts.map +1 -1
  749. package/build/utils/filePermissions.js +6 -6
  750. package/build/utils/filePermissions.js.map +1 -1
  751. package/build/utils/ui/interactiveSelector.js +1 -1
  752. package/build/utils/ui/interactiveSelector.js.map +1 -1
  753. package/build/utils/ui/urlGenerator.d.ts.map +1 -1
  754. package/build/utils/ui/urlGenerator.js +6 -10
  755. package/build/utils/ui/urlGenerator.js.map +1 -1
  756. package/build/utils/validation/scopeValidation.d.ts.map +1 -1
  757. package/build/utils/validation/scopeValidation.js +4 -12
  758. package/build/utils/validation/scopeValidation.js.map +1 -1
  759. package/build/utils/validation/urlDetection.js +4 -4
  760. package/build/utils/validation/urlDetection.js.map +1 -1
  761. package/package.json +70 -61
@@ -1,8 +1,9 @@
1
1
  import { getConfiguredServerTargets } from '../../config/configuredServerTargets.js';
2
2
  import { gatewayFailureFromUnknown } from '../../gateway/contracts/gatewayFailure.js';
3
+ import { writeLocalDiagnostic } from '../../logger/localDiagnostics.js';
3
4
  import logger, { errorIf } from '../../logger/logger.js';
4
5
  import { zodToInputSchema, zodToOutputSchema } from '../../utils/schemaUtils.js';
5
- import { CapabilityCatalog } from './capabilityCatalog.js';
6
+ import { CapabilityCatalog, } from './capabilityCatalog.js';
6
7
  import { ToolInvokeInputSchema, ToolInvokeOutputSchema, ToolListInputSchema, ToolListOutputSchema, ToolSchemaInputSchema, ToolSchemaOutputSchema, } from './schemas/metaToolSchemas.js';
7
8
  /**
8
9
  * MetaToolProvider provides meta-tools for lazy loading:
@@ -18,6 +19,7 @@ import { ToolInvokeInputSchema, ToolInvokeOutputSchema, ToolListInputSchema, Too
18
19
  * ```
19
20
  */
20
21
  export class MetaToolProvider {
22
+ refreshCapabilities;
21
23
  getToolRegistry;
22
24
  schemaCache;
23
25
  outboundConnections;
@@ -25,7 +27,8 @@ export class MetaToolProvider {
25
27
  defaultVisibility;
26
28
  capabilityCatalog;
27
29
  templateHashProvider;
28
- constructor(getToolRegistry, schemaCache, outboundConnections, loadSchema, defaultVisibility, templateHashProvider) {
30
+ constructor(getToolRegistry, schemaCache, outboundConnections, loadSchema, defaultVisibility, templateHashProvider, refreshCapabilities) {
31
+ this.refreshCapabilities = refreshCapabilities;
29
32
  this.getToolRegistry = getToolRegistry;
30
33
  this.schemaCache = schemaCache;
31
34
  this.outboundConnections = outboundConnections;
@@ -40,6 +43,7 @@ export class MetaToolProvider {
40
43
  defaultVisibility,
41
44
  templateHashProvider,
42
45
  getServerConfigs: getConfiguredServerTargets,
46
+ refreshCapabilities: this.refreshCapabilities,
43
47
  });
44
48
  }
45
49
  /**
@@ -55,6 +59,7 @@ export class MetaToolProvider {
55
59
  defaultVisibility: visibility,
56
60
  templateHashProvider: this.templateHashProvider,
57
61
  getServerConfigs: getConfiguredServerTargets,
62
+ refreshCapabilities: this.refreshCapabilities,
58
63
  });
59
64
  }
60
65
  /**
@@ -67,11 +72,17 @@ export class MetaToolProvider {
67
72
  * Call a meta-tool by name
68
73
  */
69
74
  async callMetaTool(name, args, visibility, signal, toolRegistry) {
70
- const query = { signal, toolRegistry };
75
+ const query = { signal, ...(toolRegistry ? { toolRegistry } : {}) };
71
76
  switch (name) {
72
77
  case 'tool_list': {
73
78
  const parsed = ToolListInputSchema.safeParse(args);
74
79
  if (!parsed.success) {
80
+ writeLocalDiagnostic('warn', 'tool.meta-validation-failed', {
81
+ requestedTool: name,
82
+ phase: 'meta_input_validation',
83
+ outcome: 'validation_failed',
84
+ error: parsed.error,
85
+ });
75
86
  return {
76
87
  tools: [],
77
88
  totalCount: 0,
@@ -88,6 +99,12 @@ export class MetaToolProvider {
88
99
  case 'tool_schema': {
89
100
  const parsed = ToolSchemaInputSchema.safeParse(args);
90
101
  if (!parsed.success) {
102
+ writeLocalDiagnostic('warn', 'tool.meta-validation-failed', {
103
+ requestedTool: name,
104
+ phase: 'meta_input_validation',
105
+ outcome: 'validation_failed',
106
+ error: parsed.error,
107
+ });
91
108
  return {
92
109
  schema: {},
93
110
  error: {
@@ -101,6 +118,12 @@ export class MetaToolProvider {
101
118
  case 'tool_invoke': {
102
119
  const parsed = ToolInvokeInputSchema.safeParse(args);
103
120
  if (!parsed.success) {
121
+ writeLocalDiagnostic('warn', 'tool.meta-validation-failed', {
122
+ requestedTool: name,
123
+ phase: 'meta_input_validation',
124
+ outcome: 'validation_failed',
125
+ error: parsed.error,
126
+ });
104
127
  return {
105
128
  result: {},
106
129
  server: '',
@@ -142,7 +165,11 @@ export class MetaToolProvider {
142
165
  */
143
166
  async listAvailableTools(args, visibility, query = {}) {
144
167
  try {
145
- const result = await this.capabilityCatalog.listVisibleTools(args, visibility, query);
168
+ const needsRecovery = !args.cursor && !query.toolRegistry && (await this.capabilityCatalog.requiresToolListingRecovery(visibility));
169
+ const result = await this.capabilityCatalog.listVisibleTools(args, visibility, {
170
+ ...query,
171
+ ...(needsRecovery ? { refreshIntent: 'force' } : {}),
172
+ });
146
173
  // Format tools for response
147
174
  const tools = result.tools.map((tool) => ({
148
175
  name: tool.name,
@@ -159,15 +186,13 @@ export class MetaToolProvider {
159
186
  servers,
160
187
  hasMore: result.hasMore,
161
188
  ...(result.nextCursor ? { nextCursor: result.nextCursor } : {}),
189
+ ...(result._meta ? { _meta: result._meta } : {}),
162
190
  };
163
191
  return response;
164
192
  }
165
193
  catch (error) {
166
194
  const failure = gatewayFailureFromUnknown(error);
167
- errorIf(() => ({
168
- message: 'Error in tool_list meta-tool',
169
- meta: { failure },
170
- }));
195
+ errorIf(() => ({ message: 'metaToolProvider.error.in.tool.list.meta.tool.eff4b338' }));
171
196
  return {
172
197
  tools: [],
173
198
  totalCount: 0,
@@ -210,10 +235,7 @@ export class MetaToolProvider {
210
235
  }
211
236
  catch (error) {
212
237
  const failure = gatewayFailureFromUnknown(error);
213
- errorIf(() => ({
214
- message: 'Error in tool_schema meta-tool',
215
- meta: { failure },
216
- }));
238
+ errorIf(() => ({ message: 'metaToolProvider.error.in.tool.schema.meta.tool.4ec3a241' }));
217
239
  return {
218
240
  schema: {},
219
241
  error: {
@@ -238,6 +260,7 @@ export class MetaToolProvider {
238
260
  * Implement tool_invoke
239
261
  */
240
262
  async callTool(args, visibility, query = {}) {
263
+ const startedAt = performance.now();
241
264
  try {
242
265
  const result = await this.capabilityCatalog.invokeVisibleTool(args, visibility, query);
243
266
  if (result.error) {
@@ -256,7 +279,16 @@ export class MetaToolProvider {
256
279
  }
257
280
  catch (error) {
258
281
  const failure = gatewayFailureFromUnknown(error, 'transport');
259
- logger.error('Meta-tool invocation failed', { failure });
282
+ logger.error('metaToolProvider.meta.tool.invocation.failed.aaeb1f9d', { error: error });
283
+ writeLocalDiagnostic('warn', 'tool.meta-failed', {
284
+ requestedTool: 'tool_invoke',
285
+ server: args.server,
286
+ tool: args.toolName,
287
+ outcome: query.signal?.aborted ? 'cancelled' : 'failed',
288
+ durationMs: performance.now() - startedAt,
289
+ error,
290
+ });
291
+ writeLocalDiagnostic('debug', 'tool.meta-failure-details', () => ({ error }));
260
292
  return {
261
293
  result: {},
262
294
  server: args.server,
@@ -1 +1 @@
1
- {"version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AM,EAAE,EAAE;gBACV,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,IAAI,EAAE,IAAI,CAAC,QAAQ;gBACnB,KAAK,EAAE;oBACL,IAAI,EAAE,UAAU;oBAChB,OAAO,EAAE,OAAO,CAAC,OAAO;iBACzB;aACF,CAAC;QACJ,CAAC;IACH,CAAC;CACF"}
1
+ {"version":3,"file":"metaToolProvider.js","sourceRoot":"","sources":["../../../src/core/capabilities/metaToolProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AAGpF,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAEhF,OAAO,EACL,iBAAiB,GAGlB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,qBAAqB,EAErB,sBAAsB,EACtB,mBAAmB,EAEnB,oBAAoB,EACpB,qBAAqB,EAErB,sBAAsB,GACvB,MAAM,8BAA8B,CAAC;AAiDtC;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,gBAAgB;IAgBR;IAfX,eAAe,CAAuB;IACtC,WAAW,CAAc;IACzB,mBAAmB,CAAsB;IACzC,UAAU,CAAgB;IAC1B,iBAAiB,CAAwB;IACzC,iBAAiB,CAAoB;IACrC,oBAAoB,CAAwB;IAEpD,YACE,eAAqC,EACrC,WAAwB,EACxB,mBAAwC,EACxC,UAAyB,EACzB,iBAAwC,EACxC,oBAA2C,EAC1B,mBAA0E;QAA1E,wBAAmB,GAAnB,mBAAmB,CAAuD;QAE3F,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,mBA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AC,IAAI;aAClB,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,OAAO,GAAG,yBAAyB,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;YAC9D,MAAM,CAAC,KAAK,CAAC,uDAAuD,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;YACxF,oBAAoB,CAAC,MAAM,EAAE,kBAAkB,EAAE;gBAC/C,aAAa,EAAE,aAAa;gBAC5B,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,IAAI,EAAE,IAAI,CAAC,QAAQ;gBACnB,OAAO,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ;gBACvD,UAAU,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,SAAS;gBACzC,KAAK;aACN,CAAC,CAAC;YACH,oBAAoB,CAAC,OAAO,EAAE,2BAA2B,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;YAE9E,OAAO;gBACL,MAAM,EAAE,EAAE;gBACV,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,IAAI,EAAE,IAAI,CAAC,QAAQ;gBACnB,KAAK,EAAE;oBACL,IAAI,EAAE,UAAU;oBAChB,OAAO,EAAE,OAAO,CAAC,OAAO;iBACzB;aACF,CAAC;QACJ,CAAC;IACH,CAAC;CACF"}
@@ -1,7 +1,7 @@
1
1
  import { type MCPServerParams, type OutboundConnection, type OutboundConnections } from '../types/index.js';
2
2
  import { type Tool } from '../../sdk/contracts/index.js';
3
- import { type CapabilityPaginationResult } from './capabilityPagination.js';
4
- import type { CapabilityVisibility } from './capabilityVisibility.js';
3
+ import { type CapabilityPaginationResult, type CapabilityResponseBudget } from './capabilityPagination.js';
4
+ import { type CapabilityVisibility } from './capabilityVisibility.js';
5
5
  import { type CapabilityKind, type CatalogEntry, type CatalogGeneration } from './catalogGeneration.js';
6
6
  /** Only backend replacement is eligible for the aggregate's single collection retry. */
7
7
  export declare class RuntimeCatalogBackendChangedError extends Error {
@@ -30,12 +30,19 @@ export interface PreparedToolCall {
30
30
  }
31
31
  export interface RuntimeCapabilitySnapshot {
32
32
  readonly generation: CatalogGeneration;
33
+ /** Synchronous completeness facts from this captured observation, independent of pagination walks. */
34
+ readonly capabilityMeta?: Partial<Record<CapabilityKind, Record<string, unknown>>>;
33
35
  prepareToolCall(identity: string, args: unknown, signal?: AbortSignal): Promise<PreparedToolCall>;
36
+ /** The same admitted schema projection used by tools/list, with its captured source fence. */
37
+ getToolDefinition(identity: string): {
38
+ tool: Record<string, unknown>;
39
+ assertCurrent(): void;
40
+ } | undefined;
34
41
  readonly connections: ReadonlyMap<string, OutboundConnection>;
35
42
  isCurrent(): boolean;
36
43
  /** Whether a captured backend failed to enumerate this kind, leaving the snapshot partial. */
37
44
  hasFailedSources(kind: CapabilityKind): boolean;
38
- /** Issue a session-scoped, backend-bound route for a resource absent from discovery. */
45
+ /** Issue an owner- or session-scoped, backend-bound route for a resource absent from discovery. */
39
46
  projectUnlistedResource(connectionKey: string, upstreamIdentity: string): string;
40
47
  resolve(kind: CapabilityKind, publicIdentity: string): {
41
48
  entry: CatalogEntry;
@@ -49,8 +56,16 @@ export interface RuntimeCapabilitySnapshot {
49
56
  internalOnly?: boolean;
50
57
  visibility?: CapabilityVisibility;
51
58
  serverConfigs?: Record<string, MCPServerParams>;
59
+ /** Set when the page becomes a client response; see {@link CapabilityResponseBudget}. */
60
+ responseBudget?: CapabilityResponseBudget<T>;
52
61
  }): Promise<CapabilityPaginationResult<T>>;
53
62
  }
63
+ /** Provenance alone grants no authority: each read must also assert its current owner and route. */
64
+ export declare function isIssuedRuntimeResourceEntry(entry: CatalogEntry): boolean;
65
+ export declare const RUNTIME_CATALOG_SCOPE_TTL_MS: number;
66
+ export declare const MAX_RUNTIME_CATALOG_SCOPES = 256;
67
+ /** Reclaim revoked listener owners without changing legacy session or cursor ownership. */
68
+ export declare function pruneRuntimeResourceRoutes(connections: OutboundConnections): void;
54
69
  /** Release all visibility variants and in-flight publications owned by a disconnected session. */
55
70
  export declare function evictRuntimeCapabilityCatalogSession(connections: OutboundConnections, sessionId: string): void;
56
71
  /** Acquire all route and projection facts before dispatching any capability operation. */
@@ -1 +1 @@
1
- {"version":3,"file":"runtimeCapabilityCatalog.d.ts","sourceRoot":"","sources":["../../../src/core/capabilities/runtimeCapabilityCatalog.ts"],"names":[],"mappings":"AAMA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACzB,MAAM,0BAA0B,CAAC;AAQlC,OAAO,EAAkC,KAAK,IAAI,EAAE,MAAM,6BAA6B,CAAC;AAGxF,OAAO,EAIL,KAAK,0BAA0B,EAKhC,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAEL,KAAK,cAAc,EAEnB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACvB,MAAM,wBAAwB,CAAC;AAOhC,wFAAwF;AACxF,qBAAa,iCAAkC,SAAQ,KAAK;;CAK3D;AASD,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAChD,aAAa,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IACnC,iBAAiB,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IACvC,eAAe,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IACrC,yBAAyB,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAC/C,eAAe,CAAC,EAAE,SAAS,IAAI,EAAE,CAAC;IAClC,YAAY,CAAC,EAAE;QACb,IAAI,EAAE,cAAc,CAAC;QACrB,MAAM,EAAE,MAAM,CAAC;QACf,gBAAgB,EAAE,OAAO,CAAC;QAC1B,QAA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;KACjD,GACA,OAAO,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC,CAAC;CAC3C;AAuBD,kGAAkG;AAClG,wBAAgB,oCAAoC,CAAC,WAAW,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAU9G;AAED,0FAA0F;AAC1F,wBAAsB,+BAA+B,CACnD,WAAW,EAAE,mBAAmB,EAChC,UAAU,CAAC,EAAE,oBAAoB,EACjC,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,yBAAyB,CAAC,CAUpC"}
1
+ {"version":3,"file":"runtimeCapabilityCatalog.d.ts","sourceRoot":"","sources":["../../../src/core/capabilities/runtimeCapabilityCatalog.ts"],"names":[],"mappings":"AAOA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACzB,MAAM,0BAA0B,CAAC;AAQlC,OAAO,EAAkC,KAAK,IAAI,EAAE,MAAM,6BAA6B,CAAC;AAGxF,OAAO,EAIL,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAO9B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,KAAK,oBAAoB,EAG1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAEL,KAAK,cAAc,EAEnB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACvB,MAAM,wBAAwB,CAAC;AAOhC,wFAAwF;AACxF,qBAAa,iCAAkC,SAAQ,KAAK;;CAK3D;AASD,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAChD,aAAa,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IACnC,iBAAiB,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IACvC,eAAe,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IACrC,yBAAyB,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAC/C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requestLegacyAdapter } from '../client/legacyAdapterRequest.js';
4
4
  import { isSourceToolDisabled } from '../server/disabledTools.js';
5
+ import { parseTemplateConnectionKey } from '../server/templateIdentity.js';
5
6
  import { applySourceToolDescription } from '../server/toolDescriptionOverrides.js';
6
7
  import { ClientStatus, } from '../types/index.js';
7
8
  import { SchemaBoundaryError } from '../validation/schemaBoundary.js';
8
9
  import { admitToolSchemas, prepareToolValidation, projectToolSchemas, } from '../validation/toolSchemaBoundary.js';
9
10
  import { ErrorCode, OneMcpProtocolError } from '../../sdk/contracts/index.js';
10
11
  import { MCPError } from '../../utils/core/errorTypes.js';
11
- import { CapabilityCursorCapacityError, compareCodePoints, registerCapabilityPaginationNotifications, unregisterCapabilityPaginationConnections, walkCapabilityPages, } from './capabilityPagination.js';
12
+ import { CapabilityCursorCapacityError, compareCodePoints, createCapabilityPartialMeta, getCapabilityPaginationGeneration, registerCapabilityPaginationNotifications, unregisterCapabilityPaginationConnections, walkCapabilityPages, } from './capabilityPagination.js';
13
+ import { isResourceRouteOwnerActive, } from './capabilityVisibility.js';
12
14
  import { buildCatalogGeneration, } from './catalogGeneration.js';
13
15
  import { clearConfiguredToolSnapshot, publishCompleteConfiguredToolTargetSnapshots, publishConfiguredToolSnapshot, } from './configuredToolSnapshot.js';
14
16
  /** Only backend replacement is eligible for the aggregate's single collection retry. */
@@ -25,20 +27,78 @@ const METHODS = {
25
27
  resourceTemplates: 'resources/templates/list',
26
28
  };
27
29
  const states = new WeakMap();
30
+ const issuedResourceEntries = new WeakSet();
31
+ /** Provenance alone grants no authority: each read must also assert its current owner and route. */
32
+ export function isIssuedRuntimeResourceEntry(entry) {
33
+ return issuedResourceEntries.has(entry);
34
+ }
28
35
  let activeAcquisitions = 0;
29
36
  const MAX_ACTIVE_ACQUISITIONS = 256;
37
+ export const RUNTIME_CATALOG_SCOPE_TTL_MS = 15 * 60 * 1000;
38
+ export const MAX_RUNTIME_CATALOG_SCOPES = 256;
39
+ function resourceRouteIsCurrent(scope, route) {
40
+ if (Date.now() >= route.expiresAt)
41
+ return false;
42
+ if (route.owner && !isResourceRouteOwnerActive(route.owner))
43
+ return false;
44
+ const source = scope.resourceSources.get(route.entry.route.connectionKey);
45
+ return (!!source &&
46
+ getCapabilityPaginationGeneration(source, 'resources') === route.resourcesEpoch &&
47
+ getCapabilityPaginationGeneration(source, 'resourceTemplates') === route.templatesEpoch);
48
+ }
49
+ function pruneResourceRoutes(scope, connections) {
50
+ const retainedSources = new Set();
51
+ for (const [identity, route] of scope.resourceRoutes) {
52
+ const key = route.entry.route.connectionKey;
53
+ if (!resourceRouteIsCurrent(scope, route) ||
54
+ connections.get(key) !== route.connection ||
55
+ route.connection.adapter !== route.adapter ||
56
+ route.connection.status !== ClientStatus.Connected) {
57
+ scope.resourceRoutes.delete(identity);
58
+ }
59
+ else
60
+ retainedSources.add(key);
61
+ }
62
+ for (const [key, source] of scope.resourceSources) {
63
+ if (retainedSources.has(key))
64
+ continue;
65
+ unregisterCapabilityPaginationConnections(source);
66
+ scope.resourceSources.delete(key);
67
+ }
68
+ }
69
+ function releaseResourceRoutes(scope) {
70
+ scope.resourceRoutes.clear();
71
+ for (const source of scope.resourceSources.values())
72
+ unregisterCapabilityPaginationConnections(source);
73
+ scope.resourceSources.clear();
74
+ }
75
+ function resourceRouteOwnedBy(route, visibility) {
76
+ if (visibility?.resourceOwner)
77
+ return route.owner === visibility.resourceOwner;
78
+ return route.owner === undefined && route.sessionId === visibility?.sessionId;
79
+ }
80
+ /** Reclaim revoked listener owners without changing legacy session or cursor ownership. */
81
+ export function pruneRuntimeResourceRoutes(connections) {
82
+ for (const scope of states.get(connections)?.scopes.values() ?? [])
83
+ pruneResourceRoutes(scope, connections);
84
+ }
30
85
  /** Release all visibility variants and in-flight publications owned by a disconnected session. */
31
86
  export function evictRuntimeCapabilityCatalogSession(connections, sessionId) {
32
87
  const state = states.get(connections);
33
88
  if (!state)
34
89
  return;
35
90
  for (const [key, scope] of state.scopes) {
91
+ for (const [identity, route] of scope.resourceRoutes) {
92
+ if (!route.owner && route.sessionId === sessionId)
93
+ scope.resourceRoutes.delete(identity);
94
+ }
95
+ pruneResourceRoutes(scope, connections);
36
96
  if (scope.sessionId !== sessionId)
37
97
  continue;
38
98
  state.scopes.delete(key);
39
99
  unregisterCapabilityPaginationConnections(scope.paginationConnections);
40
100
  scope.paginationConnections.clear();
41
- scope.resourceRoutes.clear();
101
+ releaseResourceRoutes(scope);
42
102
  }
43
103
  }
44
104
  /** Acquire all route and projection facts before dispatching any capability operation. */
@@ -62,21 +122,23 @@ async function collectRuntimeCapabilityCatalog(connections, visibility, options)
62
122
  states.set(connections, state);
63
123
  }
64
124
  for (const [key, retained] of state.scopes) {
65
- if (Date.now() - retained.lastAccess < 15 * 60 * 1000)
125
+ pruneResourceRoutes(retained, connections);
126
+ if (Date.now() - retained.lastAccess < RUNTIME_CATALOG_SCOPE_TTL_MS)
66
127
  continue;
67
128
  state.scopes.delete(key);
68
129
  unregisterCapabilityPaginationConnections(retained.paginationConnections);
69
130
  retained.paginationConnections.clear();
70
- retained.resourceRoutes.clear();
131
+ releaseResourceRoutes(retained);
71
132
  }
72
133
  const captured = new Map(Array.from(connections).filter(([key, connection]) => connection.status === ClientStatus.Connected && (!visibility || visibility.serverCandidates.has(key))));
73
134
  const capturedAdapters = new Map(Array.from(captured, ([key, connection]) => [key, connection.adapter]));
74
135
  const { continuation, signal, ...catalogOptions } = options;
75
136
  signal?.throwIfAborted();
137
+ const scopeSessionId = isSessionIndependent(visibility) ? undefined : visibility?.sessionId;
76
138
  const scope = createHash('sha256')
77
139
  .update(JSON.stringify([
78
140
  Array.from(captured.keys()).sort(),
79
- visibility?.sessionId,
141
+ scopeSessionId,
80
142
  visibility?.filterSelection,
81
143
  catalogOptions,
82
144
  visibility ? Array.from(visibility.serverCandidates).sort(([a], [b]) => compareCodePoints(a, b)) : null,
@@ -111,14 +173,16 @@ async function collectRuntimeCapabilityCatalog(connections, visibility, options)
111
173
  const started = state.nextId++;
112
174
  let currentScope = state.scopes.get(scope);
113
175
  if (!currentScope) {
114
- if (state.scopes.size >= 256)
176
+ if (state.scopes.size >= MAX_RUNTIME_CATALOG_SCOPES)
115
177
  throw new CapabilityCursorCapacityError();
116
178
  currentScope = {
117
- sessionId: visibility?.sessionId,
179
+ sessionId: scopeSessionId,
118
180
  latestStarted: started,
119
181
  lastAccess: Date.now(),
120
182
  paginationConnections: new Map(captured),
121
183
  resourceRoutes: new Map(),
184
+ resourceSources: new Map(),
185
+ admissionOutcomes: new Map(),
122
186
  };
123
187
  state.scopes.set(scope, currentScope);
124
188
  }
@@ -292,8 +356,33 @@ async function collectRuntimeCapabilityCatalog(connections, visibility, options)
292
356
  }
293
357
  if (!scopedState.observedTools || started > scopedState.observedTools.started) {
294
358
  scopedState.observedTools = { started, fingerprints: sourceFingerprints };
359
+ for (const [routeKey, outcome] of scopedState.admissionOutcomes) {
360
+ if (sourceFingerprints.has(routeKey))
361
+ continue;
362
+ const provider = sourcePages.find((page) => page.kind === 'tools' && page.key === outcome.connectionKey);
363
+ // Failed listing does not prove a previously observed tool was removed.
364
+ if (provider?.error)
365
+ continue;
366
+ scopedState.admissionOutcomes.delete(routeKey);
367
+ }
295
368
  }
369
+ const recordAdmission = (routeKey, connectionKey, error) => {
370
+ if (!scopedState.observedTools?.fingerprints.has(routeKey))
371
+ return;
372
+ const previous = scopedState.admissionOutcomes.get(routeKey);
373
+ if (previous && previous.started > started)
374
+ return;
375
+ if (!previous && scopedState.admissionOutcomes.size >= 100000)
376
+ throw new CapabilityCursorCapacityError();
377
+ scopedState.admissionOutcomes.set(routeKey, { started, connectionKey, error });
378
+ if (!error)
379
+ return;
380
+ const connection = captured.get(connectionKey);
381
+ if (connection)
382
+ publishConfiguredToolSnapshot(connection, [], false);
383
+ };
296
384
  const schemaContracts = new Map();
385
+ const admissionTimeouts = [];
297
386
  for (let index = 0; index < sources.length;) {
298
387
  const source = sources[index];
299
388
  if (source.kind !== 'tools') {
@@ -310,12 +399,26 @@ async function collectRuntimeCapabilityCatalog(connections, visibility, options)
310
399
  signal,
311
400
  }));
312
401
  signal?.throwIfAborted();
402
+ recordAdmission(routeKey, source.connectionKey);
313
403
  index++;
314
404
  }
315
405
  catch (error) {
316
406
  signal?.throwIfAborted();
317
- if (!(error instanceof SchemaBoundaryError) || error.retryable)
407
+ recordAdmission(routeKey, source.connectionKey, error instanceof SchemaBoundaryError ? error : new SchemaBoundaryError('schema_invalid'));
408
+ if (!(error instanceof SchemaBoundaryError))
409
+ throw error;
410
+ if (source.origin === 'internal')
318
411
  throw error;
412
+ if (error.phase !== 'admission')
413
+ throw error;
414
+ if (error.code === 'schema_evaluation_unavailable')
415
+ throw error;
416
+ if (error.code === 'schema_evaluation_timeout') {
417
+ admissionTimeouts.push(source.connectionKey);
418
+ }
419
+ else if (error.retryable) {
420
+ throw error;
421
+ }
319
422
  sources.splice(index, 1);
320
423
  }
321
424
  }
@@ -357,6 +460,7 @@ async function collectRuntimeCapabilityCatalog(connections, visibility, options)
357
460
  }
358
461
  const entriesJson = JSON.stringify([
359
462
  generation.entries,
463
+ admissionTimeouts,
360
464
  sourcePages.map((provider) => ({
361
465
  kind: provider.kind,
362
466
  key: provider.key,
@@ -374,18 +478,29 @@ async function collectRuntimeCapabilityCatalog(connections, visibility, options)
374
478
  }
375
479
  return lastSignature;
376
480
  };
481
+ const capabilityMeta = {};
482
+ for (const kind of Object.keys(METHODS)) {
483
+ const meta = createCapabilityPartialMeta(String(generation.id), sourcePages.filter((provider) => provider.kind === kind && provider.error).map((provider) => provider.key), kind === 'tools' ? admissionTimeouts : []);
484
+ if (meta)
485
+ capabilityMeta[kind] = meta;
486
+ }
377
487
  const snapshot = Object.freeze({
378
488
  generation,
379
- async prepareToolCall(identity, args, signal) {
489
+ ...(Object.keys(capabilityMeta).length > 0 ? { capabilityMeta: Object.freeze(capabilityMeta) } : {}),
490
+ getToolDefinition(identity) {
380
491
  const resolved = snapshot.resolve('tools', identity);
381
492
  if (!resolved)
382
- throw new SchemaBoundaryError('schema_invalid');
493
+ return undefined;
383
494
  const routeKey = JSON.stringify([resolved.entry.route.connectionKey, resolved.entry.route.upstreamIdentity]);
384
495
  const contract = schemaContracts.get(routeKey);
385
496
  if (!contract)
386
497
  throw new SchemaBoundaryError('schema_invalid');
387
498
  const assertContractCurrent = () => {
388
499
  assertCurrent();
500
+ // Admission outcomes invalidate routes even when a newer pending read suppresses publication.
501
+ const failure = scopedState.admissionOutcomes.get(routeKey)?.error;
502
+ if (failure)
503
+ throw new SchemaBoundaryError(failure.code, failure.retryable, failure.phase);
389
504
  // A known changed/removed source invalidates just this route, including an
390
505
  // admission that fails. Starting an otherwise identical read does not.
391
506
  if (scopedState.observedTools?.fingerprints.get(routeKey) !== sourceFingerprints.get(routeKey))
@@ -398,13 +513,25 @@ async function collectRuntimeCapabilityCatalog(connections, visibility, options)
398
513
  throw new SchemaBoundaryError('schema_invalid');
399
514
  };
400
515
  assertContractCurrent();
516
+ return Object.freeze({
517
+ tool: Object.freeze(projectToolSchemas(resolved.entry.publicObject, contract)),
518
+ assertCurrent: assertContractCurrent,
519
+ });
520
+ },
521
+ async prepareToolCall(identity, args, signal) {
522
+ const definition = snapshot.getToolDefinition(identity);
523
+ if (!definition)
524
+ throw new SchemaBoundaryError('schema_invalid');
525
+ const resolved = snapshot.resolve('tools', identity);
526
+ const routeKey = JSON.stringify([resolved.entry.route.connectionKey, resolved.entry.route.upstreamIdentity]);
527
+ const contract = schemaContracts.get(routeKey);
401
528
  const validateOutput = await prepareToolValidation(contract, args, {
402
529
  routeKey,
403
530
  generation: String(started),
404
531
  signal,
405
532
  });
406
- assertContractCurrent();
407
- return Object.freeze(Object.assign(validateOutput, { assertCurrent: assertContractCurrent }));
533
+ definition.assertCurrent();
534
+ return Object.freeze(Object.assign(validateOutput, { assertCurrent: definition.assertCurrent }));
408
535
  },
409
536
  connections: readonlyConnections(captured),
410
537
  isCurrent,
@@ -413,17 +540,27 @@ async function collectRuntimeCapabilityCatalog(connections, visibility, options)
413
540
  },
414
541
  projectUnlistedResource(connectionKey, upstreamIdentity) {
415
542
  assertCurrent();
543
+ if (visibility?.resourceOwner && !isResourceRouteOwnerActive(visibility.resourceOwner))
544
+ throw new Error('Resource route owner is unavailable');
545
+ pruneResourceRoutes(scopedState, connections);
416
546
  const connection = captured.get(connectionKey);
417
547
  if (!connection)
418
548
  throw new Error('Unknown resource backend');
419
549
  for (const [identity, route] of scopedState.resourceRoutes) {
420
- if (route.entry.route.connectionKey === connectionKey &&
550
+ if (resourceRouteOwnedBy(route, visibility) &&
551
+ route.entry.route.connectionKey === connectionKey &&
421
552
  route.entry.route.upstreamIdentity === upstreamIdentity)
422
553
  return identity;
423
554
  }
424
555
  if (scopedState.resourceRoutes.size >= 1000)
425
556
  throw new Error('Resource route capacity exceeded');
426
- // This namespace cannot collide with canonical identities, which always contain the MCP separator.
557
+ let source = scopedState.resourceSources.get(connectionKey);
558
+ if (!source) {
559
+ source = new Map([[connectionKey, connection]]);
560
+ scopedState.resourceSources.set(connectionKey, source);
561
+ registerCapabilityPaginationNotifications(source, connection);
562
+ }
563
+ // Generated resource identities use a scheme extension; retained legacy identities contain the MCP separator.
427
564
  const identity = `urn:1mcp:resource:${randomUUID()}`;
428
565
  const server = visibility?.serverCandidates.get(connectionKey) ?? connection.name ?? connectionKey;
429
566
  const entry = Object.freeze({
@@ -438,12 +575,24 @@ async function collectRuntimeCapabilityCatalog(connections, visibility, options)
438
575
  sourceObject: Object.freeze({ name: upstreamIdentity, uri: upstreamIdentity }),
439
576
  publicObject: Object.freeze({ name: upstreamIdentity, uri: identity }),
440
577
  });
441
- scopedState.resourceRoutes.set(identity, { entry, connection, adapter: connection.adapter });
578
+ issuedResourceEntries.add(entry);
579
+ scopedState.resourceRoutes.set(identity, {
580
+ entry,
581
+ connection,
582
+ adapter: connection.adapter,
583
+ ...(visibility?.resourceOwner ? { owner: visibility.resourceOwner } : { sessionId: visibility?.sessionId }),
584
+ expiresAt: Date.now() + RUNTIME_CATALOG_SCOPE_TTL_MS,
585
+ resourcesEpoch: getCapabilityPaginationGeneration(source, 'resources'),
586
+ templatesEpoch: getCapabilityPaginationGeneration(source, 'resourceTemplates'),
587
+ });
442
588
  return identity;
443
589
  },
444
590
  resolve(kind, identity) {
445
591
  assertCurrent();
446
- const issued = kind === 'resources' ? scopedState.resourceRoutes.get(identity) : undefined;
592
+ const routed = kind === 'resources' ? scopedState.resourceRoutes.get(identity) : undefined;
593
+ const issued = routed && resourceRouteOwnedBy(routed, visibility) && resourceRouteIsCurrent(scopedState, routed)
594
+ ? routed
595
+ : undefined;
447
596
  const entry = generation.resolve(kind, identity, keys) ??
448
597
  (issued &&
449
598
  captured.get(issued.entry.route.connectionKey) === issued.connection &&
@@ -556,6 +705,7 @@ async function collectRuntimeCapabilityCatalog(connections, visibility, options)
556
705
  failedProviderIds: sourcePages
557
706
  .filter((provider) => provider.kind === kind && provider.error)
558
707
  .map((provider) => provider.key),
708
+ upstreamToolAdmissionTimeouts: kind === 'tools' ? admissionTimeouts : undefined,
559
709
  extraGenerationSignature: signature(listOptions.serverConfigs ?? options.serverConfigs),
560
710
  providers,
561
711
  });
@@ -572,7 +722,7 @@ async function collectRuntimeCapabilityCatalog(connections, visibility, options)
572
722
  else
573
723
  publishConfiguredToolSnapshot(connection, generation.entries
574
724
  .filter((entry) => entry.route.kind === 'tools' && entry.route.connectionKey === key)
575
- .map((entry) => entry.sourceObject));
725
+ .map((entry) => entry.sourceObject), !admissionTimeouts.includes(key));
576
726
  }
577
727
  publishCompleteConfiguredToolTargetSnapshots(connections);
578
728
  }
@@ -585,6 +735,20 @@ async function collectRuntimeCapabilityCatalog(connections, visibility, options)
585
735
  function isUnimplementedResourceTemplates(kind, error) {
586
736
  return (kind === 'resourceTemplates' && error instanceof OneMcpProtocolError && error.code === ErrorCode.MethodNotFound);
587
737
  }
738
+ /**
739
+ * Static servers look the same to every session, so their catalog scope can be shared.
740
+ * Stateless inbound requests run each page in a fresh session; a shared scope lets the
741
+ * next request resume a cursor. Session-scoped template instances keep their own scope.
742
+ */
743
+ function isSessionIndependent(visibility) {
744
+ if (!visibility)
745
+ return true;
746
+ for (const key of visibility.serverCandidates.keys()) {
747
+ if (parseTemplateConnectionKey(key).kind !== 'static')
748
+ return false;
749
+ }
750
+ return true;
751
+ }
588
752
  function getCapabilityIdentity(kind, value) {
589
753
  if (kind === 'resources')
590
754
  return value.uri;