@1mcp/agent 0.32.2 → 0.33.0-beta1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (347) hide show
  1. package/build/auth/oauthAuthorizationFlow.d.ts +145 -0
  2. package/build/auth/oauthAuthorizationFlow.d.ts.map +1 -0
  3. package/build/auth/oauthAuthorizationFlow.js +257 -0
  4. package/build/auth/oauthAuthorizationFlow.js.map +1 -0
  5. package/build/auth/sdkOAuthServerProvider.d.ts +4 -0
  6. package/build/auth/sdkOAuthServerProvider.d.ts.map +1 -1
  7. package/build/auth/sdkOAuthServerProvider.js +4 -0
  8. package/build/auth/sdkOAuthServerProvider.js.map +1 -1
  9. package/build/auth/storage/fileStorageService.d.ts.map +1 -1
  10. package/build/auth/storage/fileStorageService.js +9 -5
  11. package/build/auth/storage/fileStorageService.js.map +1 -1
  12. package/build/commands/cliSetup/setupFiles.d.ts +2 -4
  13. package/build/commands/cliSetup/setupFiles.d.ts.map +1 -1
  14. package/build/commands/cliSetup/setupFiles.js +8 -46
  15. package/build/commands/cliSetup/setupFiles.js.map +1 -1
  16. package/build/commands/inspect/inspect.d.ts +3 -0
  17. package/build/commands/inspect/inspect.d.ts.map +1 -1
  18. package/build/commands/inspect/inspect.js +90 -83
  19. package/build/commands/inspect/inspect.js.map +1 -1
  20. package/build/commands/instructions/instructions.d.ts.map +1 -1
  21. package/build/commands/instructions/instructions.js +11 -68
  22. package/build/commands/instructions/instructions.js.map +1 -1
  23. package/build/commands/mcp/install.d.ts.map +1 -1
  24. package/build/commands/mcp/install.js +62 -145
  25. package/build/commands/mcp/install.js.map +1 -1
  26. package/build/commands/mcp/installSource.d.ts +13 -0
  27. package/build/commands/mcp/installSource.d.ts.map +1 -0
  28. package/build/commands/mcp/installSource.js +69 -0
  29. package/build/commands/mcp/installSource.js.map +1 -0
  30. package/build/commands/mcp/uninstall.d.ts.map +1 -1
  31. package/build/commands/mcp/uninstall.js +20 -15
  32. package/build/commands/mcp/uninstall.js.map +1 -1
  33. package/build/commands/preset/edit.d.ts.map +1 -1
  34. package/build/commands/preset/edit.js +2 -0
  35. package/build/commands/preset/edit.js.map +1 -1
  36. package/build/commands/preset/interactive.d.ts.map +1 -1
  37. package/build/commands/preset/interactive.js +2 -0
  38. package/build/commands/preset/interactive.js.map +1 -1
  39. package/build/commands/preset/show.d.ts.map +1 -1
  40. package/build/commands/preset/show.js +2 -0
  41. package/build/commands/preset/show.js.map +1 -1
  42. package/build/commands/preset/test.d.ts.map +1 -1
  43. package/build/commands/preset/test.js +2 -0
  44. package/build/commands/preset/test.js.map +1 -1
  45. package/build/commands/proxy/proxy.d.ts.map +1 -1
  46. package/build/commands/proxy/proxy.js +11 -22
  47. package/build/commands/proxy/proxy.js.map +1 -1
  48. package/build/commands/registry/options.d.ts +14 -7
  49. package/build/commands/registry/options.d.ts.map +1 -1
  50. package/build/commands/registry/options.js +14 -7
  51. package/build/commands/registry/options.js.map +1 -1
  52. package/build/commands/run/run.d.ts +1 -0
  53. package/build/commands/run/run.d.ts.map +1 -1
  54. package/build/commands/run/run.js +124 -156
  55. package/build/commands/run/run.js.map +1 -1
  56. package/build/commands/serve/index.d.ts +5 -0
  57. package/build/commands/serve/index.d.ts.map +1 -1
  58. package/build/commands/serve/index.js +6 -1
  59. package/build/commands/serve/index.js.map +1 -1
  60. package/build/commands/serve/serve.d.ts +1 -0
  61. package/build/commands/serve/serve.d.ts.map +1 -1
  62. package/build/commands/serve/serve.js +5 -103
  63. package/build/commands/serve/serve.js.map +1 -1
  64. package/build/commands/serve/serveOptions.d.ts +6 -0
  65. package/build/commands/serve/serveOptions.d.ts.map +1 -0
  66. package/build/commands/serve/serveOptions.js +90 -0
  67. package/build/commands/serve/serveOptions.js.map +1 -0
  68. package/build/commands/shared/baseConfigUtils.d.ts +1 -25
  69. package/build/commands/shared/baseConfigUtils.d.ts.map +1 -1
  70. package/build/commands/shared/baseConfigUtils.js +3 -193
  71. package/build/commands/shared/baseConfigUtils.js.map +1 -1
  72. package/build/commands/shared/clientSurfaceAttachment.d.ts +131 -0
  73. package/build/commands/shared/clientSurfaceAttachment.d.ts.map +1 -0
  74. package/build/commands/shared/clientSurfaceAttachment.js +205 -0
  75. package/build/commands/shared/clientSurfaceAttachment.js.map +1 -0
  76. package/build/commands/shared/configParsingUtils.d.ts +9 -0
  77. package/build/commands/shared/configParsingUtils.d.ts.map +1 -0
  78. package/build/commands/shared/configParsingUtils.js +179 -0
  79. package/build/commands/shared/configParsingUtils.js.map +1 -0
  80. package/build/commands/shared/serveClient.d.ts.map +1 -1
  81. package/build/commands/shared/serveClient.js +35 -12
  82. package/build/commands/shared/serveClient.js.map +1 -1
  83. package/build/commands/shared/serveTargetResolver.d.ts.map +1 -1
  84. package/build/commands/shared/serveTargetResolver.js +42 -3
  85. package/build/commands/shared/serveTargetResolver.js.map +1 -1
  86. package/build/config/configLoader.d.ts +0 -1
  87. package/build/config/configLoader.d.ts.map +1 -1
  88. package/build/config/configLoader.js +12 -7
  89. package/build/config/configLoader.js.map +1 -1
  90. package/build/config/envProcessor.d.ts +3 -8
  91. package/build/config/envProcessor.d.ts.map +1 -1
  92. package/build/config/envProcessor.js +17 -34
  93. package/build/config/envProcessor.js.map +1 -1
  94. package/build/config/mcpConfigMerge.d.ts.map +1 -1
  95. package/build/config/mcpConfigMerge.js +15 -8
  96. package/build/config/mcpConfigMerge.js.map +1 -1
  97. package/build/constants/mcp.d.ts +1 -1
  98. package/build/constants/mcp.d.ts.map +1 -1
  99. package/build/constants/mcp.js +1 -1
  100. package/build/constants/mcp.js.map +1 -1
  101. package/build/core/capabilities/asyncLoadingOrchestrator.d.ts +2 -1
  102. package/build/core/capabilities/asyncLoadingOrchestrator.d.ts.map +1 -1
  103. package/build/core/capabilities/asyncLoadingOrchestrator.js +3 -1
  104. package/build/core/capabilities/asyncLoadingOrchestrator.js.map +1 -1
  105. package/build/core/capabilities/capabilityCatalog.d.ts +88 -0
  106. package/build/core/capabilities/capabilityCatalog.d.ts.map +1 -0
  107. package/build/core/capabilities/capabilityCatalog.js +235 -0
  108. package/build/core/capabilities/capabilityCatalog.js.map +1 -0
  109. package/build/core/capabilities/capabilityNotificationFacts.d.ts +9 -0
  110. package/build/core/capabilities/capabilityNotificationFacts.d.ts.map +1 -0
  111. package/build/core/capabilities/capabilityNotificationFacts.js +11 -0
  112. package/build/core/capabilities/capabilityNotificationFacts.js.map +1 -0
  113. package/build/core/capabilities/metaToolProvider.d.ts +2 -0
  114. package/build/core/capabilities/metaToolProvider.d.ts.map +1 -1
  115. package/build/core/capabilities/metaToolProvider.js +37 -77
  116. package/build/core/capabilities/metaToolProvider.js.map +1 -1
  117. package/build/core/capabilities/toolRegistry.d.ts +2 -1
  118. package/build/core/capabilities/toolRegistry.d.ts.map +1 -1
  119. package/build/core/capabilities/toolRegistry.js +2 -0
  120. package/build/core/capabilities/toolRegistry.js.map +1 -1
  121. package/build/core/configChangeHandler.d.ts.map +1 -1
  122. package/build/core/configChangeHandler.js +33 -16
  123. package/build/core/configChangeHandler.js.map +1 -1
  124. package/build/core/filtering/filterSelection.d.ts +72 -0
  125. package/build/core/filtering/filterSelection.d.ts.map +1 -0
  126. package/build/core/filtering/filterSelection.js +262 -0
  127. package/build/core/filtering/filterSelection.js.map +1 -0
  128. package/build/core/instructions/instructionsDistribution.d.ts +52 -0
  129. package/build/core/instructions/instructionsDistribution.d.ts.map +1 -0
  130. package/build/core/instructions/instructionsDistribution.js +124 -0
  131. package/build/core/instructions/instructionsDistribution.js.map +1 -0
  132. package/build/core/protocol/notificationHandlers.js +2 -2
  133. package/build/core/protocol/notificationHandlers.js.map +1 -1
  134. package/build/core/protocol/promptRequestHandlers.d.ts +4 -0
  135. package/build/core/protocol/promptRequestHandlers.d.ts.map +1 -0
  136. package/build/core/protocol/promptRequestHandlers.js +64 -0
  137. package/build/core/protocol/promptRequestHandlers.js.map +1 -0
  138. package/build/core/protocol/requestHandlerUtils.d.ts +8 -0
  139. package/build/core/protocol/requestHandlerUtils.d.ts.map +1 -0
  140. package/build/core/protocol/requestHandlerUtils.js +48 -0
  141. package/build/core/protocol/requestHandlerUtils.js.map +1 -0
  142. package/build/core/protocol/requestHandlers.d.ts +2 -0
  143. package/build/core/protocol/requestHandlers.d.ts.map +1 -1
  144. package/build/core/protocol/requestHandlers.js +7 -391
  145. package/build/core/protocol/requestHandlers.js.map +1 -1
  146. package/build/core/protocol/resourceRequestHandlers.d.ts +3 -0
  147. package/build/core/protocol/resourceRequestHandlers.d.ts.map +1 -0
  148. package/build/core/protocol/resourceRequestHandlers.js +76 -0
  149. package/build/core/protocol/resourceRequestHandlers.js.map +1 -0
  150. package/build/core/protocol/toolRequestHandlers.d.ts +4 -0
  151. package/build/core/protocol/toolRequestHandlers.d.ts.map +1 -0
  152. package/build/core/protocol/toolRequestHandlers.js +132 -0
  153. package/build/core/protocol/toolRequestHandlers.js.map +1 -0
  154. package/build/core/server/adapters/TemplateServerAdapter.d.ts +0 -5
  155. package/build/core/server/adapters/TemplateServerAdapter.d.ts.map +1 -1
  156. package/build/core/server/adapters/TemplateServerAdapter.js +7 -30
  157. package/build/core/server/adapters/TemplateServerAdapter.js.map +1 -1
  158. package/build/core/server/clientInstanceFactory.d.ts +13 -0
  159. package/build/core/server/clientInstanceFactory.d.ts.map +1 -0
  160. package/build/core/server/clientInstanceFactory.js +32 -0
  161. package/build/core/server/clientInstanceFactory.js.map +1 -0
  162. package/build/core/server/clientInstancePool.d.ts +8 -49
  163. package/build/core/server/clientInstancePool.d.ts.map +1 -1
  164. package/build/core/server/clientInstancePool.js +61 -72
  165. package/build/core/server/clientInstancePool.js.map +1 -1
  166. package/build/core/server/clientInstancePoolTypes.d.ts +52 -0
  167. package/build/core/server/clientInstancePoolTypes.d.ts.map +1 -0
  168. package/build/core/server/clientInstancePoolTypes.js +10 -0
  169. package/build/core/server/clientInstancePoolTypes.js.map +1 -0
  170. package/build/core/server/connectionResolver.d.ts.map +1 -1
  171. package/build/core/server/connectionResolver.js +34 -31
  172. package/build/core/server/connectionResolver.js.map +1 -1
  173. package/build/core/server/requestContextPreparation.d.ts +38 -0
  174. package/build/core/server/requestContextPreparation.d.ts.map +1 -0
  175. package/build/core/server/requestContextPreparation.js +49 -0
  176. package/build/core/server/requestContextPreparation.js.map +1 -0
  177. package/build/core/server/serverManager.js +1 -1
  178. package/build/core/server/serverManager.js.map +1 -1
  179. package/build/core/server/templateIdentity.d.ts +44 -0
  180. package/build/core/server/templateIdentity.d.ts.map +1 -0
  181. package/build/core/server/templateIdentity.js +95 -0
  182. package/build/core/server/templateIdentity.js.map +1 -0
  183. package/build/core/server/templateServerCleanup.d.ts +23 -0
  184. package/build/core/server/templateServerCleanup.d.ts.map +1 -0
  185. package/build/core/server/templateServerCleanup.js +155 -0
  186. package/build/core/server/templateServerCleanup.js.map +1 -0
  187. package/build/core/server/templateServerManager.d.ts +12 -3
  188. package/build/core/server/templateServerManager.d.ts.map +1 -1
  189. package/build/core/server/templateServerManager.js +82 -127
  190. package/build/core/server/templateServerManager.js.map +1 -1
  191. package/build/core/tools/internal/adapters/installation/types.d.ts +16 -11
  192. package/build/core/tools/internal/adapters/installation/types.d.ts.map +1 -1
  193. package/build/core/tools/internal/adapters/installationAdapter.d.ts +3 -13
  194. package/build/core/tools/internal/adapters/installationAdapter.d.ts.map +1 -1
  195. package/build/core/tools/internal/adapters/installationAdapter.js +85 -69
  196. package/build/core/tools/internal/adapters/installationAdapter.js.map +1 -1
  197. package/build/core/tools/internal/installationHandlers.d.ts.map +1 -1
  198. package/build/core/tools/internal/installationHandlers.js +10 -4
  199. package/build/core/tools/internal/installationHandlers.js.map +1 -1
  200. package/build/core/tools/internal/integration.domainMocks.testSetup.d.ts +2 -0
  201. package/build/core/tools/internal/integration.domainMocks.testSetup.d.ts.map +1 -0
  202. package/build/core/tools/internal/integration.domainMocks.testSetup.js +66 -0
  203. package/build/core/tools/internal/integration.domainMocks.testSetup.js.map +1 -0
  204. package/build/core/tools/internal/integration.testSetup.d.ts +2 -0
  205. package/build/core/tools/internal/integration.testSetup.d.ts.map +1 -0
  206. package/build/core/tools/internal/integration.testSetup.js +469 -0
  207. package/build/core/tools/internal/integration.testSetup.js.map +1 -0
  208. package/build/core/tools/internal/schemas/index.d.ts +6 -0
  209. package/build/core/tools/internal/schemas/index.d.ts.map +1 -1
  210. package/build/core/tools/internal/schemas/installation.d.ts +6 -0
  211. package/build/core/tools/internal/schemas/installation.d.ts.map +1 -1
  212. package/build/core/tools/internal/schemas/installation.js +13 -1
  213. package/build/core/tools/internal/schemas/installation.js.map +1 -1
  214. package/build/domains/config-change/backupRetention.d.ts +14 -0
  215. package/build/domains/config-change/backupRetention.d.ts.map +1 -0
  216. package/build/domains/config-change/backupRetention.js +36 -0
  217. package/build/domains/config-change/backupRetention.js.map +1 -0
  218. package/build/domains/config-change/configChange.d.ts +4 -0
  219. package/build/domains/config-change/configChange.d.ts.map +1 -0
  220. package/build/domains/config-change/configChange.js +346 -0
  221. package/build/domains/config-change/configChange.js.map +1 -0
  222. package/build/domains/config-change/configLock.d.ts +6 -0
  223. package/build/domains/config-change/configLock.d.ts.map +1 -0
  224. package/build/domains/config-change/configLock.js +62 -0
  225. package/build/domains/config-change/configLock.js.map +1 -0
  226. package/build/domains/config-change/types.d.ts +64 -0
  227. package/build/domains/config-change/types.d.ts.map +1 -0
  228. package/build/domains/config-change/types.js +2 -0
  229. package/build/domains/config-change/types.js.map +1 -0
  230. package/build/domains/installation/index.d.ts +4 -3
  231. package/build/domains/installation/index.d.ts.map +1 -1
  232. package/build/domains/installation/index.js +5 -3
  233. package/build/domains/installation/index.js.map +1 -1
  234. package/build/domains/installation/serverInstallationSourceResolution.d.ts +6 -0
  235. package/build/domains/installation/serverInstallationSourceResolution.d.ts.map +1 -0
  236. package/build/domains/installation/serverInstallationSourceResolution.js +210 -0
  237. package/build/domains/installation/serverInstallationSourceResolution.js.map +1 -0
  238. package/build/domains/installation/serverInstallationTypes.d.ts +105 -0
  239. package/build/domains/installation/serverInstallationTypes.d.ts.map +1 -0
  240. package/build/domains/installation/serverInstallationTypes.js +2 -0
  241. package/build/domains/installation/serverInstallationTypes.js.map +1 -0
  242. package/build/domains/installation/serverInstallationWorkflow.d.ts +4 -0
  243. package/build/domains/installation/serverInstallationWorkflow.d.ts.map +1 -0
  244. package/build/domains/installation/serverInstallationWorkflow.js +148 -0
  245. package/build/domains/installation/serverInstallationWorkflow.js.map +1 -0
  246. package/build/domains/preset/manager/presetManager.d.ts +0 -4
  247. package/build/domains/preset/manager/presetManager.d.ts.map +1 -1
  248. package/build/domains/preset/manager/presetManager.js +19 -153
  249. package/build/domains/preset/manager/presetManager.js.map +1 -1
  250. package/build/domains/preset/manager/presetManagerCleanup.d.ts +15 -0
  251. package/build/domains/preset/manager/presetManagerCleanup.d.ts.map +1 -0
  252. package/build/domains/preset/manager/presetManagerCleanup.js +34 -0
  253. package/build/domains/preset/manager/presetManagerCleanup.js.map +1 -0
  254. package/build/domains/preset/manager/presetStorage.d.ts +4 -0
  255. package/build/domains/preset/manager/presetStorage.d.ts.map +1 -0
  256. package/build/domains/preset/manager/presetStorage.js +27 -0
  257. package/build/domains/preset/manager/presetStorage.js.map +1 -0
  258. package/build/domains/preset/manager/presetTesting.d.ts +8 -0
  259. package/build/domains/preset/manager/presetTesting.d.ts.map +1 -0
  260. package/build/domains/preset/manager/presetTesting.js +38 -0
  261. package/build/domains/preset/manager/presetTesting.js.map +1 -0
  262. package/build/domains/preset/manager/presetValidation.d.ts +3 -0
  263. package/build/domains/preset/manager/presetValidation.d.ts.map +1 -0
  264. package/build/domains/preset/manager/presetValidation.js +41 -0
  265. package/build/domains/preset/manager/presetValidation.js.map +1 -0
  266. package/build/domains/registry/cacheManager.d.ts.map +1 -1
  267. package/build/domains/registry/cacheManager.js +1 -0
  268. package/build/domains/registry/cacheManager.js.map +1 -1
  269. package/build/domains/registry/mcpRegistryClient.d.ts.map +1 -1
  270. package/build/domains/registry/mcpRegistryClient.js +2 -1
  271. package/build/domains/registry/mcpRegistryClient.js.map +1 -1
  272. package/build/transport/http/middlewares/scopeAuthMiddleware.d.ts +3 -0
  273. package/build/transport/http/middlewares/scopeAuthMiddleware.d.ts.map +1 -1
  274. package/build/transport/http/middlewares/scopeAuthMiddleware.js +18 -28
  275. package/build/transport/http/middlewares/scopeAuthMiddleware.js.map +1 -1
  276. package/build/transport/http/middlewares/tagsExtractor.d.ts.map +1 -1
  277. package/build/transport/http/middlewares/tagsExtractor.js +46 -255
  278. package/build/transport/http/middlewares/tagsExtractor.js.map +1 -1
  279. package/build/transport/http/routes/cliTokenRoute.d.ts.map +1 -1
  280. package/build/transport/http/routes/cliTokenRoute.js +20 -14
  281. package/build/transport/http/routes/cliTokenRoute.js.map +1 -1
  282. package/build/transport/http/routes/inspectRequestContext.d.ts +5 -0
  283. package/build/transport/http/routes/inspectRequestContext.d.ts.map +1 -0
  284. package/build/transport/http/routes/inspectRequestContext.js +59 -0
  285. package/build/transport/http/routes/inspectRequestContext.js.map +1 -0
  286. package/build/transport/http/routes/inspectRoutes.d.ts +3 -3
  287. package/build/transport/http/routes/inspectRoutes.d.ts.map +1 -1
  288. package/build/transport/http/routes/inspectRoutes.js +60 -83
  289. package/build/transport/http/routes/inspectRoutes.js.map +1 -1
  290. package/build/transport/http/routes/oauthRoutes.d.ts.map +1 -1
  291. package/build/transport/http/routes/oauthRoutes.js +99 -223
  292. package/build/transport/http/routes/oauthRoutes.js.map +1 -1
  293. package/build/transport/http/routes/streamableHttpRoutes.d.ts +2 -2
  294. package/build/transport/http/routes/streamableHttpRoutes.d.ts.map +1 -1
  295. package/build/transport/http/routes/streamableHttpRoutes.js +39 -84
  296. package/build/transport/http/routes/streamableHttpRoutes.js.map +1 -1
  297. package/build/transport/http/routes/toolRoutes.d.ts.map +1 -1
  298. package/build/transport/http/routes/toolRoutes.js +138 -39
  299. package/build/transport/http/routes/toolRoutes.js.map +1 -1
  300. package/build/transport/http/server.d.ts.map +1 -1
  301. package/build/transport/http/server.js +93 -0
  302. package/build/transport/http/server.js.map +1 -1
  303. package/build/transport/http/streamableSessionLifecycle.d.ts +90 -0
  304. package/build/transport/http/streamableSessionLifecycle.d.ts.map +1 -0
  305. package/build/transport/http/streamableSessionLifecycle.js +348 -0
  306. package/build/transport/http/streamableSessionLifecycle.js.map +1 -0
  307. package/build/transport/http/utils/contextExtractor.d.ts +1 -1
  308. package/build/transport/http/utils/contextExtractor.d.ts.map +1 -1
  309. package/build/transport/http/utils/contextExtractor.js +1 -33
  310. package/build/transport/http/utils/contextExtractor.js.map +1 -1
  311. package/build/transport/stdioProxyTransport.d.ts +1 -0
  312. package/build/transport/stdioProxyTransport.d.ts.map +1 -1
  313. package/build/transport/stdioProxyTransport.js +3 -0
  314. package/build/transport/stdioProxyTransport.js.map +1 -1
  315. package/build/transport/transportFactory.d.ts +1 -2
  316. package/build/transport/transportFactory.d.ts.map +1 -1
  317. package/build/transport/transportFactory.js +54 -4
  318. package/build/transport/transportFactory.js.map +1 -1
  319. package/build/transport/transportFactory.testSetup.d.ts +2 -0
  320. package/build/transport/transportFactory.testSetup.d.ts.map +1 -0
  321. package/build/transport/transportFactory.testSetup.js +83 -0
  322. package/build/transport/transportFactory.testSetup.js.map +1 -0
  323. package/build/utils/context/sessionIdentity.d.ts +9 -0
  324. package/build/utils/context/sessionIdentity.d.ts.map +1 -0
  325. package/build/utils/context/sessionIdentity.js +39 -0
  326. package/build/utils/context/sessionIdentity.js.map +1 -0
  327. package/build/utils/ui/interactiveSelector.d.ts +0 -25
  328. package/build/utils/ui/interactiveSelector.d.ts.map +1 -1
  329. package/build/utils/ui/interactiveSelector.js +12 -329
  330. package/build/utils/ui/interactiveSelector.js.map +1 -1
  331. package/build/utils/ui/interactiveSelectorPrompts.d.ts +7 -0
  332. package/build/utils/ui/interactiveSelectorPrompts.d.ts.map +1 -0
  333. package/build/utils/ui/interactiveSelectorPrompts.js +60 -0
  334. package/build/utils/ui/interactiveSelectorPrompts.js.map +1 -0
  335. package/build/utils/ui/interactiveSelectorQuery.d.ts +5 -0
  336. package/build/utils/ui/interactiveSelectorQuery.d.ts.map +1 -0
  337. package/build/utils/ui/interactiveSelectorQuery.js +67 -0
  338. package/build/utils/ui/interactiveSelectorQuery.js.map +1 -0
  339. package/build/utils/ui/interactiveSelectorTagUi.d.ts +7 -0
  340. package/build/utils/ui/interactiveSelectorTagUi.d.ts.map +1 -0
  341. package/build/utils/ui/interactiveSelectorTagUi.js +129 -0
  342. package/build/utils/ui/interactiveSelectorTagUi.js.map +1 -0
  343. package/package.json +2 -2
  344. package/build/transport/http/utils/sessionService.d.ts +0 -106
  345. package/build/transport/http/utils/sessionService.d.ts.map +0 -1
  346. package/build/transport/http/utils/sessionService.js +0 -342
  347. package/build/transport/http/utils/sessionService.js.map +0 -1
