@1mcp/agent 0.37.0 → 0.38.1

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 (987) hide show
  1. package/build/admin/assets/{admin-OAuthServicesWorkspace-BHyDoEos.js → admin-OAuthServicesWorkspace-C3DNmymC.js} +1 -1
  2. package/build/admin/assets/{admin-console-DnlZpz5X.js → admin-console-BmdH0cQS.js} +3 -3
  3. package/build/admin/index.html +1 -1
  4. package/build/application/services/healthService.d.ts +6 -6
  5. package/build/application/services/healthService.d.ts.map +1 -1
  6. package/build/application/services/healthService.js +1 -1
  7. package/build/application/services/healthService.js.map +1 -1
  8. package/build/application/services/tokenEstimationService.d.ts +1 -1
  9. package/build/application/services/tokenEstimationService.d.ts.map +1 -1
  10. package/build/application/services/tokenEstimationService.js.map +1 -1
  11. package/build/auth/oauthAuthorizationFlow.d.ts +17 -11
  12. package/build/auth/oauthAuthorizationFlow.d.ts.map +1 -1
  13. package/build/auth/oauthAuthorizationFlow.js +64 -20
  14. package/build/auth/oauthAuthorizationFlow.js.map +1 -1
  15. package/build/auth/sdkOAuthClientProvider.d.ts +2 -97
  16. package/build/auth/sdkOAuthClientProvider.d.ts.map +1 -1
  17. package/build/auth/sdkOAuthClientProvider.js +1 -242
  18. package/build/auth/sdkOAuthClientProvider.js.map +1 -1
  19. package/build/auth/sdkOAuthServerProvider.d.ts +1 -68
  20. package/build/auth/sdkOAuthServerProvider.d.ts.map +1 -1
  21. package/build/auth/sdkOAuthServerProvider.js +1 -483
  22. package/build/auth/sdkOAuthServerProvider.js.map +1 -1
  23. package/build/auth/sessionTypes.d.ts +1 -1
  24. package/build/auth/sessionTypes.d.ts.map +1 -1
  25. package/build/auth/sessionTypes.js.map +1 -1
  26. package/build/auth/storage/authCodeRepository.d.ts +1 -1
  27. package/build/auth/storage/authRequestRepository.d.ts +1 -1
  28. package/build/auth/storage/clientDataRepository.d.ts +1 -1
  29. package/build/auth/storage/clientDataRepository.d.ts.map +1 -1
  30. package/build/auth/storage/clientDataRepository.js.map +1 -1
  31. package/build/auth/storage/clientSessionRepository.d.ts +1 -1
  32. package/build/auth/storage/fileStorageService.d.ts +3 -1
  33. package/build/auth/storage/fileStorageService.d.ts.map +1 -1
  34. package/build/auth/storage/fileStorageService.js +61 -7
  35. package/build/auth/storage/fileStorageService.js.map +1 -1
  36. package/build/auth/storage/refreshTokenFamilyRepository.d.ts +1 -1
  37. package/build/auth/storage/refreshTokenFamilyRepository.js +1 -1
  38. package/build/auth/storage/sessionRepository.d.ts +1 -1
  39. package/build/auth/storage/sessionRepository.js +1 -1
  40. package/build/commands/admin/admin.d.ts +2 -2
  41. package/build/commands/admin/admin.js +3 -3
  42. package/build/commands/admin/index.js +1 -1
  43. package/build/commands/app/consolidate.js +1 -1
  44. package/build/commands/auth/index.js +1 -1
  45. package/build/commands/auth/login.js +1 -1
  46. package/build/commands/auth/runtimeTargetContext.js +1 -1
  47. package/build/commands/auth/status.js +1 -1
  48. package/build/commands/inspect/index.js +1 -1
  49. package/build/commands/inspect/inspect.d.ts +3 -3
  50. package/build/commands/inspect/inspect.d.ts.map +1 -1
  51. package/build/commands/inspect/inspect.js +43 -16
  52. package/build/commands/inspect/inspect.js.map +1 -1
  53. package/build/commands/inspect/inspectUtils.d.ts +2 -2
  54. package/build/commands/inspect/inspectUtils.d.ts.map +1 -1
  55. package/build/commands/inspect/inspectUtils.js +16 -16
  56. package/build/commands/inspect/inspectUtils.js.map +1 -1
  57. package/build/commands/instructions/index.js +1 -1
  58. package/build/commands/instructions/instructions.js +4 -4
  59. package/build/commands/mcp/enable.d.ts +1 -1
  60. package/build/commands/mcp/enable.js +2 -2
  61. package/build/commands/mcp/restart.d.ts +1 -1
  62. package/build/commands/mcp/restart.js +2 -2
  63. package/build/commands/mcp/status.d.ts +1 -1
  64. package/build/commands/mcp/status.js +2 -2
  65. package/build/commands/mcp/tokens.js +1 -1
  66. package/build/commands/mcp/tools.d.ts +1 -1
  67. package/build/commands/mcp/tools.js +1 -1
  68. package/build/commands/mcp/utils/mcpServerConfig.d.ts +1 -1
  69. package/build/commands/mcp/utils/mcpServerConfig.js +2 -2
  70. package/build/commands/preset/edit.js +1 -1
  71. package/build/commands/preset/interactive.js +1 -1
  72. package/build/commands/preset/show.js +1 -1
  73. package/build/commands/preset/test.js +1 -1
  74. package/build/commands/proxy/proxy.js +1 -1
  75. package/build/commands/run/index.js +1 -1
  76. package/build/commands/run/run.d.ts +4 -4
  77. package/build/commands/run/run.d.ts.map +1 -1
  78. package/build/commands/run/run.js +19 -13
  79. package/build/commands/run/run.js.map +1 -1
  80. package/build/commands/run/runUtils.d.ts +1 -1
  81. package/build/commands/run/runUtils.d.ts.map +1 -1
  82. package/build/commands/run/runUtils.js.map +1 -1
  83. package/build/commands/run/upstreamEofGuidance.d.ts +3 -0
  84. package/build/commands/run/upstreamEofGuidance.d.ts.map +1 -0
  85. package/build/commands/run/upstreamEofGuidance.js +19 -0
  86. package/build/commands/run/upstreamEofGuidance.js.map +1 -0
  87. package/build/commands/serve/asyncLoadingOptions.d.ts.map +1 -1
  88. package/build/commands/serve/asyncLoadingOptions.js +1 -1
  89. package/build/commands/serve/asyncLoadingOptions.js.map +1 -1
  90. package/build/commands/serve/serve.d.ts +1 -89
  91. package/build/commands/serve/serve.d.ts.map +1 -1
  92. package/build/commands/serve/serve.js +1 -550
  93. package/build/commands/serve/serve.js.map +1 -1
  94. package/build/commands/serve/serveBackground.d.ts +4 -1
  95. package/build/commands/serve/serveBackground.d.ts.map +1 -1
  96. package/build/commands/serve/serveBackground.js +19 -5
  97. package/build/commands/serve/serveBackground.js.map +1 -1
  98. package/build/commands/serve/serveStatus.d.ts +2 -1
  99. package/build/commands/serve/serveStatus.d.ts.map +1 -1
  100. package/build/commands/serve/serveStatus.js +30 -12
  101. package/build/commands/serve/serveStatus.js.map +1 -1
  102. package/build/commands/serve/serveStop.d.ts +2 -1
  103. package/build/commands/serve/serveStop.d.ts.map +1 -1
  104. package/build/commands/serve/serveStop.js +113 -20
  105. package/build/commands/serve/serveStop.js.map +1 -1
  106. package/build/commands/shared/authProfileStore.d.ts.map +1 -1
  107. package/build/commands/shared/authProfileStore.js +54 -10
  108. package/build/commands/shared/authProfileStore.js.map +1 -1
  109. package/build/commands/shared/clientSurfaceAttachment.d.ts +3 -3
  110. package/build/commands/shared/clientSurfaceAttachment.d.ts.map +1 -1
  111. package/build/commands/shared/clientSurfaceAttachment.js +20 -8
  112. package/build/commands/shared/clientSurfaceAttachment.js.map +1 -1
  113. package/build/commands/shared/connectionHelper.d.ts +4 -4
  114. package/build/commands/shared/connectionHelper.d.ts.map +1 -1
  115. package/build/commands/shared/connectionHelper.js +9 -26
  116. package/build/commands/shared/connectionHelper.js.map +1 -1
  117. package/build/commands/shared/inspectApiSchemas.d.ts +21 -8
  118. package/build/commands/shared/inspectApiSchemas.d.ts.map +1 -1
  119. package/build/commands/shared/inspectApiSchemas.js +18 -0
  120. package/build/commands/shared/inspectApiSchemas.js.map +1 -1
  121. package/build/commands/shared/serveClient.d.ts +1 -69
  122. package/build/commands/shared/serveClient.d.ts.map +1 -1
  123. package/build/commands/shared/serveClient.js +1 -234
  124. package/build/commands/shared/serveClient.js.map +1 -1
  125. package/build/commands/shared/serveTargetResolver.d.ts +1 -1
  126. package/build/commands/shared/serveTargetResolver.js +1 -1
  127. package/build/commands/target/index.js +1 -1
  128. package/build/commands/wait/index.js +1 -1
  129. package/build/commands/wait/wait.d.ts +2 -2
  130. package/build/commands/wait/wait.js +4 -4
  131. package/build/config/configLoader.js +1 -1
  132. package/build/config/configManager.js +3 -3
  133. package/build/config/configManager.js.map +1 -1
  134. package/build/config/configuredServerTargets.js +1 -1
  135. package/build/config/envProcessor.d.ts.map +1 -1
  136. package/build/config/envProcessor.js +26 -1
  137. package/build/config/envProcessor.js.map +1 -1
  138. package/build/config/mcpConfigManager.js +3 -3
  139. package/build/constants/auth.d.ts +7 -0
  140. package/build/constants/auth.d.ts.map +1 -1
  141. package/build/constants/auth.js +6 -1
  142. package/build/constants/auth.js.map +1 -1
  143. package/build/constants/mcp.d.ts +2 -2
  144. package/build/constants/mcp.d.ts.map +1 -1
  145. package/build/constants/mcp.js +1 -1
  146. package/build/constants.d.ts +1 -1
  147. package/build/constants.js +1 -1
  148. package/build/core/capabilities/asyncLoadingOrchestrator.d.ts +4 -4
  149. package/build/core/capabilities/asyncLoadingOrchestrator.js +3 -3
  150. package/build/core/capabilities/capabilityAggregator.d.ts +18 -88
  151. package/build/core/capabilities/capabilityAggregator.d.ts.map +1 -1
  152. package/build/core/capabilities/capabilityAggregator.js +76 -270
  153. package/build/core/capabilities/capabilityAggregator.js.map +1 -1
  154. package/build/core/capabilities/capabilityCatalog.d.ts +5 -6
  155. package/build/core/capabilities/capabilityCatalog.d.ts.map +1 -1
  156. package/build/core/capabilities/capabilityCatalog.js +48 -18
  157. package/build/core/capabilities/capabilityCatalog.js.map +1 -1
  158. package/build/core/capabilities/capabilityManager.d.ts +10 -33
  159. package/build/core/capabilities/capabilityManager.d.ts.map +1 -1
  160. package/build/core/capabilities/capabilityManager.js +7 -6
  161. package/build/core/capabilities/capabilityManager.js.map +1 -1
  162. package/build/core/capabilities/capabilityNotificationFacts.js +1 -1
  163. package/build/core/capabilities/capabilityNotificationFacts.js.map +1 -1
  164. package/build/core/capabilities/capabilityPagination.d.ts +3 -1
  165. package/build/core/capabilities/capabilityPagination.d.ts.map +1 -1
  166. package/build/core/capabilities/capabilityPagination.js +59 -32
  167. package/build/core/capabilities/capabilityPagination.js.map +1 -1
  168. package/build/core/capabilities/catalogGeneration.d.ts +47 -0
  169. package/build/core/capabilities/catalogGeneration.d.ts.map +1 -0
  170. package/build/core/capabilities/catalogGeneration.js +145 -0
  171. package/build/core/capabilities/catalogGeneration.js.map +1 -0
  172. package/build/core/capabilities/configuredToolSnapshot.d.ts +2 -2
  173. package/build/core/capabilities/configuredToolSnapshot.d.ts.map +1 -1
  174. package/build/core/capabilities/configuredToolSnapshot.js +1 -1
  175. package/build/core/capabilities/configuredToolSnapshot.js.map +1 -1
  176. package/build/core/capabilities/inspectPagination.d.ts +16 -0
  177. package/build/core/capabilities/inspectPagination.d.ts.map +1 -0
  178. package/build/core/capabilities/inspectPagination.js +41 -0
  179. package/build/core/capabilities/inspectPagination.js.map +1 -0
  180. package/build/core/capabilities/internal/discoveryTools.d.ts +1 -7
  181. package/build/core/capabilities/internal/discoveryTools.d.ts.map +1 -1
  182. package/build/core/capabilities/internal/discoveryTools.js +7 -1
  183. package/build/core/capabilities/internal/discoveryTools.js.map +1 -1
  184. package/build/core/capabilities/internal/installationTools.d.ts +1 -7
  185. package/build/core/capabilities/internal/installationTools.d.ts.map +1 -1
  186. package/build/core/capabilities/internal/installationTools.js +7 -1
  187. package/build/core/capabilities/internal/installationTools.js.map +1 -1
  188. package/build/core/capabilities/internal/lazyTools.d.ts +1 -1
  189. package/build/core/capabilities/internal/lazyTools.d.ts.map +1 -1
  190. package/build/core/capabilities/internal/lazyTools.js.map +1 -1
  191. package/build/core/capabilities/internal/managementTools.d.ts +1 -7
  192. package/build/core/capabilities/internal/managementTools.d.ts.map +1 -1
  193. package/build/core/capabilities/internal/managementTools.js +7 -1
  194. package/build/core/capabilities/internal/managementTools.js.map +1 -1
  195. package/build/core/capabilities/internalCapabilitiesProvider.d.ts +3 -3
  196. package/build/core/capabilities/internalCapabilitiesProvider.d.ts.map +1 -1
  197. package/build/core/capabilities/internalCapabilitiesProvider.js +8 -8
  198. package/build/core/capabilities/internalCapabilitiesProvider.js.map +1 -1
  199. package/build/core/capabilities/lazyLoadingOrchestrator.d.ts +3 -3
  200. package/build/core/capabilities/lazyLoadingOrchestrator.d.ts.map +1 -1
  201. package/build/core/capabilities/lazyLoadingOrchestrator.js +21 -80
  202. package/build/core/capabilities/lazyLoadingOrchestrator.js.map +1 -1
  203. package/build/core/capabilities/metaToolProvider.d.ts +3 -3
  204. package/build/core/capabilities/metaToolProvider.d.ts.map +1 -1
  205. package/build/core/capabilities/metaToolProvider.js.map +1 -1
  206. package/build/core/capabilities/runtimeCapabilityCatalog.d.ts +48 -0
  207. package/build/core/capabilities/runtimeCapabilityCatalog.d.ts.map +1 -0
  208. package/build/core/capabilities/runtimeCapabilityCatalog.js +409 -0
  209. package/build/core/capabilities/runtimeCapabilityCatalog.js.map +1 -0
  210. package/build/core/capabilities/schemaCache.d.ts +1 -1
  211. package/build/core/capabilities/schemaCache.d.ts.map +1 -1
  212. package/build/core/capabilities/schemaCache.js.map +1 -1
  213. package/build/core/capabilities/schemas/metaToolSchemas.d.ts +3 -3
  214. package/build/core/capabilities/toolRegistry.d.ts +11 -1
  215. package/build/core/capabilities/toolRegistry.d.ts.map +1 -1
  216. package/build/core/capabilities/toolRegistry.js +51 -32
  217. package/build/core/capabilities/toolRegistry.js.map +1 -1
  218. package/build/core/client/clientFactory.d.ts +1 -6
  219. package/build/core/client/clientFactory.d.ts.map +1 -1
  220. package/build/core/client/clientFactory.js +1 -35
  221. package/build/core/client/clientFactory.js.map +1 -1
  222. package/build/core/client/clientManager.d.ts +1 -89
  223. package/build/core/client/clientManager.d.ts.map +1 -1
  224. package/build/core/client/clientManager.js +1 -728
  225. package/build/core/client/clientManager.js.map +1 -1
  226. package/build/core/client/connectedClient.d.ts +1 -6
  227. package/build/core/client/connectedClient.d.ts.map +1 -1
  228. package/build/core/client/connectionHandler.d.ts +1 -8
  229. package/build/core/client/connectionHandler.d.ts.map +1 -1
  230. package/build/core/client/connectionHandler.js +1 -96
  231. package/build/core/client/connectionHandler.js.map +1 -1
  232. package/build/core/client/legacyAdapterRequest.d.ts +6 -0
  233. package/build/core/client/legacyAdapterRequest.d.ts.map +1 -0
  234. package/build/core/client/legacyAdapterRequest.js +55 -0
  235. package/build/core/client/legacyAdapterRequest.js.map +1 -0
  236. package/build/core/client/oauthFlowHandler.d.ts +1 -9
  237. package/build/core/client/oauthFlowHandler.d.ts.map +1 -1
  238. package/build/core/client/oauthFlowHandler.js +1 -80
  239. package/build/core/client/oauthFlowHandler.js.map +1 -1
  240. package/build/core/client/postAuthOAuthRecovery.d.ts +3 -3
  241. package/build/core/client/postAuthOAuthRecovery.d.ts.map +1 -1
  242. package/build/core/client/postAuthOAuthRecovery.js +7 -19
  243. package/build/core/client/postAuthOAuthRecovery.js.map +1 -1
  244. package/build/core/client/recreateHttpTransportOptions.d.ts +1 -13
  245. package/build/core/client/recreateHttpTransportOptions.d.ts.map +1 -1
  246. package/build/core/client/renderableOutboundConnection.d.ts +5 -0
  247. package/build/core/client/renderableOutboundConnection.d.ts.map +1 -0
  248. package/build/core/client/renderableOutboundConnection.js +38 -0
  249. package/build/core/client/renderableOutboundConnection.js.map +1 -0
  250. package/build/core/client/transportRecreationState.d.ts +1 -10
  251. package/build/core/client/transportRecreationState.d.ts.map +1 -1
  252. package/build/core/client/transportRecreator.d.ts +1 -13
  253. package/build/core/client/transportRecreator.d.ts.map +1 -1
  254. package/build/core/client/transportRecreator.js +1 -51
  255. package/build/core/client/transportRecreator.js.map +1 -1
  256. package/build/core/client/types.d.ts +1 -6
  257. package/build/core/client/types.d.ts.map +1 -1
  258. package/build/core/client/types.js +1 -10
  259. package/build/core/client/types.js.map +1 -1
  260. package/build/core/configChangeHandler.d.ts.map +1 -1
  261. package/build/core/configChangeHandler.js +8 -11
  262. package/build/core/configChangeHandler.js.map +1 -1
  263. package/build/core/context/templateContextTrust.d.ts.map +1 -1
  264. package/build/core/context/templateContextTrust.js +22 -4
  265. package/build/core/context/templateContextTrust.js.map +1 -1
  266. package/build/core/filtering/clientFiltering.d.ts +2 -2
  267. package/build/core/filtering/clientFiltering.d.ts.map +1 -1
  268. package/build/core/filtering/clientFiltering.js +3 -3
  269. package/build/core/filtering/clientFiltering.js.map +1 -1
  270. package/build/core/filtering/filterCache.d.ts +1 -1
  271. package/build/core/filtering/filterSelection.d.ts +1 -1
  272. package/build/core/filtering/filteringService.d.ts +2 -2
  273. package/build/core/filtering/filteringService.d.ts.map +1 -1
  274. package/build/core/filtering/filteringService.js +4 -4
  275. package/build/core/filtering/filteringService.js.map +1 -1
  276. package/build/core/filtering/templateFilteringService.d.ts +2 -2
  277. package/build/core/filtering/templateIndex.d.ts +1 -1
  278. package/build/core/flags/flagManager.js +1 -1
  279. package/build/core/instructions/effectiveServerInstructions.d.ts +1 -1
  280. package/build/core/instructions/instructionAggregator.d.ts +3 -3
  281. package/build/core/instructions/instructionAggregator.js +1 -1
  282. package/build/core/loading/loadingStateTracker.d.ts.map +1 -1
  283. package/build/core/loading/loadingStateTracker.js +5 -1
  284. package/build/core/loading/loadingStateTracker.js.map +1 -1
  285. package/build/core/loading/mcpLoadingManager.d.ts +5 -2
  286. package/build/core/loading/mcpLoadingManager.d.ts.map +1 -1
  287. package/build/core/loading/mcpLoadingManager.js.map +1 -1
  288. package/build/core/notifications/notificationManager.d.ts +4 -3
  289. package/build/core/notifications/notificationManager.d.ts.map +1 -1
  290. package/build/core/notifications/notificationManager.js +15 -13
  291. package/build/core/notifications/notificationManager.js.map +1 -1
  292. package/build/core/protocol/notificationHandlers.d.ts +1 -13
  293. package/build/core/protocol/notificationHandlers.d.ts.map +1 -1
  294. package/build/core/protocol/notificationHandlers.js +1 -123
  295. package/build/core/protocol/notificationHandlers.js.map +1 -1
  296. package/build/core/protocol/promptRequestHandlers.d.ts +1 -3
  297. package/build/core/protocol/promptRequestHandlers.d.ts.map +1 -1
  298. package/build/core/protocol/promptRequestHandlers.js +1 -72
  299. package/build/core/protocol/promptRequestHandlers.js.map +1 -1
  300. package/build/core/protocol/requestHandlerUtils.d.ts +4 -4
  301. package/build/core/protocol/requestHandlerUtils.d.ts.map +1 -1
  302. package/build/core/protocol/requestHandlerUtils.js +13 -32
  303. package/build/core/protocol/requestHandlerUtils.js.map +1 -1
  304. package/build/core/protocol/requestHandlers.d.ts +1 -12
  305. package/build/core/protocol/requestHandlers.d.ts.map +1 -1
  306. package/build/core/protocol/requestHandlers.js +1 -92
  307. package/build/core/protocol/requestHandlers.js.map +1 -1
  308. package/build/core/protocol/resourceRequestHandlers.d.ts +1 -2
  309. package/build/core/protocol/resourceRequestHandlers.d.ts.map +1 -1
  310. package/build/core/protocol/resourceRequestHandlers.js +1 -95
  311. package/build/core/protocol/resourceRequestHandlers.js.map +1 -1
  312. package/build/core/protocol/toolRequestHandlers.d.ts +1 -3
  313. package/build/core/protocol/toolRequestHandlers.d.ts.map +1 -1
  314. package/build/core/protocol/toolRequestHandlers.js +1 -187
  315. package/build/core/protocol/toolRequestHandlers.js.map +1 -1
  316. package/build/core/server/adapters/ExternalServerAdapter.d.ts +2 -2
  317. package/build/core/server/adapters/ServerRegistry.d.ts +3 -3
  318. package/build/core/server/adapters/TemplateServerAdapter.d.ts +3 -3
  319. package/build/core/server/adapters/types.d.ts +3 -3
  320. package/build/core/server/adapters/types.js +1 -1
  321. package/build/core/server/agentConfig.d.ts +3 -3
  322. package/build/core/server/agentConfig.js +2 -2
  323. package/build/core/server/backendStdioSupervisor.d.ts.map +1 -1
  324. package/build/core/server/backendStdioSupervisor.js +8 -5
  325. package/build/core/server/backendStdioSupervisor.js.map +1 -1
  326. package/build/core/server/backgroundLaunchConfig.d.ts +1 -1
  327. package/build/core/server/backgroundLaunchConfig.js +1 -1
  328. package/build/core/server/backgroundRuntimeSupervisor.d.ts +2 -2
  329. package/build/core/server/backgroundRuntimeSupervisor.d.ts.map +1 -1
  330. package/build/core/server/backgroundRuntimeSupervisor.js +12 -4
  331. package/build/core/server/backgroundRuntimeSupervisor.js.map +1 -1
  332. package/build/core/server/backgroundRuntimeSupervisorState.d.ts +3 -0
  333. package/build/core/server/backgroundRuntimeSupervisorState.d.ts.map +1 -1
  334. package/build/core/server/backgroundRuntimeSupervisorState.js +3 -0
  335. package/build/core/server/backgroundRuntimeSupervisorState.js.map +1 -1
  336. package/build/core/server/clientInstanceFactory.d.ts +1 -13
  337. package/build/core/server/clientInstanceFactory.d.ts.map +1 -1
  338. package/build/core/server/clientInstanceFactory.js +1 -48
  339. package/build/core/server/clientInstanceFactory.js.map +1 -1
  340. package/build/core/server/clientInstancePool.d.ts +1 -115
  341. package/build/core/server/clientInstancePool.d.ts.map +1 -1
  342. package/build/core/server/clientInstancePool.js +1 -599
  343. package/build/core/server/clientInstancePool.js.map +1 -1
  344. package/build/core/server/clientInstancePoolTypes.d.ts +1 -66
  345. package/build/core/server/clientInstancePoolTypes.d.ts.map +1 -1
  346. package/build/core/server/clientInstancePoolTypes.js +1 -14
  347. package/build/core/server/clientInstancePoolTypes.js.map +1 -1
  348. package/build/core/server/connectionManager.d.ts +1 -79
  349. package/build/core/server/connectionManager.d.ts.map +1 -1
  350. package/build/core/server/connectionManager.js +1 -262
  351. package/build/core/server/connectionManager.js.map +1 -1
  352. package/build/core/server/connectionResolver.d.ts +1 -1
  353. package/build/core/server/disabledTools.d.ts +8 -2
  354. package/build/core/server/disabledTools.d.ts.map +1 -1
  355. package/build/core/server/disabledTools.js +13 -0
  356. package/build/core/server/disabledTools.js.map +1 -1
  357. package/build/core/server/mcpServerLifecycleManager.d.ts +1 -58
  358. package/build/core/server/mcpServerLifecycleManager.d.ts.map +1 -1
  359. package/build/core/server/mcpServerLifecycleManager.js +1 -271
  360. package/build/core/server/mcpServerLifecycleManager.js.map +1 -1
  361. package/build/core/server/pidFileManager.d.ts +6 -2
  362. package/build/core/server/pidFileManager.d.ts.map +1 -1
  363. package/build/core/server/pidFileManager.js +13 -4
  364. package/build/core/server/pidFileManager.js.map +1 -1
  365. package/build/core/server/processIdentity.d.ts +27 -0
  366. package/build/core/server/processIdentity.d.ts.map +1 -0
  367. package/build/core/server/processIdentity.js +101 -0
  368. package/build/core/server/processIdentity.js.map +1 -0
  369. package/build/core/server/requestContextPreparation.d.ts +1 -38
  370. package/build/core/server/requestContextPreparation.d.ts.map +1 -1
  371. package/build/core/server/requestContextPreparation.js +1 -49
  372. package/build/core/server/requestContextPreparation.js.map +1 -1
  373. package/build/core/server/runtimeFileLock.d.ts +6 -0
  374. package/build/core/server/runtimeFileLock.d.ts.map +1 -0
  375. package/build/core/server/runtimeFileLock.js +34 -0
  376. package/build/core/server/runtimeFileLock.js.map +1 -0
  377. package/build/core/server/runtimeLifecycle.d.ts +5 -5
  378. package/build/core/server/runtimeLifecycle.d.ts.map +1 -1
  379. package/build/core/server/runtimeLifecycle.js +16 -3
  380. package/build/core/server/runtimeLifecycle.js.map +1 -1
  381. package/build/core/server/runtimeScopeOwnership.d.ts +3 -0
  382. package/build/core/server/runtimeScopeOwnership.d.ts.map +1 -1
  383. package/build/core/server/runtimeScopeOwnership.js +95 -28
  384. package/build/core/server/runtimeScopeOwnership.js.map +1 -1
  385. package/build/core/server/serverManager.d.ts +1 -130
  386. package/build/core/server/serverManager.d.ts.map +1 -1
  387. package/build/core/server/serverManager.js +1 -457
  388. package/build/core/server/serverManager.js.map +1 -1
  389. package/build/core/server/templateConfigurationManager.d.ts +1 -1
  390. package/build/core/server/templateServerCleanup.d.ts +1 -22
  391. package/build/core/server/templateServerCleanup.d.ts.map +1 -1
  392. package/build/core/server/templateServerCleanup.js +1 -160
  393. package/build/core/server/templateServerCleanup.js.map +1 -1
  394. package/build/core/server/templateServerManager.d.ts +1 -154
  395. package/build/core/server/templateServerManager.d.ts.map +1 -1
  396. package/build/core/server/templateServerManager.js +1 -603
  397. package/build/core/server/templateServerManager.js.map +1 -1
  398. package/build/core/server/toolDescriptionOverrides.d.ts +6 -2
  399. package/build/core/server/toolDescriptionOverrides.d.ts.map +1 -1
  400. package/build/core/server/toolDescriptionOverrides.js +6 -0
  401. package/build/core/server/toolDescriptionOverrides.js.map +1 -1
  402. package/build/core/tools/handlers/serverManagementHandler.d.ts +32 -24
  403. package/build/core/tools/handlers/serverManagementHandler.d.ts.map +1 -1
  404. package/build/core/tools/handlers/serverManagementHandler.js +4 -4
  405. package/build/core/tools/handlers/serverManagementHandler.js.map +1 -1
  406. package/build/core/tools/internal/adapters/helpers/configTransformers.d.ts +3 -2
  407. package/build/core/tools/internal/adapters/helpers/configTransformers.d.ts.map +1 -1
  408. package/build/core/tools/internal/adapters/management/managementAdapter.d.ts +1 -1
  409. package/build/core/tools/internal/adapters/management/managementAdapter.js +2 -2
  410. package/build/core/tools/internal/adapters/management/toolHandlers.js +1 -1
  411. package/build/core/tools/internal/adapters/management/types.d.ts +18 -8
  412. package/build/core/tools/internal/adapters/management/types.d.ts.map +1 -1
  413. package/build/core/tools/internal/adapters/management/validation.d.ts +1 -1
  414. package/build/core/tools/internal/adapters/validation/configValidation.d.ts +1 -1
  415. package/build/core/tools/internal/discoveryHandlers.js +1 -1
  416. package/build/core/tools/internal/installationHandlers.js +2 -2
  417. package/build/core/tools/internal/managementHandlers.d.ts.map +1 -1
  418. package/build/core/tools/internal/managementHandlers.js +13 -4
  419. package/build/core/tools/internal/managementHandlers.js.map +1 -1
  420. package/build/core/tools/internal/schemas/discovery.d.ts +5 -5
  421. package/build/core/tools/internal/schemas/index.d.ts +14 -14
  422. package/build/core/tools/internal/schemas/installation.d.ts +1 -1
  423. package/build/core/tools/internal/schemas/management.d.ts +8 -8
  424. package/build/core/types/client.d.ts +30 -17
  425. package/build/core/types/client.d.ts.map +1 -1
  426. package/build/core/types/client.js.map +1 -1
  427. package/build/core/types/server.d.ts +18 -11
  428. package/build/core/types/server.d.ts.map +1 -1
  429. package/build/core/types/server.js.map +1 -1
  430. package/build/core/types/transport.d.ts +18 -19
  431. package/build/core/types/transport.d.ts.map +1 -1
  432. package/build/core/types/transport.js +4 -0
  433. package/build/core/types/transport.js.map +1 -1
  434. package/build/core/validation/CustomJsonSchemaValidator.d.ts +1 -62
  435. package/build/core/validation/CustomJsonSchemaValidator.d.ts.map +1 -1
  436. package/build/core/validation/CustomJsonSchemaValidator.js +1 -309
  437. package/build/core/validation/CustomJsonSchemaValidator.js.map +1 -1
  438. package/build/domains/admin/adminConfiguredServerService.d.ts +1 -1
  439. package/build/domains/admin/adminConfiguredServerService.d.ts.map +1 -1
  440. package/build/domains/admin/adminConfiguredServerService.js +12 -8
  441. package/build/domains/admin/adminConfiguredServerService.js.map +1 -1
  442. package/build/domains/admin/adminDomain.d.ts +2 -2
  443. package/build/domains/admin/adminDomain.js +1 -1
  444. package/build/domains/admin/adminInstructionPreviewRuntime.d.ts +1 -1
  445. package/build/domains/admin/adminInstructionPreviewRuntime.d.ts.map +1 -1
  446. package/build/domains/admin/adminInstructionPreviewRuntime.js +3 -10
  447. package/build/domains/admin/adminInstructionPreviewRuntime.js.map +1 -1
  448. package/build/domains/admin/adminInstructionTemplateService.d.ts +3 -3
  449. package/build/domains/admin/adminOAuthService.d.ts +1 -0
  450. package/build/domains/admin/adminOAuthService.d.ts.map +1 -1
  451. package/build/domains/admin/adminOAuthService.js +8 -2
  452. package/build/domains/admin/adminOAuthService.js.map +1 -1
  453. package/build/domains/admin/adminPresetService.d.ts +2 -2
  454. package/build/domains/admin/adminPresetService.js +2 -2
  455. package/build/domains/admin/configuredToolInventory.d.ts.map +1 -1
  456. package/build/domains/admin/configuredToolInventory.js +1 -1
  457. package/build/domains/admin/configuredToolInventory.js.map +1 -1
  458. package/build/domains/admin/runtimeConfiguredToolInspectionService.d.ts.map +1 -1
  459. package/build/domains/admin/runtimeConfiguredToolInspectionService.js +7 -13
  460. package/build/domains/admin/runtimeConfiguredToolInspectionService.js.map +1 -1
  461. package/build/domains/admin/runtimeServerManagerBackendRestartService.js +1 -1
  462. package/build/domains/admin/runtimeServerManagerBackendRestartService.js.map +1 -1
  463. package/build/domains/discovery/appDiscovery.js +2 -2
  464. package/build/domains/installation/metadata/defaultsProvider.d.ts +1 -1
  465. package/build/domains/installation/metadata/metadataExtractor.d.ts +1 -1
  466. package/build/domains/installation/serverInstallationSourceResolution.d.ts +1 -1
  467. package/build/domains/installation/serverInstallationTypes.d.ts +2 -2
  468. package/build/domains/installation/serverInstallationWorkflow.js +2 -2
  469. package/build/domains/instruction-template/instructionTemplateManager.d.ts +1 -1
  470. package/build/domains/instruction-template/instructionTemplateManager.js +1 -1
  471. package/build/domains/preset/manager/presetManager.d.ts +1 -1
  472. package/build/domains/preset/manager/presetManager.js +3 -3
  473. package/build/domains/preset/manager/presetManagerCleanup.d.ts +2 -2
  474. package/build/domains/preset/manager/presetStorage.d.ts +1 -1
  475. package/build/domains/preset/manager/presetTesting.d.ts +1 -1
  476. package/build/domains/preset/manager/presetTesting.js +2 -2
  477. package/build/domains/preset/manager/presetValidation.d.ts +1 -1
  478. package/build/domains/preset/manager/presetValidation.js +1 -1
  479. package/build/domains/preset/parsers/tagQueryEvaluator.d.ts +1 -1
  480. package/build/domains/preset/parsers/tagQueryParser.d.ts +1 -1
  481. package/build/domains/registry/formatters/commonFormatters.d.ts +1 -1
  482. package/build/domains/registry/formatters/serverDetailFormatter.d.ts +1 -1
  483. package/build/domains/registry/formatters/serverDetailFormatter.js +1 -1
  484. package/build/domains/registry/formatters/versionsFormatter.d.ts +1 -1
  485. package/build/domains/registry/searchFiltering.d.ts +1 -1
  486. package/build/domains/registry/searchFiltering.js +1 -1
  487. package/build/domains/server-management/types.d.ts +1 -1
  488. package/build/gateway/adapters/index.d.ts +3 -0
  489. package/build/gateway/adapters/index.d.ts.map +1 -0
  490. package/build/gateway/adapters/index.js +3 -0
  491. package/build/gateway/adapters/index.js.map +1 -0
  492. package/build/gateway/adapters/legacy/index.d.ts +3 -0
  493. package/build/gateway/adapters/legacy/index.d.ts.map +1 -0
  494. package/build/gateway/adapters/legacy/index.js +3 -0
  495. package/build/gateway/adapters/legacy/index.js.map +1 -0
  496. package/build/gateway/adapters/legacy/legacyEraPin.d.ts +3 -0
  497. package/build/gateway/adapters/legacy/legacyEraPin.d.ts.map +1 -0
  498. package/build/gateway/adapters/legacy/legacyEraPin.js +12 -0
  499. package/build/gateway/adapters/legacy/legacyEraPin.js.map +1 -0
  500. package/build/gateway/adapters/legacy/legacyInboundEraAdapter.d.ts +19 -0
  501. package/build/gateway/adapters/legacy/legacyInboundEraAdapter.d.ts.map +1 -0
  502. package/build/gateway/adapters/legacy/legacyInboundEraAdapter.js +86 -0
  503. package/build/gateway/adapters/legacy/legacyInboundEraAdapter.js.map +1 -0
  504. package/build/gateway/adapters/legacy/legacyOutboundEraAdapter.d.ts +19 -0
  505. package/build/gateway/adapters/legacy/legacyOutboundEraAdapter.d.ts.map +1 -0
  506. package/build/gateway/adapters/legacy/legacyOutboundEraAdapter.js +76 -0
  507. package/build/gateway/adapters/legacy/legacyOutboundEraAdapter.js.map +1 -0
  508. package/build/gateway/adapters/modern/index.d.ts +3 -0
  509. package/build/gateway/adapters/modern/index.d.ts.map +1 -0
  510. package/build/gateway/adapters/modern/index.js +3 -0
  511. package/build/gateway/adapters/modern/index.js.map +1 -0
  512. package/build/gateway/adapters/modern/modernInboundEraAdapter.d.ts +32 -0
  513. package/build/gateway/adapters/modern/modernInboundEraAdapter.d.ts.map +1 -0
  514. package/build/gateway/adapters/modern/modernInboundEraAdapter.js +150 -0
  515. package/build/gateway/adapters/modern/modernInboundEraAdapter.js.map +1 -0
  516. package/build/gateway/adapters/modern/modernOutboundEraAdapter.d.ts +24 -0
  517. package/build/gateway/adapters/modern/modernOutboundEraAdapter.d.ts.map +1 -0
  518. package/build/gateway/adapters/modern/modernOutboundEraAdapter.js +75 -0
  519. package/build/gateway/adapters/modern/modernOutboundEraAdapter.js.map +1 -0
  520. package/build/gateway/adapters/modern/modernPin.d.ts +9 -0
  521. package/build/gateway/adapters/modern/modernPin.d.ts.map +1 -0
  522. package/build/gateway/adapters/modern/modernPin.js +14 -0
  523. package/build/gateway/adapters/modern/modernPin.js.map +1 -0
  524. package/build/gateway/contracts/effectiveRequestAuthority.d.ts +12 -0
  525. package/build/gateway/contracts/effectiveRequestAuthority.d.ts.map +1 -0
  526. package/build/gateway/contracts/effectiveRequestAuthority.js +30 -0
  527. package/build/gateway/contracts/effectiveRequestAuthority.js.map +1 -0
  528. package/build/gateway/contracts/gatewayFailure.d.ts +25 -0
  529. package/build/gateway/contracts/gatewayFailure.d.ts.map +1 -0
  530. package/build/gateway/contracts/gatewayFailure.js +72 -0
  531. package/build/gateway/contracts/gatewayFailure.js.map +1 -0
  532. package/build/gateway/contracts/gatewayRequest.d.ts +32 -0
  533. package/build/gateway/contracts/gatewayRequest.d.ts.map +1 -0
  534. package/build/gateway/contracts/gatewayRequest.js +50 -0
  535. package/build/gateway/contracts/gatewayRequest.js.map +1 -0
  536. package/build/gateway/contracts/immutableJson.d.ts +6 -0
  537. package/build/gateway/contracts/immutableJson.d.ts.map +1 -0
  538. package/build/gateway/contracts/immutableJson.js +14 -0
  539. package/build/gateway/contracts/immutableJson.js.map +1 -0
  540. package/build/gateway/contracts/index.d.ts +6 -0
  541. package/build/gateway/contracts/index.d.ts.map +1 -0
  542. package/build/gateway/contracts/index.js +6 -0
  543. package/build/gateway/contracts/index.js.map +1 -0
  544. package/build/gateway/contracts/protocolEra.d.ts +22 -0
  545. package/build/gateway/contracts/protocolEra.d.ts.map +1 -0
  546. package/build/gateway/contracts/protocolEra.js +68 -0
  547. package/build/gateway/contracts/protocolEra.js.map +1 -0
  548. package/build/gateway/core/gatewayDispatcher.d.ts +15 -0
  549. package/build/gateway/core/gatewayDispatcher.d.ts.map +1 -0
  550. package/build/gateway/core/gatewayDispatcher.js +77 -0
  551. package/build/gateway/core/gatewayDispatcher.js.map +1 -0
  552. package/build/gateway/core/gatewaySession.d.ts +13 -0
  553. package/build/gateway/core/gatewaySession.d.ts.map +1 -0
  554. package/build/gateway/core/gatewaySession.js +61 -0
  555. package/build/gateway/core/gatewaySession.js.map +1 -0
  556. package/build/gateway/core/index.d.ts +3 -0
  557. package/build/gateway/core/index.d.ts.map +1 -0
  558. package/build/gateway/core/index.js +3 -0
  559. package/build/gateway/core/index.js.map +1 -0
  560. package/build/gateway/index.d.ts +5 -0
  561. package/build/gateway/index.d.ts.map +1 -0
  562. package/build/gateway/index.js +5 -0
  563. package/build/gateway/index.js.map +1 -0
  564. package/build/gateway/ports/inboundEraAdapter.d.ts +27 -0
  565. package/build/gateway/ports/inboundEraAdapter.d.ts.map +1 -0
  566. package/build/gateway/ports/inboundEraAdapter.js +2 -0
  567. package/build/gateway/ports/inboundEraAdapter.js.map +1 -0
  568. package/build/gateway/ports/index.d.ts +3 -0
  569. package/build/gateway/ports/index.d.ts.map +1 -0
  570. package/build/gateway/ports/index.js +3 -0
  571. package/build/gateway/ports/index.js.map +1 -0
  572. package/build/gateway/ports/outboundEraAdapter.d.ts +16 -0
  573. package/build/gateway/ports/outboundEraAdapter.d.ts.map +1 -0
  574. package/build/gateway/ports/outboundEraAdapter.js +2 -0
  575. package/build/gateway/ports/outboundEraAdapter.js.map +1 -0
  576. package/build/logger/configureGlobalLogger.js +1 -1
  577. package/build/logger/mcpLoggingEnhancer.d.ts +1 -5
  578. package/build/logger/mcpLoggingEnhancer.d.ts.map +1 -1
  579. package/build/logger/mcpLoggingEnhancer.js +1 -192
  580. package/build/logger/mcpLoggingEnhancer.js.map +1 -1
  581. package/build/sdk/contracts/index.d.ts +5 -0
  582. package/build/sdk/contracts/index.d.ts.map +1 -0
  583. package/build/sdk/contracts/index.js +5 -0
  584. package/build/sdk/contracts/index.js.map +1 -0
  585. package/build/sdk/contracts/jsonValue.d.ts +21 -0
  586. package/build/sdk/contracts/jsonValue.d.ts.map +1 -0
  587. package/build/sdk/contracts/jsonValue.js +127 -0
  588. package/build/sdk/contracts/jsonValue.js.map +1 -0
  589. package/build/sdk/contracts/legacySdkAdapter.d.ts +73 -0
  590. package/build/sdk/contracts/legacySdkAdapter.d.ts.map +1 -0
  591. package/build/sdk/contracts/legacySdkAdapter.js +7 -0
  592. package/build/sdk/contracts/legacySdkAdapter.js.map +1 -0
  593. package/build/sdk/contracts/oneMcpProtocolError.d.ts +18 -0
  594. package/build/sdk/contracts/oneMcpProtocolError.d.ts.map +1 -0
  595. package/build/sdk/contracts/oneMcpProtocolError.js +39 -0
  596. package/build/sdk/contracts/oneMcpProtocolError.js.map +1 -0
  597. package/build/sdk/contracts/protocol.d.ts +240 -0
  598. package/build/sdk/contracts/protocol.d.ts.map +1 -0
  599. package/build/sdk/contracts/protocol.js +187 -0
  600. package/build/sdk/contracts/protocol.js.map +1 -0
  601. package/build/sdk/legacy/auth/sdkOAuthClientProvider.d.ts +98 -0
  602. package/build/sdk/legacy/auth/sdkOAuthClientProvider.d.ts.map +1 -0
  603. package/build/sdk/legacy/auth/sdkOAuthClientProvider.js +243 -0
  604. package/build/sdk/legacy/auth/sdkOAuthClientProvider.js.map +1 -0
  605. package/build/sdk/legacy/auth/sdkOAuthServerProvider.d.ts +69 -0
  606. package/build/sdk/legacy/auth/sdkOAuthServerProvider.d.ts.map +1 -0
  607. package/build/sdk/legacy/auth/sdkOAuthServerProvider.js +519 -0
  608. package/build/sdk/legacy/auth/sdkOAuthServerProvider.js.map +1 -0
  609. package/build/sdk/legacy/client/auth.d.ts +2 -0
  610. package/build/sdk/legacy/client/auth.d.ts.map +1 -0
  611. package/build/sdk/legacy/client/auth.js +2 -0
  612. package/build/sdk/legacy/client/auth.js.map +1 -0
  613. package/build/sdk/legacy/client/index.d.ts +2 -0
  614. package/build/sdk/legacy/client/index.d.ts.map +1 -0
  615. package/build/sdk/legacy/client/index.js +2 -0
  616. package/build/sdk/legacy/client/index.js.map +1 -0
  617. package/build/sdk/legacy/client/runtime/clientFactory.d.ts +10 -0
  618. package/build/sdk/legacy/client/runtime/clientFactory.d.ts.map +1 -0
  619. package/build/sdk/legacy/client/runtime/clientFactory.js +56 -0
  620. package/build/sdk/legacy/client/runtime/clientFactory.js.map +1 -0
  621. package/build/sdk/legacy/client/runtime/clientManager.d.ts +94 -0
  622. package/build/sdk/legacy/client/runtime/clientManager.d.ts.map +1 -0
  623. package/build/sdk/legacy/client/runtime/clientManager.js +834 -0
  624. package/build/sdk/legacy/client/runtime/clientManager.js.map +1 -0
  625. package/build/sdk/legacy/client/runtime/connectedClient.d.ts +7 -0
  626. package/build/sdk/legacy/client/runtime/connectedClient.d.ts.map +1 -0
  627. package/build/sdk/legacy/client/runtime/connectedClient.js +2 -0
  628. package/build/sdk/legacy/client/runtime/connectedClient.js.map +1 -0
  629. package/build/sdk/legacy/client/runtime/connectionHandler.d.ts +10 -0
  630. package/build/sdk/legacy/client/runtime/connectionHandler.d.ts.map +1 -0
  631. package/build/sdk/legacy/client/runtime/connectionHandler.js +139 -0
  632. package/build/sdk/legacy/client/runtime/connectionHandler.js.map +1 -0
  633. package/build/sdk/legacy/client/runtime/legacyGatewayClientAdapter.d.ts +14 -0
  634. package/build/sdk/legacy/client/runtime/legacyGatewayClientAdapter.d.ts.map +1 -0
  635. package/build/sdk/legacy/client/runtime/legacyGatewayClientAdapter.js +66 -0
  636. package/build/sdk/legacy/client/runtime/legacyGatewayClientAdapter.js.map +1 -0
  637. package/build/sdk/legacy/client/runtime/legacyOutboundConnection.d.ts +50 -0
  638. package/build/sdk/legacy/client/runtime/legacyOutboundConnection.d.ts.map +1 -0
  639. package/build/sdk/legacy/client/runtime/legacyOutboundConnection.js +93 -0
  640. package/build/sdk/legacy/client/runtime/legacyOutboundConnection.js.map +1 -0
  641. package/build/sdk/legacy/client/runtime/legacySdkClientAdapter.d.ts +37 -0
  642. package/build/sdk/legacy/client/runtime/legacySdkClientAdapter.d.ts.map +1 -0
  643. package/build/sdk/legacy/client/runtime/legacySdkClientAdapter.js +240 -0
  644. package/build/sdk/legacy/client/runtime/legacySdkClientAdapter.js.map +1 -0
  645. package/build/sdk/legacy/client/runtime/legacyTransport.d.ts +32 -0
  646. package/build/sdk/legacy/client/runtime/legacyTransport.d.ts.map +1 -0
  647. package/build/sdk/legacy/client/runtime/legacyTransport.js +2 -0
  648. package/build/sdk/legacy/client/runtime/legacyTransport.js.map +1 -0
  649. package/build/sdk/legacy/client/runtime/modernSdkClientAdapter.d.ts +40 -0
  650. package/build/sdk/legacy/client/runtime/modernSdkClientAdapter.d.ts.map +1 -0
  651. package/build/sdk/legacy/client/runtime/modernSdkClientAdapter.js +238 -0
  652. package/build/sdk/legacy/client/runtime/modernSdkClientAdapter.js.map +1 -0
  653. package/build/sdk/legacy/client/runtime/oauthFlowHandler.d.ts +12 -0
  654. package/build/sdk/legacy/client/runtime/oauthFlowHandler.d.ts.map +1 -0
  655. package/build/sdk/legacy/client/runtime/oauthFlowHandler.js +93 -0
  656. package/build/sdk/legacy/client/runtime/oauthFlowHandler.js.map +1 -0
  657. package/build/sdk/legacy/client/runtime/outboundRequestParams.d.ts +4 -0
  658. package/build/sdk/legacy/client/runtime/outboundRequestParams.d.ts.map +1 -0
  659. package/build/sdk/legacy/client/runtime/outboundRequestParams.js +8 -0
  660. package/build/sdk/legacy/client/runtime/outboundRequestParams.js.map +1 -0
  661. package/build/sdk/legacy/client/runtime/recreateHttpTransportOptions.d.ts +12 -0
  662. package/build/sdk/legacy/client/runtime/recreateHttpTransportOptions.d.ts.map +1 -0
  663. package/build/sdk/legacy/client/runtime/recreateHttpTransportOptions.js +2 -0
  664. package/build/sdk/legacy/client/runtime/recreateHttpTransportOptions.js.map +1 -0
  665. package/build/sdk/legacy/client/runtime/sdkClient.d.ts +5 -0
  666. package/build/sdk/legacy/client/runtime/sdkClient.d.ts.map +1 -0
  667. package/build/sdk/legacy/client/runtime/sdkClient.js +5 -0
  668. package/build/sdk/legacy/client/runtime/sdkClient.js.map +1 -0
  669. package/build/sdk/legacy/client/runtime/serveClient.d.ts +70 -0
  670. package/build/sdk/legacy/client/runtime/serveClient.d.ts.map +1 -0
  671. package/build/sdk/legacy/client/runtime/serveClient.js +235 -0
  672. package/build/sdk/legacy/client/runtime/serveClient.js.map +1 -0
  673. package/build/sdk/legacy/client/runtime/transportRecreationState.d.ts +14 -0
  674. package/build/sdk/legacy/client/runtime/transportRecreationState.d.ts.map +1 -0
  675. package/build/sdk/legacy/client/runtime/transportRecreationState.js +2 -0
  676. package/build/sdk/legacy/client/runtime/transportRecreationState.js.map +1 -0
  677. package/build/sdk/legacy/client/runtime/transportRecreator.d.ts +14 -0
  678. package/build/sdk/legacy/client/runtime/transportRecreator.d.ts.map +1 -0
  679. package/build/sdk/legacy/client/runtime/transportRecreator.js +89 -0
  680. package/build/sdk/legacy/client/runtime/transportRecreator.js.map +1 -0
  681. package/build/sdk/legacy/client/runtime/types.d.ts +9 -0
  682. package/build/sdk/legacy/client/runtime/types.d.ts.map +1 -0
  683. package/build/sdk/legacy/client/runtime/types.js +13 -0
  684. package/build/sdk/legacy/client/runtime/types.js.map +1 -0
  685. package/build/sdk/legacy/client/sse.d.ts +2 -0
  686. package/build/sdk/legacy/client/sse.d.ts.map +1 -0
  687. package/build/sdk/legacy/client/sse.js +2 -0
  688. package/build/sdk/legacy/client/sse.js.map +1 -0
  689. package/build/sdk/legacy/client/stdio.d.ts +2 -0
  690. package/build/sdk/legacy/client/stdio.d.ts.map +1 -0
  691. package/build/sdk/legacy/client/stdio.js +2 -0
  692. package/build/sdk/legacy/client/stdio.js.map +1 -0
  693. package/build/sdk/legacy/client/streamableHttp.d.ts +2 -0
  694. package/build/sdk/legacy/client/streamableHttp.d.ts.map +1 -0
  695. package/build/sdk/legacy/client/streamableHttp.js +2 -0
  696. package/build/sdk/legacy/client/streamableHttp.js.map +1 -0
  697. package/build/sdk/legacy/commands/serve.d.ts +90 -0
  698. package/build/sdk/legacy/commands/serve.d.ts.map +1 -0
  699. package/build/sdk/legacy/commands/serve.js +561 -0
  700. package/build/sdk/legacy/commands/serve.js.map +1 -0
  701. package/build/sdk/legacy/server/auth/clients.d.ts +2 -0
  702. package/build/sdk/legacy/server/auth/clients.d.ts.map +1 -0
  703. package/build/sdk/legacy/server/auth/clients.js +2 -0
  704. package/build/sdk/legacy/server/auth/clients.js.map +1 -0
  705. package/build/sdk/legacy/server/auth/errors.d.ts +2 -0
  706. package/build/sdk/legacy/server/auth/errors.d.ts.map +1 -0
  707. package/build/sdk/legacy/server/auth/errors.js +2 -0
  708. package/build/sdk/legacy/server/auth/errors.js.map +1 -0
  709. package/build/sdk/legacy/server/auth/middleware/bearerAuth.d.ts +2 -0
  710. package/build/sdk/legacy/server/auth/middleware/bearerAuth.d.ts.map +1 -0
  711. package/build/sdk/legacy/server/auth/middleware/bearerAuth.js +2 -0
  712. package/build/sdk/legacy/server/auth/middleware/bearerAuth.js.map +1 -0
  713. package/build/sdk/legacy/server/auth/provider.d.ts +2 -0
  714. package/build/sdk/legacy/server/auth/provider.d.ts.map +1 -0
  715. package/build/sdk/legacy/server/auth/provider.js +2 -0
  716. package/build/sdk/legacy/server/auth/provider.js.map +1 -0
  717. package/build/sdk/legacy/server/auth/router.d.ts +2 -0
  718. package/build/sdk/legacy/server/auth/router.d.ts.map +1 -0
  719. package/build/sdk/legacy/server/auth/router.js +2 -0
  720. package/build/sdk/legacy/server/auth/router.js.map +1 -0
  721. package/build/sdk/legacy/server/auth/types.d.ts +2 -0
  722. package/build/sdk/legacy/server/auth/types.d.ts.map +1 -0
  723. package/build/sdk/legacy/server/auth/types.js +2 -0
  724. package/build/sdk/legacy/server/auth/types.js.map +1 -0
  725. package/build/sdk/legacy/server/index.d.ts +2 -0
  726. package/build/sdk/legacy/server/index.d.ts.map +1 -0
  727. package/build/sdk/legacy/server/index.js +2 -0
  728. package/build/sdk/legacy/server/index.js.map +1 -0
  729. package/build/sdk/legacy/server/protocol/notificationHandlers.d.ts +15 -0
  730. package/build/sdk/legacy/server/protocol/notificationHandlers.d.ts.map +1 -0
  731. package/build/sdk/legacy/server/protocol/notificationHandlers.js +146 -0
  732. package/build/sdk/legacy/server/protocol/notificationHandlers.js.map +1 -0
  733. package/build/sdk/legacy/server/protocol/promptRequestHandlers.d.ts +5 -0
  734. package/build/sdk/legacy/server/protocol/promptRequestHandlers.d.ts.map +1 -0
  735. package/build/sdk/legacy/server/protocol/promptRequestHandlers.js +50 -0
  736. package/build/sdk/legacy/server/protocol/promptRequestHandlers.js.map +1 -0
  737. package/build/sdk/legacy/server/protocol/requestHandlers.d.ts +14 -0
  738. package/build/sdk/legacy/server/protocol/requestHandlers.d.ts.map +1 -0
  739. package/build/sdk/legacy/server/protocol/requestHandlers.js +96 -0
  740. package/build/sdk/legacy/server/protocol/requestHandlers.js.map +1 -0
  741. package/build/sdk/legacy/server/protocol/resourceRequestHandlers.d.ts +4 -0
  742. package/build/sdk/legacy/server/protocol/resourceRequestHandlers.d.ts.map +1 -0
  743. package/build/sdk/legacy/server/protocol/resourceRequestHandlers.js +62 -0
  744. package/build/sdk/legacy/server/protocol/resourceRequestHandlers.js.map +1 -0
  745. package/build/sdk/legacy/server/protocol/toolRequestHandlers.d.ts +5 -0
  746. package/build/sdk/legacy/server/protocol/toolRequestHandlers.d.ts.map +1 -0
  747. package/build/sdk/legacy/server/protocol/toolRequestHandlers.js +87 -0
  748. package/build/sdk/legacy/server/protocol/toolRequestHandlers.js.map +1 -0
  749. package/build/sdk/legacy/server/runtime/clientInstanceFactory.d.ts +14 -0
  750. package/build/sdk/legacy/server/runtime/clientInstanceFactory.d.ts.map +1 -0
  751. package/build/sdk/legacy/server/runtime/clientInstanceFactory.js +49 -0
  752. package/build/sdk/legacy/server/runtime/clientInstanceFactory.js.map +1 -0
  753. package/build/sdk/legacy/server/runtime/clientInstancePool.d.ts +116 -0
  754. package/build/sdk/legacy/server/runtime/clientInstancePool.d.ts.map +1 -0
  755. package/build/sdk/legacy/server/runtime/clientInstancePool.js +600 -0
  756. package/build/sdk/legacy/server/runtime/clientInstancePool.js.map +1 -0
  757. package/build/sdk/legacy/server/runtime/clientInstancePoolTypes.d.ts +67 -0
  758. package/build/sdk/legacy/server/runtime/clientInstancePoolTypes.d.ts.map +1 -0
  759. package/build/sdk/legacy/server/runtime/clientInstancePoolTypes.js +15 -0
  760. package/build/sdk/legacy/server/runtime/clientInstancePoolTypes.js.map +1 -0
  761. package/build/sdk/legacy/server/runtime/connectionManager.d.ts +82 -0
  762. package/build/sdk/legacy/server/runtime/connectionManager.d.ts.map +1 -0
  763. package/build/sdk/legacy/server/runtime/connectionManager.js +298 -0
  764. package/build/sdk/legacy/server/runtime/connectionManager.js.map +1 -0
  765. package/build/sdk/legacy/server/runtime/legacyInboundConnection.d.ts +17 -0
  766. package/build/sdk/legacy/server/runtime/legacyInboundConnection.d.ts.map +1 -0
  767. package/build/sdk/legacy/server/runtime/legacyInboundConnection.js +22 -0
  768. package/build/sdk/legacy/server/runtime/legacyInboundConnection.js.map +1 -0
  769. package/build/sdk/legacy/server/runtime/legacySdkServerAdapter.d.ts +18 -0
  770. package/build/sdk/legacy/server/runtime/legacySdkServerAdapter.d.ts.map +1 -0
  771. package/build/sdk/legacy/server/runtime/legacySdkServerAdapter.js +82 -0
  772. package/build/sdk/legacy/server/runtime/legacySdkServerAdapter.js.map +1 -0
  773. package/build/sdk/legacy/server/runtime/mcpLoggingEnhancer.d.ts +6 -0
  774. package/build/sdk/legacy/server/runtime/mcpLoggingEnhancer.d.ts.map +1 -0
  775. package/build/sdk/legacy/server/runtime/mcpLoggingEnhancer.js +193 -0
  776. package/build/sdk/legacy/server/runtime/mcpLoggingEnhancer.js.map +1 -0
  777. package/build/sdk/legacy/server/runtime/mcpServerLifecycleManager.d.ts +60 -0
  778. package/build/sdk/legacy/server/runtime/mcpServerLifecycleManager.d.ts.map +1 -0
  779. package/build/sdk/legacy/server/runtime/mcpServerLifecycleManager.js +274 -0
  780. package/build/sdk/legacy/server/runtime/mcpServerLifecycleManager.js.map +1 -0
  781. package/build/sdk/legacy/server/runtime/requestContextPreparation.d.ts +39 -0
  782. package/build/sdk/legacy/server/runtime/requestContextPreparation.d.ts.map +1 -0
  783. package/build/sdk/legacy/server/runtime/requestContextPreparation.js +50 -0
  784. package/build/sdk/legacy/server/runtime/requestContextPreparation.js.map +1 -0
  785. package/build/sdk/legacy/server/runtime/serverManager.d.ts +132 -0
  786. package/build/sdk/legacy/server/runtime/serverManager.d.ts.map +1 -0
  787. package/build/sdk/legacy/server/runtime/serverManager.js +462 -0
  788. package/build/sdk/legacy/server/runtime/serverManager.js.map +1 -0
  789. package/build/sdk/legacy/server/runtime/templateServerCleanup.d.ts +23 -0
  790. package/build/sdk/legacy/server/runtime/templateServerCleanup.d.ts.map +1 -0
  791. package/build/sdk/legacy/server/runtime/templateServerCleanup.js +161 -0
  792. package/build/sdk/legacy/server/runtime/templateServerCleanup.js.map +1 -0
  793. package/build/sdk/legacy/server/runtime/templateServerManager.d.ts +155 -0
  794. package/build/sdk/legacy/server/runtime/templateServerManager.d.ts.map +1 -0
  795. package/build/sdk/legacy/server/runtime/templateServerManager.js +606 -0
  796. package/build/sdk/legacy/server/runtime/templateServerManager.js.map +1 -0
  797. package/build/sdk/legacy/server/sse.d.ts +2 -0
  798. package/build/sdk/legacy/server/sse.d.ts.map +1 -0
  799. package/build/sdk/legacy/server/sse.js +2 -0
  800. package/build/sdk/legacy/server/sse.js.map +1 -0
  801. package/build/sdk/legacy/server/stdio.d.ts +2 -0
  802. package/build/sdk/legacy/server/stdio.d.ts.map +1 -0
  803. package/build/sdk/legacy/server/stdio.js +2 -0
  804. package/build/sdk/legacy/server/stdio.js.map +1 -0
  805. package/build/sdk/legacy/server/streamableHttp.d.ts +2 -0
  806. package/build/sdk/legacy/server/streamableHttp.d.ts.map +1 -0
  807. package/build/sdk/legacy/server/streamableHttp.js +2 -0
  808. package/build/sdk/legacy/server/streamableHttp.js.map +1 -0
  809. package/build/sdk/legacy/shared/auth.d.ts +2 -0
  810. package/build/sdk/legacy/shared/auth.d.ts.map +1 -0
  811. package/build/sdk/legacy/shared/auth.js +2 -0
  812. package/build/sdk/legacy/shared/auth.js.map +1 -0
  813. package/build/sdk/legacy/shared/capabilityListCapture.d.ts +4 -0
  814. package/build/sdk/legacy/shared/capabilityListCapture.d.ts.map +1 -0
  815. package/build/sdk/legacy/shared/capabilityListCapture.js +30 -0
  816. package/build/sdk/legacy/shared/capabilityListCapture.js.map +1 -0
  817. package/build/sdk/legacy/shared/protocol.d.ts +2 -0
  818. package/build/sdk/legacy/shared/protocol.d.ts.map +1 -0
  819. package/build/sdk/legacy/shared/protocol.js +2 -0
  820. package/build/sdk/legacy/shared/protocol.js.map +1 -0
  821. package/build/sdk/legacy/shared/resourceTemplateRouting.d.ts +12 -0
  822. package/build/sdk/legacy/shared/resourceTemplateRouting.d.ts.map +1 -0
  823. package/build/sdk/legacy/shared/resourceTemplateRouting.js +66 -0
  824. package/build/sdk/legacy/shared/resourceTemplateRouting.js.map +1 -0
  825. package/build/sdk/legacy/shared/transport.d.ts +2 -0
  826. package/build/sdk/legacy/shared/transport.d.ts.map +1 -0
  827. package/build/sdk/legacy/shared/transport.js +2 -0
  828. package/build/sdk/legacy/shared/transport.js.map +1 -0
  829. package/build/sdk/legacy/transport/http/loggingSseTransport.d.ts +13 -0
  830. package/build/sdk/legacy/transport/http/loggingSseTransport.d.ts.map +1 -0
  831. package/build/sdk/legacy/transport/http/loggingSseTransport.js +43 -0
  832. package/build/sdk/legacy/transport/http/loggingSseTransport.js.map +1 -0
  833. package/build/sdk/legacy/transport/http/middlewares/scopeAuthMiddleware.d.ts +91 -0
  834. package/build/sdk/legacy/transport/http/middlewares/scopeAuthMiddleware.d.ts.map +1 -0
  835. package/build/sdk/legacy/transport/http/middlewares/scopeAuthMiddleware.js +240 -0
  836. package/build/sdk/legacy/transport/http/middlewares/scopeAuthMiddleware.js.map +1 -0
  837. package/build/sdk/legacy/transport/http/modernInboundLegacyBridge.d.ts +14 -0
  838. package/build/sdk/legacy/transport/http/modernInboundLegacyBridge.d.ts.map +1 -0
  839. package/build/sdk/legacy/transport/http/modernInboundLegacyBridge.js +50 -0
  840. package/build/sdk/legacy/transport/http/modernInboundLegacyBridge.js.map +1 -0
  841. package/build/sdk/legacy/transport/http/restorableStreamableTransport.d.ts +58 -0
  842. package/build/sdk/legacy/transport/http/restorableStreamableTransport.d.ts.map +1 -0
  843. package/build/sdk/legacy/transport/http/restorableStreamableTransport.js +59 -0
  844. package/build/sdk/legacy/transport/http/restorableStreamableTransport.js.map +1 -0
  845. package/build/sdk/legacy/transport/http/routes/sseRoutes.d.ts +5 -0
  846. package/build/sdk/legacy/transport/http/routes/sseRoutes.d.ts.map +1 -0
  847. package/build/sdk/legacy/transport/http/routes/sseRoutes.js +105 -0
  848. package/build/sdk/legacy/transport/http/routes/sseRoutes.js.map +1 -0
  849. package/build/sdk/legacy/transport/http/server.d.ts +90 -0
  850. package/build/sdk/legacy/transport/http/server.d.ts.map +1 -0
  851. package/build/sdk/legacy/transport/http/server.js +487 -0
  852. package/build/sdk/legacy/transport/http/server.js.map +1 -0
  853. package/build/sdk/legacy/transport/http/streamableSessionLifecycle.d.ts +92 -0
  854. package/build/sdk/legacy/transport/http/streamableSessionLifecycle.d.ts.map +1 -0
  855. package/build/sdk/legacy/transport/http/streamableSessionLifecycle.js +372 -0
  856. package/build/sdk/legacy/transport/http/streamableSessionLifecycle.js.map +1 -0
  857. package/build/sdk/legacy/transport/restartableStdioTransport.d.ts +90 -0
  858. package/build/sdk/legacy/transport/restartableStdioTransport.d.ts.map +1 -0
  859. package/build/sdk/legacy/transport/restartableStdioTransport.js +192 -0
  860. package/build/sdk/legacy/transport/restartableStdioTransport.js.map +1 -0
  861. package/build/sdk/legacy/transport/stdioProxyTransport.d.ts +92 -0
  862. package/build/sdk/legacy/transport/stdioProxyTransport.d.ts.map +1 -0
  863. package/build/sdk/legacy/transport/stdioProxyTransport.js +388 -0
  864. package/build/sdk/legacy/transport/stdioProxyTransport.js.map +1 -0
  865. package/build/sdk/legacy/transport/transportFactory.d.ts +25 -0
  866. package/build/sdk/legacy/transport/transportFactory.d.ts.map +1 -0
  867. package/build/sdk/legacy/transport/transportFactory.js +404 -0
  868. package/build/sdk/legacy/transport/transportFactory.js.map +1 -0
  869. package/build/sdk/legacy/types.d.ts +2 -0
  870. package/build/sdk/legacy/types.d.ts.map +1 -0
  871. package/build/sdk/legacy/types.js +3 -0
  872. package/build/sdk/legacy/types.js.map +1 -0
  873. package/build/sdk/legacy/validation/CustomJsonSchemaValidator.d.ts +57 -0
  874. package/build/sdk/legacy/validation/CustomJsonSchemaValidator.d.ts.map +1 -0
  875. package/build/sdk/legacy/validation/CustomJsonSchemaValidator.js +316 -0
  876. package/build/sdk/legacy/validation/CustomJsonSchemaValidator.js.map +1 -0
  877. package/build/sdk/legacy/validation.d.ts +2 -0
  878. package/build/sdk/legacy/validation.d.ts.map +1 -0
  879. package/build/sdk/legacy/validation.js +2 -0
  880. package/build/sdk/legacy/validation.js.map +1 -0
  881. package/build/server.d.ts.map +1 -1
  882. package/build/server.js +12 -3
  883. package/build/server.js.map +1 -1
  884. package/build/transport/http/loggingSseTransport.d.ts +1 -12
  885. package/build/transport/http/loggingSseTransport.d.ts.map +1 -1
  886. package/build/transport/http/loggingSseTransport.js +1 -42
  887. package/build/transport/http/loggingSseTransport.js.map +1 -1
  888. package/build/transport/http/middlewares/errorHandler.d.ts.map +1 -1
  889. package/build/transport/http/middlewares/errorHandler.js +18 -1
  890. package/build/transport/http/middlewares/errorHandler.js.map +1 -1
  891. package/build/transport/http/middlewares/httpRequestLogger.js +1 -1
  892. package/build/transport/http/middlewares/scopeAuthMiddleware.d.ts +2 -90
  893. package/build/transport/http/middlewares/scopeAuthMiddleware.d.ts.map +1 -1
  894. package/build/transport/http/middlewares/scopeAuthMiddleware.js +2 -239
  895. package/build/transport/http/middlewares/scopeAuthMiddleware.js.map +1 -1
  896. package/build/transport/http/middlewares/tagsExtractor.d.ts.map +1 -1
  897. package/build/transport/http/middlewares/tagsExtractor.js +2 -2
  898. package/build/transport/http/middlewares/tagsExtractor.js.map +1 -1
  899. package/build/transport/http/restorableStreamableTransport.d.ts +2 -57
  900. package/build/transport/http/restorableStreamableTransport.d.ts.map +1 -1
  901. package/build/transport/http/restorableStreamableTransport.js +1 -58
  902. package/build/transport/http/restorableStreamableTransport.js.map +1 -1
  903. package/build/transport/http/routes/adminRoutes.d.ts +3 -1
  904. package/build/transport/http/routes/adminRoutes.d.ts.map +1 -1
  905. package/build/transport/http/routes/adminRoutes.js +39 -2
  906. package/build/transport/http/routes/adminRoutes.js.map +1 -1
  907. package/build/transport/http/routes/apiRoutes.d.ts +5 -1
  908. package/build/transport/http/routes/apiRoutes.d.ts.map +1 -1
  909. package/build/transport/http/routes/apiRoutes.js +16 -4
  910. package/build/transport/http/routes/apiRoutes.js.map +1 -1
  911. package/build/transport/http/routes/healthRoutes.js.map +1 -1
  912. package/build/transport/http/routes/inspectHelpers.d.ts +1 -1
  913. package/build/transport/http/routes/inspectHelpers.d.ts.map +1 -1
  914. package/build/transport/http/routes/inspectHelpers.js +10 -6
  915. package/build/transport/http/routes/inspectHelpers.js.map +1 -1
  916. package/build/transport/http/routes/inspectRequestContext.js +2 -2
  917. package/build/transport/http/routes/inspectRoutes.d.ts.map +1 -1
  918. package/build/transport/http/routes/inspectRoutes.js +89 -77
  919. package/build/transport/http/routes/inspectRoutes.js.map +1 -1
  920. package/build/transport/http/routes/instructionsRoutes.d.ts.map +1 -1
  921. package/build/transport/http/routes/instructionsRoutes.js +2 -9
  922. package/build/transport/http/routes/instructionsRoutes.js.map +1 -1
  923. package/build/transport/http/routes/modernHttpRoutes.d.ts +29 -0
  924. package/build/transport/http/routes/modernHttpRoutes.d.ts.map +1 -0
  925. package/build/transport/http/routes/modernHttpRoutes.js +241 -0
  926. package/build/transport/http/routes/modernHttpRoutes.js.map +1 -0
  927. package/build/transport/http/routes/oauthRoutes.d.ts.map +1 -1
  928. package/build/transport/http/routes/oauthRoutes.js +28 -8
  929. package/build/transport/http/routes/oauthRoutes.js.map +1 -1
  930. package/build/transport/http/routes/sseRoutes.d.ts +1 -4
  931. package/build/transport/http/routes/sseRoutes.d.ts.map +1 -1
  932. package/build/transport/http/routes/sseRoutes.js +1 -109
  933. package/build/transport/http/routes/sseRoutes.js.map +1 -1
  934. package/build/transport/http/routes/streamableHttpRoutes.d.ts +2 -2
  935. package/build/transport/http/routes/streamableHttpRoutes.js +7 -7
  936. package/build/transport/http/routes/toolRoutes.d.ts.map +1 -1
  937. package/build/transport/http/routes/toolRoutes.js +22 -11
  938. package/build/transport/http/routes/toolRoutes.js.map +1 -1
  939. package/build/transport/http/server.d.ts +1 -84
  940. package/build/transport/http/server.d.ts.map +1 -1
  941. package/build/transport/http/server.js +1 -449
  942. package/build/transport/http/server.js.map +1 -1
  943. package/build/transport/http/storage/streamableSessionRepository.js +1 -1
  944. package/build/transport/http/streamableSessionLifecycle.d.ts +1 -91
  945. package/build/transport/http/streamableSessionLifecycle.d.ts.map +1 -1
  946. package/build/transport/http/streamableSessionLifecycle.js +1 -376
  947. package/build/transport/http/streamableSessionLifecycle.js.map +1 -1
  948. package/build/transport/http/utils/httpErrorHandler.js +1 -1
  949. package/build/transport/http/utils/httpErrorHandler.js.map +1 -1
  950. package/build/transport/http/utils/templateContextAuthority.d.ts.map +1 -1
  951. package/build/transport/http/utils/templateContextAuthority.js +20 -7
  952. package/build/transport/http/utils/templateContextAuthority.js.map +1 -1
  953. package/build/transport/restartableStdioTransport.d.ts +1 -89
  954. package/build/transport/restartableStdioTransport.d.ts.map +1 -1
  955. package/build/transport/restartableStdioTransport.js +1 -191
  956. package/build/transport/restartableStdioTransport.js.map +1 -1
  957. package/build/transport/stdioProxyTransport.d.ts +1 -82
  958. package/build/transport/stdioProxyTransport.d.ts.map +1 -1
  959. package/build/transport/stdioProxyTransport.js +1 -278
  960. package/build/transport/stdioProxyTransport.js.map +1 -1
  961. package/build/transport/transportFactory.d.ts +1 -23
  962. package/build/transport/transportFactory.d.ts.map +1 -1
  963. package/build/transport/transportFactory.js +1 -379
  964. package/build/transport/transportFactory.js.map +1 -1
  965. package/build/transport/transportFactory.testSetup.js +13 -0
  966. package/build/transport/transportFactory.testSetup.js.map +1 -1
  967. package/build/utils/client/clientInfoExtractor.d.ts +1 -1
  968. package/build/utils/client/clientInfoExtractor.d.ts.map +1 -1
  969. package/build/utils/client/clientInfoExtractor.js.map +1 -1
  970. package/build/utils/core/errorHandling.d.ts.map +1 -1
  971. package/build/utils/core/errorHandling.js +1 -1
  972. package/build/utils/core/errorHandling.js.map +1 -1
  973. package/build/utils/core/errorTypes.js +1 -1
  974. package/build/utils/core/errorTypes.js.map +1 -1
  975. package/build/utils/core/operationExecution.d.ts.map +1 -1
  976. package/build/utils/core/operationExecution.js +1 -1
  977. package/build/utils/core/operationExecution.js.map +1 -1
  978. package/build/utils/crypto.d.ts +5 -1
  979. package/build/utils/crypto.d.ts.map +1 -1
  980. package/build/utils/crypto.js +8 -3
  981. package/build/utils/crypto.js.map +1 -1
  982. package/build/utils/filePermissions.d.ts +65 -0
  983. package/build/utils/filePermissions.d.ts.map +1 -0
  984. package/build/utils/filePermissions.js +212 -0
  985. package/build/utils/filePermissions.js.map +1 -0
  986. package/build/utils/validation/urlDetection.js +1 -1
  987. package/package.json +18 -5