@@ -0,0 +1,210 @@
1
+ import { deriveLocalName, isValidServerName } from './validators/serverNameValidator.js';
2
+ export function resolveDirectInstallTarget(source) {
3
+ const fieldErrors = validateDirectSource(source);
4
+ if (Object.keys(fieldErrors).length > 0) {
5
+ return {
6
+ status: 'invalid_input',
7
+ sourceType: 'direct',
8
+ targetName: source.localName,
9
+ fieldErrors,
10
+ warnings: [],
11
+ };
12
+ }
13
+ const config = createDirectServerConfig(source);
14
+ return {
15
+ sourceType: 'direct',
16
+ targetName: source.localName,
17
+ config,
18
+ warnings: [],
19
+ metadata: {
20
+ localName: source.localName,
21
+ },
22
+ };
23
+ }
24
+ export function resolveRegistryInstallTarget(source, registryServer) {
25
+ const endpoint = selectRegistryEndpoint(registryServer);
26
+ if (!endpoint) {
27
+ return {
28
+ status: 'invalid_input',
29
+ sourceType: 'registry',
30
+ registryId: source.registryId,
31
+ fieldErrors: {
32
+ registryId: [`No compatible installation endpoint found for ${source.registryId}`],
33
+ },
34
+ warnings: [],
35
+ };
36
+ }
37
+ const targetName = source.localName ?? deriveLocalName(source.registryId);
38
+ if (!isValidServerName(targetName)) {
39
+ return {
40
+ status: 'invalid_input',
41
+ sourceType: 'registry',
42
+ registryId: source.registryId,
43
+ targetName,
44
+ fieldErrors: {
45
+ localName: [`Local server name '${targetName}' is invalid`],
46
+ },
47
+ warnings: [],
48
+ };
49
+ }
50
+ const config = createRegistryServerConfig({
51
+ endpoint,
52
+ registryId: source.registryId,
53
+ targetName,
54
+ tags: source.tags,
55
+ env: source.env,
56
+ args: source.args,
57
+ });
58
+ return {
59
+ sourceType: 'registry',
60
+ targetName,
61
+ registryId: source.registryId,
62
+ version: registryServer.version,
63
+ config,
64
+ selectedEndpoint: endpoint,
65
+ warnings: [],
66
+ metadata: {
67
+ registryId: source.registryId,
68
+ localName: targetName,
69
+ version: registryServer.version,
70
+ selectedEndpoint: endpoint,
71
+ },
72
+ };
73
+ }
74
+ export function validateRegistrySource(source) {
75
+ const errors = {};
76
+ if (!source.registryId?.trim()) {
77
+ pushFieldError(errors, 'registryId', 'Registry ID is required');
78
+ }
79
+ if (source.localName && !isValidServerName(source.localName)) {
80
+ pushFieldError(errors, 'localName', `Local server name '${source.localName}' is invalid`);
81
+ }
82
+ return errors;
83
+ }
84
+ function validateDirectSource(source) {
85
+ const errors = {};
86
+ const command = resolveDirectStdioCommand(source);
87
+ if (!isValidServerName(source.localName)) {
88
+ pushFieldError(errors, 'localName', `Local server name '${source.localName}' is invalid`);
89
+ }
90
+ if (source.transport === 'stdio') {
91
+ if (!command?.trim()) {
92
+ pushFieldError(errors, 'command', 'Direct stdio installs require command');
93
+ }
94
+ if (source.url) {
95
+ pushFieldError(errors, 'url', 'Direct stdio installs cannot include url');
96
+ }
97
+ if (source.headers) {
98
+ pushFieldError(errors, 'headers', 'Direct stdio installs cannot include headers');
99
+ }
100
+ return errors;
101
+ }
102
+ if (!source.url?.trim()) {
103
+ pushFieldError(errors, 'url', `Direct ${source.transport} installs require url`);
104
+ }
105
+ if (source.command) {
106
+ pushFieldError(errors, 'command', `Direct ${source.transport} installs cannot include command`);
107
+ }
108
+ if (source.args?.length) {
109
+ pushFieldError(errors, 'args', `Direct ${source.transport} installs cannot include args`);
110
+ }
111
+ if (source.env && Object.keys(source.env).length > 0) {
112
+ pushFieldError(errors, 'env', `Direct ${source.transport} installs cannot include env`);
113
+ }
114
+ if (source.cwd) {
115
+ pushFieldError(errors, 'cwd', `Direct ${source.transport} installs cannot include cwd`);
116
+ }
117
+ return errors;
118
+ }
119
+ function createDirectServerConfig(source) {
120
+ const common = {
121
+ tags: source.tags,
122
+ timeout: source.timeout,
123
+ disabled: source.enabled === undefined ? undefined : !source.enabled,
124
+ };
125
+ if (source.transport === 'stdio') {
126
+ return omitUndefined({
127
+ ...common,
128
+ type: 'stdio',
129
+ command: resolveDirectStdioCommand(source),
130
+ args: resolveDirectStdioArgs(source),
131
+ env: source.env,
132
+ cwd: source.cwd,
133
+ restartOnExit: source.autoRestart,
134
+ maxRestarts: source.maxRestarts,
135
+ restartDelay: source.restartDelay,
136
+ });
137
+ }
138
+ return omitUndefined({
139
+ ...common,
140
+ type: source.transport,
141
+ url: source.url,
142
+ headers: source.headers,
143
+ });
144
+ }
145
+ function resolveDirectStdioCommand(source) {
146
+ if (source.command) {
147
+ return source.command;
148
+ }
149
+ return source.package ? 'npx' : undefined;
150
+ }
151
+ function resolveDirectStdioArgs(source) {
152
+ if (source.command || !source.package) {
153
+ return source.args;
154
+ }
155
+ return ['-y', source.package, ...(source.args ?? [])];
156
+ }
157
+ function selectRegistryEndpoint(registryServer) {
158
+ const packages = registryServer.packages ?? [];
159
+ if (packages.length > 0) {
160
+ const selectedPackage = packages.find((candidate) => candidate.registryType === 'npm') ?? packages[0];
161
+ return packageEndpoint(selectedPackage);
162
+ }
163
+ const remotes = registryServer.remotes ?? [];
164
+ if (remotes.length > 0) {
165
+ const selectedRemote = remotes.find((candidate) => candidate.type === 'streamable-http') ?? remotes[0];
166
+ return remoteEndpoint(selectedRemote);
167
+ }
168
+ return undefined;
169
+ }
170
+ function packageEndpoint(serverPackage) {
171
+ return {
172
+ kind: 'package',
173
+ type: serverPackage.registryType,
174
+ identifier: serverPackage.identifier,
175
+ };
176
+ }
177
+ function remoteEndpoint(remote) {
178
+ return {
179
+ kind: 'remote',
180
+ type: remote.type,
181
+ url: remote.url,
182
+ };
183
+ }
184
+ function createRegistryServerConfig(input) {
185
+ const tags = Array.from(new Set([...(input.tags ?? []), input.targetName, input.registryId]));
186
+ if (input.endpoint.kind === 'package') {
187
+ if (input.endpoint.type !== 'npm') {
188
+ throw new Error(`Unsupported package registry type for installation: ${input.endpoint.type}`);
189
+ }
190
+ return omitUndefined({
191
+ type: 'stdio',
192
+ command: 'npx',
193
+ args: ['-y', input.endpoint.identifier, ...(input.args ?? [])],
194
+ env: input.env,
195
+ tags,
196
+ });
197
+ }
198
+ return omitUndefined({
199
+ type: input.endpoint.type === 'sse' ? 'sse' : 'http',
200
+ url: input.endpoint.url,
201
+ tags,
202
+ });
203
+ }
204
+ function pushFieldError(errors, field, message) {
205
+ errors[field] = [...(errors[field] ?? []), message];
206
+ }
207
+ function omitUndefined(input) {
208
+ return Object.fromEntries(Object.entries(input).filter(([, value]) => value !== undefined));
209
+ }
210
+ //# sourceMappingURL=serverInstallationSourceResolution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serverInstallationSourceResolution.js","sourceRoot":"","sources":["../../../src/domains/installation/serverInstallationSourceResolution.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAEzF,MAAM,UAAU,0BAA0B,CAAC,MAAgC;IACzE,MAAM,WAAW,GAAG,oBAAoB,CAAC,MAAM,CAAC,CAAC;IACjD,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxC,OAAO;YACL,MAAM,EAAE,eAAe;YACvB,UAAU,EAAE,QAAQ;YACpB,UAAU,EAAE,MAAM,CAAC,SAAS;YAC5B,WAAW;YACX,QAAQ,EAAE,EAAE;SACb,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAG,wBAAwB,CAAC,MAAM,CAAC,CAAC;IAChD,O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eResult, ConfiguredServerTargetRef } from '../../domains/config-change/configChange.js';
3
+ import type { RegistryServer } from '../../domains/registry/types.js';
4
+ export type ServerInstallationWorkflowMode = 'preview' | 'apply';
5
+ export type ServerInstallationWorkflowSourceType = 'registry' | 'direct';
6
+ export type DirectInstallTransport = 'stdio' | 'http' | 'sse';
7
+ export type ServerInstallationWorkflowStatus = 'preview' | 'applied' | 'exists' | 'template_conflict' | 'invalid_input' | 'not_found' | 'registry_unavailable' | 'failed';
8
+ export interface RegistryInstallationSource {
9
+ type: 'registry';
10
+ registryId: string;
11
+ version?: string;
12
+ localName?: string;
13
+ tags?: string[];
14
+ env?: Record<string, string>;
15
+ args?: string[];
16
+ }
17
+ export interface DirectInstallationSource {
18
+ type: 'direct';
19
+ localName: string;
20
+ transport: DirectInstallTransport;
21
+ command?: string;
22
+ url?: string;
23
+ args?: string[];
24
+ env?: Record<string, string>;
25
+ headers?: Record<string, string>;
26
+ tags?: string[];
27
+ timeout?: number;
28
+ enabled?: boolean;
29
+ cwd?: string;
30
+ autoRestart?: boolean;
31
+ maxRestarts?: number;
32
+ restartDelay?: number;
33
+ package?: string;
34
+ }
35
+ export type ServerInstallationWorkflowSource = RegistryInstallationSource | DirectInstallationSource;
36
+ export interface ServerInstallationWorkflowInput {
37
+ mode: ServerInstallationWorkflowMode;
38
+ source: ServerInstallationWorkflowSource;
39
+ force?: boolean;
40
+ backup?: ConfigBackupPolicy;
41
+ }
42
+ export type SelectedRegistryEndpoint = {
43
+ kind: 'package';
44
+ type: string;
45
+ identifier: string;
46
+ } | {
47
+ kind: 'remote';
48
+ type: string;
49
+ url: string;
50
+ };
51
+ export interface ServerInstallationMetadata {
52
+ registryId?: string;
53
+ localName: string;
54
+ version?: string;
55
+ selectedEndpoint?: SelectedRegistryEndpoint;
56
+ }
57
+ export interface ServerInstallationWorkflowResult {
58
+ status: ServerInstallationWorkflowStatus;
59
+ mode: ServerInstallationWorkflowMode;
60
+ sourceType: ServerInstallationWorkflowSourceType;
61
+ targetName?: string;
62
+ registryId?: string;
63
+ version?: string;
64
+ config?: MCPServerParams;
65
+ selectedEndpoint?: SelectedRegistryEndpoint;
66
+ metadata?: ServerInstallationMetadata;
67
+ configChange?: ConfigChangeResult;
68
+ warnings: string[];
69
+ fieldErrors?: Record<string, string[]>;
70
+ error?: string;
71
+ }
72
+ export interface ServerInstallationWorkflowPorts {
73
+ getRegistryServer?: (registryId: string, version?: string) => Promise<RegistryServer | null>;
74
+ findConfiguredTarget?: (targetName: string) => ConfiguredServerTargetRef | null;
75
+ applyConfigChange?: (input: {
76
+ targetName: string;
77
+ serverConfig: MCPServerParams;
78
+ operation: 'install';
79
+ backup: ConfigBackupPolicy;
80
+ }) => Promise<ConfigChangeResult>;
81
+ }
82
+ export interface ServerInstallationWorkflow {
83
+ run(input: ServerInstallationWorkflowInput): Promise<ServerInstallationWorkflowResult>;
84
+ }
85
+ export interface ResolvedInstallTarget {
86
+ sourceType: ServerInstallationWorkflowSourceType;
87
+ targetName: string;
88
+ registryId?: string;
89
+ version?: string;
90
+ config: MCPServerParams;
91
+ selectedEndpoint?: SelectedRegistryEndpoint;
92
+ warnings: string[];
93
+ metadata: ServerInstallationMetadata;
94
+ }
95
+ export interface InvalidResolvedInstallTarget {
96
+ status: 'invalid_input' | 'not_found' | 'registry_unavailable';
97
+ sourceType: ServerInstallationWorkflowSourceType;
98
+ registryId?: string;
99
+ targetName?: string;
100
+ fieldErrors?: Record<string, string[]>;
101
+ error?: string;
102
+ warnings: string[];
103
+ }
104
+ export type TargetResolution = ResolvedInstallTarget | InvalidResolvedInstallTarget;
105
+ //# sourceMappingURL=serverInstallationTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serverInstallationTypes.d.ts","sourceRoot":"","sources":["../../../src/domains/installation/serverInstallationTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EACV,kBAAkB,EAClB,kBAAk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,EAAE,CAAC,CAAC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,MAAM,gBAAgB,GAAG,qBAAqB,GAAG,4BAA4B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=serverInstallationTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serverInstallationTypes.js","sourceRoot":"","sources":["../../../src/domains/installation/serverInstallationTypes.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { ServerInstallationWorkflow, ServerInstallationWorkflowPorts } from './serverInstallationTypes.js';
2
+ export type { DirectInstallationSource, DirectInstallTransport, RegistryInstallationSource, SelectedRegistryEndpoint, ServerInstallationMetadata, ServerInstallationWorkflow, ServerInstallationWorkflowInput, ServerInstallationWorkflowMode, ServerInstallationWorkflowPorts, ServerInstallationWorkflowResult, ServerInstallationWorkflowSource, ServerInstallationWorkflowSourceType, ServerInstallationWorkflowStatus, } from './serverInstallationTypes.js';
3
+ export declare function createServerInstallationWorkflow(ports?: ServerInstallationWorkflowPorts): ServerInstallationWorkflow;
4
+ //# sourceMappingURL=serverInstallationWorkflow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serverInstallationWorkflow.d.ts","sourceRoot":"","sources":["../../../src/domains/installation/serverInstallationWorkflow.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAGV,0BAA0B,EAG1B,+BAA+B,EAIhC,MAAM,8BAA8B,CAAC;AAEtC,YAAY,EACV,wBAAwB,EACxB,sBAAsB,EACtB,0BAA0B,EAC1B,wBAAwB,EACxB,0BAA0B,EAC1B,0BAA0B,EAC1B,+BAA+B,EAC/B,8BAA8B,EAC9B,+BAA+B,EAC/B,gCAAgC,EAChC,gCAAgC,EAChC,oCAAoC,EACpC,gCAAgC,GACjC,MAAM,8BAA8B,CAAC;AAEtC,wBAAgB,gCAAgC,CAC9C,KAAK,GAAE,+BAAoC,GAC1C,0BAA0B,CAE5B"}
@@ -0,0 +1,148 @@
1
+ import { resolveServerTarget } from '../../commands/mcp/utils/mcpServerConfig.js';
2
+ import { createConfigChangeService, } from '../../domains/config-change/configChange.js';
3
+ import { createRegistryClient } from '../../domains/registry/mcpRegistryClient.js';
4
+ import { resolveDirectInstallTarget, resolveRegistryInstallTarget, validateRegistrySource, } from './serverInstallationSourceResolution.js';
5
+ export function createServerInstallationWorkflow(ports = {}) {
6
+ return new DefaultServerInstallationWorkflow(ports);
7
+ }
8
+ class DefaultServerInstallationWorkflow {
9
+ ports;
10
+ constructor(ports) {
11
+ this.ports = ports;
12
+ }
13
+ async run(input) {
14
+ const resolved = await this.resolveInstallTarget(input.source);
15
+ if (!isResolvedTarget(resolved)) {
16
+ return {
17
+ status: resolved.status,
18
+ mode: input.mode,
19
+ sourceType: resolved.sourceType,
20
+ targetName: resolved.targetName,
21
+ registryId: resolved.registryId,
22
+ warnings: resolved.warnings,
23
+ fieldErrors: resolved.fieldErrors,
24
+ error: resolved.error,
25
+ };
26
+ }
27
+ const conflict = this.findConfiguredTarget(resolved.targetName);
28
+ if (conflict?.source === 'mcpTemplates') {
29
+ return {
30
+ ...resultFromResolved(input.mode, resolved),
31
+ status: 'template_conflict',
32
+ error: `Configured server target '${resolved.targetName}' exists in mcpTemplates and cannot be replaced by install`,
33
+ };
34
+ }
35
+ if (conflict?.source === 'mcpServers' && !input.force) {
36
+ return {
37
+ ...resultFromResolved(input.mode, resolved),
38
+ status: 'exists',
39
+ error: `Server '${resolved.targetName}' already exists. Use force to replace it.`,
40
+ };
41
+ }
42
+ if (input.mode === 'preview') {
43
+ return {
44
+ ...resultFromResolved(input.mode, resolved),
45
+ status: 'preview',
46
+ };
47
+ }
48
+ const backup = input.backup ?? (conflict?.source === 'mcpServers' ? 'required' : 'skip');
49
+ const configChange = await this.applyConfigChange({
50
+ targetName: resolved.targetName,
51
+ serverConfig: resolved.config,
52
+ operation: 'install',
53
+ backup,
54
+ });
55
+ if (configChange.status === 'changed') {
56
+ return {
57
+ ...resultFromResolved(input.mode, resolved),
58
+ status: 'applied',
59
+ configChange,
60
+ warnings: [...resolved.warnings, ...configChange.warnings],
61
+ };
62
+ }
63
+ return {
64
+ ...resultFromResolved(input.mode, resolved),
65
+ status: configChange.status === 'template_conflict' ? 'template_conflict' : 'failed',
66
+ configChange,
67
+ warnings: [...resolved.warnings, ...configChange.warnings],
68
+ error: configChange.error ?? `Config Change returned ${configChange.status}`,
69
+ };
70
+ }
71
+ async resolveInstallTarget(source) {
72
+ if (source.type === 'direct') {
73
+ return resolveDirectInstallTarget(source);
74
+ }
75
+ return this.resolveRegistryInstallTarget(source);
76
+ }
77
+ async resolveRegistryInstallTarget(source) {
78
+ const fieldErrors = validateRegistrySource(source);
79
+ if (Object.keys(fieldErrors).length > 0) {
80
+ return {
81
+ status: 'invalid_input',
82
+ sourceType: 'registry',
83
+ registryId: source.registryId,
84
+ fieldErrors,
85
+ warnings: [],
86
+ };
87
+ }
88
+ let registryServer;
89
+ try {
90
+ registryServer = await this.getRegistryServer(source.registryId, source.version);
91
+ }
92
+ catch (error) {
93
+ return {
94
+ status: 'registry_unavailable',
95
+ sourceType: 'registry',
96
+ registryId: source.registryId,
97
+ warnings: [],
98
+ error: error instanceof Error ? error.message : String(error),
99
+ };
100
+ }
101
+ if (!registryServer) {
102
+ return {
103
+ status: 'not_found',
104
+ sourceType: 'registry',
105
+ registryId: source.registryId,
106
+ warnings: [],
107
+ error: `Server '${source.registryId}' not found in registry`,
108
+ };
109
+ }
110
+ return resolveRegistryInstallTarget(source, registryServer);
111
+ }
112
+ async getRegistryServer(registryId, version) {
113
+ if (this.ports.getRegistryServer) {
114
+ return this.ports.getRegistryServer(registryId, version);
115
+ }
116
+ return createRegistryClient().getServerById(registryId, version);
117
+ }
118
+ findConfiguredTarget(targetName) {
119
+ if (this.ports.findConfiguredTarget) {
120
+ return this.ports.findConfiguredTarget(targetName);
121
+ }
122
+ const target = resolveServerTarget(targetName);
123
+ return target ? { name: target.serverName, source: target.source } : null;
124
+ }
125
+ applyConfigChange(input) {
126
+ if (this.ports.applyConfigChange) {
127
+ return this.ports.applyConfigChange(input);
128
+ }
129
+ return createConfigChangeService().setStaticConfiguredServerTarget(input);
130
+ }
131
+ }
132
+ function resultFromResolved(mode, resolved) {
133
+ return {
134
+ mode,
135
+ sourceType: resolved.sourceType,
136
+ targetName: resolved.targetName,
137
+ registryId: resolved.registryId,
138
+ version: resolved.version,
139
+ config: resolved.config,
140
+ selectedEndpoint: resolved.selectedEndpoint,
141
+ metadata: resolved.metadata,
142
+ warnings: resolved.warnings,
143
+ };
144
+ }
145
+ function isResolvedTarget(resolved) {
146
+ return !('status' in resolved);
147
+ }
148
+ //# sourceMappingURL=serverInstallationWorkflow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serverInstallationWorkflow.js","sourceRoot":"","sources":["../../../src/domains/installation/serverInstallationWorkflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AAEjF,OAAO,EAIL,yBAAyB,GAC1B,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAGlF,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,EAC5B,sBAAsB,GACvB,MAAM,yCAAyC,CAAC;AA6BjD,MAAM,UAAU,gCAAgC,CAC9C,QAAyC,EAAE;IAE3C,OAAO,IAAI,iCAAiC,CAAC,KAAK,CAAC,CAAC;AACtD,CAAC;AAED,MAAM,iCAAiC;IACR;IAA7B,YAA6B,KAAsC;QAAtC,UAAK,GAAL,KAAK,CAAiC;IAAG,CAAC;IAEvE,KAAK,CAAC,GAAG,CAAC,KAAsC;QAC9C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC/D,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,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53
  */