@@ -1,272 +1,2 @@
1
- import { sanitizeRuntimeScopeError } from '../../config/runtimeScopeEnv.js';
2
- import { ClientManager } from '../../core/client/clientManager.js';
3
- import { getGlobalContextManager } from '../../core/context/globalContextManager.js';
4
- import logger, { debugIf } from '../../logger/logger.js';
5
- import { createTransports, createTransportsWithContext, inferTransportType } from '../../transport/transportFactory.js';
6
- /**
7
- * Manages the lifecycle of MCP server instances (start, stop, restart)
8
- */
9
- export class MCPServerLifecycleManager {
10
- mcpServers = new Map();
11
- clientManager;
12
- constructor() {
13
- this.clientManager = ClientManager.getOrCreateInstance();
14
- }
15
- /**
16
- * Start a new MCP server instance
17
- */
18
- async startServer(serverName, config, outboundConns, transports) {
19
- try {
20
- logger.info(`Starting MCP server: ${serverName}`);
21
- // Check if server is already running
22
- if (this.mcpServers.has(serverName)) {
23
- logger.warn(`Server ${serverName} is already running`);
24
- return;
25
- }
26
- // Skip disabled servers
27
- if (config.disabled) {
28
- logger.info(`Server ${serverName} is disabled, skipping start`);
29
- return;
30
- }
31
- // Infer transport type if not specified
32
- const configWithType = inferTransportType(config, serverName);
33
- // Create transport for the server
34
- const transport = await this.createServerTransport(serverName, configWithType);
35
- // Store server info
36
- this.mcpServers.set(serverName, {
37
- transport,
38
- config: configWithType,
39
- });
40
- // Create client connection to the server using ClientManager
41
- await this.connectToServer(serverName, transport, configWithType, outboundConns, transports);
42
- logger.info(`Successfully started MCP server: ${serverName}`);
43
- }
44
- catch (error) {
45
- const safeError = sanitizeRuntimeScopeError(error);
46
- logger.error(`Failed to start MCP server ${serverName}:`, safeError);
47
- throw safeError;
48
- }
49
- }
50
- /**
51
- * Stop a server instance
52
- */
53
- async stopServer(serverName, outboundConns, transports) {
54
- try {
55
- logger.info(`Stopping MCP server: ${serverName}`);
56
- // Check if server is running
57
- const serverInfo = this.mcpServers.get(serverName);
58
- if (!serverInfo) {
59
- logger.warn(`Server ${serverName} is not running`);
60
- return;
61
- }
62
- // Disconnect client from the server using ClientManager
63
- await this.disconnectFromServer(serverName, outboundConns, transports);
64
- // Clean up transport
65
- const { transport } = serverInfo;
66
- try {
67
- if (transport.close) {
68
- await transport.close();
69
- }
70
- }
71
- catch (error) {
72
- logger.warn(`Error closing transport for server ${serverName}:`, sanitizeRuntimeScopeError(error));
73
- }
74
- // Remove from tracking
75
- this.mcpServers.delete(serverName);
76
- logger.info(`Successfully stopped MCP server: ${serverName}`);
77
- }
78
- catch (error) {
79
- const safeError = sanitizeRuntimeScopeError(error);
80
- logger.error(`Failed to stop MCP server ${serverName}:`, safeError);
81
- throw safeError;
82
- }
83
- }
84
- /**
85
- * Restart a server instance
86
- */
87
- async restartServer(serverName, config, outboundConns, transports) {
88
- try {
89
- logger.info(`Restarting MCP server: ${serverName}`);
90
- // Check if server is currently running and stop it
91
- const isCurrentlyRunning = this.mcpServers.has(serverName);
92
- if (isCurrentlyRunning) {
93
- logger.info(`Stopping existing server ${serverName} before restart`);
94
- await this.stopServer(serverName, outboundConns, transports);
95
- }
96
- // Start the server with new configuration
97
- await this.startServer(serverName, config, outboundConns, transports);
98
- logger.info(`Successfully restarted MCP server: ${serverName}`);
99
- }
100
- catch (error) {
101
- const safeError = sanitizeRuntimeScopeError(error);
102
- logger.error(`Failed to restart MCP server ${serverName}:`, safeError);
103
- throw safeError;
104
- }
105
- }
106
- /**
107
- * Get the status of all managed MCP servers
108
- */
109
- getMcpServerStatus() {
110
- const status = new Map();
111
- for (const [serverName, serverInfo] of this.mcpServers.entries()) {
112
- status.set(serverName, {
113
- running: true,
114
- config: serverInfo.config,
115
- });
116
- }
117
- return status;
118
- }
119
- /**
120
- * Check if a specific MCP server is running
121
- */
122
- isMcpServerRunning(serverName) {
123
- return this.mcpServers.has(serverName);
124
- }
125
- /**
126
- * Track a server whose connection is managed by another startup path.
127
- */
128
- trackServer(serverName, config, transport) {
129
- if (config.disabled) {
130
- this.mcpServers.delete(serverName);
131
- return;
132
- }
133
- this.mcpServers.set(serverName, { transport, config });
134
- debugIf(() => ({
135
- message: `Tracked MCP server lifecycle state: ${serverName}`,
136
- meta: { serverName, tags: config.tags },
137
- }));
138
- }
139
- /**
140
- * Remove lifecycle tracking without touching the already-cleaned-up transport.
141
- */
142
- untrackServer(serverName) {
143
- if (this.mcpServers.delete(serverName)) {
144
- debugIf(() => ({ message: `Untracked MCP server lifecycle state: ${serverName}` }));
145
- }
146
- }
147
- /**
148
- * Update metadata for a running server without restarting it
149
- */
150
- async updateServerMetadata(serverName, newConfig, outboundConns) {
151
- try {
152
- const serverInfo = this.mcpServers.get(serverName);
153
- if (!serverInfo) {
154
- logger.warn(`Cannot update metadata for ${serverName}: server not running`);
155
- return;
156
- }
157
- debugIf(() => ({
158
- message: `Updating metadata for server ${serverName}`,
159
- meta: {
160
- oldConfig: serverInfo.config,
161
- newConfig,
162
- },
163
- }));
164
- // Update the stored configuration with new metadata
165
- serverInfo.config = { ...serverInfo.config, ...newConfig };
166
- // Update transport metadata if supported
167
- const { transport } = serverInfo;
168
- if (transport && 'tags' in transport) {
169
- // Update tags and other metadata on transport
170
- if (newConfig.tags) {
171
- transport.tags = newConfig.tags;
172
- }
173
- }
174
- // Update outbound connections metadata
175
- const outboundConn = outboundConns.get(serverName);
176
- if (outboundConn && outboundConn.transport && 'tags' in outboundConn.transport) {
177
- // Update tags in the outbound connection
178
- outboundConn.transport.tags = newConfig.tags;
179
- }
180
- debugIf(() => ({
181
- message: `Successfully updated metadata for server ${serverName}`,
182
- meta: { newTags: newConfig.tags },
183
- }));
184
- }
185
- catch (error) {
186
- logger.error(`Failed to update metadata for server ${serverName}:`, error);
187
- throw error;
188
- }
189
- }
190
- /**
191
- * Create a transport for the given server configuration
192
- */
193
- async createServerTransport(serverName, config) {
194
- try {
195
- debugIf(() => ({
196
- message: `Creating transport for server ${serverName}`,
197
- meta: { serverName, type: config.type, command: config.command, url: config.url },
198
- }));
199
- // Create transport using the factory pattern with context awareness
200
- const globalContextManager = getGlobalContextManager();
201
- const currentContext = globalContextManager.getContext();
202
- const transports = currentContext
203
- ? await createTransportsWithContext({ [serverName]: config }, currentContext)
204
- : createTransports({ [serverName]: config });
205
- const transport = transports[serverName];
206
- if (!transport) {
207
- throw new Error(`Failed to create transport for server ${serverName}`);
208
- }
209
- debugIf(() => ({
210
- message: `Successfully created transport for server ${serverName}`,
211
- meta: { serverName, transportType: config.type },
212
- }));
213
- return transport;
214
- }
215
- catch (error) {
216
- const safeError = sanitizeRuntimeScopeError(error);
217
- logger.error(`Failed to create transport for server ${serverName}:`, safeError);
218
- throw safeError;
219
- }
220
- }
221
- /**
222
- * Connect to a server using ClientManager
223
- */
224
- async connectToServer(serverName, transport, _config, outboundConns, transports) {
225
- try {
226
- if (!this.clientManager) {
227
- throw new Error('ClientManager not initialized');
228
- }
229
- // Create client connection using the existing ClientManager infrastructure
230
- const clients = await this.clientManager.createClients({ [serverName]: transport });
231
- // Update our local outbound connections
232
- const newClient = clients.get(serverName);
233
- if (newClient) {
234
- outboundConns.set(serverName, newClient);
235
- transports[serverName] = transport;
236
- }
237
- debugIf(() => ({
238
- message: `Successfully connected to server ${serverName}`,
239
- meta: { serverName, status: newClient?.status },
240
- }));
241
- }
242
- catch (error) {
243
- const safeError = sanitizeRuntimeScopeError(error);
244
- logger.error(`Failed to connect to server ${serverName}:`, safeError);
245
- throw safeError;
246
- }
247
- }
248
- /**
249
- * Disconnect from a server using ClientManager
250
- */
251
- async disconnectFromServer(serverName, outboundConns, transports) {
252
- try {
253
- if (!this.clientManager) {
254
- throw new Error('ClientManager not initialized');
255
- }
256
- // Remove from outbound connections
257
- outboundConns.delete(serverName);
258
- delete transports[serverName];
259
- // ClientManager doesn't have explicit disconnect method, so we clean up our references
260
- // The actual transport cleanup happens in stopServer
261
- debugIf(() => ({
262
- message: `Successfully disconnected from server ${serverName}`,
263
- meta: { serverName },
264
- }));
265
- }
266
- catch (error) {
267
- logger.error(`Failed to disconnect from server ${serverName}:`, error);
268
- throw error;
269
- }
270
- }
271
- }
1
+ export { MCPServerLifecycleManager } from '../../sdk/legacy/server/runtime/mcpServerLifecycleManager.js';
272
2
  //# sourceMappingURL=mcpServerLifecycleManager.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mcpServerLifecycleManager.js","sourceRoot":"","sources":["../../../src/core/server/mcpServerLifecycleManager.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAGpF,OAAO,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAEvH;;GAEG;AACH,MAAM,OAAO,yBAAyB;IAC5B,UAAU,GAA+E,IAAI,GAAG,EAAE,CAAC;IACnG,aAAa,CAAiB;IAEtC;QACE,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC,mBAAmB,EAAE,CAAC;IAC3D,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,WAAW,CACtB,UAAkB,EAClB,MAAuB,EACvB,aAAkC,EAClC,UAAqC;QAErC,IAAI,CAAC;YACH,MAAM,CAAC,IAAI,CAAC,wBAAwB,UAAU,EAAE,CAAC,CAAC;YAElD,qCAAqC;YACrC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;gBACpC,MAAM,CAAC,IAAI,CAAC,UAAU,UAAU,qBAAqB,C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C,CAAC;gBACb,OAAO,EAAE,oCAAoC,UAAU,EAAE;gBACzD,IAAI,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE;aAChD,CAAC,CAAC,CAAC;QACN,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,SAAS,GAAG,yBAAyB,CAAC,KAAK,CAAC,CAAC;YACnD,MAAM,CAAC,KAAK,CAAC,+BAA+B,UAAU,GAAG,EAAE,SAAS,CAAC,CAAC;YACtE,MAAM,SAAS,CAAC;QAClB,CAAC;IACH,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,oBAAoB,CAChC,UAAkB,EAClB,aAAkC,EAClC,UAAqC;QAErC,IAAI,CAAC;YACH,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;gBACxB,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;YACnD,CAAC;YAED,mCAAmC;YACnC,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;YACjC,OAAO,UAAU,CAAC,UAAU,CAAC,CAAC;YAE9B,uFAAuF;YACvF,qDAAqD;YAErD,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;gBACb,OAAO,EAAE,yCAAyC,UAAU,EAAE;gBAC9D,IAAI,EAAE,EAAE,UAAU,EAAE;aACrB,CAAC,CAAC,CAAC;QACN,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,oCAAoC,UAAU,GAAG,EAAE,KAAK,CAAC,CAAC;YACvE,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF"}