54
54
  private savePresets;
55
- /**
56
- * Ensure config directory exists
57
- */
58
- private ensureConfigDirectory;
59
55
  /**
60
56
  * Start watching preset file for changes
61
57
  */
@@ -1 +1 @@
1
- {"version":3,"file":"presetManager.d.ts","sourceRoot":"","sources":["../../../../src/domains/preset/manager/presetManager.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,YAAY,EACZ,cAAc,EAEd,sBAAsB,EACvB,MAAM,0CAA0C,CAAC;AAGlD;;;GAGG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAA8B;IACrD,OAAO,CAAC,OAAO,CAAwC;IACvD,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,OAAO,CAA0B;IACzC,OAAO,CAAC,aAAa,CAA8C;IACnE,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAO;IACtC,OAAO,CAAC,qBAAqB,CAAyD;IACtF,OAAO,CAAC,eAAe,CAAC,CAAS;IACjC,OAAO,CAAC,cAAc,CAAgE;IAEtF,OAAO;WAOO,WAAW,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,aAAa;IAOlE;;OAEG;WACW,aAAa,IAAI,IAAI;IASnC;;OAEG;IACU,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAcxC;;OAEG;IACI,cAAc,CAAC,QAAQ,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAI5E;;OAEG;IACI,eAAe,CAAC,QAAQ,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAI7E;;;OAGG;IACU,yBAAyB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIvD;;OAEG;YACW,WAAW;IAgDzB;;OAEG;YACW,sBAAsB;IA4FpC;;OAEG;YACW,wBAAwB;IAmBtC;;OAEG;YACW,WAAW;IAuBzB;;OAEG;YACW,qBAAqB;IAgBnC;;OAEG;YACW,aAAa;IAmC3B;;OAEG;IACU,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAgDrC;;OAEG;IACU,UAAU,CACrB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,GAAG,cAAc,CAAC,GAC9D,OAAO,CAAC,IAAI,CAAC;IA6BhB;;OAEG;IACI,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI;IAInD;;OAEG;IACI,aAAa,IAAI,cAAc,EAAE;IASxC;;OAEG;IACU,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAYzD;;OAEG;IACU,cAAc,CACzB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,GAAG,cAAc,CAAC,GAC9D,OAAO,CAAC,sBAAsB,CAAC;IA8ClC;;OAEG;IACI,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IA2B7D;;OAEG;IACU,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,EAAE,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAuDrF;;OAEG;YACW,kBAAkB;IAchC;;OAEG;IACI,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIvC;;OAEG;IACI,cAAc,IAAI,MAAM,EAAE;IAIjC;;OAEG;IACI,aAAa,IAAI,MAAM;CAG/B"}
1
+ {"version":3,"file":"presetManager.d.ts","sourceRoot":"","sources":["../../../../src/domains/preset/manager/presetManager.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,YAAY,EACZ,cAAc,EAEd,sBAAsB,EACvB,MAAM,0CAA0C,CAAC;AAQlD;;;GAGG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAA8B;IACrD,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