1
+ {"version":3,"file":"mcpServerLifecycleManager.js","sourceRoot":"","sources":["../../../src/core/server/mcpServerLifecycleManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6DAA6D,CAAC"}
@@ -1,8 +1,10 @@
1
+ import { type ProcessIdentity } from './processIdentity.js';
1
2
  /**
2
3
  * Server information stored in PID file
3
4
  */
4
5
  export interface ServerPidInfo {
5
6
  pid: number;
7
+ processIdentity?: ProcessIdentity;
6
8
  url: string;
7
9
  port: number;
8
10
  host: string;
@@ -58,7 +60,9 @@ export declare function readPidFile(configDir: string): ServerPidInfo | null;
58
60
  */
59
61
  export declare function cleanupPidFile(configDir: string): boolean;
60
62
  /**
61
- * Delete the PID file only if it still records `expectedPid`. Guards against a
63
+ * Delete the PID file only if it still matches the expected PID or full record.
64
+ * Lifecycle callers pass the full record to also match birth evidence and startup time.
65
+ * Guards against a
62
66
  * time-of-check/time-of-use race: between reading a stale/dead PID and deleting
63
67
  * the file, a new runtime may have written a fresh PID file in the same scope.
64
68
  * Deleting unconditionally would strand that live runtime (undiscoverable to
@@ -67,7 +71,7 @@ export declare function cleanupPidFile(configDir: string): boolean;
67
71
  * @returns true if the file was removed or is already gone/replaced; false if a
68
72
  * matching file existed but could not be deleted.
69
73
  */
70
- export declare function cleanupPidFileIfMatches(configDir: string, expectedPid: number): boolean;
74
+ export declare function cleanupPidFileIfMatches(configDir: string, expected: number | ServerPidInfo): boolean;
71
75
  /**
72
76
  * Cleanup function to remove PID file
73
77
  * @param configDir Configuration directory
@@ -1 +1 @@
1
- {"version":3,"file":"pidFileManager.d.ts","sourceRoot":"","sources":["../../../src/core/server/pidFileManager.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAsBD,qBAAa,gBAAiB,SAAQ,KAAK;aAEvB,WAAW,EAAE,MAAM;gBAAnB,WAAW,EAAE,MAAM,EACnC,K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;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAuBD,qBAAa,gBAAiB,SAAQ,KAAK;aAEvB,WAAW,EAAE,MAAM;gBAAnB,WAAW,EAAE,MAAM,EACnC,KAAK,EAAE,OAAO;CAOjB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAExD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAWnD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,GAAG,IAAI,CA0B/E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CA4BnE;AAWD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAczD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,aAAa,GAAG,OAAO,CAsBpG;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAE5D;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAQ9D;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAmBrE"}
@@ -2,6 +2,7 @@ import fs from 'fs';
2
2
  import path from 'path';
3
3
  import logger from '../../logger/logger.js';
4
4
  import { z } from 'zod';
5
+ import { processIdentitySchema, readProcessIdentity } from './processIdentity.js';
5
6
  /**
6
7
  * Schema validating a PID file at the (untrusted, cross-version) file boundary.
7
8
  * `pid` must be a positive integer — this is load-bearing: a negative PID would
@@ -11,6 +12,7 @@ import { z } from 'zod';
11
12
  */
12
13
  const serverPidInfoSchema = z.object({
13
14
  pid: z.number().int().positive(),
15
+ processIdentity: processIdentitySchema.optional(),
14
16
  url: z.string().min(1),
15
17
  port: z.number().int().min(1).max(65535),
16
18
  host: z.string().min(1),
@@ -67,7 +69,7 @@ export function writePidFile(configDir, serverInfo) {
67
69
  // Write PID file atomically: write to a sibling temp file then rename into
68
70
  // place (rename is atomic on POSIX). Concurrent readers — racing `serve
69
71
  // --status` / discovery — never observe a half-written, unparseable file.
70
- const content = JSON.stringify(serverInfo, null, 2);
72
+ const content = JSON.stringify({ ...serverInfo, processIdentity: serverInfo.processIdentity ?? readProcessIdentity(serverInfo.pid) }, null, 2);
71
73
  const tempFilePath = `${pidFilePath}.${process.pid}.tmp`;
72
74
  fs.writeFileSync(tempFilePath, content, { encoding: 'utf-8' });
73
75
  fs.renameSync(tempFilePath, pidFilePath);
@@ -148,7 +150,9 @@ export function cleanupPidFile(configDir) {
148
150
  }
149
151
  }
150
152
  /**
151
- * Delete the PID file only if it still records `expectedPid`. Guards against a
153
+ * Delete the PID file only if it still matches the expected PID or full record.
154
+ * Lifecycle callers pass the full record to also match birth evidence and startup time.
155
+ * Guards against a
152
156
  * time-of-check/time-of-use race: between reading a stale/dead PID and deleting
153
157
  * the file, a new runtime may have written a fresh PID file in the same scope.
154
158
  * Deleting unconditionally would strand that live runtime (undiscoverable to
@@ -157,7 +161,8 @@ export function cleanupPidFile(configDir) {
157
161
  * @returns true if the file was removed or is already gone/replaced; false if a
158
162
  * matching file existed but could not be deleted.
159
163
  */
160
- export function cleanupPidFileIfMatches(configDir, expectedPid) {
164
+ export function cleanupPidFileIfMatches(configDir, expected) {
165
+ const expectedPid = typeof expected === 'number' ? expected : expected.pid;
161
166
  let current;
162
167
  try {
163
168
  current = readPidFile(configDir);
@@ -168,7 +173,11 @@ export function cleanupPidFileIfMatches(configDir, expectedPid) {
168
173
  }
169
174
  throw error;
170
175
  }
171
- if (!current || current.pid !== expectedPid) {
176
+ if (!current ||
177
+ current.pid !== expectedPid ||
178
+ (typeof expected !== 'number' &&
179
+ (current.startedAt !== expected.startedAt ||
180
+ JSON.stringify(current.processIdentity) !== JSON.stringify(expected.processIdentity)))) {
172
181
  // Already gone, or replaced by a newer runtime — leave it untouched.
173
182
  return true;
174
183
  }
@@ -1 +1 @@
1
- {"version":3,"file":"pidFileManager.js","sourceRoot":"","sources":["../../../src/core/server/pidFileManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAE3C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAsBxB;;;;;;GAMG;AACH,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IAChC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACtB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC;IACxC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IAC5B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CACtC,CAAoC,CAAC;AAEtC,MAAM,aAAa,GAAG,YAAY,CAAC;AAEnC,MAAM,OAAO,gBAAiB,SAAQ,K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,8FAA8F;IAC9F,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;QACxB,OAAO,EAAE,CAAC;QACV,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE;QACzB,OAAO,EAAE,CAAC;QACV,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;QACxB,OAAO,EAAE,CAAC;QACV,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { z } from 'zod';
2
+ export declare const processIdentitySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3
+ platform: z.ZodLiteral<"linux">;
4
+ bootId: z.ZodString;
5
+ pidNamespace: z.ZodString;
6
+ startTime: z.ZodString;
7
+ }, z.core.$strip>, z.ZodObject<{
8
+ platform: z.ZodLiteral<"darwin">;
9
+ hostname: z.ZodString;
10
+ startTime: z.ZodString;
11
+ }, z.core.$strip>, z.ZodObject<{
12
+ platform: z.ZodLiteral<"win32">;
13
+ hostname: z.ZodString;
14
+ startTime: z.ZodString;
15
+ }, z.core.$strip>], "platform">;
16
+ export type ProcessIdentity = z.infer<typeof processIdentitySchema>;
17
+ export type ProcessIdentityStatus = 'alive' | 'dead' | 'unknown';
18
+ /** Capture kernel process birth evidence; unavailable evidence is never a PID-only match. */
19
+ export declare function readProcessIdentity(pid: number): ProcessIdentity | undefined;
20
+ interface IdentityDependencies {
21
+ readIdentity?: typeof readProcessIdentity;
22
+ processAlive?: (pid: number) => boolean;
23
+ }
24
+ /** Numeric PIDs are meaningful only within the recorded execution context. */
25
+ export declare function inspectProcessIdentity(pid: number, identity?: ProcessIdentity, dependencies?: IdentityDependencies): ProcessIdentityStatus;
26
+ export {};
27
+ //# sourceMappingURL=processIdentity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"processIdentity.d.ts","sourceRoot":"","sources":["../../../src/core/server/processIdentity.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;+BAShC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,qBAAqB,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAEjE,6FAA6F;AAC7F,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAoD5E;AAED,UAAU,oBAAoB;IAC5B,YAAY,CAAC,EAAE,OAAO,mBAAmB,CAAC;IAC1C,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;CACzC;AAmBD,8EAA8E;AAC9E,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,MAAM,EACX,QAAQ,CAAC,EAAE,eAAe,EAC1B,YAAY,GAAE,oBAAyB,GACtC,qBAAqB,CAWvB"}
@@ -0,0 +1,101 @@
1
+ import childProcess from 'node:child_process';
2
+ import fs from 'node:fs';
3
+ import os from 'node:os';
4
+ import { z } from 'zod';
5
+ export const processIdentitySchema = z.discriminatedUnion('platform', [
6
+ z.object({
7
+ platform: z.literal('linux'),
8
+ bootId: z.string().min(1),
9
+ pidNamespace: z.string().min(1),
10
+ startTime: z.string().regex(/^\d+$/),
11
+ }),
12
+ z.object({ platform: z.literal('darwin'), hostname: z.string().min(1), startTime: z.string().min(1) }),
13
+ z.object({ platform: z.literal('win32'), hostname: z.string().min(1), startTime: z.string().regex(/^\d+$/) }),
14
+ ]);
15
+ /** Capture kernel process birth evidence; unavailable evidence is never a PID-only match. */
16
+ export function readProcessIdentity(pid) {
17
+ if (!Number.isSafeInteger(pid) || pid <= 0)
18
+ return undefined;
19
+ try {
20
+ if (process.platform === 'linux') {
21
+ const stat = fs.readFileSync(`/proc/${pid}/stat`, 'utf8');
22
+ // comm is parenthesized and may itself contain spaces or closing parentheses.
23
+ const fields = stat
24
+ .slice(stat.lastIndexOf(')') + 2)
25
+ .trim()
26
+ .split(/\s+/);
27
+ if (fields[0] === 'Z' || fields[0] === 'X')
28
+ return undefined;
29
+ return processIdentitySchema.parse({
30
+ platform: 'linux',
31
+ bootId: fs.readFileSync('/proc/sys/kernel/random/boot_id', 'utf8').trim(),
32
+ pidNamespace: fs.readlinkSync(`/proc/${pid}/ns/pid`),
33
+ startTime: fields[19],
34
+ });
35
+ }
36
+ if (process.platform === 'darwin') {
37
+ // macOS ps exposes birth time at second precision; see the lifecycle platform contract.
38
+ const startTime = childProcess
39
+ .execFileSync('/usr/bin/env', ['LC_ALL=C', 'TZ=UTC', '/bin/ps', '-p', String(pid), '-o', 'lstart='], {
40
+ encoding: 'utf8',
41
+ timeout: 3000,
42
+ stdio: ['ignore', 'pipe', 'ignore'],
43
+ })
44
+ .trim();
45
+ return processIdentitySchema.parse({ platform: 'darwin', hostname: os.hostname(), startTime });
46
+ }
47
+ if (process.platform === 'win32') {
48
+ const startTime = childProcess
49
+ .execFileSync('powershell.exe', [
50
+ '-NoProfile',
51
+ '-NonInteractive',
52
+ '-Command',
53
+ `(Get-Process -Id ${pid} -ErrorAction Stop).StartTime.ToUniversalTime().Ticks`,
54
+ ], {
55
+ encoding: 'utf8',
56
+ timeout: 3000,
57
+ stdio: ['ignore', 'pipe', 'ignore'],
58
+ })
59
+ .trim();
60
+ return processIdentitySchema.parse({ platform: 'win32', hostname: os.hostname(), startTime });
61
+ }
62
+ }
63
+ catch {
64
+ // Permission errors, disappearing processes, malformed procfs, and missing platform tools are uncertain.
65
+ }
66
+ return undefined;
67
+ }
68
+ function processExists(pid) {
69
+ try {
70
+ process.kill(pid, 0);
71
+ return true;
72
+ }
73
+ catch (error) {
74
+ return !(error instanceof Error && 'code' in error && error.code === 'ESRCH');
75
+ }
76
+ }
77
+ function sameContext(left, right) {
78
+ if (left.platform !== right.platform)
79
+ return false;
80
+ if (left.platform === 'linux' && right.platform === 'linux') {
81
+ return left.bootId === right.bootId && left.pidNamespace === right.pidNamespace;
82
+ }
83
+ return 'hostname' in left && 'hostname' in right && left.hostname === right.hostname;
84
+ }
85
+ /** Numeric PIDs are meaningful only within the recorded execution context. */
86
+ export function inspectProcessIdentity(pid, identity, dependencies = {}) {
87
+ if (!identity)
88
+ return 'unknown';
89
+ const readIdentity = dependencies.readIdentity ?? readProcessIdentity;
90
+ const context = readIdentity(process.pid);
91
+ if (!context || !sameContext(identity, context))
92
+ return 'unknown';
93
+ const observed = readIdentity(pid);
94
+ if (observed) {
95
+ if (!sameContext(identity, observed))
96
+ return 'unknown';
97
+ return observed.startTime === identity.startTime ? 'alive' : 'dead';
98
+ }
99
+ return (dependencies.processAlive ?? processExists)(pid) ? 'unknown' : 'dead';
100
+ }
101
+ //# sourceMappingURL=processIdentity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"processIdentity.js","sourceRoot":"","sources":["../../../src/core/server/processIdentity.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,kBAAkB,CAAC,UAAU,EAAE;IACpE,CAAC,CAAC,MAAM,CAAC;QACP,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;QAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QACzB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC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,CAAC,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC;QAAE,OAAO,SAAS,CAAC;IAClE,MAAM,QAAQ,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;IACnC,IAAI,QAAQ,EAAE,CAAC;QACb,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,QAAQ,CAAC;YAAE,OAAO,SAAS,CAAC;QACvD,OAAO,QAAQ,CAAC,SAAS,KAAK,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;IACtE,CAAC;IACD,OAAO,CAAC,YAAY,CAAC,YAAY,IAAI,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;AAChF,CAAC"}
@@ -1,39 +1,2 @@
1
- import type { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
2
- import type { TrustedTemplateContext } from '../../core/context/templateContextTrust.js';
3
- import type { OutboundConnections } from '../../core/types/client.js';
4
- import type { MCPServerParams } from '../../core/types/index.js';
5
- import type { InboundConnectionConfig } from '../../core/types/server.js';
6
- import type { ContextData } from '../../types/context.js';
7
- export type RequestContextPreparationResult = {
8
- status: 'no_context';
9
- } | {
10
- status: 'routing_only';
11
- sessionId: string;
12
- } | {
13
- status: 'already_prepared' | 'prepared';
14
- sessionId: string;
15
- templateNames: string[];
16
- createdTemplateNames: string[];
17
- };
18
- export interface RequestContextPreparationDependencies {
19
- deriveSessionId(context: ContextData): string;
20
- loadRenderedTemplates(context: ContextData): Promise<Record<string, MCPServerParams>>;
21
- getRenderedHashForSession(sessionId: string, templateName: string): string | undefined;
22
- touchEphemeralClient(sessionId: string): void;
23
- createTemplateBasedServers(sessionId: string, context: ContextData, filterConfig: InboundConnectionConfig, serverConfigData: {
24
- mcpTemplates?: Record<string, MCPServerParams>;
25
- }, outboundConns: OutboundConnections, transports: Record<string, Transport>, lifecycle: 'ephemeral'): Promise<void>;
26
- hasTemplateAdapter(templateName: string): boolean;
27
- registerTemplateAdapter(templateName: string, config: MCPServerParams): void;
28
- getOutboundConnections(): OutboundConnections;
29
- getClientTransports(): Record<string, Transport>;
30
- refreshCapabilities(): Promise<void>;
31
- }
32
- export interface PrepareRequestContextInput {
33
- deps: RequestContextPreparationDependencies;
34
- filterConfig: InboundConnectionConfig;
35
- context?: TrustedTemplateContext | null;
36
- transportSessionId?: string;
37
- }
38
- export declare function prepareRequestContext(input: PrepareRequestContextInput): Promise<RequestContextPreparationResult>;
1
+ export * from '../../sdk/legacy/server/runtime/requestContextPreparation.js';
39
2
  //# sourceMappingURL=requestContextPreparation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"requestContextPreparation.d.ts","sourceRoot":"","sources":["../../../src/core/server/requestContextPreparation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAC;AAG/E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACxF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGzD,MAAM,MAAM,+BAA+B,GACvC;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,GACxB;IAAE,MAAM,EAAE,cAAc,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAC7C;IACE,MAAM,EAAE,kBAAkB,GAAG,UAAU,CAAC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,oBAAoB,EAAE,MAAM,EAAE,CAAC;CAChC,CAAC;AAEN,MAAM,WAAW,qCAAqC;IACpD,eAAe,CAAC,OAAO,EAAE,WAAW,GAAG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paration.ts"],"names":[],"mappings":"AAAA,cAAc,6DAA6D,CAAC"}